/* Project 16 Source Code~\r
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
*\r
* This file is part of Project 16.\r
*\r
printf("\n");\\r
printf("player vars:\n");\\r
printf(" xy: %dx%d", player[0].enti.x, player[0].enti.y); printf(" txy: %dx%d", player[0].enti.tx, player[0].enti.ty); printf(" triggxy: %dx%d", player[0].enti.triggerx, 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(" hp: %d", (player[0].enti.hp)); printf(" q: %d", player[0].enti.q); printf(" info.dir: %d", player[0].info.dir); printf(" d: %d ", player[0].enti.d);\\r
printf(" pdir: %d\n", player[0].pdir); printf(" delay=%u", player[0].enti.spri->delay);\\r
printf("\n\n");\\r
VL_PrintmodexmemInfo(&gvar.video);\\r
void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid);\r
void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid);\r
void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid);\r
-void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid);\r
-void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid);\r
-void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid);\r
-void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid);\r
-void playerXYpos(int x, int y, player_t *player, map_view_t *pip, nibble pn);\r
+inline void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid)\r
+{\r
+ /* increment the pixel position and update the page */\r
+ mv[id].page->dx += player[plid].enti.speed;\r
+\r
+ /* check to see if this changes the tile */\r
+ if(mv[id].page->dx >= mv[id].dxThresh )\r
+ {\r
+ /* go forward one tile */\r
+ if(id==0) mv[id].tx++;\r
+ /* Snap the origin forward */\r
+ mv[id].page->data += 4;\r
+\r
+ mv[id].page->dx = mv[id].map->tiles->tileWidth;\r
+ }\r
+}\r
+\r
+inline void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid)\r
+{\r
+ /* decrement the pixel position and update the page */\r
+ mv[id].page->dx -= player[plid].enti.speed;\r
+\r
+ /* check to see if this changes the tile */\r
+ if(mv[id].page->dx == 0)\r
+ {\r
+ /* go backward one tile */\r
+ if(id==0) mv[id].tx--;\r
+ /* Snap the origin backward */\r
+ mv[id].page->data -= 4;\r
+\r
+ mv[id].page->dx = mv[id].map->tiles->tileWidth;\r
+ }\r
+}\r
+\r
+inline void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid)\r
+{\r
+ /* decrement the pixel position and update the page */\r
+ mv[id].page->dy -= player[plid].enti.speed;\r
+\r
+ /* check to see if this changes the tile */\r
+ if(mv[id].page->dy == 0 )\r
+ {\r
+ /* go up one tile */\r
+ if(id==0) mv[id].ty--;\r
+ /* Snap the origin upward */\r
+ mv[id].page->data -= mv[id].page->pi;\r
+\r
+ mv[id].page->dy = mv[id].map->tiles->tileHeight;\r
+ }\r
+}\r
+\r
+inline void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid)\r
+{\r
+ /* increment the pixel position and update the page */\r
+ mv[id].page->dy += player[plid].enti.speed;\r
+\r
+ /* check to see if this changes the tile */\r
+ if(mv[id].page->dy >= mv[id].dyThresh )\r
+ {\r
+ /* go down one tile */\r
+ if(id==0) mv[id].ty++;\r
+ /* Snap the origin downward */\r
+ mv[id].page->data += mv[id].page->pi;\r
+\r
+ mv[id].page->dy = mv[id].map->tiles->tileHeight;\r
+ }\r
+}\r
+\r
+void ZC_playerXYpos(int x, int y, player_t *player, map_view_t *pip, nibble pn);\r
sword chkmap(map_t *map, word q);\r
void mapGoTo(map_view_t *mv, int tx, int ty);\r
void mapinitmapview(map_view_t *mv, int tx, int ty);\r