X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Flevel.cpp;h=e316e4790adc7619d909c89d6e59389ac74b0a56;hb=aadd77c676baae31db931c8e64cd1713c24289d5;hp=e3e40c061f76b46c3485354ef614f6b91cdee062;hpb=234eef12ae725e40b14f9ebb7f8308fbe6fb06b8;p=supertux.git diff --git a/src/level.cpp b/src/level.cpp index e3e40c061..e316e4790 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -26,8 +26,6 @@ using namespace std; -texture_type img_bkgd; - st_subset::st_subset() { levels = 0; @@ -539,30 +537,9 @@ Level::cleanup() badguy_data.clear(); } -/* Load graphics: */ - void Level::load_gfx() { - /* - level_load_image(&img_brick[0],theme,"brick0.png", IGNORE_ALPHA); - level_load_image(&img_brick[1],theme,"brick1.png", IGNORE_ALPHA); - - level_load_image(&img_solid[0],theme,"solid0.png", USE_ALPHA); - level_load_image(&img_solid[1],theme,"solid1.png", USE_ALPHA); - level_load_image(&img_solid[2],theme,"solid2.png", USE_ALPHA); - level_load_image(&img_solid[3],theme,"solid3.png", USE_ALPHA); - - level_load_image(&img_bkgd_tile[0][0],theme,"bkgd-00.png", USE_ALPHA); - level_load_image(&img_bkgd_tile[0][1],theme,"bkgd-01.png", USE_ALPHA); - level_load_image(&img_bkgd_tile[0][2],theme,"bkgd-02.png", USE_ALPHA); - level_load_image(&img_bkgd_tile[0][3],theme,"bkgd-03.png", USE_ALPHA); - - level_load_image(&img_bkgd_tile[1][0],theme,"bkgd-10.png", USE_ALPHA); - level_load_image(&img_bkgd_tile[1][1],theme,"bkgd-11.png", USE_ALPHA); - level_load_image(&img_bkgd_tile[1][2],theme,"bkgd-12.png", USE_ALPHA); - level_load_image(&img_bkgd_tile[1][3],theme,"bkgd-13.png", USE_ALPHA); - */ if(!bkgd_image.empty()) { char fname[1024]; @@ -573,20 +550,20 @@ Level::load_gfx() } else { - /* Quick hack to make sure an image is loaded, when we are freeing it afterwards. */# - level_load_image(&img_bkgd, theme,"solid0.png", IGNORE_ALPHA); + /* Quick hack to make sure an image is loaded, when we are freeing it afterwards. */ + load_image(&img_bkgd, theme,"solid0.png", IGNORE_ALPHA); } } -/* Free graphics data for this level: */ -void level_free_gfx(void) +void +Level::free_gfx() { texture_free(&img_bkgd); } /* Load a level-specific graphic... */ - -void level_load_image(texture_type* ptexture, string theme,const char * file, int use_alpha) +void +Level::load_image(texture_type* ptexture, string theme,const char * file, int use_alpha) { char fname[1024]; @@ -647,16 +624,13 @@ Level::change(float x, float y, int tm, unsigned int c) } } -/* Free music data for this level: */ - -void level_free_song(void) +void +Level::free_song(void) { free_music(level_song); free_music(level_song_fast); } -/* Load music: */ - void Level::load_song() { @@ -669,7 +643,8 @@ Level::load_song() strlen(song_title.c_str()) + 8 + 5); song_subtitle = strdup(song_title.c_str()); strcpy(strstr(song_subtitle, "."), "\0"); - sprintf(song_path, "%s/music/%s-fast%s", datadir.c_str(), song_subtitle, strstr(song_title.c_str(), ".")); + sprintf(song_path, "%s/music/%s-fast%s", datadir.c_str(), + song_subtitle, strstr(song_title.c_str(), ".")); level_song_fast = ::load_song(song_path); free(song_subtitle); free(song_path);