/*****************************************************************************
 * $Id: mod_pony_view.hh,v 1.1 2006/11/24 21:56:58 devel Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	Module Pony View classes.
 *//*
 * LEGAL:	COPYRIGHT (C) 2004 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE (GPL).
 *****************************************************************************/

#if COMPILING_MODULE_PONY
#ifndef MOD_PONY_VIEW_HH
#define MOD_PONY_VIEW_HH 1

////////////////////////////////////////////////////////////////////////////////
/// @brief Primary view.
class ViewModulePony : public View
{
private:
	PREVENT_COPYING(ViewModulePony)
	typedef View Parent;

public:
	explicit	ViewModulePony( ViewMaster& master );
	void		Reset( void ) { }
	void		Reshape( int w, int h ) { }

	/// Enable/disable texturing in this view.
	/// Whether an object is actually textured depends on LOD.
	/// Engine::mTexturing or -no-texturing may override this.
	void SetTexturing( bool f )
	{
		mTexturing = f;
	}

	/// @return True if texturing is enabled in this view.
	/// Whether an object is actually textured also depends on LOD.
	/// Even then an class Draw() method might not texture the object depending on its distance.
	bool IfTexturing( void )
	{
#if 1
		// With advent of clouds and removal of simple tree models,
		// texturing has become necessary at any LOD.
		return true;
#else
		// Don't do texturing if user-selected LOD is too low or altitude is too high.
		return    mTexturing
			   && ! gEng.mEye.IfAboveAltitude( MAX_ALTITUDE_DETAIL )
			   && gEng.IfAtLeastLod( LOD_TEXTURE_LEAST );
#endif
	}

private:
	bool		mTexturing;
};

////////////////////////////////////////////////////////////////////////////////
/// @brief Radar view class.
class ViewRadar : public View
{
private:
	PREVENT_COPYING(ViewRadar)
	typedef View Parent;

public:
	enum eRadar { eRadar_HORIZON, eRadar_OVERHEAD };

					ViewRadar( ViewMaster& master, eRadar radar );
	virtual			~ViewRadar() { }
	void			Draw( void );
	void			Reset( void ) { }
	void			Reshape( int w, int h );
	bool			IfTexturing( void ) { return false; }
	void			SetTexturing( bool f ) { }

	eRadar			mRadar;
};

#endif // MOD_PONY_VIEW_HH
#endif // COMPILING_MODULE_PONY
