+ if (game->font == NULL) {
+ game->font = pango_font_description_new ();
+ pango_font_description_set_family (game->font, DVONN_FONT);
+ pango_font_description_set_absolute_size (game->font, DVONN_FONT_SIZE * PANGO_SCALE);
+ }
+ if (game->board.phase == DVONN_PHASE_GAME_OVER) {
+ if (game->board.score[DVONN_PLAYER_WHITE] >
+ game->board.score[DVONN_PLAYER_BLACK])
+ {
+ to_move = _create_layout_printf (cr, game->font,
+ "White wins (%d to %d)\n",
+ game->board.score[DVONN_PLAYER_WHITE],
+ game->board.score[DVONN_PLAYER_BLACK]);
+ }
+ else if (game->board.score[DVONN_PLAYER_BLACK] >
+ game->board.score[DVONN_PLAYER_WHITE])
+ {
+ to_move = _create_layout_printf (cr, game->font,
+ "Black wins (%d to %d)\n",
+ game->board.score[DVONN_PLAYER_BLACK],
+ game->board.score[DVONN_PLAYER_WHITE]);
+ }
+ else
+ {
+ to_move = _create_layout_printf (cr, game->font,
+ "Tie game (%d to %d)\n",
+ game->board.score[DVONN_PLAYER_WHITE],
+ game->board.score[DVONN_PLAYER_BLACK]);
+
+ }
+ } else {
+ to_move = _create_layout_printf (cr, game->font,
+ "%s to %s.",
+ game->board.player == DVONN_PLAYER_WHITE ?
+ "White" : "Black",
+ game->board.phase == DVONN_PHASE_PLACEMENT ?
+ "place" : "move");
+ }
+ cairo_move_to (cr, 2, 2);
+ if (game->board.player == DVONN_PLAYER_WHITE)
+ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
+ else
+ cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
+ _show_layout (cr, to_move);
+