Fixes a bug in SDL_UpdateTexture when using SDL_RENDERER_SOFTWARE and texture access is SDL_TEXTUREACCESS_STATIC
This commit is contained in:
parent
2fdcb7bdfc
commit
b43aca329d
1 changed files with 4 additions and 0 deletions
|
@ -240,6 +240,8 @@ SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||||
int row;
|
int row;
|
||||||
size_t length;
|
size_t length;
|
||||||
|
|
||||||
|
if(SDL_MUSTLOCK(surface))
|
||||||
|
SDL_LockSurface(surface);
|
||||||
src = (Uint8 *) pixels;
|
src = (Uint8 *) pixels;
|
||||||
dst = (Uint8 *) surface->pixels +
|
dst = (Uint8 *) surface->pixels +
|
||||||
rect->y * surface->pitch +
|
rect->y * surface->pitch +
|
||||||
|
@ -250,6 +252,8 @@ SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||||
src += pitch;
|
src += pitch;
|
||||||
dst += surface->pitch;
|
dst += surface->pitch;
|
||||||
}
|
}
|
||||||
|
if(SDL_MUSTLOCK(surface))
|
||||||
|
SDL_UnlockSurface(surface);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue