Merge pull request #7896 from ricardoquesada/std_nothrow

Adds `std::nothrow` to the `new` statements
This commit is contained in:
minggo 2014-08-28 10:06:55 +08:00
commit 5f20d17bc0
328 changed files with 1368 additions and 1368 deletions

View File

@ -1,20 +1,19 @@
cocos2d-x-3.3alpha0 ??
[NEW] Added UIScale9Sprite
[NEW] Added Camera, AABB, OBB and Ray
[NEW] Added render primitive and render primitive command, support passing point, line and triangle data
[NEW] Added support for applicationDidEnterBackground / applicationWillEnterForeground on desktop
[NEW] Added method for custom precompiled shader program loading on WP8
[NEW] Added c++11 random support
[NEW] Added better reskin model support
[NEW] Added consistent way to set GL context attributes
[NEW] 3D: Added Camera, AABB, OBB and Ray
[NEW] 3D: Added better reskin model support
[NEW] Core: c++11 random support
[NEW] Core: Using `(std::notrow)` for all the `new` statements
[NEW] Desktop: Added support for applicationDidEnterBackground / applicationWillEnterForeground on desktop
[NEW] Device: added setKeepScreenOn() for iOS and Android
[NEW] EventMouse: support getDelta, getDeltaX, getDeltaY functions
[NEW] FileUtils: add isDirectoryExist(), createDirectory(), removeDirectory(), removeFile(), renameFile()
getFileSize()
[NEW] FileUtils: add isDirectoryExist(), createDirectory(), removeDirectory(), removeFile(), renameFile(), getFileSize()
[NEW] FileUtilsApple: allow setting bundle to use in file utils on iOS and Mac OS X
[NEW] Image: support of software PVRTC v1 decompression
[NEW] Lua-binding: added release_print that can print log even in release mode
[NEW] Physics Integration: can invoke update in demand
[NEW] Renderer: Added primitive and render primitive command, support passing point, line and triangle data
[NEW] Renderer: Added method for custom precompiled shader program loading on WP8
[NEW] Renderer: Added consistent way to set GL context attributes
[NEW] RenderTexture: add a call back function for saveToFile()
[NEW] RotateTo: added 3D rotation support
[NEW] ScrollView: added `setMinScale()` and `setMaxScale()`
@ -22,11 +21,12 @@ cocos2d-x-3.3alpha0 ??
[NEW] Sprite3D: added getBoundingBox() and getAABB()
[NEW] SpriteFrameCache: load from plist file content data
[NEW] utils: added gettime()
[NEW] ui::Button: support customize how much zoom scale is when pressing a button
[NEW] ui::PageView: added `customScrollThreshold`, could determine the swipe distance to trigger a PageView scroll event
[NEW] ui::TextField: support utf8
[NEW] ui::TextField: support set color and placehold color
[NEW] ui::Widget: support swallowing touch events
[NEW] UI: Added Added UIScale9Sprite
[NEW] UI: ui::Button: support customize how much zoom scale is when pressing a button
[NEW] UI: ui::PageView: added `customScrollThreshold`, could determine the swipe distance to trigger a PageView scroll event
[NEW] UI: ui::TextField: support utf8
[NEW] UI: ui::TextField: support set color and placehold color
[NEW] UI: ui::Widget: support swallowing touch events
[NEW] Text: added getter and setter for TextColor
[FIX] EditBox: font size is not scaled when glview is scaled on Mac OS X

View File

