X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcamera.h;h=453a06a8fff9eb5649d14ba9faf3aa5e990bb73d;hb=157cef71aeb9ae25b7bb90f37dda11bc09329d11;hp=aaa8e1959de712aa42265d13126e7e035ed0ae54;hpb=b8c83bae1b0cd0367b6e3ac8c4c28e077eb1b594;p=supertux.git diff --git a/src/camera.h b/src/camera.h index aaa8e1959..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,8 +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