Skip to content

Commit

Permalink
add: Experimental lighting perfomance fix (#6238) [testmerge][4c8b3e2]
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 18, 2024
1 parent 738cd48 commit 7b4ef06
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 17 deletions.
9 changes: 1 addition & 8 deletions code/game/area/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
icon_state = "unknown"
layer = AREA_LAYER
plane = AREA_PLANE //Keeping this on the default plane, GAME_PLANE, will make area overlays fail to render on FLOOR_PLANE.
luminosity = 0
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
invisibility = INVISIBILITY_LIGHTING

Expand Down Expand Up @@ -119,17 +118,11 @@
base_lighting_color = null
static_lighting = TRUE


if(requires_power)
luminosity = 0
else
if(!requires_power)
power_light = TRUE
power_equip = TRUE
power_environ = TRUE

if(static_lighting)
luminosity = 0

. = ..()

if(!static_lighting)
Expand Down
1 change: 0 additions & 1 deletion code/modules/lighting/lighting_area.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ GLOBAL_LIST_INIT_TYPED(fullbright_overlays, /mutable_appearance, list(create_ful
add_overlay(lighting_effects[1])
var/list/z_offsets = SSmapping.z_level_to_plane_offset
for(var/turf/T in src)
T.luminosity = 1
// This outside loop is EXTREMELY hot because it's run by space tiles. Don't want no part in that
// We will only add overlays to turfs not on the first z layer, because that's a significantly lesser portion
// And we need to do them separate, or lighting will go fuckey
Expand Down
5 changes: 1 addition & 4 deletions code/modules/lighting/lighting_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ GLOBAL_LIST_EMPTY(default_lighting_underlays_by_z)
stack_trace("a lighting object was assigned to a turf that already had a lighting object!")

affected_turf.lighting_object = src
affected_turf.luminosity = 0

// This path is really hot. this is faster
// Really this should be a global var or something, but lets not think about that yes?
Expand All @@ -59,7 +58,6 @@ GLOBAL_LIST_EMPTY(default_lighting_underlays_by_z)
SSlighting.objects_queue -= src
if (isturf(affected_turf))
affected_turf.lighting_object = null
affected_turf.luminosity = 1
affected_turf = null
return ..()

Expand Down Expand Up @@ -109,8 +107,7 @@ GLOBAL_LIST_EMPTY(default_lighting_underlays_by_z)
alpha_corner.cache_r, alpha_corner.cache_g, alpha_corner.cache_b, 00,
00, 00, 00, 01
)

affected_turf.luminosity = set_luminosity

SSdemo.mark_turf(affected_turf)


Expand Down
4 changes: 0 additions & 4 deletions code/modules/lighting/lighting_source.dm
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,6 @@

if(source_turf)
var/uses_multiz = !!GET_LOWEST_STACK_OFFSET(source_turf.z)
var/oldlum = source_turf.luminosity
source_turf.luminosity = CEILING(light_range, 1)
if(uses_multiz)
for(var/turf/T in view(CEILING(light_range, 1), source_turf))
if(IS_OPAQUE_TURF(T))
Expand Down Expand Up @@ -311,8 +309,6 @@
INSERT_CORNERS(corners, T)
SSdemo.mark_turf(T)

source_turf.luminosity = oldlum

SETUP_CORNERS_CACHE(src)

var/list/datum/lighting_corner/new_corners = (corners - src.effect_str)
Expand Down

0 comments on commit 7b4ef06

Please sign in to comment.