X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FModels.cpp;h=16f92badf78552f5d1667896e0485184ba7276b1;hb=757fd9c1ec8d263225df90ef486051712f448483;hp=d0a991b8217a5b6eed602b44b613913ce6664dd9;hpb=8d45019f2b1ac74108ae4589333680158fee32d5;p=lugaru.git diff --git a/Source/Models.cpp b/Source/Models.cpp index d0a991b..16f92ba 100644 --- a/Source/Models.cpp +++ b/Source/Models.cpp @@ -20,6 +20,7 @@ along with Lugaru. If not, see . #include "Game.h" #include "Models.h" +#include "Utils/Folders.h" extern float multiplier; extern float viewdistance; @@ -407,7 +408,7 @@ bool Model::loadnotex(const char *filename ) type = notextype; color = 0; - tfile = fopen( ConvertFileName(filename), "rb" ); + tfile = fopen( Folders::getResourcePath(filename).c_str(), "rb" ); // read model settings fseek(tfile, 0, SEEK_SET); @@ -477,7 +478,7 @@ bool Model::load(const char *filename, bool texture ) type = normaltype; color = 0; - tfile = fopen( ConvertFileName(filename), "rb" ); + tfile = fopen( Folders::getResourcePath(filename).c_str(), "rb" ); // read model settings @@ -543,16 +544,13 @@ bool Model::loaddecal(const char *filename, bool texture ) LOGFUNC; - // Changing the filename so that its more os specific - char * FixedFN = ConvertFileName(filename); - - LOG(std::string("Loading decal...") + FixedFN); + LOG(std::string("Loading decal...") + Folders::getResourcePath(filename)); type = decalstype; numdecals = 0; color = 0; - tfile = fopen( FixedFN, "rb" ); + tfile = fopen( Folders::getResourcePath(filename).c_str(), "rb" ); // read model settings @@ -646,7 +644,7 @@ bool Model::loadraw(char *filename ) type = rawtype; color = 0; - tfile = fopen( ConvertFileName(filename), "rb" ); + tfile = fopen( Folders::getResourcePath(filename).c_str(), "rb" ); // read model settings