mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Merge branch 'master' of https://github.com/PolarisSS13/Polaris into aro-sync-04252018
# Conflicts: # README.md # code/game/jobs/job/job.dm # code/modules/client/preference_setup/loadout/loadout_utility.dm # code/modules/mob/living/carbon/human/examine.dm # code/modules/mob/living/carbon/human/npcs.dm # code/modules/mob/living/carbon/human/species/station/prometheans.dm # html/changelogs/.all_changelog.yml # maps/RandomZLevels/Academy.dmm # maps/RandomZLevels/beach.dmm # maps/RandomZLevels/blackmarketpackers.dmm # maps/RandomZLevels/challenge.dmm # maps/RandomZLevels/example.dmm # maps/RandomZLevels/jungle.dmm # maps/RandomZLevels/listeningpost.dmm # maps/RandomZLevels/spacebattle.dmm # maps/RandomZLevels/stationCollision.dmm # maps/RandomZLevels/wildwest.dmm # maps/RandomZLevels/zresearchlabs.dmm # maps/northern_star/polaris-1.dmm # maps/southern_cross/southern_cross-1.dmm # maps/southern_cross/southern_cross-3.dmm # maps/southern_cross/southern_cross-6.dmm # maps/southern_cross/southern_cross-7.dmm # maps/submaps/surface_submaps/mountains/CrashedMedShuttle1.dmm # maps/submaps/surface_submaps/plains/Boathouse.dmm # maps/submaps/surface_submaps/wilderness/Blackshuttledown.dmm # maps/submaps/surface_submaps/wilderness/Boombase.dmm # maps/submaps/surface_submaps/wilderness/DJOutpost1.dmm # maps/submaps/surface_submaps/wilderness/DecoupledEngine.dmm # maps/submaps/surface_submaps/wilderness/Drugden.dmm # maps/submaps/surface_submaps/wilderness/Rockybase.dmm # maps/submaps/surface_submaps/wilderness/Shack1.dmm # maps/virgo/virgo-6.dmm # vorestation.dme
This commit is contained in:
@@ -61,14 +61,40 @@ var/datum/controller/process/planet/planet_controller = null
|
||||
//Sun light needs changing
|
||||
if(P.needs_work & PLANET_PROCESS_SUN)
|
||||
P.needs_work &= ~PLANET_PROCESS_SUN
|
||||
//Redraw sun overlay
|
||||
var/new_range = P.sun["range"]
|
||||
// Remove old value from corners
|
||||
var/list/sunlit_corners = P.sunlit_corners
|
||||
var/old_lum_r = -P.sun["lum_r"]
|
||||
var/old_lum_g = -P.sun["lum_g"]
|
||||
var/old_lum_b = -P.sun["lum_b"]
|
||||
if(old_lum_r || old_lum_g || old_lum_b)
|
||||
for(var/C in P.sunlit_corners)
|
||||
var/datum/lighting_corner/LC = C
|
||||
LC.update_lumcount(old_lum_r, old_lum_g, old_lum_b)
|
||||
SCHECK
|
||||
sunlit_corners.Cut()
|
||||
|
||||
// Calculate new values to apply
|
||||
var/new_brightness = P.sun["brightness"]
|
||||
var/new_color = P.sun["color"]
|
||||
for(var/T in P.planet_floors)
|
||||
var/turf/simulated/turf = T
|
||||
turf.set_light(new_range, new_brightness, new_color)
|
||||
var/lum_r = new_brightness * GetRedPart (new_color) / 255
|
||||
var/lum_g = new_brightness * GetGreenPart(new_color) / 255
|
||||
var/lum_b = new_brightness * GetBluePart (new_color) / 255
|
||||
var/static/update_gen = -1 // Used to prevent double-processing corners. Otherwise would happen when looping over adjacent turfs.
|
||||
for(var/I in P.planet_floors)
|
||||
var/turf/simulated/T = I
|
||||
if(!T.lighting_corners_initialised)
|
||||
T.generate_missing_corners()
|
||||
for(var/C in T.get_corners())
|
||||
var/datum/lighting_corner/LC = C
|
||||
if(LC.update_gen != update_gen && LC.active)
|
||||
sunlit_corners += LC
|
||||
LC.update_gen = update_gen
|
||||
LC.update_lumcount(lum_r, lum_g, lum_b)
|
||||
SCHECK
|
||||
update_gen--
|
||||
P.sun["lum_r"] = lum_r
|
||||
P.sun["lum_g"] = lum_g
|
||||
P.sun["lum_b"] = lum_b
|
||||
|
||||
//Temperature needs updating
|
||||
if(P.needs_work & PLANET_PROCESS_TEMP)
|
||||
|
||||
Reference in New Issue
Block a user