//HalfConverter - [2020-04-13 11:57:47]
#ifndef _HALFCONVERTER_H_
#define _HALFCONVERTER_H_

#include "common.h"

/*
0018E2A4 HalfConverter::Init()
0018E42C HalfConverter::F2H(float)
0018E6E4 HalfConverter::convertmantissa(uint)
001AE240 HalfConverter::H2F(ushort)
001AE27C HalfConverter::CreateRGB9E5(float,float,float,bool)
00225574 HalfConverter::RGB9E5toFloat(uint,float &,float &,float &,bool)
*/

class HalfConverter {
public:
  //0018E2A4
  static void Init();

  //0018E42C
  static ushort F2H(float);

  //0018E6E4
  static uint convertmantissa(uint);

  //001AE240
  static float H2F(ushort);

  //001AE27C
  static uint CreateRGB9E5(float, float, float, bool);

  //00225574
  static float RGB9E5toFloat(uint, float &, float &, float &, bool);

  static bool bInitialised;  //005CB43C
  static uint exponenttable[64];
  static uint offsettable[64];
  static uint mantissatable[2048];
  static ushort basetable[512];
  static sint8 shifttable[512];

};  //namespace HalfConverter

#endif  //_HALFCONVERTER_H_