@@ -216,10 +216,10 @@ uint64_t pong_draw(struct pong *pong)
216
216
if (pong -> ball_y .pos >= 30.0 || pong -> ball_y .pos <= 0.0 )
217
217
pong -> ball_y .vel = - pong -> ball_y .vel ;
218
218
219
- if (roundf (pong -> ball_x .pos ) == 40.0 + rand_double (13 )) {
219
+ if (round (pong -> ball_x .pos ) == 40.0 + rand_double (13 )) {
220
220
pong -> player_left .target_y = pong -> ball_y .pos - 3.0 ;
221
221
clamp (& pong -> player_left .target_y , 0.0 , 24.0 );
222
- } else if (roundf (pong -> ball_x .pos ) == 8 + rand_double (13 )) {
222
+ } else if (round (pong -> ball_x .pos ) == 8 + rand_double (13 )) {
223
223
pong -> player_right .target_y = pong -> ball_y .pos - 3.0 ;
224
224
clamp (& pong -> player_right .target_y , 0.0 , 24.0 );
225
225
}
@@ -236,7 +236,7 @@ uint64_t pong_draw(struct pong *pong)
236
236
237
237
/* If the ball is in the middle, check if we need to lose and calculate
238
238
* the endpoint to avoid/hit the ball */
239
- if (roundf (pong -> ball_x .pos ) == 32.0 ) {
239
+ if (round (pong -> ball_x .pos ) == 32.0 ) {
240
240
struct pong_time cur_time = {};
241
241
242
242
pong_time_update (& cur_time );
@@ -280,8 +280,8 @@ uint64_t pong_draw(struct pong *pong)
280
280
memset (pong -> gif -> frame , 0 , 64 * 32 );
281
281
pong_draw_net (pong );
282
282
pong_draw_time (pong );
283
- pong_draw_player (pong , 0 , pong -> player_left .y );
284
- pong_draw_player (pong , 62 , pong -> player_right .y );
283
+ pong_draw_player (pong , 0 , ( int ) pong -> player_left .y );
284
+ pong_draw_player (pong , 62 , ( int ) pong -> player_right .y );
285
285
pong_draw_ball (pong );
286
286
287
287
return 8 ;
0 commit comments