Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/space_ships/helicopter.cc

    r9235 r9869  
    2525
    2626#include "util/loading/factory.h"
    27 #include "util/loading/resource_manager.h"
     27#include "sound/resource_sound_buffer.h"
    2828
    2929#include "key_mapper.h"
     
    3434#include "debug.h"
    3535
    36 CREATE_FACTORY(Helicopter, CL_HELICOPTER);
     36#include "class_id_DEPRECATED.h"
     37ObjectListDefinitionID(Helicopter, CL_HELICOPTER);
     38CREATE_FACTORY(Helicopter);
    3739#include "script_class.h"
    38 CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER,
    39                         addMethod("moveUp", ExecutorLua1<Helicopter,bool>(&Helicopter::moveUp))
    40                             ->addMethod("moveDown", ExecutorLua1<Helicopter,bool>(&Helicopter::moveDown))
    41                             ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
    42                             ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
    43                             ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))
    44                             ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
     40CREATE_SCRIPTABLE_CLASS(Helicopter,
     41                        addMethod("moveUp", Executor1<Helicopter, lua_State*,bool>(&Helicopter::moveUp))
     42                            ->addMethod("moveDown", Executor1<Helicopter, lua_State*,bool>(&Helicopter::moveDown))
     43                            ->addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor))
     44                            ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX))
     45                            ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
     46                            ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
    4547
    4648                       );
    4749
     50
    4851/**
    4952 *  creates the controlable Helicopter
     
    6063{
    6164  this->setPlayer(NULL);
    62 
    63   if (this->chopperBuffer != NULL)
    64     ResourceManager::getInstance()->unload(this->chopperBuffer);
    6565}
    6666
     
    100100  Weapon* wpLeft = new TestGun(1);
    101101  wpLeft->setName("testGun Left");
    102   Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_CANNON));
     102  Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate("Cannon"));
    103103
    104104  cannon->setName("BFG");
     
    112112
    113113  //load sound
    114   if (this->chopperBuffer != NULL)
    115     ResourceManager::getInstance()->unload(this->chopperBuffer);
    116   this->chopperBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/engine/chopper.wav", WAV);
     114  this->chopperBuffer = OrxSound::ResourceSoundBuffer("sound/engine/chopper.wav");
    117115
    118116}
     
    124122void Helicopter::init()
    125123{
    126   this->chopperBuffer = NULL;
    127 
    128   this->setClassID(CL_HELICOPTER, "Helicopter");
     124  this->registerObject(this, Helicopter::_objectList);
    129125  PRINTF(4)("HELICOPTER INIT\n");
    130126
Note: See TracChangeset for help on using the changeset viewer.