Commit graph

1162 commits

Author SHA1 Message Date
Eugene Sandulenko
b34411bc23
ENGINES: [a-k]*: Switched Debug Channels from bitfield to sequential enum 2025-02-22 15:51:24 +01:00
antoniou79
0380f01e07 BLADERUNNER: Fix 2x scaling for non-interactive demo
Fixes bug https://bugs.scummvm.org/ticket/15713
2025-01-24 13:36:04 +02:00
antoniou79
f48703b090 BLADERUNNER: Fix duplicate vertices in merged polygons
Some merged polygons for obstacles would get duplicate vertices

This could result in bad pathfinding and actors being stuck while walking to their destinations.
A soft lock could occur, for example in RC02, with Runciter walking to his desk to get
the camera disc, if he started at a point like -15.78f, -1238.894287f, 108432.14f
(ie. Actor_Set_At_XYZ(kActorRunciter, -15.78f, -1238.894287f, 108432.14f, Actor_Query_Facing_1024(kActorRunciter));)

Same could happen to the player's actor, but in Runciter's case from the above example,
the player loses control until Runciter gets the disc and gives it to McCoy, but since
Runctiter never reaches the waypoint to get the disc, the game is soft locked.

This will not automatically fix a scene's obstacles loaded from an old saved game.
For those cases, the player will have to exit the scene and re-enter for the obstacles
to be properly recalculated.
2024-12-30 22:21:58 +02:00
Hubert Maier
f874c42eca
JANITORIAL: BLADERUNNER: Fix typo 2024-12-25 17:10:07 +02:00
Eugene Sandulenko
481492eb89 BLADERUNNER: The engine does not really use mt32emu component 2024-12-25 00:34:39 +01:00
Eugene Sandulenko
d780708c96 ENGINES: Add mt32emu as a feature and component
Add it to engines that have MIDI playback.

This essentially compiles the emulator only when an engine that
can potentially use it (e.g. MIDI) is enabled
2024-12-25 00:34:39 +01:00
Eugene Sandulenko
fdecb6afca ENGINES: Add components to configure.engine's explanatory comment 2024-12-25 00:34:39 +01:00
antoniou79
eea0cfbbf1 BLADERUNNER: Initialize color in SliceRenderer::drawShadowPolygon()
Prevents compiler warning for potential uninitialized use of color

This would happen if getPixel() dealt with a Surface whose bytePerPixel would be a value other than 1, 2 or 4. So highly unlikely.
2024-12-19 19:15:28 +02:00
Le Philousophe
3e433ad943 BLADERUNNER: Garbage collect the unused pages
This avoids to accmulate all the pages from the previous scenes and
filling the memory on platform without much (like Wii).

This is implemented by adding a doubly circular linked list to the Page
structure.
Every page is moved at the end of the list when it is accessed and a
garbage collection process happens everytime a new page is allocated.
At this time, all pages (starting by the end) unused for 60 seconds are
discarded.
2024-12-11 13:24:50 +01:00
Le Philousophe
a81bfbe805 BLADERUNNER: Avoid memory leak in overlays
Sometimes, the overlay is played twice in a row which causes the player
to reload the stream.
2024-12-11 13:24:50 +01:00
Le Philousophe
5be3b9e1d7 BLADERUNNER: Don't read pixels using READ_UINT32
This breaks when the pixel format is 16 bits and we are reading the last
pixel of the surface.
2024-12-11 13:24:50 +01:00
antoniou79
91d6bc1106 BLADERUNNER: Use assert for failed malloc for thumbnail data
Instead of check for nullptr
2024-12-08 19:51:47 +02:00
antoniou79
00b977816f BLADERUNNER: Check for failed malloc for thumbnail data 2024-12-08 19:11:36 +02:00
Le Philousophe
76b61e398e BLADERUNNER: Don't allocate the thumbnail before needing it
Graphics::loadThumbnail will overwrite it and it creates a memory leak.
2024-12-07 21:20:18 +02:00
antoniou79
d309d02e64 BLADERUNNER: Clarifications for duplicated branches
And also minor fixes to adhere closely to the original code
2024-11-06 17:25:08 +02:00
D G Turner
5200524587 BLADERUNNER: Fix Duplicated Branches GCC Compiler Warnings 2024-11-06 13:56:58 +00:00
Eugene Sandulenko
c08c2af410
BLADERUNNER: Fix warning about unused variable 2024-10-24 15:07:01 +02:00
sluicebox
4200d6575c ALL: Return result from MetaEngine::removeSaveState 2024-10-18 09:41:03 +03:00
Hubert Maier
9bb9f341cb JANITORIAL: BLADERUNNER: Fix typos 2024-09-11 11:03:48 +03:00
Le Philousophe
65c0429045 ALL: Declare the Game not implemented message in only one place 2024-08-17 17:51:06 +03:00
antoniou79
c7b8025e4e BLADERUNNER: Add debug command to show initial random seed
Also reveals the nature of the variable characters for the game

