Fixed compiling of three test programs with C++.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Wed, 21 Sep 2016 23:06:38 +0200
changeset 103593806fd310e5b
parent 10358 f46d780b6685
child 10360 2e78b92aa9b3
Fixed compiling of three test programs with C++.
test/controllermap.c
test/testgamecontroller.c
test/testrendercopyex.c
     1.1 --- a/test/controllermap.c	Wed Sep 21 23:06:26 2016 +0200
     1.2 +++ b/test/controllermap.c	Wed Sep 21 23:06:38 2016 +0200
     1.3 @@ -47,7 +47,7 @@
     1.4  
     1.5  
     1.6  SDL_Texture *
     1.7 -LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
     1.8 +LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent)
     1.9  {
    1.10      SDL_Surface *temp;
    1.11      SDL_Texture *texture;
    1.12 @@ -226,7 +226,7 @@
    1.13              SDL_RenderCopy(screen, background, NULL, NULL);
    1.14              SDL_SetTextureAlphaMod(marker, alpha);
    1.15              SDL_SetTextureColorMod(marker, 10, 255, 21);
    1.16 -            SDL_RenderCopyEx(screen, marker, NULL, &dst, step->angle, NULL, 0);
    1.17 +            SDL_RenderCopyEx(screen, marker, NULL, &dst, step->angle, NULL, SDL_FLIP_NONE);
    1.18              SDL_RenderPresent(screen);
    1.19              
    1.20              if (SDL_PollEvent(&event)) {
     2.1 --- a/test/testgamecontroller.c	Wed Sep 21 23:06:26 2016 +0200
     2.2 +++ b/test/testgamecontroller.c	Wed Sep 21 23:06:38 2016 +0200
     2.3 @@ -67,7 +67,7 @@
     2.4  SDL_Texture *background, *button, *axis;
     2.5  
     2.6  static SDL_Texture *
     2.7 -LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
     2.8 +LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent)
     2.9  {
    2.10      SDL_Surface *temp = NULL;
    2.11      SDL_Texture *texture = NULL;
    2.12 @@ -129,7 +129,7 @@
    2.13      for (i = 0; i < SDL_CONTROLLER_BUTTON_MAX; ++i) {
    2.14          if (SDL_GameControllerGetButton(gamecontroller, (SDL_GameControllerButton)i) == SDL_PRESSED) {
    2.15              const SDL_Rect dst = { button_positions[i].x, button_positions[i].y, 50, 50 };
    2.16 -            SDL_RenderCopyEx(screen, button, NULL, &dst, 0, NULL, 0);
    2.17 +            SDL_RenderCopyEx(screen, button, NULL, &dst, 0, NULL, SDL_FLIP_NONE);
    2.18          }
    2.19      }
    2.20  
    2.21 @@ -139,11 +139,11 @@
    2.22          if (value < -deadzone) {
    2.23              const SDL_Rect dst = { axis_positions[i].x, axis_positions[i].y, 50, 50 };
    2.24              const double angle = axis_positions[i].angle;
    2.25 -            SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, 0);
    2.26 +            SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, SDL_FLIP_NONE);
    2.27          } else if (value > deadzone) {
    2.28              const SDL_Rect dst = { axis_positions[i].x, axis_positions[i].y, 50, 50 };
    2.29              const double angle = axis_positions[i].angle + 180.0;
    2.30 -            SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, 0);
    2.31 +            SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, SDL_FLIP_NONE);
    2.32          }
    2.33      }
    2.34  
     3.1 --- a/test/testrendercopyex.c	Wed Sep 21 23:06:26 2016 +0200
     3.2 +++ b/test/testrendercopyex.c	Wed Sep 21 23:06:38 2016 +0200
     3.3 @@ -45,7 +45,7 @@
     3.4  }
     3.5  
     3.6  SDL_Texture *
     3.7 -LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
     3.8 +LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent)
     3.9  {
    3.10      SDL_Surface *temp;
    3.11      SDL_Texture *texture;
    3.12 @@ -126,7 +126,7 @@
    3.13      s->sprite_rect.x = (viewport.w - s->sprite_rect.w) / 2;
    3.14      s->sprite_rect.y = (viewport.h - s->sprite_rect.h) / 2;
    3.15  
    3.16 -    SDL_RenderCopyEx(s->renderer, s->sprite, NULL, &s->sprite_rect, (double)s->sprite_rect.w, center, s->scale_direction);
    3.17 +    SDL_RenderCopyEx(s->renderer, s->sprite, NULL, &s->sprite_rect, (double)s->sprite_rect.w, center, (SDL_RendererFlip)s->scale_direction);
    3.18  
    3.19      SDL_SetRenderTarget(s->renderer, NULL);
    3.20      SDL_RenderCopy(s->renderer, target, NULL, NULL);