File tree 4 files changed +2
-12
lines changed
4 files changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ void idToken::NumberValue( void ) {
87
87
}
88
88
}
89
89
}
90
- intvalue = idMath::Ftou ( floatvalue );
90
+ intvalue = dword ( floatvalue );
91
91
}
92
92
else if ( subtype & TT_DECIMAL ) {
93
93
while ( *p ) {
Original file line number Diff line number Diff line change @@ -173,19 +173,14 @@ TEST_CASE("Math:Rounding") {
173
173
174
174
float xp = i, xm = -i;
175
175
176
- errors += (idMath::Ftou (xp) != xp);
177
-
178
176
errors += (idMath::Ftoi (xp + 0 .25f ) != xp);
179
177
errors += (idMath::Ftoi (xm - 0 .25f ) != xm);
180
- errors += (idMath::Ftou (xp + 0 .25f ) != xp);
181
178
182
179
errors += (idMath::Ftoi (xp + 0 .75f ) != xp);
183
180
errors += (idMath::Ftoi (xm - 0 .75f ) != xm);
184
- errors += (idMath::Ftou (xp + 0 .75f ) != xp);
185
181
186
182
errors += (idMath::Ftoi (xp + 0 .5f ) != xp);
187
183
errors += (idMath::Ftoi (xm - 0 .5f ) != xm);
188
- errors += (idMath::Ftou (xp + 0 .5f ) != xp);
189
184
190
185
errors += (idMath::FtoiFast (xp + 0 .5f ) != (i + (i & 1 ))); // FE_TONEAREST: choose even
191
186
errors += (idMath::FtoiFast (xm - 0 .5f ) != -(i + (i & 1 ))); // FE_TONEAREST: choose even
Original file line number Diff line number Diff line change @@ -175,7 +175,6 @@ class idMath {
175
175
static float Ceil ( float f ); // returns the smallest integer that is greater than or equal to the given value
176
176
static float Rint ( float f ); // returns the nearest integer (ties resolved arbitrarily)
177
177
static int Ftoi ( float f ); // float to int conversion: round to zero
178
- static unsigned int Ftou ( float f ); // float to unsigned conversion: round down
179
178
static int FtoiFast ( float f ); // float to int conversion: round to nearest (ties are rounded to even) --- depends on FPU mode
180
179
181
180
// stgatilov: branchless min and max for floating point values
@@ -901,10 +900,6 @@ ID_INLINE int idMath::FtoiFast( float f ) {
901
900
#endif
902
901
}
903
902
904
- ID_INLINE unsigned int idMath::Ftou ( float f ) {
905
- return (unsigned int ) f;
906
- }
907
-
908
903
ID_FORCE_INLINE float idMath::Fmin ( float a, float b ) {
909
904
#ifdef __SSE__
910
905
return _mm_cvtss_f32 (_mm_min_ss (_mm_set_ss (a), _mm_set_ss (b)));
Original file line number Diff line number Diff line change @@ -677,7 +677,7 @@ int idSoundSystemLocal::AsyncUpdate( int inTime ) {
677
677
dword dwCurrentBlock;
678
678
679
679
// here we do it in samples ( overflows in 27 hours or so )
680
- dwCurrentWritePos = idMath::Ftou ((float )Sys_Milliseconds () * 44 .1f ) % (MIXBUFFER_SAMPLES * ROOM_SLICES_IN_BUFFER);
680
+ dwCurrentWritePos = dword ((float )Sys_Milliseconds () * 44 .1f ) % (MIXBUFFER_SAMPLES * ROOM_SLICES_IN_BUFFER);
681
681
dwCurrentBlock = dwCurrentWritePos / MIXBUFFER_SAMPLES;
682
682
683
683
if ( nextWriteBlock == 0xffffffff ) {
You can’t perform that action at this time.
0 commit comments