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.
140 lines
4.1 KiB
C
140 lines
4.1 KiB
C
/* NetHack 3.7 sym.h */
|
|
/* Copyright (c) 2016 by Pasi Kallinen */
|
|
/* NetHack may be freely redistributed. See license for details. */
|
|
|
|
#ifndef SYM_H
|
|
#define SYM_H
|
|
|
|
/*
|
|
* Default characters for monsters.
|
|
*/
|
|
/* clang-format off */
|
|
enum mon_defchars {
|
|
#define MONSYMS_DEFCHAR_ENUM
|
|
#include "defsym.h"
|
|
#undef MONSYMS_DEFCHAR_ENUM
|
|
};
|
|
/* clang-format on */
|
|
|
|
enum mon_syms {
|
|
#define MONSYMS_S_ENUM
|
|
#include "defsym.h"
|
|
#undef MONSYMS_S_ENUM
|
|
|
|
MAXMCLASSES /* number of monster classes */
|
|
};
|
|
|
|
#ifndef MAKEDEFS_C
|
|
|
|
/* Default characters for dungeon surroundings and furniture */
|
|
enum cmap_symbols {
|
|
#define PCHAR_S_ENUM
|
|
#include "defsym.h"
|
|
#undef PCHAR_S_ENUM
|
|
MAXPCHARS
|
|
};
|
|
|
|
struct symdef {
|
|
uchar sym;
|
|
const char *explanation;
|
|
#ifdef TEXTCOLOR
|
|
uchar color;
|
|
#endif
|
|
};
|
|
|
|
enum symparse_range {
|
|
SYM_CONTROL = 1, /* start/finish markers */
|
|
SYM_PCHAR = 2, /* index into showsyms */
|
|
SYM_OC = 3, /* index into oc_syms */
|
|
SYM_MON = 4, /* index into monsyms */
|
|
SYM_OTH = 5 /* misc */
|
|
};
|
|
|
|
struct symparse {
|
|
unsigned range;
|
|
int idx;
|
|
const char *name;
|
|
};
|
|
|
|
/* linked list of symsets and their characteristics */
|
|
struct symsetentry {
|
|
struct symsetentry *next; /* next in list */
|
|
char *name; /* ptr to symset name */
|
|
char *desc; /* ptr to description */
|
|
int idx; /* an index value */
|
|
int handling; /* known handlers value */
|
|
Bitfield(nocolor, 1); /* don't use color if set */
|
|
Bitfield(primary, 1); /* restricted for use as primary set */
|
|
Bitfield(rogue, 1); /* restricted for use as rogue lev set */
|
|
Bitfield(explicitly, 1); /* explicit symset set */
|
|
/* 4 free bits */
|
|
};
|
|
|
|
/*
|
|
*
|
|
*/
|
|
|
|
#define MAXDCHARS (S_water - S_stone + 1) /* mapped dungeon characters */
|
|
#define MAXTCHARS (S_vibrating_square - S_arrow_trap + 1) /* trap chars */
|
|
#define MAXECHARS (S_expl_br - S_vbeam + 1) /* mapped effects characters */
|
|
#define MAXEXPCHARS 9 /* number of explosion characters */
|
|
|
|
#define DARKROOMSYM (Is_rogue_level(&u.uz) ? S_stone : S_darkroom)
|
|
|
|
#define is_cmap_trap(i) ((i) >= S_arrow_trap && (i) <= S_polymorph_trap)
|
|
#define is_cmap_drawbridge(i) ((i) >= S_vodbridge && (i) <= S_hcdbridge)
|
|
#define is_cmap_door(i) ((i) >= S_vodoor && (i) <= S_hcdoor)
|
|
#define is_cmap_wall(i) ((i) >= S_stone && (i) <= S_trwall)
|
|
#define is_cmap_room(i) ((i) >= S_room && (i) <= S_darkroom)
|
|
#define is_cmap_corr(i) ((i) >= S_corr && (i) <= S_litcorr)
|
|
#define is_cmap_furniture(i) ((i) >= S_upstair && (i) <= S_fountain)
|
|
#define is_cmap_water(i) ((i) == S_pool || (i) == S_water)
|
|
#define is_cmap_lava(i) ((i) == S_lava)
|
|
#define is_cmap_stairs(i) ((i) == S_upstair || (i) == S_dnstair || \
|
|
(i) == S_upladder || (i) == S_dnladder)
|
|
|
|
/* misc symbol definitions */
|
|
enum misc_symbols {
|
|
SYM_NOTHING = 0,
|
|
SYM_UNEXPLORED = 1,
|
|
SYM_BOULDER = 2,
|
|
SYM_INVISIBLE = 3,
|
|
SYM_PET_OVERRIDE = 4,
|
|
SYM_HERO_OVERRIDE = 5,
|
|
MAXOTHER
|
|
};
|
|
|
|
/*
|
|
* Graphics sets for display symbols
|
|
*/
|
|
#define DEFAULT_GRAPHICS 0 /* regular characters: '-', '+', &c */
|
|
enum graphics_sets {
|
|
PRIMARY = 0, /* primary graphics set */
|
|
ROGUESET = 1, /* rogue graphics set */
|
|
NUM_GRAPHICS
|
|
};
|
|
|
|
/*
|
|
* special symbol set handling types ( for invoking callbacks, etc.)
|
|
* Must match the order of the known_handlers strings
|
|
* in drawing.c
|
|
*/
|
|
|
|
enum symset_handling_types {
|
|
H_UNK = 0,
|
|
H_IBM = 1,
|
|
H_DEC = 2,
|
|
H_CURS = 3,
|
|
H_MAC = 4 /* obsolete; needed so that the listing of available
|
|
* symsets by 'O' can skip it for !MAC_GRAPHICS_ENV */
|
|
};
|
|
|
|
extern const struct symdef defsyms[MAXPCHARS]; /* defaults */
|
|
#define WARNCOUNT 6 /* number of different warning levels */
|
|
extern const struct symdef def_warnsyms[WARNCOUNT];
|
|
#define SYMHANDLING(ht) (g.symset[g.currentgraphics].handling == (ht))
|
|
|
|
#endif /* !MAKEDEFS_C */
|
|
#endif /* SYM_H */
|
|
|