added castledoor background, worked on door entry level, added small clover to doodads
[supertux.git] / src / sector.hpp
index 067e453..99d8746 100644 (file)
@@ -42,6 +42,7 @@ class CollisionGrid;
 class ScriptInterpreter;
 class SpawnPoint;
 class MovingObject;
+class CollisionHit;
 
 enum MusicType {
   LEVEL_MUSIC,
@@ -89,7 +90,7 @@ public:
   /** Checks for all possible collisions. And calls the
       collision_handlers, which the collision_objects provide for this
       case (or not). */
-  void collision_handler();
+  void handle_collisions();
 
   bool add_bullet(const Vector& pos, float xm, Direction dir);
   bool add_smoke_cloud(const Vector& pos);
@@ -102,12 +103,16 @@ public:
   /** Get total number of badguys */
   int get_total_badguys();
 
-  // make this private again soon
-  void collision_tilemap(MovingObject* object, int depth);
+  void collision_tilemap(MovingObject* object, CollisionHit& hit) const;
+  uint32_t collision_tile_attributes(MovingObject* object) const;
+
+  /** Checks if at the specified rectangle are gameobjects with STATIC flag set
+   * (or solid tiles from the tilemap)
+   */
+  bool is_free_space(const Rect& rect) const;
 
 private:
-  void collision_object(MovingObject* object1, MovingObject* object2);
-  
+  void collision_object(MovingObject* object1, MovingObject* object2) const;
   GameObject* parse_object(const std::string& name, const lisp::Lisp& lisp);
   
   static Sector* _current;
@@ -115,7 +120,7 @@ private:
   std::string name;
 
 public:
-  std::string song_title;
+  std::string music;
   float gravity;
 
   // some special objects, where we need direct access
@@ -131,6 +136,8 @@ private:
 public: // TODO make this private again
   typedef std::vector<GameObject*> GameObjects;
   GameObjects gameobjects;
+  typedef std::vector<MovingObject*> MovingObjects;
+  MovingObjects moving_objects;
   typedef std::vector<SpawnPoint*> SpawnPoints;
   SpawnPoints spawnpoints;