Debug command is "cheat"
2024-08-14 14:53:26 +03:00
antoniou79
eff108fdff BLADERUNNER: Fix soft lock case for Izo at HC01
Fixes bug #15321

Prevents a soft lock if Izo is clicked for his final question before he reaches his waypoint outside of his pawn shop in Act 2.
This is also an original game bug.
2024-08-14 14:10:44 +03:00
Eugene Sandulenko
caacb4d1e4
ENGINES: "Missing game code" -> "Game not implemented" for unsupported games
As suggested by lephilosouphe, we show this to the end users on attempt
to run unsupported gamesA.
2024-08-13 23:39:57 +02:00
antoniou79
4791bb0646 BLADERUNNER: Fix random seed generation for new game
Generates a new seed for random numbers at the exact point when a new game starts to initialize

Additionally, this command will use a custom seed, if any (set from ScummVM Global Options), for the new game.
And, this avoids the issue of intermediate calculations of random numbers, during setup() initializations
(via initScript.SCRIPT_Initialize_Game()) or in KIA menu, eg. when adjusting speech volume, before starting a new game,
which would result in the new game starting with a different seed than the one set from ScummVM Global Options.
2024-08-09 20:33:19 +03:00
antoniou79
4e553baca9 BLADERUNNER: Move bootparm management outside initChapterAndScene()
This fixes a (potential) crash when launching ScummVM with boot params and then starting a NEW GAME from KIA menu

Example of cmd line that would lead to crash in the above scenario: scummvm -d0 -b 4021004 bladerunner-win
2024-08-09 20:30:18 +03:00
antoniou79
94d782c27c BLADERUNNER: Maintain designers cut setting in New Game
Allow keeping the designers cut mode if the player sets it in KIA before starting a New Game

This is different from the original behavior, but the code for RC01 (a dialogue cue from the intro is intended to be skipped in designers cut mode) shows that is the intended behavior. Also, setting McCoy's mood in KIA before starting a New Game, maintains the setting, so this change is also consistent with that behavior.
2024-08-08 23:10:23 +03:00
antoniou79
ea528e81ac BLADERUNNER: CUTCONTENT: Fix untriggered easy mode for Izo
When reaching Izo with no clues to discuss, in Easy Mode, Izo takes the photo anyway

This is only enabled for Restored Content as of yet.

