Remove unnecessary check [skip ci]

refer to #748
This commit is contained in:
涓€绾跨伒 2022-07-15 19:44:31 +08:00 committed by GitHub
parent 41d2c44308
commit ac1872494c
1128 changed files with 6541 additions and 6545 deletions

View File

@ -474,13 +474,13 @@ function(cocos_use_pkg target pkg)
# message(STATUS "${target} add dll: ${_dlls}")
get_property(pre_dlls
TARGET ${target}
PROPERTY AX_DEPEND_DLLS)
PROPERTY CC_DEPEND_DLLS)
if(pre_dlls)
set(_dlls ${pre_dlls} ${_dlls})
endif()
set_property(TARGET ${target}
PROPERTY
AX_DEPEND_DLLS ${_dlls}
CC_DEPEND_DLLS ${_dlls}
)
endif()
endif()

View File

@ -55,7 +55,7 @@ message(STATUS "CMAKE_GENERATOR: ${CMAKE_GENERATOR}")
# custom target property for lua/js link
define_property(TARGET
PROPERTY AX_LUA_DEPEND
PROPERTY CC_LUA_DEPEND
BRIEF_DOCS "axis lua depend libs"
FULL_DOCS "use to save depend libs of axis lua project"
)
@ -151,7 +151,7 @@ function(use_axis_compile_define target)
PRIVATE _USEGUIDLL # ui
)
else()
target_compile_definitions(${target} PUBLIC AX_STATIC)
target_compile_definitions(${target} PUBLIC CC_STATIC)
endif()
endif()
endfunction()

View File

@ -17,7 +17,7 @@ message(STATUS "AX_ENABLE_MSEDGE_WEBVIEW2=${AX_ENABLE_MSEDGE_WEBVIEW2}")
function(axis_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR)
if (NOT AX_USE_SHARED_PREBUILT)
target_compile_definitions(${APP_NAME}
PRIVATE AX_STATIC=1
PRIVATE CC_STATIC=1
)
endif()

View File

@ -81,7 +81,7 @@ Speed::Speed() : _speed(0.0), _innerAction(nullptr) {}
Speed::~Speed()
{
AX_SAFE_RELEASE(_innerAction);
CC_SAFE_RELEASE(_innerAction);
}
Speed* Speed::create(ActionInterval* action, float speed)
@ -92,7 +92,7 @@ Speed* Speed::create(ActionInterval* action, float speed)
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -161,9 +161,9 @@ void Speed::setInnerAction(ActionInterval* action)
{
if (_innerAction != action)
{
AX_SAFE_RELEASE(_innerAction);
CC_SAFE_RELEASE(_innerAction);
_innerAction = action;
AX_SAFE_RETAIN(_innerAction);
CC_SAFE_RETAIN(_innerAction);
}
}
@ -172,7 +172,7 @@ void Speed::setInnerAction(ActionInterval* action)
//
Follow::~Follow()
{
AX_SAFE_RELEASE(_followedNode);
CC_SAFE_RELEASE(_followedNode);
}
Follow* Follow::create(Node* followedNode, const Rect& rect /* = Rect::ZERO*/)

View File

