// $Id$
//
// SuperTux - A Jump'n Run
-// Copyright (C) 2004 Matthias Braun <matze@braunis.de
+// Copyright (C) 2006 Matthias Braun <matze@braunis.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
Sector* Sector::_current = 0;
+bool Sector::show_collrects = false;
+bool Sector::draw_solids_only = false;
+
Sector::Sector()
: currentmusic(LEVEL_MUSIC), gravity(10),
player(0), solids(0), camera(0)
GameObject* object = *i;
if(!object->is_valid())
continue;
-
+
+ if (draw_solids_only)
+ {
+ TileMap* tm = dynamic_cast<TileMap*>(object);
+ if (tm && !tm->is_solid())
+ continue;
+ }
+
object->draw(context);
}
+ if(show_collrects) {
+ Color col(0.2, 0.2, 0.2, 0.7);
+ for(MovingObjects::iterator i = moving_objects.begin();
+ i != moving_objects.end(); ++i) {
+ MovingObject* object = *i;
+ const Rect& rect = object->get_bbox();
+
+ context.draw_filled_rect(rect, col, LAYER_FOREGROUND1 + 10);
+ }
+ }
+
context.pop_transform();
}