aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen
diff options
context:
space:
mode:
authorPaul Gilbert2015-11-20 20:11:23 -0500
committerPaul Gilbert2015-11-20 20:11:23 -0500
commitb6e39dbf79801b5d96ca9292a47825d39f1e3fb4 (patch)
tree272f7b47dc4188e941c261ca9f5c13c5dd40ad6c /engines/xeen
parent619a165f359251ed82dcd84d2c0ab221671af1d7 (diff)
downloadscummvm-rg350-b6e39dbf79801b5d96ca9292a47825d39f1e3fb4.tar.gz
scummvm-rg350-b6e39dbf79801b5d96ca9292a47825d39f1e3fb4.tar.bz2
scummvm-rg350-b6e39dbf79801b5d96ca9292a47825d39f1e3fb4.zip
XEEN: Some initial work on better sound manager
Diffstat (limited to 'engines/xeen')
-rw-r--r--engines/xeen/sound.cpp12
-rw-r--r--engines/xeen/sound.h15
-rw-r--r--engines/xeen/worldofxeen/worldofxeen_game.cpp55
-rw-r--r--engines/xeen/worldofxeen/worldofxeen_game.h14
-rw-r--r--engines/xeen/xeen.cpp4
-rw-r--r--engines/xeen/xeen.h4
6 files changed, 64 insertions, 40 deletions
diff --git a/engines/xeen/sound.cpp b/engines/xeen/sound.cpp
index 7c7524af54..a71584c769 100644
--- a/engines/xeen/sound.cpp
+++ b/engines/xeen/sound.cpp
@@ -24,6 +24,18 @@
namespace Xeen {
+VOC::~VOC() {
+ stop();
+}
+
+void VOC::play() {
+ warning("TODO: VOC::play");
+}
+
+void VOC::stop() {
+ warning("TODO: VOC::stop");
+}
+
SoundManager::SoundManager(XeenEngine *vm): _vm(vm) {
}
diff --git a/engines/xeen/sound.h b/engines/xeen/sound.h
index 7e7df9caea..b44bff7f30 100644
--- a/engines/xeen/sound.h
+++ b/engines/xeen/sound.h
@@ -29,6 +29,21 @@
namespace Xeen {
+class VOC: public Common::File {
+public:
+ virtual ~VOC();
+
+ /**
+ * Play the given loaded sound
+ */
+ void play();
+
+ /**
+ * Stop playing the sound
+ */
+ void stop();
+};
+
class SoundManager {
private:
XeenEngine *_vm;
diff --git a/engines/xeen/worldofxeen/worldofxeen_game.cpp b/engines/xeen/worldofxeen/worldofxeen_game.cpp
index 3b0efb2aac..836f039cf6 100644
--- a/engines/xeen/worldofxeen/worldofxeen_game.cpp
+++ b/engines/xeen/worldofxeen/worldofxeen_game.cpp
@@ -21,6 +21,7 @@
*/
#include "xeen/worldofxeen/worldofxeen_game.h"
+#include "xeen/sound.h"
namespace Xeen {
@@ -28,24 +29,15 @@ WorldOfXeenEngine::WorldOfXeenEngine(OSystem *syst, const XeenGameDescription *g
: XeenEngine(syst, gameDesc) {
}
-void WorldOfXeenEngine::playGame () {
- XeenEngine::playGame();
-}
-
-void WorldOfXeenEngine::showDarkSideTitle() {
- showDarkSideTitle1();
- if (shouldQuit())
- return;
+void WorldOfXeenEngine::showIntro() {
+ // **DEBUG**
+ if (gDebugLevel == 0)
+ return;
- showDarkSideTitle2();
- if (shouldQuit())
- return;
-
- // TODO: Only show intro sequence if not seen before
- showDarkSideIntroSequence();
+ showDarkSideTitle();
}
-void WorldOfXeenEngine::showDarkSideTitle1() {
+void WorldOfXeenEngine::showDarkSideTitle() {
// TODO: Starting method, and sound
//sub_28F40
_screen->loadPalette("dark.pal");
@@ -53,11 +45,22 @@ void WorldOfXeenEngine::showDarkSideTitle1() {
SpriteResource("nwc1.int"), SpriteResource("nwc2.int"),
SpriteResource("nwc3.int"), SpriteResource("nwc4.int")
};
- Common::File voc[3];
+ VOC voc[3];
voc[0].open("dragon1.voc");
voc[1].open("dragon2.voc");
voc[2].open("dragon3.voc");
-
+/*
+ Common::File f;
+ f.open("adsnd");
+ Common::DumpFile df;
+ byte *b = new byte[f.size()];
+ f.read(b, f.size());
+ df.open("d:\\temp\\adsnd.bin");
+ df.write(b, f.size());
+ df.close();
+ f.close();
+ delete[] b;
+ */
// Load backgrounds
_screen->loadBackground("nwc1.raw");
_screen->loadPage(0);
@@ -97,6 +100,8 @@ void WorldOfXeenEngine::showDarkSideTitle1() {
if (_events->wait(2, true))
return;
}
+ if (shouldQuit())
+ return;
// Loop for dragon using flyspray
for (int idx = 0; idx < 42 && !shouldQuit(); ++idx) {
@@ -130,10 +135,16 @@ void WorldOfXeenEngine::showDarkSideTitle1() {
}
// Pause for a bit
- _events->wait(10, true);
-}
+ if (_events->wait(10, true))
+ return;
+ if (shouldQuit())
+ return;
+
+ voc[0].stop();
+ voc[1].stop();
+ voc[2].stop();
+
-void WorldOfXeenEngine::showDarkSideTitle2() {
_screen->fadeOut(8);
//TODO: Stuff
@@ -145,7 +156,7 @@ void WorldOfXeenEngine::showDarkSideTitle2() {
_events->wait(60, true);
}
-void WorldOfXeenEngine::showDarkSideIntroSequence() {
+void WorldOfXeenEngine::showDarkSideIntro() {
_screen->fadeOut(8);
_screen->loadBackground("pyramid2.raw");
_screen->loadPage(0);
@@ -191,7 +202,7 @@ void WorldOfXeenEngine::showDarkSideIntroSequence() {
idx -= timeExpired;
frame = MIN(frame + timeExpired, (uint)200);
-
+
while (_events->timeElapsed() < 1) {
_events->pollEventsAndWait();
if (_events->isKeyMousePressed())
diff --git a/engines/xeen/worldofxeen/worldofxeen_game.h b/engines/xeen/worldofxeen/worldofxeen_game.h
index 9a3cee185d..f35f25be15 100644
--- a/engines/xeen/worldofxeen/worldofxeen_game.h
+++ b/engines/xeen/worldofxeen/worldofxeen_game.h
@@ -35,16 +35,6 @@ namespace Xeen {
class WorldOfXeenEngine: public XeenEngine {
private:
/**
- * Shows the first part of the Dark Side of Xeen title sequence
- */
- void showDarkSideTitle1();
-
- /**
- * Shows the second part of the Dark Side of Xeen title sequence
- */
- void showDarkSideTitle2();
-
- /**
* Shows the Dark Side of Xeen title sequence
*/
void showDarkSideTitle();
@@ -52,9 +42,9 @@ private:
/**
* Shows the Dark Side of Xeen introduction sequence
*/
- void showDarkSideIntroSequence();
+ void showDarkSideIntro();
protected:
- virtual void playGame();
+ virtual void showIntro();
public:
WorldOfXeenEngine(OSystem *syst, const XeenGameDescription *gameDesc);
virtual ~WorldOfXeenEngine() {}
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp
index fb7edead00..90349858ee 100644
--- a/engines/xeen/xeen.cpp
+++ b/engines/xeen/xeen.cpp
@@ -266,10 +266,6 @@ void XeenEngine::writeSavegameHeader(Common::OutSaveFile *out, XeenSavegameHeade
// out->writeUint32LE(_events->getFrameCounter());
}
-void XeenEngine::showIntro() {
-
-}
-
void XeenEngine::showMainMenu() {
//OptionsMenu::show(this);
}
diff --git a/engines/xeen/xeen.h b/engines/xeen/xeen.h
index 4180a17650..cd1b98b1b8 100644
--- a/engines/xeen/xeen.h
+++ b/engines/xeen/xeen.h
@@ -104,8 +104,6 @@ private:
Common::RandomSource _randomSource;
int _loadSaveSlot;
- void showIntro();
-
void showMainMenu();
void play();
@@ -114,6 +112,8 @@ private:
void gameLoop();
protected:
+ virtual void showIntro() = 0;
+
/**
* Play the game
*/