From 320e481677a06f4fc5cc244fc0e9a45313e56a30 Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Sat, 20 Jun 2015 14:55:53 +0200 Subject: [PATCH] Alright --- code/__DEFINES/lighting.dm | 2 +- code/game/turfs/turf.dm | 4 +++- code/modules/lighting/light_source.dm | 25 +++++++++++++++-------- code/modules/lighting/lighting_process.dm | 4 ++-- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/code/__DEFINES/lighting.dm b/code/__DEFINES/lighting.dm index 1f30f7ff9ef..3a33365efd4 100644 --- a/code/__DEFINES/lighting.dm +++ b/code/__DEFINES/lighting.dm @@ -12,4 +12,4 @@ #ifdef LIGHTING_TRANSITIONS #define LIGHTING_TRANSITION_SPEED (LIGHTING_INTERVAL - 1) #endif -#define LIGHTING_ROUND_VALUE 1 / 128 //Value used to round lumcounts, values smaller than 1/255 don't matter (if they do, thanks sinking points), greater values will make lighting less precise, but in turn increase performance, VERY SLIGHTLY. +#define LIGHTING_ROUND_VALUE (1 / 128) //Value used to round lumcounts, values smaller than 1/255 don't matter (if they do, thanks sinking points), greater values will make lighting less precise, but in turn increase performance, VERY SLIGHTLY. diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 118f63530ea..0392140834c 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -37,7 +37,9 @@ spawn( 0 ) src.Entered(AM) return - return + + if(!dynamic_lighting) + luminosity = 1 // Adds the adjacent turfs to the current atmos processing /turf/Del() diff --git a/code/modules/lighting/light_source.dm b/code/modules/lighting/light_source.dm index 27f23187ba8..854fddcc2ce 100644 --- a/code/modules/lighting/light_source.dm +++ b/code/modules/lighting/light_source.dm @@ -60,15 +60,14 @@ if(top_atom != source_atom) if(!top_atom.light_sources) top_atom.light_sources = list() top_atom.light_sources += src - lighting_update_lights += src - if(!needs_update) + if(!needs_update) //Incase we're already updating either way. lighting_update_lights += src needs_update = 1 /datum/light_source/proc/force_update() force_update = 1 - if(!needs_update) + if(!needs_update) //Incase we're already updating either way. needs_update = 1 lighting_update_lights += src @@ -157,7 +156,11 @@ effect_g[T.lighting_overlay] = round(lum_g * strength, LIGHTING_ROUND_VALUE) effect_b[T.lighting_overlay] = round(lum_b * strength, LIGHTING_ROUND_VALUE) - T.lighting_overlay.update_lumcount(effect_r[T.lighting_overlay], effect_g[T.lighting_overlay], effect_b[T.lighting_overlay]) + T.lighting_overlay.update_lumcount( + round(lum_r * strength, LIGHTING_ROUND_VALUE), + round(lum_g * strength, LIGHTING_ROUND_VALUE), + round(lum_b * strength, LIGHTING_ROUND_VALUE) + ) if(!T.affecting_lights) T.affecting_lights = list() @@ -174,7 +177,11 @@ effect_g[L] = round(lum_g * strength, LIGHTING_ROUND_VALUE) effect_b[L] = round(lum_b * strength, LIGHTING_ROUND_VALUE) - L.update_lumcount(effect_r[L], effect_g[L], effect_b[L]) + L.update_lumcount( + round(lum_r * strength, LIGHTING_ROUND_VALUE), + round(lum_g * strength, LIGHTING_ROUND_VALUE), + round(lum_b * strength, LIGHTING_ROUND_VALUE) + ) if(!T.affecting_lights) T.affecting_lights = list() @@ -198,7 +205,7 @@ #endif - effect_r.len = 0 - effect_g.len = 0 - effect_b.len = 0 - effect_turf.len = 0 + effect_r.Cut() + effect_g.Cut() + effect_b.Cut() + effect_turf.Cut() diff --git a/code/modules/lighting/lighting_process.dm b/code/modules/lighting/lighting_process.dm index 6c771f679f9..3159cfcd852 100644 --- a/code/modules/lighting/lighting_process.dm +++ b/code/modules/lighting/lighting_process.dm @@ -16,7 +16,7 @@ scheck() - lighting_update_lights.len = 0 + lighting_update_lights.Cut() for(var/atom/movable/lighting_overlay/O in lighting_update_overlays) if(O.needs_update) @@ -25,4 +25,4 @@ scheck() - lighting_update_overlays.len = 0 \ No newline at end of file + lighting_update_overlays.Cut() \ No newline at end of file