Skip to content

Commit

Permalink
fix build using Watcom :
Browse files Browse the repository at this point in the history
./src/render/SDL_render.c(2168): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2168): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2175): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2175): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant

./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant
./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant
./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant
./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant
  • Loading branch information
sezero committed Nov 1, 2018
1 parent 4659e73 commit 0d79a8a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
20 changes: 16 additions & 4 deletions src/render/SDL_render.c
Expand Up @@ -2165,14 +2165,18 @@ SDL_RenderClear(SDL_Renderer * renderer)
int
SDL_RenderDrawPoint(SDL_Renderer * renderer, int x, int y)
{
const SDL_FPoint fpoint = { (float) x, (float) y };
SDL_FPoint fpoint;
fpoint.x = (float) x;
fpoint.y = (float) y;
return SDL_RenderDrawPointsF(renderer, &fpoint, 1);
}

int
SDL_RenderDrawPointF(SDL_Renderer * renderer, float x, float y)
{
const SDL_FPoint fpoint = { x, y };
SDL_FPoint fpoint;
fpoint.x = x;
fpoint.y = y;
return SDL_RenderDrawPointsF(renderer, &fpoint, 1);
}

Expand Down Expand Up @@ -2319,14 +2323,22 @@ SDL_RenderDrawPointsF(SDL_Renderer * renderer,
int
SDL_RenderDrawLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2)
{
const SDL_FPoint points[2] = { { (float) x1, (float) y1 }, { (float) x2, (float) y2 } };
SDL_FPoint points[2];
points[0].x = (float) x1;
points[0].y = (float) y1;
points[1].x = (float) x2;
points[1].y = (float) y2;
return SDL_RenderDrawLinesF(renderer, points, 2);
}

int
SDL_RenderDrawLineF(SDL_Renderer * renderer, float x1, float y1, float x2, float y2)
{
const SDL_FPoint points[2] = { { x1, y1 }, { x2, y2 } };
SDL_FPoint points[2];
points[0].x = x1;
points[0].y = y1;
points[1].x = x2;
points[1].y = y2;
return SDL_RenderDrawLinesF(renderer, points, 2);
}

Expand Down
6 changes: 5 additions & 1 deletion src/render/software/SDL_render_sw.c
Expand Up @@ -599,7 +599,11 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic
SDL_assert(viewport != NULL);
cliprect = cmd->data.cliprect.enabled ? &cmd->data.cliprect.rect : NULL;
if (cliprect) {
SDL_Rect clip_rect = { cliprect->x + viewport->x, cliprect->y + viewport->y, cliprect->w, cliprect->h };
SDL_Rect clip_rect;
clip_rect.x = cliprect->x + viewport->x;
clip_rect.y = cliprect->y + viewport->y;
clip_rect.w = cliprect->w;
clip_rect.h = cliprect->h;
SDL_IntersectRect(viewport, &clip_rect, &clip_rect);
SDL_SetClipRect(surface, &clip_rect);
} else {
Expand Down

0 comments on commit 0d79a8a

Please sign in to comment.