]> git.sesse.net Git - ccbs/blobdiff - bigscreen/splitscreen.cpp
Move the theming out to a runtime-read config file. Opens, among others, for differen...
[ccbs] / bigscreen / splitscreen.cpp
index b2939be755e2769eef5656bf0bd1e036a6388978..1a39df44efa472974dde8dc903bb6679b4627a35 100644 (file)
@@ -1,8 +1,9 @@
 /* NOTE: this class will _NOT_ handle resolution changes cleanly. You have been warned. :-) */
 
 #include <cstring>
+#include <cstdlib>
 #include "splitscreen.h"
-#include "design.h"
+#include "theme.h"
 
 SplitScreen::SplitScreen(GenericScreen *s1, GenericScreen *s2, GenericScreen *s3, GenericScreen *s4)
        : valid(false)
@@ -51,19 +52,23 @@ void SplitScreen::draw(unsigned char *buf, unsigned width, unsigned height)
        copy_subscreen(buf + width * (height/2) * 4 + (width/2) * 4, subbufs[3], width, height); 
        
        // make divider lines
+       int r = atoi(get_theme_config("divider", "red").c_str());
+       int g = atoi(get_theme_config("divider", "green").c_str());
+       int b = atoi(get_theme_config("divider", "blue").c_str());
+
        unsigned char *ptr = buf + (height/2) * width * 4;
        for (unsigned x = 0; x < width; ++x) {
-               *ptr++ = DIVIDER_BLUE;
-               *ptr++ = DIVIDER_GREEN;
-               *ptr++ = DIVIDER_RED;
+               *ptr++ = b;
+               *ptr++ = g;
+               *ptr++ = r;
                *ptr++ = 0;
        }
        
        ptr = buf + (width/2) * 4;
        for (unsigned y = 0; y < height; ++y) {
-               ptr[0] = DIVIDER_BLUE;
-               ptr[1] = DIVIDER_GREEN;
-               ptr[2] = DIVIDER_RED;
+               ptr[0] = b;
+               ptr[1] = g;
+               ptr[2] = r;
                ptr[3] = 0;
 
                ptr += width * 4;