1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 08:10:01 +00:00

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

This commit is contained in:
aap 2020-11-02 13:57:58 +01:00
commit 8acc98563e
6 changed files with 37 additions and 13 deletions

View file

@ -53,7 +53,7 @@
#include "Fluff.h" #include "Fluff.h"
#include "WaterCreatures.h" #include "WaterCreatures.h"
//--MIAMI: file done except TODO //--MIAMI: file done
uint8 CReplay::Mode; uint8 CReplay::Mode;
CAddressInReplayBuffer CReplay::Record; CAddressInReplayBuffer CReplay::Record;
@ -158,7 +158,7 @@ static void(*CBArray[])(CAnimBlendAssociation*, void*) =
&CPed::FinishedAttackCB, &CPed::FinishedAttackCB,
&CPed::FinishFightMoveCB, &PhonePutDownCB, &PhonePickUpCB, &CPed::PedAnimDoorCloseRollingCB, &CPed::FinishJumpCB, &CPed::FinishFightMoveCB, &PhonePutDownCB, &PhonePickUpCB, &CPed::PedAnimDoorCloseRollingCB, &CPed::FinishJumpCB,
&CPed::PedLandCB, &CPed::RestoreHeadingRateCB, &CPed::PedSetQuickDraggedOutCarPositionCB, &CPed::PedSetDraggedOutCarPositionCB, &CPed::PedLandCB, &CPed::RestoreHeadingRateCB, &CPed::PedSetQuickDraggedOutCarPositionCB, &CPed::PedSetDraggedOutCarPositionCB,
&CPed::PedSetPreviousStateCB, &CPed::FinishedReloadCB, /*&CPed::PedSetGetInCarPositionCB, TODO(MIAMI)*/ &CPed::PedSetPreviousStateCB, &CPed::FinishedReloadCB, &CPed::PedSetGetInCarPositionCB,
&CPed::PedAnimShuffleCB, &CPed::DeleteSunbatheIdleAnimCB, &StartTalkingOnMobileCB, &FinishTalkingOnMobileCB &CPed::PedAnimShuffleCB, &CPed::DeleteSunbatheIdleAnimCB, &StartTalkingOnMobileCB, &FinishTalkingOnMobileCB
}; };
@ -396,7 +396,8 @@ void CReplay::RecordThisFrame(void)
misc->cam_shake_start = TheCamera.m_uiCamShakeStart; misc->cam_shake_start = TheCamera.m_uiCamShakeStart;
misc->cam_shake_strength = TheCamera.m_fCamShakeForce; misc->cam_shake_strength = TheCamera.m_fCamShakeForce;
misc->cur_area = CGame::currArea; misc->cur_area = CGame::currArea;
//misc->special_fx_flags; // TODO(MIAMI)!!! misc->video_cam = CSpecialFX::bVideoCam;
misc->lift_cam = CSpecialFX::bLiftCam;
Record.m_nOffset += sizeof(*misc); Record.m_nOffset += sizeof(*misc);
tEndOfFramePacket* eof = (tEndOfFramePacket*)&Record.m_pBase[Record.m_nOffset]; tEndOfFramePacket* eof = (tEndOfFramePacket*)&Record.m_pBase[Record.m_nOffset];
eof->type = REPLAYPACKET_ENDOFFRAME; eof->type = REPLAYPACKET_ENDOFFRAME;
@ -1139,7 +1140,8 @@ bool CReplay::PlayBackThisFrameInterpolation(CAddressInReplayBuffer *buffer, flo
tMiscPacket* pm = (tMiscPacket*)&ptr[offset]; tMiscPacket* pm = (tMiscPacket*)&ptr[offset];
TheCamera.m_uiCamShakeStart = pm->cam_shake_start; TheCamera.m_uiCamShakeStart = pm->cam_shake_start;
TheCamera.m_fCamShakeForce = pm->cam_shake_strength; TheCamera.m_fCamShakeForce = pm->cam_shake_strength;
// TODO(MIAMI): SpecialFX CSpecialFX::bVideoCam = pm->video_cam;
CSpecialFX::bLiftCam = pm->lift_cam;
CGame::currArea = pm->cur_area; CGame::currArea = pm->cur_area;
buffer->m_nOffset += sizeof(tMiscPacket); buffer->m_nOffset += sizeof(tMiscPacket);
break; break;

View file

@ -263,7 +263,8 @@ class CReplay
uint32 cam_shake_start; uint32 cam_shake_start;
float cam_shake_strength; float cam_shake_strength;
uint8 cur_area; uint8 cur_area;
uint8 special_fx_flags; uint8 video_cam : 1;
uint8 lift_cam : 1;
}; };
VALIDATE_SIZE(tMiscPacket, 16); VALIDATE_SIZE(tMiscPacket, 16);

