From 2611b62d5ec07868d52b8a014932c937eddfceea Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 6 Dec 2015 21:53:57 +0100 Subject: LAB: Rename parse types --- engines/lab/engine.cpp | 76 ++++++++++---------- engines/lab/parsetypes.h | 56 ++++++++------- engines/lab/processroom.cpp | 168 ++++++++++++++++++++++---------------------- engines/lab/resource.cpp | 62 ++++++++-------- engines/lab/savegame.cpp | 2 +- engines/lab/special.cpp | 6 +- 6 files changed, 187 insertions(+), 183 deletions(-) (limited to 'engines') diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index d300f474ab..17ae4cc560 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -97,14 +97,14 @@ void LabEngine::drawRoomMessage(uint16 curInv, CloseDataPtr closePtr) { } if (_alternate) { - if ((curInv <= _numInv) && _conditions->in(curInv) && _inventory[curInv].BInvName) { + if ((curInv <= _numInv) && _conditions->in(curInv) && _inventory[curInv]._bitmapName) { if ((curInv == LAMPNUM) && _conditions->in(LAMPON)) /* LAB: Labyrinth specific */ drawStaticMessage(kTextLampOn); - else if (_inventory[curInv].Many > 1) { - Common::String roomMessage = Common::String(_inventory[curInv].name) + " (" + Common::String::format("%d", _inventory[curInv].Many) + ")"; + else if (_inventory[curInv]._many > 1) { + Common::String roomMessage = Common::String(_inventory[curInv]._name) + " (" + Common::String::format("%d", _inventory[curInv]._many) + ")"; _graphics->drawMessage(roomMessage.c_str()); } else - _graphics->drawMessage(_inventory[curInv].name); + _graphics->drawMessage(_inventory[curInv]._name); } } else drawDirection(closePtr); @@ -182,32 +182,32 @@ bool LabEngine::doCloseUp(CloseDataPtr closePtr) { lutertmargin = 128; } - switch (closePtr->CloseUpType) { + switch (closePtr->_closeUpType) { case MUSEUMMONITOR: case LIBRARYMONITOR: case WINDOWMONITOR: - doMonitor(closePtr->GraphicName, closePtr->Message, false, monltmargin, montopmargin, monrtmargin, 165); + doMonitor(closePtr->_graphicName, closePtr->_message, false, monltmargin, montopmargin, monrtmargin, 165); break; case GRAMAPHONEMONITOR: - doMonitor(closePtr->GraphicName, closePtr->Message, false, monltmargin, montopmargin, 171, 165); + doMonitor(closePtr->_graphicName, closePtr->_message, false, monltmargin, montopmargin, 171, 165); break; case UNICYCLEMONITOR: - doMonitor(closePtr->GraphicName, closePtr->Message, false, 100, montopmargin, monrtmargin, 165); + doMonitor(closePtr->_graphicName, closePtr->_message, false, 100, montopmargin, monrtmargin, 165); break; case STATUEMONITOR: - doMonitor(closePtr->GraphicName, closePtr->Message, false, 117, montopmargin, monrtmargin, 165); + doMonitor(closePtr->_graphicName, closePtr->_message, false, 117, montopmargin, monrtmargin, 165); break; case TALISMANMONITOR: - doMonitor(closePtr->GraphicName, closePtr->Message, false, monltmargin, montopmargin, 184, 165); + doMonitor(closePtr->_graphicName, closePtr->_message, false, monltmargin, montopmargin, 184, 165); break; case LUTEMONITOR: - doMonitor(closePtr->GraphicName, closePtr->Message, false, monltmargin, montopmargin, lutertmargin, 165); + doMonitor(closePtr->_graphicName, closePtr->_message, false, monltmargin, montopmargin, lutertmargin, 165); break; case CLOCKMONITOR: - doMonitor(closePtr->GraphicName, closePtr->Message, false, monltmargin, montopmargin, 206, 165); + doMonitor(closePtr->_graphicName, closePtr->_message, false, monltmargin, montopmargin, 206, 165); break; case TERMINALMONITOR: - doMonitor(closePtr->GraphicName, closePtr->Message, true, monltmargin, montopmargin, monrtmargin, 165); + doMonitor(closePtr->_graphicName, closePtr->_message, true, monltmargin, montopmargin, monrtmargin, 165); break; default: return false; @@ -224,7 +224,7 @@ bool LabEngine::doCloseUp(CloseDataPtr closePtr) { /******************************************************************************/ const char *LabEngine::getInvName(uint16 curInv) { if (_mainDisplay) - return _inventory[curInv].BInvName; + return _inventory[curInv]._bitmapName; if ((curInv == LAMPNUM) && _conditions->in(LAMPON)) return "P:Mines/120"; @@ -233,20 +233,20 @@ const char *LabEngine::getInvName(uint16 curInv) { return "P:Future/BeltGlow"; if (curInv == WESTPAPERNUM) { - _curFileName = _inventory[curInv].BInvName; + _curFileName = _inventory[curInv]._bitmapName; _anim->_noPalChange = true; _graphics->readPict(_curFileName, false); _anim->_noPalChange = false; doWestPaper(); } else if (curInv == NOTESNUM) { - _curFileName = _inventory[curInv].BInvName; + _curFileName = _inventory[curInv]._bitmapName; _anim->_noPalChange = true; _graphics->readPict(_curFileName, false); _anim->_noPalChange = false; doNotes(); } - return _inventory[curInv].BInvName; + return _inventory[curInv]._bitmapName; } /******************************************************************************/ @@ -351,7 +351,7 @@ void LabEngine::decIncInv(uint16 *curInv, bool decreaseFl) { (*curInv)++; while (*curInv && (*curInv <= _numInv)) { - if (_conditions->in(*curInv) && _inventory[*curInv].BInvName) { + if (_conditions->in(*curInv) && _inventory[*curInv]._bitmapName) { _nextFileName = getInvName(*curInv); break; } @@ -369,7 +369,7 @@ void LabEngine::decIncInv(uint16 *curInv, bool decreaseFl) { *curInv = 1; while (*curInv && (*curInv <= _numInv)) { - if (_conditions->in(*curInv) && _inventory[*curInv].BInvName) { + if (_conditions->in(*curInv) && _inventory[*curInv]._bitmapName) { _nextFileName = getInvName(*curInv); break; } @@ -452,12 +452,12 @@ void LabEngine::mainGameLoop() { _curFileName = _nextFileName; if (_cptr) { - if ((_cptr->CloseUpType == SPECIALLOCK) && _mainDisplay) /* LAB: Labyrinth specific code */ + if ((_cptr->_closeUpType == SPECIALLOCK) && _mainDisplay) /* LAB: Labyrinth specific code */ showCombination(_curFileName); - else if (((_cptr->CloseUpType == SPECIALBRICK) || - (_cptr->CloseUpType == SPECIALBRICKNOMOUSE)) && + else if (((_cptr->_closeUpType == SPECIALBRICK) || + (_cptr->_closeUpType == SPECIALBRICKNOMOUSE)) && _mainDisplay) /* LAB: Labyrinth specific code */ - showTile(_curFileName, (bool)(_cptr->CloseUpType == SPECIALBRICKNOMOUSE)); + showTile(_curFileName, (bool)(_cptr->_closeUpType == SPECIALBRICKNOMOUSE)); else _graphics->readPict(_curFileName, false); } else @@ -535,11 +535,11 @@ void LabEngine::mainGameLoop() { if (_inventory) { for (int i = 1; i <= _numInv; i++) { - if (_inventory[i].name) - free(_inventory[i].name); + if (_inventory[i]._name) + free(_inventory[i]._name); - if (_inventory[i].BInvName) - free(_inventory[i].BInvName); + if (_inventory[i]._bitmapName) + free(_inventory[i]._bitmapName); } free(_inventory); @@ -552,7 +552,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm uint16 oldDirection = 0; uint16 lastInv = MAPNUM; - CloseDataPtr oldcptr, tempcptr, hcptr = NULL; + CloseDataPtr oldcptr, tempcptr, hcptr = nullptr; ViewData *VPtr; bool doit; uint16 NewDir; @@ -862,7 +862,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm } if ((curInv <= _numInv) && _conditions->in(curInv) && - _inventory[curInv].BInvName) + _inventory[curInv]._bitmapName) _nextFileName = getInvName(curInv); _graphics->screenUpdate(); @@ -922,9 +922,9 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm doit = false; if (_cptr) { - if ((_cptr->CloseUpType == SPECIALLOCK) && _mainDisplay) /* LAB: Labyrinth specific code */ + if ((_cptr->_closeUpType == SPECIALLOCK) && _mainDisplay) /* LAB: Labyrinth specific code */ mouseCombination(curPos); - else if ((_cptr->CloseUpType == SPECIALBRICK) && _mainDisplay) + else if ((_cptr->_closeUpType == SPECIALBRICK) && _mainDisplay) mouseTile(curPos); else doit = true; @@ -963,8 +963,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm if (_cptr == tempcptr) { if (curPos.y < (_graphics->VGAScaleY(149) + _graphics->SVGACord(2))) drawStaticMessage(kTextNothing); - } else if (tempcptr->GraphicName) { - if (*(tempcptr->GraphicName)) { + } else if (tempcptr->_graphicName) { + if (*(tempcptr->_graphicName)) { _anim->_doBlack = true; _cptr = tempcptr; } else if (curPos.y < (_graphics->VGAScaleY(149) + _graphics->SVGACord(2))) @@ -987,7 +987,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm _graphics->screenUpdate(); } else if (msgClass == DELTAMOVE) { VPtr = getViewData(_roomNum, _direction); - oldcptr = VPtr->closeUps; + oldcptr = VPtr->_closeUps; if (hcptr == NULL) { tempcptr = _cptr; @@ -997,18 +997,18 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm if (_cptr == NULL) hcptr = oldcptr; else - hcptr = _cptr->SubCloseUps; + hcptr = _cptr->_subCloseUps; } else - hcptr = tempcptr->NextCloseUp; + hcptr = tempcptr->_nextCloseUp; } else - hcptr = hcptr->NextCloseUp; + hcptr = hcptr->_nextCloseUp; if (hcptr == NULL) { if (_cptr == NULL) hcptr = oldcptr; else - hcptr = _cptr->SubCloseUps; + hcptr = _cptr->_subCloseUps; } if (hcptr) diff --git a/engines/lab/parsetypes.h b/engines/lab/parsetypes.h index 9bfc2b094d..b345e1e056 100644 --- a/engines/lab/parsetypes.h +++ b/engines/lab/parsetypes.h @@ -37,8 +37,6 @@ namespace Lab { #define MAXFILELEN 31 - - /*------------------------------- Action types ------------------------------*/ #define PLAYSOUND 1 #define PLAYSOUNDCONT 2 @@ -77,8 +75,6 @@ namespace Lab { #define CSHOWMESSAGE 35 #define PLAYSOUNDB 36 - - /* Rule Types */ #define ACTION 1 #define OPERATE 2 @@ -88,8 +84,6 @@ namespace Lab { #define GOMAINVIEW 6 #define TURNFROMTO 7 - - /*----------------------------- Rule Type Action ----------------------------*/ #define TAKE 1 #define MOVE 2 @@ -101,50 +95,60 @@ namespace Lab { #pragma pack(push, 1) #endif -typedef struct closeData { +typedef struct CloseData { uint16 x1, y1, x2, y2; - int16 CloseUpType; /* if > 0, an object. If < 0, an item */ - uint16 depth; /* Level of the closeup. */ - char *GraphicName, *Message; - closeData *NextCloseUp, *SubCloseUps; + int16 _closeUpType; /* if > 0, an object. If < 0, an item */ + uint16 _depth; /* Level of the closeup. */ + char *_graphicName; + char *_message; + CloseData *_nextCloseUp; + CloseData *_subCloseUps; } CloseData; typedef CloseData *CloseDataPtr; struct ViewData { - int16 *Condition; - char *GraphicName; - struct ViewData *NextCondition; - CloseDataPtr closeUps; + int16 *_condition; + char *_graphicName; + struct ViewData *_nextCondition; + CloseDataPtr _closeUps; }; struct Action { - int16 ActionType, Param1, Param2, Param3; - byte *Data; /* Message, or a pointer to array of messages. */ - Action *NextAction; + int16 _actionType; + int16 _param1; + int16 _param2; + int16 _param3; + byte *_data; /* Message, or a pointer to array of messages. */ + Action *_nextAction; }; struct Rule { - int16 RuleType, Param1, Param2, *Condition; - Action *ActionList; - Rule *NextRule; + int16 _ruleType; + int16 _param1; + int16 _param2; + int16 *_condition; + Action *_actionList; + Rule *_nextRule; }; typedef Common::List RuleList; struct RoomData { - uint16 _northDoor, _southDoor, _eastDoor, _westDoor; - + uint16 _northDoor; + uint16 _southDoor; + uint16 _eastDoor; + uint16 _westDoor; byte _wipeType; - ViewData *_view[4]; RuleList *_rules; char *_roomMsg; }; struct InventoryData { - uint16 Many; - char *name, *BInvName; + uint16 _many; + char *_name; + char *_bitmapName; }; /* Map Flags */ diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp index f254d4b753..015b854b75 100644 --- a/engines/lab/processroom.cpp +++ b/engines/lab/processroom.cpp @@ -85,10 +85,10 @@ ViewData *getViewData(uint16 roomNum, uint16 direction) { ViewData *view = g_lab->_rooms[roomNum]._view[direction]; do { - if (checkConditions(view->Condition)) + if (checkConditions(view->_condition)) break; - view = view->NextCondition; + view = view->_nextCondition; } while (true); return view; @@ -99,9 +99,9 @@ ViewData *getViewData(uint16 roomNum, uint16 direction) { /*****************************************************************************/ static CloseData *getObject(uint16 x, uint16 y, CloseDataPtr lcptr) { if (lcptr == NULL) { - lcptr = getViewData(g_lab->_roomNum, g_lab->_direction)->closeUps; + lcptr = getViewData(g_lab->_roomNum, g_lab->_direction)->_closeUps; } else { - lcptr = lcptr->SubCloseUps; + lcptr = lcptr->_subCloseUps; } while (lcptr != NULL) { @@ -109,7 +109,7 @@ static CloseData *getObject(uint16 x, uint16 y, CloseDataPtr lcptr) { (x <= g_lab->_graphics->scaleX(lcptr->x2)) && (y <= g_lab->_graphics->scaleY(lcptr->y2))) return lcptr; - lcptr = lcptr->NextCloseUp; + lcptr = lcptr->_nextCloseUp; } return NULL; @@ -127,15 +127,15 @@ static CloseDataPtr findCPtrMatch(CloseDataPtr cpmain, CloseDataPtr list) { while (list) { if ((cpmain->x1 == list->x1) && (cpmain->x2 == list->x2) && (cpmain->y1 == list->y1) && (cpmain->y2 == list->y2) && - (cpmain->depth == list->depth)) + (cpmain->_depth == list->_depth)) return list; - cptr = findCPtrMatch(cpmain, list->SubCloseUps); + cptr = findCPtrMatch(cpmain, list->_subCloseUps); if (cptr) return cptr; else - list = list->NextCloseUp; + list = list->_nextCloseUp; } return NULL; @@ -148,21 +148,21 @@ char *getPictName(CloseDataPtr *lcptr) { ViewData *viewPtr = getViewData(g_lab->_roomNum, g_lab->_direction); if (*lcptr != NULL) { - *lcptr = findCPtrMatch(*lcptr, viewPtr->closeUps); + *lcptr = findCPtrMatch(*lcptr, viewPtr->_closeUps); if (*lcptr) - return (*lcptr)->GraphicName; + return (*lcptr)->_graphicName; } - return viewPtr->GraphicName; + return viewPtr->_graphicName; } /*****************************************************************************/ /* Draws the current direction to the screen. */ /*****************************************************************************/ void LabEngine::drawDirection(CloseDataPtr lcptr) { - if (lcptr != NULL && lcptr->Message) { - _graphics->drawMessage(lcptr->Message); + if (lcptr != NULL && lcptr->_message) { + _graphics->drawMessage(lcptr->_message); return; } @@ -236,9 +236,9 @@ void setCurClose(Common::Point pos, CloseDataPtr *cptr, bool useAbsoluteCoords) uint16 x1, y1, x2, y2; if (*cptr == NULL) { - lcptr = getViewData(g_lab->_roomNum, g_lab->_direction)->closeUps; + lcptr = getViewData(g_lab->_roomNum, g_lab->_direction)->_closeUps; } else - lcptr = (*cptr)->SubCloseUps; + lcptr = (*cptr)->_subCloseUps; while (lcptr != NULL) { if (!useAbsoluteCoords) { @@ -253,12 +253,12 @@ void setCurClose(Common::Point pos, CloseDataPtr *cptr, bool useAbsoluteCoords) y2 = g_lab->_graphics->scaleY(lcptr->y2); } - if (pos.x >= x1 && pos.y >= y1 && pos.x <= x2 && pos.y <= y2 && lcptr->GraphicName) { + if (pos.x >= x1 && pos.y >= y1 && pos.x <= x2 && pos.y <= y2 && lcptr->_graphicName) { *cptr = lcptr; return; } - lcptr = lcptr->NextCloseUp; + lcptr = lcptr->_nextCloseUp; } } @@ -269,23 +269,23 @@ bool takeItem(uint16 x, uint16 y, CloseDataPtr *cptr) { CloseDataPtr lcptr; if (*cptr == NULL) { - lcptr = getViewData(g_lab->_roomNum, g_lab->_direction)->closeUps; - } else if ((*cptr)->CloseUpType < 0) { - g_lab->_conditions->inclElement(abs((*cptr)->CloseUpType)); + lcptr = getViewData(g_lab->_roomNum, g_lab->_direction)->_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 >= g_lab->_graphics->scaleX(lcptr->x1)) && (y >= g_lab->_graphics->scaleY(lcptr->y1)) && (x <= g_lab->_graphics->scaleX(lcptr->x2)) && (y <= g_lab->_graphics->scaleY(lcptr->y2)) && - (lcptr->CloseUpType < 0)) { - g_lab->_conditions->inclElement(abs(lcptr->CloseUpType)); + (lcptr->_closeUpType < 0)) { + g_lab->_conditions->inclElement(abs(lcptr->_closeUpType)); return true; } - lcptr = lcptr->NextCloseUp; + lcptr = lcptr->_nextCloseUp; } return false; @@ -298,42 +298,42 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) { while (aptr) { _music->updateMusic(); - switch (aptr->ActionType) { + switch (aptr->_actionType) { case PLAYSOUND: _music->_loopSoundEffect = false; _music->_waitTillFinished = true; - _music->readMusic((char *)aptr->Data, true); + _music->readMusic((char *)aptr->_data, true); _music->_waitTillFinished = false; break; case PLAYSOUNDB: _music->_loopSoundEffect = false; _music->_waitTillFinished = false; - _music->readMusic((char *)aptr->Data, false); + _music->readMusic((char *)aptr->_data, false); break; case PLAYSOUNDCONT: _music->_doNotFilestopSoundEffect = true; _music->_loopSoundEffect = true; - _music->readMusic((char *)aptr->Data, _music->_waitTillFinished); + _music->readMusic((char *)aptr->_data, _music->_waitTillFinished); break; case SHOWDIFF: - _graphics->readPict((char *)aptr->Data, true); + _graphics->readPict((char *)aptr->_data, true); break; case SHOWDIFFCONT: - _graphics->readPict((char *)aptr->Data, false); + _graphics->readPict((char *)aptr->_data, false); break; case LOADDIFF: - if (aptr->Data) - _graphics->loadPict((char *)aptr->Data); /* Puts a file into memory */ + if (aptr->_data) + _graphics->loadPict((char *)aptr->_data); /* Puts a file into memory */ break; case WIPECMD: - _graphics->doWipe(aptr->Param1, lcptr, (char *)aptr->Data); + _graphics->doWipe(aptr->_param1, lcptr, (char *)aptr->_data); break; case NOUPDATE: @@ -356,20 +356,20 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) { break; case SETELEMENT: - _conditions->inclElement(aptr->Param1); + _conditions->inclElement(aptr->_param1); break; case UNSETELEMENT: - _conditions->exclElement(aptr->Param1); + _conditions->exclElement(aptr->_param1); break; case SHOWMESSAGE: _graphics->_doNotDrawMessage = false; if (_graphics->_longWinInFront) - _graphics->longDrawMessage((char *)aptr->Data); + _graphics->longDrawMessage((char *)aptr->_data); else - _graphics->drawMessage((char *)aptr->Data); + _graphics->drawMessage((char *)aptr->_data); _graphics->_doNotDrawMessage = true; break; @@ -377,22 +377,22 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) { case CSHOWMESSAGE: if (*lcptr == NULL) { _graphics->_doNotDrawMessage = false; - _graphics->drawMessage((char *)aptr->Data); + _graphics->drawMessage((char *)aptr->_data); _graphics->_doNotDrawMessage = true; } break; case SHOWMESSAGES: { - char **str = (char **)aptr->Data; + char **str = (char **)aptr->_data; _graphics->_doNotDrawMessage = false; - _graphics->drawMessage(str[getRandom(aptr->Param1)]); + _graphics->drawMessage(str[getRandom(aptr->_param1)]); _graphics->_doNotDrawMessage = true; } break; case SETPOSITION: - if (aptr->Param1 & 0x8000) { + 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 _graphics->readPict(getPictName(lcptr), true); @@ -402,14 +402,14 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) { continue; } - _roomNum = aptr->Param1; - _direction = aptr->Param2 - 1; + _roomNum = aptr->_param1; + _direction = aptr->_param2 - 1; *lcptr = NULL; _anim->_doBlack = true; break; case SETCLOSEUP: { - CloseDataPtr tlcptr = getObject(g_lab->_graphics->scaleX(aptr->Param1), g_lab->_graphics->scaleY(aptr->Param2), *lcptr); + CloseDataPtr tlcptr = getObject(g_lab->_graphics->scaleX(aptr->_param1), g_lab->_graphics->scaleY(aptr->_param2), *lcptr); if (tlcptr) *lcptr = tlcptr; @@ -421,17 +421,17 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) { break; case SUBINV: - if (_inventory[aptr->Param1].Many) - (_inventory[aptr->Param1].Many)--; + if (_inventory[aptr->_param1]._many) + (_inventory[aptr->_param1]._many)--; - if (_inventory[aptr->Param1].Many == 0) - _conditions->exclElement(aptr->Param1); + if (_inventory[aptr->_param1]._many == 0) + _conditions->exclElement(aptr->_param1); break; case ADDINV: - (_inventory[aptr->Param1].Many) += aptr->Param2; - _conditions->inclElement(aptr->Param1); + (_inventory[aptr->_param1]._many) += aptr->_param2; + _conditions->inclElement(aptr->_param1); break; case SHOWDIR: @@ -441,7 +441,7 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) { case WAITSECS: { uint32 startSecs, startMicros, curSecs, curMicros; - addCurTime(aptr->Param1, 0, &startSecs, &startMicros); + addCurTime(aptr->_param1, 0, &startSecs, &startMicros); _graphics->screenUpdate(); @@ -466,7 +466,7 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) { break; case CHANGEMUSIC: - _music->changeMusic((const char *)aptr->Data); + _music->changeMusic((const char *)aptr->_data); _music->setMusicReset(false); break; @@ -516,13 +516,13 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) { break; case SPECIALCMD: - if (aptr->Param1 == 0) + if (aptr->_param1 == 0) _anim->_doBlack = true; - else if (aptr->Param1 == 1) + else if (aptr->_param1 == 1) _anim->_doBlack = (_cptr == NULL); - else if (aptr->Param1 == 2) + else if (aptr->_param1 == 2) _anim->_doBlack = (_cptr != NULL); - else if (aptr->Param1 == 5) { /* inverse the palette */ + else if (aptr->_param1 == 5) { /* inverse the palette */ for (uint16 idx = (8 * 3); idx < (255 * 3); idx++) _anim->_diffPalette[idx] = 255 - _anim->_diffPalette[idx]; @@ -530,16 +530,16 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) { _graphics->setPalette(_anim->_diffPalette, 256); waitTOF(); waitTOF(); - } else if (aptr->Param1 == 4) { /* white the palette */ + } else if (aptr->_param1 == 4) { /* white the palette */ _graphics->whiteScreen(); waitTOF(); waitTOF(); - } else if (aptr->Param1 == 6) { /* Restore the palette */ + } else if (aptr->_param1 == 6) { /* Restore the palette */ waitTOF(); _graphics->setPalette(_anim->_diffPalette, 256); waitTOF(); waitTOF(); - } else if (aptr->Param1 == 7) { /* Quick pause */ + } else if (aptr->_param1 == 7) { /* Quick pause */ waitTOF(); waitTOF(); waitTOF(); @@ -548,7 +548,7 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) { break; } - aptr = aptr->NextAction; + aptr = aptr->_nextAction; } if (_music->_loopSoundEffect) { @@ -580,14 +580,14 @@ 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) || - (((*rule)->Param2 == 0) && allowDefaults)) + if (((*rule)->_ruleType == ACTION) && + (((*rule)->_param1 == action) || (((*rule)->_param1 == 0) && allowDefaults))) { + if ((((*rule)->_param2 == lcptr->_closeUpType) || + (((*rule)->_param2 == 0) && allowDefaults)) || - ((action == 1) && ((*rule)->Param2 == (-lcptr->CloseUpType)))) { - if (checkConditions((*rule)->Condition)) { - g_lab->doActions((*rule)->ActionList, set); + ((action == 1) && ((*rule)->_param2 == (-lcptr->_closeUpType)))) { + if (checkConditions((*rule)->_condition)) { + g_lab->doActions((*rule)->_actionList, set); return true; } } @@ -626,7 +626,7 @@ bool doActionRule(Common::Point pos, int16 action, int16 roomNum, CloseDataPtr * /*****************************************************************************/ static bool doOperateRuleSub(int16 itemNum, int16 roomNum, CloseDataPtr lcptr, CloseDataPtr *set, bool allowDefaults) { if (lcptr) - if (lcptr->CloseUpType > 0) { + if (lcptr->_closeUpType > 0) { RuleList *rules = g_lab->_rooms[roomNum]._rules; if ((rules == NULL) && (roomNum == 0)) { @@ -635,11 +635,11 @@ 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))) { - if (checkConditions((*rule)->Condition)) { - g_lab->doActions((*rule)->ActionList, set); + if (((*rule)->_ruleType == OPERATE) && + (((*rule)->_param1 == itemNum) || (((*rule)->_param1 == 0) && allowDefaults)) && + (((*rule)->_param2 == lcptr->_closeUpType) || (((*rule)->_param2 == 0) && allowDefaults))) { + if (checkConditions((*rule)->_condition)) { + g_lab->doActions((*rule)->_actionList, set); return true; } } @@ -690,9 +690,9 @@ bool doGoForward(CloseDataPtr *lcptr) { RuleList *rules = g_lab->_rooms[g_lab->_roomNum]._rules; for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) { - if (((*rule)->RuleType == GOFORWARD) && ((*rule)->Param1 == (g_lab->_direction + 1))) { - if (checkConditions((*rule)->Condition)) { - g_lab->doActions((*rule)->ActionList, lcptr); + if (((*rule)->_ruleType == GOFORWARD) && ((*rule)->_param1 == (g_lab->_direction + 1))) { + if (checkConditions((*rule)->_condition)) { + g_lab->doActions((*rule)->_actionList, lcptr); return true; } } @@ -711,11 +711,11 @@ bool doTurn(uint16 from, uint16 to, CloseDataPtr *lcptr) { RuleList *rules = g_lab->_rooms[g_lab->_roomNum]._rules; for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) { - if (((*rule)->RuleType == TURN) || - (((*rule)->RuleType == TURNFROMTO) && - ((*rule)->Param1 == from) && ((*rule)->Param2 == to))) { - if (checkConditions((*rule)->Condition)) { - g_lab->doActions((*rule)->ActionList, lcptr); + if (((*rule)->_ruleType == TURN) || + (((*rule)->_ruleType == TURNFROMTO) && + ((*rule)->_param1 == from) && ((*rule)->_param2 == to))) { + if (checkConditions((*rule)->_condition)) { + g_lab->doActions((*rule)->_actionList, lcptr); return true; } } @@ -730,9 +730,9 @@ bool doTurn(uint16 from, uint16 to, CloseDataPtr *lcptr) { bool doMainView(CloseDataPtr *lcptr) { RuleList *rules = g_lab->_rooms[g_lab->_roomNum]._rules; for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) { - if ((*rule)->RuleType == GOMAINVIEW) { - if (checkConditions((*rule)->Condition)) { - g_lab->doActions((*rule)->ActionList, lcptr); + if ((*rule)->_ruleType == GOMAINVIEW) { + if (checkConditions((*rule)->_condition)) { + g_lab->doActions((*rule)->_actionList, lcptr); return true; } } diff --git a/engines/lab/resource.cpp b/engines/lab/resource.cpp index c8aea6361c..538b6f6023 100644 --- a/engines/lab/resource.cpp +++ b/engines/lab/resource.cpp @@ -120,9 +120,9 @@ InventoryData *Resource::readInventory(const char *fileName) { InventoryData *inventory = (InventoryData *)malloc((_vm->_numInv + 1) * sizeof(InventoryData)); for (uint16 i = 1; i <= _vm->_numInv; i++) { - inventory[i].Many = dataFile->readUint16LE(); - inventory[i].name = readString(dataFile); - inventory[i].BInvName = readString(dataFile); + inventory[i]._many = dataFile->readUint16LE(); + inventory[i]._name = readString(dataFile); + inventory[i]._bitmapName = readString(dataFile); } delete dataFile; @@ -232,11 +232,11 @@ RuleList *Resource::readRule(Common::File *file) { if (c == 1) { Rule *rule = new Rule();; - rule->RuleType = file->readSint16LE(); - rule->Param1 = file->readSint16LE(); - rule->Param2 = file->readSint16LE(); - rule->Condition = readConditions(file); - rule->ActionList = readAction(file); + rule->_ruleType = file->readSint16LE(); + rule->_param1 = file->readSint16LE(); + rule->_param2 = file->readSint16LE(); + rule->_condition = readConditions(file); + rule->_actionList = readAction(file); rules->push_back(rule); } } while (c == 1); @@ -259,24 +259,24 @@ Action *Resource::readAction(Common::File *file) { if (!head) head = action; if (prev) - prev->NextAction = action; - action->ActionType = file->readSint16LE(); - action->Param1 = file->readSint16LE(); - action->Param2 = file->readSint16LE(); - action->Param3 = file->readSint16LE(); + prev->_nextAction = action; + action->_actionType = file->readSint16LE(); + action->_param1 = file->readSint16LE(); + action->_param2 = file->readSint16LE(); + action->_param3 = file->readSint16LE(); - if (action->ActionType == SHOWMESSAGES) { - messages = (char **)malloc(action->Param1 * 4); + if (action->_actionType == SHOWMESSAGES) { + messages = (char **)malloc(action->_param1 * 4); - for (int i = 0; i < action->Param1; i++) + for (int i = 0; i < action->_param1; i++) messages[i] = readString(file); - action->Data = (byte *)messages; + action->_data = (byte *)messages; } else { - action->Data = (byte *)readString(file); + action->_data = (byte *)readString(file); } - action->NextAction = NULL; + action->_nextAction = NULL; prev = action; } } while (c == 1); @@ -298,17 +298,17 @@ CloseData *Resource::readCloseUps(uint16 depth, Common::File *file) { if (!head) head = closeup; if (prev) - prev->NextCloseUp = closeup; + prev->_nextCloseUp = closeup; closeup->x1 = file->readUint16LE(); closeup->y1 = file->readUint16LE(); closeup->x2 = file->readUint16LE(); closeup->y2 = file->readUint16LE(); - closeup->CloseUpType = file->readSint16LE(); - closeup->depth = depth; - closeup->GraphicName = readString(file); - closeup->Message = readString(file); - closeup->SubCloseUps = readCloseUps(depth + 1, file); - closeup->NextCloseUp = NULL; + closeup->_closeUpType = file->readSint16LE(); + closeup->_depth = depth; + closeup->_graphicName = readString(file); + closeup->_message = readString(file); + closeup->_subCloseUps = readCloseUps(depth + 1, file); + closeup->_nextCloseUp = NULL; prev = closeup; } } while (c != '\0'); @@ -330,11 +330,11 @@ ViewData *Resource::readView(Common::File *file) { if (!head) head = view; if (prev) - prev->NextCondition = view; - view->Condition = readConditions(file); - view->GraphicName = readString(file); - view->closeUps = readCloseUps(0, file); - view->NextCondition = NULL; + prev->_nextCondition = view; + view->_condition = readConditions(file); + view->_graphicName = readString(file); + view->_closeUps = readCloseUps(0, file); + view->_nextCondition = NULL; prev = view; } } while (c == 1); diff --git a/engines/lab/savegame.cpp b/engines/lab/savegame.cpp index 133e4b1d70..b28d1a2652 100644 --- a/engines/lab/savegame.cpp +++ b/engines/lab/savegame.cpp @@ -128,7 +128,7 @@ bool saveGame(uint16 Direction, uint16 Quarters, int slot, Common::String desc) return false; // Load scene pic - CloseDataPtr cPtr = NULL; + CloseDataPtr cPtr = nullptr; g_lab->_graphics->readPict(getPictName(&cPtr), true); writeSaveGameHeader(file, desc); diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp index 8afeeeadc6..f4c8439a57 100644 --- a/engines/lab/special.cpp +++ b/engines/lab/special.cpp @@ -435,14 +435,14 @@ bool LabEngine::saveRestoreGame() { desc = dialog->createDefaultSaveDescription(slot); } - isOK = saveGame(_direction, _inventory[QUARTERNUM].Many, slot, desc); + isOK = saveGame(_direction, _inventory[QUARTERNUM]._many, slot, desc); } } else { // Restore GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false); int slot = dialog->runModalWithCurrentTarget(); if (slot >= 0) { - isOK = loadGame(&_direction, &(_inventory[QUARTERNUM].Many), slot); + isOK = loadGame(&_direction, &(_inventory[QUARTERNUM]._many), slot); if (isOK) _music->resetMusic(); } @@ -534,7 +534,7 @@ void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isintera if (_cptr == startcptr) Test = StartFileName; else - Test = _cptr->GraphicName; + Test = _cptr->_graphicName; if (strcmp(Test, TextFileName)) { monitorPage = 0; -- cgit v1.2.3