X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FTerrain.cpp;h=9061f37559694f06f3bcb8ab4f8834f9da0367b7;hb=211943fca2a77110d07c4eab259ed0208462766e;hp=38bf0ae611c9643d38faa9d196129b697dd2dc43;hpb=6c36b920245ca8b1e3d9aaede5f9d2a6210538a1;p=lugaru.git diff --git a/Source/Terrain.cpp b/Source/Terrain.cpp index 38bf0ae..9061f37 100644 --- a/Source/Terrain.cpp +++ b/Source/Terrain.cpp @@ -1,5 +1,6 @@ /* Copyright (C) 2003, 2010 - Wolfire Games +Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file) This file is part of Lugaru. @@ -34,7 +35,6 @@ extern bool decals; extern float blurness; extern float targetblurness; extern Objects objects; -extern TGAImageRec texture; extern bool visibleloading; extern bool skyboxtexture; extern int tutoriallevel; @@ -197,7 +197,6 @@ void Terrain::UpdateTransparency(int whichx, int whichy) void Terrain::UpdateTransparencyother(int whichx, int whichy) { - static XYZ vertex; static int i, j, a, b, c, d, patch_size, stepsize; patch_size = size / subdivision; @@ -404,15 +403,11 @@ bool Terrain::load(const char *fileName) static float patch_size; float temptexdetail = texdetail; - //LoadTGA( fileName ); - // Fixing filename so that it works with its own os - char * FixedFN = ConvertFileName(fileName); + ImageRec texture; - unsigned char fileNamep[256]; - CopyCStringToPascal(FixedFN, fileNamep); //Load Image - upload_image( fileNamep , 0); + load_image(ConvertFileName(fileName), texture); //Is it valid? if (texture.bpp > 24) { @@ -808,7 +803,7 @@ void Terrain::drawpatchotherother(int whichx, int whichy, float opacity) float Terrain::getHeight(float pointx, float pointz) { static int tilex, tiley; - static XYZ startpoint, endpoint, intersect, triangle[3], average; + static XYZ startpoint, endpoint, intersect, triangle[3]; pointx /= scale; pointz /= scale;