projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
64a64dc
)
at the left or right end, it's obvious which dir we will go next
author
Matthias Braun
<matze@braunis.de>
Sat, 3 Mar 2007 21:09:25 +0000
(21:09 +0000)
committer
Matthias Braun
<matze@braunis.de>
Sat, 3 Mar 2007 21:09:25 +0000
(21:09 +0000)
SVN-Revision: 4921
src/object/camera.cpp
patch
|
blob
|
history
diff --git
a/src/object/camera.cpp
b/src/object/camera.cpp
index
a0f6bc9
..
8ad604f
100644
(file)
--- a/
src/object/camera.cpp
+++ b/
src/object/camera.cpp
@@
-378,14
+378,21
@@
Camera::update_scroll_normal(float elapsed_time)
float LEFTEND = SCREEN_WIDTH * config.sensitive_x;
float RIGHTEND = SCREEN_WIDTH * (1-config.sensitive_x);
float LEFTEND = SCREEN_WIDTH * config.sensitive_x;
float RIGHTEND = SCREEN_WIDTH * (1-config.sensitive_x);
- /* if we're undecided then look if we crossed the left or right "sensitive"
- * area */
if(lookahead_mode == LOOKAHEAD_NONE) {
if(lookahead_mode == LOOKAHEAD_NONE) {
+ /* if we're undecided then look if we crossed the left or right
+ * "sensitive" area */
if(player_pos.x < translation.x + LEFTEND) {
lookahead_mode = LOOKAHEAD_LEFT;
} else if(player_pos.x > translation.x + RIGHTEND) {
lookahead_mode = LOOKAHEAD_RIGHT;
}
if(player_pos.x < translation.x + LEFTEND) {
lookahead_mode = LOOKAHEAD_LEFT;
} else if(player_pos.x > translation.x + RIGHTEND) {
lookahead_mode = LOOKAHEAD_RIGHT;
}
+ /* at the ends of a level it's obvious which way we will go */
+ if(player_pos.x < SCREEN_WIDTH*0.5) {
+ lookahead_mode = LOOKAHEAD_RIGHT;
+ } else if(player_pos.x >= sector->get_width() - SCREEN_WIDTH*0.5) {
+ lookahead_mode = LOOKAHEAD_LEFT;
+ }
+
changetime = -1;
} else if(lookahead_mode != walkDirection) {
/* player changed direction while camera was scrolling...
changetime = -1;
} else if(lookahead_mode != walkDirection) {
/* player changed direction while camera was scrolling...