-
Notifications
You must be signed in to change notification settings - Fork 173
/
id_rf.h
137 lines (94 loc) · 3.83 KB
/
id_rf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/* Keen Dreams Source Code
* Copyright (C) 2014 Javier M. Chavez
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
// ID_RF.H
#define __ID_RF__
#ifndef __ID_MM__
#include "ID_MM.H"
#endif
/*
=============================================================================
CONSTANTS
=============================================================================
*/
#define MINTICS 2
#define MAXTICS 6
#define MAPBORDER 2 // map border must be at least 1
#define MAXSPRITES 100 // max tracked sprites
#define MAXANIMTILES 90 // max animating tiles on screen
#define MAXANIMTYPES 50 // max different unique anim tiles on map
#define MAXMAPHEIGHT 128
#define PRIORITIES 4
#define MASKEDTILEPRIORITY 3 // planes go: 0,1,2,MTILES,3
#define TILEGLOBAL 256
#define PIXGLOBAL 16
#define G_T_SHIFT 8 // global >> ?? = tile
#define G_P_SHIFT 4 // global >> ?? = pixels
#define P_T_SHIFT 4 // pixels >> ?? = tile
#define PORTTILESWIDE 21 // all drawing takes place inside a
#define PORTTILESHIGH 14 // non displayed port of this size
//#define PORTGLOBALWIDE (21*TILEGLOBAL)
//#define PORTGLOBALHIGH (14*TILEGLOBAL)
#define UPDATEWIDE (PORTTILESWIDE+1)
#define UPDATEHIGH PORTTILESHIGH
//===========================================================================
typedef enum {spritedraw,maskdraw} drawtype;
/*
=============================================================================
PUBLIC VARIABLES
=============================================================================
*/
extern boolean compatability; // crippled refresh for wierdo SVGAs
extern unsigned tics;
extern long lasttimecount;
extern unsigned originxglobal,originyglobal;
extern unsigned originxtile,originytile;
extern unsigned originxscreen,originyscreen;
extern unsigned mapwidth,mapheight,mapbyteswide,mapwordswide
,mapbytesextra,mapwordsextra;
extern unsigned mapbwidthtable[MAXMAPHEIGHT];
extern unsigned originxmin,originxmax,originymin,originymax;
extern unsigned masterofs;
//
// the floating update window is also used by the view manager for
// double buffer tracking
//
extern byte *updateptr; // current start of update window
#if GRMODE == CGAGR
extern byte *baseupdateptr;
#endif
extern unsigned blockstarts[UPDATEWIDE*UPDATEHIGH];
extern unsigned updatemapofs[UPDATEWIDE*UPDATEHIGH];
extern unsigned uwidthtable[UPDATEHIGH]; // lookup instead of multiple
#define UPDATETERMINATE 0x0301
/*
=============================================================================
PUBLIC FUNCTIONS
=============================================================================
*/
void RF_Startup (void);
void RF_Shutdown (void);
void RF_NewMap (void);
void RF_MarkTileGraphics (void);
void RF_NewPosition (unsigned x, unsigned y);
void RF_Scroll (int x, int y);
void RF_PlaceSprite (void **user,unsigned globalx,unsigned globaly,
unsigned spritenumber, drawtype draw, int priority);
void RF_RemoveSprite (void **user);
void RF_Refresh (void);
void RF_ForceRefresh (void);
void RF_SetRefreshHook (void (*func) (void) );