2012-04-19 14:35:52 +08:00
|
|
|
#ifndef __PERFORMANCE_PARTICLE_TEST_H__
|
|
|
|
#define __PERFORMANCE_PARTICLE_TEST_H__
|
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
#include "BaseTest.h"
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
DEFINE_TEST_SUITE(PerformceParticleTests);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
class ParticleMainScene : public TestCase
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-05-11 16:26:14 +08:00
|
|
|
virtual bool init() override;
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void initWithSubTest(int subtest, int particles);
|
|
|
|
|
2012-06-08 13:55:28 +08:00
|
|
|
void step(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
void createParticleSystem();
|
2015-04-09 08:37:30 +08:00
|
|
|
void testNCallback(cocos2d::Ref* sender);
|
2012-04-19 14:35:52 +08:00
|
|
|
void updateQuantityLabel();
|
|
|
|
virtual void doTest() = 0;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
int lastRenderedCount;
|
2015-05-11 16:26:14 +08:00
|
|
|
static int quantityParticles;
|
|
|
|
static int subtestNumber;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2011-03-25 13:59:08 +08:00
|
|
|
class ParticlePerformTest1 : public ParticleMainScene
|
|
|
|
{
|
|
|
|
public:
|
2015-05-11 16:26:14 +08:00
|
|
|
CREATE_FUNC(ParticlePerformTest1);
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2011-03-25 13:59:08 +08:00
|
|
|
virtual void doTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ParticlePerformTest2 : public ParticleMainScene
|
|
|
|
{
|
|
|
|
public:
|
2015-05-11 16:26:14 +08:00
|
|
|
CREATE_FUNC(ParticlePerformTest2);
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2011-03-25 13:59:08 +08:00
|
|
|
virtual void doTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ParticlePerformTest3 : public ParticleMainScene
|
|
|
|
{
|
|
|
|
public:
|
2015-05-11 16:26:14 +08:00
|
|
|
CREATE_FUNC(ParticlePerformTest3);
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2011-03-25 13:59:08 +08:00
|
|
|
virtual void doTest();
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class ParticlePerformTest4 : public ParticleMainScene
|
2011-03-25 13:59:08 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-05-11 16:26:14 +08:00
|
|
|
CREATE_FUNC(ParticlePerformTest4);
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2011-03-25 13:59:08 +08:00
|
|
|
virtual void doTest();
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|