summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ball.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/ball.c b/ball.c
index 81c3ad0..a1c3b9e 100644
--- a/ball.c
+++ b/ball.c
@@ -26,14 +26,14 @@ GLPong_BallInit() {
ball_width = GLPONG_WIDTH / 32.0f; /* FIXME: magic numbers */
ball_height = GLPONG_HEIGHT / 24.0f;
- ball = glGenLists(1);
- glNewList(ball, GL_COMPILE);
+ ball = glGenLists(1);
+ glNewList(ball, GL_COMPILE);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex2f( 0.0f, 0.0f); /* Lower Left */
glTexCoord2f(1.0f, 0.0f); glVertex2f(ball_width, 0.0f); /* Lower Right */
glTexCoord2f(1.0f, 1.0f); glVertex2f(ball_width, ball_height); /* Upper Right */
glTexCoord2f(0.0f, 1.0f); glVertex2f( 0.0f, ball_height); /* Upper Left */
- glEnd();
+ glEnd();
glEndList();
}
@@ -72,16 +72,15 @@ GLPong_BallAdd(Ball_t ** balls) {
void
GLPong_BallDelete(Ball_t * from, Ball_t * ball) {
- Ball_t * current = from;
Ball_t * temp = NULL;
- while (current) {
- if (current == ball) {
+ while (from) {
+ if (from == ball) {
temp = ball;
- current->next = ball->next;
+ from->next = ball->next;
free(ball);
break;
}
- current = current->next;
+ from = from->next;
}
}