Fixed old model format bugs

dev-ui
Piotr Dziwinski 2012-09-09 23:34:52 +02:00
parent b3d5491af4
commit 901f10b2ba
1 changed files with 5 additions and 1 deletions

View File

@ -484,6 +484,8 @@ bool Gfx::CModelFile::ReadModel(std::istream& stream)
t.used = IOUtils::ReadBinary<1, char>(stream);
t.selected = IOUtils::ReadBinary<1, char>(stream);
/* padding */ IOUtils::ReadBinary<2, unsigned int>(stream);
ReadBinaryVertex(stream, t.p1);
ReadBinaryVertex(stream, t.p2);
ReadBinaryVertex(stream, t.p3);
@ -520,6 +522,8 @@ bool Gfx::CModelFile::ReadModel(std::istream& stream)
t.used = IOUtils::ReadBinary<1, char>(stream);
t.selected = IOUtils::ReadBinary<1, char>(stream);
/* padding */ IOUtils::ReadBinary<2, unsigned int>(stream);
ReadBinaryVertex(stream, t.p1);
ReadBinaryVertex(stream, t.p2);
ReadBinaryVertex(stream, t.p3);
@ -848,7 +852,7 @@ bool Gfx::CModelFile::ReadTextModel(std::istream& stream)
if (!triOk || stream.fail())
{
GetLogger()->Error("Error reading model file header\n");
GetLogger()->Error("Error reading model data\n");
return false;
}