Made it possible to switch between legacy renderer and new renderer in code

This commit is contained in:
andreja6
2019-11-05 13:14:24 -08:00
parent bb01d01950
commit 55f3ff8964
4 changed files with 16 additions and 14 deletions

View File

@@ -194,7 +194,7 @@ bool PartInstance::collides(Box box)
{
return CollisionDetection::fixedSolidBoxIntersectsFixedSolidBox(getBox(), box);
}
#ifdef NEW_BOX_RENDER
void PartInstance::addVertex(Vector3 vertexPos,Color3 color)
{
_vertices.push_back(vertexPos.x);
@@ -265,15 +265,15 @@ bool PartInstance::isUniqueVertex(Vector3 pos)
return true;
}
#ifdef NEW_BOX_RENDER
void PartInstance::render(RenderDevice* rd) {
if(nameShown)
postRenderStack.push_back(this);
//if(nameShown)
//postRenderStack.push_back(this);
if (changed)
{
getBox();
_vertices.clear();
//std::vector<GLfloat>(_vertices).swap(_vertices); //Clear the memory
Vector3 renderSize = size/2;
// Front
addTriangle(Vector3(renderSize.x-_bevelSize,renderSize.y-_bevelSize,renderSize.z),