View file

@ -88,6 +88,8 @@
#include <stdarg.h> #include <stdarg.h>
#endif #endif
//--MIAMI: file done
#define PICKUP_PLACEMENT_OFFSET 0.5f #define PICKUP_PLACEMENT_OFFSET 0.5f
#define PED_FIND_Z_OFFSET 5.0f #define PED_FIND_Z_OFFSET 5.0f
#define COP_PED_FIND_Z_OFFSET 10.0f #define COP_PED_FIND_Z_OFFSET 10.0f
@ -9113,12 +9115,16 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
switch (pPed->m_vehEnterType) { switch (pPed->m_vehEnterType) {
case CAR_DOOR_LF: case CAR_DOOR_LF:
flags = pPed->m_pMyVehicle->m_nNumMaxPassengers != 0 ? CAR_DOOR_FLAG_LF : CAR_DOOR_FLAG_LF | CAR_DOOR_FLAG_LR; flags = pPed->m_pMyVehicle->m_nNumMaxPassengers != 0 ? CAR_DOOR_FLAG_LF : CAR_DOOR_FLAG_LF | CAR_DOOR_FLAG_LR;
break;
case CAR_DOOR_LR: case CAR_DOOR_LR:
flags = pPed->m_pMyVehicle->m_nNumMaxPassengers != 0 ? CAR_DOOR_FLAG_RF : CAR_DOOR_FLAG_LF | CAR_DOOR_FLAG_LR; flags = pPed->m_pMyVehicle->m_nNumMaxPassengers != 0 ? CAR_DOOR_FLAG_RF : CAR_DOOR_FLAG_LF | CAR_DOOR_FLAG_LR;
break;
case CAR_DOOR_RF: case CAR_DOOR_RF:
flags = CAR_DOOR_FLAG_RF; flags = CAR_DOOR_FLAG_RF;
break;
case CAR_DOOR_RR: case CAR_DOOR_RR:
flags = CAR_DOOR_FLAG_RR; flags = CAR_DOOR_FLAG_RR;
break;
} }
} }
pPed->m_pMyVehicle->m_nGettingOutFlags &= ~flags; pPed->m_pMyVehicle->m_nGettingOutFlags &= ~flags;
@ -15751,7 +15757,7 @@ INITSAVEBUF
uint32 script_data_size = SCRIPT_DATA_SIZE; uint32 script_data_size = SCRIPT_DATA_SIZE;
WriteSaveBuf(buf, script_data_size); WriteSaveBuf(buf, script_data_size);
WriteSaveBuf(buf, OnAMissionFlag); WriteSaveBuf(buf, OnAMissionFlag);
WriteSaveBuf(buf, NextFreeCollectiveIndex); WriteSaveBuf(buf, LastMissionPassedTime);
for (uint32 i = 0; i < MAX_NUM_BUILDING_SWAPS; i++) { for (uint32 i = 0; i < MAX_NUM_BUILDING_SWAPS; i++) {
CBuilding* pBuilding = BuildingSwapArray[i].m_pBuilding; CBuilding* pBuilding = BuildingSwapArray[i].m_pBuilding;
uint32 type, handle; uint32 type, handle;
@ -15801,12 +15807,12 @@ INITSAVEBUF
WriteSaveBuf(buf, handle); WriteSaveBuf(buf, handle);
} }
WriteSaveBuf(buf, bUsingAMultiScriptFile); WriteSaveBuf(buf, bUsingAMultiScriptFile);
WriteSaveBuf(buf, (uint8)0); WriteSaveBuf(buf, bPlayerHasMetDebbieHarry);
WriteSaveBuf(buf, (uint16)0); WriteSaveBuf(buf, (uint16)0);
WriteSaveBuf(buf, MainScriptSize); WriteSaveBuf(buf, MainScriptSize);
WriteSaveBuf(buf, LargestMissionScriptSize); WriteSaveBuf(buf, LargestMissionScriptSize);
WriteSaveBuf(buf, NumberOfMissionScripts); WriteSaveBuf(buf, NumberOfMissionScripts);
WriteSaveBuf(buf, (uint16)0); WriteSaveBuf(buf, NumberOfExclusiveMissionScripts);
WriteSaveBuf(buf, runningScripts); WriteSaveBuf(buf, runningScripts);
for (CRunningScript* pScript = pActiveScripts; pScript; pScript = pScript->GetNext()) for (CRunningScript* pScript = pActiveScripts; pScript; pScript = pScript->GetNext())
pScript->Save(buf); pScript->Save(buf);
@ -15823,7 +15829,7 @@ INITSAVEBUF
ScriptSpace[i] = ReadSaveBuf<uint8>(buf); ScriptSpace[i] = ReadSaveBuf<uint8>(buf);
script_assert(ReadSaveBuf<uint32>(buf) == SCRIPT_DATA_SIZE); script_assert(ReadSaveBuf<uint32>(buf) == SCRIPT_DATA_SIZE);
OnAMissionFlag = ReadSaveBuf<uint32>(buf); OnAMissionFlag = ReadSaveBuf<uint32>(buf);
NextFreeCollectiveIndex = ReadSaveBuf<uint32>(buf); LastMissionPassedTime = ReadSaveBuf<uint32>(buf);
for (uint32 i = 0; i < MAX_NUM_BUILDING_SWAPS; i++) { for (uint32 i = 0; i < MAX_NUM_BUILDING_SWAPS; i++) {
uint32 type = ReadSaveBuf<uint32>(buf); uint32 type = ReadSaveBuf<uint32>(buf);
uint32 handle = ReadSaveBuf<uint32>(buf); uint32 handle = ReadSaveBuf<uint32>(buf);
@ -15871,12 +15877,12 @@ INITSAVEBUF
InvisibilitySettingArray[i]->bIsVisible = false; InvisibilitySettingArray[i]->bIsVisible = false;
} }
script_assert(ReadSaveBuf<bool>(buf) == bUsingAMultiScriptFile); script_assert(ReadSaveBuf<bool>(buf) == bUsingAMultiScriptFile);
ReadSaveBuf<uint8>(buf); bPlayerHasMetDebbieHarry = ReadSaveBuf<uint8>(buf);
ReadSaveBuf<uint16>(buf); ReadSaveBuf<uint16>(buf);
script_assert(ReadSaveBuf<uint32>(buf) == MainScriptSize); script_assert(ReadSaveBuf<uint32>(buf) == MainScriptSize);
script_assert(ReadSaveBuf<uint32>(buf) == LargestMissionScriptSize); script_assert(ReadSaveBuf<uint32>(buf) == LargestMissionScriptSize);
script_assert(ReadSaveBuf<uint16>(buf) == NumberOfMissionScripts); script_assert(ReadSaveBuf<uint16>(buf) == NumberOfMissionScripts);
ReadSaveBuf<uint16>(buf); script_assert(ReadSaveBuf<uint16>(buf) == NumberOfExclusiveMissionScripts);
uint32 runningScripts = ReadSaveBuf<uint32>(buf); uint32 runningScripts = ReadSaveBuf<uint32>(buf);
for (uint32 i = 0; i < runningScripts; i++) for (uint32 i = 0; i < runningScripts; i++)
StartNewScript(0)->Load(buf); StartNewScript(0)->Load(buf);
@ -16103,7 +16109,7 @@ void CTheScripts::CleanUpThisObject(CObject* pObject)
if (pObject->ObjectCreatedBy != MISSION_OBJECT) if (pObject->ObjectCreatedBy != MISSION_OBJECT)
return; return;
pObject->ObjectCreatedBy = TEMP_OBJECT; pObject->ObjectCreatedBy = TEMP_OBJECT;
pObject->m_nEndOfLifeTime = CTimer::GetTimeInMilliseconds() + 20000; pObject->m_nEndOfLifeTime = CTimer::GetTimeInMilliseconds() + 20000000;
pObject->m_nRefModelIndex = -1; pObject->m_nRefModelIndex = -1;
pObject->bUseVehicleColours = false; pObject->bUseVehicleColours = false;
++CObject::nNoTempObjects; ++CObject::nNoTempObjects;

