Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11690


Ignore:
Timestamp:
Dec 18, 2017, 12:40:00 PM (7 years ago)
Author:
patricwi
Message:

rolled back to functional without 2 branches

Location:
code/branches/Presentation_HS17
Files:
16 deleted
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • code/branches/Presentation_HS17

  • code/branches/Presentation_HS17/data/overlays/HUDPickupTemplate.oxo

    r11354 r11690  
    9292     correctaspect = true
    9393     iconmaterial  = "Orxonox/BarIconSpeed"
    94     >
     94     >
    9595      <BarColour position = 0.0 colour = "0.7,0.5,0.2" />
    9696      <BarColour position = 0.5 colour = "0.2,0.7,0.2" />
     
    193193    />
    194194
     195
    195196    <HUDTimer
    196197     name     = "Timer"
  • code/branches/Presentation_HS17/data/overlays/HUDTemplates3.oxo

    r11685 r11690  
    190190     position               = "0.32, 0.81"
    191191     pickpoint              = "0.0, 0.0"
    192      visible                = "true"
     192     visible                = "false"
    193193    />
    194194
  • code/branches/Presentation_HS17/src/libraries/core/BaseObject.h

    r11686 r11690  
    5858    class Gametype;
    5959    class Level;
    60     class ScriptableController;
    6160
    6261    /// The BaseObject is the parent of all classes representing an instance in the game.
     
    192191
    193192            static void loadAllEventStates(Element& xmlelement, XMLPort::Mode mode, BaseObject* object, Identifier* identifier);
    194 
    195193
    196194        protected:
  • code/branches/Presentation_HS17/src/libraries/tools/Timer.cc

    r11686 r11690  
    158158    }
    159159
    160     Timer::Timer(float interval, bool bLoop, std::function<void ()> func, bool bKillAfterCall)
    161     {
    162         this->init();
    163         RegisterObject(Timer);
    164 
    165         this->setTimer(interval, bLoop, func, bKillAfterCall);
    166     }
    167 
    168160    /**
    169161        @brief Initializes the Timer
     
    201193        this->executor_ = executor;
    202194        this->bActive_ = true;
    203         this->isStdFunction_ = false;
    204195
    205196        this->time_ = this->interval_;
    206197        this->bKillAfterCall_ = bKillAfterCall;
    207198
    208         if(executor != nullptr)
    209             executor->getFunctor()->setSafeMode(true);
    210     }
    211 
    212     void Timer::setTimer(float interval, bool bLoop, std::function<void ()> func, bool bKillAfterCall)
    213     {
    214         // Without the cast, the call would be ambiguous, because nullptr is castable to
    215         // both, ExecutorPtr and std::function.
    216         this->setTimer(interval, bLoop, static_cast<ExecutorPtr>(nullptr), bKillAfterCall);
    217         this->function_ = func;
    218         this->isStdFunction_ = true;
     199        executor->getFunctor()->setSafeMode(true);
    219200    }
    220201
     
    226207        bool temp = this->bKillAfterCall_; // to avoid errors with bKillAfterCall_=false and an exutors which destroy the timer
    227208
    228         if(this->isStdFunction_)
    229             this->function_();
    230         else
    231             (*this->executor_)();
     209        (*this->executor_)();
    232210
    233211        if (temp)
  • code/branches/Presentation_HS17/src/libraries/tools/Timer.h

    r11686 r11690  
    108108
    109109            Timer(float interval, bool bLoop, const ExecutorPtr& executor, bool bKillAfterCall = false);
    110             Timer(float interval, bool bLoop, std::function<void (void)> func, bool bKillAfterCall = false);
    111110
    112111            void setTimer(float interval, bool bLoop, const ExecutorPtr& executor, bool bKillAfterCall = false);
    113             void setTimer(float interval, bool bLoop, std::function<void (void)> func, bool bKillAfterCall = false);
    114112
    115113            void run();
     
    155153
    156154            ExecutorPtr executor_;  //!< The executor of the function that will be called when the time expires
    157             std::function<void (void)> function_;
    158155
    159             bool isStdFunction_;
    160156            long long interval_;    //!< The time-interval in micro seconds
    161157            bool bLoop_;            //!< If true, the executor gets called every @a interval seconds
  • code/branches/Presentation_HS17/src/modules/overlays/hud/CMakeLists.txt

    r11685 r11690  
    1111  HUDEnemyHealthBar.cc
    1212  HUDEnemyShieldBar.cc
    13   HUDWaypoints.cc
    1413  HUDWeaponMode.cc
    1514  HUDWeapon.cc
  • code/branches/Presentation_HS17/src/modules/questsystem/Quest.cc

    r11071 r11690  
    8080        XMLPortObject(Quest, QuestEffect, "fail-effects", addFailEffect, getFailEffect, xmlelement, mode);
    8181        XMLPortObject(Quest, QuestEffect, "complete-effects", addCompleteEffect, getCompleteEffect, xmlelement, mode);
     82        //XMLPortObject(Quest, Worldentity, "arrowtarget", addArrowTarget, getArrowTarget, xmlelement, mode);
    8283
    8384        QuestManager::getInstance().registerQuest(this); // Registers the Quest with the QuestManager.
    8485    }
     86
     87
     88    /*bool Quest::addArrowTarget(Quest* quest){
     89
     90        assert(quest);
     91
     92
     93    }*/
     94
     95
    8596
    8697    /**
  • code/branches/Presentation_HS17/src/orxonox/CMakeLists.txt

    r11686 r11690  
    5252ADD_SUBDIRECTORY(items)
    5353ADD_SUBDIRECTORY(overlays)
    54 ADD_SUBDIRECTORY(scriptablecontroller)
    5554ADD_SUBDIRECTORY(sound)
    5655ADD_SUBDIRECTORY(weaponsystem)
  • code/branches/Presentation_HS17/src/orxonox/Level.cc

    r11686 r11690  
    4242#include "overlays/OverlayGroup.h"
    4343#include "LevelManager.h"
    44 #include "scriptablecontroller/scriptable_controller.h"
    4544
    4645namespace orxonox
     
    5756        this->xmlfilename_ = this->getFilename();
    5857        this->xmlfile_ = nullptr;
    59         this->controller_.reset(new ScriptableController());
    6058    }
    6159
     
    8078        XMLPortParam(Level, "plugins",  setPluginsString,  getPluginsString,  xmlelement, mode);
    8179        XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype");
    82 
    83         XMLPortParamLoadOnly(Level, "script", setScript, xmlelement, mode);
    8480
    8581        XMLPortObject(Level, MeshLodInformation, "lodinformation", addLodInfo, getLodInfo, xmlelement, mode);
  • code/branches/Presentation_HS17/src/orxonox/Level.h

    r11686 r11690  
    4242namespace orxonox
    4343{
    44     class ScriptableController;
    45 
    4644    class _OrxonoxExport Level : public BaseObject, public Synchronisable, public Context
    4745    {
     
    5654
    5755            MeshLodInformation* getLodInfo(std::string meshName) const;
    58 
    59             inline ScriptableController *getScriptableController(void)
    60                 { return this->controller_.get(); }
    61 
    62             inline const std::string &getScript(void)
    63                 { return this->level_script_; }
    6456
    6557
     
    8678            void networkcallback_applyXMLFile();
    8779
    88             inline void setScript(const std::string &script)
    89                 { this->level_script_ = script; }
    90 
    91 
    9280            std::string                    pluginsString_;
    9381            std::list<PluginReference*>    plugins_;
     82
    9483            std::string                    gametype_;
    9584            std::string                    xmlfilename_;
     
    9786            std::list<BaseObject*>         objects_;
    9887            std::map<std::string,MeshLodInformation*>  lodInformation_;
    99 
    100             std::unique_ptr<ScriptableController> controller_;
    101             std::string           level_script_;
    10288    };
    10389}
  • code/branches/Presentation_HS17/src/orxonox/controllers/CMakeLists.txt

    r11685 r11690  
    1919  FightingController.cc
    2020  MasterController.cc
    21   AutonomousDroneController.cc
    22   ArrowController.cc
    2321)
  • code/branches/Presentation_HS17/src/orxonox/graphics/Model.cc

    r11685 r11690  
    7373
    7474        XMLPortParam(Model, "lodLevel", setLodLevel, getLodLevel, xmlelement, mode);
     75
    7576        XMLPortParam(Model, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
    7677        XMLPortParam(Model, "renderQueueGroup", setRenderQueueGroup, getRenderQueueGroup, xmlelement, mode);
  • code/branches/Presentation_HS17/src/orxonox/infos/GametypeInfo.cc

    r11686 r11690  
    4343#include "interfaces/GametypeMessageListener.h"
    4444#include "interfaces/NotificationListener.h"
    45 #include "scriptablecontroller/scriptable_controller.h"
    46 #include "Level.h"
    4745
    4846#include "PlayerInfo.h"
     
    7876        this->spawned_ = false;
    7977        this->readyToSpawn_ = false;
    80         this->isFirstSpawn_ = true;
    8178
    8279        this->registerVariables();
     
    313310        {
    314311            if(this->hasStarted() && !this->hasEnded())
     312
    315313                this->setSpawnedHelper(player, true);
    316         }
    317 
    318         // TODO We might want to handle the subsequent spawns as well somehow
    319         if(player->isHumanPlayer() && player->isLocalPlayer() && this->isFirstSpawn_)
    320         {
    321             this->isFirstSpawn_ = false;
    322             this->getLevel()->getScriptableController()->setPlayer(player);
    323 
    324             // This handles paths relative to the 'level' directory
    325             std::string script = this->getLevel()->getScript();
    326             if(script.at(0) != '/')
    327                 script = "../levels/" + script; // Not very dynamic
    328             this->getLevel()->getScriptableController()->runScript(script);
    329314        }
    330315    }
  • code/branches/Presentation_HS17/src/orxonox/infos/GametypeInfo.h

    r11686 r11690  
    8383            inline bool isStartCountdownRunning() const
    8484                { return this->bStartCountdownRunning_; }
    85 
     85           
    8686            void changedStartCountdownRunning(void); // Is called when the start countdown has been either started or stopped.
    8787
     
    168168            bool spawned_; //!< Whether the local Player is currently spawned.
    169169            bool readyToSpawn_; //!< Whether the local Player is ready to spawn.
    170             bool isFirstSpawn_;
    171170    };
    172171}
  • code/branches/Presentation_HS17/src/orxonox/infos/HumanPlayer.cc

    r11686 r11690  
    3838#include "gametypes/Gametype.h"
    3939#include "overlays/OverlayGroup.h"
    40 #include "Level.h"
    41 #include "scriptablecontroller/scriptable_controller.h"
    4240
    4341namespace orxonox
  • code/branches/Presentation_HS17/src/orxonox/items/ShipPart.cc

    r11686 r11690  
    4242#include "items/PartDestructionEvent.h"
    4343#include "chat/ChatManager.h"
    44 #include "Level.h"
    45 #include "scriptablecontroller/scriptable_controller.h"
    4644
    4745
     
    217215            }
    218216        }
    219 
    220         // This is a bit hacky, but it takes away damage control from the pawn, so it has to handle
    221         // that as well.
    222         this->getLevel()->getScriptableController()->pawnHit(parent_, originator, parent_->getHealth(), parent_->getShieldHealth());
    223 
    224217        if (this->health_ < 0)
    225218            this->death();
  • code/branches/Presentation_HS17/src/orxonox/worldentities/CMakeLists.txt

    r11685 r11690  
    1313  ExplosionPart.cc
    1414  Actionpoint.cc
    15   AutonomousDrone.cc
    16   Arrow.cc
    1715  NameableStaticEntity.cc
    1816)
  • code/branches/Presentation_HS17/src/orxonox/worldentities/ControllableEntity.cc

    r11686 r11690  
    3939
    4040#include "Scene.h"
    41 #include "Level.h"
    4241#include "infos/PlayerInfo.h"
    4342#include "controllers/NewHumanController.h"
     
    6867        this->camera_ = nullptr;
    6968        this->xmlcontroller_ = nullptr;
     69        //this->controller_ = nullptr;
    7070        this->reverseCamera_ = nullptr;
    7171        this->bDestroyWhenPlayerLeft_ = false;
  • code/branches/Presentation_HS17/src/orxonox/worldentities/ControllableEntity.h

    r11686 r11690  
    175175            inline int getTeam() const
    176176                { return this->team_; }
    177 
    178177
    179178        protected:
  • code/branches/Presentation_HS17/src/orxonox/worldentities/MobileEntity.cc

    r11686 r11690  
    3636
    3737#include "Scene.h"
    38 #include "Level.h"
    39 #include "scriptablecontroller/scriptable_controller.h"
    4038
    4139namespace orxonox
     
    7472                this->setAngularVelocity(rotationAxis.normalisedCopy() * rotationRate.valueRadians());
    7573        }
    76 
    77         if(!this->id_.empty() && this->getLevel() != nullptr)
    78             this->getLevel()->getScriptableController()->registerMobileEntity(this->id_, this);
    7974    }
    8075
  • code/branches/Presentation_HS17/src/orxonox/worldentities/WorldEntity.cc

    r11686 r11690  
    4444#include "core/XMLPort.h"
    4545#include "Scene.h"
    46 #include "Level.h"
    4746#include "collisionshapes/WorldEntityCollisionShape.h"
    48 #include "scriptablecontroller/scriptable_controller.h"
    4947
    5048namespace orxonox
     
    8179        this->parentID_ = OBJECTID_UNKNOWN;
    8280        this->bDeleteWithParent_ = true;
    83         this->id_ = -1;
    8481
    8582        this->node_->setPosition(Vector3::ZERO);
     
    163160        XMLPortParamTemplate(WorldEntity, "scale3D",     setScale3D,     getScale3D,     xmlelement, mode, const Vector3&);
    164161        XMLPortParam        (WorldEntity, "scale",       setScale,       getScale,       xmlelement, mode);
    165         XMLPortParamLoadOnly(WorldEntity, "id",          setID,                xmlelement, mode);
    166162        XMLPortParamLoadOnly(WorldEntity, "lookat",      lookAt_xmlport,       xmlelement, mode);
    167163        XMLPortParamLoadOnly(WorldEntity, "direction",   setDirection_xmlport, xmlelement, mode);
     
    185181        // Attached collision shapes
    186182        XMLPortObject(WorldEntity, CollisionShape, "collisionShapes", attachCollisionShape, getAttachedCollisionShape, xmlelement, mode);
    187 
    188         if(!this->id_.empty() && this->getLevel() != nullptr)
    189             this->getLevel()->getScriptableController()->registerWorldEntity(this->id_, this);
    190183    }
    191184
  • code/branches/Presentation_HS17/src/orxonox/worldentities/WorldEntity.h

    r11686 r11690  
    110110            virtual void changedActivity(void) override;
    111111            virtual void changedVisibility(void) override;
    112 
    113             inline std::string getID(void)
    114                 { return this->id_; }
    115 
    116             inline void setID(std::string id)
    117                 { this->id_ = id; }
    118112
    119113            virtual void setPosition(const Vector3& position) = 0;
     
    448442
    449443            btRigidBody*  physicalBody_; //!< Bullet rigid body. Everything physical is applied to this instance.
    450             std::string   id_;           //!< Used by the ScriptableController to identify objects
    451444
    452445        private:
  • code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/Pawn.cc

    r11686 r11690  
    5050#include "sound/WorldSound.h"
    5151#include "core/object/ObjectListIterator.h"
    52 #include "Level.h"
    53 #include "scriptablecontroller/scriptable_controller.h"
    5452
    5553#include "controllers/FormationController.h"
     
    162160
    163161        XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode );
    164 
    165         if(!this->id_.empty() && this->getLevel() != nullptr)
    166             this->getLevel()->getScriptableController()->registerPawn(this->id_, this);
    167162    }
    168163
     
    287282        {
    288283            // Health-damage cannot be absorbed by shields.
    289             // Shield-damage only reduces shield health.
     284            // Shield-damage only reduces shield health. 
    290285            // Normal damage can be (partially) absorbed by shields.
    291286
     
    307302                this->setHealth(this->health_ - (damage - shielddamage) - healthdamage);
    308303            }
    309             this->getLevel()->getScriptableController()->pawnHit(this, originator, this->health_, this->shieldHealth_);
    310304
    311305            this->lastHitOriginator_ = originator;
     
    408402            }
    409403        }
    410 
    411         this->getLevel()->getScriptableController()->pawnKilled(this);
    412404    }
    413405    void Pawn::goWithStyle()
     
    633625        {
    634626            // delete all debug models
    635             for(Model* model : debugWeaponSlotModels_)
     627            for(Model* model : debugWeaponSlotModels_) 
    636628            {
    637629                model->destroy();
Note: See TracChangeset for help on using the changeset viewer.