/
rend_main.h
113 lines (86 loc) · 3.14 KB
/
rend_main.h
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
/** @file rend_main.h
*
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2006-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>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, see:
* http://www.gnu.org/licenses</small>
*/
/**
* Core of the rendering subsystem.
*/
#ifndef LIBDENG_REND_MAIN_H
#define LIBDENG_REND_MAIN_H
#include <math.h>
#ifdef __CLIENT__
# include "rend_list.h"
#endif
#include "r_things.h"
#define GLOW_HEIGHT_MAX (1024.f) /// Absolute maximum
#define OMNILIGHT_SURFACE_LUMINOSITY_ATTRIBUTION_MIN (.05f)
#define SHADOW_SURFACE_LUMINOSITY_ATTRIBUTION_MIN (.05f)
DENG_EXTERN_C coord_t vOrigin[3];
DENG_EXTERN_C float vang, vpitch, fieldOfView, yfov;
DENG_EXTERN_C byte smoothTexAnim, devMobjVLights;
DENG_EXTERN_C float viewsidex, viewsidey;
DENG_EXTERN_C boolean usingFog;
DENG_EXTERN_C float fogColor[4];
DENG_EXTERN_C int rAmbient;
DENG_EXTERN_C float rendLightDistanceAttentuation;
DENG_EXTERN_C float lightModRange[255];
DENG_EXTERN_C int devRendSkyMode;
DENG_EXTERN_C int gameDrawHUD;
DENG_EXTERN_C int useDynLights;
DENG_EXTERN_C float dynlightFactor, dynlightFogBright;
DENG_EXTERN_C int useWallGlow;
DENG_EXTERN_C float glowFactor, glowHeightFactor;
DENG_EXTERN_C int glowHeightMax;
DENG_EXTERN_C int useShadows;
DENG_EXTERN_C float shadowFactor;
DENG_EXTERN_C int shadowMaxRadius;
DENG_EXTERN_C int shadowMaxDistance;
DENG_EXTERN_C int useShinySurfaces;
DENG_EXTERN_C byte devRendSkyAlways;
DENG_EXTERN_C byte freezeRLs;
#ifdef __cplusplus
extern "C" {
#endif
void Rend_Register(void);
void Rend_Init(void);
void Rend_Shutdown(void);
void Rend_Reset(void);
void Rend_RenderMap(void);
void Rend_ModelViewMatrix(boolean use_angles);
#define Rend_PointDist2D(c) (fabs((vOrigin[VZ]-c[VY])*viewsidex - (vOrigin[VX]-c[VX])*viewsidey))
coord_t Rend_PointDist3D(coord_t const point[3]);
void Rend_ApplyTorchLight(float *color, float distance);
/**
* Apply range compression delta to @a lightValue.
* @param lightValue Address of the value for adaptation.
*/
void Rend_ApplyLightAdaptation(float *lightValue);
/// Same as Rend_ApplyLightAdaptation except the delta is returned.
float Rend_LightAdaptationDelta(float lightvalue);
void Rend_CalcLightModRange(void);
/**
* Number of vertices needed for this leaf's trifan.
*/
uint Rend_NumFanVerticesForBspLeaf(BspLeaf *bspLeaf);
void R_DrawLightRange(void);
#ifdef __cplusplus
} // extern "C"
#ifdef __CLIENT__
de::MaterialVariantSpec const &Rend_MapSurfaceMaterialSpec();
#endif
#endif // __cplusplus
#endif // LIBDENG_REND_MAIN_H