mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
Implements icon size caching to avoid unnecessary load in updatehealth (#88266)
## About The Pull Request Technically an improved port of https://github.com/DaedalusDock/daedalusdock/pull/651, instead of only storing height over 32 pixels for HUDs we store both pure height and width for the sake of cutting down on icon operation spam (which is pretty costly). Should save us a significant amount of time, cuts down update_health_hud times by 45% and total update_health by 30% which is pretty good for a somewhat hot proc. ## Why It's Good For The Game Our health HUDs constantly fetch icons ***twice*** every update_health, jesus. ## Changelog 🆑 SmArtKar, Kapu code: Implemented caching for icon sizes which should significantly improve mob health performance due to HUDs constantly fetching icons /🆑
This commit is contained in:
@@ -443,8 +443,7 @@
|
||||
var/size_matrix = matrix()
|
||||
if(size_calc_target)
|
||||
layer = size_calc_target.layer + 0.01
|
||||
var/icon/I = icon(size_calc_target.icon, size_calc_target.icon_state, size_calc_target.dir)
|
||||
size_matrix = matrix() * (I.Height()/ICON_SIZE_Y)
|
||||
size_matrix = matrix() * (size_calc_target.get_cached_height()/ICON_SIZE_Y)
|
||||
transform = size_matrix //scale the bleed overlay's size based on the target's icon size
|
||||
var/matrix/M = transform
|
||||
if(shrink)
|
||||
|
||||
Reference in New Issue
Block a user