Add a main heading to each group.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 19 Feb 2005 20:11:20 +0000 (20:11 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 19 Feb 2005 20:11:20 +0000 (20:11 +0000)
bigscreen/groupscreen.cpp

index ff8cbac..7f63cdd 100644 (file)
@@ -27,6 +27,19 @@ void GroupScreen::draw(unsigned char *buf)
        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];
@@ -55,13 +68,13 @@ void GroupScreen::draw(unsigned char *buf)
        for (std::vector<Score>::const_iterator i = group.players[0].scores.begin(); i != group.players[0].scores.end(); ++i, ++col) {
                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, 30);
+                       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);