Another round of instance globals changes.

This commit is contained in:
Bart House
2018-12-24 16:43:50 -08:00
parent e5e906dc3b
commit 572ee347b9
78 changed files with 946 additions and 975 deletions

View File

@@ -103,7 +103,6 @@ E struct dgn_topology { /* special dungeon levels for speed */
E NEARDATA char tune[6];
#define MAXLINFO (MAXDUNGEON * MAXLEVEL)
E struct linfo level_info[MAXLINFO];
E NEARDATA struct sinfo {
int gameover; /* self explanatory? */
@@ -144,11 +143,6 @@ E NEARDATA struct kinfo {
char name[BUFSZ]; /* actual killer name */
} killer;
E NEARDATA char dogname[];
E NEARDATA char catname[];
E NEARDATA char horsename[];
E char preferred_pet;
E char lock[];
E const schar xdir[], ydir[], zdir[];
@@ -162,12 +156,9 @@ struct multishot {
E NEARDATA long moves, monstermoves;
E NEARDATA long wailmsg;
E NEARDATA boolean in_steed_dismounting;
E const int shield_static[];
#include "spell.h"
E NEARDATA struct spell spl_book[]; /* sized in decl.c */
#include "color.h"
#ifdef TEXTCOLOR
@@ -188,7 +179,6 @@ E NEARDATA struct obj *uchain; /* defined only when punished */
E NEARDATA struct obj *uball;
E NEARDATA struct obj *migrating_objs;
E NEARDATA struct obj *billobjs;
E NEARDATA struct obj *current_wand, *thrownobj, *kickedobj;
E NEARDATA struct obj zeroobj; /* for init; &zeroobj used as special value */
@@ -206,13 +196,12 @@ E NEARDATA struct u_realtime urealtime;
E NEARDATA struct monst zeromonst; /* for init of new or temp monsters */
E NEARDATA struct monst youmonst; /* monster details when hero is poly'd */
E NEARDATA struct monst *mydogs, *migrating_mons;
E NEARDATA struct mvitals {
struct mvitals {
uchar born;
uchar died;
uchar mvflags;
} mvitals[NUMMONS];
};
E NEARDATA struct c_color_names {
const char *const c_black, *const c_amber, *const c_golden,
@@ -268,10 +257,6 @@ E const char *materialnm[];
#define EXACT_NAME 0x0F
#define SUPPRESS_NAME 0x10
/* Vision */
E NEARDATA boolean vision_full_recalc; /* TRUE if need vision recalc */
E NEARDATA char **viz_array; /* could see/in sight row pointers */
/* Window system stuff */
E NEARDATA winid WIN_MESSAGE;
E NEARDATA winid WIN_STATUS;
@@ -286,7 +271,6 @@ E NEARDATA winid WIN_MAP, WIN_INVEN;
#define Sprintf1(buf, cstr) Sprintf(buf, "%s", cstr)
#define panic1(cstr) panic("%s", cstr)
E char toplines[];
#ifndef TCAP_H
E struct tc_gbl_data { /* also declared in tcap.h */
char *tc_AS, *tc_AE; /* graphics start and end (tty font swapping) */
@@ -365,8 +349,6 @@ struct plinemsg_type {
/* bitmask for callers of hide_unhide_msgtypes() */
#define MSGTYP_MASK_REP_SHOW ((1 << MSGTYP_NOREP) | (1 << MSGTYP_NOSHOW))
E struct plinemsg_type *plinemsg_types;
#ifdef PANICTRACE
E const char *ARGV0;
#endif
@@ -689,6 +671,24 @@ struct instance_globals {
boolean stoned; /* done to monsters hit by 'c' */
boolean unweapon;
boolean mrg_to_wielded; /* weapon picked is merged with wielded one */
struct plinemsg_type *plinemsg_types;
char toplines[TBUFSZ];
struct mkroom *upstairs_room;
struct mkroom *dnstairs_room;
struct mkroom *sstairs_room;
coord bhitpos; /* place where throw or zap hits or stops */
boolean in_steed_dismounting;
coord doors[DOORMAX];
struct menucoloring *menu_colorings;
schar lastseentyp[COLNO][ROWNO]; /* last seen/touched dungeon typ */
struct spell spl_book[MAXSPELL + 1];
struct linfo level_info[MAXLINFO];
struct trap *ftrap;
/* some objects need special handling during destruction or placement */
struct obj *current_wand; /* wand currently zapped/applied */
struct obj *thrownobj; /* object in flight due to throwing */
struct obj *kickedobj; /* object in flight due to kicking */
/* dig.c */
@@ -721,6 +721,13 @@ struct instance_globals {
xchar gtyp; /* type of dog's current goal */
xchar gx; /* x position of dog's current goal */
char gy; /* y position of dog's current goal */
char dogname[PL_PSIZ];
char catname[PL_PSIZ];
char horsename[PL_PSIZ];
char preferred_pet; /* '\0', 'c', 'd', 'n' (none) */
struct monst *mydogs; /* monsters that went down/up together with @ */
struct monst *migrating_mons; /* monsters moving to another level */
struct mvitals mvitals[NUMMONS];
/* dokick.c */
struct rm *maploc;
@@ -975,7 +982,7 @@ struct instance_globals {
/* spells.c */
int spl_sortmode; /* index into spl_sortchoices[] */
int *spl_orderindx; /* array of spl_book[] indices */
int *spl_orderindx; /* array of g.spl_book[] indices */
/* timeout.c */
/* ordered timer list */
@@ -1010,6 +1017,12 @@ struct instance_globals {
boolean override_confirmation; /* Used to flag attacks caused by
Stormbringer's maliciousness. */
/* vision.c */
char **viz_array; /* used in cansee() and couldsee() macros */
char *viz_rmin; /* min could see indices */
char *viz_rmax; /* max could see indices */
boolean vision_full_recalc;
/* weapon.c */
struct obj *propellor;

View File

@@ -322,7 +322,7 @@ struct savefile_info {
#define BUFSZ 256 /* for getlin buffers */
#define QBUFSZ 128 /* for building question text */
#define TBUFSZ 300 /* toplines[] buffer max msg: 3 81char names */
#define TBUFSZ 300 /* g.toplines[] buffer max msg: 3 81char names */
/* plus longest prefix plus a few extra words */
#define PL_NSIZ 32 /* name of player, ghost, shopkeeper */

View File

@@ -214,8 +214,6 @@ typedef struct {
#include "decl.h"
#include "timeout.h"
NEARDATA extern coord bhitpos; /* place where throw or zap hits or stops */
/* types of calls to bhit() */
enum bhit_call_types {
ZAPPED_WAND = 0,
@@ -357,7 +355,7 @@ typedef struct sortloot_item Loot;
/* Flags to control find_mid() */
#define FM_FMON 0x01 /* search the fmon chain */
#define FM_MIGRATE 0x02 /* search the migrating monster chain */
#define FM_MYDOGS 0x04 /* search mydogs */
#define FM_MYDOGS 0x04 /* search g.mydogs */
#define FM_EVERYWHERE (FM_FMON | FM_MIGRATE | FM_MYDOGS)
/* Flags to control pick_[race,role,gend,align] routines in role.c */

View File

@@ -47,10 +47,6 @@ extern NEARDATA struct mkroom *subrooms;
* there is at most one non-vault special room on a level
*/
extern struct mkroom *dnstairs_room, *upstairs_room, *sstairs_room;
extern NEARDATA coord doors[DOORMAX];
/* values for rtype in the room definition structure */
enum roomtype_types {
OROOM = 0, /* ordinary room */

View File

@@ -186,7 +186,7 @@
#define G_NOCORPSE 0x0010 /* no corpse left ever */
#define G_FREQ 0x0007 /* creation frequency mask */
/* for mvitals[].mvflags (variant during game), along with G_NOCORPSE */
/* for g.mvitals[].mvflags (variant during game), along with G_NOCORPSE */
#define G_KNOWN 0x0004 /* have been encountered */
#define G_GONE (G_GENOD | G_EXTINCT)
#define G_GENOD 0x0002 /* have been genocided */

View File

@@ -345,7 +345,7 @@ extern const struct symdef def_warnsyms[WARNCOUNT];
#define CLEAR_FOUNTAIN_LOOTED(x, y) levl[x][y].looted &= ~F_LOOTED;
/*
* Doors are even worse :-) The special warning has a side effect
* doors are even worse :-) The special warning has a side effect
* of instantly trapping the door, and if it was defined as trapped,
* the guards consider that you have already been warned!
*/
@@ -596,8 +596,6 @@ typedef struct {
struct levelflags flags;
} dlevel_t;
extern schar lastseentyp[COLNO][ROWNO]; /* last seen/touched dungeon typ */
extern dlevel_t level; /* structure describing the current level */
/*

View File

@@ -20,8 +20,8 @@ struct spell {
#define ALL_MAP 0x1
#define ALL_SPELLS 0x2
#define decrnknow(spell) spl_book[spell].sp_know--
#define spellid(spell) spl_book[spell].sp_id
#define spellknow(spell) spl_book[spell].sp_know
#define decrnknow(spell) g.spl_book[spell].sp_know--
#define spellid(spell) g.spl_book[spell].sp_id
#define spellknow(spell) g.spl_book[spell].sp_know
#endif /* SPELL_H */

View File

@@ -37,7 +37,6 @@ struct trap {
#define tnote vl.v_tnote
};
extern struct trap *ftrap;
#define newtrap() (struct trap *) alloc(sizeof(struct trap))
#define dealloc_trap(trap) free((genericptr_t)(trap))

View File

@@ -5,12 +5,6 @@
#ifndef VISION_H
#define VISION_H
#if 0 /* (moved to decl.h) */
extern boolean vision_full_recalc; /* TRUE if need vision recalc */
extern char **viz_array; /* could see/in sight row pointers */
extern char *viz_rmin; /* min could see indices */
extern char *viz_rmax; /* max could see indices */
#endif
#define COULD_SEE 0x1 /* location could be seen, if it were lit */
#define IN_SIGHT 0x2 /* location can be seen */
#define TEMP_LIT 0x4 /* location is temporarily lit */
@@ -27,9 +21,9 @@ extern char *viz_rmax; /* max could see indices */
* couldsee() - Returns true if the hero has a clear line of sight to
* the location.
*/
#define cansee(x, y) (viz_array[y][x] & IN_SIGHT)
#define couldsee(x, y) (viz_array[y][x] & COULD_SEE)
#define templit(x, y) (viz_array[y][x] & TEMP_LIT)
#define cansee(x, y) (g.viz_array[y][x] & IN_SIGHT)
#define couldsee(x, y) (g.viz_array[y][x] & COULD_SEE)
#define templit(x, y) (g.viz_array[y][x] & TEMP_LIT)
/*
* The following assume the monster is not blind.