Fixed a bug in detecting surface mapping changes
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40846
This commit is contained in:
parent
5de765a423
commit
54478fc8ca
2 changed files with 7 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue