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:
@@ -19,7 +19,7 @@ static void map_monst(struct monst *, boolean);
|
||||
static void do_dknown_of(struct obj *);
|
||||
static boolean check_map_spot(int, int, 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 void display_trap_map(struct trap *, int);
|
||||
static int furniture_detect(void);
|
||||
@@ -837,7 +837,7 @@ monster_detect(struct obj *otmp, /* detecting object (if any) */
|
||||
}
|
||||
|
||||
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) {
|
||||
struct obj obj; /* fake object */
|
||||
@@ -885,7 +885,7 @@ detect_obj_traps(
|
||||
int how) /* 1 for misleading map feedback */
|
||||
{
|
||||
struct obj *otmp;
|
||||
xchar x, y;
|
||||
coordxy x, y;
|
||||
int result = OTRAP_NONE;
|
||||
|
||||
/*
|
||||
@@ -1776,7 +1776,7 @@ mfind0(struct monst *mtmp, boolean via_warning)
|
||||
int
|
||||
dosearch0(int aflag) /* intrinsic autosearch vs explicit searching */
|
||||
{
|
||||
xchar x, y;
|
||||
coordxy x, y;
|
||||
register struct trap *trap;
|
||||
register struct monst *mtmp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user