]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_sprit.h
16_pm worked on~
[16.git] / src / lib / 16_sprit.h
index a93838ace685a54dd0c4aab65acbb50b0a79424b..555e8d1c67c5689743bf1d5e9db4cae8996f17f2 100755 (executable)
@@ -1,74 +1,74 @@
-/* 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.
- *
- */
-#ifndef __16_SPRI__
-#define __16_SPRI__
-
-#include "src/lib/16_vrs.h"
-#include "src/lib/typdefst.h"
-
-struct sprite
-{
-       // VRS container from which we will extract animation and image data
-       struct vrs_container *spritesheet;
-       // Container for a vrl sprite
-       struct vrl_container *sprite_vrl_cont;
-       // Current sprite id
-       int curr_spri_id;
-       // Index of a current sprite in an animation sequence
-       int curr_anim_spri;
-       // Current animation sequence
-       struct vrs_animation_list_entry_t *curr_anim_list;
-       // Index of current animation in relevant VRS offsets table
-       int curr_anim;
-       // Delay in time units untill we should change sprite
-       int delay;
-       // Position of sprite on screen
-       int x, y;
-};
-
-/* Retrive current animation name of sprite
-* In:
-* + struct sprite *spri - sprite to retrive current animation sequence name from
-* Out:
-* + char* - animation sequence name
-*/
-char* get_curr_anim_name(struct sprite *spri);
-
-/* Change sprite's current animation to the one given by id
- * In:
- * struct sprite *spri - sprite to manipulate on
- * int id - id of a new animation sequence of th sprite
- * Out:
- * int - 0 on success, -1 on error
- */
-int set_anim_by_id(struct sprite *spri, int id);
-
-/* Animate sprite, triggering any events and changing indices if necessary
- * NB: if you want to change animation sequence after a specific sprite is shown, you should call animate_spri first
- * In:
- * + struct sprite *spri - sprite to animate
- */
-void animate_spri(struct sprite *spri);
-
-void print_anim_ids(struct sprite *spri);
-
-#endif
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+#ifndef __16_SPRI__\r
+#define __16_SPRI__\r
+\r
+#include "src/lib/16_vrs.h"\r
+#include "src/lib/typdefst.h"\r
+\r
+struct sprite\r
+{\r
+       // VRS container from which we will extract animation and image data\r
+       struct vrs_container *spritesheet;\r
+       // Container for a vrl sprite\r
+       struct vrl_container *sprite_vrl_cont;\r
+       // Current sprite id\r
+       int curr_spri_id;\r
+       // Index of a current sprite in an animation sequence\r
+       int curr_anim_spri;\r
+       // Current animation sequence\r
+       struct vrs_animation_list_entry_t *curr_anim_list;\r
+       // Index of current animation in relevant VRS offsets table\r
+       int curr_anim;\r
+       // Delay in time units untill we should change sprite\r
+       int delay;\r
+       // Position of sprite on screen\r
+       int x, y;\r
+};\r
+\r
+/* Retrive current animation name of sprite\r
+* In:\r
+* + struct sprite *spri - sprite to retrive current animation sequence name from\r
+* Out:\r
+* + char* - animation sequence name\r
+*/\r
+char* get_curr_anim_name(struct sprite *spri);\r
+\r
+/* Change sprite's current animation to the one given by id\r
+ * In:\r
+ * struct sprite *spri - sprite to manipulate on\r
+ * int id - id of a new animation sequence of th sprite\r
+ * Out:\r
+ * int - 0 on success, -1 on error\r
+ */\r
+int set_anim_by_id(struct sprite *spri, int id);\r
+\r
+/* Animate sprite, triggering any events and changing indices if necessary\r
+ * NB: if you want to change animation sequence after a specific sprite is shown, you should call animate_spri first\r
+ * In:\r
+ * + struct sprite *spri - sprite to animate\r
+ */\r
+void animate_spri(struct sprite *spri);\r
+\r
+void print_anim_ids(struct sprite *spri);\r
+\r
+#endif\r