X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Fccbs_bigscreen.cpp;h=5c91b9e045fe4cfce7d7fcc4f5a3ec963d56b61f;hp=fb53775f64e9d35ef194fc2e8554610eeac4df10;hb=5a591d5e5db52bb78fd794342f090c7db66211dd;hpb=876c65c3f4f828a54fa8041f5d68e3c4cae1d463 diff --git a/bigscreen/ccbs_bigscreen.cpp b/bigscreen/ccbs_bigscreen.cpp index fb53775..5c91b9e 100644 --- a/bigscreen/ccbs_bigscreen.cpp +++ b/bigscreen/ccbs_bigscreen.cpp @@ -9,8 +9,10 @@ #include "fetch_current_tournament.h" #include "fetch_list_of_active_groups.h" #include "fetch_group.h" +#include "fetch_auxilliary_screens.h" #include "fonts.h" #include "groupscreen.h" +#include "top10scorescreen.h" #include "splitscreen.h" #include "rotatescreen.h" @@ -22,6 +24,8 @@ unsigned char framebuf[800 * 600 * 4], screenbuf[800 * 600 * 4]; void init(pqxx::connection &conn) { + std::vector aux_screens; + if (screens.size() == 0 || mainscreen != screens[0]) delete mainscreen; @@ -51,6 +55,15 @@ void init(pqxx::connection &conn) } } + conn.perform(FetchAuxilliaryScreens(&aux_screens)); + for (std::vector::const_iterator i = aux_screens.begin(); i != aux_screens.end(); ++i) { + if (*i == widestring("top10scores")) { + screens.push_back(new Top10ScoreScreen(conn, active_tournament.id)); + continue; + } + std::fprintf(stderr, "Foobarbaz?\n"); + } + // hack screens.push_back(NULL); screens.push_back(NULL);