]> 4ch.mooo.com Git - 16.git/blob - src/lib/zcroll16.h
See WHAT_WAS_CHANGED for details
[16.git] / src / lib / zcroll16.h
1 /* Project 16 Source Code~\r
2  * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
3  *\r
4  * This file is part of Project 16.\r
5  *\r
6  * Project 16 is free software; you can redistribute it and/or modify\r
7  * it under the terms of the GNU General Public License as published by\r
8  * the Free Software Foundation; either version 3 of the License, or\r
9  * (at your option) any later version.\r
10  *\r
11  * Project 16 is distributed in the hope that it will be useful,\r
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14  * GNU General Public License for more details.\r
15  *\r
16  * You should have received a copy of the GNU General Public License\r
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
18  * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
19  * Fifth Floor, Boston, MA 02110-1301 USA.\r
20  *\r
21  */\r
22 \r
23 #ifndef __ZCROLL16_H_\r
24 #define __ZCROLL16_H_\r
25 \r
26 #include "src/lib/16_head.h"\r
27 #include "src/lib/16_entity.h"\r
28 //#include "src/lib/bakapee.h"\r
29 #include "src/lib/modex16.h"\r
30 //#include "src/lib/16_in.h"\r
31 #include "src/lib/bitmap.h"\r
32 #include "src/lib/16_map.h" //map is loaded here www\r
33 #include "src/lib/16_timer.h"\r
34 #include "src/lib/wcpu/wcpu.h"\r
35 \r
36 #include <hw/cpu/cpu.h>\r
37 #include <hw/dos/dos.h>\r
38 #include <hw/vga/vga.h>\r
39 #include <hw/vga/vrl.h>\r
40 \r
41 #define SPRITE\r
42 //#define TILERENDER\r
43 \r
44 //modexDrawSpritePBufRegion\r
45 //modexDrawBmpPBufRegion\r
46 #define PBUFSFUN                modexDrawSpriteRegion\r
47 #define PBUFBFUN                modexDrawBmpRegion\r
48 #define PLAYERBMPDATA   player->data\r
49 \r
50 \r
51 #define MAPW    40\r
52 #define MAPH    30\r
53 \r
54 extern boolean pageflipflop, pageploop;\r
55 extern unsigned char shinku_fps_indicator_page;\r
56 \r
57 typedef struct {\r
58         map_t *map;\r
59         page_t *page;\r
60         int tx; //appears to be the top left tile position on the viewable screen map\r
61         int ty; //appears to be the top left tile position on the viewable screen map\r
62         word dxThresh; //Threshold for physical tile switch\r
63         word dyThresh; //Threshold for physical tile switch\r
64         video_t *video; //pointer to game variables of the video\r
65         pan_t *pan;             //pointer the the page panning debug system\r
66         int dx, dy, delta, d;\r
67 } map_view_t;\r
68 /* Map is presumed to:\r
69  * 1. Have all the required layers and tilesets within itself\r
70  * 2. Have a 'fence' around accessible blocks to simplify boundary logic\r
71  * 3. Have a persistent map and tile size among the layers\r
72  * Map view is presumed to:\r
73  * 1. Calculate, store and update a panning info, which includes, but not limited to:\r
74  *      combined layer information, actual map representation (reflecting real state of the game),\r
75  *      pixel shift for smooth tile scrolling.\r
76  * 2. Provide ways to draw a visible part of map. For simplicity with smooth scrolling, \r
77  *      additional row/column is always drawn at the each side of the map. This implies that 'fence'\r
78  *      should have a sprite too. Map is drawn left-to-right, top-to-bottom.\r
79  */\r
80 \r
81 // Move an entity around. Should actually be in 16_entity\r
82 boolean walk(entity_t *ent, map_view_t *map_v);\r
83 \r
84 // Move player around and call map scrolling if required/possible\r
85 void walk_player(player_t *player, map_view_t *map_v);\r
86 \r
87 // Scroll map in one direction (assumed from player's movement)\r
88 void near mapScroll(map_view_t *mv, player_t *player);\r
89 sword chkmap(map_t *map, word q);\r
90 void mapGoTo(map_view_t *mv, int tx, int ty);\r
91 void near mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y);\r
92 //void qclean();\r
93 void shinku(global_game_variables_t *gv);\r
94 void near animatePlayer(map_view_t *pip, player_t *player, sword scrollswitch);\r
95 \r
96 #endif /*__ZCROLL16_H_*/\r