X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FTerrain.cpp;h=34da00ea94b2fd1d3071e1f755dee31de2fc2b3c;hb=4f4771bb67958d2e9180ba24d422141b9069e363;hp=9061f37559694f06f3bcb8ab4f8834f9da0367b7;hpb=a7c9ba64aa7413abb4c566dad8dc796526952d3e;p=lugaru.git diff --git a/Source/Terrain.cpp b/Source/Terrain.cpp index 9061f37..34da00e 100644 --- a/Source/Terrain.cpp +++ b/Source/Terrain.cpp @@ -21,6 +21,8 @@ along with Lugaru. If not, see . #include "Game.h" #include "Terrain.h" #include "Objects.h" +#include "Utils/Folders.h" + extern XYZ viewer; extern float viewdistance; extern float fadestart; @@ -396,7 +398,7 @@ void Terrain::UpdateVertexArray(int whichx, int whichy) } -bool Terrain::load(const char *fileName) +bool Terrain::load(const std::string& fileName) { static long i, j; static long x, y; @@ -407,7 +409,9 @@ bool Terrain::load(const char *fileName) ImageRec texture; //Load Image - load_image(ConvertFileName(fileName), texture); + if (!load_image(Folders::getResourcePath(fileName).c_str(), texture)) { + return false; + } //Is it valid? if (texture.bpp > 24) { @@ -641,7 +645,7 @@ bool Terrain::load(const char *fileName) patch_elements = (patch_size) * (patch_size) * 54; CalculateNormals(); - return 1; + return true; } void Terrain::CalculateNormals()