- rename GLCompiler::Vertex to GLCompiler::VAO to avoid name conflicts

Tue, 21 Jan 2014 01:09:22 +0200

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Tue, 21 Jan 2014 01:09:22 +0200
changeset 673
8e6f5b3f9d38
parent 672
0925d25ea32c
child 674
3d8ab0f89102

- rename GLCompiler::Vertex to GLCompiler::VAO to avoid name conflicts

src/GLCompiler.cc file | annotate | diff | comparison | revisions
src/GLCompiler.h file | annotate | diff | comparison | revisions
--- a/src/GLCompiler.cc	Tue Jan 21 01:05:03 2014 +0200
+++ b/src/GLCompiler.cc	Tue Jan 21 01:09:22 2014 +0200
@@ -14,7 +14,7 @@
 GLCompiler g_vertexCompiler;
 
 // =============================================================================
-// -----------------------------------------------------------------------------
+//
 GLCompiler::GLCompiler() :
 	m_file (null)
 {
@@ -27,7 +27,7 @@
 // Note: we use the top level object's color but the draw object's vertices.
 // This is so that the index color is generated correctly - it has to reference
 // the top level object's ID. This is crucial for picking to work.
-// -----------------------------------------------------------------------------
+//
 void GLCompiler::compilePolygon (LDObject* drawobj, LDObject* trueobj, QList< GLCompiler::CompiledTriangle >& data)
 {
 	const QColor pickColor = getObjectColor (trueobj, PickColor);
@@ -72,7 +72,7 @@
 }
 
 // =============================================================================
-// -----------------------------------------------------------------------------
+//
 void GLCompiler::compileObject (LDObject* obj)
 {
 	initObject (obj);
@@ -127,7 +127,7 @@
 }
 
 // =============================================================================
-// -----------------------------------------------------------------------------
+//
 void GLCompiler::compileSubObject (LDObject* obj, LDObject* topobj, GLCompiler::PolygonList& data)
 {
 	LDObjectList objs;
@@ -173,7 +173,7 @@
 }
 
 // =============================================================================
-// -----------------------------------------------------------------------------
+//
 void GLCompiler::compileDocument()
 {
 	for (LDObject * obj : m_file->getObjects())
@@ -181,7 +181,7 @@
 }
 
 // =============================================================================
-// -----------------------------------------------------------------------------
+//
 void GLCompiler::forgetObject (LDObject* obj)
 {
 	auto it = m_objArrays.find (obj);
@@ -193,14 +193,14 @@
 }
 
 // =============================================================================
-// -----------------------------------------------------------------------------
+//
 void GLCompiler::setFile (LDDocument* file)
 {
 	m_file = file;
 }
 
 // =============================================================================
-// -----------------------------------------------------------------------------
+//
 const GLCompiler::Array* GLCompiler::getMergedBuffer (GL::VAOType type)
 {
 	// If there are objects staged for compilation, compile them now.
@@ -238,7 +238,7 @@
 
 // =============================================================================
 // This turns a compiled triangle into usable VAO vertices
-// -----------------------------------------------------------------------------
+//
 GLCompiler::Array* GLCompiler::postprocess (const CompiledTriangle& poly, GLRenderer::VAOType type)
 {
 	Array* va = new Array;
@@ -247,7 +247,7 @@
 	for (int i = 0; i < poly.numVerts; ++i)
 	{
 		alias v0 = poly.verts[i];
-		Vertex v;
+		VAO v;
 		v.x = v0.x();
 		v.y = v0.y();
 		v.z = v0.z();
@@ -279,19 +279,19 @@
 	{
 		int32 rgb = getColorRGB (getObjectColor (poly.obj, BFCFront));
 
-		for (Vertex v : verts)
+		for (VAO vao : verts)
 		{
-			v.color = rgb;
-			*va << v;
+			vao.color = rgb;
+			*va << vao;
 		}
 
 		rgb = getColorRGB (getObjectColor (poly.obj, BFCBack));
 
 		for (int i = verts.size() - 1; i >= 0; --i)
 		{
-			Vertex v = verts[i];
-			v.color = rgb;
-			*va << v;
+			VAO vao = verts[i];
+			vao.color = rgb;
+			*va << vao;
 		}
 	}
 	else
@@ -301,7 +301,7 @@
 }
 
 // =============================================================================
-// -----------------------------------------------------------------------------
+//
 uint32 GLCompiler::getColorRGB (const QColor& color)
 {
 	return
@@ -312,7 +312,7 @@
 }
 
 // =============================================================================
-// -----------------------------------------------------------------------------
+//
 QColor GLCompiler::getObjectColor (LDObject* obj, ColorType colotype) const
 {
 	QColor qcol;
@@ -403,7 +403,7 @@
 }
 
 // =============================================================================
-// -----------------------------------------------------------------------------
+//
 void GLCompiler::needMerge()
 {
 	// Set all of m_changed to true
@@ -411,7 +411,7 @@
 }
 
 // =============================================================================
-// -----------------------------------------------------------------------------
+//
 void GLCompiler::initObject (LDObject* obj)
 {
 	if (m_objArrays.find (obj) == m_objArrays.end())
@@ -419,7 +419,7 @@
 }
 
 // =============================================================================
-// -----------------------------------------------------------------------------
+//
 void GLCompiler::stageForCompilation (LDObject* obj)
 {
 	m_staged << obj;
--- a/src/GLCompiler.h	Tue Jan 21 01:05:03 2014 +0200
+++ b/src/GLCompiler.h	Tue Jan 21 01:09:22 2014 +0200
@@ -46,7 +46,7 @@
 
 		struct CompiledTriangle
 		{
-			::Vertex	verts[3];
+			Vertex	verts[3];
 			uint8		numVerts;	// 2 if a line
 			uint32		rgb;		// Color of this poly normally
 			uint32		pickrgb;	// Color of this poly while picking
@@ -54,7 +54,7 @@
 			LDObject*	obj;		// Pointer to the object this poly represents
 		};
 
-		struct Vertex
+		struct VAO
 		{
 			float x, y, z;
 			uint32 color;
@@ -62,7 +62,7 @@
 		};
 
 		using PolygonList = QList<CompiledTriangle>;
-		using Array = QVector<GLCompiler::Vertex>;
+		using Array = QVector<VAO>;
 
 		GLCompiler();
 		~GLCompiler();

mercurial