Fixed texture list when swapping textures (thanks Drake Wilson!)
authorSam Lantinga
Tue, 02 Oct 2012 00:28:23 -0700
changeset 6533c784245304dd
parent 6532 58f726a2fc82
child 6534 8faa51147576
Fixed texture list when swapping textures (thanks Drake Wilson!)
src/render/SDL_render.c
     1.1 --- a/src/render/SDL_render.c	Mon Oct 01 23:28:19 2012 -0700
     1.2 +++ b/src/render/SDL_render.c	Tue Oct 02 00:28:23 2012 -0700
     1.3 @@ -418,7 +418,13 @@
     1.4  
     1.5          /* Swap textures to have texture before texture->native in the list */
     1.6          texture->native->next = texture->next;
     1.7 +        if (texture->native->next) {
     1.8 +            texture->native->next->prev = texture->native;
     1.9 +        }
    1.10          texture->prev = texture->native->prev;
    1.11 +        if (texture->prev) {
    1.12 +            texture->prev->next = texture;
    1.13 +        }
    1.14          texture->native->prev = texture;
    1.15          texture->next = texture->native;
    1.16          renderer->textures = texture;