]> 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 435d06aa7ff86f2cf23f6414d71113e3efa66f37..fbbc0aaed7a06baf1640f63781dd814c19660382 100644 (file)
@@ -45,20 +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);
        
-       if (screens[0]->check_invalidated()) {
-               screens[0]->draw(screenbuf);
+       if (screens.size() > 0) {
+               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)