diff --git a/Source/Core/InputCommon/Src/Configuration.cpp b/Source/Core/InputCommon/Src/Configuration.cpp index c48e48d05f..f48d6519c8 100644 --- a/Source/Core/InputCommon/Src/Configuration.cpp +++ b/Source/Core/InputCommon/Src/Configuration.cpp @@ -126,11 +126,11 @@ void RadiusAdjustment(s8 &_x, s8 &_y, int _Radius) float Square2CircleDistance(float deg) { // See if we have to adjust the angle - deg = abs(deg); + deg = fabsf(deg); if( (deg > 45 && deg < 135) ) deg = deg - 90; // Calculate distance from center - float val = abs(cos(Deg2Rad(deg))); + float val = fabsf(cos(Deg2Rad(deg))); float Distance = 1 / val; //m_frame->m_pStatusBar2->SetLabel(wxString::Format("Deg:%f Val:%f Dist:%f", deg, val, dist)); diff --git a/Source/Core/InputCommon/Src/ControllerEmu.h b/Source/Core/InputCommon/Src/ControllerEmu.h index 943c001d18..9197bad3f4 100644 --- a/Source/Core/InputCommon/Src/ControllerEmu.h +++ b/Source/Core/InputCommon/Src/ControllerEmu.h @@ -146,8 +146,8 @@ public: // modifier code if ( m ) { - yy = (abs(yy)>deadzone) * sign(yy) * (m + deadzone/2); - xx = (abs(xx)>deadzone) * sign(xx) * (m + deadzone/2); + yy = (fabsf(yy)>deadzone) * sign(yy) * (m + deadzone/2); + xx = (fabsf(xx)>deadzone) * sign(xx) * (m + deadzone/2); } // deadzone / square stick code @@ -160,7 +160,7 @@ public: ControlState ang_cos = cos(ang); // the amt a full square stick would have at current angle - ControlState square_full = std::min( ang_sin ? 1/abs(ang_sin) : 2, ang_cos ? 1/abs(ang_cos) : 2 ); + ControlState square_full = std::min( ang_sin ? 1/fabsf(ang_sin) : 2, ang_cos ? 1/fabsf(ang_cos) : 2 ); // the amt a full stick would have that was ( user setting squareness) at current angle // i think this is more like a pointed circle rather than a rounded square like it should be @@ -259,7 +259,7 @@ public: for ( unsigned int i=0; i<6; i+=2 ) { const float state = controls[i+1]->control_ref->State() - controls[i]->control_ref->State(); - if (abs(state) > deadzone) + if (fabsf(state) > deadzone) *axis++ = (C)((state - (deadzone * sign(state))) / (1 - deadzone) * range + base); //*axis++ = state * range + base; else @@ -288,8 +288,8 @@ public: // modifier code if ( m ) { - yy = (abs(yy)>deadzone) * sign(yy) * (m + deadzone/2); - xx = (abs(xx)>deadzone) * sign(xx) * (m + deadzone/2); + yy = (fabsf(yy)>deadzone) * sign(yy) * (m + deadzone/2); + xx = (fabsf(xx)>deadzone) * sign(xx) * (m + deadzone/2); } // deadzone / circle stick code @@ -302,7 +302,7 @@ public: ControlState ang_cos = cos(ang); // the amt a full square stick would have at current angle - ControlState square_full = std::min( ang_sin ? 1/abs(ang_sin) : 2, ang_cos ? 1/abs(ang_cos) : 2 ); + ControlState square_full = std::min( ang_sin ? 1/fabsf(ang_sin) : 2, ang_cos ? 1/fabsf(ang_cos) : 2 ); // the amt a full stick would have that was ( user setting circular ) at current angle // i think this is more like a pointed circle rather than a rounded square like it should be diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.cpp index 7fa87e5619..4af6f2c886 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.cpp @@ -358,7 +358,7 @@ namespace Clipper float screenDx = 0; float screenDy = 0; - if(abs(dx) > abs(dy)) + if(fabsf(dx) > fabsf(dy)) { if(dx > 0) screenDy = bpmem.lineptwidth.linesize / -12.0f; diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp index f0cd7483e0..17fd435c84 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp @@ -205,8 +205,8 @@ inline void CalculateLOD(s32 &lod, bool &linear, u32 texmap, u32 texcoord) float *uv0 = rasterBlock.Pixel[0][0].Uv[texcoord]; float *uv1 = rasterBlock.Pixel[1][1].Uv[texcoord]; - sDelta = abs(uv0[0] - uv1[0]); - tDelta = abs(uv0[1] - uv1[1]); + sDelta = fabsf(uv0[0] - uv1[0]); + tDelta = fabsf(uv0[1] - uv1[1]); } else { @@ -214,8 +214,8 @@ inline void CalculateLOD(s32 &lod, bool &linear, u32 texmap, u32 texcoord) float *uv1 = rasterBlock.Pixel[1][0].Uv[texcoord]; float *uv2 = rasterBlock.Pixel[0][1].Uv[texcoord]; - sDelta = max(abs(uv0[0] - uv1[0]), abs(uv0[0] - uv2[0])); - tDelta = max(abs(uv0[1] - uv1[1]), abs(uv0[1] - uv2[1])); + sDelta = max(fabsf(uv0[0] - uv1[0]), fabsf(uv0[0] - uv2[0])); + tDelta = max(fabsf(uv0[1] - uv1[1]), fabsf(uv0[1] - uv2[1])); } // get LOD in s28.4 diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuDynamics.cpp b/Source/Plugins/Plugin_Wiimote/Src/EmuDynamics.cpp index d2d7bd3828..6d4c67a9bf 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/EmuDynamics.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/EmuDynamics.cpp @@ -360,7 +360,7 @@ void TiltToAccelerometer(int &_x, int &_y, int &_z, STiltData &_TiltData) and Pitch. But if we select a Z from the smallest of the absolute value of cos(Roll) and cos (Pitch) we get the right values. */ // --------- - if (abs(cos(Roll)) < abs(cos(Pitch))) + if (fabsf(cos(Roll)) < fabsf(cos(Pitch))) z = cos(Roll); else z = cos(Pitch); diff --git a/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteEmu/WiimoteEmu.cpp b/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteEmu/WiimoteEmu.cpp index 55176319b6..470bcb010a 100644 --- a/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteEmu/WiimoteEmu.cpp +++ b/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteEmu/WiimoteEmu.cpp @@ -165,7 +165,8 @@ void EmulateTilt( wm_accel* const accel if (!sideways && upright) one_g[ud] *= -1; - (&accel->x)[ud] = u8(sin( (PI / 2) - std::max( abs(roll), abs(pitch) ) ) * one_g[ud] + zero_g[ud]); + (&accel->x)[ud] = u8(sin((PI / 2) - + std::max(fabsf(roll), fabsf(pitch))) * one_g[ud] + zero_g[ud]); (&accel->x)[lr] = u8(sin(roll) * -one_g[lr] + zero_g[lr]); (&accel->x)[fb] = u8(sin(pitch) * one_g[fb] + zero_g[fb]); }