Prevent redraws till internal buffers are correctly setup
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40965
This commit is contained in:
parent
6b8a12329c
commit
8a8ea6302a
3 changed files with 18 additions and 2 deletions
|
@ -210,7 +210,9 @@ static int do_messages(_THIS, short *message)
|
|||
SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
|
||||
break;
|
||||
case WM_REDRAW:
|
||||
GEM_wind_redraw(this, message[3],&message[4]);
|
||||
if (!GEM_lock_redraw) {
|
||||
GEM_wind_redraw(this, message[3],&message[4]);
|
||||
}
|
||||
break;
|
||||
case WM_ICONIFY:
|
||||
case WM_ALLICONIFY:
|
||||
|
@ -240,8 +242,9 @@ static int do_messages(_THIS, short *message)
|
|||
break;
|
||||
case WM_SIZED:
|
||||
wind_set (message[3], WF_CURRXYWH, message[4], message[5], message[6], message[7]);
|
||||
GEM_win_fulled = SDL_FALSE; /* Cancel maximized flag */
|
||||
wind_get (message[3], WF_WORKXYWH, &x2, &y2, &w2, &h2);
|
||||
GEM_win_fulled = SDL_FALSE; /* Cancel maximized flag */
|
||||
GEM_lock_redraw = SDL_TRUE; /* Prevent redraw till buffers resized */
|
||||
SDL_PrivateResize(w2, h2);
|
||||
break;
|
||||
case WM_FULLED:
|
||||
|
@ -260,6 +263,7 @@ static int do_messages(_THIS, short *message)
|
|||
}
|
||||
wind_set (message[3], WF_CURRXYWH, x, y, w, h);
|
||||
wind_get (message[3], WF_WORKXYWH, &x2, &y2, &w2, &h2);
|
||||
GEM_lock_redraw = SDL_TRUE; /* Prevent redraw till buffers resized */
|
||||
SDL_PrivateResize(w2, h2);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -401,6 +401,7 @@ int GEM_VideoInit(_THIS, SDL_PixelFormat *vformat)
|
|||
GEM_locked = SDL_FALSE;
|
||||
GEM_win_fulled = SDL_FALSE;
|
||||
GEM_fullscreen = SDL_FALSE;
|
||||
GEM_lock_redraw = SDL_TRUE; /* Prevent redraw till buffers are setup */
|
||||
|
||||
VDI_screen = NULL;
|
||||
VDI_pitch = VDI_w * VDI_pixelsize;
|
||||
|
@ -720,6 +721,7 @@ SDL_Surface *GEM_SetVideoMode(_THIS, SDL_Surface *current,
|
|||
#endif
|
||||
|
||||
this->UpdateRects = GEM_UpdateRects;
|
||||
GEM_lock_redraw = SDL_FALSE; /* Enable redraw */
|
||||
|
||||
/* We're done */
|
||||
return(current);
|
||||
|
@ -858,6 +860,10 @@ static void GEM_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
|
|||
{
|
||||
SDL_Surface *surface;
|
||||
|
||||
if (GEM_lock_redraw) {
|
||||
return;
|
||||
}
|
||||
|
||||
surface = this->screen;
|
||||
|
||||
if (surface->flags & SDL_FULLSCREEN) {
|
||||
|
@ -951,6 +957,10 @@ static int GEM_FlipHWSurfaceWindowed(_THIS, SDL_Surface *surface)
|
|||
|
||||
static int GEM_FlipHWSurface(_THIS, SDL_Surface *surface)
|
||||
{
|
||||
if (GEM_lock_redraw) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
if (surface->flags & SDL_FULLSCREEN) {
|
||||
return GEM_FlipHWSurfaceFullscreen(this, surface);
|
||||
} else {
|
||||
|
|
|
@ -79,6 +79,7 @@ struct SDL_PrivateVideoData {
|
|||
SDL_bool window_fulled; /* Window maximized ? */
|
||||
SDL_bool mouse_relative; /* Report relative mouse movement */
|
||||
SDL_bool locked; /* AES locked for fullscreen ? */
|
||||
SDL_bool lock_redraw; /* Prevent redraw till buffers are setup */
|
||||
short message[8]; /* To self-send an AES message */
|
||||
|
||||
SDL_bool fullscreen; /* Fullscreen or windowed mode ? */
|
||||
|
@ -120,6 +121,7 @@ struct SDL_PrivateVideoData {
|
|||
#define GEM_win_fulled (this->hidden->window_fulled)
|
||||
#define GEM_mouse_relative (this->hidden->mouse_relative)
|
||||
#define GEM_locked (this->hidden->locked)
|
||||
#define GEM_lock_redraw (this->hidden->lock_redraw)
|
||||
#define GEM_message (this->hidden->message)
|
||||
#define SDL_modelist (this->hidden->SDL_modelist)
|
||||
#define GEM_icon (this->hidden->icon)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue