]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_spri.c
__seguse.txt added to show _seg usage also OpenVGMFile needs to be ported to 16_snd...
[16.git] / src / lib / 16_spri.c
index f4c795371490c4eef4fdb2d2b5ecef499575f549..cde64ac644a96ca318e0d296f53ba0017375e31a 100755 (executable)
@@ -25,7 +25,7 @@
 char* get_curr_anim_name(struct sprite *spri)\r
 {\r
        // Retrive animation name list\r
-       struct vrs_header far *vrs = spri->spritesheet->vrs_hdr;\r
+       struct vrs_header far *vrs = spri->spritesheet.vrs_hdr;\r
        uint32_t far *anim_names_offsets =      (uint32_t far *)\r
                                                ((byte far *)vrs +\r
                                                 vrs->offset_table[VRS_HEADER_OFFSET_ANIMATION_NAME_LIST]);\r
@@ -35,7 +35,7 @@ char* get_curr_anim_name(struct sprite *spri)
 \r
 void init_anim(struct sprite *spri, int anim_index)\r
 {\r
-       struct vrs_header far *vrs = spri->spritesheet->vrs_hdr;\r
+       struct vrs_header far *vrs = spri->spritesheet.vrs_hdr;\r
        uint32_t far *anim_lists_offsets =      (uint32_t far *)\r
                                                ((byte far *)vrs +\r
                                                 vrs->offset_table[VRS_HEADER_OFFSET_ANIMATION_LIST]);\r
@@ -56,7 +56,7 @@ int set_anim_by_id(struct sprite *spri, int anim_id)
 {\r
        int new_anim_index = 0;\r
        int iter_id;\r
-       struct vrs_header far *vrs = spri->spritesheet->vrs_hdr;\r
+       struct vrs_header far *vrs = spri->spritesheet.vrs_hdr;\r
        // Retruve animation ids list\r
         uint16_t far *anim_ids =       (uint16_t far *)\r
                                        ((byte far *)vrs +\r
@@ -80,7 +80,7 @@ void print_anim_ids(struct sprite *spri)
 {\r
        int new_anim_index = 0;\r
        int iter_id;\r
-       struct vrs_header far *vrs = spri->spritesheet->vrs_hdr;\r
+       struct vrs_header far *vrs = spri->spritesheet.vrs_hdr;\r
        // Retruve animation ids list\r
         uint16_t far *anim_ids =       (uint16_t far *)\r
                                        ((byte far *)vrs +\r
@@ -148,7 +148,7 @@ void animate_spri(entity_t *enti, video_t *video)
 \r
 \r
        // Draw sprite\r
-       j = get_vrl_by_id(enti->spri.spritesheet, enti->spri.curr_spri_id, enti->spri.sprite_vrl_cont);\r
+       j = get_vrl_by_id(&enti->spri.spritesheet, enti->spri.curr_spri_id, &enti->spri.sprite_vrl_cont);\r
        if(j < 0)\r
        {\r
                //Quit (gv, "Error retriving required sprite");\r
@@ -162,8 +162,8 @@ void animate_spri(entity_t *enti, video_t *video)
                        else rx = -(video->page[0].dx);\r
                if (y >= enti->overdrawh) ry = (y - enti->overdrawh);\r
                        else ry = -(video->page[0].dy);\r
-               h = enti->spri.sprite_vrl_cont->vrl_header->height + enti->overdrawh + y - ry;\r
-               w = (x + enti->spri.sprite_vrl_cont->vrl_header->width + (enti->overdraww*2) + 3 - rx) & (~3) - enti->overdraww;//round up\r
+               h = enti->spri.sprite_vrl_cont.vrl_header->height + enti->overdrawh + y - ry;\r
+               w = (x + enti->spri.sprite_vrl_cont.vrl_header->width + (enti->overdraww*2) + 3 - rx) & (~3) - enti->overdraww;//round up\r
                if ((rx+w) > video->page[0].width) w = video->page[0].width-rx;\r
                if ((ry+h) > video->page[0].height) h = video->page[0].height-ry;\r
 \r
@@ -190,10 +190,10 @@ void animate_spri(entity_t *enti, video_t *video)
        draw_vrl1_vgax_modex(\r
                x-rx,\r
                y-ry,\r
-               enti->spri.sprite_vrl_cont->vrl_header,\r
-               enti->spri.sprite_vrl_cont->line_offsets,\r
-               enti->spri.sprite_vrl_cont->buffer + sizeof(struct vrl1_vgax_header),\r
-               enti->spri.sprite_vrl_cont->data_size\r
+               enti->spri.sprite_vrl_cont.vrl_header,\r
+               enti->spri.sprite_vrl_cont.line_offsets,\r
+               enti->spri.sprite_vrl_cont.buffer + sizeof(struct vrl1_vgax_header),\r
+               enti->spri.sprite_vrl_cont.data_size\r
        );\r
 #endif\r
        if(!video->rss)\r