Changeset 1001 for code/branches/core2/src/orxonox
- Timestamp:
- Apr 8, 2008, 1:51:25 AM (17 years ago)
- Location:
- code/branches/core2/src/orxonox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/orxonox/OrxonoxStableHeaders.h
r871 r1001 83 83 84 84 #include "util/Math.h" 85 #include "util/Convert.h"86 85 #include "util/Sleep.h" 87 86 #include "util/String2Number.h" -
code/branches/core2/src/orxonox/core/CommandExecutor.cc
r994 r1001 297 297 } 298 298 299 boolCommandExecutor::addConsoleCommandShortcut(ExecutorStatic* executor)299 Executor& CommandExecutor::addConsoleCommandShortcut(ExecutorStatic* executor) 300 300 { 301 301 CommandExecutor::getInstance().consoleCommandShortcuts_[executor->getName()] = executor; 302 302 CommandExecutor::getInstance().consoleCommandShortcuts_LC_[getLowercase(executor->getName())] = executor; 303 return true;303 return (*executor); 304 304 } 305 305 -
code/branches/core2/src/orxonox/core/CommandExecutor.h
r994 r1001 139 139 static CommandEvaluation evaluate(const std::string& command); 140 140 141 static booladdConsoleCommandShortcut(ExecutorStatic* executor);141 static Executor& addConsoleCommandShortcut(ExecutorStatic* executor); 142 142 static ExecutorStatic* getConsoleCommandShortcut(const std::string& name); 143 143 static ExecutorStatic* getLowercaseConsoleCommandShortcut(const std::string& name); -
code/branches/core2/src/orxonox/core/ConsoleCommand.h
r993 r1001 50 50 51 51 #define ConsoleCommandShortcutGeneric(fakevariable, executor) \ 52 boolfakevariable = CommandExecutor::addConsoleCommandShortcut((ExecutorStatic*)executor)52 Executor& fakevariable = CommandExecutor::addConsoleCommandShortcut((ExecutorStatic*)executor) 53 53 54 54 -
code/branches/core2/src/orxonox/core/Functor.h
r967 r1001 325 325 void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \ 326 326 { \ 327 std::cout << "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" << std::endl; \ 328 std::cout << param1 << std::endl; \ 329 std::cout << this->getTypenameParam(0) << std::endl; \ 327 330 FUNCTOR_STORE_RETURNVALUE(returnvalue, (*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \ 331 std::cout << "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" << std::endl; \ 328 332 } \ 329 333 \ -
code/branches/core2/src/orxonox/objects/Tickable.cc
r871 r1001 1 1 #include "core/CoreIncludes.h" 2 #include "core/ConsoleCommand.h" 2 3 #include "Tickable.h" 3 4 4 5 namespace orxonox 5 6 { 7 ConsoleCommandShortcutExtern(slomo, AccessLevel::Offline).setDefaultValue(0, 1.0); 8 ConsoleCommandShortcutExtern(setTimeFactor, AccessLevel::Offline).setDefaultValue(0, 1.0); 9 10 static float timefactor = 1.0; 11 void slomo(float factor) 12 { 13 setTimeFactor(factor); 14 } 15 void setTimeFactor(float factor) 16 { 17 timefactor = factor; 18 } 19 float getTimeFactor() 20 { 21 return timefactor; 22 } 23 6 24 /** 7 25 @brief Constructor: Registers the object in the Tickable-list -
code/branches/core2/src/orxonox/objects/Tickable.h
r871 r1001 50 50 class TickFrameListener; // Forward declaration 51 51 52 void slomo(float factor); 53 void setTimeFactor(float factor = 1.0); 54 float getTimeFactor(); 55 52 56 //! The Tickable interface provides a tick(dt) function, that gets called every frame. 53 57 class _OrxonoxExport Tickable : virtual public OrxonoxClass … … 71 75 bool frameStarted(const Ogre::FrameEvent &evt) 72 76 { 77 float dt = evt.timeSinceLastFrame * getTimeFactor(); 73 78 // Iterate through all Tickables and call their tick(dt) function 74 79 for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; ) 75 (it++)->tick( evt.timeSinceLastFrame);80 (it++)->tick(dt); 76 81 77 82 return FrameListener::frameStarted(evt); -
code/branches/core2/src/orxonox/tools/Timer.h
r995 r1001 63 63 #include "OrxonoxPrereqs.h" 64 64 #include "core/CorePrereqs.h" 65 #include "../objects/Tickable.h" 65 66 66 67 namespace orxonox … … 200 201 bool frameStarted(const Ogre::FrameEvent &evt) 201 202 { 203 float dt = evt.timeSinceLastFrame * getTimeFactor(); 202 204 // Iterate through all Timers 203 205 for (Iterator<TimerBase> it = ObjectList<TimerBase>::start(); it; ) … … 206 208 { 207 209 // If active: Decrease the timer by the duration of the last frame 208 it->time_ -= evt.timeSinceLastFrame;210 it->time_ -= dt; 209 211 210 212 if (it->time_ <= 0)
Note: See TracChangeset
for help on using the changeset viewer.