- Timestamp:
- Aug 31, 2008, 4:32:31 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/orxonox/objects/ParticleProjectile.cc
r1676 r1684 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/ConfigValueIncludes.h" 35 //#include "util/FastDelegate.h"36 //using namespace fastdelegate;37 35 38 36 namespace orxonox 39 37 { 40 38 CreateFactory(ParticleProjectile); 41 42 struct FunctionPointerViewer43 {44 void* ptr1_;45 void* ptr2_;46 47 void view()48 {49 std::cout << ptr1_ << "." << ptr2_ << std::endl;50 }51 };52 53 union FunctionPointerViewer154 {55 FunctionPointerViewer viewer_;56 void (Projectile::*function_) ();57 };58 59 union FunctionPointerViewer260 {61 FunctionPointerViewer viewer_;62 void (BillboardProjectile::*function_) ();63 };64 65 union FunctionPointerViewer366 {67 FunctionPointerViewer viewer_;68 void (ParticleProjectile::*function_) ();69 };70 39 71 40 ParticleProjectile::ParticleProjectile(SpaceShip* owner) : BillboardProjectile(owner) … … 86 55 87 56 this->setConfigValues(); 88 /*89 FunctionPointerViewer1 fpw1;90 fpw1.function_ = &Projectile::testfunction;91 FunctionPointerViewer2 fpw2;92 fpw2.function_ = &BillboardProjectile::testfunction;93 FunctionPointerViewer3 fpw3;94 fpw3.function_ = &ParticleProjectile::testfunction;95 57 96 std::cout << sizeof(void (Projectile::*) ()) << std::endl;97 fpw1.viewer_.view();98 fpw2.viewer_.view();99 fpw3.viewer_.view();100 101 {102 std::cout << "1:" << std::endl;103 FastDelegate0<> delegate1(this, &ParticleProjectile::testfunction);104 delegate1();105 FastDelegate0<> delegate2((BillboardProjectile*)this, &BillboardProjectile::testfunction);106 delegate2();107 FastDelegate0<> delegate3(this, &Projectile::testfunction);108 delegate3();109 }110 {111 std::cout << "2:" << std::endl;112 BillboardProjectile temp;113 // FastDelegate0<> delegate1(&temp, &ParticleProjectile::testfunction);114 // delegate1();115 FastDelegate0<> delegate2(&temp, &BillboardProjectile::testfunction);116 delegate2();117 FastDelegate0<> delegate3(&temp, &Projectile::testfunction);118 delegate3();119 }120 std::cout << "done" << std::endl;121 122 std::cout << "0:" << std::endl;123 this->Projectile::testfunction();124 this->BillboardProjectile::testfunction();125 this->ParticleProjectile::testfunction();126 this->testfunction();127 128 std::cout << "1:" << std::endl;129 (this->*fpw1.function_)();130 std::cout << "2:" << std::endl;131 (this->*fpw2.function_)();132 std::cout << "3:" << std::endl;133 (this->*fpw3.function_)();134 std::cout << "done" << std::endl;135 */136 58 std::cout << "c:\n"; 137 59 SUPER(ParticleProjectile, testfunction); … … 141 63 this->testfunction(); 142 64 std::cout << "f:\n"; 143 144 // (*((ClassIdentifier<SuperDummy>*)this->getIdentifier())->superFunctionCaller_testfunction_)(this);145 65 } 146 66 … … 158 78 void ParticleProjectile::changedVisibility() 159 79 { 160 BillboardProjectile::changedVisibility(); 80 // BillboardProjectile::changedVisibility(); 81 SUPER(ParticleProjectile, changedVisibility); 161 82 this->particles_->setEnabled(this->isVisible()); 162 83 }
Note: See TracChangeset
for help on using the changeset viewer.