From 9cb4ddebc6846c368354cc2269debd5d9f385e7a Mon Sep 17 00:00:00 2001 From: Martin Renold Date: Sun, 13 May 2007 12:11:02 +0000 Subject: [PATCH] turbo_speed defaults to 2.0 instead of 1.0 tuned scrolling speed range a bit (slightly slower) accel_time should be constant, added comments to clarify --- src/display.cpp | 10 +++++----- src/preferences.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/display.cpp b/src/display.cpp index eecd2261109..482529a0e98 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -94,7 +94,7 @@ display::display(unit_map& units, CVideo& video, const gamemap& map, invalidateAll_(true), invalidateUnit_(true), invalidateGameStatus_(true), panelsDrawn_(false), currentTeam_(0), activeTeam_(0), - turbo_speed_(1), turbo_(false), grid_(false), sidebarScaling_(1.0), + turbo_speed_(2), turbo_(false), grid_(false), sidebarScaling_(1.0), theme_(theme_cfg,screen_area()), builder_(cfg, level, map), first_turn_(true), in_game_(false), map_labels_(*this,map, 0), tod_hex_mask1(NULL), tod_hex_mask2(NULL), reach_map_changed_(true), @@ -601,8 +601,8 @@ void display::scroll_to_tile(int x, int y, SCROLL_TYPE scroll_type, bool check_f int t_prev = SDL_GetTicks(); // those values might need some fine-tuning: - const double accel_time = 0.3*turbo_speed(); // seconds - const double decel_time = 0.4*turbo_speed(); // seconds + const double accel_time = 0.3; // seconds until full speed is reached + const double decel_time = 0.4; // seconds from full speed to stop double velocity = 0.0; while (dist_moved < dist_total) { @@ -618,8 +618,8 @@ void display::scroll_to_tile(int x, int y, SCROLL_TYPE scroll_type, bool check_f //std::cout << t << " " << hypot(x_old, y_old) << "\n"; - double velocity_max = preferences::scroll_speed() * 80.0; - velocity_max *= turbo_speed(); + double velocity_max = preferences::scroll_speed() * 60.0; + velocity_max *= turbo_speed(); double accel = velocity_max / accel_time; double decel = velocity_max / decel_time; diff --git a/src/preferences.cpp b/src/preferences.cpp index 48eb6cf143e..211a99b8ea7 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -181,12 +181,12 @@ void _set_turbo(bool ison) double turbo_speed() { - return lexical_cast_default(prefs["turbo_speed"], 1); + return lexical_cast_default(prefs["turbo_speed"], 2); } void save_turbo_speed(const double speed) { - prefs["turbo_speed"] = lexical_cast_default(speed, "1"); + prefs["turbo_speed"] = lexical_cast_default(speed, "2"); } bool show_lobby_minimaps()