X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Frotatescreen.cpp;fp=bigscreen%2Frotatescreen.cpp;h=3c2a4b9df16afcc0d41e822380bc65d39d4d5aa3;hp=54f04238e2f36c540e2cf67423ded7f765ec600f;hb=99b06a7cbf2cbd55cc5d6475b6b33d2fb1b2ecd0;hpb=8963fce7337a09bdcfea051a81c0c3d9281acd6e diff --git a/bigscreen/rotatescreen.cpp b/bigscreen/rotatescreen.cpp index 54f0423..3c2a4b9 100644 --- a/bigscreen/rotatescreen.cpp +++ b/bigscreen/rotatescreen.cpp @@ -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);