*/\r
#include "src/lib/scroll16.h"\r
\r
-#define INC_PER_FRAME_PRINT sprintf(global_temp_status_text, "%u", player[pn].enti.persist_aniframe);\\r
-modexprint(&(pip->video->page[0]), player[pn].enti.x-(8*player[pn].enti.persist_aniframe), player[pn].enti.y-TILEWH-(8*player[pn].enti.persist_aniframe), 1, 20, 1, global_temp_status_text);\r
-\r
-//#define WALKTYPE_FRAM_PRINT INC_PER_FRAME_PRINT\r
-//walktypeinfo(player, pn);\r
-//modexprint(&(pip->video->page[0]), player[pn].enti.x-(8*player[pn].enti.persist_aniframe)+8, player[pn].enti.y-TILEWH-(8*player[pn].enti.persist_aniframe), 1, 20, 1, global_temp_status_text);\r
-\r
-#define PERSIST_ANIFRAME_INIT 1\r
-#define Q_INIT PERSIST_ANIFRAME_INIT\r
-#define INC_PER_FRAME if(player[pn].enti.q&1) player[pn].enti.persist_aniframe++; if(player[pn].enti.persist_aniframe>4) player[pn].enti.persist_aniframe = PERSIST_ANIFRAME_INIT;\r
+#define INC_PER_FRAME if(player[pn].enti.q&1) player[pn].enti.persist_aniframe++; if(player[pn].enti.persist_aniframe>4) player[pn].enti.persist_aniframe = 1;\r
\r
void ZC_walk(map_view_t *pip, player_t *player, word pn)\r
{\r
mapScrollRight(pip, player, (pip[0].video->p), pn);\r
player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
}\r
else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
{\r
player[pn].enti.x+=(player[pn].enti.speed);\r
ANIMATESPRIFUN(pip, player, pn, 1);\r
player[pn].enti.q++;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
}\r
else\r
{\r
mapScrollLeft(pip, player, (pip[0].video->p), pn);\r
player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
}\r
else if(player[pn].enti.tx > 1 && !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
{\r
player[pn].enti.x-=(player[pn].enti.speed);\r
ANIMATESPRIFUN(pip, player, pn, 1);\r
player[pn].enti.q++;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
}\r
else\r
{\r
mapScrollDown(pip, player, (pip[0].video->p), pn);\r
player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
}\r
else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))\r
{\r
player[pn].enti.y+=(player[pn].enti.speed);\r
ANIMATESPRIFUN(pip, player, pn, 1);\r
player[pn].enti.q++;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
}\r
else\r
{\r
mapScrollUp(pip, player, (pip[0].video->p), pn);\r
player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
}\r
else if(player[pn].enti.ty > 1 && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY))\r
{\r
player[pn].enti.y-=(player[pn].enti.speed);\r
ANIMATESPRIFUN(pip, player, pn, 1);\r
player[pn].enti.q++;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
}\r
else\r
{\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
}\r
else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
{\r
ANIMATESPRIFUN(pip, player, pn, 0);\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
player[pn].enti.q++;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
}\r
else\r
{\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
}\r
else if(player[pn].enti.tx > 1 && !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
{\r
ANIMATESPRIFUN(pip, player, pn, 0);\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
player[pn].enti.q++;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
}\r
else\r
{\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
}\r
else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))\r
{\r
ANIMATESPRIFUN(pip, player, pn, 0);\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
player[pn].enti.q++;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
}\r
else\r
{\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
}\r
else if(player[pn].enti.ty > 1 && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY))\r
{\r
ANIMATESPRIFUN(pip, player, pn, 0);\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
player[pn].enti.q++;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
}\r
else\r
{\r
pip[0].page->dx+=4;\r
SHOWMVFUN_;\r
player[pn].enti.q++;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; pip[0].tx++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].tx++; }\r
}\r
break;\r
\r
pip[0].page->dx-=4;\r
SHOWMVFUN_;\r
player[pn].enti.q++;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; pip[0].tx--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].tx--; }\r
}\r
break;\r
\r
pip[0].page->dy+=4;\r
SHOWMVFUN_;\r
player[pn].enti.q++;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; pip[0].ty++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].ty++; }\r
}\r
break;\r
\r
pip[0].page->dy-=4;\r
SHOWMVFUN_;\r
player[pn].enti.q++;\r
- } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; pip[0].ty--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].ty--; }\r
}\r
break;\r
}\r
#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+player[pn].enti.dire);\r
#endif\r
\r
-void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch)\r
+void /*near*/ animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch)\r
{\r
sword x = player[pn].enti.x;\r
sword y = player[pn].enti.y;\r
sword bx = x+16; //buffer's x\r
sword by = y+16; //buffer's y\r
sword qq; //scroll offset\r
- word ls = player[pn].enti.persist_aniframe;\r
+ word ls = 0;//player[pn].enti.persist_aniframe;\r
player[pn].enti.dire=32; //direction\r
\r
switch(scrollswitch)\r
ZC_drawframe(pip, &player[pn].enti, x, y);\r
//if(player[pn].enti.q<4) delay(500);\r
pip->video->r=1;\r
- //WALKTYPE_FRAM_PRINT;\r
}\r
\r
/*\r
}\r
}\r
\r
-void near mapScroll(map_view_t *mv, player_t *player)\r
+void /*near*/ mapScroll(map_view_t *mv, player_t *player)\r
{\r
//word x, y; /* coordinate for drawing */\r
int c = 1;\r
//printf("map.width=%d map.height=%d map.data[0]=%d\n", mv[0].map->width, mv[0].map->height, mv[0].map->data[0]);\r
//printf("&global_temp_status_text = %Fp\n", &global_temp_status_text);\r
//print_anim_ids(player[0].ent->spri);\r
+//printf(" aniframe=%u", player[0].enti.persist_aniframe);\r
#define SCROLLEXITMESG printf("tx: %d ", mv[0].tx);\\r
printf("ty: %d\n", mv[0].ty);\\r
printf("\n");\\r
printf(" tx: %d", player[0].enti.tx); printf(" ty: %d\n", player[0].enti.ty);\\r
printf(" triggx: %d", player[0].enti.triggerx); printf(" triggy: %d", player[0].enti.triggery); printf(" value: %d\n", mv[0].map->data[(player[0].enti.triggerx-1)+(map.width*(player[0].enti.triggery-1))]);\\r
printf(" hp: %d", (player[0].enti.hp)); printf(" q: %d", player[0].enti.q); printf(" player.info.dir: %d", player[0].info.dir); printf(" player.d: %d ", player[0].enti.d);\\r
- printf(" pdir=%d\n", player[0].pdir); printf(" aniframe=%u", player[0].enti.persist_aniframe); printf(" delay=%u", player[0].enti.spri->delay);\\r
+ printf(" pdir=%d\n", player[0].pdir); printf(" delay=%u", player[0].enti.spri->delay);\\r
printf("\n\n");\\r
printf("Virtual Screen: %dx", gvar.video.page[0].width); printf("%d ", gvar.video.page[0].height);\\r
printf("Screen: %dx", gvar.video.page[0].sw); printf("%d\n", gvar.video.page[0].sh);\\r
//void qclean();\r
void shinku(global_game_variables_t *gv);\r
void near ZC_drawframe(map_view_t *pip, entity_t *enti, sword x, sword y);\r
-void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch);\r
+void /*near*/ animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch);\r
void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch);\r
\r
// Move an entity around. Should actually be in 16_entity\r
void walk_player(player_t *player, map_view_t *map_v);\r
\r
// Scroll map in one direction (assumed from player's movement)\r
-void near mapScroll(map_view_t *mv, player_t *player);\r
+void /*near*/ mapScroll(map_view_t *mv, player_t *player);\r
\r
#endif /*__SCROLL16_H_*/\r
//older zc_animate\r