/*****************************************************************************
 * $LastChangedDate: 2011-04-23 21:07:07 -0400 (Sat, 23 Apr 2011) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Module configuration.
 *//*
 * LEGAL:   COPYRIGHT (C) 2008 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#ifndef SKY_CONF_HH
#define SKY_CONF_HH 1

#define SKY_CONF sky::GET_CONF()

#include <fstream>
#include "base/conf_txt.hh"
#include "gfx/rgba.hh"
using namespace gfx;
#include "physics/module.hh"
using namespace physics;

namespace sky {

////////////////////////////////////////////////////////////////////////////////
/// @brief Module configuration.
///
class Conf
{
public:
    struct CloudConf
    {
        CloudConf( void )
        : mCloudCount(0), mCloudMinAlt(0), mCloudMaxAlt(0),
          mCloudMinWidth(0), mCloudMaxWidth(0) { }
        uint    mCloudCount;        ///< amount of clouds
        Meter   mCloudMinAlt;       ///< random range
        Meter   mCloudMaxAlt;
        Meter   mCloudMinWidth;     ///< random range
        Meter   mCloudMaxWidth;
    };

#define CONF_TXT_EXTRA_PROCESS_FIELD_PROTOTYPES void ProcessField( string& field, std::ifstream& conf, CloudConf& cloudConf );
#include "base/conf_template_txt.hh"
#undef  CONF_TXT_EXTRA_PROCESS_FIELD_PROTOTYPES

public:
    // Cmd-line args:
    bool            mSkyEnabled;
    bool            mUseOssim;          ///< WORLD_CONF isn't available to SKY_CONF

    // .conf:
    RGBA            mSkyColor;
    fpx             mSkyFogDensity;     ///< fpx, sky needs lower fog density
    uint            mSkyDomeSliceCount;
    bool            mEnableMoon;
    uint            mStarCount;         ///< amount of stars
    bool            mCloudsEnabled;
    CloudConf       mCloudConfFlat;
    CloudConf       mCloudConfSphere;
    uint            mWeatherRainChance;
    uint            mWeatherSnowChance;
};
#include "base/conf_template_end.hh"

} // namespace sky

#endif // SKY_CONF_HH
