summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-12-04 01:12:58 +0100
committeraap <aap@papnet.eu>2020-12-04 01:12:58 +0100
commit9714a3776996d97e680cea575967a1d6041f5723 (patch)
tree0810bc2c542a9cf63b49ebbb0f6f6d37f0653755 /src/core
parentMerge branch 'master' of github.com:GTAmodding/re3 (diff)
downloadre3-9714a3776996d97e680cea575967a1d6041f5723.tar
re3-9714a3776996d97e680cea575967a1d6041f5723.tar.gz
re3-9714a3776996d97e680cea575967a1d6041f5723.tar.bz2
re3-9714a3776996d97e680cea575967a1d6041f5723.tar.lz
re3-9714a3776996d97e680cea575967a1d6041f5723.tar.xz
re3-9714a3776996d97e680cea575967a1d6041f5723.tar.zst
re3-9714a3776996d97e680cea575967a1d6041f5723.zip
Diffstat (limited to '')
-rw-r--r--src/core/Game.cpp47
-rw-r--r--src/core/main.cpp18
2 files changed, 48 insertions, 17 deletions
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index dfc13bb2..33302653 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -170,26 +170,39 @@ void ReplaceAtomicPipeCallback();
#endif // PS2_ALPHA_TEST
#endif // !LIBRW
-// missing altogether on PS2, mostly done in GameInit there it seems
bool
CGame::InitialiseRenderWare(void)
{
#ifdef USE_TEXTURE_POOL
_TexturePoolsInitialise();
#endif
-
- CTxdStore::Initialise();
- CVisibilityPlugins::Initialise();
-
+
+#if GTA_VERSION > GTA3_PS2_160
+ CTxdStore::Initialise(); // in GameInit on ps2
+ CVisibilityPlugins::Initialise(); // in plugin attach on ps2
+#endif
+
+ //InitialiseScene(Scene); // PS2 only, only clears Scene.camera
+
+#ifdef GTA_PS2
+ RpSkySelectTrueTSClipper(TRUE);
+ RpSkySelectTrueTLClipper(TRUE);
+
+ // PS2ManagerApplyDirectionalLightingCB() uploads the GTA lights
+ // directly without going through RpWorld and all that
+ SetupPS2ManagerDefaultLightingCallback();
+ PreAllocateRwObjects();
+#endif
+
/* Create camera */
- Scene.camera = CameraCreate(RsGlobal.width, RsGlobal.height, TRUE);
+ Scene.camera = CameraCreate(SCREEN_WIDTH, SCREEN_HEIGHT, TRUE);
ASSERT(Scene.camera != nil);
if (!Scene.camera)
{
return (false);
}
- RwCameraSetFarClipPlane(Scene.camera, 2000.0f);
+ RwCameraSetFarClipPlane(Scene.camera, 2000.0f); // 250.0f on PS2 but who cares
RwCameraSetNearClipPlane(Scene.camera, 0.9f);
CameraSize(Scene.camera, nil, DEFAULT_VIEWWINDOW, DEFAULT_ASPECT_RATIO);
@@ -212,8 +225,12 @@ CGame::InitialiseRenderWare(void)
/* Add the camera to the world */
RpWorldAddCamera(Scene.world, Scene.camera);
LightsCreate(Scene.world);
-
- CreateDebugFont();
+
+#if GTA_VERSION > GTA3_PS2_160
+ CreateDebugFont(); // in GameInit on PS2
+#else
+ RwImageSetPath("textures");
+#endif
#ifdef LIBRW
#ifdef PS2_MATFX
@@ -229,9 +246,16 @@ CGame::InitialiseRenderWare(void)
ReplaceAtomicPipeCallback();
#endif // PS2_ALPHA_TEST
#endif // LIBRW
-
+
+
+#if GTA_VERSION > GTA3_PS2_160
+ // in GameInit on PS2
+ PUSH_MEMID(MEMID_TEXTURES);
CFont::Initialise();
CHud::Initialise();
+ POP_MEMID();
+#endif
+ // TODO: define
CPlayerSkin::Initialise();
return (true);
@@ -247,7 +271,8 @@ void CGame::ShutdownRenderWare(void)
for ( int32 i = 0; i < NUMPLAYERS; i++ )
CWorld::Players[i].DeletePlayerSkin();
-
+
+ // TODO: define
CPlayerSkin::Shutdown();
DestroyDebugFont();
diff --git a/src/core/main.cpp b/src/core/main.cpp
index ebfa096a..54821979 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -114,7 +114,7 @@ void DebugMenuPopulate(void);
bool gbPrintMemoryUsage;
#endif
-#ifdef GTA_PS2
+#ifdef PS2_MENU
#define WANT_TO_LOAD TheMemoryCard.m_bWantToLoad
#define FOUND_GAME_TO_LOAD TheMemoryCard.b_FoundRecentSavedGameWantToLoad
#else
@@ -415,7 +415,6 @@ PluginAttach(void)
return TRUE;
}
-// rather different on PS2
static RwBool
Initialise3D(void *param)
{
@@ -1766,7 +1765,7 @@ void SystemInit()
#ifdef GTA_PS2
CFileMgr::InitCd();
- Char modulepath[256];
+ char modulepath[256];
strcpy(modulepath, "cdrom0:\\");
strcat(modulepath, "SYSTEM\\");
@@ -1989,7 +1988,7 @@ void GameInit()
CreateDebugFont();
#ifdef GTA_PS2
- AddIntcHandler(_TODOCONST(2), VBlankCounter, 0);
+ AddIntcHandler(INTC_VBLANK_S, VBlankCounter, 0);
#endif
CameraSize(Scene.camera, NULL, DEFAULT_VIEWWINDOW, DEFAULT_ASPECT_RATIO);
@@ -2031,8 +2030,7 @@ main(int argc, char *argv[])
#ifdef GTA_PS2
int32 r = TheMemoryCard.CheckCardStateAtGameStartUp(CARD_ONE);
- if ( r == CMemoryCard::ERR_DIRNOENTRY || r == CMemoryCard::ERR_NOFORMAT
- && r != CMemoryCard::ERR_OPENNOENTRY && r != CMemoryCard::ERR_NONE )
+ if ( r == CMemoryCard::ERR_DIRNOENTRY || r == CMemoryCard::ERR_NOFORMAT )
{
GameInit();
@@ -2042,6 +2040,8 @@ main(int argc, char *argv[])
CFont::Initialise();
FrontEndMenuManager.DrawMemoryCardStartUpMenus();
+ }else if(r == CMemoryCard::ERR_OPENNOENTRY || r == CMemoryCard::ERR_NONE){
+ // eh?
}
#endif
@@ -2052,12 +2052,18 @@ main(int argc, char *argv[])
InitMPEGPlayer();
+#ifdef GTA_PAL
PlayMPEG("cdrom0:\\MOVIES\\DMAPAL.PSS;1", false);
if (CGame::frenchGame || CGame::germanGame)
PlayMPEG("cdrom0:\\MOVIES\\INTROPAF.PSS;1", true);
else
PlayMPEG("cdrom0:\\MOVIES\\INTROPAL.PSS;1", true);
+#else
+ PlayMPEG("cdrom0:\\MOVIES\\DMANTSC.PSS;1", false);
+
+ PlayMPEG("cdrom0:\\MOVIES\\INTRNTSC.PSS;1", true);
+#endif
ShutdownMPEGPlayer();