mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-21 04:39:45 +00:00
Eliminate hsScalar and hsFixed
Modern CPUs support floats just fine... hsFixed was crazy.
This commit is contained in:
@ -43,11 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#define hsTimer_Defined
|
||||
|
||||
#include "hsWide.h"
|
||||
#include "hsScalar.h"
|
||||
|
||||
#if !HS_CAN_USE_FLOAT
|
||||
#error "Unsupported without double's"
|
||||
#endif // !HS_CAN_USE_FLOAT
|
||||
|
||||
class plTimerShare
|
||||
{
|
||||
@ -62,14 +57,14 @@ protected:
|
||||
double fSmoothBuff[kSmoothBuffLen];
|
||||
int fCurrSlot;
|
||||
|
||||
hsScalar fSysTimeScale;
|
||||
float fSysTimeScale;
|
||||
double fRealSeconds;
|
||||
double fSysSeconds;
|
||||
hsScalar fDelSysSeconds;
|
||||
hsScalar fFrameTimeInc;
|
||||
float fDelSysSeconds;
|
||||
float fFrameTimeInc;
|
||||
hsBool fRunningFrameTime;
|
||||
hsScalar fTimeClampSecs;
|
||||
hsScalar fSmoothingClampSecs;
|
||||
float fTimeClampSecs;
|
||||
float fSmoothingClampSecs;
|
||||
hsBool fClamping;
|
||||
|
||||
hsWide* FactorInTimeZero(hsWide* ticks) const;
|
||||
@ -82,21 +77,21 @@ protected:
|
||||
double RawTicksToDSeconds(const hsWide& ticks);
|
||||
hsWide DSecondsToRawTicks(double secs);
|
||||
|
||||
hsScalar GetDelSysSeconds() const { return fDelSysSeconds; }
|
||||
float GetDelSysSeconds() const { return fDelSysSeconds; }
|
||||
double GetSysSeconds() const { return fSysSeconds; }
|
||||
double IncSysSeconds();
|
||||
|
||||
void SetRealTime(hsBool realTime);
|
||||
hsBool IsRealTime() const { return !fRunningFrameTime; }
|
||||
|
||||
void SetFrameTimeInc(hsScalar inc) { fFrameTimeInc = inc; }
|
||||
void SetFrameTimeInc(float inc) { fFrameTimeInc = inc; }
|
||||
|
||||
void SetTimeScale(hsScalar s) { fSysTimeScale = s; }
|
||||
hsScalar GetTimeScale() const { return fSysTimeScale; }
|
||||
void SetTimeScale(float s) { fSysTimeScale = s; }
|
||||
float GetTimeScale() const { return fSysTimeScale; }
|
||||
|
||||
void SetTimeClamp(hsScalar secs) { fTimeClampSecs = secs; }
|
||||
void SetSmoothingCap(hsScalar secs) { fSmoothingClampSecs = secs; }
|
||||
hsScalar GetTimeClamp() const { return fTimeClampSecs; }
|
||||
void SetTimeClamp(float secs) { fTimeClampSecs = secs; }
|
||||
void SetSmoothingCap(float secs) { fSmoothingClampSecs = secs; }
|
||||
float GetTimeClamp() const { return fTimeClampSecs; }
|
||||
hsBool IsClamping() const { return fClamping; }
|
||||
|
||||
friend class hsTimer;
|
||||
@ -127,7 +122,7 @@ public:
|
||||
static double RawTicksToDSeconds(const hsWide& ticks) { return fTimer->RawTicksToDSeconds(ticks); }
|
||||
static hsWide DSecondsToRawTicks(double secs) { return fTimer->DSecondsToRawTicks(secs); }
|
||||
|
||||
static hsScalar GetDelSysSeconds() { return fTimer->GetDelSysSeconds(); }
|
||||
static float GetDelSysSeconds() { return fTimer->GetDelSysSeconds(); }
|
||||
static double GetSysSeconds() { return fTimer->GetSysSeconds(); }
|
||||
|
||||
static double IncSysSeconds() { return fTimer->IncSysSeconds(); }
|
||||
@ -135,14 +130,14 @@ public:
|
||||
static void SetRealTime(hsBool realTime) { fTimer->SetRealTime(realTime); }
|
||||
static hsBool IsRealTime() { return fTimer->IsRealTime(); }
|
||||
|
||||
static void SetFrameTimeInc(hsScalar inc) { fTimer->SetFrameTimeInc(inc); }
|
||||
static void SetFrameTimeInc(float inc) { fTimer->SetFrameTimeInc(inc); }
|
||||
|
||||
static void SetTimeScale(hsScalar s) { fTimer->SetTimeScale(s); }
|
||||
static hsScalar GetTimeScale() { return fTimer->GetTimeScale(); }
|
||||
static void SetTimeScale(float s) { fTimer->SetTimeScale(s); }
|
||||
static float GetTimeScale() { return fTimer->GetTimeScale(); }
|
||||
|
||||
static void SetTimeClamp(hsScalar secs) { fTimer->SetTimeClamp(secs); }
|
||||
static void SetTimeSmoothingClamp(hsScalar secs) { fTimer->SetSmoothingCap(secs); }
|
||||
static hsScalar GetTimeClamp() { return fTimer->GetTimeClamp(); }
|
||||
static void SetTimeClamp(float secs) { fTimer->SetTimeClamp(secs); }
|
||||
static void SetTimeSmoothingClamp(float secs) { fTimer->SetSmoothingCap(secs); }
|
||||
static float GetTimeClamp() { return fTimer->GetTimeClamp(); }
|
||||
static hsBool IsClamping() { return fTimer->IsClamping(); }
|
||||
|
||||
///////////////////////////
|
||||
@ -150,7 +145,7 @@ public:
|
||||
///////////////////////////
|
||||
static uint32_t GetPrecTickCount();
|
||||
static double GetPrecTicksPerSec();
|
||||
static uint32_t PrecSecsToTicks(hsScalar secs);
|
||||
static uint32_t PrecSecsToTicks(float secs);
|
||||
static double PrecTicksToSecs(uint32_t ticks);
|
||||
static double PrecTicksToHz(uint32_t ticks);
|
||||
|
||||
|
Reference in New Issue
Block a user