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:
@@ -1,11 +1,13 @@
|
||||
#include "global.h"
|
||||
#include "StreamDisplay.h"
|
||||
#include "GameState.h"
|
||||
#include <float.h>
|
||||
#include "RageDisplay.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "EnumHelper.h"
|
||||
|
||||
#include <cfloat>
|
||||
#include <cmath>
|
||||
|
||||
static const char *StreamTypeNames[] = {
|
||||
"Normal",
|
||||
"Passing",
|
||||
@@ -75,10 +77,10 @@ void StreamDisplay::Update( float fDeltaSecs )
|
||||
// Just move straight to either full or empty.
|
||||
if( m_fPercent <= 0 || m_fPercent >= 1 )
|
||||
{
|
||||
if( fabsf(fDelta) < 0.00001f )
|
||||
if( std::abs(fDelta) < 0.00001f )
|
||||
m_fVelocity = 0; // prevent div/0
|
||||
else
|
||||
m_fVelocity = (fDelta / fabsf(fDelta)) * VELOCITY_MULTIPLIER;
|
||||
m_fVelocity = (fDelta / std::abs(fDelta)) * VELOCITY_MULTIPLIER;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -161,7 +163,7 @@ void StreamDisplay::SetPercent( float fPercent )
|
||||
/*
|
||||
* (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
|
||||
@@ -171,7 +173,7 @@ void StreamDisplay::SetPercent( float fPercent )
|
||||
* 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
|
||||
|
||||
Reference in New Issue
Block a user