If a piece is swapped with another piece, the LastPos is forgotten too soon;
after viewing an inventory item with the new piece in hand, that piece can't be
put down.
The data in nancy.dat was reliant on the ordering of
the Common::Language enum, which this broke Russian
game variants. This commit adds support for a new
chunk type that defines a custom enumeration instead.
In a previous commit, a code path that would adjust
the number of loops for a sound was forgotten and
rendered useless. This commit moves it earlier in
the call chain, where it could still have an effect.
CifFile::createReadStream's `buf` is free()d by way of
Common::DisposablePtr<unsigned char const,
Common::MemoryReadStream::CastFreeDeleter>::~DisposablePtr()
IFF::getChunkStream's `dup` is free()d by way of
Common::DisposablePtr<unsigned char const,
Common::MemoryReadStream::CastFreeDeleter>::~DisposablePtr()
StaticData::readData's `patchBuf` is free()d by way of
Common::DisposablePtr<unsigned char const,
Common::MemoryReadStream::CastFreeDeleter>::~DisposablePtr()
CifTree::createReadStreamForMember's `buf` is free()d by way of
Common::DisposablePtr<unsigned char const,
Common::MemoryReadStream::CastFreeDeleter>::~DisposablePtr()
A scene that contains one of the puzzles that have an
associated PuzzleData struct would previously crash on load,
because loading from a save would clear the PuzzleData
struct after the pointer to it was acquired by the puzzle.
This commit adds second calls to getPuzzleData() in
those puzzles, ensuring the pointer will be correct.
The puzzle may be left in a broken state when a save is
initiated or when clicking a scene item while holding a
puzzle piece. The held piece is now tracked inside the
puzzle state object, and put in its place whenever the
game is saved/the puzzle is reopened.
The LoopingAudioStream object that was being created
on the spot and passed to the Mixer when calling playSound was not being tracked anywhere, and was
getting leaked (though the underlying stream was
properly deleted). This commit adds a pointer to that
(maybe) looped stream and makes sure the underlying
data is getting deleted through it.
This class manages a buffer where all data usually stored in detection
plugin will get copied before unloading the plugin and starting the
game.
This class expects that two functions are present in every
GameDescription: sizeBuffer which calculates how many bytes we will need
to store the entry in RAM and toBuffer which copies the data in the
buffer and fix the pointers in the class.
At the end, it is expected that an ADDynamicGameDescription doesn't
depend anymore on data stored in the detection plugin.
The AD_GAME_DESCRIPTION_HELPERS macro allow to implement these functions
in all GameDescription which don't have any pointer except those in
ADGameDescription.
Vorbis-encoded .his sounds were being read incorrectly.
Specifically, the size property inside the headers was
assumed to refer to the size of the file's body; instead, it
appears to refer to the uncompressed size of the sound.
This would then cause an assertion in
MemorySubReadStream when extracting those files
from a compressed game variant, since the code was
attempting to seek to the "end" of a stream with a size
larger than the file it's coming from.
Added support for the new Telephone AR type, which
adds a cellphone display with a phone number directory,
a dial button, and conditional phone numbers.
Added a hidden ConfMan property that controls how many
saves are allowed, and added code that sets it to 8 at
startup, provided the game is nancy7 or earlier. This makes
sure that later games, which had infinite saves, can have
their save menus supported correctly.