X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fbitmap.c;h=864878d8b3776016d3d6d62ee9713534d16f85b7;hb=0797174ac571f1ff80ba3fa86ae362cd10864e14;hp=ea35c1723286f6db3e715e159bde3bcddf38af22;hpb=c49e0bb8159b3a5bf318ef305f302f1f1df9524c;p=16.git diff --git a/src/lib/bitmap.c b/src/lib/bitmap.c index ea35c172..864878d8 100644 --- a/src/lib/bitmap.c +++ b/src/lib/bitmap.c @@ -88,14 +88,19 @@ bitmapLoadPcx(char *filename) { /* load the first part of the pcx file */ loadPcxStage1(file, &result); - /* allocate the buffer */ - bufSize = (result.width * result.height); - result.data = malloc((bufSize)); - printf("Size of block is %u bytes\n", _msize(result.data)); - printf("Size of bufSize is %lu bytes\n", bufSize); - printf("Size of result.width is %d \n", result.width); - printf("Size of result.height is %d \n", result.height); - printf("Dimensions of result is %lu\n", result.width*result.height); + /* allocate the buffer */ + //printf("%zu\n", _memmax()); + bufSize = (/*(dword)*/result.width * result.height); + result.data = malloc(bufSize); +// result.data = (byte far *)_fmalloc(bufSize); +// result.data = (byte __huge *)halloc(bufSize, sizeof(byte)); + /*printf("&bufSize=%p\n", &bufSize); + printf("&result.data=%p\n", result.data); + printf("Size of block is %zu bytes\n", _msize(result.data)); + printf("Size of bufSize is %zu bytes\n", bufSize); + 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."); @@ -115,7 +120,7 @@ bitmapLoadPcx(char *filename) { val = count; count = 1; } - + /* write the pixel the specified number of times */ for(; count && index < bufSize; count--,index++) { result.data[index] = val;