Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 25, 2009, 1:18:03 PM (15 years ago)
Author:
dafrick
Message:

Merged presentation2 branch into pickup2 branch.

Location:
code/branches/pickup2
Files:
62 edited
4 copied

Legend:

Unmodified
Added
Removed
  • code/branches/pickup2

  • code/branches/pickup2/src/modules/objects/Attacher.cc

    r5929 r6412  
    9898        this->target_ = 0;
    9999
    100         if (this->targetname_ == "")
     100        if (this->targetname_.empty())
    101101            return;
    102102
     
    113113    void Attacher::loadedNewXMLName(BaseObject* object)
    114114    {
    115         if (this->target_ || this->targetname_ == "")
     115        if (this->target_ || this->targetname_.empty())
    116116            return;
    117117
  • code/branches/pickup2/src/modules/objects/collisionshapes/BoxCollisionShape.cc

    r5781 r6412  
    6666        XMLPortParam(BoxCollisionShape, "halfExtents",  setHalfExtents,  getHalfExtents,  xmlelement, mode);
    6767        XMLPortParamLoadOnly(BoxCollisionShape, "width",  setWidth,  xmlelement, mode);
    68         XMLPortParamLoadOnly(BoxCollisionShape, "height", setHeight, xmlelement, mode);   
    69         XMLPortParamLoadOnly(BoxCollisionShape, "length", setLength, xmlelement, mode);   
     68        XMLPortParamLoadOnly(BoxCollisionShape, "height", setHeight, xmlelement, mode);
     69        XMLPortParamLoadOnly(BoxCollisionShape, "length", setLength, xmlelement, mode);
    7070    }
    7171
  • code/branches/pickup2/src/modules/objects/collisionshapes/ConeCollisionShape.cc

    r5781 r6412  
    6666
    6767        XMLPortParam(ConeCollisionShape, "radius", setRadius, getRadius, xmlelement, mode);
    68         XMLPortParam(ConeCollisionShape, "height", setHeight, getHeight, xmlelement, mode);   
     68        XMLPortParam(ConeCollisionShape, "height", setHeight, getHeight, xmlelement, mode);
    6969    }
    7070
  • code/branches/pickup2/src/modules/objects/collisionshapes/PlaneCollisionShape.cc

    r5781 r6412  
    6767
    6868        XMLPortParam(PlaneCollisionShape, "normal", setNormal, getNormal, xmlelement, mode);
    69         XMLPortParam(PlaneCollisionShape, "offset", setOffset, getOffset, xmlelement, mode);   
     69        XMLPortParam(PlaneCollisionShape, "offset", setOffset, getOffset, xmlelement, mode);
    7070    }
    7171
  • code/branches/pickup2/src/modules/objects/eventsystem/EventFilter.cc

    r5929 r6412  
    6262        if (this->bActive_)
    6363        {
    64             COUT(2) << "Warning: Detected Event loop in EventFilter \"" << this->getName() << "\"" << std::endl;
     64            COUT(2) << "Warning: Detected Event loop in EventFilter \"" << this->getName() << '"' << std::endl;
    6565            return;
    6666        }
  • code/branches/pickup2/src/modules/objects/eventsystem/EventListener.cc

    r5929 r6412  
    5858        if (this->bActive_)
    5959        {
    60             COUT(2) << "Warning: Detected Event loop in EventListener \"" << this->getName() << "\"" << std::endl;
     60            COUT(2) << "Warning: Detected Event loop in EventListener \"" << this->getName() << '"' << std::endl;
    6161            return;
    6262        }
     
    7171        this->eventName_ = eventname;
    7272
    73         if (this->eventName_ == "")
     73        if (this->eventName_.empty())
    7474            return;
    7575
     
    8181    void EventListener::loadedNewXMLName(BaseObject* object)
    8282    {
    83         if (this->eventName_ == "")
     83        if (this->eventName_.empty())
    8484            return;
    8585
  • code/branches/pickup2/src/modules/objects/eventsystem/EventTarget.cc

    r5929 r6412  
    4545    {
    4646    }
    47    
     47
    4848    void EventTarget::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    4949    {
     
    6060        if (this->bActive_)
    6161        {
    62             COUT(2) << "Warning: Detected Event loop in EventTarget \"" << this->getName() << "\"" << std::endl;
     62            COUT(2) << "Warning: Detected Event loop in EventTarget \"" << this->getName() << '"' << std::endl;
    6363            return;
    6464        }
     
    7272    {
    7373        this->target_ = name;
    74        
     74
    7575        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
    7676            if (it->getName() == this->target_)
     
    8080    void EventTarget::loadedNewXMLName(BaseObject* object)
    8181    {
    82         if (this->target_ == "")
     82        if (this->target_.empty())
    8383            return;
    8484
  • code/branches/pickup2/src/modules/objects/eventsystem/EventTarget.h

    r5929 r6412  
    4242            EventTarget(BaseObject* creator);
    4343            virtual ~EventTarget();
    44            
     44
    4545            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    46            
     46
    4747            virtual void processEvent(Event& event);
    4848
     
    5454            virtual void loadedNewXMLName(BaseObject* object);
    5555            void addEventTarget(BaseObject* object);
    56            
     56
    5757            std::string target_;
    5858            bool bActive_;
  • code/branches/pickup2/src/modules/objects/triggers/DistanceTrigger.cc

    r5937 r6412  
    9292    if (!targetId)
    9393    {
    94         COUT(1) << "Error: \"" << targets << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << std::endl;
     94        COUT(1) << "Error: \"" << targets << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ')' << std::endl;
    9595        return;
    9696    }
  • code/branches/pickup2/src/modules/objects/triggers/Trigger.cc

    r5929 r6412  
    280280  {
    281281    if (this->mode_ == TriggerMode::EventTriggerAND)
    282       return std::string("and");
     282      return "and";
    283283    else if (this->mode_ == TriggerMode::EventTriggerOR)
    284       return std::string("or");
     284      return "or";
    285285    else if (this->mode_ == TriggerMode::EventTriggerXOR)
    286       return std::string("xor");
     286      return "xor";
    287287    else
    288       return std::string("and");
     288      return "and";
    289289  }
    290290
  • code/branches/pickup2/src/modules/overlays/GUIOverlay.cc

    r5781 r6412  
    6464
    6565        //Setting player now.
    66         GUIManager::getInstance().setPlayer(this->guiName_, (orxonox_cast<ControllableEntity*>(this->getOwner()))->getPlayer());
     66        if( this->getOwner() )
     67            GUIManager::getInstance().setPlayer(this->guiName_, (orxonox_cast<ControllableEntity*>(this->getOwner()))->getPlayer());
    6768
    6869        if (this->isVisible())
    6970        {
    70             std::string str;
    71             std::stringstream out;
     71            std::ostringstream out;
    7272            out << reinterpret_cast<long>(this);
    73             str = out.str();
    74             GUIManager::getInstance().executeCode("showCursor()");
    75             InputManager::getInstance().enterState("guiMouseOnly");
    76             GUIManager::getInstance().executeCode("showGUI(\"" + this->guiName_ + "\", " + str + ")");
     73            const std::string& str = out.str();
     74            COUT(1) << "GUIManager ptr: " << str << std::endl;
     75            GUIManager::getInstance().showGUIExtra(this->guiName_, str);
     76
     77            COUT(3) << "Showing GUI " << this->guiName_ << std::endl;
    7778        }
    7879        else
    7980        {
    80             GUIManager::getInstance().executeCode("hideGUI(\"" + this->guiName_ + "\")");
    81             GUIManager::getInstance().executeCode("hideCursor()");
    82             InputManager::getInstance().leaveState("guiMouseOnly");
     81            GUIManager::hideGUI(this->guiName_);
     82            COUT(3) << "Hiding GUI " << this->guiName_ << std::endl;
    8383        }
    8484    }
  • code/branches/pickup2/src/modules/overlays/OverlayText.cc

    r5781 r6412  
    134134    void OverlayText::setFont(const std::string& font)
    135135    {
    136         if (font != "")
     136        if (!font.empty())
    137137            this->text_->setFontName(font);
    138138    }
  • code/branches/pickup2/src/modules/overlays/hud/ChatOverlay.cc

    r5929 r6412  
    3333
    3434#include "util/Convert.h"
    35 #include "util/UTFStringConversions.h"
     35#include "util/DisplayStringConversions.h"
    3636#include "core/CoreIncludes.h"
    3737#include "core/ConfigValueIncludes.h"
     
    8686        }
    8787
    88         this->messages_.push_back(multi_cast<Ogre::UTFString>(text));
     88        this->messages_.push_back(multi_cast<Ogre::DisplayString>(text));
    8989        COUT(0) << "Chat: " << text << std::endl;
    9090
     
    110110        this->text_->setCaption("");
    111111
    112         for (std::list<Ogre::UTFString>::reverse_iterator it = this->messages_.rbegin(); it != this->messages_.rend(); ++it)
     112        for (std::list<Ogre::DisplayString>::reverse_iterator it = this->messages_.rbegin(); it != this->messages_.rend(); ++it)
    113113        {
    114114            this->text_->setCaption(this->text_->getCaption() + "\n" + (*it));
  • code/branches/pickup2/src/modules/overlays/hud/ChatOverlay.h

    r5929 r6412  
    3333
    3434#include <list>
    35 #include <OgreUTFString.h>
     35#include <OgreOverlayElement.h>
    3636
    3737#include "network/ChatListener.h"
     
    5151            virtual void incomingChat(const std::string& message, unsigned int senderID);
    5252
    53             std::list<Ogre::UTFString> messages_;
     53            std::list<Ogre::DisplayString> messages_;
    5454
    5555        private:
  • code/branches/pickup2/src/modules/overlays/hud/HUDBar.cc

    r5929 r6412  
    6767
    6868    HUDBar::HUDBar(BaseObject* creator)
    69         : OrxonoxOverlay(creator)
     69        : OrxonoxOverlay(creator), right2Left_(false), autoColour_(false)
    7070    {
    7171        RegisterObject(HUDBar);
    7272
    7373        // create new material
    74         std::string materialname = "barmaterial" + multi_cast<std::string>(materialcount_s++);
     74        const std::string& materialname = "barmaterial" + multi_cast<std::string>(materialcount_s++);
    7575        Ogre::MaterialPtr material = static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().create(materialname, "General"));
    7676        material->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
     
    8585
    8686        this->value_ = 1.0f;  // initielize with 1.0f to trigger a change when calling setValue(0.0f) on the line below
     87        this->setAutoColour(true);
    8788        this->setValue(0.0f); // <--
    8889        this->setRightToLeft(false);
    89         this->setAutoColour(true);
    9090        this->currentColour_ = ColourValue::White;
    9191
     
    122122            {
    123123                ColourValue colour1(0, 0, 0, 1);
    124                 ColourValue colour2 = (*this->colours_.rbegin()).second;
     124                ColourValue colour2 = this->colours_.rbegin()->second;
    125125                float value1(0);
    126                 float value2 = (*this->colours_.rbegin()).first;
     126                float value2 = this->colours_.rbegin()->first;
    127127                for (std::map<float, ColourValue>::reverse_iterator it = this->colours_.rbegin(); it != this->colours_.rend(); ++it)
    128128                {
    129129                    colour1 = colour2;
    130130                    value1 = value2;
    131                     colour2 = (*it).second;
    132                     value2 = (*it).first;
     131                    colour2 = it->second;
     132                    value2 = it->first;
    133133
    134134                    if (value2 < this->value_)
  • code/branches/pickup2/src/modules/overlays/hud/HUDHealthBar.cc

    r5929 r6412  
    4848        this->textoverlay_ = new OverlayText(this);
    4949
    50         assert(this->textoverlay_);
     50        assert(this->textoverlay_.get());
    5151
    5252        this->textoverlay_->setCaption("");
     
    5656    {
    5757        if (this->isInitialized())
     58        {
    5859            this->textoverlay_->destroy();
     60            this->textoverlay_ = 0;
     61        }
    5962    }
    6063
     
    106109        SUPER(HUDHealthBar, changedOverlayGroup);
    107110
    108         this->getOverlayGroup()->addElement(this->textoverlay_);
     111        this->getOverlayGroup()->addElement(this->textoverlay_.get());
    109112    }
    110113
  • code/branches/pickup2/src/modules/overlays/hud/HUDHealthBar.h

    r5929 r6412  
    5353
    5454            inline void setTextFont(const std::string& font)
    55                 { if (font != "") { this->textoverlay_->setFont(font); } }
     55                { if (!font.empty()) { this->textoverlay_->setFont(font); } }
    5656            inline const std::string& getTextFont() const
    5757                { return this->textoverlay_->getFont(); }
     
    112112        private:
    113113            WeakPtr<Pawn> owner_;
    114             OverlayText* textoverlay_;
     114            SmartPtr<OverlayText> textoverlay_;
    115115            bool bUseBarColour_;
    116116            ColourValue textColour_;
  • code/branches/pickup2/src/modules/overlays/hud/HUDNavigation.cc

    r5929 r6412  
    3030
    3131#include <string>
     32#include <OgreCamera.h>
    3233#include <OgreOverlayManager.h>
    3334#include <OgreTextAreaOverlayElement.h>
     
    3536
    3637#include "util/Math.h"
    37 #include "util/StringUtils.h"
    3838#include "util/Convert.h"
    3939#include "core/CoreIncludes.h"
    4040#include "core/XMLPort.h"
     41#include "CameraManager.h"
    4142#include "Scene.h"
    4243#include "Radar.h"
     44#include "graphics/Camera.h"
     45#include "controllers/HumanController.h"
     46#include "worldentities/pawns/Pawn.h"
    4347
    4448namespace orxonox
     
    6064        navMarker_->setMaterialName("Orxonox/NavArrows");
    6165
     66/*
    6267        // create aim marker
    6368        aimMarker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
     
    7075        setNavMarkerSize(0.05f);
    7176        setAimMarkerSize(0.04f);
     77*/
    7278
    7379        background_->addChild(navMarker_);
    74         background_->addChild(aimMarker_);
     80//        background_->addChild(aimMarker_);
    7581        background_->addChild(navText_);
    7682
     
    8591            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->navMarker_);
    8692            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->navText_);
    87             Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->aimMarker_);
     93//            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->aimMarker_);
    8894        }
    8995    }
     
    96102        XMLPortParam(HUDNavigation, "textSize", setTextSize, getTextSize, xmlElement, mode);
    97103        XMLPortParam(HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlElement, mode);
    98         XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlElement, mode);
     104//        XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlElement, mode);
    99105    }
    100106
    101107    void HUDNavigation::setFont(const std::string& font)
    102108    {
    103         if (this->navText_ && font != "")
     109        if (this->navText_ && !font.empty())
    104110            this->navText_->setFontName(font);
    105111    }
     
    149155        float textLength = multi_cast<std::string>(dist).size() * navText_->getCharHeight() * 0.3;
    150156
    151 /*
    152         Ogre::Camera* navCam = SpaceShip::getLocalShip()->getCamera()->cam_;
    153         Matrix4 transformationMatrix = navCam->getProjectionMatrix() * navCam->getViewMatrix();
    154 */
     157        orxonox::Camera* cam = CameraManager::getInstance().getActiveCamera();
     158        if (!cam)
     159            return;
     160        const Matrix4& transform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
    155161        // transform to screen coordinates
    156         Vector3 pos = /*transformationMatrix * */radar->getFocus()->getRVWorldPosition();
     162        Vector3 pos = transform * radar->getFocus()->getRVWorldPosition();
    157163
    158164        bool outOfView;
     
    172178        {
    173179            // object is not in view
    174             aimMarker_->hide();
     180//            aimMarker_->hide();
    175181
    176182            if (!wasOutOfView_)
     
    227233            // object is in view
    228234/*
    229             Vector3 aimpos = transformationMatrix * getPredictedPosition(SpaceShip::getLocalShip()->getPosition(),
     235            Vector3 aimpos = transform * getPredictedPosition(SpaceShip::getLocalShip()->getPosition(),
    230236                    Projectile::getSpeed(), Radar::getInstance().getFocus()->getRVWorldPosition(), Radar::getInstance().getFocus()->getRVOrientedVelocity());
    231237*/
     
    241247            navMarker_->setTop((-pos.y + 1.0 - navMarker_->getHeight()) * 0.5);
    242248
     249/*
    243250            aimMarker_->show();
    244 /*
    245251            aimMarker_->setLeft((aimpos.x + 1.0 - aimMarker_->getWidth()) * 0.5);
    246252            aimMarker_->setTop((-aimpos.y + 1.0 - aimMarker_->getHeight()) * 0.5);
     
    253259    float HUDNavigation::getDist2Focus() const
    254260    {
    255 /*
    256         if (Radar::getInstance().getFocus())
    257             return (Radar::getInstance().getFocus()->getRVWorldPosition() - SpaceShip::getLocalShip()->getPosition()).length();
    258         else
    259 */
     261        Radar* radar = this->getOwner()->getScene()->getRadar();
     262        if (radar->getFocus() && HumanController::getLocalControllerEntityAsPawn())
     263            return (radar->getFocus()->getRVWorldPosition() - HumanController::getLocalControllerEntityAsPawn()->getWorldPosition()).length();
     264        else
    260265            return 0;
    261266    }
     
    267272    void HUDNavigation::sizeChanged()
    268273    {
    269         // use size to compensate for apspect ratio if enabled.
     274        // use size to compensate for aspect ratio if enabled.
    270275        float xScale = this->getActualSize().x;
    271276        float yScale = this->getActualSize().y;
    272277        if (this->navMarker_)
    273278            navMarker_->setDimensions(navMarkerSize_ * xScale, navMarkerSize_ * yScale);
     279/*
    274280        if (this->aimMarker_)
    275281            aimMarker_->setDimensions(aimMarkerSize_ * xScale, aimMarkerSize_ * yScale);
     282*/
    276283        if (this->navText_)
    277284            navText_->setCharHeight(navText_->getCharHeight() * yScale);
  • code/branches/pickup2/src/modules/overlays/hud/HUDNavigation.h

    r5781 r6412  
    5656        float getNavMarkerSize() const    { return this->navMarkerSize_; }
    5757
     58/*
    5859        void setAimMarkerSize(float size) { this->aimMarkerSize_ = size; this->sizeChanged(); }
    5960        float getAimMarkerSize() const    { return this->aimMarkerSize_; }
     61*/
    6062
    6163        void setTextSize(float size);
     
    7173        Ogre::PanelOverlayElement* navMarker_;      //!< the panel used to show the arrow and the target marker
    7274        float navMarkerSize_;                       //!< One paramter size of the navigation marker
     75/*
    7376        Ogre::PanelOverlayElement* aimMarker_;      //!< Panel used to show the aim Marker
    7477        float aimMarkerSize_;                       //!< One paramter size of the aim marker
     78*/
    7579        Ogre::TextAreaOverlayElement* navText_;     //!< Text overlay to display the target distance
    7680        bool wasOutOfView_;                         //!< Performance booster variable: setMaterial is not cheap
  • code/branches/pickup2/src/modules/overlays/hud/HUDRadar.cc

    r5781 r6412  
    126126            panel = *itRadarDots_;
    127127            ++itRadarDots_;
    128             std::string materialName = TextureGenerator::getMaterialName(
     128            const std::string& materialName = TextureGenerator::getMaterialName(
    129129                shapeMaterials_[object->getRadarObjectShape()], object->getRadarObjectColour());
    130130            if (materialName != panel->getMaterialName())
  • code/branches/pickup2/src/modules/overlays/hud/TeamBaseMatchScore.cc

    r5929 r6412  
    7171        if (this->owner_)
    7272        {
    73             std::string bases1 = "(" + multi_cast<std::string>(this->owner_->getTeamBases(0)) + ")";
    74             std::string bases2 = "(" + multi_cast<std::string>(this->owner_->getTeamBases(1)) + ")";
     73            const std::string& bases1 = '(' + multi_cast<std::string>(this->owner_->getTeamBases(0)) + ')';
     74            const std::string& bases2 = '(' + multi_cast<std::string>(this->owner_->getTeamBases(1)) + ')';
    7575
    76             std::string score1 = multi_cast<std::string>(this->owner_->getTeamPoints(0));
    77             std::string score2 = multi_cast<std::string>(this->owner_->getTeamPoints(1));
     76            const std::string& score1 = multi_cast<std::string>(this->owner_->getTeamPoints(0));
     77            const std::string& score2 = multi_cast<std::string>(this->owner_->getTeamPoints(1));
    7878
    7979            std::string output1;
     
    9999            }
    100100
    101             std::string output = "";
     101            std::string output;
    102102            if (this->bShowBases_ || this->bShowScore_)
    103103            {
    104104                if (this->bShowLeftTeam_ && this->bShowRightTeam_)
    105                     output = output1 + ":" + output2;
     105                    output = output1 + ':' + output2;
    106106                else if (this->bShowLeftTeam_ || this->bShowRightTeam_)
    107107                    output = output1 + output2;
  • code/branches/pickup2/src/modules/overlays/hud/UnderAttackHealthBar.cc

    r5929 r6412  
    3434#include "gametypes/UnderAttack.h"
    3535#include "worldentities/pawns/Destroyer.h"
     36#include "overlays/OverlayGroup.h"
    3637
    3738namespace orxonox
     
    5859    {
    5960        if (this->isInitialized())
     61        {
    6062            this->text_->destroy();
     63            this->text_ = 0;
     64        }
    6165    }
    6266
     
    9195    }
    9296
     97    void UnderAttackHealthBar::changedOverlayGroup()
     98    {
     99        SUPER(UnderAttackHealthBar, changedOverlayGroup);
     100
     101        this->getOverlayGroup()->addElement(this->text_.get());
     102    }
     103
    93104    void UnderAttackHealthBar::init()
    94105    {
  • code/branches/pickup2/src/modules/overlays/hud/UnderAttackHealthBar.h

    r5929 r6412  
    4646            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4747            virtual void changedOwner();
     48            virtual void changedOverlayGroup();
    4849
    4950            inline void setDescriptionPickPoint(const Vector2& pickpoint)
     
    6162
    6263            PlayerInfo* owner_;
    63             OverlayText* text_;
     64            SmartPtr<OverlayText> text_;
    6465            Timer inittimer_;
    6566    };
  • code/branches/pickup2/src/modules/overlays/stats/CreateLines.cc

    r5929 r6412  
    8787        this->background_->setVisible(visible);
    8888    }
     89    void CreateLines::changedVisibility()
     90    {
     91        this->scoreText_->changedVisibility();
     92        this->deathsText_->changedVisibility();
     93        this->playerNameText_->changedVisibility();
     94        this->background_->changedVisibility();
     95    }
     96
     97    void CreateLines::setOverlayGroup( OverlayGroup* group )
     98    {
     99        this->scoreText_->setOverlayGroup( group );
     100        this->deathsText_->setOverlayGroup( group );
     101        this->playerNameText_->setOverlayGroup( group );
     102        this->background_->setOverlayGroup( group );
     103    }
    89104
    90105    /**
  • code/branches/pickup2/src/modules/overlays/stats/CreateLines.h

    r5781 r6412  
    4444
    4545        void setVisibility(bool);
     46        void changedVisibility();
     47        void setOverlayGroup( OverlayGroup* group );
    4648
    4749        //void setNumberOfColumns(unsigned int numberOfColumns, unsigned int lineIndex);
  • code/branches/pickup2/src/modules/overlays/stats/Scoreboard.cc

    r5929 r6412  
    6969
    7070        for (unsigned int i = 0; i < this->lines_.size(); ++i)
    71             this->lines_[i]->setVisibility(this->isVisible());
     71            this->lines_[i]->changedVisibility();
    7272    }
    7373
     
    8989            CreateLines* lines = new CreateLines(leftOffset, topOffset + (distance + height) * lines_.size(), width, height);
    9090            lines->setVisibility(this->isVisible());
     91            lines->setOverlayGroup( this->getOverlayGroup() );
    9192            this->lines_.push_back(lines);
    9293        }
  • code/branches/pickup2/src/modules/pong/Pong.cc

    r5929 r6412  
    4242    CreateEventName(PongCenterpoint, right);
    4343    CreateEventName(PongCenterpoint, left);
    44    
     44
    4545    CreateUnloadableFactory(Pong);
    4646
     
    164164            else if (player == this->getLeftPlayer())
    165165                this->center_->fireEvent(FireEventName(PongCenterpoint, left));
    166            
     166
    167167            if (player)
    168168                this->gtinfo_->sendAnnounceMessage(player->getName() + " scored");
  • code/branches/pickup2/src/modules/pong/PongAI.cc

    r5929 r6412  
    6262    {
    6363        for (std::list<std::pair<Timer*, char> >::iterator it = this->reactionTimers_.begin(); it != this->reactionTimers_.end(); ++it)
    64             (*it).first->destroy();
     64            it->first->destroy();
    6565    }
    6666
     
    131131                this->bOscillationAvoidanceActive_ = false;
    132132            }
    133            
     133
    134134            // If the ball is close enough, calculate another random offset to accelerate the ball
    135135            if (!this->bChangedRandomOffset_)
     
    206206            // calculate the time until the ball reaches the other side
    207207            float totaltime = (-position.x + dimension.x / 2 * sgn(velocity.x)) / velocity.x;
    208            
     208
    209209            // calculate wall bounce position (four possible solutions of the equation: pos.z + vel.z*t + acc.z/2*t^2 = +/- dim.z/2)
    210210            float bouncetime = totaltime;
    211211            bool bUpperWall = false;
    212            
     212
    213213            if (acceleration.z == 0)
    214214            {
     
    270270                // ball bounces after <bouncetime> seconds, update the position and continue
    271271                velocity.z = velocity.z + acceleration.z * bouncetime;
    272                
     272
    273273                if (bUpperWall)
    274274                {
     
    281281                    velocity.z = fabs(velocity.z) - fabs(randomErrorZ);
    282282                }
    283                    
     283
    284284                position.x = position.x + velocity.x * bouncetime + randomErrorX;
    285285                this->ballEndPosition_ = position.z;
  • code/branches/pickup2/src/modules/pong/PongBall.cc

    r5929 r6412  
    105105                        velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
    106106                        acceleration = this->bat_[1]->getVelocity() * this->accelerationFactor_ * -1;
    107                        
     107
    108108                        this->fireEvent();
    109109                    }
  • code/branches/pickup2/src/modules/pong/PongScore.cc

    r5929 r6412  
    7777            std::string name2;
    7878
    79             std::string score1 = "0";
    80             std::string score2 = "0";
     79            std::string score1("0");
     80            std::string score2("0");
    8181
    8282            if (player1)
     
    114114            }
    115115
    116             std::string output = "PONG";
     116            std::string output("PONG");
    117117            if (this->bShowName_ || this->bShowScore_)
    118118            {
    119119                if (this->bShowLeftPlayer_ && this->bShowRightPlayer_)
    120                     output = output1 + ":" + output2;
     120                    output = output1 + ':' + output2;
    121121                else if (this->bShowLeftPlayer_ || this->bShowRightPlayer_)
    122122                    output = output1 + output2;
  • code/branches/pickup2/src/modules/questsystem/AddQuestHint.cc

    r5781 r6412  
    7171
    7272        XMLPortParam(AddQuestHint, "hintId", setHintId, getHintId, xmlelement, mode);
    73        
     73
    7474        COUT(3) << "New AddQuestHint, with target QuestHint {" << this->getHintId() << "}, created." << std::endl;
    7575    }
     
    9090            return false;
    9191        }
    92        
     92
    9393        this->hintId_ = id;
    9494        return true;
  • code/branches/pickup2/src/modules/questsystem/AddReward.cc

    r5781 r6412  
    6767
    6868        XMLPortObject(AddReward, Rewardable, "", addRewardable, getRewardables, xmlelement, mode);
    69        
     69
    7070        COUT(3) << "New AddReward, with " << this->rewards_.size() << " Rewardables created." << std::endl;
    7171    }
     
    104104    {
    105105        COUT(3) << "AddReward on player: " << player << " ." << std::endl;
    106        
     106
    107107        bool check = true;
    108108        for ( std::list<Rewardable*>::iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward )
     
    110110            check = check && (*reward)->reward(player);
    111111        }
    112        
     112
    113113        COUT(3) << "Rewardable successfully added to player." << player << " ." << std::endl;
    114114
  • code/branches/pickup2/src/modules/questsystem/ChangeQuestStatus.cc

    r5781 r6412  
    8383            return false;
    8484        }
    85        
     85
    8686        this->questId_ = id;
    8787        return true;
  • code/branches/pickup2/src/modules/questsystem/CompleteQuest.cc

    r5781 r6412  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    6767    {
    6868        SUPER(CompleteQuest, XMLPort, xmlelement, mode);
    69        
     69
    7070        COUT(3) << "New CompleteQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
    7171    }
  • code/branches/pickup2/src/modules/questsystem/FailQuest.cc

    r5781 r6412  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    6767    {
    6868        SUPER(FailQuest, XMLPort, xmlelement, mode);
    69        
     69
    7070        COUT(3) << "New FailQUest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
    7171    }
     
    103103            return false;
    104104        }
    105        
     105
    106106        COUT(3) << "Quest {" << quest->getId() << "} failed by player: " << player << " ." << std::endl;
    107107        return true;
  • code/branches/pickup2/src/modules/questsystem/GlobalQuest.cc

    r5781 r6412  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    5959
    6060    }
    61    
     61
    6262    /**
    6363    @brief
     
    6767    {
    6868        SUPER(GlobalQuest, XMLPort, xmlelement, mode);
    69        
     69
    7070        XMLPortObject(GlobalQuest, QuestEffect, "reward-effects", addRewardEffect, getRewardEffects, xmlelement, mode);
    7171
    7272        COUT(3) << "New GlobalQuest {" << this->getId() << "} created." << std::endl;
    7373    }
    74    
     74
    7575    /**
    7676    @brief
     
    8989            return false;
    9090        }
    91        
     91
    9292        Quest::fail(player);
    93    
     93
    9494    //! Iterate through all players possessing this Quest.
    9595    for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
     
    118118            return false;
    119119        }
    120        
     120
    121121        //! Iterate through all players possessing the Quest.
    122122        for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
     
    124124            QuestEffect::invokeEffects(*it, this->getCompleteEffectList());
    125125        }
    126    
     126
    127127        Quest::complete(player);
    128    
     128
    129129        QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward QuestEffects on the player completing the Quest.
    130130        return true;
     
    230230            this->players_.insert(player); //!< Add the player to the set.
    231231        }
    232        
     232
    233233        this->status_ = status; //!< Set the status, which is global, remember...?
    234234        return true;
    235235    }
    236    
     236
    237237    /**
    238238    @brief
     
    256256        return true;
    257257    }
    258    
     258
    259259    /**
    260260    @brief
  • code/branches/pickup2/src/modules/questsystem/LocalQuest.cc

    r5781 r6412  
    8787            return false;
    8888        }
    89        
     89
    9090        Quest::fail(player);
    91        
     91
    9292        QuestEffect::invokeEffects(player, this->getFailEffectList()); //!< Invoke the failEffects.
    9393        return true;
     
    110110            return false;
    111111        }
    112        
     112
    113113        Quest::complete(player);
    114        
     114
    115115        QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the complete QuestEffects.
    116116        return true;
     
    188188            return it->second;
    189189        }
    190        
     190
    191191        return QuestStatus::Inactive; //!< If the player is not yet in the map, that means the status of the quest form him is 'inactive'.
    192192    }
     
    209209            return false;
    210210        }
    211        
     211
    212212        this->playerStatus_[player] = status;
    213213        return true;
  • code/branches/pickup2/src/modules/questsystem/Quest.cc

    r5781 r6412  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    204204    {
    205205        int i = index;
    206        
     206
    207207        //! Iterate through all subquests.
    208208        for (std::list<Quest*>::const_iterator subQuest = this->subQuests_.begin(); subQuest != this->subQuests_.end(); ++subQuest)
     
    214214            i--;
    215215        }
    216        
     216
    217217        return NULL; //!< If the index is greater than the number of elements in the list.
    218218    }
     
    229229    {
    230230        int i = index;
    231        
     231
    232232        //! Iterate through all QuestHints.
    233233        for (std::list<QuestHint*>::const_iterator hint = this->hints_.begin(); hint != this->hints_.end(); ++hint)
     
    253253    {
    254254        int i = index;
    255        
     255
    256256        //! Iterate through all fail QuestEffects.
    257257        for (std::list<QuestEffect*>::const_iterator effect = this->failEffects_.begin(); effect != this->failEffects_.end(); ++effect)
     
    277277    {
    278278        int i = index;
    279        
     279
    280280        //! Iterate through all complete QuestEffects.
    281281        for (std::list<QuestEffect*>::const_iterator effect = this->completeEffects_.begin(); effect != this->completeEffects_.end(); ++effect)
     
    350350        return this->getStatus(player) == QuestStatus::Completed;
    351351    }
    352    
     352
    353353    /**
    354354    @brief
     
    363363        QuestListener::advertiseStatusChange(this->listeners_, "fail"); //!< Tells the QuestListeners, that the status has changed to failed.
    364364        this->setStatus(player, QuestStatus::Failed);
    365        
     365
    366366        COUT(4) << "Quest {" << this->getId() << "} is failed for player: " << player << " ." <<std::endl;
    367        
     367
    368368        this->getDescription()->sendFailQuestNotification();
    369369        return true;
    370370    }
    371    
     371
    372372    /**
    373373    @brief
     
    382382        QuestListener::advertiseStatusChange(this->listeners_, "complete"); //!< Tells the QuestListeners, that the status has changed to completed.
    383383        this->setStatus(player, QuestStatus::Completed);
    384        
     384
    385385        COUT(4) << "Quest {" << this->getId() << "} is completed for player: " << player << " ." <<std::endl;
    386        
     386
    387387        this->getDescription()->sendCompleteQuestNotification();
    388388        return true;
     
    404404            return false;
    405405        }
    406        
     406
    407407        COUT(4) << "Quest {" << this->getId() << "} is started for player: " << player << " ." <<std::endl;
    408        
     408
    409409        QuestListener::advertiseStatusChange(this->listeners_, "start"); //!< Tells the QuestListeners, that the status has changed to active.
    410        
     410
    411411        this->setStatus(player, QuestStatus::Active);
    412        
     412
    413413        this->getDescription()->sendAddQuestNotification();
    414414        return true;
    415415    }
    416    
     416
    417417    /**
    418418    @brief
     
    430430            return false;
    431431        }
    432        
     432
    433433        this->listeners_.push_back(listener);
    434434        return true;
  • code/branches/pickup2/src/modules/questsystem/QuestDescription.cc

    r5781 r6412  
    5050    {
    5151        RegisterObject(QuestDescription);
    52        
    53         this->title_ = "";
    54         this->description_ = "";
    5552    }
    5653
     
    7976        COUT(3) << "New QuestDescription with title '" << this->getTitle() << "' created." << std::endl;
    8077    }
    81    
     78
    8279    /**
    8380    @brief
     
    9491    bool QuestDescription::notificationHelper(const std::string & item, const std::string & status) const
    9592    {
    96         std::string message = "";
     93        std::string message;
    9794        if(item == "hint")
    9895        {
    99             message = "You received a hint: '" + this->title_ + "'";
     96            message = "You received a hint: '" + this->title_ + '\'';
    10097        }
    10198        else if(item == "quest")
     
    103100            if(status == "start")
    104101            {
    105                 message = "You received a new quest: '" + this->title_ + "'";
     102                message = "You received a new quest: '" + this->title_ + '\'';
    106103            }
    107104            else if(status == "fail")
    108105            {
    109                 message = "You failed the quest: '" + this->title_ + "'";
     106                message = "You failed the quest: '" + this->title_ + '\'';
    110107            }
    111108            else if(status == "complete")
    112109            {
    113                 message = "You successfully completed the quest: '" + this->title_ + "'";
     110                message = "You successfully completed the quest: '" + this->title_ + '\'';
    114111            }
    115112            else
     
    124121            return false;
    125122        }
    126        
     123
    127124        QuestNotification* notification = new QuestNotification(message);
    128125        notification->send();
  • code/branches/pickup2/src/modules/questsystem/QuestEffect.cc

    r5781 r6412  
    6969    {
    7070        bool check = true;
    71        
     71
    7272        COUT(4) << "Invoking QuestEffects on player: " << player << " ."  << std::endl;
    7373
  • code/branches/pickup2/src/modules/questsystem/QuestGUI.cc

    r5929 r6412  
    7777        }
    7878        this->windows_.clear();
    79        
     79
    8080        if(this->root_ != NULL)
    8181            this->root_->destroy();
     
    104104
    105105        this->clear(); //!< Clear the GUI.
    106        
     106
    107107        int depth = 0;
    108108        int index = 0;
     
    116116        for(std::map<std::string, Quest*>::iterator it = quests.begin(); it != quests.end(); it++)
    117117        {
    118             Quest* quest = (*it).second;
     118            Quest* quest = it->second;
    119119            if(quest->getParentQuest() == NULL && !quest->isInactive(this->player_)) //!< If the Quest isn't inactive and a root Quest (meaning it has no parent.), create a Node.
    120120            {
     
    136136        for(std::map<CEGUI::Window*, QuestGUINode*>::iterator it = this->nodes_.begin(); it != this->nodes_.end(); it++)
    137137        {
    138             QuestGUINode* node = (*it).second;
     138            QuestGUINode* node = it->second;
    139139            if(node == NULL)
    140140            {
     
    209209        for(std::map<PlayerInfo*, QuestGUI*>::iterator it = QuestManager::getInstance().questGUIs_.begin(); it != QuestManager::getInstance().questGUIs_.end(); it++)
    210210        {
    211             QuestGUI* gui = (*it).second;
     211            QuestGUI* gui = it->second;
    212212            std::map<CEGUI::Window*, QuestGUINode*>::iterator node = gui->nodes_.find(window);
    213213            if(node != gui->nodes_.end()) return node->second;
     
    235235
    236236        this->nodes_.insert(std::pair<CEGUI::Window*, QuestGUINode*>(node->getWindow(),node)); //!< Insert the node and its window in the nodes_ map.
    237        
     237
    238238        index++;
    239239
     
    268268        index = tempIndex; //!< Reset the index to the original level.
    269269
    270         return index;       
     270        return index;
    271271    }
    272272
  • code/branches/pickup2/src/modules/questsystem/QuestGUI.h

    r5781 r6412  
    5656
    5757        public:
    58        
     58
    5959            QuestGUI(PlayerInfo* player);
    6060            virtual ~QuestGUI();
     
    8686            inline PlayerInfo* getPlayer(void)
    8787                { return this->player_; }
    88    
     88
    8989        private:
    90            
     90
    9191            int createNode(QuestGUINode* parent, QuestItem* item, int depth, int index); //!< Recursive method to create Nodes for all Quests an Hints the given Quest is a parent to.
    9292
  • code/branches/pickup2/src/modules/questsystem/QuestGUINode.cc

    r5781 r6412  
    7171    QuestGUINode::QuestGUINode(QuestGUI* gui, QuestGUINode* parent, QuestItem* item, int depth, int index)
    7272    {
    73         this->initialize();   
     73        this->initialize();
    7474
    7575        this->gui_ = gui;
     
    119119    void QuestGUINode::toggleVisibility(void)
    120120    {
    121        
     121
    122122    }
    123123
     
    134134        if(this->window_ != NULL)
    135135        {
    136             buffer = (std::string)(this->window_->getName().c_str());
     136            buffer = this->window_->getName().c_str();
    137137        }
    138138        else
    139139        {
    140             buffer = "";
     140            buffer.erase();
    141141        }
    142142    }
     
    154154
    155155        if(this->details_ == NULL) //!< If the details window was not already created.
    156         { 
     156        {
    157157            std::ostringstream stream;
    158158
     
    187187                CEGUI::Window* statusWindow = this->gui_->getWindowManager()->createWindow("TaharezLook/StaticText", stream.str());
    188188                window->addChildWindow(statusWindow);
    189                 std::string status = "";
     189                std::string status;
    190190                if(quest->isActive(this->gui_->getPlayer()))
    191191                {
     
    209209                offset += height;
    210210            }
    211            
     211
    212212            //! Create title pane for the description.
    213213            stream.str("");
     
    282282    {
    283283        COUT(3) << "Open QuestItem..." << std::endl;
    284        
     284
    285285        //CEGUI::Window* window = this->gui_->getRootWindow();
    286286        CEGUI::Window* window = this->gui_->getWindowManager()->getWindow("orxonox/QuestGUI/Background");
     
    297297    */
    298298    bool QuestGUINode::closeDetails(const CEGUI::EventArgs& e)
    299     {       
     299    {
    300300        //CEGUI::Window* window = this->gui_->getRootWindow();
    301301        CEGUI::Window* window = this->gui_->getWindowManager()->getWindow("orxonox/QuestGUI/Background");
     
    344344        //! Set the height to the window.
    345345        window->setHeight(CEGUI::UDim(0, height));
    346        
     346
    347347        //Debug
    348348        const CEGUI::Rect newArea = getStaticTextArea(window);
     
    368368    {
    369369        Quest* quest = dynamic_cast<Quest*>(this->item_);
    370        
     370
    371371        this->window_ = this->gui_->getWindow();
    372372        std::ostringstream stream;
     
    377377        }
    378378        stream << this->index_;
    379        
     379
    380380        this->window_->rename(stream.str());
    381381        this->window_->setText(this->item_->getDescription()->getTitle());
  • code/branches/pickup2/src/modules/questsystem/QuestGUINode.h

    r5781 r6412  
    4444
    4545        public:
    46    
     46
    4747            QuestGUINode(void);
    4848            QuestGUINode(QuestGUI* gui, QuestGUINode* parent, QuestItem* item, int depth, int index);
    4949            virtual ~QuestGUINode(void);
    50    
     50
    5151            void toggleVisibility(void);
    5252
     
    5454            /**
    5555            @brief Retreive the window of this node.
    56             @return The CEGUI Window of this node. 
     56            @return The CEGUI Window of this node.
    5757            */
    5858            inline CEGUI::Window* getWindow(void)
  • code/branches/pickup2/src/modules/questsystem/QuestHint.cc

    r5781 r6412  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    7171
    7272        QuestManager::getInstance().registerHint(this); //!< Registers the QuestHint with the QuestManager.
    73        
     73
    7474        COUT(3) << "New QuestHint {" << this->getId() << "} created." << std::endl;
    7575    }
     
    100100            return it->second;
    101101        }
    102        
     102
    103103        return QuestStatus::Inactive;
    104104    }
     
    119119            {
    120120                this->playerStatus_[player] = QuestHintStatus::Active;
    121                
     121
    122122                this->getDescription()->sendAddHintNotification();
    123123                return true;
     
    129129            }
    130130        }
    131        
     131
    132132        COUT(2) << "A hint of a non-active quest was trying to get activated." << std::endl;
    133133        return false;
  • code/branches/pickup2/src/modules/questsystem/QuestItem.cc

    r5781 r6412  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    4747    {
    4848        RegisterObject(QuestItem);
    49 
    50         this->id_ = "";
    5149    }
    5250
     
    8684            return;
    8785        }
    88        
     86
    8987        this->id_ = id;
    9088    }
  • code/branches/pickup2/src/modules/questsystem/QuestListener.cc

    r5781 r6412  
    5050    {
    5151        RegisterObject(QuestListener);
    52        
     52
    5353        this->mode_ = QuestListenerMode::All;
    5454        this->quest_ = NULL;
    5555    }
    56    
     56
    5757    /**
    5858    @brief
     
    6262    {
    6363    }
    64    
     64
    6565    /**
    6666    @brief
     
    7575
    7676        this->quest_->addListener(this); //!< Adds the QuestListener to the Quests list of listeners.
    77        
     77
    7878        COUT(3) << "QuestListener created for quest: {" << this->quest_->getId() << "} with mode '" << this->getMode() << "'." << std::endl;
    7979    }
    80    
     80
    8181    /**
    8282    @brief
     
    9898        }
    9999    }
    100    
     100
    101101    /**
    102102    @brief
     
    110110    {
    111111        this->quest_ = QuestManager::getInstance().findQuest(id); //!< Find the Quest corresponding to the given questId.
    112        
     112
    113113        if(this->quest_ == NULL) //!< If there is no such Quest.
    114114        {
     
    116116            return false;
    117117        }
    118        
     118
    119119        return true;
    120120    }
    121    
     121
    122122    /**
    123123    @brief
     
    152152        return false;
    153153        }
    154        
     154
    155155        return true;
    156156    }
    157    
     157
    158158    /**
    159159    @brief
     
    183183        {
    184184            COUT(1) << "An unforseen, never to happen, Error has occurred. This is impossible!" << std::endl;
    185         return "";
     185            return "";
    186186        }
    187187    }
     
    193193        Returns the questId of the Quest the QuestListener reacts to.
    194194    */
    195     const std::string & QuestListener::getQuestId(void)   
     195    const std::string & QuestListener::getQuestId(void)
    196196    {
    197197        return this->quest_->getId();
  • code/branches/pickup2/src/modules/questsystem/QuestManager.cc

    r5929 r6412  
    5555    DeclareToluaInterface(Questsystem);
    5656
    57     //! Pointer to the current (and single) instance of this class.
    58     /*static*/ QuestManager* QuestManager::singletonPtr_s = NULL;
    5957    ManageScopedSingleton(QuestManager, ScopeID::Root, false);
    6058
     
    7876        for(std::map<PlayerInfo*, QuestGUI*>::iterator it = this->questGUIs_.begin(); it != this->questGUIs_.end(); it++)
    7977        {
    80             (*it).second->destroy();
     78            it->second->destroy();
    8179        }
    8280        this->questGUIs_.clear();
  • code/branches/pickup2/src/modules/questsystem/QuestManager.h

    r5929 r6412  
    7272            static QuestManager& getInstance() { return Singleton<QuestManager>::getInstance(); } // tolua_export
    7373
    74             //! Retreive the main window for the GUI. 
     74            //! Retreive the main window for the GUI.
    7575            CEGUI::Window* getQuestGUI(const std::string & guiName); // tolua_export
    7676
  • code/branches/pickup2/src/modules/questsystem/QuestNotification.cc

    r5781 r6412  
    3232namespace orxonox {
    3333
    34     const std::string QuestNotification::SENDER = "questsystem";
     34    const std::string QuestNotification::SENDER("questsystem");
    3535
    3636    QuestNotification::QuestNotification(BaseObject* creator) : Notification(creator)
     
    3838        this->initialize();
    3939    }
    40    
     40
    4141    QuestNotification::QuestNotification(const std::string & message) : Notification(message)
    4242    {
    4343        this->initialize();
    4444    }
    45    
     45
    4646    QuestNotification::~QuestNotification()
    4747    {
    48        
     48
    4949    }
    5050
  • code/branches/pickup2/src/modules/questsystem/notifications/Notification.cc

    r5781 r6412  
    4949        this->initialize();
    5050    }
    51    
     51
    5252    /**
    5353    @brief
     
    6060        this->message_ = message;
    6161    }
    62    
     62
    6363    /**
    6464    @brief
     
    6868    {
    6969    }
    70    
     70
    7171    /**
    7272    @brief
     
    7575    void Notification::initialize(void)
    7676    {
    77         this->message_ = "";
     77        this->message_.clear();
    7878        this->sender_ = NotificationManager::NONE;
    7979        this->sent_ = false;
    8080    }
    81    
     81
    8282    /**
    8383    @brief
     
    9090        return this->send(NotificationManager::NONE);
    9191    }
    92    
     92
    9393    /**
    9494    @brief
     
    106106            return false;
    107107        this->sent_ = true;
    108        
     108
    109109        COUT(3) << "Notification \"" << this->getMessage() << "\" sent." << std::endl;
    110        
     110
    111111        return true;
    112112    }
    113    
     113
    114114    /**
    115115    @brief
  • code/branches/pickup2/src/modules/questsystem/notifications/NotificationManager.cc

    r5929 r6412  
    4444{
    4545
    46     const std::string NotificationManager::ALL = "all";
    47     const std::string NotificationManager::NONE = "none";
     46    const std::string NotificationManager::ALL("all");
     47    const std::string NotificationManager::NONE("none");
    4848
    49     NotificationManager* NotificationManager::singletonPtr_s = NULL;
    5049    ManageScopedSingleton(NotificationManager, ScopeID::Root, false);
    5150
  • code/branches/pickup2/src/modules/questsystem/notifications/NotificationQueue.cc

    r5929 r6412  
    4646    CreateFactory(NotificationQueue);
    4747
    48     const std::string NotificationQueue::DEFAULT_FONT = "VeraMono";
    49     const Vector2 NotificationQueue::DEFAULT_POSITION = Vector2(0.0,0.0);
    50     const float NotificationQueue::DEFAULT_FONT_SIZE  = 0.025f;
     48    const std::string NotificationQueue::DEFAULT_FONT("VeraMono");
     49    const Vector2 NotificationQueue::DEFAULT_POSITION(0.0,0.0);
     50    const float NotificationQueue::DEFAULT_FONT_SIZE = 0.025f;
    5151
    5252    /**
     
    271271            if(!first)
    272272            {
    273                 *string += ",";
     273                *string += ',';
    274274            }
    275275            else
     
    300300        while( index < targets.size() ) //!< Go through the string, character by character until the end is reached.
    301301        {
    302             pTemp = new std::string("");
     302            pTemp = new std::string();
    303303            while(index < targets.size() && targets[index] != ',' && targets[index] != ' ')
    304304            {
     
    399399        std::ostringstream stream;
    400400        stream << reinterpret_cast<unsigned long>(notification);
    401         std::string addressString = stream.str() ;
     401        const std::string& addressString = stream.str();
    402402        container->name = "NotificationOverlay(" + timeString + ")&" + addressString;
    403403
  • code/branches/pickup2/src/modules/weapons/projectiles/CMakeLists.txt

    r5781 r6412  
    44  Projectile.cc
    55  LightningGunProjectile.cc
     6  Rocket.cc
    67)
  • code/branches/pickup2/src/modules/weapons/projectiles/LightningGunProjectile.cc

    r5929 r6412  
    4343        this->maxTextureIndex_ = 8;
    4444        this->textureTimer_.setTimer(0.01f, true, createExecutor(createFunctor(&LightningGunProjectile::changeTexture, this)));
    45        
     45
    4646        registerVariables();
    4747    }
    48    
     48
    4949    void LightningGunProjectile::registerVariables()
    5050    {
    5151        registerVariable(this->materialBase_);
    5252    }
    53    
     53
    5454    void LightningGunProjectile::setMaterial(const std::string& material)
    5555    {
    56         this->materialBase_ = material;   
    57    
     56        this->materialBase_ = material;
     57
    5858        BillboardProjectile::setMaterial(material + multi_cast<std::string>(this->textureIndex_));
    5959    }
     
    6464        if (this->textureIndex_ > this->maxTextureIndex_)
    6565            this->textureIndex_ = 1;
    66        
     66
    6767        this->setMaterial(this->materialBase_);
    6868    }
  • code/branches/pickup2/src/modules/weapons/projectiles/Projectile.cc

    r6405 r6412  
    4848        this->bDestroy_ = false;
    4949        this->owner_ = 0;
     50        this->damage_ = 15;
    5051
    5152        // Get notification about collisions
     
    5354        if (GameMode::isMaster())
    5455        {
     56            this->setMass(1.0);
    5557            this->enableCollisionCallback();
    5658            this->setCollisionResponse(false);
     
    7173    void Projectile::setConfigValues()
    7274    {
    73         SetConfigValue(damage_, 15.0).description("The damage caused by the projectile");
    7475        SetConfigValue(lifetime_, 4.0).description("The time in seconds a projectile stays alive");
    7576    }
     
    129130            Pawn* victim = orxonox_cast<Pawn*>(otherObject);
    130131            if (victim)
    131                 victim->damage(dmg, this->owner_);
     132                victim->hit(this->owner_, contactPoint, dmg);
    132133        }
    133134        return false;
  • code/branches/pickup2/src/modules/weapons/weaponmodes/CMakeLists.txt

    r5781 r6412  
    55  HsW01.cc
    66  LightningGun.cc
     7  RocketFire.cc
    78)
  • code/branches/pickup2/src/modules/weapons/weaponmodes/HsW01.cc

    r5929 r6412  
    3939#include "weaponsystem/WeaponPack.h"
    4040#include "weaponsystem/WeaponSystem.h"
     41#include "worldentities/WorldEntity.h"
     42#include "worldentities/pawns/Pawn.h"
    4143
    4244namespace orxonox
     
    5658        this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&HsW01::shot, this)));
    5759        this->delayTimer_.stopTimer();
     60
     61        this->setDefaultSound("sounds/Weapon_HsW01.ogg");
     62    }
     63
     64    HsW01::~HsW01()
     65    {
    5866    }
    5967
     
    103111    void HsW01::shot()
    104112    {
     113        assert( this->getWeapon() && this->getWeapon()->getWeaponPack() && this->getWeapon()->getWeaponPack()->getWeaponSystem() && this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn() );
    105114        Projectile* projectile = new Projectile(this);
    106115        Model* model = new Model(projectile);
     
    110119        model->setScale(5);
    111120
     121        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
    112122        projectile->setOrientation(this->getMuzzleOrientation());
    113123        projectile->setPosition(this->getMuzzlePosition());
  • code/branches/pickup2/src/modules/weapons/weaponmodes/HsW01.h

    r5929 r6412  
    4141        public:
    4242            HsW01(BaseObject* creator);
    43             virtual ~HsW01() {}
     43            virtual ~HsW01();
    4444
    4545            virtual void fire();
  • code/branches/pickup2/src/modules/weapons/weaponmodes/LightningGun.cc

    r5781 r6412  
    3434#include "weaponsystem/WeaponPack.h"
    3535#include "weaponsystem/WeaponSystem.h"
     36#include "worldentities/pawns/Pawn.h"
    3637
    3738namespace orxonox
     
    4849
    4950        this->setMunitionName("LaserMunition");
     51        this->setDefaultSound("sounds/Weapon_LightningGun.ogg");
    5052    }
    5153
     
    5961        projectile->setMaterial("Flares/LightningBall_");
    6062
     63        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
    6164        projectile->setOrientation(this->getMuzzleOrientation());
    6265        projectile->setPosition(this->getMuzzlePosition());
  • code/branches/pickup2/src/modules/weapons/weaponmodes/LightningGun.h

    r5781 r6412  
    4242
    4343            virtual void fire();
     44
    4445       private:
    4546            float speed_;
Note: See TracChangeset for help on using the changeset viewer.