mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 23:32:02 +00:00
- use the newly added OF_Transient flag to avoid writing out the owned dynamic lights to savegames instead of destroying and recreating them each time.
This commit is contained in:
parent
b03489a43c
commit
59576e6d23
2 changed files with 6 additions and 3 deletions
|
@ -1081,6 +1081,7 @@ void gl_AttachLight(AActor *actor, unsigned int count, const FLightDefaults *lig
|
|||
light = Spawn<ADynamicLight>(actor->Pos(), NO_REPLACE);
|
||||
light->target = actor;
|
||||
light->owned = true;
|
||||
light->ObjectFlags |= OF_Transient;
|
||||
actor->dynamiclights.Push(light);
|
||||
}
|
||||
light->flags2&=~MF2_DORMANT;
|
||||
|
|
|
@ -1199,7 +1199,6 @@ void FGLInterface::StateChanged(AActor *actor)
|
|||
|
||||
void FGLInterface::StartSerialize(FSerializer &arc)
|
||||
{
|
||||
gl_DeleteAllAttachedLights();
|
||||
if (arc.BeginObject("glinfo"))
|
||||
{
|
||||
arc("fogdensity", fogdensity)
|
||||
|
@ -1211,8 +1210,11 @@ void FGLInterface::StartSerialize(FSerializer &arc)
|
|||
|
||||
void FGLInterface::EndSerialize(FSerializer &arc)
|
||||
{
|
||||
gl_RecreateAllAttachedLights();
|
||||
if (arc.isReading()) gl_InitPortals();
|
||||
if (arc.isReading())
|
||||
{
|
||||
gl_RecreateAllAttachedLights();
|
||||
gl_InitPortals();
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
Loading…
Reference in a new issue