summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-04-26 23:53:54 +0200
committerGitHub <noreply@github.com>2020-04-26 23:53:54 +0200
commit68bf2398689a1de168dce41d31ad2070ce32f70a (patch)
tree9de92b6123fb2b7e219768b5b6e5c11b2ac0b75a /src/core
parentMerge branch 'master' of github.com:gtamodding/re3 (diff)
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadre3-68bf2398689a1de168dce41d31ad2070ce32f70a.tar
re3-68bf2398689a1de168dce41d31ad2070ce32f70a.tar.gz
re3-68bf2398689a1de168dce41d31ad2070ce32f70a.tar.bz2
re3-68bf2398689a1de168dce41d31ad2070ce32f70a.tar.lz
re3-68bf2398689a1de168dce41d31ad2070ce32f70a.tar.xz
re3-68bf2398689a1de168dce41d31ad2070ce32f70a.tar.zst
re3-68bf2398689a1de168dce41d31ad2070ce32f70a.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Cam.cpp13
-rw-r--r--src/core/Camera.cpp20
-rw-r--r--src/core/Camera.h1
-rw-r--r--src/core/Frontend.cpp23
-rw-r--r--src/core/Frontend.h1
-rw-r--r--src/core/Pad.cpp44
-rw-r--r--src/core/Pad.h4
-rw-r--r--src/core/config.h2
-rw-r--r--src/core/templates.h4
9 files changed, 110 insertions, 2 deletions
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index 5cf1c8f3..801652cb 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -2545,11 +2545,13 @@ CCam::Process_M16_1stPerson(const CVector &CameraTarget, float, float, float)
ResetStatics = false;
}
+#ifndef GTA3_1_1_PATCH
((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&HeadPos, PED_HEAD);
Source = HeadPos;
Source.z += 0.1f;
Source.x -= 0.19f*Cos(m_fInitialPlayerOrientation);
Source.y -= 0.19f*Sin(m_fInitialPlayerOrientation);
+#endif
// Look around
bool UseMouse = false;
@@ -2578,6 +2580,17 @@ CCam::Process_M16_1stPerson(const CVector &CameraTarget, float, float, float)
if(Alpha > DEGTORAD(60.0f)) Alpha = DEGTORAD(60.0f);
if(Alpha < -DEGTORAD(89.5f)) Alpha = -DEGTORAD(89.5f);
+#ifdef GTA3_1_1_PATCH
+ HeadPos.x = 0.0f;
+ HeadPos.y = 0.0f;
+ HeadPos.z = 0.0f;
+ ((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&HeadPos, PED_HEAD);
+ Source = HeadPos;
+ Source.z += 0.1f;
+ Source.x -= 0.19f * Cos(m_fInitialPlayerOrientation);
+ Source.y -= 0.19f * Sin(m_fInitialPlayerOrientation);
+#endif
+
TargetCoors.x = 3.0f * Cos(Alpha) * Cos(Beta) + Source.x;
TargetCoors.y = 3.0f * Cos(Alpha) * Sin(Beta) + Source.y;
TargetCoors.z = 3.0f * Sin(Alpha) + Source.z;
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index c8eaaa56..9a053056 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -71,11 +71,27 @@ bool bDidWeProcessAnyCinemaCam;
#define CTRLDOWN(key) ((KEYDOWN(rsLCTRL) || KEYDOWN(rsRCTRL)) && KEYDOWN((RsKeyCodes)key))
#endif
+CCamera::CCamera(void)
+{
+#ifdef GTA3_1_1_PATCH
+ m_fMouseAccelHorzntl = 0.0025f;
+ m_fMouseAccelVertical = 0.003f;
+#endif
+ Init();
+}
+
void
CCamera::Init(void)
{
+#ifdef GTA3_1_1_PATCH
+ float fMouseAccelHorzntl = m_fMouseAccelHorzntl;
+ float fMouseAccelVertical = m_fMouseAccelVertical;
+#endif
memset(this, 0, sizeof(CCamera)); // getting rid of vtable, eh?
-
+#ifdef GTA3_1_1_PATCH
+ m_fMouseAccelHorzntl = fMouseAccelHorzntl;
+ m_fMouseAccelVertical = fMouseAccelVertical;
+#endif
m_pRwCamera = nil;
m_1rstPersonRunCloseToAWall = false;
m_fPositionAlongSpline = 0.0f;
@@ -191,8 +207,10 @@ CCamera::Init(void)
m_uiTransitionState = 0;
m_uiTimeTransitionStart = 0;
m_bLookingAtPlayer = true;
+#ifndef GTA3_1_1_PATCH
m_fMouseAccelHorzntl = 0.0025f;
m_fMouseAccelVertical = 0.003f;
+#endif
m_f3rdPersonCHairMultX = 0.53f;
m_f3rdPersonCHairMultY = 0.4f;
}
diff --git a/src/core/Camera.h b/src/core/Camera.h
index d1c8ec03..6d53f417 100644
--- a/src/core/Camera.h
+++ b/src/core/Camera.h
@@ -546,6 +546,7 @@ uint32 unknown; // some counter having to do with music
#endif
// High level and misc
+ CCamera(void);
void Init(void);
void Process(void);
void CamControl(void);
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index cc076057..b0766cff 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -2966,8 +2966,10 @@ CMenuManager::LoadAllTextures()
CTxdStore::LoadTxd(frontendTxdSlot, "MODELS/FRONTEND.TXD");
CTxdStore::AddRef(frontendTxdSlot);
CTxdStore::SetCurrentTxd(frontendTxdSlot);
+#ifndef GTA3_1_1_PATCH
CStreaming::IHaveUsedStreamingMemory();
CTimer::Update();
+#endif
for (int i = 0; i < ARRAY_SIZE(FrontendFilenames); i++) {
m_aFrontEndSprites[i].SetTexture(FrontendFilenames[i][0], FrontendFilenames[i][1]);
@@ -2994,6 +2996,10 @@ CMenuManager::LoadAllTextures()
m_aMapSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER);
}
#endif
+#ifdef GTA3_1_1_PATCH
+ CStreaming::IHaveUsedStreamingMemory();
+ CTimer::Update();
+#endif
m_bSpritesLoaded = true;
CTxdStore::PopCurrentTxd();
}
@@ -3005,7 +3011,11 @@ CMenuManager::LoadSettings()
int fileHandle = CFileMgr::OpenFile("gta3.set", "r");
int32 prevLang = m_PrefsLanguage;
+#ifdef GTA3_1_1_PATCH
+ CMBlur::BlurOn = (_dwOperatingSystemVersion != OS_WIN98);
+#else
CMBlur::BlurOn = true;
+#endif
MousePointerStateHelper.bInvertVertically = true;
// 50 is silly
@@ -4474,7 +4484,18 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsUseWideScreen = false;
m_PrefsShowSubtitles = true;
m_nDisplayVideoMode = m_nPrefsVideoMode;
+#ifdef GTA3_1_1_PATCH
+ if (_dwOperatingSystemVersion == OS_WIN98) {
+ CMBlur::BlurOn = false;
+ CMBlur::MotionBlurClose();
+ }
+ else {
+ CMBlur::BlurOn = true;
+ CMBlur::MotionBlurOpen(Scene.camera);
+ }
+#else
CMBlur::BlurOn = true;
+#endif
SaveSettings();
} else if ((m_nCurrScreen != MENUPAGE_SKIN_SELECT_OLD) && (m_nCurrScreen == MENUPAGE_CONTROLLER_PC)) {
ControlsManager.MakeControllerActionsBlank();
@@ -5012,7 +5033,7 @@ CMenuManager::WaitForUserCD()
CSprite2d *splash;
char *splashscreen = nil;
-#ifndef RANDOMSPLASH
+#if (!(defined RANDOMSPLASH) && !(defined GTA3_1_1_PATCH))
if (CGame::frenchGame || CGame::germanGame || !CGame::nastyGame)
splashscreen = "mainsc2";
else
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index c7b0c979..ef5279aa 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -646,3 +646,4 @@ public:
static_assert(sizeof(CMenuManager) == 0x564, "CMenuManager: error");
extern CMenuManager FrontEndMenuManager;
+extern unsigned long _dwOperatingSystemVersion; \ No newline at end of file
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 84bb1526..0a626570 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -293,6 +293,38 @@ void KangarooCheat()
}
#endif
+#ifdef ALLCARSHELI_CHEAT
+void AllCarsHeliCheat(void)
+{
+ wchar* string;
+ if (bAllCarCheat) {
+ string = TheText.Get("CHEATOF");
+ bAllCarCheat = false;
+ }
+ else {
+ string = TheText.Get("CHEAT1");
+ bAllCarCheat = true;
+ }
+ CHud::SetHelpMessage(string, true);
+}
+#endif
+
+#ifdef ALT_DODO_CHEAT
+void AltDodoCheat(void)
+{
+ wchar* string;
+ if (CVehicle::bAltDodoCheat) {
+ string = TheText.Get("CHEATOF");
+ CVehicle::bAltDodoCheat = false;
+ }
+ else {
+ string = TheText.Get("CHEAT1");
+ CVehicle::bAltDodoCheat = true;
+ }
+ CHud::SetHelpMessage(string, true);
+}
+#endif
+
void
CControllerState::Clear(void)
{
@@ -915,6 +947,18 @@ void CPad::AddToPCCheatString(char c)
if (!_CHEATCMP("GUBEDDEP"))
CPed::SwitchDebugDisplay();
#endif
+
+#ifdef ALLCARSHELI_CHEAT
+ // "CARSAREHELI"
+ if (!_CHEATCMP("ILEHERASRAC"))
+ AllCarsHeliCheat();
+#endif
+
+#ifdef ALT_DODO_CHEAT
+ // "IWANTTOMASTERDODO"
+ if (!_CHEATCMP("ODODRETSAMOTTNAWI"))
+ AltDodoCheat();
+#endif
#undef _CHEATCMP
}
diff --git a/src/core/Pad.h b/src/core/Pad.h
index b3b0849b..b8228444 100644
--- a/src/core/Pad.h
+++ b/src/core/Pad.h
@@ -450,3 +450,7 @@ public:
VALIDATE_SIZE(CPad, 0xFC);
extern CPad Pads[MAX_PADS];
+
+#ifdef ALLCARSHELI_CHEAT
+extern bool bAllCarCheat;
+#endif
diff --git a/src/core/config.h b/src/core/config.h
index 2cf8ec88..f05e6c4a 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -204,6 +204,8 @@ enum Config {
#define XINPUT
#endif
#define KANGAROO_CHEAT
+#define ALLCARSHELI_CHEAT
+#define ALT_DODO_CHEAT
#define REGISTER_START_BUTTON
// Hud, frontend and radar
diff --git a/src/core/templates.h b/src/core/templates.h
index a1627357..51a24e4c 100644
--- a/src/core/templates.h
+++ b/src/core/templates.h
@@ -104,6 +104,10 @@ public:
return m_flags[i].free ? nil : (T*)&m_entries[i];
}
T *GetAt(int handle){
+#ifdef FIX_BUGS
+ if (handle == -1)
+ return nil;
+#endif
return m_flags[handle>>8].u == (handle & 0xFF) ?
(T*)&m_entries[handle >> 8] : nil;
}