From upstream 6a238e9cb4acda222898dd4b597cf20581b401f6
This replaces a slightly different fix we had in ScummVM. But this new
code works better and fixes bug #12949
There have been this stupid oversight all along since the introduction
of the class: while it reported Length and EOS correctly, it still
allowed to read past the end.
This can cause issues if the user code relies, for example, on Read()
or ReadByte() return value.
For upstream code, in practice this fixes MP3 streaming, where the length
of data is not always possible to precalculate. In ScummVM we used a
different code for MP3, but this may fix other cases as well.
From upstream 6f02bedc65b902ce41858b7e92970662020a11cf
Some custom engines supported Label.TextAlignment before 3.5.0 got this
added officially, except they used old alignment constants.
From upstream 46fc9bac4fa6082561a1937861b3e567ccea2cd4
This allows to fully pack InputType, KeyMod and KeyCode/MouseButton/etc in a int32:
- 8 bits (0xFF) - input type
- 8 bits (0xFF) - key mod flags
- 4 bits (0xF) - reserved (potentially for expanding mod flags, if that will be necessary)
- 12 bits (0xFFF) - KeyCode, mouse codes, gamepad buttons, etc.
Purpose:
1. Potentially allow to set keycodes + mods in an integer and assign to an integer variable/property, such as "skip key", instead of using existing "combo keys"
2. In fact, with InputType flags, this makes it possible to assign a mouse or gamepad button to the same variables.
3. Potentially allow to return keycode + mods from Wait* (currently returns only single key).
From upstream 0203e8feb73b96c501ac2439aa3fe3d6c182c8f4
* Changed from -1 - based constants to 0 - based constants;
* These were purely internal values, therefore no API would be harmed;
* Removed necessity of converting from internal mouse button code to script and back all the time;
* On a side note, this fixes a bug where WaitMouse etc were returning incorrect values on mouse skip, because we forgot to convert from internal to script code.
From upstream 471098d239b076c494beb2d554572ccb69372667
This may lead to unexpected effects when resources are not fully preloaded yet, but a Slider's "UpdateMetrics" was called.
From upstream 5654fb52a64904a6b0cdcec674224f7a0d91a8eb
This could make a new sprite look differently, depending on placeholder's (sprite 0) settings, until the game is saved once.
From upstream f2a922a9cefd40337502bde734503605a76550db
Sprite Cache and Managed Objects produce a lot of entries in the log currently.
They use a macro to set if they should be on or not, but this macro may be set =0, with the intent of disabling.
Let's instead use #if when testing these macros.
Additionally
- only define DEBUG_MANAGED_OBJECTS if AGS_DEBUG_MANAGED_OBJECTS is true
- adds a new command line flag AGS_DEBUG_SPRITECACHE, which will only define DEBUG_SPRITECACHE if true
- guard indefinition through core/platform.h
From upstream e8bd58da2e09d844068dc087f1da153a693b7aa8
Fixes kq1agdi crashing on big-endian systems, since it tried to allocate
a gigantic amount of memory from MFLUtil::ReadV21() because of the
misread values.
From upstream 5e29a339fc83bf5c06a3a9a3b1c65a2fc4b4e72c
Also includes upstream 427752da015fd93549deef1a31d5e533e5c9319e
After discussing with upstream ags developers, it was indicated that
making the destructor virtual changes the vtable and could cause
issues with plugins used by old games. This is unlikely to be an
issue with ScummVM since we do not use the original plugin DLL, but
to be consistent with upstream code I am reverting the change here.
And furthermore there was no need to make the IAGSFontRenderer
destructor virtual, as long as we do make the destructor of the base
renderers in the AGSSpriteFont plugin virtual (so that the Clifftop
Games versions of the renderers are properly destroyed).
This fixes issues with the font renderers deletion in the ags_sprite_font
plugin since we do deletion using pointers that may not be of the final
class.