Oops.
[AROS-Contrib.git] / Games / Doom / r_main.h
blobdbe26073fbdf2b246080d4b8d7f5c2b090207aa8
1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
3 //
4 // $Id$
5 //
6 // Copyright (C) 1993-1996 by id Software, Inc.
7 //
8 // This source is available for distribution and/or modification
9 // only under the terms of the DOOM Source Code License as
10 // published by id Software. All rights reserved.
12 // The source is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
15 // for more details.
17 // DESCRIPTION:
18 // System specific interface stuff.
20 //-----------------------------------------------------------------------------
23 #ifndef __R_MAIN__
24 #define __R_MAIN__
26 #include "d_player.h"
27 #include "r_data.h"
30 #ifdef __GNUG__
31 #pragma interface
32 #endif
36 // POV related.
38 extern fixed_t viewcos;
39 extern fixed_t viewsin;
41 extern int viewwidth;
42 extern int viewheight;
43 extern int viewwindowx;
44 extern int viewwindowy;
48 extern int centerx;
49 extern int centery;
51 extern fixed_t centerxfrac;
52 extern fixed_t centeryfrac;
53 extern fixed_t projection;
55 extern int validcount;
57 extern int linecount;
58 extern int loopcount;
62 // Lighting LUT.
63 // Used for z-depth cuing per column/row,
64 // and other lighting effects (sector ambient, flash).
67 // Lighting constants.
68 // Now why not 32 levels here?
69 #define LIGHTLEVELS 16
70 #define LIGHTSEGSHIFT 4
72 #define MAXLIGHTSCALE 48
73 #define LIGHTSCALESHIFT 12
74 #define MAXLIGHTZ 128
75 #define LIGHTZSHIFT 20
77 extern FAR lighttable_t* scalelight[LIGHTLEVELS][MAXLIGHTSCALE];
78 extern lighttable_t* scalelightfixed[MAXLIGHTSCALE];
79 extern FAR lighttable_t* zlight[LIGHTLEVELS][MAXLIGHTZ];
81 extern int extralight;
82 extern lighttable_t* fixedcolormap;
85 // Number of diminishing brightness levels.
86 // There a 0-31, i.e. 32 LUT in the COLORMAP lump.
87 #define NUMCOLORMAPS 32
90 // Blocky/low detail mode.
91 //B remove this?
92 // 0 = high, 1 = low
93 extern int detailshift;
97 // Function pointers to switch refresh/drawing functions.
98 // Used to select shadow mode etc.
100 extern void (*colfunc) (void);
101 extern void (*basecolfunc) (void);
102 extern void (*fuzzcolfunc) (void);
103 // No shadow effects on floors.
104 extern void (*spanfunc) (void);
105 extern void (*transcolfunc) (void);
109 // Utility functions.
111 R_PointOnSide
112 ( fixed_t x,
113 fixed_t y,
114 node_t* node );
117 R_PointOnSegSide
118 ( fixed_t x,
119 fixed_t y,
120 seg_t* line );
122 angle_t
123 R_PointToAngle
124 ( fixed_t x,
125 fixed_t y );
127 angle_t
128 R_PointToAngle2
129 ( fixed_t x1,
130 fixed_t y1,
131 fixed_t x2,
132 fixed_t y2 );
134 fixed_t
135 R_PointToDist
136 ( fixed_t x,
137 fixed_t y );
140 fixed_t R_ScaleFromGlobalAngle (angle_t visangle);
142 subsector_t*
143 R_PointInSubsector
144 ( fixed_t x,
145 fixed_t y );
147 void
148 R_AddPointToBox
149 ( int x,
150 int y,
151 fixed_t* box );
156 // REFRESH - the actual rendering functions.
159 // Called by G_Drawer.
160 void R_RenderPlayerView (player_t *player);
162 // Called by startup code.
163 void R_Init (void);
165 // Called by M_Responder.
166 void R_SetViewSize (int blocks, int detail);
168 #endif
169 //-----------------------------------------------------------------------------
171 // $Log$
172 // Revision 1.1 2000/02/29 18:21:06 stegerg
173 // Doom port based on ADoomPPC. Read README.AROS!
176 //-----------------------------------------------------------------------------