LAB: Renames and moved vars to classes
This commit is contained in:
parent
5c246e4189
commit
646c29d5a3
9 changed files with 132 additions and 136 deletions
|
@ -40,10 +40,6 @@
|
|||
|
||||
namespace Lab {
|
||||
|
||||
bool LongWinInFront = false;
|
||||
|
||||
TextFont *MsgFont;
|
||||
|
||||
extern bool stopsound, DoNotDrawMessage;
|
||||
|
||||
/* Global parser data */
|
||||
|
@ -468,7 +464,7 @@ void LabEngine::interfaceOn() {
|
|||
_event->mouseShow();
|
||||
}
|
||||
|
||||
if (LongWinInFront)
|
||||
if (_longWinInFront)
|
||||
_event->attachGadgetList(NULL);
|
||||
else if (_alternate)
|
||||
_event->attachGadgetList(_invGadgetList);
|
||||
|
@ -608,7 +604,7 @@ void LabEngine::mainGameLoop() {
|
|||
|
||||
_conditions->readInitialConditions("LAB:Conditio");
|
||||
|
||||
LongWinInFront = false;
|
||||
_longWinInFront = false;
|
||||
drawPanel();
|
||||
|
||||
perFlipGadget(actionMode);
|
||||
|
@ -758,7 +754,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
|
|||
|
||||
_anim->_doBlack = false;
|
||||
|
||||
if ((msgClass == RAWKEY) && (!LongWinInFront)) {
|
||||
if ((msgClass == RAWKEY) && (!_longWinInFront)) {
|
||||
if (code == 13) { /* The return key */
|
||||
msgClass = MOUSEBUTTONS;
|
||||
Qualifier = IEQUALIFIER_LEFTBUTTON;
|
||||
|
@ -846,12 +842,12 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
|
|||
eatMessages();
|
||||
}
|
||||
|
||||
if (LongWinInFront) {
|
||||
if (_longWinInFront) {
|
||||
if ((msgClass == RAWKEY) ||
|
||||
((msgClass == MOUSEBUTTONS) &&
|
||||
((IEQUALIFIER_LEFTBUTTON & Qualifier) ||
|
||||
(IEQUALIFIER_RBUTTON & Qualifier)))) {
|
||||
LongWinInFront = false;
|
||||
_longWinInFront = false;
|
||||
DoNotDrawMessage = false;
|
||||
drawPanel();
|
||||
drawRoomMessage(curInv, CPtr);
|
||||
|
@ -1274,7 +1270,7 @@ void LabEngine::go() {
|
|||
if (!doIntro)
|
||||
_music->initMusic();
|
||||
|
||||
MsgFont = _resource->getFont("P:AvanteG.12");
|
||||
_msgFont = _resource->getFont("P:AvanteG.12");
|
||||
|
||||
_event->mouseHide();
|
||||
|
||||
|
@ -1311,7 +1307,7 @@ void LabEngine::go() {
|
|||
}
|
||||
}
|
||||
|
||||
closeFont(MsgFont);
|
||||
closeFont(_msgFont);
|
||||
|
||||
freeRoomBuffer();
|
||||
freeBuffer();
|
||||
|
|
|
@ -42,8 +42,6 @@ namespace Lab {
|
|||
BitMap bit1, bit2, *DispBitMap = &bit1, *DrawBitMap = &bit1;
|
||||
|
||||
extern bool stopsound;
|
||||
extern TextFont *MsgFont;
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Scales the x co-ordinates to that of the new display. In the room parser */
|
||||
|
@ -194,8 +192,6 @@ byte *readPictToMem(const char *filename, uint16 x, uint16 y) {
|
|||
/*---------------------------------------------------------------------------*/
|
||||
bool DoNotDrawMessage = false;
|
||||
|
||||
extern bool LongWinInFront, Alternate;
|
||||
|
||||
/*----- The flowText routines -----*/
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -266,7 +262,7 @@ uint32 flowText(void *font, /* the TextAttr pointer */
|
|||
bool output, /* Whether to output any text */
|
||||
uint16 x1, /* Cords */
|
||||
uint16 y1, uint16 x2, uint16 y2, const char *str) { /* The text itself */
|
||||
TextFont *msgfont = (TextFont *)font;
|
||||
TextFont *_msgFont = (TextFont *)font;
|
||||
char linebuffer[256];
|
||||
const char *temp;
|
||||
uint16 numlines, actlines, fontheight, width;
|
||||
|
@ -282,7 +278,7 @@ uint32 flowText(void *font, /* the TextAttr pointer */
|
|||
|
||||
g_lab->setAPen(pencolor);
|
||||
|
||||
fontheight = textHeight(msgfont) + spacing;
|
||||
fontheight = textHeight(_msgFont) + spacing;
|
||||
numlines = (y2 - y1 + 1) / fontheight;
|
||||
width = x2 - x1 + 1;
|
||||
y = y1;
|
||||
|
@ -292,7 +288,7 @@ uint32 flowText(void *font, /* the TextAttr pointer */
|
|||
actlines = 0;
|
||||
|
||||
while (temp[0]) {
|
||||
getLine(msgfont, linebuffer, &temp, width);
|
||||
getLine(_msgFont, linebuffer, &temp, width);
|
||||
actlines++;
|
||||
}
|
||||
|
||||
|
@ -303,15 +299,15 @@ uint32 flowText(void *font, /* the TextAttr pointer */
|
|||
temp = str;
|
||||
|
||||
while (numlines && str[0]) {
|
||||
getLine(msgfont, linebuffer, &str, width);
|
||||
getLine(_msgFont, linebuffer, &str, width);
|
||||
|
||||
x = x1;
|
||||
|
||||
if (centerh)
|
||||
x += (width - textLength(msgfont, linebuffer, strlen(linebuffer))) / 2;
|
||||
x += (width - textLength(_msgFont, linebuffer, strlen(linebuffer))) / 2;
|
||||
|
||||
if (output)
|
||||
text(msgfont, x, y, pencolor, linebuffer, strlen(linebuffer));
|
||||
text(_msgFont, x, y, pencolor, linebuffer, strlen(linebuffer));
|
||||
|
||||
numlines--;
|
||||
y += fontheight;
|
||||
|
@ -370,8 +366,8 @@ int32 LabEngine::longDrawMessage(const char *str) {
|
|||
_event->mouseHide();
|
||||
strcpy(newText, str);
|
||||
|
||||
if (!LongWinInFront) {
|
||||
LongWinInFront = true;
|
||||
if (!_longWinInFront) {
|
||||
_longWinInFront = true;
|
||||
setAPen(3); /* Clear Area */
|
||||
rectFill(0, VGAScaleY(149) + SVGACord(2), VGAScaleX(319), VGAScaleY(199));
|
||||
}
|
||||
|
@ -379,7 +375,7 @@ int32 LabEngine::longDrawMessage(const char *str) {
|
|||
createBox(198);
|
||||
_event->mouseShow();
|
||||
|
||||
return flowText(MsgFont, 0, 1, 7, false, true, true, true, VGAScaleX(6), VGAScaleY(155), VGAScaleX(313), VGAScaleY(195), str);
|
||||
return flowText(_msgFont, 0, 1, 7, false, true, true, true, VGAScaleX(6), VGAScaleY(155), VGAScaleX(313), VGAScaleY(195), str);
|
||||
}
|
||||
|
||||
void LabEngine::drawStaticMessage(byte index) {
|
||||
|
@ -396,18 +392,18 @@ void LabEngine::drawMessage(const char *str) {
|
|||
}
|
||||
|
||||
if (str) {
|
||||
if ((textLength(MsgFont, str, strlen(str)) > VGAScaleX(306))) {
|
||||
if ((textLength(_msgFont, str, strlen(str)) > VGAScaleX(306))) {
|
||||
longDrawMessage(str);
|
||||
_lastMessageLong = true;
|
||||
} else {
|
||||
if (LongWinInFront) {
|
||||
LongWinInFront = false;
|
||||
if (_longWinInFront) {
|
||||
_longWinInFront = false;
|
||||
drawPanel();
|
||||
}
|
||||
|
||||
_event->mouseHide();
|
||||
createBox(168);
|
||||
text(MsgFont, VGAScaleX(7), VGAScaleY(155) + SVGACord(2), 1, str, strlen(str));
|
||||
text(_msgFont, VGAScaleX(7), VGAScaleY(155) + SVGACord(2), 1, str, strlen(str));
|
||||
_event->mouseShow();
|
||||
_lastMessageLong = false;
|
||||
}
|
||||
|
|
|
@ -109,6 +109,9 @@ LabEngine::LabEngine(OSystem *syst, const ADGameDescription *gameDesc)
|
|||
|
||||
_curFileName = " ";
|
||||
|
||||
_longWinInFront = false;
|
||||
_msgFont = 0;
|
||||
|
||||
//const Common::FSNode gameDataDir(ConfMan.get("path"));
|
||||
//SearchMan.addSubDirectoryMatching(gameDataDir, "game");
|
||||
//SearchMan.addSubDirectoryMatching(gameDataDir, "game/pict");
|
||||
|
|
|
@ -130,6 +130,10 @@ private:
|
|||
int _lastWaitTOFTicks;
|
||||
bool _lastMessageLong;
|
||||
bool _lastTooLong;
|
||||
TextFont *_msgFont;
|
||||
|
||||
public:
|
||||
bool _longWinInFront;
|
||||
|
||||
private:
|
||||
bool createScreen(bool HiRes);
|
||||
|
@ -161,8 +165,8 @@ public:
|
|||
void doScrollBlack();
|
||||
void doScrollWipe(char *filename);
|
||||
void doScrollBounce();
|
||||
void doWipe(uint16 WipeType, CloseDataPtr *CPtr, char *filename);
|
||||
void doTransWipe(CloseDataPtr *CPtr, char *filename);
|
||||
void doWipe(uint16 WipeType, CloseDataPtr *cPtr, char *filename);
|
||||
void doTransWipe(CloseDataPtr *cPtr, char *filename);
|
||||
Gadget *checkNumGadgetHit(Gadget *gadlist, uint16 key);
|
||||
IntuiMessage *getMsg();
|
||||
void drawMap(uint16 CurRoom, uint16 CurMsg, uint16 Floor, bool fadeout, bool fadein);
|
||||
|
@ -176,7 +180,7 @@ public:
|
|||
void doMonitor(char *background, char *textfile, bool isinteractive, uint16 x1, uint16 y1, uint16 x2, uint16 y2);
|
||||
void eatMessages();
|
||||
void drawStaticMessage(byte index);
|
||||
void drawDirection(CloseDataPtr LCPtr);
|
||||
void drawDirection(CloseDataPtr lcPtr);
|
||||
int followCrumbs();
|
||||
|
||||
void changeVolume(int delta);
|
||||
|
|
|
@ -81,8 +81,6 @@ static MapData *Maps;
|
|||
|
||||
extern char *LOWERFLOORS, *MIDDLEFLOORS, *UPPERFLOORS, *MEDMAZEFLOORS, *HEDGEMAZEFLOORS, *SURMAZEFLOORS, *CARNIVALFLOOR, *SURMAZEMSG;
|
||||
|
||||
extern TextFont *MsgFont;
|
||||
|
||||
uint16 *FadePalette;
|
||||
|
||||
static uint16 MapGadX[3] = {101, 55, 8}, MapGadY[3] = {105, 105, 105};
|
||||
|
@ -550,7 +548,7 @@ void LabEngine::drawMap(uint16 CurRoom, uint16 CurMsg, uint16 Floor, bool fadeou
|
|||
HugeMaze->drawImage(mapScaleX(524), mapScaleY(97));
|
||||
} else if (Floor == SURMAZEFLOOR) {
|
||||
sptr = (char *)_resource->getStaticText(kTextSurmazeMessage).c_str();
|
||||
flowText(MsgFont, 0, 7, 0, true, true, true, true, mapScaleX(360), 0, mapScaleX(660), mapScaleY(450), sptr);
|
||||
flowText(_msgFont, 0, 7, 0, true, true, true, true, mapScaleX(360), 0, mapScaleX(660), mapScaleY(450), sptr);
|
||||
}
|
||||
|
||||
switch (Floor) {
|
||||
|
@ -581,10 +579,10 @@ void LabEngine::drawMap(uint16 CurRoom, uint16 CurMsg, uint16 Floor, bool fadeou
|
|||
}
|
||||
|
||||
if (sptr)
|
||||
flowText(MsgFont, 0, 5, 3, true, true, true, true, VGAScaleX(14), VGAScaleY(75), VGAScaleX(134), VGAScaleY(97), sptr);
|
||||
flowText(_msgFont, 0, 5, 3, true, true, true, true, VGAScaleX(14), VGAScaleY(75), VGAScaleX(134), VGAScaleY(97), sptr);
|
||||
|
||||
if ((sptr = _rooms[CurMsg]._roomMsg))
|
||||
flowText(MsgFont, 0, 5, 3, true, true, true, true, VGAScaleX(14), VGAScaleY(148), VGAScaleX(134), VGAScaleY(186), sptr);
|
||||
flowText(_msgFont, 0, 5, 3, true, true, true, true, VGAScaleX(14), VGAScaleY(148), VGAScaleX(134), VGAScaleY(186), sptr);
|
||||
|
||||
if (fadein)
|
||||
fade(true, 0);
|
||||
|
@ -739,7 +737,7 @@ void LabEngine::processMap(uint16 CurRoom) {
|
|||
_event->mouseHide();
|
||||
setAPen(3);
|
||||
rectFill(VGAScaleX(13), VGAScaleY(148), VGAScaleX(135), VGAScaleY(186));
|
||||
flowText(MsgFont, 0, 5, 3, true, true, true, true, VGAScaleX(14), VGAScaleY(148), VGAScaleX(134), VGAScaleY(186), sptr);
|
||||
flowText(_msgFont, 0, 5, 3, true, true, true, true, VGAScaleX(14), VGAScaleY(148), VGAScaleX(134), VGAScaleY(186), sptr);
|
||||
|
||||
if (Maps[OldMsg].PageNumber == CurFloor)
|
||||
drawRoom(OldMsg, (bool)(OldMsg == CurRoom));
|
||||
|
|
|
@ -49,16 +49,16 @@ void freeRoomBuffer();
|
|||
/* From ProcessRoom.c */
|
||||
|
||||
ViewData *getViewData(uint16 RoomNum, uint16 Direction);
|
||||
char *getPictName(CloseDataPtr *LCPtr);
|
||||
void drawDirection(CloseDataPtr LCPtr);
|
||||
char *getPictName(CloseDataPtr *lcptr);
|
||||
void drawDirection(CloseDataPtr lcptr);
|
||||
bool processArrow(uint16 *Direction, uint16 Arrow);
|
||||
void setCurClose(Common::Point pos, CloseDataPtr *cptr, bool useAbsoluteCoords = false);
|
||||
bool takeItem(uint16 x, uint16 y, CloseDataPtr *cptr);
|
||||
bool doActionRule(Common::Point pos, int16 action, int16 RoomNum, CloseDataPtr *LCPtr);
|
||||
bool doOperateRule(int16 x, int16 y, int16 ItemNum, CloseDataPtr *LCPtr);
|
||||
bool doGoForward(CloseDataPtr *LCPtr);
|
||||
bool doTurn(uint16 from, uint16 to, CloseDataPtr *LCPtr);
|
||||
bool doMainView(CloseDataPtr *LCPtr);
|
||||
bool doActionRule(Common::Point pos, int16 action, int16 RoomNum, CloseDataPtr *lcptr);
|
||||
bool doOperateRule(int16 x, int16 y, int16 ItemNum, CloseDataPtr *lcptr);
|
||||
bool doGoForward(CloseDataPtr *lcptr);
|
||||
bool doTurn(uint16 from, uint16 to, CloseDataPtr *lcptr);
|
||||
bool doMainView(CloseDataPtr *lcptr);
|
||||
|
||||
} // End of namespace Lab
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ RoomData *_rooms;
|
|||
InventoryData *Inventory;
|
||||
uint16 NumInv, ManyRooms, HighestCondition, Direction;
|
||||
|
||||
extern bool DoNotDrawMessage, noupdatediff, QuitLab, MusicOn, LongWinInFront;
|
||||
extern bool DoNotDrawMessage, noupdatediff, QuitLab, MusicOn;
|
||||
extern CloseDataPtr CPtr;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -116,24 +116,24 @@ ViewData *getViewData(uint16 roomNum, uint16 direction) {
|
|||
/*****************************************************************************/
|
||||
/* Gets an object, if any, from the user's click on the screen. */
|
||||
/*****************************************************************************/
|
||||
static CloseData *getObject(uint16 x, uint16 y, CloseDataPtr LCPtr) {
|
||||
static CloseData *getObject(uint16 x, uint16 y, CloseDataPtr lcptr) {
|
||||
ViewData *VPtr;
|
||||
|
||||
if (LCPtr == NULL) {
|
||||
if (lcptr == NULL) {
|
||||
VPtr = getViewData(g_lab->_roomNum, Direction);
|
||||
LCPtr = VPtr->closeUps;
|
||||
lcptr = VPtr->closeUps;
|
||||
}
|
||||
|
||||
else
|
||||
LCPtr = LCPtr->SubCloseUps;
|
||||
lcptr = lcptr->SubCloseUps;
|
||||
|
||||
|
||||
while (LCPtr != NULL) {
|
||||
if ((x >= scaleX(LCPtr->x1)) && (y >= scaleY(LCPtr->y1)) &&
|
||||
(x <= scaleX(LCPtr->x2)) && (y <= scaleY(LCPtr->y2)))
|
||||
return LCPtr;
|
||||
while (lcptr != NULL) {
|
||||
if ((x >= scaleX(lcptr->x1)) && (y >= scaleY(lcptr->y1)) &&
|
||||
(x <= scaleX(lcptr->x2)) && (y <= scaleY(lcptr->y2)))
|
||||
return lcptr;
|
||||
|
||||
LCPtr = LCPtr->NextCloseUp;
|
||||
lcptr = lcptr->NextCloseUp;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -168,14 +168,14 @@ static CloseDataPtr findCPtrMatch(CloseDataPtr Main, CloseDataPtr List) {
|
|||
/*****************************************************************************/
|
||||
/* Returns the current picture name. */
|
||||
/*****************************************************************************/
|
||||
char *getPictName(CloseDataPtr *LCPtr) {
|
||||
char *getPictName(CloseDataPtr *lcptr) {
|
||||
ViewData *ViewPtr = getViewData(g_lab->_roomNum, Direction);
|
||||
|
||||
if (*LCPtr != NULL) {
|
||||
*LCPtr = findCPtrMatch(*LCPtr, ViewPtr->closeUps);
|
||||
if (*lcptr != NULL) {
|
||||
*lcptr = findCPtrMatch(*lcptr, ViewPtr->closeUps);
|
||||
|
||||
if (*LCPtr)
|
||||
return (*LCPtr)->GraphicName;
|
||||
if (*lcptr)
|
||||
return (*lcptr)->GraphicName;
|
||||
}
|
||||
|
||||
return ViewPtr->GraphicName;
|
||||
|
@ -184,9 +184,9 @@ char *getPictName(CloseDataPtr *LCPtr) {
|
|||
/*****************************************************************************/
|
||||
/* Draws the current direction to the screen. */
|
||||
/*****************************************************************************/
|
||||
void LabEngine::drawDirection(CloseDataPtr LCPtr) {
|
||||
if (LCPtr != NULL && LCPtr->Message) {
|
||||
drawMessage(LCPtr->Message);
|
||||
void LabEngine::drawDirection(CloseDataPtr lcptr) {
|
||||
if (lcptr != NULL && lcptr->Message) {
|
||||
drawMessage(lcptr->Message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -257,34 +257,34 @@ bool processArrow(uint16 *direction, uint16 Arrow) {
|
|||
/*****************************************************************************/
|
||||
void setCurClose(Common::Point pos, CloseDataPtr *cptr, bool useAbsoluteCoords) {
|
||||
ViewData *VPtr;
|
||||
CloseDataPtr LCPtr;
|
||||
CloseDataPtr lcptr;
|
||||
uint16 x1, y1, x2, y2;
|
||||
|
||||
if (*cptr == NULL) {
|
||||
VPtr = getViewData(g_lab->_roomNum, Direction);
|
||||
LCPtr = VPtr->closeUps;
|
||||
lcptr = VPtr->closeUps;
|
||||
} else
|
||||
LCPtr = (*cptr)->SubCloseUps;
|
||||
lcptr = (*cptr)->SubCloseUps;
|
||||
|
||||
while (LCPtr != NULL) {
|
||||
while (lcptr != NULL) {
|
||||
if (!useAbsoluteCoords) {
|
||||
x1 = LCPtr->x1;
|
||||
y1 = LCPtr->y1;
|
||||
x2 = LCPtr->x2;
|
||||
y2 = LCPtr->y2;
|
||||
x1 = lcptr->x1;
|
||||
y1 = lcptr->y1;
|
||||
x2 = lcptr->x2;
|
||||
y2 = lcptr->y2;
|
||||
} else {
|
||||
x1 = scaleX(LCPtr->x1);
|
||||
y1 = scaleY(LCPtr->y1);
|
||||
x2 = scaleX(LCPtr->x2);
|
||||
y2 = scaleY(LCPtr->y2);
|
||||
x1 = scaleX(lcptr->x1);
|
||||
y1 = scaleY(lcptr->y1);
|
||||
x2 = scaleX(lcptr->x2);
|
||||
y2 = scaleY(lcptr->y2);
|
||||
}
|
||||
|
||||
if (pos.x >= x1 && pos.y >= y1 && pos.x <= x2 && pos.y <= y2 && LCPtr->GraphicName) {
|
||||
*cptr = LCPtr;
|
||||
if (pos.x >= x1 && pos.y >= y1 && pos.x <= x2 && pos.y <= y2 && lcptr->GraphicName) {
|
||||
*cptr = lcptr;
|
||||
return;
|
||||
}
|
||||
|
||||
LCPtr = LCPtr->NextCloseUp;
|
||||
lcptr = lcptr->NextCloseUp;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -293,27 +293,27 @@ void setCurClose(Common::Point pos, CloseDataPtr *cptr, bool useAbsoluteCoords)
|
|||
/*****************************************************************************/
|
||||
bool takeItem(uint16 x, uint16 y, CloseDataPtr *cptr) {
|
||||
ViewData *VPtr;
|
||||
CloseDataPtr LCPtr;
|
||||
CloseDataPtr lcptr;
|
||||
|
||||
if (*cptr == NULL) {
|
||||
VPtr = getViewData(g_lab->_roomNum, Direction);
|
||||
LCPtr = VPtr->closeUps;
|
||||
lcptr = VPtr->closeUps;
|
||||
} else if ((*cptr)->CloseUpType < 0) {
|
||||
g_lab->_conditions->inclElement(abs((*cptr)->CloseUpType));
|
||||
return true;
|
||||
} else
|
||||
LCPtr = (*cptr)->SubCloseUps;
|
||||
lcptr = (*cptr)->SubCloseUps;
|
||||
|
||||
|
||||
while (LCPtr != NULL) {
|
||||
if ((x >= scaleX(LCPtr->x1)) && (y >= scaleY(LCPtr->y1)) &&
|
||||
(x <= scaleX(LCPtr->x2)) && (y <= scaleY(LCPtr->y2)) &&
|
||||
(LCPtr->CloseUpType < 0)) {
|
||||
g_lab->_conditions->inclElement(abs(LCPtr->CloseUpType));
|
||||
while (lcptr != NULL) {
|
||||
if ((x >= scaleX(lcptr->x1)) && (y >= scaleY(lcptr->y1)) &&
|
||||
(x <= scaleX(lcptr->x2)) && (y <= scaleY(lcptr->y2)) &&
|
||||
(lcptr->CloseUpType < 0)) {
|
||||
g_lab->_conditions->inclElement(abs(lcptr->CloseUpType));
|
||||
return true;
|
||||
}
|
||||
|
||||
LCPtr = LCPtr->NextCloseUp;
|
||||
lcptr = lcptr->NextCloseUp;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -322,8 +322,8 @@ bool takeItem(uint16 x, uint16 y, CloseDataPtr *cptr) {
|
|||
/*****************************************************************************/
|
||||
/* Processes the action list. */
|
||||
/*****************************************************************************/
|
||||
static void doActions(Action *APtr, CloseDataPtr *LCPtr) {
|
||||
CloseDataPtr TLCPtr;
|
||||
static void doActions(Action *APtr, CloseDataPtr *lcptr) {
|
||||
CloseDataPtr tlcptr;
|
||||
bool FirstLoaded = true;
|
||||
char **str, *Test;
|
||||
uint32 StartSecs, StartMicros, CurSecs, CurMicros;
|
||||
|
@ -371,7 +371,7 @@ static void doActions(Action *APtr, CloseDataPtr *LCPtr) {
|
|||
break;
|
||||
|
||||
case WIPECMD:
|
||||
g_lab->doWipe(APtr->Param1, LCPtr, (char *)APtr->Data);
|
||||
g_lab->doWipe(APtr->Param1, lcptr, (char *)APtr->Data);
|
||||
break;
|
||||
|
||||
case NOUPDATE:
|
||||
|
@ -384,7 +384,7 @@ static void doActions(Action *APtr, CloseDataPtr *LCPtr) {
|
|||
break;
|
||||
|
||||
case SHOWCURPICT:
|
||||
Test = getPictName(LCPtr);
|
||||
Test = getPictName(lcptr);
|
||||
|
||||
if (strcmp(Test, g_lab->_curFileName) != 0) {
|
||||
g_lab->_curFileName = Test;
|
||||
|
@ -404,7 +404,7 @@ static void doActions(Action *APtr, CloseDataPtr *LCPtr) {
|
|||
case SHOWMESSAGE:
|
||||
DoNotDrawMessage = false;
|
||||
|
||||
if (LongWinInFront)
|
||||
if (g_lab->_longWinInFront)
|
||||
g_lab->longDrawMessage((char *)APtr->Data);
|
||||
else
|
||||
g_lab->drawMessage((char *)APtr->Data);
|
||||
|
@ -413,7 +413,7 @@ static void doActions(Action *APtr, CloseDataPtr *LCPtr) {
|
|||
break;
|
||||
|
||||
case CSHOWMESSAGE:
|
||||
if (*LCPtr == NULL) {
|
||||
if (*lcptr == NULL) {
|
||||
DoNotDrawMessage = false;
|
||||
g_lab->drawMessage((char *)APtr->Data);
|
||||
DoNotDrawMessage = true;
|
||||
|
@ -432,7 +432,7 @@ static void doActions(Action *APtr, CloseDataPtr *LCPtr) {
|
|||
if (APtr->Param1 & 0x8000) {
|
||||
// This is a Wyrmkeep Windows trial version, thus stop at this
|
||||
// point, since we can't check for game payment status
|
||||
readPict(getPictName(LCPtr), true);
|
||||
readPict(getPictName(lcptr), true);
|
||||
APtr = NULL;
|
||||
GUI::MessageDialog trialMessage("This is the end of the trial version. You can play the full game using the original interpreter from Wyrmkeep");
|
||||
trialMessage.runModal();
|
||||
|
@ -441,20 +441,20 @@ static void doActions(Action *APtr, CloseDataPtr *LCPtr) {
|
|||
|
||||
g_lab->_roomNum = APtr->Param1;
|
||||
Direction = APtr->Param2 - 1;
|
||||
*LCPtr = NULL;
|
||||
*lcptr = NULL;
|
||||
g_lab->_anim->_doBlack = true;
|
||||
break;
|
||||
|
||||
case SETCLOSEUP:
|
||||
TLCPtr = getObject(scaleX(APtr->Param1), scaleY(APtr->Param2), *LCPtr);
|
||||
tlcptr = getObject(scaleX(APtr->Param1), scaleY(APtr->Param2), *lcptr);
|
||||
|
||||
if (TLCPtr)
|
||||
*LCPtr = TLCPtr;
|
||||
if (tlcptr)
|
||||
*lcptr = tlcptr;
|
||||
|
||||
break;
|
||||
|
||||
case MAINVIEW:
|
||||
*LCPtr = NULL;
|
||||
*lcptr = NULL;
|
||||
break;
|
||||
|
||||
case SUBINV:
|
||||
|
@ -603,10 +603,10 @@ static void doActions(Action *APtr, CloseDataPtr *LCPtr) {
|
|||
/*****************************************************************************/
|
||||
/* Does the work for doActionRule. */
|
||||
/*****************************************************************************/
|
||||
static bool doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr LCPtr, CloseDataPtr *Set, bool AllowDefaults) {
|
||||
static bool doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr lcptr, CloseDataPtr *Set, bool AllowDefaults) {
|
||||
action++;
|
||||
|
||||
if (LCPtr) {
|
||||
if (lcptr) {
|
||||
RuleList *rules = _rooms[g_lab->_roomNum]._rules;
|
||||
|
||||
if ((rules == NULL) && (roomNum == 0)) {
|
||||
|
@ -617,10 +617,10 @@ static bool doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr LCPtr, Clo
|
|||
for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) {
|
||||
if (((*rule)->RuleType == ACTION) &&
|
||||
(((*rule)->Param1 == action) || (((*rule)->Param1 == 0) && AllowDefaults))) {
|
||||
if ((((*rule)->Param2 == LCPtr->CloseUpType) ||
|
||||
if ((((*rule)->Param2 == lcptr->CloseUpType) ||
|
||||
(((*rule)->Param2 == 0) && AllowDefaults))
|
||||
||
|
||||
((action == 1) && ((*rule)->Param2 == (-LCPtr->CloseUpType)))) {
|
||||
((action == 1) && ((*rule)->Param2 == (-lcptr->CloseUpType)))) {
|
||||
if (checkConditions((*rule)->Condition)) {
|
||||
doActions((*rule)->ActionList, Set);
|
||||
return true;
|
||||
|
@ -636,23 +636,23 @@ static bool doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr LCPtr, Clo
|
|||
/*****************************************************************************/
|
||||
/* Goes through the rules if an action is taken. */
|
||||
/*****************************************************************************/
|
||||
bool doActionRule(Common::Point pos, int16 action, int16 roomNum, CloseDataPtr *LCPtr) {
|
||||
CloseDataPtr TLCPtr;
|
||||
bool doActionRule(Common::Point pos, int16 action, int16 roomNum, CloseDataPtr *lcptr) {
|
||||
CloseDataPtr tlcptr;
|
||||
|
||||
if (roomNum)
|
||||
g_lab->_newFileName = NOFILE;
|
||||
else
|
||||
g_lab->_newFileName = g_lab->_curFileName;
|
||||
|
||||
TLCPtr = getObject(pos.x, pos.y, *LCPtr);
|
||||
tlcptr = getObject(pos.x, pos.y, *lcptr);
|
||||
|
||||
if (doActionRuleSub(action, roomNum, TLCPtr, LCPtr, false))
|
||||
if (doActionRuleSub(action, roomNum, tlcptr, lcptr, false))
|
||||
return true;
|
||||
else if (doActionRuleSub(action, roomNum, *LCPtr, LCPtr, false))
|
||||
else if (doActionRuleSub(action, roomNum, *lcptr, lcptr, false))
|
||||
return true;
|
||||
else if (doActionRuleSub(action, roomNum, TLCPtr, LCPtr, true))
|
||||
else if (doActionRuleSub(action, roomNum, tlcptr, lcptr, true))
|
||||
return true;
|
||||
else if (doActionRuleSub(action, roomNum, *LCPtr, LCPtr, true))
|
||||
else if (doActionRuleSub(action, roomNum, *lcptr, lcptr, true))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -661,9 +661,9 @@ bool doActionRule(Common::Point pos, int16 action, int16 roomNum, CloseDataPtr *
|
|||
/*****************************************************************************/
|
||||
/* Does the work for doActionRule. */
|
||||
/*****************************************************************************/
|
||||
static bool doOperateRuleSub(int16 ItemNum, int16 roomNum, CloseDataPtr LCPtr, CloseDataPtr *Set, bool AllowDefaults) {
|
||||
if (LCPtr)
|
||||
if (LCPtr->CloseUpType > 0) {
|
||||
static bool doOperateRuleSub(int16 ItemNum, int16 roomNum, CloseDataPtr lcptr, CloseDataPtr *Set, bool AllowDefaults) {
|
||||
if (lcptr)
|
||||
if (lcptr->CloseUpType > 0) {
|
||||
RuleList *rules = _rooms[roomNum]._rules;
|
||||
|
||||
if ((rules == NULL) && (roomNum == 0)) {
|
||||
|
@ -674,7 +674,7 @@ static bool doOperateRuleSub(int16 ItemNum, int16 roomNum, CloseDataPtr LCPtr, C
|
|||
for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) {
|
||||
if (((*rule)->RuleType == OPERATE) &&
|
||||
(((*rule)->Param1 == ItemNum) || (((*rule)->Param1 == 0) && AllowDefaults)) &&
|
||||
(((*rule)->Param2 == LCPtr->CloseUpType) || (((*rule)->Param2 == 0) && AllowDefaults))) {
|
||||
(((*rule)->Param2 == lcptr->CloseUpType) || (((*rule)->Param2 == 0) && AllowDefaults))) {
|
||||
if (checkConditions((*rule)->Condition)) {
|
||||
doActions((*rule)->ActionList, Set);
|
||||
return true;
|
||||
|
@ -689,31 +689,31 @@ static bool doOperateRuleSub(int16 ItemNum, int16 roomNum, CloseDataPtr LCPtr, C
|
|||
/*****************************************************************************/
|
||||
/* Goes thru the rules if the user tries to operate an item on an object. */
|
||||
/*****************************************************************************/
|
||||
bool doOperateRule(int16 x, int16 y, int16 ItemNum, CloseDataPtr *LCPtr) {
|
||||
CloseDataPtr TLCPtr;
|
||||
bool doOperateRule(int16 x, int16 y, int16 ItemNum, CloseDataPtr *lcptr) {
|
||||
CloseDataPtr tlcptr;
|
||||
|
||||
g_lab->_newFileName = NOFILE;
|
||||
|
||||
TLCPtr = getObject(x, y, *LCPtr);
|
||||
tlcptr = getObject(x, y, *lcptr);
|
||||
|
||||
if (doOperateRuleSub(ItemNum, g_lab->_roomNum, TLCPtr, LCPtr, false))
|
||||
if (doOperateRuleSub(ItemNum, g_lab->_roomNum, tlcptr, lcptr, false))
|
||||
return true;
|
||||
else if (doOperateRuleSub(ItemNum, g_lab->_roomNum, *LCPtr, LCPtr, false))
|
||||
else if (doOperateRuleSub(ItemNum, g_lab->_roomNum, *lcptr, lcptr, false))
|
||||
return true;
|
||||
else if (doOperateRuleSub(ItemNum, g_lab->_roomNum, TLCPtr, LCPtr, true))
|
||||
else if (doOperateRuleSub(ItemNum, g_lab->_roomNum, tlcptr, lcptr, true))
|
||||
return true;
|
||||
else if (doOperateRuleSub(ItemNum, g_lab->_roomNum, *LCPtr, LCPtr, true))
|
||||
else if (doOperateRuleSub(ItemNum, g_lab->_roomNum, *lcptr, lcptr, true))
|
||||
return true;
|
||||
else {
|
||||
g_lab->_newFileName = g_lab->_curFileName;
|
||||
|
||||
if (doOperateRuleSub(ItemNum, 0, TLCPtr, LCPtr, false))
|
||||
if (doOperateRuleSub(ItemNum, 0, tlcptr, lcptr, false))
|
||||
return true;
|
||||
else if (doOperateRuleSub(ItemNum, 0, *LCPtr, LCPtr, false))
|
||||
else if (doOperateRuleSub(ItemNum, 0, *lcptr, lcptr, false))
|
||||
return true;
|
||||
else if (doOperateRuleSub(ItemNum, 0, TLCPtr, LCPtr, true))
|
||||
else if (doOperateRuleSub(ItemNum, 0, tlcptr, lcptr, true))
|
||||
return true;
|
||||
else if (doOperateRuleSub(ItemNum, 0, *LCPtr, LCPtr, true))
|
||||
else if (doOperateRuleSub(ItemNum, 0, *lcptr, lcptr, true))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -723,13 +723,13 @@ bool doOperateRule(int16 x, int16 y, int16 ItemNum, CloseDataPtr *LCPtr) {
|
|||
/*****************************************************************************/
|
||||
/* Goes thru the rules if the user tries to go forward. */
|
||||
/*****************************************************************************/
|
||||
bool doGoForward(CloseDataPtr *LCPtr) {
|
||||
bool doGoForward(CloseDataPtr *lcptr) {
|
||||
RuleList *rules = _rooms[g_lab->_roomNum]._rules;
|
||||
|
||||
for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) {
|
||||
if (((*rule)->RuleType == GOFORWARD) && ((*rule)->Param1 == (Direction + 1))) {
|
||||
if (checkConditions((*rule)->Condition)) {
|
||||
doActions((*rule)->ActionList, LCPtr);
|
||||
doActions((*rule)->ActionList, lcptr);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -741,7 +741,7 @@ bool doGoForward(CloseDataPtr *LCPtr) {
|
|||
/*****************************************************************************/
|
||||
/* Goes thru the rules if the user tries to turn. */
|
||||
/*****************************************************************************/
|
||||
bool doTurn(uint16 from, uint16 to, CloseDataPtr *LCPtr) {
|
||||
bool doTurn(uint16 from, uint16 to, CloseDataPtr *lcptr) {
|
||||
from++;
|
||||
to++;
|
||||
|
||||
|
@ -752,7 +752,7 @@ bool doTurn(uint16 from, uint16 to, CloseDataPtr *LCPtr) {
|
|||
(((*rule)->RuleType == TURNFROMTO) &&
|
||||
((*rule)->Param1 == from) && ((*rule)->Param2 == to))) {
|
||||
if (checkConditions((*rule)->Condition)) {
|
||||
doActions((*rule)->ActionList, LCPtr);
|
||||
doActions((*rule)->ActionList, lcptr);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -764,12 +764,12 @@ bool doTurn(uint16 from, uint16 to, CloseDataPtr *LCPtr) {
|
|||
/*****************************************************************************/
|
||||
/* Goes thru the rules if the user tries to go to the main view */
|
||||
/*****************************************************************************/
|
||||
bool doMainView(CloseDataPtr *LCPtr) {
|
||||
bool doMainView(CloseDataPtr *lcptr) {
|
||||
RuleList *rules = _rooms[g_lab->_roomNum]._rules;
|
||||
for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) {
|
||||
if ((*rule)->RuleType == GOMAINVIEW) {
|
||||
if (checkConditions((*rule)->Condition)) {
|
||||
doActions((*rule)->ActionList, LCPtr);
|
||||
doActions((*rule)->ActionList, lcptr);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace Lab {
|
|||
/* Lab: Labyrinth specific */
|
||||
extern byte combination[6];
|
||||
extern uint16 CurTile[4] [4];
|
||||
extern char *getPictName(CloseDataPtr *LCPtr);
|
||||
extern char *getPictName(CloseDataPtr *lcptr);
|
||||
|
||||
void writeSaveGameHeader(Common::OutSaveFile *out, const Common::String &saveName) {
|
||||
out->writeUint32BE(SAVEGAME_ID);
|
||||
|
@ -137,8 +137,8 @@ bool saveGame(uint16 Direction, uint16 Quarters, int slot, Common::String desc)
|
|||
return false;
|
||||
|
||||
// Load scene pic
|
||||
CloseDataPtr CPtr = NULL;
|
||||
readPict(getPictName(&CPtr), true);
|
||||
CloseDataPtr cPtr = NULL;
|
||||
readPict(getPictName(&cPtr), true);
|
||||
|
||||
writeSaveGameHeader(file, desc);
|
||||
file->writeUint16LE(g_lab->_roomNum);
|
||||
|
|
|
@ -81,7 +81,6 @@ uint16 CurTile[4][4] = {
|
|||
{ 10, 13, 12, 0 }
|
||||
};
|
||||
|
||||
extern TextFont *MsgFont;
|
||||
extern uint16 *FadePalette;
|
||||
extern BitMap *DispBitMap, *DrawBitMap;
|
||||
extern CloseDataPtr CPtr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue