X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FImageIO.cpp;h=affcb8c58c29d40cc1a9dc2a96cfedac9b7cb020;hb=94df0906c159318cb39bb4ee063336ba3cf51ccb;hp=c8dffe511d1537a9e21b771db0f2185dee8e56c3;hpb=97989f58ab13c64fbe05e629d2b2a024a2c3cfa4;p=lugaru.git diff --git a/Source/ImageIO.cpp b/Source/ImageIO.cpp index c8dffe5..affcb8c 100644 --- a/Source/ImageIO.cpp +++ b/Source/ImageIO.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. @@ -27,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 */ @@ -38,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)