Преглед изворни кода

Added advmap config options to enable/disable fading;

Fay пре 10 година
родитељ
комит
3c3fb0e21d

+ 2 - 2
client/mapHandler.cpp

@@ -1223,7 +1223,7 @@ bool CMapHandler::printObject(const CGObjectInstance *obj, bool fadein /* = fals
 			cr.x = fx*32;
 			cr.y = fy*32;
 			TerrainTileObject toAdd(obj, cr);
-			if (fadein)
+			if (fadein && ADVOPT.objectFading)
 			{
 				auto tmp = CSDL_Ext::newSurface(bitmap->w, bitmap->h);
 				SDL_BlitSurface(bitmap, nullptr, tmp, nullptr); // can't be 8bpp for fading
@@ -1269,7 +1269,7 @@ bool CMapHandler::hideObject(const CGObjectInstance *obj, bool fadeout /* = fals
 				{
 					if (ttiles[i][j][k].objects[x].obj->id == obj->id)
 					{
-						if (fadeout) // erase delayed until end of fadeout
+						if (fadeout && ADVOPT.objectFading) // erase delayed until end of fadeout
 						{						
 							auto bitmap = graphics->getDef(obj)->ourImages[0].bitmap;
 							auto tmp = CSDL_Ext::newSurface(bitmap->w, bitmap->h); // TODO cache these bitmaps instead of creating new ones?

+ 2 - 0
client/windows/CAdvmapInterface.cpp

@@ -353,6 +353,8 @@ int3 CTerrainRect::tileCountOnScreen()
 
 void CTerrainRect::fadeFromCurrentView()
 {
+	if (!ADVOPT.screenFading)
+		return;
 	if (adventureInt->mode == EAdvMapMode::WORLD_VIEW)
 		return;
 	

+ 1 - 1
config/resolutions.json

@@ -4,7 +4,7 @@
 		{
 			"resolution": { "x": 800, "y": 600 },
 			"InGameConsole": { "maxInputPerLine": 60, "maxOutputPerLine": 39 },
-			"AdvMap": { "x": 7, "y": 7, "width": 594, "height": 546, "smoothMove": 1, "puzzleSepia": 1 },
+			"AdvMap": { "x": 7, "y": 7, "width": 594, "height": 546, "smoothMove": 1, "puzzleSepia": 1, "objectFading" : 1, "screenFading" : 1 },
 			"InfoBox": { "x": 605, "y": 389 },
 			"gem0": { "x": 6, "y": 508, "graphic": "agemLL.def" },
 			"gem1": { "x": 556, "y": 508, "graphic": "agemLR.def" },

+ 2 - 0
lib/CConfigHandler.cpp

@@ -228,6 +228,8 @@ void config::CConfigHandler::init()
 		current->ac.advmapH = g["AdvMap"]["height"].Float();
 		current->ac.smoothMove = g["AdvMap"]["smoothMove"].Float();
 		current->ac.puzzleSepia = g["AdvMap"]["puzzleSepia"].Float();
+		current->ac.screenFading = g["AdvMap"]["screenFading"].Float();
+		current->ac.objectFading = g["AdvMap"]["objectFading"].Float();
 
 		current->ac.infoboxX = g["InfoBox"]["x"].Float();
 		current->ac.infoboxY = g["InfoBox"]["y"].Float();

+ 2 - 0
lib/CConfigHandler.h

@@ -133,6 +133,8 @@ namespace config
 		int advmapX, advmapY, advmapW, advmapH;
 		bool smoothMove;
 		bool puzzleSepia;
+		bool screenFading;
+		bool objectFading;
 		//general properties
 		std::string mainGraphic;
 		std::string worldViewGraphic;