SCI: Fix LB2 CD Wolf and O'Riley actor loops

This commit is contained in:
sluicebox 2022-08-19 07:12:29 -04:00
parent 78a6a93faf
commit d1cf428dec

View File

@ -9446,6 +9446,43 @@ static const uint16 laurabow2CDPatchFixYvetteTutResponse[] = {
PATCH_END
};
// In the CD version, Wolf stands facing the wrong direction in most scenes.
// O'Riley also does this in the Old Masters Gallery. Their views were reduced
// from nine loops to five in the CD version, but the scripts weren't updated.
// They still set the actors' loops to eight instead of four. kAnimate adjusts
// invalid cels and the result is usually the last cel in the last loop, which
// is the actor standing facing north west.
//
// We fix this by setting the correct loop in the CD version so that Wolf and
// O'Riley face the direction the scripts request like in the floppy versions.
// This patch is only enabled in the CD version since the scripts don't change.
//
// Applies to: English CD
// Responsible methods: sPartysOver:changeState, rm400:init, sHeimlichShoos:changeState
// sEnterNorth:changeState, rm500:init, rm650:init
static const uint16 laurabow2CDSignatureFixMuseumActorLoops1[] = {
0x38, SIG_SELECTOR16(setLoop), // pushi setLoop
0x78, // push1
0x39, SIG_MAGICDWORD, 0x08, // pushi 08 [ standing loop in floppy ]
0x38, SIG_SELECTOR16(setCel), // pushi setCel
SIG_END
};
static const uint16 laurabow2CDSignatureFixMuseumActorLoops2[] = {
0x39, SIG_SELECTOR8(loop), // pushi loop
0x78, // push1
SIG_MAGICDWORD,
0x39, 0x08, // pushi 08 [ standing loop in floppy ]
0x39, SIG_SELECTOR8(cel), // pushi cel
SIG_END
};
static const uint16 laurabow2CDPatchFixMuseumActorLoops[] = {
PATCH_ADDTOOFFSET(+4),
0x39, 0x04, // pushi 04 [ standing loop in CD ]
PATCH_END
};
// When entering the main musem party room (w/ the golden Egyptian head), Laura
// is walking a bit into the room automatically. If you press a mouse button
// while this is happening, you will get stuck inside that room and won't be
@ -10291,11 +10328,15 @@ static const SciScriptPatcherEntry laurabow2Signatures[] = {
{ true, 110, "CD: fix intro music", 1, laurabow2CDSignatureFixIntroMusic, laurabow2CDPatchFixIntroMusic },
{ true, 350, "CD/Floppy: museum party fix entering south 1/2", 1, laurabow2SignatureMuseumPartyFixEnteringSouth1, laurabow2PatchMuseumPartyFixEnteringSouth1 },
{ true, 350, "CD/Floppy: museum party fix entering south 2/2", 1, laurabow2SignatureMuseumPartyFixEnteringSouth2, laurabow2PatchMuseumPartyFixEnteringSouth2 },
{ false, 355, "CD: fix museum actor loops", 2, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops },
{ true, 430, "CD/Floppy: make wired east door persistent", 1, laurabow2SignatureRememberWiredEastDoor, laurabow2PatchRememberWiredEastDoor },
{ true, 430, "CD/Floppy: fix wired east door", 1, laurabow2SignatureFixWiredEastDoor, laurabow2PatchFixWiredEastDoor },
{ true, 448, "CD/Floppy: fix armor hall door pathfinding", 1, laurabow2SignatureFixArmorHallDoorPathfinding, laurabow2PatchFixArmorHallDoorPathfinding },
{ false, 400, "CD: fix museum actor loops", 4, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops },
{ false, 420, "CD: fix museum actor loops", 1, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops },
{ true, 450, "Floppy: fix dagger case error", 2, laurabow2SignatureFixDaggerCaseError, laurabow2PatchFixDaggerCaseError },
{ true, 460, "CD/Floppy: fix crate room east door lockup", 1, laurabow2SignatureFixCrateRoomEastDoorLockup, laurabow2PatchFixCrateRoomEastDoorLockup },
{ false, 500, "CD: fix museum actor loops", 3, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops },
{ true, 2660, "CD/Floppy: fix elevator lockup", 1, laurabow2SignatureFixElevatorLockup, laurabow2PatchFixElevatorLockup },
{ true, 550, "CD/Floppy: fix back rub east entrance lockup", 1, laurabow2SignatureFixBackRubEastEntranceLockup, laurabow2PatchFixBackRubEastEntranceLockup },
{ true, 550, "CD/Floppy: fix disappearing desk items", 1, laurabow2SignatureFixDisappearingDeskItems, laurabow2PatchFixDisappearingDeskItems },
@ -10304,6 +10345,7 @@ static const SciScriptPatcherEntry laurabow2Signatures[] = {
{ true, 448, "CD/Floppy: handle armor hall room events", 1, laurabow2SignatureHandleArmorRoomEvents, laurabow2PatchHandleArmorRoomEvents },
{ true, 600, "Floppy: fix bugs with meat", 1, laurabow2FloppySignatureFixBugsWithMeat, laurabow2FloppyPatchFixBugsWithMeat },
{ true, 600, "CD: fix bugs with meat", 1, laurabow2CDSignatureFixBugsWithMeat, laurabow2CDPatchFixBugsWithMeat },
{ false, 650, "CD: fix museum actor loops", 1, laurabow2CDSignatureFixMuseumActorLoops2, laurabow2CDPatchFixMuseumActorLoops },
{ true, 480, "CD: fix act 5 finale music", 1, laurabow2CDSignatureFixAct5FinaleMusic, laurabow2CDPatchFixAct5FinaleMusic },
{ true, 28, "disable speed test", 1, sci11SpeedTestSignature, sci11SpeedTestPatch },
{ true, 120, "CD: disable intro volume change in text mode", 1, laurabow2CDSignatureIntroVolumeChange, laurabow2CDPatchIntroVolumeChange },
@ -24054,6 +24096,9 @@ void ScriptPatcher::processScript(uint16 scriptNr, SciSpan<byte> scriptData) {
break;
case GID_LAURABOW2:
if (g_sci->isCD()) {
// Enable patches due views having fewer loops in the CD version
enablePatch(signatureTable, "CD: fix museum actor loops");
// Enables Dual mode patches (audio + subtitles at the same time) for Laura Bow 2
enablePatch(signatureTable, "CD: audio + text support");
}