- beginnings of a wingling
[supertux.git] / src / camera.h
index e1de4a5..453a06a 100644 (file)
 #ifndef __VIEWPORT_H__
 #define __VIEWPORT_H__
 
+#include <vector>
 #include "vector.h"
 #include "game_object.h"
 #include "serializable.h"
+#include <cassert>
 
 class LispReader;
 class Player;
@@ -43,7 +45,7 @@ public:
   }                                                  
 
   /// parse camera mode from lisp file
-  void parse_camera(LispReader& reader);
+  void read(LispReader& reader);
   /// write camera mode to a lisp file
   virtual void write(LispWriter& writer);
 
@@ -59,10 +61,12 @@ public:
   {
     NORMAL, AUTOSCROLL, MANUAL
   };
+  CameraMode mode;
 
 private:
   void scroll_normal(float elapsed_time);
   void scroll_autoscroll(float elapsed_time);
+  void keep_in_bounds();
 
   enum LeftRightScrollChange
   {
@@ -73,12 +77,21 @@ private:
 
   Player* player;
   Level* level;
-  CameraMode mode;
 
   // normal mode
+  bool do_backscrolling;
   LeftRightScrollChange scrollchange;
 
   // autoscroll mode
+  class ScrollPoint {
+  public:
+    Vector position;
+    float speed;
+  };
+  std::vector<ScrollPoint> scrollpoints;
+  size_t auto_idx;
+  float auto_t;
+  Vector current_dir;
 };
 
 #endif