Changeset 9406 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jul 24, 2006, 11:09:47 AM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 58 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/bsp_entity.cc
r9059 r9406 1 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 4 4 Copyright (C) 2004 orx 5 5 6 6 This program is free software; you can redistribute it and/or modify 7 7 it under the terms of the GNU General Public License as published by 8 8 the Free Software Foundation; either version 2, or (at your option) 9 9 any later version. 10 10 11 11 ### File Specific: 12 12 main-programmer: Claudio Botta … … 53 53 54 54 this->bspManager = NULL; 55 55 56 56 this->name_handle = registerVarId( new SynchronizeableString( &this->name, &this->name_write, "name" ) ); 57 57 58 58 this->setSynchronized( true ); 59 59 } … … 63 63 { 64 64 PRINTF(0)("+++++++++++ LOADING NAME %s\n", name.c_str()); 65 65 66 66 this->name = name; 67 67 -
trunk/src/world_entities/camera.cc
r9235 r9406 17 17 #include "camera.h" 18 18 #include "key_mapper.h" 19 #include "glincl.h" 19 20 20 21 /** -
trunk/src/world_entities/character_attributes.cc
r4836 r9406 20 20 #include "stdincl.h" 21 21 22 using namespace std; 22 23 23 24 24 -
trunk/src/world_entities/creatures/fps_player.cc
r9235 r9406 276 276 // if( target != NULL) 277 277 // { 278 // PRINTF(0)("hit hit hit, got: %s\n", target->getClass Name());278 // PRINTF(0)("hit hit hit, got: %s\n", target->getClassCName()); 279 279 // } 280 280 // else … … 287 287 //dealing damage 288 288 289 if ( State::isOnline() && SharedNetworkData::getInstance()->isGameServer())289 if ( State::isOnline() && (SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer())) 290 290 { 291 291 this->damageTicker -= time; … … 299 299 if ( victim ) 300 300 { 301 PRINTF(0)("FIRE: hit %s\n", victim->getClass Name());301 PRINTF(0)("FIRE: hit %s\n", victim->getClassCName()); 302 302 victim->hit( 20, this ); 303 303 } -
trunk/src/world_entities/effects/billboard.cc
r8495 r9406 24 24 25 25 26 using namespace std; 26 27 27 28 28 -
trunk/src/world_entities/effects/explosion.cc
r9235 r9406 27 27 28 28 29 using namespace std; 29 30 30 31 31 CREATE_FAST_FACTORY_STATIC(Explosion, CL_EXPLOSION); -
trunk/src/world_entities/effects/lightning_bolt.cc
r8793 r9406 24 24 25 25 26 using namespace std; 26 27 27 28 28 CREATE_FACTORY(LightningBolt, CL_LIGHTNING_BOLT); -
trunk/src/world_entities/elements/glgui_energywidget.cc
r9014 r9406 17 17 18 18 #include "glgui_energywidget.h" 19 20 #include "multi_type.h" 19 21 20 22 namespace OrxGui -
trunk/src/world_entities/elements/image_entity.cc
r7751 r9406 27 27 28 28 29 using namespace std; 29 30 30 31 31 -
trunk/src/world_entities/elements/text_element.cc
r7221 r9406 25 25 26 26 27 using namespace std; 27 28 28 29 29 -
trunk/src/world_entities/environment.cc
r7711 r9406 27 27 #include "util/loading/factory.h" 28 28 29 using namespace std; 29 30 30 CREATE_FACTORY(Environment, CL_ENVIRONMENT); 31 31 -
trunk/src/world_entities/environments/building.cc
r7193 r9406 21 21 #include "util/loading/factory.h" 22 22 23 using namespace std; 23 24 24 25 25 -
trunk/src/world_entities/environments/mapped_water.cc
r9235 r9406 374 374 waterColorR->setValue(this->waterColor.x); 375 375 waterColorR->setStep(0.1f); 376 waterColorR-> connect(SIGNAL(waterColorR, valueChanged), this, SLOT(MappedWater, resetWaterColorR));376 waterColorR->valueChanged.connect(this, &MappedWater::resetWaterColorR); 377 377 waterColorBox->pack(waterColorR); 378 378 … … 381 381 waterColorG->setStep(0.1f); 382 382 waterColorG->setValue(this->waterColor.y); 383 waterColorG-> connect(SIGNAL(waterColorG, valueChanged), this, SLOT(MappedWater, resetWaterColorG));383 waterColorG->valueChanged.connect(this, &MappedWater::resetWaterColorG); 384 384 waterColorBox->pack(waterColorG); 385 385 … … 388 388 waterColorB->setStep(0.1f); 389 389 waterColorB->setValue(this->waterColor.z); 390 waterColorB-> connect(SIGNAL(waterColorB, valueChanged), this, SLOT(MappedWater, resetWaterColorB));390 waterColorB->valueChanged.connect(this, &MappedWater::resetWaterColorB); 391 391 waterColorBox->pack(waterColorB); 392 392 } … … 403 403 waterUV->setValue(this->waterUV); 404 404 waterUV->setStep(1); 405 waterUV-> connect(SIGNAL(waterUV, valueChanged), this, SLOT(MappedWater, setWaterUV));405 waterUV->valueChanged.connect(this, &MappedWater::setWaterUV); 406 406 waterUVBox->pack(waterUV); 407 407 } … … 418 418 waterFlow->setValue(this->waterFlow); 419 419 waterFlow->setStep(0.02f); 420 waterFlow-> connect(SIGNAL(waterFlow, valueChanged), this, SLOT(MappedWater, setWaterFlow));420 waterFlow->valueChanged.connect(this, &MappedWater::setWaterFlow); 421 421 waterFlowBox->pack(waterFlow); 422 422 } … … 433 433 shineSize->setValue(this->shineSize); 434 434 shineSize->setStep(1); 435 shineSize-> connect(SIGNAL(shineSize, valueChanged), this, SLOT(MappedWater, resetShineSize));435 shineSize->valueChanged.connect(this, &MappedWater::resetShineSize); 436 436 shineSizeBox->pack(shineSize); 437 437 } … … 448 448 shineStrength->setValue(this->shineStrength); 449 449 shineStrength->setStep(0.1f); 450 shineStrength-> connect(SIGNAL(shineStrength, valueChanged), this, SLOT(MappedWater, resetShineStrength));450 shineStrength->valueChanged.connect(this, &MappedWater::resetShineStrength); 451 451 shineStrengthBox->pack(shineStrength); 452 452 } … … 463 463 reflStrength->setValue(this->reflStrength); 464 464 reflStrength->setStep(0.1f); 465 reflStrength-> connect(SIGNAL(reflStrength, valueChanged), this, SLOT(MappedWater, resetReflStrength));465 reflStrength->valueChanged.connect(this, &MappedWater::resetReflStrength); 466 466 reflStrengthBox->pack(reflStrength); 467 467 } … … 478 478 refraction->setValue(this->refraction); 479 479 refraction->setStep(0.004f); 480 refraction-> connect(SIGNAL(refraction, valueChanged), this, SLOT(MappedWater, resetRefraction));480 refraction->valueChanged.connect(this, &MappedWater::resetRefraction); 481 481 refractionBox->pack(refraction); 482 482 } … … 493 493 lightPosX->setValue(this->lightPos.x); 494 494 lightPosX->setStep(15); 495 lightPosX-> connect(SIGNAL(lightPosX, valueChanged), this, SLOT(MappedWater, resetLightPosX));495 lightPosX->valueChanged.connect(this, &MappedWater::resetLightPosX); 496 496 lightPosBox->pack(lightPosX); 497 497 … … 500 500 lightPosY->setStep(15); 501 501 lightPosY->setValue(this->lightPos.y); 502 lightPosY-> connect(SIGNAL(lightPosY, valueChanged), this, SLOT(MappedWater, resetLightPosY));502 lightPosY->valueChanged.connect(this, &MappedWater::resetLightPosY); 503 503 lightPosBox->pack(lightPosY); 504 504 … … 507 507 lightPosZ->setStep(15); 508 508 lightPosZ->setValue(this->lightPos.z); 509 lightPosZ-> connect(SIGNAL(lightPosZ, valueChanged), this, SLOT(MappedWater, resetLightPosZ));509 lightPosZ->valueChanged.connect(this, &MappedWater::resetLightPosZ); 510 510 lightPosBox->pack(lightPosZ); 511 511 } … … 522 522 waterHeight->setValue(this->waterHeight); 523 523 waterHeight->setStep(4); 524 waterHeight-> connect(SIGNAL(waterHeight, valueChanged), this, SLOT(MappedWater, setWaterHeight));524 waterHeight->valueChanged.connect(this, &MappedWater::setWaterHeight); 525 525 waterHeightBox->pack(waterHeight); 526 526 } -
trunk/src/world_entities/environments/model_entity.cc
r9235 r9406 21 21 #include "util/loading/factory.h" 22 22 23 using namespace std; 23 24 24 25 25 -
trunk/src/world_entities/environments/water.cc
r7954 r9406 32 32 #include "network_game_manager.h" 33 33 34 using namespace std; 34 35 35 36 36 CREATE_FACTORY(Water, CL_WATER); -
trunk/src/world_entities/items/item_container.cc
r6655 r9406 18 18 #include "item_container.h" 19 19 20 using namespace std; 20 21 21 22 22 -
trunk/src/world_entities/movie_entity.cc
r8310 r9406 20 20 #include "util/loading/factory.h" 21 21 22 using namespace std; 22 23 23 24 24 CREATE_FACTORY(MovieEntity, CL_MOVIE_ENTITY); -
trunk/src/world_entities/npcs/door.cc
r9110 r9406 28 28 29 29 30 using namespace std; 30 31 31 32 32 -
trunk/src/world_entities/npcs/gate.cc
r9298 r9406 31 31 32 32 33 using namespace std; 33 34 34 35 35 -
trunk/src/world_entities/npcs/ground_turret.cc
r9235 r9406 31 31 CREATE_FACTORY(GroundTurret, CL_GROUND_TURRET); 32 32 33 using namespace std; 33 34 34 35 35 -
trunk/src/world_entities/npcs/repair_station.cc
r9003 r9406 28 28 29 29 30 using namespace std; 30 31 31 32 32 -
trunk/src/world_entities/planet.cc
r7919 r9406 30 30 #include "primitive_model.h" 31 31 32 using namespace std; 32 33 33 34 34 -
trunk/src/world_entities/playable.cc
r9235 r9406 148 148 if (weapon != NULL) 149 149 PRINTF(2)("Unable to add Weapon (%s::%s) to %s::%s\n", 150 weapon->getClass Name(), weapon->getName(), this->getClassName(), this->getName());150 weapon->getClassCName(), weapon->getCName(), this->getClassCName(), this->getCName()); 151 151 else 152 152 PRINTF(2)("No weapon defined\n"); … … 361 361 } 362 362 } 363 /**364 * @brief helps us colliding Playables365 * @param entity the Entity to collide366 * @param location where the collision occured.367 */368 void Playable::collidesWith(WorldEntity* entity, const Vector& location)369 {370 if (entity == collider)371 return;372 collider = entity;373 374 if ( entity->isA(CL_PROJECTILE) && ( !State::isOnline() || SharedNetworkData::getInstance()->isGameServer() ) )375 {376 this->decreaseHealth(entity->getHealth() *(float)rand()/(float)RAND_MAX);377 // EXTREME HACK378 if (this->getHealth() <= 0.0f)379 {380 // this->destory();381 382 if( State::getGameRules() != NULL)383 State::getGameRules()->registerKill(Kill(entity, this));384 }385 }386 }387 363 388 364 … … 413 389 } 414 390 this->bDead = true; 415 391 416 392 if( State::getGameRules() != NULL) 417 393 State::getGameRules()->registerKill(Kill(killer, this)); -
trunk/src/world_entities/playable.h
r9235 r9406 82 82 virtual void destroy(WorldEntity* killer); 83 83 virtual void respawn(); 84 virtual void collidesWith(WorldEntity* entity, const Vector& location);85 84 virtual void process(const Event &event); 86 85 virtual void tick(float dt); … … 90 89 static const std::string& playmodeToString(Playable::Playmode playmode); 91 90 static const std::string playmodeNames[]; 92 91 93 92 inline bool beFire(){ return this->bFire; } 94 93 inline void fire(bool bF){ this->bFire = bF;} -
trunk/src/world_entities/power_ups/laser_power_up.cc
r7954 r9406 23 23 #include "primitive_model.h" 24 24 25 using namespace std; 25 26 26 27 27 CREATE_FACTORY(LaserPowerUp, CL_LASER_POWER_UP); … … 78 78 void LaserPowerUp::collidesWith(WorldEntity* entity, const Vector& location) 79 79 { 80 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClass Name(), entity->getClassName(), location.x, location.y, location.z);80 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassCName(), entity->getClassCName(), location.x, location.y, location.z); 81 81 if (entity->isA(CL_PLAYABLE)) 82 82 this->toList(OM_DEAD); -
trunk/src/world_entities/power_ups/param_power_up.cc
r7954 r9406 26 26 #include "network_game_manager.h" 27 27 28 using namespace std; 28 29 29 30 30 CREATE_FACTORY(ParamPowerUp, CL_PARAM_POWER_UP); -
trunk/src/world_entities/power_ups/power_up.cc
r8350 r9406 24 24 #include "util/loading/load_param.h" 25 25 26 using namespace std; 26 27 27 28 28 PowerUp::PowerUp(float r, float g, float b) … … 85 85 if (this->pickupBuffer != NULL) 86 86 { 87 PRINTF(4)("Loaded sound %s to Pickup: %s.\n", pickupSound.c_str(), this->get Name());87 PRINTF(4)("Loaded sound %s to Pickup: %s.\n", pickupSound.c_str(), this->getCName()); 88 88 } 89 89 else 90 90 { 91 PRINTF(2)("Failed to load sound %s to pickup %s.\n.", pickupSound.c_str(), this->get Name());91 PRINTF(2)("Failed to load sound %s to pickup %s.\n.", pickupSound.c_str(), this->getCName()); 92 92 } 93 93 } … … 106 106 if (this->respawnBuffer != NULL) 107 107 { 108 PRINTF(4)("Loaded sound %s to Pickup: %s.\n", respawnSound.c_str(), this->get Name());108 PRINTF(4)("Loaded sound %s to Pickup: %s.\n", respawnSound.c_str(), this->getCName()); 109 109 } 110 110 else 111 111 { 112 PRINTF(2)("Failed to load sound %s to respawn %s.\n.", respawnSound.c_str(), this->get Name());112 PRINTF(2)("Failed to load sound %s to respawn %s.\n.", respawnSound.c_str(), this->getCName()); 113 113 } 114 114 } -
trunk/src/world_entities/power_ups/turret_power_up.cc
r7954 r9406 23 23 #include "primitive_model.h" 24 24 25 using namespace std; 25 26 26 27 27 CREATE_FACTORY(TurretPowerUp, CL_TURRET_POWER_UP); … … 74 74 void TurretPowerUp::collidesWith(WorldEntity* entity, const Vector& location) 75 75 { 76 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClass Name(), entity->getClassName(), location.x, location.y, location.z);76 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassCName(), entity->getClassCName(), location.x, location.y, location.z); 77 77 if (entity->isA(CL_PLAYABLE)) 78 78 this->toList(OM_DEAD); -
trunk/src/world_entities/power_ups/weapon_power_up.cc
r7954 r9406 26 26 #include "util/loading/load_param.h" 27 27 28 using namespace std; 28 29 29 30 30 CREATE_FACTORY(WeaponPowerUp, CL_WEAPON_POWER_UP); -
trunk/src/world_entities/projectiles/laser.cc
r9235 r9406 28 28 #include "debug.h" 29 29 30 using namespace std; 30 31 31 32 32 CREATE_FAST_FACTORY_STATIC(Laser, CL_LASER); -
trunk/src/world_entities/projectiles/projectile.cc
r9235 r9406 75 75 if (this->explosionBuffer != NULL) 76 76 { 77 PRINTF(4)("Loaded sound %s to Pickup: %s.\n", explosionSound.c_str(), this->get Name());77 PRINTF(4)("Loaded sound %s to Pickup: %s.\n", explosionSound.c_str(), this->getCName()); 78 78 } 79 79 else 80 80 { 81 PRINTF(2)("Failed to load sound %s to explosion %s.\n.", explosionSound.c_str(), this->get Name());81 PRINTF(2)("Failed to load sound %s to explosion %s.\n.", explosionSound.c_str(), this->getCName()); 82 82 } 83 83 } … … 97 97 if (this->engineBuffer != NULL) 98 98 { 99 PRINTF(4)("Loaded sound %s to Pickup: %s.\n", engineSound.c_str(), this->get Name());99 PRINTF(4)("Loaded sound %s to Pickup: %s.\n", engineSound.c_str(), this->getCName()); 100 100 } 101 101 else 102 102 { 103 PRINTF(2)("Failed to load sound %s to engine %s.\n.", engineSound.c_str(), this->get Name());103 PRINTF(2)("Failed to load sound %s to engine %s.\n.", engineSound.c_str(), this->getCName()); 104 104 } 105 105 } -
trunk/src/world_entities/projectiles/rail_projectile.cc
r9235 r9406 28 28 #include "debug.h" 29 29 30 using namespace std; 30 31 31 32 32 CREATE_FAST_FACTORY_STATIC(RailProjectile, CL_RAIL_PROJECTILE); -
trunk/src/world_entities/recorder.cc
r7221 r9406 21 21 #include "state.h" 22 22 23 using namespace std; 23 24 24 25 25 CREATE_FACTORY(Recorder, CL_RECORDER); -
trunk/src/world_entities/satellite.cc
r6222 r9406 24 24 25 25 26 using namespace std; 26 27 27 28 28 /** -
trunk/src/world_entities/script_trigger.cc
r9298 r9406 63 63 addToScript = false; 64 64 this->activeOnCreation = false; 65 65 66 66 if(root != NULL) 67 67 { 68 68 69 69 loadParams(root); 70 70 71 71 if(addToScript && scriptIsOk) 72 72 { 73 73 script->addObject( "ScriptTrigger", this->getName()); 74 74 } 75 76 } 77 75 76 } 77 78 78 } 79 79 80 80 /** 81 81 * Deletes the ScriptTrigger. 82 * 82 * 83 83 */ 84 84 ScriptTrigger::~ScriptTrigger() … … 147 147 else 148 148 { 149 PRINTF(2)("Target %s for %s::%s does not Exist\n", target.c_str(), this->getClass Name(), this->getName());149 PRINTF(2)("Target %s for %s::%s does not Exist\n", target.c_str(), this->getClassCName(), this->getCName()); 150 150 } 151 151 } … … 153 153 /** 154 154 * Sets the parent of the trigger. 155 * @param parent The parrent. 155 * @param parent The parrent. 156 156 */ 157 157 void ScriptTrigger::setTriggerParent(const std::string& parent) … … 166 166 else 167 167 { 168 PRINTF(2)("Parent %s for %s::%s does not Exist\n", parent.c_str(), this->getClass Name(), this->getName());168 PRINTF(2)("Parent %s for %s::%s does not Exist\n", parent.c_str(), this->getClassCName(), this->getCName()); 169 169 } 170 170 } … … 179 179 return; 180 180 } 181 181 182 182 if(triggerRemains && scriptCalled) 183 183 { … … 185 185 return; 186 186 } 187 187 188 188 if( !invert && this->distance(target) < radius) 189 189 { … … 191 191 scriptCalled = true; 192 192 return; 193 193 194 194 } 195 195 else if( invert && this->distance(target) > radius) 196 196 { 197 executeAction(timestep); 197 executeAction(timestep); 198 198 scriptCalled = true; 199 199 return; … … 207 207 void ScriptTrigger::executeAction(float timestep) 208 208 { 209 209 210 210 if(scriptIsOk) 211 211 { … … 213 213 if(!(script->selectFunction(this->functionName,returnCount)) ) 214 214 PRINT(1)("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str()); 215 215 216 216 script->pushParam( timestep, this->functionName); 217 217 218 218 if( !(script->executeFunction()) ) 219 219 PRINT(1)("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str()); 220 220 221 221 scriptFinished = script->getReturnedBool(); 222 222 } 223 224 223 224 225 225 } 226 226 … … 268 268 float retf = script->getReturnedFloat(); 269 269 printf("main returned %f\n",retf); 270 270 271 271 272 272 printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState())); -
trunk/src/world_entities/skybox.cc
r8037 r9406 30 30 31 31 32 using namespace std; 32 33 33 34 34 CREATE_FACTORY(SkyBox, CL_SKYBOX); -
trunk/src/world_entities/skydome.cc
r9235 r9406 28 28 #define SQR(x) (x*x) 29 29 30 using namespace std; 30 31 31 32 32 -
trunk/src/world_entities/skysphere.cc
r7840 r9406 33 33 34 34 35 using namespace std; 35 36 36 37 37 /** -
trunk/src/world_entities/space_ships/collision_probe.cc
r8724 r9406 24 24 25 25 26 using namespace std; 26 27 27 28 28 CREATE_FACTORY(CollisionProbe, CL_COLLISION_PROBE); -
trunk/src/world_entities/space_ships/space_ship.cc
r9235 r9406 52 52 53 53 54 using namespace std; 54 55 55 56 56 CREATE_FACTORY(SpaceShip, CL_SPACE_SHIP); … … 314 314 if( entity->isA(CL_PROJECTILE) && entity != ref) 315 315 { 316 if ( isServer())316 if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer()) 317 317 { 318 318 //TODO handle this 319 319 } 320 320 } 321 PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClass Name(), 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); 322 322 } 323 323 -
trunk/src/world_entities/space_ships/spacecraft_2d.cc
r9298 r9406 324 324 325 325 default: 326 PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClass Name());326 PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassCName()); 327 327 } 328 328 } … … 474 474 475 475 default: 476 PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClass Name());476 PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassCName()); 477 477 } 478 478 } -
trunk/src/world_entities/spawning_point.cc
r9235 r9406 31 31 #include "shared_network_data.h" 32 32 33 34 /// TODO REMOVE converter.h 35 #include "converter.h" 36 33 37 CREATE_FACTORY( SpawningPoint, CL_SPAWNING_POINT ); 34 38 … … 41 45 42 46 this->init(); 43 47 44 48 if (root != NULL) 45 49 this->loadParams(root); … … 50 54 this->setClassID(CL_SPAWNING_POINT, "SpawningPoint"); 51 55 PRINTF(0)("Created SpawningPoint\n"); 52 56 53 57 this->teamId = -1; 54 58 this->localTimer = 0.0f; 55 59 56 60 this->toList( OM_DEAD_TICK ); 57 61 58 62 MessageManager::getInstance()->registerMessageHandler( MSGID_RESPAWN, respawnMessageHandler, NULL ); 59 63 60 64 this->setSynchronized( true ); 61 65 } … … 94 98 qe.entity = entity; 95 99 qe.respawnTime = this->localTimer + delay; 96 100 97 101 queue.push_back( qe ); 98 102 } … … 105 109 { 106 110 const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE ); 107 111 108 112 bool found = false; 109 113 110 114 if ( !list ) 111 115 return; 112 116 113 117 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 114 118 { … … 119 123 } 120 124 } 121 125 122 126 if ( !found ) 123 127 return; 124 128 125 PRINTF(0)("Spawningpoint spawns Entity (%s)\n", entity->getClass Name());129 PRINTF(0)("Spawningpoint spawns Entity (%s)\n", entity->getClassCName()); 126 130 127 131 128 132 entity->setAbsCoor( this->getAbsCoor() ); 129 133 entity->setAbsDir( this->getAbsDir() ); 130 134 131 135 //TODO set camera (not smooth) 132 136 133 137 if ( State::getGameRules() ) 134 138 { 135 139 (State::getGameRules())->registerSpawn( entity ); 136 140 } 137 141 138 142 entity->respawn(); 139 143 } … … 157 161 //spawn the player 158 162 this->spawn(it->entity); 159 163 160 164 const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE ); 161 165 162 166 bool found = false; 163 167 164 168 if ( !list ) 165 169 return; 166 170 167 171 for ( std::list<BaseObject*>::const_iterator it2 = list->begin(); it2 != list->end(); it2++ ) 168 172 { … … 173 177 } 174 178 } 175 176 if ( found && SharedNetworkData::getInstance()->is GameServer())179 180 if ( found && SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer()) 177 181 this->sendRespawnMessage( it->entity->getUniqueID() ); 178 182 179 183 std::list<QueueEntry>::iterator delit = it; 180 184 it++; 181 185 182 186 queue.erase( delit ); 183 187 184 188 continue; 185 189 } 186 190 187 191 it++; 188 192 } … … 203 207 void SpawningPoint::sendRespawnMessage( int uniqueId ) 204 208 { 209 #warning this byte array is not being deleted according to valginrd 205 210 byte * buf = new byte[2*INTSIZE]; 206 211 207 212 assert( Converter::intToByteArray( this->getUniqueID(), buf, INTSIZE ) == INTSIZE ); 208 213 assert( Converter::intToByteArray( uniqueId, buf + INTSIZE, INTSIZE ) == INTSIZE ); 209 214 210 215 MessageManager::getInstance()->sendMessage( MSGID_RESPAWN, buf, 2*INTSIZE, RT_ALL_NOT_ME, 0, MP_HIGHBANDWIDTH ); 211 216 } … … 213 218 bool SpawningPoint::respawnMessageHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId ) 214 219 { 215 if ( SharedNetworkData::getInstance()->is GameServer())220 if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer()) 216 221 { 217 222 PRINTF(2)("server received spawn message!\n"); 218 223 return true; 219 224 } 220 225 221 226 int spUniqueId; 222 227 int uniqueId; 223 228 224 229 if ( dataLength != 2*INTSIZE ) 225 230 { … … 227 232 return true; 228 233 } 229 234 230 235 assert( Converter::byteArrayToInt( data, &spUniqueId ) == INTSIZE ); 231 236 assert( Converter::byteArrayToInt( data+INTSIZE, &uniqueId ) == INTSIZE ); 232 237 233 238 PRINTF(0)("SPAWNMESSAGE %d\n", uniqueId); 234 239 235 240 SpawningPoint * sp = NULL; 236 241 Playable * playable = NULL; 237 242 238 243 const std::list<BaseObject*> * list = ClassList::getList( CL_SPAWNING_POINT ); 239 244 240 245 if ( list ) 241 246 { … … 250 255 } 251 256 } 252 257 253 258 if ( !sp ) 254 259 { … … 256 261 return false; 257 262 } 258 263 259 264 list = ClassList::getList( CL_PLAYABLE ); 260 265 261 266 if ( list ) 262 267 { … … 270 275 } 271 276 } 272 277 273 278 if ( !playable ) 274 279 { … … 276 281 return false; 277 282 } 278 283 279 284 sp->spawn( playable ); 280 285 281 286 return true; 282 287 } -
trunk/src/world_entities/spectator.cc
r8708 r9406 25 25 26 26 27 using namespace std; 27 28 28 29 29 -
trunk/src/world_entities/terrain.cc
r8316 r9406 33 33 #include "state.h" 34 34 35 using namespace std; 35 36 36 37 37 CREATE_FACTORY(Terrain, CL_TERRAIN); -
trunk/src/world_entities/test_entity.cc
r9235 r9406 33 33 #include "state.h" 34 34 35 using namespace std; 35 36 36 37 37 -
trunk/src/world_entities/weapons/aim.cc
r7370 r9406 27 27 #include "world_entity.h" 28 28 29 using namespace std; 29 30 30 31 31 -
trunk/src/world_entities/weapons/aiming_system.cc
r9298 r9406 28 28 29 29 30 using namespace std; 30 31 31 32 32 … … 91 91 92 92 93 for( int i = 0; i < this->selectionList.size(); i++)93 for(unsigned int i = 0; i < this->selectionList.size(); i++) 94 94 { 95 95 distance = fabs((this->getAbsCoor() - this->selectionList[i]->getAbsCoor()).len()); … … 101 101 } 102 102 103 PRINTF(0)("entity: %s\n", nearestEntity->getClass Name());103 PRINTF(0)("entity: %s\n", nearestEntity->getClassCName()); 104 104 return nearestEntity; 105 105 } … … 115 115 if( this->owner != killer) 116 116 { 117 //PRINTF(0)("real hit: %s\n", killer->getClass Name());117 //PRINTF(0)("real hit: %s\n", killer->getClassCName()); 118 118 this->selectionList.push_back(killer); 119 119 } -
trunk/src/world_entities/weapons/aiming_turret.cc
r8777 r9406 29 29 CREATE_FACTORY(AimingTurret, CL_AIMING_TURRET); 30 30 31 using namespace std; 31 32 32 33 33 -
trunk/src/world_entities/weapons/ammo_container.cc
r6846 r9406 22 22 #include <assert.h> 23 23 24 using namespace std; 24 25 25 26 26 /** -
trunk/src/world_entities/weapons/cannon.cc
r8777 r9406 35 35 36 36 37 using namespace std; 37 38 38 39 39 CREATE_FACTORY(Cannon, CL_CANNON); -
trunk/src/world_entities/weapons/crosshair.cc
r7868 r9406 24 24 #include "material.h" 25 25 26 using namespace std; 26 27 27 28 28 -
trunk/src/world_entities/weapons/fps_sniper_rifle.cc
r9235 r9406 36 36 #include "effects/explosion.h" 37 37 38 using namespace std; 38 39 39 40 40 -
trunk/src/world_entities/weapons/hyperblaster.cc
r8777 r9406 34 34 35 35 36 using namespace std; 36 37 37 38 38 CREATE_FACTORY(Hyperblaster, CL_HYPERBLASTER); -
trunk/src/world_entities/weapons/targeting_turret.cc
r8777 r9406 29 29 CREATE_FACTORY(TargetingTurret, CL_TARGETING_TURRET); 30 30 31 using namespace std; 31 32 32 33 33 -
trunk/src/world_entities/weapons/turret.cc
r8777 r9406 29 29 CREATE_FACTORY(Turret, CL_TURRET); 30 30 31 using namespace std; 31 32 32 33 33 /** -
trunk/src/world_entities/weapons/weapon.cc
r8977 r9406 36 36 #include "elements/glgui_energywidget.h" 37 37 38 using namespace std; 38 39 39 40 40 //////////////////// … … 199 199 else 200 200 { 201 PRINTF(1)("Projectile %s does not exist for weapon %s\n", projectile.c_str(), this->get Name());201 PRINTF(1)("Projectile %s does not exist for weapon %s\n", projectile.c_str(), this->getCName()); 202 202 } 203 203 } … … 213 213 projectileFactory->prepare(count); 214 214 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()); 216 216 } 217 217 … … 234 234 else 235 235 { 236 PRINTF(2)("No projectile defined for Weapon %s(%s) can't return any\n", this->get Name(), this->getClassName());236 PRINTF(2)("No projectile defined for Weapon %s(%s) can't return any\n", this->getCName(), this->getClassCName()); 237 237 return NULL; 238 238 } … … 313 313 { 314 314 this->energyWidget = new OrxGui::GLGuiEnergyWidget(); 315 this->energyWidget->setDisplayedName(this->getClass Name());315 this->energyWidget->setDisplayedName(this->getClassCName()); 316 316 this->energyWidget->setSize2D( 20, 100); 317 317 this->energyWidget->setMaximum(this->getEnergyMax()); … … 442 442 this->updateWidgets(); 443 443 // activate 444 PRINTF(4)("Activating the Weapon %s\n", this->get Name());444 PRINTF(4)("Activating the Weapon %s\n", this->getCName()); 445 445 this->activate(); 446 446 // setting up for next action … … 458 458 // if (this->currentState != WS_INACTIVE) 459 459 { 460 PRINTF(4)("Deactivating the Weapon %s\n", this->get Name());460 PRINTF(4)("Deactivating the Weapon %s\n", this->getCName()); 461 461 // play Sound 462 462 if (this->soundBuffers[WA_DEACTIVATE] != NULL) … … 527 527 bool Weapon::reloadW() 528 528 { 529 PRINTF(4)("Reloading Weapon %s\n", this->get Name());529 PRINTF(4)("Reloading Weapon %s\n", this->getCName()); 530 530 if (this->ammoContainer.get() != NULL && 531 531 unlikely(this->energy + this->ammoContainer->getStoredEnergy() < this->minCharge)) … … 632 632 void Weapon::debug() const 633 633 { 634 PRINT(0)("Weapon-Debug %s, state: %s (duration: %fs), nextAction: %s\n", this->get Name(), 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)); 635 635 PRINT(0)("Energy: max: %f; current: %f; chargeMin: %f, chargeMax %f\n", 636 636 this->energyMax, this->energy, this->minCharge, this->maxCharge); -
trunk/src/world_entities/weapons/weapon_manager.cc
r8844 r9406 83 83 // NAMING 84 84 char* tmpName; 85 if ( this->getName())86 { 87 tmpName = new char[ strlen(this->getName()) + 10];88 sprintf(tmpName, "%s_slot%d", this->get Name(), i);85 if (!this->getName().empty()) 86 { 87 tmpName = new char[this->getName().size() + 10]; 88 sprintf(tmpName, "%s_slot%d", this->getCName(), i); 89 89 } 90 90 else … … 265 265 if (configID > 0 && slotID > 0 && this->configs[configID][slotID] != NULL) 266 266 { 267 PRINTF(3)("Weapon-slot %d/%d of %s already poulated, remove weapon (%s::%s) first\n", configID, slotID, this->get Name(), 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()); 268 268 return false; 269 269 } … … 302 302 weapon->setDefaultTarget(this->crosshair); 303 303 } 304 PRINTF(3)("Added a new Weapon (%s::%s) to the WeaponManager: config %i/ slot %i\n", weapon->getClass Name(), 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); 305 305 return true; 306 306 } … … 555 555 { 556 556 if (this->configs[i][j] != NULL) 557 PRINT(3)("Slot %d loaded a %s\n", j, this->configs[i][j]->getClass Name());558 } 559 } 560 } 557 PRINT(3)("Slot %d loaded a %s\n", j, this->configs[i][j]->getClassCName()); 558 } 559 } 560 } -
trunk/src/world_entities/world_entity.cc
r9235 r9406 414 414 bool WorldEntity::registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB) 415 415 { 416 PRINTF(5)("registering collision of type: %s vs %s\n", entityA->getClass Name(), entityB->getClassName());416 PRINTF(5)("registering collision of type: %s vs %s\n", entityA->getClassCName(), entityB->getClassCName()); 417 417 // is there any handler listening? 418 418 if( !this->bReactive) … … 506 506 * You can always define a default Action.... don't be affraid just test it :) 507 507 */ 508 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClass Name(), entity->getClassName(), location.x, location.y, location.z);508 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassCName(), entity->getClassCName(), location.x, location.y, location.z); 509 509 } 510 510 … … 518 518 void WorldEntity::collidesWithGround(const Vector& location) 519 519 { 520 PRINTF(0)("BSP_GROUND: %s collides \n", this->getClass Name() );520 PRINTF(0)("BSP_GROUND: %s collides \n", this->getClassCName() ); 521 521 } 522 522 … … 524 524 { 525 525 526 // PRINTF(0)("BSP_GROUND: Player collides \n", this->getClass Name() );526 // PRINTF(0)("BSP_GROUND: Player collides \n", this->getClassCName() ); 527 527 528 528 Vector v = this->getAbsDirX(); … … 594 594 void WorldEntity::draw() const 595 595 { 596 //PRINTF(0)("(%s::%s)\n", this->getClass Name(), this->getName());596 //PRINTF(0)("(%s::%s)\n", this->getClassCName(), this->getName()); 597 597 // assert(!unlikely(this->models.empty())); 598 598 { … … 676 676 if (this->health > this->healthMax) 677 677 { 678 PRINTF(3)("new maxHealth is bigger as the old health. Did you really intend to do this for (%s::%s)\n", this->getClass Name(), 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()); 679 679 this->health = this->healthMax; 680 680 } … … 699 699 } 700 700 else 701 PRINTF(3)("Allready created the HealthWidget for %s::%s\n", this->getClass Name(), this->getName());701 PRINTF(3)("Allready created the HealthWidget for %s::%s\n", this->getClassCName(), this->getCName()); 702 702 } 703 703 … … 745 745 this->decreaseHealth(damage); 746 746 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()); 748 748 749 749 if( this->getHealth() > 0) … … 811 811 void WorldEntity::debugEntity() const 812 812 { 813 PRINT(0)("WorldEntity %s::%s (DEBUG)\n", this->getClass Name(), this->getName());813 PRINT(0)("WorldEntity %s::%s (DEBUG)\n", this->getClassCName(), this->getCName()); 814 814 this->debugNode(); 815 815 PRINT(0)("List: %s ; ModelCount %d - ", ObjectManager::OMListToString(this->objectListNumber) , this->models.size()); … … 817 817 { 818 818 if (models[i] != NULL) 819 PRINT(0)(" : %d:%s", i, this->models[i]->get Name());819 PRINT(0)(" : %d:%s", i, this->models[i]->getCName()); 820 820 } 821 821 PRINT(0)("\n");
Note: See TracChangeset
for help on using the changeset viewer.