Commit 78a17dbc authored by Sam Lantinga's avatar Sam Lantinga

Ah there, that fixed it. :)

parent 53654196
...@@ -553,8 +553,12 @@ GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, ...@@ -553,8 +553,12 @@ GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
rect->h, data->format, data->formattype, rect->h, data->format, data->formattype,
pixels); pixels);
if (data->yuv) { if (data->yuv) {
const void *top;
renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, (pitch / 2));
/* Skip to the top of the next texture */ /* 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 */ /* Skip to the correct offset into the next texture */
pixels = (const void*)((const Uint8*)top + (rect->y / 2) * pitch + rect->x / 2); pixels = (const void*)((const Uint8*)top + (rect->y / 2) * pitch + rect->x / 2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment