comparison carNode.c @ 0:0fae5658fb0b

Initial revision
author gongo
date Thu, 02 Nov 2006 08:55:19 +0000
parents
children a1908b83f8fa
comparison
equal deleted inserted replaced
-1:000000000000 0:0fae5658fb0b
1 /*
2 * $Id$
3 */
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include "libps2.h"
7 #include "ps2util.h"
8 #include "car.h"
9 #include "game.h"
10
11 extern Game game;
12
13 /* --- car.c --- */
14 extern void car_destroy(CarPtr car);
15
16 static CarPtr car_list;
17
18 void
19 carNode_append(CarPtr new)
20 {
21 CarPtr p = car_list;
22
23 if (!p) {
24 car_list = new;
25 } else {
26 while (p->next) p = p->next;
27 p->next = new;
28 }
29 }
30
31 void
32 carNode_draw()
33 {
34 CarPtr p = car_list;
35
36 while (p) {
37 ps2util_obj_Draw(p->body);
38 p = p->next;
39 }
40 }
41
42 void
43 carNode_destroy()
44 {
45 CarPtr p = car_list;
46
47 while (p) {
48 car_destroy(p);
49 p = p->next;
50 }
51 car_list = NULL;
52 }