Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

ltclientshell.h

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 // Shared includes
00017 #include "shared_types.h"
00018 
00019 // Engine includes
00020 #include <iclientshell.h>
00021 #include <ilttexinterface.h>
00022 #include "ltbasedefs.h"
00023 #include "ltengineobjects.h"
00024 
00026 // Global pointer to the ClientShell
00027 class CLTClientShell;
00028 extern CLTClientShell *g_pCShell;
00029 
00030 //Crazy shawn functions in NodeMania!
00031 void printModelNodeInfo();
00032 void processNode(int modelNumber, char* nodeName, float degree);
00033 
00034 class CClientConnClnt;
00035 class CCamera;
00036 class CWorldPropClnt;
00037 class CPlayerClnt;
00038 
00039 
00041 enum EClientGameState
00042 {
00043         CGS_STARTING_UP = 0,
00044         CGS_MENU,
00045         CGS_LOADING_WORLD,
00046         CGS_PLAYING,
00047         CGS_PAUSED,
00048         CGS_WORLD_EXIT,
00049         CGS_SCOREBOARD,
00050         CGS_CINEMATIC,
00051         CGS_SHUTTING_DOWN,
00052 
00053         CGS_SAMPLE,
00054 
00055         CGS_NUM_STATES
00056 };
00057 
00058 
00059 extern  int     BOW;
00060 extern  int     TWIST;
00061 extern  int     STRETCH;
00062 extern  bool APPLY_NODE;
00063 extern  HOBJECT purple_light;
00064 extern  HOBJECT yellow_light;
00065 
00067 class CLTClientShell : public IClientShellStub
00068 {
00069   public:
00070         // Construction / destruction
00071         CLTClientShell();
00072         virtual ~CLTClientShell();
00073 
00074         declare_interface(CLTClientShell);
00075 
00076         // Overridden functions
00077 
00078         virtual uint32          OnEngineInitialized(RMode *pMod, LTGUID *pAppGuid);
00079         virtual void            OnEngineTerm();
00080 
00081         virtual void            OnEvent(uint32 dwEventID, uint32 dwParam);
00082 
00083         virtual void            PreLoadWorld(const char *pWorldName);
00084         virtual void            OnEnterWorld();
00085         virtual void            OnExitWorld();
00086 
00087         virtual void            PreUpdate();
00088         virtual void            Update();
00089         virtual void            PostUpdate();
00090 
00091         virtual void            OnCommandOn(int command);
00092         virtual void            OnCommandOff(int command);
00093 
00094         virtual void            OnKeyDown(int key, int rep);
00095         virtual void            OnKeyUp(int key);
00096 
00097         virtual void            OnMessage(uint8 messageID, ILTMessage* pMessage);
00098         virtual void            SpecialEffectNotify(HLOCALOBJ hObj, ILTMessage* pMessage);
00099 
00100         virtual LTRESULT        OnObjectMove(HLOCALOBJ hObj, LTBOOL bTeleport, LTVector3f *pNewPos);
00101         virtual LTRESULT        OnObjectRotate(HLOCALOBJ hObj, LTBOOL bTeleport,
00102                                                         LTOrientation *pNewOrientation);
00103         virtual void            OnObjectRemove(HLOCALOBJ hObj);
00104 
00105         virtual LTRESULT        OnTouchNotify(HOBJECT hMain, LTContactInfo *pInfo);
00106 
00107         virtual void            OnModelKey(HLOCALOBJ hObj, ArgList *pArgs);
00108 
00109         virtual void            OnPlaySound(PlaySoundInfo *pPlaySoundInfo) ;
00110 
00111 
00112         // Non-LithTech-defined functions
00113 
00114         void                            FirstUpdate();
00115 
00116         void                            RegisterObject(CPlayerClnt* pPlayer);
00117         void                            UnRegisterObject(CPlayerClnt* pPlayer);
00118         void                            RegisterObject(CWorldPropClnt* pWorldProp);
00119         void                            UnRegisterObject(CWorldPropClnt* pWorldProp);
00120         void                            RegisterObject(CClientConnClnt* pClientConn);
00121         void                            UnRegisterObject(CClientConnClnt* pClientConn);
00122 
00123         uint32                          GetClientID() {return m_nClientID;};
00124         
00125         CPlayerClnt*            GetPlayer(uint32 iPlayer = 0)   { return m_Players[iPlayer]; }
00126         CCamera*                        GetCamera(uint32 iCamera = 0)   { return m_Cameras[iCamera]; }
00127 
00128         LTOrientation           GetStartPointRot() {return m_oStartPointRot;};
00129         
00130         LTRESULT                        InitGame();
00131         void                            InitBeforeConnect();
00132 
00133   protected:
00134         // Non-Lithtech defined Functions
00135 
00136         LTRESULT                        InitRenderer(RMode *pMode);
00137         LTRESULT                        InitSound();
00138         LTRESULT                        Render();
00139 
00140 
00141         void                            DisplayWatermark();
00142 
00143         void                            AddPlayer();
00144         void                            RemovePlayer();
00145 
00146         void                            UpdatePlayers(float fFrameTime);
00147         void                            UpdateCameras(float fFrameTime);
00148 
00149         LTRESULT                        RenderCameras();
00150 
00151         void                            SetupCameraViewports();
00152         void                            SetupCameraViewports(uint32 count, uint32 indx,
00153                 uint32 nPrevViewports, uint32 nCurrentDigit);
00154 
00155 //      void                            Viewport2Cameras(uint32 indx,
00156 //                                                      uint32 nPrevViewports, uint32 nCurrentDigit);
00157 
00158         // Member variables
00159 
00160         uint8                           m_iPlayerCount;
00161         uint8                           m_iCurrentPlayer;
00162 
00163         CCamera*                        m_Cameras[MAX_CLIENT_PLAYERS];
00164         CPlayerClnt*            m_Players[MAX_CLIENT_PLAYERS];
00165 
00166         LTOrientation           m_oStartPointRot;
00167         bool                            m_bRender;
00168         bool                            m_bFirstUpdate;
00169         
00170         CWorldPropClnt*         m_pWorldProp;
00171         
00172         CClientConnClnt*        m_pClientConn;
00173 
00174         HTEXTURE                        m_hWatermark;
00175 
00176         uint32                          m_eClientGameState;
00177         
00178         uint32                          m_nClientID;
00179         bool                            m_bDisplayClientIDErrorMsg;
00180 };
00181 
00182 
00183 #endif // __LT_CLIENT_SHELL_H__

Generated on Tue Oct 16 13:42:10 2001 for The Stage by doxygen1.2.11 written by Dimitri van Heesch, © 1997-2001