change xchar to other typedefs

One of the drivers of this change was that screen coordinates require a
type that can hold values greater than 127. Parameters to the window
port routines require a large type in order to be able to have values
a fair bit larger than COLNO and ROWNO passed to them, particularly for
their use to the right of the map window.

This splits the uses of xchar into 3 different situations, and adjusts
their type and size:

                        xchar
                          |
               -----------------------
               |          |          |
            coordxy     xint16     xint8

coordxy: Actual x or y coordinates for various things (moved to 16-bits).

xint16:  Same data size as coordxy, but for non-coordinate use (16-bits).

xint8:   There are only a few use cases initially, where it was very
         plain to see that the variable could remain as 8-bits, rather
         than be bumped to 16-bits.  There are probably more such cases
         that could be changed after additional review.

Note: This first changed all xchar variables to coordxy. Some were
reviewed and got changed to xint16 or xint8 when it became apparent that
their usage was not for coordinates.

This increments EDITLEVEL in patchlevel.h
This commit is contained in:
nhmall
2022-06-30 23:48:18 -04:00
parent 751b6e646f
commit 30b557f7d5
104 changed files with 1016 additions and 996 deletions
+2 -2
View File
@@ -70,7 +70,7 @@ struct engrave_info {
the possible mutations of this */ the possible mutations of this */
char *nextc; /* next character(s) in text[] to engrave */ char *nextc; /* next character(s) in text[] to engrave */
struct obj *stylus; /* object doing the writing */ struct obj *stylus; /* object doing the writing */
xchar type; /* type of engraving (DUST, MARK, etc) */ xint8 type; /* type of engraving (DUST, MARK, etc) */
coord pos; /* location the engraving is being placed on */ coord pos; /* location the engraving is being placed on */
int actionct; /* nth turn spent engraving */ int actionct; /* nth turn spent engraving */
}; };
@@ -104,7 +104,7 @@ struct tribute_info {
struct novel_tracking { /* for choosing random passage when reading novel */ struct novel_tracking { /* for choosing random passage when reading novel */
unsigned id; /* novel oid from previous passage selection */ unsigned id; /* novel oid from previous passage selection */
int count; /* number of passage indices available in pasg[] */ int count; /* number of passage indices available in pasg[] */
xchar pasg[30]; /* pasg[0..count-1] are passage indices */ xint8 pasg[30]; /* pasg[0..count-1] are passage indices */
/* tribute file is allowed to have more than 30 passages for a novel; /* tribute file is allowed to have more than 30 passages for a novel;
if it does, reading will first choose a random subset of 30 of them; if it does, reading will first choose a random subset of 30 of them;
reading all 30 or switching to a different novel and then back again reading all 30 or switching to a different novel and then back again
+1 -1
View File
@@ -7,7 +7,7 @@
#define COORD_H #define COORD_H
typedef struct nhcoord { typedef struct nhcoord {
xchar x, y; coordxy x, y;
} coord; } coord;
#endif /* COORD_H */ #endif /* COORD_H */
+23 -23
View File
@@ -32,9 +32,9 @@ struct dgn_topology { /* special dungeon levels for speed */
d_level d_fire_level; d_level d_fire_level;
d_level d_air_level; d_level d_air_level;
d_level d_astral_level; d_level d_astral_level;
xchar d_tower_dnum; xint16 d_tower_dnum;
xchar d_sokoban_dnum; xint16 d_sokoban_dnum;
xchar d_mines_dnum, d_quest_dnum; xint16 d_mines_dnum, d_quest_dnum;
d_level d_qstart_level, d_qlocate_level, d_nemesis_level; d_level d_qstart_level, d_qlocate_level, d_nemesis_level;
d_level d_knox_level; d_level d_knox_level;
d_level d_mineend_level; d_level d_mineend_level;
@@ -410,7 +410,7 @@ struct autopickup_exception {
}; };
struct plinemsg_type { struct plinemsg_type {
xchar msgtype; /* one of MSGTYP_foo */ xint16 msgtype; /* one of MSGTYP_foo */
struct nhregex *regex; struct nhregex *regex;
char *pattern; char *pattern;
struct plinemsg_type *next; struct plinemsg_type *next;
@@ -545,7 +545,7 @@ struct xlock_s {
struct trapinfo { struct trapinfo {
struct obj *tobj; struct obj *tobj;
xchar tx, ty; coordxy tx, ty;
int time_needed; int time_needed;
boolean force_bungle; boolean force_bungle;
}; };
@@ -564,8 +564,8 @@ enum vanq_order_modes {
}; };
struct rogueroom { struct rogueroom {
xchar rlx, rly; coordxy rlx, rly;
xchar dx, dy; coordxy dx, dy;
boolean real; boolean real;
uchar doortable; uchar doortable;
int nroom; /* Only meaningful for "real" rooms */ int nroom; /* Only meaningful for "real" rooms */
@@ -573,7 +573,7 @@ struct rogueroom {
typedef struct ls_t { typedef struct ls_t {
struct ls_t *next; struct ls_t *next;
xchar x, y; /* source's position */ coordxy x, y; /* source's position */
short range; /* source's current range */ short range; /* source's current range */
short flags; short flags;
short type; /* type of light source */ short type; /* type of light source */
@@ -582,7 +582,7 @@ typedef struct ls_t {
struct container { struct container {
struct container *next; struct container *next;
xchar x, y; coordxy x, y;
short what; short what;
genericptr_t list; genericptr_t list;
}; };
@@ -597,7 +597,7 @@ enum bubble_contains_types {
#define MAX_BMASK 4 #define MAX_BMASK 4
struct bubble { struct bubble {
xchar x, y; /* coordinates of the upper left corner */ coordxy x, y; /* coordinates of the upper left corner */
schar dx, dy; /* the general direction of the bubble's movement */ schar dx, dy; /* the general direction of the bubble's movement */
uchar bm[MAX_BMASK + 2]; /* bubble bit mask */ uchar bm[MAX_BMASK + 2]; /* bubble bit mask */
struct bubble *prev, *next; /* need to traverse the list up and down */ struct bubble *prev, *next; /* need to traverse the list up and down */
@@ -621,7 +621,7 @@ struct h2o_ctx {
struct launchplace { struct launchplace {
struct obj *obj; struct obj *obj;
xchar x, y; coordxy x, y;
}; };
struct repo { /* repossession context */ struct repo { /* repossession context */
@@ -862,8 +862,8 @@ struct instance_globals {
/* display.c */ /* display.c */
gbuf_entry gbuf[ROWNO][COLNO]; gbuf_entry gbuf[ROWNO][COLNO];
xchar gbuf_start[ROWNO]; coordxy gbuf_start[ROWNO];
xchar gbuf_stop[ROWNO]; coordxy gbuf_stop[ROWNO];
/* do.c */ /* do.c */
@@ -884,9 +884,9 @@ struct instance_globals {
/* dog.c */ /* dog.c */
int petname_used; /* user preferred pet name has been used */ int petname_used; /* user preferred pet name has been used */
xchar gtyp; /* type of dog's current goal */ xint16 gtyp; /* type of dog's current goal */
xchar gx; /* x position of dog's current goal */ coordxy gx; /* x position of dog's current goal */
xchar gy; /* y position of dog's current goal */ coordxy gy; /* y position of dog's current goal */
char dogname[PL_PSIZ]; char dogname[PL_PSIZ];
char catname[PL_PSIZ]; char catname[PL_PSIZ];
char horsename[PL_PSIZ]; char horsename[PL_PSIZ];
@@ -1000,8 +1000,8 @@ struct instance_globals {
/* mklev.c */ /* mklev.c */
genericptr_t luathemes[MAXDUNGEON]; genericptr_t luathemes[MAXDUNGEON];
xchar vault_x; coordxy vault_x;
xchar vault_y; coordxy vault_y;
boolean made_branch; /* used only during level creation */ boolean made_branch; /* used only during level creation */
/* mkmap.c */ /* mkmap.c */
@@ -1202,8 +1202,8 @@ struct instance_globals {
lev_region *lregions; lev_region *lregions;
int num_lregions; int num_lregions;
struct sp_coder *coder; struct sp_coder *coder;
xchar xstart, ystart; coordxy xstart, ystart;
xchar xsize, ysize; coordxy xsize, ysize;
boolean in_mk_themerooms; boolean in_mk_themerooms;
boolean themeroom_failed; boolean themeroom_failed;
@@ -1248,9 +1248,9 @@ struct instance_globals {
Stormbringer's maliciousness. */ Stormbringer's maliciousness. */
/* vision.c */ /* vision.c */
xchar **viz_array; /* used in cansee() and couldsee() macros */ coordxy **viz_array; /* used in cansee() and couldsee() macros */
xchar *viz_rmin; /* min could see indices */ coordxy *viz_rmin; /* min could see indices */
xchar *viz_rmax; /* max could see indices */ coordxy *viz_rmax; /* max could see indices */
boolean vision_full_recalc; boolean vision_full_recalc;
int seethru; /* 'bubble' debugging: clouds and water don't block light */ int seethru; /* 'bubble' debugging: clouds and water don't block light */
+1 -1
View File
@@ -984,7 +984,7 @@ enum glyph_offsets {
#define MG_BADXY 0x04000 /* bad coordinates were passed */ #define MG_BADXY 0x04000 /* bad coordinates were passed */
typedef struct { typedef struct {
xchar gnew; /* perhaps move this bit into the rm structure. */ xint8 gnew; /* perhaps move this bit into the rm structure. */
glyph_info glyphinfo; glyph_info glyphinfo;
} gbuf_entry; } gbuf_entry;
+10 -10
View File
@@ -7,8 +7,8 @@
#define DUNGEON_H #define DUNGEON_H
typedef struct d_level { /* basic dungeon level element */ typedef struct d_level { /* basic dungeon level element */
xchar dnum; /* dungeon number */ xint16 dnum; /* dungeon number */
xchar dlevel; /* level number */ xint16 dlevel; /* level number */
} d_level; } d_level;
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C) #if !defined(MAKEDEFS_C) && !defined(MDLIB_C)
@@ -32,7 +32,7 @@ typedef struct s_level { /* special dungeon level element */
} s_level; } s_level;
typedef struct stairway { /* basic stairway identifier */ typedef struct stairway { /* basic stairway identifier */
xchar sx, sy; /* x / y location of the stair */ coordxy sx, sy; /* x / y location of the stair */
d_level tolev; /* where does it go */ d_level tolev; /* where does it go */
boolean up; /* up or down? */ boolean up; /* up or down? */
boolean isladder; /* ladder or stairway? */ boolean isladder; /* ladder or stairway? */
@@ -52,10 +52,10 @@ enum level_region_types {
}; };
typedef struct dest_area { /* non-stairway level change identifier */ typedef struct dest_area { /* non-stairway level change identifier */
xchar lx, ly; /* "lower" left corner (near [0,0]) */ coordxy lx, ly; /* "lower" left corner (near [0,0]) */
xchar hx, hy; /* "upper" right corner (near [COLNO,ROWNO]) */ coordxy hx, hy; /* "upper" right corner (near [COLNO,ROWNO]) */
xchar nlx, nly; /* outline of invalid area */ coordxy nlx, nly; /* outline of invalid area */
xchar nhx, nhy; /* opposite corner of invalid area */ coordxy nhx, nhy; /* opposite corner of invalid area */
} dest_area; } dest_area;
typedef struct dungeon { /* basic dungeon identifier */ typedef struct dungeon { /* basic dungeon identifier */
@@ -65,9 +65,9 @@ typedef struct dungeon { /* basic dungeon identifier */
char themerms[15]; /* lua file name containing themed rooms */ char themerms[15]; /* lua file name containing themed rooms */
char boneid; /* character to id dungeon in bones files */ char boneid; /* character to id dungeon in bones files */
d_flags flags; /* dungeon flags */ d_flags flags; /* dungeon flags */
xchar entry_lev; /* entry level */ xint16 entry_lev; /* entry level */
xchar num_dunlevs; /* number of levels in this dungeon */ xint16 num_dunlevs; /* number of levels in this dungeon */
xchar dunlev_ureached; /* how deep you have been in this dungeon */ xint16 dunlev_ureached; /* how deep you have been in this dungeon */
int ledger_start, /* the starting depth in "real" terms */ int ledger_start, /* the starting depth in "real" terms */
depth_start; /* the starting depth in "logical" terms */ depth_start; /* the starting depth in "logical" terms */
} dungeon; } dungeon;
+2 -2
View File
@@ -9,10 +9,10 @@
struct engr { struct engr {
struct engr *nxt_engr; struct engr *nxt_engr;
char *engr_txt; char *engr_txt;
xchar engr_x, engr_y; coordxy engr_x, engr_y;
unsigned engr_lth; /* for save & restore; not length of text */ unsigned engr_lth; /* for save & restore; not length of text */
long engr_time; /* moment engraving was (will be) finished */ long engr_time; /* moment engraving was (will be) finished */
xchar engr_type; xint8 engr_type;
#define DUST 1 #define DUST 1
#define ENGRAVE 2 #define ENGRAVE 2
#define BURN 3 #define BURN 3
+141 -141
View File
@@ -46,8 +46,8 @@ extern boolean leashable(struct monst *);
extern boolean next_to_u(void); extern boolean next_to_u(void);
extern struct obj *get_mleash(struct monst *); extern struct obj *get_mleash(struct monst *);
extern const char *beautiful(void); extern const char *beautiful(void);
extern void check_leash(xchar, xchar); extern void check_leash(coordxy, coordxy);
extern boolean um_dist(xchar, xchar, xchar); extern boolean um_dist(coordxy, coordxy, xint16);
extern boolean snuff_candle(struct obj *); extern boolean snuff_candle(struct obj *);
extern boolean snuff_lit(struct obj *); extern boolean snuff_lit(struct obj *);
extern boolean splash_lit(struct obj *); extern boolean splash_lit(struct obj *);
@@ -87,8 +87,8 @@ extern void set_artifact_intrinsic(struct obj *, boolean, long);
extern int touch_artifact(struct obj *, struct monst *); extern int touch_artifact(struct obj *, struct monst *);
extern int spec_abon(struct obj *, struct monst *); extern int spec_abon(struct obj *, struct monst *);
extern int spec_dbon(struct obj *, struct monst *, int); extern int spec_dbon(struct obj *, struct monst *, int);
extern void discover_artifact(xchar); extern void discover_artifact(xint16);
extern boolean undiscovered_artifact(xchar); extern boolean undiscovered_artifact(xint16);
extern int disp_artifact_discoveries(winid); extern int disp_artifact_discoveries(winid);
extern void dump_artifact_info(winid); extern void dump_artifact_info(winid);
extern boolean artifact_hit(struct monst *, struct monst *, struct obj *, extern boolean artifact_hit(struct monst *, struct monst *, struct obj *,
@@ -155,10 +155,10 @@ extern void lift_covet_and_placebc(int);
Lift_covet_and_placebc(x, __FUNCTION__, __LINE__) Lift_covet_and_placebc(x, __FUNCTION__, __LINE__)
#endif #endif
extern void set_bc(int); extern void set_bc(int);
extern void move_bc(int, int, xchar, xchar, xchar, xchar); extern void move_bc(int, int, coordxy, coordxy, coordxy, coordxy);
extern boolean drag_ball(xchar, xchar, int *, xchar *, xchar *, xchar *, extern boolean drag_ball(coordxy, coordxy, int *, coordxy *, coordxy *, coordxy *,
xchar *, boolean *, boolean); coordxy *, boolean *, boolean);
extern void drop_ball(xchar, xchar); extern void drop_ball(coordxy, coordxy);
extern void drag_down(void); extern void drag_down(void);
extern void bc_sanity_check(void); extern void bc_sanity_check(void);
@@ -284,7 +284,7 @@ extern int getdir(const char *);
extern void confdir(void); extern void confdir(void);
extern const char *directionname(int); extern const char *directionname(int);
extern int isok(int, int); extern int isok(int, int);
extern int get_adjacent_loc(const char *, const char *, xchar, xchar, coord *); extern int get_adjacent_loc(const char *, const char *, coordxy, coordxy, coord *);
extern const char *click_to_cmd(int, int, int); extern const char *click_to_cmd(int, int, int);
extern char get_count(const char *, char, long, cmdcount_nht *, unsigned); extern char get_count(const char *, char, long, cmdcount_nht *, unsigned);
#ifdef HANGUPHANDLING #ifdef HANGUPHANDLING
@@ -306,7 +306,7 @@ extern void free_nomakedefs(void);
/* ### dbridge.c ### */ /* ### dbridge.c ### */
extern boolean is_waterwall(xchar, xchar); extern boolean is_waterwall(coordxy, coordxy);
extern boolean is_pool(int, int); extern boolean is_pool(int, int);
extern boolean is_lava(int, int); extern boolean is_lava(int, int);
extern boolean is_pool_or_lava(int, int); extern boolean is_pool_or_lava(int, int);
@@ -357,7 +357,7 @@ extern int wiz_mgender(void);
/* ### dig.c ### */ /* ### dig.c ### */
extern int dig_typ(struct obj *, xchar, xchar); extern int dig_typ(struct obj *, coordxy, coordxy);
extern boolean is_digging(void); extern boolean is_digging(void);
extern int holetime(void); extern int holetime(void);
extern boolean dig_check(struct monst *, boolean, int, int); extern boolean dig_check(struct monst *, boolean, int, int);
@@ -367,7 +367,7 @@ extern int use_pick_axe(struct obj *);
extern int use_pick_axe2(struct obj *); extern int use_pick_axe2(struct obj *);
extern boolean mdig_tunnel(struct monst *); extern boolean mdig_tunnel(struct monst *);
extern void draft_message(boolean); extern void draft_message(boolean);
extern void watch_dig(struct monst *, xchar, xchar, boolean); extern void watch_dig(struct monst *, coordxy, coordxy, boolean);
extern void zap_dig(void); extern void zap_dig(void);
extern struct obj *bury_an_obj(struct obj *, boolean *); extern struct obj *bury_an_obj(struct obj *, boolean *);
extern void bury_objs(int, int); extern void bury_objs(int, int);
@@ -378,7 +378,7 @@ extern struct obj *buried_ball(coord *);
extern void buried_ball_to_punishment(void); extern void buried_ball_to_punishment(void);
extern void buried_ball_to_freedom(void); extern void buried_ball_to_freedom(void);
extern schar fillholetyp(int, int, boolean); extern schar fillholetyp(int, int, boolean);
extern void liquid_flow(xchar, xchar, schar, struct trap *, const char *); extern void liquid_flow(coordxy, coordxy, schar, struct trap *, const char *);
extern boolean conjoined_pits(struct trap *, struct trap *, boolean); extern boolean conjoined_pits(struct trap *, struct trap *, boolean);
#if 0 #if 0
extern void bury_monst(struct monst *); extern void bury_monst(struct monst *);
@@ -401,20 +401,20 @@ extern int see_with_infrared(struct monst *);
extern int canseemon(struct monst *); extern int canseemon(struct monst *);
extern int knowninvisible(struct monst *); extern int knowninvisible(struct monst *);
extern int is_safemon(struct monst *); extern int is_safemon(struct monst *);
extern void magic_map_background(xchar, xchar, int); extern void magic_map_background(coordxy, coordxy, int);
extern void map_background(xchar, xchar, int); extern void map_background(coordxy, coordxy, int);
extern void map_trap(struct trap *, int); extern void map_trap(struct trap *, int);
extern void map_object(struct obj *, int); extern void map_object(struct obj *, int);
extern void map_invisible(xchar, xchar); extern void map_invisible(coordxy, coordxy);
extern boolean unmap_invisible(int, int); extern boolean unmap_invisible(int, int);
extern void unmap_object(int, int); extern void unmap_object(int, int);
extern void map_location(int, int, int); extern void map_location(int, int, int);
extern boolean suppress_map_output(void); extern boolean suppress_map_output(void);
extern void feel_newsym(xchar, xchar); extern void feel_newsym(coordxy, coordxy);
extern void feel_location(xchar, xchar); extern void feel_location(coordxy, coordxy);
extern void newsym(int, int); extern void newsym(int, int);
extern void newsym_force(int, int); extern void newsym_force(int, int);
extern void shieldeff(xchar, xchar); extern void shieldeff(coordxy, coordxy);
extern void tmp_at(int, int); extern void tmp_at(int, int);
extern void flash_glyph_at(int, int, int, int); extern void flash_glyph_at(int, int, int, int);
extern void swallowed(int); extern void swallowed(int);
@@ -433,15 +433,15 @@ extern void clear_glyph_buffer(void);
extern void row_refresh(int, int, int); extern void row_refresh(int, int, int);
extern void cls(void); extern void cls(void);
extern void flush_screen(int); extern void flush_screen(int);
extern int back_to_glyph(xchar, xchar); extern int back_to_glyph(coordxy, coordxy);
extern int zapdir_to_glyph(int, int, int); extern int zapdir_to_glyph(int, int, int);
extern int glyph_at(xchar, xchar); extern int glyph_at(coordxy, coordxy);
extern void reglyph_darkroom(void); extern void reglyph_darkroom(void);
extern void xy_set_wall_state(int, int); extern void xy_set_wall_state(int, int);
extern void set_wall_state(void); extern void set_wall_state(void);
extern void unset_seenv(struct rm *, int, int, int, int); extern void unset_seenv(struct rm *, int, int, int, int);
extern int warning_of(struct monst *); extern int warning_of(struct monst *);
extern void map_glyphinfo(xchar, xchar, int, unsigned, glyph_info *); extern void map_glyphinfo(coordxy, coordxy, int, unsigned, glyph_info *);
extern void reset_glyphmap(enum glyphmap_change_triggers trigger); extern void reset_glyphmap(enum glyphmap_change_triggers trigger);
extern int fn_cmap_to_glyph(int); extern int fn_cmap_to_glyph(int);
@@ -588,14 +588,14 @@ extern boolean inaccessible_equipment(struct obj *, const char *, boolean);
extern void newedog(struct monst *); extern void newedog(struct monst *);
extern void free_edog(struct monst *); extern void free_edog(struct monst *);
extern void initedog(struct monst *); extern void initedog(struct monst *);
extern struct monst *make_familiar(struct obj *, xchar, xchar, boolean); extern struct monst *make_familiar(struct obj *, coordxy, coordxy, boolean);
extern struct monst *makedog(void); extern struct monst *makedog(void);
extern void update_mlstmv(void); extern void update_mlstmv(void);
extern void losedogs(void); extern void losedogs(void);
extern void mon_arrive(struct monst *, boolean); extern void mon_arrive(struct monst *, boolean);
extern void mon_catchup_elapsed_time(struct monst *, long); extern void mon_catchup_elapsed_time(struct monst *, long);
extern void keepdogs(boolean); extern void keepdogs(boolean);
extern void migrate_to_level(struct monst *, xchar, xchar, coord *); extern void migrate_to_level(struct monst *, coordxy, coordxy, coord *);
extern int dogfood(struct monst *, struct obj *); extern int dogfood(struct monst *, struct obj *);
extern boolean tamedog(struct monst *, struct obj *); extern boolean tamedog(struct monst *, struct obj *);
extern void abuse_dog(struct monst *); extern void abuse_dog(struct monst *);
@@ -613,13 +613,13 @@ extern void finish_meating(struct monst *);
/* ### dokick.c ### */ /* ### dokick.c ### */
extern boolean ghitm(struct monst *, struct obj *); extern boolean ghitm(struct monst *, struct obj *);
extern void container_impact_dmg(struct obj *, xchar, xchar); extern void container_impact_dmg(struct obj *, coordxy, coordxy);
extern int dokick(void); extern int dokick(void);
extern boolean ship_object(struct obj *, xchar, xchar, boolean); extern boolean ship_object(struct obj *, coordxy, coordxy, boolean);
extern void obj_delivery(boolean); extern void obj_delivery(boolean);
extern void deliver_obj_to_mon(struct monst *mtmp, int, unsigned long); extern void deliver_obj_to_mon(struct monst *mtmp, int, unsigned long);
extern schar down_gate(xchar, xchar); extern schar down_gate(coordxy, coordxy);
extern void impact_drop(struct obj *, xchar, xchar, xchar); extern void impact_drop(struct obj *, coordxy, coordxy, coordxy);
/* ### dothrow.c ### */ /* ### dothrow.c ### */
@@ -634,10 +634,10 @@ extern boolean throwing_weapon(struct obj *);
extern void throwit(struct obj *, long, boolean, struct obj *); extern void throwit(struct obj *, long, boolean, struct obj *);
extern int omon_adj(struct monst *, struct obj *, boolean); extern int omon_adj(struct monst *, struct obj *, boolean);
extern int thitmonst(struct monst *, struct obj *); extern int thitmonst(struct monst *, struct obj *);
extern int hero_breaks(struct obj *, xchar, xchar, unsigned); extern int hero_breaks(struct obj *, coordxy, coordxy, unsigned);
extern int breaks(struct obj *, xchar, xchar); extern int breaks(struct obj *, coordxy, coordxy);
extern void release_camera_demon(struct obj *, xchar, xchar); extern void release_camera_demon(struct obj *, coordxy, coordxy);
extern void breakobj(struct obj *, xchar, xchar, boolean, boolean); extern void breakobj(struct obj *, coordxy, coordxy, boolean, boolean);
extern boolean breaktest(struct obj *); extern boolean breaktest(struct obj *);
extern boolean walk_path(coord *, coord *, boolean(*)(void *, int, int), extern boolean walk_path(coord *, coord *, boolean(*)(void *, int, int),
genericptr_t); genericptr_t);
@@ -660,14 +660,14 @@ extern s_level *find_level(const char *);
extern s_level *Is_special(d_level *); extern s_level *Is_special(d_level *);
extern branch *Is_branchlev(d_level *); extern branch *Is_branchlev(d_level *);
extern boolean builds_up(d_level *); extern boolean builds_up(d_level *);
extern xchar ledger_no(d_level *); extern xint16 ledger_no(d_level *);
extern xchar maxledgerno(void); extern xint16 maxledgerno(void);
extern schar depth(d_level *); extern schar depth(d_level *);
extern xchar dunlev(d_level *); extern xint16 dunlev(d_level *);
extern xchar dunlevs_in_dungeon(d_level *); extern xint16 dunlevs_in_dungeon(d_level *);
extern xchar ledger_to_dnum(xchar); extern xint16 ledger_to_dnum(xint16);
extern xchar ledger_to_dlev(xchar); extern xint16 ledger_to_dlev(xint16);
extern xchar deepest_lev_reached(boolean); extern xint16 deepest_lev_reached(boolean);
extern boolean on_level(d_level *, d_level *); extern boolean on_level(d_level *, d_level *);
extern void next_level(boolean); extern void next_level(boolean);
extern void prev_level(boolean); extern void prev_level(boolean);
@@ -685,10 +685,10 @@ extern stairway *stairway_find_special_dir(boolean);
extern void u_on_sstairs(int); extern void u_on_sstairs(int);
extern void u_on_upstairs(void); extern void u_on_upstairs(void);
extern void u_on_dnstairs(void); extern void u_on_dnstairs(void);
extern boolean On_stairs(xchar, xchar); extern boolean On_stairs(coordxy, coordxy);
extern boolean On_ladder(xchar, xchar); extern boolean On_ladder(coordxy, coordxy);
extern boolean On_stairs_up(xchar, xchar); extern boolean On_stairs_up(coordxy, coordxy);
extern boolean On_stairs_dn(xchar, xchar); extern boolean On_stairs_dn(coordxy, coordxy);
extern void get_level(d_level *, int); extern void get_level(d_level *, int);
extern boolean Is_botlevel(d_level *); extern boolean Is_botlevel(d_level *);
extern boolean Can_fall_thru(d_level *); extern boolean Can_fall_thru(d_level *);
@@ -710,11 +710,11 @@ extern void assign_level(d_level *, d_level *);
extern void assign_rnd_level(d_level *, d_level *, int); extern void assign_rnd_level(d_level *, d_level *, int);
extern unsigned int induced_align(int); extern unsigned int induced_align(int);
extern boolean Invocation_lev(d_level *); extern boolean Invocation_lev(d_level *);
extern xchar level_difficulty(void); extern xint16 level_difficulty(void);
extern schar lev_by_name(const char *); extern schar lev_by_name(const char *);
extern boolean known_branch_stairs(stairway *); extern boolean known_branch_stairs(stairway *);
extern char *stairs_description(stairway *, char *, boolean); extern char *stairs_description(stairway *, char *, boolean);
extern schar print_dungeon(boolean, schar *, xchar *); extern schar print_dungeon(boolean, schar *, xint16 *);
extern char *get_annotation(d_level *); extern char *get_annotation(d_level *);
extern int donamelevel(void); extern int donamelevel(void);
extern int dooverview(void); extern int dooverview(void);
@@ -796,12 +796,12 @@ extern boolean can_reach_floor(boolean);
extern void cant_reach_floor(int, int, boolean, boolean); extern void cant_reach_floor(int, int, boolean, boolean);
extern const char *surface(int, int); extern const char *surface(int, int);
extern const char *ceiling(int, int); extern const char *ceiling(int, int);
extern struct engr *engr_at(xchar, xchar); extern struct engr *engr_at(coordxy, coordxy);
extern boolean sengr_at(const char *, xchar, xchar, boolean); extern boolean sengr_at(const char *, coordxy, coordxy, boolean);
extern void u_wipe_engr(int); extern void u_wipe_engr(int);
extern void wipe_engr_at(xchar, xchar, xchar, boolean); extern void wipe_engr_at(coordxy, coordxy, coordxy, boolean);
extern void read_engr_at(int, int); extern void read_engr_at(int, int);
extern void make_engr_at(int, int, const char *, long, xchar); extern void make_engr_at(int, int, const char *, long, xint16);
extern void del_engr_at(int, int); extern void del_engr_at(int, int);
extern int freehand(void); extern int freehand(void);
extern int doengrave(void); extern int doengrave(void);
@@ -918,7 +918,7 @@ extern void livelog_add(long ll_type, const char *);
extern void floating_above(const char *); extern void floating_above(const char *);
extern void dogushforth(int); extern void dogushforth(int);
extern void dryup(xchar, xchar, boolean); extern void dryup(coordxy, coordxy, boolean);
extern void drinkfountain(void); extern void drinkfountain(void);
extern void dipfountain(struct obj *); extern void dipfountain(struct obj *);
extern void breaksink(int, int); extern void breaksink(int, int);
@@ -932,13 +932,13 @@ extern anything *long_to_any(long);
extern anything *monst_to_any(struct monst *); extern anything *monst_to_any(struct monst *);
extern anything *obj_to_any(struct obj *); extern anything *obj_to_any(struct obj *);
extern boolean revive_nasty(int, int, const char *); extern boolean revive_nasty(int, int, const char *);
extern int still_chewing(xchar, xchar); extern int still_chewing(coordxy, coordxy);
extern void movobj(struct obj *, xchar, xchar); extern void movobj(struct obj *, coordxy, coordxy);
extern boolean may_dig(xchar, xchar); extern boolean may_dig(coordxy, coordxy);
extern boolean may_passwall(xchar, xchar); extern boolean may_passwall(coordxy, coordxy);
extern boolean bad_rock(struct permonst *, xchar, xchar); extern boolean bad_rock(struct permonst *, coordxy, coordxy);
extern int cant_squeeze_thru(struct monst *); extern int cant_squeeze_thru(struct monst *);
extern boolean invocation_pos(xchar, xchar); extern boolean invocation_pos(coordxy, coordxy);
extern boolean test_move(int, int, int, int, int); extern boolean test_move(int, int, int, int, int);
#ifdef DEBUG #ifdef DEBUG
extern int wiz_debug_cmd_traveldisplay(void); extern int wiz_debug_cmd_traveldisplay(void);
@@ -954,7 +954,7 @@ extern void switch_terrain(void);
extern void set_uinwater(int); extern void set_uinwater(int);
extern boolean pooleffects(boolean); extern boolean pooleffects(boolean);
extern void spoteffects(boolean); extern void spoteffects(boolean);
extern char *in_rooms(xchar, xchar, int); extern char *in_rooms(coordxy, coordxy, int);
extern boolean in_town(int, int); extern boolean in_town(int, int);
extern void check_special_room(boolean); extern void check_special_room(boolean);
extern int dopickup(void); extern int dopickup(void);
@@ -973,7 +973,7 @@ extern int max_capacity(void);
extern boolean check_capacity(const char *); extern boolean check_capacity(const char *);
extern int inv_cnt(boolean); extern int inv_cnt(boolean);
extern long money_cnt(struct obj *); extern long money_cnt(struct obj *);
extern void spot_checks(xchar, xchar, schar); extern void spot_checks(coordxy, coordxy, schar);
/* ### hacklib.c ### */ /* ### hacklib.c ### */
@@ -1190,9 +1190,9 @@ extern int dosuspend(void);
/* ### light.c ### */ /* ### light.c ### */
extern void new_light_source(xchar, xchar, int, int, union any *); extern void new_light_source(coordxy, coordxy, int, int, union any *);
extern void del_light_source(int, union any *); extern void del_light_source(int, union any *);
extern void do_light_sources(xchar **); extern void do_light_sources(coordxy **);
extern void show_transient_light(struct obj *, int, int); extern void show_transient_light(struct obj *, int, int);
extern void transient_light_cleanup(void); extern void transient_light_cleanup(void);
extern struct monst *find_mid(unsigned, unsigned); extern struct monst *find_mid(unsigned, unsigned);
@@ -1222,7 +1222,7 @@ extern void breakchestlock(struct obj *, boolean);
extern void reset_pick(void); extern void reset_pick(void);
extern void maybe_reset_pick(struct obj *); extern void maybe_reset_pick(struct obj *);
extern struct obj *autokey(boolean); extern struct obj *autokey(boolean);
extern int pick_lock(struct obj *, xchar, xchar, struct obj *); extern int pick_lock(struct obj *, coordxy, coordxy, struct obj *);
extern boolean u_have_forceable_weapon(void); extern boolean u_have_forceable_weapon(void);
extern int doforce(void); extern int doforce(void);
extern boolean boxlock(struct obj *, struct obj *); extern boolean boxlock(struct obj *, struct obj *);
@@ -1257,7 +1257,7 @@ extern void readmail(struct obj *);
extern void dealloc_monst(struct monst *); extern void dealloc_monst(struct monst *);
extern boolean is_home_elemental(struct permonst *); extern boolean is_home_elemental(struct permonst *);
extern struct monst *clone_mon(struct monst *, xchar, xchar); extern struct monst *clone_mon(struct monst *, coordxy, coordxy);
extern int monhp_per_lvl(struct monst *); extern int monhp_per_lvl(struct monst *);
extern void newmonhp(struct monst *, int); extern void newmonhp(struct monst *, int);
extern struct mextra *newmextra(void); extern struct mextra *newmextra(void);
@@ -1369,12 +1369,12 @@ extern void topologize(struct mkroom *, boolean));
#else #else
extern void topologize(struct mkroom *); extern void topologize(struct mkroom *);
#endif #endif
extern void place_branch(branch *, xchar, xchar); extern void place_branch(branch *, coordxy, coordxy);
extern boolean occupied(xchar, xchar); extern boolean occupied(coordxy, coordxy);
extern int okdoor(xchar, xchar); extern int okdoor(coordxy, coordxy);
extern void dodoor(int, int, struct mkroom *); extern void dodoor(int, int, struct mkroom *);
extern void mktrap(int, int, struct mkroom *, coord *); extern void mktrap(int, int, struct mkroom *, coord *);
extern void mkstairs(xchar, xchar, char, struct mkroom *, boolean); extern void mkstairs(coordxy, coordxy, char, struct mkroom *, boolean);
extern void mkinvokearea(void); extern void mkinvokearea(void);
extern void mineralize(int, int, int, int, boolean); extern void mineralize(int, int, int, int, boolean);
@@ -1386,8 +1386,8 @@ extern boolean litstate_rnd(int);
/* ### mkmaze.c ### */ /* ### mkmaze.c ### */
extern boolean set_levltyp(xchar, xchar, schar); extern boolean set_levltyp(coordxy, coordxy, schar);
extern boolean set_levltyp_lit(xchar, xchar, schar, schar); extern boolean set_levltyp_lit(coordxy, coordxy, schar, schar);
extern void create_maze(int, int, boolean); extern void create_maze(int, int, boolean);
extern void wallification(int, int, int, int); extern void wallification(int, int, int, int);
extern void fix_wall_spines(int, int, int, int); extern void fix_wall_spines(int, int, int, int);
@@ -1396,10 +1396,10 @@ extern void makemaz(const char *);
extern void mazexy(coord *); extern void mazexy(coord *);
extern void get_level_extends(int *, int *, int *, int *); extern void get_level_extends(int *, int *, int *, int *);
extern void bound_digging(void); extern void bound_digging(void);
extern void mkportal(xchar, xchar, xchar, xchar); extern void mkportal(coordxy, coordxy, coordxy, coordxy);
extern boolean bad_location(xchar, xchar, xchar, xchar, xchar, xchar); extern boolean bad_location(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy);
extern void place_lregion(xchar, xchar, xchar, xchar, xchar, xchar, xchar, extern void place_lregion(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, coordxy,
xchar, xchar, d_level *); coordxy, coordxy, d_level *);
extern void fixup_special(void); extern void fixup_special(void);
extern void fumaroles(void); extern void fumaroles(void);
extern void movebubbles(void); extern void movebubbles(void);
@@ -1495,7 +1495,7 @@ extern boolean has_dnstairs(struct mkroom *);
extern boolean has_upstairs(struct mkroom *); extern boolean has_upstairs(struct mkroom *);
extern int somex(struct mkroom *); extern int somex(struct mkroom *);
extern int somey(struct mkroom *); extern int somey(struct mkroom *);
extern boolean inside_room(struct mkroom *, xchar, xchar); extern boolean inside_room(struct mkroom *, coordxy, coordxy);
extern boolean somexy(struct mkroom *, coord *); extern boolean somexy(struct mkroom *, coord *);
extern boolean somexyspace(struct mkroom *, coord *); extern boolean somexyspace(struct mkroom *, coord *);
extern void mkundead(coord *, boolean, int); extern void mkundead(coord *, boolean, int);
@@ -1549,7 +1549,7 @@ extern void mon_to_stone(struct monst *);
extern void m_into_limbo(struct monst *); extern void m_into_limbo(struct monst *);
extern void mnexto(struct monst *, unsigned); extern void mnexto(struct monst *, unsigned);
extern void maybe_mnexto(struct monst *); extern void maybe_mnexto(struct monst *);
extern int mnearto(struct monst *, xchar, xchar, boolean, unsigned); extern int mnearto(struct monst *, coordxy, coordxy, boolean, unsigned);
extern void m_respond(struct monst *); extern void m_respond(struct monst *);
extern void setmangry(struct monst *, boolean); extern void setmangry(struct monst *, boolean);
extern void wake_msg(struct monst *, boolean); extern void wake_msg(struct monst *, boolean);
@@ -1560,11 +1560,11 @@ extern void seemimic(struct monst *);
extern void normal_shape(struct monst *); extern void normal_shape(struct monst *);
extern void iter_mons(void (*)(struct monst *)); extern void iter_mons(void (*)(struct monst *));
extern struct monst *get_iter_mons(boolean (*)(struct monst *)); extern struct monst *get_iter_mons(boolean (*)(struct monst *));
extern struct monst *get_iter_mons_xy(boolean (*)(struct monst *, xchar, xchar), xchar, xchar); extern struct monst *get_iter_mons_xy(boolean (*)(struct monst *, coordxy, coordxy), coordxy, coordxy);
extern void rescham(void); extern void rescham(void);
extern void restartcham(void); extern void restartcham(void);
extern void restore_cham(struct monst *); extern void restore_cham(struct monst *);
extern void maybe_unhide_at(xchar, xchar); extern void maybe_unhide_at(coordxy, coordxy);
extern boolean hideunder(struct monst *); extern boolean hideunder(struct monst *);
extern void hide_monst(struct monst *); extern void hide_monst(struct monst *);
extern void mon_animal_list(boolean); extern void mon_animal_list(boolean);
@@ -1648,18 +1648,18 @@ extern int bee_eat_jelly(struct monst *, struct obj *);
extern void monflee(struct monst *, int, boolean, boolean); extern void monflee(struct monst *, int, boolean, boolean);
extern void mon_yells(struct monst *, const char *); extern void mon_yells(struct monst *, const char *);
extern int dochug(struct monst *); extern int dochug(struct monst *);
extern boolean m_digweapon_check(struct monst *, xchar, xchar); extern boolean m_digweapon_check(struct monst *, coordxy, coordxy);
extern int m_move(struct monst *, int); extern int m_move(struct monst *, int);
extern int m_move_aggress(struct monst *, xchar, xchar); extern int m_move_aggress(struct monst *, coordxy, coordxy);
extern void dissolve_bars(int, int); extern void dissolve_bars(int, int);
extern boolean closed_door(int, int); extern boolean closed_door(int, int);
extern boolean accessible(int, int); extern boolean accessible(int, int);
extern void set_apparxy(struct monst *); extern void set_apparxy(struct monst *);
extern boolean can_ooze(struct monst *); extern boolean can_ooze(struct monst *);
extern boolean can_fog(struct monst *); extern boolean can_fog(struct monst *);
extern boolean should_displace(struct monst *, coord *, long *, int, xchar, extern boolean should_displace(struct monst *, coord *, long *, int, coordxy,
xchar); coordxy);
extern boolean undesirable_disp(struct monst *, xchar, xchar); extern boolean undesirable_disp(struct monst *, coordxy, coordxy);
/* ### monst.c ### */ /* ### monst.c ### */
@@ -1667,7 +1667,7 @@ extern void monst_globals_init(void);
/* ### mplayer.c ### */ /* ### mplayer.c ### */
extern struct monst *mk_mplayer(struct permonst *, xchar, xchar, boolean); extern struct monst *mk_mplayer(struct permonst *, coordxy, coordxy, boolean);
extern void create_mplayers(int, boolean); extern void create_mplayers(int, boolean);
extern void mplayer_talk(struct monst *); extern void mplayer_talk(struct monst *);
@@ -1731,9 +1731,9 @@ extern int ohitmon(struct monst *, struct obj *, int, boolean);
extern void thrwmu(struct monst *); extern void thrwmu(struct monst *);
extern int spitmu(struct monst *, struct attack *); extern int spitmu(struct monst *, struct attack *);
extern int breamu(struct monst *, struct attack *); extern int breamu(struct monst *, struct attack *);
extern boolean linedup_callback(xchar, xchar, xchar, xchar, extern boolean linedup_callback(coordxy, coordxy, coordxy, coordxy,
boolean(*)(int,int)); boolean(*)(int,int));
extern boolean linedup(xchar, xchar, xchar, xchar, int); extern boolean linedup(coordxy, coordxy, coordxy, coordxy, int);
extern boolean lined_up(struct monst *); extern boolean lined_up(struct monst *);
extern struct obj *m_carrying(struct monst *, int); extern struct obj *m_carrying(struct monst *, int);
extern int thrwmm(struct monst *, struct monst *); extern int thrwmm(struct monst *, struct monst *);
@@ -1808,7 +1808,7 @@ extern void nhl_add_table_entry_char(lua_State *, const char *, char);
extern void nhl_add_table_entry_str(lua_State *, const char *, const char *); extern void nhl_add_table_entry_str(lua_State *, const char *, const char *);
extern void nhl_add_table_entry_bool(lua_State *, const char *, boolean); extern void nhl_add_table_entry_bool(lua_State *, const char *, boolean);
extern void nhl_add_table_entry_region(lua_State *, const char *, extern void nhl_add_table_entry_region(lua_State *, const char *,
xchar, xchar, xchar, xchar); coordxy, coordxy, coordxy, coordxy);
extern schar splev_chr2typ(char); extern schar splev_chr2typ(char);
extern schar check_mapchr(const char *); extern schar check_mapchr(const char *);
extern int get_table_int(lua_State *, const char *); extern int get_table_int(lua_State *, const char *);
@@ -1991,7 +1991,7 @@ extern char *self_lookat(char *);
extern char *monhealthdescr(struct monst *mon, boolean, char *); extern char *monhealthdescr(struct monst *mon, boolean, char *);
extern void mhidden_description(struct monst *, boolean, char *); extern void mhidden_description(struct monst *, boolean, char *);
extern boolean object_from_map(int,int,int,struct obj **); extern boolean object_from_map(int,int,int,struct obj **);
extern const char *waterbody_name(xchar, xchar); extern const char *waterbody_name(coordxy, coordxy);
extern int do_screen_description(coord, boolean, int, char *, const char **, extern int do_screen_description(coord, boolean, int, char *, const char **,
struct permonst **); struct permonst **);
extern int do_look(int, coord *); extern int do_look(int, coord *);
@@ -2179,7 +2179,7 @@ extern const char *u_gname(void);
extern int doturn(void); extern int doturn(void);
extern int altarmask_at(int, int); extern int altarmask_at(int, int);
extern const char *a_gname(void); extern const char *a_gname(void);
extern const char *a_gname_at(xchar x, xchar y); extern const char *a_gname_at(coordxy x, coordxy y);
extern const char *align_gname(aligntyp); extern const char *align_gname(aligntyp);
extern const char *halu_gname(aligntyp); extern const char *halu_gname(aligntyp);
extern const char *align_gtitle(aligntyp); extern const char *align_gtitle(aligntyp);
@@ -2188,7 +2188,7 @@ extern void altar_wrath(int, int);
/* ### priest.c ### */ /* ### priest.c ### */
extern int move_special(struct monst *, boolean, schar, boolean, boolean, extern int move_special(struct monst *, boolean, schar, boolean, boolean,
xchar, xchar, xchar, xchar); coordxy, coordxy, coordxy, coordxy);
extern char temple_occupied(char *); extern char temple_occupied(char *);
extern boolean inhistemple(struct monst *); extern boolean inhistemple(struct monst *);
extern int pri_move(struct monst *); extern int pri_move(struct monst *);
@@ -2200,10 +2200,10 @@ extern struct monst *findpriest(char);
extern void intemple(int); extern void intemple(int);
extern void forget_temple_entry(struct monst *); extern void forget_temple_entry(struct monst *);
extern void priest_talk(struct monst *); extern void priest_talk(struct monst *);
extern struct monst *mk_roamer(struct permonst *, aligntyp, xchar, xchar, extern struct monst *mk_roamer(struct permonst *, aligntyp, coordxy, coordxy,
boolean); boolean);
extern void reset_hostility(struct monst *); extern void reset_hostility(struct monst *);
extern boolean in_your_sanctuary(struct monst *, xchar, xchar); extern boolean in_your_sanctuary(struct monst *, coordxy, coordxy);
extern void ghod_hitsu(struct monst *); extern void ghod_hitsu(struct monst *);
extern void angry_priest(void); extern void angry_priest(void);
extern void clearpriests(void); extern void clearpriests(void);
@@ -2287,16 +2287,16 @@ extern void split_rects(NhRect *, NhRect *);
extern boolean inside_region(NhRegion *, int, int); extern boolean inside_region(NhRegion *, int, int);
extern void clear_regions(void); extern void clear_regions(void);
extern void run_regions(void); extern void run_regions(void);
extern boolean in_out_region(xchar, xchar); extern boolean in_out_region(coordxy, coordxy);
extern boolean m_in_out_region(struct monst *, xchar, xchar); extern boolean m_in_out_region(struct monst *, coordxy, coordxy);
extern void update_player_regions(void); extern void update_player_regions(void);
extern void update_monster_region(struct monst *); extern void update_monster_region(struct monst *);
extern NhRegion *visible_region_at(xchar, xchar); extern NhRegion *visible_region_at(coordxy, coordxy);
extern void show_region(NhRegion *, xchar, xchar); extern void show_region(NhRegion *, coordxy, coordxy);
extern void save_regions(NHFILE *); extern void save_regions(NHFILE *);
extern void rest_regions(NHFILE *); extern void rest_regions(NHFILE *);
extern void region_stats(const char *, char *, long *, long *); extern void region_stats(const char *, char *, long *, long *);
extern NhRegion *create_gas_cloud(xchar, xchar, int, int); extern NhRegion *create_gas_cloud(coordxy, coordxy, int, int);
extern boolean region_danger(void); extern boolean region_danger(void);
extern void region_safety(void); extern void region_safety(void);
@@ -2306,7 +2306,7 @@ extern void inven_inuse(boolean);
extern int dorecover(NHFILE *); extern int dorecover(NHFILE *);
extern void restcemetery(NHFILE *, struct cemetery **); extern void restcemetery(NHFILE *, struct cemetery **);
extern void trickery(char *); extern void trickery(char *);
extern void getlev(NHFILE *, int, xchar); extern void getlev(NHFILE *, int, xint8);
extern void get_plname_from_file(NHFILE *, char *); extern void get_plname_from_file(NHFILE *, char *);
#ifdef SELECTSAVED #ifdef SELECTSAVED
extern int restore_menu(winid); extern int restore_menu(winid);
@@ -2392,7 +2392,7 @@ extern boolean tricked_fileremoved(NHFILE *, char *);
#ifdef INSURANCE #ifdef INSURANCE
extern void savestateinlock(void); extern void savestateinlock(void);
#endif #endif
extern void savelev(NHFILE *, xchar); extern void savelev(NHFILE *, xint8);
extern genericptr_t mon_to_buffer(struct monst *, int *); extern genericptr_t mon_to_buffer(struct monst *, int *);
extern boolean close_check(int); extern boolean close_check(int);
extern void savecemetery(NHFILE *, struct cemetery **); extern void savecemetery(NHFILE *, struct cemetery **);
@@ -2430,9 +2430,9 @@ extern void shkgone(struct monst *);
extern void set_residency(struct monst *, boolean); extern void set_residency(struct monst *, boolean);
extern void replshk(struct monst *, struct monst *); extern void replshk(struct monst *, struct monst *);
extern void restshk(struct monst *, boolean); extern void restshk(struct monst *, boolean);
extern char inside_shop(xchar, xchar); extern char inside_shop(coordxy, coordxy);
extern void u_left_shop(char *, boolean); extern void u_left_shop(char *, boolean);
extern void remote_burglary(xchar, xchar); extern void remote_burglary(coordxy, coordxy);
extern void u_entered_shop(char *); extern void u_entered_shop(char *);
extern void pick_pick(struct obj *); extern void pick_pick(struct obj *);
extern boolean same_price(struct obj *, struct obj *); extern boolean same_price(struct obj *, struct obj *);
@@ -2446,7 +2446,7 @@ extern void obfree(struct obj *, struct obj *);
extern void make_happy_shk(struct monst *, boolean); extern void make_happy_shk(struct monst *, boolean);
extern void make_happy_shoppers(boolean); extern void make_happy_shoppers(boolean);
extern void hot_pursuit(struct monst *); extern void hot_pursuit(struct monst *);
extern void make_angry_shk(struct monst *, xchar, xchar); extern void make_angry_shk(struct monst *, coordxy, coordxy);
extern int dopay(void); extern int dopay(void);
extern boolean paybill(int, boolean); extern boolean paybill(int, boolean);
extern void finish_paybill(void); extern void finish_paybill(void);
@@ -2462,30 +2462,30 @@ extern boolean billable(struct monst **, struct obj *, char, boolean);
extern void addtobill(struct obj *, boolean, boolean, boolean); extern void addtobill(struct obj *, boolean, boolean, boolean);
extern void splitbill(struct obj *, struct obj *); extern void splitbill(struct obj *, struct obj *);
extern void subfrombill(struct obj *, struct monst *); extern void subfrombill(struct obj *, struct monst *);
extern long stolen_value(struct obj *, xchar, xchar, boolean, boolean); extern long stolen_value(struct obj *, coordxy, coordxy, boolean, boolean);
extern void donate_gold(long, struct monst *, boolean); extern void donate_gold(long, struct monst *, boolean);
extern void sellobj_state(int); extern void sellobj_state(int);
extern void sellobj(struct obj *, xchar, xchar); extern void sellobj(struct obj *, coordxy, coordxy);
extern int doinvbill(int); extern int doinvbill(int);
extern struct monst *shkcatch(struct obj *, xchar, xchar); extern struct monst *shkcatch(struct obj *, coordxy, coordxy);
extern void add_damage(xchar, xchar, long); extern void add_damage(coordxy, coordxy, long);
extern void fix_shop_damage(void); extern void fix_shop_damage(void);
extern int shk_move(struct monst *); extern int shk_move(struct monst *);
extern void after_shk_move(struct monst *); extern void after_shk_move(struct monst *);
extern boolean is_fshk(struct monst *); extern boolean is_fshk(struct monst *);
extern void shopdig(int); extern void shopdig(int);
extern void pay_for_damage(const char *, boolean); extern void pay_for_damage(const char *, boolean);
extern boolean costly_spot(xchar, xchar); extern boolean costly_spot(coordxy, coordxy);
extern struct obj *shop_object(xchar, xchar); extern struct obj *shop_object(coordxy, coordxy);
extern void price_quote(struct obj *); extern void price_quote(struct obj *);
extern void shk_chat(struct monst *); extern void shk_chat(struct monst *);
extern void check_unpaid_usage(struct obj *, boolean); extern void check_unpaid_usage(struct obj *, boolean);
extern void check_unpaid(struct obj *); extern void check_unpaid(struct obj *);
extern void costly_gold(xchar, xchar, long, boolean); extern void costly_gold(coordxy, coordxy, long, boolean);
extern long get_cost_of_shop_item(struct obj *, int *); extern long get_cost_of_shop_item(struct obj *, int *);
extern int oid_price_adjustment(struct obj *, unsigned); extern int oid_price_adjustment(struct obj *, unsigned);
extern boolean block_door(xchar, xchar); extern boolean block_door(coordxy, coordxy);
extern boolean block_entry(xchar, xchar); extern boolean block_entry(coordxy, coordxy);
extern char *shk_your(char *, struct obj *); extern char *shk_your(char *, struct obj *);
extern char *Shk_Your(char *, struct obj *); extern char *Shk_Your(char *, struct obj *);
extern void globby_bill_fixup(struct obj *, struct obj *); extern void globby_bill_fixup(struct obj *, struct obj *);
@@ -2541,34 +2541,34 @@ extern const char * mapfrag_error(struct mapfragment *);
extern boolean mapfrag_match(struct mapfragment *, int, int); extern boolean mapfrag_match(struct mapfragment *, int, int);
extern void flip_level(int, boolean); extern void flip_level(int, boolean);
extern void flip_level_rnd(int, boolean); extern void flip_level_rnd(int, boolean);
extern boolean check_room(xchar *, xchar *, xchar *, xchar *, boolean); extern boolean check_room(coordxy *, coordxy *, coordxy *, coordxy *, boolean);
extern boolean create_room(xchar, xchar, xchar, xchar, xchar, xchar, xchar, extern boolean create_room(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, xint16,
xchar); xint16);
extern boolean dig_corridor(coord *, coord *, boolean, schar, schar); extern boolean dig_corridor(coord *, coord *, boolean, schar, schar);
extern void fill_special_room(struct mkroom *); extern void fill_special_room(struct mkroom *);
extern void wallify_map(int, int, int, int); extern void wallify_map(int, int, int, int);
extern boolean load_special(const char *); extern boolean load_special(const char *);
extern xchar selection_getpoint(int, int, struct selectionvar *); extern coordxy selection_getpoint(int, int, struct selectionvar *);
extern struct selectionvar *selection_new(void); extern struct selectionvar *selection_new(void);
extern void selection_free(struct selectionvar *, boolean); extern void selection_free(struct selectionvar *, boolean);
extern struct selectionvar *selection_clone(struct selectionvar *); extern struct selectionvar *selection_clone(struct selectionvar *);
extern void set_selection_floodfillchk(int(*)(int,int)); extern void set_selection_floodfillchk(int(*)(int,int));
extern void selection_floodfill(struct selectionvar *, int, int, boolean); extern void selection_floodfill(struct selectionvar *, int, int, boolean);
extern boolean pm_good_location(int, int, struct permonst *); extern boolean pm_good_location(int, int, struct permonst *);
extern void get_location_coord(xchar *, xchar *, int, struct mkroom *, long); extern void get_location_coord(coordxy *, coordxy *, int, struct mkroom *, long);
extern void selection_setpoint(int, int, struct selectionvar *, xchar); extern void selection_setpoint(int, int, struct selectionvar *, coordxy);
extern struct selectionvar * selection_not(struct selectionvar *); extern struct selectionvar * selection_not(struct selectionvar *);
extern void selection_filter_percent(struct selectionvar *, int); extern void selection_filter_percent(struct selectionvar *, int);
extern int selection_rndcoord(struct selectionvar *, xchar *, xchar *, extern int selection_rndcoord(struct selectionvar *, coordxy *, coordxy *,
boolean); boolean);
extern void selection_do_grow(struct selectionvar *, int); extern void selection_do_grow(struct selectionvar *, int);
extern void selection_do_line(xchar, xchar, xchar, xchar, extern void selection_do_line(coordxy, coordxy, coordxy, coordxy,
struct selectionvar *); struct selectionvar *);
extern void selection_do_randline(xchar, xchar, xchar, xchar, schar, schar, extern void selection_do_randline(coordxy, coordxy, coordxy, coordxy, schar, schar,
struct selectionvar *); struct selectionvar *);
extern struct selectionvar *selection_filter_mapchar(struct selectionvar *, extern struct selectionvar *selection_filter_mapchar(struct selectionvar *,
xchar, int); coordxy, int);
extern void set_floodfillchk_match_under(xchar); extern void set_floodfillchk_match_under(coordxy);
extern void selection_do_ellipse(struct selectionvar *, int, int, int, int, extern void selection_do_ellipse(struct selectionvar *, int, int, int, int,
int); int);
extern void selection_do_gradient(struct selectionvar *, long, long, long, extern void selection_do_gradient(struct selectionvar *, long, long, long,
@@ -2672,8 +2672,8 @@ extern void sysopt_seduce_set(int);
extern boolean noteleport_level(struct monst *); extern boolean noteleport_level(struct monst *);
extern boolean goodpos(int, int, struct monst *, mmflags_nht); extern boolean goodpos(int, int, struct monst *, mmflags_nht);
extern boolean enexto(coord *, xchar, xchar, struct permonst *); extern boolean enexto(coord *, coordxy, coordxy, struct permonst *);
extern boolean enexto_core(coord *, xchar, xchar, struct permonst *, extern boolean enexto_core(coord *, coordxy, coordxy, struct permonst *,
mmflags_nht); mmflags_nht);
extern void teleds(int, int, int); extern void teleds(int, int, int);
extern boolean safe_teleds(int); extern boolean safe_teleds(int);
@@ -2724,9 +2724,9 @@ extern void obj_move_timers(struct obj *, struct obj *);
extern void obj_split_timers(struct obj *, struct obj *); extern void obj_split_timers(struct obj *, struct obj *);
extern void obj_stop_timers(struct obj *); extern void obj_stop_timers(struct obj *);
extern boolean obj_has_timer(struct obj *, short); extern boolean obj_has_timer(struct obj *, short);
extern void spot_stop_timers(xchar, xchar, short); extern void spot_stop_timers(coordxy, coordxy, short);
extern long spot_time_expires(xchar, xchar, short); extern long spot_time_expires(coordxy, coordxy, short);
extern long spot_time_left(xchar, xchar, short); extern long spot_time_left(coordxy, coordxy, short);
extern boolean obj_is_local(struct obj *); extern boolean obj_is_local(struct obj *);
extern void save_timers(NHFILE *, int); extern void save_timers(NHFILE *, int);
extern void restore_timers(NHFILE *, int, long); extern void restore_timers(NHFILE *, int, long);
@@ -2757,8 +2757,8 @@ extern int erode_obj(struct obj *, const char *, int, int);
extern boolean grease_protect(struct obj *, const char *, struct monst *); extern boolean grease_protect(struct obj *, const char *, struct monst *);
extern struct trap *maketrap(int, int, int); extern struct trap *maketrap(int, int, int);
extern void fall_through(boolean, unsigned); extern void fall_through(boolean, unsigned);
extern struct monst *animate_statue(struct obj *, xchar, xchar, int, int *); extern struct monst *animate_statue(struct obj *, coordxy, coordxy, int, int *);
extern struct monst *activate_statue_trap(struct trap *, xchar, xchar, extern struct monst *activate_statue_trap(struct trap *, coordxy, coordxy,
boolean); boolean);
extern void set_utrap(unsigned, unsigned); extern void set_utrap(unsigned, unsigned);
extern void reset_utrap(boolean); extern void reset_utrap(boolean);
@@ -2774,9 +2774,9 @@ extern void float_up(void);
extern void fill_pit(int, int); extern void fill_pit(int, int);
extern int float_down(long, long); extern int float_down(long, long);
extern void climb_pit(void); extern void climb_pit(void);
extern boolean fire_damage(struct obj *, boolean, xchar, xchar); extern boolean fire_damage(struct obj *, boolean, coordxy, coordxy);
extern int fire_damage_chain(struct obj *, boolean, boolean, xchar, xchar); extern int fire_damage_chain(struct obj *, boolean, boolean, coordxy, coordxy);
extern boolean lava_damage(struct obj *, xchar, xchar); extern boolean lava_damage(struct obj *, coordxy, coordxy);
extern void acid_damage(struct obj *); extern void acid_damage(struct obj *);
extern int water_damage(struct obj *, const char *, boolean); extern int water_damage(struct obj *, const char *, boolean);
extern void water_damage_chain(struct obj *, boolean); extern void water_damage_chain(struct obj *, boolean);
@@ -2807,7 +2807,7 @@ extern void sink_into_lava(void);
extern void sokoban_guilt(void); extern void sokoban_guilt(void);
extern const char * trapname(int, boolean); extern const char * trapname(int, boolean);
extern void ignite_items(struct obj *); extern void ignite_items(struct obj *);
extern void trap_ice_effects(xchar x, xchar y, boolean ice_is_melting); extern void trap_ice_effects(coordxy x, coordxy y, boolean ice_is_melting);
extern void trap_sanity_check(void); extern void trap_sanity_check(void);
/* ### u_init.c ### */ /* ### u_init.c ### */
@@ -3261,7 +3261,7 @@ extern void nethack_enter_windows(void);
extern void amulet(void); extern void amulet(void);
extern int mon_has_amulet(struct monst *); extern int mon_has_amulet(struct monst *);
extern int mon_has_special(struct monst *); extern int mon_has_special(struct monst *);
extern void choose_stairs(xchar *, xchar *, boolean); extern void choose_stairs(coordxy *, coordxy *, boolean);
extern int tactics(struct monst *); extern int tactics(struct monst *);
extern boolean has_aggravatables(struct monst *); extern boolean has_aggravatables(struct monst *);
extern void aggravate(void); extern void aggravate(void);
@@ -3281,7 +3281,7 @@ extern void worm_move(struct monst *);
extern void worm_nomove(struct monst *); extern void worm_nomove(struct monst *);
extern void wormgone(struct monst *); extern void wormgone(struct monst *);
extern int wormhitu(struct monst *); extern int wormhitu(struct monst *);
extern void cutworm(struct monst *, xchar, xchar, boolean); extern void cutworm(struct monst *, coordxy, coordxy, boolean);
extern void see_wsegs(struct monst *); extern void see_wsegs(struct monst *);
extern void detect_wsegs(struct monst *, boolean); extern void detect_wsegs(struct monst *, boolean);
extern void save_worm(NHFILE *); extern void save_worm(NHFILE *);
@@ -3290,7 +3290,7 @@ extern void place_wsegs(struct monst *, struct monst *);
extern void sanity_check_worm(struct monst *); extern void sanity_check_worm(struct monst *);
extern void wormno_sanity_check(void); extern void wormno_sanity_check(void);
extern void remove_worm(struct monst *); extern void remove_worm(struct monst *);
extern void place_worm_tail_randomly(struct monst *, xchar, xchar); extern void place_worm_tail_randomly(struct monst *, coordxy, coordxy);
extern int size_wseg(struct monst *); extern int size_wseg(struct monst *);
extern int count_wsegs(struct monst *); extern int count_wsegs(struct monst *);
extern boolean worm_known(struct monst *); extern boolean worm_known(struct monst *);
@@ -3333,8 +3333,8 @@ extern void learnwand(struct obj *);
extern int bhitm(struct monst *, struct obj *); extern int bhitm(struct monst *, struct obj *);
extern void release_hold(void); extern void release_hold(void);
extern void probe_monster(struct monst *); extern void probe_monster(struct monst *);
extern boolean get_obj_location(struct obj *, xchar *, xchar *, int); extern boolean get_obj_location(struct obj *, coordxy *, coordxy *, int);
extern boolean get_mon_location(struct monst *, xchar *, xchar *, int); extern boolean get_mon_location(struct monst *, coordxy *, coordxy *, int);
extern struct monst *get_container_location(struct obj * obj, int *, int *); extern struct monst *get_container_location(struct obj * obj, int *, int *);
extern struct monst *montraits(struct obj *, coord *, boolean); extern struct monst *montraits(struct obj *, coord *, boolean);
extern struct monst *revive(struct obj *, boolean); extern struct monst *revive(struct obj *, boolean);
@@ -3373,12 +3373,12 @@ extern struct monst *bhit(int, int, int, enum bhit_call_types,
extern struct monst *boomhit(struct obj *, int, int); extern struct monst *boomhit(struct obj *, int, int);
extern int zhitm(struct monst *, int, int, struct obj **); extern int zhitm(struct monst *, int, int, struct obj **);
extern int burn_floor_objects(int, int, boolean, boolean); extern int burn_floor_objects(int, int, boolean, boolean);
extern void buzz(int, int, xchar, xchar, int, int); extern void buzz(int, int, coordxy, coordxy, int, int);
extern void dobuzz(int, int, xchar, xchar, int, int, boolean); extern void dobuzz(int, int, coordxy, coordxy, int, int, boolean);
extern void melt_ice(xchar, xchar, const char *); extern void melt_ice(coordxy, coordxy, const char *);
extern void start_melt_ice_timeout(xchar, xchar, long); extern void start_melt_ice_timeout(coordxy, coordxy, long);
extern void melt_ice_away(union any *, long); extern void melt_ice_away(union any *, long);
extern int zap_over_floor(xchar, xchar, int, boolean *, short); extern int zap_over_floor(coordxy, coordxy, int, boolean *, short);
extern void fracture_rock(struct obj *); extern void fracture_rock(struct obj *);
extern boolean break_statue(struct obj *); extern boolean break_statue(struct obj *);
extern boolean u_adtyp_resistance_obj(int); extern boolean u_adtyp_resistance_obj(int);
+16 -4
View File
@@ -59,17 +59,29 @@
#endif /* DUMB */ #endif /* DUMB */
/* /*
* type xchar: small integers (typedef'd as signed char, * type xint8: small integers (typedef'd as signed,
* so in the range -127 - 127), usually coordinates. * in the range -127 - 127).
*/ */
typedef schar xchar; typedef int8_t xint8;
/*
* type coordxy: integers (typedef'd as signed,
* in the range −32768 to 32767), mostly coordinates.
* Note that in 2022, screen coordinates easily
* surpass an upper limit of 127.
*/
typedef int16_t coordxy;
/*
* type xint16: integers (typedef'd as signed,
* in the range −32768 to 32767), non-coordinates.
*/
typedef int16_t xint16;
#ifdef __MINGW32__ #ifdef __MINGW32__
/* Resolve conflict with Qt 5 and MinGW-w32 */ /* Resolve conflict with Qt 5 and MinGW-w32 */
typedef unsigned char boolean; /* 0 or 1 */ typedef unsigned char boolean; /* 0 or 1 */
#else #else
#ifndef SKIP_BOOLEAN #ifndef SKIP_BOOLEAN
typedef xchar boolean; /* 0 or 1 */ typedef schar boolean; /* 0 or 1 */
#endif #endif
#endif #endif
+6 -6
View File
@@ -170,13 +170,13 @@ typedef union str_or_len {
/* lev_region from sp_lev.h */ /* lev_region from sp_lev.h */
typedef struct { typedef struct {
struct { struct {
xchar x1, y1, x2, y2; coordxy x1, y1, x2, y2;
} inarea; } inarea;
struct { struct {
xchar x1, y1, x2, y2; coordxy x1, y1, x2, y2;
} delarea; } delarea;
boolean in_islev, del_islev; boolean in_islev, del_islev;
xchar rtype, padding; coordxy rtype, padding;
Str_or_Len rname; Str_or_Len rname;
} lev_region; } lev_region;
@@ -251,9 +251,9 @@ struct sortloot_item {
char *str; /* result of loot_xname(obj) in some cases, otherwise null */ char *str; /* result of loot_xname(obj) in some cases, otherwise null */
int indx; /* signed int, because sortloot()'s qsort comparison routine int indx; /* signed int, because sortloot()'s qsort comparison routine
assumes (a->indx - b->indx) might yield a negative result */ assumes (a->indx - b->indx) might yield a negative result */
xchar orderclass; /* order rather than object class; 0 => not yet init'd */ xint16 orderclass; /* order rather than object class; 0 => not yet init'd */
xchar subclass; /* subclass for some classes */ xint16 subclass; /* subclass for some classes */
xchar disco; /* discovery status */ xint16 disco; /* discovery status */
}; };
typedef struct sortloot_item Loot; typedef struct sortloot_item Loot;
+4 -4
View File
@@ -69,7 +69,7 @@
#define GD_DESTROYGOLD 0x02 #define GD_DESTROYGOLD 0x02
struct fakecorridor { struct fakecorridor {
xchar fx, fy; coordxy fx, fy;
schar ftyp; /* from struct rm's typ */ schar ftyp; /* from struct rm's typ */
uchar flags; /* also from struct rm; an unsigned 5-bit field there */ uchar flags; /* also from struct rm; an unsigned 5-bit field there */
}; };
@@ -77,10 +77,10 @@ struct fakecorridor {
struct egd { struct egd {
int fcbeg, fcend; /* fcend: first unused pos */ int fcbeg, fcend; /* fcend: first unused pos */
int vroom; /* room number of the vault */ int vroom; /* room number of the vault */
xchar gdx, gdy; /* goal of guard's walk */ coordxy gdx, gdy; /* goal of guard's walk */
xchar ogx, ogy; /* guard's last position */ coordxy ogx, ogy; /* guard's last position */
d_level gdlevel; /* level (& dungeon) guard was created in */ d_level gdlevel; /* level (& dungeon) guard was created in */
xchar warncnt; /* number of warnings to follow */ xint16 warncnt; /* number of warnings to follow */
Bitfield(gddone, 1); /* true iff guard has released player */ Bitfield(gddone, 1); /* true iff guard has released player */
Bitfield(witness, 2); /* the guard saw you do something */ Bitfield(witness, 2); /* the guard saw you do something */
Bitfield(unused, 5); Bitfield(unused, 5);
+1 -1
View File
@@ -9,7 +9,7 @@
/* mkroom.h - types and structures for room and shop initialization */ /* mkroom.h - types and structures for room and shop initialization */
struct mkroom { struct mkroom {
xchar lx, hx, ly, hy; /* usually xchar, but hx may be -1 */ coordxy lx, hx, ly, hy; /* usually coordxy, but hx may be -1 */
schar rtype; /* type of room (zoo, throne, etc...) */ schar rtype; /* type of room (zoo, throne, etc...) */
schar orig_rtype; /* same as rtype, but not zeroed later */ schar orig_rtype; /* same as rtype, but not zeroed later */
schar rlit; /* is the room lit ? */ schar rlit; /* is the room lit ? */
+5 -5
View File
@@ -96,8 +96,8 @@ struct monst {
uchar m_lev; /* adjusted difficulty level of monster */ uchar m_lev; /* adjusted difficulty level of monster */
aligntyp malign; /* alignment of this monster, relative to the aligntyp malign; /* alignment of this monster, relative to the
player (positive = good to kill) */ player (positive = good to kill) */
xchar mx, my; coordxy mx, my;
xchar mux, muy; /* where the monster thinks you are */ coordxy mux, muy; /* where the monster thinks you are */
#define MTSZ 4 #define MTSZ 4
/* mtrack[0..2] is used to keep extra data when migrating the monster */ /* mtrack[0..2] is used to keep extra data when migrating the monster */
coord mtrack[MTSZ]; /* monster track */ coord mtrack[MTSZ]; /* monster track */
@@ -174,8 +174,8 @@ struct monst {
#define STRAT_XMASK 0x00ff0000L #define STRAT_XMASK 0x00ff0000L
#define STRAT_YMASK 0x0000ff00L #define STRAT_YMASK 0x0000ff00L
#define STRAT_GOAL 0x000000ffL #define STRAT_GOAL 0x000000ffL
#define STRAT_GOALX(s) ((xchar) ((s & STRAT_XMASK) >> 16)) #define STRAT_GOALX(s) ((coordxy) ((s & STRAT_XMASK) >> 16))
#define STRAT_GOALY(s) ((xchar) ((s & STRAT_YMASK) >> 8)) #define STRAT_GOALY(s) ((coordxy) ((s & STRAT_YMASK) >> 8))
long mtrapseen; /* bitmap of traps we've been trapped in */ long mtrapseen; /* bitmap of traps we've been trapped in */
long mlstmv; /* for catching up with lost time */ long mlstmv; /* for catching up with lost time */
@@ -185,7 +185,7 @@ struct monst {
struct obj *minvent; /* mon's inventory */ struct obj *minvent; /* mon's inventory */
struct obj *mw; /* mon's weapon */ struct obj *mw; /* mon's weapon */
long misc_worn_check; /* mon's wornmask */ long misc_worn_check; /* mon's wornmask */
xchar weapon_check; /* flag for whether to try switching weapons */ xint16 weapon_check; /* flag for whether to try switching weapons */
int meating; /* monster is eating timeout */ int meating; /* monster is eating timeout */
struct mextra *mextra; /* point to mextra struct */ struct mextra *mextra; /* point to mextra struct */
+5 -5
View File
@@ -36,7 +36,7 @@ struct obj {
struct obj *cobj; /* contents list for containers */ struct obj *cobj; /* contents list for containers */
unsigned o_id; unsigned o_id;
xchar ox, oy; coordxy ox, oy;
short otyp; /* object class number */ short otyp; /* object class number */
unsigned owt; unsigned owt;
long quan; /* number of items */ long quan; /* number of items */
@@ -66,7 +66,7 @@ struct obj {
char invlet; /* designation in inventory */ char invlet; /* designation in inventory */
char oartifact; /* artifact array index */ char oartifact; /* artifact array index */
xchar where; /* where the object thinks it is */ xint8 where; /* where the object thinks it is */
#define OBJ_FREE 0 /* object not attached to anything */ #define OBJ_FREE 0 /* object not attached to anything */
#define OBJ_FLOOR 1 /* object on floor */ #define OBJ_FLOOR 1 /* object on floor */
#define OBJ_CONTAINED 2 /* object in a container */ #define OBJ_CONTAINED 2 /* object in a container */
@@ -77,7 +77,7 @@ struct obj {
#define OBJ_ONBILL 7 /* object on shk bill */ #define OBJ_ONBILL 7 /* object on shk bill */
#define OBJ_LUAFREE 8 /* object has been dealloc'd, but is ref'd by lua */ #define OBJ_LUAFREE 8 /* object has been dealloc'd, but is ref'd by lua */
#define NOBJ_STATES 9 #define NOBJ_STATES 9
xchar timed; /* # of fuses (timers) attached to this obj */ xint16 timed; /* # of fuses (timers) attached to this obj */
Bitfield(cursed, 1); Bitfield(cursed, 1);
Bitfield(blessed, 1); Bitfield(blessed, 1);
@@ -140,8 +140,8 @@ struct obj {
* overloaded for the destination of migrating * overloaded for the destination of migrating
* objects (which can't be worn at same time) */ * objects (which can't be worn at same time) */
unsigned lua_ref_cnt; /* # of lua script references for this object */ unsigned lua_ref_cnt; /* # of lua script references for this object */
xchar omigr_from_dnum; /* where obj is migrating from */ xint16 omigr_from_dnum; /* where obj is migrating from */
xchar omigr_from_dlevel; /* where obj is migrating from */ xint16 omigr_from_dlevel; /* where obj is migrating from */
struct oextra *oextra; /* pointer to oextra struct */ struct oextra *oextra; /* pointer to oextra struct */
}; };
+1 -1
View File
@@ -17,7 +17,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones * Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files. * and save files.
*/ */
#define EDITLEVEL 59 #define EDITLEVEL 60
/* /*
* Development status possibilities. * Development status possibilities.
+2 -2
View File
@@ -6,8 +6,8 @@
#define RECT_H #define RECT_H
typedef struct nhrect { typedef struct nhrect {
xchar lx, ly; coordxy lx, ly;
xchar hx, hy; coordxy hx, hy;
} NhRect; } NhRect;
#endif /* RECT_H */ #endif /* RECT_H */
+1 -1
View File
@@ -352,7 +352,7 @@ struct cemetery {
/* date+time in string of digits rather than binary */ /* date+time in string of digits rather than binary */
char when[4 + 2 + 2 + 2 + 2 + 2 + 1]; /* "YYYYMMDDhhmmss\0" */ char when[4 + 2 + 2 + 2 + 2 + 2 + 1]; /* "YYYYMMDDhhmmss\0" */
/* final resting place spot */ /* final resting place spot */
xchar frpx, frpy; coordxy frpx, frpy;
boolean bonesknown; boolean bonesknown;
}; };
+4 -4
View File
@@ -108,8 +108,8 @@ enum skill_levels {
/* The hero's skill in various weapons. */ /* The hero's skill in various weapons. */
struct skills { struct skills {
xchar skill; xint16 skill;
xchar max_skill; xint16 max_skill;
unsigned short advance; unsigned short advance;
}; };
@@ -122,8 +122,8 @@ struct skills {
/* Initial skill matrix structure; used in u_init.c and weapon.c */ /* Initial skill matrix structure; used in u_init.c and weapon.c */
struct def_skill { struct def_skill {
xchar skill; xint16 skill;
xchar skmax; xint16 skmax;
}; };
#endif /* SKILLS_H */ #endif /* SKILLS_H */
+22 -18
View File
@@ -99,31 +99,32 @@ struct sp_coder {
#define packed_coord long #define packed_coord long
typedef uint32_t getloc_flags_t; typedef uint32_t getloc_flags_t;
typedef struct { typedef struct {
xchar is_random; xint16 is_random;
getloc_flags_t getloc_flags; getloc_flags_t getloc_flags;
int x, y; int x, y;
} unpacked_coord; } unpacked_coord;
typedef struct { typedef struct {
xchar init_style; /* one of LVLINIT_foo */ xint16 init_style; /* one of LVLINIT_foo */
long flags; long flags;
schar filling; schar filling;
boolean init_present, padding; boolean init_present, padding;
char fg, bg; char fg, bg;
boolean smoothed, joined; boolean smoothed, joined;
xchar lit, walled; xint16 lit, walled;
boolean icedpools; boolean icedpools;
int corrwid, wallthick; int corrwid, wallthick;
boolean rm_deadends; boolean rm_deadends;
} lev_init; } lev_init;
typedef struct { typedef struct {
xchar wall, pos, secret, mask; xint16 wall, pos, secret, mask;
} room_door; } room_door;
typedef struct { typedef struct {
packed_coord coord; packed_coord coord;
xchar x, y, type; coordxy x, y;
xint16 type;
boolean spider_on_web; boolean spider_on_web;
boolean seen; boolean seen;
} spltrap; } spltrap;
@@ -133,7 +134,8 @@ typedef struct {
short id; short id;
unsigned int sp_amask; /* splev amask */ unsigned int sp_amask; /* splev amask */
packed_coord coord; packed_coord coord;
xchar x, y, class, appear; coordxy x, y;
xint16 class, appear;
schar peaceful, asleep; schar peaceful, asleep;
short female, invis, cancelled, revived, avenge, fleeing, blinded, short female, invis, cancelled, revived, avenge, fleeing, blinded,
paralyzed, stunned, confused, waiting; paralyzed, stunned, confused, waiting;
@@ -147,7 +149,8 @@ typedef struct {
int corpsenm; int corpsenm;
short id, spe; short id, spe;
packed_coord coord; packed_coord coord;
xchar x, y, class, containment; coordxy x, y;
xint16 class, containment;
schar curse_state; schar curse_state;
int quan; int quan;
short buried; short buried;
@@ -158,34 +161,35 @@ typedef struct {
typedef struct { typedef struct {
packed_coord coord; packed_coord coord;
xchar x, y; coordxy x, y;
unsigned int sp_amask; /* splev amask */ unsigned int sp_amask; /* splev amask */
xchar shrine; xint16 shrine;
} altar; } altar;
typedef struct { typedef struct {
xchar x1, y1, x2, y2; coordxy x1, y1, x2, y2;
xchar rtype, rlit, rirreg; xint16 rtype, rlit, rirreg;
} region; } region;
typedef struct { typedef struct {
xchar ter, tlit; xint16 ter, tlit;
} terrain; } terrain;
typedef struct { typedef struct {
struct { struct {
xchar room; xint16 room;
xchar wall; xint16 wall;
xchar door; xint16 door;
} src, dest; } src, dest;
} corridor; } corridor;
typedef struct _room { typedef struct _room {
Str_or_Len name; Str_or_Len name;
Str_or_Len parent; Str_or_Len parent;
xchar x, y, w, h; coordxy x, y;
xchar xalign, yalign; xint16 w, h;
xchar rtype, chance, rlit, needfill; xint16 xalign, yalign;
xint16 rtype, chance, rlit, needfill;
boolean joined; boolean joined;
} room; } room;
+1 -1
View File
@@ -13,7 +13,7 @@
struct spell { struct spell {
short sp_id; /* spell id (== object.otyp) */ short sp_id; /* spell id (== object.otyp) */
xchar sp_lev; /* power level */ xint16 sp_lev; /* power level */
int sp_know; /* knowlege of spell */ int sp_know; /* knowlege of spell */
}; };
+1 -1
View File
@@ -324,7 +324,7 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
#define CHAR_P char #define CHAR_P char
#define SCHAR_P schar #define SCHAR_P schar
#define UCHAR_P uchar #define UCHAR_P uchar
#define XCHAR_P xchar #define XCHAR_P coordxy
#define SHORT_P short #define SHORT_P short
#ifndef SKIP_BOOLEAN #ifndef SKIP_BOOLEAN
#define BOOLEAN_P boolean #define BOOLEAN_P boolean
+1 -1
View File
@@ -17,7 +17,7 @@ union vlaunchinfo {
struct trap { struct trap {
struct trap *ntrap; struct trap *ntrap;
xchar tx, ty; coordxy tx, ty;
d_level dst; /* destination for portals */ d_level dst; /* destination for portals */
coord launch; coord launch;
Bitfield(ttyp, 5); Bitfield(ttyp, 5);
+2 -2
View File
@@ -81,7 +81,7 @@ struct tile_map_info_t {
struct map_info_t { struct map_info_t {
Dimension viewport_width, /* Saved viewport size, so we can */ Dimension viewport_width, /* Saved viewport size, so we can */
viewport_height; /* clip to cursor on a resize. */ viewport_height; /* clip to cursor on a resize. */
xchar t_start[ROWNO], /* Starting column for new info. */ coordxy t_start[ROWNO], /* Starting column for new info. */
t_stop[ROWNO]; /* Ending column for new info. */ t_stop[ROWNO]; /* Ending column for new info. */
boolean is_tile; /* true if currently using tiles */ boolean is_tile; /* true if currently using tiles */
@@ -455,7 +455,7 @@ extern void X11_wait_synch(void);
#ifdef CLIPPING #ifdef CLIPPING
extern void X11_cliparound(int, int); extern void X11_cliparound(int, int);
#endif #endif
extern void X11_print_glyph(winid, xchar, xchar, const glyph_info *, extern void X11_print_glyph(winid, coordxy, coordxy, const glyph_info *,
const glyph_info *); const glyph_info *);
extern void X11_raw_print(const char *); extern void X11_raw_print(const char *);
extern void X11_raw_print_bold(const char *); extern void X11_raw_print_bold(const char *);
+2 -2
View File
@@ -37,13 +37,13 @@ struct amii_menu {
* tty-style windows also, then things will need to change. */ * tty-style windows also, then things will need to change. */
/* per-window data */ /* per-window data */
struct amii_WinDesc { struct amii_WinDesc {
xchar type; /* type of window */ xint16 type; /* type of window */
struct amii_menu menu; struct amii_menu menu;
boolean active; /* true if window is active */ boolean active; /* true if window is active */
boolean wasup; /* true if menu/text window was already open */ boolean wasup; /* true if menu/text window was already open */
short short
disprows; /* Rows displayed so far (used for paging in message win) */ disprows; /* Rows displayed so far (used for paging in message win) */
xchar offx, offy; /* offset from topleft of display */ coordxy offx, offy; /* offset from topleft of display */
short vwx, vwy, vcx, vcy; /* View cursor location */ short vwx, vwy, vcx, vcy; /* View cursor location */
short rows, cols; /* dimensions */ short rows, cols; /* dimensions */
short curx, cury; /* current cursor position */ short curx, cury; /* current cursor position */
+1 -1
View File
@@ -92,7 +92,7 @@ extern int curses_select_menu(winid wid, int how, MENU_ITEM_P **selected);
extern void curses_mark_synch(void); extern void curses_mark_synch(void);
extern void curses_wait_synch(void); extern void curses_wait_synch(void);
extern void curses_cliparound(int x, int y); extern void curses_cliparound(int x, int y);
extern void curses_print_glyph(winid wid, xchar x, xchar y, extern void curses_print_glyph(winid wid, coordxy x, coordxy y,
const glyph_info *, const glyph_info *); const glyph_info *, const glyph_info *);
extern void curses_raw_print(const char *str); extern void curses_raw_print(const char *str);
extern void curses_raw_print_bold(const char *str); extern void curses_raw_print_bold(const char *str);
+3 -3
View File
@@ -54,7 +54,7 @@ struct window_procs {
#ifdef POSITIONBAR #ifdef POSITIONBAR
void (*win_update_positionbar)(char *); void (*win_update_positionbar)(char *);
#endif #endif
void (*win_print_glyph)(winid, xchar, xchar, void (*win_print_glyph)(winid, coordxy, coordxy,
const glyph_info *, const glyph_info *); const glyph_info *, const glyph_info *);
void (*win_raw_print)(const char *); void (*win_raw_print)(const char *);
void (*win_raw_print_bold)(const char *); void (*win_raw_print_bold)(const char *);
@@ -375,7 +375,7 @@ struct chain_procs {
#ifdef POSITIONBAR #ifdef POSITIONBAR
void (*win_update_positionbar)(CARGS, char *); void (*win_update_positionbar)(CARGS, char *);
#endif #endif
void (*win_print_glyph)(CARGS, winid, xchar, xchar, void (*win_print_glyph)(CARGS, winid, coordxy, coordxy,
const glyph_info *, const glyph_info *,
const glyph_info *); const glyph_info *);
void (*win_raw_print)(CARGS, const char *); void (*win_raw_print)(CARGS, const char *);
@@ -452,7 +452,7 @@ extern void safe_cliparound(int, int);
#ifdef POSITIONBAR #ifdef POSITIONBAR
extern void safe_update_positionbar(char *); extern void safe_update_positionbar(char *);
#endif #endif
extern void safe_print_glyph(winid, xchar, xchar, extern void safe_print_glyph(winid, coordxy, coordxy,
const glyph_info *, const glyph_info *); const glyph_info *, const glyph_info *);
extern void safe_raw_print(const char *); extern void safe_raw_print(const char *);
extern void safe_raw_print_bold(const char *); extern void safe_raw_print_bold(const char *);
+2 -2
View File
@@ -46,7 +46,7 @@ typedef struct tty_mi {
/* descriptor for tty-based windows */ /* descriptor for tty-based windows */
struct WinDesc { struct WinDesc {
int flags; /* window flags */ int flags; /* window flags */
xchar type; /* type of window */ xint16 type; /* type of window */
boolean active; /* true if window is active */ boolean active; /* true if window is active */
short offx, offy; /* offset from topleft of display */ short offx, offy; /* offset from topleft of display */
long rows, cols; /* dimensions */ long rows, cols; /* dimensions */
@@ -249,7 +249,7 @@ E void tty_cliparound(int, int);
#ifdef POSITIONBAR #ifdef POSITIONBAR
E void tty_update_positionbar(char *); E void tty_update_positionbar(char *);
#endif #endif
E void tty_print_glyph(winid, xchar, xchar, const glyph_info *, E void tty_print_glyph(winid, coordxy, coordxy, const glyph_info *,
const glyph_info *); const glyph_info *);
E void tty_raw_print(const char *); E void tty_raw_print(const char *);
E void tty_raw_print_bold(const char *); E void tty_raw_print_bold(const char *);
+14 -14
View File
@@ -22,9 +22,9 @@ struct RoleName {
struct RoleAdvance { struct RoleAdvance {
/* "fix" is the fixed amount, "rnd" is the random amount */ /* "fix" is the fixed amount, "rnd" is the random amount */
xchar infix, inrnd; /* at character initialization */ xint16 infix, inrnd; /* at character initialization */
xchar lofix, lornd; /* gained per level < g.urole.xlev */ xint16 lofix, lornd; /* gained per level < g.urole.xlev */
xchar hifix, hirnd; /* gained per level >= g.urole.xlev */ xint16 hifix, hirnd; /* gained per level >= g.urole.xlev */
}; };
struct u_have { struct u_have {
@@ -198,12 +198,12 @@ struct Role {
#define ROLE_CHAOTIC AM_CHAOTIC #define ROLE_CHAOTIC AM_CHAOTIC
/*** Attributes (from attrib.c and exper.c) ***/ /*** Attributes (from attrib.c and exper.c) ***/
xchar attrbase[A_MAX]; /* lowest initial attributes */ xint16 attrbase[A_MAX]; /* lowest initial attributes */
xchar attrdist[A_MAX]; /* distribution of initial attributes */ xint16 attrdist[A_MAX]; /* distribution of initial attributes */
struct RoleAdvance hpadv; /* hit point advancement */ struct RoleAdvance hpadv; /* hit point advancement */
struct RoleAdvance enadv; /* energy advancement */ struct RoleAdvance enadv; /* energy advancement */
xchar xlev; /* cutoff experience level */ xint16 xlev; /* cutoff experience level */
xchar initrecord; /* initial alignment record */ xint16 initrecord; /* initial alignment record */
/*** Spell statistics (from spell.c) ***/ /*** Spell statistics (from spell.c) ***/
int spelbase; /* base spellcasting penalty */ int spelbase; /* base spellcasting penalty */
@@ -258,8 +258,8 @@ struct Race {
hatemask; /* bit mask of always hostile */ hatemask; /* bit mask of always hostile */
/*** Attributes ***/ /*** Attributes ***/
xchar attrmin[A_MAX]; /* minimum allowable attribute */ xint16 attrmin[A_MAX]; /* minimum allowable attribute */
xchar attrmax[A_MAX]; /* maximum allowable attribute */ xint16 attrmax[A_MAX]; /* maximum allowable attribute */
struct RoleAdvance hpadv; /* hit point advancement */ struct RoleAdvance hpadv; /* hit point advancement */
struct RoleAdvance enadv; /* energy advancement */ struct RoleAdvance enadv; /* energy advancement */
#if 0 /* DEFERRED */ #if 0 /* DEFERRED */
@@ -347,11 +347,11 @@ enum utotypes {
/*** Information about the player ***/ /*** Information about the player ***/
struct you { struct you {
xchar ux, uy; /* current map coordinates */ coordxy ux, uy; /* current map coordinates */
schar dx, dy, dz; /* direction of move (or zap or ... ) */ schar dx, dy, dz; /* direction of move (or zap or ... ) */
schar di; /* direction of FF */ schar di; /* direction of FF */
xchar tx, ty; /* destination of travel */ coordxy tx, ty; /* destination of travel */
xchar ux0, uy0; /* initial position FF */ coordxy ux0, uy0; /* initial position FF */
d_level uz, uz0; /* your level on this and the previous turn */ d_level uz, uz0; /* your level on this and the previous turn */
d_level utolev; /* level monster teleported you to, or uz */ d_level utolev; /* level monster teleported you to, or uz */
uchar utotype; /* bitmask of goto_level() flags for utolev */ uchar utotype; /* bitmask of goto_level() flags for utolev */
@@ -455,7 +455,7 @@ struct you {
uhppeak; /* highest value of uhpmax so far */ uhppeak; /* highest value of uhpmax so far */
int uen, uenmax, /* magical energy, aka spell power */ int uen, uenmax, /* magical energy, aka spell power */
uenpeak; /* highest value of uenmax so far */ uenpeak; /* highest value of uenmax so far */
xchar uhpinc[MAXULEV], /* increases to uhpmax for each level gain */ xint16 uhpinc[MAXULEV], /* increases to uhpmax for each level gain */
ueninc[MAXULEV]; /* increases to uenmax for each level gain */ ueninc[MAXULEV]; /* increases to uenmax for each level gain */
int ugangr; /* if the gods are angry at you */ int ugangr; /* if the gods are angry at you */
int ugifts; /* number of artifacts bestowed */ int ugifts; /* number of artifacts bestowed */
@@ -474,7 +474,7 @@ struct you {
int ugrave_arise; /* you die and become something aside from a ghost */ int ugrave_arise; /* you die and become something aside from a ghost */
int weapon_slots; /* unused skill slots */ int weapon_slots; /* unused skill slots */
int skills_advanced; /* # of advances made so far */ int skills_advanced; /* # of advances made so far */
xchar skill_record[P_SKILL_LIMIT]; /* skill advancements */ xint16 skill_record[P_SKILL_LIMIT]; /* skill advancements */
struct skills weapon_skills[P_NUM_SKILLS]; struct skills weapon_skills[P_NUM_SKILLS];
boolean twoweap; /* KMH -- Using two-weapon combat */ boolean twoweap; /* KMH -- Using two-weapon combat */
short mcham; /* vampire mndx if shapeshifted to bat/cloud */ short mcham; /* vampire mndx if shapeshifted to bat/cloud */
+1 -1
View File
@@ -267,7 +267,7 @@ moveloop_core(void)
if (!u.uinvulnerable) { if (!u.uinvulnerable) {
if (Teleportation && !rn2(85)) { if (Teleportation && !rn2(85)) {
xchar old_ux = u.ux, old_uy = u.uy; coordxy old_ux = u.ux, old_uy = u.uy;
tele(); tele();
if (u.ux != old_ux || u.uy != old_uy) { if (u.ux != old_ux || u.uy != old_uy) {
+8 -8
View File
@@ -654,7 +654,7 @@ magic_whistled(struct obj *obj)
} }
boolean boolean
um_dist(xchar x, xchar y, xchar n) um_dist(coordxy x, coordxy y, xint16 n)
{ {
return (boolean) (abs(u.ux - x) > n || abs(u.uy - y) > n); return (boolean) (abs(u.ux - x) > n || abs(u.uy - y) > n);
} }
@@ -889,7 +889,7 @@ next_to_u(void)
} }
void void
check_leash(xchar x, xchar y) check_leash(coordxy x, coordxy y)
{ {
register struct obj *otmp; register struct obj *otmp;
register struct monst *mtmp; register struct monst *mtmp;
@@ -1427,7 +1427,7 @@ snuff_candle(struct obj *otmp)
if ((candle || otmp->otyp == CANDELABRUM_OF_INVOCATION) if ((candle || otmp->otyp == CANDELABRUM_OF_INVOCATION)
&& otmp->lamplit) { && otmp->lamplit) {
char buf[BUFSZ]; char buf[BUFSZ];
xchar x, y; coordxy x, y;
boolean many = candle ? (otmp->quan > 1L) : (otmp->spe > 1); boolean many = candle ? (otmp->quan > 1L) : (otmp->spe > 1);
(void) get_obj_location(otmp, &x, &y, 0); (void) get_obj_location(otmp, &x, &y, 0);
@@ -1447,7 +1447,7 @@ snuff_candle(struct obj *otmp)
boolean boolean
snuff_lit(struct obj *obj) snuff_lit(struct obj *obj)
{ {
xchar x, y; coordxy x, y;
if (obj->lamplit) { if (obj->lamplit) {
if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
@@ -1491,7 +1491,7 @@ splash_lit(struct obj *obj)
/* don't assume that lit lantern has been swallowed; /* don't assume that lit lantern has been swallowed;
a nymph might have stolen it or picked it up */ a nymph might have stolen it or picked it up */
&& ((mtmp = obj->ocarry), humanoid(mtmp->data))) { && ((mtmp = obj->ocarry), humanoid(mtmp->data))) {
xchar x, y; coordxy x, y;
useeit = get_obj_location(obj, &x, &y, 0) && cansee(x, y); useeit = get_obj_location(obj, &x, &y, 0) && cansee(x, y);
uhearit = couldsee(x, y) && distu(x, y) < 5 * 5; uhearit = couldsee(x, y) && distu(x, y) < 5 * 5;
@@ -1525,7 +1525,7 @@ splash_lit(struct obj *obj)
boolean boolean
catch_lit(struct obj *obj) catch_lit(struct obj *obj)
{ {
xchar x, y; coordxy x, y;
if (!obj->lamplit && ignitable(obj) && get_obj_location(obj, &x, &y, 0)) { if (!obj->lamplit && ignitable(obj) && get_obj_location(obj, &x, &y, 0)) {
if (((obj->otyp == MAGIC_LAMP /* spe==0 => no djinni inside */ if (((obj->otyp == MAGIC_LAMP /* spe==0 => no djinni inside */
@@ -2380,7 +2380,7 @@ fig_transform(anything *arg, long timeout)
static boolean static boolean
figurine_location_checks(struct obj *obj, coord *cc, boolean quietly) figurine_location_checks(struct obj *obj, coord *cc, boolean quietly)
{ {
xchar x, y; coordxy x, y;
if (carried(obj) && u.uswallow) { if (carried(obj) && u.uswallow) {
if (!quietly) if (!quietly)
@@ -2414,7 +2414,7 @@ static int
use_figurine(struct obj **optr) use_figurine(struct obj **optr)
{ {
register struct obj *obj = *optr; register struct obj *obj = *optr;
xchar x, y; coordxy x, y;
coord cc; coord cc;
if (u.uswallow) { if (u.uswallow) {
+3 -3
View File
@@ -57,7 +57,7 @@ struct arti_info {
static struct arti_info artiexist[1 + NROFARTIFACTS]; static struct arti_info artiexist[1 + NROFARTIFACTS];
/* discovery list; for N discovered artifacts, the first N entries are ART_xx /* discovery list; for N discovered artifacts, the first N entries are ART_xx
values in discovery order, the remaining (NROFARTIFACTS-N) slots are 0 */ values in discovery order, the remaining (NROFARTIFACTS-N) slots are 0 */
static xchar artidisco[NROFARTIFACTS]; static xint16 artidisco[NROFARTIFACTS];
/* note: artiexist[] and artidisco[] don't need to be in struct g; they /* note: artiexist[] and artidisco[] don't need to be in struct g; they
* get explicitly initialized at game start so don't need to be part of * get explicitly initialized at game start so don't need to be part of
* bulk re-init if game restart ever gets implemented. They are saved * bulk re-init if game restart ever gets implemented. They are saved
@@ -1001,7 +1001,7 @@ spec_dbon(struct obj *otmp, struct monst *mon, int tmp)
/* add identified artifact to discoveries list */ /* add identified artifact to discoveries list */
void void
discover_artifact(xchar m) discover_artifact(xint16 m)
{ {
int i; int i;
@@ -1019,7 +1019,7 @@ discover_artifact(xchar m)
/* used to decide whether an artifact has been fully identified */ /* used to decide whether an artifact has been fully identified */
boolean boolean
undiscovered_artifact(xchar m) undiscovered_artifact(xint16 m)
{ {
int i; int i;
+1 -1
View File
@@ -1025,7 +1025,7 @@ newhp(void)
hp = 1; hp = 1;
if (u.ulevel < MAXULEV) { if (u.ulevel < MAXULEV) {
/* remember increment; future level drain could take it away again */ /* remember increment; future level drain could take it away again */
u.uhpinc[u.ulevel] = (xchar) hp; u.uhpinc[u.ulevel] = (xint16) hp;
} else { } else {
/* after level 30, throttle hit point gains from extra experience; /* after level 30, throttle hit point gains from extra experience;
once max reaches 1200, further increments will be just 1 more */ once max reaches 1200, further increments will be just 1 more */
+8 -8
View File
@@ -431,8 +431,8 @@ set_bc(int already_blind)
* Should not be called while swallowed. * Should not be called while swallowed.
*/ */
void void
move_bc(int before, int control, xchar ballx, xchar bally, move_bc(int before, int control, coordxy ballx, coordxy bally,
xchar chainx, xchar chainy) coordxy chainx, coordxy chainy)
{ {
if (Blind) { if (Blind) {
/* /*
@@ -554,8 +554,8 @@ move_bc(int before, int control, xchar ballx, xchar bally,
/* return TRUE if the caller needs to place the ball and chain down again */ /* return TRUE if the caller needs to place the ball and chain down again */
boolean boolean
drag_ball(xchar x, xchar y, int *bc_control, drag_ball(coordxy x, coordxy y, int *bc_control,
xchar *ballx, xchar *bally, xchar *chainx, xchar *chainy, coordxy *ballx, coordxy *bally, coordxy *chainx, coordxy *chainy,
boolean *cause_delay, boolean allow_drag) boolean *cause_delay, boolean allow_drag)
{ {
struct trap *t = (struct trap *) 0; struct trap *t = (struct trap *) 0;
@@ -589,7 +589,7 @@ drag_ball(xchar x, xchar y, int *bc_control,
/* only need to move the chain? */ /* only need to move the chain? */
if (carried(uball) || distmin(x, y, uball->ox, uball->oy) <= 2) { if (carried(uball) || distmin(x, y, uball->ox, uball->oy) <= 2) {
xchar oldchainx = uchain->ox, oldchainy = uchain->oy; coordxy oldchainx = uchain->ox, oldchainy = uchain->oy;
*bc_control = BC_CHAIN; *bc_control = BC_CHAIN;
move_bc(1, *bc_control, *ballx, *bally, *chainx, *chainy); move_bc(1, *bc_control, *ballx, *bally, *chainx, *chainy);
@@ -646,7 +646,7 @@ drag_ball(xchar x, xchar y, int *bc_control,
* 0 * 0
*/ */
case 5: { case 5: {
xchar tempx, tempy, tempx2, tempy2; coordxy tempx, tempy, tempx2, tempy2;
/* find position closest to current position of chain; /* find position closest to current position of chain;
no effect if current position is already OK */ no effect if current position is already OK */
@@ -835,7 +835,7 @@ drag_ball(xchar x, xchar y, int *bc_control,
*ballx = *chainx = x; *ballx = *chainx = x;
*bally = *chainy = y; *bally = *chainy = y;
} else { } else {
xchar newchainx = u.ux, newchainy = u.uy; coordxy newchainx = u.ux, newchainy = u.uy;
/* /*
* Generally, chain moves to hero's previous location and ball * Generally, chain moves to hero's previous location and ball
@@ -877,7 +877,7 @@ DISABLE_WARNING_FORMAT_NONLITERAL
* Should not be called while swallowed. * Should not be called while swallowed.
*/ */
void void
drop_ball(xchar x, xchar y) drop_ball(coordxy x, coordxy y)
{ {
if (Blind) { if (Blind) {
/* get the order */ /* get the order */
+1 -1
View File
@@ -82,7 +82,7 @@ resetobjs(struct obj *ochain, boolean restore)
if (otmp->oclass == FOOD_CLASS && otmp->oeaten) { if (otmp->oclass == FOOD_CLASS && otmp->oeaten) {
struct obj *top; struct obj *top;
char *p; char *p;
xchar ox, oy; coordxy ox, oy;
for (top = otmp; top->where == OBJ_CONTAINED; for (top = otmp; top->where == OBJ_CONTAINED;
top = top->ocontainer) top = top->ocontainer)
+5 -5
View File
@@ -1144,7 +1144,7 @@ static int
wiz_where(void) wiz_where(void)
{ {
if (wizard) if (wizard)
(void) print_dungeon(FALSE, (schar *) 0, (xchar *) 0); (void) print_dungeon(FALSE, (schar *) 0, (xint16 *) 0);
else else
pline(unavailcmd, ecname_from_fn(wiz_where)); pline(unavailcmd, ecname_from_fn(wiz_where));
return ECMD_OK; return ECMD_OK;
@@ -4383,10 +4383,10 @@ int
get_adjacent_loc( get_adjacent_loc(
const char *prompt, const char *prompt,
const char *emsg, const char *emsg,
xchar x, xchar y, coordxy x, coordxy y,
coord *cc) coord *cc)
{ {
xchar new_x, new_y; coordxy new_x, new_y;
if (!getdir(prompt)) { if (!getdir(prompt)) {
pline1(Never_mind); pline1(Never_mind);
return 0; return 0;
@@ -5008,7 +5008,7 @@ there_cmd_menu_next2u(
} }
static int static int
there_cmd_menu_far(winid win, xchar x, xchar y, int mod) there_cmd_menu_far(winid win, coordxy x, coordxy y, int mod)
{ {
int K = 0; int K = 0;
@@ -5025,7 +5025,7 @@ there_cmd_menu_far(winid win, xchar x, xchar y, int mod)
static int static int
there_cmd_menu_common( there_cmd_menu_common(
winid win, winid win,
xchar x UNUSED, xchar y UNUSED, coordxy x UNUSED, coordxy y UNUSED,
int mod, int mod,
int *act UNUSED) int *act UNUSED)
{ {
+1 -1
View File
@@ -34,7 +34,7 @@ static boolean e_jumps(struct entity *);
static void do_entity(struct entity *); static void do_entity(struct entity *);
boolean boolean
is_waterwall(xchar x, xchar y) is_waterwall(coordxy x, coordxy y)
{ {
if (isok(x, y) && IS_WATERWALL(levl[x][y].typ)) if (isok(x, y) && IS_WATERWALL(levl[x][y].typ))
return TRUE; return TRUE;
+4 -4
View File
@@ -19,7 +19,7 @@ static void map_monst(struct monst *, boolean);
static void do_dknown_of(struct obj *); static void do_dknown_of(struct obj *);
static boolean check_map_spot(int, int, char, unsigned); static boolean check_map_spot(int, int, char, unsigned);
static boolean clear_stale_map(char, unsigned); static boolean clear_stale_map(char, unsigned);
static void sense_trap(struct trap *, xchar, xchar, int); static void sense_trap(struct trap *, coordxy, coordxy, int);
static int detect_obj_traps(struct obj *, boolean, int); static int detect_obj_traps(struct obj *, boolean, int);
static void display_trap_map(struct trap *, int); static void display_trap_map(struct trap *, int);
static int furniture_detect(void); static int furniture_detect(void);
@@ -837,7 +837,7 @@ monster_detect(struct obj *otmp, /* detecting object (if any) */
} }
static void static void
sense_trap(struct trap *trap, xchar x, xchar y, int src_cursed) sense_trap(struct trap *trap, coordxy x, coordxy y, int src_cursed)
{ {
if (Hallucination || src_cursed) { if (Hallucination || src_cursed) {
struct obj obj; /* fake object */ struct obj obj; /* fake object */
@@ -885,7 +885,7 @@ detect_obj_traps(
int how) /* 1 for misleading map feedback */ int how) /* 1 for misleading map feedback */
{ {
struct obj *otmp; struct obj *otmp;
xchar x, y; coordxy x, y;
int result = OTRAP_NONE; int result = OTRAP_NONE;
/* /*
@@ -1776,7 +1776,7 @@ mfind0(struct monst *mtmp, boolean via_warning)
int int
dosearch0(int aflag) /* intrinsic autosearch vs explicit searching */ dosearch0(int aflag) /* intrinsic autosearch vs explicit searching */
{ {
xchar x, y; coordxy x, y;
register struct trap *trap; register struct trap *trap;
register struct monst *mtmp; register struct monst *mtmp;
+13 -13
View File
@@ -6,7 +6,7 @@
#include "hack.h" #include "hack.h"
static boolean rm_waslit(void); static boolean rm_waslit(void);
static void mkcavepos(xchar, xchar, int, boolean, boolean); static void mkcavepos(coordxy, coordxy, int, boolean, boolean);
static void mkcavearea(boolean); static void mkcavearea(boolean);
static int dig(void); static int dig(void);
static void dig_up_grave(coord *); static void dig_up_grave(coord *);
@@ -28,7 +28,7 @@ enum dig_types {
static boolean static boolean
rm_waslit(void) rm_waslit(void)
{ {
register xchar x, y; register coordxy x, y;
if (levl[u.ux][u.uy].typ == ROOM && levl[u.ux][u.uy].waslit) if (levl[u.ux][u.uy].typ == ROOM && levl[u.ux][u.uy].waslit)
return TRUE; return TRUE;
@@ -44,7 +44,7 @@ rm_waslit(void)
* immediately after the effect is complete. * immediately after the effect is complete.
*/ */
static void static void
mkcavepos(xchar x, xchar y, int dist, boolean waslit, boolean rockit) mkcavepos(coordxy x, coordxy y, int dist, boolean waslit, boolean rockit)
{ {
register struct rm *lev; register struct rm *lev;
@@ -87,9 +87,9 @@ static void
mkcavearea(boolean rockit) mkcavearea(boolean rockit)
{ {
int dist; int dist;
xchar xmin = u.ux, xmax = u.ux; coordxy xmin = u.ux, xmax = u.ux;
xchar ymin = u.uy, ymax = u.uy; coordxy ymin = u.uy, ymax = u.uy;
register xchar i; register coordxy i;
register boolean waslit = rm_waslit(); register boolean waslit = rm_waslit();
if (rockit) if (rockit)
@@ -135,7 +135,7 @@ mkcavearea(boolean rockit)
/* When digging into location <x,y>, what are you actually digging into? */ /* When digging into location <x,y>, what are you actually digging into? */
int int
dig_typ(struct obj *otmp, xchar x, xchar y) dig_typ(struct obj *otmp, coordxy x, coordxy y)
{ {
boolean ispick; boolean ispick;
@@ -231,7 +231,7 @@ static int
dig(void) dig(void)
{ {
struct rm *lev; struct rm *lev;
xchar dpx = g.context.digging.pos.x, dpy = g.context.digging.pos.y; coordxy dpx = g.context.digging.pos.x, dpy = g.context.digging.pos.y;
boolean ispick = uwep && is_pick(uwep); boolean ispick = uwep && is_pick(uwep);
const char *verb = (!uwep || is_pick(uwep)) ? "dig into" : "chop through"; const char *verb = (!uwep || is_pick(uwep)) ? "dig into" : "chop through";
@@ -734,7 +734,7 @@ DISABLE_WARNING_FORMAT_NONLITERAL
* in apply.c. * in apply.c.
*/ */
void void
liquid_flow(xchar x, xchar y, schar typ, struct trap *ttmp, liquid_flow(coordxy x, coordxy y, schar typ, struct trap *ttmp,
const char *fillmsg) const char *fillmsg)
{ {
struct obj *objchain; struct obj *objchain;
@@ -773,7 +773,7 @@ dighole(boolean pit_only, boolean by_magic, coord *cc)
struct rm *lev; struct rm *lev;
struct obj *boulder_here; struct obj *boulder_here;
schar typ, old_typ; schar typ, old_typ;
xchar dig_x, dig_y; coordxy dig_x, dig_y;
boolean nohole, retval = FALSE; boolean nohole, retval = FALSE;
if (!cc) { if (!cc) {
@@ -901,7 +901,7 @@ static void
dig_up_grave(coord *cc) dig_up_grave(coord *cc)
{ {
struct obj *otmp; struct obj *otmp;
xchar dig_x, dig_y; coordxy dig_x, dig_y;
if (!cc) { if (!cc) {
dig_x = u.ux; dig_x = u.ux;
@@ -1220,7 +1220,7 @@ watchman_canseeu(struct monst *mtmp)
* zap == TRUE if wand/spell of digging, FALSE otherwise (chewing) * zap == TRUE if wand/spell of digging, FALSE otherwise (chewing)
*/ */
void void
watch_dig(struct monst *mtmp, xchar x, xchar y, boolean zap) watch_dig(struct monst *mtmp, coordxy x, coordxy y, boolean zap)
{ {
struct rm *lev = &levl[x][y]; struct rm *lev = &levl[x][y];
@@ -1985,7 +1985,7 @@ rot_organic(anything *arg, long timeout UNUSED)
void void
rot_corpse(anything *arg, long timeout) rot_corpse(anything *arg, long timeout)
{ {
xchar x = 0, y = 0; coordxy x = 0, y = 0;
struct obj *obj = arg->a_obj; struct obj *obj = arg->a_obj;
boolean on_floor = obj->where == OBJ_FLOOR, boolean on_floor = obj->where == OBJ_FLOOR,
in_invent = obj->where == OBJ_INVENT; in_invent = obj->where == OBJ_INVENT;
+19 -19
View File
@@ -124,16 +124,16 @@
#include "hack.h" #include "hack.h"
static void show_mon_or_warn(int, int, int); static void show_mon_or_warn(int, int, int);
static void display_monster(xchar, xchar, struct monst *, int, boolean); static void display_monster(coordxy, coordxy, struct monst *, int, boolean);
static int swallow_to_glyph(int, int); static int swallow_to_glyph(int, int);
static void display_warning(struct monst *); static void display_warning(struct monst *);
static int check_pos(int, int, int); static int check_pos(int, int, int);
static int get_bk_glyph(xchar x, xchar y); static int get_bk_glyph(coordxy x, coordxy y);
static int tether_glyph(int, int); static int tether_glyph(int, int);
static void mimic_light_blocking(struct monst *); static void mimic_light_blocking(struct monst *);
#ifdef UNBUFFERED_GLYPHINFO #ifdef UNBUFFERED_GLYPHINFO
static glyph_info *glyphinfo_at(xchar, xchar, int); static glyph_info *glyphinfo_at(coordxy, coordxy, int);
#endif #endif
/*#define WA_VERBOSE*/ /* give (x,y) locations for all "bad" spots */ /*#define WA_VERBOSE*/ /* give (x,y) locations for all "bad" spots */
@@ -229,7 +229,7 @@ is_safemon(struct monst *mon)
* attention to and correct unexplored, lit ROOM and CORR spots. * attention to and correct unexplored, lit ROOM and CORR spots.
*/ */
void void
magic_map_background(xchar x, xchar y, int show) magic_map_background(coordxy x, coordxy y, int show)
{ {
int glyph = back_to_glyph(x, y); /* assumes hero can see x,y */ int glyph = back_to_glyph(x, y); /* assumes hero can see x,y */
struct rm *lev = &levl[x][y]; struct rm *lev = &levl[x][y];
@@ -266,7 +266,7 @@ magic_map_background(xchar x, xchar y, int show)
* having to create fake objects and traps. However, I am reluctant to * having to create fake objects and traps. However, I am reluctant to
* make this change. * make this change.
*/ */
/* FIXME: some of these use xchars for x and y, and some use ints. Make /* FIXME: some of these use coordxys for x and y, and some use ints. Make
* this consistent. * this consistent.
*/ */
@@ -277,7 +277,7 @@ magic_map_background(xchar x, xchar y, int show)
* the hero can physically see the location. Update the screen if directed. * the hero can physically see the location. Update the screen if directed.
*/ */
void void
map_background(register xchar x, register xchar y, register int show) map_background(register coordxy x, register coordxy y, register int show)
{ {
register int glyph = back_to_glyph(x, y); register int glyph = back_to_glyph(x, y);
@@ -341,7 +341,7 @@ map_object(register struct obj *obj, register int show)
* by newsym() if necessary. * by newsym() if necessary.
*/ */
void void
map_invisible(register xchar x, register xchar y) map_invisible(register coordxy x, register coordxy y)
{ {
if (x != u.ux || y != u.uy) { /* don't display I at hero's location */ if (x != u.ux || y != u.uy) { /* don't display I at hero's location */
if (g.level.flags.hero_memory) if (g.level.flags.hero_memory)
@@ -458,7 +458,7 @@ show_mon_or_warn(int x, int y, int monglyph)
* *
*/ */
static void static void
display_monster(xchar x, xchar y, /* display position */ display_monster(coordxy x, coordxy y, /* display position */
struct monst *mon, /* monster to display */ struct monst *mon, /* monster to display */
int sightflags, /* 1 if the monster is physically seen; int sightflags, /* 1 if the monster is physically seen;
2 if detected using Detect_monsters */ 2 if detected using Detect_monsters */
@@ -626,7 +626,7 @@ suppress_map_output(void)
* When hero knows what happened to location, even when blind. * When hero knows what happened to location, even when blind.
*/ */
void void
feel_newsym(xchar x, xchar y) feel_newsym(coordxy x, coordxy y)
{ {
if (Blind) if (Blind)
feel_location(x, y); feel_location(x, y);
@@ -646,7 +646,7 @@ feel_newsym(xchar x, xchar y)
* searching only finds one monster per turn so we must check that separately. * searching only finds one monster per turn so we must check that separately.
*/ */
void void
feel_location(xchar x, xchar y) feel_location(coordxy x, coordxy y)
{ {
struct rm *lev; struct rm *lev;
struct obj *boulder; struct obj *boulder;
@@ -978,7 +978,7 @@ newsym(register int x, register int y)
* pulled into a platform dependent routine for fancier graphics if desired. * pulled into a platform dependent routine for fancier graphics if desired.
*/ */
void void
shieldeff(xchar x, xchar y) shieldeff(coordxy x, coordxy y)
{ {
register int i; register int i;
@@ -1198,7 +1198,7 @@ flash_glyph_at(int x, int y, int tg, int rpt)
void void
swallowed(int first) swallowed(int first)
{ {
static xchar lastx, lasty; /* last swallowed position */ static coordxy lastx, lasty; /* last swallowed position */
int swallower, left_ok, rght_ok; int swallower, left_ok, rght_ok;
if (first) { if (first) {
@@ -1261,7 +1261,7 @@ swallowed(int first)
void void
under_water(int mode) under_water(int mode)
{ {
static xchar lastx, lasty; static coordxy lastx, lasty;
static boolean dela; static boolean dela;
register int x, y; register int x, y;
@@ -1600,7 +1600,7 @@ redraw_map(void)
void void
reglyph_darkroom(void) reglyph_darkroom(void)
{ {
xchar x, y; coordxy x, y;
for (x = 1; x < COLNO; x++) for (x = 1; x < COLNO; x++)
for (y = 0; y < ROWNO; y++) { for (y = 0; y < ROWNO; y++) {
@@ -1988,7 +1988,7 @@ flush_screen(int cursor_on_u)
* variables. * variables.
*/ */
int int
back_to_glyph(xchar x, xchar y) back_to_glyph(coordxy x, coordxy y)
{ {
int idx, bypass_glyph = NO_GLYPH; int idx, bypass_glyph = NO_GLYPH;
struct rm *ptr = &(levl[x][y]); struct rm *ptr = &(levl[x][y]);
@@ -2170,7 +2170,7 @@ zapdir_to_glyph(int dx, int dy, int beam_type)
* structure, so we must check the "third screen". * structure, so we must check the "third screen".
*/ */
int int
glyph_at(xchar x, xchar y) glyph_at(coordxy x, coordxy y)
{ {
if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO) if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO)
return cmap_to_glyph(S_room); /* XXX */ return cmap_to_glyph(S_room); /* XXX */
@@ -2179,7 +2179,7 @@ glyph_at(xchar x, xchar y)
#ifdef UNBUFFERED_GLYPHINFO #ifdef UNBUFFERED_GLYPHINFO
glyph_info * glyph_info *
glyphinfo_at(xchar x, xchar y, int glyph) glyphinfo_at(coordxy x, coordxy y, int glyph)
{ {
map_glyphinfo(x, y, glyph, 0, &ginfo); map_glyphinfo(x, y, glyph, 0, &ginfo);
return &ginfo; return &ginfo;
@@ -2200,7 +2200,7 @@ glyphinfo_at(xchar x, xchar y, int glyph)
*/ */
static int static int
get_bk_glyph(xchar x, xchar y) get_bk_glyph(coordxy x, coordxy y)
{ {
int idx, bkglyph = GLYPH_UNEXPLORED; int idx, bkglyph = GLYPH_UNEXPLORED;
struct rm *lev = &levl[x][y]; struct rm *lev = &levl[x][y];
@@ -2272,7 +2272,7 @@ get_bk_glyph(xchar x, xchar y)
void void
map_glyphinfo( map_glyphinfo(
xchar x, xchar y, coordxy x, coordxy y,
int glyph, int glyph,
unsigned mgflags, unsigned mgflags,
glyph_info *glyphinfo) glyph_info *glyphinfo)
+5 -5
View File
@@ -18,7 +18,7 @@ static int menu_drop(int);
static NHFILE *currentlevel_rewrite(void); static NHFILE *currentlevel_rewrite(void);
static void final_level(void); static void final_level(void);
/* static boolean badspot(xchar,xchar); */ /* static boolean badspot(coordxy,coordxy); */
/* the #drop command: drop one inventory item */ /* the #drop command: drop one inventory item */
int int
@@ -1237,7 +1237,7 @@ save_currentstate(void)
/* /*
static boolean static boolean
badspot(register xchar x, register xchar y) badspot(register coordxy x, register coordxy y)
{ {
return (boolean) ((levl[x][y].typ != ROOM return (boolean) ((levl[x][y].typ != ROOM
&& levl[x][y].typ != AIR && levl[x][y].typ != AIR
@@ -1295,7 +1295,7 @@ goto_level(
{ {
int l_idx, save_mode; int l_idx, save_mode;
NHFILE *nhfp; NHFILE *nhfp;
xchar new_ledger; xint16 new_ledger;
boolean cant_go_back, great_effort, boolean cant_go_back, great_effort,
up = (depth(newlevel) < depth(&u.uz)), up = (depth(newlevel) < depth(&u.uz)),
newdungeon = (u.uz.dnum != newlevel->dnum), newdungeon = (u.uz.dnum != newlevel->dnum),
@@ -1890,7 +1890,7 @@ revive_corpse(struct obj *corpse)
{ {
struct monst *mtmp, *mcarry; struct monst *mtmp, *mcarry;
boolean is_uwep, chewed; boolean is_uwep, chewed;
xchar where; xint16 where;
char cname[BUFSZ]; char cname[BUFSZ];
struct obj *container = (struct obj *) 0; struct obj *container = (struct obj *) 0;
int container_where = 0; int container_where = 0;
@@ -2005,7 +2005,7 @@ revive_mon(anything *arg, long timeout UNUSED)
struct obj *body = arg->a_obj; struct obj *body = arg->a_obj;
struct permonst *mptr = &mons[body->corpsenm]; struct permonst *mptr = &mons[body->corpsenm];
struct monst *mtmp; struct monst *mtmp;
xchar x, y; coordxy x, y;
/* corpse will revive somewhere else if there is a monster in the way; /* corpse will revive somewhere else if there is a monster in the way;
Riders get a chance to try to bump the obstacle out of their way */ Riders get a chance to try to bump the obstacle out of their way */
+10 -8
View File
@@ -66,7 +66,7 @@ pet_type(void)
} }
struct monst * struct monst *
make_familiar(struct obj *otmp, xchar x, xchar y, boolean quietly) make_familiar(struct obj *otmp, coordxy x, coordxy y, boolean quietly)
{ {
struct permonst *pm; struct permonst *pm;
struct monst *mtmp = 0; struct monst *mtmp = 0;
@@ -302,7 +302,8 @@ void
mon_arrive(struct monst *mtmp, boolean with_you) mon_arrive(struct monst *mtmp, boolean with_you)
{ {
struct trap *t; struct trap *t;
xchar xlocale, ylocale, xyloc, xyflags, wander; coordxy xlocale, ylocale, xyloc, xyflags;
xint16 wander;
int num_segs; int num_segs;
boolean failed_to_place = FALSE; boolean failed_to_place = FALSE;
stairway *stway; stairway *stway;
@@ -366,7 +367,7 @@ mon_arrive(struct monst *mtmp, boolean with_you)
mtmp->mlstmv = g.moves - 1L; mtmp->mlstmv = g.moves - 1L;
/* let monster move a bit on new level (see placement code below) */ /* let monster move a bit on new level (see placement code below) */
wander = (xchar) min(nmv, 8); wander = (xint16) min(nmv, 8);
} else } else
wander = 0; wander = 0;
@@ -716,12 +717,13 @@ keepdogs(
void void
migrate_to_level( migrate_to_level(
struct monst *mtmp, struct monst *mtmp,
xchar tolev, /* destination level */ xint16 tolev, /* destination level */
xchar xyloc, /* MIGR_xxx destination xy location: */ xint16 xyloc, /* MIGR_xxx destination xy location: */
coord *cc) /* optional destination coordinates */ coord *cc) /* optional destination coordinates */
{ {
d_level new_lev; d_level new_lev;
xchar xyflags, mx = mtmp->mx, my = mtmp->my; /* <mx,my> needed below */ coordxy xyflags;
coordxy mx = mtmp->mx, my = mtmp->my; /* <mx,my> needed below */
int num_segs; /* count of worm segments */ int num_segs; /* count of worm segments */
if (mtmp->mleashed) { if (mtmp->mleashed) {
@@ -735,8 +737,8 @@ migrate_to_level(
relmon(mtmp, &g.migrating_mons); /* mtmp->mx,my retain their value */ relmon(mtmp, &g.migrating_mons); /* mtmp->mx,my retain their value */
mtmp->mstate |= MON_MIGRATING; mtmp->mstate |= MON_MIGRATING;
new_lev.dnum = ledger_to_dnum((xchar) tolev); new_lev.dnum = ledger_to_dnum((xint16) tolev);
new_lev.dlevel = ledger_to_dlev((xchar) tolev); new_lev.dlevel = ledger_to_dlev((xint16) tolev);
/* overload mtmp->[mx,my], mtmp->[mux,muy], and mtmp->mtrack[] as /* overload mtmp->[mx,my], mtmp->[mux,muy], and mtmp->mtrack[] as
destination codes */ destination codes */
xyflags = (depth(&new_lev) < depth(&u.uz)); /* 1 => up */ xyflags = (depth(&new_lev) < depth(&u.uz)); /* 1 => up */
+9 -9
View File
@@ -18,9 +18,9 @@ static struct monst *find_targ(struct monst *, int, int, int);
static int find_friends(struct monst *, struct monst *, int); static int find_friends(struct monst *, struct monst *, int);
static struct monst *best_target(struct monst *); static struct monst *best_target(struct monst *);
static long score_targ(struct monst *, struct monst *); static long score_targ(struct monst *, struct monst *);
static boolean can_reach_location(struct monst *, xchar, xchar, xchar, static boolean can_reach_location(struct monst *, coordxy, coordxy, coordxy,
xchar); coordxy);
static boolean could_reach_item(struct monst *, xchar, xchar); static boolean could_reach_item(struct monst *, coordxy, coordxy);
static void quickmimic(struct monst *); static void quickmimic(struct monst *);
/* pick a carried item for pet to drop */ /* pick a carried item for pet to drop */
@@ -509,7 +509,7 @@ dog_goal(register struct monst *mtmp, struct edog *edog,
register int omx, omy; register int omx, omy;
boolean in_masters_sight, dog_has_minvent; boolean in_masters_sight, dog_has_minvent;
register struct obj *obj; register struct obj *obj;
xchar otyp; xint16 otyp;
int appr; int appr;
/* Steeds don't move on their own will */ /* Steeds don't move on their own will */
@@ -913,12 +913,12 @@ dog_move(register struct monst *mtmp,
int i, j, k; int i, j, k;
register struct edog *edog = EDOG(mtmp); register struct edog *edog = EDOG(mtmp);
struct obj *obj = (struct obj *) 0; struct obj *obj = (struct obj *) 0;
xchar otyp; xint16 otyp;
boolean has_edog, cursemsg[9], do_eat = FALSE; boolean has_edog, cursemsg[9], do_eat = FALSE;
boolean better_with_displacing = FALSE; boolean better_with_displacing = FALSE;
xchar nix, niy; /* position mtmp is (considering) moving to */ coordxy nix, niy; /* position mtmp is (considering) moving to */
register int nx, ny; /* temporary coordinates */ register int nx, ny; /* temporary coordinates */
xchar cnt, uncursedcnt, chcnt; xint16 cnt, uncursedcnt, chcnt;
int chi = -1, nidist, ndist; int chi = -1, nidist, ndist;
coord poss[9]; coord poss[9];
long info[9], allowflags; long info[9], allowflags;
@@ -1326,7 +1326,7 @@ dog_move(register struct monst *mtmp,
/* check if a monster could pick up objects from a location */ /* check if a monster could pick up objects from a location */
static boolean static boolean
could_reach_item(struct monst *mon, xchar nx, xchar ny) could_reach_item(struct monst *mon, coordxy nx, coordxy ny)
{ {
if ((!is_pool(nx, ny) || is_swimmer(mon->data)) if ((!is_pool(nx, ny) || is_swimmer(mon->data))
&& (!is_lava(nx, ny) || likes_lava(mon->data)) && (!is_lava(nx, ny) || likes_lava(mon->data))
@@ -1343,7 +1343,7 @@ could_reach_item(struct monst *mon, xchar nx, xchar ny)
* calls deep. * calls deep.
*/ */
static boolean static boolean
can_reach_location(struct monst *mon, xchar mx, xchar my, xchar fx, xchar fy) can_reach_location(struct monst *mon, coordxy mx, coordxy my, coordxy fx, coordxy fy)
{ {
int i, j; int i, j;
int dist; int dist;
+19 -19
View File
@@ -12,17 +12,17 @@
/* g.kickedobj (decl.c) tracks a kicked object until placed or destroyed */ /* g.kickedobj (decl.c) tracks a kicked object until placed or destroyed */
static void kickdmg(struct monst *, boolean); static void kickdmg(struct monst *, boolean);
static boolean maybe_kick_monster(struct monst *, xchar, xchar); static boolean maybe_kick_monster(struct monst *, coordxy, coordxy);
static void kick_monster(struct monst *, xchar, xchar); static void kick_monster(struct monst *, coordxy, coordxy);
static int kick_object(xchar, xchar, char *); static int kick_object(coordxy, coordxy, char *);
static int really_kick_object(xchar, xchar); static int really_kick_object(coordxy, coordxy);
static char *kickstr(char *, const char *); static char *kickstr(char *, const char *);
static boolean watchman_thief_arrest(struct monst *); static boolean watchman_thief_arrest(struct monst *);
static boolean watchman_door_damage(struct monst *, xchar, xchar); static boolean watchman_door_damage(struct monst *, coordxy, coordxy);
static void kick_dumb(int, int); static void kick_dumb(int, int);
static void kick_ouch(int, int, const char *); static void kick_ouch(int, int, const char *);
static void otransit_msg(struct obj *, boolean, boolean, long); static void otransit_msg(struct obj *, boolean, boolean, long);
static void drop_to(coord *, schar, xchar, xchar); static void drop_to(coord *, schar, coordxy, coordxy);
static const char kick_passes_thru[] = "kick passes harmlessly through"; static const char kick_passes_thru[] = "kick passes harmlessly through";
@@ -120,7 +120,7 @@ kickdmg(struct monst *mon, boolean clumsy)
} }
static boolean static boolean
maybe_kick_monster(struct monst *mon, xchar x, xchar y) maybe_kick_monster(struct monst *mon, coordxy x, coordxy y)
{ {
if (mon) { if (mon) {
boolean save_forcefight = g.context.forcefight; boolean save_forcefight = g.context.forcefight;
@@ -140,7 +140,7 @@ maybe_kick_monster(struct monst *mon, xchar x, xchar y)
} }
static void static void
kick_monster(struct monst *mon, xchar x, xchar y) kick_monster(struct monst *mon, coordxy x, coordxy y)
{ {
boolean clumsy = FALSE; boolean clumsy = FALSE;
int i, j; int i, j;
@@ -389,8 +389,8 @@ ghitm(register struct monst *mtmp, register struct obj *gold)
/* container is kicked, dropped, thrown or otherwise impacted by player. /* container is kicked, dropped, thrown or otherwise impacted by player.
* Assumes container is on floor. Checks contents for possible damage. */ * Assumes container is on floor. Checks contents for possible damage. */
void void
container_impact_dmg(struct obj *obj, xchar x, container_impact_dmg(struct obj *obj, coordxy x,
xchar y) /* coordinates where object was before the impact, not after */ coordxy y) /* coordinates where object was before the impact, not after */
{ {
struct monst *shkp; struct monst *shkp;
struct obj *otmp, *otmp2; struct obj *otmp, *otmp2;
@@ -456,7 +456,7 @@ container_impact_dmg(struct obj *obj, xchar x,
/* jacket around really_kick_object */ /* jacket around really_kick_object */
static int static int
kick_object(xchar x, xchar y, char *kickobjnam) kick_object(coordxy x, coordxy y, char *kickobjnam)
{ {
int res = 0; int res = 0;
@@ -474,7 +474,7 @@ kick_object(xchar x, xchar y, char *kickobjnam)
/* guts of kick_object */ /* guts of kick_object */
static int static int
really_kick_object(xchar x, xchar y) really_kick_object(coordxy x, coordxy y)
{ {
int range; int range;
struct monst *mon, *shkp = 0; struct monst *mon, *shkp = 0;
@@ -785,7 +785,7 @@ watchman_thief_arrest(struct monst *mtmp)
} }
static boolean static boolean
watchman_door_damage(struct monst *mtmp, xchar x, xchar y) watchman_door_damage(struct monst *mtmp, coordxy x, coordxy y)
{ {
if (is_watch(mtmp->data) && mtmp->mpeaceful if (is_watch(mtmp->data) && mtmp->mpeaceful
&& couldsee(mtmp->mx, mtmp->my)) { && couldsee(mtmp->mx, mtmp->my)) {
@@ -1390,7 +1390,7 @@ dokick(void)
} }
static void static void
drop_to(coord *cc, schar loc, xchar x, xchar y) drop_to(coord *cc, schar loc, coordxy x, coordxy y)
{ {
stairway *stway = stairway_at(x, y); stairway *stway = stairway_at(x, y);
@@ -1428,8 +1428,8 @@ drop_to(coord *cc, schar loc, xchar x, xchar y)
/* player or missile impacts location, causing objects to fall down */ /* player or missile impacts location, causing objects to fall down */
void void
impact_drop(struct obj *missile, /* caused impact, won't drop itself */ impact_drop(struct obj *missile, /* caused impact, won't drop itself */
xchar x, xchar y, /* location affected */ coordxy x, coordxy y, /* location affected */
xchar dlev) /* if !0 send to dlev near player */ xint16 dlev) /* if !0 send to dlev near player */
{ {
schar toloc; schar toloc;
register struct obj *obj, *obj2; register struct obj *obj, *obj2;
@@ -1554,10 +1554,10 @@ impact_drop(struct obj *missile, /* caused impact, won't drop itself */
* otmp is either a kicked, dropped, or thrown object. * otmp is either a kicked, dropped, or thrown object.
*/ */
boolean boolean
ship_object(struct obj *otmp, xchar x, xchar y, boolean shop_floor_obj) ship_object(struct obj *otmp, coordxy x, coordxy y, boolean shop_floor_obj)
{ {
schar toloc; schar toloc;
xchar ox, oy; coordxy ox, oy;
coord cc; coord cc;
struct obj *obj; struct obj *obj;
struct trap *t; struct trap *t;
@@ -1850,7 +1850,7 @@ otransit_msg(register struct obj *otmp, boolean nodrop, boolean chainthere, long
/* migration destination for objects which fall down to next level */ /* migration destination for objects which fall down to next level */
schar schar
down_gate(xchar x, xchar y) down_gate(coordxy x, coordxy y)
{ {
struct trap *ttmp; struct trap *ttmp;
stairway *stway = stairway_at(x, y); stairway *stway = stairway_at(x, y);
+7 -7
View File
@@ -15,7 +15,7 @@ static struct obj *find_launcher(struct obj *);
static int gem_accept(struct monst *, struct obj *); static int gem_accept(struct monst *, struct obj *);
static void tmiss(struct obj *, struct monst *, boolean); static void tmiss(struct obj *, struct monst *, boolean);
static int throw_gold(struct obj *); static int throw_gold(struct obj *);
static void check_shop_obj(struct obj *, xchar, xchar, boolean); static void check_shop_obj(struct obj *, coordxy, coordxy, boolean);
static boolean harmless_missile(struct obj *); static boolean harmless_missile(struct obj *);
static void breakmsg(struct obj *, boolean); static void breakmsg(struct obj *, boolean);
static boolean toss_up(struct obj *, boolean); static boolean toss_up(struct obj *, boolean);
@@ -864,7 +864,7 @@ hurtle_step(genericptr_t arg, int x, int y)
if ball is carried we might still need to drag the chain */ if ball is carried we might still need to drag the chain */
if (Punished) { if (Punished) {
int bc_control; int bc_control;
xchar ballx, bally, chainx, chainy; coordxy ballx, bally, chainx, chainy;
boolean cause_delay; boolean cause_delay;
if (drag_ball(x, y, &bc_control, &ballx, &bally, &chainx, if (drag_ball(x, y, &bc_control, &ballx, &bally, &chainx,
@@ -1100,7 +1100,7 @@ mhurtle(struct monst *mon, int dx, int dy, int range)
} }
static void static void
check_shop_obj(struct obj *obj, xchar x, xchar y, boolean broken) check_shop_obj(struct obj *obj, coordxy x, coordxy y, boolean broken)
{ {
boolean costly_xy; boolean costly_xy;
struct monst *shkp = shop_keeper(*u.ushops); struct monst *shkp = shop_keeper(*u.ushops);
@@ -2198,7 +2198,7 @@ gem_accept(register struct monst *mon, register struct obj *obj)
*/ */
int int
hero_breaks(struct obj *obj, hero_breaks(struct obj *obj,
xchar x, xchar y, /* object location (ox, oy may not be right) */ coordxy x, coordxy y, /* object location (ox, oy may not be right) */
unsigned breakflags) unsigned breakflags)
{ {
/* from_invent: thrown or dropped by player; maybe on shop bill; /* from_invent: thrown or dropped by player; maybe on shop bill;
@@ -2225,7 +2225,7 @@ hero_breaks(struct obj *obj,
*/ */
int int
breaks(struct obj *obj, breaks(struct obj *obj,
xchar x, xchar y) /* object location (ox, oy may not be right) */ coordxy x, coordxy y) /* object location (ox, oy may not be right) */
{ {
boolean in_view = Blind ? FALSE : cansee(x, y); boolean in_view = Blind ? FALSE : cansee(x, y);
@@ -2237,7 +2237,7 @@ breaks(struct obj *obj,
} }
void void
release_camera_demon(struct obj *obj, xchar x, xchar y) release_camera_demon(struct obj *obj, coordxy x, coordxy y)
{ {
struct monst *mtmp; struct monst *mtmp;
if (!rn2(3) if (!rn2(3)
@@ -2259,7 +2259,7 @@ release_camera_demon(struct obj *obj, xchar x, xchar y)
void void
breakobj( breakobj(
struct obj *obj, struct obj *obj,
xchar x, xchar y, /* object location (ox, oy may not be right) */ coordxy x, coordxy y, /* object location (ox, oy may not be right) */
boolean hero_caused, /* is this the hero's fault? */ boolean hero_caused, /* is this the hero's fault? */
boolean from_invent) boolean from_invent)
{ {
+48 -48
View File
@@ -28,25 +28,25 @@ struct lchoice {
int idx; int idx;
schar lev[MAXLINFO]; schar lev[MAXLINFO];
schar playerlev[MAXLINFO]; schar playerlev[MAXLINFO];
xchar dgn[MAXLINFO]; xint16 dgn[MAXLINFO];
char menuletter; char menuletter;
}; };
#if 0 #if 0
static void Fread(genericptr_t, int, int, dlb *); static void Fread(genericptr_t, int, int, dlb *);
#endif #endif
static xchar dname_to_dnum(const char *); static xint16 dname_to_dnum(const char *);
static int find_branch(const char *, struct proto_dungeon *); static int find_branch(const char *, struct proto_dungeon *);
static xchar parent_dnum(const char *, struct proto_dungeon *); static xint16 parent_dnum(const char *, struct proto_dungeon *);
static int level_range(xchar, int, int, int, struct proto_dungeon *, static int level_range(xint16, int, int, int, struct proto_dungeon *,
int *); int *);
static xchar parent_dlevel(const char *, struct proto_dungeon *); static xint16 parent_dlevel(const char *, struct proto_dungeon *);
static int correct_branch_type(struct tmpbranch *); static int correct_branch_type(struct tmpbranch *);
static branch *add_branch(int, int, struct proto_dungeon *); static branch *add_branch(int, int, struct proto_dungeon *);
static void add_level(s_level *); static void add_level(s_level *);
static void init_level(int, int, struct proto_dungeon *); static void init_level(int, int, struct proto_dungeon *);
static int possible_places(int, boolean *, struct proto_dungeon *); static int possible_places(int, boolean *, struct proto_dungeon *);
static xchar pick_level(boolean *, int); static xint16 pick_level(boolean *, int);
static boolean place_level(int, struct proto_dungeon *); static boolean place_level(int, struct proto_dungeon *);
static int get_dgn_flags(lua_State *); static int get_dgn_flags(lua_State *);
static boolean unplaced_floater(struct dungeon *); static boolean unplaced_floater(struct dungeon *);
@@ -63,7 +63,7 @@ static mapseen *find_mapseen_by_str(const char *);
static void print_mapseen(winid, mapseen *, int, int, boolean); static void print_mapseen(winid, mapseen *, int, int, boolean);
static boolean interest_mapseen(mapseen *); static boolean interest_mapseen(mapseen *);
static void traverse_mapseenchn(boolean, winid, int, int, int *); static void traverse_mapseenchn(boolean, winid, int, int, int *);
static const char *seen_string(xchar, const char *); static const char *seen_string(xint16, const char *);
static const char *br_string2(branch *); static const char *br_string2(branch *);
static const char *shop_string(int); static const char *shop_string(int);
static char *tunesuffix(mapseen *, char *, size_t); static char *tunesuffix(mapseen *, char *, size_t);
@@ -264,10 +264,10 @@ Fread(genericptr_t ptr, int size, int nitems, dlb *stream)
} }
#endif #endif
static xchar static xint16
dname_to_dnum(const char *s) dname_to_dnum(const char *s)
{ {
xchar i; xint16 i;
for (i = 0; i < g.n_dgns; i++) for (i = 0; i < g.n_dgns; i++)
if (!strcmp(g.dungeons[i].dname, s)) if (!strcmp(g.dungeons[i].dname, s))
@@ -275,7 +275,7 @@ dname_to_dnum(const char *s)
panic("Couldn't resolve dungeon number for name \"%s\".", s); panic("Couldn't resolve dungeon number for name \"%s\".", s);
/*NOT REACHED*/ /*NOT REACHED*/
return (xchar) 0; return (xint16) 0;
} }
s_level * s_level *
@@ -321,12 +321,12 @@ find_branch(const char *s, /* dungeon name */
* Find the "parent" by searching the prototype branch list for the branch * Find the "parent" by searching the prototype branch list for the branch
* listing, then figuring out to which dungeon it belongs. * listing, then figuring out to which dungeon it belongs.
*/ */
static xchar static xint16
parent_dnum(const char *s, /* dungeon name */ parent_dnum(const char *s, /* dungeon name */
struct proto_dungeon *pd) struct proto_dungeon *pd)
{ {
int i; int i;
xchar pdnum; xint16 pdnum;
i = find_branch(s, pd); i = find_branch(s, pd);
/* /*
@@ -339,7 +339,7 @@ parent_dnum(const char *s, /* dungeon name */
panic("parent_dnum: couldn't resolve branch."); panic("parent_dnum: couldn't resolve branch.");
/*NOT REACHED*/ /*NOT REACHED*/
return (xchar) 0; return (xint16) 0;
} }
/* /*
@@ -353,7 +353,7 @@ parent_dnum(const char *s, /* dungeon name */
* end of the dungeon. * end of the dungeon.
*/ */
static int static int
level_range(xchar dgn, int base, int randc, int chain, level_range(xint16 dgn, int base, int randc, int chain,
struct proto_dungeon *pd, int *adjusted_base) struct proto_dungeon *pd, int *adjusted_base)
{ {
int lmax = g.dungeons[dgn].num_dunlevs; int lmax = g.dungeons[dgn].num_dunlevs;
@@ -384,7 +384,7 @@ level_range(xchar dgn, int base, int randc, int chain,
return 1; return 1;
} }
static xchar static xint16
parent_dlevel(const char *s, struct proto_dungeon *pd) parent_dlevel(const char *s, struct proto_dungeon *pd)
{ {
int i, j, num, base, dnum = parent_dnum(s, pd); int i, j, num, base, dnum = parent_dnum(s, pd);
@@ -593,14 +593,14 @@ possible_places(int idx, /* prototype index */
} }
/* Pick the nth TRUE entry in the given boolean array. */ /* Pick the nth TRUE entry in the given boolean array. */
static xchar static xint16
pick_level(boolean *map, /* an array MAXLEVEL+1 in size */ pick_level(boolean *map, /* an array MAXLEVEL+1 in size */
int nth) int nth)
{ {
int i; xint16 i;
for (i = 1; i <= MAXLEVEL; i++) for (i = 1; i <= MAXLEVEL; i++)
if (map[i] && !nth--) if (map[i] && !nth--)
return (xchar) i; return i;
panic("pick_level: ran out of valid levels"); panic("pick_level: ran out of valid levels");
return 0; return 0;
} }
@@ -1009,9 +1009,9 @@ init_dungeons(void)
free((genericptr) dgn_themerms); free((genericptr) dgn_themerms);
if (dgn_range) if (dgn_range)
g.dungeons[i].num_dunlevs = (xchar) rn1(dgn_range, dgn_base); g.dungeons[i].num_dunlevs = (xint16) rn1(dgn_range, dgn_base);
else else
g.dungeons[i].num_dunlevs = (xchar) dgn_base; g.dungeons[i].num_dunlevs = (xint16) dgn_base;
if (!i) { if (!i) {
g.dungeons[i].ledger_start = 0; g.dungeons[i].ledger_start = 0;
@@ -1197,21 +1197,21 @@ init_dungeons(void)
} }
/* return the level number for lev in *this* dungeon */ /* return the level number for lev in *this* dungeon */
xchar xint16
dunlev(d_level *lev) dunlev(d_level *lev)
{ {
return lev->dlevel; return lev->dlevel;
} }
/* return the lowest level number for *this* dungeon */ /* return the lowest level number for *this* dungeon */
xchar xint16
dunlevs_in_dungeon(d_level *lev) dunlevs_in_dungeon(d_level *lev)
{ {
return g.dungeons[lev->dnum].num_dunlevs; return g.dungeons[lev->dnum].num_dunlevs;
} }
/* return the lowest level explored in the game*/ /* return the lowest level explored in the game*/
xchar xint16
deepest_lev_reached(boolean noquest) deepest_lev_reached(boolean noquest)
{ {
/* this function is used for three purposes: to provide a factor /* this function is used for three purposes: to provide a factor
@@ -1231,7 +1231,7 @@ deepest_lev_reached(boolean noquest)
*/ */
register int i; register int i;
d_level tmp; d_level tmp;
register schar ret = 0; xint16 ret = 0;
for (i = 0; i < g.n_dgns; i++) { for (i = 0; i < g.n_dgns; i++) {
if (noquest && i == quest_dnum) if (noquest && i == quest_dnum)
@@ -1243,15 +1243,15 @@ deepest_lev_reached(boolean noquest)
if (depth(&tmp) > ret) if (depth(&tmp) > ret)
ret = depth(&tmp); ret = depth(&tmp);
} }
return (xchar) ret; return ret;
} }
/* return a bookkeeping level number for purpose of comparisons and /* return a bookkeeping level number for purpose of comparisons and
save/restore */ save/restore */
xchar xint16
ledger_no(d_level *lev) ledger_no(d_level *lev)
{ {
return (xchar) (lev->dlevel + g.dungeons[lev->dnum].ledger_start); return (xint16) (lev->dlevel + g.dungeons[lev->dnum].ledger_start);
} }
/* /*
@@ -1264,36 +1264,36 @@ ledger_no(d_level *lev)
* not be confused with deepest_lev_reached() -- which returns the lowest * not be confused with deepest_lev_reached() -- which returns the lowest
* depth visited by the player. * depth visited by the player.
*/ */
xchar xint16
maxledgerno(void) maxledgerno(void)
{ {
return (xchar) (g.dungeons[g.n_dgns - 1].ledger_start return (xint16) (g.dungeons[g.n_dgns - 1].ledger_start
+ g.dungeons[g.n_dgns - 1].num_dunlevs); + g.dungeons[g.n_dgns - 1].num_dunlevs);
} }
/* return the dungeon that this ledgerno exists in */ /* return the dungeon that this ledgerno exists in */
xchar xint16
ledger_to_dnum(xchar ledgerno) ledger_to_dnum(xint16 ledgerno)
{ {
register int i; xint16 i;
/* find i such that (i->base + 1) <= ledgerno <= (i->base + i->count) */ /* find i such that (i->base + 1) <= ledgerno <= (i->base + i->count) */
for (i = 0; i < g.n_dgns; i++) for (i = 0; i < g.n_dgns; i++)
if (g.dungeons[i].ledger_start < ledgerno if (g.dungeons[i].ledger_start < ledgerno
&& (ledgerno && (ledgerno
<= g.dungeons[i].ledger_start + g.dungeons[i].num_dunlevs)) <= g.dungeons[i].ledger_start + g.dungeons[i].num_dunlevs))
return (xchar) i; return i;
panic("level number out of range [ledger_to_dnum(%d)]", (int) ledgerno); panic("level number out of range [ledger_to_dnum(%d)]", (int) ledgerno);
/*NOT REACHED*/ /*NOT REACHED*/
return (xchar) 0; return (xint16) 0;
} }
/* return the level of the dungeon this ledgerno exists in */ /* return the level of the dungeon this ledgerno exists in */
xchar xint16
ledger_to_dlev(xchar ledgerno) ledger_to_dlev(xint16 ledgerno)
{ {
return (xchar) (ledgerno return (xint16) (ledgerno
- g.dungeons[ledger_to_dnum(ledgerno)].ledger_start); - g.dungeons[ledger_to_dnum(ledgerno)].ledger_start);
} }
@@ -1599,13 +1599,13 @@ u_on_dnstairs(void)
} }
boolean boolean
On_stairs(xchar x, xchar y) On_stairs(coordxy x, coordxy y)
{ {
return (stairway_at(x,y) != NULL); return (stairway_at(x,y) != NULL);
} }
boolean boolean
On_ladder(xchar x, xchar y) On_ladder(coordxy x, coordxy y)
{ {
stairway *stway = stairway_at(x,y); stairway *stway = stairway_at(x,y);
@@ -1613,7 +1613,7 @@ On_ladder(xchar x, xchar y)
} }
boolean boolean
On_stairs_up(xchar x, xchar y) On_stairs_up(coordxy x, coordxy y)
{ {
stairway *stway = stairway_at(x,y); stairway *stway = stairway_at(x,y);
@@ -1621,7 +1621,7 @@ On_stairs_up(xchar x, xchar y)
} }
boolean boolean
On_stairs_dn(xchar x, xchar y) On_stairs_dn(coordxy x, coordxy y)
{ {
stairway *stway = stairway_at(x,y); stairway *stway = stairway_at(x,y);
@@ -1697,7 +1697,7 @@ void
get_level(d_level *newlevel, int levnum) get_level(d_level *newlevel, int levnum)
{ {
branch *br; branch *br;
xchar dgn = u.uz.dnum; xint16 dgn = u.uz.dnum;
if (levnum <= 0) { if (levnum <= 0) {
/* can only currently happen in endgame */ /* can only currently happen in endgame */
@@ -1765,7 +1765,7 @@ branch *
dungeon_branch(const char *s) dungeon_branch(const char *s)
{ {
branch *br; branch *br;
xchar dnum; xint16 dnum;
dnum = dname_to_dnum(s); dnum = dname_to_dnum(s);
@@ -1918,10 +1918,10 @@ Invocation_lev(d_level *lev)
/* use instead of depth() wherever a degree of difficulty is made /* use instead of depth() wherever a degree of difficulty is made
* dependent on the location in the dungeon (eg. monster creation). * dependent on the location in the dungeon (eg. monster creation).
*/ */
xchar xint16
level_difficulty(void) level_difficulty(void)
{ {
int res; xint16 res;
if (In_endgame(&u.uz)) { if (In_endgame(&u.uz)) {
res = depth(&sanctum_level) + u.ulevel / 2; res = depth(&sanctum_level) + u.ulevel / 2;
@@ -1972,7 +1972,7 @@ level_difficulty(void)
*/ */
#endif /*0*/ #endif /*0*/
} }
return (xchar) res; return res;
} }
/* Take one word and try to match it to a level. /* Take one word and try to match it to a level.
@@ -2225,7 +2225,7 @@ print_branch(winid win, int dnum, int lower_bound, int upper_bound,
/* Print available dungeon information. */ /* Print available dungeon information. */
schar schar
print_dungeon(boolean bymenu, schar *rlev, xchar *rdgn) print_dungeon(boolean bymenu, schar *rlev, xint16 *rdgn)
{ {
int i, last_level, nlev; int i, last_level, nlev;
char buf[BUFSZ]; char buf[BUFSZ];
@@ -3140,7 +3140,7 @@ traverse_mapseenchn(boolean viewendgame, winid win, int why, int reason,
} }
static const char * static const char *
seen_string(xchar x, const char *obj) seen_string(xint16 x, const char *obj)
{ {
/* players are computer scientists: 0, 1, 2, n */ /* players are computer scientists: 0, 1, 2, n */
switch (x) { switch (x) {
+7 -7
View File
@@ -249,7 +249,7 @@ ceiling(int x, int y)
} }
struct engr * struct engr *
engr_at(xchar x, xchar y) engr_at(coordxy x, coordxy y)
{ {
register struct engr *ep = head_engr; register struct engr *ep = head_engr;
@@ -269,7 +269,7 @@ engr_at(xchar x, xchar y)
* present if it is intact and is the entire content of the engraving. * present if it is intact and is the entire content of the engraving.
*/ */
boolean boolean
sengr_at(const char *s, xchar x, xchar y, boolean strict) sengr_at(const char *s, coordxy x, coordxy y, boolean strict)
{ {
register struct engr *ep = engr_at(x, y); register struct engr *ep = engr_at(x, y);
@@ -288,7 +288,7 @@ u_wipe_engr(int cnt)
} }
void void
wipe_engr_at(xchar x, xchar y, xchar cnt, boolean magical) wipe_engr_at(coordxy x, coordxy y, xint16 cnt, boolean magical)
{ {
register struct engr *ep = engr_at(x, y); register struct engr *ep = engr_at(x, y);
@@ -384,7 +384,7 @@ read_engr_at(int x, int y)
} }
void void
make_engr_at(int x, int y, const char *s, long e_time, xchar e_type) make_engr_at(int x, int y, const char *s, long e_time, xint16 e_type)
{ {
struct engr *ep; struct engr *ep;
unsigned smem = Strlen(s) + 1; unsigned smem = Strlen(s) + 1;
@@ -524,8 +524,8 @@ doengrave(void)
boolean ptext = TRUE; /* TRUE if we must prompt for engrave text */ boolean ptext = TRUE; /* TRUE if we must prompt for engrave text */
boolean teleengr = FALSE; /* TRUE if we move the old engraving */ boolean teleengr = FALSE; /* TRUE if we move the old engraving */
boolean zapwand = FALSE; /* TRUE if we remove a wand charge */ boolean zapwand = FALSE; /* TRUE if we remove a wand charge */
xchar type = DUST; /* Type of engraving made */ xint16 type = DUST; /* Type of engraving made */
xchar oetype = 0; /* will be set to type of current engraving */ xint16 oetype = 0; /* will be set to type of current engraving */
char buf[BUFSZ]; /* Buffer for final/poly engraving text */ char buf[BUFSZ]; /* Buffer for final/poly engraving text */
char ebuf[BUFSZ]; /* Buffer for initial engraving text */ char ebuf[BUFSZ]; /* Buffer for initial engraving text */
char fbuf[BUFSZ]; /* Buffer for "your fingers" */ char fbuf[BUFSZ]; /* Buffer for "your fingers" */
@@ -703,7 +703,7 @@ doengrave(void)
case WAN_POLYMORPH: case WAN_POLYMORPH:
if (oep) { if (oep) {
if (!Blind) { if (!Blind) {
type = (xchar) 0; /* random */ type = (xint16) 0; /* random */
(void) random_engraving(buf); (void) random_engraving(buf);
} else { } else {
/* keep the same type so that feels don't /* keep the same type so that feels don't
+1 -1
View File
@@ -67,7 +67,7 @@ newpw(void)
en = 1; en = 1;
if (u.ulevel < MAXULEV) { if (u.ulevel < MAXULEV) {
/* remember increment; future level drain could take it away again */ /* remember increment; future level drain could take it away again */
u.ueninc[u.ulevel] = (xchar) en; u.ueninc[u.ulevel] = (xint16) en;
} else { } else {
/* after level 30, throttle energy gains from extra experience; /* after level 30, throttle energy gains from extra experience;
once max reaches 600, further increments will be just 1 more */ once max reaches 600, further increments will be just 1 more */
+5 -5
View File
@@ -349,8 +349,8 @@ explode(
/* Affect the floor unless the player caused the explosion from /* Affect the floor unless the player caused the explosion from
* inside their engulfer. */ * inside their engulfer. */
if (!(u.uswallow && !g.context.mon_moving)) if (!(u.uswallow && !g.context.mon_moving))
(void) zap_over_floor((xchar) (i + x - 1), (void) zap_over_floor((coordxy) (i + x - 1),
(xchar) (j + y - 1), type, (coordxy) (j + y - 1), type,
&shopdamage, exploding_wand_typ); &shopdamage, exploding_wand_typ);
mtmp = m_at(i + x - 1, j + y - 1); mtmp = m_at(i + x - 1, j + y - 1);
@@ -619,8 +619,8 @@ explode(
struct scatter_chain { struct scatter_chain {
struct scatter_chain *next; /* pointer to next scatter item */ struct scatter_chain *next; /* pointer to next scatter item */
struct obj *obj; /* pointer to the object */ struct obj *obj; /* pointer to the object */
xchar ox; /* location of */ coordxy ox; /* location of */
xchar oy; /* item */ coordxy oy; /* item */
schar dx; /* direction of */ schar dx; /* direction of */
schar dy; /* travel */ schar dy; /* travel */
int range; /* range of object */ int range; /* range of object */
@@ -721,7 +721,7 @@ scatter(int sx, int sy, /* location of objects to scatter */
} else if ((scflags & MAY_DESTROY) != 0 } else if ((scflags & MAY_DESTROY) != 0
&& (!rn2(10) || (objects[otmp->otyp].oc_material == GLASS && (!rn2(10) || (objects[otmp->otyp].oc_material == GLASS
|| otmp->otyp == EGG))) { || otmp->otyp == EGG))) {
if (breaks(otmp, (xchar) sx, (xchar) sy)) if (breaks(otmp, (coordxy) sx, (coordxy) sy))
used_up = TRUE; used_up = TRUE;
} }
+5 -5
View File
@@ -3681,7 +3681,7 @@ recover_savefile(void)
{ {
NHFILE *gnhfp, *lnhfp, *snhfp; NHFILE *gnhfp, *lnhfp, *snhfp;
int lev, savelev, hpid, pltmpsiz, filecmc; int lev, savelev, hpid, pltmpsiz, filecmc;
xchar levc; xint16 levc;
struct version_info version_data; struct version_info version_data;
int processed[256]; int processed[256];
char savename[SAVESIZE], errbuf[BUFSZ], indicator; char savename[SAVESIZE], errbuf[BUFSZ], indicator;
@@ -3820,14 +3820,14 @@ recover_savefile(void)
processed[0] = 1; processed[0] = 1;
for (lev = 1; lev < 256; lev++) { for (lev = 1; lev < 256; lev++) {
/* level numbers are kept in xchars in save.c, so the /* level numbers are kept in xint16s in save.c, so the
* maximum level number (for the endlevel) must be < 256 * maximum level number (for the endlevel) must be < 256
*/ */
if (lev != savelev) { if (lev != savelev) {
lnhfp = open_levelfile(lev, (char *) 0); lnhfp = open_levelfile(lev, (char *) 0);
if (lnhfp) { if (lnhfp) {
/* any or all of these may not exist */ /* any or all of these may not exist */
levc = (xchar) lev; levc = (xint16) lev;
write(snhfp->fd, (genericptr_t) &levc, sizeof(levc)); write(snhfp->fd, (genericptr_t) &levc, sizeof(levc));
if (!copy_bytes(lnhfp->fd, snhfp->fd)) { if (!copy_bytes(lnhfp->fd, snhfp->fd)) {
close_nhfile(lnhfp); close_nhfile(lnhfp);
@@ -4257,14 +4257,14 @@ choose_passage(int passagecnt, /* total of available passages */
/* collect all of the N indices */ /* collect all of the N indices */
g.context.novel.count = passagecnt; g.context.novel.count = passagecnt;
for (idx = 0; idx < MAXPASSAGES; idx++) for (idx = 0; idx < MAXPASSAGES; idx++)
g.context.novel.pasg[idx] = (xchar) ((idx < passagecnt) g.context.novel.pasg[idx] = (xint16) ((idx < passagecnt)
? idx + 1 : 0); ? idx + 1 : 0);
} else { } else {
/* collect MAXPASSAGES of the N indices */ /* collect MAXPASSAGES of the N indices */
g.context.novel.count = MAXPASSAGES; g.context.novel.count = MAXPASSAGES;
for (idx = i = 0; i < passagecnt; ++i, --range) for (idx = i = 0; i < passagecnt; ++i, --range)
if (range > 0 && rn2(range) < limit) { if (range > 0 && rn2(range) < limit) {
g.context.novel.pasg[idx++] = (xchar) (i + 1); g.context.novel.pasg[idx++] = (xint16) (i + 1);
--limit; --limit;
} }
} }
+1 -1
View File
@@ -187,7 +187,7 @@ watchman_warn_fountain(struct monst *mtmp)
} }
void void
dryup(xchar x, xchar y, boolean isyou) dryup(coordxy x, coordxy y, boolean isyou)
{ {
if (IS_FOUNTAIN(levl[x][y].typ) if (IS_FOUNTAIN(levl[x][y].typ)
&& (!rn2(3) || FOUNTAIN_IS_WARNED(x, y))) { && (!rn2(3) || FOUNTAIN_IS_WARNED(x, y))) {
+42 -42
View File
@@ -12,23 +12,23 @@ static int moverock(void);
static void dosinkfall(void); static void dosinkfall(void);
static boolean findtravelpath(int); static boolean findtravelpath(int);
static boolean trapmove(int, int, struct trap *); static boolean trapmove(int, int, struct trap *);
static void check_buried_zombies(xchar, xchar); static void check_buried_zombies(coordxy, coordxy);
static schar u_simple_floortyp(xchar, xchar); static schar u_simple_floortyp(coordxy, coordxy);
static boolean swim_move_danger(xchar, xchar); static boolean swim_move_danger(coordxy, coordxy);
static boolean domove_bump_mon(struct monst *, int); static boolean domove_bump_mon(struct monst *, int);
static boolean domove_attackmon_at(struct monst *, xchar, xchar, boolean *); static boolean domove_attackmon_at(struct monst *, coordxy, coordxy, boolean *);
static boolean domove_fight_ironbars(xchar, xchar); static boolean domove_fight_ironbars(coordxy, coordxy);
static boolean domove_swap_with_pet(struct monst *, xchar, xchar); static boolean domove_swap_with_pet(struct monst *, coordxy, coordxy);
static boolean domove_fight_empty(xchar, xchar); static boolean domove_fight_empty(coordxy, coordxy);
static boolean air_turbulence(void); static boolean air_turbulence(void);
static void slippery_ice_fumbling(void); static void slippery_ice_fumbling(void);
static boolean impaired_movement(xchar *, xchar *); static boolean impaired_movement(coordxy *, coordxy *);
static boolean avoid_moving_on_trap(xchar, xchar, boolean); static boolean avoid_moving_on_trap(coordxy, coordxy, boolean);
static boolean avoid_moving_on_liquid(xchar, xchar, boolean); static boolean avoid_moving_on_liquid(coordxy, coordxy, boolean);
static boolean avoid_running_into_trap_or_liquid(xchar, xchar); static boolean avoid_running_into_trap_or_liquid(coordxy, coordxy);
static boolean move_out_of_bounds(xchar, xchar); static boolean move_out_of_bounds(coordxy, coordxy);
static boolean carrying_too_much(void); static boolean carrying_too_much(void);
static boolean escape_from_sticky_mon(xchar, xchar); static boolean escape_from_sticky_mon(coordxy, coordxy);
static void domove_core(void); static void domove_core(void);
static void maybe_smudge_engr(int, int, int, int); static void maybe_smudge_engr(int, int, int, int);
static struct monst *monstinroom(struct permonst *, int); static struct monst *monstinroom(struct permonst *, int);
@@ -139,7 +139,7 @@ could_move_onto_boulder(int sx, int sy)
static int static int
moverock(void) moverock(void)
{ {
register xchar rx, ry, sx, sy; register coordxy rx, ry, sx, sy;
struct obj *otmp; struct obj *otmp;
struct trap *ttmp; struct trap *ttmp;
struct monst *mtmp; struct monst *mtmp;
@@ -511,7 +511,7 @@ moverock(void)
* Returns TRUE if still eating, FALSE when done. * Returns TRUE if still eating, FALSE when done.
*/ */
int int
still_chewing(xchar x, xchar y) still_chewing(coordxy x, coordxy y)
{ {
struct rm *lev = &levl[x][y]; struct rm *lev = &levl[x][y];
struct obj *boulder = sobj_at(BOULDER, x, y); struct obj *boulder = sobj_at(BOULDER, x, y);
@@ -689,7 +689,7 @@ still_chewing(xchar x, xchar y)
} }
void void
movobj(struct obj *obj, xchar ox, xchar oy) movobj(struct obj *obj, coordxy ox, coordxy oy)
{ {
/* optimize by leaving on the fobj chain? */ /* optimize by leaving on the fobj chain? */
remove_object(obj); remove_object(obj);
@@ -787,7 +787,7 @@ dosinkfall(void)
/* intended to be called only on ROCKs or TREEs */ /* intended to be called only on ROCKs or TREEs */
boolean boolean
may_dig(register xchar x, register xchar y) may_dig(register coordxy x, register coordxy y)
{ {
struct rm *lev = &levl[x][y]; struct rm *lev = &levl[x][y];
@@ -796,14 +796,14 @@ may_dig(register xchar x, register xchar y)
} }
boolean boolean
may_passwall(register xchar x, register xchar y) may_passwall(register coordxy x, register coordxy y)
{ {
return (boolean) !(IS_STWALL(levl[x][y].typ) return (boolean) !(IS_STWALL(levl[x][y].typ)
&& (levl[x][y].wall_info & W_NONPASSWALL)); && (levl[x][y].wall_info & W_NONPASSWALL));
} }
boolean boolean
bad_rock(struct permonst *mdat, register xchar x, register xchar y) bad_rock(struct permonst *mdat, register coordxy x, register coordxy y)
{ {
return (boolean) ((Sokoban && sobj_at(BOULDER, x, y)) return (boolean) ((Sokoban && sobj_at(BOULDER, x, y))
|| (IS_ROCK(levl[x][y].typ) || (IS_ROCK(levl[x][y].typ)
@@ -843,7 +843,7 @@ cant_squeeze_thru(struct monst *mon)
} }
boolean boolean
invocation_pos(xchar x, xchar y) invocation_pos(coordxy x, coordxy y)
{ {
return (boolean) (Invocation_lev(&u.uz) return (boolean) (Invocation_lev(&u.uz)
&& x == g.inv_pos.x && y == g.inv_pos.y); && x == g.inv_pos.x && y == g.inv_pos.y);
@@ -1121,10 +1121,10 @@ findtravelpath(int mode)
g.context.run = 8; g.context.run = 8;
} }
if (u.tx != u.ux || u.ty != u.uy) { if (u.tx != u.ux || u.ty != u.uy) {
xchar travel[COLNO][ROWNO]; coordxy travel[COLNO][ROWNO];
xchar travelstepx[2][COLNO * ROWNO]; coordxy travelstepx[2][COLNO * ROWNO];
xchar travelstepy[2][COLNO * ROWNO]; coordxy travelstepy[2][COLNO * ROWNO];
xchar tx, ty, ux, uy; coordxy tx, ty, ux, uy;
int n = 1; /* max offset in travelsteps */ int n = 1; /* max offset in travelsteps */
int set = 0; /* two sets current and previous */ int set = 0; /* two sets current and previous */
int radius = 1; /* search radius */ int radius = 1; /* search radius */
@@ -1538,7 +1538,7 @@ u_rooted(void)
/* reduce zombification timeout of buried zombies around px, py */ /* reduce zombification timeout of buried zombies around px, py */
static void static void
check_buried_zombies(xchar x, xchar y) check_buried_zombies(coordxy x, coordxy y)
{ {
struct obj *otmp; struct obj *otmp;
long t; long t;
@@ -1568,7 +1568,7 @@ u_locomotion(const char *def)
/* Return a simplified floor solid/liquid state based on hero's state */ /* Return a simplified floor solid/liquid state based on hero's state */
static schar static schar
u_simple_floortyp(xchar x, xchar y) u_simple_floortyp(coordxy x, coordxy y)
{ {
boolean u_in_air = (Levitation || Flying || !grounded(g.youmonst.data)); boolean u_in_air = (Levitation || Flying || !grounded(g.youmonst.data));
@@ -1585,7 +1585,7 @@ u_simple_floortyp(xchar x, xchar y)
/* Is it dangerous for hero to move to x,y due to water or lava? */ /* Is it dangerous for hero to move to x,y due to water or lava? */
static boolean static boolean
swim_move_danger(xchar x, xchar y) swim_move_danger(coordxy x, coordxy y)
{ {
schar newtyp = u_simple_floortyp(x, y); schar newtyp = u_simple_floortyp(x, y);
boolean liquid_wall = IS_WATERWALL(newtyp); boolean liquid_wall = IS_WATERWALL(newtyp);
@@ -1660,7 +1660,7 @@ domove_bump_mon(struct monst *mtmp, int glyph)
sets displaceu, if hero and monster could swap places instead. sets displaceu, if hero and monster could swap places instead.
*/ */
static boolean static boolean
domove_attackmon_at(struct monst *mtmp, xchar x, xchar y, boolean *displaceu) domove_attackmon_at(struct monst *mtmp, coordxy x, coordxy y, boolean *displaceu)
{ {
/* only attack if we know it's there */ /* only attack if we know it's there */
/* or if we used the 'F' command to fight blindly */ /* or if we used the 'F' command to fight blindly */
@@ -1695,7 +1695,7 @@ domove_attackmon_at(struct monst *mtmp, xchar x, xchar y, boolean *displaceu)
/* force-fight iron bars with your weapon? */ /* force-fight iron bars with your weapon? */
static boolean static boolean
domove_fight_ironbars(xchar x, xchar y) domove_fight_ironbars(coordxy x, coordxy y)
{ {
if (g.context.forcefight && levl[x][y].typ == IRONBARS && uwep) { if (g.context.forcefight && levl[x][y].typ == IRONBARS && uwep) {
struct obj *obj = uwep; struct obj *obj = uwep;
@@ -1720,7 +1720,7 @@ domove_fight_ironbars(xchar x, xchar y)
/* maybe swap places with a pet? returns TRUE if swapped places */ /* maybe swap places with a pet? returns TRUE if swapped places */
static boolean static boolean
domove_swap_with_pet(struct monst *mtmp, xchar x, xchar y) domove_swap_with_pet(struct monst *mtmp, coordxy x, coordxy y)
{ {
struct trap *trap; struct trap *trap;
/* if it turns out we can't actually move */ /* if it turns out we can't actually move */
@@ -1839,7 +1839,7 @@ domove_swap_with_pet(struct monst *mtmp, xchar x, xchar y)
/* force-fight (x,y) which doesn't have anything to fight */ /* force-fight (x,y) which doesn't have anything to fight */
static boolean static boolean
domove_fight_empty(xchar x, xchar y) domove_fight_empty(coordxy x, coordxy y)
{ {
static const char unknown_obstacle[] = "an unknown obstacle"; static const char unknown_obstacle[] = "an unknown obstacle";
boolean off_edge = !isok(x, y); boolean off_edge = !isok(x, y);
@@ -1972,7 +1972,7 @@ air_turbulence(void)
/* does water disturb the movement? */ /* does water disturb the movement? */
static boolean static boolean
water_turbulence(xchar *x, xchar *y) water_turbulence(coordxy *x, coordxy *y)
{ {
if (u.uinwater) { if (u.uinwater) {
int wtcap; int wtcap;
@@ -2028,7 +2028,7 @@ slippery_ice_fumbling(void)
/* change movement dir if impaired. return TRUE if can't move */ /* change movement dir if impaired. return TRUE if can't move */
static boolean static boolean
impaired_movement(xchar *x, xchar *y) impaired_movement(coordxy *x, coordxy *y)
{ {
if (Stunned || (Confusion && !rn2(5))) { if (Stunned || (Confusion && !rn2(5))) {
register int tries = 0; register int tries = 0;
@@ -2047,7 +2047,7 @@ impaired_movement(xchar *x, xchar *y)
} }
static boolean static boolean
avoid_moving_on_trap(xchar x, xchar y, boolean msg) avoid_moving_on_trap(coordxy x, coordxy y, boolean msg)
{ {
struct trap *trap; struct trap *trap;
@@ -2061,7 +2061,7 @@ avoid_moving_on_trap(xchar x, xchar y, boolean msg)
} }
static boolean static boolean
avoid_moving_on_liquid(xchar x, xchar y, boolean msg) avoid_moving_on_liquid(coordxy x, coordxy y, boolean msg)
{ {
if (!Levitation && !Flying && !is_clinger(g.youmonst.data) if (!Levitation && !Flying && !is_clinger(g.youmonst.data)
&& is_pool_or_lava(x, y) && levl[x][y].seenv) { && is_pool_or_lava(x, y) && levl[x][y].seenv) {
@@ -2076,7 +2076,7 @@ avoid_moving_on_liquid(xchar x, xchar y, boolean msg)
/* when running/rushing, avoid stepping on a known trap or pool of liquid. /* when running/rushing, avoid stepping on a known trap or pool of liquid.
returns TRUE if avoided. */ returns TRUE if avoided. */
static boolean static boolean
avoid_running_into_trap_or_liquid(xchar x, xchar y) avoid_running_into_trap_or_liquid(coordxy x, coordxy y)
{ {
if (!g.context.run) if (!g.context.run)
return FALSE; return FALSE;
@@ -2096,7 +2096,7 @@ avoid_running_into_trap_or_liquid(xchar x, xchar y)
/* trying to move out-of-bounds? */ /* trying to move out-of-bounds? */
static boolean static boolean
move_out_of_bounds(xchar x, xchar y) move_out_of_bounds(coordxy x, coordxy y)
{ {
if (!isok(x, y)) { if (!isok(x, y)) {
if (g.context.forcefight) if (g.context.forcefight)
@@ -2149,7 +2149,7 @@ carrying_too_much(void)
/* try to pull free from sticking monster, or you release a monster /* try to pull free from sticking monster, or you release a monster
you're sticking to. returns TRUE if you lose your movement. */ you're sticking to. returns TRUE if you lose your movement. */
static boolean static boolean
escape_from_sticky_mon(xchar x, xchar y) escape_from_sticky_mon(coordxy x, coordxy y)
{ {
if (u.ustuck && (x != u.ustuck->mx || y != u.ustuck->my)) { if (u.ustuck && (x != u.ustuck->mx || y != u.ustuck->my)) {
struct monst *mtmp; struct monst *mtmp;
@@ -2220,10 +2220,10 @@ domove_core(void)
{ {
register struct monst *mtmp; register struct monst *mtmp;
register struct rm *tmpr; register struct rm *tmpr;
xchar x, y; coordxy x, y;
struct trap *trap = NULL; struct trap *trap = NULL;
int glyph; int glyph;
xchar chainx = 0, chainy = 0, coordxy chainx = 0, chainy = 0,
ballx = 0, bally = 0; /* ball&chain new positions */ ballx = 0, bally = 0; /* ball&chain new positions */
int bc_control = 0; /* control for ball&chain */ int bc_control = 0; /* control for ball&chain */
boolean cause_delay = FALSE, /* dragging ball will skip a move */ boolean cause_delay = FALSE, /* dragging ball will skip a move */
@@ -2852,7 +2852,7 @@ monstinroom(struct permonst *mdat, int roomno)
} }
char * char *
in_rooms(register xchar x, register xchar y, register int typewanted) in_rooms(register coordxy x, register coordxy y, register int typewanted)
{ {
static char buf[5]; static char buf[5];
char rno, *ptr = &buf[4]; char rno, *ptr = &buf[4];
@@ -3753,7 +3753,7 @@ money_cnt(struct obj *otmp)
} }
void void
spot_checks(xchar x, xchar y, schar old_typ) spot_checks(coordxy x, coordxy y, schar old_typ)
{ {
schar new_typ = levl[x][y].typ; schar new_typ = levl[x][y].typ;
boolean db_ice_now = FALSE; boolean db_ice_now = FALSE;
+5 -5
View File
@@ -86,7 +86,7 @@ loot_classify(Loot *sort_item, struct obj *obj)
k = 1 + (int) (p - classorder); k = 1 + (int) (p - classorder);
else else
k = 1 + (int) strlen(classorder) + (oclass != VENOM_CLASS); k = 1 + (int) strlen(classorder) + (oclass != VENOM_CLASS);
sort_item->orderclass = (xchar) k; sort_item->orderclass = (coordxy) k;
/* subclass designation; only a few classes have subclasses /* subclass designation; only a few classes have subclasses
and the non-armor ones we use are fairly arbitrary */ and the non-armor ones we use are fairly arbitrary */
switch (oclass) { switch (oclass) {
@@ -202,13 +202,13 @@ loot_classify(Loot *sort_item, struct obj *obj)
k = 1; /* any non-zero would do */ k = 1; /* any non-zero would do */
break; break;
} }
sort_item->subclass = (xchar) k; sort_item->subclass = (coordxy) k;
/* discovery status */ /* discovery status */
k = !seen ? 1 /* unseen */ k = !seen ? 1 /* unseen */
: (discovered || !OBJ_DESCR(objects[otyp])) ? 4 : (discovered || !OBJ_DESCR(objects[otyp])) ? 4
: (objects[otyp].oc_uname) ? 3 /* named (partially discovered) */ : (objects[otyp].oc_uname) ? 3 /* named (partially discovered) */
: 2; /* undiscovered */ : 2; /* undiscovered */
sort_item->disco = (xchar) k; sort_item->disco = (coordxy) k;
} }
/* sortloot() formatting routine; for alphabetizing, not shown to user */ /* sortloot() formatting routine; for alphabetizing, not shown to user */
@@ -2283,7 +2283,7 @@ fully_identify_obj(struct obj *otmp)
{ {
makeknown(otmp->otyp); makeknown(otmp->otyp);
if (otmp->oartifact) if (otmp->oartifact)
discover_artifact((xchar) otmp->oartifact); discover_artifact((coordxy) otmp->oartifact);
otmp->known = otmp->dknown = otmp->bknown = otmp->rknown = 1; otmp->known = otmp->dknown = otmp->bknown = otmp->rknown = 1;
set_cknown_lknown(otmp); /* set otmp->{cknown,lknown} if applicable */ set_cknown_lknown(otmp); /* set otmp->{cknown,lknown} if applicable */
if (otmp->otyp == EGG && otmp->corpsenm != NON_PM) if (otmp->otyp == EGG && otmp->corpsenm != NON_PM)
@@ -3634,7 +3634,7 @@ count_contents(struct obj *container,
long count = 0L; long count = 0L;
if (!everything && !newdrop) { if (!everything && !newdrop) {
xchar x, y; coordxy x, y;
for (topc = container; topc->where == OBJ_CONTAINED; for (topc = container; topc->where == OBJ_CONTAINED;
topc = topc->ocontainer) topc = topc->ocontainer)
+8 -8
View File
@@ -41,27 +41,27 @@
#define LSF_SHOW 0x1 /* display the light source */ #define LSF_SHOW 0x1 /* display the light source */
#define LSF_NEEDS_FIXUP 0x2 /* need oid fixup */ #define LSF_NEEDS_FIXUP 0x2 /* need oid fixup */
static light_source *new_light_core(xchar, xchar, int, int, anything *); static light_source *new_light_core(coordxy, coordxy, int, int, anything *);
static void discard_flashes(void); static void discard_flashes(void);
static void write_ls(NHFILE *, light_source *); static void write_ls(NHFILE *, light_source *);
static int maybe_write_ls(NHFILE *, int, boolean); static int maybe_write_ls(NHFILE *, int, boolean);
/* imported from vision.c, for small circles */ /* imported from vision.c, for small circles */
extern xchar circle_data[]; extern coordxy circle_data[];
extern xchar circle_start[]; extern coordxy circle_start[];
/* Create a new light source. Caller (and extern.h) doesn't need to know /* Create a new light source. Caller (and extern.h) doesn't need to know
anything about type 'light_source'. */ anything about type 'light_source'. */
void void
new_light_source(xchar x, xchar y, int range, int type, anything *id) new_light_source(coordxy x, coordxy y, int range, int type, anything *id)
{ {
(void) new_light_core(x, y, range, type, id); (void) new_light_core(x, y, range, type, id);
} }
/* Create a new light source and return it. Only used within this file. */ /* Create a new light source and return it. Only used within this file. */
static light_source * static light_source *
new_light_core(xchar x, xchar y, int range, int type, anything *id) new_light_core(coordxy x, coordxy y, int range, int type, anything *id)
{ {
light_source *ls; light_source *ls;
@@ -134,13 +134,13 @@ del_light_source(int type, anything *id)
/* Mark locations that are temporarily lit via mobile light sources. */ /* Mark locations that are temporarily lit via mobile light sources. */
void void
do_light_sources(xchar **cs_rows) do_light_sources(coordxy **cs_rows)
{ {
int x, y, min_x, max_x, max_y, offset; int x, y, min_x, max_x, max_y, offset;
xchar *limits; coordxy *limits;
short at_hero_range = 0; short at_hero_range = 0;
light_source *ls; light_source *ls;
xchar *row; coordxy *row;
for (ls = g.light_base; ls; ls = ls->next) { for (ls = g.light_base; ls; ls = ls->next) {
ls->flags &= ~LSF_SHOW; ls->flags &= ~LSF_SHOW;
+1 -1
View File
@@ -352,7 +352,7 @@ DISABLE_WARNING_FORMAT_NONLITERAL
int int
pick_lock( pick_lock(
struct obj *pick, struct obj *pick,
xchar rx, xchar ry, /* coordinates of door/container, for autounlock: coordxy rx, coordxy ry, /* coordinates of door/container, for autounlock:
* does not prompt for direction if these are set */ * does not prompt for direction if these are set */
struct obj *container) /* container, for autounlock */ struct obj *container) /* container, for autounlock */
{ {
+2 -2
View File
@@ -200,7 +200,7 @@ md_start(coord *startp)
startp->y = row; startp->y = row;
startp->x = g.viz_rmin[row]; startp->x = g.viz_rmin[row];
} else if (enexto(&testcc, (xchar) g.viz_rmin[row], row, } else if (enexto(&testcc, (coordxy) g.viz_rmin[row], row,
(struct permonst *) 0) (struct permonst *) 0)
&& !cansee(testcc.x, testcc.y) && !cansee(testcc.x, testcc.y)
&& couldsee(testcc.x, testcc.y)) { && couldsee(testcc.x, testcc.y)) {
@@ -215,7 +215,7 @@ md_start(coord *startp)
startp->y = row; startp->y = row;
startp->x = g.viz_rmax[row]; startp->x = g.viz_rmax[row];
} else if (enexto(&testcc, (xchar) g.viz_rmax[row], row, } else if (enexto(&testcc, (coordxy) g.viz_rmax[row], row,
(struct permonst *) 0) (struct permonst *) 0)
&& !cansee(testcc.x, testcc.y) && !cansee(testcc.x, testcc.y)
&& couldsee(testcc.x, testcc.y)) { && couldsee(testcc.x, testcc.y)) {
+1 -1
View File
@@ -815,7 +815,7 @@ m_initinv(register struct monst *mtmp)
/* Note: for long worms, always call cutworm (cutworm calls clone_mon) */ /* Note: for long worms, always call cutworm (cutworm calls clone_mon) */
struct monst * struct monst *
clone_mon(struct monst *mon, clone_mon(struct monst *mon,
xchar x, xchar y) /* clone's preferred location or 0 (near mon) */ coordxy x, coordxy y) /* clone's preferred location or 0 (near mon) */
{ {
coord mm; coord mm;
struct monst *m2; struct monst *m2;
+1 -1
View File
@@ -751,7 +751,7 @@ static int
gulpmm(register struct monst *magr, register struct monst *mdef, gulpmm(register struct monst *magr, register struct monst *mdef,
register struct attack *mattk) register struct attack *mattk)
{ {
xchar ax, ay, dx, dy; coordxy ax, ay, dx, dy;
int status; int status;
char buf[BUFSZ]; char buf[BUFSZ];
struct obj *obj; struct obj *obj;
+1 -1
View File
@@ -1702,7 +1702,7 @@ could_seduce(struct monst *magr, struct monst *mdef,
{ {
struct permonst *pagr; struct permonst *pagr;
boolean agrinvis, defperc; boolean agrinvis, defperc;
xchar genagr, gendef; xint16 genagr, gendef;
int adtyp; int adtyp;
if (is_animal(magr->data)) if (is_animal(magr->data))
+24 -24
View File
@@ -21,22 +21,22 @@ static void makevtele(void);
void clear_level_structures(void); void clear_level_structures(void);
static void fill_ordinary_room(struct mkroom *); static void fill_ordinary_room(struct mkroom *);
static void makelevel(void); static void makelevel(void);
static boolean bydoor(xchar, xchar); static boolean bydoor(coordxy, coordxy);
static struct mkroom *find_branch_room(coord *); static struct mkroom *find_branch_room(coord *);
static struct mkroom *pos_to_room(xchar, xchar); static struct mkroom *pos_to_room(coordxy, coordxy);
static boolean place_niche(struct mkroom *, int *, int *, int *); static boolean place_niche(struct mkroom *, int *, int *, int *);
static void makeniche(int); static void makeniche(int);
static void make_niches(void); static void make_niches(void);
static int QSORTCALLBACK mkroom_cmp(const genericptr, const genericptr); static int QSORTCALLBACK mkroom_cmp(const genericptr, const genericptr);
static void dosdoor(xchar, xchar, struct mkroom *, int); static void dosdoor(coordxy, coordxy, struct mkroom *, int);
static void join(int, int, boolean); static void join(int, int, boolean);
static void do_room_or_subroom(struct mkroom *, int, int, int, int, boolean, static void do_room_or_subroom(struct mkroom *, int, int, int, int, boolean,
schar, boolean, boolean); schar, boolean, boolean);
static void makerooms(void); static void makerooms(void);
static boolean door_into_nonjoined(xchar, xchar); static boolean door_into_nonjoined(coordxy, coordxy);
static boolean finddpos(coord *, xchar, xchar, xchar, xchar); static boolean finddpos(coord *, coordxy, coordxy, coordxy, coordxy);
static void mkinvpos(xchar, xchar, int); static void mkinvpos(coordxy, coordxy, int);
static void mk_knox_portal(xchar, xchar); static void mk_knox_portal(coordxy, coordxy);
#define create_vault() create_room(-1, -1, 2, 2, -1, -1, VAULT, TRUE) #define create_vault() create_room(-1, -1, 2, 2, -1, -1, VAULT, TRUE)
#define init_vault() g.vault_x = -1 #define init_vault() g.vault_x = -1
@@ -71,9 +71,9 @@ mkroom_cmp(const genericptr vx, const genericptr vy)
* to connect them up to other areas. * to connect them up to other areas.
*/ */
static boolean static boolean
door_into_nonjoined(xchar x, xchar y) door_into_nonjoined(coordxy x, coordxy y)
{ {
xchar tx, ty, i; coordxy tx, ty, i;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
tx = x + xdir[dirs_ord[i]]; tx = x + xdir[dirs_ord[i]];
@@ -91,9 +91,9 @@ door_into_nonjoined(xchar x, xchar y)
} }
static boolean static boolean
finddpos(coord *cc, xchar xl, xchar yl, xchar xh, xchar yh) finddpos(coord *cc, coordxy xl, coordxy yl, coordxy xh, coordxy yh)
{ {
register xchar x, y; register coordxy x, y;
x = rn1(xh - xl + 1, xl); x = rn1(xh - xl + 1, xl);
y = rn1(yh - yl + 1, yl); y = rn1(yh - yl + 1, yl);
@@ -329,7 +329,7 @@ static void
join(register int a, register int b, boolean nxcor) join(register int a, register int b, boolean nxcor)
{ {
coord cc, tt, org, dest; coord cc, tt, org, dest;
register xchar tx, ty, xx, yy; register coordxy tx, ty, xx, yy;
register struct mkroom *croom, *troom; register struct mkroom *croom, *troom;
register int dx, dy; register int dx, dy;
@@ -481,7 +481,7 @@ add_door(register int x, register int y, register struct mkroom *aroom)
} }
static void static void
dosdoor(register xchar x, register xchar y, struct mkroom *aroom, int type) dosdoor(register coordxy x, register coordxy y, struct mkroom *aroom, int type)
{ {
boolean shdoor = *in_rooms(x, y, SHOPBASE) ? TRUE : FALSE; boolean shdoor = *in_rooms(x, y, SHOPBASE) ? TRUE : FALSE;
@@ -905,7 +905,7 @@ makelevel(void)
/* make a secret treasure vault, not connected to the rest */ /* make a secret treasure vault, not connected to the rest */
if (do_vault()) { if (do_vault()) {
xchar w, h; coordxy w, h;
debugpline0("trying to make a vault..."); debugpline0("trying to make a vault...");
w = 1; w = 1;
@@ -1222,7 +1222,7 @@ find_branch_room(coord *mp)
/* Find the room for (x,y). Return null if not in a room. */ /* Find the room for (x,y). Return null if not in a room. */
static struct mkroom * static struct mkroom *
pos_to_room(xchar x, xchar y) pos_to_room(coordxy x, coordxy y)
{ {
int i; int i;
struct mkroom *curr; struct mkroom *curr;
@@ -1238,7 +1238,7 @@ pos_to_room(xchar x, xchar y)
void void
place_branch( place_branch(
branch *br, /* branch to place */ branch *br, /* branch to place */
xchar x, xchar y) /* location */ coordxy x, coordxy y) /* location */
{ {
coord m = {0}; coord m = {0};
d_level *dest; d_level *dest;
@@ -1294,7 +1294,7 @@ place_branch(
} }
static boolean static boolean
bydoor(register xchar x, register xchar y) bydoor(register coordxy x, register coordxy y)
{ {
register int typ; register int typ;
@@ -1323,7 +1323,7 @@ bydoor(register xchar x, register xchar y)
/* see whether it is allowable to create a door at [x,y] */ /* see whether it is allowable to create a door at [x,y] */
int int
okdoor(xchar x, xchar y) okdoor(coordxy x, coordxy y)
{ {
boolean near_door = bydoor(x, y); boolean near_door = bydoor(x, y);
@@ -1347,7 +1347,7 @@ dodoor(int x, int y, struct mkroom *aroom)
} }
boolean boolean
occupied(xchar x, xchar y) occupied(coordxy x, coordxy y)
{ {
return (boolean) (t_at(x, y) || IS_FURNITURE(levl[x][y].typ) return (boolean) (t_at(x, y) || IS_FURNITURE(levl[x][y].typ)
|| is_lava(x, y) || is_pool(x, y) || is_lava(x, y) || is_pool(x, y)
@@ -1636,7 +1636,7 @@ mktrap(
If force is TRUE, change the terrain to ROOM first */ If force is TRUE, change the terrain to ROOM first */
void void
mkstairs( mkstairs(
xchar x, xchar y, coordxy x, coordxy y,
char up, /* [why 'char' when usage is boolean?] */ char up, /* [why 'char' when usage is boolean?] */
struct mkroom *croom UNUSED, struct mkroom *croom UNUSED,
boolean force) boolean force)
@@ -1884,9 +1884,9 @@ void
mkinvokearea(void) mkinvokearea(void)
{ {
int dist; int dist;
xchar xmin = g.inv_pos.x, xmax = g.inv_pos.x, coordxy xmin = g.inv_pos.x, xmax = g.inv_pos.x,
ymin = g.inv_pos.y, ymax = g.inv_pos.y; ymin = g.inv_pos.y, ymax = g.inv_pos.y;
register xchar i; register coordxy i;
/* slightly odd if levitating, but not wrong */ /* slightly odd if levitating, but not wrong */
pline_The("floor shakes violently under you!"); pline_The("floor shakes violently under you!");
@@ -1940,7 +1940,7 @@ mkinvokearea(void)
* Temporarily overrides vision in the name of a nice effect. * Temporarily overrides vision in the name of a nice effect.
*/ */
static void static void
mkinvpos(xchar x, xchar y, int dist) mkinvpos(coordxy x, coordxy y, int dist)
{ {
struct trap *ttmp; struct trap *ttmp;
struct obj *otmp; struct obj *otmp;
@@ -2035,7 +2035,7 @@ mkinvpos(xchar x, xchar y, int dist)
* Ludios will remain isolated until the branch is corrected by this function. * Ludios will remain isolated until the branch is corrected by this function.
*/ */
static void static void
mk_knox_portal(xchar x, xchar y) mk_knox_portal(coordxy x, coordxy y)
{ {
d_level *source; d_level *source;
branch *br; branch *br;
+1 -1
View File
@@ -433,7 +433,7 @@ mkmap(lev_init* init_lev)
{ {
schar bg_typ = init_lev->bg, fg_typ = init_lev->fg; schar bg_typ = init_lev->bg, fg_typ = init_lev->fg;
boolean smooth = init_lev->smoothed, join = init_lev->joined; boolean smooth = init_lev->smoothed, join = init_lev->joined;
xchar lit = init_lev->lit, walled = init_lev->walled; xint16 lit = init_lev->lit, walled = init_lev->walled;
int i; int i;
lit = litstate_rnd(lit); lit = litstate_rnd(lit);
+23 -23
View File
@@ -13,8 +13,8 @@ static int extend_spine(int[3][3], int, int, int);
static void wall_cleanup(int, int, int, int); static void wall_cleanup(int, int, int, int);
static boolean okay(int, int, int); static boolean okay(int, int, int);
static void maze0xy(coord *); static void maze0xy(coord *);
static boolean put_lregion_here(xchar, xchar, xchar, xchar, xchar, static boolean put_lregion_here(coordxy, coordxy, coordxy, coordxy, coordxy,
xchar, xchar, boolean, d_level *); coordxy, coordxy, boolean, d_level *);
static void baalz_fixup(void); static void baalz_fixup(void);
static void setup_waterlevel(void); static void setup_waterlevel(void);
static void unsetup_waterlevel(void); static void unsetup_waterlevel(void);
@@ -24,7 +24,7 @@ static void migrate_orc(struct monst *, unsigned long);
static void shiny_orc_stuff(struct monst *); static void shiny_orc_stuff(struct monst *);
static void stolen_booty(void); static void stolen_booty(void);
static boolean maze_inbounds(int, int); static boolean maze_inbounds(int, int);
static void maze_remove_deadends(xchar); static void maze_remove_deadends(xint16);
/* adjust a coordinate one step in the specified direction */ /* adjust a coordinate one step in the specified direction */
#define mz_move(X, Y, dir) \ #define mz_move(X, Y, dir) \
@@ -69,7 +69,7 @@ is_solid(int x, int y)
/* set map terrain type, handling lava lit, ice melt timers, etc */ /* set map terrain type, handling lava lit, ice melt timers, etc */
boolean boolean
set_levltyp(xchar x, xchar y, schar typ) set_levltyp(coordxy x, coordxy y, schar typ)
{ {
if (isok(x, y)) { if (isok(x, y)) {
if ((typ < MAX_TYPE) && CAN_OVERWRITE_TERRAIN(levl[x][y].typ)) { if ((typ < MAX_TYPE) && CAN_OVERWRITE_TERRAIN(levl[x][y].typ)) {
@@ -94,7 +94,7 @@ set_levltyp(xchar x, xchar y, schar typ)
/* set map terrain type and light state */ /* set map terrain type and light state */
boolean boolean
set_levltyp_lit(xchar x, xchar y, schar typ, schar lit) set_levltyp_lit(coordxy x, coordxy y, schar typ, schar lit)
{ {
boolean ret = set_levltyp(x, y, typ); boolean ret = set_levltyp(x, y, typ);
@@ -209,7 +209,7 @@ fix_wall_spines(int x1, int y1, int x2, int y2)
* so even though this table says VWALL, we actually leave whatever * so even though this table says VWALL, we actually leave whatever
* typ was there alone. * typ was there alone.
*/ */
static xchar spine_array[16] = { VWALL, HWALL, HWALL, HWALL, static xint16 spine_array[16] = { VWALL, HWALL, HWALL, HWALL,
VWALL, TRCORNER, TLCORNER, TDWALL, VWALL, TRCORNER, TLCORNER, TDWALL,
VWALL, BRCORNER, BLCORNER, TUWALL, VWALL, BRCORNER, BLCORNER, TUWALL,
VWALL, TLWALL, TRWALL, CROSSWALL }; VWALL, TLWALL, TRWALL, CROSSWALL };
@@ -289,7 +289,7 @@ maze0xy(coord * cc)
* NOT (pos is corridor and a maze level OR pos is a room OR pos is air) * NOT (pos is corridor and a maze level OR pos is a room OR pos is air)
*/ */
boolean boolean
bad_location(xchar x, xchar y, xchar lx, xchar ly, xchar hx, xchar hy) bad_location(coordxy x, coordxy y, coordxy lx, coordxy ly, coordxy hx, coordxy hy)
{ {
return (boolean) (occupied(x, y) return (boolean) (occupied(x, y)
|| within_bounded_area(x, y, lx, ly, hx, hy) || within_bounded_area(x, y, lx, ly, hx, hy)
@@ -302,14 +302,14 @@ bad_location(xchar x, xchar y, xchar lx, xchar ly, xchar hx, xchar hy)
and place something (based on rtype) in that region */ and place something (based on rtype) in that region */
void void
place_lregion( place_lregion(
xchar lx, xchar ly, xchar hx, xchar hy, coordxy lx, coordxy ly, coordxy hx, coordxy hy,
xchar nlx, xchar nly, xchar nhx,xchar nhy, coordxy nlx, coordxy nly, coordxy nhx,coordxy nhy,
xchar rtype, xint16 rtype,
d_level *lev) d_level *lev)
{ {
int trycnt; int trycnt;
boolean oneshot; boolean oneshot;
xchar x, y; coordxy x, y;
if (!lx) { /* default to whole level */ if (!lx) { /* default to whole level */
/* /*
@@ -349,9 +349,9 @@ place_lregion(
static boolean static boolean
put_lregion_here( put_lregion_here(
xchar x, xchar y, coordxy x, coordxy y,
xchar nlx, xchar nly, xchar nhx, xchar nhy, coordxy nlx, coordxy nly, coordxy nhx, coordxy nhy,
xchar rtype, xint16 rtype,
boolean oneshot, boolean oneshot,
d_level *lev) d_level *lev)
{ {
@@ -823,7 +823,7 @@ maze_inbounds(int x, int y)
} }
static void static void
maze_remove_deadends(xchar typ) maze_remove_deadends(xint16 typ)
{ {
char dirok[4]; char dirok[4];
int x, y, dir, idx, idx2, dx, dy, dx2, dy2; int x, y, dir, idx, idx2, dx, dy, dx2, dy2;
@@ -1234,8 +1234,8 @@ mazexy(coord *cc)
x = rnd(g.x_maze_max); x = rnd(g.x_maze_max);
y = rnd(g.y_maze_max); y = rnd(g.y_maze_max);
if (levl[x][y].typ == allowedtyp) { if (levl[x][y].typ == allowedtyp) {
cc->x = (xchar) x; cc->x = (coordxy) x;
cc->y = (xchar) y; cc->y = (coordxy) y;
return; return;
} }
} while (++cpt < 100); } while (++cpt < 100);
@@ -1243,8 +1243,8 @@ mazexy(coord *cc)
for (x = 1; x <= g.x_maze_max; x++) for (x = 1; x <= g.x_maze_max; x++)
for (y = 1; y <= g.y_maze_max; y++) for (y = 1; y <= g.y_maze_max; y++)
if (levl[x][y].typ == allowedtyp) { if (levl[x][y].typ == allowedtyp) {
cc->x = (xchar) x; cc->x = (coordxy) x;
cc->y = (xchar) y; cc->y = (coordxy) y;
return; return;
} }
/* every spot on the area of map allowed for mazes has been rejected */ /* every spot on the area of map allowed for mazes has been rejected */
@@ -1356,7 +1356,7 @@ bound_digging(void)
} }
void void
mkportal(xchar x, xchar y, xchar todnum, xchar todlevel) mkportal(coordxy x, coordxy y, xint16 todnum, xint16 todlevel)
{ {
/* a portal "trap" must be matched by a /* a portal "trap" must be matched by a
portal in the destination dungeon/dlevel */ portal in the destination dungeon/dlevel */
@@ -1376,12 +1376,12 @@ mkportal(xchar x, xchar y, xchar todnum, xchar todlevel)
void void
fumaroles(void) fumaroles(void)
{ {
xchar n; xint16 n;
boolean snd = FALSE, loud = FALSE; boolean snd = FALSE, loud = FALSE;
for (n = rn2(3) + 2; n; n--) { for (n = rn2(3) + 2; n; n--) {
xchar x = rn1(COLNO - 4, 3); coordxy x = rn1(COLNO - 4, 3);
xchar y = rn1(ROWNO - 4, 3); coordxy y = rn1(ROWNO - 4, 3);
if (levl[x][y].typ == LAVAPOOL) { if (levl[x][y].typ == LAVAPOOL) {
NhRegion *r = create_gas_cloud(x, y, rn1(30, 20), rn1(10, 5)); NhRegion *r = create_gas_cloud(x, y, rn1(30, 20), rn1(10, 5));
+9 -9
View File
@@ -9,7 +9,7 @@ static void mkbox_cnts(struct obj *);
static unsigned nextoid(struct obj *, struct obj *); static unsigned nextoid(struct obj *, struct obj *);
static int item_on_ice(struct obj *); static int item_on_ice(struct obj *);
static void shrinking_glob_gone(struct obj *); static void shrinking_glob_gone(struct obj *);
static void obj_timer_checks(struct obj *, xchar, xchar, int); static void obj_timer_checks(struct obj *, coordxy, coordxy, int);
static void container_weight(struct obj *); static void container_weight(struct obj *);
static struct obj *save_mtraits(struct obj *, struct monst *); static struct obj *save_mtraits(struct obj *, struct monst *);
static void objlist_sanity(struct obj *, int, const char *); static void objlist_sanity(struct obj *, int, const char *);
@@ -677,7 +677,7 @@ static const char *const alteration_verbs[] = {
void void
costly_alteration(struct obj *obj, int alter_type) costly_alteration(struct obj *obj, int alter_type)
{ {
xchar ox, oy; coordxy ox, oy;
char objroom; char objroom;
boolean learn_bknown; boolean learn_bknown;
const char *those, *them; const char *those, *them;
@@ -1293,7 +1293,7 @@ static int
item_on_ice(struct obj *item) item_on_ice(struct obj *item)
{ {
struct obj *otmp; struct obj *otmp;
xchar ox, oy; coordxy ox, oy;
otmp = item; otmp = item;
/* if in a container, it might be nested so find outermost one since /* if in a container, it might be nested so find outermost one since
@@ -1491,7 +1491,7 @@ shrink_glob(
} }
if (gone) { if (gone) {
xchar ox = 0, oy = 0; coordxy ox = 0, oy = 0;
/* check location for visibility before destroying obj */ /* check location for visibility before destroying obj */
boolean seeit = (obj->where == OBJ_FLOOR boolean seeit = (obj->where == OBJ_FLOOR
&& get_obj_location(obj, &ox, &oy, 0) && get_obj_location(obj, &ox, &oy, 0)
@@ -1522,7 +1522,7 @@ shrink_glob(
static void static void
shrinking_glob_gone(struct obj *obj) shrinking_glob_gone(struct obj *obj)
{ {
xchar owhere = obj->where; xint16 owhere = obj->where;
if (owhere == OBJ_INVENT) { if (owhere == OBJ_INVENT) {
if (obj->owornmask) { if (obj->owornmask) {
@@ -1554,7 +1554,7 @@ void
maybe_adjust_light(struct obj *obj, int old_range) maybe_adjust_light(struct obj *obj, int old_range)
{ {
char buf[BUFSZ]; char buf[BUFSZ];
xchar ox, oy; coordxy ox, oy;
int new_range = arti_light_radius(obj), delta = new_range - old_range; int new_range = arti_light_radius(obj), delta = new_range - old_range;
/* radius of light emitting artifact varies by curse/bless state /* radius of light emitting artifact varies by curse/bless state
@@ -2198,7 +2198,7 @@ peek_at_iced_corpse_age(struct obj *otmp)
static void static void
obj_timer_checks( obj_timer_checks(
struct obj *otmp, struct obj *otmp,
xchar x, xchar y, coordxy x, coordxy y,
int force) /* 0 = no force so do checks, <0 = force off, >0 force on */ int force) /* 0 = no force so do checks, <0 = force off, >0 force on */
{ {
long tleft = 0L; long tleft = 0L;
@@ -2266,8 +2266,8 @@ obj_timer_checks(
void void
remove_object(struct obj *otmp) remove_object(struct obj *otmp)
{ {
xchar x = otmp->ox; coordxy x = otmp->ox;
xchar y = otmp->oy; coordxy y = otmp->oy;
if (otmp->where != OBJ_FLOOR) if (otmp->where != OBJ_FLOOR)
panic("remove_object: obj not on floor"); panic("remove_object: obj not on floor");
+2 -2
View File
@@ -283,7 +283,7 @@ fill_zoo(struct mkroom* sroom)
(void) somexy(sroom, &mm); (void) somexy(sroom, &mm);
tx = mm.x; tx = mm.x;
ty = mm.y; ty = mm.y;
} while (occupied((xchar) tx, (xchar) ty) && --i > 0); } while (occupied((coordxy) tx, (coordxy) ty) && --i > 0);
throne_placed: throne_placed:
mk_zoo_thronemon(tx, ty); mk_zoo_thronemon(tx, ty);
break; break;
@@ -654,7 +654,7 @@ somey(struct mkroom* croom)
} }
boolean boolean
inside_room(struct mkroom* croom, xchar x, xchar y) inside_room(struct mkroom* croom, coordxy x, coordxy y)
{ {
if (croom->irregular) { if (croom->irregular) {
int i = (int) ((croom - g.rooms) + ROOMOFFSET); int i = (int) ((croom - g.rooms) + ROOMOFFSET);
+16 -16
View File
@@ -19,7 +19,7 @@ static void mon_leaving_level(struct monst *);
static void m_detach(struct monst *, struct permonst *); static void m_detach(struct monst *, struct permonst *);
static void set_mon_min_mhpmax(struct monst *, int); static void set_mon_min_mhpmax(struct monst *, int);
static void lifesaved_monster(struct monst *); static void lifesaved_monster(struct monst *);
static void migrate_mon(struct monst *, xchar, xchar); static void migrate_mon(struct monst *, coordxy, coordxy);
static boolean ok_to_obliterate(struct monst *); static boolean ok_to_obliterate(struct monst *);
static void deal_with_overcrowding(struct monst *); static void deal_with_overcrowding(struct monst *);
static void m_restartcham(struct monst *); static void m_restartcham(struct monst *);
@@ -1807,7 +1807,7 @@ mfndpos(
{ {
struct permonst *mdat = mon->data; struct permonst *mdat = mon->data;
register struct trap *ttmp; register struct trap *ttmp;
xchar x, y, nx, ny; coordxy x, y, nx, ny;
int cnt = 0; int cnt = 0;
uchar ntyp; uchar ntyp;
uchar nowtyp; uchar nowtyp;
@@ -2357,7 +2357,7 @@ m_detach(
struct monst *mtmp, struct monst *mtmp,
struct permonst *mptr) /* reflects mtmp->data _prior_ to mtmp's death */ struct permonst *mptr) /* reflects mtmp->data _prior_ to mtmp's death */
{ {
xchar mx = mtmp->mx, my = mtmp->my; coordxy mx = mtmp->mx, my = mtmp->my;
if (mtmp->mleashed) if (mtmp->mleashed)
m_unleash(mtmp, FALSE); m_unleash(mtmp, FALSE);
@@ -2790,7 +2790,7 @@ void
monstone(struct monst* mdef) monstone(struct monst* mdef)
{ {
struct obj *otmp, *obj, *oldminvent; struct obj *otmp, *obj, *oldminvent;
xchar x = mdef->mx, y = mdef->my; coordxy x = mdef->mx, y = mdef->my;
boolean wasinside = FALSE; boolean wasinside = FALSE;
/* vampshifter reverts to vampire; /* vampshifter reverts to vampire;
@@ -3284,14 +3284,14 @@ vamp_stone(struct monst *mtmp)
void void
m_into_limbo(struct monst *mtmp) m_into_limbo(struct monst *mtmp)
{ {
xchar target_lev = ledger_no(&u.uz), xyloc = MIGR_APPROX_XY; xint16 target_lev = ledger_no(&u.uz), xyloc = MIGR_APPROX_XY;
mtmp->mstate |= MON_LIMBO; mtmp->mstate |= MON_LIMBO;
migrate_mon(mtmp, target_lev, xyloc); migrate_mon(mtmp, target_lev, xyloc);
} }
static void static void
migrate_mon(struct monst *mtmp, xchar target_lev, xchar xyloc) migrate_mon(struct monst *mtmp, xint16 target_lev, xint16 xyloc)
{ {
if (!mtmp->mx) { if (!mtmp->mx) {
/* this was a failed arrival attempt from a prior migration; /* this was a failed arrival attempt from a prior migration;
@@ -3382,7 +3382,7 @@ elemental_clog(struct monst *mon)
/* last resort - migrate mon to the next plane */ /* last resort - migrate mon to the next plane */
} else if (!Is_astralevel(&u.uz)) { } else if (!Is_astralevel(&u.uz)) {
d_level dest; d_level dest;
xchar target_lev; coordxy target_lev;
dest = u.uz; dest = u.uz;
dest.dlevel--; dest.dlevel--;
@@ -3462,13 +3462,13 @@ maybe_mnexto(struct monst* mtmp)
int int
mnearto( mnearto(
register struct monst *mtmp, register struct monst *mtmp,
xchar x, coordxy x,
xchar y, coordxy y,
boolean move_other, /* make sure mtmp gets to x, y! so move m_at(x, y) */ boolean move_other, /* make sure mtmp gets to x, y! so move m_at(x, y) */
unsigned int rlocflags) unsigned int rlocflags)
{ {
struct monst *othermon = (struct monst *) 0; struct monst *othermon = (struct monst *) 0;
xchar newx, newy; coordxy newx, newy;
coord mm; coord mm;
int res = 1; int res = 1;
@@ -3874,8 +3874,8 @@ get_iter_mons(boolean (*func)(struct monst *))
passing x,y to the function. passing x,y to the function.
if func returns TRUE, stop and return that monster. */ if func returns TRUE, stop and return that monster. */
struct monst * struct monst *
get_iter_mons_xy(boolean (*func)(struct monst *, xchar, xchar), get_iter_mons_xy(boolean (*func)(struct monst *, coordxy, coordxy),
xchar x, xchar y) coordxy x, coordxy y)
{ {
struct monst *mtmp; struct monst *mtmp;
@@ -3960,7 +3960,7 @@ restrap(struct monst *mtmp)
/* reveal a monster at x,y hiding under an object, /* reveal a monster at x,y hiding under an object,
if there are no objects there */ if there are no objects there */
void void
maybe_unhide_at(xchar x, xchar y) maybe_unhide_at(coordxy x, coordxy y)
{ {
struct monst *mtmp; struct monst *mtmp;
@@ -3978,7 +3978,7 @@ hideunder(struct monst *mtmp)
{ {
struct trap *t; struct trap *t;
boolean oldundetctd, undetected = FALSE, is_u = (mtmp == &g.youmonst); boolean oldundetctd, undetected = FALSE, is_u = (mtmp == &g.youmonst);
xchar x = is_u ? u.ux : mtmp->mx, y = is_u ? u.uy : mtmp->my; coordxy x = is_u ? u.ux : mtmp->mx, y = is_u ? u.uy : mtmp->my;
if (mtmp == u.ustuck) { if (mtmp == u.ustuck) {
; /* can't hide if holding you or held by you */ ; /* can't hide if holding you or held by you */
@@ -4021,7 +4021,7 @@ hide_monst(struct monst* mon)
if ((is_hider(mon->data) || hider_under) if ((is_hider(mon->data) || hider_under)
&& !(mon->mundetected || M_AP_TYPE(mon))) { && !(mon->mundetected || M_AP_TYPE(mon))) {
xchar x = mon->mx, y = mon->my; coordxy x = mon->mx, y = mon->my;
char save_viz = g.viz_array[y][x]; char save_viz = g.viz_array[y][x];
/* override vision, forcing hero to be unable to see monster's spot */ /* override vision, forcing hero to be unable to see monster's spot */
@@ -4541,7 +4541,7 @@ newcham(
*p = '\0'; *p = '\0';
if (mtmp->wormno) { /* throw tail away */ if (mtmp->wormno) { /* throw tail away */
xchar mx = mtmp->mx, my = mtmp->my; coordxy mx = mtmp->mx, my = mtmp->my;
wormgone(mtmp); /* discards tail segments, takes head off the map */ wormgone(mtmp); /* discards tail segments, takes head off the map */
/* put the head back; it will morph into mtmp's new form */ /* put the head back; it will morph into mtmp's new form */
+13 -12
View File
@@ -12,8 +12,8 @@ static int disturb(struct monst *);
static void release_hero(struct monst *); static void release_hero(struct monst *);
static void distfleeck(struct monst *, int *, int *, int *); static void distfleeck(struct monst *, int *, int *, int *);
static int m_arrival(struct monst *); static int m_arrival(struct monst *);
static boolean holds_up_web(xchar, xchar); static boolean holds_up_web(coordxy, coordxy);
static int count_webbing_walls(xchar, xchar); static int count_webbing_walls(coordxy, coordxy);
static boolean soko_allow_web(struct monst *); static boolean soko_allow_web(struct monst *);
static boolean leppie_avoidance(struct monst *); static boolean leppie_avoidance(struct monst *);
static void leppie_stash(struct monst *); static void leppie_stash(struct monst *);
@@ -812,8 +812,8 @@ should_displace(
coord *poss, /* coord poss[9] */ coord *poss, /* coord poss[9] */
long *info, /* long info[9] */ long *info, /* long info[9] */
int cnt, int cnt,
xchar gx, coordxy gx,
xchar gy) coordxy gy)
{ {
int shortest_with_displacing = -1; int shortest_with_displacing = -1;
int shortest_without_displacing = -1; int shortest_without_displacing = -1;
@@ -845,7 +845,7 @@ should_displace(
} }
boolean boolean
m_digweapon_check(struct monst* mtmp, xchar nix, xchar niy) m_digweapon_check(struct monst* mtmp, coordxy nix, coordxy niy)
{ {
boolean can_tunnel = 0; boolean can_tunnel = 0;
struct obj *mw_tmp = MON_WEP(mtmp); struct obj *mw_tmp = MON_WEP(mtmp);
@@ -940,7 +940,7 @@ m_balks_at_approaching(struct monst* mtmp)
} }
static boolean static boolean
holds_up_web(xchar x, xchar y) holds_up_web(coordxy x, coordxy y)
{ {
stairway *sway; stairway *sway;
@@ -957,7 +957,7 @@ holds_up_web(xchar x, xchar y)
/* returns the number of walls in the four cardinal directions that could /* returns the number of walls in the four cardinal directions that could
hold up a web */ hold up a web */
static int static int
count_webbing_walls(xchar x, xchar y) count_webbing_walls(coordxy x, coordxy y)
{ {
return (holds_up_web(x, y - 1) + holds_up_web(x + 1, y) return (holds_up_web(x, y - 1) + holds_up_web(x + 1, y)
+ holds_up_web(x, y + 1) + holds_up_web(x - 1, y)); + holds_up_web(x, y + 1) + holds_up_web(x - 1, y));
@@ -1018,7 +1018,8 @@ int
m_move(register struct monst* mtmp, register int after) m_move(register struct monst* mtmp, register int after)
{ {
int appr, etmp; int appr, etmp;
xchar gx, gy, nix, niy, chcnt; coordxy gx, gy, nix, niy;
xint16 chcnt;
int chi; /* could be schar except for stupid Sun-2 compiler */ int chi; /* could be schar except for stupid Sun-2 compiler */
boolean likegold = 0, likegems = 0, likeobjs = 0, likemagic = 0, boolean likegold = 0, likegems = 0, likeobjs = 0, likemagic = 0,
conceals = 0; conceals = 0;
@@ -1076,7 +1077,7 @@ m_move(register struct monst* mtmp, register int after)
/* and the acquisitive monsters get special treatment */ /* and the acquisitive monsters get special treatment */
if (is_covetous(ptr)) { if (is_covetous(ptr)) {
xchar tx = STRAT_GOALX(mtmp->mstrategy), coordxy tx = STRAT_GOALX(mtmp->mstrategy),
ty = STRAT_GOALY(mtmp->mstrategy); ty = STRAT_GOALY(mtmp->mstrategy);
struct monst *intruder = m_at(tx, ty); struct monst *intruder = m_at(tx, ty);
/* /*
@@ -1723,7 +1724,7 @@ m_move(register struct monst* mtmp, register int after)
* (mtmp died) or 3 (mtmp made its move). * (mtmp died) or 3 (mtmp made its move).
*/ */
int int
m_move_aggress(struct monst* mtmp, xchar x, xchar y) m_move_aggress(struct monst* mtmp, coordxy x, coordxy y)
{ {
struct monst *mtmp2; struct monst *mtmp2;
int mstatus; int mstatus;
@@ -1855,8 +1856,8 @@ set_apparxy(register struct monst* mtmp)
boolean boolean
undesirable_disp( undesirable_disp(
struct monst *mtmp, /* barging creature */ struct monst *mtmp, /* barging creature */
xchar x, coordxy x,
xchar y) /* spot 'mtmp' is considering moving to */ coordxy y) /* spot 'mtmp' is considering moving to */
{ {
boolean is_pet = (mtmp && mtmp->mtame && !mtmp->isminion); boolean is_pet = (mtmp && mtmp->mtame && !mtmp->isminion);
struct trap *trap = t_at(x, y); struct trap *trap = t_at(x, y);
+2 -2
View File
@@ -114,7 +114,7 @@ mk_mplayer_armor(struct monst* mon, short typ)
} }
struct monst * struct monst *
mk_mplayer(struct permonst *ptr, xchar x, xchar y, boolean special) mk_mplayer(struct permonst *ptr, coordxy x, coordxy y, boolean special)
{ {
struct monst *mtmp; struct monst *mtmp;
char nam[PL_NSIZ]; char nam[PL_NSIZ];
@@ -343,7 +343,7 @@ create_mplayers(register int num, boolean special)
if (tryct > 50) if (tryct > 50)
return; return;
(void) mk_mplayer(&mons[pm], (xchar) x, (xchar) y, special); (void) mk_mplayer(&mons[pm], (coordxy) x, (coordxy) y, special);
num--; num--;
} }
} }
+14 -14
View File
@@ -777,7 +777,7 @@ int
thrwmm(struct monst* mtmp, struct monst* mtarg) thrwmm(struct monst* mtmp, struct monst* mtarg)
{ {
struct obj *otmp, *mwep; struct obj *otmp, *mwep;
register xchar x, y; register coordxy x, y;
boolean ispole; boolean ispole;
/* Polearms won't be applied by monsters against other monsters */ /* Polearms won't be applied by monsters against other monsters */
@@ -833,8 +833,8 @@ spitmm(struct monst* mtmp, struct attack* mattk, struct monst* mtarg)
} }
if (m_lined_up(mtarg, mtmp)) { if (m_lined_up(mtarg, mtmp)) {
boolean utarg = (mtarg == &g.youmonst); boolean utarg = (mtarg == &g.youmonst);
xchar tx = utarg ? mtmp->mux : mtarg->mx; coordxy tx = utarg ? mtmp->mux : mtarg->mx;
xchar ty = utarg ? mtmp->muy : mtarg->my; coordxy ty = utarg ? mtmp->muy : mtarg->my;
switch (mattk->adtyp) { switch (mattk->adtyp) {
case AD_BLND: case AD_BLND:
@@ -972,7 +972,7 @@ void
thrwmu(struct monst* mtmp) thrwmu(struct monst* mtmp)
{ {
struct obj *otmp, *mwep; struct obj *otmp, *mwep;
xchar x, y; coordxy x, y;
const char *onm; const char *onm;
/* Rearranged beginning so monsters can use polearms not in a line */ /* Rearranged beginning so monsters can use polearms not in a line */
@@ -1072,10 +1072,10 @@ breamu(struct monst* mtmp, struct attack* mattk)
Returns TRUE if fnc returned TRUE. */ Returns TRUE if fnc returned TRUE. */
boolean boolean
linedup_callback( linedup_callback(
xchar ax, coordxy ax,
xchar ay, coordxy ay,
xchar bx, coordxy bx,
xchar by, coordxy by,
boolean (*fnc)(int, int)) boolean (*fnc)(int, int))
{ {
int dx, dy; int dx, dy;
@@ -1110,10 +1110,10 @@ linedup_callback(
boolean boolean
linedup( linedup(
register xchar ax, register coordxy ax,
register xchar ay, register coordxy ay,
register xchar bx, register coordxy bx,
register xchar by, register coordxy by,
int boulderhandling) /* 0=block, 1=ignore, 2=conditionally block */ int boulderhandling) /* 0=block, 1=ignore, 2=conditionally block */
{ {
int dx, dy, boulderspots; int dx, dy, boulderspots;
@@ -1159,8 +1159,8 @@ static int
m_lined_up(struct monst* mtarg, struct monst* mtmp) m_lined_up(struct monst* mtarg, struct monst* mtmp)
{ {
boolean utarget = (mtarg == &g.youmonst); boolean utarget = (mtarg == &g.youmonst);
xchar tx = utarget ? mtmp->mux : mtarg->mx; coordxy tx = utarget ? mtmp->mux : mtarg->mx;
xchar ty = utarget ? mtmp->muy : mtarg->my; coordxy ty = utarget ? mtmp->muy : mtarg->my;
boolean ignore_boulders = utarget && (throws_rocks(mtmp->data) boolean ignore_boulders = utarget && (throws_rocks(mtmp->data)
|| m_carrying(mtmp, WAN_STRIKING)); || m_carrying(mtmp, WAN_STRIKING));
+3 -3
View File
@@ -561,14 +561,14 @@ l_obj_bury(lua_State *L)
int argc = lua_gettop(L); int argc = lua_gettop(L);
boolean dealloced = FALSE; boolean dealloced = FALSE;
struct _lua_obj *lo = l_obj_check(L, 1); struct _lua_obj *lo = l_obj_check(L, 1);
xchar x = 0, y = 0; coordxy x = 0, y = 0;
if (argc == 1) { if (argc == 1) {
x = lo->obj->ox; x = lo->obj->ox;
y = lo->obj->oy; y = lo->obj->oy;
} else if (argc == 3) { } else if (argc == 3) {
x = (xchar) lua_tointeger(L, 2); x = (coordxy) lua_tointeger(L, 2);
y = (xchar) lua_tointeger(L, 3); y = (coordxy) lua_tointeger(L, 3);
} else } else
nhl_error(L, "l_obj_bury: Wrong args"); nhl_error(L, "l_obj_bury: Wrong args");
+57 -57
View File
@@ -14,7 +14,7 @@ static int l_selection_not(lua_State *);
static int l_selection_filter_percent(lua_State *); static int l_selection_filter_percent(lua_State *);
static int l_selection_rndcoord(lua_State *); static int l_selection_rndcoord(lua_State *);
static boolean params_sel_2coords(lua_State *, struct selectionvar **, static boolean params_sel_2coords(lua_State *, struct selectionvar **,
xchar *, xchar *, xchar *, xchar *); coordxy *, coordxy *, coordxy *, coordxy *);
static int l_selection_line(lua_State *); static int l_selection_line(lua_State *);
static int l_selection_randline(lua_State *); static int l_selection_randline(lua_State *);
static int l_selection_rect(lua_State *); static int l_selection_rect(lua_State *);
@@ -136,7 +136,7 @@ static int
l_selection_setpoint(lua_State *L) l_selection_setpoint(lua_State *L)
{ {
struct selectionvar *sel = (struct selectionvar *) 0; struct selectionvar *sel = (struct selectionvar *) 0;
xchar x = -1, y = -1; coordxy x = -1, y = -1;
int val = 1; int val = 1;
int argc = lua_gettop(L); int argc = lua_gettop(L);
long crd = 0L; long crd = 0L;
@@ -146,15 +146,15 @@ l_selection_setpoint(lua_State *L)
} else if (argc == 1) { } else if (argc == 1) {
sel = l_selection_check(L, 1); sel = l_selection_check(L, 1);
} else if (argc == 2) { } else if (argc == 2) {
x = (xchar) luaL_checkinteger(L, 1); x = (coordxy) luaL_checkinteger(L, 1);
y = (xchar) luaL_checkinteger(L, 2); y = (coordxy) luaL_checkinteger(L, 2);
lua_pop(L, 2); lua_pop(L, 2);
(void) l_selection_new(L); (void) l_selection_new(L);
sel = l_selection_check(L, 1); sel = l_selection_check(L, 1);
} else { } else {
sel = l_selection_check(L, 1); sel = l_selection_check(L, 1);
x = (xchar) luaL_checkinteger(L, 2); x = (coordxy) luaL_checkinteger(L, 2);
y = (xchar) luaL_checkinteger(L, 3); y = (coordxy) luaL_checkinteger(L, 3);
val = (int) luaL_optinteger(L, 4, 1); val = (int) luaL_optinteger(L, 4, 1);
} }
@@ -180,7 +180,7 @@ static int
l_selection_getpoint(lua_State *L) l_selection_getpoint(lua_State *L)
{ {
struct selectionvar *sel = l_selection_check(L, 1); struct selectionvar *sel = l_selection_check(L, 1);
xchar x, y; coordxy x, y;
int ix, iy; int ix, iy;
int val; int val;
long crd; long crd;
@@ -190,8 +190,8 @@ l_selection_getpoint(lua_State *L)
nhl_error(L, "l_selection_getpoint: Incorrect params"); nhl_error(L, "l_selection_getpoint: Incorrect params");
return 0; return 0;
} }
x = (xchar) ix; x = (coordxy) ix;
y = (xchar) iy; y = (coordxy) iy;
if (x == -1 && y == -1) if (x == -1 && y == -1)
crd = SP_COORD_PACK_RANDOM(0); crd = SP_COORD_PACK_RANDOM(0);
@@ -299,8 +299,8 @@ l_selection_sub(lua_State *L)
for (x = 0; x < selr->wid; x++) { for (x = 0; x < selr->wid; x++) {
for (y = 0; y < selr->hei; y++) { for (y = 0; y < selr->hei; y++) {
xchar a_pt = selection_getpoint(x, y, sela); coordxy a_pt = selection_getpoint(x, y, sela);
xchar b_pt = selection_getpoint(x, y, selb); coordxy b_pt = selection_getpoint(x, y, selb);
int val = (a_pt ^ b_pt) & a_pt; int val = (a_pt ^ b_pt) & a_pt;
selection_setpoint(x, y, selr, val); selection_setpoint(x, y, selr, val);
} }
@@ -335,7 +335,7 @@ l_selection_rndcoord(lua_State *L)
{ {
struct selectionvar *sel = l_selection_check(L, 1); struct selectionvar *sel = l_selection_check(L, 1);
int removeit = (int) luaL_optinteger(L, 2, 0); int removeit = (int) luaL_optinteger(L, 2, 0);
xchar x = -1, y = -1; coordxy x = -1, y = -1;
selection_rndcoord(sel, &x, &y, removeit); selection_rndcoord(sel, &x, &y, removeit);
if (!(x == -1 && y == -1)) { if (!(x == -1 && y == -1)) {
update_croom(); update_croom();
@@ -362,16 +362,16 @@ l_selection_rndcoord(lua_State *L)
/* selection:function(x1,y1, x2,y2) */ /* selection:function(x1,y1, x2,y2) */
static boolean static boolean
params_sel_2coords(lua_State *L, struct selectionvar **sel, params_sel_2coords(lua_State *L, struct selectionvar **sel,
xchar *x1, xchar *y1, xchar *x2, xchar *y2) coordxy *x1, coordxy *y1, coordxy *x2, coordxy *y2)
{ {
int argc = lua_gettop(L); int argc = lua_gettop(L);
if (argc == 4) { if (argc == 4) {
(void) l_selection_new(L); (void) l_selection_new(L);
*x1 = (xchar) luaL_checkinteger(L, 1); *x1 = (coordxy) luaL_checkinteger(L, 1);
*y1 = (xchar) luaL_checkinteger(L, 2); *y1 = (coordxy) luaL_checkinteger(L, 2);
*x2 = (xchar) luaL_checkinteger(L, 3); *x2 = (coordxy) luaL_checkinteger(L, 3);
*y2 = (xchar) luaL_checkinteger(L, 4); *y2 = (coordxy) luaL_checkinteger(L, 4);
*sel = l_selection_check(L, 5); *sel = l_selection_check(L, 5);
lua_remove(L, 1); lua_remove(L, 1);
lua_remove(L, 1); lua_remove(L, 1);
@@ -380,10 +380,10 @@ params_sel_2coords(lua_State *L, struct selectionvar **sel,
return TRUE; return TRUE;
} else if (argc == 5) { } else if (argc == 5) {
*sel = l_selection_check(L, 1); *sel = l_selection_check(L, 1);
*x1 = (xchar) luaL_checkinteger(L, 2); *x1 = (coordxy) luaL_checkinteger(L, 2);
*y1 = (xchar) luaL_checkinteger(L, 3); *y1 = (coordxy) luaL_checkinteger(L, 3);
*x2 = (xchar) luaL_checkinteger(L, 4); *x2 = (coordxy) luaL_checkinteger(L, 4);
*y2 = (xchar) luaL_checkinteger(L, 5); *y2 = (coordxy) luaL_checkinteger(L, 5);
lua_pop(L, 4); lua_pop(L, 4);
return TRUE; return TRUE;
} }
@@ -397,7 +397,7 @@ static int
l_selection_line(lua_State *L) l_selection_line(lua_State *L)
{ {
struct selectionvar *sel = NULL; struct selectionvar *sel = NULL;
xchar x1, y1, x2, y2; coordxy x1, y1, x2, y2;
if (!params_sel_2coords(L, &sel, &x1, &y1, &x2, &y2)) { if (!params_sel_2coords(L, &sel, &x1, &y1, &x2, &y2)) {
nhl_error(L, "selection.line: illegal arguments"); nhl_error(L, "selection.line: illegal arguments");
@@ -417,7 +417,7 @@ static int
l_selection_rect(lua_State *L) l_selection_rect(lua_State *L)
{ {
struct selectionvar *sel = NULL; struct selectionvar *sel = NULL;
xchar x1, y1, x2, y2; coordxy x1, y1, x2, y2;
if (!params_sel_2coords(L, &sel, &x1, &y1, &x2, &y2)) { if (!params_sel_2coords(L, &sel, &x1, &y1, &x2, &y2)) {
nhl_error(L, "selection.rect: illegal arguments"); nhl_error(L, "selection.rect: illegal arguments");
@@ -446,7 +446,7 @@ l_selection_fillrect(lua_State *L)
{ {
struct selectionvar *sel = NULL; struct selectionvar *sel = NULL;
int y; int y;
xchar x1, y1, x2, y2; coordxy x1, y1, x2, y2;
if (!params_sel_2coords(L, &sel, &x1, &y1, &x2, &y2)) { if (!params_sel_2coords(L, &sel, &x1, &y1, &x2, &y2)) {
nhl_error(L, "selection.fillrect: illegal arguments"); nhl_error(L, "selection.fillrect: illegal arguments");
@@ -478,22 +478,22 @@ l_selection_randline(lua_State *L)
{ {
int argc = lua_gettop(L); int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0; struct selectionvar *sel = (struct selectionvar *) 0;
xchar x1 = 0, y1 = 0, x2 = 0, y2 = 0; coordxy x1 = 0, y1 = 0, x2 = 0, y2 = 0;
int roughness = 7; int roughness = 7;
if (argc == 6) { if (argc == 6) {
sel = l_selection_check(L, 1); sel = l_selection_check(L, 1);
x1 = (xchar) luaL_checkinteger(L, 2); x1 = (coordxy) luaL_checkinteger(L, 2);
y1 = (xchar) luaL_checkinteger(L, 3); y1 = (coordxy) luaL_checkinteger(L, 3);
x2 = (xchar) luaL_checkinteger(L, 4); x2 = (coordxy) luaL_checkinteger(L, 4);
y2 = (xchar) luaL_checkinteger(L, 5); y2 = (coordxy) luaL_checkinteger(L, 5);
roughness = (int) luaL_checkinteger(L, 6); roughness = (int) luaL_checkinteger(L, 6);
lua_pop(L, 5); lua_pop(L, 5);
} else if (argc == 5 && lua_type(L, 1) == LUA_TNUMBER) { } else if (argc == 5 && lua_type(L, 1) == LUA_TNUMBER) {
x1 = (xchar) luaL_checkinteger(L, 1); x1 = (coordxy) luaL_checkinteger(L, 1);
y1 = (xchar) luaL_checkinteger(L, 2); y1 = (coordxy) luaL_checkinteger(L, 2);
x2 = (xchar) luaL_checkinteger(L, 3); x2 = (coordxy) luaL_checkinteger(L, 3);
y2 = (xchar) luaL_checkinteger(L, 4); y2 = (coordxy) luaL_checkinteger(L, 4);
roughness = (int) luaL_checkinteger(L, 5); roughness = (int) luaL_checkinteger(L, 5);
lua_pop(L, 5); lua_pop(L, 5);
(void) l_selection_new(L); (void) l_selection_new(L);
@@ -540,7 +540,7 @@ l_selection_filter_mapchar(lua_State *L)
int argc = lua_gettop(L); int argc = lua_gettop(L);
struct selectionvar *sel = l_selection_check(L, 1); struct selectionvar *sel = l_selection_check(L, 1);
char *mapchr = dupstr(luaL_checkstring(L, 2)); char *mapchr = dupstr(luaL_checkstring(L, 2));
xchar typ = check_mapchr(mapchr); coordxy typ = check_mapchr(mapchr);
int lit = (int) luaL_optinteger(L, 3, -2); /* TODO: special lit values */ int lit = (int) luaL_optinteger(L, 3, -2); /* TODO: special lit values */
struct selectionvar *tmp, *tmp2; struct selectionvar *tmp, *tmp2;
@@ -612,12 +612,12 @@ l_selection_flood(lua_State *L)
{ {
int argc = lua_gettop(L); int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0; struct selectionvar *sel = (struct selectionvar *) 0;
xchar x = 0, y = 0; coordxy x = 0, y = 0;
boolean diagonals = FALSE; boolean diagonals = FALSE;
if (argc == 2 || argc == 3) { if (argc == 2 || argc == 3) {
x = (xchar) luaL_checkinteger(L, 1); x = (coordxy) luaL_checkinteger(L, 1);
y = (xchar) luaL_checkinteger(L, 2); y = (coordxy) luaL_checkinteger(L, 2);
if (argc == 3) if (argc == 3)
diagonals = lua_toboolean(L, 3); diagonals = lua_toboolean(L, 3);
lua_pop(L, argc); lua_pop(L, argc);
@@ -648,20 +648,20 @@ l_selection_circle(lua_State *L)
{ {
int argc = lua_gettop(L); int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0; struct selectionvar *sel = (struct selectionvar *) 0;
xchar x = 0, y = 0; coordxy x = 0, y = 0;
int r = 0, filled = 0; int r = 0, filled = 0;
if (argc == 3) { if (argc == 3) {
x = (xchar) luaL_checkinteger(L, 1); x = (coordxy) luaL_checkinteger(L, 1);
y = (xchar) luaL_checkinteger(L, 2); y = (coordxy) luaL_checkinteger(L, 2);
r = (int) luaL_checkinteger(L, 3); r = (int) luaL_checkinteger(L, 3);
lua_pop(L, 3); lua_pop(L, 3);
(void) l_selection_new(L); (void) l_selection_new(L);
sel = l_selection_check(L, 1); sel = l_selection_check(L, 1);
filled = 0; filled = 0;
} else if (argc == 4 && lua_type(L, 1) == LUA_TNUMBER) { } else if (argc == 4 && lua_type(L, 1) == LUA_TNUMBER) {
x = (xchar) luaL_checkinteger(L, 1); x = (coordxy) luaL_checkinteger(L, 1);
y = (xchar) luaL_checkinteger(L, 2); y = (coordxy) luaL_checkinteger(L, 2);
r = (int) luaL_checkinteger(L, 3); r = (int) luaL_checkinteger(L, 3);
filled = (int) luaL_checkinteger(L, 4); /* TODO: boolean*/ filled = (int) luaL_checkinteger(L, 4); /* TODO: boolean*/
lua_pop(L, 4); lua_pop(L, 4);
@@ -669,8 +669,8 @@ l_selection_circle(lua_State *L)
sel = l_selection_check(L, 1); sel = l_selection_check(L, 1);
} else if (argc == 4 || argc == 5) { } else if (argc == 4 || argc == 5) {
sel = l_selection_check(L, 1); sel = l_selection_check(L, 1);
x = (xchar) luaL_checkinteger(L, 2); x = (coordxy) luaL_checkinteger(L, 2);
y = (xchar) luaL_checkinteger(L, 3); y = (coordxy) luaL_checkinteger(L, 3);
r = (int) luaL_checkinteger(L, 4); r = (int) luaL_checkinteger(L, 4);
filled = (int) luaL_optinteger(L, 5, 0); /* TODO: boolean */ filled = (int) luaL_optinteger(L, 5, 0); /* TODO: boolean */
} else { } else {
@@ -696,12 +696,12 @@ l_selection_ellipse(lua_State *L)
{ {
int argc = lua_gettop(L); int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0; struct selectionvar *sel = (struct selectionvar *) 0;
xchar x = 0, y = 0; coordxy x = 0, y = 0;
int r1 = 0, r2 = 0, filled = 0; int r1 = 0, r2 = 0, filled = 0;
if (argc == 4) { if (argc == 4) {
x = (xchar) luaL_checkinteger(L, 1); x = (coordxy) luaL_checkinteger(L, 1);
y = (xchar) luaL_checkinteger(L, 2); y = (coordxy) luaL_checkinteger(L, 2);
r1 = (int) luaL_checkinteger(L, 3); r1 = (int) luaL_checkinteger(L, 3);
r2 = (int) luaL_checkinteger(L, 4); r2 = (int) luaL_checkinteger(L, 4);
lua_pop(L, 4); lua_pop(L, 4);
@@ -709,8 +709,8 @@ l_selection_ellipse(lua_State *L)
sel = l_selection_check(L, 1); sel = l_selection_check(L, 1);
filled = 0; filled = 0;
} else if (argc == 5 && lua_type(L, 1) == LUA_TNUMBER) { } else if (argc == 5 && lua_type(L, 1) == LUA_TNUMBER) {
x = (xchar) luaL_checkinteger(L, 1); x = (coordxy) luaL_checkinteger(L, 1);
y = (xchar) luaL_checkinteger(L, 2); y = (coordxy) luaL_checkinteger(L, 2);
r1 = (int) luaL_checkinteger(L, 3); r1 = (int) luaL_checkinteger(L, 3);
r2 = (int) luaL_checkinteger(L, 4); r2 = (int) luaL_checkinteger(L, 4);
filled = (int) luaL_optinteger(L, 5, 0); /* TODO: boolean */ filled = (int) luaL_optinteger(L, 5, 0); /* TODO: boolean */
@@ -719,8 +719,8 @@ l_selection_ellipse(lua_State *L)
sel = l_selection_check(L, 1); sel = l_selection_check(L, 1);
} else if (argc == 5 || argc == 6) { } else if (argc == 5 || argc == 6) {
sel = l_selection_check(L, 1); sel = l_selection_check(L, 1);
x = (xchar) luaL_checkinteger(L, 2); x = (coordxy) luaL_checkinteger(L, 2);
y = (xchar) luaL_checkinteger(L, 3); y = (coordxy) luaL_checkinteger(L, 3);
r1 = (int) luaL_checkinteger(L, 4); r1 = (int) luaL_checkinteger(L, 4);
r2 = (int) luaL_checkinteger(L, 5); r2 = (int) luaL_checkinteger(L, 5);
filled = (int) luaL_optinteger(L, 6, 0); /* TODO: boolean */ filled = (int) luaL_optinteger(L, 6, 0); /* TODO: boolean */
@@ -750,11 +750,11 @@ l_selection_gradient(lua_State *L)
struct selectionvar *sel = (struct selectionvar *) 0; struct selectionvar *sel = (struct selectionvar *) 0;
/* if x2 and y2 aren't set, the gradient has a single center point of x,y; /* if x2 and y2 aren't set, the gradient has a single center point of x,y;
* if they are set, the gradient is centered on a (x,y) to (x2,y2) line */ * if they are set, the gradient is centered on a (x,y) to (x2,y2) line */
xchar x = 0, y = 0, x2 = -1, y2 = -1; coordxy x = 0, y = 0, x2 = -1, y2 = -1;
/* points will not be added within mindist of the center; the chance for a /* points will not be added within mindist of the center; the chance for a
* point between mindist and maxdist to be added to the selection starts at * point between mindist and maxdist to be added to the selection starts at
* 0% at mindist and increases linearly to 100% at maxdist */ * 0% at mindist and increases linearly to 100% at maxdist */
xchar mindist = 0, maxdist = 0; coordxy mindist = 0, maxdist = 0;
/* if limited is true, no points farther than maxdist will be added; if /* if limited is true, no points farther than maxdist will be added; if
* false, all points farther than maxdist will be added */ * false, all points farther than maxdist will be added */
boolean limited = FALSE; boolean limited = FALSE;
@@ -769,10 +769,10 @@ l_selection_gradient(lua_State *L)
if (argc == 1 && lua_type(L, 1) == LUA_TTABLE) { if (argc == 1 && lua_type(L, 1) == LUA_TTABLE) {
lcheck_param_table(L); lcheck_param_table(L);
type = gradtypes2i[get_table_option(L, "type", "radial", gradtypes)]; type = gradtypes2i[get_table_option(L, "type", "radial", gradtypes)];
x = (xchar) get_table_int(L, "x"); x = (coordxy) get_table_int(L, "x");
y = (xchar) get_table_int(L, "y"); y = (coordxy) get_table_int(L, "y");
x2 = (xchar) get_table_int_opt(L, "x2", -1); x2 = (coordxy) get_table_int_opt(L, "x2", -1);
y2 = (xchar) get_table_int_opt(L, "y2", -1); y2 = (coordxy) get_table_int_opt(L, "y2", -1);
/* maxdist is required because there's no obvious default value for it, /* maxdist is required because there's no obvious default value for it,
* whereas mindist has an obvious defalt of 0 */ * whereas mindist has an obvious defalt of 0 */
maxdist = get_table_int(L, "maxdist"); maxdist = get_table_int(L, "maxdist");
+7 -7
View File
@@ -213,7 +213,7 @@ schar
get_table_mapchr(lua_State *L, const char *name) get_table_mapchr(lua_State *L, const char *name)
{ {
char *ter; char *ter;
xchar typ; xint8 typ;
ter = get_table_str(L, name); ter = get_table_str(L, name);
typ = check_mapchr(ter); typ = check_mapchr(ter);
@@ -228,15 +228,15 @@ schar
get_table_mapchr_opt(lua_State *L, const char *name, schar defval) get_table_mapchr_opt(lua_State *L, const char *name, schar defval)
{ {
char *ter; char *ter;
xchar typ; xint8 typ;
ter = get_table_str_opt(L, name, emptystr); ter = get_table_str_opt(L, name, emptystr);
if (name && *ter) { if (name && *ter) {
typ = check_mapchr(ter); typ = (xint8) check_mapchr(ter);
if (typ == INVALID_TYPE) if (typ == INVALID_TYPE)
nhl_error(L, "Erroneous map char"); nhl_error(L, "Erroneous map char");
} else } else
typ = defval; typ = (xint8) defval;
if (ter) if (ter)
free(ter); free(ter);
return typ; return typ;
@@ -292,7 +292,7 @@ nhl_add_table_entry_bool(lua_State *L, const char *name, boolean value)
void void
nhl_add_table_entry_region(lua_State *L, const char *name, nhl_add_table_entry_region(lua_State *L, const char *name,
xchar x1, xchar y1, xchar x2, xchar y2) coordxy x1, coordxy y1, coordxy x2, coordxy y2)
{ {
lua_pushstring(L, name); lua_pushstring(L, name);
lua_newtable(L); lua_newtable(L);
@@ -1345,8 +1345,8 @@ nhl_meta_u_index(lua_State *L)
{ "mh", &(u.mh), ANY_INT }, { "mh", &(u.mh), ANY_INT },
{ "mhmax", &(u.mhmax), ANY_INT }, { "mhmax", &(u.mhmax), ANY_INT },
{ "mtimedone", &(u.mtimedone), ANY_INT }, { "mtimedone", &(u.mtimedone), ANY_INT },
{ "dlevel", &(u.uz.dlevel), ANY_SCHAR }, /* actually xchar */ { "dlevel", &(u.uz.dlevel), ANY_SCHAR }, /* actually coordxy */
{ "dnum", &(u.uz.dnum), ANY_SCHAR }, /* actually xchar */ { "dnum", &(u.uz.dnum), ANY_SCHAR }, /* actually coordxy */
{ "uluck", &(u.uluck), ANY_SCHAR }, { "uluck", &(u.uluck), ANY_SCHAR },
{ "uhp", &(u.uhp), ANY_INT }, { "uhp", &(u.uhp), ANY_INT },
{ "uhpmax", &(u.uhpmax), ANY_INT }, { "uhpmax", &(u.uhpmax), ANY_INT },
+1 -1
View File
@@ -301,7 +301,7 @@ distant_name(
char *(*func)(OBJ_P)) /* formatting routine (usually xname or doname) */ char *(*func)(OBJ_P)) /* formatting routine (usually xname or doname) */
{ {
char *str; char *str;
xchar ox = 0, oy = 0; coordxy ox = 0, oy = 0;
/* /*
* (r * r): square of the x or y distance; * (r * r): square of the x or y distance;
* (r * r) * 2: sum of squares of both x and y distances * (r * r) * 2: sum of squares of both x and y distances
+1 -1
View File
@@ -6852,7 +6852,7 @@ query_attr(const char *prompt)
static const struct { static const struct {
const char *name; const char *name;
xchar msgtyp; xint8 msgtyp;
const char *descr; const char *descr;
} msgtype_names[] = { } msgtype_names[] = {
{ "show", MSGTYP_NORMAL, "Show message normally" }, { "show", MSGTYP_NORMAL, "Show message normally" },
+1 -1
View File
@@ -466,7 +466,7 @@ look_at_monster(char *buf,
caller should use it or copy it before calling waterbody_name() again caller should use it or copy it before calling waterbody_name() again
[3.7: moved here from mkmaze.c] */ [3.7: moved here from mkmaze.c] */
const char * const char *
waterbody_name(xchar x, xchar y) waterbody_name(coordxy x, coordxy y)
{ {
static char pooltype[40]; static char pooltype[40];
struct rm *lev; struct rm *lev;
+4 -4
View File
@@ -1910,7 +1910,7 @@ do_loot_cont(
if (flags.autounlock) { if (flags.autounlock) {
struct obj *otmp, *unlocktool = 0; struct obj *otmp, *unlocktool = 0;
xchar ox = cobj->ox, oy = cobj->oy; coordxy ox = cobj->ox, oy = cobj->oy;
u.dz = 0; /* might be non-zero from previous command since u.dz = 0; /* might be non-zero from previous command since
* #loot isn't a move command; pick_lock() cares */ * #loot isn't a move command; pick_lock() cares */
@@ -2622,7 +2622,7 @@ observe_quantum_cat(struct obj *box, boolean makecat, boolean givemsg)
static NEARDATA const char sc[] = "Schroedinger's Cat"; static NEARDATA const char sc[] = "Schroedinger's Cat";
struct obj *deadcat; struct obj *deadcat;
struct monst *livecat = 0; struct monst *livecat = 0;
xchar ox, oy; coordxy ox, oy;
boolean itsalive = !rn2(2); boolean itsalive = !rn2(2);
if (get_obj_location(box, &ox, &oy, 0)) if (get_obj_location(box, &ox, &oy, 0))
@@ -3431,7 +3431,7 @@ enum tipping_check_values {
static void static void
tipcontainer(struct obj *box) /* or bag */ tipcontainer(struct obj *box) /* or bag */
{ {
xchar ox = u.ux, oy = u.uy; /* #tip only works at hero's location */ coordxy ox = u.ux, oy = u.uy; /* #tip only works at hero's location */
boolean empty_it = TRUE, maybeshopgoods; boolean empty_it = TRUE, maybeshopgoods;
struct obj *targetbox = (struct obj *) 0; struct obj *targetbox = (struct obj *) 0;
boolean cancelled = FALSE; boolean cancelled = FALSE;
@@ -3655,7 +3655,7 @@ tipcontainer_checks(struct obj *box, boolean allowempty)
boolean bag = box->otyp == BAG_OF_TRICKS; boolean bag = box->otyp == BAG_OF_TRICKS;
int old_spe = box->spe, seen = 0; int old_spe = box->spe, seen = 0;
boolean maybeshopgoods = !carried(box) && costly_spot(box->ox, box->oy); boolean maybeshopgoods = !carried(box) && costly_spot(box->ox, box->oy);
xchar ox = u.ux, oy = u.uy; coordxy ox = u.ux, oy = u.uy;
if (get_obj_location(box, &ox, &oy, 0)) if (get_obj_location(box, &ox, &oy, 0))
box->ox = ox, box->oy = oy; box->ox = ox, box->oy = oy;
+1 -1
View File
@@ -2268,7 +2268,7 @@ a_gname(void)
/* returns the name of an altar's deity */ /* returns the name of an altar's deity */
const char * const char *
a_gname_at(xchar x, xchar y) a_gname_at(coordxy x, coordxy y)
{ {
if (!IS_ALTAR(levl[x][y].typ)) if (!IS_ALTAR(levl[x][y].typ))
return (char *) 0; return (char *) 0;
+7 -7
View File
@@ -9,7 +9,7 @@
#define ALGN_SINNED (-4) /* worse than strayed (-1..-3) */ #define ALGN_SINNED (-4) /* worse than strayed (-1..-3) */
#define ALGN_PIOUS 14 /* better than fervent (9..13) */ #define ALGN_PIOUS 14 /* better than fervent (9..13) */
static boolean histemple_at(struct monst *, xchar, xchar); static boolean histemple_at(struct monst *, coordxy, coordxy);
static boolean has_shrine(struct monst *); static boolean has_shrine(struct monst *);
void void
@@ -40,9 +40,9 @@ free_epri(struct monst *mtmp)
int int
move_special(struct monst *mtmp, boolean in_his_shop, schar appr, move_special(struct monst *mtmp, boolean in_his_shop, schar appr,
boolean uondoor, boolean avoid, boolean uondoor, boolean avoid,
xchar omx, xchar omy, xchar gx, xchar gy) coordxy omx, coordxy omy, coordxy gx, coordxy gy)
{ {
register xchar nx, ny, nix, niy; register coordxy nx, ny, nix, niy;
register schar i; register schar i;
schar chcnt, cnt; schar chcnt, cnt;
coord poss[9]; coord poss[9];
@@ -146,7 +146,7 @@ temple_occupied(char *array)
} }
static boolean static boolean
histemple_at(struct monst *priest, xchar x, xchar y) histemple_at(struct monst *priest, coordxy x, coordxy y)
{ {
return (boolean) (priest && priest->ispriest return (boolean) (priest && priest->ispriest
&& (EPRI(priest)->shroom == *in_rooms(x, y, TEMPLE)) && (EPRI(priest)->shroom == *in_rooms(x, y, TEMPLE))
@@ -172,7 +172,7 @@ inhistemple(struct monst *priest)
int int
pri_move(struct monst *priest) pri_move(struct monst *priest)
{ {
register xchar gx, gy, omx, omy; register coordxy gx, gy, omx, omy;
schar temple; schar temple;
boolean avoid = TRUE; boolean avoid = TRUE;
@@ -670,7 +670,7 @@ priest_talk(struct monst *priest)
} }
struct monst * struct monst *
mk_roamer(struct permonst *ptr, aligntyp alignment, xchar x, xchar y, mk_roamer(struct permonst *ptr, aligntyp alignment, coordxy x, coordxy y,
boolean peaceful) boolean peaceful)
{ {
register struct monst *roamer; register struct monst *roamer;
@@ -719,7 +719,7 @@ reset_hostility(struct monst *roamer)
boolean boolean
in_your_sanctuary( in_your_sanctuary(
struct monst *mon, /* if non-null, <mx,my> overrides <x,y> */ struct monst *mon, /* if non-null, <mx,my> overrides <x,y> */
xchar x, xchar y) coordxy x, coordxy y)
{ {
register char roomno; register char roomno;
register struct monst *priest; register struct monst *priest;
+13 -13
View File
@@ -31,10 +31,10 @@ void remove_region(NhRegion *);
#if 0 #if 0
void replace_mon_regions(struct monst *,struct monst *); void replace_mon_regions(struct monst *,struct monst *);
void remove_mon_from_regions(struct monst *); void remove_mon_from_regions(struct monst *);
NhRegion *create_msg_region(xchar,xchar,xchar,xchar, const char *, NhRegion *create_msg_region(coordxy,coordxy,coordxy,coordxy, const char *,
const char *); const char *);
boolean enter_force_field(genericptr,genericptr); boolean enter_force_field(genericptr,genericptr);
NhRegion *create_force_field(xchar,xchar,int,long); NhRegion *create_force_field(coordxy,coordxy,int,long);
#endif #endif
static void reset_region_mids(NhRegion *); static void reset_region_mids(NhRegion *);
@@ -427,7 +427,7 @@ run_regions(void)
* check whether player enters/leaves one or more regions. * check whether player enters/leaves one or more regions.
*/ */
boolean boolean
in_out_region(xchar x, xchar y) in_out_region(coordxy x, coordxy y)
{ {
int i, f_indx = 0; int i, f_indx = 0;
@@ -480,7 +480,7 @@ in_out_region(xchar x, xchar y)
* check whether a monster enters/leaves one or more regions. * check whether a monster enters/leaves one or more regions.
*/ */
boolean boolean
m_in_out_region(struct monst *mon, xchar x, xchar y) m_in_out_region(struct monst *mon, coordxy x, coordxy y)
{ {
int i, f_indx = 0; int i, f_indx = 0;
@@ -601,7 +601,7 @@ remove_mon_from_regions(struct monst *mon)
* Returns NULL if not, otherwise returns region. * Returns NULL if not, otherwise returns region.
*/ */
NhRegion * NhRegion *
visible_region_at(xchar x, xchar y) visible_region_at(coordxy x, coordxy y)
{ {
register int i; register int i;
@@ -615,7 +615,7 @@ visible_region_at(xchar x, xchar y)
} }
void void
show_region(NhRegion *reg, xchar x, xchar y) show_region(NhRegion *reg, coordxy x, coordxy y)
{ {
show_glyph(x, y, reg->glyph); show_glyph(x, y, reg->glyph);
} }
@@ -872,7 +872,7 @@ reset_region_mids(NhRegion *reg)
NhRegion * NhRegion *
create_msg_region( create_msg_region(
xchar x, xchar y, xchar w, xchar h, coordxy x, coordxy y, coordxy w, coordxy h,
const char *msg_enter, const char *msg_leave) const char *msg_enter, const char *msg_leave)
{ {
NhRect tmprect; NhRect tmprect;
@@ -919,7 +919,7 @@ enter_force_field(genericptr_t p1, genericptr_t p2)
} }
NhRegion * NhRegion *
create_force_field(xchar x, xchar y, int radius, long ttl) create_force_field(coordxy x, coordxy y, int radius, long ttl)
{ {
int i; int i;
NhRegion *ff; NhRegion *ff;
@@ -966,7 +966,7 @@ expire_gas_cloud(genericptr_t p1, genericptr_t p2 UNUSED)
{ {
NhRegion *reg; NhRegion *reg;
int damage; int damage;
xchar x, y; coordxy x, y;
reg = (NhRegion *) p1; reg = (NhRegion *) p1;
damage = reg->arg.a_int; damage = reg->arg.a_int;
@@ -1080,15 +1080,15 @@ is_hero_inside_gas_cloud(void)
* damage is how much it deals to afflicted creatures. */ * damage is how much it deals to afflicted creatures. */
#define MAX_CLOUD_SIZE 150 #define MAX_CLOUD_SIZE 150
NhRegion * NhRegion *
create_gas_cloud(xchar x, xchar y, int cloudsize, int damage) create_gas_cloud(coordxy x, coordxy y, int cloudsize, int damage)
{ {
NhRegion *cloud; NhRegion *cloud;
int i, j; int i, j;
NhRect tmprect; NhRect tmprect;
/* store visited coords */ /* store visited coords */
xchar xcoords[MAX_CLOUD_SIZE]; coordxy xcoords[MAX_CLOUD_SIZE];
xchar ycoords[MAX_CLOUD_SIZE]; coordxy ycoords[MAX_CLOUD_SIZE];
xcoords[0] = x; xcoords[0] = x;
ycoords[0] = y; ycoords[0] = y;
int curridx; int curridx;
@@ -1112,7 +1112,7 @@ create_gas_cloud(xchar x, xchar y, int cloudsize, int damage)
* directions chosen. */ * directions chosen. */
coord dirs[4] = { {0, -1}, {0, 1}, {-1, 0}, {1, 0} }; coord dirs[4] = { {0, -1}, {0, 1}, {-1, 0}, {1, 0} };
for (i = 4; i > 0; --i) { for (i = 4; i > 0; --i) {
xchar swapidx = rn2(i); coordxy swapidx = rn2(i);
coord tmp = dirs[swapidx]; coord tmp = dirs[swapidx];
dirs[swapidx] = dirs[i-1]; dirs[swapidx] = dirs[i-1];
dirs[i-1] = tmp; dirs[i-1] = tmp;
+8 -8
View File
@@ -29,7 +29,7 @@ static void freefruitchn(struct fruit *);
static void ghostfruit(struct obj *); static void ghostfruit(struct obj *);
static boolean restgamestate(NHFILE *, unsigned int *, unsigned int *); static boolean restgamestate(NHFILE *, unsigned int *, unsigned int *);
static void restlevelstate(unsigned int, unsigned int); static void restlevelstate(unsigned int, unsigned int);
static int restlevelfile(xchar); static int restlevelfile(xint8);
static void rest_bubbles(NHFILE *); static void rest_bubbles(NHFILE *);
static void restore_gamelog(NHFILE *); static void restore_gamelog(NHFILE *);
static void restore_msghistory(NHFILE *); static void restore_msghistory(NHFILE *);
@@ -723,7 +723,7 @@ restlevelstate(unsigned int stuckid, unsigned int steedid)
/*ARGSUSED*/ /*ARGSUSED*/
static int static int
restlevelfile(xchar ltmp) restlevelfile(xint8 ltmp)
{ {
char whynot[BUFSZ]; char whynot[BUFSZ];
NHFILE *nhfp = (NHFILE *) 0; NHFILE *nhfp = (NHFILE *) 0;
@@ -745,14 +745,14 @@ int
dorecover(NHFILE* nhfp) dorecover(NHFILE* nhfp)
{ {
unsigned int stuckid = 0, steedid = 0; /* not a register */ unsigned int stuckid = 0, steedid = 0; /* not a register */
xchar ltmp = 0; xint8 ltmp = 0;
int rtmp; int rtmp;
/* suppress map display if some part of the code tries to update that */ /* suppress map display if some part of the code tries to update that */
g.program_state.restoring = 1; g.program_state.restoring = 1;
get_plname_from_file(nhfp, g.plname); get_plname_from_file(nhfp, g.plname);
getlev(nhfp, 0, (xchar) 0); getlev(nhfp, 0, (xint8) 0);
if (!restgamestate(nhfp, &stuckid, &steedid)) { if (!restgamestate(nhfp, &stuckid, &steedid)) {
NHFILE tnhfp; NHFILE tnhfp;
@@ -835,7 +835,7 @@ dorecover(NHFILE* nhfp)
(void) validate(nhfp, (char *) 0); (void) validate(nhfp, (char *) 0);
get_plname_from_file(nhfp, g.plname); get_plname_from_file(nhfp, g.plname);
getlev(nhfp, 0, (xchar) 0); getlev(nhfp, 0, (xint8) 0);
close_nhfile(nhfp); close_nhfile(nhfp);
restlevelstate(stuckid, steedid); restlevelstate(stuckid, steedid);
g.program_state.something_worth_saving = 1; /* useful data now exists */ g.program_state.something_worth_saving = 1; /* useful data now exists */
@@ -999,14 +999,14 @@ trickery(char *reason)
} }
void void
getlev(NHFILE* nhfp, int pid, xchar lev) getlev(NHFILE* nhfp, int pid, xint8 lev)
{ {
register struct trap *trap; register struct trap *trap;
register struct monst *mtmp; register struct monst *mtmp;
long elapsed; long elapsed;
branch *br; branch *br;
int hpid = 0; int hpid = 0;
xchar dlvl = 0; xint8 dlvl = 0;
int x, y; int x, y;
boolean ghostly = (nhfp->ftype == NHF_BONESFILE); boolean ghostly = (nhfp->ftype == NHF_BONESFILE);
#ifdef TOS #ifdef TOS
@@ -1233,7 +1233,7 @@ get_plname_from_file(NHFILE* nhfp, char *plbuf)
static void static void
rest_bubbles(NHFILE *nhfp) rest_bubbles(NHFILE *nhfp)
{ {
xchar bbubbly; xint8 bbubbly;
/* whether or not the Plane of Water's air bubbles or Plane of Air's /* whether or not the Plane of Water's air bubbles or Plane of Air's
clouds are present is recorded during save so that we don't have to clouds are present is recorded during save so that we don't have to
+8 -8
View File
@@ -19,7 +19,7 @@ int dotcnt, dotrow; /* also used in restore */
static void savelevchn(NHFILE *); static void savelevchn(NHFILE *);
static void savelevl(NHFILE *,boolean); static void savelevl(NHFILE *,boolean);
static void savedamage(NHFILE *); static void savedamage(NHFILE *);
static void save_bubbles(NHFILE *, xchar); static void save_bubbles(NHFILE *, xint8);
static void save_stairs(NHFILE *); static void save_stairs(NHFILE *);
static void save_bc(NHFILE *); static void save_bc(NHFILE *);
static void saveobj(NHFILE *,struct obj *); static void saveobj(NHFILE *,struct obj *);
@@ -29,7 +29,7 @@ static void savemonchn(NHFILE *,struct monst *);
static void savetrapchn(NHFILE *,struct trap *); static void savetrapchn(NHFILE *,struct trap *);
static void save_gamelog(NHFILE *); static void save_gamelog(NHFILE *);
static void savegamestate(NHFILE *); static void savegamestate(NHFILE *);
static void savelev_core(NHFILE *, xchar); static void savelev_core(NHFILE *, xint8);
static void save_msghistory(NHFILE *); static void save_msghistory(NHFILE *);
#ifdef ZEROCOMP #ifdef ZEROCOMP
@@ -78,7 +78,7 @@ int
dosave0(void) dosave0(void)
{ {
const char *fq_save; const char *fq_save;
xchar ltmp; xint8 ltmp;
char whynot[BUFSZ]; char whynot[BUFSZ];
NHFILE *nhfp, *onhfp; NHFILE *nhfp, *onhfp;
int res = 0; int res = 0;
@@ -186,7 +186,7 @@ dosave0(void)
set_ustuck((struct monst *) 0); set_ustuck((struct monst *) 0);
u.usteed = (struct monst *) 0; u.usteed = (struct monst *) 0;
for (ltmp = (xchar) 1; ltmp <= maxledgerno(); ltmp++) { for (ltmp = (xint8) 1; ltmp <= maxledgerno(); ltmp++) {
if (ltmp == ledger_no(&g.uz_save)) if (ltmp == ledger_no(&g.uz_save))
continue; continue;
if (!(g.level_info[ltmp].flags & LFILE_EXISTS)) if (!(g.level_info[ltmp].flags & LFILE_EXISTS))
@@ -447,7 +447,7 @@ savestateinlock(void)
#endif #endif
void void
savelev(NHFILE *nhfp, xchar lev) savelev(NHFILE *nhfp, xint8 lev)
{ {
boolean set_uz_save = (g.uz_save.dnum == 0 && g.uz_save.dlevel == 0); boolean set_uz_save = (g.uz_save.dnum == 0 && g.uz_save.dlevel == 0);
@@ -470,7 +470,7 @@ savelev(NHFILE *nhfp, xchar lev)
} }
static void static void
savelev_core(NHFILE *nhfp, xchar lev) savelev_core(NHFILE *nhfp, xint8 lev)
{ {
#ifdef TOS #ifdef TOS
short tlev; short tlev;
@@ -636,9 +636,9 @@ savelevl(NHFILE* nhfp, boolean rlecomp)
/* save Plane of Water's air bubbles and Plane of Air's clouds */ /* save Plane of Water's air bubbles and Plane of Air's clouds */
static void static void
save_bubbles(NHFILE *nhfp, xchar lev) save_bubbles(NHFILE *nhfp, xint8 lev)
{ {
xchar bbubbly; xint8 bbubbly;
/* air bubbles and clouds used to be saved as part of game state /* air bubbles and clouds used to be saved as part of game state
because restoring them needs dungeon data that isn't available because restoring them needs dungeon data that isn't available
+38 -38
View File
@@ -63,9 +63,9 @@ static struct damage *find_damage(struct monst *);
static void discard_damage_struct(struct damage *); static void discard_damage_struct(struct damage *);
static void discard_damage_owned_by(struct monst *); static void discard_damage_owned_by(struct monst *);
static void shk_fixes_damage(struct monst *); static void shk_fixes_damage(struct monst *);
static xchar *litter_getpos(int *, xchar, xchar, struct monst *); static coordxy *litter_getpos(int *, coordxy, coordxy, struct monst *);
static void litter_scatter(xchar *, int, xchar, xchar, struct monst *); static void litter_scatter(coordxy *, int, coordxy, coordxy, struct monst *);
static void litter_newsyms(xchar *, xchar, xchar); static void litter_newsyms(coordxy *, coordxy, coordxy);
static int repair_damage(struct monst *, struct damage *, boolean); static int repair_damage(struct monst *, struct damage *, boolean);
static void sub_one_frombill(struct obj *, struct monst *); static void sub_one_frombill(struct obj *, struct monst *);
static void add_one_tobill(struct obj *, boolean, struct monst *); static void add_one_tobill(struct obj *, boolean, struct monst *);
@@ -344,7 +344,7 @@ call_kops(register struct monst* shkp, register boolean nearshop)
{ {
coord mm; coord mm;
xchar sx = 0, sy = 0; coordxy sx = 0, sy = 0;
choose_stairs(&sx, &sy, TRUE); choose_stairs(&sx, &sy, TRUE);
@@ -374,7 +374,7 @@ call_kops(register struct monst* shkp, register boolean nearshop)
/* x,y is strictly inside shop */ /* x,y is strictly inside shop */
char char
inside_shop(register xchar x, register xchar y) inside_shop(register coordxy x, register coordxy y)
{ {
register char rno; register char rno;
@@ -468,7 +468,7 @@ credit_report(struct monst *shkp, int idx, boolean silent)
/* robbery from outside the shop via telekinesis or grappling hook */ /* robbery from outside the shop via telekinesis or grappling hook */
void void
remote_burglary(xchar x, xchar y) remote_burglary(coordxy x, coordxy y)
{ {
struct monst *shkp; struct monst *shkp;
struct eshk *eshkp; struct eshk *eshkp;
@@ -1045,7 +1045,7 @@ pay(long tmp, register struct monst* shkp)
static void static void
home_shk(struct monst *shkp, boolean killkops) home_shk(struct monst *shkp, boolean killkops)
{ {
xchar x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y; coordxy x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y;
(void) mnearto(shkp, x, y, TRUE, RLOC_NOMSG); (void) mnearto(shkp, x, y, TRUE, RLOC_NOMSG);
g.level.flags.has_shop = 1; g.level.flags.has_shop = 1;
@@ -1189,7 +1189,7 @@ hot_pursuit(register struct monst* shkp)
the shop. These conditions must be checked by the calling function. */ the shop. These conditions must be checked by the calling function. */
/*ARGSUSED*/ /*ARGSUSED*/
void void
make_angry_shk(struct monst* shkp, xchar ox UNUSED, xchar oy UNUSED) make_angry_shk(struct monst* shkp, coordxy ox UNUSED, coordxy oy UNUSED)
/* <ox,oy> predate 'noit_Monnam()', let alone Shknam() */ /* <ox,oy> predate 'noit_Monnam()', let alone Shknam() */
{ {
struct eshk *eshkp = ESHK(shkp); struct eshk *eshkp = ESHK(shkp);
@@ -1884,7 +1884,7 @@ inherits(struct monst* shkp, int numsk, int croaked, boolean silently)
static void static void
set_repo_loc(struct monst* shkp) set_repo_loc(struct monst* shkp)
{ {
register xchar ox, oy; register coordxy ox, oy;
struct eshk *eshkp = ESHK(shkp); struct eshk *eshkp = ESHK(shkp);
/* if you're not in this shk's shop room, or if you're in its doorway /* if you're not in this shk's shop room, or if you're in its doorway
@@ -1992,7 +1992,7 @@ get_cost_of_shop_item(
{ {
struct monst *shkp; struct monst *shkp;
struct obj *top; struct obj *top;
xchar x, y; coordxy x, y;
boolean freespot; boolean freespot;
long cost = 0L; long cost = 0L;
@@ -2172,7 +2172,7 @@ contained_cost(
boolean unpaid_only) boolean unpaid_only)
{ {
register struct obj *otmp, *top; register struct obj *otmp, *top;
xchar x, y; coordxy x, y;
boolean on_floor, freespot; boolean on_floor, freespot;
for (top = obj; top->where == OBJ_CONTAINED; top = top->ocontainer) for (top = obj; top->where == OBJ_CONTAINED; top = top->ocontainer)
@@ -2433,7 +2433,7 @@ unpaid_cost(
long amt = 0L; long amt = 0L;
#if 0 /* if two shops share a wall, this might find wrong shk */ #if 0 /* if two shops share a wall, this might find wrong shk */
xchar ox, oy; coordxy ox, oy;
if (!get_obj_location(unp_obj, &ox, &oy, BURIED_TOO | CONTAINED_TOO)) if (!get_obj_location(unp_obj, &ox, &oy, BURIED_TOO | CONTAINED_TOO))
ox = u.ux, oy = u.uy; /* (shouldn't happen) */ ox = u.ux, oy = u.uy; /* (shouldn't happen) */
@@ -2903,8 +2903,8 @@ stolen_container(
long long
stolen_value( stolen_value(
struct obj *obj, struct obj *obj,
xchar x, coordxy x,
xchar y, coordxy y,
boolean peaceful, boolean peaceful,
boolean silent) boolean silent)
{ {
@@ -3066,7 +3066,7 @@ sellobj_state(int deliberate)
} }
void void
sellobj(register struct obj* obj, xchar x, xchar y) sellobj(register struct obj* obj, coordxy x, coordxy y)
{ {
register struct monst *shkp; register struct monst *shkp;
register struct eshk *eshkp; register struct eshk *eshkp;
@@ -3446,7 +3446,7 @@ getprice(register struct obj* obj, boolean shk_buying)
/* shk catches thrown pick-axe */ /* shk catches thrown pick-axe */
struct monst * struct monst *
shkcatch(register struct obj* obj, register xchar x, register xchar y) shkcatch(register struct obj* obj, register coordxy x, register coordxy y)
{ {
register struct monst *shkp; register struct monst *shkp;
@@ -3479,8 +3479,8 @@ shkcatch(register struct obj* obj, register xchar x, register xchar y)
void void
add_damage( add_damage(
register xchar x, register coordxy x,
register xchar y, register coordxy y,
long cost) long cost)
{ {
struct damage *tmp_dam; struct damage *tmp_dam;
@@ -3533,7 +3533,7 @@ shk_impaired(struct monst *shkp)
static boolean static boolean
repairable_damage(struct damage *dam, struct monst *shkp) repairable_damage(struct damage *dam, struct monst *shkp)
{ {
xchar x, y; coordxy x, y;
struct trap* ttmp; struct trap* ttmp;
struct monst *mtmp; struct monst *mtmp;
@@ -3614,7 +3614,7 @@ discard_damage_owned_by(struct monst *shkp)
struct damage *dam = g.level.damagelist, *dam2, *prevdam = NULL; struct damage *dam = g.level.damagelist, *dam2, *prevdam = NULL;
while (dam) { while (dam) {
xchar x = dam->place.x, y = dam->place.y; coordxy x = dam->place.x, y = dam->place.y;
if (index(in_rooms(x, y, SHOPBASE), ESHK(shkp)->shoproom)) { if (index(in_rooms(x, y, SHOPBASE), ESHK(shkp)->shoproom)) {
dam2 = dam->next; dam2 = dam->next;
@@ -3664,10 +3664,10 @@ shk_fixes_damage(struct monst *shkp)
#define horiz(i) ((i % 3) - 1) #define horiz(i) ((i % 3) - 1)
#define vert(i) ((i / 3) - 1) #define vert(i) ((i / 3) - 1)
static xchar * static coordxy *
litter_getpos(int *k, xchar x, xchar y, struct monst *shkp) litter_getpos(int *k, coordxy x, coordxy y, struct monst *shkp)
{ {
static xchar litter[9]; static xint16 litter[9];
int i, ix, iy; int i, ix, iy;
(void) memset((genericptr_t) litter, 0, sizeof litter); (void) memset((genericptr_t) litter, 0, sizeof litter);
@@ -3694,9 +3694,9 @@ litter_getpos(int *k, xchar x, xchar y, struct monst *shkp)
static void static void
litter_scatter( litter_scatter(
xchar *litter, xint16 *litter,
int k, int k,
xchar x, xchar y, coordxy x, coordxy y,
struct monst *shkp) struct monst *shkp)
{ {
struct obj *otmp; struct obj *otmp;
@@ -3755,7 +3755,7 @@ litter_scatter(
} }
static void static void
litter_newsyms(xchar *litter, xchar x, xchar y) litter_newsyms(xint16 *litter, coordxy x, coordxy y)
{ {
int i; int i;
@@ -3780,8 +3780,8 @@ repair_damage(
struct damage *tmp_dam, struct damage *tmp_dam,
boolean catchup) boolean catchup)
{ {
xchar x, y; coordxy x, y;
xchar *litter; xint16 *litter;
struct obj *otmp; struct obj *otmp;
struct trap *ttmp; struct trap *ttmp;
int k, disposition = 1; int k, disposition = 1;
@@ -3923,7 +3923,7 @@ fix_shop_damage(void)
int int
shk_move(struct monst *shkp) shk_move(struct monst *shkp)
{ {
xchar gx, gy, omx, omy; coordxy gx, gy, omx, omy;
int udist; int udist;
schar appr; schar appr;
struct eshk *eshkp = ESHK(shkp); struct eshk *eshkp = ESHK(shkp);
@@ -4179,7 +4179,7 @@ pay_for_damage(const char* dmgstr, boolean cant_mollify)
char shops_affected[5]; char shops_affected[5];
boolean uinshp = (*u.ushops != '\0'); boolean uinshp = (*u.ushops != '\0');
char qbuf[80]; char qbuf[80];
xchar x, y; coordxy x, y;
boolean dugwall = (!strcmp(dmgstr, "dig into") /* wand */ boolean dugwall = (!strcmp(dmgstr, "dig into") /* wand */
|| !strcmp(dmgstr, "damage")); /* pick-axe */ || !strcmp(dmgstr, "damage")); /* pick-axe */
boolean animal, pursue; boolean animal, pursue;
@@ -4329,7 +4329,7 @@ pay_for_damage(const char* dmgstr, boolean cant_mollify)
if (yn(qbuf) != 'n') { if (yn(qbuf) != 'n') {
boolean is_seen, was_seen = canseemon(shkp), boolean is_seen, was_seen = canseemon(shkp),
was_outside = !inhishop(shkp); was_outside = !inhishop(shkp);
xchar sx = shkp->mx, sy = shkp->my; coordxy sx = shkp->mx, sy = shkp->my;
cost_of_damage = check_credit(cost_of_damage, shkp); cost_of_damage = check_credit(cost_of_damage, shkp);
if (cost_of_damage > 0L) { if (cost_of_damage > 0L) {
@@ -4367,7 +4367,7 @@ pay_for_damage(const char* dmgstr, boolean cant_mollify)
/* called in dokick.c when we kick an object that might be in a store */ /* called in dokick.c when we kick an object that might be in a store */
boolean boolean
costly_spot(register xchar x, register xchar y) costly_spot(register coordxy x, register coordxy y)
{ {
struct monst *shkp; struct monst *shkp;
struct eshk *eshkp; struct eshk *eshkp;
@@ -4385,7 +4385,7 @@ costly_spot(register xchar x, register xchar y)
/* called by dotalk(sounds.c) when #chatting; returns obj if location /* called by dotalk(sounds.c) when #chatting; returns obj if location
contains shop goods and shopkeeper is willing & able to speak */ contains shop goods and shopkeeper is willing & able to speak */
struct obj * struct obj *
shop_object(register xchar x, register xchar y) shop_object(register coordxy x, register coordxy y)
{ {
register struct obj *otmp; register struct obj *otmp;
register struct monst *shkp; register struct monst *shkp;
@@ -4726,7 +4726,7 @@ check_unpaid(struct obj* otmp)
} }
void void
costly_gold(xchar x, xchar y, long amount, boolean silent) costly_gold(coordxy x, coordxy y, long amount, boolean silent)
{ {
register long delta; register long delta;
register struct monst *shkp; register struct monst *shkp;
@@ -4765,7 +4765,7 @@ costly_gold(xchar x, xchar y, long amount, boolean silent)
/* used in domove to block diagonal shop-exit */ /* used in domove to block diagonal shop-exit */
/* x,y should always be a door */ /* x,y should always be a door */
boolean boolean
block_door(register xchar x, register xchar y) block_door(register coordxy x, register coordxy y)
{ {
register int roomno = *in_rooms(x, y, SHOPBASE); register int roomno = *in_rooms(x, y, SHOPBASE);
register struct monst *shkp; register struct monst *shkp;
@@ -4799,9 +4799,9 @@ block_door(register xchar x, register xchar y)
/* used in domove to block diagonal shop-entry; /* used in domove to block diagonal shop-entry;
u.ux, u.uy should always be a door */ u.ux, u.uy should always be a door */
boolean boolean
block_entry(register xchar x, register xchar y) block_entry(register coordxy x, register coordxy y)
{ {
register xchar sx, sy; register coordxy sx, sy;
register int roomno; register int roomno;
register struct monst *shkp; register struct monst *shkp;
@@ -4860,7 +4860,7 @@ static char *
shk_owns(char *buf, struct obj *obj) shk_owns(char *buf, struct obj *obj)
{ {
struct monst *shkp; struct monst *shkp;
xchar x, y; coordxy x, y;
if (get_obj_location(obj, &x, &y, 0) if (get_obj_location(obj, &x, &y, 0)
&& (obj->unpaid || (obj->where == OBJ_FLOOR && !obj->no_charge && (obj->unpaid || (obj->where == OBJ_FLOOR && !obj->no_charge
+92 -92
View File
@@ -18,7 +18,7 @@ typedef void (*select_iter_func)(int, int, genericptr);
extern void mkmap(lev_init *); extern void mkmap(lev_init *);
static boolean match_maptyps(xchar, xchar); static boolean match_maptyps(xint16, xint16);
static void solidify_map(void); static void solidify_map(void);
static void lvlfill_maze_grid(int, int, int, int, schar); static void lvlfill_maze_grid(int, int, int, int, schar);
static void lvlfill_solid(schar, schar); static void lvlfill_solid(schar, schar);
@@ -28,7 +28,7 @@ static void flip_drawbridge_vertical(struct rm *);
static void flip_visuals(int, int, int, int, int); static void flip_visuals(int, int, int, int, int);
static int flip_encoded_direction_bits(int, int); static int flip_encoded_direction_bits(int, int);
static void sel_set_wall_property(int, int, genericptr_t); static void sel_set_wall_property(int, int, genericptr_t);
static void set_wall_property(xchar, xchar, xchar, xchar, int); static void set_wall_property(coordxy, coordxy, coordxy, coordxy, int);
static void count_features(void); static void count_features(void);
static void remove_boundary_syms(void); static void remove_boundary_syms(void);
static void set_door_orientation(int, int); static void set_door_orientation(int, int);
@@ -37,15 +37,15 @@ static void maybe_add_door(int, int, struct mkroom *);
static void link_doors_rooms(void); static void link_doors_rooms(void);
static int rnddoor(void); static int rnddoor(void);
static int rndtrap(void); static int rndtrap(void);
static void get_location(xchar *, xchar *, getloc_flags_t, struct mkroom *); static void get_location(coordxy *, coordxy *, getloc_flags_t, struct mkroom *);
static void set_ok_location_func(boolean (*)(xchar, xchar)); static void set_ok_location_func(boolean (*)(coordxy, coordxy));
static boolean is_ok_location(xchar, xchar, getloc_flags_t); static boolean is_ok_location(coordxy, coordxy, getloc_flags_t);
static unpacked_coord get_unpacked_coord(long, int); static unpacked_coord get_unpacked_coord(long, int);
static void get_room_loc(xchar *, xchar *, struct mkroom *); static void get_room_loc(coordxy *, coordxy *, struct mkroom *);
static void get_free_room_loc(xchar *, xchar *, struct mkroom *, static void get_free_room_loc(coordxy *, coordxy *, struct mkroom *,
packed_coord); packed_coord);
static boolean create_subroom(struct mkroom *, xchar, xchar, xchar, static boolean create_subroom(struct mkroom *, coordxy, coordxy, coordxy,
xchar, xchar, xchar); coordxy, xint16, xint16);
static void create_door(room_door *, struct mkroom *); static void create_door(room_door *, struct mkroom *);
static void create_trap(spltrap *, struct mkroom *); static void create_trap(spltrap *, struct mkroom *);
static int noncoalignment(aligntyp); static int noncoalignment(aligntyp);
@@ -55,7 +55,7 @@ static unsigned int sp_amask_to_amask(unsigned int sp_amask);
static void create_monster(monster *, struct mkroom *); static void create_monster(monster *, struct mkroom *);
static void create_object(object *, struct mkroom *); static void create_object(object *, struct mkroom *);
static void create_altar(altar *, struct mkroom *); static void create_altar(altar *, struct mkroom *);
static boolean search_door(struct mkroom *, xchar *, xchar *, xchar, int); static boolean search_door(struct mkroom *, coordxy *, coordxy *, coordxy, int);
static void create_corridor(corridor *); static void create_corridor(corridor *);
static struct mkroom *build_room(room *, struct mkroom *); static struct mkroom *build_room(room *, struct mkroom *);
static void light_region(region *); static void light_region(region *);
@@ -100,10 +100,10 @@ static void get_table_xy_or_coord(lua_State *, lua_Integer *, lua_Integer *);
static int get_table_region(lua_State *, const char *, lua_Integer *, static int get_table_region(lua_State *, const char *, lua_Integer *,
lua_Integer *, lua_Integer *, lua_Integer *, boolean); lua_Integer *, lua_Integer *, lua_Integer *, boolean);
static void set_wallprop_in_selection(lua_State *, int); static void set_wallprop_in_selection(lua_State *, int);
static xchar random_wdir(void); static coordxy random_wdir(void);
static int floodfillchk_match_under(int, int); static int floodfillchk_match_under(int, int);
static int floodfillchk_match_accessible(int, int); static int floodfillchk_match_accessible(int, int);
static boolean sel_flood_havepoint(int, int, xchar *, xchar *, int); static boolean sel_flood_havepoint(int, int, coordxy *, coordxy *, int);
static long line_dist_coord(long, long, long, long, long, long); static long line_dist_coord(long, long, long, long, long, long);
static void l_push_mkroom_table(lua_State *, struct mkroom *); static void l_push_mkroom_table(lua_State *, struct mkroom *);
static int get_table_align(lua_State *); static int get_table_align(lua_State *);
@@ -200,7 +200,7 @@ static struct monst *invent_carrying_monster = (struct monst *) 0;
/* Does typ match with levl[][].typ, considering special types /* Does typ match with levl[][].typ, considering special types
MATCH_WALL and MAX_TYPE (aka transparency)? */ MATCH_WALL and MAX_TYPE (aka transparency)? */
static boolean static boolean
match_maptyps(xchar typ, xchar levltyp) match_maptyps(xint16 typ, xint16 levltyp)
{ {
if ((typ == MATCH_WALL) && !IS_STWALL(levltyp)) if ((typ == MATCH_WALL) && !IS_STWALL(levltyp))
return FALSE; return FALSE;
@@ -300,7 +300,7 @@ mapfrag_match(struct mapfragment* mf, int x, int y)
static void static void
solidify_map(void) solidify_map(void)
{ {
xchar x, y; coordxy x, y;
for (x = 0; x < COLNO; x++) for (x = 0; x < COLNO; x++)
for (y = 0; y < ROWNO; y++) for (y = 0; y < ROWNO; y++)
@@ -870,9 +870,9 @@ sel_set_wall_property(int x, int y, genericptr_t arg)
* Make walls of the area (x1, y1, x2, y2) non diggable/non passwall-able * Make walls of the area (x1, y1, x2, y2) non diggable/non passwall-able
*/ */
static void static void
set_wall_property(xchar x1, xchar y1, xchar x2, xchar y2, int prop) set_wall_property(coordxy x1, coordxy y1, coordxy x2, coordxy y2, int prop)
{ {
register xchar x, y; register coordxy x, y;
x1 = max(x1, 1); x1 = max(x1, 1);
x2 = min(x2, COLNO - 1); x2 = min(x2, COLNO - 1);
@@ -890,7 +890,7 @@ set_wall_property(xchar x1, xchar y1, xchar x2, xchar y2, int prop)
static void static void
count_features(void) count_features(void)
{ {
xchar x, y; coordxy x, y;
g.level.flags.nfountains = g.level.flags.nsinks = 0; g.level.flags.nfountains = g.level.flags.nsinks = 0;
for (y = 0; y < ROWNO; y++) for (y = 0; y < ROWNO; y++)
@@ -911,7 +911,7 @@ remove_boundary_syms(void)
* are laid out. CROSSWALLS are used to specify "invisible" * are laid out. CROSSWALLS are used to specify "invisible"
* boundaries where DOOR syms look bad or aren't desirable. * boundaries where DOOR syms look bad or aren't desirable.
*/ */
xchar x, y; coordxy x, y;
boolean has_bounds = FALSE; boolean has_bounds = FALSE;
for (x = 0; x < COLNO - 1; x++) for (x = 0; x < COLNO - 1; x++)
@@ -1087,7 +1087,7 @@ rndtrap(void)
*/ */
static void static void
get_location( get_location(
xchar *x, xchar *y, coordxy *x, coordxy *y,
getloc_flags_t humidity, getloc_flags_t humidity,
struct mkroom *croom) struct mkroom *croom)
{ {
@@ -1155,16 +1155,16 @@ get_location(
} }
} }
static boolean (*is_ok_location_func)(xchar, xchar) = NULL; static boolean (*is_ok_location_func)(coordxy, coordxy) = NULL;
static void static void
set_ok_location_func(boolean (*func)(xchar, xchar)) set_ok_location_func(boolean (*func)(coordxy, coordxy))
{ {
is_ok_location_func = func; is_ok_location_func = func;
} }
static boolean static boolean
is_ok_location(xchar x, xchar y, getloc_flags_t humidity) is_ok_location(coordxy x, coordxy y, getloc_flags_t humidity)
{ {
register int typ = levl[x][y].typ; register int typ = levl[x][y].typ;
@@ -1222,7 +1222,7 @@ get_unpacked_coord(long loc, int defhumidity)
void void
get_location_coord( get_location_coord(
xchar *x, xchar *y, coordxy *x, coordxy *y,
int humidity, int humidity,
struct mkroom *croom, struct mkroom *croom,
long crd) long crd)
@@ -1243,7 +1243,7 @@ get_location_coord(
* negative values for x or y means RANDOM! * negative values for x or y means RANDOM!
*/ */
static void static void
get_room_loc(xchar *x, xchar *y, struct mkroom *croom) get_room_loc(coordxy *x, coordxy *y, struct mkroom *croom)
{ {
coord c; coord c;
@@ -1269,11 +1269,11 @@ get_room_loc(xchar *x, xchar *y, struct mkroom *croom)
*/ */
static void static void
get_free_room_loc( get_free_room_loc(
xchar *x, xchar *y, coordxy *x, coordxy *y,
struct mkroom *croom, struct mkroom *croom,
packed_coord pos) packed_coord pos)
{ {
xchar try_x, try_y; coordxy try_x, try_y;
register int trycnt = 0; register int trycnt = 0;
get_location_coord(&try_x, &try_y, DRY, croom, pos); get_location_coord(&try_x, &try_y, DRY, croom, pos);
@@ -1291,14 +1291,14 @@ get_free_room_loc(
boolean boolean
check_room( check_room(
xchar *lowx, xchar *ddx, coordxy *lowx, coordxy *ddx,
xchar *lowy, xchar *ddy, coordxy *lowy, coordxy *ddy,
boolean vault) boolean vault)
{ {
register int x, y, hix = *lowx + *ddx, hiy = *lowy + *ddy; register int x, y, hix = *lowx + *ddx, hiy = *lowy + *ddy;
register struct rm *lev; register struct rm *lev;
int xlim, ylim, ymax; int xlim, ylim, ymax;
xchar s_lowx, s_ddx, s_lowy, s_ddy; coordxy s_lowx, s_ddx, s_lowy, s_ddy;
s_lowx = *lowx; s_ddx = *ddx; s_lowx = *lowx; s_ddx = *ddx;
s_lowy = *lowy; s_ddy = *ddy; s_lowy = *lowy; s_ddy = *ddy;
@@ -1370,12 +1370,12 @@ check_room(
*/ */
boolean boolean
create_room( create_room(
xchar x, xchar y, coordxy x, coordxy y,
xchar w, xchar h, coordxy w, coordxy h,
xchar xal, xchar yal, coordxy xal, coordxy yal,
xchar rtype, xchar rlit) xint16 rtype, xint16 rlit)
{ {
xchar xabs = 0, yabs = 0; coordxy xabs = 0, yabs = 0;
int wtmp, htmp, xaltmp, yaltmp, xtmp, ytmp; int wtmp, htmp, xaltmp, yaltmp, xtmp, ytmp;
NhRect *r1 = 0, r2; NhRect *r1 = 0, r2;
int trycnt = 0; int trycnt = 0;
@@ -1403,7 +1403,7 @@ create_room(
* it up. * it up.
*/ */
do { do {
xchar xborder, yborder; coordxy xborder, yborder;
wtmp = w; wtmp = w;
htmp = h; htmp = h;
@@ -1416,7 +1416,7 @@ create_room(
if ((xtmp < 0 && ytmp < 0 && wtmp < 0 && xaltmp < 0 && yaltmp < 0) if ((xtmp < 0 && ytmp < 0 && wtmp < 0 && xaltmp < 0 && yaltmp < 0)
|| vault) { || vault) {
xchar hx, hy, lx, ly, dx, dy; coordxy hx, hy, lx, ly, dx, dy;
r1 = rnd_rect(); /* Get a random rectangle */ r1 = rnd_rect(); /* Get a random rectangle */
@@ -1464,7 +1464,7 @@ create_room(
r2.hy = yabs + htmp; r2.hy = yabs + htmp;
} else { /* Only some parameters are random */ } else { /* Only some parameters are random */
int rndpos = 0; int rndpos = 0;
xchar dx, dy; coordxy dx, dy;
if (xtmp < 0 && ytmp < 0) { /* Position is RANDOM */ if (xtmp < 0 && ytmp < 0) { /* Position is RANDOM */
xtmp = rnd(5); xtmp = rnd(5);
@@ -1552,11 +1552,11 @@ create_room(
static boolean static boolean
create_subroom( create_subroom(
struct mkroom *proom, struct mkroom *proom,
xchar x, xchar y, coordxy x, coordxy y,
xchar w, xchar h, coordxy w, coordxy h,
xchar rtype, xchar rlit) xint16 rtype, xint16 rlit)
{ {
xchar width, height; coordxy width, height;
width = proom->hx - proom->lx + 1; width = proom->hx - proom->lx + 1;
height = proom->hy - proom->ly + 1; height = proom->hy - proom->ly + 1;
@@ -1696,7 +1696,7 @@ create_door(room_door *dd, struct mkroom *broom)
static void static void
create_trap(spltrap* t, struct mkroom* croom) create_trap(spltrap* t, struct mkroom* croom)
{ {
xchar x = -1, y = -1; coordxy x = -1, y = -1;
coord tm; coord tm;
int mktrap_flags = MKTRAP_MAZEFLAG; int mktrap_flags = MKTRAP_MAZEFLAG;
@@ -1804,7 +1804,7 @@ static void
create_monster(monster* m, struct mkroom* croom) create_monster(monster* m, struct mkroom* croom)
{ {
struct monst *mtmp; struct monst *mtmp;
xchar x, y; coordxy x, y;
char class; char class;
unsigned int amask; unsigned int amask;
coord cc; coord cc;
@@ -2053,7 +2053,7 @@ static void
create_object(object* o, struct mkroom* croom) create_object(object* o, struct mkroom* croom)
{ {
struct obj *otmp; struct obj *otmp;
xchar x, y; coordxy x, y;
char c; char c;
boolean named; /* has a name been supplied in level description? */ boolean named; /* has a name been supplied in level description? */
@@ -2297,7 +2297,7 @@ static void
create_altar(altar* a, struct mkroom* croom) create_altar(altar* a, struct mkroom* croom)
{ {
schar sproom; schar sproom;
xchar x = -1, y = -1; coordxy x = -1, y = -1;
unsigned int amask; unsigned int amask;
boolean croom_is_temple = TRUE; boolean croom_is_temple = TRUE;
@@ -2342,8 +2342,8 @@ create_altar(altar* a, struct mkroom* croom)
static boolean static boolean
search_door( search_door(
struct mkroom* croom, struct mkroom* croom,
xchar *x, xchar * y, coordxy *x, coordxy * y,
xchar wall, int cnt) xint16 wall, int cnt)
{ {
int dx, dy; int dx, dy;
int xx, yy; int xx, yy;
@@ -2652,7 +2652,7 @@ build_room(room *r, struct mkroom* mkr)
{ {
boolean okroom; boolean okroom;
struct mkroom *aroom; struct mkroom *aroom;
xchar rtype = (!r->chance || rn2(100) < r->chance) ? r->rtype : OROOM; xint16 rtype = (!r->chance || rn2(100) < r->chance) ? r->rtype : OROOM;
if (mkr) { if (mkr) {
aroom = &g.subrooms[g.nsubroom]; aroom = &g.subrooms[g.nsubroom];
@@ -2755,9 +2755,9 @@ maze1xy(coord *m, int humidity)
if (--tryct < 0) if (--tryct < 0)
break; /* give up */ break; /* give up */
} while (!(x % 2) || !(y % 2) || SpLev_Map[x][y] } while (!(x % 2) || !(y % 2) || SpLev_Map[x][y]
|| !is_ok_location((xchar) x, (xchar) y, humidity)); || !is_ok_location((coordxy) x, (coordxy) y, humidity));
m->x = (xchar) x, m->y = (xchar) y; m->x = (coordxy) x, m->y = (coordxy) y;
} }
/* /*
@@ -2771,7 +2771,7 @@ static void
fill_empty_maze(void) fill_empty_maze(void)
{ {
int mapcountmax, mapcount, mapfact; int mapcountmax, mapcount, mapfact;
xchar x, y; coordxy x, y;
coord mm; coord mm;
mapcountmax = mapcount = (g.x_maze_max - 2) * (g.y_maze_max - 2); mapcountmax = mapcount = (g.x_maze_max - 2) * (g.y_maze_max - 2);
@@ -3643,7 +3643,7 @@ lspo_engraving(lua_State *L)
int etyp = DUST; int etyp = DUST;
char *txt = (char *) 0; char *txt = (char *) 0;
long ecoord; long ecoord;
xchar x = -1, y = -1; coordxy x = -1, y = -1;
int argc = lua_gettop(L); int argc = lua_gettop(L);
create_des_coder(); create_des_coder();
@@ -3874,7 +3874,7 @@ spo_endroom(struct sp_coder* coder UNUSED)
/* callback for is_ok_location. /* callback for is_ok_location.
stairs generated at random location shouldn't overwrite special terrain */ stairs generated at random location shouldn't overwrite special terrain */
static boolean static boolean
good_stair_loc(xchar x, xchar y) good_stair_loc(coordxy x, coordxy y)
{ {
schar typ = levl[x][y].typ; schar typ = levl[x][y].typ;
@@ -3887,7 +3887,7 @@ l_create_stairway(lua_State *L, boolean using_ladder)
static const char *const stairdirs[] = { "down", "up", NULL }; static const char *const stairdirs[] = { "down", "up", NULL };
static const int stairdirs2i[] = { 0, 1 }; static const int stairdirs2i[] = { 0, 1 };
int argc = lua_gettop(L); int argc = lua_gettop(L);
xchar x = -1, y = -1; coordxy x = -1, y = -1;
struct trap *badtrap; struct trap *badtrap;
long scoord; long scoord;
@@ -3981,7 +3981,7 @@ int
lspo_grave(lua_State *L) lspo_grave(lua_State *L)
{ {
int argc = lua_gettop(L); int argc = lua_gettop(L);
xchar x, y; coordxy x, y;
long scoord; long scoord;
lua_Integer ax,ay; lua_Integer ax,ay;
char *txt; char *txt;
@@ -4202,7 +4202,7 @@ int
lspo_gold(lua_State *L) lspo_gold(lua_State *L)
{ {
int argc = lua_gettop(L); int argc = lua_gettop(L);
xchar x, y; coordxy x, y;
long amount; long amount;
long gcoord; long gcoord;
lua_Integer gx, gy; lua_Integer gx, gy;
@@ -4330,7 +4330,7 @@ selection_clone(struct selectionvar* sel)
return tmps; return tmps;
} }
xchar coordxy
selection_getpoint(int x, int y, struct selectionvar* sel) selection_getpoint(int x, int y, struct selectionvar* sel)
{ {
if (!sel || !sel->map) if (!sel || !sel->map)
@@ -4342,7 +4342,7 @@ selection_getpoint(int x, int y, struct selectionvar* sel)
} }
void void
selection_setpoint(int x, int y, struct selectionvar* sel, xchar c) selection_setpoint(int x, int y, struct selectionvar* sel, coordxy c)
{ {
if (!sel || !sel->map) if (!sel || !sel->map)
return; return;
@@ -4366,7 +4366,7 @@ selection_not(struct selectionvar* s)
} }
struct selectionvar * struct selectionvar *
selection_filter_mapchar(struct selectionvar* ov, xchar typ, int lit) selection_filter_mapchar(struct selectionvar* ov, coordxy typ, int lit)
{ {
int x, y; int x, y;
struct selectionvar *ret; struct selectionvar *ret;
@@ -4412,7 +4412,7 @@ selection_filter_percent(struct selectionvar* ov, int percent)
} }
int int
selection_rndcoord(struct selectionvar* ov, xchar *x, xchar *y, boolean removeit) selection_rndcoord(struct selectionvar* ov, coordxy *x, coordxy *y, boolean removeit)
{ {
int idx = 0; int idx = 0;
int c; int c;
@@ -4443,10 +4443,10 @@ selection_rndcoord(struct selectionvar* ov, xchar *x, xchar *y, boolean removeit
} }
/* Choose a single random W_* direction. */ /* Choose a single random W_* direction. */
static xchar static coordxy
random_wdir(void) random_wdir(void)
{ {
static const xchar wdirs[4] = { W_NORTH, W_SOUTH, W_EAST, W_WEST }; static const coordxy wdirs[4] = { W_NORTH, W_SOUTH, W_EAST, W_WEST };
return wdirs[rn2(4)]; return wdirs[rn2(4)];
} }
@@ -4510,7 +4510,7 @@ floodfillchk_match_under(int x, int y)
} }
void void
set_floodfillchk_match_under(xchar typ) set_floodfillchk_match_under(coordxy typ)
{ {
floodfillchk_match_under_typ = typ; floodfillchk_match_under_typ = typ;
set_selection_floodfillchk(floodfillchk_match_under); set_selection_floodfillchk(floodfillchk_match_under);
@@ -4526,9 +4526,9 @@ floodfillchk_match_accessible(int x, int y)
/* check whethere <x,y> is already in xs[],ys[] */ /* check whethere <x,y> is already in xs[],ys[] */
static boolean static boolean
sel_flood_havepoint(int x, int y, xchar xs[], xchar ys[], int n) sel_flood_havepoint(int x, int y, coordxy xs[], coordxy ys[], int n)
{ {
xchar xx = (xchar) x, yy = (xchar) y; coordxy xx = (coordxy) x, yy = (coordxy) y;
while (n > 0) { while (n > 0) {
--n; --n;
@@ -4562,8 +4562,8 @@ selection_floodfill(struct selectionvar* ov, int x, int y, boolean diagonals)
} while (0) } while (0)
static const char floodfill_stack_overrun[] = "floodfill stack overrun"; static const char floodfill_stack_overrun[] = "floodfill stack overrun";
int idx = 0; int idx = 0;
xchar dx[SEL_FLOOD_STACK]; coordxy dx[SEL_FLOOD_STACK];
xchar dy[SEL_FLOOD_STACK]; coordxy dy[SEL_FLOOD_STACK];
if (selection_flood_check_func == (int (*)(int, int)) 0) { if (selection_flood_check_func == (int (*)(int, int)) 0) {
selection_free(tmp, TRUE); selection_free(tmp, TRUE);
@@ -4767,8 +4767,8 @@ selection_do_gradient(
/* bresenham line algo */ /* bresenham line algo */
void void
selection_do_line( selection_do_line(
xchar x1, xchar y1, coordxy x1, coordxy y1,
xchar x2, xchar y2, coordxy x2, coordxy y2,
struct selectionvar *ov) struct selectionvar *ov)
{ {
int d0, dx, dy, ai, bi, xi, yi; int d0, dx, dy, ai, bi, xi, yi;
@@ -4824,8 +4824,8 @@ selection_do_line(
void void
selection_do_randline( selection_do_randline(
xchar x1, xchar y1, coordxy x1, coordxy y1,
xchar x2, xchar y2, coordxy x2, coordxy y2,
schar rough, schar rough,
schar rec, schar rec,
struct selectionvar *ov) struct selectionvar *ov)
@@ -4912,8 +4912,8 @@ sel_set_feature(int x, int y, genericptr_t arg)
static void static void
sel_set_door(int dx, int dy, genericptr_t arg) sel_set_door(int dx, int dy, genericptr_t arg)
{ {
xchar typ = *(xchar *) arg; coordxy typ = *(coordxy *) arg;
xchar x = dx, y = dy; coordxy x = dx, y = dy;
if (!IS_DOOR(levl[x][y].typ) && levl[x][y].typ != SDOOR) if (!IS_DOOR(levl[x][y].typ) && levl[x][y].typ != SDOOR)
levl[x][y].typ = (typ & D_SECRET) ? SDOOR : DOOR; levl[x][y].typ = (typ & D_SECRET) ? SDOOR : DOOR;
@@ -4942,8 +4942,8 @@ lspo_door(lua_State *L)
-1, D_ISOPEN, D_CLOSED, D_LOCKED, D_NODOOR, D_BROKEN, D_SECRET -1, D_ISOPEN, D_CLOSED, D_LOCKED, D_NODOOR, D_BROKEN, D_SECRET
}; };
int msk; int msk;
xchar x, y; coordxy x, y;
xchar typ; coordxy typ;
int argc = lua_gettop(L); int argc = lua_gettop(L);
create_des_coder(); create_des_coder();
@@ -4962,7 +4962,7 @@ lspo_door(lua_State *L)
msk = doorstates2i[get_table_option(L, "state", "random", doorstates)]; msk = doorstates2i[get_table_option(L, "state", "random", doorstates)];
} }
typ = (msk == -1) ? rnddoor() : (xchar) msk; typ = (msk == -1) ? rnddoor() : (coordxy) msk;
if (x == -1 && y == -1) { if (x == -1 && y == -1) {
static const char *const walldirs[] = { static const char *const walldirs[] = {
@@ -5020,19 +5020,19 @@ int
nhl_abs_coord(lua_State *L) nhl_abs_coord(lua_State *L)
{ {
int argc = lua_gettop(L); int argc = lua_gettop(L);
xchar x = -1, y = -1; coordxy x = -1, y = -1;
if (argc == 2) { if (argc == 2) {
x = (xchar) lua_tointeger(L, 1); x = (coordxy) lua_tointeger(L, 1);
y = (xchar) lua_tointeger(L, 2); y = (coordxy) lua_tointeger(L, 2);
x += g.xstart; x += g.xstart;
y += g.ystart; y += g.ystart;
lua_pushinteger(L, x); lua_pushinteger(L, x);
lua_pushinteger(L, y); lua_pushinteger(L, y);
return 2; return 2;
} else if (argc == 1 && lua_type(L, 1) == LUA_TTABLE) { } else if (argc == 1 && lua_type(L, 1) == LUA_TTABLE) {
x = (xchar) get_table_int(L, "x"); x = (coordxy) get_table_int(L, "x");
y = (xchar) get_table_int(L, "y"); y = (coordxy) get_table_int(L, "y");
x += g.xstart; x += g.xstart;
y += g.ystart; y += g.ystart;
lua_newtable(L); lua_newtable(L);
@@ -5057,7 +5057,7 @@ lspo_feature(lua_State *L)
"throne", "tree", NULL }; "throne", "tree", NULL };
static const int features2i[] = { FOUNTAIN, SINK, POOL, static const int features2i[] = { FOUNTAIN, SINK, POOL,
THRONE, TREE, STONE }; THRONE, TREE, STONE };
xchar x, y; coordxy x, y;
int typ; int typ;
int argc = lua_gettop(L); int argc = lua_gettop(L);
boolean can_have_flags = FALSE; boolean can_have_flags = FALSE;
@@ -5132,7 +5132,7 @@ int
lspo_terrain(lua_State *L) lspo_terrain(lua_State *L)
{ {
terrain tmpterrain; terrain tmpterrain;
xchar x = 0, y = 0; coordxy x = 0, y = 0;
struct selectionvar *sel = NULL; struct selectionvar *sel = NULL;
int argc = lua_gettop(L); int argc = lua_gettop(L);
@@ -5199,7 +5199,7 @@ lspo_terrain(lua_State *L)
int int
lspo_replace_terrain(lua_State *L) lspo_replace_terrain(lua_State *L)
{ {
xchar totyp, fromtyp; coordxy totyp, fromtyp;
struct mapfragment *mf = NULL; struct mapfragment *mf = NULL;
struct selectionvar *sel = NULL; struct selectionvar *sel = NULL;
boolean freesel = FALSE; boolean freesel = FALSE;
@@ -5256,7 +5256,7 @@ lspo_replace_terrain(lua_State *L)
if (x1 == -1 && y1 == -1 && x2 == -1 && y2 == -1) { if (x1 == -1 && y1 == -1 && x2 == -1 && y2 == -1) {
(void) selection_not(sel); (void) selection_not(sel);
} else { } else {
xchar rx1, ry1, rx2, ry2; coordxy rx1, ry1, rx2, ry2;
rx1 = x1, ry1 = y1, rx2 = x2, ry2 = y2; rx1 = x1, ry1 = y1, rx2 = x2, ry2 = y2;
get_location(&rx1, &ry1, ANY_LOC, g.coder->croom); get_location(&rx1, &ry1, ANY_LOC, g.coder->croom);
get_location(&rx2, &ry2, ANY_LOC, g.coder->croom); get_location(&rx2, &ry2, ANY_LOC, g.coder->croom);
@@ -5296,7 +5296,7 @@ generate_way_out_method(
WAN_TELEPORTATION, SCR_TELEPORTATION, RIN_TELEPORTATION WAN_TELEPORTATION, SCR_TELEPORTATION, RIN_TELEPORTATION
}; };
struct selectionvar *ov2 = selection_new(), *ov3; struct selectionvar *ov2 = selection_new(), *ov3;
xchar x, y; coordxy x, y;
boolean res = TRUE; boolean res = TRUE;
selection_floodfill(ov2, nx, ny, TRUE); selection_floodfill(ov2, nx, ny, TRUE);
@@ -5648,7 +5648,7 @@ add_doors_to_room(struct mkroom *croom)
int int
lspo_region(lua_State *L) lspo_region(lua_State *L)
{ {
xchar dx1, dy1, dx2, dy2; coordxy dx1, dy1, dx2, dy2;
register struct mkroom *troom; register struct mkroom *troom;
boolean do_arrival_room = FALSE, room_not_needed, boolean do_arrival_room = FALSE, room_not_needed,
irregular = FALSE, joined = TRUE; irregular = FALSE, joined = TRUE;
@@ -5798,7 +5798,7 @@ lspo_drawbridge(lua_State *L)
"open", "closed", "random", NULL "open", "closed", "random", NULL
}; };
static const int dbopens2i[] = { 1, 0, -1, -2 }; static const int dbopens2i[] = { 1, 0, -1, -2 };
xchar x, y; coordxy x, y;
lua_Integer mx, my; lua_Integer mx, my;
int dir; int dir;
int db_open; int db_open;
@@ -5838,9 +5838,9 @@ lspo_mazewalk(lua_State *L)
static const int mwdirs2i[] = { static const int mwdirs2i[] = {
W_NORTH, W_SOUTH, W_EAST, W_WEST, W_RANDOM, -2 W_NORTH, W_SOUTH, W_EAST, W_WEST, W_RANDOM, -2
}; };
xchar x, y; coordxy x, y;
lua_Integer mx, my; lua_Integer mx, my;
xchar ftyp = ROOM; coordxy ftyp = ROOM;
int fstocked = 1, dir = -1; int fstocked = 1, dir = -1;
long mcoord; long mcoord;
int argc = lua_gettop(L); int argc = lua_gettop(L);
@@ -5936,7 +5936,7 @@ lspo_wall_property(lua_State *L)
{ {
static const char *const wprops[] = { "nondiggable", "nonpasswall", NULL }; static const char *const wprops[] = { "nondiggable", "nonpasswall", NULL };
static const int wprop2i[] = { W_NONDIGGABLE, W_NONPASSWALL, -1 }; static const int wprop2i[] = { W_NONDIGGABLE, W_NONPASSWALL, -1 };
xchar dx1 = -1, dy1 = -1, dx2 = -1, dy2 = -1; coordxy dx1 = -1, dy1 = -1, dx2 = -1, dy2 = -1;
int wprop; int wprop;
create_des_coder(); create_des_coder();
@@ -6292,7 +6292,7 @@ TODO: g.coder->croom needs to be updated
g.xsize = COLNO - 1; g.xsize = COLNO - 1;
g.ysize = ROWNO; g.ysize = ROWNO;
} else { } else {
xchar mptyp; coordxy mptyp;
/* Themed rooms should never overwrite anything */ /* Themed rooms should never overwrite anything */
if (g.in_mk_themerooms) { if (g.in_mk_themerooms) {
+5 -5
View File
@@ -180,7 +180,7 @@ goodpos(
boolean boolean
enexto( enexto(
coord *cc, coord *cc,
xchar xx, xchar yy, coordxy xx, coordxy yy,
struct permonst *mdat) struct permonst *mdat)
{ {
return (enexto_core(cc, xx, yy, mdat, GP_CHECKSCARY) return (enexto_core(cc, xx, yy, mdat, GP_CHECKSCARY)
@@ -190,7 +190,7 @@ enexto(
boolean boolean
enexto_core( enexto_core(
coord *cc, coord *cc,
xchar xx, xchar yy, coordxy xx, coordxy yy,
struct permonst *mdat, struct permonst *mdat,
mmflags_nht entflags) mmflags_nht entflags)
{ {
@@ -411,7 +411,7 @@ teleds(int nux, int nuy, int teleds_flags)
} }
if (ball_active && (ball_still_in_range || allow_drag)) { if (ball_active && (ball_still_in_range || allow_drag)) {
int bc_control; int bc_control;
xchar ballx, bally, chainx, chainy; coordxy ballx, bally, chainx, chainy;
boolean cause_delay; boolean cause_delay;
if (drag_ball(nux, nuy, &bc_control, &ballx, &bally, &chainx, if (drag_ball(nux, nuy, &bc_control, &ballx, &bally, &chainx,
@@ -901,7 +901,7 @@ level_tele(void)
} }
if (wizard && !strcmp(buf, "?")) { if (wizard && !strcmp(buf, "?")) {
schar destlev; schar destlev;
xchar destdnum; coordxy destdnum;
levTport_menu: levTport_menu:
destlev = 0; destlev = 0;
@@ -1592,7 +1592,7 @@ mlevel_tele_trap(
boolean boolean
rloco(register struct obj* obj) rloco(register struct obj* obj)
{ {
register xchar tx, ty, otx, oty; register coordxy tx, ty, otx, oty;
boolean restricted_fall; boolean restricted_fall;
int try_limit = 4000; int try_limit = 4000;
+8 -8
View File
@@ -899,7 +899,7 @@ hatch_egg(anything *arg, long timeout)
struct obj *egg; struct obj *egg;
struct monst *mon, *mon2; struct monst *mon, *mon2;
coord cc; coord cc;
xchar x, y; coordxy x, y;
boolean yours, silent, knows_egg = FALSE; boolean yours, silent, knows_egg = FALSE;
boolean cansee_hatchspot = FALSE; boolean cansee_hatchspot = FALSE;
int i, mnum, hatchcount = 0; int i, mnum, hatchcount = 0;
@@ -1222,7 +1222,7 @@ burn_object(anything *arg, long timeout)
{ {
struct obj *obj = arg->a_obj; struct obj *obj = arg->a_obj;
boolean canseeit, many, menorah, need_newsym, need_invupdate; boolean canseeit, many, menorah, need_newsym, need_invupdate;
xchar x, y; coordxy x, y;
char whose[BUFSZ]; char whose[BUFSZ];
menorah = obj->otyp == CANDELABRUM_OF_INVOCATION; menorah = obj->otyp == CANDELABRUM_OF_INVOCATION;
@@ -1604,7 +1604,7 @@ begin_burn(struct obj *obj, boolean already_lit)
} }
if (obj->lamplit && !already_lit) { if (obj->lamplit && !already_lit) {
xchar x, y; coordxy x, y;
if (get_obj_location(obj, &x, &y, CONTAINED_TOO | BURIED_TOO)) if (get_obj_location(obj, &x, &y, CONTAINED_TOO | BURIED_TOO))
new_light_source(x, y, radius, LS_OBJECT, obj_to_any(obj)); new_light_source(x, y, radius, LS_OBJECT, obj_to_any(obj));
@@ -1925,8 +1925,8 @@ timer_sanity_check(void)
} }
} else if (curr->kind == TIMER_LEVEL) { } else if (curr->kind == TIMER_LEVEL) {
long where = curr->arg.a_long; long where = curr->arg.a_long;
xchar x = (xchar) ((where >> 16) & 0xFFFF), coordxy x = (coordxy) ((where >> 16) & 0xFFFF),
y = (xchar) (where & 0xFFFF); y = (coordxy) (where & 0xFFFF);
if (!isok(x, y)) { if (!isok(x, y)) {
impossible("timer sanity: spot timer %lu at <%d,%d>", impossible("timer sanity: spot timer %lu at <%d,%d>",
@@ -2135,7 +2135,7 @@ obj_has_timer(struct obj* object, short timer_type)
* *
*/ */
void void
spot_stop_timers(xchar x, xchar y, short func_index) spot_stop_timers(coordxy x, coordxy y, short func_index)
{ {
timeout_proc cleanup_func; timeout_proc cleanup_func;
timer_element *curr, *prev, *next_timer = 0; timer_element *curr, *prev, *next_timer = 0;
@@ -2163,7 +2163,7 @@ spot_stop_timers(xchar x, xchar y, short func_index)
* Returns 0L if no such timer. * Returns 0L if no such timer.
*/ */
long long
spot_time_expires(xchar x, xchar y, short func_index) spot_time_expires(coordxy x, coordxy y, short func_index)
{ {
timer_element *curr; timer_element *curr;
long where = (((long) x << 16) | ((long) y)); long where = (((long) x << 16) | ((long) y));
@@ -2177,7 +2177,7 @@ spot_time_expires(xchar x, xchar y, short func_index)
} }
long long
spot_time_left(xchar x, xchar y, short func_index) spot_time_left(coordxy x, coordxy y, short func_index)
{ {
long expires = spot_time_expires(x, y, func_index); long expires = spot_time_expires(x, y, func_index);
return (expires > 0L) ? expires - g.moves : 0L; return (expires > 0L) ? expires - g.moves : 0L;
+27 -27
View File
@@ -7,7 +7,7 @@
extern const char *const destroy_strings[][3]; /* from zap.c */ extern const char *const destroy_strings[][3]; /* from zap.c */
static void mk_trap_statue(xchar, xchar); static void mk_trap_statue(coordxy, coordxy);
static boolean keep_saddle_with_steedcorpse(unsigned, struct obj *, static boolean keep_saddle_with_steedcorpse(unsigned, struct obj *,
struct obj *); struct obj *);
static boolean mu_maybe_destroy_web(struct monst *, boolean, struct trap *); static boolean mu_maybe_destroy_web(struct monst *, boolean, struct trap *);
@@ -41,9 +41,9 @@ static int trapeffect_selector(struct monst *, struct trap *, unsigned);
static char *trapnote(struct trap *, boolean); static char *trapnote(struct trap *, boolean);
static int choose_trapnote(struct trap *); static int choose_trapnote(struct trap *);
static int steedintrap(struct trap *, struct obj *); static int steedintrap(struct trap *, struct obj *);
static void launch_drop_spot(struct obj *, xchar, xchar); static void launch_drop_spot(struct obj *, coordxy, coordxy);
static boolean find_random_launch_coord(struct trap *, coord *); static boolean find_random_launch_coord(struct trap *, coord *);
static int mkroll_launch(struct trap *, xchar, xchar, short, long); static int mkroll_launch(struct trap *, coordxy, coordxy, short, long);
static boolean isclearpath(coord *, int, schar, schar); static boolean isclearpath(coord *, int, schar, schar);
static void dofiretrap(struct obj *); static void dofiretrap(struct obj *);
static void domagictrap(void); static void domagictrap(void);
@@ -346,7 +346,7 @@ grease_protect(
/* create a "living" statue at x,y */ /* create a "living" statue at x,y */
static void static void
mk_trap_statue(xchar x, xchar y) mk_trap_statue(coordxy x, coordxy y)
{ {
struct monst *mtmp; struct monst *mtmp;
struct obj *otmp, *statue; struct obj *otmp, *statue;
@@ -599,8 +599,8 @@ fall_through(
struct monst * struct monst *
animate_statue( animate_statue(
struct obj *statue, struct obj *statue,
xchar x, coordxy x,
xchar y, coordxy y,
int cause, int cause,
int *fail_reason) int *fail_reason)
{ {
@@ -779,8 +779,8 @@ animate_statue(
struct monst * struct monst *
activate_statue_trap( activate_statue_trap(
struct trap *trap, struct trap *trap,
xchar x, coordxy x,
xchar y, coordxy y,
boolean shatter) boolean shatter)
{ {
struct monst *mtmp = (struct monst *) 0; struct monst *mtmp = (struct monst *) 0;
@@ -821,7 +821,7 @@ keep_saddle_with_steedcorpse(
if (mtmp->m_id == steed_mid) { if (mtmp->m_id == steed_mid) {
/* move saddle */ /* move saddle */
xchar x, y; coordxy x, y;
if (get_obj_location(objchn, &x, &y, 0)) { if (get_obj_location(objchn, &x, &y, 0)) {
obj_extract_self(saddle); obj_extract_self(saddle);
place_object(saddle, x, y); place_object(saddle, x, y);
@@ -851,8 +851,8 @@ mu_maybe_destroy_web(
if (amorphous(mptr) || is_whirly(mptr) || flaming(mptr) if (amorphous(mptr) || is_whirly(mptr) || flaming(mptr)
|| unsolid(mptr) || mptr == &mons[PM_GELATINOUS_CUBE]) { || unsolid(mptr) || mptr == &mons[PM_GELATINOUS_CUBE]) {
xchar x = trap->tx; coordxy x = trap->tx;
xchar y = trap->ty; coordxy y = trap->ty;
if (flaming(mptr) || acidic(mptr)) { if (flaming(mptr) || acidic(mptr)) {
if (domsg) { if (domsg) {
@@ -2241,7 +2241,7 @@ trapeffect_landmine(
boolean trapkilled = FALSE; boolean trapkilled = FALSE;
boolean in_sight = canseemon(mtmp) || (mtmp == u.usteed); boolean in_sight = canseemon(mtmp) || (mtmp == u.usteed);
struct permonst *mptr = mtmp->data; struct permonst *mptr = mtmp->data;
xchar tx = trap->tx, ty = trap->ty; coordxy tx = trap->tx, ty = trap->ty;
if (rn2(3)) if (rn2(3))
return Trap_Effect_Finished; /* monsters usually don't set it off */ return Trap_Effect_Finished; /* monsters usually don't set it off */
@@ -2691,7 +2691,7 @@ blow_up_landmine(struct trap* trap)
} }
static void static void
launch_drop_spot(struct obj* obj, xchar x, xchar y) launch_drop_spot(struct obj* obj, coordxy x, coordxy y)
{ {
if (!obj) { if (!obj) {
g.launchplace.obj = (struct obj *) 0; g.launchplace.obj = (struct obj *) 0;
@@ -3038,8 +3038,8 @@ find_random_launch_coord(struct trap *ttmp, coord *cc)
int distance; int distance;
int mindist = 4; int mindist = 4;
int trycount = 0; int trycount = 0;
xchar dx, dy; coordxy dx, dy;
xchar x, y; coordxy x, y;
if (!ttmp || !cc) if (!ttmp || !cc)
return FALSE; return FALSE;
@@ -3092,8 +3092,8 @@ find_random_launch_coord(struct trap *ttmp, coord *cc)
static int static int
mkroll_launch( mkroll_launch(
struct trap *ttmp, struct trap *ttmp,
xchar x, coordxy x,
xchar y, coordxy y,
short otyp, short otyp,
long ocount) long ocount)
{ {
@@ -3134,7 +3134,7 @@ isclearpath(
{ {
struct trap *t; struct trap *t;
uchar typ; uchar typ;
xchar x, y; coordxy x, y;
x = cc->x; x = cc->x;
y = cc->y; y = cc->y;
@@ -3855,8 +3855,8 @@ boolean
fire_damage( fire_damage(
struct obj *obj, struct obj *obj,
boolean force, boolean force,
xchar x, coordxy x,
xchar y) coordxy y)
{ {
int chance; int chance;
struct obj *otmp, *ncobj; struct obj *otmp, *ncobj;
@@ -3947,8 +3947,8 @@ fire_damage_chain(
struct obj *chain, struct obj *chain,
boolean force, boolean force,
boolean here, boolean here,
xchar x, coordxy x,
xchar y) coordxy y)
{ {
struct obj *obj, *nobj; struct obj *obj, *nobj;
int num = 0; int num = 0;
@@ -3970,7 +3970,7 @@ fire_damage_chain(
/* obj has been thrown or dropped into lava; damage is worse than mere fire */ /* obj has been thrown or dropped into lava; damage is worse than mere fire */
boolean boolean
lava_damage(struct obj* obj, xchar x, xchar y) lava_damage(struct obj* obj, coordxy x, coordxy y)
{ {
int otyp = obj->otyp, ocls = obj->oclass; int otyp = obj->otyp, ocls = obj->oclass;
@@ -4212,7 +4212,7 @@ water_damage_chain(
boolean here) boolean here)
{ {
struct obj *otmp; struct obj *otmp;
xchar x, y; coordxy x, y;
if (!obj) if (!obj)
return; return;
@@ -4602,7 +4602,7 @@ static void
move_into_trap(struct trap *ttmp) move_into_trap(struct trap *ttmp)
{ {
int bc = 0; int bc = 0;
xchar x = ttmp->tx, y = ttmp->ty, bx, by, cx, cy; coordxy x = ttmp->tx, y = ttmp->ty, bx, by, cx, cy;
boolean unused; boolean unused;
bx = by = cx = cy = 0; /* lint suppression */ bx = by = cx = cy = 0; /* lint suppression */
@@ -5499,7 +5499,7 @@ chest_trap(
struct monst *shkp = 0; struct monst *shkp = 0;
long loss = 0L; long loss = 0L;
boolean costly, insider; boolean costly, insider;
xchar ox = obj->ox, oy = obj->oy; coordxy ox = obj->ox, oy = obj->oy;
/* the obj location need not be that of player */ /* the obj location need not be that of player */
costly = (costly_spot(ox, oy) costly = (costly_spot(ox, oy)
@@ -6231,7 +6231,7 @@ ignite_items(struct obj* objchn)
} }
void void
trap_ice_effects(xchar x, xchar y, boolean ice_is_melting) trap_ice_effects(coordxy x, coordxy y, boolean ice_is_melting)
{ {
struct trap *ttmp = t_at(x, y); struct trap *ttmp = t_at(x, y);
+8 -8
View File
@@ -10,7 +10,7 @@ static void blackout(int, int);
static void restfakecorr(struct monst *); static void restfakecorr(struct monst *);
static void parkguard(struct monst *); static void parkguard(struct monst *);
static boolean in_fcorridor(struct monst *, int, int); static boolean in_fcorridor(struct monst *, int, int);
static boolean find_guard_dest(struct monst *, xchar *, xchar *); static boolean find_guard_dest(struct monst *, coordxy *, coordxy *);
static void move_gold(struct obj *, int); static void move_gold(struct obj *, int);
static void wallify_vault(struct monst *); static void wallify_vault(struct monst *);
static void gd_mv_monaway(struct monst *, int, int); static void gd_mv_monaway(struct monst *, int, int);
@@ -255,7 +255,7 @@ uleftvault(struct monst *grd)
} }
static boolean static boolean
find_guard_dest(struct monst *guard, xchar *rx, xchar *ry) find_guard_dest(struct monst *guard, coordxy *rx, coordxy *ry)
{ {
register int x, y, dd, lx, ly; register int x, y, dd, lx, ly;
@@ -309,7 +309,7 @@ invault(void)
/* if time ok and no guard now. */ /* if time ok and no guard now. */
char buf[BUFSZ]; char buf[BUFSZ];
int x, y, gx, gy, typ; int x, y, gx, gy, typ;
xchar rx, ry; coordxy rx, ry;
long umoney; long umoney;
/* first find the goal for the guard */ /* first find the goal for the guard */
@@ -535,8 +535,8 @@ invault(void)
dug into an empty doorway (which could subsequently have dug into an empty doorway (which could subsequently have
been plugged with an intact door by use of locking magic) */ been plugged with an intact door by use of locking magic) */
int vlt = EGD(guard)->vroom; int vlt = EGD(guard)->vroom;
xchar lowx = g.rooms[vlt].lx, hix = g.rooms[vlt].hx; coordxy lowx = g.rooms[vlt].lx, hix = g.rooms[vlt].hx;
xchar lowy = g.rooms[vlt].ly, hiy = g.rooms[vlt].hy; coordxy lowy = g.rooms[vlt].ly, hiy = g.rooms[vlt].hy;
if (x == lowx - 1 && y == lowy - 1) if (x == lowx - 1 && y == lowy - 1)
typ = TLCORNER; typ = TLCORNER;
@@ -571,7 +571,7 @@ invault(void)
static void static void
move_gold(struct obj *gold, int vroom) move_gold(struct obj *gold, int vroom)
{ {
xchar nx, ny; coordxy nx, ny;
remove_object(gold); remove_object(gold);
newsym(gold->ox, gold->oy); newsym(gold->ox, gold->oy);
@@ -588,7 +588,7 @@ wallify_vault(struct monst *grd)
int x, y, typ; int x, y, typ;
int vlt = EGD(grd)->vroom; int vlt = EGD(grd)->vroom;
char tmp_viz; char tmp_viz;
xchar lox = g.rooms[vlt].lx - 1, hix = g.rooms[vlt].hx + 1, coordxy lox = g.rooms[vlt].lx - 1, hix = g.rooms[vlt].hx + 1,
loy = g.rooms[vlt].ly - 1, hiy = g.rooms[vlt].hy + 1; loy = g.rooms[vlt].ly - 1, hiy = g.rooms[vlt].hy + 1;
struct monst *mon; struct monst *mon;
struct obj *gold, *rocks; struct obj *gold, *rocks;
@@ -701,7 +701,7 @@ gd_pick_corridor_gold(struct monst *grd, int goldx, int goldy)
gdelta = distu(guardx, guardy); gdelta = distu(guardx, guardy);
if (gdelta > 2 && see_it) { /* skip if player won't see it */ if (gdelta > 2 && see_it) { /* skip if player won't see it */
bestdelta = gdelta; bestdelta = gdelta;
bestcc.x = (xchar) guardx, bestcc.y = (xchar) guardy; bestcc.x = (coordxy) guardx, bestcc.y = (coordxy) guardy;
tryct = 9; tryct = 9;
do { do {
/* pick an available spot nearest the hero and also try /* pick an available spot nearest the hero and also try
+42 -42
View File
@@ -23,7 +23,7 @@
* @...X +4 * @...X +4
* *
*/ */
const xchar circle_data[] = { const coordxy circle_data[] = {
/* 0*/ 0, /* 0*/ 0,
/* 1*/ 1, 1, /* 1*/ 1, 1,
/* 3*/ 2, 2, 1, /* 3*/ 2, 2, 1,
@@ -49,7 +49,7 @@ const xchar circle_data[] = {
* used for a single point: temporary light source of a camera flash * used for a single point: temporary light source of a camera flash
* as it traverses its path. * as it traverses its path.
*/ */
const xchar circle_start[] = { const coordxy circle_start[] = {
/* 0*/ 0, /* 0*/ 0,
/* 1*/ 1, /* 1*/ 1,
/* 2*/ 3, /* 2*/ 3,
@@ -74,26 +74,26 @@ const xchar circle_start[] = {
/*------ local variables ------*/ /*------ local variables ------*/
static xchar could_see[2][ROWNO][COLNO]; /* vision work space */ static coordxy could_see[2][ROWNO][COLNO]; /* vision work space */
static xchar *cs_rows0[ROWNO], *cs_rows1[ROWNO]; static coordxy *cs_rows0[ROWNO], *cs_rows1[ROWNO];
static xchar cs_rmin0[ROWNO], cs_rmax0[ROWNO]; static coordxy cs_rmin0[ROWNO], cs_rmax0[ROWNO];
static xchar cs_rmin1[ROWNO], cs_rmax1[ROWNO]; static coordxy cs_rmin1[ROWNO], cs_rmax1[ROWNO];
static char viz_clear[ROWNO][COLNO]; /* vision clear/blocked map */ static char viz_clear[ROWNO][COLNO]; /* vision clear/blocked map */
static char *viz_clear_rows[ROWNO]; static char *viz_clear_rows[ROWNO];
static xchar left_ptrs[ROWNO][COLNO]; /* LOS algorithm helpers */ static coordxy left_ptrs[ROWNO][COLNO]; /* LOS algorithm helpers */
static xchar right_ptrs[ROWNO][COLNO]; static coordxy right_ptrs[ROWNO][COLNO];
/* Forward declarations. */ /* Forward declarations. */
static void fill_point(int, int); static void fill_point(int, int);
static void dig_point(int, int); static void dig_point(int, int);
static void view_init(void); static void view_init(void);
static void view_from(int, int, xchar **, xchar *, xchar *, int, static void view_from(int, int, coordxy **, coordxy *, coordxy *, int,
void (*)(int, int, genericptr_t), void (*)(int, int, genericptr_t),
genericptr_t); genericptr_t);
static void get_unused_cs(xchar ***, xchar **, xchar **); static void get_unused_cs(coordxy ***, coordxy **, coordxy **);
static void rogue_vision(xchar **, xchar *, xchar *); static void rogue_vision(coordxy **, coordxy *, coordxy *);
/* Macro definitions that I can't find anywhere. */ /* Macro definitions that I can't find anywhere. */
#define sign(z) ((z) < 0 ? -1 : ((z) ? 1 : 0)) #define sign(z) ((z) < 0 ? -1 : ((z) ? 1 : 0))
@@ -265,10 +265,10 @@ vision_reset(void)
* to the unused vision work area. * to the unused vision work area.
*/ */
static void static void
get_unused_cs(xchar ***rows, xchar **rmin, xchar **rmax) get_unused_cs(coordxy ***rows, coordxy **rmin, coordxy **rmax)
{ {
register int row; register int row;
register xchar *nrmin, *nrmax; register coordxy *nrmin, *nrmax;
if (g.viz_array == cs_rows0) { if (g.viz_array == cs_rows0) {
*rows = cs_rows1; *rows = cs_rows1;
@@ -284,7 +284,7 @@ get_unused_cs(xchar ***rows, xchar **rmin, xchar **rmax)
nrmin = *rmin; nrmin = *rmin;
nrmax = *rmax; nrmax = *rmax;
(void) memset((genericptr_t) **rows, 0, sizeof(xchar) * (ROWNO * COLNO)); /* see nothing */ (void) memset((genericptr_t) **rows, 0, sizeof(coordxy) * (ROWNO * COLNO)); /* see nothing */
for (row = 0; row < ROWNO; row++) { /* set row min & max */ for (row = 0; row < ROWNO; row++) { /* set row min & max */
*nrmin++ = COLNO - 1; *nrmin++ = COLNO - 1;
*nrmax++ = 1; *nrmax++ = 1;
@@ -304,7 +304,7 @@ get_unused_cs(xchar ***rows, xchar **rmin, xchar **rmax)
* due to the one-sided lit wall hack. * due to the one-sided lit wall hack.
*/ */
static void static void
rogue_vision(xchar **next, xchar *rmin, xchar *rmax) rogue_vision(coordxy **next, coordxy *rmin, coordxy *rmax)
{ {
int rnum = levl[u.ux][u.uy].roomno - ROOMOFFSET; /* no SHARED... */ int rnum = levl[u.ux][u.uy].roomno - ROOMOFFSET; /* no SHARED... */
int start, stop, in_door, xhi, xlo, yhi, ylo; int start, stop, in_door, xhi, xlo, yhi, ylo;
@@ -506,13 +506,13 @@ vision_recalc(int control)
{ {
extern unsigned char seenv_matrix[3][3]; /* from display.c */ extern unsigned char seenv_matrix[3][3]; /* from display.c */
static unsigned char colbump[COLNO + 1]; /* cols to bump sv */ static unsigned char colbump[COLNO + 1]; /* cols to bump sv */
xchar **temp_array; /* points to the old vision array */ coordxy **temp_array; /* points to the old vision array */
xchar **next_array; /* points to the new vision array */ coordxy **next_array; /* points to the new vision array */
xchar *next_row; /* row pointer for the new array */ coordxy *next_row; /* row pointer for the new array */
xchar *old_row; /* row pointer for the old array */ coordxy *old_row; /* row pointer for the old array */
xchar *next_rmin; /* min pointer for the new array */ coordxy *next_rmin; /* min pointer for the new array */
xchar *next_rmax; /* max pointer for the new array */ coordxy *next_rmax; /* max pointer for the new array */
const xchar *ranges; /* circle ranges -- used for xray & night vision */ const coordxy *ranges; /* circle ranges -- used for xray & night vision */
int row = 0; /* row counter (outer loop) */ int row = 0; /* row counter (outer loop) */
int start, stop; /* inner loop starting/stopping index */ int start, stop; /* inner loop starting/stopping index */
int dx, dy; /* one step from a lit door or lit wall (see below) */ int dx, dy; /* one step from a lit door or lit wall (see below) */
@@ -1109,9 +1109,9 @@ fill_point(int row, int col)
static int start_row; static int start_row;
static int start_col; static int start_col;
static int step; static int step;
static xchar **cs_rows; static coordxy **cs_rows;
static xchar *cs_left; static coordxy *cs_left;
static xchar *cs_right; static coordxy *cs_right;
static void (*vis_func)(int, int, genericptr_t); static void (*vis_func)(int, int, genericptr_t);
static genericptr_t varg; static genericptr_t varg;
@@ -1603,8 +1603,8 @@ clear_path(int col1, int row1, int col2, int row2)
/* /*
* Defines local to Algorithm C. * Defines local to Algorithm C.
*/ */
static void right_side(int, int, int, const xchar *); static void right_side(int, int, int, const coordxy *);
static void left_side(int, int, int, const xchar *); static void left_side(int, int, int, const coordxy *);
/* Initialize algorithm C (nothing). */ /* Initialize algorithm C (nothing). */
static void static void
@@ -1623,7 +1623,7 @@ view_init(void)
* limits points at range limit for current row, or NULL * limits points at range limit for current row, or NULL
*/ */
static void static void
right_side(int row, int left, int right_mark, const xchar *limits) right_side(int row, int left, int right_mark, const coordxy *limits)
{ {
int right; /* right limit of "could see" */ int right; /* right limit of "could see" */
int right_edge; /* right edge of an opening */ int right_edge; /* right edge of an opening */
@@ -1631,9 +1631,9 @@ right_side(int row, int left, int right_mark, const xchar *limits)
int deeper; /* if TRUE, call self as needed */ int deeper; /* if TRUE, call self as needed */
int result; /* set by q?_path() */ int result; /* set by q?_path() */
register int i; /* loop counter */ register int i; /* loop counter */
register xchar *rowp = NULL; /* row optimization */ register coordxy *rowp = NULL; /* row optimization */
xchar *row_min = NULL; /* left most [used by macro set_min()] */ coordxy *row_min = NULL; /* left most [used by macro set_min()] */
xchar *row_max = NULL; /* right most [used by macro set_max()] */ coordxy *row_max = NULL; /* right most [used by macro set_max()] */
int lim_max; /* right most limit of circle */ int lim_max; /* right most limit of circle */
nrow = row + step; nrow = row + step;
@@ -1811,13 +1811,13 @@ right_side(int row, int left, int right_mark, const xchar *limits)
* extensive comments. * extensive comments.
*/ */
static void static void
left_side(int row, int left_mark, int right, const xchar *limits) left_side(int row, int left_mark, int right, const coordxy *limits)
{ {
int left, left_edge, nrow, deeper, result; int left, left_edge, nrow, deeper, result;
register int i; register int i;
register xchar *rowp = NULL; register coordxy *rowp = NULL;
xchar *row_min = NULL; coordxy *row_min = NULL;
xchar *row_max = NULL; coordxy *row_max = NULL;
int lim_min; int lim_min;
#ifdef GCC_WARN #ifdef GCC_WARN
@@ -1954,16 +1954,16 @@ left_side(int row, int left_mark, int right, const xchar *limits)
* arg argument for func * arg argument for func
*/ */
static void static void
view_from(int srow, int scol, xchar **loc_cs_rows, view_from(int srow, int scol, coordxy **loc_cs_rows,
xchar *left_most, xchar *right_most, int range, coordxy *left_most, coordxy *right_most, int range,
void (*func)(int, int, genericptr_t), genericptr_t arg) void (*func)(int, int, genericptr_t), genericptr_t arg)
{ {
register int i; /* loop counter */ register int i; /* loop counter */
xchar *rowp; /* optimization for setting could_see */ coordxy *rowp; /* optimization for setting could_see */
int nrow; /* the next row */ int nrow; /* the next row */
int left; /* the left-most visible column */ int left; /* the left-most visible column */
int right; /* the right-most visible column */ int right; /* the right-most visible column */
const xchar *limits; /* range limit for next row */ const coordxy *limits; /* range limit for next row */
/* Set globals for q?_path(), left_side(), and right_side() to use. */ /* Set globals for q?_path(), left_side(), and right_side() to use. */
start_col = scol; start_col = scol;
@@ -2003,7 +2003,7 @@ view_from(int srow, int scol, xchar **loc_cs_rows,
if (right > scol + range) if (right > scol + range)
right = scol + range; right = scol + range;
} else } else
limits = (xchar *) 0; limits = (coordxy *) 0;
if (func) { if (func) {
for (i = left; i <= right; i++) for (i = left; i <= right; i++)
@@ -2060,12 +2060,12 @@ do_clear_area(int scol, int srow, int range,
{ {
/* If not centered on hero, do the hard work of figuring the area */ /* If not centered on hero, do the hard work of figuring the area */
if (scol != u.ux || srow != u.uy) { if (scol != u.ux || srow != u.uy) {
view_from(srow, scol, (xchar **) 0, (xchar *) 0, (xchar *) 0, range, view_from(srow, scol, (coordxy **) 0, (coordxy *) 0, (coordxy *) 0, range,
func, arg); func, arg);
} else { } else {
register int x; register int x;
int y, min_x, max_x, max_y, offset; int y, min_x, max_x, max_y, offset;
const xchar *limits; const coordxy *limits;
boolean override_vision; boolean override_vision;
/* vision doesn't pass through water or clouds, detection should /* vision doesn't pass through water or clouds, detection should
+2 -2
View File
@@ -511,7 +511,7 @@ static void hup_add_menu(winid, const glyph_info *, const anything *, char,
char, int, int, const char *, unsigned int); char, int, int, const char *, unsigned int);
static void hup_end_menu(winid, const char *); static void hup_end_menu(winid, const char *);
static void hup_putstr(winid, int, const char *); static void hup_putstr(winid, int, const char *);
static void hup_print_glyph(winid, xchar, xchar, const glyph_info *, static void hup_print_glyph(winid, coordxy, coordxy, const glyph_info *,
const glyph_info *); const glyph_info *);
static void hup_outrip(winid, int, time_t); static void hup_outrip(winid, int, time_t);
static void hup_curs(winid, int, int); static void hup_curs(winid, int, int);
@@ -718,7 +718,7 @@ hup_putstr(winid window UNUSED, int attr UNUSED, const char *text UNUSED)
/*ARGSUSED*/ /*ARGSUSED*/
static void static void
hup_print_glyph(winid window UNUSED, hup_print_glyph(winid window UNUSED,
xchar x UNUSED, xchar y UNUSED, coordxy x UNUSED, coordxy y UNUSED,
const glyph_info *glyphinfo UNUSED, const glyph_info *glyphinfo UNUSED,
const glyph_info *bkglyphinfo UNUSED) const glyph_info *bkglyphinfo UNUSED)
{ {
+3 -3
View File
@@ -314,7 +314,7 @@ strategy(struct monst *mtmp)
heal or for guardians (Kops) to congregate at to block hero's progress */ heal or for guardians (Kops) to congregate at to block hero's progress */
void void
choose_stairs( choose_stairs(
xchar *sx, xchar *sy, /* output; left as-is if no spot found */ coordxy *sx, coordxy *sy, /* output; left as-is if no spot found */
boolean dir) /* True: forward, False: backtrack (usually up) */ boolean dir) /* True: forward, False: backtrack (usually up) */
{ {
stairway *stway; stairway *stway;
@@ -353,7 +353,7 @@ int
tactics(struct monst *mtmp) tactics(struct monst *mtmp)
{ {
unsigned long strat = strategy(mtmp); unsigned long strat = strategy(mtmp);
xchar sx = 0, sy = 0, mx, my; coordxy sx = 0, sy = 0, mx, my;
mtmp->mstrategy = mtmp->mstrategy =
(mtmp->mstrategy & (STRAT_WAITMASK | STRAT_APPEARMSG)) | strat; (mtmp->mstrategy & (STRAT_WAITMASK | STRAT_APPEARMSG)) | strat;
@@ -394,7 +394,7 @@ tactics(struct monst *mtmp)
default: /* kill, maim, pillage! */ default: /* kill, maim, pillage! */
{ {
long where = (strat & STRAT_STRATMASK); long where = (strat & STRAT_STRATMASK);
xchar tx = STRAT_GOALX(strat), ty = STRAT_GOALY(strat); coordxy tx = STRAT_GOALX(strat), ty = STRAT_GOALY(strat);
int targ = (int) (strat & STRAT_GOAL); int targ = (int) (strat & STRAT_GOAL);
struct obj *otmp; struct obj *otmp;
+7 -7
View File
@@ -11,7 +11,7 @@
/* worm segment structure */ /* worm segment structure */
struct wseg { struct wseg {
struct wseg *nseg; struct wseg *nseg;
xchar wx, wy; /* the segment's position */ coordxy wx, wy; /* the segment's position */
}; };
static void toss_wsegs(struct wseg *, boolean); static void toss_wsegs(struct wseg *, boolean);
@@ -368,7 +368,7 @@ wormhitu(struct monst *worm)
* that both halves will survive. * that both halves will survive.
*/ */
void void
cutworm(struct monst *worm, xchar x, xchar y, cutworm(struct monst *worm, coordxy x, coordxy y,
boolean cuttier) /* hit is by wielded blade or axe or by thrown axe */ boolean cuttier) /* hit is by wielded blade or axe or by thrown axe */
{ {
struct wseg *curr, *new_tail; struct wseg *curr, *new_tail;
@@ -621,7 +621,7 @@ place_wsegs(struct monst *worm, struct monst *oldworm)
struct wseg *curr = wtails[worm->wormno]; struct wseg *curr = wtails[worm->wormno];
while (curr != wheads[worm->wormno]) { while (curr != wheads[worm->wormno]) {
xchar x = curr->wx, y = curr->wy; coordxy x = curr->wx, y = curr->wy;
struct monst *mtmp = m_at(x, y); struct monst *mtmp = m_at(x, y);
if (oldworm && mtmp == oldworm) if (oldworm && mtmp == oldworm)
@@ -739,7 +739,7 @@ remove_worm(struct monst *worm)
* be, if somehow the head is disjoint from the tail. * be, if somehow the head is disjoint from the tail.
*/ */
void void
place_worm_tail_randomly(struct monst *worm, xchar x, xchar y) place_worm_tail_randomly(struct monst *worm, coordxy x, coordxy y)
{ {
int wnum = worm->wormno; int wnum = worm->wormno;
struct wseg *curr = wtails[wnum]; struct wseg *curr = wtails[wnum];
@@ -810,8 +810,8 @@ place_worm_tail_randomly(struct monst *worm, xchar x, xchar y)
#endif #endif
{ {
place_worm_seg(worm, nx, ny); place_worm_seg(worm, nx, ny);
curr->wx = (xchar) (ox = nx); curr->wx = (coordxy) (ox = nx);
curr->wy = (xchar) (oy = ny); curr->wy = (coordxy) (oy = ny);
wtails[wnum] = curr; wtails[wnum] = curr;
curr = curr->nseg; curr = curr->nseg;
wtails[wnum]->nseg = new_tail; wtails[wnum]->nseg = new_tail;
@@ -985,7 +985,7 @@ wseg_at(struct monst *worm, int x, int y)
if (worm && worm->wormno && m_at(x, y) == worm) { if (worm && worm->wormno && m_at(x, y) == worm) {
struct wseg *curr; struct wseg *curr;
int i, n; int i, n;
xchar wx = (xchar) x, wy = (xchar) y; coordxy wx = (coordxy) x, wy = (coordxy) y;
for (i = 0, curr = wtails[worm->wormno]; curr; curr = curr->nseg) { for (i = 0, curr = wtails[worm->wormno]; curr; curr = curr->nseg) {
if (curr->wx == wx && curr->wy == wy) if (curr->wx == wx && curr->wy == wy)
+22 -22
View File
@@ -13,12 +13,12 @@
#define MAGIC_COOKIE 1000 #define MAGIC_COOKIE 1000
static void probe_objchain(struct obj *); static void probe_objchain(struct obj *);
static boolean zombie_can_dig(xchar x, xchar y); static boolean zombie_can_dig(coordxy x, coordxy y);
static void polyuse(struct obj *, int, int); static void polyuse(struct obj *, int, int);
static void create_polymon(struct obj *, int); static void create_polymon(struct obj *, int);
static int stone_to_flesh_obj(struct obj *); static int stone_to_flesh_obj(struct obj *);
static boolean zap_updown(struct obj *); static boolean zap_updown(struct obj *);
static void zhitu(int, int, const char *, xchar, xchar); static void zhitu(int, int, const char *, coordxy, coordxy);
static void revive_egg(struct obj *); static void revive_egg(struct obj *);
static boolean zap_steed(struct obj *); static boolean zap_steed(struct obj *);
static void skiprange(int, int *, int *); static void skiprange(int, int *, int *);
@@ -560,7 +560,7 @@ probe_monster(struct monst *mtmp)
boolean boolean
get_obj_location( get_obj_location(
struct obj *obj, struct obj *obj,
xchar *xp, xchar *yp, coordxy *xp, coordxy *yp,
int locflags) int locflags)
{ {
switch (obj->where) { switch (obj->where) {
@@ -598,7 +598,7 @@ get_obj_location(
boolean boolean
get_mon_location( get_mon_location(
struct monst *mon, struct monst *mon,
xchar *xp, xchar *yp, coordxy *xp, coordxy *yp,
int locflags) /* non-zero means get location even if monster is buried */ int locflags) /* non-zero means get location even if monster is buried */
{ {
if (mon == &g.youmonst || (u.usteed && mon == u.usteed)) { if (mon == &g.youmonst || (u.usteed && mon == u.usteed)) {
@@ -767,7 +767,7 @@ get_container_location(
/* can zombie dig the location at x,y */ /* can zombie dig the location at x,y */
static boolean static boolean
zombie_can_dig(xchar x, xchar y) zombie_can_dig(coordxy x, coordxy y)
{ {
if (isok(x, y)) { if (isok(x, y)) {
schar typ = levl[x][y].typ; schar typ = levl[x][y].typ;
@@ -794,7 +794,7 @@ revive(struct obj *corpse, boolean by_hero)
struct permonst *mptr; struct permonst *mptr;
struct obj *container; struct obj *container;
coord xy; coord xy;
xchar x, y; coordxy x, y;
boolean one_of; boolean one_of;
mmflags_nht mmflags = NO_MINVENT | MM_NOWAIT | MM_NOMSG; mmflags_nht mmflags = NO_MINVENT | MM_NOWAIT | MM_NOMSG;
int montype, cgend, container_nesting = 0; int montype, cgend, container_nesting = 0;
@@ -1584,7 +1584,7 @@ struct obj *
poly_obj(struct obj *obj, int id) poly_obj(struct obj *obj, int id)
{ {
struct obj *otmp; struct obj *otmp;
xchar ox = 0, oy = 0; coordxy ox = 0, oy = 0;
long old_wornmask, new_wornmask = 0L; long old_wornmask, new_wornmask = 0L;
boolean can_merge = (id == STRANGE_OBJECT); boolean can_merge = (id == STRANGE_OBJECT);
int obj_location = obj->where; int obj_location = obj->where;
@@ -1856,7 +1856,7 @@ stone_to_flesh_obj(struct obj *obj)
struct permonst *ptr; struct permonst *ptr;
struct monst *mon, *shkp; struct monst *mon, *shkp;
struct obj *item; struct obj *item;
xchar oox, ooy; coordxy oox, ooy;
boolean smell = FALSE, golem_xform = FALSE; boolean smell = FALSE, golem_xform = FALSE;
if (objects[obj->otyp].oc_material != MINERAL if (objects[obj->otyp].oc_material != MINERAL
@@ -2171,7 +2171,7 @@ bhito(struct obj *obj, struct obj *otmp)
revive_egg(obj); revive_egg(obj);
} else if (obj->otyp == CORPSE) { } else if (obj->otyp == CORPSE) {
struct monst *mtmp; struct monst *mtmp;
xchar ox, oy; coordxy ox, oy;
unsigned save_norevive; unsigned save_norevive;
boolean by_u = !g.context.mon_moving; boolean by_u = !g.context.mon_moving;
int corpsenm = corpse_revive_type(obj); int corpsenm = corpse_revive_type(obj);
@@ -3131,7 +3131,7 @@ zap_updown(struct obj *obj) /* wand or spell */
case WAN_POLYMORPH: case WAN_POLYMORPH:
case SPE_POLYMORPH: case SPE_POLYMORPH:
del_engr(e); del_engr(e);
make_engr_at(x, y, random_engraving(buf), g.moves, (xchar) 0); make_engr_at(x, y, random_engraving(buf), g.moves, (coordxy) 0);
break; break;
case WAN_CANCELLATION: case WAN_CANCELLATION:
case SPE_CANCELLATION: case SPE_CANCELLATION:
@@ -3374,7 +3374,7 @@ maybe_explode_trap(struct trap *ttmp, struct obj *otmp)
if (!ttmp || !otmp) if (!ttmp || !otmp)
return; return;
if (otmp->otyp == WAN_CANCELLATION || otmp->otyp == SPE_CANCELLATION) { if (otmp->otyp == WAN_CANCELLATION || otmp->otyp == SPE_CANCELLATION) {
xchar x = ttmp->tx, y = ttmp->ty; coordxy x = ttmp->tx, y = ttmp->ty;
if (undestroyable_trap(ttmp->ttyp)) { if (undestroyable_trap(ttmp->ttyp)) {
shieldeff(x, y); shieldeff(x, y);
@@ -3989,7 +3989,7 @@ zhitm(
} }
static void static void
zhitu(int type, int nd, const char *fltxt, xchar sx, xchar sy) zhitu(int type, int nd, const char *fltxt, coordxy sx, coordxy sy)
{ {
int dam = 0, abstyp = abs(type); int dam = 0, abstyp = abs(type);
@@ -4254,7 +4254,7 @@ disintegrate_mon(struct monst *mon,
} }
void void
buzz(int type, int nd, xchar sx, xchar sy, int dx, int dy) buzz(int type, int nd, coordxy sx, coordxy sy, int dx, int dy)
{ {
dobuzz(type, nd, sx, sy, dx, dy, TRUE); dobuzz(type, nd, sx, sy, dx, dy, TRUE);
} }
@@ -4272,12 +4272,12 @@ void
dobuzz( dobuzz(
int type, int type,
int nd, int nd,
xchar sx, xchar sy, coordxy sx, coordxy sy,
int dx, int dy, int dx, int dy,
boolean say) /* announce out of sight hit/miss events if true */ boolean say) /* announce out of sight hit/miss events if true */
{ {
int range, abstype = abs(type) % 10; int range, abstype = abs(type) % 10;
register xchar lsx, lsy; register coordxy lsx, lsy;
struct monst *mon; struct monst *mon;
coord save_bhitpos; coord save_bhitpos;
boolean shopdamage = FALSE; boolean shopdamage = FALSE;
@@ -4546,7 +4546,7 @@ dobuzz(
} }
void void
melt_ice(xchar x, xchar y, const char *msg) melt_ice(coordxy x, coordxy y, const char *msg)
{ {
struct rm *lev = &levl[x][y]; struct rm *lev = &levl[x][y];
struct obj *otmp; struct obj *otmp;
@@ -4594,7 +4594,7 @@ melt_ice(xchar x, xchar y, const char *msg)
* permanent instead. * permanent instead.
*/ */
void void
start_melt_ice_timeout(xchar x, xchar y, start_melt_ice_timeout(coordxy x, coordxy y,
long min_time) /* <x,y>'s old melt timeout (deleted by long min_time) /* <x,y>'s old melt timeout (deleted by
time we get here) */ time we get here) */
{ {
@@ -4627,14 +4627,14 @@ start_melt_ice_timeout(xchar x, xchar y,
void void
melt_ice_away(anything *arg, long timeout UNUSED) melt_ice_away(anything *arg, long timeout UNUSED)
{ {
xchar x, y; coordxy x, y;
long where = arg->a_long; long where = arg->a_long;
boolean save_mon_moving = g.context.mon_moving; /* will be False */ boolean save_mon_moving = g.context.mon_moving; /* will be False */
/* melt_ice -> minliquid -> mondead|xkilled shouldn't credit/blame hero */ /* melt_ice -> minliquid -> mondead|xkilled shouldn't credit/blame hero */
g.context.mon_moving = TRUE; /* hero isn't causing this ice to melt */ g.context.mon_moving = TRUE; /* hero isn't causing this ice to melt */
y = (xchar) (where & 0xFFFF); y = (coordxy) (where & 0xFFFF);
x = (xchar) ((where >> 16) & 0xFFFF); x = (coordxy) ((where >> 16) & 0xFFFF);
/* melt_ice does newsym when appropriate */ /* melt_ice does newsym when appropriate */
melt_ice(x, y, "Some ice melts away."); melt_ice(x, y, "Some ice melts away.");
g.context.mon_moving = save_mon_moving; g.context.mon_moving = save_mon_moving;
@@ -4647,7 +4647,7 @@ melt_ice_away(anything *arg, long timeout UNUSED)
*/ */
int int
zap_over_floor( zap_over_floor(
xchar x, xchar y, /* location */ coordxy x, coordxy y, /* location */
int type, /* damage type plus {wand|spell|breath} info */ int type, /* damage type plus {wand|spell|breath} info */
boolean *shopdamage, /* extra output if shop door is destroyed */ boolean *shopdamage, /* extra output if shop door is destroyed */
short exploding_wand_typ) /* supplied when breaking a wand; or POT_OIL short exploding_wand_typ) /* supplied when breaking a wand; or POT_OIL
@@ -4977,7 +4977,7 @@ zap_over_floor(
void void
fracture_rock(struct obj *obj) /* no texts here! */ fracture_rock(struct obj *obj) /* no texts here! */
{ {
xchar x, y; coordxy x, y;
boolean by_you = !g.context.mon_moving; boolean by_you = !g.context.mon_moving;
if (by_you && get_obj_location(obj, &x, &y, 0) && costly_spot(x, y)) { if (by_you && get_obj_location(obj, &x, &y, 0) && costly_spot(x, y)) {
+3 -3
View File
@@ -208,7 +208,7 @@ restore_savefile(char *basename)
{ {
int gfd, lfd, sfd; int gfd, lfd, sfd;
int res = 0, lev, savelev, hpid, pltmpsiz, filecmc; int res = 0, lev, savelev, hpid, pltmpsiz, filecmc;
xchar levc; coordxy levc;
struct version_info version_data; struct version_info version_data;
struct savefile_info sfi; struct savefile_info sfi;
char plbuf[PL_NSIZ], indicator; char plbuf[PL_NSIZ], indicator;
@@ -345,14 +345,14 @@ restore_savefile(char *basename)
(void) unlink(lock); (void) unlink(lock);
for (lev = 1; lev < 256 && res == 0; lev++) { for (lev = 1; lev < 256 && res == 0; lev++) {
/* level numbers are kept in xchars in save.c, so the /* level numbers are kept in coordxys in save.c, so the
* maximum level number (for the endlevel) must be < 256 * maximum level number (for the endlevel) must be < 256
*/ */
if (lev != savelev) { if (lev != savelev) {
lfd = open_levelfile(lev); lfd = open_levelfile(lev);
if (lfd >= 0) { if (lfd >= 0) {
/* any or all of these may not exist */ /* any or all of these may not exist */
levc = (xchar) lev; levc = (coordxy) lev;
if (write(sfd, (genericptr_t) &levc, sizeof levc) if (write(sfd, (genericptr_t) &levc, sizeof levc)
!= sizeof levc) != sizeof levc)
res = -1; res = -1;
+2 -2
View File
@@ -522,7 +522,7 @@ void NetHackQtBind::qt_cliparound_window(winid wid, int x, int y)
} }
void NetHackQtBind::qt_print_glyph( void NetHackQtBind::qt_print_glyph(
winid wid, xchar x, xchar y, winid wid, coordxy x, coordxy y,
const glyph_info *glyphinfo, const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo UNUSED) const glyph_info *bkglyphinfo UNUSED)
{ {
@@ -533,7 +533,7 @@ void NetHackQtBind::qt_print_glyph(
#if 0 #if 0
void NetHackQtBind::qt_print_glyph_compose( void NetHackQtBind::qt_print_glyph_compose(
winid wid, xchar x, xchar y, int glyph1, int glyph2) winid wid, coordxy x, coordxy y, int glyph1, int glyph2)
{ {
NetHackQtWindow *window = id_to_window[(int) wid]; NetHackQtWindow *window = id_to_window[(int) wid];
window->PrintGlyphCompose(x, y, glyph1, glyph2); window->PrintGlyphCompose(x, y, glyph1, glyph2);
+1 -1
View File
@@ -63,7 +63,7 @@ public:
static void qt_cliparound(int x, int y); static void qt_cliparound(int x, int y);
static void qt_cliparound_window(winid wid, int x, int y); static void qt_cliparound_window(winid wid, int x, int y);
static void qt_print_glyph(winid wid, xchar x, xchar y, static void qt_print_glyph(winid wid, coordxy x, coordxy y,
const glyph_info *glyphingo, const glyph_info *glyphingo,
const glyph_info *bkglyphinfo); const glyph_info *bkglyphinfo);
static void qt_raw_print(const char *str); static void qt_raw_print(const char *str);
+2 -2
View File
@@ -73,7 +73,7 @@ static void display_cursor(struct xwindow *);
void void
X11_print_glyph( X11_print_glyph(
winid window, winid window,
xchar x, xchar y, coordxy x, coordxy y,
const glyph_info *glyphinfo, const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo UNUSED) const glyph_info *bkglyphinfo UNUSED)
{ {
@@ -894,7 +894,7 @@ display_map_window(struct xwindow *wp)
check_cursor_visibility(wp); check_cursor_visibility(wp);
highlight_yn(TRUE); /* change fg/bg to match map */ highlight_yn(TRUE); /* change fg/bg to match map */
} else if (wp->prevx != wp->cursx || wp->prevy != wp->cursy) { } else if (wp->prevx != wp->cursx || wp->prevy != wp->cursy) {
register xchar x = wp->prevx, y = wp->prevy; register coordxy x = wp->prevx, y = wp->prevy;
/* /*
* Previous cursor position is not the same as the current * Previous cursor position is not the same as the current
+3 -3
View File
@@ -37,7 +37,7 @@ void chainin_cliparound(int, int);
#ifdef POSITIONBAR #ifdef POSITIONBAR
void chainin_update_positionbar(char *); void chainin_update_positionbar(char *);
#endif #endif
void chainin_print_glyph(winid, xchar, xchar, void chainin_print_glyph(winid, coordxy, coordxy,
const glyph_info *, const glyph_info *); const glyph_info *, const glyph_info *);
void chainin_raw_print(const char *); void chainin_raw_print(const char *);
void chainin_raw_print_bold(const char *); void chainin_raw_print_bold(const char *);
@@ -345,8 +345,8 @@ chainin_update_positionbar(char *posbar)
void void
chainin_print_glyph( chainin_print_glyph(
winid window, winid window,
xchar x, coordxy x,
xchar y, coordxy y,
const glyph_info *glyphinfo, const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo) const glyph_info *bkglyphinfo)
{ {
+3 -3
View File
@@ -37,7 +37,7 @@ void chainout_cliparound(void *,int, int);
#ifdef POSITIONBAR #ifdef POSITIONBAR
void chainout_update_positionbar(void *,char *); void chainout_update_positionbar(void *,char *);
#endif #endif
void chainout_print_glyph(void *,winid, xchar, xchar, void chainout_print_glyph(void *,winid, coordxy, coordxy,
const glyph_info *, const glyph_info *); const glyph_info *, const glyph_info *);
void chainout_raw_print(void *,const char *); void chainout_raw_print(void *,const char *);
void chainout_raw_print_bold(void *,const char *); void chainout_raw_print_bold(void *,const char *);
@@ -404,8 +404,8 @@ void
chainout_print_glyph( chainout_print_glyph(
void *vp, void *vp,
winid window, winid window,
xchar x, coordxy x,
xchar y, coordxy y,
const glyph_info *glyphinfo, const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo) const glyph_info *bkglyphinfo)
{ {
+3 -3
View File
@@ -64,7 +64,7 @@ void trace_cliparound(void *,int, int);
#ifdef POSITIONBAR #ifdef POSITIONBAR
void trace_update_positionbar(void *,char *); void trace_update_positionbar(void *,char *);
#endif #endif
void trace_print_glyph(void *,winid, xchar, xchar, void trace_print_glyph(void *,winid, coordxy, coordxy,
const glyph_info *, const glyph_info *); const glyph_info *, const glyph_info *);
void trace_raw_print(void *,const char *); void trace_raw_print(void *,const char *);
void trace_raw_print_bold(void *,const char *); void trace_raw_print_bold(void *,const char *);
@@ -645,8 +645,8 @@ void
trace_print_glyph( trace_print_glyph(
void *vp, void *vp,
winid window, winid window,
xchar x, coordxy x,
xchar y, coordxy y,
const glyph_info *glyphinfo, const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo) const glyph_info *bkglyphinfo)
{ {
+1 -1
View File
@@ -771,7 +771,7 @@ print_glyph(window, x, y, glyphinfo, bkglyphinfo)
*/ */
void void
curses_print_glyph(winid wid, xchar x, xchar y, curses_print_glyph(winid wid, coordxy x, coordxy y,
const glyph_info *glyphinfo, const glyph_info *bkglyphinfo UNUSED) const glyph_info *glyphinfo, const glyph_info *bkglyphinfo UNUSED)
{ {
int glyph; int glyph;
+2 -2
View File
@@ -289,7 +289,7 @@ draw_horizontal(boolean border)
blPAD, blPAD, blPAD, blPAD } blPAD, blPAD, blPAD, blPAD }
}; };
const enum statusfields (*fieldorder)[15]; const enum statusfields (*fieldorder)[15];
xchar spacing[MAXBLSTATS], valline[MAXBLSTATS]; coordxy spacing[MAXBLSTATS], valline[MAXBLSTATS];
enum statusfields fld, prev_fld; enum statusfields fld, prev_fld;
char *text, *p, cbuf[BUFSZ], ebuf[STATVAL_WIDTH]; char *text, *p, cbuf[BUFSZ], ebuf[STATVAL_WIDTH];
#ifdef SCORE_ON_BOTL #ifdef SCORE_ON_BOTL
@@ -690,7 +690,7 @@ draw_vertical(boolean border)
BL_STR, BL_SCORE, BL_TIME, BL_LEVELDESC, BL_HP, BL_STR, BL_SCORE, BL_TIME, BL_LEVELDESC, BL_HP,
BL_CONDITION, BL_CAP, BL_HUNGER BL_CONDITION, BL_CAP, BL_HUNGER
}; };
xchar spacing[MAXBLSTATS]; coordxy spacing[MAXBLSTATS];
int i, fld, cap_and_hunger, time_and_score, cond_count, per_line; int i, fld, cap_and_hunger, time_and_score, cond_count, per_line;
char *text; char *text;
#ifdef STATUS_HILITES #ifdef STATUS_HILITES
+2 -2
View File
@@ -298,8 +298,8 @@ safe_cliparound(int x, int y)
void void
safe_print_glyph( safe_print_glyph(
winid window UNUSED, winid window UNUSED,
xchar x UNUSED, coordxy x UNUSED,
xchar y UNUSED, coordxy y UNUSED,
const glyph_info *glyphinfo UNUSED, const glyph_info *glyphinfo UNUSED,
const glyph_info *bkglyphinfo UNUSED) const glyph_info *bkglyphinfo UNUSED)
{ {
+1 -1
View File
@@ -141,7 +141,7 @@ VDECLCB(shim_mark_synch,(void), "v")
VDECLCB(shim_wait_synch,(void), "v") VDECLCB(shim_wait_synch,(void), "v")
VDECLCB(shim_cliparound,(int x, int y), "vii", A2P x, A2P y) VDECLCB(shim_cliparound,(int x, int y), "vii", A2P x, A2P y)
VDECLCB(shim_update_positionbar,(char *posbar), "vp", P2V posbar) VDECLCB(shim_update_positionbar,(char *posbar), "vp", P2V posbar)
VDECLCB(shim_print_glyph,(winid w, xchar x, xchar y, const glyph_info *glyphinfo, const glyph_info *bkglyphinfo), "viiipp", A2P w, A2P x, A2P y, P2V glyphinfo, P2V bkglyphinfo) VDECLCB(shim_print_glyph,(winid w, coordxy x, coordxy y, const glyph_info *glyphinfo, const glyph_info *bkglyphinfo), "viiipp", A2P w, A2P x, A2P y, P2V glyphinfo, P2V bkglyphinfo)
VDECLCB(shim_raw_print,(const char *str), "vs", P2V str) VDECLCB(shim_raw_print,(const char *str), "vs", P2V str)
VDECLCB(shim_raw_print_bold,(const char *str), "vs", P2V str) VDECLCB(shim_raw_print_bold,(const char *str), "vs", P2V str)
DECLCB(int, shim_nhgetch,(void), "i") DECLCB(int, shim_nhgetch,(void), "i")

Some files were not shown because too many files have changed in this diff Show More