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.
This commit is contained in:
Charles Dang 2017-12-02 14:43:48 +11:00
parent 9b8e235d17
commit 14dc762f31
2 changed files with 0 additions and 12 deletions

View File

@ -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)

View File

@ -396,19 +396,11 @@ std::pair<float, float> 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;
}