Skip to content
Permalink
Browse files

onepad: Cleanup in a few places.

  • Loading branch information...
arcum42 committed Apr 28, 2019
1 parent 6a202c9 commit b270c1bb67de83c0b8423857f54d782f9517a62f
@@ -1,3 +1,22 @@
/*
* PCSX2 Dev Team
* Copyright (C) 2015
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/

#include "GamePad.h"
#ifdef SDL_BUILD
#include "SDL/joystick.h"
@@ -1,7 +1,27 @@
/*
* PCSX2 Dev Team
* Copyright (C) 2015
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/

#pragma once

#include "onepad.h"
#include "controller.h"

#ifdef SDL_BUILD
#include <SDL.h>
#endif
@@ -24,8 +24,11 @@
* Pragmatically, event handing's going in here too.
*/

#if defined(__unix__)
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#endif

#include "keyboard.h"

#ifdef _WIN32
@@ -240,7 +243,10 @@ bool PollX11KeyboardMouseEvent(u32 &pkey)
LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static bool lbutton = false, rbutton = false;
g_key_status.keyboard_state_acces(cpad);
for (int pad = 0; pad < GAMEPAD_NUMBER; ++pad)
{
g_key_status.keyboard_state_acces(pad);
}

switch (msg) {
case WM_KEYDOWN:
@@ -20,6 +20,7 @@
*/

#include "state_management.h"
#include "GamePad.h"

// Typical packet response on the bus
static const u8 ConfigExit[7] = {0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
@@ -28,9 +28,10 @@
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/slider.h>
#include "GamePad.h"
#include "keyboard.h"
#include "onepad.h"

#include "../GamePad.h"
#include "../keyboard.h"
#include "../onepad.h"

class GamepadConfiguration : public wxDialog
{
@@ -28,9 +28,10 @@
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/slider.h>
#include "GamePad.h"
#include "keyboard.h"
#include "onepad.h"

#include "../GamePad.h"
#include "../keyboard.h"
#include "../onepad.h"

class JoystickConfiguration : public wxDialog
{
@@ -35,9 +35,9 @@
#include <string>
#include <sstream>

#include "GamePad.h"
#include "keyboard.h"
#include "onepad.h"
#include "../GamePad.h"
#include "../keyboard.h"
#include "../onepad.h"
#include "opPanel.h"

#include "GamepadConfiguration.h"
@@ -23,8 +23,10 @@

#include "onepad.h"
#include "controller.h"

#ifdef SDL_BUILD
#include <SDL.h>

#define HAT_UP SDL_HAT_UP
#define HAT_DOWN SDL_HAT_DOWN
#define HAT_RIGHT SDL_HAT_RIGHT
@@ -26,9 +26,10 @@
#include <SDL_haptic.h>
#endif

#include "GamePad.h"
#include "onepad.h"
#include "controller.h"
#include "../GamePad.h"
#include "../onepad.h"
#include "../controller.h"

#define NB_EFFECT 2 // Don't use more than two, ps2 only has one for big motor and one for small(like most systems)
// holds all joystick info
class JoystickInfo : GamePad
@@ -24,9 +24,12 @@
* Pragmatically, event handing's going in here too.
*/

#include "keyboard.h"

#if defined(__unix__)
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "keyboard.h"
#endif

#ifdef _WIN32
char *KeysymToChar(int keysym)
@@ -276,7 +279,10 @@ bool PollX11KeyboardMouseEvent(u32 &pkey)
LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static bool lbutton = false, rbutton = false;
key_status->keyboard_state_acces(cpad);
for (int pad = 0; pad < GAMEPAD_NUMBER; ++pad)
{
key_status->keyboard_state_acces(pad);
}

switch (msg)
{
@@ -20,6 +20,7 @@
*/

#include "state_management.h"
#include "GamePad.h"

// Typical packet response on the bus
static const u8 ConfigExit[7] = {0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
@@ -28,9 +28,10 @@
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/slider.h>
#include "GamePad.h"
#include "keyboard.h"
#include "onepad.h"

#include "../GamePad.h"
#include "../keyboard.h"
#include "../onepad.h"

class GamepadConfiguration : public wxDialog
{
@@ -28,9 +28,10 @@
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/slider.h>
#include "GamePad.h"
#include "keyboard.h"
#include "onepad.h"

#include "../GamePad.h"
#include "../keyboard.h"
#include "../onepad.h"

class JoystickConfiguration : public wxDialog
{
@@ -35,9 +35,9 @@
#include <string>
#include <sstream>

#include "GamePad.h"
#include "keyboard.h"
#include "onepad.h"
#include "../GamePad.h"
#include "../keyboard.h"
#include "../onepad.h"
#include "opPanel.h"

#include "GamepadConfiguration.h"

1 comment on commit b270c1b

@arcum42

This comment has been minimized.

Copy link
Contributor Author

commented on b270c1b Apr 28, 2019

Some of this was complained about when I tried running it through Visual Studio, and I noticed missing headers.

Please sign in to comment.
You can’t perform that action at this time.