X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fbitmap.c;h=864878d8b3776016d3d6d62ee9713534d16f85b7;hb=2f4fecee7f595ff717929984ec98b8e5c2efbf2f;hp=598aa6104c495d107da244d3f4d654859ee9114f;hpb=86121293a63d2017f58df55edbfef5c6197acc4a;p=16.git diff --git a/src/lib/bitmap.c b/src/lib/bitmap.c index 598aa610..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 %lu \n", result.width); - printf("Size of result.height is %lu \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;