#include "src/lib/16_in.h"\r
#include "src/lib/bitmap.h"\r
#include "src/lib/mapread.h" //map is loaded here www\r
+#include "src/lib/16render.h"\r
//#include "src/lib/16_map.h" //new map stuff\r
#include "src/lib/16_timer.h"\r
#include "src/lib/wcpu/wcpu.h"\r
#define SPRITE\r
//#define TILERENDER\r
\r
+extern void modexDrawSpriteRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp);\r
+\r
//modexDrawSpritePBufRegion\r
//modexDrawBmpPBufRegion\r
#define PBUFSFUN modexDrawSpriteRegion\r
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
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