Adjust the fade time back to 0.5 again, after the "starting fade time" fix.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 20 Feb 2005 22:58:00 +0000 (22:58 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 20 Feb 2005 22:58:00 +0000 (22:58 +0000)
bigscreen/rotatescreen.cpp

index 3c2a4b9..96a3ebc 100644 (file)
@@ -46,7 +46,7 @@ void RotateScreen::draw(unsigned char *buf)
                double elapsed_fade = double(now.tv_sec - fade_started.tv_sec) +
                        double(now.tv_usec - fade_started.tv_usec) * 1.0e-6;
                
-               if (elapsed_fade > 6.0 || (!same_fade && elapsed_fade > 1.0)) {
+               if (elapsed_fade > 5.5 || (!same_fade && elapsed_fade > 0.5)) {
                        in_fade = false;
 
                        // ugly hack here? :-)
@@ -57,20 +57,20 @@ void RotateScreen::draw(unsigned char *buf)
                        // find the fade factors
                        int fr, fg, fb, fa;
                        if (same_fade) {
-                               if (elapsed_fade < 1.0) {
-                                       fr = fg = fb = fa = unsigned(elapsed_fade/1.0 * 256.0);
+                               if (elapsed_fade < 0.5) {
+                                       fr = fg = fb = fa = unsigned(elapsed_fade/0.5 * 256.0);
                                } else {
-                                       fr = fg = fb = fa = unsigned((elapsed_fade-1.0)/5.0 * 256.0);
+                                       fr = fg = fb = fa = unsigned((elapsed_fade-0.5)/5.0 * 256.0);
                                }
                        } else {
-                               fr = fg = fb = fa = unsigned(elapsed_fade/1.0 * 256.0);
+                               fr = fg = fb = fa = unsigned(elapsed_fade/0.5 * 256.0);
                        }
 
                        unsigned char *sptr1 = fadefrom_buf;
                        unsigned char *sptr2 = subscreens[current_screen].buf;
                        unsigned char *dptr = buf;
 
-                       if (same_fade && elapsed_fade >= 1.0) {
+                       if (same_fade && elapsed_fade >= 0.5) {
                                // fade G&B to be = R
                                for (unsigned i = 0; i < 800 * 600; ++i) {
                                        dptr[0] = sptr2[0] + (((int(sptr2[2]) - int(sptr2[0])) * fb) >> 8);