summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2013-01-05 20:26:18 +0400
committerAndrey Nazarov <skuller@skuller.net>2013-01-05 20:26:18 +0400
commit5ecbf20d85b39e20c6d12f6839c02a780825297c (patch)
treea2253f7e9b13004591586ca615a21437e725518e
parent9e008be328be5ff83457e5d0fa790f4e1f062d80 (diff)
Empty lightstyles are fullbright.
-rw-r--r--src/client/effects.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/client/effects.c b/src/client/effects.c
index d17a2d3..d026352 100644
--- a/src/client/effects.c
+++ b/src/client/effects.c
@@ -47,7 +47,18 @@ static int cl_lastofs;
void CL_ClearLightStyles(void)
{
- memset(cl_lightstyles, 0, sizeof(cl_lightstyles));
+ int i;
+ clightstyle_t *ls;
+
+ for (i = 0, ls = cl_lightstyles; i < MAX_LIGHTSTYLES; i++, ls++) {
+ List_Init(&ls->entry);
+ ls->length = 0;
+ ls->value[0] =
+ ls->value[1] =
+ ls->value[2] =
+ ls->value[3] = 1;
+ }
+
List_Init(&cl_lightlist);
cl_lastofs = -1;
}
@@ -99,11 +110,18 @@ void CL_SetLightStyle(int index, const char *s)
return;
}
+ if (ls->length == 1) {
+ ls->value[0] =
+ ls->value[1] =
+ ls->value[2] =
+ ls->value[3] = ls->map[0];
+ return;
+ }
+
ls->value[0] =
ls->value[1] =
ls->value[2] =
- ls->value[3] =
- ls->map[0] = 1;
+ ls->value[3] = 1;
}
/*