]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_sprit.c
wwww merged
[16.git] / src / lib / 16_sprit.c
index ab6e33785ba4f27bf55df60722dfff5b7c429e5a..c5158dc5d318e6836808b20e366351a2cf9e9cd2 100755 (executable)
@@ -1,24 +1,3 @@
-/* Project 16 Source Code~
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
- *
- * This file is part of Project 16.
- *
- * Project 16 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Project 16 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>, or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
 #include "src/lib/16_sprit.h"
 
 char* get_curr_anim_name(struct sprite *spri)
@@ -38,9 +17,9 @@ void init_anim(struct sprite *spri, int anim_index)
        uint32_t huge *anim_lists_offsets =     (uint32_t huge *)
                                                ((byte huge *)vrs +
                                                 vrs->offset_table[VRS_HEADER_OFFSET_ANIMATION_LIST]);
-       struct vrs_animation_list_entry_t *anim_list =  (struct vrs_animation_list_entry_t huge *)
-                                                       ((byte huge *)vrs +
-                                                        anim_lists_offsets[anim_index]);
+       struct vrs_animation_list_entry_t huge *anim_list =     (struct vrs_animation_list_entry_t huge *)
+                                                               ((byte huge *)vrs +
+                                                                anim_lists_offsets[anim_index]);
 
        // Upon new animation, start from the first sprite in it
        spri->curr_anim = anim_index;
@@ -93,17 +72,22 @@ void print_anim_ids(struct sprite *spri)
        {
                // Return on successful match
                new_anim_index++;
-               printf("%d, ", iter_id);
        }
 }
 
 
 void animate_spri(struct sprite *spri)
 {
+       int i;
        // Events go here
 
        // Draw sprite
-       get_vrl_by_id(spri->spritesheet, spri->curr_spri_id, spri->sprite_vrl_cont);
+       i = get_vrl_by_id(spri->spritesheet, spri->curr_spri_id, spri->sprite_vrl_cont);
+       if(i < 0)
+       {
+               printf("Error retriving required sprite");
+               exit(-1);
+       }
        draw_vrl1_vgax_modex(   spri->x, spri->y,
                                spri->sprite_vrl_cont->vrl_header, spri->sprite_vrl_cont->line_offsets,
                                spri->sprite_vrl_cont->buffer + sizeof(struct vrl1_vgax_header),