Prev: CD99 Up: Map Next: CDB3
CD9B: Test one object against the union rectangle
Used by the routine at next_overlap_obj.
IY is the object under test. An empty record (type 0) is skipped, and so is one already marked for redrawing. Otherwise its current rectangle is compared with the union: in each direction, if the object starts inside the union its offset from the union's start must be less than the union's size, and if it starts before the union the distance back must be less than the object's own size. Both directions overlapping means the object must be redrawn.
Input
IY the object to test
E the union's first column, D its width in columns
L the union's bottom row, H its height in rows
test_overlap_obj CD9B LD A,(IY+$00) skip empty records
CD9E AND A
CD9F JR Z,next_overlap_obj
CDA1 BIT 4,(IY+$07) skip objects already marked for redrawing
CDA5 JR NZ,next_overlap_obj
CDA7 LD A,(IY+$1A) A = the object's first column
CDAA RRCA
CDAB RRCA
CDAC RRCA
CDAD AND $1F
CDAF SUB E columns from the union's left edge; negative if it starts to the left
CDB0 JR C,obj_starts_left
CDB2 CP D does it start beyond the union's right edge?
Prev: CD99 Up: Map Next: CDB3