More warnings: mark/avert truncating conversions from float.

This commit is contained in:
comex
2013-08-30 00:43:21 -04:00
parent 4f5729dd59
commit 2630169229
6 changed files with 13 additions and 13 deletions

View File

@ -364,7 +364,7 @@ void CUCode_AXWii::GenerateVolumeRamp(u16* output, u16 vol1, u16 vol2, size_t nv
for (size_t i = 0; i < nvals; ++i)
{
curr += (vol2 - vol1) / (float)nvals;
output[i] = curr;
output[i] = (u16) curr;
}
}

View File

@ -119,7 +119,7 @@ void GCPad::GetInput(SPADStatus* const pad)
void GCPad::SetMotor(const u8 on)
{
float state = (float)on / 255;
float force = abs(state - 0.5) * 2;
float force = abs(state - 0.5f) * 2;
if (state < 0.5)
force = -force;

View File

@ -109,18 +109,18 @@ void InputConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event))
if (strcmp((*g)->control_group->name, "Main Stick") == 0)
{
max = (87.0 / 127.0) * 100;
diagonal = (55.0 / 127.0) * 100.0;
max = (87.0f / 127.0f) * 100;
diagonal = (55.0f / 127.0f) * 100.0;
}
else if (strcmp((*g)->control_group->name,"C-Stick") == 0)
{
max = (74.0 / 127.0) * 100;
diagonal = (46.0 / 127.0) * 100;
max = (74.0f / 127.0f) * 100;
diagonal = (46.0f / 127.0f) * 100;
}
else
{
max = (82.0 / 127.0) * 100;
diagonal = (58.0 / 127.0) * 100;
max = (82.0f / 127.0f) * 100;
diagonal = (58.0f / 127.0f) * 100;
}
// polygon corners