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:
10 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/dodgerace/CMakeLists.txt

    r10284 r10624  
    88
    99ORXONOX_ADD_LIBRARY(dodgerace
    10   MODULE
     10  PLUGIN
    1111  FIND_HEADER_FILES
    1212  LINK_LIBRARIES
  • code/trunk/src/modules/dodgerace/DodgeRace.cc

    r10236 r10624  
    3535#include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
    3636#include "DodgeRaceCube.h"
     37#include "core/CoreIncludes.h"
    3738
    3839namespace orxonox
     
    4344    {
    4445        RegisterObject(DodgeRace);
    45         init();
    46         this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
    47         this->center_ = 0;
    48 
    49         this->setHUDTemplate("DodgeRaceHUD");
    50     }
    51 
    52     void DodgeRace::init()
    53     {
     46
    5447        bEndGame = false;
    5548        lives = 1;
     
    6558        //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this)));
    6659        comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this)));
     60        this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
     61        this->center_ = 0;
     62
     63        this->setHUDTemplate("DodgeRaceHUD");
    6764    }
    6865
     
    7471            for (int i = 0; i < 7; i++)
    7572            {
    76                 WeakPtr<BigExplosion> chunk = new BigExplosion(this->center_->getContext());
     73                BigExplosion* chunk = new BigExplosion(this->center_->getContext());
    7774                chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
    7875                chunk->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
     
    9087        if (getPlayer() != NULL)
    9188        {
    92             //WeakPtr<DodgeRaceShip> ship = getPlayer();
    93 
    9489            currentPosition = getPlayer()->getWorldPosition().x;
    9590            counter = counter + (currentPosition - lastPosition);
     
    112107                for(int i = 0; i<6; i++)
    113108                {
    114                     WeakPtr<DodgeRaceCube> cube = new DodgeRaceCube(this->center_->getContext());
     109                    DodgeRaceCube* cube = new DodgeRaceCube(this->center_->getContext());
    115110                    cubeList.push_back(cube);
    116111                    switch(pattern)
     
    137132    }
    138133
    139     WeakPtr<DodgeRaceShip> DodgeRace::getPlayer()
     134    DodgeRaceShip* DodgeRace::getPlayer()
    140135    {
    141136        if (player == NULL)
     
    168163    {
    169164        orxout() << "start" << endl;
    170         init();
    171165        for(unsigned int i=0; i< cubeList.size();i++)
    172166        {
     
    199193        /*
    200194        orxout() << "prespawn" << endl;
    201         init();
    202195        for(int i=0; i< cubeList.size();i++)
    203196        {
  • code/trunk/src/modules/dodgerace/DodgeRace.h

    r10236 r10624  
    4444
    4545
    46 #include "core/CoreIncludes.h"
    4746#include "core/EventIncludes.h"
    4847#include "core/command/Executor.h"
     
    6968       public:
    7069            DodgeRace(Context* context);
    71 
    72             void init();
    7370
    7471            virtual void start();
     
    106103            Timer endGameTimer;
    107104
    108             WeakPtr<DodgeRaceShip> getPlayer();
     105            DodgeRaceShip* getPlayer();
    109106            WeakPtr<DodgeRaceShip> player;
    110107            std::vector<DodgeRaceCube*> cubeList;
  • code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.cc

    r10232 r10624  
    5454    }
    5555
    56     void DodgeRaceCenterPoint::changedGametype()
    57     {
    58         SUPER(DodgeRaceCenterPoint, changedGametype);
    59 
    60         // Check, whether it's still DodgeRace.
    61         this->checkGametype();
    62     }
    63 
    6456    void DodgeRaceCenterPoint::checkGametype()
    6557    {
    6658        if (this->getGametype() != NULL && this->getGametype()->isA(Class(DodgeRace)))
    6759        {
    68             DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype().get());
     60            DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype());
    6961            DodgeRaceGametype->setCenterpoint(this);
    7062        }
  • code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.h

    r10234 r10624  
    5252            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5353
    54             virtual void changedGametype(); //!< Is called when the gametype has changed.
    5554        private:
    5655            void checkGametype();
  • code/trunk/src/modules/dodgerace/DodgeRaceCube.cc

    r10236 r10624  
    3333#include "DodgeRaceCube.h"
    3434#include "DodgeRace.h"
     35#include "core/CoreIncludes.h"
    3536
    3637namespace orxonox
  • code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.cc

    r10236 r10624  
    8282        if (this->getOwner() && this->getOwner()->getGametype())
    8383        {
    84             this->DodgeRaceGame = orxonox_cast<DodgeRace*>(this->getOwner()->getGametype().get());
     84            this->DodgeRaceGame = orxonox_cast<DodgeRace*>(this->getOwner()->getGametype());
    8585        }
    8686        else
  • code/trunk/src/modules/dodgerace/DodgeRaceShip.cc

    r10236 r10624  
    3333
    3434#include "DodgeRaceShip.h"
     35#include "core/CoreIncludes.h"
    3536
    3637namespace orxonox
     
    8990
    9091        // Camera
    91         WeakPtr<Camera> camera = this->getCamera();
     92        Camera* camera = this->getCamera();
    9293        if (camera != NULL)
    9394        {
     
    149150    }
    150151
    151     WeakPtr<DodgeRace> DodgeRaceShip::getGame()
     152    DodgeRace* DodgeRaceShip::getGame()
    152153    {
    153154        if (game == NULL)
  • code/trunk/src/modules/dodgerace/DodgeRaceShip.h

    r10284 r10624  
    3838#include "dodgerace/DodgeRacePrereqs.h"
    3939
    40 #include "core/CoreIncludes.h"
    4140#include "core/XMLPort.h"
    4241#include "worldentities/pawns/SpaceShip.h"
     
    7978        private:
    8079            virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
    81             WeakPtr<DodgeRace> getGame();
     80            DodgeRace* getGame();
    8281            WeakPtr<DodgeRace> game;
    8382            WeakPtr<WorldEntity> lastEntity;
Note: See TracChangeset for help on using the changeset viewer.