diff options
author | P. J. McDermott <pj@pehjota.net> | 2021-03-27 17:20:27 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2021-03-27 17:20:58 (EDT) |
commit | 38f7c9f909815df9886b532e2e631c91ca6db1a6 (patch) | |
tree | 0275b8b838af2e897cd8e3227220e3a789fe0cfa /src | |
parent | f5afccb93da63988655817cf49741f9c0955f1a5 (diff) | |
download | dodge-balls-38f7c9f909815df9886b532e2e631c91ca6db1a6.zip dodge-balls-38f7c9f909815df9886b532e2e631c91ca6db1a6.tar.gz dodge-balls-38f7c9f909815df9886b532e2e631c91ca6db1a6.tar.bz2 |
ball: Add map member
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); |