/*****************************************************************************
 * $Id: mod_pony_listeners.cc,v 1.3 2006/11/25 22:34:36 devel Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	Event listeners.
 *//*
 * LEGAL:	COPYRIGHT (C) 2004 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE (GPL).
 *****************************************************************************/

#define MOD_PONY_LISTENERS_CC 1
#include "mod_pony_common.hh"
#include "mod_pony_event.hh"
#include "mod_pony_listeners.hh"
#include "mod_pony_gui.hh"

// Other listeners are in the GUI.

/*****************************************************************************
 * Start/stop listeners.
 *****************************************************************************/
void
ModulePony::StartStopListeners( bool start )
{
	gEngineEvent.mEngineReady.Listen(    Listener_ModulePony_EngineReady,    start );
	gEngineEvent.mResetScene.Listen(     Listener_ModulePony_ResetScene,     start );
	gEngineEvent.mPreDrawViews.Listen(   Listener_ModulePony_PreDrawViews,   start );
	gEngineEvent.mLodUserChange.Listen(  Listener_ModulePony_LodUserChange,  start );
	gModuleBaseEvent.mPrintStats.Listen( Listener_ModulePony_PrintStats,     start );
	gEngineEvent.mTextureFilter.Listen(  Listener_ModulePony_TextureFilter_Cloud, start ); // mod_pony_cloud.cc
	gModulePonyEvent.mWeather.Listen(    Listener_CumulusCloud_Weather,      start );
}

/*****************************************************************************
 * Listeners.
 * @note The order of calling listeners is undefined.
 *****************************************************************************/
void
Listener_ModulePony_EngineReady( void )
{
}
void
Listener_ModulePony_ResetScene( void )
{
	gModule.ResetScene();
}
void
Listener_ModulePony_PreDrawViews( void )
{
#if STATS
	gModule.mStats.PreDrawViews();
#endif
}
void
Listener_ModulePony_LodUserChange( void )
{
	gWorld.LodUserChange();
}
void
Listener_ModulePony_PrintStats( void )
{
	// There's a counterpart at module base.
	MODULE_STATS_CODE( *gStreamStats << gModule.mStats; )
}
