From a989214a460882ffdf179dfe19995268027e21c8 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 7 Jan 2019 04:53:09 +0100 Subject: [PATCH] racing:: guiding line feature --- racing.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/racing.cpp b/racing.cpp index 500d533f..982fca7d 100644 --- a/racing.cpp +++ b/racing.cpp @@ -9,6 +9,8 @@ namespace hr { namespace racing { +bool guiding = false; + bool on; bool player_relative = false; bool track_ready; @@ -887,6 +889,9 @@ struct race_configurer { dialog::add_action([] () { dialog::editNumber(race_advance, 0, 360, 0.1, 1, XLAT("race advance"), ""); }); + + dialog::addBoolItem(XLAT("guiding line"), guiding, 'g'); + dialog::add_action([] () { guiding = !guiding; }); dialog::addItem(shmup::player_count_name(playercfg), 'n'); dialog::add_action([this] () { @@ -1013,19 +1018,23 @@ void draw_ghost(ghost& ghost) { if(!gmatrix.count(w)) return; dynamicval x(getcs(), ghost.cs); - transmatrix T = spin_uchar(p->alpha) * xpush(uchar_to_frac(p->distance) * distance_multiplier) * spin_uchar(p->beta); - if(ghost.cs.charid == -1) { dynamicval pc(peace::on, true); - drawMonsterType(eMonster(ghost.cs.uicolor), w, gmatrix[w] * T, ghost.cs.dresscolor, uchar_to_frac(p->footphase)); + drawMonsterType(eMonster(ghost.cs.uicolor), w, get_ghostmoment(*p), ghost.cs.dresscolor, uchar_to_frac(p->footphase)); return; } - drawMonsterType(moPlayer, w, gmatrix[w] * T, 0, uchar_to_frac(p->footphase)); + drawMonsterType(moPlayer, w, get_ghostmoment(*p), 0, uchar_to_frac(p->footphase)); } void markers() { if(!racing::on) return; + if(guiding) for(int i=0; ipat * xpush0(j), m->pat * xpush0(j+1), multi::scs[i].uicolor, 2); + } if(racing::player_relative) { using namespace racing; cell *goal = NULL;