]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameInitDispose.cpp
Got rid of global texture var. Calling load_image directly
[lugaru.git] / Source / GameInitDispose.cpp
index 0ce61eeb704cbb2a8a4faa017e86e406dc96d2b0..79a6a8de030f85980efbef4bff5d2f3aadcb8ab6 100644 (file)
@@ -52,7 +52,6 @@ extern float multiplier;
 extern int netdatanew;
 extern float mapinfo;
 extern bool stillloading;
-extern ImageRec texture;
 extern short vRefNum;
 extern long dirID;
 extern int mainmenu;
@@ -120,10 +119,6 @@ void Dispose()
     }
 
     OPENAL_Close();
-    if (texture.data) {
-        free(texture.data);
-    }
-    texture.data = 0;
 #endif
 }
 
@@ -170,7 +165,8 @@ void LoadSave(const char *fileName, GLuint *textureid, bool mipmap, GLubyte *arr
     texdetail = 1;
 
     //Load Image
-    upload_image(ConvertFileName(fileName));
+    ImageRec texture;
+    load_image(ConvertFileName(fileName), texture);
     texdetail = temptexdetail;
 
     int bytesPerPixel = texture.bpp / 8;
@@ -569,8 +565,6 @@ void Game::InitGame()
 
     stillloading = 1;
 
-    texture.data = ( GLubyte* )malloc( 1024 * 1024 * 4 );
-
     int temptexdetail = texdetail;
     texdetail = 1;
     text->LoadFontTexture(":Data:Textures:Font.png");