Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Ah there, that fixed it. :)
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 12, 2011
1 parent 8255dd8 commit e2db86d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/render/opengl/SDL_render_gl.c
Expand Up @@ -553,8 +553,12 @@ GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
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);
Expand Down

0 comments on commit e2db86d

Please sign in to comment.