mirror of https://github.com/axmolengine/axmol.git
Merge branch 'develop' of git://github.com/cocos2d/cocos2d-x into di2899
This commit is contained in:
commit
d3a58fa5ad
32
AUTHORS
32
AUTHORS
|
@ -587,18 +587,6 @@ Developers:
|
|||
signmotion (Andrey Syrokomsky)
|
||||
Fixed some compiling-warnings (MSVC2012).
|
||||
|
||||
Retired Core Developers:
|
||||
WenSheng Yang
|
||||
Author of windows port, CCTextField,
|
||||
Designer of CCApplication/CCEGLView/platform structure.
|
||||
He's working together with 2dx core team but leading FishingJoy game
|
||||
|
||||
Bin Zhang
|
||||
core-team member but put himself in FishingJoy game since 2012.
|
||||
|
||||
RongHong Huang (flyingpaper)
|
||||
Author of cocos2d-xna and spent all his time on wp7.
|
||||
|
||||
michaelcontento
|
||||
[Android] use onWindowFocusChanged(bool) instead of onResume()/onPause()
|
||||
Prevent nullptr access in AssetsManager
|
||||
|
@ -615,6 +603,26 @@ Retired Core Developers:
|
|||
Project creator: use absolute path for json config files
|
||||
Documentation fixes
|
||||
A better way to locate project creator
|
||||
|
||||
rablwupei
|
||||
Fixed a memory leak in ScriptingCore::runScript()
|
||||
Fixed a memory leak in Spine.
|
||||
Added support of passing array to cc.Sequence.create and cc.Spawn.create.
|
||||
Fixed a bug that sys.localStorage.getItem() does not support non-ascii string.
|
||||
Fixed a memory leak in XMLHttpRequest.
|
||||
|
||||
Retired Core Developers:
|
||||
WenSheng Yang
|
||||
Author of windows port, CCTextField,
|
||||
Designer of CCApplication/CCEGLView/platform structure.
|
||||
He's working together with 2dx core team but leading FishingJoy game
|
||||
|
||||
Bin Zhang
|
||||
core-team member but put himself in FishingJoy game since 2012.
|
||||
|
||||
RongHong Huang (flyingpaper)
|
||||
Author of cocos2d-xna and spent all his time on wp7.
|
||||
|
||||
|
||||
|
||||
Cocos2d-x can not grow so fast without the active community.
|
||||
|
|
|
@ -2,11 +2,17 @@ cocos2d-x-3.0alpha1 @??? 2013
|
|||
[all platforms]
|
||||
[DOC] Added RELEASE_NOTES and CODING_STYLE.md files
|
||||
[FIX] Texture: use CCLOG to log when a texture is being decoded in software
|
||||
[FIX] Spine: fix memory leaks
|
||||
[FIX] fixed a memory leak in XMLHTTPRequest.cpp
|
||||
[FIX] removeSpriteFramesFromFile() crashes if file doesn't exist.
|
||||
[Android]
|
||||
[FIX] Added EGL_RENDERABLE_TYPE to OpenGL attributes
|
||||
[NEW] Added Cocos2dxHelper.runOnGLThread(Runnable) again
|
||||
[Mac]
|
||||
[FIX] Removed unused CCLOG() from GL initialization
|
||||
[Javascript binding]
|
||||
[FIX] Fixed a memory leak in ScriptingCore::runScript()
|
||||
[FIX] sys.localStorage.getItem() does not support non-ascii string.
|
||||
|
||||
cocos2d-x-3.0alpha0 @Sep.19 2013
|
||||
[all platforms]
|
||||
|
|
|
@ -353,6 +353,11 @@ public:
|
|||
void setActionManager(ActionManager* actionManager);
|
||||
/* Gets delta time since last tick to main loop */
|
||||
float getDeltaTime() const;
|
||||
|
||||
/**
|
||||
* get Frame Rate
|
||||
*/
|
||||
float getFrameRate() const { return _frameRate; }
|
||||
|
||||
protected:
|
||||
void purgeDirector();
|
||||
|
|
|
@ -311,6 +311,7 @@ void ClippingNode::visit()
|
|||
GLProgram *program = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST);
|
||||
GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE);
|
||||
// set our alphaThreshold
|
||||
program->use();
|
||||
program->setUniformLocationWith1f(alphaValueLocation, _alphaThreshold);
|
||||
// we need to recursively apply this shader to all the nodes in the stencil node
|
||||
// XXX: we should have a way to apply shader to all nodes without having to do this
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
|
||||
// Accelerometer
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <functional>
|
||||
#import<CoreMotion/CoreMotion.h>
|
||||
#import<CoreFoundation/CoreFoundation.h>
|
||||
|
||||
@interface CCAccelerometerDispatcher : NSObject<UIAccelerometerDelegate>
|
||||
{
|
||||
cocos2d::Acceleration *_acceleration;
|
||||
CMMotionManager *_motionManager;
|
||||
}
|
||||
|
||||
+ (id) sharedAccelerometerDispather;
|
||||
|
@ -38,6 +38,7 @@ static CCAccelerometerDispatcher* s_pAccelerometerDispatcher;
|
|||
- (id) init
|
||||
{
|
||||
_acceleration = new cocos2d::Acceleration();
|
||||
_motionManager = [[CMMotionManager alloc] init];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -45,6 +46,7 @@ static CCAccelerometerDispatcher* s_pAccelerometerDispatcher;
|
|||
{
|
||||
s_pAccelerometerDispatcher = nullptr;
|
||||
delete _acceleration;
|
||||
[_motionManager release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -52,25 +54,27 @@ static CCAccelerometerDispatcher* s_pAccelerometerDispatcher;
|
|||
{
|
||||
if (isEnabled)
|
||||
{
|
||||
[[UIAccelerometer sharedAccelerometer] setDelegate:self];
|
||||
[_motionManager startAccelerometerUpdatesToQueue:[NSOperationQueue currentQueue] withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) {
|
||||
[self accelerometer:accelerometerData];
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[UIAccelerometer sharedAccelerometer] setDelegate:nil];
|
||||
[_motionManager stopAccelerometerUpdates];
|
||||
}
|
||||
}
|
||||
|
||||
-(void) setAccelerometerInterval:(float)interval
|
||||
{
|
||||
[[UIAccelerometer sharedAccelerometer] setUpdateInterval:interval];
|
||||
_motionManager.accelerometerUpdateInterval = interval;
|
||||
}
|
||||
|
||||
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
|
||||
- (void)accelerometer:(CMAccelerometerData *)accelerometerData
|
||||
{
|
||||
_acceleration->x = acceleration.x;
|
||||
_acceleration->y = acceleration.y;
|
||||
_acceleration->z = acceleration.z;
|
||||
_acceleration->timestamp = acceleration.timestamp;
|
||||
_acceleration->x = accelerometerData.acceleration.x;
|
||||
_acceleration->y = accelerometerData.acceleration.y;
|
||||
_acceleration->z = accelerometerData.acceleration.z;
|
||||
_acceleration->timestamp = accelerometerData.timestamp;
|
||||
|
||||
double tmp = _acceleration->x;
|
||||
|
||||
|
|
|
@ -344,7 +344,11 @@ void SpriteFrameCache::removeSpriteFramesFromFile(const char* plist)
|
|||
{
|
||||
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist);
|
||||
Dictionary* dict = Dictionary::createWithContentsOfFileThreadSafe(fullPath.c_str());
|
||||
|
||||
if (dict == nullptr)
|
||||
{
|
||||
CCLOG("cocos2d:SpriteFrameCache:removeSpriteFramesFromFile: create dict by %s fail.",plist);
|
||||
return;
|
||||
}
|
||||
removeSpriteFramesFromDictionary((Dictionary*)dict);
|
||||
|
||||
// remove it from the cache
|
||||
|
|
|
@ -303,7 +303,7 @@ Atlas* Atlas_readAtlasFile (const char* path) {
|
|||
data = _Util_readFile(path, &length);
|
||||
if (data) atlas = Atlas_readAtlas(data, length, dir);
|
||||
|
||||
FREE(data);
|
||||
delete [] data;
|
||||
FREE(dir);
|
||||
return atlas;
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ SkeletonData* SkeletonJson_readSkeletonDataFile (SkeletonJson* self, const char*
|
|||
return 0;
|
||||
}
|
||||
skeletonData = SkeletonJson_readSkeletonData(self, json);
|
||||
FREE(json);
|
||||
delete [] json;
|
||||
return skeletonData;
|
||||
}
|
||||
|
||||
|
|
2
plugin
2
plugin
|
@ -1 +1 @@
|
|||
Subproject commit d583b83c5806a0d44788095dfc541fb2812c600e
|
||||
Subproject commit 915a29d230b785bdea4bce39e643ce7ce667f6d0
|
|
@ -10,11 +10,10 @@ enum {
|
|||
enum {
|
||||
kTagInfoLayer = 1,
|
||||
kTagMainLayer = 2,
|
||||
kTagAutoTestMenu = 3,
|
||||
kTagMenuLayer = (kMaxNodes + 1000),
|
||||
};
|
||||
|
||||
static int s_nSpriteCurCase = 0;
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// SubTest
|
||||
|
@ -227,6 +226,37 @@ void SubTest::removeByTag(int tag)
|
|||
// SpriteMenuLayer
|
||||
//
|
||||
////////////////////////////////////////////////////////
|
||||
void SpriteMenuLayer::restartCallback(Object* sender)
|
||||
{
|
||||
if ( SpriteMainScene::_s_autoTest )
|
||||
{
|
||||
log("It's auto sprite performace testing,so this operation is invalid");
|
||||
return;
|
||||
}
|
||||
|
||||
PerformBasicLayer::restartCallback(sender);
|
||||
}
|
||||
void SpriteMenuLayer::nextCallback(Object* sender)
|
||||
{
|
||||
if ( SpriteMainScene::_s_autoTest )
|
||||
{
|
||||
log("It's auto sprite performace testing,so this operation is invalid");
|
||||
return;
|
||||
}
|
||||
|
||||
PerformBasicLayer::nextCallback(sender);
|
||||
}
|
||||
void SpriteMenuLayer::backCallback(Object* sender)
|
||||
{
|
||||
if ( SpriteMainScene::_s_autoTest )
|
||||
{
|
||||
log("It's auto sprite performace testing,so this operation is invalid");
|
||||
return;
|
||||
}
|
||||
|
||||
PerformBasicLayer::backCallback(sender);
|
||||
}
|
||||
|
||||
void SpriteMenuLayer::showCurrentTest()
|
||||
{
|
||||
SpriteMainScene* scene = NULL;
|
||||
|
@ -258,7 +288,8 @@ void SpriteMenuLayer::showCurrentTest()
|
|||
scene = new SpritePerformTest7;
|
||||
break;
|
||||
}
|
||||
s_nSpriteCurCase = _curCase;
|
||||
|
||||
SpriteMainScene::_s_nSpriteCurCase = _curCase;
|
||||
|
||||
if (scene)
|
||||
{
|
||||
|
@ -267,12 +298,15 @@ void SpriteMenuLayer::showCurrentTest()
|
|||
scene->release();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// SpriteMainScene
|
||||
//
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
bool SpriteMainScene::_s_autoTest = false;
|
||||
int SpriteMainScene::_s_nSpriteCurCase = 0;
|
||||
|
||||
void SpriteMainScene::initWithSubTest(int asubtest, int nNodes)
|
||||
{
|
||||
//srandom(0);
|
||||
|
@ -303,10 +337,33 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes)
|
|||
addChild(infoLabel, 1, kTagInfoLayer);
|
||||
|
||||
// add menu
|
||||
auto menuLayer = new SpriteMenuLayer(true, TEST_COUNT, s_nSpriteCurCase);
|
||||
auto menuLayer = new SpriteMenuLayer(true, TEST_COUNT, SpriteMainScene::_s_nSpriteCurCase);
|
||||
addChild(menuLayer, 1, kTagMenuLayer);
|
||||
menuLayer->release();
|
||||
|
||||
|
||||
/**
|
||||
* auto test menu
|
||||
*/
|
||||
|
||||
auto menuAutoTest = Menu::create();
|
||||
menuAutoTest->setPosition( Point::ZERO );
|
||||
MenuItemFont::setFontName("Arial");
|
||||
MenuItemFont::setFontSize(24);
|
||||
|
||||
MenuItemFont* autoTestItem = NULL;
|
||||
if (SpriteMainScene::_s_autoTest)
|
||||
{
|
||||
autoTestItem = MenuItemFont::create("Auto Test On",CC_CALLBACK_1(SpriteMainScene::onAutoTest, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
autoTestItem = MenuItemFont::create("Auto Test Off",CC_CALLBACK_1(SpriteMainScene::onAutoTest, this));
|
||||
}
|
||||
autoTestItem->setTag(1);
|
||||
autoTestItem->setPosition(Point( s.width - 90, s.height / 2));
|
||||
menuAutoTest->addChild(autoTestItem);
|
||||
addChild( menuAutoTest, 3, kTagAutoTestMenu );
|
||||
|
||||
// Sub Tests
|
||||
MenuItemFont::setFontSize(32);
|
||||
auto subMenu = Menu::create();
|
||||
|
@ -356,6 +413,12 @@ SpriteMainScene::~SpriteMainScene()
|
|||
|
||||
void SpriteMainScene::testNCallback(Object* sender)
|
||||
{
|
||||
if (SpriteMainScene::_s_autoTest)
|
||||
{
|
||||
log("It's auto sprite performace testing,so this operation is invalid");
|
||||
return;
|
||||
}
|
||||
|
||||
subtestNumber = static_cast<MenuItemFont*>(sender)->getTag();
|
||||
auto menu = static_cast<SpriteMenuLayer*>( getChildByTag(kTagMenuLayer) );
|
||||
menu->restartCallback(sender);
|
||||
|
@ -375,7 +438,7 @@ void SpriteMainScene::updateNodes()
|
|||
}
|
||||
|
||||
void SpriteMainScene::onIncrease(Object* sender)
|
||||
{
|
||||
{
|
||||
if( quantityNodes >= kMaxNodes)
|
||||
return;
|
||||
|
||||
|
@ -391,6 +454,7 @@ void SpriteMainScene::onIncrease(Object* sender)
|
|||
|
||||
void SpriteMainScene::onDecrease(Object* sender)
|
||||
{
|
||||
|
||||
if( quantityNodes <= 0 )
|
||||
return;
|
||||
|
||||
|
@ -403,6 +467,216 @@ void SpriteMainScene::onDecrease(Object* sender)
|
|||
updateNodes();
|
||||
}
|
||||
|
||||
void SpriteMainScene::dumpProfilerFPS()
|
||||
{
|
||||
if (_vecFPS.empty())
|
||||
{
|
||||
log("Error: the FPS vector is empty");
|
||||
return;
|
||||
}
|
||||
|
||||
auto iter = _vecFPS.begin();
|
||||
float minFPS = *iter;
|
||||
float maxFPS = *iter;
|
||||
float totalFPS = 0.0f;
|
||||
float averagerFPS = 0.0f;
|
||||
for (; iter != _vecFPS.end(); ++iter)
|
||||
{
|
||||
if (minFPS > *iter)
|
||||
{
|
||||
minFPS = *iter;
|
||||
}
|
||||
|
||||
if (maxFPS < *iter)
|
||||
{
|
||||
maxFPS = *iter;
|
||||
}
|
||||
|
||||
totalFPS += *iter;
|
||||
}
|
||||
|
||||
averagerFPS = totalFPS / _vecFPS.size();
|
||||
log("Cur test: %d, cur sub item :%d,cur sprite nums:%d, the min FPS value is %.1f,the max FPS value is %.1f,the averager FPS is %.1f", SpriteMainScene::_s_nSpriteCurCase, subtestNumber, quantityNodes, minFPS, maxFPS, averagerFPS);
|
||||
|
||||
}
|
||||
|
||||
void SpriteMainScene::updateAutoTest(float dt)
|
||||
{
|
||||
if (SpriteMainScene::_s_autoTest)
|
||||
{
|
||||
_executeTimes += 1;
|
||||
_vecFPS.push_back(Director::getInstance()->getFrameRate());
|
||||
if ( _executeTimes >= SpriteMainScene::MAX_AUTO_TEST_TIMES )
|
||||
{
|
||||
dumpProfilerFPS();
|
||||
nextAutoTest();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SpriteMainScene::onEnter()
|
||||
{
|
||||
Scene::onEnter();
|
||||
|
||||
if ( SpriteMainScene::_s_autoTest )
|
||||
{
|
||||
_vecFPS.clear();
|
||||
_executeTimes = 0;
|
||||
|
||||
auto director = Director::getInstance();
|
||||
auto sched = director->getScheduler();
|
||||
|
||||
sched->scheduleSelector(SEL_SCHEDULE(&SpriteMainScene::updateAutoTest), this, 0.2, false);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void SpriteMainScene::onExit()
|
||||
{
|
||||
if ( SpriteMainScene::_s_autoTest )
|
||||
{
|
||||
auto director = Director::getInstance();
|
||||
auto sched = director->getScheduler();
|
||||
|
||||
sched->unscheduleSelector(SEL_SCHEDULE(&SpriteMainScene::updateAutoTest), this );
|
||||
}
|
||||
|
||||
Scene::onExit();
|
||||
}
|
||||
|
||||
void SpriteMainScene::autoShowSpriteTests(int curCase, int subTest,int nodes)
|
||||
{
|
||||
|
||||
SpriteMainScene* scene = NULL;
|
||||
|
||||
switch (curCase)
|
||||
{
|
||||
case 0:
|
||||
scene = new SpritePerformTest1;
|
||||
break;
|
||||
case 1:
|
||||
scene = new SpritePerformTest2;
|
||||
break;
|
||||
case 2:
|
||||
scene = new SpritePerformTest3;
|
||||
break;
|
||||
case 3:
|
||||
scene = new SpritePerformTest4;
|
||||
break;
|
||||
case 4:
|
||||
scene = new SpritePerformTest5;
|
||||
break;
|
||||
case 5:
|
||||
scene = new SpritePerformTest6;
|
||||
break;
|
||||
case 6:
|
||||
scene = new SpritePerformTest7;
|
||||
break;
|
||||
}
|
||||
|
||||
SpriteMainScene::_s_nSpriteCurCase = curCase;
|
||||
|
||||
if (scene)
|
||||
{
|
||||
scene->initWithSubTest(subTest, nodes);
|
||||
Director::getInstance()->replaceScene(scene);
|
||||
scene->release();
|
||||
}
|
||||
}
|
||||
|
||||
void SpriteMainScene::beginAutoTest()
|
||||
{
|
||||
if (0 != SpriteMainScene::_s_nSpriteCurCase)
|
||||
{
|
||||
SpriteMainScene::_s_nSpriteCurCase = 0;
|
||||
}
|
||||
|
||||
auto scene = new SpritePerformTest1;
|
||||
scene->initWithSubTest(1, 500);
|
||||
Director::getInstance()->replaceScene(scene);
|
||||
scene->release();
|
||||
}
|
||||
|
||||
void SpriteMainScene::endAutoTest()
|
||||
{
|
||||
SpriteMainScene::_s_autoTest = false;
|
||||
|
||||
auto director = Director::getInstance();
|
||||
auto sched = director->getScheduler();
|
||||
|
||||
sched->unscheduleSelector( SEL_SCHEDULE( &SpriteMainScene::updateAutoTest ), this );
|
||||
}
|
||||
|
||||
void SpriteMainScene::nextAutoTest()
|
||||
{
|
||||
if ( SpriteMainScene::_s_nSpriteCurCase < SpriteMainScene::MAX_SPRITE_TEST_CASE )
|
||||
{
|
||||
if ( subtestNumber < SpriteMainScene::MAX_SUB_TEST_NUMS )
|
||||
{
|
||||
subtestNumber += 1;
|
||||
autoShowSpriteTests(SpriteMainScene::_s_nSpriteCurCase, subtestNumber, quantityNodes);
|
||||
}
|
||||
else if ( subtestNumber == SpriteMainScene::MAX_SUB_TEST_NUMS )
|
||||
{
|
||||
if (quantityNodes == SpriteMainScene::AUTO_TEST_NODE_NUM1)
|
||||
{
|
||||
autoShowSpriteTests(SpriteMainScene::_s_nSpriteCurCase, 1, SpriteMainScene::AUTO_TEST_NODE_NUM2);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SpriteMainScene::_s_nSpriteCurCase + 1 < SpriteMainScene::MAX_SPRITE_TEST_CASE)
|
||||
{
|
||||
SpriteMainScene::_s_nSpriteCurCase += 1;
|
||||
autoShowSpriteTests(SpriteMainScene::_s_nSpriteCurCase, 1, SpriteMainScene::AUTO_TEST_NODE_NUM1);
|
||||
}
|
||||
else
|
||||
{
|
||||
finishAutoTest();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SpriteMainScene::finishAutoTest()
|
||||
{
|
||||
SpriteMainScene::_s_autoTest = false;
|
||||
auto director = Director::getInstance();
|
||||
auto sched = director->getScheduler();
|
||||
sched->unscheduleSelector( SEL_SCHEDULE( &SpriteMainScene::updateAutoTest ), this);
|
||||
|
||||
auto autoTestMenu = dynamic_cast<Menu*>(getChildByTag(kTagAutoTestMenu));
|
||||
if (nullptr != autoTestMenu)
|
||||
{
|
||||
auto menuItemFont = dynamic_cast<MenuItemFont*>(autoTestMenu->getChildByTag(1));
|
||||
if (nullptr != menuItemFont)
|
||||
{
|
||||
menuItemFont->setString("Auto Test finish");
|
||||
}
|
||||
}
|
||||
|
||||
log("Sprite performance test is finish ");
|
||||
}
|
||||
|
||||
void SpriteMainScene::onAutoTest(Object* sender)
|
||||
{
|
||||
SpriteMainScene::_s_autoTest = !SpriteMainScene::_s_autoTest;
|
||||
MenuItemFont* menuItem = dynamic_cast<MenuItemFont*>(sender);
|
||||
if (nullptr != menuItem)
|
||||
{
|
||||
if (SpriteMainScene::_s_autoTest)
|
||||
{
|
||||
menuItem->setString("Auto Test On");
|
||||
beginAutoTest();
|
||||
}
|
||||
else
|
||||
{
|
||||
menuItem->setString("Auto Test Off");
|
||||
endAutoTest();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// For test functions
|
||||
|
@ -498,7 +772,6 @@ void SpritePerformTest1::doTest(Sprite* sprite)
|
|||
{
|
||||
performancePosition(sprite);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// SpritePerformTest2
|
||||
|
@ -609,6 +882,7 @@ void SpritePerformTest7::doTest(Sprite* sprite)
|
|||
|
||||
void runSpriteTest()
|
||||
{
|
||||
SpriteMainScene::_s_autoTest = false;
|
||||
auto scene = new SpritePerformTest1;
|
||||
scene->initWithSubTest(1, 50);
|
||||
Director::getInstance()->replaceScene(scene);
|
||||
|
|
|
@ -25,6 +25,9 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void restartCallback(Object* sender);
|
||||
virtual void nextCallback(Object* sender);
|
||||
virtual void backCallback(Object* sender);
|
||||
virtual void showCurrentTest();
|
||||
};
|
||||
|
||||
|
@ -45,12 +48,33 @@ public:
|
|||
|
||||
int getSubTestNum() { return subtestNumber; }
|
||||
int getNodesNum() { return quantityNodes; }
|
||||
|
||||
|
||||
virtual void onEnter();
|
||||
virtual void onExit();
|
||||
void updateAutoTest(float dt);
|
||||
void onAutoTest(Object* sender);
|
||||
private:
|
||||
void dumpProfilerFPS();
|
||||
void beginAutoTest();
|
||||
void endAutoTest();
|
||||
void nextAutoTest();
|
||||
void finishAutoTest();
|
||||
void autoShowSpriteTests(int curCase, int subTest,int nodes);
|
||||
public:
|
||||
static bool _s_autoTest;
|
||||
static int _s_nSpriteCurCase;
|
||||
protected:
|
||||
int lastRenderedCount;
|
||||
int quantityNodes;
|
||||
SubTest *_subTest;
|
||||
int subtestNumber;
|
||||
std::vector<float> _vecFPS;
|
||||
int _executeTimes;
|
||||
const int MAX_AUTO_TEST_TIMES = 25;
|
||||
const int MAX_SPRITE_TEST_CASE = 7;
|
||||
const int MAX_SUB_TEST_NUMS = 9;
|
||||
const int AUTO_TEST_NODE_NUM1 = 500;
|
||||
const int AUTO_TEST_NODE_NUM2 = 1500;
|
||||
};
|
||||
|
||||
class SpritePerformTest1 : public SpriteMainScene
|
||||
|
|
|
@ -1 +1 @@
|
|||
b759f56a07f242b20e9c96f2a6cd49c4b5c9dc9b
|
||||
381c282bed409f4b41a82505460d4d6c84ba70ab
|
|
@ -1 +1 @@
|
|||
Subproject commit 946a5276fb9b072ee9ceeb8f49c1aeeea66ab9c4
|
||||
Subproject commit ec90d1c35d06c1de3cb5079f885c22c45b8f129b
|
|
@ -521,6 +521,7 @@ JSBool ScriptingCore::runScript(const char *path, JSObject* global, JSContext* c
|
|||
&length);
|
||||
if (data) {
|
||||
script = JS_DecodeScript(cx, data, length, NULL, NULL);
|
||||
CC_SAFE_DELETE_ARRAY(data);
|
||||
}
|
||||
|
||||
// b) no jsc file, check js file
|
||||
|
|
|
@ -99,6 +99,8 @@ void MinXmlHttpRequest::_gotHeader(string header)
|
|||
pch = strtok (NULL, " ");
|
||||
}
|
||||
}
|
||||
|
||||
CC_SAFE_DELETE_ARRAY(cstr);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1 +1 @@
|
|||
b88df18e2512b5111debda3991f51c2e72a2e5da
|
||||
db6aaa41d0756117258eebb759cd6420f66071e0
|
|
@ -14,6 +14,7 @@
|
|||
#include "js_bindings_core.h"
|
||||
#include "js_manual_conversions.h"
|
||||
#include "js_bindings_system_functions.h"
|
||||
#include "ScriptingCore.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
|
@ -31,7 +32,7 @@ JSBool JSB_localStorageGetItem(JSContext *cx, uint32_t argc, jsval *vp) {
|
|||
|
||||
ret_val = localStorageGetItem((char*)arg0 );
|
||||
|
||||
jsval ret_jsval = charptr_to_jsval( cx, ret_val);
|
||||
jsval ret_jsval = c_string_to_jsval(cx, ret_val ? ret_val : "");
|
||||
JS_SET_RVAL(cx, vp, ret_jsval );
|
||||
|
||||
return JS_TRUE;
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
D44C620C132DFF330009C878 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D44C620B132DFF330009C878 /* OpenAL.framework */; };
|
||||
D44C620E132DFF430009C878 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D44C620D132DFF430009C878 /* AVFoundation.framework */; };
|
||||
D44C6210132DFF4E0009C878 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D44C620F132DFF4E0009C878 /* AudioToolbox.framework */; };
|
||||
D6B0611B1803AB670077942B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6B0611A1803AB670077942B /* CoreMotion.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
|
@ -294,6 +295,7 @@
|
|||
D44C620B132DFF330009C878 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; };
|
||||
D44C620D132DFF430009C878 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
|
||||
D44C620F132DFF4E0009C878 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
|
||||
D6B0611A1803AB670077942B /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -301,6 +303,7 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D6B0611B1803AB670077942B /* CoreMotion.framework in Frameworks */,
|
||||
1AF4C2F417865DCB00122817 /* libbox2d iOS.a in Frameworks */,
|
||||
1AF4C2F517865DCB00122817 /* libchipmunk iOS.a in Frameworks */,
|
||||
1AF4C2F617865DCB00122817 /* libcocos2dx iOS.a in Frameworks */,
|
||||
|
@ -419,6 +422,7 @@
|
|||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D6B0611A1803AB670077942B /* CoreMotion.framework */,
|
||||
503AE11A17EB9C5A00D1A890 /* IOKit.framework */,
|
||||
503AE11117EB99EE00D1A890 /* libcurl.dylib */,
|
||||
5087E78A17EB975400C73F5D /* OpenGL.framework */,
|
||||
|
|
|
@ -95,6 +95,7 @@
|
|||
A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; };
|
||||
D454520C156E22BD00887EB5 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D454520B156E22BD00887EB5 /* libz.dylib */; };
|
||||
D4545227156E28EF00887EB5 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4545215156E28EF00887EB5 /* AppDelegate.cpp */; };
|
||||
D6B061241803AB9F0077942B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6B061231803AB9F0077942B /* CoreMotion.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
|
@ -276,6 +277,7 @@
|
|||
D454520B156E22BD00887EB5 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
|
||||
D4545215156E28EF00887EB5 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = "<group>"; };
|
||||
D4545216156E28EF00887EB5 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
D6B061231803AB9F0077942B /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -307,6 +309,7 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D6B061241803AB9F0077942B /* CoreMotion.framework in Frameworks */,
|
||||
1AF4C33317865EC500122817 /* libchipmunk iOS.a in Frameworks */,
|
||||
1AF4C33417865EC500122817 /* libcocos2dx iOS.a in Frameworks */,
|
||||
1AF4C33517865EC500122817 /* libcocos2dx-extensions iOS.a in Frameworks */,
|
||||
|
@ -437,6 +440,7 @@
|
|||
A92275401517C094001B78AA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D6B061231803AB9F0077942B /* CoreMotion.framework */,
|
||||
502380DB17EBB88200990C9B /* libcurl.dylib */,
|
||||
509D4AEA17EBB82600697056 /* IOKit.framework */,
|
||||
509D4AE817EBB82000697056 /* AppKit.framework */,
|
||||
|
|
|
@ -101,6 +101,7 @@
|
|||
50D7C97417EBBEF7005D0B91 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3CF1786631700122817 /* libcocos2dx-extensions Mac.a */; };
|
||||
50D7C97517EBBEF7005D0B91 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3D51786631700122817 /* libCocosDenshion Mac.a */; };
|
||||
50D7C97617EBBEF7005D0B91 /* libluabindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3D91786631700122817 /* libluabindings Mac.a */; };
|
||||
D6B061351803AC000077942B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6B061341803AC000077942B /* CoreMotion.framework */; };
|
||||
F293B3CD15EB7BE500256477 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3CC15EB7BE500256477 /* QuartzCore.framework */; };
|
||||
F293B3D115EB7BE500256477 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D015EB7BE500256477 /* OpenAL.framework */; };
|
||||
F293B3D315EB7BE500256477 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D215EB7BE500256477 /* AudioToolbox.framework */; };
|
||||
|
@ -285,6 +286,7 @@
|
|||
50D7C96B17EBBEDF005D0B91 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
|
||||
50D7C96D17EBBEE6005D0B91 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
||||
50D7C96F17EBBEEC005D0B91 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
|
||||
D6B061341803AC000077942B /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; };
|
||||
F293B3C815EB7BE500256477 /* HelloLua iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloLua iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F293B3CC15EB7BE500256477 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
||||
F293B3CE15EB7BE500256477 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
|
||||
|
@ -326,6 +328,7 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D6B061351803AC000077942B /* CoreMotion.framework in Frameworks */,
|
||||
50D7C96517EBBECA005D0B91 /* libbox2d iOS.a in Frameworks */,
|
||||
50D7C96617EBBECA005D0B91 /* libchipmunk iOS.a in Frameworks */,
|
||||
50D7C96717EBBECA005D0B91 /* libcocos2dx iOS.a in Frameworks */,
|
||||
|
@ -462,6 +465,7 @@
|
|||
F293B3CB15EB7BE500256477 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D6B061341803AC000077942B /* CoreMotion.framework */,
|
||||
50D7C96F17EBBEEC005D0B91 /* IOKit.framework */,
|
||||
50D7C96D17EBBEE6005D0B91 /* AppKit.framework */,
|
||||
50D7C96B17EBBEDF005D0B91 /* OpenGL.framework */,
|
||||
|
|
Loading…
Reference in New Issue