We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5937734 commit 2b33dc0Copy full SHA for 2b33dc0
1 file changed
Source/utils/hp_mana_units.hpp
@@ -0,0 +1,23 @@
1
+#pragma once
2
+
3
+namespace devilution {
4
5
+constexpr int HpManaFracBits = 6;
6
+constexpr int HpManaScale = 1 << HpManaFracBits;
7
8
+constexpr int HpManaToFrac(int whole)
9
+{
10
+ return whole * HpManaScale;
11
+}
12
13
+constexpr int HpManaToWhole(int frac)
14
15
+ return frac / HpManaScale;
16
17
18
+constexpr int HpManaFromParts(int whole, int frac)
19
20
+ return HpManaToFrac(whole) + frac;
21
22
23
+} // namespace devilution
0 commit comments