]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client/renderingengine.cpp
Merge branch 'master' of https://github.com/minetest/minetest
[dragonfireclient.git] / src / client / renderingengine.cpp
index 037ede07475bc48ee6f725d4332374405c2fb756..6ebcc784d151abd0ccb7fecc6ec38fbf07dc096c 100644 (file)
@@ -19,7 +19,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include <IrrlichtDevice.h>
-#include <irrlicht.h>
 #include "fontengine.h"
 #include "client.h"
 #include "clouds.h"
@@ -117,7 +116,7 @@ RenderingEngine::RenderingEngine(IEventReceiver *receiver)
        }
 
        SIrrlichtCreationParameters params = SIrrlichtCreationParameters();
-       if (g_logger.getTraceEnabled())
+       if (tracestream)
                params.LoggingLevel = irr::ELL_DEBUG;
        params.DriverType = driverType;
        params.WindowSize = core::dimension2d<u32>(screen_w, screen_h);
@@ -253,7 +252,7 @@ void RenderingEngine::setupTopLevelXorgWindow(const std::string &name)
        // force a shutdown of an application if it doesn't respond to the destroy
        // window message.
 
-       verbosestream << "Client: Setting Xorg _NET_WM_PID extened window manager property"
+       verbosestream << "Client: Setting Xorg _NET_WM_PID extended window manager property"
                << std::endl;
 
        Atom NET_WM_PID = XInternAtom(x11_dpl, "_NET_WM_PID", false);
@@ -304,15 +303,14 @@ bool RenderingEngine::setWindowIcon()
 #if defined(XORG_USED)
 #if RUN_IN_PLACE
        return setXorgWindowIconFromPath(
-                       porting::path_share + "/misc/" PROJECT_NAME "-xorg-icon-128.png");
+                       porting::path_share + "/misc/dragonfire-xorg-icon-128.png");
 #else
        // We have semi-support for reading in-place data if we are
        // compiled with RUN_IN_PLACE. Don't break with this and
        // also try the path_share location.
        return setXorgWindowIconFromPath(
-                              ICON_DIR "/hicolor/128x128/apps/" PROJECT_NAME ".png") ||
-              setXorgWindowIconFromPath(porting::path_share + "/misc/" PROJECT_NAME
-                                                              "-xorg-icon-128.png");
+                              ICON_DIR "/hicolor/128x128/apps/dragonfire.png") ||
+              setXorgWindowIconFromPath(porting::path_share + "/misc/dragonfire-xorg-icon-128.png");
 #endif
 #elif defined(_WIN32)
        HWND hWnd; // Window handle
@@ -557,13 +555,13 @@ void RenderingEngine::draw_scene(video::SColor skycolor, bool show_hud,
 
 const VideoDriverInfo &RenderingEngine::getVideoDriverInfo(irr::video::E_DRIVER_TYPE type)
 {
-       static const std::unordered_map<irr::video::E_DRIVER_TYPE,VideoDriverInfo> driver_info_map = {
-               {irr::video::EDT_NULL, {"null", "NULL Driver"}},
-               {irr::video::EDT_OPENGL, {"opengl", "OpenGL"}},
-               {irr::video::EDT_OGLES1, {"ogles1", "OpenGL ES1"}},
-               {irr::video::EDT_OGLES2, {"ogles2", "OpenGL ES2"}},
+       static const std::unordered_map<int, VideoDriverInfo> driver_info_map = {
+               {(int)video::EDT_NULL,   {"null",   "NULL Driver"}},
+               {(int)video::EDT_OPENGL, {"opengl", "OpenGL"}},
+               {(int)video::EDT_OGLES1, {"ogles1", "OpenGL ES1"}},
+               {(int)video::EDT_OGLES2, {"ogles2", "OpenGL ES2"}},
        };
-       return driver_info_map.at(type);
+       return driver_info_map.at((int)type);
 }
 
 #ifndef __ANDROID__
@@ -599,7 +597,7 @@ static float calcDisplayDensity()
 float RenderingEngine::getDisplayDensity()
 {
        static float cached_display_density = calcDisplayDensity();
-       return cached_display_density;
+       return cached_display_density * g_settings->getFloat("display_density_factor");
 }
 
 #elif defined(_WIN32)
@@ -627,14 +625,14 @@ float RenderingEngine::getDisplayDensity()
                display_density = calcDisplayDensity(get_video_driver());
                cached = true;
        }
-       return display_density;
+       return display_density * g_settings->getFloat("display_density_factor");
 }
 
 #else
 
 float RenderingEngine::getDisplayDensity()
 {
-       return g_settings->getFloat("screen_dpi") / 96.0;
+       return (g_settings->getFloat("screen_dpi") / 96.0) * g_settings->getFloat("display_density_factor");
 }
 
 #endif