[Scummvm-git-logs] scummvm master -> deb4261b6ab3bc2afd6c174dc9f224432ef748d8
dreammaster
dreammaster at scummvm.org
Sat Dec 9 22:31:39 CET 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
deb4261b6a XEEN: Fix rendering of game screen on startup
Commit: deb4261b6ab3bc2afd6c174dc9f224432ef748d8
https://github.com/scummvm/scummvm/commit/deb4261b6ab3bc2afd6c174dc9f224432ef748d8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-12-09T16:31:27-05:00
Commit Message:
XEEN: Fix rendering of game screen on startup
Changed paths:
engines/xeen/window.cpp
engines/xeen/window.h
engines/xeen/worldofxeen/worldofxeen_menu.cpp
engines/xeen/worldofxeen/worldofxeen_menu.h
diff --git a/engines/xeen/window.cpp b/engines/xeen/window.cpp
index ef3fede..78e8df3 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 0594a99..2389065 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 54cde36..b58bf64 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 49553dd..39d309c 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) {}
More information about the Scummvm-git-logs
mailing list