aboutsummaryrefslogtreecommitdiff
path: root/engines/adl
diff options
context:
space:
mode:
authorWalter van Niftrik2016-02-27 13:54:47 +0100
committerWalter van Niftrik2016-03-09 10:03:13 +0100
commit183fe8b217c09df4deef3e31d5c01531bb532c50 (patch)
tree0f24a6ab0f24675296f5d8e8fc3115ae13a470b9 /engines/adl
parent9717aa956197480a608622a2e294fa8302258a0e (diff)
downloadscummvm-rg350-183fe8b217c09df4deef3e31d5c01531bb532c50.tar.gz
scummvm-rg350-183fe8b217c09df4deef3e31d5c01531bb532c50.tar.bz2
scummvm-rg350-183fe8b217c09df4deef3e31d5c01531bb532c50.zip
ADL: Move members into base class
Diffstat (limited to 'engines/adl')
-rw-r--r--engines/adl/adl.cpp10
-rw-r--r--engines/adl/adl.h23
-rw-r--r--engines/adl/adl_v1.cpp6
-rw-r--r--engines/adl/adl_v1.h52
4 files changed, 25 insertions, 66 deletions
diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp
index 9925e04286..8042a9a557 100644
--- a/engines/adl/adl.cpp
+++ b/engines/adl/adl.cpp
@@ -42,12 +42,15 @@ namespace Adl {
AdlEngine::AdlEngine(OSystem *syst, const AdlGameDescription *gd) :
Engine(syst),
_gameDescription(gd),
- _console(nullptr),
- _display(nullptr) {
+ _display(nullptr),
+ _parser(nullptr),
+ _room(1),
+ _steps(0),
+ _isDark(false) {
}
AdlEngine::~AdlEngine() {
- delete _console;
+ delete _parser;
delete _display;
}
@@ -65,7 +68,6 @@ Common::Error AdlEngine::run() {
g_system->getPaletteManager()->setPalette(palette, 0, 6);
- _console = new Console(this);
_display = new Display();
_parser = new Parser(*this, *_display);
diff --git a/engines/adl/adl.h b/engines/adl/adl.h
index 954c61335d..55ba0fcdec 100644
--- a/engines/adl/adl.h
+++ b/engines/adl/adl.h
@@ -24,7 +24,10 @@
#define ADL_ADL_H
#include "common/random.h"
+#include "common/rect.h"
+
#include "engines/engine.h"
+
#include "gui/debugger.h"
namespace Common {
@@ -102,14 +105,24 @@ protected:
virtual void runGame() = 0;
Common::String readString(Common::ReadStream &stream, byte until = 0);
void printStrings(Common::SeekableReadStream &stream, int count = 1);
+
Display *_display;
Parser *_parser;
-private:
- Console *_console;
-
- // We need random numbers
- Common::RandomSource *_rnd;
+ Common::Array<Common::String> _msgStrings;
+ Common::Array<Picture> _pictures;
+ Common::Array<Item> _inventory;
+ Common::Array<Common::Point> _itemOffsets;
+ Common::Array<Common::Array<byte> > _drawings;
+ Commands _roomCommands;
+ Commands _globalCommands;
+
+ // Game state
+ Common::Array<Room> _rooms;
+ byte _room;
+ uint16 _steps;
+ Common::Array<byte> _variables;
+ bool _isDark;
};
// Example console class
diff --git a/engines/adl/adl_v1.cpp b/engines/adl/adl_v1.cpp
index 42182390dd..28aa895b3c 100644
--- a/engines/adl/adl_v1.cpp
+++ b/engines/adl/adl_v1.cpp
@@ -46,11 +46,7 @@ static uint exeStrings[STR_MH_TOTAL] = {
};
AdlEngine_v1::AdlEngine_v1(OSystem *syst, const AdlGameDescription *gd) :
- AdlEngine(syst, gd),
- _state(kIntro),
- _room(1),
- _steps(1),
- _isDark(false) {
+ AdlEngine(syst, gd) {
_variables.resize(20);
}
diff --git a/engines/adl/adl_v1.h b/engines/adl/adl_v1.h
index b8f4c536a5..c1e28bcb04 100644
--- a/engines/adl/adl_v1.h
+++ b/engines/adl/adl_v1.h
@@ -57,46 +57,6 @@ private:
MH_ITEM_OFFSETS = 21
};
- enum State {
- kIntro,
- kIdle
- };
-
- struct Room {
- byte description;
- byte connections[6];
- byte field8;
- byte picture;
- };
-
- struct Picture {
- byte block;
- uint16 offset;
- };
-
- struct Command {
- byte room;
- byte verb, noun;
- byte numCond, numAct;
- Common::Array<byte> script;
- };
-
- struct Item {
- byte field1;
- byte field2;
- byte field3;
- byte field4;
- byte field5;
- byte field6;
- byte field7;
- byte field8;
- Common::Array<byte> field10;
- };
-
- typedef Common::List<Command> Commands;
-
- int _state;
-
void runIntro();
void drawPic(Common::ReadStream &stream, byte xOffset, byte yOffset);
void showRoom();
@@ -114,18 +74,6 @@ private:
void drawPic(byte pic, byte xOffset, byte yOffset);
Common::Array<Common::String> _exeStrings;
- Common::Array<Common::String> _msgStrings;
- Common::Array<Room> _rooms;
- Common::Array<Picture> _pictures;
- Common::Array<Item> _inventory;
- Common::Array<Common::Point> _itemOffsets;
- Common::Array<Common::Array<byte> > _drawings;
- Commands _roomCommands;
- Commands _globalCommands;
- byte _room;
- uint16 _steps;
- Common::Array<byte> _variables;
- bool _isDark;
};
} // End of namespace Adl