Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixed bug updating the clip rect for the software renderer

  • Loading branch information
slouken committed Jun 27, 2013
1 parent 2e9dc2b commit 44e52e57d30615ee56e3e8cb9943787be336c241

File 1 of 1 in 44e52e5

@@ -118,6 +118,7 @@ SW_ActivateRenderer(SDL_Renderer * renderer)
renderer->viewport.h = surface->h;

SW_UpdateViewport(renderer);
SW_UpdateClipRect(renderer);
}
}
return data->surface;
@@ -346,13 +347,16 @@ SW_UpdateViewport(SDL_Renderer * renderer)
static int
SW_UpdateClipRect(SDL_Renderer * renderer)
{
SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
SDL_Surface *surface = data->surface;
const SDL_Rect *rect = &renderer->clip_rect;
SDL_Surface* framebuffer = (SDL_Surface *) renderer->driverdata;

if (!SDL_RectEmpty(rect)) {
SDL_SetClipRect(framebuffer, rect);
} else {
SDL_SetClipRect(framebuffer, NULL);
if (surface) {
if (!SDL_RectEmpty(rect)) {
SDL_SetClipRect(surface, rect);
} else {
SDL_SetClipRect(surface, NULL);
}
}
return 0;
}

0 comments on commit 44e52e5

Please sign in to comment.