-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #578 from LLA-Gaming/development
Development
- Loading branch information
Showing
153 changed files
with
2,424 additions
and
2,323 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
//Bay lighting engine shit, not in /code/modules/lighting because BYOND is being shit about it | ||
#define LIGHTING_INTERVAL 5 // frequency, in 1/10ths of a second, of the lighting process | ||
|
||
#ifndef LIGHTING_INSTANT_UPDATES | ||
#define LIGHTING_INTERVAL 5 // Frequency, in 1/10ths of a second, of the lighting process. | ||
#endif | ||
|
||
#define LIGHTING_FALLOFF 1 // type of falloff to use for lighting; 1 for circular, 2 for square | ||
#define LIGHTING_LAMBERTIAN 0 // use lambertian shading for light sources | ||
#define LIGHTING_HEIGHT 1 // height off the ground of light sources on the pseudo-z-axis, you should probably leave this alone | ||
#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_LAYER 10 // drawing layer for lighting overlays | ||
|
||
#define LIGHTING_ICON 'icons/effects/lighting_overlay.png' // icon used for lighting shading effects | ||
|
||
#define LIGHTING_SOFT_THRESHOLD 0.05 // If the max of the lighting lumcounts of each spectrum drops below this, disable luminosity on the lighting overlays. | ||
|
||
// If I were you I'd leave this alone. | ||
#define LIGHTING_BASE_MATRIX \ | ||
list \ | ||
( \ | ||
LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, 0, \ | ||
LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, 0, \ | ||
LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, 0, \ | ||
LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, LIGHTING_SOFT_THRESHOLD, 0, \ | ||
0, 0, 0, 1 \ | ||
) \ | ||
|
||
// Helpers so we can (more easily) control the colour matrices. | ||
#define CL_MATRIX_RR 1 | ||
#define CL_MATRIX_RG 2 | ||
#define CL_MATRIX_RB 3 | ||
#define CL_MATRIX_RA 4 | ||
#define CL_MATRIX_GR 5 | ||
#define CL_MATRIX_GG 6 | ||
#define CL_MATRIX_GB 7 | ||
#define CL_MATRIX_GA 8 | ||
#define CL_MATRIX_BR 9 | ||
#define CL_MATRIX_BG 10 | ||
#define CL_MATRIX_BB 11 | ||
#define CL_MATRIX_BA 12 | ||
#define CL_MATRIX_AR 13 | ||
#define CL_MATRIX_AG 14 | ||
#define CL_MATRIX_AB 15 | ||
#define CL_MATRIX_AA 16 | ||
#define CL_MATRIX_CR 17 | ||
#define CL_MATRIX_CG 18 | ||
#define CL_MATRIX_CB 19 | ||
#define CL_MATRIX_CA 20 | ||
|
||
//Some defines to generalise colours used in lighting. | ||
//Important note on colors. Colors can end up significantly different from the basic html picture, especially when saturated | ||
#define LIGHT_COLOR_RED "#FA8282" //Warm but extremely diluted red. rgb(250, 130, 130) | ||
#define LIGHT_COLOR_GREEN "#64C864" //Bright but quickly dissipating neon green. rgb(100, 200, 100) | ||
#define LIGHT_COLOR_BLUE "#6496FA" //Cold, diluted blue. rgb(100, 150, 250) | ||
|
||
#define LIGHT_COLOR_CYAN "#7DE1E1" //Diluted cyan. rgb(125, 225, 225) | ||
#define LIGHT_COLOR_PINK "#E17DE1" //Diluted, mid-warmth pink. rgb(225, 125, 225) | ||
#define LIGHT_COLOR_YELLOW "#E1E17D" //Dimmed yellow, leaning kaki. rgb(225, 225, 125) | ||
#define LIGHT_COLOR_BROWN "#966432" //Clear brown, mostly dim. rgb(150, 100, 50) | ||
#define LIGHT_COLOR_ORANGE "#FA9632" //Mostly pure orange. rgb(250, 150, 50) | ||
|
||
//These ones aren't a direct colour like the ones above, because nothing would fit | ||
#define LIGHT_COLOR_FIRE "#FAA019" //Warm orange color, leaning strongly towards yellow. rgb(250, 160, 25) | ||
#define LIGHT_COLOR_FLARE "#FA644B" //Bright, non-saturated red. Leaning slightly towards pink for visibility. rgb(250, 100, 75) | ||
#define LIGHT_COLOR_SLIME_LAMP "#AFC84B" //Weird color, between yellow and green, very slimy. rgb(175, 200, 75) | ||
#define LIGHT_COLOR_TUNGSTEN "#FAE1AF" //Extremely diluted yellow, close to skin color (for some reason). rgb(250, 225, 175) | ||
#define LIGHT_COLOR_HALOGEN "#F0FAFA" //Barely visible cyan-ish hue, as the doctor prescribed. rgb(240, 250, 250) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,48 @@ | ||
/var/list/lighting_update_lights = list() // List of lighting sources queued for update. | ||
/var/list/lighting_update_corners = list() // List of lighting corners queued for update. | ||
/var/list/lighting_update_overlays = list() // List of lighting overlays queued for update. | ||
|
||
/datum/controller/process/lighting/setup() | ||
name = "lighting" | ||
schedule_interval = 5 // every .5 second | ||
lighting_controller.Initialize() | ||
schedule_interval = LIGHTING_INTERVAL | ||
if(config && config.instant_lighting) | ||
schedule_interval = 1 //instant lighting | ||
|
||
create_all_lighting_corners() | ||
create_all_lighting_overlays() | ||
|
||
/datum/controller/process/lighting/doWork() | ||
lighting_controller.lights_workload_max = \ | ||
max(lighting_controller.lights_workload_max, lighting_controller.lights.len) | ||
var/i = 1 | ||
while(i<=lighting_controller.lights.len) | ||
var/datum/light_source/L = lighting_controller.lights[i] | ||
if(L) | ||
if(L.check()) | ||
lighting_controller.lights.Remove(L) | ||
|
||
scheck() | ||
i++ | ||
continue | ||
lighting_controller.lights.Cut(i,i+1) | ||
|
||
lighting_controller.changed_turfs_workload_max = \ | ||
max(lighting_controller.changed_turfs_workload_max, lighting_controller.changed_turfs.len) | ||
i = 1 | ||
while(i<=lighting_controller.changed_turfs.len) | ||
var/turf/T = lighting_controller.changed_turfs[i] | ||
if(T) | ||
if(T.lighting_changed) | ||
T.shift_to_subarea() | ||
|
||
scheck() | ||
i++ | ||
continue | ||
lighting_controller.changed_turfs.Cut(i,i+1) | ||
|
||
if(lighting_controller.changed_turfs && lighting_controller.changed_turfs.len) | ||
lighting_controller.changed_turfs.Cut() // reset the changed list | ||
|
||
var/list/lighting_update_lights_old = lighting_update_lights //We use a different list so any additions to the update lists during a delay from scheck() don't cause things to be cut from the list without being updated. | ||
lighting_update_lights = list() | ||
for(var/datum/light_source/L in lighting_update_lights_old) | ||
if(L.check() || L.destroyed || L.force_update) | ||
L.remove_lum() | ||
if(!L.destroyed) | ||
L.apply_lum() | ||
|
||
else if(L.vis_update) //We smartly update only tiles that became (in) visible to use. | ||
L.smart_vis_update() | ||
|
||
L.vis_update = FALSE | ||
L.force_update = FALSE | ||
L.needs_update = FALSE | ||
|
||
scheck() | ||
|
||
var/list/lighting_update_corners_old = lighting_update_corners //Same as above. | ||
lighting_update_corners = list() | ||
for(var/A in lighting_update_corners_old) | ||
var/datum/lighting_corner/C = A | ||
|
||
C.update_overlays() | ||
|
||
C.needs_update = FALSE | ||
|
||
var/list/lighting_update_overlays_old = lighting_update_overlays //Same as above. | ||
lighting_update_overlays = list() | ||
|
||
for(var/atom/movable/lighting_overlay/O in lighting_update_overlays_old) | ||
O.update_overlay() | ||
O.needs_update = 0 | ||
scheck() |
Oops, something went wrong.