X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Frotatescreen.cpp;h=ef7fba079005daa5b4eed55c6b73eeccb1aaace9;hp=96a3ebc7bad1137f957e1971642f611ddd34247e;hb=5205061c547014321afc2d00e739c480df49d197;hpb=61761afb28eff20b8839835878a73f7aa2159f84 diff --git a/bigscreen/rotatescreen.cpp b/bigscreen/rotatescreen.cpp index 96a3ebc..ef7fba0 100644 --- a/bigscreen/rotatescreen.cpp +++ b/bigscreen/rotatescreen.cpp @@ -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); }