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

some PS2 things

This commit is contained in:
aap 2020-12-20 14:27:48 +01:00
parent be92b57b54
commit fc312113d2
4 changed files with 32 additions and 19 deletions

View file

@ -191,8 +191,6 @@ CGame::InitialiseRenderWare(void)
CTxdStore::Initialise(); CTxdStore::Initialise();
CVisibilityPlugins::Initialise(); CVisibilityPlugins::Initialise();
//InitialiseScene(Scene); // PS2 only, only clears Scene.camera
#ifdef GTA_PS2 #ifdef GTA_PS2
RpSkySelectTrueTSClipper(TRUE); RpSkySelectTrueTSClipper(TRUE);
RpSkySelectTrueTLClipper(TRUE); RpSkySelectTrueTLClipper(TRUE);
@ -255,14 +253,12 @@ CGame::InitialiseRenderWare(void)
PUSH_MEMID(MEMID_TEXTURES); PUSH_MEMID(MEMID_TEXTURES);
CFont::Initialise(); CFont::Initialise();
CHud::Initialise(); CHud::Initialise();
POP_MEMID();
CPlayerSkin::Initialise(); CPlayerSkin::Initialise();
POP_MEMID();
return (true); return (true);
} }
// missing altogether on PS2
void CGame::ShutdownRenderWare(void) void CGame::ShutdownRenderWare(void)
{ {
DestroySplashScreen(); DestroySplashScreen();
@ -272,7 +268,6 @@ void CGame::ShutdownRenderWare(void)
for ( int32 i = 0; i < NUMPLAYERS; i++ ) for ( int32 i = 0; i < NUMPLAYERS; i++ )
CWorld::Players[i].DeletePlayerSkin(); CWorld::Players[i].DeletePlayerSkin();
// TODO: define
CPlayerSkin::Shutdown(); CPlayerSkin::Shutdown();
DestroyDebugFont(); DestroyDebugFont();
@ -295,7 +290,6 @@ void CGame::ShutdownRenderWare(void)
#endif #endif
} }
// missing altogether on PS2
bool CGame::InitialiseOnceAfterRW(void) bool CGame::InitialiseOnceAfterRW(void)
{ {
TheText.Load(); TheText.Load();
@ -305,7 +299,12 @@ bool CGame::InitialiseOnceAfterRW(void)
CSurfaceTable::Initialise("DATA\\SURFACE.DAT"); CSurfaceTable::Initialise("DATA\\SURFACE.DAT");
CPedStats::Initialise(); CPedStats::Initialise();
CTimeCycle::Initialise(); CTimeCycle::Initialise();
#ifdef GTA_PS2
LoadingScreen("Loading the Game", "Initialising audio", GetRandomSplashScreen());
#endif
DMAudio.Initialise(); DMAudio.Initialise();
#ifndef GTA_PS2
if ( DMAudio.GetNum3DProvidersAvailable() == 0 ) if ( DMAudio.GetNum3DProvidersAvailable() == 0 )
FrontEndMenuManager.m_nPrefsAudio3DProviderIndex = NO_AUDIO_PROVIDER; FrontEndMenuManager.m_nPrefsAudio3DProviderIndex = NO_AUDIO_PROVIDER;
@ -322,10 +321,10 @@ 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);
#endif
return true; return true;
} }
// missing altogether on PS2
void void
CGame::FinalShutdown(void) CGame::FinalShutdown(void)
{ {
@ -336,12 +335,13 @@ CGame::FinalShutdown(void)
bool CGame::Initialise(const char* datFile) bool CGame::Initialise(const char* datFile)
{ {
ResetLoadingScreenBar();
strcpy(aDatFile, datFile);
#ifdef GTA_PS2 #ifdef GTA_PS2
// TODO: upload VU0 collision code here // TODO: upload VU0 collision code here
#endif #endif
ResetLoadingScreenBar();
strcpy(aDatFile, datFile);
CPools::Initialise(); CPools::Initialise();
#ifndef GTA_PS2 #ifndef GTA_PS2
@ -408,9 +408,8 @@ bool CGame::Initialise(const char* datFile)
CCarCtrl::Init(); CCarCtrl::Init();
POP_MEMID(); POP_MEMID();
InitModelIndices();
PUSH_MEMID(MEMID_DEF_MODELS); PUSH_MEMID(MEMID_DEF_MODELS);
InitModelIndices();
CModelInfo::Initialise(); CModelInfo::Initialise();
CPickups::Init(); CPickups::Init();
CTheCarGenerators::Init(); CTheCarGenerators::Init();
@ -428,17 +427,21 @@ bool CGame::Initialise(const char* datFile)
CVehicleModelInfo::LoadVehicleColours(); CVehicleModelInfo::LoadVehicleColours();
CVehicleModelInfo::LoadEnvironmentMaps(); CVehicleModelInfo::LoadEnvironmentMaps();
CTheZones::PostZoneCreation(); CTheZones::PostZoneCreation();
POP_MEMID();
LoadingScreen("Loading the Game", "Setup paths", nil); 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();
CWorld::Players[0].LoadPlayerSkin(); CWorld::Players[0].LoadPlayerSkin();
TestModelIndices(); TestModelIndices();
LoadingScreen("Loading the Game", "Setup water", nil); LoadingScreen("Loading the Game", "Setup water", nil);
WaterLevelInitialise("DATA\\WATER.DAT"); WaterLevelInitialise("DATA\\WATER.DAT");
TheConsole.Init(); TheConsole.Init();
CDraw::SetFOV(120.0f); CDraw::SetFOV(120.0f);
CDraw::ms_fLODDistance = 500.0f; CDraw::ms_fLODDistance = 500.0f;
LoadingScreen("Loading the Game", "Setup streaming", nil); LoadingScreen("Loading the Game", "Setup streaming", nil);
CStreaming::LoadInitialVehicles(); CStreaming::LoadInitialVehicles();
CStreaming::LoadInitialPeds(); CStreaming::LoadInitialPeds();
@ -446,10 +449,12 @@ bool CGame::Initialise(const char* datFile)
CStreaming::LoadAllRequestedModels(false); CStreaming::LoadAllRequestedModels(false);
CStreaming::RemoveIslandsNotUsed(currLevel); 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());
PUSH_MEMID(MEMID_ANIMATION); PUSH_MEMID(MEMID_ANIMATION);
CAnimManager::LoadAnimFiles(); CAnimManager::LoadAnimFiles();
POP_MEMID();
CStreaming::LoadInitialWeapons(); CStreaming::LoadInitialWeapons();
CStreaming::LoadAllRequestedModels(0); CStreaming::LoadAllRequestedModels(0);
CPed::Initialise(); CPed::Initialise();
@ -483,6 +488,7 @@ bool CGame::Initialise(const char* datFile)
#ifdef GTA_SCENE_EDIT #ifdef GTA_SCENE_EDIT
CSceneEdit::Initialise(); CSceneEdit::Initialise();
#endif #endif
LoadingScreen("Loading the Game", "Load scripts", nil); LoadingScreen("Loading the Game", "Load scripts", nil);
PUSH_MEMID(MEMID_SCRIPT); PUSH_MEMID(MEMID_SCRIPT);
CTheScripts::Init(); CTheScripts::Init();
@ -514,11 +520,11 @@ bool CGame::Initialise(const char* datFile)
CRecordDataForChase::Init(); CRecordDataForChase::Init();
CReplay::Init(); CReplay::Init();
LoadingScreen("Loading the Game", "Start script", nil);
#ifdef PS2_MENU #ifdef PS2_MENU
if ( !TheMemoryCard.m_bWantToLoad ) if ( !TheMemoryCard.m_bWantToLoad )
#endif #endif
{ {
LoadingScreen("Loading the Game", "Start script", nil);
CTheScripts::StartTestScript(); CTheScripts::StartTestScript();
CTheScripts::Process(); CTheScripts::Process();
TheCamera.Process(); TheCamera.Process();
@ -801,9 +807,9 @@ void CGame::Process(void)
#endif #endif
CCutsceneMgr::Update(); CCutsceneMgr::Update();
PUSH_MEMID(MEMID_FRONTEND);
if (!CCutsceneMgr::IsCutsceneProcessing() && !CTimer::GetIsCodePaused()) if (!CCutsceneMgr::IsCutsceneProcessing() && !CTimer::GetIsCodePaused())
FrontEndMenuManager.Process(); FrontEndMenuManager.Process();
CTheZones::Update(); CTheZones::Update();
// DRM call in here // DRM call in here
uint32 startTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond(); uint32 startTime = CTimer::GetCurrentTimeInCycles() / CTimer::GetCyclesPerMillisecond();
@ -884,11 +890,13 @@ void CGame::Process(void)
gPhoneInfo.Update(); gPhoneInfo.Update();
if (!CReplay::IsPlayingBack()) if (!CReplay::IsPlayingBack())
{ {
PUSH_MEMID(MEMID_CARS);
if (processTime < 2) if (processTime < 2)
CCarCtrl::GenerateRandomCars(); CCarCtrl::GenerateRandomCars();
CRoadBlocks::GenerateRoadBlocks(); CRoadBlocks::GenerateRoadBlocks();
CCarCtrl::RemoveDistantCars(); CCarCtrl::RemoveDistantCars();
CCarCtrl::RemoveCarsIfThePoolGetsFull(); CCarCtrl::RemoveCarsIfThePoolGetsFull();
POP_MEMID();
} }
} }
#ifdef GTA_PS2 #ifdef GTA_PS2
@ -898,6 +906,8 @@ void CGame::Process(void)
#ifdef USE_CUSTOM_ALLOCATOR #ifdef USE_CUSTOM_ALLOCATOR
// TODO(MIAMI)
int32 gNumMemMoved; int32 gNumMemMoved;
bool bool

View file

@ -465,8 +465,11 @@ PreAllocateRwObjects(void)
static RwBool static RwBool
Initialise3D(void *param) Initialise3D(void *param)
{ {
PUSH_MEMID(MEMID_RENDER);
if (RsRwInitialize(param)) if (RsRwInitialize(param))
{ {
POP_MEMID();
#ifdef DEBUGMENU #ifdef DEBUGMENU
DebugMenuInit(); DebugMenuInit();
DebugMenuPopulate(); DebugMenuPopulate();
@ -485,8 +488,10 @@ Initialise3D(void *param)
#ifdef SCREEN_DROPLETS #ifdef SCREEN_DROPLETS
ScreenDroplets::InitDraw(); ScreenDroplets::InitDraw();
#endif #endif
return ret; return ret;
} }
POP_MEMID();
return (FALSE); return (FALSE);
} }

View file

@ -76,6 +76,7 @@ LoadPlayerDff(void)
void void
CPlayerSkin::Initialise(void) CPlayerSkin::Initialise(void)
{ {
// empty on PS2
m_txdSlot = CTxdStore::AddTxdSlot("skin"); m_txdSlot = CTxdStore::AddTxdSlot("skin");
CTxdStore::Create(m_txdSlot); CTxdStore::Create(m_txdSlot);
CTxdStore::AddRef(m_txdSlot); CTxdStore::AddRef(m_txdSlot);
@ -84,6 +85,7 @@ CPlayerSkin::Initialise(void)
void void
CPlayerSkin::Shutdown(void) CPlayerSkin::Shutdown(void)
{ {
// empty on PS2
CTxdStore::RemoveTxdSlot(m_txdSlot); CTxdStore::RemoveTxdSlot(m_txdSlot);
} }

View file

@ -307,8 +307,6 @@ RsRwInitialize(void *displayID)
{ {
RwEngineOpenParams openParams; RwEngineOpenParams openParams;
PUSH_MEMID(MEMID_RENDER); // NB: not popped on failed return
/* /*
* Start RenderWare... * Start RenderWare...
*/ */
@ -376,8 +374,6 @@ RsRwInitialize(void *displayID)
RwTextureSetAutoMipmapping(TRUE); RwTextureSetAutoMipmapping(TRUE);
RwTextureSetMipmapping(FALSE); RwTextureSetMipmapping(FALSE);
POP_MEMID();
return TRUE; return TRUE;
} }