Changeset 1414 for code/branches/network/src
- Timestamp:
- May 24, 2008, 10:08:42 PM (16 years ago)
- Location:
- code/branches/network/src
- Files:
-
- 14 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/audio/AudioPrereqs.h
r1069 r1414 35 35 #define _AudioPrereqs_H__ 36 36 37 #include " OrxonoxPlatform.h"37 #include "util/OrxonoxPlatform.h" 38 38 39 39 //----------------------------------------------------------------------- -
code/branches/network/src/core/CorePrereqs.h
r1413 r1414 35 35 #define _CorePrereqs_H__ 36 36 37 #include " OrxonoxPlatform.h"37 #include "util/OrxonoxPlatform.h" 38 38 39 39 #include <string> -
code/branches/network/src/core/InputManager.cc
r1413 r1414 421 421 422 422 case IS_GUI: 423 // TODO: do stuff424 423 break; 425 424 -
code/branches/network/src/core/KeyBinder.cc
r1413 r1414 188 188 // check for param command 189 189 int paramIndex = eval.getEvaluatedExecutor()->getAxisParamIndex(); 190 // TODO: check in Executor for correct paramIndex191 190 if (paramIndex >= 0) 192 191 { … … 231 230 cmd->evaluation_ = eval; 232 231 233 //TODO: check CommandEvaluation for correct KeybindMode234 232 if (mode == KeybindMode::None) 235 233 mode = eval.getEvaluatedExecutor()->getKeybindMode(); … … 757 755 void KeyBinder::joyStickAxisMoved(int joyStickID, int axis, int value) 758 756 { 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 760 758 int i = 8 + axis * 2; 761 759 if (value >= 0) -
code/branches/network/src/core/KeyBinder.h
r1413 r1414 48 48 namespace orxonox 49 49 { 50 class _CoreExport BaseCommand51 {52 public:53 virtual ~BaseCommand() { }54 virtual bool execute(float abs = 1.0f, float rel = 1.0f) = 0;55 };56 57 50 class _CoreExport BufferedParamCommand 58 51 { … … 65 58 int paramIndex_; 66 59 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; 67 67 }; 68 68 -
code/branches/network/src/network/NetworkPrereqs.h
r1360 r1414 35 35 #define _NetworkPrereqs_H__ 36 36 37 #include " OrxonoxPlatform.h"37 #include "util/OrxonoxPlatform.h" 38 38 39 39 //----------------------------------------------------------------------- … … 54 54 #else 55 55 # define _NetworkExport 56 #endif57 58 //-----------------------------------------------------------------------59 // fixed width integers60 //-----------------------------------------------------------------------61 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC62 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 #else71 # include "inttypes.h"72 56 #endif 73 57 -
code/branches/network/src/orxonox/GraphicsEngine.h
r1293 r1414 72 72 int getWindowWidth() const; 73 73 int getWindowHeight() const; 74 float getAverageFPS() const 75 { if (renderWindow_) return this->renderWindow_->getAverageFPS(); else return 0.0f; } 74 76 75 77 void windowMoved (Ogre::RenderWindow* rw); -
code/branches/network/src/orxonox/Main.cc
r1293 r1414 36 36 #include <exception> 37 37 38 #include " OrxonoxPlatform.h"38 #include "util/OrxonoxPlatform.h" 39 39 #include "core/SignalHandler.h" 40 40 #include "Orxonox.h" -
code/branches/network/src/orxonox/Orxonox.cc
r1413 r1414 456 456 // Contains the times of recently fired events 457 457 // 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]; 459 459 // Clear event times 460 for (int i = 0; i < 4; ++i)460 for (int i = 0; i < 3; ++i) 461 461 eventTimes[i].clear(); 462 // fill the fps time list with zeros463 for (int i = 0; i < 50; i++)464 eventTimes[3].push_back(0);465 462 466 463 // use the ogre timer class to measure time. … … 478 475 // get current time 479 476 unsigned long now = timer_->getMilliseconds(); 480 eventTimes[3].push_back(now);481 eventTimes[3].erase(eventTimes[3].begin());482 477 483 478 // create an event to pass to the frameStarted method in ogre … … 487 482 488 483 // 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 495 487 for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; ++it) 496 488 it->tick((float)evt.timeSinceLastFrame * this->timefactor_); 497 // Iterate through all TickableReals and call their tick(dt) function489 // Call the scene objects 498 490 for (Iterator<TickableReal> it = ObjectList<TickableReal>::start(); it; ++it) 499 491 it->tick((float)evt.timeSinceLastFrame); 492 // TODO: currently a hack. Somehow the console doesn't work with OrxonoxClass 500 493 orxonoxConsole_->tick((float)evt.timeSinceLastFrame); 501 494 … … 504 497 ogreRoot._fireFrameStarted(evt); 505 498 506 // server still renders at the moment507 //if (mode_ != SERVER)508 499 ogreRoot._updateAllRenderTargets(); // only render in non-server mode 509 500 … … 517 508 // again, just to be sure ogre works fine 518 509 ogreRoot._fireFrameEnded(evt); 519 //msleep(50);520 510 } 521 511 522 if (mode_==CLIENT)512 if (mode_==CLIENT) 523 513 network::Client::getSingleton()->closeConnection(); 524 else if (mode_==SERVER)514 else if (mode_==SERVER) 525 515 server_g->close(); 516 526 517 return true; 527 518 } -
code/branches/network/src/orxonox/OrxonoxPrereqs.h
r1410 r1414 35 35 #define _OrxonoxPrereqs_H__ 36 36 37 #include " OrxonoxPlatform.h"37 #include "util/OrxonoxPlatform.h" 38 38 39 39 //----------------------------------------------------------------------- -
code/branches/network/src/orxonox/OrxonoxStableHeaders.h
r1219 r1414 35 35 #define _OrxonoxStableHeaders_H__ 36 36 37 #include " OrxonoxPlatform.h"37 #include "util/OrxonoxPlatform.h" 38 38 39 39 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC … … 109 109 #include "network/Synchronisable.h" 110 110 111 #include "OrxonoxPlatform.h"112 111 #include "OrxonoxPrereqs.h" 113 112 #include "tools/Timer.h" -
code/branches/network/src/orxonox/hud/HUD.cc
r1411 r1414 38 38 #include "core/ConsoleCommand.h" 39 39 #include "objects/SpaceShip.h" 40 #include "GraphicsEngine.h" 40 41 #include "BarOverlayElement.h" 41 42 #include "RadarObject.h" … … 129 130 130 131 nav->update(); 131 }132 132 133 void HUD::setFPS(float fps){133 float fps = GraphicsEngine::getSingleton().getAverageFPS(); 134 134 fpsText->setCaption("FPS: " + Ogre::StringConverter::toString(fps)); 135 135 } -
code/branches/network/src/orxonox/hud/HUD.h
r1411 r1414 58 58 public: 59 59 virtual void tick(float); 60 void setFPS(float fps);61 60 void addRadarObject(Vector3 pos); 62 61 RadarObject* getFirstRadarObject(); -
code/branches/network/src/util/OrxonoxPlatform.h
r1411 r1414 36 36 #define _OrxonoxPlatform_H__ 37 37 38 namespace orxonox {39 38 /* Initial platform/compiler-related stuff to set. 40 39 */ … … 191 190 #endif 192 191 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 196 typedef __int8 int8_t; 197 typedef __int16 int16_t; 198 typedef __int32 int32_t; 199 typedef __int64 int64_t; 200 typedef unsigned __int8 uint8_t; 201 typedef unsigned __int16 uint16_t; 202 typedef unsigned __int32 uint32_t; 203 typedef unsigned __int64 uint64_t; 204 #else 205 # include "inttypes.h" 206 #endif 207 208 namespace orxonox { 200 209 #ifdef ORXONOX_DOUBLE_PRECISION 201 210 typedef double Real; … … 203 212 typedef float Real; 204 213 #endif 214 } 205 215 206 216 … … 270 280 //#include <vld.h> 271 281 272 } /* namespace orxonox */273 274 282 #endif /* _OrxonoxPlatform_H__ */ -
code/branches/network/src/util/UtilPrereqs.h
r1062 r1414 35 35 #define _UtilPrereqs_H__ 36 36 37 #include " OrxonoxPlatform.h"37 #include "util/OrxonoxPlatform.h" 38 38 39 39 //-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.