The steps "required" to reach Izo with no clues are:
- It's for Easy Mode only
- It's for Restored Content mode only
- Don't pick up the shell casings at Runciters (Act 1)
- Don't find Lucy's anklet jewelry via ESPER
- Don't interview Grigorian at all
- Don't pick up the dragonfly jewelry outside the Gravity lab (Act 2)
- Find the Kingston Kitchen takeout box either from the Gravity lab scene or via ESPER (Act 2)
- Don't find Sadik's face via ESPER before talking to Izo (Act 2)
- Visit Animoid Row and talk directly to Izo (don't interview the Peruvian lady nor Bullet Bob).

This case is a bit odd since, with this fix, which only applies to Easy Mode,
it's easier and faster to trigger Izo's taking the photo when McCoy has no clues,
than if he has at least one. However, a more complex logic would require
a lot of additional interference with the code, which is not desireable.
2024-08-07 14:58:04 +03:00
Hubert Maier
63b7129f12
JANITORIAL: BLADERUNNER: Fix typos in comments 2024-07-28 11:23:11 +03:00
Cameron Cawley
89c57d29ef COMMON: Move more maths functions into the Math namespace 2024-07-27 14:00:48 +03:00
Cameron Cawley
7e0dfe0081 GRAPHICS: Use custom stream callbacks for loading TTF fonts 2024-07-23 15:33:43 +01: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
Filippos Karapetis
a2dad68dda BLADERUNNER: Use true/false keywords for boolean variables 2024-05-13 09:47:29 +03:00
antoniou79
26bef51149 BLADERUNNER: Better drawing of zbuff via debugger
Avoids recycling colors which makes it more easy to understand, with the side-effect of not being very colorful
2024-01-28 15:28:04 +02:00
antoniou79
00c7e30aec BLADERUNNER: CUTCONTENT: Move lighter voiceover to KIA
This is done to avoid overlap with Gordo's performance which may be starting or have started at that time
2024-01-27 12:15:29 +02:00
antoniou79
f9429241cb BLADERUNNER: CUTCONTENT: Fix voice over calls in NR02
For Gordo's lighter
2024-01-26 23:32:28 +02:00
antoniou79
02bfbe232d BLADERUNNER: Debugger commands ammo and sound
Ammo is to show or add ammo for McCoy, sound is to play sound effects

Also made minor improvements to usability of cmdSay() and cmdMusic()
2024-01-25 22:22:35 +02:00
antoniou79
9513dfbf56 BLADERUNNER: CUTCONTENT: Sloth comment in Early Q club 2024-01-21 00:04:56 +02:00
antoniou79
4e7c7b1190 BLADERUNNER: CUTCONTENT: Alternative earring comment
For Sadik's earring in the photo

It's for cut content's normal/hard mode
or if McCoy already got the full earring comment from picking up the earring outside the lab
2024-01-21 00:04:56 +02:00
antoniou79
0f8f8447ce BLADERUNNER: CUTCONTENT: Gordo's Replicant lighter
Also restored a small variation on rat comment for localizations other than English.
2024-01-18 19:04:08 +02:00
Le Philousophe
db6fcfcc24 BLADERUNNER: 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
1e84bbae4d BLADERUNNER: Fix memory leak in AudioMixer
Coverity CID 1419822
2023-11-29 06:54:30 -08:00
sluicebox
1e546bf51d BLADERUNNER: Remove extra event arrays. PVS Studio V575
The intent was to create a Common::Array with a maximum capacity of 20.
Instead, _activeCustomEvents was a C array of 20 Common::Arrays.
The -> operator accesses the first element of a C array, so the first
Common::Array was always used.
2023-10-31 14:20:29 -07:00
Eugene Sandulenko
098c64e696
BLADERUNNER: Remove extra semicolon 2023-08-10 17:43:00 +02:00
antoniou79
6f38a68c11 BLADERUNNER: Use uppercase for overlay names
This is done for code consistency only
2023-07-29 14:25:41 +03:00
antoniou79
3f4767c41f BLADERUNNER: Check for nullptr _currentScript in SceneScript methods 2023-07-11 20:14:59 +03:00
elasota
f10e9c6082 BLADERUNNER: Fix signed/unsigned mismatch 2023-07-08 22:02:00 +03:00
antoniou79
0f7ee148ea BLADERUNNER: Methods for debugging animations 2023-07-05 14:57:58 +03:00
antoniou79
ea23048d60 BLADERUNNER: Better handling of cut overlay
Also some minor code changes (renamed a few variables and added more explanatory comments)
2023-07-05 14:29:33 +03:00