aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/gob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gob/gob.cpp')
-rw-r--r--engines/gob/gob.cpp62
1 files changed, 41 insertions, 21 deletions
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index 863665357b..951f331cbe 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "common/events.h"
@@ -37,18 +36,16 @@
#include "gob/util.h"
#include "gob/dataio.h"
#include "gob/game.h"
-#include "gob/sound.h"
+#include "gob/sound/sound.h"
#include "gob/init.h"
#include "gob/inter.h"
#include "gob/draw.h"
-#include "gob/cdrom.h"
#include "gob/goblin.h"
#include "gob/map.h"
#include "gob/mult.h"
#include "gob/palanim.h"
#include "gob/parse.h"
#include "gob/scenery.h"
-#include "gob/music.h"
#include "gob/videoplayer.h"
#include "gob/saveload.h"
@@ -71,13 +68,12 @@ const Common::Language GobEngine::_gobToScummVMLang[] = {
GobEngine::GobEngine(OSystem *syst) : Engine(syst) {
_vm = this;
- _snd = 0; _adlib = 0; _mult = 0;
- _game = 0; _global = 0; _cdrom = 0;
- _dataIO = 0; _goblin = 0; _vidPlayer = 0;
- _init = 0; _inter = 0; _map = 0;
- _palAnim = 0; _parse = 0; _scenery = 0;
- _draw = 0; _util = 0; _video = 0;
- _saveLoad = 0;
+ _sound = 0; _mult = 0; _game = 0;
+ _global = 0; _dataIO = 0; _goblin = 0;
+ _vidPlayer = 0; _init = 0; _inter = 0;
+ _map = 0; _palAnim = 0; _parse = 0;
+ _scenery = 0; _draw = 0; _util = 0;
+ _video = 0; _saveLoad = 0;
// Setup mixer
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
@@ -118,6 +114,12 @@ void GobEngine::shutdown() {
_quitRequested = true;
}
+const char *GobEngine::getLangDesc(int16 language) const {
+ if ((language < 0) || (language > 8))
+ language = 2;
+ return Common::getLanguageDescription(_gobToScummVMLang[language]);
+}
+
void GobEngine::validateLanguage() {
if (_vm->_global->_languageWanted != _vm->_global->_language) {
warning("Your game version doesn't support the requested language %s",
@@ -140,6 +142,30 @@ void GobEngine::validateVideoMode(int16 videoMode) {
error("Video mode 0x%X is not supported!", videoMode);
}
+Common::Platform GobEngine::getPlatform() const {
+ return _platform;
+}
+
+GameType GobEngine::getGameType() const {
+ return _gameType;
+}
+
+bool GobEngine::isCD() const {
+ return (_features & kFeaturesCD) != 0;
+}
+
+bool GobEngine::isEGA() const {
+ return (_features & kFeaturesEGA) != 0;
+}
+
+bool GobEngine::is640() const {
+ return (_features & kFeatures640) != 0;
+}
+
+bool GobEngine::hasAdlib() const {
+ return (_features & kFeaturesAdlib) != 0;
+}
+
int GobEngine::init() {
if (!initGameParts()) {
GUIErrorMessage("GobEngine::init(): Unknown version of game engine");
@@ -220,7 +246,8 @@ int GobEngine::init() {
}
bool GobEngine::initGameParts() {
- _adlib = 0;
+ _noMusic = MidiDriver::parseMusicDriver(ConfMan.get("music_driver")) == MD_NULL;
+
_saveLoad = 0;
_global = new Global(this);
@@ -228,8 +255,7 @@ bool GobEngine::initGameParts() {
_dataIO = new DataIO(this);
_palAnim = new PalAnim(this);
_vidPlayer = new VideoPlayer(this);
- _cdrom = new CDROM(this);
- _snd = new Snd(this);
+ _sound = new Sound(this);
switch (_gameType) {
case kGameTypeGob1:
@@ -336,10 +362,6 @@ bool GobEngine::initGameParts() {
break;
}
- _noMusic = MidiDriver::parseMusicDriver(ConfMan.get("music_driver")) == MD_NULL;
- if (!_noMusic && hasAdlib())
- _adlib = new Adlib(this);
-
if (is640()) {
_video->_surfWidth = _width = 640;
_video->_surfHeight = _video->_splitHeight1 = _height = 480;
@@ -360,12 +382,9 @@ bool GobEngine::initGameParts() {
}
void GobEngine::deinitGameParts() {
- delete _snd; _snd = 0;
- delete _adlib; _adlib = 0;
delete _mult; _mult = 0;
delete _game; _game = 0;
delete _global; _global = 0;
- delete _cdrom; _cdrom = 0;
delete _dataIO; _dataIO = 0;
delete _goblin; _goblin = 0;
delete _vidPlayer; _vidPlayer = 0;
@@ -379,6 +398,7 @@ void GobEngine::deinitGameParts() {
delete _util; _util = 0;
delete _video; _video = 0;
delete _saveLoad; _saveLoad = 0;
+ delete _sound; _sound = 0;
}
} // End of namespace Gob