OnePad : Add set all buttons + fix bug

Can set all buttons. Buttons labels are not printed correctly in spite of update and refresh
The cause of this problem come from the while in the config_key function which monopolise ressources

Add arrow pictures implementation

OnePad : bug fixed (assert failure)
Modification of copyright
This commit is contained in:
kust2708 2015-10-27 20:07:41 +01:00
parent 823a37aed7
commit 0e602ab50b
9 changed files with 249 additions and 111 deletions

View File

@ -31,6 +31,10 @@ set(onepadGuiResources
${compiled_images}/square.h
${compiled_images}/start.h
${compiled_images}/triangle.h
${compiled_images}/arrow_up.h
${compiled_images}/arrow_bottom.h
${compiled_images}/arrow_left.h
${compiled_images}/arrow_right.h
)
# plugin name
@ -115,7 +119,8 @@ file(MAKE_DIRECTORY ${compiled_images})
foreach(result_file IN ITEMS
analog circle cross dp_bottom dp_left dp_right dp_up dualshock2
joystick_cursor l1 r1 l2 r2 l3 r3 select square start triangle)
joystick_cursor l1 r1 l2 r2 l3 r3 select square start triangle arrow_up
arrow_bottom arrow_left arrow_right)
add_custom_command(
OUTPUT "${compiled_images}/${result_file}.h"
COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl "${image_sources}/${result_file}.png" "${compiled_images}/${result_file}" )

View File

