Mercurial > sdl-ios-xcode
changeset 5270:48724afcdc6e
Ah there, that fixed it. :)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 12 Feb 2011 00:42:39 -0800 |
parents | 7ace5f8f432f |
children | e107518710f6 |
files | src/render/opengl/SDL_render_gl.c |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/render/opengl/SDL_render_gl.c Sat Feb 12 00:25:02 2011 -0800 +++ b/src/render/opengl/SDL_render_gl.c Sat Feb 12 00:42:39 2011 -0800 @@ -553,8 +553,12 @@ rect->h, data->format, data->formattype, pixels); if (data->yuv) { + const void *top; + + renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, (pitch / 2)); + /* Skip to the top of the next texture */ - const void *top = (const void*)((const Uint8*)pixels + (texture->h-rect->y) * pitch - rect->x); + top = (const void*)((const Uint8*)pixels + (texture->h-rect->y) * pitch - rect->x); /* Skip to the correct offset into the next texture */ pixels = (const void*)((const Uint8*)top + (rect->y / 2) * pitch + rect->x / 2);