Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1414


Ignore:
Timestamp:
May 24, 2008, 10:08:42 PM (16 years ago)
Author:
rgrieder
Message:
  • moved OrxonoxPlatform.h to util (didn't even notice util recently)
  • therefore was able to define uint32_t, etc. for all our libs in OrxonoxPlatform.h
  • made use of OgreRenderWindow::getAverageFPS() in HUD
Location:
code/branches/network
Files:
16 edited
1 moved

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/audio/AudioPrereqs.h

    r1069 r1414  
    3535#define _AudioPrereqs_H__
    3636
    37 #include "OrxonoxPlatform.h"
     37#include "util/OrxonoxPlatform.h"
    3838
    3939//-----------------------------------------------------------------------
  • code/branches/network/src/core/CorePrereqs.h

    r1413 r1414  
    3535#define _CorePrereqs_H__
    3636
    37 #include "OrxonoxPlatform.h"
     37#include "util/OrxonoxPlatform.h"
    3838
    3939#include <string>
  • code/branches/network/src/core/InputManager.cc

    r1413 r1414  
    421421
    422422        case IS_GUI:
    423           // TODO: do stuff
    424423          break;
    425424
  • code/branches/network/src/core/KeyBinder.cc

    r1413 r1414  
    188188        // check for param command
    189189        int paramIndex = eval.getEvaluatedExecutor()->getAxisParamIndex();
    190         // TODO: check in Executor for correct paramIndex
    191190        if (paramIndex >= 0)
    192191        {
     
    231230          cmd->evaluation_ = eval;
    232231
    233           //TODO: check CommandEvaluation for correct KeybindMode
    234232          if (mode == KeybindMode::None)
    235233            mode = eval.getEvaluatedExecutor()->getKeybindMode();
     
    757755  void KeyBinder::joyStickAxisMoved(int joyStickID, int axis, int value)
    758756  {
    759     // TODO: check whether 16 bit integer as general axis value is a good idea (works under windows)
     757    // TODO: Use proper calibration values instead of generally 16-bit integer
    760758    int i = 8 + axis * 2;
    761759    if (value >= 0)
  • code/branches/network/src/core/KeyBinder.h

    r1413 r1414  
    4848namespace orxonox
    4949{
    50   class _CoreExport BaseCommand
    51   {
    52   public:
    53     virtual ~BaseCommand() { }
    54     virtual bool execute(float abs = 1.0f, float rel = 1.0f) = 0;
    55   };
    56 
    5750  class _CoreExport BufferedParamCommand
    5851  {
     
    6558    int paramIndex_;
    6659    CommandEvaluation evaluation_;
     60  };
     61
     62  class _CoreExport BaseCommand
     63  {
     64  public:
     65    virtual ~BaseCommand() { }
     66    virtual bool execute(float abs = 1.0f, float rel = 1.0f) = 0;
    6767  };
    6868
  • code/branches/network/src/network/NetworkPrereqs.h

    r1360 r1414  
    3535#define _NetworkPrereqs_H__
    3636
    37 #include "OrxonoxPlatform.h"
     37#include "util/OrxonoxPlatform.h"
    3838
    3939//-----------------------------------------------------------------------
     
    5454#else
    5555#  define _NetworkExport
    56 #endif
    57 
    58 //-----------------------------------------------------------------------
    59 // fixed width integers
    60 //-----------------------------------------------------------------------
    61 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
    62 typedef __int8            int8_t;
    63 typedef __int16           int16_t;
    64 typedef __int32           int32_t;
    65 typedef __int64           int64_t;
    66 typedef unsigned __int8   uint8_t;
    67 typedef unsigned __int16  uint16_t;
    68 typedef unsigned __int32  uint32_t;
    69 typedef unsigned __int64  uint64_t;
    70 #else
    71 # include "inttypes.h"
    7256#endif
    7357
  • code/branches/network/src/orxonox/GraphicsEngine.h

    r1293 r1414  
    7272            int getWindowWidth() const;
    7373            int getWindowHeight() const;
     74            float getAverageFPS() const
     75            { if (renderWindow_) return this->renderWindow_->getAverageFPS(); else return 0.0f; }
    7476
    7577            void windowMoved       (Ogre::RenderWindow* rw);
  • code/branches/network/src/orxonox/Main.cc

    r1293 r1414  
    3636#include <exception>
    3737
    38 #include "OrxonoxPlatform.h"
     38#include "util/OrxonoxPlatform.h"
    3939#include "core/SignalHandler.h"
    4040#include "Orxonox.h"
  • code/branches/network/src/orxonox/Orxonox.cc

    r1413 r1414  
    456456    // Contains the times of recently fired events
    457457    // eventTimes[4] is the list for the times required for the fps counter
    458     std::deque<unsigned long> eventTimes[4];
     458    std::deque<unsigned long> eventTimes[3];
    459459    // Clear event times
    460     for (int i = 0; i < 4; ++i)
     460    for (int i = 0; i < 3; ++i)
    461461      eventTimes[i].clear();
    462     // fill the fps time list with zeros
    463     for (int i = 0; i < 50; i++)
    464       eventTimes[3].push_back(0);
    465462
    466463    // use the ogre timer class to measure time.
     
    478475      // get current time
    479476      unsigned long now = timer_->getMilliseconds();
    480       eventTimes[3].push_back(now);
    481       eventTimes[3].erase(eventTimes[3].begin());
    482477
    483478      // create an event to pass to the frameStarted method in ogre
     
    487482
    488483      // show the current time in the HUD
    489 //      orxonoxHUD_->setTime((int)now, 0);
    490 //      orxonoxHUD_->setRocket2(ogreRoot.getCurrentFrameNumber());
    491       if (eventTimes[3].back() - eventTimes[3].front() != 0)
    492         HUD::getSingleton().setFPS(50000.0f/(eventTimes[3].back() - eventTimes[3].front()));
    493 
    494       // Iterate through all Tickables and call their tick(dt) function
     484      // HUD::getSingleton().setTime(now);
     485
     486      // Call those objects that need the real time
    495487      for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; ++it)
    496488        it->tick((float)evt.timeSinceLastFrame * this->timefactor_);
    497       // Iterate through all TickableReals and call their tick(dt) function
     489      // Call the scene objects
    498490      for (Iterator<TickableReal> it = ObjectList<TickableReal>::start(); it; ++it)
    499491        it->tick((float)evt.timeSinceLastFrame);
     492      // TODO: currently a hack. Somehow the console doesn't work with OrxonoxClass
    500493      orxonoxConsole_->tick((float)evt.timeSinceLastFrame);
    501494
     
    504497      ogreRoot._fireFrameStarted(evt);
    505498
    506       // server still renders at the moment
    507       //if (mode_ != SERVER)
    508499      ogreRoot._updateAllRenderTargets(); // only render in non-server mode
    509500
     
    517508      // again, just to be sure ogre works fine
    518509      ogreRoot._fireFrameEnded(evt);
    519       //msleep(50);
    520510          }
    521511
    522     if(mode_==CLIENT)
     512    if (mode_==CLIENT)
    523513      network::Client::getSingleton()->closeConnection();
    524     else if(mode_==SERVER)
     514    else if (mode_==SERVER)
    525515      server_g->close();
     516
    526517    return true;
    527518  }
  • code/branches/network/src/orxonox/OrxonoxPrereqs.h

    r1410 r1414  
    3535#define _OrxonoxPrereqs_H__
    3636
    37 #include "OrxonoxPlatform.h"
     37#include "util/OrxonoxPlatform.h"
    3838
    3939//-----------------------------------------------------------------------
  • code/branches/network/src/orxonox/OrxonoxStableHeaders.h

    r1219 r1414  
    3535#define _OrxonoxStableHeaders_H__
    3636
    37 #include "OrxonoxPlatform.h"
     37#include "util/OrxonoxPlatform.h"
    3838
    3939#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
     
    109109#include "network/Synchronisable.h"
    110110
    111 #include "OrxonoxPlatform.h"
    112111#include "OrxonoxPrereqs.h"
    113112#include "tools/Timer.h"
  • code/branches/network/src/orxonox/hud/HUD.cc

    r1411 r1414  
    3838#include "core/ConsoleCommand.h"
    3939#include "objects/SpaceShip.h"
     40#include "GraphicsEngine.h"
    4041#include "BarOverlayElement.h"
    4142#include "RadarObject.h"
     
    129130
    130131        nav->update();
    131     }
    132132
    133     void HUD::setFPS(float fps){
     133        float fps = GraphicsEngine::getSingleton().getAverageFPS();
    134134        fpsText->setCaption("FPS: " + Ogre::StringConverter::toString(fps));
    135135    }
  • code/branches/network/src/orxonox/hud/HUD.h

    r1411 r1414  
    5858      public:
    5959        virtual void tick(float);
    60         void setFPS(float fps);
    6160        void addRadarObject(Vector3 pos);
    6261        RadarObject* getFirstRadarObject();
  • code/branches/network/src/util/OrxonoxPlatform.h

    r1411 r1414  
    3636#define _OrxonoxPlatform_H__
    3737
    38 namespace orxonox {
    3938/* Initial platform/compiler-related stuff to set.
    4039*/
     
    191190#endif
    192191
    193 // Integer formats of fixed bit width
    194 // FIXME: consider 64 bit platforms!
    195 //typedef unsigned int uint32;
    196 //typedef unsigned short uint16;
    197 //typedef unsigned char uint8;
    198 // proper approach
    199 
     192//-----------------------------------------------------------------------
     193// fixed width integers
     194//-----------------------------------------------------------------------
     195#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
     196typedef __int8            int8_t;
     197typedef __int16           int16_t;
     198typedef __int32           int32_t;
     199typedef __int64           int64_t;
     200typedef unsigned __int8   uint8_t;
     201typedef unsigned __int16  uint16_t;
     202typedef unsigned __int32  uint32_t;
     203typedef unsigned __int64  uint64_t;
     204#else
     205# include "inttypes.h"
     206#endif
     207
     208namespace orxonox {
    200209#ifdef ORXONOX_DOUBLE_PRECISION
    201210typedef double Real;
     
    203212typedef float Real;
    204213#endif
     214}
    205215
    206216
     
    270280//#include <vld.h>
    271281
    272 } /* namespace orxonox */
    273 
    274282#endif /* _OrxonoxPlatform_H__ */
  • code/branches/network/src/util/UtilPrereqs.h

    r1062 r1414  
    3535#define _UtilPrereqs_H__
    3636
    37 #include "OrxonoxPlatform.h"
     37#include "util/OrxonoxPlatform.h"
    3838
    3939//-----------------------------------------------------------------------
  • code/branches/network/visual_studio/vc8/orxonox.vcproj

    r1410 r1414  
    451451                        </File>
    452452                        <File
    453                                 RelativePath="..\..\src\orxonox\OrxonoxPlatform.h"
    454                                 >
    455                         </File>
    456                         <File
    457453                                RelativePath="..\..\src\orxonox\OrxonoxPrereqs.h"
    458454                                >
  • code/branches/network/visual_studio/vc8/util.vcproj

    r1126 r1414  
    227227                        </File>
    228228                        <File
     229                                RelativePath="..\..\src\util\OrxonoxPlatform.h"
     230                                >
     231                        </File>
     232                        <File
    229233                                RelativePath="..\..\src\util\Sleep.h"
    230234                                >
Note: See TracChangeset for help on using the changeset viewer.