aboutsummaryrefslogtreecommitdiff
path: root/engines/pink
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pink')
-rw-r--r--engines/pink/cursor_mgr.h2
-rw-r--r--engines/pink/director.h4
-rw-r--r--engines/pink/gui.cpp2
-rw-r--r--engines/pink/pink.cpp14
-rw-r--r--engines/pink/pink.h13
5 files changed, 18 insertions, 17 deletions
diff --git a/engines/pink/cursor_mgr.h b/engines/pink/cursor_mgr.h
index a08cb8e417..5e336a3e18 100644
--- a/engines/pink/cursor_mgr.h
+++ b/engines/pink/cursor_mgr.h
@@ -25,8 +25,6 @@
#include "common/rect.h"
-#include "graphics/wincursor.h"
-
#include "pink/objects/object.h"
namespace Pink {
diff --git a/engines/pink/director.h b/engines/pink/director.h
index 9dff49a271..a3255fc859 100644
--- a/engines/pink/director.h
+++ b/engines/pink/director.h
@@ -30,10 +30,6 @@
#include "graphics/macgui/macwindowmanager.h"
#include "graphics/screen.h"
-namespace Common {
- class PEResources;
-}
-
namespace Graphics {
class MacMenu;
}
diff --git a/engines/pink/gui.cpp b/engines/pink/gui.cpp
index 5267cbb540..9286747f63 100644
--- a/engines/pink/gui.cpp
+++ b/engines/pink/gui.cpp
@@ -129,7 +129,7 @@ static void menuCommandsCallback(int action, Common::U32String &, void *data) {
engine->executeMenuCommand(action);
}
-void PinkEngine::initMenu(Common::PEResources &exeResources) {
+void PinkEngine::initMenu(Common::PEResources *exeResources) {
_director->getWndManager().setEnginePauseCallback(this, &pauseEngine);
_menu = Graphics::MacMenu::createMenuFromPEexe(exeResources, &_director->getWndManager());
diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp
index 2852348a72..a067d2bddf 100644
--- a/engines/pink/pink.cpp
+++ b/engines/pink/pink.cpp
@@ -30,6 +30,7 @@
#include "graphics/cursorman.h"
#include "graphics/thumbnail.h"
#include "graphics/surface.h"
+#include "graphics/wincursor.h"
#include "pink/pink.h"
#include "pink/console.h"
@@ -40,7 +41,7 @@
namespace Pink {
PinkEngine::PinkEngine(OSystem *system, const ADGameDescription *desc)
- : Engine(system), _console(nullptr), _rnd("pink"),
+ : Engine(system), _console(nullptr), _rnd("pink"), _exeResources(nullptr),
_desc(desc), _bro(nullptr), _menu(nullptr), _actor(nullptr),
_module(nullptr), _director(nullptr), _pdaMgr(this) {
@@ -56,6 +57,7 @@ PinkEngine::PinkEngine(OSystem *system, const ADGameDescription *desc)
PinkEngine::~PinkEngine() {
delete _console;
+ delete _exeResources;
delete _bro;
_pdaMgr.close();
for (uint i = 0; i < _modules.size(); ++i) {
@@ -72,16 +74,16 @@ Common::Error PinkEngine::init() {
debugC(10, kPinkDebugGeneral, "PinkEngine init");
initGraphics(640, 480);
- Common::PEResources exeResources;
+ _exeResources = new Common::PEResources();
Common::String fileName = isPeril() ? "pptp.exe" : "hpp.exe";
- if (!exeResources.loadFromEXE(fileName)) {
+ if (!_exeResources->loadFromEXE(fileName)) {
return Common::kNoGameDataFoundError;
}
_console = new Console(this);
_director = new Director();
- initMenu(exeResources);
+ initMenu(_exeResources);
Common::String orbName;
Common::String broName;
@@ -96,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(_exeResources))
return Common::kNoGameDataFoundError;
setCursor(kLoadingCursor);
@@ -233,7 +235,7 @@ bool PinkEngine::checkValueOfVariable(Common::String &variable, Common::String &
return _variables[variable] == value;
}
-bool PinkEngine::loadCursors(Common::PEResources &exeResources) {
+bool PinkEngine::loadCursors(Common::PEResources *exeResources) {
bool isPokus = !isPeril();
_cursors.reserve(kCursorsCount);
diff --git a/engines/pink/pink.h b/engines/pink/pink.h
index cfc7190399..ce48a900ee 100644
--- a/engines/pink/pink.h
+++ b/engines/pink/pink.h
@@ -29,8 +29,6 @@
#include "engines/engine.h"
#include "engines/savestate.h"
-#include "graphics/wincursor.h"
-
#include "gui/debugger.h"
#include "pink/constants.h"
@@ -62,8 +60,13 @@
struct ADGameDescription;
+namespace Common {
+ class PEResources;
+}
+
namespace Graphics {
class MacMenu;
+class WinCursorGroup;
}
namespace Pink {
@@ -132,9 +135,9 @@ public:
private:
Common::Error init();
- void initMenu(Common::PEResources &exeResources);
+ void initMenu(Common::PEResources *exeResources);
- bool loadCursors(Common::PEResources &exeResources);
+ bool loadCursors(Common::PEResources *exeResources);
void initModule(const Common::String &moduleName, const Common::String &pageName, Archive *saveFile);
void addModule(const Common::String &moduleName);
@@ -148,6 +151,8 @@ private:
Common::String _nextModule;
Common::String _nextPage;
+ Common::PEResources *_exeResources;
+
OrbFile _orb;
BroFile *_bro;