Rev 124 | Rev 140 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 124 | Rev 136 | ||
|---|---|---|---|
| Line 8... | Line 8... | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | // prototypes of local functions |
10 | // prototypes of local functions |
| 11 | static void StartThread_ThisDialog (void *thread_parms); |
11 | static void StartThread_ThisDialog (void *thread_parms); |
| 12 | static int CALLBACK DialogProc_ThisDialog (HWND hWnd, unsigned int message, WPARAM wParam, LPARAM lParam); |
12 | static int CALLBACK DialogProc_ThisDialog (HWND hWnd, unsigned int message, WPARAM wParam, LPARAM lParam); |
| - | 13 | static int resign_type; |
|
| 13 | 14 | ||
| 14 | 15 | ||
| 15 | void DialogBox_Resign ( |
16 | void DialogBox_Resign (int type) |
| 16 | { |
17 | { |
| 17 | // helper function to fire up the modeless dialog box |
18 | // helper function to fire up the modeless dialog box |
| 18 | 19 | ||
| - | 20 | resign_type = type; // save the resign type for later use |
|
| 19 | _beginthread (StartThread_ThisDialog, 0, NULL); // fire up a new thread to display the dialog box |
21 | _beginthread (StartThread_ThisDialog, 0, NULL); // fire up a new thread to display the dialog box |
| 20 | 22 | ||
| 21 | return; // return as soon as the thread is fired up |
23 | return; // return as soon as the thread is fired up |
| 22 | } |
24 | } |
| 23 | 25 | ||
| Line 45... | Line 47... | ||
| 45 | Board_Shutdown (&the_board); // release chess game |
47 | Board_Shutdown (&the_board); // release chess game |
| 46 | Board_Init (&the_board, PLAYER_HUMAN, PLAYER_HUMAN, FENSTARTUP_STANDARDCHESS); // prepare a new human vs human game (by default) |
48 | Board_Init (&the_board, PLAYER_HUMAN, PLAYER_HUMAN, FENSTARTUP_STANDARDCHESS); // prepare a new human vs human game (by default) |
| 47 | Scene_Init (&the_scene, &the_board); // initialize scene |
49 | Scene_Init (&the_scene, &the_board); // initialize scene |
| 48 | SetWindowText (hMainWnd, PROGRAM_NAME); // update window title |
50 | SetWindowText (hMainWnd, PROGRAM_NAME); // update window title |
| 49 | 51 | ||
| - | 52 | if (resign_type == RESIGNTYPE_NEWGAME) |
|
| 50 | DialogBox_NewGame (); // show the new game dialog box |
53 | DialogBox_NewGame (); // show the new game dialog box |
| - | 54 | else if (resign_type == RESIGNTYPE_LOADGAME) |
|
| - | 55 | DialogBox_Load (); // show the open dialog box |
|
| 51 | } |
56 | } |
| 52 | 57 | ||
| 53 | the_board.reevaluate = true; // evaluate the new board |
58 | the_board.reevaluate = true; // evaluate the new board |
| 54 | the_scene.update = true; // update scene |
59 | the_scene.update = true; // update scene |
| 55 | 60 | ||