@ -1,4 +1,5 @@
/* OnePAD
/* GamepadConfiguration.cpp
* PCSX2 Dev Team
* Copyright (C) 2015
*
* This program is free software; you can redistribute it and/or modify

View File

@ -1,4 +1,5 @@
/* onepad.h
/* GamepadConfiguration.h
* PCSX2 Dev Team
* Copyright (C) 2015
*
* This program is free software; you can redistribute it and/or modify

View File

@ -1,4 +1,5 @@
/* OnePAD
/* JoystickConfiguration.cpp
* PCSX2 Dev Team
* Copyright (C) 2015
*
* This program is free software; you can redistribute it and/or modify

View File

@ -1,4 +1,5 @@
/* onepad.h
/* JoystickConfiguration.h
* PCSX2 Dev Team
* Copyright (C) 2015
*
* This program is free software; you can redistribute it and/or modify

View File

@ -1,4 +1,5 @@
/* OnePAD
/* dialog.cpp
* PCSX2 Dev Team
* Copyright (C) 2015
*
* This program is free software; you can redistribute it and/or modify
@ -209,6 +210,12 @@ Dialog::Dialog() : wxFrame( NULL, // Parent
padding[Gamepad_config][2] = 50; // X
padding[Gamepad_config][3] = 585; // Y
// Set All Buttons
padding[Set_all][0] = 180; // Width
padding[Set_all][1] = 28; // Height
padding[Set_all][2] = 764; // X
padding[Set_all][3] = 585; // Y
// Apply modifications without exit
padding[Apply][0] = 70; // Width
padding[Apply][1] = 28; // Height
@ -246,9 +253,7 @@ Dialog::Dialog() : wxFrame( NULL, // Parent
// New page creation
this->tab_gamepad->AddPage(
this->pan_tabs[i], // Parent
sstm.str(), // Title
0, // select (if 1 the tab is selected, 0 otherwise)
wxEXPAND // Specifies the optional image index for the new page.
sstm.str() // Title
);
for(int j=0; j<BUTTONS_LENGHT; ++j)
@ -266,6 +271,7 @@ Dialog::Dialog() : wxFrame( NULL, // Parent
this->bt_gamepad[i][JoyL_config]->SetLabel(_T("&Left Joystick Config"));
this->bt_gamepad[i][JoyR_config]->SetLabel(_T("&Right Joystick Config"));
this->bt_gamepad[i][Gamepad_config]->SetLabel(_T("&Gamepad Configuration"));
this->bt_gamepad[i][Set_all]->SetLabel(_T("&Set All Buttons"));
this->bt_gamepad[i][Cancel]->SetLabel(_T("&Cancel"));
this->bt_gamepad[i][Apply]->SetLabel(_T("&Apply"));
this->bt_gamepad[i][Ok]->SetLabel(_T("&Ok"));
@ -337,6 +343,79 @@ void Dialog::OnButtonClicked(wxCommandEvent &event)
this->frm_joystick_config->InitJoystickConfiguration();
this->frm_joystick_config->Show(true);
}
else if(bt_id == Set_all) // If the button ID is equals to the Set_all button ID
{
for(int i=0; i<MAX_KEYS; ++i)
{
bt_tmp = this->bt_gamepad[gamepad_id][i];
switch(i)
{
case PAD_L_UP: // Left joystick (Up) ↑
this->pan_tabs[gamepad_id]->ShowImg(img_l_arrow_up);
break;
case PAD_L_RIGHT: // Left joystick (Right) →
this->pan_tabs[gamepad_id]->ShowImg(img_l_arrow_right);
break;
case PAD_L_DOWN: // Left joystick (Down) ↓
this->pan_tabs[gamepad_id]->ShowImg(img_l_arrow_bottom);
break;
case PAD_L_LEFT: // Left joystick (Left) ←
this->pan_tabs[gamepad_id]->ShowImg(img_l_arrow_left);
break;
case PAD_R_UP: // Right joystick (Up) ↑
this->pan_tabs[gamepad_id]->ShowImg(img_r_arrow_up);
break;
case PAD_R_RIGHT: // Right joystick (Right) →
this->pan_tabs[gamepad_id]->ShowImg(img_r_arrow_right);
break;
case PAD_R_DOWN: // Right joystick (Down) ↓
this->pan_tabs[gamepad_id]->ShowImg(img_r_arrow_bottom);
break;
case PAD_R_LEFT: // Right joystick (Left) ←
this->pan_tabs[gamepad_id]->ShowImg(img_r_arrow_left);
break;
default:
this->pan_tabs[gamepad_id]->ShowImg(i);
break;
}
this->pan_tabs[gamepad_id]->Refresh();
this->pan_tabs[gamepad_id]->Update();
this->config_key(gamepad_id, i);
switch(i)
{
case PAD_L_UP: // Left joystick (Up) ↑
this->pan_tabs[gamepad_id]->HideImg(img_l_arrow_up);
break;
case PAD_L_RIGHT: // Left joystick (Right) →
this->pan_tabs[gamepad_id]->HideImg(img_l_arrow_right);
break;
case PAD_L_DOWN: // Left joystick (Down) ↓
this->pan_tabs[gamepad_id]->HideImg(img_l_arrow_bottom);
break;
case PAD_L_LEFT: // Left joystick (Left) ←
this->pan_tabs[gamepad_id]->HideImg(img_l_arrow_left);
break;
case PAD_R_UP: // Right joystick (Up) ↑
this->pan_tabs[gamepad_id]->HideImg(img_r_arrow_up);
break;
case PAD_R_RIGHT: // Right joystick (Right) →
this->pan_tabs[gamepad_id]->HideImg(img_r_arrow_right);
break;
case PAD_R_DOWN: // Right joystick (Down) ↓
this->pan_tabs[gamepad_id]->HideImg(img_r_arrow_bottom);
break;
case PAD_R_LEFT: // Right joystick (Left) ←
this->pan_tabs[gamepad_id]->HideImg(img_r_arrow_left);
break;
default:
this->pan_tabs[gamepad_id]->HideImg(i);
break;
}
this->pan_tabs[gamepad_id]->Refresh();
this->pan_tabs[gamepad_id]->Update();
usleep(500000); // give enough time to the user to release the button
}
}
else if(bt_id == Ok) // If the button ID is equals to the Ok button ID
{
SaveConfig(); // Save the configuration
@ -367,7 +446,6 @@ void Dialog::JoystickEvent(wxCommandEvent& event)
{
case SDL_KEYDOWN:
case SDL_KEYUP:
fprintf(stderr, "%d\n", events.key.keysym);
break;
case SDL_JOYAXISMOTION:
key = axis_to_key(false, (events.jaxis.value<0), events.jaxis.axis);

View File

@ -1,4 +1,5 @@
/* onepad.h
/* dialog.h
* PCSX2 Dev Team
* Copyright (C) 2015
*
* This program is free software; you can redistribute it and/or modify
@ -41,7 +42,6 @@
#include "GamepadConfiguration.h"
#include "JoystickConfiguration.h"
#include <SDL2/SDL.h>
// Allow to found quickly button id
// e.g L2 → 0, triangle → 4, ...
@ -52,12 +52,13 @@ enum gui_buttons {
JoyL_config, // Left Joystick Configuration
JoyR_config, // Right Joystick Configuration
Gamepad_config, // Gamepad Configuration
Set_all, // Set all buttons
Apply, // Apply modifications without exit
Ok, // Apply modifications and exit
Cancel // Exit without apply modificatons
};
#define BUTTONS_LENGHT 31 // numbers of buttons on the gamepad
#define BUTTONS_LENGHT 32 // numbers of buttons on the gamepad
#define GAMEPAD_NUMBER 2 // numbers of gamepad
#define UPDATE_TIME 5

View File

@ -1,4 +1,5 @@
/* opPanel.cpp
* PCSX2 Dev Team
* Copyright (C) 2015
*
* This program is free software; you can redistribute it and/or modify
@ -36,6 +37,10 @@
#include "ImgHeader/select.h"
#include "ImgHeader/analog.h"
#include "ImgHeader/joystick_cursor.h"
#include "ImgHeader/arrow_up.h"
#include "ImgHeader/arrow_right.h"
#include "ImgHeader/arrow_bottom.h"
#include "ImgHeader/arrow_left.h"
opPanel::opPanel(wxWindow *parent,
wxWindowID id=wxID_ANY,
@ -43,83 +48,92 @@ opPanel::opPanel(wxWindow *parent,
const wxSize &size=wxDefaultSize
): wxPanel( parent, id, pos, size)
{
this->picture[img_background] = EmbeddedImage<res_dualshock2>().GetIcon();
m_picture[img_background] = EmbeddedImage<res_dualshock2>().Get();
this->picture[img_start] = EmbeddedImage<res_start>().GetIcon();
this->picture[img_select] = EmbeddedImage<res_select>().GetIcon();
this->picture[img_analog] = EmbeddedImage<res_analog>().GetIcon();
m_picture[img_start] = EmbeddedImage<res_start>().Get();
m_picture[img_select] = EmbeddedImage<res_select>().Get();
m_picture[img_analog] = EmbeddedImage<res_analog>().Get();
this->picture[img_dp_left] = EmbeddedImage<res_dp_left>().GetIcon();
this->picture[img_dp_right] = EmbeddedImage<res_dp_right>().GetIcon();
this->picture[img_dp_up] = EmbeddedImage<res_dp_up>().GetIcon();
this->picture[img_dp_bottom] = EmbeddedImage<res_dp_bottom>().GetIcon();
m_picture[img_dp_left] = EmbeddedImage<res_dp_left>().Get();
m_picture[img_dp_right] = EmbeddedImage<res_dp_right>().Get();
m_picture[img_dp_up] = EmbeddedImage<res_dp_up>().Get();
m_picture[img_dp_bottom] = EmbeddedImage<res_dp_bottom>().Get();
this->picture[img_square] = EmbeddedImage<res_square>().GetIcon();
this->picture[img_circle] = EmbeddedImage<res_circle>().GetIcon();
this->picture[img_cross] = EmbeddedImage<res_cross>().GetIcon();
this->picture[img_triangle] = EmbeddedImage<res_triangle>().GetIcon();
m_picture[img_square] = EmbeddedImage<res_square>().Get();
m_picture[img_circle] = EmbeddedImage<res_circle>().Get();
m_picture[img_cross] = EmbeddedImage<res_cross>().Get();
m_picture[img_triangle] = EmbeddedImage<res_triangle>().Get();
this->picture[img_l1] = EmbeddedImage<res_l1>().GetIcon();
this->picture[img_l3] = EmbeddedImage<res_l3>().GetIcon();
this->picture[img_l2] = EmbeddedImage<res_l2>().GetIcon();
m_picture[img_l1] = EmbeddedImage<res_l1>().Get();
m_picture[img_l3] = EmbeddedImage<res_l3>().Get();
m_picture[img_l2] = EmbeddedImage<res_l2>().Get();
this->picture[img_r1] = EmbeddedImage<res_r1>().GetIcon();
this->picture[img_r3] = EmbeddedImage<res_r3>().GetIcon();
this->picture[img_r2] = EmbeddedImage<res_r2>().GetIcon();
m_picture[img_r1] = EmbeddedImage<res_r1>().Get();
m_picture[img_r3] = EmbeddedImage<res_r3>().Get();
m_picture[img_r2] = EmbeddedImage<res_r2>().Get();
this->picture[img_left_cursor] = EmbeddedImage<res_joystick_cursor>().GetIcon();
this->picture[img_right_cursor] = EmbeddedImage<res_joystick_cursor>().GetIcon();
m_picture[img_left_cursor] = EmbeddedImage<res_joystick_cursor>().Get();
m_picture[img_right_cursor] = EmbeddedImage<res_joystick_cursor>().Get();
m_picture[img_l_arrow_up] = EmbeddedImage<res_arrow_up>().Get();
m_picture[img_l_arrow_right] = EmbeddedImage<res_arrow_right>().Get();
m_picture[img_l_arrow_bottom] = EmbeddedImage<res_arrow_bottom>().Get();
m_picture[img_l_arrow_left] = EmbeddedImage<res_arrow_left>().Get();
m_picture[img_r_arrow_up] = EmbeddedImage<res_arrow_up>().Get();
m_picture[img_r_arrow_right] = EmbeddedImage<res_arrow_right>().Get();
m_picture[img_r_arrow_bottom] = EmbeddedImage<res_arrow_bottom>().Get();
m_picture[img_r_arrow_left] = EmbeddedImage<res_arrow_left>().Get();
for(int i=0; i<NB_IMG; ++i)
{
this->show_image[i] = false;
this->SaveSize(i);
this->HideImg(i);
m_show_image[i] = false;
HideImg(i);
}
this->ShowImg(img_background);
this->show_image[img_background] = true;
ShowImg(img_background);
m_show_image[img_background] = true;
this->left_cursor_x = 0;
this->left_cursor_y = 0;
this->right_cursor_x = 0;
this->right_cursor_y = 0;
}
void opPanel::SaveSize(int id)
{
this->img_size[id][0] = this->picture[id].GetWidth();
this->img_size[id][1] = this->picture[id].GetHeight();
m_left_cursor_x = 0;
m_left_cursor_y = 0;
m_right_cursor_x = 0;
m_right_cursor_y = 0;
}
void opPanel::HideImg(int id)
{
this->show_image[id] = false;
this->Refresh();
if(id < NB_IMG)
{
m_show_image[id] = false;
Refresh();
}
}
void opPanel::ShowImg(int id)
{
this->show_image[id] = true;
this->Refresh();
if(id < NB_IMG)
{
m_show_image[id] = true;
Refresh();
}
}
void opPanel::MoveJoystick(int axe,int value)
{
if(axe == 0)
{
this->left_cursor_x = value*30/40000;
m_left_cursor_x = value*30/40000;
}
else if(axe == 1)
{
this->left_cursor_y = value*30/40000;
m_left_cursor_y = value*30/40000;
}
else if( axe == 2)
{
this->right_cursor_x = value*30/40000;
m_right_cursor_x = value*30/40000;
}
else
{
this->right_cursor_y = value*30/40000;
m_right_cursor_y = value*30/40000;
}
}
@ -130,75 +144,104 @@ END_EVENT_TABLE()
void opPanel::OnPaint(wxPaintEvent& event)
{
wxPaintDC dc(this);
wxSize sz = GetClientSize();
wxMemoryDC temp_background, temp_start, temp_select, temp_analog, temp_dp_left,
temp_dp_right, temp_dp_up, temp_dp_bottom, temp_l1, temp_r1, temp_L3, temp_l2_2,
temp_R3, temp_r2_2, temp_square, temp_circle, temp_cross, temp_triangle,
temp_left_cursor, temp_right_cursor;
temp_left_cursor, temp_right_cursor, temp_l_arrow_up, temp_l_arrow_right,
temp_l_arrow_bottom, temp_l_arrow_left, temp_r_arrow_up, temp_r_arrow_right,
temp_r_arrow_bottom, temp_r_arrow_left;
temp_background.SelectObject(this->picture[img_background]);
temp_start.SelectObject(this->picture[img_start]);
temp_select.SelectObject(this->picture[img_select]);
temp_analog.SelectObject(this->picture[img_analog]);
temp_dp_left.SelectObject(this->picture[img_dp_left]);
temp_background.SelectObject(m_picture[img_background]);
temp_start.SelectObject(m_picture[img_start]);
temp_select.SelectObject(m_picture[img_select]);
temp_analog.SelectObject(m_picture[img_analog]);
temp_dp_left.SelectObject(m_picture[img_dp_left]);
temp_dp_right.SelectObject(this->picture[img_dp_right]);
temp_dp_up.SelectObject(this->picture[img_dp_up]);
temp_dp_bottom.SelectObject(this->picture[img_dp_bottom]);
temp_l1.SelectObject(this->picture[img_l1]);
temp_r1.SelectObject(this->picture[img_r1]);
temp_L3.SelectObject(this->picture[img_l3]);
temp_l2_2.SelectObject(this->picture[img_l2]);
temp_dp_right.SelectObject(m_picture[img_dp_right]);
temp_dp_up.SelectObject(m_picture[img_dp_up]);
temp_dp_bottom.SelectObject(m_picture[img_dp_bottom]);
temp_l1.SelectObject(m_picture[img_l1]);
temp_r1.SelectObject(m_picture[img_r1]);
temp_L3.SelectObject(m_picture[img_l3]);
temp_l2_2.SelectObject(m_picture[img_l2]);
temp_R3.SelectObject(this->picture[img_r3]);
temp_r2_2.SelectObject(this->picture[img_r2]);
temp_square.SelectObject(this->picture[img_square]);
temp_circle.SelectObject(this->picture[img_circle]);
temp_cross.SelectObject(this->picture[img_cross]);
temp_triangle.SelectObject(this->picture[img_triangle]);
temp_R3.SelectObject(m_picture[img_r3]);
temp_r2_2.SelectObject(m_picture[img_r2]);
temp_square.SelectObject(m_picture[img_square]);
temp_circle.SelectObject(m_picture[img_circle]);
temp_cross.SelectObject(m_picture[img_cross]);
temp_triangle.SelectObject(m_picture[img_triangle]);
temp_left_cursor.SelectObject(this->picture[img_left_cursor]);
temp_right_cursor.SelectObject(this->picture[img_right_cursor]);
temp_left_cursor.SelectObject(m_picture[img_left_cursor]);
temp_right_cursor.SelectObject(m_picture[img_right_cursor]);
if(this->show_image[img_background])
temp_l_arrow_up.SelectObject(m_picture[img_l_arrow_up]);
temp_l_arrow_right.SelectObject(m_picture[img_l_arrow_right]);
temp_l_arrow_bottom.SelectObject(m_picture[img_l_arrow_bottom]);
temp_l_arrow_left.SelectObject(m_picture[img_l_arrow_left]);
temp_r_arrow_up.SelectObject(m_picture[img_r_arrow_up]);
temp_r_arrow_right.SelectObject(m_picture[img_r_arrow_right]);
temp_r_arrow_bottom.SelectObject(m_picture[img_r_arrow_bottom]);
temp_r_arrow_left.SelectObject(m_picture[img_r_arrow_left]);
if(m_show_image[img_background])
dc.Blit(wxPoint(0, 0), temp_background.GetSize(), &temp_background, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_start])
if(m_show_image[img_start])
dc.Blit(wxPoint(526, 296), temp_start.GetSize(), &temp_start, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_select])
if(m_show_image[img_select])
dc.Blit(wxPoint(450, 297), temp_select.GetSize(), &temp_select, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_analog])
if(m_show_image[img_analog])
dc.Blit(wxPoint(489, 358), temp_analog.GetSize(), &temp_analog, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_dp_left])
dc.Blit(wxPoint(335, 292), temp_dp_left.GetSize(), &temp_dp_left, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_dp_right])
if(m_show_image[img_dp_left])
dc.Blit(wxPoint(334, 292), temp_dp_left.GetSize(), &temp_dp_left, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_dp_right])
dc.Blit(wxPoint(378, 292), temp_dp_right.GetSize(), &temp_dp_right, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_dp_up])
if(m_show_image[img_dp_up])
dc.Blit(wxPoint(358, 269), temp_dp_up.GetSize(), &temp_dp_up, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_dp_bottom])
if(m_show_image[img_dp_bottom])
dc.Blit(wxPoint(358, 312), temp_dp_bottom.GetSize(), &temp_dp_bottom, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_l1])
if(m_show_image[img_l1])
dc.Blit(wxPoint(343, 186), temp_l1.GetSize(), &temp_l1, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_r1])
dc.Blit(wxPoint(594, 186), temp_r1.GetSize(), &temp_r1, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_l3])
if(m_show_image[img_r1])
dc.Blit(wxPoint(593, 186), temp_r1.GetSize(), &temp_r1, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_l3])
dc.Blit(wxPoint(409, 344), temp_L3.GetSize(), &temp_L3, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_l2])
dc.Blit(wxPoint(347, 158), temp_l2_2.GetSize(), &temp_l2_2, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_r3])
if(m_show_image[img_l2])
dc.Blit(wxPoint(346, 158), temp_l2_2.GetSize(), &temp_l2_2, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_r3])
dc.Blit(wxPoint(525, 344), temp_R3.GetSize(), &temp_R3, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_r2])
dc.Blit(wxPoint(581, 158), temp_r2_2.GetSize(), &temp_r2_2, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_square])
if(m_show_image[img_r2])
dc.Blit(wxPoint(582, 158), temp_r2_2.GetSize(), &temp_r2_2, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_square])
dc.Blit(wxPoint(573, 287), temp_square.GetSize(), &temp_square, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_circle])
if(m_show_image[img_circle])
dc.Blit(wxPoint(647, 287), temp_circle.GetSize(), &temp_circle, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_cross])
if(m_show_image[img_cross])
dc.Blit(wxPoint(610, 324), temp_cross.GetSize(), &temp_cross, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_triangle])
if(m_show_image[img_triangle])
dc.Blit(wxPoint(610, 250), temp_triangle.GetSize(), &temp_triangle, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_left_cursor])
dc.Blit(wxPoint(439+this->left_cursor_x, 374+this->left_cursor_y), temp_left_cursor.GetSize(), &temp_left_cursor, wxPoint(0, 0), wxCOPY, true);
if(this->show_image[img_right_cursor])
dc.Blit(wxPoint(555+this->right_cursor_x, 374+this->right_cursor_y), temp_right_cursor.GetSize(), &temp_right_cursor, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_left_cursor])
dc.Blit(wxPoint(439+m_left_cursor_x, 374+m_left_cursor_y), temp_left_cursor.GetSize(), &temp_left_cursor, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_right_cursor])
dc.Blit(wxPoint(555+m_right_cursor_x, 374+m_right_cursor_y), temp_right_cursor.GetSize(), &temp_right_cursor, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_l_arrow_up])
dc.Blit(wxPoint(433, 357), temp_l_arrow_up.GetSize(), &temp_l_arrow_up, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_l_arrow_right])
dc.Blit(wxPoint(423, 368), temp_l_arrow_right.GetSize(), &temp_l_arrow_right, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_l_arrow_bottom])
dc.Blit(wxPoint(433, 357), temp_l_arrow_bottom.GetSize(), &temp_l_arrow_bottom, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_l_arrow_left])
dc.Blit(wxPoint(423, 368), temp_l_arrow_left.GetSize(), &temp_l_arrow_left, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_r_arrow_up])
dc.Blit(wxPoint(548, 357), temp_r_arrow_up.GetSize(), &temp_r_arrow_up, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_r_arrow_right])
dc.Blit(wxPoint(539, 368), temp_r_arrow_right.GetSize(), &temp_r_arrow_right, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_r_arrow_bottom])
dc.Blit(wxPoint(548, 357), temp_r_arrow_bottom.GetSize(), &temp_r_arrow_bottom, wxPoint(0, 0), wxCOPY, true);
if(m_show_image[img_r_arrow_left])
dc.Blit(wxPoint(539, 368), temp_r_arrow_left.GetSize(), &temp_r_arrow_left, wxPoint(0, 0), wxCOPY, true);
}

View File

@ -1,4 +1,5 @@
/* opPanel.h
* PCSX2 Dev Team
* Copyright (C) 2015
*
* This program is free software; you can redistribute it and/or modify
@ -45,18 +46,24 @@ enum gui_img {
img_left_cursor,
img_right_cursor,
img_analog,
img_background // background pic
img_background, // background pic
img_l_arrow_up,
img_l_arrow_right,
img_l_arrow_bottom,
img_l_arrow_left,
img_r_arrow_up,
img_r_arrow_right,
img_r_arrow_bottom,
img_r_arrow_left
};
#define NB_IMG 20
#define NB_IMG 28
class opPanel : public wxPanel
{
wxBitmap picture[NB_IMG];
int img_size[NB_IMG][2];
bool show_image[NB_IMG];
int left_cursor_x, left_cursor_y, right_cursor_x, right_cursor_y;
void SaveSize(int);
wxBitmap m_picture[NB_IMG];
bool m_show_image[NB_IMG];
int m_left_cursor_x, m_left_cursor_y, m_right_cursor_x, m_right_cursor_y;
DECLARE_EVENT_TABLE()
void OnPaint(wxPaintEvent& event);