]> 4ch.mooo.com Git - 16.git/blob - src/lib/scroll16.h
readded OLD sprite drawing now for fixing the background stuff ww
[16.git] / src / lib / scroll16.h
1 /* Project 16 Source Code~
2  * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
3  *
4  * This file is part of Project 16.
5  *
6  * Project 16 is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Project 16 is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>, or
18  * write to the Free Software Foundation, Inc., 51 Franklin Street,
19  * Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  */
22
23 #ifndef __SCROLL16_H_
24 #define __SCROLL16_H_
25
26 #include "src/lib/16_head.h"
27 #include "src/lib/bakapee.h"
28 #include "src/lib/modex16.h"
29 #include "src/lib/16_in.h"
30 #include "src/lib/bitmap.h"
31 #include "src/lib/planar.h"
32 #include "src/lib/mapread.h" //map is loaded here www
33 #include "src/lib/16_timer.h"
34 #include "src/lib/wcpu/wcpu.h"
35
36 #include <hw/cpu/cpu.h>
37 #include <hw/dos/dos.h>
38 #include <hw/vga/vga.h>
39 #include <hw/vga/vrl.h>
40
41 #define SPRITE
42 //#define TILERENDER
43
44 //modexDrawSpritePBufRegion
45 //modexDrawBmpPBufRegion
46 #define PBUFSFUN                modexDrawSpriteRegion
47 #define PBUFBFUN                modexDrawBmpRegion
48 #define PLAYERBMPDATA   player[pn].data
49
50 typedef struct {
51         map_t *map;
52         page_t *page;
53         int tx; //appears to be the top left tile position on the viewable screen map
54         int ty; //appears to be the top left tile position on the viewable screen map
55         word dxThresh; //????
56         word dyThresh; //????
57         video_t *video; //pointer to game variables of the video
58         pan_t *pan;             //pointer the the page panning debug system
59 } map_view_t;
60
61 typedef struct
62 {
63         map_view_t *mv;
64 } map_view_db_t;
65
66 //for null map!
67 #define MAPW    40
68 #define MAPH    30
69
70 extern boolean pageflipflop, pageploop;
71 extern unsigned char shinku_fps_indicator_page;
72
73 //map_t allocMap(int w, int h);
74 //void initMap(map_t *map);
75 void walk(map_view_t *pip, player_t *player, word pn);
76 void panpagemanual(map_view_t *pip,  player_t *player, word pn);
77 void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid);
78 void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid);
79 void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid);
80 void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid);
81 void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid);
82 void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid);
83 void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid);
84 void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid);
85 sword chkmap(map_t *map, word q);
86 void mapGoTo(map_view_t *mv, int tx, int ty);
87 void near mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y);
88 void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *p, word poopoffset);
89 void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *p, word poopoffset);
90 void mapDrawWRow(map_view_t *mv, int tx, int ty, word y);
91 void mapDrawWCol(map_view_t *mv, int tx, int ty, word x);
92 //void qclean();
93 void shinku(global_game_variables_t *gv);
94 void near animatePlayer(map_view_t *pip, player_t *player, word playnum, sword scrollswitch);
95
96 #endif /*__SCROLL16_H_*/