Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 24, 2008, 1:50:47 AM (16 years ago)
Author:
landauf
Message:

Update your media repository and delete keybindings.ini if you want to use boost (space).

  • Added new class "Engine" to control the speed of a SpaceShip (Engine is an Item, MultiStateEngine is a specialized version of Engine)
  • Added FadingBillboard, a billboard with the ability to fade in and out smoothly when activated/deactivated.
  • Several changes in Backlight, it's now a child of FadingBillboard
  • Some changes concerning local control in ControllableEntity
  • Fixed a bug in WorldEntity caused by different destruction order of attached objects on server and client
  • Added a "MainState" to BaseObject. An object has several states (activity, visibility, …) and one of it can be defined as "MainState" in the XML file. Other objects can change this state without knowing which state it really is (used by MultiStateEngine).
File:
1 edited

Legend:

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

    r2171 r2254  
    3636#ifndef _BaseObject_H__
    3737#define _BaseObject_H__
     38
     39#define SetMainState(classname, statename, setfunction, getfunction) \
     40    if (this->getMainStateName() == statename) \
     41    { \
     42        this->functorSetMainState_ = createFunctor(&classname::setfunction)->setObject(this); \
     43        this->functorGetMainState_ = createFunctor(&classname::getfunction)->setObject(this); \
     44    }
    3845
    3946#include <map>
     
    100107            virtual void changedVisibility() {}
    101108
     109            void setMainState(bool state);
     110            bool getMainState() const;
     111
     112            void setMainStateName(const std::string& name);
     113            inline const std::string& getMainStateName() const { return this->mainStateName_; }
     114            virtual void changedMainState();
     115
    102116            /** @brief Sets a pointer to the xml file that loaded this object. @param file The pointer to the XMLFile */
    103117            inline void setFile(const XMLFile* file) { this->file_ = file; }
     
    153167            std::string name_;                          //!< The name of the object
    154168            std::string oldName_;                       //!< The old name of the object
    155             mbool bActive_;                             //!< True = the object is active
    156             mbool bVisible_;                            //!< True = the object is visible
     169            mbool       bActive_;                       //!< True = the object is active
     170            mbool       bVisible_;                      //!< True = the object is visible
     171            std::string mainStateName_;
     172            Functor*    functorSetMainState_;
     173            Functor*    functorGetMainState_;
    157174
    158175        private:
     
    160177            Template* getTemplate(unsigned int index) const;
    161178
    162             bool                  bInitialized_;         //!< True if the object was initialized (passed the object registration)
    163             const XMLFile*        file_;                 //!< The XMLFile that loaded this object
    164             std::string           loaderIndentation_;    //!< Indentation of the debug output in the Loader
    165             Namespace*            namespace_;
    166             BaseObject*           creator_;
    167             Scene*                scene_;
    168             Gametype*             gametype_;
    169             Gametype*             oldGametype_;
    170             std::set<Template*>   templates_;
    171             std::map<BaseObject*, std::string> eventListeners_;
     179            bool                   bInitialized_;         //!< True if the object was initialized (passed the object registration)
     180            const XMLFile*         file_;                 //!< The XMLFile that loaded this object
     181            std::string            loaderIndentation_;    //!< Indentation of the debug output in the Loader
     182            Namespace*             namespace_;
     183            BaseObject*            creator_;
     184            Scene*                 scene_;
     185            Gametype*              gametype_;
     186            Gametype*              oldGametype_;
     187            std::set<Template*>    templates_;
     188            std::map<BaseObject*,  std::string> eventListeners_;
    172189            std::list<BaseObject*> events_;
    173190            std::map<std::string, EventContainer*> eventContainers_;
     
    178195    SUPER_FUNCTION(3, BaseObject, changedVisibility, false);
    179196    SUPER_FUNCTION(4, BaseObject, processEvent, false);
     197    SUPER_FUNCTION(6, BaseObject, changedMainState, false);
    180198}
    181199
Note: See TracChangeset for help on using the changeset viewer.