]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/bitmap.c
fack
[16.git] / src / lib / bitmap.c
index 19af31f5386846af026278b88df3d0ca94e697b6..d43411699873b2fca5119cc26a7752b2466813fa 100755 (executable)
 #include <stdlib.h>\r
 #include <malloc.h>\r
 #include "src/lib/bitmap.h"\r
-#include "src/lib/modex16.h"\r
-\r
-#ifndef PCXHEADER_H\r
-#define PCXHEADER_H\r
-static struct pcxHeader {\r
-       byte id;\r
-       byte version;\r
-       byte encoding;\r
-       byte bpp;\r
-       word xmin;\r
-       word ymin;\r
-       word xmax;\r
-       word ymax;\r
-       word hres;\r
-       word vres;\r
-       byte pal16[48];\r
-       byte res1;\r
-       word bpplane;\r
-       word palType;\r
-       word hScreenSize;\r
-       word vScreenSize;\r
-       byte padding[54];\r
-} head;\r
-#endif /*PCXHEADER_H*/\r
-\r
 \r
 static void loadPcxStage1(FILE *file, bitmap_t *result) {\r
        long bufSize;\r
@@ -151,6 +126,7 @@ bitmapLoadPcx(char *filename) {
                result.data[index] = val;\r
        }\r
        } while(index < bufSize);\r
+       printf("index=%d\n", index);\r
 \r
        loadPcxPalette(file, &result);\r
 \r
@@ -185,7 +161,7 @@ bitmapLoadPcxTiles(char *filename, word twidth, word theight) {
 \r
        /* allocate the pixel storage for the tiles */\r
        ts.data = malloc(sizeof(byte*) * ts.ntiles);\r
-       ts.data[0] = malloc(sizeof(byte) * ts.ntiles * twidth * theight);\r
+       //ts.data[0] = malloc(sizeof(byte) * ts.ntiles * twidth * theight);\r
        for(i=1; i < ts.ntiles; i++) {\r
                ts.data[i] = ts.data[i-1] + twidth * theight;\r
        }\r