home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / GRAPHICS / povosk.lzh / oskconf.h < prev    next >
Text File  |  1993-01-31  |  6KB  |  150 lines

  1. /*****************************************************************************
  2. *
  3. *               oskconf.h
  4. *
  5. *  This header file contains all constants and types required to run on an
  6. *  OSK (OS9/68000) system.
  7. *
  8. *  from Persistence of Vision Raytracer 
  9. *  Copyright 1991 Persistence of Vision Team
  10. *---------------------------------------------------------------------------
  11. *                       *IMPORTANT!*
  12. *  This copyrighted software is freely distributable. The source and/or
  13. * object code may be copied or uploaded to communications services so long as
  14. * this notice remains at the top of each file.
  15. *  If any changes are made to the program, you must clearly indicate in the
  16. * documentation and in the program startup message who it was who made the
  17. * changes. The documentation should also describe what those changes were.
  18. *  This software may not be included in whole or in part into any commercial
  19. * package without the express written consent of the PV-Team. It may,
  20. * however, be included in other freely distributed software so long as proper
  21. * credit for the software is given. No more than five dollars U.S. ($5) can
  22. * be charged for the copying of this software and the media it is provided on,
  23. * i.e. a shareware distribution company may only charge five U.S dollars or
  24. * less for providing this software.
  25. *  This software is provided as is without any guarantees or warranty.
  26. * Although the authors have attempted to find and correct any bugs in the
  27. * software, they are not responsible for any damage caused by the use of the
  28. * software. The authors are under no obligation to provide service,
  29. * corrections, or upgrades to this package.
  30. *-----------------------------------------------------------------------------
  31. *  Despite all the legal stuff above, if you have any problems with the
  32. * program the PV-Team would like to hear about them. Also, if you have any
  33. * comments, questions or enhancements, please contact the PV-Team on the
  34. * Compuserve Online Service in the COMART forum message section 16 (!GO
  35. * COMART). The CIS COMART forum is devoted to computer generated artwork like
  36. * raytracing, animation and fractals. For more information regarding the PV
  37. * team see the file PVINF.TXT. For more information on Compuserve call
  38. * (in the U.S.) 1-800-848-8990.
  39. *       Drew Wells
  40. *       PV-Team Leader
  41. *       CIS: 73767,1244
  42. *  This program is based on the popular DKB raytracer version 2.12 written by
  43. * David Buck, a PV-Team member.
  44. *  (David Buck CIS: 70521,1371 Internet: dbuck@ccs.carleton.ca)
  45. *****************************************************************************/
  46.  
  47. /* The following defines may be added when porting to other systems or
  48.    other compilers.  The defaults are shown here:
  49.  
  50. #define PARAMS(x) x                   - use 'x' for ANSI, '()' for non ANSI
  51. #define EPSILON 1.0e-5                - a small value used for quartics
  52. #define FILE_NAME_LENGTH 150          - default file name length
  53. #define DBL double                    - floating point precision
  54. #define HUGE_VAL 1.0e+17              - a really big number
  55. #define MAXPOW 32                     - Highest power polynomial allowed
  56. #define DBL_FORMAT_STRING "%lf"       - the string to use for scanfs of doubles
  57. #define DEFAULT_OUTPUT_FORMAT  'd'    - the default +f format
  58. #define TEST_ABORT                    - code to test for ^C or abort
  59.                                         (called on each pixel)
  60. #define RED_RAW_FILE_EXTENSION ".red" - for +fr, this is the extension for the
  61.                                         red file
  62. #define GREEN_RAW_FILE_EXTENSION ".grn"  - ditto for the green file
  63. #define BLUE_RAW_FILE_EXTENSION ".blu"   - ditto again for the blue file
  64. #define STARTUP_PVRAY                 - first executable statement of main
  65.                                         (useful for initialization)
  66. #define PRINT_OTHER_CREDITS           - used for people who extend the machine
  67.                                         specific modules 
  68.                                         (put your own printf's here)
  69. #define FINISH_PVRAY                  - last statement before exiting normally
  70. #define FILENAME_SEPARATOR "/"        - the character that separates names
  71.                                         in a path.
  72. #define setvbuf(w,x,y,z)              - some systems don't understand setvbuf.
  73.                                         If not, just define it away - it's
  74.                                         not critical to the raytracer.  It
  75.                                         just buffers disk accesses.
  76. */
  77.  
  78. /* By default, OSK doesn't use ANSI prototyping */
  79.  
  80. #ifdef _STDC_
  81. #define PARAMS(x) x
  82. #else
  83. #define PARAMS(x) ()
  84. #define volatile
  85. #endif
  86.  
  87. #define ACOS    acos
  88. #define ASIN    asin
  89. #define COS     cos
  90. #define SIN     sin
  91. #define SQRT    sqrt
  92. #define POW     pow
  93. /*
  94. #define stricmp strucmp
  95. */
  96. #define labs    abs
  97. #define EPSILON 1.0e-5
  98.  
  99. /* The following define takes care of a multiple case error
  100.  * in tokenize.c.  '\n' is the same as '\r' on OSK boxes.
  101.  */
  102.  
  103. #define CR_SAME_AS_R
  104.  
  105. char *getenv PARAMS((char *name));
  106. char *malloc PARAMS((int size));
  107. void free PARAMS((void *));
  108.  
  109. #define STARTUP_PVRAY osk_init_pvray();
  110. #ifndef max
  111. #define max(x,y) ((x<y)?y:x)
  112. #endif
  113.  
  114. /* defines for special binary (raw, uncooked) modes of fopen() */
  115. #define READ_FILE_STRING   "r"
  116. #define WRITE_FILE_STRING  "w"
  117. #define APPEND_FILE_STRING "a"
  118.  
  119. /* defines for machine-specific PaletteOption settings */
  120. /* These don't really apply, for there are no OSK display routines! */
  121. #define NORMAL '0'
  122. #define GREY   'G'
  123.  
  124. /* Trace Timer Macro */
  125. #define START_TIME time(&tstart);     /* Defined for most "flavors" of C */
  126. #define STOP_TIME  time(&tstop);
  127. #define TIME_ELAPSED difftime(tstop, tstart);
  128.  
  129. /* difftime not supported by all versions */
  130. /* of C. Can be replaced with:            */ 
  131. /* #define TIME_ELAPSED (tstop - tstart); */
  132. /* in some cases. If time is completely   */
  133. /* unsupported define them all as 0.      */
  134.  
  135. double fmod PARAMS((double x, double y));
  136. char *getenv PARAMS((char *name));
  137. char *malloc PARAMS((int size));
  138. void free PARAMS((void *));
  139.  
  140. #define setvbuf(a,b,c,d)
  141.  
  142. #define WORD _WORD_
  143.