split g into multiple structures
The consolidation of global variables from scattered source
files into decl.c and declared in decl.h was begun in 3.7.0.
Their placement in common files was done for centralized
initialization and potential re-initialization during a
"play again" scenario.
It wasn't really necessary for all of them to be housed in a
single huge structure to meet the "play again" requirement,
and the single huge structure has been a little unwieldy when
it comes to maintenance.
Following this commit, instead of one single extremely large structure
named 'g' to house all of the relocated global variables, they
are distributed into several ga through gz.
To make things easy for the developer, each variable is placed
into the struct corresponding to the starting letter of the variable.
That way, no lookup is required in order to know which struct houses
a particular variable, it is a simple match to the starting letter
for all the centralized global variables.
A global variable named 'amulets', would be found in ga.
ga.amulets
^ ^
A global varable named 'move', would be found in gm.
gm.moves
^ ^
A global variable named 'val_for_n_or_more' would be found in gv.
gv.val_for_n_or_more
^ ^
A global variable named 'youmonst' would be found in gy.
gy.youmonst
^ ^
This commit is contained in:
190
src/display.c
190
src/display.c
@@ -151,7 +151,7 @@ static void set_seenv(struct rm *, coordxy, coordxy, coordxy, coordxy);
|
||||
static void t_warn(struct rm *);
|
||||
static int wall_angle(struct rm *);
|
||||
|
||||
#define remember_topology(x, y) (g.lastseentyp[x][y] = levl[x][y].typ)
|
||||
#define remember_topology(x, y) (gl.lastseentyp[x][y] = levl[x][y].typ)
|
||||
|
||||
/*
|
||||
* See display.h for descriptions of tp_sensemon() through
|
||||
@@ -249,7 +249,7 @@ magic_map_background(coordxy x, coordxy y, int show)
|
||||
else if (lev->typ == CORR && glyph == cmap_to_glyph(S_litcorr))
|
||||
glyph = cmap_to_glyph(S_corr);
|
||||
}
|
||||
if (g.level.flags.hero_memory)
|
||||
if (gl.level.flags.hero_memory)
|
||||
lev->glyph = glyph;
|
||||
if (show)
|
||||
show_glyph(x, y, glyph);
|
||||
@@ -280,7 +280,7 @@ map_background(register coordxy x, register coordxy y, register int show)
|
||||
{
|
||||
register int glyph = back_to_glyph(x, y);
|
||||
|
||||
if (g.level.flags.hero_memory)
|
||||
if (gl.level.flags.hero_memory)
|
||||
levl[x][y].glyph = glyph;
|
||||
if (show)
|
||||
show_glyph(x, y, glyph);
|
||||
@@ -298,7 +298,7 @@ map_trap(register struct trap *trap, register int show)
|
||||
register coordxy x = trap->tx, y = trap->ty;
|
||||
register int glyph = trap_to_glyph(trap);
|
||||
|
||||
if (g.level.flags.hero_memory)
|
||||
if (gl.level.flags.hero_memory)
|
||||
levl[x][y].glyph = glyph;
|
||||
if (show)
|
||||
show_glyph(x, y, glyph);
|
||||
@@ -316,7 +316,7 @@ map_object(register struct obj *obj, register int show)
|
||||
register coordxy x = obj->ox, y = obj->oy;
|
||||
register int glyph = obj_to_glyph(obj, newsym_rn2);
|
||||
|
||||
if (g.level.flags.hero_memory) {
|
||||
if (gl.level.flags.hero_memory) {
|
||||
/* MRKR: While hallucinating, statues are seen as random monsters */
|
||||
/* but remembered as random objects. */
|
||||
|
||||
@@ -343,7 +343,7 @@ void
|
||||
map_invisible(register coordxy x, register coordxy y)
|
||||
{
|
||||
if (x != u.ux || y != u.uy) { /* don't display I at hero's location */
|
||||
if (g.level.flags.hero_memory)
|
||||
if (gl.level.flags.hero_memory)
|
||||
levl[x][y].glyph = GLYPH_INVISIBLE;
|
||||
show_glyph(x, y, GLYPH_INVISIBLE);
|
||||
}
|
||||
@@ -375,7 +375,7 @@ unmap_object(register coordxy x, register coordxy y)
|
||||
{
|
||||
register struct trap *trap;
|
||||
|
||||
if (!g.level.flags.hero_memory)
|
||||
if (!gl.level.flags.hero_memory)
|
||||
return;
|
||||
|
||||
if ((trap = t_at(x, y)) != 0 && trap->tseen && !covers_traps(x, y)) {
|
||||
@@ -499,7 +499,7 @@ display_monster(coordxy x, coordxy y, /* display position */
|
||||
if (!sensed) {
|
||||
show_glyph(x, y, glyph);
|
||||
/* override real topology with mimic's fake one */
|
||||
g.lastseentyp[x][y] = cmap_to_type(sym);
|
||||
gl.lastseentyp[x][y] = cmap_to_type(sym);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -610,10 +610,10 @@ warning_of(struct monst *mon)
|
||||
boolean
|
||||
suppress_map_output(void)
|
||||
{
|
||||
if (g.in_mklev || g.program_state.saving || g.program_state.restoring)
|
||||
if (gi.in_mklev || gp.program_state.saving || gp.program_state.restoring)
|
||||
return TRUE;
|
||||
#ifdef HANGUPHANDLING
|
||||
if (g.program_state.done_hup)
|
||||
if (gp.program_state.done_hup)
|
||||
return TRUE;
|
||||
#endif
|
||||
return FALSE;
|
||||
@@ -776,14 +776,14 @@ feel_location(coordxy x, coordxy y)
|
||||
*/
|
||||
if (uchain && uchain->where == OBJ_FLOOR
|
||||
&& uchain->ox == x && uchain->oy == y
|
||||
&& g.level.objects[x][y] == uchain)
|
||||
&& gl.level.objects[x][y] == uchain)
|
||||
u.bc_felt |= BC_CHAIN;
|
||||
else
|
||||
u.bc_felt &= ~BC_CHAIN; /* do not feel the chain */
|
||||
|
||||
if (uball && uball->where == OBJ_FLOOR
|
||||
&& uball->ox == x && uball->oy == y
|
||||
&& g.level.objects[x][y] == uball)
|
||||
&& gl.level.objects[x][y] == uball)
|
||||
u.bc_felt |= BC_BALL;
|
||||
else
|
||||
u.bc_felt &= ~BC_BALL; /* do not feel the ball */
|
||||
@@ -1176,7 +1176,7 @@ flash_glyph_at(coordxy x, coordxy y, int tg, int rpt)
|
||||
|
||||
rpt *= 2; /* two loop iterations per 'count' */
|
||||
glyph[0] = tg;
|
||||
glyph[1] = (g.level.flags.hero_memory) ? levl[x][y].glyph
|
||||
glyph[1] = (gl.level.flags.hero_memory) ? levl[x][y].glyph
|
||||
: back_to_glyph(x, y);
|
||||
/* even iteration count (guaranteed) ends with glyph[1] showing;
|
||||
caller might want to override that, but no newsym() calls here
|
||||
@@ -1357,7 +1357,7 @@ see_monsters(void)
|
||||
register struct monst *mon;
|
||||
int new_warn_obj_cnt = 0;
|
||||
|
||||
if (g.defer_see_monsters)
|
||||
if (gd.defer_see_monsters)
|
||||
return;
|
||||
|
||||
for (mon = fmon; mon; mon = mon->nmon) {
|
||||
@@ -1366,16 +1366,16 @@ see_monsters(void)
|
||||
newsym(mon->mx, mon->my);
|
||||
if (mon->wormno)
|
||||
see_wsegs(mon);
|
||||
if (Warn_of_mon && (g.context.warntype.obj & mon->data->mflags2) != 0L)
|
||||
if (Warn_of_mon && (gc.context.warntype.obj & mon->data->mflags2) != 0L)
|
||||
new_warn_obj_cnt++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make Sting glow blue or stop glowing if required.
|
||||
*/
|
||||
if (new_warn_obj_cnt != g.warn_obj_cnt) {
|
||||
if (new_warn_obj_cnt != gw.warn_obj_cnt) {
|
||||
Sting_effects(new_warn_obj_cnt);
|
||||
g.warn_obj_cnt = new_warn_obj_cnt;
|
||||
gw.warn_obj_cnt = new_warn_obj_cnt;
|
||||
}
|
||||
|
||||
/* when mounted, hero's location gets caught by monster loop */
|
||||
@@ -1434,7 +1434,7 @@ see_traps(void)
|
||||
struct trap *trap;
|
||||
int glyph;
|
||||
|
||||
for (trap = g.ftrap; trap; trap = trap->ntrap) {
|
||||
for (trap = gf.ftrap; trap; trap = trap->ntrap) {
|
||||
glyph = glyph_at(trap->tx, trap->ty);
|
||||
if (glyph_is_trap(glyph))
|
||||
newsym(trap->tx, trap->ty);
|
||||
@@ -1453,7 +1453,7 @@ static glyph_info no_ginfo = {
|
||||
#ifndef UNBUFFERED_GLYPHINFO
|
||||
#define Glyphinfo_at(x, y, glyph) \
|
||||
(((x) < 0 || (y) < 0 || (x) >= COLNO || (y) >= ROWNO) ? &no_ginfo \
|
||||
: &g.gbuf[(y)][(x)].glyphinfo)
|
||||
: &gg.gbuf[(y)][(x)].glyphinfo)
|
||||
#else
|
||||
static glyph_info ginfo;
|
||||
#define Glyphinfo_at(x, y, glyph) glyphinfo_at(x, y, glyph)
|
||||
@@ -1512,10 +1512,10 @@ docrt(void)
|
||||
coordxy x, y;
|
||||
register struct rm *lev;
|
||||
|
||||
if (!u.ux || g.program_state.in_docrt)
|
||||
if (!u.ux || gp.program_state.in_docrt)
|
||||
return; /* display isn't ready yet */
|
||||
|
||||
g.program_state.in_docrt = TRUE;
|
||||
gp.program_state.in_docrt = TRUE;
|
||||
|
||||
if (u.uswallow) {
|
||||
swallowed(1);
|
||||
@@ -1558,8 +1558,8 @@ docrt(void)
|
||||
/* perm_invent */
|
||||
update_inventory();
|
||||
|
||||
g.context.botlx = 1; /* force a redraw of the bottom line */
|
||||
g.program_state.in_docrt = FALSE;
|
||||
gc.context.botlx = 1; /* force a redraw of the bottom line */
|
||||
gp.program_state.in_docrt = FALSE;
|
||||
}
|
||||
|
||||
/* for panning beyond a clipped region; resend the current map data to
|
||||
@@ -1637,9 +1637,9 @@ reglyph_darkroom(void)
|
||||
}
|
||||
}
|
||||
if (flags.dark_room && iflags.use_color)
|
||||
g.showsyms[S_darkroom] = g.showsyms[S_room];
|
||||
gs.showsyms[S_darkroom] = gs.showsyms[S_room];
|
||||
else
|
||||
g.showsyms[S_darkroom] = g.showsyms[SYM_NOTHING + SYM_OFF_X];
|
||||
gs.showsyms[S_darkroom] = gs.showsyms[SYM_NOTHING + SYM_OFF_X];
|
||||
}
|
||||
|
||||
/* ======================================================================== */
|
||||
@@ -1652,11 +1652,11 @@ void
|
||||
newsym_force(coordxy x, coordxy y)
|
||||
{
|
||||
newsym(x, y);
|
||||
g.gbuf[y][x].gnew = 1;
|
||||
if (g.gbuf_start[y] > x)
|
||||
g.gbuf_start[y] = x;
|
||||
if (g.gbuf_stop[y] < x)
|
||||
g.gbuf_stop[y] = x;
|
||||
gg.gbuf[y][x].gnew = 1;
|
||||
if (gg.gbuf_start[y] > x)
|
||||
gg.gbuf_start[y] = x;
|
||||
if (gg.gbuf_stop[y] < x)
|
||||
gg.gbuf_stop[y] = x;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1782,7 +1782,7 @@ show_glyph(coordxy x, coordxy y, int glyph)
|
||||
map_glyphinfo(x, y, glyph, 0, &glyphinfo);
|
||||
#endif
|
||||
|
||||
if (g.gbuf[y][x].glyphinfo.glyph != glyph
|
||||
if (gg.gbuf[y][x].glyphinfo.glyph != glyph
|
||||
#ifndef UNBUFFERED_GLYPHINFO
|
||||
/* flags might change (single object vs pile, monster tamed or pet
|
||||
gone feral), color might change (altar's alignment converted by
|
||||
@@ -1790,23 +1790,23 @@ show_glyph(coordxy x, coordxy y, int glyph)
|
||||
glyph does too (changing boulder symbol would be an exception,
|
||||
but that triggers full redraw so doesn't matter here); still,
|
||||
be thorough and check everything */
|
||||
|| g.gbuf[y][x].glyphinfo.ttychar != glyphinfo.ttychar
|
||||
|| g.gbuf[y][x].glyphinfo.gm.glyphflags != glyphinfo.gm.glyphflags
|
||||
|| g.gbuf[y][x].glyphinfo.gm.sym.color != glyphinfo.gm.sym.color
|
||||
|| g.gbuf[y][x].glyphinfo.gm.tileidx != glyphinfo.gm.tileidx
|
||||
|| gg.gbuf[y][x].glyphinfo.ttychar != glyphinfo.ttychar
|
||||
|| gg.gbuf[y][x].glyphinfo.gm.glyphflags != glyphinfo.gm.glyphflags
|
||||
|| gg.gbuf[y][x].glyphinfo.gm.sym.color != glyphinfo.gm.sym.color
|
||||
|| gg.gbuf[y][x].glyphinfo.gm.tileidx != glyphinfo.gm.tileidx
|
||||
#endif
|
||||
|| iflags.use_background_glyph) {
|
||||
g.gbuf[y][x].glyphinfo.glyph = glyph;
|
||||
g.gbuf[y][x].gnew = 1;
|
||||
gg.gbuf[y][x].glyphinfo.glyph = glyph;
|
||||
gg.gbuf[y][x].gnew = 1;
|
||||
#ifndef UNBUFFERED_GLYPHINFO
|
||||
g.gbuf[y][x].glyphinfo.glyph = glyphinfo.glyph;
|
||||
g.gbuf[y][x].glyphinfo.ttychar = glyphinfo.ttychar;
|
||||
g.gbuf[y][x].glyphinfo.gm = glyphinfo.gm;
|
||||
gg.gbuf[y][x].glyphinfo.glyph = glyphinfo.glyph;
|
||||
gg.gbuf[y][x].glyphinfo.ttychar = glyphinfo.ttychar;
|
||||
gg.gbuf[y][x].glyphinfo.gm = glyphinfo.gm;
|
||||
#endif
|
||||
if (g.gbuf_start[y] > x)
|
||||
g.gbuf_start[y] = x;
|
||||
if (g.gbuf_stop[y] < x)
|
||||
g.gbuf_stop[y] = x;
|
||||
if (gg.gbuf_start[y] > x)
|
||||
gg.gbuf_start[y] = x;
|
||||
if (gg.gbuf_stop[y] < x)
|
||||
gg.gbuf_stop[y] = x;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1819,8 +1819,8 @@ show_glyph(coordxy x, coordxy y, int glyph)
|
||||
int i; \
|
||||
\
|
||||
for (i = 0; i < ROWNO; i++) { \
|
||||
g.gbuf_start[i] = COLNO - 1; \
|
||||
g.gbuf_stop[i] = 0; \
|
||||
gg.gbuf_start[i] = COLNO - 1; \
|
||||
gg.gbuf_stop[i] = 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
@@ -1843,7 +1843,7 @@ void
|
||||
clear_glyph_buffer(void)
|
||||
{
|
||||
register coordxy x, y;
|
||||
gbuf_entry *gptr = &g.gbuf[0][0];
|
||||
gbuf_entry *gptr = &gg.gbuf[0][0];
|
||||
glyph_info *giptr =
|
||||
#ifndef UNBUFFERED_GLYPHINFO
|
||||
&gptr->glyphinfo;
|
||||
@@ -1865,12 +1865,12 @@ clear_glyph_buffer(void)
|
||||
#endif
|
||||
? 1 : 0;
|
||||
for (y = 0; y < ROWNO; y++) {
|
||||
gptr = &g.gbuf[y][0];
|
||||
gptr = &gg.gbuf[y][0];
|
||||
for (x = COLNO; x; x--) {
|
||||
*gptr++ = nul_gbuf;
|
||||
}
|
||||
g.gbuf_start[y] = 1;
|
||||
g.gbuf_stop[y] = COLNO - 1;
|
||||
gg.gbuf_start[y] = 1;
|
||||
gg.gbuf_stop[y] = COLNO - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1882,7 +1882,7 @@ row_refresh(coordxy start, coordxy stop, coordxy y)
|
||||
register coordxy x;
|
||||
int glyph;
|
||||
register boolean force;
|
||||
gbuf_entry *gptr = &g.gbuf[0][0];
|
||||
gbuf_entry *gptr = &gg.gbuf[0][0];
|
||||
glyph_info bkglyphinfo = nul_glyphinfo;
|
||||
glyph_info *giptr =
|
||||
#ifndef UNBUFFERED_GLYPHINFO
|
||||
@@ -1904,7 +1904,7 @@ row_refresh(coordxy start, coordxy stop, coordxy y)
|
||||
#endif
|
||||
? 1 : 0;
|
||||
for (x = start; x <= stop; x++) {
|
||||
gptr = &g.gbuf[y][x];
|
||||
gptr = &gg.gbuf[y][x];
|
||||
glyph = gptr->glyphinfo.glyph;
|
||||
if (force || glyph != GLYPH_UNEXPLORED) {
|
||||
bkglyphinfo.glyph = get_bk_glyph(x, y);
|
||||
@@ -1923,7 +1923,7 @@ cls(void)
|
||||
return;
|
||||
in_cls = TRUE;
|
||||
display_nhwindow(WIN_MESSAGE, FALSE); /* flush messages */
|
||||
g.context.botlx = 1; /* force update of botl window */
|
||||
gc.context.botlx = 1; /* force update of botl window */
|
||||
clear_nhwindow(WIN_MAP); /* clear physical screen */
|
||||
|
||||
clear_glyph_buffer(); /* force gbuf[][].glyph to unexplored */
|
||||
@@ -1956,20 +1956,20 @@ flush_screen(int cursor_on_u)
|
||||
return; /* if already flushing then return */
|
||||
flushing = 1;
|
||||
#ifdef HANGUPHANDLING
|
||||
if (g.program_state.done_hup)
|
||||
if (gp.program_state.done_hup)
|
||||
return;
|
||||
#endif
|
||||
|
||||
/* get this done now, before we place the cursor on the hero */
|
||||
if (g.context.botl || g.context.botlx)
|
||||
if (gc.context.botl || gc.context.botlx)
|
||||
bot();
|
||||
else if (iflags.time_botl)
|
||||
timebot();
|
||||
|
||||
for (y = 0; y < ROWNO; y++) {
|
||||
register gbuf_entry *gptr = &g.gbuf[y][x = g.gbuf_start[y]];
|
||||
register gbuf_entry *gptr = &gg.gbuf[y][x = gg.gbuf_start[y]];
|
||||
|
||||
for (; x <= g.gbuf_stop[y]; gptr++, x++)
|
||||
for (; x <= gg.gbuf_stop[y]; gptr++, x++)
|
||||
if (gptr->gnew) {
|
||||
map_glyphinfo(x, y, get_bk_glyph(x, y), 0, &bkglyphinfo);
|
||||
print_glyph(WIN_MAP, x, y,
|
||||
@@ -2014,7 +2014,7 @@ back_to_glyph(coordxy x, coordxy y)
|
||||
switch (ptr->typ) {
|
||||
case SCORR:
|
||||
case STONE:
|
||||
idx = g.level.flags.arboreal ? S_tree : S_stone;
|
||||
idx = gl.level.flags.arboreal ? S_tree : S_stone;
|
||||
break;
|
||||
case ROOM:
|
||||
idx = S_room;
|
||||
@@ -2191,7 +2191,7 @@ glyph_at(coordxy x, coordxy y)
|
||||
{
|
||||
if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO)
|
||||
return cmap_to_glyph(S_room); /* XXX */
|
||||
return g.gbuf[y][x].glyphinfo.glyph;
|
||||
return gg.gbuf[y][x].glyphinfo.glyph;
|
||||
}
|
||||
|
||||
#ifdef UNBUFFERED_GLYPHINFO
|
||||
@@ -2223,11 +2223,11 @@ get_bk_glyph(coordxy x, coordxy y)
|
||||
struct rm *lev = &levl[x][y];
|
||||
|
||||
if (iflags.use_background_glyph && lev->seenv != 0
|
||||
&& (g.gbuf[y][x].glyphinfo.glyph != GLYPH_UNEXPLORED)) {
|
||||
&& (gg.gbuf[y][x].glyphinfo.glyph != GLYPH_UNEXPLORED)) {
|
||||
switch (lev->typ) {
|
||||
case SCORR:
|
||||
case STONE:
|
||||
idx = g.level.flags.arboreal ? S_tree : S_stone;
|
||||
idx = gl.level.flags.arboreal ? S_tree : S_stone;
|
||||
break;
|
||||
case ROOM:
|
||||
idx = S_room;
|
||||
@@ -2276,14 +2276,14 @@ get_bk_glyph(coordxy x, coordxy y)
|
||||
|
||||
#if defined(USE_TILES) && defined(MSDOS)
|
||||
#define HAS_ROGUE_IBM_GRAPHICS \
|
||||
(g.currentgraphics == ROGUESET && SYMHANDLING(H_IBM) && !iflags.grmode)
|
||||
(gc.currentgraphics == ROGUESET && SYMHANDLING(H_IBM) && !iflags.grmode)
|
||||
#else
|
||||
#define HAS_ROGUE_IBM_GRAPHICS \
|
||||
(g.currentgraphics == ROGUESET && SYMHANDLING(H_IBM))
|
||||
(gc.currentgraphics == ROGUESET && SYMHANDLING(H_IBM))
|
||||
#endif
|
||||
#define HI_DOMESTIC CLR_WHITE /* monst.c */
|
||||
|
||||
/* masks for per-level variances kept in g.glyphmap_perlevel_flags */
|
||||
/* masks for per-level variances kept in gg.glyphmap_perlevel_flags */
|
||||
#define GMAP_SET 0x0001
|
||||
#define GMAP_ROGUELEVEL 0x0002
|
||||
|
||||
@@ -2320,7 +2320,7 @@ map_glyphinfo(
|
||||
; /* color tweak not needed (!use_color) or not wanted (poly'd
|
||||
or riding--which uses steed's color, not hero's) */
|
||||
} else if (HAS_ROGUE_IBM_GRAPHICS
|
||||
&& g.symset[g.currentgraphics].nocolor == 0) {
|
||||
&& gs.symset[gc.currentgraphics].nocolor == 0) {
|
||||
/* actually player should be yellow-on-gray if in corridor */
|
||||
glyphinfo->gm.sym.color = CLR_YELLOW;
|
||||
} else if (flags.showrace) {
|
||||
@@ -2336,9 +2336,9 @@ map_glyphinfo(
|
||||
Turn on override symbol if caller hasn't specified NOOVERRIDE. */
|
||||
if (sysopt.accessibility == 1 && !(mgflags & MG_FLAG_NOOVERRIDE)) {
|
||||
offset = SYM_HERO_OVERRIDE + SYM_OFF_X;
|
||||
if ((g.glyphmap_perlevel_flags & GMAP_ROGUELEVEL)
|
||||
? g.ov_rogue_syms[offset]
|
||||
: g.ov_primary_syms[offset])
|
||||
if ((gg.glyphmap_perlevel_flags & GMAP_ROGUELEVEL)
|
||||
? go.ov_rogue_syms[offset]
|
||||
: go.ov_primary_syms[offset])
|
||||
glyphinfo->gm.sym.symidx = offset;
|
||||
}
|
||||
glyphinfo->gm.glyphflags |= MG_HERO;
|
||||
@@ -2349,7 +2349,7 @@ map_glyphinfo(
|
||||
turn off override symbol if caller has specfieid NOOVERRIDE */
|
||||
glyphinfo->gm.sym.symidx = mons[glyph_to_mon(glyph)].mlet + SYM_OFF_M;
|
||||
}
|
||||
glyphinfo->ttychar = g.showsyms[glyphinfo->gm.sym.symidx];
|
||||
glyphinfo->ttychar = gs.showsyms[glyphinfo->gm.sym.symidx];
|
||||
glyphinfo->glyph = glyph;
|
||||
}
|
||||
|
||||
@@ -2411,8 +2411,8 @@ int wallcolors[sokoban_walls + 1] = {
|
||||
|
||||
#if 0
|
||||
#define is_objpile(x, y) \
|
||||
(!Hallucination && g.level.objects[(x)][(y)] \
|
||||
&& g.level.objects[(x)][(y)]->nexthere)
|
||||
(!Hallucination && gl.level.objects[(x)][(y)] \
|
||||
&& gl.level.objects[(x)][(y)]->nexthere)
|
||||
#endif
|
||||
|
||||
static int cmap_to_roguecolor(int);
|
||||
@@ -2422,7 +2422,7 @@ cmap_to_roguecolor(int cmap)
|
||||
{
|
||||
int color = NO_COLOR;
|
||||
|
||||
if (g.symset[g.currentgraphics].nocolor)
|
||||
if (gs.symset[gc.currentgraphics].nocolor)
|
||||
return NO_COLOR;
|
||||
|
||||
if (cmap >= S_vwall && cmap <= S_hcdoor)
|
||||
@@ -2467,19 +2467,19 @@ reset_glyphmap(enum glyphmap_change_triggers trigger)
|
||||
/* condense multiple tests in macro version down to single */
|
||||
boolean has_rogue_ibm_graphics = HAS_ROGUE_IBM_GRAPHICS,
|
||||
has_rogue_color = (has_rogue_ibm_graphics
|
||||
&& g.symset[g.currentgraphics].nocolor == 0);
|
||||
&& gs.symset[gc.currentgraphics].nocolor == 0);
|
||||
if (trigger == gm_levelchange)
|
||||
g.glyphmap_perlevel_flags = 0;
|
||||
gg.glyphmap_perlevel_flags = 0;
|
||||
|
||||
if (!g.glyphmap_perlevel_flags) {
|
||||
if (!gg.glyphmap_perlevel_flags) {
|
||||
/*
|
||||
* GMAP_SET 0x00000001
|
||||
* GMAP_ROGUELEVEL 0x00000002
|
||||
*/
|
||||
g.glyphmap_perlevel_flags |= GMAP_SET;
|
||||
gg.glyphmap_perlevel_flags |= GMAP_SET;
|
||||
|
||||
if (Is_rogue_level(&u.uz)) {
|
||||
g.glyphmap_perlevel_flags |= GMAP_ROGUELEVEL;
|
||||
gg.glyphmap_perlevel_flags |= GMAP_ROGUELEVEL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2612,25 +2612,25 @@ reset_glyphmap(enum glyphmap_change_triggers trigger)
|
||||
/* try to provide a visible difference between water and lava
|
||||
if they use the same symbol and color is disabled */
|
||||
if (cmap == S_lava
|
||||
&& (g.showsyms[gmap->sym.symidx]
|
||||
== g.showsyms[S_pool + SYM_OFF_P]
|
||||
|| g.showsyms[gmap->sym.symidx]
|
||||
== g.showsyms[S_water + SYM_OFF_P])) {
|
||||
&& (gs.showsyms[gmap->sym.symidx]
|
||||
== gs.showsyms[S_pool + SYM_OFF_P]
|
||||
|| gs.showsyms[gmap->sym.symidx]
|
||||
== gs.showsyms[S_water + SYM_OFF_P])) {
|
||||
gmap->glyphflags |= MG_BW_LAVA;
|
||||
|
||||
/* similar for floor [what about empty doorway?] and ice */
|
||||
} else if (cmap == S_ice
|
||||
&& (g.showsyms[gmap->sym.symidx]
|
||||
== g.showsyms[S_room + SYM_OFF_P]
|
||||
|| g.showsyms[gmap->sym.symidx]
|
||||
== g.showsyms[S_darkroom
|
||||
&& (gs.showsyms[gmap->sym.symidx]
|
||||
== gs.showsyms[S_room + SYM_OFF_P]
|
||||
|| gs.showsyms[gmap->sym.symidx]
|
||||
== gs.showsyms[S_darkroom
|
||||
+ SYM_OFF_P])) {
|
||||
gmap->glyphflags |= MG_BW_ICE;
|
||||
|
||||
/* and for fountain vs sink */
|
||||
} else if (cmap == S_sink
|
||||
&& (g.showsyms[gmap->sym.symidx]
|
||||
== g.showsyms[S_fountain + SYM_OFF_P])) {
|
||||
&& (gs.showsyms[gmap->sym.symidx]
|
||||
== gs.showsyms[S_fountain + SYM_OFF_P])) {
|
||||
gmap->glyphflags |= MG_BW_SINK;
|
||||
}
|
||||
} else if (has_rogue_color) {
|
||||
@@ -2656,8 +2656,8 @@ reset_glyphmap(enum glyphmap_change_triggers trigger)
|
||||
/* provide a visible difference if normal and lit corridor
|
||||
use the same symbol */
|
||||
} else if ((cmap == S_litcorr)
|
||||
&& g.showsyms[gmap->sym.symidx]
|
||||
== g.showsyms[S_corr + SYM_OFF_P]) {
|
||||
&& gs.showsyms[gmap->sym.symidx]
|
||||
== gs.showsyms[S_corr + SYM_OFF_P]) {
|
||||
color = CLR_WHITE;
|
||||
#endif
|
||||
}
|
||||
@@ -2784,24 +2784,24 @@ reset_glyphmap(enum glyphmap_change_triggers trigger)
|
||||
/* This was requested by a blind player to enhance screen reader use
|
||||
*/
|
||||
if (sysopt.accessibility == 1 && (gmap->glyphflags & MG_PET) != 0) {
|
||||
int pet_override = ((g.glyphmap_perlevel_flags & GMAP_ROGUELEVEL)
|
||||
? g.ov_rogue_syms[SYM_PET_OVERRIDE + SYM_OFF_X]
|
||||
: g.ov_primary_syms[SYM_PET_OVERRIDE + SYM_OFF_X]);
|
||||
int pet_override = ((gg.glyphmap_perlevel_flags & GMAP_ROGUELEVEL)
|
||||
? go.ov_rogue_syms[SYM_PET_OVERRIDE + SYM_OFF_X]
|
||||
: go.ov_primary_syms[SYM_PET_OVERRIDE + SYM_OFF_X]);
|
||||
|
||||
if (g.showsyms[pet_override] != ' ')
|
||||
if (gs.showsyms[pet_override] != ' ')
|
||||
gmap->sym.symidx = SYM_PET_OVERRIDE + SYM_OFF_X;
|
||||
}
|
||||
#ifdef TEXTCOLOR
|
||||
/* Turn off color if no color defined, or rogue level w/o PC graphics.
|
||||
*/
|
||||
if ((!has_color(color)
|
||||
|| ((g.glyphmap_perlevel_flags & GMAP_ROGUELEVEL)
|
||||
|| ((gg.glyphmap_perlevel_flags & GMAP_ROGUELEVEL)
|
||||
&& !has_rogue_color)) || !iflags.use_color)
|
||||
#endif
|
||||
color = NO_COLOR;
|
||||
gmap->sym.color = color;
|
||||
}
|
||||
g.glyph_reset_timestamp = g.moves;
|
||||
gg.glyph_reset_timestamp = gm.moves;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
Reference in New Issue
Block a user