aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/xeen/character.cpp6
-rw-r--r--engines/xeen/combat.cpp14
-rw-r--r--engines/xeen/dialogs_error.cpp2
-rw-r--r--engines/xeen/dialogs_input.cpp2
-rw-r--r--engines/xeen/dialogs_items.cpp4
-rw-r--r--engines/xeen/dialogs_options.cpp2
-rw-r--r--engines/xeen/dialogs_party.cpp2
-rw-r--r--engines/xeen/dialogs_spells.cpp6
-rw-r--r--engines/xeen/interface.cpp16
-rw-r--r--engines/xeen/module.mk1
-rw-r--r--engines/xeen/music.cpp88
-rw-r--r--engines/xeen/music.h83
-rw-r--r--engines/xeen/party.cpp4
-rw-r--r--engines/xeen/scripts.cpp8
-rw-r--r--engines/xeen/sound.cpp36
-rw-r--r--engines/xeen/sound.h36
-rw-r--r--engines/xeen/spells.cpp138
-rw-r--r--engines/xeen/town.cpp14
-rw-r--r--engines/xeen/worldofxeen/darkside_cutscenes.cpp10
-rw-r--r--engines/xeen/xeen.cpp3
-rw-r--r--engines/xeen/xeen.h2
21 files changed, 303 insertions, 174 deletions
diff --git a/engines/xeen/character.cpp b/engines/xeen/character.cpp
index b0502d254a..f47b6e28fb 100644
--- a/engines/xeen/character.cpp
+++ b/engines/xeen/character.cpp
@@ -286,7 +286,7 @@ Common::String WeaponItems::getFullDescription(int itemIndex, int displayNum) {
}
void WeaponItems::enchantItem(int itemIndex, int amount) {
- SoundManager &sound = *getVm()->_sound;
+ Sound &sound = *getVm()->_sound;
XeenItem &item = operator[](itemIndex);
Character tempCharacter;
@@ -445,7 +445,7 @@ Common::String ArmorItems::getFullDescription(int itemIndex, int displayNum) {
}
void ArmorItems::enchantItem(int itemIndex, int amount) {
- SoundManager &sound = *getVm()->_sound;
+ Sound &sound = *getVm()->_sound;
XeenItem &item = operator[](itemIndex);
Character tempCharacter;
@@ -1775,7 +1775,7 @@ void Character::addHitPoints(int amount) {
}
void Character::subtractHitPoints(int amount) {
- SoundManager &sound = *Party::_vm->_sound;
+ Sound &sound = *Party::_vm->_sound;
_currentHp -= amount;
bool flag = _currentHp <= 10;
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index 3faff3d157..be7ade8877 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -132,7 +132,7 @@ void Combat::giveCharDamage(int damage, DamageType attackType, int charIndex) {
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
Scripts &scripts = *_vm->_scripts;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
int charIndex1 = charIndex + 1;
int selectedIndex1 = 0;
int selectedIndex2 = 0;
@@ -262,7 +262,7 @@ void Combat::doCharDamage(Character &c, int charNum, int monsterDataIndex) {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
MonsterStruct &monsterData = map._monsterData[monsterDataIndex];
// Attacked characters are automatically woken up
@@ -539,7 +539,7 @@ void Combat::monstersAttack() {
Interface &intf = *_vm->_interface;
Map &map = *_vm->_map;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
int powNum = -1;
MonsterStruct *monsterData = nullptr;
OutdoorDrawList &outdoorList = intf._outdoorList;
@@ -769,7 +769,7 @@ void Combat::doMonsterTurn(int monsterId) {
Interface &intf = *_vm->_interface;
Map &map = *_vm->_map;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
if (_monstersAttacking) {
int monsterIndex;
@@ -1376,7 +1376,7 @@ void Combat::attack2(int damage, RangeType rangeType) {
Interface &intf = *_vm->_interface;
Map &map = *_vm->_map;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
bool isDarkCc = _vm->_files->_isDarkCc;
MazeMonster &monster = map._mobData._monsters[_monster2Attack];
MonsterStruct &monsterData = *monster._monsterData;
@@ -1592,7 +1592,7 @@ void Combat::quickFight() {
void Combat::run() {
Map &map = *_vm->_map;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
if (_vm->getRandomNumber(1, 100) < map.mazeData()._difficulties._chance2Run) {
// Remove the character from the combat party
@@ -1804,7 +1804,7 @@ void Combat::multiAttack(int powNum) {
Interface &intf = *_vm->_interface;
Map &map = *_vm->_map;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
if (_damageType == DT_POISON_VOLLEY) {
_damageType = DT_POISON;
diff --git a/engines/xeen/dialogs_error.cpp b/engines/xeen/dialogs_error.cpp
index 7204bad8fe..0a8f5923f2 100644
--- a/engines/xeen/dialogs_error.cpp
+++ b/engines/xeen/dialogs_error.cpp
@@ -92,7 +92,7 @@ void CantCast::show(XeenEngine *vm, int spellId, int componentNum) {
void CantCast::execute(int spellId, int componentNum) {
EventsManager &events = *_vm->_events;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Spells &spells = *_vm->_spells;
Window &w = _vm->_screen->_windows[6];
Mode oldMode = _vm->_mode;
diff --git a/engines/xeen/dialogs_input.cpp b/engines/xeen/dialogs_input.cpp
index 40b8847d14..50d6ed2eca 100644
--- a/engines/xeen/dialogs_input.cpp
+++ b/engines/xeen/dialogs_input.cpp
@@ -135,7 +135,7 @@ int StringInput::execute(bool type, const Common::String &expected,
Screen &screen = *_vm->_screen;
Scripts &scripts = *_vm->_scripts;
Window &w = screen._windows[6];
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
int result = 0;
w.open();
diff --git a/engines/xeen/dialogs_items.cpp b/engines/xeen/dialogs_items.cpp
index 4ad9e240bd..59bf35dfb8 100644
--- a/engines/xeen/dialogs_items.cpp
+++ b/engines/xeen/dialogs_items.cpp
@@ -772,7 +772,7 @@ int ItemsDialog::doItemOptions(Character &c, int actionIndex, int itemIndex, Ite
Interface &intf = *_vm->_interface;
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Spells &spells = *_vm->_spells;
bool isDarkCc = _vm->_files->_isDarkCc;
@@ -1044,7 +1044,7 @@ void ItemsDialog::itemToGold(Character &c, int itemIndex, ItemCategory category,
ItemsMode mode) {
XeenItem &item = c._items[category][itemIndex];
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
if (category == CATEGORY_WEAPON && item._id == 34) {
sound.playFX(21);
diff --git a/engines/xeen/dialogs_options.cpp b/engines/xeen/dialogs_options.cpp
index 757634a2ad..72445bf055 100644
--- a/engines/xeen/dialogs_options.cpp
+++ b/engines/xeen/dialogs_options.cpp
@@ -121,7 +121,7 @@ void OptionsMenu::showTitles1(SpriteResource &sprites) {
void OptionsMenu::showTitles2() {
Screen &screen = *_vm->_screen;
EventsManager &events = *_vm->_events;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
File voc("elect.voc");
SpriteResource titleSprites("title2b.raw");
diff --git a/engines/xeen/dialogs_party.cpp b/engines/xeen/dialogs_party.cpp
index a03e2d763d..ac5c749d03 100644
--- a/engines/xeen/dialogs_party.cpp
+++ b/engines/xeen/dialogs_party.cpp
@@ -48,7 +48,7 @@ void PartyDialog::execute() {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
bool modeFlag = false;
int startingChar = 0;
diff --git a/engines/xeen/dialogs_spells.cpp b/engines/xeen/dialogs_spells.cpp
index e7bbbf5cbf..1e0600faf9 100644
--- a/engines/xeen/dialogs_spells.cpp
+++ b/engines/xeen/dialogs_spells.cpp
@@ -44,7 +44,7 @@ Character *SpellsDialog::execute(ButtonContainer *priorDialog, Character *c, int
Interface &intf = *_vm->_interface;
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Spells &spells = *_vm->_spells;
bool isDarkCc = _vm->_files->_isDarkCc;
loadButtons();
@@ -780,7 +780,7 @@ bool LloydsBeacon::execute() {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Window &w = screen._windows[10];
bool isDarkCc = _vm->_files->_isDarkCc;
Character &c = *combat._oldCharacter;
@@ -990,7 +990,7 @@ void IdentifyMonster::execute() {
Interface &intf = *_vm->_interface;
Map &map = *_vm->_map;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Window &w = screen._windows[17];
Common::String monsterDesc[3];
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index 9f9df190f7..9aca904fb8 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -265,7 +265,7 @@ void Interface::perform() {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
Scripts &scripts = *_vm->_scripts;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Spells &spells = *_vm->_spells;
const Common::Rect WAIT_BOUNDS(8, 8, 224, 140);
@@ -621,7 +621,7 @@ void Interface::chargeStep() {
void Interface::stepTime() {
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
doStepCode();
if (++party._ctr24 == 24)
@@ -926,7 +926,7 @@ void Interface::startFalling(bool flag) {
bool Interface::checkMoveDirection(int key) {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Direction dir = party._mazeDirection;
switch (key) {
@@ -1027,7 +1027,7 @@ void Interface::rest() {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
map.cellFlagLookup(party._mazePosition);
@@ -1158,7 +1158,7 @@ void Interface::bash(const Common::Point &pt, Direction direction) {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
if (map._isOutdoors)
return;
@@ -1310,7 +1310,7 @@ void Interface::draw3d(bool updateFlag, bool skipDelay) {
void Interface::handleFalling() {
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Window &w = screen._windows[3];
File voc1("scream.voc");
File voc2("unnh.voc");
@@ -1866,7 +1866,7 @@ void Interface::doCombat() {
Screen &screen = *_vm->_screen;
Scripts &scripts = *_vm->_scripts;
Spells &spells = *_vm->_spells;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
bool upDoorText = _upDoorText;
bool reloadMap = false;
@@ -2244,7 +2244,7 @@ void Interface::spellFX(Character *c) {
EventsManager &events = *_vm->_events;
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
// Ensure there's no alraedy running effect for the given character
uint charIndex;
diff --git a/engines/xeen/module.mk b/engines/xeen/module.mk
index b18f44fa6d..7435790335 100644
--- a/engines/xeen/module.mk
+++ b/engines/xeen/module.mk
@@ -32,6 +32,7 @@ MODULE_OBJS := \
interface.o \
interface_map.o \
map.o \
+ music.o \
party.o \
resources.o \
saves.o \
diff --git a/engines/xeen/music.cpp b/engines/xeen/music.cpp
new file mode 100644
index 0000000000..f95683ac3d
--- /dev/null
+++ b/engines/xeen/music.cpp
@@ -0,0 +1,88 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/md5.h"
+#include "xeen/music.h"
+#include "xeen/xeen.h"
+#include "xeen/files.h"
+
+namespace Xeen {
+
+#define ADLIB_CHANNEL_COUNT 9
+#define CALLBACKS_PER_SECOND 60
+
+Music::Music(Audio::Mixer *mixer) : _mixer(mixer), _effectsData(nullptr) {
+ _mixer = mixer;
+ _opl = OPL::Config::create();
+ _opl->init();
+ _opl->start(new Common::Functor0Mem<void, Music>(this, &Music::onTimer), CALLBACKS_PER_SECOND);
+
+ loadEffectsData();
+}
+
+Music::~Music() {
+ _opl->stop();
+ delete _opl;
+ delete[] _effectsData;
+}
+
+void Music::loadEffectsData() {
+ File file("admus");
+ Common::String md5str = Common::computeStreamMD5AsString(file, 8192);
+
+ if (md5str != "be8989a5e868913f0e53963046e3ea13")
+ error("Unknown music driver encountered");
+
+ // Load in the driver data
+ const int EFFECTS_OFFSET = 0x91D;
+ byte *effectsData = new byte[file.size() - EFFECTS_OFFSET];
+ file.seek(EFFECTS_OFFSET);
+ file.read(effectsData, file.size() - EFFECTS_OFFSET);
+ file.close();
+ _effectsData = effectsData;
+
+ // Extract the effects offsets
+ _effectsOffsets.resize(180);
+ for (int idx = 0; idx < 180; ++idx)
+ _effectsOffsets[idx] = READ_LE_UINT16(&effectsData[idx * 2]) - EFFECTS_OFFSET;
+}
+
+void Music::onTimer() {
+ Common::StackLock slock(_driverMutex);
+ update();
+ flush();
+}
+
+void Music::flush() {
+ Common::StackLock slock(_driverMutex);
+
+ while (!_queue.empty()) {
+ RegisterValue v = _queue.pop();
+ _opl->writeReg(v._regNum, v._value);
+ }
+}
+
+void Music::update() {
+ // TODO
+}
+
+} // End of namespace Xeen
diff --git a/engines/xeen/music.h b/engines/xeen/music.h
new file mode 100644
index 0000000000..202f8ba982
--- /dev/null
+++ b/engines/xeen/music.h
@@ -0,0 +1,83 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef XEEN_MUSIC_H
+#define XEEN_MUSIC_H
+
+#include "audio/fmopl.h"
+#include "audio/mixer.h"
+#include "common/array.h"
+#include "common/mutex.h"
+#include "common/queue.h"
+
+namespace OPL {
+ class OPL;
+}
+
+namespace Xeen {
+
+struct RegisterValue {
+ uint8 _regNum;
+ uint8 _value;
+
+ RegisterValue(int regNum, int value) {
+ _regNum = regNum; _value = value;
+ }
+};
+
+class Music {
+private:
+ OPL::OPL *_opl;
+ Common::Mutex _driverMutex;
+ Common::Queue<RegisterValue> _queue;
+ const byte *_effectsData;
+ Common::Array<uint16> _effectsOffsets;
+private:
+ /**
+ * Loads effects data that was embedded in the music driver
+ */
+ void loadEffectsData();
+
+ /**
+ * Timer function for OPL
+ */
+ void onTimer();
+
+ /**
+ * Flushes any pending writes to the OPL
+ */
+ void flush();
+
+ /**
+ * Updates any playing music
+ */
+ void update();
+protected:
+ Audio::Mixer *_mixer;
+public:
+ Music(Audio::Mixer *mixer);
+ ~Music();
+};
+
+} // End of namespace Xeen
+
+#endif /* XEEN_MUSIC_H */
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index 35a8f00fbe..3315cb2816 100644
--- a/engines/xeen/party.cpp
+++ b/engines/xeen/party.cpp
@@ -560,7 +560,7 @@ void Party::giveTreasure() {
Interface &intf = *_vm->_interface;
Screen &screen = *_vm->_screen;
Scripts &scripts = *_vm->_scripts;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Window &w = screen._windows[10];
if (!_treasure._gold && !_treasure._gems)
@@ -694,7 +694,7 @@ bool Party::arePacksFull() const {
void Party::giveTreasureToCharacter(Character &c, ItemCategory category, int itemIndex) {
EventsManager &events = *_vm->_events;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Window &w = screen._windows[10];
XeenItem &treasureItem = _treasure._categories[category][itemIndex];
sound.playFX(20);
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 0e752529d5..0bf1792b26 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -114,7 +114,7 @@ int Scripts::checkEvents() {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Town &town = *_vm->_town;
bool isDarkCc = _vm->_files->_isDarkCc;
@@ -257,7 +257,7 @@ void Scripts::openGrate(int wallVal, int action) {
Interface &intf = *_vm->_interface;
Map &map = *_vm->_map;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
bool isDarkCc = _vm->_files->_isDarkCc;
if ((wallVal != 13 || map._currentGrateUnlocked) && (!isDarkCc || wallVal != 9 ||
@@ -420,7 +420,7 @@ void Scripts::cmdTeleport(Common::Array<byte> &params) {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
screen.closeWindows();
@@ -1094,7 +1094,7 @@ void Scripts::cmdSeatTextSml(Common::Array<byte> &params) {
}
void Scripts::cmdPlayEventVoc(Common::Array<byte> &params) {
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
sound.playSample(nullptr, 0);
File f(EVENT_SAMPLES[params[0]]);
sound.playSample(&f, 1);
diff --git a/engines/xeen/sound.cpp b/engines/xeen/sound.cpp
index f5cc40249d..46532fa887 100644
--- a/engines/xeen/sound.cpp
+++ b/engines/xeen/sound.cpp
@@ -26,7 +26,7 @@
namespace Xeen {
-SoundManager *Voc::_sound;
+Sound *Voc::_sound;
Voc::Voc(const Common::String &name) {
if (!open(name))
@@ -47,53 +47,33 @@ void Voc::stop() {
/*------------------------------------------------------------------------*/
-SoundManager *Music::_sound;
+Sound::Sound(XeenEngine *vm, Audio::Mixer *mixer): Music(mixer) {
-Music::Music(const Common::String &name) {
- if (!open(name))
- error("Could not open - %s", name.c_str());
-}
-
-void Music::init(XeenEngine *vm) {
- _sound = vm->_sound;
-}
-
-void Music::play() {
- _sound->playMusic(this, _soundHandle);
-}
-
-void Music::stop() {
- _sound->stopSound(_soundHandle);
-}
-
-/*------------------------------------------------------------------------*/
-
-SoundManager::SoundManager(XeenEngine *vm, Audio::Mixer *mixer): _mixer(mixer) {
}
-void SoundManager::proc2(Common::SeekableReadStream &f) {
+void Sound::proc2(Common::SeekableReadStream &f) {
// TODO
}
-void SoundManager::startMusic(int v1) {
+void Sound::startMusic(int v1) {
// TODO
}
-void SoundManager::stopMusic(int id) {
+void Sound::stopMusic(int id) {
// TODO
}
-void SoundManager::playSound(Common::SeekableReadStream *s, Audio::SoundHandle &soundHandle,
+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 SoundManager::playMusic(Common::SeekableReadStream *s, Audio::SoundHandle &soundHandle) {
+void Sound::playMusic(Common::SeekableReadStream *s, Audio::SoundHandle &soundHandle) {
// TODO
}
-void SoundManager::stopSound(Audio::SoundHandle &soundHandle) {
+void Sound::stopSound(Audio::SoundHandle &soundHandle) {
_mixer->stopHandle(soundHandle);
}
diff --git a/engines/xeen/sound.h b/engines/xeen/sound.h
index 954d324e8d..5dd80c0e55 100644
--- a/engines/xeen/sound.h
+++ b/engines/xeen/sound.h
@@ -25,17 +25,18 @@
#include "audio/mixer.h"
#include "audio/audiostream.h"
-#include "common/scummsys.h"
-#include "common/system.h"
+//#include "common/scummsys.h"
+//#include "common/system.h"
#include "xeen/files.h"
+#include "xeen/music.h"
namespace Xeen {
-class SoundManager;
+class Sound;
class Voc: public Common::File {
private:
- static SoundManager *_sound;
+ static Sound *_sound;
Audio::SoundHandle _soundHandle;
public:
Voc() {}
@@ -54,32 +55,9 @@ public:
void stop();
};
-class Music : public Common::File {
-private:
- static SoundManager *_sound;
- Audio::SoundHandle _soundHandle;
-public:
- Music() {}
- Music(const Common::String &name);
- virtual ~Music() { stop(); }
- static void init(XeenEngine *vm);
-
- /**
- * Start playing the sound
- */
- void play();
-
- /**
- * Stop playing the sound
- */
- void stop();
-};
-
-class SoundManager {
-private:
- Audio::Mixer *_mixer;
+class Sound : public Music {
public:
- SoundManager(XeenEngine *vm, Audio::Mixer *mixer);
+ Sound(XeenEngine *vm, Audio::Mixer *mixer);
void proc2(Common::SeekableReadStream &f);
diff --git a/engines/xeen/spells.cpp b/engines/xeen/spells.cpp
index ee3085d052..1a0761ae40 100644
--- a/engines/xeen/spells.cpp
+++ b/engines/xeen/spells.cpp
@@ -244,7 +244,7 @@ void Spells::addSpellCost(Character &c, int spellId) {
void Spells::acidSpray() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 15;
combat._damageType = DT_POISON;
@@ -256,7 +256,7 @@ void Spells::acidSpray() {
void Spells::awaken() {
Interface &intf = *_vm->_interface;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
for (uint idx = 0; idx < party._activeParty.size(); ++idx) {
Character &c = party._activeParty[idx];
@@ -271,7 +271,7 @@ void Spells::awaken() {
void Spells::beastMaster() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 0;
combat._damageType = DT_BEASTMASTER;
@@ -283,7 +283,7 @@ void Spells::beastMaster() {
void Spells::bless() {
Combat &combat = *_vm->_combat;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
sound.playFX(30);
party._blessed = combat._oldCharacter->getCurrentLevel();
@@ -296,7 +296,7 @@ void Spells::clairvoyance() {
void Spells::coldRay() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = _vm->getRandomNumber(2, 4) * combat._oldCharacter->getCurrentLevel();
combat._damageType = DT_COLD;
@@ -307,7 +307,7 @@ void Spells::coldRay() {
void Spells::createFood() {
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
party._food += party._activeParty.size();
sound.playFX(20);
@@ -315,7 +315,7 @@ void Spells::createFood() {
void Spells::cureDisease() {
Interface &intf = *_vm->_interface;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character *c = SpellOnWho::show(_vm, MS_CureDisease);
if (!c)
@@ -329,7 +329,7 @@ void Spells::cureDisease() {
void Spells::cureParalysis() {
Interface &intf = *_vm->_interface;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character *c = SpellOnWho::show(_vm, MS_CureParalysis);
if (!c)
@@ -343,7 +343,7 @@ void Spells::cureParalysis() {
void Spells::curePoison() {
Interface &intf = *_vm->_interface;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character *c = SpellOnWho::show(_vm, MS_CurePoison);
if (!c)
@@ -356,7 +356,7 @@ void Spells::curePoison() {
}
void Spells::cureWounds() {
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character *c = SpellOnWho::show(_vm, MS_CureWounds);
if (!c)
@@ -372,7 +372,7 @@ void Spells::cureWounds() {
void Spells::dancingSword() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = _vm->getRandomNumber(6, 14) * combat._oldCharacter->getCurrentLevel();
combat._damageType = DT_PHYSICAL;
@@ -384,7 +384,7 @@ void Spells::dancingSword() {
void Spells::dayOfProtection() {
Combat &combat = *_vm->_combat;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
int lvl = combat._oldCharacter->getCurrentLevel();
party._walkOnWaterActive = true;
@@ -402,7 +402,7 @@ void Spells::dayOfProtection() {
void Spells::dayOfSorcery() {
Combat &combat = *_vm->_combat;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
int lvl = combat._oldCharacter->getCurrentLevel();
party._powerShield = lvl;
@@ -416,7 +416,7 @@ void Spells::dayOfSorcery() {
void Spells::deadlySwarm() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 40;
combat._damageType = DT_PHYSICAL;
@@ -431,7 +431,7 @@ void Spells::detectMonster() {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Window &w = screen._windows[19];
bool isDarkCc = _vm->_files->_isDarkCc;
int grid[7][7];
@@ -477,7 +477,7 @@ void Spells::divineIntervention() {
Combat &combat = *_vm->_combat;
Interface &intf = *_vm->_interface;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character &castChar = *combat._oldCharacter;
if ((castChar._tempAge + 5) > 250) {
@@ -499,7 +499,7 @@ void Spells::divineIntervention() {
void Spells::dragonSleep() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 0;
combat._damageType = DT_DRAGONSLEEP;
@@ -510,7 +510,7 @@ void Spells::dragonSleep() {
void Spells::elementalStorm() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
static const int STORM_FX_LIST[4] = { 13, 14, 15, 17 };
static const int STORM_MA_LIST[4] = { 0, 5, 9, 10 };
@@ -535,7 +535,7 @@ void Spells::enchantItem() {
void Spells::energyBlast() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = combat._oldCharacter->getCurrentLevel() * 2;
combat._damageType = DT_ENERGY;
@@ -547,7 +547,7 @@ void Spells::energyBlast() {
void Spells::etherialize() {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Common::Point pt = party._mazePosition + Common::Point(
SCREEN_POSITIONING_X[party._mazeDirection][7],
SCREEN_POSITIONING_Y[party._mazeDirection][7]
@@ -564,7 +564,7 @@ void Spells::etherialize() {
void Spells::fantasticFreeze() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 40;
combat._damageType = DT_COLD;
@@ -575,7 +575,7 @@ void Spells::fantasticFreeze() {
void Spells::fieryFlail() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 100;
combat._damageType = DT_FIRE;
@@ -586,7 +586,7 @@ void Spells::fieryFlail() {
void Spells::fingerOfDeath() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 0;
combat._damageType = DT_FINGEROFDEATH;
@@ -597,7 +597,7 @@ void Spells::fingerOfDeath() {
void Spells::fireball() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = _vm->getRandomNumber(3, 7) * combat._oldCharacter->getCurrentLevel();
combat._damageType = DT_FIRE;
@@ -607,7 +607,7 @@ void Spells::fireball() {
}
void Spells::firstAid() {
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character *c = SpellOnWho::show(_vm, MS_FirstAid);
if (!c)
@@ -623,7 +623,7 @@ void Spells::firstAid() {
void Spells::flyingFist() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 6;
combat._damageType = DT_PHYSICAL;
@@ -634,7 +634,7 @@ void Spells::flyingFist() {
void Spells::frostbite() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 35;
combat._damageType = DT_COLD;
@@ -645,7 +645,7 @@ void Spells::frostbite() {
void Spells::golemStopper() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 0;
combat._damageType = DT_GOLEMSTOPPER;
@@ -657,7 +657,7 @@ void Spells::golemStopper() {
void Spells::heroism() {
Combat &combat = *_vm->_combat;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
sound.playFX(30);
party._heroism = combat._oldCharacter->getCurrentLevel();
@@ -666,7 +666,7 @@ void Spells::heroism() {
void Spells::holyBonus() {
Combat &combat = *_vm->_combat;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
sound.playFX(30);
party._holyBonus = combat._oldCharacter->getCurrentLevel();
@@ -674,7 +674,7 @@ void Spells::holyBonus() {
void Spells::holyWord() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 0;
combat._damageType = DT_HOLYWORD;
@@ -685,7 +685,7 @@ void Spells::holyWord() {
void Spells::hypnotize() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 0;
combat._damageType = DT_HYPNOTIZE;
@@ -707,7 +707,7 @@ void Spells::identifyMonster() {
void Spells::implosion() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 1000;
combat._damageType = DT_ENERGY;
@@ -718,7 +718,7 @@ void Spells::implosion() {
void Spells::incinerate() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 250;
combat._damageType = DT_FIRE;
@@ -729,7 +729,7 @@ void Spells::incinerate() {
void Spells::inferno() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 250;
combat._damageType = DT_FIRE;
@@ -740,7 +740,7 @@ void Spells::inferno() {
void Spells::insectSpray() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 0;
combat._damageType = DT_INSECT_SPRAY;
@@ -766,7 +766,7 @@ void Spells::itemToGold() {
void Spells::jump() {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
if (map._isOutdoors) {
map.getCell(7);
@@ -809,7 +809,7 @@ void Spells::levitate() {
void Spells::light() {
Interface &intf = *_vm->_interface;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
++party._lightCount;
if (intf._intrIndex1)
@@ -819,7 +819,7 @@ void Spells::light() {
void Spells::lightningBolt() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = _vm->getRandomNumber(4, 6) * combat._oldCharacter->getCurrentLevel();
combat._damageType = DT_ELECTRICAL;
@@ -847,7 +847,7 @@ void Spells::magicArrow() {
void Spells::massDistortion() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 0;
combat._damageType = DT_MASS_DISTORTION;
@@ -858,7 +858,7 @@ void Spells::massDistortion() {
void Spells::megaVolts() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 150;
combat._damageType = DT_ELECTRICAL;
@@ -871,7 +871,7 @@ void Spells::moonRay() {
Combat &combat = *_vm->_combat;
Interface &intf = *_vm->_interface;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 30;
combat._damageType = DT_ENERGY;
@@ -888,7 +888,7 @@ void Spells::moonRay() {
}
void Spells::naturesCure() {
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character *c = SpellOnWho::show(_vm, MS_NaturesCure);
if (!c)
@@ -904,7 +904,7 @@ void Spells::naturesCure() {
void Spells::pain() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 0;
combat._damageType = DT_PHYSICAL;
@@ -915,7 +915,7 @@ void Spells::pain() {
void Spells::poisonVolley() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 10;
combat._damageType = DT_POISON_VOLLEY;
@@ -925,7 +925,7 @@ void Spells::poisonVolley() {
}
void Spells::powerCure() {
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character *c = SpellOnWho::show(_vm, MS_PowerCure);
if (!c)
@@ -942,7 +942,7 @@ void Spells::powerCure() {
void Spells::powerShield() {
Combat &combat = *_vm->_combat;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
sound.playFX(20);
party._powerShield = combat._oldCharacter->getCurrentLevel();
@@ -950,7 +950,7 @@ void Spells::powerShield() {
void Spells::prismaticLight() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 80;
combat._damageType = (DamageType)_vm->getRandomNumber(DT_PHYSICAL, DT_ENERGY);
@@ -963,7 +963,7 @@ void Spells::protectionFromElements() {
Combat &combat = *_vm->_combat;
Interface &intf = *_vm->_interface;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character &c = *combat._oldCharacter;
int resist = MIN(c.getCurrentLevel() * 2 + 5, (uint)200);
@@ -993,7 +993,7 @@ void Spells::protectionFromElements() {
void Spells::raiseDead() {
Interface &intf = *_vm->_interface;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character *c = SpellOnWho::show(_vm, MS_RaiseDead);
if (!c)
@@ -1027,7 +1027,7 @@ void Spells::rechargeItem() {
void Spells::resurrection() {
Interface &intf = *_vm->_interface;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character *c = SpellOnWho::show(_vm, MS_RaiseDead);
if (!c)
@@ -1054,7 +1054,7 @@ void Spells::resurrection() {
void Spells::revitalize() {
Interface &intf = *_vm->_interface;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character *c = SpellOnWho::show(_vm, MS_Revitalize);
if (!c)
@@ -1068,7 +1068,7 @@ void Spells::revitalize() {
void Spells::shrapMetal() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = combat._oldCharacter->getCurrentLevel() * 2;
combat._damageType = DT_PHYSICAL;
@@ -1079,7 +1079,7 @@ void Spells::shrapMetal() {
void Spells::sleep() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 0;
combat._damageType = DT_SLEEP;
@@ -1090,7 +1090,7 @@ void Spells::sleep() {
void Spells::sparks() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = combat._oldCharacter->getCurrentLevel() * 2;
combat._damageType = DT_ELECTRICAL;
@@ -1101,7 +1101,7 @@ void Spells::sparks() {
void Spells::starBurst() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 500;
combat._damageType = DT_FIRE;
@@ -1112,7 +1112,7 @@ void Spells::starBurst() {
void Spells::stoneToFlesh() {
Interface &intf = *_vm->_interface;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character *c = SpellOnWho::show(_vm, MS_StoneToFlesh);
if (!c)
@@ -1126,7 +1126,7 @@ void Spells::stoneToFlesh() {
void Spells::sunRay() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 200;
combat._damageType = DT_ENERGY;
@@ -1138,7 +1138,7 @@ void Spells::sunRay() {
void Spells::superShelter() {
Interface &intf = *_vm->_interface;
Map &map = *_vm->_map;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
if (map.mazeData()._mazeFlags & RESTRICTION_SUPER_SHELTER) {
spellFailed();
@@ -1153,7 +1153,7 @@ void Spells::superShelter() {
void Spells::suppressDisease() {
Interface &intf = *_vm->_interface;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character *c = SpellOnWho::show(_vm, MS_SuppressDisease);
if (!c)
@@ -1173,7 +1173,7 @@ void Spells::suppressDisease() {
void Spells::suppressPoison() {
Interface &intf = *_vm->_interface;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Character *c = SpellOnWho::show(_vm, MS_FirstAid);
if (!c)
@@ -1194,7 +1194,7 @@ void Spells::suppressPoison() {
void Spells::teleport() {
Map &map = *_vm->_map;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
if (map.mazeData()._mazeFlags & RESTRICTION_TELPORT) {
spellFailed();
@@ -1216,7 +1216,7 @@ void Spells::timeDistortion() {
Interface &intf = *_vm->_interface;
Map &map = *_vm->_map;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
if (map.mazeData()._mazeFlags & RESTRICTION_TIME_DISTORTION) {
spellFailed();
@@ -1230,7 +1230,7 @@ void Spells::timeDistortion() {
void Spells::townPortal() {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
if (map.mazeData()._mazeFlags & RESTRICTION_TOWN_PORTAL) {
spellFailed();
@@ -1278,7 +1278,7 @@ void Spells::townPortal() {
void Spells::toxicCloud() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 10;
combat._damageType = DT_POISON;
@@ -1289,7 +1289,7 @@ void Spells::toxicCloud() {
void Spells::turnUndead() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 0;
combat._damageType = DT_UNDEAD;
@@ -1300,7 +1300,7 @@ void Spells::turnUndead() {
void Spells::walkOnWater() {
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
party._walkOnWaterActive = true;
sound.playFX(20);
@@ -1308,7 +1308,7 @@ void Spells::walkOnWater() {
void Spells::wizardEye() {
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
party._wizardEyeActive = true;
party._automapOn = false;
@@ -1317,7 +1317,7 @@ void Spells::wizardEye() {
void Spells::frostbite2() {
Combat &combat = *_vm->_combat;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
combat._monsterDamage = 35;
combat._damageType = DT_COLD;
diff --git a/engines/xeen/town.cpp b/engines/xeen/town.cpp
index cc83563de2..7cba3853f2 100644
--- a/engines/xeen/town.cpp
+++ b/engines/xeen/town.cpp
@@ -69,7 +69,7 @@ int Town::townAction(int actionId) {
Map &map = *_vm->_map;
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
bool isDarkCc = _vm->_files->_isDarkCc;
if (actionId == 12) {
@@ -548,7 +548,7 @@ Character *Town::doBlacksmithOptions(Character *c) {
Character *Town::doGuildOptions(Character *c) {
Interface &intf = *_vm->_interface;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
bool isDarkCc = _vm->_files->_isDarkCc;
if (_buttonValue >= Common::KEYCODE_F1 && _buttonValue <= Common::KEYCODE_F6) {
@@ -584,7 +584,7 @@ Character *Town::doTavernOptions(Character *c) {
Interface &intf = *_vm->_interface;
Map &map = *_vm->_map;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Screen &screen = *_vm->_screen;
bool isDarkCc = _vm->_files->_isDarkCc;
int idx = 0;
@@ -788,7 +788,7 @@ Character *Town::doTavernOptions(Character *c) {
Character *Town::doTempleOptions(Character *c) {
Interface &intf = *_vm->_interface;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
switch (_buttonValue) {
case Common::KEYCODE_F1:
@@ -888,7 +888,7 @@ Character *Town::doTempleOptions(Character *c) {
Character *Town::doTrainingOptions(Character *c) {
Interface &intf = *_vm->_interface;
Party &party = *_vm->_party;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
bool isDarkCc = _vm->_files->_isDarkCc;
switch (_buttonValue) {
@@ -956,7 +956,7 @@ Character *Town::doTrainingOptions(Character *c) {
void Town::depositWithdrawl(int choice) {
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
int gold, gems;
if (choice) {
@@ -1057,7 +1057,7 @@ void Town::depositWithdrawl(int choice) {
void Town::drawTownAnim(bool flag) {
Interface &intf = *_vm->_interface;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
bool isDarkCc = _vm->_files->_isDarkCc;
if (_townActionId == 1) {
diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.cpp b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
index bbbe138a58..514bcac901 100644
--- a/engines/xeen/worldofxeen/darkside_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
@@ -30,7 +30,7 @@ namespace Xeen {
bool DarkSideCutscenes::showDarkSideTitle() {
EventsManager &events = *_vm->_events;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
// TODO: Starting method, and sound
//sub_28F40
@@ -137,7 +137,7 @@ bool DarkSideCutscenes::showDarkSideTitle() {
bool DarkSideCutscenes::showDarkSideIntro() {
EventsManager &events = *_vm->_events;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
const int XLIST1[] = {
0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 58, 60, 62
};
@@ -236,13 +236,13 @@ bool DarkSideCutscenes::showDarkSideIntro() {
bool DarkSideCutscenes::showDarkSideEnding() {
EventsManager &events = *_vm->_events;
Screen &screen = *_vm->_screen;
- SoundManager &sound = *_vm->_sound;
+ Sound &sound = *_vm->_sound;
Voc voc("ido2.voc");
- Music newBright("newbrigh.m");
+// Music newBright("newbrigh.m");
SpriteResource box("box.vga");
- newBright.play();
+// newBright.play();
screen.loadBackground("scene1.raw");
screen.loadPalette("endgame.pal");
screen.update();
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp
index e549c8e845..c67ee07b69 100644
--- a/engines/xeen/xeen.cpp
+++ b/engines/xeen/xeen.cpp
@@ -95,11 +95,10 @@ void XeenEngine::initialize() {
_screen = new Screen(this);
_scripts = new Scripts(this);
_screen->setupWindows();
- _sound = new SoundManager(this, _mixer);
+ _sound = new Sound(this, _mixer);
_spells = new Spells(this);
_town = new Town(this);
Voc::init(this);
- Music::init(this);
File f("029.obj");
_eventData = f.readStream(f.size());
diff --git a/engines/xeen/xeen.h b/engines/xeen/xeen.h
index 389d73dcc3..d0a69394e1 100644
--- a/engines/xeen/xeen.h
+++ b/engines/xeen/xeen.h
@@ -147,7 +147,7 @@ public:
SavesManager *_saves;
Screen *_screen;
Scripts *_scripts;
- SoundManager *_sound;
+ Sound *_sound;
Spells *_spells;
Town *_town;
Mode _mode;