#include <Client.h>
Collaboration diagram for ASR::Client:
Public Member Functions | |
Client (RenderWindow *window) | |
~Client () | |
void | createCamera () |
Team * | createTeam (const String &teamName, const ColourValue &teamColor) |
Private Member Functions | |
void | _createGUI () |
Private Attributes | |
RTSCamera * | mRTSCamera |
RTSCameraUpdater * | mCameraUpdater |
UnitSelecter * | mUnitSelecter |
Team * | mTeam |
ClientUpdater * | mUpdater |
RenderWindow * | mWindow |
CEGUI::OgreCEGUIRenderer * | mGUIRenderer |
CEGUI::System * | mGUISystem |
CEGUI::Window * | mGUIWindow |
Friends | |
class | ClientUpdater |
Definition at line 25 of file Client.h.
ASR::Client::Client | ( | RenderWindow * | window | ) |
Definition at line 23 of file Client.cpp.
References mGUIRenderer, mGUISystem, mGUIWindow, mTeam, mUnitSelecter, and mUpdater.
00024 : mWindow ( window ) 00025 { 00026 // GUI 00027 mGUIRenderer = NULL; 00028 mGUISystem = NULL; 00029 mGUIWindow = NULL; 00030 00031 mTeam = NULL; 00032 mUnitSelecter = NULL; 00033 mUpdater = NULL; 00034 }
ASR::Client::~Client | ( | ) |
Definition at line 38 of file Client.cpp.
References mCameraUpdater, mGUIRenderer, mGUISystem, mGUIWindow, mRTSCamera, mUnitSelecter, and mUpdater.
00039 { 00040 // GUI 00041 if ( mGUIWindow ) 00042 CEGUI::WindowManager::getSingleton().destroyWindow( mGUIWindow ); 00043 if ( mGUISystem ) 00044 delete mGUISystem; 00045 if ( mGUIRenderer ) 00046 delete mGUIRenderer; 00047 00048 delete mUnitSelecter; 00049 delete mUpdater; 00050 00051 delete mCameraUpdater; 00052 delete mRTSCamera; 00053 }
void ASR::Client::_createGUI | ( | ) | [private] |
Definition at line 76 of file Client.cpp.
References ASR::Game::getSingleton(), mGUIRenderer, mGUISystem, mGUIWindow, and mWindow.
Referenced by createCamera().
00077 { 00078 mGUIRenderer = new CEGUI::OgreCEGUIRenderer ( mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, Game::getSingleton ().getSceneManager () ); 00079 mGUISystem = new CEGUI::System ( mGUIRenderer ); 00080 00081 CEGUI::Logger::getSingleton().setLoggingLevel( CEGUI::Informative ); 00082 00083 CEGUI::SchemeManager::getSingleton().loadScheme ( (CEGUI::utf8*)"TaharezLook.scheme" ); 00084 mGUISystem->setDefaultMouseCursor( (CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*) "MouseArrow" ); 00085 mGUISystem->setDefaultFont( (CEGUI::utf8*)"Tahoma-12" ); 00086 00087 mGUIWindow = CEGUI::WindowManager::getSingleton().createWindow ( (CEGUI::utf8*)"DefaultWindow", (CEGUI::utf8*)"Sheet"); 00088 mGUISystem->setGUISheet( mGUIWindow ); 00089 }
void ASR::Client::createCamera | ( | ) |
Definition at line 57 of file Client.cpp.
References _createGUI(), ASR::Game::addUpdater(), ASR::RTSCamera::getCamera(), ASR::Game::getSingleton(), mCameraUpdater, mGUIRenderer, mRTSCamera, mWindow, and ASR::RTSCamera::setAspectRatio().
Referenced by TutorialApplication::createCamera().
00058 { 00059 mRTSCamera = new RTSCamera ( Game::getSingleton ().getSceneManager () ); 00060 00061 // Create one viewport, entire window 00062 Viewport* vp = mWindow->addViewport(mRTSCamera->getCamera()); 00063 vp->setBackgroundColour(ColourValue(0.1,0.1,0.1)); 00064 00065 // Alter the camera aspect ratio to match the viewport 00066 mRTSCamera->setAspectRatio( Real(vp->getActualWidth()) / Real(vp->getActualHeight())); 00067 00068 _createGUI (); 00069 00070 mCameraUpdater = new RTSCameraUpdater ( mRTSCamera, mGUIRenderer ); 00071 Game::getSingleton ().addUpdater ( mCameraUpdater ); 00072 }
Team * ASR::Client::createTeam | ( | const String & | teamName, | |
const ColourValue & | teamColor | |||
) |
Definition at line 93 of file Client.cpp.
References ASR::Game::addUpdater(), ClientUpdater, ASR::Level::createTeam(), ASR::RTSCamera::getCamera(), ASR::Game::getSingleton(), ASR::Level::getSingleton(), mRTSCamera, mTeam, mUnitSelecter, and mUpdater.
Referenced by TutorialApplication::_createTeamA().
00094 { 00095 OgreAssert ( mTeam == NULL, "Client already has a team" ); 00096 00097 mTeam = Level::getSingleton().createTeam ( teamName, teamColor ); 00098 00099 mUnitSelecter = new UnitSelecter ( mTeam, mRTSCamera->getCamera() ); 00100 Game::getSingleton ().addUpdater ( mUnitSelecter ); 00101 00102 mUpdater = new ClientUpdater ( this ); 00103 Game::getSingleton ().addUpdater ( mUpdater ); 00104 00105 return mTeam; 00106 }
friend class ClientUpdater [friend] |
RTSCameraUpdater* ASR::Client::mCameraUpdater [private] |
CEGUI::OgreCEGUIRenderer* ASR::Client::mGUIRenderer [private] |
Definition at line 42 of file Client.h.
Referenced by _createGUI(), Client(), createCamera(), and ~Client().
CEGUI::System* ASR::Client::mGUISystem [private] |
CEGUI::Window* ASR::Client::mGUIWindow [private] |
RTSCamera* ASR::Client::mRTSCamera [private] |
Team* ASR::Client::mTeam [private] |
Definition at line 36 of file Client.h.
Referenced by ASR::ClientUpdater::_findVisibleObjects(), Client(), and createTeam().
UnitSelecter* ASR::Client::mUnitSelecter [private] |
ClientUpdater* ASR::Client::mUpdater [private] |
RenderWindow* ASR::Client::mWindow [private] |