mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-13 12:40:04 +00:00
Remove WindowManager wrappers. It's not safe to use WindowManager in all places and it's not required. Environment stores resource system providing VFS required to call these functions. In the case of ObjectPaging it's available from the member variable. Also ObjectPaging::createChunk may access WindowManager when it's already destructed when exiting the game because it's destructed before CellPreloader finishes all background jobs. Engine::mResourceSystem is destructed after all other systems so it's safe to use it.
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#include "bodypart.hpp"
|
|
|
|
#include "../mwrender/renderinginterface.hpp"
|
|
#include "../mwrender/objects.hpp"
|
|
|
|
#include "../mwworld/cellstore.hpp"
|
|
|
|
#include "classmodel.hpp"
|
|
|
|
namespace MWClass
|
|
{
|
|
BodyPart::BodyPart()
|
|
: MWWorld::RegisteredClass<BodyPart>(ESM::BodyPart::sRecordId)
|
|
{
|
|
}
|
|
|
|
MWWorld::Ptr BodyPart::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
|
|
{
|
|
const MWWorld::LiveCellRef<ESM::BodyPart> *ref = ptr.get<ESM::BodyPart>();
|
|
|
|
return MWWorld::Ptr(cell.insert(ref), &cell);
|
|
}
|
|
|
|
void BodyPart::insertObjectRendering(const MWWorld::Ptr &ptr, const std::string &model, MWRender::RenderingInterface &renderingInterface) const
|
|
{
|
|
if (!model.empty()) {
|
|
renderingInterface.getObjects().insertModel(ptr, model);
|
|
}
|
|
}
|
|
|
|
std::string BodyPart::getName(const MWWorld::ConstPtr &ptr) const
|
|
{
|
|
return std::string();
|
|
}
|
|
|
|
bool BodyPart::hasToolTip(const MWWorld::ConstPtr& ptr) const
|
|
{
|
|
return false;
|
|
}
|
|
|
|
std::string BodyPart::getModel(const MWWorld::ConstPtr &ptr) const
|
|
{
|
|
return getClassModel<ESM::BodyPart>(ptr);
|
|
}
|
|
|
|
}
|