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

#ifndef PROGRAM_SPLASH_HH
#define PROGRAM_SPLASH_HH 1

#include "base/singleton.hh"
using namespace base;
#include "hud/module.hh"
using namespace hud;

namespace program {

#define GET_PROGRAM_SPLASH() (program::ProgramSplash::GetInstance())

////////////////////////////////////////////////////////////////////////////////
/// @brief Splash graphical text.  To activate, call Start().
///
class ProgramSplash
{
PREVENT_COPYING(ProgramSplash)
private:
    ProgramSplash( void );
    ~ProgramSplash();

public:
                    DEFINE_GetInstance( ProgramSplash )  // Singleton
    void            Start( void );

private:
    shptr<HudText>  CtorHudTextSplash( void );
    void            Update( const Milliseconds millisecElapsed );

private:
    /// @brief Timer-tick.
    ///
    CLASS_TICK_FUNCTOR_BASIC

private:
    // Each HudText represents a line of text.
    CLASS_VAR ProgramSplash*    msInstance;
    hud::Hud&                   mHud;
    shptr<HudText>              mHudTextSplash;
    shptr<TickFunctor>          mTickFunctor;
    const Milliseconds          mFadeMilliseconds;  ///< when fading begins
    const Milliseconds          mEndMilliseconds;   ///< when splash ends
};

} // namespace program

#endif // PROGRAM_SPLASH_HH
