char str[60];
DrawingContext context;
- if(currentsector->background)
- currentsector->background->draw(context);
+ for(Sector::GameObjects::iterator i = currentsector->gameobjects.begin();
+ i != currentsector->gameobjects.end(); ++i) {
+ Background* background = dynamic_cast<Background*> (*i);
+ if(background) {
+ background->draw(context);
+ }
+ }
// context.draw_text(gold_text, level->get_name(), Vector(screen->w/2, 160),
// CENTER_ALLIGN, LAYER_FOREGROUND1);
}
void
-GameSession::drawresultscreen(void)
+GameSession::drawresultscreen()
{
char str[80];
DrawingContext context;
- currentsector->background->draw(context);
+ for(Sector::GameObjects::iterator i = currentsector->gameobjects.begin();
+ i != currentsector->gameobjects.end(); ++i) {
+ Background* background = dynamic_cast<Background*> (*i);
+ if(background) {
+ background->draw(context);
+ }
+ }
context.draw_text(blue_text, _("Result:"), Vector(screen->w/2, 200),
CENTER_ALLIGN, LAYER_FOREGROUND1);
Sector* Sector::_current = 0;
Sector::Sector()
- : gravity(10), player(0), solids(0), background(0), camera(0),
+ : gravity(10), player(0), solids(0), camera(0),
currentmusic(LEVEL_MUSIC)
{
song_title = "Mortimers_chipdisko.mod";
Sector::parse_object(const std::string& name, LispReader& reader)
{
if(name == "background") {
- background = new Background(reader);
- return background;
+ return new Background(reader);
} else if(name == "camera") {
Camera* camera = new Camera(this);
camera->parse(reader);