E int FDECL(sgn, (int));
E int FDECL(rounddiv, (long,int));
E int FDECL(dist2, (int,int,int,int));
+E int FDECL(isqrt, (int));
E int FDECL(distmin, (int,int,int,int));
E boolean FDECL(online2, (int,int,int,int));
E boolean FDECL(pmatch, (const char *,const char *));
E void FDECL(mktrap, (int,int,struct mkroom *,coord*));
E void FDECL(mkstairs, (XCHAR_P,XCHAR_P,CHAR_P,struct mkroom *));
E void NDECL(mkinvokearea);
-E void FDECL(mineralize, (int, int, int, int, boolean));
+E void FDECL(mineralize, (int, int, int, int, BOOLEAN_P));
/* ### mkmap.c ### */
return dx * dx + dy * dy;
}
+/* Integer square root function without using floating point.
+ * This could be replaced by a faster algorithm, but has not been because:
+ * + the simple algorithm is easy to read
+ * + this algorithm does not require 64-bit support
+ * + in current usage, the values passed to isqrt() are not really that
+ * large, so the performance difference is negligible
+ * + isqrt() is used in only few places, which are not bottle-necks
+ */
int
isqrt(val)
int val;
if (mtmp) {
x = mtmp->mx, y = mtmp->my; /* sanity precaution */
+ m->x = x, m->y = y;
/* handle specific attributes for some special monsters */
if (m->name.str) mtmp = christen_monst(mtmp, m->name.str);
{
boolean okroom;
struct mkroom *aroom;
- short i;
xchar rtype = (!r->chance || rn2(100) < r->chance) ? r->rtype : OROOM;
if(mkr) {
spo_room(coder)
struct sp_coder *coder;
{
- int isbigrm = FALSE;
if (coder->n_subroom > MAX_NESTED_ROOMS)
panic("Too deeply nested rooms?!");
else {
/*tmproom.irregular = (OV_i(flags) & (1 << 1));*/
tmproom.joined = !(OV_i(flags) & (1 << 2));
- isbigrm = ((tmproom.w * tmproom.h) > 20);
-
opvar_free(x);
opvar_free(y);
opvar_free(w);
struct opvar *mpxs, *mpys, *mpmap, *mpa, *mpkeepr, *mpzalign;
xchar halign, valign;
xchar tmpxstart, tmpystart, tmpxsize, tmpysize;
- int tryct = 0;
unpacked_coord upc;
if (!OV_pop_i(mpxs) ||
!OV_pop_i(mpzalign) ||
!OV_pop_c(mpa)) return;
-redo_maploc:
-
tmpmazepart.xsize = OV_i(mpxs);
tmpmazepart.ysize = OV_i(mpys);
tmpmazepart.zaligntyp = OV_i(mpzalign);
xsize = tmpxsize; ysize = tmpysize;
}
-skipmap:
opvar_free(mpxs);
opvar_free(mpys);
opvar_free(mpmap);
STATIC_DCL void NDECL(cast_protection);
STATIC_DCL void FDECL(spell_backfire, (int));
STATIC_DCL const char *FDECL(spelltypemnemonic, (int));
-STATIC_DCL int FDECL(isqrt, (int));
/* The roles[] table lists the role-specific values for tuning
* percent_success().
return FALSE;
}
-/* Integer square root function without using floating point.
- * This could be replaced by a faster algorithm, but has not been because:
- * + the simple algorithm is easy to read
- * + this algorithm does not require 64-bit support
- * + in current usage, the values passed to isqrt() are not really that
- * large, so the performance difference is negligible
- * + isqrt() is used in only one place
- * + that one place is not a bottle-neck
- */
-STATIC_OVL int
-isqrt(val)
-int val;
-{
- int rt = 0;
- int odd = 1;
- while(val >= odd) {
- val = val-odd;
- odd = odd+2;
- rt = rt + 1;
- }
- return rt;
-}
-
STATIC_OVL int
percent_success(spell)
int spell;