X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcamera.h;h=453a06a8fff9eb5649d14ba9faf3aa5e990bb73d;hb=157cef71aeb9ae25b7bb90f37dda11bc09329d11;hp=e1de4a5b49a3db3c8642037203e36b6ff10db834;hpb=91705941a6a8a251b7c5f670c6d100e512b2dd7f;p=supertux.git diff --git a/src/camera.h b/src/camera.h index e1de4a5b4..453a06a8f 100644 --- a/src/camera.h +++ b/src/camera.h @@ -19,9 +19,11 @@ #ifndef __VIEWPORT_H__ #define __VIEWPORT_H__ +#include #include "vector.h" #include "game_object.h" #include "serializable.h" +#include 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 scrollpoints; + size_t auto_idx; + float auto_t; + Vector current_dir; }; #endif