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:
@@ -57,7 +57,7 @@ struct arti_info {
|
||||
static struct arti_info artiexist[1 + NROFARTIFACTS];
|
||||
/* discovery list; for N discovered artifacts, the first N entries are ART_xx
|
||||
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
|
||||
* 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
|
||||
@@ -1001,7 +1001,7 @@ spec_dbon(struct obj *otmp, struct monst *mon, int tmp)
|
||||
|
||||
/* add identified artifact to discoveries list */
|
||||
void
|
||||
discover_artifact(xchar m)
|
||||
discover_artifact(xint16 m)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1019,7 +1019,7 @@ discover_artifact(xchar m)
|
||||
|
||||
/* used to decide whether an artifact has been fully identified */
|
||||
boolean
|
||||
undiscovered_artifact(xchar m)
|
||||
undiscovered_artifact(xint16 m)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user