Repository navigation
Add sprite AABB collision helper - #75
Conversation
|
@codex fix-request (review of ee7a92c, base 9bcc0c3; every CI check passed on a hand-resolved merge a35a02c, except cargo +1.85, which CI covers) F0 [blocking] Conflicts with
Reply format and rules: AGENTS.md "Fix requests". |
Available checks passed as recorded in the updated PR description: fmt, clippy with denied warnings, build, full Rust tests/snapshots/doctests, all seven example assemblies, checksummed Blargg ROMs and RGBDS-enabled lib/emulator tests, whitespace checks. Rust 1.85 is unavailable locally (no rustup/toolchain); GitHub MSRV checks are reported separately. Fresh independent review of the final head remains pending. Reviewer agents reached the account usage limit; these fixes and local checks are not being counted as a completed independent review. Merge order is recorded in the PR dependency line. |
Depends on #74.
Summary
Phase 3 had no reusable sprite rectangle collision check. This adds
engine::Aabb::overlaps, which emits an unsigned half-open rectangle test and runs a body only when the rectangles share positive area.What changed
Aabbwith coordinate snippets and nonzero byte dimensions; exported it fromengineand the prelude.Task.md,CONTEXT.mdandCHANGELOG.md.Tasks closed
Task.md: sprite-vs-sprite AABB checks.How it was verified
Final pushed head
fdf4ba99fdee2425f92df7069ee6e80086129843:cargo fmt --check— passed.cargo clippy --all-targets -- -D warnings— passed.cargo build— passed.cargo test— passed (447 library tests, integration tests, snapshots and doctests).scripts/assemble-examples.shwith RGBDS 1.0.4 on PATH — passed; all seven examples.scripts/fetch-test-roms.sh /tmp/rust-boy-test-roms— pinned checksums passed; cache reused.RGBDS_LINK_CHECK=1 GB_TEST_ROMS=/tmp/rust-boy-test-roms cargo test --lib --test emulatorwith RGBDS on PATH — passed (447 library, 113 emulator tests including Blargg).git diff --check— passed.cargo +1.85 test— not run locally (rustup / 1.85 not installed; CI MSRV job checks this).Generated-asm impact
No example output changes; snapshots are unchanged.
Risks and follow-ups
Coordinates and dimensions are unsigned bytes; rectangles whose right or bottom edge crosses 256 need a wrap-aware follow-up (recorded as an unticked follow-up in Task.md).
Independent review
fdf4ba99fdee2425f92df7069ee6e80086129843againstrefactor(ede3574).ee7a92care addressed:engine::modandpreludeproperly exportAabb;CONTEXT.mdaccurately preservesrefactor's state and addsengine::Aabb.tests/emulator.rshas tests for left-touch, top-touch, clear misses, non-square rectangles, and rectangles reading live sprite coordinates fromgame.sprites.get_x/get_y.(250, 10, 8, 8, 251, 10, 2, 8, 0), and added as an unticked follow-up inTask.md.How to review
Review
src/engine/collision.rsfor the four strict edge comparisons andtests/emulator.rsfor overlap and edge-touch cases.