Disable fog of war rendering on the HUD map by default

coverity_scan
scrawl 9 years ago
parent ca4e859f61
commit ef20962fc5

@ -69,7 +69,7 @@ namespace MWGui
HUD::HUD(CustomMarkerCollection &customMarkers, DragAndDrop* dragAndDrop, MWRender::LocalMap* localMapRender) HUD::HUD(CustomMarkerCollection &customMarkers, DragAndDrop* dragAndDrop, MWRender::LocalMap* localMapRender)
: Layout("openmw_hud.layout") : Layout("openmw_hud.layout")
, LocalMapBase(customMarkers, localMapRender) , LocalMapBase(customMarkers, localMapRender, Settings::Manager::getBool("local map hud fog of war", "Map"))
, mHealth(NULL) , mHealth(NULL)
, mMagicka(NULL) , mMagicka(NULL)
, mStamina(NULL) , mStamina(NULL)

@ -156,7 +156,7 @@ namespace MWGui
// ------------------------------------------------------ // ------------------------------------------------------
LocalMapBase::LocalMapBase(CustomMarkerCollection &markers, MWRender::LocalMap* localMapRender) LocalMapBase::LocalMapBase(CustomMarkerCollection &markers, MWRender::LocalMap* localMapRender, bool fogOfWarEnabled)
: mLocalMapRender(localMapRender) : mLocalMapRender(localMapRender)
, mCurX(0) , mCurX(0)
, mCurY(0) , mCurY(0)
@ -165,7 +165,8 @@ namespace MWGui
, mCompass(NULL) , mCompass(NULL)
, mPrefix() , mPrefix()
, mChanged(true) , mChanged(true)
, mFogOfWar(true) , mFogOfWarToggled(true)
, mFogOfWarEnabled(fogOfWarEnabled)
, mMapWidgetSize(0) , mMapWidgetSize(0)
, mCustomMarkers(markers) , mCustomMarkers(markers)
, mMarkerUpdateTimer(0.0f) , mMarkerUpdateTimer(0.0f)
@ -222,9 +223,9 @@ namespace MWGui
bool LocalMapBase::toggleFogOfWar() bool LocalMapBase::toggleFogOfWar()
{ {
mFogOfWar = !mFogOfWar; mFogOfWarToggled = !mFogOfWarToggled;
applyFogOfWar(); applyFogOfWar();
return mFogOfWar; return mFogOfWarToggled;
} }
void LocalMapBase::applyFogOfWar() void LocalMapBase::applyFogOfWar()
@ -238,7 +239,7 @@ namespace MWGui
int y = mCurY + (-1*(my-1)); int y = mCurY + (-1*(my-1));
MyGUI::ImageBox* fog = mFogWidgets[my + 3*mx]; MyGUI::ImageBox* fog = mFogWidgets[my + 3*mx];
if (!mFogOfWar) if (!mFogOfWarToggled || !mFogOfWarEnabled)
{ {
fog->setImageTexture(""); fog->setImageTexture("");
continue; continue;

@ -61,7 +61,7 @@ namespace MWGui
class LocalMapBase class LocalMapBase
{ {
public: public:
LocalMapBase(CustomMarkerCollection& markers, MWRender::LocalMap* localMapRender); LocalMapBase(CustomMarkerCollection& markers, MWRender::LocalMap* localMapRender, bool fogOfWarEnabled = true);
virtual ~LocalMapBase(); virtual ~LocalMapBase();
void init(MyGUI::ScrollView* widget, MyGUI::ImageBox* compass, int mapWidgetSize); void init(MyGUI::ScrollView* widget, MyGUI::ImageBox* compass, int mapWidgetSize);
@ -105,7 +105,8 @@ namespace MWGui
MyGUI::ImageBox* mCompass; MyGUI::ImageBox* mCompass;
std::string mPrefix; std::string mPrefix;
bool mChanged; bool mChanged;
bool mFogOfWar; bool mFogOfWarToggled;
bool mFogOfWarEnabled;
int mMapWidgetSize; int mMapWidgetSize;

@ -47,6 +47,10 @@ global map cell size = 18
# cell, 256 is 1/8 cell. See documentation for details. (e.g. 64 to 256). # cell, 256 is 1/8 cell. See documentation for details. (e.g. 64 to 256).
local map hud widget size = 256 local map hud widget size = 256
# Enables Fog of War rendering on the HUD map. Default is Off since with default settings
# the map is so small that the fog would not obscure anything, just darken the edges slightly.
local map hud fog of war = false
# Resolution of local map in GUI window in pixels. See documentation # Resolution of local map in GUI window in pixels. See documentation
# for details which may affect cell load performance. (e.g. 128 to 1024). # for details which may affect cell load performance. (e.g. 128 to 1024).
local map resolution = 256 local map resolution = 256

Loading…
Cancel
Save