[Super-tux-commit] supertux/src badguy.cpp,1.110,1.111 gameloop.cpp,1.156,1.157 gameloop.h,1.55,1.56
Brought to you by:
wkendrick
From: Tobias G. <to...@us...> - 2004-07-25 19:03:47
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31225/src Modified Files: badguy.cpp gameloop.cpp gameloop.h high_scores.cpp level_subset.cpp leveleditor.cpp misc.cpp player.cpp player.h resources.cpp sector.cpp special.cpp supertux.cpp tile_manager.cpp title.cpp worldmap.cpp Log Message: - Major changes in Setup-API. - Moved all sound handling into SoundManager, which became a singleton. Index: tile_manager.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile_manager.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- tile_manager.cpp 20 Jul 2004 18:04:48 -0000 1.2 +++ tile_manager.cpp 25 Jul 2004 19:03:36 -0000 1.3 @@ -59,7 +59,7 @@ lisp_object_t* root_obj = lisp_read_from_file(filename); if (!root_obj) - st_abort("Couldn't load file", filename); + Termination::abort("Couldn't load file", filename); if (strcmp(lisp_symbol(lisp_car(root_obj)), "supertux-tiles") == 0) { Index: level_subset.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level_subset.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- level_subset.cpp 21 Jul 2004 16:51:53 -0000 1.5 +++ level_subset.cpp 25 Jul 2004 19:03:36 -0000 1.6 @@ -106,12 +106,12 @@ snprintf(filename, 1024, "%s/levels/%s/", st_dir, subset); if(access(filename, R_OK) == 0) { - files = read_directory(filename); + files = FileSystem::read_directory(filename); } else { snprintf(filename, 1024, "%s/levels/%s/", datadir.c_str(), subset); - files = read_directory(filename); + files = FileSystem::read_directory(filename); } for(std::vector<std::string>::iterator i = files.begin(); i != files.end(); ++i) @@ -131,11 +131,11 @@ /* Save data file: */ filename = "/levels/" + name + "/"; - fcreatedir(filename.c_str()); + FileSystem::fcreatedir(filename.c_str()); filename = std::string(st_dir) + "/levels/" + name + "/info"; - if(!fwriteable(filename.c_str())) + if(!FileSystem::fwriteable(filename.c_str())) filename = datadir + "/levels/" + name + "/info"; - if(fwriteable(filename.c_str())) + if(FileSystem::fwriteable(filename.c_str())) { fi = fopen(filename.c_str(), "w"); if (fi == NULL) Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.99 retrieving revision 1.100 diff -u -d -r1.99 -r1.100 --- worldmap.cpp 20 Jul 2004 18:04:49 -0000 1.99 +++ worldmap.cpp 25 Jul 2004 19:03:36 -0000 1.100 @@ -98,7 +98,7 @@ lisp_object_t* root_obj = lisp_read_from_file(stwt_filename); if (!root_obj) - st_abort("Couldn't load file", stwt_filename); + Termination::abort("Couldn't load file", stwt_filename); if (strcmp(lisp_symbol(lisp_car(root_obj)), "supertux-worldmap-tiles") == 0) { @@ -386,7 +386,7 @@ { lisp_object_t* root_obj = lisp_read_from_file(datadir + "/levels/worldmap/" + map_filename); if (!root_obj) - st_abort("Couldn't load file", datadir + "/levels/worldmap/" + map_filename); + Termination::abort("Couldn't load file", datadir + "/levels/worldmap/" + map_filename); if (strcmp(lisp_symbol(lisp_car(root_obj)), "supertux-worldmap") == 0) { @@ -531,7 +531,7 @@ switch(event.type) { case SDL_QUIT: - st_abort("Received window close", ""); + Termination::abort("Received window close", ""); break; case SDL_KEYDOWN: @@ -771,7 +771,7 @@ break; } - sound_manager->play_music(song); + SoundManager::get()->play_music(song); Menu::set_current(0); if (!savegame_file.empty()) savegame(savegame_file); @@ -954,8 +954,8 @@ quit = false; - song = sound_manager->load_music(datadir + "/music/" + music); - sound_manager->play_music(song); + song = SoundManager::get()->load_music(datadir + "/music/" + music); + SoundManager::get()->play_music(song); unsigned int last_update_time; unsigned int update_time; Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- sector.cpp 20 Jul 2004 18:04:48 -0000 1.17 +++ sector.cpp 25 Jul 2004 19:03:36 -0000 1.18 @@ -669,7 +669,7 @@ throw std::runtime_error("wrong bullet type."); add_object(new_bullet); - sound_manager->play_sound(sounds[SND_SHOOT]); + SoundManager::get()->play_sound(IDToSound(SND_SHOOT)); return true; } @@ -711,7 +711,7 @@ solids->change_at(pos, tile->next_tile); } - sound_manager->play_sound(sounds[SND_DISTRO]); + SoundManager::get()->play_sound(IDToSound(SND_DISTRO)); player_status.score = player_status.score + SCORE_DISTRO; player_status.distros++; return true; @@ -727,7 +727,7 @@ (int)(pos.y / 32) * 32), tile); /* Get some score: */ - sound_manager->play_sound(sounds[SND_BRICK]); + SoundManager::get()->play_sound(IDToSound(SND_BRICK)); player_status.score = player_status.score + SCORE_BRICK; return true; @@ -765,7 +765,7 @@ { case 1: // Box with a distro! add_bouncy_distro(Vector(posx, posy)); - sound_manager->play_sound(sounds[SND_DISTRO]); + SoundManager::get()->play_sound(IDToSound(SND_DISTRO)); player_status.score = player_status.score + SCORE_DISTRO; player_status.distros++; break; @@ -775,7 +775,7 @@ add_upgrade(Vector(posx, posy), col_side, UPGRADE_GROWUP); else /* Tux is big, add a fireflower: */ add_upgrade(Vector(posx, posy), col_side, UPGRADE_FIREFLOWER); - sound_manager->play_sound(sounds[SND_UPGRADE]); + SoundManager::get()->play_sound(IDToSound(SND_UPGRADE)); break; case 5: // Add an ice flower upgrade! @@ -783,7 +783,7 @@ add_upgrade(Vector(posx, posy), col_side, UPGRADE_GROWUP); else /* Tux is big, add an iceflower: */ add_upgrade(Vector(posx, posy), col_side, UPGRADE_ICEFLOWER); - sound_manager->play_sound(sounds[SND_UPGRADE]); + SoundManager::get()->play_sound(IDToSound(SND_UPGRADE)); break; case 3: // Add a golden herring @@ -823,7 +823,7 @@ return; solids->change_at(pos, tile->next_tile); - sound_manager->play_sound(sounds[SND_DISTRO]); + SoundManager::get()->play_sound(IDToSound(SND_DISTRO)); if (bounciness == BOUNCE) { @@ -868,7 +868,7 @@ char* song_path; char* song_subtitle; - level_song = sound_manager->load_music(datadir + "/music/" + song_title); + level_song = SoundManager::get()->load_music(datadir + "/music/" + song_title); song_path = (char *) malloc(sizeof(char) * datadir.length() + strlen(song_title.c_str()) + 8 + 5); @@ -876,10 +876,10 @@ strcpy(strstr(song_subtitle, "."), "\0"); sprintf(song_path, "%s/music/%s-fast%s", datadir.c_str(), song_subtitle, strstr(song_title.c_str(), ".")); - if(!sound_manager->exists_music(song_path)) { + if(!SoundManager::get()->exists_music(song_path)) { level_song_fast = level_song; } else { - level_song_fast = sound_manager->load_music(song_path); + level_song_fast = SoundManager::get()->load_music(song_path); } free(song_subtitle); free(song_path); @@ -891,16 +891,16 @@ currentmusic = type; switch(currentmusic) { case HURRYUP_MUSIC: - sound_manager->play_music(level_song_fast); + SoundManager::get()->play_music(level_song_fast); break; case LEVEL_MUSIC: - sound_manager->play_music(level_song); + SoundManager::get()->play_music(level_song); break; case HERRING_MUSIC: - sound_manager->play_music(herring_song); + SoundManager::get()->play_music(herring_song); break; default: - sound_manager->halt_music(); + SoundManager::get()->halt_music(); break; } } Index: misc.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/misc.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- misc.cpp 24 Jul 2004 11:50:09 -0000 1.3 +++ misc.cpp 25 Jul 2004 19:03:36 -0000 1.4 @@ -46,7 +46,7 @@ if(use_gl != options_menu->isToggled(MNID_OPENGL)) { use_gl = !use_gl; - st_video_setup(screen->w,screen->h); + Setup::video(screen->w,screen->h); } #else options_menu->get_item_by_id(MNID_OPENGL).toggled = false; @@ -56,18 +56,17 @@ if(use_fullscreen != options_menu->isToggled(MNID_FULLSCREEN)) { use_fullscreen = !use_fullscreen; - st_video_setup(screen->w,screen->h); + Setup::video(screen->w,screen->h); } break; case MNID_SOUND: - if(use_sound != options_menu->isToggled(MNID_SOUND)) - use_sound = !use_sound; + if(SoundManager::get()->sound_enabled() != options_menu->isToggled(MNID_SOUND)) + SoundManager::get()->enable_sound(!SoundManager::get()->sound_enabled()); break; case MNID_MUSIC: - if(use_music != options_menu->isToggled(MNID_MUSIC)) + if(SoundManager::get()->music_enabled() != options_menu->isToggled(MNID_MUSIC)) { - use_music = !use_music; - sound_manager->enable_music(use_music); + SoundManager::get()->enable_music(!SoundManager::get()->music_enabled()); } break; case MNID_SHOWFPS: @@ -107,10 +106,10 @@ options_menu->additem(MN_DEACTIVE,_("OpenGL (not supported)"),use_gl, 0, MNID_OPENGL); #endif options_menu->additem(MN_TOGGLE,_("Fullscreen"),use_fullscreen,0, MNID_FULLSCREEN); - if(audio_device) + if(SoundManager::get()->audio_device_available()) { - options_menu->additem(MN_TOGGLE,_("Sound "), use_sound,0, MNID_SOUND); - options_menu->additem(MN_TOGGLE,_("Music "), use_music,0, MNID_MUSIC); + options_menu->additem(MN_TOGGLE,_("Sound "), SoundManager::get()->sound_enabled(),0, MNID_SOUND); + options_menu->additem(MN_TOGGLE,_("Music "), SoundManager::get()->music_enabled(),0, MNID_MUSIC); } else { Index: special.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- special.cpp 20 Jul 2004 18:06:14 -0000 1.63 +++ special.cpp 25 Jul 2004 19:03:36 -0000 1.64 @@ -27,7 +27,6 @@ #include "camera.h" #include "gameloop.h" #include "video/screen.h" -#include "audio/sound.h" #include "scene.h" #include "app/globals.h" #include "player.h" @@ -280,7 +279,7 @@ if(kind != UPGRADE_GROWUP) return; - sound_manager->play_sound(sounds[SND_BUMP_UPGRADE], Vector(base.x, base.y), Sector::current()->player->get_pos()); + SoundManager::get()->play_sound(IDToSound(SND_BUMP_UPGRADE), Vector(base.x, base.y), Sector::current()->player->get_pos()); // determine new direction Direction old_dir = dir; @@ -328,30 +327,30 @@ if (kind == UPGRADE_GROWUP) { - sound_manager->play_sound(sounds[SND_EXCELLENT]); + SoundManager::get()->play_sound(IDToSound(SND_EXCELLENT)); pplayer->grow(true); } else if (kind == UPGRADE_FIREFLOWER) { - sound_manager->play_sound(sounds[SND_COFFEE]); + SoundManager::get()->play_sound(IDToSound(SND_COFFEE)); pplayer->grow(true); pplayer->got_power = pplayer->FIRE_POWER; } else if (kind == UPGRADE_ICEFLOWER) { - sound_manager->play_sound(sounds[SND_COFFEE]); + SoundManager::get()->play_sound(IDToSound(SND_COFFEE)); pplayer->grow(true); pplayer->got_power = pplayer->ICE_POWER; } else if (kind == UPGRADE_FIREFLOWER) { - sound_manager->play_sound(sounds[SND_COFFEE]); + SoundManager::get()->play_sound(IDToSound(SND_COFFEE)); pplayer->grow(true); pplayer->got_power = pplayer->FIRE_POWER; } else if (kind == UPGRADE_HERRING) { - sound_manager->play_sound(sounds[SND_HERRING]); + SoundManager::get()->play_sound(IDToSound(SND_HERRING)); pplayer->invincible_timer.start(TUX_INVINCIBLE_TIME); Sector::current()->play_music(HERRING_MUSIC); } @@ -359,7 +358,7 @@ { if(player_status.lives < MAX_LIVES) { player_status.lives++; - sound_manager->play_sound(sounds[SND_LIFEUP]); + SoundManager::get()->play_sound(IDToSound(SND_LIFEUP)); } } Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.156 retrieving revision 1.157 diff -u -d -r1.156 -r1.157 --- gameloop.cpp 20 Jul 2004 18:04:47 -0000 1.156 +++ gameloop.cpp 25 Jul 2004 19:03:36 -0000 1.157 @@ -110,7 +110,7 @@ level->do_vertical_flip(); currentsector = level->get_sector("main"); if(!currentsector) - st_abort("Level has no main sector.", ""); + Termination::abort("Level has no main sector.", ""); currentsector->activate("main"); #if 0 // TODO @@ -153,7 +153,7 @@ void GameSession::levelintro(void) { - sound_manager->halt_music(); + SoundManager::get()->halt_music(); char str[60]; @@ -256,7 +256,7 @@ switch(event.type) { case SDL_QUIT: /* Quit event - quit: */ - st_abort("Received window close", ""); + Termination::abort("Received window close", ""); break; case SDL_KEYDOWN: /* A keypress! */ @@ -302,7 +302,7 @@ switch(event.type) { case SDL_QUIT: /* Quit event - quit: */ - st_abort("Received window close", ""); + Termination::abort("Received window close", ""); break; case SDL_KEYDOWN: /* A keypress! */ @@ -474,7 +474,7 @@ { end_sequence = ENDSEQUENCE_RUNNING; last_x_pos = -1; - sound_manager->play_music(level_end_song, 0); + SoundManager::get()->play_music(level_end_song, 0); endsequence_timer.start(7000); // 5 seconds until we finish the map tux->invincible_timer.start(7000); //FIXME: Implement a winning timer for the end sequence (with special winning animation etc.) } @@ -716,7 +716,7 @@ Sector::current()->add_bouncy_brick(Vector(((int)(x + 1) / 32) * 32, (int)(y / 32) * 32)); - sound_manager->play_sound(sounds[SND_BRICK], Vector(x, y), Sector::current()->player->get_pos()); + SoundManager::get()->play_sound(IDToSound(SND_BRICK), Vector(x, y), Sector::current()->player->get_pos()); } /* (Status): */ Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -r1.110 -r1.111 --- badguy.cpp 20 Jul 2004 18:04:47 -0000 1.110 +++ badguy.cpp 25 Jul 2004 19:03:36 -0000 1.111 @@ -357,7 +357,7 @@ tux.kick_timer.start(KICKING_TIME); set_sprite(img_mriceblock_flat_left, img_mriceblock_flat_right); physic.set_velocity_x((dir == LEFT) ? -3.5 : 3.5); - sound_manager->play_sound(sounds[SND_KICK], this, Sector::current()->player->get_pos()); + SoundManager::get()->play_sound(IDToSound(SND_KICK), this, Sector::current()->player->get_pos()); } } @@ -367,7 +367,7 @@ check_horizontal_bump(); if(mode == KICK && changed != dir) { - sound_manager->play_sound(sounds[SND_RICOCHET], get_pos(), Sector::current()->player->get_pos()); + SoundManager::get()->play_sound(IDToSound(SND_RICOCHET), get_pos(), Sector::current()->player->get_pos()); } } @@ -561,7 +561,7 @@ dying = DYING_NOT; // now the bomb hurts timer.start(EXPLODETIME); - sound_manager->play_sound(sounds[SND_EXPLODE], this, Sector::current()->player->get_pos()); + SoundManager::get()->play_sound(IDToSound(SND_EXPLODE), this, Sector::current()->player->get_pos()); } else if(mode == BOMB_EXPLODE) { remove_me(); return; @@ -1034,7 +1034,7 @@ Sector::current()->add_score(Vector(base.x, base.y), 50 * player_status.score_multiplier); - sound_manager->play_sound(sounds[SND_SQUISH], get_pos(), Sector::current()->player->get_pos()); + SoundManager::get()->play_sound(IDToSound(SND_SQUISH), get_pos(), Sector::current()->player->get_pos()); player_status.score_multiplier++; dying = DYING_SQUISHED; @@ -1054,7 +1054,7 @@ player->bounce(this); Sector::current()->add_score(Vector(base.x, base.y), 50 * player_status.score_multiplier); - sound_manager->play_sound(sounds[SND_SQUISH], get_pos(), Sector::current()->player->get_pos()); + SoundManager::get()->play_sound(IDToSound(SND_SQUISH), get_pos(), Sector::current()->player->get_pos()); player_status.score_multiplier++; return; @@ -1062,7 +1062,7 @@ if (mode == NORMAL || mode == KICK) { /* Flatten! */ - sound_manager->play_sound(sounds[SND_STOMP], get_pos(), Sector::current()->player->get_pos()); + SoundManager::get()->play_sound(IDToSound(SND_STOMP), get_pos(), Sector::current()->player->get_pos()); mode = FLAT; set_sprite(img_mriceblock_flat_left, img_mriceblock_flat_right); physic.set_velocity_x(0); @@ -1070,7 +1070,7 @@ timer.start(4000); } else if (mode == FLAT) { /* Kick! */ - sound_manager->play_sound(sounds[SND_KICK], this, Sector::current()->player->get_pos()); + SoundManager::get()->play_sound(IDToSound(SND_KICK), this, Sector::current()->player->get_pos()); if (player->base.x < base.x + (base.width/2)) { physic.set_velocity_x(5); @@ -1171,7 +1171,7 @@ score * player_status.score_multiplier); /* Play death sound: */ - sound_manager->play_sound(sounds[SND_FALL], this, Sector::current()->player->get_pos()); + SoundManager::get()->play_sound(IDToSound(SND_FALL), this, Sector::current()->player->get_pos()); } void @@ -1334,7 +1334,7 @@ /* Get kicked if were flat */ if (mode == FLAT && !dying) { - sound_manager->play_sound(sounds[SND_KICK], this, Sector::current()->player->get_pos()); + SoundManager::get()->play_sound(IDToSound(SND_KICK), this, Sector::current()->player->get_pos()); // Hit from left side if (player->base.x < base.x) { Index: gameloop.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.h,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- gameloop.h 21 Jul 2004 16:51:53 -0000 1.55 +++ gameloop.h 25 Jul 2004 19:03:36 -0000 1.56 @@ -23,7 +23,6 @@ #define SUPERTUX_GAMELOOP_H #include "special/timer.h" -#include "audio/sound.h" #include "special/base.h" using namespace SuperTux; Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.142 retrieving revision 1.143 diff -u -d -r1.142 -r1.143 --- leveleditor.cpp 20 Jul 2004 18:04:47 -0000 1.142 +++ leveleditor.cpp 25 Jul 2004 19:03:36 -0000 1.143 @@ -77,7 +77,7 @@ LevelEditor::LevelEditor() { - level_subsets = dsubdirs("/levels", "level1.stl"); + level_subsets = FileSystem::dsubdirs("/levels", "level1.stl"); le_level_subset = new LevelSubset; le_level = NULL; @@ -201,7 +201,7 @@ le_level = NULL; le_levelnb = 1; - sound_manager->halt_music(); + SoundManager::get()->halt_music(); while (SDL_PollEvent(&event)) {} @@ -544,8 +544,8 @@ level_settings_menu->get_item_by_id(MNID_NAME).change_input(le_level->name.c_str()); level_settings_menu->get_item_by_id(MNID_AUTHOR).change_input(le_level->author.c_str()); - string_list_copy(level_settings_menu->get_item_by_id(MNID_SONG).list, dfiles("music/",NULL, "-fast")); - string_list_copy(level_settings_menu->get_item_by_id(MNID_BGIMG).list, dfiles("images/background",NULL, NULL)); + string_list_copy(level_settings_menu->get_item_by_id(MNID_SONG).list, FileSystem::dfiles("music/",NULL, "-fast")); + string_list_copy(level_settings_menu->get_item_by_id(MNID_BGIMG).list, FileSystem::dfiles("images/background",NULL, NULL)); string_list_add_item(level_settings_menu->get_item_by_id(MNID_BGIMG).list,""); string_list_add_item(level_settings_menu->get_item_by_id(MNID_PARTICLE).list,""); string_list_add_item(level_settings_menu->get_item_by_id(MNID_PARTICLE).list,"snow"); @@ -1687,7 +1687,7 @@ session.run(); player_status.reset(); - sound_manager->halt_music(); + SoundManager::get()->halt_music(); Menu::set_current(NULL); } Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.146 retrieving revision 1.147 diff -u -d -r1.146 -r1.147 --- player.cpp 20 Jul 2004 18:04:48 -0000 1.146 +++ player.cpp 25 Jul 2004 19:03:36 -0000 1.147 @@ -419,7 +419,7 @@ if(on_ground() && ((vx < 0 && dirsign >0) || (vx>0 && dirsign<0))) { if(fabs(vx)>SKID_XM && !skidding_timer.check()) { skidding_timer.start(SKID_TIME); - sound_manager->play_sound(sounds[SND_SKID]); + SoundManager::get()->play_sound(IDToSound(SND_SKID)); ax *= 2.5; } else { ax *= 2; @@ -486,9 +486,9 @@ jumping = true; can_jump = false; if (size == SMALL) - sound_manager->play_sound(sounds[SND_JUMP]); + SoundManager::get()->play_sound(IDToSound(SND_JUMP)); else - sound_manager->play_sound(sounds[SND_BIGJUMP]); + SoundManager::get()->play_sound(IDToSound(SND_BIGJUMP)); } // Let go of jump key else if(input.up == UP && jumping && physic.get_velocity_y() > 0) @@ -681,7 +681,7 @@ if(player_status.lives < MAX_LIVES) ++player_status.lives; /*We want to hear the sound even, if MAX_LIVES is reached*/ - sound_manager->play_sound(sounds[SND_LIFEUP]); + SoundManager::get()->play_sound(IDToSound(SND_LIFEUP)); } } @@ -923,7 +923,7 @@ if(dying) return; - sound_manager->play_sound(sounds[SND_HURT]); + SoundManager::get()->play_sound(IDToSound(SND_HURT)); physic.set_velocity_x(0); Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 --- player.h 21 Jul 2004 16:51:53 -0000 1.76 +++ player.h 25 Jul 2004 19:03:36 -0000 1.77 @@ -27,7 +27,6 @@ #include "special/base.h" #include "video/surface.h" #include "collision.h" -#include "audio/sound.h" #include "special/moving_object.h" #include "math/physic.h" #include "app/defines.h" Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.109 retrieving revision 1.110 diff -u -d -r1.109 -r1.110 --- title.cpp 20 Jul 2004 18:04:48 -0000 1.109 +++ title.cpp 25 Jul 2004 19:03:36 -0000 1.110 @@ -103,7 +103,7 @@ void generate_contrib_menu() { /** Generating contrib levels list by making use of Level Subset */ - string_list_type level_subsets = dsubdirs("/levels", "info"); + string_list_type level_subsets = FileSystem::dsubdirs("/levels", "info"); free_contrib_menu(); @@ -272,7 +272,7 @@ img_choose_subset = new Surface(datadir + "/images/status/choose-level-subset.png", true); /* Generating contrib maps by only using a string_list */ - worldmap_list = dfiles("levels/worldmap", NULL, "icyisland.stwm"); + worldmap_list = FileSystem::dfiles("levels/worldmap", NULL, "icyisland.stwm"); titlesession->get_current_sector()->activate(); titlesession->set_current(); Index: high_scores.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/high_scores.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- high_scores.cpp 21 Jul 2004 16:51:53 -0000 1.24 +++ high_scores.cpp 25 Jul 2004 19:03:36 -0000 1.25 @@ -141,8 +141,8 @@ /* Save data file: */ filename = highscore_filename; - fcreatedir(filename.c_str()); - if(fwriteable(filename.c_str())) + FileSystem::fcreatedir(filename.c_str()); + if(FileSystem::fwriteable(filename.c_str())) { fi = fopen(filename.c_str(), "w"); if (fi == NULL) Index: supertux.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/supertux.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- supertux.cpp 24 Jul 2004 11:50:09 -0000 1.27 +++ supertux.cpp 25 Jul 2004 19:03:36 -0000 1.28 @@ -52,15 +52,15 @@ textdomain(PACKAGE); bind_textdomain_codeset(PACKAGE, "ISO-8859-1"); - st_info_setup(PACKAGE_NAME,PACKAGE,PACKAGE_VERSION); + Setup::info(PACKAGE_NAME,PACKAGE,PACKAGE_VERSION); - st_directory_setup(); - parseargs(argc, argv); + Setup::directories(); + Setup::parseargs(argc, argv); - st_audio_setup(); - st_video_setup(SCREEN_W,SCREEN_H); - st_joystick_setup(); - st_general_setup(); + Setup::audio(); + Setup::video(SCREEN_W,SCREEN_H); + Setup::joystick(); + Setup::general(); st_menu(); loadshared(); @@ -99,13 +99,13 @@ //SDL_Flip(screen); unloadshared(); - st_general_free(); + Setup::general_free(); st_menu_free(); TileManager::destroy_instance(); #ifdef DEBUG Surface::debug_check(); #endif - st_shutdown(); + Termination::shutdown(); #ifndef DEBUG // we want to see the backtrace in gdb when in debug mode } catch (SuperTuxException &e) Index: resources.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- resources.cpp 21 Jul 2004 16:51:53 -0000 1.43 +++ resources.cpp 25 Jul 2004 19:03:36 -0000 1.44 @@ -82,8 +82,6 @@ int i; sprite_manager = new SpriteManager(datadir + "/supertux.strf"); - sound_manager = new SoundManager(); - sound_manager->enable_music(use_music); /* Tuxes: */ smalltux_star = sprite_manager->load("smalltux-star"); @@ -265,11 +263,11 @@ Send a mail to me: neo...@us..., if you have another opinion. :) */ for (i = 0; i < NUM_SOUNDS; i++) - sounds.push_back(load_sound(datadir + soundfilenames[i])); + SoundManager::get()->add_sound(SoundManager::get()->load_sound(datadir + soundfilenames[i]),i); /* Herring song */ - herring_song = sound_manager->load_music(datadir + "/music/SALCON.MOD"); - level_end_song = sound_manager->load_music(datadir + "/music/leveldone.mod"); + herring_song = SoundManager::get()->load_music(datadir + "/music/SALCON.MOD"); + level_end_song = SoundManager::get()->load_music(datadir + "/music/leveldone.mod"); } @@ -311,12 +309,8 @@ for (int i = 0; i < DOOR_OPENING_FRAMES; i++) delete door_opening[i]; - for (i = 0; i < NUM_SOUNDS; i++) - free_chunk(sounds[i]); - delete sprite_manager; sprite_manager = 0; - delete sound_manager; sound_manager = 0; } |