diff options
-rw-r--r-- | engines/xeen/resources.cpp | 4 | ||||
-rw-r--r-- | engines/xeen/resources.h | 2 | ||||
-rw-r--r-- | engines/xeen/worldofxeen/clouds_cutscenes.cpp | 205 | ||||
-rw-r--r-- | engines/xeen/worldofxeen/cutscenes.cpp | 8 | ||||
-rw-r--r-- | engines/xeen/worldofxeen/cutscenes.h | 2 | ||||
-rw-r--r-- | engines/xeen/worldofxeen/darkside_cutscenes.cpp | 54 | ||||
-rw-r--r-- | engines/xeen/worldofxeen/worldofxeen.cpp | 2 |
7 files changed, 195 insertions, 82 deletions
diff --git a/engines/xeen/resources.cpp b/engines/xeen/resources.cpp index 794e47c308..5cc1e77b98 100644 --- a/engines/xeen/resources.cpp +++ b/engines/xeen/resources.cpp @@ -1587,6 +1587,10 @@ const char *const EVENT_SAMPLES[6] = { "ahh.voc", "whereto.voc", "gulp.voc", "null.voc", "scream.voc", "laff1.voc" }; +const char *const CLOUDS_INTRO1 = "\xC" "00\xB" "082\x9" "040\x3" + "cKing Burlock\xB" "190\x9" "040Peasants\xB" "082\x9" "247" + "Lord Xeen\xB" "190\x9" "258Xeen's Pet\xB" "179\x9" "150Crodo"; + const char *const DARKSIDE_ENDING1 = "\n\x3" "cCongratulations\n" "\n" "Your Final Score is:\n" diff --git a/engines/xeen/resources.h b/engines/xeen/resources.h index 2439a76667..fc7ff483ac 100644 --- a/engines/xeen/resources.h +++ b/engines/xeen/resources.h @@ -564,6 +564,8 @@ extern const char *const IDENTIFY_MONSTERS; extern const char *const EVENT_SAMPLES[6]; +extern const char *const CLOUDS_INTRO1; + extern const char *const DARKSIDE_ENDING1; extern const char *const DARKSIDE_ENDING2; diff --git a/engines/xeen/worldofxeen/clouds_cutscenes.cpp b/engines/xeen/worldofxeen/clouds_cutscenes.cpp index 9c29ca73da..d9f03443c6 100644 --- a/engines/xeen/worldofxeen/clouds_cutscenes.cpp +++ b/engines/xeen/worldofxeen/clouds_cutscenes.cpp @@ -21,6 +21,7 @@ */ #include "xeen/worldofxeen/clouds_cutscenes.h" +#include "xeen/resources.h" #include "xeen/sound.h" namespace Xeen { @@ -40,53 +41,187 @@ bool CloudsCutscenes::showCloudsTitle() { SpriteResource logo[2] = { SpriteResource("logo.vga"), SpriteResource("logo1.vga") }; - sound.playFX(1); +sound.playFX(1); - for (int idx = 0; idx < 80; ++idx) { - screen.restoreBackground(); - logo[idx / 65].draw(screen, idx % 65); - screen.update(); - - switch (idx) { - case 37: - sound.playFX(0); - sound.playFX(53); - sound.playSound("fire.voc"); - break; - case 52: - case 60: - sound.playFX(3); - break; - case 64: - sound.playFX(2); - break; - case 66: - sound.playFX(52); - sound.playSound("meangro&.voc"); - break; - default: - break; - } +for (int idx = 0; idx < 80; ++idx) { + screen.restoreBackground(); + logo[idx / 65].draw(screen, idx % 65); + screen.update(); - WAIT(2); + switch (idx) { + case 37: + sound.playFX(0); + sound.playFX(53); + sound.playSound("fire.voc"); + break; + case 52: + case 60: + sound.playFX(3); + break; + case 64: + sound.playFX(2); + break; + case 66: + sound.playFX(52); + sound.playSound("meangro&.voc"); + break; + default: + break; } - screen.restoreBackground(); - screen.update(); - WAIT(30); + WAIT(2); +} - screen.fadeOut(8); - logo[0].clear(); - logo[1].clear(); +screen.restoreBackground(); +screen.update(); +WAIT(30); - return true; +screen.fadeOut(8); +logo[0].clear(); +logo[1].clear(); + +return true; } bool CloudsCutscenes::showCloudsIntro() { - // TODO EventsManager &events = *_vm->_events; + Screen &screen = *_vm->_screen; Sound &sound = *_vm->_sound; + SpriteResource stars("stars.vga"), intro1("intro1.vga"), + lake("lake.vga"), xeen("xeen.vga"), wizTower("wiztower.vga"), + wizTower2("wiztwer2.vga"), lake2("lake2.vga"), lake3("lake3.vga"), + xeen1("xeen1.vga"); + + // Show the production splash screen sound.playSong("mm4theme.m"); + screen.loadBackground("jvc.raw"); + screen.loadPalette("mm4.pal"); + screen.update(); + screen.fadeIn(); + WAIT(30); + screen.fadeOut(8); + + // Clouds of Xeen title with vertically scrolling background + screen.loadPalette("intro.pal"); + screen.loadBackground("blank.raw"); + screen.saveBackground(); + stars.draw(screen, 0); + stars.draw(screen, 1, Common::Point(160, 0)); + screen.loadPage(0); + intro1.draw(screen, 0); + screen.loadPage(1); + + bool fadeFlag = true; + for (int yCtr = SCREEN_HEIGHT, yScroll = 0, xeenCtr = -1; yCtr > 0; --yCtr, ++yScroll) { + screen.vertMerge(yScroll); + if (yCtr < 160) { + xeen.draw(screen, 0); + } + else if (yCtr < 100) { + xeen.draw(screen, 0); + if (++xeenCtr < 14) + xeen1.draw(screen, xeenCtr); + } + screen.update(); + + if (fadeFlag) { + screen.fadeIn(); + fadeFlag = false; + } + + WAIT(1); + } + + // Remainder of vertical scrolling of background + screen.restoreBackground(); + intro1.draw(screen, 0); + screen.loadPage(0); + lake.draw(screen, 0); + screen.loadPage(1); + + bool drawFlag = false; + for (int yCtr = SCREEN_HEIGHT - 1, yScroll = 1, lakeCtr = 0; yCtr > 0; --yCtr, ++yScroll) { + screen.vertMerge(yScroll); + + if (yCtr < 95) { + if (++lakeCtr >= 44 || drawFlag) { + lakeCtr = 0; + drawFlag = true; + } else { + lake3.draw(screen, lakeCtr, Common::Point(0, yCtr)); + } + } + + xeen.draw(screen, 0); + screen.update(); + WAIT(1); + } + + screen.freePages(); + + // Flying creatures moving horizontally + lake.draw(screen, 0); + screen.saveBackground(); + + int frameNum = 0; + events.updateGameCounter(); + for (int idx = 0; idx < 100; ++idx) { + frameNum = (frameNum + 1) % 43; + screen.restoreBackground(); + lake2.draw(screen, frameNum, Common::Point(0, 0), SPRFLAG_800); + WAIT(1); + } + + // Zoom in on a closeup of the wizardry tower + const int XLIST1[16] = { 0, 5, 10, 15, 20, 25, 30, 35, 40, 44, 48, 52, 56, 60, 64, 68 }; + const int XLIST2[16] = { 160, 155, 150, 145, 140, 135, 130, 125, 120, 114, 108, 102, 96, 90, 84, 78 }; + const int YLIST[23] = { 0, 6, 12, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50, 51 }; + + for (int idx = 15; idx >= 0; --idx) { + events.updateGameCounter(); + + screen.restoreBackground(); + lake2.draw(screen, frameNum, Common::Point(0, 0), SPRFLAG_800); + frameNum = (frameNum + 1) % 43; + wizTower.draw(screen, 0, Common::Point(XLIST1[idx], YLIST[idx]), 0, idx); + wizTower.draw(screen, 1, Common::Point(XLIST2[idx], YLIST[idx]), 0, idx); + screen.update(); + WAIT(1); + } + + // Cloaked figure walks horizontally + wizTower.draw(screen, 0); + wizTower.draw(screen, 1, Common::Point(160, 0)); + screen.saveBackground(); + + for (int idx = 0; idx < 39; ++idx) { + screen.restoreBackground(); + wizTower2.draw(screen, idx); + screen.update(); + + WAIT(2); + } + + screen.fadeOut(); + lake2.clear(); + lake3.clear(); + xeen1.clear(); + + // + const char *const VOCS[14] = { + "crodo1.voc", "crodo2.voc", "iamking.voc", "crodo3.voc", + "ya1.voc", "crodo4a.voc", "crodo4b.voc", "crodo4c.voc", + "xeenlaff.voc", "tiger2&.voc", "crodo5.voc", "crodo6.voc", + "xeenlaff.voc", "tiger2&.voc" + }; + SpriteResource groupo("groupo.vga"), group("group.vga"), crodo("crodo.vga"); + + groupo.draw(screen, 0); + groupo.draw(screen, 1, Common::Point(160, 0)); + crodo.draw(screen, 0, Common::Point(0, -5)); + screen._windows[0].writeString(CLOUDS_INTRO1); + + // TODO events.wait(5000); return true; diff --git a/engines/xeen/worldofxeen/cutscenes.cpp b/engines/xeen/worldofxeen/cutscenes.cpp index 701adb6833..971070487f 100644 --- a/engines/xeen/worldofxeen/cutscenes.cpp +++ b/engines/xeen/worldofxeen/cutscenes.cpp @@ -27,8 +27,10 @@ namespace Xeen { static const char *SUBTITLE_LINE = "\xC" "35\x3" "c\xB" "190\x9" "000%s"; -void Cutscenes::resetSubtitles() { - _subtitleLineNum = _subtitleSize = 0; +void Cutscenes::resetSubtitles(uint lineNum, uint defaultSize) { + _subtitleLineNum = lineNum; + _subtitleSize = defaultSize; + recordTime(); } void Cutscenes::showSubtitles(uint windowIndex) { @@ -37,7 +39,7 @@ void Cutscenes::showSubtitles(uint windowIndex) { if (sound._soundOn || _vm->shouldQuit()) { // Sound is on, so subtitles aren't needed - resetSubtitles(); + resetSubtitles(0, 0); } else { if (timeElapsed() > 1) { ++_subtitleSize; diff --git a/engines/xeen/worldofxeen/cutscenes.h b/engines/xeen/worldofxeen/cutscenes.h index 842b97304d..f4cb18e9c2 100644 --- a/engines/xeen/worldofxeen/cutscenes.h +++ b/engines/xeen/worldofxeen/cutscenes.h @@ -49,7 +49,7 @@ protected: /** * Resets the subtitles position */ - void resetSubtitles(); + void resetSubtitles(uint lineNum, uint defaultSize = 1); /** * Free subtitles diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.cpp b/engines/xeen/worldofxeen/darkside_cutscenes.cpp index 05175158ac..8624c2c212 100644 --- a/engines/xeen/worldofxeen/darkside_cutscenes.cpp +++ b/engines/xeen/worldofxeen/darkside_cutscenes.cpp @@ -256,9 +256,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { WAIT(1); _subtitles.load("special.bin"); - recordTime(); - resetSubtitles(); - _subtitleLineNum = 21; + resetSubtitles(21, 0); // Alamar stands up for (int idx = 74; idx > 20; idx -= 2) { @@ -433,9 +431,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { screen.fadeIn(); WAIT(2); - resetSubtitles(); - _subtitleLineNum = 22; - recordTime(); + resetSubtitles(22, 0); for (int idx = 0; idx < 45; ++idx) { screen.restoreBackground(); @@ -463,10 +459,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { // Yep, that's my name, don't wear it out SpriteResource sc08("sc08.end"); - resetSubtitles(); - recordTime(); - _subtitleLineNum = 23; - _subtitleSize = 1; + resetSubtitles(23); sound.playFX(0); for (int idx = 0; idx < 15; ++idx) { @@ -493,10 +486,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { screen.saveBackground(); screen.update(); - resetSubtitles(); - recordTime(); - _subtitleLineNum = 24; - _subtitleSize = 1; + resetSubtitles(24); for (int idx = 0; idx < 15; ++idx) { if (idx == 2) @@ -517,10 +507,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { // Nor do you! SpriteResource sc10("sc10.end"); - resetSubtitles(); - recordTime(); - _subtitleLineNum = 25; - _subtitleSize = 1; + resetSubtitles(25); for (int idx = 0; idx < 15; ++idx) { if (idx == 3) @@ -588,10 +575,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { // I'm ready for you this time SpriteResource sc13("sc13.end"); - resetSubtitles(); - recordTime(); - _subtitleLineNum = 26; - _subtitleSize = 1; + resetSubtitles(26); sound.setMusicVolume(48); for (int idx = 0; idx < 16; ++idx) { @@ -616,10 +600,8 @@ bool DarkSideCutscenes::showDarkSideEnding() { // This fight will be your last SpriteResource sc14("sc14.end"); - resetSubtitles(); - recordTime(); - _subtitleLineNum = 27; - _subtitleSize = 1; + resetSubtitles(27); + screen.fadeOut(); screen.loadBackground("blank.raw"); screen.saveBackground(); @@ -671,10 +653,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { // I can not fail SpriteResource sc16("sc16.end"); - resetSubtitles(); - recordTime(); - _subtitleLineNum = 28; - _subtitleSize = 1; + resetSubtitles(28); screen.loadBackground("scene4.raw"); screen.loadPage(0); @@ -930,10 +909,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { // Corak speaking here. It seems this was ditched in favor of the // following closeup of him speaking "I do" SpriteResource sc25("sc25a.end"); - resetSubtitles(); - recordTime(); - _subtitleLineNum = 29; - _subtitleSize = 1; + resetSubtitles(29); screen.loadBackground("sc250001.raw"); screen.saveBackground(); @@ -958,10 +934,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { SpriteResource("sc26a.end"), SpriteResource("sc26b.end"), SpriteResource("sc26c.end"), SpriteResource("sc26d.end") }; - resetSubtitles(); - recordTime(); - _subtitleLineNum = 30; - _subtitleSize = 1; + resetSubtitles(30); screen.loadBackground("sc260001.raw"); screen.saveBackground(); @@ -990,10 +963,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { // What? No! SpriteResource sc27("sc27.end"); - resetSubtitles(); - recordTime(); - _subtitleLineNum = 31; - _subtitleSize = 1; + resetSubtitles(31); showSubtitles(); for (int idx = 0; idx < 12; ++idx) { diff --git a/engines/xeen/worldofxeen/worldofxeen.cpp b/engines/xeen/worldofxeen/worldofxeen.cpp index 7f29249968..6df07d9a8a 100644 --- a/engines/xeen/worldofxeen/worldofxeen.cpp +++ b/engines/xeen/worldofxeen/worldofxeen.cpp @@ -40,7 +40,7 @@ void WorldOfXeenEngine::showIntro() { if (gDebugLevel == 0) return; - showCloudsTitle(); + showCloudsIntro(); /* bool completed = showDarkSideTitle(); if (!_seenDarkSideIntro && completed) |