aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Comstedt2009-07-05 14:57:03 +0000
committerMarcus Comstedt2009-07-05 14:57:03 +0000
commit415d0c5b036a9b012c61972e7220e0f4df72db56 (patch)
tree54985bf86e39aaa4dc86fc9e38b7d91b6f4bf1c8
parentc353e8de1fb1afae67fdc69f06db4d399caa2ed5 (diff)
downloadscummvm-rg350-415d0c5b036a9b012c61972e7220e0f4df72db56.tar.gz
scummvm-rg350-415d0c5b036a9b012c61972e7220e0f4df72db56.tar.bz2
scummvm-rg350-415d0c5b036a9b012c61972e7220e0f4df72db56.zip
Refresh the screen if pollEvent() is called without updateScreen() being called for a long time.
svn-id: r42139
-rw-r--r--backends/platform/dc/dc.h6
-rw-r--r--backends/platform/dc/display.cpp26
-rw-r--r--backends/platform/dc/input.cpp2
3 files changed, 29 insertions, 5 deletions
diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h
index f86a2c6065..b67bbb51a1 100644
--- a/backends/platform/dc/dc.h
+++ b/backends/platform/dc/dc.h
@@ -194,7 +194,7 @@ class OSystem_Dreamcast : private DCHardware, public BaseBackend, public Filesys
SoftKeyboard _softkbd;
int _ms_cur_x, _ms_cur_y, _ms_cur_w, _ms_cur_h, _ms_old_x, _ms_old_y;
- int _ms_hotspot_x, _ms_hotspot_y, _ms_visible, _devpoll;
+ int _ms_hotspot_x, _ms_hotspot_y, _ms_visible, _devpoll, _last_screen_refresh;
int _current_shake_pos, _screen_w, _screen_h;
int _overlay_x, _overlay_y;
unsigned char *_ms_buf;
@@ -220,11 +220,15 @@ class OSystem_Dreamcast : private DCHardware, public BaseBackend, public Filesys
uint initSound();
void checkSound();
+ void updateScreenTextures(void);
+ void updateScreenPolygons(void);
+ void maybeRefreshScreen(void);
void drawMouse(int xdraw, int ydraw, int w, int h,
unsigned char *buf, bool visible);
void setScaling();
+
Common::SaveFileManager *createSavefileManager();
};
diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp
index ba8e1ba04f..d1e95c6a91 100644
--- a/backends/platform/dc/display.cpp
+++ b/backends/platform/dc/display.cpp
@@ -285,11 +285,8 @@ void OSystem_Dreamcast::setShakePos(int shake_pos)
_current_shake_pos = shake_pos;
}
-void OSystem_Dreamcast::updateScreen(void)
+void OSystem_Dreamcast::updateScreenTextures(void)
{
- struct polygon_list mypoly;
- struct packed_colour_vertex_list myvertex;
-
if (_screen_dirty) {
_screen_buffer++;
@@ -328,6 +325,12 @@ void OSystem_Dreamcast::updateScreen(void)
_overlay_dirty = false;
}
+}
+
+void OSystem_Dreamcast::updateScreenPolygons(void)
+{
+ struct polygon_list mypoly;
+ struct packed_colour_vertex_list myvertex;
// *((volatile unsigned int *)(void*)0xa05f8040) = 0x00ff00;
@@ -448,6 +451,21 @@ void OSystem_Dreamcast::updateScreen(void)
ta_commit_frame();
// *((volatile unsigned int *)(void*)0xa05f8040) = 0x0;
+
+ _last_screen_refresh = Timer();
+}
+
+void OSystem_Dreamcast::updateScreen(void)
+{
+ updateScreenTextures();
+ updateScreenPolygons();
+}
+
+void OSystem_Dreamcast::maybeRefreshScreen(void)
+{
+ unsigned int t = Timer();
+ if((int)(t-_last_screen_refresh) > USEC_TO_TIMER(30000))
+ updateScreenPolygons();
}
void OSystem_Dreamcast::drawMouse(int xdraw, int ydraw, int w, int h,
diff --git a/backends/platform/dc/input.cpp b/backends/platform/dc/input.cpp
index 1b85f601a6..5d4ed7ce96 100644
--- a/backends/platform/dc/input.cpp
+++ b/backends/platform/dc/input.cpp
@@ -202,6 +202,8 @@ bool OSystem_Dreamcast::pollEvent(Common::Event &event)
if (((int)(t-_devpoll))>=0)
_devpoll = t + USEC_TO_TIMER(17000);
+ maybeRefreshScreen();
+
int mask = getimask();
setimask(15);
checkSound();