86 |
86 |
87 VertexCompiler(); |
87 VertexCompiler(); |
88 ~VertexCompiler(); |
88 ~VertexCompiler(); |
89 void setFile (LDFile* file); |
89 void setFile (LDFile* file); |
90 void compileFile(); |
90 void compileFile(); |
91 void compileObject (LDObject* obj, LDObject* topobj); |
|
92 void forgetObject (LDObject* obj); |
91 void forgetObject (LDObject* obj); |
|
92 void initObject (LDObject* obj); |
93 const Array* getMergedBuffer (GL::VAOType type); |
93 const Array* getMergedBuffer (GL::VAOType type); |
94 QColor getObjectColor (LDObject* obj, ColorType list) const; |
94 QColor getObjectColor (LDObject* obj, ColorType list) const; |
|
95 void needMerge(); |
|
96 void stageForCompilation (LDObject* obj); |
95 |
97 |
96 static uint32 getColorRGB (QColor& color); |
98 static uint32 getColorRGB (QColor& color); |
97 |
99 |
98 private: |
100 private: |
99 void compilePolygon (LDObject* drawobj, LDObject* trueobj); |
101 void compilePolygon (LDObject* drawobj, LDObject* trueobj, List<CompiledTriangle>& data); |
|
102 void compileObject (LDObject* obj); |
|
103 void compileSubObject (LDObject* obj, LDObject* topobj, List<CompiledTriangle>& data); |
100 Array* postprocess (const CompiledTriangle& i, GL::VAOType type); |
104 Array* postprocess (const CompiledTriangle& i, GL::VAOType type); |
101 |
105 |
102 QMap<LDObject*, List<CompiledTriangle>> m_objArrays; |
106 QMap<LDObject*, Array*> m_objArrays; |
103 QMap<LDFile*, Array*> m_fileCache; |
107 QMap<LDFile*, Array*> m_fileCache; |
104 Array m_mainArrays[GL::NumArrays]; |
108 Array m_mainArrays[GL::NumArrays]; |
105 LDFile* m_file; |
109 LDFile* m_file; |
106 bool m_changed[GL::NumArrays]; |
110 bool m_changed[GL::NumArrays]; |
|
111 List<LDObject*> m_staged; |
107 }; |
112 }; |
108 |
113 |
109 extern VertexCompiler g_vertexCompiler; |
114 extern VertexCompiler g_vertexCompiler; |
110 |
115 |
111 #endif // LDFORGE_GLDATA_H |
116 #endif // LDFORGE_GLDATA_H |