AudioChannel.Pause and Resume commands were added back in 3.6.0,
but I forgot to write the paused state to save format...
From upstream e18091c2f32a057d4c6538b9b26e4f31ef9b6296
* separate variant of add_dynamic_sprite() that searches for the free slot itself,
not requiring user to do this;
* the previously existing variant is used for: replacing modified dynamic sprite
and restoring sprites from save.
* add_dynamic_sprite() accepts unique_ptr<Bitmap>, explicitly saying that the
ownership will be taken by the spriteset.
* sprite info and SPF_* flags are set inside spriteset, instead of hacking them in
add_dynamic_sprite().
* simplified LoadSaveSlotScreenshot()
From upstream 0913f49e4212fea3a48539251ffc1ab92518a231
and aca47b9f466fe41d73d99a15b9f0ae41e65c6926
+ minor changes
This fixes a mistake introduced in commit 4be1556, which in turn followed b02814b
The problem is, that CCStaticArray does not work as intended, and seems won't (at
least not without some extra workarounds).
When the script compiler is told to get an Nth element of a global struct array, such
as character[n], it calculates the memory address as
Character* ptr = (array address + sizeof(Character) * n).
If this address is used for the read/write operations, these ops can be intercepted by
interpreter and remapped into the real fields (see IScriptObject::ReadN, WriteN
interface).
But if this address is used IN POINTER COMPARISON BY VALUE, then we cannot do
anything. And if our real struct in the engine is stored on a different relative memory
offset than one expected by compiler, then this pointer comparison will fail.
This breaks script expressions like e.g.:
if (player == character[n])
From upstream 97ed18e95b587544ae47497f0a5f1d1ba00a7e29
Done for more consistency, so long as CharacterInfo and CharacterExtras are
separated structs.
WARNING: this breaks the saves made in 3.6.1.14 (Beta 15)...
Additionally, done so that legacy scriptnames are not loaded from current saves,
since these are supposed to stay fixed throughout the game (at least unless
characters are created dynamically, which they currently are not).
From upstream c15603adface26d3ea44519f07f4992c3201ad53
NOTE: appended this new field to the end of character save chunk for consistency.
But because the field itself is in the CharacterInfo struct, I have to pass CharacterInfo
reference into CharacterExtra::ReadFromSavegame().
This is ugly, but but should be improved when the structs are refactored into having
a distinct runtime Character class.
From upstream 5cedf554b211957d7b413a4ef7608f0748384b0e
This version was in public pre-alpha release and stayed for 3 months
before being replaced by an updated format along with the new A* pathfinder.
From upstream ac41f53a9c40f2ceb9e3f80eb219faabfeb3da43
Backport the good idea from ags4, where movelists are written in their own save file
section, as separate data objects.
Remember that we have to keep loading them from within Character/Room data in old
saves though.
Save `onpart`member as fixed-point value. MoveLists from old saves have to convert it
from integer.
From upstream 216bf453ec007d8d1545315837c6beadb49bc52f
Keep ScreenOverlays in std::vector, but do not erase elements
in the middle and invalidate them instead. Record free indexes
in a helper stack.
When creating a new overlay, first check for the recorded free indexes.
Overlay's type now equals storage index.
This speeds up both creation/deletion of overlays, and their access.
Removed the gap between "fixed" overlay types and custom ones,
to save space. If we ever need more special overlays, these could
be created as custom and their ids saved in a variable (similar to
how background speech works). Previously present special overlay
types are left for backwards compatibility (and to simplify the transition).
From upstream f7d2f162fa55aa1b6f37195d890ebe047a204154
This is not precisely a part of a particular save format, but rather a command to plugin callback system.
In theory it might be also possible to implement step by step reading and writing with some engine's action in between.
From upstream df0151983e077e577eee8691a61d03be44c24cbd
This allows to properly fixup (upgrade) RoomStatus structs
restored from a older format save in an upgraded game.
For example: game was upgraded from 3.4.0 to 3.6.0, but player
tries loading 3.4.0 save. In this situation the engine must know and
keep track of what version each RoomStatus was saved in.
This is necessary, because RoomStatus can only be updated upon
loading a corresponding room file (when entering a room). This
means that multiple RoomStatus objects will be staying in memory
not being upgraded yet, until player enters particular room.
From upstream 205232af5909e0a257494ff404f36003b004ebc4
Leave it with a new name as `update_polled_stuff()` only in functions
related to the game update.
From upstream 95dc139f51e704da19792e5480e69bbfe7ec27aa