diff options
-rw-r--r-- | engines/wage/macwindow.cpp | 15 | ||||
-rw-r--r-- | engines/wage/macwindow.h | 8 |
2 files changed, 23 insertions, 0 deletions
diff --git a/engines/wage/macwindow.cpp b/engines/wage/macwindow.cpp index a9be4458fa..002422e4fa 100644 --- a/engines/wage/macwindow.cpp +++ b/engines/wage/macwindow.cpp @@ -50,11 +50,21 @@ namespace Wage { MacWindow::MacWindow(WindowType type) : _type(type) { + _active = false; + _bordersDirty = true; } MacWindow::~MacWindow() { } +void MacWindow::setActive(bool active) { + if (active == _active) + return; + + _active = active; + _bordersDirty = true; +} + void MacWindow::resize(int w, int h) { _surface.free(); @@ -62,7 +72,12 @@ void MacWindow::resize(int w, int h) { } void MacWindow::draw(Graphics::Surface *g, int x, int y) { + if (_bordersDirty) + drawBorder(); +} +void MacWindow::drawBorder() { + _bordersDirty = false; } } // End of namespace Wage diff --git a/engines/wage/macwindow.h b/engines/wage/macwindow.h index 370468e8db..4efdbd0a0f 100644 --- a/engines/wage/macwindow.h +++ b/engines/wage/macwindow.h @@ -62,10 +62,18 @@ class MacWindow { ~MacWindow(); void resize(int w, int h); void draw(Graphics::Surface *g, int x, int y); + void setActive(bool active); + Graphics::ManagedSurface *getSurface() { return &_surface; } + +private: + void drawBorder(); private: Graphics::ManagedSurface _surface; + Graphics::ManagedSurface _borderSurface; WindowType _type; + bool _active; + bool _borderIsDirty; }; } // End of namespace Wage |