View file

@ -21440,3 +21440,17 @@ CPed::SetLook(float direction)
SetLookFlag(direction, false); SetLookFlag(direction, false);
} }
} }
// --MIAMI: Done
// Unused
void CPed::PedSetGetInCarPositionCB(CAnimBlendAssociation* assoc, void* arg)
{
CPed* pPed = (CPed*)arg;
CMatrix mat(pPed->GetMatrix());
CVehicle* pVehicle = pPed->m_pMyVehicle;
const CVector& offset = (pVehicle->bIsVan && (pPed->m_vehEnterType == CAR_DOOR_RR || pPed->m_vehEnterType == CAR_DOOR_LR)) ? vecPedVanRearDoorAnimOffset : vecPedCarDoorAnimOffset;
CVector position = Multiply3x3(mat, offset) + pPed->GetPosition();
CPedPlacement::FindZCoorForPed(&position);
pPed->SetMoveSpeed(0.0f, 0.0f, 0.0f);
pPed->SetPosition(position);
}

View file

@ -911,6 +911,7 @@ public:
static void DeleteSunbatheIdleAnimCB(CAnimBlendAssociation *assoc, void *arg); static void DeleteSunbatheIdleAnimCB(CAnimBlendAssociation *assoc, void *arg);
static void PedSetPreviousStateCB(CAnimBlendAssociation *assoc, void *arg); static void PedSetPreviousStateCB(CAnimBlendAssociation *assoc, void *arg);
static void PedAnimShuffleCB(CAnimBlendAssociation *assoc, void *arg); static void PedAnimShuffleCB(CAnimBlendAssociation *assoc, void *arg);
static void PedSetGetInCarPositionCB(CAnimBlendAssociation* assoc, void* arg);
bool IsPlayer(void); bool IsPlayer(void);
bool IsFemale(void) { return m_nPedType == PEDTYPE_CIVFEMALE || m_nPedType == PEDTYPE_PROSTITUTE; } bool IsFemale(void) { return m_nPedType == PEDTYPE_CIVFEMALE || m_nPedType == PEDTYPE_PROSTITUTE; }

View file

@ -418,7 +418,7 @@ void CMovingThings::Init()
} }
CEscalators::Init(); CEscalators::Init();
aScrollBars[0].Init(CVector(-1069.209f, 1320.126f, 18.848f), CVector(-1069.209f, 1342.299f, 22.612), SCROLL_ARENA_STRING, 128, 255, 0, 0.3f); aScrollBars[0].Init(CVector(-1069.209f, 1320.126f, 18.848f), CVector(-1069.209f, 1342.299f, 22.612f), SCROLL_ARENA_STRING, 128, 255, 0, 0.3f);
} }
void CMovingThings::Shutdown() void CMovingThings::Shutdown()