axmol/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.h

305 lines
5.7 KiB
C
Raw Normal View History

2010-08-23 16:38:10 +08:00
#ifndef _PARTICLE_TEST_H_
#define _PARTICLE_TEST_H_
2012-04-04 21:58:04 +08:00
#include "../testBasic.h"
#include "../BaseTest.h"
2012-04-04 21:58:04 +08:00
////----#include "cocos2d.h"
2010-08-25 10:26:31 +08:00
// #include "touch_dispatcher/CCTouch.h"
// #include "CCParticleExample.h"
2012-04-04 21:58:04 +08:00
class ParticleTestScene : public TestScene
{
public:
virtual void runThisTest();
};
class ParticleDemo : public BaseTest
2010-08-23 16:38:10 +08:00
{
2012-04-04 21:58:04 +08:00
protected:
CCParticleSystem* _emitter;
CCSprite* _background;
CCLayerColor* _color;
2012-04-04 21:58:04 +08:00
public:
~ParticleDemo(void);
2012-04-04 21:58:04 +08:00
virtual void onEnter(void);
2010-08-23 16:38:10 +08:00
virtual std::string title();
virtual std::string subtitle();
2010-08-23 16:38:10 +08:00
void restartCallback(CCObject* pSender);
void nextCallback(CCObject* pSender);
void backCallback(CCObject* pSender);
void toggleCallback(CCObject* pSender);
2010-08-23 16:38:10 +08:00
2012-11-20 17:39:11 +08:00
virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent);
virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent);
virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent);
2010-08-23 16:38:10 +08:00
2012-06-08 13:55:28 +08:00
virtual void update(float dt);
void setEmitterPosition();
2010-08-23 16:38:10 +08:00
};
class DemoFirework : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoFire : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoSun : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoGalaxy : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoFlower : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoBigFlower : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoRotFlower : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoMeteor : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoSpiral : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoExplosion : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoSmoke : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoSnow : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoRain : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoModernArt : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class DemoRing : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
class ParallaxParticle : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2010-08-23 16:38:10 +08:00
};
2010-08-26 09:55:54 +08:00
2012-04-04 21:58:04 +08:00
class DemoParticleFromFile : public ParticleDemo
{
public:
std::string _title;
2012-04-04 21:58:04 +08:00
DemoParticleFromFile(const char *file)
{
_title = file;
2012-04-04 21:58:04 +08:00
}
virtual void onEnter();
virtual std::string title()
{
return _title;
2012-04-04 21:58:04 +08:00
}
2010-08-26 09:55:54 +08:00
};
class RadiusMode1 : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
};
2012-04-04 21:58:04 +08:00
class RadiusMode2 : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
2012-04-04 21:58:04 +08:00
};
class Issue704 : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
virtual std::string subtitle();
2012-04-04 21:58:04 +08:00
};
class Issue870 : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
virtual std::string subtitle();
2012-06-08 13:55:28 +08:00
void updateQuads(float dt);
private:
int _index;
2012-04-04 21:58:04 +08:00
};
2012-03-22 18:29:07 +08:00
class Issue1201 : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
virtual std::string subtitle();
2012-04-04 21:58:04 +08:00
};
2012-03-22 18:29:07 +08:00
class ParticleBatchHybrid : public ParticleDemo
{
public:
virtual void onEnter();
2012-06-08 13:55:28 +08:00
void switchRender(float dt);
virtual std::string title();
virtual std::string subtitle();
2012-03-22 18:29:07 +08:00
private:
CCNode* _parent1;
CCNode* _parent2;
2012-04-04 21:58:04 +08:00
};
2012-03-22 18:29:07 +08:00
class ParticleBatchMultipleEmitters : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
virtual std::string subtitle();
2012-04-04 21:58:04 +08:00
};
2012-03-22 18:29:07 +08:00
class ParticleReorder : public ParticleDemo
{
public:
virtual void onEnter();
2012-06-08 13:55:28 +08:00
void reorderParticles(float dt);
virtual std::string title();
virtual std::string subtitle();
2012-03-22 18:29:07 +08:00
private:
unsigned int _order;
2012-04-04 21:58:04 +08:00
};
2012-03-22 18:29:07 +08:00
class MultipleParticleSystems : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
virtual std::string subtitle();
2012-06-08 13:55:28 +08:00
virtual void update(float dt);
2012-04-04 21:58:04 +08:00
};
2012-03-22 18:29:07 +08:00
class MultipleParticleSystemsBatched : public ParticleDemo
{
public:
virtual void onEnter();
2012-06-08 13:55:28 +08:00
virtual void update(float dt);
virtual std::string title();
virtual std::string subtitle();
2012-03-22 18:29:07 +08:00
private:
CCParticleBatchNode* _batchNode;
2012-04-04 21:58:04 +08:00
};
2012-03-22 18:29:07 +08:00
class AddAndDeleteParticleSystems : public ParticleDemo
{
public:
virtual void onEnter();
2012-06-08 13:55:28 +08:00
virtual void update(float dt);
void removeSystem(float dt);
virtual std::string title();
virtual std::string subtitle();
2012-03-22 18:29:07 +08:00
private:
CCParticleBatchNode* _batchNode;
2012-04-04 21:58:04 +08:00
};
2012-03-22 18:29:07 +08:00
class ReorderParticleSystems : public ParticleDemo
{
public:
virtual void onEnter();
2012-06-08 13:55:28 +08:00
void reorderSystem(float time);
virtual void update(float dt);
virtual std::string title();
virtual std::string subtitle();
2012-03-22 18:29:07 +08:00
private:
CCParticleBatchNode* _batchNode;
2012-04-04 21:58:04 +08:00
};
2012-06-12 15:40:31 +08:00
class PremultipliedAlphaTest : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
virtual std::string subtitle();
};
class PremultipliedAlphaTest2 : public ParticleDemo
{
public:
virtual void onEnter();
virtual std::string title();
virtual std::string subtitle();
};
2012-04-04 21:58:04 +08:00
#endif