diff options
author | Strangerke | 2015-11-30 00:12:01 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:33:43 +0100 |
commit | 0c84355f4ae5651e7667b9aa0d2d3c6c28f21496 (patch) | |
tree | cab1af52284e13d12495465e087dc646c925eb69 /engines | |
parent | db773d92b7f035244538316a02d109671cdf8944 (diff) | |
download | scummvm-rg350-0c84355f4ae5651e7667b9aa0d2d3c6c28f21496.tar.gz scummvm-rg350-0c84355f4ae5651e7667b9aa0d2d3c6c28f21496.tar.bz2 scummvm-rg350-0c84355f4ae5651e7667b9aa0d2d3c6c28f21496.zip |
LAB: Move IsHiRes to main engine class
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lab/engine.cpp | 10 | ||||
-rw-r--r-- | engines/lab/graphics.cpp | 7 | ||||
-rw-r--r-- | engines/lab/intro.cpp | 4 | ||||
-rw-r--r-- | engines/lab/lab.cpp | 1 | ||||
-rw-r--r-- | engines/lab/lab.h | 1 | ||||
-rw-r--r-- | engines/lab/machine.cpp | 21 | ||||
-rw-r--r-- | engines/lab/map.cpp | 5 | ||||
-rw-r--r-- | engines/lab/mouse.cpp | 16 | ||||
-rw-r--r-- | engines/lab/special.cpp | 4 |
9 files changed, 33 insertions, 36 deletions
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index c3aa5f4ff6..e246d6d9be 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -47,7 +47,7 @@ bool LongWinInFront = false; TextFont *MsgFont; -extern bool DoBlack, waitForEffect, stopsound, DoNotDrawMessage, IsHiRes, nopalchange; +extern bool DoBlack, waitForEffect, stopsound, DoNotDrawMessage, nopalchange; /* Global parser data */ @@ -224,7 +224,7 @@ bool LabEngine::setUpScreens() { Gadget *curgad; uint16 y; - if (!createScreen(IsHiRes)) + if (!createScreen(_isHiRes)) return false; /* Loads in the graphics for the movement control panel */ @@ -1299,10 +1299,10 @@ from_crumbs: void LabEngine::go() { bool dointro = true; - IsHiRes = ((getFeatures() & GF_LOWRES) == 0); + _isHiRes = ((getFeatures() & GF_LOWRES) == 0); #if 0 - if (IsHiRes) + if (_isHiRes) warning("Running in HiRes mode"); else warning("Running in LowRes mode"); @@ -1317,7 +1317,7 @@ void LabEngine::go() { } if (!setUpScreens()) { - IsHiRes = false; + _isHiRes = false; mem = mem && setUpScreens(); } diff --git a/engines/lab/graphics.cpp b/engines/lab/graphics.cpp index ab04c3e67a..218f3c66d4 100644 --- a/engines/lab/graphics.cpp +++ b/engines/lab/graphics.cpp @@ -48,7 +48,6 @@ extern char diffcmap[256 * 3]; extern bool IsBM, nopalchange; extern bool DoBlack, stopsound; -extern bool IsHiRes; extern TextFont *MsgFont; extern const char *CurFileName; @@ -438,7 +437,7 @@ void LabEngine::doScrollBlack() { while (nheight) { g_music->updateMusic(); - if (!IsHiRes) + if (!_isHiRes) g_lab->waitTOF(); BaseAddr = (uint32 *)g_lab->getVGABaseAddr(); @@ -468,7 +467,7 @@ void LabEngine::doScrollBlack() { g_lab->WSDL_UpdateScreen(); - if (!IsHiRes) { + if (!_isHiRes) { if (nheight <= (height / 8)) by = 1; else if (nheight <= (height / 4)) @@ -626,7 +625,7 @@ void LabEngine::doTransWipe(CloseDataPtr *CPtr, char *filename) { uint16 LastY, CurY, linesdone = 0, lineslast; Image ImSource, ImDest; - if (IsHiRes) { + if (_isHiRes) { lineslast = 3; LastY = 358; } else { diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp index 43bb7c6cb9..269922bbb3 100644 --- a/engines/lab/intro.cpp +++ b/engines/lab/intro.cpp @@ -37,7 +37,7 @@ #include "lab/interface.h" namespace Lab { -extern bool nopalchange, DoBlack, IsHiRes; +extern bool nopalchange, DoBlack; extern char diffcmap[256 * 3]; extern uint16 *FadePalette; @@ -118,7 +118,7 @@ void Intro::doPictText(const char *filename, bool isscreen) { g_lab->setAPen(7L); g_lab->rectFill(VGAScaleX(10), VGAScaleY(10), VGAScaleX(310), VGAScaleY(190)); - Drawn = flowText(_msgfont, (!IsHiRes) * -1, 5, 7, false, false, true, true, VGAScaleX(14), VGAScaleY(11), VGAScaleX(306), VGAScaleY(189), (char *)curplace); + Drawn = flowText(_msgfont, (!g_lab->_isHiRes) * -1, 5, 7, false, false, true, true, VGAScaleX(14), VGAScaleY(11), VGAScaleX(306), VGAScaleY(189), (char *)curplace); fade(true, 0); } else { Drawn = g_lab->longDrawMessage((char *)curplace); diff --git a/engines/lab/lab.cpp b/engines/lab/lab.cpp index 5cc49b0462..b2e779f07e 100644 --- a/engines/lab/lab.cpp +++ b/engines/lab/lab.cpp @@ -72,6 +72,7 @@ LabEngine::LabEngine(OSystem *syst, const ADGameDescription *gameDesc) _nextKeyIn = 0; _nextKeyOut = 0; + _isHiRes = false; //const Common::FSNode gameDataDir(ConfMan.get("path")); //SearchMan.addSubDirectoryMatching(gameDataDir, "game"); //SearchMan.addSubDirectoryMatching(gameDataDir, "game/pict"); diff --git a/engines/lab/lab.h b/engines/lab/lab.h index 4b5f5d1d37..8ead009fd7 100644 --- a/engines/lab/lab.h +++ b/engines/lab/lab.h @@ -113,6 +113,7 @@ private: bool _mouseAtEdge; public: byte *_tempScrollData; + bool _isHiRes; private: bool createScreen(bool HiRes); diff --git a/engines/lab/machine.cpp b/engines/lab/machine.cpp index b2ce65e9db..2bef80da2d 100644 --- a/engines/lab/machine.cpp +++ b/engines/lab/machine.cpp @@ -30,18 +30,17 @@ #include "common/str.h" +#include "lab/lab.h" #include "lab/stddefines.h" namespace Lab { -bool IsHiRes = false; - /*****************************************************************************/ /* Scales the x co-ordinates to that of the new display. In the room parser */ /* file, co-ordinates are set up on a 360x336 display. */ /*****************************************************************************/ uint16 scaleX(uint16 x) { - if (IsHiRes) + if (g_lab->_isHiRes) return (uint16)((x * 16) / 9); else return (uint16)((x * 8) / 9); @@ -52,7 +51,7 @@ uint16 scaleX(uint16 x) { /* file, co-ordinates are set up on a 368x336 display. */ /*****************************************************************************/ uint16 scaleY(uint16 y) { - if (IsHiRes) + if (g_lab->_isHiRes) return (y + (y / 14)); else return ((y * 10) / 24); @@ -62,7 +61,7 @@ uint16 scaleY(uint16 y) { /* Scales the VGA cords to SVGA if necessary; otherwise, returns VGA cords. */ /*****************************************************************************/ int16 VGAScaleX(int16 x) { - if (IsHiRes) + if (g_lab->_isHiRes) return (x * 2); else return x; @@ -72,14 +71,14 @@ int16 VGAScaleX(int16 x) { /* Scales the VGA cords to SVGA if necessary; otherwise, returns VGA cords. */ /*****************************************************************************/ int16 VGAScaleY(int16 y) { - if (IsHiRes) + if (g_lab->_isHiRes) return ((y * 12) / 5); else return y; } uint16 SVGACord(uint16 cord) { - if (IsHiRes) + if (g_lab->_isHiRes) return cord; else return 0; @@ -89,7 +88,7 @@ uint16 SVGACord(uint16 cord) { /* Converts SVGA cords to VGA if necessary, otherwise returns VGA cords. */ /*****************************************************************************/ int VGAUnScaleX(int x) { - if (IsHiRes) + if (g_lab->_isHiRes) return (x / 2); else return x; @@ -99,7 +98,7 @@ int VGAUnScaleX(int x) { /* Converts SVGA cords to VGA if necessary, otherwise returns VGA cords. */ /*****************************************************************************/ int VGAUnScaleY(int y) { - if (IsHiRes) + if (g_lab->_isHiRes) return ((y * 5) / 12); else return y; @@ -108,7 +107,7 @@ int VGAUnScaleY(int y) { static char NewFileName[255]; /*****************************************************************************/ -/* Modifes the filename so that paths and stuff are correct. Should mostly */ +/* Modifies the filename so that paths and stuff are correct. Should mostly */ /* deal with assigns and the '/' instead of '\' on IBM systems. */ /* */ /* NOTE: Make a *copy* of the string, and modify that. It would be a real */ @@ -122,7 +121,7 @@ char *translateFileName(const char *filename) { Common::String fileNameStrFinal; if (fileNameStr.hasPrefix("P:")) { - if (IsHiRes) + if (g_lab->_isHiRes) fileNameStrFinal = "GAME/SPICT/"; else fileNameStrFinal = "GAME/PICT/"; diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp index d41322f426..e4b8b3258a 100644 --- a/engines/lab/map.cpp +++ b/engines/lab/map.cpp @@ -47,7 +47,6 @@ static TextFont bmf; extern uint16 Direction; -extern bool IsHiRes; extern CloseDataPtr CPtr; extern uint16 RoomNum; @@ -170,7 +169,7 @@ static uint16 AmigaMapPalette[] = { static uint16 mapScaleX(uint16 x) { - if (IsHiRes) + if (g_lab->_isHiRes) return (x - 45); else return ((x - 45) >> 1); @@ -179,7 +178,7 @@ static uint16 mapScaleX(uint16 x) { static uint16 mapScaleY(uint16 y) { - if (IsHiRes) + if (g_lab->_isHiRes) return y; else return ((y - 35) >> 1) - (y >> 6); diff --git a/engines/lab/mouse.cpp b/engines/lab/mouse.cpp index ace64593a3..eeae317f22 100644 --- a/engines/lab/mouse.cpp +++ b/engines/lab/mouse.cpp @@ -35,8 +35,6 @@ namespace Lab { -extern bool IsHiRes; - static bool LeftClick = false; static bool RightClick = false; @@ -75,7 +73,7 @@ Gadget *EventManager::checkGadgetHit(Gadget *gadlist, Common::Point pos) { (pos.x <= (gadlist->x + gadlist->Im->Width)) && (pos.y <= (gadlist->y + gadlist->Im->Height)) && !(GADGETOFF & gadlist->GadgetFlags)) { - if (IsHiRes) { + if (_vm->_isHiRes) { hitgad = gadlist; } else { mouseHide(); @@ -118,7 +116,7 @@ void EventManager::mouseHandler(int flag, Common::Point pos) { if (flag & 0x02) { /* Left mouse button click */ Gadget *tmp = NULL; if (ScreenGadgetList) - tmp = checkGadgetHit(ScreenGadgetList, IsHiRes ? pos : Common::Point(pos.x / 2, pos.y)); + tmp = checkGadgetHit(ScreenGadgetList, _vm->_isHiRes ? pos : Common::Point(pos.x / 2, pos.y)); if (tmp) LastGadgetHit = tmp; @@ -200,7 +198,7 @@ void EventManager::mouseHide() { /* from virtual to screen co-ordinates automatically. */ /*****************************************************************************/ Common::Point EventManager::getMousePos() { - if (IsHiRes) + if (_vm->_isHiRes) return _vm->_mousePos; else return Common::Point(_vm->_mousePos.x / 2, _vm->_mousePos.y); @@ -211,7 +209,7 @@ Common::Point EventManager::getMousePos() { /* Moves the mouse to new co-ordinates. */ /*****************************************************************************/ void EventManager::setMousePos(Common::Point pos) { - if (IsHiRes) + if (_vm->_isHiRes) g_system->warpMouse(pos.x, pos.y); else g_system->warpMouse(pos.x * 2, pos.y); @@ -229,14 +227,14 @@ void EventManager::setMousePos(Common::Point pos) { bool EventManager::mouseButton(uint16 *x, uint16 *y, bool leftbutton) { if (leftbutton) { if (LeftClick) { - *x = (!IsHiRes) ? (uint16)_vm->_mousePos.x / 2 : (uint16)_vm->_mousePos.x; + *x = (!_vm->_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)_vm->_mousePos.x / 2 : (uint16)_vm->_mousePos.x; + *x = (!_vm->_isHiRes) ? (uint16)_vm->_mousePos.x / 2 : (uint16)_vm->_mousePos.x; *y = (uint16)_vm->_mousePos.y; RightClick = false; return true; @@ -249,7 +247,7 @@ bool EventManager::mouseButton(uint16 *x, uint16 *y, bool leftbutton) { Gadget *EventManager::mouseGadget() { Gadget *Temp = LastGadgetHit; - LastGadgetHit = NULL; + LastGadgetHit = nullptr; return Temp; } diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp index 9b0ed4217f..96f7bfd1ac 100644 --- a/engines/lab/special.cpp +++ b/engines/lab/special.cpp @@ -85,7 +85,7 @@ uint16 CurTile[4][4] = { extern TextFont *MsgFont; extern uint16 *FadePalette; -extern bool nopalchange, DoBlack, IsHiRes; +extern bool nopalchange, DoBlack; extern BitMap *DispBitMap, *DrawBitMap; extern char diffcmap[3 * 256]; extern CloseDataPtr CPtr; @@ -187,7 +187,7 @@ static void changeCombination(uint16 number) { display.Height = g_lab->_screenHeight; for (uint16 i = 1; i <= (Images[combnum]->Height / 2); i++) { - if (IsHiRes) { + if (g_lab->_isHiRes) { if (i & 1) g_lab->waitTOF(); } else |