LevelSubset::~LevelSubset()
{
- delete image;
+ delete image;
}
void LevelSubset::create(const std::string& subset_name)
Level::~Level()
{
- free_gfx();
+ delete img_bkgd;
}
void
start_pos_y = 170;
time_left = 100;
gravity = 10.;
+ back_scrolling = false;
bkgd_top.red = 0;
bkgd_top.green = 0;
bkgd_top.blue = 0;
if(!reader.read_int("time", &time_left)) {
printf("Warning no time specified for level.\n");
}
+
+ back_scrolling = false;
+ reader.read_bool("back_scrolling", &back_scrolling);
bkgd_top.red = bkgd_top.green = bkgd_top.blue = 0;
reader.read_int("bkgd_red_top", &bkgd_top.red);
fprintf(fi," (bkgd_blue_bottom %d)\n", bkgd_bottom.blue);
fprintf(fi," (time %d)\n", time_left);
fprintf(fi," (width %d)\n", width);
+ if(back_scrolling)
+ fprintf(fi," (back_scrolling #t)\n");
+ else
+ fprintf(fi," (back_scrolling #f)\n");
fprintf(fi," (gravity %2.1f)\n", gravity);
fprintf(fi," (background-tm ");
snprintf(fname, 1024, "%s/background/%s", st_dir, bkgd_image.c_str());
if(!faccessible(fname))
snprintf(fname, 1024, "%s/images/background/%s", datadir.c_str(), bkgd_image.c_str());
+ delete img_bkgd;
img_bkgd = new Surface(fname, IGNORE_ALPHA);
}
else
{
+ delete img_bkgd;
img_bkgd = 0;
}
}
-void
-Level::free_gfx()
-{
- delete img_bkgd;
-}
-
/* Load a level-specific graphic... */
void
Level::load_image(Surface** ptexture, string theme,const char * file, int use_alpha)