Commit Graph

1577 Commits

Author SHA1 Message Date
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
Cameron Cawley
1357bfe672 COMMON: Avoid including engine headers in common code for DebugChannelDef 2024-06-20 20:15:57 +01:00
Matthew Jimenez
5219c99400 GRAPHICS: Move PaletteManager definition to a separate header 2024-03-12 12:24:00 +02:00
Le Philousophe
ff6f58a8b6 SHERLOCK: Migrate engine to Path 2023-12-24 13:19:25 +01:00
Eugene Sandulenko
ec2dd2726b ENGINES: Added optional parameter to canSave/LoadGameStateCurrently() for indicating the reason 2023-12-08 12:21:16 +01:00
sluicebox
1a8386ae14 SHERLOCK: Fix memory leak on error. PVS-Studio V773 2023-11-22 23:21:03 -08:00
sluicebox
47d51e54cd SHERLOCK: Fix memory leaks. PVS-Studio V773 2023-10-30 11:28:14 -07:00
PushmePullyu
cd7a0bc0cf SHERLOCK: RT: Disable most input while cursor is hidden
Fixes opcode 0xAE (handled by TattooTalk::cmdMouseOnOff()).

Depending on its argument, the opcode does the following in the
original game:

0x01: Hide the cursor and disable user input
0x02: Unhide the cursor and re-enable user input

Cursor visibility toggling was already implemented, so this change
makes the opcode behave like in the original game (with the exception
that skipping dialogue is still possibile as a QoL improvement).

Fixes #14610
2023-10-16 17:30:02 +02:00
PushmePullyu
523d354371 SHERLOCK: Disable saving when cursor is hidden
Visibility of the cursor is not synced, so saving should be
impossible while it is hidden.
2023-10-16 17:30:02 +02:00
PushmePullyu
2530b1f3ed SHERLOCK: RT: Fix cursor staying hidden after darts game
The regression was introduced by the recent change to not call
showCursor() every time the cursor is changed.
2023-10-16 17:30:02 +02:00
PushmePullyu
44497da4d3 SHERLOCK: Remove showCursor call from setCursor
Calling showCursor() every time the cursor changes
is unnecessary and breaks hiding it via Rose Tattoo's cmdMouseOnOff().

Instead, call showCursor() only once on game start.
2023-10-16 17:30:02 +02:00
PushmePullyu
7cbf499501 SHERLOCK: Assert _talkToAbort is unset before changing scene 2023-10-16 17:30:02 +02:00
PushmePullyu
f35d63bb54 SHERLOCK: Assert script index is in bounds 2023-10-16 17:30:02 +02:00
Eugene Sandulenko
b032f66030
SHERLOCK: Comment out unused variables 2023-09-19 14:54:00 +02:00
PushmePullyu
dccb48e086 SHERLOCK: Fix incorrect talk history
Increase talkHistoryEntry._data[] size from 16 to 32.

Prevents out-of-bounds access to talkHistoryEntry._data if
a talk file has more than 16 statements.

Warning: This bumps the save version to 6.

Fixes #14578
2023-08-28 22:08:59 +02:00
PushmePullyu
06621c94d9 SHERLOCK: RT: Cancel scene transition when interrupted by script
Fixes #14580
2023-08-17 20:39:01 -07:00
PushmePullyu
c4d2ce9e96 SHERLOCK: RT: Sync sceneTripCounters on load/save
Warning: This bumps the save version to 5.

Scripts can create triggers via TattooTalk::cmdSetSceneEntryFlag().
These will set a flag when a scene has been visited a specified number
of times and are stored in
Array<SceneTripEntry> TattooScene::_sceneTripCounters.

However, this array is neither reset nor synced when loading/saving.
As a result, savegames can be in a buggy/unwinnable state.

While previous savegames can still be loaded with this fix, they
will not be automatically repaired.

See #14435 for instructions to reproduce the bug.
2023-08-05 08:52:51 -07:00
Miro Kropacek
f85fde7707 ENGINES: ALL: Use new CursorMan API where applicable
This makes code not only cleaner but also friendly to 8-bit surfaces
where pitch != width.
2023-07-19 22:22:11 +02:00
Vladimir Serbinenko
6b14c33da0 SHERLOCK: Fix lines displayed out of visible space 2023-05-03 22:31:45 +02:00
Vladimir Serbinenko
8ee55676de SHERLOCK: Use more accurate ZH_CHN rather than ZH_ANY for Rose Tattoo 2023-03-19 18:41:36 +01:00
Eugene Sandulenko
3776ffa8ed
SHERLOCK: Fix translation.h include usage 2023-03-17 15:08:50 +01:00
Donovan Watteau
18ab6803d6 JANITORIAL: Fix various "an" typos in comments 2023-03-16 14:47:28 +01:00
Vladimir Serbinenko
0eefb22032 SHERLOCK: Fix Fonts::unescape function
It ended up "unescaping" not escaped characters
2023-03-01 00:13:01 +01:00
Eugene Sandulenko
b58896b9a8
SHERLOCK: Fix compilation 2023-02-28 15:26:42 +01:00
Vladimir Serbinenko
a728a5aee1 SHERLOCK: Don't print bogus hotkey 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
12ed6c83fe SHERLOCK: Change coordinates for search bar in Chinese serrated scalpel 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
f407e19890 SHERLOCK: Adjust journal buttons for Chinese serrated scalpel 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
cf651ca336 SHERLOCK: Fix isPrintable for big5 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
187b28f0e5 SHERLOCK: Fix offsets in Chinese journal for serrated scalpel 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
c58c5cb86a SHERLOCK: Fix handling of big5 in journal 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
38a6cb8e8b SHERLOCK: Always use font 2 for Chinese serrated scalpel 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
8486739c00 SHERLOCK: Rearrange buttons in Chinese serrated scalpel 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
24baae1ae0 SHERLOCK: Add Chinese strings for Serrated Scalpel 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
4c782a176c SHERLOCK: Minor infoline fix for Chinese serrated scalpel 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
b6efa850aa SHERLOCK: Increase line height for Chinese object description for serrated scalpel 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
9329f7410a SHERLOCK: Fix button positions in Chinese serrated scalpel 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
3396f84269 SHERLOCK: Increase line height in Chinese serrated scalpel 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
0b9e85f93a SHERLOCK: Support Chinese object description wrapping for serrated scalpel 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
d5480c37c3 SHERLOCK: Handle scalpel big5 wrapping 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
d2b37c9dde SHERLOCK: Use common word-wrapping algorithm in journal 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
96d4f93d40 SHERLOCK: Extract word-wrapping algorithm into common file 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
5068c3253e SHERLOCK: Add skipping comments in big5 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
518b96f24f SHERLOCK: Add function for width of multibyte character 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
7daa2b5d85 SHERLOCK: Add rendering of Serrated scalpel chinese texts 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
c4da7fffdf SHERLOCK: Skip images with negative sizes 2023-02-28 00:40:25 +01:00
Vladimir Serbinenko
e53cc43272 SHERLOCK: Enable Chinese serrated scalpel 2023-02-28 00:40:25 +01:00
Donovan Watteau
4a586e4909 SHERLOCK: Use MSVC_PRINTF when GCC_PRINTF is used 2022-11-29 01:37:16 +01:00
Eugene Sandulenko
ae779b2a29
JANITORIAL: Code formatting 2022-11-29 00:20:16 +01:00