]> git.sesse.net Git - ccbs/blobdiff - bigscreen/groupscreen.cpp
Use short titles in the bigscreen headings.
[ccbs] / bigscreen / groupscreen.cpp
index 5e448ac12e6a8932624cab35cc0d5c5c3e10dda6..ff8cbace21439de9f30bf83844f0c2c7e023d3f8 100644 (file)
@@ -44,7 +44,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,8 +53,10 @@ 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, 30);
+               }
                x += width[col] + 20;
        }