diff options
author | Strangerke | 2015-12-03 01:06:04 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:33:47 +0100 |
commit | 8fa64824a2dc1b5b2470f2ae4830f5573f5d01df (patch) | |
tree | 2870d7053ed408ccc35369deeb68bc952c369516 /engines | |
parent | 1d13083b29c3b4bd3e1423a4cbdc6dc32a50de22 (diff) | |
download | scummvm-rg350-8fa64824a2dc1b5b2470f2ae4830f5573f5d01df.tar.gz scummvm-rg350-8fa64824a2dc1b5b2470f2ae4830f5573f5d01df.tar.bz2 scummvm-rg350-8fa64824a2dc1b5b2470f2ae4830f5573f5d01df.zip |
LAB: Some renaming, move a couple of variables to game engine
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lab/detection.cpp | 6 | ||||
-rw-r--r-- | engines/lab/engine.cpp | 373 | ||||
-rw-r--r-- | engines/lab/graphics.cpp | 9 | ||||
-rw-r--r-- | engines/lab/interface.cpp | 14 | ||||
-rw-r--r-- | engines/lab/interface.h | 2 | ||||
-rw-r--r-- | engines/lab/lab.cpp | 14 | ||||
-rw-r--r-- | engines/lab/lab.h | 11 | ||||
-rw-r--r-- | engines/lab/labfun.h | 8 | ||||
-rw-r--r-- | engines/lab/map.cpp | 12 | ||||
-rw-r--r-- | engines/lab/mouse.cpp | 12 | ||||
-rw-r--r-- | engines/lab/parsetypes.h | 2 | ||||
-rw-r--r-- | engines/lab/processroom.cpp | 18 | ||||
-rw-r--r-- | engines/lab/savegame.cpp | 14 | ||||
-rw-r--r-- | engines/lab/special.cpp | 12 |
14 files changed, 244 insertions, 263 deletions
diff --git a/engines/lab/detection.cpp b/engines/lab/detection.cpp index ddb6aa32a8..3b01d77568 100644 --- a/engines/lab/detection.cpp +++ b/engines/lab/detection.cpp @@ -194,7 +194,7 @@ SaveStateList LabMetaEngine::listSaves(const char *target) const { Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); if (in) { if (Lab::readSaveGameHeader(in, header)) - saveList.push_back(SaveStateDescriptor(slotNum, header.desc.getDescription())); + saveList.push_back(SaveStateDescriptor(slotNum, header._descr.getDescription())); delete in; } } @@ -242,13 +242,13 @@ SaveStateDescriptor LabMetaEngine::querySaveMetaInfos(const char *target, int sl delete in; if (successfulRead) { - SaveStateDescriptor desc(slot, header.desc.getDescription()); + SaveStateDescriptor desc(slot, header._descr.getDescription()); // Do not allow save slot 0 (used for auto-saving) to be deleted or // overwritten. //desc.setDeletableFlag(slot != 0); //desc.setWriteProtectedFlag(slot == 0); - return header.desc; + return header._descr; } } diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index ba9e4921c9..fe3c4284df 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -41,8 +41,6 @@ namespace Lab { -const char *CurFileName = " "; - bool LongWinInFront = false; TextFont *MsgFont; @@ -56,10 +54,7 @@ extern InventoryData *Inventory; extern uint16 NumInv, ManyRooms, HighestCondition, Direction; CloseDataPtr CPtr; -bool Alternate = false, ispal = false, noupdatediff = false, MainDisplay = true, QuitLab = false; - -extern const char *NewFileName; /* When ProcessRoom.c decides to change the filename - of the current picture. */ +bool ispal = false, noupdatediff = false, MainDisplay = true, QuitLab = false; #define BUFFERSIZE 850000L @@ -100,11 +95,6 @@ extern const char *NewFileName; /* When ProcessRoom.c decides to change the fil #define TERMINALMONITOR 81 #define LEVERSMONITOR 82 - -static Image *MoveImages[20], *InvImages[10]; -static Gadget *MoveGadgetList, *InvGadgetList; - - static char initcolors[] = { '\x00', '\x00', '\x00', '\x30', '\x30', '\x30', '\x10', '\x10', '\x10', '\x14', '\x14', '\x14', @@ -112,9 +102,6 @@ static char initcolors[] = { '\x00', '\x00', '\x00', '\x30', '\x24', '\x24', '\x2c', '\x2c', '\x2c', '\x08', '\x08', '\x08'}; - - - /******************************************************************************/ /* Draws the control panel display. */ /******************************************************************************/ @@ -133,10 +120,10 @@ void LabEngine::drawPanel() { setAPen(0); drawHLine(0, VGAScaleY(170), VGAScaleX(319)); /* First black line to separate buttons */ - if (!Alternate) { + if (!_alternate) { setAPen(4); drawHLine(0, VGAScaleY(170) + 1, VGAScaleX(319)); /* The horizontal lines under the black one */ - drawGadgetList(MoveGadgetList); + drawGadgetList(_moveGadgetList); } else { if (getPlatform() != Common::kPlatformWindows) { drawVLine(VGAScaleX(124), VGAScaleY(170) + 1, VGAScaleY(199)); /* Vertical Black lines */ @@ -162,7 +149,7 @@ void LabEngine::drawPanel() { drawVLine(VGAScaleX(232), VGAScaleY(170) + 2, VGAScaleY(198)); } - drawGadgetList(InvGadgetList); + drawGadgetList(_invGadgetList); } _event->mouseShow(); @@ -171,38 +158,32 @@ void LabEngine::drawPanel() { /******************************************************************************/ /* Draws the message for the room. */ /******************************************************************************/ -void LabEngine::drawRoomMessage(uint16 CurInv, CloseDataPtr cptr) { +void LabEngine::drawRoomMessage(uint16 curInv, CloseDataPtr closePtr) { if (_lastTooLong) { _lastTooLong = false; return; } - if (Alternate) { - if ((CurInv <= NumInv) && _conditions->in(CurInv) && Inventory[CurInv].BInvName) { - if ((CurInv == LAMPNUM) && _conditions->in(LAMPON)) /* LAB: Labyrith specific */ + if (_alternate) { + if ((curInv <= NumInv) && _conditions->in(curInv) && Inventory[curInv].BInvName) { + 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) + ")"; drawMessage(roomMessage.c_str()); } else - drawMessage(Inventory[CurInv].name); + drawMessage(Inventory[curInv].name); } } else - drawDirection(cptr); + drawDirection(closePtr); _lastTooLong = _lastMessageLong; } - /******************************************************************************/ /* Sets up the Labyrinth screens, and opens up the initial windows. */ /******************************************************************************/ bool LabEngine::setUpScreens() { - byte *buffer; - byte *MovePanelBuffer, *InvPanelBuffer; - Gadget *curgad; - uint16 y; - if (!createScreen(_isHiRes)) return false; @@ -215,60 +196,61 @@ bool LabEngine::setUpScreens() { if (file.err() || file.size() == 0) return false; - if (!(MovePanelBuffer = (byte *)calloc(file.size(), 1))) + byte *movePanelBuffer; + if (!(movePanelBuffer = (byte *)calloc(file.size(), 1))) return false; - file.read(MovePanelBuffer, file.size()); + file.read(movePanelBuffer, file.size()); file.close(); - buffer = MovePanelBuffer; + byte *buffer = movePanelBuffer; for (uint16 i = 0; i < 20; i++) - MoveImages[i] = new Image(&buffer); + _moveImages[i] = new Image(&buffer); /* Creates the gadgets for the movement control panel */ - y = VGAScaleY(173) - SVGACord(2); + uint16 y = VGAScaleY(173) - SVGACord(2); if (getPlatform() == Common::kPlatformWindows) { - MoveGadgetList = createButton(1, y, 0, 't', MoveImages[0], MoveImages[1]); - curgad = MoveGadgetList; - curgad->NextGadget = createButton(33, y, 1, 'm', MoveImages[2], MoveImages[3]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(65, y, 2, 'o', MoveImages[4], MoveImages[5]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(97, y, 3, 'c', MoveImages[6], MoveImages[7]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(129, y, 4, 'l', MoveImages[8], MoveImages[9]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(161, y, 5, 'i', MoveImages[12], MoveImages[13]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(193, y, 6, VKEY_LTARROW, MoveImages[14], MoveImages[15]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(225, y, 7, VKEY_UPARROW, MoveImages[16], MoveImages[17]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(257, y, 8, VKEY_RTARROW, MoveImages[18], MoveImages[19]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(289, y, 9, 'p', MoveImages[10], MoveImages[11]); + _moveGadgetList = createButton(1, y, 0, 't', _moveImages[0], _moveImages[1]); + Gadget *curGadget = _moveGadgetList; + curGadget->NextGadget = createButton(33, y, 1, 'm', _moveImages[2], _moveImages[3]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(65, y, 2, 'o', _moveImages[4], _moveImages[5]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(97, y, 3, 'c', _moveImages[6], _moveImages[7]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(129, y, 4, 'l', _moveImages[8], _moveImages[9]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(161, y, 5, 'i', _moveImages[12], _moveImages[13]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(193, y, 6, VKEY_LTARROW, _moveImages[14], _moveImages[15]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(225, y, 7, VKEY_UPARROW, _moveImages[16], _moveImages[17]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(257, y, 8, VKEY_RTARROW, _moveImages[18], _moveImages[19]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(289, y, 9, 'p', _moveImages[10], _moveImages[11]); } else { - MoveGadgetList = createButton(1, y, 0, 0, MoveImages[0], MoveImages[1]); - curgad = MoveGadgetList; - curgad->NextGadget = createButton(33, y, 1, 0, MoveImages[2], MoveImages[3]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(65, y, 2, 0, MoveImages[4], MoveImages[5]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(97, y, 3, 0, MoveImages[6], MoveImages[7]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(129, y, 4, 0, MoveImages[8], MoveImages[9]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(161, y, 5, 0, MoveImages[12], MoveImages[13]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(193, y, 6, 0, MoveImages[14], MoveImages[15]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(225, y, 7, 0, MoveImages[16], MoveImages[17]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(257, y, 8, 0, MoveImages[18], MoveImages[19]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(289, y, 9, 0, MoveImages[10], MoveImages[11]); + _moveGadgetList = createButton(1, y, 0, 0, _moveImages[0], _moveImages[1]); + Gadget *curGadget = _moveGadgetList; + curGadget->NextGadget = createButton(33, y, 1, 0, _moveImages[2], _moveImages[3]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(65, y, 2, 0, _moveImages[4], _moveImages[5]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(97, y, 3, 0, _moveImages[6], _moveImages[7]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(129, y, 4, 0, _moveImages[8], _moveImages[9]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(161, y, 5, 0, _moveImages[12], _moveImages[13]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(193, y, 6, 0, _moveImages[14], _moveImages[15]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(225, y, 7, 0, _moveImages[16], _moveImages[17]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(257, y, 8, 0, _moveImages[18], _moveImages[19]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(289, y, 9, 0, _moveImages[10], _moveImages[11]); } file.open(translateFileName("P:Inv")); @@ -278,95 +260,89 @@ bool LabEngine::setUpScreens() { if (file.err() || file.size() == 0) return false; - if (!(InvPanelBuffer = (byte *)calloc(file.size(), 1))) + byte *invPanelBuffer; + if (!(invPanelBuffer = (byte *)calloc(file.size(), 1))) return false; - file.read(InvPanelBuffer, file.size()); + file.read(invPanelBuffer, file.size()); file.close(); - buffer = InvPanelBuffer; + buffer = invPanelBuffer; if (getPlatform() == Common::kPlatformWindows) { for (uint16 imgIdx = 0; imgIdx < 10; imgIdx++) - InvImages[imgIdx] = new Image(&buffer); - - InvGadgetList = createButton(24, y, 0, 'm', InvImages[0], InvImages[1]); - curgad = InvGadgetList; - curgad->NextGadget = createButton(56, y, 1, 'g', InvImages[2], InvImages[3]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(94, y, 2, 'u', InvImages[4], InvImages[5]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(126, y, 3, 'l', MoveImages[8], MoveImages[9]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(164, y, 4, VKEY_LTARROW, MoveImages[14], MoveImages[15]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(196, y, 5, VKEY_RTARROW, MoveImages[18], MoveImages[19]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(234, y, 6, 'b', InvImages[6], InvImages[7]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(266, y, 7, 'f', InvImages[8], InvImages[9]); - curgad = curgad->NextGadget; + _invImages[imgIdx] = new Image(&buffer); + + _invGadgetList = createButton(24, y, 0, 'm', _invImages[0], _invImages[1]); + Gadget *curGadget = _invGadgetList; + curGadget->NextGadget = createButton(56, y, 1, 'g', _invImages[2], _invImages[3]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(94, y, 2, 'u', _invImages[4], _invImages[5]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(126, y, 3, 'l', _moveImages[8], _moveImages[9]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(164, y, 4, VKEY_LTARROW, _moveImages[14], _moveImages[15]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(196, y, 5, VKEY_RTARROW, _moveImages[18], _moveImages[19]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(234, y, 6, 'b', _invImages[6], _invImages[7]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(266, y, 7, 'f', _invImages[8], _invImages[9]); + curGadget = curGadget->NextGadget; } else { for (uint16 imgIdx = 0; imgIdx < 6; imgIdx++) - InvImages[imgIdx] = new Image(&buffer); - - InvGadgetList = createButton(58, y, 0, 0, InvImages[0], InvImages[1]); - curgad = InvGadgetList; - curgad->NextGadget = createButton(90, y, 1, 0, InvImages[2], InvImages[3]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(128, y, 2, 0, InvImages[4], InvImages[5]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(160, y, 3, 0, MoveImages[8], MoveImages[9]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(198, y, 4, 0, MoveImages[14], MoveImages[15]); - curgad = curgad->NextGadget; - curgad->NextGadget = createButton(230, y, 5, 0, MoveImages[18], MoveImages[19]); - curgad = curgad->NextGadget; + _invImages[imgIdx] = new Image(&buffer); + + _invGadgetList = createButton(58, y, 0, 0, _invImages[0], _invImages[1]); + Gadget *curGadget = _invGadgetList; + curGadget->NextGadget = createButton(90, y, 1, 0, _invImages[2], _invImages[3]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(128, y, 2, 0, _invImages[4], _invImages[5]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(160, y, 3, 0, _moveImages[8], _moveImages[9]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(198, y, 4, 0, _moveImages[14], _moveImages[15]); + curGadget = curGadget->NextGadget; + curGadget->NextGadget = createButton(230, y, 5, 0, _moveImages[18], _moveImages[19]); + curGadget = curGadget->NextGadget; } return true; } - - /******************************************************************************/ -/* Permanently flips the imagry of a gadget. */ +/* Permanently flips the imagery of a gadget. */ /******************************************************************************/ -void LabEngine::perFlipGadget(uint16 GadID) { - Image *Temp; - Gadget *TopGad; - - TopGad = MoveGadgetList; +void LabEngine::perFlipGadget(uint16 gadgetId) { + Gadget *topGadget = _moveGadgetList; - while (TopGad) { - if (TopGad->GadgetID == GadID) { - Temp = TopGad->Im; - TopGad->Im = TopGad->ImAlt; - TopGad->ImAlt = Temp; + while (topGadget) { + if (topGadget->GadgetID == gadgetId) { + Image *tmpImage = topGadget->_image; + topGadget->_image = topGadget->_altImage; + topGadget->_altImage = tmpImage; - if (!Alternate) { + if (!_alternate) { _event->mouseHide(); - TopGad->Im->drawImage(TopGad->x, TopGad->y); + topGadget->_image->drawImage(topGadget->x, topGadget->y); _event->mouseShow(); } return; } else - TopGad = TopGad->NextGadget; + topGadget = topGadget->NextGadget; } } - - /******************************************************************************/ /* Eats all the available messages. */ /******************************************************************************/ void LabEngine::eatMessages() { - IntuiMessage *Msg; + IntuiMessage *msg; do { - Msg = getMsg(); - } while (Msg); + msg = getMsg(); + } while (msg); return; } @@ -374,8 +350,8 @@ void LabEngine::eatMessages() { /******************************************************************************/ /* Checks whether the close up is one of the special case closeups. */ /******************************************************************************/ -bool LabEngine::doCloseUp(CloseDataPtr cptr) { - if (cptr == NULL) +bool LabEngine::doCloseUp(CloseDataPtr closePtr) { + if (closePtr == NULL) return false; int monltmargin, monrtmargin, montopmargin, lutertmargin; @@ -392,46 +368,43 @@ bool LabEngine::doCloseUp(CloseDataPtr cptr) { lutertmargin = 128; } - switch (cptr->CloseUpType) { + switch (closePtr->CloseUpType) { case MUSEUMMONITOR: case LIBRARYMONITOR: case WINDOWMONITOR: - doMonitor(cptr->GraphicName, cptr->Message, false, monltmargin, montopmargin, monrtmargin, 165); + doMonitor(closePtr->GraphicName, closePtr->Message, false, monltmargin, montopmargin, monrtmargin, 165); break; case GRAMAPHONEMONITOR: - doMonitor(cptr->GraphicName, cptr->Message, false, monltmargin, montopmargin, 171, 165); + doMonitor(closePtr->GraphicName, closePtr->Message, false, monltmargin, montopmargin, 171, 165); break; case UNICYCLEMONITOR: - doMonitor(cptr->GraphicName, cptr->Message, false, 100, montopmargin, monrtmargin, 165); + doMonitor(closePtr->GraphicName, closePtr->Message, false, 100, montopmargin, monrtmargin, 165); break; case STATUEMONITOR: - doMonitor(cptr->GraphicName, cptr->Message, false, 117, montopmargin, monrtmargin, 165); + doMonitor(closePtr->GraphicName, closePtr->Message, false, 117, montopmargin, monrtmargin, 165); break; case TALISMANMONITOR: - doMonitor(cptr->GraphicName, cptr->Message, false, monltmargin, montopmargin, 184, 165); + doMonitor(closePtr->GraphicName, closePtr->Message, false, monltmargin, montopmargin, 184, 165); break; case LUTEMONITOR: - doMonitor(cptr->GraphicName, cptr->Message, false, monltmargin, montopmargin, lutertmargin, 165); + doMonitor(closePtr->GraphicName, closePtr->Message, false, monltmargin, montopmargin, lutertmargin, 165); break; case CLOCKMONITOR: - doMonitor(cptr->GraphicName, cptr->Message, false, monltmargin, montopmargin, 206, 165); + doMonitor(closePtr->GraphicName, closePtr->Message, false, monltmargin, montopmargin, 206, 165); break; case TERMINALMONITOR: - doMonitor(cptr->GraphicName, cptr->Message, true, monltmargin, montopmargin, monrtmargin, 165); + doMonitor(closePtr->GraphicName, closePtr->Message, true, monltmargin, montopmargin, monrtmargin, 165); break; default: return false; } - CurFileName = " "; + _curFileName = " "; drawPanel(); return true; } - - - /******************************************************************************/ /* Gets the current inventory name. */ /******************************************************************************/ @@ -442,21 +415,19 @@ static const char *getInvName(uint16 CurInv) { if ((CurInv == LAMPNUM) && g_lab->_conditions->in(LAMPON)) return "P:Mines/120"; - else if ((CurInv == BELTNUM) && g_lab->_conditions->in(BELTGLOW)) + if ((CurInv == BELTNUM) && g_lab->_conditions->in(BELTGLOW)) return "P:Future/BeltGlow"; - else if (CurInv == WESTPAPERNUM) { - CurFileName = Inventory[CurInv].BInvName; + if (CurInv == WESTPAPERNUM) { + g_lab->_curFileName = Inventory[CurInv].BInvName; g_lab->_anim->_noPalChange = true; - readPict(CurFileName, false); + readPict(g_lab->_curFileName, false); g_lab->_anim->_noPalChange = false; doWestPaper(); - } - - else if (CurInv == NOTESNUM) { - CurFileName = Inventory[CurInv].BInvName; + } else if (CurInv == NOTESNUM) { + g_lab->_curFileName = Inventory[CurInv].BInvName; g_lab->_anim->_noPalChange = true; - readPict(CurFileName, false); + readPict(g_lab->_curFileName, false); g_lab->_anim->_noPalChange = false; doNotes(); } @@ -464,16 +435,14 @@ static const char *getInvName(uint16 CurInv) { return Inventory[CurInv].BInvName; } -static bool interfaceisoff = false; - /******************************************************************************/ /* Turns the interface off. */ /******************************************************************************/ void LabEngine::interfaceOff() { - if (!interfaceisoff) { + if (!_interfaceOff) { _event->attachGadgetList(NULL); _event->mouseHide(); - interfaceisoff = true; + _interfaceOff = true; } } @@ -481,22 +450,19 @@ void LabEngine::interfaceOff() { /* Turns the interface on. */ /******************************************************************************/ void LabEngine::interfaceOn() { - if (interfaceisoff) { - interfaceisoff = false; - + if (_interfaceOff) { + _interfaceOff = false; _event->mouseShow(); } if (LongWinInFront) _event->attachGadgetList(NULL); - else if (Alternate) - _event->attachGadgetList(InvGadgetList); + else if (_alternate) + _event->attachGadgetList(_invGadgetList); else - _event->attachGadgetList(MoveGadgetList); + _event->attachGadgetList(_moveGadgetList); } -static const char *Test; - /******************************************************************************/ /* If the user hits the "Use" gadget; things that can get used on themselves. */ /******************************************************************************/ @@ -505,7 +471,7 @@ bool LabEngine::doUse(uint16 CurInv) { drawStaticMessage(kTextUseMap); interfaceOff(); _anim->stopDiff(); - CurFileName = " "; + _curFileName = " "; CPtr = NULL; doMap(_roomNum); setPalette(initcolors, 8); @@ -515,7 +481,7 @@ bool LabEngine::doUse(uint16 CurInv) { drawStaticMessage(kTextUseJournal); interfaceOff(); _anim->stopDiff(); - CurFileName = " "; + _curFileName = " "; CPtr = NULL; doJournal(); drawPanel(); @@ -537,13 +503,13 @@ bool LabEngine::doUse(uint16 CurInv) { _anim->_waitForEffect = false; _anim->_doBlack = false; - Test = getInvName(CurInv); + _nextFileName = getInvName(CurInv); } else if (CurInv == BELTNUM) { /* LAB: Labyrinth specific */ if (!_conditions->in(BELTGLOW)) _conditions->inclElement(BELTGLOW); _anim->_doBlack = false; - Test = getInvName(CurInv); + _nextFileName = getInvName(CurInv); } else if (CurInv == WHISKEYNUM) { /* LAB: Labyrinth specific */ _conditions->inclElement(USEDHELMET); drawStaticMessage(kTextUseWhiskey); @@ -559,9 +525,6 @@ bool LabEngine::doUse(uint16 CurInv) { return true; } - - - /******************************************************************************/ /* Decrements the current inventory number. */ /******************************************************************************/ @@ -575,7 +538,7 @@ void LabEngine::decIncInv(uint16 *CurInv, bool dec) { while (*CurInv && (*CurInv <= NumInv)) { if (_conditions->in(*CurInv) && Inventory[*CurInv].BInvName) { - Test = getInvName(*CurInv); + _nextFileName = getInvName(*CurInv); break; } @@ -593,7 +556,7 @@ void LabEngine::decIncInv(uint16 *CurInv, bool dec) { while (*CurInv && (*CurInv <= NumInv)) { if (_conditions->in(*CurInv) && Inventory[*CurInv].BInvName) { - Test = getInvName(*CurInv); + _nextFileName = getInvName(*CurInv); break; } @@ -660,32 +623,30 @@ void LabEngine::mainGameLoop() { /* Sets the current picture properly on the screen */ if (MainDisplay) - Test = getPictName(&CPtr); + _nextFileName = getPictName(&CPtr); if (noupdatediff) { _roomsFound->inclElement(_roomNum); /* Potentially entered another room */ - forceDraw = (strcmp(Test, CurFileName) != 0) || forceDraw; + forceDraw |= (strcmp(_nextFileName, _curFileName) != 0); noupdatediff = false; - CurFileName = Test; - } - - else if (strcmp(Test, CurFileName) != 0) { + _curFileName = _nextFileName; + } else if (strcmp(_nextFileName, _curFileName) != 0) { interfaceOff(); _roomsFound->inclElement(_roomNum); /* Potentially entered another room */ - CurFileName = Test; + _curFileName = _nextFileName; if (CPtr) { if ((CPtr->CloseUpType == SPECIALLOCK) && MainDisplay) /* LAB: Labyrinth specific code */ - showCombination(CurFileName); + showCombination(_curFileName); 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 - readPict(CurFileName, false); + readPict(_curFileName, false); } else - readPict(CurFileName, false); + readPict(_curFileName, false); drawRoomMessage(curInv, CPtr); forceDraw = false; @@ -806,9 +767,9 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm _isCrumbWaiting = false; getTime(&_crumbSecs, &_crumbMicros); - if (Alternate) { + if (_alternate) { eatMessages(); - Alternate = false; + _alternate = false; _anim->_doBlack = true; DoNotDrawMessage = false; @@ -883,7 +844,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm drawRoomMessage(curInv, CPtr); screenUpdate(); } - } else if ((msgClass == GADGETUP) && !Alternate) { + } else if ((msgClass == GADGETUP) && !_alternate) { if (gadgetId <= 5) { if ((actionMode == 4) && (gadgetId == 4) && (CPtr != NULL)) { doMainView(&CPtr); @@ -896,7 +857,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm } else if (gadgetId == 5) { eatMessages(); - Alternate = true; + _alternate = true; _anim->_doBlack = true; DoNotDrawMessage = false; interfaceOn(); /* Sets the correct gadget list */ @@ -905,7 +866,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm if (LastInv && _conditions->in(LastInv)) { curInv = LastInv; - Test = getInvName(curInv); + _nextFileName = getInvName(curInv); } else decIncInv(&curInv, false); @@ -951,7 +912,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm else drawStaticMessage(kTextTurnRight); - CurFileName = " "; + _curFileName = " "; OldDirection = Direction; @@ -977,7 +938,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm if (OldRoomNum != _roomNum) { drawStaticMessage(kTextGoForward); _roomsFound->inclElement(_roomNum); /* Potentially entered a new room */ - CurFileName = " "; + _curFileName = " "; forceDraw = true; } else { _anim->_doBlack = true; @@ -1030,12 +991,12 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm screenUpdate(); } } - } else if ((msgClass == GADGETUP) && Alternate) { + } else if ((msgClass == GADGETUP) && _alternate) { _anim->_doBlack = true; if (gadgetId == 0) { eatMessages(); - Alternate = false; + _alternate = false; _anim->_doBlack = true; DoNotDrawMessage = false; @@ -1052,7 +1013,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm if (gadgetId == 0) { interfaceOff(); _anim->stopDiff(); - CurFileName = " "; + _curFileName = " "; doit = !saveRestoreGame(); CPtr = NULL; @@ -1062,7 +1023,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm curInv = MAPNUM; LastInv = MAPNUM; - Test = getInvName(curInv); + _nextFileName = getInvName(curInv); drawPanel(); @@ -1101,7 +1062,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm if ((curInv <= NumInv) && _conditions->in(curInv) && Inventory[curInv].BInvName) - Test = getInvName(curInv); + _nextFileName = getInvName(curInv); screenUpdate(); } else if (gadgetId == 3) { /* Left gadget */ @@ -1134,7 +1095,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm getTime(&_crumbSecs, &_crumbMicros); eatMessages(); - Alternate = false; + _alternate = false; _anim->_doBlack = true; DoNotDrawMessage = false; @@ -1176,20 +1137,20 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm if (actionMode == 0) { /* Take something. */ if (doActionRule(Common::Point(curPos.x, curPos.y), actionMode, _roomNum, &CPtr)) - CurFileName = NewFileName; + _curFileName = _newFileName; else if (takeItem(curPos.x, curPos.y, &CPtr)) drawStaticMessage(kTextTakeItem); else if (doActionRule(curPos, TAKEDEF - 1, _roomNum, &CPtr)) - CurFileName = NewFileName; + _curFileName = _newFileName; else if (doActionRule(curPos, TAKE - 1, 0, &CPtr)) - CurFileName = NewFileName; + _curFileName = _newFileName; else if (curPos.y < (VGAScaleY(149) + SVGACord(2))) drawStaticMessage(kTextNothing); } else if ((actionMode == 1) /* Manipulate an object */ || (actionMode == 2) /* Open up a "door" */ || (actionMode == 3)) { /* Close a "door" */ if (doActionRule(curPos, actionMode, _roomNum, &CPtr)) - CurFileName = NewFileName; + _curFileName = _newFileName; else if (!doActionRule(curPos, actionMode, 0, &CPtr)) { if (curPos.y < (VGAScaleY(149) + SVGACord(2))) drawStaticMessage(kTextNothing); @@ -1212,7 +1173,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm } else if ((actionMode == 5) && _conditions->in(curInv)) { /* Use an item on something else */ if (doOperateRule(curPos.x, curPos.y, curInv, &CPtr)) { - CurFileName = NewFileName; + _curFileName = _newFileName; if (!_conditions->in(curInv)) decIncInv(&curInv, false); @@ -1253,13 +1214,13 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm _event->setMousePos(Common::Point(scaleX((HCPtr->x1 + HCPtr->x2) / 2), scaleY((HCPtr->y1 + HCPtr->y2) / 2))); } else if ((msgClass == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) { eatMessages(); - Alternate = !Alternate; + _alternate = !_alternate; _anim->_doBlack = true; DoNotDrawMessage = false; MainDisplay = true; interfaceOn(); /* Sets the correct gadget list */ - if (Alternate) { + if (_alternate) { if (LastInv && _conditions->in(LastInv)) curInv = LastInv; else diff --git a/engines/lab/graphics.cpp b/engines/lab/graphics.cpp index 54a4f352c2..975f054fe1 100644 --- a/engines/lab/graphics.cpp +++ b/engines/lab/graphics.cpp @@ -44,7 +44,6 @@ BitMap bit1, bit2, *DispBitMap = &bit1, *DrawBitMap = &bit1; extern bool stopsound; extern TextFont *MsgFont; -extern const char *CurFileName; /*---------------------------------------------------------------------------*/ /*------ From readPict.c. Reads in pictures and animations from disk. ------*/ @@ -613,13 +612,13 @@ void LabEngine::doTransWipe(CloseDataPtr *cPtr, char *filename) { } if (filename == NULL) - CurFileName = getPictName(cPtr); + g_lab->_curFileName = getPictName(cPtr); else if (filename[0] > ' ') - CurFileName = filename; + g_lab->_curFileName = filename; else - CurFileName = getPictName(cPtr); + g_lab->_curFileName = getPictName(cPtr); - byte *BitMapMem = readPictToMem(CurFileName, _screenWidth, lastY + 5); + byte *BitMapMem = readPictToMem(g_lab->_curFileName, _screenWidth, lastY + 5); setPalette(_anim->_diffPalette, 256); if (BitMapMem) { diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp index dff74be5e0..d9df22a9b1 100644 --- a/engines/lab/interface.cpp +++ b/engines/lab/interface.cpp @@ -51,8 +51,8 @@ Gadget *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *im, Image gptr->y = y; gptr->GadgetID = id; gptr->KeyEquiv = key; - gptr->Im = im; - gptr->ImAlt = imalt; + gptr->_image = im; + gptr->_altImage = imalt; gptr->NextGadget = NULL; return gptr; @@ -82,7 +82,7 @@ void freeButtonList(Gadget *gptrlist) { /*****************************************************************************/ void drawGadgetList(Gadget *gadlist) { while (gadlist) { - gadlist->Im->drawImage(gadlist->x, gadlist->y); + gadlist->_image->drawImage(gadlist->x, gadlist->y); if (GADGETOFF & gadlist->GadgetFlags) ghoastGadget(gadlist, 1); @@ -96,7 +96,7 @@ void drawGadgetList(Gadget *gadlist) { /* Ghoasts a gadget, and makes it unavailable for using. */ /*****************************************************************************/ void ghoastGadget(Gadget *curgad, uint16 pencolor) { - g_lab->ghoastRect(pencolor, curgad->x, curgad->y, curgad->x + curgad->Im->Width - 1, curgad->y + curgad->Im->Height - 1); + g_lab->ghoastRect(pencolor, curgad->x, curgad->y, curgad->x + curgad->_image->Width - 1, curgad->y + curgad->_image->Height - 1); curgad->GadgetFlags |= GADGETOFF; } @@ -106,7 +106,7 @@ void ghoastGadget(Gadget *curgad, uint16 pencolor) { /* Unghoasts a gadget, and makes it available again. */ /*****************************************************************************/ void unGhoastGadget(Gadget *curgad) { - curgad->Im->drawImage(curgad->x, curgad->y); + curgad->_image->drawImage(curgad->x, curgad->y); curgad->GadgetFlags &= !(GADGETOFF); } @@ -133,11 +133,11 @@ Gadget *LabEngine::checkNumGadgetHit(Gadget *gadlist, uint16 key) { (gadlist->KeyEquiv != 0 && makeGadgetKeyEquiv(key) == gadlist->KeyEquiv)) && !(GADGETOFF & gadlist->GadgetFlags)) { _event->mouseHide(); - gadlist->ImAlt->drawImage(gadlist->x, gadlist->y); + gadlist->_altImage->drawImage(gadlist->x, gadlist->y); _event->mouseShow(); g_system->delayMillis(80); _event->mouseHide(); - gadlist->Im->drawImage(gadlist->x, gadlist->y); + gadlist->_image->drawImage(gadlist->x, gadlist->y); _event->mouseShow(); return gadlist; diff --git a/engines/lab/interface.h b/engines/lab/interface.h index 524c4ff437..ceeb4a8327 100644 --- a/engines/lab/interface.h +++ b/engines/lab/interface.h @@ -46,7 +46,7 @@ struct Gadget { uint16 x, y, GadgetID; uint16 KeyEquiv; // if not zero, a key that activates gadget uint32 GadgetFlags; - Image *Im, *ImAlt; + Image *_image, *_altImage; Gadget *NextGadget; }; diff --git a/engines/lab/lab.cpp b/engines/lab/lab.cpp index 22ab50392d..1c95746857 100644 --- a/engines/lab/lab.cpp +++ b/engines/lab/lab.cpp @@ -89,6 +89,20 @@ LabEngine::LabEngine(OSystem *syst, const ADGameDescription *gameDesc) _lastMessageLong = false; _lastTooLong = false; + _interfaceOff = false; + _alternate = false; + + for (int i = 0; i < 20; i++) + _moveImages[20] = nullptr; + + for (int i = 0; i < 10; i++) + _invImages[10] = nullptr; + + _moveGadgetList = nullptr; + _invGadgetList = nullptr; + _curFileName = nullptr; + _nextFileName = nullptr; + _newFileName = nullptr; //const Common::FSNode gameDataDir(ConfMan.get("path")); //SearchMan.addSubDirectoryMatching(gameDataDir, "game"); diff --git a/engines/lab/lab.h b/engines/lab/lab.h index 348ce11eca..a439a3a7eb 100644 --- a/engines/lab/lab.h +++ b/engines/lab/lab.h @@ -86,6 +86,12 @@ public: private: uint32 _extraGameFeatures; + bool _interfaceOff; + bool _alternate; + Image *_moveImages[20]; + Image *_invImages[10]; + Gadget *_moveGadgetList; + Gadget *_invGadgetList; // timing.cpp void microDelay(uint32 secs, uint32 micros); @@ -114,6 +120,11 @@ public: byte *_tempScrollData; bool _isHiRes; byte *_displayBuffer; + const char *_curFileName; + const char *_nextFileName; + const char *_newFileName; /* When ProcessRoom.c decides to change the filename + of the current picture. */ + private: int _lastWaitTOFTicks; diff --git a/engines/lab/labfun.h b/engines/lab/labfun.h index 52f6034477..b20667bc2a 100644 --- a/engines/lab/labfun.h +++ b/engines/lab/labfun.h @@ -59,10 +59,10 @@ struct TextFont; struct Gadget; struct SaveGameHeader { - byte version; - SaveStateDescriptor desc; - uint16 roomNumber; - uint16 direction; + byte _version; + SaveStateDescriptor _descr; + uint16 _roomNumber; + uint16 _direction; }; /*----------------------------*/ diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp index d7a3e124ca..43f8fd3267 100644 --- a/engines/lab/map.cpp +++ b/engines/lab/map.cpp @@ -171,12 +171,12 @@ static bool loadMapData() { Down = new Image(buffer); DownAlt = new Image(buffer); - backgadget.Im = Back; - backgadget.ImAlt = BackAlt; - upgadget.Im = Up; - upgadget.ImAlt = UpAlt; - downgadget.Im = Down; - downgadget.ImAlt = DownAlt; + backgadget._image = Back; + backgadget._altImage = BackAlt; + upgadget._image = Up; + upgadget._altImage = UpAlt; + downgadget._image = Down; + downgadget._altImage = DownAlt; counter = 0; gptr = MapGadgetList; diff --git a/engines/lab/mouse.cpp b/engines/lab/mouse.cpp index 38b893511d..b676f2cd37 100644 --- a/engines/lab/mouse.cpp +++ b/engines/lab/mouse.cpp @@ -61,21 +61,21 @@ static byte MouseData[] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, Gadget *EventManager::checkGadgetHit(Gadget *gadgetList, Common::Point pos) { while (gadgetList != NULL) { if ((pos.x >= gadgetList->x) && (pos.y >= gadgetList->y) && - (pos.x <= (gadgetList->x + gadgetList->Im->Width)) && - (pos.y <= (gadgetList->y + gadgetList->Im->Height)) && + (pos.x <= (gadgetList->x + gadgetList->_image->Width)) && + (pos.y <= (gadgetList->y + gadgetList->_image->Height)) && !(GADGETOFF & gadgetList->GadgetFlags)) { if (_vm->_isHiRes) { _hitGadget = gadgetList; } else { mouseHide(); - gadgetList->ImAlt->drawImage(gadgetList->x, gadgetList->y); + gadgetList->_altImage->drawImage(gadgetList->x, gadgetList->y); mouseShow(); for (uint16 i = 0; i < 3; i++) _vm->waitTOF(); mouseHide(); - gadgetList->Im->drawImage(gadgetList->x, gadgetList->y); + gadgetList->_image->drawImage(gadgetList->x, gadgetList->y); mouseShow(); } @@ -143,14 +143,14 @@ void EventManager::updateMouse() { if (_hitGadget) { mouseHide(); - _hitGadget->ImAlt->drawImage(_hitGadget->x, _hitGadget->y); + _hitGadget->_altImage->drawImage(_hitGadget->x, _hitGadget->y); mouseShow(); for (uint16 i = 0; i < 3; i++) _vm->waitTOF(); mouseHide(); - _hitGadget->Im->drawImage(_hitGadget->x, _hitGadget->y); + _hitGadget->_image->drawImage(_hitGadget->x, _hitGadget->y); mouseShow(); doUpdateDisplay = true; _hitGadget = nullptr; diff --git a/engines/lab/parsetypes.h b/engines/lab/parsetypes.h index 3ca441a286..82174b80f4 100644 --- a/engines/lab/parsetypes.h +++ b/engines/lab/parsetypes.h @@ -185,8 +185,6 @@ struct InventoryData { #define MULTIMAZEF2 10 #define MULTIMAZEF3 11 - - struct MapData { uint16 x, y, PageNumber, SpecialID; uint32 MapFlags; diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp index 0145c83cd4..3eeb00da54 100644 --- a/engines/lab/processroom.cpp +++ b/engines/lab/processroom.cpp @@ -47,10 +47,8 @@ namespace Lab { RoomData *_rooms; InventoryData *Inventory; uint16 NumInv, ManyRooms, HighestCondition, Direction; -const char *NewFileName; extern bool DoNotDrawMessage, noupdatediff, QuitLab, MusicOn, LongWinInFront; -extern const char *CurFileName; extern CloseDataPtr CPtr; /*****************************************************************************/ @@ -382,15 +380,15 @@ static void doActions(Action * APtr, CloseDataPtr *LCPtr) { break; case FORCEUPDATE: - CurFileName = " "; + g_lab->_curFileName = " "; break; case SHOWCURPICT: Test = getPictName(LCPtr); - if (strcmp(Test, CurFileName) != 0) { - CurFileName = Test; - readPict(CurFileName, true); + if (strcmp(Test, g_lab->_curFileName) != 0) { + g_lab->_curFileName = Test; + readPict(g_lab->_curFileName, true); } break; @@ -642,9 +640,9 @@ bool doActionRule(Common::Point pos, int16 action, int16 roomNum, CloseDataPtr * CloseDataPtr TLCPtr; if (roomNum) - NewFileName = NOFILE; + g_lab->_newFileName = NOFILE; else - NewFileName = CurFileName; + g_lab->_newFileName = g_lab->_curFileName; TLCPtr = getObject(pos.x, pos.y, *LCPtr); @@ -694,7 +692,7 @@ static bool doOperateRuleSub(int16 ItemNum, int16 roomNum, CloseDataPtr LCPtr, C bool doOperateRule(int16 x, int16 y, int16 ItemNum, CloseDataPtr *LCPtr) { CloseDataPtr TLCPtr; - NewFileName = NOFILE; + g_lab->_newFileName = NOFILE; TLCPtr = getObject(x, y, *LCPtr); @@ -707,7 +705,7 @@ bool doOperateRule(int16 x, int16 y, int16 ItemNum, CloseDataPtr *LCPtr) { else if (doOperateRuleSub(ItemNum, g_lab->_roomNum, *LCPtr, LCPtr, true)) return true; else { - NewFileName = CurFileName; + g_lab->_newFileName = g_lab->_curFileName; if (doOperateRuleSub(ItemNum, 0, TLCPtr, LCPtr, false)) return true; diff --git a/engines/lab/savegame.cpp b/engines/lab/savegame.cpp index d54e6cb491..41f7b2787e 100644 --- a/engines/lab/savegame.cpp +++ b/engines/lab/savegame.cpp @@ -89,10 +89,10 @@ bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &header) { return false; // Read in the version - header.version = in->readByte(); + header._version = in->readByte(); // Check that the save version isn't newer than this binary - if (header.version > SAVEGAME_VERSION) + if (header._version > SAVEGAME_VERSION) return false; // Read in the save name @@ -100,10 +100,10 @@ bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &header) { char ch; while ((ch = (char)in->readByte()) != '\0') saveName += ch; - header.desc.setDescription(saveName); + header._descr.setDescription(saveName); // Get the thumbnail - header.desc.setThumbnail(Graphics::loadThumbnail(*in)); + header._descr.setThumbnail(Graphics::loadThumbnail(*in)); uint32 saveDate = in->readUint32BE(); uint16 saveTime = in->readUint16BE(); @@ -112,13 +112,13 @@ bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &header) { int day = (saveDate >> 24) & 0xFF; int month = (saveDate >> 16) & 0xFF; int year = saveDate & 0xFFFF; - header.desc.setSaveDate(year, month, day); + header._descr.setSaveDate(year, month, day); int hour = (saveTime >> 8) & 0xFF; int minutes = saveTime & 0xFF; - header.desc.setSaveTime(hour, minutes); + header._descr.setSaveTime(hour, minutes); - header.desc.setPlayTime(playTime * 1000); + header._descr.setPlayTime(playTime * 1000); g_engine->setTotalPlayTime(playTime * 1000); return true; diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp index 2744d3de32..6c5ff021a8 100644 --- a/engines/lab/special.cpp +++ b/engines/lab/special.cpp @@ -551,12 +551,12 @@ static bool loadJournalData() { if (!buffer) return false; - BackG.Im = new Image(buffer); - BackG.ImAlt = new Image(buffer); - ForwardG.Im = new Image(buffer); - ForwardG.ImAlt = new Image(buffer); - CancelG.Im = new Image(buffer); - CancelG.ImAlt = new Image(buffer); + BackG._image = new Image(buffer); + BackG._altImage = new Image(buffer); + ForwardG._image = new Image(buffer); + ForwardG._altImage = new Image(buffer); + CancelG._image = new Image(buffer); + CancelG._altImage = new Image(buffer); BackG.KeyEquiv = VKEY_LTARROW; ForwardG.KeyEquiv = VKEY_RTARROW; |