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:
Martin Natano
2023-04-19 14:22:59 +02:00
parent f39ed52dbf
commit b68ca517e6
111 changed files with 1831 additions and 1785 deletions
+6 -5
View File
@@ -9,6 +9,7 @@
#include "RageLog.h"
#include "RageDisplay.h"
#include <cmath>
#include <numeric>
#define MS_MAX_NAME 32
@@ -71,7 +72,7 @@ void AnimatedTexture::Load( const RString &sTexOrIniPath )
RString sFileName;
float fDelay = 0;
if( pAnimatedTexture->GetAttrValue( sFileKey, sFileName ) &&
pAnimatedTexture->GetAttrValue( sDelayKey, fDelay ) )
pAnimatedTexture->GetAttrValue( sDelayKey, fDelay ) )
{
RString sTranslateXKey = ssprintf( "TranslateX%04d", i );
RString sTranslateYKey = ssprintf( "TranslateY%04d", i );
@@ -85,7 +86,7 @@ void AnimatedTexture::Load( const RString &sTexOrIniPath )
ID.bStretch = true;
ID.bHotPinkColorKey = true;
ID.bMipMaps = true; // use mipmaps in Models
AnimatedTextureState state(
AnimatedTextureState state(
TEXTUREMAN->LoadTexture( ID ),
fDelay,
vOffset
@@ -155,7 +156,7 @@ float AnimatedTexture::GetAnimationLengthSeconds() const
void AnimatedTexture::SetSecondsIntoAnimation( float fSeconds )
{
fSeconds = fmodf( fSeconds, GetAnimationLengthSeconds() );
fSeconds = std::fmod( fSeconds, GetAnimationLengthSeconds() );
m_iCurState = 0;
for( unsigned i=0; i<vFrames.size(); i++ )
@@ -353,7 +354,7 @@ bool msAnimation::LoadMilkshapeAsciiBones( RString sAniName, RString sPath )
/*
* (c) 2003-2004 Chris Danford
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -363,7 +364,7 @@ bool msAnimation::LoadMilkshapeAsciiBones( RString sAniName, RString sPath )
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF