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 + tools/MovieSettings.py | 26 ++++++++++++++++++++++---- 3 files changed, 50 insertions(+), 22 deletions(-) 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]; }; diff --git a/tools/MovieSettings.py b/tools/MovieSettings.py index 1a6bbaf..1269e5c 100644 --- a/tools/MovieSettings.py +++ b/tools/MovieSettings.py @@ -9,8 +9,9 @@ class Settings(object): def add_sound(self, delay, sound_id): self.sounds.append((delay, sound_id)) - def __init__(self): + def __init__(self, widescreen): self.banners = [] + self.widescreen = widescreen def add_banner(self, name): b = self.Banner(name) @@ -28,10 +29,10 @@ class Settings(object): banner_offsets.append(offset) b_header1 = 'xxxx' # will be replaced later - b_header2 = struct.pack('>I', len(b.sounds)) + b_header2 = struct.pack('>bxxxI', 1 if self.widescreen else 0, len(b.sounds)) b_sounds = map(lambda x: struct.pack('>II', *x), b.sounds) - offset += 8 + (len(b_sounds) * 8) + offset += 12 + (len(b_sounds) * 8) b_data = [b_header1, b_header2] b_data.extend(b_sounds) @@ -64,7 +65,7 @@ class Settings(object): -s = Settings() +s = Settings(widescreen=False) b = s.add_banner('/CS/Opening1.arc') b = s.add_banner('/CS/Opening3.arc') @@ -81,4 +82,21 @@ b = s.add_banner('/CS/Opening11.arc') data = s.export() open('Opening.cs', 'wb').write(data) +s = Settings(widescreen=True) + +b = s.add_banner('/CS/Kamek1_2.arc') +b = s.add_banner('/CS/Kamek3_4.arc') +b = s.add_banner('/CS/Kamek5_6.arc') +b = s.add_banner('/CS/Kamek7_8.arc') +b = s.add_banner('/CS/Kamek9_10.arc') +b = s.add_banner('/CS/Kamek11.arc') +b = s.add_banner('/CS/Kamek12.arc') +b = s.add_banner('/CS/Kamek13_14.arc') +b = s.add_banner('/CS/Kamek15_16.arc') +b = s.add_banner('/CS/Kamek17.arc') + + +data = s.export() +open('Kamek.cs', 'wb').write(data) + -- cgit v1.2.3