home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / MISC / STK100.ZIP / STKSRC.COM / SPR_HIT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-10-20  |  2.2 KB  |  60 lines

  1. /**********************************************************************
  2. * spr_hit.h
  3. * The sprite collision detection routines.
  4. *
  5. * Collisions may be checked only for the sprites which have been 
  6. * spr_put() since the last call to spr_next_pass().
  7. * All checks are made against the mask-bitmaps of the sprites.
  8. *
  9. **********************************************************************
  10.                     This file is part of
  11.  
  12.           STK -- The sprite toolkit -- version 1.0
  13.  
  14.               Copyright (C) Jari Karjala 1990
  15.  
  16. The sprite toolkit (STK) is a FreeWare toolkit for creating high
  17. resolution sprite graphics with PCompatible hardware. This toolkit 
  18. is provided as is without any warranty or such thing. See the file
  19. COPYING for further information.
  20.  
  21. **********************************************************************
  22. **********************************************************************/
  23.  
  24.  
  25. #ifndef __SPR_HIT_H_
  26. #define __SPR_HIT_H_
  27.  
  28. #include "grtypes.h"
  29.  
  30.  
  31. /**********************************************************************
  32. * Check whether the given point is inside the given sprite.
  33. * Return: 0 if no collision, negative otherwise.
  34. **********************************************************************/
  35. int spr_hit_with_point(SPRITE spr, WORD x, WORD y);
  36.  
  37. /**********************************************************************
  38. * Check whether the given sprites collide against each other.
  39. * Return: 0 if no collision, negative otherwise.
  40. **********************************************************************/
  41. int spr_hit(SPRITE spr1, SPRITE spr2);
  42.  
  43. /**********************************************************************
  44. * Find the first sprite colliding the given sprite. Use spr_hit_next 
  45. * to get the next sprites.
  46. * Return: Sprite or NULL if no collision
  47. **********************************************************************/
  48. SPRITE spr_hit_first(SPRITE spr);
  49.  
  50. /**********************************************************************
  51. * Find the next sprite colliding with the given sprite. 
  52. * Return: Sprite or NULL if no collision
  53. **********************************************************************/
  54. SPRITE spr_hit_next(SPRITE spr);
  55.  
  56. #endif
  57.