Attempt to fix build in Travis CI
This commit is contained in:
parent
e188379cd2
commit
bcc0992daa
1 changed files with 7 additions and 1 deletions
|
@ -346,17 +346,23 @@ sdl::window *CVideo::get_window()
|
|||
|
||||
std::pair<float, float> CVideo::get_dpi_scale_factor() const
|
||||
{
|
||||
std::pair<float, float> result;
|
||||
std::pair<float, float> result {1.0f, 1.0f};
|
||||
|
||||
if(!window) {
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue