[Scummvm-cvs-logs] SF.net SVN: scummvm:[42139] scummvm/trunk/backends/platform/dc

marcus_c at users.sourceforge.net marcus_c at users.sourceforge.net
Sun Jul 5 16:57:03 CEST 2009


Revision: 42139
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42139&view=rev
Author:   marcus_c
Date:     2009-07-05 14:57:03 +0000 (Sun, 05 Jul 2009)

Log Message:
-----------
Refresh the screen if pollEvent() is called without updateScreen() being called for a long time.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/dc/dc.h
    scummvm/trunk/backends/platform/dc/display.cpp
    scummvm/trunk/backends/platform/dc/input.cpp

Modified: scummvm/trunk/backends/platform/dc/dc.h
===================================================================
--- scummvm/trunk/backends/platform/dc/dc.h	2009-07-05 14:12:04 UTC (rev 42138)
+++ scummvm/trunk/backends/platform/dc/dc.h	2009-07-05 14:57:03 UTC (rev 42139)
@@ -194,7 +194,7 @@
   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 @@
   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();
 };
 

Modified: scummvm/trunk/backends/platform/dc/display.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/display.cpp	2009-07-05 14:12:04 UTC (rev 42138)
+++ scummvm/trunk/backends/platform/dc/display.cpp	2009-07-05 14:57:03 UTC (rev 42139)
@@ -285,11 +285,8 @@
   _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,7 +325,13 @@
 
     _overlay_dirty = false;
   }
+}
 
+void OSystem_Dreamcast::updateScreenPolygons(void)
+{
+  struct polygon_list mypoly;
+  struct packed_colour_vertex_list myvertex;
+
   // *((volatile unsigned int *)(void*)0xa05f8040) = 0x00ff00;
 
   mypoly.cmd =
@@ -448,8 +451,23 @@
   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,
 				  unsigned char *buf, bool visible)
 {

Modified: scummvm/trunk/backends/platform/dc/input.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/input.cpp	2009-07-05 14:12:04 UTC (rev 42138)
+++ scummvm/trunk/backends/platform/dc/input.cpp	2009-07-05 14:57:03 UTC (rev 42139)
@@ -202,6 +202,8 @@
   if (((int)(t-_devpoll))>=0)
     _devpoll = t + USEC_TO_TIMER(17000);
 
+  maybeRefreshScreen();
+
   int mask = getimask();
   setimask(15);
   checkSound();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list