From 6ea3cc4bcc18e87a2ef0c26ca8de09a1251403f4 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 18 Sep 2022 10:22:13 +0200 Subject: [PATCH] time_unit and pause_speed settings --- rogueviz/ads/control.cpp | 2 +- rogueviz/ads/display.cpp | 8 ++++---- rogueviz/ads/globals.cpp | 8 ++++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/rogueviz/ads/control.cpp b/rogueviz/ads/control.cpp index 287c03e4..0b62c392 100644 --- a/rogueviz/ads/control.cpp +++ b/rogueviz/ads/control.cpp @@ -164,7 +164,7 @@ bool ads_turn(int idelta) { } if(paused && a[16+11]) { - current = ads_matrix(spin(ang*degree) * xpush(mul*delta*-5) * spin(-ang*degree), 0) * current; + current = ads_matrix(spin(ang*degree) * xpush(mul*delta*-pause_speed) * spin(-ang*degree), 0) * current; } else apply_lorentz(spin(ang*degree) * lorentz(0, 2, -delta*accel*mul) * spin(-ang*degree)); diff --git a/rogueviz/ads/display.cpp b/rogueviz/ads/display.cpp index d1c85432..1add235a 100644 --- a/rogueviz/ads/display.cpp +++ b/rogueviz/ads/display.cpp @@ -88,7 +88,7 @@ void draw_game_cell(cell *cs, ads_matrix V, ld plev) { } if(view_proper_times) { - string str = format(tformat, center.shift / TAU); + string str = format(tformat, center.shift / time_unit); queuestr(shiftless(rgpushxto0(center.h)), .1, str, 0xFF4040, 8); } @@ -122,7 +122,7 @@ void draw_game_cell(cell *cs, ads_matrix V, ld plev) { 0x000000FF, rock.col, PPR::LINE); if(view_proper_times && rock.type != oParticle) { - string str = format(tformat, rock.pt_main.shift / TAU); + string str = format(tformat, rock.pt_main.shift / time_unit); queuestr(shiftless(rgpushxto0(rock.pt_main.h)), .1, str, 0xFFFFFF, 8); } } @@ -243,13 +243,13 @@ void view_ads_game() { poly_outline = 0xFF; if(view_proper_times) { - string str = format(tformat, ship_pt / TAU); + string str = format(tformat, ship_pt / time_unit); queuestr(shiftless(Id), .1, str, 0xFFFFFF, 8); } } if(paused && view_proper_times) { - string str = format(tformat, view_pt / TAU); + string str = format(tformat, view_pt / time_unit); queuestr(shiftless(Id), .1, str, 0xFFFF00, 8); } } diff --git a/rogueviz/ads/globals.cpp b/rogueviz/ads/globals.cpp index 28d7f380..71ef1565 100644 --- a/rogueviz/ads/globals.cpp +++ b/rogueviz/ads/globals.cpp @@ -8,6 +8,12 @@ ld simspeed = TAU; /** by how much do WAS keys accelerate */ ld accel = 6; +/** cursor movement speed while paused */ +ld pause_speed = 5; + +/** time unit for time display */ +ld time_unit = TAU; + /** transform world coordinates to current view coordinates */ ads_matrix current; @@ -70,4 +76,6 @@ player_data pdata, max_pdata, tank_pdata; bool auto_angle = true; +cell *starting_point; + }}