diff --git a/code/ZAS/Atom.dm b/code/ZAS/Atom.dm index eeb01b4249..bff1c23941 100644 --- a/code/ZAS/Atom.dm +++ b/code/ZAS/Atom.dm @@ -56,6 +56,28 @@ #endif return (AIR_BLOCKED*!CanZASPass(other, FALSE))|(ZONE_BLOCKED*!CanZASPass(other, TRUE)) +/turf/proc/self_airblock() + if(blocks_air & AIR_BLOCKED) + return BLOCKED + + if(blocks_air & ZONE_BLOCKED) + return ZONE_BLOCKED + + var/result = 0 + for(var/atom/movable/M as anything in contents) + switch(M.can_atmos_pass) + if(ATMOS_PASS_YES) + continue + if(ATMOS_PASS_NO) + return BLOCKED + if(ATMOS_PASS_DENSITY) + if(M.density) + return BLOCKED + if(ATMOS_PASS_PROC) + result |= M.c_airblock(src) + if(result == BLOCKED) return BLOCKED + return result + /turf/c_airblock(turf/other) #ifdef ZASDBG ASSERT(isturf(other)) diff --git a/code/ZAS/Diagnostic.dm b/code/ZAS/Diagnostic.dm index 15fcd89347..0d51ad1981 100644 --- a/code/ZAS/Diagnostic.dm +++ b/code/ZAS/Diagnostic.dm @@ -55,7 +55,7 @@ return if(direction == "N/A") - if(!(T.c_airblock(T) & AIR_BLOCKED)) + if(!(T.self_airblock() & AIR_BLOCKED)) to_chat(mob, "The turf can pass air! :D") else to_chat(mob, "No air passage :x") diff --git a/code/ZAS/Turf.dm b/code/ZAS/Turf.dm index c344fa96ce..2a388be923 100644 --- a/code/ZAS/Turf.dm +++ b/code/ZAS/Turf.dm @@ -11,7 +11,7 @@ vis_contents -= graphic_remove /turf/proc/update_air_properties() - var/block = c_airblock(src) + var/block = self_airblock() if(block & AIR_BLOCKED) //dbg(blocked) return 1 @@ -139,8 +139,7 @@ c_copy_air() zone = null //Easier than iterating through the list at the zone. - var/s_block // CHOMPEdit - ATMOS_CANPASS_TURF(s_block, src, src) + var/s_block = self_airblock() if(s_block & AIR_BLOCKED) #ifdef ZASDBG if(verbose) to_world("Self-blocked.") diff --git a/code/__defines/_init.dm b/code/__defines/_init.dm index 0a07f34f7d..474e021d33 100644 --- a/code/__defines/_init.dm +++ b/code/__defines/_init.dm @@ -7,8 +7,10 @@ // This allows us to get the real details of everything lagging at server start. // world.Profile(PROFILE_START) #if defined(ENABLE_BYOND_TRACY) - var/tracy_init = call_ext("prof.dll", "init")() // Setup Tracy integration - if(tracy_init != "0") + var/tracy_init = LIBCALL("prof.dll", "init")() // Setup Tracy integration + if(length(tracy_init) != 0 && tracy_init[1] == ".") // it returned the output file + to_world_log("TRACY Enabled, streaming to [tracy_init].") + else if(tracy_init != "0") CRASH("Tracy init error: [tracy_init]") #endif // After that, the debugger is initialized. diff --git a/code/controllers/subsystems/air.dm b/code/controllers/subsystems/air.dm index b2410a8432..fcd017409a 100644 --- a/code/controllers/subsystems/air.dm +++ b/code/controllers/subsystems/air.dm @@ -219,7 +219,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun var/turf/T = currentrun[currentrun.len] currentrun.len-- //check if the turf is self-zone-blocked - if(T.c_airblock(T) & ZONE_BLOCKED) + if(T.self_airblock() & ZONE_BLOCKED) selfblock_deferred += T if(MC_TICK_CHECK) return diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index f76248d632..a8589447d4 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -43,7 +43,7 @@ /turf/simulated/floor/LateInitialize() . = ..() - update_icon(1) + update_icon() /turf/simulated/floor/proc/swap_decals() var/current_decals = decals diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 8e6b02ce9f..e318e9d94b 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -178,7 +178,6 @@ var/list/mining_overlay_cache = list() update_general() /turf/simulated/mineral/proc/update_general() - update_icon(1) recalculate_directional_opacity() if(ticker && ticker.current_state == GAME_STATE_PLAYING) reconsider_lights() @@ -212,7 +211,7 @@ var/list/mining_overlay_cache = list() make_ore() if(prob(20)) overlay_detail = "asteroid[rand(0,9)]" - update_icon(1) + update_icon(!mapload) if(density && mineral) . = INITIALIZE_HINT_LATELOAD if(random_icon) @@ -223,8 +222,7 @@ var/list/mining_overlay_cache = list() if(density && mineral) MineralSpread() -/turf/simulated/mineral/update_icon(var/update_neighbors) - +/turf/simulated/mineral/update_icon(var/update_neighbors, ignore_list) cut_overlays() //We are a wall (why does this system work like this??) @@ -240,7 +238,7 @@ var/list/mining_overlay_cache = list() //Apply overlays if we should have borders for(var/direction in GLOB.cardinal) var/turf/T = get_step(src,direction) - if(istype(T) && !T.density) + if(T && !T.density) add_overlay(get_cached_border(rock_side_icon_state,direction,icon,rock_side_icon_state)) if(archaeo_overlay) @@ -260,13 +258,12 @@ var/list/mining_overlay_cache = list() //Apply overlays if there's space for(var/direction in GLOB.cardinal) - if(istype(get_step(src, direction), /turf/space) && !istype(get_step(src, direction), /turf/space/cracked_asteroid)) + var/turf/T = get_step(src, direction) + if(istype(T, /turf/space) && !istype(T, /turf/space/cracked_asteroid)) add_overlay(get_cached_border("asteroid_edge",direction,icon,"asteroid_edges", 0)) - //Or any time else - var/turf/T = get_step(src, direction) - if(istype(T) && T.density) + if(T?.density) add_overlay(get_cached_border(rock_side_icon_state,direction,rock_icon_path,rock_side_icon_state)) if(overlay_detail) @@ -274,12 +271,16 @@ var/list/mining_overlay_cache = list() if(update_neighbors) for(var/direction in GLOB.alldirs) - if(istype(get_step(src, direction), /turf/simulated/mineral)) - var/turf/simulated/mineral/M = get_step(src, direction) - M.update_icon() - if(istype(get_step(src, direction), /turf/simulated/wall/solidrock)) - var/turf/simulated/wall/solidrock/M = get_step(src, direction) - M.update_icon() + var/turf/T = get_step(src, direction) + // don't double update during cave generation + if(LAZYACCESS(ignore_list, T)) + continue + + if(istype(T, /turf/simulated/mineral)) + T.update_icon() + + if(istype(T, /turf/simulated/wall/solidrock)) + T.update_icon() /turf/simulated/mineral/ex_act(severity) diff --git a/code/modules/random_map/automata/caves.dm b/code/modules/random_map/automata/caves.dm index 96c29db5a4..20bbd2456b 100644 --- a/code/modules/random_map/automata/caves.dm +++ b/code/modules/random_map/automata/caves.dm @@ -2,6 +2,7 @@ iterations = 5 descriptor = "moon caves" var/list/ore_turfs = list() + var/list/turfs_changed var/make_cracked_turfs = TRUE /datum/random_map/automata/cave_system/no_cracks @@ -68,6 +69,7 @@ new /obj/structure/mob_spawner/scanner/mining_animals(T) //CHOMP Add else T.make_wall() + LAZYSET(turfs_changed, T, TRUE) if(T.density && !T.ignore_oregen) if(map[current_cell] == DOOR_CHAR) @@ -77,3 +79,11 @@ get_additional_spawns(map[current_cell],T,get_spawn_dir(x, y)) //VOREStation Edit End return T + +/datum/random_map/automata/cave_system/apply_to_map() + . = ..() + + for(var/turf/simulated/mineral/T as anything in turfs_changed) + T.update_icon(1, turfs_changed) + + LAZYCLEARLIST(turfs_changed) diff --git a/libverdigris.so b/libverdigris.so index bef4966ce4..eff1cbc1de 100644 Binary files a/libverdigris.so and b/libverdigris.so differ diff --git a/prof.dll b/prof.dll index f32fe6607c..71cf5cac61 100644 Binary files a/prof.dll and b/prof.dll differ diff --git a/verdigris.dll b/verdigris.dll index 264ca48591..489b9e11cc 100644 Binary files a/verdigris.dll and b/verdigris.dll differ diff --git a/verdigris/Cargo.toml b/verdigris/Cargo.toml index 29fd9e041c..90aa612ad5 100644 --- a/verdigris/Cargo.toml +++ b/verdigris/Cargo.toml @@ -20,6 +20,7 @@ const_format = "0.2.33" eyre = "0.6.12" meowtonin = { git = "https://github.com/Absolucy/meowtonin.git" } rand = "0.8.5" +rayon = "1.10.0" [build-dependencies] bosion = "1.1.1" diff --git a/verdigris/src/random_map.rs b/verdigris/src/random_map.rs index 67f5b167e5..ee5dfda09d 100644 --- a/verdigris/src/random_map.rs +++ b/verdigris/src/random_map.rs @@ -1,5 +1,6 @@ use meowtonin::{value::ByondValue, ByondError, ByondResult}; use rand::{distributions::Bernoulli, prelude::Distribution}; +use rayon::iter::{IndexedParallelIterator, IntoParallelRefIterator, ParallelIterator}; const CELL_THRESHOLD: usize = 5; @@ -18,7 +19,7 @@ pub fn generate_automata( let mut map = seed_map(limit_x, limit_y, initial_wall_cell)?; for _ in 1..iterations { map = map - .iter() + .par_iter() .enumerate() .map(|(i, _)| { let mut count = 0;