From: Ricardo Cruz Date: Thu, 6 May 2004 12:47:45 +0000 (+0000) Subject: Made the back scrolling to work in debug mode (and also only). X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=116fbf233cc2e99597d75a685595d92b3677aafd;p=supertux.git Made the back scrolling to work in debug mode (and also only). If you want to test it, just run supertux as 'supertux --debug-mode'. SVN-Revision: 1004 --- diff --git a/src/world.cpp b/src/world.cpp index fdb1fda8e..1256420d9 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -320,9 +320,9 @@ void World::scrolling(double frame_ratio) { int tux_pos_x = (int)(tux.base.x + (tux.base.width/2)); - if (level->back_scrolling || debug_mode) + if (/*level->back_scrolling || */debug_mode) { - if(tux.old_dir != tux.dir && level->back_scrolling) + if(tux.old_dir != tux.dir) scrolling_timer.start(CHANGE_DIR_SCROLL_SPEED); if(scrolling_timer.check()) @@ -350,13 +350,13 @@ void World::scrolling(double frame_ratio) { if (tux.physic.get_velocity_x() > 0 && scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) + else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && debug_mode) scroll_x = tux_pos_x - X_SPACE; else { if (tux.dir == RIGHT && scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) + else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && debug_mode) scroll_x = tux_pos_x - X_SPACE; } } @@ -364,20 +364,10 @@ void World::scrolling(double frame_ratio) else /*no debug*/ { - if (tux.physic.get_velocity_x() > 0 && scroll_x < tux_pos_x - (screen->w - X_SPACE)) + if (scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) - scroll_x = tux_pos_x - X_SPACE; - else - { - if (tux.dir == RIGHT && scroll_x < tux_pos_x - (screen->w - X_SPACE)) - scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) - scroll_x = tux_pos_x - X_SPACE; } - } - // this code prevent the screen to scroll before the start or after the level's end if(scroll_x < 0) scroll_x = 0;