+
+ // Find out which player is next. we want to show SHOW_PLAYERS players, centered
+ // around this as much as possible. (Usually, this will mean all, but not always.)
+ unsigned show_players = get_show_players(group);
+ const Player *center_player = get_next_player(group);
+
+ // find the index (kind of backwards...)
+ int player_index = -1;
+ for (unsigned i = 0; i < group.players.size(); ++i) {
+ if (&(group.players[i]) == center_player) {
+ player_index = i;
+ break;
+ }
+ }
+
+ assert(player_index >= 0);
+
+ int min_player = player_index - signed(show_players) / 2;
+ if (min_player + show_players > group.players.size()) // FIXME: songs_per_machine
+ min_player = group.players.size() - show_players;
+ if (min_player < 0)
+ min_player = 0;
+
+ draw_scores(td, group, min_player, colwidth);