From bf42d769e2407491116b7f02d9e366cd97e69caa Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 22 Feb 2017 15:41:58 -0500 Subject: [PATCH] Overlay/Roundstart fixpack (#24356) * Fixes roundstart graphical lag * Fixes manifests * >Expecting searching lists to be fast * Here's where they needed flushing * THE DATACORE IS ANNOYING REEE * --- code/__HELPERS/icons.dm | 2 ++ .../subsystem/processing/overlays.dm | 20 +++++++++++-------- code/controllers/subsystem/ticker.dm | 4 ++++ code/datums/datacore.dm | 19 ++++++++++++------ 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 586d2d502be..73f9aee5342 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -954,6 +954,8 @@ var/global/list/humanoid_icon_cache = list() if(outfit) body.equipOutfit(outfit, TRUE) + SSoverlays.Flush() + var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing") body.setDir(NORTH) diff --git a/code/controllers/subsystem/processing/overlays.dm b/code/controllers/subsystem/processing/overlays.dm index 1508142a8d9..9a93fbd4b4b 100644 --- a/code/controllers/subsystem/processing/overlays.dm +++ b/code/controllers/subsystem/processing/overlays.dm @@ -18,25 +18,29 @@ var/datum/subsystem/processing/overlays/SSoverlays /datum/subsystem/processing/overlays/Initialize() initialized = TRUE - for(var/I in processing) - var/atom/A = I - A.compile_overlays() - CHECK_TICK - processing.Cut() + Flush() ..() /datum/subsystem/processing/overlays/Recover() overlay_icon_state_caches = SSoverlays.overlay_icon_state_caches processing = SSoverlays.processing -/datum/subsystem/processing/overlays/fire() +/datum/subsystem/processing/overlays/fire(resumed = FALSE, mc_check = TRUE) while(processing.len) var/atom/thing = processing[processing.len] processing.len-- if(thing) thing.compile_overlays(FALSE) - if(MC_TICK_CHECK) - break + if(mc_check) + if(MC_TICK_CHECK) + break + else + CHECK_TICK + +/datum/subsystem/processing/overlays/proc/Flush() + if(processing.len) + testing("Flushing [processing.len] overlays") + fire(mc_check = FALSE) //pair this thread up with the MC to get extra compile time /atom/proc/compile_overlays() if(LAZYLEN(priority_overlays) && LAZYLEN(our_overlays)) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 50ef8311de1..9c3420a8587 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -201,6 +201,10 @@ var/datum/subsystem/ticker/ticker CHECK_TICK equip_characters() CHECK_TICK + + SSoverlays.Flush() //Flush the majority of the shit + CHECK_TICK + data_core.manifest() CHECK_TICK diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 9e2f25e3c31..e8c3b7a8f08 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -66,8 +66,9 @@ return /datum/datacore/proc/manifest() - for(var/mob/living/carbon/human/H in player_list) - manifest_inject(H) + for(var/mob/new_player/N in player_list) + if(ishuman(N.new_character)) + manifest_inject(N.new_character, N.client) CHECK_TICK /datum/datacore/proc/manifest_modify(name, assignment) @@ -184,7 +185,7 @@ var/record_id_num = 1001 -/datum/datacore/proc/manifest_inject(mob/living/carbon/human/H) +/datum/datacore/proc/manifest_inject(mob/living/carbon/human/H, client/C) if(H.mind && (H.mind.assigned_role != H.mind.special_role)) var/assignment if(H.mind.assigned_role) @@ -195,7 +196,9 @@ var/record_id_num = 1001 assignment = "Unassigned" var/id = num2hex(record_id_num++,6) - var/image = get_id_photo(H) + if(!C) + C = H.client + var/image = get_id_photo(H, C) var/obj/item/weapon/photo/photo_front = new() var/obj/item/weapon/photo/photo_side = new() photo_front.photocreate(null, icon(image, dir = SOUTH)) @@ -263,7 +266,11 @@ var/record_id_num = 1001 locked += L return -/datum/datacore/proc/get_id_photo(mob/living/carbon/human/H) +/datum/datacore/proc/get_id_photo(mob/living/carbon/human/H, client/C) var/datum/job/J = SSjob.GetJob(H.mind.assigned_role) - var/datum/preferences/P = H.client.prefs + var/datum/preferences/P + if(!C) + C = H.client + if(C) + P = C.prefs return get_flat_human_icon(null,J.outfit,P)