mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 18:59:09 +00:00
Eliminate hsScalar and hsFixed
Modern CPUs support floats just fine... hsFixed was crazy.
This commit is contained in:
@ -427,7 +427,7 @@ void plAvatarInputInterface::ForceAlwaysRun(hsBool val)
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
// Gets called once per IUpdate(), just like normal IEval()s
|
||||
|
||||
hsBool plAvatarInputInterface::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool plAvatarInputInterface::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
fCursorTimeout += del;
|
||||
if( fCursorTimeout > fCursorFadeDelay )
|
||||
@ -848,7 +848,7 @@ hsBool plAvatarInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
|
||||
plCtrlCmd* pCmd = TRACKED_NEW plCtrlCmd( this );
|
||||
pCmd->fControlActivated = true;
|
||||
pCmd->fControlCode = mouseMap->fMap[i]->fCode;
|
||||
hsScalar pct = 0.0f;
|
||||
float pct = 0.0f;
|
||||
if (mouseMap->fMap[i]->fControlFlags & kControlFlagRangePos)
|
||||
{
|
||||
if (mouseMap->fMap[i]->fControlFlags & kControlFlagXAxisEvent)
|
||||
@ -878,7 +878,7 @@ hsBool plAvatarInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
|
||||
plCtrlCmd* pCmd = TRACKED_NEW plCtrlCmd( this );
|
||||
pCmd->fControlActivated = true;
|
||||
pCmd->fControlCode = mouseMap->fMap[i]->fCode;
|
||||
hsScalar pct = 0.0f;
|
||||
float pct = 0.0f;
|
||||
|
||||
if (mouseMap->fMap[i]->fControlFlags & kControlFlagXAxisEvent)
|
||||
pct = pMouseMsg->GetDX();
|
||||
@ -959,7 +959,7 @@ hsBool plAvatarInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
|
||||
pCmd->fNetPropagateToPlayers = mouseMap->fMap[i]->fControlFlags & kControlFlagNetPropagate;
|
||||
|
||||
// figure out what percent (if any)
|
||||
hsScalar pct = 0.0f;
|
||||
float pct = 0.0f;
|
||||
if (mouseMap->fMap[i]->fControlFlags & kControlFlagRangePos)
|
||||
{
|
||||
if (mouseMap->fMap[i]->fControlFlags & kControlFlagXAxisEvent)
|
||||
|
@ -179,7 +179,7 @@ class plAvatarInputInterface : public plInputInterface
|
||||
protected:
|
||||
|
||||
uint32_t fCurrentCursor;
|
||||
hsScalar fCursorOpacity, fCursorTimeout, fCursorFadeDelay;
|
||||
float fCursorOpacity, fCursorTimeout, fCursorFadeDelay;
|
||||
|
||||
plAvatarInputMap *fInputMap;
|
||||
|
||||
@ -188,7 +188,7 @@ class plAvatarInputInterface : public plInputInterface
|
||||
virtual hsBool IHandleCtrlCmd( plCtrlCmd *cmd );
|
||||
|
||||
// Gets called once per IUpdate(), just like normal IEval()s
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty );
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty );
|
||||
|
||||
void IDeactivateCommand(plMouseInfo *info);
|
||||
void IChangeInputMaps(plAvatarInputMap *newMap);
|
||||
@ -209,7 +209,7 @@ class plAvatarInputInterface : public plInputInterface
|
||||
|
||||
void Reset();
|
||||
|
||||
void RequestCursorToWorldPos(hsScalar xPos, hsScalar yPos, int ID);
|
||||
void RequestCursorToWorldPos(float xPos, float yPos, int ID);
|
||||
|
||||
hsBitVector fControlFlags;
|
||||
hsBool fMouseDisabled;
|
||||
@ -230,7 +230,7 @@ class plAvatarInputInterface : public plInputInterface
|
||||
virtual hsBool HasInterestingCursorID( void ) const { return true; }
|
||||
virtual uint32_t GetPriorityLevel( void ) const { return kAvatarInputPriority; }
|
||||
virtual uint32_t GetCurrentCursorID( void ) const { return fCurrentCursor; }
|
||||
virtual hsScalar GetCurrentCursorOpacity( void ) const { return fCursorOpacity; }
|
||||
virtual float GetCurrentCursorOpacity( void ) const { return fCursorOpacity; }
|
||||
const char* GetInputMapName() { return fInputMap ? fInputMap->GetName() : ""; }
|
||||
|
||||
virtual hsBool InterpretInputEvent( plInputEventMsg *pMsg );
|
||||
@ -256,7 +256,7 @@ class plAvatarInputInterface : public plInputInterface
|
||||
|
||||
void SetControlFlag(int f, hsBool val = true) { fControlFlags.SetBit(f, val); }
|
||||
|
||||
void SetCursorFadeDelay( hsScalar delay ) { fCursorFadeDelay = delay; }
|
||||
void SetCursorFadeDelay( float delay ) { fCursorFadeDelay = delay; }
|
||||
|
||||
hsBool IsEnterChatModeBound();
|
||||
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
virtual void Update(DIDEVICEOBJECTDATA* js);
|
||||
|
||||
protected:
|
||||
hsScalar fX,fY;
|
||||
float fX,fY;
|
||||
};
|
||||
|
||||
|
||||
|
@ -139,7 +139,7 @@ void plDebugInputInterface::RestoreDefaultKeyMappings( void )
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool plDebugInputInterface::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool plDebugInputInterface::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -244,7 +244,7 @@ hsBool plDebugInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
|
||||
plCtrlCmd* pCmd = TRACKED_NEW plCtrlCmd( this );
|
||||
pCmd->fControlActivated = true;
|
||||
pCmd->fControlCode = fMouseMap.fMap[i]->fCode;
|
||||
hsScalar pct = 0.0f;
|
||||
float pct = 0.0f;
|
||||
if (fMouseMap.fMap[i]->fControlFlags & kControlFlagRangePos)
|
||||
{
|
||||
if (fMouseMap.fMap[i]->fControlFlags & kControlFlagXAxisEvent)
|
||||
@ -319,7 +319,7 @@ hsBool plDebugInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
|
||||
pCmd->fNetPropagateToPlayers = fMouseMap.fMap[i]->fControlFlags & kControlFlagNetPropagate;
|
||||
|
||||
// figure out what percent (if any)
|
||||
hsScalar pct = 0.0f;
|
||||
float pct = 0.0f;
|
||||
if (fMouseMap.fMap[i]->fControlFlags & kControlFlagRangePos)
|
||||
{
|
||||
if (fMouseMap.fMap[i]->fControlFlags & kControlFlagXAxisEvent)
|
||||
|
@ -60,7 +60,7 @@ class plDebugInputInterface : public plInputInterface
|
||||
{
|
||||
protected:
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty );
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty );
|
||||
hsBool CursorInBox(plMouseEventMsg* pMsg, hsPoint4 box);
|
||||
|
||||
plMouseMap fMouseMap;
|
||||
|
@ -225,8 +225,8 @@ bool plMouseDevice::bMsgAlways = true;
|
||||
bool plMouseDevice::bCursorHidden = false;
|
||||
bool plMouseDevice::bCursorOverride = false;
|
||||
bool plMouseDevice::bInverted = false;
|
||||
hsScalar plMouseDevice::fWidth = BASE_WIDTH;
|
||||
hsScalar plMouseDevice::fHeight = BASE_HEIGHT;
|
||||
float plMouseDevice::fWidth = BASE_WIDTH;
|
||||
float plMouseDevice::fHeight = BASE_HEIGHT;
|
||||
plMouseDevice* plMouseDevice::fInstance = 0;
|
||||
|
||||
plMouseDevice::plMouseDevice()
|
||||
@ -259,7 +259,7 @@ plMouseDevice::~plMouseDevice()
|
||||
fCursor = nil;
|
||||
plMouseDevice::fInstance = nil;
|
||||
}
|
||||
void plMouseDevice::SetDisplayResolution(hsScalar Width, hsScalar Height)
|
||||
void plMouseDevice::SetDisplayResolution(float Width, float Height)
|
||||
{
|
||||
fWidth = Width;
|
||||
fHeight = Height;
|
||||
@ -321,7 +321,7 @@ void plMouseDevice::AddIDNumToCursor(uint32_t idNum)
|
||||
}
|
||||
|
||||
|
||||
void plMouseDevice::SetCursorX(hsScalar x)
|
||||
void plMouseDevice::SetCursorX(float x)
|
||||
{
|
||||
/// Set the cursor position
|
||||
if( fCursor == nil && !plMouseDevice::bCursorHidden)
|
||||
@ -335,7 +335,7 @@ void plMouseDevice::SetCursorX(hsScalar x)
|
||||
// txt.DrawString(fWXPos + 20,fWYPos - 5,"test");
|
||||
|
||||
}
|
||||
void plMouseDevice::SetCursorY(hsScalar y)
|
||||
void plMouseDevice::SetCursorY(float y)
|
||||
{
|
||||
/// Set the cursor position
|
||||
if( fCursor == nil && !plMouseDevice::bCursorHidden)
|
||||
@ -387,7 +387,7 @@ void plMouseDevice::NewCursor(char* cursor)
|
||||
fInstance->fCursor->SetVisible( true );
|
||||
}
|
||||
|
||||
void plMouseDevice::SetCursorOpacity( hsScalar opacity )
|
||||
void plMouseDevice::SetCursorOpacity( float opacity )
|
||||
{
|
||||
fInstance->fOpacity = opacity;
|
||||
if( fInstance->fCursor != nil )
|
||||
|
@ -168,13 +168,13 @@ public:
|
||||
fControlFlags.SetBit(f);
|
||||
}
|
||||
void ClearControlFlag(int which) { fControlFlags.ClearBit( which ); }
|
||||
void SetCursorX(hsScalar x);
|
||||
void SetCursorY(hsScalar y);
|
||||
hsScalar GetCursorX() { return fXPos; }
|
||||
hsScalar GetCursorY() { return fYPos; }
|
||||
void SetCursorX(float x);
|
||||
void SetCursorY(float y);
|
||||
float GetCursorX() { return fXPos; }
|
||||
float GetCursorY() { return fYPos; }
|
||||
uint32_t GetButtonState() { return fButtonState; }
|
||||
hsScalar GetCursorOpacity() { return fOpacity; }
|
||||
void SetDisplayResolution(hsScalar Width, hsScalar Height);
|
||||
float GetCursorOpacity() { return fOpacity; }
|
||||
void SetDisplayResolution(float Width, float Height);
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
@ -185,7 +185,7 @@ public:
|
||||
static void NewCursor(char* cursor);
|
||||
static void HideCursor(hsBool override = false);
|
||||
static bool GetHideCursor() { return plMouseDevice::bCursorHidden; }
|
||||
static void SetCursorOpacity( hsScalar opacity = 1.f );
|
||||
static void SetCursorOpacity( float opacity = 1.f );
|
||||
static bool GetInverted() { return plMouseDevice::bInverted; }
|
||||
static void SetInverted(bool inverted) { plMouseDevice::bInverted = inverted; }
|
||||
static void AddNameToCursor(const char* name);
|
||||
@ -202,12 +202,12 @@ protected:
|
||||
plInputEventMsg* fRightBMsg[2];
|
||||
plInputEventMsg* fMiddleBMsg[2];
|
||||
|
||||
hsScalar fXPos;
|
||||
hsScalar fYPos;
|
||||
float fXPos;
|
||||
float fYPos;
|
||||
int fWXPos; // the windows coordinates of the cursor
|
||||
int fWYPos;
|
||||
uint32_t fButtonState;
|
||||
hsScalar fOpacity;
|
||||
float fOpacity;
|
||||
hsBitVector fControlFlags;
|
||||
|
||||
|
||||
@ -222,7 +222,7 @@ protected:
|
||||
static bool bCursorHidden;
|
||||
static bool bCursorOverride;
|
||||
static bool bInverted;
|
||||
static hsScalar fWidth, fHeight;
|
||||
static float fWidth, fHeight;
|
||||
};
|
||||
|
||||
|
||||
|
@ -125,7 +125,7 @@ class plInputInterface : public hsRefCnt
|
||||
|
||||
|
||||
// Gets called once per IUpdate(), just like normal IEval()s
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ) { return false; }
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ) { return false; }
|
||||
|
||||
// Override to handle special-cased control messages of your own (same as receiving them via a message, but if you process them, nobody else gets them). Return false if you don't handle it.
|
||||
virtual hsBool IHandleCtrlCmd( plCtrlCmd *cmd ) { return false; }
|
||||
@ -184,7 +184,7 @@ class plInputInterface : public hsRefCnt
|
||||
virtual uint32_t GetCurrentCursorID( void ) const = 0;
|
||||
|
||||
// Returns the current opacity that this layer wants the cursor to be, from 0 (xparent) to 1 (opaque)
|
||||
virtual hsScalar GetCurrentCursorOpacity( void ) const { return 1.f; }
|
||||
virtual float GetCurrentCursorOpacity( void ) const { return 1.f; }
|
||||
|
||||
// Returns true if this layer is wanting to change the mouse, false if it isn't interested
|
||||
virtual hsBool HasInterestingCursorID( void ) const = 0;
|
||||
|
@ -297,7 +297,7 @@ void plInputInterfaceMgr::IUpdateCursor( int32_t newCursor )
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
// Inherited from plSingleModifier, gets called once per IUpdate() loop.
|
||||
|
||||
hsBool plInputInterfaceMgr::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool plInputInterfaceMgr::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
const char *inputEval = "Eval";
|
||||
plProfile_BeginLap(Input, inputEval);
|
||||
|
@ -88,14 +88,14 @@ class plInputInterfaceMgr : public plSingleModifier
|
||||
|
||||
hsBool fClickEnabled;
|
||||
int32_t fCurrentCursor;
|
||||
hsScalar fCursorOpacity;
|
||||
float fCursorOpacity;
|
||||
hsBool fForceCursorHidden;
|
||||
int32_t fForceCursorHiddenCount;
|
||||
plInputInterface *fCurrentFocus;
|
||||
plDefaultKeyCatcher *fDefaultCatcher;
|
||||
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty );
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty );
|
||||
|
||||
void IAddInterface( plInputInterface *iface );
|
||||
void IRemoveInterface( plInputInterface *iface );
|
||||
@ -170,7 +170,7 @@ class plCtrlCmd
|
||||
ControlEventCode fControlCode;
|
||||
hsBool fControlActivated;
|
||||
hsPoint3 fPt;
|
||||
hsScalar fPct;
|
||||
float fPct;
|
||||
|
||||
hsBool fNetPropagateToPlayers;
|
||||
|
||||
|
@ -208,7 +208,7 @@ void plInputManager::Update()
|
||||
fDInputMgr->Update();
|
||||
}
|
||||
|
||||
void plInputManager::SetMouseScale( hsScalar s )
|
||||
void plInputManager::SetMouseScale( float s )
|
||||
{
|
||||
/* RECT rect;
|
||||
POINT currPos;
|
||||
|
@ -84,8 +84,8 @@ public:
|
||||
|
||||
void Activate( bool activating );
|
||||
|
||||
hsScalar GetMouseScale( void ) const { return fMouseScale; }
|
||||
void SetMouseScale( hsScalar s );
|
||||
float GetMouseScale( void ) const { return fMouseScale; }
|
||||
void SetMouseScale( float s );
|
||||
|
||||
static plKeyDef UntranslateKey(plKeyDef key, hsBool extended);
|
||||
|
||||
@ -96,7 +96,7 @@ protected:
|
||||
plInputInterfaceMgr *fInterfaceMgr;
|
||||
bool fActive, fFirstActivated;
|
||||
|
||||
hsScalar fMouseScale;
|
||||
float fMouseScale;
|
||||
static uint8_t bRecenterMouse;
|
||||
static HWND fhWnd;
|
||||
|
||||
|
@ -207,7 +207,7 @@ void plSceneInputInterface::ResetClickableState()
|
||||
}
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool plSceneInputInterface::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool plSceneInputInterface::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
// this needs to always go no matter what...
|
||||
// ...unless we have cliclability disabled (as in the case of certain multistage behaviors)
|
||||
@ -395,10 +395,10 @@ hsBool plSceneInputInterface::MsgReceive( plMessage *msg )
|
||||
{
|
||||
hsVector3 ourView = locPlayer->GetCoordinateInterface()->GetLocalToWorld().GetAxis(hsMatrix44::kView);
|
||||
hsVector3 theirView = pObj->GetCoordinateInterface()->GetLocalToWorld().GetAxis(hsMatrix44::kView);
|
||||
hsScalar viewdot = ourView * theirView;
|
||||
float viewdot = ourView * theirView;
|
||||
hsVector3 towards(locPlayer->GetCoordinateInterface()->GetLocalToWorld().GetTranslate() - pObj->GetCoordinateInterface()->GetLocalToWorld().GetTranslate());
|
||||
towards.Normalize();
|
||||
hsScalar towardsdot = ourView * towards;
|
||||
float towardsdot = ourView * towards;
|
||||
if (viewdot > SHARE_FACING_TOLERANCE || towardsdot > SHARE_FACING_TOLERANCE )
|
||||
{
|
||||
ResetClickableState();
|
||||
@ -1151,7 +1151,7 @@ void plSceneInputInterface::ISendAvatarDisabledNotification(hsBool enabled)
|
||||
|
||||
//// IRequestLOSCheck ////////////////////////////////////////////////////////
|
||||
|
||||
void plSceneInputInterface::IRequestLOSCheck( hsScalar xPos, hsScalar yPos, int ID )
|
||||
void plSceneInputInterface::IRequestLOSCheck( float xPos, float yPos, int ID )
|
||||
{
|
||||
if( fPipe == nil )
|
||||
return;
|
||||
|
@ -106,10 +106,10 @@ class plSceneInputInterface : public plInputInterface
|
||||
hsPoint3 fLastStartPt, fLastEndPt;
|
||||
plPipeline *fPipe;
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty );
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty );
|
||||
|
||||
|
||||
void IRequestLOSCheck( hsScalar xPos, hsScalar yPos, int ID );
|
||||
void IRequestLOSCheck( float xPos, float yPos, int ID );
|
||||
void ISetLastClicked( plKey obj, hsPoint3 hitPoint );
|
||||
void IHalfFadeAvatar(hsBool out);
|
||||
|
||||
|
@ -100,7 +100,7 @@ void plTelescopeInputInterface::Init( plInputInterfaceMgr *manager )
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool plTelescopeInputInterface::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool plTelescopeInputInterface::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ class plTelescopeInputInterface : public plInputInterface
|
||||
{
|
||||
protected:
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty );
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty );
|
||||
|
||||
public:
|
||||
|
||||
@ -80,7 +80,7 @@ class plTelescopeInputInterface : public plInputInterface
|
||||
virtual uint32_t GetCurrentCursorID( void ) const { return kCursorUp; }
|
||||
|
||||
// Returns the current opacity that this layer wants the cursor to be, from 0 (xparent) to 1 (opaque)
|
||||
virtual hsScalar GetCurrentCursorOpacity( void ) const { return 1.f; }
|
||||
virtual float GetCurrentCursorOpacity( void ) const { return 1.f; }
|
||||
|
||||
// Returns true if this layer is wanting to change the mouse, false if it isn't interested
|
||||
virtual hsBool HasInterestingCursorID( void ) const { return false; }
|
||||
|
Reference in New Issue
Block a user