From: Ingo Ruhnke Date: Fri, 1 Aug 2014 16:57:09 +0000 (+0200) Subject: Removed foobar from Renderer::to_logical(), it's no longer needed X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=61bf2f1767d3ec05efc3e96aac5135b170e9b547;p=supertux.git Removed foobar from Renderer::to_logical(), it's no longer needed --- diff --git a/src/video/gl/gl_renderer.cpp b/src/video/gl/gl_renderer.cpp index 6982845db..9cf568c28 100644 --- a/src/video/gl/gl_renderer.cpp +++ b/src/video/gl/gl_renderer.cpp @@ -665,7 +665,7 @@ GLRenderer::apply_video_mode(const Size& size, bool fullscreen) } Vector -GLRenderer::to_logical(int physical_x, int physical_y, bool foobar) +GLRenderer::to_logical(int physical_x, int physical_y) { return Vector(physical_x * float(SCREEN_WIDTH) / PHYSICAL_SCREEN_WIDTH, physical_y * float(SCREEN_HEIGHT) / PHYSICAL_SCREEN_HEIGHT); diff --git a/src/video/gl/gl_renderer.hpp b/src/video/gl/gl_renderer.hpp index 1352df920..dd7030816 100644 --- a/src/video/gl/gl_renderer.hpp +++ b/src/video/gl/gl_renderer.hpp @@ -129,7 +129,7 @@ public: void resize(int w, int h); void apply_config(); void apply_video_mode(const Size& size, bool fullscreen); - Vector to_logical(int physical_x, int physical_y, bool foobar); + Vector to_logical(int physical_x, int physical_y); void set_gamma(float gamma); SDL_Window* get_window() const { return window; } }; diff --git a/src/video/renderer.hpp b/src/video/renderer.hpp index 5c9c16bfa..a2a2a500b 100644 --- a/src/video/renderer.hpp +++ b/src/video/renderer.hpp @@ -52,7 +52,7 @@ public: virtual void flip() = 0; virtual void resize(int w, int h) = 0; virtual void apply_config() = 0; - virtual Vector to_logical(int physical_x, int physical_y, bool foobar = false) = 0; + virtual Vector to_logical(int physical_x, int physical_y) = 0; virtual void set_gamma(float gamma) = 0; virtual SDL_Window* get_window() const = 0; diff --git a/src/video/sdl/sdl_renderer.cpp b/src/video/sdl/sdl_renderer.cpp index 49f1af1ef..6708ffe85 100644 --- a/src/video/sdl/sdl_renderer.cpp +++ b/src/video/sdl/sdl_renderer.cpp @@ -355,19 +355,10 @@ SDLRenderer::apply_config() } Vector -SDLRenderer::to_logical(int physical_x, int physical_y, bool foobar) +SDLRenderer::to_logical(int physical_x, int physical_y) { - if (foobar) - { - // SDL translates coordinates automatically, except for SDL_GetMouseState(), thus foobar - return Vector(physical_x * float(SCREEN_WIDTH) / (PHYSICAL_SCREEN_WIDTH), - physical_y * float(SCREEN_HEIGHT) / (PHYSICAL_SCREEN_HEIGHT)); - } - else - { - // SDL is doing the translation internally, so we have nothing to do - return Vector(physical_x, physical_y); - } + // SDL is doing the translation internally, so we have nothing to do + return Vector(physical_x, physical_y); } void diff --git a/src/video/sdl/sdl_renderer.hpp b/src/video/sdl/sdl_renderer.hpp index 197beb40f..a9159ec81 100644 --- a/src/video/sdl/sdl_renderer.hpp +++ b/src/video/sdl/sdl_renderer.hpp @@ -35,7 +35,7 @@ public: void flip(); void resize(int w, int h); void apply_config(); - Vector to_logical(int physical_x, int physical_y, bool foobar); + Vector to_logical(int physical_x, int physical_y); void set_gamma(float gamma); SDL_Window* get_window() const { return window; }