conn.perform(FetchGroup(tournament, round, parallel, &group));
gettimeofday(&last_updated, NULL);
- fill_background(buf, width, height);
+ fill_background(buf, "groupscreen", width, height);
std::vector<unsigned> colwidth;
divider.green=127
divider.blue=127
-# available elements: background, mainheading, (fresh)columnheading, randomsongname, nextsonginfo, need, divider
+# available elements: background.groupscreen, background.top5chosenscreen, background.top10scorescreen, mainheading, (fresh)columnheading, randomsongname, nextsonginfo, need, divider
# available elements that also have .odd and .even: rowheading, (fresh)score, (fresh)chosensongname, (fresh)totalscore, (fresh)rank
return config["default." + subkey];
}
-void fill_background(unsigned char *buf, unsigned width, unsigned height)
+void fill_background(unsigned char *buf, const std::string &screen_name, unsigned width, unsigned height)
{
- int bg_r = atoi(get_theme_config("background", "red").c_str());
- int bg_g = atoi(get_theme_config("background", "green").c_str());
- int bg_b = atoi(get_theme_config("background", "blue").c_str());
+ std::string key = "background." + screen_name;
+ int bg_r = atoi(get_theme_config(key, "red").c_str());
+ int bg_g = atoi(get_theme_config(key, "green").c_str());
+ int bg_b = atoi(get_theme_config(key, "blue").c_str());
unsigned char *ptr = buf;
for (unsigned i = 0; i < width * height; ++i) {
void init_theme();
std::string get_theme_config(const std::string &key, const std::string subkey);
-void fill_background(unsigned char *buf, unsigned width, unsigned height);
+void fill_background(unsigned char *buf, const std::string &screen_name, unsigned width, unsigned height);
#define LOGICAL_SCREEN_WIDTH (atoi(get_theme_config("screen", "logical_width").c_str()))
#define LOGICAL_SCREEN_HEIGHT (atoi(get_theme_config("screen", "logical_height").c_str()))
void Top10ScoreScreen::draw(unsigned char *buf, unsigned width, unsigned height)
{
scores_changed.reset_flag();
- fill_background(buf, width, height);
+ fill_background(buf, "top10scorescreen", width, height);
set_screen_size(width, height);
// fetch the top 10 scores
void Top5ChosenScreen::draw(unsigned char *buf, unsigned width, unsigned height)
{
scores_changed.reset_flag();
- fill_background(buf, width, height);
+ fill_background(buf, "top5chosenscreen", width, height);
set_screen_size(width, height);
// fetch the top 5 chosen songs