Float to int is slow on ppc. It requires a store, a big stall, and then a load. It's even worse on a G5 if the compiler is dumb (and let's face it, I'm using gcc here...). Just use lroundf when we want an int. It will certainly be no slower.

This commit is contained in:
Steve Checkoway
2007-01-02 23:36:44 +00:00
parent 7a6eabd616
commit eb0b26cd82
17 changed files with 37 additions and 37 deletions
+2 -2
View File
@@ -67,7 +67,7 @@ void ScreenNameEntry::ScrollingText::Init( const RString &sName, const vector<fl
void ScreenNameEntry::ScrollingText::DrawPrimitives()
{
const float fFakeBeat = GAMESTATE->m_fSongBeat;
const size_t iClosestIndex = (int)roundf( fFakeBeat ) % g_sNameChars.size();
const size_t iClosestIndex = lroundf( fFakeBeat ) % g_sNameChars.size();
const float fClosestYOffset = GetClosestCharYOffset( fFakeBeat );
size_t iCharIndex = ( iClosestIndex - NUM_CHARS_TO_DRAW_BEHIND + g_sNameChars.size() ) % g_sNameChars.size();
@@ -103,7 +103,7 @@ void ScreenNameEntry::ScrollingText::DrawPrimitives()
char ScreenNameEntry::ScrollingText::GetClosestChar( float fFakeBeat ) const
{
ASSERT( fFakeBeat >= 0.f );
return g_sNameChars[(size_t)roundf(fFakeBeat) % g_sNameChars.size()];
return g_sNameChars[lroundf(fFakeBeat) % g_sNameChars.size()];
}
// return value is relative to gray arrows