diff --git a/code/__DEFINES/layers.dm b/code/__DEFINES/layers.dm index 9350116635..9f0fdc27b2 100644 --- a/code/__DEFINES/layers.dm +++ b/code/__DEFINES/layers.dm @@ -6,6 +6,7 @@ #define PLANE_SPACE -95 #define PLANE_SPACE_PARALLAX -90 +#define FLOOR_PLANE -2 #define GAME_PLANE -1 #define BLACKNESS_PLANE 0 //To keep from conflicts with SEE_BLACKNESS internals #define SPACE_LAYER 1.8 diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 3267a43d5a..3cb143108d 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -445,3 +445,6 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE #define NO_INIT_PARAMETER "no-init" #define EGG_LAYING_MESSAGES list("lays an egg.","squats down and croons.","begins making a huge racket.","begins clucking raucously.") + +//Filters +#define AMBIENT_OCCLUSION filter(type="drop_shadow", x=0, y=-2, size=4, border=4, color="#04080FAA") diff --git a/code/_onclick/hud/plane_master.dm b/code/_onclick/hud/plane_master.dm index f0c56b84ac..6b9a02c009 100644 --- a/code/_onclick/hud/plane_master.dm +++ b/code/_onclick/hud/plane_master.dm @@ -16,12 +16,22 @@ //Trust me, you need one. Period. If you don't think you do, you're doing something extremely wrong. /obj/screen/plane_master/proc/backdrop(mob/mymob) +/obj/screen/plane_master/floor + name = "floor plane master" + plane = FLOOR_PLANE + appearance_flags = PLANE_MASTER + blend_mode = BLEND_OVERLAY + /obj/screen/plane_master/game_world name = "game world plane master" plane = GAME_PLANE appearance_flags = PLANE_MASTER //should use client color blend_mode = BLEND_OVERLAY +/obj/screen/plane_master/game_world/backdrop(mob/mymob) + if(istype(mymob) && mymob.client && mymob.client.prefs && mymob.client.prefs.ambientocclusion) + filters += AMBIENT_OCCLUSION + /obj/screen/plane_master/lighting name = "lighting plane master" plane = LIGHTING_PLANE diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 87894dd4d7..85a0fd1d4e 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -7,6 +7,7 @@ icon = 'icons/turf/areas.dmi' icon_state = "unknown" layer = AREA_LAYER + plane = BLACKNESS_PLANE //Keeping this on the default plane, GAME_PLANE, will make area overlays fail to render on FLOOR_PLANE. mouse_opacity = MOUSE_OPACITY_TRANSPARENT invisibility = INVISIBILITY_LIGHTING @@ -518,4 +519,4 @@ GLOBAL_LIST_EMPTY(teleportlocs) // A hook so areas can modify the incoming args /area/proc/PlaceOnTopReact(list/new_baseturfs, turf/fake_turf_type, flags) - return flags \ No newline at end of file + return flags diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm index 253f18f717..a09db0a3cc 100644 --- a/code/game/machinery/ai_slipper.dm +++ b/code/game/machinery/ai_slipper.dm @@ -4,6 +4,7 @@ icon = 'icons/obj/device.dmi' icon_state = "ai-slipper0" layer = PROJECTILE_HIT_THRESHHOLD_LAYER + plane = FLOOR_PLANE anchored = TRUE max_integrity = 200 armor = list("melee" = 50, "bullet" = 20, "laser" = 20, "energy" = 20, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 30) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index ab2694769f..61ee4eb178 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -32,6 +32,7 @@ Possible to do for anyone motivated enough: desc = "It's a floor-mounted device for projecting holographic images." icon_state = "holopad0" layer = LOW_OBJ_LAYER + plane = FLOOR_PLANE flags_1 = HEAR_1 anchored = TRUE use_power = IDLE_POWER_USE @@ -66,7 +67,7 @@ Possible to do for anyone motivated enough: flags_1 = NODECONSTRUCT_1 on_network = FALSE var/proximity_range = 1 - + /obj/machinery/holopad/tutorial/Initialize(mapload) . = ..() if(proximity_range) @@ -86,7 +87,7 @@ Possible to do for anyone motivated enough: replay_stop() else if(disk && disk.record) replay_start() - + /obj/machinery/holopad/tutorial/HasProximity(atom/movable/AM) if (!isliving(AM)) return @@ -487,7 +488,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ if(QDELETED(user) || user.incapacitated() || !user.client) return FALSE return TRUE - + //Can we display holos there //Area check instead of line of sight check because this is a called a lot if AI wants to move around. /obj/machinery/holopad/proc/validate_location(turf/T,check_los = FALSE) diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 79954693c3..f6182fdae0 100644 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -3,6 +3,7 @@ desc = "It's useful for igniting plasma." icon = 'icons/obj/stationobjs.dmi' icon_state = "igniter0" + plane = FLOOR_PLANE var/id = null var/on = FALSE anchored = TRUE @@ -12,7 +13,7 @@ max_integrity = 300 armor = list("melee" = 50, "bullet" = 30, "laser" = 70, "energy" = 50, "bomb" = 20, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 70) resistance_flags = FIRE_PROOF - + /obj/machinery/igniter/on on = TRUE icon_state = "igniter1" diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index d26dbb72e7..eec91657a9 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -1,5 +1,6 @@ /obj/effect/decal name = "decal" + plane = FLOOR_PLANE anchored = TRUE resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF var/turf_loc_check = TRUE diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index c6273f3049..40435c2000 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -8,6 +8,7 @@ armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 50) max_integrity = 50 layer = LATTICE_LAYER //under pipes + plane = FLOOR_PLANE var/number_of_rods = 1 canSmoothWith = list(/obj/structure/lattice, /turf/open/floor, diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index 02df5ed3fb..2fc582229d 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -1,4 +1,5 @@ /turf/open + plane = FLOOR_PLANE var/slowdown = 0 //negative for faster, positive for slower var/mutable_appearance/wet_overlay diff --git a/code/modules/atmospherics/machinery/components/components_base.dm b/code/modules/atmospherics/machinery/components/components_base.dm index 28148c0364..5dcf95f3cf 100644 --- a/code/modules/atmospherics/machinery/components/components_base.dm +++ b/code/modules/atmospherics/machinery/components/components_base.dm @@ -34,8 +34,10 @@ Iconnery var/turf/T = loc if(level == 2 || !T.intact) showpipe = TRUE + plane = GAME_PLANE else showpipe = FALSE + plane = FLOOR_PLANE if(!showpipe) return //no need to update the pipes if they aren't showing diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 7558380a36..c6ca621a41 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -120,6 +120,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/parallax + var/ambientocclusion = TRUE + var/uplink_spawn_loc = UPLINK_PDA var/list/exp = list() @@ -456,6 +458,27 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "Ghosts of Others: [button_name]
" +<<<<<<< HEAD +======= + dat += "FPS: [clientfps]
" + + dat += "Parallax (Fancy Space): " + switch (parallax) + if (PARALLAX_LOW) + dat += "Low" + if (PARALLAX_MED) + dat += "Medium" + if (PARALLAX_INSANE) + dat += "Insane" + if (PARALLAX_DISABLE) + dat += "Disabled" + else + dat += "High" + dat += "
" + + dat += "Ambient Occlusion: [ambientocclusion ? "Enabled" : "Disabled"]
" + +>>>>>>> cdf36c2... adds ambient occlusion as a client preference (#37406) if (CONFIG_GET(flag/maprotation)) var/p_map = preferred_map if (!p_map) @@ -1535,6 +1558,14 @@ GLOBAL_LIST_EMPTY(preferences_datums) cit_toggles ^= DIGESTION_NOISES //END CITADEL EDIT + if("ambientocclusion") + ambientocclusion = !ambientocclusion + if(parent && parent.screen && parent.screen.len) + var/obj/screen/plane_master/game_world/PM = locate(/obj/screen/plane_master/game_world) in parent.screen + PM.filters -= AMBIENT_OCCLUSION + if(ambientocclusion) + PM.filters += AMBIENT_OCCLUSION + if("save") save_preferences() save_character() diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index d2efc477c6..53f8161a60 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -130,6 +130,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["uses_glasses_colour"]>> uses_glasses_colour S["clientfps"] >> clientfps S["parallax"] >> parallax + S["ambientocclusion"] >> ambientocclusion S["menuoptions"] >> menuoptions S["enable_tips"] >> enable_tips S["tip_delay"] >> tip_delay @@ -160,6 +161,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car toggles = sanitize_integer(toggles, 0, 65535, initial(toggles)) clientfps = sanitize_integer(clientfps, 0, 1000, 0) parallax = sanitize_integer(parallax, PARALLAX_INSANE, PARALLAX_DISABLE, null) + ambientocclusion = sanitize_integer(ambientocclusion, 0, 1, initial(ambientocclusion)) ghost_form = sanitize_inlist(ghost_form, GLOB.ghost_forms, initial(ghost_form)) ghost_orbit = sanitize_inlist(ghost_orbit, GLOB.ghost_orbits, initial(ghost_orbit)) ghost_accs = sanitize_inlist(ghost_accs, GLOB.ghost_accs_options, GHOST_ACCS_DEFAULT_OPTION) @@ -210,6 +212,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["uses_glasses_colour"], uses_glasses_colour) WRITE_FILE(S["clientfps"], clientfps) WRITE_FILE(S["parallax"], parallax) + WRITE_FILE(S["ambientocclusion"], ambientocclusion) WRITE_FILE(S["menuoptions"], menuoptions) WRITE_FILE(S["enable_tips"], enable_tips) WRITE_FILE(S["tip_delay"], tip_delay) diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index 0972f32ad7..9d5c6c5a0f 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -728,7 +728,7 @@ /datum/reagent/toxin/rotatium/on_mob_life(mob/living/M) if(M.hud_used) if(current_cycle >= 20 && current_cycle%20 == 0) - var/list/screens = list(M.hud_used.plane_masters["[GAME_PLANE]"], M.hud_used.plane_masters["[LIGHTING_PLANE]"]) + var/list/screens = list(M.hud_used.plane_masters["[FLOOR_PLANE]"], M.hud_used.plane_masters["[GAME_PLANE]"], M.hud_used.plane_masters["[LIGHTING_PLANE]"]) var/rotation = min(round(current_cycle/20), 89) // By this point the player is probably puking and quitting anyway for(var/whole_screen in screens) animate(whole_screen, transform = matrix(rotation, MATRIX_ROTATE), time = 5, easing = QUAD_EASING, loop = -1) @@ -737,7 +737,7 @@ /datum/reagent/toxin/rotatium/on_mob_delete(mob/living/M) if(M && M.hud_used) - var/list/screens = list(M.hud_used.plane_masters["[GAME_PLANE]"], M.hud_used.plane_masters["[LIGHTING_PLANE]"]) + var/list/screens = list(M.hud_used.plane_masters["[FLOOR_PLANE]"], M.hud_used.plane_masters["[GAME_PLANE]"], M.hud_used.plane_masters["[LIGHTING_PLANE]"]) for(var/whole_screen in screens) animate(whole_screen, transform = matrix(), time = 5, easing = QUAD_EASING) ..() @@ -755,7 +755,7 @@ /datum/reagent/toxin/skewium/on_mob_life(mob/living/M) if(M.hud_used) if(current_cycle >= 5 && current_cycle % 3 == 0) - var/list/screens = list(M.hud_used.plane_masters["[GAME_PLANE]"], M.hud_used.plane_masters["[LIGHTING_PLANE]"]) + var/list/screens = list(M.hud_used.plane_masters["[FLOOR_PLANE]"], M.hud_used.plane_masters["[GAME_PLANE]"], M.hud_used.plane_masters["[LIGHTING_PLANE]"]) var/matrix/skew = matrix() var/intensity = 8 skew.set_skew(rand(-intensity,intensity), rand(-intensity,intensity)) @@ -772,7 +772,7 @@ /datum/reagent/toxin/skewium/on_mob_delete(mob/living/M) if(M && M.hud_used) - var/list/screens = list(M.hud_used.plane_masters["[GAME_PLANE]"], M.hud_used.plane_masters["[LIGHTING_PLANE]"]) + var/list/screens = list(M.hud_used.plane_masters["[FLOOR_PLANE]"], M.hud_used.plane_masters["[GAME_PLANE]"], M.hud_used.plane_masters["[LIGHTING_PLANE]"]) for(var/whole_screen in screens) animate(whole_screen, transform = matrix(), time = 5, easing = QUAD_EASING) ..()