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:
@@ -143,25 +143,10 @@ extern NEARDATA struct objdescr obj_descr[];
|
||||
*/
|
||||
enum obj_class_types {
|
||||
RANDOM_CLASS = 0, /* used for generating random objects */
|
||||
ILLOBJ_CLASS = 1,
|
||||
WEAPON_CLASS = 2,
|
||||
ARMOR_CLASS = 3,
|
||||
RING_CLASS = 4,
|
||||
AMULET_CLASS = 5,
|
||||
TOOL_CLASS = 6,
|
||||
FOOD_CLASS = 7,
|
||||
POTION_CLASS = 8,
|
||||
SCROLL_CLASS = 9,
|
||||
SPBOOK_CLASS = 10, /* actually SPELL-book */
|
||||
WAND_CLASS = 11,
|
||||
COIN_CLASS = 12,
|
||||
GEM_CLASS = 13,
|
||||
ROCK_CLASS = 14,
|
||||
BALL_CLASS = 15,
|
||||
CHAIN_CLASS = 16,
|
||||
VENOM_CLASS = 17,
|
||||
|
||||
MAXOCLASSES = 18
|
||||
#define OBJCLASS_ENUM
|
||||
#include "defsym.h"
|
||||
#undef OBJCLASS_ENUM
|
||||
MAXOCLASSES
|
||||
};
|
||||
/* for mkobj() use ONLY! odd '-SPBOOK_CLASS' is in case of unsigned enums */
|
||||
#define SPBOOK_no_NOVEL (0 - (int) SPBOOK_CLASS)
|
||||
@@ -175,26 +160,6 @@ extern const struct class_sym
|
||||
extern uchar oc_syms[MAXOCLASSES]; /* current class symbols */
|
||||
#endif
|
||||
|
||||
/* Default definitions of all object-symbols (must match classes above). */
|
||||
|
||||
#define ILLOBJ_SYM ']' /* also used for mimics */
|
||||
#define WEAPON_SYM ')'
|
||||
#define ARMOR_SYM '['
|
||||
#define RING_SYM '='
|
||||
#define AMULET_SYM '"'
|
||||
#define TOOL_SYM '('
|
||||
#define FOOD_SYM '%'
|
||||
#define POTION_SYM '!'
|
||||
#define SCROLL_SYM '?'
|
||||
#define SPBOOK_SYM '+'
|
||||
#define WAND_SYM '/'
|
||||
#define GOLD_SYM '$'
|
||||
#define GEM_SYM '*'
|
||||
#define ROCK_SYM '`'
|
||||
#define BALL_SYM '0'
|
||||
#define CHAIN_SYM '_'
|
||||
#define VENOM_SYM '.'
|
||||
|
||||
struct fruit {
|
||||
char fname[PL_FSIZ];
|
||||
int fid;
|
||||
|
||||
Reference in New Issue
Block a user