They are attached and actived explicitly during usual actor initialization sequence
Postponed processing applicable to so called user dynamic lights must be skipped for them
RECREATELIGHTS flag handling for dynamic light actors had the opposite effect of deactivating them
https://forum.zdoom.org/viewtopic.php?t=65683
This was only run on a state change and missed every external light change.
Any place which wants to flag a light change now only will set a flag and at the end of the thinker loop all flagged actors will be processed.
For performance reasons this was merged with the P_RunEffects iterator loop.
# Conflicts:
# src/p_effect.cpp
# src/p_effect.h
# src/p_tick.cpp
# Conflicts:
# src/p_mobj.cpp
This also removes the gl_attachedlights CVAR because with the new management this doesn't really work anymore.
# Conflicts:
# src/gl/system/gl_cvars.h
# wadsrc/static/menudef.txt
Unlike the other classes, the places where variables from this class were accessed were quite scattered so there isn't much scriptified code. Instead, most of these places are now using the script variable access methods.
This was the last remaining subclass of AActor, meaning that class Actor can now be opened for user-side extensions.
Since these can be changed on the placed light actor they have to be read from there, so this is now a pointer in FDynamicLight, just like the other properties that can be user-changed.
Also did some cleanup on the interface so that external code doesn't need to dereference the lightflags pointer but can use utility functions for all flags.
# Conflicts:
# src/hwrenderer/dynlights/hw_dynlightdata.cpp
# src/swrenderer/line/r_walldraw.cpp
# Conflicts:
# src/g_level.cpp
# src/gl/compatibility/gl_20.cpp
This should be less of a drag on the playsim than having each light a separate actor. A quick check with ZDCMP2 showed that the light processing time was reduced to 1/3rd from 0.5 ms to 0.17 ms per tic.
It's also one native actor class less.
# Conflicts:
# src/g_shared/a_dynlight.cpp
# src/g_shared/a_dynlight.h
# src/hwrenderer/dynlights/hw_dynlightdata.cpp
# src/hwrenderer/dynlights/hw_dynlightdata.h
# src/hwrenderer/scene/hw_renderhacks.cpp
# src/namedef.h
# src/scripting/thingdef_data.cpp
# src/swrenderer/line/r_walldraw.cpp
# Conflicts:
# src/d_main.cpp
# src/g_levellocals.h
# src/g_shared/a_dynlight.cpp
# src/g_shared/a_dynlight.h
# src/gl/dynlights/gl_dynlight.h
# src/gl/dynlights/gl_dynlight1.cpp
# src/gl/scene/gl_spritelight.cpp
# src/gl/scene/gl_walls.cpp
# src/hwrenderer/dynlights/hw_shadowmap.cpp
# src/hwrenderer/dynlights/hw_shadowmap.h
# src/hwrenderer/scene/hw_flats.cpp
# src/p_setup.cpp
Actors get initialized from their defaults so anything done in the constructor or some explicit member initialization will be overwritten.
They must use their properties for setting up configurable fields and do the rest in BeginPlay.
CMakeFiles/zdoom.dir/r_utility.cpp.o: In function `R_SetupFrame(FRenderViewpoint&, FViewWindow&, AActor*)':
/home/travis/build/coelckers/gzdoom/src/r_utility.cpp:832: undefined reference to `AActor::GetCameraHeight() const'
CMakeFiles/zdoom.dir/g_shared/a_action.cpp.o: In function `A_Unblock(AActor*, bool)':
/home/travis/build/coelckers/gzdoom/src/g_shared/a_action.cpp:64: undefined reference to `AActor::GetDropItems() const'
The easiest part was the type checks which could be changed to the name variant with a global search and replace.
# Conflicts:
# src/hwrenderer/scene/hw_sprites.cpp
# Conflicts:
# src/hwrenderer/scene/hw_sprites.cpp
- moved the ALTHUDCF parser PClass::StaticInit, so that it gets done right after creating the actor definitions.
All left to do is not to reallocate the AltHud object for each frame but store it in a better suited place.
# Conflicts:
# src/d_main.cpp
# Conflicts:
# src/info.cpp
- offloaded key list generation for alternative HUD to non-UI parts.
This change also revealed a problem with handling empty sprites in the key list so this got fixed, too.
# Conflicts:
# src/g_shared/shared_hud.cpp
This seriously needs to be independent from the data store and better abstracted. More work to come to move this to its proper place.
# Conflicts:
# src/g_inventory/a_pickups.cpp