Changed the main to change if _XBOX is declared. Maybe a little not-with-standards,

but at least now an outside main is not necessary.
This commit is contained in:
Renaud Lepage
2004-07-20 15:53:36 +00:00
parent 1198d2d731
commit aaea3cb415
+11 -6
View File
@@ -903,11 +903,14 @@ static void ProcessArgsSecond()
NSMAN->DisplayStartupStatus(); //If we're using networking show what happend NSMAN->DisplayStartupStatus(); //If we're using networking show what happend
} }
#ifdef _XBOX
void __cdecl main(char* argv[])
#else
int main(int argc, char* argv[]) int main(int argc, char* argv[])
#endif
{ {
#ifdef _XBOX #ifdef _XBOX
argc = 1; int argc = 1;
argv = xboxargv;
XGetCustomLaunchData(); XGetCustomLaunchData();
#endif #endif
@@ -918,7 +921,6 @@ int main(int argc, char* argv[])
HOOKS = MakeArchHooks(); HOOKS = MakeArchHooks();
CString g_sErrorString = ""; CString g_sErrorString = "";
#if !defined(DEBUG) #if !defined(DEBUG)
/* Always catch RageExceptions; they should always have distinct strings. */ /* Always catch RageExceptions; they should always have distinct strings. */
try { /* RageException */ try { /* RageException */
@@ -935,6 +937,8 @@ int main(int argc, char* argv[])
#endif #endif
// Xbox : bug in the following
// Xbox : Detected with an endless loop placed to test if anything is reached.
/* Almost everything uses this to read and write files. Load this early. */ /* Almost everything uses this to read and write files. Load this early. */
FILEMAN = new RageFileManager( argv[0] ); FILEMAN = new RageFileManager( argv[0] );
FILEMAN->MountInitialFilesystems(); FILEMAN->MountInitialFilesystems();
@@ -985,6 +989,7 @@ int main(int argc, char* argv[])
// //
// Create game objects // Create game objects
// //
GAMESTATE = new GameState; GAMESTATE = new GameState;
/* This requires PREFSMAN, for PREFSMAN->m_bShowLoadingWindow. */ /* This requires PREFSMAN, for PREFSMAN->m_bShowLoadingWindow. */
@@ -1099,7 +1104,7 @@ int main(int argc, char* argv[])
PREFSMAN->SaveGlobalPrefsToDisk(); PREFSMAN->SaveGlobalPrefsToDisk();
SaveGamePrefsToDisk(); SaveGamePrefsToDisk();
#ifndef DEBUG #if !defined(DEBUG)
} }
catch( const RageException &e ) catch( const RageException &e )
{ {
@@ -1159,9 +1164,9 @@ int main(int argc, char* argv[])
#ifdef _XBOX #ifdef _XBOX
XReturnToLaunchingXBE(); XReturnToLaunchingXBE();
#endif #else
return 0; return 0;
#endif
} }
CString SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMakeSignature, int iIndex ) CString SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMakeSignature, int iIndex )