aboutsummaryrefslogtreecommitdiff
path: root/engines/lab
diff options
context:
space:
mode:
authorEugene Sandulenko2014-12-25 12:36:47 +0100
committerEugene Sandulenko2015-12-15 00:05:02 +0100
commit471dbaa758f0ebea9f3d76caa7fd769c6809d395 (patch)
tree9f786ded0254e4efddc387e48dfc420645b414d0 /engines/lab
parent6ab5edf7629ae2166b0fdc9773005d240ade5d3e (diff)
downloadscummvm-rg350-471dbaa758f0ebea9f3d76caa7fd769c6809d395.tar.gz
scummvm-rg350-471dbaa758f0ebea9f3d76caa7fd769c6809d395.tar.bz2
scummvm-rg350-471dbaa758f0ebea9f3d76caa7fd769c6809d395.zip
LAB: Started objectifying LargeSets
Diffstat (limited to 'engines/lab')
-rw-r--r--engines/lab/engine.cpp60
-rw-r--r--engines/lab/lab.h3
-rw-r--r--engines/lab/labfun.h25
-rw-r--r--engines/lab/labsets.cpp86
-rw-r--r--engines/lab/labtext.cpp2
-rw-r--r--engines/lab/machine.cpp21
-rw-r--r--engines/lab/map.cpp10
-rw-r--r--engines/lab/modernsavegame.cpp3
-rw-r--r--engines/lab/parsefun.h3
-rw-r--r--engines/lab/processroom.cpp18
-rw-r--r--engines/lab/readparse.cpp39
-rw-r--r--engines/lab/special.cpp24
12 files changed, 102 insertions, 192 deletions
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index 83bf3964a3..dec1806db5 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -53,7 +53,6 @@ extern bool DoBlack, waiteffect, EffectPlaying, stopsound, DoNotDrawMessage, IsH
extern RoomData *Rooms;
extern InventoryData *Inventory;
extern uint16 NumInv, RoomNum, ManyRooms, HighestCondition, Direction;
-extern LargeSet Conditions, RoomsFound;
CloseDataPtr CPtr;
#if !defined(DOSCODE)
@@ -223,8 +222,8 @@ static void drawRoomMessage(uint16 CurInv, CloseDataPtr cptr) {
}
if (Alternate) {
- if ((CurInv <= NumInv) && In(Conditions, CurInv) && Inventory[CurInv].BInvName) {
- if ((CurInv == LAMPNUM) && In(Conditions, LAMPON)) /* LAB: Labyrith specific */
+ if ((CurInv <= NumInv) && g_engine->_conditions->in(CurInv) && Inventory[CurInv].BInvName) {
+ if ((CurInv == LAMPNUM) && g_engine->_conditions->in(LAMPON)) /* LAB: Labyrith specific */
drawMessage(LAMPONMSG);
else if (Inventory[CurInv].Many > 1) {
ManyPtr = numtostr(ManyText, Inventory[CurInv].Many);
@@ -518,10 +517,10 @@ static const char *getInvName(uint16 CurInv) {
if (MainDisplay)
return Inventory[CurInv].BInvName;
- if ((CurInv == LAMPNUM) && In(Conditions, LAMPON))
+ if ((CurInv == LAMPNUM) && g_engine->_conditions->in(LAMPON))
return "P:Mines/120";
- else if ((CurInv == BELTNUM) && In(Conditions, BELTGLOW))
+ else if ((CurInv == BELTNUM) && g_engine->_conditions->in(BELTGLOW))
return "P:Future/BeltGlow";
else if (CurInv == WESTPAPERNUM) {
@@ -617,12 +616,12 @@ static bool doUse(uint16 CurInv) {
else if (CurInv == LAMPNUM) { /* LAB: Labyrinth specific */
interfaceOff();
- if (In(Conditions, LAMPON)) {
+ if (g_engine->_conditions->in(LAMPON)) {
drawMessage(TURNLAMPOFF);
- exclElement(Conditions, LAMPON);
+ g_engine->_conditions->exclElement(LAMPON);
} else {
drawMessage(TURNLAMPON);
- inclElement(Conditions, LAMPON);
+ g_engine->_conditions->inclElement(LAMPON);
}
DoBlack = false;
@@ -635,25 +634,25 @@ static bool doUse(uint16 CurInv) {
}
else if (CurInv == BELTNUM) { /* LAB: Labyrinth specific */
- if (!In(Conditions, BELTGLOW))
- inclElement(Conditions, BELTGLOW);
+ if (!g_engine->_conditions->in(BELTGLOW))
+ g_engine->_conditions->inclElement(BELTGLOW);
DoBlack = false;
Test = getInvName(CurInv);
}
else if (CurInv == WHISKEYNUM) { /* LAB: Labyrinth specific */
- inclElement(Conditions, USEDHELMET);
+ g_engine->_conditions->inclElement(USEDHELMET);
drawMessage(USEWHISKEY);
}
else if (CurInv == PITHHELMETNUM) { /* LAB: Labyrinth specific */
- inclElement(Conditions, USEDHELMET);
+ g_engine->_conditions->inclElement(USEDHELMET);
drawMessage(USEPITH);
}
else if (CurInv == HELMETNUM) { /* LAB: Labyrinth specific */
- inclElement(Conditions, USEDHELMET);
+ g_engine->_conditions->inclElement(USEDHELMET);
drawMessage(USEHELMET);
}
@@ -678,7 +677,7 @@ static void decIncInv(uint16 *CurInv, bool dec) {
(*CurInv)++;
while (*CurInv && (*CurInv <= NumInv)) {
- if (In(Conditions, *CurInv) && Inventory[*CurInv].BInvName) {
+ if (g_engine->_conditions->in(*CurInv) && Inventory[*CurInv].BInvName) {
Test = getInvName(*CurInv);
break;
}
@@ -696,7 +695,7 @@ static void decIncInv(uint16 *CurInv, bool dec) {
*CurInv = 1;
while (*CurInv && (*CurInv <= NumInv)) {
- if (In(Conditions, *CurInv) && Inventory[*CurInv].BInvName) {
+ if (g_engine->_conditions->in(*CurInv) && Inventory[*CurInv].BInvName) {
Test = getInvName(*CurInv);
break;
}
@@ -749,13 +748,13 @@ static void process(void) {
readRoomData("LAB:Doors");
readInventory("LAB:Inventor");
- if (!createSet(&Conditions, HighestCondition + 1))
+ if (!(g_engine->_conditions = new LargeSet(HighestCondition + 1)))
return;
- if (!createSet(&RoomsFound, ManyRooms + 1))
+ if (!(g_engine->_roomsFound = new LargeSet(ManyRooms + 1)))
return;
- readInitialConditions(Conditions, "LAB:Conditio");
+ g_engine->_conditions->readInitialConditions("LAB:Conditio");
LongWinInFront = false;
drawPanel();
@@ -789,7 +788,7 @@ static void process(void) {
Test = getPictName(&CPtr);
if (noupdatediff) {
- inclElement(RoomsFound, RoomNum); /* Potentially entered another room */
+ g_engine->_roomsFound->inclElement(RoomNum); /* Potentially entered another room */
ForceDraw = (strcmp(Test, CurFileName) != 0) || ForceDraw;
noupdatediff = false;
@@ -798,7 +797,7 @@ static void process(void) {
else if (strcmp(Test, CurFileName) != 0) {
interfaceOff();
- inclElement(RoomsFound, RoomNum); /* Potentially entered another room */
+ g_engine->_roomsFound->inclElement(RoomNum); /* Potentially entered another room */
CurFileName = Test;
if (CPtr) {
@@ -1090,7 +1089,7 @@ from_crumbs:
MainDisplay = false;
- if (LastInv && In(Conditions, LastInv)) {
+ if (LastInv && g_engine->_conditions->in(LastInv)) {
CurInv = LastInv;
Test = getInvName(CurInv);
} else
@@ -1172,7 +1171,7 @@ from_crumbs:
if (OldRoomNum != RoomNum) {
drawMessage(GOFORWARDDIR);
- inclElement(RoomsFound, RoomNum); /* Potentially entered a new room */
+ g_engine->_roomsFound->inclElement(RoomNum); /* Potentially entered a new room */
CurFileName = " ";
ForceDraw = true;
} else {
@@ -1316,11 +1315,11 @@ from_crumbs:
if ((CurInv == 0) || (CurInv > NumInv)) {
CurInv = 1;
- while ((CurInv <= NumInv) && (!In(Conditions, CurInv)))
+ while ((CurInv <= NumInv) && (!g_engine->_conditions->in(CurInv)))
CurInv++;
}
- if ((CurInv <= NumInv) && In(Conditions, CurInv) &&
+ if ((CurInv <= NumInv) && g_engine->_conditions->in(CurInv) &&
Inventory[CurInv].BInvName)
Test = getInvName(CurInv);
@@ -1454,11 +1453,11 @@ from_crumbs:
}
else if ((ActionMode == 5) &&
- In(Conditions, CurInv)) { /* Use an item on something else */
+ g_engine->_conditions->in(CurInv)) { /* Use an item on something else */
if (doOperateRule(MouseX, MouseY, CurInv, &CPtr)) {
CurFileName = NewFileName;
- if (!In(Conditions, CurInv))
+ if (!g_engine->_conditions->in(CurInv))
decIncInv(&CurInv, false);
} else if (MouseY < (VGAScaleY(149) + SVGACord(2)))
drawMessage(NOTHING);
@@ -1510,7 +1509,7 @@ from_crumbs:
interfaceOn(); /* Sets the correct gadget list */
if (Alternate) {
- if (LastInv && In(Conditions, LastInv))
+ if (LastInv && g_engine->_conditions->in(LastInv))
CurInv = LastInv;
else
decIncInv(&CurInv, false);
@@ -1526,11 +1525,8 @@ from_crumbs:
}
}
- if (Conditions)
- deleteSet(Conditions);
-
- if (RoomsFound)
- deleteSet(RoomsFound);
+ delete g_engine->_conditions;
+ delete g_engine->_roomsFound;
if (Rooms)
free(Rooms);
diff --git a/engines/lab/lab.h b/engines/lab/lab.h
index 3b1e411e7c..42429553f8 100644
--- a/engines/lab/lab.h
+++ b/engines/lab/lab.h
@@ -34,6 +34,7 @@
#include "common/array.h"
#include "engines/engine.h"
+#include "lab/labfun.h"
namespace Lab {
@@ -45,6 +46,8 @@ public:
virtual Common::Error run();
bool hasFeature(EngineFeature f) const;
+
+ LargeSet *_conditions, *_roomsFound;
};
} // End of namespace Lab
diff --git a/engines/lab/labfun.h b/engines/lab/labfun.h
index 995177b654..93d5166480 100644
--- a/engines/lab/labfun.h
+++ b/engines/lab/labfun.h
@@ -275,26 +275,23 @@ extern Music *g_music;
/*----- From LabSets.c ------*/
/*---------------------------*/
-typedef struct {
- uint16 lastElement, array[1];
-} LargeSetRecord;
-
-typedef LargeSetRecord *LargeSet;
-
-
-
-bool createSet(LargeSet *set, uint16 last);
-
-void deleteSet(LargeSet set);
+class LargeSet {
+public:
+ LargeSet(uint16 last);
-bool In(LargeSet set, uint16 element);
+ ~LargeSet();
-void inclElement(LargeSet set, uint16 element);
+ bool in(set, uint16 element);
-void exclElement(LargeSet set, uint16 element);
+ void inclElement(uint16 element);
+ void exclElement(uint16 element);
+ bool readInitialConditions(const char *fileName);
+private:
+ uint16 *_array;
+};
/*---------------------------*/
/*----- From Machine.c ------*/
diff --git a/engines/lab/labsets.cpp b/engines/lab/labsets.cpp
index 86fd6fd60b..cee9cda56b 100644
--- a/engines/lab/labsets.cpp
+++ b/engines/lab/labsets.cpp
@@ -33,65 +33,57 @@
namespace Lab {
-const uint32 LargeSetSIZE = sizeof(LargeSetRecord) - 2;
-
-
-
-/*****************************************************************************/
-/* Creates a large set. */
-/*****************************************************************************/
-bool createSet(LargeSet *set, uint16 last) {
+LabSet::LabSet(uint16 last) {
last = (((last + 15) >> 4) << 4);
- if ((*set = (LargeSet)calloc((last >> 3) + LargeSetSIZE, 1))) {
- (*set)->lastElement = last;
- return true;
- } else /* Not Enough Memory! */
- return false;
-
+ _array = (uint16 *)calloc(last >> 3);
}
-
-
-
-/*****************************************************************************/
-/* Deletes a large set. */
-/*****************************************************************************/
-void deleteSet(LargeSet set) {
- if (set)
- free(set);
+LargeSet::~LargeSet() {
+ free(_array);
}
-
-#define INCL(BITSET,BIT) ((BITSET) |= (BIT))
-
-#define EXCL(BITSET,BIT) ((BITSET) &= (~(BIT)))
-
-
-
-/*****************************************************************************/
-/* Tests if an element is in the set. */
-/*****************************************************************************/
-bool In(LargeSet set, uint16 element) {
- return ((1 << ((element - 1) % 16)) & (set->array[(element - 1) >> 4])) > 0;
+bool LargeSet::in(uint16 element) {
+ return ((1 << ((element - 1) % 16)) & (_array[(element - 1) >> 4])) > 0;
}
-
-
-/*****************************************************************************/
-/* Sets an element in the Large set. */
-/*****************************************************************************/
-void inclElement(LargeSet set, uint16 element) {
- INCL((set->array[(element - 1) >> 4]), (1 << ((element - 1) % 16)));
+void LargeSet::inclElement(uint16 element) {
+ _array[(element - 1) >> 4]) |= 1 << ((element - 1) % 16);
}
+void LargeSet::exclElement(uint16 element) {
+ _array[(element - 1) >> 4] &= ~(1 << ((element - 1) % 16));
+}
+bool LargeSet::readInitialConditions(const char *fileName) {
+ byte **file;
+ uint16 many, set;
+ char temp[5];
+
+ if ((file = g_music->newOpen(fileName)) != NULL) {
+ readBlock(temp, 4L, file);
+ temp[4] = '\0';
+
+ if (strcmp(temp, "CON0") != 0)
+ return false;
+
+ readBlock(&many, 2L, file);
+#if !defined(DOSCODE)
+ swapUShortPtr(&many, 1);
+#endif
+
+ for (int counter = 0; counter < many; counter++) {
+ readBlock(&set, 2L, file);
+#if !defined(DOSCODE)
+ swapUShortPtr(&set, 1);
+#endif
+ inclElement(set);
+ }
+ } else
+ return false;
-/*****************************************************************************/
-/* Removes an element in the Large set. */
-/*****************************************************************************/
-void exclElement(LargeSet set, uint16 element) {
- EXCL((set->array[(element - 1) >> 4]), (1 << ((element - 1) % 16)));
+ return true;
}
+
} // End of namespace Lab
diff --git a/engines/lab/labtext.cpp b/engines/lab/labtext.cpp
index 7acb014389..673f8d06ac 100644
--- a/engines/lab/labtext.cpp
+++ b/engines/lab/labtext.cpp
@@ -159,7 +159,7 @@ void decrypt(byte *text) {
return;
while (*text != '\0') {
- (*text) -= (byte) 95;
+ (*text) -= (byte)95;
text++;
}
}
diff --git a/engines/lab/machine.cpp b/engines/lab/machine.cpp
index da8744a9f5..c1bdd003b8 100644
--- a/engines/lab/machine.cpp
+++ b/engines/lab/machine.cpp
@@ -147,27 +147,6 @@ uint16 VGAUnScaleY(uint16 y) {
}
-
-
-#if defined(WIN32)
-/*****************************************************************************/
-/* Replaces all occurences of a character in a string with a new one. */
-/*****************************************************************************/
-static void strrplc(char *text, char orig, char replace) {
- uint16 counter;
-
- counter = 0;
-
- while (text[counter]) {
- if (text[counter] == orig)
- text[counter] = replace;
-
- counter++;
- }
-}
-#endif
-
-
/*****************************************************************************/
/* Checks to see if all the characters in the second string are at the start */
/* of the first. */
diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp
index c56f699778..d3380b7ecb 100644
--- a/engines/lab/map.cpp
+++ b/engines/lab/map.cpp
@@ -528,12 +528,12 @@ static void drawRoom(uint16 CurRoom, bool drawx) {
/*****************************************************************************/
/* Checks if a floor has been visitted. */
/*****************************************************************************/
-static bool onFloor(LargeSet RoomsFound, uint16 Floor) {
+static bool onFloor(uint16 Floor) {
uint16 drawroom;
for (drawroom = 1; drawroom <= MaxRooms; drawroom++) {
if ((Maps[drawroom].PageNumber == Floor)
- && In(RoomsFound, drawroom)
+ && g_engine->_roomsFound->in(drawroom)
&& Maps[drawroom].x) {
return true;
}
@@ -623,7 +623,7 @@ static void drawMap(LargeSet RoomsFound, uint16 CurRoom, uint16 CurMsg, uint16 F
for (drawroom = 1; drawroom <= MaxRooms; drawroom++) {
if ((Maps[drawroom].PageNumber == Floor)
- && In(RoomsFound, drawroom)
+ && g_engine->_roomsFound->in(drawroom)
&& Maps[drawroom].x) {
drawRoom(drawroom, (bool)(drawroom == CurRoom));
g_music->checkMusic();
@@ -631,7 +631,7 @@ static void drawMap(LargeSet RoomsFound, uint16 CurRoom, uint16 CurMsg, uint16 F
}
if ((Maps[CurRoom].PageNumber == Floor) /* Makes sure the X is drawn in corridors */
- && In(RoomsFound, CurRoom) /* NOTE: this here on purpose just in case there's some wierd condition, like the surreal maze where there are no rooms */
+ && g_engine->_roomsFound->in(CurRoom) /* NOTE: this here on purpose just in case there's some wierd condition, like the surreal maze where there are no rooms */
&& Maps[CurRoom].x)
drawRoom(CurRoom, true);
@@ -858,7 +858,7 @@ void processMap(uint16 CurRoom, LargeSet RoomsFound) {
roomCords(drawroom, &x1, &y1, &x2, &y2);
if ((Maps[drawroom].PageNumber == CurFloor)
- && In(RoomsFound, drawroom)
+ && g_engine->_roomsFound->in(drawroom)
&& (MouseX >= x1) && (MouseX <= x2)
&& (MouseY >= y1) && (MouseY <= y2)) {
CurMsg = drawroom;
diff --git a/engines/lab/modernsavegame.cpp b/engines/lab/modernsavegame.cpp
index 2ea5c22911..2be33b8aa5 100644
--- a/engines/lab/modernsavegame.cpp
+++ b/engines/lab/modernsavegame.cpp
@@ -39,9 +39,6 @@ byte g_SaveGameImage[SAVED_IMAGE_SIZE]; // 640 x 358
char g_SaveGamePath[512];
char g_PathSeperator[4];
-extern LargeSet Conditions,
- RoomsFound;
-
#define SAVEVERSION "LBS3"
int getSaveGameList(struct SaveGameInfo *info, int maxNum) {
diff --git a/engines/lab/parsefun.h b/engines/lab/parsefun.h
index 4e1dc5de7e..e6794ee8eb 100644
--- a/engines/lab/parsefun.h
+++ b/engines/lab/parsefun.h
@@ -60,9 +60,6 @@ char *numtostr(char *text, uint16 Num);
bool readViews(uint16 RoomNum, const char *Path);
-bool readInitialConditions(LargeSet Conditions, const char *fileName);
-
-
/* From ProcessRoom.c */
diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp
index d9f40b4e1d..19e113391c 100644
--- a/engines/lab/processroom.cpp
+++ b/engines/lab/processroom.cpp
@@ -51,8 +51,6 @@ extern int g_IsRegistered;
RoomData *Rooms;
InventoryData *Inventory;
uint16 NumInv, RoomNum, ManyRooms, HighestCondition, Direction;
-LargeSet Conditions, RoomsFound;
-
extern char *FACINGNORTH, *FACINGEAST, *FACINGSOUTH, *FACINGWEST;
extern bool LongWinInFront;
@@ -105,10 +103,10 @@ static bool checkConditions(int16 *Condition) {
return true;
Counter = 1;
- res = In(Conditions, Condition[0]);
+ res = g_engine->_conditions->in(Condition[0]);
while (Condition[Counter] && res) {
- res = In(Conditions, Condition[Counter]);
+ res = g_engine->_conditions->in(Condition[Counter]);
Counter++;
}
@@ -415,7 +413,7 @@ bool takeItem(uint16 x, uint16 y, CloseDataPtr *cptr) {
VPtr = getViewData(RoomNum, Direction);
LCPtr = VPtr->closeUps;
} else if ((*cptr)->CloseUpType < 0) {
- inclElement(Conditions, abs((*cptr)->CloseUpType));
+ g_engine->_conditions->inclElement(abs((*cptr)->CloseUpType));
return true;
} else
LCPtr = (*cptr)->SubCloseUps;
@@ -425,7 +423,7 @@ bool takeItem(uint16 x, uint16 y, CloseDataPtr *cptr) {
if ((x >= scaleX(LCPtr->x1)) && (y >= scaleY(LCPtr->y1)) &&
(x <= scaleX(LCPtr->x2)) && (y <= scaleY(LCPtr->y2)) &&
(LCPtr->CloseUpType < 0)) {
- inclElement(Conditions, abs(LCPtr->CloseUpType));
+ g_engine->_conditions->inclElement(abs(LCPtr->CloseUpType));
return true;
}
@@ -513,11 +511,11 @@ static void doActions(ActionPtr APtr, CloseDataPtr *LCPtr) {
break;
case SETELEMENT:
- inclElement(Conditions, APtr->Param1);
+ g_engine->_conditions->inclElement(APtr->Param1);
break;
case UNSETELEMENT:
- exclElement(Conditions, APtr->Param1);
+ g_engine->_conditions->exclElement(APtr->Param1);
break;
case SHOWMESSAGE:
@@ -612,13 +610,13 @@ static void doActions(ActionPtr APtr, CloseDataPtr *LCPtr) {
(Inventory[APtr->Param1].Many)--;
if (Inventory[APtr->Param1].Many == 0)
- exclElement(Conditions, APtr->Param1);
+ g_engine->_conditions->exclElement(APtr->Param1);
break;
case ADDINV:
(Inventory[APtr->Param1].Many) += APtr->Param2;
- inclElement(Conditions, APtr->Param1);
+ g_engine->_conditions->inclElement(APtr->Param1);
break;
case SHOWDIR:
diff --git a/engines/lab/readparse.cpp b/engines/lab/readparse.cpp
index 7734a232bb..075c1fdb99 100644
--- a/engines/lab/readparse.cpp
+++ b/engines/lab/readparse.cpp
@@ -46,9 +46,6 @@ static bool UseMemory = false;
extern RoomData *Rooms;
extern InventoryData *Inventory;
extern uint16 NumInv, ManyRooms, HighestCondition, Direction;
-extern LargeSet Conditions, RoomsFound;
-
-
static uint16 allocroom;
@@ -474,40 +471,4 @@ bool readViews(uint16 RoomNum, const char *Path) {
return false;
}
-
-
-
-/*****************************************************************************/
-/* Reads the initial conditions and sets the LargeSet accordingly. */
-/*****************************************************************************/
-bool readInitialConditions(LargeSet conditions, const char *fileName) {
- byte **file;
- uint16 many, set;
- char temp[5];
-
- if ((file = g_music->newOpen(fileName)) != NULL) {
- readBlock(temp, 4L, file);
- temp[4] = '\0';
-
- if (strcmp(temp, "CON0") != 0)
- return false;
-
- readBlock(&many, 2L, file);
-#if !defined(DOSCODE)
- swapUShortPtr(&many, 1);
-#endif
-
- for (int counter = 0; counter < many; counter++) {
- readBlock(&set, 2L, file);
-#if !defined(DOSCODE)
- swapUShortPtr(&set, 1);
-#endif
- inclElement(conditions, set);
- }
- } else
- return false;
-
- return true;
-}
-
} // End of namespace Lab
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index 50589ed941..022f203f52 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -195,20 +195,13 @@ static void changeCombination(LargeSet Conditions, uint16 number) {
bltBitMap(Images[combnum], 0, (Images[combnum])->Height - (2 * counter), &(display), VGAScaleX(combx[number]), VGAScaleY(65), (Images[combnum])->Width, 2);
}
- /*
- if (memcmp(combination, solution, (size_t) 12) == 0)
- inclElement(Conditions, COMBINATIONUNLOCKED);
- else
- exclElement(Conditions, COMBINATIONUNLOCKED);
- */
-
for (counter = 0; counter < 6; counter++)
unlocked = (combination[counter] == solution[counter]) && unlocked;
if (unlocked)
- inclElement(Conditions, COMBINATIONUNLOCKED);
+ g_engine->_conditions->inclElement(COMBINATIONUNLOCKED);
else
- exclElement(Conditions, COMBINATIONUNLOCKED);
+ g_engine->_conditions->exclElement(COMBINATIONUNLOCKED);
#if !defined(DOSCODE)
ungetVGABaseAddr();
@@ -486,7 +479,7 @@ static void changeTile(LargeSet Conditions, uint16 col, uint16 row) {
}
if (check) {
- inclElement(Conditions, BRICKOPEN); /* unlocked combination */
+ g_engine->_conditions->inclElement(BRICKOPEN); /* unlocked combination */
DoBlack = true;
check = readPict("p:Up/BDOpen", true);
}
@@ -665,10 +658,10 @@ static bool loadJournalData(LargeSet Conditions) {
g_music->checkMusic();
strcpy(filename, "Lab:Rooms/j0");
- bridge = In(Conditions, BRIDGE0) || In(Conditions, BRIDGE1);
- dirty = In(Conditions, DIRTY);
- news = !In(Conditions, NONEWS);
- clean = !In(Conditions, NOCLEAN);
+ bridge = g_engine->_conditions->in(BRIDGE0) || g_engine->_conditions->in(BRIDGE1);
+ dirty = g_engine->_conditions->in(DIRTY);
+ news = !g_engine->_conditions->in(NONEWS);
+ clean = !g_engine->_conditions->in(NOCLEAN);
if (bridge && clean && news)
filename[11] = '8';
@@ -981,9 +974,6 @@ struct Image *Arrow1, *NoArrow1, *DriveButton;
extern InventoryData *Inventory;
extern uint16 RoomNum, Direction;
-extern LargeSet Conditions, RoomsFound;
-
-
extern char *SAVETEXT, *LOADTEXT, *BOOKMARKTEXT, *PERSONALTEXT, *DISKTEXT, *SAVEBOOK, *RESTOREBOOK, *SAVEFLASH, *RESTOREFLASH, *SAVEDISK, *RESTOREDISK, *SELECTDISK, *NODISKINDRIVE, *WRITEPROTECTED, *FORMATFLOPPY, *FORMATTING;