Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9371 in orxonox.OLD for branches/proxy/src/world_entities


Ignore:
Timestamp:
Jul 20, 2006, 11:08:16 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: ORXONOX is now completely std::stringed

Location:
branches/proxy/src/world_entities
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/world_entities/creatures/fps_player.cc

    r9347 r9371  
    299299      if ( victim )
    300300      {
    301         PRINTF(0)("FIRE: hit %s\n", victim->getClassName());
     301        PRINTF(0)("FIRE: hit %s\n", victim->getClassCName());
    302302        victim->hit( 20, this );
    303303      }
  • branches/proxy/src/world_entities/playable.cc

    r9347 r9371  
    148148    if (weapon != NULL)
    149149      PRINTF(2)("Unable to add Weapon (%s::%s) to %s::%s\n",
    150                 weapon->getClassName(), weapon->getName(), this->getClassName(), this->getName());
     150                weapon->getClassCName(), weapon->getCName(), this->getClassCName(), this->getCName());
    151151    else
    152152      PRINTF(2)("No weapon defined\n");
  • branches/proxy/src/world_entities/power_ups/power_up.cc

    r9357 r9371  
    8585    if (this->pickupBuffer != NULL)
    8686    {
    87       PRINTF(4)("Loaded sound %s to Pickup: %s.\n", pickupSound.c_str(), this->getName());
     87      PRINTF(4)("Loaded sound %s to Pickup: %s.\n", pickupSound.c_str(), this->getCName());
    8888    }
    8989    else
    9090    {
    91       PRINTF(2)("Failed to load sound %s to pickup %s.\n.", pickupSound.c_str(), this->getName());
     91      PRINTF(2)("Failed to load sound %s to pickup %s.\n.", pickupSound.c_str(), this->getCName());
    9292    }
    9393  }
     
    106106    if (this->respawnBuffer != NULL)
    107107    {
    108       PRINTF(4)("Loaded sound %s to Pickup: %s.\n", respawnSound.c_str(), this->getName());
     108      PRINTF(4)("Loaded sound %s to Pickup: %s.\n", respawnSound.c_str(), this->getCName());
    109109    }
    110110    else
    111111    {
    112       PRINTF(2)("Failed to load sound %s to respawn %s.\n.", respawnSound.c_str(), this->getName());
     112      PRINTF(2)("Failed to load sound %s to respawn %s.\n.", respawnSound.c_str(), this->getCName());
    113113    }
    114114  }
  • branches/proxy/src/world_entities/projectiles/projectile.cc

    r9235 r9371  
    7575    if (this->explosionBuffer != NULL)
    7676    {
    77       PRINTF(4)("Loaded sound %s to Pickup: %s.\n", explosionSound.c_str(), this->getName());
     77      PRINTF(4)("Loaded sound %s to Pickup: %s.\n", explosionSound.c_str(), this->getCName());
    7878    }
    7979    else
    8080    {
    81       PRINTF(2)("Failed to load sound %s to explosion %s.\n.", explosionSound.c_str(), this->getName());
     81      PRINTF(2)("Failed to load sound %s to explosion %s.\n.", explosionSound.c_str(), this->getCName());
    8282    }
    8383  }
     
    9797    if (this->engineBuffer != NULL)
    9898    {
    99       PRINTF(4)("Loaded sound %s to Pickup: %s.\n", engineSound.c_str(), this->getName());
     99      PRINTF(4)("Loaded sound %s to Pickup: %s.\n", engineSound.c_str(), this->getCName());
    100100    }
    101101    else
    102102    {
    103       PRINTF(2)("Failed to load sound %s to engine %s.\n.", engineSound.c_str(), this->getName());
     103      PRINTF(2)("Failed to load sound %s to engine %s.\n.", engineSound.c_str(), this->getCName());
    104104    }
    105105  }
  • branches/proxy/src/world_entities/script_trigger.cc

    r9298 r9371  
    6363  addToScript = false;
    6464  this->activeOnCreation = false;
    65  
     65
    6666  if(root != NULL)
    6767  {
    68    
     68
    6969    loadParams(root);
    70  
     70
    7171    if(addToScript && scriptIsOk)
    7272    {
    7373      script->addObject( "ScriptTrigger", this->getName());
    7474    }
    75  
    76   }
    77  
     75
     76  }
     77
    7878}
    7979
    8080/**
    8181 * Deletes the ScriptTrigger.
    82  * 
     82 *
    8383 */
    8484ScriptTrigger::~ScriptTrigger()
     
    147147  else
    148148  {
    149     PRINTF(2)("Target %s for %s::%s does not Exist\n", target.c_str(), this->getClassName(), this->getName());
     149    PRINTF(2)("Target %s for %s::%s does not Exist\n", target.c_str(), this->getClassCName(), this->getCName());
    150150  }
    151151}
     
    153153/**
    154154 * Sets the parent of the trigger.
    155  * @param parent The parrent. 
     155 * @param parent The parrent.
    156156 */
    157157void ScriptTrigger::setTriggerParent(const std::string& parent)
     
    166166  else
    167167  {
    168     PRINTF(2)("Parent %s for %s::%s does not Exist\n", parent.c_str(), this->getClassName(), this->getName());
     168    PRINTF(2)("Parent %s for %s::%s does not Exist\n", parent.c_str(), this->getClassCName(), this->getCName());
    169169  }
    170170}
     
    179179     return;
    180180   }
    181    
     181
    182182  if(triggerRemains && scriptCalled)
    183183  {
     
    185185    return;
    186186  }
    187  
     187
    188188  if( !invert && this->distance(target) < radius)
    189189  {
     
    191191    scriptCalled = true;
    192192    return;
    193  
     193
    194194  }
    195195  else if( invert && this->distance(target) > radius)
    196196  {
    197     executeAction(timestep); 
     197    executeAction(timestep);
    198198    scriptCalled = true;
    199199    return;
     
    207207void ScriptTrigger::executeAction(float timestep)
    208208{
    209  
     209
    210210  if(scriptIsOk)
    211211  {
     
    213213    if(!(script->selectFunction(this->functionName,returnCount)) )
    214214      PRINT(1)("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());
    215      
     215
    216216    script->pushParam( timestep, this->functionName);
    217      
     217
    218218    if( !(script->executeFunction()) )
    219219      PRINT(1)("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());
    220      
     220
    221221    scriptFinished = script->getReturnedBool();
    222222  }
    223      
    224      
     223
     224
    225225}
    226226
     
    268268   float retf = script->getReturnedFloat();
    269269   printf("main returned %f\n",retf);
    270    
     270
    271271
    272272   printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
  • branches/proxy/src/world_entities/space_ships/space_ship.cc

    r9357 r9371  
    319319    }
    320320  }
    321   PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
     321  PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassCName(), entity->getClassCName(), location.x, location.y, location.z);
    322322}
    323323
  • branches/proxy/src/world_entities/space_ships/spacecraft_2d.cc

    r9298 r9371  
    324324
    325325    default:
    326       PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassName());
     326      PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassCName());
    327327  }
    328328}
     
    474474
    475475    default:
    476       PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassName());
     476      PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassCName());
    477477  }
    478478}
  • branches/proxy/src/world_entities/spawning_point.cc

    r9365 r9371  
    123123    return;
    124124
    125   PRINTF(0)("Spawningpoint spawns Entity (%s)\n", entity->getClassName());
     125  PRINTF(0)("Spawningpoint spawns Entity (%s)\n", entity->getClassCName());
    126126
    127127
     
    203203void SpawningPoint::sendRespawnMessage( int uniqueId )
    204204{
    205 #warning this bye array is not been deleted according to valginrd
     205#warning this byte array is not being deleted according to valginrd
    206206  byte * buf = new byte[2*INTSIZE];
    207207
  • branches/proxy/src/world_entities/weapons/aiming_system.cc

    r9357 r9371  
    101101  }
    102102
    103   PRINTF(0)("entity: %s\n", nearestEntity->getClassName());
     103  PRINTF(0)("entity: %s\n", nearestEntity->getClassCName());
    104104    return nearestEntity;
    105105}
  • branches/proxy/src/world_entities/weapons/weapon.cc

    r9357 r9371  
    199199  else
    200200  {
    201     PRINTF(1)("Projectile %s does not exist for weapon %s\n", projectile.c_str(), this->getName());
     201    PRINTF(1)("Projectile %s does not exist for weapon %s\n", projectile.c_str(), this->getCName());
    202202  }
    203203}
     
    213213    projectileFactory->prepare(count);
    214214  else
    215     PRINTF(2)("unable to create %d projectile for Weapon %s (%s)\n", count, this->getName(), this->getClassName());
     215    PRINTF(2)("unable to create %d projectile for Weapon %s::%s\n", count, this->getClassCName(), this->getCName());
    216216}
    217217
     
    234234  else
    235235  {
    236     PRINTF(2)("No projectile defined for Weapon %s(%s) can't return any\n", this->getName(), this->getClassName());
     236    PRINTF(2)("No projectile defined for Weapon %s(%s) can't return any\n", this->getCName(), this->getClassCName());
    237237    return NULL;
    238238  }
     
    442442    this->updateWidgets();
    443443    // activate
    444     PRINTF(4)("Activating the Weapon %s\n", this->getName());
     444    PRINTF(4)("Activating the Weapon %s\n", this->getCName());
    445445    this->activate();
    446446    // setting up for next action
     
    458458  //  if (this->currentState != WS_INACTIVE)
    459459  {
    460     PRINTF(4)("Deactivating the Weapon %s\n", this->getName());
     460    PRINTF(4)("Deactivating the Weapon %s\n", this->getCName());
    461461    // play Sound
    462462    if (this->soundBuffers[WA_DEACTIVATE] != NULL)
     
    527527bool Weapon::reloadW()
    528528{
    529   PRINTF(4)("Reloading Weapon %s\n", this->getName());
     529  PRINTF(4)("Reloading Weapon %s\n", this->getCName());
    530530  if (this->ammoContainer.get() != NULL &&
    531531      unlikely(this->energy + this->ammoContainer->getStoredEnergy() < this->minCharge))
     
    632632void Weapon::debug() const
    633633{
    634   PRINT(0)("Weapon-Debug %s, state: %s (duration: %fs), nextAction: %s\n", this->getName(), Weapon::stateToChar(this->currentState), this->stateDuration, Weapon::actionToChar(requestedAction));
     634  PRINT(0)("Weapon-Debug %s, state: %s (duration: %fs), nextAction: %s\n", this->getCName(), Weapon::stateToChar(this->currentState), this->stateDuration, Weapon::actionToChar(requestedAction));
    635635  PRINT(0)("Energy: max: %f; current: %f; chargeMin: %f, chargeMax %f\n",
    636636           this->energyMax, this->energy, this->minCharge, this->maxCharge);
  • branches/proxy/src/world_entities/weapons/weapon_manager.cc

    r8844 r9371  
    8383    // NAMING
    8484    char* tmpName;
    85     if (this->getName())
    86     {
    87       tmpName = new char[strlen(this->getName()) + 10];
    88       sprintf(tmpName, "%s_slot%d", this->getName(), i);
     85    if (!this->getName().empty())
     86    {
     87      tmpName = new char[this->getName().size() + 10];
     88      sprintf(tmpName, "%s_slot%d", this->getCName(), i);
    8989    }
    9090    else
     
    265265  if (configID > 0 && slotID > 0 && this->configs[configID][slotID] != NULL)
    266266  {
    267     PRINTF(3)("Weapon-slot %d/%d of %s already poulated, remove weapon (%s::%s) first\n", configID, slotID, this->getName(), weapon->getClassName(), weapon->getName());
     267    PRINTF(3)("Weapon-slot %d/%d of %s already poulated, remove weapon (%s::%s) first\n", configID, slotID, this->getCName(), weapon->getClassCName(), weapon->getCName());
    268268    return false;
    269269  }
     
    302302    weapon->setDefaultTarget(this->crosshair);
    303303  }
    304   PRINTF(3)("Added a new Weapon (%s::%s) to the WeaponManager: config %i/ slot %i\n", weapon->getClassName(), weapon->getName(), configID, slotID);
     304  PRINTF(3)("Added a new Weapon (%s::%s) to the WeaponManager: config %i/ slot %i\n", weapon->getClassCName(), weapon->getCName(), configID, slotID);
    305305  return true;
    306306}
     
    555555    {
    556556      if (this->configs[i][j] != NULL)
    557         PRINT(3)("Slot %d loaded a %s\n", j, this->configs[i][j]->getClassName());
    558     }
    559   }
    560 }
     557        PRINT(3)("Slot %d loaded a %s\n", j, this->configs[i][j]->getClassCName());
     558    }
     559  }
     560}
  • branches/proxy/src/world_entities/world_entity.cc

    r9235 r9371  
    414414bool WorldEntity::registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB)
    415415{
    416   PRINTF(5)("registering collision of type: %s vs %s\n", entityA->getClassName(), entityB->getClassName());
     416  PRINTF(5)("registering collision of type: %s vs %s\n", entityA->getClassCName(), entityB->getClassCName());
    417417  // is there any handler listening?
    418418  if( !this->bReactive)
     
    518518void WorldEntity::collidesWithGround(const Vector& location)
    519519{
    520   PRINTF(0)("BSP_GROUND: %s collides \n", this->getClassName() );
     520  PRINTF(0)("BSP_GROUND: %s collides \n", this->getClassCName() );
    521521}
    522522
     
    676676  if (this->health > this->healthMax)
    677677  {
    678     PRINTF(3)("new maxHealth is bigger as the old health. Did you really intend to do this for (%s::%s)\n", this->getClassName(), this->getName());
     678    PRINTF(3)("new maxHealth is bigger as the old health. Did you really intend to do this for (%s::%s)\n", this->getClassCName(), this->getCName());
    679679    this->health = this->healthMax;
    680680  }
     
    699699  }
    700700  else
    701     PRINTF(3)("Allready created the HealthWidget for %s::%s\n", this->getClassName(), this->getName());
     701    PRINTF(3)("Allready created the HealthWidget for %s::%s\n", this->getClassCName(), this->getCName());
    702702}
    703703
     
    745745  this->decreaseHealth(damage);
    746746
    747   PRINTF(5)("Hit me: %s now only %f/%f health\n", this->getClassName(), this->getHealth(), this->getHealthMax());
     747  PRINTF(5)("Hit me: %s::%s now only %f/%f health\n", this->getClassCName(), this->getCName(), this->getHealth(), this->getHealthMax());
    748748
    749749  if( this->getHealth() > 0)
     
    811811void WorldEntity::debugEntity() const
    812812{
    813   PRINT(0)("WorldEntity %s::%s  (DEBUG)\n", this->getClassName(), this->getName());
     813  PRINT(0)("WorldEntity %s::%s  (DEBUG)\n", this->getClassCName(), this->getCName());
    814814  this->debugNode();
    815815  PRINT(0)("List: %s ; ModelCount %d - ", ObjectManager::OMListToString(this->objectListNumber) , this->models.size());
     
    817817  {
    818818    if (models[i] != NULL)
    819       PRINT(0)(" : %d:%s", i, this->models[i]->getName());
     819      PRINT(0)(" : %d:%s", i, this->models[i]->getCName());
    820820  }
    821821  PRINT(0)("\n");
Note: See TracChangeset for help on using the changeset viewer.