From 29088c7b98a477127a238ca8f2a688b479ef568c Mon Sep 17 00:00:00 2001 From: pelya Date: Thu, 29 Jul 2010 12:22:08 +0300 Subject: [PATCH] Removed unnecessary optimization that forces extra memcpy() for textures with width not multiplier of 2 --- alienblaster/project/sdl/sdl-1.2/src/video/SDL_pixels.c | 4 ++-- alienblaster/project/sdl/sdl-1.3/src/video/SDL_pixels.c | 4 ++++ .../project/sdl/sdl-1.3/src/video/SDL_renderer_gles.c | 4 ---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/alienblaster/project/sdl/sdl-1.2/src/video/SDL_pixels.c b/alienblaster/project/sdl/sdl-1.2/src/video/SDL_pixels.c index 5c9800f54..abfa36825 100644 --- a/alienblaster/project/sdl/sdl-1.2/src/video/SDL_pixels.c +++ b/alienblaster/project/sdl/sdl-1.2/src/video/SDL_pixels.c @@ -306,9 +306,9 @@ Uint16 SDL_CalculatePitch(SDL_Surface *surface) } // 4-byte aligning adds extra memcpy() with OpenGL ES renderer // TODO: check if we really can disable that for Android -//#ifndef ANDROID +#ifndef ANDROID pitch = (pitch + 3) & ~3; /* 4-byte aligning */ -//#endif +#endif return(pitch); } /* diff --git a/alienblaster/project/sdl/sdl-1.3/src/video/SDL_pixels.c b/alienblaster/project/sdl/sdl-1.3/src/video/SDL_pixels.c index acb72066d..77ca8b0e7 100644 --- a/alienblaster/project/sdl/sdl-1.3/src/video/SDL_pixels.c +++ b/alienblaster/project/sdl/sdl-1.3/src/video/SDL_pixels.c @@ -597,7 +597,11 @@ SDL_CalculatePitch(SDL_Surface * surface) default: break; } +// 4-byte aligning adds extra memcpy() with OpenGL ES renderer +// TODO: check if we really can disable that for Android +#ifndef ANDROID pitch = (pitch + 3) & ~3; /* 4-byte aligning */ +#endif return (pitch); } diff --git a/alienblaster/project/sdl/sdl-1.3/src/video/SDL_renderer_gles.c b/alienblaster/project/sdl/sdl-1.3/src/video/SDL_renderer_gles.c index 2f847f15a..b4f58eb54 100644 --- a/alienblaster/project/sdl/sdl-1.3/src/video/SDL_renderer_gles.c +++ b/alienblaster/project/sdl/sdl-1.3/src/video/SDL_renderer_gles.c @@ -952,10 +952,6 @@ GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, /* this code is a little funny because the viewport is upside down vs SDL's coordinate system */ SDL_Window *window = renderer->window; - __android_log_print(ANDROID_LOG_INFO, "libSDL", "GLES_RenderCopy(): %dx%d+%d+%d -> %dx%d+%d+%d", - (int)srcrect->x, (int)srcrect->y, (int)srcrect->w, (int)srcrect->h, - (int)dstrect->x, (int)dstrect->y, (int)dstrect->w, (int)dstrect->h); - GLint cropRect[4]; cropRect[0] = srcrect->x; cropRect[1] = srcrect->y + srcrect->h;