simplify: only accept RectF
This commit is contained in:
+5
-11
@@ -409,11 +409,11 @@ void Actor::HurryTweening( float factor )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actor::ScaleTo( const RectI &rect, StretchType st )
|
void Actor::ScaleTo( const RectF &rect, StretchType st )
|
||||||
{
|
{
|
||||||
// width and height of rectangle
|
// width and height of rectangle
|
||||||
float rect_width = (float) rect.GetWidth();
|
float rect_width = rect.GetWidth();
|
||||||
float rect_height = (float) rect.GetHeight();
|
float rect_height = rect.GetHeight();
|
||||||
|
|
||||||
if( rect_width < 0 ) SetRotationY( 180 );
|
if( rect_width < 0 ) SetRotationY( 180 );
|
||||||
if( rect_height < 0 ) SetRotationX( 180 );
|
if( rect_height < 0 ) SetRotationX( 180 );
|
||||||
@@ -467,12 +467,6 @@ void Actor::SetEffectClock( CString s )
|
|||||||
else ASSERT(0);
|
else ASSERT(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actor::StretchTo( const RectI &r )
|
|
||||||
{
|
|
||||||
RectF r2( (float)r.left, (float)r.top, (float)r.right, (float)r.bottom );
|
|
||||||
StretchTo( r2 );
|
|
||||||
}
|
|
||||||
|
|
||||||
void Actor::StretchTo( const RectF &r )
|
void Actor::StretchTo( const RectF &r )
|
||||||
{
|
{
|
||||||
// width and height of rectangle
|
// width and height of rectangle
|
||||||
@@ -714,8 +708,8 @@ void Actor::HandleCommand( const ParsedCommand &command )
|
|||||||
else if( sName=="effectdelay" ) SetEffectDelay( fParam(1) );
|
else if( sName=="effectdelay" ) SetEffectDelay( fParam(1) );
|
||||||
else if( sName=="effectclock" ) SetEffectClock( sParam(1) );
|
else if( sName=="effectclock" ) SetEffectClock( sParam(1) );
|
||||||
else if( sName=="effectmagnitude" ) SetEffectMagnitude( RageVector3(fParam(1),fParam(2),fParam(3)) );
|
else if( sName=="effectmagnitude" ) SetEffectMagnitude( RageVector3(fParam(1),fParam(2),fParam(3)) );
|
||||||
else if( sName=="scaletocover" ) { RectI R(iParam(1), iParam(2), iParam(3), iParam(4)); ScaleToCover(R); }
|
else if( sName=="scaletocover" ) { RectF R(fParam(1), fParam(2), fParam(3), fParam(4)); ScaleToCover(R); }
|
||||||
else if( sName=="scaletofit" ) { RectI R(iParam(1), iParam(2), iParam(3), iParam(4)); ScaleToFitInside(R); }
|
else if( sName=="scaletofit" ) { RectF R(fParam(1), fParam(2), fParam(3), fParam(4)); ScaleToFitInside(R); }
|
||||||
// Commands that take effect immediately (ignoring the tweening queue):
|
// Commands that take effect immediately (ignoring the tweening queue):
|
||||||
else if( sName=="animate" ) EnableAnimation( bParam(1) );
|
else if( sName=="animate" ) EnableAnimation( bParam(1) );
|
||||||
else if( sName=="setstate" ) SetState( iParam(1) );
|
else if( sName=="setstate" ) SetState( iParam(1) );
|
||||||
|
|||||||
@@ -198,11 +198,10 @@ public:
|
|||||||
|
|
||||||
enum StretchType { fit_inside, cover };
|
enum StretchType { fit_inside, cover };
|
||||||
|
|
||||||
void ScaleToCover( const RectI &rect ) { ScaleTo( rect, cover ); }
|
void ScaleToCover( const RectF &rect ) { ScaleTo( rect, cover ); }
|
||||||
void ScaleToFitInside( const RectI &rect ) { ScaleTo( rect, fit_inside); };
|
void ScaleToFitInside( const RectF &rect ) { ScaleTo( rect, fit_inside); };
|
||||||
void ScaleTo( const RectI &rect, StretchType st );
|
void ScaleTo( const RectF &rect, StretchType st );
|
||||||
|
|
||||||
void StretchTo( const RectI &rect );
|
|
||||||
void StretchTo( const RectF &rect );
|
void StretchTo( const RectF &rect );
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public:
|
|||||||
|
|
||||||
void DrawStrip( float fRightEdgePercent )
|
void DrawStrip( float fRightEdgePercent )
|
||||||
{
|
{
|
||||||
RectI rect;
|
RectF rect;
|
||||||
|
|
||||||
const float fChamberWidthInPercent = 1.0f/NUM_CHAMBERS;
|
const float fChamberWidthInPercent = 1.0f/NUM_CHAMBERS;
|
||||||
const float fStripWidthInPercent = 1.0f/NUM_STRIPS;
|
const float fStripWidthInPercent = 1.0f/NUM_STRIPS;
|
||||||
@@ -177,7 +177,7 @@ public:
|
|||||||
|
|
||||||
void DrawMask( float fPercent )
|
void DrawMask( float fPercent )
|
||||||
{
|
{
|
||||||
RectI rect;
|
RectF rect;
|
||||||
|
|
||||||
int iChamber;
|
int iChamber;
|
||||||
float fChamberOverflowPercent;
|
float fChamberOverflowPercent;
|
||||||
|
|||||||
@@ -781,10 +781,7 @@ void Sprite::ScaleToClipped( float fWidth, float fHeight )
|
|||||||
Sprite::StopUsingCustomCoords();
|
Sprite::StopUsingCustomCoords();
|
||||||
|
|
||||||
// first find the correct zoom
|
// first find the correct zoom
|
||||||
Sprite::ScaleToCover( RectI(0, 0,
|
Sprite::ScaleToCover( RectF(0,0,fWidth,fHeight) );
|
||||||
(int)fWidth,
|
|
||||||
(int)fHeight )
|
|
||||||
);
|
|
||||||
// find which dimension is larger
|
// find which dimension is larger
|
||||||
bool bXDimNeedsToBeCropped = GetZoomedWidth() > fWidth+0.01;
|
bool bXDimNeedsToBeCropped = GetZoomedWidth() > fWidth+0.01;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user