More globals moved to instance_globals.

This commit is contained in:
Bart House
2018-11-24 17:59:16 -08:00
parent 3645e415e3
commit ff5fe26e72
11 changed files with 233 additions and 227 deletions

View File

@@ -96,7 +96,36 @@ enum hlattribs { HL_UNDEF = 0x00,
HL_ULINE = 0x08,
HL_BLINK = 0x10,
HL_DIM = 0x20 };
/* #endif STATUS_HILITES */
#ifdef STATUS_HILITES
struct hilite_s {
enum statusfields fld;
boolean set;
unsigned anytype;
anything value;
int behavior;
char textmatch[QBUFSZ];
enum relationships rel;
int coloridx;
struct hilite_s *next;
};
#endif
struct istat_s {
const char *fldname;
const char *fldfmt;
long time; /* moves when this field hilite times out */
boolean chg; /* need to recalc time? */
unsigned anytype;
anything a;
char *val;
int valwidth;
enum statusfields idxmax;
enum statusfields fld;
#ifdef STATUS_HILITES
struct hilite_s *thresholds;
#endif
};
extern const char *status_fieldnames[]; /* in botl.c */

View File

@@ -545,6 +545,13 @@ struct xlock_s {
boolean magic_key;
};
struct trapinfo {
struct obj *tobj;
xchar tx, ty;
int time_needed;
boolean force_bungle;
};
/* instance_globals holds engine state that does not need to be
* persisted upon game exit. The initialization state is well defined
* an set in decl.c during early early engine initialization.
@@ -559,6 +566,7 @@ struct instance_globals {
int jumping_is_magic; /* current jump result of magic */
int polearm_range_min;
int polearm_range_max;
struct trapinfo trapinfo;
/* artifcat.c */
int spec_dbon_applies; /* coordinate effects from spec_dbon() with
@@ -567,9 +575,16 @@ struct instance_globals {
boolean artiexist[1 + NROFARTIFACTS + 1];
/* and a discovery list for them (no dummy first entry here) */
xchar artidisco[NROFARTIFACTS];
int mkot_trap_warn_count;
/* botl.c */
int mrank_sz; /* loaded by max_rank_sz */
struct istat_s blstats[2][MAXBLSTATS];
boolean blinit;
boolean update_all;
boolean valset[MAXBLSTATS];
long bl_hilite_moves;
unsigned long cond_hilites[BL_ATTCLR_MAX];
/* cmd.c */
struct cmd Cmd; /* flag.h */
@@ -690,6 +705,9 @@ struct instance_globals {
* baalz level */
boolean was_waterlevel; /* ugh... this shouldn't be needed */
/* mon.c */
boolean vamp_rise_msg;
boolean disintegested;
/* muse.c */
boolean m_using; /* kludge to use mondided instead of killed */

View File

@@ -197,6 +197,7 @@ typedef struct {
#include "wintype.h"
#include "context.h"
#include "rm.h"
#include "botl.h"
/* Symbol offsets */
#define SYM_OFF_P (0)