Fix a bug where all new screens would be cycled on start.
[ccbs] / bigscreen / rotatescreen.cpp
index 96a3ebc..ef7fba0 100644 (file)
@@ -32,6 +32,12 @@ bool RotateScreen::check_invalidated()
 void RotateScreen::draw(unsigned char *buf)
 {
        bool force = false;
+
+       if (subscreens.size() == 0) {
+               valid = true;
+               gettimeofday(&last_update, NULL);
+               return;
+       }
        
        // if we're in a fade, complete it before doing anything else
        if (in_fade) {
@@ -110,7 +116,7 @@ void RotateScreen::draw(unsigned char *buf)
                        gettimeofday(&last_update, NULL);
                }
 
-               if (current_screen != old_current_screen || subscreens[current_screen].screen->check_invalidated()) {
+               if (!valid || current_screen != old_current_screen || subscreens[current_screen].screen->check_invalidated()) {
                        // initialize a fade
                        in_fade = true;
                        fade_found_start_time = false;
@@ -147,6 +153,8 @@ void RotateScreen::add_screen(GenericScreen *screen)
        ss.buf = new unsigned char[800 * 600 * 4];
        ss.screen = screen;
 
+       screen->draw(ss.buf);
+       
        subscreens.push_back(ss);
 }