Port DDDisplay__BlitStippled (per-pixel checkerboard XOR pattern) and
DDDisplay__BlitTiled (horizontal sprite tiling) to pure Rust, eliminating
fallthrough to the original WA code for these modes.
Slot 19 (BlitSprite) now only falls through for bitmap sprites.
Slot 20 (DrawScaledSprite) has no fallthrough at all.
Adds 6 snapshot tests (4 stippled + 2 tiled) validated against WA ground
truth, and consolidates snapshot capture into a single OPENWA_CAPTURE_SNAPSHOTS
env var.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Port all remaining 8bpp blend modes in the core sprite blit hook:
- Mode 1 with non-null color_table pointer now passes the LUT through
instead of falling back to native WA
- Mode 2 (additive mask): write src where both src and dst are non-zero
- Mode 3 (subtractive mask): write src where src non-zero and dst is zero
- Update color_table parameter type from u32 to *const u8 (FFI style)
- Snapshot capture now uses ORIG_BLIT to call unhooked native function
34 tests (up from 25): 5 new unit tests + 4 new snapshot tests verified
byte-exact against native WA output.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: port core sprite blit with snapshot tests and hook
Port BitGrid__BlitSpriteRect (0x4F6910) — the core sprite/bitmap
blitting function used for both rendering and collision mask
construction. Hooked via MinHook with fallthrough to original for
unsupported modes.
Sprite blit module (sprite_blit.rs):
- Direct copy (mode 0) and color-table/transparency (mode 1)
- 8 orientation modes (mirror X/Y/XY, 90° rotations)
- Destination clip rect support
- GIF test image loader with transparent index normalization
18 snapshot tests captured from WA's native function verify
pixel-perfect output. All 15 headless replay tests pass (simulation
checksums match), confirming correctness for collision masks.
Also ports DDDisplay::is_sprite_loaded (slot 32) and
DDDisplay::draw_via_callback (slot 21), bringing ported DDDisplay
methods to 13 of 38. Splits DisplayBase _buf_008 into named
sprite_array_0/1/2 fields.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: port polygon fill with Sutherland-Hodgman clipping, 26 snapshot tests
Add PixelGrid (pure-Rust test grid) and PixelWriter trait for unit
testing line algorithms without WA runtime. Add snapshot capture in
DLL (OPENWA_CAPTURE_LINE_SNAPSHOTS=1, triggered at frame 10) that
draws test lines on a BitGrid using WA's native functions and saves
pixel data for comparison.
Also fix headful test crash: remove --minimized flag which became
incompatible with WA's DirectDraw initialization.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>