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
+1 -1
View File
@@ -71,7 +71,7 @@ static void AddPart( vector<RString> &AddTo, float level, RString name )
if( level == 0 )
return;
const RString LevelStr = (level == 1)? RString(""): ssprintf( "%i%% ", (int) roundf(level*100) );
const RString LevelStr = (level == 1)? RString(""): ssprintf( "%ld%% ", lroundf(level*100) );
AddTo.push_back( LevelStr + name );
}