Subversion Repositories Games.Chess Giants

Rev

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

Rev 72 Rev 119
Line 136... Line 136...
136
   int nag_code;
136
   int nag_code;
137
   int length;
137
   int length;
138
   int char_index;
138
   int char_index;
139
   int fieldstart;
139
   int fieldstart;
140
   int fieldstop;
140
   int fieldstop;
-
 
141
   int program_index;
141
   int variation_depth;
142
   int variation_depth;
142
   char movenumber_string[8];
143
   char movenumber_string[8];
143
 
144
 
144
   // did we chose NO game ?
145
   // did we chose NO game ?
145
   if (game == NULL)
146
   if (game == NULL)
146
   {
147
   {
147
      PGNFile_GameList_Shutdown (); // free the games list
148
      PGNFile_GameList_Shutdown (); // free the games list
148
      SAFE_free ((void **) &pgnfile_data); // free the file data space
149
      SAFE_free ((void **) &pgnfile_data); // free the file data space
149
      return (true); // return success as there's nothing to load
150
      return (true); // return success as there's nothing to load
-
 
151
   }
-
 
152
 
-
 
153
   // if either of the players is a chess engine, start it
-
 
154
   for (program_index = 0; program_index < options.engine.program_count; program_index++)
-
 
155
   {
-
 
156
      if (wcscmp (game->black_str, options.engine.programs[program_index].name) == 0)
-
 
157
      {
-
 
158
         options.engine.selected_program = program_index; // update the preferred chess engine (FIXME: we should not)
-
 
159
         Player_Shutdown (&board->players[COLOR_BLACK]);
-
 
160
         Player_Init (&board->players[COLOR_BLACK], COLOR_BLACK, PLAYER_COMPUTER);
-
 
161
      }
-
 
162
      if (wcscmp (game->white_str, options.engine.programs[program_index].name) == 0)
-
 
163
      {
-
 
164
         options.engine.selected_program = program_index; // update the preferred chess engine (FIXME: we should not)
-
 
165
         Player_Shutdown (&board->players[COLOR_WHITE]);
-
 
166
         Player_Init (&board->players[COLOR_WHITE], COLOR_WHITE, PLAYER_COMPUTER);
-
 
167
      }
150
   }
168
   }
151
 
169
 
152
   // reset the board (but NOT the players, just their view angles)
170
   // reset the board (but NOT the players, just their view angles)
153
   Board_Reset (board, game->fen_str);
171
   Board_Reset (board, game->fen_str);
154
   animation_endtime = current_time + 2.0f; // HACK: this sorta prevents the "load file" dialog box trailing clicks to be misinterpreted
172
   animation_endtime = current_time + 2.0f; // HACK: this sorta prevents the "load file" dialog box trailing clicks to be misinterpreted