diff -r 0b32138fedcc -r fff86085017e src/gldata.h --- a/src/gldata.h Sat Sep 07 16:40:05 2013 +0300 +++ b/src/gldata.h Mon Sep 09 23:35:32 2013 +0300 @@ -48,11 +48,11 @@ struct CompiledTriangle { vertex verts[3]; - uint8 numVerts; - QRgb rgb; - QRgb pickrgb; - bool isCondLine; - LDObject* obj; + 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 { @@ -88,22 +88,27 @@ ~VertexCompiler(); void setFile (LDFile* file); void compileFile(); - void compileObject (LDObject* obj, LDObject* topobj); void forgetObject (LDObject* obj); + void initObject (LDObject* obj); const Array* getMergedBuffer (GL::VAOType type); QColor getObjectColor (LDObject* obj, ColorType list) const; + void needMerge(); + void stageForCompilation (LDObject* obj); static uint32 getColorRGB (QColor& color); private: - void compilePolygon (LDObject* drawobj, LDObject* trueobj); + void compilePolygon (LDObject* drawobj, LDObject* trueobj, List& data); + void compileObject (LDObject* obj); + void compileSubObject (LDObject* obj, LDObject* topobj, List& data); Array* postprocess (const CompiledTriangle& i, GL::VAOType type); - QMap> m_objArrays; + QMap m_objArrays; QMap m_fileCache; Array m_mainArrays[GL::NumArrays]; LDFile* m_file; bool m_changed[GL::NumArrays]; + List m_staged; }; extern VertexCompiler g_vertexCompiler;