From: Steinar H. Gunderson Date: Sat, 18 Feb 2012 01:44:27 +0000 (+0100) Subject: On the last fade-from-red, just complete the fade instead of doing a re-render. Fixes... X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=b6fa823a82184618370341eb414b50f1ac459a2f On the last fade-from-red, just complete the fade instead of doing a re-render. Fixes an ugly “jerk” at the end of the fade, since FreeType is pretty slow. --- diff --git a/bigscreen/rotatescreen.cpp b/bigscreen/rotatescreen.cpp index a8c9d6f..64e7269 100644 --- a/bigscreen/rotatescreen.cpp +++ b/bigscreen/rotatescreen.cpp @@ -71,8 +71,12 @@ void RotateScreen::draw(unsigned char *buf, unsigned width, unsigned height) if (elapsed_fade > 5.5 || (!fade_to_new_info && elapsed_fade > 0.5)) { in_fade = false; - // ugly hack here? :-) - subscreens[current_screen].screen->draw(subscreens[current_screen].buf, width, height); + // set G&B to be = R + unsigned char *ptr = subscreens[current_screen].buf; + for (unsigned i = 0; i < width * height; ++i) { + ptr[1] = ptr[2] = ptr[3] = ptr[0]; + ptr += 4; + } memcpy(buf, subscreens[current_screen].buf, width * height * 4); } else {