]> git.jsancho.org Git - lugaru.git/blobdiff - Source/TGALoader.cpp
convert Game class to namespace
[lugaru.git] / Source / TGALoader.cpp
index 89d9b6b0a34d2a009928a8ca5ee57240a17cb11a..172ed5f1218f7c5b03efa9c06a3405cf37f7967d 100644 (file)
@@ -28,22 +28,18 @@ extern TGAImageRec texture;
 extern short vRefNum;
 extern long dirID;
 extern bool visibleloading;
-extern Game * pgame;
-extern int loadscreencolor;
 
 extern bool LoadImage(const char * fname, TGAImageRec & tex);
 /********************> LoadTGA() <*****/
 bool upload_image(const unsigned char* filePath, bool hasalpha)
 {
-       if(visibleloading) {
-               loadscreencolor=1;
-               pgame->LoadingScreen();
-       }
+       if(visibleloading) 
+               Game::LoadingScreen();
 
 #if !PLATFORM_MACOSX
 
        // for Windows, just use TGA loader for now
-       char fileName[ 256];
+       char fileName[256];
        CopyPascalStringToC( filePath, fileName);
 /*
        // change extension to .TGA
@@ -87,7 +83,7 @@ bool upload_image(const unsigned char* filePath, bool hasalpha)
        Rect natbounds;
        cr = GraphicsImportGetNaturalBounds(gi, &natbounds);
 
-       size_t buffersize = 4 * natbounds.bottom * natbounds.right;
+       //~ size_t buffersize = 4 * natbounds.bottom * natbounds.right;
        //void* buf = malloc(buffersize);
        texture.sizeX=natbounds.right;
        texture.sizeY=natbounds.bottom;
@@ -124,7 +120,7 @@ bool upload_image(const unsigned char* filePath, bool hasalpha)
        GLuint                  bytesPerPixel;                                                                          // Temporary Variable
        bytesPerPixel=texture.bpp/8;
        imageSize = texture.sizeX * texture.sizeY * bytesPerPixel;
-       int alltrans=10;
+       //~ int alltrans=10;
 
        for( GLuint i = 0; i < int( imageSize ); i += 4 )
        {
@@ -136,8 +132,8 @@ bool upload_image(const unsigned char* filePath, bool hasalpha)
                texture.data[i + 3] = temp;
        }
 
-       int tempplace;
-       tempplace=0;
+       //~ int tempplace;
+       //~ tempplace=0;
        if(!hasalpha){
                for( GLuint i = 0; i < int( imageSize ); i += 4 )
                {