Merge remote-tracking branch 'upstream/miami' into miami

This commit is contained in:
Nikolay Korolev 2020-08-31 00:07:38 +03:00
commit 4ffca8954f
22 changed files with 483 additions and 506 deletions

View File

@ -450,9 +450,9 @@ int8 cSampleManager::GetCurrent3DProviderIndex(void)
int8 cSampleManager::SetCurrent3DProvider(uint8 nProvider) int8 cSampleManager::SetCurrent3DProvider(uint8 nProvider)
{ {
ASSERT( nProvider < m_nNumberOfProviders );
if (nProvider >= m_nNumberOfProviders) if (nProvider >= m_nNumberOfProviders)
nProvider = 0; nProvider = 0;
ASSERT( nProvider < m_nNumberOfProviders );
int savedprovider = curprovider; int savedprovider = curprovider;
if ( nProvider < m_nNumberOfProviders ) if ( nProvider < m_nNumberOfProviders )

View File

@ -1737,7 +1737,7 @@ CPathFind::Load(uint8 *buf, uint32 size)
void void
CPathFind::DisplayPathData(void) CPathFind::DisplayPathData(void)
{ {
// Not the function from mobm_carPathLinksile but my own! // Not the function from mobile but my own!
int i, j, k; int i, j, k;
// Draw 50 units around camera // Draw 50 units around camera

View File

@ -1698,11 +1698,11 @@ void CMissionCleanup::AddEntityToList(int32 id, uint8 type)
m_nCount++; m_nCount++;
} }
static void PossiblyWakeThisEntity(CPhysical* pEntity) static void PossiblyWakeThisEntity(CPhysical* pEntity, bool ifColLoaded = false)
{ {
if (!pEntity->bIsStaticWaitingForCollision) if (!pEntity->bIsStaticWaitingForCollision)
return; return;
if (CColStore::HasCollisionLoaded(pEntity->GetPosition())) { if (!ifColLoaded || CColStore::HasCollisionLoaded(pEntity->GetPosition())) {
pEntity->bIsStaticWaitingForCollision = false; pEntity->bIsStaticWaitingForCollision = false;
if (!pEntity->IsStatic()) if (!pEntity->IsStatic())
pEntity->AddToMovingList(); pEntity->AddToMovingList();
@ -1745,7 +1745,7 @@ void CMissionCleanup::RemoveEntityFromList(int32 id, uint8 type)
} }
} }
void CMissionCleanup::CheckIfCollisionHasLoadedForMissionObject() void CMissionCleanup::CheckIfCollisionHasLoadedForMissionObjects()
{ {
for (int i = 0; i < MAX_CLEANUP; i++) { for (int i = 0; i < MAX_CLEANUP; i++) {
switch (m_sEntities[i].type) { switch (m_sEntities[i].type) {
@ -1753,21 +1753,21 @@ void CMissionCleanup::CheckIfCollisionHasLoadedForMissionObject()
{ {
CVehicle* v = CPools::GetVehiclePool()->GetAt(m_sEntities[i].id); CVehicle* v = CPools::GetVehiclePool()->GetAt(m_sEntities[i].id);
if (v) if (v)
PossiblyWakeThisEntity(v); PossiblyWakeThisEntity(v, true);
break; break;
} }
case CLEANUP_CHAR: case CLEANUP_CHAR:
{ {
CPed* p = CPools::GetPedPool()->GetAt(m_sEntities[i].id); CPed* p = CPools::GetPedPool()->GetAt(m_sEntities[i].id);
if (p) if (p)
PossiblyWakeThisEntity(p); PossiblyWakeThisEntity(p, true);
break; break;
} }
case CLEANUP_OBJECT: case CLEANUP_OBJECT:
{ {
CObject* o = CPools::GetObjectPool()->GetAt(m_sEntities[i].id); CObject* o = CPools::GetObjectPool()->GetAt(m_sEntities[i].id);
if (o) if (o)
PossiblyWakeThisEntity(o); PossiblyWakeThisEntity(o, true);
break; break;
} }
default: default:
@ -2351,7 +2351,7 @@ void CTheScripts::Process()
float timeStep = CTimer::GetTimeStepInMilliseconds(); float timeStep = CTimer::GetTimeStepInMilliseconds();
UpsideDownCars.UpdateTimers(); UpsideDownCars.UpdateTimers();
StuckCars.Process(); StuckCars.Process();
MissionCleanup.CheckIfCollisionHasLoadedForMissionObject(); MissionCleanup.CheckIfCollisionHasLoadedForMissionObjects();
DrawScriptSpheres(); DrawScriptSpheres();
if (FailCurrentMission) if (FailCurrentMission)
--FailCurrentMission; --FailCurrentMission;

View File

@ -138,7 +138,7 @@ public:
void AddEntityToList(int32, uint8); void AddEntityToList(int32, uint8);
void RemoveEntityFromList(int32, uint8); void RemoveEntityFromList(int32, uint8);
void Process(); void Process();
void CheckIfCollisionHasLoadedForMissionObject(); void CheckIfCollisionHasLoadedForMissionObjects();
CPhysical* DoesThisEntityWaitForCollision(int i); CPhysical* DoesThisEntityWaitForCollision(int i);
}; };

View File

@ -6,6 +6,8 @@
#include "Pools.h" #include "Pools.h"
#include "World.h" #include "World.h"
// --MIAMI: File done
CAccidentManager gAccidentManager; CAccidentManager gAccidentManager;
CAccident* CAccident*

View File

@ -2044,7 +2044,11 @@ CCamera::GetScreenRect(CRect &rect)
{ {
rect.left = 0.0f; rect.left = 0.0f;
rect.right = SCREEN_WIDTH; rect.right = SCREEN_WIDTH;
if(m_WideScreenOn){ if(m_WideScreenOn
#ifdef CUTSCENE_BORDERS_SWITCH
&& CMenuManager::m_PrefsCutsceneBorders
#endif
){
float borderSize = (SCREEN_HEIGHT / 2) * (m_ScreenReductionPercentage / 100.f); float borderSize = (SCREEN_HEIGHT / 2) * (m_ScreenReductionPercentage / 100.f);
rect.top = borderSize - SCREEN_SCALE_Y(22.f); rect.top = borderSize - SCREEN_SCALE_Y(22.f);
rect.bottom = SCREEN_HEIGHT - borderSize - SCREEN_SCALE_Y(14.f); rect.bottom = SCREEN_HEIGHT - borderSize - SCREEN_SCALE_Y(14.f);

View File

@ -5,6 +5,8 @@
#include "Clock.h" #include "Clock.h"
#include "Stats.h" #include "Stats.h"
// --MIAMI: File done
_TODO("gbFastTime"); _TODO("gbFastTime");
bool gbFastTime; bool gbFastTime;
@ -73,8 +75,14 @@ CClock::Update(void)
void void
CClock::SetGameClock(uint8 h, uint8 m) CClock::SetGameClock(uint8 h, uint8 m)
{ {
ms_nGameClockHours = h; while (m >= 60) {
m -= 60;
h++;
}
ms_nGameClockMinutes = m; ms_nGameClockMinutes = m;
while (h >= 24)
h -= 24;
ms_nGameClockHours = h;
ms_nGameClockSeconds = 0; ms_nGameClockSeconds = 0;
ms_nLastClockTick = CTimer::GetTimeInMilliseconds(); ms_nLastClockTick = CTimer::GetTimeInMilliseconds();
} }

View File

@ -3507,8 +3507,9 @@ CMenuManager::Process(void)
UserInput(); UserInput();
ProcessFileActions(); ProcessFileActions();
DMAudio.Service(); DMAudio.Service();
#ifdef USE_TEXTURE_POOL
// Game calls some texture pool cleanup functions in here // TODO
#endif
} }
SwitchMenuOnAndOff(); SwitchMenuOnAndOff();

View File

@ -109,6 +109,7 @@ bool CGame::japaneseGame = false;
int gameTxdSlot; int gameTxdSlot;
// --MIAMI: File done
bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha); bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha);
void DoRWStuffEndOfFrame(void); void DoRWStuffEndOfFrame(void);
@ -153,7 +154,11 @@ CGame::InitialiseOnceBeforeRW(void)
{ {
CFileMgr::Initialise(); CFileMgr::Initialise();
CdStreamInit(MAX_CDCHANNELS); CdStreamInit(MAX_CDCHANNELS);
ValidateVersion(); debug("size of matrix %d\n", sizeof(CMatrix));
debug("size of placeable %d\n", sizeof(CPlaceable));
debug("size of entity %d\n", sizeof(CEntity));
debug("size of building %d\n", sizeof(CBuilding));
debug("size of dummy %d\n", sizeof(CDummy));
#ifdef EXTENDED_COLOURFILTER #ifdef EXTENDED_COLOURFILTER
CPostFX::InitOnce(); CPostFX::InitOnce();
#endif #endif
@ -172,6 +177,7 @@ void ReplaceAtomicPipeCallback();
bool bool
CGame::InitialiseRenderWare(void) CGame::InitialiseRenderWare(void)
{ {
ValidateVersion();
#ifdef USE_TEXTURE_POOL #ifdef USE_TEXTURE_POOL
_TexturePoolsInitialise(); _TexturePoolsInitialise();
#endif #endif
@ -237,7 +243,6 @@ CGame::InitialiseRenderWare(void)
void CGame::ShutdownRenderWare(void) void CGame::ShutdownRenderWare(void)
{ {
CMBlur::MotionBlurClose();
DestroySplashScreen(); DestroySplashScreen();
CHud::Shutdown(); CHud::Shutdown();
CFont::Shutdown(); CFont::Shutdown();
@ -293,7 +298,6 @@ bool CGame::InitialiseOnceAfterRW(void)
DMAudio.SetEffectsMasterVolume(FrontEndMenuManager.m_PrefsSfxVolume); DMAudio.SetEffectsMasterVolume(FrontEndMenuManager.m_PrefsSfxVolume);
DMAudio.SetEffectsFadeVol(127); DMAudio.SetEffectsFadeVol(127);
DMAudio.SetMusicFadeVol(127); DMAudio.SetMusicFadeVol(127);
CWorld::Players[0].SetPlayerSkin(FrontEndMenuManager.m_PrefsSkinFile);
return true; return true;
} }
@ -311,7 +315,11 @@ bool CGame::Initialise(const char* datFile)
strcpy(aDatFile, datFile); strcpy(aDatFile, datFile);
CPools::Initialise(); CPools::Initialise();
CIniFile::LoadIniFile(); CIniFile::LoadIniFile();
#ifdef USE_TEXTURE_POOL
_TexturePoolsUnknown(false);
#endif
currLevel = LEVEL_BEACH; currLevel = LEVEL_BEACH;
currArea = AREA_MAIN_MAP;
LoadingScreen("Loading the Game", "Loading generic textures", GetRandomSplashScreen()); LoadingScreen("Loading the Game", "Loading generic textures", GetRandomSplashScreen());
gameTxdSlot = CTxdStore::AddTxdSlot("generic"); gameTxdSlot = CTxdStore::AddTxdSlot("generic");
CTxdStore::Create(gameTxdSlot); CTxdStore::Create(gameTxdSlot);
@ -362,11 +370,12 @@ bool CGame::Initialise(const char* datFile)
// for generic fallback // for generic fallback
CustomPipes::SetTxdFindCallback(); CustomPipes::SetTxdFindCallback();
#endif #endif
LoadingScreen("Loading the Game", "Add Particles", nil);
CWorld::AddParticles(); CWorld::AddParticles();
CVehicleModelInfo::LoadVehicleColours(); CVehicleModelInfo::LoadVehicleColours();
CVehicleModelInfo::LoadEnvironmentMaps(); CVehicleModelInfo::LoadEnvironmentMaps();
CTheZones::PostZoneCreation(); CTheZones::PostZoneCreation();
LoadingScreen("Loading the Game", "Setup paths", GetRandomSplashScreen()); LoadingScreen("Loading the Game", "Setup paths", nil);
ThePaths.PreparePathData(); ThePaths.PreparePathData();
for (int i = 0; i < NUMPLAYERS; i++) for (int i = 0; i < NUMPLAYERS; i++)
CWorld::Players[i].Clear(); CWorld::Players[i].Clear();
@ -382,10 +391,12 @@ bool CGame::Initialise(const char* datFile)
CStreaming::LoadInitialPeds(); CStreaming::LoadInitialPeds();
CStreaming::RequestBigBuildings(LEVEL_GENERIC); CStreaming::RequestBigBuildings(LEVEL_GENERIC);
CStreaming::LoadAllRequestedModels(false); CStreaming::LoadAllRequestedModels(false);
CStreaming::RemoveIslandsNotUsed(currLevel);
printf("Streaming uses %zuK of its memory", CStreaming::ms_memoryUsed / 1024); // original modifier was %d printf("Streaming uses %zuK of its memory", CStreaming::ms_memoryUsed / 1024); // original modifier was %d
LoadingScreen("Loading the Game", "Load animations", GetRandomSplashScreen()); LoadingScreen("Loading the Game", "Load animations", GetRandomSplashScreen());
CAnimManager::LoadAnimFiles(); CAnimManager::LoadAnimFiles();
CStreaming::LoadInitialWeapons(); CStreaming::LoadInitialWeapons();
CStreaming::LoadAllRequestedModels(0);
CPed::Initialise(); CPed::Initialise();
CRouteNode::Initialise(); CRouteNode::Initialise();
CEventList::Initialise(); CEventList::Initialise();
@ -449,6 +460,9 @@ bool CGame::Initialise(const char* datFile)
CCollision::ms_collisionInMemory = currLevel; CCollision::ms_collisionInMemory = currLevel;
for (int i = 0; i < MAX_PADS; i++) for (int i = 0; i < MAX_PADS; i++)
CPad::GetPad(i)->Clear(true); CPad::GetPad(i)->Clear(true);
#ifdef USE_TEXTURE_POOL
_TexturePoolsUnknown(true);
#endif
// TODO(Miami) // TODO(Miami)
// DMAudio.SetStartingTrackPositions(1); // DMAudio.SetStartingTrackPositions(1);
DMAudio.ChangeMusicMode(MUSICMODE_GAME); DMAudio.ChangeMusicMode(MUSICMODE_GAME);
@ -457,10 +471,16 @@ bool CGame::Initialise(const char* datFile)
bool CGame::ShutDown(void) bool CGame::ShutDown(void)
{ {
#ifdef USE_TEXTURE_POOL
_TexturePoolsUnknown(false);
#endif
CReplay::FinishPlayback(); CReplay::FinishPlayback();
CReplay::EmptyReplayBuffer();
CPlane::Shutdown(); CPlane::Shutdown();
CTrain::Shutdown(); CTrain::Shutdown();
CScriptPaths::Shutdown(); CScriptPaths::Shutdown();
// TODO(Miami)
// CWaterCreatures::RemoveAll();
CSpecialFX::Shutdown(); CSpecialFX::Shutdown();
#ifndef PS2 #ifndef PS2
CGarages::Shutdown(); CGarages::Shutdown();
@ -495,7 +515,7 @@ bool CGame::ShutDown(void)
CStreaming::Shutdown(); CStreaming::Shutdown();
CTxdStore::GameShutdown(); CTxdStore::GameShutdown();
CCollision::Shutdown(); CCollision::Shutdown();
CWaterLevel::Shutdown(); CWaterLevel::DestroyWavyAtomic();
CRubbish::Shutdown(); CRubbish::Shutdown();
CClouds::Shutdown(); CClouds::Shutdown();
CShadows::Shutdown(); CShadows::Shutdown();
@ -505,7 +525,11 @@ bool CGame::ShutDown(void)
CParticle::Shutdown(); CParticle::Shutdown();
CPools::ShutDown(); CPools::ShutDown();
CTxdStore::RemoveTxdSlot(gameTxdSlot); CTxdStore::RemoveTxdSlot(gameTxdSlot);
CMBlur::MotionBlurClose();
CdStreamRemoveImages(); CdStreamRemoveImages();
#ifdef USE_TEXTURE_POOL
_TexturePoolsFinalShutdown();
#endif
return true; return true;
} }
@ -539,7 +563,10 @@ void CGame::ReInitGameObjectVariables(void)
CDraw::SetFOV(120.0f); CDraw::SetFOV(120.0f);
CDraw::ms_fLODDistance = 500.0f; CDraw::ms_fLODDistance = 500.0f;
CStreaming::RequestBigBuildings(LEVEL_GENERIC); CStreaming::RequestBigBuildings(LEVEL_GENERIC);
CStreaming::RemoveIslandsNotUsed(LEVEL_BEACH);
CStreaming::RemoveIslandsNotUsed(LEVEL_MAINLAND);
CStreaming::LoadAllRequestedModels(false); CStreaming::LoadAllRequestedModels(false);
currArea = AREA_MAIN_MAP;
CPed::Initialise(); CPed::Initialise();
CEventList::Initialise(); CEventList::Initialise();
CWeapon::InitialiseWeapons(); CWeapon::InitialiseWeapons();
@ -603,9 +630,13 @@ void CGame::ReloadIPLs(void)
void CGame::ShutDownForRestart(void) void CGame::ShutDownForRestart(void)
{ {
#ifdef USE_TEXTURE_POOL
_TexturePoolsUnknown(false);
#endif
CReplay::FinishPlayback(); CReplay::FinishPlayback();
CReplay::EmptyReplayBuffer(); CReplay::EmptyReplayBuffer();
DMAudio.DestroyAllGameCreatedEntities(); DMAudio.DestroyAllGameCreatedEntities();
CMovingThings::Shutdown();
for (int i = 0; i < NUMPLAYERS; i++) for (int i = 0; i < NUMPLAYERS; i++)
CWorld::Players[i].Clear(); CWorld::Players[i].Clear();
@ -620,11 +651,10 @@ void CGame::ShutDownForRestart(void)
CRadar::RemoveRadarSections(); CRadar::RemoveRadarSections();
FrontEndMenuManager.UnloadTextures(); FrontEndMenuManager.UnloadTextures();
CParticleObject::RemoveAllExpireableParticleObjects(); CParticleObject::RemoveAllExpireableParticleObjects();
//CWaterCreatures::RemoveAll(); //TODO VC //CWaterCreatures::RemoveAll(); //TODO(Miami)
CSetPieces::Init(); CSetPieces::Init();
CPedType::Shutdown(); CPedType::Shutdown();
CSpecialFX::Shutdown(); CSpecialFX::Shutdown();
TidyUpMemory(true, false);
} }
void CGame::InitialiseWhenRestarting(void) void CGame::InitialiseWhenRestarting(void)
@ -649,13 +679,15 @@ void CGame::InitialiseWhenRestarting(void)
if ( FrontEndMenuManager.m_bWantToLoad == true ) if ( FrontEndMenuManager.m_bWantToLoad == true )
{ {
RestoreForStartLoad(); RestoreForStartLoad();
CStreaming::LoadScene(TheCamera.GetPosition());
} }
ReInitGameObjectVariables(); ReInitGameObjectVariables();
if ( FrontEndMenuManager.m_bWantToLoad == true ) if ( FrontEndMenuManager.m_bWantToLoad == true )
{ {
FrontEndMenuManager.m_bWantToLoad = false;
// TODO(Miami)
//InitRadioStationPositionList();
if ( GenericLoad() == true ) if ( GenericLoad() == true )
{ {
DMAudio.ResetTimers(CTimer::GetTimeInMilliseconds()); DMAudio.ResetTimers(CTimer::GetTimeInMilliseconds());
@ -670,6 +702,7 @@ void CGame::InitialiseWhenRestarting(void)
FrontEndMenuManager.MessageScreen("FED_LFL", true); // Loading save game has failed. The game will restart now. FrontEndMenuManager.MessageScreen("FED_LFL", true); // Loading save game has failed. The game will restart now.
} }
TheCamera.SetFadeColour(0, 0, 0);
ShutDownForRestart(); ShutDownForRestart();
CTimer::Stop(); CTimer::Stop();
CTimer::Initialise(); CTimer::Initialise();
@ -683,6 +716,9 @@ void CGame::InitialiseWhenRestarting(void)
CTimer::Update(); CTimer::Update();
DMAudio.ChangeMusicMode(MUSICMODE_GAME); DMAudio.ChangeMusicMode(MUSICMODE_GAME);
#ifdef USE_TEXTURE_POOL
_TexturePoolsUnknown(true);
#endif
} }
void CGame::Process(void) void CGame::Process(void)
@ -691,20 +727,20 @@ void CGame::Process(void)
#ifdef GTA_PS2 #ifdef GTA_PS2
ProcessTidyUpMemory(); ProcessTidyUpMemory();
#endif #endif
TheCamera.SetMotionBlurAlpha(0);
if (TheCamera.m_BlurType == MOTION_BLUR_NONE || TheCamera.m_BlurType == MOTION_BLUR_SNIPER || TheCamera.m_BlurType == MOTION_BLUR_LIGHT_SCENE)
TheCamera.SetMotionBlur(0, 0, 0, 0, MOTION_BLUR_NONE);
#ifdef DEBUGMENU #ifdef DEBUGMENU
DebugMenuProcess(); DebugMenuProcess();
#endif #endif
CCutsceneMgr::Update(); CCutsceneMgr::Update();
if (!CCutsceneMgr::IsCutsceneProcessing() && !CTimer::GetIsCodePaused()) if (!CCutsceneMgr::IsCutsceneProcessing() && !CTimer::GetIsCodePaused())
FrontEndMenuManager.Process(); FrontEndMenuManager.Process();
CTheZones::Update();
// DRM call in here
uint32 startTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond();
CStreaming::Update(); CStreaming::Update();
uint32 processTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond() - startTime;
CWindModifiers::Number = 0; CWindModifiers::Number = 0;
if (!CTimer::GetIsPaused()) if (!CTimer::GetIsPaused())
{ {
CTheZones::Update();
CSprite2d::SetRecipNearClip(); CSprite2d::SetRecipNearClip();
CSprite2d::InitPerFrame(); CSprite2d::InitPerFrame();
CFont::InitPerFrame(); CFont::InitPerFrame();
@ -728,7 +764,13 @@ void CGame::Process(void)
CEventList::Update(); CEventList::Update();
CParticle::Update(); CParticle::Update();
gFireManager.Update(); gFireManager.Update();
CPopulation::Update(); if (processTime >= 2) {
CPopulation::Update(false);
} else {
uint32 startTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond();
CPopulation::Update(true);
processTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond() - startTime;
}
CWeapon::UpdateWeapons(); CWeapon::UpdateWeapons();
if (!CCutsceneMgr::IsRunning()) if (!CCutsceneMgr::IsRunning())
CTheCarGenerators::Process(); CTheCarGenerators::Process();
@ -761,9 +803,11 @@ void CGame::Process(void)
gPhoneInfo.Update(); gPhoneInfo.Update();
if (!CReplay::IsPlayingBack()) if (!CReplay::IsPlayingBack())
{ {
CCarCtrl::GenerateRandomCars(); if (processTime < 2)
CCarCtrl::GenerateRandomCars();
CRoadBlocks::GenerateRoadBlocks(); CRoadBlocks::GenerateRoadBlocks();
CCarCtrl::RemoveDistantCars(); CCarCtrl::RemoveDistantCars();
CCarCtrl::RemoveCarsIfThePoolGetsFull();
} }
} }
} }
@ -794,16 +838,22 @@ CGame::CanSeeOutSideFromCurrArea(void)
void CGame::DrasticTidyUpMemory(bool) void CGame::DrasticTidyUpMemory(bool)
{ {
#ifdef USE_TEXTURE_POOL
// TODO
#endif
#ifdef PS2 #ifdef PS2
// meow // meow
#endif #endif
} }
void CGame::TidyUpMemory(bool, bool) void CGame::TidyUpMemory(bool unk1, bool unk2)
{ {
#ifdef PS2 #ifdef PS2
// meow // meow
#endif #endif
if (unk2) {
DrasticTidyUpMemory(true); // parameter is unknown too
}
} }
void CGame::ProcessTidyUpMemory(void) void CGame::ProcessTidyUpMemory(void)

View File

@ -730,9 +730,9 @@ CTheZones::LoadAllZones(uint8 *buffer, uint32 size)
InfoZoneArray[i].child = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].child); InfoZoneArray[i].child = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].child);
InfoZoneArray[i].parent = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].parent); InfoZoneArray[i].parent = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].parent);
InfoZoneArray[i].next = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].next); InfoZoneArray[i].next = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].next);
InfoZoneArray[i].child = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].child); assert(InfoZoneArray[i].child == nil);
InfoZoneArray[i].parent = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].parent); assert(InfoZoneArray[i].parent == nil);
InfoZoneArray[i].next = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].next); assert(InfoZoneArray[i].next == nil);
} }
for(i = 0; i < ARRAY_SIZE(ZoneInfoArray); i++) for(i = 0; i < ARRAY_SIZE(ZoneInfoArray); i++)

