diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2010-04-24 00:44:10 +0000 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2010-04-24 00:44:10 +0000 |
| commit | 23689387e1f00bf045daa44df5c733950cdfb5d2 (patch) | |
| tree | eee9dbd66cdc19e8309791e1bff89a9560d99395 /Source/Plugins/InputPluginCommon/Src/ConfigDiagBitmaps.cpp | |
| parent | 1d8db5ce3f44cf637a88a6521680e2a336ff8f7c (diff) | |
More improvements to new wiimote plugin: Added emulated Drums/Guitar extensions. Wiimote rumble now handled for every output report. Fixed some mem leaks. Hopefully fixed a floating point exception in Linux, thanks to glennrics.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5403 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/InputPluginCommon/Src/ConfigDiagBitmaps.cpp')
| -rw-r--r-- | Source/Plugins/InputPluginCommon/Src/ConfigDiagBitmaps.cpp | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/Source/Plugins/InputPluginCommon/Src/ConfigDiagBitmaps.cpp b/Source/Plugins/InputPluginCommon/Src/ConfigDiagBitmaps.cpp index 04061098e8..0cb19ef610 100644 --- a/Source/Plugins/InputPluginCommon/Src/ConfigDiagBitmaps.cpp +++ b/Source/Plugins/InputPluginCommon/Src/ConfigDiagBitmaps.cpp @@ -79,9 +79,9 @@ void ConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event)) else dc.DrawRectangle( 16, 16, 32, 32 ); - // deadzone circle if ( GROUP_TYPE_CURSOR != (*g)->control_group->type ) { + // deadzone circle dc.SetBrush(*wxLIGHT_GREY_BRUSH); dc.DrawCircle( 32, 32, ((*g)->control_group)->settings[0]->value * 32 ); @@ -166,7 +166,52 @@ void ConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event)) (*g)->static_bitmap->SetBitmap( bitmap ); } break; + case GROUP_TYPE_TRIGGERS : + { + const unsigned int trigger_count = ((unsigned int)((*g)->control_group->controls.size())); + // setup + wxBitmap bitmap( 64, 12*trigger_count+1); + wxMemoryDC dc; + dc.SelectObject(bitmap); + dc.Clear(); + + // draw the shit + dc.SetPen(*wxGREY_PEN); + ControlState deadzone = (*g)->control_group->settings[0]->value; + + unsigned int* const trigs = new unsigned int[trigger_count]; + ((ControllerEmu::Triggers*)(*g)->control_group)->GetState( trigs, 64 ); + + for ( unsigned int n = 0; n < trigger_count; ++n ) + { + ControlState trig_r = (*g)->control_group->controls[n]->control_ref->State(); + + dc.SetBrush(*wxGREY_BRUSH); + dc.DrawRectangle(0, n*12, trig_r*64, 14); + + dc.SetBrush(*wxRED_BRUSH); + dc.DrawRectangle(0, n*12, trigs[n], 14); + } + + delete[] trigs; + // deadzone box + dc.SetPen(*wxLIGHT_GREY_PEN); + dc.SetBrush(*wxTRANSPARENT_BRUSH); + dc.DrawRectangle(0, 0, deadzone*64, trigger_count*14); + + // box outline + // Windows XP color + dc.SetPen(wxPen(_T("#7f9db9"))); + dc.DrawRectangle(0, 0, bitmap.GetWidth(), bitmap.GetHeight()); + + // done drawing + dc.SelectObject(wxNullBitmap); + + // set the shit + (*g)->static_bitmap->SetBitmap( bitmap ); + } + break; case GROUP_TYPE_MIXED_TRIGGERS : { const unsigned int trigger_count = ((unsigned int)((*g)->control_group->controls.size() / 2)); @@ -194,6 +239,9 @@ void ConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event)) dc.DrawRectangle(trig_a*64, n*12, 64+20, 14); dc.DrawRectangle(64, n*12, 32, 14); } + + // threshold box + dc.SetPen(*wxLIGHT_GREY_PEN); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawRectangle(thresh*64, 0, 128, trigger_count*14); |
