#ifndef CONFIG_HPP_
#define CONFIG_HPP_


/**
 * @file
 * Defines for configuring behaviour, features, and tweaks.
 *
 * Not shown: NDEBUG, TRACE_ALL, DEPTH_MAP, NO_CLIP
 */


constexpr float raster_per_second = 5.0F; ///< movement speed
constexpr unsigned max_fps = 100; ///< minimum delay between frames
constexpr unsigned min_fps = 5; ///< maximum delay between frames


namespace level_config {
    constexpr float camera_z = 20.0F; ///< camera z-distance, determines DOV
    constexpr float viewport_z = 1.5F; ///< viewport raster z-distance, determines FOV

    constexpr int level_dim[] = {5, 14, 40};
    constexpr int level_max[] = {level_dim[2] * 2, level_dim[2] * 2};
    constexpr float raster_base = 100.0F;
};


/** @brief Enable SIMD optimizations on main @ref vertex_t.
 *
 * 0: do not force SIMD, sticking with 3D float struct
 * 1: use aligned 4-component vector and basic compiler-native operators on it
 * 2: allow explicit use of basic gcc __builtin_ia32_*
 * 3: use explicit gcc builtins for more complex implementations
 * 4: use explicit gcc builtins for 3D comparison operators
 * 5: use explicit gcc builtins also for 2D comparison operators
 */
#define USE_SIMD 5


/** @brief Per-frame timing statistics logging verboseness. */
#define USE_LOG_STATS 0

/** @brief Overlap frames by premature enqueuing with < 1.0F, for when >> 4 threads are supported. */
#define SQUEEZE_FACTOR 1.0F


/** @brief Game mode: Explore with full light, pickup/drop lights, grow player light when doing so.*/
#define USE_LIGHT_PICKUP 2

/** @brief Generate light sources in levels. */
#define USE_LIGHTS 1

/** @brief Try to optimize light volume boxes by cutting down scene overlaps. */
#define USE_LIGHTBOX 2


/** @brief Enable bilinear interpolation when subsampling, nearest neighbour otherwise. */
#define USE_UPSAMPLE 1

/** @brief Uniform, colored, or perlin noise textures, respectively. */
#define USE_TEXTURE 2

/** @brief Enable polynomial noise interpolation, avoiding blocky artifacts. */
#define USE_PERLIN_INTERPOLATE 1

/** @brief Saturation, 1.0 for full color texture. */
#define USE_TEXTURE_SATURATION 0.5F

/** @brief Blend textures between levels. */
#define USE_TEXTURE_GRADIENT 1


#ifndef USE_X
/** @brief Enable X image output and key input, disable for 'headless' benchmarking. */
#define USE_X 1
#endif

#if !USE_X
/** @brief If X is disabled, write frames as PPM images for debugging instead. */
#define USE_PPM 0
#endif

/** @brief Enable X11 SHM extension for frame image, avoiding copy. */
#define USE_X_SHM 1

/** @brief Use WASD instead of arrow keys for movement. */
#define USE_WASD 0


#endif // CONFIG_HPP_