Re-introduced the ability to skip the title scenes in Discworld 1. Since the exact scene numbers differed between language versions, this new version simply relies on skipping the first four screens - hopefully, none of the various versions will have any extra title screens.

svn-id: r40196
This commit is contained in:
Paul Gilbert
2009-04-29 10:37:00 +00:00
parent eaf22dc66c
commit 4a2e5bb793
3 changed files with 16 additions and 31 deletions
+9 -1
View File
@@ -112,6 +112,9 @@ static bool ShowPosition = false; // Set when showpos() has been called
SCNHANDLE newestScene = 0;
int sceneCtr = 0;
static int initialMyEscape;
static SCNHANDLE SceneHandle = 0; // Current scene handle - stored in case of Save_Scene()
static bool bWatchingOut = false;
@@ -152,10 +155,15 @@ static void SceneTinselProcess(CORO_PARAM, const void *param) {
CORO_BEGIN_CONTEXT;
INT_CONTEXT *pic;
const TP_INIT *pInit;
int myEscape;
CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx);
// The following myEscape value setting is used for enabling title screen skipping in DW1
if (TinselV1 && (sceneCtr == 1)) initialMyEscape = GetEscEvents();
_ctx->myEscape = (TinselV1 && (sceneCtr < 4)) ? initialMyEscape : 0;
// get the stuff copied to process when it was created
_ctx->pInit = (const TP_INIT *)param;
assert(_ctx->pInit);
@@ -167,7 +175,7 @@ static void SceneTinselProcess(CORO_PARAM, const void *param) {
NOPOLY, // No polygon
0, // No actor
NULL, // No object
0);
_ctx->myEscape);
CORO_INVOKE_1(Interpret, _ctx->pic);
if (_ctx->pInit->event == CLOSEDOWN || _ctx->pInit->event == LEAVE_T2)
+6
View File
@@ -108,6 +108,7 @@ extern int NewestSavedGame(void);
// in SCENE.CPP
extern void setshowpos(void);
extern int sceneCtr;
// in TINSEL.CPP
extern void SetCdChangeScene(SCNHANDLE hScene);
@@ -1436,6 +1437,9 @@ void NewScene(CORO_PARAM, SCNHANDLE scene, int entrance, int transition) {
else
GetControl(CONTROL_STARTOFF);
if (TinselV1)
++sceneCtr;
// Prevent code subsequent to this call running before scene changes
if (g_scheduler->getCurrentPID() != PID_MASTER_SCR)
CORO_KILL_SELF();
@@ -2406,7 +2410,9 @@ void FnRestartGame(void) {
// TODO: Tinsel 2 comments out the 2 calls, but I'm not sure that this should be done
StopMidi();
StopSample();
bRestart = true;
sceneCtr = 0;
}
/**
+1 -30
View File
@@ -220,36 +220,7 @@ void KeyboardProcess(CORO_PARAM, const void *) {
continue;
case Common::KEYCODE_ESCAPE:
#if 0
if (!TinselV2) {
// WORKAROUND: For Discworld 1, check if any of the starting logo screens are
// active, and if so manually skip to the title screen, allowing them to be bypassed
int sceneOffset = (_vm->getFeatures() & GF_SCNFILES) ? 1 : 0;
int sceneNumber = (GetSceneHandle() >> SCNHANDLE_SHIFT) - sceneOffset;
if ((g_language == TXT_GERMAN) &&
((sceneNumber >= 25 && sceneNumber <= 27) || (sceneNumber == 17))) {
// Skip to title screen
// It seems the German CD version uses scenes 25,26,27,17 for the intro,
// instead of 13,14,15,11; also, the title screen is 11 instead of 10
SetNewScene((11 + sceneOffset) << SCNHANDLE_SHIFT, 1, TRANS_CUT);
} else if ((sceneNumber >= 13) && (sceneNumber <= 15) || (sceneNumber == 11)) {
// Skip to title screen
SetNewScene((10 + sceneOffset) << SCNHANDLE_SHIFT, 1, TRANS_CUT);
} else {
// Not on an intro screen, so process the key normally
ProcessKeyEvent(PLR_ESCAPE);
}
} else {
// Running Discworld 2, so process the key normally
ProcessKeyEvent(PLR_ESCAPE);
}
#else
// The above workaround is used to skip the title screens in DW1, but it can throw assertions
// in certain versions of the game, e.g. the multilingual version with English speech and several
// subtitles (French, German, Italian, Spanish)
// FIXME: Add that workaround again, once we make sure it works properly in all versions of the game
ProcessKeyEvent(PLR_ESCAPE);
#endif
ProcessKeyEvent(PLR_ESCAPE);
continue;
#ifdef SLOW_RINCE_DOWN