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

Function UpdateManaFlask

Source/control.cpp:690–715  ·  view source on GitHub ↗

* Controls the drawing of the area of the life flask within the control panel. * Also for some reason draws the current right mouse button spell. */

Source from the content-addressed store, hash-verified

688 * Also for some reason draws the current right mouse button spell.
689 */
690void UpdateManaFlask()
691{
692 int filled;
693 int maxMana = plr[myplr]._pMaxMana;
694 int mana = plr[myplr]._pMana;
695 if (maxMana < 0)
696 maxMana = 0;
697 if (mana < 0)
698 mana = 0;
699
700 if (maxMana == 0)
701 filled = 0;
702 else
703 filled = (double)mana / (double)maxMana * 80.0;
704
705 plr[myplr]._pManaPer = filled;
706
707 if (filled > 69)
708 filled = 69;
709 if (filled != 69)
710 SetFlaskHeight(pManaBuff, 16, 85 - filled, 96 + PANEL_X + 368, PANEL_Y);
711 if (filled)
712 DrawPanelBox(96 + 368, 85 - filled, 88, filled, 96 + PANEL_X + 368, PANEL_Y + 69 - filled);
713
714 DrawSpell();
715}
716
717void InitControlPan()
718{

Callers 1

DrawAndBlitFunction · 0.85

Calls 3

SetFlaskHeightFunction · 0.85
DrawPanelBoxFunction · 0.85
DrawSpellFunction · 0.85

Tested by

no test coverage detected