File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff 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 )) {
You can’t perform that action at this time.
0 commit comments