Don't create the werewolf overlay if its texture is not available

Avoiding a warning in the log when Bloodmoon is not installed
openmw-38
scrawl 9 years ago
parent 1f543b4d79
commit 5981e1cbb3

@ -324,7 +324,9 @@ namespace MWGui
trackWindow(mCompanionWindow, "companion");
mJailScreen = new JailScreen();
mWerewolfFader = new ScreenFader("textures\\werewolfoverlay.dds");
std::string werewolfFaderTex = "textures\\werewolfoverlay.dds";
if (mResourceSystem->getVFS()->exists(werewolfFaderTex))
mWerewolfFader = new ScreenFader(werewolfFaderTex);
mBlindnessFader = new ScreenFader("black");
std::string hitFaderTexture = "textures\\bm_player_hit_01.dds";
// fall back to player_hit_01.dds if bm_player_hit_01.dds is not available
@ -984,6 +986,7 @@ namespace MWGui
mCompanionWindow->onFrame();
mJailScreen->onFrame(frameDuration);
if (mWerewolfFader)
mWerewolfFader->update(frameDuration);
mBlindnessFader->update(frameDuration);
mHitFader->update(frameDuration);
@ -1878,6 +1881,7 @@ namespace MWGui
if (!mWerewolfOverlayEnabled)
return;
if (mWerewolfFader)
mWerewolfFader->notifyAlphaChanged(set ? 1.0f : 0.0f);
}

Loading…
Cancel
Save