diff options
Diffstat (limited to 'ball.c')
-rw-r--r-- | ball.c | 20 |
1 files changed, 3 insertions, 17 deletions
@@ -57,9 +57,9 @@ GLPong_BallAdd(Ball_t ** balls) { newball->y = 100.0f; newball->xv = 2.0f; newball->yv = 2.0f; - newball->r = rand() % 255; - newball->g = rand() % 255; - newball->b = rand() % 255; + newball->r = (GLubyte)(rand() % 255); + newball->g = (GLubyte)(rand() % 255); + newball->b = (GLubyte)(rand() % 255); newball->a = SDL_ALPHA_OPAQUE; *balls = newball; @@ -71,20 +71,6 @@ GLPong_BallAdd(Ball_t ** balls) { } void -GLPong_BallDelete(Ball_t * from, Ball_t * ball) { - Ball_t * temp = NULL; - while (from) { - if (from == ball) { - temp = ball; - from->next = ball->next; - free(ball); - break; - } - from = from->next; - } -} - -void GLPong_BallDeleteAll(Ball_t * list) { if (list) { GLPong_BallDeleteAll(list->next); |