diff options
author | Paul Gilbert | 2017-12-09 16:31:27 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-12-09 16:31:27 -0500 |
commit | deb4261b6ab3bc2afd6c174dc9f224432ef748d8 (patch) | |
tree | a5bbdeb9d8f14cfcfb65e18b49e85a292bc48aba | |
parent | 7ed6b9cdfa2c17a7e236445d5d8aadcfbc846a39 (diff) | |
download | scummvm-rg350-deb4261b6ab3bc2afd6c174dc9f224432ef748d8.tar.gz scummvm-rg350-deb4261b6ab3bc2afd6c174dc9f224432ef748d8.tar.bz2 scummvm-rg350-deb4261b6ab3bc2afd6c174dc9f224432ef748d8.zip |
XEEN: Fix rendering of game screen on startup
-rw-r--r-- | engines/xeen/window.cpp | 8 | ||||
-rw-r--r-- | engines/xeen/window.h | 5 | ||||
-rw-r--r-- | engines/xeen/worldofxeen/worldofxeen_menu.cpp | 8 | ||||
-rw-r--r-- | engines/xeen/worldofxeen/worldofxeen_menu.h | 16 |
4 files changed, 35 insertions, 2 deletions
diff --git a/engines/xeen/window.cpp b/engines/xeen/window.cpp index ef3fedeec2..78e8df32e0 100644 --- a/engines/xeen/window.cpp +++ b/engines/xeen/window.cpp @@ -136,7 +136,7 @@ void Window::setBounds(const Common::Rect &r) { void Window::open() { Screen &screen = *g_vm->_screen; - if (!_enabled) { + if (!_enabled && !isFullScreen()) { // Save a copy of the area under the window _savedArea.create(_bounds.width(), _bounds.height()); _savedArea.copyRectToSurface(screen, 0, 0, _bounds); @@ -163,7 +163,7 @@ void Window::open() { void Window::close() { Screen &screen = *g_vm->_screen; - if (_enabled) { + if (_enabled && !isFullScreen()) { // Update the window update(); @@ -258,4 +258,8 @@ void Window::drawList(DrawStruct *items, int count) { } } +bool Window::isFullScreen() const { + return _bounds.width() == SCREEN_WIDTH && _bounds.height() == SCREEN_HEIGHT; +} + } // End of namespace Xeen diff --git a/engines/xeen/window.h b/engines/xeen/window.h index 0594a9946d..2389065300 100644 --- a/engines/xeen/window.h +++ b/engines/xeen/window.h @@ -86,6 +86,11 @@ private: int _border; int _xLo, _xHi; int _ycL, _ycH; +private: + /** + * Returns true if the window is covering the entire screen + */ + bool isFullScreen() const; public: bool _enabled; public: diff --git a/engines/xeen/worldofxeen/worldofxeen_menu.cpp b/engines/xeen/worldofxeen/worldofxeen_menu.cpp index 54cde36d46..b58bf64dc0 100644 --- a/engines/xeen/worldofxeen/worldofxeen_menu.cpp +++ b/engines/xeen/worldofxeen/worldofxeen_menu.cpp @@ -95,14 +95,17 @@ void WorldOfXeenMenu::execute() { if (key == 27) { // Hide the options menu + closeWindow(); break; } else if (key == 'C' || key == 'V') { // Show credits + closeWindow(); CreditsScreen::show(_vm); break; } else if (key == 'S') { // Start new game WOX_VM._pendingAction = WOX_PLAY_GAME; + closeWindow(); return; } } @@ -213,6 +216,11 @@ void WorldOptionsMenu::openWindow() { windows[GAME_WINDOW].open(); } +void WorldOptionsMenu::closeWindow() { + Windows &windows = *_vm->_windows; + windows[GAME_WINDOW].close(); +} + void WorldOptionsMenu::showContents(SpriteResource &title1, bool waitFlag) { EventsManager &events = *_vm->_events; Screen &screen = *_vm->_screen; diff --git a/engines/xeen/worldofxeen/worldofxeen_menu.h b/engines/xeen/worldofxeen/worldofxeen_menu.h index 49553dd10f..39d309c751 100644 --- a/engines/xeen/worldofxeen/worldofxeen_menu.h +++ b/engines/xeen/worldofxeen/worldofxeen_menu.h @@ -45,7 +45,15 @@ protected: virtual void setupButtons(SpriteResource *buttons); + /** + * Opens the menu window + */ virtual void openWindow() {} + + /** + * Closes the menu window + */ + virtual void closeWindow() {} public: virtual ~WorldOfXeenMenu() {} @@ -82,8 +90,16 @@ protected: virtual void setupButtons(SpriteResource *buttons); + /** + * Opens the menu window + */ virtual void openWindow(); + /** + * Closes the menu window + */ + virtual void closeWindow(); + virtual void showContents(SpriteResource &title1, bool mode); public: WorldOptionsMenu(XeenEngine *vm) : DarkSideOptionsMenu(vm), _bgFrame(0) {} |