Processor-driven effects system & Minor Lighting Performance Tweaks (#1697)

Adds a new process-based effects system with the goal of reducing insane lag from sparks.
Currently only supports sparks, but should be easily extendable to other types of effects.
Also fixes a bug with airlocks where the light from bolts wasn't updating.

Refactors bears slightly to reduce duplicated code & pointless spark object creation and destruction.
Lighting profiler will now log /turf locations & names correctly.
Doors will no longer trigger way more visibility checks than they need to.
This commit is contained in:
Lohikar
2017-02-04 03:34:13 +02:00
committed by skull132
parent 6a1fecbd2a
commit f544fe43b1
24 changed files with 393 additions and 170 deletions
@@ -0,0 +1,25 @@
/*
/datum/effect_system
var/atom/movable/holder
- The atom that this effect_system is attached to.
var/no_del
- If this effect_system should be deleted at end of processing.
/datum/effect_system/New(var/queue = TRUE, var/persistant = FALSE)
- queue: if the effect should be queued for processing after creation
- persistent: if the effect should not be destroyed at the end of processing.
/datum/effect_system/proc/queue()
- Called when the object is queued for update. Overriding procs should call ..()
/datum/effect_system/proc/process()
- Called when the processor processes this effect.
Return ..() to allow default behavior of self-destroying after one tick.
Alternately; EFFECT_HALT, EFFECT_CONTINUE, and EFFECT_DESTROY can be used to tell the processor what to do with the object.
/datum/effect_system/proc/bind(var/target)
- Binds this effect_system to an object and prevents it from being destroyed by the collector, assuming the derived class returns ..() on process().
*/