www.pudn.com > RCApp-src.zip > Status.h


/* 
	RedEye Project (http://members.ozemail.com.au/~ndmcevoy/) 
	Copyright (C) 2003  Nick McEvoy 
 
	This library is free software; you can redistribute it and/or 
	modify it under the terms of the GNU Library General Public 
	License as published by the Free Software Foundation; either 
	version 2 of the License, or (at your option) any later version. 
 
	This library is distributed in the hope that it will be useful, 
	but WITHOUT ANY WARRANTY; without even the implied warranty of 
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
	Library General Public License for more details. 
 
	You should have received a copy of the GNU Library General Public 
	License along with this library; if not, write to the Free 
	Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
 
	----------------------------------------------------------------- 
 
		Commented for use with Doxygen (http://www.doxygen.org) 
 
	----------------------------------------------------------------- 
*/ 
 
/*! \file Status.h 
 *	\brief Game status. 
 * 
 *		This file contains the game status. 
 */ 
 
#ifndef _RE_GAME_STATUS_H_ 
#define _RE_GAME_STATUS_H_ 
 
// PLIB includes 
#include  
#include  
 
class reGameStatus 
{ 
public: 
	//! Get instance 
	static reGameStatus* GetInstance(); 
 
	//! Draw status 
	void Display(); 
 
	//! Set all status text off 
	void SetStatusOff(); 
 
	void SetPlayerText(const char* sText, bool bOn); 
	void SetStatusText(const char* sText, bool bOn); 
	void SetDebugText(const char* sText, bool bOn); 
 
	//! Set status on/off 
	void SetHelpTextOn(bool bOn) {mbHelpTextOn = bOn;}; 
	void SetStartTextOn(bool bOn) {mbStartTextOn = bOn;}; 
	void SetLoadingTextOn(bool bOn) {mbLoadingTextOn = bOn;}; 
	void SetPauseTextOn(bool bOn) {mbPauseTextOn = bOn;}; 
	void SetPlayerTextOn(bool bOn) {mbPlayerTextOn = bOn;}; 
	void SetStatusTextOn(bool bOn) {mbStatusTextOn = bOn;}; 
	void SetDebugTextOn(bool bOn) {mbDebugTextOn = bOn;}; 
 
	bool IsHelpTextOn() {return mbHelpTextOn;}; 
	bool IsStartTextOn() {return mbStartTextOn;}; 
	bool IsLoadingTextOn() {return mbLoadingTextOn;}; 
	bool IsPauseTextOn() {return mbPauseTextOn;}; 
	bool IsPlayerTextOn() {return mbPlayerTextOn;}; 
	bool IsStatusTextOn() {return mbStatusTextOn;}; 
	bool IsDebugTextOn() {return mbDebugTextOn;}; 
 
	//! Destructor 
	~reGameStatus(); 
 
protected: 
	//! Constructor is protected as this class is a singleton 
	reGameStatus(); 
 
private: 
	void DrawText(const char* sText, int iSize, int x, int y); 
	void DrawInverseDropShadowText(const char* sText, int iSize, int x, int y); 
	void DrawDropShadowText(const char* sText, int iSize, int x, int y); 
	void DrawPlainText(const char* sText, int iSize, int x, int y); 
 
	fntRenderer mText; 
	fntTexFont mTexFont; 
 
	char msPlayerText[512]; 
	char msStatusText[512]; 
	char msDebugText[512]; 
 
	bool mbHelpTextOn; 
	bool mbStartTextOn; 
	bool mbLoadingTextOn; 
	bool mbPauseTextOn; 
	bool mbPlayerTextOn; 
	bool mbStatusTextOn; 
	bool mbDebugTextOn; 
 
	//! The one and only instance 
	static reGameStatus* mpInstance; 
}; 
 
//! Get the one and only instance 
inline reGameStatus* reGetGameStatus() {return reGameStatus::GetInstance();}; 
 
#endif // _RE_GAME_STATUS_H_