more symbol stuff (trunk only)
- reduce the number of symbol tables for each graphics
set {PRIMARY, ROGUESET} from three {map, oc, mon}
tables for each of the display symbols, the loadable symbols,
and the rogue symbols, to one continguous table for
each:
showsyms: the current display symbols
l_syms: the loaded, alterable symbols
r_syms: the rogue symbols
- Modify mapglyph so that the index into the symbolt table is
available as a return value (it was a void function), rather than
just the char converted from the glyph.
- That makes it possible for a window port to use the same
index value to extract from another table (perhaps a unicode
table) for a different set of display symbols. The index
is much more useful than trying to convert the character
into another type of symbol, as some contributed patches
have done.
- It is much easier to load a single alternative flat table to
make substitutions, since the corresponding value just
has to get placed into the same index offset in the
alternative table.
This also fixes a bug I found in botl.c, where you could
go to the rogue level, and the bottom line gold symbol
was not being updated with the new character as it should.
The reason was because the gold value had not changed,
only the field symbol used had changed.
This updates multiple ports to place a (void) cast on
the mapglyph call, now that it returns a value, so this
is going to generate a lot of diff e-mails.
This commit is contained in:
@@ -787,12 +787,17 @@ These are not part of the interface. They may be called by your
|
||||
window port routines to perform the desired task, instead of duplicating
|
||||
the necessary code in each window port.
|
||||
|
||||
mapglyph(int glyph, int *ochar, int *ocolor, unsigned *special, int x, int y)
|
||||
int mapglyph(int glyph, int *ochar, int *ocolor, unsigned *special, int x, int y)
|
||||
-- Maps glyph at x,y to NetHack ascii character and color.
|
||||
If it represents something special such as a pet, that
|
||||
information is returned as set bits in "special."
|
||||
The return value is an index into the showsyms[] array, in
|
||||
case a port wants to index into its own alternative
|
||||
set of display symbols (such as a unicode set) instead of
|
||||
the default set.
|
||||
|
||||
If the glyph represents something special such as a pet,
|
||||
that information is returned as set bits in "special."
|
||||
Usually called from the window port's print_glyph()
|
||||
routine.
|
||||
routine.
|
||||
|
||||
VII. Game startup
|
||||
|
||||
|
||||
Reference in New Issue
Block a user