Skip to content

Commit 14945ab

Browse files
committed
Remove numerous other bits of left over debugging code
1 parent 48a9aaf commit 14945ab

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

sxbp/refine_figure_grow_from_start.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,6 @@ static sxbp_result_t sxbp_figure_collides_with(
198198
sxbp_walk_figure(
199199
figure, 1, sxbp_figure_collides_with_callback, (void*)&data
200200
);
201-
// XXX: debugging, print the line map
202-
for (uint32_t row = 0; row < map.height; row++) {
203-
for (uint32_t col = 0; col < map.width; col++) {
204-
if (map.cells[col][map.height - 1 - row] != NULL) {
205-
printf("%x", map.cells[col][map.height - 1 - row]->id);
206-
} else {
207-
printf("░");
208-
}
209-
}
210-
printf("\n");
211-
}
212-
printf("\n");
213201
// free the line map
214202
sxbp_free_line_map(&map);
215203
// signal to caller that the call succeeded
@@ -340,12 +328,6 @@ static sxbp_length_t sxbp_suggest_previous_length(
340328
sxbp_walk_figure(
341329
figure, 1, sxbp_suggest_previous_length_callback, (void*)&data
342330
);
343-
// XXX: Debugging code
344-
// printf(
345-
// "(%u, %u) and (%u, %u)\n",
346-
// data.previous_origin.x, data.previous_origin.y,
347-
// data.collider_origin.x, data.collider_origin.y
348-
// );
349331
// use collision resolution rules to calculate the length to resize to
350332
sxbp_resolve_collision(
351333
previous, collider, data.previous_origin, data.collider_origin
@@ -377,10 +359,6 @@ static sxbp_result_t sxbp_set_line_length(
377359
while (true) {
378360
// set the target line to the target length
379361
figure->lines[target_index].length = target_length;
380-
// XXX: debugging, render figure
381-
sxbp_bitmap_t bitmap = sxbp_blank_bitmap();
382-
sxbp_render_figure_to_bitmap(figure, &bitmap);
383-
sxbp_print_bitmap(&bitmap, stdout);
384362
// check if the figure now collides, and if so, with which other line?
385363
sxbp_line_t* collider = NULL;
386364
if (
@@ -400,8 +378,6 @@ static sxbp_result_t sxbp_set_line_length(
400378
* alternative size to set the *previous* line to to try and
401379
* resolve it
402380
*/
403-
// XXX: debugging, reset the latest line to zero
404-
figure->lines[target_index].length = 0;
405381
// change target length so next iteration uses this suggestion
406382
target_length = sxbp_suggest_previous_length(
407383
figure, target_index, collider->id
@@ -453,10 +429,6 @@ sxbp_result_t sxbp_refine_figure_grow_from_start(
453429
sxbp_figure_t* figure,
454430
const sxbp_refine_figure_options_t* options
455431
) {
456-
// XXX: debugging
457-
for (sxbp_figure_size_t i = 0; i < figure->size; i++) {
458-
figure->lines[i].length = 0;
459-
}
460432
// variable to store any errors in
461433
// sxbp_result_t status = SXBP_RESULT_UNKNOWN;
462434
// try and set the length of each line in the figure (ascending) to 1

tests.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ extern "C"{
3131
#pragma GCC diagnostic ignored "-Wunused-parameter"
3232
static void print_progress(const sxbp_figure_t* figure, void* context) {
3333
printf("(%" PRIu32 " lines remaining)\n", figure->lines_remaining);
34-
fflush(stdout);
3534
}
3635
// reënable all warnings
3736
#pragma GCC diagnostic pop

0 commit comments

Comments
 (0)