summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2019-10-06 01:41:35 +0200
committerSergeanur <s.anureev@yandex.ua>2019-10-06 01:41:35 +0200
commit96eee4f10ffd5b5fccf417aba580108b160e3842 (patch)
treea737b09b4d70ea55937210256105f50e94aa8fa7 /src
parentFixed a bunch of calculation mistakes in CHud (diff)
downloadre3-96eee4f10ffd5b5fccf417aba580108b160e3842.tar
re3-96eee4f10ffd5b5fccf417aba580108b160e3842.tar.gz
re3-96eee4f10ffd5b5fccf417aba580108b160e3842.tar.bz2
re3-96eee4f10ffd5b5fccf417aba580108b160e3842.tar.lz
re3-96eee4f10ffd5b5fccf417aba580108b160e3842.tar.xz
re3-96eee4f10ffd5b5fccf417aba580108b160e3842.tar.zst
re3-96eee4f10ffd5b5fccf417aba580108b160e3842.zip
Diffstat (limited to 'src')
-rw-r--r--src/control/Script.cpp2
-rw-r--r--src/core/Camera.cpp22
-rw-r--r--src/core/Camera.h16
-rw-r--r--src/core/Streaming.cpp9
4 files changed, 31 insertions, 18 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 1511b233..db4ef82f 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -130,7 +130,7 @@ void CMissionCleanup::Process()
CCarCtrl::CarDensityMultiplier = 1.0;
FindPlayerPed()->m_pWanted->m_fCrimeSensitivity = 1.0f;
TheCamera.Restore();
- TheCamera.SetWidescreenOff();
+ TheCamera.SetWideScreenOff();
DMAudio.ClearMissionAudio();
CWeather::ReleaseWeather();
for (int i = 0; i < NUM_OF_SPECIAL_CHARS; i++)
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index 93680dc1..775ab46a 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -22,7 +22,6 @@ WRAPPER void CCamera::CamShake(float strength, float x, float y, float z) { EAXJ
WRAPPER void CCamera::DrawBordersForWideScreen(void) { EAXJMP(0x46B430); }
WRAPPER void CCamera::CalculateDerivedValues(void) { EAXJMP(0x46EEA0); }
WRAPPER void CCamera::Restore(void) { EAXJMP(0x46F990); }
-WRAPPER void CCamera::SetWidescreenOff(void) { EAXJMP(0x46FF10); }
WRAPPER void CamShakeNoPos(CCamera*, float) { EAXJMP(0x46B100); }
WRAPPER void CCamera::TakeControl(CEntity*, int16, int16, int32) { EAXJMP(0x471500); }
WRAPPER void CCamera::TakeControlNoEntity(const CVector&, int16, int32) { EAXJMP(0x4715B0); }
@@ -33,8 +32,6 @@ WRAPPER void CCamera::Process(void) { EAXJMP(0x46D3F0); }
WRAPPER void CCamera::LoadPathSplines(int file) { EAXJMP(0x46D1D0); }
WRAPPER uint32 CCamera::GetCutSceneFinishTime(void) { EAXJMP(0x46B920); }
WRAPPER void CCamera::FinishCutscene(void) { EAXJMP(0x46B560); }
-WRAPPER void CCamera::SetCamCutSceneOffSet(const CVector&) { EAXJMP(0x46FC30); };
-WRAPPER void CCamera::TakeControlWithSpline(short) { EAXJMP(0x471620); };
WRAPPER void CCamera::RestoreWithJumpCut(void) { EAXJMP(0x46FAE0); };
bool
@@ -1333,6 +1330,25 @@ CCamera::Find3rdPersonQuickAimPitch(void)
return -(DEGTORAD(((0.5f - m_f3rdPersonCHairMultY) * 1.8f * 0.5f * Cams[ActiveCam].FOV)) + rot);
}
+void
+CCamera::SetCamCutSceneOffSet(const CVector &pos)
+{
+ m_vecCutSceneOffset = pos;
+};
+
+void
+CCamera::TakeControlWithSpline(short nSwitch)
+{
+ m_iModeToGoTo = CCam::MODE_FLYBY;
+ m_bLookingAtPlayer = false;
+ m_bLookingAtVector = false;
+ m_bcutsceneFinished = false;
+ m_iTypeOfSwitch = nSwitch;
+ m_bStartInterScript = true;
+
+ //FindPlayerPed(); // unused
+};
+
STARTPATCHES
InjectHook(0x42C760, (bool (CCamera::*)(const CVector &center, float radius, const CMatrix *mat))&CCamera::IsSphereVisible, PATCH_JUMP);
InjectHook(0x46FD00, &CCamera::SetFadeColour, PATCH_JUMP);
diff --git a/src/core/Camera.h b/src/core/Camera.h
index de725b19..0fd372c3 100644
--- a/src/core/Camera.h
+++ b/src/core/Camera.h
@@ -380,11 +380,11 @@ uint32 unknown;
CVector m_RealPreviousCameraPosition;
CVector m_cvecAimingTargetCoors;
CVector m_vecFixedModeVector;
+ CVector m_vecFixedModeSource;
+ CVector m_vecFixedModeUpOffSet;
+ CVector m_vecCutSceneOffset;
- // one of those has to go
- CVector m_vecFixedModeSource;
- CVector m_vecFixedModeUpOffSet;
-// CVector m_vecCutSceneOffset;
+ // one of those has to go
CVector m_cvecStartingSourceForInterPol;
CVector m_cvecStartingTargetForInterPol;
CVector m_cvecStartingUpForInterPol;
@@ -394,7 +394,7 @@ uint32 unknown;
CVector m_vecSourceWhenInterPol;
CVector m_vecTargetWhenInterPol;
CVector m_vecUpWhenInterPol;
- CVector m_vecClearGeometryVec;
+ //CVector m_vecClearGeometryVec;
CVector m_vecGameCamPos;
CVector SourceDuringInter;
@@ -468,7 +468,8 @@ int m_iModeObbeCamIsInForCar;
void DrawBordersForWideScreen(void);
void Restore(void);
- void SetWidescreenOff(void);
+ void SetWideScreenOn(void) { m_WideScreenOn = true; }
+ void SetWideScreenOff(void) { m_WideScreenOn = false; }
float Find3rdPersonQuickAimPitch(void);
@@ -487,8 +488,6 @@ int m_iModeObbeCamIsInForCar;
void SetCamCutSceneOffSet(const CVector&);
void TakeControlWithSpline(short);
- void SetWideScreenOn(void) { m_WideScreenOn = true; }
- void SetWideScreenOff(void) { m_WideScreenOn = false; }
void RestoreWithJumpCut(void);
void dtor(void) { this->CCamera::~CCamera(); }
@@ -500,6 +499,7 @@ static_assert(offsetof(CCamera, m_uiTransitionState) == 0x89, "CCamera: error");
static_assert(offsetof(CCamera, m_uiTimeTransitionStart) == 0x94, "CCamera: error");
static_assert(offsetof(CCamera, m_BlurBlue) == 0x9C, "CCamera: error");
static_assert(offsetof(CCamera, Cams) == 0x1A4, "CCamera: error");
+static_assert(offsetof(CCamera, m_vecCutSceneOffset) == 0x6F8, "CCamera: error");
static_assert(sizeof(CCamera) == 0xE9D8, "CCamera: wrong size");
extern CCamera &TheCamera;
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index d15415ea..227a4a9f 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -1719,8 +1719,10 @@ CStreaming::RetryLoadFile(int32 ch)
}
switch(ms_channel[ch].state){
+ case CHANNELSTATE_ERROR:
+ ms_channel[ch].numTries++;
+ if (CdStreamGetStatus(ch) == STREAM_READING || CdStreamGetStatus(ch) == STREAM_WAITING) break;
case CHANNELSTATE_IDLE:
-streamread:
CdStreamRead(ch, ms_pStreamingBuffer[ch], ms_channel[ch].position, ms_channel[ch].size);
ms_channel[ch].state = CHANNELSTATE_READING;
ms_channel[ch].field24 = -600;
@@ -1731,11 +1733,6 @@ streamread:
CTimer::SetCodePause(false);
}
break;
- case CHANNELSTATE_ERROR:
- ms_channel[ch].numTries++;
- if(CdStreamGetStatus(ch) != STREAM_READING && CdStreamGetStatus(ch) != STREAM_WAITING)
- goto streamread;
- break;
}
}