]> git.sesse.net Git - ccbs/commitdiff
Start the fade when we can display the first frame of it, not when we know that there...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 20 Feb 2005 22:52:45 +0000 (22:52 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 20 Feb 2005 22:52:45 +0000 (22:52 +0000)
bigscreen/rotatescreen.cpp
bigscreen/rotatescreen.h

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);
 
index d2c69f788d78c6c97bbc25ab65bcaee4e766be66..4fe6edfe13a3a474a340b16fee314de5c2376423 100644 (file)
@@ -23,7 +23,7 @@ private:
        unsigned current_screen;
 
        struct timeval last_update, fade_started;
-       bool in_fade, same_fade;
+       bool in_fade, fade_found_start_time, same_fade;
 
        bool needs_update();