From: Matthias Braun Date: Sat, 3 Mar 2007 21:31:20 +0000 (+0000) Subject: make it possible to disable the no-scroll mode X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=3d652d0090a20b5948f5e4ac3d2fed60b017ed94;p=supertux.git make it possible to disable the no-scroll mode SVN-Revision: 4922 --- diff --git a/data/camera.cfg b/data/camera.cfg index d13ecbb6d..e4d91ca81 100644 --- a/data/camera.cfg +++ b/data/camera.cfg @@ -18,7 +18,7 @@ (target-y 0.5) ; Speed is limited to these for the Yoshi cam - (max-speed-x 80) + (max-speed-x 100) (max-speed-y 100) ; Used in YI camera to adjust to max_speed relatively to player speed @@ -34,7 +34,10 @@ ; If YI camera is in no-scrollmode it will go to scrollmode again if tux ; reaches this part of the screen, make sure this value is bigger than edge-x ; to avoid sudden camera stops - (sensitive-x 0.35) + ; Set to <= 0 to deactivate nonscroll mode + + ;(sensitive-x 0.35) + (sensitive-x -1) (dirchange-time 0.2) ) diff --git a/src/object/camera.cpp b/src/object/camera.cpp index 8ad604f32..bd1ecde3d 100644 --- a/src/object/camera.cpp +++ b/src/object/camera.cpp @@ -61,6 +61,8 @@ public: float dirchange_time; // edge_x float edge_x; + // when too change from noscroll mode back to lookahead left/right mode + // set to <= 0 to disable noscroll mode float sensitive_x; float clamp_y; @@ -375,8 +377,14 @@ Camera::update_scroll_normal(float elapsed_time) else if (player->dir == ::LEFT) walkDirection = LOOKAHEAD_LEFT; else walkDirection = LOOKAHEAD_RIGHT; - float LEFTEND = SCREEN_WIDTH * config.sensitive_x; - float RIGHTEND = SCREEN_WIDTH * (1-config.sensitive_x); + float LEFTEND, RIGHTEND; + if(config.sensitive_x > 0) { + LEFTEND = SCREEN_WIDTH * config.sensitive_x; + RIGHTEND = SCREEN_WIDTH * (1-config.sensitive_x); + } else { + LEFTEND = SCREEN_WIDTH; + RIGHTEND = 0; + } if(lookahead_mode == LOOKAHEAD_NONE) { /* if we're undecided then look if we crossed the left or right