aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gob/gob.cpp12
-rw-r--r--engines/gob/inter.h11
-rw-r--r--engines/gob/inter_littlered.cpp49
-rw-r--r--engines/gob/inter_v2.cpp6
-rw-r--r--engines/gob/module.mk1
5 files changed, 75 insertions, 4 deletions
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index acd8fcb468..a13f6a372f 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -438,7 +438,6 @@ bool GobEngine::initGameParts() {
break;
case kGameTypeWeen:
- case kGameTypeLittleRed:
case kGameTypeGob2:
_init = new Init_v2(this);
_video = new Video_v2(this);
@@ -463,6 +462,17 @@ bool GobEngine::initGameParts() {
_saveLoad = new SaveLoad_v2(this, _targetName.c_str());
break;
+ case kGameTypeLittleRed:
+ _init = new Init_v2(this);
+ _video = new Video_v2(this);
+ _inter = new Inter_LittleRed(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);
+ break;
+
case kGameTypeGob3:
_init = new Init_v3(this);
_video = new Video_v2(this);
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index 1e6f74db4e..907a275e50 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -513,6 +513,17 @@ protected:
void oFascin_setWinFlags();
};
+class Inter_LittleRed : public Inter_v2 {
+public:
+ Inter_LittleRed(GobEngine *vm);
+ virtual ~Inter_LittleRed() {}
+
+protected:
+ virtual void setupOpcodesDraw();
+ virtual void setupOpcodesFunc();
+ virtual void setupOpcodesGob();
+};
+
class Inter_v3 : public Inter_v2 {
public:
Inter_v3(GobEngine *vm);
diff --git a/engines/gob/inter_littlered.cpp b/engines/gob/inter_littlered.cpp
new file mode 100644
index 0000000000..6a63998216
--- /dev/null
+++ b/engines/gob/inter_littlered.cpp
@@ -0,0 +1,49 @@
+/* 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/inter.h"
+
+namespace Gob {
+
+#define OPCODEVER Inter_LittleRed
+#define OPCODEDRAW(i, x) _opcodesDraw[i]._OPCODEDRAW(OPCODEVER, x)
+#define OPCODEFUNC(i, x) _opcodesFunc[i]._OPCODEFUNC(OPCODEVER, x)
+#define OPCODEGOB(i, x) _opcodesGob[i]._OPCODEGOB(OPCODEVER, x)
+
+Inter_LittleRed::Inter_LittleRed(GobEngine *vm) : Inter_v2(vm) {
+}
+
+void Inter_LittleRed::setupOpcodesDraw() {
+ Inter_v2::setupOpcodesDraw();
+}
+
+void Inter_LittleRed::setupOpcodesFunc() {
+ Inter_v2::setupOpcodesFunc();
+}
+
+void Inter_LittleRed::setupOpcodesGob() {
+ OPCODEGOB(500, o2_playProtracker);
+ OPCODEGOB(501, o2_stopProtracker);
+}
+
+} // End of namespace Gob
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 54f6a1acc1..cb58fe86f7 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -1248,7 +1248,7 @@ void Inter_v2::o2_checkData(OpFuncParams &params) {
file = "EMAP2011.TOT";
int32 size = -1;
- SaveLoad::SaveMode mode = _vm->_saveLoad->getSaveMode(file.c_str());
+ SaveLoad::SaveMode mode = _vm->_saveLoad ? _vm->_saveLoad->getSaveMode(file.c_str()) : SaveLoad::kSaveModeNone;
if (mode == SaveLoad::kSaveModeNone) {
size = _vm->_dataIO->fileSize(file);
@@ -1277,7 +1277,7 @@ void Inter_v2::o2_readData(OpFuncParams &params) {
debugC(2, kDebugFileIO, "Read from file \"%s\" (%d, %d bytes at %d)",
file, dataVar, size, offset);
- SaveLoad::SaveMode mode = _vm->_saveLoad->getSaveMode(file);
+ SaveLoad::SaveMode mode = _vm->_saveLoad ? _vm->_saveLoad->getSaveMode(file) : SaveLoad::kSaveModeNone;
if (mode == SaveLoad::kSaveModeSave) {
WRITE_VAR(1, 1);
@@ -1349,7 +1349,7 @@ void Inter_v2::o2_writeData(OpFuncParams &params) {
WRITE_VAR(1, 1);
- SaveLoad::SaveMode mode = _vm->_saveLoad->getSaveMode(file);
+ SaveLoad::SaveMode mode = _vm->_saveLoad ? _vm->_saveLoad->getSaveMode(file) : SaveLoad::kSaveModeNone;
if (mode == SaveLoad::kSaveModeSave) {
if (!_vm->_saveLoad->save(file, dataVar, size, offset)) {
diff --git a/engines/gob/module.mk b/engines/gob/module.mk
index 7c5d7de158..20214ea940 100644
--- a/engines/gob/module.mk
+++ b/engines/gob/module.mk
@@ -44,6 +44,7 @@ MODULE_OBJS := \
inter_v2.o \
inter_bargon.o \
inter_fascin.o \
+ inter_littlered.o \
inter_inca2.o \
inter_playtoons.o \
inter_v3.o \