mirror of
https://github.com/halpz/re3.git
synced 2025-07-14 01:48:10 +00:00
Merge branch 'miami' into miami
This commit is contained in:
@ -4247,7 +4247,7 @@ CCam::GetLookFromLampPostPos(CEntity *Target, CPed *Cop, CVector &TargetCoors, C
|
||||
CWorld::FindObjectsInRange(TargetCoors, 30.0f, true, &NumObjects, 15, Objects, false, false, false, true, true);
|
||||
float NearestDist = 10000.0f;
|
||||
for(i = 0; i < NumObjects; i++){
|
||||
if(Objects[i]->IsStatic() && Objects[i]->GetUp().z > 0.9f && IsLampPost(Objects[i]->GetModelIndex())){
|
||||
if(Objects[i]->GetIsStatic() && Objects[i]->GetUp().z > 0.9f && IsLampPost(Objects[i]->GetModelIndex())){
|
||||
float Dist = (Objects[i]->GetPosition() - TargetCoors).Magnitude2D();
|
||||
if(Abs(ARRESTCAM_LAMP_BEST_DIST - Dist) < NearestDist){
|
||||
CVector TestStart = Objects[i]->GetColModel()->boundingBox.max;
|
||||
|
@ -240,9 +240,8 @@ CdStreamRead(int32 channel, void *buffer, uint32 offset, uint32 size)
|
||||
CdReadInfo *pChannel = &gpReadInfo[channel];
|
||||
ASSERT( pChannel != nil );
|
||||
|
||||
|
||||
if ( pChannel->nSectorsToRead != 0 || pChannel->bReading ) {
|
||||
if (pChannel->nSectorOffset == _GET_OFFSET(offset) && pChannel->nSectorsToRead >= size)
|
||||
if (pChannel->hFile == hImage - 1 && pChannel->nSectorOffset == _GET_OFFSET(offset) && pChannel->nSectorsToRead >= size)
|
||||
return STREAM_SUCCESS;
|
||||
|
||||
flushStream[channel] = 1;
|
||||
@ -293,7 +292,6 @@ CdStreamGetStatus(int32 channel)
|
||||
if ( pChannel->nStatus != STREAM_NONE )
|
||||
{
|
||||
int32 status = pChannel->nStatus;
|
||||
|
||||
pChannel->nStatus = STREAM_NONE;
|
||||
|
||||
return status;
|
||||
@ -322,15 +320,16 @@ CdStreamSync(int32 channel)
|
||||
pthread_kill(pChannel->pChannelThread, SIGUSR1);
|
||||
if (pChannel->bReading) {
|
||||
pChannel->bLocked = true;
|
||||
sem_wait(pChannel->pDoneSemaphore);
|
||||
while (pChannel->bLocked)
|
||||
sem_wait(pChannel->pDoneSemaphore);
|
||||
}
|
||||
#else
|
||||
pChannel->nSectorsToRead = 0;
|
||||
if (pChannel->bReading) {
|
||||
pChannel->bLocked = true;
|
||||
pthread_kill(_gCdStreamThread, SIGUSR1);
|
||||
sem_wait(pChannel->pDoneSemaphore);
|
||||
|
||||
while (pChannel->bLocked)
|
||||
sem_wait(pChannel->pDoneSemaphore);
|
||||
}
|
||||
#endif
|
||||
pChannel->bReading = false;
|
||||
@ -341,8 +340,8 @@ CdStreamSync(int32 channel)
|
||||
if ( pChannel->nSectorsToRead != 0 )
|
||||
{
|
||||
pChannel->bLocked = true;
|
||||
|
||||
sem_wait(pChannel->pDoneSemaphore);
|
||||
while (pChannel->bLocked)
|
||||
sem_wait(pChannel->pDoneSemaphore);
|
||||
}
|
||||
|
||||
pChannel->bReading = false;
|
||||
@ -443,9 +442,9 @@ void *CdStreamThread(void *param)
|
||||
#endif
|
||||
|
||||
pChannel->nSectorsToRead = 0;
|
||||
|
||||
if ( pChannel->bLocked )
|
||||
{
|
||||
pChannel->bLocked = 0;
|
||||
sem_post(pChannel->pDoneSemaphore);
|
||||
}
|
||||
pChannel->bReading = false;
|
||||
|
@ -406,8 +406,8 @@ CFireManager::ExtinguishPointWithWater(CVector point, float range)
|
||||
CFire *fireToExtinguish = &m_aFires[fireI];
|
||||
fireToExtinguish->m_fWaterExtinguishCountdown -= 0.012f * CTimer::GetTimeStep();
|
||||
CVector steamPos = fireToExtinguish->m_vecPos +
|
||||
CVector((CGeneral::GetRandomNumber() - 128) * 31.f / 200.f,
|
||||
(CGeneral::GetRandomNumber() - 128) * 31.f / 200.f,
|
||||
CVector((CGeneral::GetRandomNumber() - 128) * 3.1f / 200.f,
|
||||
(CGeneral::GetRandomNumber() - 128) * 3.1f / 200.f,
|
||||
CGeneral::GetRandomNumber() / 200.f);
|
||||
|
||||
CParticle::AddParticle(PARTICLE_STEAM_NY_SLOWMOTION, steamPos, CVector(0.f, 0.f, 0.2f), nil, 0.5f);
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "Messages.h"
|
||||
#include "FileLoader.h"
|
||||
#include "User.h"
|
||||
#include "sampman.h"
|
||||
|
||||
// TODO(Miami): Remove that!! That was my map implementation for III, instead use MAP_ENHACEMENTS on some places
|
||||
#define CUSTOM_MAP
|
||||
@ -376,8 +377,7 @@ CMenuManager::CMenuManager()
|
||||
m_bShowMouse = true;
|
||||
m_nHoverOption = HOVEROPTION_NOT_HOVERING;
|
||||
|
||||
// TODO(Miami)
|
||||
// DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume);
|
||||
DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume);
|
||||
m_bMenuActive = false;
|
||||
m_bActivateSaveMenu = false;
|
||||
m_bWantToLoad = false;
|
||||
@ -426,9 +426,7 @@ CMenuManager::Initialise(void)
|
||||
DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume);
|
||||
DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
|
||||
m_PrefsRadioStation = DMAudio.GetRadioInCar();
|
||||
|
||||
// TODO(Miami)
|
||||
// DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume);
|
||||
DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume);
|
||||
if (DMAudio.IsMP3RadioChannelAvailable()) {
|
||||
if (m_PrefsRadioStation < WILDSTYLE || m_PrefsRadioStation > USERTRACK)
|
||||
m_PrefsRadioStation = CGeneral::GetRandomNumber() % 10;
|
||||
@ -570,6 +568,7 @@ CMenuManager::CheckHover(int x1, int x2, int y1, int y2)
|
||||
m_nMousePosY > y1 && m_nMousePosY < y2;
|
||||
}
|
||||
|
||||
// --MIAMI: Done
|
||||
void
|
||||
CMenuManager::CheckSliderMovement(int value)
|
||||
{
|
||||
@ -587,14 +586,27 @@ CMenuManager::CheckSliderMovement(int value)
|
||||
CRenderer::ms_lodDistScale = m_PrefsLOD;
|
||||
break;
|
||||
case MENUACTION_MUSICVOLUME:
|
||||
m_PrefsMusicVolume += value * (128/32);
|
||||
m_PrefsMusicVolume = clamp(m_PrefsMusicVolume, 0, 65);
|
||||
DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume);
|
||||
if (m_nPrefsAudio3DProviderIndex != NO_AUDIO_PROVIDER) {
|
||||
m_PrefsMusicVolume += value * (128 / 32);
|
||||
m_PrefsMusicVolume = clamp(m_PrefsMusicVolume, 0, 65);
|
||||
DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume);
|
||||
}
|
||||
break;
|
||||
case MENUACTION_SFXVOLUME:
|
||||
m_PrefsSfxVolume += value * (128/32);
|
||||
m_PrefsSfxVolume = clamp(m_PrefsSfxVolume, 0, 65);
|
||||
DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
|
||||
if (m_nPrefsAudio3DProviderIndex != NO_AUDIO_PROVIDER) {
|
||||
m_PrefsSfxVolume += value * (128 / 32);
|
||||
m_PrefsSfxVolume = clamp(m_PrefsSfxVolume, 0, 65);
|
||||
DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
|
||||
}
|
||||
break;
|
||||
case MENUACTION_MP3VOLUMEBOOST:
|
||||
if (m_nPrefsAudio3DProviderIndex != NO_AUDIO_PROVIDER) {
|
||||
if (DMAudio.IsMP3RadioChannelAvailable()) {
|
||||
m_PrefsMP3BoostVolume += value * (128 / 32);
|
||||
m_PrefsMP3BoostVolume = clamp(m_PrefsMP3BoostVolume, 0, 65);
|
||||
DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MENUACTION_MOUSESENS:
|
||||
TheCamera.m_fMouseAccelHorzntl += value * 1.0f/200.0f/15.0f; // ???
|
||||
@ -1065,20 +1077,17 @@ CMenuManager::DrawStandardMenus(bool activeScreen)
|
||||
else if (m_nPrefsAudio3DProviderIndex == -1)
|
||||
rightText = TheText.Get("FEA_ADP");
|
||||
else {
|
||||
char* provider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex);
|
||||
if (provider != NULL) {
|
||||
if (!strcmp(strupr(provider), "DIRECTSOUND3D HARDWARE SUPPORT")) {
|
||||
strcpy(provider, "DSOUND3D HARDWARE SUPPORT");
|
||||
}
|
||||
else if (!strcmp(strupr(provider), "DIRECTSOUND3D SOFTWARE EMULATION")) {
|
||||
strcpy(provider, "DSOUND3D SOFTWARE EMULATION");
|
||||
}
|
||||
AsciiToUnicode(provider, unicodeTemp);
|
||||
rightText = unicodeTemp;
|
||||
}
|
||||
else {
|
||||
rightText = TheText.Get("not defined");
|
||||
char *rawProvider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex);
|
||||
AsciiToUnicode(rawProvider, unicodeTemp);
|
||||
char *provider = UnicodeToAscii(unicodeTemp); // genius
|
||||
strupr(provider);
|
||||
if (!strcmp(provider, "DIRECTSOUND3D HARDWARE SUPPORT")) {
|
||||
strcpy(provider, "DSOUND3D HARDWARE SUPPORT");
|
||||
} else if (!strcmp(provider, "DIRECTSOUND3D SOFTWARE EMULATION")) {
|
||||
strcpy(provider, "DSOUND3D SOFTWARE EMULATION");
|
||||
}
|
||||
AsciiToUnicode(provider, unicodeTemp);
|
||||
rightText = unicodeTemp;
|
||||
}
|
||||
break;
|
||||
case MENUACTION_SPEAKERCONF: {
|
||||
@ -4007,6 +4016,7 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
|
||||
if (selectedProvider != NO_AUDIO_PROVIDER) {
|
||||
if (selectedProvider == -1)
|
||||
selectedProvider = m_nPrefsAudio3DProviderIndex = DMAudio.AutoDetect3DProviders();
|
||||
|
||||
m_nPrefsAudio3DProviderIndex = DMAudio.SetCurrent3DProvider(m_nPrefsAudio3DProviderIndex);
|
||||
if (selectedProvider != m_nPrefsAudio3DProviderIndex) {
|
||||
SetHelperText(5);
|
||||
@ -4039,7 +4049,7 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
|
||||
m_PrefsMP3BoostVolume = 0;
|
||||
m_PrefsStereoMono = 1;
|
||||
m_PrefsSpeakers = 0;
|
||||
// DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume); // TODO(Miami)
|
||||
DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume);
|
||||
DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume);
|
||||
DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
|
||||
DMAudio.SetRadioInCar(m_PrefsRadioStation);
|
||||
@ -4180,11 +4190,36 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
|
||||
break;
|
||||
#endif
|
||||
case MENUACTION_AUDIOHW:
|
||||
// TODO(Miami): What are the extra things in here??
|
||||
|
||||
if (m_nPrefsAudio3DProviderIndex != NO_AUDIO_PROVIDER) {
|
||||
m_nPrefsAudio3DProviderIndex += changeAmount;
|
||||
m_nPrefsAudio3DProviderIndex = clamp(m_nPrefsAudio3DProviderIndex, 0, DMAudio.GetNum3DProvidersAvailable() - 1);
|
||||
|
||||
bool checkIfForbidden = true;
|
||||
while (checkIfForbidden) {
|
||||
checkIfForbidden = false;
|
||||
|
||||
if (m_nPrefsAudio3DProviderIndex < -1)
|
||||
m_nPrefsAudio3DProviderIndex = DMAudio.GetNum3DProvidersAvailable() - 1;
|
||||
else if (m_nPrefsAudio3DProviderIndex > DMAudio.GetNum3DProvidersAvailable() - 1)
|
||||
m_nPrefsAudio3DProviderIndex = -1;
|
||||
|
||||
// what a retarded move...
|
||||
if (m_nPrefsAudio3DProviderIndex != -1) {
|
||||
char* provider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex);
|
||||
strupr(provider);
|
||||
if (!strcmp(provider, "MILES FAST 2D POSITIONAL AUDIO")) {
|
||||
m_nPrefsAudio3DProviderIndex += changeAmount;
|
||||
checkIfForbidden = true;
|
||||
|
||||
} else if (!strcmp(provider, "AUREAL A3D 2.0 (TM)")) {
|
||||
m_nPrefsAudio3DProviderIndex += changeAmount;
|
||||
checkIfForbidden = true;
|
||||
|
||||
} else if (!strcmp(provider, "AUREAL A3D INTERACTIVE (TM)")) {
|
||||
m_nPrefsAudio3DProviderIndex += changeAmount;
|
||||
checkIfForbidden = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MENUACTION_SPEAKERCONF:
|
||||
@ -4543,19 +4578,13 @@ CMenuManager::UnloadTextures()
|
||||
CUserDisplay::PlaceName.ProcessAfterFrontEndShutDown();
|
||||
}
|
||||
|
||||
// --MIAMI: Done
|
||||
void
|
||||
CMenuManager::WaitForUserCD()
|
||||
{
|
||||
CSprite2d *splash;
|
||||
char *splashscreen = nil;
|
||||
|
||||
#if (!(defined RANDOMSPLASH) && !(defined GTA3_1_1_PATCH))
|
||||
if (CGame::frenchGame || CGame::germanGame || !CGame::nastyGame)
|
||||
splashscreen = "mainsc2";
|
||||
else
|
||||
splashscreen = "mainsc1";
|
||||
#endif
|
||||
|
||||
splash = LoadSplash(splashscreen);
|
||||
|
||||
if (RsGlobal.quit)
|
||||
@ -4707,6 +4736,53 @@ CMenuManager::PrintMap(void)
|
||||
}
|
||||
|
||||
CRadar::DrawBlips();
|
||||
if (m_PrefsShowLegends) {
|
||||
CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(40.0f));
|
||||
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(84.0f));
|
||||
CFont::SetBackGroundOnlyTextOff();
|
||||
CFont::SetColor(CRGBA(255, 150, 225, FadeIn(255)));
|
||||
CFont::SetDropShadowPosition(2);
|
||||
CFont::SetDropColor(CRGBA(0, 0, 0, FadeIn(255)));
|
||||
CFont::SetCentreOn();
|
||||
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
|
||||
CFont::SetScale(SCREEN_SCALE_X(0.65f), SCREEN_SCALE_Y(0.95f));
|
||||
|
||||
int secondColumnStart = (CRadar::MapLegendCounter - 1) / 2;
|
||||
int boxBottom = MENU_Y(100.0f);
|
||||
|
||||
// + 3, because we want 19*3 px padding
|
||||
for (int i = 0; i < secondColumnStart + 3; i++) {
|
||||
boxBottom += MENU_Y(19.f);
|
||||
}
|
||||
|
||||
CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(95.0f), MENU_Y(100.0f), MENU_X_LEFT_ALIGNED(555.f), boxBottom),
|
||||
CRGBA(0, 0, 0, FadeIn(190)));
|
||||
|
||||
CFont::PrintString(MENU_X_LEFT_ALIGNED(320.0f), MENU_Y(102.0f), TheText.Get("FE_MLG"));
|
||||
CFont::SetRightJustifyOff();
|
||||
CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
|
||||
if (m_PrefsLanguage == LANGUAGE_AMERICAN)
|
||||
CFont::SetScale(SCREEN_SCALE_X(0.55f), SCREEN_SCALE_Y(0.55f));
|
||||
else
|
||||
CFont::SetScale(SCREEN_SCALE_X(0.45f), SCREEN_SCALE_Y(0.55f));
|
||||
|
||||
CFont::SetColor(CRGBA(225, 225, 225, FadeIn(255)));
|
||||
CFont::SetDropShadowPosition(0);
|
||||
|
||||
int y = MENU_Y(127.0f);
|
||||
int x = MENU_X_LEFT_ALIGNED(160.0f);
|
||||
|
||||
for (int16 i = 0; i < CRadar::MapLegendCounter; i++) {
|
||||
CRadar::DrawLegend(x, y, CRadar::MapLegendList[i]);
|
||||
|
||||
if (i == secondColumnStart) {
|
||||
x = MENU_X_LEFT_ALIGNED(350.0f);
|
||||
y = MENU_Y(127.0f);
|
||||
} else {
|
||||
y += MENU_Y(19.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CUSTOM_MAP
|
||||
CVector2D mapPoint;
|
||||
@ -4785,7 +4861,7 @@ CMenuManager::PrintMap(void)
|
||||
#endif
|
||||
m_bMenuMapActive = false;
|
||||
|
||||
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(5.0f));
|
||||
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(10.0f));
|
||||
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(10.0f));
|
||||
DisplayHelperText("FEH_MPH");
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include "Pools.h"
|
||||
|
||||
#include "Bike.h"
|
||||
#include "Boat.h"
|
||||
#include "CarCtrl.h"
|
||||
#ifdef MISSION_REPLAY
|
||||
@ -13,6 +14,8 @@
|
||||
#include "Wanted.h"
|
||||
#include "World.h"
|
||||
|
||||
//--MIAMI: file done
|
||||
|
||||
CCPtrNodePool *CPools::ms_pPtrNodePool;
|
||||
CEntryInfoNodePool *CPools::ms_pEntryInfoNodePool;
|
||||
CPedPool *CPools::ms_pPedPool;
|
||||
@ -24,7 +27,6 @@ CDummyPool *CPools::ms_pDummyPool;
|
||||
CAudioScriptObjectPool *CPools::ms_pAudioScriptObjectPool;
|
||||
CColModelPool *CPools::ms_pColModelPool;
|
||||
|
||||
//--MIAMI: done
|
||||
void
|
||||
CPools::Initialise(void)
|
||||
{
|
||||
@ -40,7 +42,6 @@ CPools::Initialise(void)
|
||||
ms_pColModelPool = new CColModelPool(NUMCOLMODELS, "ColModel");
|
||||
}
|
||||
|
||||
//--MIAMI: done
|
||||
void
|
||||
CPools::ShutDown(void)
|
||||
{
|
||||
@ -119,7 +120,8 @@ void CPools::LoadVehiclePool(uint8* buf, uint32 size)
|
||||
INITSAVEBUF
|
||||
int nNumCars = ReadSaveBuf<int>(buf);
|
||||
int nNumBoats = ReadSaveBuf<int>(buf);
|
||||
for (int i = 0; i < nNumCars + nNumBoats; i++) {
|
||||
int nNumBikes = ReadSaveBuf<int>(buf);
|
||||
for (int i = 0; i < nNumCars + nNumBoats + nNumBikes; i++) {
|
||||
uint32 type = ReadSaveBuf<uint32>(buf);
|
||||
int16 model = ReadSaveBuf<int16>(buf);
|
||||
CStreaming::RequestModel(model, STREAMFLAGS_DEPENDENCY);
|
||||
@ -131,13 +133,15 @@ INITSAVEBUF
|
||||
pVehicle = new(slot) CBoat(model, RANDOM_VEHICLE);
|
||||
else if (type == VEHICLE_TYPE_CAR)
|
||||
pVehicle = new(slot) CAutomobile(model, RANDOM_VEHICLE);
|
||||
else if (type == VEHICLE_TYPE_BIKE)
|
||||
pVehicle = new(slot) CBike(model, RANDOM_VEHICLE);
|
||||
else
|
||||
assert(0);
|
||||
--CCarCtrl::NumRandomCars;
|
||||
pVehicle->Load(buf);
|
||||
CWorld::Add(pVehicle);
|
||||
#else
|
||||
char* vbuf = new char[Max(CAutomobile::nSaveStructSize, CBoat::nSaveStructSize)];
|
||||
char* vbuf = new char[Max(CBike::nSaveStructSize, Max(CAutomobile::nSaveStructSize, CBoat::nSaveStructSize))];
|
||||
if (type == VEHICLE_TYPE_BOAT) {
|
||||
memcpy(vbuf, buf, sizeof(CBoat));
|
||||
SkipSaveBuf(buf, sizeof(CBoat));
|
||||
@ -156,6 +160,17 @@ INITSAVEBUF
|
||||
pAutomobile->Damage = ((CAutomobile*)vbuf)->Damage;
|
||||
pAutomobile->SetupDamageAfterLoad();
|
||||
}
|
||||
else if (type == VEHICLE_TYPE_BIKE) {
|
||||
#ifdef FIX_BUGS
|
||||
memcpy(vbuf, buf, sizeof(CBike));
|
||||
#else
|
||||
memcpy(vbuf, buf, sizeof(CAutomobile));
|
||||
#endif
|
||||
SkipSaveBuf(buf, sizeof(CBike));
|
||||
CBike* pBike = new(slot) CBike(model, RANDOM_VEHICLE);
|
||||
pVehicle = pBike;
|
||||
--CCarCtrl::NumRandomCars;
|
||||
}
|
||||
else
|
||||
assert(0);
|
||||
CVehicle* pBufferVehicle = (CVehicle*)vbuf;
|
||||
@ -193,6 +208,7 @@ INITSAVEBUF
|
||||
(pVehicle->GetAddressOfEntityProperties())[0] = (pBufferVehicle->GetAddressOfEntityProperties())[0];
|
||||
(pVehicle->GetAddressOfEntityProperties())[1] = (pBufferVehicle->GetAddressOfEntityProperties())[1];
|
||||
pVehicle->AutoPilot = pBufferVehicle->AutoPilot;
|
||||
CCarCtrl::UpdateCarCount(pVehicle, false);
|
||||
CWorld::Add(pVehicle);
|
||||
delete[] vbuf;
|
||||
#endif
|
||||
@ -205,6 +221,7 @@ void CPools::SaveVehiclePool(uint8* buf, uint32* size)
|
||||
INITSAVEBUF
|
||||
int nNumCars = 0;
|
||||
int nNumBoats = 0;
|
||||
int nNumBikes = 0;
|
||||
int nPoolSize = GetVehiclePool()->GetSize();
|
||||
for (int i = 0; i < nPoolSize; i++) {
|
||||
CVehicle* pVehicle = GetVehiclePool()->GetSlot(i);
|
||||
@ -226,19 +243,25 @@ INITSAVEBUF
|
||||
++nNumCars;
|
||||
if (pVehicle->IsBoat() && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving))
|
||||
++nNumBoats;
|
||||
if (pVehicle->IsBike() && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving))
|
||||
++nNumBoats;
|
||||
#else
|
||||
if (!pVehicle->pDriver && !bHasPassenger) {
|
||||
if (pVehicle->IsCar() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE)
|
||||
++nNumCars;
|
||||
if (pVehicle->IsBoat() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE)
|
||||
++nNumBoats;
|
||||
if (pVehicle->IsBike() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE)
|
||||
++nNumBoats;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
*size = nNumCars * (sizeof(uint32) + sizeof(int16) + sizeof(int32) + CAutomobile::nSaveStructSize) + sizeof(int) +
|
||||
nNumBoats * (sizeof(uint32) + sizeof(int16) + sizeof(int32) + CBoat::nSaveStructSize) + sizeof(int);
|
||||
nNumBoats * (sizeof(uint32) + sizeof(int16) + sizeof(int32) + CBoat::nSaveStructSize) + sizeof(int) +
|
||||
nNumBikes * (sizeof(uint32) + sizeof(int16) + sizeof(int32) + CBike::nSaveStructSize) + sizeof(int);
|
||||
WriteSaveBuf(buf, nNumCars);
|
||||
WriteSaveBuf(buf, nNumBoats);
|
||||
WriteSaveBuf(buf, nNumBikes);
|
||||
for (int i = 0; i < nPoolSize; i++) {
|
||||
CVehicle* pVehicle = GetVehiclePool()->GetSlot(i);
|
||||
if (!pVehicle)
|
||||
@ -258,9 +281,9 @@ INITSAVEBUF
|
||||
#endif
|
||||
#ifdef COMPATIBLE_SAVES
|
||||
#ifdef MISSION_REPLAY
|
||||
if ((pVehicle->IsCar() || pVehicle->IsBoat()) && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving)) {
|
||||
if ((pVehicle->IsCar() || pVehicle->IsBoat() || pVehicle->IsBike()) && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving)) {
|
||||
#else
|
||||
if ((pVehicle->IsCar() || pVehicle->IsBoat()) && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) {
|
||||
if ((pVehicle->IsCar() || pVehicle->IsBoat() || pVehicle->IsBike()) && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) {
|
||||
#endif
|
||||
WriteSaveBuf<uint32>(buf, pVehicle->m_vehType);
|
||||
WriteSaveBuf<int16>(buf, pVehicle->GetModelIndex());
|
||||
@ -290,6 +313,17 @@ INITSAVEBUF
|
||||
memcpy(buf, pVehicle, sizeof(CBoat));
|
||||
SkipSaveBuf(buf, sizeof(CBoat));
|
||||
}
|
||||
#ifdef MISSION_REPLAY
|
||||
if (pVehicle->IsBike() && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving)) {
|
||||
#else
|
||||
if (pVehicle->IsBike() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) {
|
||||
#endif
|
||||
WriteSaveBuf(buf, (uint32)pVehicle->m_vehType);
|
||||
WriteSaveBuf(buf, pVehicle->GetModelIndex());
|
||||
WriteSaveBuf(buf, GetVehicleRef(pVehicle));
|
||||
memcpy(buf, pVehicle, sizeof(CBike));
|
||||
SkipSaveBuf(buf, sizeof(CBike));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -311,8 +345,9 @@ INITSAVEBUF
|
||||
++nObjects;
|
||||
}
|
||||
*size = nObjects * (sizeof(int16) + sizeof(int) + sizeof(CCompressedMatrix) +
|
||||
sizeof(float) + sizeof(CCompressedMatrix) + sizeof(int8) + 7 * sizeof(bool) + sizeof(float) +
|
||||
sizeof(int8) + sizeof(int8) + sizeof(uint32) + 2 * sizeof(uint32)) + sizeof(int);
|
||||
sizeof(float) + sizeof(CCompressedMatrix) + sizeof(int8) + 7 * sizeof(bool) + sizeof(int16) +
|
||||
+ sizeof(int8) * 2 + sizeof(float) + sizeof(int8) + sizeof(int8) +
|
||||
sizeof(uint32) + 2 * sizeof(uint32)) + sizeof(int);
|
||||
CopyToBuf(buf, nObjects);
|
||||
for (int i = 0; i < nPoolSize; i++) {
|
||||
CObject* pObject = GetObjectPool()->GetSlot(i);
|
||||
@ -343,6 +378,9 @@ INITSAVEBUF
|
||||
CopyToBuf(buf, bGlassBroken);
|
||||
CopyToBuf(buf, bHasBeenDamaged);
|
||||
CopyToBuf(buf, bUseVehicleColours);
|
||||
CopyToBuf(buf, pObject->m_nCostValue);
|
||||
CopyToBuf(buf, pObject->m_nBonusValue);
|
||||
SkipSaveBuf(buf, 1);
|
||||
CopyToBuf(buf, pObject->m_fCollisionDamageMultiplier);
|
||||
CopyToBuf(buf, pObject->m_nCollisionDamageEffect);
|
||||
CopyToBuf(buf, pObject->m_nSpecialCollisionResponseCases);
|
||||
@ -392,6 +430,9 @@ INITSAVEBUF
|
||||
pBufferObject->bHasBeenDamaged = bitFlag;
|
||||
CopyFromBuf(buf, bitFlag);
|
||||
pBufferObject->bUseVehicleColours = bitFlag;
|
||||
CopyFromBuf(buf, pBufferObject->m_nCostValue);
|
||||
CopyFromBuf(buf, pBufferObject->m_nBonusValue);
|
||||
SkipSaveBuf(buf, 1);
|
||||
CopyFromBuf(buf, pBufferObject->m_fCollisionDamageMultiplier);
|
||||
CopyFromBuf(buf, pBufferObject->m_nCollisionDamageEffect);
|
||||
CopyFromBuf(buf, pBufferObject->m_nSpecialCollisionResponseCases);
|
||||
@ -426,6 +467,8 @@ INITSAVEBUF
|
||||
(pObject->GetAddressOfEntityProperties())[1] = (pBufferObject->GetAddressOfEntityProperties())[1];
|
||||
#endif
|
||||
pObject->bHasCollided = false;
|
||||
pObject->m_nCostValue = pBufferObject->m_nCostValue;
|
||||
pObject->m_nBonusValue = pBufferObject->m_nBonusValue;
|
||||
CWorld::Add(pObject);
|
||||
delete[] obuf;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -96,6 +96,17 @@ enum eRadarSprite
|
||||
RADAR_SPRITE_COUNT
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
RADAR_TRACE_RED,
|
||||
RADAR_TRACE_GREEN,
|
||||
RADAR_TRACE_LIGHT_BLUE,
|
||||
RADAR_TRACE_GRAY,
|
||||
RADAR_TRACE_YELLOW,
|
||||
RADAR_TRACE_MAGENTA,
|
||||
RADAR_TRACE_CYAN
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
BLIP_MODE_TRIANGULAR_UP = 0,
|
||||
@ -108,17 +119,39 @@ struct sRadarTrace
|
||||
uint32 m_nColor;
|
||||
uint32 m_eBlipType; // eBlipType
|
||||
int32 m_nEntityHandle;
|
||||
CVector m_vec2DPos;
|
||||
CVector m_vecPos;
|
||||
uint16 m_BlipIndex;
|
||||
bool m_bDim;
|
||||
bool m_bInUse;
|
||||
bool m_bShortRange;
|
||||
bool m_unused;
|
||||
float m_Radius;
|
||||
int16 m_wScale;
|
||||
uint16 m_eBlipDisplay; // eBlipDisplay
|
||||
uint16 m_eRadarSprite; // eRadarSprite
|
||||
};
|
||||
|
||||
// Either that was a thing while saving/loading blips, or they added sizes of each field one by one. I want to do the former.
|
||||
#pragma pack(push,1)
|
||||
struct sRadarTraceSave
|
||||
{
|
||||
uint32 m_nColor;
|
||||
float m_Radius;
|
||||
uint32 m_eBlipType; // eBlipType
|
||||
int32 m_nEntityHandle;
|
||||
CVector2D m_vec2DPos;
|
||||
CVector m_vecPos;
|
||||
uint16 m_BlipIndex;
|
||||
bool m_bDim;
|
||||
bool m_bInUse;
|
||||
bool m_bShortRange;
|
||||
float m_Radius;
|
||||
bool m_unused;
|
||||
int16 m_wScale;
|
||||
uint16 m_eBlipDisplay; // eBlipDisplay
|
||||
uint16 m_eRadarSprite; // eRadarSprite
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
// Values for screen space
|
||||
#define RADAR_LEFT (40.0f)
|
||||
@ -176,7 +209,7 @@ public:
|
||||
static CRGBA ArrowBlipColour1;
|
||||
static CRGBA ArrowBlipColour2;
|
||||
static int16 MapLegendList[NUM_MAP_LEGENDS];
|
||||
static uint16 MapLegendCounter;
|
||||
static int16 MapLegendCounter;
|
||||
|
||||
#ifdef MAP_ENHANCEMENTS
|
||||
static int TargetMarkerId;
|
||||
@ -215,9 +248,9 @@ public:
|
||||
static void RemoveRadarSections();
|
||||
static void SaveAllRadarBlips(uint8*, uint32*);
|
||||
static void SetBlipSprite(int32 i, int32 icon);
|
||||
static int32 SetCoordBlip(eBlipType type, CVector pos, int32, eBlipDisplay);
|
||||
static int32 SetEntityBlip(eBlipType type, int32, int32, eBlipDisplay);
|
||||
static int32 SetShortRangeCoordBlip(eBlipType type, CVector pos, int32, eBlipDisplay);
|
||||
static int32 SetCoordBlip(eBlipType type, CVector pos, uint32, eBlipDisplay);
|
||||
static int32 SetEntityBlip(eBlipType type, int32, uint32, eBlipDisplay);
|
||||
static int32 SetShortRangeCoordBlip(eBlipType type, CVector pos, uint32, eBlipDisplay);
|
||||
static void SetRadarMarkerState(int32 i, bool flag);
|
||||
static void ShowRadarMarker(CVector pos, uint32 color, float radius);
|
||||
static void ShowRadarTrace(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha);
|
||||
@ -229,7 +262,8 @@ public:
|
||||
static void TransformRadarPointToRealWorldSpace(CVector2D &out, const CVector2D &in);
|
||||
static void TransformRadarPointToScreenSpace(CVector2D &out, const CVector2D &in);
|
||||
static void TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D &in);
|
||||
|
||||
// no in CRadar in the game:
|
||||
static void CalculateCachedSinCos();
|
||||
static void DrawEntityBlip(int32 blipId);
|
||||
static void DrawCoordBlip(int32 blipId);
|
||||
static void DrawLegend(int32, int32, int32);
|
||||
};
|
||||
|
@ -903,7 +903,7 @@ CStreaming::RequestSpecialModel(int32 modelId, const char *modelName, int32 flag
|
||||
int i, n;
|
||||
|
||||
mi = CModelInfo::GetModelInfo(modelId);
|
||||
if(!CGeneral::faststrcmp("CSPlay", modelName)){
|
||||
if(strncasecmp("CSPlay", modelName, 6) == 0){
|
||||
char *curname = CModelInfo::GetModelInfo(MI_PLAYER)->GetName();
|
||||
for(int i = 0; CSnames[i][0]; i++){
|
||||
if(strcasecmp(curname, IGnames[i]) == 0){
|
||||
|
@ -79,7 +79,7 @@ CWorld::Add(CEntity *ent)
|
||||
|
||||
if(ent->IsBuilding() || ent->IsDummy()) return;
|
||||
|
||||
if(!ent->IsStatic()) ((CPhysical *)ent)->AddToMovingList();
|
||||
if(!ent->GetIsStatic()) ((CPhysical *)ent)->AddToMovingList();
|
||||
}
|
||||
|
||||
void
|
||||
@ -94,7 +94,7 @@ CWorld::Remove(CEntity *ent)
|
||||
|
||||
if(ent->IsBuilding() || ent->IsDummy()) return;
|
||||
|
||||
if(!ent->IsStatic()) ((CPhysical *)ent)->RemoveFromMovingList();
|
||||
if(!ent->GetIsStatic()) ((CPhysical *)ent)->RemoveFromMovingList();
|
||||
}
|
||||
|
||||
void
|
||||
@ -1962,7 +1962,7 @@ CWorld::Process(void)
|
||||
RemoveEntityInsteadOfProcessingIt(movingEnt);
|
||||
} else {
|
||||
movingEnt->ProcessControl();
|
||||
if(movingEnt->IsStatic()) { movingEnt->RemoveFromMovingList(); }
|
||||
if(movingEnt->GetIsStatic()) { movingEnt->RemoveFromMovingList(); }
|
||||
}
|
||||
}
|
||||
bForceProcessControl = true;
|
||||
@ -1973,7 +1973,7 @@ CWorld::Process(void)
|
||||
RemoveEntityInsteadOfProcessingIt(movingEnt);
|
||||
} else {
|
||||
movingEnt->ProcessControl();
|
||||
if(movingEnt->IsStatic()) { movingEnt->RemoveFromMovingList(); }
|
||||
if(movingEnt->GetIsStatic()) { movingEnt->RemoveFromMovingList(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2133,13 +2133,13 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
|
||||
CObject *pObject = (CObject *)pEntity;
|
||||
CVehicle *pVehicle = (CVehicle *)pEntity;
|
||||
if(!pEntity->bExplosionProof && (!pEntity->IsPed() || !pPed->bInVehicle)) {
|
||||
if(pEntity->IsStatic()) {
|
||||
if(pEntity->GetIsStatic()) {
|
||||
if(pEntity->IsObject()) {
|
||||
if (fPower > pObject->m_fUprootLimit || IsFence(pObject->GetModelIndex())) {
|
||||
if (IsGlass(pObject->GetModelIndex())) {
|
||||
CGlass::WindowRespondsToExplosion(pObject, position);
|
||||
} else {
|
||||
pObject->bIsStatic = false;
|
||||
pObject->SetIsStatic(false);
|
||||
pObject->AddToMovingList();
|
||||
int16 modelId = pEntity->GetModelIndex();
|
||||
if(modelId != MI_FIRE_HYDRANT ||
|
||||
@ -2157,18 +2157,18 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
|
||||
}
|
||||
}
|
||||
}
|
||||
if(pEntity->IsStatic()) {
|
||||
if(pEntity->GetIsStatic()) {
|
||||
float fDamageMultiplier =
|
||||
(fRadius - fMagnitude) * 2.0f / fRadius;
|
||||
float fDamage = 300.0f * Min(fDamageMultiplier, 1.0f);
|
||||
pObject->ObjectDamage(fDamage);
|
||||
}
|
||||
} else {
|
||||
pEntity->bIsStatic = false;
|
||||
pEntity->SetIsStatic(false);
|
||||
pEntity->AddToMovingList();
|
||||
}
|
||||
}
|
||||
if(!pEntity->IsStatic()) {
|
||||
if(!pEntity->GetIsStatic()) {
|
||||
float fDamageMultiplier = Min((fRadius - fMagnitude) * 2.0f / fRadius, 1.0f);
|
||||
CVector vecForceDir =
|
||||
vecDistance * (fPower * pEntity->m_fMass * 0.00071429f * fDamageMultiplier /
|
||||
|
@ -633,14 +633,17 @@ CTheZones::SaveAllZones(uint8 *buffer, uint32 *size)
|
||||
INITSAVEBUF
|
||||
int i;
|
||||
|
||||
#define CZONE_SAVE_SIZE (sizeof(char)*8+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(eZoneType)+sizeof(eLevelName)+sizeof(int16)+sizeof(int16)+sizeof(int32)+sizeof(int32)+sizeof(int32))
|
||||
|
||||
*size = SAVE_HEADER_SIZE
|
||||
+ sizeof(m_CurrLevel) + sizeof(FindIndex)
|
||||
+ sizeof(int16) // padding
|
||||
+ sizeof(NavigationZoneArray) + sizeof(InfoZoneArray) + sizeof(ZoneInfoArray)
|
||||
+ CZONE_SAVE_SIZE * ARRAY_SIZE(NavigationZoneArray) + CZONE_SAVE_SIZE * ARRAY_SIZE(InfoZoneArray) + sizeof(ZoneInfoArray)
|
||||
+ sizeof(TotalNumberOfNavigationZones) + sizeof(TotalNumberOfInfoZones) + sizeof(TotalNumberOfZoneInfos)
|
||||
+ sizeof(int16) // padding
|
||||
+ sizeof(MapZoneArray) + sizeof(AudioZoneArray)
|
||||
+ CZONE_SAVE_SIZE * ARRAY_SIZE(MapZoneArray) + sizeof(AudioZoneArray)
|
||||
+ sizeof(TotalNumberOfMapZones) + sizeof(NumberOfAudioZones);
|
||||
#undef CZONE_SAVE_SIZE
|
||||
|
||||
uint32 length = 0;
|
||||
WriteSaveHeaderWithLength(buffer, length, 'Z', 'N', 'S', '\0', *size - SAVE_HEADER_SIZE);
|
||||
|
@ -172,7 +172,6 @@ enum Config {
|
||||
# define RANDOMSPLASH
|
||||
# define VU_COLLISION
|
||||
#elif defined GTA_PC
|
||||
# define GTA3_1_1_PATCH
|
||||
//# define GTA3_STEAM_PATCH
|
||||
//# define GTAVC_JP_PATCH
|
||||
# ifdef GTA_PS2_STUFF
|
||||
@ -263,7 +262,6 @@ enum Config {
|
||||
|
||||
// Hud, frontend and radar
|
||||
//#define BETA_SLIDING_TEXT
|
||||
#define TRIANGULAR_BLIPS // height indicating triangular radar blips, as in VC
|
||||
#define PC_MENU
|
||||
|
||||
#ifndef PC_MENU
|
||||
@ -315,9 +313,7 @@ enum Config {
|
||||
#define FREE_CAM // Rotating cam
|
||||
|
||||
// Audio
|
||||
#ifndef AUDIO_OAL // is not working yet for openal
|
||||
#define AUDIO_CACHE // cache sound lengths to speed up the cold boot
|
||||
#endif
|
||||
//#define PS2_AUDIO // changes audio paths for cutscenes and radio to PS2 paths, needs vbdec to support VB with MSS
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user