From 463192aa51eb809d258617c3cce24b4ae9857fd9 Mon Sep 17 00:00:00 2001 From: "Henrik \"Henke37\" Andersson" Date: Thu, 13 Feb 2020 20:56:41 +0100 Subject: [PATCH] PINK: remove member function arguments in favor of using the existing `_exeResources` member variable. --- engines/pink/gui.cpp | 4 ++-- engines/pink/pink.cpp | 42 +++++++++++++++++++++--------------------- engines/pink/pink.h | 4 ++-- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/engines/pink/gui.cpp b/engines/pink/gui.cpp index fccd0f8e3c1..fb1a42441aa 100644 --- a/engines/pink/gui.cpp +++ b/engines/pink/gui.cpp @@ -131,10 +131,10 @@ static void menuCommandsCallback(int action, Common::U32String &, void *data) { engine->executeMenuCommand(action); } -void PinkEngine::initMenu(Common::PEResources *exeResources) { +void PinkEngine::initMenu() { _director->getWndManager().setEnginePauseCallback(this, &pauseEngine); - _menu = Graphics::MacMenu::createMenuFromPEexe(exeResources, &_director->getWndManager()); + _menu = Graphics::MacMenu::createMenuFromPEexe(_exeResources, &_director->getWndManager()); _menu->calcDimensions(); _menu->setCommandsCallback(&menuCommandsCallback, this); } diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp index a067d2bddfb..2f16e5bc61c 100644 --- a/engines/pink/pink.cpp +++ b/engines/pink/pink.cpp @@ -83,7 +83,7 @@ Common::Error PinkEngine::init() { _console = new Console(this); _director = new Director(); - initMenu(_exeResources); + initMenu(); Common::String orbName; Common::String broName; @@ -98,7 +98,7 @@ Common::Error PinkEngine::init() { if (!_orb.open(orbName) || (_bro && !_bro->open(broName) && _orb.getTimestamp() == _bro->getTimestamp())) return Common::kNoGameDataFoundError; - if (!loadCursors(_exeResources)) + if (!loadCursors()) return Common::kNoGameDataFoundError; setCursor(kLoadingCursor); @@ -235,41 +235,41 @@ bool PinkEngine::checkValueOfVariable(Common::String &variable, Common::String & return _variables[variable] == value; } -bool PinkEngine::loadCursors(Common::PEResources *exeResources) { +bool PinkEngine::loadCursors() { bool isPokus = !isPeril(); _cursors.reserve(kCursorsCount); - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusLoadingCursorID)); - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusClickableFirstCursorID)); - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusClickableSecondCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPokusLoadingCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPokusClickableFirstCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPokusClickableSecondCursorID)); if (isPokus) { - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusClickableThirdCursorID)); - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusNotClickableCursorID)); - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusHoldingItemCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPokusClickableThirdCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPokusNotClickableCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPokusHoldingItemCursorID)); } else { - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPerilClickableThirdCursorID)); - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPerilNotClickableCursorID)); - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPerilHoldingItemCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPerilClickableThirdCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPerilNotClickableCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPerilHoldingItemCursorID)); } - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusPDADefaultCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPokusPDADefaultCursorID)); if (isPokus) { - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusPDAClickableFirstFrameCursorID)); - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusPDAClickableSecondFrameCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPokusPDAClickableFirstFrameCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPokusPDAClickableSecondFrameCursorID)); } else { - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPerilPDAClickableFirstFrameCursorID)); - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPerilPDAClickableSecondFrameCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPerilPDAClickableFirstFrameCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPerilPDAClickableSecondFrameCursorID)); } - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusExitLeftCursorID)); - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusExitRightCursorID)); - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusExitForwardCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPokusExitLeftCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPokusExitRightCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPokusExitForwardCursorID)); if (isPokus) - _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(exeResources, kPokusExitDownCursorID)); + _cursors.push_back(Graphics::WinCursorGroup::createCursorGroup(_exeResources, kPokusExitDownCursorID)); return true; } diff --git a/engines/pink/pink.h b/engines/pink/pink.h index d9a30bd2e08..ea19816c4b5 100644 --- a/engines/pink/pink.h +++ b/engines/pink/pink.h @@ -135,9 +135,9 @@ public: private: Common::Error init(); - void initMenu(Common::PEResources *exeResources); + void initMenu(); - bool loadCursors(Common::PEResources *exeResources); + bool loadCursors(); void initModule(const Common::String &moduleName, const Common::String &pageName, Archive *saveFile); void addModule(const Common::String &moduleName);