Changeset 3301 for code/trunk/src/orxonox/tools
- Timestamp:
- Jul 18, 2009, 4:03:59 PM (15 years ago)
- Location:
- code/trunk/src/orxonox/tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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.