diff options
author | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-10-27 04:17:30 +0100 |
---|---|---|
committer | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-10-27 04:17:30 +0100 |
commit | 537aaca5c200cb61928674303f7a24e3af29ad54 (patch) | |
tree | 6107f1e30d2392fb11df36d4902605810b4a6998 /src/skel | |
parent | CGame::FinalShutdown (diff) | |
download | re3-537aaca5c200cb61928674303f7a24e3af29ad54.tar re3-537aaca5c200cb61928674303f7a24e3af29ad54.tar.gz re3-537aaca5c200cb61928674303f7a24e3af29ad54.tar.bz2 re3-537aaca5c200cb61928674303f7a24e3af29ad54.tar.lz re3-537aaca5c200cb61928674303f7a24e3af29ad54.tar.xz re3-537aaca5c200cb61928674303f7a24e3af29ad54.tar.zst re3-537aaca5c200cb61928674303f7a24e3af29ad54.zip |
Diffstat (limited to 'src/skel')
-rw-r--r-- | src/skel/skeleton.h | 8 | ||||
-rw-r--r-- | src/skel/win/win.cpp | 40 | ||||
-rw-r--r-- | src/skel/win/win.h | 39 |
3 files changed, 52 insertions, 35 deletions
diff --git a/src/skel/skeleton.h b/src/skel/skeleton.h index e357905d..6bf8d2fd 100644 --- a/src/skel/skeleton.h +++ b/src/skel/skeleton.h @@ -180,6 +180,14 @@ enum RsKeyCodes rsAPPS = 1055, rsNULL = 1056, + + rsMOUSELEFTBUTTON = 1, + rsMOUSMIDDLEBUTTON = 2, + rsMOUSERIGHTBUTTON = 3, + rsMOUSEWHEELUPBUTTON = 4, + rsMOUSEWHEELDOWNBUTTON = 5, + rsMOUSEX1BUTTON = 6, + rsMOUSEX2BUTTON = 7, }; typedef enum RsKeyCodes RsKeyCodes; diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index fc82e51e..9d74b68b 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -115,38 +115,11 @@ DWORD _dwMemAvailVideo; DWORD &_dwOperatingSystemVersion = *(DWORD*)0x70F290; RwUInt32 &gGameState = *(RwUInt32*)0x8F5838; - -enum eJoypadState -{ - JOYPAD_UNUSED, - JOYPAD_ATTACHED, -}; - -struct tJoy -{ - eJoypadState m_State; - bool m_bInitialised; - bool m_bHasAxisZ; - bool m_bHasAxisR; - char _pad0; - int32 m_nVendorID; - int32 m_nProductID; -}; - -class CJoySticks -{ -public: - tJoy m_aJoys[2]; - - CJoySticks(); - void ClearJoyInfo(int joyID); -}; - -static CJoySticks AllValidWinJoys; +CJoySticks AllValidWinJoys; CJoySticks::CJoySticks() { - for (int i = 0; i < _TODOCONST(2); i++) + for (int i = 0; i < MAX_JOYSTICKS; i++) { ClearJoyInfo(i); } @@ -154,7 +127,6 @@ CJoySticks::CJoySticks() void CJoySticks::ClearJoyInfo(int joyID) { - m_aJoys[joyID].m_State = JOYPAD_UNUSED; m_aJoys[joyID].m_bInitialised = false; m_aJoys[joyID].m_bHasAxisZ = false; @@ -641,14 +613,14 @@ psInitialise(void) GetVersionEx(&verInfo); - _dwOperatingSystemVersion = 0; + _dwOperatingSystemVersion = OS_WIN95; if ( verInfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) { if ( verInfo.dwMajorVersion == 4 ) { debug("Operating System is WinNT\n"); - _dwOperatingSystemVersion = oS_WINNT; + _dwOperatingSystemVersion = OS_WINNT; } else if ( verInfo.dwMajorVersion == 5 ) { @@ -2337,12 +2309,12 @@ HRESULT CapturePad(RwInt32 padID) if( FAILED( hr = (*pPad)->GetDeviceState( sizeof(DIJOYSTATE2), &js ) ) ) return hr; // The device should have been acquired during the Poll() - if ( ControlsManager.firstCapture == true ) + if ( ControlsManager.m_bFirstCapture == true ) { memcpy(&ControlsManager.m_OldState, &js, sizeof(DIJOYSTATE2)); memcpy(&ControlsManager.m_NewState, &js, sizeof(DIJOYSTATE2)); - ControlsManager.firstCapture = false; + ControlsManager.m_bFirstCapture = false; } else { diff --git a/src/skel/win/win.h b/src/skel/win/win.h index 8c32e57d..dc2cc7c4 100644 --- a/src/skel/win/win.h +++ b/src/skel/win/win.h @@ -24,11 +24,13 @@ enum eWinVersion { OS_WIN95 = 0, OS_WIN98, - oS_WINNT, + OS_WINNT, OS_WIN2000, OS_WINXP, }; +extern DWORD &_dwOperatingSystemVersion; + extern RwUInt32 &gGameState; /* platform specfic global data */ @@ -50,6 +52,41 @@ psGlobalType; #define PSGLOBAL(var) (((psGlobalType *)(RsGlobal.ps))->var) +enum eJoypads +{ + JOYSTICK1 = 0, + JOYSTICK2, + MAX_JOYSTICKS +}; + +enum eJoypadState +{ + JOYPAD_UNUSED, + JOYPAD_ATTACHED, +}; + +struct tJoy +{ + eJoypadState m_State; + bool m_bInitialised; + bool m_bHasAxisZ; + bool m_bHasAxisR; + char _pad0; + int m_nVendorID; + int m_nProductID; +}; + +class CJoySticks +{ +public: + tJoy m_aJoys[MAX_JOYSTICKS]; + + CJoySticks(); + void ClearJoyInfo(int joyID); +}; + +extern CJoySticks AllValidWinJoys; + #ifdef __cplusplus extern "C" { |