home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 12 / CD_ASCQ_12_0294.iso / vrac / pov_mp21.zip / NTCONF.H < prev    next >
C/C++ Source or Header  |  1993-12-14  |  8KB  |  167 lines

  1. /****************************************************************************
  2. *                ntconf.h
  3. *                  based on vaxconf.h
  4. *
  5. *  This header file contains all constants and types required to run under
  6. *  Under Windows NT
  7. *
  8. *  from Persistence of Vision Raytracer
  9. *  Copyright 1993 Persistence of Vision Team
  10. *   MODIFIED by Gilles Vollant (email : 100144,2636@compuserve.com)
  11. *---------------------------------------------------------------------------
  12. *  NOTICE: This source code file is provided so that users may experiment
  13. *  with enhancements to POV-Ray and to port the software to platforms other
  14. *  than those supported by the POV-Ray Team.  There are strict rules under
  15. *  which you are permitted to use this file.  The rules are in the file
  16. *  named POVLEGAL.DOC which should be distributed with this file. If
  17. *  POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  18. *  Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  19. *  Forum.  The latest version of POV-Ray may be found there as well.
  20. *
  21. * This program is based on the popular DKB raytracer version 2.12.
  22. * DKBTrace was originally written by David K. Buck.
  23. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  24. *
  25. *****************************************************************************/
  26.  
  27. /* Below are several defines needed by the generic parts of POV.  You
  28. *   may redefine them as needed in this config.h file.
  29. *
  30. *   The following constants are needed by various POV modules.  Each has
  31. *   a default (shown below) which is will be defined in frame.h if you don't
  32. *   define them here.
  33. *
  34. *   #define EPSILON 1.0e-10               - a small value used for POLY
  35. *   #define FILE_NAME_LENGTH 150          - default file name length
  36. *   #define HUGE_VAL 1.0e+17              - a really big number
  37. *   #define DBL_FORMAT_STRING "%lf"       - the string to use for scanfs of doubles
  38. *   #define DEFAULT_OUTPUT_FORMAT  'd'    - the default +f format
  39. *   #define RED_RAW_FILE_EXTENSION ".red" - for +fr, this is the extension for the
  40. *                                           red file
  41. *   #define GREEN_RAW_FILE_EXTENSION ".grn"  - ditto for the green file
  42. *   #define BLUE_RAW_FILE_EXTENSION ".blu"   - ditto again for the blue file
  43. *   #define FILENAME_SEPARATOR "/"        - the character that separates names
  44. *                                           in a path.
  45. *   #define CASE_SENSITIVE_DEFAULT 2     - controls case sensitivity in DAT files
  46. *   #define READ_FILE_STRING "rb"        - special binary (raw, uncooked)
  47. *   #define WRITE_FILE_STRING "wb"         modes of fopen()
  48. *   #define APPEND_FILE_STRING "ab"
  49. *   #define NORMAL '0'                   - machine-specific PaletteOption settings
  50. *   #define GREY   'G'
  51. *
  52. *   These routines are required by POV to compute trace times.  The defaults
  53. *   shown below are defined in most versions of C.  You may redefine them if
  54. *   your compiler doesn't support these.  If time is completely unsupported
  55. *   define them as 0.
  56. *
  57. *   #define START_TIME time(&tstart);
  58. *   #define STOP_TIME  time(&tstop);
  59. *   #define TIME_ELAPSED difftime (tstop, tstart);
  60. *
  61. *   Note difftime can be replaced with: #define TIME_ELAPSED (tstop - tstart);
  62. *   in some cases.
  63. *
  64. *   These are optional routines that POV calls.  You may define them
  65. *   or if undefined they will be defined as empty in frame.h.
  66. *
  67. *   #define STARTUP_POVRAY             - first executable statement of main
  68. *                                           (useful for initialization)
  69. *   #define PRINT_OTHER_CREDITS           - used for people who extend the machine specific modules
  70. *                                           (put your own printf's here)
  71. *   #define TEST_ABORT                    - code to test for ^C or abort
  72. *                                           (called on each pixel)
  73. *   #define FINISH_POVRAY              - last statement before exiting normally
  74. *   #define COOPERATE                    - called for multi-tasking
  75. *
  76. *   These items are standard on some C compilers.  If they are not defined
  77. *   on your compiler or are called something different you may define your
  78. *   own or use the defaults supplied in frame.h as shown below.
  79. *
  80. *   #define DBL double                    - floating point precision
  81. *   #define ACOS acos                     - arc cosine of DBL
  82. *   #define SQRT sqrt                     - square root of DBL
  83. *   #define POW pow                       - x to the y power - x, y DBL
  84. *   #define COS cos                       - cosine of DBL
  85. *   #define SIN sin                       - sine of DBL
  86. *   #define labs(x) (long) ((x<0)?-x:x)   - Returns the absolute value of long integer x
  87. *   #define max (x,y) ((x<y)?y:x)         - greater of x and y
  88. *
  89. *   On some systems "sprintf" returns the string rather than the length
  90. *   of the string.  If the string is returned, define the following:
  91. *   #define STRLN(x) strlen(x)
  92. *
  93. *   #define setvbuf(w,x,y,z)              - some systems don't understand setvbuf.
  94. *                                           If not, just define it away - it's
  95. *                                           not critical to the raytracer.  It
  96. *                                           just buffers disk accesses.
  97. *   This macro controls prototyping and is required by POV.  Choose one
  98. *   of the two options below or if left undefined it will default to ANSI
  99. *   in frame.h
  100. *
  101. *   #define PARAMS (x) x                  - do ANSI prototyping
  102. *   #define PARAMS (x) ()                 - do K&R non-ANSI prototyping
  103. *
  104. *   These allow command line vs non-command line versions and alternate
  105. *   main routines.  Normally they should be undefined.  Define them 1 if needed.
  106. *   #define ALTMAIN 1
  107. *   #define NOCMDLINE 1
  108. ****************************************************/
  109.  
  110. #include <conio.h>
  111. #include <stdarg.h>
  112. #include <stdlib.h>
  113.  
  114. #ifdef _STDC_
  115. #define PARAMS(x) x
  116. #else
  117. #define PARAMS(x) ()
  118. #define volatile
  119. #endif
  120.  
  121. #define EPSILON 1.0e-5
  122.  
  123. /* Need prototypes for these standard routines */
  124. char *getenv PARAMS((char *name));
  125. //char *malloc PARAMS((int size));
  126. //void free PARAMS((void *));
  127.  
  128. #define RED_RAW_FILE_EXTENSION   ".r8"  /* PICLAB's "RAW" file format */
  129. #define GREEN_RAW_FILE_EXTENSION ".g8"  /* PICLAB's "RAW" file format */
  130. #define BLUE_RAW_FILE_EXTENSION  ".b8"  /* PICLAB's "RAW" file format */
  131.  
  132. #define MAIN_TYPE                 int
  133. #define FILENAME_SEPARATOR        "\\"         /* weird 'ol NT's like backslashes */
  134. #define DEFAULT_OUTPUT_FORMAT     't'
  135.  
  136. #define MAIN_RETURN_TYPE          int
  137. #define FINISH_POVRAY             return (0) ;
  138.  
  139. #define TEST_ABORT if (Options & EXITENABLE) if (kbhit()) { Stop_Flag = TRUE; getch(); }
  140.  
  141. /* defines for machine-specific PaletteOption settings */
  142. #define NORMAL  '0'
  143. #define GREY    'G'
  144. #define HSV     '0'
  145. #define P_332   '3'
  146. #define HICOLOR 'H'             /* 16 bits/pixel "high" color */
  147. #define FULLCOLOR 'T'           /* 24 bits/pixel "true" color */
  148.  
  149. #ifndef READ_ENV_VAR_BEFORE 
  150. #define READ_ENV_VAR_BEFORE if ((Option_String_Ptr = getenv("POVRAYOPT")) != NULL) read_options(Option_String_Ptr);
  151. #endif
  152. #ifndef READ_ENV_VAR_AFTER
  153. #define READ_ENV_VAR_AFTER     
  154. #endif
  155.  
  156. #define COMPILER_VER ".ntmsc"
  157.  
  158.  
  159. #define WAIT_FOR_KEYPRESS getch();
  160.  
  161. /* I have make POV for Intel. If you build on Alpha, try with and without 
  162.    the line #pragma message disable IMPLICITFUNC  */
  163. #ifdef ALPHA
  164. #pragma message disable IMPLICITFUNC
  165. #endif
  166.  
  167.