From 2162a9e1b93848321e486adbac944930e0c8174c Mon Sep 17 00:00:00 2001 From: MiroslavR Date: Sat, 11 Oct 2014 23:09:20 +0200 Subject: [PATCH] Fall back to player_hit_01.dds if bm_player_hit_01.dds is not available --- apps/openmw/mwgui/screenfader.cpp | 7 ++++++- apps/openmw/mwgui/screenfader.hpp | 2 ++ apps/openmw/mwgui/windowmanagerimp.cpp | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/screenfader.cpp b/apps/openmw/mwgui/screenfader.cpp index c616a83380..f2b3fa6af0 100644 --- a/apps/openmw/mwgui/screenfader.cpp +++ b/apps/openmw/mwgui/screenfader.cpp @@ -71,10 +71,15 @@ namespace MWGui , mRepeat(false) { mMainWidget->setSize(MyGUI::RenderManager::getInstance().getViewSize()); - mMainWidget->setProperty("ImageTexture", texturePath); + setTexture(texturePath); setVisible(false); } + void ScreenFader::setTexture(const std::string & texturePath) + { + mMainWidget->setProperty("ImageTexture", texturePath); + } + void ScreenFader::update(float dt) { if (!mQueue.empty()) diff --git a/apps/openmw/mwgui/screenfader.hpp b/apps/openmw/mwgui/screenfader.hpp index 8c393bf922..402554555e 100644 --- a/apps/openmw/mwgui/screenfader.hpp +++ b/apps/openmw/mwgui/screenfader.hpp @@ -38,6 +38,8 @@ namespace MWGui public: ScreenFader(const std::string & texturePath); + void setTexture(const std::string & texturePath); + void update(float dt); void fadeIn(const float time); diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 0bc36cf4fc..2970c9b1db 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -273,7 +273,11 @@ namespace MWGui trackWindow(mCompanionWindow, "companion"); mWerewolfFader = new ScreenFader("textures\\werewolfoverlay.dds"); - mHitFader = new ScreenFader("textures\\player_hit_01.dds"); + mHitFader = new ScreenFader("textures\\bm_player_hit_01.dds"); + // fall back to player_hit_01.dds if bm_player_hit_01.dds is not available + // TODO: check if non-BM versions actually use player_hit_01.dds + if(!Ogre::ResourceGroupManager::getSingleton().resourceExistsInAnyGroup("textures\\bm_player_hit_01.dds")) + mHitFader->setTexture("textures\\player_hit_01.dds"); mScreenFader = new ScreenFader("black.png"); mDebugWindow = new DebugWindow();