Changeset 3301 for code/trunk/src/orxonox
- Timestamp:
- Jul 18, 2009, 4:03:59 PM (15 years ago)
- Location:
- code/trunk/src/orxonox
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/gamestates/GSDedicated.cc
r3300 r3301 193 193 // boost::recursive_mutex::scoped_lock(this->inputLineMutex_); 194 194 std::cout << endl << CommandExecutor::hint( std::string((const char*)this->commandLine_,inputIterator_) ) << endl; 195 strncpy( (char*)this->commandLine_, CommandExecutor::complete( std::string((const char*)this->commandLine_,inputIterator_) ).c_str(), MAX_COMMAND_LENGTH);195 strncpy(reinterpret_cast<char*>(this->commandLine_), CommandExecutor::complete( std::string(reinterpret_cast<char*>(this->commandLine_),inputIterator_) ).c_str(), MAX_COMMAND_LENGTH); 196 196 inputIterator_ = strlen((const char*)this->commandLine_); 197 197 break; … … 275 275 void GSDedicated::insertCharacter( unsigned int position, char c ) 276 276 { 277 // std::cout << endl << (unsigned int)c<< endl;277 // std::cout << endl << static_cast<unsigned int>(c) << endl; 278 278 // check that we do not exceed MAX_COMMAND_LENGTH 279 279 if( inputIterator_+1 < MAX_COMMAND_LENGTH ) -
code/trunk/src/orxonox/objects/Scene.cc
r3280 r3301 325 325 { 326 326 // get the WorldEntity pointers 327 WorldEntity* object0 = (WorldEntity*)colObj0->getUserPointer();327 WorldEntity* object0 = static_cast<WorldEntity*>(colObj0->getUserPointer()); 328 328 assert(dynamic_cast<WorldEntity*>(object0)); 329 WorldEntity* object1 = (WorldEntity*)colObj1->getUserPointer();329 WorldEntity* object1 = static_cast<WorldEntity*>(colObj1->getUserPointer()); 330 330 assert(dynamic_cast<WorldEntity*>(object1)); 331 331 -
code/trunk/src/orxonox/objects/collisionshapes/CollisionShape.h
r2662 r3301 63 63 virtual void setScale3D(const Vector3& scale); 64 64 virtual void setScale(float scale); 65 inline const Vector3& getScale3D( void) const65 inline const Vector3& getScale3D() const 66 66 { return this->scale_; } 67 67 -
code/trunk/src/orxonox/objects/controllers/WaypointPatrolController.cc
r3196 r3301 85 85 86 86 Vector3 myposition = this->getControllableEntity()->getPosition(); 87 float shortestsqdistance = (unsigned int)-1;87 float shortestsqdistance = static_cast<unsigned int>(-1); 88 88 89 89 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) -
code/trunk/src/orxonox/objects/gametypes/TeamDeathmatch.cc
r3300 r3301 74 74 playersperteam[it->second]++; 75 75 76 unsigned int minplayers = (unsigned int)-1;76 unsigned int minplayers = static_cast<unsigned int>(-1); 77 77 size_t minplayersteam = 0; 78 78 for (size_t i = 0; i < this->teams_; ++i) -
code/trunk/src/orxonox/objects/gametypes/UnderAttack.cc
r3300 r3301 51 51 52 52 this->setConfigValues(); 53 this->timesequence_ = static_cast< this->gameTime_);53 this->timesequence_ = static_cast<int>(this->gameTime_); 54 54 } 55 55 -
code/trunk/src/orxonox/objects/weaponsystem/Munition.cc
r3196 r3301 354 354 return false; 355 355 356 if (amount <= (unsigned int)needed_magazines)356 if (amount <= static_cast<unsigned int>(needed_magazines)) 357 357 { 358 358 // We need more magazines than we get, so just add them -
code/trunk/src/orxonox/objects/weaponsystem/WeaponSystem.h
r3196 r3301 84 84 85 85 static const unsigned int MAX_FIRE_MODES = 8; 86 static const unsigned int FIRE_MODE_UNASSIGNED = (unsigned int)-1;86 static const unsigned int FIRE_MODE_UNASSIGNED = static_cast<unsigned int>(-1); 87 87 88 88 static const unsigned int MAX_WEAPON_MODES = 8; 89 static const unsigned int WEAPON_MODE_UNASSIGNED = (unsigned int)-1;89 static const unsigned int WEAPON_MODE_UNASSIGNED = static_cast<unsigned int>(-1); 90 90 91 91 private: -
code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.h
r3300 r3301 66 66 { this->LOD_ = static_cast<LODParticle::Value>(level); this->LODchanged(); } 67 67 inline unsigned int getLODxml() const 68 { return (unsigned int)this->LOD_; }68 { return static_cast<unsigned int>(this->LOD_); } 69 69 70 70 void sourceChanged(); -
code/trunk/src/orxonox/objects/worldentities/WorldEntity.h
r3196 r3301 148 148 inline void setScale3D(float x, float y, float z) 149 149 { this->setScale3D(Vector3(x, y, z)); } 150 const Vector3& getScale3D( void) const;150 const Vector3& getScale3D() const; 151 151 const Vector3& getWorldScale3D() const; 152 152 … … 457 457 inline const Quaternion& WorldEntity::getOrientation() const 458 458 { return this->node_->getOrientation(); } 459 inline const Vector3& WorldEntity::getScale3D( void) const459 inline const Vector3& WorldEntity::getScale3D() const 460 460 { return this->node_->getScale(); } 461 461 #endif -
code/trunk/src/orxonox/overlays/GUIOverlay.cc
r3300 r3301 67 67 std::string str; 68 68 std::stringstream out; 69 out << static_cast<long>(this);69 out << reinterpret_cast<long>(this); 70 70 str = out.str(); 71 71 GUIManager::getInstance().executeCode("showCursor()"); -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r3300 r3301 82 82 // Get aspect ratio from the render window. Later on, we get informed automatically 83 83 Ogre::RenderWindow* defaultWindow = GraphicsManager::getInstance().getRenderWindow(); 84 this->windowAspectRatio_ = (float)defaultWindow->getWidth() / defaultWindow->getHeight();84 this->windowAspectRatio_ = static_cast<float>(defaultWindow->getWidth()) / defaultWindow->getHeight(); 85 85 this->sizeCorrectionChanged(); 86 86 … … 183 183 void OrxonoxOverlay::windowResized(unsigned int newWidth, unsigned int newHeight) 184 184 { 185 this->windowAspectRatio_ = newWidth/(float)newHeight;185 this->windowAspectRatio_ = static_cast<float>(newWidth) / newHeight; 186 186 this->sizeCorrectionChanged(); 187 187 } … … 215 215 if (angle < 0.0) 216 216 angle = -angle; 217 angle -= 180.0f * static_cast e<int>(angle / 180.0);217 angle -= 180.0f * static_cast<int>(angle / 180.0); 218 218 219 219 // take the reverse if angle is about 90 degrees -
code/trunk/src/orxonox/overlays/console/InGameConsole.cc
r3300 r3301 93 93 @brief Destructor: Destroys the TextAreas. 94 94 */ 95 InGameConsole::~InGameConsole( void)95 InGameConsole::~InGameConsole() 96 96 { 97 97 this->deactivate(); -
code/trunk/src/orxonox/overlays/hud/HUDNavigation.cc
r3280 r3301 141 141 142 142 // set text 143 int dist = (int) getDist2Focus();143 int dist = static_cast<int>(getDist2Focus()); 144 144 navText_->setCaption(multi_cast<std::string>(dist)); 145 145 float textLength = multi_cast<std::string>(dist).size() * navText_->getCharHeight() * 0.3; -
code/trunk/src/orxonox/overlays/notifications/NotificationOverlay.cc
r3196 r3301 129 129 std::string NotificationOverlay::clipMessage(const std::string & message) 130 130 { 131 if(message.length() <= (unsigned int)this->queue_->getNotificationLength()) //!< If the message is not too long.131 if(message.length() <= static_cast<unsigned int>(this->queue_->getNotificationLength())) //!< If the message is not too long. 132 132 return message; 133 133 return message.substr(0, this->queue_->getNotificationLength()); -
code/trunk/src/orxonox/overlays/notifications/NotificationQueue.cc
r3196 r3301 398 398 timeString.erase(timeString.length()-1); 399 399 std::ostringstream stream; 400 stream << (unsigned long)notification;400 stream << reinterpret_cast<unsigned long>(notification); 401 401 std::string addressString = stream.str() ; 402 402 container->name = "NotificationOverlay(" + timeString + ")&" + addressString; -
code/trunk/src/orxonox/tools/ParticleInterface.cc
r3280 r3301 79 79 } 80 80 81 this->setDetailLevel( (unsigned int)detaillevel);81 this->setDetailLevel(static_cast<unsigned int>(detaillevel)); 82 82 } 83 83 … … 185 185 void ParticleInterface::detailLevelChanged(unsigned int newlevel) 186 186 { 187 if (newlevel >= (unsigned int)this->detaillevel_)187 if (newlevel >= static_cast<unsigned int>(this->detaillevel_)) 188 188 this->bAllowedByLOD_ = true; 189 189 else -
code/trunk/src/orxonox/tools/Shader.cc
r3196 r3301 165 165 if (pointer->first) 166 166 { 167 if ((* ((float*)pointer->second)) != value)168 { 169 (* ((float*)pointer->second)) = value;167 if ((*static_cast<float*>(pointer->second)) != value) 168 { 169 (*static_cast<float*>(pointer->second)) = value; 170 170 return true; 171 171 } … … 173 173 else 174 174 { 175 if ((* ((int*)pointer->second)) != (int)value)176 { 177 (* ((int*)pointer->second)) = (int)value;175 if ((*static_cast<int*>(pointer->second)) != static_cast<int>(value)) 176 { 177 (*static_cast<int*>(pointer->second)) = static_cast<int>(value); 178 178 return true; 179 179 } … … 190 190 if (pointer->first) 191 191 { 192 if ((* ((float*)pointer->second)) != (float)value)193 { 194 (* ((float*)pointer->second)) = (float)value;192 if ((*static_cast<float*>(pointer->second)) != static_cast<float>(value)) 193 { 194 (*static_cast<float*>(pointer->second)) = static_cast<float>(value); 195 195 return true; 196 196 } … … 198 198 else 199 199 { 200 if ((* ((int*)pointer->second)) != value)201 { 202 (* ((int*)pointer->second)) = value;200 if ((*static_cast<int*>(pointer->second)) != value) 201 { 202 (*static_cast<int*>(pointer->second)) = value; 203 203 return true; 204 204 } … … 214 214 { 215 215 if (pointer->first) 216 return (* ((float*)pointer->second));216 return (*static_cast<float*>(pointer->second)); 217 217 else 218 return static_cast<float>(* ((int*)pointer->second));218 return static_cast<float>(*static_cast<int*>(pointer->second)); 219 219 } 220 220 else … … 309 309 { 310 310 void* temp = (definition_iterator->second.isFloat()) 311 ? (void*)parameter_pointer->getFloatPointer(definition_iterator->second.physicalIndex)312 : (void*)parameter_pointer->getIntPointer(definition_iterator->second.physicalIndex);311 ? static_cast<void*>(parameter_pointer->getFloatPointer(definition_iterator->second.physicalIndex)) 312 : static_cast<void*>(parameter_pointer->getIntPointer(definition_iterator->second.physicalIndex)); 313 313 ParameterPointer parameter_pointer = ParameterPointer(definition_iterator->second.isFloat(), temp); 314 314 -
code/trunk/src/orxonox/tools/Timer.cc
r3196 r3301 136 136 { 137 137 // If active: Decrease the timer by the duration of the last frame 138 this->time_ -= (long long)(time.getDeltaTimeMicroseconds() * this->getTimeFactor());138 this->time_ -= static_cast<long long>(time.getDeltaTimeMicroseconds() * this->getTimeFactor()); 139 139 140 140 if (this->time_ <= 0) -
code/trunk/src/orxonox/tools/Timer.h
r3300 r3301 103 103 /** @brief Gives the Timer some extra time. @param time The amount of extra time in seconds */ 104 104 inline void addTime(float time) 105 { if (time > 0.0f) this->time_ += (long long)(time * 1000000.0f); }105 { if (time > 0.0f) this->time_ += static_cast<long long>(time * 1000000.0f); } 106 106 /** @brief Decreases the remaining time of the Timer. @param time The amount of time to remove */ 107 107 inline void removeTime(float time) 108 { if (time > 0.0f) this->time_ -= (long long)(time * 1000000.0f); }108 { if (time > 0.0f) this->time_ -= static_cast<long long>(time * 1000000.0f); } 109 109 /** @brief Sets the interval of the Timer. @param interval The interval */ 110 110 inline void setInterval(float interval) 111 { this->interval_ = (long long)(interval * 1000000.0f); }111 { this->interval_ = static_cast<long long>(interval * 1000000.0f); } 112 112 /** @brief Sets bLoop to a given value. @param bLoop True = loop */ 113 113 inline void setLoop(bool bLoop)
Note: See TracChangeset
for help on using the changeset viewer.