glyph_to_cmap() becomes function instead of macro
Also adds swallow and explosion glyphs to glyph_to_cmap() References: https://github.com/NetHack/NetHack/pull/1022 by argrath https://github.com/NetHack/NetHack/pull/1277 by ars3niy Closes #1277 Closes #1022
This commit is contained in:
@@ -2873,6 +2873,7 @@ remove a null sobj check from gold_detect that was situated after
|
|||||||
check for valid indexes of def_monsyms[] and def_oc_syms[] in
|
check for valid indexes of def_monsyms[] and def_oc_syms[] in
|
||||||
choose_classes_menu() (pr #1179 by argrath)
|
choose_classes_menu() (pr #1179 by argrath)
|
||||||
split damage from acid potion into separate function (pr #1195 by argrath)
|
split damage from acid potion into separate function (pr #1195 by argrath)
|
||||||
|
add swallow and explosion glyphs to glyph_to_cmap() (pr #1277 by ars3niy)
|
||||||
|
|
||||||
|
|
||||||
Code Cleanup and Reorganization
|
Code Cleanup and Reorganization
|
||||||
@@ -3005,4 +3006,5 @@ remove TEXTCOLOR build option
|
|||||||
relocate general-purpose function choose_classes_menu(), from
|
relocate general-purpose function choose_classes_menu(), from
|
||||||
options.c to windows.c
|
options.c to windows.c
|
||||||
remove register from variable declarations
|
remove register from variable declarations
|
||||||
|
make glyph_to_cmap() a function instead of a macro
|
||||||
|
|
||||||
|
|||||||
@@ -723,10 +723,6 @@ enum glyph_offsets {
|
|||||||
#define glyph_is_cmap(glyph) \
|
#define glyph_is_cmap(glyph) \
|
||||||
((glyph) >= GLYPH_CMAP_STONE_OFF \
|
((glyph) >= GLYPH_CMAP_STONE_OFF \
|
||||||
&& (glyph) < (GLYPH_CMAP_C_OFF + ((S_goodpos - S_digbeam) + 1)))
|
&& (glyph) < (GLYPH_CMAP_C_OFF + ((S_goodpos - S_digbeam) + 1)))
|
||||||
|
|
||||||
/* final MAXPCHARS is legal array index because of trailing fencepost entry */
|
|
||||||
int glyph_to_cmap(int glpyh);
|
|
||||||
|
|
||||||
#define glyph_to_swallow(glyph) \
|
#define glyph_to_swallow(glyph) \
|
||||||
(glyph_is_swallow(glyph) ? (((glyph) - GLYPH_SWALLOW_OFF) & 0x7) : 0)
|
(glyph_is_swallow(glyph) ? (((glyph) - GLYPH_SWALLOW_OFF) & 0x7) : 0)
|
||||||
#define glyph_to_explosion(glyph) \
|
#define glyph_to_explosion(glyph) \
|
||||||
|
|||||||
@@ -1124,6 +1124,7 @@ extern void purge_all_custom_entries(void);
|
|||||||
extern void dump_glyphids(void);
|
extern void dump_glyphids(void);
|
||||||
extern void clear_all_glyphmap_colors(void);
|
extern void clear_all_glyphmap_colors(void);
|
||||||
extern void reset_customcolors(void);
|
extern void reset_customcolors(void);
|
||||||
|
extern int glyph_to_cmap(int);
|
||||||
|
|
||||||
/* ### hack.c ### */
|
/* ### hack.c ### */
|
||||||
|
|
||||||
|
|||||||
@@ -221,7 +221,8 @@ glyph_to_cmap(int glyph)
|
|||||||
else if (glyph_is_explosion(glyph))
|
else if (glyph_is_explosion(glyph))
|
||||||
return glyph_to_explosion(glyph) + S_expl_tl;
|
return glyph_to_explosion(glyph) + S_expl_tl;
|
||||||
else
|
else
|
||||||
return MAXPCHARS;
|
return MAXPCHARS; /* MAXPCHARS is legal array index because
|
||||||
|
of trailing fencepost entry */
|
||||||
}
|
}
|
||||||
|
|
||||||
staticfn int
|
staticfn int
|
||||||
|
|||||||
Reference in New Issue
Block a user