aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2019-10-17 01:43:54 +0200
committerEugene Sandulenko2019-10-17 01:43:54 +0200
commitde42a124ed21f412ef1a23b09a6a3954d0cb2df0 (patch)
tree49bd37058137b71e630c0bb5003a7e1c65541fd8 /engines
parent6100de0b3a0f869b0dc94b5f961c60206b264bf1 (diff)
downloadscummvm-rg350-de42a124ed21f412ef1a23b09a6a3954d0cb2df0.tar.gz
scummvm-rg350-de42a124ed21f412ef1a23b09a6a3954d0cb2df0.tar.bz2
scummvm-rg350-de42a124ed21f412ef1a23b09a6a3954d0cb2df0.zip
PINK: Enforce built-in fonts in WM
Diffstat (limited to 'engines')
-rw-r--r--engines/pink/director.cpp27
-rw-r--r--engines/pink/director.h5
2 files changed, 19 insertions, 13 deletions
diff --git a/engines/pink/director.cpp b/engines/pink/director.cpp
index 1baf239dd3..8560469a03 100644
--- a/engines/pink/director.cpp
+++ b/engines/pink/director.cpp
@@ -90,17 +90,22 @@ static void redrawCallback(void *ref) {
Director::Director()
: _surface(640, 480), _textRendered(false) {
- _wm.setScreen(&_surface);
- _wm.setMode(Graphics::kWMModeNoDesktop | Graphics::kWMModeAutohideMenu | Graphics::kWMModalMenuMode |
- Graphics::kWMModeForceBuiltinFonts);
- _wm.setMenuHotzone(Common::Rect(0, 0, 640, 23));
- _wm.setMenuDelay(250000);
- _wm.setEngineRedrawCallback(this, redrawCallback);
+ _wm = new Graphics::MacWindowManager(Graphics::kWMModeNoDesktop | Graphics::kWMModeAutohideMenu
+ | Graphics::kWMModalMenuMode | Graphics::kWMModeForceBuiltinFonts);
+
+ _wm->setScreen(&_surface);
+ _wm->setMenuHotzone(Common::Rect(0, 0, 640, 23));
+ _wm->setMenuDelay(250000);
+ _wm->setEngineRedrawCallback(this, redrawCallback);
+}
+
+Director::~Director() {
+ delete _wm;
}
void Director::update() {
- if (_wm.isMenuActive()) {
- _wm.draw();
+ if (_wm->isMenuActive()) {
+ _wm->draw();
g_system->updateScreen();
return;
}
@@ -114,19 +119,19 @@ void Director::update() {
_sprites[i]->update();
}
- _wm.draw();
+ _wm->draw();
draw();
}
bool Director::processEvent(Common::Event &event) {
- return _wm.processEvent(event);
+ return _wm->processEvent(event);
}
void Director::setPalette(const byte *palette) {
g_system->getPaletteManager()->setPalette(palette, 0, 256);
- _wm.passPalette(palette, 256);
+ _wm->passPalette(palette, 256);
}
void Director::addTextAction(ActionText *txt) {
diff --git a/engines/pink/director.h b/engines/pink/director.h
index af8dbfc35d..9dff49a271 100644
--- a/engines/pink/director.h
+++ b/engines/pink/director.h
@@ -48,6 +48,7 @@ class ActionText;
class Director {
public:
Director();
+ ~Director();
void update();
bool processEvent(Common::Event &event);
@@ -75,7 +76,7 @@ public:
Actor *getActorByPoint(const Common::Point point);
- Graphics::MacWindowManager &getWndManager() { return _wm; };
+ Graphics::MacWindowManager &getWndManager() { return *_wm; };
void draw(bool blit = true);
@@ -85,7 +86,7 @@ private:
private:
Graphics::Screen _surface;
- Graphics::MacWindowManager _wm;
+ Graphics::MacWindowManager *_wm;
Common::Array<Common::Rect> _dirtyRects;
Common::Array<ActionCEL *> _sprites;
Common::Array<ActionCEL *> _savedSprites;