X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgameloop.cpp;h=1b2914bef2d58cf4c50b323cb4b65106f82a1ed6;hb=02d54bd21d3d72e46ecad8f6038666b0384d4eb8;hp=fc9f471c1ccca8567314a8cb97ba2f1197ebfe3d;hpb=5a542dea3c6043703683b68fcaa774f6cb0d9127;p=supertux.git diff --git a/src/gameloop.cpp b/src/gameloop.cpp index fc9f471c1..1b2914bef 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -47,20 +47,19 @@ #include "high_scores.h" #include "gui/menu.h" #include "sector.h" -#include "player.h" #include "level.h" #include "scene.h" -#include "collision.h" #include "tile.h" -#include "particlesystem.h" +#include "object/particlesystem.h" +#include "object/background.h" +#include "object/tilemap.h" +#include "object/camera.h" +#include "object/player.h" #include "resources.h" -#include "background.h" -#include "tilemap.h" #include "app/gettext.h" #include "worldmap.h" #include "intro.h" #include "misc.h" -#include "camera.h" #include "statistics.h" #include "timer.h" #include "object/fireworks.h" @@ -186,8 +185,13 @@ GameSession::levelintro(void) 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 (*i); + if(background) { + background->draw(context); + } + } // context.draw_text(gold_text, level->get_name(), Vector(screen->w/2, 160), // CENTER_ALLIGN, LAYER_FOREGROUND1); @@ -906,12 +910,18 @@ GameSession::drawstatus(DrawingContext& context) } 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 (*i); + if(background) { + background->draw(context); + } + } context.draw_text(blue_text, _("Result:"), Vector(screen->w/2, 200), CENTER_ALLIGN, LAYER_FOREGROUND1);