diff options
-rw-r--r-- | engines/wage/gui.cpp | 18 | ||||
-rw-r--r-- | engines/wage/gui.h | 6 | ||||
-rw-r--r-- | engines/wage/macwindow.cpp | 2 | ||||
-rw-r--r-- | engines/wage/macwindowmanager.cpp | 23 | ||||
-rw-r--r-- | engines/wage/macwindowmanager.h | 5 |
5 files changed, 36 insertions, 18 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 09eeb0f3ee..50dadc881f 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -73,7 +73,6 @@ static const byte palette[] = { static byte fillPatterns[][8] = { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, // kPatternSolid { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 }, // kPatternStripes - { 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55 }, // kPatternCheckers { 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa } // kPatternCheckers2 }; @@ -231,17 +230,11 @@ const Graphics::Font *Gui::getTitleFont() { return getFont("Chicago-12", Graphics::FontManager::kBigGUIFont); } -void Gui::drawDesktop() { - // Draw desktop - Common::Rect r(0, 0, _screen.w - 1, _screen.h - 1); - Design::drawFilledRoundRect(&_screen, r, kDesktopArc, kColorBlack, _patterns, kPatternCheckers); - g_system->copyRectToScreen(_screen.getPixels(), _screen.pitch, 0, 0, _screen.w, _screen.h); -} - void Gui::draw() { if (_engine->_isGameOver) { if (_menuDirty) { - drawDesktop(); + _wm.setFullRefresh(true); + _wm.draw(); _menu->render(); } @@ -260,13 +253,8 @@ void Gui::draw() { _sceneWindow->setDimensions(*_scene->_designBounds); _sceneWindow->setTitle(_scene->_name); - _sceneWindow->setDirty(true); _consoleWindow->setDimensions(*_scene->_textBounds); - _consoleWindow->setDirty(true); - } - if (_sceneDirty) { - drawDesktop(); _wm.setFullRefresh(true); } @@ -370,7 +358,7 @@ bool Gui::processConsoleEvents(WindowClick click, Common::Event &event) { undrawCursor(); _cursorY -= (_scrollPos - oldScrollPos); _consoleDirty = true; - _consoleFullRedraw = true; + _consoleFullRedraw = true; break; case kBorderScrollDown: _scrollPos = MIN<int>((_lines.size() - 2) * _consoleLineHeight, _scrollPos + _consoleLineHeight); diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 8a819822c6..2feb259e9f 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -78,8 +78,7 @@ enum { enum { kPatternSolid = 1, kPatternStripes = 2, - kPatternCheckers = 3, - kPatternCheckers2 = 4 + kPatternCheckers2 = 3 }; class Gui { @@ -117,11 +116,12 @@ public: bool processSceneEvents(WindowClick click, Common::Event &event); bool processConsoleEvents(WindowClick click, Common::Event &event); + Patterns &getPatterns() { return _patterns; } + private: void drawScene(); void drawConsole(); void undrawCursor(); - void drawDesktop(); void renderConsole(Graphics::ManagedSurface *g, const Common::Rect &r); void loadFonts(); void flowText(Common::String &str); diff --git a/engines/wage/macwindow.cpp b/engines/wage/macwindow.cpp index 034a52e63c..076584ca0e 100644 --- a/engines/wage/macwindow.cpp +++ b/engines/wage/macwindow.cpp @@ -116,6 +116,8 @@ void MacWindow::setDimensions(const Common::Rect &r) { resize(r.width(), r.height()); _dims.moveTo(r.left, r.top); updateInnerDims(); + + _contentIsDirty = true; } bool MacWindow::draw(Graphics::ManagedSurface *g, bool forceRedraw) { diff --git a/engines/wage/macwindowmanager.cpp b/engines/wage/macwindowmanager.cpp index 8625e86490..7985f5b624 100644 --- a/engines/wage/macwindowmanager.cpp +++ b/engines/wage/macwindowmanager.cpp @@ -53,17 +53,30 @@ #include "graphics/managed_surface.h" #include "wage/wage.h" +#include "wage/design.h" +#include "wage/gui.h" #include "wage/macwindow.h" #include "wage/macwindowmanager.h" namespace Wage { +enum { + kPatternCheckers = 1 +}; + +static byte fillPatterns[][8] = { { 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55 } // kPatternCheckers +}; + + MacWindowManager::MacWindowManager() { _screen = 0; _lastId = 0; _activeWindow = -1; _fullRefresh = true; + + for (int i = 0; i < ARRAYSIZE(fillPatterns); i++) + _patterns.push_back(fillPatterns[i]); } MacWindowManager::~MacWindowManager() { @@ -104,6 +117,9 @@ void MacWindowManager::setActive(int id) { void MacWindowManager::draw() { assert(_screen); + if (_fullRefresh) + drawDesktop(); + for (Common::List<MacWindow *>::const_iterator it = _windowStack.begin(); it != _windowStack.end(); it++) { MacWindow *w = *it; if (w->draw(_screen, _fullRefresh)) { @@ -119,6 +135,13 @@ void MacWindowManager::draw() { _fullRefresh = false; } +void MacWindowManager::drawDesktop() { + Common::Rect r(_screen->getBounds()); + + Design::drawFilledRoundRect(_screen, r, kDesktopArc, kColorBlack, _patterns, kPatternCheckers); + g_system->copyRectToScreen(_screen->getPixels(), _screen->pitch, 0, 0, _screen->w, _screen->h); +} + bool MacWindowManager::processEvent(Common::Event &event) { if (event.type != Common::EVENT_MOUSEMOVE && event.type != Common::EVENT_LBUTTONDOWN && event.type != Common::EVENT_LBUTTONUP) diff --git a/engines/wage/macwindowmanager.h b/engines/wage/macwindowmanager.h index 1e8b24b4ad..5efd0f4037 100644 --- a/engines/wage/macwindowmanager.h +++ b/engines/wage/macwindowmanager.h @@ -71,6 +71,9 @@ public: MacWindow *getWindow(int id) { return _windows[id]; } private: + void drawDesktop(); + +private: Graphics::ManagedSurface *_screen; Common::List<MacWindow *> _windowStack; @@ -80,6 +83,8 @@ private: int _activeWindow; bool _fullRefresh; + + Patterns _patterns; }; } // End of namespace Wage |