Hey it almost works

This commit is contained in:
Pieter-Jan Briers
2017-02-04 01:00:12 +01:00
parent d0a574ff21
commit aeb057579e
23 changed files with 68 additions and 78 deletions
+5 -6
View File
@@ -7,13 +7,12 @@
icon = LIGHTING_ICON
color = LIGHTING_BASE_MATRIX
#warn [insert crashing airplane noise here]
plane = LIGHTING_PLANE
mouse_opacity = 0
layer = LIGHTING_LAYER
invisibility = INVISIBILITY_LIGHTING
blend_mode = BLEND_MULTIPLY
blend_mode = BLEND_OVERLAY
var/needs_update = FALSE
@@ -80,10 +79,10 @@
var/max = max(cr.cache_mx, cg.cache_mx, cb.cache_mx, ca.cache_mx)
color = list(
cr.cache_r, cr.cache_g, cr.cache_b, 0,
cg.cache_r, cg.cache_g, cg.cache_b, 0,
cb.cache_r, cb.cache_g, cb.cache_b, 0,
ca.cache_r, ca.cache_g, ca.cache_b, 0,
1-cr.cache_r, 1-cr.cache_g, 1-cr.cache_b, 0,
1-cg.cache_r, 1-cg.cache_g, 1-cg.cache_b, 0,
1-cb.cache_r, 1-cb.cache_g, 1-cb.cache_b, 0,
1-ca.cache_r, 1-ca.cache_g, 1-ca.cache_b, 0,
0, 0, 0, 1
)
luminosity = max > LIGHTING_SOFT_THRESHOLD
+2 -5
View File
@@ -92,10 +92,7 @@
top_atom = new_top_atom
if (top_atom != source_atom)
if(!top_atom.light_sources)
top_atom.light_sources = list()
top_atom.light_sources += src // Add ourselves to the light sources of our new top atom.
LAZYADD(src, top_atom.light_sources) // Add ourselves to the light sources of our new top atom.
EFFECT_UPDATE
@@ -121,7 +118,7 @@
top_atom = source_atom
. = 1
if (istype(top_atom, /turf))
if (isturf(top_atom))
if (source_turf != top_atom)
source_turf = top_atom
. = 1
+10
View File
@@ -61,6 +61,16 @@
return CLAMP01(totallums)
// Returns a boolean whether the turf is on soft lighting.
// Soft lighting being the threshold at which point the overlay considers
// itself as too dark to allow sight and see_in_dark becomes useful.
// So basically if this returns true the tile is unlit black.
/turf/proc/is_softly_lit()
if (!lighting_overlay)
return FALSE
return !lighting_overlay.luminosity
// Can't think of a good name, this proc will recalculate the has_opaque_atom variable.
/turf/proc/recalc_atom_opacity()
has_opaque_atom = FALSE