From d320df749f0d1fa99456fb8c31fb30fce232f28e Mon Sep 17 00:00:00 2001 From: Deve Date: Fri, 12 Aug 2016 23:30:10 +0200 Subject: [PATCH] Allow to set max texture size in config file. It gives much lower memory usage when it's set for example to 128. --- src/config/user_config.hpp | 6 +++++- src/graphics/irr_driver.cpp | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/config/user_config.hpp b/src/config/user_config.hpp index ccde2db71..a8267a858 100644 --- a/src/config/user_config.hpp +++ b/src/config/user_config.hpp @@ -492,9 +492,13 @@ namespace UserConfigParams PARAM_DEFAULT(BoolUserConfigParam(true, "old_driver_popup", &m_video_group, "Determines if popup message about too old drivers should be displayed.")); PARAM_PREFIX FloatUserConfigParam m_scale_rtts_factor - PARAM_DEFAULT(FloatUserConfigParam(1.0f, "m_scale_rtts_factor", + PARAM_DEFAULT(FloatUserConfigParam(1.0f, "scale_rtts_factor", &m_video_group, "Allows to increase performance by setting lower RTTs " "resolution. Value should be smaller or equal to 1.0")); + PARAM_PREFIX IntUserConfigParam m_max_texture_size + PARAM_DEFAULT(IntUserConfigParam(512, "max_texture_size", + &m_video_group, "Max texture size when high definition textures are " + "disabled")); // ---- Debug - not saved to config file /** If gamepad debugging is enabled. */ diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 075efdbe2..6fb6bfd5a 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -673,7 +673,9 @@ void IrrDriver::setMaxTextureSize() if( (UserConfigParams::m_high_definition_textures & 0x01) == 0) { io::IAttributes &att = m_video_driver->getNonConstDriverAttributes(); - att.setAttribute("MAX_TEXTURE_SIZE", core::dimension2du(512, 512)); + att.setAttribute("MAX_TEXTURE_SIZE", core::dimension2du( + UserConfigParams::m_max_texture_size, + UserConfigParams::m_max_texture_size)); } } // setMaxTextureSize