Also prevent segmentation fault cases related to low-res or switching from low-res to hi-res
And fix memory leak related to loading and scaling of the thumbnail image
A lot of the updated logic is borrowed from the saveload-dialog.cpp for the simple list view (with the thumbnail to the right of the list).
toupper() callers should avoid putting a side-effect expression there, but
in practice it sometimes happen, so making the macro safer can't hurt.
This uses a GCC statement expression, but this port only uses GCC
anyway.
GCC 2.95.3 has no C++11 support, so there's no point in referencing
it anymore.
The SYNC_AS() lines could be moved back to the end of the class
declaration, but it still seems fine where it is, so just remove the
workaround comment.
There's no need to check for GCC 3.4+ anymore, since we always require
a C++11 compiler. Just look for __GNUC__, since this is an old
builtin and Clang always has it too.
Also #undef the LT() temporary macro while there, so that it can't
pollute something else by accident, since it's a short macro name in
a header file.
C++11 is now required, so there's no point in checking for pre-C++11
versions of GCC anymore. Note that Clang defines __GNUC__ too, but
always reports itself as GCC-4.2.1-compatible (and, in practice, the
earliest C++11-compatible versions of Clang will also be have most
GCC 4.8 features).
Currently, the text-to-speech manager will try to update the voices whenever TextToSpeechManager::pushState()/popState() is called. This causes lags of 4 - 5 seconds on Windows. Also, a warning is triggered each time. This commit prevents that from happening if the tts option is not enabled.
This commit currently affects only Windows. Other backends don't make use of the new _enabled setting. I don't know if it would make sense for any of these and I also wouldn't be able to test it.
This adds a lot more unit tests for Common::INIFile and fixes some small
problems identified during their creation. Specifically:
* addSection() did not check the validity of the section name, which meant it
was possible to create a section that could not then be operated on by the
other functions (which all check validity)
* If allowNonEnglishCharacters was set, it was possible to create a key or
section name starting with '[' or '#', or including a carriage return. This
would not read back in correctly.
* Blank section and key names were considered valid, but neither would be
read back in correctly.
* The struct documentation did not mention whitespcae handling or that comments
include the '#' and carriage return.
Apple's desktop operating system was formerly called "Mac OS X" and "OS X", but since 2016 it has been called "macOS" (starting with version 10.12).
Changing across all comments and documentation to use this current terminology, except in cases where the historical versions are explicitly referenced. No code changes are made; we should consider changing those in future PRs.
The pos() method of BufferedWriteStream should return the stream position
but actually returns the buffer position. That completely breaks saving
the game in AGS engine on the platforms using BufferedWriteStream wrapper
for savefile handling, such as Nintendo Switch. AGS engine's save file
writing functions use GetPosition() with later Seek() on stream,
so an invalid return value from GetPosition() results in invalid save files
that cannot be loaded and are skipped by the engine.