Prev: CD43 Up: Map Next: CD6C
CD4D: Mark every object the moving object's old or new rectangle touches
Used by the routines at set_wipe_and_draw_flags and head_on_shoulders.
Called once an object has moved or changed sprite. It works out the object's new screen rectangle, forms the smallest rectangle that covers both that and the one it had at the start of the frame (saved at +$1C to +$1F by save_2d_info), and then walks all forty object records setting the redraw flag, bit 4 of +$07, on every live object whose current rectangle overlaps it -- including the moving object itself, if it is not marked already.
Horizontally the rectangles are measured in byte columns (pixel x divided by 8), vertically in pixel rows counted up from the bottom. At the end of this entry E is the union's first column and D its width in columns; union_right_edge to union_height go on to put its lowest row in L and its height in H.
Only the moving object's own rectangle is used. An object that is redrawn because it overlaps it does not in turn mark the objects that overlap it.
Input
IX the object that has moved
set_draw_objs_overlapped CD4D LD IY,$5C08 IY = object 0; new rectangle into +$18 to +$1B
CD51 CALL calc_2d_info
CD54 LD B,$28 forty objects to test
CD56 LD A,(IX+$1A) L = the new first column
CD59 RRCA
CD5A RRCA
CD5B RRCA
CD5C AND $1F
CD5E LD L,A
CD5F LD A,(IX+$1E) H = the old first column
CD62 RRCA
CD63 RRCA
CD64 RRCA
CD65 AND $1F
CD67 LD H,A
CD68 CP L A = whichever is further left
CD69 JR C,union_right_edge
CD6B LD A,L
Prev: CD43 Up: Map Next: CD6C