projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix issue with action not being updated when typing grow()/fire()/etc in console...
[supertux.git]
/
src
/
object
/
camera.cpp
diff --git
a/src/object/camera.cpp
b/src/object/camera.cpp
index
d840241
..
7cea284
100644
(file)
--- a/
src/object/camera.cpp
+++ b/
src/object/camera.cpp
@@
-77,21
+77,21
@@
public:
float dynamic_speed_sm;
CameraConfig() {
float dynamic_speed_sm;
CameraConfig() {
- xmode =
1
;
- ymode =
1
;
+ xmode =
4
;
+ ymode =
3
;
target_x = .5f;
target_x = .5f;
- target_y =
2.f/3.
f;
- max_speed_y = 1
4
0;
- max_speed_x = 1
3
0;
- clamp_x =
1.f/6.
f;
- clamp_y =
1.f/6.
f;
+ target_y =
.5
f;
+ max_speed_y = 1
0
0;
+ max_speed_x = 1
0
0;
+ clamp_x =
0.1666
f;
+ clamp_y =
0.3
f;
kirby_rectsize_x = 0.2f;
kirby_rectsize_y = 0.34f;
kirby_rectsize_x = 0.2f;
kirby_rectsize_y = 0.34f;
- edge_x =
1.f/3.
f;
- sensitive_x =
1.f/4.f
;
+ edge_x =
0.4
f;
+ sensitive_x =
-1
;
dynamic_max_speed_x = 1.0;
dirchange_time = 0.2f;
dynamic_max_speed_x = 1.0;
dirchange_time = 0.2f;
- dynamic_speed_sm =
1.0
f;
+ dynamic_speed_sm =
0.8
f;
}
void load(const std::string& filename)
}
void load(const std::string& filename)
@@
-262,7
+262,12
@@
Camera::update(float elapsed_time)
void
Camera::reload_config()
{
void
Camera::reload_config()
{
- config->load("camera.cfg");
+ try {
+ config->load("camera.cfg");
+ } catch(std::exception &e) {
+ log_debug << "Couldn't load camera.cfg, using defaults ("
+ << e.what() << ")" << std::endl;
+ }
}
float clamp(float val, float min, float max)
}
float clamp(float val, float min, float max)
@@
-305,7
+310,8
@@
Camera::update_scroll_normal(float elapsed_time)
{
const CameraConfig& config = *(this->config);
Player* player = sector->player;
{
const CameraConfig& config = *(this->config);
Player* player = sector->player;
- const Vector& player_pos = player->get_bbox().get_middle();
+ const Vector& player_pos = Vector(player->get_bbox().get_middle().x,
+ player->get_bbox().get_bottom());
static Vector last_player_pos = player_pos;
Vector player_delta = player_pos - last_player_pos;
last_player_pos = player_pos;
static Vector last_player_pos = player_pos;
Vector player_delta = player_pos - last_player_pos;
last_player_pos = player_pos;