Skip to content

Commit

Permalink
Merge pull request #1480 from RachelBryk/warn
Browse files Browse the repository at this point in the history
Fix some warnings.
  • Loading branch information
comex committed Nov 3, 2014
2 parents 7c698b0 + 114b0f5 commit 4cf8697
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions Source/Core/DolphinWX/TASInputDlg.cpp
Expand Up @@ -442,7 +442,7 @@ void TASInputDlg::GetKeyBoardInput(u8* data, WiimoteEmu::ReportFeatures rptf, in
{
u8* const coreData = rptf.core ? (data + rptf.core) : nullptr;
u8* const accelData = rptf.accel ? (data + rptf.accel) : nullptr;
u8* const irData = rptf.ir ? (data + rptf.ir) : nullptr;
//u8* const irData = rptf.ir ? (data + rptf.ir) : nullptr;
u8* const extData = rptf.ext ? (data + rptf.ext) : nullptr;

if (coreData)
Expand Down Expand Up @@ -493,7 +493,6 @@ void TASInputDlg::GetValues(u8* data, WiimoteEmu::ReportFeatures rptf, int ext,
u8* const accelData = rptf.accel ? (data + rptf.accel) : nullptr;
u8* const irData = rptf.ir ? (data + rptf.ir) : nullptr;
u8* const extData = rptf.ext ? (data + rptf.ext) : nullptr;
u8 size = rptf.size;

if (coreData)
SetWiiButtons(&((wm_buttons*)coreData)->hex);
Expand Down Expand Up @@ -530,42 +529,42 @@ void TASInputDlg::GetValues(u8* data, WiimoteEmu::ReportFeatures rptf, int ext,
if (mode == 1)
{
memset(irData, 0xFF, sizeof(wm_ir_basic) * 2);
wm_ir_basic* data = (wm_ir_basic*)irData;
wm_ir_basic* ir_data = (wm_ir_basic*)irData;
for (unsigned int i = 0; i < 2; ++i)
{
if (x[i*2] < 1024 && y < 768)
{
data[i].x1 = static_cast<u8>(x[i*2]);
data[i].x1hi = x[i*2] >> 8;
ir_data[i].x1 = static_cast<u8>(x[i*2]);
ir_data[i].x1hi = x[i*2] >> 8;

data[i].y1 = static_cast<u8>(y);
data[i].y1hi = y >> 8;
ir_data[i].y1 = static_cast<u8>(y);
ir_data[i].y1hi = y >> 8;
}
if (x[i*2+1] < 1024 && y < 768)
{
data[i].x2 = static_cast<u8>(x[i*2+1]);
data[i].x2hi = x[i*2+1] >> 8;
ir_data[i].x2 = static_cast<u8>(x[i*2+1]);
ir_data[i].x2hi = x[i*2+1] >> 8;

data[i].y2 = static_cast<u8>(y);
data[i].y2hi = y >> 8;
ir_data[i].y2 = static_cast<u8>(y);
ir_data[i].y2hi = y >> 8;
}
}
}
else
{
memset(data, 0xFF, sizeof(wm_ir_extended) * 4);
wm_ir_extended* const data = (wm_ir_extended*)irData;
wm_ir_extended* const ir_data = (wm_ir_extended*)irData;
for (unsigned int i = 0; i < 4; ++i)
{
if (x[i] < 1024 && y < 768)
{
data[i].x = static_cast<u8>(x[i]);
data[i].xhi = x[i] >> 8;
ir_data[i].x = static_cast<u8>(x[i]);
ir_data[i].xhi = x[i] >> 8;

data[i].y = static_cast<u8>(y);
data[i].yhi = y >> 8;
ir_data[i].y = static_cast<u8>(y);
ir_data[i].yhi = y >> 8;

data[i].size = 10;
ir_data[i].size = 10;
}
}
}
Expand Down Expand Up @@ -799,9 +798,6 @@ void TASInputDlg::OnMouseDownL(wxMouseEvent& event)
stick->x_cont.value = (unsigned int)stick->x_cont.value > stick->x_cont.range ? stick->x_cont.range : stick->x_cont.value;
stick->y_cont.value = (unsigned int)stick->y_cont.value > stick->y_cont.range ? stick->y_cont.range : stick->y_cont.value;

int x = (u8)((double)stick->x_cont.value / (double)stick->x_cont.range * 255.0);
int y = (u8)((double)stick->y_cont.value / (double)stick->y_cont.range * 255.0);

stick->bitmap->SetBitmap(CreateStickBitmap(ptM.x*2, ptM.y*2));

stick->x_cont.text->SetValue(std::to_string(stick->x_cont.value));
Expand Down

0 comments on commit 4cf8697

Please sign in to comment.