+/* 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
+\r
#include "src/lib/16_sprit.h"\r
\r
char* get_curr_anim_name(struct sprite *spri)\r
{\r
// Retrive animation name list\r
- struct vrs_header huge *vrs = spri->spritesheet->vrs_hdr;\r
- uint32_t huge *anim_names_offsets = (uint32_t huge *)\r
- ((byte huge *)vrs +\r
+ struct vrs_header far *vrs = spri->spritesheet->vrs_hdr;\r
+ uint32_t far *anim_names_offsets = (uint32_t far *)\r
+ ((byte far *)vrs +\r
vrs->offset_table[VRS_HEADER_OFFSET_ANIMATION_NAME_LIST]);\r
\r
return (char *)(vrs + anim_names_offsets[spri->curr_anim]);\r
\r
void init_anim(struct sprite *spri, int anim_index)\r
{\r
- struct vrs_header huge *vrs = spri->spritesheet->vrs_hdr;\r
- uint32_t huge *anim_lists_offsets = (uint32_t huge *)\r
- ((byte huge *)vrs +\r
+ struct vrs_header far *vrs = spri->spritesheet->vrs_hdr;\r
+ uint32_t far *anim_lists_offsets = (uint32_t far *)\r
+ ((byte far *)vrs +\r
vrs->offset_table[VRS_HEADER_OFFSET_ANIMATION_LIST]);\r
- struct vrs_animation_list_entry_t huge *anim_list = (struct vrs_animation_list_entry_t huge *)\r
- ((byte huge *)vrs +\r
+ struct vrs_animation_list_entry_t far *anim_list = (struct vrs_animation_list_entry_t far *)\r
+ ((byte far *)vrs +\r
anim_lists_offsets[anim_index]);\r
\r
// Upon new animation, start from the first sprite in it\r
{\r
int new_anim_index = 0;\r
int iter_id;\r
- struct vrs_header huge *vrs = spri->spritesheet->vrs_hdr;\r
+ struct vrs_header far *vrs = spri->spritesheet->vrs_hdr;\r
// Retruve animation ids list\r
- uint16_t huge *anim_ids = (uint16_t huge *)\r
- ((byte huge *)vrs +\r
+ uint16_t far *anim_ids = (uint16_t far *)\r
+ ((byte far *)vrs +\r
vrs->offset_table[VRS_HEADER_OFFSET_ANIMATION_ID_LIST]);\r
\r
// Loop through animation id untill match or end of list\r
{\r
int new_anim_index = 0;\r
int iter_id;\r
- struct vrs_header huge *vrs = spri->spritesheet->vrs_hdr;\r
+ struct vrs_header far *vrs = spri->spritesheet->vrs_hdr;\r
// Retruve animation ids list\r
- uint16_t huge *anim_ids = (uint16_t huge *)\r
- ((byte huge *)vrs +\r
+ uint16_t far *anim_ids = (uint16_t far *)\r
+ ((byte far *)vrs +\r
vrs->offset_table[VRS_HEADER_OFFSET_ANIMATION_ID_LIST]);\r
\r
if(!anim_ids[new_anim_index])\r
}\r
\r
\r
-void animate_spri(struct sprite *spri)\r
+void animate_spri(struct sprite *spri, global_game_variables_t *gv)\r
{\r
int i;\r
// Events go here\r
i = get_vrl_by_id(spri->spritesheet, spri->curr_spri_id, spri->sprite_vrl_cont);\r
if(i < 0)\r
{\r
- printf("Error retriving required sprite");\r
- exit(-1);\r
+ Quit (gv, "Error retriving required sprite");\r
}\r
- draw_vrl1_vgax_modex( spri->x, spri->y,\r
+ draw_vrl1_vgax_modex( spri->x,// - spri->sprite_vrl_cont->vrl_header->width-28,\r
+ spri->y,// - spri->sprite_vrl_cont->vrl_header->height*2 -(gv->video.page[0].sh/2),\r
spri->sprite_vrl_cont->vrl_header, spri->sprite_vrl_cont->line_offsets,\r
spri->sprite_vrl_cont->buffer + sizeof(struct vrl1_vgax_header),\r
spri->sprite_vrl_cont->data_size);\r