From: <eg...@us...> - 2006-07-31 20:35:10
|
Revision: 145 Author: egore Date: 2006-07-31 13:34:53 -0700 (Mon, 31 Jul 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=145&view=rev Log Message: ----------- start better documentation and customization of the code Modified Paths: -------------- data/Ships/Octavius/Apteryx/octavius_apteryx.mesh opengate.kdevelop src/client/ui/application.cpp src/client/ui/application.h Modified: data/Ships/Octavius/Apteryx/octavius_apteryx.mesh =================================================================== (Binary files differ) Modified: opengate.kdevelop =================================================================== --- opengate.kdevelop 2006-07-31 20:34:00 UTC (rev 144) +++ opengate.kdevelop 2006-07-31 20:34:53 UTC (rev 145) @@ -18,7 +18,7 @@ </general> <kdevautoproject> <general> - <activetarget>src/client/ogre/libopengate-ogre.la</activetarget> + <activetarget>src/client/ui/libopengate-ui.la</activetarget> <useconfiguration>debug</useconfiguration> <useactivetarget>true</useactivetarget> </general> Modified: src/client/ui/application.cpp =================================================================== --- src/client/ui/application.cpp 2006-07-31 20:34:00 UTC (rev 144) +++ src/client/ui/application.cpp 2006-07-31 20:34:53 UTC (rev 145) @@ -31,17 +31,18 @@ #include <CEGUI/CEGUIWindow.h> #include <CEGUI/elements/CEGUIPushButton.h> -OpengateApp::OpengateApp() : mGUIRenderer(0), mGUISystem(0), actionConfig(0) { - mFrameListener = 0; - mRoot = 0; +OpengateApp::OpengateApp() : mGUISystem(0), mGUIRenderer(0), actionConfig(0), mRoot(0), mFrameListener(0), mAvatar(0), mExCamera(0) { + } OpengateApp::~OpengateApp() { - delete actionConfig; delete mGUISystem; delete mGUIRenderer; - delete mFrameListener; + delete actionConfig; delete mRoot; + delete mFrameListener; + delete mAvatar; + delete mExCamera; } void OpengateApp::go(void) { @@ -111,14 +112,9 @@ mCamera->setPosition (0, 0, 0); // Required or else the camera will have an offset // Main character - ogre = new OgreCharacter ("Ogre 1", mSceneMgr); - exCamera = new ExtendedCamera ("Extended Camera", mSceneMgr, mCamera); + mAvatar = new OgreCharacter ("Ogre 1", mSceneMgr); + mExCamera = new ExtendedCamera ("Extended Camera", mSceneMgr, mCamera); - - - Ogre::Entity* ent = mSceneMgr->createEntity( "Octavius Apteryx", "Ships/Octavius/Apteryx/octavius_apteryx.mesh" ); - mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent); - //--------------- setup GUI system ---------------------// mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr); @@ -153,7 +149,7 @@ OIS::JoyStick* joy = gUI->getJoyStick(); //Utility class for configuring, & testing ActionMap - actionConfig = new ActionConfig( mouse, kb, joy, mSceneMgr, ogre, exCamera); + actionConfig = new ActionConfig( mouse, kb, joy, mSceneMgr, mAvatar, mExCamera); } void OpengateApp::setupResources(void) { @@ -165,17 +161,14 @@ Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator(); Ogre::String secName, typeName, archName; - while (seci.hasMoreElements()) - { + while (seci.hasMoreElements()) { secName = seci.peekNextKey(); Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext(); Ogre::ConfigFile::SettingsMultiMap::iterator i; - for (i = settings->begin(); i != settings->end(); ++i) - { + for (i = settings->begin(); i != settings->end(); ++i) { typeName = i->first; archName = i->second; - Ogre::ResourceGroupManager::getSingleton().addResourceLocation( - archName, typeName, secName); + Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName); } } } Modified: src/client/ui/application.h =================================================================== --- src/client/ui/application.h 2006-07-31 20:34:00 UTC (rev 144) +++ src/client/ui/application.h 2006-07-31 20:34:53 UTC (rev 145) @@ -34,8 +34,17 @@ extern "C" { #endif +/*! + * \brief This class is the main class of the client. It binds together the user interface with the game logic. + * + * This class references everything else that lives on the clients side and is visible to the user or + * affected by input by the user. So you will find references to the users avatar, the input system and + * the camera. Most of the stuff here combines the world of OGRE with the world of CEGUI with the world + * of OIS. + * + * \author Christoph Brill + */ class OpengateApp { - public: OpengateApp(); ~OpengateApp(); @@ -43,19 +52,34 @@ private: - OgreCharacter *ogre; - ExtendedCamera *exCamera; + /*! Handle to the players avatar in this game */ + OgreCharacter *mAvatar; + /*! Handle to the camera that is used by the player */ + ExtendedCamera *mExCamera; + /*! Handle to the main menu rendering routines */ CEGUI::OgreCEGUIRenderer* mGUIRenderer; + /*! Handle to the user interface */ CEGUI::System* mGUISystem; + /*! Handle to the keybindings of the player */ ActionConfig *actionConfig; + /*! Handle to the root where everything from the OGRE-world lives */ Ogre::Root *mRoot; - Ogre::Camera* mCamera; + /*! Handle to the camera that is used by the player */ + Ogre::Camera* mCamera; //FIXME: remove an totally replace by mExCamera + /*! Handle to the scenemanager where the objects (like the avatar or the camera) live in */ Ogre::SceneManager* mSceneMgr; + /*! Handle to the framelistener (the thing that does changes to the ogre world) */ OpengateListener* mFrameListener; + /*! Handle to the window through which the player is looking into the opengate universe */ Ogre::RenderWindow* mWindow; + /*! + * \brief Creates the startscene + * + * This method + */ void createScene(void); void createFrameListener(void); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |