Browse Source

Hd setting

Laserlicht 3 months ago
parent
commit
03870ee28a
2 changed files with 9 additions and 4 deletions
  1. 3 3
      client/renderSDL/RenderHandler.cpp
  2. 6 1
      config/schemas/settings.json

+ 3 - 3
client/renderSDL/RenderHandler.cpp

@@ -137,7 +137,7 @@ RenderHandler::AnimationLayoutMap & RenderHandler::getAnimationLayout(const Anim
 
 	auto it = animationLayouts.find(actualPath);
 
-	if (it != animationLayouts.end())
+	if (it != animationLayouts.end() && settings["video"]["useHdTextures"].Bool())
 		return it->second;
 
 	AnimationLayoutMap result;
@@ -304,10 +304,10 @@ std::shared_ptr<SDLImageShared> RenderHandler::loadScaledImage(const ImageLocato
 	auto imagePathSprites = ImagePath::builtin(imagePathString).addPrefix(scaledSpritesPath.at(locator.scalingFactor));
 	auto imagePathData = ImagePath::builtin(imagePathString).addPrefix(scaledDataPath.at(locator.scalingFactor));
 
-	if(CResourceHandler::get()->existsResource(imagePathSprites))
+	if(CResourceHandler::get()->existsResource(imagePathSprites) && settings["video"]["useHdTextures"].Bool())
 		return std::make_shared<SDLImageShared>(imagePathSprites);
 
-	if(CResourceHandler::get()->existsResource(imagePathData))
+	if(CResourceHandler::get()->existsResource(imagePathData) && settings["video"]["useHdTextures"].Bool())
 		return std::make_shared<SDLImageShared>(imagePathData);
 
 	if(CResourceHandler::get()->existsResource(imagePath))

+ 6 - 1
config/schemas/settings.json

@@ -220,7 +220,8 @@
 				"fontUpscalingFilter",
 				"downscalingFilter",
 				"allowPortrait",
-				"asyncUpscaling"
+				"asyncUpscaling",
+				"useHdTextures"
 			],
 			"properties" : {
 				"resolution" : {
@@ -316,6 +317,10 @@
 				"asyncUpscaling" : {
 					"type" : "boolean",
 					"default" : true
+				},
+				"useHdTextures" : {
+					"type" : "boolean",
+					"default" : true
 				}
 			}
 		},