X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fbitmap.c;h=1e4a8d5b54ea9b179b17566f3b92aec3db4e8e29;hb=24760854cf1668b8b0eba2bfaf63ab083da14ea8;hp=4f25bbd42d2454b1dd16033d6b486cee52fb3b9a;hpb=ef6299431f115ac663324d55ffb64570a2e66258;p=16.git diff --git a/src/lib/bitmap.c b/src/lib/bitmap.c index 4f25bbd4..1e4a8d5b 100755 --- a/src/lib/bitmap.c +++ b/src/lib/bitmap.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 + * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -25,6 +25,26 @@ #include #include "src/lib/bitmap.h" +static struct pcxHeader { + byte id; + byte version; + byte encoding; + byte bpp; + word xmin; + word ymin; + word xmax; + word ymax; + word hres; + word vres; + byte pal16[48]; + byte res1; + word bpplane; + word palType; + word hScreenSize; + word vScreenSize; + byte padding[54]; +} head; + static void loadPcxStage1(FILE *file, bitmap_t *result) { long bufSize; int index; @@ -126,7 +146,7 @@ bitmapLoadPcx(char *filename) { result.data[index] = val; } } while(index < bufSize); - printf("index=%d\n", index); + //printf("index=%d\n", index); loadPcxPalette(file, &result); @@ -161,7 +181,7 @@ bitmapLoadPcxTiles(char *filename, word twidth, word theight) { /* allocate the pixel storage for the tiles */ ts.data = malloc(sizeof(byte*) * ts.ntiles); - ts.data[0] = malloc(sizeof(byte) * ts.ntiles * twidth * theight); + //ts.data[0] = malloc(sizeof(byte) * ts.ntiles * twidth * theight); for(i=1; i < ts.ntiles; i++) { ts.data[i] = ts.data[i-1] + twidth * theight; }