1 /* Project 16 Source Code~
2 * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
4 * This file is part of Project 16.
6 * Project 16 is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * Project 16 is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>, or
18 * write to the Free Software Foundation, Inc., 51 Franklin Street,
19 * Fifth Floor, Boston, MA 02110-1301 USA.
25 #include "src/lib/16_vrs.h"
26 #include "src/lib/typdefst.h"
30 // VRS container from which we will extract animation and image data
31 struct vrs_container *spritesheet;
32 // Container for a vrl sprite
33 struct vrl_container *sprite_vrl_cont;
36 // Index of a current sprite in an animation sequence
38 // Current animation sequence
39 struct vrs_animation_list_entry_t *curr_anim_list;
40 // Index of current animation in relevant VRS offsets table
42 // Delay in time units untill we should change sprite
44 // Position of sprite on screen
48 /* Retrive current animation name of sprite
50 * + struct sprite *spri - sprite to retrive current animation sequence name from
52 * + char* - animation sequence name
54 char* get_curr_anim_name(struct sprite *spri);
56 /* Change sprite's current animation to the one given by id
58 * struct sprite *spri - sprite to manipulate on
59 * int id - id of a new animation sequence of th sprite
61 * int - 0 on success, -1 on error
63 int set_anim_by_id(struct sprite *spri, int id);
65 /* Animate sprite, triggering any events and changing indices if necessary
66 * NB: if you want to change animation sequence after a specific sprite is shown, you should call animate_spri first
68 * + struct sprite *spri - sprite to animate
70 void animate_spri(struct sprite *spri);
72 void print_anim_ids(struct sprite *spri);