Tried to fix clearing children but failed miserably
This commit is contained in:
@@ -216,7 +216,7 @@ void renderShape(const Enum::Shape::Value& shape, const Vector3& size, const Col
|
||||
glPopMatrix();
|
||||
/*Plusses, can possibly integrate into cylinder code later on*/
|
||||
glVertexPointer(2, GL_FLOAT,0, square_arr);
|
||||
glColor(Color3(127,127,127));
|
||||
glColor3f(127,127,127);
|
||||
glPushMatrix();
|
||||
glRotatef(90,0,1,0);
|
||||
glTranslatef(0,0,-(size.z+0.001F));
|
||||
|
||||
@@ -8,5 +8,6 @@ class WorkspaceInstance :
|
||||
public:
|
||||
WorkspaceInstance(void);
|
||||
~WorkspaceInstance(void);
|
||||
void clearChildren();
|
||||
std::vector<PartInstance *> partObjects;
|
||||
};
|
||||
|
||||
@@ -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