Prev: EF6C Up: Map Next: F04C
F036: Find an object's far corner and floor
Used by the routines at REDRAW_OBJECT and SORT_AND_DRAW_BEHIND.
D is +6 plus +9 and C is +8 plus +11, the far edges along the two floor axes; E is +7, the top, less +10, the height: the floor it stands on. IS_IN_FRONT tests other objects against them. Krumlinde's name for it is RTN_ComputeSortKey.
Input
IX The object's record
Output
D The far edge along +6
E The floor
C The far edge along +8
FAR_CORNER F036 LD A,(IX+OBJ_X)
F039 ADD A,(IX+OBJ_LEN_X)
F03C LD D,A
F03D LD A,(IX+OBJ_TOP)
F040 SUB (IX+OBJ_HEIGHT)
F043 LD E,A
F044 LD A,(IX+OBJ_Z)
F047 ADD A,(IX+OBJ_LEN_Z)
F04A LD C,A
F04B RET
Prev: EF6C Up: Map Next: F04C