mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 02:51:27 +00:00
Eliminate hsScalar and hsFixed
Modern CPUs support floats just fine... hsFixed was crazy.
This commit is contained in:
@ -169,7 +169,7 @@ pfGUIButtonMod::~pfGUIButtonMod()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIButtonMod::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIButtonMod::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIControlMod::IEval( secs, del, dirty );
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ class pfGUIButtonMod : public pfGUIControlMod
|
||||
|
||||
int32_t fNotifyType;
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
virtual uint32_t IGetDesiredCursor( void ) const; // As specified in plInputInterface.h
|
||||
|
||||
|
@ -79,7 +79,7 @@ pfGUICheckBoxCtrl::~pfGUICheckBoxCtrl()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUICheckBoxCtrl::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUICheckBoxCtrl::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIControlMod::IEval( secs, del, dirty );
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ class pfGUICheckBoxCtrl : public pfGUIControlMod
|
||||
hsBool fChecked;
|
||||
hsBool fPlaySound;
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
virtual uint32_t IGetDesiredCursor( void ) const; // As specified in plInputInterface.h
|
||||
|
||||
|
@ -72,7 +72,7 @@ pfGUIClickMapCtrl::~pfGUIClickMapCtrl()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIClickMapCtrl::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIClickMapCtrl::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIControlMod::IEval( secs, del, dirty );
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class pfGUIClickMapCtrl : public pfGUIControlMod
|
||||
hsBool fTracking;
|
||||
int32_t fCustomCursor;
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
virtual uint32_t IGetDesiredCursor( void ) const; // As specified in plInputInterface.h
|
||||
|
||||
|
@ -180,7 +180,7 @@ pfGUIControlMod::~pfGUIControlMod()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIControlMod::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIControlMod::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
// UpdateBounds();
|
||||
return false;
|
||||
@ -205,13 +205,13 @@ void pfGUIControlMod::SetTransform( const hsMatrix44 &l2w, const hsMatrix44 &
|
||||
|
||||
//// GetVectorAngle //////////////////////////////////////////////////////////
|
||||
|
||||
static hsScalar GetVectorAngle( const hsPoint3 &basePt, const hsPoint3 &pointA, const hsPoint3 &pointB )
|
||||
static float GetVectorAngle( const hsPoint3 &basePt, const hsPoint3 &pointA, const hsPoint3 &pointB )
|
||||
{
|
||||
hsVector3 vectorA( &pointA, &basePt ), vectorB( &pointB, &basePt );
|
||||
|
||||
hsScalar dot = vectorA * vectorB;
|
||||
float dot = vectorA * vectorB;
|
||||
hsVector3 cross = vectorA % vectorB;
|
||||
hsScalar crossLen = cross.fZ;
|
||||
float crossLen = cross.fZ;
|
||||
|
||||
return atan2( crossLen, dot );
|
||||
}
|
||||
@ -225,7 +225,7 @@ static hsScalar GetVectorAngle( const hsPoint3 &basePt, const hsPoint3 &pointA,
|
||||
static hsBool CreateConvexHull( hsPoint3 *inPoints, int &numPoints )
|
||||
{
|
||||
int i, j, pointA, pointB, pointC;
|
||||
hsScalar *angles;
|
||||
float *angles;
|
||||
|
||||
if( numPoints < 3 )
|
||||
return false;
|
||||
@ -246,7 +246,7 @@ static hsBool CreateConvexHull( hsPoint3 *inPoints, int &numPoints )
|
||||
// Step 2: Sort all the in points by the angle to the X axis (vector <1,0>).
|
||||
// Step A: Calculate all the angles
|
||||
|
||||
angles = TRACKED_NEW hsScalar[ numPoints ];
|
||||
angles = TRACKED_NEW float[ numPoints ];
|
||||
hsPoint3 xAxisPoint( avgPoint.fX + 1, avgPoint.fY, avgPoint.fZ );
|
||||
for( i = 0; i < numPoints; i++ )
|
||||
angles[ i ] = GetVectorAngle( avgPoint, inPoints[ i ], xAxisPoint );
|
||||
@ -258,7 +258,7 @@ static hsBool CreateConvexHull( hsPoint3 *inPoints, int &numPoints )
|
||||
{
|
||||
if( angles[ j ] < angles[ i ] )
|
||||
{
|
||||
hsScalar tempAngle = angles[ j ];
|
||||
float tempAngle = angles[ j ];
|
||||
angles[ j ] = angles[ i ];
|
||||
angles[ i ] = tempAngle;
|
||||
|
||||
@ -283,12 +283,12 @@ static hsBool CreateConvexHull( hsPoint3 *inPoints, int &numPoints )
|
||||
pointB += numPoints;
|
||||
|
||||
// For points A, B, and C, find the interior angle between them
|
||||
hsScalar angle = GetVectorAngle( inPoints[ pointB ], inPoints[ pointA ], inPoints[ pointC ] );
|
||||
float angle = GetVectorAngle( inPoints[ pointB ], inPoints[ pointA ], inPoints[ pointC ] );
|
||||
|
||||
// If the angle is < 180, then it's a good angle and we can advance all our points by 1...
|
||||
// Note: we have a tolerance so that we don't get points that form edges that are pretty darned close...
|
||||
const hsScalar tolerance = hsScalarPI / 90.f;
|
||||
if( angle > tolerance && angle < hsScalarPI - tolerance )
|
||||
const float tolerance = M_PI / 90.f;
|
||||
if( angle > tolerance && angle < M_PI - tolerance )
|
||||
{
|
||||
pointA++;
|
||||
pointB++;
|
||||
@ -526,7 +526,7 @@ void pfGUIControlMod::UpdateBounds( hsMatrix44 *invXformMatrix, hsBool force
|
||||
// Given the x/y coordinates in 0..1 space, recalcs the sceneObject position
|
||||
// and moves the object to match, retaining the stored fCenterZ coordinate
|
||||
|
||||
void pfGUIControlMod::SetObjectCenter( hsScalar x, hsScalar y )
|
||||
void pfGUIControlMod::SetObjectCenter( float x, float y )
|
||||
{
|
||||
hsMatrix44 xformMatrix, l2p, p2l;
|
||||
hsPoint3 center, corners[ 8 ];
|
||||
|
@ -119,7 +119,7 @@ class pfGUIControlMod : public plSingleModifier
|
||||
pfGUIDialogMod *fDialog;
|
||||
|
||||
hsBounds3 fBounds, fInitialBounds; // Z component is 0-1
|
||||
hsScalar fScreenMinZ; // Closest Z coordinate in screen space
|
||||
float fScreenMinZ; // Closest Z coordinate in screen space
|
||||
hsPoint3 fScreenCenter;
|
||||
hsBool fBoundsValid, fCenterValid;
|
||||
hsMatrix44 fXformMatrix; // Only used for doing drag work, etc.
|
||||
@ -144,7 +144,7 @@ class pfGUIControlMod : public plSingleModifier
|
||||
virtual void IPostSetUpDynTextMap( void ) {}
|
||||
virtual void IGrowDTMDimsToDesiredSize( uint16_t &width, uint16_t &height ) { }
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
void ISetDialog( pfGUIDialogMod *mod ) { fDialog = mod; }
|
||||
void IScreenToLocalPt( hsPoint3 &pt );
|
||||
@ -190,9 +190,9 @@ class pfGUIControlMod : public plSingleModifier
|
||||
virtual void Refresh( void );
|
||||
|
||||
virtual void UpdateBounds( hsMatrix44 *invXformMatrix = nil, hsBool force = false );
|
||||
void SetObjectCenter( hsScalar x, hsScalar y );
|
||||
void SetObjectCenter( float x, float y );
|
||||
virtual hsPoint3 GetObjectCenter() { return fScreenCenter; }
|
||||
hsScalar GetScreenMinZ( void ) { return fScreenMinZ; }
|
||||
float GetScreenMinZ( void ) { return fScreenMinZ; }
|
||||
void CalcInitialBounds( void );
|
||||
|
||||
const hsBounds3 &GetBounds( void );
|
||||
|
@ -466,8 +466,8 @@ pfGUIDialogMod *pfGUICtrlGenerator::IGenerateDialog( const char *name, float sc
|
||||
fovX = atan( scrnWidth / ( 2.f * 100.f ) ) * 2.f;
|
||||
fovY = fovX;// * 3.f / 4.f;
|
||||
|
||||
renderMod->SetFovX( fovX * 180.f / hsScalarPI );
|
||||
renderMod->SetFovY( fovY * 180.f / hsScalarPI );
|
||||
renderMod->SetFovX( fovX * 180.f / M_PI );
|
||||
renderMod->SetFovY( fovY * 180.f / M_PI );
|
||||
|
||||
// Create the sceneNode to go with it
|
||||
node = TRACKED_NEW plSceneNode;
|
||||
|
@ -117,7 +117,7 @@ pfGUIDialogMod::~pfGUIDialogMod()
|
||||
// Sometimes it just sucks not having access to the pipeline at just the
|
||||
// right time.
|
||||
|
||||
void pfGUIDialogMod::ScreenToWorldPoint( hsScalar x, hsScalar y, hsScalar z, hsPoint3 &outPt )
|
||||
void pfGUIDialogMod::ScreenToWorldPoint( float x, float y, float z, hsPoint3 &outPt )
|
||||
{
|
||||
plViewTransform view = fRenderMod->GetViewTransform();
|
||||
view.SetScreenSize( 1, 1 );
|
||||
@ -141,7 +141,7 @@ hsPoint3 pfGUIDialogMod::WorldToScreenPoint( const hsPoint3 &inPt )
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIDialogMod::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIDialogMod::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -364,7 +364,7 @@ plKey pfGUIDialogMod::GetSceneNodeKey( void )
|
||||
// Really. We go through and make sure every control marked as interesting
|
||||
// still has the mouse inside it and vice versa.
|
||||
|
||||
void pfGUIDialogMod::UpdateInterestingThings( hsScalar mouseX, hsScalar mouseY, uint8_t modifiers, hsBool modalPreset )
|
||||
void pfGUIDialogMod::UpdateInterestingThings( float mouseX, float mouseY, uint8_t modifiers, hsBool modalPreset )
|
||||
{
|
||||
int i;
|
||||
hsPoint3 mousePoint;
|
||||
@ -405,14 +405,14 @@ void pfGUIDialogMod::UpdateInterestingThings( hsScalar mouseX, hsScalar mouse
|
||||
#include "plPipeline/plDebugText.h"
|
||||
#endif
|
||||
|
||||
hsBool pfGUIDialogMod::HandleMouseEvent( pfGameGUIMgr::EventType event, hsScalar mouseX, hsScalar mouseY,
|
||||
hsBool pfGUIDialogMod::HandleMouseEvent( pfGameGUIMgr::EventType event, float mouseX, float mouseY,
|
||||
uint8_t modifiers )
|
||||
{
|
||||
hsPoint3 mousePoint;
|
||||
uint32_t i;
|
||||
|
||||
pfGUIControlMod *oldInterestingCtrl = nil;
|
||||
hsScalar smallestZ;
|
||||
float smallestZ;
|
||||
|
||||
#ifdef HS_DEBUGGING // Debugging bounds rects
|
||||
static bool showBounds = false;
|
||||
@ -787,7 +787,7 @@ void pfGUIDialogMod::EnterDragMode( pfGUIControlMod *source )
|
||||
void pfGUIDialogMod::IHandleDrag( hsPoint3 &mousePoint, pfGameGUIMgr::EventType event, uint8_t modifiers )
|
||||
{
|
||||
int i;
|
||||
hsScalar smallestZ;
|
||||
float smallestZ;
|
||||
|
||||
|
||||
// First, see if our target control has changed
|
||||
|
@ -91,7 +91,7 @@ class pfGUIDialogMod : public plSingleModifier
|
||||
plKey fSceneNodeKey;
|
||||
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
void IHandleDrag( hsPoint3 &mousePt, pfGameGUIMgr::EventType event, uint8_t modifiers );
|
||||
|
||||
@ -130,13 +130,13 @@ class pfGUIDialogMod : public plSingleModifier
|
||||
|
||||
const char *GetName( void ) { return fName; }
|
||||
|
||||
void ScreenToWorldPoint( hsScalar x, hsScalar y, hsScalar z, hsPoint3 &outPt );
|
||||
void ScreenToWorldPoint( float x, float y, float z, hsPoint3 &outPt );
|
||||
hsPoint3 WorldToScreenPoint( const hsPoint3 &inPt );
|
||||
|
||||
virtual hsBool HandleMouseEvent( pfGameGUIMgr::EventType event, hsScalar mouseX, hsScalar mouseY, uint8_t modifiers );
|
||||
virtual hsBool HandleMouseEvent( pfGameGUIMgr::EventType event, float mouseX, float mouseY, uint8_t modifiers );
|
||||
hsBool HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef key, uint8_t modifiers );
|
||||
hsBool HandleKeyPress( wchar_t key, uint8_t modifiers );
|
||||
void UpdateInterestingThings( hsScalar mouseX, hsScalar mouseY, uint8_t modifiers, hsBool modalPreset );
|
||||
void UpdateInterestingThings( float mouseX, float mouseY, uint8_t modifiers, hsBool modalPreset );
|
||||
|
||||
void SetControlOfInterest( pfGUIControlMod *c );
|
||||
pfGUIControlMod *GetControlOfInterest( void ) const { return fControlOfInterest; }
|
||||
|
@ -78,7 +78,7 @@ pfGUIDragBarCtrl::~pfGUIDragBarCtrl()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIDragBarCtrl::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIDragBarCtrl::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIControlMod::IEval( secs, del, dirty );
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class pfGUIDragBarCtrl : public pfGUIControlMod
|
||||
hsBool fDragging;
|
||||
hsBool fAnchored;
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
virtual uint32_t IGetDesiredCursor( void ) const; // As specified in plInputInterface.h
|
||||
|
||||
|
@ -72,7 +72,7 @@ pfGUIDraggableMod::~pfGUIDraggableMod()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIDraggableMod::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIDraggableMod::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIControlMod::IEval( secs, del, dirty );
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ class pfGUIDraggableMod : public pfGUIControlMod
|
||||
hsBool fDragging;
|
||||
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
virtual uint32_t IGetDesiredCursor( void ) const; // As specified in plInputInterface.h
|
||||
|
||||
|
@ -72,7 +72,7 @@ pfGUIDynDisplayCtrl::~pfGUIDynDisplayCtrl()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIDynDisplayCtrl::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIDynDisplayCtrl::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIControlMod::IEval( secs, del, dirty );
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ class pfGUIDynDisplayCtrl : public pfGUIControlMod
|
||||
|
||||
hsTArray<hsGMaterial *> fMaterials;
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
public:
|
||||
|
||||
|
@ -86,7 +86,7 @@ pfGUIEditBoxMod::~pfGUIEditBoxMod()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIEditBoxMod::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIEditBoxMod::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIControlMod::IEval( secs, del, dirty );
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ class pfGUIEditBoxMod : public pfGUIControlMod
|
||||
plKeyDef fSavedKey;
|
||||
uint8_t fSavedModifiers;
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
virtual void IPostSetUpDynTextMap( void );
|
||||
virtual void IUpdate( void );
|
||||
|
@ -90,7 +90,7 @@ pfGUIKnobCtrl::~pfGUIKnobCtrl()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIKnobCtrl::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIKnobCtrl::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIValueCtrl::IEval( secs, del, dirty );
|
||||
}
|
||||
@ -210,7 +210,7 @@ void pfGUIKnobCtrl::HandleMouseUp( hsPoint3 &mousePt, uint8_t modifiers )
|
||||
|
||||
void pfGUIKnobCtrl::HandleMouseDrag( hsPoint3 &mousePt, uint8_t modifiers )
|
||||
{
|
||||
hsScalar oldValue = fValue, newValue = fDragValue;
|
||||
float oldValue = fValue, newValue = fDragValue;
|
||||
|
||||
if( fDragRangeMin != -1 )
|
||||
{
|
||||
@ -242,7 +242,7 @@ void pfGUIKnobCtrl::HandleMouseDrag( hsPoint3 &mousePt, uint8_t modifiers )
|
||||
}
|
||||
else
|
||||
{
|
||||
hsScalar diff;
|
||||
float diff;
|
||||
if( HasFlag( kLeftRightOrientation ) )
|
||||
diff = ( mousePt.fX - fDragStart.fX ) * 20.f;
|
||||
else
|
||||
@ -284,7 +284,7 @@ hsBool pfGUIKnobCtrl::ICalcAnimTimes( void )
|
||||
if( fAnimTimesCalced )
|
||||
return true;
|
||||
|
||||
hsScalar tBegin = 1e30, tEnd = -1e30;
|
||||
float tBegin = 1e30, tEnd = -1e30;
|
||||
bool foundOne = false;
|
||||
|
||||
for( int i = 0; i < fAnimationKeys.GetCount(); i++ )
|
||||
@ -295,8 +295,8 @@ hsBool pfGUIKnobCtrl::ICalcAnimTimes( void )
|
||||
{
|
||||
for( int j = 0; j < mod->GetNumAnimations(); j++ )
|
||||
{
|
||||
hsScalar begin = mod->GetAnimInstance( j )->GetTimeConvert()->GetBegin();
|
||||
hsScalar end = mod->GetAnimInstance( j )->GetTimeConvert()->GetEnd();
|
||||
float begin = mod->GetAnimInstance( j )->GetTimeConvert()->GetBegin();
|
||||
float end = mod->GetAnimInstance( j )->GetTimeConvert()->GetEnd();
|
||||
if( begin < tBegin )
|
||||
tBegin = begin;
|
||||
if( end > tEnd )
|
||||
@ -308,8 +308,8 @@ hsBool pfGUIKnobCtrl::ICalcAnimTimes( void )
|
||||
plLayerAnimation *layer = plLayerAnimation::ConvertNoRef( fAnimationKeys[ i ]->ObjectIsLoaded() );
|
||||
if( layer != nil )
|
||||
{
|
||||
hsScalar begin = layer->GetTimeConvert().GetBegin();
|
||||
hsScalar end = layer->GetTimeConvert().GetEnd();
|
||||
float begin = layer->GetTimeConvert().GetBegin();
|
||||
float end = layer->GetTimeConvert().GetEnd();
|
||||
if( begin < tBegin )
|
||||
tBegin = begin;
|
||||
if( end > tEnd )
|
||||
@ -331,7 +331,7 @@ hsBool pfGUIKnobCtrl::ICalcAnimTimes( void )
|
||||
|
||||
//// SetCurrValue ////////////////////////////////////////////////////////////
|
||||
|
||||
void pfGUIKnobCtrl::SetCurrValue( hsScalar v )
|
||||
void pfGUIKnobCtrl::SetCurrValue( float v )
|
||||
{
|
||||
int old = (int)fValue;
|
||||
pfGUIValueCtrl::SetCurrValue( v );
|
||||
@ -343,8 +343,8 @@ void pfGUIKnobCtrl::SetCurrValue( hsScalar v )
|
||||
{
|
||||
ICalcAnimTimes();
|
||||
|
||||
hsScalar tLength = fAnimEnd - fAnimBegin;
|
||||
hsScalar newTime = fMin;
|
||||
float tLength = fAnimEnd - fAnimBegin;
|
||||
float newTime = fMin;
|
||||
|
||||
if (fMin != fMax) // Protect against div by zero
|
||||
{
|
||||
|
@ -61,17 +61,17 @@ class pfGUIKnobCtrl : public pfGUIValueCtrl
|
||||
char *fAnimName;
|
||||
|
||||
hsPoint3 fDragStart;
|
||||
hsScalar fDragValue;
|
||||
float fDragValue;
|
||||
hsBool fDragging;
|
||||
|
||||
hsPoint3 fAnimStartPos, fAnimEndPos; // Calculated at export time for kMapToScreenRange
|
||||
hsScalar fDragRangeMin, fDragRangeMax;
|
||||
float fDragRangeMin, fDragRangeMax;
|
||||
|
||||
// Computed once, once an anim is loaded that we can compute this with
|
||||
hsScalar fAnimBegin, fAnimEnd;
|
||||
float fAnimBegin, fAnimEnd;
|
||||
hsBool fAnimTimesCalced;
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
virtual uint32_t IGetDesiredCursor( void ) const; // As specified in plInputInterface.h
|
||||
|
||||
@ -106,7 +106,7 @@ class pfGUIKnobCtrl : public pfGUIValueCtrl
|
||||
|
||||
virtual void UpdateBounds( hsMatrix44 *invXformMatrix = nil, hsBool force = false );
|
||||
|
||||
virtual void SetCurrValue( hsScalar v );
|
||||
virtual void SetCurrValue( float v );
|
||||
|
||||
// Export only
|
||||
void SetAnimationKeys( hsTArray<plKey> &keys, const char *name );
|
||||
|
@ -140,7 +140,7 @@ pfGUIListBoxMod::~pfGUIListBoxMod()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIListBoxMod::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIListBoxMod::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIControlMod::IEval( secs, del, dirty );
|
||||
}
|
||||
@ -242,7 +242,7 @@ void pfGUIListBoxMod::IUpdate( void )
|
||||
{
|
||||
// Shit. Move the scrollPos up to this item at the very least
|
||||
fScrollPos = j;
|
||||
fScrollControl->SetCurrValue( (hsScalar)( (int)fScrollControl->GetMax() - fScrollPos ) );
|
||||
fScrollControl->SetCurrValue( (float)( (int)fScrollControl->GetMax() - fScrollPos ) );
|
||||
fCheckScroll = false;
|
||||
break;
|
||||
}
|
||||
@ -345,7 +345,7 @@ void pfGUIListBoxMod::IUpdate( void )
|
||||
if( anySelected )
|
||||
{
|
||||
fScrollPos = j;
|
||||
fScrollControl->SetCurrValue( (hsScalar)( (int)fScrollControl->GetMax() - fScrollPos ) );
|
||||
fScrollControl->SetCurrValue( (float)( (int)fScrollControl->GetMax() - fScrollPos ) );
|
||||
IUpdate(); // Gotta update again, since we just changed the scrollPos after the fact
|
||||
return;
|
||||
}
|
||||
@ -495,9 +495,9 @@ void pfGUIListBoxMod::ICalcScrollRange( void )
|
||||
// Smaller than the viewing area, so we don't scroll at all
|
||||
fScrollControl->SetRange( 0.f, 0.f );
|
||||
else
|
||||
fScrollControl->SetRange( 0.f, (hsScalar)( i + 1 ) );
|
||||
fScrollControl->SetRange( 0.f, (float)( i + 1 ) );
|
||||
|
||||
fScrollControl->SetCurrValue( (hsScalar)( (int)fScrollControl->GetMax() - fScrollPos ) );
|
||||
fScrollControl->SetCurrValue( (float)( (int)fScrollControl->GetMax() - fScrollPos ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -1044,7 +1044,7 @@ void pfGUIListBoxMod::SetScrollPos( int32_t pos )
|
||||
{
|
||||
if ( pos >= (int)fScrollControl->GetMin() && pos <= (int)fScrollControl->GetMax() )
|
||||
{
|
||||
fScrollControl->SetCurrValue( (hsScalar)pos );
|
||||
fScrollControl->SetCurrValue( (float)pos );
|
||||
fScrollPos = (int)fScrollControl->GetMax() - pos;
|
||||
}
|
||||
IUpdate();
|
||||
|
@ -89,7 +89,7 @@ class pfGUIListBoxMod : public pfGUIControlMod
|
||||
hsTArray<int16_t> fWrapStartIdxs;
|
||||
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
void ICalcScrollRange( void );
|
||||
void ICalcWrapStarts( void );
|
||||
|
@ -189,7 +189,7 @@ pfGUIMultiLineEditCtrl::~pfGUIMultiLineEditCtrl()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIMultiLineEditCtrl::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIMultiLineEditCtrl::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIControlMod::IEval( secs, del, dirty );
|
||||
}
|
||||
@ -240,7 +240,7 @@ void pfGUIMultiLineEditCtrl::SetScrollPosition( int32_t topLine )
|
||||
|
||||
if( fScrollControl != nil )
|
||||
// Scroll control values are reversed
|
||||
fScrollControl->SetCurrValue( fScrollControl->GetMax() - (hsScalar)fScrollPos );
|
||||
fScrollControl->SetCurrValue( fScrollControl->GetMax() - (float)fScrollPos );
|
||||
|
||||
HandleExtendedEvent( pfGUIMultiLineEditCtrl::kScrollPosChanged );
|
||||
|
||||
@ -267,16 +267,16 @@ void pfGUIMultiLineEditCtrl::IUpdateScrollRange( void )
|
||||
{
|
||||
// +1 here because the last visible line is only a partial, but we want to be able to view
|
||||
// full lines all the way to the end.
|
||||
hsScalar newMax = (hsScalar)( fLineStarts.GetCount() - ICalcNumVisibleLines() + 1 );
|
||||
float newMax = (float)( fLineStarts.GetCount() - ICalcNumVisibleLines() + 1 );
|
||||
|
||||
if( newMax != fScrollControl->GetMax() )
|
||||
{
|
||||
fScrollControl->SetRange( 0, (hsScalar)(fLineStarts.GetCount() - ICalcNumVisibleLines() + 1) );
|
||||
fScrollControl->SetRange( 0, (float)(fLineStarts.GetCount() - ICalcNumVisibleLines() + 1) );
|
||||
fScrollControl->SetEnabled( true );
|
||||
if( fScrollPos > fLineStarts.GetCount() - ICalcNumVisibleLines() + 1 )
|
||||
{
|
||||
fScrollPos = fLineStarts.GetCount() - ICalcNumVisibleLines() + 1;
|
||||
fScrollControl->SetCurrValue( fScrollControl->GetMax() - (hsScalar)fScrollPos );
|
||||
fScrollControl->SetCurrValue( fScrollControl->GetMax() - (float)fScrollPos );
|
||||
}
|
||||
|
||||
// All bets are off on scrolling, so refresh the whole area
|
||||
|
@ -111,7 +111,7 @@ class pfGUIMultiLineEditCtrl : public pfGUIControlMod
|
||||
static wchar_t fColorCodeChar, fStyleCodeChar;
|
||||
static uint32_t fColorCodeSize, fStyleCodeSize;
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
virtual void IPostSetUpDynTextMap( void );
|
||||
virtual void IUpdate( void );
|
||||
|
@ -336,7 +336,7 @@ void pfGUIPopUpMenu::SetEnabled( hsBool e )
|
||||
pfGUIDialogMod::SetEnabled( e );
|
||||
}
|
||||
|
||||
void pfGUIPopUpMenu::Show( hsScalar x, hsScalar y )
|
||||
void pfGUIPopUpMenu::Show( float x, float y )
|
||||
{
|
||||
fOriginX = x;
|
||||
fOriginY = y;
|
||||
@ -622,7 +622,7 @@ void pfGUIPopUpMenu::ITearDownMenu( void )
|
||||
|
||||
//// HandleMouseEvent ////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIPopUpMenu::HandleMouseEvent( pfGameGUIMgr::EventType event, hsScalar mouseX, hsScalar mouseY,
|
||||
hsBool pfGUIPopUpMenu::HandleMouseEvent( pfGameGUIMgr::EventType event, float mouseX, float mouseY,
|
||||
uint8_t modifiers )
|
||||
{
|
||||
hsBool r = pfGUIDialogMod::HandleMouseEvent( event, mouseX, mouseY, modifiers );
|
||||
@ -733,7 +733,7 @@ hsGMaterial *pfGUIPopUpMenu::ICreateDynMaterial( void )
|
||||
|
||||
#include "plJPEG/plJPEG.h"
|
||||
|
||||
pfGUIPopUpMenu *pfGUIPopUpMenu::Build( const char *name, pfGUIDialogMod *parent, hsScalar x, hsScalar y, const plLocation &destLoc )
|
||||
pfGUIPopUpMenu *pfGUIPopUpMenu::Build( const char *name, pfGUIDialogMod *parent, float x, float y, const plLocation &destLoc )
|
||||
{
|
||||
float fovX, fovY;
|
||||
|
||||
@ -778,8 +778,8 @@ pfGUIPopUpMenu *pfGUIPopUpMenu::Build( const char *name, pfGUIDialogMod *parent
|
||||
fovX = atan( scrnWidth / ( 2.f * 100.f ) ) * 2.f;
|
||||
fovY = fovX;// * 3.f / 4.f;
|
||||
|
||||
renderMod->SetFovX( fovX * 180.f / hsScalarPI );
|
||||
renderMod->SetFovY( fovY * 180.f / hsScalarPI );
|
||||
renderMod->SetFovX( fovX * 180.f / M_PI );
|
||||
renderMod->SetFovY( fovY * 180.f / M_PI );
|
||||
|
||||
// Create the sceneNode to go with it
|
||||
menu->fParentNode= TRACKED_NEW plSceneNode;
|
||||
|
@ -100,7 +100,7 @@ class pfGUIPopUpMenu : public pfGUIDialogMod
|
||||
|
||||
// Array of info to rebuild our menu from. Note that this is ONLY used when rebuilding
|
||||
hsBool fNeedsRebuilding, fWaitingForSkin;
|
||||
hsScalar fOriginX, fOriginY;
|
||||
float fOriginX, fOriginY;
|
||||
uint16_t fMargin;
|
||||
hsTArray<pfMenuItem> fMenuItems;
|
||||
int32_t fSubMenuOpen;
|
||||
@ -153,9 +153,9 @@ class pfGUIPopUpMenu : public pfGUIDialogMod
|
||||
virtual void Write( hsStream* s, hsResMgr* mgr );
|
||||
|
||||
virtual void SetEnabled( hsBool e );
|
||||
virtual hsBool HandleMouseEvent( pfGameGUIMgr::EventType event, hsScalar mouseX, hsScalar mouseY, uint8_t modifiers );
|
||||
virtual hsBool HandleMouseEvent( pfGameGUIMgr::EventType event, float mouseX, float mouseY, uint8_t modifiers );
|
||||
|
||||
void Show( hsScalar x, hsScalar y );
|
||||
void Show( float x, float y );
|
||||
|
||||
void SetOriginAnchor( plSceneObject *anchor, pfGUIDialogMod *context );
|
||||
void SetAlignment( Alignment a ) { fAlignment = a; }
|
||||
@ -164,7 +164,7 @@ class pfGUIPopUpMenu : public pfGUIDialogMod
|
||||
void AddItem( const wchar_t *name, pfGUICtrlProcObject *handler, pfGUIPopUpMenu *subMenu = nil );
|
||||
void SetSkin( pfGUISkin *skin );
|
||||
|
||||
static pfGUIPopUpMenu *Build( const char *name, pfGUIDialogMod *parent, hsScalar x, hsScalar y, const plLocation &destLoc = plLocation::kGlobalFixedLoc );
|
||||
static pfGUIPopUpMenu *Build( const char *name, pfGUIDialogMod *parent, float x, float y, const plLocation &destLoc = plLocation::kGlobalFixedLoc );
|
||||
|
||||
};
|
||||
|
||||
|
@ -83,7 +83,7 @@ pfGUIProgressCtrl::~pfGUIProgressCtrl()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIProgressCtrl::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIProgressCtrl::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIValueCtrl::IEval( secs, del, dirty );
|
||||
}
|
||||
@ -163,7 +163,7 @@ hsBool pfGUIProgressCtrl::ICalcAnimTimes( void )
|
||||
if( fAnimTimesCalced )
|
||||
return true;
|
||||
|
||||
hsScalar tBegin = 1e30, tEnd = -1e30;
|
||||
float tBegin = 1e30, tEnd = -1e30;
|
||||
bool foundOne = false;
|
||||
|
||||
for( int i = 0; i < fAnimationKeys.GetCount(); i++ )
|
||||
@ -174,8 +174,8 @@ hsBool pfGUIProgressCtrl::ICalcAnimTimes( void )
|
||||
{
|
||||
for( int j = 0; j < mod->GetNumAnimations(); j++ )
|
||||
{
|
||||
hsScalar begin = mod->GetAnimInstance( j )->GetTimeConvert()->GetBegin();
|
||||
hsScalar end = mod->GetAnimInstance( j )->GetTimeConvert()->GetEnd();
|
||||
float begin = mod->GetAnimInstance( j )->GetTimeConvert()->GetBegin();
|
||||
float end = mod->GetAnimInstance( j )->GetTimeConvert()->GetEnd();
|
||||
if( begin < tBegin )
|
||||
tBegin = begin;
|
||||
if( end > tEnd )
|
||||
@ -187,8 +187,8 @@ hsBool pfGUIProgressCtrl::ICalcAnimTimes( void )
|
||||
plLayerAnimation *layer = plLayerAnimation::ConvertNoRef( fAnimationKeys[ i ]->ObjectIsLoaded() );
|
||||
if( layer != nil )
|
||||
{
|
||||
hsScalar begin = layer->GetTimeConvert().GetBegin();
|
||||
hsScalar end = layer->GetTimeConvert().GetEnd();
|
||||
float begin = layer->GetTimeConvert().GetBegin();
|
||||
float end = layer->GetTimeConvert().GetEnd();
|
||||
if( begin < tBegin )
|
||||
tBegin = begin;
|
||||
if( end > tEnd )
|
||||
@ -210,7 +210,7 @@ hsBool pfGUIProgressCtrl::ICalcAnimTimes( void )
|
||||
|
||||
//// SetCurrValue ////////////////////////////////////////////////////////////
|
||||
|
||||
void pfGUIProgressCtrl::SetCurrValue( hsScalar v )
|
||||
void pfGUIProgressCtrl::SetCurrValue( float v )
|
||||
{
|
||||
int old = (int)fValue;
|
||||
|
||||
@ -223,8 +223,8 @@ void pfGUIProgressCtrl::SetCurrValue( hsScalar v )
|
||||
{
|
||||
ICalcAnimTimes();
|
||||
|
||||
hsScalar tLength = fAnimEnd - fAnimBegin;
|
||||
hsScalar newTime;
|
||||
float tLength = fAnimEnd - fAnimBegin;
|
||||
float newTime;
|
||||
|
||||
if( HasFlag( kReverseValues ) )
|
||||
newTime = ( ( fMax - fValue ) / ( fMax - fMin ) ) * tLength + fAnimBegin;
|
||||
@ -240,7 +240,7 @@ void pfGUIProgressCtrl::SetCurrValue( hsScalar v )
|
||||
}
|
||||
}
|
||||
|
||||
void pfGUIProgressCtrl::AnimateToPercentage( hsScalar percent )
|
||||
void pfGUIProgressCtrl::AnimateToPercentage( float percent )
|
||||
{
|
||||
// percent should be a value in range 0.0 to 1.0
|
||||
if (percent >= 0.0f && percent <= 1.0f)
|
||||
@ -262,7 +262,7 @@ void pfGUIProgressCtrl::AnimateToPercentage( hsScalar percent )
|
||||
PlaySound(kAnimateSound, true);
|
||||
|
||||
// setup a timer to call back when we finish animating
|
||||
hsScalar elapsedTime = (fAnimEnd - fAnimBegin) * percent;
|
||||
float elapsedTime = (fAnimEnd - fAnimBegin) * percent;
|
||||
plTimerCallbackMsg *timerMsg = TRACKED_NEW plTimerCallbackMsg(GetKey(), fStopSoundTimer);
|
||||
plgTimerCallbackMgr::NewTimer(elapsedTime, timerMsg);
|
||||
}
|
||||
|
@ -61,11 +61,11 @@ class pfGUIProgressCtrl : public pfGUIValueCtrl
|
||||
char *fAnimName;
|
||||
|
||||
// Computed once, once an anim is loaded that we can compute this with
|
||||
hsScalar fAnimBegin, fAnimEnd;
|
||||
float fAnimBegin, fAnimEnd;
|
||||
hsBool fAnimTimesCalced;
|
||||
hsBool fPlaySound;
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
hsBool ICalcAnimTimes( void );
|
||||
|
||||
@ -92,8 +92,8 @@ class pfGUIProgressCtrl : public pfGUIValueCtrl
|
||||
|
||||
virtual void UpdateBounds( hsMatrix44 *invXformMatrix = nil, hsBool force = false );
|
||||
|
||||
virtual void SetCurrValue( hsScalar v );
|
||||
virtual void AnimateToPercentage( hsScalar percent );
|
||||
virtual void SetCurrValue( float v );
|
||||
virtual void AnimateToPercentage( float percent );
|
||||
|
||||
enum SoundEvents
|
||||
{
|
||||
|
@ -137,7 +137,7 @@ pfGUIRadioGroupCtrl::~pfGUIRadioGroupCtrl()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIRadioGroupCtrl::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIRadioGroupCtrl::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIControlMod::IEval( secs, del, dirty );
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ class pfGUIRadioGroupCtrl : public pfGUIControlMod
|
||||
|
||||
int32_t fValue, fDefaultValue;
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
public:
|
||||
|
||||
|
@ -80,7 +80,7 @@ pfGUITextBoxMod::~pfGUITextBoxMod()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUITextBoxMod::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUITextBoxMod::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIControlMod::IEval( secs, del, dirty );
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ class pfGUITextBoxMod : public pfGUIControlMod
|
||||
bool fUseLocalizationPath;
|
||||
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
|
||||
virtual void IUpdate( void );
|
||||
virtual void IPostSetUpDynTextMap( void );
|
||||
|
@ -119,7 +119,7 @@ pfGUIUpDownPairMod::~pfGUIUpDownPairMod()
|
||||
|
||||
//// IEval ///////////////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIUpDownPairMod::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
hsBool pfGUIUpDownPairMod::IEval( double secs, float del, uint32_t dirty )
|
||||
{
|
||||
return pfGUIValueCtrl::IEval( secs, del, dirty );
|
||||
}
|
||||
@ -228,13 +228,13 @@ void pfGUIUpDownPairMod::Write( hsStream *s, hsResMgr *mgr )
|
||||
}
|
||||
|
||||
|
||||
void pfGUIUpDownPairMod::SetRange( hsScalar min, hsScalar max )
|
||||
void pfGUIUpDownPairMod::SetRange( float min, float max )
|
||||
{
|
||||
pfGUIValueCtrl::SetRange( min, max );
|
||||
IUpdate();
|
||||
}
|
||||
|
||||
void pfGUIUpDownPairMod::SetCurrValue( hsScalar v )
|
||||
void pfGUIUpDownPairMod::SetCurrValue( float v )
|
||||
{
|
||||
pfGUIValueCtrl::SetCurrValue( v );
|
||||
IUpdate();
|
||||
|
@ -70,7 +70,7 @@ class pfGUIUpDownPairMod : public pfGUIValueCtrl
|
||||
pfUpDownBtnProc *fButtonProc;
|
||||
|
||||
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
virtual void IUpdate( void );
|
||||
|
||||
public:
|
||||
@ -89,8 +89,8 @@ class pfGUIUpDownPairMod : public pfGUIValueCtrl
|
||||
virtual void Read( hsStream* s, hsResMgr* mgr );
|
||||
virtual void Write( hsStream* s, hsResMgr* mgr );
|
||||
|
||||
virtual void SetRange( hsScalar min, hsScalar max );
|
||||
virtual void SetCurrValue( hsScalar v );
|
||||
virtual void SetRange( float min, float max );
|
||||
virtual void SetCurrValue( float v );
|
||||
|
||||
/// Export ONLY
|
||||
|
||||
|
@ -66,7 +66,7 @@ pfGUIValueCtrl::~pfGUIValueCtrl()
|
||||
|
||||
//// SetCurrValue ////////////////////////////////////////////////////////////
|
||||
|
||||
void pfGUIValueCtrl::SetCurrValue( hsScalar v )
|
||||
void pfGUIValueCtrl::SetCurrValue( float v )
|
||||
{
|
||||
fValue = v;
|
||||
if( fValue < fMin )
|
||||
@ -77,7 +77,7 @@ void pfGUIValueCtrl::SetCurrValue( hsScalar v )
|
||||
|
||||
//// SetRange ////////////////////////////////////////////////////////////////
|
||||
|
||||
void pfGUIValueCtrl::SetRange( hsScalar min, hsScalar max )
|
||||
void pfGUIValueCtrl::SetRange( float min, float max )
|
||||
{
|
||||
fMin = min;
|
||||
fMax = max;
|
||||
|
@ -55,7 +55,7 @@ class pfGUIValueCtrl : public pfGUIControlMod
|
||||
{
|
||||
protected:
|
||||
|
||||
hsScalar fValue, fMin, fMax, fStep;
|
||||
float fValue, fMin, fMax, fStep;
|
||||
|
||||
|
||||
public:
|
||||
@ -69,15 +69,15 @@ class pfGUIValueCtrl : public pfGUIControlMod
|
||||
virtual void Read( hsStream* s, hsResMgr* mgr );
|
||||
virtual void Write( hsStream* s, hsResMgr* mgr );
|
||||
|
||||
virtual hsScalar GetCurrValue( void ) { return fValue; }
|
||||
virtual void SetCurrValue( hsScalar v );
|
||||
virtual float GetCurrValue( void ) { return fValue; }
|
||||
virtual void SetCurrValue( float v );
|
||||
|
||||
virtual hsScalar GetMin( void ) { return fMin; }
|
||||
virtual hsScalar GetMax( void ) { return fMax; }
|
||||
virtual hsScalar GetStep( void ) { return fStep; }
|
||||
virtual float GetMin( void ) { return fMin; }
|
||||
virtual float GetMax( void ) { return fMax; }
|
||||
virtual float GetStep( void ) { return fStep; }
|
||||
|
||||
virtual void SetRange( hsScalar min, hsScalar max );
|
||||
virtual void SetStep( hsScalar step ) { fStep = step; }
|
||||
virtual void SetRange( float min, float max );
|
||||
virtual void SetStep( float step ) { fStep = step; }
|
||||
|
||||
};
|
||||
|
||||
|
@ -102,7 +102,7 @@ class pfGameUIInputInterface : public plInputInterface
|
||||
virtual uint32_t GetPriorityLevel( void ) const { return kGUISystemPriority; }
|
||||
virtual hsBool InterpretInputEvent( plInputEventMsg *pMsg );
|
||||
virtual uint32_t GetCurrentCursorID( void ) const;
|
||||
virtual hsScalar GetCurrentCursorOpacity( void ) const;
|
||||
virtual float GetCurrentCursorOpacity( void ) const;
|
||||
virtual hsBool HasInterestingCursorID( void ) const { return fHaveInterestingCursor; }
|
||||
virtual hsBool SwitchInterpretOrder( void ) const { return true; }
|
||||
|
||||
@ -561,7 +561,7 @@ void pfGameGUIMgr::IActivateGUI( hsBool activate )
|
||||
//// IHandleMouse ////////////////////////////////////////////////////////////
|
||||
// Distributes mouse events to the dialogs currently active
|
||||
|
||||
hsBool pfGameGUIMgr::IHandleMouse( EventType event, hsScalar mouseX, hsScalar mouseY, uint8_t modifiers, uint32_t *desiredCursor )
|
||||
hsBool pfGameGUIMgr::IHandleMouse( EventType event, float mouseX, float mouseY, uint8_t modifiers, uint32_t *desiredCursor )
|
||||
{
|
||||
pfGUIDialogMod *dlg;
|
||||
|
||||
@ -850,7 +850,7 @@ uint32_t pfGameUIInputInterface::GetCurrentCursorID( void ) const
|
||||
return fCurrentCursor;
|
||||
}
|
||||
|
||||
hsScalar pfGameUIInputInterface::GetCurrentCursorOpacity( void ) const
|
||||
float pfGameUIInputInterface::GetCurrentCursorOpacity( void ) const
|
||||
{
|
||||
if ( pfGameGUIMgr::GetInstance() )
|
||||
return pfGameGUIMgr::GetInstance()->GetCursorOpacity();
|
||||
@ -942,12 +942,12 @@ uint32_t pfGameGUIMgr::GetHighestTag( void )
|
||||
}
|
||||
|
||||
|
||||
void pfGameGUIMgr::SetAspectRatio(hsScalar aspectratio)
|
||||
void pfGameGUIMgr::SetAspectRatio(float aspectratio)
|
||||
{
|
||||
hsScalar oldAspectRatio = fAspectRatio;
|
||||
float oldAspectRatio = fAspectRatio;
|
||||
|
||||
// don't allow the aspectratio below 4:3
|
||||
hsScalar fourThree = 4.0f/3.0f;
|
||||
float fourThree = 4.0f/3.0f;
|
||||
fAspectRatio = aspectratio < fourThree ? fourThree : aspectratio;
|
||||
|
||||
if (fAspectRatio != oldAspectRatio)
|
||||
|
@ -148,8 +148,8 @@ class pfGameGUIMgr : public hsKeyedObject
|
||||
uint32_t fInputCtlIndex;
|
||||
|
||||
uint32_t fDefaultCursor;
|
||||
hsScalar fCursorOpacity;
|
||||
hsScalar fAspectRatio;
|
||||
float fCursorOpacity;
|
||||
float fAspectRatio;
|
||||
|
||||
// This is an array of the dialogs (by name) that need their
|
||||
// receiver key set once they are loaded.
|
||||
@ -167,7 +167,7 @@ class pfGameGUIMgr : public hsKeyedObject
|
||||
|
||||
void IActivateGUI( hsBool activate );
|
||||
|
||||
hsBool IHandleMouse( EventType event, hsScalar mouseX, hsScalar mouseY, uint8_t modifiers, uint32_t *desiredCursor );
|
||||
hsBool IHandleMouse( EventType event, float mouseX, float mouseY, uint8_t modifiers, uint32_t *desiredCursor );
|
||||
hsBool IHandleKeyEvt( EventType event, plKeyDef key, uint8_t modifiers );
|
||||
hsBool IHandleKeyPress( wchar_t key, uint8_t modifiers );
|
||||
|
||||
@ -212,8 +212,8 @@ class pfGameGUIMgr : public hsKeyedObject
|
||||
|
||||
void SetDefaultCursor(uint32_t defaultCursor) { fDefaultCursor = defaultCursor; }
|
||||
uint32_t GetDefaultCursor() { return fDefaultCursor; }
|
||||
void SetCursorOpacity(hsScalar opacity) { fCursorOpacity = opacity; }
|
||||
hsScalar GetCursorOpacity() { return fCursorOpacity; }
|
||||
void SetCursorOpacity(float opacity) { fCursorOpacity = opacity; }
|
||||
float GetCursorOpacity() { return fCursorOpacity; }
|
||||
|
||||
pfGUIPopUpMenu *FindPopUpMenu( const char *name );
|
||||
|
||||
@ -227,8 +227,8 @@ class pfGameGUIMgr : public hsKeyedObject
|
||||
static uint32_t GetNumTags( void );
|
||||
static pfGUITag *GetTag( uint32_t tagIndex );
|
||||
static uint32_t GetHighestTag( void );
|
||||
void SetAspectRatio(hsScalar aspectratio);
|
||||
hsScalar GetAspectRatio() { return fAspectRatio; }
|
||||
void SetAspectRatio(float aspectratio);
|
||||
float GetAspectRatio() { return fAspectRatio; }
|
||||
|
||||
static pfGameGUIMgr *GetInstance( void ) { return fInstance; }
|
||||
};
|
||||
|
Reference in New Issue
Block a user