X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Fgroupscreen.cpp;h=6639f4c057db0a83494ebe10e5c07963d9c1656e;hp=88fce1cc03606f527cce3c12158cd641c2956466;hb=d4ec885cadcbcce077579bdd24c93ead18b06852;hpb=07c1b0a88317b59f0deee5ad5d3e4febd423acbc diff --git a/bigscreen/groupscreen.cpp b/bigscreen/groupscreen.cpp index 88fce1c..6639f4c 100644 --- a/bigscreen/groupscreen.cpp +++ b/bigscreen/groupscreen.cpp @@ -3,6 +3,7 @@ #include #include +#include "design.h" #include "resolution.h" #include "groupscreen.h" #include "fetch_group.h" @@ -60,7 +61,7 @@ void GroupScreen::draw_main_heading(std::vector &td) } unsigned width = my_draw_text(heading, NULL, 40.0); - my_draw_text_deferred(td, heading, 40.0, LOGICAL_SCREEN_WIDTH/2 - width/2, 60); + my_draw_text_deferred(td, heading, 40.0, LOGICAL_SCREEN_WIDTH/2 - width/2, 60, MAIN_HEADING_RED, MAIN_HEADING_GREEN, MAIN_HEADING_BLUE); } // make column headings from the first player's songs @@ -73,16 +74,16 @@ void GroupScreen::draw_column_headings(std::vector &td, const Group & for (std::vector::const_iterator i = group.players[0].scores.begin(); i != group.players[0].scores.end(); ++i, ++col) { if (!i->chosen) { unsigned this_width = my_draw_text(i->song.short_title, NULL, 12.0); - my_draw_text_deferred(td, i->song.short_title, 12.0, x + colwidth[col] / 2 - this_width / 2, 100); + my_draw_text_deferred(td, i->song.short_title, 12.0, x + colwidth[col] / 2 - this_width / 2, 100, COLUMN_HEADING_RED, COLUMN_HEADING_GREEN, COLUMN_HEADING_BLUE); } x += colwidth[col] + 20; } if (num_scores > 1) { - my_draw_text_deferred(td, "Total", 12.0, x + colwidth[num_scores + 1] / 2 - my_draw_text("Total", NULL, 12.0) / 2, 100); + my_draw_text_deferred(td, "Total", 12.0, x + colwidth[num_scores + 1] / 2 - my_draw_text("Total", NULL, 12.0) / 2, 100, COLUMN_HEADING_RED, COLUMN_HEADING_GREEN, COLUMN_HEADING_BLUE); x += colwidth[num_scores + 1] + 20; } - my_draw_text_deferred(td, "Rank", 12.0, x + colwidth[num_scores + 2] / 2 - my_draw_text("Rank", NULL, 12.0) / 2, 100); + my_draw_text_deferred(td, "Rank", 12.0, x + colwidth[num_scores + 2] / 2 - my_draw_text("Rank", NULL, 12.0) / 2, 100, COLUMN_HEADING_RED, COLUMN_HEADING_GREEN, COLUMN_HEADING_BLUE); } // show all the players and the scores @@ -100,7 +101,7 @@ void GroupScreen::draw_scores(std::vector &td, const Group &group, un if (m-1 < min_player) continue; - my_draw_text_deferred(td, i->nick, 18.0, 20, y); + my_draw_text_deferred(td, i->nick, 18.0, 20, y, ROW_HEADING_RED, ROW_HEADING_GREEN, ROW_HEADING_BLUE); x = 40 + colwidth[0]; @@ -601,7 +602,13 @@ void GroupScreen::draw(unsigned char *buf, unsigned width, unsigned height) conn.perform(FetchGroup(tournament, round, parallel, &group)); gettimeofday(&last_updated, NULL); - memset(buf, 0, width * height * 4); + unsigned char *ptr = buf; + for (unsigned i = 0; i < width * height; ++i) { + *ptr++ = BACKGROUND_BLUE; + *ptr++ = BACKGROUND_GREEN; + *ptr++ = BACKGROUND_RED; + *ptr++ = 0; + } std::vector colwidth;