937 Commits

Author SHA1 Message Date
Hubert Maier
830ed3c53b JANITORIAL: NANCY: Fix typos 2024-09-16 01:51:50 +03:00
scummvmuser
319fcb7c97 NANCY: Fix leak in scene.cpp
`buf` wasn't freed.
The assignment to `description` copies the string; no need for heap here.
2024-08-05 22:11:53 +03:00
scummvmuser
282ad5a719 NANCY: Fix an alloc-dealloc mismatch in cif.cpp
CifFile::createReadStream's `buf` is free()d by way of
Common::DisposablePtr<unsigned char const,
    Common::MemoryReadStream::CastFreeDeleter>::~DisposablePtr()
2024-07-29 21:59:48 +02:00
scummvmuser
de4f8ca634 NANCY: Fix an alloc-dealloc mismatch in iff.cpp
IFF::getChunkStream's `dup` is free()d by way of
Common::DisposablePtr<unsigned char const,
    Common::MemoryReadStream::CastFreeDeleter>::~DisposablePtr()
2024-07-29 21:59:48 +02:00
scummvmuser
bf61247bc5 NANCY: Fix an alloc-dealloc mismatch in commontypes.cpp
StaticData::readData's `patchBuf` is free()d by way of
Common::DisposablePtr<unsigned char const,
    Common::MemoryReadStream::CastFreeDeleter>::~DisposablePtr()
2024-07-29 21:59:48 +02:00
scummvmuser
10f5465991 NANCY: Fix an alloc-dealloc mismatch in cif.cpp
CifTree::createReadStreamForMember's `buf` is free()d by way of
Common::DisposablePtr<unsigned char const,
    Common::MemoryReadStream::CastFreeDeleter>::~DisposablePtr()
