From 3c3fb0e21dced57dc4ad640051bc839c594b80e5 Mon Sep 17 00:00:00 2001 From: Fay Date: Mon, 2 Feb 2015 19:38:30 +0100 Subject: [PATCH] Added advmap config options to enable/disable fading; --- client/mapHandler.cpp | 4 ++-- client/windows/CAdvmapInterface.cpp | 2 ++ config/resolutions.json | 2 +- lib/CConfigHandler.cpp | 2 ++ lib/CConfigHandler.h | 2 ++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/client/mapHandler.cpp b/client/mapHandler.cpp index d430ef13f..e79569600 100644 --- a/client/mapHandler.cpp +++ b/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? diff --git a/client/windows/CAdvmapInterface.cpp b/client/windows/CAdvmapInterface.cpp index e120ae424..c0cde0ba3 100644 --- a/client/windows/CAdvmapInterface.cpp +++ b/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; diff --git a/config/resolutions.json b/config/resolutions.json index 8511694b0..1917a62da 100644 --- a/config/resolutions.json +++ b/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" }, diff --git a/lib/CConfigHandler.cpp b/lib/CConfigHandler.cpp index 937732f57..4dccaad1e 100644 --- a/lib/CConfigHandler.cpp +++ b/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(); diff --git a/lib/CConfigHandler.h b/lib/CConfigHandler.h index e1e75126d..1e85c44e0 100644 --- a/lib/CConfigHandler.h +++ b/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;