X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Fgroupscreen.cpp;h=cdd2633a1a684a8e799431be81b631651b421211;hp=d163069f711105cb3bf6500156843a385d5b09e8;hb=6c10aec4722be34e2aa39805c29c7fb057eb7707;hpb=3db3afdf96b85a9eeaef00167b434b9ace23be17 diff --git a/bigscreen/groupscreen.cpp b/bigscreen/groupscreen.cpp index d163069..cdd2633 100644 --- a/bigscreen/groupscreen.cpp +++ b/bigscreen/groupscreen.cpp @@ -276,15 +276,12 @@ void GroupScreen::draw_next_up_single(unsigned char *buf, const Group &group, */ const Player *next_player = get_next_player(group); const Score *next_song = NULL; - unsigned num_played = 0; // will not always be completely accurate, but always as accurate as we need it :-) for (unsigned i = 0; i < num_random_songs; ++i) { unsigned j = (i + next_player->position - 1) % num_random_songs; if (next_player->scores[j].score == -1) { next_song = &(next_player->scores[j]); break; - } else { - ++num_played; } } @@ -295,13 +292,19 @@ void GroupScreen::draw_next_up_single(unsigned char *buf, const Group &group, if (next_player->scores[j].score == -1) { next_song = &(next_player->scores[j]); break; - } else { - ++num_played; } } } if (next_song != NULL) { + // find out how many songs we've played in all + unsigned num_played = 0; + for (unsigned i = 0; i < num_scores; ++i) { + if (next_player->scores[i].score != -1) { + ++num_played; + } + } + bool last_song = (num_played == num_scores - 1); draw_next_up_player(buf, group, *next_player, *next_song, last_song, song_scores, player_scores, max_score, min_score); @@ -547,6 +550,7 @@ void GroupScreen::draw_next_up_player(unsigned char *buf, const Group &group, co } if (group.num_qualifying > 0 && + group.num_qualifying != group.players.size() && player.total + max_score_this_song > unsigned(qualify_beat_worst_case) && (unsigned(qualify_beat_worst_case) != win_beat)) { int qual_need = std::max(qualify_beat_worst_case - player.total + 1, 0U);