X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fbitmap.c;h=6d7f72ed11ce81105f102799a6c2312528d8a556;hb=1159fe5a6cd0f8eaeee6e8584f5972d42e004073;hp=7696cc3475ed303e89dd5014f84ab1c4a7e4e626;hpb=2accbf2668001e82a8fec1e75f37c195996186b0;p=16.git diff --git a/src/lib/bitmap.c b/src/lib/bitmap.c index 7696cc34..6d7f72ed 100755 --- a/src/lib/bitmap.c +++ b/src/lib/bitmap.c @@ -24,12 +24,35 @@ #include #include #include "src/lib/bitmap.h" +#include "src/lib/16_mm.h" +#include "src/lib/16_pm.h" +#include "src/lib/16_ca.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; - byte count, val; - long int pos; + //long bufSize; + //int index; + //byte count, val; + //long int pos; /* read the header */ fread(&head, sizeof(char), sizeof(struct pcxHeader), file); @@ -71,7 +94,7 @@ static void loadPcxPalette(FILE *file, bitmap_t *result) { bitmap_t -bitmapLoadPcx(char *filename) { +bitmapLoadPcx(char *filename, global_game_variables_t *gv) { FILE *file; bitmap_t result; dword bufSize; @@ -91,7 +114,9 @@ bitmapLoadPcx(char *filename) { /* allocate the buffer */ //printf("%zu\n", _memmax()); bufSize = (/*(dword)*/result.width * result.height); + //CA_LoadFile(filename, (memptr *)(result.data), gv); result.data = malloc(bufSize); + // result.data = (byte far *)_fmalloc(bufSize); // result.data = (byte __huge *)halloc(bufSize, sizeof(byte)); /*printf("&bufSize=%p\n", &bufSize); @@ -101,7 +126,6 @@ bitmapLoadPcx(char *filename) { printf("Size of result.width is %zu \n", result.width); printf("Size of result.height is %zu \n", result.height); printf("Dimensions of result is %lu\n", (dword)result.width*result.height);*/ - //exit(0); if(!result.data) { fprintf(stderr, "Could not allocate memory for bitmap data."); fclose(file);