- level_load_image(&img_brick[0],plevel->theme,"brick0.png", IGNORE_ALPHA);
- level_load_image(&img_brick[1],plevel->theme,"brick1.png", IGNORE_ALPHA);
-
- level_load_image(&img_solid[0],plevel->theme,"solid0.png", USE_ALPHA);
- level_load_image(&img_solid[1],plevel->theme,"solid1.png", USE_ALPHA);
- level_load_image(&img_solid[2],plevel->theme,"solid2.png", USE_ALPHA);
- level_load_image(&img_solid[3],plevel->theme,"solid3.png", USE_ALPHA);
-
- level_load_image(&img_bkgd_tile[0][0],plevel->theme,"bkgd-00.png", USE_ALPHA);
- level_load_image(&img_bkgd_tile[0][1],plevel->theme,"bkgd-01.png", USE_ALPHA);
- level_load_image(&img_bkgd_tile[0][2],plevel->theme,"bkgd-02.png", USE_ALPHA);
- level_load_image(&img_bkgd_tile[0][3],plevel->theme,"bkgd-03.png", USE_ALPHA);
-
- level_load_image(&img_bkgd_tile[1][0],plevel->theme,"bkgd-10.png", USE_ALPHA);
- level_load_image(&img_bkgd_tile[1][1],plevel->theme,"bkgd-11.png", USE_ALPHA);
- level_load_image(&img_bkgd_tile[1][2],plevel->theme,"bkgd-12.png", USE_ALPHA);
- level_load_image(&img_bkgd_tile[1][3],plevel->theme,"bkgd-13.png", USE_ALPHA);
-
- if(!plevel->bkgd_image.empty())
- {
- char fname[1024];
- snprintf(fname, 1024, "%s/background/%s", st_dir, plevel->bkgd_image.c_str());
- if(!faccessible(fname))
- snprintf(fname, 1024, "%s/images/background/%s", datadir.c_str(), plevel->bkgd_image.c_str());
- texture_load(&img_bkgd, fname, IGNORE_ALPHA);
- }
- else
- {
- /* Quick hack to make sure an image is loaded, when we are freeing it afterwards. */#
- level_load_image(&img_bkgd, plevel->theme,"solid0.png", IGNORE_ALPHA);
- }
-}
-
-/* Free graphics data for this level: */
-
-void level_free_gfx(void)
-{
- int i;
-
- for (i = 0; i < 2; i++)
- {
- texture_free(&img_brick[i]);
- }
- for (i = 0; i < 4; i++)
- {
- texture_free(&img_solid[i]);
- texture_free(&img_bkgd_tile[0][i]);
- texture_free(&img_bkgd_tile[1][i]);
- }
-
- texture_free(&img_bkgd);
-}
-
-/* Load a level-specific graphic... */
-
-void level_load_image(texture_type* ptexture, string theme,const char * file, int use_alpha)
-{
- char fname[1024];
-
- snprintf(fname, 1024, "%s/themes/%s/%s", st_dir, theme.c_str(), file);
- if(!faccessible(fname))
- snprintf(fname, 1024, "%s/images/themes/%s/%s", datadir.c_str(), theme.c_str(), file);
-
- texture_load(ptexture, fname, use_alpha);
-}
-
-void tilemap_change_size(unsigned int** tilemap[15], int w, int old_w)
-{
- int j,y;
- for(y = 0; y < 15; ++y)
- {
- *tilemap[y] = (unsigned int*) realloc(*tilemap[y],(w+1)*sizeof(unsigned int));
- if(w > old_w)
- for(j = 0; j < w - old_w; ++j)
- *tilemap[y][old_w+j] = 0;
- *tilemap[y][w] = 0;
- }