diff options
author | Sven Hesse | 2012-06-28 00:07:29 +0200 |
---|---|---|
committer | Sven Hesse | 2012-07-30 01:44:42 +0200 |
commit | 4819468d9ad8218d04a2e4563ef71d7d00964515 (patch) | |
tree | efab77f1b829be3847a9b4acb2d2efa1cf5c2630 /engines | |
parent | 55c75756ea3c38cdd7074caff7085e35a658c9e7 (diff) | |
download | scummvm-rg350-4819468d9ad8218d04a2e4563ef71d7d00964515.tar.gz scummvm-rg350-4819468d9ad8218d04a2e4563ef71d7d00964515.tar.bz2 scummvm-rg350-4819468d9ad8218d04a2e4563ef71d7d00964515.zip |
GOB: Add PreGob stubs for the Once Upon A Time games
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/gob.cpp | 33 | ||||
-rw-r--r-- | engines/gob/gob.h | 2 | ||||
-rw-r--r-- | engines/gob/init.cpp | 14 | ||||
-rw-r--r-- | engines/gob/module.mk | 4 | ||||
-rw-r--r-- | engines/gob/pregob/onceupon/abracadabra.cpp | 43 | ||||
-rw-r--r-- | engines/gob/pregob/onceupon/abracadabra.h | 44 | ||||
-rw-r--r-- | engines/gob/pregob/onceupon/babayaga.cpp | 43 | ||||
-rw-r--r-- | engines/gob/pregob/onceupon/babayaga.h | 44 | ||||
-rw-r--r-- | engines/gob/pregob/onceupon/onceupon.cpp | 37 | ||||
-rw-r--r-- | engines/gob/pregob/onceupon/onceupon.h | 42 | ||||
-rw-r--r-- | engines/gob/pregob/pregob.cpp | 35 | ||||
-rw-r--r-- | engines/gob/pregob/pregob.h | 43 |
12 files changed, 380 insertions, 4 deletions
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index ef9a7112f9..02aea63377 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -48,6 +48,10 @@ #include "gob/videoplayer.h" #include "gob/save/saveload.h" +#include "gob/pregob/pregob.h" +#include "gob/pregob/onceupon/abracadabra.h" +#include "gob/pregob/onceupon/babayaga.h" + namespace Gob { #define MAX_TIME_DELTA 100 @@ -115,7 +119,7 @@ GobEngine::GobEngine(OSystem *syst) : Engine(syst), _rnd("gob") { _vidPlayer = 0; _init = 0; _inter = 0; _map = 0; _palAnim = 0; _scenery = 0; _draw = 0; _util = 0; _video = 0; - _saveLoad = 0; + _saveLoad = 0; _preGob = 0; _pauseStart = 0; @@ -398,7 +402,6 @@ Common::Error GobEngine::initGameParts() { // just detect some devices some of which will be always there if the music is not disabled _noMusic = MidiDriver::getMusicType(MidiDriver::detectDevice(MDT_PCSPK | MDT_MIDI | MDT_ADLIB)) == MT_NULL ? true : false; - _saveLoad = 0; _global = new Global(this); _util = new Util(this); @@ -607,6 +610,28 @@ Common::Error GobEngine::initGameParts() { _saveLoad = new SaveLoad_v2(this, _targetName.c_str()); break; + case kGameTypeAbracadabra: + _init = new Init_v2(this); + _video = new Video_v2(this); + _mult = new Mult_v2(this); + _draw = new Draw_v2(this); + _map = new Map_v2(this); + _goblin = new Goblin_v2(this); + _scenery = new Scenery_v2(this); + _preGob = new OnceUpon::Abracadabra(this); + break; + + case kGameTypeBabaYaga: + _init = new Init_v2(this); + _video = new Video_v2(this); + _mult = new Mult_v2(this); + _draw = new Draw_v2(this); + _map = new Map_v2(this); + _goblin = new Goblin_v2(this); + _scenery = new Scenery_v2(this); + _preGob = new OnceUpon::BabaYaga(this); + break; + default: deinitGameParts(); return Common::kUnsupportedGameidError; @@ -615,12 +640,14 @@ Common::Error GobEngine::initGameParts() { // Setup mixer syncSoundSettings(); - _inter->setupOpcodes(); + if (_inter) + _inter->setupOpcodes(); return Common::kNoError; } void GobEngine::deinitGameParts() { + delete _preGob; _preGob = 0; delete _saveLoad; _saveLoad = 0; delete _mult; _mult = 0; delete _vidPlayer; _vidPlayer = 0; diff --git a/engines/gob/gob.h b/engines/gob/gob.h index 5d4c3d7c55..9b919098d6 100644 --- a/engines/gob/gob.h +++ b/engines/gob/gob.h @@ -75,6 +75,7 @@ class Scenery; class Util; class SaveLoad; class GobConsole; +class PreGob; #define WRITE_VAR_UINT32(var, val) _vm->_inter->_variables->writeVar32(var, val) #define WRITE_VAR_UINT16(var, val) _vm->_inter->_variables->writeVar16(var, val) @@ -223,6 +224,7 @@ public: Inter *_inter; SaveLoad *_saveLoad; VideoPlayer *_vidPlayer; + PreGob *_preGob; const char *getLangDesc(int16 language) const; void validateLanguage(); diff --git a/engines/gob/init.cpp b/engines/gob/init.cpp index a61261f355..814d4d1821 100644 --- a/engines/gob/init.cpp +++ b/engines/gob/init.cpp @@ -34,9 +34,13 @@ #include "gob/inter.h" #include "gob/video.h" #include "gob/videoplayer.h" + +#include "gob/sound/sound.h" + #include "gob/demos/scnplayer.h" #include "gob/demos/batplayer.h" -#include "gob/sound/sound.h" + +#include "gob/pregob/pregob.h" namespace Gob { @@ -118,6 +122,14 @@ void Init::initGame() { return; } + if (_vm->_preGob) { + _vm->_preGob->run(); + delete _palDesc; + _vm->_video->initPrimary(-1); + cleanup(); + return; + } + Common::SeekableReadStream *infFile = _vm->_dataIO->getFile("intro.inf"); if (!infFile) { diff --git a/engines/gob/module.mk b/engines/gob/module.mk index 3395046b6c..8a792049e8 100644 --- a/engines/gob/module.mk +++ b/engines/gob/module.mk @@ -77,6 +77,10 @@ MODULE_OBJS := \ demos/scnplayer.o \ demos/batplayer.o \ detection/detection.o \ + pregob/pregob.o \ + pregob/onceupon/onceupon.o \ + pregob/onceupon/abracadabra.o \ + pregob/onceupon/babayaga.o \ minigames/geisha/evilfish.o \ minigames/geisha/oko.o \ minigames/geisha/meter.o \ diff --git a/engines/gob/pregob/onceupon/abracadabra.cpp b/engines/gob/pregob/onceupon/abracadabra.cpp new file mode 100644 index 0000000000..14a362ce12 --- /dev/null +++ b/engines/gob/pregob/onceupon/abracadabra.cpp @@ -0,0 +1,43 @@ +/* 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/textconsole.h" + +#include "gob/pregob/onceupon/abracadabra.h" + +namespace Gob { + +namespace OnceUpon { + +Abracadabra::Abracadabra(GobEngine *vm) : OnceUpon(vm) { +} + +Abracadabra::~Abracadabra() { +} + +void Abracadabra::run() { + warning("TODO: Abracadabra::run()"); +} + +} // End of namespace OnceUpon + +} // End of namespace Gob diff --git a/engines/gob/pregob/onceupon/abracadabra.h b/engines/gob/pregob/onceupon/abracadabra.h new file mode 100644 index 0000000000..855d2bf131 --- /dev/null +++ b/engines/gob/pregob/onceupon/abracadabra.h @@ -0,0 +1,44 @@ +/* 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 GOB_PREGOB_ONCEUPON_ABRACADABRA_H +#define GOB_PREGOB_ONCEUPON_ABRACADABRA_H + +#include "gob/pregob/onceupon/onceupon.h" + +namespace Gob { + +namespace OnceUpon { + +class Abracadabra : public OnceUpon { +public: + Abracadabra(GobEngine *vm); + ~Abracadabra(); + + void run(); +}; + +} // End of namespace OnceUpon + +} // End of namespace Gob + +#endif // GOB_PREGOB_ONCEUPON_ABRACADABRA_H diff --git a/engines/gob/pregob/onceupon/babayaga.cpp b/engines/gob/pregob/onceupon/babayaga.cpp new file mode 100644 index 0000000000..f2c7569460 --- /dev/null +++ b/engines/gob/pregob/onceupon/babayaga.cpp @@ -0,0 +1,43 @@ +/* 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/textconsole.h" + +#include "gob/pregob/onceupon/babayaga.h" + +namespace Gob { + +namespace OnceUpon { + +BabaYaga::BabaYaga(GobEngine *vm) : OnceUpon(vm) { +} + +BabaYaga::~BabaYaga() { +} + +void BabaYaga::run() { + warning("TODO: BabaYaga::run()"); +} + +} // End of namespace OnceUpon + +} // End of namespace Gob diff --git a/engines/gob/pregob/onceupon/babayaga.h b/engines/gob/pregob/onceupon/babayaga.h new file mode 100644 index 0000000000..b3339b0ca8 --- /dev/null +++ b/engines/gob/pregob/onceupon/babayaga.h @@ -0,0 +1,44 @@ +/* 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 GOB_PREGOB_ONCEUPON_BABAYAGA_H +#define GOB_PREGOB_ONCEUPON_BABAYAGA_H + +#include "gob/pregob/onceupon/onceupon.h" + +namespace Gob { + +namespace OnceUpon { + +class BabaYaga : public OnceUpon { +public: + BabaYaga(GobEngine *vm); + ~BabaYaga(); + + void run(); +}; + +} // End of namespace OnceUpon + +} // End of namespace Gob + +#endif // GOB_PREGOB_ONCEUPON_BABAYAGA_H diff --git a/engines/gob/pregob/onceupon/onceupon.cpp b/engines/gob/pregob/onceupon/onceupon.cpp new file mode 100644 index 0000000000..639f5b1ee8 --- /dev/null +++ b/engines/gob/pregob/onceupon/onceupon.cpp @@ -0,0 +1,37 @@ +/* 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 "gob/pregob/onceupon/onceupon.h" + +namespace Gob { + +namespace OnceUpon { + +OnceUpon::OnceUpon(GobEngine *vm) : PreGob(vm) { +} + +OnceUpon::~OnceUpon() { +} + +} // End of namespace OnceUpon + +} // End of namespace Gob diff --git a/engines/gob/pregob/onceupon/onceupon.h b/engines/gob/pregob/onceupon/onceupon.h new file mode 100644 index 0000000000..f937701537 --- /dev/null +++ b/engines/gob/pregob/onceupon/onceupon.h @@ -0,0 +1,42 @@ +/* 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 GOB_PREGOB_ONCEUPON_ONCEUPON_H +#define GOB_PREGOB_ONCEUPON_ONCEUPON_H + +#include "gob/pregob/pregob.h" + +namespace Gob { + +namespace OnceUpon { + +class OnceUpon : public PreGob { +public: + OnceUpon(GobEngine *vm); + ~OnceUpon(); +}; + +} // End of namespace OnceUpon + +} // End of namespace Gob + +#endif // GOB_PREGOB_ONCEUPON_ONCEUPON_H diff --git a/engines/gob/pregob/pregob.cpp b/engines/gob/pregob/pregob.cpp new file mode 100644 index 0000000000..ab47adaac6 --- /dev/null +++ b/engines/gob/pregob/pregob.cpp @@ -0,0 +1,35 @@ +/* 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 "gob/gob.h" + +#include "gob/pregob/pregob.h" + +namespace Gob { + +PreGob::PreGob(GobEngine *vm) : _vm(vm) { +} + +PreGob::~PreGob() { +} + +} // End of namespace Gob diff --git a/engines/gob/pregob/pregob.h b/engines/gob/pregob/pregob.h new file mode 100644 index 0000000000..e77e0ba17b --- /dev/null +++ b/engines/gob/pregob/pregob.h @@ -0,0 +1,43 @@ +/* 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 GOB_PREGOB_PREGOB_H +#define GOB_PREGOB_PREGOB_H + +namespace Gob { + +class GobEngine; + +class PreGob { +public: + PreGob(GobEngine *vm); + virtual ~PreGob(); + + virtual void run() = 0; + +protected: + GobEngine *_vm; +}; + +} // End of namespace Gob + +#endif // GOB_PREGOB_PREGOB_H |