summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/level.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/level.c b/src/level.c
index 0973003..efa566c 100644
--- a/src/level.c
+++ b/src/level.c
@@ -25,19 +25,19 @@
#include "output.h"
struct db_level {
- char *game_id;
- char *level_id;
- struct db_level *next;
- int player_x;
- int player_y;
- int player_r;
- int player_a;
- int player_s;
- int target_x;
- int target_y;
- int target_r;
- struct db_ball *ball_head;
- struct db_ball *ball_tail;
+ char *game_id;
+ char *level_id;
+ struct db_level *next;
+ struct db_tileset *tilesets;
+ int player_x;
+ int player_y;
+ int player_r;
+ int player_a;
+ int player_s;
+ int target_x;
+ int target_y;
+ int target_r;
+ struct db_ball *balls;
};
struct db_level *
@@ -86,6 +86,12 @@ db_level_play(SDL_Renderer *renderer, struct db_level *level)
return -1;
}
map_texture = db_map_render(map, renderer);
+ level->tilesets = db_map_get_tilesets(map);
+ db_map_get_player(map, &level->player_x, &level->player_y,
+ &level->player_r);
+ db_map_get_target(map, &level->target_x, &level->target_y,
+ &level->target_r);
+ level->balls = db_map_get_balls(map);
if (SDL_RenderClear(renderer) != 0) {
db_err("Failed to clear screen (%s)", SDL_GetError());