Subversion Repositories Games.Chess Giants

Rev

Rev 25 | Rev 81 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25 Rev 75
Line 743... Line 743...
743
 
743
 
744
   // is it time to draw the hovered slot and last move textures on the board slots ?
744
   // is it time to draw the hovered slot and last move textures on the board slots ?
745
   if (animation_endtime < current_time)
745
   if (animation_endtime < current_time)
746
   {
746
   {
747
      // add the hovered slot tile (only when it should not be hidden because of highlighting)
747
      // add the hovered slot tile (only when it should not be hidden because of highlighting)
748
      if (IS_VALID_POSITION (board->hovered_position)
748
      if (!is_paused && IS_VALID_POSITION (board->hovered_position)
749
          && ((highlight_endtime < current_time) || ((int) ((highlight_endtime - current_time) * 20.0f) % 2 == 1)))
749
          && ((highlight_endtime < current_time) || ((int) ((highlight_endtime - current_time) * 20.0f) % 2 == 1)))
750
         Scene_AddTile (scene, theme->hovered_textureindex, 3.1f,
750
         Scene_AddTile (scene, theme->hovered_textureindex, 3.1f,
751
                        17.5f - (7 - board->hovered_position[1]) * 5.0f,
751
                        17.5f - (7 - board->hovered_position[1]) * 5.0f,
752
                        17.5f - board->hovered_position[0] * 5.0f,
752
                        17.5f - board->hovered_position[0] * 5.0f,
753
                        0.03f, 0.0f); // hovered tile
753
                        0.03f, 0.0f); // hovered tile
Line 943... Line 943...
943
            }
943
            }
944
         }
944
         }
945
      } // end for (column = 0; column < 8; column++)
945
      } // end for (column = 0; column < 8; column++)
946
   } // end for (line = 0; line < 8; line++)
946
   } // end for (line = 0; line < 8; line++)
947
 
947
 
948
   ///////////////////////////////////////////////////////////
948
   ////////////////////////////////////////////////////////////////////////////////////
949
   // now draw the sepia overlay if we're in history view mode
949
   // now draw the sepia overlay if we're in history view mode or if the game is paused
950
 
950
 
951
   if (options.want_sepiafilter && (board->move_count > 1) && (board->viewed_move != board->move_count - 1))
951
   if (options.want_sepiafilter && (is_paused || ((board->move_count > 1) && (board->viewed_move != board->move_count - 1))))
952
      scene->overlay_spriteindex = sepia_spriteindex; // use the sepia filter
952
      scene->overlay_spriteindex = sepia_spriteindex; // use the sepia filter
953
   else
953
   else
954
      scene->overlay_spriteindex = -1; // else use natural colors
954
      scene->overlay_spriteindex = -1; // else use natural colors
955
 
955
 
956
   ////////////////////////////////////////////////////////////////////////////////////////////////
956
   ////////////////////////////////////////////////////////////////////////////////////////////////
Line 974... Line 974...
974
 
974
 
975
      // are we in Internet play ? if so, count time down, else count it up
975
      // are we in Internet play ? if so, count time down, else count it up
976
      if ((network_player != NULL) && network_player->is_in_game)
976
      if ((network_player != NULL) && network_player->is_in_game)
977
         seconds = Player_GetCurrent ()->remaining_seconds - (int) (current_time - board->lastmove_time); // total seconds first
977
         seconds = Player_GetCurrent ()->remaining_seconds - (int) (current_time - board->lastmove_time); // total seconds first
978
      else
978
      else
979
         seconds = (int) (current_time - board->lastmove_time); // total seconds first
979
         seconds = (int) (current_time - stoppage_time - board->lastmove_time); // total seconds first, take pauses in account
980
 
980
 
981
      minutes = seconds / 60; // minutes
981
      minutes = seconds / 60; // minutes
982
      seconds -= 60 * minutes; // remaining seconds
982
      seconds -= 60 * minutes; // remaining seconds
983
 
983
 
984
      Scene_SetText (&the_scene.gui.clock_text, 99.0f, 66.6f, -1, ALIGN_RIGHT, ALIGN_CENTER, ALIGN_RIGHT, players_fontindex, RGBACOLOR_SETALPHA (options.clock_color, 0x7f), 999999.0f, false, L"%02d:%02d  ", minutes, seconds); // note: last space is alt+255
984
      Scene_SetText (&the_scene.gui.clock_text, 99.0f, 66.6f, -1, ALIGN_RIGHT, ALIGN_CENTER, ALIGN_RIGHT, players_fontindex, RGBACOLOR_SETALPHA (options.clock_color, 0x7f), 999999.0f, false, L"%02d:%02d  ", minutes, seconds); // note: last space is alt+255
Line 1088... Line 1088...
1088
      if (!the_scene.gui.central_text.is_displayed)
1088
      if (!the_scene.gui.central_text.is_displayed)
1089
         Scene_SetText (&the_scene.gui.central_text, 50.0f, 50.0f, -1, ALIGN_CENTER, ALIGN_CENTER, ALIGN_CENTER, centermsg_fontindex, RGBA_TO_RGBACOLOR (255, 255, 255, 191),
1089
         Scene_SetText (&the_scene.gui.central_text, 50.0f, 50.0f, -1, ALIGN_CENTER, ALIGN_CENTER, ALIGN_CENTER, centermsg_fontindex, RGBA_TO_RGBACOLOR (255, 255, 255, 191),
1090
                        999999.0f, true, LOCALIZE (L"Error_ConnectionToChessServerLost")); // display "error" in the middle of the screen
1090
                        999999.0f, true, LOCALIZE (L"Error_ConnectionToChessServerLost")); // display "error" in the middle of the screen
1091
      the_scene.overlay_spriteindex = sepia_spriteindex; // display sepia filter if no connection
1091
      the_scene.overlay_spriteindex = sepia_spriteindex; // display sepia filter if no connection
1092
   }
1092
   }
-
 
1093
 
-
 
1094
   // is the game paused ?
-
 
1095
   if (is_paused)
-
 
1096
      Scene_SetText (&the_scene.gui.central_text, 50.0f, 50.0f, -1, ALIGN_CENTER, ALIGN_CENTER, ALIGN_CENTER, centermsg_fontindex, RGBA_TO_RGBACOLOR (255, 255, 255, 255),
-
 
1097
                     1.0f, false, LOCALIZE (L"Paused")); // if so, display the "paused" phrase in the middle of the screen
1093
 
1098
 
1094
   return; // finished, scene is updated
1099
   return; // finished, scene is updated
1095
}
1100
}
1096
 
1101
 
1097
 
1102