Cache light fixture overlays (#3948)

changes:

Light fixture overlays are now cached.
BlendRGB is now cached (used by light fixture overlays)
Nightmode now only tints the bulb instead of both the bulb and the fixture itself.
This commit is contained in:
Lohikar
2017-12-09 16:17:09 -06:00
committed by Erki
parent b58a3037c1
commit 81685214df
4 changed files with 26 additions and 16 deletions
@@ -63,6 +63,10 @@
var/list/ao_cache = list()
var/list/light_fixture_cache = list()
var/list/rgb_blend_cache = list() // not an icon per-se, but this proc could be expensive so we might as well cache it.
/datum/controller/subsystem/icon_cache/New()
NEW_SS_GLOBAL(SSicon_cache)
@@ -85,3 +89,8 @@
uniform_states = list()
for (var/i in icon_states('icons/mob/uniform.dmi'))
uniform_states[i] = TRUE
/datum/controller/subsystem/icon_cache/proc/generate_color_variant(icon/icon, icon_state, color)
var/image/I = new(icon, icon_state)
I.color = color
return I