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;
34 // Index of a current sprite in an animation sequence
36 // Current animation sequence
37 struct vrs_animation_list_entry_t *curr_anim_list;
38 // Index of current animation in relevant VRS offsets table
40 // Delay in time units untill we should change sprite
42 // Position of sprite on screen
46 /* Retrive current animation name of sprite
48 * + struct sprite *spri - sprite to retrive current animation sequence name from
50 * + char* - animation sequence name
52 char* get_curr_anim_name(struct sprite *spri);
54 /* Change sprite's current animation to the one given by id
56 * struct sprite *spri - sprite to manipulate on
57 * int id - id of a new animation sequence of th sprite
59 * int - 0 on success, -1 on error
61 int set_anim_by_id(struct sprite *spri, int id);
63 /* Animate sprite, triggering any events and changing indices if necessary
64 * NB: if you want to change animation sequence after a specific sprite is shown, you should call animate_spri first
66 * + struct sprite *spri - sprite to animate
68 void animate_spri(struct sprite *spri);
70 void print_anim_ids(struct sprite *spri);