Fixed CCamera::SetWideScreenOff dupe, removed goto in CStreaming::RetryLoadFile

This commit is contained in:
Sergeanur 2019-10-06 02:41:35 +03:00
parent dd99edd339
commit 96eee4f10f
4 changed files with 31 additions and 18 deletions

View File

@ -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++)

View File

@ -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);

View File

@ -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;

View File

@ -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;
}
}