]> granicus.if.org Git - nethack/commit
ENHANCED_SYMBOLS
authornhmall <nhmall@nethack.org>
Sat, 7 May 2022 14:25:13 +0000 (10:25 -0400)
committernhmall <nhmall@nethack.org>
Sat, 7 May 2022 14:25:13 +0000 (10:25 -0400)
commitcb0c21e91d90c16cd470fa808a93e959aae1ed37
tree6f1f6657cdcc2554b5f09a2ffcf8f47d575607c8
parent132e1d433a2e398be62cc169f4b7bffdb6007a28
ENHANCED_SYMBOLS

A new feature, enabled by default to maximize testing, but one which can
be disabled by commenting it out in config.h

With this, some additional information is added to the glyphmap entries
in a new optional substructure called u with these fields:
    ucolor          RGB color for use with truecolor terminals/platforms.
                    A ucolor value of zero means "not set." The actual
                    rgb value of 0 has the 0x1000000 bit set.
    u256coloridx    256 color index value for use with 256 color
                    terminals, the closest color match to ucolor.
    utf8str         Custom representation via utf-8 string (can be null).

There is a new symset included in the symbols file, called enhanced1.

Some initial code has been added to parse individual
OPTIONS=glyph:glyphid/R-G-B entries in the config file.

The glyphid can, in theory, either be an individual glyph (G_* glyphid)
for a single glyph, or it can be an existing symbol S_ value
(monster, object, or cmap symbol) to store the custom representation for
all the glyphs that match that symbol.

Examples:
   OPTIONS=glyph:G_fountain/U+03A8/0-150-255

(Your platform/terminal font needs to be able to include/display the
character, of course.)

The NetHack core code does parsing and storing the customized
entries, and adding them to the glyphmap data structure.

Any window port can utilize the additional information in the glyphinfo
that is passed to them, once code is added to do so.

Also, consolidate some symbol-related code into symbols.c, and remove it from
files.c and options.c
50 files changed:
dat/symbols
doc/Guidebook.mn
doc/Guidebook.tex
include/config.h
include/decl.h
include/extern.h
include/flag.h
include/hack.h
include/optlist.h
include/sym.h
include/wincurs.h
include/winprocs.h
include/wintty.h
include/wintype.h
src/allmain.c
src/decl.c
src/display.c
src/do.c
src/drawing.c
src/files.c
src/hacklib.c
src/mdlib.c
src/monst.c
src/options.c
src/symbols.c
src/utf8map.c [new file with mode: 0644]
src/windows.c
sys/libnh/libnhmain.c
sys/share/pcmain.c
sys/share/unixtty.c
sys/unix/Makefile.src
sys/unix/hints/linux.370
sys/unix/hints/macOS.370
sys/unix/unixmain.c
sys/vms/vmsmain.c
sys/windows/Makefile.mingw32
sys/windows/Makefile.nmake
sys/windows/consoletty.c
sys/windows/windmain.c
win/Qt/qt_map.cpp
win/X11/winmap.c
win/curses/cursinit.c
win/curses/cursmain.c
win/curses/curswins.c
win/curses/curswins.h
win/share/tilemap.c
win/tty/termcap.c
win/tty/topl.c
win/tty/wintty.c
win/win32/mhmap.c