00001
00002
00003
#ifndef SCREEN_H
00004
#define SCREEN_H
00005
00006
#include "ActorFrame.h"
00007
#include "ScreenMessage.h"
00008
#include "InputFilter.h"
00009
#include "GameInput.h"
00010
#include "MenuInput.h"
00011
#include "StyleInput.h"
00012
#include "ScreenManager.h"
00013
00014
00015 #define REGISTER_SCREEN_CLASS( className ) \
00016
Screen* Create##className( const CString &sName ) { Screen *pRet = new className( sName ); pRet->Init(); return pRet; } \
00017
class Register##className { \
00018
public: \
00019
Register##className() { SCREENMAN->Register(#className,Create##className); } \
00020
}; \
00021
static Register##className registera;
00022
00023 class Screen :
public ActorFrame
00024 {
00025
public:
00026
Screen(
CString sName );
00027
virtual ~Screen();
00028
00029
00030
00031 virtual void Init() { }
00032
virtual void Update(
float fDeltaTime );
00033
virtual void Input(
const DeviceInput& DeviceI,
const InputEventType type,
const GameInput &GameI,
const MenuInput &MenuI,
const StyleInput &StyleI );
00034
virtual void HandleScreenMessage(
const ScreenMessage SM );
00035
00036
void PostScreenMessage(
const ScreenMessage SM,
float fDelay );
00037
void ClearMessageQueue();
00038
void ClearMessageQueue(
const ScreenMessage SM );
00039
00040 bool IsTransparent()
const {
return m_bIsTransparent; }
00041 virtual bool UsesBackground()
const {
return true; }
00042
00043
static bool ChangeCoinModeInput(
const DeviceInput& DeviceI,
const InputEventType type,
const GameInput &GameI,
const MenuInput &MenuI,
const StyleInput &StyleI );
00044
static bool JoinInput(
const MenuInput &MenuI );
00045
00046
protected:
00047
00048 struct QueuedScreenMessage {
00049 ScreenMessage SM;
00050 float fDelayRemaining;
00051 };
00052 vector<QueuedScreenMessage>
m_QueuedMessages;
00053
static bool SortMessagesByDelayRemaining(
const QueuedScreenMessage &m1,
const QueuedScreenMessage &m2);
00054
00055 bool m_bIsTransparent;
00056
00057
public:
00058
00059
00060 virtual void MenuUp( PlayerNumber pn,
const InputEventType type ) {
if(type==
IET_FIRST_PRESS) MenuUp(pn); }
00061 virtual void MenuDown( PlayerNumber pn,
const InputEventType type ) {
if(type==
IET_FIRST_PRESS) MenuDown(pn); }
00062 virtual void MenuLeft( PlayerNumber pn,
const InputEventType type ) {
if(type==
IET_FIRST_PRESS) MenuLeft(pn); }
00063 virtual void MenuRight( PlayerNumber pn,
const InputEventType type ) {
if(type==
IET_FIRST_PRESS) MenuRight(pn); }
00064 virtual void MenuStart( PlayerNumber pn,
const InputEventType type ) {
if(type==
IET_FIRST_PRESS) MenuStart(pn); }
00065
virtual void MenuBack( PlayerNumber pn,
const InputEventType type );
00066 virtual void MenuCoin( PlayerNumber pn,
const InputEventType type ) {
if(type==
IET_FIRST_PRESS) MenuCoin(pn); }
00067
00068 virtual void MenuUp( PlayerNumber pn ) {}
00069 virtual void MenuDown( PlayerNumber pn ) {}
00070 virtual void MenuLeft( PlayerNumber pn ) {}
00071 virtual void MenuRight( PlayerNumber pn ) {}
00072 virtual void MenuStart( PlayerNumber pn ) {}
00073 virtual void MenuBack( PlayerNumber pn ) {}
00074
virtual void MenuCoin( PlayerNumber pn );
00075 };
00076
00077
#endif
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102