Changeset 4666 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 23, 2005, 4:34:44 PM (19 years ago)
- Location:
- orxonox/trunk/src/subprojects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/subprojects/particles/particle_fun.cc
r4649 r4666 23 23 #include "stdlibincl.h" 24 24 #include "graphics_engine.h" 25 26 #include <dirent.h> 25 27 26 28 #define PINIT_EMISSION_RATE 50 … … 36 38 #define PINIT_INHERIT_SPEED 0.0 37 39 #define PINIT_PARTICLE_MASS 1.0 40 #define PINIT_MODEL_DIRECTORY "models/" 38 41 39 42 … … 217 220 PRINT(4)("ParticleType set to %s\n", value); 218 221 } 219 222 else if(!strcmp(name, "ParticleModel")) 223 { 224 char* modelName = new char[strlen(PINIT_MODEL_DIRECTORY) + strlen(value)+1]; 225 sprintf(modelName, "%s%s", PINIT_MODEL_DIRECTORY, value); 226 tmpSys->setModel(ResourceManager::getFullName(modelName)); 227 delete modelName; 228 } 220 229 else if (!strcmp(name, "RandomColor")) 221 230 { … … 370 379 systemBox->fill(ParticleType); 371 380 381 systemBox->fill(new Label("ParticleModel")); 382 Menu* ParticleModel = new Menu("ParticleModel"); 383 { 384 DIR* directory; 385 directory = opendir(ResourceManager::getFullName(PINIT_MODEL_DIRECTORY)); 386 dirent* file; 387 while(file = readdir(directory)) 388 { 389 printf("%s\n", file->d_name); 390 if(strstr(file->d_name, ".obj")) 391 ParticleModel->addItem(file->d_name); 392 } 393 } 394 ParticleModel->connectSignal("changed", (void*)ParticleModel, systemChange ); 395 systemBox->fill(ParticleModel); 396 397 372 398 Button* RandomColor = new Button("RandomColor"); 373 399 RandomColor->connectSignal("released", (void*)RandomColor, systemChange); -
orxonox/trunk/src/subprojects/testmain/testmain.cc
r3572 r4666 1 #include <dirent.h> 2 #include <stdio.h> 3 1 4 int main(int argc, char** argv) 2 5 { 6 DIR* directory; 7 directory = opendir("/"); 8 dirent* test; 9 10 while(test = readdir(directory)) 11 { 12 printf("%s\n", test->d_name); 13 } 14 3 15 4 16 }
Note: See TracChangeset
for help on using the changeset viewer.