Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 9:12:21 PM (9 years ago)
Author:
landauf
Message:

merged branch core7 back to trunk

Location:
code/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/overlays/InGameConsole.cc

    r9667 r10624  
    4545#include "util/Math.h"
    4646#include "util/DisplayStringConversions.h"
    47 #include "util/ScopedSingletonManager.h"
    4847#include "util/output/MemoryWriter.h"
    4948#include "util/output/OutputManager.h"
    5049#include "core/CoreIncludes.h"
    5150#include "core/config/ConfigValueIncludes.h"
    52 #include "core/command/ConsoleCommand.h"
     51#include "core/command/ConsoleCommandIncludes.h"
     52#include "core/singleton/ScopedSingletonIncludes.h"
    5353#include "core/GUIManager.h"
    5454#include "core/input/InputManager.h"
     
    6565    SetConsoleCommand("InGameConsole", "closeConsole", &InGameConsole::closeConsole);
    6666
    67     ManageScopedSingleton(InGameConsole, ScopeID::Graphics, false);
     67    ManageScopedSingleton(InGameConsole, ScopeID::GRAPHICS, false);
     68
     69    RegisterAbstractClass(InGameConsole).inheritsFrom<WindowEventListener>().inheritsFrom<UpdateListener>();
    6870
    6971    /**
  • code/trunk/src/orxonox/overlays/InGameConsole.h

    r8858 r10624  
    3939#include "core/WindowEventListener.h"
    4040#include "core/command/Shell.h"
     41#include "core/UpdateListener.h"
    4142
    4243namespace orxonox
    4344{
    44     class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener
     45    class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener, public UpdateListener
    4546    {
    4647        friend class Singleton<InGameConsole>;
     
    5354
    5455        void preUpdate(const Clock& time);
     56        void postUpdate(const Clock& time) { /*no action*/ }
    5557
    5658        static void openConsole();
  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc

    r9667 r10624  
    4848#include "core/CoreIncludes.h"
    4949#include "core/XMLPort.h"
    50 #include "core/command/ConsoleCommand.h"
     50#include "core/command/ConsoleCommandIncludes.h"
    5151
    5252#include "OverlayGroup.h"
  • code/trunk/src/orxonox/overlays/OverlayGroup.cc

    r9667 r10624  
    3636#include "core/CoreIncludes.h"
    3737#include "core/XMLPort.h"
    38 #include "core/command/ConsoleCommand.h"
     38#include "core/command/ConsoleCommandIncludes.h"
    3939#include "OrxonoxOverlay.h"
     40#include "gametypes/Gametype.h"
    4041
    4142namespace orxonox
     
    6162    OverlayGroup::~OverlayGroup()
    6263    {
    63         for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
     64        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    6465            (*it)->destroy();
    6566        this->hudElements_.clear();
     
    8586    void OverlayGroup::setScale(const Vector2& scale)
    8687    {
    87         for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
     88        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    8889            (*it)->scale(scale / this->scale_);
    8990        this->scale_ = scale;
     
    9394    void OverlayGroup::setScroll(const Vector2& scroll)
    9495    {
    95         for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
     96        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    9697            (*it)->scroll(scroll - this->scroll_);
    9798        this->scroll_ = scroll;
     
    106107    void OverlayGroup::addElement(OrxonoxOverlay* element)
    107108    {
    108         hudElements_.insert(SmartPtr<OrxonoxOverlay>(element));
     109        hudElements_.insert(element);
    109110        element->setOverlayGroup( this );
    110111        if (this->owner_)
     
    122123    bool OverlayGroup::removeElement(OrxonoxOverlay* element)
    123124    {
    124         if(this->hudElements_.erase(SmartPtr<OrxonoxOverlay>(element)) == 0)
     125        if(this->hudElements_.erase(element) == 0)
    125126            return false;
    126127        return true;
     
    132133        if (index < this->hudElements_.size())
    133134        {
    134             std::set< SmartPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin();
     135            std::set< StrongPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin();
    135136            for (unsigned int i = 0; i != index; ++it, ++i)
    136137                ;
    137             return it->get();
     138            return *it;
    138139        }
    139140        else
     
    146147        SUPER( OverlayGroup, changedVisibility );
    147148
    148         for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
     149        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    149150            (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
    150151    }
    151152
    152     //! Changes the gametype of all elements
    153     void OverlayGroup::changedGametype()
    154     {
    155         SUPER( OverlayGroup, changedGametype );
    156 
    157         for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    158             (*it)->setGametype(this->getGametype());
    159     }
    160 
    161153    void OverlayGroup::setOwner(BaseObject* owner)
    162154    {
    163155        this->owner_ = owner;
    164156
    165         for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
     157        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    166158            (*it)->setOwner(owner);
    167159    }
  • code/trunk/src/orxonox/overlays/OverlayGroup.h

    r9667 r10624  
    6565        static void scrollGroup(const std::string& name, const Vector2& scroll);
    6666
    67         inline const std::set< SmartPtr<OrxonoxOverlay> >& getOverlays() const
     67        inline const std::set< StrongPtr<OrxonoxOverlay> >& getOverlays() const
    6868            { return this->hudElements_; }
    6969
    7070        virtual void changedVisibility();
    71         virtual void changedGametype();
    7271
    7372        void setOwner(BaseObject* owner);
     
    9291
    9392    private:
    94         std::set< SmartPtr<OrxonoxOverlay> > hudElements_;    //!< Contains all the OrxonoxOverlays of the this group.
     93        std::set< StrongPtr<OrxonoxOverlay> > hudElements_;    //!< Contains all the OrxonoxOverlays of the this group.
    9594        Vector2 scale_;                            //!< Current scale (independent of the elements).
    9695        Vector2 scroll_;                           //!< Current scrolling offset.
Note: See TracChangeset for help on using the changeset viewer.