diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index fb472eb2b..7f5cd23c7 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -140,14 +141,24 @@ namespace MWRender virtual void doWork() { - for (std::vector::const_iterator it = mModels.begin(); it != mModels.end(); ++it) - mResourceSystem->getSceneManager()->getTemplate(*it); - for (std::vector::const_iterator it = mTextures.begin(); it != mTextures.end(); ++it) - mResourceSystem->getImageManager()->getImage(*it); + try + { + for (std::vector::const_iterator it = mModels.begin(); it != mModels.end(); ++it) + mResourceSystem->getSceneManager()->cacheInstance(*it); + for (std::vector::const_iterator it = mTextures.begin(); it != mTextures.end(); ++it) + mResourceSystem->getImageManager()->getImage(*it); + for (std::vector::const_iterator it = mKeyframes.begin(); it != mKeyframes.end(); ++it) + mResourceSystem->getKeyframeManager()->get(*it); + } + catch (std::exception&) + { + // ignore error (will be shown when these are needed proper) + } } std::vector mModels; std::vector mTextures; + std::vector mKeyframes; private: Resource::ResourceSystem* mResourceSystem; @@ -308,6 +319,13 @@ namespace MWRender mSky->listAssetsToPreload(workItem->mModels, workItem->mTextures); mWater->listAssetsToPreload(workItem->mTextures); + const char* basemodels[] = {"xbase_anim", "xbase_anim.1st", "xbase_anim_female", "xbase_animkna"}; + for (size_t i=0; imModels.push_back(std::string("meshes/") + basemodels[i] + ".nif"); + workItem->mKeyframes.push_back(std::string("meshes/") + basemodels[i] + ".kf"); + } + workItem->mTextures.push_back("textures/_land_default.dds"); mWorkQueue->addWorkItem(workItem); diff --git a/components/resource/keyframemanager.cpp b/components/resource/keyframemanager.cpp index 4392f84c1..50dfbd9a3 100644 --- a/components/resource/keyframemanager.cpp +++ b/components/resource/keyframemanager.cpp @@ -1,7 +1,6 @@ #include "keyframemanager.hpp" #include -#include #include "objectcache.hpp" diff --git a/components/resource/keyframemanager.hpp b/components/resource/keyframemanager.hpp index 1c2c219bb..ab33d51e3 100644 --- a/components/resource/keyframemanager.hpp +++ b/components/resource/keyframemanager.hpp @@ -4,12 +4,9 @@ #include #include -#include "resourcemanager.hpp" +#include -namespace NifOsg -{ - class KeyframeHolder; -} +#include "resourcemanager.hpp" namespace Resource {