In C++, globals initialization order accross translation units is not
defined. Accessing a global via a function ensures that it is initialized.
This will be needed for #7638, which will statically initialize change
handlers after the Options object has been initialized.
This mod renders a clock in the top-right corner
and is always available (disabled by default).
It is useful to have a mod available by default
as we work on mod support.
1. Moves more assets-related stuff from `init` to `engine/assets`.
2. Removes `SDL_audiolib` dependency from `soundsample.h`.
3. Cleans up some unused/missing includes.
Our implementation has a more modern interface and only
supports the features that we care about.
It always outputs `\n` as newlines and does not output BOM.
The modern interface eliminates awkward `c_str()/data()` conversions.
This implementation preserves comments and the file order of sections
and keys. New keys are written in insertion order.
We now also support modifying and adding default comments,
which may be a useful thing to do for the especially tricky
ini options (this PR doesn't add any but adds the ability to do so).
Sadly, this increases the RG99 binary size by 24 KiB.
I'm guessing this is because the map implementation generates
quite a bit of code.
Note that while it might seem that using `std::string` for every key and
value would do a lot of allocations, most of these strings are
small and thus benefit from Small String Optimization (= no allocations).
* Extend F keys with F13-F24 range
* Add more possible keybindings
* Removed hardcoded keys that are used elsewhere
* Put PAUSE back where it was before
* Remove hardcoded logic for PAUSE key
* Hotkeys: Support more keybindings
This patch adds more keybindings, so we can map multiple keys.
It also adds a possibility to bind an alternate key to pause game
(currently mapped to P and Pause key by default).
Co-authored-by: n <neube.github@gmail.com>
Co-authored-by: staphen <staphen@gmail.com>
If a resampler was not enabled, we'd get an unused variable warning:
warning: unused variable 'ResamplerSpeex' [-Wunused-const-variable]
constexpr char ResamplerSpeex[] = "Speex";
This commit restricts the use of Test Barbarian and Test Barb to the
Hellfire expansion only.
Signed-off-by: Vinícius Ferrão <vinicius@ferrao.net.br>
Adds handy helpers for performing algorithms on the entire container.
They're prefixed with `c_` for container.
This naming convention is identical to some popular C++ libraries, such
as Abseil.
With this, we no longer require `std::filesystem` support to create the
save file directory when it does not exist.
Note that by default the save file directory exists because it is
created by SDL, so this is mostly useful on platforms that override the
save directory or use `UNPACKED_SAVES`.