-void
-World::activate_particle_systems()
-{
- if (level->particle_system == "clouds")
- {
- particle_systems.push_back(new CloudParticleSystem);
- }
- else if (level->particle_system == "snow")
- {
- particle_systems.push_back(new SnowParticleSystem);
- }
- else if (level->particle_system != "")
- {
- st_abort("unknown particle system specified in level", "");
- }
-}
-
-void
-World::draw()
-{
- int y,x;
-
- /* Draw the real background */
- drawgradient(level->bkgd_top, level->bkgd_bottom);
- if(level->img_bkgd)
- level->draw_bg();
-
-
- /* Draw particle systems (background) */
- std::vector<ParticleSystem*>::iterator p;
- for(p = particle_systems.begin(); p != particle_systems.end(); ++p)
- {
- (*p)->draw(scroll_x, 0, 0);
- }
-
- /* Draw background: */
- for (y = 0; y < VISIBLE_TILES_Y && y < level->height; ++y)
- {
- for (x = 0; x < VISIBLE_TILES_X; ++x)
- {
- Tile::draw(32*x - fmodf(scroll_x, 32), y * 32 - fmodf(scroll_y, 32),
- level->bg_tiles[(int)y + (int)(scroll_y / 32)][(int)x + (int)(scroll_x / 32)]);
- }
- }
-
- /* Draw interactive tiles: */
- for (y = 0; y < VISIBLE_TILES_Y && y < level->height; ++y)
- {
- for (x = 0; x < VISIBLE_TILES_X; ++x)
- {
- Tile::draw(32*x - fmodf(scroll_x, 32), y * 32 - fmodf(scroll_y, 32),
- level->ia_tiles[(int)y + (int)(scroll_y / 32)][(int)x + (int)(scroll_x / 32)]);
- }
- }
-
- /* (Bouncy bricks): */
- for (unsigned int i = 0; i < bouncy_bricks.size(); ++i)
- bouncy_bricks[i]->draw();
-
- for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i)
- (*i)->draw();
-
- for (Trampolines::iterator i = trampolines.begin(); i != trampolines.end(); ++i)
- (*i)->draw();
-
- tux.draw();
-
- for (unsigned int i = 0; i < bullets.size(); ++i)
- bullets[i].draw();
-
- for (unsigned int i = 0; i < floating_scores.size(); ++i)
- floating_scores[i]->draw();
-
- for (unsigned int i = 0; i < upgrades.size(); ++i)
- upgrades[i].draw();
-
- for (unsigned int i = 0; i < bouncy_distros.size(); ++i)
- bouncy_distros[i]->draw();
-
- for (unsigned int i = 0; i < broken_bricks.size(); ++i)
- broken_bricks[i]->draw();
-
- /* Draw foreground: */
- for (y = 0; y < VISIBLE_TILES_Y && y < level->height; ++y)
- {
- for (x = 0; x < VISIBLE_TILES_X; ++x)
- {
- Tile::draw(32*x - fmodf(scroll_x, 32), y * 32 - fmodf(scroll_y, 32),
- level->fg_tiles[(int)y + (int)(scroll_y / 32)][(int)x + (int)(scroll_x / 32)]);
- }
- }
-
- /* Draw particle systems (foreground) */
- for(p = particle_systems.begin(); p != particle_systems.end(); ++p)
- {
- (*p)->draw(scroll_x, 0, 1);
- }