Renders to a Pixmap and then sets the Pixmap. This in itself does not
change the appearance, but provides a means to do percentage bars,
italics and more.
This was trying to retrieve the foreground color of the form created
in create_value(). Forms don't have colors, and so this was failing,
and update_color() didn't update the color.
Menu windows with lots of entries (such as #optionsfull) were taller
than the screen, making them awkward to use.
The widget needs to be realized before we can get the size.
Also, we need to set the size of the parent popup, not the
acting widget.
In the event that there is a collision between a menu group accelerator
and an individual menu item's accelerator, disregard the group
accelerator.
'$' is the only known collision in NetHack 5.0 presently.
Close#805
win/share/decals.txt contains (initially) a decal_delimiter tile,
a decal_pet tile, and a decal_pile tile.
The latter two can be used for hilite_pet and hilite_pile implementations
that don't have something in place already. The implementation would
just need to apply (merge) the non-background decal pixels over a
regular tile.
The special decal_delimiter tile can be used to confirm the presence
of the delimiter tiles in the tileset and mark the end of the regular tiles,
and the start of the decal tiles.
row 1 contains the background color whose pixels should be
ignored when applying a decal to a tile.
row 2 contains a row of pixels colored (0, 0, 0).
row 3 contains a row of pixels colored pure green (0, 255, 0).
row 3 contains a row of pixels colored pure blue (0, 0, 255).
In previous versions of NetHack, setting -DUSE_TILES enabled the tile
support, while setting -DSUPPRESS_GRAPHICS produced a NetHack that
would write its TTY output to standard output, and rely on ANSI.SYS or
similar to do screen control. (USE_TILES is now TILES_IN_GLYPHMAP.)
This change ensures that the current NetHack can be built the same
ways.
One twist is that previous NetHacks would drop all support for graphical
modes when tiles were not supported. Thus sys/msdos/vid{vga,vesa}.c have
very disordered use of TILES_IN_GLYPHMAP. There was no need to check
this. But now, the graphical modes also support Unicode. A non-tiled
build should have the graphical modes, with only the text functions
present, provided that ENHANCED_SYMBOLS is defined.
Some unused and locally used symbols were cleaned up along the way.
* 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.
Keep only 8 background colours but if curses supports 256 colours and
256*8 colours pairs, create colours pairs for 256 foregrounds rather
than just 16.
It will need another parameter for 256-colour support. To avoid having
too many arguments, put glyph colour, background colour and attributes
into a struct and, since to curses library all of that is attributes
that are handled by same function, call the struct "gryph attributes".
curses_putch was also declared in two different headers, remove one of
those declarations.
The blue background colour for piles was implemented by changing glyph
colour to curses colour pair with the desired background, and then
passed to curses_putch which takes character and background colour and
makes curses colour pair out of them once again.
Pass blue background to curses_putch instead and let it create curses
colour pair just once.
The old logic used a negative check to emit an extern declaration for
tparm(). This guarded against old platforms whose curses implementations
did not declare their own functions.
If there are still any platforms left that need this declaration, they
can set TPARM_WORKAROUND to get the old behavior back.
I noticed a strange thing where the X11 windowport didn't show the tethered
thrown aklys animation correctly. Interestingly, other stuff, such as zapped
wands did show the path. I didn't bother trying to figure out what the core
was doing differently, as the animation worked in all the other windowports,
so instead fix the issue in X11, so it behaves the same as all the others.
The issue seems to be that the event loop exited on any(?) event, instead
of our specific timed event. So, create our event with a magic id number,
and exit only when we encounter that.
Also: Obey the timed_delay option, and change the delay from 30ms to 50ms,
like in other windowports.
The terminfo entries from the standard ncurses distribution have
peculiar settings for entries supporting 24 bit colors. The direct
entries mix indexed and RGB values into an incompatible mess.
This commit adds a simple workaround for the tty port. Colors are
initialised as if only 8 ANSI colors are available. This does not
affect color customisation from the symsets.
The curses port is affected as well. But I am not yet comfortable to
refactor a large part of the code for an absolute edge case.
Buffer overflows could occur when interacting with containers while
inputting or outputting many items.
This commit ensures topline updates do not exceed buffer limits by
checking against TBUFSZ.
Issue reported by k21971 on IRC.