CommonLibSSE (Parapets fork)
hkBaseTypes.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace RE
4 {
5  using hkObjectIndex = std::uint16_t;
6  using hkTime = float;
7 
8  enum class hkResult
9  {
10  kSuccess = 0,
11  kFailure = 1
12  };
13 
14  // 16-bit float with 7-bit precision
15  class hkHalf
16  {
17  public:
18  hkHalf();
19  explicit hkHalf(const float& a_val);
20 
21  hkHalf& operator=(const float& a_val);
22  operator float() const;
23 
24  protected:
25  void SetFloat(const float& a_val);
26  [[nodiscard]] float GetFloat() const;
27 
28  // members
29  std::int16_t _value; // 0
30  };
31  static_assert(sizeof(hkHalf) == 0x2);
32 
33  // 8-bit float ranging [0.01, 1000000.0]
34  // value is an index in a lookup table
35  class hkUFloat8
36  {
37  public:
38  // members
39  std::uint8_t value; // 0
40  };
41  static_assert(sizeof(hkUFloat8) == 0x1);
42 }
Definition: hkBaseTypes.h:16
void SetFloat(const float &a_val)
std::int16_t _value
Definition: hkBaseTypes.h:29
float GetFloat() const
hkHalf(const float &a_val)
hkHalf & operator=(const float &a_val)
Definition: hkBaseTypes.h:36
std::uint8_t value
Definition: hkBaseTypes.h:39
Definition: AbsorbEffect.h:6
std::uint16_t hkObjectIndex
Definition: hkBaseTypes.h:5
hkResult
Definition: hkBaseTypes.h:9
float hkTime
Definition: hkBaseTypes.h:6