]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Terrain.cpp
Got rid of global texture var. Calling load_image directly
[lugaru.git] / Source / Terrain.cpp
index 8c0335c8a8872b8f2dd4250be708c56a8c9c0e9d..9061f37559694f06f3bcb8ab4f8834f9da0367b7 100644 (file)
@@ -35,7 +35,6 @@ extern bool decals;
 extern float blurness;
 extern float targetblurness;
 extern Objects objects;
-extern ImageRec texture;
 extern bool visibleloading;
 extern bool skyboxtexture;
 extern int tutoriallevel;
@@ -198,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;
@@ -406,8 +404,10 @@ bool Terrain::load(const char *fileName)
 
     float temptexdetail = texdetail;
 
+    ImageRec texture;
+
     //Load Image
-    upload_image(ConvertFileName(fileName));
+    load_image(ConvertFileName(fileName), texture);
 
     //Is it valid?
     if (texture.bpp > 24) {
@@ -803,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;