mirror of
https://github.com/yawut/SDL.git
synced 2026-06-22 12:29:50 -05:00
Fixed a bug in detecting surface mapping changes
This commit is contained in:
parent
9e02d4aecb
commit
d2a487772f
|
|
@ -246,7 +246,12 @@ SDL_PixelFormat *SDL_ReallocFormat(SDL_Surface *surface, int bpp,
|
|||
*/
|
||||
void SDL_FormatChanged(SDL_Surface *surface)
|
||||
{
|
||||
surface->format_version++;
|
||||
static int format_version = 0;
|
||||
++format_version;
|
||||
if ( format_version < 0 ) { /* It wrapped... */
|
||||
format_version = 1;
|
||||
}
|
||||
surface->format_version = format_version;
|
||||
SDL_InvalidateMap(surface->map);
|
||||
}
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -106,9 +106,9 @@ SDL_Surface * SDL_CreateRGBSurface (Uint32 flags,
|
|||
surface->hwdata = NULL;
|
||||
surface->locked = 0;
|
||||
surface->map = NULL;
|
||||
surface->format_version = 0;
|
||||
surface->unused1 = 0;
|
||||
SDL_SetClipRect(surface, NULL);
|
||||
SDL_FormatChanged(surface);
|
||||
|
||||
/* Get the pixels */
|
||||
if ( ((flags&SDL_HWSURFACE) == SDL_SWSURFACE) ||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user