Commit Graph
142 Commits
Author SHA1 Message Date
Matthew Duggan 2e9d97ed0f DGDS: Use frame ms consistently for checks
Some game timing events are based on ms elapsed, but we were just getting the
current ms when it was evaluated.  This was not very consistent and could
potentially lead to weird problems, although in practice they were unlikely

Record the elapsed ms at the start of each frame so we can use the same
comparison point in every operation.
2024-11-08 20:03:48 +11:00
Eugene Sandulenko 18a44c676a DGDS: I18N: Added missing POTFILES and removed redundant includes 2024-11-08 01:25:29 +01:00
Matthew Duggan 4312a96913 DGDS: Update various strings for German RotD
Some hard-coded strings needed their own version for the German version of Rise
of the Dragon.

This fixes #15456.
2024-11-05 22:19:10 +11:00
Matthew Duggan 8d088114c0 DGDS: Implement stubs for HoC minigames 2024-11-03 08:36:25 +11:00
Filippos Karapetis 6cf43726cc DGDS: Move mini-games into a separate folder
This includes the mini arcade games, as well as games with dedicated
logic, such as the shell game in HoC

Mini games for Dragon and HoC:
- Dragon: Arcade sequence: Fighting Snake (implemented)
- Dragon: Arcade: Reservoir (implemented)
- HoC: Tank 3D arcade sequence in Chengdu (missing)
- HoC: Shell game with street gambler in Istanbul (implemented)
- HoC: Train arcade sequence after Istanbul (missing)
2024-10-30 12:03:14 +02:00
Matthew Duggan 9d7266c280 DGDS: Remove redundant null checks. PVS-Studio V560 2024-10-29 17:51:58 +11:00
Matthew Duggan 2495c1bcbc DGDS: Avoid unsigned/signed comparison. PVS-Studio V1112.
Object numbers should never be negative, but globals technically can be.
2024-10-29 17:51:58 +11:00
Matthew Duggan 50cface678 DGDS: Implement Heart of China intro natives
The full intro cinematic can now play correctly.
2024-10-27 18:25:47 +11:00
Matthew Duggan 605833246a DGDS: Fix word wrapping of dialogs to be more like original
This fixes the trailing space problem that was putting some dialogs in the
wrong place and wrapping some text too much.
2024-10-26 20:07:41 +11:00
Matthew Duggan 81ca1d6296 DGDS: Fix dialog drawing on scene change 2024-10-26 16:05:00 +11:00
Matthew Duggan 21c2612456 DGDS: Fix scene ops on scene change
In d26ee6, I changed the scene ops to always be executed to the end even if the
scene changed - this was not correct and it breaks scene 60 (police cutscene)
in Rise of the Dragon, which stores the current day into a variable - but if
run twice will leave the day as 999 after leaving.

The correct behavior is not to abort ops *only* in the case of scene change to
inventory.  All other scene changes should still abort running scene ops.
2024-10-21 23:13:38 +11:00
Matthew Duggan 36fe1cdff4 DGDS: Fix ADS execution order again
Closer inspection shows the "move to front" and "move to back" ADS ops were the
wrong way around.

Unfortunately this breaks the rendering a bit - blade's shirt flashes on the
floor of the apartment at the start of dragon.

However, it's more correct and fixes other things - eg, turning off the tap in
the apartment.  The rendering problem will need a different fix.
2024-10-16 19:52:19 +11:00
Matthew Duggan 8b5bc71a02 DGDS: Clean up scene functions a little 2024-10-16 19:51:23 +11:00
Matthew Duggan d26ee617d4 DGDS: Run scene ops to completion after scene change
This was the bug that required a workaround for the ticket vendor in Heart of
China.  The scene opened inventory (which makes the scene change) and then set
a global.  We were never setting that global as expected.

