Ejemplo n.º 1
0
static void hall_of_fame_phase_exit(struct phase *up)
{
	struct hall_of_fame_phase *self =
		b6_cast_of(up, struct hall_of_fame_phase, up);
	int i;
	finalize_fade_io(&self->fade_io);
	if (self->entry) {
		save_hall_of_fame(&up->engine->hall_of_fame);
		self->entry = NULL;
	}
	if (self->music) {
		stop_music(up->engine->mixer);
		unload_music(up->engine->mixer);
	}
	del_controller_observer(&self->controller_observer);
	del_renderer_observer(&self->renderer_observer);
	if (self->cursor_base) {
		finalize_toolkit_label(&self->cursor_label);
		destroy_renderer_base(self->cursor_base);
	}
	for (i = 0; i < b6_card_of(self->label); i += 1)
		finalize_toolkit_label(&self->label[i]);
	if (self->panel) {
		destroy_renderer_texture(self->panel->texture);
		destroy_renderer_tile(self->panel);
	}
	if (self->background) {
		destroy_renderer_texture(self->background->texture);
		destroy_renderer_tile(self->background);
	}
	finalize_fixed_font(&self->font);
	close_hall_of_fame(self->array);
}
Ejemplo n.º 2
0
void finalize_menu_mixer(struct menu_mixer *self)
{
	del_menu_observer(&self->menu_observer);
	if (self->music) {
		stop_music(self->mixer);
		unload_music(self->mixer);
	}
}
Ejemplo n.º 3
0
void soundLib::load_music(std::string music_file) {
	string filename;

	unload_music();
    filename = FILEPATH + "music/" + music_file;
    std::cout << "soundLib::load_music - filename: " << filename << std::endl;
	music = Mix_LoadMUS(filename.c_str());
	if (!music) {
        std::cout << "Error in soundLib::load_music::Mix_LoadMUS('" << filename << "': '" << Mix_GetError() << "'\n";
		exit(-1);
	}
}