direct3d: Fixed SDL_RenderSetClipRect usage.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 11 Jun 2019 10:12:47 -0400
changeset 128338a5ef22c9e13
parent 12832 5b0c4bfbd083
child 12834 75dad4c8914e
direct3d: Fixed SDL_RenderSetClipRect usage.

Fixes Bugzilla #4459.
src/render/direct3d/SDL_render_d3d.c
     1.1 --- a/src/render/direct3d/SDL_render_d3d.c	Tue Jun 11 09:29:48 2019 -0400
     1.2 +++ b/src/render/direct3d/SDL_render_d3d.c	Tue Jun 11 10:12:47 2019 -0400
     1.3 @@ -1185,7 +1185,7 @@
     1.4  
     1.5      if (data->drawstate.cliprect_dirty) {
     1.6          const SDL_Rect *viewport = &data->drawstate.viewport;
     1.7 -        const SDL_Rect *rect = &cmd->data.cliprect.rect;
     1.8 +        const SDL_Rect *rect = &data->drawstate.cliprect;
     1.9          const RECT d3drect = { viewport->x + rect->x, viewport->y + rect->y, viewport->x + rect->x + rect->w, viewport->y + rect->y + rect->h };
    1.10          IDirect3DDevice9_SetScissorRect(data->device, &d3drect);
    1.11          data->drawstate.cliprect_dirty = SDL_FALSE;
    1.12 @@ -1511,6 +1511,7 @@
    1.13      if (!data) {
    1.14          return;
    1.15      }
    1.16 +
    1.17      D3D_DestroyTextureRep(&data->texture);
    1.18      D3D_DestroyTextureRep(&data->utexture);
    1.19      D3D_DestroyTextureRep(&data->vtexture);