]> git.jsancho.org Git - lugaru.git/blobdiff - Source/ImageIO.cpp
Got rid of global texture var. Calling load_image directly
[lugaru.git] / Source / ImageIO.cpp
index eaeef5f2751764f2c62cab33b2ffe40979b1e6fb..affcb8c58c29d40cc1a9dc2a96cfedac9b7cb020 100644 (file)
@@ -28,7 +28,6 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 #include "Game.h"
 #include "ImageIO.h"
 
-extern ImageRec texture;
 extern bool visibleloading;
 
 /* These two are needed for screenshot */
@@ -39,9 +38,15 @@ static bool load_png(const char * fname, ImageRec & tex);
 static bool load_jpg(const char * fname, ImageRec & tex);
 static bool save_screenshot_png(const char * fname);
 
-bool upload_image(const char* fileName)
+ImageRec::ImageRec()
 {
-    return load_image(fileName, texture);
+    data = ( GLubyte* )malloc( 1024 * 1024 * 4 );
+}
+
+ImageRec::~ImageRec()
+{
+    free(data);
+    data = NULL;
 }
 
 bool load_image(const char *file_name, ImageRec &tex)