Commit 823ccb1b authored by scrawl's avatar scrawl

Don't batch statics that have "references persist" set (temporary fix for...

Don't batch statics that have "references persist" set (temporary fix for Arkngthand door - Fixes #1386)
parent 69855097
......@@ -14,9 +14,12 @@ namespace MWClass
{
void Static::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
{
MWWorld::LiveCellRef<ESM::Static> *ref =
ptr.get<ESM::Static>();
const std::string model = getModel(ptr);
if (!model.empty()) {
renderingInterface.getObjects().insertModel(ptr, model);
renderingInterface.getObjects().insertModel(ptr, model, !ref->mBase->mPersistent);
}
}
......
......@@ -73,7 +73,7 @@ void Objects::insertBegin(const MWWorld::Ptr& ptr)
ptr.getRefData().setBaseNode(insert);
}
void Objects::insertModel(const MWWorld::Ptr &ptr, const std::string &mesh)
void Objects::insertModel(const MWWorld::Ptr &ptr, const std::string &mesh, bool batch)
{
insertBegin(ptr);
......@@ -99,7 +99,7 @@ void Objects::insertModel(const MWWorld::Ptr &ptr, const std::string &mesh)
mBounds[ptr.getCell()] = Ogre::AxisAlignedBox::BOX_NULL;
mBounds[ptr.getCell()].merge(bounds);
if(ptr.getTypeName() == typeid(ESM::Static).name() &&
if(batch &&
Settings::Manager::getBool("use static geometry", "Objects") &&
anim->canBatch())
{
......
......@@ -41,7 +41,7 @@ public:
, mRootNode(NULL)
{}
~Objects(){}
void insertModel(const MWWorld::Ptr& ptr, const std::string &model);
void insertModel(const MWWorld::Ptr& ptr, const std::string &model, bool batch=false);
ObjectAnimation* getAnimation(const MWWorld::Ptr &ptr);
......
......@@ -10,6 +10,7 @@ namespace ESM
void Static::load(ESMReader &esm)
{
mPersistent = esm.getRecordFlags() & 0x0400;
mModel = esm.getHNString("MODL");
}
void Static::save(ESMWriter &esm) const
......
......@@ -26,6 +26,8 @@ struct Static
std::string mId, mModel;
bool mPersistent;
void load(ESMReader &esm);
void save(ESMWriter &esm) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment