Diablo and Hellfire have different palettes in `ui_art\black.pcx`.
We now ship our own tiny `black.pcx` that takes priority over the
other ones. This `black.pcx` had the Diablo palette which resulted in an
incorrect palette in the Settings screen.
Split our own `black.pcx` file into `black_diablo.pcx` and
`black_hellfire.pcx` and load the correct one depending on the mode.
1. Do not modify the map after loading. Instead, return string views
(guaranteed to be null-terminated) from look up functions and return
the key directly if not found.
2. Use an `unorded_map` instead of `map` where available (C++20).
Saves a bit of RAM (~50 KiB) and improves lookup performance.
The backgrounds can be quite large, for example
the Hellfire title background is a 2.4 MiB PCX file.
Previously, we converted all background to SDL surfaces.
This required extra memory, e.g. the 2.4 MiB Hellfire
title background uses 4.6 MiB as an SDL surface.
Changes the background to render directly from PCX instead
to reduce the allocator pressure.
Using optional arguments where possible so that all use cases can share the same constructor. Also moving member initialisation to the initialiser list syntax as this makes it clear that the derived class is only setting properties on that class, leaving the parent constructor to initialise members of the parent class.
Disabled by default because of these known issues:
1. When clicking on inventory item, it briefly appears a bit shifted (in the wrong coordinates).
This issue can happen with software cursor as well, but is a lot more
obvious with the hardware cursor.
2. Cursor is scaled with nearest-neighbour scaling, which may look a bit different from
how the rest of the graphics are scaled.
See also previous attempt: https://github.com/diasurgical/devilutionX/pull/955 by @viciious
Co-authored-by: Victor Luchits <vluchits@gmail.com>
Use that instead of using `GetOutputSurface()` directly.
For the rg99 port, we'll want to render this to the `pal_surface`
instead of output surface directly.
Might also be useful for 3ds, perhaps to render to the bottom screen.
Text mode is on by default. Calling SDL_StartTextInput() will start the
virual keyboard, but does not allow for a default value. Calling it as
well as switch_start_text_input() will start the keyboard a secound
time.
We still turn TextInput off on other platforms when it's not needed as
it can require additional resources.
Text mode is on by default. Calling SDL_StartTextInput() will start the
virual keyboard, but does not allow for a default value. Calling it as
well as switch_start_text_input() will start the keyboard a secound
time.
We still turn TextInput off on other platforms when it's not needed as
it can require additional resources.