@ -96,7 +96,7 @@ Speed::~Speed()
Speed* Speed::create(ActionInterval* action, float speed)
{
Speed *ret = new Speed();
Speed *ret = new (std::nothrow) Speed();
if (ret && ret->initWithAction(action, speed))
{
ret->autorelease();
@ -118,7 +118,7 @@ bool Speed::initWithAction(ActionInterval *action, float speed)
Speed *Speed::clone() const
{
// no copy constructor
auto a = new Speed();
auto a = new (std::nothrow) Speed();
a->initWithAction(_innerAction->clone(), _speed);
a->autorelease();
return a;
@ -172,7 +172,7 @@ Follow::~Follow()
Follow* Follow::create(Node *followedNode, const Rect& rect/* = Rect::ZERO*/)
{
Follow *follow = new Follow();
Follow *follow = new (std::nothrow) Follow();
if (follow && follow->initWithTarget(followedNode, rect))
{
follow->autorelease();
@ -185,7 +185,7 @@ Follow* Follow::create(Node *followedNode, const Rect& rect/* = Rect::ZERO*/)
Follow* Follow::clone() const
{
// no copy constructor
auto a = new Follow();
auto a = new (std::nothrow) Follow();
a->initWithTarget(_followedNode, _worldRect);
a->autorelease();
return a;

View File

@ -47,7 +47,7 @@ void ActionCamera::startWithTarget(Node *target)
ActionCamera* ActionCamera::clone() const
{
// no copy constructor
auto a = new ActionCamera();
auto a = new (std::nothrow) ActionCamera();
a->autorelease();
return a;
}
@ -148,7 +148,7 @@ OrbitCamera::~OrbitCamera()
OrbitCamera * OrbitCamera::create(float t, float radius, float deltaRadius, float angleZ, float deltaAngleZ, float angleX, float deltaAngleX)
{
OrbitCamera * obitCamera = new OrbitCamera();
OrbitCamera * obitCamera = new (std::nothrow) OrbitCamera();
if(obitCamera->initWithDuration(t, radius, deltaRadius, angleZ, deltaAngleZ, angleX, deltaAngleX))
{
obitCamera->autorelease();
@ -161,7 +161,7 @@ OrbitCamera * OrbitCamera::create(float t, float radius, float deltaRadius, floa
OrbitCamera* OrbitCamera::clone() const
{
// no copy constructor
auto a = new OrbitCamera();
auto a = new (std::nothrow) OrbitCamera();
a->initWithDuration(_duration, _radius, _deltaRadius, _angleZ, _deltaAngleZ, _angleX, _deltaAngleX);
a->autorelease();
return a;

View File

@ -43,7 +43,7 @@ NS_CC_BEGIN;
PointArray* PointArray::create(ssize_t capacity)
{
PointArray* pointArray = new PointArray();
PointArray* pointArray = new (std::nothrow) PointArray();
if (pointArray)
{
if (pointArray->initWithCapacity(capacity))
@ -77,7 +77,7 @@ PointArray* PointArray::clone() const
newArray->push_back(new Vec2((*iter)->x, (*iter)->y));
}
PointArray *points = new PointArray();
PointArray *points = new (std::nothrow) PointArray();
points->initWithCapacity(10);
points->setControlPoints(newArray);
@ -126,7 +126,7 @@ void PointArray::addControlPoint(Vec2 controlPoint)
void PointArray::insertControlPoint(Vec2 &controlPoint, ssize_t index)
{
Vec2 *temp = new Vec2(controlPoint.x, controlPoint.y);
Vec2 *temp = new (std::nothrow) Vec2(controlPoint.x, controlPoint.y);
_controlPoints->insert(_controlPoints->begin() + index, temp);
}
@ -222,7 +222,7 @@ Vec2 ccCardinalSplineAt(Vec2 &p0, Vec2 &p1, Vec2 &p2, Vec2 &p3, float tension, f
CardinalSplineTo* CardinalSplineTo::create(float duration, cocos2d::PointArray *points, float tension)
{
CardinalSplineTo *ret = new CardinalSplineTo();
CardinalSplineTo *ret = new (std::nothrow) CardinalSplineTo();
if (ret)
{
if (ret->initWithDuration(duration, points, tension))
@ -281,7 +281,7 @@ void CardinalSplineTo::startWithTarget(cocos2d::Node *target)
CardinalSplineTo* CardinalSplineTo::clone() const
{
// no copy constructor
auto a = new CardinalSplineTo();
auto a = new (std::nothrow) CardinalSplineTo();
a->initWithDuration(this->_duration, this->_points->clone(), this->_tension);
a->autorelease();
return a;
@ -346,7 +346,7 @@ CardinalSplineTo* CardinalSplineTo::reverse() const
CardinalSplineBy* CardinalSplineBy::create(float duration, cocos2d::PointArray *points, float tension)
{
CardinalSplineBy *ret = new CardinalSplineBy();
CardinalSplineBy *ret = new (std::nothrow) CardinalSplineBy();
if (ret)
{
if (ret->initWithDuration(duration, points, tension))
@ -425,7 +425,7 @@ void CardinalSplineBy::startWithTarget(cocos2d::Node *target)
CardinalSplineBy* CardinalSplineBy::clone() const
{
// no copy constructor
auto a = new CardinalSplineBy();
auto a = new (std::nothrow) CardinalSplineBy();
a->initWithDuration(this->_duration, this->_points->clone(), this->_tension);
a->autorelease();
return a;
@ -436,7 +436,7 @@ CardinalSplineBy* CardinalSplineBy::clone() const
CatmullRomTo* CatmullRomTo::create(float dt, cocos2d::PointArray *points)
{
CatmullRomTo *ret = new CatmullRomTo();
CatmullRomTo *ret = new (std::nothrow) CatmullRomTo();
if (ret)
{
if (ret->initWithDuration(dt, points))
@ -465,7 +465,7 @@ bool CatmullRomTo::initWithDuration(float dt, cocos2d::PointArray *points)
CatmullRomTo* CatmullRomTo::clone() const
{
// no copy constructor
auto a = new CatmullRomTo();
auto a = new (std::nothrow) CatmullRomTo();
a->initWithDuration(this->_duration, this->_points->clone());
a->autorelease();
return a;
@ -483,7 +483,7 @@ CatmullRomTo* CatmullRomTo::reverse() const
CatmullRomBy* CatmullRomBy::create(float dt, cocos2d::PointArray *points)
{
CatmullRomBy *ret = new CatmullRomBy();
CatmullRomBy *ret = new (std::nothrow) CatmullRomBy();
if (ret)
{
if (ret->initWithDuration(dt, points))
@ -512,7 +512,7 @@ bool CatmullRomBy::initWithDuration(float dt, cocos2d::PointArray *points)
CatmullRomBy* CatmullRomBy::clone() const
{
// no copy constructor
auto a = new CatmullRomBy();
auto a = new (std::nothrow) CatmullRomBy();
a->initWithDuration(this->_duration, this->_points->clone());
a->autorelease();
return a;

View File

@ -111,7 +111,7 @@ EaseRateAction::~EaseRateAction()
EaseIn* EaseIn::create(ActionInterval *action, float rate)
{
EaseIn *easeIn = new EaseIn();
EaseIn *easeIn = new (std::nothrow) EaseIn();
if (easeIn)
{
if (easeIn->initWithAction(action, rate))
@ -130,7 +130,7 @@ EaseIn* EaseIn::create(ActionInterval *action, float rate)
EaseIn* EaseIn::clone() const
{
// no copy constructor
auto a = new EaseIn();
auto a = new (std::nothrow) EaseIn();
a->initWithAction(_inner->clone(), _rate);
a->autorelease();
return a;
@ -151,7 +151,7 @@ EaseIn* EaseIn::reverse() const
//
EaseOut* EaseOut::create(ActionInterval *action, float rate)
{
EaseOut *easeOut = new EaseOut();
EaseOut *easeOut = new (std::nothrow) EaseOut();
if (easeOut)
{
if (easeOut->initWithAction(action, rate))
@ -170,7 +170,7 @@ EaseOut* EaseOut::create(ActionInterval *action, float rate)
EaseOut* EaseOut::clone() const
{
// no copy constructor
auto a = new EaseOut();
auto a = new (std::nothrow) EaseOut();
a->initWithAction(_inner->clone(), _rate);
a->autorelease();
return a;
@ -191,7 +191,7 @@ EaseOut* EaseOut::reverse() const
//
EaseInOut* EaseInOut::create(ActionInterval *action, float rate)
{
EaseInOut *easeInOut = new EaseInOut();
EaseInOut *easeInOut = new (std::nothrow) EaseInOut();
if (easeInOut)
{
if (easeInOut->initWithAction(action, rate))
@ -210,7 +210,7 @@ EaseInOut* EaseInOut::create(ActionInterval *action, float rate)
EaseInOut* EaseInOut::clone() const
{
// no copy constructor
auto a = new EaseInOut();
auto a = new (std::nothrow) EaseInOut();
a->initWithAction(_inner->clone(), _rate);
a->autorelease();
return a;
@ -232,7 +232,7 @@ EaseInOut* EaseInOut::reverse() const
//
EaseExponentialIn* EaseExponentialIn::create(ActionInterval* action)
{
EaseExponentialIn *ret = new EaseExponentialIn();
EaseExponentialIn *ret = new (std::nothrow) EaseExponentialIn();
if (ret)
{
if (ret->initWithAction(action))
@ -251,7 +251,7 @@ EaseExponentialIn* EaseExponentialIn::create(ActionInterval* action)
EaseExponentialIn* EaseExponentialIn::clone() const
{
// no copy constructor
auto a = new EaseExponentialIn();
auto a = new (std::nothrow) EaseExponentialIn();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -272,7 +272,7 @@ ActionEase * EaseExponentialIn::reverse() const
//
EaseExponentialOut* EaseExponentialOut::create(ActionInterval* action)
{
EaseExponentialOut *ret = new EaseExponentialOut();
EaseExponentialOut *ret = new (std::nothrow) EaseExponentialOut();
if (ret)
{
if (ret->initWithAction(action))
@ -291,7 +291,7 @@ EaseExponentialOut* EaseExponentialOut::create(ActionInterval* action)
EaseExponentialOut* EaseExponentialOut::clone() const
{
// no copy constructor
auto a = new EaseExponentialOut();
auto a = new (std::nothrow) EaseExponentialOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -313,7 +313,7 @@ ActionEase* EaseExponentialOut::reverse() const
EaseExponentialInOut* EaseExponentialInOut::create(ActionInterval *action)
{
EaseExponentialInOut *ret = new EaseExponentialInOut();
EaseExponentialInOut *ret = new (std::nothrow) EaseExponentialInOut();
if (ret)
{
if (ret->initWithAction(action))
@ -332,7 +332,7 @@ EaseExponentialInOut* EaseExponentialInOut::create(ActionInterval *action)
EaseExponentialInOut* EaseExponentialInOut::clone() const
{
// no copy constructor
auto a = new EaseExponentialInOut();
auto a = new (std::nothrow) EaseExponentialInOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -354,7 +354,7 @@ EaseExponentialInOut* EaseExponentialInOut::reverse() const
EaseSineIn* EaseSineIn::create(ActionInterval* action)
{
EaseSineIn *ret = new EaseSineIn();
EaseSineIn *ret = new (std::nothrow) EaseSineIn();
if (ret)
{
if (ret->initWithAction(action))
@ -373,7 +373,7 @@ EaseSineIn* EaseSineIn::create(ActionInterval* action)
EaseSineIn* EaseSineIn::clone() const
{
// no copy constructor
auto a = new EaseSineIn();
auto a = new (std::nothrow) EaseSineIn();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -395,7 +395,7 @@ ActionEase* EaseSineIn::reverse() const
EaseSineOut* EaseSineOut::create(ActionInterval* action)
{
EaseSineOut *ret = new EaseSineOut();
EaseSineOut *ret = new (std::nothrow) EaseSineOut();
if (ret)
{
if (ret->initWithAction(action))
@ -414,7 +414,7 @@ EaseSineOut* EaseSineOut::create(ActionInterval* action)
EaseSineOut* EaseSineOut::clone() const
{
// no copy constructor
auto a = new EaseSineOut();
auto a = new (std::nothrow) EaseSineOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -436,7 +436,7 @@ ActionEase* EaseSineOut::reverse(void) const
EaseSineInOut* EaseSineInOut::create(ActionInterval* action)
{
EaseSineInOut *ret = new EaseSineInOut();
EaseSineInOut *ret = new (std::nothrow) EaseSineInOut();
if (ret)
{
if (ret->initWithAction(action))
@ -455,7 +455,7 @@ EaseSineInOut* EaseSineInOut::create(ActionInterval* action)
EaseSineInOut* EaseSineInOut::clone() const
{
// no copy constructor
auto a = new EaseSineInOut();
auto a = new (std::nothrow) EaseSineInOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -497,7 +497,7 @@ EaseElasticIn* EaseElasticIn::create(ActionInterval *action)
EaseElasticIn* EaseElasticIn::create(ActionInterval *action, float period/* = 0.3f*/)
{
EaseElasticIn *ret = new EaseElasticIn();
EaseElasticIn *ret = new (std::nothrow) EaseElasticIn();
if (ret)
{
if (ret->initWithAction(action, period))
@ -516,7 +516,7 @@ EaseElasticIn* EaseElasticIn::create(ActionInterval *action, float period/* = 0.
EaseElasticIn* EaseElasticIn::clone() const
{
// no copy constructor
auto a = new EaseElasticIn();
auto a = new (std::nothrow) EaseElasticIn();
a->initWithAction(_inner->clone(), _period);
a->autorelease();
return a;
@ -543,7 +543,7 @@ EaseElasticOut* EaseElasticOut::create(ActionInterval *action)
EaseElasticOut* EaseElasticOut::create(ActionInterval *action, float period/* = 0.3f*/)
{
EaseElasticOut *ret = new EaseElasticOut();
EaseElasticOut *ret = new (std::nothrow) EaseElasticOut();
if (ret)
{
if (ret->initWithAction(action, period))
@ -562,7 +562,7 @@ EaseElasticOut* EaseElasticOut::create(ActionInterval *action, float period/* =
EaseElasticOut* EaseElasticOut::clone() const
{
// no copy constructor
auto a = new EaseElasticOut();
auto a = new (std::nothrow) EaseElasticOut();
a->initWithAction(_inner->clone(), _period);
a->autorelease();
return a;
@ -589,7 +589,7 @@ EaseElasticInOut* EaseElasticInOut::create(ActionInterval *action)
EaseElasticInOut* EaseElasticInOut::create(ActionInterval *action, float period/* = 0.3f*/)
{
EaseElasticInOut *ret = new EaseElasticInOut();
EaseElasticInOut *ret = new (std::nothrow) EaseElasticInOut();
if (ret)
{
if (ret->initWithAction(action, period))
@ -608,7 +608,7 @@ EaseElasticInOut* EaseElasticInOut::create(ActionInterval *action, float period/
EaseElasticInOut* EaseElasticInOut::clone() const
{
// no copy constructor
auto a = new EaseElasticInOut();
auto a = new (std::nothrow) EaseElasticInOut();
a->initWithAction(_inner->clone(), _period);
a->autorelease();
return a;
@ -634,7 +634,7 @@ EaseElasticInOut* EaseElasticInOut::reverse() const
EaseBounceIn* EaseBounceIn::create(ActionInterval* action)
{
EaseBounceIn *ret = new EaseBounceIn();
EaseBounceIn *ret = new (std::nothrow) EaseBounceIn();
if (ret)
{
if (ret->initWithAction(action))
@ -653,7 +653,7 @@ EaseBounceIn* EaseBounceIn::create(ActionInterval* action)
EaseBounceIn* EaseBounceIn::clone() const
{
// no copy constructor
auto a = new EaseBounceIn();
auto a = new (std::nothrow) EaseBounceIn();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -675,7 +675,7 @@ EaseBounce* EaseBounceIn::reverse() const
EaseBounceOut* EaseBounceOut::create(ActionInterval* action)
{
EaseBounceOut *ret = new EaseBounceOut();
EaseBounceOut *ret = new (std::nothrow) EaseBounceOut();
if (ret)
{
if (ret->initWithAction(action))
@ -694,7 +694,7 @@ EaseBounceOut* EaseBounceOut::create(ActionInterval* action)
EaseBounceOut* EaseBounceOut::clone() const
{
// no copy constructor
auto a = new EaseBounceOut();
auto a = new (std::nothrow) EaseBounceOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -716,7 +716,7 @@ EaseBounce* EaseBounceOut::reverse() const
EaseBounceInOut* EaseBounceInOut::create(ActionInterval* action)
{
EaseBounceInOut *ret = new EaseBounceInOut();
EaseBounceInOut *ret = new (std::nothrow) EaseBounceInOut();
if (ret)
{
if (ret->initWithAction(action))
@ -735,7 +735,7 @@ EaseBounceInOut* EaseBounceInOut::create(ActionInterval* action)
EaseBounceInOut* EaseBounceInOut::clone() const
{
// no copy constructor
auto a = new EaseBounceInOut();
auto a = new (std::nothrow) EaseBounceInOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -757,7 +757,7 @@ EaseBounceInOut* EaseBounceInOut::reverse() const
EaseBackIn* EaseBackIn::create(ActionInterval *action)
{
EaseBackIn *ret = new EaseBackIn();
EaseBackIn *ret = new (std::nothrow) EaseBackIn();
if (ret)
{
if (ret->initWithAction(action))
@ -776,7 +776,7 @@ EaseBackIn* EaseBackIn::create(ActionInterval *action)
EaseBackIn* EaseBackIn::clone() const
{
// no copy constructor
auto a = new EaseBackIn();
auto a = new (std::nothrow) EaseBackIn();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -798,7 +798,7 @@ ActionEase* EaseBackIn::reverse() const
EaseBackOut* EaseBackOut::create(ActionInterval* action)
{
EaseBackOut *ret = new EaseBackOut();
EaseBackOut *ret = new (std::nothrow) EaseBackOut();
if (ret)
{
if (ret->initWithAction(action))
@ -817,7 +817,7 @@ EaseBackOut* EaseBackOut::create(ActionInterval* action)
EaseBackOut* EaseBackOut::clone() const
{
// no copy constructor
auto a = new EaseBackOut();
auto a = new (std::nothrow) EaseBackOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -839,7 +839,7 @@ ActionEase* EaseBackOut::reverse() const
EaseBackInOut* EaseBackInOut::create(ActionInterval* action)
{
EaseBackInOut *ret = new EaseBackInOut();
EaseBackInOut *ret = new (std::nothrow) EaseBackInOut();
if (ret)
{
if (ret->initWithAction(action))
@ -858,7 +858,7 @@ EaseBackInOut* EaseBackInOut::create(ActionInterval* action)
EaseBackInOut* EaseBackInOut::clone() const
{
// no copy constructor
auto a = new EaseBackInOut();
auto a = new (std::nothrow) EaseBackInOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -879,7 +879,7 @@ EaseBackInOut* EaseBackInOut::reverse() const
EaseBezierAction* EaseBezierAction::create(cocos2d::ActionInterval* action)
{
EaseBezierAction *ret = new EaseBezierAction();
EaseBezierAction *ret = new (std::nothrow) EaseBezierAction();
if (ret)
{
if (ret->initWithAction(action))
@ -906,7 +906,7 @@ void EaseBezierAction::setBezierParamer( float p0, float p1, float p2, float p3)
EaseBezierAction* EaseBezierAction::clone() const
{
// no copy constructor
auto a = new EaseBezierAction();
auto a = new (std::nothrow) EaseBezierAction();
a->initWithAction(_inner->clone());
a->setBezierParamer(_p0,_p1,_p2,_p3);
a->autorelease();
@ -931,7 +931,7 @@ EaseBezierAction* EaseBezierAction::reverse() const
EaseQuadraticActionIn* EaseQuadraticActionIn::create(ActionInterval* action)
{
EaseQuadraticActionIn *ret = new EaseQuadraticActionIn();
EaseQuadraticActionIn *ret = new (std::nothrow) EaseQuadraticActionIn();
if (ret)
{
if (ret->initWithAction(action))
@ -950,7 +950,7 @@ EaseQuadraticActionIn* EaseQuadraticActionIn::create(ActionInterval* action)
EaseQuadraticActionIn* EaseQuadraticActionIn::clone() const
{
// no copy constructor
auto a = new EaseQuadraticActionIn();
auto a = new (std::nothrow) EaseQuadraticActionIn();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -972,7 +972,7 @@ EaseQuadraticActionIn* EaseQuadraticActionIn::reverse() const
EaseQuadraticActionOut* EaseQuadraticActionOut::create(ActionInterval* action)
{
EaseQuadraticActionOut *ret = new EaseQuadraticActionOut();
EaseQuadraticActionOut *ret = new (std::nothrow) EaseQuadraticActionOut();
if (ret)
{
if (ret->initWithAction(action))
@ -991,7 +991,7 @@ EaseQuadraticActionOut* EaseQuadraticActionOut::create(ActionInterval* action)
EaseQuadraticActionOut* EaseQuadraticActionOut::clone() const
{
// no copy constructor
auto a = new EaseQuadraticActionOut();
auto a = new (std::nothrow) EaseQuadraticActionOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -1013,7 +1013,7 @@ EaseQuadraticActionOut* EaseQuadraticActionOut::reverse() const
EaseQuadraticActionInOut* EaseQuadraticActionInOut::create(ActionInterval* action)
{
EaseQuadraticActionInOut *ret = new EaseQuadraticActionInOut();
EaseQuadraticActionInOut *ret = new (std::nothrow) EaseQuadraticActionInOut();
if (ret)
{
if (ret->initWithAction(action))
@ -1032,7 +1032,7 @@ EaseQuadraticActionInOut* EaseQuadraticActionInOut::create(ActionInterval* actio
EaseQuadraticActionInOut* EaseQuadraticActionInOut::clone() const
{
// no copy constructor
auto a = new EaseQuadraticActionInOut();
auto a = new (std::nothrow) EaseQuadraticActionInOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -1054,7 +1054,7 @@ EaseQuadraticActionInOut* EaseQuadraticActionInOut::reverse() const
EaseQuarticActionIn* EaseQuarticActionIn::create(ActionInterval* action)
{
EaseQuarticActionIn *ret = new EaseQuarticActionIn();
EaseQuarticActionIn *ret = new (std::nothrow) EaseQuarticActionIn();
if (ret)
{
if (ret->initWithAction(action))
@ -1073,7 +1073,7 @@ EaseQuarticActionIn* EaseQuarticActionIn::create(ActionInterval* action)
EaseQuarticActionIn* EaseQuarticActionIn::clone() const
{
// no copy constructor
auto a = new EaseQuarticActionIn();
auto a = new (std::nothrow) EaseQuarticActionIn();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -1095,7 +1095,7 @@ EaseQuarticActionIn* EaseQuarticActionIn::reverse() const
EaseQuarticActionOut* EaseQuarticActionOut::create(ActionInterval* action)
{
EaseQuarticActionOut *ret = new EaseQuarticActionOut();
EaseQuarticActionOut *ret = new (std::nothrow) EaseQuarticActionOut();
if (ret)
{
if (ret->initWithAction(action))
@ -1114,7 +1114,7 @@ EaseQuarticActionOut* EaseQuarticActionOut::create(ActionInterval* action)
EaseQuarticActionOut* EaseQuarticActionOut::clone() const
{
// no copy constructor
auto a = new EaseQuarticActionOut();
auto a = new (std::nothrow) EaseQuarticActionOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -1136,7 +1136,7 @@ EaseQuarticActionOut* EaseQuarticActionOut::reverse() const
EaseQuarticActionInOut* EaseQuarticActionInOut::create(ActionInterval* action)
{
EaseQuarticActionInOut *ret = new EaseQuarticActionInOut();
EaseQuarticActionInOut *ret = new (std::nothrow) EaseQuarticActionInOut();
if (ret)
{
if (ret->initWithAction(action))
@ -1155,7 +1155,7 @@ EaseQuarticActionInOut* EaseQuarticActionInOut::create(ActionInterval* action)
EaseQuarticActionInOut* EaseQuarticActionInOut::clone() const
{
// no copy constructor
auto a = new EaseQuarticActionInOut();
auto a = new (std::nothrow) EaseQuarticActionInOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -1177,7 +1177,7 @@ EaseQuarticActionInOut* EaseQuarticActionInOut::reverse() const
EaseQuinticActionIn* EaseQuinticActionIn::create(ActionInterval* action)
{
EaseQuinticActionIn *ret = new EaseQuinticActionIn();
EaseQuinticActionIn *ret = new (std::nothrow) EaseQuinticActionIn();
if (ret)
{
if (ret->initWithAction(action))
@ -1196,7 +1196,7 @@ EaseQuinticActionIn* EaseQuinticActionIn::create(ActionInterval* action)
EaseQuinticActionIn* EaseQuinticActionIn::clone() const
{
// no copy constructor
auto a = new EaseQuinticActionIn();
auto a = new (std::nothrow) EaseQuinticActionIn();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -1218,7 +1218,7 @@ EaseQuinticActionIn* EaseQuinticActionIn::reverse() const
EaseQuinticActionOut* EaseQuinticActionOut::create(ActionInterval* action)
{
EaseQuinticActionOut *ret = new EaseQuinticActionOut();
EaseQuinticActionOut *ret = new (std::nothrow) EaseQuinticActionOut();
if (ret)
{
if (ret->initWithAction(action))
@ -1237,7 +1237,7 @@ EaseQuinticActionOut* EaseQuinticActionOut::create(ActionInterval* action)
EaseQuinticActionOut* EaseQuinticActionOut::clone() const
{
// no copy constructor
auto a = new EaseQuinticActionOut();
auto a = new (std::nothrow) EaseQuinticActionOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -1259,7 +1259,7 @@ EaseQuinticActionOut* EaseQuinticActionOut::reverse() const
EaseQuinticActionInOut* EaseQuinticActionInOut::create(ActionInterval* action)
{
EaseQuinticActionInOut *ret = new EaseQuinticActionInOut();
EaseQuinticActionInOut *ret = new (std::nothrow) EaseQuinticActionInOut();
if (ret)
{
if (ret->initWithAction(action))
@ -1278,7 +1278,7 @@ EaseQuinticActionInOut* EaseQuinticActionInOut::create(ActionInterval* action)
EaseQuinticActionInOut* EaseQuinticActionInOut::clone() const
{
// no copy constructor
auto a = new EaseQuinticActionInOut();
auto a = new (std::nothrow) EaseQuinticActionInOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -1300,7 +1300,7 @@ EaseQuinticActionInOut* EaseQuinticActionInOut::reverse() const
EaseCircleActionIn* EaseCircleActionIn::create(ActionInterval* action)
{
EaseCircleActionIn *ret = new EaseCircleActionIn();
EaseCircleActionIn *ret = new (std::nothrow) EaseCircleActionIn();
if (ret)
{
if (ret->initWithAction(action))
@ -1319,7 +1319,7 @@ EaseCircleActionIn* EaseCircleActionIn::create(ActionInterval* action)
EaseCircleActionIn* EaseCircleActionIn::clone() const
{
// no copy constructor
auto a = new EaseCircleActionIn();
auto a = new (std::nothrow) EaseCircleActionIn();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -1341,7 +1341,7 @@ EaseCircleActionIn* EaseCircleActionIn::reverse() const
EaseCircleActionOut* EaseCircleActionOut::create(ActionInterval* action)
{
EaseCircleActionOut *ret = new EaseCircleActionOut();
EaseCircleActionOut *ret = new (std::nothrow) EaseCircleActionOut();
if (ret)
{
if (ret->initWithAction(action))
@ -1360,7 +1360,7 @@ EaseCircleActionOut* EaseCircleActionOut::create(ActionInterval* action)
EaseCircleActionOut* EaseCircleActionOut::clone() const
{
// no copy constructor
auto a = new EaseCircleActionOut();
auto a = new (std::nothrow) EaseCircleActionOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -1382,7 +1382,7 @@ EaseCircleActionOut* EaseCircleActionOut::reverse() const
EaseCircleActionInOut* EaseCircleActionInOut::create(ActionInterval* action)
{
EaseCircleActionInOut *ret = new EaseCircleActionInOut();
EaseCircleActionInOut *ret = new (std::nothrow) EaseCircleActionInOut();
if (ret)
{
if (ret->initWithAction(action))
@ -1401,7 +1401,7 @@ EaseCircleActionInOut* EaseCircleActionInOut::create(ActionInterval* action)
EaseCircleActionInOut* EaseCircleActionInOut::clone() const
{
// no copy constructor
auto a = new EaseCircleActionInOut();
auto a = new (std::nothrow) EaseCircleActionInOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -1423,7 +1423,7 @@ EaseCircleActionInOut* EaseCircleActionInOut::reverse() const
EaseCubicActionIn* EaseCubicActionIn::create(ActionInterval* action)
{
EaseCubicActionIn *ret = new EaseCubicActionIn();
EaseCubicActionIn *ret = new (std::nothrow) EaseCubicActionIn();
if (ret)
{
if (ret->initWithAction(action))
@ -1442,7 +1442,7 @@ EaseCubicActionIn* EaseCubicActionIn::create(ActionInterval* action)
EaseCubicActionIn* EaseCubicActionIn::clone() const
{
// no copy constructor
auto a = new EaseCubicActionIn();
auto a = new (std::nothrow) EaseCubicActionIn();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -1464,7 +1464,7 @@ EaseCubicActionIn* EaseCubicActionIn::reverse() const
EaseCubicActionOut* EaseCubicActionOut::create(ActionInterval* action)
{
EaseCubicActionOut *ret = new EaseCubicActionOut();
EaseCubicActionOut *ret = new (std::nothrow) EaseCubicActionOut();
if (ret)
{
if (ret->initWithAction(action))
@ -1483,7 +1483,7 @@ EaseCubicActionOut* EaseCubicActionOut::create(ActionInterval* action)
EaseCubicActionOut* EaseCubicActionOut::clone() const
{
// no copy constructor
auto a = new EaseCubicActionOut();
auto a = new (std::nothrow) EaseCubicActionOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;
@ -1505,7 +1505,7 @@ EaseCubicActionOut* EaseCubicActionOut::reverse() const
EaseCubicActionInOut* EaseCubicActionInOut::create(ActionInterval* action)
{
EaseCubicActionInOut *ret = new EaseCubicActionInOut();
EaseCubicActionInOut *ret = new (std::nothrow) EaseCubicActionInOut();
if (ret)
{
if (ret->initWithAction(action))
@ -1524,7 +1524,7 @@ EaseCubicActionInOut* EaseCubicActionInOut::create(ActionInterval* action)
EaseCubicActionInOut* EaseCubicActionInOut::clone() const
{
// no copy constructor
auto a = new EaseCubicActionInOut();
auto a = new (std::nothrow) EaseCubicActionInOut();
a->initWithAction(_inner->clone());
a->autorelease();
return a;

View File

@ -152,7 +152,7 @@ void TiledGrid3DAction::setTile(const Vec2& pos, const Quad3& coords)
AccelDeccelAmplitude* AccelDeccelAmplitude::create(Action *action, float duration)
{
AccelDeccelAmplitude *ret = new AccelDeccelAmplitude();
AccelDeccelAmplitude *ret = new (std::nothrow) AccelDeccelAmplitude();
if (ret)
{
if (ret->initWithAction(action, duration))
@ -185,7 +185,7 @@ bool AccelDeccelAmplitude::initWithAction(Action *action, float duration)
AccelDeccelAmplitude* AccelDeccelAmplitude::clone() const
{
// no copy constructor
auto a = new AccelDeccelAmplitude();
auto a = new (std::nothrow) AccelDeccelAmplitude();
a->initWithAction(_other->clone(), _rate);
a->autorelease();
return a;
@ -224,7 +224,7 @@ AccelDeccelAmplitude* AccelDeccelAmplitude::reverse() const
AccelAmplitude* AccelAmplitude::create(Action *action, float duration)
{
AccelAmplitude *ret = new AccelAmplitude();
AccelAmplitude *ret = new (std::nothrow) AccelAmplitude();
if (ret)
{
if (ret->initWithAction(action, duration))
@ -257,7 +257,7 @@ bool AccelAmplitude::initWithAction(Action *action, float duration)
AccelAmplitude* AccelAmplitude::clone() const
{
// no copy constructor
auto a = new AccelAmplitude();
auto a = new (std::nothrow) AccelAmplitude();
a->initWithAction(_other->clone(), _duration);
a->autorelease();
return a;
@ -289,7 +289,7 @@ AccelAmplitude* AccelAmplitude::reverse() const
DeccelAmplitude* DeccelAmplitude::create(Action *action, float duration)
{
DeccelAmplitude *ret = new DeccelAmplitude();
DeccelAmplitude *ret = new (std::nothrow) DeccelAmplitude();
if (ret)
{
if (ret->initWithAction(action, duration))
@ -339,7 +339,7 @@ void DeccelAmplitude::update(float time)
DeccelAmplitude* DeccelAmplitude::clone() const
{
// no copy constructor
auto a = new DeccelAmplitude();
auto a = new (std::nothrow) DeccelAmplitude();
a->initWithAction(_other->clone(), _duration);
a->autorelease();
return a;
@ -371,7 +371,7 @@ void StopGrid::cacheTargetAsGridNode()
StopGrid* StopGrid::create()
{
StopGrid* pAction = new StopGrid();
StopGrid* pAction = new (std::nothrow) StopGrid();
pAction->autorelease();
return pAction;
@ -392,7 +392,7 @@ StopGrid* StopGrid::reverse() const
ReuseGrid* ReuseGrid::create(int times)
{
ReuseGrid *action = new ReuseGrid();
ReuseGrid *action = new (std::nothrow) ReuseGrid();
if (action)
{
if (action->initWithTimes(times))

View File

@ -31,7 +31,7 @@ NS_CC_BEGIN
Waves3D* Waves3D::create(float duration, const Size& gridSize, unsigned int waves, float amplitude)
{
Waves3D *pAction = new Waves3D();
Waves3D *pAction = new (std::nothrow) Waves3D();
if (pAction)
{
@ -65,7 +65,7 @@ bool Waves3D::initWithDuration(float duration, const Size& gridSize, unsigned in
Waves3D* Waves3D::clone() const
{
// no copy constructor
auto a = new Waves3D();
auto a = new (std::nothrow) Waves3D();
a->initWithDuration(_duration, _gridSize, _waves, _amplitude);
a->autorelease();
return a;
@ -90,7 +90,7 @@ void Waves3D::update(float time)
FlipX3D* FlipX3D::create(float duration)
{
FlipX3D *action = new FlipX3D();
FlipX3D *action = new (std::nothrow) FlipX3D();
if (action)
{
@ -128,7 +128,7 @@ bool FlipX3D::initWithSize(const Size& gridSize, float duration)
FlipX3D* FlipX3D::clone() const
{
// no copy constructor
auto a = new FlipX3D();
auto a = new (std::nothrow) FlipX3D();
a->initWithSize(_gridSize, _duration);
a->autorelease();
return a;
@ -203,7 +203,7 @@ void FlipX3D::update(float time)
FlipY3D* FlipY3D::clone() const
{
// no copy constructor
auto a = new FlipY3D();
auto a = new (std::nothrow) FlipY3D();
a->initWithSize(_gridSize, _duration);
a->autorelease();
return a;
@ -211,7 +211,7 @@ FlipY3D* FlipY3D::clone() const
FlipY3D* FlipY3D::create(float duration)
{
FlipY3D *action = new FlipY3D();
FlipY3D *action = new (std::nothrow) FlipY3D();
if (action)
{
@ -297,7 +297,7 @@ void FlipY3D::update(float time)
Lens3D* Lens3D::create(float duration, const Size& gridSize, const Vec2& position, float radius)
{
Lens3D *action = new Lens3D();
Lens3D *action = new (std::nothrow) Lens3D();
if (action)
{
@ -334,7 +334,7 @@ bool Lens3D::initWithDuration(float duration, const Size& gridSize, const Vec2&
Lens3D* Lens3D::clone() const
{
// no copy constructor
auto a = new Lens3D();
auto a = new (std::nothrow) Lens3D();
a->initWithDuration(_duration, _gridSize, _position, _radius);
a->autorelease();
return a;
@ -396,7 +396,7 @@ void Lens3D::update(float time)
Ripple3D* Ripple3D::create(float duration, const Size& gridSize, const Vec2& position, float radius, unsigned int waves, float amplitude)
{
Ripple3D *action = new Ripple3D();
Ripple3D *action = new (std::nothrow) Ripple3D();
if (action)
{
@ -438,7 +438,7 @@ void Ripple3D::setPosition(const Vec2& position)
Ripple3D* Ripple3D::clone() const
{
// no copy constructor
auto a = new Ripple3D();
auto a = new (std::nothrow) Ripple3D();
a->initWithDuration(_duration, _gridSize, _position, _radius, _waves, _amplitude);
a->autorelease();
return a;
@ -472,7 +472,7 @@ void Ripple3D::update(float time)
Shaky3D* Shaky3D::create(float duration, const Size& gridSize, int range, bool shakeZ)
{
Shaky3D *action = new Shaky3D();
Shaky3D *action = new (std::nothrow) Shaky3D();
if (action)
{
@ -505,7 +505,7 @@ bool Shaky3D::initWithDuration(float duration, const Size& gridSize, int range,
Shaky3D* Shaky3D::clone() const
{
// no copy constructor
auto a = new Shaky3D();
auto a = new (std::nothrow) Shaky3D();
a->initWithDuration(_duration, _gridSize, _randrange, _shakeZ);
a->autorelease();
return a;
@ -537,7 +537,7 @@ void Shaky3D::update(float time)
Liquid* Liquid::create(float duration, const Size& gridSize, unsigned int waves, float amplitude)
{
Liquid *action = new Liquid();
Liquid *action = new (std::nothrow) Liquid();
if (action)
{
@ -571,7 +571,7 @@ bool Liquid::initWithDuration(float duration, const Size& gridSize, unsigned int
Liquid* Liquid::clone() const
{
// no copy constructor
auto a = new Liquid();
auto a = new (std::nothrow) Liquid();
a->initWithDuration(_duration, _gridSize, _waves, _amplitude);
a->autorelease();
return a;
@ -597,7 +597,7 @@ void Liquid::update(float time)
Waves* Waves::create(float duration, const Size& gridSize, unsigned int waves, float amplitude, bool horizontal, bool vertical)
{
Waves *action = new Waves();
Waves *action = new (std::nothrow) Waves();
if (action)
{
@ -633,7 +633,7 @@ bool Waves::initWithDuration(float duration, const Size& gridSize, unsigned int
Waves* Waves::clone() const
{
// no copy constructor
auto a = new Waves();
auto a = new (std::nothrow) Waves();
a->initWithDuration(_duration, _gridSize, _waves, _amplitude, _horizontal, _vertical);
a->autorelease();
return a;
@ -668,7 +668,7 @@ void Waves::update(float time)
Twirl* Twirl::create(float duration, const Size& gridSize, Vec2 position, unsigned int twirls, float amplitude)
{
Twirl *action = new Twirl();
Twirl *action = new (std::nothrow) Twirl();
if (action)
{
@ -708,7 +708,7 @@ void Twirl::setPosition(const Vec2& position)
Twirl *Twirl::clone() const
{
// no copy constructor
auto a = new Twirl();
auto a = new (std::nothrow) Twirl();
a->initWithDuration(_duration, _gridSize, _position, _twirls, _amplitude);
a->autorelease();
return a;

View File

@ -61,7 +61,7 @@ void ActionInstant::update(float time) {
Show* Show::create()
{
Show* ret = new Show();
Show* ret = new (std::nothrow) Show();
if (ret) {
ret->autorelease();
@ -83,7 +83,7 @@ ActionInstant* Show::reverse() const
Show * Show::clone() const
{
// no copy constructor
auto a = new Show();
auto a = new (std::nothrow) Show();
a->autorelease();
return a;
}
@ -93,7 +93,7 @@ Show * Show::clone() const
//
Hide * Hide::create()
{
Hide *ret = new Hide();
Hide *ret = new (std::nothrow) Hide();
if (ret) {
ret->autorelease();
@ -115,7 +115,7 @@ ActionInstant *Hide::reverse() const
Hide * Hide::clone() const
{
// no copy constructor
auto a = new Hide();
auto a = new (std::nothrow) Hide();
a->autorelease();
return a;
}
@ -125,7 +125,7 @@ Hide * Hide::clone() const
//
ToggleVisibility * ToggleVisibility::create()
{
ToggleVisibility *ret = new ToggleVisibility();
ToggleVisibility *ret = new (std::nothrow) ToggleVisibility();
if (ret)
{
@ -149,7 +149,7 @@ ToggleVisibility * ToggleVisibility::reverse() const
ToggleVisibility * ToggleVisibility::clone() const
{
// no copy constructor
auto a = new ToggleVisibility();
auto a = new (std::nothrow) ToggleVisibility();
a->autorelease();
return a;
}
@ -159,7 +159,7 @@ ToggleVisibility * ToggleVisibility::clone() const
//
RemoveSelf * RemoveSelf::create(bool isNeedCleanUp /*= true*/)
{
RemoveSelf *ret = new RemoveSelf();
RemoveSelf *ret = new (std::nothrow) RemoveSelf();
if (ret && ret->init(isNeedCleanUp)) {
ret->autorelease();
@ -186,7 +186,7 @@ RemoveSelf *RemoveSelf::reverse() const
RemoveSelf * RemoveSelf::clone() const
{
// no copy constructor
auto a = new RemoveSelf();
auto a = new (std::nothrow) RemoveSelf();
a->init(_isNeedCleanUp);
a->autorelease();
return a;
@ -198,7 +198,7 @@ RemoveSelf * RemoveSelf::clone() const
FlipX *FlipX::create(bool x)
{
FlipX *ret = new FlipX();
FlipX *ret = new (std::nothrow) FlipX();
if (ret && ret->initWithFlipX(x)) {
ret->autorelease();
@ -227,7 +227,7 @@ FlipX* FlipX::reverse() const
FlipX * FlipX::clone() const
{
// no copy constructor
auto a = new FlipX();
auto a = new (std::nothrow) FlipX();
a->initWithFlipX(_flipX);
a->autorelease();
return a;
@ -238,7 +238,7 @@ FlipX * FlipX::clone() const
FlipY * FlipY::create(bool y)
{
FlipY *ret = new FlipY();
FlipY *ret = new (std::nothrow) FlipY();
if (ret && ret->initWithFlipY(y)) {
ret->autorelease();
@ -267,7 +267,7 @@ FlipY* FlipY::reverse() const
FlipY * FlipY::clone() const
{
// no copy constructor
auto a = new FlipY();
auto a = new (std::nothrow) FlipY();
a->initWithFlipY(_flipY);
a->autorelease();
return a;
@ -279,7 +279,7 @@ FlipY * FlipY::clone() const
Place* Place::create(const Vec2& pos)
{
Place *ret = new Place();
Place *ret = new (std::nothrow) Place();
if (ret && ret->initWithPosition(pos)) {
ret->autorelease();
@ -298,7 +298,7 @@ bool Place::initWithPosition(const Vec2& pos) {
Place * Place::clone() const
{
// no copy constructor
auto a = new Place();
auto a = new (std::nothrow) Place();
a->initWithPosition(_position);
a->autorelease();
return a;
@ -321,7 +321,7 @@ void Place::update(float time) {
CallFunc * CallFunc::create(const std::function<void()> &func)
{
CallFunc *ret = new CallFunc();
CallFunc *ret = new (std::nothrow) CallFunc();
if (ret && ret->initWithFunction(func) ) {
ret->autorelease();
@ -334,7 +334,7 @@ CallFunc * CallFunc::create(const std::function<void()> &func)
CallFunc * CallFunc::create(Ref* selectorTarget, SEL_CallFunc selector)
{
CallFunc *ret = new CallFunc();
CallFunc *ret = new (std::nothrow) CallFunc();
if (ret && ret->initWithTarget(selectorTarget)) {
ret->_callFunc = selector;
@ -375,7 +375,7 @@ CallFunc::~CallFunc()
CallFunc * CallFunc::clone() const
{
// no copy constructor
auto a = new CallFunc();
auto a = new (std::nothrow) CallFunc();
if( _selectorTarget) {
a->initWithTarget(_selectorTarget);
a->_callFunc = _callFunc;
@ -413,7 +413,7 @@ void CallFunc::execute() {
CallFuncN * CallFuncN::create(const std::function<void(Node*)> &func)
{
auto ret = new CallFuncN();
auto ret = new (std::nothrow) CallFuncN();
if (ret && ret->initWithFunction(func) ) {
ret->autorelease();
@ -427,7 +427,7 @@ CallFuncN * CallFuncN::create(const std::function<void(Node*)> &func)
// XXX deprecated
CallFuncN * CallFuncN::create(Ref* selectorTarget, SEL_CallFuncN selector)
{
CallFuncN *ret = new CallFuncN();
CallFuncN *ret = new (std::nothrow) CallFuncN();
if (ret && ret->initWithTarget(selectorTarget, selector))
{
@ -467,7 +467,7 @@ bool CallFuncN::initWithTarget(Ref* selectorTarget, SEL_CallFuncN selector)
CallFuncN * CallFuncN::clone() const
{
// no copy constructor
auto a = new CallFuncN();
auto a = new (std::nothrow) CallFuncN();
if( _selectorTarget) {
a->initWithTarget(_selectorTarget, _callFuncN);

View File

@ -52,7 +52,7 @@ public:
ExtraAction* ExtraAction::create()
{
ExtraAction* ret = new ExtraAction();
ExtraAction* ret = new (std::nothrow) ExtraAction();
if (ret)
{
ret->autorelease();
@ -62,7 +62,7 @@ ExtraAction* ExtraAction::create()
ExtraAction* ExtraAction::clone() const
{
// no copy constructor
auto a = new ExtraAction();
auto a = new (std::nothrow) ExtraAction();
a->autorelease();
return a;
}
@ -157,7 +157,7 @@ void ActionInterval::startWithTarget(Node *target)
Sequence* Sequence::createWithTwoActions(FiniteTimeAction *actionOne, FiniteTimeAction *actionTwo)
{
Sequence *sequence = new Sequence();
Sequence *sequence = new (std::nothrow) Sequence();
sequence->initWithTwoActions(actionOne, actionTwo);
sequence->autorelease();
@ -265,7 +265,7 @@ bool Sequence::initWithTwoActions(FiniteTimeAction *actionOne, FiniteTimeAction
Sequence* Sequence::clone() const
{
// no copy constructor
auto a = new Sequence();
auto a = new (std::nothrow) Sequence();
a->initWithTwoActions(_actions[0]->clone(), _actions[1]->clone() );
a->autorelease();
return a;
@ -368,7 +368,7 @@ Sequence* Sequence::reverse() const
Repeat* Repeat::create(FiniteTimeAction *action, unsigned int times)
{
Repeat* repeat = new Repeat();
Repeat* repeat = new (std::nothrow) Repeat();
repeat->initWithAction(action, times);
repeat->autorelease();
@ -402,7 +402,7 @@ bool Repeat::initWithAction(FiniteTimeAction *action, unsigned int times)
Repeat* Repeat::clone(void) const
{
// no copy constructor
auto a = new Repeat();
auto a = new (std::nothrow) Repeat();
a->initWithAction( _innerAction->clone(), _times );
a->autorelease();
return a;
@ -491,7 +491,7 @@ RepeatForever::~RepeatForever()
RepeatForever *RepeatForever::create(ActionInterval *action)
{
RepeatForever *ret = new RepeatForever();
RepeatForever *ret = new (std::nothrow) RepeatForever();
if (ret && ret->initWithAction(action))
{
ret->autorelease();
@ -512,7 +512,7 @@ bool RepeatForever::initWithAction(ActionInterval *action)
RepeatForever *RepeatForever::clone() const
{
// no copy constructor
auto a = new RepeatForever();
auto a = new (std::nothrow) RepeatForever();
a->initWithAction(_innerAction->clone());
a->autorelease();
return a;
@ -635,7 +635,7 @@ Spawn* Spawn::create(const Vector<FiniteTimeAction*>& arrayOfActions)
Spawn* Spawn::createWithTwoActions(FiniteTimeAction *action1, FiniteTimeAction *action2)
{
Spawn *spawn = new Spawn();
Spawn *spawn = new (std::nothrow) Spawn();
spawn->initWithTwoActions(action1, action2);
spawn->autorelease();
@ -678,7 +678,7 @@ bool Spawn::initWithTwoActions(FiniteTimeAction *action1, FiniteTimeAction *acti
Spawn* Spawn::clone(void) const
{
// no copy constructor
auto a = new Spawn();
auto a = new (std::nothrow) Spawn();
a->initWithTwoActions(_one->clone(), _two->clone());
a->autorelease();
@ -728,7 +728,7 @@ Spawn* Spawn::reverse() const
RotateTo* RotateTo::create(float duration, float dstAngle)
{
RotateTo* rotateTo = new RotateTo();
RotateTo* rotateTo = new (std::nothrow) RotateTo();
rotateTo->initWithDuration(duration, dstAngle, dstAngle);
rotateTo->autorelease();
@ -737,7 +737,7 @@ RotateTo* RotateTo::create(float duration, float dstAngle)
RotateTo* RotateTo::create(float duration, float dstAngleX, float dstAngleY)
{
RotateTo* rotateTo = new RotateTo();
RotateTo* rotateTo = new (std::nothrow) RotateTo();
rotateTo->initWithDuration(duration, dstAngleX, dstAngleY);
rotateTo->autorelease();
@ -746,7 +746,7 @@ RotateTo* RotateTo::create(float duration, float dstAngleX, float dstAngleY)
RotateTo* RotateTo::create(float duration, const Vec3& dstAngle3D)
{
RotateTo* rotateTo = new RotateTo();
RotateTo* rotateTo = new (std::nothrow) RotateTo();
rotateTo->initWithDuration(duration, dstAngle3D);
rotateTo->autorelease();
@ -787,7 +787,7 @@ bool RotateTo::initWithDuration(float duration, const Vec3& dstAngle3D)
RotateTo* RotateTo::clone(void) const
{
// no copy constructor
auto a = new RotateTo();
auto a = new (std::nothrow) RotateTo();
if(_is3D)
a->initWithDuration(_duration, _dstAngle);
else
@ -887,7 +887,7 @@ RotateTo *RotateTo::reverse() const
RotateBy* RotateBy::create(float duration, float deltaAngle)
{
RotateBy *rotateBy = new RotateBy();
RotateBy *rotateBy = new (std::nothrow) RotateBy();
rotateBy->initWithDuration(duration, deltaAngle);
rotateBy->autorelease();
@ -896,7 +896,7 @@ RotateBy* RotateBy::create(float duration, float deltaAngle)
RotateBy* RotateBy::create(float duration, float deltaAngleX, float deltaAngleY)
{
RotateBy *rotateBy = new RotateBy();
RotateBy *rotateBy = new (std::nothrow) RotateBy();
rotateBy->initWithDuration(duration, deltaAngleX, deltaAngleY);
rotateBy->autorelease();
@ -905,7 +905,7 @@ RotateBy* RotateBy::create(float duration, float deltaAngleX, float deltaAngleY)
RotateBy* RotateBy::create(float duration, const Vec3& deltaAngle3D)
{
RotateBy *rotateBy = new RotateBy();
RotateBy *rotateBy = new (std::nothrow) RotateBy();
rotateBy->initWithDuration(duration, deltaAngle3D);
rotateBy->autorelease();
@ -956,7 +956,7 @@ bool RotateBy::initWithDuration(float duration, const Vec3& deltaAngle3D)
RotateBy* RotateBy::clone() const
{
// no copy constructor
auto a = new RotateBy();
auto a = new (std::nothrow) RotateBy();
if(_is3D)
a->initWithDuration(_duration, _deltaAngle);
else
@ -1040,7 +1040,7 @@ RotateBy* RotateBy::reverse() const
MoveBy* MoveBy::create(float duration, const Vec2& deltaPosition)
{
MoveBy *ret = new MoveBy();
MoveBy *ret = new (std::nothrow) MoveBy();
ret->initWithDuration(duration, deltaPosition);
ret->autorelease();
@ -1061,7 +1061,7 @@ bool MoveBy::initWithDuration(float duration, const Vec2& deltaPosition)
MoveBy* MoveBy::clone() const
{
// no copy constructor
auto a = new MoveBy();
auto a = new (std::nothrow) MoveBy();
a->initWithDuration(_duration, _positionDelta);
a->autorelease();
return a;
@ -1102,7 +1102,7 @@ void MoveBy::update(float t)
MoveTo* MoveTo::create(float duration, const Vec2& position)
{
MoveTo *ret = new MoveTo();
MoveTo *ret = new (std::nothrow) MoveTo();
ret->initWithDuration(duration, position);
ret->autorelease();
@ -1123,7 +1123,7 @@ bool MoveTo::initWithDuration(float duration, const Vec2& position)
MoveTo* MoveTo::clone() const
{
// no copy constructor
auto a = new MoveTo();
auto a = new (std::nothrow) MoveTo();
a->initWithDuration(_duration, _endPosition);
a->autorelease();
return a;
@ -1141,7 +1141,7 @@ void MoveTo::startWithTarget(Node *target)
//
SkewTo* SkewTo::create(float t, float sx, float sy)
{
SkewTo *skewTo = new SkewTo();
SkewTo *skewTo = new (std::nothrow) SkewTo();
if (skewTo)
{
if (skewTo->initWithDuration(t, sx, sy))
@ -1175,7 +1175,7 @@ bool SkewTo::initWithDuration(float t, float sx, float sy)
SkewTo* SkewTo::clone() const
{
// no copy constructor
auto a = new SkewTo();
auto a = new (std::nothrow) SkewTo();
a->initWithDuration(_duration, _endSkewX, _endSkewY);
a->autorelease();
return a;
@ -1259,7 +1259,7 @@ SkewTo::SkewTo()
//
SkewBy* SkewBy::create(float t, float sx, float sy)
{
SkewBy *skewBy = new SkewBy();
SkewBy *skewBy = new (std::nothrow) SkewBy();
if (skewBy)
{
if (skewBy->initWithDuration(t, sx, sy))
@ -1278,7 +1278,7 @@ SkewBy* SkewBy::create(float t, float sx, float sy)
SkewBy * SkewBy::clone() const
{
// no copy constructor
auto a = new SkewBy();
auto a = new (std::nothrow) SkewBy();
a->initWithDuration(_duration, _skewX, _skewY);
a->autorelease();
return a;
@ -1319,7 +1319,7 @@ SkewBy* SkewBy::reverse() const
JumpBy* JumpBy::create(float duration, const Vec2& position, float height, int jumps)
{
JumpBy *jumpBy = new JumpBy();
JumpBy *jumpBy = new (std::nothrow) JumpBy();
jumpBy->initWithDuration(duration, position, height, jumps);
jumpBy->autorelease();
@ -1345,7 +1345,7 @@ bool JumpBy::initWithDuration(float duration, const Vec2& position, float height
JumpBy* JumpBy::clone() const
{
// no copy constructor
auto a = new JumpBy();
auto a = new (std::nothrow) JumpBy();
a->initWithDuration(_duration, _delta, _height, _jumps);
a->autorelease();
return a;
@ -1395,7 +1395,7 @@ JumpBy* JumpBy::reverse() const
JumpTo* JumpTo::create(float duration, const Vec2& position, float height, int jumps)
{
JumpTo *jumpTo = new JumpTo();
JumpTo *jumpTo = new (std::nothrow) JumpTo();
jumpTo->initWithDuration(duration, position, height, jumps);
jumpTo->autorelease();
@ -1405,7 +1405,7 @@ JumpTo* JumpTo::create(float duration, const Vec2& position, float height, int j
JumpTo* JumpTo::clone() const
{
// no copy constructor
auto a = new JumpTo();
auto a = new (std::nothrow) JumpTo();
a->initWithDuration(_duration, _delta, _height, _jumps);
a->autorelease();
return a;
@ -1441,7 +1441,7 @@ static inline float bezierat( float a, float b, float c, float d, float t )
BezierBy* BezierBy::create(float t, const ccBezierConfig& c)
{
BezierBy *bezierBy = new BezierBy();
BezierBy *bezierBy = new (std::nothrow) BezierBy();
bezierBy->initWithDuration(t, c);
bezierBy->autorelease();
@ -1468,7 +1468,7 @@ void BezierBy::startWithTarget(Node *target)
BezierBy* BezierBy::clone() const
{
// no copy constructor
auto a = new BezierBy();
auto a = new (std::nothrow) BezierBy();
a->initWithDuration(_duration, _config);
a->autorelease();
return a;
@ -1524,7 +1524,7 @@ BezierBy* BezierBy::reverse() const
BezierTo* BezierTo::create(float t, const ccBezierConfig& c)
{
BezierTo *bezierTo = new BezierTo();
BezierTo *bezierTo = new (std::nothrow) BezierTo();
bezierTo->initWithDuration(t, c);
bezierTo->autorelease();
@ -1545,7 +1545,7 @@ bool BezierTo::initWithDuration(float t, const ccBezierConfig &c)
BezierTo* BezierTo::clone() const
{
// no copy constructor
auto a = new BezierTo();
auto a = new (std::nothrow) BezierTo();
a->initWithDuration(_duration, _toConfig);
a->autorelease();
return a;
@ -1571,7 +1571,7 @@ BezierTo* BezierTo::reverse() const
//
ScaleTo* ScaleTo::create(float duration, float s)
{
ScaleTo *scaleTo = new ScaleTo();
ScaleTo *scaleTo = new (std::nothrow) ScaleTo();
scaleTo->initWithDuration(duration, s);
scaleTo->autorelease();
@ -1580,7 +1580,7 @@ ScaleTo* ScaleTo::create(float duration, float s)
ScaleTo* ScaleTo::create(float duration, float sx, float sy)
{
ScaleTo *scaleTo = new ScaleTo();
ScaleTo *scaleTo = new (std::nothrow) ScaleTo();
scaleTo->initWithDuration(duration, sx, sy);
scaleTo->autorelease();
@ -1589,7 +1589,7 @@ ScaleTo* ScaleTo::create(float duration, float sx, float sy)
ScaleTo* ScaleTo::create(float duration, float sx, float sy, float sz)
{
ScaleTo *scaleTo = new ScaleTo();
ScaleTo *scaleTo = new (std::nothrow) ScaleTo();
scaleTo->initWithDuration(duration, sx, sy, sz);
scaleTo->autorelease();
@ -1641,7 +1641,7 @@ bool ScaleTo::initWithDuration(float duration, float sx, float sy, float sz)
ScaleTo* ScaleTo::clone() const
{
// no copy constructor
auto a = new ScaleTo();
auto a = new (std::nothrow) ScaleTo();
a->initWithDuration(_duration, _endScaleX, _endScaleY, _endScaleZ);
a->autorelease();
return a;
@ -1681,7 +1681,7 @@ void ScaleTo::update(float time)
ScaleBy* ScaleBy::create(float duration, float s)
{
ScaleBy *scaleBy = new ScaleBy();
ScaleBy *scaleBy = new (std::nothrow) ScaleBy();
scaleBy->initWithDuration(duration, s);
scaleBy->autorelease();
@ -1690,7 +1690,7 @@ ScaleBy* ScaleBy::create(float duration, float s)
ScaleBy* ScaleBy::create(float duration, float sx, float sy)
{
ScaleBy *scaleBy = new ScaleBy();
ScaleBy *scaleBy = new (std::nothrow) ScaleBy();
scaleBy->initWithDuration(duration, sx, sy, 1.f);
scaleBy->autorelease();
@ -1699,7 +1699,7 @@ ScaleBy* ScaleBy::create(float duration, float sx, float sy)
ScaleBy* ScaleBy::create(float duration, float sx, float sy, float sz)
{
ScaleBy *scaleBy = new ScaleBy();
ScaleBy *scaleBy = new (std::nothrow) ScaleBy();
scaleBy->initWithDuration(duration, sx, sy, sz);
scaleBy->autorelease();
@ -1709,7 +1709,7 @@ ScaleBy* ScaleBy::create(float duration, float sx, float sy, float sz)
ScaleBy* ScaleBy::clone() const
{
// no copy constructor
auto a = new ScaleBy();
auto a = new (std::nothrow) ScaleBy();
a->initWithDuration(_duration, _endScaleX, _endScaleY, _endScaleZ);
a->autorelease();
return a;
@ -1734,7 +1734,7 @@ ScaleBy* ScaleBy::reverse() const
Blink* Blink::create(float duration, int blinks)
{
Blink *blink = new Blink();
Blink *blink = new (std::nothrow) Blink();
blink->initWithDuration(duration, blinks);
blink->autorelease();
@ -1769,7 +1769,7 @@ void Blink::startWithTarget(Node *target)
Blink* Blink::clone(void) const
{
// no copy constructor
auto a = new Blink();
auto a = new (std::nothrow) Blink();
a->initWithDuration(_duration, _times);
a->autorelease();
return a;
@ -1796,7 +1796,7 @@ Blink* Blink::reverse() const
FadeIn* FadeIn::create(float d)
{
FadeIn* action = new FadeIn();
FadeIn* action = new (std::nothrow) FadeIn();
action->initWithDuration(d,255.0f);
action->autorelease();
@ -1807,7 +1807,7 @@ FadeIn* FadeIn::create(float d)
FadeIn* FadeIn::clone() const
{
// no copy constructor
auto a = new FadeIn();
auto a = new (std::nothrow) FadeIn();
a->initWithDuration(_duration,255.0f);
a->autorelease();
return a;
@ -1850,7 +1850,7 @@ void FadeIn::startWithTarget(cocos2d::Node *target)
FadeOut* FadeOut::create(float d)
{
FadeOut* action = new FadeOut();
FadeOut* action = new (std::nothrow) FadeOut();
action->initWithDuration(d,0.0f);
action->autorelease();
@ -1861,7 +1861,7 @@ FadeOut* FadeOut::create(float d)
FadeOut* FadeOut::clone() const
{
// no copy constructor
auto a = new FadeOut();
auto a = new (std::nothrow) FadeOut();
a->initWithDuration(_duration,0.0f);
a->autorelease();
return a;
@ -1901,7 +1901,7 @@ FadeTo* FadeOut::reverse() const
FadeTo* FadeTo::create(float duration, GLubyte opacity)
{
FadeTo *fadeTo = new FadeTo();
FadeTo *fadeTo = new (std::nothrow) FadeTo();
fadeTo->initWithDuration(duration, opacity);
fadeTo->autorelease();
@ -1922,7 +1922,7 @@ bool FadeTo::initWithDuration(float duration, GLubyte opacity)
FadeTo* FadeTo::clone() const
{
// no copy constructor
auto a = new FadeTo();
auto a = new (std::nothrow) FadeTo();
a->initWithDuration(_duration, _toOpacity);
a->autorelease();
return a;
@ -1959,7 +1959,7 @@ void FadeTo::update(float time)
//
TintTo* TintTo::create(float duration, GLubyte red, GLubyte green, GLubyte blue)
{
TintTo *tintTo = new TintTo();
TintTo *tintTo = new (std::nothrow) TintTo();
tintTo->initWithDuration(duration, red, green, blue);
tintTo->autorelease();
@ -1980,7 +1980,7 @@ bool TintTo::initWithDuration(float duration, GLubyte red, GLubyte green, GLubyt
TintTo* TintTo::clone() const
{
// no copy constructor
auto a = new TintTo();
auto a = new (std::nothrow) TintTo();
a->initWithDuration(_duration, _to.r, _to.g, _to.b);
a->autorelease();
return a;
@ -2018,7 +2018,7 @@ void TintTo::update(float time)
TintBy* TintBy::create(float duration, GLshort deltaRed, GLshort deltaGreen, GLshort deltaBlue)
{
TintBy *tintBy = new TintBy();
TintBy *tintBy = new (std::nothrow) TintBy();
tintBy->initWithDuration(duration, deltaRed, deltaGreen, deltaBlue);
tintBy->autorelease();
@ -2042,7 +2042,7 @@ bool TintBy::initWithDuration(float duration, GLshort deltaRed, GLshort deltaGre
TintBy* TintBy::clone() const
{
// no copy constructor
auto a = new TintBy();
auto a = new (std::nothrow) TintBy();
a->initWithDuration(_duration, (GLubyte)_deltaR, (GLubyte)_deltaG, (GLubyte)_deltaB);
a->autorelease();
return a;
@ -2081,7 +2081,7 @@ TintBy* TintBy::reverse() const
//
DelayTime* DelayTime::create(float d)
{
DelayTime* action = new DelayTime();
DelayTime* action = new (std::nothrow) DelayTime();
action->initWithDuration(d);
action->autorelease();
@ -2092,7 +2092,7 @@ DelayTime* DelayTime::create(float d)
DelayTime* DelayTime::clone() const
{
// no copy constructor
auto a = new DelayTime();
auto a = new (std::nothrow) DelayTime();
a->initWithDuration(_duration);
a->autorelease();
return a;
@ -2116,7 +2116,7 @@ DelayTime* DelayTime::reverse() const
ReverseTime* ReverseTime::create(FiniteTimeAction *action)
{
// casting to prevent warnings
ReverseTime *reverseTime = new ReverseTime();
ReverseTime *reverseTime = new (std::nothrow) ReverseTime();
reverseTime->initWithAction( action->clone() );
reverseTime->autorelease();
@ -2145,7 +2145,7 @@ bool ReverseTime::initWithAction(FiniteTimeAction *action)
ReverseTime* ReverseTime::clone() const
{
// no copy constructor
auto a = new ReverseTime();
auto a = new (std::nothrow) ReverseTime();
a->initWithAction( _other->clone() );
a->autorelease();
return a;
@ -2192,7 +2192,7 @@ ReverseTime* ReverseTime::reverse() const
//
Animate* Animate::create(Animation *animation)
{
Animate *animate = new Animate();
Animate *animate = new (std::nothrow) Animate();
animate->initWithAnimation(animation);
animate->autorelease();
@ -2262,7 +2262,7 @@ void Animate::setAnimation(cocos2d::Animation *animation)
Animate* Animate::clone() const
{
// no copy constructor
auto a = new Animate();
auto a = new (std::nothrow) Animate();
a->initWithAnimation(_animation->clone());
a->autorelease();
return a;
@ -2327,7 +2327,7 @@ void Animate::update(float t)
if ( !dict.empty() )
{
if (_frameDisplayedEvent == nullptr)
_frameDisplayedEvent = new EventCustom(AnimationFrameDisplayedNotification);
_frameDisplayedEvent = new (std::nothrow) EventCustom(AnimationFrameDisplayedNotification);
_frameDisplayedEventInfo.target = _target;
_frameDisplayedEventInfo.userInfo = &dict;
@ -2384,7 +2384,7 @@ TargetedAction::~TargetedAction()
TargetedAction* TargetedAction::create(Node* target, FiniteTimeAction* action)
{
TargetedAction* p = new TargetedAction();
TargetedAction* p = new (std::nothrow) TargetedAction();
p->initWithTarget(target, action);
p->autorelease();
return p;
@ -2407,7 +2407,7 @@ bool TargetedAction::initWithTarget(Node* target, FiniteTimeAction* action)
TargetedAction* TargetedAction::clone() const
{
// no copy constructor
auto a = new TargetedAction();
auto a = new (std::nothrow) TargetedAction();
// win32 : use the _other's copy object.
a->initWithTarget(_forcedTarget, _action->clone());
a->autorelease();
@ -2417,7 +2417,7 @@ TargetedAction* TargetedAction::clone() const
TargetedAction* TargetedAction::reverse() const
{
// just reverse the internal action
auto a = new TargetedAction();
auto a = new (std::nothrow) TargetedAction();
a->initWithTarget(_forcedTarget, _action->reverse());
a->autorelease();
return a;

View File

@ -29,7 +29,7 @@ NS_CC_BEGIN
PageTurn3D* PageTurn3D::create(float duration, const Size& gridSize)
{
PageTurn3D *action = new PageTurn3D();
PageTurn3D *action = new (std::nothrow) PageTurn3D();
if (action)
{
@ -49,7 +49,7 @@ PageTurn3D* PageTurn3D::create(float duration, const Size& gridSize)
PageTurn3D *PageTurn3D::clone() const
{
// no copy constructor
auto a = new PageTurn3D();
auto a = new (std::nothrow) PageTurn3D();
a->initWithDuration(_duration, _gridSize);
a->autorelease();
return a;

View File

@ -34,7 +34,7 @@ NS_CC_BEGIN
ProgressTo* ProgressTo::create(float duration, float percent)
{
ProgressTo *progressTo = new ProgressTo();
ProgressTo *progressTo = new (std::nothrow) ProgressTo();
progressTo->initWithDuration(duration, percent);
progressTo->autorelease();
@ -56,7 +56,7 @@ bool ProgressTo::initWithDuration(float duration, float percent)
ProgressTo* ProgressTo::clone() const
{
// no copy constructor
auto a = new ProgressTo();
auto a = new (std::nothrow) ProgressTo();
a->initWithDuration(_duration, _to);
a->autorelease();
return a;
@ -83,7 +83,7 @@ void ProgressTo::update(float time)
ProgressFromTo* ProgressFromTo::create(float duration, float fromPercentage, float toPercentage)
{
ProgressFromTo *progressFromTo = new ProgressFromTo();
ProgressFromTo *progressFromTo = new (std::nothrow) ProgressFromTo();
progressFromTo->initWithDuration(duration, fromPercentage, toPercentage);
progressFromTo->autorelease();
@ -106,7 +106,7 @@ bool ProgressFromTo::initWithDuration(float duration, float fromPercentage, floa
ProgressFromTo* ProgressFromTo::clone() const
{
// no copy constructor
auto a = new ProgressFromTo();
auto a = new (std::nothrow) ProgressFromTo();
a->initWithDuration(_duration, _from, _to);
a->autorelease();
return a;

View File

@ -42,7 +42,7 @@ struct Tile
ShakyTiles3D* ShakyTiles3D::create(float duration, const Size& gridSize, int range, bool shakeZ)
{
ShakyTiles3D *action = new ShakyTiles3D();
ShakyTiles3D *action = new (std::nothrow) ShakyTiles3D();
if (action)
{
@ -75,7 +75,7 @@ bool ShakyTiles3D::initWithDuration(float duration, const Size& gridSize, int ra
ShakyTiles3D* ShakyTiles3D::clone() const
{
// no copy constructor
auto a = new ShakyTiles3D();
auto a = new (std::nothrow) ShakyTiles3D();
a->initWithDuration(_duration, _gridSize, _randrange, _shakeZ);
a->autorelease();
return a;
@ -121,7 +121,7 @@ void ShakyTiles3D::update(float time)
ShatteredTiles3D* ShatteredTiles3D::create(float duration, const Size& gridSize, int range, bool shatterZ)
{
ShatteredTiles3D *action = new ShatteredTiles3D();
ShatteredTiles3D *action = new (std::nothrow) ShatteredTiles3D();
if (action)
{
@ -155,7 +155,7 @@ bool ShatteredTiles3D::initWithDuration(float duration, const Size& gridSize, in
ShatteredTiles3D* ShatteredTiles3D::clone() const
{
// no copy constructor
auto a = new ShatteredTiles3D();
auto a = new (std::nothrow) ShatteredTiles3D();
a->initWithDuration(_duration, _gridSize, _randrange, _shatterZ);
a->autorelease();
return a;
@ -206,7 +206,7 @@ void ShatteredTiles3D::update(float time)
ShuffleTiles* ShuffleTiles::create(float duration, const Size& gridSize, unsigned int seed)
{
ShuffleTiles *action = new ShuffleTiles();
ShuffleTiles *action = new (std::nothrow) ShuffleTiles();
if (action)
{
@ -240,7 +240,7 @@ bool ShuffleTiles::initWithDuration(float duration, const Size& gridSize, unsign
ShuffleTiles* ShuffleTiles::clone() const
{
// no copy constructor
auto a = new ShuffleTiles();
auto a = new (std::nothrow) ShuffleTiles();
a->initWithDuration(_duration, _gridSize, _seed);
a->autorelease();
return a;
@ -352,7 +352,7 @@ void ShuffleTiles::update(float time)
FadeOutTRTiles* FadeOutTRTiles::create(float duration, const Size& gridSize)
{
FadeOutTRTiles *action = new FadeOutTRTiles();
FadeOutTRTiles *action = new (std::nothrow) FadeOutTRTiles();
if (action)
{
@ -372,7 +372,7 @@ FadeOutTRTiles* FadeOutTRTiles::create(float duration, const Size& gridSize)
FadeOutTRTiles* FadeOutTRTiles::clone() const
{
// no copy constructor
auto a = new FadeOutTRTiles();
auto a = new (std::nothrow) FadeOutTRTiles();
a->initWithDuration(_duration, _gridSize);
a->autorelease();
return a;
@ -448,7 +448,7 @@ void FadeOutTRTiles::update(float time)
FadeOutBLTiles* FadeOutBLTiles::create(float duration, const Size& gridSize)
{
FadeOutBLTiles *action = new FadeOutBLTiles();
FadeOutBLTiles *action = new (std::nothrow) FadeOutBLTiles();
if (action)
{
@ -468,7 +468,7 @@ FadeOutBLTiles* FadeOutBLTiles::create(float duration, const Size& gridSize)
FadeOutBLTiles* FadeOutBLTiles::clone() const
{
// no copy constructor
auto a = new FadeOutBLTiles();
auto a = new (std::nothrow) FadeOutBLTiles();
a->initWithDuration(_duration, _gridSize);
a->autorelease();
return a;
@ -489,7 +489,7 @@ float FadeOutBLTiles::testFunc(const Size& pos, float time)
FadeOutUpTiles* FadeOutUpTiles::create(float duration, const Size& gridSize)
{
FadeOutUpTiles *action = new FadeOutUpTiles();
FadeOutUpTiles *action = new (std::nothrow) FadeOutUpTiles();
if (action)
{
@ -509,7 +509,7 @@ FadeOutUpTiles* FadeOutUpTiles::create(float duration, const Size& gridSize)
FadeOutUpTiles* FadeOutUpTiles::clone() const
{
// no copy constructor
auto a = new FadeOutUpTiles();
auto a = new (std::nothrow) FadeOutUpTiles();
a->initWithDuration(_duration, _gridSize);
a->autorelease();
return a;
@ -543,7 +543,7 @@ void FadeOutUpTiles::transformTile(const Vec2& pos, float distance)
FadeOutDownTiles* FadeOutDownTiles::create(float duration, const Size& gridSize)
{
FadeOutDownTiles *action = new FadeOutDownTiles();
FadeOutDownTiles *action = new (std::nothrow) FadeOutDownTiles();
if (action)
{
@ -563,7 +563,7 @@ FadeOutDownTiles* FadeOutDownTiles::create(float duration, const Size& gridSize)
FadeOutDownTiles* FadeOutDownTiles::clone() const
{
// no copy constructor
auto a = new FadeOutDownTiles();
auto a = new (std::nothrow) FadeOutDownTiles();
a->initWithDuration(_duration, _gridSize);
a->autorelease();
return a;
@ -584,7 +584,7 @@ float FadeOutDownTiles::testFunc(const Size& pos, float time)
TurnOffTiles* TurnOffTiles::create(float duration, const Size& gridSize)
{
TurnOffTiles* pAction = new TurnOffTiles();
TurnOffTiles* pAction = new (std::nothrow) TurnOffTiles();
if (pAction->initWithDuration(duration, gridSize, 0))
{
pAction->autorelease();
@ -598,7 +598,7 @@ TurnOffTiles* TurnOffTiles::create(float duration, const Size& gridSize)
TurnOffTiles* TurnOffTiles::create(float duration, const Size& gridSize, unsigned int seed)
{
TurnOffTiles *action = new TurnOffTiles();
TurnOffTiles *action = new (std::nothrow) TurnOffTiles();
if (action)
{
@ -631,7 +631,7 @@ bool TurnOffTiles::initWithDuration(float duration, const Size& gridSize, unsign
TurnOffTiles* TurnOffTiles::clone() const
{
// no copy constructor
auto a = new TurnOffTiles();
auto a = new (std::nothrow) TurnOffTiles();
a->initWithDuration(_duration, _gridSize, _seed );
a->autorelease();
return a;
@ -711,7 +711,7 @@ void TurnOffTiles::update(float time)
WavesTiles3D* WavesTiles3D::create(float duration, const Size& gridSize, unsigned int waves, float amplitude)
{
WavesTiles3D *action = new WavesTiles3D();
WavesTiles3D *action = new (std::nothrow) WavesTiles3D();
if (action)
{
@ -745,7 +745,7 @@ bool WavesTiles3D::initWithDuration(float duration, const Size& gridSize, unsign
WavesTiles3D* WavesTiles3D::clone() const
{
// no copy constructor
auto a = new WavesTiles3D();
auto a = new (std::nothrow) WavesTiles3D();
a->initWithDuration(_duration, _gridSize, _waves, _amplitude);
a->autorelease();
return a;
@ -774,7 +774,7 @@ void WavesTiles3D::update(float time)
JumpTiles3D* JumpTiles3D::create(float duration, const Size& gridSize, unsigned int numberOfJumps, float amplitude)
{
JumpTiles3D *action = new JumpTiles3D();
JumpTiles3D *action = new (std::nothrow) JumpTiles3D();
if (action)
{
@ -808,7 +808,7 @@ bool JumpTiles3D::initWithDuration(float duration, const Size& gridSize, unsigne
JumpTiles3D* JumpTiles3D::clone() const
{
// no copy constructor
auto a = new JumpTiles3D();
auto a = new (std::nothrow) JumpTiles3D();
a->initWithDuration(_duration, _gridSize, _jumps, _amplitude);
a->autorelease();
return a;
@ -849,7 +849,7 @@ void JumpTiles3D::update(float time)
SplitRows* SplitRows::create(float duration, unsigned int nRows)
{
SplitRows *action = new SplitRows();
SplitRows *action = new (std::nothrow) SplitRows();
if (action)
{
@ -876,7 +876,7 @@ bool SplitRows::initWithDuration(float duration, unsigned int rows)
SplitRows* SplitRows::clone() const
{
// no copy constructor
auto a = new SplitRows();
auto a = new (std::nothrow) SplitRows();
a->initWithDuration(_duration, _rows);
a->autorelease();
return a;
@ -913,7 +913,7 @@ void SplitRows::update(float time)
SplitCols* SplitCols::create(float duration, unsigned int cols)
{
SplitCols *action = new SplitCols();
SplitCols *action = new (std::nothrow) SplitCols();
if (action)
{
@ -939,7 +939,7 @@ bool SplitCols::initWithDuration(float duration, unsigned int cols)
SplitCols* SplitCols::clone() const
{
// no copy constructor
auto a = new SplitCols();
auto a = new (std::nothrow) SplitCols();
a->initWithDuration(_duration, _cols);
a->autorelease();
return a;

View File

@ -30,7 +30,7 @@ NS_CC_BEGIN
ActionTween* ActionTween::create(float duration, const std::string& key, float from, float to)
{
ActionTween* ret = new ActionTween();
ActionTween* ret = new (std::nothrow) ActionTween();
if (ret && ret->initWithDuration(duration, key, from, to))
{
ret->autorelease();
@ -58,7 +58,7 @@ bool ActionTween::initWithDuration(float duration, const std::string& key, float
ActionTween *ActionTween::clone() const
{
// no copy constructor
auto a = new ActionTween();
auto a = new (std::nothrow) ActionTween();
a->initWithDuration(_duration, _key.c_str(), _from, _to);
a->autorelease();
return a;

View File

@ -35,7 +35,7 @@ NS_CC_BEGIN
AnimationFrame* AnimationFrame::create(SpriteFrame* spriteFrame, float delayUnits, const ValueMap& userInfo)
{
auto ret = new AnimationFrame();
auto ret = new (std::nothrow) AnimationFrame();
if (ret && ret->initWithSpriteFrame(spriteFrame, delayUnits, userInfo))
{
ret->autorelease();
@ -73,7 +73,7 @@ AnimationFrame::~AnimationFrame()
AnimationFrame* AnimationFrame::clone() const
{
// no copy constructor
auto frame = new AnimationFrame();
auto frame = new (std::nothrow) AnimationFrame();
frame->initWithSpriteFrame(_spriteFrame->clone(),
_delayUnits,
_userInfo);
@ -86,7 +86,7 @@ AnimationFrame* AnimationFrame::clone() const
Animation* Animation::create(void)
{
Animation *animation = new Animation();
Animation *animation = new (std::nothrow) Animation();
animation->init();
animation->autorelease();
@ -95,7 +95,7 @@ Animation* Animation::create(void)
Animation* Animation::createWithSpriteFrames(const Vector<SpriteFrame*>& frames, float delay/* = 0.0f*/, unsigned int loops/* = 1*/)
{
Animation *animation = new Animation();
Animation *animation = new (std::nothrow) Animation();
animation->initWithSpriteFrames(frames, delay, loops);
animation->autorelease();
@ -104,7 +104,7 @@ Animation* Animation::createWithSpriteFrames(const Vector<SpriteFrame*>& frames,
Animation* Animation::create(const Vector<AnimationFrame*>& arrayOfAnimationFrameNames, float delayPerUnit, unsigned int loops /* = 1 */)
{
Animation *animation = new Animation();
Animation *animation = new (std::nothrow) Animation();
animation->initWithAnimationFrames(arrayOfAnimationFrameNames, delayPerUnit, loops);
animation->autorelease();
return animation;
@ -194,7 +194,7 @@ float Animation::getDuration(void) const
Animation* Animation::clone() const
{
// no copy constructor
auto a = new Animation();
auto a = new (std::nothrow) Animation();
a->initWithAnimationFrames(_frames, _delayPerUnit, _loops);
a->setRestoreOriginalFrame(_restoreOriginalFrame);
a->autorelease();

View File

@ -42,7 +42,7 @@ AnimationCache* AnimationCache::getInstance()
{
if (! s_sharedAnimationCache)
{
s_sharedAnimationCache = new AnimationCache();
s_sharedAnimationCache = new (std::nothrow) AnimationCache();
s_sharedAnimationCache->init();
}

View File

@ -59,7 +59,7 @@ AtlasNode::~AtlasNode()
AtlasNode * AtlasNode::create(const std::string& tile, int tileWidth, int tileHeight, int itemsToRender)
{
AtlasNode * ret = new AtlasNode();
AtlasNode * ret = new (std::nothrow) AtlasNode();
if (ret->initWithTileFile(tile, tileWidth, tileHeight, itemsToRender))
{
ret->autorelease();
@ -86,7 +86,7 @@ bool AtlasNode::initWithTexture(Texture2D* texture, int tileWidth, int tileHeigh
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
_textureAtlas = new TextureAtlas();
_textureAtlas = new (std::nothrow) TextureAtlas();
_textureAtlas->initWithTexture(texture, itemsToRender);
if (! _textureAtlas)

View File

@ -84,7 +84,7 @@ ClippingNode::~ClippingNode()
ClippingNode* ClippingNode::create()
{
ClippingNode *ret = new ClippingNode();
ClippingNode *ret = new (std::nothrow) ClippingNode();
if (ret && ret->init())
{
ret->autorelease();
@ -99,7 +99,7 @@ ClippingNode* ClippingNode::create()
ClippingNode* ClippingNode::create(Node *pStencil)
{
ClippingNode *ret = new ClippingNode();
ClippingNode *ret = new (std::nothrow) ClippingNode();
if (ret && ret->init(pStencil))
{
ret->autorelease();

View File

@ -110,7 +110,7 @@ bool Component::serialize(void *ar)
Component* Component::create(void)
{
Component * ret = new Component();
Component * ret = new (std::nothrow) Component();
if (ret != nullptr && ret->init())
{
ret->autorelease();

View File

@ -60,7 +60,7 @@ bool ComponentContainer::add(Component *com)
{
if (_components == nullptr)
{
_components = new Map<std::string, Component*>();
_components = new (std::nothrow) Map<std::string, Component*>();
}
Component *component = _components->at(com->getName());
@ -135,7 +135,7 @@ void ComponentContainer::removeAll()
void ComponentContainer::alloc(void)
{
_components = new Map<std::string, Component*>();
_components = new (std::nothrow) Map<std::string, Component*>();
}
void ComponentContainer::visit(float delta)

View File

@ -129,7 +129,7 @@ DrawNode::~DrawNode()
DrawNode* DrawNode::create()
{
DrawNode* ret = new DrawNode();
DrawNode* ret = new (std::nothrow) DrawNode();
if (ret && ret->init())
{
ret->autorelease();

View File

@ -158,7 +158,7 @@ void drawPoints( const Vec2 *points, unsigned int numberOfPoints )
s_shader->setUniformLocationWith1f(s_pointSizeLocation, s_pointSize);
// XXX: Mac OpenGL error. arrays can't go out of scope before draw is executed
Vec2* newPoints = new Vec2[numberOfPoints];
Vec2* newPoints = new (std::nothrow) Vec2[numberOfPoints];
// iPhone and 32-bit machines optimization
if( sizeof(Vec2) == sizeof(Vec2) )
@ -269,7 +269,7 @@ void drawPoly(const Vec2 *poli, unsigned int numberOfPoints, bool closePolygon)
{
// Mac on 64-bit
// XXX: Mac OpenGL error. arrays can't go out of scope before draw is executed
Vec2* newPoli = new Vec2[numberOfPoints];
Vec2* newPoli = new (std::nothrow) Vec2[numberOfPoints];
for( unsigned int i=0; i<numberOfPoints;i++) {
newPoli[i].x = poli[i].x;
newPoli[i].y = poli[i].y;
@ -303,7 +303,7 @@ void drawSolidPoly(const Vec2 *poli, unsigned int numberOfPoints, Color4F color)
GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );
// XXX: Mac OpenGL error. arrays can't go out of scope before draw is executed
Vec2* newPoli = new Vec2[numberOfPoints];
Vec2* newPoli = new (std::nothrow) Vec2[numberOfPoints];
// iPhone and 32-bit machines optimization
if (sizeof(Vec2) == sizeof(Vec2))
@ -435,7 +435,7 @@ void drawQuadBezier(const Vec2& origin, const Vec2& control, const Vec2& destina
{
lazy_init();
Vec2* vertices = new Vec2[segments + 1];
Vec2* vertices = new (std::nothrow) Vec2[segments + 1];
float t = 0.0f;
for(unsigned int i = 0; i < segments; i++)
@ -474,7 +474,7 @@ void drawCardinalSpline( PointArray *config, float tension, unsigned int segmen
{
lazy_init();
Vec2* vertices = new Vec2[segments + 1];
Vec2* vertices = new (std::nothrow) Vec2[segments + 1];
ssize_t p;
float lt;
@ -526,7 +526,7 @@ void drawCubicBezier(const Vec2& origin, const Vec2& control1, const Vec2& contr
{
lazy_init();
Vec2* vertices = new Vec2[segments + 1];
Vec2* vertices = new (std::nothrow) Vec2[segments + 1];
float t = 0;
for (unsigned int i = 0; i < segments; i++)

View File

@ -59,7 +59,7 @@ const int TMXLayer::FAST_TMX_ORIENTATION_ISO = 2;
// FastTMXLayer - init & alloc & dealloc
TMXLayer * TMXLayer::create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo)
{
TMXLayer *ret = new TMXLayer();
TMXLayer *ret = new (std::nothrow) TMXLayer();
if (ret->initWithTilesetInfo(tilesetInfo, layerInfo, mapInfo))
{
ret->autorelease();

View File

@ -40,7 +40,7 @@ namespace experimental {
TMXTiledMap * TMXTiledMap::create(const std::string& tmxFile)
{
TMXTiledMap *ret = new TMXTiledMap();
TMXTiledMap *ret = new (std::nothrow) TMXTiledMap();
if (ret->initWithTMXFile(tmxFile))
{
ret->autorelease();
@ -52,7 +52,7 @@ TMXTiledMap * TMXTiledMap::create(const std::string& tmxFile)
TMXTiledMap* TMXTiledMap::createWithXML(const std::string& tmxString, const std::string& resourcePath)
{
TMXTiledMap *ret = new TMXTiledMap();
TMXTiledMap *ret = new (std::nothrow) TMXTiledMap();
if (ret->initWithXML(tmxString, resourcePath))
{
ret->autorelease();

View File

@ -53,7 +53,7 @@ FontAtlas::FontAtlas(Font &theFont)
{
_commonLineHeight = _font->getFontMaxHeight();
_fontAscender = fontTTf->getFontAscender();
auto texture = new Texture2D;
auto texture = new (std::nothrow) Texture2D;
_currentPage = 0;
_currentPageOrigX = 0;
_currentPageOrigY = 0;
@ -256,7 +256,7 @@ bool FontAtlas::prepareLetterDefinitions(const std::u16string& utf16String)
_currentPageOrigY = 0;
memset(_currentPageData, 0, _currentPageDataSize);
_currentPage++;
auto tex = new Texture2D;
auto tex = new (std::nothrow) Texture2D;
if (_antialiasEnabled)
{
tex->setAntiAliasTexParameters();

View File

@ -119,7 +119,7 @@ int * FontCharMap::getHorizontalKerningForTextUTF16(const std::u16string& text,
FontAtlas * FontCharMap::createFontAtlas()
{
FontAtlas *tempAtlas = new FontAtlas(*this);
FontAtlas *tempAtlas = new (std::nothrow) FontAtlas(*this);
if (!tempAtlas)
return nullptr;

View File

@ -167,7 +167,7 @@ BMFontConfiguration* FNTConfigLoadFile(const std::string& fntFile)
if( s_configurations == nullptr )
{
s_configurations = new Map<std::string, BMFontConfiguration*>();
s_configurations = new (std::nothrow) Map<std::string, BMFontConfiguration*>();
}
ret = s_configurations->at(fntFile);
@ -189,7 +189,7 @@ BMFontConfiguration* FNTConfigLoadFile(const std::string& fntFile)
BMFontConfiguration * BMFontConfiguration::create(const std::string& FNTfile)
{
BMFontConfiguration * ret = new BMFontConfiguration();
BMFontConfiguration * ret = new (std::nothrow) BMFontConfiguration();
if (ret->initWithFNTfile(FNTfile))
{
ret->autorelease();
@ -752,7 +752,7 @@ int FontFNT::getHorizontalKerningForChars(unsigned short firstChar, unsigned sh
FontAtlas * FontFNT::createFontAtlas()
{
FontAtlas *tempAtlas = new FontAtlas(*this);
FontAtlas *tempAtlas = new (std::nothrow) FontAtlas(*this);
if (!tempAtlas)
return nullptr;

View File

@ -172,7 +172,7 @@ FontFreeType::~FontFreeType()
FontAtlas * FontFreeType::createFontAtlas()
{
FontAtlas *atlas = new FontAtlas(*this);
FontAtlas *atlas = new (std::nothrow) FontAtlas(*this);
if (_usedGlyphs != GlyphCollection::DYNAMIC)
{
std::u16string utf16;

View File

@ -41,7 +41,7 @@ NS_CC_BEGIN
GridBase* GridBase::create(const Size& gridSize)
{
GridBase *pGridBase = new GridBase();
GridBase *pGridBase = new (std::nothrow) GridBase();
if (pGridBase)
{
@ -60,7 +60,7 @@ GridBase* GridBase::create(const Size& gridSize)
GridBase* GridBase::create(const Size& gridSize, Texture2D *texture, bool flipped)
{
GridBase *pGridBase = new GridBase();
GridBase *pGridBase = new (std::nothrow) GridBase();
if (pGridBase)
{
@ -93,7 +93,7 @@ bool GridBase::initWithSize(const Size& gridSize, Texture2D *texture, bool flipp
_step.x = texSize.width / _gridSize.width;
_step.y = texSize.height / _gridSize.height;
_grabber = new Grabber();
_grabber = new (std::nothrow) Grabber();
if (_grabber)
{
_grabber->grab(_texture);
@ -129,7 +129,7 @@ bool GridBase::initWithSize(const Size& gridSize)
return false;
}
Texture2D *texture = new Texture2D();
Texture2D *texture = new (std::nothrow) Texture2D();
texture->initWithData(data, dataLen, format, POTWide, POTHigh, s);
free(data);
@ -254,7 +254,7 @@ void GridBase::calculateVertexPoints(void)
Grid3D* Grid3D::create(const Size& gridSize, Texture2D *texture, bool flipped)
{
Grid3D *ret= new Grid3D();
Grid3D *ret= new (std::nothrow) Grid3D();
if (ret)
{
@ -274,7 +274,7 @@ Grid3D* Grid3D::create(const Size& gridSize, Texture2D *texture, bool flipped)
Grid3D* Grid3D::create(const Size& gridSize)
{
Grid3D *ret= new Grid3D();
Grid3D *ret= new (std::nothrow) Grid3D();
if (ret)
{
@ -471,7 +471,7 @@ TiledGrid3D::~TiledGrid3D(void)
TiledGrid3D* TiledGrid3D::create(const Size& gridSize, Texture2D *texture, bool flipped)
{
TiledGrid3D *ret= new TiledGrid3D();
TiledGrid3D *ret= new (std::nothrow) TiledGrid3D();
if (ret)
{
@ -491,7 +491,7 @@ TiledGrid3D* TiledGrid3D::create(const Size& gridSize, Texture2D *texture, bool
TiledGrid3D* TiledGrid3D::create(const Size& gridSize)
{
TiledGrid3D *ret= new TiledGrid3D();
TiledGrid3D *ret= new (std::nothrow) TiledGrid3D();
if (ret)
{

View File

@ -45,7 +45,7 @@ const int Label::DistanceFieldFontSize = 50;
Label* Label::create()
{
auto ret = new Label();
auto ret = new (std::nothrow) Label();
if (ret)
{
@ -69,7 +69,7 @@ Label* Label::create(const std::string& text, const std::string& font, float fon
Label* Label::createWithSystemFont(const std::string& text, const std::string& font, float fontSize, const Size& dimensions /* = Size::ZERO */, TextHAlignment hAlignment /* = TextHAlignment::LEFT */, TextVAlignment vAlignment /* = TextVAlignment::TOP */)
{
auto ret = new Label(nullptr,hAlignment,vAlignment);
auto ret = new (std::nothrow) Label(nullptr,hAlignment,vAlignment);
if (ret)
{
@ -89,7 +89,7 @@ Label* Label::createWithSystemFont(const std::string& text, const std::string& f
Label* Label::createWithTTF(const std::string& text, const std::string& fontFile, float fontSize, const Size& dimensions /* = Size::ZERO */, TextHAlignment hAlignment /* = TextHAlignment::LEFT */, TextVAlignment vAlignment /* = TextVAlignment::TOP */)
{
auto ret = new Label(nullptr,hAlignment,vAlignment);
auto ret = new (std::nothrow) Label(nullptr,hAlignment,vAlignment);
if (ret && FileUtils::getInstance()->isFileExist(fontFile))
{
@ -111,7 +111,7 @@ Label* Label::createWithTTF(const std::string& text, const std::string& fontFile
Label* Label::createWithTTF(const TTFConfig& ttfConfig, const std::string& text, TextHAlignment alignment /* = TextHAlignment::CENTER */, int maxLineWidth /* = 0 */)
{
auto ret = new Label(nullptr,alignment);
auto ret = new (std::nothrow) Label(nullptr,alignment);
if (ret && FileUtils::getInstance()->isFileExist(ttfConfig.fontFilePath) && ret->setTTFConfig(ttfConfig))
{
@ -128,7 +128,7 @@ Label* Label::createWithTTF(const TTFConfig& ttfConfig, const std::string& text,
Label* Label::createWithBMFont(const std::string& bmfontFilePath, const std::string& text,const TextHAlignment& alignment /* = TextHAlignment::LEFT */, int maxLineWidth /* = 0 */, const Vec2& imageOffset /* = Vec2::ZERO */)
{
auto ret = new Label(nullptr,alignment);
auto ret = new (std::nothrow) Label(nullptr,alignment);
if (ret && ret->setBMFontFilePath(bmfontFilePath,imageOffset))
{
@ -145,7 +145,7 @@ Label* Label::createWithBMFont(const std::string& bmfontFilePath, const std::str
Label* Label::createWithCharMap(const std::string& plistFile)
{
auto ret = new Label();
auto ret = new (std::nothrow) Label();
if (ret && ret->setCharMap(plistFile))
{
@ -159,7 +159,7 @@ Label* Label::createWithCharMap(const std::string& plistFile)
Label* Label::createWithCharMap(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap)
{
auto ret = new Label();
auto ret = new (std::nothrow) Label();
if (ret && ret->setCharMap(texture,itemWidth,itemHeight,startCharMap))
{
@ -173,7 +173,7 @@ Label* Label::createWithCharMap(Texture2D* texture, int itemWidth, int itemHeigh
Label* Label::createWithCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap)
{
auto ret = new Label();
auto ret = new (std::nothrow) Label();
if (ret && ret->setCharMap(charMapFile,itemWidth,itemHeight,startCharMap))
{
@ -892,7 +892,7 @@ void Label::createSpriteWithFontDefinition()
{
_currentLabelType = LabelType::STRING_TEXTURE;
auto texture = new Texture2D;
auto texture = new (std::nothrow) Texture2D;
texture->initWithString(_originalUTF8String.c_str(),_fontDefinition);
_textSprite = Sprite::createWithTexture(texture);

View File

@ -43,7 +43,7 @@ NS_CC_BEGIN
LabelAtlas* LabelAtlas::create()
{
LabelAtlas* ret = new LabelAtlas();
LabelAtlas* ret = new (std::nothrow) LabelAtlas();
if (ret)
{
ret->autorelease();
@ -58,7 +58,7 @@ LabelAtlas* LabelAtlas::create()
LabelAtlas* LabelAtlas::create(const std::string& string, const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap)
{
LabelAtlas* ret = new LabelAtlas();
LabelAtlas* ret = new (std::nothrow) LabelAtlas();
if(ret && ret->initWithString(string, charMapFile, itemWidth, itemHeight, startCharMap))
{
ret->autorelease();
@ -87,7 +87,7 @@ bool LabelAtlas::initWithString(const std::string& string, Texture2D* texture, i
LabelAtlas* LabelAtlas::create(const std::string& string, const std::string& fntFile)
{
LabelAtlas *ret = new LabelAtlas();
LabelAtlas *ret = new (std::nothrow) LabelAtlas();
if (ret)
{
if (ret->initWithString(string, fntFile))

View File

@ -53,7 +53,7 @@ NS_CC_BEGIN
LabelBMFont * LabelBMFont::create()
{
LabelBMFont * pRet = new LabelBMFont();
LabelBMFont * pRet = new (std::nothrow) LabelBMFont();
if (pRet)
{
pRet->autorelease();
@ -66,7 +66,7 @@ LabelBMFont * LabelBMFont::create()
//LabelBMFont - Creation & Init
LabelBMFont *LabelBMFont::create(const std::string& str, const std::string& fntFile, float width /* = 0 */, TextHAlignment alignment /* = TextHAlignment::LEFT */,const Vec2& imageOffset /* = Vec2::ZERO */)
{
LabelBMFont *ret = new LabelBMFont();
LabelBMFont *ret = new (std::nothrow) LabelBMFont();
if(ret && ret->initWithString(str, fntFile, width, alignment,imageOffset))
{
ret->autorelease();

View File

@ -54,7 +54,7 @@ LabelTTF::~LabelTTF()
LabelTTF * LabelTTF::create()
{
LabelTTF * ret = new LabelTTF();
LabelTTF * ret = new (std::nothrow) LabelTTF();
if (ret)
{
ret->autorelease();
@ -70,7 +70,7 @@ LabelTTF* LabelTTF::create(const std::string& string, const std::string& fontNam
const Size &dimensions, TextHAlignment hAlignment,
TextVAlignment vAlignment)
{
LabelTTF *ret = new LabelTTF();
LabelTTF *ret = new (std::nothrow) LabelTTF();
if(ret && ret->initWithString(string, fontName, fontSize, dimensions, hAlignment, vAlignment))
{
ret->autorelease();
@ -82,7 +82,7 @@ LabelTTF* LabelTTF::create(const std::string& string, const std::string& fontNam
LabelTTF * LabelTTF::createWithFontDefinition(const std::string& string, FontDefinition &textDefinition)
{
LabelTTF *ret = new LabelTTF();
LabelTTF *ret = new (std::nothrow) LabelTTF();
if(ret && ret->initWithStringAndTextDefinition(string, textDefinition))
{
ret->autorelease();

View File

@ -78,7 +78,7 @@ bool Layer::init()
Layer *Layer::create()
{
Layer *ret = new Layer();
Layer *ret = new (std::nothrow) Layer();
if (ret && ret->init())
{
ret->autorelease();
@ -459,7 +459,7 @@ void LayerColor::setBlendFunc(const BlendFunc &var)
LayerColor* LayerColor::create()
{
LayerColor* ret = new LayerColor();
LayerColor* ret = new (std::nothrow) LayerColor();
if (ret && ret->init())
{
ret->autorelease();
@ -473,7 +473,7 @@ LayerColor* LayerColor::create()
LayerColor * LayerColor::create(const Color4B& color, GLfloat width, GLfloat height)
{
LayerColor * layer = new LayerColor();
LayerColor * layer = new (std::nothrow) LayerColor();
if( layer && layer->initWithColor(color,width,height))
{
layer->autorelease();
@ -485,7 +485,7 @@ LayerColor * LayerColor::create(const Color4B& color, GLfloat width, GLfloat hei
LayerColor * LayerColor::create(const Color4B& color)
{
LayerColor * layer = new LayerColor();
LayerColor * layer = new (std::nothrow) LayerColor();
if(layer && layer->initWithColor(color))
{
layer->autorelease();
@ -641,7 +641,7 @@ LayerGradient::~LayerGradient()
LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end)
{
LayerGradient * layer = new LayerGradient();
LayerGradient * layer = new (std::nothrow) LayerGradient();
if( layer && layer->initWithColor(start, end))
{
layer->autorelease();
@ -653,7 +653,7 @@ LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end)
LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end, const Vec2& v)
{
LayerGradient * layer = new LayerGradient();
LayerGradient * layer = new (std::nothrow) LayerGradient();
if( layer && layer->initWithColor(start, end, v))
{
layer->autorelease();
@ -665,7 +665,7 @@ LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end, c
LayerGradient* LayerGradient::create()
{
LayerGradient* ret = new LayerGradient();
LayerGradient* ret = new (std::nothrow) LayerGradient();
if (ret && ret->init())
{
ret->autorelease();
@ -848,7 +848,7 @@ LayerMultiplex * LayerMultiplex::createVariadic(Layer * layer, ...)
va_list args;
va_start(args,layer);
LayerMultiplex * multiplexLayer = new LayerMultiplex();
LayerMultiplex * multiplexLayer = new (std::nothrow) LayerMultiplex();
if(multiplexLayer && multiplexLayer->initWithLayers(layer, args))
{
multiplexLayer->autorelease();
@ -865,7 +865,7 @@ LayerMultiplex * LayerMultiplex::create(Layer * layer, ...)
va_list args;
va_start(args,layer);
LayerMultiplex * multiplexLayer = new LayerMultiplex();
LayerMultiplex * multiplexLayer = new (std::nothrow) LayerMultiplex();
if(multiplexLayer && multiplexLayer->initWithLayers(layer, args))
{
multiplexLayer->autorelease();
@ -885,7 +885,7 @@ LayerMultiplex * LayerMultiplex::createWithLayer(Layer* layer)
LayerMultiplex* LayerMultiplex::create()
{
LayerMultiplex* ret = new LayerMultiplex();
LayerMultiplex* ret = new (std::nothrow) LayerMultiplex();
if (ret && ret->init())
{
ret->autorelease();
@ -899,7 +899,7 @@ LayerMultiplex* LayerMultiplex::create()
LayerMultiplex* LayerMultiplex::createWithArray(const Vector<Layer*>& arrayOfLayers)
{
LayerMultiplex* ret = new LayerMultiplex();
LayerMultiplex* ret = new (std::nothrow) LayerMultiplex();
if (ret && ret->initWithArray(arrayOfLayers))
{
ret->autorelease();

View File

@ -89,7 +89,7 @@ Menu * Menu::create(MenuItem* item, ...)
Menu* Menu::createWithArray(const Vector<MenuItem*>& arrayOfItems)
{
auto ret = new Menu();
auto ret = new (std::nothrow) Menu();
if (ret && ret->initWithArray(arrayOfItems))
{
ret->autorelease();

View File

@ -66,7 +66,7 @@ MenuItem* MenuItem::create()
// XXX deprecated
MenuItem* MenuItem::create(Ref *target, SEL_MenuHandler selector)
{
MenuItem *ret = new MenuItem();
MenuItem *ret = new (std::nothrow) MenuItem();
ret->initWithTarget(target, selector);
ret->autorelease();
return ret;
@ -74,7 +74,7 @@ MenuItem* MenuItem::create(Ref *target, SEL_MenuHandler selector)
MenuItem* MenuItem::create( const ccMenuCallback& callback)
{
MenuItem *ret = new MenuItem();
MenuItem *ret = new (std::nothrow) MenuItem();
ret->initWithCallback(callback);
ret->autorelease();
return ret;
@ -195,7 +195,7 @@ void MenuItemLabel::setLabel(Node* var)
// XXX: deprecated
MenuItemLabel * MenuItemLabel::create(Node*label, Ref* target, SEL_MenuHandler selector)
{
MenuItemLabel *ret = new MenuItemLabel();
MenuItemLabel *ret = new (std::nothrow) MenuItemLabel();
ret->initWithLabel(label, target, selector);
ret->autorelease();
return ret;
@ -203,7 +203,7 @@ MenuItemLabel * MenuItemLabel::create(Node*label, Ref* target, SEL_MenuHandler s
MenuItemLabel * MenuItemLabel::create(Node*label, const ccMenuCallback& callback)
{
MenuItemLabel *ret = new MenuItemLabel();
MenuItemLabel *ret = new (std::nothrow) MenuItemLabel();
ret->initWithLabel(label, callback);
ret->autorelease();
return ret;
@ -211,7 +211,7 @@ MenuItemLabel * MenuItemLabel::create(Node*label, const ccMenuCallback& callback
MenuItemLabel* MenuItemLabel::create(Node *label)
{
MenuItemLabel *ret = new MenuItemLabel();
MenuItemLabel *ret = new (std::nothrow) MenuItemLabel();
ret->initWithLabel(label, (const ccMenuCallback&) nullptr);
ret->autorelease();
return ret;
@ -325,7 +325,7 @@ MenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const st
// XXX: deprecated
MenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, Ref* target, SEL_MenuHandler selector)
{
MenuItemAtlasFont *ret = new MenuItemAtlasFont();
MenuItemAtlasFont *ret = new (std::nothrow) MenuItemAtlasFont();
ret->initWithString(value, charMapFile, itemWidth, itemHeight, startCharMap, target, selector);
ret->autorelease();
return ret;
@ -333,7 +333,7 @@ MenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const st
MenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, const ccMenuCallback& callback)
{
MenuItemAtlasFont *ret = new MenuItemAtlasFont();
MenuItemAtlasFont *ret = new (std::nothrow) MenuItemAtlasFont();
ret->initWithString(value, charMapFile, itemWidth, itemHeight, startCharMap, callback);
ret->autorelease();
return ret;
@ -391,7 +391,7 @@ const std::string& MenuItemFont::getFontName()
// XXX: deprecated
MenuItemFont * MenuItemFont::create(const std::string& value, Ref* target, SEL_MenuHandler selector)
{
MenuItemFont *ret = new MenuItemFont();
MenuItemFont *ret = new (std::nothrow) MenuItemFont();
ret->initWithString(value, target, selector);
ret->autorelease();
return ret;
@ -399,7 +399,7 @@ MenuItemFont * MenuItemFont::create(const std::string& value, Ref* target, SEL_M
MenuItemFont * MenuItemFont::create(const std::string& value, const ccMenuCallback& callback)
{
MenuItemFont *ret = new MenuItemFont();
MenuItemFont *ret = new (std::nothrow) MenuItemFont();
ret->initWithString(value, callback);
ret->autorelease();
return ret;
@ -408,7 +408,7 @@ MenuItemFont * MenuItemFont::create(const std::string& value, const ccMenuCallba
MenuItemFont * MenuItemFont::create(const std::string& value)
{
MenuItemFont *ret = new MenuItemFont();
MenuItemFont *ret = new (std::nothrow) MenuItemFont();
ret->initWithString(value, (const ccMenuCallback&)nullptr);
ret->autorelease();
return ret;
@ -560,7 +560,7 @@ MenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite
// XXX deprecated
MenuItemSprite * MenuItemSprite::create(Node *normalSprite, Node *selectedSprite, Node *disabledSprite, Ref *target, SEL_MenuHandler selector)
{
MenuItemSprite *ret = new MenuItemSprite();
MenuItemSprite *ret = new (std::nothrow) MenuItemSprite();
ret->initWithNormalSprite(normalSprite, selectedSprite, disabledSprite, target, selector);
ret->autorelease();
return ret;
@ -568,7 +568,7 @@ MenuItemSprite * MenuItemSprite::create(Node *normalSprite, Node *selectedSprite
MenuItemSprite * MenuItemSprite::create(Node *normalSprite, Node *selectedSprite, Node *disabledSprite, const ccMenuCallback& callback)
{
MenuItemSprite *ret = new MenuItemSprite();
MenuItemSprite *ret = new (std::nothrow) MenuItemSprite();
ret->initWithNormalSprite(normalSprite, selectedSprite, disabledSprite, callback);
ret->autorelease();
return ret;
@ -686,7 +686,7 @@ void MenuItemSprite::updateImagesVisibility()
MenuItemImage* MenuItemImage::create()
{
MenuItemImage *ret = new MenuItemImage();
MenuItemImage *ret = new (std::nothrow) MenuItemImage();
if (ret && ret->init())
{
ret->autorelease();
@ -720,7 +720,7 @@ MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std:
// XXX deprecated
MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, Ref* target, SEL_MenuHandler selector)
{
MenuItemImage *ret = new MenuItemImage();
MenuItemImage *ret = new (std::nothrow) MenuItemImage();
if (ret && ret->initWithNormalImage(normalImage, selectedImage, disabledImage, target, selector))
{
ret->autorelease();
@ -732,7 +732,7 @@ MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std:
MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, const ccMenuCallback& callback)
{
MenuItemImage *ret = new MenuItemImage();
MenuItemImage *ret = new (std::nothrow) MenuItemImage();
if (ret && ret->initWithNormalImage(normalImage, selectedImage, disabledImage, callback))
{
ret->autorelease();
@ -744,7 +744,7 @@ MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std:
MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage)
{
MenuItemImage *ret = new MenuItemImage();
MenuItemImage *ret = new (std::nothrow) MenuItemImage();
if (ret && ret->initWithNormalImage(normalImage, selectedImage, disabledImage, (const ccMenuCallback&)nullptr))
{
ret->autorelease();
@ -809,7 +809,7 @@ void MenuItemImage::setDisabledSpriteFrame(SpriteFrame * frame)
// XXX: deprecated
MenuItemToggle * MenuItemToggle::createWithTarget(Ref* target, SEL_MenuHandler selector, const Vector<MenuItem*>& menuItems)
{
MenuItemToggle *ret = new MenuItemToggle();
MenuItemToggle *ret = new (std::nothrow) MenuItemToggle();
ret->MenuItem::initWithTarget(target, selector);
ret->_subItems = menuItems;
ret->_selectedIndex = UINT_MAX;
@ -819,7 +819,7 @@ MenuItemToggle * MenuItemToggle::createWithTarget(Ref* target, SEL_MenuHandler s
MenuItemToggle * MenuItemToggle::createWithCallback(const ccMenuCallback &callback, const Vector<MenuItem*>& menuItems)
{
MenuItemToggle *ret = new MenuItemToggle();
MenuItemToggle *ret = new (std::nothrow) MenuItemToggle();
ret->MenuItem::initWithCallback(callback);
ret->_subItems = menuItems;
ret->_selectedIndex = UINT_MAX;
@ -832,7 +832,7 @@ MenuItemToggle * MenuItemToggle::createWithTarget(Ref* target, SEL_MenuHandler s
{
va_list args;
va_start(args, item);
MenuItemToggle *ret = new MenuItemToggle();
MenuItemToggle *ret = new (std::nothrow) MenuItemToggle();
ret->initWithTarget(target, selector, item, args);
ret->autorelease();
va_end(args);
@ -844,7 +844,7 @@ MenuItemToggle * MenuItemToggle::createWithCallbackVA(const ccMenuCallback &call
{
va_list args;
va_start(args, item);
MenuItemToggle *ret = new MenuItemToggle();
MenuItemToggle *ret = new (std::nothrow) MenuItemToggle();
ret->initWithCallback(callback, item, args);
ret->autorelease();
va_end(args);
@ -855,7 +855,7 @@ MenuItemToggle * MenuItemToggle::createWithCallback(const ccMenuCallback &callba
{
va_list args;
va_start(args, item);
MenuItemToggle *ret = new MenuItemToggle();
MenuItemToggle *ret = new (std::nothrow) MenuItemToggle();
ret->initWithCallback(callback, item, args);
ret->autorelease();
va_end(args);
@ -865,7 +865,7 @@ MenuItemToggle * MenuItemToggle::createWithCallback(const ccMenuCallback &callba
MenuItemToggle * MenuItemToggle::create()
{
MenuItemToggle *ret = new MenuItemToggle();
MenuItemToggle *ret = new (std::nothrow) MenuItemToggle();
ret->initWithItem(nullptr);
ret->autorelease();
return ret;
@ -898,7 +898,7 @@ bool MenuItemToggle::initWithCallback(const ccMenuCallback &callback, MenuItem *
MenuItemToggle* MenuItemToggle::create(MenuItem *item)
{
MenuItemToggle *ret = new MenuItemToggle();
MenuItemToggle *ret = new (std::nothrow) MenuItemToggle();
ret->initWithItem(item);
ret->autorelease();
return ret;

View File

@ -69,7 +69,7 @@ MotionStreak::~MotionStreak()
MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const Color3B& color, const std::string& path)
{
MotionStreak *ret = new MotionStreak();
MotionStreak *ret = new (std::nothrow) MotionStreak();
if (ret && ret->initWithFade(fade, minSeg, stroke, color, path))
{
ret->autorelease();
@ -82,7 +82,7 @@ MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const
MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture)
{
MotionStreak *ret = new MotionStreak();
MotionStreak *ret = new (std::nothrow) MotionStreak();
if (ret && ret->initWithFade(fade, minSeg, stroke, color, texture))
{
ret->autorelease();

View File

@ -757,7 +757,7 @@ Rect Node::getBoundingBox() const
Node * Node::create()
{
Node * ret = new Node();
Node * ret = new (std::nothrow) Node();
if (ret && ret->init())
{
ret->autorelease();
@ -1847,7 +1847,7 @@ bool Node::addComponent(Component *component)
{
// lazy alloc
if( !_componentContainer )
_componentContainer = new ComponentContainer(this);
_componentContainer = new (std::nothrow) ComponentContainer(this);
return _componentContainer->add(component);
}

View File

@ -34,7 +34,7 @@ NS_CC_BEGIN
NodeGrid* NodeGrid::create()
{
NodeGrid * ret = new NodeGrid();
NodeGrid * ret = new (std::nothrow) NodeGrid();
if (ret && ret->init())
{
ret->autorelease();

View File

@ -34,7 +34,7 @@ class PointObject : public Ref
public:
static PointObject * create(Vec2 ratio, Vec2 offset)
{
PointObject *ret = new PointObject();
PointObject *ret = new (std::nothrow) PointObject();
ret->initWithPoint(ratio, offset);
ret->autorelease();
return ret;
@ -80,7 +80,7 @@ ParallaxNode::~ParallaxNode()
ParallaxNode * ParallaxNode::create()
{
ParallaxNode *ret = new ParallaxNode();
ParallaxNode *ret = new (std::nothrow) ParallaxNode();
ret->autorelease();
return ret;
}

View File

@ -65,7 +65,7 @@ ParticleBatchNode::~ParticleBatchNode()
ParticleBatchNode* ParticleBatchNode::createWithTexture(Texture2D *tex, int capacity/* = kParticleDefaultCapacity*/)
{
ParticleBatchNode * p = new ParticleBatchNode();
ParticleBatchNode * p = new (std::nothrow) ParticleBatchNode();
if( p && p->initWithTexture(tex, capacity))
{
p->autorelease();
@ -81,7 +81,7 @@ ParticleBatchNode* ParticleBatchNode::createWithTexture(Texture2D *tex, int capa
ParticleBatchNode* ParticleBatchNode::create(const std::string& imageFile, int capacity/* = kParticleDefaultCapacity*/)
{
ParticleBatchNode * p = new ParticleBatchNode();
ParticleBatchNode * p = new (std::nothrow) ParticleBatchNode();
if( p && p->initWithFile(imageFile, capacity))
{
p->autorelease();
@ -96,7 +96,7 @@ ParticleBatchNode* ParticleBatchNode::create(const std::string& imageFile, int c
*/
bool ParticleBatchNode::initWithTexture(Texture2D *tex, int capacity)
{
_textureAtlas = new TextureAtlas();
_textureAtlas = new (std::nothrow) TextureAtlas();
_textureAtlas->initWithTexture(tex, capacity);
_children.reserve(capacity);

View File

@ -47,7 +47,7 @@ static Texture2D* getDefaultTexture()
texture = Director::getInstance()->getTextureCache()->getTextureForKey(key);
CC_BREAK_IF(texture != nullptr);
image = new Image();
image = new (std::nothrow) Image();
CC_BREAK_IF(nullptr == image);
ret = image->initWithImageData(__firePngData, sizeof(__firePngData));
CC_BREAK_IF(!ret);
@ -62,7 +62,7 @@ static Texture2D* getDefaultTexture()
ParticleFire* ParticleFire::create()
{
ParticleFire* ret = new ParticleFire();
ParticleFire* ret = new (std::nothrow) ParticleFire();
if (ret && ret->init())
{
ret->autorelease();
@ -76,7 +76,7 @@ ParticleFire* ParticleFire::create()
ParticleFire* ParticleFire::createWithTotalParticles(int numberOfParticles)
{
ParticleFire* ret = new ParticleFire();
ParticleFire* ret = new (std::nothrow) ParticleFire();
if (ret && ret->initWithTotalParticles(numberOfParticles))
{
ret->autorelease();
@ -167,7 +167,7 @@ bool ParticleFire::initWithTotalParticles(int numberOfParticles)
ParticleFireworks* ParticleFireworks::create()
{
ParticleFireworks* ret = new ParticleFireworks();
ParticleFireworks* ret = new (std::nothrow) ParticleFireworks();
if (ret && ret->init())
{
ret->autorelease();
@ -181,7 +181,7 @@ ParticleFireworks* ParticleFireworks::create()
ParticleFireworks* ParticleFireworks::createWithTotalParticles(int numberOfParticles)
{
ParticleFireworks* ret = new ParticleFireworks();
ParticleFireworks* ret = new (std::nothrow) ParticleFireworks();
if (ret && ret->initWithTotalParticles(numberOfParticles))
{
ret->autorelease();
@ -268,7 +268,7 @@ bool ParticleFireworks::initWithTotalParticles(int numberOfParticles)
//
ParticleSun* ParticleSun::create()
{
ParticleSun* ret = new ParticleSun();
ParticleSun* ret = new (std::nothrow) ParticleSun();
if (ret && ret->init())
{
ret->autorelease();
@ -282,7 +282,7 @@ ParticleSun* ParticleSun::create()
ParticleSun* ParticleSun::createWithTotalParticles(int numberOfParticles)
{
ParticleSun* ret = new ParticleSun();
ParticleSun* ret = new (std::nothrow) ParticleSun();
if (ret && ret->initWithTotalParticles(numberOfParticles))
{
ret->autorelease();
@ -375,7 +375,7 @@ bool ParticleSun::initWithTotalParticles(int numberOfParticles)
ParticleGalaxy* ParticleGalaxy::create()
{
ParticleGalaxy* ret = new ParticleGalaxy();
ParticleGalaxy* ret = new (std::nothrow) ParticleGalaxy();
if (ret && ret->init())
{
ret->autorelease();
@ -389,7 +389,7 @@ ParticleGalaxy* ParticleGalaxy::create()
ParticleGalaxy* ParticleGalaxy::createWithTotalParticles(int numberOfParticles)
{
ParticleGalaxy* ret = new ParticleGalaxy();
ParticleGalaxy* ret = new (std::nothrow) ParticleGalaxy();
if (ret && ret->initWithTotalParticles(numberOfParticles))
{
ret->autorelease();
@ -484,7 +484,7 @@ bool ParticleGalaxy::initWithTotalParticles(int numberOfParticles)
ParticleFlower* ParticleFlower::create()
{
ParticleFlower* ret = new ParticleFlower();
ParticleFlower* ret = new (std::nothrow) ParticleFlower();
if (ret && ret->init())
{
ret->autorelease();
@ -498,7 +498,7 @@ ParticleFlower* ParticleFlower::create()
ParticleFlower* ParticleFlower::createWithTotalParticles(int numberOfParticles)
{
ParticleFlower* ret = new ParticleFlower();
ParticleFlower* ret = new (std::nothrow) ParticleFlower();
if (ret && ret->initWithTotalParticles(numberOfParticles))
{
ret->autorelease();
@ -592,7 +592,7 @@ bool ParticleFlower::initWithTotalParticles(int numberOfParticles)
ParticleMeteor * ParticleMeteor::create()
{
ParticleMeteor *ret = new ParticleMeteor();
ParticleMeteor *ret = new (std::nothrow) ParticleMeteor();
if (ret && ret->init())
{
ret->autorelease();
@ -606,7 +606,7 @@ ParticleMeteor * ParticleMeteor::create()
ParticleMeteor* ParticleMeteor::createWithTotalParticles(int numberOfParticles)
{
ParticleMeteor* ret = new ParticleMeteor();
ParticleMeteor* ret = new (std::nothrow) ParticleMeteor();
if (ret && ret->initWithTotalParticles(numberOfParticles))
{
ret->autorelease();
@ -701,7 +701,7 @@ bool ParticleMeteor::initWithTotalParticles(int numberOfParticles)
ParticleSpiral* ParticleSpiral::create()
{
ParticleSpiral* ret = new ParticleSpiral();
ParticleSpiral* ret = new (std::nothrow) ParticleSpiral();
if (ret && ret->init())
{
ret->autorelease();
@ -715,7 +715,7 @@ ParticleSpiral* ParticleSpiral::create()
ParticleSpiral* ParticleSpiral::createWithTotalParticles(int numberOfParticles)
{
ParticleSpiral* ret = new ParticleSpiral();
ParticleSpiral* ret = new (std::nothrow) ParticleSpiral();
if (ret && ret->initWithTotalParticles(numberOfParticles))
{
ret->autorelease();
@ -810,7 +810,7 @@ bool ParticleSpiral::initWithTotalParticles(int numberOfParticles)
ParticleExplosion* ParticleExplosion::create()
{
ParticleExplosion* ret = new ParticleExplosion();
ParticleExplosion* ret = new (std::nothrow) ParticleExplosion();
if (ret && ret->init())
{
ret->autorelease();
@ -824,7 +824,7 @@ ParticleExplosion* ParticleExplosion::create()
ParticleExplosion* ParticleExplosion::createWithTotalParticles(int numberOfParticles)
{
ParticleExplosion* ret = new ParticleExplosion();
ParticleExplosion* ret = new (std::nothrow) ParticleExplosion();
if (ret && ret->initWithTotalParticles(numberOfParticles))
{
ret->autorelease();
@ -918,7 +918,7 @@ bool ParticleExplosion::initWithTotalParticles(int numberOfParticles)
ParticleSmoke* ParticleSmoke::create()
{
ParticleSmoke* ret = new ParticleSmoke();
ParticleSmoke* ret = new (std::nothrow) ParticleSmoke();
if (ret && ret->init())
{
ret->autorelease();
@ -932,7 +932,7 @@ ParticleSmoke* ParticleSmoke::create()
ParticleSmoke* ParticleSmoke::createWithTotalParticles(int numberOfParticles)
{
ParticleSmoke* ret = new ParticleSmoke();
ParticleSmoke* ret = new (std::nothrow) ParticleSmoke();
if (ret && ret->initWithTotalParticles(numberOfParticles))
{
ret->autorelease();
@ -1023,7 +1023,7 @@ bool ParticleSmoke::initWithTotalParticles(int numberOfParticles)
ParticleSnow* ParticleSnow::create()
{
ParticleSnow* ret = new ParticleSnow();
ParticleSnow* ret = new (std::nothrow) ParticleSnow();
if (ret && ret->init())
{
ret->autorelease();
@ -1037,7 +1037,7 @@ ParticleSnow* ParticleSnow::create()
ParticleSnow* ParticleSnow::createWithTotalParticles(int numberOfParticles)
{
ParticleSnow* ret = new ParticleSnow();
ParticleSnow* ret = new (std::nothrow) ParticleSnow();
if (ret && ret->initWithTotalParticles(numberOfParticles))
{
ret->autorelease();
@ -1131,7 +1131,7 @@ bool ParticleSnow::initWithTotalParticles(int numberOfParticles)
ParticleRain* ParticleRain::create()
{
ParticleRain* ret = new ParticleRain();
ParticleRain* ret = new (std::nothrow) ParticleRain();
if (ret && ret->init())
{
ret->autorelease();
@ -1145,7 +1145,7 @@ ParticleRain* ParticleRain::create()
ParticleRain* ParticleRain::createWithTotalParticles(int numberOfParticles)
{
ParticleRain* ret = new ParticleRain();
ParticleRain* ret = new (std::nothrow) ParticleRain();
if (ret && ret->initWithTotalParticles(numberOfParticles))
{
ret->autorelease();

View File

@ -139,7 +139,7 @@ ParticleSystem::ParticleSystem()
ParticleSystem * ParticleSystem::create(const std::string& plistFile)
{
ParticleSystem *ret = new ParticleSystem();
ParticleSystem *ret = new (std::nothrow) ParticleSystem();
if (ret && ret->initWithFile(plistFile))
{
ret->autorelease();
@ -151,7 +151,7 @@ ParticleSystem * ParticleSystem::create(const std::string& plistFile)
ParticleSystem* ParticleSystem::createWithTotalParticles(int numberOfParticles)
{
ParticleSystem *ret = new ParticleSystem();
ParticleSystem *ret = new (std::nothrow) ParticleSystem();
if (ret && ret->initWithTotalParticles(numberOfParticles))
{
ret->autorelease();
@ -405,7 +405,7 @@ bool ParticleSystem::initWithDictionary(ValueMap& dictionary, const std::string&
CC_BREAK_IF(!deflated);
// For android, we should retain it in VolatileTexture::addImage which invoked in Director::getInstance()->getTextureCache()->addUIImage()
image = new Image();
image = new (std::nothrow) Image();
bool isOK = image->initWithImageData(deflated, deflatedLen);
CCASSERT(isOK, "CCParticleSystem: error init image with Data");
CC_BREAK_IF(!isOK);

View File

@ -75,7 +75,7 @@ ParticleSystemQuad::~ParticleSystemQuad()
ParticleSystemQuad * ParticleSystemQuad::create(const std::string& filename)
{
ParticleSystemQuad *ret = new ParticleSystemQuad();
ParticleSystemQuad *ret = new (std::nothrow) ParticleSystemQuad();
if (ret && ret->initWithFile(filename))
{
ret->autorelease();
@ -86,7 +86,7 @@ ParticleSystemQuad * ParticleSystemQuad::create(const std::string& filename)
}
ParticleSystemQuad * ParticleSystemQuad::createWithTotalParticles(int numberOfParticles) {
ParticleSystemQuad *ret = new ParticleSystemQuad();
ParticleSystemQuad *ret = new (std::nothrow) ParticleSystemQuad();
if (ret && ret->initWithTotalParticles(numberOfParticles))
{
ret->autorelease();
@ -597,7 +597,7 @@ void ParticleSystemQuad::setBatchNode(ParticleBatchNode * batchNode)
}
ParticleSystemQuad * ParticleSystemQuad::create() {
ParticleSystemQuad *particleSystemQuad = new ParticleSystemQuad();
ParticleSystemQuad *particleSystemQuad = new (std::nothrow) ParticleSystemQuad();
if (particleSystemQuad && particleSystemQuad->init())
{
particleSystemQuad->autorelease();

View File

@ -59,7 +59,7 @@ ProgressTimer::ProgressTimer()
ProgressTimer* ProgressTimer::create(Sprite* sp)
{
ProgressTimer *progressTimer = new ProgressTimer();
ProgressTimer *progressTimer = new (std::nothrow) ProgressTimer();
if (progressTimer->initWithSprite(sp))
{
progressTimer->autorelease();

View File

@ -49,7 +49,7 @@ ProtectedNode::~ProtectedNode()
ProtectedNode * ProtectedNode::create(void)
{
ProtectedNode * ret = new ProtectedNode();
ProtectedNode * ret = new (std::nothrow) ProtectedNode();
if (ret && ret->init())
{
ret->autorelease();

View File

@ -150,7 +150,7 @@ void RenderTexture::listenToForeground(EventCustom *event)
RenderTexture * RenderTexture::create(int w, int h, Texture2D::PixelFormat eFormat)
{
RenderTexture *ret = new RenderTexture();
RenderTexture *ret = new (std::nothrow) RenderTexture();
if(ret && ret->initWithWidthAndHeight(w, h, eFormat))
{
@ -163,7 +163,7 @@ RenderTexture * RenderTexture::create(int w, int h, Texture2D::PixelFormat eForm
RenderTexture * RenderTexture::create(int w ,int h, Texture2D::PixelFormat eFormat, GLuint uDepthStencilFormat)
{
RenderTexture *ret = new RenderTexture();
RenderTexture *ret = new (std::nothrow) RenderTexture();
if(ret && ret->initWithWidthAndHeight(w, h, eFormat, uDepthStencilFormat))
{
@ -176,7 +176,7 @@ RenderTexture * RenderTexture::create(int w ,int h, Texture2D::PixelFormat eForm
RenderTexture * RenderTexture::create(int w, int h)
{
RenderTexture *ret = new RenderTexture();
RenderTexture *ret = new (std::nothrow) RenderTexture();
if(ret && ret->initWithWidthAndHeight(w, h, Texture2D::PixelFormat::RGBA8888, 0))
{
@ -231,7 +231,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, int h, Texture2D::PixelFormat
memset(data, 0, dataLen);
_pixelFormat = format;
_texture = new Texture2D();
_texture = new (std::nothrow) Texture2D();
if (_texture)
{
_texture->initWithData(data, dataLen, (Texture2D::PixelFormat)_pixelFormat, powW, powH, Size((float)w, (float)h));
@ -245,7 +245,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, int h, Texture2D::PixelFormat
if (Configuration::getInstance()->checkForGLExtension("GL_QCOM"))
{
_textureCopy = new Texture2D();
_textureCopy = new (std::nothrow) Texture2D();
if (_textureCopy)
{
_textureCopy->initWithData(data, dataLen, (Texture2D::PixelFormat)_pixelFormat, powW, powH, Size((float)w, (float)h));
@ -488,13 +488,13 @@ Image* RenderTexture::newImage(bool fliimage)
GLubyte *buffer = nullptr;
GLubyte *tempData = nullptr;
Image *image = new Image();
Image *image = new (std::nothrow) Image();
do
{
CC_BREAK_IF(! (buffer = new GLubyte[savedBufferWidth * savedBufferHeight * 4]));
CC_BREAK_IF(! (buffer = new (std::nothrow) GLubyte[savedBufferWidth * savedBufferHeight * 4]));
if(! (tempData = new GLubyte[savedBufferWidth * savedBufferHeight * 4]))
if(! (tempData = new (std::nothrow) GLubyte[savedBufferWidth * savedBufferHeight * 4]))
{
delete[] buffer;
buffer = nullptr;

View File

@ -77,7 +77,7 @@ bool Scene::initWithSize(const Size& size)
Scene* Scene::create()
{
Scene *ret = new Scene();
Scene *ret = new (std::nothrow) Scene();
if (ret && ret->init())
{
ret->autorelease();
@ -92,7 +92,7 @@ Scene* Scene::create()
Scene* Scene::createWithSize(const Size& size)
{
Scene *ret = new Scene();
Scene *ret = new (std::nothrow) Scene();
if (ret && ret->initWithSize(size))
{
ret->autorelease();
@ -148,7 +148,7 @@ void Scene::update(float delta)
Scene* Scene::createWithPhysics()
{
Scene *ret = new Scene();
Scene *ret = new (std::nothrow) Scene();
if (ret && ret->initWithPhysics())
{
ret->autorelease();

View File

@ -292,7 +292,7 @@ Sprite::~Sprite(void)
* It's used for creating a default texture when sprite's texture is set to nullptr.
* Supposing codes as follows:
*
* auto sp = new Sprite();
* auto sp = new (std::nothrow) Sprite();
* sp->init(); // Texture was set to nullptr, in order to make opacity and color to work correctly, we need to create a 2x2 white texture.
*
* The test is in "TestCpp/SpriteTest/Sprite without texture".
@ -332,7 +332,7 @@ void Sprite::setTexture(Texture2D *texture)
// If texture wasn't in cache, create it from RAW data.
if (texture == nullptr)
{
Image* image = new Image();
Image* image = new (std::nothrow) Image();
bool isOK = image->initWithRawData(cc_2x2_white_image, sizeof(cc_2x2_white_image), 2, 2, 8);
CC_UNUSED_PARAM(isOK);
CCASSERT(isOK, "The 2x2 empty texture was created unsuccessfully.");

View File

@ -57,7 +57,7 @@ NS_CC_BEGIN
SpriteBatchNode* SpriteBatchNode::createWithTexture(Texture2D* tex, ssize_t capacity/* = DEFAULT_CAPACITY*/)
{
SpriteBatchNode *batchNode = new SpriteBatchNode();
SpriteBatchNode *batchNode = new (std::nothrow) SpriteBatchNode();
batchNode->initWithTexture(tex, capacity);
batchNode->autorelease();
@ -70,7 +70,7 @@ SpriteBatchNode* SpriteBatchNode::createWithTexture(Texture2D* tex, ssize_t capa
SpriteBatchNode* SpriteBatchNode::create(const std::string& fileImage, ssize_t capacity/* = DEFAULT_CAPACITY*/)
{
SpriteBatchNode *batchNode = new SpriteBatchNode();
SpriteBatchNode *batchNode = new (std::nothrow) SpriteBatchNode();
batchNode->initWithFile(fileImage, capacity);
batchNode->autorelease();
@ -89,7 +89,7 @@ bool SpriteBatchNode::initWithTexture(Texture2D *tex, ssize_t capacity)
{
_blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;
}
_textureAtlas = new TextureAtlas();
_textureAtlas = new (std::nothrow) TextureAtlas();
if (capacity == 0)
{
@ -110,7 +110,7 @@ bool SpriteBatchNode::initWithTexture(Texture2D *tex, ssize_t capacity)
bool SpriteBatchNode::init()
{
Texture2D * texture = new Texture2D();
Texture2D * texture = new (std::nothrow) Texture2D();
texture->autorelease();
return this->initWithTexture(texture, 0);
}

View File

@ -35,7 +35,7 @@ NS_CC_BEGIN
SpriteFrame* SpriteFrame::create(const std::string& filename, const Rect& rect)
{
SpriteFrame *spriteFrame = new SpriteFrame();
SpriteFrame *spriteFrame = new (std::nothrow) SpriteFrame();
spriteFrame->initWithTextureFilename(filename, rect);
spriteFrame->autorelease();
@ -44,7 +44,7 @@ SpriteFrame* SpriteFrame::create(const std::string& filename, const Rect& rect)
SpriteFrame* SpriteFrame::createWithTexture(Texture2D *texture, const Rect& rect)
{
SpriteFrame *spriteFrame = new SpriteFrame();
SpriteFrame *spriteFrame = new (std::nothrow) SpriteFrame();
spriteFrame->initWithTexture(texture, rect);
spriteFrame->autorelease();
@ -53,7 +53,7 @@ SpriteFrame* SpriteFrame::createWithTexture(Texture2D *texture, const Rect& rect
SpriteFrame* SpriteFrame::createWithTexture(Texture2D* texture, const Rect& rect, bool rotated, const Vec2& offset, const Size& originalSize)
{
SpriteFrame *spriteFrame = new SpriteFrame();
SpriteFrame *spriteFrame = new (std::nothrow) SpriteFrame();
spriteFrame->initWithTexture(texture, rect, rotated, offset, originalSize);
spriteFrame->autorelease();
@ -62,7 +62,7 @@ SpriteFrame* SpriteFrame::createWithTexture(Texture2D* texture, const Rect& rect
SpriteFrame* SpriteFrame::create(const std::string& filename, const Rect& rect, bool rotated, const Vec2& offset, const Size& originalSize)
{
SpriteFrame *spriteFrame = new SpriteFrame();
SpriteFrame *spriteFrame = new (std::nothrow) SpriteFrame();
spriteFrame->initWithTextureFilename(filename, rect, rotated, offset, originalSize);
spriteFrame->autorelease();
@ -132,7 +132,7 @@ SpriteFrame::~SpriteFrame(void)
SpriteFrame* SpriteFrame::clone() const
{
// no copy constructor
SpriteFrame *copy = new SpriteFrame();
SpriteFrame *copy = new (std::nothrow) SpriteFrame();
copy->initWithTextureFilename(_textureFilename.c_str(), _rectInPixels, _rotated, _offsetInPixels, _originalSizeInPixels);
copy->setTexture(_texture);
copy->autorelease();

View File

@ -53,7 +53,7 @@ SpriteFrameCache* SpriteFrameCache::getInstance()
{
if (! _sharedSpriteFrameCache)
{
_sharedSpriteFrameCache = new SpriteFrameCache();
_sharedSpriteFrameCache = new (std::nothrow) SpriteFrameCache();
_sharedSpriteFrameCache->init();
}

View File

@ -45,7 +45,7 @@ NS_CC_BEGIN
TMXLayer * TMXLayer::create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo)
{
TMXLayer *ret = new TMXLayer();
TMXLayer *ret = new (std::nothrow) TMXLayer();
if (ret->initWithTilesetInfo(tilesetInfo, layerInfo, mapInfo))
{
ret->autorelease();

View File

@ -38,7 +38,7 @@ NS_CC_BEGIN
TMXTiledMap * TMXTiledMap::create(const std::string& tmxFile)
{
TMXTiledMap *ret = new TMXTiledMap();
TMXTiledMap *ret = new (std::nothrow) TMXTiledMap();
if (ret->initWithTMXFile(tmxFile))
{
ret->autorelease();
@ -50,7 +50,7 @@ TMXTiledMap * TMXTiledMap::create(const std::string& tmxFile)
TMXTiledMap* TMXTiledMap::createWithXML(const std::string& tmxString, const std::string& resourcePath)
{
TMXTiledMap *ret = new TMXTiledMap();
TMXTiledMap *ret = new (std::nothrow) TMXTiledMap();
if (ret->initWithXML(tmxString, resourcePath))
{
ret->autorelease();

View File

@ -100,7 +100,7 @@ Rect TMXTilesetInfo::getRectForGID(uint32_t gid)
TMXMapInfo * TMXMapInfo::create(const std::string& tmxFile)
{
TMXMapInfo *ret = new TMXMapInfo();
TMXMapInfo *ret = new (std::nothrow) TMXMapInfo();
if(ret->initWithTMXFile(tmxFile))
{
ret->autorelease();
@ -112,7 +112,7 @@ TMXMapInfo * TMXMapInfo::create(const std::string& tmxFile)
TMXMapInfo * TMXMapInfo::createWithXML(const std::string& tmxString, const std::string& resourcePath)
{
TMXMapInfo *ret = new TMXMapInfo();
TMXMapInfo *ret = new (std::nothrow) TMXMapInfo();
if(ret->initWithXML(tmxString, resourcePath))
{
ret->autorelease();
@ -278,7 +278,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
}
else
{
TMXTilesetInfo *tileset = new TMXTilesetInfo();
TMXTilesetInfo *tileset = new (std::nothrow) TMXTilesetInfo();
tileset->_name = attributeDict["name"].asString();
if (_recordFirstGID)
@ -332,7 +332,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
}
else if (elementName == "layer")
{
TMXLayerInfo *layer = new TMXLayerInfo();
TMXLayerInfo *layer = new (std::nothrow) TMXLayerInfo();
layer->_name = attributeDict["name"].asString();
Size s;
@ -359,7 +359,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
}
else if (elementName == "objectgroup")
{
TMXObjectGroup *objectGroup = new TMXObjectGroup();
TMXObjectGroup *objectGroup = new (std::nothrow) TMXObjectGroup();
objectGroup->setGroupName(attributeDict["name"].asString());
Vec2 positionOffset;
positionOffset.x = attributeDict["x"].asFloat() * tmxMapInfo->getTileSize().width;

View File

@ -72,7 +72,7 @@ TextFieldTTF::~TextFieldTTF()
TextFieldTTF * TextFieldTTF::textFieldWithPlaceHolder(const std::string& placeholder, const Size& dimensions, TextHAlignment alignment, const std::string& fontName, float fontSize)
{
TextFieldTTF *ret = new TextFieldTTF();
TextFieldTTF *ret = new (std::nothrow) TextFieldTTF();
if(ret && ret->initWithPlaceHolder("", dimensions, alignment, fontName, fontSize))
{
ret->autorelease();
@ -88,7 +88,7 @@ TextFieldTTF * TextFieldTTF::textFieldWithPlaceHolder(const std::string& placeho
TextFieldTTF * TextFieldTTF::textFieldWithPlaceHolder(const std::string& placeholder, const std::string& fontName, float fontSize)
{
TextFieldTTF *ret = new TextFieldTTF();
TextFieldTTF *ret = new (std::nothrow) TextFieldTTF();
if(ret && ret->initWithPlaceHolder("", fontName, fontSize))
{
ret->autorelease();

View File

@ -39,7 +39,7 @@ NS_CC_BEGIN
TileMapAtlas * TileMapAtlas::create(const std::string& tile, const std::string& mapFile, int tileWidth, int tileHeight)
{
TileMapAtlas *ret = new TileMapAtlas();
TileMapAtlas *ret = new (std::nothrow) TileMapAtlas();
if (ret->initWithTileFile(tile, mapFile, tileWidth, tileHeight))
{
ret->autorelease();

View File

@ -59,7 +59,7 @@ TransitionScene::~TransitionScene()
TransitionScene * TransitionScene::create(float t, Scene *scene)
{
TransitionScene * pScene = new TransitionScene();
TransitionScene * pScene = new (std::nothrow) TransitionScene();
if(pScene && pScene->initWithDuration(t,scene))
{
pScene->autorelease();
@ -211,7 +211,7 @@ TransitionSceneOriented::~TransitionSceneOriented()
TransitionSceneOriented * TransitionSceneOriented::create(float t, Scene *scene, Orientation orientation)
{
TransitionSceneOriented * newScene = new TransitionSceneOriented();
TransitionSceneOriented * newScene = new (std::nothrow) TransitionSceneOriented();
newScene->initWithDuration(t,scene,orientation);
newScene->autorelease();
return newScene;
@ -235,7 +235,7 @@ TransitionRotoZoom::TransitionRotoZoom()
TransitionRotoZoom* TransitionRotoZoom::create(float t, Scene* scene)
{
TransitionRotoZoom* newScene = new TransitionRotoZoom();
TransitionRotoZoom* newScene = new (std::nothrow) TransitionRotoZoom();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -295,7 +295,7 @@ TransitionJumpZoom::~TransitionJumpZoom()
TransitionJumpZoom* TransitionJumpZoom::create(float t, Scene* scene)
{
TransitionJumpZoom* newScene = new TransitionJumpZoom();
TransitionJumpZoom* newScene = new (std::nothrow) TransitionJumpZoom();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -350,7 +350,7 @@ TransitionMoveInL::~TransitionMoveInL()
TransitionMoveInL* TransitionMoveInL::create(float t, Scene* scene)
{
TransitionMoveInL* newScene = new TransitionMoveInL();
TransitionMoveInL* newScene = new (std::nothrow) TransitionMoveInL();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -407,7 +407,7 @@ TransitionMoveInR::~TransitionMoveInR()
TransitionMoveInR* TransitionMoveInR::create(float t, Scene* scene)
{
TransitionMoveInR* newScene = new TransitionMoveInR();
TransitionMoveInR* newScene = new (std::nothrow) TransitionMoveInR();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -435,7 +435,7 @@ TransitionMoveInT::~TransitionMoveInT()
TransitionMoveInT* TransitionMoveInT::create(float t, Scene* scene)
{
TransitionMoveInT* newScene = new TransitionMoveInT();
TransitionMoveInT* newScene = new (std::nothrow) TransitionMoveInT();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -463,7 +463,7 @@ TransitionMoveInB::~TransitionMoveInB()
TransitionMoveInB* TransitionMoveInB::create(float t, Scene* scene)
{
TransitionMoveInB* newScene = new TransitionMoveInB();
TransitionMoveInB* newScene = new (std::nothrow) TransitionMoveInB();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -540,7 +540,7 @@ ActionInterval* TransitionSlideInL::easeActionWithAction(ActionInterval* action)
TransitionSlideInL* TransitionSlideInL::create(float t, Scene* scene)
{
TransitionSlideInL* newScene = new TransitionSlideInL();
TransitionSlideInL* newScene = new (std::nothrow) TransitionSlideInL();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -562,7 +562,7 @@ TransitionSlideInR::~TransitionSlideInR()
TransitionSlideInR* TransitionSlideInR::create(float t, Scene* scene)
{
TransitionSlideInR* newScene = new TransitionSlideInR();
TransitionSlideInR* newScene = new (std::nothrow) TransitionSlideInR();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -603,7 +603,7 @@ TransitionSlideInT::~TransitionSlideInT()
TransitionSlideInT* TransitionSlideInT::create(float t, Scene* scene)
{
TransitionSlideInT* newScene = new TransitionSlideInT();
TransitionSlideInT* newScene = new (std::nothrow) TransitionSlideInT();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -643,7 +643,7 @@ TransitionSlideInB::~TransitionSlideInB()
TransitionSlideInB* TransitionSlideInB::create(float t, Scene* scene)
{
TransitionSlideInB* newScene = new TransitionSlideInB();
TransitionSlideInB* newScene = new (std::nothrow) TransitionSlideInB();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -683,7 +683,7 @@ TransitionShrinkGrow::~TransitionShrinkGrow()
TransitionShrinkGrow* TransitionShrinkGrow::create(float t, Scene* scene)
{
TransitionShrinkGrow* newScene = new TransitionShrinkGrow();
TransitionShrinkGrow* newScene = new (std::nothrow) TransitionShrinkGrow();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -781,7 +781,7 @@ void TransitionFlipX::onEnter()
TransitionFlipX* TransitionFlipX::create(float t, Scene* s, Orientation o)
{
TransitionFlipX* newScene = new TransitionFlipX();
TransitionFlipX* newScene = new (std::nothrow) TransitionFlipX();
newScene->initWithDuration(t, s, o);
newScene->autorelease();
@ -851,7 +851,7 @@ void TransitionFlipY::onEnter()
TransitionFlipY* TransitionFlipY::create(float t, Scene* s, Orientation o)
{
TransitionFlipY* newScene = new TransitionFlipY();
TransitionFlipY* newScene = new (std::nothrow) TransitionFlipY();
newScene->initWithDuration(t, s, o);
newScene->autorelease();
@ -921,7 +921,7 @@ void TransitionFlipAngular::onEnter()
TransitionFlipAngular* TransitionFlipAngular::create(float t, Scene* s, Orientation o)
{
TransitionFlipAngular* newScene = new TransitionFlipAngular();
TransitionFlipAngular* newScene = new (std::nothrow) TransitionFlipAngular();
newScene->initWithDuration(t, s, o);
newScene->autorelease();
@ -999,7 +999,7 @@ void TransitionZoomFlipX::onEnter()
TransitionZoomFlipX* TransitionZoomFlipX::create(float t, Scene* s, Orientation o)
{
TransitionZoomFlipX* newScene = new TransitionZoomFlipX();
TransitionZoomFlipX* newScene = new (std::nothrow) TransitionZoomFlipX();
newScene->initWithDuration(t, s, o);
newScene->autorelease();
@ -1078,7 +1078,7 @@ void TransitionZoomFlipY::onEnter()
TransitionZoomFlipY* TransitionZoomFlipY::create(float t, Scene* s, Orientation o)
{
TransitionZoomFlipY* newScene = new TransitionZoomFlipY();
TransitionZoomFlipY* newScene = new (std::nothrow) TransitionZoomFlipY();
newScene->initWithDuration(t, s, o);
newScene->autorelease();
@ -1159,7 +1159,7 @@ void TransitionZoomFlipAngular::onEnter()
TransitionZoomFlipAngular* TransitionZoomFlipAngular::create(float t, Scene* s, Orientation o)
{
TransitionZoomFlipAngular* newScene = new TransitionZoomFlipAngular();
TransitionZoomFlipAngular* newScene = new (std::nothrow) TransitionZoomFlipAngular();
newScene->initWithDuration(t, s, o);
newScene->autorelease();
@ -1183,7 +1183,7 @@ TransitionFade::~TransitionFade()
TransitionFade * TransitionFade::create(float duration, Scene *scene, const Color3B& color)
{
TransitionFade * transition = new TransitionFade();
TransitionFade * transition = new (std::nothrow) TransitionFade();
transition->initWithDuration(duration, scene, color);
transition->autorelease();
return transition;
@ -1252,7 +1252,7 @@ TransitionCrossFade::~TransitionCrossFade()
TransitionCrossFade* TransitionCrossFade::create(float t, Scene* scene)
{
TransitionCrossFade* newScene = new TransitionCrossFade();
TransitionCrossFade* newScene = new (std::nothrow) TransitionCrossFade();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -1363,7 +1363,7 @@ TransitionTurnOffTiles::~TransitionTurnOffTiles()
TransitionTurnOffTiles* TransitionTurnOffTiles::create(float t, Scene* scene)
{
TransitionTurnOffTiles* newScene = new TransitionTurnOffTiles();
TransitionTurnOffTiles* newScene = new (std::nothrow) TransitionTurnOffTiles();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -1448,7 +1448,7 @@ TransitionSplitCols::~TransitionSplitCols()
TransitionSplitCols* TransitionSplitCols::create(float t, Scene* scene)
{
TransitionSplitCols* newScene = new TransitionSplitCols();
TransitionSplitCols* newScene = new (std::nothrow) TransitionSplitCols();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -1534,7 +1534,7 @@ ActionInterval* TransitionSplitRows::action()
TransitionSplitRows* TransitionSplitRows::create(float t, Scene* scene)
{
TransitionSplitRows* newScene = new TransitionSplitRows();
TransitionSplitRows* newScene = new (std::nothrow) TransitionSplitRows();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -1559,7 +1559,7 @@ TransitionFadeTR::~TransitionFadeTR()
TransitionFadeTR* TransitionFadeTR::create(float t, Scene* scene)
{
TransitionFadeTR* newScene = new TransitionFadeTR();
TransitionFadeTR* newScene = new (std::nothrow) TransitionFadeTR();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -1647,7 +1647,7 @@ TransitionFadeBL::~TransitionFadeBL()
TransitionFadeBL* TransitionFadeBL::create(float t, Scene* scene)
{
TransitionFadeBL* newScene = new TransitionFadeBL();
TransitionFadeBL* newScene = new (std::nothrow) TransitionFadeBL();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -1675,7 +1675,7 @@ TransitionFadeUp::~TransitionFadeUp()
TransitionFadeUp* TransitionFadeUp::create(float t, Scene* scene)
{
TransitionFadeUp* newScene = new TransitionFadeUp();
TransitionFadeUp* newScene = new (std::nothrow) TransitionFadeUp();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -1702,7 +1702,7 @@ TransitionFadeDown::~TransitionFadeDown()
TransitionFadeDown* TransitionFadeDown::create(float t, Scene* scene)
{
TransitionFadeDown* newScene = new TransitionFadeDown();
TransitionFadeDown* newScene = new (std::nothrow) TransitionFadeDown();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();

View File

@ -53,7 +53,7 @@ TransitionPageTurn::~TransitionPageTurn()
/** creates a base transition with duration and incoming scene */
TransitionPageTurn * TransitionPageTurn::create(float t, Scene *scene, bool backwards)
{
TransitionPageTurn * transition = new TransitionPageTurn();
TransitionPageTurn * transition = new (std::nothrow) TransitionPageTurn();
transition->initWithDuration(t,scene,backwards);
transition->autorelease();
return transition;

View File

@ -49,7 +49,7 @@ TransitionProgress::TransitionProgress()
TransitionProgress* TransitionProgress::create(float t, Scene* scene)
{
TransitionProgress* newScene = new TransitionProgress();
TransitionProgress* newScene = new (std::nothrow) TransitionProgress();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -152,7 +152,7 @@ ProgressTimer* TransitionProgressRadialCCW::progressTimerNodeWithRenderTexture(R
TransitionProgressRadialCCW* TransitionProgressRadialCCW::create(float t, Scene* scene)
{
TransitionProgressRadialCCW* newScene = new TransitionProgressRadialCCW();
TransitionProgressRadialCCW* newScene = new (std::nothrow) TransitionProgressRadialCCW();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -165,7 +165,7 @@ TransitionProgressRadialCCW* TransitionProgressRadialCCW::create(float t, Scene*
// TransitionProgressRadialCW
TransitionProgressRadialCW* TransitionProgressRadialCW::create(float t, Scene* scene)
{
TransitionProgressRadialCW* newScene = new TransitionProgressRadialCW();
TransitionProgressRadialCW* newScene = new (std::nothrow) TransitionProgressRadialCW();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -197,7 +197,7 @@ ProgressTimer* TransitionProgressRadialCW::progressTimerNodeWithRenderTexture(Re
// TransitionProgressHorizontal
TransitionProgressHorizontal* TransitionProgressHorizontal::create(float t, Scene* scene)
{
TransitionProgressHorizontal* newScene = new TransitionProgressHorizontal();
TransitionProgressHorizontal* newScene = new (std::nothrow) TransitionProgressHorizontal();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -230,7 +230,7 @@ ProgressTimer* TransitionProgressHorizontal::progressTimerNodeWithRenderTexture(
// TransitionProgressVertical
TransitionProgressVertical* TransitionProgressVertical::create(float t, Scene* scene)
{
TransitionProgressVertical* newScene = new TransitionProgressVertical();
TransitionProgressVertical* newScene = new (std::nothrow) TransitionProgressVertical();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -264,7 +264,7 @@ ProgressTimer* TransitionProgressVertical::progressTimerNodeWithRenderTexture(Re
// TransitionProgressInOut
TransitionProgressInOut* TransitionProgressInOut::create(float t, Scene* scene)
{
TransitionProgressInOut* newScene = new TransitionProgressInOut();
TransitionProgressInOut* newScene = new (std::nothrow) TransitionProgressInOut();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();
@ -310,7 +310,7 @@ ProgressTimer* TransitionProgressInOut::progressTimerNodeWithRenderTexture(Rende
// TransitionProgressOutIn
TransitionProgressOutIn* TransitionProgressOutIn::create(float t, Scene* scene)
{
TransitionProgressOutIn* newScene = new TransitionProgressOutIn();
TransitionProgressOutIn* newScene = new (std::nothrow) TransitionProgressOutIn();
if(newScene && newScene->initWithDuration(t, scene))
{
newScene->autorelease();

View File

@ -36,7 +36,7 @@ NS_CC_BEGIN
//create Animate3D using Animation.
Animate3D* Animate3D::create(Animation3D* animation)
{
auto animate = new Animate3D();
auto animate = new (std::nothrow) Animate3D();
animate->_animation = animation;
animation->retain();

View File

@ -39,7 +39,7 @@ Animation3D* Animation3D::create(const std::string& fileName, const std::string&
return animation;
//load animation here
animation = new Animation3D();
animation = new (std::nothrow) Animation3D();
auto bundle = Bundle3D::getInstance();
Animation3DData animationdata;
if (bundle->load(fullPath) && bundle->loadAnimationData(animationName, &animationdata) && animation->init(animationdata))
@ -101,7 +101,7 @@ bool Animation3D::init(const Animation3DData &data)
Curve* curve = _boneCurves[iter.first];
if( curve == nullptr)
{
curve = new Curve();
curve = new (std::nothrow) Curve();
_boneCurves[iter.first] = curve;
}
@ -125,7 +125,7 @@ bool Animation3D::init(const Animation3DData &data)
Curve* curve = _boneCurves[iter.first];
if( curve == nullptr)
{
curve = new Curve();
curve = new (std::nothrow) Curve();
_boneCurves[iter.first] = curve;
}
@ -150,7 +150,7 @@ bool Animation3D::init(const Animation3DData &data)
Curve* curve = _boneCurves[iter.first];
if( curve == nullptr)
{
curve = new Curve();
curve = new (std::nothrow) Curve();
_boneCurves[iter.first] = curve;
}
@ -178,7 +178,7 @@ Animation3DCache* Animation3DCache::_cacheInstance = nullptr;
Animation3DCache* Animation3DCache::getInstance()
{
if (_cacheInstance == nullptr)
_cacheInstance = new Animation3DCache();
_cacheInstance = new (std::nothrow) Animation3DCache();
return _cacheInstance;
}

View File

@ -72,7 +72,7 @@ template <int componentSize>
AnimationCurve<componentSize>* AnimationCurve<componentSize>::create(float* keytime, float* value, int count)
{
int floatSize = sizeof(float);
AnimationCurve* curve = new AnimationCurve();
AnimationCurve* curve = new (std::nothrow) AnimationCurve();
curve->_keytime = new float[count];
memcpy(curve->_keytime, keytime, count * floatSize);

View File

@ -35,7 +35,7 @@ NS_CC_BEGIN
AttachNode* AttachNode::create(Bone3D* attachBone)
{
auto attachnode = new AttachNode();
auto attachnode = new (std::nothrow) AttachNode();
attachnode->_attachBone = attachBone;
attachnode->autorelease();

View File

@ -157,7 +157,7 @@ void Bundle3D::setBundleInstance(Bundle3D* bundleInstance)
Bundle3D* Bundle3D::getInstance()
{
if (_instance == nullptr)
_instance = new Bundle3D();
_instance = new (std::nothrow) Bundle3D();
return _instance;
}
@ -220,7 +220,7 @@ bool Bundle3D::loadObj(MeshDatas& meshdatas, MaterialDatas& materialdatas, NodeD
if (ret.empty())
{
//fill data
MeshData* meshdata = new MeshData();
MeshData* meshdata = new (std::nothrow) MeshData();
MeshVertexAttrib attrib;
attrib.size = 3;
attrib.type = GL_FLOAT;
@ -292,8 +292,8 @@ bool Bundle3D::loadObj(MeshDatas& meshdatas, MaterialDatas& materialdatas, NodeD
meshdata->subMeshIndices.push_back(it.mesh.indices);
meshdata->subMeshIds.push_back(str);
auto node = new NodeData();
auto modelnode = new ModelData();
auto node = new (std::nothrow) NodeData();
auto modelnode = new (std::nothrow) ModelData();
modelnode->matrialId = str;
modelnode->subMeshId = str;
node->id = it.name;
@ -410,7 +410,7 @@ bool Bundle3D::loadMeshDatasBinary(MeshDatas& meshdatas)
}
for(int i = 0; i < meshSize ; i++ )
{
MeshData* meshData = new MeshData();
MeshData* meshData = new (std::nothrow) MeshData();
unsigned int attribSize=0;
// read mesh data
if (_binaryReader.read(&attribSize, 4, 1) != 1 || attribSize < 1)
@ -486,7 +486,7 @@ bool Bundle3D::loadMeshDatasBinary_0_1(MeshDatas& meshdatas)
meshdatas.resetData();
MeshData* meshdata = new MeshData();
MeshData* meshdata = new (std::nothrow) MeshData();
// read mesh data
unsigned int attribSize=0;
@ -594,7 +594,7 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas)
meshdatas.resetData();
MeshData* meshdata = new MeshData();
MeshData* meshdata = new (std::nothrow) MeshData();
// read mesh data
unsigned int attribSize=0;
@ -706,7 +706,7 @@ bool Bundle3D::loadMeshDatasJson(MeshDatas& meshdatas)
const rapidjson::Value& mesh_data_array = _jsonReader[MESHES];
for (rapidjson::SizeType index = 0; index < mesh_data_array.Size(); index++)
{
MeshData* meshData = new MeshData();
MeshData* meshData = new (std::nothrow) MeshData();
const rapidjson::Value& mesh_data = mesh_data_array[index];
// mesh_vertex_attribute
const rapidjson::Value& mesh_vertex_attribute = mesh_data[ATTRIBUTES];
@ -761,19 +761,19 @@ bool Bundle3D::loadNodes(NodeDatas& nodedatas)
{
SkinData skinData;
loadSkinData("", &skinData);
auto nodeDatas = new NodeData*[skinData.skinBoneNames.size() + skinData.nodeBoneNames.size()];
auto nodeDatas = new (std::nothrow) NodeData*[skinData.skinBoneNames.size() + skinData.nodeBoneNames.size()];
int index = 0;
size_t i;
for (i = 0; i < skinData.skinBoneNames.size(); i++)
{
nodeDatas[index] = new NodeData();
nodeDatas[index] = new (std::nothrow) NodeData();
nodeDatas[index]->id = skinData.skinBoneNames[i];
nodeDatas[index]->transform = skinData.skinBoneOriginMatrices[i];
index++;
}
for (i = 0; i < skinData.nodeBoneNames.size(); i++)
{
nodeDatas[index] = new NodeData();
nodeDatas[index] = new (std::nothrow) NodeData();
nodeDatas[index]->id = skinData.nodeBoneNames[i];
nodeDatas[index]->transform = skinData.nodeBoneOriginMatrices[i];
index++;
@ -788,8 +788,8 @@ bool Bundle3D::loadNodes(NodeDatas& nodedatas)
}
}
nodedatas.skeleton.push_back(nodeDatas[skinData.rootBoneIndex]);
auto node= new NodeData();
auto modelnode = new ModelData();
auto node= new (std::nothrow) NodeData();
auto modelnode = new (std::nothrow) ModelData();
modelnode->matrialId = "";
modelnode->subMeshId = "";
modelnode->bones = skinData.skinBoneNames;
@ -1246,7 +1246,7 @@ bool Bundle3D::loadBinary(const std::string& path)
// get file data
CC_SAFE_DELETE(_binaryBuffer);
_binaryBuffer = new Data();
_binaryBuffer = new (std::nothrow) Data();
*_binaryBuffer = FileUtils::getInstance()->getDataFromFile(path);
if (_binaryBuffer->isNull())
{
@ -1289,7 +1289,7 @@ bool Bundle3D::loadBinary(const std::string& path)
// Read all refs
CC_SAFE_DELETE_ARRAY(_references);
_references = new Reference[_referenceCount];
_references = new (std::nothrow) Reference[_referenceCount];
for (ssize_t i = 0; i < _referenceCount; ++i)
{
if ((_references[i].id = _binaryReader.readString()).empty() ||
@ -1696,11 +1696,11 @@ bool Bundle3D::loadNodesJson(NodeDatas& nodedatas)
}
NodeData* Bundle3D::parseNodesRecursivelyJson(const rapidjson::Value& jvalue)
{
NodeData* nodedata = new NodeData();;
NodeData* nodedata = new (std::nothrow) NodeData();;
//if (jvalue.HasMember(PARTS))
// nodedata = new ModelNodeData();
// nodedata = new (std::nothrow) ModelNodeData();
//else
//nodedata = new NodeData();
//nodedata = new (std::nothrow) NodeData();
// id
nodedata->id = jvalue[ID].GetString();
@ -1724,7 +1724,7 @@ NodeData* Bundle3D::parseNodesRecursivelyJson(const rapidjson::Value& jvalue)
for (rapidjson::SizeType i = 0; i < parts.Size(); i++)
{
auto modelnodedata = new ModelData();;
auto modelnodedata = new (std::nothrow) ModelData();;
const rapidjson::Value& part = parts[i];
modelnodedata->subMeshId = part[MESHPARTID].GetString();
modelnodedata->matrialId = part[MATERIALID].GetString();
@ -1837,14 +1837,14 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton)
return nullptr;
}
NodeData* nodedata = new NodeData();
NodeData* nodedata = new (std::nothrow) NodeData();
nodedata->id = id;
nodedata->transform = transform;
if (partsSize > 0)
{
for (rapidjson::SizeType i = 0; i < partsSize; i++)
{
auto modelnodedata = new ModelData();
auto modelnodedata = new (std::nothrow) ModelData();
modelnodedata->subMeshId = _binaryReader.readString();
modelnodedata->matrialId = _binaryReader.readString();
@ -1907,7 +1907,7 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton)
}
//else
//{
// nodedata = new NodeData();
// nodedata = new (std::nothrow) NodeData();
// nodedata->id = id;
// nodedata->transform = transform;
//}

View File

@ -166,7 +166,7 @@ Mesh* Mesh::create(const std::vector<float>& vertices, int perVertexSizeInFloat,
Mesh* Mesh::create(const std::string& name, MeshIndexData* indexData, MeshSkin* skin)
{
auto state = new Mesh();
auto state = new (std::nothrow) Mesh();
state->autorelease();
state->bindMeshCommand();
state->_name = name;

View File

@ -50,7 +50,7 @@ MeshSkin::~MeshSkin()
MeshSkin* MeshSkin::create(Skeleton3D* skeleton, const std::vector<std::string>& boneNames, const std::vector<Mat4>& invBindPose)
{
auto skin = new MeshSkin();
auto skin = new (std::nothrow) MeshSkin();
skin->_skeleton = skeleton;
skeleton->retain();
@ -104,7 +104,7 @@ Vec4* MeshSkin::getMatrixPalette()
{
if (_matrixPalette == nullptr)
{
_matrixPalette = new Vec4[_skinBones.size() * PALETTE_ROWS];
_matrixPalette = new (std::nothrow) Vec4[_skinBones.size() * PALETTE_ROWS];
}
int i = 0, paletteIndex = 0;
static Mat4 t;

View File

@ -49,7 +49,7 @@ NS_CC_BEGIN
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
MeshIndexData* MeshIndexData::create(const std::string& id, MeshVertexData* vertexData, IndexBuffer* indexbuffer, const AABB& aabb)
{
auto meshindex = new MeshIndexData();
auto meshindex = new (std::nothrow) MeshIndexData();
meshindex->_id = id;
meshindex->_indexBuffer = indexbuffer;
@ -82,7 +82,7 @@ MeshIndexData::~MeshIndexData()
MeshVertexData* MeshVertexData::create(const MeshData& meshdata)
{
auto vertexdata = new MeshVertexData();
auto vertexdata = new (std::nothrow) MeshVertexData();
int pervertexsize = meshdata.getPerVertexSize();
vertexdata->_vertexBuffer = VertexBuffer::create(pervertexsize, (int)(meshdata.vertex.size() / (pervertexsize / 4)));
vertexdata->_vertexData = VertexData::create();

View File

@ -137,7 +137,7 @@ void Bone3D::clearBoneBlendState()
*/
Bone3D* Bone3D::create(const std::string& id)
{
auto bone = new Bone3D(id);
auto bone = new (std::nothrow) Bone3D(id);
bone->autorelease();
return bone;
}
@ -260,7 +260,7 @@ Skeleton3D::~Skeleton3D()
Skeleton3D* Skeleton3D::create(const std::vector<NodeData*>& skeletondata)
{
auto skeleton = new Skeleton3D();
auto skeleton = new (std::nothrow) Skeleton3D();
for (const auto& it : skeletondata) {
auto bone = skeleton->createBone3D(*it);
bone->resetPose();

View File

@ -50,7 +50,7 @@ Sprite3D* Sprite3D::create(const std::string &modelPath)
if (modelPath.length() < 4)
CCASSERT(false, "improper name specified when creating Sprite3D");
auto sprite = new Sprite3D();
auto sprite = new (std::nothrow) Sprite3D();
if (sprite && sprite->initWithFile(modelPath))
{
sprite->autorelease();
@ -102,13 +102,13 @@ bool Sprite3D::loadFromObj(const std::string& path)
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(path);
MeshDatas meshdatas;
MaterialDatas* materialdatas = new MaterialDatas();
NodeDatas* nodeDatas = new NodeDatas();
MaterialDatas* materialdatas = new (std::nothrow) MaterialDatas();
NodeDatas* nodeDatas = new (std::nothrow) NodeDatas();
bool ret = Bundle3D::loadObj(meshdatas, *materialdatas, *nodeDatas, fullPath);
if (ret && initFrom(*nodeDatas, meshdatas, *materialdatas))
{
//add to cache
auto data = new Sprite3DCache::Sprite3DData();
auto data = new (std::nothrow) Sprite3DCache::Sprite3DData();
data->materialdatas = materialdatas;
data->nodedatas = nodeDatas;
data->meshVertexDatas = _meshVertexDatas;
@ -130,15 +130,15 @@ bool Sprite3D::loadFromC3x(const std::string& path)
return false;
MeshDatas meshdatas;
MaterialDatas* materialdatas = new MaterialDatas();
NodeDatas* nodeDatas = new NodeDatas();
MaterialDatas* materialdatas = new (std::nothrow) MaterialDatas();
NodeDatas* nodeDatas = new (std::nothrow) NodeDatas();
if (bundle->loadMeshDatas(meshdatas)
&& bundle->loadMaterials(*materialdatas)
&& bundle->loadNodes(*nodeDatas)
&& initFrom(*nodeDatas, meshdatas, *materialdatas))
{
//add to cache
auto data = new Sprite3DCache::Sprite3DData();
auto data = new (std::nothrow) Sprite3DCache::Sprite3DData();
data->materialdatas = materialdatas;
data->nodedatas = nodeDatas;
data->meshVertexDatas = _meshVertexDatas;
@ -228,7 +228,7 @@ bool Sprite3D::initFrom(const NodeDatas& nodeDatas, const MeshDatas& meshdatas,
}
Sprite3D* Sprite3D::createSprite3DNode(NodeData* nodedata,ModelData* modeldata,const MaterialDatas& matrialdatas)
{
auto sprite = new Sprite3D();
auto sprite = new (std::nothrow) Sprite3D();
if (sprite)
{
auto mesh = Mesh::create(nodedata->id, getMeshIndexData(modeldata->subMeshId));
@ -617,7 +617,7 @@ Sprite3DCache* Sprite3DCache::_cacheInstance = nullptr;
Sprite3DCache* Sprite3DCache::getInstance()
{
if (_cacheInstance == nullptr)
_cacheInstance = new Sprite3DCache();
_cacheInstance = new (std::nothrow) Sprite3DCache();
return _cacheInstance;
}
void Sprite3DCache::destroyInstance()

View File

@ -50,7 +50,7 @@ Sprite3DMaterialCache* Sprite3DMaterialCache::getInstance()
{
if (! _cacheInstance)
{
_cacheInstance = new Sprite3DMaterialCache();
_cacheInstance = new (std::nothrow) Sprite3DMaterialCache();
}
return _cacheInstance;

View File

@ -157,7 +157,7 @@ SimpleAudioEngine* SimpleAudioEngine::getInstance()
{
if (! s_pEngine)
{
s_pEngine = new SimpleAudioEngine();
s_pEngine = new (std::nothrow) SimpleAudioEngine();
}
return s_pEngine;

View File

@ -159,7 +159,7 @@ SimpleAudioEngine* SimpleAudioEngine::getInstance()
{
if (! s_pEngine)
{
s_pEngine = new SimpleAudioEngine();
s_pEngine = new (std::nothrow) SimpleAudioEngine();
}
return s_pEngine;

View File

@ -109,7 +109,7 @@ PoolManager* PoolManager::getInstance()
{
if (s_singleInstance == nullptr)
{
s_singleInstance = new PoolManager();
s_singleInstance = new (std::nothrow) PoolManager();
// Add the first auto release pool
new AutoreleasePool("cocos2d autorelease pool");
}

View File

@ -33,7 +33,7 @@ Camera* Camera::_visitingCamera = nullptr;
Camera* Camera::create()
{
Camera* camera = new Camera();
Camera* camera = new (std::nothrow) Camera();
camera->initDefault();
camera->autorelease();
@ -42,7 +42,7 @@ Camera* Camera::create()
Camera* Camera::createPerspective(float fieldOfView, float aspectRatio, float nearPlane, float farPlane)
{
auto ret = new Camera();
auto ret = new (std::nothrow) Camera();
if (ret)
{
ret->initPerspective(fieldOfView, aspectRatio, nearPlane, farPlane);
@ -55,7 +55,7 @@ Camera* Camera::createPerspective(float fieldOfView, float aspectRatio, float ne
Camera* Camera::createOrthographic(float zoomX, float zoomY, float nearPlane, float farPlane)
{
auto ret = new Camera();
auto ret = new (std::nothrow) Camera();
if (ret)
{
ret->initOrthographic(zoomX, zoomY, nearPlane, farPlane);

View File

@ -149,7 +149,7 @@ Configuration* Configuration::getInstance()
{
if (! s_sharedConfiguration)
{
s_sharedConfiguration = new Configuration();
s_sharedConfiguration = new (std::nothrow) Configuration();
s_sharedConfiguration->init();
}

View File

@ -120,7 +120,7 @@ void Controller::startDiscoveryController()
[[GCControllerConnectionEventHandler getInstance] observerConnection: ^(GCController* gcController) {
auto controller = new Controller();
auto controller = new (std::nothrow) Controller();
controller->_impl->_gcController = gcController;
controller->_deviceName = [gcController.vendorName UTF8String];

View File

@ -61,9 +61,9 @@ void Controller::init()
}
_eventDispatcher = Director::getInstance()->getEventDispatcher();
_connectEvent = new EventController(EventController::ControllerEventType::CONNECTION, this, false);
_keyEvent = new EventController(EventController::ControllerEventType::BUTTON_STATUS_CHANGED, this, 0);
_axisEvent = new EventController(EventController::ControllerEventType::AXIS_STATUS_CHANGED, this, 0);
_connectEvent = new (std::nothrow) EventController(EventController::ControllerEventType::CONNECTION, this, false);
_keyEvent = new (std::nothrow) EventController(EventController::ControllerEventType::BUTTON_STATUS_CHANGED, this, 0);
_axisEvent = new (std::nothrow) EventController(EventController::ControllerEventType::AXIS_STATUS_CHANGED, this, 0);
}
const Controller::KeyStatus& Controller::getKeyStatus(int keyCode)

View File

@ -137,19 +137,19 @@ bool Director::init(void)
_contentScaleFactor = 1.0f;
// scheduler
_scheduler = new Scheduler();
_scheduler = new (std::nothrow) Scheduler();
// action manager
_actionManager = new ActionManager();
_actionManager = new (std::nothrow) ActionManager();
_scheduler->scheduleUpdate(_actionManager, Scheduler::PRIORITY_SYSTEM, false);
_eventDispatcher = new EventDispatcher();
_eventAfterDraw = new EventCustom(EVENT_AFTER_DRAW);
_eventDispatcher = new (std::nothrow) EventDispatcher();
_eventAfterDraw = new (std::nothrow) EventCustom(EVENT_AFTER_DRAW);
_eventAfterDraw->setUserData(this);
_eventAfterVisit = new EventCustom(EVENT_AFTER_VISIT);
_eventAfterVisit = new (std::nothrow) EventCustom(EVENT_AFTER_VISIT);
_eventAfterVisit->setUserData(this);
_eventAfterUpdate = new EventCustom(EVENT_AFTER_UPDATE);
_eventAfterUpdate = new (std::nothrow) EventCustom(EVENT_AFTER_UPDATE);
_eventAfterUpdate->setUserData(this);
_eventProjectionChanged = new EventCustom(EVENT_PROJECTION_CHANGED);
_eventProjectionChanged = new (std::nothrow) EventCustom(EVENT_PROJECTION_CHANGED);
_eventProjectionChanged->setUserData(this);
@ -157,10 +157,10 @@ bool Director::init(void)
initTextureCache();
initMatrixStack();
_renderer = new Renderer;
_renderer = new (std::nothrow) Renderer;
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
_console = new Console;
_console = new (std::nothrow) Console;
#endif
return true;
}
@ -438,9 +438,9 @@ TextureCache* Director::getTextureCache() const
void Director::initTextureCache()
{
#ifdef EMSCRIPTEN
_textureCache = new TextureCacheEmscripten();
_textureCache = new (std::nothrow) TextureCacheEmscripten();
#else
_textureCache = new TextureCache();
_textureCache = new (std::nothrow) TextureCache();
#endif // EMSCRIPTEN
}
@ -1188,7 +1188,7 @@ void Director::createStatsLabel()
ssize_t dataLength = 0;
getFPSImageData(&data, &dataLength);
Image* image = new Image();
Image* image = new (std::nothrow) Image();
bool isOK = image->initWithImageData(data, dataLength);
if (! isOK) {
CCLOGERROR("%s", "Fails: init fps_images");

View File

@ -461,7 +461,7 @@ void EventDispatcher::forceAddEventListener(EventListener* listener)
if (itr == _listenerMap.end())
{
listeners = new EventListenerVector();
listeners = new (std::nothrow) EventListenerVector();
_listenerMap.insert(std::make_pair(listenerID, listeners));
}
else

View File

@ -41,7 +41,7 @@ EventListenerAcceleration::~EventListenerAcceleration()
EventListenerAcceleration* EventListenerAcceleration::create(const std::function<void(Acceleration*, Event*)>& callback)
{
EventListenerAcceleration* ret = new EventListenerAcceleration();
EventListenerAcceleration* ret = new (std::nothrow) EventListenerAcceleration();
if (ret && ret->init(callback))
{
ret->autorelease();
@ -72,7 +72,7 @@ bool EventListenerAcceleration::init(const std::function<void(Acceleration*, Eve
EventListenerAcceleration* EventListenerAcceleration::clone()
{
auto ret = new EventListenerAcceleration();
auto ret = new (std::nothrow) EventListenerAcceleration();
if (ret && ret->init(onAccelerationEvent))
{

View File

@ -34,7 +34,7 @@ const std::string EventListenerController::LISTENER_ID = "__cc_controller";
EventListenerController* EventListenerController::create()
{
auto ret = new EventListenerController();
auto ret = new (std::nothrow) EventListenerController();
if (ret && ret->init())
{
ret->autorelease();

View File

@ -34,7 +34,7 @@ EventListenerCustom::EventListenerCustom()
EventListenerCustom* EventListenerCustom::create(const std::string& eventName, const std::function<void(EventCustom*)>& callback)
{
EventListenerCustom* ret = new EventListenerCustom();
EventListenerCustom* ret = new (std::nothrow) EventListenerCustom();
if (ret && ret->init(eventName, callback))
{
ret->autorelease();
@ -68,7 +68,7 @@ bool EventListenerCustom::init(const ListenerID& listenerId, const std::function
EventListenerCustom* EventListenerCustom::clone()
{
EventListenerCustom* ret = new EventListenerCustom();
EventListenerCustom* ret = new (std::nothrow) EventListenerCustom();
if (ret && ret->init(_listenerID, _onCustomEvent))
{
ret->autorelease();

View File

@ -46,7 +46,7 @@ EventListenerFocus::~EventListenerFocus()
EventListenerFocus* EventListenerFocus::create()
{
EventListenerFocus* ret = new EventListenerFocus;
EventListenerFocus* ret = new (std::nothrow) EventListenerFocus;
if (ret && ret->init()) {
ret->autorelease();
return ret;
@ -57,7 +57,7 @@ EventListenerFocus* EventListenerFocus::create()
EventListenerFocus* EventListenerFocus::clone()
{
EventListenerFocus* ret = new EventListenerFocus;
EventListenerFocus* ret = new (std::nothrow) EventListenerFocus;
if (ret && ret->init()) {
ret->autorelease();

View File

@ -44,7 +44,7 @@ bool EventListenerKeyboard::checkAvailable()
EventListenerKeyboard* EventListenerKeyboard::create()
{
auto ret = new EventListenerKeyboard();
auto ret = new (std::nothrow) EventListenerKeyboard();
if (ret && ret->init())
{
ret->autorelease();
@ -58,7 +58,7 @@ EventListenerKeyboard* EventListenerKeyboard::create()
EventListenerKeyboard* EventListenerKeyboard::clone()
{
auto ret = new EventListenerKeyboard();
auto ret = new (std::nothrow) EventListenerKeyboard();
if (ret && ret->init())
{
ret->autorelease();

View File

@ -36,7 +36,7 @@ bool EventListenerMouse::checkAvailable()
EventListenerMouse* EventListenerMouse::create()
{
auto ret = new EventListenerMouse();
auto ret = new (std::nothrow) EventListenerMouse();
if (ret && ret->init())
{
ret->autorelease();
@ -50,7 +50,7 @@ EventListenerMouse* EventListenerMouse::create()
EventListenerMouse* EventListenerMouse::clone()
{
auto ret = new EventListenerMouse();
auto ret = new (std::nothrow) EventListenerMouse();
if (ret && ret->init())
{
ret->autorelease();

View File

@ -68,7 +68,7 @@ bool EventListenerTouchOneByOne::isSwallowTouches()
EventListenerTouchOneByOne* EventListenerTouchOneByOne::create()
{
auto ret = new EventListenerTouchOneByOne();
auto ret = new (std::nothrow) EventListenerTouchOneByOne();
if (ret && ret->init())
{
ret->autorelease();
@ -95,7 +95,7 @@ bool EventListenerTouchOneByOne::checkAvailable()
EventListenerTouchOneByOne* EventListenerTouchOneByOne::clone()
{
auto ret = new EventListenerTouchOneByOne();
auto ret = new (std::nothrow) EventListenerTouchOneByOne();
if (ret && ret->init())
{
ret->autorelease();
@ -144,7 +144,7 @@ bool EventListenerTouchAllAtOnce::init()
EventListenerTouchAllAtOnce* EventListenerTouchAllAtOnce::create()
{
auto ret = new EventListenerTouchAllAtOnce();
auto ret = new (std::nothrow) EventListenerTouchAllAtOnce();
if (ret && ret->init())
{
ret->autorelease();
@ -170,7 +170,7 @@ bool EventListenerTouchAllAtOnce::checkAvailable()
EventListenerTouchAllAtOnce* EventListenerTouchAllAtOnce::clone()
{
auto ret = new EventListenerTouchAllAtOnce();
auto ret = new (std::nothrow) EventListenerTouchAllAtOnce();
if (ret && ret->init())
{
ret->autorelease();

View File

@ -44,7 +44,7 @@ Profiler* Profiler::getInstance()
{
if (! g_sSharedProfiler)
{
g_sSharedProfiler = new Profiler();
g_sSharedProfiler = new (std::nothrow) Profiler();
g_sSharedProfiler->init();
}
@ -59,7 +59,7 @@ Profiler* Profiler::sharedProfiler(void)
ProfilingTimer* Profiler::createAndAddTimerWithName(const char* timerName)
{
ProfilingTimer *t = new ProfilingTimer();
ProfilingTimer *t = new (std::nothrow) ProfilingTimer();
t->initWithName(timerName);
_activeTimers.insert(timerName, t);
t->release();

View File

@ -323,7 +323,7 @@ void Scheduler::schedule(const ccSchedulerFunc& callback, void *target, float in
ccArrayEnsureExtraCapacity(element->timers, 1);
}
TimerTargetCallback *timer = new TimerTargetCallback();
TimerTargetCallback *timer = new (std::nothrow) TimerTargetCallback();
timer->initWithCallback(this, callback, target, key, interval, repeat, delay);
ccArrayAppendObject(element->timers, timer);
timer->release();
@ -1023,7 +1023,7 @@ void Scheduler::schedule(SEL_SCHEDULE selector, Ref *target, float interval, uns
ccArrayEnsureExtraCapacity(element->timers, 1);
}
TimerTargetSelector *timer = new TimerTargetSelector();
TimerTargetSelector *timer = new (std::nothrow) TimerTargetSelector();
timer->initWithSelector(this, selector, target, interval, repeat, delay);
ccArrayAppendObject(element->timers, timer);
timer->release();

View File

@ -47,7 +47,7 @@ NS_CC_BEGIN
ScriptHandlerEntry* ScriptHandlerEntry::create(int handler)
{
ScriptHandlerEntry* entry = new ScriptHandlerEntry(handler);
ScriptHandlerEntry* entry = new (std::nothrow) ScriptHandlerEntry(handler);
entry->autorelease();
return entry;
}
@ -67,7 +67,7 @@ ScriptHandlerEntry::~ScriptHandlerEntry(void)
SchedulerScriptHandlerEntry* SchedulerScriptHandlerEntry::create(int handler, float interval, bool paused)
{
SchedulerScriptHandlerEntry* entry = new SchedulerScriptHandlerEntry(handler);
SchedulerScriptHandlerEntry* entry = new (std::nothrow) SchedulerScriptHandlerEntry(handler);
entry->init(interval, paused);
entry->autorelease();
return entry;
@ -75,7 +75,7 @@ SchedulerScriptHandlerEntry* SchedulerScriptHandlerEntry::create(int handler, fl
bool SchedulerScriptHandlerEntry::init(float interval, bool paused)
{
_timer = new TimerScriptHandler();
_timer = new (std::nothrow) TimerScriptHandler();
_timer->initWithScriptHandler(_handler, interval);
_paused = paused;
LUALOG("[LUA] ADD script schedule: %d, entryID: %d", _handler, _entryId);
@ -97,7 +97,7 @@ TouchScriptHandlerEntry* TouchScriptHandlerEntry::create(int handler,
int priority,
bool swallowsTouches)
{
TouchScriptHandlerEntry* entry = new TouchScriptHandlerEntry(handler);
TouchScriptHandlerEntry* entry = new (std::nothrow) TouchScriptHandlerEntry(handler);
entry->init(isMultiTouches, priority, swallowsTouches);
entry->autorelease();
return entry;
@ -149,7 +149,7 @@ ScriptEngineManager* ScriptEngineManager::getInstance()
{
if (!s_pSharedScriptEngineManager)
{
s_pSharedScriptEngineManager = new ScriptEngineManager();
s_pSharedScriptEngineManager = new (std::nothrow) ScriptEngineManager();
}
return s_pSharedScriptEngineManager;
}

View File

@ -417,7 +417,7 @@ UserDefault* UserDefault::getInstance()
if (! _userDefault)
{
_userDefault = new UserDefault();
_userDefault = new (std::nothrow) UserDefault();
}
return _userDefault;

View File

@ -479,7 +479,7 @@ UserDefault* UserDefault::getInstance()
if (! _userDefault)
{
_userDefault = new UserDefault();
_userDefault = new (std::nothrow) UserDefault();
}
return _userDefault;

View File

@ -482,7 +482,7 @@ UserDefault* UserDefault::getInstance()
if (! _userDefault)
{
_userDefault = new UserDefault();
_userDefault = new (std::nothrow) UserDefault();
}
return _userDefault;

View File

@ -91,42 +91,42 @@ Value::Value(const std::string& v)
Value::Value(const ValueVector& v)
: _type(Type::VECTOR)
{
_field.vectorVal = new ValueVector();
_field.vectorVal = new (std::nothrow) ValueVector();
*_field.vectorVal = v;
}
Value::Value(ValueVector&& v)
: _type(Type::VECTOR)
{
_field.vectorVal = new ValueVector();
_field.vectorVal = new (std::nothrow) ValueVector();
*_field.vectorVal = std::move(v);
}
Value::Value(const ValueMap& v)
: _type(Type::MAP)
{
_field.mapVal = new ValueMap();
_field.mapVal = new (std::nothrow) ValueMap();
*_field.mapVal = v;
}
Value::Value(ValueMap&& v)
: _type(Type::MAP)
{
_field.mapVal = new ValueMap();
_field.mapVal = new (std::nothrow) ValueMap();
*_field.mapVal = std::move(v);
}
Value::Value(const ValueMapIntKey& v)
: _type(Type::INT_KEY_MAP)
{
_field.intKeyMapVal = new ValueMapIntKey();
_field.intKeyMapVal = new (std::nothrow) ValueMapIntKey();
*_field.intKeyMapVal = v;
}
Value::Value(ValueMapIntKey&& v)
: _type(Type::INT_KEY_MAP)
{
_field.intKeyMapVal = new ValueMapIntKey();
_field.intKeyMapVal = new (std::nothrow) ValueMapIntKey();
*_field.intKeyMapVal = std::move(v);
}
@ -178,21 +178,21 @@ Value& Value::operator= (const Value& other)
case Type::VECTOR:
if (_field.vectorVal == nullptr)
{
_field.vectorVal = new ValueVector();
_field.vectorVal = new (std::nothrow) ValueVector();
}
*_field.vectorVal = *other._field.vectorVal;
break;
case Type::MAP:
if (_field.mapVal == nullptr)
{
_field.mapVal = new ValueMap();
_field.mapVal = new (std::nothrow) ValueMap();
}
*_field.mapVal = *other._field.mapVal;
break;
case Type::INT_KEY_MAP:
if (_field.intKeyMapVal == nullptr)
{
_field.intKeyMapVal = new ValueMapIntKey();
_field.intKeyMapVal = new (std::nothrow) ValueMapIntKey();
}
*_field.intKeyMapVal = *other._field.intKeyMapVal;
break;
@ -816,13 +816,13 @@ void Value::reset(Type type)
_field.strVal = new std::string();
break;
case Type::VECTOR:
_field.vectorVal = new ValueVector();
_field.vectorVal = new (std::nothrow) ValueVector();
break;
case Type::MAP:
_field.mapVal = new ValueMap();
_field.mapVal = new (std::nothrow) ValueMap();
break;
case Type::INT_KEY_MAP:
_field.intKeyMapVal = new ValueMapIntKey();
_field.intKeyMapVal = new (std::nothrow) ValueMapIntKey();
break;
default:
break;

View File

@ -76,7 +76,7 @@ ObjectFactory* ObjectFactory::getInstance()
{
if ( nullptr == _sharedFactory)
{
_sharedFactory = new ObjectFactory();
_sharedFactory = new (std::nothrow) ObjectFactory();
}
return _sharedFactory;
}

View File

@ -51,7 +51,7 @@ class RCPtr
{
public:
//Construct using a C pointer
//e.g. RCPtr< T > x = new T();
//e.g. RCPtr< T > x = new (std::nothrow) T();
RCPtr(T* ptr = nullptr)
: _ptr(ptr)
{
@ -81,7 +81,7 @@ public:
}
//Assign a pointer
//e.g. x = new T();
//e.g. x = new (std::nothrow) T();
RCPtr &operator=(T* ptr)
{
// printf("Array: operator= T*: %p\n", this);

View File

@ -298,14 +298,14 @@ void __Dictionary::removeObjectForKey(intptr_t key)
void __Dictionary::setObjectUnSafe(Ref* pObject, const std::string& key)
{
pObject->retain();
DictElement* pElement = new DictElement(key.c_str(), pObject);
DictElement* pElement = new (std::nothrow) DictElement(key.c_str(), pObject);
HASH_ADD_STR(_elements, _strKey, pElement);
}
void __Dictionary::setObjectUnSafe(Ref* pObject, const intptr_t key)
{
pObject->retain();
DictElement* pElement = new DictElement(key, pObject);
DictElement* pElement = new (std::nothrow) DictElement(key, pObject);
HASH_ADD_PTR(_elements, _intKey, pElement);
}

View File

@ -104,7 +104,7 @@ void __NotificationCenter::addObserver(Ref *target,
if (this->observerExisted(target, name, sender))
return;
NotificationObserver *observer = new NotificationObserver(target, selector, name, sender);
NotificationObserver *observer = new (std::nothrow) NotificationObserver(target, selector, name, sender);
if (!observer)
return;
@ -156,7 +156,7 @@ void __NotificationCenter::registerScriptObserver(Ref *target, int handler,const
if (this->observerExisted(target, name, nullptr))
return;
NotificationObserver *observer = new NotificationObserver(target, nullptr, name, nullptr);
NotificationObserver *observer = new (std::nothrow) NotificationObserver(target, nullptr, name, nullptr);
if (!observer)
return;

View File

@ -426,7 +426,7 @@ void CCBAnimationManager::setAnimatedProperty(const std::string& propName, Node
if (fTweenDuration > 0)
{
// Create a fake keyframe to generate the action from
CCBKeyframe *kf1 = new CCBKeyframe();
CCBKeyframe *kf1 = new (std::nothrow) CCBKeyframe();
kf1->autorelease();
kf1->setObject(obj);
@ -957,7 +957,7 @@ void CCBAnimationManager::sequenceCompleted()
CCBSetSpriteFrame* CCBSetSpriteFrame::create(SpriteFrame *pSpriteFrame)
{
CCBSetSpriteFrame *ret = new CCBSetSpriteFrame();
CCBSetSpriteFrame *ret = new (std::nothrow) CCBSetSpriteFrame();
if (ret)
{
if (ret->initWithSpriteFrame(pSpriteFrame))
@ -989,7 +989,7 @@ CCBSetSpriteFrame::~CCBSetSpriteFrame()
CCBSetSpriteFrame* CCBSetSpriteFrame::clone() const
{
// no copy constructor
auto a = new CCBSetSpriteFrame();
auto a = new (std::nothrow) CCBSetSpriteFrame();
a->initWithSpriteFrame(_spriteFrame);
a->autorelease();
return a;
@ -1012,7 +1012,7 @@ void CCBSetSpriteFrame::update(float time)
************************************************************/
CCBSoundEffect* CCBSoundEffect::actionWithSoundFile(const std::string &filename, float pitch, float pan, float gain) {
CCBSoundEffect* pRet = new CCBSoundEffect();
CCBSoundEffect* pRet = new (std::nothrow) CCBSoundEffect();
if (pRet != nullptr && pRet->initWithSoundFile(filename, pitch, pan, gain))
{
pRet->autorelease();
@ -1040,7 +1040,7 @@ bool CCBSoundEffect::initWithSoundFile(const std::string &filename, float pitch,
CCBSoundEffect* CCBSoundEffect::clone() const
{
// no copy constructor
auto a = new CCBSoundEffect();
auto a = new (std::nothrow) CCBSoundEffect();
a->initWithSoundFile(_soundFile, _pitch, _pan, _gain);
a->autorelease();
return a;
@ -1064,7 +1064,7 @@ void CCBSoundEffect::update(float time)
CCBRotateTo* CCBRotateTo::create(float fDuration, float fAngle)
{
CCBRotateTo *ret = new CCBRotateTo();
CCBRotateTo *ret = new (std::nothrow) CCBRotateTo();
if (ret)
{
if (ret->initWithDuration(fDuration, fAngle))
@ -1097,7 +1097,7 @@ bool CCBRotateTo::initWithDuration(float fDuration, float fAngle)
CCBRotateTo* CCBRotateTo::clone() const
{
// no copy constructor
auto a = new CCBRotateTo();
auto a = new (std::nothrow) CCBRotateTo();
a->initWithDuration(_duration, _dstAngle);
a->autorelease();
return a;
@ -1132,7 +1132,7 @@ void CCBRotateTo::update(float time)
CCBRotateXTo* CCBRotateXTo::create(float fDuration, float fAngle)
{
CCBRotateXTo *ret = new CCBRotateXTo();
CCBRotateXTo *ret = new (std::nothrow) CCBRotateXTo();
if (ret)
{
if (ret->initWithDuration(fDuration, fAngle))
@ -1177,7 +1177,7 @@ void CCBRotateXTo::startWithTarget(Node *pNode)
CCBRotateXTo* CCBRotateXTo::clone() const
{
// no copy constructor
auto a = new CCBRotateXTo();
auto a = new (std::nothrow) CCBRotateXTo();
a->initWithDuration(_duration, _dstAngle);
a->autorelease();
return a;
@ -1204,7 +1204,7 @@ void CCBRotateXTo::update(float time)
CCBRotateYTo* CCBRotateYTo::create(float fDuration, float fAngle)
{
CCBRotateYTo *ret = new CCBRotateYTo();
CCBRotateYTo *ret = new (std::nothrow) CCBRotateYTo();
if (ret)
{
if (ret->initWithDuration(fDuration, fAngle))
@ -1237,7 +1237,7 @@ bool CCBRotateYTo::initWithDuration(float fDuration, float fAngle)
CCBRotateYTo* CCBRotateYTo::clone() const
{
// no copy constructor
auto a = new CCBRotateYTo();
auto a = new (std::nothrow) CCBRotateYTo();
a->initWithDuration(_duration, _dstAngle);
a->autorelease();
return a;
@ -1273,7 +1273,7 @@ void CCBRotateYTo::update(float time)
************************************************************/
CCBEaseInstant* CCBEaseInstant::create(ActionInterval *pAction)
{
CCBEaseInstant *pRet = new CCBEaseInstant();
CCBEaseInstant *pRet = new (std::nothrow) CCBEaseInstant();
if (pRet && pRet->initWithAction(pAction))
{
pRet->autorelease();
@ -1289,7 +1289,7 @@ CCBEaseInstant* CCBEaseInstant::create(ActionInterval *pAction)
CCBEaseInstant* CCBEaseInstant::clone() const
{
// no copy constructor
auto a = new CCBEaseInstant();
auto a = new (std::nothrow) CCBEaseInstant();
a->initWithAction(_inner);
a->autorelease();
return a;

View File

@ -31,7 +31,7 @@ CCBFile::CCBFile():_CCBFileNode(nullptr) {}
CCBFile* CCBFile::create()
{
CCBFile *ret = new CCBFile();
CCBFile *ret = new (std::nothrow) CCBFile();
if (ret)
{
@ -140,7 +140,7 @@ const std::string& CCBReader::getCCBRootPath() const
bool CCBReader::init()
{
// Setup action manager
CCBAnimationManager *pActionManager = new CCBAnimationManager();
CCBAnimationManager *pActionManager = new (std::nothrow) CCBAnimationManager();
setAnimationManager(pActionManager);
pActionManager->release();
@ -561,7 +561,7 @@ Node * CCBReader::readNodeGraph(Node * pParent)
for (int j = 0; j < numProps; ++j)
{
CCBSequenceProperty *seqProp = new CCBSequenceProperty();
CCBSequenceProperty *seqProp = new (std::nothrow) CCBSequenceProperty();
seqProp->autorelease();
seqProp->setName(readCachedString().c_str());
@ -731,7 +731,7 @@ Node * CCBReader::readNodeGraph(Node * pParent)
CCBKeyframe* CCBReader::readKeyframe(PropertyType type)
{
CCBKeyframe *keyframe = new CCBKeyframe();
CCBKeyframe *keyframe = new (std::nothrow) CCBKeyframe();
keyframe->autorelease();
keyframe->setTime(readFloat());
@ -835,7 +835,7 @@ bool CCBReader::readCallbackKeyframesForSeq(CCBSequence* seq)
int numKeyframes = readInt(false);
if(!numKeyframes) return true;
CCBSequenceProperty* channel = new CCBSequenceProperty();
CCBSequenceProperty* channel = new (std::nothrow) CCBSequenceProperty();
channel->autorelease();
for(int i = 0; i < numKeyframes; ++i) {
@ -849,7 +849,7 @@ bool CCBReader::readCallbackKeyframesForSeq(CCBSequence* seq)
valueVector.push_back(Value(callbackName));
valueVector.push_back(Value(callbackType));
CCBKeyframe* keyframe = new CCBKeyframe();
CCBKeyframe* keyframe = new (std::nothrow) CCBKeyframe();
keyframe->autorelease();
keyframe->setTime(time);
@ -874,7 +874,7 @@ bool CCBReader::readSoundKeyframesForSeq(CCBSequence* seq) {
int numKeyframes = readInt(false);
if(!numKeyframes) return true;
CCBSequenceProperty* channel = new CCBSequenceProperty();
CCBSequenceProperty* channel = new (std::nothrow) CCBSequenceProperty();
channel->autorelease();
for(int i = 0; i < numKeyframes; ++i) {
@ -891,7 +891,7 @@ bool CCBReader::readSoundKeyframesForSeq(CCBSequence* seq) {
vec.push_back(Value(pan));
vec.push_back(Value(gain));
CCBKeyframe* keyframe = new CCBKeyframe();
CCBKeyframe* keyframe = new (std::nothrow) CCBKeyframe();
keyframe->setTime(time);
keyframe->setValue(Value(vec));
channel->getKeyframes().pushBack(keyframe);
@ -916,7 +916,7 @@ bool CCBReader::readSequences()
for (int i = 0; i < numSeqs; i++)
{
CCBSequence *seq = new CCBSequence();
CCBSequence *seq = new (std::nothrow) CCBSequence();
seq->autorelease();
seq->setDuration(readFloat());

View File

@ -11,7 +11,7 @@
#include "cocosbuilder/CCBAnimationManager.h"
#define CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(T, METHOD) static T * METHOD() { \
T * ptr = new T(); \
T * ptr = new (std::nothrow) T(); \
if(ptr != NULL) { \
ptr->autorelease(); \
return ptr; \
@ -21,7 +21,7 @@
}
#define CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(T, METHOD) static T * METHOD() { \
T * ptr = new T(); \
T * ptr = new (std::nothrow) T(); \
if(ptr != NULL && ptr->init()) { \
ptr->autorelease(); \
return ptr; \

Some files were not shown because too many files have changed in this diff Show More