- }\r
-}\r
-\r
-void near ZC_drawframe(map_view_t *pip, entity_t *enti, sword x, sword y)\r
-{\r
- switch(pip[0].video->rss)\r
- {\r
- case 0:\r
- animate_spri(enti, pip->video);\r
- break;\r
- case 1:\r
- animate_spri(enti, pip->video);\r
- break;\r
-// case 2:\r
-// modexClearRegion(&(pip[0].page[0]), x, y, 16, 32, player[pn].enti.dire);\r
-// break;\r
- }\r
-}\r
-\r
-#ifdef SPRITE\r
-#define FRAME1 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 48, player[pn].enti.dire, 24, 32, PLAYERBMPDATAPTR);\r
-#define FRAME2 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, player[pn].enti.dire, 24, 32, PLAYERBMPDATAPTR);\r
-#define FRAME3 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 0, player[pn].enti.dire, 24, 32, PLAYERBMPDATAPTR);\r
-#define FRAME4 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, player[pn].enti.dire, 24, 32, PLAYERBMPDATAPTR);\r
-#else\r
-#define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 2+player[pn].enti.dire);\r
-#define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+player[pn].enti.dire);\r
-#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, player[pn].enti.dire);\r
-#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+player[pn].enti.dire);\r
-#endif\r
-\r
-void 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 = 0;//player[pn].enti.persist_aniframe;\r
- player[pn].enti.dire=32; //direction\r
-\r
- switch(scrollswitch)\r
- {\r
- case 0:\r
- qq = 0;\r
- break;\r
- default:\r
- qq = ((player[pn].enti.q)*(player[pn].enti.speed));\r
- break;\r
- }\r
- //x-=4;\r
- y-=pip[0].map->tiles->tileHeight;\r
- switch (player[pn].enti.d)\r
- {\r
- case 0:\r
- //up\r
- player[pn].enti.dire*=player[pn].enti.d;\r
- y-=qq;\r
- by-=4;\r
- break;\r
- case 3:\r
- // right\r
- player[pn].enti.dire*=(player[pn].enti.d-2);\r
- x+=qq;\r
- bx+=4;\r
- break;\r
- case 2:\r
- break;\r
- case 4:\r
- //down\r
- player[pn].enti.dire*=(player[pn].enti.d-2);\r
- y+=qq;\r
- by+=4;\r
- break;\r
- case 1:\r
- //left\r
- player[pn].enti.dire*=(player[pn].enti.d+2);\r
- x-=qq;\r
- bx-=4;\r
- break;\r
- }\r
-\r
- if(!pageflipflop)\r
- modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 36);\r
- else{\r
- //copy old bg to page0\r
- //modexCopyPageRegion(pip[3].page, pip[0].page, bx, by, 0, 0, 20, 36);\r
- //update buffer\r
- //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0, x, y, 20, 36);\r
- }\r
-//modexCopyPageRegion(page_t *dest, page_t *src, word sx, word sy, word dx, word dy, word width, word height);\r
- //modexCopyPageRegion(pip[3].page, pip[!(pip->video->p)].page, x-4, y-4, 0, 128, 28, 36);\r
- /*modexCopyPageRegion(pip[pip->video->p].page,\r
- pip[!(pip->video->p)].page, x-4, y-4, x-4, y-4, 28, 36);*/\r
-// else modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 40);\r
- switch(ls)\r
- {\r
- case 1:\r
- FRAME1\r
- break;\r
- case 2:\r
- FRAME2\r
- break;\r
- case 3:\r
- FRAME3\r
- break;\r
- case 4:\r
- FRAME4\r
- break;\r
- }\r
-// if(2>ls && ls>=1) { FRAME1 }else\r
-// if(3>ls && ls>=2) { FRAME2 }else\r
-// if(4>ls && ls>=3) { FRAME3 }else\r
-// if(5>ls && ls>=4) { FRAME4 }\r
- //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0, x, y, 24, 32);\r
- //printf("x=%d y=%d bx=%d by=%d\n", x, y, bx, by);\r
- pip->video->r=1;\r