]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/scroll16.h
zcroll16 merged with scroll16
[16.git] / src / lib / scroll16.h
index a7c4d4b3a844d78cab4b02c59d79c183fa182e67..4f1b539fca5bc1d2751728ecb79ef9131e87c979 100755 (executable)
@@ -56,11 +56,24 @@ typedef struct {
        page_t *page;\r
        int tx; //appears to be the top left tile position on the viewable screen map\r
        int ty; //appears to be the top left tile position on the viewable screen map\r
-       word dxThresh; //????\r
-       word dyThresh; //????\r
+       word dxThresh; //Threshold for physical tile switch\r
+       word dyThresh; //Threshold for physical tile switch\r
        video_t *video; //pointer to game variables of the video\r
        pan_t *pan;             //pointer the the page panning debug system\r
+       int dx, dy, delta, d;\r
 } map_view_t;\r
+/* Map is presumed to:\r
+ * 1. Have all the required layers and tilesets within itself\r
+ * 2. Have a 'fence' around accessible blocks to simplify boundary logic\r
+ * 3. Have a persistent map and tile size among the layers\r
+ * Map view is presumed to:\r
+ * 1. Calculate, store and update a panning info, which includes, but not limited to:\r
+ *     combined layer information, actual map representation (reflecting real state of the game),\r
+ *     pixel shift for smooth tile scrolling.\r
+ * 2. Provide ways to draw a visible part of map. For simplicity with smooth scrolling,\r
+ *     additional row/column is always drawn at the each side of the map. This implies that 'fence'\r
+ *     should have a sprite too. Map is drawn left-to-right, top-to-bottom.\r
+ */\r
 \r
 typedef struct\r
 {\r
@@ -99,4 +112,13 @@ void mapDrawWCol(map_view_t *mv, int tx, int ty, word x);
 void shinku(global_game_variables_t *gv);\r
 void near animatePlayer(map_view_t *pip, player_t *player, word playnum, sword scrollswitch);\r
 \r
+// Move an entity around. Should actually be in 16_entity\r
+boolean ZC_walk(entity_t *ent, map_view_t *map_v);\r
+\r
+// Move player around and call map scrolling if required/possible\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
+\r
 #endif /*__SCROLL16_H_*/\r