Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 1, 2008, 10:20:24 PM (16 years ago)
Author:
rgrieder
Message:

Added Dedicated game state (name: "dedicated", class: GSDedicated).
It doesn't work at all yet, mainly because of our very poorly designed /objects folder. I tried adding a few "if (Settings::showsGraphics())", but I ran into some serious issues.
I will simply leave this topic up to an eager orxonox developer who wants a dedicated server :D There is A LOT of work to be done…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/orxonox/objects/SpaceShipAI.cc

    r1608 r1694  
    3939#include "core/XMLPort.h"
    4040#include "tools/ParticleInterface.h"
     41#include "Settings.h"
    4142
    4243#define ACTION_INTERVAL 1.0f
     
    102103            newenemy->XMLPort(xmlelement, XMLPort::LoadObject);
    103104
    104             ParticleSpawner* spawneffect = new ParticleSpawner("Orxonox/fairytwirl", LODParticle::normal, 2.0, 0, 0, newenemy->getOrth());
    105             spawneffect->setPosition(newenemy->getPosition() - newenemy->getOrth() * 50);
    106             spawneffect->create();
     105            if (Settings::showsGraphics())
     106            {
     107                ParticleSpawner* spawneffect = new ParticleSpawner("Orxonox/fairytwirl", LODParticle::normal, 2.0, 0, 0, newenemy->getOrth());
     108                spawneffect->setPosition(newenemy->getPosition() - newenemy->getOrth() * 50);
     109                spawneffect->create();
     110            }
    107111        }
    108112    }
     
    182186    void SpaceShipAI::kill()
    183187    {
    184         ParticleSpawner* explosion = new ParticleSpawner("Orxonox/BigExplosion1part1", LODParticle::low, 3.0);
    185         explosion->setPosition(this->getPosition());
    186         explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
    187         explosion->setScale(4);
    188         explosion->create();
    189 
    190         explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::normal, 3.0);
    191         explosion->setPosition(this->getPosition());
    192         explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
    193         explosion->setScale(4);
    194         explosion->create();
    195         explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::high, 3.0);
    196         explosion->setPosition(this->getPosition());
    197         explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
    198         explosion->setScale(4);
    199         explosion->create();
    200 
    201         Vector3 ringdirection = Vector3(rnd(), rnd(), rnd());
    202         ringdirection.normalise();
    203         explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::normal, 3.0, 0.5, 0, ringdirection);
    204         explosion->setPosition(this->getPosition());
    205         explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
    206         explosion->setScale(4);
    207         explosion->create();
    208         explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::high, 3.0, 0.5, 0, ringdirection);
    209         explosion->setPosition(this->getPosition());
    210         explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
    211         explosion->setScale(4);
    212         explosion->create();
     188        if (Settings::showsGraphics())
     189        {
     190            ParticleSpawner* explosion = new ParticleSpawner("Orxonox/BigExplosion1part1", LODParticle::low, 3.0);
     191            explosion->setPosition(this->getPosition());
     192            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     193            explosion->setScale(4);
     194            explosion->create();
     195
     196            explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::normal, 3.0);
     197            explosion->setPosition(this->getPosition());
     198            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     199            explosion->setScale(4);
     200            explosion->create();
     201            explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::high, 3.0);
     202            explosion->setPosition(this->getPosition());
     203            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     204            explosion->setScale(4);
     205            explosion->create();
     206
     207            Vector3 ringdirection = Vector3(rnd(), rnd(), rnd());
     208            ringdirection.normalise();
     209            explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::normal, 3.0, 0.5, 0, ringdirection);
     210            explosion->setPosition(this->getPosition());
     211            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     212            explosion->setScale(4);
     213            explosion->create();
     214            explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::high, 3.0, 0.5, 0, ringdirection);
     215            explosion->setPosition(this->getPosition());
     216            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     217            explosion->setScale(4);
     218            explosion->create();
     219        }
    213220
    214221        delete this;
Note: See TracChangeset for help on using the changeset viewer.