* In both the 16 color and the VESA mode, the tileset image is loaded
and split into individual tiles; the tiles are then processed into a
form that is compatible with the video mode in use. For 16 color mode,
a tile is processed each time it is displayed, leading to slow
redrawing. For VESA mode, each tile is processed at startup, leading
to long startup times. Both modes are changed so that the tile is
processed once, when it is first displayed, and the result is cached.
* Use memcpy when splitting the image into tiles.
* Only load the tileset once. In 16 color mode, for reasons I do not
understand, the gr_init function is called twice, leading to delay
in startup. This does not happen in VESA mode.
* src/glyphs.c: Don't produce names for swallow glyphs that can never
appear. This speeds up the building of the glyph index in
populate_glyphname_hash_indices.
* src/symbols.c: Build a sorted index for loadsyms so that it can be
searched with bsearch.
Benchmarking results, using the MS-DOS port on an emulated 386SX at
16 MHz; times are as measured with clock() from the entry to main()
to the appearance of the "Who are you?" prompt:
* Unmodified: 48.5 seconds
* With the loadsyms index: 40.4 seconds
* With impossible swallow glyphs left unnamed: 34.5 seconds
These changes should also be helpful for the Amiga and Atari ST ports.
The 16 color mode loads the font specified in font_map, and accepts it
only if its size is 8 by 16 pixels. This change avoids a null
dereference if the font is not found.
This change adds U+2299, U+2601 and U+2980 to the bundled fonts, so
that all symbols specified in the Extended2 symbol set are available.
Also, a few more directives are added to the files, so that FontForge
can load them and display their contents.
When corpses haven't stacked, and there is no player-discernable
reason why, provide some additional information in some cases,
but only when it is required.
Gender variance is the supported case in this commit.
Related to GitHub issue #1607.
This commit doesn't change the underlying mechanics to allow
the corpses to stack, but it does help the player understand
why that's the case in this instance.
In file included from ../include/hack.h:34,
from sp_lev.c:14:
In function ‘create_monster’,
inlined from ‘lspo_monster’ at sp_lev.c:3386:5:
../include/rm.h:528:32: warning: array subscript -1 is below array bounds of ‘struct monst *[80][21]’ [-Warray-bounds=]
528 | if (!svl.level.monsters[x][y]) \
| ~~~~~~~~~~~~~~~~~~^~~
sp_lev.c:2045:25: note: in expansion of macro ‘remove_monster’
2045 | remove_monster(x, y);
| ^~~~~~~~~~~~~~
../include/rm.h: In function ‘lspo_monster’:
../include/rm.h:476:19: note: while referencing ‘monsters’
476 | struct monst *monsters[COLNO][ROWNO];
| ^~~~~~~~
In function ‘create_monster’,
inlined from ‘lspo_monster’ at sp_lev.c:3386:5:
../include/rm.h:530:27: warning: array subscript -1 is below array bounds of ‘struct monst *[80][21]’ [-Warray-bounds=]
530 | svl.level.monsters[x][y] = (struct monst *) 0; \
| ~~~~~~~~~~~~~~~~~~^~~
sp_lev.c:2045:25: note: in expansion of macro ‘remove_monster’
2045 | remove_monster(x, y);
| ^~~~~~~~~~~~~~
../include/rm.h: In function ‘lspo_monster’:
../include/rm.h:476:19: note: while referencing ‘monsters’
476 | struct monst *monsters[COLNO][ROWNO];
| ^~~~~~~~
This is a reimplementation of commit ec32748 in TNNT by entrez:
If you use undead turning on a dead hero's corpse from a bones file,
its ghost will get sucked back into its body when it comes back to
life. In such cases, treat the newly revived corpse/recorporealized
ghost as a "former hero" for the purposes of livelogging bones
monster kills.
Part of this change was to remove a bit of weirdness in the game - the
odd situation where you revive a corpse-ghost combo on a bones pile, and
get the messages:
The human corpse glows iridescently.
Foo's ghost is suddenly drawn into its former body!
The human is resurrected!
and subsequently the monster is just a generic human (or elf, etc)
without anything indicating it used to be a player. With this change,
the monster will retain the name that the ghost had, and its struct
ebones prevents the player from renaming it.
This commit also adjusts the "resurrected" message to explicitly use the
monster's name if it has one, and to use YMonnam in the unrelated case
where the monster was a pet (so reviving an unnamed tame kitten will
print as "Your kitten is resurrected!")