@ -50,7 +50,7 @@ enum
/**
* @brief Base class for Action objects.
*/
class AX_DLL Action : public Ref, public Clonable
class CC_DLL Action : public Ref, public Clonable
{
public:
/** Default tag used for all the actions. */
@ -67,7 +67,7 @@ public:
*/
virtual Action* clone() const
{
AX_ASSERT(0);
CC_ASSERT(0);
return nullptr;
}
@ -78,7 +78,7 @@ public:
*/
virtual Action* reverse() const
{
AX_ASSERT(0);
CC_ASSERT(0);
return nullptr;
}
@ -180,7 +180,7 @@ protected:
unsigned int _flags;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Action);
CC_DISALLOW_COPY_AND_ASSIGN(Action);
};
/** @class FiniteTimeAction
@ -191,7 +191,7 @@ private:
* - An action with a duration of 35.5 seconds.
* Infinite time actions are valid.
*/
class AX_DLL FiniteTimeAction : public Action
class CC_DLL FiniteTimeAction : public Action
{
public:
/** Get duration in seconds of the action.
@ -210,12 +210,12 @@ public:
//
virtual FiniteTimeAction* reverse() const override
{
AX_ASSERT(0);
CC_ASSERT(0);
return nullptr;
}
virtual FiniteTimeAction* clone() const override
{
AX_ASSERT(0);
CC_ASSERT(0);
return nullptr;
}
@ -227,7 +227,7 @@ protected:
float _duration;
private:
AX_DISALLOW_COPY_AND_ASSIGN(FiniteTimeAction);
CC_DISALLOW_COPY_AND_ASSIGN(FiniteTimeAction);
};
class ActionInterval;
@ -239,7 +239,7 @@ class RepeatForever;
* Useful to simulate 'slow motion' or 'fast forward' effect.
* @warning This action can't be Sequenceable because it is not an IntervalAction.
*/
class AX_DLL Speed : public Action
class CC_DLL Speed : public Action
{
public:
/** Create the action and set the speed.
@ -297,7 +297,7 @@ protected:
ActionInterval* _innerAction;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Speed);
CC_DISALLOW_COPY_AND_ASSIGN(Speed);
};
/** @class Follow
@ -309,7 +309,7 @@ private:
* Instead of using Camera as a "follower", use this action instead.
* @since v0.99.2
*/
class AX_DLL Follow : public Action
class CC_DLL Follow : public Action
{
public:
/**
@ -439,7 +439,7 @@ protected:
Rect _worldRect;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Follow);
CC_DISALLOW_COPY_AND_ASSIGN(Follow);
};
// end of actions group

View File

@ -180,8 +180,8 @@ bool OrbitCamera::initWithDuration(float t,
_angleX = angleX;
_deltaAngleX = deltaAngleX;
_radDeltaZ = (float)AX_DEGREES_TO_RADIANS(deltaAngleZ);
_radDeltaX = (float)AX_DEGREES_TO_RADIANS(deltaAngleX);
_radDeltaZ = (float)CC_DEGREES_TO_RADIANS(deltaAngleZ);
_radDeltaX = (float)CC_DEGREES_TO_RADIANS(deltaAngleX);
return true;
}
return false;
@ -196,12 +196,12 @@ void OrbitCamera::startWithTarget(Node* target)
if (std::isnan(_radius))
_radius = r;
if (std::isnan(_angleZ))
_angleZ = (float)AX_RADIANS_TO_DEGREES(zenith);
_angleZ = (float)CC_RADIANS_TO_DEGREES(zenith);
if (std::isnan(_angleX))
_angleX = (float)AX_RADIANS_TO_DEGREES(azimuth);
_angleX = (float)CC_RADIANS_TO_DEGREES(azimuth);
_radZ = (float)AX_DEGREES_TO_RADIANS(_angleZ);
_radX = (float)AX_DEGREES_TO_RADIANS(_angleX);
_radZ = (float)CC_DEGREES_TO_RADIANS(_angleZ);
_radX = (float)CC_DEGREES_TO_RADIANS(_angleX);
}
void OrbitCamera::update(float dt)

View File

@ -45,7 +45,7 @@ class Camera;
*@brief Base class for Camera actions.
*@ingroup Actions
*/
class AX_DLL ActionCamera : public ActionInterval
class CC_DLL ActionCamera : public ActionInterval
{
public:
/**
@ -117,7 +117,7 @@ protected:
* Orbits the camera around the center of the screen using spherical coordinates.
* @ingroup Actions
*/
class AX_DLL OrbitCamera : public ActionCamera
class CC_DLL OrbitCamera : public ActionCamera
{
public:
/** Creates a OrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX.

View File

@ -197,7 +197,7 @@ CardinalSplineTo* CardinalSplineTo::create(float duration, PointArray* points, f
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
@ -220,7 +220,7 @@ bool CardinalSplineTo::initWithDuration(float duration, PointArray* points, floa
CardinalSplineTo::~CardinalSplineTo()
{
AX_SAFE_RELEASE_NULL(_points);
CC_SAFE_RELEASE_NULL(_points);
}
CardinalSplineTo::CardinalSplineTo() : _points(nullptr), _deltaT(0.f), _tension(0.f) {}
@ -275,7 +275,7 @@ void CardinalSplineTo::update(float time)
Vec2 newPos = ccCardinalSplineAt(pp0, pp1, pp2, pp3, _tension, lt);
#if AX_ENABLE_STACKABLE_ACTIONS
#if CC_ENABLE_STACKABLE_ACTIONS
// Support for stacked actions
Node* node = _target;
Vec2 diff = node->getPosition() - _previousPosition;
@ -314,7 +314,7 @@ CardinalSplineBy* CardinalSplineBy::create(float duration, PointArray* points, f
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
@ -398,7 +398,7 @@ CatmullRomTo* CatmullRomTo::create(float dt, PointArray* points)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
@ -441,7 +441,7 @@ CatmullRomBy* CatmullRomBy::create(float dt, PointArray* points)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}

View File

@ -55,7 +55,7 @@ class Node;
* @ingroup Actions
* @js NA
*/
class AX_DLL PointArray : public Ref, public Clonable
class CC_DLL PointArray : public Ref, public Clonable
{
public:
/** Creates and initializes a Points array with capacity.
@ -163,7 +163,7 @@ private:
* http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline
* @ingroup Actions
*/
class AX_DLL CardinalSplineTo : public ActionInterval
class CC_DLL CardinalSplineTo : public ActionInterval
{
public:
/** Creates an action with a Cardinal Spline array of points and tension.
@ -212,8 +212,8 @@ public:
*/
void setPoints(PointArray* points)
{
AX_SAFE_RETAIN(points);
AX_SAFE_RELEASE(_points);
CC_SAFE_RETAIN(points);
CC_SAFE_RELEASE(_points);
_points = points;
}
@ -241,7 +241,7 @@ protected:
* http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline
* @ingroup Actions
*/
class AX_DLL CardinalSplineBy : public CardinalSplineTo
class CC_DLL CardinalSplineBy : public CardinalSplineTo
{
public:
/** Creates an action with a Cardinal Spline array of points and tension.
@ -274,7 +274,7 @@ protected:
* http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline
* @ingroup Actions
*/
class AX_DLL CatmullRomTo : public CardinalSplineTo
class CC_DLL CatmullRomTo : public CardinalSplineTo
{
public:
/** Creates an action with a Cardinal Spline array of points and tension.
@ -307,7 +307,7 @@ public:
* http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline
* @ingroup Actions
*/
class AX_DLL CatmullRomBy : public CardinalSplineBy
class CC_DLL CatmullRomBy : public CardinalSplineBy
{
public:
/** Creates an action with a Cardinal Spline array of points and tension.
@ -334,7 +334,7 @@ public:
};
/** Returns the Cardinal Spline position for a given set of control points, tension and time */
extern AX_DLL Vec2
extern CC_DLL Vec2
ccCardinalSplineAt(const Vec2& p0, const Vec2& p1, const Vec2& p2, const Vec2& p3, float tension, float t);
// end of actions group

View File

@ -66,7 +66,7 @@ bool ActionEase::initWithAction(ActionInterval* action)
ActionEase::~ActionEase()
{
AX_SAFE_RELEASE(_inner);
CC_SAFE_RELEASE(_inner);
}
void ActionEase::startWithTarget(Node* target)
@ -115,7 +115,7 @@ EaseRateAction* EaseRateAction::create(ActionInterval* action, float rate)
return easeRateAction;
}
AX_SAFE_DELETE(easeRateAction);
CC_SAFE_DELETE(easeRateAction);
return nullptr;
}
@ -141,7 +141,7 @@ bool EaseRateAction::initWithAction(ActionInterval* action, float rate)
if (ease->initWithAction(action)) \
ease->autorelease(); \
else \
AX_SAFE_DELETE(ease); \
CC_SAFE_DELETE(ease); \
return ease; \
} \
CLASSNAME* CLASSNAME::clone() const \
@ -192,7 +192,7 @@ EASE_TEMPLATE_IMPL(EaseCubicActionInOut, tweenfunc::cubicEaseInOut, EaseCubicAct
if (ease->initWithAction(action, rate)) \
ease->autorelease(); \
else \
AX_SAFE_DELETE(ease); \
CC_SAFE_DELETE(ease); \
return ease; \
} \
CLASSNAME* CLASSNAME::clone() const \
@ -235,7 +235,7 @@ bool EaseElastic::initWithAction(ActionInterval* action, float period /* = 0.3f*
if (ease->initWithAction(action, period)) \
ease->autorelease(); \
else \
AX_SAFE_DELETE(ease); \
CC_SAFE_DELETE(ease); \
return ease; \
} \
CLASSNAME* CLASSNAME::clone() const \

View File

@ -45,7 +45,7 @@ NS_AX_BEGIN
The ease action will change the timeline of the inner action.
@ingroup Actions
*/
class AX_DLL ActionEase : public ActionInterval
class CC_DLL ActionEase : public ActionInterval
{
public:
/**
@ -75,7 +75,7 @@ protected:
ActionInterval* _inner;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ActionEase);
CC_DISALLOW_COPY_AND_ASSIGN(ActionEase);
};
/**
@ -84,7 +84,7 @@ private:
@details Ease the inner action with specified rate.
@ingroup Actions
*/
class AX_DLL EaseRateAction : public ActionEase
class CC_DLL EaseRateAction : public ActionEase
{
public:
static EaseRateAction* create(ActionInterval* action, float rate);
@ -113,7 +113,7 @@ protected:
float _rate;
private:
AX_DISALLOW_COPY_AND_ASSIGN(EaseRateAction);
CC_DISALLOW_COPY_AND_ASSIGN(EaseRateAction);
};
//
@ -121,7 +121,7 @@ private:
// issue #16159 [https://github.com/cocos2d/cocos2d-x/pull/16159] for further info
//
#define EASE_TEMPLATE_DECL_CLASS(CLASSNAME) \
class AX_DLL CLASSNAME : public ActionEase \
class CC_DLL CLASSNAME : public ActionEase \
{ \
public: \
virtual ~CLASSNAME() {} \
@ -134,7 +134,7 @@ private:
virtual ActionEase* reverse() const override; \
\
private: \
AX_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \
CC_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \
};
/**
@ -199,7 +199,7 @@ EASE_TEMPLATE_DECL_CLASS(EaseSineInOut);
@since v0.8.2
@ingroup Actions
*/
class AX_DLL EaseBounce : public ActionEase
class CC_DLL EaseBounce : public ActionEase
{};
/**
@ -373,7 +373,7 @@ EASE_TEMPLATE_DECL_CLASS(EaseCubicActionInOut);
//
#define EASERATE_TEMPLATE_DECL_CLASS(CLASSNAME) \
class AX_DLL CLASSNAME : public EaseRateAction \
class CC_DLL CLASSNAME : public EaseRateAction \
{ \
public: \
virtual ~CLASSNAME() {} \
@ -385,7 +385,7 @@ EASE_TEMPLATE_DECL_CLASS(EaseCubicActionInOut);
virtual EaseRateAction* reverse() const override; \
\
private: \
AX_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \
CC_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \
};
/**
@ -423,7 +423,7 @@ EASERATE_TEMPLATE_DECL_CLASS(EaseInOut);
@since v0.8.2
@ingroup Actions
*/
class AX_DLL EaseElastic : public ActionEase
class CC_DLL EaseElastic : public ActionEase
{
public:
/**
@ -451,7 +451,7 @@ protected:
float _period;
private:
AX_DISALLOW_COPY_AND_ASSIGN(EaseElastic);
CC_DISALLOW_COPY_AND_ASSIGN(EaseElastic);
};
//
@ -459,7 +459,7 @@ private:
// issue #16159 [https://github.com/cocos2d/cocos2d-x/pull/16159] for further info
//
#define EASEELASTIC_TEMPLATE_DECL_CLASS(CLASSNAME) \
class AX_DLL CLASSNAME : public EaseElastic \
class CC_DLL CLASSNAME : public EaseElastic \
{ \
public: \
virtual ~CLASSNAME() {} \
@ -471,7 +471,7 @@ private:
virtual EaseElastic* reverse() const override; \
\
private: \
AX_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \
CC_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \
};
/**
@ -516,7 +516,7 @@ EASEELASTIC_TEMPLATE_DECL_CLASS(EaseElasticInOut);
@brief Ease Bezier
@ingroup Actions
*/
class AX_DLL EaseBezierAction : public axis::ActionEase
class CC_DLL EaseBezierAction : public axis::ActionEase
{
public:
/**
@ -545,7 +545,7 @@ protected:
float _p3;
private:
AX_DISALLOW_COPY_AND_ASSIGN(EaseBezierAction);
CC_DISALLOW_COPY_AND_ASSIGN(EaseBezierAction);
};
// end of actions group

View File

@ -206,7 +206,7 @@ AccelDeccelAmplitude* AccelDeccelAmplitude::clone() const
AccelDeccelAmplitude::~AccelDeccelAmplitude()
{
AX_SAFE_RELEASE(_other);
CC_SAFE_RELEASE(_other);
}
void AccelDeccelAmplitude::startWithTarget(Node* target)
@ -276,7 +276,7 @@ AccelAmplitude* AccelAmplitude::clone() const
AccelAmplitude::~AccelAmplitude()
{
AX_SAFE_DELETE(_other);
CC_SAFE_DELETE(_other);
}
void AccelAmplitude::startWithTarget(Node* target)
@ -330,7 +330,7 @@ bool DeccelAmplitude::initWithAction(Action* action, float duration)
DeccelAmplitude::~DeccelAmplitude()
{
AX_SAFE_RELEASE(_other);
CC_SAFE_RELEASE(_other);
}
void DeccelAmplitude::startWithTarget(Node* target)

View File

@ -45,7 +45,7 @@ class NodeGrid;
@brief Base class for Grid actions.
@details Grid actions are the actions take effect on GridBase.
*/
class AX_DLL GridAction : public ActionInterval
class CC_DLL GridAction : public ActionInterval
{
public:
/**
@ -57,7 +57,7 @@ public:
// overrides
virtual GridAction* clone() const override
{
AX_ASSERT(0);
CC_ASSERT(0);
return nullptr;
}
virtual GridAction* reverse() const override;
@ -81,14 +81,14 @@ protected:
void cacheTargetAsGridNode();
private:
AX_DISALLOW_COPY_AND_ASSIGN(GridAction);
CC_DISALLOW_COPY_AND_ASSIGN(GridAction);
};
/**
@brief Base class for Grid3D actions.
@details Grid3D actions can modify a non-tiled grid.
*/
class AX_DLL Grid3DAction : public GridAction
class CC_DLL Grid3DAction : public GridAction
{
public:
virtual GridBase* getGrid() override;
@ -122,7 +122,7 @@ public:
// Overrides
virtual Grid3DAction* clone() const override
{
AX_ASSERT(0);
CC_ASSERT(0);
return nullptr;
}
@ -136,7 +136,7 @@ public:
/**
@brief Base class for TiledGrid3D actions.
*/
class AX_DLL TiledGrid3DAction : public GridAction
class CC_DLL TiledGrid3DAction : public GridAction
{
public:
/**
@ -180,7 +180,7 @@ public:
// Override
virtual TiledGrid3DAction* clone() const override
{
AX_ASSERT(0);
CC_ASSERT(0);
return nullptr;
}
};
@ -189,7 +189,7 @@ public:
@brief AccelDeccelAmplitude action.
@js NA
*/
class AX_DLL AccelDeccelAmplitude : public ActionInterval
class CC_DLL AccelDeccelAmplitude : public ActionInterval
{
public:
/**
@ -233,14 +233,14 @@ protected:
ActionInterval* _other;
private:
AX_DISALLOW_COPY_AND_ASSIGN(AccelDeccelAmplitude);
CC_DISALLOW_COPY_AND_ASSIGN(AccelDeccelAmplitude);
};
/**
@brief AccelAmplitude action.
@js NA
*/
class AX_DLL AccelAmplitude : public ActionInterval
class CC_DLL AccelAmplitude : public ActionInterval
{
public:
/**
@ -278,14 +278,14 @@ protected:
ActionInterval* _other;
private:
AX_DISALLOW_COPY_AND_ASSIGN(AccelAmplitude);
CC_DISALLOW_COPY_AND_ASSIGN(AccelAmplitude);
};
/**
@brief DeccelAmplitude action.
@js NA
*/
class AX_DLL DeccelAmplitude : public ActionInterval
class CC_DLL DeccelAmplitude : public ActionInterval
{
public:
/**
@ -329,7 +329,7 @@ protected:
ActionInterval* _other;
private:
AX_DISALLOW_COPY_AND_ASSIGN(DeccelAmplitude);
CC_DISALLOW_COPY_AND_ASSIGN(DeccelAmplitude);
};
/**
@ -340,7 +340,7 @@ private:
Sequence::create(Lens3D::create(...), StopGrid::create(), nullptr);
@endcode
*/
class AX_DLL StopGrid : public ActionInstant
class CC_DLL StopGrid : public ActionInstant
{
public:
/**
@ -363,13 +363,13 @@ protected:
void cacheTargetAsGridNode();
private:
AX_DISALLOW_COPY_AND_ASSIGN(StopGrid);
CC_DISALLOW_COPY_AND_ASSIGN(StopGrid);
};
/**
@brief ReuseGrid action.
*/
class AX_DLL ReuseGrid : public ActionInstant
class CC_DLL ReuseGrid : public ActionInstant
{
public:
/**
@ -402,7 +402,7 @@ protected:
int _times;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ReuseGrid);
CC_DISALLOW_COPY_AND_ASSIGN(ReuseGrid);
};
// end of actions group

View File

@ -209,7 +209,7 @@ FlipY3D* FlipY3D::create(float duration)
}
else
{
AX_SAFE_DELETE(action);
CC_SAFE_DELETE(action);
}
return action;
@ -291,7 +291,7 @@ Lens3D* Lens3D::create(float duration, const Vec2& gridSize, const Vec2& positio
}
else
{
AX_SAFE_DELETE(action);
CC_SAFE_DELETE(action);
}
return action;
@ -392,7 +392,7 @@ Ripple3D* Ripple3D::create(float duration,
}
else
{
AX_SAFE_DELETE(action);
CC_SAFE_DELETE(action);
}
return action;
@ -470,7 +470,7 @@ Shaky3D* Shaky3D::create(float duration, const Vec2& gridSize, int range, bool s
}
else
{
AX_SAFE_DELETE(action);
CC_SAFE_DELETE(action);
}
return action;
}
@ -531,7 +531,7 @@ Liquid* Liquid::create(float duration, const Vec2& gridSize, unsigned int waves,
}
else
{
AX_SAFE_DELETE(action);
CC_SAFE_DELETE(action);
}
return action;
@ -594,7 +594,7 @@ Waves* Waves::create(float duration,
}
else
{
AX_SAFE_DELETE(action);
CC_SAFE_DELETE(action);
}
return action;
@ -668,7 +668,7 @@ Twirl* Twirl::create(float duration, const Vec2& gridSize, const Vec2& position,
}
else
{
AX_SAFE_DELETE(action);
CC_SAFE_DELETE(action);
}
return action;

View File

@ -42,7 +42,7 @@ NS_AX_BEGIN
You can control the effect by these parameters:
duration, grid size, waves count, amplitude.
*/
class AX_DLL Waves3D : public Grid3DAction
class CC_DLL Waves3D : public Grid3DAction
{
public:
/**
@ -100,14 +100,14 @@ protected:
float _amplitudeRate;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Waves3D);
CC_DISALLOW_COPY_AND_ASSIGN(Waves3D);
};
/**
@brief FlipX3D action.
@details This action is used for flipping the target node on the x axis.
*/
class AX_DLL FlipX3D : public Grid3DAction
class CC_DLL FlipX3D : public Grid3DAction
{
public:
/**
@ -140,14 +140,14 @@ public:
virtual bool initWithSize(const Vec2& gridSize, float duration);
private:
AX_DISALLOW_COPY_AND_ASSIGN(FlipX3D);
CC_DISALLOW_COPY_AND_ASSIGN(FlipX3D);
};
/**
@brief FlipY3D action.
@details This action is used for flipping the target node on the y axis.
*/
class AX_DLL FlipY3D : public FlipX3D
class CC_DLL FlipY3D : public FlipX3D
{
public:
/**
@ -165,7 +165,7 @@ public:
virtual ~FlipY3D() {}
private:
AX_DISALLOW_COPY_AND_ASSIGN(FlipY3D);
CC_DISALLOW_COPY_AND_ASSIGN(FlipY3D);
};
/**
@ -175,7 +175,7 @@ private:
duration, grid size, center position of lens, radius of lens.
Also you can change the lens effect value & whether effect is concave by the setter methods.
*/
class AX_DLL Lens3D : public Grid3DAction
class CC_DLL Lens3D : public Grid3DAction
{
public:
/**
@ -247,7 +247,7 @@ protected:
bool _dirty;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Lens3D);
CC_DISALLOW_COPY_AND_ASSIGN(Lens3D);
};
/**
@ -257,7 +257,7 @@ private:
duration, grid size, center position of ripple,
radius of ripple, waves count, amplitude.
*/
class AX_DLL Ripple3D : public Grid3DAction
class CC_DLL Ripple3D : public Grid3DAction
{
public:
/**
@ -343,7 +343,7 @@ protected:
float _amplitudeRate;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Ripple3D);
CC_DISALLOW_COPY_AND_ASSIGN(Ripple3D);
};
/**
@ -352,7 +352,7 @@ private:
You can create the action by these parameters:
duration, grid size, range, whether shake on the z axis.
*/
class AX_DLL Shaky3D : public Grid3DAction
class CC_DLL Shaky3D : public Grid3DAction
{
public:
/**
@ -387,7 +387,7 @@ protected:
bool _shakeZ;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Shaky3D);
CC_DISALLOW_COPY_AND_ASSIGN(Shaky3D);
};
/**
@ -396,7 +396,7 @@ private:
You can create the action by these parameters:
duration, grid size, waves count, amplitude of the liquid effect.
*/
class AX_DLL Liquid : public Grid3DAction
class CC_DLL Liquid : public Grid3DAction
{
public:
/**
@ -454,7 +454,7 @@ protected:
float _amplitudeRate;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Liquid);
CC_DISALLOW_COPY_AND_ASSIGN(Liquid);
};
/**
@ -464,7 +464,7 @@ private:
duration, grid size, waves count, amplitude,
whether waves on horizontal and whether waves on vertical.
*/
class AX_DLL Waves : public Grid3DAction
class CC_DLL Waves : public Grid3DAction
{
public:
/**
@ -538,7 +538,7 @@ protected:
bool _horizontal;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Waves);
CC_DISALLOW_COPY_AND_ASSIGN(Waves);
};
/**
@ -547,7 +547,7 @@ private:
You can control the effect by these parameters:
duration, grid size, center position, twirls count, amplitude.
*/
class AX_DLL Twirl : public Grid3DAction
class CC_DLL Twirl : public Grid3DAction
{
public:
/**
@ -628,7 +628,7 @@ protected:
float _amplitudeRate;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Twirl);
CC_DISALLOW_COPY_AND_ASSIGN(Twirl);
};
// end of actions group

View File

@ -150,7 +150,7 @@ RemoveSelf* RemoveSelf::create(bool isNeedCleanUp /*= true*/)
if (ret->init(isNeedCleanUp))
ret->autorelease();
else
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return ret;
}
@ -192,7 +192,7 @@ FlipX* FlipX::create(bool x)
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -232,7 +232,7 @@ FlipY* FlipY::create(bool y)
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -315,7 +315,7 @@ CallFunc* CallFunc::create(const std::function<void()>& func)
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -370,7 +370,7 @@ CallFuncN* CallFuncN::create(const std::function<void(Node*)>& func)
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}

View File

@ -42,7 +42,7 @@ NS_AX_BEGIN
/** @class ActionInstant
* @brief Instant actions are immediate actions. They don't have a duration like the IntervalAction actions.
**/
class AX_DLL ActionInstant : public FiniteTimeAction
class CC_DLL ActionInstant : public FiniteTimeAction
{
public:
//
@ -50,13 +50,13 @@ public:
//
virtual ActionInstant* clone() const override
{
AX_ASSERT(0);
CC_ASSERT(0);
return nullptr;
}
virtual ActionInstant* reverse() const override
{
AX_ASSERT(0);
CC_ASSERT(0);
return nullptr;
}
@ -79,7 +79,7 @@ private:
/** @class Show
* @brief Show the node.
**/
class AX_DLL Show : public ActionInstant
class CC_DLL Show : public ActionInstant
{
public:
/** Allocates and initializes the action.
@ -102,13 +102,13 @@ public:
virtual ~Show() {}
private:
AX_DISALLOW_COPY_AND_ASSIGN(Show);
CC_DISALLOW_COPY_AND_ASSIGN(Show);
};
/** @class Hide
* @brief Hide the node.
*/
class AX_DLL Hide : public ActionInstant
class CC_DLL Hide : public ActionInstant
{
public:
/** Allocates and initializes the action.
@ -131,13 +131,13 @@ public:
virtual ~Hide() {}
private:
AX_DISALLOW_COPY_AND_ASSIGN(Hide);
CC_DISALLOW_COPY_AND_ASSIGN(Hide);
};
/** @class ToggleVisibility
* @brief Toggles the visibility of a node.
*/
class AX_DLL ToggleVisibility : public ActionInstant
class CC_DLL ToggleVisibility : public ActionInstant
{
public:
/** Allocates and initializes the action.
@ -160,13 +160,13 @@ public:
virtual ~ToggleVisibility() {}
private:
AX_DISALLOW_COPY_AND_ASSIGN(ToggleVisibility);
CC_DISALLOW_COPY_AND_ASSIGN(ToggleVisibility);
};
/** @class RemoveSelf
* @brief Remove the node.
*/
class AX_DLL RemoveSelf : public ActionInstant
class CC_DLL RemoveSelf : public ActionInstant
{
public:
/** Create the action.
@ -196,14 +196,14 @@ protected:
bool _isNeedCleanUp;
private:
AX_DISALLOW_COPY_AND_ASSIGN(RemoveSelf);
CC_DISALLOW_COPY_AND_ASSIGN(RemoveSelf);
};
/** @class FlipX
* @brief Flips the sprite horizontally.
* @since v0.99.0
*/
class AX_DLL FlipX : public ActionInstant
class CC_DLL FlipX : public ActionInstant
{
public:
/** Create the action.
@ -233,14 +233,14 @@ protected:
bool _flipX;
private:
AX_DISALLOW_COPY_AND_ASSIGN(FlipX);
CC_DISALLOW_COPY_AND_ASSIGN(FlipX);
};
/** @class FlipY
* @brief Flips the sprite vertically.
* @since v0.99.0
*/
class AX_DLL FlipY : public ActionInstant
class CC_DLL FlipY : public ActionInstant
{
public:
/** Create the action.
@ -270,13 +270,13 @@ protected:
bool _flipY;
private:
AX_DISALLOW_COPY_AND_ASSIGN(FlipY);
CC_DISALLOW_COPY_AND_ASSIGN(FlipY);
};
/** @class Place
* @brief Places the node in a certain position.
*/
class AX_DLL Place : public ActionInstant
class CC_DLL Place : public ActionInstant
{
public:
/** Creates a Place action with a position.
@ -306,13 +306,13 @@ protected:
Vec2 _position;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Place);
CC_DISALLOW_COPY_AND_ASSIGN(Place);
};
/** @class CallFunc
* @brief Calls a 'callback'.
*/
class AX_DLL CallFunc : public ActionInstant
class CC_DLL CallFunc : public ActionInstant
{
public:
/** Creates the action with the callback of type std::function<void()>.
@ -354,14 +354,14 @@ protected:
std::function<void()> _function;
private:
AX_DISALLOW_COPY_AND_ASSIGN(CallFunc);
CC_DISALLOW_COPY_AND_ASSIGN(CallFunc);
};
/** @class CallFuncN
* @brief Calls a 'callback' with the node as the first argument. N means Node.
* @js NA
*/
class AX_DLL CallFuncN : public CallFunc
class CC_DLL CallFuncN : public CallFunc
{
public:
/** Creates the action with the callback of type std::function<void()>.
@ -389,7 +389,7 @@ protected:
std::function<void(Node*)> _functionN;
private:
AX_DISALLOW_COPY_AND_ASSIGN(CallFuncN);
CC_DISALLOW_COPY_AND_ASSIGN(CallFuncN);
};
// end of actions group

View File

@ -287,8 +287,8 @@ Sequence::Sequence() : _split(0)
Sequence::~Sequence()
{
AX_SAFE_RELEASE(_actions[0]);
AX_SAFE_RELEASE(_actions[1]);
CC_SAFE_RELEASE(_actions[0]);
CC_SAFE_RELEASE(_actions[1]);
}
void Sequence::startWithTarget(Node* target)
@ -448,7 +448,7 @@ Repeat* Repeat::clone() const
Repeat::~Repeat()
{
AX_SAFE_RELEASE(_innerAction);
CC_SAFE_RELEASE(_innerAction);
}
void Repeat::startWithTarget(Node* target)
@ -531,7 +531,7 @@ Repeat* Repeat::reverse() const
//
RepeatForever::~RepeatForever()
{
AX_SAFE_RELEASE(_innerAction);
CC_SAFE_RELEASE(_innerAction);
}
RepeatForever* RepeatForever::create(ActionInterval* action)
@ -742,8 +742,8 @@ Spawn::Spawn() : _one(nullptr), _two(nullptr) {}
Spawn::~Spawn()
{
AX_SAFE_RELEASE(_one);
AX_SAFE_RELEASE(_two);
CC_SAFE_RELEASE(_one);
CC_SAFE_RELEASE(_two);
}
void Spawn::startWithTarget(Node* target)
@ -932,7 +932,7 @@ void RotateTo::update(float time)
}
else
{
#if AX_USE_PHYSICS
#if CC_USE_PHYSICS
if (_startAngle.x == _startAngle.y && _diffAngle.x == _diffAngle.y)
{
_target->setRotation(_startAngle.x + _diffAngle.x * time);
@ -945,7 +945,7 @@ void RotateTo::update(float time)
#else
_target->setRotationSkewX(_startAngle.x + _diffAngle.x * time);
_target->setRotationSkewY(_startAngle.y + _diffAngle.y * time);
#endif // AX_USE_PHYSICS
#endif // CC_USE_PHYSICS
}
}
}
@ -1077,7 +1077,7 @@ void RotateBy::update(float time)
}
else
{
#if AX_USE_PHYSICS
#if CC_USE_PHYSICS
if (_startAngle.x == _startAngle.y && _deltaAngle.x == _deltaAngle.y)
{
_target->setRotation(_startAngle.x + _deltaAngle.x * time);
@ -1090,7 +1090,7 @@ void RotateBy::update(float time)
#else
_target->setRotationSkewX(_startAngle.x + _deltaAngle.x * time);
_target->setRotationSkewY(_startAngle.y + _deltaAngle.y * time);
#endif // AX_USE_PHYSICS
#endif // CC_USE_PHYSICS
}
}
}
@ -1174,7 +1174,7 @@ void MoveBy::update(float t)
{
if (_target)
{
#if AX_ENABLE_STACKABLE_ACTIONS
#if CC_ENABLE_STACKABLE_ACTIONS
Vec3 currentPos = _target->getPosition3D();
Vec3 diff = currentPos - _previousPosition;
_startPosition = _startPosition + diff;
@ -1183,7 +1183,7 @@ void MoveBy::update(float t)
_previousPosition = newPos;
#else
_target->setPosition3D(_startPosition + _positionDelta * t);
#endif // AX_ENABLE_STACKABLE_ACTIONS
#endif // CC_ENABLE_STACKABLE_ACTIONS
}
}
@ -1583,7 +1583,7 @@ void JumpBy::update(float t)
y += _delta.y * t;
float x = _delta.x * t;
#if AX_ENABLE_STACKABLE_ACTIONS
#if CC_ENABLE_STACKABLE_ACTIONS
Vec2 currentPos = _target->getPosition();
Vec2 diff = currentPos - _previousPos;
@ -1595,7 +1595,7 @@ void JumpBy::update(float t)
_previousPos = newPos;
#else
_target->setPosition(_startPosition + Vec2(x, y));
#endif // !AX_ENABLE_STACKABLE_ACTIONS
#endif // !CC_ENABLE_STACKABLE_ACTIONS
}
}
@ -1726,7 +1726,7 @@ void BezierBy::update(float time)
float x = bezierat(xa, xb, xc, xd, time);
float y = bezierat(ya, yb, yc, yd, time);
#if AX_ENABLE_STACKABLE_ACTIONS
#if CC_ENABLE_STACKABLE_ACTIONS
Vec2 currentPos = _target->getPosition();
Vec2 diff = currentPos - _previousPosition;
_startPosition = _startPosition + diff;
@ -1737,7 +1737,7 @@ void BezierBy::update(float time)
_previousPosition = newPos;
#else
_target->setPosition(_startPosition + Vec2(x, y));
#endif // !AX_ENABLE_STACKABLE_ACTIONS
#endif // !CC_ENABLE_STACKABLE_ACTIONS
}
}
@ -2393,7 +2393,7 @@ bool ReverseTime::initWithAction(FiniteTimeAction* action)
if (ActionInterval::initWithDuration(action->getDuration()))
{
// Don't leak if action is reused
AX_SAFE_RELEASE(_other);
CC_SAFE_RELEASE(_other);
_other = action;
action->retain();
@ -2414,7 +2414,7 @@ ReverseTime::ReverseTime() : _other(nullptr) {}
ReverseTime::~ReverseTime()
{
AX_SAFE_RELEASE(_other);
CC_SAFE_RELEASE(_other);
}
void ReverseTime::startWithTarget(Node* target)
@ -2464,10 +2464,10 @@ Animate::Animate() {}
Animate::~Animate()
{
AX_SAFE_RELEASE(_animation);
AX_SAFE_RELEASE(_origFrame);
AX_SAFE_DELETE(_splitTimes);
AX_SAFE_RELEASE(_frameDisplayedEvent);
CC_SAFE_RELEASE(_animation);
CC_SAFE_RELEASE(_origFrame);
CC_SAFE_DELETE(_splitTimes);
CC_SAFE_RELEASE(_frameDisplayedEvent);
}
bool Animate::initWithAnimation(Animation* animation)
@ -2510,8 +2510,8 @@ void Animate::setAnimation(axis::Animation* animation)
{
if (_animation != animation)
{
AX_SAFE_RETAIN(animation);
AX_SAFE_RELEASE(_animation);
CC_SAFE_RETAIN(animation);
CC_SAFE_RELEASE(_animation);
_animation = animation;
}
}
@ -2527,7 +2527,7 @@ void Animate::startWithTarget(Node* target)
ActionInterval::startWithTarget(target);
Sprite* sprite = static_cast<Sprite*>(target);
AX_SAFE_RELEASE(_origFrame);
CC_SAFE_RELEASE(_origFrame);
if (_animation->getRestoreOriginalFrame())
{
@ -2637,8 +2637,8 @@ TargetedAction::TargetedAction() : _action(nullptr), _forcedTarget(nullptr) {}
TargetedAction::~TargetedAction()
{
AX_SAFE_RELEASE(_forcedTarget);
AX_SAFE_RELEASE(_action);
CC_SAFE_RELEASE(_forcedTarget);
CC_SAFE_RELEASE(_action);
}
TargetedAction* TargetedAction::create(Node* target, FiniteTimeAction* action)
@ -2658,9 +2658,9 @@ bool TargetedAction::initWithTarget(Node* target, FiniteTimeAction* action)
{
if (ActionInterval::initWithDuration(action->getDuration()))
{
AX_SAFE_RETAIN(target);
CC_SAFE_RETAIN(target);
_forcedTarget = target;
AX_SAFE_RETAIN(action);
CC_SAFE_RETAIN(action);
_action = action;
return true;
}
@ -2704,8 +2704,8 @@ void TargetedAction::setForcedTarget(Node* forcedTarget)
{
if (_forcedTarget != forcedTarget)
{
AX_SAFE_RETAIN(forcedTarget);
AX_SAFE_RELEASE(_forcedTarget);
CC_SAFE_RETAIN(forcedTarget);
CC_SAFE_RELEASE(_forcedTarget);
_forcedTarget = forcedTarget;
}
}

View File

@ -68,7 +68,7 @@ auto action = MoveBy::create(1.0f, Vec2::ONE);
auto pingPongAction = Sequence::create(action, action->reverse(), nullptr);
@endcode
*/
class AX_DLL ActionInterval : public FiniteTimeAction
class CC_DLL ActionInterval : public FiniteTimeAction
{
public:
/** How many seconds had elapsed since the actions started to run.
@ -100,13 +100,13 @@ public:
virtual void startWithTarget(Node* target) override;
virtual ActionInterval* reverse() const override
{
AX_ASSERT(0);
CC_ASSERT(0);
return nullptr;
}
virtual ActionInterval* clone() const override
{
AX_ASSERT(0);
CC_ASSERT(0);
return nullptr;
}
@ -125,14 +125,14 @@ protected:
/** @class Sequence
* @brief Runs actions sequentially, one after another.
*/
class AX_DLL Sequence : public ActionInterval
class CC_DLL Sequence : public ActionInterval
{
public:
/** Helper constructor to create an array of sequenceable actions.
*
* @return An autoreleased Sequence object.
*/
static Sequence* create(FiniteTimeAction* action1, ...) AX_REQUIRES_NULL_TERMINATION;
static Sequence* create(FiniteTimeAction* action1, ...) CC_REQUIRES_NULL_TERMINATION;
/** Helper constructor to create an array of sequenceable actions given an array.
* @code
@ -187,14 +187,14 @@ protected:
int _last;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Sequence);
CC_DISALLOW_COPY_AND_ASSIGN(Sequence);
};
/** @class Repeat
* @brief Repeats an action a number of times.
* To repeat an action forever use the RepeatForever action.
*/
class AX_DLL Repeat : public ActionInterval
class CC_DLL Repeat : public ActionInterval
{
public:
/** Creates a Repeat action. Times is an unsigned integer between 1 and pow(2,30).
@ -213,8 +213,8 @@ public:
{
if (_innerAction != action)
{
AX_SAFE_RETAIN(action);
AX_SAFE_RELEASE(_innerAction);
CC_SAFE_RETAIN(action);
CC_SAFE_RELEASE(_innerAction);
_innerAction = action;
}
}
@ -253,7 +253,7 @@ protected:
FiniteTimeAction* _innerAction;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Repeat);
CC_DISALLOW_COPY_AND_ASSIGN(Repeat);
};
/** @class RepeatForever
@ -261,7 +261,7 @@ private:
To repeat the an action for a limited number of times use the Repeat action.
* @warning This action can't be Sequenceable because it is not an IntervalAction.
*/
class AX_DLL RepeatForever : public ActionInterval
class CC_DLL RepeatForever : public ActionInterval
{
public:
/** Creates the action.
@ -279,9 +279,9 @@ public:
{
if (_innerAction != action)
{
AX_SAFE_RELEASE(_innerAction);
CC_SAFE_RELEASE(_innerAction);
_innerAction = action;
AX_SAFE_RETAIN(_innerAction);
CC_SAFE_RETAIN(_innerAction);
}
}
@ -314,13 +314,13 @@ protected:
ActionInterval* _innerAction;
private:
AX_DISALLOW_COPY_AND_ASSIGN(RepeatForever);
CC_DISALLOW_COPY_AND_ASSIGN(RepeatForever);
};
/** @class Spawn
* @brief Spawn a new action immediately
*/
class AX_DLL Spawn : public ActionInterval
class CC_DLL Spawn : public ActionInterval
{
public:
/** Helper constructor to create an array of spawned actions.
@ -332,7 +332,7 @@ public:
*
* @return An autoreleased Spawn object.
*/
static Spawn* create(FiniteTimeAction* action1, ...) AX_REQUIRES_NULL_TERMINATION;
static Spawn* create(FiniteTimeAction* action1, ...) CC_REQUIRES_NULL_TERMINATION;
/** Helper constructor to create an array of spawned actions.
*
@ -383,14 +383,14 @@ protected:
FiniteTimeAction* _two;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Spawn);
CC_DISALLOW_COPY_AND_ASSIGN(Spawn);
};
/** @class RotateTo
* @brief Rotates a Node object to a certain angle by modifying it's rotation attribute.
The direction will be decided by the shortest angle.
*/
class AX_DLL RotateTo : public ActionInterval
class CC_DLL RotateTo : public ActionInterval
{
public:
/**
@ -460,13 +460,13 @@ protected:
Vec3 _diffAngle;
private:
AX_DISALLOW_COPY_AND_ASSIGN(RotateTo);
CC_DISALLOW_COPY_AND_ASSIGN(RotateTo);
};
/** @class RotateBy
* @brief Rotates a Node object clockwise a number of degrees by modifying it's rotation attribute.
*/
class AX_DLL RotateBy : public ActionInterval
class CC_DLL RotateBy : public ActionInterval
{
public:
/**
@ -525,7 +525,7 @@ protected:
Vec3 _startAngle;
private:
AX_DISALLOW_COPY_AND_ASSIGN(RotateBy);
CC_DISALLOW_COPY_AND_ASSIGN(RotateBy);
};
/** @class MoveBy
@ -535,7 +535,7 @@ private:
movement will be the sum of individual movements.
@since v2.1beta2-custom
*/
class AX_DLL MoveBy : public ActionInterval
class CC_DLL MoveBy : public ActionInterval
{
public:
/**
@ -580,7 +580,7 @@ protected:
Vec3 _previousPosition;
private:
AX_DISALLOW_COPY_AND_ASSIGN(MoveBy);
CC_DISALLOW_COPY_AND_ASSIGN(MoveBy);
};
/** @class MoveTo
@ -589,7 +589,7 @@ private:
movements.
@since v2.1beta2-custom
*/
class AX_DLL MoveTo : public MoveBy
class CC_DLL MoveTo : public MoveBy
{
public:
/**
@ -632,14 +632,14 @@ protected:
Vec3 _endPosition;
private:
AX_DISALLOW_COPY_AND_ASSIGN(MoveTo);
CC_DISALLOW_COPY_AND_ASSIGN(MoveTo);
};
/** @class SkewTo
* @brief Skews a Node object to given angles by modifying it's skewX and skewY attributes
@since v1.0
*/
class AX_DLL SkewTo : public ActionInterval
class CC_DLL SkewTo : public ActionInterval
{
public:
/**
@ -680,14 +680,14 @@ protected:
float _deltaY;
private:
AX_DISALLOW_COPY_AND_ASSIGN(SkewTo);
CC_DISALLOW_COPY_AND_ASSIGN(SkewTo);
};
/** @class SkewBy
* @brief Skews a Node object by skewX and skewY degrees.
@since v1.0
*/
class AX_DLL SkewBy : public SkewTo
class CC_DLL SkewBy : public SkewTo
{
public:
/**
@ -714,13 +714,13 @@ public:
bool initWithDuration(float t, float sx, float sy);
private:
AX_DISALLOW_COPY_AND_ASSIGN(SkewBy);
CC_DISALLOW_COPY_AND_ASSIGN(SkewBy);
};
/** @class ResizeTo
* @brief Resize a Node object to the final size by modifying it's 'size' attribute.
*/
class AX_DLL ResizeTo : public ActionInterval
class CC_DLL ResizeTo : public ActionInterval
{
public:
/**
@ -756,14 +756,14 @@ protected:
Vec2 _sizeDelta;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ResizeTo);
CC_DISALLOW_COPY_AND_ASSIGN(ResizeTo);
};
/** @class ResizeBy
* @brief Resize a Node object by a size. Works on all nodes where setContentSize is effective. But it's mostly useful
* for nodes where 9-slice is enabled
*/
class AX_DLL ResizeBy : public ActionInterval
class CC_DLL ResizeBy : public ActionInterval
{
public:
/**
@ -798,13 +798,13 @@ protected:
Vec2 _previousSize;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ResizeBy);
CC_DISALLOW_COPY_AND_ASSIGN(ResizeBy);
};
/** @class JumpBy
* @brief Moves a Node object simulating a parabolic jump movement by modifying it's position attribute.
*/
class AX_DLL JumpBy : public ActionInterval
class CC_DLL JumpBy : public ActionInterval
{
public:
/**
@ -845,13 +845,13 @@ protected:
Vec2 _previousPos;
private:
AX_DISALLOW_COPY_AND_ASSIGN(JumpBy);
CC_DISALLOW_COPY_AND_ASSIGN(JumpBy);
};
/** @class JumpTo
* @brief Moves a Node object to a parabolic position simulating a jump movement by modifying it's position attribute.
*/
class AX_DLL JumpTo : public JumpBy
class CC_DLL JumpTo : public JumpBy
{
public:
/**
@ -884,7 +884,7 @@ protected:
Vec2 _endPosition;
private:
AX_DISALLOW_COPY_AND_ASSIGN(JumpTo);
CC_DISALLOW_COPY_AND_ASSIGN(JumpTo);
};
/** @struct Bezier configuration structure
@ -902,7 +902,7 @@ typedef struct _ccBezierConfig
/** @class BezierBy
* @brief An action that moves the target with a cubic Bezier curve by a certain distance.
*/
class AX_DLL BezierBy : public ActionInterval
class CC_DLL BezierBy : public ActionInterval
{
public:
/** Creates the action with a duration and a bezier configuration.
@ -943,14 +943,14 @@ protected:
Vec2 _previousPosition;
private:
AX_DISALLOW_COPY_AND_ASSIGN(BezierBy);
CC_DISALLOW_COPY_AND_ASSIGN(BezierBy);
};
/** @class BezierTo
* @brief An action that moves the target with a cubic Bezier curve to a destination point.
@since v0.8.2
*/
class AX_DLL BezierTo : public BezierBy
class CC_DLL BezierTo : public BezierBy
{
public:
/** Creates the action with a duration and a bezier configuration.
@ -983,7 +983,7 @@ protected:
ccBezierConfig _toConfig;
private:
AX_DISALLOW_COPY_AND_ASSIGN(BezierTo);
CC_DISALLOW_COPY_AND_ASSIGN(BezierTo);
};
/** @class ScaleTo
@ -991,7 +991,7 @@ private:
@warning This action doesn't support "reverse".
@warning The physics body contained in Node doesn't support this action.
*/
class AX_DLL ScaleTo : public ActionInterval
class CC_DLL ScaleTo : public ActionInterval
{
public:
/**
@ -1066,14 +1066,14 @@ protected:
float _deltaZ;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ScaleTo);
CC_DISALLOW_COPY_AND_ASSIGN(ScaleTo);
};
/** @class ScaleBy
* @brief Scales a Node object a zoom factor by modifying it's scale attribute.
@warning The physics body contained in Node doesn't support this action.
*/
class AX_DLL ScaleBy : public ScaleTo
class CC_DLL ScaleBy : public ScaleTo
{
public:
/**
@ -1114,13 +1114,13 @@ public:
virtual ~ScaleBy() {}
private:
AX_DISALLOW_COPY_AND_ASSIGN(ScaleBy);
CC_DISALLOW_COPY_AND_ASSIGN(ScaleBy);
};
/** @class Blink
* @brief Blinks a Node object by modifying it's visible attribute.
*/
class AX_DLL Blink : public ActionInterval
class CC_DLL Blink : public ActionInterval
{
public:
/**
@ -1157,7 +1157,7 @@ protected:
bool _originalState;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Blink);
CC_DISALLOW_COPY_AND_ASSIGN(Blink);
};
/** @class FadeTo
@ -1165,7 +1165,7 @@ private:
custom one.
@warning This action doesn't support "reverse"
*/
class AX_DLL FadeTo : public ActionInterval
class CC_DLL FadeTo : public ActionInterval
{
public:
/**
@ -1203,14 +1203,14 @@ protected:
friend class FadeIn;
private:
AX_DISALLOW_COPY_AND_ASSIGN(FadeTo);
CC_DISALLOW_COPY_AND_ASSIGN(FadeTo);
};
/** @class FadeIn
* @brief Fades In an object that implements the RGBAProtocol protocol. It modifies the opacity from 0 to 255.
The "reverse" of this action is FadeOut
*/
class AX_DLL FadeIn : public FadeTo
class CC_DLL FadeIn : public FadeTo
{
public:
/**
@ -1236,7 +1236,7 @@ public:
virtual ~FadeIn() {}
private:
AX_DISALLOW_COPY_AND_ASSIGN(FadeIn);
CC_DISALLOW_COPY_AND_ASSIGN(FadeIn);
FadeTo* _reverseAction;
};
@ -1244,7 +1244,7 @@ private:
* @brief Fades Out an object that implements the RGBAProtocol protocol. It modifies the opacity from 255 to 0.
The "reverse" of this action is FadeIn
*/
class AX_DLL FadeOut : public FadeTo
class CC_DLL FadeOut : public FadeTo
{
public:
/**
@ -1269,7 +1269,7 @@ public:
virtual ~FadeOut() {}
private:
AX_DISALLOW_COPY_AND_ASSIGN(FadeOut);
CC_DISALLOW_COPY_AND_ASSIGN(FadeOut);
FadeTo* _reverseAction;
};
@ -1278,7 +1278,7 @@ private:
@warning This action doesn't support "reverse"
@since v0.7.2
*/
class AX_DLL TintTo : public ActionInterval
class CC_DLL TintTo : public ActionInterval
{
public:
/**
@ -1320,14 +1320,14 @@ protected:
Color3B _from;
private:
AX_DISALLOW_COPY_AND_ASSIGN(TintTo);
CC_DISALLOW_COPY_AND_ASSIGN(TintTo);
};
/** @class TintBy
@brief Tints a Node that implements the NodeRGB protocol from current tint to a custom one.
@since v0.7.2
*/
class AX_DLL TintBy : public ActionInterval
class CC_DLL TintBy : public ActionInterval
{
public:
/**
@ -1367,13 +1367,13 @@ protected:
int16_t _fromB;
private:
AX_DISALLOW_COPY_AND_ASSIGN(TintBy);
CC_DISALLOW_COPY_AND_ASSIGN(TintBy);
};
/** @class DelayTime
* @brief Delays the action a certain amount of seconds.
*/
class AX_DLL DelayTime : public ActionInterval
class CC_DLL DelayTime : public ActionInterval
{
public:
/**
@ -1397,7 +1397,7 @@ public:
virtual ~DelayTime() {}
private:
AX_DISALLOW_COPY_AND_ASSIGN(DelayTime);
CC_DISALLOW_COPY_AND_ASSIGN(DelayTime);
};
/** @class ReverseTime
@ -1408,7 +1408,7 @@ private:
of your own actions, but using it outside the "reversed"
scope is not recommended.
*/
class AX_DLL ReverseTime : public ActionInterval
class CC_DLL ReverseTime : public ActionInterval
{
public:
/** Creates the action.
@ -1440,14 +1440,14 @@ protected:
FiniteTimeAction* _other;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ReverseTime);
CC_DISALLOW_COPY_AND_ASSIGN(ReverseTime);
};
class Texture2D;
/** @class Animate
* @brief Animates a sprite given the name of an Animation.
*/
class AX_DLL Animate : public ActionInterval
class CC_DLL Animate : public ActionInterval
{
public:
/** Creates the action with an Animation and will restore the original frame when the animation is over.
@ -1504,14 +1504,14 @@ protected:
AnimationFrame::DisplayedEventInfo _frameDisplayedEventInfo;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Animate);
CC_DISALLOW_COPY_AND_ASSIGN(Animate);
};
/** @class TargetedAction
* @brief Overrides the target of an action so that it always runs on the target
* specified at action creation rather than the one specified by runAction.
*/
class AX_DLL TargetedAction : public ActionInterval
class CC_DLL TargetedAction : public ActionInterval
{
public:
/** Create an action with the specified action and forced target.
@ -1557,14 +1557,14 @@ protected:
Node* _forcedTarget;
private:
AX_DISALLOW_COPY_AND_ASSIGN(TargetedAction);
CC_DISALLOW_COPY_AND_ASSIGN(TargetedAction);
};
/**
* @class ActionFloat
* @brief Action used to animate any value in range [from,to] over specified time interval
*/
class AX_DLL ActionFloat : public ActionInterval
class CC_DLL ActionFloat : public ActionInterval
{
public:
/**
@ -1609,7 +1609,7 @@ protected:
ActionFloatCallback _callback;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ActionFloat);
CC_DISALLOW_COPY_AND_ASSIGN(ActionFloat);
};
// end of actions group

View File

@ -245,7 +245,7 @@ void ActionManager::removeAction(Action* action)
if (element)
{
auto i = ccArrayGetIndexOfObject(element->actions, action);
if (i != AX_INVALID_INDEX)
if (i != CC_INVALID_INDEX)
{
removeActionAtIndex(i, element);
}

View File

@ -56,7 +56,7 @@ struct _hashElement;
@since v0.8
*/
class AX_DLL ActionManager : public Ref
class CC_DLL ActionManager : public Ref
{
public:
/**

View File

@ -45,7 +45,7 @@ NS_AX_BEGIN
@since v0.8.2
*/
class AX_DLL PageTurn3D : public Grid3DAction
class CC_DLL PageTurn3D : public Grid3DAction
{
public:
/**

View File

@ -42,7 +42,7 @@ NS_AX_BEGIN
You should specify the destination percentage when creating the action.
@since v0.99.1
*/
class AX_DLL ProgressTo : public ActionInterval
class CC_DLL ProgressTo : public ActionInterval
{
public:
/**
@ -77,14 +77,14 @@ protected:
float _from;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ProgressTo);
CC_DISALLOW_COPY_AND_ASSIGN(ProgressTo);
};
/**
@brief Progress from a percentage to another percentage.
@since v0.99.1
*/
class AX_DLL ProgressFromTo : public ActionInterval
class CC_DLL ProgressFromTo : public ActionInterval
{
public:
/**
@ -121,7 +121,7 @@ protected:
float _from;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ProgressFromTo);
CC_DISALLOW_COPY_AND_ASSIGN(ProgressFromTo);
};
// end of actions group

View File

@ -225,8 +225,8 @@ ShuffleTiles* ShuffleTiles::clone() const
ShuffleTiles::~ShuffleTiles()
{
AX_SAFE_DELETE_ARRAY(_tilesOrder);
AX_SAFE_DELETE_ARRAY(_tiles);
CC_SAFE_DELETE_ARRAY(_tilesOrder);
CC_SAFE_DELETE_ARRAY(_tiles);
}
void ShuffleTiles::shuffle(unsigned int* array, unsigned int len)
@ -569,7 +569,7 @@ TurnOffTiles* TurnOffTiles::clone() const
TurnOffTiles::~TurnOffTiles()
{
AX_SAFE_DELETE_ARRAY(_tilesOrder);
CC_SAFE_DELETE_ARRAY(_tilesOrder);
}
void TurnOffTiles::shuffle(unsigned int* array, unsigned int len)

View File

@ -42,7 +42,7 @@ NS_AX_BEGIN
You can create the action by these parameters:
duration, grid size, range, whether shake on the z axis.
*/
class AX_DLL ShakyTiles3D : public TiledGrid3DAction
class CC_DLL ShakyTiles3D : public TiledGrid3DAction
{
public:
/**
@ -77,7 +77,7 @@ protected:
bool _shakeZ;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ShakyTiles3D);
CC_DISALLOW_COPY_AND_ASSIGN(ShakyTiles3D);
};
/**
@ -86,7 +86,7 @@ private:
You can create the action by these parameters:
duration, grid size, range, whether shatter on the z axis.
*/
class AX_DLL ShatteredTiles3D : public TiledGrid3DAction
class CC_DLL ShatteredTiles3D : public TiledGrid3DAction
{
public:
/**
@ -122,7 +122,7 @@ protected:
bool _shatterZ;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ShatteredTiles3D);
CC_DISALLOW_COPY_AND_ASSIGN(ShatteredTiles3D);
};
struct Tile;
@ -132,7 +132,7 @@ struct Tile;
You can create the action by these parameters:
duration, grid size, the random seed.
*/
class AX_DLL ShuffleTiles : public TiledGrid3DAction
class CC_DLL ShuffleTiles : public TiledGrid3DAction
{
public:
/**
@ -172,14 +172,14 @@ protected:
Tile* _tiles;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ShuffleTiles);
CC_DISALLOW_COPY_AND_ASSIGN(ShuffleTiles);
};
/**
@brief FadeOutTRTiles action.
@details Fades out the target node with many tiles from Bottom-Left to Top-Right.
*/
class AX_DLL FadeOutTRTiles : public TiledGrid3DAction
class CC_DLL FadeOutTRTiles : public TiledGrid3DAction
{
public:
/**
@ -225,14 +225,14 @@ public:
virtual ~FadeOutTRTiles() {}
private:
AX_DISALLOW_COPY_AND_ASSIGN(FadeOutTRTiles);
CC_DISALLOW_COPY_AND_ASSIGN(FadeOutTRTiles);
};
/**
@brief FadeOutBLTiles action.
@details Fades out the target node with many tiles from Top-Right to Bottom-Left.
*/
class AX_DLL FadeOutBLTiles : public FadeOutTRTiles
class CC_DLL FadeOutBLTiles : public FadeOutTRTiles
{
public:
/**
@ -251,14 +251,14 @@ public:
virtual ~FadeOutBLTiles() {}
private:
AX_DISALLOW_COPY_AND_ASSIGN(FadeOutBLTiles);
CC_DISALLOW_COPY_AND_ASSIGN(FadeOutBLTiles);
};
/**
@brief FadeOutUpTiles action.
@details Fades out the target node with many tiles from bottom to top.
*/
class AX_DLL FadeOutUpTiles : public FadeOutTRTiles
class CC_DLL FadeOutUpTiles : public FadeOutTRTiles
{
public:
/**
@ -279,14 +279,14 @@ public:
virtual ~FadeOutUpTiles() {}
private:
AX_DISALLOW_COPY_AND_ASSIGN(FadeOutUpTiles);
CC_DISALLOW_COPY_AND_ASSIGN(FadeOutUpTiles);
};
/**
@brief FadeOutDownTiles action.
@details Fades out the target node with many tiles from top to bottom.
*/
class AX_DLL FadeOutDownTiles : public FadeOutUpTiles
class CC_DLL FadeOutDownTiles : public FadeOutUpTiles
{
public:
/**
@ -305,14 +305,14 @@ public:
virtual ~FadeOutDownTiles() {}
private:
AX_DISALLOW_COPY_AND_ASSIGN(FadeOutDownTiles);
CC_DISALLOW_COPY_AND_ASSIGN(FadeOutDownTiles);
};
/**
@brief TurnOffTiles action.
@details Turn off the target node with many tiles in random order.
*/
class AX_DLL TurnOffTiles : public TiledGrid3DAction
class CC_DLL TurnOffTiles : public TiledGrid3DAction
{
public:
/**
@ -373,14 +373,14 @@ protected:
unsigned int* _tilesOrder;
private:
AX_DISALLOW_COPY_AND_ASSIGN(TurnOffTiles);
CC_DISALLOW_COPY_AND_ASSIGN(TurnOffTiles);
};
/**
@brief WavesTiles3D action.
@details This action wave the target node with many tiles.
*/
class AX_DLL WavesTiles3D : public TiledGrid3DAction
class CC_DLL WavesTiles3D : public TiledGrid3DAction
{
public:
/**
@ -438,14 +438,14 @@ protected:
float _amplitudeRate;
private:
AX_DISALLOW_COPY_AND_ASSIGN(WavesTiles3D);
CC_DISALLOW_COPY_AND_ASSIGN(WavesTiles3D);
};
/**
@brief JumpTiles3D action.
@details Move the tiles of a target node across the Z axis.
*/
class AX_DLL JumpTiles3D : public TiledGrid3DAction
class CC_DLL JumpTiles3D : public TiledGrid3DAction
{
public:
/**
@ -503,7 +503,7 @@ protected:
float _amplitudeRate;
private:
AX_DISALLOW_COPY_AND_ASSIGN(JumpTiles3D);
CC_DISALLOW_COPY_AND_ASSIGN(JumpTiles3D);
};
/**
@ -511,7 +511,7 @@ private:
@details Split the target node in many rows.
Then move out some rows from left, move out the other rows from right.
*/
class AX_DLL SplitRows : public TiledGrid3DAction
class CC_DLL SplitRows : public TiledGrid3DAction
{
public:
/**
@ -543,7 +543,7 @@ protected:
Vec2 _winSize;
private:
AX_DISALLOW_COPY_AND_ASSIGN(SplitRows);
CC_DISALLOW_COPY_AND_ASSIGN(SplitRows);
};
/**
@ -551,7 +551,7 @@ private:
@details Split the target node in many columns.
Then move out some columns from top, move out the other columns from bottom.
*/
class AX_DLL SplitCols : public TiledGrid3DAction
class CC_DLL SplitCols : public TiledGrid3DAction
{
public:
/**
@ -586,7 +586,7 @@ protected:
Vec2 _winSize;
private:
AX_DISALLOW_COPY_AND_ASSIGN(SplitCols);
CC_DISALLOW_COPY_AND_ASSIGN(SplitCols);
};
// end of actions group

View File

@ -45,7 +45,7 @@ NS_AX_BEGIN
Then once you running ActionTween on the node, the method updateTweenAction will be invoked.
*/
class AX_DLL ActionTweenDelegate
class CC_DLL ActionTweenDelegate
{
public:
/**
@ -82,7 +82,7 @@ public:
@since v0.99.2
*/
class AX_DLL ActionTween : public ActionInterval
class CC_DLL ActionTween : public ActionInterval
{
public:
/**

View File

@ -41,7 +41,7 @@ AnimationFrame* AnimationFrame::create(SpriteFrame* spriteFrame, float delayUnit
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -61,7 +61,7 @@ AnimationFrame::~AnimationFrame()
{
CCLOGINFO("deallocing AnimationFrame: %p", this);
AX_SAFE_RELEASE(_spriteFrame);
CC_SAFE_RELEASE(_spriteFrame);
}
AnimationFrame* AnimationFrame::clone() const

View File

@ -25,8 +25,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __AX_ANIMATION_H__
#define __AX_ANIMATION_H__
#ifndef __CC_ANIMATION_H__
#define __CC_ANIMATION_H__
#include "platform/CCPlatformConfig.h"
#include "base/CCRef.h"
@ -55,7 +55,7 @@ class SpriteFrame;
@since v2.0
*/
class AX_DLL AnimationFrame : public Ref, public Clonable
class CC_DLL AnimationFrame : public Ref, public Clonable
{
public:
/** @struct DisplayedEventInfo
@ -87,8 +87,8 @@ public:
*/
void setSpriteFrame(SpriteFrame* frame)
{
AX_SAFE_RETAIN(frame);
AX_SAFE_RELEASE(_spriteFrame);
CC_SAFE_RETAIN(frame);
CC_SAFE_RELEASE(_spriteFrame);
_spriteFrame = frame;
}
@ -146,7 +146,7 @@ protected:
ValueMap _userInfo;
private:
AX_DISALLOW_COPY_AND_ASSIGN(AnimationFrame);
CC_DISALLOW_COPY_AND_ASSIGN(AnimationFrame);
};
/** @class Animation
@ -157,7 +157,7 @@ private:
* sprite->runAction(Animate::create(animation));
* @endcode
*/
class AX_DLL Animation : public Ref, public Clonable
class CC_DLL Animation : public Ref, public Clonable
{
public:
/** Creates an animation.
@ -314,7 +314,7 @@ protected:
unsigned int _loops;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Animation);
CC_DISALLOW_COPY_AND_ASSIGN(Animation);
};
// end of sprite_nodes group
@ -322,4 +322,4 @@ private:
NS_AX_END
#endif // __AX_ANIMATION_H__
#endif // __CC_ANIMATION_H__

View File

@ -48,7 +48,7 @@ AnimationCache* AnimationCache::getInstance()
void AnimationCache::destroyInstance()
{
AX_SAFE_RELEASE_NULL(s_sharedAnimationCache);
CC_SAFE_RELEASE_NULL(s_sharedAnimationCache);
}
bool AnimationCache::init()

View File

@ -25,8 +25,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __AX_ANIMATION_CACHE_H__
#define __AX_ANIMATION_CACHE_H__
#ifndef __CC_ANIMATION_CACHE_H__
#define __CC_ANIMATION_CACHE_H__
#include "base/CCRef.h"
#include "base/CCMap.h"
@ -52,7 +52,7 @@ Before v0.99.5, the recommend way was to save them on the Sprite. Since v0.99.5,
@since v0.99.5
@js cc.animationCache
*/
class AX_DLL AnimationCache : public Ref
class CC_DLL AnimationCache : public Ref
{
public:
/**
@ -129,4 +129,4 @@ private:
NS_AX_END
#endif // __AX_ANIMATION_CACHE_H__
#endif // __CC_ANIMATION_CACHE_H__

View File

@ -44,7 +44,7 @@ NS_AX_BEGIN
AtlasNode::~AtlasNode()
{
AX_SAFE_RELEASE(_textureAtlas);
CC_SAFE_RELEASE(_textureAtlas);
}
AtlasNode* AtlasNode::create(std::string_view tile, int tileWidth, int tileHeight, int itemsToRender)
@ -55,7 +55,7 @@ AtlasNode* AtlasNode::create(std::string_view tile, int tileWidth, int tileHeigh
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -270,8 +270,8 @@ Texture2D* AtlasNode::getTexture() const
void AtlasNode::setTextureAtlas(TextureAtlas* textureAtlas)
{
AX_SAFE_RETAIN(textureAtlas);
AX_SAFE_RELEASE(_textureAtlas);
CC_SAFE_RETAIN(textureAtlas);
CC_SAFE_RELEASE(_textureAtlas);
_textureAtlas = textureAtlas;
}

View File

@ -47,7 +47,7 @@ class TextureAtlas;
* All features from Node are valid, plus the following features:
* - opacity and RGB colors.
*/
class AX_DLL AtlasNode : public Node, public TextureProtocol
class CC_DLL AtlasNode : public Node, public TextureProtocol
{
public:
/** creates a AtlasNode with an Atlas file the width and height of each item and the quantity of items to render.
@ -147,7 +147,7 @@ protected:
backend::UniformLocation _mvpMatrixLocation;
private:
AX_DISALLOW_COPY_AND_ASSIGN(AtlasNode);
CC_DISALLOW_COPY_AND_ASSIGN(AtlasNode);
};
// end of base_node group

View File

@ -133,12 +133,12 @@ void PolygonInfo::releaseVertsAndIndices()
{
if (nullptr != triangles.verts)
{
AX_SAFE_DELETE_ARRAY(triangles.verts);
CC_SAFE_DELETE_ARRAY(triangles.verts);
}
if (nullptr != triangles.indices)
{
AX_SAFE_DELETE_ARRAY(triangles.indices);
CC_SAFE_DELETE_ARRAY(triangles.indices);
}
}
}
@ -184,7 +184,7 @@ AutoPolygon::AutoPolygon(std::string_view filename)
AutoPolygon::~AutoPolygon()
{
AX_SAFE_DELETE(_image);
CC_SAFE_DELETE(_image);
}
std::vector<Vec2> AutoPolygon::trace(const Rect& rect, float threshold)
@ -694,7 +694,7 @@ Rect AutoPolygon::getRealRect(const Rect& rect)
else
{
// rect is specified, so convert to real rect
realRect = AX_RECT_POINTS_TO_PIXELS(rect);
realRect = CC_RECT_POINTS_TO_PIXELS(rect);
}
return realRect;
}

View File

@ -45,7 +45,7 @@ NS_AX_BEGIN
* PolygonInfo is an object holding the required data to display Sprites.
* It can be a simple as a triangle, or as complex as a whole 3D mesh
*/
class AX_DLL PolygonInfo
class CC_DLL PolygonInfo
{
public:
/// @name Creators
@ -138,7 +138,7 @@ private:
* It has functions for each step in the process, from tracing all the points, to triangulation
* the result can be then passed to Sprite::create() to create a Polygon Sprite
*/
class AX_DLL AutoPolygon
class CC_DLL AutoPolygon
{
public:
/**

View File

@ -119,7 +119,7 @@ Camera::Camera()
Camera::~Camera()
{
AX_SAFE_RELEASE(_clearBrush);
CC_SAFE_RELEASE(_clearBrush);
}
const Mat4& Camera::getProjectionMatrix() const
@ -572,8 +572,8 @@ void Camera::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t par
void Camera::setBackgroundBrush(CameraBackgroundBrush* clearBrush)
{
AX_SAFE_RETAIN(clearBrush);
AX_SAFE_RELEASE(_clearBrush);
CC_SAFE_RETAIN(clearBrush);
CC_SAFE_RELEASE(_clearBrush);
_clearBrush = clearBrush;
}

View File

@ -63,7 +63,7 @@ enum class CameraFlag
/**
* Defines a camera .
*/
class AX_DLL Camera : public Node
class CC_DLL Camera : public Node
{
friend class Scene;
friend class Director;

View File

@ -36,7 +36,7 @@
#include "renderer/CCTextureCube.h"
#include "renderer/ccShaders.h"
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
# include "base/CCEventCustom.h"
# include "base/CCEventListenerCustom.h"
# include "base/CCEventType.h"
@ -49,7 +49,7 @@ CameraBackgroundBrush::CameraBackgroundBrush() {}
CameraBackgroundBrush::~CameraBackgroundBrush()
{
AX_SAFE_RELEASE_NULL(_programState);
CC_SAFE_RELEASE_NULL(_programState);
}
CameraBackgroundBrush* CameraBackgroundBrush::createNoneBrush()
@ -86,11 +86,11 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundBrush::createSkyboxBrush(std::strin
CameraBackgroundDepthBrush::CameraBackgroundDepthBrush()
: _depth(0.f)
, _clearColor(false)
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
, _backToForegroundListener(nullptr)
#endif
{
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
_backToForegroundListener =
EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { initBuffer(); });
Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1);
@ -98,7 +98,7 @@ CameraBackgroundDepthBrush::CameraBackgroundDepthBrush()
}
CameraBackgroundDepthBrush::~CameraBackgroundDepthBrush()
{
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener);
#endif
}
@ -114,7 +114,7 @@ CameraBackgroundDepthBrush* CameraBackgroundDepthBrush::create(float depth)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
@ -122,7 +122,7 @@ CameraBackgroundDepthBrush* CameraBackgroundDepthBrush::create(float depth)
bool CameraBackgroundDepthBrush::init()
{
AX_SAFE_RELEASE_NULL(_programState);
CC_SAFE_RELEASE_NULL(_programState);
auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::CAMERA_CLEAR);
_programState = new backend::ProgramState(program);
@ -166,8 +166,8 @@ bool CameraBackgroundDepthBrush::init()
_vertices[2].texCoords = Tex2F(1, 1);
_vertices[3].texCoords = Tex2F(0, 1);
_customCommand.setBeforeCallback(AX_CALLBACK_0(CameraBackgroundDepthBrush::onBeforeDraw, this));
_customCommand.setAfterCallback(AX_CALLBACK_0(CameraBackgroundDepthBrush::onAfterDraw, this));
_customCommand.setBeforeCallback(CC_CALLBACK_0(CameraBackgroundDepthBrush::onBeforeDraw, this));
_customCommand.setAfterCallback(CC_CALLBACK_0(CameraBackgroundDepthBrush::onAfterDraw, this));
initBuffer();
return true;
@ -273,7 +273,7 @@ CameraBackgroundColorBrush* CameraBackgroundColorBrush::create(const Color4F& co
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
@ -284,11 +284,11 @@ CameraBackgroundSkyBoxBrush::CameraBackgroundSkyBoxBrush()
: _texture(nullptr)
, _actived(true)
, _textureValid(true)
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
, _backToForegroundListener(nullptr)
#endif
{
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
_backToForegroundListener =
EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { initBuffer(); });
Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1);
@ -297,8 +297,8 @@ CameraBackgroundSkyBoxBrush::CameraBackgroundSkyBoxBrush()
CameraBackgroundSkyBoxBrush::~CameraBackgroundSkyBoxBrush()
{
AX_SAFE_RELEASE(_texture);
#if AX_ENABLE_CACHE_TEXTURE_DATA
CC_SAFE_RELEASE(_texture);
#if CC_ENABLE_CACHE_TEXTURE_DATA
Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener);
#endif
}
@ -333,8 +333,8 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundSkyBoxBrush::create(std::string_vie
}
else
{
AX_SAFE_DELETE(texture);
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(texture);
CC_SAFE_DELETE(ret);
}
}
@ -351,7 +351,7 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundSkyBoxBrush::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
@ -386,16 +386,16 @@ void CameraBackgroundSkyBoxBrush::drawBackground(Camera* camera)
renderer->popGroup();
AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8);
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8);
}
bool CameraBackgroundSkyBoxBrush::init()
{
_customCommand.setBeforeCallback(AX_CALLBACK_0(CameraBackgroundSkyBoxBrush::onBeforeDraw, this));
_customCommand.setAfterCallback(AX_CALLBACK_0(CameraBackgroundSkyBoxBrush::onAfterDraw, this));
_customCommand.setBeforeCallback(CC_CALLBACK_0(CameraBackgroundSkyBoxBrush::onBeforeDraw, this));
_customCommand.setAfterCallback(CC_CALLBACK_0(CameraBackgroundSkyBoxBrush::onAfterDraw, this));
AX_SAFE_RELEASE_NULL(_programState);
CC_SAFE_RELEASE_NULL(_programState);
auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::SKYBOX_3D);
_programState = new backend::ProgramState(program);
_uniformColorLoc = _programState->getUniformLocation("u_color");
@ -444,8 +444,8 @@ void CameraBackgroundSkyBoxBrush::initBuffer()
void CameraBackgroundSkyBoxBrush::setTexture(TextureCube* texture)
{
AX_SAFE_RETAIN(texture);
AX_SAFE_RELEASE(_texture);
CC_SAFE_RETAIN(texture);
CC_SAFE_RELEASE(_texture);
_texture = texture;
_programState->setTexture(_uniformEnvLoc, 0, _texture->getBackendTexture());
}

View File

@ -54,7 +54,7 @@ class Buffer;
* background with given color and depth, Skybox brush clear the background with a skybox. Camera uses depth brush by
* default.
*/
class AX_DLL CameraBackgroundBrush : public Ref
class CC_DLL CameraBackgroundBrush : public Ref
{
public:
/**
@ -130,7 +130,7 @@ protected:
/**
* Depth brush clear depth buffer with given depth
*/
class AX_DLL CameraBackgroundDepthBrush : public CameraBackgroundBrush
class CC_DLL CameraBackgroundDepthBrush : public CameraBackgroundBrush
{
public:
/**
@ -167,7 +167,7 @@ private:
void onAfterDraw();
protected:
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
EventListenerCustom* _backToForegroundListener;
#endif
void initBuffer();
@ -191,7 +191,7 @@ protected:
/**
* Color brush clear buffer with given depth and color
*/
class AX_DLL CameraBackgroundColorBrush : public CameraBackgroundDepthBrush
class CC_DLL CameraBackgroundColorBrush : public CameraBackgroundDepthBrush
{
public:
/**
@ -235,7 +235,7 @@ class EventListenerCustom;
/**
* Skybox brush clear buffer with a skybox
*/
class AX_DLL CameraBackgroundSkyBoxBrush : public CameraBackgroundBrush
class CC_DLL CameraBackgroundSkyBoxBrush : public CameraBackgroundBrush
{
public:
/**
@ -298,7 +298,7 @@ protected:
TextureCube* _texture;
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
EventListenerCustom* _backToForegroundListener;
#endif

View File

@ -43,7 +43,7 @@ ClippingNode::~ClippingNode()
_stencil->stopAllActions();
_stencil->release();
}
AX_SAFE_DELETE(_stencilStateManager);
CC_SAFE_DELETE(_stencilStateManager);
}
ClippingNode* ClippingNode::create()
@ -55,7 +55,7 @@ ClippingNode* ClippingNode::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
@ -70,7 +70,7 @@ ClippingNode* ClippingNode::create(Node* pStencil)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
@ -153,7 +153,7 @@ void ClippingNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32
renderer->pushGroup(_groupCommandStencil.getRenderQueueID());
// _beforeVisitCmd.init(_globalZOrder);
// _beforeVisitCmd.func = AX_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilStateManager);
// _beforeVisitCmd.func = CC_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilStateManager);
// renderer->addCommand(&_beforeVisitCmd);
_stencilStateManager->onBeforeVisit(_globalZOrder);
@ -166,14 +166,14 @@ void ClippingNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32
programState->setUniform(alphaLocation, &alphaThreshold, sizeof(alphaThreshold));
setProgramStateRecursively(_stencil, programState);
AX_SAFE_RELEASE_NULL(programState);
CC_SAFE_RELEASE_NULL(programState);
}
_stencil->visit(renderer, _modelViewTransform, flags);
auto afterDrawStencilCmd = renderer->nextCallbackCommand();
afterDrawStencilCmd->init(_globalZOrder);
afterDrawStencilCmd->func = AX_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilStateManager);
afterDrawStencilCmd->func = CC_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilStateManager);
renderer->addCommand(afterDrawStencilCmd);
bool visibleByCamera = isVisitableByVisitingCamera();
@ -215,7 +215,7 @@ void ClippingNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32
auto _afterVisitCmd = renderer->nextCallbackCommand();
_afterVisitCmd->init(_globalZOrder);
_afterVisitCmd->func = AX_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager);
_afterVisitCmd->func = CC_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager);
renderer->addCommand(_afterVisitCmd);
renderer->popGroup();
@ -242,7 +242,7 @@ void ClippingNode::setStencil(Node* stencil)
if (_stencil == stencil)
return;
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
@ -251,7 +251,7 @@ void ClippingNode::setStencil(Node* stencil)
if (stencil)
sEngine->retainScriptObject(this, stencil);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
// cleanup current stencil
if (_stencil != nullptr && _stencil->isRunning())
@ -259,11 +259,11 @@ void ClippingNode::setStencil(Node* stencil)
_stencil->onExitTransitionDidStart();
_stencil->onExit();
}
AX_SAFE_RELEASE_NULL(_stencil);
CC_SAFE_RELEASE_NULL(_stencil);
// initialise new stencil
_stencil = stencil;
AX_SAFE_RETAIN(_stencil);
CC_SAFE_RETAIN(_stencil);
if (_stencil != nullptr && this->isRunning())
{
_stencil->onEnter();

View File

@ -44,7 +44,7 @@ class StencilStateManager;
* The stencil is an other Node that will not be drawn.
* The clipping is done using the alpha part of the stencil (adjusted with an alphaThreshold).
*/
class AX_DLL ClippingNode : public Node
class CC_DLL ClippingNode : public Node
{
public:
/** Creates and initializes a clipping node without a stencil.
@ -166,7 +166,7 @@ protected:
std::unordered_map<Node*, backend::ProgramState*> _originalStencilProgramState;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ClippingNode);
CC_DISALLOW_COPY_AND_ASSIGN(ClippingNode);
};
/** @} */
NS_AX_END

View File

@ -38,7 +38,7 @@ ClippingRectangleNode* ClippingRectangleNode::create(const Rect& clippingRegion)
node->autorelease();
}
else
AX_SAFE_DELETE(node);
CC_SAFE_DELETE(node);
return node;
}
@ -49,7 +49,7 @@ ClippingRectangleNode* ClippingRectangleNode::create()
if (node->init())
node->autorelease();
else
AX_SAFE_DELETE(node);
CC_SAFE_DELETE(node);
return node;
}
@ -94,14 +94,14 @@ void ClippingRectangleNode::visit(Renderer* renderer, const Mat4& parentTransfor
{
auto beforeVisitCmdScissor = renderer->nextCallbackCommand();
beforeVisitCmdScissor->init(_globalZOrder);
beforeVisitCmdScissor->func = AX_CALLBACK_0(ClippingRectangleNode::onBeforeVisitScissor, this);
beforeVisitCmdScissor->func = CC_CALLBACK_0(ClippingRectangleNode::onBeforeVisitScissor, this);
renderer->addCommand(beforeVisitCmdScissor);
Node::visit(renderer, parentTransform, parentFlags);
auto afterVisitCmdScissor = renderer->nextCallbackCommand();
afterVisitCmdScissor->init(_globalZOrder);
afterVisitCmdScissor->func = AX_CALLBACK_0(ClippingRectangleNode::onAfterVisitScissor, this);
afterVisitCmdScissor->func = CC_CALLBACK_0(ClippingRectangleNode::onAfterVisitScissor, this);
renderer->addCommand(afterVisitCmdScissor);
}

View File

@ -43,7 +43,7 @@ NS_AX_BEGIN
The region of ClippingRectangleNode doesn't support any transform except scale.
@js NA
*/
class AX_DLL ClippingRectangleNode : public Node
class CC_DLL ClippingRectangleNode : public Node
{
public:
/**

View File

@ -61,7 +61,7 @@ Component* Component::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;

View File

@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __AX_FRAMEWORK_COMPONENT_H__
#define __AX_FRAMEWORK_COMPONENT_H__
#ifndef __CC_FRAMEWORK_COMPONENT_H__
#define __CC_FRAMEWORK_COMPONENT_H__
/// @cond DO_NOT_SHOW
#include <string>
@ -44,7 +44,7 @@ enum
kComponentOnUpdate
};
class AX_DLL Component : public Ref
class CC_DLL Component : public Ref
{
public:
static Component* create();
@ -88,4 +88,4 @@ protected:
NS_AX_END
/// @endcond
#endif // __AX_FRAMEWORK_COMPONENT_H__
#endif // __CC_FRAMEWORK_COMPONENT_H__

View File

@ -76,7 +76,7 @@ bool ComponentContainer::remove(std::string_view componentName)
do
{
auto iter = _componentMap.find(componentName);
AX_BREAK_IF(iter == _componentMap.end());
CC_BREAK_IF(iter == _componentMap.end());
auto component = iter->second;
_componentMap.erase(componentName);
@ -116,12 +116,12 @@ void ComponentContainer::visit(float delta)
{
if (!_componentMap.empty())
{
AX_SAFE_RETAIN(_owner);
CC_SAFE_RETAIN(_owner);
for (auto& iter : _componentMap)
{
iter.second->update(delta);
}
AX_SAFE_RELEASE(_owner);
CC_SAFE_RELEASE(_owner);
}
}

View File

@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __AX_FRAMEWORK_COMCONTAINER_H__
#define __AX_FRAMEWORK_COMCONTAINER_H__
#ifndef __CC_FRAMEWORK_COMCONTAINER_H__
#define __CC_FRAMEWORK_COMCONTAINER_H__
/// @cond DO_NOT_SHOW
@ -36,7 +36,7 @@ NS_AX_BEGIN
class Component;
class Node;
class AX_DLL ComponentContainer
class CC_DLL ComponentContainer
{
protected:
/**
@ -77,4 +77,4 @@ private:
NS_AX_END
/// @endcond
#endif // __AX_FRAMEWORK_COMCONTAINER_H__
#endif // __CC_FRAMEWORK_COMCONTAINER_H__

View File

@ -49,7 +49,7 @@ static inline Tex2F v2ToTex2F(const Vec2& v)
DrawNode::DrawNode(float lineWidth) : _lineWidth(lineWidth), _defaultLineWidth(lineWidth)
{
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
// TODO new-renderer: interface setupBuffer removal
// Need to listen the event only when not use batchnode, because it will use VBO
@ -64,9 +64,9 @@ DrawNode::DrawNode(float lineWidth) : _lineWidth(lineWidth), _defaultLineWidth(l
DrawNode::~DrawNode()
{
AX_SAFE_FREE(_bufferTriangle);
AX_SAFE_FREE(_bufferPoint);
AX_SAFE_FREE(_bufferLine);
CC_SAFE_FREE(_bufferTriangle);
CC_SAFE_FREE(_bufferPoint);
CC_SAFE_FREE(_bufferLine);
freeShaderInternal(_customCommandTriangle);
freeShaderInternal(_customCommandPoint);
@ -82,7 +82,7 @@ DrawNode* DrawNode::create(float defaultLineWidth)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
@ -166,7 +166,7 @@ void DrawNode::updateShaderInternal(CustomCommand& cmd,
CustomCommand::PrimitiveType primitiveType)
{
auto& pipelinePS = cmd.getPipelineDescriptor().programState;
AX_SAFE_RELEASE(pipelinePS);
CC_SAFE_RELEASE(pipelinePS);
auto program = backend::Program::getBuiltinProgram(programType);
pipelinePS = new backend::ProgramState(program);
@ -178,7 +178,7 @@ void DrawNode::updateShaderInternal(CustomCommand& cmd,
void DrawNode::freeShaderInternal(CustomCommand& cmd)
{
auto& pipelinePS = cmd.getPipelineDescriptor().programState;
AX_SAFE_RELEASE_NULL(pipelinePS);
CC_SAFE_RELEASE_NULL(pipelinePS);
}
void DrawNode::setVertexLayout(CustomCommand& cmd)

View File

@ -54,7 +54,7 @@ class PointArray;
* Faster than the "drawing primitives" since they draws everything in one single batch.
* @since v2.1
*/
class AX_DLL DrawNode : public Node
class CC_DLL DrawNode : public Node
{
public:
/** creates and initialize a DrawNode node.
@ -412,7 +412,7 @@ protected:
axis::any_buffer _abuf;
private:
AX_DISALLOW_COPY_AND_ASSIGN(DrawNode);
CC_DISALLOW_COPY_AND_ASSIGN(DrawNode);
};
/** @} */
NS_AX_END

View File

@ -65,7 +65,7 @@ FastTMXLayer* FastTMXLayer::create(TMXTilesetInfo* tilesetInfo, TMXLayerInfo* la
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -88,7 +88,7 @@ bool FastTMXLayer::initWithTilesetInfo(TMXTilesetInfo* tilesetInfo, TMXLayerInfo
// tilesetInfo
_tileSet = tilesetInfo;
AX_SAFE_RETAIN(_tileSet);
CC_SAFE_RETAIN(_tileSet);
// mapInfo
_mapTileSize = mapInfo->getTileSize();
@ -98,10 +98,10 @@ bool FastTMXLayer::initWithTilesetInfo(TMXTilesetInfo* tilesetInfo, TMXLayerInfo
// offset (after layer orientation is set);
Vec2 offset = this->calculateLayerOffset(layerInfo->_offset);
this->setPosition(AX_POINT_PIXELS_TO_POINTS(offset));
this->setPosition(CC_POINT_PIXELS_TO_POINTS(offset));
this->setContentSize(
AX_SIZE_PIXELS_TO_POINTS(Vec2(_layerSize.width * _mapTileSize.width, _layerSize.height * _mapTileSize.height)));
CC_SIZE_PIXELS_TO_POINTS(Vec2(_layerSize.width * _mapTileSize.width, _layerSize.height * _mapTileSize.height)));
this->tileToNodeTransform();
@ -115,15 +115,15 @@ FastTMXLayer::FastTMXLayer() {}
FastTMXLayer::~FastTMXLayer()
{
AX_SAFE_RELEASE(_tileSet);
AX_SAFE_RELEASE(_texture);
AX_SAFE_FREE(_tiles);
AX_SAFE_RELEASE(_vertexBuffer);
AX_SAFE_RELEASE(_indexBuffer);
CC_SAFE_RELEASE(_tileSet);
CC_SAFE_RELEASE(_texture);
CC_SAFE_FREE(_tiles);
CC_SAFE_RELEASE(_vertexBuffer);
CC_SAFE_RELEASE(_indexBuffer);
for (auto& e : _customCommands)
{
AX_SAFE_RELEASE(e.second->getPipelineDescriptor().programState);
CC_SAFE_RELEASE(e.second->getPipelineDescriptor().programState);
delete e.second;
}
}
@ -167,8 +167,8 @@ void FastTMXLayer::draw(Renderer* renderer, const Mat4& transform, uint32_t flag
void FastTMXLayer::updateTiles(const Rect& culledRect)
{
Rect visibleTiles = Rect(culledRect.origin, culledRect.size * _director->getContentScaleFactor());
Vec2 mapTileSize = AX_SIZE_PIXELS_TO_POINTS(_mapTileSize);
Vec2 tileSize = AX_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize);
Vec2 mapTileSize = CC_SIZE_PIXELS_TO_POINTS(_mapTileSize);
Vec2 tileSize = CC_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize);
Mat4 nodeToTileTransform = _tileToNodeTransform.getInversed();
// transform to tile
visibleTiles = RectApplyTransform(visibleTiles, nodeToTileTransform);
@ -275,7 +275,7 @@ void FastTMXLayer::updateVertexBuffer()
void FastTMXLayer::updateIndexBuffer()
{
#ifdef AX_FAST_TILEMAP_32_BIT_INDICES
#ifdef CC_FAST_TILEMAP_32_BIT_INDICES
unsigned int indexBufferSize = (unsigned int)(sizeof(unsigned int) * _indices.size());
#else
unsigned int indexBufferSize = (unsigned int)(sizeof(unsigned short) * _indices.size());
@ -384,8 +384,8 @@ void FastTMXLayer::setupTiles()
Mat4 FastTMXLayer::tileToNodeTransform()
{
float w = _mapTileSize.width / AX_CONTENT_SCALE_FACTOR();
float h = _mapTileSize.height / AX_CONTENT_SCALE_FACTOR();
float w = _mapTileSize.width / CC_CONTENT_SCALE_FACTOR();
float h = _mapTileSize.height / CC_CONTENT_SCALE_FACTOR();
float offY = (_layerSize.height - 1) * h;
switch (_layerOrientation)
@ -432,7 +432,7 @@ void FastTMXLayer::updatePrimitives()
command->setVertexBuffer(_vertexBuffer);
CustomCommand::IndexFormat indexFormat = CustomCommand::IndexFormat::U_SHORT;
#if AX_FAST_TILEMAP_32_BIT_INDICES
#if CC_FAST_TILEMAP_32_BIT_INDICES
indexFormat = CustomCommand::IndexFormat::U_INT;
#endif
command->setIndexBuffer(_indexBuffer, indexFormat);
@ -443,7 +443,7 @@ void FastTMXLayer::updatePrimitives()
if (_useAutomaticVertexZ)
{
AX_SAFE_RELEASE(pipelineDescriptor.programState);
CC_SAFE_RELEASE(pipelineDescriptor.programState);
auto* program =
backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE_COLOR_ALPHA_TEST);
auto programState = new backend::ProgramState(program);
@ -454,7 +454,7 @@ void FastTMXLayer::updatePrimitives()
}
else
{
AX_SAFE_RELEASE(pipelineDescriptor.programState);
CC_SAFE_RELEASE(pipelineDescriptor.programState);
auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE_COLOR);
auto programState = new backend::ProgramState(program);
pipelineDescriptor.programState = programState;
@ -504,7 +504,7 @@ void FastTMXLayer::updateTotalQuads()
{
if (_quadsDirty)
{
Vec2 tileSize = AX_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize);
Vec2 tileSize = CC_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize);
Vec2 texSize = _tileSet->_imageSize;
_tileToQuadIndex.clear();
_totalQuads.resize(int(_layerSize.width * _layerSize.height));
@ -669,7 +669,7 @@ Sprite* FastTMXLayer::getTileAt(const Vec2& tileCoordinate)
{
// tile not created yet. create it
Rect rect = _tileSet->getRectForGID(gid);
rect = AX_RECT_PIXELS_TO_POINTS(rect);
rect = CC_RECT_PIXELS_TO_POINTS(rect);
tile = Sprite::createWithTexture(_texture, rect);
Vec2 p = this->getPositionAt(tileCoordinate);
@ -890,7 +890,7 @@ void FastTMXLayer::setTileGID(int gid, const Vec2& tileCoordinate, TMXTileFlags
{
Sprite* sprite = it->second.first;
Rect rect = _tileSet->getRectForGID(gid);
rect = AX_RECT_PIXELS_TO_POINTS(rect);
rect = CC_RECT_PIXELS_TO_POINTS(rect);
sprite->setTextureRect(rect, false, rect.size);
this->reorderChild(sprite, z);
@ -1026,7 +1026,7 @@ TMXTileAnimTask::TMXTileAnimTask(FastTMXLayer* layer, TMXTileAnimInfo* animation
void TMXTileAnimTask::tickAndScheduleNext(float dt)
{
setCurrFrame();
_layer->getParent()->scheduleOnce(AX_CALLBACK_1(TMXTileAnimTask::tickAndScheduleNext, this),
_layer->getParent()->scheduleOnce(CC_CALLBACK_1(TMXTileAnimTask::tickAndScheduleNext, this),
_animation->_frames[_currentFrame]._duration / 1000.0f, _key);
}

View File

@ -81,7 +81,7 @@ class Buffer;
* @js NA
*/
class AX_DLL FastTMXLayer : public Node
class CC_DLL FastTMXLayer : public Node
{
public:
/** Possible orientations of the TMX map */
@ -222,8 +222,8 @@ public:
*/
void setTileSet(TMXTilesetInfo* info)
{
AX_SAFE_RETAIN(info);
AX_SAFE_RELEASE(_tileSet);
CC_SAFE_RETAIN(info);
CC_SAFE_RELEASE(_tileSet);
_tileSet = info;
}
@ -363,7 +363,7 @@ protected:
bool _quadsDirty = true;
std::vector<int> _tileToQuadIndex;
std::vector<V3F_C4B_T2F_Quad> _totalQuads;
#ifdef AX_FAST_TILEMAP_32_BIT_INDICES
#ifdef CC_FAST_TILEMAP_32_BIT_INDICES
std::vector<unsigned int> _indices;
#else
std::vector<unsigned short> _indices;
@ -386,7 +386,7 @@ protected:
/** @brief TMXTileAnimTask represents the frame-tick task of an animated tile.
* It is a assistant class for TMXTileAnimTicker.
*/
class AX_DLL TMXTileAnimTask : public Ref
class CC_DLL TMXTileAnimTask : public Ref
{
public:
TMXTileAnimTask(FastTMXLayer* layer, TMXTileAnimInfo* animation, const Vec2& tilePos);
@ -418,7 +418,7 @@ protected:
/** @brief TMXTileAnimManager controls all tile animation of a layer.
*/
class AX_DLL TMXTileAnimManager : public Ref
class CC_DLL TMXTileAnimManager : public Ref
{
public:
static TMXTileAnimManager* create(FastTMXLayer* layer);

View File

@ -41,7 +41,7 @@ FastTMXTiledMap* FastTMXTiledMap::create(std::string_view tmxFile)
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -53,7 +53,7 @@ FastTMXTiledMap* FastTMXTiledMap::createWithXML(std::string_view tmxString, std:
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}

View File

@ -94,7 +94,7 @@ class FastTMXLayer;
* @since v3.2
* @js NA
*/
class AX_DLL FastTMXTiledMap : public Node
class CC_DLL FastTMXTiledMap : public Node
{
public:
/** Creates a TMX Tiled Map with a TMX file.
@ -203,7 +203,7 @@ public:
*/
void setTileAnimEnabled(bool enabled);
AX_DEPRECATED_ATTRIBUTE int getLayerNum() const { return getLayerCount(); }
CC_DEPRECATED_ATTRIBUTE int getLayerNum() const { return getLayerCount(); }
int getLayerCount() const { return _layerCount; }
@ -249,7 +249,7 @@ protected:
std::string _tmxFile;
private:
AX_DISALLOW_COPY_AND_ASSIGN(FastTMXTiledMap);
CC_DISALLOW_COPY_AND_ASSIGN(FastTMXTiledMap);
};
// end of tilemap_parallax_nodes group

View File

@ -38,7 +38,7 @@ NS_AX_BEGIN
class FontAtlas;
class AX_DLL Font : public Ref
class CC_DLL Font : public Ref
{
public:
virtual FontAtlas* newFontAtlas() = 0;

View File

@ -26,8 +26,8 @@
****************************************************************************/
#include "2d/CCFontAtlas.h"
#if AX_TARGET_PLATFORM != AX_PLATFORM_WIN32 && AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID
#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID
#if CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID
#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
# include "platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h"
#endif
#include <algorithm>
@ -63,7 +63,7 @@ FontAtlas::FontAtlas(Font* theFont) : _font(theFont)
_pixelFormat = backend::PixelFormat::LA8;
_currentPageDataSize = CacheTextureWidth * CacheTextureHeight << _strideShift;
#if defined(AX_USE_METAL)
#if defined(CC_USE_METAL)
_currentPageDataSizeRGBA = CacheTextureWidth * CacheTextureHeight * 4;
#endif
@ -81,11 +81,11 @@ FontAtlas::FontAtlas(Font* theFont) : _font(theFont)
_letterPadding += 2 * FontFreeType::DistanceMapSpread;
}
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
auto eventDispatcher = Director::getInstance()->getEventDispatcher();
_rendererRecreatedListener = EventListenerCustom::create(
EVENT_RENDERER_RECREATED, AX_CALLBACK_1(FontAtlas::listenRendererRecreated, this));
EVENT_RENDERER_RECREATED, CC_CALLBACK_1(FontAtlas::listenRendererRecreated, this));
eventDispatcher->addEventListenerWithFixedPriority(_rendererRecreatedListener, 1);
#endif
}
@ -97,7 +97,7 @@ void FontAtlas::reinit()
_currentPageData = new uint8_t[_currentPageDataSize];
_currentPage = -1;
#if defined(AX_USE_METAL)
#if defined(CC_USE_METAL)
if (_strideShift && !_currentPageDataRGBA)
_currentPageDataRGBA = new uint8_t[_currentPageDataSizeRGBA];
#endif
@ -107,7 +107,7 @@ void FontAtlas::reinit()
FontAtlas::~FontAtlas()
{
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
if (_fontFreeType && _rendererRecreatedListener)
{
auto eventDispatcher = Director::getInstance()->getEventDispatcher();
@ -119,9 +119,9 @@ FontAtlas::~FontAtlas()
_font->release();
releaseTextures();
AX_SAFE_DELETE_ARRAY(_currentPageData);
#if defined(AX_USE_METAL)
AX_SAFE_DELETE_ARRAY(_currentPageDataRGBA);
CC_SAFE_DELETE_ARRAY(_currentPageData);
#if defined(CC_USE_METAL)
CC_SAFE_DELETE_ARRAY(_currentPageDataRGBA);
#endif
}
@ -234,7 +234,7 @@ bool FontAtlas::prepareLetterDefinitions(const std::u32string& utf32Text)
Rect tempRect;
FontLetterDefinition tempDef;
auto scaleFactor = AX_CONTENT_SCALE_FACTOR();
auto scaleFactor = CC_CONTENT_SCALE_FACTOR();
auto pixelFormat = _pixelFormat;
int startY = (int)_currentPageOrigY;
@ -309,7 +309,7 @@ bool FontAtlas::prepareLetterDefinitions(const std::u32string& utf32Text)
void FontAtlas::updateTextureContent(backend::PixelFormat format, int startY)
{
#if !defined(AX_USE_METAL)
#if !defined(CC_USE_METAL)
auto data = _currentPageData + (CacheTextureWidth * (int)startY << _strideShift);
_atlasTextures[_currentPage]->updateWithSubData(data, 0, startY, CacheTextureWidth,
(int)_currentPageOrigY - startY + _currLineHeight);
@ -343,7 +343,7 @@ void FontAtlas::addNewPage()
memset(_currentPageData, 0, _currentPageDataSize);
#if !defined(AX_USE_METAL)
#if !defined(CC_USE_METAL)
texture->initWithData(_currentPageData, _currentPageDataSize, _pixelFormat, CacheTextureWidth, CacheTextureHeight);
#else
if (_strideShift)

View File

@ -59,7 +59,7 @@ struct FontLetterDefinition
bool rotated;
};
class AX_DLL FontAtlas : public Ref
class CC_DLL FontAtlas : public Ref
{
public:
static const int CacheTextureWidth;
@ -147,7 +147,7 @@ protected:
int _strideShift = 0;
uint8_t* _currentPageData = nullptr;
int _currentPageDataSize = 0;
#if defined(AX_USE_METAL)
#if defined(CC_USE_METAL)
// Notes:
// Metal backend doesn't support PixelFormat::LA8
// Currently we use RGBA for texture data upload

View File

@ -270,7 +270,7 @@ void FontAtlasCache::reloadFontAtlasFNT(std::string_view fontFileName, const Rec
auto it = _atlasMap.find(atlasName);
if (it != _atlasMap.end())
{
AX_SAFE_RELEASE_NULL(it->second);
CC_SAFE_RELEASE_NULL(it->second);
_atlasMap.erase(it);
}
FontFNT::reloadBMFontResource(fontFileName);
@ -297,7 +297,7 @@ void FontAtlasCache::unloadFontAtlasTTF(std::string_view fontFileName)
{
if (item->first.find(fontFileName) != std::string::npos)
{
AX_SAFE_RELEASE_NULL(item->second);
CC_SAFE_RELEASE_NULL(item->second);
item = _atlasMap.erase(item);
}
else

View File

@ -38,7 +38,7 @@ class FontAtlas;
class Texture2D;
struct _ttfConfig;
class AX_DLL FontAtlasCache
class CC_DLL FontAtlasCache
{
public:
static FontAtlas* getFontAtlasTTF(const _ttfConfig* config);
@ -46,7 +46,7 @@ public:
static FontAtlas* getFontAtlasFNT(std::string_view fontFileName);
static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, std::string_view subTextureKey);
static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Rect& imageRect, bool imageRotated);
AX_DEPRECATED_ATTRIBUTE static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset);
CC_DEPRECATED_ATTRIBUTE static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset);
static FontAtlas* getFontAtlasCharMap(std::string_view charMapFile,
int itemWidth,
@ -68,7 +68,7 @@ public:
*/
static void reloadFontAtlasFNT(std::string_view fontFileName, const Rect& imageRect, bool imageRotated);
AX_DEPRECATED_ATTRIBUTE static void reloadFontAtlasFNT(std::string_view fontFileName,
CC_DEPRECATED_ATTRIBUTE static void reloadFontAtlasFNT(std::string_view fontFileName,
const Vec2& imageOffset = Vec2::ZERO);
/** Unload all texture atlas texture create by special file name.

View File

@ -112,7 +112,7 @@ FontAtlas* FontCharMap::newFontAtlas()
tempAtlas->setLineHeight((float)_itemHeight);
auto contentScaleFactor = AX_CONTENT_SCALE_FACTOR();
auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR();
FontLetterDefinition tempDefinition;
tempDefinition.textureID = 0;

View File

@ -92,7 +92,7 @@ BMFontConfiguration* BMFontConfiguration::create(std::string_view FNTfile)
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -121,13 +121,13 @@ BMFontConfiguration::~BMFontConfiguration()
this->purgeFontDefDictionary();
this->purgeKerningDictionary();
_atlasName.clear();
AX_SAFE_DELETE(_characterSet);
CC_SAFE_DELETE(_characterSet);
}
std::string BMFontConfiguration::description() const
{
return StringUtils::format(
"<BMFontConfiguration = " AX_FORMAT_PRINTF_SIZE_T " | Glphys:%d Kernings:%d | Image = %s>", (size_t)this,
"<BMFontConfiguration = " CC_FORMAT_PRINTF_SIZE_T " | Glphys:%d Kernings:%d | Image = %s>", (size_t)this,
static_cast<int>(_fontDefDictionary.size()), static_cast<int>(_kerningDictionary.size()), _atlasName.c_str());
}
@ -596,7 +596,7 @@ FontFNT* FontFNT::create(std::string_view fntFilePath, const Vec2& imageOffset)
}
FontFNT::FontFNT(BMFontConfiguration* theContfig, const Rect& imageRect, bool imageRotated)
: _configuration(theContfig), _imageRectInPoints(AX_RECT_PIXELS_TO_POINTS(imageRect)), _imageRotated(imageRotated)
: _configuration(theContfig), _imageRectInPoints(CC_RECT_PIXELS_TO_POINTS(imageRect)), _imageRotated(imageRotated)
{
_configuration->retain();
}
@ -615,7 +615,7 @@ void FontFNT::purgeCachedData()
if (s_configurations)
{
s_configurations->clear();
AX_SAFE_DELETE(s_configurations);
CC_SAFE_DELETE(s_configurations);
}
}
@ -709,7 +709,7 @@ FontAtlas* FontFNT::newFontAtlas()
FontLetterDefinition tempDefinition;
const auto tempRect = AX_RECT_PIXELS_TO_POINTS(fontDef.rect);
const auto tempRect = CC_RECT_PIXELS_TO_POINTS(fontDef.rect);
tempDefinition.offsetX = fontDef.xOffset;
tempDefinition.offsetY = fontDef.yOffset;
@ -751,7 +751,7 @@ FontAtlas* FontFNT::newFontAtlas()
Texture2D* tempTexture = Director::getInstance()->getTextureCache()->addImage(_configuration->getAtlasName());
if (!tempTexture)
{
AX_SAFE_RELEASE(tempAtlas);
CC_SAFE_RELEASE(tempAtlas);
return nullptr;
}

View File

@ -73,7 +73,7 @@ typedef struct _BMFontPadding
/** @brief BMFontConfiguration has parsed configuration of the .fnt file
@since v0.8
*/
class AX_DLL BMFontConfiguration : public Ref
class CC_DLL BMFontConfiguration : public Ref
{
// FIXME: Creating a public interface so that the bitmapFontArray[] is accessible
public: //@public
@ -141,7 +141,7 @@ private:
void purgeFontDefDictionary();
};
class AX_DLL FontFNT : public Font
class CC_DLL FontFNT : public Font
{
public:
@ -149,7 +149,7 @@ public:
static FontFNT* create(std::string_view fntFilePath, std::string_view subTextureKey);
static FontFNT* create(std::string_view fntFilePath);
AX_DEPRECATED_ATTRIBUTE static FontFNT* create(std::string_view fntFilePath, const Vec2& imageOffset = Vec2::ZERO);
CC_DEPRECATED_ATTRIBUTE static FontFNT* create(std::string_view fntFilePath, const Vec2& imageOffset = Vec2::ZERO);
/** Purges the cached data.
Removes from memory the cached configurations and the atlas name dictionary.

View File

@ -164,7 +164,7 @@ FontFreeType::FontFreeType(bool distanceFieldEnabled /* = false */, float outlin
{
if (outline > 0.0f)
{
_outlineSize = outline * AX_CONTENT_SCALE_FACTOR();
_outlineSize = outline * CC_CONTENT_SCALE_FACTOR();
FT_Stroker_New(FontFreeType::getFTLibrary(), &_stroker);
FT_Stroker_Set(_stroker,
(int)(_outlineSize * 64),
@ -255,7 +255,7 @@ bool FontFreeType::loadFontFace(std::string_view fontPath, float fontSize)
// set the requested font size
int dpi = 72;
int fontSizePoints = (int)(64.f * fontSize * AX_CONTENT_SCALE_FACTOR());
int fontSizePoints = (int)(64.f * fontSize * CC_CONTENT_SCALE_FACTOR());
if (FT_Set_Char_Size(face, fontSizePoints, fontSizePoints, dpi, dpi))
break;

View File

@ -42,7 +42,7 @@ typedef struct FT_BBox_ FT_BBox;
NS_AX_BEGIN
class AX_DLL FontFreeType : public Font
class CC_DLL FontFreeType : public Font
{
public:
static const int DistanceMapSpread;

View File

@ -84,10 +84,10 @@ bool GridBase::initWithSize(const Vec2& gridSize, Texture2D* texture, bool flipp
_gridSize = gridSize;
_texture = texture;
AX_SAFE_RETAIN(_texture);
CC_SAFE_RETAIN(_texture);
_isTextureFlipped = flipped;
#ifdef AX_USE_METAL
#ifdef CC_USE_METAL
_isTextureFlipped = !flipped;
#endif
@ -104,7 +104,7 @@ bool GridBase::initWithSize(const Vec2& gridSize, Texture2D* texture, bool flipp
_step.y = _gridRect.size.height / _gridSize.height;
auto& pipelineDescriptor = _drawCommand.getPipelineDescriptor();
AX_SAFE_RELEASE(_programState);
CC_SAFE_RELEASE(_programState);
auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE);
_programState = new backend::ProgramState(program);
pipelineDescriptor.programState = _programState;
@ -151,12 +151,12 @@ GridBase::~GridBase()
{
CCLOGINFO("deallocing GridBase: %p", this);
AX_SAFE_RELEASE(_renderTarget);
CC_SAFE_RELEASE(_renderTarget);
// TODO: ? why 2.0 comments this line: setActive(false);
AX_SAFE_RELEASE(_texture);
CC_SAFE_RELEASE(_texture);
AX_SAFE_RELEASE(_programState);
CC_SAFE_RELEASE(_programState);
}
// properties
@ -216,7 +216,7 @@ void GridBase::beforeDraw()
renderer->setViewPort(0, 0, (unsigned int)size.width, (unsigned int)size.height);
_oldRenderTarget = renderer->getRenderTarget();
AX_SAFE_RELEASE(_renderTarget);
CC_SAFE_RELEASE(_renderTarget);
_renderTarget =
backend::Device::getInstance()->newRenderTarget(TargetBufferFlags::COLOR, _texture->getBackendTexture());
renderer->setRenderTarget(_renderTarget);
@ -344,11 +344,11 @@ Grid3D::Grid3D() {}
Grid3D::~Grid3D()
{
AX_SAFE_FREE(_texCoordinates);
AX_SAFE_FREE(_vertices);
AX_SAFE_FREE(_indices);
AX_SAFE_FREE(_originalVertices);
AX_SAFE_FREE(_vertexBuffer);
CC_SAFE_FREE(_texCoordinates);
CC_SAFE_FREE(_vertices);
CC_SAFE_FREE(_indices);
CC_SAFE_FREE(_originalVertices);
CC_SAFE_FREE(_vertexBuffer);
}
void Grid3D::beforeBlit()
@ -392,11 +392,11 @@ void Grid3D::calculateVertexPoints()
float height = (float)_texture->getPixelsHigh();
float imageH = _texture->getContentSizeInPixels().height;
AX_SAFE_FREE(_vertices);
AX_SAFE_FREE(_originalVertices);
AX_SAFE_FREE(_texCoordinates);
AX_SAFE_FREE(_vertexBuffer);
AX_SAFE_FREE(_indices);
CC_SAFE_FREE(_vertices);
CC_SAFE_FREE(_originalVertices);
CC_SAFE_FREE(_texCoordinates);
CC_SAFE_FREE(_vertexBuffer);
CC_SAFE_FREE(_indices);
size_t numOfPoints = static_cast<size_t>((_gridSize.width + 1) * (_gridSize.height + 1));
@ -552,10 +552,10 @@ void Grid3D::updateVertexAndTexCoordinate()
TiledGrid3D::~TiledGrid3D()
{
AX_SAFE_FREE(_texCoordinates);
AX_SAFE_FREE(_vertices);
AX_SAFE_FREE(_originalVertices);
AX_SAFE_FREE(_indices);
CC_SAFE_FREE(_texCoordinates);
CC_SAFE_FREE(_vertices);
CC_SAFE_FREE(_originalVertices);
CC_SAFE_FREE(_indices);
}
TiledGrid3D* TiledGrid3D::create(const Vec2& gridSize)
@ -643,11 +643,11 @@ void TiledGrid3D::calculateVertexPoints()
float imageH = _texture->getContentSizeInPixels().height;
int numQuads = (int)(_gridSize.width * _gridSize.height);
AX_SAFE_FREE(_vertices);
AX_SAFE_FREE(_originalVertices);
AX_SAFE_FREE(_texCoordinates);
AX_SAFE_FREE(_indices);
AX_SAFE_FREE(_vertexBuffer);
CC_SAFE_FREE(_vertices);
CC_SAFE_FREE(_originalVertices);
CC_SAFE_FREE(_texCoordinates);
CC_SAFE_FREE(_indices);
CC_SAFE_FREE(_vertexBuffer);
_vertices = malloc(numQuads * 4 * sizeof(Vec3));
_originalVertices = malloc(numQuads * 4 * sizeof(Vec3));

View File

@ -53,7 +53,7 @@ class RenderTarget;
/** Base class for Other grid.
*/
class AX_DLL GridBase : public Ref
class CC_DLL GridBase : public Ref
{
public:
/**
@ -174,7 +174,7 @@ protected:
/**
Grid3D is a 3D grid implementation. Each vertex has 3 dimensions: x,y,z
*/
class AX_DLL Grid3D : public GridBase
class CC_DLL Grid3D : public GridBase
{
public:
/** create one Grid. */
@ -248,7 +248,7 @@ protected:
TiledGrid3D is a 3D grid implementation. It differs from Grid3D in that
the tiles can be separated from the grid.
*/
class AX_DLL TiledGrid3D : public GridBase
class CC_DLL TiledGrid3D : public GridBase
{
public:
/** Create one Grid. */

View File

@ -95,7 +95,7 @@ public:
letter->autorelease();
return letter;
}
AX_SAFE_DELETE(letter);
CC_SAFE_DELETE(letter);
return nullptr;
}
@ -206,9 +206,9 @@ Label::BatchCommand::BatchCommand()
Label::BatchCommand::~BatchCommand()
{
AX_SAFE_RELEASE(textCommand.getPipelineDescriptor().programState);
AX_SAFE_RELEASE(shadowCommand.getPipelineDescriptor().programState);
AX_SAFE_RELEASE(outLineCommand.getPipelineDescriptor().programState);
CC_SAFE_RELEASE(textCommand.getPipelineDescriptor().programState);
CC_SAFE_RELEASE(shadowCommand.getPipelineDescriptor().programState);
CC_SAFE_RELEASE(outLineCommand.getPipelineDescriptor().programState);
}
void Label::BatchCommand::setProgramState(backend::ProgramState* programState)
@ -216,15 +216,15 @@ void Label::BatchCommand::setProgramState(backend::ProgramState* programState)
assert(programState);
auto& programStateText = textCommand.getPipelineDescriptor().programState;
AX_SAFE_RELEASE(programStateText);
CC_SAFE_RELEASE(programStateText);
programStateText = programState->clone();
auto& programStateShadow = shadowCommand.getPipelineDescriptor().programState;
AX_SAFE_RELEASE(programStateShadow);
CC_SAFE_RELEASE(programStateShadow);
programStateShadow = programState->clone();
auto& programStateOutline = outLineCommand.getPipelineDescriptor().programState;
AX_SAFE_RELEASE(programStateOutline);
CC_SAFE_RELEASE(programStateOutline);
programStateOutline = programState->clone();
}
@ -274,7 +274,7 @@ Label* Label::createWithTTF(std::string_view text,
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -291,7 +291,7 @@ Label* Label::createWithTTF(const TTFConfig& ttfConfig,
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -508,7 +508,7 @@ Label::Label(TextHAlignment hAlignment /* = TextHAlignment::LEFT */,
_hAlignment = hAlignment;
_vAlignment = vAlignment;
#if AX_LABEL_DEBUG_DRAW
#if CC_LABEL_DEBUG_DRAW
_debugDrawNode = DrawNode::create();
addChild(_debugDrawNode);
#endif
@ -557,7 +557,7 @@ Label::~Label()
if (_fontAtlas)
{
Node::removeAllChildrenWithCleanup(true);
AX_SAFE_RELEASE_NULL(_reusedLetter);
CC_SAFE_RELEASE_NULL(_reusedLetter);
_batchNodes.clear();
FontAtlasCache::releaseFontAtlas(_fontAtlas);
}
@ -565,16 +565,16 @@ Label::~Label()
_eventDispatcher->removeEventListener(_purgeTextureListener);
_eventDispatcher->removeEventListener(_resetTextureListener);
AX_SAFE_RELEASE_NULL(_textSprite);
AX_SAFE_RELEASE_NULL(_shadowNode);
CC_SAFE_RELEASE_NULL(_textSprite);
CC_SAFE_RELEASE_NULL(_shadowNode);
}
void Label::reset()
{
AX_SAFE_RELEASE_NULL(_textSprite);
AX_SAFE_RELEASE_NULL(_shadowNode);
CC_SAFE_RELEASE_NULL(_textSprite);
CC_SAFE_RELEASE_NULL(_shadowNode);
Node::removeAllChildrenWithCleanup(true);
AX_SAFE_RELEASE_NULL(_reusedLetter);
CC_SAFE_RELEASE_NULL(_reusedLetter);
_letters.clear();
_batchNodes.clear();
_batchCommands.clear();
@ -604,7 +604,7 @@ void Label::reset()
_systemFontDirty = false;
_systemFont = "Helvetica";
_systemFontSize = AX_DEFAULT_FONT_LABEL_SIZE;
_systemFontSize = CC_DEFAULT_FONT_LABEL_SIZE;
if (_horizontalKernings)
{
@ -803,7 +803,7 @@ void Label::setFontAtlas(FontAtlas* atlas, bool distanceFieldEnabled /* = false
if (atlas == _fontAtlas)
return;
AX_SAFE_RETAIN(atlas);
CC_SAFE_RETAIN(atlas);
if (_fontAtlas)
{
_batchNodes.clear();
@ -858,7 +858,7 @@ bool Label::setBMFontFilePath(std::string_view bmfontFilePath, float fontSize)
if (bmFont)
{
float originalFontSize = bmFont->getOriginalFontSize();
_bmFontSize = originalFontSize / AX_CONTENT_SCALE_FACTOR();
_bmFontSize = originalFontSize / CC_CONTENT_SCALE_FACTOR();
}
}
@ -892,7 +892,7 @@ bool Label::setBMFontFilePath(std::string_view bmfontFilePath, const Rect& image
if (bmFont)
{
float originalFontSize = bmFont->getOriginalFontSize();
_bmFontSize = originalFontSize / AX_CONTENT_SCALE_FACTOR();
_bmFontSize = originalFontSize / CC_CONTENT_SCALE_FACTOR();
}
}
@ -928,7 +928,7 @@ bool Label::setBMFontFilePath(std::string_view bmfontFilePath, std::string_view
if (bmFont)
{
float originalFontSize = bmFont->getOriginalFontSize();
_bmFontSize = originalFontSize / AX_CONTENT_SCALE_FACTOR();
_bmFontSize = originalFontSize / CC_CONTENT_SCALE_FACTOR();
}
}
@ -1157,7 +1157,7 @@ bool Label::alignText()
if (fontSize > 0 && isVerticalClamp())
{
this->shrinkLabelToContentSize(AX_CALLBACK_0(Label::isVerticalClamp, this));
this->shrinkLabelToContentSize(CC_CALLBACK_0(Label::isVerticalClamp, this));
}
}
@ -1166,7 +1166,7 @@ bool Label::alignText()
ret = false;
if (_overflow == Overflow::SHRINK)
{
this->shrinkLabelToContentSize(AX_CALLBACK_0(Label::isHorizontalClamp, this));
this->shrinkLabelToContentSize(CC_CALLBACK_0(Label::isHorizontalClamp, this));
}
break;
}
@ -1543,7 +1543,7 @@ void Label::disableEffect(LabelEffect effect)
if (_shadowEnabled)
{
_shadowEnabled = false;
AX_SAFE_RELEASE_NULL(_shadowNode);
CC_SAFE_RELEASE_NULL(_shadowNode);
updateShaderProgram();
}
break;
@ -1680,7 +1680,7 @@ void Label::updateContent()
{
_batchNodes.clear();
_batchCommands.clear();
AX_SAFE_RELEASE_NULL(_reusedLetter);
CC_SAFE_RELEASE_NULL(_reusedLetter);
FontAtlasCache::releaseFontAtlas(_fontAtlas);
_fontAtlas = nullptr;
}
@ -1688,8 +1688,8 @@ void Label::updateContent()
_systemFontDirty = false;
}
AX_SAFE_RELEASE_NULL(_textSprite);
AX_SAFE_RELEASE_NULL(_shadowNode);
CC_SAFE_RELEASE_NULL(_textSprite);
CC_SAFE_RELEASE_NULL(_shadowNode);
bool updateFinished = true;
if (_fontAtlas)
@ -1760,7 +1760,7 @@ void Label::updateContent()
_contentDirty = false;
}
#if AX_LABEL_DEBUG_DRAW
#if CC_LABEL_DEBUG_DRAW
_debugDrawNode->clear();
Vec2 vertices[4] = {Vec2::ZERO, Vec2(_contentSize.width, 0.0f), Vec2(_contentSize.width, _contentSize.height),
Vec2(0.0f, _contentSize.height)};
@ -1920,7 +1920,7 @@ void Label::draw(Renderer* renderer, const Mat4& transform, uint32_t flags)
}
// Don't do calculate the culling if the transform was not updated
bool transformUpdated = flags & FLAGS_TRANSFORM_DIRTY;
#if AX_USE_CULLING
#if CC_USE_CULLING
auto visitingCamera = Camera::getVisitingCamera();
auto defaultCamera = Camera::getDefaultCamera();
if (visitingCamera == defaultCamera)
@ -2502,7 +2502,7 @@ FontDefinition Label::_getFontDefinition() const
systemFontDef._stroke._strokeEnabled = false;
}
#if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) && (AX_TARGET_PLATFORM != AX_PLATFORM_IOS)
#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS)
if (systemFontDef._stroke._strokeEnabled)
{
CCLOGERROR("Stroke Currently only supported on iOS and Android!");
@ -2530,7 +2530,7 @@ void Label::setGlobalZOrder(float globalZOrder)
_underlineNode->setGlobalZOrder(globalZOrder);
}
#if AX_LABEL_DEBUG_DRAW
#if CC_LABEL_DEBUG_DRAW
_debugDrawNode->setGlobalZOrder(globalZOrder);
#endif
}

View File

@ -41,7 +41,7 @@ NS_AX_BEGIN
* @{
*/
#define AX_DEFAULT_FONT_LABEL_SIZE 12
#define CC_DEFAULT_FONT_LABEL_SIZE 12
/**
* @struct TTFConfig
@ -64,7 +64,7 @@ typedef struct _ttfConfig
bool strikethrough;
_ttfConfig(std::string_view filePath = {},
float size = AX_DEFAULT_FONT_LABEL_SIZE,
float size = CC_DEFAULT_FONT_LABEL_SIZE,
const GlyphCollection& glyphCollection = GlyphCollection::DYNAMIC,
const char* customGlyphCollection = nullptr, /* nullable */
bool useDistanceField = false,
@ -113,7 +113,7 @@ class TextureAtlas;
* - http://www.angelcode.com/products/bmfont/ (Free, Windows only)
* @js NA
*/
class AX_DLL Label : public Node, public LabelProtocol, public BlendProtocol
class CC_DLL Label : public Node, public LabelProtocol, public BlendProtocol
{
public:
enum class Overflow
@ -274,7 +274,7 @@ public:
* @return An automatically released Label object.
* @see setBMFontFilePath setMaxLineWidth
*/
AX_DEPRECATED_ATTRIBUTE static Label* createWithBMFont(std::string_view bmfontPath,
CC_DEPRECATED_ATTRIBUTE static Label* createWithBMFont(std::string_view bmfontPath,
std::string_view text,
const TextHAlignment& hAlignment,
int maxLineWidth,
@ -344,7 +344,7 @@ public:
virtual bool setBMFontFilePath(std::string_view bmfontFilePath, std::string_view subTextureKey, float fontSize = 0);
/** Sets a new bitmap font to Label */
AX_DEPRECATED_ATTRIBUTE virtual bool setBMFontFilePath(std::string_view bmfontFilePath,
CC_DEPRECATED_ATTRIBUTE virtual bool setBMFontFilePath(std::string_view bmfontFilePath,
const Vec2& imageOffset,
float fontSize = 0);
@ -899,7 +899,7 @@ protected:
EventListenerCustom* _purgeTextureListener;
EventListenerCustom* _resetTextureListener;
#if AX_LABEL_DEBUG_DRAW
#if CC_LABEL_DEBUG_DRAW
DrawNode* _debugDrawNode;
#endif
@ -920,7 +920,7 @@ protected:
backend::UniformLocation _effectTypeLocation;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Label);
CC_DISALLOW_COPY_AND_ASSIGN(Label);
};
// end group

View File

@ -32,7 +32,7 @@ THE SOFTWARE.
#include "base/ccUTF8.h"
#include "renderer/CCTextureCache.h"
#if AX_LABELATLAS_DEBUG_DRAW
#if CC_LABELATLAS_DEBUG_DRAW
# include "renderer/CCRenderer.h"
#endif
@ -52,7 +52,7 @@ LabelAtlas* LabelAtlas::create(std::string_view string,
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -91,7 +91,7 @@ LabelAtlas* LabelAtlas::create(std::string_view string, std::string_view fntFile
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
@ -111,7 +111,7 @@ LabelAtlas* LabelAtlas::create(std::string_view string,
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
@ -128,8 +128,8 @@ bool LabelAtlas::initWithString(std::string_view theString, std::string_view fnt
std::string textureFilename = relPathStr + dict["textureFilename"].asString();
unsigned int width = static_cast<unsigned int>(dict["itemWidth"].asInt() / AX_CONTENT_SCALE_FACTOR());
unsigned int height = static_cast<unsigned int>(dict["itemHeight"].asInt() / AX_CONTENT_SCALE_FACTOR());
unsigned int width = static_cast<unsigned int>(dict["itemWidth"].asInt() / CC_CONTENT_SCALE_FACTOR());
unsigned int height = static_cast<unsigned int>(dict["itemHeight"].asInt() / CC_CONTENT_SCALE_FACTOR());
unsigned int startChar = dict["firstChar"].asInt();
this->initWithString(theString, textureFilename, width, height, startChar);
@ -152,8 +152,8 @@ void LabelAtlas::updateAtlasValues()
Texture2D* texture = _textureAtlas->getTexture();
float textureWide = (float)texture->getPixelsWide();
float textureHigh = (float)texture->getPixelsHigh();
float itemWidthInPixels = _itemWidth * AX_CONTENT_SCALE_FACTOR();
float itemHeightInPixels = _itemHeight * AX_CONTENT_SCALE_FACTOR();
float itemWidthInPixels = _itemWidth * CC_CONTENT_SCALE_FACTOR();
float itemHeightInPixels = _itemHeight * CC_CONTENT_SCALE_FACTOR();
if (_ignoreContentScaleFactor)
{
itemWidthInPixels = static_cast<float>(_itemWidth);
@ -169,7 +169,7 @@ void LabelAtlas::updateAtlasValues()
float row = (float)(a % _itemsPerRow);
float col = (float)(a / _itemsPerRow);
#if AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL
#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
// Issue #938. Don't use texStepX & texStepY
float left = (2 * row * itemWidthInPixels + 1) / (2 * textureWide);
float right = left + (itemWidthInPixels * 2 - 2) / (2 * textureWide);
@ -180,7 +180,7 @@ void LabelAtlas::updateAtlasValues()
float right = left + itemWidthInPixels / textureWide;
float top = col * itemHeightInPixels / textureHigh;
float bottom = top + itemHeightInPixels / textureHigh;
#endif // ! AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL
#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
quads[i].tl.texCoords.u = left;
quads[i].tl.texCoords.v = top;
@ -269,7 +269,7 @@ void LabelAtlas::updateColor()
}
// CCLabelAtlas - draw
#if AX_LABELATLAS_DEBUG_DRAW
#if CC_LABELATLAS_DEBUG_DRAW
void LabelAtlas::draw(Renderer* renderer, const Mat4& transform, uint32_t flags)
{
AtlasNode::draw(renderer, transform, _transformUpdated);

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
#define __CCLABEL_ATLAS_H__
#include "2d/CCAtlasNode.h"
#if AX_LABELATLAS_DEBUG_DRAW
#if CC_LABELATLAS_DEBUG_DRAW
# include "renderer/CCCustomCommand.h"
# include "2d/CCDrawNode.h"
#endif
@ -53,7 +53,7 @@ NS_AX_BEGIN
*
* A more flexible class is LabelBMFont. It supports variable width characters and it also has a nice editor.
*/
class AX_DLL LabelAtlas : public AtlasNode, public LabelProtocol
class CC_DLL LabelAtlas : public AtlasNode, public LabelProtocol
{
public:
/** Creates the LabelAtlas with a string, a char map file(the atlas), the width and height of each element and the
@ -107,13 +107,13 @@ public:
*/
virtual std::string getDescription() const override;
#if AX_LABELATLAS_DEBUG_DRAW
#if CC_LABELATLAS_DEBUG_DRAW
virtual void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override;
#endif
LabelAtlas()
{
#if AX_LABELATLAS_DEBUG_DRAW
#if CC_LABELATLAS_DEBUG_DRAW
_debugDrawNode = DrawNode::create();
addChild(_debugDrawNode);
#endif
@ -124,7 +124,7 @@ public:
protected:
virtual void updateColor() override;
#if AX_LABELATLAS_DEBUG_DRAW
#if CC_LABELATLAS_DEBUG_DRAW
DrawNode* _debugDrawNode;
#endif

View File

@ -83,7 +83,7 @@ int Label::getFirstWordLen(const std::u32string& utf32Text, int startIndex, int
int len = 0;
auto nextLetterX = 0;
FontLetterDefinition letterDef;
auto contentScaleFactor = AX_CONTENT_SCALE_FACTOR();
auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR();
for (int index = startIndex; index < textLen; ++index)
{
@ -141,7 +141,7 @@ void Label::updateBMFontScale()
{
FontFNT* bmFont = (FontFNT*)font;
auto originalFontSize = bmFont->getOriginalFontSize();
_bmfontScale = _bmFontSize * AX_CONTENT_SCALE_FACTOR() / originalFontSize;
_bmfontScale = _bmFontSize * CC_CONTENT_SCALE_FACTOR() / originalFontSize;
}
else
{
@ -159,7 +159,7 @@ bool Label::multilineTextWrap(const std::function<int(const std::u32string&, int
float letterRight = 0.f;
float nextWhitespaceWidth = 0.f;
auto contentScaleFactor = AX_CONTENT_SCALE_FACTOR();
auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR();
float lineSpacing = _lineSpacing * contentScaleFactor;
float highestY = 0.f;
float lowestY = 0.f;
@ -318,12 +318,12 @@ bool Label::multilineTextWrap(const std::function<int(const std::u32string&, int
bool Label::multilineTextWrapByWord()
{
return multilineTextWrap(AX_CALLBACK_3(Label::getFirstWordLen, this));
return multilineTextWrap(CC_CALLBACK_3(Label::getFirstWordLen, this));
}
bool Label::multilineTextWrapByChar()
{
return multilineTextWrap(AX_CALLBACK_3(Label::getFirstCharLen, this));
return multilineTextWrap(CC_CALLBACK_3(Label::getFirstCharLen, this));
}
bool Label::isVerticalClamp()

View File

@ -46,7 +46,7 @@ THE SOFTWARE.
#include "renderer/ccShaders.h"
#include "renderer/backend/ProgramState.h"
#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC)
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
# include "platform/desktop/CCGLViewImpl-desktop.h"
#endif
@ -72,7 +72,7 @@ LayerColor* LayerColor::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -85,7 +85,7 @@ LayerColor* LayerColor::create(const Color4B& color, float width, float height)
layer->autorelease();
return layer;
}
AX_SAFE_DELETE(layer);
CC_SAFE_DELETE(layer);
return nullptr;
}
@ -97,7 +97,7 @@ LayerColor* LayerColor::create(const Color4B& color)
layer->autorelease();
return layer;
}
AX_SAFE_DELETE(layer);
CC_SAFE_DELETE(layer);
return nullptr;
}
@ -162,7 +162,7 @@ LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end)
layer->autorelease();
return layer;
}
AX_SAFE_DELETE(layer);
CC_SAFE_DELETE(layer);
return nullptr;
}
@ -174,7 +174,7 @@ LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end, c
layer->autorelease();
return layer;
}
AX_SAFE_DELETE(layer);
CC_SAFE_DELETE(layer);
return nullptr;
}
@ -187,7 +187,7 @@ LayerGradient* LayerGradient::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -406,7 +406,7 @@ LayerRadialGradient::LayerRadialGradient()
LayerRadialGradient::~LayerRadialGradient()
{
AX_SAFE_RELEASE_NULL(_customCommand.getPipelineDescriptor().programState);
CC_SAFE_RELEASE_NULL(_customCommand.getPipelineDescriptor().programState);
}
bool LayerRadialGradient::initWithColor(const axis::Color4B& startColor,
@ -603,7 +603,7 @@ LayerMultiplex* LayerMultiplex::create(Node* layer, ...)
return ret;
}
va_end(args);
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -621,7 +621,7 @@ LayerMultiplex* LayerMultiplex::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -635,20 +635,20 @@ LayerMultiplex* LayerMultiplex::createWithArray(const Vector<Node*>& arrayOfLaye
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
void LayerMultiplex::addLayer(Node* layer)
{
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->retainScriptObject(this, layer);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
_layers.pushBack(layer);
}
@ -667,24 +667,24 @@ bool LayerMultiplex::initWithLayers(Node* layer, va_list params)
if (Node::initLayer())
{
_layers.reserve(5);
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->retainScriptObject(this, layer);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
_layers.pushBack(layer);
Node* l = va_arg(params, Node*);
while (l)
{
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
if (sEngine)
{
sEngine->retainScriptObject(this, l);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
_layers.pushBack(l);
l = va_arg(params, Node*);
}
@ -701,7 +701,7 @@ bool LayerMultiplex::initWithArray(const Vector<Node*>& arrayOfLayers)
{
if (Node::initLayer())
{
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
@ -713,7 +713,7 @@ bool LayerMultiplex::initWithArray(const Vector<Node*>& arrayOfLayers)
}
}
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
_layers.reserve(arrayOfLayers.size());
_layers.pushBack(arrayOfLayers);
@ -746,13 +746,13 @@ void LayerMultiplex::switchToAndReleaseMe(int n)
CCASSERT(n < _layers.size(), "Invalid index in MultiplexLayer switchTo message");
this->removeChild(_layers.at(_enabledLayer), true);
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->releaseScriptObject(this, _layers.at(_enabledLayer));
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
_layers.replace(_enabledLayer, nullptr);

View File

@ -41,7 +41,7 @@ NS_AX_BEGIN
*/
/* !!!HACK, the memory model of 'Layer' is identical to 'Node' */
class AX_DLL Layer : public Node
class CC_DLL Layer : public Node
{
public:
static Layer* create();
@ -56,7 +56,7 @@ All features from Layer are valid, plus the following new features:
- opacity
- RGB colors
*/
class AX_DLL LayerColor : public Sprite
class CC_DLL LayerColor : public Sprite
{
public:
@ -103,7 +103,7 @@ public:
bool initWithColor(const Color4B& color);
private:
AX_DISALLOW_COPY_AND_ASSIGN(LayerColor);
CC_DISALLOW_COPY_AND_ASSIGN(LayerColor);
};
@ -130,7 +130,7 @@ If ' compressedInterpolation' is enabled (default mode) you will see both the st
@since v0.99.5
*/
class AX_DLL LayerGradient : public LayerColor
class CC_DLL LayerGradient : public LayerColor
{
public:
/** Creates a fullscreen black layer.
@ -257,7 +257,7 @@ protected:
* @brief LayerRadialGradient is a subclass of Layer that draws radial gradients across the background.
@since v3.16
*/
class AX_DLL LayerRadialGradient : public Node, BlendProtocol
class CC_DLL LayerRadialGradient : public Node, BlendProtocol
{
public:
/** Create a LayerRadialGradient
@ -349,7 +349,7 @@ Features:
- It supports one or more children
- Only one children will be active a time
*/
class AX_DLL LayerMultiplex : public Node
class CC_DLL LayerMultiplex : public Node
{
public:
/** Creates and initializes a LayerMultiplex object.
@ -439,7 +439,7 @@ protected:
Vector<Node*> _layers;
private:
AX_DISALLOW_COPY_AND_ASSIGN(LayerMultiplex);
CC_DISALLOW_COPY_AND_ASSIGN(LayerMultiplex);
};
// end of _2d group

View File

@ -29,7 +29,7 @@ NS_AX_BEGIN
void BaseLight::setIntensity(float intensity)
{
AX_ASSERT(intensity >= 0);
CC_ASSERT(intensity >= 0);
_intensity = intensity;
}
@ -61,8 +61,8 @@ void BaseLight::onExit()
void BaseLight::setRotationFromDirection(const Vec3& direction)
{
float projLen = sqrt(direction.x * direction.x + direction.z * direction.z);
float rotY = AX_RADIANS_TO_DEGREES(atan2f(-direction.x, -direction.z));
float rotX = -AX_RADIANS_TO_DEGREES(atan2f(-direction.y, projLen));
float rotY = CC_RADIANS_TO_DEGREES(atan2f(-direction.x, -direction.z));
float rotX = -CC_RADIANS_TO_DEGREES(atan2f(-direction.y, projLen));
setRotation3D(Vec3(rotX, rotY, 0.0f));
}

View File

@ -61,7 +61,7 @@ enum class LightFlag
/**
@js NA
*/
class AX_DLL BaseLight : public Node
class CC_DLL BaseLight : public Node
{
public:
/**
@ -103,7 +103,7 @@ protected:
/**
@js NA
*/
class AX_DLL DirectionLight : public BaseLight
class CC_DLL DirectionLight : public BaseLight
{
public:
/**
@ -142,7 +142,7 @@ public:
/**
@js NA
*/
class AX_DLL PointLight : public BaseLight
class CC_DLL PointLight : public BaseLight
{
public:
/**
@ -172,7 +172,7 @@ protected:
/**
@js NA
*/
class AX_DLL SpotLight : public BaseLight
class CC_DLL SpotLight : public BaseLight
{
public:
/**
@ -270,7 +270,7 @@ protected:
/**
@js NA
*/
class AX_DLL AmbientLight : public BaseLight
class CC_DLL AmbientLight : public BaseLight
{
public:
/**

View File

@ -79,7 +79,7 @@ Menu* Menu::createWithArray(const Vector<MenuItem*>& arrayOfItems)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
@ -144,10 +144,10 @@ bool Menu::initWithArray(const Vector<MenuItem*>& arrayOfItems)
auto touchListener = EventListenerTouchOneByOne::create();
touchListener->setSwallowTouches(true);
touchListener->onTouchBegan = AX_CALLBACK_2(Menu::onTouchBegan, this);
touchListener->onTouchMoved = AX_CALLBACK_2(Menu::onTouchMoved, this);
touchListener->onTouchEnded = AX_CALLBACK_2(Menu::onTouchEnded, this);
touchListener->onTouchCancelled = AX_CALLBACK_2(Menu::onTouchCancelled, this);
touchListener->onTouchBegan = CC_CALLBACK_2(Menu::onTouchBegan, this);
touchListener->onTouchMoved = CC_CALLBACK_2(Menu::onTouchMoved, this);
touchListener->onTouchEnded = CC_CALLBACK_2(Menu::onTouchEnded, this);
touchListener->onTouchCancelled = CC_CALLBACK_2(Menu::onTouchCancelled, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this);

View File

@ -45,7 +45,7 @@ class Touch;
* - You can add MenuItem objects in runtime using addChild.
* - But the only accepted children are MenuItem objects.
*/
class AX_DLL Menu : public Node
class CC_DLL Menu : public Node
{
public:
/**
@ -63,7 +63,7 @@ public:
static Menu* create();
/** Creates a Menu with MenuItem objects. */
static Menu* create(MenuItem* item, ...) AX_REQUIRES_NULL_TERMINATION;
static Menu* create(MenuItem* item, ...) CC_REQUIRES_NULL_TERMINATION;
/**
* Creates a Menu with a Array of MenuItem objects.
@ -101,7 +101,7 @@ public:
void alignItemsHorizontallyWithPadding(float padding);
/** Align items in rows of columns. */
void alignItemsInColumns(int columns, ...) AX_REQUIRES_NULL_TERMINATION;
void alignItemsInColumns(int columns, ...) CC_REQUIRES_NULL_TERMINATION;
/** Align items in rows of columns. */
void alignItemsInColumns(int columns, va_list args);
@ -112,7 +112,7 @@ public:
void alignItemsInColumnsWithArray(const ValueVector& rows);
/** Align items in columns of rows. */
void alignItemsInRows(int rows, ...) AX_REQUIRES_NULL_TERMINATION;
void alignItemsInRows(int rows, ...) CC_REQUIRES_NULL_TERMINATION;
/** Align items in columns of rows. */
void alignItemsInRows(int rows, va_list args);
@ -179,7 +179,7 @@ protected:
const Camera* _selectedWithCamera;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Menu);
CC_DISALLOW_COPY_AND_ASSIGN(Menu);
};
// end of _2d group

View File

@ -88,7 +88,7 @@ void MenuItem::activate()
{
_callback(this);
}
#if AX_ENABLE_SCRIPT_BINDING
#if CC_ENABLE_SCRIPT_BINDING
BasicScriptData data(this);
ScriptEvent scriptEvent(kMenuClickedEvent, &data);
ScriptEngineManager::sendEventToLua(scriptEvent);
@ -591,7 +591,7 @@ MenuItemImage* MenuItemImage::create()
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -623,7 +623,7 @@ MenuItemImage* MenuItemImage::create(std::string_view normalImage,
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -637,7 +637,7 @@ MenuItemImage* MenuItemImage::create(std::string_view normalImage,
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -694,7 +694,7 @@ MenuItemToggle* MenuItemToggle::createWithCallback(const ccMenuCallback& callbac
MenuItemToggle* ret = new MenuItemToggle();
ret->MenuItem::initWithCallback(callback);
ret->autorelease();
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
@ -706,7 +706,7 @@ MenuItemToggle* MenuItemToggle::createWithCallback(const ccMenuCallback& callbac
}
}
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
ret->_subItems = menuItems;
ret->_selectedIndex = UINT_MAX;
ret->setSelectedIndex(0);
@ -739,19 +739,19 @@ bool MenuItemToggle::initWithCallback(const ccMenuCallback& callback, MenuItem*
int z = 0;
MenuItem* i = item;
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
while (i)
{
z++;
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
if (sEngine)
{
sEngine->retainScriptObject(this, i);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
_subItems.pushBack(i);
i = va_arg(args, MenuItem*);
}
@ -787,13 +787,13 @@ bool MenuItemToggle::initWithItem(MenuItem* item)
void MenuItemToggle::addSubItem(MenuItem* item)
{
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->retainScriptObject(this, item);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
_subItems.pushBack(item);
}
@ -801,7 +801,7 @@ void MenuItemToggle::cleanup()
{
for (const auto& item : _subItems)
{
#if defined(AX_NATIVE_CONTROL_SCRIPT) && !AX_NATIVE_CONTROL_SCRIPT
#if defined(CC_NATIVE_CONTROL_SCRIPT) && !CC_NATIVE_CONTROL_SCRIPT
ScriptEngineManager::getInstance()->getScriptEngine()->releaseScriptObject(this, item);
#endif
item->cleanup();

View File

@ -55,7 +55,7 @@ class SpriteFrame;
*
* Subclass MenuItem (or any subclass) to create your custom MenuItem objects.
*/
class AX_DLL MenuItem : public Node
class CC_DLL MenuItem : public Node
{
public:
/** Creates a MenuItem with no target/selector. */
@ -113,7 +113,7 @@ protected:
ccMenuCallback _callback;
private:
AX_DISALLOW_COPY_AND_ASSIGN(MenuItem);
CC_DISALLOW_COPY_AND_ASSIGN(MenuItem);
};
/** @brief An abstract class for "label" MenuItemLabel items.
@ -124,7 +124,7 @@ private:
- LabelTTF
- Label
*/
class AX_DLL MenuItemLabel : public MenuItem
class CC_DLL MenuItemLabel : public MenuItem
{
public:
/** Creates a MenuItemLabel with a Label and a callback. */
@ -180,13 +180,13 @@ protected:
Node* _label;
private:
AX_DISALLOW_COPY_AND_ASSIGN(MenuItemLabel);
CC_DISALLOW_COPY_AND_ASSIGN(MenuItemLabel);
};
/** @brief A MenuItemAtlasFont.
Helper class that creates a MenuItemLabel class with a LabelAtlas.
*/
class AX_DLL MenuItemAtlasFont : public MenuItemLabel
class CC_DLL MenuItemAtlasFont : public MenuItemLabel
{
public:
/** Creates a menu item from a string and atlas with a target/selector. */
@ -222,13 +222,13 @@ public:
const ccMenuCallback& callback);
private:
AX_DISALLOW_COPY_AND_ASSIGN(MenuItemAtlasFont);
CC_DISALLOW_COPY_AND_ASSIGN(MenuItemAtlasFont);
};
/** @brief A MenuItemFont.
Helper class that creates a MenuItemLabel class with a Label.
*/
class AX_DLL MenuItemFont : public MenuItemLabel
class CC_DLL MenuItemFont : public MenuItemLabel
{
public:
/** Creates a menu item from a string without target/selector. To be used with MenuItemToggle. */
@ -292,7 +292,7 @@ protected:
std::string _fontName;
private:
AX_DISALLOW_COPY_AND_ASSIGN(MenuItemFont);
CC_DISALLOW_COPY_AND_ASSIGN(MenuItemFont);
};
/** @brief MenuItemSprite accepts Node<RGBAProtocol> objects as items.
@ -303,7 +303,7 @@ private:
@since v0.8.0
*/
class AX_DLL MenuItemSprite : public MenuItem
class CC_DLL MenuItemSprite : public MenuItem
{
public:
/** Creates a menu item with a normal, selected and disabled image.*/
@ -365,7 +365,7 @@ protected:
Node* _disabledImage;
private:
AX_DISALLOW_COPY_AND_ASSIGN(MenuItemSprite);
CC_DISALLOW_COPY_AND_ASSIGN(MenuItemSprite);
};
/** @brief MenuItemImage accepts images as items.
@ -376,7 +376,7 @@ private:
For best results try that all images are of the same size.
*/
class AX_DLL MenuItemImage : public MenuItemSprite
class CC_DLL MenuItemImage : public MenuItemSprite
{
public:
/** Creates an MenuItemImage. */
@ -423,14 +423,14 @@ public:
const ccMenuCallback& callback);
private:
AX_DISALLOW_COPY_AND_ASSIGN(MenuItemImage);
CC_DISALLOW_COPY_AND_ASSIGN(MenuItemImage);
};
/** @brief A MenuItemToggle.
A simple container class that "toggles" it's inner items.
The inner items can be any MenuItem.
*/
class AX_DLL MenuItemToggle : public MenuItem
class CC_DLL MenuItemToggle : public MenuItem
{
public:
/**
@ -440,7 +440,7 @@ public:
/** Creates a menu item from a list of items with a callable object. */
static MenuItemToggle* createWithCallback(const ccMenuCallback& callback,
MenuItem* item,
...) AX_REQUIRES_NULL_TERMINATION;
...) CC_REQUIRES_NULL_TERMINATION;
/** Creates a menu item with no target/selector and no items. */
static MenuItemToggle* create();
@ -501,7 +501,7 @@ protected:
Vector<MenuItem*> _subItems;
private:
AX_DISALLOW_COPY_AND_ASSIGN(MenuItemToggle);
CC_DISALLOW_COPY_AND_ASSIGN(MenuItemToggle);
};
// end of 2d group

View File

@ -44,12 +44,12 @@ MotionStreak::MotionStreak()
MotionStreak::~MotionStreak()
{
AX_SAFE_RELEASE(_texture);
AX_SAFE_FREE(_pointState);
AX_SAFE_FREE(_pointVertexes);
AX_SAFE_FREE(_vertices);
AX_SAFE_FREE(_colorPointer);
AX_SAFE_FREE(_texCoords);
CC_SAFE_RELEASE(_texture);
CC_SAFE_FREE(_pointState);
CC_SAFE_FREE(_pointVertexes);
CC_SAFE_FREE(_vertices);
CC_SAFE_FREE(_colorPointer);
CC_SAFE_FREE(_texCoords);
}
MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const Color3B& color, std::string_view path)
@ -61,7 +61,7 @@ MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -74,7 +74,7 @@ MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -215,8 +215,8 @@ void MotionStreak::setTexture(Texture2D* texture)
{
if (_texture != texture)
{
AX_SAFE_RETAIN(texture);
AX_SAFE_RELEASE(_texture);
CC_SAFE_RETAIN(texture);
CC_SAFE_RELEASE(_texture);
_texture = texture;
setProgramStateWithRegistry(backend::ProgramType::POSITION_TEXTURE_COLOR, _texture);

View File

@ -42,7 +42,7 @@ class Texture2D;
/** @class MotionStreak.
* @brief Creates a trailing path.
*/
class AX_DLL MotionStreak : public Node, public TextureProtocol
class CC_DLL MotionStreak : public Node, public TextureProtocol
{
public:
/** Creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture
@ -200,7 +200,7 @@ protected:
backend::UniformLocation _textureLocation;
private:
AX_DISALLOW_COPY_AND_ASSIGN(MotionStreak);
CC_DISALLOW_COPY_AND_ASSIGN(MotionStreak);
};
// end of _2d group

View File

@ -47,7 +47,7 @@ THE SOFTWARE.
#include "math/TransformUtils.h"
#include "renderer/backend/ProgramStateRegistry.h"
#if AX_NODE_RENDER_SUBPIXEL
#if CC_NODE_RENDER_SUBPIXEL
# define RENDER_IN_SUBPIXEL
#else
# define RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__))
@ -56,7 +56,7 @@ THE SOFTWARE.
/*
* 4.5x faster than std::hash in release mode
*/
#define AX_HASH_NODE_NAME(name) (!name.empty() ? XXH3_64bits(name.data(), name.length()) : 0)
#define CC_HASH_NODE_NAME(name) (!name.empty() ? XXH3_64bits(name.data(), name.length()) : 0)
NS_AX_BEGIN
@ -106,7 +106,7 @@ Node::Node()
, _ignoreAnchorPointForPosition(false)
, _reorderChildDirty(false)
, _isTransitionFinished(false)
#if AX_ENABLE_SCRIPT_BINDING
#if CC_ENABLE_SCRIPT_BINDING
, _scriptHandler(0)
, _updateScriptHandler(0)
#endif
@ -123,7 +123,7 @@ Node::Node()
, _onExitCallback(nullptr)
, _onEnterTransitionDidFinishCallback(nullptr)
, _onExitTransitionDidStartCallback(nullptr)
#if AX_USE_PHYSICS
#if CC_USE_PHYSICS
, _physicsBody(nullptr)
#endif
{
@ -148,7 +148,7 @@ Node* Node::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -157,9 +157,9 @@ Node::~Node()
{
CCLOGINFO("deallocing Node: %p - tag: %i", this, _tag);
AX_SAFE_DELETE(_childrenIndexer);
CC_SAFE_DELETE(_childrenIndexer);
#if AX_ENABLE_SCRIPT_BINDING
#if CC_ENABLE_SCRIPT_BINDING
if (_updateScriptHandler)
{
ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_updateScriptHandler);
@ -168,8 +168,8 @@ Node::~Node()
// User object has to be released before others, since userObject may have a weak reference of this node
// It may invoke `node->stopAllActions();` while `_actionManager` is null if the next line is after
// `AX_SAFE_RELEASE_NULL(_actionManager)`.
AX_SAFE_RELEASE_NULL(_userObject);
// `CC_SAFE_RELEASE_NULL(_actionManager)`.
CC_SAFE_RELEASE_NULL(_userObject);
for (auto& child : _children)
{
@ -178,26 +178,26 @@ Node::~Node()
removeAllComponents();
AX_SAFE_DELETE(_componentContainer);
CC_SAFE_DELETE(_componentContainer);
stopAllActions();
unscheduleAllCallbacks();
AX_SAFE_RELEASE_NULL(_actionManager);
AX_SAFE_RELEASE_NULL(_scheduler);
CC_SAFE_RELEASE_NULL(_actionManager);
CC_SAFE_RELEASE_NULL(_scheduler);
_eventDispatcher->removeEventListenersForTarget(this);
#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0
#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0
_eventDispatcher->debugCheckNodeHasNoEventListenersOnDestruction(this);
#endif
CCASSERT(!_running,
"Node still marked as running on node destruction! Was base class onExit() called in derived class "
"onExit() implementations?");
AX_SAFE_RELEASE(_eventDispatcher);
CC_SAFE_RELEASE(_eventDispatcher);
delete[] _additionalTransform;
AX_SAFE_RELEASE(_programState);
CC_SAFE_RELEASE(_programState);
}
bool Node::init()
@ -214,9 +214,9 @@ bool Node::initLayer() {
void Node::cleanup()
{
#if AX_ENABLE_SCRIPT_BINDING
#if CC_ENABLE_SCRIPT_BINDING
ScriptEngineManager::sendNodeEventToLua(this, kNodeOnCleanup);
#endif // #if AX_ENABLE_SCRIPT_BINDING
#endif // #if CC_ENABLE_SCRIPT_BINDING
// actions
this->stopAllActions();
@ -360,8 +360,8 @@ void Node::updateRotationQuat()
// convert Euler angle to quaternion
// when _rotationZ_X == _rotationZ_Y, _rotationQuat = RotationZ_X * RotationY * RotationX
// when _rotationZ_X != _rotationZ_Y, _rotationQuat = RotationY * RotationX
float halfRadx = AX_DEGREES_TO_RADIANS(_rotationX / 2.f), halfRady = AX_DEGREES_TO_RADIANS(_rotationY / 2.f),
halfRadz = _rotationZ_X == _rotationZ_Y ? -AX_DEGREES_TO_RADIANS(_rotationZ_X / 2.f) : 0;
float halfRadx = CC_DEGREES_TO_RADIANS(_rotationX / 2.f), halfRady = CC_DEGREES_TO_RADIANS(_rotationY / 2.f),
halfRadz = _rotationZ_X == _rotationZ_Y ? -CC_DEGREES_TO_RADIANS(_rotationZ_X / 2.f) : 0;
float coshalfRadx = cosf(halfRadx), sinhalfRadx = sinf(halfRadx), coshalfRady = cosf(halfRady),
sinhalfRady = sinf(halfRady), coshalfRadz = cosf(halfRadz), sinhalfRadz = sinf(halfRadz);
_rotationQuat.x = sinhalfRadx * coshalfRady * coshalfRadz - coshalfRadx * sinhalfRady * sinhalfRadz;
@ -380,9 +380,9 @@ void Node::updateRotation3D()
_rotationY = asinf(sy);
_rotationZ_X = atan2f(2.f * (w * z + x * y), 1.f - 2.f * (y * y + z * z));
_rotationX = AX_RADIANS_TO_DEGREES(_rotationX);
_rotationY = AX_RADIANS_TO_DEGREES(_rotationY);
_rotationZ_X = _rotationZ_Y = -AX_RADIANS_TO_DEGREES(_rotationZ_X);
_rotationX = CC_RADIANS_TO_DEGREES(_rotationX);
_rotationY = CC_RADIANS_TO_DEGREES(_rotationY);
_rotationZ_X = _rotationZ_Y = -CC_RADIANS_TO_DEGREES(_rotationZ_X);
}
void Node::setRotationQuat(const Quaternion& quat)
@ -727,11 +727,11 @@ void Node::updateParentChildrenIndexer(int tag)
void Node::updateParentChildrenIndexer(std::string_view name)
{
uint64_t newHash = AX_HASH_NODE_NAME(name);
uint64_t newHash = CC_HASH_NODE_NAME(name);
auto parentChildrenIndexer = getParentChildrenIndexer();
if (parentChildrenIndexer)
{
auto oldHash = AX_HASH_NODE_NAME(_name);
auto oldHash = CC_HASH_NODE_NAME(_name);
if (oldHash != newHash)
parentChildrenIndexer->erase(oldHash);
(*parentChildrenIndexer)[newHash] = this;
@ -763,7 +763,7 @@ void Node::setUserData(void* userData)
void Node::setUserObject(Ref* userObject)
{
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
@ -772,9 +772,9 @@ void Node::setUserObject(Ref* userObject)
if (_userObject)
sEngine->releaseScriptObject(this, _userObject);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
AX_SAFE_RETAIN(userObject);
AX_SAFE_RELEASE(_userObject);
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
CC_SAFE_RETAIN(userObject);
CC_SAFE_RELEASE(_userObject);
_userObject = userObject;
}
@ -828,7 +828,7 @@ Node* Node::getChildByTag(int tag) const
Node* Node::getChildByName(std::string_view name) const
{
// CCASSERT(!name.empty(), "Invalid name");
auto hash = AX_HASH_NODE_NAME(name);
auto hash = CC_HASH_NODE_NAME(name);
if (_childrenIndexer)
{
auto it = _childrenIndexer->find(hash);
@ -1082,7 +1082,7 @@ void Node::removeChild(Node* child, bool cleanup /* = true */)
}
ssize_t index = _children.getIndex(child);
if (index != AX_INVALID_INDEX)
if (index != CC_INVALID_INDEX)
this->detachChild(child, index, cleanup);
}
@ -1132,7 +1132,7 @@ void Node::removeAllChildrenWithCleanup(bool cleanup)
}
_children.clear();
AX_SAFE_DELETE(_childrenIndexer);
CC_SAFE_DELETE(_childrenIndexer);
}
void Node::resetChild(Node* child, bool cleanup)
@ -1152,13 +1152,13 @@ void Node::resetChild(Node* child, bool cleanup)
child->cleanup();
}
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->releaseScriptObject(this, child);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
// set parent nil at the end
child->setParent(nullptr);
}
@ -1178,13 +1178,13 @@ void Node::detachChild(Node* child, ssize_t childIndex, bool cleanup)
// helper used by reorderChild & add
void Node::insertChild(Node* child, int z)
{
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->retainScriptObject(this, child);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
_transformUpdated = true;
_reorderChildDirty = true;
_children.pushBack(child);
@ -1350,7 +1350,7 @@ void Node::onEnter()
_running = true;
#if AX_ENABLE_SCRIPT_BINDING
#if CC_ENABLE_SCRIPT_BINDING
ScriptEngineManager::sendNodeEventToLua(this, kNodeOnEnter);
#endif
}
@ -1364,7 +1364,7 @@ void Node::onEnterTransitionDidFinish()
for (const auto& child : _children)
child->onEnterTransitionDidFinish();
#if AX_ENABLE_SCRIPT_BINDING
#if CC_ENABLE_SCRIPT_BINDING
ScriptEngineManager::sendNodeEventToLua(this, kNodeOnEnterTransitionDidFinish);
#endif
}
@ -1377,7 +1377,7 @@ void Node::onExitTransitionDidStart()
for (const auto& child : _children)
child->onExitTransitionDidStart();
#if AX_ENABLE_SCRIPT_BINDING
#if CC_ENABLE_SCRIPT_BINDING
ScriptEngineManager::sendNodeEventToLua(this, kNodeOnExitTransitionDidStart);
#endif
}
@ -1404,7 +1404,7 @@ void Node::onExit()
for (const auto& child : _children)
child->onExit();
#if AX_ENABLE_SCRIPT_BINDING
#if CC_ENABLE_SCRIPT_BINDING
ScriptEngineManager::sendNodeEventToLua(this, kNodeOnExit);
#endif
}
@ -1414,8 +1414,8 @@ void Node::setEventDispatcher(EventDispatcher* dispatcher)
if (dispatcher != _eventDispatcher)
{
_eventDispatcher->removeEventListenersForTarget(this);
AX_SAFE_RETAIN(dispatcher);
AX_SAFE_RELEASE(_eventDispatcher);
CC_SAFE_RETAIN(dispatcher);
CC_SAFE_RELEASE(_eventDispatcher);
_eventDispatcher = dispatcher;
}
}
@ -1425,8 +1425,8 @@ void Node::setActionManager(ActionManager* actionManager)
if (actionManager != _actionManager)
{
this->stopAllActions();
AX_SAFE_RETAIN(actionManager);
AX_SAFE_RELEASE(_actionManager);
CC_SAFE_RETAIN(actionManager);
CC_SAFE_RELEASE(_actionManager);
_actionManager = actionManager;
}
}
@ -1493,8 +1493,8 @@ void Node::setScheduler(Scheduler* scheduler)
if (scheduler != _scheduler)
{
this->unscheduleAllCallbacks();
AX_SAFE_RETAIN(scheduler);
AX_SAFE_RELEASE(_scheduler);
CC_SAFE_RETAIN(scheduler);
CC_SAFE_RELEASE(_scheduler);
_scheduler = scheduler;
}
}
@ -1523,7 +1523,7 @@ void Node::scheduleUpdateWithPriorityLua(int nHandler, int priority)
{
unscheduleUpdate();
#if AX_ENABLE_SCRIPT_BINDING
#if CC_ENABLE_SCRIPT_BINDING
_updateScriptHandler = nHandler;
#endif
@ -1534,7 +1534,7 @@ void Node::unscheduleUpdate()
{
_scheduler->unscheduleUpdate(this);
#if AX_ENABLE_SCRIPT_BINDING
#if CC_ENABLE_SCRIPT_BINDING
if (_updateScriptHandler)
{
ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_updateScriptHandler);
@ -1545,12 +1545,12 @@ void Node::unscheduleUpdate()
void Node::schedule(SEL_SCHEDULE selector)
{
this->schedule(selector, 0.0f, AX_REPEAT_FOREVER, 0.0f);
this->schedule(selector, 0.0f, CC_REPEAT_FOREVER, 0.0f);
}
void Node::schedule(SEL_SCHEDULE selector, float interval)
{
this->schedule(selector, interval, AX_REPEAT_FOREVER, 0.0f);
this->schedule(selector, interval, CC_REPEAT_FOREVER, 0.0f);
}
void Node::schedule(SEL_SCHEDULE selector, float interval, unsigned int repeat, float delay)
@ -1626,7 +1626,7 @@ void Node::pause()
// override me
void Node::update(float fDelta)
{
#if AX_ENABLE_SCRIPT_BINDING
#if CC_ENABLE_SCRIPT_BINDING
if (0 != _updateScriptHandler)
{
// only lua use
@ -1702,8 +1702,8 @@ const Mat4& Node::getNodeToParentTransform() const
// Rotation values
// Change rotation code to handle X and Y
// If we skew with the exact same value for both x and y then we're simply just rotating
float radiansX = -AX_DEGREES_TO_RADIANS(_rotationZ_X);
float radiansY = -AX_DEGREES_TO_RADIANS(_rotationZ_Y);
float radiansX = -CC_DEGREES_TO_RADIANS(_rotationZ_X);
float radiansY = -CC_DEGREES_TO_RADIANS(_rotationZ_Y);
float cx = cosf(radiansX);
float sx = sinf(radiansX);
float cy = cosf(radiansY);
@ -1744,10 +1744,10 @@ const Mat4& Node::getNodeToParentTransform() const
if (needsSkewMatrix)
{
float skewMatArray[16] = {1,
(float)tanf(AX_DEGREES_TO_RADIANS(_skewY)),
(float)tanf(CC_DEGREES_TO_RADIANS(_skewY)),
0,
0,
(float)tanf(AX_DEGREES_TO_RADIANS(_skewX)),
(float)tanf(CC_DEGREES_TO_RADIANS(_skewX)),
1,
0,
0,
@ -2225,10 +2225,10 @@ bool Node::setProgramState(backend::ProgramState* programState, bool needsRetain
{
if (_programState != programState)
{
AX_SAFE_RELEASE(_programState);
CC_SAFE_RELEASE(_programState);
_programState = programState;
if (needsRetain)
AX_SAFE_RETAIN(_programState);
CC_SAFE_RETAIN(_programState);
return !!_programState;
}
return false;

View File

@ -41,7 +41,7 @@
#include "2d/CCComponentContainer.h"
#include "2d/CCComponent.h"
#if AX_USE_PHYSICS
#if CC_USE_PHYSICS
# include "physics/CCPhysicsBody.h"
#endif
@ -114,7 +114,7 @@ Node and override `draw`.
*/
class AX_DLL Node : public Ref
class CC_DLL Node : public Ref
{
public:
/** Default tag used for all the nodes */
@ -949,7 +949,7 @@ public:
inline static void sortNodes(axis::Vector<_T*>& nodes)
{
static_assert(std::is_base_of<Node, _T>::value, "Node::sortNodes: Only accept derived of Node!");
#if AX_64BITS
#if CC_64BITS
std::sort(std::begin(nodes), std::end(nodes),
[](_T* n1, _T* n2) { return (n1->_localZOrder$Arrival < n2->_localZOrder$Arrival); });
#else
@ -1344,13 +1344,13 @@ public:
// firstly, implement a schedule function
void MyNode::TickMe(float dt);
// wrap this function into a selector via schedule_selector macro.
this->schedule(AX_SCHEDULE_SELECTOR(MyNode::TickMe), 0, 0, 0);
this->schedule(CC_SCHEDULE_SELECTOR(MyNode::TickMe), 0, 0, 0);
@endcode
*
* @param selector The SEL_SCHEDULE selector to be scheduled.
* @param interval Tick interval in seconds. 0 means tick every frame. If interval = 0, it's recommended to use
scheduleUpdate() instead.
* @param repeat The selector will be executed (repeat + 1) times, you can use AX_REPEAT_FOREVER for tick
* @param repeat The selector will be executed (repeat + 1) times, you can use CC_REPEAT_FOREVER for tick
infinitely.
* @param delay The amount of time that the first tick will wait before execution.
* @lua NA
@ -1420,7 +1420,7 @@ public:
*
* @param callback The lambda function to be schedule.
* @param interval Tick interval in seconds. 0 means tick every frame.
* @param repeat The selector will be executed (repeat + 1) times, you can use AX_REPEAT_FOREVER for tick
* @param repeat The selector will be executed (repeat + 1) times, you can use CC_REPEAT_FOREVER for tick
* infinitely.
* @param delay The amount of time that the first tick will wait before execution.
* @param key The key of the lambda function. To be used if you want to unschedule it.
@ -1915,7 +1915,7 @@ protected:
mutable Mat4 _inverse; ///< inverse transform
mutable Mat4* _additionalTransform; ///< two transforms needed by additional transforms
#if AX_LITTLE_ENDIAN
#if CC_LITTLE_ENDIAN
union
{
struct
@ -1982,7 +1982,7 @@ protected:
// camera mask, it is visible only when _cameraMask & current camera' camera flag is true
unsigned short _cameraMask;
#if AX_ENABLE_SCRIPT_BINDING
#if CC_ENABLE_SCRIPT_BINDING
int _scriptHandler; ///< script handler for onEnter() & onExit(), used in Javascript binding and Lua binding.
int _updateScriptHandler; ///< script handler for update() callback per frame, which is invoked from lua &
///< javascript.
@ -2004,7 +2004,7 @@ protected:
backend::ProgramState* _programState = nullptr;
// Physics:remaining backwardly compatible
#if AX_USE_PHYSICS
#if CC_USE_PHYSICS
PhysicsBody* _physicsBody;
public:
@ -2025,7 +2025,7 @@ public:
static int __attachedNodeCount;
private:
AX_DISALLOW_COPY_AND_ASSIGN(Node);
CC_DISALLOW_COPY_AND_ASSIGN(Node);
};
/**
@ -2043,7 +2043,7 @@ private:
* @parma p Point to a Vec3 for store the intersect point, if don't need them set to nullptr.
* @return true if the point is in content rectangle, false otherwise.
*/
bool AX_DLL isScreenPointInRect(const Vec2& pt, const Camera* camera, const Mat4& w2l, const Rect& rect, Vec3* p);
bool CC_DLL isScreenPointInRect(const Vec2& pt, const Camera* camera, const Mat4& w2l, const Rect& rect, Vec3* p);
// end of _2d group
/// @}

View File

@ -37,7 +37,7 @@ NodeGrid* NodeGrid::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -56,7 +56,7 @@ NodeGrid::NodeGrid() {}
void NodeGrid::setTarget(Node* target)
{
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
@ -65,16 +65,16 @@ void NodeGrid::setTarget(Node* target)
if (target)
sEngine->retainScriptObject(this, target);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
AX_SAFE_RELEASE(_gridTarget);
AX_SAFE_RETAIN(target);
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
CC_SAFE_RELEASE(_gridTarget);
CC_SAFE_RETAIN(target);
_gridTarget = target;
}
NodeGrid::~NodeGrid()
{
AX_SAFE_RELEASE(_nodeGrid);
AX_SAFE_RELEASE(_gridTarget);
CC_SAFE_RELEASE(_nodeGrid);
CC_SAFE_RELEASE(_gridTarget);
}
void NodeGrid::onGridBeginDraw()
@ -173,8 +173,8 @@ void NodeGrid::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t p
void NodeGrid::setGrid(GridBase* grid)
{
AX_SAFE_RELEASE(_nodeGrid);
AX_SAFE_RETAIN(grid);
CC_SAFE_RELEASE(_nodeGrid);
CC_SAFE_RETAIN(grid);
_nodeGrid = grid;
}

View File

@ -40,7 +40,7 @@ class GridBase;
* @brief Base class for Grid Node.
*/
class AX_DLL NodeGrid : public Node
class CC_DLL NodeGrid : public Node
{
public:
/** Create a Grid Node.
@ -104,7 +104,7 @@ protected:
Rect _gridRect = Rect::ZERO;
private:
AX_DISALLOW_COPY_AND_ASSIGN(NodeGrid);
CC_DISALLOW_COPY_AND_ASSIGN(NodeGrid);
};
/** @} */
NS_AX_END

View File

@ -46,7 +46,7 @@ struct _ccArray;
The children will be moved faster / slower than the parent according the parallax ratio.
*/
class AX_DLL ParallaxNode : public Node
class CC_DLL ParallaxNode : public Node
{
public:
/** Create a Parallax node.
@ -107,7 +107,7 @@ protected:
struct _ccArray* _parallaxArray;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParallaxNode);
CC_DISALLOW_COPY_AND_ASSIGN(ParallaxNode);
};
// end of _2d group

View File

@ -85,8 +85,8 @@ ParticleBatchNode::ParticleBatchNode()
ParticleBatchNode::~ParticleBatchNode()
{
AX_SAFE_RELEASE(_textureAtlas);
AX_SAFE_RELEASE(_customCommand.getPipelineDescriptor().programState);
CC_SAFE_RELEASE(_textureAtlas);
CC_SAFE_RELEASE(_customCommand.getPipelineDescriptor().programState);
}
/*
* creation with Texture2D
@ -100,7 +100,7 @@ ParticleBatchNode* ParticleBatchNode::createWithTexture(Texture2D* tex, int capa
p->autorelease();
return p;
}
AX_SAFE_DELETE(p);
CC_SAFE_DELETE(p);
return nullptr;
}
@ -116,7 +116,7 @@ ParticleBatchNode* ParticleBatchNode::create(std::string_view imageFile, int cap
p->autorelease();
return p;
}
AX_SAFE_DELETE(p);
CC_SAFE_DELETE(p);
return nullptr;
}
@ -447,7 +447,7 @@ void ParticleBatchNode::removeAllChildrenWithCleanup(bool doCleanup)
void ParticleBatchNode::draw(Renderer* renderer, const Mat4& transform, uint32_t flags)
{
AX_PROFILER_START("CCParticleBatchNode - draw");
CC_PROFILER_START("CCParticleBatchNode - draw");
if (_textureAtlas->getTotalQuads() == 0)
return;
@ -476,7 +476,7 @@ void ParticleBatchNode::draw(Renderer* renderer, const Mat4& transform, uint32_t
renderer->addCommand(&_customCommand);
AX_PROFILER_STOP("CCParticleBatchNode - draw");
CC_PROFILER_STOP("CCParticleBatchNode - draw");
}
void ParticleBatchNode::increaseAtlasCapacityTo(ssize_t quantity)
@ -564,7 +564,7 @@ void ParticleBatchNode::updateProgramStateTexture()
auto programState = _customCommand.getPipelineDescriptor().programState;
programState->setTexture(texture->getBackendTexture());
// If the new texture has No premultiplied alpha, AND the blendFunc hasn't been changed, then update it
if (!texture->hasPremultipliedAlpha() && (_blendFunc.src == AX_BLEND_SRC && _blendFunc.dst == AX_BLEND_DST))
if (!texture->hasPremultipliedAlpha() && (_blendFunc.src == CC_BLEND_SRC && _blendFunc.dst == CC_BLEND_DST))
_blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;
}

View File

@ -68,7 +68,7 @@ class ParticleSystem;
* @since v1.1
*/
class AX_DLL ParticleBatchNode : public Node, public TextureProtocol
class CC_DLL ParticleBatchNode : public Node, public TextureProtocol
{
public:
/** Create the particle system with Texture2D, a capacity of particles, which particle system to use.

View File

@ -44,16 +44,16 @@ static Texture2D* getDefaultTexture()
{
const std::string key = "/__firePngData";
texture = Director::getInstance()->getTextureCache()->getTextureForKey(key);
AX_BREAK_IF(texture != nullptr);
CC_BREAK_IF(texture != nullptr);
image = new Image();
bool ret = image->initWithImageData(__firePngData, sizeof(__firePngData));
AX_BREAK_IF(!ret);
CC_BREAK_IF(!ret);
texture = Director::getInstance()->getTextureCache()->addImage(image, key);
} while (0);
AX_SAFE_RELEASE(image);
CC_SAFE_RELEASE(image);
return texture;
}
@ -67,7 +67,7 @@ ParticleFire* ParticleFire::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -81,7 +81,7 @@ ParticleFire* ParticleFire::createWithTotalParticles(int numberOfParticles)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -171,7 +171,7 @@ ParticleFireworks* ParticleFireworks::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -185,7 +185,7 @@ ParticleFireworks* ParticleFireworks::createWithTotalParticles(int numberOfParti
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -272,7 +272,7 @@ ParticleSun* ParticleSun::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -286,7 +286,7 @@ ParticleSun* ParticleSun::createWithTotalParticles(int numberOfParticles)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -378,7 +378,7 @@ ParticleGalaxy* ParticleGalaxy::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -392,7 +392,7 @@ ParticleGalaxy* ParticleGalaxy::createWithTotalParticles(int numberOfParticles)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -487,7 +487,7 @@ ParticleFlower* ParticleFlower::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -501,7 +501,7 @@ ParticleFlower* ParticleFlower::createWithTotalParticles(int numberOfParticles)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -595,7 +595,7 @@ ParticleMeteor* ParticleMeteor::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -609,7 +609,7 @@ ParticleMeteor* ParticleMeteor::createWithTotalParticles(int numberOfParticles)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -704,7 +704,7 @@ ParticleSpiral* ParticleSpiral::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -718,7 +718,7 @@ ParticleSpiral* ParticleSpiral::createWithTotalParticles(int numberOfParticles)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -813,7 +813,7 @@ ParticleExplosion* ParticleExplosion::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -827,7 +827,7 @@ ParticleExplosion* ParticleExplosion::createWithTotalParticles(int numberOfParti
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -921,7 +921,7 @@ ParticleSmoke* ParticleSmoke::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -935,7 +935,7 @@ ParticleSmoke* ParticleSmoke::createWithTotalParticles(int numberOfParticles)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -1026,7 +1026,7 @@ ParticleSnow* ParticleSnow::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -1040,7 +1040,7 @@ ParticleSnow* ParticleSnow::createWithTotalParticles(int numberOfParticles)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -1134,7 +1134,7 @@ ParticleRain* ParticleRain::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -1148,7 +1148,7 @@ ParticleRain* ParticleRain::createWithTotalParticles(int numberOfParticles)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}

View File

@ -40,7 +40,7 @@ NS_AX_BEGIN
/** @class ParticleFire
* @brief A fire particle system.
*/
class AX_DLL ParticleFire : public ParticleSystemQuad
class CC_DLL ParticleFire : public ParticleSystemQuad
{
public:
/** Create a fire particle system.
@ -70,13 +70,13 @@ public:
virtual bool initWithTotalParticles(int numberOfParticles) override;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParticleFire);
CC_DISALLOW_COPY_AND_ASSIGN(ParticleFire);
};
/** @class ParticleFireworks
* @brief A fireworks particle system.
*/
class AX_DLL ParticleFireworks : public ParticleSystemQuad
class CC_DLL ParticleFireworks : public ParticleSystemQuad
{
public:
/** Create a fireworks particle system.
@ -106,13 +106,13 @@ public:
virtual bool initWithTotalParticles(int numberOfParticles);
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParticleFireworks);
CC_DISALLOW_COPY_AND_ASSIGN(ParticleFireworks);
};
/** @class ParticleSun
* @brief A sun particle system.
*/
class AX_DLL ParticleSun : public ParticleSystemQuad
class CC_DLL ParticleSun : public ParticleSystemQuad
{
public:
/** Create a sun particle system.
@ -142,13 +142,13 @@ public:
virtual bool initWithTotalParticles(int numberOfParticles);
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParticleSun);
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSun);
};
/** @class ParticleGalaxy
* @brief A galaxy particle system.
*/
class AX_DLL ParticleGalaxy : public ParticleSystemQuad
class CC_DLL ParticleGalaxy : public ParticleSystemQuad
{
public:
/** Create a galaxy particle system.
@ -178,13 +178,13 @@ public:
virtual bool initWithTotalParticles(int numberOfParticles);
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParticleGalaxy);
CC_DISALLOW_COPY_AND_ASSIGN(ParticleGalaxy);
};
/** @class ParticleFlower
* @brief A flower particle system.
*/
class AX_DLL ParticleFlower : public ParticleSystemQuad
class CC_DLL ParticleFlower : public ParticleSystemQuad
{
public:
/** Create a flower particle system.
@ -214,13 +214,13 @@ public:
virtual bool initWithTotalParticles(int numberOfParticles);
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParticleFlower);
CC_DISALLOW_COPY_AND_ASSIGN(ParticleFlower);
};
/** @class ParticleMeteor
* @brief A meteor particle system.
*/
class AX_DLL ParticleMeteor : public ParticleSystemQuad
class CC_DLL ParticleMeteor : public ParticleSystemQuad
{
public:
/** Create a meteor particle system.
@ -250,13 +250,13 @@ public:
virtual bool initWithTotalParticles(int numberOfParticles);
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParticleMeteor);
CC_DISALLOW_COPY_AND_ASSIGN(ParticleMeteor);
};
/** @class ParticleSpiral
* @brief An spiral particle system.
*/
class AX_DLL ParticleSpiral : public ParticleSystemQuad
class CC_DLL ParticleSpiral : public ParticleSystemQuad
{
public:
/** Create a spiral particle system.
@ -286,13 +286,13 @@ public:
virtual bool initWithTotalParticles(int numberOfParticles);
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParticleSpiral);
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSpiral);
};
/** @class ParticleExplosion
* @brief An explosion particle system.
*/
class AX_DLL ParticleExplosion : public ParticleSystemQuad
class CC_DLL ParticleExplosion : public ParticleSystemQuad
{
public:
/** Create a explosion particle system.
@ -322,13 +322,13 @@ public:
virtual bool initWithTotalParticles(int numberOfParticles);
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParticleExplosion);
CC_DISALLOW_COPY_AND_ASSIGN(ParticleExplosion);
};
/** @class ParticleSmoke
* @brief An smoke particle system.
*/
class AX_DLL ParticleSmoke : public ParticleSystemQuad
class CC_DLL ParticleSmoke : public ParticleSystemQuad
{
public:
/** Create a smoke particle system.
@ -358,13 +358,13 @@ public:
virtual bool initWithTotalParticles(int numberOfParticles);
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParticleSmoke);
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSmoke);
};
/** @class ParticleSnow
* @brief An snow particle system.
*/
class AX_DLL ParticleSnow : public ParticleSystemQuad
class CC_DLL ParticleSnow : public ParticleSystemQuad
{
public:
/** Create a snow particle system.
@ -394,13 +394,13 @@ public:
virtual bool initWithTotalParticles(int numberOfParticles);
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParticleSnow);
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSnow);
};
/** @class ParticleRain
* @brief A rain particle system.
*/
class AX_DLL ParticleRain : public ParticleSystemQuad
class CC_DLL ParticleRain : public ParticleSystemQuad
{
public:
/** Create a rain particle system.
@ -430,7 +430,7 @@ public:
virtual bool initWithTotalParticles(int numberOfParticles);
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParticleRain);
CC_DISALLOW_COPY_AND_ASSIGN(ParticleRain);
};
// end of _2d group

View File

@ -147,47 +147,47 @@ bool ParticleData::init(int count)
void ParticleData::release()
{
AX_SAFE_FREE(posx);
AX_SAFE_FREE(posy);
AX_SAFE_FREE(startPosX);
AX_SAFE_FREE(startPosY);
AX_SAFE_FREE(colorR);
AX_SAFE_FREE(colorG);
AX_SAFE_FREE(colorB);
AX_SAFE_FREE(colorA);
AX_SAFE_FREE(deltaColorR);
AX_SAFE_FREE(deltaColorG);
AX_SAFE_FREE(deltaColorB);
AX_SAFE_FREE(deltaColorA);
AX_SAFE_FREE(hue);
AX_SAFE_FREE(sat);
AX_SAFE_FREE(val);
AX_SAFE_FREE(opacityFadeInDelta);
AX_SAFE_FREE(opacityFadeInLength);
AX_SAFE_FREE(scaleInDelta);
AX_SAFE_FREE(scaleInLength);
AX_SAFE_FREE(size);
AX_SAFE_FREE(deltaSize);
AX_SAFE_FREE(rotation);
AX_SAFE_FREE(staticRotation);
AX_SAFE_FREE(deltaRotation);
AX_SAFE_FREE(totalTimeToLive);
AX_SAFE_FREE(timeToLive);
AX_SAFE_FREE(animTimeLength);
AX_SAFE_FREE(animTimeDelta);
AX_SAFE_FREE(animIndex);
AX_SAFE_FREE(animCellIndex);
AX_SAFE_FREE(atlasIndex);
CC_SAFE_FREE(posx);
CC_SAFE_FREE(posy);
CC_SAFE_FREE(startPosX);
CC_SAFE_FREE(startPosY);
CC_SAFE_FREE(colorR);
CC_SAFE_FREE(colorG);
CC_SAFE_FREE(colorB);
CC_SAFE_FREE(colorA);
CC_SAFE_FREE(deltaColorR);
CC_SAFE_FREE(deltaColorG);
CC_SAFE_FREE(deltaColorB);
CC_SAFE_FREE(deltaColorA);
CC_SAFE_FREE(hue);
CC_SAFE_FREE(sat);
CC_SAFE_FREE(val);
CC_SAFE_FREE(opacityFadeInDelta);
CC_SAFE_FREE(opacityFadeInLength);
CC_SAFE_FREE(scaleInDelta);
CC_SAFE_FREE(scaleInLength);
CC_SAFE_FREE(size);
CC_SAFE_FREE(deltaSize);
CC_SAFE_FREE(rotation);
CC_SAFE_FREE(staticRotation);
CC_SAFE_FREE(deltaRotation);
CC_SAFE_FREE(totalTimeToLive);
CC_SAFE_FREE(timeToLive);
CC_SAFE_FREE(animTimeLength);
CC_SAFE_FREE(animTimeDelta);
CC_SAFE_FREE(animIndex);
CC_SAFE_FREE(animCellIndex);
CC_SAFE_FREE(atlasIndex);
AX_SAFE_FREE(modeA.dirX);
AX_SAFE_FREE(modeA.dirY);
AX_SAFE_FREE(modeA.radialAccel);
AX_SAFE_FREE(modeA.tangentialAccel);
CC_SAFE_FREE(modeA.dirX);
CC_SAFE_FREE(modeA.dirY);
CC_SAFE_FREE(modeA.radialAccel);
CC_SAFE_FREE(modeA.tangentialAccel);
AX_SAFE_FREE(modeB.angle);
AX_SAFE_FREE(modeB.degreesPerSecond);
AX_SAFE_FREE(modeB.deltaRadius);
AX_SAFE_FREE(modeB.radius);
CC_SAFE_FREE(modeB.angle);
CC_SAFE_FREE(modeB.degreesPerSecond);
CC_SAFE_FREE(modeB.deltaRadius);
CC_SAFE_FREE(modeB.radius);
}
Vector<ParticleSystem*> ParticleSystem::__allInstances;
@ -279,7 +279,7 @@ ParticleSystem* ParticleSystem::create(std::string_view plistFile)
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return ret;
}
@ -291,7 +291,7 @@ ParticleSystem* ParticleSystem::createWithTotalParticles(int numberOfParticles)
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return ret;
}
@ -321,10 +321,10 @@ bool ParticleSystem::allocAnimationMem()
void ParticleSystem::deallocAnimationMem()
{
AX_SAFE_FREE(_particleData.animTimeLength);
AX_SAFE_FREE(_particleData.animTimeDelta);
AX_SAFE_FREE(_particleData.animIndex);
AX_SAFE_FREE(_particleData.animCellIndex);
CC_SAFE_FREE(_particleData.animTimeLength);
CC_SAFE_FREE(_particleData.animTimeDelta);
CC_SAFE_FREE(_particleData.animIndex);
CC_SAFE_FREE(_particleData.animCellIndex);
_isAnimAllocated = false;
}
@ -346,9 +346,9 @@ bool ParticleSystem::allocHSVMem()
void ParticleSystem::deallocHSVMem()
{
AX_SAFE_FREE(_particleData.hue);
AX_SAFE_FREE(_particleData.sat);
AX_SAFE_FREE(_particleData.val);
CC_SAFE_FREE(_particleData.hue);
CC_SAFE_FREE(_particleData.sat);
CC_SAFE_FREE(_particleData.val);
_isHSVAllocated = false;
}
@ -369,8 +369,8 @@ bool ParticleSystem::allocOpacityFadeInMem()
void ParticleSystem::deallocOpacityFadeInMem()
{
AX_SAFE_FREE(_particleData.opacityFadeInDelta);
AX_SAFE_FREE(_particleData.opacityFadeInLength);
CC_SAFE_FREE(_particleData.opacityFadeInDelta);
CC_SAFE_FREE(_particleData.opacityFadeInLength);
_isOpacityFadeInAllocated = false;
}
@ -391,8 +391,8 @@ bool ParticleSystem::allocScaleInMem()
void ParticleSystem::deallocScaleInMem()
{
AX_SAFE_FREE(_particleData.scaleInDelta);
AX_SAFE_FREE(_particleData.scaleInLength);
CC_SAFE_FREE(_particleData.scaleInDelta);
CC_SAFE_FREE(_particleData.scaleInLength);
_isScaleInAllocated = false;
}
@ -574,7 +574,7 @@ bool ParticleSystem::initWithDictionary(const ValueMap& dictionary, std::string_
else
{
CCASSERT(false, "Invalid emitterType in config file");
AX_BREAK_IF(true);
CC_BREAK_IF(true);
}
// life span
@ -639,19 +639,19 @@ bool ParticleSystem::initWithDictionary(const ValueMap& dictionary, std::string_
int decodeLen =
base64Decode((unsigned char*)textureData.c_str(), (unsigned int)dataLen, &buffer);
CCASSERT(buffer != nullptr, "CCParticleSystem: error decoding textureImageData");
AX_BREAK_IF(!buffer);
CC_BREAK_IF(!buffer);
unsigned char* deflated = nullptr;
ssize_t deflatedLen = ZipUtils::inflateMemory(buffer, decodeLen, &deflated);
CCASSERT(deflated != nullptr, "CCParticleSystem: error ungzipping textureImageData");
AX_BREAK_IF(!deflated);
CC_BREAK_IF(!deflated);
// For android, we should retain it in VolatileTexture::addImage which invoked in
// Director::getInstance()->getTextureCache()->addUIImage()
image = new Image();
bool isOK = image->initWithImageData(deflated, deflatedLen, true);
CCASSERT(isOK, "CCParticleSystem: error init image with Data");
AX_BREAK_IF(!isOK);
CC_BREAK_IF(!isOK);
setTexture(_director->getTextureCache()->addImage(image, _plistFile + textureName));
@ -712,7 +712,7 @@ bool ParticleSystem::initWithTotalParticles(int numberOfParticles)
// Optimization: compile updateParticle method
// updateParticleSel = @selector(updateQuadWithParticle:newPosition:);
// updateParticleImp = (AX_UPDATE_PARTICLE_IMP) [self methodForSelector:updateParticleSel];
// updateParticleImp = (CC_UPDATE_PARTICLE_IMP) [self methodForSelector:updateParticleSel];
// for batchNode
_transformSystemDirty = false;
@ -726,7 +726,7 @@ ParticleSystem::~ParticleSystem()
// unscheduleUpdate();
_particleData.release();
_animations.clear();
AX_SAFE_RELEASE(_texture);
CC_SAFE_RELEASE(_texture);
}
void ParticleSystem::addParticles(int count, int animationIndex, int animationCellIndex)
@ -798,7 +798,7 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe
auto val = _rng.float01() * shape.innerRadius / shape.innerRadius;
val = powf(val, 1 / shape.edgeBias);
auto point = Vec2(0.0F, val * shape.innerRadius);
point = point.rotateByAngle(Vec2::ZERO, -AX_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef()));
point = point.rotateByAngle(Vec2::ZERO, -CC_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef()));
_particleData.posx[i] = _sourcePosition.x + shape.x + point.x / 2;
_particleData.posy[i] = _sourcePosition.y + shape.y + point.y / 2;
@ -809,7 +809,7 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe
auto val = _rng.float01() * shape.outerRadius / shape.outerRadius;
val = powf(val, 1 / shape.edgeBias);
auto point = Vec2(0.0F, ((val * (shape.outerRadius - shape.innerRadius) + shape.outerRadius) - (shape.outerRadius - shape.innerRadius)));
point = point.rotateByAngle(Vec2::ZERO, -AX_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef()));
point = point.rotateByAngle(Vec2::ZERO, -CC_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef()));
_particleData.posx[i] = _sourcePosition.x + shape.x + point.x / 2;
_particleData.posy[i] = _sourcePosition.y + shape.y + point.y / 2;
@ -839,7 +839,7 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe
point.x = point.x / size.x * overrideSize.x * scale.x;
point.y = point.y / size.y * overrideSize.y * scale.y;
point = point.rotateByAngle(Vec2::ZERO, -AX_DEGREES_TO_RADIANS(angle));
point = point.rotateByAngle(Vec2::ZERO, -CC_DEGREES_TO_RADIANS(angle));
_particleData.posx[i] = _sourcePosition.x + shape.x + point.x;
_particleData.posy[i] = _sourcePosition.y + shape.y + point.y;
@ -1053,20 +1053,20 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe
{
for (int i = start; i < _particleCount; ++i)
{
float a = AX_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef());
float a = CC_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef());
Vec2 v(cosf(a), sinf(a));
float s = modeA.speed + modeA.speedVar * _rng.rangef();
Vec2 dir = v * s;
_particleData.modeA.dirX[i] = dir.x; // v * s ;
_particleData.modeA.dirY[i] = dir.y;
_particleData.rotation[i] = -AX_RADIANS_TO_DEGREES(dir.getAngle());
_particleData.rotation[i] = -CC_RADIANS_TO_DEGREES(dir.getAngle());
}
}
else
{
for (int i = start; i < _particleCount; ++i)
{
float a = AX_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef());
float a = CC_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef());
Vec2 v(cosf(a), sinf(a));
float s = modeA.speed + modeA.speedVar * _rng.rangef();
Vec2 dir = v * s;
@ -1088,13 +1088,13 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe
for (int i = start; i < _particleCount; ++i)
{
_particleData.modeB.angle[i] = AX_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef());
_particleData.modeB.angle[i] = CC_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef());
}
for (int i = start; i < _particleCount; ++i)
{
_particleData.modeB.degreesPerSecond[i] =
AX_DEGREES_TO_RADIANS(modeB.rotatePerSecond + modeB.rotatePerSecondVar * _rng.rangef());
CC_DEGREES_TO_RADIANS(modeB.rotatePerSecond + modeB.rotatePerSecondVar * _rng.rangef());
}
if (modeB.endRadius == START_RADIUS_EQUAL_TO_END_RADIUS)
@ -1558,7 +1558,7 @@ void ParticleSystem::update(float dt)
if (!_visible)
return;
AX_PROFILER_START_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update");
CC_PROFILER_START_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update");
if (_componentContainer && !_componentContainer->isEmpty())
{
@ -1572,7 +1572,7 @@ void ParticleSystem::update(float dt)
{
updateParticleQuads();
_transformSystemDirty = false;
AX_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update");
CC_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update");
return;
}
dt = _fixedFPSDelta;
@ -1838,7 +1838,7 @@ void ParticleSystem::update(float dt)
postStep();
}
AX_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update");
CC_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update");
}
void ParticleSystem::updateWithNoTime()
@ -1861,8 +1861,8 @@ void ParticleSystem::setTexture(Texture2D* var)
{
if (_texture != var)
{
AX_SAFE_RETAIN(var);
AX_SAFE_RELEASE(_texture);
CC_SAFE_RETAIN(var);
CC_SAFE_RELEASE(_texture);
_texture = var;
updateBlendFunc();
}
@ -1878,7 +1878,7 @@ void ParticleSystem::updateBlendFunc()
_opacityModifyRGB = false;
if (_texture && (_blendFunc.src == AX_BLEND_SRC && _blendFunc.dst == AX_BLEND_DST))
if (_texture && (_blendFunc.src == CC_BLEND_SRC && _blendFunc.dst == CC_BLEND_DST))
{
if (premultiplied)
{

View File

@ -103,7 +103,7 @@ struct ParticleFrameDescriptor
bool isRotated;
};
class AX_DLL ParticleData
class CC_DLL ParticleData
{
public:
float* posx;
@ -239,7 +239,7 @@ public:
* Particle emission mask cache.
* @since axis-1.0.0b8
*/
class AX_DLL ParticleEmissionMaskCache : public axis::Ref
class CC_DLL ParticleEmissionMaskCache : public axis::Ref
{
public:
static ParticleEmissionMaskCache* getInstance();
@ -306,7 +306,7 @@ private:
};
// typedef void (*AX_UPDATE_PARTICLE_IMP)(id, SEL, tParticle*, Vec2);
// typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tParticle*, Vec2);
class Texture2D;
@ -354,7 +354,7 @@ emitter.startSpin = 0;
@endcode
*/
class AX_DLL ParticleSystem : public Node, public TextureProtocol, public PlayableProtocol
class CC_DLL ParticleSystem : public Node, public TextureProtocol, public PlayableProtocol
{
public:
/** Mode
@ -1535,7 +1535,7 @@ protected:
float _emitCounter;
// Optimization
// AX_UPDATE_PARTICLE_IMP updateParticleImp;
// CC_UPDATE_PARTICLE_IMP updateParticleImp;
// SEL updateParticleSel;
/** weak reference to the SpriteBatchNode that renders the Sprite */
@ -1684,7 +1684,7 @@ protected:
FastRNG _rng;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParticleSystem);
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSystem);
};
// end of _2d group

View File

@ -83,11 +83,11 @@ ParticleSystemQuad::~ParticleSystemQuad()
{
if (nullptr == _batchNode)
{
AX_SAFE_FREE(_quads);
AX_SAFE_FREE(_indices);
CC_SAFE_FREE(_quads);
CC_SAFE_FREE(_indices);
}
AX_SAFE_RELEASE_NULL(_quadCommand.getPipelineDescriptor().programState);
CC_SAFE_RELEASE_NULL(_quadCommand.getPipelineDescriptor().programState);
}
// implementation ParticleSystemQuad
@ -100,7 +100,7 @@ ParticleSystemQuad* ParticleSystemQuad::create(std::string_view filename)
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return ret;
}
@ -116,7 +116,7 @@ ParticleSystemQuad* ParticleSystemQuad::createWithTotalParticles(int numberOfPar
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return ret;
}
@ -128,7 +128,7 @@ ParticleSystemQuad* ParticleSystemQuad::create(ValueMap& dictionary)
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return ret;
}
@ -149,10 +149,10 @@ bool ParticleSystemQuad::initWithTotalParticles(int numberOfParticles)
initIndices();
// setupVBO();
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
// Need to listen the event only when not use batchnode, because it will use VBO
auto listener = EventListenerCustom::create(EVENT_RENDERER_RECREATED,
AX_CALLBACK_1(ParticleSystemQuad::listenRendererRecreated, this));
CC_CALLBACK_1(ParticleSystemQuad::listenRendererRecreated, this));
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
#endif
@ -167,8 +167,8 @@ void ParticleSystemQuad::initTexCoordsWithRect(const Rect& pointRect)
// convert to Tex coords
Rect rect =
Rect(pointRect.origin.x * AX_CONTENT_SCALE_FACTOR(), pointRect.origin.y * AX_CONTENT_SCALE_FACTOR(),
pointRect.size.width * AX_CONTENT_SCALE_FACTOR(), pointRect.size.height * AX_CONTENT_SCALE_FACTOR());
Rect(pointRect.origin.x * CC_CONTENT_SCALE_FACTOR(), pointRect.origin.y * CC_CONTENT_SCALE_FACTOR(),
pointRect.size.width * CC_CONTENT_SCALE_FACTOR(), pointRect.size.height * CC_CONTENT_SCALE_FACTOR());
float wide = (float)pointRect.size.width;
float high = (float)pointRect.size.height;
@ -179,7 +179,7 @@ void ParticleSystemQuad::initTexCoordsWithRect(const Rect& pointRect)
high = (float)_texture->getPixelsHigh();
}
#if AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL
#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
float left = (rect.origin.x * 2 + 1) / (wide * 2);
float bottom = (rect.origin.y * 2 + 1) / (high * 2);
float right = left + (rect.size.width * 2 - 2) / (wide * 2);
@ -189,7 +189,7 @@ void ParticleSystemQuad::initTexCoordsWithRect(const Rect& pointRect)
float bottom = rect.origin.y / high;
float right = left + rect.size.width / wide;
float top = bottom + rect.size.height / high;
#endif // ! AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL
#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
// Important. Texture in cocos2d are inverted, so the Y component should be inverted
std::swap(top, bottom);
@ -295,7 +295,7 @@ inline void updatePosWithParticle(V3F_C4B_T2F_Quad* quad,
float x = newPosition.x;
float y = newPosition.y;
float r = (float)-AX_DEGREES_TO_RADIANS(rotation + staticRotation);
float r = (float)-CC_DEGREES_TO_RADIANS(rotation + staticRotation);
float cr = cosf(r);
float sr = sinf(r);
float ax = x1 * cr - y1 * sr + x;
@ -811,8 +811,8 @@ bool ParticleSystemQuad::allocMemory()
{
CCASSERT(!_batchNode, "Memory should not be alloced when not using batchNode");
AX_SAFE_FREE(_quads);
AX_SAFE_FREE(_indices);
CC_SAFE_FREE(_quads);
CC_SAFE_FREE(_indices);
_quads = (V3F_C4B_T2F_Quad*)malloc(_totalParticles * sizeof(V3F_C4B_T2F_Quad));
_indices = (unsigned short*)malloc(_totalParticles * 6 * sizeof(unsigned short));
@ -820,8 +820,8 @@ bool ParticleSystemQuad::allocMemory()
if (!_quads || !_indices)
{
CCLOG("cocos2d: Particle system: not enough memory");
AX_SAFE_FREE(_quads);
AX_SAFE_FREE(_indices);
CC_SAFE_FREE(_quads);
CC_SAFE_FREE(_indices);
return false;
}
@ -856,8 +856,8 @@ void ParticleSystemQuad::setBatchNode(ParticleBatchNode* batchNode)
V3F_C4B_T2F_Quad* quad = &(batchQuads[_atlasIndex]);
memcpy(quad, _quads, _totalParticles * sizeof(_quads[0]));
AX_SAFE_FREE(_quads);
AX_SAFE_FREE(_indices);
CC_SAFE_FREE(_quads);
CC_SAFE_FREE(_indices);
}
}
}
@ -870,7 +870,7 @@ ParticleSystemQuad* ParticleSystemQuad::create()
particleSystemQuad->autorelease();
return particleSystemQuad;
}
AX_SAFE_DELETE(particleSystemQuad);
CC_SAFE_DELETE(particleSystemQuad);
return nullptr;
}

View File

@ -55,7 +55,7 @@ Special features and Limitations:
@since v0.8
@js NA
*/
class AX_DLL ParticleSystemQuad : public ParticleSystem
class CC_DLL ParticleSystemQuad : public ParticleSystem
{
public:
/** Creates a Particle Emitter.
@ -176,7 +176,7 @@ protected:
backend::UniformLocation _textureLocation;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ParticleSystemQuad);
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSystemQuad);
};
// end of _2d group

View File

@ -317,7 +317,7 @@ void PlistSpriteSheetLoader::addSpriteFramesWithDictionary(ValueMap& dictionary,
spriteSheet->full = true;
AX_SAFE_DELETE(image);
CC_SAFE_DELETE(image);
}
void PlistSpriteSheetLoader::addSpriteFramesWithDictionary(ValueMap& dict,

View File

@ -53,7 +53,7 @@ backend::ProgramState* initPipelineDescriptor(axis::CustomCommand& command,
auto& pipelieDescriptor = command.getPipelineDescriptor();
auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE_COLOR);
auto programState = new backend::ProgramState(program);
AX_SAFE_RELEASE(pipelieDescriptor.programState);
CC_SAFE_RELEASE(pipelieDescriptor.programState);
pipelieDescriptor.programState = programState;
// set vertexLayout according to V2F_C4B_T2F structure
@ -117,7 +117,7 @@ bool ProgressTimer::initWithSprite(Sprite* sp)
setSprite(sp);
// TODO: Use ProgramState Vector to Node
AX_SAFE_RELEASE(_programState2);
CC_SAFE_RELEASE(_programState2);
setProgramState(initPipelineDescriptor(_customCommand, true, _locMVP1, _locTex1), false);
_programState2 = initPipelineDescriptor(_customCommand2, false, _locMVP2, _locTex2);
@ -126,8 +126,8 @@ bool ProgressTimer::initWithSprite(Sprite* sp)
ProgressTimer::~ProgressTimer()
{
AX_SAFE_RELEASE(_sprite);
AX_SAFE_RELEASE(_programState2);
CC_SAFE_RELEASE(_sprite);
CC_SAFE_RELEASE(_programState2);
}
void ProgressTimer::setPercentage(float percentage)
@ -143,7 +143,7 @@ void ProgressTimer::setSprite(Sprite* sprite)
{
if (_sprite != sprite)
{
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
@ -152,9 +152,9 @@ void ProgressTimer::setSprite(Sprite* sprite)
if (sprite)
sEngine->retainScriptObject(this, sprite);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
AX_SAFE_RETAIN(sprite);
AX_SAFE_RELEASE(_sprite);
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
CC_SAFE_RETAIN(sprite);
CC_SAFE_RELEASE(_sprite);
_sprite = sprite;
setContentSize(_sprite->getContentSize());

View File

@ -48,7 +48,7 @@ class Sprite;
* The progress can be Radial, Horizontal or vertical.
* @since v0.99.1
*/
class AX_DLL ProgressTimer : public Node
class CC_DLL ProgressTimer : public Node
{
public:
/** Types of progress
@ -201,7 +201,7 @@ protected:
backend::UniformLocation _locTex2;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ProgressTimer);
CC_DISALLOW_COPY_AND_ASSIGN(ProgressTimer);
};
// end of misc_nodes group

View File

@ -51,7 +51,7 @@ ProtectedNode* ProtectedNode::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
}
return ret;
}
@ -141,7 +141,7 @@ void ProtectedNode::removeProtectedChild(axis::Node* child, bool cleanup)
}
ssize_t index = _protectedChildren.getIndex(child);
if (index != AX_INVALID_INDEX)
if (index != CC_INVALID_INDEX)
{
// IMPORTANT:
@ -163,13 +163,13 @@ void ProtectedNode::removeProtectedChild(axis::Node* child, bool cleanup)
// set parent nil at the end
child->setParent(nullptr);
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->releaseScriptObject(this, child);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
_protectedChildren.erase(index);
}
}
@ -197,13 +197,13 @@ void ProtectedNode::removeAllProtectedChildrenWithCleanup(bool cleanup)
{
child->cleanup();
}
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->releaseScriptObject(this, child);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
// set parent nil at the end
child->setParent(nullptr);
}
@ -230,13 +230,13 @@ void ProtectedNode::removeProtectedChildByTag(int tag, bool cleanup)
// helper used by reorderChild & add
void ProtectedNode::insertProtectedChild(axis::Node* child, int z)
{
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->retainScriptObject(this, child);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
_reorderProtectedChildDirty = true;
_protectedChildren.pushBack(child);
child->setLocalZOrder(z);

View File

@ -43,7 +43,7 @@ NS_AX_BEGIN
*@brief A inner node type mainly used for UI module.
* It is useful for composing complex node type and it's children are protected.
*/
class AX_DLL ProtectedNode : public Node
class CC_DLL ProtectedNode : public Node
{
public:
/**
@ -199,7 +199,7 @@ protected:
bool _reorderProtectedChildDirty;
private:
AX_DISALLOW_COPY_AND_ASSIGN(ProtectedNode);
CC_DISALLOW_COPY_AND_ASSIGN(ProtectedNode);
};
// end of 2d group

View File

@ -45,39 +45,39 @@ NS_AX_BEGIN
// implementation RenderTexture
RenderTexture::RenderTexture()
{
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
// Listen this event to save render texture before come to background.
// Then it can be restored after coming to foreground on Android.
auto toBackgroundListener =
EventListenerCustom::create(EVENT_COME_TO_BACKGROUND, AX_CALLBACK_1(RenderTexture::listenToBackground, this));
EventListenerCustom::create(EVENT_COME_TO_BACKGROUND, CC_CALLBACK_1(RenderTexture::listenToBackground, this));
_eventDispatcher->addEventListenerWithSceneGraphPriority(toBackgroundListener, this);
auto toForegroundListener =
EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, AX_CALLBACK_1(RenderTexture::listenToForeground, this));
EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(RenderTexture::listenToForeground, this));
_eventDispatcher->addEventListenerWithSceneGraphPriority(toForegroundListener, this);
#endif
}
RenderTexture::~RenderTexture()
{
AX_SAFE_RELEASE(_renderTarget);
AX_SAFE_RELEASE(_sprite);
AX_SAFE_RELEASE(_depthStencilTexture);
AX_SAFE_RELEASE(_UITextureImage);
CC_SAFE_RELEASE(_renderTarget);
CC_SAFE_RELEASE(_sprite);
CC_SAFE_RELEASE(_depthStencilTexture);
CC_SAFE_RELEASE(_UITextureImage);
}
void RenderTexture::listenToBackground(EventCustom* /*event*/)
{
// We have not found a way to dispatch the enter background message before the texture data are destroyed.
// So we disable this pair of message handler at present.
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
// to get the rendered texture data
auto func = [&](Image* uiTextureImage) {
if (uiTextureImage)
{
AX_SAFE_RELEASE(_UITextureImage);
CC_SAFE_RELEASE(_UITextureImage);
_UITextureImage = uiTextureImage;
AX_SAFE_RETAIN(_UITextureImage);
CC_SAFE_RETAIN(_UITextureImage);
const Vec2& s = _texture2D->getContentSizeInPixels();
VolatileTextureMgr::addDataTexture(_texture2D, uiTextureImage->getData(), s.width * s.height * 4,
backend::PixelFormat::RGBA8, s);
@ -86,7 +86,7 @@ void RenderTexture::listenToBackground(EventCustom* /*event*/)
{
CCLOG("Cache rendertexture failed!");
}
AX_SAFE_RELEASE(uiTextureImage);
CC_SAFE_RELEASE(uiTextureImage);
};
auto callback = std::bind(func, std::placeholders::_1);
newImage(callback, false);
@ -96,7 +96,7 @@ void RenderTexture::listenToBackground(EventCustom* /*event*/)
void RenderTexture::listenToForeground(EventCustom* /*event*/)
{
#if AX_ENABLE_CACHE_TEXTURE_DATA
#if CC_ENABLE_CACHE_TEXTURE_DATA
const Vec2& s = _texture2D->getContentSizeInPixels();
// TODO new-renderer: field _depthAndStencilFormat removal
// if (_depthAndStencilFormat != 0)
@ -117,7 +117,7 @@ RenderTexture* RenderTexture::create(int w, int h, backend::PixelFormat eFormat,
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -130,7 +130,7 @@ RenderTexture* RenderTexture::create(int w, int h, backend::PixelFormat eFormat,
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -143,7 +143,7 @@ RenderTexture* RenderTexture::create(int w, int h, bool sharedRenderTarget)
ret->autorelease();
return ret;
}
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
@ -164,8 +164,8 @@ bool RenderTexture::initWithWidthAndHeight(int w,
do
{
_fullRect = _rtTextureRect = Rect(0, 0, w, h);
w = (int)(w * AX_CONTENT_SCALE_FACTOR());
h = (int)(h * AX_CONTENT_SCALE_FACTOR());
w = (int)(w * CC_CONTENT_SCALE_FACTOR());
h = (int)(h * CC_CONTENT_SCALE_FACTOR());
_fullviewPort = Rect(0, 0, w, h);
// textures must be power of two squared
@ -189,7 +189,7 @@ bool RenderTexture::initWithWidthAndHeight(int w,
descriptor.textureUsage = TextureUsage::RENDER_TARGET;
descriptor.textureFormat = PixelFormat::RGBA8;
_texture2D = new Texture2D();
_texture2D->updateTextureDescriptor(descriptor, !!AX_ENABLE_PREMULTIPLIED_ALPHA);
_texture2D->updateTextureDescriptor(descriptor, !!CC_ENABLE_PREMULTIPLIED_ALPHA);
_renderTargetFlags = RenderTargetFlag::COLOR;
if (PixelFormat::D24S8 == depthStencilFormat)
@ -201,7 +201,7 @@ bool RenderTexture::initWithWidthAndHeight(int w,
_depthStencilTexture->updateTextureDescriptor(descriptor);
}
AX_SAFE_RELEASE(_renderTarget);
CC_SAFE_RELEASE(_renderTarget);
if (sharedRenderTarget)
{
@ -229,7 +229,7 @@ bool RenderTexture::initWithWidthAndHeight(int w,
// retained
setSprite(Sprite::createWithTexture(_texture2D));
#if defined(AX_USE_GL) || defined(AX_USE_GLES)
#if defined(CC_USE_GL) || defined(CC_USE_GLES)
_sprite->setFlippedY(true);
#endif
@ -260,7 +260,7 @@ bool RenderTexture::initWithWidthAndHeight(int w,
void RenderTexture::setSprite(Sprite* sprite)
{
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
@ -269,9 +269,9 @@ void RenderTexture::setSprite(Sprite* sprite)
if (_sprite)
sEngine->releaseScriptObject(this, _sprite);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
AX_SAFE_RETAIN(sprite);
AX_SAFE_RELEASE(_sprite);
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
CC_SAFE_RETAIN(sprite);
CC_SAFE_RELEASE(_sprite);
_sprite = sprite;
}
@ -430,7 +430,7 @@ bool RenderTexture::saveToFileAsNonPMA(std::string_view fileName,
auto renderer = _director->getRenderer();
auto saveToFileCommand = renderer->nextCallbackCommand();
saveToFileCommand->init(_globalZOrder);
saveToFileCommand->func = AX_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, true);
saveToFileCommand->func = CC_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, true);
renderer->addCommand(saveToFileCommand);
return true;
@ -453,7 +453,7 @@ bool RenderTexture::saveToFile(std::string_view fileName,
auto renderer = _director->getRenderer();
auto saveToFileCommand = renderer->nextCallbackCommand();
saveToFileCommand->init(_globalZOrder);
saveToFileCommand->func = AX_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, false);
saveToFileCommand->func = CC_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, false);
_director->getRenderer()->addCommand(saveToFileCommand);
return true;
@ -619,7 +619,7 @@ void RenderTexture::begin()
auto beginCommand = renderer->nextCallbackCommand();
beginCommand->init(_globalZOrder);
beginCommand->func = AX_CALLBACK_0(RenderTexture::onBegin, this);
beginCommand->func = CC_CALLBACK_0(RenderTexture::onBegin, this);
renderer->addCommand(beginCommand);
}
@ -629,7 +629,7 @@ void RenderTexture::end()
auto endCommand = renderer->nextCallbackCommand();
endCommand->init(_globalZOrder);
endCommand->func = AX_CALLBACK_0(RenderTexture::onEnd, this);
endCommand->func = CC_CALLBACK_0(RenderTexture::onEnd, this);
renderer->addCommand(endCommand);
renderer->popGroup();

View File

@ -58,7 +58,7 @@ class EventCustom;
* There are also functions for saving the render texture to disk in PNG or JPG format.
* @since v0.8.1
*/
class AX_DLL RenderTexture : public Node
class CC_DLL RenderTexture : public Node
{
public:
using SaveFileCallbackType = std::function<void(RenderTexture*, std::string_view)>;
@ -430,7 +430,7 @@ protected:
Mat4 _transformMatrix, _projectionMatrix;
private:
AX_DISALLOW_COPY_AND_ASSIGN(RenderTexture);
CC_DISALLOW_COPY_AND_ASSIGN(RenderTexture);
};
// end of textures group

View File

@ -34,16 +34,16 @@ THE SOFTWARE.
#include "base/ccUTF8.h"
#include "renderer/CCRenderer.h"
#if AX_USE_PHYSICS
#if CC_USE_PHYSICS
# include "physics/CCPhysicsWorld.h"
#endif
#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION
#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION
# include "physics3d/CCPhysics3DWorld.h"
# include "physics3d/CCPhysics3DComponent.h"
#endif
#if AX_USE_NAVMESH
#if CC_USE_NAVMESH
# include "navmesh/CCNavMesh.h"
#endif
@ -64,36 +64,36 @@ Scene::Scene()
Scene::~Scene()
{
#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION
AX_SAFE_RELEASE(_physics3DWorld);
AX_SAFE_RELEASE(_physics3dDebugCamera);
#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION
CC_SAFE_RELEASE(_physics3DWorld);
CC_SAFE_RELEASE(_physics3dDebugCamera);
#endif
#if AX_USE_NAVMESH
AX_SAFE_RELEASE(_navMesh);
#if CC_USE_NAVMESH
CC_SAFE_RELEASE(_navMesh);
#endif
_director->getEventDispatcher()->removeEventListener(_event);
AX_SAFE_RELEASE(_event);
CC_SAFE_RELEASE(_event);
#if AX_USE_PHYSICS
#if CC_USE_PHYSICS
delete _physicsWorld;
#endif
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->releaseAllChildrenRecursive(this);
}
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
}
#if AX_USE_NAVMESH
#if CC_USE_NAVMESH
void Scene::setNavMesh(NavMesh* navMesh)
{
if (_navMesh != navMesh)
{
AX_SAFE_RETAIN(navMesh);
AX_SAFE_RELEASE(_navMesh);
CC_SAFE_RETAIN(navMesh);
CC_SAFE_RELEASE(_navMesh);
_navMesh = navMesh;
}
}
@ -131,7 +131,7 @@ Scene* Scene::create()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
}
@ -146,7 +146,7 @@ Scene* Scene::createWithSize(const Vec2& size)
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
}
@ -215,7 +215,7 @@ void Scene::render(Renderer* renderer, const Mat4& eyeTransform, const Mat4* eye
camera->clearBackground();
// visit the scene
visit(renderer, transform, 0);
#if AX_USE_NAVMESH
#if CC_USE_NAVMESH
if (_navMesh && _navMeshDebugCamera == camera)
{
_navMesh->debugDraw(renderer);
@ -231,7 +231,7 @@ void Scene::render(Renderer* renderer, const Mat4& eyeTransform, const Mat4* eye
// camera->setNodeToParentTransform(eyeCopy);
}
#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION
#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION
if (_physics3DWorld && _physics3DWorld->isDebugDrawEnabled())
{
Camera* physics3dDebugCamera = _physics3dDebugCamera != nullptr ? _physics3dDebugCamera : defaultCamera;
@ -272,26 +272,26 @@ void Scene::removeAllChildren()
}
}
#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION
#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION
void Scene::setPhysics3DDebugCamera(Camera* camera)
{
AX_SAFE_RETAIN(camera);
AX_SAFE_RELEASE(_physics3dDebugCamera);
CC_SAFE_RETAIN(camera);
CC_SAFE_RELEASE(_physics3dDebugCamera);
_physics3dDebugCamera = camera;
}
#endif
#if AX_USE_NAVMESH
#if CC_USE_NAVMESH
void Scene::setNavMeshDebugCamera(Camera* camera)
{
AX_SAFE_RETAIN(camera);
AX_SAFE_RELEASE(_navMeshDebugCamera);
CC_SAFE_RETAIN(camera);
CC_SAFE_RELEASE(_navMeshDebugCamera);
_navMeshDebugCamera = camera;
}
#endif
#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION))
#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION))
Scene* Scene::createWithPhysics()
{
@ -303,7 +303,7 @@ Scene* Scene::createWithPhysics()
}
else
{
AX_SAFE_DELETE(ret);
CC_SAFE_DELETE(ret);
return nullptr;
}
}
@ -316,7 +316,7 @@ bool Scene::initWithPhysics()
bool Scene::initPhysicsWorld()
{
# if AX_USE_PHYSICS
# if CC_USE_PHYSICS
_physicsWorld = PhysicsWorld::construct(this);
# endif
@ -325,9 +325,9 @@ bool Scene::initPhysicsWorld()
{
this->setContentSize(_director->getWinSize());
# if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION
# if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION
Physics3DWorldDes info;
AX_BREAK_IF(!(_physics3DWorld = Physics3DWorld::create(&info)));
CC_BREAK_IF(!(_physics3DWorld = Physics3DWorld::create(&info)));
_physics3DWorld->retain();
# endif
@ -339,21 +339,21 @@ bool Scene::initPhysicsWorld()
#endif
#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION) || AX_USE_NAVMESH)
#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION) || CC_USE_NAVMESH)
void Scene::stepPhysicsAndNavigation(float deltaTime)
{
# if AX_USE_PHYSICS
# if CC_USE_PHYSICS
if (_physicsWorld && _physicsWorld->isAutoStep())
_physicsWorld->update(deltaTime);
# endif
# if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION
# if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION
if (_physics3DWorld)
{
_physics3DWorld->stepSimulate(deltaTime);
}
# endif
# if AX_USE_NAVMESH
# if CC_USE_NAVMESH
if (_navMesh)
{
_navMesh->update(deltaTime);

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