mirror of
https://github.com/yawut/SDL.git
synced 2026-04-25 15:58:04 -05:00
Fixes a bug in SDL_UpdateTexture when using SDL_RENDERER_SOFTWARE and texture access is SDL_TEXTUREACCESS_STATIC
This commit is contained in:
parent
41447caf1c
commit
316ae21313
|
|
@ -240,6 +240,8 @@ SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
|||
int row;
|
||||
size_t length;
|
||||
|
||||
if(SDL_MUSTLOCK(surface))
|
||||
SDL_LockSurface(surface);
|
||||
src = (Uint8 *) pixels;
|
||||
dst = (Uint8 *) surface->pixels +
|
||||
rect->y * surface->pitch +
|
||||
|
|
@ -250,6 +252,8 @@ SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
|||
src += pitch;
|
||||
dst += surface->pitch;
|
||||
}
|
||||
if(SDL_MUSTLOCK(surface))
|
||||
SDL_UnlockSurface(surface);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user