mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:53:50 +00:00
Don't batch statics that have "references persist" set (temporary fix for Arkngthand door - Fixes #1386)
This commit is contained in:
parent
69855097ca
commit
823ccb1b3d
5 changed files with 10 additions and 4 deletions
|
@ -14,9 +14,12 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
void Static::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
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);
|
const std::string model = getModel(ptr);
|
||||||
if (!model.empty()) {
|
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);
|
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);
|
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()] = Ogre::AxisAlignedBox::BOX_NULL;
|
||||||
mBounds[ptr.getCell()].merge(bounds);
|
mBounds[ptr.getCell()].merge(bounds);
|
||||||
|
|
||||||
if(ptr.getTypeName() == typeid(ESM::Static).name() &&
|
if(batch &&
|
||||||
Settings::Manager::getBool("use static geometry", "Objects") &&
|
Settings::Manager::getBool("use static geometry", "Objects") &&
|
||||||
anim->canBatch())
|
anim->canBatch())
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
, mRootNode(NULL)
|
, mRootNode(NULL)
|
||||||
{}
|
{}
|
||||||
~Objects(){}
|
~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);
|
ObjectAnimation* getAnimation(const MWWorld::Ptr &ptr);
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ namespace ESM
|
||||||
|
|
||||||
void Static::load(ESMReader &esm)
|
void Static::load(ESMReader &esm)
|
||||||
{
|
{
|
||||||
|
mPersistent = esm.getRecordFlags() & 0x0400;
|
||||||
mModel = esm.getHNString("MODL");
|
mModel = esm.getHNString("MODL");
|
||||||
}
|
}
|
||||||
void Static::save(ESMWriter &esm) const
|
void Static::save(ESMWriter &esm) const
|
||||||
|
|
|
@ -26,6 +26,8 @@ struct Static
|
||||||
|
|
||||||
std::string mId, mModel;
|
std::string mId, mModel;
|
||||||
|
|
||||||
|
bool mPersistent;
|
||||||
|
|
||||||
void load(ESMReader &esm);
|
void load(ESMReader &esm);
|
||||||
void save(ESMWriter &esm) const;
|
void save(ESMWriter &esm) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue