]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/bitmap.c
trying to figure out the issue with player sprite with pcx i have no idea wwww
[16.git] / src / lib / bitmap.c
index b030b379ef3c1bf504935aade28f4f4649b2317f..6d7f72ed11ce81105f102799a6c2312528d8a556 100755 (executable)
@@ -24,6 +24,9 @@
 #include <stdlib.h>\r
 #include <malloc.h>\r
 #include "src/lib/bitmap.h"\r
+#include "src/lib/16_mm.h"\r
+#include "src/lib/16_pm.h"\r
+#include "src/lib/16_ca.h"\r
 \r
 static struct pcxHeader {\r
        byte id;\r
@@ -91,7 +94,7 @@ static void loadPcxPalette(FILE *file, bitmap_t *result) {
 \r
 \r
 bitmap_t\r
-bitmapLoadPcx(char *filename) {\r
+bitmapLoadPcx(char *filename, global_game_variables_t *gv) {\r
        FILE *file;\r
        bitmap_t result;\r
        dword bufSize;\r
@@ -111,7 +114,9 @@ bitmapLoadPcx(char *filename) {
        /* allocate the buffer */\r
        //printf("%zu\n", _memmax());\r
        bufSize = (/*(dword)*/result.width * result.height);\r
-       result.data = _fmalloc(bufSize);\r
+       //CA_LoadFile(filename, (memptr *)(result.data), gv);\r
+       result.data = malloc(bufSize);\r
+\r
 //     result.data = (byte far *)_fmalloc(bufSize);\r
 //     result.data = (byte __huge *)halloc(bufSize, sizeof(byte));\r
        /*printf("&bufSize=%p\n", &bufSize);\r
@@ -121,7 +126,6 @@ bitmapLoadPcx(char *filename) {
        printf("Size of result.width is %zu \n", result.width);\r
        printf("Size of result.height is %zu \n", result.height);\r
        printf("Dimensions of result is %lu\n", (dword)result.width*result.height);*/\r
-       //exit(0);\r
        if(!result.data) {\r
                fprintf(stderr, "Could not allocate memory for bitmap data.");\r
                fclose(file);\r