From 39bce25b25b9de9ad613aaba5f85fc3f19793089 Mon Sep 17 00:00:00 2001 From: Arne Sund Date: Sat, 21 Feb 2015 11:22:34 +0100 Subject: Added support for more colors --- planning/planning.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'planning/planning.cpp') diff --git a/planning/planning.cpp b/planning/planning.cpp index dd06179..a952d02 100644 --- a/planning/planning.cpp +++ b/planning/planning.cpp @@ -560,7 +560,11 @@ void Planner::print_switch(const Graph &g, int i, int distro) logprintf("(XXXX)"); #endif } else { - logprintf("[%u;22m%u ", distro + 32, distro); + if(distro >= 6) + logprintf("[%u;1m%u ", distro + 32 - 7, distro); + else + logprintf("[%u;22m%u ", distro + 32, distro); + int this_distance = find_distance(switches[i], distro); #if TRUNCATE_METRIC @@ -615,10 +619,16 @@ int Planner::do_work(int distro_placements[NUM_DISTRO]) char distro_marker_right[16] = " "; for (int d = 0; d < NUM_DISTRO; ++d) { if (int(row) == distro_placements[d]) { - sprintf(distro_marker_left, "[%u;1m*", d + 32); + if(d >= 6) + sprintf(distro_marker_left, "[%u;1m*", d + 32 - 7); + else + sprintf(distro_marker_left, "[%u;22m*", d + 32); } if (int(row) == -distro_placements[d]) { - sprintf(distro_marker_right, "[%u;1m*", d + 32); + if(d >= 6) + sprintf(distro_marker_right, "[%u;22m*", d + 32 - 7); + else + sprintf(distro_marker_right, "[%u;1m*", d + 32); } } -- cgit v1.2.3