Changeset 4308 in orxonox.OLD for orxonox/branches/physics
- Timestamp:
- May 26, 2005, 8:44:11 PM (20 years ago)
- Location:
- orxonox/branches/physics/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/lib/graphics/particles/particle_engine.cc
r4178 r4308 267 267 268 268 /** 269 \param systemName the name of the system to search for 270 \returns the system called by systemName or NULL if not found 271 */ 272 ParticleSystem* ParticleEngine::getSystemByName(const char* systemName) const 273 { 274 tIterator<ParticleSystem>* tmpIt = systemList->getIterator(); 275 ParticleSystem* tmpSys = tmpIt->nextElement(); 276 while(tmpSys) 277 { 278 if (!strcmp(systemName, tmpSys->getName())) 279 { 280 delete tmpIt; 281 return tmpSys; 282 } 283 tmpSys = tmpIt->nextElement(); 284 } 285 delete tmpIt; 286 return NULL; 287 } 288 289 /** 290 \param number the n-th system to return 291 \returns the system called by number or NULL if not found 292 */ 293 ParticleSystem* ParticleEngine::getSystemByNumber(unsigned int number) const 294 { 295 int count = 0; 296 tIterator<ParticleSystem>* tmpIt = systemList->getIterator(); 297 ParticleSystem* tmpSys = tmpIt->nextElement(); 298 while(tmpSys) 299 { 300 count++; 301 if ( count == number) 302 { 303 delete tmpIt; 304 return tmpSys; 305 } 306 tmpSys = tmpIt->nextElement(); 307 } 308 delete tmpIt; 309 return NULL; 310 } 311 312 /** 313 \param emitterName the name of the emitter to search for 314 \returns the emitter called by emitterName or NULL if not found 315 */ 316 ParticleEmitter* ParticleEngine::getEmitterByName(const char* emitterName) const 317 { 318 tIterator<ParticleEmitter>* tmpIt = emitterList->getIterator(); 319 ParticleEmitter* tmpEmit = tmpIt->nextElement(); 320 while(tmpEmit) 321 { 322 if (!strcmp(emitterName, tmpEmit->getName())) 323 { 324 delete tmpIt; 325 return tmpEmit; 326 } 327 tmpEmit = tmpIt->nextElement(); 328 } 329 delete tmpIt; 330 return NULL; 331 } 332 333 334 /** 335 \param number the n-th emitter to return 336 \returns the emitter called by number or NULL if not found 337 */ 338 ParticleEmitter* ParticleEngine::getEmitterByNumber(unsigned int number) const 339 { 340 int count = 0; 341 tIterator<ParticleEmitter>* tmpIt = emitterList->getIterator(); 342 ParticleEmitter* tmpEmit = tmpIt->nextElement(); 343 while(tmpEmit) 344 { 345 count++; 346 if ( count == number) 347 { 348 delete tmpIt; 349 return tmpEmit; 350 } 351 tmpEmit = tmpIt->nextElement(); 352 } 353 delete tmpIt; 354 return NULL; 355 } 356 357 /** 269 358 \brief outputs some nice debug information 270 359 */ -
orxonox/branches/physics/src/lib/graphics/particles/particle_engine.h
r4178 r4308 13 13 // FORWARD DEFINITION 14 14 template<class T> class tList; 15 class ParticleSystem;16 class ParticleEmitter;17 15 18 16 struct ParticleConnection … … 41 39 bool breakConnection(ParticleConnection* connection); 42 40 41 ParticleSystem* getSystemByName(const char* systemName) const; 42 ParticleSystem* getSystemByNumber(unsigned int number) const; 43 ParticleEmitter* getEmitterByName(const char* emitterName) const; 44 ParticleEmitter* getEmitterByNumber(unsigned int number) const; 45 43 46 void debug(); 44 47 -
orxonox/branches/physics/src/subprojects/particles/framework.cc
r4307 r4308 171 171 this->printHelp(); 172 172 break; 173 174 case SDLK_1: 175 break; 173 176 } 174 177 break;
Note: See TracChangeset
for help on using the changeset viewer.