conn.perform(FetchGroup(tournament, round, parallel, &group));
memset(buf, 0, 800 * 600 * 4);
+
+ // main heading
+ char heading[64];
+ if (parallel == 0) {
+ sprintf(heading, "Round %u", round);
+ } else {
+ sprintf(heading, "Round %u, Group %u", round, parallel);
+ }
+
+ {
+ unsigned width = my_draw_text(heading, NULL, 48.0);
+ my_draw_text(heading, buf, 48.0, 800/2 - width/2, 60);
+ }
// find out how wide each column has to be
unsigned width[16];
width[col] = std::max(width[col], my_draw_text(j->song.title, NULL, 12.0) +
max_num_width + 10);
} else {
- width[col] = std::max(width[col], my_draw_text(j->song.title, NULL, 12.0));
+ width[col] = std::max(width[col], my_draw_text(j->song.short_title, NULL, 12.0));
width[col] = std::max(width[col], max_num_width);
}
}
// make column headings from the first player's songs
unsigned col = 1, x = 40 + width[0];
for (std::vector<Score>::const_iterator i = group.players[0].scores.begin(); i != group.players[0].scores.end(); ++i, ++col) {
- if (!i->chosen)
- my_draw_text(i->song.title, buf, 12.0, x, 30);
+ if (!i->chosen) {
+ unsigned this_width = my_draw_text(i->song.short_title, NULL, 12.0);
+ my_draw_text(i->song.short_title, buf, 12.0, x + width[col] / 2 - this_width / 2, 100);
+ }
x += width[col] + 20;
}
// show all the players and the scores
- unsigned y = 70;
+ unsigned y = 140;
for (std::vector<Player>::const_iterator i = group.players.begin(); i != group.players.end(); ++i) {
my_draw_text(i->nick, buf, 18.0, 20, y);