aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/backdrop.cpp2
-rw-r--r--engines/dreamweb/dreambase.h4
-rw-r--r--engines/dreamweb/dreamgen.cpp45
-rw-r--r--engines/dreamweb/dreamgen.h60
-rw-r--r--engines/dreamweb/dreamweb.cpp2
-rw-r--r--engines/dreamweb/keypad.cpp6
-rw-r--r--engines/dreamweb/module.mk1
-rw-r--r--engines/dreamweb/monitor.cpp10
-rw-r--r--engines/dreamweb/newplace.cpp6
-rw-r--r--engines/dreamweb/object.cpp24
-rw-r--r--engines/dreamweb/pathfind.cpp8
-rw-r--r--engines/dreamweb/people.cpp218
-rw-r--r--engines/dreamweb/print.cpp2
-rw-r--r--engines/dreamweb/saveload.cpp85
-rw-r--r--engines/dreamweb/sprite.cpp54
-rw-r--r--engines/dreamweb/structs.h62
-rw-r--r--engines/dreamweb/stubs.cpp386
-rw-r--r--engines/dreamweb/titles.cpp6
-rw-r--r--engines/dreamweb/use.cpp602
-rw-r--r--engines/dreamweb/vgagrafx.cpp16
20 files changed, 841 insertions, 758 deletions
diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp
index 7c0713c0c4..528a6c4fd1 100644
--- a/engines/dreamweb/backdrop.cpp
+++ b/engines/dreamweb/backdrop.cpp
@@ -110,7 +110,7 @@ void DreamBase::calcFrFrame(const Frame &frame, uint8 *width, uint8 *height, uin
}
void DreamBase::makeBackOb(SetObject *objData, uint16 x, uint16 y) {
- if (data.byte(kNewobs) == 0)
+ if (_vars._newObs == 0)
return;
uint8 priority = objData->priority;
uint8 type = objData->type;
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index e9bf6641af..ebbe24c9cc 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -63,6 +63,7 @@ const unsigned int kOpsx = 60;
const unsigned int kOpsy = 52;
const unsigned int kSymbolx = 64;
const unsigned int kSymboly = 56;
+const unsigned int kLengthofvars = 68;
/**
* This class is one of the parent classes of DreamGenContext. Its sole purpose
@@ -78,6 +79,7 @@ protected:
DreamWeb::DreamWebEngine *engine;
const char *_timedString;
+ GameVars _vars; // saved variables
// from backdrop.cpp
uint8 *_backdropBlocks;
@@ -133,7 +135,6 @@ protected:
Change _listOfChanges[kNumChanges]; // Note: this array is saved
uint8 _underTimedText[kUnderTimedTextBufSize];
Common::List<Rain> _rainList;
- uint8 _initialVars[kLengthOfVars]; // TODO: This shouldn't be necessary
// textfiles
TextFile _textFile1;
@@ -652,6 +653,7 @@ public:
void reelsOnScreen();
// from stubs.cpp
+ void setupInitialVars();
bool isCD();
void crosshair();
void delTextLine();
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
deleted file mode 100644
index 7f4c8e437a..0000000000
--- a/engines/dreamweb/dreamgen.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/* PLEASE DO NOT MODIFY THIS FILE. ALL CHANGES WILL BE LOST! LOOK FOR README FOR DETAILS */
-
-/* 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 "dreamgen.h"
-
-namespace DreamGen {
-
-
-void DreamGenContext::__start() {
- static const uint8 src[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x13, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- //0x0000: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
- //0x0010: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- //0x0020: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0xff, 0x00,
- //0x0030: .... .... .... ....
- 0xff, 0x00, 0x00, 0x30, };
- ds.assign(src, src + sizeof(src));
- dreamweb();
-}
-
-} // End of namespace DreamGen
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index d53353858b..dfec45d069 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -32,71 +32,14 @@
namespace DreamGen {
-static const uint16 kStartvars = 0;
-static const uint16 kProgresspoints = 1;
-static const uint16 kWatchon = 2;
-static const uint16 kShadeson = 3;
-static const uint16 kSecondcount = 4;
-static const uint16 kMinutecount = 5;
-static const uint16 kHourcount = 6;
-static const uint16 kZoomon = 7;
-static const uint16 kLocation = 8;
-static const uint16 kExpos = 9;
-static const uint16 kExframepos = 10;
-static const uint16 kExtextpos = 12;
-static const uint16 kCard1money = 14;
-static const uint16 kListpos = 16;
-static const uint16 kRyanpage = 18;
-static const uint16 kWatchingtime = 19;
-static const uint16 kReeltowatch = 21;
-static const uint16 kEndwatchreel = 23;
-static const uint16 kSpeedcount = 25;
-static const uint16 kWatchspeed = 26;
-static const uint16 kReeltohold = 27;
-static const uint16 kEndofholdreel = 29;
-static const uint16 kWatchmode = 31;
-static const uint16 kDestafterhold = 32;
-static const uint16 kNewsitem = 33;
-static const uint16 kLiftflag = 34;
-static const uint16 kLiftpath = 35;
-static const uint16 kLockstatus = 36;
-static const uint16 kDoorpath = 37;
-static const uint16 kCounttoopen = 38;
-static const uint16 kCounttoclose = 39;
-static const uint16 kRockstardead = 40;
-static const uint16 kGeneraldead = 41;
-static const uint16 kSartaindead = 42;
-static const uint16 kAidedead = 43;
-static const uint16 kBeenmugged = 44;
-static const uint16 kGunpassflag = 45;
-static const uint16 kCanmovealtar = 46;
-static const uint16 kTalkedtoattendant = 47;
-static const uint16 kTalkedtosparky = 48;
-static const uint16 kTalkedtoboss = 49;
-static const uint16 kTalkedtorecep = 50;
-static const uint16 kCardpassflag = 51;
-static const uint16 kMadmanflag = 52;
-static const uint16 kKeeperflag = 53;
-static const uint16 kLasttrigger = 54;
-static const uint16 kMandead = 55;
-static const uint16 kSeed = 56;
-static const uint16 kNeedtotravel = 59;
-static const uint16 kThroughdoor = 60;
-static const uint16 kNewobs = 61;
-static const uint16 kRyanon = 62;
-static const uint16 kCombatcount = 63;
-static const uint16 kLastweapon = 64;
-static const uint16 kDreamnumber = 65;
-static const uint16 kRoomafterdream = 66;
-static const uint16 kShakecounter = 67;
static const uint16 kDebuglevel1 = (0);
static const uint16 kDebuglevel2 = (0);
static const uint16 kPlayback = (0);
static const uint16 kSpanish = (0);
static const uint16 kRecording = (0);
-static const uint16 kExframedata = (0);
static const uint16 kGerman = (0);
static const uint16 kDemo = (0);
+static const uint16 kExframedata = (0);
static const uint16 kExframes = (0+2080);
static const uint16 kExdata = (0+2080+30000);
static const uint16 kExtextdat = (0+2080+30000+(16*114));
@@ -108,7 +51,6 @@ static const uint16 kNumexobjects = (114);
static const uint16 kExtextlen = (18000);
static const uint16 kExframeslen = (30000);
static const uint16 kItempicsize = (44);
-static const uint16 kLengthofvars = (68-0);
class DreamGenContext : public DreamBase, public Context {
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index 4e7257bcd3..8bc4975f69 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -204,7 +204,7 @@ Common::Error DreamWebEngine::run() {
ConfMan.registerDefault("dreamweb_originalsaveload", "false");
_timer->installTimerProc(vSyncInterrupt, 1000000 / 70, this, "dreamwebVSync");
- _context.__start();
+ _context.dreamweb();
_base._quitRequested = false;
_timer->removeTimerProc(vSyncInterrupt);
diff --git a/engines/dreamweb/keypad.cpp b/engines/dreamweb/keypad.cpp
index 34f33ae128..864cc8e8fa 100644
--- a/engines/dreamweb/keypad.cpp
+++ b/engines/dreamweb/keypad.cpp
@@ -65,7 +65,7 @@ void DreamBase::showKeypad() {
--_lightCount;
uint8 frameIndex;
uint16 y;
- if (data.byte(kLockstatus)) {
+ if (_vars._lockStatus) {
frameIndex = 36;
y = kKeypady-1+63;
} else {
@@ -145,14 +145,14 @@ void DreamBase::enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3
if (_quitRequested || (_getBack == 1))
break;
if (_lightCount == 1) {
- if (data.byte(kLockstatus) == 0)
+ if (_vars._lockStatus == 0)
break;
} else {
if (_pressCount == 40) {
addToPressList();
if (_pressed == 11) {
if (isItRight(digit0, digit1, digit2, digit3))
- data.byte(kLockstatus) = 0;
+ _vars._lockStatus = 0;
playChannel1(11);
_lightCount = 120;
_pressPointer = 0;
diff --git a/engines/dreamweb/module.mk b/engines/dreamweb/module.mk
index 88dfdeea53..661a9b973a 100644
--- a/engines/dreamweb/module.mk
+++ b/engines/dreamweb/module.mk
@@ -5,7 +5,6 @@ MODULE_OBJS := \
console.o \
detection.o \
dreamweb.o \
- dreamgen.o \
keypad.o \
monitor.o \
newplace.o \
diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp
index 375ab9fcdd..0f6d42040d 100644
--- a/engines/dreamweb/monitor.cpp
+++ b/engines/dreamweb/monitor.cpp
@@ -39,7 +39,7 @@ static MonitorKeyEntry monitorKeyEntries[4] = {
};
void DreamBase::useMon() {
- data.byte(kLasttrigger) = 0;
+ _vars._lastTrigger = 0;
_currentFile[0] = 34;
memset(_currentFile+1, ' ', 12);
_currentFile[13] = 0;
@@ -377,7 +377,7 @@ void DreamBase::printOuterMon() {
}
void DreamBase::loadPersonal() {
- if (data.byte(kLocation) == 0 || data.byte(kLocation) == 42)
+ if (_vars._location == 0 || _vars._location == 42)
loadTextFile(_textFile1, "DREAMWEB.T01"); // monitor file 1
else
loadTextFile(_textFile1, "DREAMWEB.T02"); // monitor file 2
@@ -385,11 +385,11 @@ void DreamBase::loadPersonal() {
void DreamBase::loadNews() {
// textfile2 holds information accessible by anyone
- if (data.byte(kNewsitem) == 0)
+ if (_vars._newsItem == 0)
loadTextFile(_textFile2, "DREAMWEB.T10"); // monitor file 10
- else if (data.byte(kNewsitem) == 1)
+ else if (_vars._newsItem == 1)
loadTextFile(_textFile2, "DREAMWEB.T11"); // monitor file 11
- else if (data.byte(kNewsitem) == 2)
+ else if (_vars._newsItem == 2)
loadTextFile(_textFile2, "DREAMWEB.T12"); // monitor file 12
else
loadTextFile(_textFile2, "DREAMWEB.T13"); // monitor file 13
diff --git a/engines/dreamweb/newplace.cpp b/engines/dreamweb/newplace.cpp
index 3093968969..a460d2879e 100644
--- a/engines/dreamweb/newplace.cpp
+++ b/engines/dreamweb/newplace.cpp
@@ -25,8 +25,8 @@
namespace DreamGen {
void DreamBase::newPlace() {
- if (data.byte(kNeedtotravel) == 1) {
- data.byte(kNeedtotravel) = 0;
+ if (_vars._needToTravel == 1) {
+ _vars._needToTravel = 0;
selectLocation();
} else if (_autoLocation != 0xFF) {
_newLocation = _autoLocation;
@@ -84,7 +84,7 @@ void DreamBase::selectLocation() {
checkCoords(destList);
}
- if (_quitRequested || _getBack == 1 || _newLocation == data.byte(kLocation)) {
+ if (_quitRequested || _getBack == 1 || _newLocation == _vars._location) {
_newLocation = _realLocation;
_getBack = 0;
}
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp
index 7dc605c032..555125e9e7 100644
--- a/engines/dreamweb/object.cpp
+++ b/engines/dreamweb/object.cpp
@@ -26,7 +26,7 @@ namespace DreamGen {
void DreamBase::showRyanPage() {
showFrame(_icons1, kInventx + 167, kInventy - 12, 12, 0);
- showFrame(_icons1, kInventx + 167 + 18 * data.byte(kRyanpage), kInventy - 12, 13 + data.byte(kRyanpage), 0);
+ showFrame(_icons1, kInventx + 167 + 18 * _vars._ryanPage, kInventy - 12, 13 + _vars._ryanPage, 0);
}
void DreamBase::findAllRyan() {
@@ -45,7 +45,7 @@ void DreamBase::findAllRyan() {
}
void DreamBase::fillRyan() {
- ObjectRef *inv = &_ryanInvList[data.byte(kRyanpage) * 10];
+ ObjectRef *inv = &_ryanInvList[_vars._ryanPage * 10];
findAllRyan();
for (size_t i = 0; i < 2; ++i) {
for (size_t j = 0; j < 5; ++j) {
@@ -203,7 +203,7 @@ void DreamBase::examineOb(bool examineAgain) {
}
_pickUp = 0;
- if (data.word(kWatchingtime) != 0 || _newLocation == 255) {
+ if (_vars._watchingTime != 0 || _newLocation == 255) {
// isWatching
makeMainScreen();
}
@@ -213,7 +213,7 @@ void DreamBase::examineOb(bool examineAgain) {
}
void DreamBase::inventory() {
- if (data.byte(kMandead) == 1 || data.word(kWatchingtime) != 0) {
+ if (_vars._manDead == 1 || _vars._watchingTime != 0) {
blank();
return;
}
@@ -251,13 +251,13 @@ void DreamBase::inventory() {
}
void DreamBase::transferText(uint8 from, uint8 to) {
- _exText.setOffset(to, data.word(kExtextpos));
+ _exText.setOffset(to, _vars._exTextPos);
const char *src = _freeDesc.getString(from);
- char *dst = _exText._text + data.word(kExtextpos);
+ char *dst = _exText._text + _vars._exTextPos;
size_t len = strlen(src);
memcpy(dst, src, len + 1);
- data.word(kExtextpos) += len + 1;
+ _vars._exTextPos += len + 1;
}
void DreamBase::getBackFromOb() {
@@ -305,7 +305,7 @@ void DreamBase::openOb() {
}
void DreamBase::identifyOb() {
- if (data.word(kWatchingtime) != 0) {
+ if (_vars._watchingTime != 0) {
blank();
return;
}
@@ -335,7 +335,7 @@ void DreamBase::identifyOb() {
checkOne(x, y, &flag, &flagEx, &type, &flagX, &flagY);
- if (type != 0 && data.byte(kMandead) != 1)
+ if (type != 0 && _vars._manDead != 1)
obName(type, 3);
else
blank();
@@ -345,7 +345,7 @@ ObjectRef DreamBase::findInvPos() {
uint16 x = _mouseX - kInventx;
uint16 y = _mouseY - kInventy;
uint8 pos = (x / kItempicsize) + (y / kItempicsize) * 5;
- uint8 invPos = data.byte(kRyanpage) * 10 + pos;
+ uint8 invPos = _vars._ryanPage * 10 + pos;
_lastInvPos = invPos;
return _ryanInvList[invPos];
}
@@ -435,7 +435,7 @@ void DreamBase::deleteExFrame(uint8 frameNum) {
memmove(&_exFrames._data[startOff], &_exFrames._data[endOff], remainder);
// Combined frame data is now frameSize smaller
- data.word(kExframepos) -= frameSize;
+ _vars._exFramePos -= frameSize;
// Adjust all frame pointers pointing into the shifted data
for (unsigned int i = 0; i < 3*kNumexobjects; ++i) {
@@ -457,7 +457,7 @@ void DreamBase::deleteExText(uint8 textNum) {
memmove(&_exText._text[startOff], &_exText._text[endOff], remainder);
// Combined text data is now frameSize smaller
- data.word(kExtextpos) -= textSize;
+ _vars._exTextPos -= textSize;
// Adjust all text pointers pointing into the shifted data
for (unsigned int i = 0; i < kNumexobjects; ++i) {
diff --git a/engines/dreamweb/pathfind.cpp b/engines/dreamweb/pathfind.cpp
index 6254fe7755..908ac001bb 100644
--- a/engines/dreamweb/pathfind.cpp
+++ b/engines/dreamweb/pathfind.cpp
@@ -68,11 +68,11 @@ void DreamBase::setWalk() {
} else if (_pointersPath == _mansPath) {
// Can't walk
faceRightWay();
- } else if (data.byte(kWatchmode) == 1) {
+ } else if (_vars._watchMode == 1) {
// Holding reel
- data.byte(kDestafterhold) = _pointersPath;
- data.byte(kWatchmode) = 2;
- } else if (data.byte(kWatchmode) == 2) {
+ _vars._destAfterHold = _pointersPath;
+ _vars._watchMode = 2;
+ } else if (_vars._watchMode == 2) {
// Can't walk
} else {
_destination = _pointersPath;
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 0ab39eea9f..cecb6ee9dd 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -153,27 +153,27 @@ void DreamBase::madmanText() {
origCount = _speechCount;
++_speechCount;
} else {
- if (data.byte(kCombatcount) >= 61)
+ if (_vars._combatCount >= 61)
return;
- if (data.byte(kCombatcount) & 3)
+ if (_vars._combatCount & 3)
return;
- origCount = data.byte(kCombatcount) / 4;
+ origCount = _vars._combatCount / 4;
}
setupTimedTemp(47 + origCount, 82, 72, 80, 90, 1);
}
void DreamBase::madman(ReelRoutine &routine) {
- data.word(kWatchingtime) = 2;
+ _vars._watchingTime = 2;
if (checkSpeed(routine)) {
uint16 newReelPointer = routine.reelPointer();
if (newReelPointer >= 364) {
- data.byte(kMandead) = 2;
+ _vars._manDead = 2;
showGameReel(&routine);
return;
}
if (newReelPointer == 10) {
loadTempText("DREAMWEB.T82");
- data.byte(kCombatcount) = (uint8)-1;
+ _vars._combatCount = (uint8)-1;
_speechCount = 0;
}
++newReelPointer;
@@ -185,17 +185,17 @@ void DreamBase::madman(ReelRoutine &routine) {
return;
}
if (newReelPointer == 66) {
- ++data.byte(kCombatcount);
+ ++_vars._combatCount;
madmanText();
newReelPointer = 53;
- if (data.byte(kCombatcount) >= (isCD() ? 64 : 62)) {
- if (data.byte(kCombatcount) == (isCD() ? 70 : 68))
+ if (_vars._combatCount >= (isCD() ? 64 : 62)) {
+ if (_vars._combatCount == (isCD() ? 70 : 68))
newReelPointer = 310;
else {
- if (data.byte(kLastweapon) == 8) {
- data.byte(kCombatcount) = isCD() ? 72 : 70;
- data.byte(kLastweapon) = (uint8)-1;
- data.byte(kMadmanflag) = 1;
+ if (_vars._lastWeapon == 8) {
+ _vars._combatCount = isCD() ? 72 : 70;
+ _vars._lastWeapon = (uint8)-1;
+ _vars._madmanFlag = 1;
newReelPointer = 67;
}
}
@@ -209,11 +209,11 @@ void DreamBase::madman(ReelRoutine &routine) {
}
void DreamBase::madMode() {
- data.word(kWatchingtime) = 2;
+ _vars._watchingTime = 2;
_pointerMode = 0;
- if (data.byte(kCombatcount) < (isCD() ? 65 : 63))
+ if (_vars._combatCount < (isCD() ? 65 : 63))
return;
- if (data.byte(kCombatcount) >= (isCD() ? 70 : 68))
+ if (_vars._combatCount >= (isCD() ? 70 : 68))
return;
_pointerMode = 2;
}
@@ -228,7 +228,7 @@ void DreamBase::addToPeopleList(ReelRoutine *routine) {
}
bool DreamBase::checkSpeed(ReelRoutine &routine) {
- if (data.byte(kLastweapon) != (uint8)-1)
+ if (_vars._lastWeapon != (uint8)-1)
return true;
++routine.counter;
if (routine.counter != routine.period)
@@ -261,14 +261,14 @@ void DreamBase::gamer(ReelRoutine &routine) {
}
void DreamBase::eden(ReelRoutine &routine) {
- if (data.byte(kGeneraldead))
+ if (_vars._generalDead)
return;
showGameReel(&routine);
addToPeopleList(&routine);
}
void DreamBase::sparky(ReelRoutine &routine) {
- if (data.word(kCard1money))
+ if (_vars._card1Money)
routine.b7 = 3;
if (checkSpeed(routine)) {
if (routine.reelPointer() == 34) {
@@ -286,7 +286,7 @@ void DreamBase::sparky(ReelRoutine &routine) {
showGameReel(&routine);
addToPeopleList(&routine);
if (routine.b7 & 128)
- data.byte(kTalkedtosparky) = 1;
+ _vars._talkedToSparky = 1;
}
void DreamBase::rockstar(ReelRoutine &routine) {
@@ -298,17 +298,17 @@ void DreamBase::rockstar(ReelRoutine &routine) {
if (checkSpeed(routine)) {
uint16 nextReelPointer = routine.reelPointer() + 1;
if (nextReelPointer == 118) {
- data.byte(kMandead) = 2;
+ _vars._manDead = 2;
} else if (nextReelPointer == 79) {
--nextReelPointer;
- if (data.byte(kLastweapon) != 1) {
- ++data.byte(kCombatcount);
- if (data.byte(kCombatcount) == 40) {
- data.byte(kCombatcount) = 0;
+ if (_vars._lastWeapon != 1) {
+ ++_vars._combatCount;
+ if (_vars._combatCount == 40) {
+ _vars._combatCount = 0;
nextReelPointer = 79;
}
} else {
- data.byte(kLastweapon) = (uint8)-1;
+ _vars._lastWeapon = (uint8)-1;
nextReelPointer = 123;
}
}
@@ -318,9 +318,9 @@ void DreamBase::rockstar(ReelRoutine &routine) {
if (routine.reelPointer() == 78) {
addToPeopleList(&routine);
_pointerMode = 2;
- data.word(kWatchingtime) = 0;
+ _vars._watchingTime = 0;
} else {
- data.word(kWatchingtime) = 2;
+ _vars._watchingTime = 2;
_pointerMode = 0;
routine.mapY = _mapY;
}
@@ -336,7 +336,7 @@ void DreamBase::madmansTelly(ReelRoutine &routine) {
void DreamBase::smokeBloke(ReelRoutine &routine) {
- if (data.byte(kRockstardead) == 0) {
+ if (_vars._rockstarDead == 0) {
if (routine.b7 & 128)
DreamBase::setLocation(5);
}
@@ -365,28 +365,28 @@ void DreamBase::attendant(ReelRoutine &routine) {
showGameReel(&routine);
addToPeopleList(&routine);
if (routine.b7 & 128)
- data.byte(kTalkedtoattendant) = 1;
+ _vars._talkedToAttendant = 1;
}
void DreamBase::keeper(ReelRoutine &routine) {
- if (data.byte(kKeeperflag) != 0) {
+ if (_vars._keeperFlag != 0) {
// Not waiting
addToPeopleList(&routine);
showGameReel(&routine);
return;
}
- if (data.word(kReeltowatch) < 190)
+ if (_vars._reelToWatch < 190)
return; // waiting
- data.byte(kKeeperflag)++;
+ _vars._keeperFlag++;
- if ((routine.b7 & 127) != data.byte(kDreamnumber))
- routine.b7 = data.byte(kDreamnumber);
+ if ((routine.b7 & 127) != _vars._dreamNumber)
+ routine.b7 = _vars._dreamNumber;
}
void DreamBase::drunk(ReelRoutine &routine) {
- if (data.byte(kGeneraldead))
+ if (_vars._generalDead)
return;
routine.b7 &= 127;
showGameReel(&routine);
@@ -394,7 +394,7 @@ void DreamBase::drunk(ReelRoutine &routine) {
}
void DreamBase::interviewer(ReelRoutine &routine) {
- if (data.word(kReeltowatch) == 68)
+ if (_vars._reelToWatch == 68)
routine.incReelPointer();
if (routine.reelPointer() != 250 && routine.reelPointer() != 259 && checkSpeed(routine))
@@ -527,17 +527,17 @@ void DreamBase::gates(ReelRoutine &routine) {
void DreamBase::security(ReelRoutine &routine) {
if (routine.reelPointer() == 32) {
- if (data.byte(kLastweapon) == 1) {
- data.word(kWatchingtime) = 10;
+ if (_vars._lastWeapon == 1) {
+ _vars._watchingTime = 10;
if ((_mansPath == 9) && (_facing == 0)) {
- data.byte(kLastweapon) = (uint8)-1;
+ _vars._lastWeapon = (uint8)-1;
routine.incReelPointer();
}
}
} else if (routine.reelPointer() == 69)
return;
else {
- data.word(kWatchingtime) = 10;
+ _vars._watchingTime = 10;
if (checkSpeed(routine))
routine.incReelPointer();
}
@@ -546,7 +546,7 @@ void DreamBase::security(ReelRoutine &routine) {
}
void DreamBase::edenInBath(ReelRoutine &routine) {
- if (data.byte(kGeneraldead) == 0 || data.byte(kSartaindead) != 0)
+ if (_vars._generalDead == 0 || _vars._sartainDead != 0)
return;
showGameReel(&routine);
@@ -554,7 +554,7 @@ void DreamBase::edenInBath(ReelRoutine &routine) {
}
void DreamBase::louis(ReelRoutine &routine) {
- if (data.byte(kRockstardead) != 0)
+ if (_vars._rockstarDead != 0)
return;
showGameReel(&routine);
@@ -581,7 +581,7 @@ void DreamBase::train(ReelRoutine &routine) {
}
void DreamBase::louisChair(ReelRoutine &routine) {
- if (data.byte(kRockstardead) == 0)
+ if (_vars._rockstarDead == 0)
return; // notlouis2
if (checkSpeed(routine)) {
@@ -607,14 +607,14 @@ void DreamBase::bossMan(ReelRoutine &routine) {
uint16 nextReelPointer = routine.reelPointer() + 1;
if (nextReelPointer == 4) {
- if (data.byte(kGunpassflag) != 1 && engine->randomNumber() >= 10)
+ if (_vars._gunPassFlag != 1 && engine->randomNumber() >= 10)
nextReelPointer = 0;
} else if (nextReelPointer == 20) {
- if (data.byte(kGunpassflag) != 1)
+ if (_vars._gunPassFlag != 1)
nextReelPointer = 0;
} else if (nextReelPointer == 41) {
nextReelPointer = 0;
- data.byte(kGunpassflag)++;
+ _vars._gunPassFlag++;
routine.b7 = 10;
}
@@ -625,7 +625,7 @@ void DreamBase::bossMan(ReelRoutine &routine) {
addToPeopleList(&routine);
if (routine.b7 & 128)
- data.byte(kTalkedtoboss) = 1;
+ _vars._talkedToBoss = 1;
}
void DreamBase::priest(ReelRoutine &routine) {
@@ -633,7 +633,7 @@ void DreamBase::priest(ReelRoutine &routine) {
return; // priestspoken
_pointerMode = 0;
- data.word(kWatchingtime) = 2;
+ _vars._watchingTime = 2;
if (checkSpeed(routine)) {
routine.incReelPointer();
@@ -752,21 +752,21 @@ void DreamBase::introMonks2(ReelRoutine &routine) {
void DreamBase::soldier1(ReelRoutine &routine) {
if (routine.reelPointer() != 0) {
- data.word(kWatchingtime) = 10;
+ _vars._watchingTime = 10;
if (routine.reelPointer() == 30) {
- data.byte(kCombatcount)++;
- if (data.byte(kCombatcount) == 40)
- data.byte(kMandead) = 2;
+ _vars._combatCount++;
+ if (_vars._combatCount == 40)
+ _vars._manDead = 2;
} else if (checkSpeed(routine)) {
// Not after shot
routine.incReelPointer();
}
- } else if (data.byte(kLastweapon) == 1) {
- data.word(kWatchingtime) = 10;
+ } else if (_vars._lastWeapon == 1) {
+ _vars._watchingTime = 10;
if (_mansPath == 2 && _facing == 4)
routine.incReelPointer();
- data.byte(kLastweapon) = 0xFF;
- data.byte(kCombatcount) = 0;
+ _vars._lastWeapon = 0xFF;
+ _vars._combatCount = 0;
}
showGameReel(&routine);
@@ -775,9 +775,9 @@ void DreamBase::soldier1(ReelRoutine &routine) {
void DreamBase::receptionist(ReelRoutine &routine) {
if (checkSpeed(routine)) {
- if (data.byte(kCardpassflag) == 1) {
+ if (_vars._cardPassFlag == 1) {
// Set card
- data.byte(kCardpassflag)++;
+ _vars._cardPassFlag++;
routine.b7 = 1;
routine.setReelPointer(64);
}
@@ -807,7 +807,7 @@ void DreamBase::receptionist(ReelRoutine &routine) {
showGameReel(&routine);
addToPeopleList(&routine);
if (routine.b7 & 128)
- data.byte(kTalkedtorecep) = 1;
+ _vars._talkedToRecep = 1;
}
void DreamBase::bartender(ReelRoutine &routine) {
@@ -825,7 +825,7 @@ void DreamBase::bartender(ReelRoutine &routine) {
}
showGameReel(&routine);
- if (data.byte(kGunpassflag) == 1)
+ if (_vars._gunPassFlag == 1)
routine.b7 = 9; // got gun
addToPeopleList(&routine);
@@ -834,21 +834,21 @@ void DreamBase::bartender(ReelRoutine &routine) {
void DreamBase::heavy(ReelRoutine &routine) {
routine.b7 &= 127;
if (routine.reelPointer() != 43) {
- data.word(kWatchingtime) = 10;
+ _vars._watchingTime = 10;
if (routine.reelPointer() == 70) {
// After shot
- data.byte(kCombatcount)++;
- if (data.byte(kCombatcount) == 80)
- data.byte(kMandead) = 2;
+ _vars._combatCount++;
+ if (_vars._combatCount == 80)
+ _vars._manDead = 2;
} else {
if (checkSpeed(routine))
routine.incReelPointer();
}
- } else if (data.byte(kLastweapon) == 1 && _mansPath == 5 && _facing == 4) {
+ } else if (_vars._lastWeapon == 1 && _mansPath == 5 && _facing == 4) {
// Heavy wait
- data.byte(kLastweapon) = (byte)-1;
+ _vars._lastWeapon = (byte)-1;
routine.incReelPointer();
- data.byte(kCombatcount) = 0;
+ _vars._combatCount = 0;
}
showGameReel(&routine);
@@ -866,20 +866,20 @@ void DreamBase::helicopter(ReelRoutine &routine) {
uint16 nextReelPointer = routine.reelPointer() + 1;
if (nextReelPointer == 53) {
// Before killing helicopter
- data.byte(kCombatcount)++;
- if (data.byte(kCombatcount) >= 8)
- data.byte(kMandead) = 2;
+ _vars._combatCount++;
+ if (_vars._combatCount >= 8)
+ _vars._manDead = 2;
nextReelPointer = 49;
} else if (nextReelPointer == 9) {
nextReelPointer--;
- if (data.byte(kLastweapon) == 1) {
- data.byte(kLastweapon) = (byte)-1;
+ if (_vars._lastWeapon == 1) {
+ _vars._lastWeapon = (byte)-1;
nextReelPointer = 55;
} else {
nextReelPointer = 5;
- data.byte(kCombatcount)++;
- if (data.byte(kCombatcount) == 20) {
- data.byte(kCombatcount) = 0;
+ _vars._combatCount++;
+ if (_vars._combatCount == 20) {
+ _vars._combatCount = 0;
nextReelPointer = 9;
}
}
@@ -890,13 +890,13 @@ void DreamBase::helicopter(ReelRoutine &routine) {
showGameReel(&routine);
routine.mapX = _mapX;
- if (routine.reelPointer() < 9 && data.byte(kCombatcount) >= 7) {
+ if (routine.reelPointer() < 9 && _vars._combatCount >= 7) {
_pointerMode = 2;
- data.word(kWatchingtime) = 0;
+ _vars._watchingTime = 0;
} else {
// Not waiting helicopter
_pointerMode = 0;
- data.word(kWatchingtime) = 2;
+ _vars._watchingTime = 2;
}
}
@@ -906,7 +906,7 @@ void DreamBase::mugger(ReelRoutine &routine) {
return; // endmugger2
if (routine.reelPointer() == 2)
- data.word(kWatchingtime) = 175 * 2; // set watch
+ _vars._watchingTime = 175 * 2; // set watch
if (checkSpeed(routine))
routine.incReelPointer();
@@ -935,7 +935,7 @@ void DreamBase::mugger(ReelRoutine &routine) {
removeObFromInv();
makeMainScreen();
DreamBase::setupTimedUse(48, 70, 10, 68 - 32, 54 + 64);
- data.byte(kBeenmugged) = 1;
+ _vars._beenMugged = 1;
}
}
@@ -943,14 +943,14 @@ void DreamBase::mugger(ReelRoutine &routine) {
// two bodyguards are expecting Ryan.
void DreamBase::businessMan(ReelRoutine &routine) {
_pointerMode = 0;
- data.word(kWatchingtime) = 2;
+ _vars._watchingTime = 2;
if (routine.reelPointer() == 2)
DreamBase::setupTimedUse(49, 30, 1, 68, 174); // First
if (routine.reelPointer() == 95) {
// Businessman combat won - end
_pointerMode = 0;
- data.word(kWatchingtime) = 0;
+ _vars._watchingTime = 0;
return;
}
@@ -960,19 +960,19 @@ void DreamBase::businessMan(ReelRoutine &routine) {
if (checkSpeed(routine)) {
uint16 nextReelPointer = routine.reelPointer() + 1;
if (nextReelPointer == 48) {
- data.byte(kMandead) = 2; // before dead body
+ _vars._manDead = 2; // before dead body
} else if (nextReelPointer == 15) {
nextReelPointer--;
- if (data.byte(kLastweapon) == 3) {
+ if (_vars._lastWeapon == 3) {
// Shield on bus
- data.byte(kLastweapon) = (byte)-1;
- data.byte(kCombatcount) = 0;
+ _vars._lastWeapon = (byte)-1;
+ _vars._combatCount = 0;
nextReelPointer = 51;
} else {
// No shield on businessman
- data.byte(kCombatcount)++;
- if (data.byte(kCombatcount) == 20) {
- data.byte(kCombatcount) = 0;
+ _vars._combatCount++;
+ if (_vars._combatCount == 20) {
+ _vars._combatCount = 0;
nextReelPointer = 15;
}
}
@@ -997,7 +997,7 @@ void DreamBase::businessMan(ReelRoutine &routine) {
showGameReel(&routine);
routine.mapY = _mapY;
if (routine.reelPointer() == 14) {
- data.word(kWatchingtime) = 0;
+ _vars._watchingTime = 0;
_pointerMode = 2;
}
}
@@ -1037,17 +1037,17 @@ void DreamBase::poolGuard(ReelRoutine &routine) {
if (routine.reelPointer() == 214 || routine.reelPointer() == 258) {
// Combat over 2
showGameReel(&routine);
- data.word(kWatchingtime) = 2;
+ _vars._watchingTime = 2;
_pointerMode = 0;
- data.byte(kCombatcount)++;
- if (data.byte(kCombatcount) < 100)
+ _vars._combatCount++;
+ if (_vars._combatCount < 100)
return; // doneover2
- data.word(kWatchingtime) = 0;
- data.byte(kMandead) = 2;
+ _vars._watchingTime = 0;
+ _vars._manDead = 2;
return;
} else if (routine.reelPointer() == 185) {
// Combat over 1
- data.word(kWatchingtime) = 0;
+ _vars._watchingTime = 0;
_pointerMode = 0;
turnPathOn(0);
turnPathOff(1);
@@ -1064,15 +1064,15 @@ void DreamBase::poolGuard(ReelRoutine &routine) {
// Not end guard 1
if (nextReelPointer == 147) {
nextReelPointer--;
- if (data.byte(kLastweapon) == 1) {
+ if (_vars._lastWeapon == 1) {
// Gun on pool
- data.byte(kLastweapon) = (byte)-1;
+ _vars._lastWeapon = (byte)-1;
nextReelPointer = 147;
} else {
// Gun not on pool
- data.byte(kCombatcount)++;
- if (data.byte(kCombatcount) == 40) {
- data.byte(kCombatcount) = 0;
+ _vars._combatCount++;
+ if (_vars._combatCount == 40) {
+ _vars._combatCount = 0;
nextReelPointer = 220;
}
}
@@ -1080,14 +1080,14 @@ void DreamBase::poolGuard(ReelRoutine &routine) {
} else {
nextReelPointer--;
- if (data.byte(kLastweapon) == 2) {
+ if (_vars._lastWeapon == 2) {
// Axe on pool
- data.byte(kLastweapon) = (byte)-1;
+ _vars._lastWeapon = (byte)-1;
nextReelPointer = 122;
} else {
- data.byte(kCombatcount)++;
- if (data.byte(kCombatcount) == 40) {
- data.byte(kCombatcount) = 0;
+ _vars._combatCount++;
+ if (_vars._combatCount == 40) {
+ _vars._combatCount = 0;
nextReelPointer = 195;
}
}
@@ -1100,10 +1100,10 @@ void DreamBase::poolGuard(ReelRoutine &routine) {
if (routine.reelPointer() != 121 && routine.reelPointer() != 146) {
_pointerMode = 0;
- data.word(kWatchingtime) = 2;
+ _vars._watchingTime = 2;
} else {
_pointerMode = 2;
- data.word(kWatchingtime) = 0;
+ _vars._watchingTime = 0;
}
}
diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp
index 3a27b7e05f..04e7a22ef8 100644
--- a/engines/dreamweb/print.cpp
+++ b/engines/dreamweb/print.cpp
@@ -220,7 +220,7 @@ const char *DreamBase::monPrint(const char *string) {
break;
}
if (c == '%') {
- data.byte(kLasttrigger) = *iterator;
+ _vars._lastTrigger = *iterator;
iterator += 2;
done = true;
break;
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index 06cf7e0012..95f1b3694d 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -44,6 +44,68 @@ void syncReelRoutine(Common::Serializer &s, ReelRoutine *reel) {
s.syncAsByte(reel->b7);
}
+void syncGameVars(Common::Serializer &s, GameVars &vars) {
+ s.syncAsByte(vars._startVars);
+ s.syncAsByte(vars._progressPoints);
+ s.syncAsByte(vars._watchOn);
+ s.syncAsByte(vars._shadesOn);
+ s.syncAsByte(vars._secondCount);
+ s.syncAsByte(vars._minuteCount);
+ s.syncAsByte(vars._hourCount);
+ s.syncAsByte(vars._zoomOn);
+ s.syncAsByte(vars._location);
+ s.syncAsByte(vars._exPos);
+ s.syncAsUint16LE(vars._exFramePos);
+ s.syncAsUint16LE(vars._exTextPos);
+ s.syncAsUint16LE(vars._card1Money);
+ s.syncAsUint16LE(vars._listPos);
+ s.syncAsByte(vars._ryanPage);
+ s.syncAsUint16LE(vars._watchingTime);
+ s.syncAsUint16LE(vars._reelToWatch);
+ s.syncAsUint16LE(vars._endWatchReel);
+ s.syncAsByte(vars._speedCount);
+ s.syncAsByte(vars._watchSpeed);
+ s.syncAsUint16LE(vars._reelToHold);
+ s.syncAsUint16LE(vars._endOfHoldReel);
+ s.syncAsByte(vars._watchMode);
+ s.syncAsByte(vars._destAfterHold);
+ s.syncAsByte(vars._newsItem);
+ s.syncAsByte(vars._liftFlag);
+ s.syncAsByte(vars._liftPath);
+ s.syncAsByte(vars._lockStatus);
+ s.syncAsByte(vars._doorPath);
+ s.syncAsByte(vars._countToOpen);
+ s.syncAsByte(vars._countToClose);
+ s.syncAsByte(vars._rockstarDead);
+ s.syncAsByte(vars._generalDead);
+ s.syncAsByte(vars._sartainDead);
+ s.syncAsByte(vars._aideDead);
+ s.syncAsByte(vars._beenMugged);
+ s.syncAsByte(vars._gunPassFlag);
+ s.syncAsByte(vars._canMoveAltar);
+ s.syncAsByte(vars._talkedToAttendant);
+ s.syncAsByte(vars._talkedToSparky);
+ s.syncAsByte(vars._talkedToBoss);
+ s.syncAsByte(vars._talkedToRecep);
+ s.syncAsByte(vars._cardPassFlag);
+ s.syncAsByte(vars._madmanFlag);
+ s.syncAsByte(vars._keeperFlag);
+ s.syncAsByte(vars._lastTrigger);
+ s.syncAsByte(vars._manDead);
+ s.syncAsByte(vars._seed1);
+ s.syncAsByte(vars._seed2);
+ s.syncAsByte(vars._seed3);
+ s.syncAsByte(vars._needToTravel);
+ s.syncAsByte(vars._throughDoor);
+ s.syncAsByte(vars._newObs);
+ s.syncAsByte(vars._ryanOn);
+ s.syncAsByte(vars._combatCount);
+ s.syncAsByte(vars._lastWeapon);
+ s.syncAsByte(vars._dreamNumber);
+ s.syncAsByte(vars._roomAfterDream);
+ s.syncAsByte(vars._shakeCounter);
+}
+
void DreamBase::loadGame() {
if (_commandType != 246) {
_commandType = 246;
@@ -137,7 +199,7 @@ void DreamBase::doLoad(int savegameId) {
void DreamBase::saveGame() {
- if (data.byte(kMandead) == 2) {
+ if (_vars._manDead == 2) {
blank();
return;
}
@@ -238,7 +300,7 @@ void DreamBase::oldToNames() {
}
void DreamBase::saveLoad() {
- if (data.word(kWatchingtime) || (_pointerMode == 2)) {
+ if (_vars._watchingTime || (_pointerMode == 2)) {
blank();
return;
}
@@ -315,7 +377,7 @@ void DreamBase::doSaveLoad() {
}
void DreamBase::getBackFromOps() {
- if (data.byte(kMandead) == 2)
+ if (_vars._manDead == 2)
blank();
else
getBack1();
@@ -435,13 +497,13 @@ void DreamBase::actualLoad() {
void DreamBase::savePosition(unsigned int slot, const char *descbuf) {
- const Room &currentRoom = g_roomData[data.byte(kLocation)];
+ const Room &currentRoom = g_roomData[_vars._location];
Room madeUpRoom = currentRoom;
madeUpRoom.roomsSample = _roomsSample;
madeUpRoom.mapX = _mapX;
madeUpRoom.mapY = _mapY;
- madeUpRoom.liftFlag = data.byte(kLiftflag);
+ madeUpRoom.liftFlag = _vars._liftFlag;
madeUpRoom.b21 = _mansPath;
madeUpRoom.facing = _facing;
madeUpRoom.b27 = 255;
@@ -475,7 +537,9 @@ void DreamBase::savePosition(unsigned int slot, const char *descbuf) {
outSaveFile->write((const uint8 *)&header, sizeof(FileHeader));
outSaveFile->write(descbuf, len[0]);
- outSaveFile->write(data.ptr(kStartvars, len[1]), len[1]);
+ // TODO: Convert more to serializer?
+ Common::Serializer s(0, outSaveFile);
+ syncGameVars(s, _vars);
// the Extras segment:
outSaveFile->write((const uint8 *)_exFrames._frames, 2080);
@@ -490,8 +554,6 @@ void DreamBase::savePosition(unsigned int slot, const char *descbuf) {
outSaveFile->write((const uint8 *)&madeUpRoom, sizeof(Room));
outSaveFile->write(_roomsCanGo, 16);
- // TODO: Convert more to serializer?
- Common::Serializer s(0, outSaveFile);
for (unsigned int i = 0; i < kNumReelRoutines; ++i) {
syncReelRoutine(s, &_reelRoutines[i]);
}
@@ -548,7 +610,10 @@ void DreamBase::loadPosition(unsigned int slot) {
uint8 namebuf[17];
inSaveFile->read(namebuf, 17);
}
- inSaveFile->read(data.ptr(kStartvars, len[1]), len[1]);
+
+ // TODO: Use serializer for more?
+ Common::Serializer s(inSaveFile, 0);
+ syncGameVars(s, _vars);
// the Extras segment:
inSaveFile->read((uint8 *)_exFrames._frames, kExframes);
@@ -565,8 +630,6 @@ void DreamBase::loadPosition(unsigned int slot) {
inSaveFile->read((uint8 *)&g_madeUpRoomDat, sizeof(Room));
inSaveFile->read(_roomsCanGo, 16);
- // TODO: Use serializer for more
- Common::Serializer s(inSaveFile, 0);
for (unsigned int i = 0; i < kNumReelRoutines; ++i) {
syncReelRoutine(s, &_reelRoutines[i]);
}
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index c2646d6588..a04f877f2c 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -89,7 +89,7 @@ Sprite *DreamBase::makeSprite(uint8 x, uint8 y, uint16 updateCallback, const Gra
void DreamBase::spriteUpdate() {
// During the intro the sprite table can be empty
if (!_spriteTable.empty())
- _spriteTable.front().hidden = data.byte(kRyanon);
+ _spriteTable.front().hidden = _vars._ryanOn;
Common::List<Sprite>::iterator i;
for (i = _spriteTable.begin(); i != _spriteTable.end(); ++i) {
@@ -286,7 +286,7 @@ void DreamBase::doDoor(Sprite *sprite, SetObject *objData, Common::Rect check) {
if (openDoor) {
- if ((data.byte(kThroughdoor) == 1) && (sprite->animFrame == 0))
+ if ((_vars._throughDoor == 1) && (sprite->animFrame == 0))
sprite->animFrame = 6;
++sprite->animFrame;
@@ -302,7 +302,7 @@ void DreamBase::doDoor(Sprite *sprite, SetObject *objData, Common::Rect check) {
--sprite->animFrame;
sprite->frameNumber = objData->index = objData->frames[sprite->animFrame];
- data.byte(kThroughdoor) = 1;
+ _vars._throughDoor = 1;
} else {
// shut door
@@ -320,7 +320,7 @@ void DreamBase::doDoor(Sprite *sprite, SetObject *objData, Common::Rect check) {
sprite->frameNumber = objData->index = objData->frames[sprite->animFrame];
if (sprite->animFrame == 5) // nearly
- data.byte(kThroughdoor) = 0;
+ _vars._throughDoor = 0;
}
}
@@ -338,7 +338,7 @@ void DreamBase::lockedDoorway(Sprite *sprite, SetObject *objData) {
check.translate(sprite->x, sprite->y);
bool openDoor = check.contains(ryanx, ryany);
- if (data.byte(kThroughdoor) != 1 && data.byte(kLockstatus) == 1)
+ if (_vars._throughDoor != 1 && _vars._lockStatus == 1)
openDoor = false;
if (openDoor) {
@@ -348,9 +348,9 @@ void DreamBase::lockedDoorway(Sprite *sprite, SetObject *objData) {
}
if (sprite->animFrame == 6)
- turnPathOn(data.byte(kDoorpath));
+ turnPathOn(_vars._doorPath);
- if (data.byte(kThroughdoor) == 1 && sprite->animFrame == 0)
+ if (_vars._throughDoor == 1 && sprite->animFrame == 0)
sprite->animFrame = 6;
++sprite->animFrame;
@@ -359,7 +359,7 @@ void DreamBase::lockedDoorway(Sprite *sprite, SetObject *objData) {
sprite->frameNumber = objData->index = objData->frames[sprite->animFrame];
if (sprite->animFrame == 5)
- data.byte(kThroughdoor) = 1;
+ _vars._throughDoor = 1;
} else {
// shut door
@@ -371,43 +371,43 @@ void DreamBase::lockedDoorway(Sprite *sprite, SetObject *objData) {
if (sprite->animFrame != 0)
--sprite->animFrame;
- data.byte(kThroughdoor) = 0;
+ _vars._throughDoor = 0;
sprite->frameNumber = objData->index = objData->frames[sprite->animFrame];
if (sprite->animFrame == 0) {
- turnPathOff(data.byte(kDoorpath));
- data.byte(kLockstatus) = 1;
+ turnPathOff(_vars._doorPath);
+ _vars._lockStatus = 1;
}
}
}
void DreamBase::liftSprite(Sprite *sprite, SetObject *objData) {
- uint8 liftFlag = data.byte(kLiftflag);
+ uint8 liftFlag = _vars._liftFlag;
if (liftFlag == 0) { //liftclosed
- turnPathOff(data.byte(kLiftpath));
+ turnPathOff(_vars._liftPath);
- if (data.byte(kCounttoopen) != 0) {
- data.byte(kCounttoopen)--;
- if (data.byte(kCounttoopen) == 0)
- data.byte(kLiftflag) = 3;
+ if (_vars._countToOpen != 0) {
+ _vars._countToOpen--;
+ if (_vars._countToOpen == 0)
+ _vars._liftFlag = 3;
}
sprite->animFrame = 0;
sprite->frameNumber = objData->index = objData->frames[sprite->animFrame];
}
else if (liftFlag == 1) { //liftopen
- turnPathOn(data.byte(kLiftpath));
+ turnPathOn(_vars._liftPath);
- if (data.byte(kCounttoclose) != 0) {
- data.byte(kCounttoclose)--;
- if (data.byte(kCounttoclose) == 0)
- data.byte(kLiftflag) = 2;
+ if (_vars._countToClose != 0) {
+ _vars._countToClose--;
+ if (_vars._countToClose == 0)
+ _vars._liftFlag = 2;
}
sprite->animFrame = 12;
sprite->frameNumber = objData->index = objData->frames[sprite->animFrame];
}
else if (liftFlag == 3) { //openlift
if (sprite->animFrame == 12) {
- data.byte(kLiftflag) = 1;
+ _vars._liftFlag = 1;
return;
}
++sprite->animFrame;
@@ -418,7 +418,7 @@ void DreamBase::liftSprite(Sprite *sprite, SetObject *objData) {
} else { //closeLift
assert(liftFlag == 2);
if (sprite->animFrame == 0) {
- data.byte(kLiftflag) = 0;
+ _vars._liftFlag = 0;
return;
}
--sprite->animFrame;
@@ -497,7 +497,7 @@ void DreamBase::showRain() {
if (_channel1Playing != 255)
return;
- if (_realLocation == 2 && data.byte(kBeenmugged) != 1)
+ if (_realLocation == 2 && _vars._beenMugged != 1)
return;
if (_realLocation == 55)
return;
@@ -803,7 +803,7 @@ void DreamBase::reelsOnScreen() {
void DreamBase::reconstruct() {
if (_haveDoneObs == 0)
return;
- data.byte(kNewobs) = 1;
+ _vars._newObs = 1;
drawFloor();
spriteUpdate();
printSprites();
@@ -1186,7 +1186,7 @@ void DreamBase::checkForExit(Sprite *sprite) {
}
- data.byte(kNeedtotravel) = 1;
+ _vars._needToTravel = 1;
}
} // End of namespace DreamGen
diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h
index db1e51fafc..defc6850d0 100644
--- a/engines/dreamweb/structs.h
+++ b/engines/dreamweb/structs.h
@@ -343,6 +343,68 @@ struct GraphicsFile {
}
};
+struct GameVars {
+ uint8 _startVars;
+ uint8 _progressPoints;
+ uint8 _watchOn;
+ uint8 _shadesOn;
+ uint8 _secondCount;
+ uint8 _minuteCount;
+ uint8 _hourCount;
+ uint8 _zoomOn;
+ uint8 _location;
+ uint8 _exPos;
+ uint16 _exFramePos;
+ uint16 _exTextPos;
+ uint16 _card1Money;
+ uint16 _listPos;
+ uint8 _ryanPage;
+ uint16 _watchingTime;
+ uint16 _reelToWatch; // reel plays from here in mode 0
+ uint16 _endWatchReel; // and stops here. Mode set to 1
+ uint8 _speedCount;
+ uint8 _watchSpeed;
+ uint16 _reelToHold; // if mode is 1 hold on this reel
+ uint16 _endOfHoldReel; // if mode is 2 then play to endOfHoldReel and reset mode to -1
+ uint8 _watchMode;
+ uint8 _destAfterHold; // set walking destination
+ uint8 _newsItem;
+ uint8 _liftFlag;
+ uint8 _liftPath;
+ uint8 _lockStatus;
+ uint8 _doorPath;
+ uint8 _countToOpen;
+ uint8 _countToClose;
+ uint8 _rockstarDead;
+ uint8 _generalDead;
+ uint8 _sartainDead;
+ uint8 _aideDead;
+ uint8 _beenMugged;
+ uint8 _gunPassFlag;
+ uint8 _canMoveAltar;
+ uint8 _talkedToAttendant;
+ uint8 _talkedToSparky;
+ uint8 _talkedToBoss;
+ uint8 _talkedToRecep;
+ uint8 _cardPassFlag;
+ uint8 _madmanFlag;
+ uint8 _keeperFlag;
+ uint8 _lastTrigger;
+ uint8 _manDead;
+ uint8 _seed1;
+ uint8 _seed2;
+ uint8 _seed3;
+ uint8 _needToTravel;
+ uint8 _throughDoor;
+ uint8 _newObs;
+ uint8 _ryanOn;
+ uint8 _combatCount;
+ uint8 _lastWeapon;
+ uint8 _dreamNumber;
+ uint8 _roomAfterDream;
+ uint8 _shakeCounter;
+};
+
} // End of namespace DreamWeb
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 59fb00e3e6..b0b4e621c8 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -560,8 +560,8 @@ void DreamBase::dreamweb() {
clearChanges();
setMode();
loadPalFromIFF();
- data.byte(kLocation) = 255;
- data.byte(kRoomafterdream) = 1;
+ _vars._location = 255;
+ _vars._roomAfterDream = 1;
_newLocation = 35;
_volume = 7;
loadRoom();
@@ -599,18 +599,18 @@ void DreamBase::dreamweb() {
goto done;
}
- if (data.byte(kMandead) == 1 || data.byte(kMandead) == 2)
+ if (_vars._manDead == 1 || _vars._manDead == 2)
break;
- if (data.word(kWatchingtime) > 0) {
+ if (_vars._watchingTime > 0) {
if (_finalDest == _mansPath)
- data.word(kWatchingtime)--;
+ _vars._watchingTime--;
}
- if (data.word(kWatchingtime) == 0) {
+ if (_vars._watchingTime == 0) {
// "notWatching"
- if (data.byte(kMandead) == 4)
+ if (_vars._manDead == 4)
break;
if (_newLocation != 255) {
@@ -697,7 +697,7 @@ void DreamBase::screenUpdate() {
animPointer();
showPointer();
- if ((data.word(kWatchingtime) == 0) && (_newLocation != 0xff))
+ if ((_vars._watchingTime == 0) && (_newLocation != 0xff))
return;
vSync();
uint16 mouseState = 0;
@@ -749,7 +749,7 @@ void DreamBase::startup() {
_currentKey = 0;
_mainMode = 0;
createPanel();
- data.byte(kNewobs) = 1;
+ _vars._newObs = 1;
drawFloor();
showIcon();
getUnderZoom();
@@ -762,7 +762,7 @@ void DreamBase::startup() {
void DreamBase::startup1() {
clearPalette();
- data.byte(kThroughdoor) = 0;
+ _vars._throughDoor = 0;
startup();
@@ -771,11 +771,11 @@ void DreamBase::startup1() {
}
void DreamBase::switchRyanOn() {
- data.byte(kRyanon) = 255;
+ _vars._ryanOn = 255;
}
void DreamBase::switchRyanOff() {
- data.byte(kRyanon) = 1;
+ _vars._ryanOn = 1;
}
void DreamBase::loadGraphicsFile(GraphicsFile &file, const char *fileName) {
@@ -898,17 +898,17 @@ void DreamBase::triggerMessage(uint16 index) {
hangOn(340);
multiPut(_mapStore, 174, 153, 200, 63);
workToScreen();
- data.byte(kLasttrigger) = 0;
+ _vars._lastTrigger = 0;
}
void DreamBase::processTrigger() {
- if (data.byte(kLasttrigger) == '1') {
+ if (_vars._lastTrigger == '1') {
setLocation(8);
triggerMessage(45);
- } else if (data.byte(kLasttrigger) == '2') {
+ } else if (_vars._lastTrigger == '2') {
setLocation(9);
triggerMessage(55);
- } else if (data.byte(kLasttrigger) == '3') {
+ } else if (_vars._lastTrigger == '3') {
setLocation(2);
triggerMessage(59);
}
@@ -975,9 +975,9 @@ void DreamBase::getTime() {
TimeDate t;
g_system->getTimeAndDate(t);
debug(1, "\tgettime: %02d:%02d:%02d", t.tm_hour, t.tm_min, t.tm_sec);
- data.byte(kSecondcount) = t.tm_sec;
- data.byte(kMinutecount) = t.tm_min;
- data.byte(kHourcount) = t.tm_hour;
+ _vars._secondCount = t.tm_sec;
+ _vars._minuteCount = t.tm_min;
+ _vars._hourCount = t.tm_hour;
}
uint16 DreamBase::allocateMem(uint16 paragraphs) {
@@ -1007,7 +1007,7 @@ void DreamBase::DOSReturn() {
}
void DreamBase::eraseOldObs() {
- if (data.byte(kNewobs) == 0)
+ if (_vars._newObs == 0)
return;
// Note: the original didn't delete sprites here, but marked the
@@ -1058,20 +1058,20 @@ void DreamBase::clearAndLoad(uint8 *buf, uint8 c,
}
void DreamBase::startLoading(const Room &room) {
- data.byte(kCombatcount) = 0;
+ _vars._combatCount = 0;
_roomsSample = room.roomsSample;
_mapX = room.mapX;
_mapY = room.mapY;
- data.byte(kLiftflag) = room.liftFlag;
+ _vars._liftFlag = room.liftFlag;
_mansPath = room.b21;
_destination = room.b21;
_finalDest = room.b21;
_facing = room.facing;
_turnToFace = room.facing;
- data.byte(kCounttoopen) = room.countToOpen;
- data.byte(kLiftpath) = room.liftPath;
- data.byte(kDoorpath) = room.doorPath;
- data.byte(kLastweapon) = (uint8)-1;
+ _vars._countToOpen = room.countToOpen;
+ _vars._liftPath = room.liftPath;
+ _vars._doorPath = room.doorPath;
+ _vars._lastWeapon = (uint8)-1;
_realLocation = room.realLocation;
loadRoomData(room, false);
@@ -1081,8 +1081,8 @@ void DreamBase::startLoading(const Room &room) {
setAllChanges();
autoAppear();
// const Room &newRoom = g_roomData[_newLocation];
- data.byte(kLastweapon) = (uint8)-1;
- data.byte(kMandead) = 0;
+ _vars._lastWeapon = (uint8)-1;
+ _vars._manDead = 0;
_lookCounter = 160;
_newLocation = 255;
_linePointer = 254;
@@ -1415,11 +1415,11 @@ void DreamBase::obName(uint8 command, uint8 commandType) {
} else if (!finishedWalking())
return;
else if (_commandType == 5) {
- if (data.word(kWatchingtime) == 0)
+ if (_vars._watchingTime == 0)
talk();
return;
} else {
- if (data.word(kWatchingtime) == 0)
+ if (_vars._watchingTime == 0)
examineOb();
return;
}
@@ -1429,7 +1429,7 @@ void DreamBase::obName(uint8 command, uint8 commandType) {
_command = command;
_commandType = commandType;
- if ((_linePointer != 254) || (data.word(kWatchingtime) != 0) || (_facing != _turnToFace)) {
+ if ((_linePointer != 254) || (_vars._watchingTime != 0) || (_facing != _turnToFace)) {
blockNameText();
return;
} else if (_commandType != 3) {
@@ -1484,7 +1484,7 @@ void DreamBase::showBlink() {
if (_manIsOffScreen == 1)
return;
++_blinkCount;
- if (data.byte(kShadeson) != 0)
+ if (_vars._shadesOn != 0)
return;
if (_realLocation >= 50) // eyesshut
return;
@@ -1502,7 +1502,7 @@ void DreamBase::showBlink() {
}
void DreamBase::dumpBlink() {
- if (data.byte(kShadeson) != 0)
+ if (_vars._shadesOn != 0)
return;
if (_blinkCount != 0)
return;
@@ -1582,7 +1582,7 @@ void DreamBase::animPointer() {
_pointerFrame = flashMouseTab[_pointerCount];
return;
}
- if (data.word(kWatchingtime) != 0) {
+ if (_vars._watchingTime != 0) {
_pointerFrame = 11;
return;
}
@@ -1851,7 +1851,7 @@ void DreamBase::enterSymbol() {
}
void DreamBase::zoomOnOff() {
- if (data.word(kWatchingtime) != 0 || _pointerMode == 2) {
+ if (_vars._watchingTime != 0 || _pointerMode == 2) {
blank();
return;
}
@@ -1864,9 +1864,9 @@ void DreamBase::zoomOnOff() {
if (!(_mouseButton & 1) || (_mouseButton == _oldButton))
return;
- data.byte(kZoomon) ^= 1;
+ _vars._zoomOn ^= 1;
createPanel();
- data.byte(kNewobs) = 0;
+ _vars._newObs = 0;
drawFloor();
printSprites();
reelsOnScreen();
@@ -1890,7 +1890,7 @@ void DreamBase::sortOutMap() {
void DreamBase::mainScreen() {
_inMapArea = 0;
- if (data.byte(kWatchon) == 1) {
+ if (_vars._watchOn == 1) {
RectWithCallback<DreamBase> mainList[] = {
{ 44,70,32,46,&DreamBase::look },
{ 0,50,0,180,&DreamBase::inventory },
@@ -1919,7 +1919,7 @@ void DreamBase::mainScreen() {
}
void DreamBase::showWatch() {
- if (data.byte(kWatchon)) {
+ if (_vars._watchOn) {
showFrame(_icons1, 250, 1, 6, 0);
showTime();
}
@@ -1933,12 +1933,12 @@ void DreamBase::dumpWatch() {
}
void DreamBase::showTime() {
- if (data.byte(kWatchon) == 0)
+ if (_vars._watchOn == 0)
return;
- int seconds = data.byte(kSecondcount);
- int minutes = data.byte(kMinutecount);
- int hours = data.byte(kHourcount);
+ int seconds = _vars._secondCount;
+ int minutes = _vars._minuteCount;
+ int hours = _vars._hourCount;
showFrame(_charset1, 282+5, 21, 91*3+10 + seconds / 10, 0);
showFrame(_charset1, 282+9, 21, 91*3+10 + seconds % 10, 0);
@@ -1953,7 +1953,7 @@ void DreamBase::showTime() {
}
void DreamBase::watchCount() {
- if (data.byte(kWatchon) == 0)
+ if (_vars._watchOn == 0)
return;
++_timerCount;
if (_timerCount == 9) {
@@ -1961,15 +1961,15 @@ void DreamBase::watchCount() {
_watchDump = 1;
} else if (_timerCount == 18) {
_timerCount = 0;
- ++data.byte(kSecondcount);
- if (data.byte(kSecondcount) == 60) {
- data.byte(kSecondcount) = 0;
- ++data.byte(kMinutecount);
- if (data.byte(kMinutecount) == 60) {
- data.byte(kMinutecount) = 0;
- ++data.byte(kHourcount);
- if (data.byte(kHourcount) == 24)
- data.byte(kHourcount) = 0;
+ ++_vars._secondCount;
+ if (_vars._secondCount == 60) {
+ _vars._secondCount = 0;
+ ++_vars._minuteCount;
+ if (_vars._minuteCount == 60) {
+ _vars._minuteCount = 0;
+ ++_vars._hourCount;
+ if (_vars._hourCount == 24)
+ _vars._hourCount = 0;
}
}
showTime();
@@ -1983,7 +1983,7 @@ void DreamBase::roomName() {
if (textIndex >= 32)
textIndex -= 32;
_lineSpacing = 7;
- uint8 maxWidth = (data.byte(kWatchon) == 1) ? 120 : 160;
+ uint8 maxWidth = (_vars._watchOn == 1) ? 120 : 160;
const uint8 *string = (const uint8 *)_roomDesc.getString(textIndex);
printDirect(string, 88, 25, maxWidth, false);
_lineSpacing = 10;
@@ -1999,7 +1999,7 @@ void DreamBase::loadRoom() {
_textAddressX = 13;
_textAddressY = 182;
_textLen = 240;
- data.byte(kLocation) = _newLocation;
+ _vars._location = _newLocation;
const Room &room = g_roomData[_newLocation];
startLoading(room);
loadRoomsSample();
@@ -2043,13 +2043,13 @@ void DreamBase::autoLook() {
--_lookCounter;
if (_lookCounter)
return;
- if (data.word(kWatchingtime))
+ if (_vars._watchingTime)
return;
doLook();
}
void DreamBase::look() {
- if (data.word(kWatchingtime) || (_pointerMode == 2)) {
+ if (_vars._watchingTime || (_pointerMode == 2)) {
blank();
return;
}
@@ -2192,7 +2192,7 @@ void DreamBase::loadRoomData(const Room &room, bool skipDat) {
}
void DreamBase::restoreAll() {
- const Room &room = g_roomData[data.byte(kLocation)];
+ const Room &room = g_roomData[_vars._location];
loadRoomData(room, true);
setAllChanges();
}
@@ -2322,18 +2322,18 @@ void DreamBase::showExit() {
void DreamBase::showMan() {
showFrame(_icons1, 0, 0, 0, 0);
showFrame(_icons1, 0, 114, 1, 0);
- if (data.byte(kShadeson))
+ if (_vars._shadesOn)
showFrame(_icons1, 28, 25, 2, 0);
}
void DreamBase::panelIcons1() {
uint16 x;
- if (data.byte(kWatchon) != 1)
+ if (_vars._watchOn != 1)
x = 48;
else
x = 0;
showFrame(_icons2, 204 + x, 4, 2, 0);
- if (data.byte(kZoomon) != 1)
+ if (_vars._zoomOn != 1)
showFrame(_icons1, 228 + x, 8, 5, 0);
showWatch();
}
@@ -2399,7 +2399,7 @@ void DreamBase::lastFolder() {
void DreamBase::folderHints() {
if (_folderPage == 5) {
- if ((data.byte(kAidedead) != 1) && (getLocation(13) != 1)) {
+ if ((_vars._aideDead != 1) && (getLocation(13) != 1)) {
setLocation(13);
showFolder();
const uint8 *string = getTextInFile1(30);
@@ -2441,7 +2441,7 @@ void DreamBase::drawFloor() {
showAllEx();
panelToMap();
initRain();
- data.byte(kNewobs) = 0;
+ _vars._newObs = 0;
}
void DreamBase::allocateBuffers() {
@@ -2482,7 +2482,7 @@ void DreamBase::useMenu() {
createPanel();
showPanel();
showIcon();
- data.byte(kNewobs) = 0;
+ _vars._newObs = 0;
drawFloor();
printSprites();
showFrame(_tempGraphics2, kMenux-48, kMenuy-4, 4, 0);
@@ -2526,7 +2526,7 @@ void DreamBase::atmospheres() {
continue;
if (a->_sound != _channel0Playing) {
- if (data.byte(kLocation) == 45 && data.word(kReeltowatch) == 45)
+ if (_vars._location == 45 && _vars._reelToWatch == 45)
continue; // "web"
playChannel0(a->_sound, a->_repeat);
@@ -2708,16 +2708,16 @@ void DreamBase::initialInv() {
pickupOb(19, 1);
pickupOb(20, 9);
pickupOb(16, 2);
- data.byte(kWatchmode) = 1;
- data.word(kReeltohold) = 0;
- data.word(kEndofholdreel) = 6;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchMode = 1;
+ _vars._reelToHold = 0;
+ _vars._endOfHoldReel = 6;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
switchRyanOff();
}
void DreamBase::walkIntoRoom() {
- if (data.byte(kLocation) == 14 && _mapX == 22) {
+ if (_vars._location == 14 && _mapX == 22) {
_destination = 1;
_finalDest = 1;
autoSetWalk();
@@ -2730,7 +2730,7 @@ void DreamBase::afterIntroRoom() {
clearWork();
findRoomInLoc();
- data.byte(kNewobs) = 1;
+ _vars._newObs = 1;
drawFloor();
reelsOnScreen();
spriteUpdate();
@@ -2742,7 +2742,7 @@ void DreamBase::afterIntroRoom() {
void DreamBase::redrawMainScrn() {
_timeCount = 0;
createPanel();
- data.byte(kNewobs) = 0;
+ _vars._newObs = 0;
drawFloor();
printSprites();
reelsOnScreen();
@@ -2768,7 +2768,7 @@ void DreamBase::allPointer() {
void DreamBase::makeMainScreen() {
createPanel();
- data.byte(kNewobs) = 1;
+ _vars._newObs = 1;
drawFloor();
spriteUpdate();
printSprites();
@@ -2949,59 +2949,59 @@ void DreamBase::underTextLine() {
}
void DreamBase::showWatchReel() {
- uint16 reelPointer = data.word(kReeltowatch);
+ uint16 reelPointer = _vars._reelToWatch;
plotReel(reelPointer);
- data.word(kReeltowatch) = reelPointer;
+ _vars._reelToWatch = reelPointer;
// check for shake
if (_realLocation == 26 && reelPointer == 104)
- data.byte(kShakecounter) = 0xFF;
+ _vars._shakeCounter = 0xFF;
}
void DreamBase::watchReel() {
- if (data.word(kReeltowatch) != 0xFFFF) {
+ if (_vars._reelToWatch != 0xFFFF) {
if (_mansPath != _finalDest)
return; // Wait until stopped walking
if (_turnToFace != _facing)
return;
- if (--data.byte(kSpeedcount) != 0xFF) {
+ if (--_vars._speedCount != 0xFF) {
showWatchReel();
return;
}
- data.byte(kSpeedcount) = data.byte(kWatchspeed);
- if (data.word(kReeltowatch) != data.word(kEndwatchreel)) {
- ++data.word(kReeltowatch);
+ _vars._speedCount = _vars._watchSpeed;
+ if (_vars._reelToWatch != _vars._endWatchReel) {
+ ++_vars._reelToWatch;
showWatchReel();
return;
}
- if (data.word(kWatchingtime)) {
+ if (_vars._watchingTime) {
showWatchReel();
return;
}
- data.word(kReeltowatch) = 0xFFFF;
- data.byte(kWatchmode) = 0xFF;
- if (data.word(kReeltohold) == 0xFFFF)
+ _vars._reelToWatch = 0xFFFF;
+ _vars._watchMode = 0xFF;
+ if (_vars._reelToHold == 0xFFFF)
return; // No more reel
- data.byte(kWatchmode) = 1;
- } else if (data.byte(kWatchmode) != 1) {
- if (data.byte(kWatchmode) != 2)
+ _vars._watchMode = 1;
+ } else if (_vars._watchMode != 1) {
+ if (_vars._watchMode != 2)
return; // "notreleasehold"
- if (--data.byte(kSpeedcount) == 0xFF) {
- data.byte(kSpeedcount) = data.byte(kWatchspeed);
- ++data.word(kReeltohold);
+ if (--_vars._speedCount == 0xFF) {
+ _vars._speedCount = _vars._watchSpeed;
+ ++_vars._reelToHold;
}
- if (data.word(kReeltohold) == data.word(kEndofholdreel)) {
- data.word(kReeltohold) = 0xFFFF;
- data.byte(kWatchmode) = 0xFF;
- _destination = data.byte(kDestafterhold);
- _finalDest = data.byte(kDestafterhold);
+ if (_vars._reelToHold == _vars._endOfHoldReel) {
+ _vars._reelToHold = 0xFFFF;
+ _vars._watchMode = 0xFF;
+ _destination = _vars._destAfterHold;
+ _finalDest = _vars._destAfterHold;
autoSetWalk();
return;
}
}
- uint16 reelPointer = data.word(kReeltohold);
+ uint16 reelPointer = _vars._reelToHold;
plotReel(reelPointer);
}
@@ -3013,12 +3013,12 @@ void DreamBase::afterNewRoom() {
createPanel();
_commandType = 0;
findRoomInLoc();
- if (data.byte(kRyanon) != 1) {
+ if (_vars._ryanOn != 1) {
_mansPath = findPathOfPoint(_ryanX + 12, _ryanY + 12);
findXYFromPath();
_resetManXY = 1;
}
- data.byte(kNewobs) = 1;
+ _vars._newObs = 1;
drawFloor();
_lookCounter = 160;
_nowInNewRoom = 0;
@@ -3037,10 +3037,10 @@ void DreamBase::afterNewRoom() {
}
void DreamBase::madmanRun() {
- if (data.byte(kLocation) != 14 ||
+ if (_vars._location != 14 ||
_mapX != 22 ||
_pointerMode != 2 ||
- data.byte(kMadmanflag) != 0) {
+ _vars._madmanFlag != 0) {
identifyOb();
return;
}
@@ -3052,7 +3052,7 @@ void DreamBase::madmanRun() {
if (_mouseButton == 1 &&
_mouseButton != _oldButton)
- data.byte(kLastweapon) = 8;
+ _vars._lastWeapon = 8;
}
@@ -3061,7 +3061,7 @@ void DreamBase::decide() {
loadPalFromIFF();
clearPalette();
_pointerMode = 0;
- data.word(kWatchingtime) = 0;
+ _vars._watchingTime = 0;
_pointerFrame = 0;
_textAddressX = 70;
_textAddressY = 182 - 8;
@@ -3227,7 +3227,7 @@ void DreamBase::getBack1() {
}
void DreamBase::autoAppear() {
- if (data.byte(kLocation) == 32) {
+ if (_vars._location == 32) {
// In alley
resetLocation(5);
setLocation(10);
@@ -3237,8 +3237,8 @@ void DreamBase::autoAppear() {
if (_realLocation == 24) {
// In Eden's apartment
- if (data.byte(kGeneraldead) == 1) {
- data.byte(kGeneraldead)++;
+ if (_vars._generalDead == 1) {
+ _vars._generalDead++;
placeSetObject(44);
placeSetObject(18);
placeSetObject(93);
@@ -3247,23 +3247,23 @@ void DreamBase::autoAppear() {
removeSetObject(75);
removeSetObject(84);
removeSetObject(85);
- } else if (data.byte(kSartaindead) == 1) {
+ } else if (_vars._sartainDead == 1) {
// Eden's part 2
removeSetObject(44);
removeSetObject(93);
placeSetObject(55);
- data.byte(kSartaindead)++;
+ _vars._sartainDead++;
}
} else {
// Not in Eden's
if (_realLocation == 25) {
// Sart roof
- data.byte(kNewsitem) = 3;
+ _vars._newsItem = 3;
resetLocation(6);
setLocation(11);
_destPos = 11;
} else {
- if (_realLocation == 2 && data.byte(kRockstardead) != 0)
+ if (_realLocation == 2 && _vars._rockstarDead != 0)
placeSetObject(23);
}
}
@@ -3292,7 +3292,7 @@ void DreamBase::setupTimedUse(uint16 textIndex, uint16 countToTimed, uint16 time
}
void DreamBase::entryTexts() {
- switch (data.byte(kLocation)) {
+ switch (_vars._location) {
case 21:
setupTimedUse(28, 60, 11, 68, 64);
break;
@@ -3320,33 +3320,33 @@ void DreamBase::entryTexts() {
}
void DreamBase::entryAnims() {
- data.word(kReeltowatch) = 0xFFFF;
- data.byte(kWatchmode) = (byte)-1;
+ _vars._reelToWatch = 0xFFFF;
+ _vars._watchMode = (byte)-1;
- switch (data.byte(kLocation)) {
+ switch (_vars._location) {
case 33: // beach
switchRyanOff();
- data.word(kWatchingtime) = 76 * 2;
- data.word(kReeltowatch) = 0;
- data.word(kEndwatchreel) = 76;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 76 * 2;
+ _vars._reelToWatch = 0;
+ _vars._endWatchReel = 76;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
break;
case 44: // Sparky's
resetLocation(8);
- data.word(kWatchingtime) = 50*2;
- data.word(kReeltowatch) = 247;
- data.word(kEndwatchreel) = 297;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 50*2;
+ _vars._reelToWatch = 247;
+ _vars._endWatchReel = 297;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
switchRyanOff();
break;
case 22: // lift
- data.word(kWatchingtime) = 31 * 2;
- data.word(kReeltowatch) = 0;
- data.word(kEndwatchreel) = 30;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 31 * 2;
+ _vars._reelToWatch = 0;
+ _vars._endWatchReel = 30;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
switchRyanOff();
break;
case 26: // under church
@@ -3354,18 +3354,18 @@ void DreamBase::entryAnims() {
_symbolBotNum = 1;
break;
case 45: // entered Dreamweb
- data.byte(kKeeperflag) = 0;
- data.word(kWatchingtime) = 296;
- data.word(kReeltowatch) = 45;
- data.word(kEndwatchreel) = 198;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._keeperFlag = 0;
+ _vars._watchingTime = 296;
+ _vars._reelToWatch = 45;
+ _vars._endWatchReel = 198;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
switchRyanOff();
break;
default:
- if (_realLocation == 46 && data.byte(kSartaindead) == 1) { // Crystal
+ if (_realLocation == 46 && _vars._sartainDead == 1) { // Crystal
removeFreeObject(0);
- } else if (data.byte(kLocation) == 9 && !checkIfPathIsOn(2) && data.byte(kAidedead) != 0) {
+ } else if (_vars._location == 9 && !checkIfPathIsOn(2) && _vars._aideDead != 0) {
// Top of church
if (checkIfPathIsOn(3))
turnPathOn(2);
@@ -3373,24 +3373,24 @@ void DreamBase::entryAnims() {
// Make doors open
removeSetObject(4);
placeSetObject(5);
- } else if (data.byte(kLocation) == 47) { // Dream centre
+ } else if (_vars._location == 47) { // Dream centre
placeSetObject(4);
placeSetObject(5);
- } else if (data.byte(kLocation) == 38) { // Car park
- data.word(kWatchingtime) = 57 * 2;
- data.word(kReeltowatch) = 4;
- data.word(kEndwatchreel) = 57;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ } else if (_vars._location == 38) { // Car park
+ _vars._watchingTime = 57 * 2;
+ _vars._reelToWatch = 4;
+ _vars._endWatchReel = 57;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
switchRyanOff();
- } else if (data.byte(kLocation) == 32) { // Alley
- data.word(kWatchingtime) = 66 * 2;
- data.word(kReeltowatch) = 0;
- data.word(kEndwatchreel) = 66;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ } else if (_vars._location == 32) { // Alley
+ _vars._watchingTime = 66 * 2;
+ _vars._reelToWatch = 0;
+ _vars._endWatchReel = 66;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
switchRyanOff();
- } else if (data.byte(kLocation) == 24) { // Eden's again
+ } else if (_vars._location == 24) { // Eden's again
turnAnyPathOn(2, _roomNum - 1);
}
}
@@ -3489,7 +3489,7 @@ void DreamBase::showDiaryPage() {
void DreamBase::dumpDiaryKeys() {
if (_pressCount == 1) {
- if (data.byte(kSartaindead) != 1 && _diaryPage == 5 && getLocation(6) != 1) {
+ if (_vars._sartainDead != 1 && _diaryPage == 5 && getLocation(6) != 1) {
// Add Sartain Industries note
setLocation(6);
delPointer();
@@ -3539,8 +3539,6 @@ void DreamBase::lookAtCard() {
}
void DreamBase::clearBuffers() {
- memcpy(_initialVars, data.ptr(kStartvars, kLengthofvars), kLengthofvars);
-
clearChanges();
}
@@ -3549,10 +3547,10 @@ void DreamBase::clearChanges() {
setupInitialReelRoutines();
- memcpy(data.ptr(kStartvars, kLengthofvars), _initialVars, kLengthofvars);
+ setupInitialVars();
- data.word(kExframepos) = 0;
- data.word(kExtextpos) = 0;
+ _vars._exFramePos = 0;
+ _vars._exTextPos = 0;
memset(_exFrames._frames, 0xFF, 2080);
memset(_exFrames._data, 0xFF, kExframeslen);
@@ -3565,6 +3563,68 @@ void DreamBase::clearChanges() {
memcpy(_roomsCanGo, initialRoomsCanGo, 16);
}
+void DreamBase::setupInitialVars() {
+ _vars._startVars = 0;
+ _vars._progressPoints = 0;
+ _vars._watchOn = 0;
+ _vars._shadesOn = 0;
+ _vars._secondCount = 0;
+ _vars._minuteCount = 30;
+ _vars._hourCount = 19;
+ _vars._zoomOn = 1;
+ _vars._location = 0;
+ _vars._exPos = 0;
+ _vars._exFramePos = 0;
+ _vars._exTextPos = 0;
+ _vars._card1Money = 0;
+ _vars._listPos = 0;
+ _vars._ryanPage = 0;
+ _vars._watchingTime = 0;
+ _vars._reelToWatch = (uint16)-1;
+ _vars._endWatchReel = 0;
+ _vars._speedCount = 0;
+ _vars._watchSpeed = 0;
+ _vars._reelToHold = (uint16)-1;
+ _vars._endOfHoldReel = (uint16)-1;
+ _vars._watchMode = (uint8)-1;
+ _vars._destAfterHold = 0;
+ _vars._newsItem = 0;
+ _vars._liftFlag = 0;
+ _vars._liftPath = 0;
+ _vars._lockStatus = 1;
+ _vars._doorPath = 0;
+ _vars._countToOpen = 0;
+ _vars._countToClose = 0;
+ _vars._rockstarDead = 0;
+ _vars._generalDead = 0;
+ _vars._sartainDead = 0;
+ _vars._aideDead = 0;
+ _vars._beenMugged = 0;
+ _vars._gunPassFlag = 0;
+ _vars._canMoveAltar = 0;
+ _vars._talkedToAttendant = 0;
+ _vars._talkedToSparky = 0;
+ _vars._talkedToBoss = 0;
+ _vars._talkedToRecep = 0;
+ _vars._cardPassFlag = 0;
+ _vars._madmanFlag = 0;
+ _vars._keeperFlag = 0;
+ _vars._lastTrigger = 0;
+ _vars._manDead = 0;
+ _vars._seed1 = 1;
+ _vars._seed2 = 2;
+ _vars._seed3 = 3;
+ _vars._needToTravel = 0;
+ _vars._throughDoor = 0;
+ _vars._newObs = 0;
+ _vars._ryanOn = 255;
+ _vars._combatCount = 0;
+ _vars._lastWeapon = (uint8)-1;
+ _vars._dreamNumber = 0;
+ _vars._roomAfterDream = 0;
+ _vars._shakeCounter = 48;
+}
+
void DreamBase::showDiaryKeys() {
if (!_pressCount)
return; // nokeyatall
@@ -3590,7 +3650,7 @@ void DreamBase::edensFlatReminders() {
if (_realLocation != 24 || _mapX != 44)
return; // not in Eden's lift
- if (data.byte(kProgresspoints))
+ if (_vars._progressPoints)
return; // not the first time in Eden's apartment
uint16 exObjextIndex = findExObject("CSHR");
@@ -3611,7 +3671,7 @@ void DreamBase::edensFlatReminders() {
}
}
- data.byte(kProgresspoints)++; // got card
+ _vars._progressPoints++; // got card
}
void DreamBase::incRyanPage() {
@@ -3623,7 +3683,7 @@ void DreamBase::incRyanPage() {
if (_mouseButton == _oldButton || !(_mouseButton & 1))
return;
- data.byte(kRyanpage) = (_mouseX - (kInventx + 167)) / 18;
+ _vars._ryanPage = (_mouseX - (kInventx + 167)) / 18;
delPointer();
fillRyan();
@@ -3636,9 +3696,9 @@ void DreamBase::incRyanPage() {
void DreamBase::emergencyPurge() {
while (true) {
- if (data.word(kExframepos) + 4000 < kExframeslen) {
+ if (_vars._exFramePos + 4000 < kExframeslen) {
// Not near frame end
- if (data.word(kExtextpos) + 400 < kExtextlen)
+ if (_vars._exTextPos + 400 < kExtextlen)
return; // notneartextend
}
diff --git a/engines/dreamweb/titles.cpp b/engines/dreamweb/titles.cpp
index ff3566f5d7..37cdd70e9a 100644
--- a/engines/dreamweb/titles.cpp
+++ b/engines/dreamweb/titles.cpp
@@ -242,16 +242,16 @@ void DreamBase::runEndSeq() {
void DreamBase::loadIntroRoom() {
_introCount = 0;
- data.byte(kLocation) = 255;
+ _vars._location = 255;
loadRoom();
_mapOffsetX = 72;
_mapOffsetY = 16;
clearSprites();
- data.byte(kThroughdoor) = 0;
+ _vars._throughDoor = 0;
_currentKey = '0';
_mainMode = 0;
clearWork();
- data.byte(kNewobs) = 1;
+ _vars._newObs = 1;
drawFloor();
reelsOnScreen();
spriteUpdate();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 94c9d20ea7..ebebc45ad5 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -221,11 +221,11 @@ void DreamBase::viewFolder() {
void DreamBase::edensCDPlayer() {
showFirstUse();
- data.word(kWatchingtime) = 18 * 2;
- data.word(kReeltowatch) = 25;
- data.word(kEndwatchreel) = 42;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 18 * 2;
+ _vars._reelToWatch = 25;
+ _vars._endWatchReel = 42;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
}
@@ -250,37 +250,37 @@ void DreamBase::useElevator1() {
void DreamBase::useElevator2() {
showFirstUse();
- if (data.byte(kLocation) == 23) // In pool hall
+ if (_vars._location == 23) // In pool hall
_newLocation = 31;
else
_newLocation = 23;
- data.byte(kCounttoclose) = 20;
- data.byte(kCounttoopen) = 0;
- data.word(kWatchingtime) = 80;
+ _vars._countToClose = 20;
+ _vars._countToOpen = 0;
+ _vars._watchingTime = 80;
_getBack = 1;
}
void DreamBase::useElevator3() {
showFirstUse();
- data.byte(kCounttoclose) = 20;
+ _vars._countToClose = 20;
_newLocation = 34;
- data.word(kReeltowatch) = 46;
- data.word(kEndwatchreel) = 63;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.word(kWatchingtime) = 80;
+ _vars._reelToWatch = 46;
+ _vars._endWatchReel = 63;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
+ _vars._watchingTime = 80;
_getBack = 1;
}
void DreamBase::useElevator4() {
showFirstUse();
- data.word(kReeltowatch) = 0;
- data.word(kEndwatchreel) = 11;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.byte(kCounttoclose) = 20;
- data.word(kWatchingtime) = 80;
+ _vars._reelToWatch = 0;
+ _vars._endWatchReel = 11;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
+ _vars._countToClose = 20;
+ _vars._watchingTime = 80;
_getBack = 1;
_newLocation = 24;
}
@@ -289,9 +289,9 @@ void DreamBase::useElevator5() {
placeSetObject(4);
removeSetObject(0);
_newLocation = 20;
- data.word(kWatchingtime) = 80;
- data.byte(kLiftflag) = 1;
- data.byte(kCounttoclose) = 8;
+ _vars._watchingTime = 80;
+ _vars._liftFlag = 1;
+ _vars._countToClose = 8;
_getBack = 1;
}
@@ -310,7 +310,7 @@ void DreamBase::wheelSound() {
void DreamBase::callHotelLift() {
playChannel1(12);
showFirstUse();
- data.byte(kCounttoopen) = 8;
+ _vars._countToOpen = 8;
_getBack = 1;
_destination = 5;
_finalDest = 5;
@@ -319,49 +319,49 @@ void DreamBase::callHotelLift() {
}
void DreamBase::useShield() {
- if (_realLocation != 20 || data.byte(kCombatcount) == 0) {
+ if (_realLocation != 20 || _vars._combatCount == 0) {
// Not in Sart room
showFirstUse();
putBackObStuff();
} else {
- data.byte(kLastweapon) = 3;
+ _vars._lastWeapon = 3;
showSecondUse();
_getBack = 1;
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
removeObFromInv();
}
}
void DreamBase::useCoveredBox() {
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
showFirstUse();
- data.word(kWatchingtime) = 50;
- data.word(kReeltowatch) = 41;
- data.word(kEndwatchreel) = 66;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 50;
+ _vars._reelToWatch = 41;
+ _vars._endWatchReel = 66;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
}
void DreamBase::useRailing() {
showFirstUse();
- data.word(kWatchingtime) = 80;
- data.word(kReeltowatch) = 0;
- data.word(kEndwatchreel) = 30;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 80;
+ _vars._reelToWatch = 0;
+ _vars._endWatchReel = 30;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
- data.byte(kMandead) = 4;
+ _vars._manDead = 4;
}
void DreamBase::wearWatch() {
- if (data.byte(kWatchon) == 1) {
+ if (_vars._watchOn == 1) {
// Already wearing watch
showSecondUse();
putBackObStuff();
} else {
showFirstUse();
- data.byte(kWatchon) = 1;
+ _vars._watchOn = 1;
_getBack = 1;
uint8 dummy;
makeWorn((DynObject *)getAnyAd(&dummy, &dummy));
@@ -369,12 +369,12 @@ void DreamBase::wearWatch() {
}
void DreamBase::wearShades() {
- if (data.byte(kShadeson) == 1) {
+ if (_vars._shadesOn == 1) {
// Already wearing shades
showSecondUse();
putBackObStuff();
} else {
- data.byte(kShadeson) = 1;
+ _vars._shadesOn = 1;
showFirstUse();
_getBack = 1;
uint8 dummy;
@@ -385,27 +385,27 @@ void DreamBase::wearShades() {
void DreamBase::useChurchHole() {
showFirstUse();
_getBack = 1;
- data.word(kWatchingtime) = 28;
- data.word(kReeltowatch) = 13;
- data.word(kEndwatchreel) = 26;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 28;
+ _vars._reelToWatch = 13;
+ _vars._endWatchReel = 26;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
}
void DreamBase::sitDownInBar() {
- if (data.byte(kWatchmode) != 0xFF) {
+ if (_vars._watchMode != 0xFF) {
// Sat down
showSecondUse();
putBackObStuff();
} else {
showFirstUse();
- data.word(kWatchingtime) = 50;
- data.word(kReeltowatch) = 55;
- data.word(kEndwatchreel) = 71;
- data.word(kReeltohold) = 73;
- data.word(kEndofholdreel) = 83;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 50;
+ _vars._reelToWatch = 55;
+ _vars._endWatchReel = 71;
+ _vars._reelToHold = 73;
+ _vars._endOfHoldReel = 83;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
}
}
@@ -425,18 +425,18 @@ void DreamBase::useBalcony() {
turnPathOff(3);
turnPathOff(4);
turnPathOff(5);
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
_mansPath = 6;
_destination = 6;
_finalDest = 6;
findXYFromPath();
switchRyanOff();
_resetManXY = 1;
- data.word(kWatchingtime) = 30 * 2;
- data.word(kReeltowatch) = 183;
- data.word(kEndwatchreel) = 212;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 30 * 2;
+ _vars._reelToWatch = 183;
+ _vars._endWatchReel = 212;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
}
@@ -446,7 +446,7 @@ void DreamBase::useWindow() {
showSecondUse();
putBackObStuff();
} else {
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
showFirstUse();
_newLocation = 29;
_getBack = 1;
@@ -454,33 +454,33 @@ void DreamBase::useWindow() {
}
void DreamBase::trapDoor() {
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
showFirstUse();
switchRyanOff();
- data.word(kWatchingtime) = 20 * 2;
- data.word(kReeltowatch) = 181;
- data.word(kEndwatchreel) = 197;
+ _vars._watchingTime = 20 * 2;
+ _vars._reelToWatch = 181;
+ _vars._endWatchReel = 197;
_newLocation = 26;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
}
void DreamBase::callEdensLift() {
showFirstUse();
- data.byte(kCounttoopen) = 8;
+ _vars._countToOpen = 8;
_getBack = 1;
turnPathOn(2);
}
void DreamBase::callEdensDLift() {
- if (data.byte(kLiftflag) == 1) {
+ if (_vars._liftFlag == 1) {
// Eden's D here
showSecondUse();
putBackObStuff();
} else {
showFirstUse();
- data.byte(kCounttoopen) = 8;
+ _vars._countToOpen = 8;
_getBack = 1;
turnPathOn(2);
}
@@ -521,11 +521,11 @@ void DreamBase::useWall() {
showFirstUse();
if (_mansPath != 3) {
- data.word(kWatchingtime) = 30*2;
- data.word(kReeltowatch) = 2;
- data.word(kEndwatchreel) = 31;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 30*2;
+ _vars._reelToWatch = 2;
+ _vars._endWatchReel = 31;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
turnPathOn(3);
turnPathOn(4);
@@ -540,11 +540,11 @@ void DreamBase::useWall() {
switchRyanOff();
} else {
// Go back over
- data.word(kWatchingtime) = 30 * 2;
- data.word(kReeltowatch) = 34;
- data.word(kEndwatchreel) = 60;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 30 * 2;
+ _vars._reelToWatch = 34;
+ _vars._endWatchReel = 60;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
turnPathOff(3);
turnPathOff(4);
@@ -591,35 +591,35 @@ void DreamBase::useLadderB() {
void DreamBase::slabDoorA() {
showFirstUse();
_getBack = 1;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.word(kReeltowatch) = 13;
- if (data.byte(kDreamnumber) != 3) {
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
+ _vars._reelToWatch = 13;
+ if (_vars._dreamNumber != 3) {
// Wrong
- data.word(kWatchingtime) = 40;
- data.word(kEndwatchreel) = 34;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 40;
+ _vars._endWatchReel = 34;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
} else {
- data.byte(kProgresspoints)++;
- data.word(kWatchingtime) = 60;
- data.word(kEndwatchreel) = 42;
+ _vars._progressPoints++;
+ _vars._watchingTime = 60;
+ _vars._endWatchReel = 42;
_newLocation = 47;
}
}
void DreamBase::slabDoorB() {
- if (data.byte(kDreamnumber) != 1) {
+ if (_vars._dreamNumber != 1) {
// Wrong
showFirstUse();
_getBack = 1;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.word(kReeltowatch) = 44;
- data.word(kWatchingtime) = 40;
- data.word(kEndwatchreel) = 63;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
+ _vars._reelToWatch = 44;
+ _vars._watchingTime = 40;
+ _vars._endWatchReel = 63;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
} else {
if (!isRyanHolding("SHLD")) {
// No crystal
@@ -628,13 +628,13 @@ void DreamBase::slabDoorB() {
} else {
// Got crystal
showFirstUse();
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
_getBack = 1;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.word(kReeltowatch) = 44;
- data.word(kWatchingtime) = 60;
- data.word(kEndwatchreel) = 71;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
+ _vars._reelToWatch = 44;
+ _vars._watchingTime = 60;
+ _vars._endWatchReel = 71;
_newLocation = 47;
}
}
@@ -643,19 +643,19 @@ void DreamBase::slabDoorB() {
void DreamBase::slabDoorC() {
showFirstUse();
_getBack = 1;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.word(kReeltowatch) = 108;
- if (data.byte(kDreamnumber) != 4) {
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
+ _vars._reelToWatch = 108;
+ if (_vars._dreamNumber != 4) {
// Wrong
- data.word(kWatchingtime) = 40;
- data.word(kEndwatchreel) = 127;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 40;
+ _vars._endWatchReel = 127;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
} else {
- data.byte(kProgresspoints)++;
- data.word(kWatchingtime) = 60;
- data.word(kEndwatchreel) = 135;
+ _vars._progressPoints++;
+ _vars._watchingTime = 60;
+ _vars._endWatchReel = 135;
_newLocation = 47;
}
}
@@ -663,19 +663,19 @@ void DreamBase::slabDoorC() {
void DreamBase::slabDoorD() {
showFirstUse();
_getBack = 1;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.word(kReeltowatch) = 75;
- if (data.byte(kDreamnumber) != 0) {
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
+ _vars._reelToWatch = 75;
+ if (_vars._dreamNumber != 0) {
// Wrong
- data.word(kWatchingtime) = 40;
- data.word(kEndwatchreel) = 94;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 40;
+ _vars._endWatchReel = 94;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
} else {
- data.byte(kProgresspoints)++;
- data.word(kWatchingtime) = 60;
- data.word(kEndwatchreel) = 102;
+ _vars._progressPoints++;
+ _vars._watchingTime = 60;
+ _vars._endWatchReel = 102;
_newLocation = 47;
}
}
@@ -683,19 +683,19 @@ void DreamBase::slabDoorD() {
void DreamBase::slabDoorE() {
showFirstUse();
_getBack = 1;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.word(kReeltowatch) = 141;
- if (data.byte(kDreamnumber) != 5) {
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
+ _vars._reelToWatch = 141;
+ if (_vars._dreamNumber != 5) {
// Wrong
- data.word(kWatchingtime) = 40;
- data.word(kEndwatchreel) = 160;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 40;
+ _vars._endWatchReel = 160;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
} else {
- data.byte(kProgresspoints)++;
- data.word(kWatchingtime) = 60;
- data.word(kEndwatchreel) = 168;
+ _vars._progressPoints++;
+ _vars._watchingTime = 60;
+ _vars._endWatchReel = 168;
_newLocation = 47;
}
}
@@ -703,19 +703,19 @@ void DreamBase::slabDoorE() {
void DreamBase::slabDoorF() {
showFirstUse();
_getBack = 1;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.word(kReeltowatch) = 171;
- if (data.byte(kDreamnumber) != 2) {
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
+ _vars._reelToWatch = 171;
+ if (_vars._dreamNumber != 2) {
// Wrong
- data.word(kWatchingtime) = 40;
- data.word(kEndwatchreel) = 189;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 40;
+ _vars._endWatchReel = 189;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
} else {
- data.byte(kProgresspoints)++;
- data.word(kWatchingtime) = 60;
- data.word(kEndwatchreel) = 197;
+ _vars._progressPoints++;
+ _vars._watchingTime = 60;
+ _vars._endWatchReel = 197;
_newLocation = 47;
}
}
@@ -742,15 +742,15 @@ void DreamBase::useChurchGate() {
// Cut gate
showFirstUse();
- data.word(kWatchingtime) = 64 * 2;
- data.word(kReeltowatch) = 4;
- data.word(kEndwatchreel) = 70;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 64 * 2;
+ _vars._reelToWatch = 4;
+ _vars._endWatchReel = 70;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
turnPathOn(3);
- if (data.byte(kAidedead) != 0)
+ if (_vars._aideDead != 0)
turnPathOn(2); // Open church
}
@@ -764,33 +764,33 @@ void DreamBase::useGun() {
} else if (_realLocation == 22) {
// in pool room
showPuzText(34, 300);
- data.byte(kLastweapon) = 1;
- data.byte(kCombatcount) = 39;
+ _vars._lastWeapon = 1;
+ _vars._combatCount = 39;
_getBack = 1;
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
} else if (_realLocation == 25) {
// helicopter
showPuzText(34, 300);
- data.byte(kLastweapon) = 1;
- data.byte(kCombatcount) = 19;
+ _vars._lastWeapon = 1;
+ _vars._combatCount = 19;
_getBack = 1;
- data.byte(kDreamnumber) = 2;
- data.byte(kRoomafterdream) = 38;
- data.byte(kSartaindead) = 1;
- data.byte(kProgresspoints)++;
+ _vars._dreamNumber = 2;
+ _vars._roomAfterDream = 38;
+ _vars._sartainDead = 1;
+ _vars._progressPoints++;
} else if (_realLocation == 27) {
// in rock room
showPuzText(46, 300);
_pointerMode = 2;
- data.byte(kRockstardead) = 1;
- data.byte(kLastweapon) = 1;
- data.byte(kNewsitem) = 1;
+ _vars._rockstarDead = 1;
+ _vars._lastWeapon = 1;
+ _vars._newsItem = 1;
_getBack = 1;
- data.byte(kRoomafterdream) = 32;
- data.byte(kDreamnumber) = 0;
- data.byte(kProgresspoints)++;
+ _vars._roomAfterDream = 32;
+ _vars._dreamNumber = 0;
+ _vars._progressPoints++;
} else if (_realLocation == 8 && _mapX == 22 && _mapY == 40
&& !isSetObOnMap(92) && _mansPath != 9) {
@@ -798,9 +798,9 @@ void DreamBase::useGun() {
_destination = 9;
_finalDest = 9;
autoSetWalk();
- data.byte(kLastweapon) = 1;
+ _vars._lastWeapon = 1;
_getBack = 1;
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
} else if (_realLocation == 6 && _mapX == 11 && _mapY == 20
&& isSetObOnMap(5)) {
@@ -811,14 +811,14 @@ void DreamBase::useGun() {
removeSetObject(5);
placeSetObject(6);
turnAnyPathOn(1, _roomNum - 1);
- data.byte(kLiftflag) = 1;
- data.word(kWatchingtime) = 40*2;
- data.word(kReeltowatch) = 4;
- data.word(kEndwatchreel) = 43;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._liftFlag = 1;
+ _vars._watchingTime = 40*2;
+ _vars._reelToWatch = 4;
+ _vars._endWatchReel = 43;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
} else if (_realLocation == 29) {
// aide
@@ -829,15 +829,15 @@ void DreamBase::useGun() {
_destination = 2;
_finalDest = 2;
autoSetWalk();
- data.word(kWatchingtime) = 164*2;
- data.word(kReeltowatch) = 3;
- data.word(kEndwatchreel) = 164;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.byte(kAidedead) = 1;
- data.byte(kDreamnumber) = 3;
- data.byte(kRoomafterdream) = 33;
- data.byte(kProgresspoints)++;
+ _vars._watchingTime = 164*2;
+ _vars._reelToWatch = 3;
+ _vars._endWatchReel = 164;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
+ _vars._aideDead = 1;
+ _vars._dreamNumber = 3;
+ _vars._roomAfterDream = 33;
+ _vars._progressPoints++;
} else if (_realLocation == 23 && _mapX == 0 && _mapY == 50) {
// with boss
@@ -846,7 +846,7 @@ void DreamBase::useGun() {
_finalDest = 5;
autoSetWalk();
}
- data.byte(kLastweapon) = 1;
+ _vars._lastWeapon = 1;
_getBack = 1;
} else if (_realLocation == 8 && _mapX == 11 && _mapY == 10) {
@@ -856,7 +856,7 @@ void DreamBase::useGun() {
_finalDest = 2;
autoSetWalk();
}
- data.byte(kLastweapon) = 1;
+ _vars._lastWeapon = 1;
_getBack = 1;
} else {
@@ -866,7 +866,7 @@ void DreamBase::useGun() {
}
void DreamBase::useFullCart() {
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
turnAnyPathOn(2, _roomNum + 6);
_mansPath = 4;
_facing = 4;
@@ -875,11 +875,11 @@ void DreamBase::useFullCart() {
findXYFromPath();
_resetManXY = 1;
showFirstUse();
- data.word(kWatchingtime) = 72 * 2;
- data.word(kReeltowatch) = 58;
- data.word(kEndwatchreel) = 142;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 72 * 2;
+ _vars._reelToWatch = 58;
+ _vars._endWatchReel = 142;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
}
@@ -888,13 +888,13 @@ void DreamBase::useClearBox() {
return;
// Open box
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
showFirstUse();
- data.word(kWatchingtime) = 80;
- data.word(kReeltowatch) = 67;
- data.word(kEndwatchreel) = 105;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 80;
+ _vars._reelToWatch = 67;
+ _vars._endWatchReel = 105;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
}
@@ -904,7 +904,7 @@ void DreamBase::openTVDoor() {
// Key on TV
showFirstUse();
- data.byte(kLockstatus) = 0;
+ _vars._lockStatus = 0;
_getBack = 1;
}
@@ -922,7 +922,7 @@ void DreamBase::usePlate() {
placeSetObject(24);
removeSetObject(25);
placeFreeObject(0);
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
_getBack = 1;
} else if (compare(_withObject, _withType, "KNFE")) {
// Tried knife
@@ -946,15 +946,15 @@ void DreamBase::usePlinth() {
showFirstUse();
putBackObStuff();
} else {
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
showSecondUse();
- data.word(kWatchingtime) = 220;
- data.word(kReeltowatch) = 0;
- data.word(kEndwatchreel) = 104;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 220;
+ _vars._reelToWatch = 0;
+ _vars._endWatchReel = 104;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
- _newLocation = data.byte(kRoomafterdream);
+ _newLocation = _vars._roomAfterDream;
}
}
@@ -964,12 +964,12 @@ void DreamBase::useElvDoor() {
// Axe on door
showPuzText(15, 300);
- data.byte(kProgresspoints)++;
- data.word(kWatchingtime) = 46 * 2;
- data.word(kReeltowatch) = 31;
- data.word(kEndwatchreel) = 77;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._progressPoints++;
+ _vars._watchingTime = 46 * 2;
+ _vars._reelToWatch = 31;
+ _vars._endWatchReel = 77;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
}
@@ -997,19 +997,19 @@ void DreamBase::useWinch() {
return;
}
- data.word(kWatchingtime) = 217 * 2;
- data.word(kReeltowatch) = 0;
- data.word(kEndwatchreel) = 217;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 217 * 2;
+ _vars._reelToWatch = 0;
+ _vars._endWatchReel = 217;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_destPos = 1;
_newLocation = 45;
- data.byte(kDreamnumber) = 1;
- data.byte(kRoomafterdream) = 44;
- data.byte(kGeneraldead) = 1;
- data.byte(kNewsitem) = 2;
+ _vars._dreamNumber = 1;
+ _vars._roomAfterDream = 44;
+ _vars._generalDead = 1;
+ _vars._newsItem = 2;
_getBack = 1;
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
}
void DreamBase::useCart() {
@@ -1020,7 +1020,7 @@ void DreamBase::useCart() {
exObject->mapad[0] = 0;
removeSetObject(_command);
placeSetObject(_command + 1);
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
playChannel1(17);
showFirstUse();
_getBack = 1;
@@ -1032,7 +1032,7 @@ void DreamBase::useTrainer() {
if (object->mapad[0] != 4) {
notHeldError();
} else {
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
makeWorn(object);
showSecondUse();
putBackObStuff();
@@ -1056,7 +1056,7 @@ void DreamBase::useHole() {
removeSetObject(86);
DynObject *exObject = getExAd(_withObject);
exObject->mapad[0] = 255;
- data.byte(kCanmovealtar) = 1;
+ _vars._canMoveAltar = 1;
_getBack = 1;
}
@@ -1066,7 +1066,7 @@ void DreamBase::openHotelDoor() {
playChannel1(16);
showFirstUse();
- data.byte(kLockstatus) = 0;
+ _vars._lockStatus = 0;
_getBack = 1;
}
@@ -1091,14 +1091,14 @@ void DreamBase::usePoolReader() {
if (defaultUseHandler("MEMB"))
return;
- if (data.byte(kTalkedtoattendant) != 1) {
+ if (_vars._talkedToAttendant != 1) {
// Can't open pool
showSecondUse();
putBackObStuff();
} else {
playChannel1(17);
showFirstUse();
- data.byte(kCounttoopen) = 6;
+ _vars._countToOpen = 6;
_getBack = 1;
}
}
@@ -1107,11 +1107,11 @@ void DreamBase::useCardReader1() {
if (defaultUseHandler("CSHR"))
return;
- if (data.byte(kTalkedtosparky) == 0) {
+ if (_vars._talkedToSparky == 0) {
// Not yet
showFirstUse();
putBackObStuff();
- } else if (data.word(kCard1money) != 0) {
+ } else if (_vars._card1Money != 0) {
// No cash
showPuzText(17, 300);
putBackObStuff();
@@ -1119,8 +1119,8 @@ void DreamBase::useCardReader1() {
// Get cash
playChannel1(16);
showPuzText(18, 300);
- data.byte(kProgresspoints)++;
- data.word(kCard1money) = 12432;
+ _vars._progressPoints++;
+ _vars._card1Money = 12432;
_getBack = 1;
}
}
@@ -1129,15 +1129,15 @@ void DreamBase::useCardReader2() {
if (defaultUseHandler("CSHR"))
return;
- if (data.byte(kTalkedtoboss) == 0) {
+ if (_vars._talkedToBoss == 0) {
// Haven't talked to boss
showFirstUse();
putBackObStuff();
- } else if (data.byte(kCard1money) == 0) {
+ } else if (_vars._card1Money == 0) {
// No cash
showPuzText(20, 300);
putBackObStuff();
- } else if (data.byte(kGunpassflag) == 2) {
+ } else if (_vars._gunPassFlag == 2) {
// Already got new
showPuzText(22, 300);
putBackObStuff();
@@ -1145,9 +1145,9 @@ void DreamBase::useCardReader2() {
playChannel1(18);
showPuzText(19, 300);
placeSetObject(94);
- data.byte(kGunpassflag) = 1;
- data.word(kCard1money) -= 2000;
- data.byte(kProgresspoints)++;
+ _vars._gunPassFlag = 1;
+ _vars._card1Money -= 2000;
+ _vars._progressPoints++;
_getBack = 1;
}
}
@@ -1156,20 +1156,20 @@ void DreamBase::useCardReader3() {
if (defaultUseHandler("CSHR"))
return;
- if (data.byte(kTalkedtorecep) == 0) {
+ if (_vars._talkedToRecep == 0) {
// Haven't talked to receptionist
showFirstUse();
putBackObStuff();
- } else if (data.byte(kCardpassflag) != 0) {
+ } else if (_vars._cardPassFlag != 0) {
// Already used it
showPuzText(26, 300);
putBackObStuff();
} else {
playChannel1(16);
showPuzText(25, 300);
- data.byte(kProgresspoints)++;
- data.word(kCard1money) -= 8300;
- data.byte(kCardpassflag) = 1;
+ _vars._progressPoints++;
+ _vars._card1Money -= 8300;
+ _vars._cardPassFlag = 1;
_getBack = 1;
}
}
@@ -1201,7 +1201,7 @@ void DreamBase::useWire() {
removeSetObject(51);
placeSetObject(52);
showPuzText(11, 300);
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
_getBack = 1;
return;
}
@@ -1217,13 +1217,13 @@ void DreamBase::useWire() {
}
void DreamBase::openTomb() {
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
showFirstUse();
- data.word(kWatchingtime) = 35 * 2;
- data.word(kReeltowatch) = 1;
- data.word(kEndwatchreel) = 33;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 35 * 2;
+ _vars._reelToWatch = 1;
+ _vars._endWatchReel = 33;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
}
@@ -1308,7 +1308,7 @@ void DreamBase::useControl() {
if (compare(_withObject, _withType, "KEYA")) { // Right key
playChannel1(16);
- if (data.byte(kLocation) == 21) { // Going down
+ if (_vars._location == 21) { // Going down
showPuzText(3, 300);
_newLocation = 30;
} else {
@@ -1316,9 +1316,9 @@ void DreamBase::useControl() {
_newLocation = 21;
}
- data.byte(kCounttoclose) = 8;
- data.byte(kCounttoopen) = 0;
- data.word(kWatchingtime) = 80;
+ _vars._countToClose = 8;
+ _vars._countToOpen = 0;
+ _vars._watchingTime = 80;
_getBack = 1;
return;
}
@@ -1334,12 +1334,12 @@ void DreamBase::useControl() {
removeSetObject(17);
playChannel1(14);
showPuzText(10, 300);
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
_getBack = 1;
} else if (compare(_withObject, _withType, "AXED")) {
// Axe on controls
showPuzText(16, 300);
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
putBackObStuff();
} else {
// Balls
@@ -1373,14 +1373,14 @@ void DreamBase::useSlab() {
if (_command + 1 == 54) {
// Last slab
turnPathOn(0);
- data.word(kWatchingtime) = 22;
- data.word(kReeltowatch) = 35;
- data.word(kEndwatchreel) = 48;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 22;
+ _vars._reelToWatch = 35;
+ _vars._endWatchReel = 48;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
}
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
showFirstUse();
_getBack = 1;
}
@@ -1416,15 +1416,15 @@ void DreamBase::useOpenBox() {
if (compare(_withObject, _withType, "CUPF")) {
// Destroy open box
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
showPuzText(37, 300);
DynObject *exObject = getExAd(_withObject);
exObject->id[3] = 'E'-'A'; // CUPF (full cup) -> CUPE (empty cup)
- data.word(kWatchingtime) = 140;
- data.word(kReeltowatch) = 105;
- data.word(kEndwatchreel) = 181;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 140;
+ _vars._reelToWatch = 105;
+ _vars._endWatchReel = 181;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
turnPathOn(4);
_getBack = 1;
return;
@@ -1477,19 +1477,19 @@ void DreamBase::useAxe() {
if (_mapY == 10) {
// Axe on door
showPuzText(15, 300);
- data.byte(kProgresspoints)++;
- data.word(kWatchingtime) = 46*2;
- data.word(kReeltowatch) = 31;
- data.word(kEndwatchreel) = 77;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._progressPoints++;
+ _vars._watchingTime = 46*2;
+ _vars._reelToWatch = 31;
+ _vars._endWatchReel = 77;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
return;
}
showSecondUse();
- data.byte(kProgresspoints)++;
- data.byte(kLastweapon) = 2;
+ _vars._progressPoints++;
+ _vars._lastWeapon = 2;
_getBack = 1;
removeObFromInv();
}
@@ -1516,15 +1516,15 @@ void DreamBase::useAltar() {
return;
}
- if (data.byte(kCanmovealtar) == 1) {
+ if (_vars._canMoveAltar == 1) {
// Move altar
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
showSecondUse();
- data.word(kWatchingtime) = 160;
- data.word(kReeltowatch) = 81;
- data.word(kEndwatchreel) = 174;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 160;
+ _vars._reelToWatch = 81;
+ _vars._endWatchReel = 174;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
DreamBase::setupTimedUse(47, 32, 98, 52, 76);
_getBack = 1;
} else {
@@ -1583,10 +1583,10 @@ void DreamBase::useCashCard() {
y = 98;
printDirect(&obText, 36, &y, 36, 36 & 1);
char amountStr[10];
- sprintf(amountStr, "%04d", data.word(kCard1money) / 10);
+ sprintf(amountStr, "%04d", _vars._card1Money / 10);
_charShift = 91 * 2 + 75;
printDirect((const uint8 *)amountStr, 160, 155, 240, 240 & 1);
- sprintf(amountStr, "%02d", (data.word(kCard1money) % 10) * 10);
+ sprintf(amountStr, "%02d", (_vars._card1Money % 10) * 10);
_charShift = 91 * 2 + 85;
printDirect((const uint8 *)amountStr, 187, 155, 240, 240 & 1);
_charShift = 0;
@@ -1601,7 +1601,7 @@ void DreamBase::useStereo() {
// Handles the stereo in Ryan's apartment (accessible from the remote on
// the couch)
- if (data.byte(kLocation) != 0) {
+ if (_vars._location != 0) {
showPuzText(4, 400);
putBackObStuff();
} else if (_mapX != 11) {
@@ -1656,13 +1656,13 @@ void DreamBase::useButtonA() {
turnAnyPathOn(0, _roomNum - 1);
removeSetObject(9);
placeSetObject(95);
- data.word(kWatchingtime) = 15 * 2;
- data.word(kReeltowatch) = 71;
- data.word(kEndwatchreel) = 85;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
+ _vars._watchingTime = 15 * 2;
+ _vars._reelToWatch = 71;
+ _vars._endWatchReel = 85;
+ _vars._watchSpeed = 1;
+ _vars._speedCount = 1;
_getBack = 1;
- data.byte(kProgresspoints)++;
+ _vars._progressPoints++;
} else {
// Done this bit
showSecondUse();
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp
index 13defb46a2..c1a860e184 100644
--- a/engines/dreamweb/vgagrafx.cpp
+++ b/engines/dreamweb/vgagrafx.cpp
@@ -123,7 +123,7 @@ void DreamBase::frameOutFx(uint8 *dst, const uint8 *src, uint16 pitch, uint16 wi
}
void DreamBase::doShake() {
- uint8 &counter = data.byte(kShakecounter);
+ uint8 &counter = _vars._shakeCounter;
if (counter == 48)
return;
@@ -336,7 +336,7 @@ void DreamBase::clearWork() {
}
void DreamBase::dumpZoom() {
- if (data.byte(kZoomon) == 1)
+ if (_vars._zoomOn == 1)
multiDump(kZoomx + 5, kZoomy + 4, 46, 40);
}
@@ -359,15 +359,15 @@ void DreamBase::putUnderZoom() {
}
void DreamBase::zoomIcon() {
- if (data.byte(kZoomon) == 0)
+ if (_vars._zoomOn == 0)
return;
showFrame(_icons1, kZoomx, kZoomy-1, 8, 0);
}
void DreamBase::zoom() {
- if (data.word(kWatchingtime) != 0)
+ if (_vars._watchingTime != 0)
return;
- if (data.byte(kZoomon) != 1)
+ if (_vars._zoomOn != 1)
return;
if (_commandType >= 199) {
putUnderZoom();
@@ -466,11 +466,11 @@ void DreamBase::transferFrame(uint8 from, uint8 to, uint8 offset) {
uint16 byteCount = freeFrame.width * freeFrame.height;
const uint8 *src = _freeFrames.getFrameData(3*from + offset);
- uint8 *dst = _exFrames._data + data.word(kExframepos);
+ uint8 *dst = _exFrames._data + _vars._exFramePos;
memcpy(dst, src, byteCount);
- exFrame.setPtr(data.word(kExframepos));
- data.word(kExframepos) += byteCount;
+ exFrame.setPtr(_vars._exFramePos);
+ _vars._exFramePos += byteCount;
}
} // End of namespace DreamGen