Ship libccd's notice, and keep the rectangle helpers on purpose

libccd is compiled into libakgl.so and is BSD-3-Clause, so the notice has to
travel with the binary form. cmake --install now puts BSD-LICENSE at
share/doc/akgl/BSD-LICENSE.libccd, and the README says which dependency is in
that position and which are not -- everything else in deps/ is either a separate
shared object carrying its own notice, a header, or compiled into nothing.

The plan's last step was to delete akgl_rectangle_points,
akgl_collide_point_rectangle and akgl_collide_rectangles. That step is not taken,
and TODO.md carries the reasoning rather than leaving it to be rediscovered:
akgl_collide_rectangles has two correct callers in the sidescroller asking a
game-level overlap question that wants a bool, and it was fixed two commits into
this same series -- deleting it now would be a strange thing to do to a caller.
The other two are the weak case and are named as the candidates if a 0.9.0 wants
to trim.

akgl_RectanglePoints' comment still claimed akgl_collide_rectangles works corner
by corner, which stopped being true when the cross case was fixed. Corrected in
place, with the cross case named so the note explains why the shape changed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KzBDV2fqgnUAcqCKqKvc71
This commit is contained in:
2026-08-02 07:55:59 -04:00
parent 986c80d0ec
commit 71e18184c0
4 changed files with 64 additions and 3 deletions

View File

@@ -30,9 +30,13 @@ typedef struct akgl_Point {
/**
* @brief The four corners of an axis-aligned rectangle, precomputed.
*
* akgl_collide_rectangles works corner by corner rather than by comparing edge
* spans, so it wants the corners as points. akgl_rectangle_points derives one of
* these from an `SDL_FRect`.
* The form akgl_collide_point_rectangle wants. akgl_rectangle_points derives one
* of these from an `SDL_FRect`.
*
* @note akgl_collide_rectangles used to be built on this, corner by corner, and
* missed the cross case that way -- two rectangles overlapping in a plus
* sign have no corner of either inside the other. It compares edge spans
* in `float32_t` since 0.8.0 and does not go through here at all.
*/
typedef struct akgl_RectanglePoints {
akgl_Point topleft; /**< (x, y). */