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

Commit

Permalink
Fixed texture list when swapping textures (thanks Drake Wilson!)
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 2, 2012
1 parent dc135a5 commit 8be1341
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/render/SDL_render.c
Expand Up @@ -418,7 +418,13 @@ SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int

/* Swap textures to have texture before texture->native in the list */
texture->native->next = texture->next;
if (texture->native->next) {
texture->native->next->prev = texture->native;
}
texture->prev = texture->native->prev;
if (texture->prev) {
texture->prev->next = texture;
}
texture->native->prev = texture;
texture->next = texture->native;
renderer->textures = texture;
Expand Down

0 comments on commit 8be1341

Please sign in to comment.