2024-07-29 21:59:48 +02:00
Kaloyan Chehlarski
dd6e641f9c NANCY: Fix crash loading scene with PuzzleData
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.
2024-07-21 23:05:55 +02:00
Kaloyan Chehlarski
c07720c1c0 NANCY: Fix RippedLetterPuzzle breakage on exit
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.
2024-07-21 21:51:28 +02:00
Kaloyan Chehlarski
0dd0e487e9 NANCY: Fix memory leak in SoundManager
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.
2024-07-21 21:10:01 +02:00
Cameron Cawley
ff530edcb1 GRAPHICS: Deprecate ManagedSurface methods that implicitly copy pixel data 2024-07-02 13:31:18 +01:00
Le Philousophe
7e0048b4a3 ENGINES: Add ADDynamicGameDescription class
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.
2024-06-30 18:39:06 +02:00
Le Philousophe
b61bd3ff85 ENGINES: Create a type aware advanced meta engine 2024-06-30 18:39:06 +02:00
Le Philousophe
90b886097f ENGINES: Create a type aware advanced detector 2024-06-30 18:39:06 +02:00
scummvmuser
3f9b256552 NANCY: Highlight Done button in Game Setup 2024-06-30 14:08:20 +02:00
scummvmuser
acc5d24fa3 NANCY: Add sound to toggles in Game Setup 2024-06-29 18:59:37 +02:00
Kaloyan Chehlarski
02722def86 NANCY: Fix Vorbis sound reading
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.
2024-06-22 21:30:39 +02:00
Cameron Cawley
1357bfe672 COMMON: Avoid including engine headers in common code for DebugChannelDef 2024-06-20 20:15:57 +01:00
Kaloyan Chehlarski
4a6cd7f0be NANCY: Add nancy7 detection entry
Provided by user ModiTorsen on the bugtracker.
Fixes #15088
2024-05-07 18:23:41 +02:00
Kaloyan Chehlarski
8854f6e872 NANCY: Add nancy6 detection entry
Provided by user ModiTorsen on the bugtracker.
Fixes #15087
2024-05-06 12:03:14 +02:00
Kaloyan Chehlarski
1781a1e140 NANCY: Fix SliderPuzzle for pre-nancy9 games
The last changes to the class broke older titles
which use the SPUZ chunk.
Fixes #15097
2024-05-05 21:03:05 +02:00
Kaloyan Chehlarski
b9aa46c4df NANCY: Merge LOAD structs 2024-05-05 21:03:05 +02:00
Matthew Jimenez
ee5ebec7ca IMAGE: Remove palette start from image decoder.
The palette start value was always zero, adding complexity without benefit.
2024-03-31 23:16:59 +03:00
Kaloyan Chehlarski
b1a861b50d NANCY: JANITORIAL: Fix trailing whitespace/tabs 2024-02-19 20:46:17 +01:00
Kaloyan Chehlarski
f89967c979 NANCY: Implement NewPhone
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.
2024-02-18 22:31:13 +01:00
Kaloyan Chehlarski
18eea6d464 NANCY: Add support for nancy9 RippedLetterPuzzle
In nancy9 this record got an upgrade allowing for an
extra solution, as well as duplicated elements.
2024-02-18 22:31:13 +01:00
Kaloyan Chehlarski
2e22962909 NANCY: Add support for TextBoxWrite with no string
Somewhere around nancy9 (may happen earlier, too),
the TextBoxWrite record added support for reading its
string from the Autotext chunk.
2024-02-11 22:53:22 +01:00
Kaloyan Chehlarski
f85277f82a NANCY: Add support for nancy9 SliderPuzzle
The record works identically to the one in nancy1, with
the exception that the start positions are no longer pulled
from a SPUZ chunk.
2024-02-11 22:53:22 +01:00
Kaloyan Chehlarski
88574bd47c NANCY: Fix crash in Conversation 2024-02-11 22:53:22 +01:00
Kaloyan Chehlarski
b2231ac3cd NANCY: Implement Autotext with hotspots
Added support for hotspots that link to a new scene,
as introduced in nancy9.
2024-02-11 22:53:22 +01:00
Kaloyan Chehlarski
e25018f892 NANCY: Allow later games to have 999 saves
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.
2024-02-11 22:53:22 +01:00
Kaloyan Chehlarski
4541d085ca NANCY: Disable buttons/save when a Movie is active
The original engine specifically disables exiting the Scene
when a SecondaryMovie is playing.
2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski
5695018cd3 NANCY: Implement InteractiveVideo
Implemented an action record type that adds hotspots
on top of a SecondaryMovie.
2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski
01eefffad6 NANCY: Fix memory leak in ResourceManager 2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski
758db1bfb1 NANCY: Fix memory leak when reading .dat file 2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski
3d9a61f904 NANCY: Fix memory leak in Conversation 2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski
0c2e54416e NANCY: Update engine status comment 2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski
ad21d8b566 NANCY: Fix ResourceManager memory leak
The ResourceManager was never getting deleted on
engine exit. Also, it is now instantiated in the engine
constructor, just like the other managers.
2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski
4d5c4fcfcc NANCY: Rename graphics and cursor managers
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.
2024-02-11 00:41:29 +01:00
Kaloyan Chehlarski
3a6e2562dd NANCY: Implement nancy8 TileMove puzzle
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.
2024-02-11 00:41:29 +01:00
Kaloyan Chehlarski
07a95628bb NANCY: Fix nancy1 crash
Fixed a crash caused by the recent changes to the way
the clock is accessed.
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
afbeb4ab8c NANCY: Support Conversation response add rules
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.
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
b85ede6c9a NANCY: Correctly evaluate Conversation orFlags
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.
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
0f4ce35613 NANCY: Add support for nancy8 PianoPuzzle
The puzzle is used for the harmonica item, and adds
two special hover cursors.
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
c0a529c763 NANCY: Add sensible default listener on new scene
Whenever a SceneChangeDescription is constructed
manually (e.g. in Conversation), it now has its
listenerFrontVector initialized with the default value
(pointing straight forward).
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
b508ea4740 NANCY: Add sensible sound defaults 2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
477006c8a9 NANCY: Add PopScene() failsafe
When trying to pop an item scene with none pushed,
PopScene will now attempt to pop a regular pushed scene.
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
f5aef15d69 NANCY: Allow invalid item ids in some Scene functions
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.
2024-02-10 13:27:11 +01:00
Kaloyan Chehlarski
4558690ec9 NANCY: Implement GoInvViewScene record type
This record goes to an item's associated scene, and
(optionally) adds it to the inventory if it's not already
present in it.
2024-02-10 13:27:11 +01:00
Kaloyan Chehlarski
5683e5f6e6 NANCY: Implement even terser Conversation records
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.
2024-02-10 13:27:11 +01:00
Kaloyan Chehlarski
ff39bce6ea NANCY: Implement drawing Autotext marks
Marks are the special symbols introduced in nancy8,
and are used in the task list to mark done/not done tasks
using a checkmark graphic.
2024-02-08 23:12:33 +01:00