OSDN Git Service

p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I...
[proj16/16.git] / src / lib / 16_spri.h
1 /* Project 16 Source Code~\r
2  * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
3  *\r
4  * This file is part of Project 16.\r
5  *\r
6  * Project 16 is free software; you can redistribute it and/or modify\r
7  * it under the terms of the GNU General Public License as published by\r
8  * the Free Software Foundation; either version 3 of the License, or\r
9  * (at your option) any later version.\r
10  *\r
11  * Project 16 is distributed in the hope that it will be useful,\r
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14  * GNU General Public License for more details.\r
15  *\r
16  * You should have received a copy of the GNU General Public License\r
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
18  * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
19  * Fifth Floor, Boston, MA 02110-1301 USA.\r
20  *\r
21  */\r
22 #ifndef __16_SPRI__\r
23 #define __16_SPRI__\r
24 \r
25 #include "src/lib/16_vrs.h"\r
26 #ifndef OLDOLDOLDOLDSCROLLEXE\r
27 #include "src/lib/scroll16.h"\r
28 #endif\r
29 \r
30 //moved to 16_tdef.h\r
31 // struct sprite\r
32 // {\r
33 //      // VRS container from which we will extract animation and image data\r
34 //      struct vrs_container *spritesheet;\r
35 //      // Container for a vrl sprite\r
36 //      struct vrl_container *sprite_vrl_cont;\r
37 //      // Current sprite id\r
38 //      int curr_spri_id;\r
39 //      // Index of a current sprite in an animation sequence\r
40 //      int curr_anim_spri;\r
41 //      // Current animation sequence\r
42 //      struct vrs_animation_list_entry_t *curr_anim_list;\r
43 //      // Index of current animation in relevant VRS offsets table\r
44 //      int curr_anim;\r
45 //      // Delay in time units untill we should change sprite\r
46 //      int delay;\r
47 //      // Position of sprite on screen\r
48 //      int x, y;\r
49 // };\r
50 \r
51 /* Retrive current animation name of sprite\r
52 * In:\r
53 * + struct sprite *spri - sprite to retrive current animation sequence name from\r
54 * Out:\r
55 * + char* - animation sequence name\r
56 */\r
57 char* get_curr_anim_name(struct sprite *spri);\r
58 \r
59 /* Change sprite's current animation to the one given by id\r
60  * In:\r
61  * struct sprite *spri - sprite to manipulate on\r
62  * int id - id of a new animation sequence of th sprite\r
63  * Out:\r
64  * int - 0 on success, -1 on error\r
65  */\r
66 int set_anim_by_id(struct sprite *spri, int anim_id);\r
67 \r
68 /* Animate sprite, triggering any events and changing indices if necessary\r
69  * NB: if you want to change animation sequence after a specific sprite is shown, you should call animate_spri first\r
70  * In:\r
71  * + struct sprite *spri - sprite to animate\r
72  */\r
73 void animate_spri(entity_t *enti, video_t *video);\r
74 \r
75 void print_anim_ids(struct sprite *spri);\r
76 \r
77 #endif\r