/*****************************************************************************
 * $LastChangedDate: 2010-02-03 19:48:51 -0500 (Wed, 03 Feb 2010) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Cloud particle system.
 *//*
 * 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_CLOUDS_HH
#define SKY_CLOUDS_HH 1

#include "fx/module.hh"
#include "fx/partsys_big.hh"
using namespace fx;

namespace sky {

class SkyDome;
class CloudPreDrawViewListener;

////////////////////////////////////////////////////////////////////////////////
/// @brief An individual cloud.
///
class CloudParticle : public BigParticle
{
PREVENT_COPYING(CloudParticle)
public:
                    CloudParticle( const Sprite::Args& spriteArgs );
    virtual         ~CloudParticle();
    virtual void    Tick( const Milliseconds millisecElapsed ) { }  // NOP
};

////////////////////////////////////////////////////////////////////////////////
/// @brief Cloud particle system.
///
/// Currently, clouds are rendered by randomly picking
/// a pre-loaded (artist-drawn) texture image.
/// Procedural-texture functions aren't implemented in this version.
///
class CloudParticleSystem : public BigParticleSystem
{
PREVENT_COPYING(CloudParticleSystem)
friend class CloudPreDrawViewListener;
public:
            CloudParticleSystem( SkyDome& skyDome, const BoxVolume& skyVolume,
                                 const uint cloudCountDivisor, const string& textureName );
            ~CloudParticleSystem();
private:
    void    MakeClouds( SkyDome& skyDome, const BoxVolume& skyVolume,
                        const uint cloudCountDivisor );
    void    PreDraw( shptr<View> view );

private:
    shptr<CloudPreDrawViewListener>     mPreDrawViewListener;   ///< to rotate clouds according to view
    Degree                              mRollDeg;               ///< degree of roll of all Sprites
};

} // namespace sky

#endif // SKY_CLOUDS_HH
