2022-06-28 22:32:11 +00:00
|
|
|
#ifndef OPENMW_MWCLASS_CLASSMODEL_H
|
|
|
|
#define OPENMW_MWCLASS_CLASSMODEL_H
|
|
|
|
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
|
|
|
|
|
|
#include "../mwworld/livecellref.hpp"
|
2022-09-22 18:26:05 +00:00
|
|
|
#include "../mwworld/ptr.hpp"
|
2022-06-28 22:32:11 +00:00
|
|
|
|
|
|
|
#include <components/misc/resourcehelpers.hpp>
|
|
|
|
#include <components/resource/resourcesystem.hpp>
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace MWClass
|
|
|
|
{
|
|
|
|
template <class Class>
|
|
|
|
std::string getClassModel(const MWWorld::ConstPtr& ptr)
|
|
|
|
{
|
2022-09-22 18:26:05 +00:00
|
|
|
const MWWorld::LiveCellRef<Class>* ref = ptr.get<Class>();
|
2022-06-28 22:32:11 +00:00
|
|
|
|
|
|
|
if (!ref->mBase->mModel.empty())
|
2022-09-22 18:26:05 +00:00
|
|
|
return Misc::ResourceHelpers::correctMeshPath(
|
|
|
|
ref->mBase->mModel, MWBase::Environment::get().getResourceSystem()->getVFS());
|
2022-06-28 22:32:11 +00:00
|
|
|
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|