Replace RageFastSin and RageFastCos with standard library versions because the standard library is faster. Use fmod in spline evaluation.
This commit is contained in:
+8
-8
@@ -470,7 +470,7 @@ void Actor::PreDraw() // calculate actor properties
|
||||
ssprintf("PercentThroughEffect: %f", fPercentThroughEffect) );
|
||||
|
||||
bool bBlinkOn = fPercentThroughEffect > 0.5f;
|
||||
float fPercentBetweenColors = RageFastSin( (fPercentThroughEffect + 0.25f) * 2 * PI ) / 2 + 0.5f;
|
||||
float fPercentBetweenColors = std::sin( (fPercentThroughEffect + 0.25f) * 2 * PI ) / 2 + 0.5f;
|
||||
ASSERT_M( fPercentBetweenColors >= 0 && fPercentBetweenColors <= 1,
|
||||
ssprintf("PercentBetweenColors: %f, PercentThroughEffect: %f", fPercentBetweenColors, fPercentThroughEffect) );
|
||||
float fOriginalAlpha = tempState.diffuse[0].a;
|
||||
@@ -516,15 +516,15 @@ void Actor::PreDraw() // calculate actor properties
|
||||
break;
|
||||
case rainbow:
|
||||
tempState.diffuse[0] = RageColor(
|
||||
RageFastCos( fPercentBetweenColors*2*PI ) * 0.5f + 0.5f,
|
||||
RageFastCos( fPercentBetweenColors*2*PI + PI * 2.0f / 3.0f ) * 0.5f + 0.5f,
|
||||
RageFastCos( fPercentBetweenColors*2*PI + PI * 4.0f / 3.0f) * 0.5f + 0.5f,
|
||||
std::cos( fPercentBetweenColors*2*PI ) * 0.5f + 0.5f,
|
||||
std::cos( fPercentBetweenColors*2*PI + PI * 2.0f / 3.0f ) * 0.5f + 0.5f,
|
||||
std::cos( fPercentBetweenColors*2*PI + PI * 4.0f / 3.0f) * 0.5f + 0.5f,
|
||||
fOriginalAlpha );
|
||||
for( int i=1; i<NUM_DIFFUSE_COLORS; i++ )
|
||||
tempState.diffuse[i] = tempState.diffuse[0];
|
||||
break;
|
||||
case wag:
|
||||
tempState.rotation += m_vEffectMagnitude * RageFastSin( fPercentThroughEffect * 2.0f * PI );
|
||||
tempState.rotation += m_vEffectMagnitude * std::sin( fPercentThroughEffect * 2.0f * PI );
|
||||
break;
|
||||
case spin:
|
||||
// nothing needs to be here
|
||||
@@ -536,13 +536,13 @@ void Actor::PreDraw() // calculate actor properties
|
||||
break;
|
||||
case bounce:
|
||||
{
|
||||
float fPercentOffset = RageFastSin( fPercentThroughEffect*PI );
|
||||
float fPercentOffset = std::sin( fPercentThroughEffect*PI );
|
||||
tempState.pos += m_vEffectMagnitude * fPercentOffset;
|
||||
}
|
||||
break;
|
||||
case bob:
|
||||
{
|
||||
float fPercentOffset = RageFastSin( fPercentThroughEffect*PI*2 );
|
||||
float fPercentOffset = std::sin( fPercentThroughEffect*PI*2 );
|
||||
tempState.pos += m_vEffectMagnitude * fPercentOffset;
|
||||
}
|
||||
break;
|
||||
@@ -550,7 +550,7 @@ void Actor::PreDraw() // calculate actor properties
|
||||
{
|
||||
float fMinZoom = m_vEffectMagnitude[0];
|
||||
float fMaxZoom = m_vEffectMagnitude[1];
|
||||
float fPercentOffset = RageFastSin( fPercentThroughEffect*PI );
|
||||
float fPercentOffset = std::sin( fPercentThroughEffect*PI );
|
||||
float fZoom = SCALE( fPercentOffset, 0.f, 1.f, fMinZoom, fMaxZoom );
|
||||
tempState.scale *= fZoom;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user