View File

@ -304,7 +304,6 @@ enum Config {
#define PED_SKIN // support for skinned geometry on peds #define PED_SKIN // support for skinned geometry on peds
#define ANIMATE_PED_COL_MODEL #define ANIMATE_PED_COL_MODEL
#define VC_PED_PORTS // various ports from VC's CPed, mostly subtle #define VC_PED_PORTS // various ports from VC's CPed, mostly subtle
// #define NEW_WALK_AROUND_ALGORITHM // to make walking around vehicles/objects less awkward
#define CANCELLABLE_CAR_ENTER #define CANCELLABLE_CAR_ENTER
// Camera // Camera

View File

@ -256,26 +256,11 @@ DoFade(void)
fadeColor.a = alpha; fadeColor.a = alpha;
} }
// This is CCamera::GetScreenRect in VC TheCamera.GetScreenRect(rect);
if(TheCamera.m_WideScreenOn
#ifdef CUTSCENE_BORDERS_SWITCH
&& CMenuManager::m_PrefsCutsceneBorders
#endif
){
float y = SCREEN_HEIGHT/2 * TheCamera.m_ScreenReductionPercentage/100.0f;
rect.left = 0.0f;
rect.right = SCREEN_WIDTH;
rect.top = y - SCREEN_SCALE_Y(22.0f);
rect.bottom = SCREEN_HEIGHT - y - SCREEN_SCALE_Y(14.0f);
}else{
rect.left = 0.0f;
rect.right = SCREEN_WIDTH;
rect.top = 0.0f;
rect.bottom = SCREEN_HEIGHT;
}
CSprite2d::DrawRect(rect, fadeColor); CSprite2d::DrawRect(rect, fadeColor);
if(CDraw::FadeValue != 0 && TheCamera.m_FadeTargetIsSplashScreen){ if(CDraw::FadeValue != 0 && TheCamera.m_FadeTargetIsSplashScreen){
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
fadeColor.r = 255; fadeColor.r = 255;
fadeColor.g = 255; fadeColor.g = 255;
fadeColor.b = 255; fadeColor.b = 255;
@ -954,11 +939,12 @@ Render2dStuff(void)
if(cammode == CCam::MODE_SNIPER || if(cammode == CCam::MODE_SNIPER ||
cammode == CCam::MODE_SNIPER_RUNABOUT || cammode == CCam::MODE_SNIPER_RUNABOUT ||
cammode == CCam::MODE_ROCKETLAUNCHER || cammode == CCam::MODE_ROCKETLAUNCHER ||
cammode == CCam::MODE_ROCKETLAUNCHER_RUNABOUT) cammode == CCam::MODE_ROCKETLAUNCHER_RUNABOUT ||
cammode == CCam::MODE_CAMERA)
firstPersonWeapon = true; firstPersonWeapon = true;
// Draw black border for sniper and rocket launcher // Draw black border for sniper and rocket launcher
if((weaponType == WEAPONTYPE_SNIPERRIFLE || weaponType == WEAPONTYPE_ROCKETLAUNCHER) && firstPersonWeapon){ if((weaponType == WEAPONTYPE_SNIPERRIFLE || weaponType == WEAPONTYPE_ROCKETLAUNCHER || weaponType == WEAPONTYPE_LASERSCOPE) && firstPersonWeapon){
CRGBA black(0, 0, 0, 255); CRGBA black(0, 0, 0, 255);
// top and bottom strips // top and bottom strips
@ -980,13 +966,17 @@ Render2dStuff(void)
CSceneEdit::Draw(); CSceneEdit::Draw();
else else
CHud::Draw(); CHud::Draw();
// TODO(Miami)
// CSpecialFX::Render2DFXs();
CUserDisplay::OnscnTimer.ProcessForDisplay(); CUserDisplay::OnscnTimer.ProcessForDisplay();
CMessages::Display(); CMessages::Display();
CDarkel::DrawMessages(); CDarkel::DrawMessages();
CGarages::PrintMessages(); CGarages::PrintMessages();
CPad::PrintErrorMessage(); CPad::PrintErrorMessage();
CFont::DrawFonts(); CFont::DrawFonts();
#ifndef MASTER
COcclusion::Render(); COcclusion::Render();
#endif
#ifdef DEBUGMENU #ifdef DEBUGMENU
DebugMenuRender(); DebugMenuRender();

View File

@ -429,7 +429,9 @@ DebugMenuPopulate(void)
DebugMenuAddVarBool8("Render", "Motion Blur", &CPostFX::MotionBlurOn, nil); DebugMenuAddVarBool8("Render", "Motion Blur", &CPostFX::MotionBlurOn, nil);
#endif #endif
DebugMenuAddVar("Render", "Drunkness", &CMBlur::Drunkness, nil, 0.05f, 0, 1.0f); DebugMenuAddVar("Render", "Drunkness", &CMBlur::Drunkness, nil, 0.05f, 0, 1.0f);
#ifndef MASTER
DebugMenuAddVarBool8("Render", "Occlusion debug", &bDisplayOccDebugStuff, nil); DebugMenuAddVarBool8("Render", "Occlusion debug", &bDisplayOccDebugStuff, nil);
#endif
#ifdef EXTENDED_PIPELINES #ifdef EXTENDED_PIPELINES
static const char *vehpipenames[] = { "MatFX", "Neo" }; static const char *vehpipenames[] = { "MatFX", "Neo" };
e = DebugMenuAddVar("Render", "Vehicle Pipeline", &CustomPipes::VehiclePipeSwitch, nil, e = DebugMenuAddVar("Render", "Vehicle Pipeline", &CustomPipes::VehiclePipeSwitch, nil,

View File

@ -23,6 +23,7 @@ CCivilianPed::CCivilianPed(ePedType pedtype, uint32 mi) : CPed(pedtype)
m_bAttractorUnk = (CGeneral::GetRandomNumberInRange(0.0f, 1.0f) < 1.25f); m_bAttractorUnk = (CGeneral::GetRandomNumberInRange(0.0f, 1.0f) < 1.25f);
} }
// --MIAMI: Done
void void
CCivilianPed::CivilianAI(void) CCivilianPed::CivilianAI(void)
{ {
@ -39,7 +40,13 @@ CCivilianPed::CivilianAI(void)
if (CTimer::GetTimeInMilliseconds() <= m_lookTimer) if (CTimer::GetTimeInMilliseconds() <= m_lookTimer)
return; return;
uint32 closestThreatFlag = ScanForThreats(); ScanForDelayedResponseThreats();
if (!m_threatFlags || CTimer::GetTimeInMilliseconds() <= m_threatCheckTimer)
return;
CheckThreatValidity();
uint32 closestThreatFlag = m_threatFlags;
m_threatFlags = 0;
m_threatCheckTimer = 0;
if (closestThreatFlag == PED_FLAG_EXPLOSION) { if (closestThreatFlag == PED_FLAG_EXPLOSION) {
float angleToFace = CGeneral::GetRadianAngleBetweenPoints( float angleToFace = CGeneral::GetRadianAngleBetweenPoints(
m_eventOrThreat.x, m_eventOrThreat.y, m_eventOrThreat.x, m_eventOrThreat.y,
@ -53,18 +60,30 @@ CCivilianPed::CivilianAI(void)
} }
return; return;
} }
uint32 closestThreatFlag = ScanForThreats(); ScanForDelayedResponseThreats();
if (!m_threatFlags || CTimer::GetTimeInMilliseconds() <= m_threatCheckTimer)
return;
CheckThreatValidity();
uint32 closestThreatFlag = m_threatFlags;
m_threatFlags = 0;
m_threatCheckTimer = 0;
if (closestThreatFlag == PED_FLAG_GUN) { if (closestThreatFlag == PED_FLAG_GUN) {
if (!m_threatEntity || !m_threatEntity->IsPed()) if (!m_threatEntity || !m_threatEntity->IsPed())
return; return;
CPed *threatPed = (CPed*)m_threatEntity; CPed *threatPed = (CPed*)m_threatEntity;
float threatDistSqr = (m_threatEntity->GetPosition() - GetPosition()).MagnitudeSqr2D(); float threatDistSqr = (m_threatEntity->GetPosition() - GetPosition()).MagnitudeSqr2D();
if (CharCreatedBy == MISSION_CHAR && bCrouchWhenScared) {
SetDuck(10000, true);
SetLookFlag(m_threatEntity, false);
SetLookTimer(500);
return;
}
if (m_pedStats->m_fear <= m_pedStats->m_lawfulness) { if (m_pedStats->m_fear <= m_pedStats->m_lawfulness) {
if (m_pedStats->m_temper <= m_pedStats->m_fear) { if (m_pedStats->m_temper <= m_pedStats->m_fear) {
if (!threatPed->IsPlayer() || !RunToReportCrime(CRIME_POSSESSION_GUN)) { if (!threatPed->IsPlayer() || !RunToReportCrime(CRIME_POSSESSION_GUN)) {
if (threatDistSqr < sq(10.0f)) { if (threatDistSqr < sq(30.0f)) {
Say(SOUND_PED_FLEE_SPRINT); bMakeFleeScream = true;
SetFindPathAndFlee(m_threatEntity, 10000); SetFindPathAndFlee(m_threatEntity, 10000);
} else { } else {
SetFindPathAndFlee(m_threatEntity->GetPosition(), 5000, true); SetFindPathAndFlee(m_threatEntity->GetPosition(), 5000, true);
@ -74,13 +93,16 @@ CCivilianPed::CivilianAI(void)
SetFindPathAndFlee(m_threatEntity, 5000); SetFindPathAndFlee(m_threatEntity, 5000);
if (threatDistSqr < sq(20.0f)) { if (threatDistSqr < sq(20.0f)) {
SetMoveState(PEDMOVE_RUN); SetMoveState(PEDMOVE_RUN);
Say(SOUND_PED_FLEE_SPRINT); bMakeFleeScream = true;
} else { } else {
SetMoveState(PEDMOVE_WALK); SetMoveState(PEDMOVE_WALK);
} }
} else if (threatPed->IsPlayer() && IsGangMember() && b158_80) {
SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, m_threatEntity);
} else if (threatPed->IsPlayer() && FindPlayerPed()->m_pWanted->m_CurrentCops != 0) { } else if (threatPed->IsPlayer() && FindPlayerPed()->m_pWanted->m_CurrentCops != 0) {
SetFindPathAndFlee(m_threatEntity, 5000); SetFindPathAndFlee(m_threatEntity, 5000);
if (threatDistSqr < sq(10.0f)) { if (threatDistSqr < sq(30.0f)) {
SetMoveState(PEDMOVE_RUN); SetMoveState(PEDMOVE_RUN);
} else { } else {
SetMoveState(PEDMOVE_WALK); SetMoveState(PEDMOVE_WALK);
@ -89,12 +111,12 @@ CCivilianPed::CivilianAI(void)
SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, m_threatEntity); SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, m_threatEntity);
} }
} else { } else {
if (threatDistSqr < sq(10.0f)) { if (threatDistSqr < sq(30.0f)) {
Say(SOUND_PED_FLEE_SPRINT); bMakeFleeScream = true;
SetFindPathAndFlee(m_threatEntity, 10000); SetFindPathAndFlee(m_threatEntity, 10000);
SetMoveState(PEDMOVE_SPRINT); SetMoveState(PEDMOVE_SPRINT);
} else { } else {
Say(SOUND_PED_FLEE_SPRINT); bMakeFleeScream = false;
SetFindPathAndFlee(m_threatEntity, 5000); SetFindPathAndFlee(m_threatEntity, 5000);
SetMoveState(PEDMOVE_RUN); SetMoveState(PEDMOVE_RUN);
} }
@ -103,7 +125,10 @@ CCivilianPed::CivilianAI(void)
SetLookTimer(500); SetLookTimer(500);
} else if (closestThreatFlag == PED_FLAG_DEADPEDS) { } else if (closestThreatFlag == PED_FLAG_DEADPEDS) {
float eventDistSqr = (m_pEventEntity->GetPosition() - GetPosition()).MagnitudeSqr2D(); float eventDistSqr = (m_pEventEntity->GetPosition() - GetPosition()).MagnitudeSqr2D();
if (((CPed*)m_pEventEntity)->bIsDrowning || IsGangMember() && m_nPedType == ((CPed*)m_pEventEntity)->m_nPedType) { if (CharCreatedBy == MISSION_CHAR && bCrouchWhenScared && eventDistSqr < sq(5.0f)) {
SetDuck(10000, true);
} else if (((CPed*)m_pEventEntity)->bIsDrowning || IsGangMember() && m_nPedType == ((CPed*)m_pEventEntity)->m_nPedType) {
if (eventDistSqr < sq(5.0f)) { if (eventDistSqr < sq(5.0f)) {
SetFindPathAndFlee(m_pEventEntity, 2000); SetFindPathAndFlee(m_pEventEntity, 2000);
SetMoveState(PEDMOVE_RUN); SetMoveState(PEDMOVE_RUN);
@ -128,8 +153,11 @@ CCivilianPed::CivilianAI(void)
} else if (closestThreatFlag == PED_FLAG_EXPLOSION) { } else if (closestThreatFlag == PED_FLAG_EXPLOSION) {
CVector2D eventDistVec = m_eventOrThreat - GetPosition(); CVector2D eventDistVec = m_eventOrThreat - GetPosition();
float eventDistSqr = eventDistVec.MagnitudeSqr(); float eventDistSqr = eventDistVec.MagnitudeSqr();
if (eventDistSqr < sq(20.0f)) { if (CharCreatedBy == MISSION_CHAR && bCrouchWhenScared && eventDistSqr < sq(20.0f)) {
Say(SOUND_PED_FLEE_SPRINT); SetDuck(10000, true);
} else if (eventDistSqr < sq(20.0f)) {
bMakeFleeScream = true;
SetFlee(m_eventOrThreat, 2000); SetFlee(m_eventOrThreat, 2000);
float angleToFace = CGeneral::GetRadianAngleBetweenPoints( float angleToFace = CGeneral::GetRadianAngleBetweenPoints(
m_eventOrThreat.x, m_eventOrThreat.y, m_eventOrThreat.x, m_eventOrThreat.y,
@ -154,8 +182,11 @@ CCivilianPed::CivilianAI(void)
if (m_threatEntity && m_threatEntity->IsPed()) { if (m_threatEntity && m_threatEntity->IsPed()) {
CPed *threatPed = (CPed*)m_threatEntity; CPed *threatPed = (CPed*)m_threatEntity;
if (m_pedStats->m_fear <= 100 - threatPed->m_pedStats->m_temper && threatPed->m_nPedType != PEDTYPE_COP) { if (m_pedStats->m_fear <= 100 - threatPed->m_pedStats->m_temper && threatPed->m_nPedType != PEDTYPE_COP) {
if (threatPed->GetWeapon(m_currentWeapon).IsTypeMelee() || !GetWeapon()->IsTypeMelee()) { if (threatPed->GetWeapon()->IsTypeMelee() || !GetWeapon()->IsTypeMelee()) {
if (threatPed->IsPlayer() && FindPlayerPed()->m_pWanted->m_CurrentCops != 0) { if (threatPed->IsPlayer() && IsGangMember() && b158_80) {
SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, m_threatEntity);
} else if (threatPed->IsPlayer() && FindPlayerPed()->m_pWanted->m_CurrentCops != 0) {
if (m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT || m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS) { if (m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT || m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS) {
SetFindPathAndFlee(m_threatEntity, 10000); SetFindPathAndFlee(m_threatEntity, 10000);
} }

File diff suppressed because it is too large Load Diff

View File

@ -455,17 +455,17 @@ public:
uint32 bTurnedAroundOnAttractor : 1; uint32 bTurnedAroundOnAttractor : 1;
uint32 bHasAlreadyUsedAttractor : 1; uint32 bHasAlreadyUsedAttractor : 1;
//uint32 b155_2 uint32 b155_2 : 1;
uint32 bCarPassenger : 1; uint32 bCarPassenger : 1;
//uint32 b155_8 uint32 b155_8 : 1;
//uint32 b155_10 uint32 b155_10 : 1;
uint32 bMiamiViceCop : 1; uint32 bMiamiViceCop : 1;
uint32 bMoneyHasBeenGivenByScript : 1; // uint32 bMoneyHasBeenGivenByScript : 1; //
uint32 bHasBeenPhotographed : 1; // uint32 bHasBeenPhotographed : 1; //
uint32 bIsDrowning : 1; uint32 bIsDrowning : 1;
uint32 bDrownsInWater : 1; uint32 bDrownsInWater : 1;
//uint32 b156_4 uint32 b156_4 : 1;
uint32 bHeldHostageInCar : 1; uint32 bHeldHostageInCar : 1;
uint32 bIsPlayerFriend : 1; uint32 bIsPlayerFriend : 1;
uint32 bHeadStuckInCollision : 1; uint32 bHeadStuckInCollision : 1;
@ -475,7 +475,7 @@ public:
uint32 bDontFight : 1; uint32 bDontFight : 1;
uint32 bDoomAim : 1; uint32 bDoomAim : 1;
uint32 bCanBeShotInVehicle : 1; uint32 bCanBeShotInVehicle : 1;
//uint32 b157_8 uint32 b157_8 : 1;
uint32 bMakeFleeScream : 1; uint32 bMakeFleeScream : 1;
uint32 bPushedAlongByCar : 1; uint32 bPushedAlongByCar : 1;
uint32 b157_40 : 1; uint32 b157_40 : 1;
@ -488,7 +488,7 @@ public:
uint32 bCollectBusFare : 1; uint32 bCollectBusFare : 1;
uint32 bBoughtIceCream : 1; uint32 bBoughtIceCream : 1;
uint32 b158_40 : 1; uint32 b158_40 : 1;
//uint32 b158_80 uint32 b158_80 : 1;
// our own flags // our own flags
uint32 m_ped_flagI80 : 1; // KANGAROO_CHEAT define makes use of this as cheat toggle uint32 m_ped_flagI80 : 1; // KANGAROO_CHEAT define makes use of this as cheat toggle
@ -566,10 +566,9 @@ public:
bool bInVehicle; bool bInVehicle;
float m_distanceToCountSeekDone; float m_distanceToCountSeekDone;
float m_acceptableHeadingOffset; float m_acceptableHeadingOffset;
CVehicle* m_vehicleInAccident;
CPedAttractor* m_attractor; CPedAttractor* m_attractor;
int32 m_positionInQueue; int32 m_positionInQueue;
CVehicle* m_vehicleInAccident;
bool bRunningToPhone; bool bRunningToPhone;
int16 m_phoneId; int16 m_phoneId;
eCrimeType m_crimeToReportOnPhone; eCrimeType m_crimeToReportOnPhone;
@ -635,14 +634,16 @@ public:
float m_attachRotStep; float m_attachRotStep;
uint32 m_attachWepAmmo; uint32 m_attachWepAmmo;
uint32 m_threatFlags; uint32 m_threatFlags;
uint32 m_threatCheck; uint32 m_threatCheckTimer;
uint32 m_lastThreatCheck; uint32 m_threatCheckInterval;
uint32 m_delayedSoundID; uint32 m_delayedSoundID;
uint32 m_delayedSoundTimer; uint32 m_delayedSoundTimer;
uint32 m_lastSoundStart; uint32 m_lastSoundStart;
uint32 m_soundStart; uint32 m_soundStart;
uint16 m_lastQueuedSound; uint16 m_lastQueuedSound;
uint16 m_queuedSound; uint16 m_queuedSound;
bool m_canTalk;
int32 m_lastComment;
CVector m_vecSeekPosEx; // used for OBJECTIVE_GUARD_SPOT CVector m_vecSeekPosEx; // used for OBJECTIVE_GUARD_SPOT
float m_distanceToCountSeekDoneEx; // used for OBJECTIVE_GUARD_SPOT float m_distanceToCountSeekDoneEx; // used for OBJECTIVE_GUARD_SPOT
@ -864,6 +865,7 @@ public:
void DriveVehicle(); void DriveVehicle();
void PositionAttachedPed(); void PositionAttachedPed();
bool CanUseTorsoWhenLooking(); bool CanUseTorsoWhenLooking();
void ScanForDelayedResponseThreats();
// Static methods // Static methods
static CVector GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float offset); static CVector GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float offset);

View File

@ -376,7 +376,7 @@ CPopulation::FindClosestZoneForCoors(CVector *coors, int *safeZoneOut, eLevelNam
} }
void void
CPopulation::Update() CPopulation::Update(bool addPeds)
{ {
if (!CReplay::IsPlayingBack()) { if (!CReplay::IsPlayingBack()) {
ManagePopulation(); ManagePopulation();
@ -392,7 +392,7 @@ CPopulation::Update()
ms_nTotalPeds = ms_nNumDummy + ms_nNumEmergency + ms_nNumCop ms_nTotalPeds = ms_nNumDummy + ms_nNumEmergency + ms_nNumCop
+ ms_nTotalGangPeds + ms_nNumCivFemale + ms_nNumCivMale; + ms_nTotalGangPeds + ms_nNumCivFemale + ms_nNumCivMale;
ms_nTotalPeds -= ms_nTotalCarPassengerPeds; ms_nTotalPeds -= ms_nTotalCarPassengerPeds;
if (!CCutsceneMgr::IsRunning()) { if (!CCutsceneMgr::IsRunning() && addPeds) {
float pcdm = PedCreationDistMultiplier(); float pcdm = PedCreationDistMultiplier();
AddToPopulation(pcdm * (MIN_CREATION_DIST * TheCamera.GenerationDistMultiplier), AddToPopulation(pcdm * (MIN_CREATION_DIST * TheCamera.GenerationDistMultiplier),
pcdm * ((MIN_CREATION_DIST + CREATION_RANGE) * TheCamera.GenerationDistMultiplier), pcdm * ((MIN_CREATION_DIST + CREATION_RANGE) * TheCamera.GenerationDistMultiplier),

View File

@ -66,7 +66,7 @@ public:
static uint32 NumMiamiViceCops; static uint32 NumMiamiViceCops;
static void Initialise(); static void Initialise();
static void Update(void); static void Update(bool);
static void LoadPedGroups(); static void LoadPedGroups();
static void UpdatePedCount(ePedType, bool); static void UpdatePedCount(ePedType, bool);
static void DealWithZoneChange(eLevelName oldLevel, eLevelName newLevel, bool); static void DealWithZoneChange(eLevelName oldLevel, eLevelName newLevel, bool);

View File

@ -29,7 +29,9 @@ bool gOccluderCoorsValid[8];
CVector gOccluderCoorsOnScreen[8]; CVector gOccluderCoorsOnScreen[8];
CVector gOccluderCoors[8]; CVector gOccluderCoors[8];
#ifndef MASTER
bool bDisplayOccDebugStuff; bool bDisplayOccDebugStuff;
#endif
void void
COcclusion::Init(void) COcclusion::Init(void)
@ -39,7 +41,9 @@ COcclusion::Init(void)
NearbyList = -1; NearbyList = -1;
ListWalkThroughFA = -1; ListWalkThroughFA = -1;
PreviousListWalkThroughFA = -1; PreviousListWalkThroughFA = -1;
#ifndef MASTER
bDisplayOccDebugStuff = false; bDisplayOccDebugStuff = false;
#endif
} }
void void
@ -436,6 +440,7 @@ bool COcclusion::IsPositionOccluded(CVector pos, float side) {
return false; return false;
} }
#ifndef MASTER
#include "Lines.h" #include "Lines.h"
RwIm2DVertex vertexbufferT[2]; RwIm2DVertex vertexbufferT[2];
@ -476,3 +481,4 @@ void COcclusion::Render() {
DefinedState(); DefinedState();
} }
#endif

View File

@ -49,10 +49,14 @@ public:
static bool OccluderHidesBehind(CActiveOccluder *occl1, CActiveOccluder *occl2); static bool OccluderHidesBehind(CActiveOccluder *occl1, CActiveOccluder *occl2);
static bool IsAABoxOccluded(CVector pos, float width, float length, float height); static bool IsAABoxOccluded(CVector pos, float width, float length, float height);
static bool IsPositionOccluded(CVector pos, float side); static bool IsPositionOccluded(CVector pos, float side);
#ifndef MASTER
static void Render(); static void Render();
#endif
}; };
bool CalcScreenCoors(CVector const &in, CVector *out, float *outw, float *outh); bool CalcScreenCoors(CVector const &in, CVector *out, float *outw, float *outh);
bool CalcScreenCoors(CVector const &in, CVector *out); bool CalcScreenCoors(CVector const &in, CVector *out);
#ifndef MASTER
extern bool bDisplayOccDebugStuff; extern bool bDisplayOccDebugStuff;
#endif

View File

@ -99,7 +99,7 @@ CPlayerSkin::GetSkinTexture(const char *texName)
CTxdStore::PopCurrentTxd(); CTxdStore::PopCurrentTxd();
if (tex != nil) return tex; if (tex != nil) return tex;
if (strcmp(DEFAULT_SKIN_NAME, texName) == 0) if (strcmp(DEFAULT_SKIN_NAME, texName) == 0 || texName[0] == '\0')
sprintf(gString, "models\\generic\\player.bmp"); sprintf(gString, "models\\generic\\player.bmp");
else else
sprintf(gString, "skins\\%s.bmp", texName); sprintf(gString, "skins\\%s.bmp", texName);

View File

@ -716,8 +716,10 @@ CameraCreate(RwInt32 width, RwInt32 height, RwBool zBuffer)
} }
#ifdef USE_TEXTURE_POOL #ifdef USE_TEXTURE_POOL
WRAPPER void _TexturePoolsInitialise() { EAXJMP(0x598B10); } WRAPPER void _TexturePoolsInitialise() { EAXJMP(0x6271E0); }
WRAPPER void _TexturePoolsShutdown() { EAXJMP(0x598B30); } WRAPPER void _TexturePoolsShutdown() { EAXJMP(0x627080); }
WRAPPER void _TexturePoolsFinalShutdown() { EAXJMP(0x626F80); }
WRAPPER void _TexturePoolsUnknown(bool) { EAXJMP(0x626F70); }
#endif #endif
#ifdef LIBRW #ifdef LIBRW