Beispiel #1
0
SYMBOL_EXPORT void DeinitConfig(struct Game* game) {
	const ALLEGRO_FILE_INTERFACE* iface = al_get_new_file_interface();
	al_set_standard_file_interface();
	ALLEGRO_PATH* path = al_get_standard_path(ALLEGRO_USER_SETTINGS_PATH);
	ALLEGRO_PATH* data = al_create_path("SuperDerpy.ini");
	al_make_directory(al_path_cstr(path, ALLEGRO_NATIVE_PATH_SEP));
	al_join_paths(path, data);
	al_save_config_file(al_path_cstr(path, ALLEGRO_NATIVE_PATH_SEP), game->_priv.config);
	al_destroy_path(path);
	al_destroy_path(data);
	al_destroy_config(game->_priv.config);
	al_set_new_file_interface(iface);
}
Beispiel #2
0
static unsigned int init_datafile(char *argv[])
{

    /* load main game datafile (usually a zip) into memory */
    if (!PHYSFS_init(argv[0])) {
        fprintf(stderr, "Could not init PhysFS\n");
        return false;
    }
    PHYSFS_addToSearchPath(DATAPACKNAME, 1);
    al_set_standard_file_interface();
    al_set_physfs_file_interface();
    return true;

}