Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 27, 2009, 2:33:48 AM (16 years ago)
Author:
landauf
Message:
  • Enhanced SmartPtr: a) It stores now two pointers, one OrxonoxClass* (for reference counting) and one T* (for normal use). b) Incrementing the reference is now optional in the constructor for raw pointers. This is needed because Scene has a selfreference but should still be destroyable.
  • Changed BaseObject to store a SmartPtr to it's Scene instead of a normal pointer.
  • Changed setScene and getScene to deal directly with SmartPtr instead of a Scene* pointer to avoid casting-to-OrxonoxClass issues.
  • Fixed two problems with lost SceneManagers in CameraManger: a) added a SmartPtr to the Scene for the fallback camera b) added a call to GUIManager in the destructor to release the scene manager
  • Enabled unloading in GSLevel again (after years). Works if playing without bots.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/libraries/core/BaseObject.h

    r5738 r5805  
    5353#include "OrxonoxClass.h"
    5454#include "Super.h"
     55#include "SmartPtr.h"
    5556
    5657namespace orxonox
     
    134135            inline BaseObject* getCreator() const { return this->creator_; }
    135136
    136             inline void setScene(Scene* scene) { this->scene_ = scene; }
    137             inline Scene* getScene() const { return this->scene_; }
     137            inline void setScene(const SmartPtr<Scene>& scene) { this->scene_ = scene; }
     138            inline const SmartPtr<Scene>& getScene() const { return this->scene_; }
    138139
    139140            inline void setGametype(Gametype* gametype)
     
    194195            Namespace*             namespace_;
    195196            BaseObject*            creator_;
    196             Scene*                 scene_;
     197            SmartPtr<Scene>        scene_;
    197198            Gametype*              gametype_;
    198199            Gametype*              oldGametype_;
Note: See TracChangeset for help on using the changeset viewer.