fix build using Watcom : ./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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index 0c098a7..7f2b47c 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -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);
}
@@ -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);
}
diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c
index 4748873..7effafa 100644
--- a/src/render/software/SDL_render_sw.c
+++ b/src/render/software/SDL_render_sw.c
@@ -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 {