Fixed compiling of three test programs with C++.
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 68 69 70 71 72 73 74 75 76 77 78 79 80
diff --git a/test/controllermap.c b/test/controllermap.c
index 3fb30d6..e7bf0bb 100644
--- a/test/controllermap.c
+++ b/test/controllermap.c
@@ -47,7 +47,7 @@ typedef struct MappingStep
SDL_Texture *
-LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
+LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent)
{
SDL_Surface *temp;
SDL_Texture *texture;
@@ -226,7 +226,7 @@ WatchJoystick(SDL_Joystick * joystick)
SDL_RenderCopy(screen, background, NULL, NULL);
SDL_SetTextureAlphaMod(marker, alpha);
SDL_SetTextureColorMod(marker, 10, 255, 21);
- SDL_RenderCopyEx(screen, marker, NULL, &dst, step->angle, NULL, 0);
+ SDL_RenderCopyEx(screen, marker, NULL, &dst, step->angle, NULL, SDL_FLIP_NONE);
SDL_RenderPresent(screen);
if (SDL_PollEvent(&event)) {
diff --git a/test/testgamecontroller.c b/test/testgamecontroller.c
index 908f400..1f059a4 100644
--- a/test/testgamecontroller.c
+++ b/test/testgamecontroller.c
@@ -67,7 +67,7 @@ SDL_bool done = SDL_FALSE;
SDL_Texture *background, *button, *axis;
static SDL_Texture *
-LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
+LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent)
{
SDL_Surface *temp = NULL;
SDL_Texture *texture = NULL;
@@ -129,7 +129,7 @@ loop(void *arg)
for (i = 0; i < SDL_CONTROLLER_BUTTON_MAX; ++i) {
if (SDL_GameControllerGetButton(gamecontroller, (SDL_GameControllerButton)i) == SDL_PRESSED) {
const SDL_Rect dst = { button_positions[i].x, button_positions[i].y, 50, 50 };
- SDL_RenderCopyEx(screen, button, NULL, &dst, 0, NULL, 0);
+ SDL_RenderCopyEx(screen, button, NULL, &dst, 0, NULL, SDL_FLIP_NONE);
}
}
@@ -139,11 +139,11 @@ loop(void *arg)
if (value < -deadzone) {
const SDL_Rect dst = { axis_positions[i].x, axis_positions[i].y, 50, 50 };
const double angle = axis_positions[i].angle;
- SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, 0);
+ SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, SDL_FLIP_NONE);
} else if (value > deadzone) {
const SDL_Rect dst = { axis_positions[i].x, axis_positions[i].y, 50, 50 };
const double angle = axis_positions[i].angle + 180.0;
- SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, 0);
+ SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, SDL_FLIP_NONE);
}
}
diff --git a/test/testrendercopyex.c b/test/testrendercopyex.c
index 856abf7..e348902 100644
--- a/test/testrendercopyex.c
+++ b/test/testrendercopyex.c
@@ -45,7 +45,7 @@ quit(int rc)
}
SDL_Texture *
-LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
+LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent)
{
SDL_Surface *temp;
SDL_Texture *texture;
@@ -126,7 +126,7 @@ Draw(DrawState *s)
s->sprite_rect.x = (viewport.w - s->sprite_rect.w) / 2;
s->sprite_rect.y = (viewport.h - s->sprite_rect.h) / 2;
- SDL_RenderCopyEx(s->renderer, s->sprite, NULL, &s->sprite_rect, (double)s->sprite_rect.w, center, s->scale_direction);
+ SDL_RenderCopyEx(s->renderer, s->sprite, NULL, &s->sprite_rect, (double)s->sprite_rect.w, center, (SDL_RendererFlip)s->scale_direction);
SDL_SetRenderTarget(s->renderer, NULL);
SDL_RenderCopy(s->renderer, target, NULL, NULL);