-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathr_main.h
More file actions
145 lines (120 loc) · 4.57 KB
/
r_main.h
File metadata and controls
145 lines (120 loc) · 4.57 KB
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
138
139
140
141
142
143
144
145
/* Emacs style mode select -*- C++ -*-
*-----------------------------------------------------------------------------
*
*
* PrBoom: a Doom port merged with LxDoom and LSDLDoom
* based on BOOM, a modified and improved DOOM engine
* Copyright (C) 1999 by
* id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
* Copyright (C) 1999-2000 by
* Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
* Copyright 2005, 2006 by
* Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
*
* 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., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* DESCRIPTION:
* Renderer main interface.
*
*-----------------------------------------------------------------------------*/
#ifndef __R_MAIN__
#define __R_MAIN__
#include "d_player.h"
#include "r_data.h"
#ifdef __GNUG__
#pragma interface
#endif
//
// POV related.
//
extern fixed_t viewcos;
extern fixed_t viewsin;
extern int viewwidth;
extern int viewheight;
extern int viewwindowx;
extern int viewwindowy;
extern int centerx;
extern int centery;
extern fixed_t centerxfrac;
extern fixed_t centeryfrac;
extern fixed_t viewheightfrac; //e6y: for correct clipping of things
extern fixed_t projection;
// proff 11/06/98: Added for high-res
extern fixed_t projectiony;
extern int validcount;
//
// Rendering stats
//
extern int rendered_visplanes, rendered_segs, rendered_vissprites;
extern boolean rendering_stats;
//
// Lighting LUT.
// Used for z-depth cuing per column/row,
// and other lighting effects (sector ambient, flash).
//
// Lighting constants.
#define LIGHTLEVELS 16
#define LIGHTSEGSHIFT 4
#define MAXLIGHTSCALE 48
#define LIGHTSCALESHIFT 12
#define MAXLIGHTZ 128
#define LIGHTZSHIFT 20
// killough 3/20/98: Allow colormaps to be dynamic (e.g. underwater)
extern const lighttable_t *(*zlight)[MAXLIGHTZ];
extern const lighttable_t *fullcolormap;
extern int numcolormaps; // killough 4/4/98: dynamic number of maps
extern const lighttable_t **colormaps;
// killough 3/20/98, 4/4/98: end dynamic colormaps
extern int extralight;
extern const lighttable_t *fixedcolormap;
// Number of diminishing brightness levels.
// There a 0-31, i.e. 32 LUT in the COLORMAP lump.
#define NUMCOLORMAPS 32
//
// Utility functions.
//
PUREFUNC int R_PointOnSide(fixed_t x, fixed_t y, const node_t *node);
PUREFUNC int R_PointOnSegSide(fixed_t x, fixed_t y, const seg_t *line);
angle_t R_PointToAngle(fixed_t x, fixed_t y);
angle_t R_PointToAngle2(fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2);
subsector_t *R_PointInSubsector(fixed_t x, fixed_t y);
//
// REFRESH - the actual rendering functions.
//
void R_RenderPlayerView(player_t *player); // Called by G_Drawer.
void R_Init(void); // Called by startup code.
void R_SetViewSize(int blocks); // Called by M_Responder.
void R_ExecuteSetViewSize(void); // cph - called by D_Display to complete a view resize
//
// HAPTICS - functions to call for various events that should trigger haptics
//
// called when the player fires a weapon, can get player->readyweapon to know
// which weapon to use for the haptic feedback
void R_PlayerFire(player_t *player);
// called when the player picks up a weapon, can get player->readyweapon to know
// which weapon
void R_PlayerPickupWeapon(player_t *player, int weapon);
void R_PlayerPickupAmmo(player_t *player, ammotype_t ammo, int num);
void R_PlayerPickupHealth(player_t *player, int health);
void R_PlayerPickupArmor(player_t *player, int armor);
void R_PlayerPickupCard(player_t *player, card_t card);
void R_PlayerPickupPowerUp(player_t *player, int powerup);
void R_PlayerInteract(player_t *player, int special);
// called when the player is hurt. damage is the amount of health lost, saved is
// the amount of health saved by armor (which is the same as the amount of armor
// lost)
void R_PlayerHurt(player_t *player, int damage, int saved);
#endif