mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Speeds up lighting initialization
This commit is contained in:
@@ -71,4 +71,12 @@
|
||||
#define LIGHTING_PLANE_ALPHA_VISIBLE 255
|
||||
#define LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE 192
|
||||
#define LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE 128 //For lighting alpha, small amounts lead to big changes. even at 128 its hard to figure out what is dark and what is light, at 64 you almost can't even tell.
|
||||
#define LIGHTING_PLANE_ALPHA_INVISIBLE 0
|
||||
#define LIGHTING_PLANE_ALPHA_INVISIBLE 0
|
||||
|
||||
//lighting area defines
|
||||
#define DYNAMIC_LIGHTING_DISABLED 0 //dynamic lighting disabled (area stays at full brightness)
|
||||
#define DYNAMIC_LIGHTING_ENABLED 1 //dynamic lighting enabled
|
||||
#define DYNAMIC_LIGHTING_FORCED 2 //dynamic lighting enabled even if the area doesn't require power
|
||||
#define DYNAMIC_LIGHTING_IFSTARLIGHT 3 //dynamic lighting enabled only if starlight is.
|
||||
#define IS_DYNAMIC_LIGHTING_CONFIGURED(A, config_setting) ( A.dynamic_lighting == DYNAMIC_LIGHTING_IFSTARLIGHT ? config_setting : A.dynamic_lighting )
|
||||
#define IS_DYNAMIC_LIGHTING(A) IS_DYNAMIC_LIGHTING_CONFIGURED(A, config.starlight)
|
||||
@@ -216,13 +216,6 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache)
|
||||
|
||||
|
||||
|
||||
//lighting area defines
|
||||
#define DYNAMIC_LIGHTING_DISABLED 0 //dynamic lighting disabled (area stays at full brightness)
|
||||
#define DYNAMIC_LIGHTING_ENABLED 1 //dynamic lighting enabled
|
||||
#define DYNAMIC_LIGHTING_FORCED 2 //dynamic lighting enabled even if the area doesn't require power
|
||||
#define DYNAMIC_LIGHTING_IFSTARLIGHT 3 //dynamic lighting enabled only if starlight is.
|
||||
#define IS_DYNAMIC_LIGHTING(A) ( A.dynamic_lighting == DYNAMIC_LIGHTING_IFSTARLIGHT ? config.starlight : A.dynamic_lighting )
|
||||
|
||||
//subtypesof(), typesof() without the parent path
|
||||
#define subtypesof(typepath) ( typesof(typepath) - typepath )
|
||||
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
/proc/create_all_lighting_objects()
|
||||
for (var/zlevel = 1 to world.maxz)
|
||||
create_lighting_objects_zlevel(zlevel)
|
||||
var/config_dynamic_lighting = config.starlight
|
||||
for(var/I in GLOB.sortedAreas)
|
||||
var/area/A = I
|
||||
|
||||
/proc/create_lighting_objects_zlevel(zlevel)
|
||||
ASSERT(zlevel)
|
||||
var/turf/T
|
||||
var/thing
|
||||
for (thing in block(locate(1, 1, zlevel), locate(world.maxx, world.maxy, zlevel)))
|
||||
T = thing
|
||||
if (!IS_DYNAMIC_LIGHTING(T))
|
||||
if(!IS_DYNAMIC_LIGHTING_CONFIGURED(A, config_dynamic_lighting))
|
||||
continue
|
||||
|
||||
var/area/A = T.loc
|
||||
if (!IS_DYNAMIC_LIGHTING(A))
|
||||
continue
|
||||
for(var/J in A)
|
||||
var/turf/T = J
|
||||
|
||||
new/atom/movable/lighting_object(T, TRUE)
|
||||
if(!IS_DYNAMIC_LIGHTING_CONFIGURED(T, config_dynamic_lighting))
|
||||
continue
|
||||
|
||||
new/atom/movable/lighting_object(T, TRUE)
|
||||
CHECK_TICK
|
||||
CHECK_TICK
|
||||
|
||||
Reference in New Issue
Block a user