mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 08:28:29 +00:00
VITA: fix yuv texture update
This commit is contained in:

committed by
Sam Lantinga

parent
4612db21a3
commit
f79f21217b
@@ -349,6 +349,7 @@ static bool VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture,
|
|||||||
length = rect->w * SDL_BYTESPERPIXEL(texture->format);
|
length = rect->w * SDL_BYTESPERPIXEL(texture->format);
|
||||||
if (length == pitch && length == dpitch) {
|
if (length == pitch && length == dpitch) {
|
||||||
SDL_memcpy(dst, pixels, length * rect->h);
|
SDL_memcpy(dst, pixels, length * rect->h);
|
||||||
|
pixels += pitch * rect->h;
|
||||||
} else {
|
} else {
|
||||||
for (row = 0; row < rect->h; ++row) {
|
for (row = 0; row < rect->h; ++row) {
|
||||||
SDL_memcpy(dst, pixels, length);
|
SDL_memcpy(dst, pixels, length);
|
||||||
@@ -376,6 +377,7 @@ static bool VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture,
|
|||||||
// U plane
|
// U plane
|
||||||
if (length == uv_src_pitch && length == uv_pitch) {
|
if (length == uv_src_pitch && length == uv_pitch) {
|
||||||
SDL_memcpy(Udst, pixels, length * UVrect.h);
|
SDL_memcpy(Udst, pixels, length * UVrect.h);
|
||||||
|
pixels += uv_src_pitch * UVrect.h;
|
||||||
} else {
|
} else {
|
||||||
for (row = 0; row < UVrect.h; ++row) {
|
for (row = 0; row < UVrect.h; ++row) {
|
||||||
SDL_memcpy(Udst, pixels, length);
|
SDL_memcpy(Udst, pixels, length);
|
||||||
|
Reference in New Issue
Block a user