src/render/software/SDL_render_sw.c
changeset 12383 f6430feceeda
parent 12381 dc9108cd4340
child 12411 148df74b141c
equal deleted inserted replaced
12382:03d0bddca61b 12383:f6430feceeda
   597 
   597 
   598             case SDL_RENDERCMD_SETCLIPRECT: {
   598             case SDL_RENDERCMD_SETCLIPRECT: {
   599                 SDL_assert(viewport != NULL);
   599                 SDL_assert(viewport != NULL);
   600                 cliprect = cmd->data.cliprect.enabled ? &cmd->data.cliprect.rect : NULL;
   600                 cliprect = cmd->data.cliprect.enabled ? &cmd->data.cliprect.rect : NULL;
   601                 if (cliprect) {
   601                 if (cliprect) {
   602                     SDL_Rect clip_rect = { cliprect->x + viewport->x, cliprect->y + viewport->y, cliprect->w, cliprect->h };
   602                     SDL_Rect clip_rect;
       
   603                     clip_rect.x = cliprect->x + viewport->x;
       
   604                     clip_rect.y = cliprect->y + viewport->y;
       
   605                     clip_rect.w = cliprect->w;
       
   606                     clip_rect.h = cliprect->h;
   603                     SDL_IntersectRect(viewport, &clip_rect, &clip_rect);
   607                     SDL_IntersectRect(viewport, &clip_rect, &clip_rect);
   604                     SDL_SetClipRect(surface, &clip_rect);
   608                     SDL_SetClipRect(surface, &clip_rect);
   605                 } else {
   609                 } else {
   606                     SDL_SetClipRect(surface, viewport);
   610                     SDL_SetClipRect(surface, viewport);
   607                 }
   611                 }