Tried to fix clearing children but failed miserably
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#include <sstream>
|
||||
#include <commdlg.h>
|
||||
#include "ErrorFunctions.h"
|
||||
#include "Globals.h"
|
||||
#include "Application.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace rapidxml;
|
||||
@@ -60,6 +62,7 @@ void DataModelInstance::modXMLLevel(float modY)
|
||||
void DataModelInstance::clearLevel()
|
||||
{
|
||||
workspace->clearChildren();
|
||||
g_usableApp->_propWindow->UpdateSelected(this);
|
||||
}
|
||||
PartInstance* DataModelInstance::makePart()
|
||||
{
|
||||
|
||||
@@ -140,6 +140,10 @@ void Instance::addChild(Instance* newChild)
|
||||
|
||||
void Instance::clearChildren()
|
||||
{
|
||||
for (size_t i = 0; i < children.size(); i++)
|
||||
{
|
||||
delete children.at(i);
|
||||
}
|
||||
children.clear();
|
||||
}
|
||||
void Instance::removeChild(Instance* oldChild)
|
||||
|
||||
@@ -245,19 +245,11 @@ bool PartInstance::collides(Box box)
|
||||
void PartInstance::render(RenderDevice* rd) {
|
||||
if (changed)
|
||||
{
|
||||
|
||||
|
||||
changed=false;
|
||||
Vector3 renderSize = size/2;
|
||||
|
||||
glNewList(glList, GL_COMPILE_AND_EXECUTE);
|
||||
glColor(this->color);
|
||||
glNewList(glList, GL_COMPILE);
|
||||
renderShape(this->shape, renderSize, color);
|
||||
glEndList();
|
||||
changed = false;
|
||||
return;
|
||||
|
||||
changed=false;
|
||||
|
||||
}
|
||||
rd->setObjectToWorldMatrix(cFrame);
|
||||
glCallList(glList);
|
||||
|
||||
@@ -9,6 +9,12 @@ WorkspaceInstance::WorkspaceInstance(void)
|
||||
canDelete = false;
|
||||
}
|
||||
|
||||
void WorkspaceInstance::clearChildren()
|
||||
{
|
||||
children.clear();
|
||||
Instance::clearChildren();
|
||||
}
|
||||
|
||||
WorkspaceInstance::~WorkspaceInstance(void)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user