Exemplo n.º 1
0
int Engine_init()
{
	if (Graphics_init() != 0)
		BREAK_ERROR;

	if (Timer_init() != 0)
		BREAK_ERROR;

	if (Logic_init() != 0)
		BREAK_ERROR;
		
	if (Physics_init() != 0)
		BREAK_ERROR;
		
	if (Input_init() != 0)
		BREAK_ERROR;
		
	theworld = WorldObject_new();
	World_setWorldObject(theworld);	
		
	done = 0;

	initialize = 1;
	return 0;
}
Exemplo n.º 2
0
Arquivo: acme.c Projeto: Jedzia/acm3
// guess what
int main(int argc, const char *argv[]) {
	// if called without any arguments, show usage info (not full help)
	if(argc == 1)
		show_help_and_exit();
	msg_stream = stderr;
	cliargs_init(argc, argv);
	DynaBuf_init();// inits *global* dynamic buffer - important, so first
	// Init platform-specific stuff.
	// For example, this could read the library path from an
	// environment variable, which in turn may need DynaBuf already.
	PLATFORM_INIT;
	// init some keyword trees needed for argument handling
	CPUtype_init();
	Outputfile_init();
	// handle command line arguments
	cliargs_handle_options(short_option, long_option);
	// generate list of files to process
	cliargs_get_rest(&toplevel_src_count, &toplevel_sources,
		"No top level sources given");
	// Init modules (most of them will just build keyword trees)
	ALU_init();
	Basics_init();
	CPU_init();
	Encoding_init();
	Flow_init();
	Input_init();
	Label_init();
	Macro_init();
	Mnemo_init();
	Output_init(fill_value);
	Section_init();
	if(do_actual_work())
		save_output_file();
	return(ACME_finalize(EXIT_SUCCESS));	// dump labels, if wanted
}