Exemplo n.º 1
0
//Initializes the (global) scripting system, as well as any subsystems.
//script_close is handled by destructors
void script_init(void)
{
	mprintf(("SCRIPTING: Beginning initialization sequence...\n"));

	mprintf(("SCRIPTING: Beginning Lua initialization...\n"));
	Script_system.CreateLuaState();

	if (Output_scripting_meta)
	{
		mprintf(("SCRIPTING: Outputting scripting metadata...\n"));
		char cmdname[MAX_PATH_LEN];
		memset(cmdname, 0, sizeof(cmdname));
		snprintf(cmdname, MAX_PATH_LEN - 1, "%s%s%s%s%s%s%s", detect_home(), DIR_SEPARATOR_STR, Osreg_company_name,
			DIR_SEPARATOR_STR, Osreg_user_dir, DIR_SEPARATOR_STR, "scripting.html");

		Script_system.OutputMeta(cmdname);
	}
	mprintf(("SCRIPTING: Beginning main hook parse sequence....\n"));
	script_parse_table("scripting.tbl");
	parse_modular_table(NOX("*-sct.tbm"), script_parse_table);
	mprintf(("SCRIPTING: Inititialization complete.\n"));
}
Exemplo n.º 2
0
//Initializes the (global) scripting system, as well as any subsystems.
//script_close is handled by destructors
void script_init()
{
	mprintf(("SCRIPTING: Beginning initialization sequence...\n"));

	// first things first: init all script hooks, since they are PODs now, not classes...
	script_hook_init(&Script_splashhook);
	script_hook_init(&Script_simulationhook);
	script_hook_init(&Script_hudhook);
	script_hook_init(&Script_globalhook);
	script_hook_init(&Script_gameinithook);

	mprintf(("SCRIPTING: Beginning Lua initialization...\n"));
	Script_system.CreateLuaState();

	if(Output_scripting_meta)
	{
		mprintf(("SCRIPTING: Outputting scripting metadata...\n"));
		Script_system.OutputMeta("scripting.html");
	}
	mprintf(("SCRIPTING: Beginning main hook parse sequence....\n"));
	script_parse_table("scripting.tbl");
	parse_modular_table(NOX("*-sct.tbm"), script_parse_table);
	mprintf(("SCRIPTING: Inititialization complete.\n"));
}