Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 25, 2009, 10:23:58 PM (15 years ago)
Author:
rgrieder
Message:

Merged presentation2 branch back to trunk.
Major new features:

  • Actual GUI with settings, etc.
  • Improved space ship steering (human interaction)
  • Rocket fire and more particle effects
  • Advanced sound framework
Location:
code/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/infos/Bot.cc

    r5781 r6417  
    9494        static std::vector<std::string> defaultnames(names, names + sizeof(names) / sizeof(std::string));
    9595
    96         SetConfigValueVector(names_, defaultnames);
     96        SetConfigValue(names_, defaultnames);
    9797    }
    9898}
  • code/trunk/src/orxonox/infos/HumanPlayer.cc

    r5929 r6417  
    3535#include "network/Host.h"
    3636#include "controllers/HumanController.h"
     37#include "controllers/NewHumanController.h"
    3738#include "gametypes/Gametype.h"
    3839#include "overlays/OverlayGroup.h"
     
    5051
    5152        this->bHumanPlayer_ = true;
    52         this->defaultController_ = Class(HumanController);
     53        this->defaultController_ = Class(NewHumanController);
    5354
    5455        this->humanHud_ = 0;
     
    163164        if (this->isInitialized() && this->isLocalPlayer())
    164165        {
    165             if (this->getGametype() && this->getGametype()->getHUDTemplate() != "")
     166            if (this->getGametype() && !this->getGametype()->getHUDTemplate().empty())
    166167                this->setGametypeHUDTemplate(this->getGametype()->getHUDTemplate());
    167168            else
     
    178179        }
    179180
    180         if (this->isLocalPlayer() && this->humanHudTemplate_ != "" && GameMode::showsGraphics())
     181        if (this->isLocalPlayer() && !this->humanHudTemplate_.empty() && GameMode::showsGraphics())
    181182        {
    182183            this->humanHud_ = new OverlayGroup(this);
     
    194195        }
    195196
    196         if (this->isLocalPlayer() && this->gametypeHudTemplate_ != "")
     197        if (this->isLocalPlayer() && !this->gametypeHudTemplate_.empty())
    197198        {
    198199            this->gametypeHud_ = new OverlayGroup(this);
  • code/trunk/src/orxonox/infos/PlayerInfo.cc

    r5929 r6417  
    5050        this->controller_ = 0;
    5151        this->controllableEntity_ = 0;
    52         this->controllableEntityID_ = CLIENTID_UNKNOWN;
     52        this->controllableEntityID_ = OBJECTID_UNKNOWN;
     53        this->oldControllableEntity_ = 0;
    5354
    5455        this->gtinfo_ = 0;
     
    8081        registerVariable(this->name_,                 VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
    8182        registerVariable(this->controllableEntityID_, VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
    82         registerVariable(this->bReadyToSpawn_,        VariableDirection::ToServer);
    8383        registerVariable(this->gtinfoID_,             VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedgtinfoID));
    8484    }
     
    139139        this->controller_->setPlayer(this);
    140140        if (this->controllableEntity_)
     141        {
    141142            this->controller_->setControllableEntity(this->controllableEntity_);
     143            this->controllableEntity_->setController(this->controller_);
     144        }
    142145        this->changedController();
    143146    }
     
    148151            return;
    149152
     153        if (this->oldControllableEntity_)
     154            this->stopTemporaryControl();
    150155        if (this->controllableEntity_)
    151156            this->stopControl();
     
    159164
    160165        if (this->controller_)
     166        {
    161167            this->controller_->setControllableEntity(entity);
     168            this->controllableEntity_->setController(this->controller_);
     169        }
     170
     171        this->changedControllableEntity();
     172    }
     173
     174    void PlayerInfo::startTemporaryControl(ControllableEntity* entity)
     175    {
     176        if (!entity)
     177            return;
     178
     179//         assert( this->temporaryControllableEntity_==0 );
     180
     181        this->oldControllableEntity_ = this->controllableEntity_;
     182        this->controllableEntity_ = entity;
     183        this->controllableEntityID_ = entity->getObjectID();
     184
     185        entity->setPlayer(this);
     186
     187        if (this->controller_)
     188            this->controller_->setControllableEntity(entity);
    162189
    163190        this->changedControllableEntity();
     
    166193    void PlayerInfo::stopControl()
    167194    {
     195        if ( this->oldControllableEntity_ )
     196            this->stopTemporaryControl();
     197
    168198        ControllableEntity* entity = this->controllableEntity_;
    169199
     
    171201            return;
    172202
     203        this->controllableEntity_->setController(0);
    173204        this->controllableEntity_ = 0;
    174205        this->controllableEntityID_ = OBJECTID_UNKNOWN;
     
    177208            this->controller_->setControllableEntity(0);
    178209
    179         entity->removePlayer();
     210        if ( GameMode::isMaster() )
     211            entity->removePlayer();
     212
     213        this->changedControllableEntity();
     214    }
     215
     216    void PlayerInfo::stopTemporaryControl()
     217    {
     218        ControllableEntity* entity = this->controllableEntity_;
     219
     220        assert( this->controllableEntity_ && this->oldControllableEntity_ );
     221        if( !entity || !this->oldControllableEntity_ )
     222            return;
     223
     224        this->controllableEntity_ = this->oldControllableEntity_;
     225        this->controllableEntityID_ = this->controllableEntity_->getObjectID();
     226        this->oldControllableEntity_ = 0;
     227
     228        if ( this->controllableEntity_ && this->controller_)
     229            this->controller_->setControllableEntity(this->controllableEntity_);
     230
     231        if ( GameMode::isMaster() )
     232            entity->removePlayer();
    180233
    181234        this->changedControllableEntity();
     
    196249    }
    197250
     251
    198252    void PlayerInfo::networkcallback_changedgtinfoID()
    199253    {
  • code/trunk/src/orxonox/infos/PlayerInfo.h

    r5929 r6417  
    6969            void startControl(ControllableEntity* entity);
    7070            void stopControl();
     71            void startTemporaryControl(ControllableEntity* entity);
     72            void stopTemporaryControl();
    7173
    7274            inline ControllableEntity* getControllableEntity() const
     
    9698            Controller* controller_;
    9799            ControllableEntity* controllableEntity_;
     100            ControllableEntity* oldControllableEntity_;
    98101            unsigned int controllableEntityID_;
    99102
Note: See TracChangeset for help on using the changeset viewer.