Skip to content

Commit

Permalink
Add debug logging for hitpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
lw committed Apr 24, 2020
1 parent 4e1842a commit cce0c6b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/maniac.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static int play(char *map)
{
struct hitpoint *points = NULL;
struct beatmap_meta *meta = NULL;
int num_points = parse_beatmap(map, &points, &meta);
int num_points = (int)parse_beatmap(map, &points, &meta);
if (!num_points || !points || !meta) {
debug("num_points = %i, points = %p, meta = %p", num_points,
(void *)points, (void *)meta);
Expand All @@ -199,6 +199,14 @@ static int play(char *map)
printf("parsed %d hitpoints of map '%s' ('%s', %d)\n", num_points,
meta->title, meta->version, meta->map_id);

#ifdef DEBUG
for (int i = 0; i < num_points; i++) {
struct hitpoint *point = &points[i];
debug("point %d: (col: %d, start: %d, end: %d)", i, point->column,
point->start_time, point->end_time);
}
#endif /* DEBUG */

humanize_hitpoints(num_points, &points, delay);

debug("humanized %d hitpoints with delay of %d", num_points, delay);
Expand Down

0 comments on commit cce0c6b

Please sign in to comment.