Skip to content
Snippets Groups Projects
Commit 9a0dd470 authored by Zeno-'s avatar Zeno-
Browse files

Fix performance regression

parent 929e0b0a
No related branches found
No related tags found
No related merge requests found
......@@ -647,7 +647,8 @@ const char *getVideoDriverFriendlyName(irr::video::E_DRIVER_TYPE type)
#ifndef __ANDROID__
#ifdef XORG_USED
float getDisplayDensity()
static float calcDisplayDensity()
{
const char* current_display = getenv("DISPLAY");
......@@ -665,7 +666,7 @@ float getDisplayDensity()
XCloseDisplay(x11display);
return (std::max(dpi_height,dpi_width) / 96.0);
return std::max(dpi_height,dpi_width) / 96.0;
}
}
......@@ -673,6 +674,14 @@ float getDisplayDensity()
return g_settings->getFloat("screen_dpi")/96.0;
}
float getDisplayDensity()
{
static float cached_display_density = calcDisplayDensity();
return cached_display_density;
}
#else
float getDisplayDensity()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment