- Timestamp:
- May 27, 2005, 8:22:54 PM (20 years ago)
- Location:
- orxonox/branches/physics/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/lib/graphics/particles/particle_system.cc
r4332 r4336 42 42 ParticleSystem::ParticleSystem (unsigned int maxCount, PARTICLE_TYPE type) 43 43 { 44 44 this->setClassID(CL_PARTICLE_SYSTEM, "ParticleSystem"); 45 45 this->material = NULL; 46 46 this->name = NULL; … … 123 123 124 124 // glID[0] = glGenLists(count); 125 if ( material)126 delete material;125 if (this->material) 126 delete this->material; 127 127 material = NULL; 128 128 129 if ( particleType == PARTICLE_SPRITE)130 { 131 material = new Material("transperencyMap");132 material->setDiffuseMap("pictures/radialTransparency.png");129 if (this->particleType == PARTICLE_SPRITE) 130 { 131 this->material = new Material("transperencyMap"); 132 this->material->setDiffuseMap("pictures/radialTransparency.png"); 133 133 // material->setTransparency(.5); 134 134 } -
orxonox/branches/physics/src/lib/gui/gui/gui_gtk.cc
r4325 r4336 1419 1419 { 1420 1420 MenuItem* tmpItem = this->firstItem; 1421 for (int i = 0; i<this->value; i++) 1422 tmpItem = tmpItem->next; 1423 1424 return tmpItem->name; 1421 for (int i = 0; i < this->value; i++) 1422 if (tmpItem) 1423 tmpItem = tmpItem->next; 1424 else 1425 break; 1426 if (tmpItem) 1427 { 1428 char* tmpName = new char[strlen(tmpItem->name)+1]; 1429 strcpy(tmpName, tmpItem->name); 1430 return tmpName; 1431 } 1432 else 1433 return NULL; 1425 1434 } 1426 1435 … … 1503 1512 1504 1513 #endif /* HAVE_GTK2 */ 1505 PRINT( 5)("%s set to: %d\n", this->title, this->value);1514 PRINT(1)("%s set to: %d\n", this->title, this->value); 1506 1515 } 1507 1516 -
orxonox/branches/physics/src/subprojects/particles/particle_fun.cc
r4335 r4336 44 44 break; 45 45 } 46 47 } 48 46 } 49 47 } 50 48 … … 62 60 void Framework::moduleHelp(void) const 63 61 { 64 PRINT(0)("i - state Information\n\n"); 62 PRINT(0)("\n"); 63 PRINT(0)("i - Particle-state Information\n\n"); 65 64 PRINT(0)("\n"); 66 65 … … 71 70 Option* option = (Option*) widget; 72 71 const char* name = option->getTitle(); 73 char* valueC = option->save(); 74 float value = atof(valueC); 72 char* value = option->save(); 75 73 76 74 ParticleEmitter* tmpEmit = ParticleEngine::getInstance()->getEmitterByNumber(1); … … 79 77 if (!strcmp(name, "EmissionRate")) 80 78 { 81 tmpEmit->setEmissionRate( value);82 PRINT(3)("EmissionRate set to %f\n", value);79 tmpEmit->setEmissionRate(atof(value)); 80 PRINT(3)("EmissionRate set to %f\n", atof(value)); 83 81 } 84 82 else if (!strcmp(name, "Velocity")) 85 83 { 86 tmpEmit->setEmissionVelocity( value);87 PRINT(3)("Velocity set to %f\n", value);84 tmpEmit->setEmissionVelocity(atof(value)); 85 PRINT(3)("Velocity set to %f\n", atof(value)); 88 86 } 89 87 else if(!strcmp(name, "SpreadAngle")) 90 88 { 91 tmpEmit->setSpread( value);92 PRINT(3)("SpreadAngle set to %f\n", value);89 tmpEmit->setSpread(atof(value)); 90 PRINT(3)("SpreadAngle set to %f\n", atof(value)); 93 91 } 94 92 else if(!strcmp(name, "EmitterType")) 95 93 { 96 if (!strcmp(value C, "EMITTER_DOT"))94 if (!strcmp(value, "EMITTER_DOT")) 97 95 tmpEmit->setType(EMITTER_DOT); 98 else if (!strcmp(value C, "EMITTER_PLANE"))96 else if (!strcmp(value, "EMITTER_PLANE")) 99 97 tmpEmit->setType(EMITTER_PLANE); 100 else if (!strcmp(value C, "EMITTER_CUBE"))98 else if (!strcmp(value, "EMITTER_CUBE")) 101 99 tmpEmit->setType(EMITTER_CUBE); 102 PRINT(3)("EmitterType set to %s\n", value C);100 PRINT(3)("EmitterType set to %s\n", value); 103 101 } 104 102 else if(!strcmp(name, "EmitterSize")) 105 103 { 106 tmpEmit->setSize( value);107 PRINT(3)("EmitterSize set to %f\n", value);108 } 109 } 110 delete value C;104 tmpEmit->setSize(atof(value)); 105 PRINT(3)("EmitterSize set to %f\n", atof(value)); 106 } 107 } 108 delete value; 111 109 } 112 110 … … 116 114 Option* option = (Option*) widget; 117 115 const char* name = option->getTitle(); 118 char* value C= option->save();119 float value = atof(valueC);116 char* value = option->save(); 117 printf("%s\n", value); 120 118 121 119 ParticleSystem* tmpSys = ParticleEngine::getInstance()->getSystemByNumber(1); … … 124 122 if (!strcmp(name, "StartRadius")) 125 123 { 126 tmpSys->setRadius( value, tmpSys->getEndRadius());127 PRINT(3)("ParticleStartRadius set to %f\n", value);124 tmpSys->setRadius(atof(value), tmpSys->getEndRadius()); 125 PRINT(3)("ParticleStartRadius set to %f\n", atof(value)); 128 126 } 129 127 else if (!strcmp(name, "EndRadius")) 130 128 { 131 tmpSys->setRadius( tmpSys->getStartRadius(), value);132 PRINT(3)("ParticleEndRadius set to %f\n", value);129 tmpSys->setRadius( tmpSys->getStartRadius(), atof(value)); 130 PRINT(3)("ParticleEndRadius set to %f\n", atof(value)); 133 131 } 134 132 135 133 else if (!strcmp(name, "LifeSpan")) 136 134 { 137 tmpSys->setLifeSpan( value);138 PRINT(3)("ParticleLifeSpan set to %f\n", value);135 tmpSys->setLifeSpan(atof(value)); 136 PRINT(3)("ParticleLifeSpan set to %f\n", atof(value)); 139 137 } 140 138 141 139 else if (!strcmp(name, "ConserveFactor")) 142 140 { 143 tmpSys->setConserve( value);144 PRINT(3)("ParticleConserveFactor set to %f\n", value);141 tmpSys->setConserve(atof(value)); 142 PRINT(3)("ParticleConserveFactor set to %f\n", atof(value)); 145 143 } 146 144 147 145 else if (!strcmp(name, "ParticleType")) 148 146 { 149 if (!strcmp(value C, "PARTICLE_DOT"))147 if (!strcmp(value, "PARTICLE_DOT")) 150 148 tmpSys->setType(PARTICLE_DOT); 151 else if (!strcmp(value C, "PARTICLE_SPARK"))149 else if (!strcmp(value, "PARTICLE_SPARK")) 152 150 tmpSys->setType(PARTICLE_SPARK); 153 else if (!strcmp(value C, "PARTICLE_SPRITE"))151 else if (!strcmp(value, "PARTICLE_SPRITE")) 154 152 tmpSys->setType(PARTICLE_SPRITE); 155 153 156 PRINT(3)("ParticleType set to %s\n", value C);154 PRINT(3)("ParticleType set to %s\n", value); 157 155 } 158 156 159 157 else if (!strcmp(name, "InheritSpeed")) 160 158 { 161 tmpSys->setInheritSpeed( value);162 PRINT(3)("ParticleInheritSpeed set to %f\n", value);163 } 164 165 } 166 delete value C;159 tmpSys->setInheritSpeed(atof(value)); 160 PRINT(3)("ParticleInheritSpeed set to %f\n", atof(value)); 161 } 162 163 } 164 delete value; 167 165 } 168 166
Note: See TracChangeset
for help on using the changeset viewer.