src/render/software/SDL_render_sw.c
changeset 11281 42b62c737891
parent 11223 62db9336e07b
child 11811 5d94cb6b24d3
equal deleted inserted replaced
11280:3a62ecf87af9 11281:42b62c737891
   369 {
   369 {
   370     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
   370     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
   371     SDL_Surface *surface = data->surface;
   371     SDL_Surface *surface = data->surface;
   372     if (surface) {
   372     if (surface) {
   373         if (renderer->clipping_enabled) {
   373         if (renderer->clipping_enabled) {
   374             SDL_SetClipRect(surface, &renderer->clip_rect);
   374             SDL_Rect clip_rect;
       
   375             clip_rect = renderer->clip_rect;
       
   376             clip_rect.x += renderer->viewport.x;
       
   377             clip_rect.y += renderer->viewport.y;
       
   378             SDL_IntersectRect(&renderer->viewport, &clip_rect, &clip_rect);
       
   379             SDL_SetClipRect(surface, &clip_rect);
   375         } else {
   380         } else {
   376             SDL_SetClipRect(surface, NULL);
   381             SDL_SetClipRect(surface, &renderer->viewport);
   377         }
   382         }
   378     }
   383     }
   379     return 0;
   384     return 0;
   380 }
   385 }
   381 
   386