*/\r
#include "src/lib/scroll16.h"\r
\r
-#define ANIMATESPRIFUN ZC_animatePlayer\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 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
+INC_PER_FRAME_PRINT\r
\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
if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
!(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)) //collision detection!\r
{\r
+ player[pn].walktype=2;\r
if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\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].walktype=1;\r
if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
}\r
else\r
{\r
+ player[pn].walktype=0;\r
//#ifdef SPRITE\r
//modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
ANIMATESPRIFUN(pip, player, pn, 0);\r
}\r
player[pn].enti.triggerx = player[pn].enti.tx+1;\r
player[pn].enti.triggery = player[pn].enti.ty;\r
+ WALKTYPE_FRAM_PRINT\r
break;\r
//left movement\r
case 1:\r
if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
!(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)) //collision detection!\r
{\r
+ player[pn].walktype=2;\r
if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\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].walktype=1;\r
if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
}\r
else\r
{\r
+ player[pn].walktype=0;\r
//#ifdef SPRITE\r
//modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
ANIMATESPRIFUN(pip, player, pn, 0);\r
}\r
player[pn].enti.triggerx = player[pn].enti.tx-1;\r
player[pn].enti.triggery = player[pn].enti.ty;\r
+ WALKTYPE_FRAM_PRINT\r
break;\r
//down movement\r
case 4:\r
if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
!(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)) //collision detection!\r
{\r
+ player[pn].walktype=2;\r
if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\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].walktype=1;\r
if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
}\r
else\r
{\r
+ player[pn].walktype=0;\r
//#ifdef SPRITE\r
//modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
ANIMATESPRIFUN(pip, player, pn, 0);\r
}\r
player[pn].enti.triggerx = player[pn].enti.tx;\r
player[pn].enti.triggery = player[pn].enti.ty+1;\r
+ WALKTYPE_FRAM_PRINT\r
break;\r
//up movement\r
case 0:\r
if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
!(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)) //collision detection!\r
{\r
+ player[pn].walktype=2;\r
if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\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].walktype=1;\r
if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
}\r
else\r
{\r
+ player[pn].walktype=0;\r
//#ifdef SPRITE\r
//modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
ANIMATESPRIFUN(pip, player, pn, 0);\r
}\r
player[pn].enti.triggerx = player[pn].enti.tx;\r
player[pn].enti.triggery = player[pn].enti.ty-1;\r
+ WALKTYPE_FRAM_PRINT\r
break;\r
}\r
+ if(player[pn].enti.d!=2 && pip[0].video->rs)\r
+ {\r
+ IN_UserInput(1,1);\r
+ delay(500);\r
+ }\r
}\r
\r
\r
}\r
}\r
\r
+void near ZC_drawframe(map_view_t *pip, player_t *player, word pn, sword x, sword y, word dire, word sw)\r
+{\r
+ pip->video->sprifilei=0;\r
+\r
+ switch(sw)\r
+ {\r
+ case 1:\r
+ dire+=2;\r
+ break;\r
+ case 2:\r
+ dire+=1;\r
+ break;\r
+// case 3:\r
+// dire=dire;\r
+// break;\r
+ case 4:\r
+ dire+=2;\r
+ break;\r
+ }\r
+\r
+ switch(pip[0].video->rs)\r
+ {\r
+ case 0:\r
+ pip->video->sprifilei = set_anim_by_id(player[pn].ent->spri, dire); if(pip->video->sprifilei == -1) return;\r
+ animate_spri(player[pn].ent->spri, pip->video);\r
+ break;\r
+ case 1:\r
+ pip->video->sprifilei = set_anim_by_id(player[pn].ent->spri, dire); if(pip->video->sprifilei == -1) return;\r
+ oldanimate_spri(player[pn].ent->spri, pip->video);\r
+ break;\r
+ case 2:\r
+ modexClearRegion(&(pip[0].page[0]), x, y, 16, 32, dire);\r
+ break;\r
+ }\r
+}\r
+\r
+/*void ZC_odrawframe()\r
+{\r
+\r
+}*/\r
+\r
#ifdef SPRITE\r
#define FRAME1 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 48, dire, 24, 32, PLAYERBMPDATAPTR);\r
#define FRAME2 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32, PLAYERBMPDATAPTR);\r
pip->video->r=1;\r
}\r
\r
-\r
void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch)\r
{\r
sword x = player[pn].enti.x;\r
word dire=10; //direction\r
sword qq; //scroll offset\r
word ls = player[pn].enti.persist_aniframe;\r
-#ifndef SPRITO\r
- int i=0;\r
-#endif\r
+\r
switch(scrollswitch)\r
{\r
case 0:\r
qq = ((player[pn].enti.q)*(player[pn].enti.speed));\r
break;\r
}\r
-#ifdef SPRITE\r
- x-=4;\r
-#endif\r
+ if(pip[0].video->rs<2)\r
+ x-=4;\r
y-=pip[0].map->tiles->tileHeight;\r
switch (player[pn].enti.d)\r
{\r
player[pn].ent->spri->x = x;\r
player[pn].ent->spri->y = y;\r
\r
-//#define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 2+dire);\r
-//#define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
-//#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, dire);\r
-//#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
-#ifndef SPRITO\r
-//#define DRAWFRAME if (i == -1) return; oldanimate_spri(player[pn].ent->spri, pip->video)\r
-#define DRAWFRAME if (i == -1) return; animate_spri(player[pn].ent->spri, pip->video)\r
-#define NFRAME1 i = set_anim_by_id(player[pn].ent->spri, 2+dire); DRAWFRAME;\r
-#define NFRAME2 i = set_anim_by_id(player[pn].ent->spri, 1+dire); DRAWFRAME;\r
-#define NFRAME3 i = set_anim_by_id(player[pn].ent->spri, dire); DRAWFRAME;\r
-#define NFRAME4 i = set_anim_by_id(player[pn].ent->spri, 2+dire); DRAWFRAME;\r
-#else\r
-#define NFRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 2+dire);\r
-#define NFRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+dire);\r
-#define NFRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, dire);\r
-#define NFRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+dire);\r
-#endif\r
-\r
switch(ls)\r
{\r
case 1:\r
- NFRAME1\r
+ ZC_drawframe(pip, player, pn, x, y, dire, ls);\r
break;\r
case 2:\r
- NFRAME2\r
+ ZC_drawframe(pip, player, pn, x, y, dire, ls);\r
break;\r
case 3:\r
- NFRAME3\r
+ ZC_drawframe(pip, player, pn, x, y, dire, ls);\r
break;\r
case 4:\r
- NFRAME4\r
+ ZC_drawframe(pip, player, pn, x, y, dire, ls);\r
break;\r
}\r
pip->video->r=1;\r