/*****************************************************************************
 * $Id: game_pony_listeners.cc,v 1.13 2006/07/23 02:26:44 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 GAME_PONY_LISTENERS_CC 1
#include "game_pony_common.hh"
#include "game_pony_listeners.hh"
#include "game_pony_gui.hh"

// Other listeners are in the GUI.

/*****************************************************************************
 * Start/stop listeners.
 *****************************************************************************/
void
GamePony::StartStopListeners( bool start )
{
	gEngineEvent.mEngineReady.Listen(    Listener_GamePony_EngineReady,    start );
	gEngineEvent.mResetScene.Listen(     Listener_GamePony_ResetScene,     start );
	gEngineEvent.mPreDrawViews.Listen(   Listener_GamePony_PreDrawViews,   start );
	gEngineEvent.mLodUserChanged.Listen( Listener_GamePony_LodUserChanged, start );
	gGameBaseEvent.mPrintStats.Listen(   Listener_GamePony_PrintStats,     start );
}

/*****************************************************************************
 * Listeners.
 * @note The order of calling listeners is undefined.
 *****************************************************************************/
void
Listener_GamePony_EngineReady( void )
{
}
void
Listener_GamePony_ResetScene( void )
{
	gGame.ResetScene();
}
void
Listener_GamePony_PreDrawViews( void )
{
#if STATS
	gGame.mStats.PreDrawViews();
#endif
}
void
Listener_GamePony_LodUserChanged( void )
{
	gWorld.LodUserChanged();
}
void
Listener_GamePony_PrintStats( void )
{
	// There's a counterpart at game base.
	GAME_STATS_CODE( *gStreamStats << gGame.mStats; )
}
