mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Eliminate hsScalar and hsFixed
Modern CPUs support floats just fine... hsFixed was crazy.
This commit is contained in:
@ -107,17 +107,17 @@ plProgressMgr::~plProgressMgr()
|
||||
|
||||
//// RegisterOperation ///////////////////////////////////////////////////////
|
||||
|
||||
plOperationProgress* plProgressMgr::RegisterOperation(hsScalar length, const char *title, StaticText staticTextType, bool isRetry, bool alwaysDrawText)
|
||||
plOperationProgress* plProgressMgr::RegisterOperation(float length, const char *title, StaticText staticTextType, bool isRetry, bool alwaysDrawText)
|
||||
{
|
||||
return IRegisterOperation(length, title, staticTextType, isRetry, false, alwaysDrawText);
|
||||
}
|
||||
|
||||
plOperationProgress* plProgressMgr::RegisterOverallOperation(hsScalar length, const char *title, StaticText staticTextType, bool alwaysDrawText)
|
||||
plOperationProgress* plProgressMgr::RegisterOverallOperation(float length, const char *title, StaticText staticTextType, bool alwaysDrawText)
|
||||
{
|
||||
return IRegisterOperation(length, title, staticTextType, false, true, alwaysDrawText);
|
||||
}
|
||||
|
||||
plOperationProgress* plProgressMgr::IRegisterOperation(hsScalar length, const char *title, StaticText staticTextType, bool isRetry, bool isOverall, bool alwaysDrawText)
|
||||
plOperationProgress* plProgressMgr::IRegisterOperation(float length, const char *title, StaticText staticTextType, bool isRetry, bool isOverall, bool alwaysDrawText)
|
||||
{
|
||||
if (fOperations == nil)
|
||||
{
|
||||
@ -259,7 +259,7 @@ const char* plProgressMgr::GetStaticTextID(StaticText staticTextType)
|
||||
//// plOperationProgress ////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
plOperationProgress::plOperationProgress( hsScalar length ) :
|
||||
plOperationProgress::plOperationProgress( float length ) :
|
||||
fMax(length),
|
||||
fValue(0),
|
||||
fNext(nil),
|
||||
@ -292,10 +292,10 @@ void plOperationProgress::IUpdateStats()
|
||||
else
|
||||
elapsed = fStartTime - curTime;
|
||||
|
||||
hsScalar progress = GetProgress();
|
||||
float progress = GetProgress();
|
||||
|
||||
if (elapsed > 0)
|
||||
fAmtPerSec = progress / hsScalar(elapsed);
|
||||
fAmtPerSec = progress / float(elapsed);
|
||||
else
|
||||
fAmtPerSec = 0;
|
||||
fElapsedSecs = (uint32_t)elapsed;
|
||||
@ -328,7 +328,7 @@ void plOperationProgress::IChildUpdateEnd(plOperationProgress* child)
|
||||
|
||||
//// Increment ///////////////////////////////////////////////////////////////
|
||||
|
||||
void plOperationProgress::Increment( hsScalar byHowMuch )
|
||||
void plOperationProgress::Increment( float byHowMuch )
|
||||
{
|
||||
fValue += byHowMuch;
|
||||
if( fValue > fMax )
|
||||
@ -340,7 +340,7 @@ void plOperationProgress::Increment( hsScalar byHowMuch )
|
||||
|
||||
//// SetHowMuch //////////////////////////////////////////////////////////////
|
||||
|
||||
void plOperationProgress::SetHowMuch( hsScalar howMuch )
|
||||
void plOperationProgress::SetHowMuch( float howMuch )
|
||||
{
|
||||
fValue = howMuch;
|
||||
if( fValue > fMax )
|
||||
@ -374,7 +374,7 @@ void plOperationProgress::SetTitle( const char *text )
|
||||
|
||||
//// SetLength ///////////////////////////////////////////////////////////////
|
||||
|
||||
void plOperationProgress::SetLength( hsScalar length )
|
||||
void plOperationProgress::SetLength( float length )
|
||||
{
|
||||
fMax = length;
|
||||
if( fValue > fMax )
|
||||
|
@ -73,14 +73,14 @@ class plOperationProgress
|
||||
|
||||
protected:
|
||||
|
||||
hsScalar fValue, fMax;
|
||||
float fValue, fMax;
|
||||
char fStatusText[ 256 ];
|
||||
char fTitle[ 256 ];
|
||||
uint32_t fContext;
|
||||
double fStartTime;
|
||||
|
||||
uint32_t fElapsedSecs, fRemainingSecs;
|
||||
hsScalar fAmtPerSec;
|
||||
float fAmtPerSec;
|
||||
|
||||
enum Flags
|
||||
{
|
||||
@ -103,29 +103,29 @@ class plOperationProgress
|
||||
void IChildUpdateBegin(plOperationProgress* child);
|
||||
void IChildUpdateEnd(plOperationProgress* child);
|
||||
|
||||
plOperationProgress( hsScalar length );
|
||||
plOperationProgress( float length );
|
||||
|
||||
public:
|
||||
|
||||
~plOperationProgress();
|
||||
|
||||
hsScalar GetMax( void ) const { return fMax; }
|
||||
hsScalar GetProgress( void ) const { return fValue; }
|
||||
float GetMax( void ) const { return fMax; }
|
||||
float GetProgress( void ) const { return fValue; }
|
||||
const char * GetTitle( void ) const { return fTitle; }
|
||||
const char * GetStatusText( void ) const { return fStatusText; }
|
||||
uint32_t GetContext( void ) const { return fContext; }
|
||||
uint32_t GetElapsedSecs() { return fElapsedSecs; }
|
||||
uint32_t GetRemainingSecs() { return fRemainingSecs; }
|
||||
hsScalar GetAmtPerSec() { return fAmtPerSec; }
|
||||
float GetAmtPerSec() { return fAmtPerSec; }
|
||||
|
||||
// Adds on to current value
|
||||
void Increment( hsScalar byHowMuch );
|
||||
void Increment( float byHowMuch );
|
||||
|
||||
// Sets current value
|
||||
void SetHowMuch( hsScalar byHowMuch );
|
||||
void SetHowMuch( float byHowMuch );
|
||||
|
||||
// Set the length
|
||||
void SetLength( hsScalar length );
|
||||
void SetLength( float length );
|
||||
|
||||
// Sets the display text above the bar (nil for nothing)
|
||||
void SetStatusText( const char *text );
|
||||
@ -215,7 +215,7 @@ class plProgressMgr
|
||||
|
||||
void IUpdateFlags(plOperationProgress* progress);
|
||||
|
||||
plOperationProgress* IRegisterOperation(hsScalar length, const char *title, StaticText staticTextType, bool isRetry, bool isOverall, bool alwaysDrawText);
|
||||
plOperationProgress* IRegisterOperation(float length, const char *title, StaticText staticTextType, bool isRetry, bool isOverall, bool alwaysDrawText);
|
||||
// Called by the operation
|
||||
void IUnregisterOperation(plOperationProgress* op);
|
||||
|
||||
@ -234,8 +234,8 @@ class plProgressMgr
|
||||
|
||||
virtual void Draw( plPipeline *p ) { }
|
||||
|
||||
plOperationProgress* RegisterOperation(hsScalar length, const char *title = nil, StaticText staticTextType = kNone, bool isRetry = false, bool alwaysDrawText = false);
|
||||
plOperationProgress* RegisterOverallOperation(hsScalar length, const char *title = nil, StaticText staticTextType = kNone, bool alwaysDrawText = false);
|
||||
plOperationProgress* RegisterOperation(float length, const char *title = nil, StaticText staticTextType = kNone, bool isRetry = false, bool alwaysDrawText = false);
|
||||
plOperationProgress* RegisterOverallOperation(float length, const char *title = nil, StaticText staticTextType = kNone, bool alwaysDrawText = false);
|
||||
|
||||
|
||||
plProgressMgrCallbackProc SetCallbackProc( plProgressMgrCallbackProc proc );
|
||||
|
Reference in New Issue
Block a user