XenevaOS
Loading...
Searching...
No Matches
r_main.h
Go to the documentation of this file.
1//
2// Copyright(C) 1993-1996 Id Software, Inc.
3// Copyright(C) 2005-2014 Simon Howard
4//
5// This program is free software; you can redistribute it and/or
6// modify it under the terms of the GNU General Public License
7// as published by the Free Software Foundation; either version 2
8// of the License, or (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// DESCRIPTION:
16// System specific interface stuff.
17//
18
19
20#ifndef __R_MAIN__
21#define __R_MAIN__
22
23#include "d_player.h"
24#include "r_data.h"
25
26
27
28
29//
30// POV related.
31//
32extern fixed_t viewcos;
33extern fixed_t viewsin;
34
35extern int viewwindowx;
36extern int viewwindowy;
37
38
39
40extern int centerx;
41extern int centery;
42
43extern fixed_t centerxfrac;
44extern fixed_t centeryfrac;
45extern fixed_t projection;
46
47extern int validcount;
48
49extern int linecount;
50extern int loopcount;
51
52
53//
54// Lighting LUT.
55// Used for z-depth cuing per column/row,
56// and other lighting effects (sector ambient, flash).
57//
58
59// Lighting constants.
60// Now why not 32 levels here?
61#define LIGHTLEVELS 16
62#define LIGHTSEGSHIFT 4
63
64#define MAXLIGHTSCALE 48
65#define LIGHTSCALESHIFT 12
66#define MAXLIGHTZ 128
67#define LIGHTZSHIFT 20
68
72
73extern int extralight;
75
76
77// Number of diminishing brightness levels.
78// There a 0-31, i.e. 32 LUT in the COLORMAP lump.
79#define NUMCOLORMAPS 32
80
81
82// Blocky/low detail mode.
83//B remove this?
84// 0 = high, 1 = low
85extern int detailshift;
86
87
88//
89// Function pointers to switch refresh/drawing functions.
90// Used to select shadow mode etc.
91//
92extern void (*colfunc) (void);
93extern void (*transcolfunc) (void);
94extern void (*basecolfunc) (void);
95extern void (*fuzzcolfunc) (void);
96// No shadow effects on floors.
97extern void (*spanfunc) (void);
98
99
100//
101// Utility functions.
102int
104( fixed_t x,
105 fixed_t y,
106 node_t* node );
107
108int
110( fixed_t x,
111 fixed_t y,
112 seg_t* line );
113
116( fixed_t x,
117 fixed_t y );
118
121( fixed_t x1,
122 fixed_t y1,
123 fixed_t x2,
124 fixed_t y2 );
125
128( fixed_t x,
129 fixed_t y );
130
131
133
136( fixed_t x,
137 fixed_t y );
138
139void
141( int x,
142 int y,
143 fixed_t* box );
144
145
146
147//
148// REFRESH - the actual rendering functions.
149//
150
151// Called by G_Drawer.
152void R_RenderPlayerView (player_t *player);
153
154// Called by startup code.
155void R_Init (void);
156
157// Called by M_Responder.
158void R_SetViewSize (int blocks, int detail);
159
160#endif
void int node
Definition kthread.h:31
int fixed_t
Definition m_fixed.h:32
@ detail
Definition m_menu.c:335
byte lighttable_t
Definition r_defs.h:298
int centerx
Definition r_main.c:56
int extralight
Definition r_main.c:105
lighttable_t * zlight[LIGHTLEVELS][MAXLIGHTZ]
Definition r_main.c:102
int R_PointOnSide(fixed_t x, fixed_t y, node_t *node)
Definition r_main.c:147
#define MAXLIGHTSCALE
Definition r_main.h:64
void(* basecolfunc)(void)
Definition r_main.c:110
void R_SetViewSize(int blocks, int detail)
Definition r_main.c:655
fixed_t centerxfrac
Definition r_main.c:59
void R_AddPointToBox(int x, int y, fixed_t *box)
Definition r_main.c:124
int loopcount
Definition r_main.c:68
lighttable_t * scalelight[LIGHTLEVELS][MAXLIGHTSCALE]
Definition r_main.c:100
void(* spanfunc)(void)
Definition r_main.c:113
int validcount
Definition r_main.c:50
lighttable_t * fixedcolormap
Definition r_main.c:53
fixed_t projection
Definition r_main.c:61
fixed_t viewcos
Definition r_main.c:76
int centery
Definition r_main.c:57
void(* fuzzcolfunc)(void)
Definition r_main.c:111
#define LIGHTLEVELS
Definition r_main.h:61
void(* colfunc)(void)
Definition r_main.c:109
fixed_t viewsin
Definition r_main.c:77
subsector_t * R_PointInSubsector(fixed_t x, fixed_t y)
Definition r_main.c:795
int R_PointOnSegSide(fixed_t x, fixed_t y, seg_t *line)
Definition r_main.c:200
void R_Init(void)
Definition r_main.c:767
int viewwindowy
Definition r_draw.c:62
angle_t R_PointToAngle2(fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2)
Definition r_main.c:363
void(* transcolfunc)(void)
Definition r_main.c:112
#define MAXLIGHTZ
Definition r_main.h:66
int viewwindowx
Definition r_draw.c:61
fixed_t centeryfrac
Definition r_main.c:60
fixed_t R_PointToDist(fixed_t x, fixed_t y)
Definition r_main.c:377
lighttable_t * scalelightfixed[MAXLIGHTSCALE]
Definition r_main.c:101
void R_RenderPlayerView(player_t *player)
Definition r_main.c:863
int detailshift
Definition r_main.c:82
int linecount
Definition r_main.c:67
angle_t R_PointToAngle(fixed_t x, fixed_t y)
Definition r_main.c:277
fixed_t R_ScaleFromGlobalAngle(angle_t visangle)
Definition r_main.c:449
Definition r_defs.h:262
Definition d_player.h:79
Definition r_defs.h:237
Definition r_defs.h:224
unsigned angle_t
Definition tables.h:81