diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index 5cf2fcf10b..d6eb07e8aa 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include "../mwbase/environment.hpp" #include "../mwbase/windowmanager.hpp" @@ -88,7 +88,7 @@ namespace MWGui HUD::HUD(CustomMarkerCollection& customMarkers, DragAndDrop* dragAndDrop, MWRender::LocalMap* localMapRender) : WindowBase("openmw_hud.layout") - , LocalMapBase(customMarkers, localMapRender) + , LocalMapBase(customMarkers, localMapRender, Settings::map().mLocalMapHudFogOfWar) , mHealth(nullptr) , mMagicka(nullptr) , mStamina(nullptr) diff --git a/apps/openmw/mwgui/mapwindow.cpp b/apps/openmw/mwgui/mapwindow.cpp index 536e2b5a9f..088024ac63 100644 --- a/apps/openmw/mwgui/mapwindow.cpp +++ b/apps/openmw/mwgui/mapwindow.cpp @@ -167,7 +167,8 @@ namespace MWGui // ------------------------------------------------------ - LocalMapBase::LocalMapBase(CustomMarkerCollection& markers, MWRender::LocalMap* localMapRender) + LocalMapBase::LocalMapBase( + CustomMarkerCollection& markers, MWRender::LocalMap* localMapRender, bool fogOfWarEnabled) : mLocalMapRender(localMapRender) , mCurX(0) , mCurY(0) @@ -176,6 +177,7 @@ namespace MWGui , mCompass(nullptr) , mChanged(true) , mFogOfWarToggled(true) + , mFogOfWarEnabled(fogOfWarEnabled) , mNumCells(1) , mCellDistance(0) , mCustomMarkers(markers) @@ -244,7 +246,7 @@ namespace MWGui void LocalMapBase::applyFogOfWar() { - if (!mFogOfWarToggled || !Settings::map().mLocalMapHudFogOfWar) + if (!mFogOfWarToggled || !mFogOfWarEnabled) { for (auto& entry : mMaps) { @@ -595,7 +597,7 @@ namespace MWGui else entry.mMapTexture = std::make_unique(std::string(), nullptr); } - if (!entry.mFogTexture && mFogOfWarToggled && Settings::map().mLocalMapHudFogOfWar) + if (!entry.mFogTexture && mFogOfWarToggled && mFogOfWarEnabled) { osg::ref_ptr tex = mLocalMapRender->getFogOfWarTexture(entry.mCellX, entry.mCellY); if (tex) @@ -752,7 +754,7 @@ namespace MWGui #else : WindowPinnableBase("openmw_map_window.layout") #endif - , LocalMapBase(customMarkers, localMapRender) + , LocalMapBase(customMarkers, localMapRender, true) , NoDrop(drag, mMainWidget) , mGlobalMap(nullptr) , mGlobalMapImage(nullptr) diff --git a/apps/openmw/mwgui/mapwindow.hpp b/apps/openmw/mwgui/mapwindow.hpp index ea3165ac4b..20d898e967 100644 --- a/apps/openmw/mwgui/mapwindow.hpp +++ b/apps/openmw/mwgui/mapwindow.hpp @@ -73,7 +73,7 @@ namespace MWGui class LocalMapBase { public: - LocalMapBase(CustomMarkerCollection& markers, MWRender::LocalMap* localMapRender); + LocalMapBase(CustomMarkerCollection& markers, MWRender::LocalMap* localMapRender, bool fogOfWarEnabled); virtual ~LocalMapBase(); void init(MyGUI::ScrollView* widget, MyGUI::ImageBox* compass, int cellDistance = Constants::CellGridRadius); @@ -125,6 +125,7 @@ namespace MWGui std::string mPrefix; bool mChanged; bool mFogOfWarToggled; + bool mFogOfWarEnabled; int mNumCells; // for convenience, mCellDistance * 2 + 1 int mCellDistance;