Subversion Repositories Games.Chess Giants

Rev

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

Rev 154 Rev 159
Line 24... Line 24...
24
   // this function starts a chess engine as a child process. This process's stdin and
24
   // this function starts a chess engine as a child process. This process's stdin and
25
   // stdout are redirected to the handles we give it, so that we may read/write to it.
25
   // stdout are redirected to the handles we give it, so that we may read/write to it.
26
 
26
 
27
   engineprogram_t *program;
27
   engineprogram_t *program;
28
   wchar_t current_path[MAX_PATH];
28
   wchar_t current_path[MAX_PATH];
29
   wchar_t widechar_buffer[256];
29
   wchar_t widechar_buffer[1024];
30
   SYSTEM_INFO sysinfo;
30
   SYSTEM_INFO sysinfo;
31
   FILE *fp;
31
   FILE *fp;
32
 
32
 
33
   // reset stuff first
33
   // reset stuff first
34
   player->wants_hint = false;
34
   player->wants_hint = false;
Line 126... Line 126...
126
bool PlayerEngine_Think (player_t *player)
126
bool PlayerEngine_Think (player_t *player)
127
{
127
{
128
   // this function reads and writes any necessary data from and to the chess engine. Returns TRUE if scene needs to be updated.
128
   // this function reads and writes any necessary data from and to the chess engine. Returns TRUE if scene needs to be updated.
129
 
129
 
130
   engineprogram_t *program;
130
   engineprogram_t *program;
131
   wchar_t line_buffer[256];
131
   wchar_t line_buffer[1024];
132
   wchar_t *line_pointer;
132
   wchar_t *line_pointer;
133
   wchar_t *move_string;
133
   wchar_t *move_string;
134
   int char_index;
134
   int char_index;
135
   int length;
135
   int length;
136
   boardmove_t move;
136
   boardmove_t move;
Line 572... Line 572...
572
static void PlayerEngine_Send (player_t *player)
572
static void PlayerEngine_Send (player_t *player)
573
{
573
{
574
   // helper function to send data through the pipe communicating with the game engine process
574
   // helper function to send data through the pipe communicating with the game engine process
575
 
575
 
576
   static wchar_t replacement_string[65536];
576
   static wchar_t replacement_string[65536];
577
   wchar_t widechar_buffer[256];
577
   static wchar_t widechar_buffer[65536]; // needs to be big enough to hold game history
-
 
578
   static char ascii_buffer[65536]; // needs to be big enough to hold game history
578
   wchar_t *line_pointer;
579
   wchar_t *line_pointer;
579
   char ascii_buffer[256];
-
 
580
   unsigned long amount_written;
580
   unsigned long amount_written;
581
   int move_index;
581
   int move_index;
582
   int try_index;
582
   int try_index;
583
 
583
 
584
   player->sendbuffer_locked = true; // lock the buffer
584
   player->sendbuffer_locked = true; // lock the buffer