header files sym.h and defsym.h
There were multiple symbol-related lists that had to be kept
in sync in various places.
Consolidate some of that into a single new file
defsym.h
with a set of morphing macros that can be custom-called from
the various places that use the sym info without maintaining
multiple occurrences. Most maintenance can be done there.
Rename monsym.h to sym.h since it looks after some
symbols not related to monsters now too.
The defsym.h header file is included in multiple places to
produce different code depending on its use and the controlling
macro definitions in place prior to including it.
Its purpose is to have a definitive source for
pchar, objclass and mon symbol maintenance.
The controlling macros used to morph the resulting code are
used in these places:
- in include/sym.h for enums of some S_ symbol values
(define PCHAR_ENUM, MONSYMS_ENUM prior to #include defsym.h)
- in include/objclass.h for enums of some S_ symbol values
(define OBJCLASS_ENUM prior to #include defsym.h)
- in src/symbols.c for parsing S_ entries in config files
(define PCHAR_PARSE, MONSYMS_PARSE, OBJCLASS_PARSE prior
to #include defsym.h)
- in src/drawing.c for initializing some data structures/arrays
(define PCHAR_DRAWING, MONSYMS_DRAWING, OBJCLASS_DRAWING prior
to #include defsym.h)
- in win/share/tilemap.c for processing a tile file
(define PCHAR_TILES prior to #include defsym.h).
This commit is contained in:
205
src/drawing.c
205
src/drawing.c
@@ -6,9 +6,9 @@
|
||||
#include "color.h"
|
||||
#include "rm.h"
|
||||
#include "objclass.h"
|
||||
#include "monsym.h"
|
||||
#include "sym.h"
|
||||
|
||||
/* Relevant header information in rm.h, objclass.h, and monsym.h. */
|
||||
/* Relevant header information in rm.h, objclass.h, sym.h, defsym.h. */
|
||||
|
||||
#ifdef C
|
||||
#undef C
|
||||
@@ -27,88 +27,17 @@
|
||||
*/
|
||||
const struct class_sym def_oc_syms[MAXOCLASSES] = {
|
||||
{ '\0', "", "" }, /* placeholder for the "random class" */
|
||||
{ ILLOBJ_SYM, "illegal objects", "strange object" },
|
||||
{ WEAPON_SYM, "weapons", "weapon" },
|
||||
{ ARMOR_SYM, "armor", "suit or piece of armor" },
|
||||
{ RING_SYM, "rings", "ring" },
|
||||
{ AMULET_SYM, "amulets", "amulet" },
|
||||
{ TOOL_SYM, "tools", "useful item (pick-axe, key, lamp...)" },
|
||||
{ FOOD_SYM, "food", "piece of food" },
|
||||
{ POTION_SYM, "potions", "potion" },
|
||||
{ SCROLL_SYM, "scrolls", "scroll" },
|
||||
{ SPBOOK_SYM, "spellbooks", "spellbook" },
|
||||
{ WAND_SYM, "wands", "wand" },
|
||||
{ GOLD_SYM, "coins", "pile of coins" },
|
||||
{ GEM_SYM, "rocks", "gem or rock" },
|
||||
{ ROCK_SYM, "large stones", "boulder or statue" },
|
||||
{ BALL_SYM, "iron balls", "iron ball" },
|
||||
{ CHAIN_SYM, "chains", "iron chain" },
|
||||
{ VENOM_SYM, "venoms", "splash of venom" }
|
||||
#define OBJCLASS_DRAWING
|
||||
#include "defsym.h"
|
||||
#undef OBJCLASS_DRAWING
|
||||
};
|
||||
|
||||
/* Default monster class symbols. See monsym.h. */
|
||||
/* Default monster class symbols. See sym.h and defsym.h. */
|
||||
const struct class_sym def_monsyms[MAXMCLASSES] = {
|
||||
{ '\0', "", "" },
|
||||
{ DEF_ANT, "", "ant or other insect" },
|
||||
{ DEF_BLOB, "", "blob" },
|
||||
{ DEF_COCKATRICE, "", "cockatrice" },
|
||||
{ DEF_DOG, "", "dog or other canine" },
|
||||
{ DEF_EYE, "", "eye or sphere" },
|
||||
{ DEF_FELINE, "", "cat or other feline" },
|
||||
{ DEF_GREMLIN, "", "gremlin" },
|
||||
{ DEF_HUMANOID, "", "humanoid" },
|
||||
{ DEF_IMP, "", "imp or minor demon" },
|
||||
{ DEF_JELLY, "", "jelly" },
|
||||
{ DEF_KOBOLD, "", "kobold" },
|
||||
{ DEF_LEPRECHAUN, "", "leprechaun" },
|
||||
{ DEF_MIMIC, "", "mimic" },
|
||||
{ DEF_NYMPH, "", "nymph" },
|
||||
{ DEF_ORC, "", "orc" },
|
||||
{ DEF_PIERCER, "", "piercer" },
|
||||
{ DEF_QUADRUPED, "", "quadruped" },
|
||||
{ DEF_RODENT, "", "rodent" },
|
||||
{ DEF_SPIDER, "", "arachnid or centipede" },
|
||||
{ DEF_TRAPPER, "", "trapper or lurker above" },
|
||||
{ DEF_UNICORN, "", "unicorn or horse" },
|
||||
{ DEF_VORTEX, "", "vortex" },
|
||||
{ DEF_WORM, "", "worm" },
|
||||
{ DEF_XAN, "", "xan or other mythical/fantastic insect" },
|
||||
{ DEF_LIGHT, "", "light" },
|
||||
{ DEF_ZRUTY, "", "zruty" },
|
||||
{ DEF_ANGEL, "", "angelic being" },
|
||||
{ DEF_BAT, "", "bat or bird" },
|
||||
{ DEF_CENTAUR, "", "centaur" },
|
||||
{ DEF_DRAGON, "", "dragon" },
|
||||
{ DEF_ELEMENTAL, "", "elemental" },
|
||||
{ DEF_FUNGUS, "", "fungus or mold" },
|
||||
{ DEF_GNOME, "", "gnome" },
|
||||
{ DEF_GIANT, "", "giant humanoid" },
|
||||
{ '\0', "", "invisible monster" },
|
||||
{ DEF_JABBERWOCK, "", "jabberwock" },
|
||||
{ DEF_KOP, "", "Keystone Kop" },
|
||||
{ DEF_LICH, "", "lich" },
|
||||
{ DEF_MUMMY, "", "mummy" },
|
||||
{ DEF_NAGA, "", "naga" },
|
||||
{ DEF_OGRE, "", "ogre" },
|
||||
{ DEF_PUDDING, "", "pudding or ooze" },
|
||||
{ DEF_QUANTMECH, "", "quantum mechanic" },
|
||||
{ DEF_RUSTMONST, "", "rust monster or disenchanter" },
|
||||
{ DEF_SNAKE, "", "snake" },
|
||||
{ DEF_TROLL, "", "troll" },
|
||||
{ DEF_UMBER, "", "umber hulk" },
|
||||
{ DEF_VAMPIRE, "", "vampire" },
|
||||
{ DEF_WRAITH, "", "wraith" },
|
||||
{ DEF_XORN, "", "xorn" },
|
||||
{ DEF_YETI, "", "apelike creature" },
|
||||
{ DEF_ZOMBIE, "", "zombie" },
|
||||
{ DEF_HUMAN, "", "human or elf" },
|
||||
{ DEF_GHOST, "", "ghost" },
|
||||
{ DEF_GOLEM, "", "golem" },
|
||||
{ DEF_DEMON, "", "major demon" },
|
||||
{ DEF_EEL, "", "sea monster" },
|
||||
{ DEF_LIZARD, "", "lizard" },
|
||||
{ DEF_WORM_TAIL, "", "long worm tail" },
|
||||
{ DEF_MIMIC_DEF, "", "mimic" },
|
||||
#define MONSYMS_DRAWING
|
||||
#include "defsym.h"
|
||||
#undef MONSYMS_DRAWING
|
||||
};
|
||||
|
||||
const struct symdef def_warnsyms[WARNCOUNT] = {
|
||||
@@ -137,119 +66,9 @@ const struct symdef def_warnsyms[WARNCOUNT] = {
|
||||
* within NetHack itself.
|
||||
*/
|
||||
const struct symdef defsyms[MAXPCHARS] = {
|
||||
/* 0*/
|
||||
{ ' ', "stone", C(NO_COLOR) }, /* stone */
|
||||
{ '|', "wall", C(CLR_GRAY) }, /* vwall */
|
||||
{ '-', "wall", C(CLR_GRAY) }, /* hwall */
|
||||
{ '-', "wall", C(CLR_GRAY) }, /* tlcorn */
|
||||
{ '-', "wall", C(CLR_GRAY) }, /* trcorn */
|
||||
{ '-', "wall", C(CLR_GRAY) }, /* blcorn */
|
||||
{ '-', "wall", C(CLR_GRAY) }, /* brcorn */
|
||||
{ '-', "wall", C(CLR_GRAY) }, /* crwall */
|
||||
{ '-', "wall", C(CLR_GRAY) }, /* tuwall */
|
||||
{ '-', "wall", C(CLR_GRAY) }, /* tdwall */
|
||||
/*10*/
|
||||
{ '|', "wall", C(CLR_GRAY) }, /* tlwall */
|
||||
{ '|', "wall", C(CLR_GRAY) }, /* trwall */
|
||||
{ '.', "doorway", C(CLR_GRAY) }, /* ndoor */
|
||||
{ '-', "open door", C(CLR_BROWN) }, /* vodoor */
|
||||
{ '|', "open door", C(CLR_BROWN) }, /* hodoor */
|
||||
{ '+', "closed door", C(CLR_BROWN) }, /* vcdoor */
|
||||
{ '+', "closed door", C(CLR_BROWN) }, /* hcdoor */
|
||||
{ '#', "iron bars", C(HI_METAL) }, /* bars */
|
||||
{ '#', "tree", C(CLR_GREEN) }, /* tree */
|
||||
{ '.', "floor of a room", C(CLR_GRAY) }, /* room */
|
||||
/*20*/
|
||||
{ '.', "dark part of a room", C(CLR_BLACK) }, /* dark room */
|
||||
{ '#', "corridor", C(CLR_GRAY) }, /* dark corr */
|
||||
{ '#', "lit corridor", C(CLR_GRAY) }, /* lit corr, see map_glyphinfo() */
|
||||
{ '<', "staircase up", C(CLR_GRAY) }, /* upstair */
|
||||
{ '>', "staircase down", C(CLR_GRAY) }, /* dnstair */
|
||||
{ '<', "ladder up", C(CLR_BROWN) }, /* upladder */
|
||||
{ '>', "ladder down", C(CLR_BROWN) }, /* dnladder */
|
||||
{ '<', "branch staircase up", C(CLR_YELLOW) }, /* brupstair */
|
||||
{ '>', "branch staircase down", C(CLR_YELLOW) }, /* brdnstair */
|
||||
{ '<', "branch ladder up", C(CLR_YELLOW) }, /* brupladder */
|
||||
/*30*/
|
||||
{ '>', "branch ladder down", C(CLR_YELLOW) }, /* brdnladder */
|
||||
{ '_', "altar", C(CLR_GRAY) }, /* altar */
|
||||
{ '|', "grave", C(CLR_WHITE) }, /* grave */
|
||||
{ '\\', "opulent throne", C(HI_GOLD) }, /* throne */
|
||||
{ '#', "sink", C(CLR_GRAY) }, /* sink */
|
||||
{ '{', "fountain", C(CLR_BRIGHT_BLUE) }, /* fountain */
|
||||
{ '}', "water", C(CLR_BLUE) }, /* pool */
|
||||
{ '.', "ice", C(CLR_CYAN) }, /* ice */
|
||||
{ '}', "molten lava", C(CLR_RED) }, /* lava */
|
||||
{ '.', "lowered drawbridge", C(CLR_BROWN) }, /* vodbridge */
|
||||
/*40*/
|
||||
{ '.', "lowered drawbridge", C(CLR_BROWN) }, /* hodbridge */
|
||||
{ '#', "raised drawbridge", C(CLR_BROWN) }, /* vcdbridge */
|
||||
{ '#', "raised drawbridge", C(CLR_BROWN) }, /* hcdbridge */
|
||||
{ ' ', "air", C(CLR_CYAN) }, /* open air */
|
||||
{ '#', "cloud", C(CLR_GRAY) }, /* [part of] a cloud */
|
||||
{ '}', "water", C(CLR_BLUE) }, /* under water */
|
||||
{ '^', "arrow trap", C(HI_METAL) }, /* trap */
|
||||
{ '^', "dart trap", C(HI_METAL) }, /* trap */
|
||||
{ '^', "falling rock trap", C(CLR_GRAY) }, /* trap */
|
||||
{ '^', "squeaky board", C(CLR_BROWN) }, /* trap */
|
||||
/*50*/
|
||||
{ '^', "bear trap", C(HI_METAL) }, /* trap */
|
||||
{ '^', "land mine", C(CLR_RED) }, /* trap */
|
||||
{ '^', "rolling boulder trap", C(CLR_GRAY) }, /* trap */
|
||||
{ '^', "sleeping gas trap", C(HI_ZAP) }, /* trap */
|
||||
{ '^', "rust trap", C(CLR_BLUE) }, /* trap */
|
||||
{ '^', "fire trap", C(CLR_ORANGE) }, /* trap */
|
||||
{ '^', "pit", C(CLR_BLACK) }, /* trap */
|
||||
{ '^', "spiked pit", C(CLR_BLACK) }, /* trap */
|
||||
{ '^', "hole", C(CLR_BROWN) }, /* trap */
|
||||
{ '^', "trap door", C(CLR_BROWN) }, /* trap */
|
||||
/*60*/
|
||||
{ '^', "teleportation trap", C(CLR_MAGENTA) }, /* trap */
|
||||
{ '^', "level teleporter", C(CLR_MAGENTA) }, /* trap */
|
||||
{ '^', "magic portal", C(CLR_BRIGHT_MAGENTA) }, /* trap */
|
||||
{ '"', "web", C(CLR_GRAY) }, /* web */
|
||||
{ '^', "statue trap", C(CLR_GRAY) }, /* trap */
|
||||
{ '^', "magic trap", C(HI_ZAP) }, /* trap */
|
||||
{ '^', "anti-magic field", C(HI_ZAP) }, /* trap */
|
||||
{ '^', "polymorph trap", C(CLR_BRIGHT_GREEN) }, /* trap */
|
||||
{ '~', "vibrating square", C(CLR_MAGENTA) }, /* "trap" */
|
||||
/* zap colors are changed by map_glyphinfo() to match type of beam */
|
||||
{ '|', "", C(CLR_GRAY) }, /* vbeam */
|
||||
/*70*/
|
||||
{ '-', "", C(CLR_GRAY) }, /* hbeam */
|
||||
{ '\\', "", C(CLR_GRAY) }, /* lslant */
|
||||
{ '/', "", C(CLR_GRAY) }, /* rslant */
|
||||
{ '*', "", C(CLR_WHITE) }, /* dig beam */
|
||||
{ '!', "", C(CLR_WHITE) }, /* camera flash beam */
|
||||
{ ')', "", C(HI_WOOD) }, /* boomerang open left */
|
||||
{ '(', "", C(HI_WOOD) }, /* boomerang open right */
|
||||
{ '0', "", C(HI_ZAP) }, /* 4 magic shield symbols */
|
||||
{ '#', "", C(HI_ZAP) },
|
||||
{ '@', "", C(HI_ZAP) },
|
||||
/*80*/
|
||||
{ '*', "", C(HI_ZAP) },
|
||||
{ '#', "poison cloud", C(CLR_BRIGHT_GREEN) }, /* part of a cloud */
|
||||
{ '?', "valid position", C(CLR_BRIGHT_GREEN) }, /* target position */
|
||||
/* swallow colors are changed by map_glyphinfo() to match engulfing monst */
|
||||
{ '/', "", C(CLR_GREEN) }, /* swallow top left */
|
||||
{ '-', "", C(CLR_GREEN) }, /* swallow top center */
|
||||
{ '\\', "", C(CLR_GREEN) }, /* swallow top right */
|
||||
{ '|', "", C(CLR_GREEN) }, /* swallow middle left */
|
||||
{ '|', "", C(CLR_GREEN) }, /* swallow middle right */
|
||||
{ '\\', "", C(CLR_GREEN) }, /* swallow bottom left */
|
||||
{ '-', "", C(CLR_GREEN) }, /* swallow bottom center */
|
||||
/*90*/
|
||||
{ '/', "", C(CLR_GREEN) }, /* swallow bottom right */
|
||||
/* explosion colors are changed by map_glyphinfo() to match type of expl. */
|
||||
{ '/', "", C(CLR_ORANGE) }, /* explosion top left */
|
||||
{ '-', "", C(CLR_ORANGE) }, /* explosion top center */
|
||||
{ '\\', "", C(CLR_ORANGE) }, /* explosion top right */
|
||||
{ '|', "", C(CLR_ORANGE) }, /* explosion middle left */
|
||||
{ ' ', "", C(CLR_ORANGE) }, /* explosion middle center*/
|
||||
{ '|', "", C(CLR_ORANGE) }, /* explosion middle right */
|
||||
{ '\\', "", C(CLR_ORANGE) }, /* explosion bottom left */
|
||||
{ '-', "", C(CLR_ORANGE) }, /* explosion bottom center*/
|
||||
{ '/', "", C(CLR_ORANGE) }, /* explosion bottom right */
|
||||
#define PCHAR_DRAWING
|
||||
#include "defsym.h"
|
||||
#undef PCHAR_DRAWING
|
||||
};
|
||||
|
||||
/* default rogue level symbols */
|
||||
|
||||
Reference in New Issue
Block a user