X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FImageIO.cpp;h=affcb8c58c29d40cc1a9dc2a96cfedac9b7cb020;hb=a7c9ba64aa7413abb4c566dad8dc796526952d3e;hp=eaeef5f2751764f2c62cab33b2ffe40979b1e6fb;hpb=cedb9cffef6e30a2c04239c60027029da48b3897;p=lugaru.git diff --git a/Source/ImageIO.cpp b/Source/ImageIO.cpp index eaeef5f..affcb8c 100644 --- a/Source/ImageIO.cpp +++ b/Source/ImageIO.cpp @@ -28,7 +28,6 @@ along with Lugaru. If not, see . #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)