/* Project 16 Source Code~\r
- * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ * Copyright (C) 2012-2022 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
*\r
* This file is part of Project 16.\r
*\r
return false;\r
}\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
+//#define INC_PER_FRAME if(gvar->player[pn].enti.q&1) gvar->player[pn].enti.persist_aniframe++; if(gvar->player[pn].enti.persist_aniframe>4) gvar->player[pn].enti.persist_aniframe = 1;\r
#ifdef OLDWALKSHOWPAGESTUFF\r
-#define SHOWMVFUN__ ZC_ShowMV(pip, 1, 0);\r
+#define SHOWMVFUN__ VL_ShowPage(&gvar->video.page[0], 1, 0);//modexShowPage(&gvar->video.page);\r
+//ZC_ShowMV(gvar->mv, 1, 0);\r
#endif\r
\r
-void ZC_walk(map_view_t *pip, player_t *player, word pn)\r
+void ZC_walk(global_game_variables_t *gvar, word pn)\r
{\r
- switch(player[pn].enti.d)\r
+ switch(gvar->player[pn].enti.d)\r
{\r
//no direction\r
case 2:\r
- //0000pip[0].video->startclk = (*clockw);\r
+ //0000gvar->mv[0].video->startclk = (*clockw);\r
break;\r
//right movement\r
case 3:\r
- if(ZCL_ScreenMidPosChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty) &&\r
- ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY)) //collision detection!\r
+ if(ZCL_ScreenMidPosChk(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty) &&\r
+ ZCL_CollCheck(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty))//!(gvar->player[pn].enti.tx+1 == TRIGGX && gvar->player[pn].enti.ty == TRIGGY)) //collision detection!\r
{\r
- player[pn].walktype=2;\r
- if(player[pn].enti.q<=player[pn].enti.spt)\r
+ gvar->player[pn].walktype=2;\r
+ if(gvar->player[pn].enti.q<=gvar->player[pn].enti.spt)\r
{\r
- ZC_animatePlayer(pip, player, pn);\r
- ZC_mapScroll(pip, player, pn);\r
- player[pn].enti.q++;\r
- //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
+ ZC_animatePlayer(gvar->mv, gvar->player, pn);\r
+ ZC_mapScroll(gvar->mv, gvar->player, pn);\r
+ gvar->player[pn].enti.q++;\r
+ //0000gvar->mv[0].video->clk = ((*clockw)-gvar->mv[0].video->startclk)/18.2;\r
#ifdef OLDWALKSHOWPAGESTUFF\r
SHOWMVFUN__\r
#endif\r
- } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
+ } else { gvar->player[pn].enti.q = 1; gvar->player[pn].enti.d = 2; gvar->player[pn].enti.tx++; }\r
}\r
- else if(ZCL_mapEdgeChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty, 0, 1) &&\r
- ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
+ else if(ZCL_mapEdgeChk(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty, 0, 1) &&\r
+ ZCL_CollCheck(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty))//!(gvar->player[pn].enti.tx+1 == TRIGGX && gvar->player[pn].enti.ty == TRIGGY))\r
{\r
- player[pn].walktype=1;\r
- if(player[pn].enti.q<=player[pn].enti.spt)\r
+ gvar->player[pn].walktype=1;\r
+ if(gvar->player[pn].enti.q<=gvar->player[pn].enti.spt)\r
{\r
- player[pn].enti.x+=(player[pn].enti.speed);\r
- ZC_animatePlayer(pip, player, pn);\r
- player[pn].enti.q++;\r
+ gvar->player[pn].enti.x+=(gvar->player[pn].enti.spt);\r
+ ZC_animatePlayer(gvar->mv, gvar->player, pn);\r
+ gvar->player[pn].enti.q++;\r
#ifdef OLDWALKSHOWPAGESTUFF\r
SHOWMVFUN__\r
#endif\r
- } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
+ } else { gvar->player[pn].enti.q = 1; gvar->player[pn].enti.d = 2; gvar->player[pn].enti.tx++; }\r
}\r
else\r
{\r
- player[pn].walktype=0;\r
- ZC_animatePlayer(pip, player, pn);\r
- player[pn].enti.d = 2;\r
+ gvar->player[pn].walktype=0;\r
+ ZC_animatePlayer(gvar->mv, gvar->player, pn);\r
+ gvar->player[pn].enti.d = 2;\r
#ifdef OLDWALKSHOWPAGESTUFF\r
SHOWMVFUN__\r
#endif\r
}\r
- player[pn].enti.triggerx = player[pn].enti.tx+1;\r
- player[pn].enti.triggery = player[pn].enti.ty;\r
+ gvar->player[pn].enti.triggerx = gvar->player[pn].enti.tx+1;\r
+ gvar->player[pn].enti.triggery = gvar->player[pn].enti.ty;\r
break;\r
//left movement\r
case 1:\r
- if(ZCL_ScreenMidPosChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty) &&\r
- ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY)) //collision detection!\r
+ if(ZCL_ScreenMidPosChk(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty) &&\r
+ ZCL_CollCheck(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty))//!(gvar->player[pn].enti.tx-1 == TRIGGX && gvar->player[pn].enti.ty == TRIGGY)) //collision detection!\r
{\r
- player[pn].walktype=2;\r
- if(player[pn].enti.q<=player[pn].enti.spt)\r
+ gvar->player[pn].walktype=2;\r
+ if(gvar->player[pn].enti.q<=gvar->player[pn].enti.spt)\r
{\r
- ZC_animatePlayer(pip, player, pn);\r
- ZC_mapScroll(pip, player, pn);\r
- player[pn].enti.q++;\r
- //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
+ ZC_animatePlayer(gvar->mv, gvar->player, pn);\r
+ ZC_mapScroll(gvar->mv, gvar->player, pn);\r
+ gvar->player[pn].enti.q++;\r
+ //0000gvar->mv[0].video->clk = ((*clockw)-gvar->mv[0].video->startclk)/18.2;\r
#ifdef OLDWALKSHOWPAGESTUFF\r
SHOWMVFUN__\r
#endif\r
- } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
+ } else { gvar->player[pn].enti.q = 1; gvar->player[pn].enti.d = 2; gvar->player[pn].enti.tx--; }\r
}\r
- else if(ZCL_mapEdgeChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty, 0, 1) &&\r
- ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
+ else if(ZCL_mapEdgeChk(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty, 0, 1) &&\r
+ ZCL_CollCheck(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty))//!(gvar->player[pn].enti.tx-1 == TRIGGX && gvar->player[pn].enti.ty == TRIGGY))\r
{\r
- player[pn].walktype=1;\r
- if(player[pn].enti.q<=player[pn].enti.spt)\r
+ gvar->player[pn].walktype=1;\r
+ if(gvar->player[pn].enti.q<=gvar->player[pn].enti.spt)\r
{\r
- player[pn].enti.x-=(player[pn].enti.speed);\r
- ZC_animatePlayer(pip, player, pn);\r
- player[pn].enti.q++;\r
+ gvar->player[pn].enti.x-=(gvar->player[pn].enti.spt);\r
+ ZC_animatePlayer(gvar->mv, gvar->player, pn);\r
+ gvar->player[pn].enti.q++;\r
#ifdef OLDWALKSHOWPAGESTUFF\r
SHOWMVFUN__\r
#endif\r
- } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
+ } else { gvar->player[pn].enti.q = 1; gvar->player[pn].enti.d = 2; gvar->player[pn].enti.tx--; }\r
}\r
else\r
{\r
- player[pn].walktype=0;\r
- ZC_animatePlayer(pip, player, pn);\r
- player[pn].enti.d = 2;\r
+ gvar->player[pn].walktype=0;\r
+ ZC_animatePlayer(gvar->mv, gvar->player, pn);\r
+ gvar->player[pn].enti.d = 2;\r
#ifdef OLDWALKSHOWPAGESTUFF\r
SHOWMVFUN__\r
#endif\r
}\r
- player[pn].enti.triggerx = player[pn].enti.tx-1;\r
- player[pn].enti.triggery = player[pn].enti.ty;\r
+ gvar->player[pn].enti.triggerx = gvar->player[pn].enti.tx-1;\r
+ gvar->player[pn].enti.triggery = gvar->player[pn].enti.ty;\r
break;\r
//down movement\r
case 4:\r
- if(ZCL_ScreenMidPosChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty) &&\r
- ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY)) //collision detection!\r
+ if(ZCL_ScreenMidPosChk(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty) &&\r
+ ZCL_CollCheck(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty))//!(gvar->player[pn].enti.tx == TRIGGX && gvar->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
+ gvar->player[pn].walktype=2;\r
+ if(gvar->player[pn].enti.q<=gvar->player[pn].enti.spt)\r
{\r
- ZC_animatePlayer(pip, player, pn);\r
- ZC_mapScroll(pip, player, pn);\r
- player[pn].enti.q++;\r
- //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
+ ZC_animatePlayer(gvar->mv, gvar->player, pn);\r
+ ZC_mapScroll(gvar->mv, gvar->player, pn);\r
+ gvar->player[pn].enti.q++;\r
+ //0000gvar->mv[0].video->clk = ((*clockw)-gvar->mv[0].video->startclk)/18.2;\r
#ifdef OLDWALKSHOWPAGESTUFF\r
SHOWMVFUN__\r
#endif\r
- } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
+ } else { gvar->player[pn].enti.q = 1; gvar->player[pn].enti.d = 2; gvar->player[pn].enti.ty++; }\r
}\r
- else if(ZCL_mapEdgeChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty, 0, 1) &&\r
- ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))\r
+ else if(ZCL_mapEdgeChk(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty, 0, 1) &&\r
+ ZCL_CollCheck(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty))//!(gvar->player[pn].enti.tx == TRIGGX && gvar->player[pn].enti.ty+1 == TRIGGY))\r
{\r
- player[pn].walktype=1;\r
- if(player[pn].enti.q<=player[pn].enti.spt)\r
+ gvar->player[pn].walktype=1;\r
+ if(gvar->player[pn].enti.q<=gvar->player[pn].enti.spt)\r
{\r
- player[pn].enti.y+=(player[pn].enti.speed);\r
- ZC_animatePlayer(pip, player, pn);\r
- player[pn].enti.q++;\r
+ gvar->player[pn].enti.y+=(gvar->player[pn].enti.spt);\r
+ ZC_animatePlayer(gvar->mv, gvar->player, pn);\r
+ gvar->player[pn].enti.q++;\r
#ifdef OLDWALKSHOWPAGESTUFF\r
SHOWMVFUN__\r
#endif\r
- } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
+ } else { gvar->player[pn].enti.q = 1; gvar->player[pn].enti.d = 2; gvar->player[pn].enti.ty++; }\r
}\r
else\r
{\r
- player[pn].walktype=0;\r
- ZC_animatePlayer(pip, player, pn);\r
- player[pn].enti.d = 2;\r
+ gvar->player[pn].walktype=0;\r
+ ZC_animatePlayer(gvar->mv, gvar->player, pn);\r
+ gvar->player[pn].enti.d = 2;\r
#ifdef OLDWALKSHOWPAGESTUFF\r
SHOWMVFUN__\r
#endif\r
}\r
- player[pn].enti.triggerx = player[pn].enti.tx;\r
- player[pn].enti.triggery = player[pn].enti.ty+1;\r
+ gvar->player[pn].enti.triggerx = gvar->player[pn].enti.tx;\r
+ gvar->player[pn].enti.triggery = gvar->player[pn].enti.ty+1;\r
break;\r
//up movement\r
case 0:\r
- if(ZCL_ScreenMidPosChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty) &&\r
- ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY)) //collision detection!\r
+ if(ZCL_ScreenMidPosChk(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty) &&\r
+ ZCL_CollCheck(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty))//!(gvar->player[pn].enti.tx == TRIGGX && gvar->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
+ gvar->player[pn].walktype=2;\r
+ if(gvar->player[pn].enti.q<=gvar->player[pn].enti.spt)\r
{\r
- ZC_animatePlayer(pip, player, pn);\r
- ZC_mapScroll(pip, player, pn);\r
- player[pn].enti.q++;\r
- //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
+ ZC_animatePlayer(gvar->mv, gvar->player, pn);\r
+ ZC_mapScroll(gvar->mv, gvar->player, pn);\r
+ gvar->player[pn].enti.q++;\r
+ //0000gvar->mv[0].video->clk = ((*clockw)-gvar->mv[0].video->startclk)/18.2;\r
#ifdef OLDWALKSHOWPAGESTUFF\r
SHOWMVFUN__\r
#endif\r
- } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
+ } else { gvar->player[pn].enti.q = 1; gvar->player[pn].enti.d = 2; gvar->player[pn].enti.ty--; }\r
}\r
- else if(ZCL_mapEdgeChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty, 0, 1) &&\r
- ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY))\r
+ else if(ZCL_mapEdgeChk(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty, 0, 1) &&\r
+ ZCL_CollCheck(gvar->mv, gvar->player[pn].enti.d, gvar->player[pn].enti.tx, gvar->player[pn].enti.ty))//!(gvar->player[pn].enti.tx == TRIGGX && gvar->player[pn].enti.ty-1 == TRIGGY))\r
{\r
- player[pn].walktype=1;\r
- if(player[pn].enti.q<=player[pn].enti.spt)\r
+ gvar->player[pn].walktype=1;\r
+ if(gvar->player[pn].enti.q<=gvar->player[pn].enti.spt)\r
{\r
- player[pn].enti.y-=(player[pn].enti.speed);\r
- ZC_animatePlayer(pip, player, pn);\r
- player[pn].enti.q++;\r
+ gvar->player[pn].enti.y-=(gvar->player[pn].enti.spt);\r
+ ZC_animatePlayer(gvar->mv, gvar->player, pn);\r
+ gvar->player[pn].enti.q++;\r
#ifdef OLDWALKSHOWPAGESTUFF\r
SHOWMVFUN__\r
#endif\r
- } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
+ } else { gvar->player[pn].enti.q = 1; gvar->player[pn].enti.d = 2; gvar->player[pn].enti.ty--; }\r
}\r
else\r
{\r
- player[pn].walktype=0;\r
- ZC_animatePlayer(pip, player, pn);\r
- player[pn].enti.d = 2;\r
+ gvar->player[pn].walktype=0;\r
+ ZC_animatePlayer(gvar->mv, gvar->player, pn);\r
+ gvar->player[pn].enti.d = 2;\r
#ifdef OLDWALKSHOWPAGESTUFF\r
SHOWMVFUN__\r
#endif\r
}\r
- player[pn].enti.triggerx = player[pn].enti.tx;\r
- player[pn].enti.triggery = player[pn].enti.ty-1;\r
+ gvar->player[pn].enti.triggerx = gvar->player[pn].enti.tx;\r
+ gvar->player[pn].enti.triggery = gvar->player[pn].enti.ty-1;\r
break;\r
}\r
}\r
//panning page\r
void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)\r
{\r
-#define SHOWMVFUN_ ZC_ShowMV(pip, 0, 0);\r
+#define SHOWMVFUN_ VL_ShowPage(pip[0].page, 0, 0);//ZC_ShowMV(pip, 0, 0);\r
switch(player[pn].enti.d)\r
{\r
//right movement\r
//pip[0].ty = pip[1].ty = ty;\r
}\r
\r
+//#if 0\r
+//for backwards compatibility with code i am lazy ww\r
void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr)\r
{\r
VL_ShowPage(moo[0].page, vsync, sr);\r
if(player[plid].enti.q==4)\r
#endif\r
// if(id==0)\r
- mapDrawCol(&mv[id], mv[0].tx + mv[0].page->ti.tw, mv[0].ty-1, x, player, DRAWCOLNUM);\r
+ mapDrawCol(&mv[id], mv[0].tx + mv[0].page->ti.tw, mv[0].ty-1, x, player);\r
// else\r
// if(mv[0].video->vga_state.bgps)\r
// modexCopyPageRegion(mv->page, mv[0].page, x, 0, x, 0, mv[0].map->tiles->tileWidth, mv[0].page->height);\r
if(player[plid].enti.q==4)\r
#endif\r
// if(id==0)\r
- mapDrawCol(&mv[id], mv[0].tx - 1, mv[0].ty-1, x, player, DRAWCOLNUM);\r
+ mapDrawCol(&mv[id], mv[0].tx - 1, mv[0].ty-1, x, player);\r
// else\r
// if(mv[0].video->vga_state.bgps)\r
// modexCopyPageRegion(mv->page, mv[0].page, x, 0, x, 0, mv[0].map->tiles->tileWidth, mv[0].page->height);\r
if(player[plid].enti.q==4)\r
#endif\r
// if(id==0)\r
- mapDrawRow(&mv[id], mv[0].tx - 1, mv[0].ty-1, y, player, DRAWROWNUM);\r
+ mapDrawRow(&mv[id], mv[0].tx - 1, mv[0].ty-1, y, player);\r
// else\r
// if(mv[0].video->vga_state.bgps)\r
// modexCopyPageRegion(mv->page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->tiles->tileHeight);\r
if(player[plid].enti.q==4)\r
#endif\r
// if(id==0)\r
- mapDrawRow(&mv[id], mv[0].tx - 1, mv[0].ty+mv[0].page->ti.th, y, player, DRAWROWNUM);\r
+ mapDrawRow(&mv[id], mv[0].tx - 1, mv[0].ty+mv[0].page->ti.th, y, player);\r
// else\r
// if(mv[0].video->vga_state.bgps)\r
// modexCopyPageRegion(mv->page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->tiles->tileHeight);\r
//===========================================================================\r
//TODO: put player in starting position of assigned spot on map\r
//default player position on the viewable map\r
-void ZC_PlayerXYpos(int x, int y, player_t *player, map_view_t *pip, nibble pn, boolean defaultsw)\r
+void ZC_PlayerXYpos(int x, int y, player_t *player, map_view_t *pip, boolean defaultsw)\r
{\r
- player[pn].enti.tx = x + pip[0].tx;\r
- player[pn].enti.ty = y + pip[0].ty;\r
+ player->enti.tx = x + pip[0].tx;\r
+ player->enti.ty = y + pip[0].ty;\r
\r
switch(defaultsw)\r
{\r
case 1:\r
- player[pn].enti.tx += pip[0].page->ti.tilemidposscreenx;\r
- player[pn].enti.ty += pip[0].page->ti.tilemidposscreeny;\r
+ player->enti.tx += pip[0].page->ti.tilemidposscreenx;\r
+ player->enti.ty += pip[0].page->ti.tilemidposscreeny;\r
break;\r
case 0:\r
break;\r
//1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 2, 3, 4 };\r
//check for failed to load map\r
- if((map->width == map->height == 0) && (q>0))\r
+ if((!map->width || !map->height) && (q>0))\r
{\r
//initiate a null map!\r
map->width=MAPW;\r
}\r
}\r
#define PALMAPDRAWW 13\r
-void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *player, word poopoffset)\r
+void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *player)\r
{\r
- int i; nibble z;\r
-#ifdef __DEBUG_RF__\r
-if(dbg_pagedelayrendermap) if(!y) y+=TILEWH; else y-=TILEWH;\r
+ int i;\r
+#if defined(FULLRCREND) || defined(__DEBUG_RF__)\r
+ word drawtileoffset=0;\r
+//printf("y: %d ", drawtileoffset);\r
+ drawtileoffset%=player[0].enti.spt;\r
+//printf("%d\n", drawtileoffset);\r
#endif\r
- poopoffset%=player[0].enti.speed;\r
-//printf("y: %d\n", poopoffset);\r
#ifdef __DEBUG_RF__\r
-if(dbg_pagedelayrendermap){ sprintf(global_temp_status_text, "%-3u", mv->dx); modexprint(mv[0].page, player[0].enti.x, player[0].enti.y-28-(poopoffset*8) , 1, 0, PALMAPDRAWW, 1, 1, global_temp_status_text); }\r
+if(dbg_pagedelayrendermap){ if(!y) y+=TILEWH; else y-=TILEWH;\r
+ sprintf(global_temp_status_text, "%-3u", drawtileoffset); modexprint(mv->page, player[0].enti.x, player[0].enti.y-28-(drawtileoffset*8) , 1, 0, PALMAPDRAWW, 1, 1, global_temp_status_text); }\r
#endif\r
/* the position within the map array */\r
i=ty * mv->map->width + tx;\r
- for( mv->dx=poopoffset; mv->dx<(mv->page->sw+mv->dxThresh)/(poopoffset+1) && tx < mv->map->width; mv->dx+=mv->map->tiles->tileWidth, tx++) {\r
- if(i>=0){\r
+ /*\r
+ */\r
+#ifndef FULLRCREND\r
+ for( mv->dx=drawtileoffset; mv->dx<(mv->page->sw+mv->dxThresh)/(drawtileoffset+1) && tx < mv->map->width; mv->dx+=mv->map->tiles->tileWidth, tx++) {\r
+#else\r
+ for(mv->dx=0; mv->dx<mv->page->sw+mv->dxThresh && tx < mv->map->width; mv->dx+=mv->map->tiles->tileWidth, tx++) {\r
+#endif\r
+ if(i>=0)\r
mapDrawTile(mv->map->tiles, mv->map->layerdata[0].data[i], mv->page, mv->dx, y);\r
- for(z=1;z<=2;z++)\r
- if(mv->map->layerdata[z].data[i]){\r
- sprintf(global_temp_status_text2, "%u", mv->map->layerdata[z].data[i]); modexprint(mv->page, mv->dx, y, 1, 0, PALMAPDRAWW, z+2, 1, global_temp_status_text2);\r
- //mapDrawTile(mv->map->tiles, mv->map->layerdata[z].data[i], mv->page, mv->dx, y);\r
- }\r
- }\r
i++; /* next! */\r
}\r
#ifdef __DEBUG_RF__\r
-if(dbg_pagedelayrendermap) delay(200);\r
+if(dbg_pagedelayrendermap) DBG_RFDELAYMETHOD;\r
#endif\r
}\r
\r
-void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *player, word poopoffset)\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *player)\r
{\r
- int i; nibble z;\r
-#ifdef __DEBUG_RF__\r
-if(dbg_pagedelayrendermap) if(!x) x+=TILEWH; else x-=TILEWH;\r
+ int i;\r
+#if defined(FULLRCREND) || defined(__DEBUG_RF__)\r
+ word drawtileoffset=0;\r
+//printf("x: %d ", drawtileoffset);\r
+ drawtileoffset%=player[0].enti.spt;\r
+//printf("%d\n", drawtileoffset);\r
#endif\r
- poopoffset%=player[0].enti.speed;\r
-//printf("x: %d\n", poopoffset);\r
#ifdef __DEBUG_RF__\r
-if(dbg_pagedelayrendermap){ sprintf(global_temp_status_text, "%-3u", mv->dy); modexprint(mv[0].page, player[0].enti.x, player[0].enti.y-28-(poopoffset*8) , 1, 0, PALMAPDRAWW, 1, global_temp_status_text); }\r
+if(dbg_pagedelayrendermap){ if(!x) x+=TILEWH; else x-=TILEWH;\r
+ sprintf(global_temp_status_text, "%-3u", drawtileoffset); modexprint(mv->page, player[0].enti.x, player[0].enti.y-28-(drawtileoffset*8) , 1, 0, PALMAPDRAWW, 1, 1, global_temp_status_text); }\r
#endif\r
/* location in the map array */\r
i=ty * mv->map->width + tx;\r
/* We'll copy all of the columns in the screen,\r
i + 1 row above and one below */\r
- for( mv->dy=poopoffset; mv->dy<(mv->page->sh+mv->dyThresh)/(poopoffset+1) && ty < mv->map->height; mv->dy+=mv->map->tiles->tileHeight, ty++) {\r
- if(i>=0){\r
+#ifndef FULLRCREND\r
+ for( mv->dy=drawtileoffset; mv->dy<(mv->page->sh+mv->dyThresh)/(drawtileoffset+1) && ty < mv->map->height; mv->dy+=mv->map->tiles->tileHeight, ty++) {\r
+#else\r
+ for(mv->dy=0; mv->dy<mv->page->sh+mv->dyThresh && ty < mv->map->height; mv->dy+=mv->map->tiles->tileHeight, ty++) {\r
+#endif\r
+ if(i>=0)\r
mapDrawTile(mv->map->tiles, mv->map->layerdata[0].data[i], mv->page, x, mv->dy);\r
- for(z=1;z<=2;z++)\r
- if(mv->map->layerdata[z].data[i]){\r
- sprintf(global_temp_status_text2, "%u", mv->map->layerdata[z].data[i]); modexprint(mv->page, x, mv->dy, 1, 0, PALMAPDRAWW, z+2, 1, global_temp_status_text2);\r
- //mapDrawTile(mv->map->tiles, mv->map->layerdata[z].data[i], mv->page, x, mv->dy);\r
- }\r
- }\r
i += mv->map->width;\r
}\r
#ifdef __DEBUG_RF__\r
-if(dbg_pagedelayrendermap) delay(200);\r
+if(dbg_pagedelayrendermap) DBG_RFDELAYMETHOD;\r
#endif\r
}\r
\r
gv->kurokku.frames_per_second=1;\r
break;\r
case 1:\r
-#ifdef OLDWALKSHOWPAGESTUFF\r
+//#ifndef OLDWALKSHOWPAGESTUFF\r
+ //vga_wait_for_vsync();\r
+ vga_wait_for_vsync_end();\r
+//#else\r
//modexWaitBorder();\r
- //modexWaitBorder_start();\r
-#else\r
- vga_wait_for_vsync();\r
- //vga_wait_for_vsync_end();\r
-#endif\r
- gv->kurokku.frames_per_second=60;\r
+//#endif\r
+ gv->kurokku.frames_per_second=FPSVALUE;\r
break;\r
}\r
PM_NextFrame(gv);\r
break;\r
case 2:\r
dd = 1;\r
- qq = player[pn].enti.q*player[pn].enti.speed;\r
+ qq = player[pn].enti.q*player[pn].enti.spt;\r
break;\r
}\r
x-=4;\r
animate_spri(&player[pn].enti, pip[0].video);\r
}\r
//0000if(player[pn].enti.q<4) delay(200);\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+ modexWaitBorder();\r
+#endif\r
}\r
\r
/*\r
break;\r
}\r
}\r
+\r
+void ZC_GirdChk (global_game_variables_t *gvar, player_t *player)\r
+{\r
+ if((player->enti.q==1) &&\r
+ !(player->enti.x%gvar->mv[0].map->tiles->tileWidth==0 && player->enti.y%gvar->mv[0].map->tiles->tileHeight==0))\r
+ ZC_PlayerXYpos(0, 0, player, gvar->mv, 1);\r
+ //TODO: MAKE SURE TO RESYNC PLAYER IN WALKABLE SPOT\r
+}\r