Browse Source

textureloader - png fix, SIGQUIT removed

Henrique Santiago 10 years ago
parent
commit
3164d7e691
4 changed files with 13 additions and 15 deletions
  1. 11
    1
      src/framework/textureloader.cpp
  2. 1
    11
      src/framework/textureloader.h
  3. 1
    1
      src/framework/texturemanager.cpp
  4. 0
    2
      src/main.cpp

+ 11
- 1
src/framework/textureloader.cpp View File

@@ -27,6 +27,16 @@
27 27
 
28 28
 #include <png.h>
29 29
 
30
+struct File
31
+{
32
+    File() {
33
+        offset = 0;
34
+    }
35
+
36
+    unsigned char *data;
37
+    unsigned int offset;
38
+};
39
+
30 40
 void png_read_from_mem(png_structp png_ptr, png_bytep data, png_size_t size)
31 41
 {
32 42
   File *file = (File*)png_get_io_ptr(png_ptr);
@@ -38,7 +48,7 @@ void png_read_from_mem(png_structp png_ptr, png_bytep data, png_size_t size)
38 48
   file->offset += size;
39 49
 }
40 50
 
41
-Texture *TextureLoader::loadPNG(unsigned char *fileData, unsigned int fileSize)
51
+Texture *TextureLoader::loadPNG(unsigned char *fileData)
42 52
 {
43 53
     File file;
44 54
     file.data = fileData;

+ 1
- 11
src/framework/textureloader.h View File

@@ -29,20 +29,10 @@
29 29
 
30 30
 class Texture;
31 31
 
32
-struct File
33
-{
34
-    File() {
35
-        offset = 0;
36
-    }
37
-
38
-    unsigned char *data;
39
-    unsigned long offset;
40
-};
41
-
42 32
 namespace TextureLoader
43 33
 {
44 34
     /// Load a png textures using libpng
45
-    Texture *loadPNG(unsigned char *fileData, unsigned int fileSize);
35
+    Texture *loadPNG(unsigned char *fileData);
46 36
 }
47 37
 
48 38
 #endif // TEXTURELOADER_H

+ 1
- 1
src/framework/texturemanager.cpp View File

@@ -58,7 +58,7 @@ TexturePtr TextureManager::get(const std::string& textureFile)
58 58
         if(!textureFileData)
59 59
             return texture;
60 60
 
61
-        texture = TexturePtr(TextureLoader::loadPNG(textureFileData, fileSize));
61
+        texture = TexturePtr(TextureLoader::loadPNG(textureFileData));
62 62
         if(!texture)
63 63
             error("Unable to load texture %s, loading error.", textureFile.c_str());
64 64
         delete[] textureFileData;

+ 0
- 2
src/main.cpp View File

@@ -34,7 +34,6 @@ void signal_handler(int sig)
34 34
     switch(sig) {
35 35
         case SIGTERM:
36 36
         case SIGINT:
37
-        //case SIGQUIT:
38 37
         {
39 38
             static bool stopping = false;
40 39
             if(!stopping) {
@@ -58,7 +57,6 @@ int main(int argc, const char *argv[])
58 57
     // install our signal handler
59 58
     signal(SIGTERM, signal_handler);
60 59
     signal(SIGINT, signal_handler);
61
-    //signal(SIGQUIT, signal_handler);
62 60
 
63 61
     // setup resources
64 62
     g_resources.init(argv[0]);

Loading…
Cancel
Save