Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ltclientshell.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------- //
00002 //
00003 // MODULE  : ltclientshell.h
00004 //
00005 // PURPOSE : LT Client Shell - Definition
00006 //
00007 // CREATED : 12/20/00
00008 //
00009 // (c) 2000 LithTech, Inc.  All Rights Reserved
00010 //
00011 // ----------------------------------------------------------------------- //
00012 
00013 #ifndef __LT_CLIENT_SHELL_H__
00014 #define __LT_CLIENT_SHELL_H__
00015 
00016 
00017 // Shared includes
00018 #include "shared_types.h"
00019 #include "Aria.h"
00020 
00021 // Definitions of classes
00022 #include "mousefilter.h"
00023 #include "JamODrum.h"
00024 #include "MusicBoxPipe.h"
00025 #include "BeatListener.h"
00026 
00027 // Engine includes
00028 #include <iclientshell.h>
00029 #include <ilttexinterface.h>
00030 
00031 
00033 // Global pointer to the ClientShell
00034 class CLTClientShell;
00035 extern CLTClientShell *g_pCShell;
00036 
00037 class CMenuMgr;
00038 class CClientConnClnt;
00039 class CCamera;
00040 class CWorldPropClnt;
00041 class CPlayerClnt;
00042 class CFxMgr;
00043 
00044 
00046 enum EClientGameState
00047 {
00048     CGS_STARTING_UP = 0,
00049     CGS_MENU,
00050     CGS_LOADING_WORLD,
00051     CGS_PLAYING,
00052     CGS_PAUSED,
00053     CGS_WORLD_EXIT,
00054     CGS_SCOREBOARD,
00055     CGS_CINEMATIC,
00056     CGS_SHUTTING_DOWN,
00057 
00058     CGS_SAMPLE,
00059 
00060     CGS_NUM_STATES
00061 };
00062 
00063 
00065 class CLTClientShell : public IClientShellStub
00066 {
00067   public:
00068     // Construction / destruction
00069     CLTClientShell();
00070     virtual ~CLTClientShell();
00071 
00072     declare_interface(CLTClientShell);
00073 
00074     // Overridden functions
00075 
00076     virtual uint32      OnEngineInitialized(RMode *pMod, LTGUID *pAppGuid);
00077     virtual void        OnEngineTerm();
00078 
00079     virtual void        OnEvent(uint32 dwEventID, uint32 dwParam);
00080 
00081     virtual void        PreLoadWorld(const char *pWorldName);
00082     virtual void        OnEnterWorld();
00083     virtual void        OnExitWorld();
00084 
00085     virtual void        PreUpdate();
00086     virtual void        Update();
00087     virtual void        PostUpdate();
00088 
00089     virtual void        OnCommandOn(int command);
00090     virtual void        OnCommandOff(int command);
00091 
00092     virtual void        OnKeyDown(int key, int rep);
00093     virtual void        OnKeyUp(int key);
00094 
00095     virtual void        OnMessage(uint8 messageID, ILTMessage* pMessage);
00096     virtual void        SpecialEffectNotify(HLOCALOBJ hObj, ILTMessage* pMessage);
00097 
00098     virtual LTRESULT    OnObjectMove(HLOCALOBJ hObj, bool bTeleport, LTVector3f *pNewPos);
00099     virtual LTRESULT    OnObjectRotate(HLOCALOBJ hObj, bool bTeleport,
00100                             LTOrientation *pNewOrientation);
00101     virtual void        OnObjectRemove(HLOCALOBJ hObj);
00102 
00103     virtual LTRESULT    OnTouchNotify(HOBJECT hMain, LTContactInfo *pInfo);
00104 
00105     virtual void        OnModelKey(HLOCALOBJ hObj, ArgList *pArgs);
00106 
00107     virtual void        OnPlaySound(PlaySoundInfo *pPlaySoundInfo) ;
00108 
00109 
00110     // Non-LithTech-defined functions
00111 
00112     void                FirstUpdate();
00113 
00114     void                RegisterObject(CPlayerClnt* pPlayer);
00115     void                UnRegisterObject(CPlayerClnt* pPlayer);
00116     void                RegisterObject(CWorldPropClnt* pWorldProp);
00117     void                UnRegisterObject(CWorldPropClnt* pWorldProp);
00118     void                RegisterObject(CClientConnClnt* pClientConn);
00119     void                UnRegisterObject(CClientConnClnt* pClientConn);
00120 
00121     uint32              GetClientID() {return m_nClientID;};
00122     
00123     CPlayerClnt*        GetPlayer(uint32 iPlayer = 0)   { return m_Players[iPlayer]; }
00124     CCamera*            GetCamera(uint32 iCamera = 0)   { return m_Cameras[iCamera]; }
00125 
00126     LTOrientation       GetStartPointRot() {return m_oStartPointRot;};
00127     
00128     LTRESULT            InitGame();
00129     void                InitBeforeConnect();
00130 
00131     CMouseFilter*       GetMouseFilter()                { return &m_MouseFilter; }
00132 
00133     CFxMgr*             GetFxMgr() { return m_pFXMgr; };
00134     
00135   protected:
00136     // Non-Lithtech defined Functions
00137 
00138     LTRESULT            InitRenderer(RMode *pMode);
00139     LTRESULT            InitSound();
00140     LTRESULT            Render();
00141 
00142     void                DisplayWatermark();
00143 
00144     void                AddPlayer();
00145     void                RemovePlayer();
00146 
00147     void                UpdatePlayers(float fFrameTime);
00148     void                UpdateCameras(float fFrameTime);
00149 
00150     LTRESULT            RenderCameras();
00151 
00152     void                SetupCameraViewports();
00153     void                SetupCameraViewports(uint32 count, uint32 indx,
00154         uint32 nPrevViewports, uint32 nCurrentDigit);
00155 
00156 //  void                Viewport2Cameras(uint32 indx,
00157 //                          uint32 nPrevViewports, uint32 nCurrentDigit);
00158 
00159     // Member variables
00160 
00161     uint8               m_iPlayerCount;
00162     uint8               m_iCurrentPlayer;
00163 
00164     CCamera*            m_Cameras[MAX_CLIENT_PLAYERS];
00165     CPlayerClnt*        m_Players[MAX_CLIENT_PLAYERS];
00166 
00167     LTOrientation       m_oStartPointRot;
00168     bool                m_bRender;
00169     bool                m_bFirstUpdate;
00170     
00171     CWorldPropClnt*     m_pWorldProp;
00172     
00173     CClientConnClnt*    m_pClientConn;
00174 
00175     HTEXTURE            m_hWatermark;
00176 
00177     uint32              m_eClientGameState;
00178     uint32              m_eSavedClientGameState;
00179     
00180     uint32              m_nClientID;
00181     bool                m_bDisplayClientIDErrorMsg;
00182 
00183     CMouseFilter        m_MouseFilter;
00184 
00185     CFxMgr              *m_pFXMgr;
00186 
00187     JamODrum*           m_pJamODrum;
00188     MusicBoxPipe*       m_pMusicBoxPipe;
00189     BeatListener*       m_pBeatListener;
00190 };
00191 
00192 #endif // __LT_CLIENT_SHELL_H__

Generated on Mon Mar 4 08:42:23 2002 for Aria by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002