]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/bitmap.c
scroll.exe works again but the fps thingy dose not work because of MM zcroll breaks...
[16.git] / src / lib / bitmap.c
index 4f25bbd42d2454b1dd16033d6b486cee52fb3b9a..7f9df1f0f836a65cd6454b05a4407e677ea9d755 100755 (executable)
@@ -1,5 +1,5 @@
 /* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
  *\r
  * This file is part of Project 16.\r
  *\r
 #include <malloc.h>\r
 #include "src/lib/bitmap.h"\r
 \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
+\r
 static void loadPcxStage1(FILE *file, bitmap_t *result) {\r
-       long bufSize;\r
-       int index;\r
-       byte count, val;\r
-       long int pos;\r
+       //long bufSize;\r
+       //int index;\r
+       //byte count, val;\r
+       //long int pos;\r
 \r
        /* read the header */\r
        fread(&head, sizeof(char), sizeof(struct pcxHeader), file);\r
@@ -126,7 +146,7 @@ bitmapLoadPcx(char *filename) {
                result.data[index] = val;\r
        }\r
        } while(index < bufSize);\r
-       printf("index=%d\n", index);\r
+       //printf("index=%d\n", index);\r
 \r
        loadPcxPalette(file, &result);\r
 \r
@@ -161,7 +181,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