aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2010-01-07 23:52:31 +0200
committerEugene Sandulenko2015-12-27 15:39:52 +0100
commitce6aa4dd28c2c8054e6c6287c11c717376771d90 (patch)
treedb09e6a28c583c4af5998c95d4d30ebb78d2ea2a
parentae1f601855dfef89f01100ea4947639f66d032d0 (diff)
downloadscummvm-rg350-ce6aa4dd28c2c8054e6c6287c11c717376771d90.tar.gz
scummvm-rg350-ce6aa4dd28c2c8054e6c6287c11c717376771d90.tar.bz2
scummvm-rg350-ce6aa4dd28c2c8054e6c6287c11c717376771d90.zip
WAGE: Added stubs for most classes. Implemented Obj and Scene classes.
Signed-off-by: Eugene Sandulenko <sev@scummvm.org>
-rw-r--r--engines/wage/chr.cpp37
-rw-r--r--engines/wage/chr.h39
-rw-r--r--engines/wage/design.cpp42
-rw-r--r--engines/wage/design.h53
-rw-r--r--engines/wage/designed.cpp37
-rw-r--r--engines/wage/designed.h62
-rw-r--r--engines/wage/detection.cpp15
-rw-r--r--[-rwxr-xr-x]engines/wage/macresman.cpp0
-rw-r--r--[-rwxr-xr-x]engines/wage/macresman.h2
-rw-r--r--engines/wage/obj.h166
-rw-r--r--engines/wage/scene.h171
-rw-r--r--engines/wage/script.cpp32
-rw-r--r--engines/wage/script.h42
-rw-r--r--engines/wage/sound.cpp37
-rw-r--r--engines/wage/sound.h39
-rw-r--r--engines/wage/util.cpp3
-rw-r--r--engines/wage/wage.cpp18
-rw-r--r--engines/wage/wage.h16
-rw-r--r--engines/wage/world.cpp19
-rw-r--r--engines/wage/world.h69
20 files changed, 884 insertions, 15 deletions
diff --git a/engines/wage/chr.cpp b/engines/wage/chr.cpp
new file mode 100644
index 0000000000..2c02a2da7f
--- /dev/null
+++ b/engines/wage/chr.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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "wage/wage.h"
+#include "wage/chr.h"
+
+namespace Wage {
+
+Chr::Chr() {
+}
+
+Chr::~Chr() {
+}
+
+} // End of namespace Wage
diff --git a/engines/wage/chr.h b/engines/wage/chr.h
new file mode 100644
index 0000000000..51fdce0cd5
--- /dev/null
+++ b/engines/wage/chr.h
@@ -0,0 +1,39 @@
+/* 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 WAGE_CHR_H
+#define WAGE_CHR_H
+
+namespace Wage {
+
+class Chr {
+public:
+ Chr();
+ ~Chr();
+};
+
+} // End of namespace Wage
+
+#endif
diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp
new file mode 100644
index 0000000000..ce9063c2de
--- /dev/null
+++ b/engines/wage/design.cpp
@@ -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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "wage/wage.h"
+#include "wage/design.h"
+
+namespace Wage {
+
+Design::Design(byte *data) {
+ int len = READ_UINT16(data);
+
+ _data = (byte *)malloc(len);
+ memcpy(_data, data, len);
+}
+
+Design::~Design() {
+ free(_data);
+}
+
+} // End of namespace Wage
diff --git a/engines/wage/design.h b/engines/wage/design.h
new file mode 100644
index 0000000000..2956f841c0
--- /dev/null
+++ b/engines/wage/design.h
@@ -0,0 +1,53 @@
+/* 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 WAGE_DESIGN_H
+#define WAGE_DESIGN_H
+
+#include "common/rect.h"
+
+namespace Wage {
+
+class Design {
+public:
+ Design(byte *data);
+ ~Design();
+
+ void setBounds(Common::Rect bounds) {
+ _bounds = new Common::Rect(bounds);
+ }
+
+ Common::Rect *getBounds() {
+ return new Common::Rect(*_bounds);
+ }
+
+private:
+ byte *_data;
+ Common::Rect *_bounds;
+};
+
+} // End of namespace Wage
+
+#endif
diff --git a/engines/wage/designed.cpp b/engines/wage/designed.cpp
new file mode 100644
index 0000000000..040d821ee1
--- /dev/null
+++ b/engines/wage/designed.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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "wage/wage.h"
+#include "wage/designed.h"
+#include "wage/design.h"
+
+namespace Wage {
+
+void Designed::setDesignBounds(Common::Rect bounds) {
+ _designBounds = new Common::Rect(bounds);
+ _design->setBounds(bounds);
+}
+
+} // End of namespace Wage
diff --git a/engines/wage/designed.h b/engines/wage/designed.h
new file mode 100644
index 0000000000..8ef1fa2bca
--- /dev/null
+++ b/engines/wage/designed.h
@@ -0,0 +1,62 @@
+/* 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 WAGE_DESIGNED_H
+#define WAGE_DESIGNED_H
+
+#include "common/str.h"
+#include "common/rect.h"
+
+using Common::String;
+
+namespace Wage {
+
+class Design;
+
+class Designed {
+public:
+ Designed() : _design(NULL), _designBounds(NULL) {}
+
+ String _name;
+ Design *_design;
+ Common::Rect *_designBounds;
+
+ String getName() { return _name; }
+ void setName(String name) { _name = name; }
+ String toString() { return _name; }
+
+ Design *getDesign() { return _design; }
+ void setDesign(Design *design) { _design = design; }
+
+ Common::Rect *getDesignBounds() {
+ return _designBounds == NULL ? NULL : new Common::Rect(*_designBounds);
+ }
+
+ void setDesignBounds(Common::Rect bounds);
+};
+
+} // End of namespace Wage
+
+#endif
diff --git a/engines/wage/detection.cpp b/engines/wage/detection.cpp
index 991732d4b4..3c5ac732d8 100644
--- a/engines/wage/detection.cpp
+++ b/engines/wage/detection.cpp
@@ -32,7 +32,16 @@
#include "wage/wage.h"
+namespace Wage {
+
+const char *WageEngine::getGameFile() const {
+ return _gameDescription->filesDescriptions[0].fileName;
+}
+
+}
+
static const PlainGameDescriptor cineGames[] = {
+ {"afm", "Another Fine Mess"},
{"wage", "World Adventure Game Engine game"},
{0, 0}
};
@@ -43,12 +52,12 @@ using Common::GUIO_NONE;
static const ADGameDescription gameDescriptions[] = {
{
- "wage",
- "Another Fine Mess (v1.8)",
+ "afm",
+ "v1.8",
AD_ENTRY1s("Another Fine Mess 1.8", "8e5aa915f3253efb2aab52435647b25e", 1456000),
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_USEEXTRAASTITLE,
+ ADGF_NO_FLAGS,
GUIO_NONE
},
diff --git a/engines/wage/macresman.cpp b/engines/wage/macresman.cpp
index 0dce789874..0dce789874 100755..100644
--- a/engines/wage/macresman.cpp
+++ b/engines/wage/macresman.cpp
diff --git a/engines/wage/macresman.h b/engines/wage/macresman.h
index c60d29469f..58635ae1f4 100755..100644
--- a/engines/wage/macresman.h
+++ b/engines/wage/macresman.h
@@ -44,6 +44,8 @@ public:
MacResIDArray getResIDArray(const char *typeID);
+ Common::String getFileName() { return _fileName; }
+
private:
int extractResource(int id, byte **buf);
bool init();
diff --git a/engines/wage/obj.h b/engines/wage/obj.h
new file mode 100644
index 0000000000..65049ed303
--- /dev/null
+++ b/engines/wage/obj.h
@@ -0,0 +1,166 @@
+/* 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 WAGE_OBJ_H
+#define WAGE_OBJ_H
+
+#include "common/rect.h"
+
+#include "wage/designed.h"
+
+namespace Wage {
+
+class Weapon {
+public:
+ virtual ~Weapon() {}
+ virtual String getOperativeVerb() = 0;
+ virtual int getType() = 0;
+ virtual int getAccuracy() = 0;
+ virtual int getDamage() = 0;
+ virtual String getSound() = 0;
+ virtual void decrementNumberOfUses() = 0;
+};
+
+class Design;
+class Scene;
+class Chr;
+
+class Obj : public Weapon, public Designed {
+public:
+ Obj() : _currentOwner(NULL), _currentScene(NULL) {}
+
+ enum ObjectTypes {
+ REGULAR_WEAPON = 1,
+ THROW_WEAPON = 2,
+ MAGICAL_OBJECT = 3,
+ HELMET = 4,
+ SHIELD = 5,
+ CHEST_ARMOR = 6,
+ SPIRITUAL_ARMOR = 7,
+ MOBILE_OBJECT = 8,
+ IMMOBILE_OBJECT = 9
+ };
+
+ enum AttackTypes {
+ CAUSES_PHYSICAL_DAMAGE = 0,
+ CAUSES_SPIRITUAL_DAMAGE = 1,
+ CAUSES_PHYSICAL_AND_SPIRITUAL_DAMAGE = 2,
+ HEALS_PHYSICAL_DAMAGE = 3,
+ HEALS_SPIRITUAL_DAMAGE = 4,
+ HEALS_PHYSICAL_AND_SPIRITUAL_DAMAGE = 5,
+ FREEZES_OPPONENT = 6
+ };
+
+private:
+ int _index;
+ bool _namePlural;
+ int _type;
+ int _value;
+ int _damage;
+ int _accuracy;
+ int _attackType;
+ int _numberOfUses;
+ bool _returnToRandomScene;
+ String _sceneOrOwner;
+ String _clickMessage;
+ String _operativeVerb;
+ String _failureMessage;
+ String _useMessage;
+ String _sound;
+
+ Scene *_currentScene;
+ Chr *_currentOwner;
+
+public:
+ Chr *getCurrentOwner() { return _currentOwner; }
+
+ void setCurrentOwner(Chr *currentOwner) {
+ _currentOwner = currentOwner;
+ if (currentOwner != NULL)
+ _currentScene = NULL;
+ }
+
+ Scene *getCurrentScene() { return _currentScene; }
+
+ void setCurrentScene(Scene *currentScene) {
+ _currentScene = currentScene;
+ if (currentScene != NULL)
+ _currentOwner = NULL;
+ }
+
+ int getAccuracy() { return _accuracy; }
+ void setAccuracy(int accuracy) { _accuracy = accuracy; }
+
+ int getAttackType() { return _attackType; }
+ void setAttackType(int attackType) { _attackType = attackType; }
+
+ String getClickMessage() { return _clickMessage; }
+ void setClickMessage(String clickMessage) { _clickMessage = clickMessage; }
+
+ int getDamage() { return _damage; }
+ void setDamage(int damage) { _damage = damage; }
+
+ String getFailureMessage() { return _failureMessage; }
+ void setFailureMessage(String failureMessage) { _failureMessage = failureMessage; }
+
+ int getNumberOfUses() { return _numberOfUses; }
+ void setNumberOfUses(int numberOfUses) { _numberOfUses = numberOfUses; }
+ void decrementNumberOfUses() {
+ if (_numberOfUses != -1) {
+ _numberOfUses--;
+ }
+ }
+
+ int getType() { return _type; }
+ void setType(int type) { _type = type; }
+
+ String getOperativeVerb() { return _operativeVerb; }
+ void setOperativeVerb(String operativeVerb) { _operativeVerb = operativeVerb; }
+
+ bool isReturnToRandomScene() { return _returnToRandomScene; }
+ void setReturnToRandomScene(bool returnToRandomScene) { _returnToRandomScene = returnToRandomScene; }
+
+ String getSceneOrOwner() { return _sceneOrOwner; }
+ void setSceneOrOwner(String sceneOrOwner) { _sceneOrOwner = sceneOrOwner; }
+
+ String getSound() { return _sound; }
+ void setSound(String sound) { _sound = sound; }
+
+ String getUseMessage() { return _useMessage; }
+ void setUseMessage(String useMessage) { _useMessage = useMessage; }
+
+ int getValue() { return _value; }
+ void setValue(int value) { _value = value; }
+
+ bool isNamePlural() { return _namePlural; }
+ void setNamePlural(bool namePlural) { _namePlural = namePlural; }
+
+ int getIndex() { return _index; }
+ void setIndex(int index) { _index = index; }
+};
+
+} // End of namespace Wage
+
+#endif
diff --git a/engines/wage/scene.h b/engines/wage/scene.h
new file mode 100644
index 0000000000..a1873fc23b
--- /dev/null
+++ b/engines/wage/scene.h
@@ -0,0 +1,171 @@
+/* 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 WAGE_SCENE_H
+#define WAGE_SCENE_H
+
+#include "common/list.h"
+#include "common/rect.h"
+
+#include "wage/designed.h"
+
+namespace Wage {
+
+class Script;
+class Chr;
+class Obj;
+
+class Scene : public Designed {
+public:
+ enum Directions {
+ NORTH = 0,
+ SOUTH = 1,
+ EAST = 2,
+ WEST = 3
+ };
+
+ enum SceneTypes {
+ PERIODIC = 0,
+ RANDOM = 1
+ };
+
+private:
+ Script *_script;
+ String _text;
+ Common::Rect *_textBounds;
+ int _fontSize;
+ int _fontType; // 3 => Geneva, 22 => Courier, param to TextFont() function
+ bool _blocked[4];
+ String _messages[4];
+ int _soundFrequency; // times a minute, max 3600
+ int _soundType;
+ String _soundName;
+ int _worldX;
+ int _worldY;
+
+ Common::List<Obj> _objs;
+ Common::List<Chr> _chrs;
+
+public:
+ int getSoundFrequency() { return _soundFrequency; }
+ void setSoundFrequency(int soundFrequency) { _soundFrequency = soundFrequency; }
+
+ Common::Rect *getTextBounds() {
+ return _textBounds == NULL ? NULL : new Common::Rect(*_textBounds);
+ }
+
+ void setTextBounds(Common::Rect bounds) { _textBounds = new Common::Rect(bounds); }
+
+ void setDirMessage(int dir, String message) { _messages[dir] = message; }
+ String getDirMessage(int dir) { return _messages[dir]; }
+
+ void setDirBlocked(int dir, bool blocked) { _blocked[dir] = blocked; }
+ bool isDirBlocked(int dir) { return _blocked[dir]; }
+
+ String getText() { return _text; }
+ void setText(String text) { _text = text; }
+
+ Script *getScript() { return _script; }
+ void setScript(Script *script) { _script = script; }
+
+ int getSoundType() { return _soundType; }
+ void setSoundType(int soundType) { _soundType = soundType; }
+
+ int getWorldX() { return _worldX; }
+ void setWorldX(int worldX) { _worldX = worldX; }
+
+ int getWorldY() { return _worldY; }
+ void setWorldY(int worldY) { _worldY = worldY; }
+
+ String getSoundName() { return _soundName; }
+ void setSoundName(String soundName) { _soundName = soundName; }
+
+ int getFontSize() { return _fontSize; }
+ void setFontSize(int fontSize) { _fontSize = fontSize; }
+
+ int getFontType() { return _fontType; }
+
+#if 0
+ String getFontName() {
+ String[] fonts = {
+ "Chicago", // system font
+ "Geneva", // application font
+ "New York",
+ "Geneva",
+
+ "Monaco",
+ "Venice",
+ "London",
+ "Athens",
+
+ "San Francisco",
+ "Toronto",
+ "Cairo",
+ "Los Angeles", // 12
+
+ null, null, null, null, null, null, null, // not in Inside Macintosh
+
+ "Times", // 20
+ "Helvetica",
+ "Courier",
+ "Symbol",
+ "Taliesin" // mobile?
+ };
+ /*
+mappings found on some forums:
+systemFont(0):System(Swiss)
+times(20):Times New Roman(Roman)
+helvetica(21):Arial(Modern)
+courier(22):Courier New(Modern)
+symbol(23):Symbol(Decorative)
+applFont(1):Arial(Swiss)
+newYork(2):Times New Roman(Roman)
+geneva(3):Arial(Swiss)
+monaco(4):Courier New(Modern)
+venice(5):Times New Roman(Roman)
+london(6):Times New Roman(Roman)
+athens(7):Times New Roman(Roman)
+sanFran(8):Times New Roman(Roman)
+toronto(9):Times New Roman(Roman)
+cairo(11):Wingdings(Decorative)
+losAngeles(12):Times New Roman(Roman)
+taliesin(24):Wingdings(Decorative)
+ */
+ if (fontType >= 0 && fontType < fonts.length && fonts[fontType] != null) {
+ return _fonts[fontType];
+ }
+ return _"Unknown";
+ }
+#endif
+
+ void setFontType(int fontType) { _fontType = fontType; }
+
+ Common::List<Chr> getChrs() { return _chrs; }
+ Common::List<Obj> getObjs() { return _objs; }
+};
+
+} // End of namespace Wage
+
+#endif
diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp
new file mode 100644
index 0000000000..03870bf8d4
--- /dev/null
+++ b/engines/wage/script.cpp
@@ -0,0 +1,32 @@
+/* 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 "wage/wage.h"
+#include "wage/script.h"
+
+namespace Wage {
+
+
+} // End of namespace Wage
diff --git a/engines/wage/script.h b/engines/wage/script.h
new file mode 100644
index 0000000000..f21695205b
--- /dev/null
+++ b/engines/wage/script.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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef WAGE_SCRIPT_H
+#define WAGE_SCRIPT_H
+
+namespace Wage {
+
+class Script {
+public:
+ Script(byte *data) : _data(data) {}
+ ~Script();
+
+private:
+ byte *_data;
+};
+
+} // End of namespace Wage
+
+#endif
diff --git a/engines/wage/sound.cpp b/engines/wage/sound.cpp
new file mode 100644
index 0000000000..e9d67770a0
--- /dev/null
+++ b/engines/wage/sound.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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "wage/wage.h"
+#include "wage/sound.h"
+
+namespace Wage {
+
+Sound::Sound() {
+}
+
+Sound::~Sound() {
+}
+
+} // End of namespace Wage
diff --git a/engines/wage/sound.h b/engines/wage/sound.h
new file mode 100644
index 0000000000..30c36f7c03
--- /dev/null
+++ b/engines/wage/sound.h
@@ -0,0 +1,39 @@
+/* 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 WAGE_SOUND_H
+#define WAGE_SOUND_H
+
+namespace Wage {
+
+class Sound {
+public:
+ Sound();
+ ~Sound();
+};
+
+} // End of namespace Wage
+
+#endif
diff --git a/engines/wage/util.cpp b/engines/wage/util.cpp
index 9420150afe..2598a01d86 100644
--- a/engines/wage/util.cpp
+++ b/engines/wage/util.cpp
@@ -28,7 +28,8 @@
#include "common/stream.h"
namespace Wage {
-Common::String WageEngine::readPascalString(Common::SeekableReadStream &in) {
+
+Common::String readPascalString(Common::SeekableReadStream &in) {
Common::String s;
char *buf;
int len;
diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp
index 1468d246e6..cbb11bb64c 100644
--- a/engines/wage/wage.cpp
+++ b/engines/wage/wage.cpp
@@ -26,12 +26,13 @@
#include "common/scummsys.h"
#include "common/config-manager.h"
-#include "common/debug.h"
#include "common/EventRecorder.h"
#include "common/file.h"
#include "common/fs.h"
#include "wage/wage.h"
+#include "wage/macresman.h"
+#include "wage/world.h"
namespace Wage {
@@ -61,15 +62,14 @@ Common::Error WageEngine::run() {
printf("WageEngine::init\n");
// Your main even loop should be (invoked from) here.
- printf("WageEngine::go: Hello, World!\n");
-
- // This test will show up if -d1 and --debugflags=example are specified on the commandline
- debugC(1, kWageDebugExample, "Example debug call");
-
- // This test will show up if --debugflags=example or --debugflags=example2 or both of them and -d3 are specified on the commandline
- debugC(3, kWageDebugExample | kWageDebugExample2, "Example debug call two");
+ _resManager = new MacResManager(getGameFile());
+
+ _world = new World();
+
+ if (!_world->loadWorld(_resManager))
+ return Common::kNoGameDataFoundError;
return Common::kNoError;
}
-
+
} // End of namespace Wage
diff --git a/engines/wage/wage.h b/engines/wage/wage.h
index ff51c7f4ba..8e5a7bb672 100644
--- a/engines/wage/wage.h
+++ b/engines/wage/wage.h
@@ -27,6 +27,7 @@
#define WAGE_H
#include "engines/engine.h"
+#include "common/debug.h"
#include "gui/debugger.h"
#include "common/endian.h"
@@ -35,6 +36,10 @@ struct ADGameDescription;
namespace Wage {
class Console;
+class MacResManager;
+class World;
+
+using Common::String;
// our engine debug levels
enum {
@@ -44,6 +49,8 @@ enum {
// the current limitation is 32 debug levels (1 << 31 is the last one)
};
+Common::String readPascalString(Common::SeekableReadStream &in);
+
class WageEngine : public Engine {
public:
WageEngine(OSystem *syst, const ADGameDescription *gameDesc);
@@ -56,6 +63,11 @@ public:
bool canLoadGameStateCurrently();
bool canSaveGameStateCurrently();
+ const char *getGameFile() const;
+
+private:
+ bool loadWorld(MacResManager *resMan);
+
private:
Console *_console;
@@ -63,6 +75,10 @@ private:
Common::RandomSource _rnd;
const ADGameDescription *_gameDescription;
+
+ MacResManager *_resManager;
+
+ World *_world;
};
// Example console class
diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp
index 67987a5db1..f326f5868a 100644
--- a/engines/wage/world.cpp
+++ b/engines/wage/world.cpp
@@ -25,17 +25,32 @@
#include "wage/wage.h"
#include "wage/macresman.h"
+#include "wage/script.h"
+#include "wage/obj.h"
+#include "wage/world.h"
#include "common/stream.h"
namespace Wage {
-bool WageEngine::loadWorld(MacResManager *resMan) {
+World::World() {
+ _storageScene.setName(STORAGESCENE);
+ _orderedScenes.push_back(_storageScene);
+ _scenes[STORAGESCENE] = _storageScene;
+}
+
+bool World::loadWorld(MacResManager *resMan) {
int resSize;
MacResIDArray resArray;
byte *res;
MacResIDArray::const_iterator iter;
+ if ((resArray = resMan->getResIDArray("GCOD")).size() == 0)
+ return false;
+
+ res = resMan->getResource("GCOD", resArray[0], &resSize);
+ _globalScript = new Script(res);
+
if ((resArray = resMan->getResIDArray("VERS")).size() == 0)
return false;
@@ -54,7 +69,7 @@ bool WageEngine::loadWorld(MacResManager *resMan) {
readS.skip(3);
_aboutMessage = readPascalString(readS);
- if (!stricmp(getGameFile(), "Scepters"))
+ if (!stricmp(resMan->getFileName().c_str(), "Scepters"))
readS.skip(1); // ????
_soundLibrary1 = readPascalString(readS);
diff --git a/engines/wage/world.h b/engines/wage/world.h
new file mode 100644
index 0000000000..18c32884ba
--- /dev/null
+++ b/engines/wage/world.h
@@ -0,0 +1,69 @@
+/* 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 WAGE_WORLD_H
+#define WAGE_WORLD_H
+
+#include "wage/scene.h"
+#include "wage/script.h"
+#include "wage/obj.h"
+#include "wage/chr.h"
+#include "wage/sound.h"
+
+namespace Wage {
+
+#define STORAGESCENE "STORAGE@"
+
+class World {
+public:
+ World();
+ ~World();
+
+ bool loadWorld(MacResManager *resMan);
+
+ String _name;
+ String _aboutMessage;
+ String _soundLibrary1;
+ String _soundLibrary2;
+
+ bool _weaponMenuDisabled;
+ Script *_globalScript;
+ Common::HashMap<String, Scene> _scenes;
+ Common::HashMap<String, Obj> _objs;
+ Common::HashMap<String, Chr> _chrs;
+ Common::HashMap<String, Sound> _sounds;
+ Common::List<Scene> _orderedScenes;
+ Common::List<Obj> _orderedObjs;
+ Common::List<Chr> _orderedChrs;
+ Common::List<Sound> _orderedSounds;
+ Common::List<byte *> _patterns;
+ Scene _storageScene;
+ Chr _player;
+ //List<MoveListener> moveListeners;
+};
+
+} // End of namespace Wage
+
+#endif