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

View File

@@ -70,7 +70,7 @@ struct engrave_info {
the possible mutations of this */
char *nextc; /* next character(s) in text[] to engrave */
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 */
int actionct; /* nth turn spent engraving */
};
@@ -104,7 +104,7 @@ struct tribute_info {
struct novel_tracking { /* for choosing random passage when reading novel */
unsigned id; /* novel oid from previous passage selection */
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;
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