Fixed SDL_UpdateRects for the last time

This commit is contained in:
Sergii Pylypenko
2013-11-08 23:39:27 +02:00
parent 26fab0d39f
commit be99cfb17f
3 changed files with 6 additions and 3 deletions

View File

@@ -49,6 +49,8 @@ SdlVideoResize=y
# Application resizing will keep 4:3 aspect ratio, with black bars at sides (y)/(n)
SdlVideoResizeKeepAspect=n
CompatibilityHacksProperUsageOfSDL_UpdateRects=y
# Application does not call SDL_Flip() or SDL_UpdateRects() appropriately, or draws from non-main thread -
# enabling the compatibility mode will force screen update every 100 milliseconds, which is laggy and inefficient (y) or (n)
CompatibilityHacks=n

View File

@@ -967,9 +967,10 @@ static void ANDROID_FlipHWSurfaceInternal(int numrects, SDL_Rect *rects)
int i;
for(i = 0; i < numrects; i++)
{
//printf("SDL_UpdateTexture: rect %d: %04d:%04d:%04d:%04d", i, rects[i].x, rects[i].y, rects[i].w, rects[i].h);
//__android_log_print(ANDROID_LOG_INFO, "libSDL", "SDL_UpdateTexture: rect %d: %04d:%04d:%04d:%04d", i, rects[i].x, rects[i].y, rects[i].w, rects[i].h);
SDL_UpdateTexture((struct SDL_Texture *)SDL_CurrentVideoSurface->hwdata, &rects[i],
SDL_CurrentVideoSurface->pixels + rects[i].y * SDL_CurrentVideoSurface->pitch + rects[i].x,
SDL_CurrentVideoSurface->pixels + rects[i].y * SDL_CurrentVideoSurface->pitch +
rects[i].x * SDL_CurrentVideoSurface->format->BytesPerPixel,
SDL_CurrentVideoSurface->pitch);
}
}