Esempio n. 1
0
/* need to come up with a way to define loops for non-MOD audio,
 * see if there is a corresponding INI file and read loop data from that */
bool t3f_play_music(const char * fn)
{
    ALLEGRO_DEBUG("attempting to play %s\n", fn);
    if(!(t3f_flags & T3F_USE_SOUND))
    {
        return false;
    }
    if(!t3f_music_mutex)
    {
        t3f_music_mutex = al_create_mutex();
    }
    if(t3f_music_mutex)
    {
        strcpy(t3f_music_thread_fn, fn);
        t3f_music_thread_file_interface = al_get_new_file_interface(); // copy current file interface so we can use it in the music thread
        t3f_set_music_state(T3F_MUSIC_STATE_TRACK_CHANGE);
        al_run_detached_thread(t3f_play_music_thread, NULL);
        return true;
    }
    else
    {
        t3f_set_music_state(T3F_MUSIC_STATE_OFF);
        return false;
    }
}
Esempio n. 2
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);
}