]> git.sesse.net Git - ccbs/blobdiff - bigscreen/ccbs_bigscreen.cpp
Only allocate space for four digits in the score screen -- if somebody actually gets...
[ccbs] / bigscreen / ccbs_bigscreen.cpp
index aa94da2913d1d2508a446485262724de3b795eb0..fbbc0aaed7a06baf1640f63781dd814c19660382 100644 (file)
@@ -45,22 +45,22 @@ void main_loop(pqxx::connection &conn)
 {
        if (active_tournament.id == -1) {
                // No active tournament, sleep a second or so and exit
-               sleep(1);
+               conn.await_notification(1, 0);
                return;
        }
 
        memset(framebuf, 0, 800*600*4);
        
-       pqxx::work t(conn, "trx");
+       if (screens.size() > 0) {
+               if (screens[0]->check_invalidated()) {
+                       screens[0]->draw(screenbuf);
+               }
 
-       if (screens[0]->check_invalidated()) {
-               screens[0]->draw(screenbuf);
+               memcpy(framebuf, screenbuf, 800*600*4);
        }
-       
-       memcpy(framebuf, screenbuf, 800*600*4);
 
        ptc_update(framebuf);
-       sleep(1);
+       conn.await_notification(0, 50000);
 }
 
 int main(int argc, char **argv)