Files
Aurora.3/code/_helpers/overlay.dm
Lohikar 6ef9191275 Kill airlocks' process(), SSpower, and misc. performance tweaks (#2175)
changes:

Airlocks no longer tick (exceptions: firedoors, uranium airlocks)
Airlock commands run before round-start are queued to run at round-start.
Airlock commands that failed to run are scheduled to try again in 2 seconds with timers.
Callbacks can now be registered with SSticker to run at round-start in a non-blocking way.
Added a new subsystem (SSpower) for handling power-related functions. Currently doesn't do a whole lot, but this will likely eventually change.
RCON functionality has been moved from SSmachinery to SSpower.
The global cable list has been moved into SSpower.
Powernet sensors no longer process purely to keep themselves in the global machines list, instead they are added to a list in SSpower.
Power terminals no longer pointlessly tick.
Removed some variables from SSticker that weren't used by anything.
Holographic overlays such as those used by consoles are now cached.
Xenoarcheology setup is now tick-checked.
ZAS now uses post-fire timing.
The req_access and req_one_access lists are no longer initialized by default on all /obj types.
Openturfs will only emit starlight if they are bordering a non-openturf dynamically lit turf.
Powernets are now stored in SSpower instead of being a global.
The global mouse list is now stored in SSmob instead of being a global.
Fixed some weirdness in APCs' Destroy() caused by a merge.
SSwireless now pre-bakes to reduce round-start processing.
SSwireless no longer uses processing queues.
2017-05-11 22:19:51 +03:00

55 lines
1.5 KiB
Plaintext

// Factor/Opacity values are defined in __defines\lighting.dm
/proc/holographic_overlay(obj/target, icon, icon_state)
if (!icon || !icon_state)
CRASH("Invalid parameters.")
var/list/m_cache = SSoverlays.holo_multiplier_cache
var/list/m_cache_icon
var/image/multiply
if (m_cache[icon])
m_cache_icon = m_cache[icon]
multiply = m_cache_icon[icon_state]
else
m_cache_icon = list()
m_cache[icon] = m_cache_icon
if (!multiply)
multiply = make_screen_overlay(icon, icon_state)
multiply.blend_mode = BLEND_MULTIPLY
multiply.color = list(
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
HOLOSCREEN_MULTIPLICATION_FACTOR, HOLOSCREEN_MULTIPLICATION_FACTOR, HOLOSCREEN_MULTIPLICATION_FACTOR, HOLOSCREEN_MULTIPLICATION_OPACITY
)
m_cache_icon[icon_state] = multiply
var/list/a_cache = SSoverlays.holo_adder_cache
var/list/a_cache_icon = a_cache[icon]
var/image/overlay
if (!a_cache_icon)
a_cache_icon = list()
a_cache[icon] = a_cache_icon
else
overlay = a_cache_icon[icon_state]
if (!overlay)
overlay = make_screen_overlay(icon, icon_state, HOLOSCREEN_ADDITION_OPACITY)
overlay.blend_mode = BLEND_ADD
a_cache_icon[icon_state] = overlay
target.add_overlay(list(multiply, overlay))
/proc/make_screen_overlay(icon, icon_state, brightness_factor = null)
var/image/overlay = image(icon, icon_state)
overlay.layer = LIGHTING_LAYER + 0.1
if (brightness_factor)
overlay.color = list(
brightness_factor, 0, 0, 0,
0, brightness_factor, 0, 0,
0, 0, brightness_factor, 0,
0, 0, 0, 1
)
return overlay