PuzzleSDK
SpritePerformanceTestDynamic类 参考

#include <SpritePolygonTest.h>

+ 类 SpritePerformanceTestDynamic 继承关系图:
+ SpritePerformanceTestDynamic 的协作图:

Public 成员函数

 CREATE_FUNC (SpritePerformanceTestDynamic)
 
 SpritePerformanceTestDynamic ()
 
- Public 成员函数 继承自 SpritePolygonPerformance
 CREATE_FUNC (SpritePolygonPerformance)
 
 SpritePolygonPerformance ()
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual Type getTestType () const
 
virtual float getDuration () const
 
virtual std::string getExpectedOutput () const
 
virtual std::string getActualOutput () const
 
virtual void restartTestCallback (cocos2d::Ref *sender)
 
virtual void nextTestCallback (cocos2d::Ref *sender)
 
virtual void priorTestCallback (cocos2d::Ref *sender)
 
virtual void onBackCallback (cocos2d::Ref *sender)
 
void setTestSuite (TestSuite *testSuite)
 
TestSuitegetTestSuite () const
 
float getRunTime () const
 
void setTestCaseName (const std::string &name)
 
std::string getTestCaseName () const
 
const cocos2d::Label * getSubtitleLable () const
 
const cocos2d::MenuItemImage * getRestartTestItem () const
 

Protected 成员函数

virtual cocos2d::Sprite * makeSprite () override
 
virtual void initIncrementStats () override
 
- Protected 成员函数 继承自 SpritePolygonPerformance
void updateLabel ()
 
virtual void update (float dt) override
 
virtual bool init () override
 
void incrementStats ()
 
- Protected 成员函数 继承自 SpritePolygonTestCase
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
virtual void onEnter () override
 
virtual void onExit () override
 
 SpritePolygonTestCase ()
 
 ~SpritePolygonTestCase ()
 
void updateDrawNode ()
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 
- Protected 属性 继承自 SpritePolygonPerformance
int _spriteCount
 
int _vertCount
 
int _triCount
 
int _pixelCount
 
float _elapsedTime
 
cocos2d::Label * _perfLabel
 
int _continuousLowDt
 
float _continuousHighDtTime
 
float _waitingTime
 
int _posX
 
int _posY
 
int _leftX
 
int _rightX
 
bool goRight
 
bool ended
 
float prevDt
 
unsigned int _incVert
 
unsigned int _incTri
 
unsigned int _incPix
 
- Protected 属性 继承自 SpritePolygonTestCase
std::string _title
 
std::string _subtitle
 
bool _isDebugDraw
 
bool _isNeedDebugMenu
 
cocos2d::Vector< cocos2d::DrawNode * > _drawNodes
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 SpritePolygonTest.h170 行定义.

构造及析构函数说明

◆ SpritePerformanceTestDynamic()

SpritePerformanceTestDynamic::SpritePerformanceTestDynamic ( )

在文件 SpritePolygonTest.cpp646 行定义.

647{
648 _title = "Dynamic Sprite Performance";
649 _subtitle = "Test running, please wait until it ends";
650}

引用了 SpritePolygonTestCase::_subtitle , 以及 SpritePolygonTestCase::_title.

成员函数说明

◆ CREATE_FUNC()

SpritePerformanceTestDynamic::CREATE_FUNC ( SpritePerformanceTestDynamic  )

◆ initIncrementStats()

void SpritePerformanceTestDynamic::initIncrementStats ( )
overrideprotectedvirtual

重载 SpritePolygonPerformance .

在文件 SpritePolygonTest.cpp652 行定义.

653{
654 auto t = Sprite::create(s_pathGrossini);
655 _incVert = 4;
656 _incTri = 2;
657 _incPix = t->getContentSize().width * t->getContentSize().height;
658}
static const char s_pathGrossini[]
Definition: testResource.h:28

引用了 SpritePolygonPerformance::_incPix, SpritePolygonPerformance::_incTri, SpritePolygonPerformance::_incVert , 以及 s_pathGrossini.

◆ makeSprite()

Sprite * SpritePerformanceTestDynamic::makeSprite ( )
overrideprotectedvirtual

重载 SpritePolygonPerformance .

在文件 SpritePolygonTest.cpp660 行定义.

661{
662 auto ret = Sprite::create(s_pathGrossini);
663 ret->runAction(RepeatForever::create(RotateBy::create(1.0f,360.0f)));
664 return ret;
665}

引用了 s_pathGrossini.


该类的文档由以下文件生成: