aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/wii
diff options
context:
space:
mode:
authorAndre Heider2010-08-30 16:52:23 +0000
committerAndre Heider2010-08-30 16:52:23 +0000
commit2f3edeedc923d3a478f44762720fee27237fc897 (patch)
tree0cdf4361a785eb9c0d09e4412c60e0a34ee500d2 /backends/platform/wii
parent6d0902860740290159ac5c81d5b8594aefc17563 (diff)
downloadscummvm-rg350-2f3edeedc923d3a478f44762720fee27237fc897.tar.gz
scummvm-rg350-2f3edeedc923d3a478f44762720fee27237fc897.tar.bz2
scummvm-rg350-2f3edeedc923d3a478f44762720fee27237fc897.zip
WII: Abuse pollEvent() to update the screen of skipped frames.
updateScreen() itself skips redraws when called too frequently. With the right timing and number of consecutive calls this can result in missing gfx updates, so lets abuse pollEvent() to check for overdue redraws. svn-id: r52456
Diffstat (limited to 'backends/platform/wii')
-rw-r--r--backends/platform/wii/osystem.h1
-rw-r--r--backends/platform/wii/osystem_events.cpp3
-rw-r--r--backends/platform/wii/osystem_gfx.cpp16
3 files changed, 20 insertions, 0 deletions
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index eaaf616538..ed33b43a81 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -117,6 +117,7 @@ private:
void deinitGfx();
void updateScreenResolution();
void switchVideoMode(int mode);
+ bool needsScreenUpdate();
void initSfx();
void deinitSfx();
diff --git a/backends/platform/wii/osystem_events.cpp b/backends/platform/wii/osystem_events.cpp
index 488834fc20..5d0bca453f 100644
--- a/backends/platform/wii/osystem_events.cpp
+++ b/backends/platform/wii/osystem_events.cpp
@@ -300,6 +300,9 @@ bool OSystem_Wii::pollEvent(Common::Event &event) {
return true;
}
+ if (needsScreenUpdate())
+ updateScreen();
+
u32 bd = 0, bh = 0, bu = 0;
if (PAD_ScanPads() & 1) {
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
index 3ce6343800..09575bb83d 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -441,6 +441,22 @@ void OSystem_Wii::copyRectToScreen(const byte *buf, int pitch, int x, int y,
_gameDirty = true;
}
+bool OSystem_Wii::needsScreenUpdate() {
+ if (getMillis() - _lastScreenUpdate < 1000 / MAX_FPS)
+ return false;
+
+ if (_gameRunning && _gameDirty)
+ return true;
+
+ if (_overlayVisible && _overlayDirty)
+ return true;
+
+ if (_mouseVisible && _texMouse.palette && _cursorPaletteDirty)
+ return true;
+
+ return false;
+}
+
void OSystem_Wii::updateScreen() {
static f32 ar;
static gfx_screen_coords_t cc;