/** * Store the facts pertaining to a scene change. */ void SetNewScene(SCNHANDLE scene, int entrance, int transition) { if (!bCuttingScene && TinselV2) WrapScene(); // If we're loading from the GMM, load the scene as a delayed one if (loadingFromGMM) { DelayedScene.scene = scene; DelayedScene.entry = entrance; DelayedScene.trans = transition; loadingFromGMM = false; return; } // If CD change will be required, stick in the scene change scene if (CdNumber(scene) != GetCurrentCD()) { // This scene gets delayed DelayedScene.scene = scene; DelayedScene.entry = entrance; DelayedScene.trans = transition; NextScene.scene = hCdChangeScene; NextScene.entry = CdNumber(scene) - '0'; NextScene.trans = TRANS_FADE; return; } if (HookScene.scene == 0 || bCuttingScene) { // This scene comes next NextScene.scene = scene; NextScene.entry = entrance; NextScene.trans = transition; } else { // This scene gets delayed DelayedScene.scene = scene; DelayedScene.entry = entrance; DelayedScene.trans = transition; // The hooked scene comes next NextScene.scene = HookScene.scene; NextScene.entry = HookScene.entry; NextScene.trans = HookScene.trans; HookScene.scene = 0; } // Workaround for "Missing Red Dragon in square" bug in Discworld 1 PSX, act IV. // This happens with the original interpreter on PSX too: the red dragon in Act IV // doesn't show up inside the square at the right time. Original game required the // player to go in and out the square until the dragon appears (wasting hours). // I'm forcing the load of the right scene by checking that the player has (or has not) the // right items: player must have Mambo the swamp dragon, and mustn't have fireworks (used on // the swamp dragon previously to "load it up"). if (TinselV1PSX && NextScene.scene == 0x1800000 && NextScene.entry == 2) { if ((IsInInventory(261, INV_1) || IsInInventory(261, INV_2)) && (!IsInInventory(232, INV_1) && !IsInInventory(232, INV_2))) NextScene.entry = 1; } }
void CdHasChanged(void) { if (bChangingForRestore) { bChangingForRestore = false; RestoreGame(-2); } else { assert(DelayedScene.scene != 0); WrapScene(); // The delayed scene can go now NextScene.scene = DelayedScene.scene; NextScene.entry = DelayedScene.entry; NextScene.trans = DelayedScene.trans; DelayedScene.scene = 0; } }
void CdHasChanged() { if (g_bChangingForRestore) { g_bChangingForRestore = false; RestoreGame(-2); } else { assert(g_DelayedScene.scene != 0); WrapScene(); // The delayed scene can go now g_NextScene.scene = g_DelayedScene.scene; g_NextScene.entry = g_DelayedScene.entry; g_NextScene.trans = g_DelayedScene.trans; g_DelayedScene.scene = 0; } }
/** * CuttingScene */ void CuttingScene(bool bCutting) { bCuttingScene = bCutting; if (!bCutting) WrapScene(); }