]> git.sesse.net Git - ccbs/blobdiff - bigscreen/groupscreen.cpp
Added a short title for www.blonde girl.
[ccbs] / bigscreen / groupscreen.cpp
index 5e448ac12e6a8932624cab35cc0d5c5c3e10dda6..7f63cdd47fc410721414162178bdccdb739b8193 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];
@@ -44,7 +57,7 @@ void GroupScreen::draw(unsigned char *buf)
                                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);
                        }
                }
@@ -53,13 +66,15 @@ void GroupScreen::draw(unsigned char *buf)
        // 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);