Ejemplo n.º 1
0
int main (int argc, char *argv[ ], char *envp[ ])

//	main
//
//	main entry-point

	{
	if (!kernelInit())
		{
		printf("error : Unable to initialize Alchemy kernel.\n");
		return 1;
		}

	//	Do it

	{
	ALERROR error;
	CXMLElement *pCmdLine;
	if (error = CreateXMLElementFromCommandLine(argc, argv, &pCmdLine))
		{
		printf("error : Invalid command line.\n");
		kernelCleanUp();
		return 1;
		}

	TransCompiler(pCmdLine);

	delete pCmdLine;
	}

	//	Done

	kernelCleanUp();
	return 0;
	}
Ejemplo n.º 2
0
ALERROR CGameSettings::ParseCommandLine (char *pszCmdLine)

//	ParseCommandLine
//
//	Allow command line to override settings

	{
	ALERROR error;
	int i;

	char *argv[2];
	argv[0] = "Transcendence";
	argv[1] = pszCmdLine;
	CXMLElement *pCmdLine;
	if (error = CreateXMLElementFromCommandLine(2, argv, &pCmdLine))
		return error;

	//	Loop over all command line arguments

	for (i = 0; i < COMMAND_LINE_DATA_COUNT; i++)
		{
		bool bValue;
		if (pCmdLine->FindAttributeBool(CString(g_CommandLineData[i].pszParam, -1, true), &bValue))
			SetValueBoolean(g_CommandLineData[i].iOption, bValue);
		}

	//	If we have an arg then use it as the save file name

	if (pCmdLine->GetContentElementCount() > 0)
		m_sSaveFile = pCmdLine->GetContentText(0);

	//	Done

	delete pCmdLine;

	return NOERROR;
	}
Ejemplo n.º 3
0
int main (int argc, char *argv[ ], char *envp[ ])

//	main
//
//	main entry-point

	{
	int iResult;

	if (!kernelInit())
		{
		printf("ccshell: Unable to initialize Alchemy kernel.\n");
		return 1;
		}

	//	Do it

	{
	ALERROR error;
	CXMLElement *pCmdLine;
	if (error = CreateXMLElementFromCommandLine(argc, argv, &pCmdLine))
		{
		PrintError(ERR_UNABLE_TO_PARSE_COMMAND_LINE);
		return 1;
		}

	iResult = AlchemyMain(pCmdLine);

	delete pCmdLine;
	}

	//	Done

	kernelCleanUp();
	return iResult;
	}
Ejemplo n.º 4
0
static void ParseCommandLine (char *pszCmdLine, SCommandLineOptions *retOptions)

//	ParseCommandLine
//
//	Parses the command line
//
//	/debug				Use debug ship and starting system
//	/windowed			Run in windowed mode (as opposed to full screen)
//	/nosound			No music or sound
//	/nolog				Do not output Debug.log
//	/useTDB				Use Transcendence.tdb instead of .xml
//	/debugVideo			Output debug info on video system
//	/debugNonExclusive	No exclusive mode in DirectX
//	/debugManualBlt		Do not use DirectX to blt to screen buffer

	{
	ALERROR error;

	//	Initialize defaults (in case of error parsing, we still end up
	//	with valid values).

	memset(retOptions, 0, sizeof(SCommandLineOptions));

	//	Parse

	char *argv[2];
	argv[0] = "Transcendence";
	argv[1] = pszCmdLine;
	CXMLElement *pCmdLine;
	if ((error = CreateXMLElementFromCommandLine(2, argv, &pCmdLine)))
		return;

	//	If we're in debug mode then there are various game changes

	if (pCmdLine->GetAttributeBool(CONSTLIT("debug")))
		{
		retOptions->bDebugMode = true;
		retOptions->bDebugGame = true;
		}

	//	Turn debug log off

	if (pCmdLine->GetAttributeBool(CONSTLIT("nolog")))
		retOptions->bNoDebugLog = true;

	//	No sound

	if (pCmdLine->GetAttributeBool(CONSTLIT("nosound")))
		retOptions->bNoSound = true;

	//	Debug video problems

	if (pCmdLine->GetAttributeBool(CONSTLIT("debugVideo")))
		retOptions->bDebugVideo = true;

	if (pCmdLine->GetAttributeBool(CONSTLIT("debugNonExclusive")))
		retOptions->bDebugNonExclusive = true;

	if (pCmdLine->GetAttributeBool(CONSTLIT("debugManualBlt")))
		retOptions->bDebugManualBlt = true;

	if (pCmdLine->GetAttributeBool(CONSTLIT("dx")))
		retOptions->bDirectX = true;

	if (pCmdLine->GetAttributeBool(CONSTLIT("windowed")))
		retOptions->bWindowedMode = true;

	if (pCmdLine->GetAttributeBool(CONSTLIT("useTDB")))
		retOptions->bUseTDB = true;

	delete pCmdLine;
	}