MCPcopy Create free account
hub / github.com/diasurgical/devilution / DrawLifeFlask

Function DrawLifeFlask

Source/control.cpp:617–632  ·  view source on GitHub ↗

* Draws the top dome of the life flask (that part that protrudes out of the control panel). * First it draws the empty flask cel and then draws the filled part on top if needed. */

Source from the content-addressed store, hash-verified

615 * First it draws the empty flask cel and then draws the filled part on top if needed.
616 */
617void DrawLifeFlask()
618{
619 int filled = (double)plr[myplr]._pHitPoints / (double)plr[myplr]._pMaxHP * 80.0;
620 plr[myplr]._pHPPer = filled;
621
622 if (filled > 80)
623 filled = 80;
624 filled = 80 - filled;
625 if (filled > 11)
626 filled = 11;
627 filled += 2;
628
629 DrawFlask(pLifeBuff, 88, 277, gpBuffer, SCREENXY(PANEL_LEFT + 109, PANEL_TOP - 13), filled);
630 if (filled != 13)
631 DrawFlask(pBtmBuff, PANEL_WIDTH, PANEL_WIDTH * (filled + 3) + 109, gpBuffer, SCREENXY(PANEL_LEFT + 109, PANEL_TOP - 13 + filled), 13 - filled);
632}
633
634/**
635 * Controls the drawing of the area of the life flask within the control panel.

Callers 1

DrawViewFunction · 0.85

Calls 1

DrawFlaskFunction · 0.85

Tested by

no test coverage detected