Clean up math functions
- Remove checking for standard functions from the build system - Prefix all invocations with std:: - Replace suffixed functions with unprefixed versions - Include <cmath> in all files that use it and remove the global include e.g. floorf(x) -> std::floor(x)
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#include "RageSoundUtil.h"
|
||||
#include "RageUtil.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
void RageSoundUtil::Attenuate( float *pBuf, int iSamples, float fVolume )
|
||||
{
|
||||
while( iSamples-- )
|
||||
@@ -91,7 +93,7 @@ void RageSoundUtil::ConvertFloatToNativeInt16( const float *pFrom, int16_t *pTo,
|
||||
{
|
||||
for( int i = 0; i < iSamples; ++i )
|
||||
{
|
||||
int iOut = lrintf( pFrom[i] * 32768.0f );
|
||||
int iOut = std::lrint( pFrom[i] * 32768.0f );
|
||||
pTo[i] = clamp( iOut, -32768, 32767 );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user