diff --git a/Source/Dolphin.sln b/Source/Dolphin.sln index 9d5a543067..7cb910a910 100644 --- a/Source/Dolphin.sln +++ b/Source/Dolphin.sln @@ -56,7 +56,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DolphinWX", "Core\DolphinWX {636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18} = {636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18} {33546D62-7F34-4EA6-A88E-D538B36E16BF} = {33546D62-7F34-4EA6-A88E-D538B36E16BF} {3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63} - {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE} = {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE} {521498BE-6089-4780-8223-E67C22F4E068} = {521498BE-6089-4780-8223-E67C22F4E068} {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} {29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510} @@ -84,8 +83,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VideoCommon", "Core\VideoCo {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_PadDX9", "Plugins\Plugin_PadDX9\Plugin_PadDX9.vcproj", "{805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_nJoy_SDL", "Plugins\Plugin_nJoy_SDL\Plugin_nJoy_SDL.vcproj", "{521498BE-6089-4780-8223-E67C22F4E068}" ProjectSection(ProjectDependencies) = postProject {48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F} @@ -290,18 +287,6 @@ Global {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.Release|Win32.Build.0 = Release|Win32 {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.Release|x64.ActiveCfg = Release|x64 {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.Release|x64.Build.0 = Release|x64 - {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Debug|Win32.ActiveCfg = Debug|Win32 - {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Debug|Win32.Build.0 = Debug|Win32 - {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Debug|x64.ActiveCfg = Debug|x64 - {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Debug|x64.Build.0 = Debug|x64 - {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.DebugFast|Win32.ActiveCfg = DebugFast|Win32 - {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.DebugFast|Win32.Build.0 = DebugFast|Win32 - {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.DebugFast|x64.ActiveCfg = DebugFast|x64 - {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.DebugFast|x64.Build.0 = DebugFast|x64 - {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Release|Win32.ActiveCfg = Release|Win32 - {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Release|Win32.Build.0 = Release|Win32 - {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Release|x64.ActiveCfg = Release|x64 - {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Release|x64.Build.0 = Release|x64 {521498BE-6089-4780-8223-E67C22F4E068}.Debug|Win32.ActiveCfg = Debug|Win32 {521498BE-6089-4780-8223-E67C22F4E068}.Debug|Win32.Build.0 = Debug|Win32 {521498BE-6089-4780-8223-E67C22F4E068}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/Source/Plugins/Plugin_PadDX9/Plugin_PadDX9.vcproj b/Source/Plugins/Plugin_PadDX9/Plugin_PadDX9.vcproj deleted file mode 100644 index b32d826be5..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Plugin_PadDX9.vcproj +++ /dev/null @@ -1,752 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Source/Plugins/Plugin_PadDX9/Src/AboutDlg.cpp b/Source/Plugins/Plugin_PadDX9/Src/AboutDlg.cpp deleted file mode 100644 index c1ebbfee3e..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/AboutDlg.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (C) 2003-2008 Dolphin Project. - -// 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, version 2.0. - -// 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 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ -///////////////////////////////////////////////////////////////////////////////////////////////////// -// M O D U L E B E G I N /////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "resource.h" - -#include "AboutDlg.h" - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// I M P L E M E N T A T I O N ////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -// __________________________________________________________________________________________________ -// OnInitDialog -// -LRESULT -CAboutDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) -{ - CenterWindow(GetParent()); - return TRUE; -} - -// __________________________________________________________________________________________________ -// OnCloseCmd -// -LRESULT -CAboutDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) -{ - EndDialog(wID); - return 0; -} \ No newline at end of file diff --git a/Source/Plugins/Plugin_PadDX9/Src/AboutDlg.h b/Source/Plugins/Plugin_PadDX9/Src/AboutDlg.h deleted file mode 100644 index fd6b4ad1cb..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/AboutDlg.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2003-2008 Dolphin Project. - -// 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, version 2.0. - -// 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 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ -///////////////////////////////////////////////////////////////////////////////////////////////////// -// M O D U L E B E G I N /////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -class CAboutDlg : public CDialogImpl -{ -public: - enum { IDD = IDD_ABOUTPAD }; - - BEGIN_MSG_MAP(CAboutDlg) - MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) - COMMAND_ID_HANDLER(IDOK, OnCloseCmd) - COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd) - END_MSG_MAP() - -// Handler prototypes (uncomment arguments if needed): -// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) -// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) -// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) - - LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - - LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); -}; diff --git a/Source/Plugins/Plugin_PadDX9/Src/ConfigDlg.cpp b/Source/Plugins/Plugin_PadDX9/Src/ConfigDlg.cpp deleted file mode 100644 index 567f7d28de..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/ConfigDlg.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (C) 2003-2008 Dolphin Project. - -// 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, version 2.0. - -// 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 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ -///////////////////////////////////////////////////////////////////////////////////////////////////// -// M O D U L E B E G I N /////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "resource.h" - -#include "ConfigDlg.h" - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// I M P L E M E N T A T I O N ////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -// __________________________________________________________________________________________________ -// OnInitDialog -// -LRESULT -CConfigDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) -{ - return TRUE; -} - -// __________________________________________________________________________________________________ -// OnCloseCmd -// -LRESULT -CConfigDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) -{ - EndDialog(wID); - return 0; -} diff --git a/Source/Plugins/Plugin_PadDX9/Src/ConfigDlg.h b/Source/Plugins/Plugin_PadDX9/Src/ConfigDlg.h deleted file mode 100644 index ac919d98c9..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/ConfigDlg.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2003-2008 Dolphin Project. - -// 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, version 2.0. - -// 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 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ -///////////////////////////////////////////////////////////////////////////////////////////////////// -// M O D U L E B E G I N /////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -class CConfigDlg : public CDialogImpl -{ -public: - enum { IDD = IDD_PADCONFIG }; - - BEGIN_MSG_MAP(CConfigDlg) - MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) - COMMAND_ID_HANDLER(IDOK, OnCloseCmd) - END_MSG_MAP() - -private: - - // Handler prototypes (uncomment arguments if needed): - // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) - // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) - // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) - - LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); -}; diff --git a/Source/Plugins/Plugin_PadDX9/Src/DIHandler.cpp b/Source/Plugins/Plugin_PadDX9/Src/DIHandler.cpp deleted file mode 100644 index d6b73b7bdf..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/DIHandler.cpp +++ /dev/null @@ -1,482 +0,0 @@ -// Copyright (C) 2003-2008 Dolphin Project. - -// 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, version 2.0. - -// 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 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ -///////////////////////////////////////////////////////////////////////////////////////////////////// -// M O D U L E B E G I N /////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include - -#include "PluginSpecs_Pad.h" -#include "MultiDI.h" -#include "DIHandler.h" - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// T Y P E D E F S / D E F I N E S ////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -// Actions used by this app -DIACTION CDIHandler::m_rgGameAction[] = -{ - // Keyboard input mappings - { CDIHandler::INPUT_MAIN_LEFT, DIKEYBOARD_LEFT, 0, TEXT("Main left"), }, - { CDIHandler::INPUT_MAIN_RIGHT, DIKEYBOARD_RIGHT, 0, TEXT("Main right"), }, - { CDIHandler::INPUT_MAIN_UP, DIKEYBOARD_UP, 0, TEXT("Main up"), }, - { CDIHandler::INPUT_MAIN_DOWN, DIKEYBOARD_DOWN, 0, TEXT("Main down"), }, - { CDIHandler::INPUT_CPAD_LEFT, DIKEYBOARD_J, 0, TEXT("CPad left"), }, - { CDIHandler::INPUT_CPAD_RIGHT, DIKEYBOARD_L, 0, TEXT("CPad right"), }, - { CDIHandler::INPUT_CPAD_UP, DIKEYBOARD_I, 0, TEXT("CPad up"), }, - { CDIHandler::INPUT_CPAD_DOWN, DIKEYBOARD_K, 0, TEXT("CPad down"), }, - { CDIHandler::INPUT_DPAD_LEFT, DIKEYBOARD_F, 0, TEXT("DPad left"), }, - { CDIHandler::INPUT_DPAD_RIGHT, DIKEYBOARD_H, 0, TEXT("DPad right"), }, - { CDIHandler::INPUT_DPAD_UP, DIKEYBOARD_T, 0, TEXT("DPad up"), }, - { CDIHandler::INPUT_DPAD_DOWN, DIKEYBOARD_G, 0, TEXT("DPad down"), }, - { CDIHandler::INPUT_BUTTON_START, DIKEYBOARD_RETURN, 0, TEXT("Start"), }, - { CDIHandler::INPUT_BUTTON_A, DIKEYBOARD_X, 0, TEXT("A-Button"), }, - { CDIHandler::INPUT_BUTTON_B, DIKEYBOARD_Y, 0, TEXT("B-Button"), }, - { CDIHandler::INPUT_BUTTON_X, DIKEYBOARD_S, 0, TEXT("X-Button"), }, - { CDIHandler::INPUT_BUTTON_Y, DIKEYBOARD_C, 0, TEXT("Y-Button"), }, - { CDIHandler::INPUT_BUTTON_Z, DIKEYBOARD_D, 0, TEXT("Z-Button"), }, - { CDIHandler::INPUT_BUTTON_L, DIKEYBOARD_Q, 0, TEXT("L-Trigger"), }, - { CDIHandler::INPUT_BUTTON_R, DIKEYBOARD_W, 0, TEXT("R-Trigger"), }, - - // Joystick input mappings - { CDIHandler::INPUT_MAIN_AXIS_LR, DIAXIS_ARCADEP_LATERAL, 0, _T("Main left/right"), }, - { CDIHandler::INPUT_MAIN_AXIS_UD, DIAXIS_ARCADEP_MOVE, 0, _T("Main Up/Down"), }, - { CDIHandler::INPUT_CPAD_AXIS_LR, DIAXIS_ANY_1, 0, _T("CPad left/right"), }, - { CDIHandler::INPUT_CPAD_AXIS_UP, DIAXIS_ANY_2, 0, _T("CPad Up/Down"), }, - { CDIHandler::INPUT_DPAD_AXIS_LR, DIPOV_ANY_1, 0, _T("DPad left/right"), }, - { CDIHandler::INPUT_DPAD_AXIS_UP, DIPOV_ANY_2, 0, _T("DPad Up/Down"), }, -}; - -const GUID g_guidApp = { 0x3afabad0, 0xd2c0, 0x4514, { 0xb4, 0x7e, 0x65, 0xfe, 0xf9, 0xb5, 0x14, 0x2e } }; -#define SAMPLE_KEY TEXT("Emulator\\Dolphin\\PadPlugin2") -#define NUMBER_OF_GAMEACTIONS (sizeof(m_rgGameAction)/sizeof(DIACTION)) - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// I M P L E M E N T A T I O N ////////////////////////// //////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -// ________________________________________________________________________________________ __________ -// constructor -// -CDIHandler::CDIHandler(void) : - m_hWnd(NULL), - m_pInputDeviceManager(NULL) -{ -} - -// ________________________________________________________________________________________ __________ -// destructor -// -CDIHandler::~CDIHandler(void) -{ - CleanupDirectInput(); -} - -// ________________________________________________________________________________________ __________ -// InitInput -// -HRESULT -CDIHandler::InitInput(HWND _hWnd) -{ - if (m_hWnd == _hWnd) - return S_OK; - - CleanupDirectInput(); - - m_hWnd = _hWnd; - - HRESULT hr; - - // Setup action format for the actual gameplay - ZeroMemory( &m_diafGame, sizeof(DIACTIONFORMAT) ); - m_diafGame.dwSize = sizeof(DIACTIONFORMAT); - m_diafGame.dwActionSize = sizeof(DIACTION); - m_diafGame.dwDataSize = NUMBER_OF_GAMEACTIONS * sizeof(DWORD); - m_diafGame.guidActionMap = g_guidApp; - m_diafGame.dwGenre = DIVIRTUAL_ARCADE_PLATFORM; - m_diafGame.dwNumActions = NUMBER_OF_GAMEACTIONS; - m_diafGame.rgoAction = m_rgGameAction; - m_diafGame.lAxisMin = -100; - m_diafGame.lAxisMax = 100; - m_diafGame.dwBufferSize = 32; - _tcscpy_s( m_diafGame.tszActionMap, _T("Dolphin Pad Plugin") ); - - // Create a new input device manager - m_pInputDeviceManager = new CMultiplayerInputDeviceManager( SAMPLE_KEY ); - - if( FAILED( hr = ChangeNumPlayers( 1, FALSE, FALSE ) ) ) - { - MessageBox(NULL, "InitInput", "Pad", MB_OK); - return S_FALSE; - } - - return S_OK; -} - -// ________________________________________________________________________________________ __________ -// ConfigInput -// -void -CDIHandler::ConfigInput(void) -{ - HRESULT hr; - - CleanupDeviceStateStructs(); - - // Configure the devices (with edit capability) - hr = m_pInputDeviceManager->ConfigureDevices( m_hWnd, NULL, NULL, DICD_EDIT, NULL ); - if( FAILED(hr) ) - { - if( hr == E_DIUTILERR_PLAYERWITHOUTDEVICE ) - { - // There's a player that hasn't been assigned a device. Some games may - // want to handle this by reducing the number of players, or auto-assigning - // a device, or warning the user, etc. - MessageBox( m_hWnd, TEXT("There is at least one player that wasn't assigned ") \ - TEXT("a device\n") \ - TEXT("Press OK to auto-assign a device to these users"), - TEXT("Player Without Device"), MB_OK | MB_ICONEXCLAMATION ); - } - - // Auto-reassign every player a device. - ChangeNumPlayers( m_dwNumPlayers, FALSE, FALSE ); - } -} - -// ________________________________________________________________________________________ __________ -// CleanupDirectInput -// -void -CDIHandler::CleanupDirectInput(void) -{ - if( NULL == m_pInputDeviceManager ) - return; - - CleanupDeviceStateStructs(); - - // Cleanup DirectX input objects - SAFE_DELETE( m_pInputDeviceManager ); -} - -// ________________________________________________________________________________________ __________ -// CleanupDeviceStateStructs -// -void -CDIHandler::CleanupDeviceStateStructs(void) -{ - // Get access to the list of semantically-mapped input devices - // to delete all InputDeviceState structs before calling ConfigureDevices() - CMultiplayerInputDeviceManager::DeviceInfo* pDeviceInfos; - DWORD dwNumDevices; - - m_pInputDeviceManager->GetDevices( &pDeviceInfos, &dwNumDevices ); - - for( DWORD i=0; iCreate( m_hWnd, strUserNames, m_dwNumPlayers, &m_diafGame, - StaticInputAddDeviceCB, NULL, - bResetOwnership, bResetMappings ); - - if( FAILED(hr) ) - { - switch( hr ) - { - case E_DIUTILERR_DEVICESTAKEN: - { - // It's possible that a single user could "own" too many devices for the other - // players to get into the game. If so, we reinit the manager class to provide - // each user with a device that has a default configuration. - bResetOwnership = TRUE; - - MessageBox( m_hWnd, TEXT("You have entered more users than there are suitable ") \ - TEXT("devices, or some users are claiming too many devices.\n") \ - TEXT("Press OK to give each user a default device"), - TEXT("Devices Are Taken"), MB_OK | MB_ICONEXCLAMATION ); - break; - } - - case E_DIUTILERR_TOOMANYUSERS: - { - // Another common error is if more users are attempting to play than there are devices - // attached to the machine. In this case, the number of players is automatically - // lowered to make playing the game possible. - DWORD dwNumDevices = m_pInputDeviceManager->GetNumDevices(); - m_dwNumPlayers = dwNumDevices; - - TCHAR sz[256]; - wsprintf( sz, TEXT("There are not enough devices attached to the ") \ - TEXT("system for the number of users you entered.\nThe ") \ - TEXT("number of users has been automatically changed to ") \ - TEXT("%i (the number of devices available on the system)."), - m_dwNumPlayers ); - MessageBox( m_hWnd, sz, _T("Too Many Users"), MB_OK | MB_ICONEXCLAMATION ); - break; - } - default: - MessageBox(NULL, "Error creating DirectInput device.", "Pad DX9", MB_OK); - return S_FALSE; - } - - m_pInputDeviceManager->Cleanup(); - } - else - { - bSuccess = TRUE; - } - } - - return S_OK; -} - -// ________________________________________________________________________________________ __________ -// UpdateInput -// -void -CDIHandler::UpdateInput(void) -{ - if( NULL == m_pInputDeviceManager ) - return; - - CMultiplayerInputDeviceManager::DeviceInfo* pDeviceInfos; - DWORD dwNumDevices; - - // Get access to the list of semantically-mapped input devices - m_pInputDeviceManager->GetDevices( &pDeviceInfos, &dwNumDevices ); - - // Loop through all devices and check game input - for( DWORD i=0; ifMainLR = 0.0f; - pInputDeviceState->fMainUP = 0.0f; - pInputDeviceState->fCPadLR = 0.0f; - pInputDeviceState->fCPadUP = 0.0f; - pInputDeviceState->fDPadLR = 0.0f; - pInputDeviceState->fDPadUP = 0.0f; - pInputDeviceState->fTriggerL = 0.0f; - pInputDeviceState->fTriggerR = 0.0f; - } - - hr = pdidDevice->Acquire(); - hr = pdidDevice->Poll(); - hr = pdidDevice->GetDeviceData( sizeof(DIDEVICEOBJECTDATA), rgdod, &dwItems, 0 ); - if( FAILED(hr) ) - continue; - - // Get the sematics codes for the game menu - for( DWORD j=0; jfMainLR = fAxisState; break; - case INPUT_MAIN_AXIS_UD: pInputDeviceState->fMainUP = fAxisState; break; - case INPUT_CPAD_AXIS_LR: pInputDeviceState->fCPadLR = fAxisState; break; - case INPUT_CPAD_AXIS_UP: pInputDeviceState->fCPadUP = fAxisState; break; - case INPUT_DPAD_AXIS_LR: pInputDeviceState->fDPadLR = fAxisState; break; - case INPUT_DPAD_AXIS_UP: pInputDeviceState->fDPadUP = fAxisState; break; - - // Handle buttons separately so the button state data - // doesn't overwrite the axis state data, and handle - // each button separately so they don't overwrite each other - case INPUT_MAIN_LEFT: pInputDeviceState->bMainLeft = bButtonState; break; - case INPUT_MAIN_RIGHT: pInputDeviceState->bMainRight = bButtonState; break; - case INPUT_MAIN_UP: pInputDeviceState->bMainUp = bButtonState; break; - case INPUT_MAIN_DOWN: pInputDeviceState->bMainDown = bButtonState; break; - case INPUT_CPAD_LEFT: pInputDeviceState->bCPadLeft = bButtonState; break; - case INPUT_CPAD_RIGHT: pInputDeviceState->bCPadRight = bButtonState; break; - case INPUT_CPAD_UP: pInputDeviceState->bCPadUp = bButtonState; break; - case INPUT_CPAD_DOWN: pInputDeviceState->bCPadDown = bButtonState; break; - case INPUT_DPAD_LEFT: pInputDeviceState->bDPadLeft = bButtonState; break; - case INPUT_DPAD_RIGHT: pInputDeviceState->bDPadRight = bButtonState; break; - case INPUT_DPAD_UP: pInputDeviceState->bDPadUp = bButtonState; break; - case INPUT_DPAD_DOWN: pInputDeviceState->bDPadDown = bButtonState; break; - - case INPUT_BUTTON_START: pInputDeviceState->bButtonStart = bButtonState; break; - case INPUT_BUTTON_A: pInputDeviceState->bButtonA = bButtonState; break; - case INPUT_BUTTON_B: pInputDeviceState->bButtonB = bButtonState; break; - case INPUT_BUTTON_X: pInputDeviceState->bButtonX = bButtonState; break; - case INPUT_BUTTON_Y: pInputDeviceState->bButtonY = bButtonState; break; - case INPUT_BUTTON_Z: pInputDeviceState->bButtonZ = bButtonState; break; - case INPUT_BUTTON_L: pInputDeviceState->fTriggerL = bButtonState; break; - case INPUT_BUTTON_R: pInputDeviceState->fTriggerR = bButtonState; break; - } - } - } - - for( DWORD iPlayer=0; iPlayerdwPlayerIndex != iPlayer ) - continue; - - SUserInput* pInputDeviceState = (SUserInput*)pDeviceInfos[i].pParam; - - // main-axis - if( fabs(pInputDeviceState->fMainLR) > fabs(ctrlInput.fMainLR) ) - ctrlInput.fMainLR = pInputDeviceState->fMainLR; - if( fabs(pInputDeviceState->fMainUP) > fabs(ctrlInput.fMainUP) ) - ctrlInput.fMainUP = pInputDeviceState->fMainUP; - - if (pInputDeviceState->bMainLeft) ctrlInput.fMainLR = -1.0f; - if (pInputDeviceState->bMainRight) ctrlInput.fMainLR = 1.0f; - if (pInputDeviceState->bMainUp) ctrlInput.fMainUP = -1.0f; - if (pInputDeviceState->bMainDown) ctrlInput.fMainUP = 1.0f; - - // CPad-axis - if( fabs(pInputDeviceState->fCPadLR) > fabs(ctrlInput.fCPadLR) ) - ctrlInput.fCPadLR = pInputDeviceState->fCPadLR; - if( fabs(pInputDeviceState->fCPadUP) > fabs(ctrlInput.fCPadUP) ) - ctrlInput.fCPadUP = pInputDeviceState->fCPadUP; - - if (pInputDeviceState->bCPadLeft) ctrlInput.fCPadLR = -1.0f; - if (pInputDeviceState->bCPadRight) ctrlInput.fCPadLR = 1.0f; - if (pInputDeviceState->bCPadUp) ctrlInput.fCPadUP = -1.0f; - if (pInputDeviceState->bCPadDown) ctrlInput.fCPadUP = 1.0f; - - // DPad-axis - if( fabs(pInputDeviceState->fDPadLR) > fabs(ctrlInput.fDPadLR) ) - ctrlInput.fDPadLR = pInputDeviceState->fDPadLR; - if( fabs(pInputDeviceState->fDPadUP) > fabs(ctrlInput.fDPadUP) ) - ctrlInput.fDPadUP = pInputDeviceState->fDPadUP; - - if (pInputDeviceState->bDPadLeft) ctrlInput.fDPadLR = -1.0f; - if (pInputDeviceState->bDPadRight) ctrlInput.fDPadLR = 1.0f; - if (pInputDeviceState->bDPadUp) ctrlInput.fDPadUP = -1.0f; - if (pInputDeviceState->bDPadDown) ctrlInput.fDPadUP = 1.0f; - - // buttons - if (pInputDeviceState->bButtonA) ctrlInput.bButtonA = true; - if (pInputDeviceState->bButtonB) ctrlInput.bButtonB = true; - if (pInputDeviceState->bButtonX) ctrlInput.bButtonX = true; - if (pInputDeviceState->bButtonY) ctrlInput.bButtonY = true; - if (pInputDeviceState->bButtonZ) ctrlInput.bButtonZ = true; - if (pInputDeviceState->bButtonStart)ctrlInput.bButtonStart = true; - if (pInputDeviceState->fTriggerL) ctrlInput.fTriggerL = true; - if (pInputDeviceState->fTriggerR) ctrlInput.fTriggerR = true; - } - } -} - -// ________________________________________________________________________________________ __________ -// StaticInputAddDeviceCB -// -HRESULT CALLBACK -CDIHandler::StaticInputAddDeviceCB( CMultiplayerInputDeviceManager::PlayerInfo* pPlayerInfo, - CMultiplayerInputDeviceManager::DeviceInfo* pDeviceInfo, - const DIDEVICEINSTANCE* pdidi, - LPVOID pParam) -{ - CDIHandler* pApp = (CDIHandler*) pParam; - return pApp->InputAddDeviceCB( pPlayerInfo, pDeviceInfo, pdidi ); -} - -// ________________________________________________________________________________________ __________ -// InputAddDeviceCB -// -HRESULT -CDIHandler::InputAddDeviceCB( CMultiplayerInputDeviceManager::PlayerInfo* pPlayerInfo, - CMultiplayerInputDeviceManager::DeviceInfo* pDeviceInfo, - const DIDEVICEINSTANCE* pdidi) -{ - if( (GET_DIDEVICE_TYPE(pdidi->dwDevType) != DI8DEVTYPE_KEYBOARD) && - (GET_DIDEVICE_TYPE(pdidi->dwDevType) != DI8DEVTYPE_MOUSE) ) - { - // Setup the deadzone - DIPROPDWORD dipdw; - dipdw.diph.dwSize = sizeof(DIPROPDWORD); - dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); - dipdw.diph.dwObj = 0; - dipdw.diph.dwHow = DIPH_DEVICE; - dipdw.dwData = 500; - pDeviceInfo->pdidDevice->SetProperty( DIPROP_DEADZONE, &dipdw.diph ); - } - - // Create a new InputDeviceState for each device so the - // app can record its state - SUserInput* pNewInputDeviceState = new SUserInput; - ZeroMemory( pNewInputDeviceState, sizeof(SUserInput) ); - pDeviceInfo->pParam = (LPVOID) pNewInputDeviceState; - - return S_OK; -} \ No newline at end of file diff --git a/Source/Plugins/Plugin_PadDX9/Src/DIHandler.h b/Source/Plugins/Plugin_PadDX9/Src/DIHandler.h deleted file mode 100644 index 30fa2369e8..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/DIHandler.h +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (C) 2003-2008 Dolphin Project. - -// 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, version 2.0. - -// 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 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ -///////////////////////////////////////////////////////////////////////////////////////////////////// -// M O D U L E B E G I N /////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - - -// Struct to store the current input state -struct SControllerInput -{ - float fMainLR; - float fMainUP; - float fCPadLR; - float fCPadUP; - float fDPadLR; - float fDPadUP; - - bool bButtonStart; - bool bButtonA; - bool bButtonB; - bool bButtonX; - bool bButtonY; - bool bButtonZ; - - float fTriggerL; - float fTriggerR; -}; - -class CDIHandler -{ -public: - CDIHandler(void); - - ~CDIHandler(void); - - HRESULT InitInput(HWND _hWnd); - void ConfigInput(void); - void CleanupDirectInput(void); - void UpdateInput(void); - - const SControllerInput& GetControllerInput(unsigned int _number) - { - return m_controllerInput[_number]; - } - -private: - - enum - { - MAX_AXIS = 127 - }; - - enum INPUT_SEMANTICS - { - // Gameplay semantics - INPUT_MAIN_AXIS_LR=1, - INPUT_MAIN_AXIS_UD, - INPUT_MAIN_LEFT, - INPUT_MAIN_RIGHT, - INPUT_MAIN_UP, - INPUT_MAIN_DOWN, - INPUT_CPAD_AXIS_LR, - INPUT_CPAD_AXIS_UP, - INPUT_CPAD_LEFT, - INPUT_CPAD_RIGHT, - INPUT_CPAD_UP, - INPUT_CPAD_DOWN, - INPUT_DPAD_AXIS_LR, - INPUT_DPAD_AXIS_UP, - INPUT_DPAD_LEFT, - INPUT_DPAD_RIGHT, - INPUT_DPAD_UP, - INPUT_DPAD_DOWN, - INPUT_BUTTON_START, - INPUT_BUTTON_A, - INPUT_BUTTON_B, - INPUT_BUTTON_X, - INPUT_BUTTON_Y, - INPUT_BUTTON_Z, - INPUT_BUTTON_L, - INPUT_BUTTON_R - }; - - // Struct to store the current input state - struct SUserInput - { - bool bMainLeft; - bool bMainRight; - bool bMainUp; - bool bMainDown; - float fMainLR; - float fMainUP; - - bool bCPadLeft; - bool bCPadRight; - bool bCPadUp; - bool bCPadDown; - float fCPadLR; - float fCPadUP; - - bool bDPadLeft; - bool bDPadRight; - bool bDPadUp; - bool bDPadDown; - float fDPadLR; - float fDPadUP; - - bool bButtonStart; - bool bButtonA; - bool bButtonB; - bool bButtonX; - bool bButtonY; - bool bButtonZ; - - bool fTriggerL; - bool fTriggerR; - }; - - // handle to window that "owns" the DInput - HWND m_hWnd; - - static DIACTION m_rgGameAction[]; - - // DirectInput multiplayer device manager - CMultiplayerInputDeviceManager* m_pInputDeviceManager; - - // Action format for game play - DIACTIONFORMAT m_diafGame; - - // Struct for storing user input - SControllerInput m_controllerInput[4]; - - // Number of players in the game - DWORD m_dwNumPlayers; - - void CleanupDeviceStateStructs(void); - - HRESULT ChangeNumPlayers(DWORD _dwNumPlayers, BOOL _bResetOwnership, BOOL _bResetMappings); - - static HRESULT CALLBACK StaticInputAddDeviceCB(CMultiplayerInputDeviceManager::PlayerInfo* _pPlayerInfo, - CMultiplayerInputDeviceManager::DeviceInfo* _pDeviceInfo, - const DIDEVICEINSTANCE* _pdidi, - LPVOID _pParam); - - HRESULT InputAddDeviceCB(CMultiplayerInputDeviceManager::PlayerInfo* _pPlayerInfo, - CMultiplayerInputDeviceManager::DeviceInfo* _pDeviceInfo, - const DIDEVICEINSTANCE* _pdidi); -}; \ No newline at end of file diff --git a/Source/Plugins/Plugin_PadDX9/Src/IniFile.cpp b/Source/Plugins/Plugin_PadDX9/Src/IniFile.cpp deleted file mode 100644 index dd8ec233d3..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/IniFile.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (C) 2003-2008 Dolphin Project. - -// 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, version 2.0. - -// 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 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ -///////////////////////////////////////////////////////////////////////////////////////////////////// -// M O D U L E B E G I N /////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" - -#include "IniFile.h" - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// I M P L E M E N T A T I O N ////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -// ________________________________________________________________________________________ __________ -// constructor -// -IniFile::IniFile(void) -{ -} - -// ________________________________________________________________________________________ __________ -// destructor -// -IniFile::~IniFile(void) -{ -} - -// ________________________________________________________________________________________ __________ -// SetFile -// -void -IniFile::SetFile(const TCHAR* _filename) -{ - if (_filename) - { - char path_buffer[_MAX_PATH], drive[_MAX_DRIVE] ,dir[_MAX_DIR]; - char fname[_MAX_FNAME],ext[_MAX_EXT]; - - GetModuleFileName(NULL,path_buffer,sizeof(path_buffer)); - _splitpath( path_buffer, drive, dir, fname, ext ); - _makepath( filename, drive, dir, _filename, ".ini"); - } -} - -// ________________________________________________________________________________________ __________ -// SetSection -// -void -IniFile::SetSection(const TCHAR *_section) -{ - _tcscpy(section,_section); -} - -// ________________________________________________________________________________________ __________ -// ReadInt -// -int -IniFile::ReadInt(const TCHAR *key, int def) -{ - return GetPrivateProfileInt(section, key, def, filename); -} - -// ________________________________________________________________________________________ __________ -// WriteInt -// -void -IniFile::WriteInt(const TCHAR *key, int value) -{ - char temp[256]; - WritePrivateProfileString(section, key, _itoa(value,temp,10), filename); -} - -// ________________________________________________________________________________________ __________ -// ReadBool -// -bool -IniFile::ReadBool(const TCHAR *key, bool def) -{ - return ReadInt(key,def?1:0) == 0 ? false : true; -} - -// ________________________________________________________________________________________ __________ -// WriteBool -// -void -IniFile::WriteBool(const TCHAR *key, bool value) -{ - WriteInt(key,value?1:0); -} - -// ________________________________________________________________________________________ __________ -// ReadString -// -void -IniFile::ReadString(const TCHAR *key, const TCHAR *def, TCHAR *out, int size) -{ - GetPrivateProfileString(section, key, def, out, size, filename); -} - -// ________________________________________________________________________________________ __________ -// WriteString -// -void -IniFile::WriteString(const TCHAR *key, const TCHAR *value) -{ - WritePrivateProfileString(section, key, value, filename); -} - -// ________________________________________________________________________________________ __________ -// ReadStringList -// -void -IniFile::ReadStringList(const TCHAR *key, std::vector &list) -{ - int count = ReadInt(key); - for (int i=0; i &list) -{ - WriteInt(key,(int)list.size()); - int i=0; - for (std::vector::iterator iter = list.begin(); iter!=list.end(); iter++) - { - char temp[256]; - sprintf(temp,"%s%i",key,i); - WriteString(temp,iter->c_str()); - i++; - } -} \ No newline at end of file diff --git a/Source/Plugins/Plugin_PadDX9/Src/IniFile.h b/Source/Plugins/Plugin_PadDX9/Src/IniFile.h deleted file mode 100644 index bdfee1169a..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/IniFile.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (C) 2003-2008 Dolphin Project. - -// 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, version 2.0. - -// 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 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ -///////////////////////////////////////////////////////////////////////////////////////////////////// -// M O D U L E B E G I N /////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// C L A S S //////////////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -class IniFile -{ -public: - IniFile(void); - ~IniFile(void); - - void SetFile(const TCHAR *fname); - void SetSection(const TCHAR *section); - - int ReadInt (const TCHAR *key, int def = 0); - void WriteInt (const TCHAR *key, int value); - bool ReadBool (const TCHAR *key, bool def = false); - void WriteBool (const TCHAR *key, bool value); - void ReadString (const TCHAR *key, const TCHAR *def, TCHAR *out, int size = 255); - void WriteString(const TCHAR *key, const TCHAR *value); - void ReadStringList (const TCHAR *key, std::vector &list); - void WriteStringList(const TCHAR *key, std::vector &list); - -private: - TCHAR filename[512]; - TCHAR section[256]; -}; \ No newline at end of file diff --git a/Source/Plugins/Plugin_PadDX9/Src/MultiDI.cpp b/Source/Plugins/Plugin_PadDX9/Src/MultiDI.cpp deleted file mode 100644 index 574abe606e..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/MultiDI.cpp +++ /dev/null @@ -1,1053 +0,0 @@ -//----------------------------------------------------------------------------- -// File: MultiDI.cpp -// -// Desc: DirectInput framework class using semantic mapping with multiplayer -// device ownership. Feel free to use this class as a starting point -// for adding extra functionality. -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -//----------------------------------------------------------------------------- -#include "stdafx.h" - -#define DIRECTINPUT_VERSION 0x0800 - -#include -#include -#include -#include -#include -#include // included to get the D3DCOLOR_RGBA macro. -#include "MultiDI.h" -#include - -//----------------------------------------------------------------------------- -// Name: CMultiplayerInputDeviceManager -// Desc: Constructor -// Args: strRegKey - A location in the registry where device ownership -// information should be stored -//----------------------------------------------------------------------------- -CMultiplayerInputDeviceManager::CMultiplayerInputDeviceManager( TCHAR* strRegKey ) -{ - HRESULT hr = CoInitialize(NULL); - m_bCleanupCOM = SUCCEEDED(hr); - LONG nResult; - - // Initialize members - m_pDI = NULL; - m_hWnd = NULL; - m_pdiaf = NULL; - m_pUsers = NULL; - m_pDeviceList = NULL; - m_AddDeviceCallback = NULL; - m_AddDeviceCallbackParam = NULL; - m_hKey = NULL; - m_dwNumDevices = 0; - m_dwMaxDevices = 0; - - - // Duplicate the registry location string since we'll need this again later - m_strKey = _tcsdup( strRegKey ); - if( m_strKey == NULL ) - return; - - // Create a reg key to store device ownership data - nResult = RegCreateKeyEx( HKEY_CURRENT_USER, strRegKey, 0, NULL, - REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE, NULL, - &m_hKey, NULL ); - if(nResult != ERROR_SUCCESS) - m_hKey = NULL; -} - - - - -//----------------------------------------------------------------------------- -// Name: ~CMultiplayerInputDeviceManager -// Desc: Destructor -//----------------------------------------------------------------------------- -CMultiplayerInputDeviceManager::~CMultiplayerInputDeviceManager() -{ - Cleanup(); - - if( m_bCleanupCOM ) - CoUninitialize(); - - RegCloseKey( m_hKey ); - - free( m_strKey ); -} - - - - -//----------------------------------------------------------------------------- -// Name: Create -// Desc: Initializes the class, and enums the devices. See MultiMapper sample -// for how to use this class. -// It might fail if there are too many players for the -// number of devices availible, or if one player owns too many -// devices preventing others from having a device. Its up the app -// to prevent this or respond to this. -// Note: strUserName should be a array of sz strings -//----------------------------------------------------------------------------- -HRESULT CMultiplayerInputDeviceManager::Create( HWND hWnd, - TCHAR* strUserNames[], - DWORD dwNumUsers, - DIACTIONFORMAT* pdiaf, - LPDIMANAGERCALLBACK AddDeviceCallback, - LPVOID pCallbackParam, - BOOL bResetOwnership, - BOOL bResetMappings ) -{ - HRESULT hr; - - if( strUserNames == NULL || dwNumUsers == 0 ) - return E_INVALIDARG; - - Cleanup(); - - // Store data - m_hWnd = hWnd; - - // Create and init the m_pUsers array - m_dwNumUsers = dwNumUsers; - m_pUsers = new PlayerInfo*[dwNumUsers]; - for( DWORD i=0; idwPlayerIndex = i; // set the 0-based player index (for easy referencing) - lstrcpyn( m_pUsers[i]->strPlayerName, strUserNames[i], MAX_PATH-1 ); - } - - m_AddDeviceCallback = AddDeviceCallback; - m_AddDeviceCallbackParam = pCallbackParam; - - // Create the base DirectInput object - if( FAILED( hr = DirectInput8Create( GetModuleHandle(NULL), DIRECTINPUT_VERSION, - IID_IDirectInput8, (VOID**)&m_pDI, NULL ) ) ) - return DXTRACE_ERR( TEXT("DirectInput8Create"), hr ); - - if( FAILED( hr = SetActionFormat( pdiaf, TRUE, bResetOwnership, bResetMappings ) ) ) - return DXTRACE_ERR( TEXT("SetActionFormat"), hr ); - - return S_OK; -} - - - - -//----------------------------------------------------------------------------- -// Name: SetActionFormat -// Desc: Sets a new action format. -// It re-enumerates the devices if bReenumerate -// It resets the ownership of the devices if bResetOwnership -// It resets the mapper actions of the devices if bResetMappings -// This function may fail if there are too many players for the -// number of devices availible, or if one player owns too many -// devices preventing others from having a device. Its up the app -// to prevent this or respond to this. -//----------------------------------------------------------------------------- -HRESULT CMultiplayerInputDeviceManager::SetActionFormat( DIACTIONFORMAT* pdiaf, - BOOL bReenumerate, - BOOL bResetOwnership, - BOOL bResetMappings ) -{ - HRESULT hr; - DWORD iPlayer; - DWORD iDevice; - - // Store the new action format - m_pdiaf = pdiaf; - - // Only destroy and re-enumerate devices if the caller explicitly wants to. - // This isn't thread safe, so be sure not to have any other threads using - // this data unless you redesign this class - if( bReenumerate ) - { - // Set all players to not have a device yet - for( iPlayer=0; iPlayerbFoundDeviceForPlayer = FALSE; - - if( bResetOwnership ) - { - // Set all devices as not assigned to a player - for( iDevice=0; iDeviceBuildActionMap( m_pdiaf, pPlayerInfo->strPlayerName, DIDBAM_DEFAULT ) ) ) - return DXTRACE_ERR( TEXT("BuildActionMap"), hr ); - if( FAILED( hr = pdidDevice->SetActionMap( m_pdiaf, pPlayerInfo->strPlayerName, DIDSAM_DEFAULT ) ) ) - return DXTRACE_ERR( TEXT("SetActionMap"), hr ); - } - } - - return S_OK; -} - - - - -//----------------------------------------------------------------------------- -// Name: BuildDeviceList -// Desc: -//----------------------------------------------------------------------------- -HRESULT CMultiplayerInputDeviceManager::BuildDeviceList() -{ - // Cleanup any previously enumerated devices - CleanupDeviceList(); - - // Build a simple list of all devices currently attached to the machine. This - // array will be used to reassign devices to each user. - m_dwMaxDevices = 5; - m_dwNumDevices = 0; - m_pDeviceList = NULL; - - DeviceInfo* pListNew = NULL; - pListNew = (DeviceInfo*) realloc( m_pDeviceList, m_dwMaxDevices*sizeof(DeviceInfo) ); - - // Verify allocation - if( NULL == pListNew ) - return DXTRACE_ERR( TEXT("BuildDeviceList"), E_OUTOFMEMORY ); - else - m_pDeviceList = pListNew; - - ZeroMemory( m_pDeviceList, m_dwMaxDevices*sizeof(DeviceInfo) ); - - // Enumerate available devices for any user. - HRESULT rs = m_pDI->EnumDevicesBySemantics( NULL, m_pdiaf, StaticEnumSuitableDevicesCB, - this, DIEDBSFL_ATTACHEDONLY ); - - return S_OK; -} - - - - -//----------------------------------------------------------------------------- -// Name: EnumSuitableDevicesCB -// Desc: DirectInput device enumeratation callback. Calls AddDevice() -// on each device enumerated. -//----------------------------------------------------------------------------- -BOOL CALLBACK CMultiplayerInputDeviceManager::StaticEnumSuitableDevicesCB( LPCDIDEVICEINSTANCE pdidi, - LPDIRECTINPUTDEVICE8 pdidDevice, - DWORD dwFlags, DWORD dwDeviceRemaining, - VOID* pContext ) -{ - // Add the device to the device manager's internal list - CMultiplayerInputDeviceManager* pInputDeviceManager = (CMultiplayerInputDeviceManager*)pContext; - return pInputDeviceManager->EnumDevice( pdidi, pdidDevice, - dwFlags, dwDeviceRemaining ); -} - - - - -//----------------------------------------------------------------------------- -// Name: EnumDevice -// Desc: Enums each device to see if its suitable to add -//----------------------------------------------------------------------------- -BOOL CMultiplayerInputDeviceManager::EnumDevice( const DIDEVICEINSTANCE* pdidi, - const LPDIRECTINPUTDEVICE8 pdidDevice, - DWORD dwFlags, DWORD dwRemainingDevices ) -{ - TCHAR strPlayerName[MAX_PATH]; - TCHAR strDeviceGuid[40]; - - // Devices of type DI8DEVTYPE_DEVICECTRL are specialized devices not generally - // considered appropriate to control game actions. We just ignore these. - if( GET_DIDEVICE_TYPE(pdidi->dwDevType) != DI8DEVTYPE_DEVICECTRL ) - { - // We're only interested in devices that map the pri 1 actions - if( dwFlags & DIEDBS_MAPPEDPRI1 ) - { - // Add new pdidDevice struct to array, and resize array if needed - m_dwNumDevices++; - if( m_dwNumDevices > m_dwMaxDevices ) - { - m_dwMaxDevices += 5; - - DeviceInfo* pListNew = NULL; - pListNew = (DeviceInfo*) realloc( m_pDeviceList, m_dwMaxDevices*sizeof(DeviceInfo) ); - - // Verify allocation - if( NULL == pListNew ) - { - DXTRACE_ERR( TEXT("EnumDevice"), E_OUTOFMEMORY ); - return DIENUM_STOP; - } - else - m_pDeviceList = pListNew; - - ZeroMemory( m_pDeviceList + m_dwMaxDevices - 5, 5*sizeof(DeviceInfo) ); - } - - DXUtil_ConvertGUIDToStringCch( &pdidi->guidInstance, strDeviceGuid, 40 ); - DXUtil_ReadStringRegKeyCch( m_hKey, strDeviceGuid, strPlayerName, MAX_PATH, TEXT("") ); - - // Add the device to the array m_pDeviceList - DWORD dwCurrentDevice = m_dwNumDevices-1; - ZeroMemory( &m_pDeviceList[dwCurrentDevice], sizeof(DeviceInfo) ); - - m_pDeviceList[dwCurrentDevice].didi = *pdidi; - m_pDeviceList[dwCurrentDevice].pdidDevice = pdidDevice; - m_pDeviceList[dwCurrentDevice].pdidDevice->AddRef(); - m_pDeviceList[dwCurrentDevice].bMapsPri1Actions = ((dwFlags & DIEDBS_MAPPEDPRI1) == DIEDBS_MAPPEDPRI1); - m_pDeviceList[dwCurrentDevice].bMapsPri2Actions = ((dwFlags & DIEDBS_MAPPEDPRI2) == DIEDBS_MAPPEDPRI2); - - if( lstrcmp( strPlayerName, TEXT("") ) != 0 ) - { - m_pDeviceList[dwCurrentDevice].pPlayerInfo = LookupPlayer( strPlayerName ); - if( m_pDeviceList[dwCurrentDevice].pPlayerInfo ) - m_pDeviceList[dwCurrentDevice].pPlayerInfo->bFoundDeviceForPlayer = TRUE; - } - } - } - - // Continue enumerating - return DIENUM_CONTINUE; -} - - - - -//----------------------------------------------------------------------------- -// Name: AssignDevices -// Desc: -//----------------------------------------------------------------------------- -HRESULT CMultiplayerInputDeviceManager::AssignDevices() -{ - DWORD iDevice; - DWORD iPlayer; - - // For any device that doesn't have a user assigned to it, - // then assign it to the first user that needs a device - for( iDevice=0; iDevicebFoundDeviceForPlayer ) - { - m_pDeviceList[iDevice].pPlayerInfo = m_pUsers[iPlayer]; - m_pUsers[iPlayer]->bFoundDeviceForPlayer = TRUE; - break; - } - } - } - } - - return S_OK; -} - - - - -//----------------------------------------------------------------------------- -// Name: VerifyAssignment -// Desc: -//----------------------------------------------------------------------------- -HRESULT CMultiplayerInputDeviceManager::VerifyAssignment() -{ - DWORD iPlayer; - DWORD iDevice; - - // For each player, make sure that a device was found for this - // player, otherwise return failure. - for( iPlayer=0; iPlayerbFoundDeviceForPlayer ) - { - if( GetNumDevices() < m_dwNumUsers ) - return E_DIUTILERR_TOOMANYUSERS; - else - { - // Check to see if there's a device that isn't already - // assigned to a player. If there is return - // E_DIUTILERR_PLAYERWITHOUTDEVICE otherwise return - // E_DIUTILERR_DEVICESTAKEN - for( iDevice=0; iDevicedwNumActions]; - - // Verify memory allocation and collect DIA_APPFIXED settings - if( pdwAppFixed ) - { - for( iAction=0; iAction < m_pdiaf->dwNumActions; iAction++ ) - pdwAppFixed[iAction] = m_pdiaf->rgoAction[iAction].dwFlags & DIA_APPFIXED; - } - } - - // For every device that's assigned to a player, - // set it action map, and add it to the game - for( iDevice=0; iDeviceSetCooperativeLevel( m_hWnd, DISCL_NONEXCLUSIVE|DISCL_FOREGROUND ); - if( FAILED(hr) ) - break; - - // Build and set the action map on this device. This will also remove - // it from DirectInput's internal list of available devices. - DWORD dwBuildFlags = bResetMappings ? DIDBAM_HWDEFAULTS : DIDBAM_DEFAULT; - DWORD dwSetFlags = bResetMappings ? DIDSAM_FORCESAVE : DIDSAM_DEFAULT; - - hr = pdidDevice->BuildActionMap( m_pdiaf, pPlayerInfo->strPlayerName, dwBuildFlags ); - if( FAILED( hr ) ) - { - // just print out a debug message and keep going - DXTRACE_ERR( TEXT("BuildActionMap"), hr ); - hr = S_OK; - continue; - } - - hr = pdidDevice->SetActionMap( m_pdiaf, pPlayerInfo->strPlayerName, dwSetFlags ); - if( FAILED( hr ) ) - { - // just print out a debug message and keep going - DXTRACE_ERR( TEXT("SetActionMap"), hr ); - hr = S_OK; - continue; - } - - - // Callback into the app so it can adjust the device and set - // the m_pDeviceList[iDevice].pParam field with a device state struct - if( m_AddDeviceCallback ) - m_AddDeviceCallback( pPlayerInfo, &m_pDeviceList[iDevice], - &m_pDeviceList[iDevice].didi, m_AddDeviceCallbackParam ); - - // Check to see if the device is using relative axis -- sometimes app code - // might want to know this. - DIPROPDWORD dipdw; - dipdw.diph.dwSize = sizeof(DIPROPDWORD); - dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); - dipdw.diph.dwObj = 0; - dipdw.diph.dwHow = DIPH_DEVICE; - dipdw.dwData = 0; - pdidDevice->GetProperty( DIPROP_AXISMODE, &dipdw.diph ); - if( dipdw.dwData == DIPROPAXISMODE_REL ) - m_pDeviceList[iDevice].bRelativeAxis = TRUE; - - // We made it through this iteration without breaking out do to errors - hr = S_OK; - } - else - { - if( FAILED( hr = pdidDevice->BuildActionMap( m_pdiaf, NULL, DIDBAM_DEFAULT ) ) ) - { - DXTRACE_ERR( TEXT("BuildActionMap"), hr ); - break; - } - - if( FAILED( hr = pdidDevice->SetActionMap( m_pdiaf, NULL, DIDSAM_NOUSER ) ) ) - { - DXTRACE_ERR( TEXT("SetActionMap"), hr ); - break; - } - } - } - - // If we stored DIA_APPFIXED flags earlier, we need to reapply those flags and - // free the allocated memory - if( bResetMappings && pdwAppFixed ) - { - for( iAction=0; iAction < m_pdiaf->dwNumActions; iAction++ ) - m_pdiaf->rgoAction[iAction].dwFlags |= pdwAppFixed[iAction]; - - delete [] pdwAppFixed; - } - - return hr; -} - - - - -//----------------------------------------------------------------------------- -// Name: ConfigureDevices -// Desc: -//----------------------------------------------------------------------------- -HRESULT CMultiplayerInputDeviceManager::ConfigureDevices( HWND hWnd, IUnknown* pSurface, - VOID* ConfigureDevicesCB, - DWORD dwFlags, LPVOID pvCBParam ) -{ - HRESULT hr; - DWORD iPlayer; - - // Determine how large of a string we'll need to hold all user names - DWORD dwNamesSize = 0; - for( iPlayer=0; iPlayer < m_dwNumUsers; iPlayer++ ) - dwNamesSize += lstrlen( m_pUsers[iPlayer]->strPlayerName ) +1; - - // Build multi-sz list of user names - TCHAR* strUserNames = new TCHAR[dwNamesSize+1]; - - // Verify allocation and cycle through user names - if( strUserNames ) - { - TCHAR* strTemp = strUserNames; - for( iPlayer=0; iPlayerstrPlayerName ); - strTemp += lstrlen(strTemp) + 1; - } - - lstrcpy( strTemp, TEXT("\0") ); - } - - - // Fill in all the params - DICONFIGUREDEVICESPARAMS dicdp; - ZeroMemory(&dicdp, sizeof(dicdp)); - dicdp.dwSize = sizeof(dicdp); - dicdp.dwcFormats = 1; - dicdp.lprgFormats = m_pdiaf; - dicdp.hwnd = hWnd; - dicdp.lpUnkDDSTarget = pSurface; - dicdp.dwcUsers = m_dwNumUsers; - dicdp.lptszUserNames = strUserNames; - - // Initialize all the colors here - DICOLORSET dics; - ZeroMemory(&dics, sizeof(DICOLORSET)); - dics.dwSize = sizeof(DICOLORSET); - - // Set UI color scheme (if not specified it uses defaults) - dicdp.dics.dwSize = sizeof(dics); - dicdp.dics.cTextFore = D3DCOLOR_RGBA(255,255,255,255); - dicdp.dics.cTextHighlight = D3DCOLOR_RGBA(204,204,255,255); - dicdp.dics.cCalloutLine = D3DCOLOR_RGBA(255,255,255,128); // - dicdp.dics.cCalloutHighlight= D3DCOLOR_RGBA(204,204,255,255); - dicdp.dics.cBorder = D3DCOLOR_RGBA(153,153,204,128); - dicdp.dics.cControlFill = D3DCOLOR_RGBA( 51, 51, 102, 128); // - dicdp.dics.cHighlightFill = D3DCOLOR_RGBA(0,0,0,128); - dicdp.dics.cAreaFill = D3DCOLOR_RGBA(0,0,50,128); - - if( dwFlags & DICD_EDIT ) - { - // Re-enum so we can catch any new devices that have been recently attached - for( iPlayer=0; iPlayerbFoundDeviceForPlayer = FALSE; - if( FAILED( hr = BuildDeviceList() ) ) - { - DXTRACE_ERR( TEXT("BuildDeviceList"), hr ); - goto LCleanup; - } - } - - // Unacquire the devices so that mouse doesn't - // control the game while in control panel - UnacquireDevices(); - - if( FAILED( hr = m_pDI->ConfigureDevices( (LPDICONFIGUREDEVICESCALLBACK)ConfigureDevicesCB, - &dicdp, dwFlags, pvCBParam ) ) ) - { - DXTRACE_ERR( TEXT("ConfigureDevices"), hr ); - goto LCleanup; - } - - if( dwFlags & DICD_EDIT ) - { - // Update the device ownership - if( FAILED( hr = UpdateDeviceOwnership() ) ) - { - DXTRACE_ERR( TEXT("UpdateDeviceOwnership"), hr ); - goto LCleanup; - } - - // Now save the device keys that are assigned players to registry, - if( FAILED( hr = SaveDeviceOwnershipKeys() ) ) - { - DXTRACE_ERR( TEXT("SaveDeviceOwnershipKeys"), hr ); - goto LCleanup; - } - - // Report an error if there is a player that doesn't not - // have a device assigned - if( FAILED( hr = VerifyAssignment() ) ) - goto LCleanup; - - // Now that every player has at least one device, build and set - // the action map, and use callback into the app to tell the - // app of the device assignment. - if( FAILED( hr = AddAssignedDevices( FALSE ) ) ) - { - DXTRACE_ERR( TEXT("AddAssignedDevices"), hr ); - goto LCleanup; - } - } - - hr = S_OK; - -LCleanup: - - if( strUserNames ) - delete [] strUserNames; - - return hr; -} - - - - -//----------------------------------------------------------------------------- -// Name: UpdateDeviceOwnership -// Desc: -//----------------------------------------------------------------------------- -HRESULT CMultiplayerInputDeviceManager::UpdateDeviceOwnership() -{ - DWORD iPlayer; - DWORD iDevice; - - // Set all players to not have a device yet - for( iPlayer=0; iPlayerbFoundDeviceForPlayer = FALSE; - - // Set all devices as not assigned to a player - for( iDevice=0; iDeviceGetProperty( DIPROP_USERNAME, &dips.diph ); - DXUtil_ConvertWideStringToGenericCch( strPlayerName, dips.wsz, MAX_PATH ); - - if( lstrcmp( strPlayerName, TEXT("") ) != 0 ) - { - m_pDeviceList[iDevice].pPlayerInfo = LookupPlayer( strPlayerName ); - if( m_pDeviceList[iDevice].pPlayerInfo ) - m_pDeviceList[iDevice].pPlayerInfo->bFoundDeviceForPlayer = TRUE; - } - } - - return S_OK; -} - - - - -//----------------------------------------------------------------------------- -// Name: UnacquireDevices -// Desc: -//----------------------------------------------------------------------------- -VOID CMultiplayerInputDeviceManager::UnacquireDevices() -{ - // Unacquire every device - - if( m_pDeviceList ) - { - // All devices have been assigned a to a user in - // the new array, so clean up the local array - for( DWORD iDevice=0; iDeviceUnacquire(); - } - } -} - - - - -//----------------------------------------------------------------------------- -// Name: SetFocus -// Desc: Sets the DirectInput focus to a new HWND -//----------------------------------------------------------------------------- -VOID CMultiplayerInputDeviceManager::SetFocus( HWND hWnd ) -{ - m_hWnd = hWnd; - - if( m_pDeviceList ) - { - // All devices have been assigned a to a user in - // the new array, so clean up the local array - for( DWORD iDevice=0; iDeviceUnacquire(); - pdidDevice->SetCooperativeLevel( m_hWnd, DISCL_NONEXCLUSIVE|DISCL_FOREGROUND ); - } - } -} - - - - -//----------------------------------------------------------------------------- -// Name: GetDevices -// Desc: returns an array of DeviceInfo*'s -//----------------------------------------------------------------------------- -HRESULT CMultiplayerInputDeviceManager::GetDevices( DeviceInfo** ppDeviceInfo, - DWORD* pdwCount ) -{ - if( NULL==ppDeviceInfo || NULL==pdwCount ) - return E_INVALIDARG; - - (*ppDeviceInfo) = m_pDeviceList; - (*pdwCount) = m_dwNumDevices; - - return S_OK; -} - - - - -//----------------------------------------------------------------------------- -// Name: LookupPlayer -// Desc: searchs m_pUsers by player name -//----------------------------------------------------------------------------- -CMultiplayerInputDeviceManager::PlayerInfo* CMultiplayerInputDeviceManager::LookupPlayer( TCHAR* strPlayerName ) -{ - for( DWORD iPlayer=0; iPlayerstrPlayerName, strPlayerName ) == 0 ) - return pCurPlayer; - } - - return NULL; -} - - - - -//----------------------------------------------------------------------------- -// Name: SaveDeviceOwnershipKeys -// Desc: For every device that's assigned to a player, save its device key -// and assigned player to registry. -//----------------------------------------------------------------------------- -HRESULT CMultiplayerInputDeviceManager::SaveDeviceOwnershipKeys() -{ - TCHAR strDeviceGuid[40]; - DWORD iDevice; - - for( iDevice=0; iDevicestrPlayerName ); - else - RegDeleteValue( m_hKey, strDeviceGuid ); - } - - return S_OK; -} - - - - -//----------------------------------------------------------------------------- -// Name: DeleteDeviceOwnershipKeys -// Desc: Delete all the ownership keys -//----------------------------------------------------------------------------- -VOID CMultiplayerInputDeviceManager::DeleteDeviceOwnershipKeys() -{ - HKEY hKey; - TCHAR *strRegKey; - - // Prepare strings to delete the key - strRegKey = _tcsdup( m_strKey ); - if( strRegKey == NULL ) - return; - - TCHAR* strTemp = _tcsrchr( strRegKey, TEXT('\\') ); - - // Unless the registry path string was malformed, we're ready to delete - // and recreate the key - if( strTemp ) - { - *strTemp = 0; - strTemp++; - - RegCloseKey( m_hKey ); - - // Delete the reg key - RegOpenKey( HKEY_CURRENT_USER, strRegKey, &hKey ); - RegDeleteKey( hKey, strTemp ); - RegCloseKey( hKey ); - - // Create the key again now that all the subkeys have been deleted - RegCreateKeyEx( HKEY_CURRENT_USER, m_strKey, 0, NULL, - REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE, NULL, - &m_hKey, NULL ); - } - - - // Clean up memory allocation - free( strRegKey ); -} - - - - -//----------------------------------------------------------------------------- -// Name: Cleanup -// Desc: -//----------------------------------------------------------------------------- -VOID CMultiplayerInputDeviceManager::Cleanup() -{ - CleanupDeviceList(); - - if( m_pUsers ) - { - for( DWORD iPlayer=0; iPlayerData1, pGuidSrc->Data2, pGuidSrc->Data3, - pGuidSrc->Data4[0], pGuidSrc->Data4[1], - pGuidSrc->Data4[2], pGuidSrc->Data4[3], - pGuidSrc->Data4[4], pGuidSrc->Data4[5], - pGuidSrc->Data4[6], pGuidSrc->Data4[7] ); - - if( nResult < 0 ) - return E_FAIL; - return S_OK; -} - - -//----------------------------------------------------------------------------- -// Name: DXUtil_ConvertWideStringToAnsi() -// Desc: This is a UNICODE conversion utility to convert a WCHAR string into a -// char string. -// cchDestChar is the size in bytes of strDestination -//----------------------------------------------------------------------------- -HRESULT DXUtil_ConvertWideStringToAnsiCch( char* strDestination, const WCHAR* wstrSource, - int cchDestChar ) -{ - if( strDestination==NULL || wstrSource==NULL || cchDestChar < 1 ) - return E_INVALIDARG; - - int nResult = WideCharToMultiByte( CP_ACP, 0, wstrSource, -1, strDestination, - cchDestChar, NULL, NULL ); - strDestination[cchDestChar-1] = 0; - - if( nResult == 0 ) - return E_FAIL; - return S_OK; -} - - -//----------------------------------------------------------------------------- -// Name: DXUtil_ConvertAnsiStringToGeneric() -// Desc: This is a UNICODE conversion utility to convert a WCHAR string into a -// TCHAR string. -// cchDestChar is the size in TCHARs of tstrDestination. Be careful not to -// pass in sizeof(strDest) on UNICODE builds -//----------------------------------------------------------------------------- -HRESULT DXUtil_ConvertWideStringToGenericCch( TCHAR* tstrDestination, const WCHAR* wstrSource, - int cchDestChar ) -{ - if( tstrDestination==NULL || wstrSource==NULL || cchDestChar < 1 ) - return E_INVALIDARG; - -#ifdef _UNICODE - wcsncpy( tstrDestination, wstrSource, cchDestChar ); - tstrDestination[cchDestChar-1] = L'\0'; - return S_OK; -#else - return DXUtil_ConvertWideStringToAnsiCch( tstrDestination, wstrSource, cchDestChar ); -#endif -} - - - -//----------------------------------------------------------------------------- -// Name: DXUtil_ReadStringRegKeyCch() -// Desc: Helper function to read a registry key string -// cchDest is the size in TCHARs of strDest. Be careful not to -// pass in sizeof(strDest) on UNICODE builds. -//----------------------------------------------------------------------------- -HRESULT DXUtil_ReadStringRegKeyCch( HKEY hKey, LPCTSTR strRegName, TCHAR* strDest, - DWORD cchDest, LPCTSTR strDefault ) -{ - DWORD dwType; - DWORD cbDest = cchDest * sizeof(TCHAR); - - if( ERROR_SUCCESS != RegQueryValueEx( hKey, strRegName, 0, &dwType, - (BYTE*)strDest, &cbDest ) ) - { - _tcsncpy( strDest, strDefault, cchDest ); - strDest[cchDest-1] = 0; - return S_FALSE; - } - else - { - if( dwType != REG_SZ ) - { - _tcsncpy( strDest, strDefault, cchDest ); - strDest[cchDest-1] = 0; - return S_FALSE; - } - } - - return S_OK; -} - - - - -//----------------------------------------------------------------------------- -// Name: DXUtil_WriteStringRegKey() -// Desc: Helper function to write a registry key string -//----------------------------------------------------------------------------- -HRESULT DXUtil_WriteStringRegKey( HKEY hKey, LPCTSTR strRegName, - LPCTSTR strValue ) -{ - if( NULL == strValue ) - return E_INVALIDARG; - - DWORD cbValue = ((DWORD)_tcslen(strValue)+1) * sizeof(TCHAR); - - if( ERROR_SUCCESS != RegSetValueEx( hKey, strRegName, 0, REG_SZ, - (BYTE*)strValue, cbValue ) ) - return E_FAIL; - - return S_OK; -} - - - diff --git a/Source/Plugins/Plugin_PadDX9/Src/MultiDI.h b/Source/Plugins/Plugin_PadDX9/Src/MultiDI.h deleted file mode 100644 index b18e5e17ba..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/MultiDI.h +++ /dev/null @@ -1,146 +0,0 @@ -//----------------------------------------------------------------------------- -// File: MultiDI.h -// -// Desc: Multiple user DirectInput support using action mapping -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -//----------------------------------------------------------------------------- -#ifndef MULTIDI_H -#define MULTIDI_H - -#ifndef DIRECTINPUT_VERSION -#define DIRECTINPUT_VERSION 0x0800 -#endif - -#include - -//----------------------------------------------------------------------------- -// Miscellaneous helper functions -//----------------------------------------------------------------------------- -#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } } -#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } } -#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } } - -HRESULT DXUtil_WriteStringRegKey( HKEY hKey, LPCTSTR strRegName, LPCTSTR strValue ); -HRESULT DXUtil_ReadStringRegKeyCch( HKEY hKey, LPCTSTR strRegName, TCHAR* strDest, DWORD cchDest, LPCTSTR strDefault ); -HRESULT DXUtil_ConvertGUIDToStringCch( const GUID* pGuidSrc, TCHAR* strDest, int cchDestChar ); -HRESULT DXUtil_ConvertWideStringToGenericCch( TCHAR* tstrDestination, const WCHAR* wstrSource, int cchDestChar ); - -//----------------------------------------------------------------------------- -// Name: DXUtil_Timer() -// Desc: Performs timer opertations. Use the following commands: -// TIMER_RESET - to reset the timer -// TIMER_START - to start the timer -// TIMER_STOP - to stop (or pause) the timer -// TIMER_ADVANCE - to advance the timer by 0.1 seconds -// TIMER_GETABSOLUTETIME - to get the absolute system time -// TIMER_GETAPPTIME - to get the current time -// TIMER_GETELAPSEDTIME - to get the time that elapsed between -// TIMER_GETELAPSEDTIME calls -//----------------------------------------------------------------------------- -enum TIMER_COMMAND { TIMER_RESET, TIMER_START, TIMER_STOP, TIMER_ADVANCE, - TIMER_GETABSOLUTETIME, TIMER_GETAPPTIME, TIMER_GETELAPSEDTIME }; -FLOAT __stdcall DXUtil_Timer( TIMER_COMMAND command ); - -// E_DIUTILERR_PLAYERWITHOUTDEVICE is returned by the manager class after configuring -// device, and there's a player that hasn't been assigned a device. -#define E_DIUTILERR_PLAYERWITHOUTDEVICE MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,997) - -// E_DIUTILERR_DEVICESTAKEN is returned by the manager class when one player -// on the machine has enough RECENT devices to prevent other players from -// playing. This return code is needed because this sample attempts to give -// all RECENT devices to that player. -#define E_DIUTILERR_DEVICESTAKEN MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,998) - -// E_DIUTILERR_TOOMANYUSERS is returned by the manager class when the number of -// players exceeds the number of devices present on the system. For example, -// if you ask for 4 players on a machine that only has a keyboard and mouse, -// you're 2 short of what you need. -#define E_DIUTILERR_TOOMANYUSERS MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,999) - - - -//----------------------------------------------------------------------------- -// Name: class CMultiplayerInputDeviceManager -// Desc: Input device manager using DX8 action mapping -//----------------------------------------------------------------------------- -class CMultiplayerInputDeviceManager -{ -public: - struct PlayerInfo - { - DWORD dwPlayerIndex; // 0-based player number - TCHAR strPlayerName[MAX_PATH]; // player name - DWORD dwMaxDevices; // max number of elements in pDevices array - DWORD dwNumDevices; // current number of elements in pDevices array - BOOL bFoundDeviceForPlayer; // if a device has been found for this player yet - }; - - struct DeviceInfo - { - LPDIRECTINPUTDEVICE8 pdidDevice; // dinput device pointer - PlayerInfo* pPlayerInfo; // Player who owns this device - BOOL bRelativeAxis; // TRUE if device is using relative axis - BOOL bMapsPri1Actions; // TRUE if device maps pri 1 actions - BOOL bMapsPri2Actions; // TRUE if device maps pri 2 actions - LPVOID pParam; // app defined pointer assoicated with this device - DIDEVICEINSTANCE didi; // device instance info - }; - - typedef HRESULT (CALLBACK *LPDIMANAGERCALLBACK)(CMultiplayerInputDeviceManager::PlayerInfo* pPlayerInfo, CMultiplayerInputDeviceManager::DeviceInfo* pDeviceInfo, const DIDEVICEINSTANCE* pdidi, LPVOID); - -private: - BOOL m_bCleanupCOM; - HWND m_hWnd; - - LPDIRECTINPUT8 m_pDI; - DIACTIONFORMAT* m_pdiaf; - - PlayerInfo** m_pUsers; - DWORD m_dwNumUsers; - - DeviceInfo* m_pDeviceList; - DWORD m_dwNumDevices; - DWORD m_dwMaxDevices; - - LPDIMANAGERCALLBACK m_AddDeviceCallback; - LPVOID m_AddDeviceCallbackParam; - - TCHAR* m_strKey; - HKEY m_hKey; - -public: - static BOOL CALLBACK StaticEnumSuitableDevicesCB( LPCDIDEVICEINSTANCE pdidi, LPDIRECTINPUTDEVICE8 pdidDevice, DWORD dwFlags, DWORD dwRemainingDevices, VOID* pContext ); - static BOOL CALLBACK StaticBuildDeviceListCB( LPCDIDEVICEINSTANCE pdidi, VOID* pContext ); - - // Device control - BOOL EnumDevice( const DIDEVICEINSTANCE* pdidi, LPDIRECTINPUTDEVICE8 pdidDevice, DWORD dwFlags, DWORD dwDeviceRemaining ); - BOOL BuildDeviceListCB( LPCDIDEVICEINSTANCE pdidi ); - - HRESULT AddDevice( DeviceInfo* pDeviceInfo, BOOL bForceReset ); - HRESULT GetDevices( DeviceInfo** ppDeviceInfo, DWORD* pdwNumDevices ); - HRESULT ConfigureDevices( HWND hWnd, IUnknown* pSurface, VOID* pCallback, DWORD dwFlags, LPVOID pvCBParam ); - DWORD GetNumDevices() { return m_dwNumDevices; } - VOID UnacquireDevices(); - VOID SetFocus( HWND hWnd ); - PlayerInfo* LookupPlayer( TCHAR* strPlayerName ); - HRESULT SaveDeviceOwnershipKeys(); - VOID DeleteDeviceOwnershipKeys(); - HRESULT UpdateDeviceOwnership(); - HRESULT AssignDevices(); - HRESULT VerifyAssignment(); - HRESULT AddAssignedDevices( BOOL bResetMappings ); - - HRESULT BuildDeviceList(); - VOID CleanupDeviceList(); - - // Construction - HRESULT SetActionFormat( DIACTIONFORMAT* pdiaf, BOOL bReenumerate, BOOL bResetOwnership, BOOL bResetMappings ); - HRESULT Create( HWND hWnd, TCHAR* strUserNames[], DWORD dwNumUsers, DIACTIONFORMAT* pdiaf, LPDIMANAGERCALLBACK AddDeviceCallback, LPVOID pCallbackParam, BOOL bResetOwnership, BOOL bResetMappings ); - - CMultiplayerInputDeviceManager( TCHAR* strRegKey ); - ~CMultiplayerInputDeviceManager(); - VOID Cleanup(); -}; - -#endif \ No newline at end of file diff --git a/Source/Plugins/Plugin_PadDX9/Src/main.cpp b/Source/Plugins/Plugin_PadDX9/Src/main.cpp deleted file mode 100644 index c047457830..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/main.cpp +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (C) 2003-2008 Dolphin Project. - -// 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, version 2.0. - -// 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 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ -///////////////////////////////////////////////////////////////////////////////////////////////////// -// M O D U L E B E G I N /////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "resource.h" -#include "PluginSpecs_Pad.h" - -#include "IniFile.h" -#include "AboutDlg.h" -#include "ConfigDlg.h" - -#include "MultiDI.h" -#include "DIHandler.h" - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// T Y P E D E F S / D E F I N E S ////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -HINSTANCE g_hInstance = NULL; -SPADInitialize g_PADInitialize; - -CDIHandler g_diHandler; - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// I M P L E M E N T A T I O N ////////////////////////// //////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -// ________________________________________________________________________________________ __________ -// DllMain -// -BOOL APIENTRY DllMain( HINSTANCE _hinstDLL, // DLL module handle - DWORD dwReason, // reason called - LPVOID _lpvReserved) // reserved -{ - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - break; - - case DLL_PROCESS_DETACH: - break; - - default: - break; - } - - g_hInstance = _hinstDLL; - return TRUE; -} - -// __________________________________________________________________________________________________ -// GetDllInfo -// -void GetDllInfo (PLUGIN_INFO* _PluginInfo) -{ - _PluginInfo->Version = 0x0100; - _PluginInfo->Type = PLUGIN_TYPE_PAD; - -#ifndef _DEBUG - sprintf_s(_PluginInfo->Name, 100, "Pad DirectX9"); -#else - sprintf_s(_PluginInfo->Name, 100, "Pad DirectX9 (Debug)"); -#endif -} - -// __________________________________________________________________________________________________ -// DllAbout -// -void DllAbout(HWND _hParent) -{ - CAboutDlg aboutDlg; - aboutDlg.DoModal(_hParent); -} - -// __________________________________________________________________________________________________ -// DllConfig -// -void DllConfig(HWND _hParent) -{ - g_diHandler.InitInput(_hParent); - - EnableWindow(_hParent, FALSE); - g_diHandler.ConfigInput(); - EnableWindow(_hParent, TRUE); - SetForegroundWindow(_hParent); - - g_diHandler.CleanupDirectInput(); -} - -// __________________________________________________________________________________________________ -// PAD_Initialize -// -void PAD_Initialize(SPADInitialize _PADInitialize) -{ - g_PADInitialize = _PADInitialize; - g_diHandler.InitInput((HWND)_PADInitialize.hWnd); -} - -// __________________________________________________________________________________________________ -// PAD_Shutdown -// -void PAD_Shutdown(void) -{ - g_diHandler.CleanupDirectInput(); -} - -// __________________________________________________________________________________________________ -// PADGetStatus -// -void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus) -{ - // check if all is okay - if ((_numPAD != 0) || // we support just pad 0 - (_pPADStatus == NULL)) - return; - -#ifdef RECORD_REPLAY - *_pPADStatus = PlayRecord(); - return; -#endif - - int base = 0x80; - - // clear pad - memset(_pPADStatus,0,sizeof(SPADStatus)); - - _pPADStatus->stickY = base; - _pPADStatus->stickX = base; - _pPADStatus->substickX = base; - _pPADStatus->substickY = base; - - _pPADStatus->button |= PAD_USE_ORIGIN; - // just update pad on focus - if (g_PADInitialize.hWnd != ::GetForegroundWindow()) - return; - - //get keys from dinput - g_diHandler.UpdateInput(); - - const SControllerInput& rInput = g_diHandler.GetControllerInput(_numPAD); - -// int mainvalue = (dinput.diks[keyForControl[CTL_HALFMAIN]] &0xFF) ? 40 : 100; -// int subvalue = (dinput.diks[keyForControl[CTL_HALFSUB]] &0xFF) ? 40 : 100; -// int triggervalue = (dinput.diks[keyForControl[CTL_HALFTRIGGER]]&0xFF) ? 100 : 255; - - // get the new keys - if (rInput.bButtonStart) _pPADStatus->button |= PAD_BUTTON_START; - if (rInput.bButtonA) {_pPADStatus->button |= PAD_BUTTON_A; _pPADStatus->analogA = 255;} - if (rInput.bButtonB) {_pPADStatus->button |= PAD_BUTTON_B; _pPADStatus->analogB = 255;} - if (rInput.bButtonX) _pPADStatus->button |= PAD_BUTTON_X; - if (rInput.bButtonY) _pPADStatus->button |= PAD_BUTTON_Y; - if (rInput.bButtonZ) _pPADStatus->button |= PAD_TRIGGER_Z; - - if (rInput.fDPadLR < 0) _pPADStatus->button |= PAD_BUTTON_UP; - if (rInput.fDPadLR > 0) _pPADStatus->button |= PAD_BUTTON_DOWN; - if (rInput.fDPadUP < 0) _pPADStatus->button |= PAD_BUTTON_LEFT; - if (rInput.fDPadUP > 0) _pPADStatus->button |= PAD_BUTTON_RIGHT; - - if (rInput.fTriggerL > 0) {_pPADStatus->button |= PAD_TRIGGER_L; _pPADStatus->triggerLeft = 255;} - if (rInput.fTriggerR > 0) {_pPADStatus->button |= PAD_TRIGGER_R; _pPADStatus->triggerRight = 255;} - - _pPADStatus->stickX = 0x80 + (unsigned __int8)(rInput.fMainLR * 127.f); - _pPADStatus->stickY = 0x80 + (unsigned __int8)(rInput.fMainUP * -127.f); - _pPADStatus->substickX = 0x80 + (unsigned __int8)(rInput.fCPadLR * 127.f); - _pPADStatus->substickY = 0x80 + (unsigned __int8)(rInput.fCPadUP * -127.f); - - _pPADStatus->err = PAD_ERR_NONE; -} - -// __________________________________________________________________________________________________ -// PAD_Rumble -// -void PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength) -{ -} diff --git a/Source/Plugins/Plugin_PadDX9/Src/resource.h b/Source/Plugins/Plugin_PadDX9/Src/resource.h deleted file mode 100644 index 0558947755..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/resource.h +++ /dev/null @@ -1,37 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by PadPlugin2.rc -// -#define IDD_PADCONFIG 101 -#define IDD_ABOUTPAD 104 -#define IDC_SETSTART 1003 -#define IDC_SETA 1004 -#define IDC_SETB 1005 -#define IDC_SETX 1006 -#define IDC_SETY 1007 -#define IDC_SETZ 1008 -#define IDC_SETSUBUP 1009 -#define IDC_SETSUBLEFT 1010 -#define IDC_SETSUBRIGHT 1011 -#define IDC_SETSUBDOWN 1012 -#define IDC_SETDPADUP 1013 -#define IDC_SETDPADLEFT 1014 -#define IDC_SETDPADRIGHT 1015 -#define IDC_SETDPADDOWN 1016 -#define IDC_SETMAINUP 1017 -#define IDC_SETMAINLEFT 1018 -#define IDC_SETMAINDOWN 1019 -#define IDC_SETMAINRIGHT 1020 -#define IDC_SETL 1021 -#define IDC_SETR 1022 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 105 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1004 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/Source/Plugins/Plugin_PadDX9/Src/resource.rc b/Source/Plugins/Plugin_PadDX9/Src/resource.rc deleted file mode 100644 index db0cb89769..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/resource.rc +++ /dev/null @@ -1,135 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_PADCONFIG DIALOGEX 0, 0, 332, 226 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "Pad configuration" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "Close",IDOK,275,205,50,14 - PUSHBUTTON "start",IDC_SETSTART,141,102,40,14 - PUSHBUTTON "a",IDC_SETA,243,82,40,14 - PUSHBUTTON "b",IDC_SETB,215,98,40,14 - PUSHBUTTON "x",IDC_SETX,200,71,40,14 - PUSHBUTTON "y",IDC_SETY,285,90,40,14 - PUSHBUTTON "z",IDC_SETZ,241,35,40,14 - PUSHBUTTON " ",IDC_SETSUBUP,235,128,40,14 - PUSHBUTTON " ",IDC_SETSUBLEFT,193,147,40,14 - PUSHBUTTON " ",IDC_SETSUBRIGHT,275,146,40,14 - PUSHBUTTON " ",IDC_SETSUBDOWN,236,167,40,14 - PUSHBUTTON " ",IDC_SETDPADUP,66,129,40,14 - PUSHBUTTON " ",IDC_SETDPADLEFT,23,145,40,14 - PUSHBUTTON " ",IDC_SETDPADRIGHT,112,145,40,14 - PUSHBUTTON " ",IDC_SETDPADDOWN,67,166,40,14 - PUSHBUTTON " ",IDC_SETMAINUP,41,47,40,14 - PUSHBUTTON " ",IDC_SETMAINLEFT,7,66,40,14 - PUSHBUTTON " ",IDC_SETMAINDOWN,41,86,40,14 - PUSHBUTTON " ",IDC_SETMAINRIGHT,79,66,40,14 - PUSHBUTTON "l",IDC_SETL,91,16,40,14 - PUSHBUTTON "r",IDC_SETR,216,16,40,14 -END - -IDD_ABOUTPAD DIALOGEX 0, 0, 184, 76 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "About Dolphin Simple Pad Plugin" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,127,55,50,14 - LTEXT "Coded by F|RES and ector",IDC_STATIC,73,7,104,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_PADCONFIG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 325 - TOPMARGIN, 7 - BOTTOMMARGIN, 219 - END - - IDD_ABOUTPAD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 177 - TOPMARGIN, 7 - BOTTOMMARGIN, 69 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/Source/Plugins/Plugin_PadDX9/Src/stdafx.cpp b/Source/Plugins/Plugin_PadDX9/Src/stdafx.cpp deleted file mode 100644 index 60e6f16fec..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/stdafx.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2003-2008 Dolphin Project. - -// 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, version 2.0. - -// 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 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ -///////////////////////////////////////////////////////////////////////////////////////////////////// -// M O D U L E B E G I N /////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" diff --git a/Source/Plugins/Plugin_PadDX9/Src/stdafx.h b/Source/Plugins/Plugin_PadDX9/Src/stdafx.h deleted file mode 100644 index a6df59e1c1..0000000000 --- a/Source/Plugins/Plugin_PadDX9/Src/stdafx.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2003-2008 Dolphin Project. - -// 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, version 2.0. - -// 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 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ -///////////////////////////////////////////////////////////////////////////////////////////////////// -// M O D U L E B E G I N /////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Insert your headers here -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#define _CRT_SECURE_NO_DEPRECATE 1 - -#include -#include -#include -#include -#include - -// DInput -#define DIRECTINPUT_VERSION 0x0800 -#include - -// WTL -#include -#include -#include -#include \ No newline at end of file