aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorjohndoe1232011-06-28 09:37:15 +0000
committerWillem Jan Palenstijn2013-05-08 20:30:57 +0200
commitce4ef688b3c52016f31e02c2cf3f2fc6703343ba (patch)
treec57b716386e1e48b992ca1c297f4a7f44c748c3d /engines
parent4a01a69e37633aad402cea8477d812df4391a84d (diff)
downloadscummvm-rg350-ce4ef688b3c52016f31e02c2cf3f2fc6703343ba.tar.gz
scummvm-rg350-ce4ef688b3c52016f31e02c2cf3f2fc6703343ba.tar.bz2
scummvm-rg350-ce4ef688b3c52016f31e02c2cf3f2fc6703343ba.zip
NEVERHOOD: Add skeleton for Module1500 (the intro module)
Diffstat (limited to 'engines')
-rw-r--r--engines/neverhood/entity.h1
-rw-r--r--engines/neverhood/module.mk1
-rw-r--r--engines/neverhood/module1500.cpp93
-rw-r--r--engines/neverhood/module1500.h47
-rw-r--r--engines/neverhood/neverhood.h4
5 files changed, 145 insertions, 1 deletions
diff --git a/engines/neverhood/entity.h b/engines/neverhood/entity.h
index 0b0fc74e19..fe5d07e585 100644
--- a/engines/neverhood/entity.h
+++ b/engines/neverhood/entity.h
@@ -52,6 +52,7 @@ public:
if (_updateHandlerCb)
(this->*_updateHandlerCb)();
}
+ bool hasMessageHandler() const { return _messageHandlerCb != NULL; }
uint32 sendMessage(int messageNum, const MessageParam &param, Entity *sender) {
return _messageHandlerCb ? (this->*_messageHandlerCb)(messageNum, param, sender) : 0;
}
diff --git a/engines/neverhood/module.mk b/engines/neverhood/module.mk
index ef6caba6dd..97ad70e654 100644
--- a/engines/neverhood/module.mk
+++ b/engines/neverhood/module.mk
@@ -7,6 +7,7 @@ MODULE_OBJS = \
gamemodule.o \
graphics.o \
module.o \
+ module1500.o \
neverhood.o \
palette.o \
resource.o \
diff --git a/engines/neverhood/module1500.cpp b/engines/neverhood/module1500.cpp
new file mode 100644
index 0000000000..05a3bec907
--- /dev/null
+++ b/engines/neverhood/module1500.cpp
@@ -0,0 +1,93 @@
+/* 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 "neverhood/module1500.h"
+
+namespace Neverhood {
+
+Module1500::Module1500(NeverhoodEngine *vm, Module *parentModule, int which, bool flag)
+ : Module(vm, parentModule), _flag(flag) {
+
+ if (which < 0) {
+ switch (_vm->gameState().sceneNum) {
+ case 1:
+ createScene1502();
+ break;
+ case 2:
+ createScene1503();
+ break;
+ case 3:
+ createScene1504();
+ break;
+ default:
+ createScene1501();
+ }
+ } else {
+ createScene1504();
+ }
+
+}
+
+void Module1500::update() {
+ _childObject->handleUpdate();
+ if (_done) {
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ switch (_vm->gameState().sceneNum) {
+ case 0:
+ createScene1502();
+ break;
+ case 1:
+ if (_flag) {
+ createScene1503();
+ } else {
+ _parentModule->sendMessage(0x1009, 0, this);
+ }
+ break;
+ case 3:
+ createScene1501();
+ break;
+ default:
+ _parentModule->sendMessage(0x1009, 0, this);
+ break;
+ }
+ }
+}
+
+void Module1500::createScene1501() {
+ // TODO
+}
+
+void Module1500::createScene1502() {
+ // TODO
+}
+
+void Module1500::createScene1503() {
+ // TODO
+}
+
+void Module1500::createScene1504() {
+ // TODO
+}
+
+} // End of namespace Neverhood
diff --git a/engines/neverhood/module1500.h b/engines/neverhood/module1500.h
new file mode 100644
index 0000000000..d4a4310cdc
--- /dev/null
+++ b/engines/neverhood/module1500.h
@@ -0,0 +1,47 @@
+/* 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.
+ *
+ */
+
+// TODO: I couldn't come up with a better name than 'Module' so far
+
+#ifndef NEVERHOOD_MODULE1500_H
+#define NEVERHOOD_MODULE1500_H
+
+#include "neverhood/neverhood.h"
+#include "neverhood/module.h"
+
+namespace Neverhood {
+
+class Module1500 : public Module {
+public:
+ Module1500(NeverhoodEngine *vm, Module *parentModule, int which, bool flag);
+protected:
+ bool _flag;
+ void update();
+ void createScene1501();
+ void createScene1502();
+ void createScene1503();
+ void createScene1504();
+};
+
+} // End of namespace Neverhood
+
+#endif /* NEVERHOOD_MODULE1500_H */
diff --git a/engines/neverhood/neverhood.h b/engines/neverhood/neverhood.h
index edbf165654..8a95b05f94 100644
--- a/engines/neverhood/neverhood.h
+++ b/engines/neverhood/neverhood.h
@@ -46,7 +46,7 @@ struct NeverhoodGameDescription;
class ResourceMan;
struct GameState {
- int field1;
+ int sceneNum;
};
class NeverhoodEngine : public ::Engine {
@@ -111,6 +111,8 @@ public:
static kReadSaveHeaderError readSaveHeader(Common::SeekableReadStream *in, bool loadThumbnail, SaveHeader &header);
#endif
+ GameState& gameState() { return _gameState; }
+
public:
};