Update 1 changes

This commit is contained in:
Mike Rubits
2023-10-03 14:43:06 -04:00
parent 60f29560f3
commit 8dc1fc9794
67 changed files with 1806 additions and 1479 deletions

View File

@@ -508,6 +508,7 @@ USE(light_use) (edict_t *self, edict_t *other, edict_t *activator) -> void
// [Sam-KEX] For keeping track of shadow light parameters and setting them up on
// the server side.
// TODO move to level_locals_t
struct shadow_light_info_t
{
int entity_number;
@@ -568,6 +569,57 @@ void setup_shadow_lights()
shadowlightinfo[i].shadowlight.conedirection[2]).data());
}
}
// fix an oversight in shadow light code that causes
// lights to be ordered wrong on return levels
// if the spawn functions are changed.
// this will work without changing the save/load code.
void G_LoadShadowLights()
{
for (size_t i = 0; i < level.shadow_light_count; i++)
{
const char *cstr = gi.get_configstring(CS_SHADOWLIGHTS + i);
const char *token = COM_ParseEx(&cstr, ";");
if (token && *token)
{
shadowlightinfo[i].entity_number = atoi(token);
token = COM_ParseEx(&cstr, ";");
shadowlightinfo[i].shadowlight.lighttype = (shadow_light_type_t) atoi(token);
token = COM_ParseEx(&cstr, ";");
shadowlightinfo[i].shadowlight.radius = atof(token);
token = COM_ParseEx(&cstr, ";");
shadowlightinfo[i].shadowlight.resolution = atoi(token);
token = COM_ParseEx(&cstr, ";");
shadowlightinfo[i].shadowlight.intensity = atof(token);
token = COM_ParseEx(&cstr, ";");
shadowlightinfo[i].shadowlight.fade_start = atof(token);
token = COM_ParseEx(&cstr, ";");
shadowlightinfo[i].shadowlight.fade_end = atof(token);
token = COM_ParseEx(&cstr, ";");
shadowlightinfo[i].shadowlight.lightstyle = atoi(token);
token = COM_ParseEx(&cstr, ";");
shadowlightinfo[i].shadowlight.coneangle = atof(token);
token = COM_ParseEx(&cstr, ";");
shadowlightinfo[i].shadowlight.conedirection[0] = atof(token);
token = COM_ParseEx(&cstr, ";");
shadowlightinfo[i].shadowlight.conedirection[1] = atof(token);
token = COM_ParseEx(&cstr, ";");
shadowlightinfo[i].shadowlight.conedirection[2] = atof(token);
}
}
}
// ---------------------------------------------------------------------------------
static void setup_dynamic_light(edict_t* self)