From a6425f3e55078bd6b9652f5f9e13bac3b3391cbb Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 19 Feb 2005 20:11:20 +0000 Subject: [PATCH 1/1] Add a main heading to each group. --- bigscreen/groupscreen.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/bigscreen/groupscreen.cpp b/bigscreen/groupscreen.cpp index ff8cbac..7f63cdd 100644 --- a/bigscreen/groupscreen.cpp +++ b/bigscreen/groupscreen.cpp @@ -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::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::const_iterator i = group.players.begin(); i != group.players.end(); ++i) { my_draw_text(i->nick, buf, 18.0, 20, y); -- 2.39.2