6 #include "resolution.h"
7 #include "groupscreen.h"
8 #include "fetch_group.h"
9 #include "fetch_max_score_for_songs.h"
10 #include "fetch_max_score_for_players.h"
11 #include "fetch_needs_update.h"
12 #include "fetch_highscore.h"
16 GroupScreen::GroupScreen(pqxx::connection &conn, unsigned tournament, unsigned round, unsigned parallel, unsigned machine, unsigned num_machines, unsigned players_per_machine)
17 : tournament(tournament), round(round), parallel(parallel), machine(machine), num_machines(num_machines), players_per_machine(players_per_machine), scores_changed(conn, "scores"), conn(conn), valid(false)
21 GroupScreen::~GroupScreen()
25 bool GroupScreen::check_invalidated()
29 if (!scores_changed.get_flag())
31 scores_changed.reset_flag();
34 conn.perform(FetchNeedsUpdate(last_updated, tournament, round, parallel, &needs_update));
36 valid = !needs_update;
40 unsigned GroupScreen::get_show_players(const Group &group)
42 unsigned num_players_this_machine = (group.players.size() + num_machines - machine - 1) / num_machines;
43 return std::min(num_players_this_machine, 9U);
46 void GroupScreen::draw_main_heading(std::vector<TextDefer> &td)
49 if (num_machines == 1) {
51 std::sprintf(heading, "Round %u", round);
53 std::sprintf(heading, "Round %u, Group %u", round, parallel);
57 std::sprintf(heading, "Round %u, Machine %u", round, machine + 1);
59 std::sprintf(heading, "Round %u, Group %u, Machine %u", round, parallel, machine + 1);
63 unsigned width = my_draw_text(heading, NULL, 40.0, "mainheading");
64 my_draw_text_deferred(td, heading, 40.0, "mainheading", "mainheading", LOGICAL_SCREEN_WIDTH/2 - width/2, 60);
67 // make column headings from the first player's songs
68 void GroupScreen::draw_column_headings(std::vector<TextDefer> &td, const Group &group, const std::vector<unsigned> &colwidth)
70 unsigned num_scores = group.players[0].scores.size();
73 unsigned x = 40 + colwidth[0];
74 for (std::vector<Score>::const_iterator i = group.players[0].scores.begin(); i != group.players[0].scores.end(); ++i, ++col) {
76 unsigned this_width = my_draw_text(i->song.short_title, NULL, 12.0, "columnheading");
77 my_draw_text_deferred(td, i->song.short_title, 12.0, "columnheading", "columnheading", x + colwidth[col] / 2 - this_width / 2, 100);
79 x += colwidth[col] + 20;
83 unsigned this_width = my_draw_text("Total", NULL, 12.0, "columnheading");
84 my_draw_text_deferred(td, "Total", 12.0, "columnheading", "columnheading", x + colwidth[num_scores + 1] / 2 - this_width / 2, 100);
85 x += colwidth[num_scores + 1] + 20;
87 unsigned this_width = my_draw_text("Rank", NULL, 12.0, "columnheading");
88 my_draw_text_deferred(td, "Rank", 12.0, "columnheading", "columnheading", x + colwidth[num_scores + 2] / 2 - this_width / 2, 100);
91 // show all the players and the scores
92 void GroupScreen::draw_scores(std::vector<TextDefer> &td, const Group &group, unsigned min_player, const std::vector<unsigned> &colwidth)
94 unsigned max_num_width = my_draw_text("8888", NULL, 22.0, "data");
95 unsigned num_scores = group.players[0].scores.size();
96 unsigned show_players = get_show_players(group);
97 unsigned y = (show_players <= 7) ? 140 : (140 - (show_players - 7) * 5);
99 unsigned row = 0, m = 0, x;
100 for (std::vector<Player>::const_iterator i = group.players.begin(); i != group.players.end() && row < 9; ++i) {
101 if (m++ % num_machines != machine)
103 if (m-1 < min_player)
106 my_draw_text_deferred(td, i->nick, 18.0, "rowheading", "rowheading", 20, y);
108 x = 40 + colwidth[0];
111 for (std::vector<Score>::const_iterator j = i->scores.begin(); j != i->scores.end(); ++j, ++col) {
113 if (j->score != -1) {
114 std::sprintf(text, "%u", j->score);
117 unsigned this_width = my_draw_text(text, NULL, 22.0, "data");
119 my_draw_text_deferred(td, text, 22.0, "data", "freshdata", x + max_num_width - this_width, y);
121 // draw the long name if we can, otherwise use the short one
122 if (my_draw_text(j->song.title, NULL, 12.0, "data") > (colwidth[col] - 10 - max_num_width)) {
123 my_draw_text_deferred(td, j->song.short_title, 12.0, "data", "freshdata", x + max_num_width + 10, y);
125 my_draw_text_deferred(td, j->song.title, 12.0, "data", "freshdata", x + max_num_width + 10, y);
128 my_draw_text_deferred(td, text, 22.0, "data", "freshdata", x + colwidth[col] / 2 - this_width / 2, y);
130 x += colwidth[col] + 20;
134 if (num_scores > 1) {
136 std::sprintf(text, "%u", i->total);
138 unsigned this_width = my_draw_text(text, NULL, 22.0, "data");
139 my_draw_text_deferred(td, text, 22.0, "data", "freshdata", x + colwidth[num_scores + 1] / 2 - this_width / 2, y);
140 x += colwidth[num_scores + 1] + 20;
143 if (show_players > 7)
144 y += 40 - (show_players - 7) * 4;
152 * Find out how wide each column has to be. First try unlimited width (ie.
153 * long titles for everything); if that gets too long, try again with short
154 * titles for chosen songs.
156 void GroupScreen::find_column_widths(const Group &group, std::vector<unsigned> &colwidth)
159 unsigned max_num_width = my_draw_text("8888", NULL, 22.0, "data");
160 unsigned sumcolwidth;
162 for (unsigned mode = 0; mode < 2; ++mode) {
163 for (std::vector<Player>::const_iterator i = group.players.begin(); i != group.players.end(); ++i) {
166 if (colwidth.size() == 0)
167 colwidth.push_back(0);
169 colwidth[0] = std::max(colwidth[0], my_draw_text(i->nick, NULL, 18.0, "data"));
171 for (std::vector<Score>::const_iterator j = i->scores.begin(); j != i->scores.end(); ++j, ++col) {
172 if (colwidth.size() < col+1)
173 colwidth.push_back(0);
176 colwidth[col] = std::max(colwidth[col], my_draw_text((mode == 0) ? j->song.title : j->song.short_title, NULL, 12.0, "data") +
179 colwidth[col] = std::max(colwidth[col], my_draw_text(j->song.short_title, NULL, 12.0, "data"));
180 colwidth[col] = std::max(colwidth[col], max_num_width);
185 num_scores = group.players[0].scores.size();
187 if (colwidth.size() < num_scores + 2) {
188 colwidth.push_back(0);
189 colwidth.push_back(0);
192 if (num_scores > 1) {
193 colwidth[num_scores + 1] = std::max(my_draw_text("Total", NULL, 12.0, "columnheading"), max_num_width);
195 colwidth[num_scores + 2] = my_draw_text("Rank", NULL, 12.0, "columnheading");
197 // if we're at long titles and that works, don't try the short ones
200 for (unsigned i = 0; i <= num_scores + 2; ++i)
201 sumcolwidth += colwidth[i] + 20;
203 if (sumcolwidth < LOGICAL_SCREEN_WIDTH - 20)
207 colwidth.erase(colwidth.begin(), colwidth.end());
212 * If we have space to go, distribute as much as we can to the chosen song column, so we won't have
213 * total and rank jumping around.
215 if (sumcolwidth < LOGICAL_SCREEN_WIDTH - 20) {
216 int first_chosen_col = -1;
219 for (std::vector<Score>::const_iterator i = group.players[0].scores.begin(); i != group.players[0].scores.end(); ++i, ++col) {
221 first_chosen_col = col;
226 if (first_chosen_col != -1) {
227 colwidth[first_chosen_col] += LOGICAL_SCREEN_WIDTH - 20 - sumcolwidth;
232 /* Find the first player with the fewest songs played and part of this machine. */
233 const Player *GroupScreen::get_next_player(const Group &group)
235 unsigned min_played_songs = 9999;
236 const Player *next_player = NULL;
238 for (std::vector<Player>::const_iterator i = group.players.begin(); i != group.players.end(); ++i) {
239 unsigned this_played = 0;
240 for (std::vector<Score>::const_iterator j = i->scores.begin(); j != i->scores.end(); ++j) {
245 if ((m++ % num_machines == machine) && this_played < min_played_songs) {
246 min_played_songs = this_played;
255 * At the bottom, for a single player, is "who's playing, what will he/she be
256 * playing, and optionally, how much to lead/win and how much to secure
257 * qualification" (the last one only in the final round). We assume playing is
258 * done in a modified zigzag; all the random songs are played first in
259 * zigzag/wrapping order (player 1 song 1, player 2 song 2, player 3 song 3,
260 * player 1 song 2, player 2 song 3, player 3 song 1, etc... assuming three
261 * songs and three players) and then all the chosen songs are played (we assume
262 * only one chosen song).
264 * The lines are as follows:
268 * High score: <hs> by <hsplayer> at <hsevent>
269 * Needs to lead: <leadscore>
270 * Needs to secure qualification: <qualscore>
271 * Needs to win group: <winscore>
273 void GroupScreen::draw_next_up_single(unsigned char *buf, const Group &group,
274 std::map<unsigned, unsigned> &song_scores, std::map<unsigned, unsigned> &player_scores,
275 const std::vector<unsigned> &max_score, const std::vector<unsigned> &min_score)
277 unsigned num_scores = group.players[0].scores.size();
279 // Find out how many random songs there are (equal for all players).
280 unsigned num_random_songs = 0;
281 for (std::vector<Score>::const_iterator i = group.players[0].scores.begin(); i != group.players[0].scores.end(); ++i) {
287 * Find out which player is next, and what song he she is supposed to play. First
290 const Player *next_player = get_next_player(group);
291 const Score *next_song = NULL;
293 for (unsigned i = 0; i < num_random_songs; ++i) {
294 unsigned j = (i + next_player->position - 1) % num_random_songs;
295 if (next_player->scores[j].score == -1) {
296 next_song = &(next_player->scores[j]);
301 // then all songs, if that didn't work out (slightly icky, but hey)
302 if (next_song == NULL) {
303 for (unsigned i = 0; i < num_scores; ++i) {
304 unsigned j = (i + next_player->position) % num_scores;
305 if (next_player->scores[j].score == -1) {
306 next_song = &(next_player->scores[j]);
312 if (next_song != NULL) {
313 // find out how many songs we've played in all
314 unsigned num_played = 0;
315 for (unsigned i = 0; i < num_scores; ++i) {
316 if (next_player->scores[i].score != -1) {
321 bool last_song = (num_played == num_scores - 1);
323 draw_next_up_player(buf, group, *next_player, *next_song, last_song, song_scores, player_scores, max_score, min_score);
328 * Some tournaments allow versus play in the initial rounds to save time; this is
329 * of course for random songs only. In this case, the scheme from draw_next_up_single()
330 * is somewhat changed, as we zig-zag across pairs instead of players. (If there's a
331 * stray person left in the group, that player plays the song by him-/herself as in
332 * a usual single tournament.
334 void GroupScreen::draw_next_up_versus(unsigned char *buf, const Group &group,
335 std::map<unsigned, unsigned> &song_scores, std::map<unsigned, unsigned> &player_scores,
336 const std::vector<unsigned> &max_score, const std::vector<unsigned> &min_score)
338 // Find out how many random songs there are (equal for all players).
339 unsigned num_random_songs = 0;
340 for (std::vector<Score>::const_iterator i = group.players[0].scores.begin(); i != group.players[0].scores.end(); ++i) {
345 // Find the next player and what song he/she is supposed to play, if any.
346 const Player *next_player = get_next_player(group);
347 const Score *next_song = NULL;
350 for (unsigned i = 0; i < num_random_songs; ++i) {
351 unsigned j = (i + (next_player->position - 1) / 2) % num_random_songs;
352 if (next_player->scores[j].score == -1) {
353 next_song = &(next_player->scores[j]);
360 * If there's no match, we're on the chosen songs (or done),
361 * so just delegate to draw_up_single().
363 if (next_song == NULL) {
364 draw_next_up_single(buf, group, song_scores, player_scores, max_score, min_score);
369 * Look for a player with the same amount of random songs played _and_ missing
372 unsigned num_songs_played = 0;
373 for (unsigned i = 0; i < num_random_songs; ++i) {
374 if (next_player->scores[i].score != -1) {
380 const Player *other_player = NULL;
381 for (std::vector<Player>::const_iterator i = group.players.begin(); i != group.players.end(); ++i) {
382 if ((m++ % num_machines != machine))
384 if (i->id == next_player->id)
387 unsigned this_songs_played = 0;
388 for (unsigned j = 0; j < num_random_songs; ++j) {
389 if (i->scores[j].score != -1) {
394 if (this_songs_played != num_songs_played)
397 if (i->scores[song_num].score == -1) {
398 other_player = &(*i);
403 // If we didn't find another player, just draw the one we have as usual.
404 if (other_player == NULL) {
405 draw_next_up_player(buf, group, *next_player, *next_song, false,
406 song_scores, player_scores, max_score, min_score);
410 // OK, we have two players. Draw their nicks and the scores
411 widestring text = widestring("Next players: ") + next_player->nick + widestring(" and ") + other_player->nick;
412 unsigned this_width = my_draw_text(text, NULL, 24.0, "data");
413 my_draw_text(text, buf, 24.0, "data", (LOGICAL_SCREEN_WIDTH/2) - this_width/2, 420);
415 if (next_song->song.id != -1) {
416 this_width = my_draw_text(next_song->song.title, NULL, 20.0, "data");
417 my_draw_text(next_song->song.title, buf, 20.0, "data", (LOGICAL_SCREEN_WIDTH/2) - this_width/2, 457);
420 conn.perform(FetchHighscore(next_song->song.id, &hs));
422 if (hs.score != -1) {
423 text = widestring("High score: ") + widestring(pqxx::to_string(hs.score)) +
424 widestring(", by ") + hs.nick + widestring(" in ") + hs.tournament_name;
425 this_width = my_draw_text(text, NULL, 16.0, "data");
426 my_draw_text(text, buf, 16.0, "data", (LOGICAL_SCREEN_WIDTH/2) - this_width/2, 487);
431 void GroupScreen::draw_next_up_player(unsigned char *buf, const Group &group, const Player &player, const Score &song, bool last_song,
432 std::map<unsigned, unsigned> &song_scores, std::map<unsigned, unsigned> &player_scores,
433 const std::vector<unsigned> &max_score, const std::vector<unsigned> &min_score)
435 widestring text = widestring("Next player: ") + player.nick;
436 unsigned this_width = my_draw_text(text, NULL, 24.0, "data");
437 my_draw_text(text, buf, 24.0, "data", (LOGICAL_SCREEN_WIDTH/2) - this_width/2, 420);
439 if (song.song.id != -1) {
440 this_width = my_draw_text(song.song.title, NULL, 20.0, "data");
441 my_draw_text(song.song.title, buf, 20.0, "data", (LOGICAL_SCREEN_WIDTH/2) - this_width/2, 457);
444 conn.perform(FetchHighscore(song.song.id, &hs));
446 if (hs.score != -1) {
447 text = widestring("High score: ") + widestring(pqxx::to_string(hs.score)) +
448 widestring(", by ") + hs.nick + widestring(" in ") + hs.tournament_name;
449 this_width = my_draw_text(text, NULL, 16.0, "data");
450 my_draw_text(text, buf, 16.0, "data", (LOGICAL_SCREEN_WIDTH/2) - this_width/2, 487);
454 // only show lead/win/qualify for the last song
457 * Find out how much we need to lead, how much we need to be guaranteed
458 * to win the group, and how much we need to secure qualification.
461 // find the best score we can get
462 unsigned max_score_this_song;
463 if (song.song.id != -1) {
464 // random song, or we know what song the player picked
465 max_score_this_song = song_scores[song.song.id];
467 max_score_this_song = player_scores[player.id];
472 // see what score this player must beat to lead
473 unsigned lead_beat = 0, win_beat = 0;
474 for (unsigned i = 0; i < group.players.size(); ++i) {
475 if (group.players[i].id == player.id)
478 lead_beat = std::max(lead_beat, group.players[i].total);
481 // find the best max score among the others
482 for (unsigned i = 0; i < group.players.size(); ++i) {
483 if (group.players[i].id == player.id)
486 win_beat = std::max(win_beat, max_score[i]);
490 * There's a somewhat subtle point here. Normally, what a player would be interested in
491 * with regard to qualification would be a set of three values:
493 * 1. How much is the absolute minimum required to qualify, given that all others
495 * 2. How much will give a reasonable chance of qualifying, given the expected performance
497 * 3. How much will be enough to secure qualification, no matter what?
499 * Given perfect guessing, #2 would be "how much is needed to qualify"; however, it is
500 * completely impossible to give an exact value for that, and we're not into the guessing
501 * games. :-) #1 is often so low it's completely unrealistic (ie. far enough from #2 that
502 * it's not interesting), but #3, the most conservative estimate, is often a good measure.
503 * #3 is "how much is needed to _secure_ qualification", and that is usually what we
504 * print out when it's possible.
506 * However, in a few situations, #1 and #3 will be the exact same value, from which it
507 * follows (from the squeeze law, or just common sense :-) ) that #2 will be the same
508 * value as #1 and #3. (This usually happens near or at the end of a group.) In that
509 * case, we know the value we seek (ie. "how much is needed to qualify"), so we drop
510 * the word "secure" and just print it as-is.
512 * To find #1 and #3, we sort and pick out the values we need to beat in the best and
515 int qualify_beat_worst_case = -1, qualify_beat_best_case = -1;
517 if (group.num_qualifying > 0) {
518 std::vector<unsigned> tmp;
520 for (unsigned i = 0; i < group.players.size(); ++i) {
521 if (group.players[i].id == player.id)
523 tmp.push_back(max_score[i]);
525 std::sort(tmp.begin(), tmp.end());
526 qualify_beat_worst_case = tmp[tmp.size() - group.num_qualifying];
528 std::vector<unsigned> tmp2;
529 for (unsigned i = 0; i < group.players.size(); ++i) {
530 if (group.players[i].id == player.id)
532 tmp2.push_back(min_score[i]);
535 std::sort(tmp2.begin(), tmp2.end());
536 qualify_beat_best_case = tmp2[tmp2.size() - group.num_qualifying];
539 // print out the lines we can attain
540 if (player.total + max_score_this_song > lead_beat && (lead_beat != win_beat)) {
541 int lead_need = std::max(lead_beat - player.total + 1, 0U);
544 text = widestring("Needs to lead: ") + widestring(pqxx::to_string(lead_need));
545 this_width = my_draw_text(text, NULL, 18.0, "data");
546 my_draw_text(text, buf, 18.0, "data", (LOGICAL_SCREEN_WIDTH/2) - this_width/2, y);
552 if (player.total + max_score_this_song > win_beat) {
553 int win_need = std::max(win_beat - player.total + 1, 0U);
556 text = widestring("Needs to win: ") + widestring(pqxx::to_string(win_need));
558 this_width = my_draw_text(text, NULL, 18.0, "data");
559 my_draw_text(text, buf, 18.0, "data", (LOGICAL_SCREEN_WIDTH/2) - this_width/2, y);
565 if (group.num_qualifying > 0 &&
566 group.num_qualifying != group.players.size() &&
567 player.total + max_score_this_song > unsigned(qualify_beat_worst_case) &&
568 (unsigned(qualify_beat_worst_case) != win_beat)) {
569 int qual_need = std::max(qualify_beat_worst_case - player.total + 1, 0U);
572 if (qualify_beat_worst_case == qualify_beat_best_case) {
573 text = widestring("Needs to qualify: ") + widestring(pqxx::to_string(qual_need));
575 text = widestring("Needs to secure qualification: ") + widestring(pqxx::to_string(qual_need));
578 this_width = my_draw_text(text, NULL, 18.0, "data");
579 my_draw_text(text, buf, 18.0, "data", (LOGICAL_SCREEN_WIDTH/2) - this_width/2, y);
587 // some refactoring done, more should be
588 void GroupScreen::draw(unsigned char *buf, unsigned width, unsigned height)
590 std::vector<TextDefer> td;
592 scores_changed.reset_flag();
593 set_screen_size(width, height);
596 * We'll probably need some values from here later on (although not all), just fetch them
597 * all while we're at it.
599 std::map<unsigned, unsigned> song_scores, player_scores;
600 conn.perform(FetchMaxScoreForSongs(tournament, &song_scores));
601 conn.perform(FetchMaxScoreForPlayers(tournament, round, &player_scores));
604 conn.perform(FetchGroup(tournament, round, parallel, &group));
605 gettimeofday(&last_updated, NULL);
607 fill_background(buf, width, height);
609 std::vector<unsigned> colwidth;
611 draw_main_heading(td);
612 find_column_widths(group, colwidth);
613 draw_column_headings(td, group, colwidth);
615 // Find out which player is next. we want to show SHOW_PLAYERS players, centered
616 // around this as much as possible. (Usually, this will mean all, but not always.)
617 unsigned show_players = get_show_players(group);
618 const Player *center_player = get_next_player(group);
620 // find the index (kind of backwards...)
621 int player_index = -1;
622 for (unsigned i = 0; i < group.players.size(); ++i) {
623 if (&(group.players[i]) == center_player) {
629 assert(player_index >= 0);
631 int min_player = player_index - signed(show_players) / 2;
632 if (min_player + show_players > group.players.size()) // FIXME: songs_per_machine
633 min_player = group.players.size() - show_players;
637 draw_scores(td, group, min_player, colwidth);
639 unsigned num_scores = group.players[0].scores.size();
642 * Approximate (but probably working quite well in practice) heuristic
643 * for finding the min and max rank of a player works as follows:
645 * First of all, find out, for each player in the group, what the
646 * maximum remaining score possibly can be (the minimum score is of
647 * course identical to the player's current total). For a random song,
648 * this is of course 1000 * (maximum feet rating) (but of course, that
649 * depends on whether we can play single or double! for now, assume
650 * double is okay, but this logic will be deferred to FetchMaxScore
651 * anyhow); for a random song, we simply pick the highest-ranking song
652 * we can find, EXCEPT those the player has chosen earlier AND the
653 * random songs this round, AND all random songs from elimination rounds
654 * (ie. rounds with only one group). (Phew!) This doesn't solve problems
655 * we'd face with more than one chosen song, but it should be good enough.
657 * After we've found the max and min scores for all players, it's a simple
658 * matter of sorting; the best attainable rank for player X is obtained if
659 * X gets max score and all others get min score, the worst attainable rank
660 * is obtained if X gets min score and all others get max score.
662 std::vector<unsigned> max_score, min_score;
663 for (std::vector<Player>::const_iterator i = group.players.begin(); i != group.players.end(); ++i) {
664 unsigned min_score_tp = 0, max_score_tp = 0;
665 for (std::vector<Score>::const_iterator j = i->scores.begin(); j != i->scores.end(); ++j) {
666 if (j->score != -1) {
668 min_score_tp += j->score;
669 max_score_tp += j->score;
671 unsigned max_score_this_song;
672 if (j->song.id != -1) {
673 // random song, or we know what song the player picked
674 max_score_this_song = song_scores[j->song.id];
676 max_score_this_song = player_scores[i->id];
678 max_score_tp += max_score_this_song;
681 max_score.push_back(max_score_tp);
682 min_score.push_back(min_score_tp);
685 // now finally find min and max rank, and draw it all
686 unsigned y = (show_players <= 7) ? 140 : (140 - (show_players - 7) * 5);
687 for (unsigned i = 0; i < group.players.size() && (i/num_machines) < show_players+min_player; ++i) {
688 unsigned best_rank = 1, worst_rank = 1;
689 for (unsigned j = 0; j < group.players.size(); ++j) {
693 if (max_score[i] < min_score[j])
695 if (min_score[i] <= max_score[j])
700 if (best_rank == worst_rank)
701 std::sprintf(text, "%u", best_rank);
703 std::sprintf(text, "%u-%u", best_rank, worst_rank);
705 if (i % num_machines != machine)
707 if (signed(i) < min_player)
710 // find out where to place this
711 unsigned x = 40 + colwidth[0];
712 for (unsigned j = 1; j <= num_scores + 1; ++j)
713 x += colwidth[j] + 20;
715 // minor correction :-)
719 unsigned this_width = my_draw_text(text, NULL, 22.0, "data");
720 my_draw_text_deferred(td, text, 22.0, "data", "freshdata", x + colwidth[num_scores + 2] / 2 - this_width / 2, y);
722 if (show_players > 7)
723 y += 40 - (show_players - 7) * 4;
728 if (players_per_machine == 2)
729 draw_next_up_versus(buf, group, song_scores, player_scores, max_score, min_score);
731 draw_next_up_single(buf, group, song_scores, player_scores, max_score, min_score);
734 draw_all_deferred_text(buf, td, last_text);
738 int GroupScreen::get_priority()