shadow = false;
t++;
}
- a = sscanf(t, "%f %f %f %f %f %f %f %d \"%s\" %f %f %f %f", &origin[0], &origin[1], &origin[2], &radius, &color[0], &color[1], &color[2], &style, cubemapname, &corona, &angles[0], &angles[1], &angles[2]);
+ a = sscanf(t, "%f %f %f %f %f %f %f %d %s %f %f %f %f", &origin[0], &origin[1], &origin[2], &radius, &color[0], &color[1], &color[2], &style, cubemapname, &corona, &angles[0], &angles[1], &angles[2]);
if (a < 13)
VectorClear(angles);
if (a < 10)
corona = 0;
- if (a < 9)
+ if (a < 9 || !strcmp(cubemapname, "\"\""))
cubemapname[0] = 0;
*s = '\n';
if (a < 8)
buf = NULL;
for (light = r_shadow_worldlightchain;light;light = light->next)
{
- sprintf(line, "%s%f %f %f %f %f %f %f %d \"%s\" %f %f %f %f\n", light->shadow ? "" : "!", light->origin[0], light->origin[1], light->origin[2], light->radius / r_editlights_rtlightssizescale.value, light->color[0] / r_editlights_rtlightscolorscale.value, light->color[1] / r_editlights_rtlightscolorscale.value, light->color[2] / r_editlights_rtlightscolorscale.value, light->style, light->cubemapname ? light->cubemapname : "", light->corona, light->angles[0], light->angles[1], light->angles[2]);
+ sprintf(line, "%s%f %f %f %f %f %f %f %d %s %f %f %f %f\n", light->shadow ? "" : "!", light->origin[0], light->origin[1], light->origin[2], light->radius / r_editlights_rtlightssizescale.value, light->color[0] / r_editlights_rtlightscolorscale.value, light->color[1] / r_editlights_rtlightscolorscale.value, light->color[2] / r_editlights_rtlightscolorscale.value, light->style, light->cubemapname ? light->cubemapname : "\"\"", light->corona, light->angles[0], light->angles[1], light->angles[2]);
if (bufchars + (int) strlen(line) > bufmaxchars)
{
bufmaxchars = bufchars + strlen(line) + 2048;
void R_Shadow_LoadWorldLightsFromMap_LightArghliteTyrlite(void)
{
- int entnum, style, islight, skin, pflags;
+ int entnum, style, islight, skin, pflags, effects;
char key[256], value[1024];
float origin[3], angles[3], radius, color[3], light, fadescale, lightscale, originhack[3], overridecolor[3];
const char *data;
style = 0;
skin = 0;
pflags = 0;
+ effects = 0;
islight = false;
while (1)
{
skin = (int)atof(value);
else if (!strcmp("pflags", key))
pflags = (int)atof(value);
+ else if (!strcmp("effects", key))
+ effects = (int)atof(value);
}
if (light <= 0 && islight)
light = 300;
lightscale = 1;
if (fadescale <= 0)
fadescale = 1;
+ if (gamemode == GAME_TENEBRAE)
+ {
+ if (effects & EF_NODRAW)
+ {
+ pflags |= PFLAGS_FULLDYNAMIC;
+ effects &= ~EF_NODRAW;
+ }
+ }
radius = min(light * r_editlights_quakelightsizescale.value * lightscale / fadescale, 1048576);
light = sqrt(bound(0, light, 1048576)) * (1.0f / 16.0f);
if (color[0] == 1 && color[1] == 1 && color[2] == 1)
VectorCopy(overridecolor, color);
VectorScale(color, light, color);
VectorAdd(origin, originhack, origin);
- if (radius >= 15)
- R_Shadow_NewWorldLight(origin, angles, color, radius, !!(pflags & 2), style, !(pflags & 1), skin >= 16 ? va("cubemaps/%i", skin) : NULL);
+ if (radius >= 15 && !(pflags & PFLAGS_FULLDYNAMIC))
+ R_Shadow_NewWorldLight(origin, angles, color, radius, (pflags & PFLAGS_CORONA) != 0, style, (pflags & PFLAGS_NOSHADOW) == 0, skin >= 16 ? va("cubemaps/%i", skin) : NULL);
}
}