This required a slight refactor in the way the scene ops are run.
2024-10-04 16:59:48 +10:00
Matthew Duggan d7a6701a66 DGDS: Reduce unneeded hex numbers in dragon arcade code 2024-09-22 10:01:25 +03:00
Matthew Duggan 8f41c8d511 DGDS: Dragon arcade nearly complete
Code translation done, now just have to make it work
2024-09-22 10:01:25 +03:00
Matthew Duggan bf0f312d5b DGDS: More WIP dragon arcade code 2024-09-22 10:01:25 +03:00
Donovan Watteau de33c1fc06 DGDS: Fix -Wpedantic warning about double ";" 2024-08-11 16:33:53 +02:00
Matthew Duggan 342d8ab1c8 DGDS: Fix int overflow warning 2024-08-04 09:17:05 +10:00
Hubert Maier ef3b6c5fbb JANITORIAL: DGDS: Fix typos in comments/warnings 2024-08-01 20:16:37 +03:00
Filippos Karapetis 7ab947f7e0 DGDS: Fix typo in game ID check 2024-07-27 12:54:24 +03:00
Matthew Duggan f759dbb0b8 DGDS: Implement some small Willy Beamish features 2024-07-27 19:31:11 +10:00
Matthew Duggan e9f7121d7a DGDS: Implement HoC shell game 2024-07-26 21:12:08 +10:00
Matthew Duggan 403b55c5ba DGDS: Add support for both-button ops
This allows you to shoot the snakes in HoC.
2024-07-21 19:58:38 +10:00
Matthew Duggan d472339369 DGDS: Clear background when opening HoC inventory zoom
This is also done in the original because the zoom box uses a different palette
to the game.
2024-07-20 13:56:04 +10:00
Matthew Duggan dbb1b856ce DGDS: Implement HoC inventory give-to and swap-char buttons
A little closer to the original rendering, still need to fix the buttons
themselves.
2024-07-20 13:56:04 +10:00
Matthew Duggan 2f284fcc12 DGDS: Implement drop operation for HoC swap char button 2024-07-20 09:44:20 +10:00
Filippos Karapetis 806c54b356 DGDS: Add temporary hack for the snake scene in HoC 2024-07-18 12:36:01 +03:00
Filippos Karapetis dbb1a6a014 DGDS: Add a hack and notes when dragging money to the ticket agent (HoC) 2024-07-18 10:27:24 +03:00
Filippos Karapetis b3d55de276 DGDS: Add handling for the HoC train mini-game menu 2024-07-18 03:46:37 +03:00
Filippos Karapetis f2033f1c7a DGDS: Add workarounds for the missing shell game op in HoC 2024-07-18 02:20:41 +03:00
Filippos Karapetis 8b93ad65db DGDS: Add comments for HoC shell game 2024-07-18 01:30:56 +03:00
Filippos Karapetis fd0ffd7904 DGDS: Add a placeholder for the shell game in HoC 2024-07-18 01:28:18 +03:00
Filippos Karapetis ba0b8e7781 DGDS: Handle cases where a dialog is requested without arguments
This happens for example when right-clicking in Kathmandu
2024-07-18 01:27:37 +03:00
Filippos Karapetis b067153ecc DGDS: Implement the tank mini-game handling menu for HoC 2024-07-17 23:30:55 +03:00
Filippos Karapetis e782adb3fb DGDS: Add the "trigger" console command 2024-07-17 23:29:26 +03:00
Matthew Duggan e20d66ffed DGDS: Fix small issues identified by Coverity 2024-07-15 17:09:42 +10:00
Matthew Duggan ef75492ca6 DGDS: Actually render talking heads 2024-07-14 11:54:55 +10:00
Matthew Duggan bfeac18bc7 DGDS: Implement more of HoC talking heads 2024-07-14 11:40:15 +10:00
Matthew Duggan fdfbdb8433 DGDS: Add more char swap features for HoC 2024-07-13 21:03:34 +10:00
Matthew Duggan df603d1b73 DGDS: Add character switch button for HoC
Implementation is a bit hacky but gets the game playable for now.
2024-07-13 19:47:47 +10:00
Matthew Duggan 7ab57607da DGDS: Add keyboard navigation for menus
Also add ability to select dialog options on keyboard.
2024-07-12 22:01:04 +10:00
Matthew Duggan 761d144709 DGDS: Keyboard navigation for dialogs 2024-07-10 22:32:17 +10:00
Matthew Duggan 6c543ea22f DGDS: Fix variable shadow warning 2024-07-10 08:52:23 +10:00
Filippos Karapetis cb88bd6a9a DGDS: Silence a warning about a reusable global in Willy
This reduces the spam in the console, and will aid in debugging
2024-07-09 23:40:02 +03:00
Matthew Duggan 7c0b4971d3 DGDS: Willy Beamish loading improvements
* Add support for new type of op in Willy Beamish scene data
* Flesh out the game globals
2024-07-09 21:38:55 +10:00
Matthew Duggan 61ab4902fb DGDS: Fix willy scene and dialog parsing slightly
First scene now sort of works, still quite buggy.
2024-07-08 20:54:00 +10:00
Matthew Duggan 76a2745922 DGDS: Small cleanups 2024-07-07 16:35:58 +10:00
Matthew Duggan eeecc8dc5b DGDS: Add various heart of china features
Most dialogs now render correctly and the game is partly playable.  Still a
bunch of work to do for inventory and menus to render correctly.

Added loading for TDS (talking head) data structures too, but they are not yet
used.
2024-07-07 16:15:30 +10:00
Filippos Karapetis 679e34ca70 DGDS: Remove unnecessary casts for game globals 2024-07-07 03:27:39 +03:00