From 8635c49a5eb193104066b35b94bbe8e38e16c471 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 23 Dec 2018 14:01:07 +0100 Subject: [PATCH] racing:: race_advance --- racing.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/racing.cpp b/racing.cpp index 1871be7e..7f5def73 100644 --- a/racing.cpp +++ b/racing.cpp @@ -15,6 +15,8 @@ bool track_ready; int TWIDTH; +ld race_advance = 0; + static const int LENGTH = 250; static const int DROP = 1; @@ -618,6 +620,7 @@ void set_view() { hyperpoint h = T * inverse(T1) * at * C0; ld y = asin_auto(h[1]); ld x = asin_auto(h[0] / cos_auto(y)); + x += race_advance; // printf("%d %lf\n", z, x); transmatrix Z = T1 * inverse(T) * xpush(x); View = spin(race_angle * degree) * inverse(Z) * View; @@ -850,13 +853,16 @@ struct race_configurer { case mdDisk: pmodel = mdBand; conformal::model_orientation = race_angle; + race_advance = 1; break; case mdBand: pmodel = mdHalfplane; conformal::model_orientation = race_angle + 90; + race_advance = 0.5; break; default: pmodel = mdDisk; + race_advance = 0; } }); @@ -866,6 +872,11 @@ struct race_configurer { int q = conformal::model_orientation - race_angle; dialog::reaction = [q] () { conformal::model_orientation = race_angle + q; }; }); + + dialog::addSelItem(XLAT("race advance"), fts(race_advance), 'A'); + dialog::add_action([] () { + dialog::editNumber(race_advance, 0, 360, 0.1, 1, XLAT("race advance"), ""); + }); dialog::addItem(shmup::player_count_name(playercfg), 'n'); dialog::add_action([this] () {