Changeset 2501
- Timestamp:
- Dec 17, 2008, 9:11:12 AM (16 years ago)
- Location:
- code/branches/presentation/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/network/packet/Gamestate.cc
r2490 r2501 175 175 COUT(0) << "Found object with OBJECTID_UNKNOWN on the client with objectMode != 0x0!" << std::endl; 176 176 COUT(0) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << std::endl; 177 COUT(0) << "Objects class: " << it->getIdentifier()->getName() << std::endl; 177 178 assert(false); 178 179 } -
code/branches/presentation/src/orxonox/objects/GlobalShader.cc
r2485 r2501 45 45 if (!this->getScene()) 46 46 ThrowException(AbortLoading, "Can't create GlobalShader, no scene given."); 47 if (!this->getScene()->getSceneManager())48 ThrowException(AbortLoading, "Can't create GlobalShader, no scene manager given.");47 // if (!this->getScene()->getSceneManager()) 48 // ThrowException(AbortLoading, "Can't create GlobalShader, no scene manager given."); 49 49 50 this->shader_.setSceneManager(this->getScene()->getSceneManager()); 50 if (this->getScene()->getSceneManager()) 51 this->shader_.setSceneManager(this->getScene()->getSceneManager()); 51 52 52 53 this->registerVariables(); -
code/branches/presentation/src/orxonox/objects/gametypes/Gametype.cc
r2495 r2501 69 69 this->addBots(this->numberOfBots_); 70 70 71 setConfigValues();72 73 71 // load the corresponding score board 74 72 if (Core::showsGraphics() && this->scoreboardTemplate_ != "") -
code/branches/presentation/src/orxonox/objects/weaponSystem/Weapon.cc
r2493 r2501 50 50 this->magazineLoadingTime_ = 0; 51 51 this->bReloading_ = false; 52 53 this->setObjectMode(0x0); 52 54 } 53 55 -
code/branches/presentation/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc
r2497 r2501 54 54 55 55 // Get notification about collisions 56 this->enableCollisionCallback();57 56 58 this->setCollisionType(Kinematic); 57 if (Core::isMaster()) 58 { 59 this->enableCollisionCallback(); 59 60 60 SphereCollisionShape* shape = new SphereCollisionShape(this); 61 shape->setRadius(10); 62 this->attachCollisionShape(shape); 61 this->setCollisionType(Kinematic); 63 62 64 if(Core::isMaster()) 65 this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject))); 63 SphereCollisionShape* shape = new SphereCollisionShape(this); 64 shape->setRadius(10); 65 this->attachCollisionShape(shape); 66 67 this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject))); 68 } 66 69 } 67 70 -
code/branches/presentation/src/orxonox/objects/worldentities/WorldEntity.cc
r2497 r2501 545 545 if (type != None && this->collisionType_ == None) 546 546 { 547 /* 547 548 // Check whether there was some scaling applied. 548 549 if (!this->node_->getScale().positionEquals(Vector3(1, 1, 1), 0.001)) … … 551 552 return; 552 553 } 553 554 */ 554 555 // Create new rigid body 555 556 btRigidBody::btRigidBodyConstructionInfo bodyConstructionInfo(0, this, this->collisionShape_->getCollisionShape()); -
code/branches/presentation/src/orxonox/objects/worldentities/pawns/Pawn.cc
r2500 r2501 49 49 50 50 PawnManager::touch(); 51 this->getPickUp().setPlayer(this);52 51 this->bAlive_ = true; 53 52 this->fire_ = 0x0; 53 this->firehack_ = 0x0; 54 54 55 55 this->health_ = 0; … … 60 60 61 61 this->spawnparticleduration_ = 3.0f; 62 63 this->getPickUp().setPlayer(this); 62 64 63 65 if (Core::isMaster()) … … 108 110 registerVariable(this->health_, variableDirection::toclient); 109 111 registerVariable(this->initialHealth_, variableDirection::toclient); 110 registerVariable(this->fire_, variableDirection::to client);112 registerVariable(this->fire_, variableDirection::toserver); 111 113 } 112 114 … … 124 126 this->weaponSystem_->fire(WeaponMode::altFire2); 125 127 } 126 this->fire_ = 0x0; 128 this->fire_ = this->firehack_; 129 this->firehack_ = 0x0; 127 130 128 131 if (this->health_ <= 0) … … 225 228 void Pawn::fire(WeaponMode::Enum fireMode) 226 229 { 227 this->fire _ |= fireMode;230 this->firehack_ |= fireMode; 228 231 } 229 232 -
code/branches/presentation/src/orxonox/objects/worldentities/pawns/Pawn.h
r2500 r2501 116 116 ShipEquipment pickUp; 117 117 bool bAlive_; 118 118 119 119 120 120 float health_; … … 126 126 WeaponSystem* weaponSystem_; 127 127 unsigned int fire_; 128 unsigned int firehack_; 128 129 129 130 std::string spawnparticlesource_; -
code/branches/presentation/src/orxonox/overlays/notifications/NotificationManager.cc
r2436 r2501 49 49 //TDO: Destroy the containers 50 50 } 51 51 52 52 void NotificationManager::tick(float dt) 53 53 { 54 54 bool update = false; 55 55 56 56 for (std::list<NotificationContainer*>::iterator notification = notifications_s.begin(); notification != notifications_s.end(); ++notification) 57 57 { … … 71 71 } 72 72 } 73 73 74 74 if(update) 75 75 updateQueue(); 76 76 } 77 77 78 78 bool NotificationManager::insertNotification(Notification* notification) 79 79 { 80 80 if(notification == NULL) 81 81 return false; 82 82 83 83 NotificationContainer* container = new NotificationContainer; 84 84 container->notification = notification; 85 85 container->remainingTime = notification->getDisplayTime(); 86 86 notifications_s.push_front(container); 87 87 88 88 updateQueue(); 89 89 90 90 COUT(4) << "Notification inserted. Title: " << notification->getTitle() << std::endl; 91 91 92 92 return true; 93 93 } 94 94 95 95 void NotificationManager::updateQueue(void) 96 96 { 97 97 std::string text = ""; 98 98 99 if (!NotificationQueue::queue_s) 100 return; 101 99 102 int i = NotificationQueue::queue_s->getLength(); 100 103 for (std::list<NotificationContainer*>::iterator notification = notifications_s.begin(); notification != notifications_s.end() && i > 0; ++notification) … … 104 107 if(container->remainingTime == 0.0) 105 108 continue; 106 109 107 110 text = text + "\n\n\n------------\n\n" + clipMessage(container->notification->getTitle()) + "\n\n" + clipMessage(container->notification->getMessage()); 108 111 } 109 112 110 113 NotificationQueue::queue_s->setQueueText(text); 111 114 } 112 115 113 116 const std::string NotificationManager::clipMessage(const std::string & str) 114 117 { 115 118 116 119 std::string message = str; 117 120 unsigned int i = 0; 118 121 119 122 unsigned int found = message.find("\\n", i); 120 123 while(found != std::string::npos) … … 124 127 found = message.find("\\n", i); 125 128 } 126 129 127 130 std::string clippedMessage = ""; 128 131 int wordLength = 0; … … 136 139 wordLength++; 137 140 } 138 141 139 142 if(wordLength <= widthLeft) 140 143 { … … 165 168 } 166 169 } 167 170 168 171 return clippedMessage; 169 172 } -
code/branches/presentation/src/orxonox/overlays/notifications/NotificationQueue.cc
r2500 r2501 56 56 this->length_ = 3; 57 57 this->width_ = 50; 58 COUT(0) << "added notification queue" << std::endl;59 58 } 60 59 61 60 NotificationQueue::~NotificationQueue() 62 61 { 63 COUT(0) << "deleted notification queue" << std::endl;64 62 65 63 } … … 102 100 void NotificationQueue::setQueueText(const std::string & text) 103 101 { 104 COUT(0) << "queue: " << text << std::endl;105 102 this->queueText_ = text; 106 103 } … … 110 107 this->text_->setCaption(queueText_); 111 108 } 112 113 109 } -
code/branches/presentation/src/orxonox/overlays/notifications/NotificationQueue.h
r2436 r2501 42 42 /** 43 43 @brief 44 44 45 45 @author 46 46 Damian 'Mozork' Frick … … 51 51 NotificationQueue(BaseObject* creator); 52 52 virtual ~NotificationQueue(); 53 53 54 54 static NotificationQueue* queue_s; //TDO Singleton? oder im level. 55 55 56 56 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); 57 57 58 58 virtual void tick(float dt); 59 59 60 60 void update(void); 61 61 62 62 int getLength(void) const 63 63 { return this->length_; } 64 64 int getWidth(void) const 65 65 { return this->width_; } 66 66 67 67 void setQueueText(const std::string & text); 68 68 bool setLength(int length); 69 69 bool setWidth(int width); 70 70 71 71 private: 72 72 Ogre::UTFString queueText_; 73 73 int length_; 74 74 int width_; 75 75 76 76 }; 77 77
Note: See TracChangeset
for help on using the changeset viewer.