view carNode.c @ 12:b405fe1a6920

*** empty log message ***
author gongo
date Sat, 04 Nov 2006 08:55:26 +0000
parents 0fae5658fb0b
children a1908b83f8fa
line wrap: on
line source

/*
 * $Id$
 */
#include <stdio.h>
#include <stdlib.h>
#include "libps2.h"
#include "ps2util.h"
#include "car.h"
#include "game.h"

extern Game game;

/* --- car.c --- */
extern void car_destroy(CarPtr car);

static CarPtr car_list;

void
carNode_append(CarPtr new)
{
    CarPtr p = car_list;

    if (!p) {
	car_list = new;
    } else {
	while (p->next) p = p->next;
	p->next = new;
    }
}

void
carNode_draw()
{
    CarPtr p = car_list;

    while (p) {
	ps2util_obj_Draw(p->body);
	p = p->next;
    }
}

void
carNode_destroy()
{
    CarPtr p = car_list;

    while (p) {
	car_destroy(p);
	p = p->next;
    }
    car_list = NULL;
}