]> 4ch.mooo.com Git - 16.git/commitdiff
16_ca needs huge amounts of work and I should remember what needs to be done soon...
authorsparky4 <sparky4@cock.li>
Sat, 13 May 2017 20:03:05 +0000 (15:03 -0500)
committersparky4 <sparky4@cock.li>
Sat, 13 May 2017 20:03:05 +0000 (15:03 -0500)
src/lib/16_tdef.h
src/lib/16_vrs.c

index b3fc892d87a81b609eb8e4d4d6e0d0d1c222cec7..a1a293925ace89e4aa60372dfbc3a557b6257e03 100755 (executable)
@@ -84,6 +84,8 @@ typedef struct vrs_container{
        };\r
        // Array of corresponding vrl line offsets\r
        vrl1_vgax_offset_t **vrl_line_offsets;\r
+       //sprite buffer\r
+       byte far _seg *spribuff;\r
 } vrs_container_t;\r
 \r
 typedef struct vrl_container{\r
@@ -96,6 +98,8 @@ typedef struct vrl_container{
        };\r
        // Pointer to a corresponding vrl line offsets struct\r
        vrl1_vgax_offset_t *line_offsets;\r
+       //sprite buffer\r
+       byte far _seg *spribuff;\r
 } vrl_container_t;\r
 \r
 typedef struct sprite\r
@@ -765,7 +769,6 @@ typedef struct      //TODO: USE THIS!!!!
 \r
        sd_t            sd;\r
        //TODO: extend! and learn from keen/wolf/catacomb's code wwww\r
-       memptr  spribuff;\r
 } ca_t;\r
 \r
 //==========================================================================\r
index 056366afd27a848d6f4a3bda074defbbc6a2f6ab..fa1d96de3c48dbfcd5fd9f336ba984c7a640f93e 100755 (executable)
@@ -39,15 +39,15 @@ void VRS_OpenVRS(char *filename, entity_t *enti, boolean rlsw, global_game_varia
        switch(rlsw)\r
        {\r
                case 1:\r
-                       CA_ReadFile(filename, &gvar->ca.spribuff, gvar);\r
+                       CA_ReadFile(filename, MEMPTRCONV enti->spri.spritesheet.spribuff, gvar);\r
                break;\r
                case 0:\r
-                       CA_LoadFile(filename, &gvar->ca.spribuff, gvar);\r
+                       CA_LoadFile(filename, MEMPTRCONV enti->spri.spritesheet.spribuff, gvar);\r
                break;\r
        }\r
 \r
        // Insert sanity cheks later\r
-       enti->spri.spritesheet.buffer = gvar->ca.spribuff;\r
+       enti->spri.spritesheet.buffer = enti->spri.spritesheet.spribuff;        //TODO: merge these 2 vars into 1\r
        enti->spri.spritesheet.data_size = sizeof(enti->spri.spritesheet.buffer) - sizeof(struct vrl1_vgax_header);\r
        num_of_vrl = 0;\r
        vrl_id_iter = (uint16_t far *)(enti->spri.spritesheet.buffer + enti->spri.spritesheet.vrs_hdr->offset_table[VRS_HEADER_OFFSET_SPRITE_ID_LIST]);\r
@@ -112,15 +112,15 @@ void VRS_OpenVRL(char *filename, entity_t *enti, boolean rlsw, global_game_varia
        switch(rlsw)\r
        {\r
                case 1:\r
-                       CA_ReadFile(filename, &gvar->ca.spribuff, gvar);\r
+                       CA_ReadFile(filename, &enti->spri.spritesheet.spribuff, gvar);\r
                break;\r
                case 0:\r
-                       CA_LoadFile(filename, &gvar->ca.spribuff, gvar);\r
+                       CA_LoadFile(filename, &enti->spri.spritesheet.spribuff, gvar);\r
                break;\r
        }\r
 \r
        // Insert sanity cheks later\r
-       enti->spri.sprite_vrl_cont.buffer = gvar->ca.spribuff;\r
+       enti->spri.sprite_vrl_cont.buffer = enti->spri.spritesheet.spribuff;\r
        enti->spri.sprite_vrl_cont.data_size = sizeof(enti->spri.spritesheet.buffer) - sizeof(struct vrl1_vgax_header);\r
 \r
        // Allocate memory for vrl line offsets table\r