1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:23:52 +00:00

do not render deleted exterior cells in scene view

This commit is contained in:
Marc Zinnschlag 2014-06-30 17:33:03 +02:00
parent af59106533
commit 5fb2e1a877
2 changed files with 13 additions and 4 deletions

View file

@ -15,13 +15,18 @@ bool CSVRender::PagedWorldspaceWidget::adjustCells()
bool modified = false;
bool setCamera = false;
const CSMWorld::IdCollection<CSMWorld::Cell>& cells = mDocument.getData().getCells();
{
// remove
std::map<CSMWorld::CellCoordinates, Cell *>::iterator iter (mCells.begin());
while (iter!=mCells.end())
{
if (!mSelection.has (iter->first))
int index = cells.searchId (iter->first.getId (mWorldspace));
if (!mSelection.has (iter->first) || index==-1 ||
cells.getRecord (index).mState==CSMWorld::RecordBase::State_Deleted)
{
delete iter->second;
mCells.erase (iter++);
@ -39,7 +44,10 @@ bool CSVRender::PagedWorldspaceWidget::adjustCells()
for (CSMWorld::CellSelection::Iterator iter (mSelection.begin()); iter!=mSelection.end();
++iter)
{
if (mCells.find (*iter)==mCells.end())
int index = cells.searchId (iter->getId (mWorldspace));
if (index!=0 && cells.getRecord (index).mState!=CSMWorld::RecordBase::State_Deleted &&
mCells.find (*iter)==mCells.end())
{
if (setCamera)
{
@ -49,7 +57,7 @@ bool CSVRender::PagedWorldspaceWidget::adjustCells()
mCells.insert (std::make_pair (*iter,
new Cell (mDocument.getData(), getSceneManager(),
iter->getId ("std::default"))));
iter->getId (mWorldspace))));
modified = true;
}
@ -124,7 +132,7 @@ void CSVRender::PagedWorldspaceWidget::referenceAdded (const QModelIndex& parent
CSVRender::PagedWorldspaceWidget::PagedWorldspaceWidget (QWidget* parent, CSMDoc::Document& document)
: WorldspaceWidget (document, parent), mDocument (document)
: WorldspaceWidget (document, parent), mDocument (document), mWorldspace ("std::default")
{}
CSVRender::PagedWorldspaceWidget::~PagedWorldspaceWidget()

View file

@ -17,6 +17,7 @@ namespace CSVRender
CSMDoc::Document& mDocument;
CSMWorld::CellSelection mSelection;
std::map<CSMWorld::CellCoordinates, Cell *> mCells;
std::string mWorldspace;
private: