From ac819a17f2ecfdcc0ccaa44eae5a3f659b6bfcd6 Mon Sep 17 00:00:00 2001 From: Tacolizard Date: Fri, 6 Jan 2017 22:40:27 -0800 Subject: [PATCH] Removes animation on lighting changes, increases light max radii (#22754) * change light update speed * lower dynamic light max radius vals * wew i actually improved the code for once * remove define * mso's wish is my command * yeh biatch * found one --- code/__DEFINES/lighting.dm | 3 +-- code/modules/lighting/lighting_system.dm | 13 +++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/code/__DEFINES/lighting.dm b/code/__DEFINES/lighting.dm index 1fdbfaee663..53ad3d038c3 100644 --- a/code/__DEFINES/lighting.dm +++ b/code/__DEFINES/lighting.dm @@ -5,7 +5,6 @@ #define LIGHTING_CAP_FRAC (255/LIGHTING_CAP) //A precal'd variable we'll use in turf/redraw_lighting() #define LIGHTING_ICON 'icons/effects/alphacolors.dmi' #define LIGHTING_ICON_STATE "" -#define LIGHTING_TIME 2 //Time to do any lighting change. Actual number pulled out of my ass #define LIGHTING_DARKEST_VISIBLE_ALPHA 250 //Anything darker than this is so dark, we'll just consider the whole tile unlit #define LIGHTING_LUM_FOR_FULL_BRIGHT 6 //Anything who's lum is lower then this starts off less bright. #define LIGHTING_MIN_RADIUS 4 //Lowest radius a light source can effect. @@ -13,4 +12,4 @@ //different modes that lights can operate in #define LIGHTING_REGULAR 1 //Apply all effects additively -#define LIGHTING_STARLIGHT 2 //Track all starlight but only apply brightest \ No newline at end of file +#define LIGHTING_STARLIGHT 2 //Track all starlight but only apply brightest diff --git a/code/modules/lighting/lighting_system.dm b/code/modules/lighting/lighting_system.dm index 03f4a78319e..e1ab7457b39 100644 --- a/code/modules/lighting/lighting_system.dm +++ b/code/modules/lighting/lighting_system.dm @@ -313,7 +313,7 @@ else if(!lighting_object) lighting_object = new (src) - redraw_lighting(1) + redraw_lighting() for(var/turf/open/space/T in RANGE_TURFS(1,src)) T.update_starlight() @@ -324,7 +324,7 @@ if(lighting_object) lighting_object.PutOut() -/turf/proc/redraw_lighting(instantly = 0) +/turf/proc/redraw_lighting() if(lighting_object) var/newalpha if(lighting_lumcount <= 0) @@ -338,10 +338,7 @@ if(newalpha >= LIGHTING_DARKEST_VISIBLE_ALPHA) newalpha = 255 if(lighting_object.alpha != newalpha) - if(instantly) - lighting_object.alpha = newalpha - else - animate(lighting_object, alpha = newalpha, time = LIGHTING_TIME) + lighting_object.alpha = newalpha if(newalpha >= LIGHTING_DARKEST_VISIBLE_ALPHA) luminosity = 0 lighting_object.luminosity = 0 @@ -390,8 +387,8 @@ #define LIGHTING_MAX_LUMINOSITY_STATIC 8 //Maximum luminosity to reduce lag. -#define LIGHTING_MAX_LUMINOSITY_MOBILE 7 //Moving objects have a lower max luminosity since these update more often. (lag reduction) -#define LIGHTING_MAX_LUMINOSITY_MOB 6 +#define LIGHTING_MAX_LUMINOSITY_MOBILE 8 //Moving objects have a lower max luminosity since these update more often. (lag reduction) +#define LIGHTING_MAX_LUMINOSITY_MOB 8 #define LIGHTING_MAX_LUMINOSITY_TURF 8 //turfs are static too, why was this 1?! //caps luminosity effects max-range based on what type the light's owner is.