[2.2] Clean up HUD drawing code