// Filename : COLLIDE.C // Coded by : Scott Evans // Created/Modified : 8/3/98 // Description : Collision detection routines #include // Function : BoundingBoxTest() // Coded by : Scott Evans // Created/Modified : 8/3/98 // Description : Tests if the an object is within the specified rectangular area // Parameters : r - dimensions of the object // r1 - dimensions of area to test // Returns : 1 - object is within specified area // 0 - object is not within specified area // Notes : None u_byte BoundingBoxTest(RECT *r,RECT *r1) { if(IsPointInBox(r->x,r->y,r1)) return(1); if(IsPointInBox(r->x,r->y+r->h,r1)) return(1); if(IsPointInBox(r->x+r->w,r->y,r1)) return(1); if(IsPointInBox(r->x+r->w,r->y+r->h,r1)) return(1); return(0); }