Crop moth wings to 32x32, saving about 0.18s in init time (yes really) (#71243)

Crops all moth wings to 32x32 and saves the very expensive Crop cost in the preference icon generation for moth wings.
This commit is contained in:
Mothblocks
2022-11-14 22:26:28 -03:00
committed by GitHub
parent d661f9c27c
commit 13a1939eee
2 changed files with 1 additions and 7 deletions
@@ -86,17 +86,11 @@
should_generate_icons = TRUE
/datum/preference/choiced/moth_wings/init_possible_values()
var/list/icon/values = possible_values_for_sprite_accessory_list_for_body_part(
return possible_values_for_sprite_accessory_list_for_body_part(
GLOB.moth_wings_list,
"moth_wings",
list("BEHIND", "FRONT"),
)
// Moth wings are in a stupid dimension
for (var/name in values)
values[name].Crop(1, 1, 32, 32)
return values
/datum/preference/choiced/moth_wings/apply_to_human(mob/living/carbon/human/target, value)
target.dna.features["moth_wings"] = value