diff options
-rw-r--r-- | src/ball.c | 37 | ||||
-rw-r--r-- | src/ball.h | 4 | ||||
-rw-r--r-- | src/map.c | 1 |
3 files changed, 25 insertions, 17 deletions
@@ -20,22 +20,25 @@ #include <stdlib.h> #include "ball.h" #include "collision.h" +#include "tileset.h" #include "output.h" struct db_ball { - double x; - double y; - int r; - double a; - int d; - int sr; - double s; - struct db_ball *next; + double x; + double y; + int r; + double a; + int d; + int sr; + double s; + struct db_tileset *tilesets; + int gid; + struct db_ball *next; }; struct db_ball * db_ball_new(int x, int y, int r, int a, int d, int sr, double s, - struct db_ball *prev) + struct db_tileset *tilesets, int gid, struct db_ball *prev) { struct db_ball *ball; @@ -45,13 +48,15 @@ db_ball_new(int x, int y, int r, int a, int d, int sr, double s, return NULL; } - ball->x = x; - ball->y = y; - ball->r = r; - ball->a = a; - ball->d = d; - ball->sr = sr; - ball->s = s; + ball->x = x; + ball->y = y; + ball->r = r; + ball->a = a; + ball->d = d; + ball->sr = sr; + ball->s = s; + ball->tilesets = tilesets; + ball->gid = gid; if (prev != NULL) { prev->next = ball; @@ -20,10 +20,12 @@ #ifndef DB_BALL_H_ #define DB_BALL_H_ +#include "tileset.h" + struct db_ball; struct db_ball *db_ball_new(int x, int y, int r, int a, int d, int sr, double s, - struct db_ball *prev); + struct db_tileset *tilesets, int gid, struct db_ball *prev); void db_balls_collisions(struct db_ball *ball_head); int db_balls_player_collisions(struct db_ball *ball_head, int player_x, int player_y, int player_r) @@ -539,6 +539,7 @@ _db_tmx_object_end(void *pv, const char *name) map->ball_tail = db_ball_new(map->obj_x, map->obj_y, map->obj_r, map->obj_a, map->obj_d, map->obj_sr, map->obj_s, + map->tileset_head, map->obj_gid, map->ball_tail); if (map->ball_tail == NULL) { XML_StopParser(p, XML_FALSE); |