src/game.c

changeset 100
685af47592b5
parent 98
9cb41383540f
--- a/src/game.c	Thu Apr 16 19:29:11 2026 +0200
+++ b/src/game.c	Thu Apr 16 19:49:16 2026 +0200
@@ -35,7 +35,6 @@
 #include "chess/pgn.h"
 #include <ncurses.h>
 #include <string.h>
-#include <inttypes.h>
 #include <sys/select.h>
 #include <stdio.h>
 #include <errno.h>
@@ -47,12 +46,12 @@
     if (gameinfo->timecontrol) {
         uint16_t white = remaining_movetime(gameinfo, gamestate, WHITE);
         uint16_t black = remaining_movetime(gameinfo, gamestate, BLACK);
-        mvprintw(boardy+4, boardx-1,
-            "White time: %4" PRIu16 ":%02" PRIu16,
-            white / 60, white % 60);
-        mvprintw(boardy+5, boardx-1,
-            "Black time: %4" PRIu16 ":%02" PRIu16,
-            black / 60, black % 60);
+        char clkstr[16];
+        bool always_hours = gameinfo->time >= 3600;
+        print_clk(white, clkstr, always_hours);
+        mvprintw(boardy+4, boardx-1, "White time: %s", clkstr);
+        print_clk(black, clkstr, always_hours);
+        mvprintw(boardy+5, boardx-1, "Black time: %s", clkstr);
     
         if (white == 0) {
             move(inputy, 0);

mercurial