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

svn-id: r42139
This commit is contained in:
Marcus Comstedt 2009-07-05 14:57:03 +00:00
parent c353e8de1f
commit 415d0c5b03
3 changed files with 29 additions and 5 deletions

View File

@ -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();
};

View File

@ -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,

View File

@ -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();