diff options
Diffstat (limited to 'src/graphics/engine/modelfile.cpp')
-rw-r--r-- | src/graphics/engine/modelfile.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/graphics/engine/modelfile.cpp b/src/graphics/engine/modelfile.cpp index 99496aa..5f10ff1 100644 --- a/src/graphics/engine/modelfile.cpp +++ b/src/graphics/engine/modelfile.cpp @@ -22,6 +22,8 @@ #include "common/logger.h" #include "common/stringutils.h" +#include "common/resources/inputstream.h" + #include "graphics/engine/engine.h" #include "math/geometry.h" @@ -432,9 +434,9 @@ bool CModelFile::ReadModel(const std::string& fileName) { m_triangles.clear(); - std::ifstream stream; - stream.open(fileName.c_str(), std::ios_base::in | std::ios_base::binary); - if (!stream.good()) + CInputStream stream; + stream.open(fileName.c_str()); + if (!stream.is_open()) { GetLogger()->Error("Could not open file '%s'\n", fileName.c_str()); return false; @@ -823,9 +825,9 @@ struct NewModelTriangle1 bool CModelFile::ReadTextModel(const std::string& fileName) { - std::ifstream stream; - stream.open(fileName.c_str(), std::ios_base::in); - if (!stream.good()) + CInputStream stream; + stream.open(fileName.c_str()); + if (!stream.is_open()) { GetLogger()->Error("Could not open file '%s'\n", fileName.c_str()); return false; @@ -1020,9 +1022,9 @@ bool CModelFile::WriteTextModel(std::ostream& stream) bool CModelFile::ReadBinaryModel(const std::string& fileName) { - std::ifstream stream; - stream.open(fileName.c_str(), std::ios_base::in | std::ios_base::binary); - if (!stream.good()) + CInputStream stream; + stream.open(fileName.c_str()); + if (!stream.is_open()) { GetLogger()->Error("Could not open file '%s'\n", fileName.c_str()); return false; |