]> git.sesse.net Git - ccbs/blobdiff - bigscreen/rotatescreen.cpp
Start the fade when we can display the first frame of it, not when we know that there...
[ccbs] / bigscreen / rotatescreen.cpp
index 54f04238e2f36c540e2cf67423ded7f765ec600f..3c2a4b9df16afcc0d41e822380bc65d39d4d5aa3 100644 (file)
@@ -38,6 +38,11 @@ void RotateScreen::draw(unsigned char *buf)
                struct timeval now;
                gettimeofday(&now, NULL);
 
+               if (!fade_found_start_time) {
+                       fade_found_start_time = true;
+                       fade_started = now;
+               }
+               
                double elapsed_fade = double(now.tv_sec - fade_started.tv_sec) +
                        double(now.tv_usec - fade_started.tv_usec) * 1.0e-6;
                
@@ -108,8 +113,8 @@ void RotateScreen::draw(unsigned char *buf)
                if (current_screen != old_current_screen || subscreens[current_screen].screen->check_invalidated()) {
                        // initialize a fade
                        in_fade = true;
+                       fade_found_start_time = false;
                        same_fade = (current_screen == old_current_screen);
-                       gettimeofday(&fade_started, NULL);
                        
                        memcpy(fadefrom_buf, subscreens[old_current_screen].buf, 800 * 600 * 4);