move Xbox hacks into archutils
This commit is contained in:
@@ -880,17 +880,8 @@ static void ApplyLogPreferences()
|
|||||||
|
|
||||||
static LocalizedString COULDNT_OPEN_LOADING_WINDOW( "StepMania", "Couldn't open any loading windows." );
|
static LocalizedString COULDNT_OPEN_LOADING_WINDOW( "StepMania", "Couldn't open any loading windows." );
|
||||||
|
|
||||||
#ifdef _XBOX
|
|
||||||
void __cdecl main()
|
|
||||||
#else
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#if defined(XBOX)
|
|
||||||
int argc = 1;
|
|
||||||
char *argv[] = {"default.xbe"};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
RageThreadRegister thread( "Main thread" );
|
RageThreadRegister thread( "Main thread" );
|
||||||
RageException::SetCleanupHandler( HandleException );
|
RageException::SetCleanupHandler( HandleException );
|
||||||
|
|
||||||
@@ -933,9 +924,7 @@ int main(int argc, char* argv[])
|
|||||||
if( !g_bAllowMultipleInstances.Get() && HOOKS->CheckForMultipleInstances() )
|
if( !g_bAllowMultipleInstances.Get() && HOOKS->CheckForMultipleInstances() )
|
||||||
{
|
{
|
||||||
ShutdownGame();
|
ShutdownGame();
|
||||||
#if !defined(XBOX)
|
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplyLogPreferences();
|
ApplyLogPreferences();
|
||||||
@@ -1113,9 +1102,7 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _XBOX
|
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CString StepMania::SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMakeSignature, int iIndex )
|
CString StepMania::SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMakeSignature, int iIndex )
|
||||||
|
|||||||
@@ -1,68 +1,14 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "arch_setup.h"
|
|
||||||
#ifdef _WINDOWS
|
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(WINDOWS)
|
void __cdecl main()
|
||||||
/* Ugh. Windows doesn't give us the argv[] parser; all it gives is CommandLineToArgvW,
|
|
||||||
* which is NT-only, so we have to do this ourself. Don't be fancy; only handle double
|
|
||||||
* quotes. */
|
|
||||||
int GetWin32CmdLine( char** &argv )
|
|
||||||
{
|
{
|
||||||
char *pCmdLine = GetCommandLine();
|
int argc = 1;
|
||||||
int argc = 0;
|
char *argv[] = {"default.xbe"};
|
||||||
argv = NULL;
|
int ret = main( argc, argv );
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
while( pCmdLine[i] )
|
|
||||||
{
|
|
||||||
argv = (char **) realloc( argv, (argc+1) * sizeof(char *) );
|
|
||||||
argv[argc] = pCmdLine+i;
|
|
||||||
++argc;
|
|
||||||
|
|
||||||
/* Skip to the end of this argument. */
|
|
||||||
while( pCmdLine[i] && pCmdLine[i] != ' ' )
|
|
||||||
{
|
|
||||||
if( pCmdLine[i] == '"' )
|
|
||||||
{
|
|
||||||
/* Erase the quote. */
|
|
||||||
memmove( pCmdLine+i, pCmdLine+i+1, strlen(pCmdLine+i+1)+1 );
|
|
||||||
|
|
||||||
/* Skip to the close quote. */
|
|
||||||
while( pCmdLine[i] && pCmdLine[i] != '"' )
|
|
||||||
++i;
|
|
||||||
|
|
||||||
/* Erase the close quote. */
|
|
||||||
if( pCmdLine[i] == '"' )
|
|
||||||
memmove( pCmdLine+i, pCmdLine+i+1, strlen(pCmdLine+i+1)+1 );
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( pCmdLine[i] == ' ' )
|
|
||||||
{
|
|
||||||
pCmdLine[i] = '\0';
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return argc;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main( int argc, char* argv[] );
|
|
||||||
int __stdcall WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, char *pCmdLine, int nCmdShow )
|
|
||||||
{
|
|
||||||
char **argv;
|
|
||||||
int argc = GetWin32CmdLine( argv );
|
|
||||||
|
|
||||||
return main( argc, argv );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2004 Glenn Maynard
|
* (c) 2006 Chris
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
|||||||
Reference in New Issue
Block a user