From 14dc762f3146cf6b5d27454ed23c05a815ce5889 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Sat, 2 Dec 2017 14:43:48 +1100 Subject: [PATCH] Removed some pre-SDL 2.0.4 fallbacks As of 10ca22e863e0 we use an Ubuntu 16.04 Docker image for Travis, which has 2.0.4. --- src/sdl/rect.cpp | 4 ---- src/video.cpp | 8 -------- 2 files changed, 12 deletions(-) diff --git a/src/sdl/rect.cpp b/src/sdl/rect.cpp index 6b688a9fdd8..f80a023f422 100644 --- a/src/sdl/rect.cpp +++ b/src/sdl/rect.cpp @@ -21,12 +21,8 @@ namespace sdl { bool point_in_rect(int x, int y, const SDL_Rect& rect) { -#if SDL_VERSION_ATLEAST(2, 0, 4) SDL_Point p {x, y}; return SDL_PointInRect(&p, &rect) != SDL_FALSE; -#else - return x >= rect.x && y >= rect.y && x < rect.x + rect.w && y < rect.y + rect.h; -#endif } bool point_in_rect(const point& point, const SDL_Rect& rect) diff --git a/src/video.cpp b/src/video.cpp index 31710cc8b80..d1ca0f88f15 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -396,19 +396,11 @@ std::pair CVideo::get_dpi_scale_factor() const return result; } - /* This check is here because Travis CI builds with SDL 2.0.2. - * The code isn't intended to be skipped: end users, distribution packagers etc. - * should build the game with SDL 2.0.4 or above. - * - * - Jyrki, 2017-06-03 - */ -#if SDL_VERSION_ATLEAST(2, 0, 4) float hdpi, vdpi; SDL_GetDisplayDPI(window->get_display_index(), nullptr, &hdpi, &vdpi); result.first = hdpi / MAGIC_DPI_SCALE_NUMBER; result.second = vdpi / MAGIC_DPI_SCALE_NUMBER; -#endif return result; }