summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Frontend.cpp12
-rw-r--r--src/core/MenuScreensCustom.cpp8
-rw-r--r--src/core/Pad.cpp21
-rw-r--r--src/core/Pad.h3
-rw-r--r--src/core/config.h2
-rw-r--r--src/core/main.cpp4
6 files changed, 45 insertions, 5 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 4be23b77..b84b691d 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -5433,6 +5433,10 @@ CMenuManager::SetHelperText(int text)
void
CMenuManager::ShutdownJustMenu()
{
+ // In case we're windowed, keep mouse centered while in game. Done in main.cpp in other conditions.
+#if defined(RW_GL3) && defined(IMPROVED_VIDEOMODE)
+ glfwSetInputMode(PSGLOBAL(window), GLFW_CURSOR, GLFW_CURSOR_DISABLED);
+#endif
m_bMenuActive = false;
CTimer::EndUserPause();
}
@@ -5529,8 +5533,14 @@ CMenuManager::SwitchMenuOnAndOff()
gMusicPlaying = 0;
}
*/
- if (m_bMenuActive != menuWasActive)
+ if (m_bMenuActive != menuWasActive) {
m_bMenuStateChanged = true;
+
+ // In case we're windowed, keep mouse centered while in game. Done in main.cpp in other conditions.
+#if defined(RW_GL3) && defined(IMPROVED_VIDEOMODE)
+ glfwSetInputMode(PSGLOBAL(window), GLFW_CURSOR, m_bMenuActive && m_nPrefsWindowed ? GLFW_CURSOR_HIDDEN : GLFW_CURSOR_DISABLED);
+#endif
+ }
m_bStartUpFrontEndRequested = false;
m_bShutDownFrontEndRequested = false;
diff --git a/src/core/MenuScreensCustom.cpp b/src/core/MenuScreensCustom.cpp
index d3d7474d..f8ff3acf 100644
--- a/src/core/MenuScreensCustom.cpp
+++ b/src/core/MenuScreensCustom.cpp
@@ -15,6 +15,7 @@
#include "FileLoader.h"
#include "Collision.h"
#include "ModelInfo.h"
+#include "Pad.h"
// Menu screens array is at the bottom of the file.
@@ -76,6 +77,12 @@
#define PIPELINES_SELECTOR
#endif
+#ifdef INVERT_LOOK_FOR_PAD
+ #define INVERT_PAD_SELECTOR MENUACTION_CFO_SELECT, "FEC_IVP", { new CCFOSelect((int8*)&CPad::bInvertLook4Pad, "InvertPad", off_on, 2, false, nil) },
+#else
+ #define INVERT_PAD_SELECTOR
+#endif
+
const char *filterNames[] = { "FEM_NON", "FEM_SIM", "FEM_NRM", "FEM_MOB" };
const char *vehPipelineNames[] = { "FED_MFX", "FED_NEO" };
const char *off_on[] = { "FEM_OFF", "FEM_ON" };
@@ -780,6 +787,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
{ "FET_MTI", MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, nil, nil,
MENUACTION_MOUSESENS, "FEC_MSH", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS },
MENUACTION_INVVERT, "FEC_IVV", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS },
+ INVERT_PAD_SELECTOR
MENUACTION_MOUSESTEER, "FET_MST", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS },
MENUACTION_CHANGEMENU, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE },
},
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 928ae826..9c6bdc98 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -59,6 +59,9 @@ bool CPad::bDisplayNoControllerMessage;
bool CPad::bObsoleteControllerMessage;
bool CPad::bOldDisplayNoControllerMessage;
bool CPad::m_bMapPadOneToPadTwo;
+#ifdef INVERT_LOOK_FOR_PAD
+bool CPad::bInvertLook4Pad;
+#endif
#ifdef GTA_PS2
unsigned char act_direct[6];
unsigned char act_align[6];
@@ -1281,7 +1284,7 @@ void CPad::Update(int16 pad)
{
if ( ShakeDur )
{
- ShakeDur = Max(ShakeDur - CTimer::GetTimeStepInMilliseconds(), 0);
+ ShakeDur = Max(ShakeDur - (int32)CTimer::GetTimeStepInMilliseconds(), 0);
if ( ShakeDur == 0 )
{
@@ -2534,10 +2537,20 @@ int16 CPad::SniperModeLookLeftRight(void)
int16 CPad::SniperModeLookUpDown(void)
{
int16 axis = NewState.LeftStickY;
+ int16 dpad;
#ifdef FIX_BUGS
axis = -axis;
#endif
- int16 dpad = (NewState.DPadUp - NewState.DPadDown) / 2;
+#ifndef INVERT_LOOK_FOR_PAD
+ dpad = (NewState.DPadUp - NewState.DPadDown) / 2;
+#else
+ if (CPad::bInvertLook4Pad) {
+ axis = -axis;
+ dpad = (NewState.DPadDown - NewState.DPadUp) / 2;
+ } else {
+ dpad = (NewState.DPadUp - NewState.DPadDown) / 2;
+ }
+#endif
if ( Abs(axis) > Abs(dpad) )
return axis;
@@ -2567,6 +2580,10 @@ int16 CPad::LookAroundUpDown(void)
#ifdef FIX_BUGS
axis = -axis;
#endif
+#ifdef INVERT_LOOK_FOR_PAD
+ if (CPad::bInvertLook4Pad)
+ axis = -axis;
+#endif
if ( Abs(axis) > 85 && !GetLookBehindForPed() )
return (int16) ( (axis + ( ( axis > 0 ) ? -85 : 85) )
diff --git a/src/core/Pad.h b/src/core/Pad.h
index 8c5d7ba3..20a676ef 100644
--- a/src/core/Pad.h
+++ b/src/core/Pad.h
@@ -170,6 +170,9 @@ public:
static bool bObsoleteControllerMessage;
static bool bOldDisplayNoControllerMessage;
static bool m_bMapPadOneToPadTwo;
+#ifdef INVERT_LOOK_FOR_PAD
+ static bool bInvertLook4Pad;
+#endif
static CKeyboardState OldKeyState;
static CKeyboardState NewKeyState;
diff --git a/src/core/config.h b/src/core/config.h
index ddbac185..3da9bcb1 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -177,6 +177,7 @@ enum Config {
# define GTA_PS2_STUFF
# define RANDOMSPLASH
# define VU_COLLISION
+# define ANIM_COMPRESSION
#elif defined GTA_PC
# define GTA3_1_1_PATCH
//# define GTA3_STEAM_PATCH
@@ -280,6 +281,7 @@ enum Config {
# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
# define CUTSCENE_BORDERS_SWITCH
# define MULTISAMPLING // adds MSAA option
+# define INVERT_LOOK_FOR_PAD // add bInvertLook4Pad from VC
# endif
#endif
diff --git a/src/core/main.cpp b/src/core/main.cpp
index cd234588..157776e0 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -1090,9 +1090,9 @@ Idle(void *arg)
if((!FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bRenderGameInMenu) &&
TheCamera.GetScreenFadeStatus() != FADE_2)
{
-#ifdef GTA_PC
+ // This is from SA, but it's nice for windowed mode
+#if defined(GTA_PC) && !defined(RW_GL3)
if (!FrontEndMenuManager.m_bRenderGameInMenu) {
- // This is from SA, but it's nice for windowed mode
RwV2d pos;
pos.x = SCREEN_WIDTH / 2.0f;
pos.y = SCREEN_HEIGHT / 2.0f;