summaryrefslogtreecommitdiffstats
path: root/src/graphics/engine/modelfile.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-12-14 21:30:35 +0100
committerPiotr Dziwinski <piotrdz@gmail.com>2012-12-14 21:30:35 +0100
commit4811defca2eeea69e40346be6b1647f276db8c76 (patch)
tree52204202603817d09d93ed8a863b69f93ada74b2 /src/graphics/engine/modelfile.cpp
parent39ac36efda1f7c7b446886cf2508518f06e132ba (diff)
downloadcolobot-4811defca2eeea69e40346be6b1647f276db8c76.tar.gz
colobot-4811defca2eeea69e40346be6b1647f276db8c76.tar.bz2
colobot-4811defca2eeea69e40346be6b1647f276db8c76.zip
Static objects using OpenGL VBOs and display lists
Diffstat (limited to 'src/graphics/engine/modelfile.cpp')
-rw-r--r--src/graphics/engine/modelfile.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/graphics/engine/modelfile.cpp b/src/graphics/engine/modelfile.cpp
index 3b0343a..a9972fe 100644
--- a/src/graphics/engine/modelfile.cpp
+++ b/src/graphics/engine/modelfile.cpp
@@ -1157,18 +1157,24 @@ bool CModelFile::WriteBinaryModel(std::ostream& stream)
#ifndef MODELFILE_NO_ENGINE
+
+/**
+ * TODO: move the function to CEngine or new class (CModelManager?)
+ * and make models shared static objects.
+ */
+
bool CModelFile::CreateEngineObject(int objRank)
{
std::vector<VertexTex2> vs(3, VertexTex2());
+ m_engine->SetObjectStatic(objRank, true); // TODO: make optional in the future
+
float limit[2];
limit[0] = m_engine->GetLimitLOD(0); // frontier AB as config
limit[1] = m_engine->GetLimitLOD(1); // frontier BC as config
for (int i = 0; i < static_cast<int>( m_triangles.size() ); i++)
{
- // TODO move this to CEngine
-
float min = m_triangles[i].min;
float max = m_triangles[i].max;