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.
Changed the names of the pointers to GraphicsManager
and CursorManager to be shorter, since they were
inconsistent with the rest of the managers, and typing
them out is a chore.
Added support for the changes nancy8 made to the
TileMove puzzle type. Specifically, an optional exit button,
and a timer with graphics that indicate how much time the
player has left.
Conversation responses have rules for how they should
be added to the list (just add, add at end, or remove),
which until now have been ignored. It's unclear if these
have ever been used, since scanning for them is hard.
Also, conditional responses are now added after the
regular ones.
The previous implementation of ConditionFlags' orFlag
checking did not account for chained orFlags. This struct
is seldom used, so it's unclear what, if anything, was
affected by this issue.
Whenever a SceneChangeDescription is constructed
manually (e.g. in Conversation), it now has its
listenerFrontVector initialized with the default value
(pointing straight forward).
The addItemToInventory() and removeItemFromInventory()
were still using uints, which meant that if they were
somehow called with an id of -1 (which marks an invalid
item), they'd crash the engine. This shouldn't matter for
regular play, but may occur when debugging.
Implemented the ConversationSoundTerse and
ConversationCelTerse action records, which are even
shorter variants of the corresponding Conversation types.
Made changes to the base ConversationSound to reduce
code duplication.