projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- beginnings of a wingling
[supertux.git]
/
src
/
camera.h
diff --git
a/src/camera.h
b/src/camera.h
index
aaa8e19
..
453a06a
100644
(file)
--- a/
src/camera.h
+++ b/
src/camera.h
@@
-19,9
+19,11
@@
#ifndef __VIEWPORT_H__
#define __VIEWPORT_H__
#ifndef __VIEWPORT_H__
#define __VIEWPORT_H__
+#include <vector>
#include "vector.h"
#include "game_object.h"
#include "serializable.h"
#include "vector.h"
#include "game_object.h"
#include "serializable.h"
+#include <cassert>
class LispReader;
class Player;
class LispReader;
class Player;
@@
-43,7
+45,7
@@
public:
}
/// parse camera mode from lisp file
}
/// 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);
/// write camera mode to a lisp file
virtual void write(LispWriter& writer);
@@
-59,10
+61,12
@@
public:
{
NORMAL, AUTOSCROLL, MANUAL
};
{
NORMAL, AUTOSCROLL, MANUAL
};
+ CameraMode mode;
private:
void scroll_normal(float elapsed_time);
void scroll_autoscroll(float elapsed_time);
private:
void scroll_normal(float elapsed_time);
void scroll_autoscroll(float elapsed_time);
+ void keep_in_bounds();
enum LeftRightScrollChange
{
enum LeftRightScrollChange
{
@@
-73,8
+77,21
@@
private:
Player* player;
Level* level;
Player* player;
Level* level;
- CameraMode mode;
+
+ // normal mode
+ bool do_backscrolling;
LeftRightScrollChange scrollchange;
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
};
#endif