Example #1
0
/**
**  Initialize ccl and load the config file(s).
*/
void InitCcl(void)
{
	InitLua();

	lua_register(Lua, "CompileFeature", CclGetCompileFeature);
	lua_register(Lua, "LibraryPath", CclStratagusLibraryPath);
	lua_register(Lua, "ListDirectory", CclListDirectory);
	lua_register(Lua, "ListFilesInDirectory", CclListFilesInDirectory);
	lua_register(Lua, "ListDirsInDirectory", CclListDirsInDirectory);
	lua_register(Lua, "SetLocalPlayerName", CclSetLocalPlayerName);
	lua_register(Lua, "GetLocalPlayerName", CclGetLocalPlayerName);
	lua_register(Lua, "SetGodMode", CclSetGodMode);
	lua_register(Lua, "GetGodMode", CclGetGodMode);

	lua_register(Lua, "SetSpeedBuild", CclSetSpeedBuild);
	lua_register(Lua, "GetSpeedBuild", CclGetSpeedBuild);
	lua_register(Lua, "SetSpeedTrain", CclSetSpeedTrain);
	lua_register(Lua, "GetSpeedTrain", CclGetSpeedTrain);
	lua_register(Lua, "SetSpeeds", CclSetSpeeds);

	lua_register(Lua, "DefineDefaultResourceNames", CclDefineDefaultResourceNames);
	lua_register(Lua, "DefineDefaultDisplayResourceNames", CclDefineDefaultDisplayResourceNames);
	lua_register(Lua, "NoRandomPlacementMultiplayer", CclNoRandomPlacementMultiplayer);

	lua_register(Lua, "SavePreferences", CclSavePreferences);
	lua_register(Lua, "Load", CclLoad);
	lua_register(Lua, "LoadBuffer", CclLoadBuffer);
	lua_register(Lua, "GetCurrentLuaPath", CclGetCurrentLuaPath);
	lua_register(Lua, "SavedGameInfo", CclSavedGameInfo);

	ReplayCclRegister();
	IconCclRegister();
	MissileCclRegister();
	PlayerCclRegister();
	MapCclRegister();
	ConstructionCclRegister();
	DecorationCclRegister();
	UnitTypeCclRegister();
	UpgradesCclRegister();
	SelectionCclRegister();
	GroupCclRegister();
	UnitCclRegister();
	SoundCclRegister();
	UserInterfaceCclRegister();
	AiCclRegister();
	TriggerCclRegister();
	SpellCclRegister();
}
Example #2
0
/**
**	Called from scheme.
*/
local void gh_main_prog(int argc,char* argv[])
{
    gh_new_procedure0_0("clone-library-path",CclCloneLibraryPath);
    gh_new_procedure1_0("title-screen",CclTitleScreen);

    gh_new_procedure5_0("mana-sprite",CclManaSprite);
    gh_new_procedure5_0("health-sprite",CclHealthSprite);
    gh_new_procedure0_0("show-health-bar",CclShowHealthBar);
    gh_new_procedure0_0("show-health-dot",CclShowHealthDot);
    gh_new_procedure0_0("show-mana-bar",CclShowManaBar);
    gh_new_procedure0_0("show-mana-dot",CclShowManaDot);
    gh_new_procedure0_0("show-full",CclShowFull);
    gh_new_procedure0_0("show-no-full",CclShowNoFull);
    gh_new_procedure0_0("decoration-on-top",CclDecorationOnTop);
    gh_new_procedure0_0("show-sight-range",CclShowSightRange);
    gh_new_procedure0_0("show-react-range",CclShowReactRange);
    gh_new_procedure0_0("show-attack-range",CclShowAttackRange);
    gh_new_procedure0_0("show-orders",CclShowOrders);

    gh_new_procedure1_0("speed-mine",CclSpeedMine);
    gh_new_procedure1_0("speed-gold",CclSpeedGold);
    gh_new_procedure1_0("speed-chop",CclSpeedChop);
    gh_new_procedure1_0("speed-wood",CclSpeedWood);
    gh_new_procedure1_0("speed-haul",CclSpeedHaul);
    gh_new_procedure1_0("speed-oil",CclSpeedOil);
    gh_new_procedure1_0("speed-build",CclSpeedBuild);
    gh_new_procedure1_0("speed-train",CclSpeedTrain);
    gh_new_procedure1_0("speed-upgrade",CclSpeedUpgrade);
    gh_new_procedure1_0("speed-research",CclSpeedResearch);
    gh_new_procedure1_0("speeds",CclSpeeds);

    gh_new_procedureN("missile-type",CclMissileType);

    MapCclRegister();
    UnitButtonCclRegister();
    UnitTypeCclRegister();
    SoundCclRegister();
    UserInterfaceCclRegister();

    gh_new_procedure1_0("load-pud",CclLoadPud);
    gh_new_procedure2_0("define-map",CclDefineMap);

    gh_new_procedureN("clone-map",CclCloneMap);

    gh_new_procedure0_0("c-main1",CclMain1);

#ifdef GUILE_GTK
    SGTK_REGISTER_GLUE(sgtk_init_gtk_gtk_glue);
    SGTK_REGISTER_GLUE(sgtk_init_gtk_gdk_glue);
    // ALL Stupid
    {
    int argc;
    char** argv;
    static char* args[2] = { "clone", NULL };

    argc=1;
    argv=args;
    sgtk_init_with_args(&argc,&argv);
    }
    //sgtk_init_with_args(NULL,NULL);
#endif

    //
    //	Load and evaluate configuration file
    //
    CclInConfigFile=1;
    gh_eval_file(CclStartFile);
    CclInConfigFile=0;

    // FIXME: guile didn't cleanup, all memory is lost!

    main1(argc,argv);			// continue with setup
}