Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2007, 5:00:41 PM (17 years ago)
Author:
rgrieder
Message:
  • added namespace Orxonox to every file
    • removed all the "using namespace Ogre" in the header files
  • cleaned up with the includes: attempt to include as little as possible to reduce compile time.
    • created a header file: orxonox_prerequisites.h
    • used OgrePrerequisites in the header files
    • avoided including "Ogre.h", using separate files instead
  • created empty class: AmmunitionDump
Location:
code/branches/main_reto_vs05/include
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/main_reto_vs05/include/Bullet.h

    r157 r161  
    3030#define BULLET_H
    3131
    32 #include "Ogre.h"
     32#include "OgrePrerequisites.h"
    3333
    34 using namespace Ogre;
    35 
    36 class Bullet
    37 {
    38 public:
    39         SceneNode *mNode;
    40         Entity *mEntity;
    41         Vector3 mSpeed;
    42 
    43         Bullet(SceneNode*, Entity*, Vector3);
    44         ~Bullet();
    45 
    46 protected:
    47 
    48 };
     34#include "Orxonox_prerequisites.h"
    4935
    5036
     37namespace Orxonox {
     38
     39  class Bullet
     40  {
     41  public:
     42    Ogre::SceneNode *mNode;
     43          Ogre::Entity *mEntity;
     44          Ogre::Vector3 mSpeed;
     45
     46  protected:
     47
     48  public:
     49          Bullet(Ogre::SceneNode*, Ogre::Entity*, Ogre::Vector3);
     50          ~Bullet();
     51
     52  protected:
     53
     54  };
     55
     56}
     57
    5158#endif /* BULLET_H */
  • code/branches/main_reto_vs05/include/Orxonox.h

    r159 r161  
    3030#define ORXONOX_H
    3131
    32 #include "Ogre.h"
    33 #include "OgreTimer.h"
     32#include "OgrePrerequisites.h"
    3433
    35 #include "ogre_control.h"
    36 #include "run_manager.h"
     34#include "Orxonox_prerequisites.h"
    3735
    38 class Orxonox
    39 {
    40 public:
    41   Orxonox();
    42   virtual ~Orxonox();
    43         virtual void go();
     36namespace Orxonox {
    4437
    45 protected:
    46         virtual bool setup(void);
     38  class Orxonox
     39  {
     40  public:
     41    Orxonox();
     42    virtual ~Orxonox();
     43          virtual void go();
    4744
    48         virtual void destroy(void);
     45  protected:
     46          virtual bool setup(void);
    4947
    50 protected:
    51         OgreControl *ogre_;
    52         RunManager  *runMgr_;
    53         Timer       *timer_;
     48          virtual void destroy(void);
    5449
    55 };
     50  protected:
     51          OgreControl *ogre_;
     52          RunManager  *runMgr_;
     53          Ogre::Timer *timer_;
     54
     55  };
     56
     57}
    5658
    5759#endif /* ORXONOX_H */
  • code/branches/main_reto_vs05/include/camera_manager.h

    r157 r161  
    3030#define CAMERA_MANAGER_H
    3131
    32 #include "Ogre.h"
     32#include "OgrePrerequisites.h"
    3333
    34 using namespace Ogre;
    35 
    36 class CameraManager
    37 {
    38 public:
    39         CameraManager(SceneManager*);
    40         ~CameraManager();
    41 
    42         bool setCameraPosition(int);
    43 
    44 protected:
    45         SceneManager *mSceneMgr;
    46         Camera *mCamera;
    47 };
     34#include "Orxonox_prerequisites.h"
    4835
    4936
     37namespace Orxonox {
     38
     39  class CameraManager
     40  {
     41  public:
     42    CameraManager(Ogre::SceneManager*);
     43          ~CameraManager();
     44
     45          bool setCameraPosition(int);
     46
     47  protected:
     48          Ogre::SceneManager *mSceneMgr;
     49          Ogre::Camera *mCamera;
     50  };
     51
     52}
     53
    5054#endif /* CAMERA_MANAGER_H */
  • code/branches/main_reto_vs05/include/ogre_control.h

    r159 r161  
    3030#define OGRE_CONTROL_H
    3131
    32 #include "Ogre.h"
    33 #include "OgreConfigFile.h"
     32#include "OgrePrerequisites.h"
     33
     34#include "Orxonox_prerequisites.h"
    3435
    3536
    36 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    37 #include <CoreFoundation/CoreFoundation.h>
    38 #endif
     37namespace Orxonox {
    3938
    40 using namespace Ogre;
     39  class OgreControl
     40  {
     41  public:
     42          OgreControl();
    4143
    42 class OgreControl
    43 {
    44 public:
    45         OgreControl();
     44          virtual ~OgreControl();
    4645
    47         virtual ~OgreControl();
     46          /** Sets up the application - returns false if the user chooses to abandon configuration. */
     47          virtual bool initialise();
    4848
    49         /** Sets up the application - returns false if the user chooses to abandon configuration. */
    50         virtual bool initialise();
     49    virtual Ogre::Root* getRoot();
    5150
    52         virtual Root* getRoot();
     51          virtual Ogre::RenderWindow* getRenderWindow();
    5352
    54         virtual RenderWindow* getRenderWindow();
     53          virtual Ogre::String getResourcePath();
    5554
    56         virtual Ogre::String getResourcePath();
     55  protected:
     56          /** Configures the application - returns false if the user chooses to abandon configuration. */
     57          virtual bool configure(void);
    5758
    58 protected:
    59         /** Configures the application - returns false if the user chooses to abandon configuration. */
    60         virtual bool configure(void);
     59          /// Method which will define the source of resources (other than current folder)
     60          virtual void setupResources(void);
    6161
    62         /// Method which will define the source of resources (other than current folder)
    63         virtual void setupResources(void);
     62  protected:
     63          Ogre::Root         *root_;
     64          Ogre::RenderWindow *window_;
     65          Ogre::String  resourcePath_;
    6466
    65 protected:
    66         Root         *root_;
    67         RenderWindow *window_;
    68         Ogre::String  resourcePath_;
     67  };
    6968
    70 };
     69}
    7170
    7271#endif /* OGRE_CONTROL_H */
  • code/branches/main_reto_vs05/include/orxonox_scene.h

    r159 r161  
    3030#define ORXONOX_SCENE_H
    3131
    32 #include "Ogre.h"
     32#include "OgrePrerequisites.h"
    3333
    34 using namespace Ogre;
     34#include "Orxonox_prerequisites.h"
    3535
    36 class OrxonoxScene
    37 {
    38 public:
    39         OrxonoxScene(SceneManager*);
    4036
    41         virtual ~OrxonoxScene();
     37namespace Orxonox {
    4238
    43         virtual bool initialise();
     39  class OrxonoxScene
     40  {
     41  public:
     42    OrxonoxScene(Ogre::SceneManager*);
    4443
    45         virtual bool tick(unsigned long, Real);
     44          virtual ~OrxonoxScene();
    4645
    47 protected:
    48         /// method where you can perform resource group loading
    49         virtual void loadResources();
     46          virtual bool initialise();
    5047
    51         /// Define what is in the scene
    52         virtual void createScene();
     48          virtual bool tick(unsigned long, Ogre::Real);
    5349
    54 protected:
    55         SceneManager* sceneMgr_;
     50  protected:
     51          /// method where you can perform resource group loading
     52          virtual void loadResources();
    5653
    57         //specific variables for test purposes
    58         Light        *light_;
    59         SceneNode    *lightNode_;
    60         BillboardSet *bbs_;
    61         Real distance_;
    62   Real radius_;
    63 };
     54          /// Define what is in the scene
     55          virtual void createScene();
     56
     57  protected:
     58          Ogre::SceneManager* sceneMgr_;
     59
     60          //specific variables for test purposes
     61          Ogre::Light        *light_;
     62          Ogre::SceneNode    *lightNode_;
     63          Ogre::BillboardSet *bbs_;
     64          Ogre::Real distance_;
     65    Ogre::Real radius_;
     66  };
     67
     68}
    6469
    6570#endif /* ORXONOX_SCENE_H */
  • code/branches/main_reto_vs05/include/orxonox_ship.h

    r159 r161  
    3030#define ORXONOX_SHIP_H
    3131
    32 #include "Ogre.h"
     32#include "OgrePrerequisites.h"
    3333
    34 #include "bullet.h"
    35 
    36 using namespace Ogre;
    37 
    38 class OrxonoxShip
    39 {
    40 public:
    41         OrxonoxShip(SceneManager*, SceneNode*);
    42         virtual ~OrxonoxShip();
    43 
    44         virtual bool initialise();
    45 
    46         void setMainThrust(const Real);
    47         void setSideThrust(const Real);
    48   void setYThrust(const Real);
    49         void turnUpAndDown(const Radian&);
    50         void turnLeftAndRight(const Radian&);
    51 
    52   SceneNode* getRootNode();
    53   Vector3 getSpeed();
    54 
    55         Bullet* fire();
    56 
    57         bool tick(unsigned long, Real);
    58 
    59 protected:
    60 
    61 protected:
    62         SceneManager *sceneMgr_;
    63         SceneNode *rootNode_;
    64         Entity *shipEntity_;
    65 
    66         Vector3 currentSpeed_;  // relative to space
    67         Vector3 currentThrust_; // relative to the ship
    68   Real baseThrust_;
    69         int objectCounter_;
    70         Vector3 bulletSpeed_;
    71 
    72 };
     34#include "Orxonox_prerequisites.h"
    7335
    7436
     37namespace Orxonox {
     38
     39  class OrxonoxShip
     40  {
     41  public:
     42          OrxonoxShip(Ogre::SceneManager*, Ogre::SceneNode*);
     43          virtual ~OrxonoxShip();
     44
     45          virtual bool initialise();
     46
     47          void setMainThrust(const Ogre::Real);
     48          void setSideThrust(const Ogre::Real);
     49    void setYThrust(const Ogre::Real);
     50          void turnUpAndDown(const Ogre::Radian&);
     51          void turnLeftAndRight(const Ogre::Radian&);
     52
     53    Ogre::SceneNode* getRootNode();
     54    Ogre::Vector3 getSpeed();
     55
     56          Bullet* fire();
     57
     58          bool tick(unsigned long, Ogre::Real);
     59
     60  protected:
     61
     62  protected:
     63          Ogre::SceneManager *sceneMgr_;
     64          Ogre::SceneNode *rootNode_;
     65          Ogre::Entity *shipEntity_;
     66
     67          Ogre::Vector3 currentSpeed_;  // relative to space
     68          Ogre::Vector3 currentThrust_; // relative to the ship
     69    Ogre::Real baseThrust_;
     70          int objectCounter_;
     71          Ogre::Vector3 bulletSpeed_;
     72
     73  };
     74
     75}
     76
    7577#endif /* ORXONOX_SHIP_H */
  • code/branches/main_reto_vs05/include/run_manager.h

    r159 r161  
    3030#define RUN_MANAGER_H
    3131
    32 #include "Ogre.h"
    33 #include "OgreStringConverter.h"
    34 #include "OgreException.h"
     32#include "OgrePrerequisites.h"
     33#include "OgreWindowEventUtilities.h"
     34#include "OgreTextureManager.h"
    3535
    36 #include "ogre_control.h"
    37 #include "orxonox_scene.h"
    38 #include "orxonox_ship.h"
     36#include <OIS/OISPrereqs.h>
     37
     38#include "Orxonox_prerequisites.h"
    3939
    4040
    41 //Use this define to signify OIS will be used as a DLL
    42 //(so that dll import/export macros are in effect)
    43 #define OIS_DYNAMIC_LIB
    44 #include <OIS/OIS.h>
     41namespace Orxonox {
    4542
    46 using namespace Ogre;
     43  // let the class inherit from WindowEventListener in order for the RunMgr
     44  // to act as the central point of all the calcuations in Orxonox
     45  class RunManager : Ogre::WindowEventListener
     46  {
     47  public:
     48          RunManager(OgreControl*);
     49
     50          virtual ~RunManager();
     51
     52    virtual bool tick(unsigned long, Ogre::Real);
     53
     54  protected:
     55          virtual void createCamera(void);
     56
     57          virtual void createViewports(void);
    4758
    4859
    49 // let the class inherit from WindowEventListener in order for the RunMgr
    50 // to act as the central point of all the calcuations in Orxonox
    51 class RunManager : WindowEventListener
    52 {
    53 public:
    54         RunManager(OgreControl*);
     60          /** EVENT HANDLING **/
    5561
    56         virtual ~RunManager();
     62          //Adjust mouse clipping area
     63          virtual void windowResized(Ogre::RenderWindow*);
    5764
    58         virtual bool tick(unsigned long, Real);
    59 
    60 protected:
    61         virtual void createCamera(void);
    62 
    63         virtual void createViewports(void);
     65          //Unattach OIS before window shutdown (very important under Linux)
     66          virtual void windowClosed(Ogre::RenderWindow*);
    6467
    6568
    66         /** EVENT HANDLING **/
     69          /** INPUT PROCESSING **/
     70          virtual bool processUnbufferedKeyInput();
    6771
    68         //Adjust mouse clipping area
    69         virtual void windowResized(RenderWindow*);
    70 
    71         //Unattach OIS before window shutdown (very important under Linux)
    72         virtual void windowClosed(RenderWindow*);
     72          virtual bool processUnbufferedMouseInput();
    7373
    7474
    75         /** INPUT PROCESSING **/
    76         virtual bool processUnbufferedKeyInput();
     75          /** OUTPUT **/
    7776
    78         virtual bool processUnbufferedMouseInput();
     77          virtual void updateStats(void);
    7978
     79          virtual void showDebugOverlay(bool);
    8080
    81         /** OUTPUT **/
     81  protected:
     82          Ogre::SceneManager *sceneMgr_;
     83          Ogre::RenderWindow *window_;
     84          Ogre::Camera       *camera_;
     85          OgreControl  *ogre_;
     86          OrxonoxScene *backgroundScene_;
     87          OrxonoxShip  *playerShip_;
    8288
    83         virtual void updateStats(void);
     89          bool statsOn_;
     90          std::string debugText_;
    8491
    85         virtual void showDebugOverlay(bool);
     92          unsigned int screenShotCounter_;
     93          // just to stop toggles flipping too fast
     94          Ogre::Real timeUntilNextToggle_;
     95          bool leftButtonDown_;
     96          Ogre::TextureFilterOptions filtering_;
     97          int aniso_;
    8698
    87 protected:
    88         OgreControl  *ogre_;
    89         SceneManager *sceneMgr_;
    90         RenderWindow *window_;
    91         OrxonoxScene *backgroundScene_;
    92         Camera       *camera_;
    93         OrxonoxShip  *playerShip_;
     99          int sceneDetailIndex_;
     100          Ogre::Overlay* debugOverlay_;
    94101
    95         bool statsOn_;
    96         std::string debugText_;
     102          //OIS Input devices
     103          OIS::InputManager* inputManager_;
     104          OIS::Mouse*    mouse_;
     105          OIS::Keyboard* keyboard_;
     106          OIS::JoyStick* joystick_;
    97107
    98         unsigned int screenShotCounter_;
    99         // just to stop toggles flipping too fast
    100         Real timeUntilNextToggle_;
    101         bool leftButtonDown_;
    102         TextureFilterOptions filtering_;
    103         int aniso_;
     108    const Ogre::Real mouseSensitivity_;
    104109
    105         int sceneDetailIndex_;
    106         Overlay* debugOverlay_;
     110    // Bullet array
     111          Bullet **bullets_;
     112          int bulletsSize_;
     113          int bulletsIndex_;
    107114
    108         //OIS Input devices
    109         OIS::InputManager* inputManager_;
    110         OIS::Mouse*    mouse_;
    111         OIS::Keyboard* keyboard_;
    112         OIS::JoyStick* joystick_;
     115          // previously elapsed render time
     116          unsigned long totalTime_;
    113117
    114   const Real mouseSensitivity_;
     118  };
    115119
    116   // Bullet array
    117         Bullet **bullets_;
    118         int bulletsSize_;
    119         int bulletsIndex_;
    120 
    121         // previously elapsed render time
    122         unsigned long totalTime_;
    123 
    124 };
     120}
    125121
    126122#endif /* RUN_MANAGER_H */
  • code/branches/main_reto_vs05/include/weapon_manager.h

    r157 r161  
    3030#define WEAPON_MANAGER_H
    3131
    32 #include "Ogre.h"
     32#include "OgrePrerequisites.h"
    3333
    34 using namespace Ogre;
    35 
    36 class WeaponManager
    37 {
    38 public:
    39         WeaponManager(SceneManager*);
    40         virtual ~WeaponManager();
    41 
    42 protected:
    43 
    44 };
     34#include "Orxonox_prerequisites.h"
    4535
    4636
     37namespace Orxonox {
     38
     39  class WeaponManager
     40  {
     41  public:
     42    WeaponManager(Ogre::SceneManager*);
     43          virtual ~WeaponManager();
     44
     45  protected:
     46
     47  };
     48
     49}
     50
    4751#endif /* WEAPON_MANAGER_H */
Note: See TracChangeset for help on using the changeset viewer.