1 /* Emacs style mode select -*- C++ -*-
2 *-----------------------------------------------------------------------------
5 * PrBoom a Doom port merged with LxDoom and LSDLDoom
6 * based on BOOM, a modified and improved DOOM engine
7 * Copyright (C) 1999 by
8 * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
9 * Copyright (C) 1999-2000 by
10 * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
28 * Renderer main interface.
30 *-----------------------------------------------------------------------------*/
46 extern fixed_t viewcos
;
47 extern fixed_t viewsin
;
49 extern int viewheight
;
50 extern int viewwindowx
;
51 extern int viewwindowy
;
54 extern fixed_t centerxfrac
;
55 extern fixed_t centeryfrac
;
56 extern fixed_t projection
;
57 // proff 11/06/98: Added for high-res
58 extern fixed_t projectiony
;
59 extern int validcount
;
67 extern int rendered_visplanes
, rendered_segs
, rendered_vissprites
;
68 extern boolean rendering_stats
;
72 // Used for z-depth cuing per column/row,
73 // and other lighting effects (sector ambient, flash).
76 // Lighting constants.
78 #define LIGHTLEVELS 16
79 #define LIGHTSEGSHIFT 4
80 #define MAXLIGHTSCALE 48
81 #define LIGHTSCALESHIFT 12
83 #define LIGHTZSHIFT 20
85 // killough 3/20/98: Allow colormaps to be dynamic (e.g. underwater)
86 extern lighttable_t
*(*scalelight
)[MAXLIGHTSCALE
];
87 extern lighttable_t
*(*zlight
)[MAXLIGHTZ
];
88 extern lighttable_t
*fullcolormap
;
89 extern int numcolormaps
; // killough 4/4/98: dynamic number of maps
90 extern lighttable_t
**colormaps
;
91 // killough 3/20/98, 4/4/98: end dynamic colormaps
93 extern int extralight
;
94 extern lighttable_t
*fixedcolormap
;
96 // Number of diminishing brightness levels.
97 // There a 0-31, i.e. 32 LUT in the COLORMAP lump.
99 #define NUMCOLORMAPS 32
102 // Function pointers to switch refresh/drawing functions.
103 // Used to select shadow mode etc.
106 extern void (*colfunc
)(void);
109 // Utility functions.
112 int R_PointOnSide(fixed_t x
, fixed_t y
, const node_t
*node
);
113 int R_PointOnSegSide(fixed_t x
, fixed_t y
, const seg_t
*line
);
114 angle_t
R_PointToAngle(fixed_t x
, fixed_t y
);
115 angle_t
R_PointToAngle2(fixed_t x1
, fixed_t y1
, fixed_t x2
, fixed_t y2
);
116 subsector_t
*R_PointInSubsector(fixed_t x
, fixed_t y
);
119 // REFRESH - the actual rendering functions.
122 void R_RenderPlayerView(player_t
*player
); // Called by G_Drawer.
123 void R_Init(void); // Called by startup code.
124 void R_SetViewSize(int blocks
); // Called by M_Responder.
125 void R_ExecuteSetViewSize(void); // cph - called by D_Display to complete a view resize