diff options
author | Colin Snover | 2018-02-10 12:26:50 -0600 |
---|---|---|
committer | Filippos Karapetis | 2019-05-12 19:05:50 +0300 |
commit | 8cec2ba8f9bc9c213d45d890ff3a19532206fe24 (patch) | |
tree | 1f47effd3a6b4c18dd58e044c2888e71b082c5e3 /engines/sci | |
parent | fde0a488b745958cc5e799c31f37974336d65b1d (diff) | |
download | scummvm-rg350-8cec2ba8f9bc9c213d45d890ff3a19532206fe24.tar.gz scummvm-rg350-8cec2ba8f9bc9c213d45d890ff3a19532206fe24.tar.bz2 scummvm-rg350-8cec2ba8f9bc9c213d45d890ff3a19532206fe24.zip |
SCI: Remove unnecessary two-phase GfxCursor initialisation
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/graphics/cursor.cpp | 13 | ||||
-rw-r--r-- | engines/sci/graphics/cursor.h | 4 | ||||
-rw-r--r-- | engines/sci/sci.cpp | 3 |
3 files changed, 4 insertions, 16 deletions
diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index 9c26d816a1..56177db9f3 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -40,8 +40,8 @@ namespace Sci { -GfxCursor::GfxCursor(ResourceManager *resMan, GfxPalette *palette, GfxScreen *screen) - : _resMan(resMan), _palette(palette), _screen(screen) { +GfxCursor::GfxCursor(ResourceManager *resMan, GfxPalette *palette, GfxScreen *screen, GfxCoordAdjuster16 *coordAdjuster, EventManager *eventMan) + : _resMan(resMan), _palette(palette), _screen(screen), _coordAdjuster(coordAdjuster), _event(eventMan) { _upscaledHires = _screen->getUpscaledHires(); _isVisible = true; @@ -68,10 +68,6 @@ GfxCursor::GfxCursor(ResourceManager *resMan, GfxPalette *palette, GfxScreen *sc _useSilverSQ4CDCursors = ConfMan.getBool("silver_cursors"); else _useSilverSQ4CDCursors = false; - - // _coordAdjuster and _event will be initialized later on - _coordAdjuster = NULL; - _event = NULL; } GfxCursor::~GfxCursor() { @@ -79,11 +75,6 @@ GfxCursor::~GfxCursor() { kernelClearZoomZone(); } -void GfxCursor::init(GfxCoordAdjuster16 *coordAdjuster, EventManager *event) { - _coordAdjuster = coordAdjuster; - _event = event; -} - void GfxCursor::kernelShow() { CursorMan.showMouse(true); _isVisible = true; diff --git a/engines/sci/graphics/cursor.h b/engines/sci/graphics/cursor.h index 8d9ce7c0ab..99ed5b49e1 100644 --- a/engines/sci/graphics/cursor.h +++ b/engines/sci/graphics/cursor.h @@ -54,11 +54,9 @@ struct SciCursorSetPositionWorkarounds { class GfxCursor { public: - GfxCursor(ResourceManager *resMan, GfxPalette *palette, GfxScreen *screen); + GfxCursor(ResourceManager *resMan, GfxPalette *palette, GfxScreen *screen, GfxCoordAdjuster16 *coordAdjuster, EventManager *eventMan); ~GfxCursor(); - void init(GfxCoordAdjuster16 *coordAdjuster, EventManager *event); - void kernelShow(); void kernelHide(); bool isVisible(); diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 717d6786b7..416d5c5cf3 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -615,10 +615,9 @@ void SciEngine::initGraphics() { } else { #endif // SCI0-SCI1.1 graphic objects creation - _gfxCursor = new GfxCursor(_resMan, _gfxPalette16, _gfxScreen); _gfxPorts = new GfxPorts(_gamestate->_segMan, _gfxScreen); _gfxCoordAdjuster = new GfxCoordAdjuster16(_gfxPorts); - _gfxCursor->init(_gfxCoordAdjuster, _eventMan); + _gfxCursor = new GfxCursor(_resMan, _gfxPalette16, _gfxScreen, _gfxCoordAdjuster, _eventMan); _gfxCompare = new GfxCompare(_gamestate->_segMan, _gfxCache, _gfxScreen, _gfxCoordAdjuster); _gfxTransitions = new GfxTransitions(_gfxScreen, _gfxPalette16); _gfxPaint16 = new GfxPaint16(_resMan, _gamestate->_segMan, _gfxCache, _gfxPorts, _gfxCoordAdjuster, _gfxScreen, _gfxPalette16, _gfxTransitions, _audio); |