Prev: E3D6 Up: Map Next: E3FF
E3D9: Draw Object
Used by the routine at DrawObjectsInList.
Draws an object, if it is on the screen. The position of the object is worked out from its position in the world and the offsets of its sprite, and kept in the object.
After DrawObject
draw-object
Input
IX Object
Clip the X position of the sprite.
DrawObject E3D9 CALL ProjectObject Work out the position of the object on the screen.
E3DC LD HL,($BBB6) Return if the position along the X axis is outside the screen.
E3DF LD A,H
E3E0 AND A
E3E1 RET NZ
E3E2 LD A,L Add the offset of the sprite along the X axis, and return if that is past the right edge of the window.
E3E3 ADD A,(IX+$0C)
E3E6 CP $CB
E3E8 RET NC
E3E9 CP $10 Return if it is past the left edge, and set the X position of the sprite.
E3EB RET C
E3EC LD (IX+$0E),A
Clip the Y position of the sprite.
E3EF LD HL,($BBB8) Return if the position along the Y axis is outside the screen.
E3F2 LD A,H
E3F3 AND A
E3F4 RET NZ
E3F5 LD A,L Add the offset of the sprite along the Y axis, and return if that is past the top edge of the window.
E3F6 ADD A,(IX+$0D)
E3F9 CP $B8
E3FB RET NC
E3FC LD (IX+$0F),A Set the Y position of the sprite.
Prev: E3D6 Up: Map Next: E3FF