UFO: Alien Invasion
Doxygen documentation generating
r_light.h
Go to the documentation of this file.
1 
5 /*
6 Copyright (C) 1997-2001 Id Software, Inc.
7 
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 
17 See the GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23 */
24 
25 #pragma once
26 
27 struct entity_s;
28 
29 typedef struct light_s {
32  float radius;
33 } light_t;
34 
36 typedef struct sustain_s {
38  float time;
39  float sustain;
40 } sustain_t;
41 
42 /* cap on number of light sources that can be in a scene; feel free
43  * to increase if necessary, but be aware that doing so will increase
44  * the time it takes for each entity to sort the light list at each
45  * frame (this is based on the number of lights actually used, not
46  * the max number allowed) */
47 #define MAX_STATIC_LIGHTS 1024
48 
50 void R_AddLight(const vec3_t origin, float radius, const vec3_t color);
51 void R_AddSustainedLight(const vec3_t org, float radius, const vec3_t color, float sustain);
52 void R_UpdateSustainedLights(void);
53 void R_EnableWorldLights(void);
54 void R_EnableModelLights(const light_t** lights, int numLights, bool inShadow, bool enable);
55 void R_DisableLights(void);
56 
57 void R_AddStaticLight(const vec3_t origin, float radius, const vec3_t color);
58 void R_ClearStaticLights(void);
59 void R_UpdateLightList(struct entity_s* ent);
float radius
Definition: r_light.h:32
sustains are light flashes which slowly decay
Definition: r_light.h:36
a light source
Definition: r_light.h:29
void R_AddStaticLight(const vec3_t origin, float radius, const vec3_t color)
Add static light for model lighting (world already got them baked into lightmap)
Definition: r_light.cpp:261
vec4_t color
Definition: r_light.h:31
voidpf uLong int origin
Definition: ioapi.h:45
light_t light
Definition: r_light.h:37
void R_AddLight(const vec3_t origin, float radius, const vec3_t color)
Create light to be rendered in the current frame (will be removed before the next) ...
Definition: r_light.cpp:36
void R_EnableModelLights(const light_t **lights, int numLights, bool inShadow, bool enable)
Enable or disable realtime dynamic lighting for models.
Definition: r_light.cpp:149
vec3_t origin
Definition: r_light.h:30
static light_t * lights[LIGHTMAP_MAX]
Definition: lightmap.cpp:285
float sustain
Definition: r_light.h:39
void R_UpdateSustainedLights(void)
Updates state of sustained lights; should be called once per frame right before world rendering...
Definition: r_light.cpp:83
void R_UpdateLightList(struct entity_s *ent)
void R_EnableWorldLights(void)
Set up lighting data for the GLSL world shader.
Definition: r_light.cpp:108
void R_AddSustainedLight(const vec3_t org, float radius, const vec3_t color, float sustain)
Definition: r_light.cpp:58
void R_ClearStaticLights(void)
Remove all static light data.
Definition: r_light.cpp:300
vec_t vec3_t[3]
Definition: ufotypes.h:39
float time
Definition: r_light.h:38
void R_DisableLights(void)
Definition: r_light.cpp:282
vec_t vec4_t[4]
Definition: ufotypes.h:40