software: Fixed compiler warning and dos2unix'd the endlines.

This commit is contained in:
Ryan C. Gordon 2019-06-11 15:06:35 -04:00
parent 04fedce0e8
commit 3e9bf28413
1 changed files with 16 additions and 17 deletions

View File

@ -578,30 +578,29 @@ PrepTextureForCopy(const SDL_RenderCommand *cmd)
static void static void
SetDrawState(SDL_Surface *surface, SW_DrawStateCache *drawstate) SetDrawState(SDL_Surface *surface, SW_DrawStateCache *drawstate)
{ {
if (drawstate->surface_cliprect_dirty) { if (drawstate->surface_cliprect_dirty) {
const SDL_Rect *viewport = drawstate->viewport; const SDL_Rect *viewport = drawstate->viewport;
const SDL_Rect *cliprect = drawstate->cliprect; const SDL_Rect *cliprect = drawstate->cliprect;
SDL_assert(viewport != NULL); /* the higher level should have forced a SDL_RENDERCMD_SETVIEWPORT */ SDL_assert(viewport != NULL); /* the higher level should have forced a SDL_RENDERCMD_SETVIEWPORT */
if (cliprect != NULL) { if (cliprect != NULL) {
SDL_Rect clip_rect; SDL_Rect clip_rect;
clip_rect.x = cliprect->x + viewport->x; clip_rect.x = cliprect->x + viewport->x;
clip_rect.y = cliprect->y + viewport->y; clip_rect.y = cliprect->y + viewport->y;
clip_rect.w = cliprect->w; clip_rect.w = cliprect->w;
clip_rect.h = cliprect->h; clip_rect.h = cliprect->h;
SDL_IntersectRect(viewport, &clip_rect, &clip_rect); SDL_IntersectRect(viewport, &clip_rect, &clip_rect);
SDL_SetClipRect(surface, &clip_rect); SDL_SetClipRect(surface, &clip_rect);
} else { } else {
SDL_SetClipRect(surface, drawstate->viewport); SDL_SetClipRect(surface, drawstate->viewport);
} }
drawstate->surface_cliprect_dirty = SDL_FALSE; drawstate->surface_cliprect_dirty = SDL_FALSE;
} }
} }
static int static int
SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize)
{ {
SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
SDL_Surface *surface = SW_ActivateRenderer(renderer); SDL_Surface *surface = SW_ActivateRenderer(renderer);
SW_DrawStateCache drawstate; SW_DrawStateCache drawstate;