#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)
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<Player>::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<Score>::const_iterator j = i->scores.begin(); j != i->scores.end(); ++j) {
+ my_draw_text(widestring("1234"), buf, x, y, true, 255, 255, 255);
+ x += 60;
+ }
+
+ y += 20;
+ }
+
valid = true;
}
static iconv_t ucs4_iconv;
static bool iconv_initialized = false;
+widestring::widestring(const char *from)
+{
+ *this = from;
+}
+
void widestring::operator= (const char *from)
{
if (!iconv_initialized) {