1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-28 18:18:52 +00:00
OpenMW/apps/openmw/mwclass/classmodel.hpp
2022-09-22 21:35:26 +03:00

30 lines
709 B
C++

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