summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure2
-rw-r--r--source/cl_ents.c2
-rw-r--r--source/cl_fx.c9
-rw-r--r--source/cl_local.h8
-rw-r--r--source/cl_main.c2
-rw-r--r--source/cl_parse.c4
-rw-r--r--source/cl_view.c7
7 files changed, 27 insertions, 7 deletions
diff --git a/configure b/configure
index ff378ab..9fc7b72 100755
--- a/configure
+++ b/configure
@@ -536,6 +536,8 @@ if [ "$use_ref" != "no" ]; then
echo "#define REF_GL 2" >> $config_h
if [ "$use_ref" = "gl" ]; then
echo "#define DEFAULT_OPENGL_DRIVER \"$gldriver\"" >> $config_h
+ else
+ echo "#define USE_LIGHTSTYLES 1" >> $config_h
fi
echo "#define VID_REF \"$use_ref\"" >> $config_h
echo "#define VID_MODELIST \"$vid_modelist\"" >> $config_h
diff --git a/source/cl_ents.c b/source/cl_ents.c
index 98bbe61..fb99c82 100644
--- a/source/cl_ents.c
+++ b/source/cl_ents.c
@@ -983,7 +983,9 @@ void CL_AddEntities( void ) {
CL_AddTEnts();
CL_AddParticles();
CL_AddDLights();
+#if USE_LIGHTSTYLES
CL_AddLightStyles();
+#endif
LOC_AddLocationsToScene();
}
diff --git a/source/cl_fx.c b/source/cl_fx.c
index 4d173b1..ef32f7f 100644
--- a/source/cl_fx.c
+++ b/source/cl_fx.c
@@ -34,6 +34,8 @@ LIGHT STYLE MANAGEMENT
==============================================================
*/
+#if USE_LIGHTSTYLES
+
typedef struct clightstyle_s {
list_t entry;
int length;
@@ -71,8 +73,7 @@ void CL_RunLightStyles( void ) {
}
}
-
-void CL_SetLightstyle( int index, const char *string, size_t length ) {
+void CL_SetLightStyle( int index, const char *string, size_t length ) {
int i;
clightstyle_t *dest;
@@ -108,6 +109,8 @@ void CL_AddLightStyles( void ) {
V_AddLightStyle( i, ls->value );
}
+#endif
+
/*
==============================================================
@@ -1902,7 +1905,9 @@ void CL_ClearEffects (void)
{
clear_particles ();
clear_dlights ();
+#if USE_LIGHTSTYLES
clear_lightstyles ();
+#endif
}
void CL_InitEffects( void ) {
diff --git a/source/cl_local.h b/source/cl_local.h
index 27fbd81..4b367cc 100644
--- a/source/cl_local.h
+++ b/source/cl_local.h
@@ -576,13 +576,15 @@ void CL_TeleporterParticles (vec3_t org);
void CL_TeleportParticles (vec3_t org);
void CL_ParticleEffect (vec3_t org, vec3_t dir, int color, int count);
void CL_ParticleEffect2 (vec3_t org, vec3_t dir, int color, int count);
-void CL_SetLightstyle( int index, const char *string, size_t length );
void CL_RunParticles (void);
-void CL_RunDLights (void);
-void CL_RunLightStyles (void);
void CL_AddParticles (void);
+void CL_RunDLights (void);
void CL_AddDLights (void);
+#if USE_LIGHTSTYLES
+void CL_SetLightStyle( int index, const char *string, size_t length );
+void CL_RunLightStyles (void);
void CL_AddLightStyles (void);
+#endif
//
// cl_newfx.c
diff --git a/source/cl_main.c b/source/cl_main.c
index 7fc972c..f4869e5 100644
--- a/source/cl_main.c
+++ b/source/cl_main.c
@@ -2948,7 +2948,9 @@ void CL_Frame( unsigned msec ) {
// advance local effects for next frame
CL_RunDLights();
+#if USE_LIGHTSTYLES
CL_RunLightStyles();
+#endif
// check connection timeout
if( cls.netchan ) {
diff --git a/source/cl_parse.c b/source/cl_parse.c
index 5b32eaf..5d5d856 100644
--- a/source/cl_parse.c
+++ b/source/cl_parse.c
@@ -653,10 +653,12 @@ static void CL_ParseConfigstring( int index ) {
cl.mapname[len - 9] = 0; // cut off ".bsp"
return;
}
+#if USE_LIGHTSTYLES
if (index >= CS_LIGHTS && index < CS_LIGHTS+MAX_LIGHTSTYLES) {
- CL_SetLightstyle( index - CS_LIGHTS, string, len );
+ CL_SetLightStyle( index - CS_LIGHTS, string, len );
return;
}
+#endif
if( cls.state < ca_precached ) {
return;
diff --git a/source/cl_view.c b/source/cl_view.c
index 03c4293..c018a48 100644
--- a/source/cl_view.c
+++ b/source/cl_view.c
@@ -54,7 +54,9 @@ entity_t r_entities[MAX_ENTITIES];
int r_numparticles;
particle_t r_particles[MAX_PARTICLES];
+#if USE_LIGHTSTYLES
lightstyle_t r_lightstyles[MAX_LIGHTSTYLES];
+#endif
/*
====================
@@ -125,7 +127,7 @@ void V_AddLight (vec3_t org, float intensity, float r, float g, float b) {
dl->color[2] = b;
}
-
+#if USE_LIGHTSTYLES
/*
=====================
V_AddLightStyle
@@ -145,6 +147,7 @@ void V_AddLightStyle (int style, vec4_t value) {
ls->rgb[2] = value[2];
ls->white = value[3];
}
+#endif
#ifdef _DEBUG
/*
@@ -492,7 +495,9 @@ void V_RenderView( void ) {
cl.refdef.particles = r_particles;
cl.refdef.num_dlights = r_numdlights;
cl.refdef.dlights = r_dlights;
+#if USE_LIGHTSTYLES
cl.refdef.lightstyles = r_lightstyles;
+#endif
cl.refdef.rdflags = cl.frame.ps.rdflags;