Rev 131 | Rev 140 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 131 | Rev 136 | ||
|---|---|---|---|
| Line 43... | Line 43... | ||
| 43 | scene->objects[2].mesh_index = theme->board_meshindex; |
43 | scene->objects[2].mesh_index = theme->board_meshindex; |
| 44 | scene->objects[2].texture_index = theme->board_texture; |
44 | scene->objects[2].texture_index = theme->board_texture; |
| 45 | scene->objects[2].scale = 1.0f; |
45 | scene->objects[2].scale = 1.0f; |
| 46 | scene->object_count = 3; |
46 | scene->object_count = 3; |
| 47 | 47 | ||
| 48 | // reset the camera position for a cool slide-in |
48 | // reset the camera position for a cool slide-in effect |
| 49 | if (options.want_autorotateon1vs1) |
- | |
| 50 | { |
- | |
| 51 |
|
49 | current_pitch = CLOSEUP_VIEW_PITCH; // autorotate is enabled, prepare for slide-in effect |
| 52 |
|
50 | current_yaw = (Board_ColorToMove (board) == COLOR_WHITE ? 90.0f : -90.0f); |
| 53 |
|
51 | current_distance = CLOSEUP_VIEW_DISTANCE; |
| 54 |
|
52 | if (current_distance >= MIN_VIEW_DISTANCE) |
| 55 |
|
53 | current_distance = MIN_VIEW_DISTANCE - 1.0f; // consistency check for stupid programmers |
| 56 | } |
- | |
| 57 | else |
- | |
| 58 | { |
- | |
| 59 | current_pitch = 55.0f; // no autorotate, reset to standard view position directly |
- | |
| 60 | current_yaw = (Board_ColorToMove (board) == COLOR_BLACK ? 90.0f : -90.0f); |
- | |
| 61 | current_distance = 70.0f; |
- | |
| 62 | if (current_distance < MIN_VIEW_DISTANCE) |
- | |
| 63 | current_distance = MIN_VIEW_DISTANCE; // consistency check for stupid programmers |
- | |
| 64 | } |
- | |
| 65 | 54 | ||
| 66 | // look at the center of the table immediately |
55 | // look at the center of the table immediately |
| 67 | lookatpoint_x = 0; |
56 | lookatpoint_x = 0; |
| 68 | lookatpoint_y = 0; |
57 | lookatpoint_y = 0; |
| 69 | 58 | ||
| Line 149... | Line 138... | ||
| 149 | int line; |
138 | int line; |
| 150 | int column; |
139 | int column; |
| 151 | int pos_index; |
140 | int pos_index; |
| 152 | int part_index; |
141 | int part_index; |
| 153 | int move_index; |
142 | int move_index; |
| 154 | int start_index; |
- | |
| 155 | int length; |
143 | int length; |
| 156 | int threat_line; |
144 | int threat_line; |
| 157 | int threat_column; |
145 | int threat_column; |
| 158 | int minutes; |
146 | int minutes; |
| 159 | int seconds; |
147 | int seconds; |
| Line 991... | Line 979... | ||
| 991 | //////////////////////////////////////////////////////////////////////////////////////////////// |
979 | //////////////////////////////////////////////////////////////////////////////////////////////// |
| 992 | // now draw the move comment text |
980 | // now draw the move comment text |
| 993 | 981 | ||
| 994 | // does the move we are viewing have a comment ? if so, copy it, else leave it clear. Also if we're online, display a help text |
982 | // does the move we are viewing have a comment ? if so, copy it, else leave it clear. Also if we're online, display a help text |
| 995 | if ((currentmove->comment != NULL) && (currentmove->comment[0] != 0)) |
983 | if ((currentmove->comment != NULL) && (currentmove->comment[0] != 0)) |
| 996 | Scene_SetText (&scene->gui.comment_text, |
984 | Scene_SetText (&scene->gui.comment_text, 50.0f, 0.5f, 80.0f, ALIGN_CENTER, ALIGN_TOP, ALIGN_LEFT, chat_fontindex, RGBA_TO_RGBACOLOR (255, 255, 255, 191), 999999.0f, false, currentmove->comment); |
| 997 | else if ((network_player != NULL) && network_player->is_logged_in && !network_player->is_in_game) |
985 | else if ((network_player != NULL) && network_player->is_logged_in && !network_player->is_in_game) |
| 998 | Scene_SetText (&scene->gui.comment_text, |
986 | Scene_SetText (&scene->gui.comment_text, 50.0f, 0.5f, 80.0f, ALIGN_CENTER, ALIGN_TOP, ALIGN_LEFT, chat_fontindex, RGBA_TO_RGBACOLOR (255, 255, 255, 191), 999999.0f, false, connected_comment); |
| 999 | else if (RGBACOLOR_ALPHA (scene->gui.comment_text.color) >= 128) // HACK: don't clear if a dimmed hint text is already here |
987 | else if (RGBACOLOR_ALPHA (scene->gui.comment_text.color) >= 128) // HACK: don't clear if a dimmed hint text is already here |
| 1000 | scene->gui.comment_text.is_displayed = false; // else clear comment text |
988 | scene->gui.comment_text.is_displayed = false; // else clear comment text |
| 1001 | 989 | ||
| 1002 | //////////////////////////////////////////////////////////////////////////////////////////////// |
990 | //////////////////////////////////////////////////////////////////////////////////////////////// |
| 1003 | // now draw the game clock |
991 | // now draw the game clock |
| Line 1045... | Line 1033... | ||
| 1045 | // now draw the game history text |
1033 | // now draw the game history text |
| 1046 | 1034 | ||
| 1047 | // do we want to display the game history ? if so, display the game history text in PGN |
1035 | // do we want to display the game history ? if so, display the game history text in PGN |
| 1048 | if (options.want_history && (board->move_count > 1)) |
1036 | if (options.want_history && (board->move_count > 1)) |
| 1049 | { |
1037 | { |
| 1050 | // first off, see where we start (for long games, we don't want to display EVERYTHING... |
- | |
| 1051 | if (board->viewed_move > 30) |
- | |
| 1052 | start_index = board->viewed_move - 30; // display 30 moves maximum |
- | |
| 1053 | else |
- | |
| 1054 | start_index = 1; |
- | |
| 1055 | - | ||
| 1056 | // allocate an arbitrary length history text string buffer (assume each move can't be longer than 15 characters) |
1038 | // allocate an arbitrary length history text string buffer (assume each move can't be longer than 15 characters) |
| 1057 | historytext_size = 15 * (1 + |
1039 | historytext_size = 15 * (1 + board->viewed_move); |
| 1058 | history_text = (wchar_t *) SAFE_malloc (historytext_size, sizeof (wchar_t), false); |
1040 | history_text = (wchar_t *) SAFE_malloc (historytext_size, sizeof (wchar_t), false); |
| 1059 | history_text[0] = 0; // and reset it |
1041 | history_text[0] = 0; // and reset it |
| 1060 | 1042 | ||
| 1061 | // now for each move we want to display... |
1043 | // now for each move we want to display... |
| 1062 | for (move_index = |
1044 | for (move_index = 1; move_index <= board->viewed_move; move_index++) |
| 1063 | { |
1045 | { |
| 1064 | length = wcslen (history_text); // get current text length |
1046 | length = wcslen (history_text); // get current text length |
| 1065 | 1047 | ||
| 1066 | // every move pair, append move pair number |
1048 | // every move pair, append move pair number |
| 1067 | if (move_index % 2 == 1) |
1049 | if (move_index % 2 == 1) |