aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/xeen/combat.cpp11
-rw-r--r--engines/xeen/dialogs_items.cpp5
-rw-r--r--engines/xeen/dialogs_options.cpp5
-rw-r--r--engines/xeen/dialogs_spells.cpp10
-rw-r--r--engines/xeen/interface.cpp20
-rw-r--r--engines/xeen/scripts.cpp5
-rw-r--r--engines/xeen/sound.cpp41
-rw-r--r--engines/xeen/sound.h44
-rw-r--r--engines/xeen/town.cpp96
-rw-r--r--engines/xeen/worldofxeen/darkside_cutscenes.cpp43
-rw-r--r--engines/xeen/xeen.cpp1
11 files changed, 107 insertions, 174 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index be7ade8877..c8e912c85e 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -799,8 +799,7 @@ void Combat::doMonsterTurn(int monsterId) {
intf.draw3d(true);
intf.draw3d(true);
- File f(Common::String::format("%s.voc", monsterData._attackVoc.c_str()));
- sound.playSample(&f, 0);
+ sound.playSound(Common::String::format("%s.voc", monsterData._attackVoc.c_str()));
monsterId = monster._spriteId;
}
@@ -1386,7 +1385,7 @@ void Combat::attack2(int damage, RangeType rangeType) {
damage = 0;
if (!damage) {
- sound.playSample(&_missVoc, 1);
+ sound.playSound(_missVoc, 1);
sound.playFX(6);
} else {
if (!isDarkCc && monster._spriteId == 89)
@@ -1449,17 +1448,17 @@ void Combat::attack2(int damage, RangeType rangeType) {
}
if (damage < 1) {
- sound.playSample(&_missVoc, 1);
+ sound.playSound(_missVoc, 1);
sound.playFX(6);
} else {
_monsterScale[_monsterIndex] = getDamageScale(damage);
intf.draw3d(true);
- sound.playSample(nullptr, 0);
+ sound.stopSound();
File powVoc(Common::String::format("pow%d.voc",
POW_WEAPON_VOCS[_attackWeaponId]));
sound.playFX(60 + POW_WEAPON_VOCS[_attackWeaponId]);
- sound.playSample(&powVoc, 1);
+ sound.playSound(powVoc, 1);
if (monster._hp > damage) {
monster._hp -= damage;
diff --git a/engines/xeen/dialogs_items.cpp b/engines/xeen/dialogs_items.cpp
index 59bf35dfb8..ed9f7f560d 100644
--- a/engines/xeen/dialogs_items.cpp
+++ b/engines/xeen/dialogs_items.cpp
@@ -907,9 +907,8 @@ int ItemsDialog::doItemOptions(Character &c, int actionIndex, int itemIndex, Ite
desc.c_str(), cost))) {
if (party.subtract(0, cost, 0, WT_FREEZE_WAIT)) {
if (isDarkCc) {
- sound.playSample(0, 0);
- File f("choice2.voc");
- sound.playSample(&f, 0);
+ sound.stopSound();
+ sound.playSound("choice2.voc");
}
// Add entry to the end of the list
diff --git a/engines/xeen/dialogs_options.cpp b/engines/xeen/dialogs_options.cpp
index 72445bf055..b2390e344f 100644
--- a/engines/xeen/dialogs_options.cpp
+++ b/engines/xeen/dialogs_options.cpp
@@ -123,7 +123,6 @@ void OptionsMenu::showTitles2() {
EventsManager &events = *_vm->_events;
Sound &sound = *_vm->_sound;
- File voc("elect.voc");
SpriteResource titleSprites("title2b.raw");
SpriteResource kludgeSprites("kludge.int");
SpriteResource title2Sprites[8] = {
@@ -135,7 +134,7 @@ void OptionsMenu::showTitles2() {
kludgeSprites.draw(screen, 0);
screen.saveBackground();
- sound.playSample(&voc, 0);
+ sound.playSound("elect.voc");
for (int i = 0; i < 30 && !_vm->shouldQuit(); ++i) {
events.updateGameCounter();
@@ -144,7 +143,7 @@ void OptionsMenu::showTitles2() {
screen._windows[0].update();
if (i == 19)
- sound.playSample(nullptr, 0);
+ sound.stopSound();
while (!_vm->shouldQuit() && events.timeElapsed() < 2)
events.pollEventsAndWait();
diff --git a/engines/xeen/dialogs_spells.cpp b/engines/xeen/dialogs_spells.cpp
index 1e0600faf9..77d1b4ef6e 100644
--- a/engines/xeen/dialogs_spells.cpp
+++ b/engines/xeen/dialogs_spells.cpp
@@ -59,10 +59,9 @@ Character *SpellsDialog::execute(ButtonContainer *priorDialog, Character *c, int
do {
if (!isCasting) {
if (!c->guildMember()) {
- sound.playSample(nullptr, 0);
+ sound.stopSound();
intf._overallFrame = 5;
- File f(isDarkCc ? "skull1.voc" : "guild11.voc");
- sound.playSample(&f, 1);
+ sound.playSound(isDarkCc ? "skull1.voc" : "guild11.voc", 1);
break;
}
@@ -239,10 +238,9 @@ Character *SpellsDialog::execute(ButtonContainer *priorDialog, Character *c, int
if (Confirm::show(_vm, msg, castingCopy + 1)) {
if (party.subtract(0, spellCost, 0, WT_FREEZE_WAIT)) {
++c->_spells[spellIndex];
- sound.playSample(nullptr, 0);
+ sound.stopSound();
intf._overallFrame = 0;
- File f(isDarkCc ? "guild12.voc" : "parrot2.voc");
- sound.playSample(&f, 1);
+ sound.playSound(isDarkCc ? "guild12.voc" : "parrot2.voc", 1);
} else {
sound.playFX(21);
}
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index 9aca904fb8..bdb871bb6e 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -1088,17 +1088,13 @@ void Interface::rest() {
while (!_vm->shouldQuit() && events.timeElapsed() < 7)
events.pollEventsAndWait();
- File f("dreams2.voc");
- sound.playSample(&f, 1);
- while (!_vm->shouldQuit() && sound.playSample(1, 0))
+ sound.playSound("dreams2.voc", 1);
+ while (!_vm->shouldQuit() && sound.isPlaying())
events.pollEventsAndWait();
- f.close();
- f.openFile("laff1.voc");
- sound.playSample(&f, 1);
- while (!_vm->shouldQuit() && sound.playSample(1, 0))
+ sound.playSound("laff1.voc", 1);
+ while (!_vm->shouldQuit() && sound.isPlaying())
events.pollEventsAndWait();
- f.close();
events.updateGameCounter();
while (!_vm->shouldQuit() && events.timeElapsed() < 7)
@@ -1312,8 +1308,6 @@ void Interface::handleFalling() {
Screen &screen = *_vm->_screen;
Sound &sound = *_vm->_sound;
Window &w = screen._windows[3];
- File voc1("scream.voc");
- File voc2("unnh.voc");
saveFall();
for (uint idx = 0; idx < party._activeParty.size(); ++idx) {
@@ -1323,7 +1317,7 @@ void Interface::handleFalling() {
screen._windows[33].update();
sound.playFX(11);
- sound.playSample(&voc1, 0);
+ sound.playSound("scream.voc");
for (int idx = 0, incr = 2; idx < 133; ++incr, idx += incr) {
fall(idx);
@@ -1335,8 +1329,8 @@ void Interface::handleFalling() {
assembleBorder();
w.update();
- sound.playSample(nullptr, 0);
- sound.playSample(&voc2, 0);
+ sound.stopSound();
+ sound.playSound("unnh.voc");
sound.playFX(31);
fall(127);
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 0bf1792b26..64b387499d 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -1095,9 +1095,8 @@ void Scripts::cmdSeatTextSml(Common::Array<byte> &params) {
void Scripts::cmdPlayEventVoc(Common::Array<byte> &params) {
Sound &sound = *_vm->_sound;
- sound.playSample(nullptr, 0);
- File f(EVENT_SAMPLES[params[0]]);
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound(EVENT_SAMPLES[params[0]], 1);
cmdNoAction(params);
}
diff --git a/engines/xeen/sound.cpp b/engines/xeen/sound.cpp
index d6bbc4c487..360cfc89da 100644
--- a/engines/xeen/sound.cpp
+++ b/engines/xeen/sound.cpp
@@ -26,42 +26,37 @@
namespace Xeen {
-Sound *Voc::_sound;
+/*------------------------------------------------------------------------*/
-Voc::Voc(const Common::String &name) {
- if (!open(name))
- error("Could not open - %s", name.c_str());
+Sound::Sound(XeenEngine *vm, Audio::Mixer *mixer): Music(), _mixer(mixer) {
}
-void Voc::init(XeenEngine *vm) {
- _sound = vm->_sound;
+Sound::~Sound() {
+ stopSound();
}
-void Voc::play() {
- _sound->playSound(this, _soundHandle);
-}
+void Sound::playSound(Common::SeekableReadStream &s, int unused) {
+ stopSound();
-void Voc::stop() {
- _sound->stopSound(_soundHandle);
+ Common::SeekableReadStream *srcStream = s.readStream(s.size());
+ Audio::SeekableAudioStream *stream = Audio::makeVOCStream(srcStream, 0, DisposeAfterUse::YES);
+ _mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, stream);
}
-/*------------------------------------------------------------------------*/
-
-Sound::Sound(XeenEngine *vm, Audio::Mixer *mixer): Music(), _mixer(mixer) {
-}
+void Sound::playSound(const Common::String &name, int unused) {
+ File f;
+ if (!f.open(name))
+ error("Could not open sound - %s", name.c_str());
-void Sound::proc2(Common::SeekableReadStream &f) {
- // TODO
+ playSound(f);
}
-void Sound::playSound(Common::SeekableReadStream *s, Audio::SoundHandle &soundHandle,
- Audio::Mixer::SoundType soundType) {
- Audio::SeekableAudioStream *stream = Audio::makeVOCStream(s, 0);
- _mixer->playStream(soundType, &soundHandle, stream);
+void Sound::stopSound() {
+ _mixer->stopHandle(_soundHandle);
}
-void Sound::stopSound(Audio::SoundHandle &soundHandle) {
- _mixer->stopHandle(soundHandle);
+bool Sound::isPlaying() const {
+ return _mixer->isSoundHandleActive(_soundHandle);
}
} // End of namespace Xeen
diff --git a/engines/xeen/sound.h b/engines/xeen/sound.h
index b7ad94893b..71d44e694b 100644
--- a/engines/xeen/sound.h
+++ b/engines/xeen/sound.h
@@ -32,51 +32,35 @@
namespace Xeen {
-class Sound;
-
-class Voc: public Common::File {
-private:
- static Sound *_sound;
- Audio::SoundHandle _soundHandle;
-public:
- Voc() {}
- Voc(const Common::String &name);
- virtual ~Voc() { stop(); }
- static void init(XeenEngine *vm);
-
- /**
- * Start playing the sound
- */
- void play();
-
- /**
- * Stop playing the sound
- */
- void stop();
-};
-
class Sound : public Music {
private:
Audio::Mixer *_mixer;
+ Audio::SoundHandle _soundHandle;
public:
Sound(XeenEngine *vm, Audio::Mixer *mixer);
+ virtual ~Sound();
- void proc2(Common::SeekableReadStream &f);
+ /**
+ * Play a given sound
+ */
+ void playSound(Common::SeekableReadStream &s, int unused = 0);
/**
* Play a given sound
*/
- void playSound(Common::SeekableReadStream *s, Audio::SoundHandle &soundHandle,
- Audio::Mixer::SoundType soundType = Audio::Mixer::kSFXSoundType);
+ void playSound(const Common::String &name, int unused = 0);
/**
* Stop playing a sound
+ * @remarks In the original, passing 1 to playSound stopped the sound
*/
- void stopSound(Audio::SoundHandle &soundHandle);
-
- void playSample(const Common::SeekableReadStream *stream, int v2 = 1) {}
+ void stopSound();
- bool playSample(int v1, int v2) { return false; }
+ /**
+ * Returns true if a sound is currently playing
+ * @remarks In the original, passing 0 to playSound returned play status
+ */
+ bool isPlaying() const;
};
} // End of namespace Xeen
diff --git a/engines/xeen/town.cpp b/engines/xeen/town.cpp
index ba4b48131b..795d4cddd6 100644
--- a/engines/xeen/town.cpp
+++ b/engines/xeen/town.cpp
@@ -101,7 +101,7 @@ int Town::townAction(int actionId) {
addButton(Common::Rect(288, 108, 312, 128), Common::KEYCODE_ESCAPE, &_icons1);
intf._overallFrame = 1;
- sound.playSample(nullptr, 0);
+ sound.stopSound();
vocName = isDarkCc ? "bank1.voc" : "banker.voc";
break;
@@ -114,7 +114,7 @@ int Town::townAction(int actionId) {
addButton(Common::Rect(234, 74, 308, 82), 0);
addButton(Common::Rect(234, 84, 308, 92), 0);
- sound.playSample(nullptr, 0);
+ sound.stopSound();
vocName = isDarkCc ? "see2.voc" : "whaddayo.voc";
break;
@@ -129,7 +129,7 @@ int Town::townAction(int actionId) {
addButton(Common::Rect(234, 84, 308, 92), 0);
_vm->_mode = MODE_17;
- sound.playSample(nullptr, 0);
+ sound.stopSound();
vocName = isDarkCc ? "parrot1.voc" : "guild10.voc";
break;
@@ -145,7 +145,7 @@ int Town::townAction(int actionId) {
addButton(Common::Rect(234, 84, 308, 92), Common::KEYCODE_r);
_vm->_mode = MODE_17;
- sound.playSample(nullptr, 0);
+ sound.stopSound();
vocName = isDarkCc ? "hello1.voc" : "hello.voc";
break;
@@ -158,7 +158,7 @@ int Town::townAction(int actionId) {
addButton(Common::Rect(234, 74, 308, 82), Common::KEYCODE_u);
addButton(Common::Rect(234, 84, 308, 92), 0);
- sound.playSample(nullptr, 0);
+ sound.stopSound();
vocName = isDarkCc ? "help2.voc" : "maywe2.voc";
break;
@@ -171,7 +171,7 @@ int Town::townAction(int actionId) {
addButton(Common::Rect(281, 108, 305, 128), Common::KEYCODE_ESCAPE, &_icons1);
addButton(Common::Rect(242, 108, 266, 128), Common::KEYCODE_t);
- sound.playSample(nullptr, 0);
+ sound.stopSound();
vocName = isDarkCc ? "training.voc" : "youtrn1.voc";
break;
@@ -239,8 +239,7 @@ int Town::townAction(int actionId) {
if (actionId == 0)
intf._overallFrame = 2;
- File voc(vocName);
- sound.playSample(&voc, 1);
+ sound.playSound(vocName, 1);
do {
townWait();
@@ -253,17 +252,15 @@ int Town::townAction(int actionId) {
case 1:
// Leave blacksmith
if (isDarkCc) {
- sound.playSample(nullptr, 0);
- File f("come1.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound("come1.voc", 1);
}
break;
case 3: {
// Leave Tavern
- sound.playSample(nullptr, 0);
- File f(isDarkCc ? "gdluck1.voc" : "goodbye.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound(isDarkCc ? "gdluck1.voc" : "goodbye.voc", 1);
map.mazeData()._mazeNumber = party._mazeId;
break;
@@ -559,10 +556,9 @@ Character *Town::doGuildOptions(Character *c) {
intf.highlightChar(_buttonValue);
if (!c->guildMember()) {
- sound.playSample(nullptr, 0);
+ sound.stopSound();
intf._overallFrame = 5;
- File f(isDarkCc ? "skull1.voc" : "guild11.voc");
- sound.playSample(&f, 1);
+ sound.playSound(isDarkCc ? "skull1.voc" : "guild11.voc", 1);
}
}
} else if (_buttonValue == Common::KEYCODE_s) {
@@ -608,9 +604,8 @@ Character *Town::doTavernOptions(Character *c) {
// Drink
if (!c->noActions()) {
if (party.subtract(0, 1, 0, WT_2)) {
- sound.playSample(nullptr, 0);
- File f("gulp.voc");
- sound.playSample(&f, 0);
+ sound.stopSound();
+ sound.playSound("gulp.voc");
_v21 = 1;
screen._windows[10].writeString(Common::String::format(TAVERN_TEXT,
@@ -668,9 +663,8 @@ Character *Town::doTavernOptions(Character *c) {
ErrorScroll::show(_vm, FOOD_PACKS_FULL, WT_2);
} else if (party.subtract(0, _v23, 0, WT_2)) {
party._food = _v22;
- sound.playSample(nullptr, 0);
- File f(isDarkCc ? "thanks2.voc" : "thankyou.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound(isDarkCc ? "thanks2.voc" : "thankyou.voc", 1);
}
}
@@ -747,9 +741,8 @@ Character *Town::doTavernOptions(Character *c) {
screen._windows[10].update();
townWait();
} else if (party.subtract(0, 1, 0, WT_2)) {
- sound.playSample(nullptr, 0);
- File f(isDarkCc ? "thanks2.voc" : "thankyou.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound(isDarkCc ? "thanks2.voc" : "thankyou.voc", 1);
if (party._mazeId == (isDarkCc ? 29 : 28)) {
_v24 = 30;
@@ -808,9 +801,8 @@ Character *Town::doTempleOptions(Character *c) {
case Common::KEYCODE_d:
if (_donation && party.subtract(0, _donation, 0, WT_2)) {
- sound.playSample(nullptr, 0);
- File f("coina.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound("coina.voc", 1);
_dayOfWeek = (_dayOfWeek + 1) / 10;
if (_dayOfWeek == (party._day / 10)) {
@@ -824,9 +816,8 @@ Character *Town::doTempleOptions(Character *c) {
party._blessed = amt;
intf.drawParty(true);
- sound.playSample(nullptr, 0);
- Voc voc("ahh.voc");
- voc.play();
+ sound.stopSound();
+ sound.playSound("ahh.voc");
_flag1 = true;
_donation = 0;
}
@@ -855,9 +846,8 @@ Character *Town::doTempleOptions(Character *c) {
_v1 = 1440;
intf.drawParty(true);
- sound.playSample(nullptr, 0);
- File f("ahh.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound("ahh.voc", 1);
}
break;
@@ -872,9 +862,8 @@ Character *Town::doTempleOptions(Character *c) {
_v1 = 1440;
intf.drawParty(true);
- sound.playSample(nullptr, 0);
- File f("ahh.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound("ahh.voc", 1);
}
break;
@@ -909,7 +898,7 @@ Character *Town::doTrainingOptions(Character *c) {
case Common::KEYCODE_t:
if (_experienceToNextLevel) {
- sound.playSample(nullptr, 0);
+ sound.stopSound();
_drawFrameIndex = 0;
Common::String name;
@@ -919,15 +908,13 @@ Character *Town::doTrainingOptions(Character *c) {
name = isDarkCc ? "gtlost.voc" : "trainin0.voc";
}
- File f(name);
- sound.playSample(&f);
+ sound.playSound(name);
} else if (!c->noActions()) {
if (party.subtract(0, (c->_level._permanent * c->_level._permanent) * 10, 0, WT_2)) {
_drawFrameIndex = 0;
- sound.playSample(nullptr, 0);
- File f(isDarkCc ? "prtygd.voc" : "trainin2.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound(isDarkCc ? "prtygd.voc" : "trainin2.voc", 1);
c->_experience -= c->nextExperienceLevel() -
(c->getCurrentExperience() - c->_experience);
@@ -983,7 +970,7 @@ void Town::depositWithdrawl(int choice) {
drawButtons(&screen._windows[35]);
screen._windows[35].update();
- sound.playSample(nullptr, 0);
+ sound.stopSound();
File voc("coina.voc");
bool flag = false;
@@ -1038,7 +1025,7 @@ void Town::depositWithdrawl(int choice) {
gems = party._gems;
}
- sound.playSample(&voc, 0);
+ sound.playSound(voc);
msg = Common::String::format(GOLD_GEMS_2, DEPOSIT_WITHDRAWL[choice],
XeenEngine::printMil(gold).c_str(), XeenEngine::printMil(gems).c_str());
screen._windows[35].writeString(msg);
@@ -1061,7 +1048,7 @@ void Town::drawTownAnim(bool flag) {
bool isDarkCc = _vm->_files->_isDarkCc;
if (_townActionId == 1) {
- if (sound.playSample(1, 0)) {
+ if (sound.isPlaying()) {
if (isDarkCc) {
_townSprites[_drawFrameIndex / 8].draw(screen, _drawFrameIndex % 8, _townPos);
_townSprites[2].draw(screen, _vm->getRandomNumber(11) == 1 ? 9 : 10,
@@ -1085,9 +1072,9 @@ void Town::drawTownAnim(bool flag) {
switch (_townActionId) {
case 0:
- if (sound.playSample(1, 0) || (isDarkCc && intf._overallFrame)) {
+ if (sound.isPlaying() || (isDarkCc && intf._overallFrame)) {
if (isDarkCc) {
- if (sound.playSample(1, 0) || intf._overallFrame == 1) {
+ if (sound.isPlaying() || intf._overallFrame == 1) {
_townSprites[4].draw(screen, _vm->getRandomNumber(13, 18),
Common::Point(8, 30));
} else if (intf._overallFrame > 1) {
@@ -1103,7 +1090,7 @@ void Town::drawTownAnim(bool flag) {
break;
case 2:
- if (sound.playSample(1, 0)) {
+ if (sound.isPlaying()) {
if (isDarkCc) {
if (intf._overallFrame) {
intf._overallFrame ^= 1;
@@ -1116,19 +1103,19 @@ void Town::drawTownAnim(bool flag) {
break;
case 3:
- if (sound.playSample(1, 0) && isDarkCc) {
+ if (sound.isPlaying() && isDarkCc) {
_townSprites[4].draw(screen, _vm->getRandomNumber(7), Common::Point(153, 49));
}
break;
case 4:
- if (sound.playSample(1, 0)) {
+ if (sound.isPlaying()) {
_townSprites[3].draw(screen, _vm->getRandomNumber(2, 4), Common::Point(8, 8));
}
break;
case 5:
- if (sound.playSample(1, 0)) {
+ if (sound.isPlaying()) {
if (isDarkCc) {
_townSprites[_drawFrameIndex / 8].draw(screen, _drawFrameIndex % 8, _townPos);
}
@@ -1169,8 +1156,7 @@ void Town::drawTownAnim(bool flag) {
sound.playFX(45);
if (_townActionId == 5 && _drawFrameIndex == 23) {
- File f("spit1.voc");
- sound.playSample(&f, 0);
+ sound.playSound("spit1.voc");
}
} else {
if (_townMaxId == 32 && _drawFrameIndex == 0)
diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.cpp b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
index e3bd2c6f66..71fbe8f328 100644
--- a/engines/xeen/worldofxeen/darkside_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
@@ -39,7 +39,7 @@ bool DarkSideCutscenes::showDarkSideTitle() {
SpriteResource("nwc1.int"), SpriteResource("nwc2.int"),
SpriteResource("nwc3.int"), SpriteResource("nwc4.int")
};
- Voc voc[3];
+ File voc[3];
voc[0].open("dragon1.voc");
voc[1].open("dragon2.voc");
voc[2].open("dragon3.voc");
@@ -55,21 +55,6 @@ bool DarkSideCutscenes::showDarkSideTitle() {
screen.draw();
screen.fadeIn(4);
- // **DEBUG**: Testing music
- sound.setMusicVolume(0x5f);
- File f("bigtheme.m", *_vm->_files->_sideArchives[1]);
- byte *data = new byte[f.size()];
- f.read(data, f.size());
- f.close();
-
- sound.playSong(data);
-
- events.updateGameCounter();
- events.wait(1000, true);
-
- sound.stopSong();
- delete[] data;
- /*
// Initial loop for dragon roaring
int nwcIndex = 0, nwcFrame = 0;
for (int idx = 0; idx < 55 && !_vm->shouldQuit(); ++idx) {
@@ -81,7 +66,7 @@ bool DarkSideCutscenes::showDarkSideTitle() {
switch (idx) {
case 17:
- voc[0].play();
+ sound.playSound(voc[0]);
break;
case 34:
case 44:
@@ -89,7 +74,7 @@ bool DarkSideCutscenes::showDarkSideTitle() {
nwcFrame = 0;
break;
case 35:
- voc[1].play();
+ sound.playSound(voc[1]);
break;
default:
++nwcFrame;
@@ -108,19 +93,19 @@ bool DarkSideCutscenes::showDarkSideTitle() {
switch (idx) {
case 3:
- sound.startMusic(40);
+ sound.playFX(40);
break;
case 11:
- sound.startMusic(0);
+ sound.playFX(0);
case 27:
case 30:
- sound.startMusic(3);
+ sound.playFX(3);
break;
case 31:
- sound.proc2(voc[2]);
+ sound.playSound(voc[2]);
break;
case 33:
- sound.startMusic(2);
+ sound.playFX(2);
break;
default:
break;
@@ -134,10 +119,7 @@ bool DarkSideCutscenes::showDarkSideTitle() {
if (events.wait(10, true))
return false;
- voc[0].stop();
- voc[1].stop();
- voc[2].stop();
- sound.stopMusic(95);
+ sound.songCommand(95);
screen.loadBackground("jvc.raw");
screen.fadeOut(8);
@@ -146,7 +128,6 @@ bool DarkSideCutscenes::showDarkSideTitle() {
events.updateGameCounter();
events.wait(60, true);
- */
return true;
}
@@ -174,7 +155,7 @@ bool DarkSideCutscenes::showDarkSideIntro() {
SpriteResource sprites[3] = {
SpriteResource("title.int"), SpriteResource("pyratop.int"), SpriteResource("pyramid.int")
};
- Voc voc[2];
+ File voc[2];
voc[0].open("pharoh1a.voc");
voc[1].open("pharoh1b.voc");
@@ -254,8 +235,8 @@ bool DarkSideCutscenes::showDarkSideEnding() {
Screen &screen = *_vm->_screen;
Sound &sound = *_vm->_sound;
- Voc voc("ido2.voc");
-// Music newBright("newbrigh.m");
+ //Voc voc("ido2.voc");
+ // Music newBright("newbrigh.m");
SpriteResource box("box.vga");
// newBright.play();
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp
index 826551354a..2013ae660d 100644
--- a/engines/xeen/xeen.cpp
+++ b/engines/xeen/xeen.cpp
@@ -98,7 +98,6 @@ void XeenEngine::initialize() {
_sound = new Sound(this, _mixer);
_spells = new Spells(this);
_town = new Town(this);
- Voc::init(this);
File f("029.obj");
_eventData = f.readStream(f.size());