2012-04-19 14:35:52 +08:00
|
|
|
#ifndef __PERFORMANCE_NODE_CHILDREN_TEST_H__
|
|
|
|
#define __PERFORMANCE_NODE_CHILDREN_TEST_H__
|
|
|
|
|
|
|
|
#include "PerformanceTest.h"
|
|
|
|
#include "support/CCProfiling.h"
|
|
|
|
|
|
|
|
class NodeChildrenMenuLayer : public PerformBasicLayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NodeChildrenMenuLayer(bool bControlMenuVisible, int nMaxCases = 0, int nCurCase = 0);
|
|
|
|
virtual void showCurrentTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
class NodeChildrenMainScene : public CCScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void initWithQuantityOfNodes(unsigned int nNodes);
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void updateQuantityOfNodes() = 0;
|
|
|
|
|
|
|
|
void onDecrease(CCObject* pSender);
|
|
|
|
void onIncrease(CCObject* pSender);
|
|
|
|
void updateQuantityLabel();
|
|
|
|
|
|
|
|
int getQuantityOfNodes() { return quantityOfNodes; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
int lastRenderedCount;
|
|
|
|
int quantityOfNodes;
|
|
|
|
int currentQuantityOfNodes;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IterateSpriteSheet : public NodeChildrenMainScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~IterateSpriteSheet();
|
|
|
|
virtual void updateQuantityOfNodes();
|
|
|
|
virtual void initWithQuantityOfNodes(unsigned int nNodes);
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt) = 0;
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string profilerName();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
CCSpriteBatchNode *batchNode;
|
2011-04-25 14:30:30 +08:00
|
|
|
|
|
|
|
#if CC_ENABLE_PROFILERS
|
|
|
|
CCProfilingTimer *_profilingTimer;
|
2012-04-19 14:35:52 +08:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
class IterateSpriteSheetFastEnum : public IterateSpriteSheet
|
|
|
|
{
|
|
|
|
public:
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual std::string profilerName();
|
|
|
|
};
|
|
|
|
|
|
|
|
class IterateSpriteSheetCArray : public IterateSpriteSheet
|
|
|
|
{
|
|
|
|
public:
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual std::string profilerName();
|
|
|
|
};
|
|
|
|
|
|
|
|
class AddRemoveSpriteSheet : public NodeChildrenMainScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~AddRemoveSpriteSheet();
|
|
|
|
virtual void updateQuantityOfNodes();
|
|
|
|
virtual void initWithQuantityOfNodes(unsigned int nNodes);
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt) = 0;
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string profilerName();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
CCSpriteBatchNode *batchNode;
|
|
|
|
|
|
|
|
#if CC_ENABLE_PROFILERS
|
|
|
|
CCProfilingTimer* _profilingTimer;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2011-03-25 13:59:08 +08:00
|
|
|
class AddSpriteSheet : public AddRemoveSpriteSheet
|
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
virtual std::string title();
|
2011-03-25 13:59:08 +08:00
|
|
|
virtual std::string subtitle();
|
2011-04-25 14:30:30 +08:00
|
|
|
virtual std::string profilerName();
|
2011-03-25 13:59:08 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class RemoveSpriteSheet : public AddRemoveSpriteSheet
|
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
virtual std::string title();
|
2011-03-25 13:59:08 +08:00
|
|
|
virtual std::string subtitle();
|
2011-04-25 14:30:30 +08:00
|
|
|
virtual std::string profilerName();
|
2011-03-25 13:59:08 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ReorderSpriteSheet : public AddRemoveSpriteSheet
|
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
virtual std::string title();
|
2011-03-25 13:59:08 +08:00
|
|
|
virtual std::string subtitle();
|
2011-04-25 14:30:30 +08:00
|
|
|
virtual std::string profilerName();
|
2011-03-25 13:59:08 +08:00
|
|
|
};
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
void runNodeChildrenTest();
|
|
|
|
|
|
|
|
#endif // __PERFORMANCE_NODE_CHILDREN_TEST_H__
|