Subversion Repositories Games.Chess Giants

Rev

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

Rev 159 Rev 171
Line 24... Line 24...
24
   player->recvbuffer[0] = 0;
24
   player->recvbuffer[0] = 0;
25
 
25
 
26
   // save player type and color
26
   // save player type and color
27
   player->type = type;
27
   player->type = type;
28
   player->color = color;
28
   player->color = color;
-
 
29
 
-
 
30
   // reset their sleep time
-
 
31
   player->sleep_time = 0;
29
 
32
 
30
   // if internet or computer play, initialize the right interface
33
   // if internet or computer play, initialize the right interface
31
   if (player->type == PLAYER_INTERNET)
34
   if (player->type == PLAYER_INTERNET)
32
   {
35
   {
33
      // if we want online gaming, initialize the network
36
      // if we want online gaming, initialize the network
Line 84... Line 87...
84
 
87
 
85
   // reset current view
88
   // reset current view
86
   player->view_pitch = 55.0f;
89
   player->view_pitch = 55.0f;
87
   player->view_yaw = (player->color == COLOR_BLACK ? 90.0f : -90.0f);
90
   player->view_yaw = (player->color == COLOR_BLACK ? 90.0f : -90.0f);
88
   player->view_distance = 70.0f;
91
   player->view_distance = 70.0f;
89
 
92
 
90
   // reset custom view too
93
   // reset custom view too
91
   player->custom_pitch = player->view_pitch;
94
   player->custom_pitch = player->view_pitch;
92
   player->custom_yaw = player->view_yaw;
95
   player->custom_yaw = player->view_yaw;
93
   player->custom_distance = player->view_distance;
96
   player->custom_distance = player->view_distance;
94
 
97
 
95
   return; // finished
98
   return; // finished
96
}
99
}
97
 
100
 
98
 
101
 
99
bool Player_RotateTable (player_t *player, float frame_time)
102
bool Player_RotateTable (player_t *player, float frame_time)
100
{
103
{
101
   // this function is called every frame to rotate the chess table. There is some kind of
104
   // this function is called every frame to rotate the chess table. There is some kind of
102
   // filtering for the view. The function returns TRUE if the scene needs to be updated
105
   // filtering for the view. The function returns TRUE if the scene needs to be updated
103
   // (that is, the table turned significantly).
106
   // (that is, the table turned significantly).
104
 
107
 
105
   float deviation_yaw;
108
   float deviation_yaw;
106
   float deviation_pitch;
109
   float deviation_pitch;
107
   float deviation_distance;
110
   float deviation_distance;
108
   float turnspeed_yaw;
111
   float turnspeed_yaw;
109
   float turnspeed_pitch;
112
   float turnspeed_pitch;
Line 144... Line 147...
144
   // this function makes the players think (in case they are not human)
147
   // this function makes the players think (in case they are not human)
145
 
148
 
146
   player_t *current_player;
149
   player_t *current_player;
147
   player_t *opposite_player;
150
   player_t *opposite_player;
148
   bool do_update;
151
   bool do_update;
-
 
152
 
-
 
153
   if (player->sleep_time > current_time)
-
 
154
      return (false); // if this player should NOT think yet, then just don't
149
 
155
 
150
   do_update = false; // don't update scene until told otherwise
156
   do_update = false; // don't update scene until told otherwise
151
 
157
 
152
   // get current and opposite players
158
   // get current and opposite players
153
   current_player = Player_GetCurrent ();
159
   current_player = Player_GetCurrent ();