diff options
-rw-r--r-- | ball.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -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; } } |