Skip to content

Commit

Permalink
XEEN: Add World of Xeen logo to end of Dark Side intro
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Mar 3, 2018
1 parent 3de1ba1 commit 010c47b
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 41 deletions.
86 changes: 76 additions & 10 deletions engines/xeen/worldofxeen/darkside_cutscenes.cpp
Expand Up @@ -69,7 +69,7 @@ const int LEFT_CLAW_IDLE_Y[32] = {
};


bool DarkSideCutscenes::showDarkSideTitle() {
bool DarkSideCutscenes::showDarkSideTitle(bool seenIntro) {
EventsManager &events = *_vm->_events;
Screen &screen = *_vm->_screen;
Sound &sound = *_vm->_sound;
Expand Down Expand Up @@ -162,28 +162,39 @@ bool DarkSideCutscenes::showDarkSideTitle() {
return true;
}

bool DarkSideCutscenes::showDarkSideIntro() {
bool DarkSideCutscenes::showDarkSideIntro(bool seenIntro) {
FileManager &files = *g_vm->_files;
Screen &screen = *g_vm->_screen;
Sound &sound = *g_vm->_sound;

files._isDarkCc = true;
files.setGameCc(1);

_ball.load("ball.int");
_dragon1.load("dragon1.int");
_claw.load("claw.int");
if (showDarkSideTitle(seenIntro)) {
if (seenIntro) {
if (g_vm->getGameID() == GType_WorldOfXeen)
seenIntro = showWorldOfXeenLogo();
} else {
_ball.load("ball.int");
_dragon1.load("dragon1.int");
_claw.load("claw.int");

seenIntro = showDarkSideIntro1() && showDarkSideIntro2() && showDarkSideIntro3();

_ball.clear();
_dragon1.clear();
_claw.clear();

bool result = showDarkSideIntro1() && showDarkSideIntro2() && showDarkSideIntro3();
if (seenIntro && g_vm->getGameID() == GType_WorldOfXeen)
seenIntro = showWorldOfXeenLogo();
}
}

sound.stopAllAudio();
sound.setMusicVolume(100);
screen.freePages();
_ball.clear();
_dragon1.clear();
_claw.clear();

return result;
return seenIntro;
}

bool DarkSideCutscenes::rubCrystalBall(bool fadeIn) {
Expand Down Expand Up @@ -799,6 +810,61 @@ bool DarkSideCutscenes::showDarkSideIntro3() {
WAIT(2);
}

screen.fadeOut();
return true;
}

bool DarkSideCutscenes::showWorldOfXeenLogo() {
EventsManager &events = *_vm->_events;
Screen &screen = *_vm->_screen;
Sound &sound = *_vm->_sound;
SpriteResource fizzle("fizzle.int");
SpriteResource wfire[7];
for (uint idx = 0; idx < 7; ++idx)
wfire[idx].load(Common::String::format("wfire%u.int", idx + 1));

screen.loadBackground("firemain.raw");
screen.loadPalette("firemain.pal");
screen.saveBackground();
screen.fadeIn();
WAIT(10);

for (int idx = 0; idx < 28; ++idx) {
if (idx == 17)
sound.playSound("explosio.voc");
if (!sound.isSoundPlaying() && idx < 17)
sound.playSound("rumble.voc");

screen.restoreBackground();
wfire[idx / 5].draw(0, idx % 5, Common::Point(0, 45));
WAIT(2);
}

screen.saveBackground();

for (int loopCtr = 0; loopCtr < 2; ++loopCtr) {
for (int idx = 0; idx < 21; ++idx) {
screen.restoreBackground();
wfire[6].draw(0, idx, Common::Point(0, 45));

switch (idx) {
case 0:
case 11:
sound.playSound("thud.voc");
break;
case 3:
sound.playFX(60);
break;
default:
break;
}

WAIT(2);
}
}

WAIT(10);
screen.fadeOut();
return true;
}

Expand Down
17 changes: 11 additions & 6 deletions engines/xeen/worldofxeen/darkside_cutscenes.h
Expand Up @@ -47,6 +47,11 @@ class DarkSideCutscenes : public Cutscenes {
*/
void animatePharoah(int frame);

/**
* Shows the Dark Side of Xeen title screen
*/
bool showDarkSideTitle(bool seenIntro);

/**
* Shows part 1 of the Dark Side intro - up to the point where
* Dragon Pharoah ends "contact the Queen"
Expand All @@ -63,6 +68,11 @@ class DarkSideCutscenes : public Cutscenes {
*/
bool showDarkSideIntro3();

/**
* Shows the World of Xeen logo from the end of the Dark Side intro
*/
bool showWorldOfXeenLogo();

/**
* Shows part 1 of the Dark Side ending, everything up to Corak appearing
*/
Expand Down Expand Up @@ -95,15 +105,10 @@ class DarkSideCutscenes : public Cutscenes {
public:
DarkSideCutscenes(XeenEngine *vm) : Cutscenes(vm) {}

/**
* Shows the Dark Side of Xeen title screen
*/
bool showDarkSideTitle();

/**
* Shows the Dark Side of Xeen intro sequence
*/
bool showDarkSideIntro();
bool showDarkSideIntro(bool seenIntro);

/**
* Shows the Dark Side of Xeen ending sequence
Expand Down
33 changes: 8 additions & 25 deletions engines/xeen/worldofxeen/worldofxeen.cpp
Expand Up @@ -161,14 +161,6 @@ void WorldOfXeenEngine::showCutscene(const Common::String &name, int status, uin
showDarkSideEnding(score);
else if (name == "WORLDEND")
showWorldOfXeenEnding((GooberState)status, score);
else if (name == "CLOUDS_TITLE")
showCloudsTitle();
else if (name == "CLOUDS_INTRO")
showCloudsIntro();
else if (name == "DARKSIDE_TITLE")
showDarkSideTitle();
else if (name == "DARKSIDE_INTRO")
showDarkSideIntro();

_screen->freePages();
_sound->stopAllAudio();
Expand All @@ -178,25 +170,16 @@ void WorldOfXeenEngine::showCutscene(const Common::String &name, int status, uin

void WorldOfXeenEngine::showStartup() {
bool seenIntro = ConfMan.hasKey("seen_intro") && ConfMan.getBool("seen_intro");
bool completedIntro;

// Show the title animation
bool completedTitle = true;
//(getGameID() == GType_Clouds) ?
// showCloudsTitle() : showDarkSideTitle();
_sound->stopAllAudio();
if (getGameID() == GType_Clouds)
completedIntro = showCloudsIntro();
else
completedIntro = showDarkSideIntro(seenIntro);

// Unless user aborted the title, go
if (completedTitle && !seenIntro) {
if (getGameID() == GType_Clouds)
seenIntro = showCloudsIntro();
else
seenIntro = showDarkSideIntro();

seenIntro = false;//****DEBUG****
if (seenIntro) {
ConfMan.setBool("seen_intro", true);
ConfMan.flushToDisk();
}
if (!seenIntro && completedIntro) {
ConfMan.setBool("seen_intro", true);
ConfMan.flushToDisk();
}

_gameMode = GMODE_MENU;
Expand Down

0 comments on commit 010c47b

Please sign in to comment.