]> git.sesse.net Git - ccbs/commitdiff
Actually show a total for each player.
authorSteinar H. Gunderson <sesse@samfundet.no>
Sat, 19 Feb 2005 22:49:06 +0000 (22:49 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Sat, 19 Feb 2005 22:49:06 +0000 (22:49 +0000)
bigscreen/fetch_group.cpp
bigscreen/groupscreen.cpp

index bdaa0c9a9b309e469e24fde3db634eb51d983030..75e458a4f9b80ed9c60c598935c3ca51846ffa77 100644 (file)
@@ -52,6 +52,7 @@ void FetchGroup::operator() (pqxx::transaction<> &t)
                        sc.score = -1;
                } else {
                        sc.score = i["score"].as(sc.score);
                        sc.score = -1;
                } else {
                        sc.score = i["score"].as(sc.score);
+                       curr_group.players[curr_group.players.size() - 1].total += sc.score;
                }
 
                curr_group.players[curr_group.players.size() - 1].scores.push_back(sc);
                }
 
                curr_group.players[curr_group.players.size() - 1].scores.push_back(sc);
index 5f16ebf22fe98be6766e3a2fc772af2c0cca28da..26d769af52884bdfedfd253f52d034f17e755227 100644 (file)
@@ -123,6 +123,16 @@ void GroupScreen::draw(unsigned char *buf)
                        x += width[col] + 20;
                }
 
                        x += width[col] + 20;
                }
 
+               // draw total
+               {
+                       char text[16];
+                       sprintf(text, "%u", i->total);
+                       
+                       unsigned this_width = my_draw_text(text, NULL, 22.0);
+                       my_draw_text(text, buf, 22.0, x + width[num_scores + 1] / 2 - this_width / 2, y);
+                       x += width[num_scores + 1] + 20;
+               }
+
                y += 40;
        }
        
                y += 40;
        }