/* * CS5600 University of Utah * Charles McGarvey * mcgarvey@eng.utah.edu */ #ifndef _CONFIG_H_ #define _CONFIG_H_ /* * DOUBLE_FLOAT * If enabled, scalars will be of type double. This provides and insane level * of precision at a performance cost. The default behavior just uses floats. */ #if DOUBLE_FLOAT #define IF_DOUBLE_FLOAT(X) X #else #define IF_DOUBLE_FLOAT(X) #endif /* * EXPORT_BMP * If enabled, each scene rasterization will be saved as a BMP image file. * This is on unless explicitly disabled. */ #ifndef EXPORT_BMP #define EXPORT_BMP 1 #endif #if EXPORT_BMP #define IF_EXPORT_BMP(X) X #else #define IF_EXPORT_BMP(X) #endif /* * EXPORT_PPM * If enabled, each scene rasterization will be saved as a PPM image file. * This is on unless explicitly disabled. */ #ifndef EXPORT_PPM #define EXPORT_PPM 1 #endif #if EXPORT_PPM #define IF_EXPORT_PPM(X) X #else #define IF_EXPORT_PPM(X) #endif /* * EXTRA_INLINE * If enabled, functions that are defined in interface files will be marked as * inline. The compiler will generally inline functions according to its own * optimization heuristics, and this inline marking may persuade the compiler * to inline a function that it otherwise would not. This option may bring a * small performance boost, but it can also increase the size of the program * executable. */ #if EXTRA_INLINE #define IF_EXTRA_INLINE(X) X #else #define IF_EXTRA_INLINE(X) #endif /* * NDEBUG * If enabled, assertions and other nonessential checks will not be compiled * into the programs. */ #if NDEBUG #define IF_NDEBUG(X) X #else #define IF_NDEBUG(X) #endif /* * SHADOWS * If enabled, scene elements will cast shadows on other elements. */ #if SHADOWS #define IF_SHADOWS(X) X #else #define IF_SHADOWS(X) #endif /* * TEXTURING * If enabled, the first element of a scene will be textured with the * raster from texture.ppm or texture.bmp. */ #if TEXTURING #define IF_TEXTURING(X) X #else #define IF_TEXTURING(X) #endif /* * QUIRKS * If enabled, compatibility quirks particular to the project assignment * will be turned on, causing the output to match more closely with the * provided examples. */ #if QUIRKS #define IF_QUIRKS(X) X #else #define IF_QUIRKS(X) #endif /* * VERBOSITY * If enabled, a description of what is happening will be printed to stdout. * Otherwise, nothing is printed. The behavior of this option is effected by * its precise value: * 1 Print just a few very general descriptions. * 2 After rasterization, also print the triangle count and other * information that may be interesting. * 3 Also print the number of seconds it took to render the entire scene, * according to wall time. * 4 Also print the number of triangles as they are being rastered. This * uses ANSI escape codes which may not be supported on all terminals. * It also causes a lot to be printed, so it can actually decrease render * performance, especially on a slow (or remote) terminal. * The default setting for this option is 3. */ #ifndef VERBOSITY #define VERBOSITY 3 #endif #if VERBOSITY >= 2 #define IF_RASTER_STATS(X) X #else #define IF_RASTER_STATS(X) #endif #if VERBOSITY >= 3 #define IF_RENDER_TIMER(X) X #else #define IF_RENDER_TIMER(X) #endif #if VERBOSITY >= 4 #define IF_RENDER_PROGRESS(X) X #else #define IF_RENDER_PROGRESS(X) #endif #endif // _CONFIG_H_