home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 28 / amigaformatcd28.iso / -websites- / amidoom / adoom_src-0.7.lha / ADoom_src / m_fixed.h < prev    next >
C/C++ Source or Header  |  1998-01-09  |  2KB  |  57 lines

  1. // Emacs style mode select   -*- C++ -*- 
  2. //-----------------------------------------------------------------------------
  3. //
  4. // $Id:$
  5. //
  6. // Copyright (C) 1993-1996 by id Software, Inc.
  7. //
  8. // This source is available for distribution and/or modification
  9. // only under the terms of the DOOM Source Code License as
  10. // published by id Software. All rights reserved.
  11. //
  12. // The source is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
  15. // for more details.
  16. //
  17. // DESCRIPTION:
  18. //    Fixed point arithemtics, implementation.
  19. //
  20. //-----------------------------------------------------------------------------
  21.  
  22.  
  23. #ifndef __M_FIXED__
  24. #define __M_FIXED__
  25.  
  26.  
  27. #ifdef __GNUG__
  28. #pragma interface
  29. #endif
  30.  
  31.  
  32. //
  33. // Fixed point, 32bit as 16.16.
  34. //
  35. #define FRACBITS        16
  36. #define FRACUNIT        (1<<FRACBITS)
  37.  
  38. typedef int fixed_t;
  39.  
  40. extern fixed_t (*FixedMul)    (fixed_t a, fixed_t b);
  41. extern fixed_t (*FixedDiv)    (fixed_t a, fixed_t b);
  42. void SetFPMode (void);
  43. fixed_t FixedMul_040    (fixed_t a, fixed_t b);
  44. fixed_t FixedMul_060fpu    (fixed_t a, fixed_t b);
  45. fixed_t FixedMul_060    (fixed_t a, fixed_t b);
  46. fixed_t FixedDiv_040    (fixed_t a, fixed_t b);
  47. fixed_t FixedDiv_060fpu    (fixed_t a, fixed_t b);
  48. /* fixed_t FixedDiv2    (fixed_t a, fixed_t b); */
  49.  
  50.  
  51. #endif
  52. //-----------------------------------------------------------------------------
  53. //
  54. // $Log:$
  55. //
  56. //-----------------------------------------------------------------------------
  57.