summaryrefslogtreecommitdiffstats
path: root/src/graphics/engine/modelfile.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-09-03 22:37:28 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-09-03 22:37:28 +0200
commit08f1b68ffd3fa0239e9533d5de6a6fe886083756 (patch)
tree18cef00ab0e847839c6a815ea21c846a621bfc2e /src/graphics/engine/modelfile.cpp
parent09fd0e205e25d5f0c9cf5b3ebad3509893118cae (diff)
downloadcolobot-08f1b68ffd3fa0239e9533d5de6a6fe886083756.tar.gz
colobot-08f1b68ffd3fa0239e9533d5de6a6fe886083756.tar.bz2
colobot-08f1b68ffd3fa0239e9533d5de6a6fe886083756.zip
Fix
Diffstat (limited to 'src/graphics/engine/modelfile.cpp')
-rw-r--r--src/graphics/engine/modelfile.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/graphics/engine/modelfile.cpp b/src/graphics/engine/modelfile.cpp
index c087250..02021c5 100644
--- a/src/graphics/engine/modelfile.cpp
+++ b/src/graphics/engine/modelfile.cpp
@@ -144,7 +144,7 @@ void WriteTextVertexTex2(const Gfx::VertexTex2& vertex, std::ostream& stream)
stream << "c " << vertex.coord.x << " " << vertex.coord.y << " " << vertex.coord.z;
stream << " n " << vertex.normal.x << " " << vertex.normal.y << " " << vertex.normal.z;
stream << " t1 " << vertex.texCoord.x << " " << vertex.texCoord.y;
- stream << " t2 " << vertex.texCoord.x << " " << vertex.texCoord.y;
+ stream << " t2 " << vertex.texCoord2.x << " " << vertex.texCoord2.y;
stream << std::endl;
}
@@ -809,7 +809,8 @@ bool Gfx::CModelFile::ReadTextModel(std::istream& stream)
ReadLineValue<std::string>(stream, "tex2", t.tex2Name) &&
ReadLineValue<char>(stream, "var_tex2", varTex2Ch) &&
ReadLineValue<float>(stream, "min", t.min) &&
- ReadLineValue<float>(stream, "max", t.max);
+ ReadLineValue<float>(stream, "max", t.max) &&
+ ReadLineValue<int>(stream, "state", t.state);
if (!triOk || !stream.good())
{
@@ -834,6 +835,7 @@ bool Gfx::CModelFile::ReadTextModel(std::istream& stream)
triangle.variableTex2 = t.variableTex2;
triangle.min = t.min;
triangle.max = t.max;
+ triangle.state = t.state;
m_triangles.push_back(triangle);
@@ -916,6 +918,7 @@ bool Gfx::CModelFile::WriteTextModel(std::ostream& stream)
t.variableTex2 = m_triangles[i].variableTex2;
t.min = m_triangles[i].min;
t.max = m_triangles[i].max;
+ t.state = m_triangles[i].state;
stream << "p1 ";
WriteTextVertexTex2(t.p1, stream);
@@ -931,6 +934,7 @@ bool Gfx::CModelFile::WriteTextModel(std::ostream& stream)
stream << "var_tex2 " << (t.variableTex2 ? 'Y' : 'N') << std::endl;
stream << "min " << t.min << std::endl;
stream << "max " << t.max << std::endl;
+ stream << "state " << t.state << std::endl;
stream << std::endl;