summaryrefslogtreecommitdiff
path: root/apps/plugins/doom/r_main.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/doom/r_main.h')
-rw-r--r--apps/plugins/doom/r_main.h125
1 files changed, 125 insertions, 0 deletions
diff --git a/apps/plugins/doom/r_main.h b/apps/plugins/doom/r_main.h
new file mode 100644
index 0000000000..10978b3e71
--- /dev/null
+++ b/apps/plugins/doom/r_main.h
@@ -0,0 +1,125 @@
1/* Emacs style mode select -*- C++ -*-
2 *-----------------------------------------------------------------------------
3 *
4 *
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
11 *
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.
16 *
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.
21 *
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
25 * 02111-1307, USA.
26 *
27 * DESCRIPTION:
28 * Renderer main interface.
29 *
30 *-----------------------------------------------------------------------------*/
31
32#ifndef __R_MAIN__
33#define __R_MAIN__
34
35#include "d_player.h"
36#include "r_data.h"
37
38#ifdef __GNUG__
39#pragma interface
40#endif
41
42//
43// POV related.
44//
45
46extern fixed_t viewcos;
47extern fixed_t viewsin;
48extern int viewwidth;
49extern int viewheight;
50extern int viewwindowx;
51extern int viewwindowy;
52extern int centerx;
53extern int centery;
54extern fixed_t centerxfrac;
55extern fixed_t centeryfrac;
56extern fixed_t projection;
57extern int validcount;
58extern int linecount;
59extern int loopcount;
60
61//
62// Rendering stats
63//
64
65extern int rendered_visplanes, rendered_segs, rendered_vissprites;
66extern boolean rendering_stats;
67
68//
69// Lighting LUT.
70// Used for z-depth cuing per column/row,
71// and other lighting effects (sector ambient, flash).
72//
73
74// Lighting constants.
75
76#define LIGHTLEVELS 16
77#define LIGHTSEGSHIFT 4
78#define MAXLIGHTSCALE 48
79#define LIGHTSCALESHIFT 12
80#define MAXLIGHTZ 128
81#define LIGHTZSHIFT 20
82
83// killough 3/20/98: Allow colormaps to be dynamic (e.g. underwater)
84extern lighttable_t *(*scalelight)[MAXLIGHTSCALE];
85extern lighttable_t *(*zlight)[MAXLIGHTZ];
86extern lighttable_t *fullcolormap;
87extern int numcolormaps; // killough 4/4/98: dynamic number of maps
88extern lighttable_t **colormaps;
89// killough 3/20/98, 4/4/98: end dynamic colormaps
90
91extern int extralight;
92extern lighttable_t *fixedcolormap;
93
94// Number of diminishing brightness levels.
95// There a 0-31, i.e. 32 LUT in the COLORMAP lump.
96
97#define NUMCOLORMAPS 32
98
99//
100// Function pointers to switch refresh/drawing functions.
101// Used to select shadow mode etc.
102//
103
104extern void (*colfunc)(void);
105
106//
107// Utility functions.
108//
109
110int R_PointOnSide(fixed_t x, fixed_t y, const node_t *node);
111int R_PointOnSegSide(fixed_t x, fixed_t y, const seg_t *line);
112angle_t R_PointToAngle(fixed_t x, fixed_t y);
113angle_t R_PointToAngle2(fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2);
114subsector_t *R_PointInSubsector(fixed_t x, fixed_t y);
115
116//
117// REFRESH - the actual rendering functions.
118//
119
120void R_RenderPlayerView(player_t *player); // Called by G_Drawer.
121void R_Init(void); // Called by startup code.
122void R_SetViewSize(int blocks); // Called by M_Responder.
123void R_ExecuteSetViewSize(void); // cph - called by D_Display to complete a view resize
124
125#endif