diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ball.c | 6 | ||||
-rw-r--r-- | src/ball.h | 4 | ||||
-rw-r--r-- | src/map.c | 2 |
3 files changed, 9 insertions, 3 deletions
@@ -21,6 +21,7 @@ #include <stdlib.h> #include "ball.h" #include "collision.h" +#include "map.h" #include "tileset.h" #include "output.h" @@ -36,12 +37,14 @@ struct db_ball { double s; struct db_tileset *tilesets; int gid; + struct db_map *map; 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_tileset *tilesets, int gid, struct db_ball *prev) + struct db_tileset *tilesets, int gid, struct db_map *map, + struct db_ball *prev) { struct db_ball *ball; @@ -68,6 +71,7 @@ db_ball_new(int x, int y, int r, int a, int d, int sr, double s, ball->s = s; ball->tilesets = tilesets; ball->gid = gid; + ball->map = map; if (prev != NULL) { prev->next = ball; @@ -20,12 +20,14 @@ #ifndef DB_BALL_H_ #define DB_BALL_H_ +#include "map.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_tileset *tilesets, int gid, struct db_ball *prev); + struct db_tileset *tilesets, int gid, struct db_map *map, + struct db_ball *prev); void db_balls_move(struct db_ball *ball); void db_balls_collisions(struct db_ball *ball_head); int db_balls_player_collisions(struct db_ball *ball_head, @@ -553,7 +553,7 @@ _db_tmx_object_end(void *pv, const char *name) map->obj_r, map->obj_a, map->obj_d, map->obj_sr, map->obj_s, map->tileset_head, map->obj_gid, - map->ball_tail); + map, map->ball_tail); if (map->ball_tail == NULL) { XML_StopParser(p, XML_FALSE); free(map->obj_type); |