Merge branch 'miami' of github.com:GTAmodding/re3 into miami

This commit is contained in:
aap
2021-02-06 10:23:28 +01:00
20 changed files with 163 additions and 32 deletions

View File

@ -1908,6 +1908,9 @@ cSampleManager::StopStreamedFile(uint8 nStream)
{
delete stream;
aStream[nStream] = NULL;
if ( nStream == 0 )
_bIsMp3Active = false;
}
}
@ -1920,7 +1923,21 @@ cSampleManager::GetStreamedFilePosition(uint8 nStream)
if ( stream )
{
return stream->GetPosMS();
if ( _bIsMp3Active )
{
tMP3Entry *mp3 = _GetMP3EntryByIndex(_CurMP3Index);
if ( mp3 != NULL )
{
return stream->GetPosMS() + mp3->nTrackStreamPos;
}
else
return 0;
}
else
{
return stream->GetPosMS();
}
}
return 0;

View File

@ -52,8 +52,8 @@ void CAutoPilot::Save(uint8*& buf)
WriteSaveBuf<int32>(buf, m_nCurrentRouteNode);
WriteSaveBuf<int32>(buf, m_nNextRouteNode);
WriteSaveBuf<int32>(buf, m_nPrevRouteNode);
WriteSaveBuf<uint32>(buf, m_nTimeEnteredCurve);
WriteSaveBuf<uint32>(buf, m_nTimeToSpendOnCurrentCurve);
WriteSaveBuf<int32>(buf, m_nTimeEnteredCurve);
WriteSaveBuf<int32>(buf, m_nTimeToSpendOnCurrentCurve);
WriteSaveBuf<uint32>(buf, m_nCurrentPathNodeInfo);
WriteSaveBuf<uint32>(buf, m_nNextPathNodeInfo);
WriteSaveBuf<uint32>(buf, m_nPreviousPathNodeInfo);
@ -95,8 +95,8 @@ void CAutoPilot::Load(uint8*& buf)
m_nCurrentRouteNode = ReadSaveBuf<int32>(buf);
m_nNextRouteNode = ReadSaveBuf<int32>(buf);
m_nPrevRouteNode = ReadSaveBuf<int32>(buf);
m_nTimeEnteredCurve = ReadSaveBuf<uint32>(buf);
m_nTimeToSpendOnCurrentCurve = ReadSaveBuf<uint32>(buf);
m_nTimeEnteredCurve = ReadSaveBuf<int32>(buf);
m_nTimeToSpendOnCurrentCurve = ReadSaveBuf<int32>(buf);
m_nCurrentPathNodeInfo = ReadSaveBuf<uint32>(buf);
m_nNextPathNodeInfo = ReadSaveBuf<uint32>(buf);
m_nPreviousPathNodeInfo = ReadSaveBuf<uint32>(buf);

View File

@ -64,8 +64,8 @@ public:
int32 m_nCurrentRouteNode;
int32 m_nNextRouteNode;
int32 m_nPrevRouteNode;
uint32 m_nTimeEnteredCurve;
uint32 m_nTimeToSpendOnCurrentCurve;
int32 m_nTimeEnteredCurve;
int32 m_nTimeToSpendOnCurrentCurve;
uint32 m_nCurrentPathNodeInfo;
uint32 m_nNextPathNodeInfo;
uint32 m_nPreviousPathNodeInfo;

View File

@ -2757,7 +2757,7 @@ void CCarCtrl::SteerAIPlaneTowardsTargetCoors(CAutomobile* pPlane)
up.Normalise();
CVector forward(Cos(pPlane->m_fOrientation), Sin(pPlane->m_fOrientation), fForwardZ);
forward.Normalise();
CVector right = CrossProduct(forward, up);
CVector right = CrossProduct(up, forward);
right.z -= 5.0f * pPlane->m_fPlaneSteer;
right.Normalise();
up = CrossProduct(forward, right);

View File

@ -431,12 +431,12 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
script_assert(pPed);
if (ScriptParams[1]) {
pPed->bIsDucking = true;
pPed->bCrouchWhenShooting = true;
pPed->SetDuck(ScriptParams[2], true);
}
else {
pPed->ClearDuck(true);
pPed->bIsDucking = false;
pPed->bCrouchWhenShooting = false;
}
return 0;
}

View File

@ -355,7 +355,7 @@ __inline__ void TRACE(char *f, ...) { } // this is re3 only, and so the function
#ifndef MASTER
#define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) )
#else
#define assert(_Expression)
#define assert(_Expression) (_Expression)
#endif
#define ASSERT assert

View File

@ -251,6 +251,12 @@ enum Config {
#define FIX_BUGS_64 // Must have fixes to be able to run 64 bit build
#endif
#define ASCII_STRCMP // use faster ascii str comparisons
#if !defined _WIN32 || defined __MWERKS__ || defined __MINGW32__ || defined VANILLA_DEFINES
#undef ASCII_STRCMP
#endif
// Just debug menu entries
#ifdef DEBUGMENU
#define RELOADABLES // some debug menu options to reload TXD files

View File

@ -1140,18 +1140,18 @@ void CHud::Draw()
if (IntroRect.m_nTextureId >= 0) {
CRect rect (
IntroRect.m_sRect.left,
IntroRect.m_sRect.top,
IntroRect.m_sRect.bottom,
IntroRect.m_sRect.right,
IntroRect.m_sRect.bottom );
IntroRect.m_sRect.top );
CTheScripts::ScriptSprites[IntroRect.m_nTextureId].Draw(rect, IntroRect.m_sColor);
}
else {
CRect rect (
IntroRect.m_sRect.left,
IntroRect.m_sRect.top,
IntroRect.m_sRect.bottom,
IntroRect.m_sRect.right,
IntroRect.m_sRect.bottom );
IntroRect.m_sRect.top );
CSprite2d::DrawRect(rect, IntroRect.m_sColor);
}