Adjusted the fade times a bit.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 20 Feb 2005 17:40:28 +0000 (17:40 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 20 Feb 2005 17:40:28 +0000 (17:40 +0000)
bigscreen/rotatescreen.cpp

index 1dba1cc..900bac3 100644 (file)
@@ -42,7 +42,7 @@ void RotateScreen::draw(unsigned char *buf)
                        double(now.tv_usec - fade_started.tv_usec) * 1.0e-6;
                printf("fade: %f\n", elapsed_fade);
                
-               if (elapsed_fade > 5.0 || (!same_fade && elapsed_fade > 0.5)) {
+               if (elapsed_fade > 6.0 || (!same_fade && elapsed_fade > 1.0)) {
                        in_fade = false;
 
                        // ugly hack here? :-)
@@ -54,13 +54,13 @@ void RotateScreen::draw(unsigned char *buf)
                        // find the fade factors
                        int fr, fg, fb, fa;
                        if (same_fade) {
-                               if (elapsed_fade < 0.5) {
-                                       fr = fg = fb = fa = unsigned(elapsed_fade/0.5 * 256.0);
+                               if (elapsed_fade < 1.0) {
+                                       fr = fg = fb = fa = unsigned(elapsed_fade/1.0 * 256.0);
                                } else {
-                                       fr = fg = fb = fa = unsigned((elapsed_fade-0.5)/4.5 * 256.0);
+                                       fr = fg = fb = fa = unsigned((elapsed_fade-1.0)/5.0 * 256.0);
                                }
                        } else {
-                               fr = fg = fb = fa = unsigned(elapsed_fade/0.5 * 256.0);
+                               fr = fg = fb = fa = unsigned(elapsed_fade/1.0 * 256.0);
                        }
                        printf("%u %u %u %u\n", fr, fg, fb, fa);
 
@@ -68,7 +68,7 @@ void RotateScreen::draw(unsigned char *buf)
                        unsigned char *sptr2 = subscreens[current_screen].buf;
                        unsigned char *dptr = buf;
 
-                       if (same_fade && elapsed_fade >= 0.5) {
+                       if (same_fade && elapsed_fade >= 1.0) {
                                // 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);