mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 07:11:41 +00:00
[client] Auto-detect light color range
Some mappers use 0-255 and others use 0-1. Detection method adapted from ericw light (seems to be a good bet as it seems to be popular).
This commit is contained in:
parent
c6d73eaf64
commit
2e14300a11
1 changed files with 3 additions and 1 deletions
|
@ -204,7 +204,9 @@ parse_light (light_t *light, int *style, const plitem_t *entity,
|
|||
} color = { .v = light->color };
|
||||
sscanf (str, "%f %f %f", VectorExpandAddr (color.a));
|
||||
light->color = color.v;
|
||||
VectorScale (light->color, 1/255.0, light->color);
|
||||
if (light->color[0] > 1 || light->color[1] > 1 || light->color[2] > 1) {
|
||||
VectorScale (light->color, 1/255.0, light->color);
|
||||
}
|
||||
}
|
||||
|
||||
if ((str = PL_String (PL_ObjectForKey (entity, "wait")))) {
|
||||
|
|
Loading…
Reference in a new issue