diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/Cam.cpp | 2 | ||||
-rw-r--r-- | src/core/Camera.h | 2 | ||||
-rw-r--r-- | src/core/Frontend.cpp | 21 | ||||
-rw-r--r-- | src/core/Pad.cpp | 22 | ||||
-rw-r--r-- | src/core/Pad.h | 5 |
5 files changed, 39 insertions, 13 deletions
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index d04e8683..1c74598c 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -308,7 +308,7 @@ CCam::Process(void) } if(Mode == MODE_SNIPER || Mode == MODE_ROCKETLAUNCHER || Mode == MODE_M16_1STPERSON || - Mode == MODE_1STPERSON || Mode == MODE_HELICANNON_1STPERSON || GetWeaponFirstPersonOn()) + Mode == MODE_1STPERSON || Mode == MODE_HELICANNON_1STPERSON || Mode == MODE_CAMERA || GetWeaponFirstPersonOn()) ClipIfPedInFrontOfPlayer(); } diff --git a/src/core/Camera.h b/src/core/Camera.h index 4e90855b..18144ef5 100644 --- a/src/core/Camera.h +++ b/src/core/Camera.h @@ -85,6 +85,7 @@ public: MODE_SPECIAL_FIXED_FOR_SYPHON, MODE_FIGHT_CAM, MODE_TOP_DOWN_PED, + MODE_LIGHTHOUSE, MODE_SNIPER_RUNABOUT, MODE_ROCKETLAUNCHER_RUNABOUT, MODE_1STPERSON_RUNABOUT, @@ -92,7 +93,6 @@ public: MODE_FIGHT_CAM_RUNABOUT, MODE_EDITOR, MODE_HELICANNON_1STPERSON, - MODE_45, MODE_CAMERA, }; diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 5c861cf5..d4c251c3 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -3470,6 +3470,24 @@ CMenuManager::ProcessButtonPresses(void) bool assumeIncrease = false; #endif +#ifdef USE_DEBUG_SCRIPT_LOADER + if (m_nCurrScreen == MENUPAGE_START_MENU || m_nCurrScreen == MENUPAGE_NEW_GAME || m_nCurrScreen == MENUPAGE_NEW_GAME_RELOAD) { +#ifdef RW_GL3 + if (glfwGetKey(PSGLOBAL(window), GLFW_KEY_R) == GLFW_PRESS) { + scriptToLoad = 1; + DoSettingsBeforeStartingAGame(); + return; + } +#elif defined _WIN32 + if (GetAsyncKeyState('R') & 0x8000) { + scriptToLoad = 1; + DoSettingsBeforeStartingAGame(); + return; + } +#endif + } +#endif + if (!m_bShowMouse && (m_nMouseOldPosX != m_nMousePosX || m_nMouseOldPosY != m_nMousePosY)) { m_bShowMouse = true; } @@ -4894,6 +4912,9 @@ CMenuManager::ProcessFileActions() } if (m_nCurrScreen == MENUPAGE_LOADING_IN_PROGRESS) { if (CheckSlotDataValid(m_nCurrSaveSlot)) { +#ifdef USE_DEBUG_SCRIPT_LOADER + scriptToLoad = 0; +#endif DoSettingsBeforeStartingAGame(); m_bWantToLoad = true; } diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index c52c7c36..89b3f053 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -378,15 +378,13 @@ void AltDodoCheat(void) } #endif -#ifdef DETECT_PAD_INPUT_SWITCH bool -CControllerState::IsAnyButtonPressed(void) +CControllerState::CheckForInput(void) { return !!LeftStickX || !!LeftStickY || !!RightStickX || !!RightStickY || !!LeftShoulder1 || !!LeftShoulder2 || !!RightShoulder1 || !!RightShoulder2 || - !!DPadUp || !!DPadDown || !!DPadLeft || !!DPadRight || !!Start || !!Select || !!Square || !!Triangle || !!Cross || !!Circle || !!LeftShock || - !!RightShock || !!NetworkTalk; + !!DPadUp || !!DPadDown || !!DPadLeft || !!DPadRight || !!Start || !!Select || !!Square || !!Triangle || !!Cross || !!Circle || !!LeftShock || + !!RightShock; } -#endif void CControllerState::Clear(void) @@ -484,6 +482,11 @@ void CPad::Clear(bool bResetPlayerControls) AverageEntries = 0; } +uint32 CPad::InputHowLongAgo() +{ + return CTimer::GetTimeInMilliseconds() - LastTimeTouched; +} + void CPad::ClearMouseHistory() { PCTempMouseControllerState.Clear(); @@ -1155,7 +1158,7 @@ void CPad::UpdatePads(void) CapturePad(0); #endif #ifdef DETECT_PAD_INPUT_SWITCH - if (GetPad(0)->PCTempJoyState.IsAnyButtonPressed()) + if (GetPad(0)->PCTempJoyState.CheckForInput()) IsAffectedByController = true; else { #endif @@ -1165,11 +1168,11 @@ void CPad::UpdatePads(void) #ifdef DETECT_PAD_INPUT_SWITCH } - if (IsAffectedByController && (GetPad(0)->PCTempKeyState.IsAnyButtonPressed() || GetPad(0)->PCTempMouseState.IsAnyButtonPressed())) + if (IsAffectedByController && (GetPad(0)->PCTempKeyState.CheckForInput() || GetPad(0)->PCTempMouseState.CheckForInput())) IsAffectedByController = false; #endif - if ( CReplay::IsPlayingBackFromFile() ) + if ( CReplay::IsPlayingBackFromFile() && !FrontEndMenuManager.m_bMenuActive ) bUpdate = false; if ( bUpdate ) @@ -1209,6 +1212,9 @@ void CPad::Update(int16 unk) PCTempMouseState.Clear(); ProcessPCSpecificStuff(); + + if (NewState.CheckForInput()) + LastTimeTouched = CTimer::GetTimeInMilliseconds(); if ( ++iCurrHornHistory >= HORNHISTORY_SIZE ) iCurrHornHistory = 0; diff --git a/src/core/Pad.h b/src/core/Pad.h index ad93fb49..46ed9b39 100644 --- a/src/core/Pad.h +++ b/src/core/Pad.h @@ -29,9 +29,7 @@ public: float GetRightStickX(void) { return RightStickX/32767.0f; }; float GetRightStickY(void) { return RightStickY/32767.0f; }; -#ifdef DETECT_PAD_INPUT_SWITCH - bool IsAnyButtonPressed(); -#endif + bool CheckForInput(); void Clear(void); }; VALIDATE_SIZE(CControllerState, 0x2A); @@ -260,6 +258,7 @@ public: static void ResetCheats(void); static char *EditString(char *pStr, int32 nSize); static int32 *EditCodesForControls(int32 *pRsKeys, int32 nSize); + uint32 InputHowLongAgo(void); #ifdef XINPUT void AffectFromXinput(uint32 pad); |