diff -r 31540c1f22ea -r 6a05c4969074 src/gldata.h --- a/src/gldata.h Mon Jan 20 15:04:26 2014 +0200 +++ b/src/gldata.h Mon Jan 20 16:42:18 2014 +0200 @@ -6,10 +6,6 @@ #include #include -class QColor; -class LDTriangle; -class LDFile; - /* ============================================================================= * ----------------------------------------------------------------------------- * VertexCompiler @@ -38,31 +34,36 @@ */ class VertexCompiler -{ public: +{ + public: enum ColorType - { Normal, + { + Normal, BFCFront, BFCBack, PickColor, }; struct CompiledTriangle - { vertex verts[3]; - uint8 numVerts; // 2 if a line - QRgb rgb; // Color of this poly normally - QRgb pickrgb; // Color of this poly while picking - bool isCondLine; // Is this a conditional line? - LDObject* obj; // Pointer to the object this poly represents + { + ::Vertex verts[3]; + uint8 numVerts; // 2 if a line + QRgb rgb; // Color of this poly normally + QRgb pickrgb; // Color of this poly while picking + bool isCondLine; // Is this a conditional line? + LDObject* obj; // Pointer to the object this poly represents }; struct Vertex - { float x, y, z; + { + float x, y, z; uint32 color; float pad[4]; }; class Array - { public: + { + public: typedef int32 Size; Array(); @@ -86,8 +87,8 @@ VertexCompiler(); ~VertexCompiler(); - void setFile (LDFile* file); - void compileFile(); + void setFile (LDDocument* file); + void compileDocument(); void forgetObject (LDObject* obj); void initObject (LDObject* obj); const Array* getMergedBuffer (GL::VAOType type); @@ -103,12 +104,12 @@ void compileSubObject (LDObject* obj, LDObject* topobj, QList& data); Array* postprocess (const CompiledTriangle& i, GL::VAOType type); - QMap m_objArrays; - QMap m_fileCache; - Array m_mainArrays[GL::NumArrays]; - LDFile* m_file; - bool m_changed[GL::NumArrays]; - QList m_staged; + QMap m_objArrays; + QMap m_fileCache; + Array m_mainArrays[GL::NumArrays]; + LDDocument* m_file; + bool m_changed[GL::NumArrays]; + LDObjectList m_staged; }; extern VertexCompiler g_vertexCompiler;