expand the glyphs
The walls for the mines, gehennom, knox, and sokoban had been changed at the "tile"-level, with no awareness of the core game, or non-tile interfaces. - Expand the glyphs to include a set of walls for the main level as well as each of those mentioned above. Altars had been adjusted at the map_glyphinfo() level to substitute some color variations on-the-fly for unaligned, chaotic, neutral, lawful altars, and shrines. The tile interface had no awareness of the feature. - Expand the glyphs to include each of the altar variations that had been implemented in the display code for tty-only. This required the addition of four placeholder tiles in other.txt. Someone with artistic skill will hopefully alter the additional tiles to better reflect their intended purpose. Explosions had unique tiles in the tile window port, and the display code for tty tinkered with the colors, but the game had very little awareness of the different types of explosions. - Expand the glyphs to include each of the explosion types: dark, noxious, muddy, wet, magical, fiery and frosty. Pile-markers to represent a pile had been introduced at the display-level, without little to no awareness by the core game. - Expand the glyphs to include piletops, including objects, bodys, and statues. Recently male and female variations of tiles and monsters had been had been introduced, but the mechanics had been mostly done at the display-level through a marker flag. The window port interface then had to increment the tile mapped to the glyph to get the female version of the tile. - Expand the glyphs to include the male and female versions of the monsters, and their corresponding pet versions, ridden, detected versions and statues of them. Direct references to GLYPH_BODY_OFF and GLYPH_STATUE_OFF in object_from_map() in pager.c were getting incomplete results. - Add macros glyph_to_body_corpsenm(glyph) and glyph_to_statue_corpsenm(glyph) macros for obtaining the corpsenm value after passing the glyph_is_body() or glyph_is_statue() test. Other relevant notes: - The tile ordering in the win/share/*.txt tile files has been altered, other.txt in particular. - tilemap.c has had a lot of alterations to accommodate the expanded glyphs. Output that is useful for troubleshooting will end up in tilemappings.lst if OBTAIN_TILEMAP is defined during build. It lists all of the glyphs and which tile it gets mapped to, and also lists each tile and some of the references to it by various glyphs. - An array glyphmap[MAXGLYPH] is now used. It has an entry for each glyph, ordered by glyph, and once reset_glyphs(glyph) has been run, it contains the mapped symindex, default color, glyphflags, and tile index. If USE_TILES is defined during build, the tile.c produced from the tilemap utility populates the tileidx field of each array element with a glyph-to-tile mapping for the glyph. Later on, when reset_glyphmap() is run, the other fields of each element will get populated. - The glyph-to-tile mapping is an added field available to a window port via the glyphinfo struct passed in the documented interface. The old glyph2tile[] array is gone. The various active window ports that had been using glyph2tile[] have been updated to use the new interface mechanism. Disclaimer: There may be some bug fixing or tidying required in the window port code. - reset_glyphmap() is called after config file options parsing has finished, because some config file settings can impact the results produced by reset_glyphmap(). - Everything that passes the glyph_is_cmap(glyph) test must return a valid cmap value from glyph_to_cmap(glyph). - An 'extern glyph_info glyphmap[MAX_GLYPH];' is inserted into the top of only the files which need awareness of it, not inserted into display.h. Presently, the only files that actually need to directly reference the glyphmap[] array are display.c, o_init.c (for shuffling the tiles), and the generated tile.c (if USE_TILES is defined). - Added an MG_MALE glyphflag to complement the MG_FEMALE glyphflag. - Provide an array for wall colorizations. reset_glyphmap() will draw the colors from this array: int array wallcolors[sokoban_walls + 1]; The indices of the wallcolors array are main_walls (0), mines_walls (1), gehennom_walls (2), knox_walls (3), and sokoban_walls (4). In future, a config file option for adjusting the wall colors and/or an 'O' option menu to do the same could be added. Right now, the initializaton of the wallcolors[] array entries in display.c leaves the walls at CLR_GRAY, matching the defsym color. - Most of the display-level kludges for some of the on-the-fly interface features have been removed from map_glyphinfo() as they aren't needed any longer. These glyph expansions adhere more closely to the original glyph mechanics of the game. - Because the glyphs are re-ordered and expanded, an update to editlevel will be required upon merge of these changes.
This commit is contained in:
+9
-9
@@ -355,8 +355,8 @@ start: IBMgraphics
|
|||||||
S_hbeam: \xc4 # meta-D, horizontal rule
|
S_hbeam: \xc4 # meta-D, horizontal rule
|
||||||
S_sw_ml: \xb3 # meta-3, vertical rule
|
S_sw_ml: \xb3 # meta-3, vertical rule
|
||||||
S_sw_mr: \xb3 # meta-3, vertical rule
|
S_sw_mr: \xb3 # meta-3, vertical rule
|
||||||
S_expl_ml: \xb3 # meta-3, vertical rule
|
S_expl_ml: \xb3 # meta-3, vertical rule
|
||||||
S_expl_mr: \xb3 # meta-3, vertical rule
|
S_expl_mr: \xb3 # meta-3, vertical rule
|
||||||
finish
|
finish
|
||||||
|
|
||||||
start: IBMGraphics_1
|
start: IBMGraphics_1
|
||||||
@@ -377,8 +377,8 @@ start: IBMGraphics_1
|
|||||||
S_hbeam: \xc4 # meta-D, horizontal rule
|
S_hbeam: \xc4 # meta-D, horizontal rule
|
||||||
S_sw_ml: \xb3 # meta-3, vertical rule
|
S_sw_ml: \xb3 # meta-3, vertical rule
|
||||||
S_sw_mr: \xb3 # meta-3, vertical rule
|
S_sw_mr: \xb3 # meta-3, vertical rule
|
||||||
S_expl_ml: \xb3 # meta-3, vertical rule
|
S_expl_ml: \xb3 # meta-3, vertical rule
|
||||||
S_expl_mr: \xb3 # meta-3, vertical rule
|
S_expl_mr: \xb3 # meta-3, vertical rule
|
||||||
finish
|
finish
|
||||||
|
|
||||||
start: IBMGraphics_2
|
start: IBMGraphics_2
|
||||||
@@ -403,8 +403,8 @@ start: IBMGraphics_2
|
|||||||
S_hbeam: \xc4 # meta-D, horizontal rule
|
S_hbeam: \xc4 # meta-D, horizontal rule
|
||||||
S_sw_ml: \xb3 # meta-3, vertical rule
|
S_sw_ml: \xb3 # meta-3, vertical rule
|
||||||
S_sw_mr: \xb3 # meta-3, vertical rule
|
S_sw_mr: \xb3 # meta-3, vertical rule
|
||||||
S_expl_ml: \xb3 # meta-3, vertical rule
|
S_expl_ml: \xb3 # meta-3, vertical rule
|
||||||
S_expl_mr: \xb3 # meta-3, vertical rule
|
S_expl_mr: \xb3 # meta-3, vertical rule
|
||||||
finish
|
finish
|
||||||
|
|
||||||
start: RogueIBM
|
start: RogueIBM
|
||||||
@@ -574,8 +574,8 @@ start: curses
|
|||||||
S_hbeam: \xf1 # meta-D, horizontal rule
|
S_hbeam: \xf1 # meta-D, horizontal rule
|
||||||
S_sw_ml: \xf8 # meta-3, vertical rule
|
S_sw_ml: \xf8 # meta-3, vertical rule
|
||||||
S_sw_mr: \xf8 # meta-3, vertical rule
|
S_sw_mr: \xf8 # meta-3, vertical rule
|
||||||
S_expl_ml: \xf8 # meta-3, vertical rule
|
S_expl_ml: \xf8 # meta-3, vertical rule
|
||||||
S_expl_mr: \xf8 # meta-3, vertical rule
|
S_expl_mr: \xf8 # meta-3, vertical rule
|
||||||
finish
|
finish
|
||||||
|
|
||||||
start: DECgraphics
|
start: DECgraphics
|
||||||
@@ -619,7 +619,7 @@ start: DECgraphics
|
|||||||
S_expl_tc: \xef # meta-o, high horizontal line
|
S_expl_tc: \xef # meta-o, high horizontal line
|
||||||
S_expl_ml: \xf8 # meta-x, vertical rule
|
S_expl_ml: \xf8 # meta-x, vertical rule
|
||||||
S_expl_mr: \xf8 # meta-x, vertical rule
|
S_expl_mr: \xf8 # meta-x, vertical rule
|
||||||
S_expl_bc: \xf3 # meta-s, low horizontal line
|
S_expl_bc: \xf3 # meta-s, low horizontal line
|
||||||
finish
|
finish
|
||||||
|
|
||||||
start: MACgraphics
|
start: MACgraphics
|
||||||
|
|||||||
+1
-15
@@ -224,11 +224,6 @@ E const int shield_static[];
|
|||||||
|
|
||||||
#include "spell.h"
|
#include "spell.h"
|
||||||
|
|
||||||
#include "color.h"
|
|
||||||
#ifdef TEXTCOLOR
|
|
||||||
E const int zapcolors[];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
E const struct class_sym def_oc_syms[MAXOCLASSES]; /* default class symbols */
|
E const struct class_sym def_oc_syms[MAXOCLASSES]; /* default class symbols */
|
||||||
E uchar oc_syms[MAXOCLASSES]; /* current class symbols */
|
E uchar oc_syms[MAXOCLASSES]; /* current class symbols */
|
||||||
E const struct class_sym def_monsyms[MAXMCLASSES]; /* default class symbols */
|
E const struct class_sym def_monsyms[MAXMCLASSES]; /* default class symbols */
|
||||||
@@ -556,14 +551,6 @@ struct trapinfo {
|
|||||||
boolean force_bungle;
|
boolean force_bungle;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
xchar gnew; /* perhaps move this bit into the rm structure. */
|
|
||||||
int glyph;
|
|
||||||
#ifndef UNBUFFERED_GLYPHINFO
|
|
||||||
glyph_info glyphinfo;
|
|
||||||
#endif
|
|
||||||
} gbuf_entry;
|
|
||||||
|
|
||||||
enum vanq_order_modes {
|
enum vanq_order_modes {
|
||||||
VANQ_MLVL_MNDX = 0,
|
VANQ_MLVL_MNDX = 0,
|
||||||
VANQ_MSTR_MNDX,
|
VANQ_MSTR_MNDX,
|
||||||
@@ -1074,6 +1061,7 @@ struct instance_globals {
|
|||||||
boolean opt_initial;
|
boolean opt_initial;
|
||||||
boolean opt_from_file;
|
boolean opt_from_file;
|
||||||
boolean opt_need_redraw; /* for doset() */
|
boolean opt_need_redraw; /* for doset() */
|
||||||
|
boolean opt_need_glyph_reset;
|
||||||
/* use menucolors to show colors in the pick-a-color menu */
|
/* use menucolors to show colors in the pick-a-color menu */
|
||||||
boolean save_menucolors; /* copy of iflags.use_menu_colors */
|
boolean save_menucolors; /* copy of iflags.use_menu_colors */
|
||||||
struct menucoloring *save_colorings; /* copy of g.menu_colorings */
|
struct menucoloring *save_colorings; /* copy of g.menu_colorings */
|
||||||
@@ -1276,8 +1264,6 @@ struct const_globals {
|
|||||||
|
|
||||||
E const struct const_globals cg;
|
E const struct const_globals cg;
|
||||||
|
|
||||||
E const glyph_info nul_glyphinfo;
|
|
||||||
|
|
||||||
#undef E
|
#undef E
|
||||||
|
|
||||||
#endif /* DECL_H */
|
#endif /* DECL_H */
|
||||||
|
|||||||
+6
-2
@@ -103,6 +103,7 @@
|
|||||||
PCHAR2( 9, '-', S_tdwall, "tdwall", "wall", CLR(CLR_GRAY))
|
PCHAR2( 9, '-', S_tdwall, "tdwall", "wall", CLR(CLR_GRAY))
|
||||||
PCHAR2(10, '|', S_tlwall, "tlwall", "wall", CLR(CLR_GRAY))
|
PCHAR2(10, '|', S_tlwall, "tlwall", "wall", CLR(CLR_GRAY))
|
||||||
PCHAR2(11, '|', S_trwall, "trwall", "wall", CLR(CLR_GRAY))
|
PCHAR2(11, '|', S_trwall, "trwall", "wall", CLR(CLR_GRAY))
|
||||||
|
/* start cmap A */
|
||||||
PCHAR2(12, '.', S_ndoor, "no door", "doorway", CLR(CLR_GRAY))
|
PCHAR2(12, '.', S_ndoor, "no door", "doorway", CLR(CLR_GRAY))
|
||||||
PCHAR2(13, '-', S_vodoor, "vertical open door", "open door", CLR(CLR_BROWN))
|
PCHAR2(13, '-', S_vodoor, "vertical open door", "open door", CLR(CLR_BROWN))
|
||||||
PCHAR2(14, '|', S_hodoor, "horizontal open door", "open door", CLR(CLR_BROWN))
|
PCHAR2(14, '|', S_hodoor, "horizontal open door", "open door", CLR(CLR_BROWN))
|
||||||
@@ -122,7 +123,9 @@
|
|||||||
PCHAR( 28, '>', S_brdnstair, "branch staircase down", CLR(CLR_YELLOW))
|
PCHAR( 28, '>', S_brdnstair, "branch staircase down", CLR(CLR_YELLOW))
|
||||||
PCHAR( 29, '<', S_brupladder, "branch ladder up", CLR(CLR_YELLOW))
|
PCHAR( 29, '<', S_brupladder, "branch ladder up", CLR(CLR_YELLOW))
|
||||||
PCHAR( 30, '>', S_brdnladder, "branch ladder down", CLR(CLR_YELLOW))
|
PCHAR( 30, '>', S_brdnladder, "branch ladder down", CLR(CLR_YELLOW))
|
||||||
|
/* end cmap A */
|
||||||
PCHAR( 31, '_', S_altar, "altar", CLR(CLR_GRAY))
|
PCHAR( 31, '_', S_altar, "altar", CLR(CLR_GRAY))
|
||||||
|
/* start cmap B */
|
||||||
PCHAR( 32, '|', S_grave, "grave", CLR(CLR_WHITE))
|
PCHAR( 32, '|', S_grave, "grave", CLR(CLR_WHITE))
|
||||||
PCHAR2(33, '\\', S_throne, "throne", "opulent throne", CLR(HI_GOLD))
|
PCHAR2(33, '\\', S_throne, "throne", "opulent throne", CLR(HI_GOLD))
|
||||||
PCHAR( 34, '#', S_sink, "sink", CLR(CLR_GRAY))
|
PCHAR( 34, '#', S_sink, "sink", CLR(CLR_GRAY))
|
||||||
@@ -169,6 +172,7 @@
|
|||||||
PCHAR( 67, '^', S_polymorph_trap, "polymorph trap", CLR(CLR_BRIGHT_GREEN))
|
PCHAR( 67, '^', S_polymorph_trap, "polymorph trap", CLR(CLR_BRIGHT_GREEN))
|
||||||
PCHAR( 68, '~', S_vibrating_square, "vibrating square", CLR(CLR_MAGENTA))
|
PCHAR( 68, '~', S_vibrating_square, "vibrating square", CLR(CLR_MAGENTA))
|
||||||
/* end traps */
|
/* end traps */
|
||||||
|
/* end cmap B */
|
||||||
/* */
|
/* */
|
||||||
/* begin special effects */
|
/* begin special effects */
|
||||||
/* */
|
/* */
|
||||||
@@ -178,19 +182,19 @@
|
|||||||
PCHAR2(70, '-', S_hbeam, "horizontal beam", "", CLR(CLR_GRAY))
|
PCHAR2(70, '-', S_hbeam, "horizontal beam", "", CLR(CLR_GRAY))
|
||||||
PCHAR2(71, '\\', S_lslant, "left slant beam", "", CLR(CLR_GRAY))
|
PCHAR2(71, '\\', S_lslant, "left slant beam", "", CLR(CLR_GRAY))
|
||||||
PCHAR2(72, '/', S_rslant, "right slant beam", "", CLR(CLR_GRAY))
|
PCHAR2(72, '/', S_rslant, "right slant beam", "", CLR(CLR_GRAY))
|
||||||
|
/* start cmap C */
|
||||||
PCHAR2(73, '*', S_digbeam, "dig beam", "", CLR(CLR_WHITE))
|
PCHAR2(73, '*', S_digbeam, "dig beam", "", CLR(CLR_WHITE))
|
||||||
PCHAR2(74, '!', S_flashbeam, "flash beam", "", CLR(CLR_WHITE))
|
PCHAR2(74, '!', S_flashbeam, "flash beam", "", CLR(CLR_WHITE))
|
||||||
PCHAR2(75, ')', S_boomleft, "boom left", "", CLR(HI_WOOD))
|
PCHAR2(75, ')', S_boomleft, "boom left", "", CLR(HI_WOOD))
|
||||||
PCHAR2(76, '(', S_boomright, "boom right", "", CLR(HI_WOOD))
|
PCHAR2(76, '(', S_boomright, "boom right", "", CLR(HI_WOOD))
|
||||||
/* */
|
|
||||||
/* 4 magic shield symbols */
|
/* 4 magic shield symbols */
|
||||||
/* */
|
|
||||||
PCHAR2(77, '0', S_ss1, "shield1", "", CLR(HI_ZAP))
|
PCHAR2(77, '0', S_ss1, "shield1", "", CLR(HI_ZAP))
|
||||||
PCHAR2(78, '#', S_ss2, "shield2", "", CLR(HI_ZAP))
|
PCHAR2(78, '#', S_ss2, "shield2", "", CLR(HI_ZAP))
|
||||||
PCHAR2(79, '@', S_ss3, "shield3", "", CLR(HI_ZAP))
|
PCHAR2(79, '@', S_ss3, "shield3", "", CLR(HI_ZAP))
|
||||||
PCHAR2(80, '*', S_ss4, "shield4", "", CLR(HI_ZAP))
|
PCHAR2(80, '*', S_ss4, "shield4", "", CLR(HI_ZAP))
|
||||||
PCHAR( 81, '#', S_poisoncloud, "poison cloud", CLR(CLR_BRIGHT_GREEN))
|
PCHAR( 81, '#', S_poisoncloud, "poison cloud", CLR(CLR_BRIGHT_GREEN))
|
||||||
PCHAR( 82, '?', S_goodpos, "valid position", CLR(CLR_BRIGHT_GREEN))
|
PCHAR( 82, '?', S_goodpos, "valid position", CLR(CLR_BRIGHT_GREEN))
|
||||||
|
/* end cmap C */
|
||||||
/* */
|
/* */
|
||||||
/* The 8 swallow symbols. Do NOT separate. */
|
/* The 8 swallow symbols. Do NOT separate. */
|
||||||
/* To change order or add, see the function swallow_to_glyph() */
|
/* To change order or add, see the function swallow_to_glyph() */
|
||||||
|
|||||||
+655
-183
@@ -13,18 +13,6 @@
|
|||||||
#include "mondata.h" /* for mindless() */
|
#include "mondata.h" /* for mindless() */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* types of explosions */
|
|
||||||
enum explosion_types {
|
|
||||||
EXPL_DARK = 0,
|
|
||||||
EXPL_NOXIOUS = 1,
|
|
||||||
EXPL_MUDDY = 2,
|
|
||||||
EXPL_WET = 3,
|
|
||||||
EXPL_MAGICAL = 4,
|
|
||||||
EXPL_FIERY = 5,
|
|
||||||
EXPL_FROSTY = 6,
|
|
||||||
EXPL_MAX = 7
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* vobj_at()
|
* vobj_at()
|
||||||
*
|
*
|
||||||
@@ -241,23 +229,26 @@ enum explosion_types {
|
|||||||
* Display the hero. It is assumed that all checks necessary to determine
|
* Display the hero. It is assumed that all checks necessary to determine
|
||||||
* _if_ the hero can be seen have already been done.
|
* _if_ the hero can be seen have already been done.
|
||||||
*/
|
*/
|
||||||
#define maybe_display_usteed(otherwise_self) \
|
#define maybe_display_usteed(otherwise_self) \
|
||||||
((u.usteed && mon_visible(u.usteed)) \
|
((u.usteed && mon_visible(u.usteed)) \
|
||||||
? ridden_mon_to_glyph(u.usteed, rn2_on_display_rng) \
|
? ridden_mon_to_glyph(u.usteed, rn2_on_display_rng) \
|
||||||
: (otherwise_self))
|
: (otherwise_self))
|
||||||
|
|
||||||
#define display_self() \
|
#define display_self() \
|
||||||
show_glyph(u.ux, u.uy, \
|
show_glyph(u.ux, u.uy, \
|
||||||
maybe_display_usteed((U_AP_TYPE == M_AP_NOTHING) \
|
maybe_display_usteed( \
|
||||||
? hero_glyph \
|
((int) U_AP_TYPE == M_AP_NOTHING) ? hero_glyph \
|
||||||
: (U_AP_TYPE == M_AP_FURNITURE) \
|
: ((int) U_AP_TYPE == M_AP_FURNITURE) \
|
||||||
? cmap_to_glyph(g.youmonst.mappearance) \
|
? cmap_to_glyph((int) g.youmonst.mappearance) \
|
||||||
: (U_AP_TYPE == M_AP_OBJECT) \
|
: ((int) U_AP_TYPE == M_AP_OBJECT) \
|
||||||
? objnum_to_glyph(g.youmonst.mappearance) \
|
? objnum_to_glyph( \
|
||||||
/* else U_AP_TYPE == M_AP_MONSTER */ \
|
(int) g.youmonst.mappearance) /* else U_AP_TYPE == \
|
||||||
: monnum_to_glyph(g.youmonst.mappearance)))
|
M_AP_MONSTER */ \
|
||||||
|
: monnum_to_glyph((int) g.youmonst.mappearance, (int) Ugender)))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* NetHack glyphs
|
||||||
|
*
|
||||||
* A glyph is an abstraction that represents a _unique_ monster, object,
|
* A glyph is an abstraction that represents a _unique_ monster, object,
|
||||||
* dungeon part, or effect. The uniqueness is important. For example,
|
* dungeon part, or effect. The uniqueness is important. For example,
|
||||||
* It is not enough to have four (one for each "direction") zap beam glyphs,
|
* It is not enough to have four (one for each "direction") zap beam glyphs,
|
||||||
@@ -266,68 +257,187 @@ enum explosion_types {
|
|||||||
* [print_glyph()] can produce something different for each type of glyph.
|
* [print_glyph()] can produce something different for each type of glyph.
|
||||||
* That is, a beam of cold and a beam of fire would not only be different
|
* That is, a beam of cold and a beam of fire would not only be different
|
||||||
* colors, but would also be represented by different symbols.
|
* colors, but would also be represented by different symbols.
|
||||||
*
|
*/
|
||||||
|
|
||||||
|
#define NUM_ZAP 8 /* number of zap beam types */
|
||||||
|
|
||||||
|
/*
|
||||||
* Glyphs are grouped for easy accessibility:
|
* Glyphs are grouped for easy accessibility:
|
||||||
*
|
*
|
||||||
* monster Represents all the wild (not tame) monsters. Count: NUMMONS.
|
* male monsters Represents all the wild (not tame) male monsters.
|
||||||
|
* Count: NUMMONS.
|
||||||
*
|
*
|
||||||
* pet Represents all of the tame monsters. Count: NUMMONS
|
* female monsters Represents all the wild (not tame) female monsters.
|
||||||
|
* Count: NUMMONS.
|
||||||
*
|
*
|
||||||
* invisible Invisible monster placeholder. Count: 1
|
* male pets Represents all of the male tame monsters.
|
||||||
|
* Count: NUMMONS.
|
||||||
*
|
*
|
||||||
* detect Represents all detected monsters. Count: NUMMONS
|
* female pets Represents all of the female tame monsters.
|
||||||
|
* Count: NUMMONS.
|
||||||
*
|
*
|
||||||
* corpse One for each monster. Count: NUMMONS
|
* invisible Invisible monster placeholder.
|
||||||
|
* Count: 1.
|
||||||
*
|
*
|
||||||
* ridden Represents all monsters being ridden. Count: NUMMONS
|
* detect (male) Represents all detected male monsters.
|
||||||
|
* Count: NUMMONS.
|
||||||
*
|
*
|
||||||
* object One for each object. Count: NUM_OBJECTS
|
* detect (female) Represents all detected female monsters.
|
||||||
|
* Count: NUMMONS.
|
||||||
*
|
*
|
||||||
* cmap One for each entry in the character map. The character map
|
* corpse One for each monster (male/female not differentiated).
|
||||||
* is the dungeon features and other miscellaneous things.
|
* Count: NUMMONS.
|
||||||
* Count: MAXPCHARS
|
|
||||||
*
|
*
|
||||||
* explosions A set of nine for each of the following seven explosion types:
|
* ridden (male) Represents all male monsters being ridden.
|
||||||
* dark, noxious, muddy, wet, magical, fiery, frosty.
|
* Count: NUMMONS
|
||||||
* The nine positions represent those surrounding the hero.
|
|
||||||
* Count: MAXEXPCHARS * EXPL_MAX
|
|
||||||
*
|
*
|
||||||
* zap beam A set of four (there are four directions) for each beam type.
|
* ridden (female) Represents all female monsters being ridden.
|
||||||
* The beam type is shifted over 2 positions and the direction
|
* Count: NUMMONS
|
||||||
* is stored in the lower 2 bits. Count: NUM_ZAP << 2
|
|
||||||
*
|
*
|
||||||
* swallow A set of eight for each monster. The eight positions rep-
|
* object One for each object.
|
||||||
* resent those surrounding the hero. The monster number is
|
* Count: NUM_OBJECTS
|
||||||
* shifted over 3 positions and the swallow position is stored
|
|
||||||
* in the lower three bits. Count: NUMMONS << 3
|
|
||||||
*
|
*
|
||||||
* warning A set of six representing the different warning levels.
|
* Stone Stone
|
||||||
|
* Count: 1
|
||||||
*
|
*
|
||||||
* statue One for each monster. Count: NUMMONS
|
* main walls level walls (main)
|
||||||
|
* Count: (S_trwall - S_vwall) + 1 = 11
|
||||||
*
|
*
|
||||||
* unexplored One for unexplored areas of the map
|
* mines walls level walls (mines)
|
||||||
* nothing Nothing but background
|
* Count: (S_trwall - S_vwall) + 1 = 11
|
||||||
|
*
|
||||||
|
* gehennom walls level walls (gehennom)
|
||||||
|
* Count: (S_trwall - S_vwall) + 1 = 11
|
||||||
|
*
|
||||||
|
* knox walls level walls (knox)
|
||||||
|
* Count: (S_trwall - S_vwall) + 1 = 11
|
||||||
|
*
|
||||||
|
* sokoban walls level walls (sokoban)
|
||||||
|
* Count: (S_trwall - S_vwall) + 1 = 11
|
||||||
|
*
|
||||||
|
* cmap A S_ndoor through S_brdnladder
|
||||||
|
* Count: (S_brdnladder - S_ndoor) + 1 = 19
|
||||||
|
*
|
||||||
|
* Altars Altar (Unaligned, Chaotic, Neutral, Lawful, shrine)
|
||||||
|
* Count: 5
|
||||||
|
*
|
||||||
|
* cmap B S_grave through S_vibrating_square
|
||||||
|
* Count: (S_vibrating_square - S_grave) + 1 = 37
|
||||||
|
*
|
||||||
|
* zap beams set of four (there are four directions) HI_ZAP.
|
||||||
|
* Count: 4 * NUM_ZAP
|
||||||
|
*
|
||||||
|
* cmap C S_digbeam through S_goodpos
|
||||||
|
* Count: (S_goodpos - S_digbeam) + 1 = 10
|
||||||
|
*
|
||||||
|
* swallow A set of eight for each monster. The eight positions
|
||||||
|
* represent those surrounding the hero. The monster
|
||||||
|
* number is shifted over 3 positions and the swallow
|
||||||
|
* position is stored in the lower three bits.
|
||||||
|
* Count: NUMMONS << 3
|
||||||
|
*
|
||||||
|
* dark explosions A set of nine.
|
||||||
|
* Count: MAXEXPCHAR
|
||||||
|
*
|
||||||
|
* noxious explosions A set of nine.
|
||||||
|
* Count: MAXEXPCHAR
|
||||||
|
*
|
||||||
|
* muddy explosions A set of nine.
|
||||||
|
* Count: MAXEXPCHAR
|
||||||
|
*
|
||||||
|
* wet explosions A set of nine.
|
||||||
|
* Count: MAXEXPCHAR
|
||||||
|
*
|
||||||
|
* magical explosions A set of nine.
|
||||||
|
* Count: MAXEXPCHAR
|
||||||
|
*
|
||||||
|
* fiery explosions A set of nine.
|
||||||
|
* Count: MAXEXPCHAR
|
||||||
|
*
|
||||||
|
* frosty explosions A set of nine.
|
||||||
|
* Count: MAXEXPCHAR
|
||||||
|
*
|
||||||
|
* warning A set of six representing the different warning levels.
|
||||||
|
* Count: 6
|
||||||
|
*
|
||||||
|
* statues (male) One for each male monster.
|
||||||
|
* Count: NUMMONS
|
||||||
|
*
|
||||||
|
* statues (female) One for each female mo nster.
|
||||||
|
* Count: NUMMONS
|
||||||
|
*
|
||||||
|
* objects piletop Represents the top of a pile as well as
|
||||||
|
* the object.
|
||||||
|
* Count: NUM_OBJECTS
|
||||||
|
*
|
||||||
|
* bodies piletop Represents the top of a pile as well as
|
||||||
|
* the object, corpse in this case.
|
||||||
|
* Count: NUMMONS
|
||||||
|
*
|
||||||
|
* male statues piletop Represents the top of a pile as well as
|
||||||
|
* the statue of a male monster.
|
||||||
|
* Count: NUMMONS
|
||||||
|
*
|
||||||
|
* female statues piletop Represents the top of a pile as well as
|
||||||
|
* the statue of a female monster.
|
||||||
|
* Count: NUMMONS
|
||||||
|
*
|
||||||
|
* unexplored One for unexplored areas of the map
|
||||||
|
* nothing Nothing but background
|
||||||
*
|
*
|
||||||
* The following are offsets used to convert to and from a glyph.
|
* The following are offsets used to convert to and from a glyph.
|
||||||
*/
|
*/
|
||||||
#define NUM_ZAP 8 /* number of zap beam types */
|
|
||||||
|
|
||||||
#define GLYPH_MON_OFF 0
|
enum glyph_offsets {
|
||||||
#define GLYPH_PET_OFF (NUMMONS + GLYPH_MON_OFF)
|
GLYPH_MON_OFF = 0,
|
||||||
#define GLYPH_INVIS_OFF (NUMMONS + GLYPH_PET_OFF)
|
GLYPH_MON_MALE_OFF = (GLYPH_MON_OFF),
|
||||||
#define GLYPH_DETECT_OFF (1 + GLYPH_INVIS_OFF)
|
GLYPH_MON_FEM_OFF = (NUMMONS + GLYPH_MON_MALE_OFF),
|
||||||
#define GLYPH_BODY_OFF (NUMMONS + GLYPH_DETECT_OFF)
|
GLYPH_PET_OFF = (NUMMONS + GLYPH_MON_FEM_OFF),
|
||||||
#define GLYPH_RIDDEN_OFF (NUMMONS + GLYPH_BODY_OFF)
|
GLYPH_PET_MALE_OFF = (GLYPH_PET_OFF),
|
||||||
#define GLYPH_OBJ_OFF (NUMMONS + GLYPH_RIDDEN_OFF)
|
GLYPH_PET_FEM_OFF = (NUMMONS + GLYPH_PET_MALE_OFF),
|
||||||
#define GLYPH_CMAP_OFF (NUM_OBJECTS + GLYPH_OBJ_OFF)
|
GLYPH_INVIS_OFF = (NUMMONS + GLYPH_PET_FEM_OFF),
|
||||||
#define GLYPH_EXPLODE_OFF ((MAXPCHARS - MAXEXPCHARS) + GLYPH_CMAP_OFF)
|
GLYPH_DETECT_OFF = (1 + GLYPH_INVIS_OFF),
|
||||||
#define GLYPH_ZAP_OFF ((MAXEXPCHARS * EXPL_MAX) + GLYPH_EXPLODE_OFF)
|
GLYPH_DETECT_MALE_OFF = (GLYPH_DETECT_OFF),
|
||||||
#define GLYPH_SWALLOW_OFF ((NUM_ZAP << 2) + GLYPH_ZAP_OFF)
|
GLYPH_DETECT_FEM_OFF = (NUMMONS + GLYPH_DETECT_MALE_OFF),
|
||||||
#define GLYPH_WARNING_OFF ((NUMMONS << 3) + GLYPH_SWALLOW_OFF)
|
GLYPH_BODY_OFF = (NUMMONS + GLYPH_DETECT_FEM_OFF),
|
||||||
#define GLYPH_STATUE_OFF (WARNCOUNT + GLYPH_WARNING_OFF)
|
GLYPH_RIDDEN_OFF = (NUMMONS + GLYPH_BODY_OFF),
|
||||||
#define GLYPH_UNEXPLORED_OFF (NUMMONS + GLYPH_STATUE_OFF)
|
GLYPH_RIDDEN_MALE_OFF = (GLYPH_RIDDEN_OFF),
|
||||||
#define GLYPH_NOTHING_OFF (GLYPH_UNEXPLORED_OFF + 1)
|
GLYPH_RIDDEN_FEM_OFF = (NUMMONS + GLYPH_RIDDEN_MALE_OFF),
|
||||||
#define MAX_GLYPH (GLYPH_NOTHING_OFF + 1)
|
GLYPH_OBJ_OFF = (NUMMONS + GLYPH_RIDDEN_FEM_OFF),
|
||||||
|
GLYPH_CMAP_OFF = (NUM_OBJECTS + GLYPH_OBJ_OFF),
|
||||||
|
GLYPH_CMAP_STONE_OFF = (GLYPH_CMAP_OFF),
|
||||||
|
GLYPH_CMAP_MAIN_OFF = (1 + GLYPH_CMAP_STONE_OFF),
|
||||||
|
GLYPH_CMAP_MINES_OFF = (((S_trwall - S_vwall) + 1) + GLYPH_CMAP_MAIN_OFF),
|
||||||
|
GLYPH_CMAP_GEH_OFF = (((S_trwall - S_vwall) + 1) + GLYPH_CMAP_MINES_OFF),
|
||||||
|
GLYPH_CMAP_KNOX_OFF = (((S_trwall - S_vwall) + 1) + GLYPH_CMAP_GEH_OFF),
|
||||||
|
GLYPH_CMAP_SOKO_OFF = (((S_trwall - S_vwall) + 1) + GLYPH_CMAP_KNOX_OFF),
|
||||||
|
GLYPH_CMAP_A_OFF = (((S_trwall - S_vwall) + 1) + GLYPH_CMAP_SOKO_OFF),
|
||||||
|
GLYPH_ALTAR_OFF = (((S_brdnladder - S_ndoor) + 1) + GLYPH_CMAP_A_OFF),
|
||||||
|
GLYPH_CMAP_B_OFF = (5 + GLYPH_ALTAR_OFF),
|
||||||
|
GLYPH_ZAP_OFF = (((S_vibrating_square - S_grave) + 1) + GLYPH_CMAP_B_OFF),
|
||||||
|
GLYPH_CMAP_C_OFF = ((NUM_ZAP << 2) + GLYPH_ZAP_OFF),
|
||||||
|
GLYPH_SWALLOW_OFF = (((S_goodpos - S_digbeam) + 1) + GLYPH_CMAP_C_OFF),
|
||||||
|
GLYPH_EXPLODE_OFF = ((NUMMONS << 3) + GLYPH_SWALLOW_OFF),
|
||||||
|
GLYPH_EXPLODE_DARK_OFF = (GLYPH_EXPLODE_OFF),
|
||||||
|
GLYPH_EXPLODE_NOXIOUS_OFF = (MAXEXPCHARS + GLYPH_EXPLODE_DARK_OFF),
|
||||||
|
GLYPH_EXPLODE_MUDDY_OFF = (MAXEXPCHARS + GLYPH_EXPLODE_NOXIOUS_OFF),
|
||||||
|
GLYPH_EXPLODE_WET_OFF = (MAXEXPCHARS + GLYPH_EXPLODE_MUDDY_OFF),
|
||||||
|
GLYPH_EXPLODE_MAGICAL_OFF = (MAXEXPCHARS + GLYPH_EXPLODE_WET_OFF),
|
||||||
|
GLYPH_EXPLODE_FIERY_OFF = (MAXEXPCHARS + GLYPH_EXPLODE_MAGICAL_OFF),
|
||||||
|
GLYPH_EXPLODE_FROSTY_OFF = (MAXEXPCHARS + GLYPH_EXPLODE_FIERY_OFF),
|
||||||
|
GLYPH_WARNING_OFF = (MAXEXPCHARS + GLYPH_EXPLODE_FROSTY_OFF),
|
||||||
|
GLYPH_STATUE_OFF = (WARNCOUNT + GLYPH_WARNING_OFF),
|
||||||
|
GLYPH_STATUE_MALE_OFF = (GLYPH_STATUE_OFF),
|
||||||
|
GLYPH_STATUE_FEM_OFF = (NUMMONS + GLYPH_STATUE_MALE_OFF),
|
||||||
|
GLYPH_PILETOP_OFF = (NUMMONS + GLYPH_STATUE_FEM_OFF),
|
||||||
|
GLYPH_OBJ_PILETOP_OFF = (GLYPH_PILETOP_OFF),
|
||||||
|
GLYPH_BODY_PILETOP_OFF = (NUM_OBJECTS + GLYPH_OBJ_PILETOP_OFF),
|
||||||
|
GLYPH_STATUE_MALE_PILETOP_OFF = (NUMMONS + GLYPH_BODY_PILETOP_OFF),
|
||||||
|
GLYPH_STATUE_FEM_PILETOP_OFF = (NUMMONS + GLYPH_STATUE_MALE_PILETOP_OFF),
|
||||||
|
GLYPH_UNEXPLORED_OFF = (NUMMONS + GLYPH_STATUE_FEM_PILETOP_OFF),
|
||||||
|
GLYPH_NOTHING_OFF = (GLYPH_UNEXPLORED_OFF + 1),
|
||||||
|
MAX_GLYPH
|
||||||
|
};
|
||||||
|
|
||||||
#define NO_GLYPH MAX_GLYPH
|
#define NO_GLYPH MAX_GLYPH
|
||||||
#define GLYPH_INVISIBLE GLYPH_INVIS_OFF
|
#define GLYPH_INVISIBLE GLYPH_INVIS_OFF
|
||||||
@@ -335,71 +445,100 @@ enum explosion_types {
|
|||||||
#define GLYPH_NOTHING GLYPH_NOTHING_OFF
|
#define GLYPH_NOTHING GLYPH_NOTHING_OFF
|
||||||
|
|
||||||
#define warning_to_glyph(mwarnlev) ((mwarnlev) + GLYPH_WARNING_OFF)
|
#define warning_to_glyph(mwarnlev) ((mwarnlev) + GLYPH_WARNING_OFF)
|
||||||
#define mon_to_glyph(mon, rng) \
|
#define mon_to_glyph(mon, rng) \
|
||||||
((int) what_mon(monsndx((mon)->data), rng) + GLYPH_MON_OFF)
|
((int) what_mon(monsndx((mon)->data), rng) + \
|
||||||
#define detected_mon_to_glyph(mon, rng) \
|
(((mon)->female == 0) ? GLYPH_MON_MALE_OFF : GLYPH_MON_FEM_OFF))
|
||||||
((int) what_mon(monsndx((mon)->data), rng) + GLYPH_DETECT_OFF)
|
#define detected_mon_to_glyph(mon, rng) \
|
||||||
#define ridden_mon_to_glyph(mon, rng) \
|
((int) what_mon(monsndx((mon)->data), rng) + \
|
||||||
((int) what_mon(monsndx((mon)->data), rng) + GLYPH_RIDDEN_OFF)
|
(((mon)->female == 0) ? GLYPH_DETECT_MALE_OFF : GLYPH_DETECT_FEM_OFF))
|
||||||
#define pet_to_glyph(mon, rng) \
|
#define ridden_mon_to_glyph(mon, rng) \
|
||||||
((int) what_mon(monsndx((mon)->data), rng) + GLYPH_PET_OFF)
|
((int) what_mon(monsndx((mon)->data), rng) + \
|
||||||
|
(((mon)->female == 0) ? GLYPH_RIDDEN_MALE_OFF : GLYPH_RIDDEN_FEM_OFF))
|
||||||
|
#define pet_to_glyph(mon, rng) \
|
||||||
|
((int) what_mon(monsndx((mon)->data), rng) + \
|
||||||
|
(((mon)->female == 0) ? GLYPH_PET_MALE_OFF : GLYPH_PET_FEM_OFF))
|
||||||
|
|
||||||
/* This has the unfortunate side effect of needing a global variable */
|
#define altar_to_glyph(amsk) \
|
||||||
/* to store a result. 'otg_temp' is defined and declared in decl.{ch}. */
|
(((amsk & AM_NONE) == AM_NONE) \
|
||||||
#define random_obj_to_glyph(rng) \
|
? (GLYPH_ALTAR_OFF + 0) \
|
||||||
((g.otg_temp = random_object(rng)) == CORPSE \
|
: ((amsk & AM_CHAOTIC) == AM_CHAOTIC) \
|
||||||
? random_monster(rng) + GLYPH_BODY_OFF \
|
? (GLYPH_ALTAR_OFF + 1) \
|
||||||
: g.otg_temp + GLYPH_OBJ_OFF)
|
: ((amsk & AM_NEUTRAL) == AM_NEUTRAL) \
|
||||||
|
? (GLYPH_ALTAR_OFF + 2) \
|
||||||
|
: ((amsk & AM_NEUTRAL) == AM_LAWFUL) \
|
||||||
|
? (GLYPH_ALTAR_OFF + 3) \
|
||||||
|
: ((amsk & AM_NEUTRAL) == AM_SHRINE) \
|
||||||
|
? (GLYPH_ALTAR_OFF + 4) \
|
||||||
|
: (GLYPH_ALTAR_OFF + 2))
|
||||||
|
|
||||||
#define obj_to_glyph(obj, rng) \
|
/* not used, nor is it correct
|
||||||
(((obj)->otyp == STATUE) \
|
#define zap_to_glyph(zaptype, cmap_idx) \
|
||||||
? statue_to_glyph(obj, rng) \
|
((((cmap_idx) - S_vbeam) + 1) + GLYPH_ZAP_OFF)
|
||||||
: Hallucination \
|
*/
|
||||||
? random_obj_to_glyph(rng) \
|
|
||||||
: ((obj)->otyp == CORPSE) \
|
|
||||||
? (int) (obj)->corpsenm + GLYPH_BODY_OFF \
|
|
||||||
: (int) (obj)->otyp + GLYPH_OBJ_OFF)
|
|
||||||
|
|
||||||
/* MRKR: Statues now have glyphs corresponding to the monster they */
|
#define explosion_to_glyph(expltyp, idx) \
|
||||||
/* represent and look like monsters when you are hallucinating. */
|
((expltyp == EXPL_FROSTY) ? \
|
||||||
|
(((idx) - S_expl_tl) + GLYPH_EXPLODE_FROSTY_OFF) \
|
||||||
|
: (expltyp == EXPL_FIERY) ? \
|
||||||
|
(((idx) - S_expl_tl) + GLYPH_EXPLODE_FIERY_OFF) \
|
||||||
|
: (expltyp == EXPL_MAGICAL) ? \
|
||||||
|
(((idx) - S_expl_tl) + GLYPH_EXPLODE_MAGICAL_OFF) \
|
||||||
|
: (expltyp == EXPL_WET) ? \
|
||||||
|
(((idx) - S_expl_tl) + GLYPH_EXPLODE_WET_OFF) \
|
||||||
|
: (expltyp == EXPL_MUDDY) ? \
|
||||||
|
(((idx) - S_expl_tl) + GLYPH_EXPLODE_MUDDY_OFF) \
|
||||||
|
: (expltyp == EXPL_NOXIOUS) ? \
|
||||||
|
(((idx) - S_expl_tl) + GLYPH_EXPLODE_NOXIOUS_OFF) \
|
||||||
|
: (((idx) - S_expl_tl) + GLYPH_EXPLODE_FIERY_OFF))
|
||||||
|
|
||||||
#define statue_to_glyph(obj, rng) \
|
#define cmap_walls_to_glyph(cmap_idx) \
|
||||||
(Hallucination ? random_monster(rng) + GLYPH_MON_OFF \
|
( In_mines(&u.uz) ? (((cmap_idx) - S_vwall) + GLYPH_CMAP_MINES_OFF) \
|
||||||
: (int) (obj)->corpsenm + GLYPH_STATUE_OFF)
|
: In_hell(&u.uz) ? (((cmap_idx) - S_vwall) + GLYPH_CMAP_GEH_OFF) \
|
||||||
|
: Is_knox(&u.uz) ? (((cmap_idx) - S_vwall) + GLYPH_CMAP_KNOX_OFF) \
|
||||||
|
: In_sokoban(&u.uz) ? (((cmap_idx) - S_vwall) + GLYPH_CMAP_SOKO_OFF) \
|
||||||
|
: (((cmap_idx) - S_vwall) + GLYPH_CMAP_MAIN_OFF))
|
||||||
|
|
||||||
/* briefly used for Qt's "paper doll" inventory which shows map tiles for
|
#define cmap_a_to_glyph(cmap_idx) \
|
||||||
equipped objects; those vary like floor items during hallucination now
|
(((cmap_idx) - S_ndoor) + GLYPH_CMAP_A_OFF)
|
||||||
so this isn't used anywhere */
|
|
||||||
#define obj_to_true_glyph(obj) \
|
|
||||||
(((obj)->otyp == STATUE) \
|
|
||||||
? ((int) (obj)->corpsenm + GLYPH_STATUE_OFF) \
|
|
||||||
: ((obj)->otyp == CORPSE) \
|
|
||||||
? ((int) (obj)->corpsenm + GLYPH_BODY_OFF) \
|
|
||||||
: ((int) (obj)->otyp + GLYPH_OBJ_OFF))
|
|
||||||
|
|
||||||
#define cmap_to_glyph(cmap_idx) ((int) (cmap_idx) + GLYPH_CMAP_OFF)
|
#define cmap_b_to_glyph(cmap_idx) \
|
||||||
#define explosion_to_glyph(expltype, idx) \
|
(((cmap_idx) - S_grave) + GLYPH_CMAP_B_OFF)
|
||||||
((((expltype) * MAXEXPCHARS) + ((idx) - S_expl_tl)) + GLYPH_EXPLODE_OFF)
|
|
||||||
|
#define cmap_c_to_glyph(cmap_idx) \
|
||||||
|
(((cmap_idx) - S_digbeam) + GLYPH_CMAP_C_OFF)
|
||||||
|
|
||||||
|
#define cmap_to_glyph(cmap_idx) \
|
||||||
|
( ((cmap_idx) == S_stone) ? GLYPH_CMAP_STONE_OFF \
|
||||||
|
: ((cmap_idx) <= S_trwall) ? cmap_walls_to_glyph(cmap_idx) \
|
||||||
|
: ((cmap_idx) < S_altar) ? cmap_a_to_glyph(cmap_idx) \
|
||||||
|
: ((cmap_idx) == S_altar) ? altar_to_glyph(AM_NEUTRAL) \
|
||||||
|
: ((cmap_idx) <= S_vibrating_square) ? cmap_b_to_glyph(cmap_idx) \
|
||||||
|
: ((cmap_idx) <= S_goodpos) ? cmap_c_to_glyph(cmap_idx) \
|
||||||
|
: NO_GLYPH)
|
||||||
|
|
||||||
#define trap_to_glyph(trap) \
|
#define trap_to_glyph(trap) \
|
||||||
cmap_to_glyph(trap_to_defsym((trap)->ttyp))
|
cmap_to_glyph(trap_to_defsym(((int) (trap)->ttyp)))
|
||||||
|
|
||||||
/* Not affected by hallucination. Gives a generic body for CORPSE */
|
/* Not affected by hallucination. Gives a generic body for CORPSE */
|
||||||
/* MRKR: ...and the generic statue */
|
/* MRKR: ...and the generic statue */
|
||||||
#define objnum_to_glyph(onum) ((int) (onum) + GLYPH_OBJ_OFF)
|
#define objnum_to_glyph(onum) ((int) (onum) + GLYPH_OBJ_OFF)
|
||||||
#define monnum_to_glyph(mnum) ((int) (mnum) + GLYPH_MON_OFF)
|
#define monnum_to_glyph(mnum,gnd) ((int) (mnum) + \
|
||||||
#define detected_monnum_to_glyph(mnum) ((int) (mnum) + GLYPH_DETECT_OFF)
|
((gnd == MALE) ? GLYPH_MON_MALE_OFF : GLYPH_MON_FEM_OFF))
|
||||||
#define ridden_monnum_to_glyph(mnum) ((int) (mnum) + GLYPH_RIDDEN_OFF)
|
#define detected_monnum_to_glyph(mnum,gnd) ((int) (mnum) + \
|
||||||
#define petnum_to_glyph(mnum) ((int) (mnum) + GLYPH_PET_OFF)
|
((gnd == MALE) ? GLYPH_DETECT_MALE_OFF : GLYPH_DETECT_FEM_OFF))
|
||||||
|
#define ridden_monnum_to_glyph(mnum,gnd) ((int) (mnum) + \
|
||||||
|
((gnd == MALE) ? GLYPH_RIDDEN_MALE_OFF : GLYPH_RIDDEN_FEM_OFF))
|
||||||
|
#define petnum_to_glyph(mnum,gnd) ((int) (mnum) + \
|
||||||
|
((gnd == MALE) ? GLYPH_PET_MALE_OFF : GLYPH_PET_FEM_OFF))
|
||||||
|
|
||||||
/* The hero's glyph when seen as a monster.
|
/* The hero's glyph when seen as a monster.
|
||||||
*/
|
*/
|
||||||
#define hero_glyph \
|
#define hero_glyph \
|
||||||
monnum_to_glyph((Upolyd || !flags.showrace) \
|
monnum_to_glyph((Upolyd || !flags.showrace) \
|
||||||
? u.umonnum \
|
? u.umonnum \
|
||||||
: (flags.female && g.urace.femalenum != NON_PM) \
|
: (flags.female && g.urace.femalenum != NON_PM) \
|
||||||
? g.urace.femalenum \
|
? g.urace.femalenum \
|
||||||
: g.urace.malenum)
|
: g.urace.malenum, (Ugender))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Change the given glyph into it's given type. Note:
|
* Change the given glyph into it's given type. Note:
|
||||||
@@ -413,98 +552,431 @@ enum explosion_types {
|
|||||||
* out of range, it will return zero (for lack of anything better
|
* out of range, it will return zero (for lack of anything better
|
||||||
* to return).
|
* to return).
|
||||||
*/
|
*/
|
||||||
#define glyph_to_mon(glyph) \
|
|
||||||
(glyph_is_normal_monster(glyph) \
|
#define glyph_to_trap(glyph) \
|
||||||
? ((glyph) - GLYPH_MON_OFF) \
|
(glyph_is_trap(glyph) \
|
||||||
: glyph_is_pet(glyph) \
|
? ((int) defsym_to_trap(((glyph) - GLYPH_TRAP_OFF) + S_arrow_trap)) \
|
||||||
? ((glyph) - GLYPH_PET_OFF) \
|
: NO_GLYPH)
|
||||||
: glyph_is_detected_monster(glyph) \
|
|
||||||
? ((glyph) - GLYPH_DETECT_OFF) \
|
#define glyph_is_cmap_main(glyph) \
|
||||||
: glyph_is_ridden_monster(glyph) \
|
((glyph) >= GLYPH_CMAP_MAIN_OFF && \
|
||||||
? ((glyph) - GLYPH_RIDDEN_OFF) \
|
(glyph) < (((S_trwall - S_vwall) +1) + GLYPH_CMAP_MAIN_OFF))
|
||||||
: glyph_is_statue(glyph) \
|
#define glyph_is_cmap_mines(glyph) \
|
||||||
? ((glyph) - GLYPH_STATUE_OFF) \
|
((glyph) >= GLYPH_CMAP_MINES_OFF && \
|
||||||
: NO_GLYPH)
|
(glyph) < (((S_trwall - S_vwall) + 1) + GLYPH_CMAP_MINES_OFF))
|
||||||
#define glyph_to_obj(glyph) \
|
#define glyph_is_cmap_gehennom(glyph) \
|
||||||
(glyph_is_body(glyph) \
|
((glyph) >= GLYPH_CMAP_GEH_OFF && \
|
||||||
? CORPSE \
|
(glyph) < (((S_trwall - S_vwall) + 1) + GLYPH_CMAP_GEH_OFF))
|
||||||
: glyph_is_statue(glyph) \
|
#define glyph_is_cmap_knox(glyph) \
|
||||||
? STATUE \
|
((glyph) >= GLYPH_CMAP_KNOX_OFF && \
|
||||||
: glyph_is_normal_object(glyph) \
|
(glyph) < (((S_trwall - S_vwall) + 1) + GLYPH_CMAP_KNOX_OFF))
|
||||||
? ((glyph) - GLYPH_OBJ_OFF) \
|
#define glyph_is_cmap_sokoban(glyph) \
|
||||||
: NO_GLYPH)
|
((glyph) >= GLYPH_CMAP_SOKO_OFF && \
|
||||||
#define glyph_to_trap(glyph) \
|
(glyph) < (((S_trwall - S_vwall) + 1) + GLYPH_CMAP_SOKO_OFF))
|
||||||
(glyph_is_trap(glyph) ? ((int) defsym_to_trap((glyph) - GLYPH_CMAP_OFF)) \
|
#define glyph_is_cmap_a(glyph) \
|
||||||
: NO_GLYPH)
|
((glyph) >= GLYPH_CMAP_A_OFF && \
|
||||||
|
(glyph) < (((S_brdnladder - S_ndoor) + 1) + GLYPH_CMAP_A_OFF))
|
||||||
|
#define glyph_is_cmap_altar(glyph) \
|
||||||
|
((glyph) >= GLYPH_ALTAR_OFF && \
|
||||||
|
(glyph) < (5 + GLYPH_ALTAR_OFF))
|
||||||
|
#define glyph_is_cmap_b(glyph) \
|
||||||
|
((glyph) >= GLYPH_CMAP_B_OFF && \
|
||||||
|
((glyph) < (((S_vibrating_square - S_grave) + 1) + GLYPH_CMAP_B_OFF)))
|
||||||
|
#define glyph_is_cmap_zap(glyph) \
|
||||||
|
((glyph) >= GLYPH_ZAP_OFF && (glyph) < ((NUM_ZAP << 2) + GLYPH_ZAP_OFF))
|
||||||
|
#define glyph_is_cmap_c(glyph) \
|
||||||
|
((glyph) >= GLYPH_CMAP_C_OFF && \
|
||||||
|
(glyph) < (((S_goodpos - S_digbeam) + 1) + GLYPH_CMAP_C_OFF))
|
||||||
|
#define glyph_is_swallow(glyph) \
|
||||||
|
((glyph) >= GLYPH_SWALLOW_OFF && (glyph) < (((NUMMONS << 3) + GLYPH_SWALLOW_OFF)))
|
||||||
|
#define glyph_is_explosion(glyph) \
|
||||||
|
((glyph) >= GLYPH_EXPLODE_OFF && \
|
||||||
|
(glyph) < (MAXEXPCHARS + GLYPH_EXPLODE_FROSTY_OFF))
|
||||||
|
#define glyph_is_cmap(glyph) \
|
||||||
|
(((glyph) == GLYPH_CMAP_STONE_OFF) \
|
||||||
|
|| glyph_is_cmap_main(glyph) \
|
||||||
|
|| glyph_is_cmap_mines(glyph) \
|
||||||
|
|| glyph_is_cmap_gehennom(glyph) \
|
||||||
|
|| glyph_is_cmap_knox(glyph) \
|
||||||
|
|| glyph_is_cmap_sokoban(glyph) \
|
||||||
|
|| glyph_is_cmap_a(glyph) \
|
||||||
|
|| glyph_is_cmap_altar(glyph) \
|
||||||
|
|| glyph_is_cmap_b(glyph) \
|
||||||
|
|| glyph_is_cmap_c(glyph))
|
||||||
|
|
||||||
#define glyph_to_cmap(glyph) \
|
#define glyph_to_cmap(glyph) \
|
||||||
(glyph_is_cmap(glyph) ? ((glyph) - GLYPH_CMAP_OFF) : NO_GLYPH)
|
(((glyph) == GLYPH_CMAP_STONE_OFF) \
|
||||||
|
? S_stone \
|
||||||
|
: glyph_is_cmap_main(glyph) \
|
||||||
|
? (((glyph) - GLYPH_CMAP_MAIN_OFF) + S_vwall) \
|
||||||
|
: glyph_is_cmap_mines(glyph) \
|
||||||
|
? (((glyph) - GLYPH_CMAP_MINES_OFF) + S_vwall) \
|
||||||
|
: glyph_is_cmap_gehennom(glyph) \
|
||||||
|
? (((glyph) - GLYPH_CMAP_GEH_OFF) + S_vwall) \
|
||||||
|
: glyph_is_cmap_knox(glyph) \
|
||||||
|
? (((glyph) - GLYPH_CMAP_KNOX_OFF) + S_vwall) \
|
||||||
|
: glyph_is_cmap_sokoban(glyph) \
|
||||||
|
? (((glyph) - GLYPH_CMAP_SOKO_OFF) + S_vwall) \
|
||||||
|
: glyph_is_cmap_a(glyph) \
|
||||||
|
? (((glyph) - GLYPH_CMAP_A_OFF) + S_ndoor) \
|
||||||
|
: glyph_is_cmap_altar(glyph) \
|
||||||
|
? (S_altar) \
|
||||||
|
: glyph_is_cmap_b(glyph) \
|
||||||
|
? (((glyph) - GLYPH_CMAP_B_OFF) + S_grave) \
|
||||||
|
: glyph_is_cmap_c(glyph) \
|
||||||
|
? (((glyph) - GLYPH_CMAP_C_OFF) + S_digbeam) \
|
||||||
|
: NO_GLYPH)
|
||||||
|
|
||||||
#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_warning(glyph) \
|
#define glyph_to_warning(glyph) \
|
||||||
(glyph_is_warning(glyph) ? ((glyph) - GLYPH_WARNING_OFF) : NO_GLYPH);
|
(glyph_is_warning(glyph) ? ((glyph) - GLYPH_WARNING_OFF) : NO_GLYPH)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return true if the given glyph is what we want. Note that bodies are
|
* Return true if the given glyph is what we want. Note that bodies are
|
||||||
* considered objects.
|
* considered objects.
|
||||||
*/
|
*/
|
||||||
|
#define glyph_is_normal_male_monster(glyph) \
|
||||||
|
((glyph) >= GLYPH_MON_MALE_OFF && (glyph) < (GLYPH_MON_MALE_OFF + NUMMONS))
|
||||||
|
#define glyph_is_normal_female_monster(glyph) \
|
||||||
|
((glyph) >= GLYPH_MON_FEM_OFF && (glyph) < (GLYPH_MON_FEM_OFF + NUMMONS))
|
||||||
|
#define glyph_is_normal_monster(glyph) \
|
||||||
|
(glyph_is_normal_male_monster(glyph) || glyph_is_normal_female_monster(glyph))
|
||||||
|
#define glyph_is_female_pet(glyph) \
|
||||||
|
((glyph) >= GLYPH_PET_FEM_OFF && (glyph) < (GLYPH_PET_FEM_OFF + NUMMONS))
|
||||||
|
#define glyph_is_male_pet(glyph) \
|
||||||
|
((glyph) >= GLYPH_PET_MALE_OFF && (glyph) < (GLYPH_PET_MALE_OFF + NUMMONS))
|
||||||
|
#define glyph_is_pet(glyph) \
|
||||||
|
(glyph_is_male_pet(glyph) || glyph_is_female_pet(glyph))
|
||||||
|
#define glyph_is_ridden_female_monster(glyph) \
|
||||||
|
((glyph) >= GLYPH_RIDDEN_FEM_OFF && (glyph) < \
|
||||||
|
(GLYPH_RIDDEN_FEM_OFF + NUMMONS))
|
||||||
|
#define glyph_is_ridden_male_monster(glyph) \
|
||||||
|
((glyph) >= GLYPH_RIDDEN_MALE_OFF && (glyph) < \
|
||||||
|
(GLYPH_RIDDEN_MALE_OFF + NUMMONS))
|
||||||
|
#define glyph_is_ridden_monster(glyph) \
|
||||||
|
(glyph_is_ridden_male_monster(glyph) \
|
||||||
|
|| glyph_is_ridden_female_monster(glyph))
|
||||||
|
#define glyph_is_detected_female_monster(glyph) \
|
||||||
|
((glyph) >= GLYPH_DETECT_FEM_OFF && (glyph) < \
|
||||||
|
(GLYPH_DETECT_FEM_OFF + NUMMONS))
|
||||||
|
#define glyph_is_detected_male_monster(glyph) \
|
||||||
|
((glyph) >= GLYPH_DETECT_MALE_OFF && (glyph) < \
|
||||||
|
(GLYPH_DETECT_MALE_OFF + NUMMONS))
|
||||||
|
#define glyph_is_detected_monster(glyph) \
|
||||||
|
(glyph_is_detected_male_monster(glyph) \
|
||||||
|
|| glyph_is_detected_female_monster(glyph))
|
||||||
#define glyph_is_monster(glyph) \
|
#define glyph_is_monster(glyph) \
|
||||||
(glyph_is_normal_monster(glyph) || glyph_is_pet(glyph) \
|
(glyph_is_normal_monster(glyph) || glyph_is_pet(glyph) \
|
||||||
|| glyph_is_ridden_monster(glyph) || glyph_is_detected_monster(glyph))
|
|| glyph_is_ridden_monster(glyph) || glyph_is_detected_monster(glyph))
|
||||||
#define glyph_is_normal_monster(glyph) \
|
|
||||||
((glyph) >= GLYPH_MON_OFF && (glyph) < (GLYPH_MON_OFF + NUMMONS))
|
|
||||||
#define glyph_is_pet(glyph) \
|
|
||||||
((glyph) >= GLYPH_PET_OFF && (glyph) < (GLYPH_PET_OFF + NUMMONS))
|
|
||||||
#define glyph_is_body(glyph) \
|
|
||||||
((glyph) >= GLYPH_BODY_OFF && (glyph) < (GLYPH_BODY_OFF + NUMMONS))
|
|
||||||
|
|
||||||
#define glyph_is_statue(glyph) \
|
|
||||||
((glyph) >= GLYPH_STATUE_OFF && (glyph) < (GLYPH_STATUE_OFF + NUMMONS))
|
|
||||||
|
|
||||||
#define glyph_is_ridden_monster(glyph) \
|
|
||||||
((glyph) >= GLYPH_RIDDEN_OFF && (glyph) < (GLYPH_RIDDEN_OFF + NUMMONS))
|
|
||||||
#define glyph_is_detected_monster(glyph) \
|
|
||||||
((glyph) >= GLYPH_DETECT_OFF && (glyph) < (GLYPH_DETECT_OFF + NUMMONS))
|
|
||||||
#define glyph_is_invisible(glyph) ((glyph) == GLYPH_INVISIBLE)
|
#define glyph_is_invisible(glyph) ((glyph) == GLYPH_INVISIBLE)
|
||||||
|
|
||||||
|
#define glyph_to_mon(glyph) \
|
||||||
|
(glyph_is_normal_female_monster(glyph) \
|
||||||
|
? ((glyph) - GLYPH_MON_FEM_OFF) \
|
||||||
|
: glyph_is_normal_male_monster(glyph) \
|
||||||
|
? ((glyph) - GLYPH_MON_MALE_OFF) \
|
||||||
|
: glyph_is_female_pet(glyph) \
|
||||||
|
? ((glyph) - GLYPH_PET_FEM_OFF) \
|
||||||
|
: glyph_is_male_pet(glyph) \
|
||||||
|
? ((glyph) - GLYPH_PET_MALE_OFF) \
|
||||||
|
: glyph_is_detected_female_monster(glyph) \
|
||||||
|
? ((glyph) - GLYPH_DETECT_FEM_OFF) \
|
||||||
|
: glyph_is_detected_male_monster(glyph) \
|
||||||
|
? ((glyph) - GLYPH_DETECT_MALE_OFF) \
|
||||||
|
: glyph_is_ridden_female_monster(glyph) \
|
||||||
|
? ((glyph) - GLYPH_RIDDEN_FEM_OFF) \
|
||||||
|
: glyph_is_ridden_male_monster(glyph) \
|
||||||
|
? ((glyph) - GLYPH_RIDDEN_MALE_OFF) \
|
||||||
|
: NO_GLYPH)
|
||||||
|
|
||||||
|
#define obj_is_piletop(obj) \
|
||||||
|
((obj)->where == OBJ_FLOOR \
|
||||||
|
&& g.level.objects[(obj)->ox][(obj)->oy] \
|
||||||
|
&& g.level.objects[(obj)->ox][(obj)->oy]->nexthere)
|
||||||
|
|
||||||
|
#define glyph_is_body_piletop(glyph) \
|
||||||
|
(((glyph) >= GLYPH_BODY_PILETOP_OFF) \
|
||||||
|
&& ((glyph) < (GLYPH_BODY_PILETOP_OFF + NUMMONS)))
|
||||||
|
#define glyph_is_body(glyph) \
|
||||||
|
((((glyph) >= GLYPH_BODY_OFF) && ((glyph) < (GLYPH_BODY_OFF + NUMMONS))) \
|
||||||
|
|| glyph_is_body_piletop(glyph))
|
||||||
|
|
||||||
|
#define glyph_is_fem_statue_piletop(glyph) \
|
||||||
|
(((glyph) >= GLYPH_STATUE_FEM_PILETOP_OFF) \
|
||||||
|
&& ((glyph) < (GLYPH_STATUE_FEM_PILETOP_OFF + NUMMONS)))
|
||||||
|
#define glyph_is_male_statue_piletop(glyph) \
|
||||||
|
(((glyph) >= GLYPH_STATUE_MALE_PILETOP_OFF) \
|
||||||
|
&& ((glyph) < (GLYPH_STATUE_MALE_PILETOP_OFF + NUMMONS)))
|
||||||
|
#define glyph_is_fem_statue(glyph) \
|
||||||
|
((((glyph) >= GLYPH_STATUE_FEM_OFF) && \
|
||||||
|
((glyph) < (GLYPH_STATUE_FEM_OFF + NUMMONS))) \
|
||||||
|
|| glyph_is_fem_statue_piletop(glyph))
|
||||||
|
#define glyph_is_male_statue(glyph) \
|
||||||
|
((((glyph) >= GLYPH_STATUE_MALE_OFF) && \
|
||||||
|
((glyph) < (GLYPH_STATUE_MALE_OFF + NUMMONS))) \
|
||||||
|
|| glyph_is_male_statue_piletop(glyph))
|
||||||
|
#define glyph_is_statue(glyph) \
|
||||||
|
(glyph_is_male_statue(glyph) || glyph_is_fem_statue(glyph))
|
||||||
|
#define glyph_is_normal_piletop_obj(glyph) \
|
||||||
|
(((glyph) >= GLYPH_OBJ_PILETOP_OFF) && \
|
||||||
|
((glyph) < (GLYPH_OBJ_PILETOP_OFF + NUM_OBJECTS)))
|
||||||
#define glyph_is_normal_object(glyph) \
|
#define glyph_is_normal_object(glyph) \
|
||||||
((glyph) >= GLYPH_OBJ_OFF && (glyph) < (GLYPH_OBJ_OFF + NUM_OBJECTS))
|
((((glyph) >= GLYPH_OBJ_OFF) && \
|
||||||
|
((glyph) < (GLYPH_OBJ_OFF + NUM_OBJECTS))) \
|
||||||
|
|| glyph_is_normal_piletop_obj(glyph))
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
#define glyph_is_object(glyph) \
|
||||||
|
((((glyph) >= GLYPH_OBJ_OFF) && ((glyph) < (GLYPH_OBJ_OFF + NUM_OBJECTS))) \
|
||||||
|
|| (((glyph) >= GLYPH_OBJ_PILETOP_OFF) \
|
||||||
|
&& ((glyph) < (GLYPH_OBJ_PILETOP_OFF + NUM_OBJECTS))) \
|
||||||
|
|| (((glyph) >= GLYPH_STATUE_MALE_OFF) \
|
||||||
|
&& ((glyph) < (GLYPH_STATUE_MALE_OFF + NUMMONS))) \
|
||||||
|
|| (((glyph) >= GLYPH_STATUE_MALE_PILETOP_OFF) \
|
||||||
|
&& ((glyph) < (GLYPH_STATUE_MALE_PILETOP_OFF + NUMMONS))) \
|
||||||
|
|| (((glyph) >= GLYPH_STATUE_FEM_OFF) \
|
||||||
|
&& ((glyph) < (GLYPH_STATUE_FEM_OFF + NUMMONS))) \
|
||||||
|
|| (((glyph) >= GLYPH_STATUE_FEM_PILETOP_OFF) \
|
||||||
|
&& ((glyph) < (GLYPH_STATUE_FEM_PILETOP_OFF + NUMMONS))) \
|
||||||
|
|| (((glyph) >= GLYPH_BODY_OFF) && ((glyph) < (GLYPH_BODY_OFF + NUMMONS))) \
|
||||||
|
|| (((glyph) >= GLYPH_BODY_PILETOP_OFF) \
|
||||||
|
&& ((glyph) < (GLYPH_BODY_PILETOP_OFF + NUMMONS))))
|
||||||
|
#endif
|
||||||
#define glyph_is_object(glyph) \
|
#define glyph_is_object(glyph) \
|
||||||
(glyph_is_normal_object(glyph) || glyph_is_statue(glyph) \
|
(glyph_is_normal_object(glyph) || glyph_is_statue(glyph) \
|
||||||
|| glyph_is_body(glyph))
|
|| glyph_is_body(glyph))
|
||||||
#define glyph_is_trap(glyph) \
|
|
||||||
((glyph) >= (GLYPH_CMAP_OFF + trap_to_defsym(1)) \
|
/* briefly used for Qt's "paper doll" inventory which shows map tiles for
|
||||||
&& (glyph) < (GLYPH_CMAP_OFF + trap_to_defsym(1) + TRAPNUM))
|
equipped objects; those vary like floor items during hallucination now
|
||||||
#define glyph_is_cmap(glyph) \
|
so this isn't used anywhere */
|
||||||
((glyph) >= GLYPH_CMAP_OFF && (glyph) < (GLYPH_CMAP_OFF + MAXPCHARS))
|
#define obj_to_true_glyph(obj) \
|
||||||
#define glyph_is_swallow(glyph) \
|
(((obj)->otyp == STATUE) \
|
||||||
((glyph) >= GLYPH_SWALLOW_OFF \
|
? ((int) (obj)->corpsenm + \
|
||||||
&& (glyph) < (GLYPH_SWALLOW_OFF + (NUMMONS << 3)))
|
(((obj)->spe & CORPSTAT_GENDER) == CORPSTAT_FEMALE) \
|
||||||
|
? (obj_is_piletop(obj) \
|
||||||
|
? (GLYPH_STATUE_FEM_PILETOP_OFF) \
|
||||||
|
: (GLYPH_STATUE_FEM_OFF)) \
|
||||||
|
: (obj_is_piletop(obj) \
|
||||||
|
? (GLYPH_STATUE_MALE_PILETOP_OFF) \
|
||||||
|
: (GLYPH_STATUE_MALE_OFF)) \
|
||||||
|
: (((obj)->otyp == CORPSE) \
|
||||||
|
? ((int) (obj)->corpsenm + \
|
||||||
|
(obj_is_piletop(obj) \
|
||||||
|
? (GLYPH_BODY_PILETOP_OFF) \
|
||||||
|
? (GLYPH_BODY_OFF))) \
|
||||||
|
: ((int) (obj)->otyp + GLYPH_OBJ_OFF))))
|
||||||
|
|
||||||
|
#define glyph_to_obj(glyph) \
|
||||||
|
(glyph_is_body(glyph) \
|
||||||
|
? CORPSE \
|
||||||
|
: glyph_is_statue(glyph) \
|
||||||
|
? STATUE \
|
||||||
|
: glyph_is_normal_object(glyph) \
|
||||||
|
? ((glyph) - \
|
||||||
|
(glyph_is_normal_piletop_obj(glyph) \
|
||||||
|
? GLYPH_OBJ_PILETOP_OFF \
|
||||||
|
: GLYPH_OBJ_OFF)) \
|
||||||
|
: NO_GLYPH)
|
||||||
|
|
||||||
|
#define glyph_to_body_corpsenm(glyph) \
|
||||||
|
(glyph_is_body_piletop(glyph) \
|
||||||
|
? ((glyph) - GLYPH_BODY_PILETOP_OFF) \
|
||||||
|
: ((glyph) - GLYPH_BODY_OFF))
|
||||||
|
|
||||||
|
#define glyph_to_statue_corpsenm(glyph) \
|
||||||
|
(glyph_is_fem_statue_piletop(glyph) \
|
||||||
|
? ((glyph) - GLYPH_STATUE_FEM_PILETOP_OFF) \
|
||||||
|
: glyph_is_male_statue_piletop(glyph) \
|
||||||
|
? ((glyph) - GLYPH_STATUE_MALE_PILETOP_OFF) \
|
||||||
|
: glyph_is_fem_statue(glyph) \
|
||||||
|
? ((glyph) - GLYPH_STATUE_FEM_OFF) \
|
||||||
|
: glyph_is_male_statue(glyph) \
|
||||||
|
? ((glyph) - GLYPH_STATUE_MALE_OFF) \
|
||||||
|
: NO_GLYPH)
|
||||||
|
|
||||||
|
/* These have the unfortunate side effect of needing a global variable */
|
||||||
|
/* to store a result. 'otg_temp' is defined and declared in decl.{ch}. */
|
||||||
|
#define random_obj_to_glyph(rng) \
|
||||||
|
((g.otg_temp = random_object(rng)) == CORPSE \
|
||||||
|
? (random_monster(rng) + GLYPH_BODY_OFF) \
|
||||||
|
: (g.otg_temp + GLYPH_OBJ_OFF))
|
||||||
|
#define corpse_to_glyph(obj) \
|
||||||
|
((int) ((obj)->corpsenm + (obj_is_piletop(obj) \
|
||||||
|
? GLYPH_BODY_PILETOP_OFF \
|
||||||
|
: GLYPH_BODY_OFF)))
|
||||||
|
#define normal_obj_to_glyph(obj) \
|
||||||
|
((int) ((obj)->otyp + (obj_is_piletop(obj) \
|
||||||
|
? GLYPH_OBJ_PILETOP_OFF \
|
||||||
|
: GLYPH_OBJ_OFF)))
|
||||||
|
|
||||||
|
/* MRKR: Statues now have glyphs corresponding to the monster they */
|
||||||
|
/* represent and look like monsters when you are hallucinating. */
|
||||||
|
|
||||||
|
#define statue_to_glyph(obj, rng) \
|
||||||
|
((Hallucination) \
|
||||||
|
? ((random_monster(rng)) + \
|
||||||
|
((!(rng)(2)) ? GLYPH_MON_MALE_OFF : GLYPH_MON_FEM_OFF)) \
|
||||||
|
: ((int) (obj)->corpsenm + \
|
||||||
|
((((obj)->spe & CORPSTAT_GENDER) == CORPSTAT_FEMALE) \
|
||||||
|
? (obj_is_piletop(obj) \
|
||||||
|
? GLYPH_STATUE_FEM_PILETOP_OFF \
|
||||||
|
: GLYPH_STATUE_FEM_OFF) \
|
||||||
|
: (obj_is_piletop(obj) \
|
||||||
|
? GLYPH_STATUE_MALE_PILETOP_OFF \
|
||||||
|
: GLYPH_STATUE_MALE_OFF))))
|
||||||
|
|
||||||
|
#define obj_to_glyph(obj, rng) \
|
||||||
|
(((obj)->otyp == STATUE) \
|
||||||
|
? statue_to_glyph(obj, rng) \
|
||||||
|
: ((Hallucination) \
|
||||||
|
? random_obj_to_glyph(rng) \
|
||||||
|
: (((obj)->otyp == CORPSE) \
|
||||||
|
? corpse_to_glyph(obj) \
|
||||||
|
: normal_obj_to_glyph(obj))))
|
||||||
|
|
||||||
|
#define GLYPH_TRAP_OFF \
|
||||||
|
(GLYPH_CMAP_B_OFF + (S_arrow_trap - S_grave))
|
||||||
|
#define glyph_is_trap(glyph) \
|
||||||
|
((glyph) >= (GLYPH_TRAP_OFF) && \
|
||||||
|
(glyph) < ((GLYPH_TRAP_OFF) + (TRAPNUM - 1)))
|
||||||
#define glyph_is_warning(glyph) \
|
#define glyph_is_warning(glyph) \
|
||||||
((glyph) >= GLYPH_WARNING_OFF \
|
((glyph) >= GLYPH_WARNING_OFF \
|
||||||
&& (glyph) < (GLYPH_WARNING_OFF + WARNCOUNT))
|
&& (glyph) < (GLYPH_WARNING_OFF + WARNCOUNT))
|
||||||
#define glyph_is_unexplored(glyph) ((glyph) == GLYPH_UNEXPLORED)
|
#define glyph_is_unexplored(glyph) ((glyph) == GLYPH_UNEXPLORED)
|
||||||
#define glyph_is_nothing(glyph) ((glyph) == GLYPH_NOTHING)
|
#define glyph_is_nothing(glyph) ((glyph) == GLYPH_NOTHING)
|
||||||
|
|
||||||
/* glyphflags for map_glyphinfo */
|
/*
|
||||||
|
#define glyph_is_piletop(glyph) \
|
||||||
|
(glyph_is_body_piletop(glyph) || glyph_is_statue_piletop(glyph) \
|
||||||
|
|| glyph_is_obj_piletop(glyph))
|
||||||
|
*/
|
||||||
|
|
||||||
/* mgflags for altering map_glyphinfo() internal behaviour */
|
/* mgflags for altering map_glyphinfo() internal behaviour */
|
||||||
#define MG_FLAG_NORMAL 0x00
|
#define MG_FLAG_NORMAL 0x00
|
||||||
#define MG_FLAG_NOOVERRIDE 0x01
|
#define MG_FLAG_NOOVERRIDE 0x01 /* disregard accessibility override values */
|
||||||
#define MG_FLAG_RETURNIDX 0x02
|
|
||||||
|
|
||||||
/* Special mapped glyphflags encoded by map_glyphinfo() */
|
/* Special mapped glyphflags encoded by reset_glyphmap() and/or map_glyphinfo() */
|
||||||
#define MG_CORPSE 0x0001
|
#define MG_HERO 0x00001 /* represents the hero */
|
||||||
#define MG_INVIS 0x0002
|
#define MG_CORPSE 0x00002 /* represents a body */
|
||||||
#define MG_DETECT 0x0004
|
#define MG_INVIS 0x00004 /* represents invisible monster */
|
||||||
#define MG_PET 0x0008
|
#define MG_DETECT 0x00008 /* represents a detected monster */
|
||||||
#define MG_RIDDEN 0x0010
|
#define MG_PET 0x00010 /* represents a pet */
|
||||||
#define MG_STATUE 0x0020
|
#define MG_RIDDEN 0x00020 /* represents a ridden monster */
|
||||||
#define MG_OBJPILE 0x0040 /* more than one stack of objects */
|
#define MG_STATUE 0x00040 /* represents a statue */
|
||||||
#define MG_BW_LAVA 0x0080 /* 'black & white lava': highlight lava if it
|
#define MG_OBJPILE 0x00080 /* more than one stack of objects */
|
||||||
can't be distringuished from water by color */
|
#define MG_BW_LAVA 0x00100 /* 'black & white lava': highlight lava if it
|
||||||
#define MG_BW_ICE 0x0100 /* similar for ice vs floor */
|
can't be distringuished from water by color */
|
||||||
#define MG_NOTHING 0x0200 /* char represents GLYPH_NOTHING */
|
#define MG_BW_ICE 0x00200 /* similar for ice vs floor */
|
||||||
#define MG_UNEXPL 0x0400 /* char represents GLYPH_UNEXPLORED */
|
#define MG_NOTHING 0x00400 /* char represents GLYPH_NOTHING */
|
||||||
#define MG_FEMALE 0x0800 /* represents a female mon,detected mon,pet,ridden */
|
#define MG_UNEXPL 0x00800 /* char represents GLYPH_UNEXPLORED */
|
||||||
#define MG_BADXY 0x1000 /* bad coordinates were passed */
|
#define MG_MALE 0x01000 /* represents a male mon variation or statue of one */
|
||||||
|
#define MG_FEMALE 0x02000 /* represents a female mon variation or statue of one */
|
||||||
|
#define MG_BADXY 0x04000 /* bad coordinates were passed */
|
||||||
|
|
||||||
|
#include "color.h"
|
||||||
|
#ifdef TEXTCOLOR
|
||||||
|
|
||||||
|
/* 3.6.3: poison gas zap used to be yellow and acid zap was green,
|
||||||
|
which conflicted with the corresponding dragon colors */
|
||||||
|
#endif /* TEXTCOLOR */
|
||||||
|
|
||||||
|
enum level_walls { main_walls, mines_walls, gehennom_walls,
|
||||||
|
knox_walls, sokoban_walls };
|
||||||
|
|
||||||
|
enum zap_colors {
|
||||||
|
zap_color_missile = HI_ZAP,
|
||||||
|
zap_color_fire = CLR_ORANGE,
|
||||||
|
zap_color_frost = CLR_WHITE,
|
||||||
|
zap_color_sleep = HI_ZAP,
|
||||||
|
zap_color_death = CLR_BLACK,
|
||||||
|
zap_color_lightning = CLR_WHITE,
|
||||||
|
zap_color_poison_gas = CLR_GREEN,
|
||||||
|
zap_color_acid = CLR_YELLOW
|
||||||
|
};
|
||||||
|
|
||||||
|
enum altar_colors {
|
||||||
|
altar_color_unaligned = CLR_RED,
|
||||||
|
#if 0
|
||||||
|
/* On OSX with TERM=xterm-color256 these render as
|
||||||
|
* white -> tty: gray, curses: ok
|
||||||
|
* gray -> both tty and curses: black
|
||||||
|
* black -> both tty and curses: blue
|
||||||
|
* red -> both tty and curses: ok.
|
||||||
|
* Since the colors have specific associations (with the
|
||||||
|
* unicorns matched with each alignment), we shouldn't use
|
||||||
|
* scrambled colors and we don't have sufficient information
|
||||||
|
* to handle platform-specific color variations.
|
||||||
|
*/
|
||||||
|
altar_color_chaotic = CLR_BLACK,
|
||||||
|
altar_color_neutral = CLR_GRAY,
|
||||||
|
altar_color_lawful = CLR_WHITE,
|
||||||
|
#else
|
||||||
|
altar_color_chaotic = CLR_GRAY,
|
||||||
|
altar_color_neutral = CLR_GRAY,
|
||||||
|
altar_color_lawful = CLR_GRAY,
|
||||||
|
#endif
|
||||||
|
altar_color_shrine = CLR_BRIGHT_MAGENTA
|
||||||
|
};
|
||||||
|
|
||||||
|
/* types of explosions */
|
||||||
|
enum explosion_types {
|
||||||
|
EXPL_DARK = 0,
|
||||||
|
EXPL_NOXIOUS = 1,
|
||||||
|
EXPL_MUDDY = 2,
|
||||||
|
EXPL_WET = 3,
|
||||||
|
EXPL_MAGICAL = 4,
|
||||||
|
EXPL_FIERY = 5,
|
||||||
|
EXPL_FROSTY = 6,
|
||||||
|
EXPL_MAX = 7
|
||||||
|
};
|
||||||
|
|
||||||
|
/* above plus this redundant? */
|
||||||
|
enum expl_types {
|
||||||
|
expl_dark,
|
||||||
|
expl_noxious,
|
||||||
|
expl_muddy,
|
||||||
|
expl_wet,
|
||||||
|
expl_magical,
|
||||||
|
expl_fiery,
|
||||||
|
expl_frosty,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum explode_colors {
|
||||||
|
explode_color_dark = CLR_BLACK,
|
||||||
|
explode_color_noxious = CLR_GREEN,
|
||||||
|
explode_color_muddy = CLR_BROWN,
|
||||||
|
explode_color_wet = CLR_BLUE,
|
||||||
|
explode_color_magical = CLR_MAGENTA,
|
||||||
|
explode_color_fiery = CLR_ORANGE,
|
||||||
|
explode_color_frosty = CLR_WHITE
|
||||||
|
};
|
||||||
|
enum altar_types {
|
||||||
|
altar_unaligned,
|
||||||
|
altar_chaotic,
|
||||||
|
altar_neutral,
|
||||||
|
altar_lawful,
|
||||||
|
shrine
|
||||||
|
};
|
||||||
|
|
||||||
|
enum { GM_FLAGS, GM_TTYCHAR, GM_COLOR, NUM_GLYPHMOD }; /* glyphmod entries */
|
||||||
|
enum glyphmap_change_triggers { gm_nochange, gm_levelchange, gm_optionchange,
|
||||||
|
gm_symchange, gm_accessibility_change };
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
xchar gnew; /* perhaps move this bit into the rm structure. */
|
||||||
|
glyph_info glyphinfo;
|
||||||
|
} gbuf_entry;
|
||||||
|
|
||||||
|
extern const int altarcolors[];
|
||||||
|
extern const int zapcolors[];
|
||||||
|
extern const int explodecolors[];
|
||||||
|
extern int wallcolors[];
|
||||||
|
|
||||||
|
/* If USE_TILES is defined during build, this comes from the generated
|
||||||
|
* tile.c, complete with appropriate tile references in the initialization.
|
||||||
|
* Otherwise, it comes from display.c.
|
||||||
|
*/
|
||||||
|
extern const glyph_info nul_glyphinfo;
|
||||||
|
|
||||||
#endif /* DISPLAY_H */
|
#endif /* DISPLAY_H */
|
||||||
|
|||||||
@@ -381,6 +381,7 @@ extern void set_wall_state(void);
|
|||||||
extern void unset_seenv(struct rm *, int, int, int, int);
|
extern void unset_seenv(struct rm *, int, int, int, int);
|
||||||
extern int warning_of(struct monst *);
|
extern int warning_of(struct monst *);
|
||||||
extern void map_glyphinfo(xchar, xchar, int, unsigned, glyph_info *);
|
extern void map_glyphinfo(xchar, xchar, int, unsigned, glyph_info *);
|
||||||
|
extern void reset_glyphmap(enum glyphmap_change_triggers trigger);
|
||||||
|
|
||||||
/* ### do.c ### */
|
/* ### do.c ### */
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -222,7 +222,7 @@ typedef uchar nhsym;
|
|||||||
|| defined(WIN32)
|
|| defined(WIN32)
|
||||||
#ifndef NO_TILE_C
|
#ifndef NO_TILE_C
|
||||||
#ifndef USE_TILES
|
#ifndef USE_TILES
|
||||||
#define USE_TILES /* glyph2tile[] will be available */
|
#define USE_TILES /* glyphmap[] with prefilled tile mappings will be available */
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-4
@@ -212,11 +212,9 @@ enum misc_arti_nums {
|
|||||||
#define SYM_OFF_X (SYM_OFF_W + WARNCOUNT)
|
#define SYM_OFF_X (SYM_OFF_W + WARNCOUNT)
|
||||||
#define SYM_MAX (SYM_OFF_X + MAXOTHER)
|
#define SYM_MAX (SYM_OFF_X + MAXOTHER)
|
||||||
|
|
||||||
/* glyphmod entries */
|
|
||||||
enum { GM_FLAGS, GM_TTYCHAR, GM_COLOR, NUM_GLYPHMOD };
|
|
||||||
|
|
||||||
#include "rect.h"
|
#include "rect.h"
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
|
#include "display.h"
|
||||||
#include "decl.h"
|
#include "decl.h"
|
||||||
#include "timeout.h"
|
#include "timeout.h"
|
||||||
|
|
||||||
@@ -268,7 +266,6 @@ typedef struct sortloot_item Loot;
|
|||||||
#include "trap.h"
|
#include "trap.h"
|
||||||
#include "flag.h"
|
#include "flag.h"
|
||||||
#include "vision.h"
|
#include "vision.h"
|
||||||
#include "display.h"
|
|
||||||
#include "engrave.h"
|
#include "engrave.h"
|
||||||
|
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ enum mon_syms {
|
|||||||
#ifndef MAKEDEFS_C
|
#ifndef MAKEDEFS_C
|
||||||
|
|
||||||
/* Default characters for dungeon surroundings and furniture */
|
/* Default characters for dungeon surroundings and furniture */
|
||||||
enum screen_symbols {
|
enum cmap_symbols {
|
||||||
#define PCHAR_S_ENUM
|
#define PCHAR_S_ENUM
|
||||||
#include "defsym.h"
|
#include "defsym.h"
|
||||||
#undef PCHAR_S_ENUM
|
#undef PCHAR_S_ENUM
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ struct text_map_info_t {
|
|||||||
|
|
||||||
struct tile_glyph_info_t {
|
struct tile_glyph_info_t {
|
||||||
unsigned short glyph;
|
unsigned short glyph;
|
||||||
|
unsigned short tileidx;
|
||||||
unsigned glyphflags;
|
unsigned glyphflags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -125,7 +125,7 @@ E void tty_shutdown(void);
|
|||||||
E int xputc(int);
|
E int xputc(int);
|
||||||
E void xputs(const char *);
|
E void xputs(const char *);
|
||||||
#if defined(SCREEN_VGA) || defined(SCREEN_8514)
|
#if defined(SCREEN_VGA) || defined(SCREEN_8514)
|
||||||
E void xputg(int, int, unsigned);
|
E void xputg(const glyph_info *);
|
||||||
#endif
|
#endif
|
||||||
E void cl_end(void);
|
E void cl_end(void);
|
||||||
E void clear_screen(void);
|
E void clear_screen(void);
|
||||||
|
|||||||
+23
-17
@@ -52,23 +52,6 @@ enum any_types {
|
|||||||
ANY_MASK32 /* 32-bit mask (stored as unsigned long) */
|
ANY_MASK32 /* 32-bit mask (stored as unsigned long) */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* glyph plus additional info
|
|
||||||
if you add fields or change the ordering, fix up the following:
|
|
||||||
g_info initialization in display.c
|
|
||||||
nul_glyphinfo initialization in decl.c
|
|
||||||
*/
|
|
||||||
typedef struct gi {
|
|
||||||
int glyph; /* the display entity */
|
|
||||||
int color; /* color for window ports not using a tile */
|
|
||||||
int ttychar; /* the character mapping for the original tty
|
|
||||||
interface. Most or all window ports wanted
|
|
||||||
and used this for various things so it is
|
|
||||||
provided in 3.7+ */
|
|
||||||
short int symidx; /* offset into syms array */
|
|
||||||
unsigned glyphflags; /* more detail about the nature of the entity */
|
|
||||||
} glyph_info;
|
|
||||||
#define GLYPH_INFO_P struct gi
|
|
||||||
|
|
||||||
/* menu return list */
|
/* menu return list */
|
||||||
typedef struct mi {
|
typedef struct mi {
|
||||||
anything item; /* identifier */
|
anything item; /* identifier */
|
||||||
@@ -77,6 +60,29 @@ typedef struct mi {
|
|||||||
} menu_item;
|
} menu_item;
|
||||||
#define MENU_ITEM_P struct mi
|
#define MENU_ITEM_P struct mi
|
||||||
|
|
||||||
|
/* These would be in display.h if they weren't needed to define
|
||||||
|
the windowproc interface for X11 which doesn't seem to include
|
||||||
|
the main NetHack header files */
|
||||||
|
|
||||||
|
typedef struct glyph_map_entry {
|
||||||
|
int color;
|
||||||
|
int symidx;
|
||||||
|
unsigned glyphflags;
|
||||||
|
short int tileidx;
|
||||||
|
} glyph_map;
|
||||||
|
|
||||||
|
/* glyph plus additional info
|
||||||
|
if you add fields or change the ordering, fix up the following:
|
||||||
|
g_info initialization in display.c
|
||||||
|
nul_glyphinfo initialization in diplay.c
|
||||||
|
*/
|
||||||
|
typedef struct gi {
|
||||||
|
int glyph; /* the display entity */
|
||||||
|
int ttychar;
|
||||||
|
glyph_map gm;
|
||||||
|
} glyph_info;
|
||||||
|
#define GLYPH_INFO_P struct gi
|
||||||
|
|
||||||
/* select_menu() "how" argument types */
|
/* select_menu() "how" argument types */
|
||||||
/* [MINV_PICKMASK in monst.h assumes these have values of 0, 1, 2] */
|
/* [MINV_PICKMASK in monst.h assumes these have values of 0, 1, 2] */
|
||||||
#define PICK_NONE 0 /* user picks nothing (display only) */
|
#define PICK_NONE 0 /* user picks nothing (display only) */
|
||||||
|
|||||||
@@ -13,3 +13,5 @@ nhdat
|
|||||||
o
|
o
|
||||||
nhdat*
|
nhdat*
|
||||||
date.nmk
|
date.nmk
|
||||||
|
tilemappings.lst
|
||||||
|
|
||||||
|
|||||||
+1
-22
@@ -39,24 +39,6 @@ NEARDATA struct obj *uwep, *uarm, *uswapwep,
|
|||||||
|
|
||||||
struct engr *head_engr;
|
struct engr *head_engr;
|
||||||
|
|
||||||
#ifdef TEXTCOLOR
|
|
||||||
/*
|
|
||||||
* This must be the same order as used for buzz() in zap.c.
|
|
||||||
*/
|
|
||||||
const int zapcolors[NUM_ZAP] = {
|
|
||||||
HI_ZAP, /* 0 - missile */
|
|
||||||
CLR_ORANGE, /* 1 - fire */
|
|
||||||
CLR_WHITE, /* 2 - frost */
|
|
||||||
HI_ZAP, /* 3 - sleep */
|
|
||||||
CLR_BLACK, /* 4 - death */
|
|
||||||
CLR_WHITE, /* 5 - lightning */
|
|
||||||
/* 3.6.3: poison gas zap used to be yellow and acid zap was green,
|
|
||||||
which conflicted with the corresponding dragon colors */
|
|
||||||
CLR_GREEN, /* 6 - poison gas */
|
|
||||||
CLR_YELLOW, /* 7 - acid */
|
|
||||||
};
|
|
||||||
#endif /* text color */
|
|
||||||
|
|
||||||
const int shield_static[SHIELD_COUNT] = {
|
const int shield_static[SHIELD_COUNT] = {
|
||||||
S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4, /* 7 per row */
|
S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4, /* 7 per row */
|
||||||
S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4,
|
S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4,
|
||||||
@@ -540,6 +522,7 @@ const struct instance_globals g_init = {
|
|||||||
FALSE, /* opt_initial */
|
FALSE, /* opt_initial */
|
||||||
FALSE, /* opt_from_file */
|
FALSE, /* opt_from_file */
|
||||||
FALSE, /* opt_need_redraw */
|
FALSE, /* opt_need_redraw */
|
||||||
|
FALSE, /* opt_need_glyph_reset */
|
||||||
FALSE, /* save_menucolors */
|
FALSE, /* save_menucolors */
|
||||||
(struct menucoloring *) 0, /* save_colorings */
|
(struct menucoloring *) 0, /* save_colorings */
|
||||||
(struct menucoloring *) 0, /* color_colorings */
|
(struct menucoloring *) 0, /* color_colorings */
|
||||||
@@ -713,10 +696,6 @@ const struct const_globals cg = {
|
|||||||
DUMMY, /* zeroany */
|
DUMMY, /* zeroany */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* glyph, color, ttychar, symidx, glyphflags */
|
|
||||||
const glyph_info nul_glyphinfo =
|
|
||||||
{ NO_GLYPH, NO_COLOR, ' ', 0, MG_UNEXPL };
|
|
||||||
|
|
||||||
#define ZERO(x) memset(&x, 0, sizeof(x))
|
#define ZERO(x) memset(&x, 0, sizeof(x))
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
+541
-352
File diff suppressed because it is too large
Load Diff
@@ -1455,9 +1455,7 @@ goto_level(
|
|||||||
|
|
||||||
if (Is_rogue_level(newlevel) || Is_rogue_level(&u.uz))
|
if (Is_rogue_level(newlevel) || Is_rogue_level(&u.uz))
|
||||||
assign_graphics(Is_rogue_level(newlevel) ? ROGUESET : PRIMARY);
|
assign_graphics(Is_rogue_level(newlevel) ? ROGUESET : PRIMARY);
|
||||||
#ifdef USE_TILES
|
reset_glyphmap(gm_levelchange);
|
||||||
substitute_tiles(newlevel);
|
|
||||||
#endif
|
|
||||||
check_gold_symbol();
|
check_gold_symbol();
|
||||||
/* record this level transition as a potential seen branch unless using
|
/* record this level transition as a potential seen branch unless using
|
||||||
* some non-standard means of transportation (level teleport).
|
* some non-standard means of transportation (level teleport).
|
||||||
|
|||||||
+2
-1
@@ -370,7 +370,8 @@ gather_locs_interesting(int x, int y, int gloc)
|
|||||||
/* unlike '/M', this skips monsters revealed by
|
/* unlike '/M', this skips monsters revealed by
|
||||||
warning glyphs and remembered unseen ones */
|
warning glyphs and remembered unseen ones */
|
||||||
return (glyph_is_monster(glyph)
|
return (glyph_is_monster(glyph)
|
||||||
&& glyph != monnum_to_glyph(PM_LONG_WORM_TAIL));
|
&& glyph != monnum_to_glyph(PM_LONG_WORM_TAIL,MALE) &&
|
||||||
|
glyph != monnum_to_glyph(PM_LONG_WORM_TAIL, FEMALE));
|
||||||
case GLOC_OBJS:
|
case GLOC_OBJS:
|
||||||
return (glyph_is_object(glyph)
|
return (glyph_is_object(glyph)
|
||||||
&& glyph != objnum_to_glyph(BOULDER)
|
&& glyph != objnum_to_glyph(BOULDER)
|
||||||
|
|||||||
+10
-7
@@ -13,8 +13,8 @@ static int QSORTCALLBACK discovered_cmp(const genericptr, const genericptr);
|
|||||||
static char *oclass_to_name(char, char *);
|
static char *oclass_to_name(char, char *);
|
||||||
|
|
||||||
#ifdef USE_TILES
|
#ifdef USE_TILES
|
||||||
|
extern glyph_map glyphmap[MAX_GLYPH];
|
||||||
static void shuffle_tiles(void);
|
static void shuffle_tiles(void);
|
||||||
extern short glyph2tile[]; /* from tile.c */
|
|
||||||
|
|
||||||
/* Shuffle tile assignments to match descriptions, so a red potion isn't
|
/* Shuffle tile assignments to match descriptions, so a red potion isn't
|
||||||
* displayed with a blue tile and so on.
|
* displayed with a blue tile and so on.
|
||||||
@@ -29,13 +29,16 @@ static void
|
|||||||
shuffle_tiles(void)
|
shuffle_tiles(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
short tmp_tilemap[NUM_OBJECTS];
|
short tmp_tilemap[2][NUM_OBJECTS];
|
||||||
|
|
||||||
for (i = 0; i < NUM_OBJECTS; i++)
|
for (i = 0; i < NUM_OBJECTS; i++) {
|
||||||
tmp_tilemap[i] = glyph2tile[objects[i].oc_descr_idx + GLYPH_OBJ_OFF];
|
tmp_tilemap[0][i] = glyphmap[objects[i].oc_descr_idx + GLYPH_OBJ_OFF].tileidx;
|
||||||
|
tmp_tilemap[1][i] = glyphmap[objects[i].oc_descr_idx + GLYPH_OBJ_PILETOP_OFF].tileidx;
|
||||||
for (i = 0; i < NUM_OBJECTS; i++)
|
}
|
||||||
glyph2tile[i + GLYPH_OBJ_OFF] = tmp_tilemap[i];
|
for (i = 0; i < NUM_OBJECTS; i++) {
|
||||||
|
glyphmap[i + GLYPH_OBJ_OFF].tileidx = tmp_tilemap[0][i];
|
||||||
|
glyphmap[i + GLYPH_OBJ_PILETOP_OFF].tileidx = tmp_tilemap[1][i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif /* USE_TILES */
|
#endif /* USE_TILES */
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -4129,6 +4129,7 @@ optfn_boolean(int optidx, int req, boolean negated, char *opts, char *op)
|
|||||||
case opt_ascii_map:
|
case opt_ascii_map:
|
||||||
case opt_tiled_map:
|
case opt_tiled_map:
|
||||||
g.opt_need_redraw = TRUE;
|
g.opt_need_redraw = TRUE;
|
||||||
|
g.opt_need_glyph_reset = TRUE;
|
||||||
break;
|
break;
|
||||||
case opt_hilite_pet:
|
case opt_hilite_pet:
|
||||||
#ifdef CURSES_GRAPHICS
|
#ifdef CURSES_GRAPHICS
|
||||||
@@ -4166,6 +4167,7 @@ optfn_boolean(int optidx, int req, boolean negated, char *opts, char *op)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
g.opt_need_redraw = TRUE;
|
g.opt_need_redraw = TRUE;
|
||||||
|
g.opt_need_glyph_reset = TRUE;
|
||||||
break;
|
break;
|
||||||
case opt_menucolors:
|
case opt_menucolors:
|
||||||
case opt_guicolor:
|
case opt_guicolor:
|
||||||
@@ -5839,7 +5841,7 @@ initoptions_finish(void)
|
|||||||
if (sym)
|
if (sym)
|
||||||
g.showsyms[SYM_BOULDER + SYM_OFF_X] = sym;
|
g.showsyms[SYM_BOULDER + SYM_OFF_X] = sym;
|
||||||
reglyph_darkroom();
|
reglyph_darkroom();
|
||||||
|
reset_glyphmap(gm_optionchange);
|
||||||
#ifdef STATUS_HILITES
|
#ifdef STATUS_HILITES
|
||||||
/*
|
/*
|
||||||
* A multi-interface binary might only support status highlighting
|
* A multi-interface binary might only support status highlighting
|
||||||
@@ -7347,6 +7349,7 @@ doset(void) /* changing options via menu by Per Liboriussen */
|
|||||||
#endif
|
#endif
|
||||||
end_menu(tmpwin, "Set what options?");
|
end_menu(tmpwin, "Set what options?");
|
||||||
g.opt_need_redraw = FALSE;
|
g.opt_need_redraw = FALSE;
|
||||||
|
g.opt_need_glyph_reset = FALSE;
|
||||||
if ((pick_cnt = select_menu(tmpwin, PICK_ANY, &pick_list)) > 0) {
|
if ((pick_cnt = select_menu(tmpwin, PICK_ANY, &pick_list)) > 0) {
|
||||||
/*
|
/*
|
||||||
* Walk down the selection list and either invert the booleans
|
* Walk down the selection list and either invert the booleans
|
||||||
@@ -7394,6 +7397,9 @@ doset(void) /* changing options via menu by Per Liboriussen */
|
|||||||
}
|
}
|
||||||
|
|
||||||
destroy_nhwindow(tmpwin);
|
destroy_nhwindow(tmpwin);
|
||||||
|
if (g.opt_need_glyph_reset) {
|
||||||
|
reset_glyphmap(gm_optionchange);
|
||||||
|
}
|
||||||
if (g.opt_need_redraw) {
|
if (g.opt_need_redraw) {
|
||||||
check_gold_symbol();
|
check_gold_symbol();
|
||||||
reglyph_darkroom();
|
reglyph_darkroom();
|
||||||
|
|||||||
+2
-2
@@ -257,9 +257,9 @@ object_from_map(int glyph, int x, int y, struct obj **obj_p)
|
|||||||
else
|
else
|
||||||
otmp->corpsenm = MCORPSENM(mtmp);
|
otmp->corpsenm = MCORPSENM(mtmp);
|
||||||
} else if (otmp->otyp == CORPSE && glyph_is_body(glyph)) {
|
} else if (otmp->otyp == CORPSE && glyph_is_body(glyph)) {
|
||||||
otmp->corpsenm = glyph - GLYPH_BODY_OFF;
|
otmp->corpsenm = glyph_to_body_corpsenm(glyph);
|
||||||
} else if (otmp->otyp == STATUE && glyph_is_statue(glyph)) {
|
} else if (otmp->otyp == STATUE && glyph_is_statue(glyph)) {
|
||||||
otmp->corpsenm = glyph - GLYPH_STATUE_OFF;
|
otmp->corpsenm = glyph_to_statue_corpsenm(glyph);
|
||||||
}
|
}
|
||||||
if (otmp->otyp == LEASH)
|
if (otmp->otyp == LEASH)
|
||||||
otmp->leashmon = 0;
|
otmp->leashmon = 0;
|
||||||
|
|||||||
+1
-7
@@ -11,10 +11,6 @@ extern int dotcnt; /* shared with save */
|
|||||||
extern int dotrow; /* shared with save */
|
extern int dotrow; /* shared with save */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_TILES
|
|
||||||
extern void substitute_tiles(d_level *); /* from tile.c */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ZEROCOMP
|
#ifdef ZEROCOMP
|
||||||
static void zerocomp_minit(void);
|
static void zerocomp_minit(void);
|
||||||
static void zerocomp_mread(int, genericptr_t, unsigned int);
|
static void zerocomp_mread(int, genericptr_t, unsigned int);
|
||||||
@@ -852,9 +848,7 @@ dorecover(NHFILE* nhfp)
|
|||||||
(void) delete_savefile();
|
(void) delete_savefile();
|
||||||
if (Is_rogue_level(&u.uz))
|
if (Is_rogue_level(&u.uz))
|
||||||
assign_graphics(ROGUESET);
|
assign_graphics(ROGUESET);
|
||||||
#ifdef USE_TILES
|
reset_glyphmap(gm_levelchange);
|
||||||
substitute_tiles(&u.uz);
|
|
||||||
#endif
|
|
||||||
max_rank_sz(); /* to recompute g.mrank_sz (botl.c) */
|
max_rank_sz(); /* to recompute g.mrank_sz (botl.c) */
|
||||||
init_oclass_probs(); /* recompute g.oclass_prob_totals[] */
|
init_oclass_probs(); /* recompute g.oclass_prob_totals[] */
|
||||||
/* take care of iron ball & chain */
|
/* take care of iron ball & chain */
|
||||||
|
|||||||
+2
-2
@@ -1375,7 +1375,7 @@ glyph2symidx(int glyph)
|
|||||||
glyph_info glyphinfo;
|
glyph_info glyphinfo;
|
||||||
|
|
||||||
map_glyphinfo(0, 0, glyph, 0, &glyphinfo);
|
map_glyphinfo(0, 0, glyph, 0, &glyphinfo);
|
||||||
return glyphinfo.symidx;
|
return glyphinfo.gm.symidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
@@ -1419,7 +1419,7 @@ decode_mixed(char *buf, const char *str)
|
|||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
map_glyphinfo(0, 0, gv, 0, &glyphinfo);
|
map_glyphinfo(0, 0, gv, 0, &glyphinfo);
|
||||||
so = glyphinfo.symidx;
|
so = glyphinfo.gm.symidx;
|
||||||
*put++ = g.showsyms[so];
|
*put++ = g.showsyms[so];
|
||||||
/* 'str' is ready for the next loop iteration and '*str'
|
/* 'str' is ready for the next loop iteration and '*str'
|
||||||
should not be copied at the end of this iteration */
|
should not be copied at the end of this iteration */
|
||||||
|
|||||||
+6
-3
@@ -491,9 +491,12 @@ detect_wsegs(struct monst *worm, boolean use_detection_glyph)
|
|||||||
int what_tail = what_mon(PM_LONG_WORM_TAIL, newsym_rn2);
|
int what_tail = what_mon(PM_LONG_WORM_TAIL, newsym_rn2);
|
||||||
|
|
||||||
while (curr != wheads[worm->wormno]) {
|
while (curr != wheads[worm->wormno]) {
|
||||||
num = use_detection_glyph ? detected_monnum_to_glyph(what_tail)
|
num = use_detection_glyph ? detected_monnum_to_glyph(what_tail,
|
||||||
: worm->mtame ? petnum_to_glyph(what_tail)
|
worm->female ? FEMALE : MALE)
|
||||||
: monnum_to_glyph(what_tail);
|
: worm->mtame ? petnum_to_glyph(what_tail,
|
||||||
|
worm->female ? FEMALE : MALE)
|
||||||
|
: monnum_to_glyph(what_tail,
|
||||||
|
worm->female ? FEMALE : MALE);
|
||||||
show_glyph(curr->wx, curr->wy, num);
|
show_glyph(curr->wx, curr->wy, num);
|
||||||
curr = curr->nseg;
|
curr = curr->nseg;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,9 +59,6 @@ extern int ReadPlanarTileFile_O(int, struct overview_planar_cell_struct **);
|
|||||||
#ifdef PACKED_FILE
|
#ifdef PACKED_FILE
|
||||||
extern int ReadPackedTileFile(int, char (*)[TILE_X]);
|
extern int ReadPackedTileFile(int, char (*)[TILE_X]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern short glyph2tile[MAX_GLYPH]; /* in tile.c (made from tilemap.c) */
|
|
||||||
|
|
||||||
#endif /* USE_TILES */
|
#endif /* USE_TILES */
|
||||||
|
|
||||||
/* pctiles.h */
|
/* pctiles.h */
|
||||||
|
|||||||
+2
-2
@@ -276,7 +276,7 @@ extern void vga_tty_end_screen(void);
|
|||||||
extern void vga_tty_startup(int *, int *);
|
extern void vga_tty_startup(int *, int *);
|
||||||
extern void vga_xputs(const char *, int, int);
|
extern void vga_xputs(const char *, int, int);
|
||||||
extern void vga_xputc(char, int);
|
extern void vga_xputc(char, int);
|
||||||
extern void vga_xputg(int, int, unsigned);
|
extern void vga_xputg(const glyph_info *);
|
||||||
extern void vga_userpan(enum vga_pan_direction);
|
extern void vga_userpan(enum vga_pan_direction);
|
||||||
extern void vga_overview(boolean);
|
extern void vga_overview(boolean);
|
||||||
extern void vga_traditional(boolean);
|
extern void vga_traditional(boolean);
|
||||||
@@ -305,7 +305,7 @@ extern void vesa_tty_end_screen(void);
|
|||||||
extern void vesa_tty_startup(int *, int *);
|
extern void vesa_tty_startup(int *, int *);
|
||||||
extern void vesa_xputs(const char *, int, int);
|
extern void vesa_xputs(const char *, int, int);
|
||||||
extern void vesa_xputc(char, int);
|
extern void vesa_xputc(char, int);
|
||||||
extern void vesa_xputg(int, int, unsigned);
|
extern void vesa_xputg(const glyph_info *);
|
||||||
extern void vesa_userpan(enum vga_pan_direction);
|
extern void vesa_userpan(enum vga_pan_direction);
|
||||||
extern void vesa_overview(boolean);
|
extern void vesa_overview(boolean);
|
||||||
extern void vesa_traditional(boolean);
|
extern void vesa_traditional(boolean);
|
||||||
|
|||||||
+4
-4
@@ -593,17 +593,17 @@ xputc(int ch) /* write out character (and attribute) */
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* write out a glyph picture at current location */
|
/* write out a glyph picture at current location */
|
||||||
void xputg(int glyphnum, int ch, unsigned special)
|
void xputg(const glyph_info *glyphinfo)
|
||||||
{
|
{
|
||||||
if (!iflags.grmode || !iflags.tile_view) {
|
if (!iflags.grmode || !iflags.tile_view) {
|
||||||
(void) xputc((char) ch);
|
(void) xputc((char) glyphinfo->ttychar);
|
||||||
#ifdef SCREEN_VGA
|
#ifdef SCREEN_VGA
|
||||||
} else if (iflags.grmode && iflags.usevga) {
|
} else if (iflags.grmode && iflags.usevga) {
|
||||||
vga_xputg(glyphnum, ch, special);
|
vga_xputg(glyphinfo);
|
||||||
#endif
|
#endif
|
||||||
#ifdef SCREEN_VESA
|
#ifdef SCREEN_VESA
|
||||||
} else if (iflags.grmode && iflags.usevesa) {
|
} else if (iflags.grmode && iflags.usevesa) {
|
||||||
vesa_xputg(glyphnum, ch, special);
|
vesa_xputg(glyphinfo);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-10
@@ -85,6 +85,7 @@ static struct map_struct {
|
|||||||
int ch;
|
int ch;
|
||||||
int attr;
|
int attr;
|
||||||
unsigned special;
|
unsigned special;
|
||||||
|
short int tileidx;
|
||||||
} map[ROWNO][COLNO]; /* track the glyphs */
|
} map[ROWNO][COLNO]; /* track the glyphs */
|
||||||
|
|
||||||
#define vesa_clearmap() \
|
#define vesa_clearmap() \
|
||||||
@@ -667,14 +668,13 @@ vesa_xputc(char ch, int attr)
|
|||||||
#if defined(USE_TILES)
|
#if defined(USE_TILES)
|
||||||
/* Place tile represent. a glyph at current location */
|
/* Place tile represent. a glyph at current location */
|
||||||
void
|
void
|
||||||
vesa_xputg(int glyphnum, int ch,
|
vesa_xputg(const glyph_info *glyphinfo)
|
||||||
unsigned special) /* special feature: corpse, invis, detected, pet, ridden -
|
|
||||||
hack.h */
|
|
||||||
{
|
{
|
||||||
|
int glyphnum = glyphinfo->glyph, ch = glyphinfo->ttychar;
|
||||||
|
unsigned special = glyphinfo->gm.glyphflags;
|
||||||
int col, row;
|
int col, row;
|
||||||
int attr;
|
int attr;
|
||||||
int ry;
|
int ry;
|
||||||
int tilenum = 0;
|
|
||||||
|
|
||||||
row = currow;
|
row = currow;
|
||||||
col = curcol;
|
col = curcol;
|
||||||
@@ -685,6 +685,7 @@ vesa_xputg(int glyphnum, int ch,
|
|||||||
map[ry][col].glyph = glyphnum;
|
map[ry][col].glyph = glyphnum;
|
||||||
map[ry][col].ch = ch;
|
map[ry][col].ch = ch;
|
||||||
map[ry][col].special = special;
|
map[ry][col].special = special;
|
||||||
|
map[ry][col].tileidx = glyphinfo->gm.tileidx;
|
||||||
attr = (g_attribute == 0) ? attrib_gr_normal : g_attribute;
|
attr = (g_attribute == 0) ? attrib_gr_normal : g_attribute;
|
||||||
map[ry][col].attr = attr;
|
map[ry][col].attr = attr;
|
||||||
if (iflags.traditional_view) {
|
if (iflags.traditional_view) {
|
||||||
@@ -696,10 +697,7 @@ vesa_xputg(int glyphnum, int ch,
|
|||||||
if (!iflags.over_view && map[ry][col].special)
|
if (!iflags.over_view && map[ry][col].special)
|
||||||
decal_packed(packcell, special);
|
decal_packed(packcell, special);
|
||||||
#endif
|
#endif
|
||||||
tilenum = glyph2tile[glyphnum];
|
vesa_DisplayCell(glyphinfo->gm.tileidx, col - clipx, ry - clipy);
|
||||||
if (map[ry][col].special & MG_FEMALE)
|
|
||||||
tilenum++;
|
|
||||||
vesa_DisplayCell(tilenum, col - clipx, ry - clipy);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (col < (CO - 1))
|
if (col < (CO - 1))
|
||||||
@@ -807,7 +805,7 @@ vesa_redrawmap(void)
|
|||||||
for (cy = 0; cy < ROWNO; ++cy) {
|
for (cy = 0; cy < ROWNO; ++cy) {
|
||||||
for (py = 0; py < vesa_oview_height; ++py) {
|
for (py = 0; py < vesa_oview_height; ++py) {
|
||||||
for (cx = 0; cx < COLNO; ++cx) {
|
for (cx = 0; cx < COLNO; ++cx) {
|
||||||
tile = vesa_oview_tiles[glyph2tile[map[cy][cx].glyph]];
|
tile = vesa_oview_tiles[map[cy][cx].tileidx];
|
||||||
vesa_WritePixelRow(offset + p_row_width * cx, tile + p_row_width * py, p_row_width);
|
vesa_WritePixelRow(offset + p_row_width * cx, tile + p_row_width * py, p_row_width);
|
||||||
}
|
}
|
||||||
x = COLNO * vesa_oview_width;
|
x = COLNO * vesa_oview_width;
|
||||||
@@ -827,7 +825,7 @@ vesa_redrawmap(void)
|
|||||||
for (cy = clipy; cy <= (unsigned) clipymax && cy < ROWNO; ++cy) {
|
for (cy = clipy; cy <= (unsigned) clipymax && cy < ROWNO; ++cy) {
|
||||||
for (py = 0; py < (unsigned) iflags.wc_tile_height; ++py) {
|
for (py = 0; py < (unsigned) iflags.wc_tile_height; ++py) {
|
||||||
for (cx = clipx; cx <= (unsigned) clipxmax && cx < COLNO; ++cx) {
|
for (cx = clipx; cx <= (unsigned) clipxmax && cx < COLNO; ++cx) {
|
||||||
tile = vesa_tiles[glyph2tile[map[cy][cx].glyph]];
|
tile = vesa_tiles[map[cy][cx].tileidx];
|
||||||
vesa_WritePixelRow(offset + p_row_width * (cx - clipx), tile + p_row_width * py, p_row_width);
|
vesa_WritePixelRow(offset + p_row_width * (cx - clipx), tile + p_row_width * py, p_row_width);
|
||||||
}
|
}
|
||||||
x = (cx - clipx) * iflags.wc_tile_width;
|
x = (cx - clipx) * iflags.wc_tile_width;
|
||||||
|
|||||||
+10
-9
@@ -102,8 +102,6 @@
|
|||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern short glyph2tile[];
|
|
||||||
|
|
||||||
/* static void vga_NoBorder(int); */
|
/* static void vga_NoBorder(int); */
|
||||||
void vga_gotoloc(int, int); /* This should be made a macro */
|
void vga_gotoloc(int, int); /* This should be made a macro */
|
||||||
void vga_backsp(void);
|
void vga_backsp(void);
|
||||||
@@ -157,6 +155,7 @@ static struct map_struct {
|
|||||||
int ch;
|
int ch;
|
||||||
int attr;
|
int attr;
|
||||||
unsigned special;
|
unsigned special;
|
||||||
|
short int tileidx;
|
||||||
} map[ROWNO][COLNO]; /* track the glyphs */
|
} map[ROWNO][COLNO]; /* track the glyphs */
|
||||||
|
|
||||||
#define vga_clearmap() \
|
#define vga_clearmap() \
|
||||||
@@ -168,6 +167,7 @@ static struct map_struct {
|
|||||||
map[y][x].ch = S_stone; \
|
map[y][x].ch = S_stone; \
|
||||||
map[y][x].attr = 0; \
|
map[y][x].attr = 0; \
|
||||||
map[y][x].special = 0; \
|
map[y][x].special = 0; \
|
||||||
|
map[y][x].tileidx = 0; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
#define TOP_MAP_ROW 1
|
#define TOP_MAP_ROW 1
|
||||||
@@ -356,18 +356,20 @@ void vga_xputc(char ch, int attr)
|
|||||||
#if defined(USE_TILES)
|
#if defined(USE_TILES)
|
||||||
/* Place tile represent. a glyph at current location */
|
/* Place tile represent. a glyph at current location */
|
||||||
void
|
void
|
||||||
vga_xputg(int glyphnum, int ch,
|
vga_xputg(const glyph_info *glyphinfo)
|
||||||
unsigned special) /* special feature: corpse, invis, detected, pet, ridden -
|
|
||||||
hack.h */
|
|
||||||
{
|
{
|
||||||
|
int glyphnum = glyphinfo->glyph, ch = glyphinfo->ttychar;
|
||||||
|
unsigned special = glyphinfo->gm.glyphflags;
|
||||||
int col, row;
|
int col, row;
|
||||||
int attr;
|
int attr;
|
||||||
int ry;
|
int ry;
|
||||||
|
|
||||||
/* If statue glyph, map to the generic statue */
|
/* If statue glyph, map to the generic statue */
|
||||||
|
#if 0
|
||||||
if (GLYPH_STATUE_OFF <= glyphnum && glyphnum < GLYPH_STATUE_OFF + NUMMONS) {
|
if (GLYPH_STATUE_OFF <= glyphnum && glyphnum < GLYPH_STATUE_OFF + NUMMONS) {
|
||||||
glyphnum = objnum_to_glyph(STATUE);
|
glyphnum = objnum_to_glyph(STATUE);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
row = currow;
|
row = currow;
|
||||||
col = curcol;
|
col = curcol;
|
||||||
@@ -380,6 +382,7 @@ vga_xputg(int glyphnum, int ch,
|
|||||||
map[ry][col].special = special;
|
map[ry][col].special = special;
|
||||||
attr = (g_attribute == 0) ? attrib_gr_normal : g_attribute;
|
attr = (g_attribute == 0) ? attrib_gr_normal : g_attribute;
|
||||||
map[ry][col].attr = attr;
|
map[ry][col].attr = attr;
|
||||||
|
map[ry][col].tileidx = glyphinfo->gm.tileidx;
|
||||||
if (iflags.traditional_view) {
|
if (iflags.traditional_view) {
|
||||||
vga_WriteChar((unsigned char) ch, col, row, attr);
|
vga_WriteChar((unsigned char) ch, col, row, attr);
|
||||||
} else if (!iflags.over_view) {
|
} else if (!iflags.over_view) {
|
||||||
@@ -677,16 +680,14 @@ read_tile_indexes(unsigned glyph, unsigned char (*indexes)[TILE_X])
|
|||||||
glyph = GLYPH_OBJ_OFF + STATUE;
|
glyph = GLYPH_OBJ_OFF + STATUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the tile from the image */
|
|
||||||
tilenum = glyph2tile[glyph];
|
|
||||||
row = currow;
|
row = currow;
|
||||||
col = curcol;
|
col = curcol;
|
||||||
if ((col < 0 || col >= COLNO)
|
if ((col < 0 || col >= COLNO)
|
||||||
|| (row < TOP_MAP_ROW || row >= (ROWNO + TOP_MAP_ROW)))
|
|| (row < TOP_MAP_ROW || row >= (ROWNO + TOP_MAP_ROW)))
|
||||||
return;
|
return;
|
||||||
ry = row - TOP_MAP_ROW;
|
ry = row - TOP_MAP_ROW;
|
||||||
if (map[ry][col].special & MG_FEMALE)
|
/* Get the tile from the image */
|
||||||
tilenum++;
|
tilenum = map[ry][col].tileidx;
|
||||||
tile = get_tile(tilenum);
|
tile = get_tile(tilenum);
|
||||||
|
|
||||||
/* Map to a 16 bit palette; assume colors laid out as in default tileset */
|
/* Map to a 16 bit palette; assume colors laid out as in default tileset */
|
||||||
|
|||||||
@@ -296,8 +296,9 @@ tile2beos: tile2beos.o $(TEXT_IO)
|
|||||||
# that without mucking about with extra OS-specific CFLAGS and/or LFLAGS
|
# that without mucking about with extra OS-specific CFLAGS and/or LFLAGS
|
||||||
#tilemap: ../win/share/tilemap.c $(HACK_H)
|
#tilemap: ../win/share/tilemap.c $(HACK_H)
|
||||||
# $(CC) $(CFLAGS) $(LFLAGS) -o tilemap ../win/share/tilemap.c $(LIBS)
|
# $(CC) $(CFLAGS) $(LFLAGS) -o tilemap ../win/share/tilemap.c $(LIBS)
|
||||||
tilemap: tilemap.o
|
tilemap: tilemap.o $(OBJDIR)/objects.o $(OBJDIR)/monst.o $(OBJDIR)/drawing.o
|
||||||
$(CLINK) $(LFLAGS) -o tilemap tilemap.o $(LIBS)
|
$(CLINK) $(LFLAGS) -o tilemap tilemap.o $(OBJDIR)/objects.o \
|
||||||
|
$(OBJDIR)/monst.o $(OBJDIR)/drawing.o $(LIBS)
|
||||||
../src/tile.c: tilemap
|
../src/tile.c: tilemap
|
||||||
./tilemap
|
./tilemap
|
||||||
|
|
||||||
|
|||||||
+11
-10
@@ -1429,9 +1429,10 @@ $(SRC)\tile.c: $(U)tilemap.exe
|
|||||||
@$(U)tilemap
|
@$(U)tilemap
|
||||||
@echo A new $(@:\=/) has been created
|
@echo A new $(@:\=/) has been created
|
||||||
|
|
||||||
$(U)tilemap.exe: $(O)tilemap.o
|
$(U)tilemap.exe: $(O)tilemap.o $(O)monst.o $(O)objects.o $(O)drawing.o
|
||||||
@echo Linking $(@:\=/)
|
@echo Linking $(@:\=/)
|
||||||
@$(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(O)tilemap.o
|
@$(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ \
|
||||||
|
$(O)tilemap.o $(O)monst.o $(O)objects.o $(O)drawing.o
|
||||||
|
|
||||||
$(O)tilemap.o: $(WSHR)\tilemap.c $(HACK_H)
|
$(O)tilemap.o: $(WSHR)\tilemap.c $(HACK_H)
|
||||||
@$(cc) $(cflagsBuild) $(CROSSCOMPILE) -Fo$@ $(WSHR)\tilemap.c
|
@$(cc) $(cflagsBuild) $(CROSSCOMPILE) -Fo$@ $(WSHR)\tilemap.c
|
||||||
@@ -1924,30 +1925,30 @@ $(TARGETPFX)wintty.o: ..\win\tty\wintty.c $(HACK_H) $(INCL)\dlb.h \
|
|||||||
$(INCL)\tcap.h $(INCL)\wintty.h
|
$(INCL)\tcap.h $(INCL)\wintty.h
|
||||||
$(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\tty\wintty.c
|
$(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\tty\wintty.c
|
||||||
$(TARGETPFX)cursmain.o: ..\win\curses\cursmain.c $(HACK_H) $(INCL)\wincurs.h
|
$(TARGETPFX)cursmain.o: ..\win\curses\cursmain.c $(HACK_H) $(INCL)\wincurs.h
|
||||||
$(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursmain.c
|
# $(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursmain.c
|
||||||
$(TARGETPFX)curswins.o: ..\win\curses\curswins.c $(HACK_H) \
|
$(TARGETPFX)curswins.o: ..\win\curses\curswins.c $(HACK_H) \
|
||||||
$(INCL)\wincurs.h ..\win\curses\curswins.h
|
$(INCL)\wincurs.h ..\win\curses\curswins.h
|
||||||
$(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\curswins.c
|
# $(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\curswins.c
|
||||||
$(TARGETPFX)cursmisc.o: ..\win\curses\cursmisc.c $(HACK_H) \
|
$(TARGETPFX)cursmisc.o: ..\win\curses\cursmisc.c $(HACK_H) \
|
||||||
$(INCL)\wincurs.h ..\win\curses\cursmisc.h \
|
$(INCL)\wincurs.h ..\win\curses\cursmisc.h \
|
||||||
$(INCL)\func_tab.h $(INCL)\dlb.h
|
$(INCL)\func_tab.h $(INCL)\dlb.h
|
||||||
$(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursmisc.c
|
# $(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursmisc.c
|
||||||
$(TARGETPFX)cursdial.o: ..\win\curses\cursdial.c $(HACK_H) \
|
$(TARGETPFX)cursdial.o: ..\win\curses\cursdial.c $(HACK_H) \
|
||||||
$(INCL)\wincurs.h ..\win\curses\cursdial.h \
|
$(INCL)\wincurs.h ..\win\curses\cursdial.h \
|
||||||
$(INCL)\func_tab.h
|
$(INCL)\func_tab.h
|
||||||
$(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursdial.c
|
# $(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursdial.c
|
||||||
$(TARGETPFX)cursstat.o: ..\win\curses\cursstat.c $(HACK_H) \
|
$(TARGETPFX)cursstat.o: ..\win\curses\cursstat.c $(HACK_H) \
|
||||||
$(INCL)\wincurs.h ..\win\curses\cursstat.h
|
$(INCL)\wincurs.h ..\win\curses\cursstat.h
|
||||||
$(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursstat.c
|
# $(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursstat.c
|
||||||
$(TARGETPFX)cursinit.o: ..\win\curses\cursinit.c $(HACK_H) \
|
$(TARGETPFX)cursinit.o: ..\win\curses\cursinit.c $(HACK_H) \
|
||||||
$(INCL)\wincurs.h ..\win\curses\cursinit.h
|
$(INCL)\wincurs.h ..\win\curses\cursinit.h
|
||||||
$(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursinit.c
|
# $(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursinit.c
|
||||||
$(TARGETPFX)cursmesg.o: ..\win\curses\cursmesg.c $(HACK_H) \
|
$(TARGETPFX)cursmesg.o: ..\win\curses\cursmesg.c $(HACK_H) \
|
||||||
$(INCL)\wincurs.h ..\win\curses\cursmesg.h
|
$(INCL)\wincurs.h ..\win\curses\cursmesg.h
|
||||||
$(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursmesg.c
|
# $(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursmesg.c
|
||||||
$(TARGETPFX)cursinvt.o: ..\win\curses\cursinvt.c $(HACK_H) \
|
$(TARGETPFX)cursinvt.o: ..\win\curses\cursinvt.c $(HACK_H) \
|
||||||
$(INCL)\wincurs.h ..\win\curses\cursinvt.h
|
$(INCL)\wincurs.h ..\win\curses\cursinvt.h
|
||||||
$(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursinvt.c
|
# $(TARGET_CC) $(TARGET_CFLAGS) -Fo$@ ..\win\curses\cursinvt.c
|
||||||
#$(TARGETPFX)Window.o: ..\win\X11\Window.c $(INCL)\xwindowp.h \
|
#$(TARGETPFX)Window.o: ..\win\X11\Window.c $(INCL)\xwindowp.h \
|
||||||
# $(INCL)\xwindow.h $(CONFIG_H) $(INCL)\lint.h \
|
# $(INCL)\xwindow.h $(CONFIG_H) $(INCL)\lint.h \
|
||||||
# $(INCL)\winX.h $(INCL)\color.h $(INCL)\wintype.h
|
# $(INCL)\winX.h $(INCL)\color.h $(INCL)\wintype.h
|
||||||
|
|||||||
+20
-10
@@ -80,13 +80,18 @@ NetHackQtGlyphs::NetHackQtGlyphs()
|
|||||||
setSize(tilefile_tile_W, tilefile_tile_H);
|
setSize(tilefile_tile_W, tilefile_tile_H);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetHackQtGlyphs::drawGlyph(QPainter& painter, int glyph, int x, int y,
|
void NetHackQtGlyphs::drawGlyph(QPainter& painter, int glyph, int tileidx,
|
||||||
bool fem, bool reversed)
|
int x, int y, bool fem, bool reversed)
|
||||||
{
|
{
|
||||||
if (!reversed) {
|
if (!reversed) {
|
||||||
|
#if 0
|
||||||
int tile = glyph2tile[glyph];
|
int tile = glyph2tile[glyph];
|
||||||
|
/* this is not required with the new glyph representation */
|
||||||
if (fem)
|
if (fem)
|
||||||
++tile;
|
++tile;
|
||||||
|
#else
|
||||||
|
int tile = tileidx;
|
||||||
|
#endif
|
||||||
int px = (tile % tiles_per_row) * width();
|
int px = (tile % tiles_per_row) * width();
|
||||||
int py = tile / tiles_per_row * height();
|
int py = tile / tiles_per_row * height();
|
||||||
|
|
||||||
@@ -98,15 +103,16 @@ void NetHackQtGlyphs::drawGlyph(QPainter& painter, int glyph, int x, int y,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetHackQtGlyphs::drawCell(QPainter& painter, int glyph,
|
void NetHackQtGlyphs::drawCell(QPainter& painter, int glyph, int tileidx,
|
||||||
int cellx, int celly, bool fem)
|
int cellx, int celly, bool fem)
|
||||||
{
|
{
|
||||||
drawGlyph(painter, glyph, cellx * width(), celly * height(), fem, false);
|
drawGlyph(painter, glyph, tileidx, cellx * width(), celly * height(),
|
||||||
|
fem, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetHackQtGlyphs::drawBorderedCell(QPainter& painter, int glyph,
|
void NetHackQtGlyphs::drawBorderedCell(QPainter& painter, int glyph,
|
||||||
int cellx, int celly, int border,
|
int tileidx, int cellx, int celly,
|
||||||
bool reversed, bool fem)
|
int border, bool reversed, bool fem)
|
||||||
{
|
{
|
||||||
int wd = width(),
|
int wd = width(),
|
||||||
ht = height(),
|
ht = height(),
|
||||||
@@ -114,7 +120,7 @@ void NetHackQtGlyphs::drawBorderedCell(QPainter& painter, int glyph,
|
|||||||
lox = cellx * (wd + 2),
|
lox = cellx * (wd + 2),
|
||||||
loy = celly * (ht + 2) + yoffset;
|
loy = celly * (ht + 2) + yoffset;
|
||||||
|
|
||||||
drawGlyph(painter, glyph, lox + 1, loy + 1, fem, reversed);
|
drawGlyph(painter, glyph, tileidx, lox + 1, loy + 1, fem, reversed);
|
||||||
|
|
||||||
#ifdef TEXTCOLOR
|
#ifdef TEXTCOLOR
|
||||||
if (border != NO_BORDER) {
|
if (border != NO_BORDER) {
|
||||||
@@ -165,11 +171,15 @@ void NetHackQtGlyphs::drawBorderedCell(QPainter& painter, int glyph,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// mis-named routine to get the pixmap for a particular glyph
|
// mis-named routine to get the pixmap for a particular glyph
|
||||||
QPixmap NetHackQtGlyphs::glyph(int glyphindx, bool fem)
|
QPixmap NetHackQtGlyphs::glyph(int glyphindx UNUSED, int tileidx, bool fem UNUSED)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
int tile = glyph2tile[glyphindx];
|
int tile = glyph2tile[glyphindx];
|
||||||
if (fem)
|
if (fem)
|
||||||
++tile;
|
++tile;
|
||||||
|
#else
|
||||||
|
int tile = tileidx;
|
||||||
|
#endif
|
||||||
int px = (tile % tiles_per_row) * tilefile_tile_W;
|
int px = (tile % tiles_per_row) * tilefile_tile_W;
|
||||||
int py = tile / tiles_per_row * tilefile_tile_H;
|
int py = tile / tiles_per_row * tilefile_tile_H;
|
||||||
|
|
||||||
@@ -178,9 +188,9 @@ QPixmap NetHackQtGlyphs::glyph(int glyphindx, bool fem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// transpose a glyph's tile horizontally, scaled for use in paper doll
|
// transpose a glyph's tile horizontally, scaled for use in paper doll
|
||||||
QPixmap NetHackQtGlyphs::reversed_pixmap(int glyphindx, bool fem)
|
QPixmap NetHackQtGlyphs::reversed_pixmap(int glyphindx, int tileidx, bool fem)
|
||||||
{
|
{
|
||||||
QPixmap pxmp = glyph(glyphindx, fem);
|
QPixmap pxmp = glyph(glyphindx, tileidx, fem);
|
||||||
#ifdef ENHANCED_PAPERDOLL
|
#ifdef ENHANCED_PAPERDOLL
|
||||||
qreal wid = (qreal) pxmp.width(),
|
qreal wid = (qreal) pxmp.width(),
|
||||||
//hgt = (qreal) pxmp.height(),
|
//hgt = (qreal) pxmp.height(),
|
||||||
|
|||||||
+7
-5
@@ -23,14 +23,16 @@ public:
|
|||||||
void toggleSize();
|
void toggleSize();
|
||||||
void setSize(int w, int h);
|
void setSize(int w, int h);
|
||||||
|
|
||||||
void drawGlyph(QPainter &, int glyph, int pixelx, int pixely,
|
void drawGlyph(QPainter &, int glyph, int tileidx,
|
||||||
|
int pixelx, int pixely,
|
||||||
bool fem, bool reversed = false);
|
bool fem, bool reversed = false);
|
||||||
void drawCell(QPainter &, int glyph, int cellx, int celly, bool fem);
|
void drawCell(QPainter &, int glyph, int tileidx,
|
||||||
void drawBorderedCell(QPainter &, int glyph,
|
int cellx, int celly, bool fem);
|
||||||
|
void drawBorderedCell(QPainter &, int glyph, int tileidx,
|
||||||
int cellx, int celly, int bordercode,
|
int cellx, int celly, int bordercode,
|
||||||
bool reversed, bool fem = false);
|
bool reversed, bool fem = false);
|
||||||
QPixmap glyph(int glyphindx, bool fem = false);
|
QPixmap glyph(int glyphindx, int tileidx, bool fem = false);
|
||||||
QPixmap reversed_pixmap(int glyphindx, bool fem = false);
|
QPixmap reversed_pixmap(int glyphindx, int tileidx, bool fem = false);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QImage img;
|
QImage img;
|
||||||
|
|||||||
+4
-1
@@ -75,6 +75,7 @@ void NetHackQtInvUsageWindow::drawWorn(QPainter &painter, obj *nhobj,
|
|||||||
const char *alttip, int flags)
|
const char *alttip, int flags)
|
||||||
{
|
{
|
||||||
short int glyph;
|
short int glyph;
|
||||||
|
glyph_info gi;
|
||||||
int border;
|
int border;
|
||||||
char tipstr[1 + BUFSZ + 1]; // extra room for leading and trailing space
|
char tipstr[1 + BUFSZ + 1]; // extra room for leading and trailing space
|
||||||
bool rev = (flags == dollReverse),
|
bool rev = (flags == dollReverse),
|
||||||
@@ -112,6 +113,8 @@ void NetHackQtInvUsageWindow::drawWorn(QPainter &painter, obj *nhobj,
|
|||||||
tips[x][y] = dupstr(tipstr);
|
tips[x][y] = dupstr(tipstr);
|
||||||
#endif
|
#endif
|
||||||
glyph = obj_to_glyph(nhobj, rn2_on_display_rng);
|
glyph = obj_to_glyph(nhobj, rn2_on_display_rng);
|
||||||
|
map_glyphinfo(0, 0, glyph, 0, &gi); /* this skirts the defined
|
||||||
|
interface unfortunately */
|
||||||
} else {
|
} else {
|
||||||
border = NO_BORDER;
|
border = NO_BORDER;
|
||||||
#ifdef ENHANCED_PAPERDOLL
|
#ifdef ENHANCED_PAPERDOLL
|
||||||
@@ -133,7 +136,7 @@ void NetHackQtInvUsageWindow::drawWorn(QPainter &painter, obj *nhobj,
|
|||||||
// an empty slot is shown as floor tile unless it's always empty
|
// an empty slot is shown as floor tile unless it's always empty
|
||||||
glyph = canbe ? cmap_to_glyph(S_room) : GLYPH_UNEXPLORED;
|
glyph = canbe ? cmap_to_glyph(S_room) : GLYPH_UNEXPLORED;
|
||||||
}
|
}
|
||||||
qt_settings->glyphs().drawBorderedCell(painter, glyph, x, y, border, rev);
|
qt_settings->glyphs().drawBorderedCell(painter, glyph, gi.gm.tileidx, x, y, border, rev);
|
||||||
}
|
}
|
||||||
|
|
||||||
// called to update the paper doll inventory subset
|
// called to update the paper doll inventory subset
|
||||||
|
|||||||
+14
-4
@@ -184,6 +184,7 @@ void NetHackQtMapViewport::paintEvent(QPaintEvent* event)
|
|||||||
unsigned short color = Glyphcolor(i, j);
|
unsigned short color = Glyphcolor(i, j);
|
||||||
unsigned short ch = Glyphttychar(i, j);
|
unsigned short ch = Glyphttychar(i, j);
|
||||||
unsigned special = Glyphflags(i, j);
|
unsigned special = Glyphflags(i, j);
|
||||||
|
/* unsigned short tileidx = Glyphtileidx(i, j); */
|
||||||
ch = cp437(ch);
|
ch = cp437(ch);
|
||||||
#ifdef TEXTCOLOR
|
#ifdef TEXTCOLOR
|
||||||
painter.setPen( nhcolor_to_pen(color) );
|
painter.setPen( nhcolor_to_pen(color) );
|
||||||
@@ -213,8 +214,9 @@ void NetHackQtMapViewport::paintEvent(QPaintEvent* event)
|
|||||||
for (int i = garea.left(); i <= garea.right(); i++) {
|
for (int i = garea.left(); i <= garea.right(); i++) {
|
||||||
unsigned short g = Glyph(i,j);
|
unsigned short g = Glyph(i,j);
|
||||||
unsigned special = Glyphflags(i, j);
|
unsigned special = Glyphflags(i, j);
|
||||||
|
unsigned tileidx = Glyphtileidx(i, j);
|
||||||
bool femflag = (special & MG_FEMALE) ? true : false;
|
bool femflag = (special & MG_FEMALE) ? true : false;
|
||||||
glyphs.drawCell(painter, g, i, j, femflag);
|
glyphs.drawCell(painter, g, tileidx, i, j, femflag);
|
||||||
|
|
||||||
if ((special & MG_PET) != 0 && ::iflags.hilite_pet) {
|
if ((special & MG_PET) != 0 && ::iflags.hilite_pet) {
|
||||||
painter.drawPixmap(QPoint(i * gW, j * gH),
|
painter.drawPixmap(QPoint(i * gW, j * gH),
|
||||||
@@ -498,12 +500,14 @@ void NetHackQtMapViewport::Clear()
|
|||||||
Glyphttychar(0, j) = ' ';
|
Glyphttychar(0, j) = ' ';
|
||||||
Glyphcolor(0, j) = NO_COLOR;
|
Glyphcolor(0, j) = NO_COLOR;
|
||||||
Glyphflags(0, j) = 0U;
|
Glyphflags(0, j) = 0U;
|
||||||
|
Glyphtileidx(0, j) = 0;
|
||||||
|
|
||||||
for (int i = 1; i < COLNO; ++i) {
|
for (int i = 1; i < COLNO; ++i) {
|
||||||
Glyph(i, j) = GLYPH_UNEXPLORED;
|
Glyph(i, j) = GLYPH_UNEXPLORED;
|
||||||
Glyphttychar(i, j) = ' ';
|
Glyphttychar(i, j) = ' ';
|
||||||
Glyphcolor(i, j) = NO_COLOR;
|
Glyphcolor(i, j) = NO_COLOR;
|
||||||
Glyphflags(i, j) = 0U;
|
Glyphflags(i, j) = 0U;
|
||||||
|
Glyphtileidx(i, j) = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -541,8 +545,9 @@ void NetHackQtMapViewport::PrintGlyph(int x, int y,
|
|||||||
{
|
{
|
||||||
Glyph(x, y) = (unsigned short) glyphinfo->glyph;
|
Glyph(x, y) = (unsigned short) glyphinfo->glyph;
|
||||||
Glyphttychar(x, y) = (unsigned short) glyphinfo->ttychar;
|
Glyphttychar(x, y) = (unsigned short) glyphinfo->ttychar;
|
||||||
Glyphcolor(x, y) = (unsigned short) glyphinfo->color;
|
Glyphcolor(x, y) = (unsigned short) glyphinfo->gm.color;
|
||||||
Glyphflags(x, y) = glyphinfo->glyphflags;
|
Glyphflags(x, y) = glyphinfo->gm.glyphflags;
|
||||||
|
Glyphtileidx(x, y) = (unsigned short) glyphinfo->gm.tileidx;
|
||||||
Changed(x, y);
|
Changed(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -775,11 +780,13 @@ void NetHackQtMapWindow::Clear()
|
|||||||
Glyphcolor(0, j) = NO_COLOR;
|
Glyphcolor(0, j) = NO_COLOR;
|
||||||
Glyphttychar(0, j) = ' ';
|
Glyphttychar(0, j) = ' ';
|
||||||
Glyphflags(0, j) = 0;
|
Glyphflags(0, j) = 0;
|
||||||
|
Glyphtileidx(0, j) = 0;
|
||||||
for (int i = 1; i < COLNO; ++i) {
|
for (int i = 1; i < COLNO; ++i) {
|
||||||
Glyph(i, j) = GLYPH_UNEXPLORED;
|
Glyph(i, j) = GLYPH_UNEXPLORED;
|
||||||
Glyphcolor(i, j) = NO_COLOR;
|
Glyphcolor(i, j) = NO_COLOR;
|
||||||
Glyphttychar(i, j) = ' ';
|
Glyphttychar(i, j) = ' ';
|
||||||
Glyphflags(i, j) = 0;
|
Glyphflags(i, j) = 0;
|
||||||
|
Glyphtileidx(i, j) = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -895,8 +902,10 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
|||||||
int color = Glyphcolor(i,j);
|
int color = Glyphcolor(i,j);
|
||||||
int ch = Glyphttychar(i,j);
|
int ch = Glyphttychar(i,j);
|
||||||
unsigned special = Glyphflags(i,j);
|
unsigned special = Glyphflags(i,j);
|
||||||
|
unsigned short tileidx = Glyphtileidx(i,j);
|
||||||
bool femflag = (special & MG_FEMALE) ? true : false;
|
bool femflag = (special & MG_FEMALE) ? true : false;
|
||||||
qt_settings->glyphs().drawCell(painter, g, i, j, femflag);
|
qt_settings->glyphs().drawCell(painter, g, tileidx,
|
||||||
|
i, j, femflag);
|
||||||
#ifdef TEXTCOLOR
|
#ifdef TEXTCOLOR
|
||||||
if ((special & MG_PET) != 0 && ::iflags.hilite_pet) {
|
if ((special & MG_PET) != 0 && ::iflags.hilite_pet) {
|
||||||
painter.drawPixmap(QPoint(i*qt_settings->glyphs().width(),
|
painter.drawPixmap(QPoint(i*qt_settings->glyphs().width(),
|
||||||
@@ -1011,6 +1020,7 @@ void NetHackQtMapWindow::PrintGlyph(int x,int y, const glyph_info *glyphinfo)
|
|||||||
Glyphttychar(x,y)=glyphinfo->ttychar;
|
Glyphttychar(x,y)=glyphinfo->ttychar;
|
||||||
Glyphcolor(x,y)=glyphinfo->color;
|
Glyphcolor(x,y)=glyphinfo->color;
|
||||||
Glyphflags(x,y)=glyphinfo->glyphflags;
|
Glyphflags(x,y)=glyphinfo->glyphflags;
|
||||||
|
Glyphtileidx(x,y)=glyphinfo->tileidx;
|
||||||
Changed(x,y);
|
Changed(x,y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ private:
|
|||||||
unsigned int &Glyphflags(int x, int y) {
|
unsigned int &Glyphflags(int x, int y) {
|
||||||
return glyphflags[y][x];
|
return glyphflags[y][x];
|
||||||
}
|
}
|
||||||
|
unsigned short glyphtileidx[ROWNO][COLNO];
|
||||||
|
unsigned short &Glyphtileidx(int x, int y) {
|
||||||
|
return glyphtileidx[y][x];
|
||||||
|
}
|
||||||
QPoint cursor;
|
QPoint cursor;
|
||||||
QPixmap pet_annotation;
|
QPixmap pet_annotation;
|
||||||
QPixmap pile_annotation;
|
QPixmap pile_annotation;
|
||||||
|
|||||||
+3
-1
@@ -545,6 +545,7 @@ void NetHackQtMenuWindow::AddRow(int row, const MenuItem& mi)
|
|||||||
{
|
{
|
||||||
QFontMetrics fm(table->font());
|
QFontMetrics fm(table->font());
|
||||||
QTableWidgetItem *twi;
|
QTableWidgetItem *twi;
|
||||||
|
glyph_info gi;
|
||||||
|
|
||||||
if (mi.Selectable() && how != PICK_NONE) {
|
if (mi.Selectable() && how != PICK_NONE) {
|
||||||
// Count
|
// Count
|
||||||
@@ -569,7 +570,8 @@ void NetHackQtMenuWindow::AddRow(int row, const MenuItem& mi)
|
|||||||
}
|
}
|
||||||
if (mi.glyph != NO_GLYPH) {
|
if (mi.glyph != NO_GLYPH) {
|
||||||
// Icon
|
// Icon
|
||||||
QPixmap pm(qt_settings->glyphs().glyph(mi.glyph));
|
map_glyphinfo(0, 0, mi.glyph, 0, &gi);
|
||||||
|
QPixmap pm(qt_settings->glyphs().glyph(mi.glyph, gi.gm.tileidx));
|
||||||
twi = new QTableWidgetItem(QIcon(pm), "");
|
twi = new QTableWidgetItem(QIcon(pm), "");
|
||||||
table->setItem(row, 2, twi);
|
table->setItem(row, 2, twi);
|
||||||
twi->setFlags(Qt::ItemIsEnabled);
|
twi->setFlags(Qt::ItemIsEnabled);
|
||||||
|
|||||||
+10
-4
@@ -82,14 +82,14 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void setGlyph(int g, bool fem)
|
void setGlyph(int g, int tileidx, bool fem)
|
||||||
{
|
{
|
||||||
NetHackQtGlyphs& glyphs = qt_settings->glyphs();
|
NetHackQtGlyphs& glyphs = qt_settings->glyphs();
|
||||||
int gw = glyphs.width();
|
int gw = glyphs.width();
|
||||||
int gh = glyphs.height();
|
int gh = glyphs.height();
|
||||||
QPixmap pm(gw,gh);
|
QPixmap pm(gw,gh);
|
||||||
QPainter p(&pm);
|
QPainter p(&pm);
|
||||||
glyphs.drawGlyph(p, g, 0, 0, fem);
|
glyphs.drawGlyph(p, g, tileidx, 0, 0, fem);
|
||||||
p.end();
|
p.end();
|
||||||
setIcon(QIcon(pm));
|
setIcon(QIcon(pm));
|
||||||
//RLC setHeight(std::max(pm.height()+1,height()));
|
//RLC setHeight(std::max(pm.height()+1,height()));
|
||||||
@@ -124,7 +124,10 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
setGlyph(monnum_to_glyph(roles[id].malenum), false);
|
glyph_info gi;
|
||||||
|
int glyph = monnum_to_glyph(roles[id].malenum, MALE);
|
||||||
|
map_glyphinfo(0, 0, glyph, 0, &gi);
|
||||||
|
setGlyph(glyph, gi.gm.tileidx, false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -139,7 +142,10 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
setGlyph(monnum_to_glyph(races[id].malenum), false);
|
glyph_info gi;
|
||||||
|
int glyph = monnum_to_glyph(races[id].malenum, MALE);
|
||||||
|
map_glyphinfo(0, 0, glyph, 0, &gi);
|
||||||
|
setGlyph(glyph, gi.gm.tileidx, false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+23
-7
@@ -45,8 +45,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* from tile.c */
|
/* from tile.c */
|
||||||
extern short glyph2tile[];
|
extern int total_tiles_used, Tile_corr;
|
||||||
extern int total_tiles_used;
|
|
||||||
|
|
||||||
/* Define these if you really want a lot of junk on your screen. */
|
/* Define these if you really want a lot of junk on your screen. */
|
||||||
/* #define VERBOSE */ /* print various info & events as they happen */
|
/* #define VERBOSE */ /* print various info & events as they happen */
|
||||||
@@ -87,10 +86,16 @@ X11_print_glyph(winid window, xchar x, xchar y, const glyph_info *glyphinfo,
|
|||||||
|
|
||||||
/* update both the tile and text backing stores */
|
/* update both the tile and text backing stores */
|
||||||
{
|
{
|
||||||
unsigned short *t_ptr = &map_info->tile_map.glyphs[y][x].glyph;
|
unsigned short *g_ptr = &map_info->tile_map.glyphs[y][x].glyph,
|
||||||
|
*t_ptr = &map_info->tile_map.glyphs[y][x].tileidx;
|
||||||
|
|
||||||
if (*t_ptr != glyphinfo->glyph) {
|
if (*g_ptr != glyphinfo->glyph) {
|
||||||
*t_ptr = glyphinfo->glyph;
|
*g_ptr = glyphinfo->glyph;
|
||||||
|
if (map_info->is_tile)
|
||||||
|
update_bbox = TRUE;
|
||||||
|
}
|
||||||
|
if (*t_ptr != glyphinfo->gm.tileidx) {
|
||||||
|
*t_ptr = glyphinfo->gm.tileidx;
|
||||||
if (map_info->is_tile)
|
if (map_info->is_tile)
|
||||||
update_bbox = TRUE;
|
update_bbox = TRUE;
|
||||||
}
|
}
|
||||||
@@ -105,8 +110,8 @@ X11_print_glyph(winid window, xchar x, xchar y, const glyph_info *glyphinfo,
|
|||||||
register unsigned char *co_ptr;
|
register unsigned char *co_ptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
color = glyphinfo->color;
|
color = glyphinfo->gm.color;
|
||||||
special = glyphinfo->glyphflags;
|
special = glyphinfo->gm.glyphflags;
|
||||||
och = glyphinfo->ttychar;
|
och = glyphinfo->ttychar;
|
||||||
ch = (uchar) och;
|
ch = (uchar) och;
|
||||||
|
|
||||||
@@ -530,7 +535,11 @@ ntiles %ld\n",
|
|||||||
values.foreground =
|
values.foreground =
|
||||||
WhitePixelOfScreen(screen)
|
WhitePixelOfScreen(screen)
|
||||||
^ XGetPixel(tile_image, 0,
|
^ XGetPixel(tile_image, 0,
|
||||||
|
#if 0
|
||||||
tile_height * glyph2tile[cmap_to_glyph(S_corr)]);
|
tile_height * glyph2tile[cmap_to_glyph(S_corr)]);
|
||||||
|
#else
|
||||||
|
tile_height * T_corr);
|
||||||
|
#endif
|
||||||
values.function = GXxor;
|
values.function = GXxor;
|
||||||
tile_info->white_gc = XtGetGC(wp->w, mask, &values);
|
tile_info->white_gc = XtGetGC(wp->w, mask, &values);
|
||||||
|
|
||||||
@@ -1251,14 +1260,21 @@ map_update(struct xwindow *wp, int start_row, int stop_row, int start_col, int s
|
|||||||
|
|
||||||
for (row = start_row; row <= stop_row; row++) {
|
for (row = start_row; row <= stop_row; row++) {
|
||||||
for (cur_col = start_col; cur_col <= stop_col; cur_col++) {
|
for (cur_col = start_col; cur_col <= stop_col; cur_col++) {
|
||||||
|
#if 0
|
||||||
int glyph = tile_map->glyphs[row][cur_col].glyph;
|
int glyph = tile_map->glyphs[row][cur_col].glyph;
|
||||||
int tile = glyph2tile[glyph];
|
int tile = glyph2tile[glyph];
|
||||||
|
#else
|
||||||
|
int tile = tile_map->glyphs[row][cur_col].tileidx;
|
||||||
|
#endif
|
||||||
int src_x, src_y;
|
int src_x, src_y;
|
||||||
int dest_x = (cur_col - COL0_OFFSET) * tile_map->square_width;
|
int dest_x = (cur_col - COL0_OFFSET) * tile_map->square_width;
|
||||||
int dest_y = row * tile_map->square_height;
|
int dest_y = row * tile_map->square_height;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* not required with the new glyph representations */
|
||||||
if ((tile_map->glyphs[row][cur_col].glyphflags & MG_FEMALE))
|
if ((tile_map->glyphs[row][cur_col].glyphflags & MG_FEMALE))
|
||||||
tile++; /* advance to the female tile variation */
|
tile++; /* advance to the female tile variation */
|
||||||
|
#endif
|
||||||
src_x = (tile % TILES_PER_ROW) * tile_width;
|
src_x = (tile % TILES_PER_ROW) * tile_width;
|
||||||
src_y = (tile / TILES_PER_ROW) * tile_height;
|
src_y = (tile / TILES_PER_ROW) * tile_height;
|
||||||
XCopyArea(dpy, tile_pixmap, XtWindow(wp->w),
|
XCopyArea(dpy, tile_pixmap, XtWindow(wp->w),
|
||||||
|
|||||||
@@ -747,9 +747,9 @@ curses_print_glyph(winid wid, xchar x, xchar y,
|
|||||||
int attr = -1;
|
int attr = -1;
|
||||||
|
|
||||||
glyph = glyphinfo->glyph;
|
glyph = glyphinfo->glyph;
|
||||||
special = glyphinfo->glyphflags;
|
special = glyphinfo->gm.glyphflags;
|
||||||
ch = glyphinfo->ttychar;
|
ch = glyphinfo->ttychar;
|
||||||
color = glyphinfo->color;
|
color = glyphinfo->gm.color;
|
||||||
if ((special & MG_PET) && iflags.hilite_pet) {
|
if ((special & MG_PET) && iflags.hilite_pet) {
|
||||||
attr = iflags.wc2_petattr;
|
attr = iflags.wc2_petattr;
|
||||||
}
|
}
|
||||||
|
|||||||
+829
-829
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -120,10 +120,10 @@ boolean read_gif_tile(pixel[TILE_Y][TILE_X]);
|
|||||||
Array provided by shared code for NetHack use, by compiling and running
|
Array provided by shared code for NetHack use, by compiling and running
|
||||||
tilemap.c to form tile.c:
|
tilemap.c to form tile.c:
|
||||||
|
|
||||||
short glyph2tile[MAXGLYPH];
|
glyph_map glyphmap[MAXGLYPH];
|
||||||
maps glyph number to tile number for display purposes, assuming
|
maps glyph number to tile number, ( and later to ttychar, symidx,
|
||||||
(non-blank) tiles are numbered sequentially through
|
glyphflags) for display purposes, assuming (non-blank) tiles are
|
||||||
monsters/objects/other
|
numbered sequentially through monsters/objects/other
|
||||||
|
|
||||||
tilemap.c (shudder) accounts for things disappearing due to compilation
|
tilemap.c (shudder) accounts for things disappearing due to compilation
|
||||||
options -- there should be a tile for everything appearing under any
|
options -- there should be a tile for everything appearing under any
|
||||||
|
|||||||
+1124
-363
File diff suppressed because it is too large
Load Diff
@@ -50,9 +50,9 @@ static const int graymappings[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
set_grayscale(int g)
|
set_grayscale(int gs)
|
||||||
{
|
{
|
||||||
grayscale = g;
|
grayscale = gs;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
+6
-7
@@ -40,7 +40,6 @@ extern void msmsg(const char *, ...);
|
|||||||
#define VT_ANSI_COMMAND 'z'
|
#define VT_ANSI_COMMAND 'z'
|
||||||
#endif
|
#endif
|
||||||
#ifdef TTY_TILES_ESCCODES
|
#ifdef TTY_TILES_ESCCODES
|
||||||
extern short glyph2tile[];
|
|
||||||
#define AVTC_GLYPH_START 0
|
#define AVTC_GLYPH_START 0
|
||||||
#define AVTC_GLYPH_END 1
|
#define AVTC_GLYPH_END 1
|
||||||
#define AVTC_SELECT_WINDOW 2
|
#define AVTC_SELECT_WINDOW 2
|
||||||
@@ -3359,7 +3358,7 @@ tty_print_glyph(winid window, xchar x, xchar y,
|
|||||||
{
|
{
|
||||||
boolean inverse_on = FALSE;
|
boolean inverse_on = FALSE;
|
||||||
int ch, color;
|
int ch, color;
|
||||||
#if defined(TTY_TILES_ESCCODES) || defined(MSDOS)
|
#if defined(TTY_TILES_ESCCODES)
|
||||||
int glyph;
|
int glyph;
|
||||||
#endif
|
#endif
|
||||||
unsigned special;
|
unsigned special;
|
||||||
@@ -3372,19 +3371,19 @@ tty_print_glyph(winid window, xchar x, xchar y,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* get glyph ttychar, color, and special flags */
|
/* get glyph ttychar, color, and special flags */
|
||||||
#if defined(TTY_TILES_ESCCODES) || defined(MSDOS)
|
#if defined(TTY_TILES_ESCCODES)
|
||||||
glyph = glyphinfo->glyph;
|
glyph = glyphinfo->glyph;
|
||||||
#endif
|
#endif
|
||||||
ch = glyphinfo->ttychar;
|
ch = glyphinfo->ttychar;
|
||||||
color = glyphinfo->color;
|
color = glyphinfo->gm.color;
|
||||||
special = glyphinfo->glyphflags;
|
special = glyphinfo->gm.glyphflags;
|
||||||
|
|
||||||
print_vt_code2(AVTC_SELECT_WINDOW, window);
|
print_vt_code2(AVTC_SELECT_WINDOW, window);
|
||||||
|
|
||||||
/* Move the cursor. */
|
/* Move the cursor. */
|
||||||
tty_curs(window, x, y);
|
tty_curs(window, x, y);
|
||||||
|
|
||||||
print_vt_code3(AVTC_GLYPH_START, glyph2tile[glyph], special);
|
print_vt_code3(AVTC_GLYPH_START, glyphinfo->tileidx, special);
|
||||||
|
|
||||||
#ifndef NO_TERMS
|
#ifndef NO_TERMS
|
||||||
if (ul_hack && ch == '_') { /* non-destructive underscore */
|
if (ul_hack && ch == '_') { /* non-destructive underscore */
|
||||||
@@ -3424,7 +3423,7 @@ tty_print_glyph(winid window, xchar x, xchar y,
|
|||||||
|
|
||||||
#if defined(USE_TILES) && defined(MSDOS)
|
#if defined(USE_TILES) && defined(MSDOS)
|
||||||
if (iflags.grmode && iflags.tile_view)
|
if (iflags.grmode && iflags.tile_view)
|
||||||
xputg(glyph, ch, special);
|
xputg(glyphinfo);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
g_putch(ch); /* print the character */
|
g_putch(ch); /* print the character */
|
||||||
|
|||||||
+10
-13
@@ -24,8 +24,6 @@
|
|||||||
#define CURSOR_BLINK_INTERVAL 1000 // milliseconds
|
#define CURSOR_BLINK_INTERVAL 1000 // milliseconds
|
||||||
#define CURSOR_HEIGHT 2 // pixels
|
#define CURSOR_HEIGHT 2 // pixels
|
||||||
|
|
||||||
extern short glyph2tile[];
|
|
||||||
|
|
||||||
#define TILEBMP_X(ntile) \
|
#define TILEBMP_X(ntile) \
|
||||||
((ntile % GetNHApp()->mapTilesPerLine) * GetNHApp()->mapTile_X)
|
((ntile % GetNHApp()->mapTilesPerLine) * GetNHApp()->mapTile_X)
|
||||||
#define TILEBMP_Y(ntile) \
|
#define TILEBMP_Y(ntile) \
|
||||||
@@ -825,7 +823,7 @@ paintTile(PNHMapWindow data, int i, int j, RECT * rect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bkglyph != NO_GLYPH) {
|
if (bkglyph != NO_GLYPH) {
|
||||||
ntile = glyph2tile[bkglyph];
|
ntile = data->bkmap[i][j].gm.tileidx;
|
||||||
t_x = TILEBMP_X(ntile);
|
t_x = TILEBMP_X(ntile);
|
||||||
t_y = TILEBMP_Y(ntile);
|
t_y = TILEBMP_Y(ntile);
|
||||||
|
|
||||||
@@ -838,9 +836,7 @@ paintTile(PNHMapWindow data, int i, int j, RECT * rect)
|
|||||||
|
|
||||||
if ((glyph != NO_GLYPH) && (glyph != bkglyph)) {
|
if ((glyph != NO_GLYPH) && (glyph != bkglyph)) {
|
||||||
/* rely on NetHack core helper routine */
|
/* rely on NetHack core helper routine */
|
||||||
ntile = glyph2tile[glyph];
|
ntile = data->map[i][j].gm.tileidx;
|
||||||
if (data->map[i][j].glyphflags & MG_FEMALE)
|
|
||||||
ntile++;
|
|
||||||
t_x = TILEBMP_X(ntile);
|
t_x = TILEBMP_X(ntile);
|
||||||
t_y = TILEBMP_Y(ntile);
|
t_y = TILEBMP_Y(ntile);
|
||||||
|
|
||||||
@@ -861,7 +857,7 @@ paintTile(PNHMapWindow data, int i, int j, RECT * rect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_PILEMARK
|
#ifdef USE_PILEMARK
|
||||||
if ((glyph != NO_GLYPH) && (data->map[i][j].glyphflags & MG_PET)
|
if ((glyph != NO_GLYPH) && (data->map[i][j].gm.glyphflags & MG_PET)
|
||||||
#else
|
#else
|
||||||
if ((glyph != NO_GLYPH) && glyph_is_pet(glyph)
|
if ((glyph != NO_GLYPH) && glyph_is_pet(glyph)
|
||||||
#endif
|
#endif
|
||||||
@@ -884,7 +880,7 @@ paintTile(PNHMapWindow data, int i, int j, RECT * rect)
|
|||||||
DeleteDC(hdcPetMark);
|
DeleteDC(hdcPetMark);
|
||||||
}
|
}
|
||||||
#ifdef USE_PILEMARK
|
#ifdef USE_PILEMARK
|
||||||
if ((glyph != NO_GLYPH) && (data->map[i][j].glyphflags & MG_OBJPILE)
|
if ((glyph != NO_GLYPH) && (data->map[i][j].gm.glyphflags & MG_OBJPILE)
|
||||||
&& iflags.hilite_pile) {
|
&& iflags.hilite_pile) {
|
||||||
/* apply pilemark transparently over other image */
|
/* apply pilemark transparently over other image */
|
||||||
HDC hdcPileMark;
|
HDC hdcPileMark;
|
||||||
@@ -934,9 +930,9 @@ paintGlyph(PNHMapWindow data, int i, int j, RECT * rect)
|
|||||||
OldFg = SetTextColor(hDC, nhcolor_to_RGB(color));
|
OldFg = SetTextColor(hDC, nhcolor_to_RGB(color));
|
||||||
#else
|
#else
|
||||||
ch = (char) data->map[i][j].ttychar;
|
ch = (char) data->map[i][j].ttychar;
|
||||||
color = (int) data->map[i][j].color;
|
color = (int) data->map[i][j].gm.color;
|
||||||
if (((data->map[i][j].glyphflags & MG_PET) && iflags.hilite_pet)
|
if (((data->map[i][j].gm.glyphflags & MG_PET) && iflags.hilite_pet)
|
||||||
|| ((data->map[i][j].glyphflags & (MG_DETECT | MG_BW_LAVA))
|
|| ((data->map[i][j].gm.glyphflags & (MG_DETECT | MG_BW_LAVA))
|
||||||
&& iflags.use_inverse)) {
|
&& iflags.use_inverse)) {
|
||||||
back_brush =
|
back_brush =
|
||||||
CreateSolidBrush(nhcolor_to_RGB(CLR_GRAY));
|
CreateSolidBrush(nhcolor_to_RGB(CLR_GRAY));
|
||||||
@@ -1004,8 +1000,9 @@ static void setGlyph(PNHMapWindow data, int i, int j,
|
|||||||
if ((data->map[i][j].glyph != fg->glyph)
|
if ((data->map[i][j].glyph != fg->glyph)
|
||||||
|| (data->bkmap[i][j].glyph != bg->glyph)
|
|| (data->bkmap[i][j].glyph != bg->glyph)
|
||||||
|| data->map[i][j].ttychar != fg->ttychar
|
|| data->map[i][j].ttychar != fg->ttychar
|
||||||
|| data->map[i][j].color != fg->color
|
|| data->map[i][j].gm.color != fg->gm.color
|
||||||
|| data->map[i][j].glyphflags != fg->glyphflags) {
|
|| data->map[i][j].gm.glyphflags != fg->gm.glyphflags
|
||||||
|
|| data->map[i][j].gm.tileidx != fg->gm.tileidx) {
|
||||||
data->map[i][j] = *fg;
|
data->map[i][j] = *fg;
|
||||||
data->bkmap[i][j] = *bg;
|
data->bkmap[i][j] = *bg;
|
||||||
data->locDirty[i][j] = TRUE;
|
data->locDirty[i][j] = TRUE;
|
||||||
|
|||||||
+1
-3
@@ -73,8 +73,6 @@ typedef struct mswin_nethack_menu_window {
|
|||||||
BOOL is_active;
|
BOOL is_active;
|
||||||
} NHMenuWindow, *PNHMenuWindow;
|
} NHMenuWindow, *PNHMenuWindow;
|
||||||
|
|
||||||
extern short glyph2tile[];
|
|
||||||
|
|
||||||
static WNDPROC wndProcListViewOrig = NULL;
|
static WNDPROC wndProcListViewOrig = NULL;
|
||||||
static WNDPROC editControlWndProc = NULL;
|
static WNDPROC editControlWndProc = NULL;
|
||||||
|
|
||||||
@@ -1087,7 +1085,7 @@ onDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
monitorScale2 = win10_monitor_scale(hWnd);
|
monitorScale2 = win10_monitor_scale(hWnd);
|
||||||
|
|
||||||
saveBmp = SelectObject(tileDC, GetNHApp()->bmpMapTiles);
|
saveBmp = SelectObject(tileDC, GetNHApp()->bmpMapTiles);
|
||||||
ntile = glyph2tile[item->glyphinfo.glyph];
|
ntile = item->glyphinfo.gm.tileidx;
|
||||||
t_x =
|
t_x =
|
||||||
(ntile % GetNHApp()->mapTilesPerLine) * GetNHApp()->mapTile_X;
|
(ntile % GetNHApp()->mapTilesPerLine) * GetNHApp()->mapTile_X;
|
||||||
t_y =
|
t_y =
|
||||||
|
|||||||
+1
-1
@@ -1136,7 +1136,7 @@ mswin_add_menu(winid wid, const glyph_info *glyphinfo,
|
|||||||
{
|
{
|
||||||
boolean presel = ((itemflags & MENU_ITEMFLAGS_SELECTED) != 0);
|
boolean presel = ((itemflags & MENU_ITEMFLAGS_SELECTED) != 0);
|
||||||
logDebug("mswin_add_menu(%d, %d, %u, %p, %c, %c, %d, %s, %u)\n", wid,
|
logDebug("mswin_add_menu(%d, %d, %u, %p, %c, %c, %d, %s, %u)\n", wid,
|
||||||
glyphinfo->glyph, glyphinfo->glyphflags,
|
glyphinfo->glyph, glyphinfo->gm.glyphflags,
|
||||||
identifier, (char) accelerator, (char) group_accel, attr, str,
|
identifier, (char) accelerator, (char) group_accel, attr, str,
|
||||||
itemflags);
|
itemflags);
|
||||||
if ((wid >= 0) && (wid < MAXWINDOWS)
|
if ((wid >= 0) && (wid < MAXWINDOWS)
|
||||||
|
|||||||
Reference in New Issue
Block a user