From db773d92b7f035244538316a02d109671cdf8944 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 29 Nov 2015 23:34:35 +0100 Subject: LAB: Remove useless redirections --- engines/lab/engine.cpp | 52 ++++++++++++++--------------- engines/lab/map.cpp | 48 +++++++++++++-------------- engines/lab/mouse.cpp | 30 ++++++++--------- engines/lab/readdiff.cpp | 18 +++++----- engines/lab/special.cpp | 36 ++++++++++---------- engines/lab/vga.cpp | 86 ++++++++++++++++++++++++------------------------ 6 files changed, 135 insertions(+), 135 deletions(-) diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index 7af3719ae7..c3aa5f4ff6 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -151,7 +151,7 @@ void LabEngine::drawPanel() { drawHLine(0, VGAScaleY(170) + 1, VGAScaleX(319)); /* The horizontal lines under the black one */ drawGadgetList(MoveGadgetList); } else { - if (g_lab->getPlatform() != Common::kPlatformWindows) { + if (getPlatform() != Common::kPlatformWindows) { drawVLine(VGAScaleX(124), VGAScaleY(170) + 1, VGAScaleY(199)); /* Vertical Black lines */ drawVLine(VGAScaleX(194), VGAScaleY(170) + 1, VGAScaleY(199)); } else { @@ -166,7 +166,7 @@ void LabEngine::drawPanel() { drawHLine(VGAScaleX(196), VGAScaleY(170) + 1, VGAScaleX(319)); drawVLine(VGAScaleX(1), VGAScaleY(170) + 2, VGAScaleY(198)); /* The vertical high light lines */ - if (g_lab->getPlatform() != Common::kPlatformWindows) { + if (getPlatform() != Common::kPlatformWindows) { drawVLine(VGAScaleX(126), VGAScaleY(170) + 2, VGAScaleY(198)); drawVLine(VGAScaleX(196), VGAScaleY(170) + 2, VGAScaleY(198)); } else { @@ -199,8 +199,8 @@ void LabEngine::drawRoomMessage(uint16 CurInv, CloseDataPtr cptr) { } if (Alternate) { - if ((CurInv <= NumInv) && g_lab->_conditions->in(CurInv) && Inventory[CurInv].BInvName) { - if ((CurInv == LAMPNUM) && g_lab->_conditions->in(LAMPON)) /* LAB: Labyrith specific */ + if ((CurInv <= NumInv) && _conditions->in(CurInv) && Inventory[CurInv].BInvName) { + if ((CurInv == LAMPNUM) && _conditions->in(LAMPON)) /* LAB: Labyrith specific */ drawStaticMessage(kTextLampOn); else if (Inventory[CurInv].Many > 1) { Common::String roomMessage = Common::String(Inventory[CurInv].name) + " (" + Common::String::format("%d", Inventory[CurInv].Many) + ")"; @@ -250,7 +250,7 @@ bool LabEngine::setUpScreens() { /* Creates the gadgets for the movement control panel */ y = VGAScaleY(173) - SVGACord(2); - if (g_lab->getPlatform() == Common::kPlatformWindows) { + 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]); @@ -307,7 +307,7 @@ bool LabEngine::setUpScreens() { buffer = InvPanelBuffer; - if (g_lab->getPlatform() == Common::kPlatformWindows) { + if (getPlatform() == Common::kPlatformWindows) { for (uint16 imgIdx = 0; imgIdx < 10; imgIdx++) readImage(&buffer, &(InvImages[imgIdx])); @@ -401,7 +401,7 @@ bool LabEngine::doCloseUp(CloseDataPtr cptr) { int monltmargin, monrtmargin, montopmargin, lutertmargin; - if (g_lab->getPlatform() != Common::kPlatformWindows) { + if (getPlatform() != Common::kPlatformWindows) { monltmargin = 0; monrtmargin = 319; montopmargin = 0; @@ -595,7 +595,7 @@ void LabEngine::decIncInv(uint16 *CurInv, bool dec) { (*CurInv)++; while (*CurInv && (*CurInv <= NumInv)) { - if (g_lab->_conditions->in(*CurInv) && Inventory[*CurInv].BInvName) { + if (_conditions->in(*CurInv) && Inventory[*CurInv].BInvName) { Test = getInvName(*CurInv); break; } @@ -613,7 +613,7 @@ void LabEngine::decIncInv(uint16 *CurInv, bool dec) { *CurInv = 1; while (*CurInv && (*CurInv <= NumInv)) { - if (g_lab->_conditions->in(*CurInv) && Inventory[*CurInv].BInvName) { + if (_conditions->in(*CurInv) && Inventory[*CurInv].BInvName) { Test = getInvName(*CurInv); break; } @@ -653,13 +653,13 @@ void LabEngine::mainGameLoop() { g_resource->readRoomData("LAB:Doors"); g_resource->readInventory("LAB:Inventor"); - if (!(g_lab->_conditions = new LargeSet(HighestCondition + 1))) + if (!(_conditions = new LargeSet(HighestCondition + 1))) return; - if (!(g_lab->_roomsFound = new LargeSet(ManyRooms + 1))) + if (!(_roomsFound = new LargeSet(ManyRooms + 1))) return; - g_lab->_conditions->readInitialConditions("LAB:Conditio"); + _conditions->readInitialConditions("LAB:Conditio"); LongWinInFront = false; drawPanel(); @@ -693,7 +693,7 @@ void LabEngine::mainGameLoop() { Test = getPictName(&CPtr); if (noupdatediff) { - g_lab->_roomsFound->inclElement(RoomNum); /* Potentially entered another room */ + _roomsFound->inclElement(RoomNum); /* Potentially entered another room */ ForceDraw = (strcmp(Test, CurFileName) != 0) || ForceDraw; noupdatediff = false; @@ -702,7 +702,7 @@ void LabEngine::mainGameLoop() { else if (strcmp(Test, CurFileName) != 0) { interfaceOff(); - g_lab->_roomsFound->inclElement(RoomNum); /* Potentially entered another room */ + _roomsFound->inclElement(RoomNum); /* Potentially entered another room */ CurFileName = Test; if (CPtr) { @@ -789,7 +789,7 @@ from_crumbs: Class = MOUSEBUTTONS; Qualifier = IEQUALIFIER_LEFTBUTTON; curPos = _event->getMousePos(); - } else if (g_lab->getPlatform() == Common::kPlatformWindows && + } else if (getPlatform() == Common::kPlatformWindows && (code == 'b' || code == 'B')) { /* Start bread crumbs */ BreadCrumbs[0].RoomNum = 0; NumCrumbs = 0; @@ -804,7 +804,7 @@ from_crumbs: FollowCrumbsFast = (code == 'r' || code == 'R'); IsCrumbTurning = false; IsCrumbWaiting = false; - g_lab->getTime(&CrumbSecs, &CrumbMicros); + getTime(&CrumbSecs, &CrumbMicros); if (Alternate) { eatMessages(); @@ -903,7 +903,7 @@ from_crumbs: MainDisplay = false; - if (LastInv && g_lab->_conditions->in(LastInv)) { + if (LastInv && _conditions->in(LastInv)) { CurInv = LastInv; Test = getInvName(CurInv); } else @@ -976,7 +976,7 @@ from_crumbs: if (OldRoomNum != RoomNum) { drawStaticMessage(kTextGoForward); - g_lab->_roomsFound->inclElement(RoomNum); /* Potentially entered a new room */ + _roomsFound->inclElement(RoomNum); /* Potentially entered a new room */ CurFileName = " "; ForceDraw = true; } else { @@ -1095,11 +1095,11 @@ from_crumbs: if ((CurInv == 0) || (CurInv > NumInv)) { CurInv = 1; - while ((CurInv <= NumInv) && (!g_lab->_conditions->in(CurInv))) + while ((CurInv <= NumInv) && (!_conditions->in(CurInv))) CurInv++; } - if ((CurInv <= NumInv) && g_lab->_conditions->in(CurInv) && + if ((CurInv <= NumInv) && _conditions->in(CurInv) && Inventory[CurInv].BInvName) Test = getInvName(CurInv); @@ -1131,7 +1131,7 @@ from_crumbs: FollowCrumbsFast = false; IsCrumbTurning = false; IsCrumbWaiting = false; - g_lab->getTime(&CrumbSecs, &CrumbMicros); + getTime(&CrumbSecs, &CrumbMicros); eatMessages(); Alternate = false; @@ -1210,11 +1210,11 @@ from_crumbs: } else if (curPos.y < (VGAScaleY(149) + SVGACord(2))) drawStaticMessage(kTextNothing); } else if ((ActionMode == 5) && - g_lab->_conditions->in(CurInv)) { /* Use an item on something else */ + _conditions->in(CurInv)) { /* Use an item on something else */ if (doOperateRule(curPos.x, curPos.y, CurInv, &CPtr)) { CurFileName = NewFileName; - if (!g_lab->_conditions->in(CurInv)) + if (!_conditions->in(CurInv)) decIncInv(&CurInv, false); } else if (curPos.y < (VGAScaleY(149) + SVGACord(2))) drawStaticMessage(kTextNothing); @@ -1260,7 +1260,7 @@ from_crumbs: interfaceOn(); /* Sets the correct gadget list */ if (Alternate) { - if (LastInv && g_lab->_conditions->in(LastInv)) + if (LastInv && _conditions->in(LastInv)) CurInv = LastInv; else decIncInv(&CurInv, false); @@ -1275,8 +1275,8 @@ from_crumbs: } } - delete g_lab->_conditions; - delete g_lab->_roomsFound; + delete _conditions; + delete _roomsFound; if (_rooms) { free(_rooms); diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp index 98082b73f8..d41322f426 100644 --- a/engines/lab/map.cpp +++ b/engines/lab/map.cpp @@ -564,21 +564,21 @@ void LabEngine::drawMap(uint16 CurRoom, uint16 CurMsg, uint16 Floor, bool fadeou if (fadeout) fade(false, 0); - g_lab->setAPen(0); - g_lab->rectFill(0, 0, g_lab->_screenWidth - 1, g_lab->_screenHeight - 1); + setAPen(0); + rectFill(0, 0, _screenWidth - 1, _screenHeight - 1); - g_lab->drawImage(Map, 0, 0); + drawImage(Map, 0, 0); drawGadgetList(MapGadgetList); for (uint16 i = 1; i <= MaxRooms; i++) { - if ((Maps[i].PageNumber == Floor) && g_lab->_roomsFound->in(i) && Maps[i].x) { + if ((Maps[i].PageNumber == Floor) && _roomsFound->in(i) && Maps[i].x) { drawRoom(i, (bool)(i == CurRoom)); g_music->updateMusic(); } } if ((Maps[CurRoom].PageNumber == Floor) /* Makes sure the X is drawn in corridors */ - && g_lab->_roomsFound->in(CurRoom) /* NOTE: this here on purpose just in case there's some weird condition, like the surreal maze where there are no rooms */ + && _roomsFound->in(CurRoom) /* NOTE: this here on purpose just in case there's some weird condition, like the surreal maze where there are no rooms */ && Maps[CurRoom].x) drawRoom(CurRoom, true); @@ -601,16 +601,16 @@ void LabEngine::drawMap(uint16 CurRoom, uint16 CurMsg, uint16 Floor, bool fadeou // Labyrinth specific code if (Floor == LOWERFLOOR) { if (onFloor(SURMAZEFLOOR)) - g_lab->drawImage(Maze, mapScaleX(538), mapScaleY(277)); + drawImage(Maze, mapScaleX(538), mapScaleY(277)); } else if (Floor == MIDDLEFLOOR) { if (onFloor(CARNIVAL)) - g_lab->drawImage(Maze, mapScaleX(358), mapScaleY(72)); + drawImage(Maze, mapScaleX(358), mapScaleY(72)); if (onFloor(MEDMAZEFLOOR)) - g_lab->drawImage(Maze, mapScaleX(557), mapScaleY(325)); + drawImage(Maze, mapScaleX(557), mapScaleY(325)); } else if (Floor == UPPERFLOOR) { if (onFloor(HEDGEMAZEFLOOR)) - g_lab->drawImage(HugeMaze, mapScaleX(524), mapScaleY(97)); + drawImage(HugeMaze, mapScaleX(524), mapScaleY(97)); } else if (Floor == SURMAZEFLOOR) { sptr = (char *)g_resource->getStaticText(kTextSurmazeMessage).c_str(); flowText(MsgFont, 0, 7, 0, true, true, true, true, mapScaleX(360), 0, mapScaleX(660), mapScaleY(450), sptr); @@ -686,14 +686,14 @@ void LabEngine::processMap(uint16 CurRoom) { newcolor[2] = newcolor[1]; } - g_lab->waitTOF(); - g_lab->writeColorReg(newcolor, 1); + waitTOF(); + writeColorReg(newcolor, 1); _event->updateMouse(); - g_lab->waitTOF(); + waitTOF(); _event->updateMouse(); - g_lab->waitTOF(); + waitTOF(); _event->updateMouse(); - g_lab->waitTOF(); + waitTOF(); _event->updateMouse(); place++; @@ -787,7 +787,7 @@ void LabEngine::processMap(uint16 CurRoom) { roomCords(i, &x1, &y1, &x2, &y2); if ((Maps[i].PageNumber == CurFloor) - && g_lab->_roomsFound->in(i) + && _roomsFound->in(i) && (MouseX >= x1) && (MouseX <= x2) && (MouseY >= y1) && (MouseY <= y2)) { CurMsg = i; @@ -800,8 +800,8 @@ void LabEngine::processMap(uint16 CurRoom) { if ((sptr = _rooms[CurMsg]._roomMsg)) { _event->mouseHide(); - g_lab->setAPen(3); - g_lab->rectFill(VGAScaleX(13), VGAScaleY(148), VGAScaleX(135), VGAScaleY(186)); + 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); if (Maps[OldMsg].PageNumber == CurFloor) @@ -812,8 +812,8 @@ void LabEngine::processMap(uint16 CurRoom) { y1 = (y1 + y2) / 2; if ((CurMsg != CurRoom) && (Maps[CurMsg].PageNumber == CurFloor)) { - g_lab->setAPen(1); - g_lab->rectFill(x1 - 1, y1, x1, y1); + setAPen(1); + rectFill(x1 - 1, y1, x1, y1); } _event->mouseShow(); @@ -822,7 +822,7 @@ void LabEngine::processMap(uint16 CurRoom) { } } - g_lab->WSDL_UpdateScreen(); + WSDL_UpdateScreen(); } } } @@ -850,18 +850,18 @@ void LabEngine::doMap(uint16 CurRoom) { drawMap(CurRoom, CurRoom, Maps[CurRoom].PageNumber, false, true); _event->mouseShow(); _event->attachGadgetList(MapGadgetList); - g_lab->WSDL_UpdateScreen(); + WSDL_UpdateScreen(); processMap(CurRoom); _event->attachGadgetList(NULL); fade(false, 0); blackAllScreen(); _event->mouseHide(); - g_lab->setAPen(0); - g_lab->rectFill(0, 0, g_lab->_screenWidth - 1, g_lab->_screenHeight - 1); + setAPen(0); + rectFill(0, 0, _screenWidth - 1, _screenHeight - 1); freeMapData(); blackAllScreen(); _event->mouseShow(); - g_lab->WSDL_UpdateScreen(); + WSDL_UpdateScreen(); } } // End of namespace Lab diff --git a/engines/lab/mouse.cpp b/engines/lab/mouse.cpp index 73fdd2eb07..ace64593a3 100644 --- a/engines/lab/mouse.cpp +++ b/engines/lab/mouse.cpp @@ -79,14 +79,14 @@ Gadget *EventManager::checkGadgetHit(Gadget *gadlist, Common::Point pos) { hitgad = gadlist; } else { mouseHide(); - g_lab->drawImage(gadlist->ImAlt, gadlist->x, gadlist->y); + _vm->drawImage(gadlist->ImAlt, gadlist->x, gadlist->y); mouseShow(); for (uint16 i = 0; i < 3; i++) - g_lab->waitTOF(); + _vm->waitTOF(); mouseHide(); - g_lab->drawImage(gadlist->Im, gadlist->x, gadlist->y); + _vm->drawImage(gadlist->Im, gadlist->x, gadlist->y); mouseShow(); } @@ -138,21 +138,21 @@ void EventManager::updateMouse() { if (hitgad) { mouseHide(); - g_lab->drawImage(hitgad->ImAlt, hitgad->x, hitgad->y); + _vm->drawImage(hitgad->ImAlt, hitgad->x, hitgad->y); mouseShow(); for (uint16 i = 0; i < 3; i++) - g_lab->waitTOF(); + _vm->waitTOF(); mouseHide(); - g_lab->drawImage(hitgad->Im, hitgad->x, hitgad->y); + _vm->drawImage(hitgad->Im, hitgad->x, hitgad->y); mouseShow(); doUpdateDisplay = true; hitgad = NULL; } if (doUpdateDisplay) - g_lab->WSDL_UpdateScreen(); + _vm->WSDL_UpdateScreen(); } @@ -175,7 +175,7 @@ void EventManager::mouseShow() { NumHidden--; if ((NumHidden == 0) && MouseHidden) { - g_lab->WSDL_ProcessInput(0); + _vm->WSDL_ProcessInput(0); MouseHidden = false; } @@ -201,9 +201,9 @@ void EventManager::mouseHide() { /*****************************************************************************/ Common::Point EventManager::getMousePos() { if (IsHiRes) - return g_lab->_mousePos; + return _vm->_mousePos; else - return Common::Point(g_lab->_mousePos.x / 2, g_lab->_mousePos.y); + return Common::Point(_vm->_mousePos.x / 2, _vm->_mousePos.y); } @@ -217,7 +217,7 @@ void EventManager::setMousePos(Common::Point pos) { g_system->warpMouse(pos.x * 2, pos.y); if (!MouseHidden) - g_lab->WSDL_ProcessInput(0); + _vm->WSDL_ProcessInput(0); } @@ -229,15 +229,15 @@ void EventManager::setMousePos(Common::Point pos) { bool EventManager::mouseButton(uint16 *x, uint16 *y, bool leftbutton) { if (leftbutton) { if (LeftClick) { - *x = (!IsHiRes) ? (uint16)g_lab->_mousePos.x / 2 : (uint16)g_lab->_mousePos.x; - *y = (uint16)g_lab->_mousePos.y; + *x = (!IsHiRes) ? (uint16)_vm->_mousePos.x / 2 : (uint16)_vm->_mousePos.x; + *y = (uint16)_vm->_mousePos.y; LeftClick = false; return true; } } else { if (RightClick) { - *x = (!IsHiRes) ? (uint16)g_lab->_mousePos.x / 2 : (uint16)g_lab->_mousePos.x; - *y = (uint16)g_lab->_mousePos.y; + *x = (!IsHiRes) ? (uint16)_vm->_mousePos.x / 2 : (uint16)_vm->_mousePos.x; + *y = (uint16)_vm->_mousePos.y; RightClick = false; return true; } diff --git a/engines/lab/readdiff.cpp b/engines/lab/readdiff.cpp index 61edf32512..ca7d3905ce 100644 --- a/engines/lab/readdiff.cpp +++ b/engines/lab/readdiff.cpp @@ -118,7 +118,7 @@ void LabEngine::diffNextFrame() { return; if (DispBitMap->Flags & BITMAPF_VIDEO) { - DispBitMap->Planes[0] = g_lab->getVGABaseAddr(); + DispBitMap->Planes[0] = getVGABaseAddr(); DispBitMap->Planes[1] = DispBitMap->Planes[0] + 0x10000; DispBitMap->Planes[2] = DispBitMap->Planes[1] + 0x10000; DispBitMap->Planes[3] = DispBitMap->Planes[2] + 0x10000; @@ -133,12 +133,12 @@ void LabEngine::diffNextFrame() { if (!IsBM) { if (headerdata.fps) { - g_lab->waitForTime(WaitSec, WaitMicros); - g_lab->addCurTime(0L, DelayMicros, &WaitSec, &WaitMicros); + waitForTime(WaitSec, WaitMicros); + addCurTime(0L, DelayMicros, &WaitSec, &WaitMicros); } if (IsPal && !nopalchange) { - g_lab->VGASetPal(diffcmap, 256); + VGASetPal(diffcmap, 256); IsPal = false; } @@ -146,7 +146,7 @@ void LabEngine::diffNextFrame() { } if (IsPal && !nopalchange && !IsBM && !donepal) { - g_lab->VGASetPal(diffcmap, 256); + VGASetPal(diffcmap, 256); IsPal = false; } @@ -161,7 +161,7 @@ void LabEngine::diffNextFrame() { CurBit = 0; if (DispBitMap->Flags & BITMAPF_VIDEO) - g_lab->WSDL_UpdateScreen(); + WSDL_UpdateScreen(); return; /* done with the next frame. */ } @@ -229,7 +229,7 @@ void LabEngine::diffNextFrame() { if (waitForEffect) { while (g_music->isSoundEffectActive()) { g_music->updateMusic(); - g_lab->waitTOF(); + waitTOF(); } } @@ -255,7 +255,7 @@ void LabEngine::diffNextFrame() { if (waitForEffect) { while (g_music->isSoundEffectActive()) { g_music->updateMusic(); - g_lab->waitTOF(); + waitTOF(); if (DispBitMap->Flags & BITMAPF_VIDEO) didTOF = 1; @@ -266,7 +266,7 @@ void LabEngine::diffNextFrame() { _event->mouseShow(); if (!didTOF) - g_lab->WSDL_UpdateScreen(); + WSDL_UpdateScreen(); return; } diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp index 4e61b3c8cd..9b0ed4217f 100644 --- a/engines/lab/special.cpp +++ b/engines/lab/special.cpp @@ -692,10 +692,10 @@ void LabEngine::drawJournal(uint16 wipenum, bool needFade) { drawJournalText(); - ScreenImage.ImageData = g_lab->getVGABaseAddr(); + ScreenImage.ImageData = getVGABaseAddr(); if (wipenum == 0) - g_lab->bltBitMap(&JBackImage, 0, 0, &ScreenImage, 0, 0, g_lab->_screenWidth, g_lab->_screenHeight); + bltBitMap(&JBackImage, 0, 0, &ScreenImage, 0, 0, _screenWidth, _screenHeight); else turnPage((bool)(wipenum == 1)); @@ -714,7 +714,7 @@ void LabEngine::drawJournal(uint16 wipenum, bool needFade) { fade(true, 0); nopalchange = true; - JBackImage.ImageData = readPictToMem("P:Journal.pic", g_lab->_screenWidth, g_lab->_screenHeight); + JBackImage.ImageData = readPictToMem("P:Journal.pic", _screenWidth, _screenHeight); GotBackImage = true; eatMessages(); @@ -775,15 +775,15 @@ void LabEngine::doJournal() { lastpage = false; GotBackImage = false; - JBackImage.Width = g_lab->_screenWidth; - JBackImage.Height = g_lab->_screenHeight; + JBackImage.Width = _screenWidth; + JBackImage.Height = _screenHeight; JBackImage.ImageData = NULL; BackG.NextGadget = &CancelG; CancelG.NextGadget = &ForwardG; ScreenImage = JBackImage; - ScreenImage.ImageData = g_lab->getVGABaseAddr(); + ScreenImage.ImageData = getVGABaseAddr(); g_music->updateMusic(); loadJournalData(); @@ -797,10 +797,10 @@ void LabEngine::doJournal() { fade(false, 0); _event->mouseHide(); - ScreenImage.ImageData = g_lab->getVGABaseAddr(); + ScreenImage.ImageData = getVGABaseAddr(); - g_lab->setAPen(0); - g_lab->rectFill(0, 0, g_lab->_screenWidth - 1, g_lab->_screenHeight - 1); + setAPen(0); + rectFill(0, 0, _screenWidth - 1, _screenHeight - 1); blackScreen(); freeAllStolenMem(); @@ -892,17 +892,17 @@ void LabEngine::drawMonText(char *text, uint16 x1, uint16 y1, uint16 x2, uint16 else MonGadHeight = fheight; - g_lab->setAPen(0); - g_lab->rectFill(0, 0, g_lab->_screenWidth - 1, y2); + setAPen(0); + rectFill(0, 0, _screenWidth - 1, y2); for (uint16 i = 0; i < numlines; i++) - g_lab->drawImage(MonButton, 0, i * MonGadHeight); + drawImage(MonButton, 0, i * MonGadHeight); } else if (isinteractive) { - g_lab->setAPen(0); - g_lab->rectFill(0, 0, g_lab->_screenWidth - 1, y2); + setAPen(0); + rectFill(0, 0, _screenWidth - 1, y2); } else { - g_lab->setAPen(0); - g_lab->rectFill(x1, y1, x2, y2); + setAPen(0); + rectFill(x1, y1, x2, y2); } while (DrawingToPage < monitorPage) { @@ -1072,8 +1072,8 @@ void LabEngine::doMonitor(char *background, char *textfile, bool isinteractive, freeAllStolenMem(); - g_lab->setAPen(0); - g_lab->rectFill(0, 0, g_lab->_screenWidth - 1, g_lab->_screenHeight - 1); + setAPen(0); + rectFill(0, 0, _screenWidth - 1, _screenHeight - 1); blackAllScreen(); } diff --git a/engines/lab/vga.cpp b/engines/lab/vga.cpp index 3ed26e1bf6..c7252d4ee5 100644 --- a/engines/lab/vga.cpp +++ b/engines/lab/vga.cpp @@ -43,15 +43,15 @@ namespace Lab { /*****************************************************************************/ bool LabEngine::createScreen(bool HiRes) { if (HiRes) { - g_lab->_screenWidth = 640; - g_lab->_screenHeight = 480; + _screenWidth = 640; + _screenHeight = 480; } else { - g_lab->_screenWidth = 320; - g_lab->_screenHeight = 200; + _screenWidth = 320; + _screenHeight = 200; } - g_lab->_screenBytesPerPage = g_lab->_screenWidth * g_lab->_screenHeight; + _screenBytesPerPage = _screenWidth * _screenHeight; - _displayBuffer = (byte *)malloc(g_lab->_screenBytesPerPage); + _displayBuffer = (byte *)malloc(_screenBytesPerPage); return true; } @@ -106,8 +106,8 @@ void LabEngine::WSDL_ProcessInput(bool can_delay) { _mousePos.x = 0; _mouseAtEdge = true; } - if (_mousePos.x > g_lab->_screenWidth - 1) { - _mousePos.x = g_lab->_screenWidth; + if (_mousePos.x > _screenWidth - 1) { + _mousePos.x = _screenWidth; _mouseAtEdge = true; } @@ -116,8 +116,8 @@ void LabEngine::WSDL_ProcessInput(bool can_delay) { _mousePos.y = 0; _mouseAtEdge = true; } - if (_mousePos.y > g_lab->_screenHeight - 1) { - _mousePos.y = g_lab->_screenHeight; + if (_mousePos.y > _screenHeight - 1) { + _mousePos.y = _screenHeight; _mouseAtEdge = true; } @@ -157,7 +157,7 @@ void LabEngine::WSDL_ProcessInput(bool can_delay) { break; } - g_system->copyRectToScreen(_displayBuffer, g_lab->_screenWidth, 0, 0, g_lab->_screenWidth, g_lab->_screenHeight); + g_system->copyRectToScreen(_displayBuffer, _screenWidth, 0, 0, _screenWidth, _screenHeight); g_system->updateScreen(); } } @@ -173,7 +173,7 @@ Common::Point LabEngine::WSDL_GetMousePos() { } void LabEngine::waitTOF() { - g_system->copyRectToScreen(_displayBuffer, g_lab->_screenWidth, 0, 0, g_lab->_screenWidth, g_lab->_screenHeight); + g_system->copyRectToScreen(_displayBuffer, _screenWidth, 0, 0, _screenWidth, _screenHeight); g_system->updateScreen(); WSDL_ProcessInput(0); @@ -235,7 +235,7 @@ void LabEngine::VGASetPal(void *cmap, uint16 numcolors) { } void LabEngine::WSDL_UpdateScreen() { - g_system->copyRectToScreen(_displayBuffer, g_lab->_screenWidth, 0, 0, g_lab->_screenWidth, g_lab->_screenHeight); + g_system->copyRectToScreen(_displayBuffer, _screenWidth, 0, 0, _screenWidth, _screenHeight); g_system->updateScreen(); WSDL_ProcessInput(0); @@ -276,20 +276,20 @@ void LabEngine::drawImage(Image *Im, uint16 x, uint16 y) { dy = 0; } - if (dx + w > g_lab->_screenWidth) - w = g_lab->_screenWidth - dx; + if (dx + w > _screenWidth) + w = _screenWidth - dx; - if (dy + h > g_lab->_screenHeight) - h = g_lab->_screenHeight - dy; + if (dy + h > _screenHeight) + h = _screenHeight - dy; if ((w > 0) && (h > 0)) { byte *s = Im->ImageData + sy * Im->Width + sx; - byte *d = getVGABaseAddr() + dy * g_lab->_screenWidth + dx; + byte *d = getVGABaseAddr() + dy * _screenWidth + dx; while (h-- > 0) { memcpy(d, s, w); s += Im->Width; - d += g_lab->_screenWidth; + d += _screenWidth; } } } @@ -319,15 +319,15 @@ void LabEngine::drawMaskImage(Image *Im, uint16 x, uint16 y) { dy = 0; } - if (dx + w > g_lab->_screenWidth) - w = g_lab->_screenWidth - dx; + if (dx + w > _screenWidth) + w = _screenWidth - dx; - if (dy + h > g_lab->_screenHeight) - h = g_lab->_screenHeight - dy; + if (dy + h > _screenHeight) + h = _screenHeight - dy; if ((w > 0) && (h > 0)) { byte *s = Im->ImageData + sy * Im->Width + sx; - byte *d = getVGABaseAddr() + dy * g_lab->_screenWidth + dx; + byte *d = getVGABaseAddr() + dy * _screenWidth + dx; while (h-- > 0) { byte *ss = s; @@ -342,7 +342,7 @@ void LabEngine::drawMaskImage(Image *Im, uint16 x, uint16 y) { } s += Im->Width; - d += g_lab->_screenWidth; + d += _screenWidth; } } } @@ -372,20 +372,20 @@ void LabEngine::readScreenImage(Image *Im, uint16 x, uint16 y) { dy = 0; } - if (dx + w > g_lab->_screenWidth) - w = g_lab->_screenWidth - dx; + if (dx + w > _screenWidth) + w = _screenWidth - dx; - if (dy + h > g_lab->_screenHeight) - h = g_lab->_screenHeight - dy; + if (dy + h > _screenHeight) + h = _screenHeight - dy; if ((w > 0) && (h > 0)) { byte *s = Im->ImageData + sy * Im->Width + sx; - byte *d = getVGABaseAddr() + dy * g_lab->_screenWidth + dx; + byte *d = getVGABaseAddr() + dy * _screenWidth + dx; while (h-- > 0) { memcpy(s, d, w); s += Im->Width; - d += g_lab->_screenWidth; + d += _screenWidth; } } } @@ -549,14 +549,14 @@ void LabEngine::rectFill(uint16 x1, uint16 y1, uint16 x2, uint16 y2) { dy = 0; } - if (dx + w > g_lab->_screenWidth) - w = g_lab->_screenWidth - dx; + if (dx + w > _screenWidth) + w = _screenWidth - dx; - if (dy + h > g_lab->_screenHeight) - h = g_lab->_screenHeight - dy; + if (dy + h > _screenHeight) + h = _screenHeight - dy; if ((w > 0) && (h > 0)) { - char *d = (char *)getVGABaseAddr() + dy * g_lab->_screenWidth + dx; + char *d = (char *)getVGABaseAddr() + dy * _screenWidth + dx; while (h-- > 0) { char *dd = d; @@ -566,7 +566,7 @@ void LabEngine::rectFill(uint16 x1, uint16 y1, uint16 x2, uint16 y2) { *dd++ = _curapen; } - d += g_lab->_screenWidth; + d += _screenWidth; } } } @@ -606,14 +606,14 @@ void LabEngine::ghoastRect(uint16 pencolor, uint16 x1, uint16 y1, uint16 x2, uin dy = 0; } - if (dx + w > g_lab->_screenWidth) - w = g_lab->_screenWidth - dx; + if (dx + w > _screenWidth) + w = _screenWidth - dx; - if (dy + h > g_lab->_screenHeight) - h = g_lab->_screenHeight - dy; + if (dy + h > _screenHeight) + h = _screenHeight - dy; if ((w > 0) && (h > 0)) { - char *d = (char *)getVGABaseAddr() + dy * g_lab->_screenWidth + dx; + char *d = (char *)getVGABaseAddr() + dy * _screenWidth + dx; while (h-- > 0) { char *dd = d; @@ -630,7 +630,7 @@ void LabEngine::ghoastRect(uint16 pencolor, uint16 x1, uint16 y1, uint16 x2, uin ww -= 2; } - d += g_lab->_screenWidth; + d += _screenWidth; dy++; } } -- cgit v1.2.3