X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcamera.h;h=bad7fdf2a442fc3596af617651670491a56528ba;hb=e4db6eb50cd6bcba607858b5e6c4c5d53531ed1f;hp=b64e71d89bb77ee75a22aabe0a7bd8f1366638c9;hpb=03fe5c560a616e7d38a8b1d5d11bfe4675fa8896;p=supertux.git diff --git a/src/camera.h b/src/camera.h index b64e71d89..bad7fdf2a 100644 --- a/src/camera.h +++ b/src/camera.h @@ -16,23 +16,31 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#ifndef __VIEWPORT_H__ -#define __VIEWPORT_H__ + +#ifndef SUPERTUX_CAMERA_H +#define SUPERTUX_CAMERA_H #include -#include "vector.h" -#include "game_object.h" -#include "serializable.h" #include +#include "defines.h" +#include "math/vector.h" +#include "special/game_object.h" +#include "video/drawing_context.h" +#include "serializable.h" + +using namespace SuperTux; + +namespace SuperTux { class LispReader; -class Player; -class Level; +} + +class Sector; class Camera : public GameObject, public Serializable { public: - Camera(Player* player = 0, Level* level = 0); + Camera(Sector* sector); virtual ~Camera(); /// parse camera mode from lisp file @@ -40,6 +48,9 @@ public: /// write camera mode to a lisp file virtual void write(LispWriter& writer); + /// reset camera postion + virtual void reset(const Vector& tuxpos); + /** @deprecated@ */ const Vector& get_translation() const; @@ -47,7 +58,13 @@ public: virtual void draw(DrawingContext& context) { - (void) context; + UNUSED_ARG(context); + } + + void set_scrolling(int scroll_x, int scroll_y) + { + translation.x = scroll_x; + translation.y = scroll_y; } enum CameraMode @@ -68,8 +85,7 @@ private: Vector translation; - Player* player; - Level* level; + Sector* sector; // normal mode bool do_backscrolling; @@ -87,5 +103,5 @@ private: Vector current_dir; }; -#endif +#endif /*SUPERTUX_CAMERA_H*/