Skip to content

Commit e04bc80

Browse files
committed
Add more documentational and cautionary comments
1 parent 802c5d2 commit e04bc80

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sxbp/refine_figure_grow_from_start.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,15 @@ static sxbp_length_t sxbp_resolve_collision(
256256
// calculate collider end coördinates
257257
sxbp_co_ord_t collider_end = collider_origin;
258258
sxbp_move_location_along_line(&collider_end, collider);
259+
// XXX: This soup of if and else-if blocks is copied direct from the
260+
// original implementation. It cannot be verified to work correctly until
261+
// sxbp_suggest_previous_length_callback is fixed.
262+
// TODO: Once verified that this logic is correct, replace with a lookup
263+
// table approach, using the SXBP direction constants as indices
264+
// (lookup table will be a 2D array of the expressions that change)
265+
// WARN: if this approach is used, a check should first be made to check and
266+
// rule out the combinations of directions not featured in the table (any
267+
// non-parallel combos, which cannot be optimised in this manner)
259268
if((previous.direction == SXBP_UP) && (collider.direction == SXBP_UP)) {
260269
return (collider_origin.y - previous_origin.y) + collider.length + 1;
261270
} else if((previous.direction == SXBP_UP) && (collider.direction == SXBP_DOWN)) {

0 commit comments

Comments
 (0)