From d972a60eccf228031eec1226ad276dfbff0988b0 Mon Sep 17 00:00:00 2001 From: carnie Date: Tue, 2 Apr 2013 06:21:19 +0100 Subject: [PATCH] Fixes Issue #197 - "Camera Range Display" verb now uses obj/machinery/camera/proc/can_see() to calculate which turfs are visible by cameras. Each turf in camera-range is marked with a maptext number indicating how many cameras can see that turf. IMPORTANT: Changed the default fonts of the skinfile. This works around an issue with byond, where certain font-faces can cause HUGE increases in memory usage client-side, giving the illusion of lag, or severe crashes. Before changing the font-face to 'Arial': using the camera range display verb would cause dream-seeker's memory usage to climb from 146,000 K to 800,000 K (and greater, but that is the limit of my laptop's pagefile, hence crashing my entire system) After changing the font-face to 'Arial': using the same verb (with same code) resulted in negligible memory usage increase in dreamseeker, and works absolutely fine. Status displays and such were not affected by this bug as they use a different font to the default set in the skinfile. It did however affect stuff such as mining satchels, and may explain why some users found the game extremely 'laggy' or crashy --- code/modules/admin/verbs/mapping.dm | 34 ++++++++++------------------- interface/skin.dmf | 2 +- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 02836bf36f3..91781f45e52 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -18,18 +18,8 @@ //- Check for any misplaced or stacked piece of wire //- Identify how hard it is to break into the area and where the weak points are //- Check if the area has too much empty space. If so, make it smaller and replace the rest with maintenance tunnels. - -var/camera_range_display_status = 0 var/intercom_range_display_status = 0 -/obj/effect/debugging/camera_range - icon = 'icons/480x480.dmi' - icon_state = "25percent" - - New() - src.pixel_x = -224 - src.pixel_y = -224 - /obj/effect/debugging/marker icon = 'icons/turf/areas.dmi' icon_state = "yellow" @@ -47,19 +37,19 @@ var/intercom_range_display_status = 0 set category = "Mapping" set name = "Camera Range Display" - if(camera_range_display_status) - camera_range_display_status = 0 - else - camera_range_display_status = 1 - - - - for(var/obj/effect/debugging/camera_range/C in world) - del(C) - - if(camera_range_display_status) + var/on = 0 + for(var/turf/T in world) + if(T.maptext) + on = 1 + T.maptext = null + + if(!on) + var/list/seen = list() for(var/obj/machinery/camera/C in cameranet.cameras) - new/obj/effect/debugging/camera_range(C.loc) + for(var/turf/T in C.can_see()) + seen[T]++ + for(var/turf/T in seen) + T.maptext = "[seen[T]]" feedback_add_details("admin_verb","mCRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/interface/skin.dmf b/interface/skin.dmf index 09291f4c06c..d60f26736c2 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -1306,7 +1306,7 @@ window "mapwindow" size = 640x480 anchor1 = 0,0 anchor2 = 100,100 - font-family = "Arial Rounded MT Bold,Arial Black,Arial,sans-serif" + font-family = "Arial" font-size = 7 font-style = "" text-color = none