Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2008, 9:11:12 AM (16 years ago)
Author:
landauf
Message:
  • GlobalShader in dedicated mode works again
  • Shooting as a client works
  • Fixed problem with NotificationQueue
Location:
code/branches/presentation/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/network/packet/Gamestate.cc

    r2490 r2501  
    175175        COUT(0) << "Found object with OBJECTID_UNKNOWN on the client with objectMode != 0x0!" << std::endl;
    176176        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;
    177178        assert(false);
    178179      }
  • code/branches/presentation/src/orxonox/objects/GlobalShader.cc

    r2485 r2501  
    4545        if (!this->getScene())
    4646            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.");
    4949
    50         this->shader_.setSceneManager(this->getScene()->getSceneManager());
     50        if (this->getScene()->getSceneManager())
     51            this->shader_.setSceneManager(this->getScene()->getSceneManager());
    5152
    5253        this->registerVariables();
  • code/branches/presentation/src/orxonox/objects/gametypes/Gametype.cc

    r2495 r2501  
    6969        this->addBots(this->numberOfBots_);
    7070
    71         setConfigValues();
    72 
    7371        // load the corresponding score board
    7472        if (Core::showsGraphics() && this->scoreboardTemplate_ != "")
  • code/branches/presentation/src/orxonox/objects/weaponSystem/Weapon.cc

    r2493 r2501  
    5050        this->magazineLoadingTime_ = 0;
    5151        this->bReloading_ = false;
     52
     53        this->setObjectMode(0x0);
    5254    }
    5355
  • code/branches/presentation/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc

    r2497 r2501  
    5454
    5555        // Get notification about collisions
    56         this->enableCollisionCallback();
    5756
    58         this->setCollisionType(Kinematic);
     57        if (Core::isMaster())
     58        {
     59            this->enableCollisionCallback();
    5960
    60         SphereCollisionShape* shape = new SphereCollisionShape(this);
    61         shape->setRadius(10);
    62         this->attachCollisionShape(shape);
     61            this->setCollisionType(Kinematic);
    6362
    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        }
    6669    }
    6770
  • code/branches/presentation/src/orxonox/objects/worldentities/WorldEntity.cc

    r2497 r2501  
    545545        if (type != None && this->collisionType_ == None)
    546546        {
     547/*
    547548            // Check whether there was some scaling applied.
    548549            if (!this->node_->getScale().positionEquals(Vector3(1, 1, 1), 0.001))
     
    551552                return;
    552553            }
    553 
     554*/
    554555            // Create new rigid body
    555556            btRigidBody::btRigidBodyConstructionInfo bodyConstructionInfo(0, this, this->collisionShape_->getCollisionShape());
  • code/branches/presentation/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r2500 r2501  
    4949
    5050        PawnManager::touch();
    51         this->getPickUp().setPlayer(this);
    5251        this->bAlive_ = true;
    5352        this->fire_ = 0x0;
     53        this->firehack_ = 0x0;
    5454
    5555        this->health_ = 0;
     
    6060
    6161        this->spawnparticleduration_ = 3.0f;
     62
     63        this->getPickUp().setPlayer(this);
    6264
    6365        if (Core::isMaster())
     
    108110        registerVariable(this->health_,        variableDirection::toclient);
    109111        registerVariable(this->initialHealth_, variableDirection::toclient);
    110         registerVariable(this->fire_,          variableDirection::toclient);
     112        registerVariable(this->fire_,          variableDirection::toserver);
    111113    }
    112114
     
    124126                this->weaponSystem_->fire(WeaponMode::altFire2);
    125127        }
    126         this->fire_ = 0x0;
     128        this->fire_ = this->firehack_;
     129        this->firehack_ = 0x0;
    127130
    128131        if (this->health_ <= 0)
     
    225228    void Pawn::fire(WeaponMode::Enum fireMode)
    226229    {
    227         this->fire_ |= fireMode;
     230        this->firehack_ |= fireMode;
    228231    }
    229232
  • code/branches/presentation/src/orxonox/objects/worldentities/pawns/Pawn.h

    r2500 r2501  
    116116            ShipEquipment pickUp;
    117117            bool bAlive_;
    118            
     118
    119119
    120120            float health_;
     
    126126            WeaponSystem* weaponSystem_;
    127127            unsigned int fire_;
     128            unsigned int firehack_;
    128129
    129130            std::string spawnparticlesource_;
  • code/branches/presentation/src/orxonox/overlays/notifications/NotificationManager.cc

    r2436 r2501  
    4949        //TDO: Destroy the containers
    5050    }
    51    
     51
    5252    void NotificationManager::tick(float dt)
    5353    {
    5454        bool update = false;
    55    
     55
    5656        for (std::list<NotificationContainer*>::iterator notification = notifications_s.begin(); notification != notifications_s.end(); ++notification)
    5757        {
     
    7171            }
    7272        }
    73    
     73
    7474        if(update)
    7575            updateQueue();
    7676    }
    77    
     77
    7878    bool NotificationManager::insertNotification(Notification* notification)
    7979    {
    8080        if(notification == NULL)
    8181            return false;
    82            
     82
    8383        NotificationContainer* container = new NotificationContainer;
    8484        container->notification = notification;
    8585        container->remainingTime = notification->getDisplayTime();
    8686        notifications_s.push_front(container);
    87        
     87
    8888        updateQueue();
    89        
     89
    9090        COUT(4) << "Notification inserted. Title: " << notification->getTitle() << std::endl;
    91        
     91
    9292        return true;
    9393    }
    94    
     94
    9595    void NotificationManager::updateQueue(void)
    9696    {
    9797        std::string text = "";
    98        
     98
     99        if (!NotificationQueue::queue_s)
     100            return;
     101
    99102        int i = NotificationQueue::queue_s->getLength();
    100103        for (std::list<NotificationContainer*>::iterator notification = notifications_s.begin(); notification != notifications_s.end() && i > 0; ++notification)
     
    104107            if(container->remainingTime == 0.0)
    105108                continue;
    106            
     109
    107110            text = text + "\n\n\n------------\n\n" + clipMessage(container->notification->getTitle()) + "\n\n" + clipMessage(container->notification->getMessage());
    108111        }
    109        
     112
    110113        NotificationQueue::queue_s->setQueueText(text);
    111114    }
    112    
     115
    113116    const std::string NotificationManager::clipMessage(const std::string & str)
    114117    {
    115    
     118
    116119        std::string message = str;
    117120        unsigned int i = 0;
    118        
     121
    119122        unsigned int found = message.find("\\n", i);
    120123        while(found != std::string::npos)
     
    124127            found = message.find("\\n", i);
    125128        }
    126    
     129
    127130        std::string clippedMessage = "";
    128131        int wordLength = 0;
     
    136139                wordLength++;
    137140            }
    138            
     141
    139142            if(wordLength <= widthLeft)
    140143            {
     
    165168            }
    166169        }
    167        
     170
    168171        return clippedMessage;
    169172    }
  • code/branches/presentation/src/orxonox/overlays/notifications/NotificationQueue.cc

    r2500 r2501  
    5656        this->length_ = 3;
    5757        this->width_ = 50;
    58 COUT(0) << "added notification queue" << std::endl;
    5958    }
    6059
    6160    NotificationQueue::~NotificationQueue()
    6261    {
    63 COUT(0) << "deleted notification queue" << std::endl;
    6462
    6563    }
     
    102100    void NotificationQueue::setQueueText(const std::string & text)
    103101    {
    104 COUT(0) << "queue: " << text << std::endl;
    105102        this->queueText_ = text;
    106103    }
     
    110107        this->text_->setCaption(queueText_);
    111108    }
    112 
    113109}
  • code/branches/presentation/src/orxonox/overlays/notifications/NotificationQueue.h

    r2436 r2501  
    4242    /**
    4343    @brief
    44        
     44
    4545    @author
    4646        Damian 'Mozork' Frick
     
    5151        NotificationQueue(BaseObject* creator);
    5252        virtual ~NotificationQueue();
    53        
     53
    5454        static NotificationQueue* queue_s; //TDO Singleton? oder im level.
    55        
     55
    5656        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
    57        
     57
    5858        virtual void tick(float dt);
    59        
     59
    6060        void update(void);
    61        
     61
    6262        int getLength(void) const
    6363                { return this->length_; }
    6464        int getWidth(void) const
    6565                { return this->width_; }
    66        
     66
    6767        void setQueueText(const std::string & text);
    6868        bool setLength(int length);
    6969        bool setWidth(int width);
    70        
     70
    7171    private:
    7272        Ogre::UTFString queueText_;
    7373        int length_;
    7474        int width_;
    75    
     75
    7676    };
    7777
Note: See TracChangeset for help on using the changeset viewer.