move Xbox hacks into archutils

This commit is contained in:
Chris Danford
2006-01-20 08:59:54 +00:00
parent 726fa7a8dd
commit a77fc07879
2 changed files with 6 additions and 73 deletions
+1 -14
View File
@@ -880,17 +880,8 @@ static void ApplyLogPreferences()
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[])
#endif
{
#if defined(XBOX)
int argc = 1;
char *argv[] = {"default.xbe"};
#endif
{
RageThreadRegister thread( "Main thread" );
RageException::SetCleanupHandler( HandleException );
@@ -933,9 +924,7 @@ int main(int argc, char* argv[])
if( !g_bAllowMultipleInstances.Get() && HOOKS->CheckForMultipleInstances() )
{
ShutdownGame();
#if !defined(XBOX)
return 0;
#endif
}
ApplyLogPreferences();
@@ -1113,9 +1102,7 @@ int main(int argc, char* argv[])
}
#endif
#ifndef _XBOX
return 0;
#endif
}
CString StepMania::SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMakeSignature, int iIndex )
+5 -59
View File
@@ -1,68 +1,14 @@
#include "global.h"
#include "arch_setup.h"
#ifdef _WINDOWS
# include <windows.h>
#endif
#if defined(WINDOWS)
/* 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 )
void __cdecl main()
{
char *pCmdLine = GetCommandLine();
int argc = 0;
argv = NULL;
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 argc = 1;
char *argv[] = {"default.xbe"};
int ret = main( argc, argv );
}
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.
*
* Permission is hereby granted, free of charge, to any person obtaining a