#include <sprite.h>
Defines | |
#define | COLLISION_COLLIDE 0x8000 |
#define | COLLISION_INTERSECT 0x80 |
#define | COLLISION_Y1_LE_Y2 0x1 |
#define | COLLISION_X1_LE_X2 0x2 |
Functions | |
void * | init_collision_routine (void *addr) |
void | launch_collision_test (sprite *s1, sprite *s2) |
long | is_collision_done () |
long | get_collision_result (short int *y, short int *h, short int *x, short int *w) |
|
The two sprites collide. |
|
The bounding boxes of the two sprites intersect. |
|
The first sprite is on the left of the second one. |
|
The first sprite is above the second one. |
|
Returns the result of the collision test. If COLLISION_INTERSECT then the two bounding boxes intersect. In this case, it returns the coordinates of the intersection box. If COLLISION_Y1_LE_Y2 then y is relative to first sprite, otherwise relative to the second sprite. If COLLISION_X1_LE_X2 then xis relative to first sprite, otherwise relative to the second sprite.
|
|
Initialise the GPU collision routine. The given address must be an address in GPU ram where to load the GPU routine. It returns the address of the end of the collision routine in GPU ram (which is long aligned).
|
|
Checks whether the collision test launched with launch_collision_test has finished. |
|
Run the collision test between the two given sprites. The collision routine works only with 16 bit sprites that are not scaled and not reflected. The result of the test can be read with get_collision_result.
|