From e1f58a4b2b7cd3c696bb4125f6c0a665b9324430 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 2 Sep 2012 04:44:26 +0200 Subject: added support for wide/non-wide cutscenes, might not even be useful for us, oh well --- src/cutScene.cpp | 45 +++++++++++++++++++++++++++------------------ src/cutScene.h | 1 + 2 files changed, 28 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/cutScene.cpp b/src/cutScene.cpp index f60122f..cde9c2c 100644 --- a/src/cutScene.cpp +++ b/src/cutScene.cpp @@ -75,21 +75,13 @@ int dScCutScene_c::onExecute() { // deal with loading first // what do we want to load? - int loadBegin, loadEnd; - if (nextScene == 0) { - loadBegin = 0; - loadEnd = 1; - } else { - loadBegin = ((currentScene + 1) > nextScene) ? (currentScene + 1) : nextScene; - loadEnd = data->sceneCount; - } + if (currentScene >= 0 || nextScene >= 0) { + int whatToLoad = (nextScene >= 0) ? nextScene : (currentScene + 1); - for (int i = loadBegin; i < loadEnd; i++) { - sceneLoaders[i].load(data->scenes[i]->sceneName); + sceneLoaders[whatToLoad].load(data->scenes[whatToLoad]->sceneName); } - // now, do all other processing if (currentScene >= 0) { @@ -135,15 +127,32 @@ int dScCutScene_c::onExecute() { layout->disableAllAnimations(); layout->enableNonLoopAnim(0); - if (IsWideScreen()) { - layout->clippingEnabled = true; - layout->clipX = 66; - layout->clipY = 0; - layout->clipWidth = 508; - layout->clipHeight = 456; - layout->layout.rootPane->scale.x = 0.794f; + if (data->scenes[nextScene]->widescreenFlag) { + // Native on 16:9, letterboxed on 4:3 + if (!IsWideScreen()) { + layout->clippingEnabled = true; + layout->clipX = 0; + layout->clipY = 52; + layout->clipWidth = 640; + layout->clipHeight = 352; + layout->layout.rootPane->scale.x = 0.7711f; + layout->layout.rootPane->scale.y = 0.7711f; + } + } else { + // Native on 4:3, black bars on 16:9 + if (IsWideScreen()) { + layout->clippingEnabled = true; + layout->clipX = 66; + layout->clipY = 0; + layout->clipWidth = 508; + layout->clipHeight = 456; + layout->layout.rootPane->scale.x = 0.794f; + } } + layout->execAnimations(); + layout->update(); + OSReport("Loaded scene %d\n", currentScene); nextScene = -1; diff --git a/src/cutScene.h b/src/cutScene.h index 5845a86..c377347 100644 --- a/src/cutScene.h +++ b/src/cutScene.h @@ -42,6 +42,7 @@ struct dMovieSound_s { struct dMovieScene_s { char *sceneName; + u8 widescreenFlag; u32 soundCount; dMovieSound_s sounds[1]; }; -- cgit v1.2.3