aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2009-11-12 10:07:44 +0000
committerPaul Gilbert2009-11-12 10:07:44 +0000
commit94f5c0a2f85a181c6b42f2851270b46de603e1cb (patch)
treed5d9ed43a51f9d87066b8f3638623b2738e42822 /engines
parent44afaf9bf1fb8a0c4c77bdf033324a7bea82a151 (diff)
downloadscummvm-rg350-94f5c0a2f85a181c6b42f2851270b46de603e1cb.tar.gz
scummvm-rg350-94f5c0a2f85a181c6b42f2851270b46de603e1cb.tar.bz2
scummvm-rg350-94f5c0a2f85a181c6b42f2851270b46de603e1cb.zip
Added a staticres file with the MADS articles list, and added an article field to the MADSObject class
svn-id: r45856
Diffstat (limited to 'engines')
-rw-r--r--engines/m4/console.cpp6
-rw-r--r--engines/m4/globals.cpp1
-rw-r--r--engines/m4/globals.h13
-rw-r--r--engines/m4/module.mk1
-rw-r--r--engines/m4/staticres.cpp34
-rw-r--r--engines/m4/staticres.h38
6 files changed, 91 insertions, 2 deletions
diff --git a/engines/m4/console.cpp b/engines/m4/console.cpp
index 17fa20882a..99540743e9 100644
--- a/engines/m4/console.cpp
+++ b/engines/m4/console.cpp
@@ -26,6 +26,7 @@
#include "m4/m4.h"
#include "m4/console.h"
#include "m4/scene.h"
+#include "m4/staticres.h"
namespace M4 {
@@ -327,8 +328,9 @@ bool Console::cmdObject(int argc, const char **argv) {
else {
const MadsObject *obj = _vm->_globals->getObject(id);
- DebugPrintf("Object #%d (%s) room=%d vocabs=%d", id, _vm->_globals->getVocab(obj->descId),
- obj->roomNumber, obj->vocabCount);
+ DebugPrintf("Object #%d (%s) room=%d article=%d/%s vocabs=%d", id, _vm->_globals->getVocab(obj->descId),
+ obj->roomNumber, (int)obj->article, englishMADSArticleList[obj->article], obj->vocabCount);
+
if (obj->vocabCount > 0) {
DebugPrintf(" - ");
for (int i = 0; i < obj->vocabCount; ++i) {
diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp
index 55a8e61cd7..64681b3e4d 100644
--- a/engines/m4/globals.cpp
+++ b/engines/m4/globals.cpp
@@ -471,6 +471,7 @@ MadsObject::MadsObject(Common::SeekableReadStream *stream) {
// Extract object data fields
descId = READ_LE_UINT16(&obj[0]);
roomNumber = READ_LE_UINT16(&obj[2]);
+ article = (MADSArticles)obj[4];
vocabCount = obj[5];
assert(vocabCount <= 3);
diff --git a/engines/m4/globals.h b/engines/m4/globals.h
index c77f0b2089..31d5baa6c2 100644
--- a/engines/m4/globals.h
+++ b/engines/m4/globals.h
@@ -151,6 +151,18 @@ public:
#define PLAYER_INVENTORY 2
+enum MADSArticles {
+ kArticleNone = 0,
+ kArticleWith = 1,
+ kArticleTo = 2,
+ kArticleAt = 3,
+ kArticleFrom = 4,
+ kArticleOn = 5,
+ kArticleIn = 6,
+ kArticleUnder = 7,
+ kArticleBehind = 8
+};
+
struct VocabEntry {
uint16 unk;
uint16 vocabId;
@@ -164,6 +176,7 @@ public:
uint16 descId;
uint16 roomNumber;
+ MADSArticles article;
uint8 vocabCount;
VocabEntry vocabList[3];
};
diff --git a/engines/m4/module.mk b/engines/m4/module.mk
index eea75cab24..2f5756a12f 100644
--- a/engines/m4/module.mk
+++ b/engines/m4/module.mk
@@ -27,6 +27,7 @@ MODULE_OBJS = \
script.o \
sound.o \
sprite.o \
+ staticres.o \
viewmgr.o \
woodscript.o \
ws_machine.o \
diff --git a/engines/m4/staticres.cpp b/engines/m4/staticres.cpp
new file mode 100644
index 0000000000..f7da10410b
--- /dev/null
+++ b/engines/m4/staticres.cpp
@@ -0,0 +1,34 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "m4/staticres.h"
+
+namespace M4 {
+
+const char *englishMADSArticleList[9] = {
+ NULL, "with", "to", "at", "from", "on", "in", "under", "behind"
+};
+
+} // End of namespace M4
diff --git a/engines/m4/staticres.h b/engines/m4/staticres.h
new file mode 100644
index 0000000000..b3cba62e59
--- /dev/null
+++ b/engines/m4/staticres.h
@@ -0,0 +1,38 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef M4_STATICRES_H
+#define M4_STATICRES_H
+
+#include "common/scummsys.h"
+#include "m4/m4.h"
+
+namespace M4 {
+
+extern const char *englishMADSArticleList[9];
+
+} // End of namespace M4
+
+#endif