X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Fgroupscreen.cpp;h=9150906d17f8645db7720070a8c77ccf7413249f;hp=e410de9b15019b5331e18e4d43fbd056d29db0f5;hb=43f74cfb6708acd8f2c3e7f1ce9e800da28bc0f9;hpb=5271fcfed7f46d4fe481c63f4ea049e6fb83e8c4 diff --git a/bigscreen/groupscreen.cpp b/bigscreen/groupscreen.cpp index e410de9..9150906 100644 --- a/bigscreen/groupscreen.cpp +++ b/bigscreen/groupscreen.cpp @@ -1,8 +1,9 @@ #include "groupscreen.h" #include "fetch_group.h" +#include "fonts.h" GroupScreen::GroupScreen(pqxx::connection &conn, unsigned tournament, unsigned round, unsigned parallel) - : tournament(tournament), round(tournament), parallel(parallel), scores_changed(conn, "scores"), conn(conn), valid(false) + : tournament(tournament), round(round), parallel(parallel), scores_changed(conn, "scores"), conn(conn), valid(false) { } @@ -23,6 +24,25 @@ void GroupScreen::draw(unsigned char *buf) Group group; conn.perform(FetchGroup(tournament, round, parallel, &group)); + memset(buf, 0, 800 * 600 * 4); + + // just as a test, show all the players and the scores (no headings) + unsigned y = 50; + for (std::vector::const_iterator i = group.players.begin(); i != group.players.end(); ++i) { + my_draw_text(i->nick, buf, 20, y, true, 255, 255, 255); + + unsigned x = 90; + for (std::vector::const_iterator j = i->scores.begin(); j != i->scores.end(); ++j) { + char text[16]; + sprintf(text, "%u", j->score); + + my_draw_text(text, buf, x, y, true, 255, 255, 255); + x += 60; + } + + y += 20; + } + valid = true; }