Code effeciency project: HUD items rewrite

Before: Every tick each HUD item would recalculate and redo images for every mob in view. For items like the secHUD where we're transversing implants and the various records this gets very expensive.

After: Mobs use their hud_list variable to store varius huditem images, when conditions change for those specific huditem images it updates the specific ones on demand. As a backup every 30 ticks or so the mob will update all of their hud_list.

Also: moved proc/RoundHealth() from 2 seperate locations into __HELPERS/mobs.dm

Conflicts:
	code/__HELPERS/mobs.dm
	code/game/objects/items/weapons/implants/implanter.dm
	code/modules/mob/dead/observer/observer.dm
	code/modules/mob/living/carbon/human/human_damage.dm
	code/modules/mob/living/carbon/human/life.dm
	code/modules/mob/living/living.dm
	code/modules/mob/living/living_defines.dm
	code/modules/mob/living/silicon/silicon.dm
	code/modules/virus2/helpers.dm
	code/setup.dm
	icons/mob/hud.dmi
This commit is contained in:
Ccomp5950
2014-03-10 08:07:29 -04:00
committed by ZomgPonies
parent 999318156e
commit 1e5514e27e
25 changed files with 318 additions and 220 deletions
+17 -4
View File
@@ -732,13 +732,15 @@ var/list/be_special_flags = list(
#define RIGHT 2
// for secHUDs and medHUDs and variants. The number is the location of the image on the list hud_list of humans.
#define HEALTH_HUD 1 // dead, alive, sick, health status
#define STATUS_HUD 2 // a simple line rounding the mob's number health
#define HEALTH_HUD 1 // a simple line rounding the mob's number health
#define STATUS_HUD 2 // alive, dead, diseased, etc.
#define ID_HUD 3 // the job asigned to your ID
#define WANTED_HUD 4 // wanted, released, parroled, security status
#define IMPLOYAL_HUD 5 // loyality implant
#define IMPLOYAL_HUD 5 // loyality implant
#define IMPCHEM_HUD 6 // chemical implant
#define IMPTRACK_HUD 7 // tracking implant
#define IMPTRACK_HUD 7 // tracking implant
#define SPECIALROLE_HUD 8 // AntagHUD image
#define STATUS_HUD_OOC 9 // STATUS_HUD without virus db check for someone being ill.
//Pulse levels, very simplified
#define PULSE_NONE 0 //so !M.pulse checks would be possible
@@ -829,3 +831,14 @@ var/list/RESTRICTED_CAMERA_NETWORKS = list( //Those networks can only be accesse
#define CENTCOMM_Z 2
#define TELECOMM_Z 3
#define ASTEROID_Z 5
//some colors
#define COLOR_RED "#FF0000"
#define COLOR_GREEN "#00FF00"
#define COLOR_BLUE "#0000FF"
#define COLOR_CYAN "#00FFFF"
#define COLOR_PINK "#FF00FF"
#define COLOR_YELLOW "#FFFF00"
#define COLOR_ORANGE "#FF9900"
#define COLOR_WHITE "#FFFFFF"