X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Ftheme.cpp;h=fb6f7707b450de93bedf9bc97cc91ad905dc0e19;hp=542d2ada93faf271d6f00d63dbd36a48828b77cb;hb=c9cf3358a292d988d5d50819bb2db4da3347284a;hpb=40a55879c3ebcefc70e52ad2f573cf0da10d3d73 diff --git a/bigscreen/theme.cpp b/bigscreen/theme.cpp index 542d2ad..fb6f770 100644 --- a/bigscreen/theme.cpp +++ b/bigscreen/theme.cpp @@ -78,11 +78,12 @@ std::string get_theme_config(const std::string &key, const std::string subkey) 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) {