[nrage] some code clean up

This commit is contained in:
zilmar 2015-11-06 22:55:44 +11:00
parent 7c3f24b20d
commit 43f175ce70
2 changed files with 273 additions and 278 deletions

View File

@ -39,7 +39,8 @@ extern "C" {
#define CALL _cdecl #define CALL _cdecl
/***** Structures *****/ /***** Structures *****/
typedef struct { typedef struct
{
WORD Version; /* Should be set to 0x0101 */ WORD Version; /* Should be set to 0x0101 */
WORD Type; /* Set to PLUGIN_TYPE_CONTROLLER */ WORD Type; /* Set to PLUGIN_TYPE_CONTROLLER */
char Name[100]; /* Name of the DLL */ char Name[100]; /* Name of the DLL */
@ -47,15 +48,18 @@ typedef struct {
BOOL Reserved2; BOOL Reserved2;
} PLUGIN_INFO; } PLUGIN_INFO;
typedef struct { typedef struct
{
BOOL Present; BOOL Present;
BOOL RawData; BOOL RawData;
int Plugin; int Plugin;
} CONTROL; } CONTROL;
typedef union { typedef union
{
DWORD Value; DWORD Value;
struct { struct
{
unsigned R_DPAD : 1; unsigned R_DPAD : 1;
unsigned L_DPAD : 1; unsigned L_DPAD : 1;
unsigned D_DPAD : 1; unsigned D_DPAD : 1;
@ -80,7 +84,8 @@ typedef union {
}; };
} BUTTONS; } BUTTONS;
typedef struct { typedef struct
{
HWND hMainWindow; HWND hMainWindow;
HINSTANCE hinst; HINSTANCE hinst;
@ -230,4 +235,3 @@ EXPORT void CALL WM_KeyUp( WPARAM wParam, LPARAM lParam );
} }
#endif #endif
#endif #endif

View File

@ -5,7 +5,6 @@
Author`s Email: norbert.wladyka@chello.at Author`s Email: norbert.wladyka@chello.at
Website: http://go.to/nrage Website: http://go.to/nrage
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the free Software Foundation; either version 2 of the License, or the free Software Foundation; either version 2 of the License, or
@ -55,8 +54,6 @@
// just used to display text in GUI // just used to display text in GUI
#define PAK_NONRAW 16 #define PAK_NONRAW 16
typedef struct _EMULATOR_INFO typedef struct _EMULATOR_INFO
{ {
bool fInitialisedPlugin; bool fInitialisedPlugin;
@ -80,7 +77,8 @@ typedef struct _DEVICE
GUID guidInstance; GUID guidInstance;
DWORD dwDevType; // can be DI8DEVTYPE_KEYBOARD, DI8DEVTYPE_MOUSE, etc DWORD dwDevType; // can be DI8DEVTYPE_KEYBOARD, DI8DEVTYPE_MOUSE, etc
BYTE bEffType; // What rumble effects does this device support? BYTE bEffType; // What rumble effects does this device support?
union INPUTSTATE { // the last polled data from this device union INPUTSTATE // the last polled data from this device
{
DIJOYSTATE joyState; DIJOYSTATE joyState;
DIMOUSESTATE2 mouseState; DIMOUSESTATE2 mouseState;
BYTE rgbButtons[256]; // keyboard state BYTE rgbButtons[256]; // keyboard state
@ -209,9 +207,6 @@ typedef struct _CONTROLLER // AN N64 CONTROLLER
// #define PF_APADD 20 // #define PF_APADD 20
// #define PF_APADU 21 // #define PF_APADU 21
// Data Format of DWORD Controller.Button: // Data Format of DWORD Controller.Button:
// //
@ -249,7 +244,6 @@ typedef struct _CONTROLLER // AN N64 CONTROLLER
// BYTE bOffset : Offset in the DirectInput data structure // BYTE bOffset : Offset in the DirectInput data structure
typedef union _MODSPEC_MOVE typedef union _MODSPEC_MOVE
{ {
DWORD dwValue; DWORD dwValue;
@ -316,7 +310,6 @@ typedef union _MODSPEC_CONFIG
unsigned fChangeKeyboardXAxis : 1; unsigned fChangeKeyboardXAxis : 1;
unsigned fChangeKeyboardYAxis : 1; unsigned fChangeKeyboardYAxis : 1;
unsigned : 6; unsigned : 6;
}; };
} MODSPEC_CONFIG, *LPMODSPEC_CONFIG; } MODSPEC_CONFIG, *LPMODSPEC_CONFIG;
@ -357,10 +350,8 @@ typedef struct _MSHORTCUT {
int iShortcut; int iShortcut;
} MSHORTCUT, *LPMSHORTCUT; // shortcut message } MSHORTCUT, *LPMSHORTCUT; // shortcut message
#define CHECK_WHITESPACES( str ) ( str == '\r' || str == '\n' || str == '\t' ) #define CHECK_WHITESPACES( str ) ( str == '\r' || str == '\n' || str == '\t' )
extern HANDLE g_hHeap; extern HANDLE g_hHeap;
extern HMODULE g_hDirectInputDLL; extern HMODULE g_hDirectInputDLL;
extern HMODULE g_hXInputDLL; extern HMODULE g_hXInputDLL;