#include "activator.hpp" #include #include #include "../mwworld/ptr.hpp" #include "../mwrender/cellimp.hpp" namespace MWClass { void Activator::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender, MWWorld::Environment& environment) const { ESMS::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); const std::string &model = ref->base->model; if (!model.empty()) { cellRender.insertBegin (ref->ref); cellRender.insertMesh ("meshes\\" + model); ref->mData.setHandle (cellRender.insertEnd (ref->mData.isEnabled())); } } std::string Activator::getName (const MWWorld::Ptr& ptr) const { ESMS::LiveCellRef *ref = ptr.get(); return ref->base->name; } std::string Activator::getScript (const MWWorld::Ptr& ptr) const { ESMS::LiveCellRef *ref = ptr.get(); return ref->base->script; } void Activator::registerSelf() { boost::shared_ptr instance (new Activator); registerClass (typeid (ESM::Activator).name(), instance); } }