mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-09 12:42:11 +00:00
41 lines
1.0 KiB
C++
41 lines
1.0 KiB
C++
|
|
#include "static.hpp"
|
|
|
|
#include <components/esm/loadstat.hpp>
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
#include "../mwrender/cellimp.hpp"
|
|
|
|
namespace MWClass
|
|
{
|
|
void Static::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
|
MWWorld::Environment& environment) const
|
|
{
|
|
ESMS::LiveCellRef<ESM::Static, MWWorld::RefData> *ref =
|
|
ptr.get<ESM::Static>();
|
|
|
|
assert (ref->base != NULL);
|
|
const std::string &model = ref->base->model;
|
|
if (!model.empty())
|
|
{
|
|
MWRender::Rendering rendering (cellRender, ref->ref, true);
|
|
cellRender.insertMesh ("meshes\\" + model);
|
|
cellRender.insertObjectPhysics();
|
|
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
}
|
|
}
|
|
|
|
std::string Static::getName (const MWWorld::Ptr& ptr) const
|
|
{
|
|
return "";
|
|
}
|
|
|
|
void Static::registerSelf()
|
|
{
|
|
boost::shared_ptr<Class> instance (new Static);
|
|
|
|
registerClass (typeid (ESM::Static).name(), instance);
|
|
}
|
|
}
|