Migrate more macors

This commit is contained in:
halx99 2022-07-16 10:43:05 +08:00
parent ac1872494c
commit c16a33e347
1194 changed files with 8707 additions and 8703 deletions

View File

@ -16,7 +16,7 @@
- **Outdated/Abandom/Cocos2d-x**:
- class PhysicsSprite: Be only part of the axis for backwards compatibility with Cocos2d-x.
Use CC_ENABLE_BOX2D_INTEGRATION 1 (using Box2D) or CC_ENABLE_CHIPMUNK_INTEGRATION 1 (using Chipmunk2D)
Use AX_ENABLE_BOX2D_INTEGRATION 1 (using Box2D) or AX_ENABLE_CHIPMUNK_INTEGRATION 1 (using Chipmunk2D)
## Chipmunk2D-/Box2D - Testbeds:
The goals where:

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 CC_DEPEND_DLLS)
PROPERTY AX_DEPEND_DLLS)
if(pre_dlls)
set(_dlls ${pre_dlls} ${_dlls})
endif()
set_property(TARGET ${target}
PROPERTY
CC_DEPEND_DLLS ${_dlls}
AX_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 CC_LUA_DEPEND
PROPERTY AX_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 CC_STATIC)
target_compile_definitions(${target} PUBLIC AX_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 CC_STATIC=1
PRIVATE AX_STATIC=1
)
endif()

View File

@ -41,7 +41,7 @@ Action::Action() : _originalTarget(nullptr), _target(nullptr), _tag(Action::INVA
Action::~Action()
{
CCLOGINFO("deallocing Action: %p - tag: %i", this, _tag);
AXLOGINFO("deallocing Action: %p - tag: %i", this, _tag);
}
std::string Action::description() const
@ -66,12 +66,12 @@ bool Action::isDone() const
void Action::step(float /*dt*/)
{
CCLOG("[Action step]. override me");
AXLOG("[Action step]. override me");
}
void Action::update(float /*time*/)
{
CCLOG("[Action update]. override me");
AXLOG("[Action update]. override me");
}
//
@ -81,7 +81,7 @@ Speed::Speed() : _speed(0.0), _innerAction(nullptr) {}
Speed::~Speed()
{
CC_SAFE_RELEASE(_innerAction);
AX_SAFE_RELEASE(_innerAction);
}
Speed* Speed::create(ActionInterval* action, float speed)
@ -92,13 +92,13 @@ Speed* Speed::create(ActionInterval* action, float speed)
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
bool Speed::initWithAction(ActionInterval* action, float speed)
{
CCASSERT(action != nullptr, "action must not be NULL");
AXASSERT(action != nullptr, "action must not be NULL");
if (action == nullptr)
{
log("Speed::initWithAction error: action is nullptr!");
@ -161,9 +161,9 @@ void Speed::setInnerAction(ActionInterval* action)
{
if (_innerAction != action)
{
CC_SAFE_RELEASE(_innerAction);
AX_SAFE_RELEASE(_innerAction);
_innerAction = action;
CC_SAFE_RETAIN(_innerAction);
AX_SAFE_RETAIN(_innerAction);
}
}
@ -172,7 +172,7 @@ void Speed::setInnerAction(ActionInterval* action)
//
Follow::~Follow()
{
CC_SAFE_RELEASE(_followedNode);
AX_SAFE_RELEASE(_followedNode);
}
Follow* Follow::create(Node* followedNode, const Rect& rect /* = Rect::ZERO*/)
@ -209,7 +209,7 @@ Follow* Follow::reverse() const
bool Follow::initWithTargetAndOffset(Node* followedNode, float xOffset, float yOffset, const Rect& rect)
{
CCASSERT(followedNode != nullptr, "FollowedNode can't be NULL");
AXASSERT(followedNode != nullptr, "FollowedNode can't be NULL");
if (followedNode == nullptr)
{
log("Follow::initWithTarget error: followedNode is nullptr!");

View File

@ -50,7 +50,7 @@ enum
/**
* @brief Base class for Action objects.
*/
class CC_DLL Action : public Ref, public Clonable
class AX_DLL Action : public Ref, public Clonable
{
public:
/** Default tag used for all the actions. */
@ -67,7 +67,7 @@ public:
*/
virtual Action* clone() const
{
CC_ASSERT(0);
AX_ASSERT(0);
return nullptr;
}
@ -78,7 +78,7 @@ public:
*/
virtual Action* reverse() const
{
CC_ASSERT(0);
AX_ASSERT(0);
return nullptr;
}
@ -180,7 +180,7 @@ protected:
unsigned int _flags;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Action);
AX_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 CC_DLL FiniteTimeAction : public Action
class AX_DLL FiniteTimeAction : public Action
{
public:
/** Get duration in seconds of the action.
@ -210,12 +210,12 @@ public:
//
virtual FiniteTimeAction* reverse() const override
{
CC_ASSERT(0);
AX_ASSERT(0);
return nullptr;
}
virtual FiniteTimeAction* clone() const override
{
CC_ASSERT(0);
AX_ASSERT(0);
return nullptr;
}
@ -227,7 +227,7 @@ protected:
float _duration;
private:
CC_DISALLOW_COPY_AND_ASSIGN(FiniteTimeAction);
AX_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 CC_DLL Speed : public Action
class AX_DLL Speed : public Action
{
public:
/** Create the action and set the speed.
@ -297,7 +297,7 @@ protected:
ActionInterval* _innerAction;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Speed);
AX_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 CC_DLL Follow : public Action
class AX_DLL Follow : public Action
{
public:
/**
@ -439,7 +439,7 @@ protected:
Rect _worldRect;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Follow);
AX_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)CC_DEGREES_TO_RADIANS(deltaAngleZ);
_radDeltaX = (float)CC_DEGREES_TO_RADIANS(deltaAngleX);
_radDeltaZ = (float)AX_DEGREES_TO_RADIANS(deltaAngleZ);
_radDeltaX = (float)AX_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)CC_RADIANS_TO_DEGREES(zenith);
_angleZ = (float)AX_RADIANS_TO_DEGREES(zenith);
if (std::isnan(_angleX))
_angleX = (float)CC_RADIANS_TO_DEGREES(azimuth);
_angleX = (float)AX_RADIANS_TO_DEGREES(azimuth);
_radZ = (float)CC_DEGREES_TO_RADIANS(_angleZ);
_radX = (float)CC_DEGREES_TO_RADIANS(_angleX);
_radZ = (float)AX_DEGREES_TO_RADIANS(_angleZ);
_radX = (float)AX_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 CC_DLL ActionCamera : public ActionInterval
class AX_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 CC_DLL OrbitCamera : public ActionCamera
class AX_DLL OrbitCamera : public ActionCamera
{
public:
/** Creates a OrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX.

View File

@ -79,7 +79,7 @@ PointArray* PointArray::clone() const
PointArray::~PointArray()
{
CCLOGINFO("deallocing PointArray: %p", this);
AXLOGINFO("deallocing PointArray: %p", this);
}
PointArray::PointArray() {}
@ -197,7 +197,7 @@ CardinalSplineTo* CardinalSplineTo::create(float duration, PointArray* points, f
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
@ -205,7 +205,7 @@ CardinalSplineTo* CardinalSplineTo::create(float duration, PointArray* points, f
bool CardinalSplineTo::initWithDuration(float duration, PointArray* points, float tension)
{
CCASSERT(points->count() > 0, "Invalid configuration. It must at least have one control point");
AXASSERT(points->count() > 0, "Invalid configuration. It must at least have one control point");
if (ActionInterval::initWithDuration(duration))
{
@ -220,7 +220,7 @@ bool CardinalSplineTo::initWithDuration(float duration, PointArray* points, floa
CardinalSplineTo::~CardinalSplineTo()
{
CC_SAFE_RELEASE_NULL(_points);
AX_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 CC_ENABLE_STACKABLE_ACTIONS
#if AX_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
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
@ -398,7 +398,7 @@ CatmullRomTo* CatmullRomTo::create(float dt, PointArray* points)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
@ -441,7 +441,7 @@ CatmullRomBy* CatmullRomBy::create(float dt, PointArray* points)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}

View File

@ -55,7 +55,7 @@ class Node;
* @ingroup Actions
* @js NA
*/
class CC_DLL PointArray : public Ref, public Clonable
class AX_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 CC_DLL CardinalSplineTo : public ActionInterval
class AX_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)
{
CC_SAFE_RETAIN(points);
CC_SAFE_RELEASE(_points);
AX_SAFE_RETAIN(points);
AX_SAFE_RELEASE(_points);
_points = points;
}
@ -241,7 +241,7 @@ protected:
* http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline
* @ingroup Actions
*/
class CC_DLL CardinalSplineBy : public CardinalSplineTo
class AX_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 CC_DLL CatmullRomTo : public CardinalSplineTo
class AX_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 CC_DLL CatmullRomBy : public CardinalSplineBy
class AX_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 CC_DLL Vec2
extern AX_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

@ -47,7 +47,7 @@ NS_AX_BEGIN
bool ActionEase::initWithAction(ActionInterval* action)
{
CCASSERT(action != nullptr, "action couldn't be nullptr!");
AXASSERT(action != nullptr, "action couldn't be nullptr!");
if (action == nullptr)
{
return false;
@ -66,7 +66,7 @@ bool ActionEase::initWithAction(ActionInterval* action)
ActionEase::~ActionEase()
{
CC_SAFE_RELEASE(_inner);
AX_SAFE_RELEASE(_inner);
}
void ActionEase::startWithTarget(Node* target)
@ -106,7 +106,7 @@ ActionInterval* ActionEase::getInnerAction()
EaseRateAction* EaseRateAction::create(ActionInterval* action, float rate)
{
CCASSERT(action != nullptr, "action cannot be nullptr!");
AXASSERT(action != nullptr, "action cannot be nullptr!");
EaseRateAction* easeRateAction = new EaseRateAction();
if (easeRateAction->initWithAction(action, rate))
@ -115,7 +115,7 @@ EaseRateAction* EaseRateAction::create(ActionInterval* action, float rate)
return easeRateAction;
}
CC_SAFE_DELETE(easeRateAction);
AX_SAFE_DELETE(easeRateAction);
return nullptr;
}
@ -141,7 +141,7 @@ bool EaseRateAction::initWithAction(ActionInterval* action, float rate)
if (ease->initWithAction(action)) \
ease->autorelease(); \
else \
CC_SAFE_DELETE(ease); \
AX_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 \
CC_SAFE_DELETE(ease); \
AX_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 \
CC_SAFE_DELETE(ease); \
AX_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 CC_DLL ActionEase : public ActionInterval
class AX_DLL ActionEase : public ActionInterval
{
public:
/**
@ -75,7 +75,7 @@ protected:
ActionInterval* _inner;
private:
CC_DISALLOW_COPY_AND_ASSIGN(ActionEase);
AX_DISALLOW_COPY_AND_ASSIGN(ActionEase);
};
/**
@ -84,7 +84,7 @@ private:
@details Ease the inner action with specified rate.
@ingroup Actions
*/
class CC_DLL EaseRateAction : public ActionEase
class AX_DLL EaseRateAction : public ActionEase
{
public:
static EaseRateAction* create(ActionInterval* action, float rate);
@ -113,7 +113,7 @@ protected:
float _rate;
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseRateAction);
AX_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 CC_DLL CLASSNAME : public ActionEase \
class AX_DLL CLASSNAME : public ActionEase \
{ \
public: \
virtual ~CLASSNAME() {} \
@ -134,7 +134,7 @@ private:
virtual ActionEase* reverse() const override; \
\
private: \
CC_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \
AX_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \
};
/**
@ -199,7 +199,7 @@ EASE_TEMPLATE_DECL_CLASS(EaseSineInOut);
@since v0.8.2
@ingroup Actions
*/
class CC_DLL EaseBounce : public ActionEase
class AX_DLL EaseBounce : public ActionEase
{};
/**
@ -373,7 +373,7 @@ EASE_TEMPLATE_DECL_CLASS(EaseCubicActionInOut);
//
#define EASERATE_TEMPLATE_DECL_CLASS(CLASSNAME) \
class CC_DLL CLASSNAME : public EaseRateAction \
class AX_DLL CLASSNAME : public EaseRateAction \
{ \
public: \
virtual ~CLASSNAME() {} \
@ -385,7 +385,7 @@ EASE_TEMPLATE_DECL_CLASS(EaseCubicActionInOut);
virtual EaseRateAction* reverse() const override; \
\
private: \
CC_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \
AX_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \
};
/**
@ -423,7 +423,7 @@ EASERATE_TEMPLATE_DECL_CLASS(EaseInOut);
@since v0.8.2
@ingroup Actions
*/
class CC_DLL EaseElastic : public ActionEase
class AX_DLL EaseElastic : public ActionEase
{
public:
/**
@ -451,7 +451,7 @@ protected:
float _period;
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseElastic);
AX_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 CC_DLL CLASSNAME : public EaseElastic \
class AX_DLL CLASSNAME : public EaseElastic \
{ \
public: \
virtual ~CLASSNAME() {} \
@ -471,7 +471,7 @@ private:
virtual EaseElastic* reverse() const override; \
\
private: \
CC_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \
AX_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \
};
/**
@ -516,7 +516,7 @@ EASEELASTIC_TEMPLATE_DECL_CLASS(EaseElasticInOut);
@brief Ease Bezier
@ingroup Actions
*/
class CC_DLL EaseBezierAction : public axis::ActionEase
class AX_DLL EaseBezierAction : public axis::ActionEase
{
public:
/**
@ -545,7 +545,7 @@ protected:
float _p3;
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseBezierAction);
AX_DISALLOW_COPY_AND_ASSIGN(EaseBezierAction);
};
// end of actions group

View File

@ -62,7 +62,7 @@ void GridAction::startWithTarget(Node* target)
}
else
{
CCASSERT(0, "Invalid grid parameters!");
AXASSERT(0, "Invalid grid parameters!");
}
}
else
@ -81,7 +81,7 @@ void GridAction::startWithTarget(Node* target)
void GridAction::cacheTargetAsGridNode()
{
_gridNodeTarget = dynamic_cast<NodeGrid*>(_target);
CCASSERT(_gridNodeTarget, "GridActions can only used on NodeGrid");
AXASSERT(_gridNodeTarget, "GridActions can only used on NodeGrid");
}
GridAction* GridAction::reverse() const
@ -93,7 +93,7 @@ GridAction* GridAction::reverse() const
GridBase* GridAction::getGrid()
{
// Abstract class needs implementation
CCASSERT(0, "Subclass should implement this method!");
AXASSERT(0, "Subclass should implement this method!");
return nullptr;
}
@ -206,7 +206,7 @@ AccelDeccelAmplitude* AccelDeccelAmplitude::clone() const
AccelDeccelAmplitude::~AccelDeccelAmplitude()
{
CC_SAFE_RELEASE(_other);
AX_SAFE_RELEASE(_other);
}
void AccelDeccelAmplitude::startWithTarget(Node* target)
@ -276,7 +276,7 @@ AccelAmplitude* AccelAmplitude::clone() const
AccelAmplitude::~AccelAmplitude()
{
CC_SAFE_DELETE(_other);
AX_SAFE_DELETE(_other);
}
void AccelAmplitude::startWithTarget(Node* target)
@ -330,7 +330,7 @@ bool DeccelAmplitude::initWithAction(Action* action, float duration)
DeccelAmplitude::~DeccelAmplitude()
{
CC_SAFE_RELEASE(_other);
AX_SAFE_RELEASE(_other);
}
void DeccelAmplitude::startWithTarget(Node* target)
@ -375,7 +375,7 @@ void StopGrid::startWithTarget(Node* target)
void StopGrid::cacheTargetAsGridNode()
{
_gridNodeTarget = dynamic_cast<NodeGrid*>(_target);
CCASSERT(_gridNodeTarget, "GridActions can only used on NodeGrid");
AXASSERT(_gridNodeTarget, "GridActions can only used on NodeGrid");
}
StopGrid* StopGrid::create()
@ -432,7 +432,7 @@ void ReuseGrid::startWithTarget(Node* target)
void ReuseGrid::cacheTargetAsGridNode()
{
_gridNodeTarget = dynamic_cast<NodeGrid*>(_target);
CCASSERT(_gridNodeTarget, "GridActions can only used on NodeGrid");
AXASSERT(_gridNodeTarget, "GridActions can only used on NodeGrid");
}
ReuseGrid* ReuseGrid::clone() const

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

View File

@ -74,7 +74,7 @@ void Waves3D::update(float time)
Vec2 pos((float)i, (float)j);
Vec3 v = getOriginalVertex(pos);
v.z += (sinf((float)M_PI * time * _waves * 2 + (v.y + v.x) * 0.01f) * _amplitude * _amplitudeRate);
// CCLOG("v.z offset is %f\n", (sinf((float)M_PI * time * _waves * 2 + (v.y+v.x) * .01f) * _amplitude *
// AXLOG("v.z offset is %f\n", (sinf((float)M_PI * time * _waves * 2 + (v.y+v.x) * .01f) * _amplitude *
// _amplitudeRate));
setVertex(pos, v);
}
@ -107,7 +107,7 @@ bool FlipX3D::initWithSize(const Vec2& gridSize, float duration)
if (gridSize.width != 1 || gridSize.height != 1)
{
// Grid size must be (1,1)
CCASSERT(0, "Grid size must be (1,1)");
AXASSERT(0, "Grid size must be (1,1)");
return false;
}
@ -209,7 +209,7 @@ FlipY3D* FlipY3D::create(float duration)
}
else
{
CC_SAFE_DELETE(action);
AX_SAFE_DELETE(action);
}
return action;
@ -291,7 +291,7 @@ Lens3D* Lens3D::create(float duration, const Vec2& gridSize, const Vec2& positio
}
else
{
CC_SAFE_DELETE(action);
AX_SAFE_DELETE(action);
}
return action;
@ -392,7 +392,7 @@ Ripple3D* Ripple3D::create(float duration,
}
else
{
CC_SAFE_DELETE(action);
AX_SAFE_DELETE(action);
}
return action;
@ -470,7 +470,7 @@ Shaky3D* Shaky3D::create(float duration, const Vec2& gridSize, int range, bool s
}
else
{
CC_SAFE_DELETE(action);
AX_SAFE_DELETE(action);
}
return action;
}
@ -531,7 +531,7 @@ Liquid* Liquid::create(float duration, const Vec2& gridSize, unsigned int waves,
}
else
{
CC_SAFE_DELETE(action);
AX_SAFE_DELETE(action);
}
return action;
@ -594,7 +594,7 @@ Waves* Waves::create(float duration,
}
else
{
CC_SAFE_DELETE(action);
AX_SAFE_DELETE(action);
}
return action;
@ -668,7 +668,7 @@ Twirl* Twirl::create(float duration, const Vec2& gridSize, const Vec2& position,
}
else
{
CC_SAFE_DELETE(action);
AX_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 CC_DLL Waves3D : public Grid3DAction
class AX_DLL Waves3D : public Grid3DAction
{
public:
/**
@ -100,14 +100,14 @@ protected:
float _amplitudeRate;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Waves3D);
AX_DISALLOW_COPY_AND_ASSIGN(Waves3D);
};
/**
@brief FlipX3D action.
@details This action is used for flipping the target node on the x axis.
*/
class CC_DLL FlipX3D : public Grid3DAction
class AX_DLL FlipX3D : public Grid3DAction
{
public:
/**
@ -140,14 +140,14 @@ public:
virtual bool initWithSize(const Vec2& gridSize, float duration);
private:
CC_DISALLOW_COPY_AND_ASSIGN(FlipX3D);
AX_DISALLOW_COPY_AND_ASSIGN(FlipX3D);
};
/**
@brief FlipY3D action.
@details This action is used for flipping the target node on the y axis.
*/
class CC_DLL FlipY3D : public FlipX3D
class AX_DLL FlipY3D : public FlipX3D
{
public:
/**
@ -165,7 +165,7 @@ public:
virtual ~FlipY3D() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(FlipY3D);
AX_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 CC_DLL Lens3D : public Grid3DAction
class AX_DLL Lens3D : public Grid3DAction
{
public:
/**
@ -247,7 +247,7 @@ protected:
bool _dirty;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Lens3D);
AX_DISALLOW_COPY_AND_ASSIGN(Lens3D);
};
/**
@ -257,7 +257,7 @@ private:
duration, grid size, center position of ripple,
radius of ripple, waves count, amplitude.
*/
class CC_DLL Ripple3D : public Grid3DAction
class AX_DLL Ripple3D : public Grid3DAction
{
public:
/**
@ -343,7 +343,7 @@ protected:
float _amplitudeRate;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Ripple3D);
AX_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 CC_DLL Shaky3D : public Grid3DAction
class AX_DLL Shaky3D : public Grid3DAction
{
public:
/**
@ -387,7 +387,7 @@ protected:
bool _shakeZ;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Shaky3D);
AX_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 CC_DLL Liquid : public Grid3DAction
class AX_DLL Liquid : public Grid3DAction
{
public:
/**
@ -454,7 +454,7 @@ protected:
float _amplitudeRate;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Liquid);
AX_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 CC_DLL Waves : public Grid3DAction
class AX_DLL Waves : public Grid3DAction
{
public:
/**
@ -538,7 +538,7 @@ protected:
bool _horizontal;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Waves);
AX_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 CC_DLL Twirl : public Grid3DAction
class AX_DLL Twirl : public Grid3DAction
{
public:
/**
@ -628,7 +628,7 @@ protected:
float _amplitudeRate;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Twirl);
AX_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
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return ret;
}
@ -192,7 +192,7 @@ FlipX* FlipX::create(bool x)
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
@ -232,7 +232,7 @@ FlipY* FlipY::create(bool y)
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
@ -315,7 +315,7 @@ CallFunc* CallFunc::create(const std::function<void()>& func)
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
@ -370,7 +370,7 @@ CallFuncN* CallFuncN::create(const std::function<void(Node*)>& func)
return ret;
}
CC_SAFE_DELETE(ret);
AX_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 CC_DLL ActionInstant : public FiniteTimeAction
class AX_DLL ActionInstant : public FiniteTimeAction
{
public:
//
@ -50,13 +50,13 @@ public:
//
virtual ActionInstant* clone() const override
{
CC_ASSERT(0);
AX_ASSERT(0);
return nullptr;
}
virtual ActionInstant* reverse() const override
{
CC_ASSERT(0);
AX_ASSERT(0);
return nullptr;
}
@ -79,7 +79,7 @@ private:
/** @class Show
* @brief Show the node.
**/
class CC_DLL Show : public ActionInstant
class AX_DLL Show : public ActionInstant
{
public:
/** Allocates and initializes the action.
@ -102,13 +102,13 @@ public:
virtual ~Show() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(Show);
AX_DISALLOW_COPY_AND_ASSIGN(Show);
};
/** @class Hide
* @brief Hide the node.
*/
class CC_DLL Hide : public ActionInstant
class AX_DLL Hide : public ActionInstant
{
public:
/** Allocates and initializes the action.
@ -131,13 +131,13 @@ public:
virtual ~Hide() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(Hide);
AX_DISALLOW_COPY_AND_ASSIGN(Hide);
};
/** @class ToggleVisibility
* @brief Toggles the visibility of a node.
*/
class CC_DLL ToggleVisibility : public ActionInstant
class AX_DLL ToggleVisibility : public ActionInstant
{
public:
/** Allocates and initializes the action.
@ -160,13 +160,13 @@ public:
virtual ~ToggleVisibility() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(ToggleVisibility);
AX_DISALLOW_COPY_AND_ASSIGN(ToggleVisibility);
};
/** @class RemoveSelf
* @brief Remove the node.
*/
class CC_DLL RemoveSelf : public ActionInstant
class AX_DLL RemoveSelf : public ActionInstant
{
public:
/** Create the action.
@ -196,14 +196,14 @@ protected:
bool _isNeedCleanUp;
private:
CC_DISALLOW_COPY_AND_ASSIGN(RemoveSelf);
AX_DISALLOW_COPY_AND_ASSIGN(RemoveSelf);
};
/** @class FlipX
* @brief Flips the sprite horizontally.
* @since v0.99.0
*/
class CC_DLL FlipX : public ActionInstant
class AX_DLL FlipX : public ActionInstant
{
public:
/** Create the action.
@ -233,14 +233,14 @@ protected:
bool _flipX;
private:
CC_DISALLOW_COPY_AND_ASSIGN(FlipX);
AX_DISALLOW_COPY_AND_ASSIGN(FlipX);
};
/** @class FlipY
* @brief Flips the sprite vertically.
* @since v0.99.0
*/
class CC_DLL FlipY : public ActionInstant
class AX_DLL FlipY : public ActionInstant
{
public:
/** Create the action.
@ -270,13 +270,13 @@ protected:
bool _flipY;
private:
CC_DISALLOW_COPY_AND_ASSIGN(FlipY);
AX_DISALLOW_COPY_AND_ASSIGN(FlipY);
};
/** @class Place
* @brief Places the node in a certain position.
*/
class CC_DLL Place : public ActionInstant
class AX_DLL Place : public ActionInstant
{
public:
/** Creates a Place action with a position.
@ -306,13 +306,13 @@ protected:
Vec2 _position;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Place);
AX_DISALLOW_COPY_AND_ASSIGN(Place);
};
/** @class CallFunc
* @brief Calls a 'callback'.
*/
class CC_DLL CallFunc : public ActionInstant
class AX_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:
CC_DISALLOW_COPY_AND_ASSIGN(CallFunc);
AX_DISALLOW_COPY_AND_ASSIGN(CallFunc);
};
/** @class CallFuncN
* @brief Calls a 'callback' with the node as the first argument. N means Node.
* @js NA
*/
class CC_DLL CallFuncN : public CallFunc
class AX_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:
CC_DISALLOW_COPY_AND_ASSIGN(CallFuncN);
AX_DISALLOW_COPY_AND_ASSIGN(CallFuncN);
};
// end of actions group

View File

@ -126,13 +126,13 @@ void ActionInterval::step(float dt)
void ActionInterval::setAmplitudeRate(float /*amp*/)
{
// Abstract class needs implementation
CCASSERT(0, "Subclass should implement this method!");
AXASSERT(0, "Subclass should implement this method!");
}
float ActionInterval::getAmplitudeRate()
{
// Abstract class needs implementation
CCASSERT(0, "Subclass should implement this method!");
AXASSERT(0, "Subclass should implement this method!");
return 0;
}
@ -237,8 +237,8 @@ bool Sequence::init(const Vector<FiniteTimeAction*>& arrayOfActions)
bool Sequence::initWithTwoActions(FiniteTimeAction* actionOne, FiniteTimeAction* actionTwo)
{
CCASSERT(actionOne != nullptr, "actionOne can't be nullptr!");
CCASSERT(actionTwo != nullptr, "actionTwo can't be nullptr!");
AXASSERT(actionOne != nullptr, "actionOne can't be nullptr!");
AXASSERT(actionTwo != nullptr, "actionTwo can't be nullptr!");
if (actionOne == nullptr || actionTwo == nullptr)
{
log("Sequence::initWithTwoActions error: action is nullptr!!");
@ -287,8 +287,8 @@ Sequence::Sequence() : _split(0)
Sequence::~Sequence()
{
CC_SAFE_RELEASE(_actions[0]);
CC_SAFE_RELEASE(_actions[1]);
AX_SAFE_RELEASE(_actions[0]);
AX_SAFE_RELEASE(_actions[1]);
}
void Sequence::startWithTarget(Node* target)
@ -448,7 +448,7 @@ Repeat* Repeat::clone() const
Repeat::~Repeat()
{
CC_SAFE_RELEASE(_innerAction);
AX_SAFE_RELEASE(_innerAction);
}
void Repeat::startWithTarget(Node* target)
@ -531,7 +531,7 @@ Repeat* Repeat::reverse() const
//
RepeatForever::~RepeatForever()
{
CC_SAFE_RELEASE(_innerAction);
AX_SAFE_RELEASE(_innerAction);
}
RepeatForever* RepeatForever::create(ActionInterval* action)
@ -549,7 +549,7 @@ RepeatForever* RepeatForever::create(ActionInterval* action)
bool RepeatForever::initWithAction(ActionInterval* action)
{
CCASSERT(action != nullptr, "action can't be nullptr!");
AXASSERT(action != nullptr, "action can't be nullptr!");
if (action == nullptr)
{
log("RepeatForever::initWithAction error:action is nullptr!");
@ -693,8 +693,8 @@ bool Spawn::init(const Vector<FiniteTimeAction*>& arrayOfActions)
bool Spawn::initWithTwoActions(FiniteTimeAction* action1, FiniteTimeAction* action2)
{
CCASSERT(action1 != nullptr, "action1 can't be nullptr!");
CCASSERT(action2 != nullptr, "action2 can't be nullptr!");
AXASSERT(action1 != nullptr, "action1 can't be nullptr!");
AXASSERT(action2 != nullptr, "action2 can't be nullptr!");
if (action1 == nullptr || action2 == nullptr)
{
log("Spawn::initWithTwoActions error: action is nullptr!");
@ -742,8 +742,8 @@ Spawn::Spawn() : _one(nullptr), _two(nullptr) {}
Spawn::~Spawn()
{
CC_SAFE_RELEASE(_one);
CC_SAFE_RELEASE(_two);
AX_SAFE_RELEASE(_one);
AX_SAFE_RELEASE(_two);
}
void Spawn::startWithTarget(Node* target)
@ -932,7 +932,7 @@ void RotateTo::update(float time)
}
else
{
#if CC_USE_PHYSICS
#if AX_USE_PHYSICS
if (_startAngle.x == _startAngle.y && _diffAngle.x == _diffAngle.y)
{
_target->setRotation(_startAngle.x + _diffAngle.x * time);
@ -945,14 +945,14 @@ void RotateTo::update(float time)
#else
_target->setRotationSkewX(_startAngle.x + _diffAngle.x * time);
_target->setRotationSkewY(_startAngle.y + _diffAngle.y * time);
#endif // CC_USE_PHYSICS
#endif // AX_USE_PHYSICS
}
}
}
RotateTo* RotateTo::reverse() const
{
CCASSERT(false, "RotateTo doesn't support the 'reverse' method");
AXASSERT(false, "RotateTo doesn't support the 'reverse' method");
return nullptr;
}
@ -1077,7 +1077,7 @@ void RotateBy::update(float time)
}
else
{
#if CC_USE_PHYSICS
#if AX_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 // CC_USE_PHYSICS
#endif // AX_USE_PHYSICS
}
}
}
@ -1174,7 +1174,7 @@ void MoveBy::update(float t)
{
if (_target)
{
#if CC_ENABLE_STACKABLE_ACTIONS
#if AX_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 // CC_ENABLE_STACKABLE_ACTIONS
#endif // AX_ENABLE_STACKABLE_ACTIONS
}
}
@ -1242,7 +1242,7 @@ void MoveTo::startWithTarget(Node* target)
MoveTo* MoveTo::reverse() const
{
CCASSERT(false, "reverse() not supported in MoveTo");
AXASSERT(false, "reverse() not supported in MoveTo");
return nullptr;
}
@ -1285,7 +1285,7 @@ SkewTo* SkewTo::clone() const
SkewTo* SkewTo::reverse() const
{
CCASSERT(false, "reverse() not supported in SkewTo");
AXASSERT(false, "reverse() not supported in SkewTo");
return nullptr;
}
@ -1542,7 +1542,7 @@ JumpBy* JumpBy::create(float duration, const Vec2& position, float height, int j
bool JumpBy::initWithDuration(float duration, const Vec2& position, float height, int jumps)
{
CCASSERT(jumps >= 0, "Number of jumps must be >= 0");
AXASSERT(jumps >= 0, "Number of jumps must be >= 0");
if (jumps < 0)
{
log("JumpBy::initWithDuration error: Number of jumps must be >= 0");
@ -1583,7 +1583,7 @@ void JumpBy::update(float t)
y += _delta.y * t;
float x = _delta.x * t;
#if CC_ENABLE_STACKABLE_ACTIONS
#if AX_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 // !CC_ENABLE_STACKABLE_ACTIONS
#endif // !AX_ENABLE_STACKABLE_ACTIONS
}
}
@ -1623,7 +1623,7 @@ JumpTo* JumpTo::create(float duration, const Vec2& position, float height, int j
bool JumpTo::initWithDuration(float duration, const Vec2& position, float height, int jumps)
{
CCASSERT(jumps >= 0, "Number of jumps must be >= 0");
AXASSERT(jumps >= 0, "Number of jumps must be >= 0");
if (jumps < 0)
{
log("JumpTo::initWithDuration error:Number of jumps must be >= 0");
@ -1650,7 +1650,7 @@ JumpTo* JumpTo::clone() const
JumpTo* JumpTo::reverse() const
{
CCASSERT(false, "reverse() not supported in JumpTo");
AXASSERT(false, "reverse() not supported in JumpTo");
return nullptr;
}
@ -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 CC_ENABLE_STACKABLE_ACTIONS
#if AX_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 // !CC_ENABLE_STACKABLE_ACTIONS
#endif // !AX_ENABLE_STACKABLE_ACTIONS
}
}
@ -1797,7 +1797,7 @@ void BezierTo::startWithTarget(Node* target)
BezierTo* BezierTo::reverse() const
{
CCASSERT(false, "CCBezierTo doesn't support the 'reverse' method");
AXASSERT(false, "CCBezierTo doesn't support the 'reverse' method");
return nullptr;
}
@ -1893,7 +1893,7 @@ ScaleTo* ScaleTo::clone() const
ScaleTo* ScaleTo::reverse() const
{
CCASSERT(false, "reverse() not supported in ScaleTo");
AXASSERT(false, "reverse() not supported in ScaleTo");
return nullptr;
}
@ -1999,7 +1999,7 @@ Blink* Blink::create(float duration, int blinks)
bool Blink::initWithDuration(float duration, int blinks)
{
CCASSERT(blinks >= 0, "blinks should be >= 0");
AXASSERT(blinks >= 0, "blinks should be >= 0");
if (blinks < 0)
{
log("Blink::initWithDuration error:blinks should be >= 0");
@ -2181,7 +2181,7 @@ FadeTo* FadeTo::clone() const
FadeTo* FadeTo::reverse() const
{
CCASSERT(false, "reverse() not supported in FadeTo");
AXASSERT(false, "reverse() not supported in FadeTo");
return nullptr;
}
@ -2243,7 +2243,7 @@ TintTo* TintTo::clone() const
TintTo* TintTo::reverse() const
{
CCASSERT(false, "reverse() not supported in TintTo");
AXASSERT(false, "reverse() not supported in TintTo");
return nullptr;
}
@ -2382,8 +2382,8 @@ ReverseTime* ReverseTime::create(FiniteTimeAction* action)
bool ReverseTime::initWithAction(FiniteTimeAction* action)
{
CCASSERT(action != nullptr, "action can't be nullptr!");
CCASSERT(action != _other, "action doesn't equal to _other!");
AXASSERT(action != nullptr, "action can't be nullptr!");
AXASSERT(action != _other, "action doesn't equal to _other!");
if (action == nullptr || action == _other)
{
log("ReverseTime::initWithAction error: action is null or action equal to _other");
@ -2393,7 +2393,7 @@ bool ReverseTime::initWithAction(FiniteTimeAction* action)
if (ActionInterval::initWithDuration(action->getDuration()))
{
// Don't leak if action is reused
CC_SAFE_RELEASE(_other);
AX_SAFE_RELEASE(_other);
_other = action;
action->retain();
@ -2414,7 +2414,7 @@ ReverseTime::ReverseTime() : _other(nullptr) {}
ReverseTime::~ReverseTime()
{
CC_SAFE_RELEASE(_other);
AX_SAFE_RELEASE(_other);
}
void ReverseTime::startWithTarget(Node* target)
@ -2464,15 +2464,15 @@ Animate::Animate() {}
Animate::~Animate()
{
CC_SAFE_RELEASE(_animation);
CC_SAFE_RELEASE(_origFrame);
CC_SAFE_DELETE(_splitTimes);
CC_SAFE_RELEASE(_frameDisplayedEvent);
AX_SAFE_RELEASE(_animation);
AX_SAFE_RELEASE(_origFrame);
AX_SAFE_DELETE(_splitTimes);
AX_SAFE_RELEASE(_frameDisplayedEvent);
}
bool Animate::initWithAnimation(Animation* animation)
{
CCASSERT(animation != nullptr, "Animate: argument Animation must be non-nullptr");
AXASSERT(animation != nullptr, "Animate: argument Animation must be non-nullptr");
if (animation == nullptr)
{
log("Animate::initWithAnimation: argument Animation must be non-nullptr");
@ -2510,8 +2510,8 @@ void Animate::setAnimation(axis::Animation* animation)
{
if (_animation != animation)
{
CC_SAFE_RETAIN(animation);
CC_SAFE_RELEASE(_animation);
AX_SAFE_RETAIN(animation);
AX_SAFE_RELEASE(_animation);
_animation = animation;
}
}
@ -2527,7 +2527,7 @@ void Animate::startWithTarget(Node* target)
ActionInterval::startWithTarget(target);
Sprite* sprite = static_cast<Sprite*>(target);
CC_SAFE_RELEASE(_origFrame);
AX_SAFE_RELEASE(_origFrame);
if (_animation->getRestoreOriginalFrame())
{
@ -2637,8 +2637,8 @@ TargetedAction::TargetedAction() : _action(nullptr), _forcedTarget(nullptr) {}
TargetedAction::~TargetedAction()
{
CC_SAFE_RELEASE(_forcedTarget);
CC_SAFE_RELEASE(_action);
AX_SAFE_RELEASE(_forcedTarget);
AX_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()))
{
CC_SAFE_RETAIN(target);
AX_SAFE_RETAIN(target);
_forcedTarget = target;
CC_SAFE_RETAIN(action);
AX_SAFE_RETAIN(action);
_action = action;
return true;
}
@ -2704,8 +2704,8 @@ void TargetedAction::setForcedTarget(Node* forcedTarget)
{
if (_forcedTarget != forcedTarget)
{
CC_SAFE_RETAIN(forcedTarget);
CC_SAFE_RELEASE(_forcedTarget);
AX_SAFE_RETAIN(forcedTarget);
AX_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 CC_DLL ActionInterval : public FiniteTimeAction
class AX_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
{
CC_ASSERT(0);
AX_ASSERT(0);
return nullptr;
}
virtual ActionInterval* clone() const override
{
CC_ASSERT(0);
AX_ASSERT(0);
return nullptr;
}
@ -125,14 +125,14 @@ protected:
/** @class Sequence
* @brief Runs actions sequentially, one after another.
*/
class CC_DLL Sequence : public ActionInterval
class AX_DLL Sequence : public ActionInterval
{
public:
/** Helper constructor to create an array of sequenceable actions.
*
* @return An autoreleased Sequence object.
*/
static Sequence* create(FiniteTimeAction* action1, ...) CC_REQUIRES_NULL_TERMINATION;
static Sequence* create(FiniteTimeAction* action1, ...) AX_REQUIRES_NULL_TERMINATION;
/** Helper constructor to create an array of sequenceable actions given an array.
* @code
@ -187,14 +187,14 @@ protected:
int _last;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Sequence);
AX_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 CC_DLL Repeat : public ActionInterval
class AX_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)
{
CC_SAFE_RETAIN(action);
CC_SAFE_RELEASE(_innerAction);
AX_SAFE_RETAIN(action);
AX_SAFE_RELEASE(_innerAction);
_innerAction = action;
}
}
@ -253,7 +253,7 @@ protected:
FiniteTimeAction* _innerAction;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Repeat);
AX_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 CC_DLL RepeatForever : public ActionInterval
class AX_DLL RepeatForever : public ActionInterval
{
public:
/** Creates the action.
@ -279,9 +279,9 @@ public:
{
if (_innerAction != action)
{
CC_SAFE_RELEASE(_innerAction);
AX_SAFE_RELEASE(_innerAction);
_innerAction = action;
CC_SAFE_RETAIN(_innerAction);
AX_SAFE_RETAIN(_innerAction);
}
}
@ -314,13 +314,13 @@ protected:
ActionInterval* _innerAction;
private:
CC_DISALLOW_COPY_AND_ASSIGN(RepeatForever);
AX_DISALLOW_COPY_AND_ASSIGN(RepeatForever);
};
/** @class Spawn
* @brief Spawn a new action immediately
*/
class CC_DLL Spawn : public ActionInterval
class AX_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, ...) CC_REQUIRES_NULL_TERMINATION;
static Spawn* create(FiniteTimeAction* action1, ...) AX_REQUIRES_NULL_TERMINATION;
/** Helper constructor to create an array of spawned actions.
*
@ -383,14 +383,14 @@ protected:
FiniteTimeAction* _two;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Spawn);
AX_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 CC_DLL RotateTo : public ActionInterval
class AX_DLL RotateTo : public ActionInterval
{
public:
/**
@ -460,13 +460,13 @@ protected:
Vec3 _diffAngle;
private:
CC_DISALLOW_COPY_AND_ASSIGN(RotateTo);
AX_DISALLOW_COPY_AND_ASSIGN(RotateTo);
};
/** @class RotateBy
* @brief Rotates a Node object clockwise a number of degrees by modifying it's rotation attribute.
*/
class CC_DLL RotateBy : public ActionInterval
class AX_DLL RotateBy : public ActionInterval
{
public:
/**
@ -525,7 +525,7 @@ protected:
Vec3 _startAngle;
private:
CC_DISALLOW_COPY_AND_ASSIGN(RotateBy);
AX_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 CC_DLL MoveBy : public ActionInterval
class AX_DLL MoveBy : public ActionInterval
{
public:
/**
@ -580,7 +580,7 @@ protected:
Vec3 _previousPosition;
private:
CC_DISALLOW_COPY_AND_ASSIGN(MoveBy);
AX_DISALLOW_COPY_AND_ASSIGN(MoveBy);
};
/** @class MoveTo
@ -589,7 +589,7 @@ private:
movements.
@since v2.1beta2-custom
*/
class CC_DLL MoveTo : public MoveBy
class AX_DLL MoveTo : public MoveBy
{
public:
/**
@ -632,14 +632,14 @@ protected:
Vec3 _endPosition;
private:
CC_DISALLOW_COPY_AND_ASSIGN(MoveTo);
AX_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 CC_DLL SkewTo : public ActionInterval
class AX_DLL SkewTo : public ActionInterval
{
public:
/**
@ -680,14 +680,14 @@ protected:
float _deltaY;
private:
CC_DISALLOW_COPY_AND_ASSIGN(SkewTo);
AX_DISALLOW_COPY_AND_ASSIGN(SkewTo);
};
/** @class SkewBy
* @brief Skews a Node object by skewX and skewY degrees.
@since v1.0
*/
class CC_DLL SkewBy : public SkewTo
class AX_DLL SkewBy : public SkewTo
{
public:
/**
@ -714,13 +714,13 @@ public:
bool initWithDuration(float t, float sx, float sy);
private:
CC_DISALLOW_COPY_AND_ASSIGN(SkewBy);
AX_DISALLOW_COPY_AND_ASSIGN(SkewBy);
};
/** @class ResizeTo
* @brief Resize a Node object to the final size by modifying it's 'size' attribute.
*/
class CC_DLL ResizeTo : public ActionInterval
class AX_DLL ResizeTo : public ActionInterval
{
public:
/**
@ -756,14 +756,14 @@ protected:
Vec2 _sizeDelta;
private:
CC_DISALLOW_COPY_AND_ASSIGN(ResizeTo);
AX_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 CC_DLL ResizeBy : public ActionInterval
class AX_DLL ResizeBy : public ActionInterval
{
public:
/**
@ -798,13 +798,13 @@ protected:
Vec2 _previousSize;
private:
CC_DISALLOW_COPY_AND_ASSIGN(ResizeBy);
AX_DISALLOW_COPY_AND_ASSIGN(ResizeBy);
};
/** @class JumpBy
* @brief Moves a Node object simulating a parabolic jump movement by modifying it's position attribute.
*/
class CC_DLL JumpBy : public ActionInterval
class AX_DLL JumpBy : public ActionInterval
{
public:
/**
@ -845,13 +845,13 @@ protected:
Vec2 _previousPos;
private:
CC_DISALLOW_COPY_AND_ASSIGN(JumpBy);
AX_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 CC_DLL JumpTo : public JumpBy
class AX_DLL JumpTo : public JumpBy
{
public:
/**
@ -884,7 +884,7 @@ protected:
Vec2 _endPosition;
private:
CC_DISALLOW_COPY_AND_ASSIGN(JumpTo);
AX_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 CC_DLL BezierBy : public ActionInterval
class AX_DLL BezierBy : public ActionInterval
{
public:
/** Creates the action with a duration and a bezier configuration.
@ -943,14 +943,14 @@ protected:
Vec2 _previousPosition;
private:
CC_DISALLOW_COPY_AND_ASSIGN(BezierBy);
AX_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 CC_DLL BezierTo : public BezierBy
class AX_DLL BezierTo : public BezierBy
{
public:
/** Creates the action with a duration and a bezier configuration.
@ -983,7 +983,7 @@ protected:
ccBezierConfig _toConfig;
private:
CC_DISALLOW_COPY_AND_ASSIGN(BezierTo);
AX_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 CC_DLL ScaleTo : public ActionInterval
class AX_DLL ScaleTo : public ActionInterval
{
public:
/**
@ -1066,14 +1066,14 @@ protected:
float _deltaZ;
private:
CC_DISALLOW_COPY_AND_ASSIGN(ScaleTo);
AX_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 CC_DLL ScaleBy : public ScaleTo
class AX_DLL ScaleBy : public ScaleTo
{
public:
/**
@ -1114,13 +1114,13 @@ public:
virtual ~ScaleBy() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(ScaleBy);
AX_DISALLOW_COPY_AND_ASSIGN(ScaleBy);
};
/** @class Blink
* @brief Blinks a Node object by modifying it's visible attribute.
*/
class CC_DLL Blink : public ActionInterval
class AX_DLL Blink : public ActionInterval
{
public:
/**
@ -1157,7 +1157,7 @@ protected:
bool _originalState;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Blink);
AX_DISALLOW_COPY_AND_ASSIGN(Blink);
};
/** @class FadeTo
@ -1165,7 +1165,7 @@ private:
custom one.
@warning This action doesn't support "reverse"
*/
class CC_DLL FadeTo : public ActionInterval
class AX_DLL FadeTo : public ActionInterval
{
public:
/**
@ -1203,14 +1203,14 @@ protected:
friend class FadeIn;
private:
CC_DISALLOW_COPY_AND_ASSIGN(FadeTo);
AX_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 CC_DLL FadeIn : public FadeTo
class AX_DLL FadeIn : public FadeTo
{
public:
/**
@ -1236,7 +1236,7 @@ public:
virtual ~FadeIn() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(FadeIn);
AX_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 CC_DLL FadeOut : public FadeTo
class AX_DLL FadeOut : public FadeTo
{
public:
/**
@ -1269,7 +1269,7 @@ public:
virtual ~FadeOut() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(FadeOut);
AX_DISALLOW_COPY_AND_ASSIGN(FadeOut);
FadeTo* _reverseAction;
};
@ -1278,7 +1278,7 @@ private:
@warning This action doesn't support "reverse"
@since v0.7.2
*/
class CC_DLL TintTo : public ActionInterval
class AX_DLL TintTo : public ActionInterval
{
public:
/**
@ -1320,14 +1320,14 @@ protected:
Color3B _from;
private:
CC_DISALLOW_COPY_AND_ASSIGN(TintTo);
AX_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 CC_DLL TintBy : public ActionInterval
class AX_DLL TintBy : public ActionInterval
{
public:
/**
@ -1367,13 +1367,13 @@ protected:
int16_t _fromB;
private:
CC_DISALLOW_COPY_AND_ASSIGN(TintBy);
AX_DISALLOW_COPY_AND_ASSIGN(TintBy);
};
/** @class DelayTime
* @brief Delays the action a certain amount of seconds.
*/
class CC_DLL DelayTime : public ActionInterval
class AX_DLL DelayTime : public ActionInterval
{
public:
/**
@ -1397,7 +1397,7 @@ public:
virtual ~DelayTime() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(DelayTime);
AX_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 CC_DLL ReverseTime : public ActionInterval
class AX_DLL ReverseTime : public ActionInterval
{
public:
/** Creates the action.
@ -1440,14 +1440,14 @@ protected:
FiniteTimeAction* _other;
private:
CC_DISALLOW_COPY_AND_ASSIGN(ReverseTime);
AX_DISALLOW_COPY_AND_ASSIGN(ReverseTime);
};
class Texture2D;
/** @class Animate
* @brief Animates a sprite given the name of an Animation.
*/
class CC_DLL Animate : public ActionInterval
class AX_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:
CC_DISALLOW_COPY_AND_ASSIGN(Animate);
AX_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 CC_DLL TargetedAction : public ActionInterval
class AX_DLL TargetedAction : public ActionInterval
{
public:
/** Create an action with the specified action and forced target.
@ -1557,14 +1557,14 @@ protected:
Node* _forcedTarget;
private:
CC_DISALLOW_COPY_AND_ASSIGN(TargetedAction);
AX_DISALLOW_COPY_AND_ASSIGN(TargetedAction);
};
/**
* @class ActionFloat
* @brief Action used to animate any value in range [from,to] over specified time interval
*/
class CC_DLL ActionFloat : public ActionInterval
class AX_DLL ActionFloat : public ActionInterval
{
public:
/**
@ -1609,7 +1609,7 @@ protected:
ActionFloatCallback _callback;
private:
CC_DISALLOW_COPY_AND_ASSIGN(ActionFloat);
AX_DISALLOW_COPY_AND_ASSIGN(ActionFloat);
};
// end of actions group

View File

@ -54,7 +54,7 @@ ActionManager::ActionManager() : _targets(nullptr), _currentTarget(nullptr), _cu
ActionManager::~ActionManager()
{
CCLOGINFO("deallocing ActionManager: %p", this);
AXLOGINFO("deallocing ActionManager: %p", this);
removeAllActions();
}
@ -163,8 +163,8 @@ void ActionManager::resumeTargets(const Vector<Node*>& targetsToResume)
void ActionManager::addAction(Action* action, Node* target, bool paused)
{
CCASSERT(action != nullptr, "action can't be nullptr!");
CCASSERT(target != nullptr, "target can't be nullptr!");
AXASSERT(action != nullptr, "action can't be nullptr!");
AXASSERT(target != nullptr, "target can't be nullptr!");
if (action == nullptr || target == nullptr)
return;
@ -183,7 +183,7 @@ void ActionManager::addAction(Action* action, Node* target, bool paused)
actionAllocWithHashElement(element);
CCASSERT(!ccArrayContainsObject(element->actions, action), "action already be added!");
AXASSERT(!ccArrayContainsObject(element->actions, action), "action already be added!");
ccArrayAppendObject(element->actions, action);
action->startWithTarget(target);
@ -245,7 +245,7 @@ void ActionManager::removeAction(Action* action)
if (element)
{
auto i = ccArrayGetIndexOfObject(element->actions, action);
if (i != CC_INVALID_INDEX)
if (i != AX_INVALID_INDEX)
{
removeActionAtIndex(i, element);
}
@ -254,8 +254,8 @@ void ActionManager::removeAction(Action* action)
void ActionManager::removeActionByTag(int tag, Node* target)
{
CCASSERT(tag != Action::INVALID_TAG, "Invalid tag value!");
CCASSERT(target != nullptr, "target can't be nullptr!");
AXASSERT(tag != Action::INVALID_TAG, "Invalid tag value!");
AXASSERT(target != nullptr, "target can't be nullptr!");
if (target == nullptr)
{
return;
@ -282,8 +282,8 @@ void ActionManager::removeActionByTag(int tag, Node* target)
void ActionManager::removeAllActionsByTag(int tag, Node* target)
{
CCASSERT(tag != Action::INVALID_TAG, "Invalid tag value!");
CCASSERT(target != nullptr, "target can't be nullptr!");
AXASSERT(tag != Action::INVALID_TAG, "Invalid tag value!");
AXASSERT(target != nullptr, "target can't be nullptr!");
if (target == nullptr)
{
return;
@ -318,7 +318,7 @@ void ActionManager::removeActionsByFlags(unsigned int flags, Node* target)
{
return;
}
CCASSERT(target != nullptr, "target can't be nullptr!");
AXASSERT(target != nullptr, "target can't be nullptr!");
if (target == nullptr)
{
return;
@ -353,7 +353,7 @@ void ActionManager::removeActionsByFlags(unsigned int flags, Node* target)
// and, it is not possible to get the address of a reference
Action* ActionManager::getActionByTag(int tag, const Node* target) const
{
CCASSERT(tag != Action::INVALID_TAG, "Invalid tag value!");
AXASSERT(tag != Action::INVALID_TAG, "Invalid tag value!");
tHashElement* element = nullptr;
HASH_FIND_PTR(_targets, &target, element);
@ -396,7 +396,7 @@ ssize_t ActionManager::getNumberOfRunningActionsInTarget(const Node* target) con
// and, it is not possible to get the address of a reference
size_t ActionManager::getNumberOfRunningActionsInTargetByTag(const Node* target, int tag)
{
CCASSERT(tag != Action::INVALID_TAG, "Invalid tag value!");
AXASSERT(tag != Action::INVALID_TAG, "Invalid tag value!");
tHashElement* element = nullptr;
HASH_FIND_PTR(_targets, &target, element);

View File

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

View File

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

View File

@ -66,7 +66,7 @@ ProgressTo* ProgressTo::clone() const
ProgressTo* ProgressTo::reverse() const
{
CCASSERT(false, "reverse() not supported in ProgressTo");
AXASSERT(false, "reverse() not supported in ProgressTo");
return nullptr;
}

View File

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

View File

@ -225,8 +225,8 @@ ShuffleTiles* ShuffleTiles::clone() const
ShuffleTiles::~ShuffleTiles()
{
CC_SAFE_DELETE_ARRAY(_tilesOrder);
CC_SAFE_DELETE_ARRAY(_tiles);
AX_SAFE_DELETE_ARRAY(_tilesOrder);
AX_SAFE_DELETE_ARRAY(_tiles);
}
void ShuffleTiles::shuffle(unsigned int* array, unsigned int len)
@ -569,7 +569,7 @@ TurnOffTiles* TurnOffTiles::clone() const
TurnOffTiles::~TurnOffTiles()
{
CC_SAFE_DELETE_ARRAY(_tilesOrder);
AX_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 CC_DLL ShakyTiles3D : public TiledGrid3DAction
class AX_DLL ShakyTiles3D : public TiledGrid3DAction
{
public:
/**
@ -77,7 +77,7 @@ protected:
bool _shakeZ;
private:
CC_DISALLOW_COPY_AND_ASSIGN(ShakyTiles3D);
AX_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 CC_DLL ShatteredTiles3D : public TiledGrid3DAction
class AX_DLL ShatteredTiles3D : public TiledGrid3DAction
{
public:
/**
@ -122,7 +122,7 @@ protected:
bool _shatterZ;
private:
CC_DISALLOW_COPY_AND_ASSIGN(ShatteredTiles3D);
AX_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 CC_DLL ShuffleTiles : public TiledGrid3DAction
class AX_DLL ShuffleTiles : public TiledGrid3DAction
{
public:
/**
@ -172,14 +172,14 @@ protected:
Tile* _tiles;
private:
CC_DISALLOW_COPY_AND_ASSIGN(ShuffleTiles);
AX_DISALLOW_COPY_AND_ASSIGN(ShuffleTiles);
};
/**
@brief FadeOutTRTiles action.
@details Fades out the target node with many tiles from Bottom-Left to Top-Right.
*/
class CC_DLL FadeOutTRTiles : public TiledGrid3DAction
class AX_DLL FadeOutTRTiles : public TiledGrid3DAction
{
public:
/**
@ -225,14 +225,14 @@ public:
virtual ~FadeOutTRTiles() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(FadeOutTRTiles);
AX_DISALLOW_COPY_AND_ASSIGN(FadeOutTRTiles);
};
/**
@brief FadeOutBLTiles action.
@details Fades out the target node with many tiles from Top-Right to Bottom-Left.
*/
class CC_DLL FadeOutBLTiles : public FadeOutTRTiles
class AX_DLL FadeOutBLTiles : public FadeOutTRTiles
{
public:
/**
@ -251,14 +251,14 @@ public:
virtual ~FadeOutBLTiles() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(FadeOutBLTiles);
AX_DISALLOW_COPY_AND_ASSIGN(FadeOutBLTiles);
};
/**
@brief FadeOutUpTiles action.
@details Fades out the target node with many tiles from bottom to top.
*/
class CC_DLL FadeOutUpTiles : public FadeOutTRTiles
class AX_DLL FadeOutUpTiles : public FadeOutTRTiles
{
public:
/**
@ -279,14 +279,14 @@ public:
virtual ~FadeOutUpTiles() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(FadeOutUpTiles);
AX_DISALLOW_COPY_AND_ASSIGN(FadeOutUpTiles);
};
/**
@brief FadeOutDownTiles action.
@details Fades out the target node with many tiles from top to bottom.
*/
class CC_DLL FadeOutDownTiles : public FadeOutUpTiles
class AX_DLL FadeOutDownTiles : public FadeOutUpTiles
{
public:
/**
@ -305,14 +305,14 @@ public:
virtual ~FadeOutDownTiles() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(FadeOutDownTiles);
AX_DISALLOW_COPY_AND_ASSIGN(FadeOutDownTiles);
};
/**
@brief TurnOffTiles action.
@details Turn off the target node with many tiles in random order.
*/
class CC_DLL TurnOffTiles : public TiledGrid3DAction
class AX_DLL TurnOffTiles : public TiledGrid3DAction
{
public:
/**
@ -373,14 +373,14 @@ protected:
unsigned int* _tilesOrder;
private:
CC_DISALLOW_COPY_AND_ASSIGN(TurnOffTiles);
AX_DISALLOW_COPY_AND_ASSIGN(TurnOffTiles);
};
/**
@brief WavesTiles3D action.
@details This action wave the target node with many tiles.
*/
class CC_DLL WavesTiles3D : public TiledGrid3DAction
class AX_DLL WavesTiles3D : public TiledGrid3DAction
{
public:
/**
@ -438,14 +438,14 @@ protected:
float _amplitudeRate;
private:
CC_DISALLOW_COPY_AND_ASSIGN(WavesTiles3D);
AX_DISALLOW_COPY_AND_ASSIGN(WavesTiles3D);
};
/**
@brief JumpTiles3D action.
@details Move the tiles of a target node across the Z axis.
*/
class CC_DLL JumpTiles3D : public TiledGrid3DAction
class AX_DLL JumpTiles3D : public TiledGrid3DAction
{
public:
/**
@ -503,7 +503,7 @@ protected:
float _amplitudeRate;
private:
CC_DISALLOW_COPY_AND_ASSIGN(JumpTiles3D);
AX_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 CC_DLL SplitRows : public TiledGrid3DAction
class AX_DLL SplitRows : public TiledGrid3DAction
{
public:
/**
@ -543,7 +543,7 @@ protected:
Vec2 _winSize;
private:
CC_DISALLOW_COPY_AND_ASSIGN(SplitRows);
AX_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 CC_DLL SplitCols : public TiledGrid3DAction
class AX_DLL SplitCols : public TiledGrid3DAction
{
public:
/**
@ -586,7 +586,7 @@ protected:
Vec2 _winSize;
private:
CC_DISALLOW_COPY_AND_ASSIGN(SplitCols);
AX_DISALLOW_COPY_AND_ASSIGN(SplitCols);
};
// end of actions group

View File

@ -62,7 +62,7 @@ ActionTween* ActionTween::clone() const
void ActionTween::startWithTarget(Node* target)
{
CCASSERT(dynamic_cast<ActionTweenDelegate*>(target), "target must implement ActionTweenDelegate");
AXASSERT(dynamic_cast<ActionTweenDelegate*>(target), "target must implement ActionTweenDelegate");
ActionInterval::startWithTarget(target);
_delta = _to - _from;
}

View File

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

View File

@ -41,7 +41,7 @@ AnimationFrame* AnimationFrame::create(SpriteFrame* spriteFrame, float delayUnit
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -59,9 +59,9 @@ bool AnimationFrame::initWithSpriteFrame(SpriteFrame* spriteFrame, float delayUn
AnimationFrame::~AnimationFrame()
{
CCLOGINFO("deallocing AnimationFrame: %p", this);
AXLOGINFO("deallocing AnimationFrame: %p", this);
CC_SAFE_RELEASE(_spriteFrame);
AX_SAFE_RELEASE(_spriteFrame);
}
AnimationFrame* AnimationFrame::clone() const
@ -153,7 +153,7 @@ Animation::Animation()
Animation::~Animation()
{
CCLOGINFO("deallocing Animation: %p", this);
AXLOGINFO("deallocing Animation: %p", this);
}
void Animation::addSpriteFrame(SpriteFrame* spriteFrame)

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 __CC_ANIMATION_H__
#define __CC_ANIMATION_H__
#ifndef __AX_ANIMATION_H__
#define __AX_ANIMATION_H__
#include "platform/CCPlatformConfig.h"
#include "base/CCRef.h"
@ -55,7 +55,7 @@ class SpriteFrame;
@since v2.0
*/
class CC_DLL AnimationFrame : public Ref, public Clonable
class AX_DLL AnimationFrame : public Ref, public Clonable
{
public:
/** @struct DisplayedEventInfo
@ -87,8 +87,8 @@ public:
*/
void setSpriteFrame(SpriteFrame* frame)
{
CC_SAFE_RETAIN(frame);
CC_SAFE_RELEASE(_spriteFrame);
AX_SAFE_RETAIN(frame);
AX_SAFE_RELEASE(_spriteFrame);
_spriteFrame = frame;
}
@ -146,7 +146,7 @@ protected:
ValueMap _userInfo;
private:
CC_DISALLOW_COPY_AND_ASSIGN(AnimationFrame);
AX_DISALLOW_COPY_AND_ASSIGN(AnimationFrame);
};
/** @class Animation
@ -157,7 +157,7 @@ private:
* sprite->runAction(Animate::create(animation));
* @endcode
*/
class CC_DLL Animation : public Ref, public Clonable
class AX_DLL Animation : public Ref, public Clonable
{
public:
/** Creates an animation.
@ -314,7 +314,7 @@ protected:
unsigned int _loops;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Animation);
AX_DISALLOW_COPY_AND_ASSIGN(Animation);
};
// end of sprite_nodes group
@ -322,4 +322,4 @@ private:
NS_AX_END
#endif // __CC_ANIMATION_H__
#endif // __AX_ANIMATION_H__

View File

@ -48,7 +48,7 @@ AnimationCache* AnimationCache::getInstance()
void AnimationCache::destroyInstance()
{
CC_SAFE_RELEASE_NULL(s_sharedAnimationCache);
AX_SAFE_RELEASE_NULL(s_sharedAnimationCache);
}
bool AnimationCache::init()
@ -60,7 +60,7 @@ AnimationCache::AnimationCache() {}
AnimationCache::~AnimationCache()
{
CCLOGINFO("deallocing AnimationCache: %p", this);
AXLOGINFO("deallocing AnimationCache: %p", this);
}
void AnimationCache::addAnimation(Animation* animation, std::string_view name)
@ -94,7 +94,7 @@ void AnimationCache::parseVersion1(const ValueMap& animations)
if (frameNames.empty())
{
CCLOG(
AXLOG(
"cocos2d: AnimationCache: Animation '%s' found in dictionary without any frames - cannot add to "
"animation cache.",
anim.first.c_str());
@ -110,7 +110,7 @@ void AnimationCache::parseVersion1(const ValueMap& animations)
if (!spriteFrame)
{
CCLOG(
AXLOG(
"cocos2d: AnimationCache: Animation '%s' refers to frame '%s' which is not currently in the "
"SpriteFrameCache. This frame will not be added to the animation.",
anim.first.c_str(), frameName.asString().c_str());
@ -124,7 +124,7 @@ void AnimationCache::parseVersion1(const ValueMap& animations)
if (frames.empty())
{
CCLOG(
AXLOG(
"cocos2d: AnimationCache: None of the frames for animation '%s' were found in the SpriteFrameCache. "
"Animation is not being added to the Animation Cache.",
anim.first.c_str());
@ -132,7 +132,7 @@ void AnimationCache::parseVersion1(const ValueMap& animations)
}
else if (frames.size() != frameNameSize)
{
CCLOG(
AXLOG(
"cocos2d: AnimationCache: An animation in your dictionary refers to a frame which is not in the "
"SpriteFrameCache. Some or all of the frames for the animation '%s' may be missing.",
anim.first.c_str());
@ -160,7 +160,7 @@ void AnimationCache::parseVersion2(const ValueMap& animations)
if (frameArray.empty())
{
CCLOG(
AXLOG(
"cocos2d: AnimationCache: Animation '%s' found in dictionary without any frames - cannot add to "
"animation cache.",
name.c_str());
@ -178,7 +178,7 @@ void AnimationCache::parseVersion2(const ValueMap& animations)
if (!spriteFrame)
{
CCLOG(
AXLOG(
"cocos2d: AnimationCache: Animation '%s' refers to frame '%s' which is not currently in the "
"SpriteFrameCache. This frame will not be added to the animation.",
name.c_str(), spriteFrameName.c_str());
@ -210,7 +210,7 @@ void AnimationCache::addAnimationsWithDictionary(const ValueMap& dictionary, std
auto anisItr = dictionary.find("animations");
if (anisItr == dictionary.end())
{
CCLOG("cocos2d: AnimationCache: No animations were found in provided dictionary.");
AXLOG("cocos2d: AnimationCache: No animations were found in provided dictionary.");
return;
}
@ -240,14 +240,14 @@ void AnimationCache::addAnimationsWithDictionary(const ValueMap& dictionary, std
parseVersion2(animations.asValueMap());
break;
default:
CCASSERT(false, "Invalid animation format");
AXASSERT(false, "Invalid animation format");
}
}
/** Read an NSDictionary from a plist file and parse it automatically for animations */
void AnimationCache::addAnimationsWithFile(std::string_view plist)
{
CCASSERT(!plist.empty(), "Invalid texture file name");
AXASSERT(!plist.empty(), "Invalid texture file name");
if (plist.empty())
{
log("%s error:file name is empty!", __FUNCTION__);
@ -256,7 +256,7 @@ void AnimationCache::addAnimationsWithFile(std::string_view plist)
ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(plist);
CCASSERT(!dict.empty(), "CCAnimationCache: File could not be found");
AXASSERT(!dict.empty(), "CCAnimationCache: File could not be found");
if (dict.empty())
{
log("AnimationCache::addAnimationsWithFile error:%s not exist!", plist.data());

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 __CC_ANIMATION_CACHE_H__
#define __CC_ANIMATION_CACHE_H__
#ifndef __AX_ANIMATION_CACHE_H__
#define __AX_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 CC_DLL AnimationCache : public Ref
class AX_DLL AnimationCache : public Ref
{
public:
/**
@ -129,4 +129,4 @@ private:
NS_AX_END
#endif // __CC_ANIMATION_CACHE_H__
#endif // __AX_ANIMATION_CACHE_H__

View File

@ -44,7 +44,7 @@ NS_AX_BEGIN
AtlasNode::~AtlasNode()
{
CC_SAFE_RELEASE(_textureAtlas);
AX_SAFE_RELEASE(_textureAtlas);
}
AtlasNode* AtlasNode::create(std::string_view tile, int tileWidth, int tileHeight, int itemsToRender)
@ -55,13 +55,13 @@ AtlasNode* AtlasNode::create(std::string_view tile, int tileWidth, int tileHeigh
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
bool AtlasNode::initWithTileFile(std::string_view tile, int tileWidth, int tileHeight, int itemsToRender)
{
CCASSERT(!tile.empty(), "file size should not be empty");
AXASSERT(!tile.empty(), "file size should not be empty");
Texture2D* texture = _director->getTextureCache()->addImage(tile);
return initWithTexture(texture, tileWidth, tileHeight, itemsToRender);
}
@ -141,7 +141,7 @@ void AtlasNode::calculateMaxItems()
void AtlasNode::updateAtlasValues()
{
CCASSERT(false, "CCAtlasNode:Abstract updateAtlasValue not overridden");
AXASSERT(false, "CCAtlasNode:Abstract updateAtlasValue not overridden");
}
// AtlasNode - draw
@ -270,8 +270,8 @@ Texture2D* AtlasNode::getTexture() const
void AtlasNode::setTextureAtlas(TextureAtlas* textureAtlas)
{
CC_SAFE_RETAIN(textureAtlas);
CC_SAFE_RELEASE(_textureAtlas);
AX_SAFE_RETAIN(textureAtlas);
AX_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 CC_DLL AtlasNode : public Node, public TextureProtocol
class AX_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:
CC_DISALLOW_COPY_AND_ASSIGN(AtlasNode);
AX_DISALLOW_COPY_AND_ASSIGN(AtlasNode);
};
// end of base_node group

View File

@ -62,7 +62,7 @@ PolygonInfo::PolygonInfo(const PolygonInfo& other) : triangles(), _isVertsOwner(
_rect = other._rect;
triangles.verts = new V3F_C4B_T2F[other.triangles.vertCount];
triangles.indices = new unsigned short[other.triangles.indexCount];
CCASSERT(triangles.verts && triangles.indices, "not enough memory");
AXASSERT(triangles.verts && triangles.indices, "not enough memory");
triangles.vertCount = other.triangles.vertCount;
triangles.indexCount = other.triangles.indexCount;
memcpy(triangles.verts, other.triangles.verts, other.triangles.vertCount * sizeof(other.triangles.verts[0]));
@ -79,7 +79,7 @@ PolygonInfo& PolygonInfo::operator=(const PolygonInfo& other)
_rect = other._rect;
triangles.verts = new V3F_C4B_T2F[other.triangles.vertCount];
triangles.indices = new unsigned short[other.triangles.indexCount];
CCASSERT(triangles.verts && triangles.indices, "not enough memory");
AXASSERT(triangles.verts && triangles.indices, "not enough memory");
triangles.vertCount = other.triangles.vertCount;
triangles.indexCount = other.triangles.indexCount;
memcpy(triangles.verts, other.triangles.verts, other.triangles.vertCount * sizeof(other.triangles.verts[0]));
@ -106,7 +106,7 @@ void PolygonInfo::setQuad(V3F_C4B_T2F_Quad* quad)
void PolygonInfo::setQuads(V3F_C4B_T2F_Quad* quad, int numberOfQuads)
{
CCASSERT(numberOfQuads >= 1 && numberOfQuads <= 9, "Invalid number of Quads");
AXASSERT(numberOfQuads >= 1 && numberOfQuads <= 9, "Invalid number of Quads");
releaseVertsAndIndices();
_isVertsOwner = false;
@ -133,12 +133,12 @@ void PolygonInfo::releaseVertsAndIndices()
{
if (nullptr != triangles.verts)
{
CC_SAFE_DELETE_ARRAY(triangles.verts);
AX_SAFE_DELETE_ARRAY(triangles.verts);
}
if (nullptr != triangles.indices)
{
CC_SAFE_DELETE_ARRAY(triangles.indices);
AX_SAFE_DELETE_ARRAY(triangles.indices);
}
}
}
@ -174,7 +174,7 @@ AutoPolygon::AutoPolygon(std::string_view filename)
_filename = filename;
_image = new Image();
_image->initWithImageFile(filename);
CCASSERT(_image->getPixelFormat() == backend::PixelFormat::RGBA8,
AXASSERT(_image->getPixelFormat() == backend::PixelFormat::RGBA8,
"unsupported format, currently only supports rgba8888");
_data = _image->getData();
_width = _image->getWidth();
@ -184,7 +184,7 @@ AutoPolygon::AutoPolygon(std::string_view filename)
AutoPolygon::~AutoPolygon()
{
CC_SAFE_DELETE(_image);
AX_SAFE_DELETE(_image);
}
std::vector<Vec2> AutoPolygon::trace(const Rect& rect, float threshold)
@ -211,7 +211,7 @@ Vec2 AutoPolygon::findFirstNoneTransparentPixel(const Rect& rect, float threshol
}
}
}
CCASSERT(found, "image is all transparent!");
AXASSERT(found, "image is all transparent!");
return i;
}
@ -246,7 +246,7 @@ unsigned int AutoPolygon::getSquareValue(unsigned int x, unsigned int y, const R
sv += (fixedRect.containsPoint(bl) && getAlphaByPos(bl) > threshold) ? 4 : 0;
Vec2 br = Vec2(x - 0.0f, y - 0.0f);
sv += (fixedRect.containsPoint(br) && getAlphaByPos(br) > threshold) ? 8 : 0;
CCASSERT(sv != 0 && sv != 15, "square value should not be 0, or 15");
AXASSERT(sv != 0 && sv != 15, "square value should not be 0, or 15");
return sv;
}
@ -386,7 +386,7 @@ std::vector<axis::Vec2> AutoPolygon::marchSquare(const Rect& rect, const Vec2& s
}
break;
default:
CCLOG("this shouldn't happen.");
AXLOG("this shouldn't happen.");
}
// little optimization
// if previous direction is same as current direction,
@ -408,9 +408,9 @@ std::vector<axis::Vec2> AutoPolygon::marchSquare(const Rect& rect, const Vec2& s
prevx = stepx;
prevy = stepy;
#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)
#if defined(AXIS_DEBUG) && (AXIS_DEBUG > 0)
const auto totalPixel = _width * _height;
CCASSERT(count <= totalPixel, "oh no, marching square cannot find starting position");
AXASSERT(count <= totalPixel, "oh no, marching square cannot find starting position");
#endif
} while (curx != startx || cury != starty);
return _points;
@ -666,7 +666,7 @@ void AutoPolygon::calculateUV(const Rect& rect, V3F_C4B_T2F* verts, ssize_t coun
0,1 1,1
*/
CCASSERT(_width && _height, "please specify width and height for this AutoPolygon instance");
AXASSERT(_width && _height, "please specify width and height for this AutoPolygon instance");
auto texWidth = _width;
auto texHeight = _height;
@ -688,13 +688,13 @@ Rect AutoPolygon::getRealRect(const Rect& rect)
if (realRect.equals(Rect::ZERO))
{
// if the instance doesn't have width and height, then the whole operation is kaput
CCASSERT(_height && _width, "Please specify a width and height for this instance before using its functions");
AXASSERT(_height && _width, "Please specify a width and height for this instance before using its functions");
realRect = Rect(0, 0, (float)_width, (float)_height);
}
else
{
// rect is specified, so convert to real rect
realRect = CC_RECT_POINTS_TO_PIXELS(rect);
realRect = AX_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 CC_DLL PolygonInfo
class AX_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 CC_DLL AutoPolygon
class AX_DLL AutoPolygon
{
public:
/**

View File

@ -81,7 +81,7 @@ Camera* Camera::getDefaultCamera()
auto scene = Director::getInstance()->getRunningScene();
CCASSERT(scene, "Scene is not done initializing, please use this->_defaultCamera instead.");
AXASSERT(scene, "Scene is not done initializing, please use this->_defaultCamera instead.");
return scene->getDefaultCamera();
@ -119,7 +119,7 @@ Camera::Camera()
Camera::~Camera()
{
CC_SAFE_RELEASE(_clearBrush);
AX_SAFE_RELEASE(_clearBrush);
}
const Mat4& Camera::getProjectionMatrix() const
@ -233,7 +233,7 @@ bool Camera::initDefault()
break;
}
default:
CCLOG("unrecognized projection");
AXLOG("unrecognized projection");
break;
}
if (_zoomFactor != 1.0F)
@ -283,7 +283,7 @@ Vec2 Camera::project(const Vec3& src) const
Vec4 clipPos;
getViewProjectionMatrix().transformVector(Vec4(src.x, src.y, src.z, 1.0f), &clipPos);
CCASSERT(clipPos.w != 0.0f, "clipPos.w can't be 0.0f!");
AXASSERT(clipPos.w != 0.0f, "clipPos.w can't be 0.0f!");
float ndcX = clipPos.x / clipPos.w;
float ndcY = clipPos.y / clipPos.w;
@ -301,7 +301,7 @@ Vec2 Camera::projectGL(const Vec3& src) const
getViewProjectionMatrix().transformVector(Vec4(src.x, src.y, src.z, 1.0f), &clipPos);
if (clipPos.w == 0.0f)
CCLOG("WARNING: Camera's clip position w is 0.0! a black screen should be expected.");
AXLOG("WARNING: Camera's clip position w is 0.0! a black screen should be expected.");
float ndcX = clipPos.x / clipPos.w;
float ndcY = clipPos.y / clipPos.w;
@ -327,7 +327,7 @@ Vec3 Camera::unprojectGL(const Vec3& src) const
void Camera::unproject(const Vec2& viewport, const Vec3* src, Vec3* dst) const
{
CCASSERT(src && dst, "vec3 can not be null");
AXASSERT(src && dst, "vec3 can not be null");
Vec4 screen(src->x / viewport.width, ((viewport.height - src->y)) / viewport.height, src->z, 1.0f);
screen.x = screen.x * 2.0f - 1.0f;
@ -347,7 +347,7 @@ void Camera::unproject(const Vec2& viewport, const Vec3* src, Vec3* dst) const
void Camera::unprojectGL(const Vec2& viewport, const Vec3* src, Vec3* dst) const
{
CCASSERT(src && dst, "vec3 can not be null");
AXASSERT(src && dst, "vec3 can not be null");
Vec4 screen(src->x / viewport.width, src->y / viewport.height, src->z, 1.0f);
screen.x = screen.x * 2.0f - 1.0f;
@ -572,8 +572,8 @@ void Camera::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t par
void Camera::setBackgroundBrush(CameraBackgroundBrush* clearBrush)
{
CC_SAFE_RETAIN(clearBrush);
CC_SAFE_RELEASE(_clearBrush);
AX_SAFE_RETAIN(clearBrush);
AX_SAFE_RELEASE(_clearBrush);
_clearBrush = clearBrush;
}

View File

@ -63,7 +63,7 @@ enum class CameraFlag
/**
* Defines a camera .
*/
class CC_DLL Camera : public Node
class AX_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 CC_ENABLE_CACHE_TEXTURE_DATA
#if AX_ENABLE_CACHE_TEXTURE_DATA
# include "base/CCEventCustom.h"
# include "base/CCEventListenerCustom.h"
# include "base/CCEventType.h"
@ -49,7 +49,7 @@ CameraBackgroundBrush::CameraBackgroundBrush() {}
CameraBackgroundBrush::~CameraBackgroundBrush()
{
CC_SAFE_RELEASE_NULL(_programState);
AX_SAFE_RELEASE_NULL(_programState);
}
CameraBackgroundBrush* CameraBackgroundBrush::createNoneBrush()
@ -86,11 +86,11 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundBrush::createSkyboxBrush(std::strin
CameraBackgroundDepthBrush::CameraBackgroundDepthBrush()
: _depth(0.f)
, _clearColor(false)
#if CC_ENABLE_CACHE_TEXTURE_DATA
#if AX_ENABLE_CACHE_TEXTURE_DATA
, _backToForegroundListener(nullptr)
#endif
{
#if CC_ENABLE_CACHE_TEXTURE_DATA
#if AX_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 CC_ENABLE_CACHE_TEXTURE_DATA
#if AX_ENABLE_CACHE_TEXTURE_DATA
Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener);
#endif
}
@ -114,7 +114,7 @@ CameraBackgroundDepthBrush* CameraBackgroundDepthBrush::create(float depth)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
@ -122,7 +122,7 @@ CameraBackgroundDepthBrush* CameraBackgroundDepthBrush::create(float depth)
bool CameraBackgroundDepthBrush::init()
{
CC_SAFE_RELEASE_NULL(_programState);
AX_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(CC_CALLBACK_0(CameraBackgroundDepthBrush::onBeforeDraw, this));
_customCommand.setAfterCallback(CC_CALLBACK_0(CameraBackgroundDepthBrush::onAfterDraw, this));
_customCommand.setBeforeCallback(AX_CALLBACK_0(CameraBackgroundDepthBrush::onBeforeDraw, this));
_customCommand.setAfterCallback(AX_CALLBACK_0(CameraBackgroundDepthBrush::onAfterDraw, this));
initBuffer();
return true;
@ -273,7 +273,7 @@ CameraBackgroundColorBrush* CameraBackgroundColorBrush::create(const Color4F& co
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
@ -284,11 +284,11 @@ CameraBackgroundSkyBoxBrush::CameraBackgroundSkyBoxBrush()
: _texture(nullptr)
, _actived(true)
, _textureValid(true)
#if CC_ENABLE_CACHE_TEXTURE_DATA
#if AX_ENABLE_CACHE_TEXTURE_DATA
, _backToForegroundListener(nullptr)
#endif
{
#if CC_ENABLE_CACHE_TEXTURE_DATA
#if AX_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()
{
CC_SAFE_RELEASE(_texture);
#if CC_ENABLE_CACHE_TEXTURE_DATA
AX_SAFE_RELEASE(_texture);
#if AX_ENABLE_CACHE_TEXTURE_DATA
Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener);
#endif
}
@ -333,8 +333,8 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundSkyBoxBrush::create(std::string_vie
}
else
{
CC_SAFE_DELETE(texture);
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(texture);
AX_SAFE_DELETE(ret);
}
}
@ -351,7 +351,7 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundSkyBoxBrush::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
@ -386,16 +386,16 @@ void CameraBackgroundSkyBoxBrush::drawBackground(Camera* camera)
renderer->popGroup();
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8);
AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8);
}
bool CameraBackgroundSkyBoxBrush::init()
{
_customCommand.setBeforeCallback(CC_CALLBACK_0(CameraBackgroundSkyBoxBrush::onBeforeDraw, this));
_customCommand.setAfterCallback(CC_CALLBACK_0(CameraBackgroundSkyBoxBrush::onAfterDraw, this));
_customCommand.setBeforeCallback(AX_CALLBACK_0(CameraBackgroundSkyBoxBrush::onBeforeDraw, this));
_customCommand.setAfterCallback(AX_CALLBACK_0(CameraBackgroundSkyBoxBrush::onAfterDraw, this));
CC_SAFE_RELEASE_NULL(_programState);
AX_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)
{
CC_SAFE_RETAIN(texture);
CC_SAFE_RELEASE(_texture);
AX_SAFE_RETAIN(texture);
AX_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 CC_DLL CameraBackgroundBrush : public Ref
class AX_DLL CameraBackgroundBrush : public Ref
{
public:
/**
@ -130,7 +130,7 @@ protected:
/**
* Depth brush clear depth buffer with given depth
*/
class CC_DLL CameraBackgroundDepthBrush : public CameraBackgroundBrush
class AX_DLL CameraBackgroundDepthBrush : public CameraBackgroundBrush
{
public:
/**
@ -167,7 +167,7 @@ private:
void onAfterDraw();
protected:
#if CC_ENABLE_CACHE_TEXTURE_DATA
#if AX_ENABLE_CACHE_TEXTURE_DATA
EventListenerCustom* _backToForegroundListener;
#endif
void initBuffer();
@ -191,7 +191,7 @@ protected:
/**
* Color brush clear buffer with given depth and color
*/
class CC_DLL CameraBackgroundColorBrush : public CameraBackgroundDepthBrush
class AX_DLL CameraBackgroundColorBrush : public CameraBackgroundDepthBrush
{
public:
/**
@ -235,7 +235,7 @@ class EventListenerCustom;
/**
* Skybox brush clear buffer with a skybox
*/
class CC_DLL CameraBackgroundSkyBoxBrush : public CameraBackgroundBrush
class AX_DLL CameraBackgroundSkyBoxBrush : public CameraBackgroundBrush
{
public:
/**
@ -298,7 +298,7 @@ protected:
TextureCube* _texture;
#if CC_ENABLE_CACHE_TEXTURE_DATA
#if AX_ENABLE_CACHE_TEXTURE_DATA
EventListenerCustom* _backToForegroundListener;
#endif

View File

@ -43,7 +43,7 @@ ClippingNode::~ClippingNode()
_stencil->stopAllActions();
_stencil->release();
}
CC_SAFE_DELETE(_stencilStateManager);
AX_SAFE_DELETE(_stencilStateManager);
}
ClippingNode* ClippingNode::create()
@ -55,7 +55,7 @@ ClippingNode* ClippingNode::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
@ -70,7 +70,7 @@ ClippingNode* ClippingNode::create(Node* pStencil)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
@ -97,7 +97,7 @@ void ClippingNode::onEnter()
}
else
{
CCLOG("ClippingNode warning: _stencil is nil.");
AXLOG("ClippingNode warning: _stencil is nil.");
}
}
@ -141,7 +141,7 @@ void ClippingNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32
// IMPORTANT:
// To ease the migration to v3.0, we still support the Mat4 stack,
// but it is deprecated and your code should not rely on it
CCASSERT(nullptr != _director, "Director is null when setting matrix stack");
AXASSERT(nullptr != _director, "Director is null when setting matrix stack");
_director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
_director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform);
@ -153,7 +153,7 @@ void ClippingNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32
renderer->pushGroup(_groupCommandStencil.getRenderQueueID());
// _beforeVisitCmd.init(_globalZOrder);
// _beforeVisitCmd.func = CC_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilStateManager);
// _beforeVisitCmd.func = AX_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);
CC_SAFE_RELEASE_NULL(programState);
AX_SAFE_RELEASE_NULL(programState);
}
_stencil->visit(renderer, _modelViewTransform, flags);
auto afterDrawStencilCmd = renderer->nextCallbackCommand();
afterDrawStencilCmd->init(_globalZOrder);
afterDrawStencilCmd->func = CC_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilStateManager);
afterDrawStencilCmd->func = AX_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 = CC_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager);
_afterVisitCmd->func = AX_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager);
renderer->addCommand(_afterVisitCmd);
renderer->popGroup();
@ -242,7 +242,7 @@ void ClippingNode::setStencil(Node* stencil)
if (_stencil == stencil)
return;
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_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 // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_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();
}
CC_SAFE_RELEASE_NULL(_stencil);
AX_SAFE_RELEASE_NULL(_stencil);
// initialise new stencil
_stencil = stencil;
CC_SAFE_RETAIN(_stencil);
AX_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 CC_DLL ClippingNode : public Node
class AX_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:
CC_DISALLOW_COPY_AND_ASSIGN(ClippingNode);
AX_DISALLOW_COPY_AND_ASSIGN(ClippingNode);
};
/** @} */
NS_AX_END

View File

@ -38,7 +38,7 @@ ClippingRectangleNode* ClippingRectangleNode::create(const Rect& clippingRegion)
node->autorelease();
}
else
CC_SAFE_DELETE(node);
AX_SAFE_DELETE(node);
return node;
}
@ -49,7 +49,7 @@ ClippingRectangleNode* ClippingRectangleNode::create()
if (node->init())
node->autorelease();
else
CC_SAFE_DELETE(node);
AX_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 = CC_CALLBACK_0(ClippingRectangleNode::onBeforeVisitScissor, this);
beforeVisitCmdScissor->func = AX_CALLBACK_0(ClippingRectangleNode::onBeforeVisitScissor, this);
renderer->addCommand(beforeVisitCmdScissor);
Node::visit(renderer, parentTransform, parentFlags);
auto afterVisitCmdScissor = renderer->nextCallbackCommand();
afterVisitCmdScissor->init(_globalZOrder);
afterVisitCmdScissor->func = CC_CALLBACK_0(ClippingRectangleNode::onAfterVisitScissor, this);
afterVisitCmdScissor->func = AX_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 CC_DLL ClippingRectangleNode : public Node
class AX_DLL ClippingRectangleNode : public Node
{
public:
/**

View File

@ -61,7 +61,7 @@ Component* Component::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_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 __CC_FRAMEWORK_COMPONENT_H__
#define __CC_FRAMEWORK_COMPONENT_H__
#ifndef __AX_FRAMEWORK_COMPONENT_H__
#define __AX_FRAMEWORK_COMPONENT_H__
/// @cond DO_NOT_SHOW
#include <string>
@ -44,7 +44,7 @@ enum
kComponentOnUpdate
};
class CC_DLL Component : public Ref
class AX_DLL Component : public Ref
{
public:
static Component* create();
@ -88,4 +88,4 @@ protected:
NS_AX_END
/// @endcond
#endif // __CC_FRAMEWORK_COMPONENT_H__
#endif // __AX_FRAMEWORK_COMPONENT_H__

View File

@ -49,15 +49,15 @@ Component* ComponentContainer::get(std::string_view name) const
bool ComponentContainer::add(Component* com)
{
bool ret = false;
CCASSERT(com != nullptr, "Component must be non-nil");
CCASSERT(com->getOwner() == nullptr, "Component already added. It can't be added again");
AXASSERT(com != nullptr, "Component must be non-nil");
AXASSERT(com->getOwner() == nullptr, "Component already added. It can't be added again");
do
{
auto componentName = com->getName();
if (_componentMap.find(componentName) != _componentMap.end())
{
CCASSERT(false, "ComponentContainer already have this kind of component");
AXASSERT(false, "ComponentContainer already have this kind of component");
break;
}
hlookup::set_item(_componentMap, componentName, com); //_componentMap[componentName] = com;
@ -76,7 +76,7 @@ bool ComponentContainer::remove(std::string_view componentName)
do
{
auto iter = _componentMap.find(componentName);
CC_BREAK_IF(iter == _componentMap.end());
AX_BREAK_IF(iter == _componentMap.end());
auto component = iter->second;
_componentMap.erase(componentName);
@ -116,12 +116,12 @@ void ComponentContainer::visit(float delta)
{
if (!_componentMap.empty())
{
CC_SAFE_RETAIN(_owner);
AX_SAFE_RETAIN(_owner);
for (auto& iter : _componentMap)
{
iter.second->update(delta);
}
CC_SAFE_RELEASE(_owner);
AX_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 __CC_FRAMEWORK_COMCONTAINER_H__
#define __CC_FRAMEWORK_COMCONTAINER_H__
#ifndef __AX_FRAMEWORK_COMCONTAINER_H__
#define __AX_FRAMEWORK_COMCONTAINER_H__
/// @cond DO_NOT_SHOW
@ -36,7 +36,7 @@ NS_AX_BEGIN
class Component;
class Node;
class CC_DLL ComponentContainer
class AX_DLL ComponentContainer
{
protected:
/**
@ -77,4 +77,4 @@ private:
NS_AX_END
/// @endcond
#endif // __CC_FRAMEWORK_COMCONTAINER_H__
#endif // __AX_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 CC_ENABLE_CACHE_TEXTURE_DATA
#if AX_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()
{
CC_SAFE_FREE(_bufferTriangle);
CC_SAFE_FREE(_bufferPoint);
CC_SAFE_FREE(_bufferLine);
AX_SAFE_FREE(_bufferTriangle);
AX_SAFE_FREE(_bufferPoint);
AX_SAFE_FREE(_bufferLine);
freeShaderInternal(_customCommandTriangle);
freeShaderInternal(_customCommandPoint);
@ -82,7 +82,7 @@ DrawNode* DrawNode::create(float defaultLineWidth)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
@ -90,7 +90,7 @@ DrawNode* DrawNode::create(float defaultLineWidth)
void DrawNode::ensureCapacity(int count)
{
CCASSERT(count >= 0, "capacity must be >= 0");
AXASSERT(count >= 0, "capacity must be >= 0");
if (_bufferCountTriangle + count > _bufferCapacityTriangle)
{
@ -105,7 +105,7 @@ void DrawNode::ensureCapacity(int count)
void DrawNode::ensureCapacityGLPoint(int count)
{
CCASSERT(count >= 0, "capacity must be >= 0");
AXASSERT(count >= 0, "capacity must be >= 0");
if (_bufferCountPoint + count > _bufferCapacityPoint)
{
@ -120,7 +120,7 @@ void DrawNode::ensureCapacityGLPoint(int count)
void DrawNode::ensureCapacityGLLine(int count)
{
CCASSERT(count >= 0, "capacity must be >= 0");
AXASSERT(count >= 0, "capacity must be >= 0");
if (_bufferCountLine + count > _bufferCapacityLine)
{
@ -166,7 +166,7 @@ void DrawNode::updateShaderInternal(CustomCommand& cmd,
CustomCommand::PrimitiveType primitiveType)
{
auto& pipelinePS = cmd.getPipelineDescriptor().programState;
CC_SAFE_RELEASE(pipelinePS);
AX_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;
CC_SAFE_RELEASE_NULL(pipelinePS);
AX_SAFE_RELEASE_NULL(pipelinePS);
}
void DrawNode::setVertexLayout(CustomCommand& cmd)
@ -605,7 +605,7 @@ void DrawNode::drawPolygon(const Vec2* verts,
float borderWidth,
const Color4B& borderColor)
{
CCASSERT(count >= 0, "invalid count value");
AXASSERT(count >= 0, "invalid count value");
bool outline = (borderColor.a > 0.0f && borderWidth > 0.0f);

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 CC_DLL DrawNode : public Node
class AX_DLL DrawNode : public Node
{
public:
/** creates and initialize a DrawNode node.
@ -412,7 +412,7 @@ protected:
axis::any_buffer _abuf;
private:
CC_DISALLOW_COPY_AND_ASSIGN(DrawNode);
AX_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;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
@ -88,7 +88,7 @@ bool FastTMXLayer::initWithTilesetInfo(TMXTilesetInfo* tilesetInfo, TMXLayerInfo
// tilesetInfo
_tileSet = tilesetInfo;
CC_SAFE_RETAIN(_tileSet);
AX_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(CC_POINT_PIXELS_TO_POINTS(offset));
this->setPosition(AX_POINT_PIXELS_TO_POINTS(offset));
this->setContentSize(
CC_SIZE_PIXELS_TO_POINTS(Vec2(_layerSize.width * _mapTileSize.width, _layerSize.height * _mapTileSize.height)));
AX_SIZE_PIXELS_TO_POINTS(Vec2(_layerSize.width * _mapTileSize.width, _layerSize.height * _mapTileSize.height)));
this->tileToNodeTransform();
@ -115,15 +115,15 @@ FastTMXLayer::FastTMXLayer() {}
FastTMXLayer::~FastTMXLayer()
{
CC_SAFE_RELEASE(_tileSet);
CC_SAFE_RELEASE(_texture);
CC_SAFE_FREE(_tiles);
CC_SAFE_RELEASE(_vertexBuffer);
CC_SAFE_RELEASE(_indexBuffer);
AX_SAFE_RELEASE(_tileSet);
AX_SAFE_RELEASE(_texture);
AX_SAFE_FREE(_tiles);
AX_SAFE_RELEASE(_vertexBuffer);
AX_SAFE_RELEASE(_indexBuffer);
for (auto& e : _customCommands)
{
CC_SAFE_RELEASE(e.second->getPipelineDescriptor().programState);
AX_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 = CC_SIZE_PIXELS_TO_POINTS(_mapTileSize);
Vec2 tileSize = CC_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize);
Vec2 mapTileSize = AX_SIZE_PIXELS_TO_POINTS(_mapTileSize);
Vec2 tileSize = AX_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize);
Mat4 nodeToTileTransform = _tileToNodeTransform.getInversed();
// transform to tile
visibleTiles = RectApplyTransform(visibleTiles, nodeToTileTransform);
@ -211,7 +211,7 @@ void FastTMXLayer::updateTiles(const Rect& culledRect)
else
{
// do nothing, do not support
// CCASSERT(0, "TMX invalid value");
// AXASSERT(0, "TMX invalid value");
}
_indicesVertexZNumber.clear();
@ -275,7 +275,7 @@ void FastTMXLayer::updateVertexBuffer()
void FastTMXLayer::updateIndexBuffer()
{
#ifdef CC_FAST_TILEMAP_32_BIT_INDICES
#ifdef AX_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());
@ -321,7 +321,7 @@ void FastTMXLayer::setupTiles()
break;
case FAST_TMX_ORIENTATION_HEX:
default:
CCLOGERROR("FastTMX does not support type %d", _layerOrientation);
AXLOGERROR("FastTMX does not support type %d", _layerOrientation);
break;
}
@ -384,8 +384,8 @@ void FastTMXLayer::setupTiles()
Mat4 FastTMXLayer::tileToNodeTransform()
{
float w = _mapTileSize.width / CC_CONTENT_SCALE_FACTOR();
float h = _mapTileSize.height / CC_CONTENT_SCALE_FACTOR();
float w = _mapTileSize.width / AX_CONTENT_SCALE_FACTOR();
float h = _mapTileSize.height / AX_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 CC_FAST_TILEMAP_32_BIT_INDICES
#if AX_FAST_TILEMAP_32_BIT_INDICES
indexFormat = CustomCommand::IndexFormat::U_INT;
#endif
command->setIndexBuffer(_indexBuffer, indexFormat);
@ -443,7 +443,7 @@ void FastTMXLayer::updatePrimitives()
if (_useAutomaticVertexZ)
{
CC_SAFE_RELEASE(pipelineDescriptor.programState);
AX_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
{
CC_SAFE_RELEASE(pipelineDescriptor.programState);
AX_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 = CC_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize);
Vec2 tileSize = AX_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize);
Vec2 texSize = _tileSet->_imageSize;
_tileToQuadIndex.clear();
_totalQuads.resize(int(_layerSize.width * _layerSize.height));
@ -647,10 +647,10 @@ void FastTMXLayer::updateTotalQuads()
// removing / getting tiles
Sprite* FastTMXLayer::getTileAt(const Vec2& tileCoordinate)
{
CCASSERT(tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >= 0 &&
AXASSERT(tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >= 0 &&
tileCoordinate.y >= 0,
"TMXLayer: invalid position");
CCASSERT(_tiles, "TMXLayer: the tiles map has been released");
AXASSERT(_tiles, "TMXLayer: the tiles map has been released");
Sprite* tile = nullptr;
int gid = this->getTileGIDAt(tileCoordinate);
@ -669,7 +669,7 @@ Sprite* FastTMXLayer::getTileAt(const Vec2& tileCoordinate)
{
// tile not created yet. create it
Rect rect = _tileSet->getRectForGID(gid);
rect = CC_RECT_PIXELS_TO_POINTS(rect);
rect = AX_RECT_PIXELS_TO_POINTS(rect);
tile = Sprite::createWithTexture(_texture, rect);
Vec2 p = this->getPositionAt(tileCoordinate);
@ -690,10 +690,10 @@ Sprite* FastTMXLayer::getTileAt(const Vec2& tileCoordinate)
int FastTMXLayer::getTileGIDAt(const Vec2& tileCoordinate, TMXTileFlags* flags /* = nullptr*/)
{
CCASSERT(tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >= 0 &&
AXASSERT(tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >= 0 &&
tileCoordinate.y >= 0,
"TMXLayer: invalid position");
CCASSERT(_tiles, "TMXLayer: the tiles map has been released");
AXASSERT(_tiles, "TMXLayer: the tiles map has been released");
int idx = static_cast<int>(((int)tileCoordinate.x + (int)tileCoordinate.y * _layerSize.width));
@ -737,10 +737,10 @@ int FastTMXLayer::getVertexZForPos(const Vec2& pos)
ret = static_cast<int>(-(_layerSize.height - pos.y));
break;
case FAST_TMX_ORIENTATION_HEX:
CCASSERT(0, "TMX Hexa vertexZ not supported");
AXASSERT(0, "TMX Hexa vertexZ not supported");
break;
default:
CCASSERT(0, "TMX invalid value");
AXASSERT(0, "TMX invalid value");
break;
}
}
@ -755,7 +755,7 @@ int FastTMXLayer::getVertexZForPos(const Vec2& pos)
void FastTMXLayer::removeTileAt(const Vec2& tileCoordinate)
{
CCASSERT(tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >= 0 &&
AXASSERT(tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >= 0 &&
tileCoordinate.y >= 0,
"TMXLayer: invalid position");
@ -842,7 +842,7 @@ Vec2 FastTMXLayer::calculateLayerOffset(const Vec2& pos)
break;
case FAST_TMX_ORIENTATION_HEX:
default:
CCASSERT(pos.isZero(), "offset for this map not implemented yet");
AXASSERT(pos.isZero(), "offset for this map not implemented yet");
break;
}
return ret;
@ -856,11 +856,11 @@ void FastTMXLayer::setTileGID(int gid, const Vec2& tileCoordinate)
void FastTMXLayer::setTileGID(int gid, const Vec2& tileCoordinate, TMXTileFlags flags)
{
CCASSERT(tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >= 0 &&
AXASSERT(tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >= 0 &&
tileCoordinate.y >= 0,
"TMXLayer: invalid position");
CCASSERT(_tiles, "TMXLayer: the tiles map has been released");
CCASSERT(gid == 0 || gid >= _tileSet->_firstGid, "TMXLayer: invalid gid");
AXASSERT(_tiles, "TMXLayer: the tiles map has been released");
AXASSERT(gid == 0 || gid >= _tileSet->_firstGid, "TMXLayer: invalid gid");
TMXTileFlags currentFlags;
int currentGID = getTileGIDAt(tileCoordinate, &currentFlags);
@ -890,7 +890,7 @@ void FastTMXLayer::setTileGID(int gid, const Vec2& tileCoordinate, TMXTileFlags
{
Sprite* sprite = it->second.first;
Rect rect = _tileSet->getRectForGID(gid);
rect = CC_RECT_PIXELS_TO_POINTS(rect);
rect = AX_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(CC_CALLBACK_1(TMXTileAnimTask::tickAndScheduleNext, this),
_layer->getParent()->scheduleOnce(AX_CALLBACK_1(TMXTileAnimTask::tickAndScheduleNext, this),
_animation->_frames[_currentFrame]._duration / 1000.0f, _key);
}

View File

@ -81,7 +81,7 @@ class Buffer;
* @js NA
*/
class CC_DLL FastTMXLayer : public Node
class AX_DLL FastTMXLayer : public Node
{
public:
/** Possible orientations of the TMX map */
@ -222,8 +222,8 @@ public:
*/
void setTileSet(TMXTilesetInfo* info)
{
CC_SAFE_RETAIN(info);
CC_SAFE_RELEASE(_tileSet);
AX_SAFE_RETAIN(info);
AX_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 CC_FAST_TILEMAP_32_BIT_INDICES
#ifdef AX_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 CC_DLL TMXTileAnimTask : public Ref
class AX_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 CC_DLL TMXTileAnimManager : public Ref
class AX_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;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
@ -53,13 +53,13 @@ FastTMXTiledMap* FastTMXTiledMap::createWithXML(std::string_view tmxString, std:
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
bool FastTMXTiledMap::initWithTMXFile(std::string_view tmxFile)
{
CCASSERT(tmxFile.size() > 0, "FastTMXTiledMap: tmx file should not be empty");
AXASSERT(tmxFile.size() > 0, "FastTMXTiledMap: tmx file should not be empty");
setContentSize(Vec2::ZERO);
@ -69,7 +69,7 @@ bool FastTMXTiledMap::initWithTMXFile(std::string_view tmxFile)
{
return false;
}
CCASSERT(!mapInfo->getTilesets().empty(), "FastTMXTiledMap: Map not found. Please check the filename.");
AXASSERT(!mapInfo->getTilesets().empty(), "FastTMXTiledMap: Map not found. Please check the filename.");
buildWithMapInfo(mapInfo);
_tmxFile = tmxFile;
@ -83,7 +83,7 @@ bool FastTMXTiledMap::initWithXML(std::string_view tmxString, std::string_view r
TMXMapInfo* mapInfo = TMXMapInfo::createWithXML(tmxString, resourcePath);
CCASSERT(!mapInfo->getTilesets().empty(), "FastTMXTiledMap: Map not found. Please check the filename.");
AXASSERT(!mapInfo->getTilesets().empty(), "FastTMXTiledMap: Map not found. Please check the filename.");
buildWithMapInfo(mapInfo);
return true;
@ -148,7 +148,7 @@ TMXTilesetInfo* FastTMXTiledMap::tilesetForLayer(TMXLayerInfo* layerInfo, TMXMap
}
// If all the tiles are 0, return empty tileset
CCLOG("cocos2d: Warning: TMX Layer '%s' has no tiles", layerInfo->_name.c_str());
AXLOG("cocos2d: Warning: TMX Layer '%s' has no tiles", layerInfo->_name.c_str());
return nullptr;
}
@ -196,7 +196,7 @@ void FastTMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo)
// public
FastTMXLayer* FastTMXTiledMap::getLayer(std::string_view layerName) const
{
CCASSERT(!layerName.empty(), "Invalid layer name!");
AXASSERT(!layerName.empty(), "Invalid layer name!");
for (auto& child : _children)
{
@ -216,7 +216,7 @@ FastTMXLayer* FastTMXTiledMap::getLayer(std::string_view layerName) const
TMXObjectGroup* FastTMXTiledMap::getObjectGroup(std::string_view groupName) const
{
CCASSERT(!groupName.empty(), "Invalid group name!");
AXASSERT(!groupName.empty(), "Invalid group name!");
if (_objectGroups.size() > 0)
{

View File

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

View File

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

View File

@ -26,8 +26,8 @@
****************************************************************************/
#include "2d/CCFontAtlas.h"
#if CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID
#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
#if AX_TARGET_PLATFORM != AX_PLATFORM_WIN32 && AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID
#elif AX_TARGET_PLATFORM == AX_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(CC_USE_METAL)
#if defined(AX_USE_METAL)
_currentPageDataSizeRGBA = CacheTextureWidth * CacheTextureHeight * 4;
#endif
@ -81,11 +81,11 @@ FontAtlas::FontAtlas(Font* theFont) : _font(theFont)
_letterPadding += 2 * FontFreeType::DistanceMapSpread;
}
#if CC_ENABLE_CACHE_TEXTURE_DATA
#if AX_ENABLE_CACHE_TEXTURE_DATA
auto eventDispatcher = Director::getInstance()->getEventDispatcher();
_rendererRecreatedListener = EventListenerCustom::create(
EVENT_RENDERER_RECREATED, CC_CALLBACK_1(FontAtlas::listenRendererRecreated, this));
EVENT_RENDERER_RECREATED, AX_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(CC_USE_METAL)
#if defined(AX_USE_METAL)
if (_strideShift && !_currentPageDataRGBA)
_currentPageDataRGBA = new uint8_t[_currentPageDataSizeRGBA];
#endif
@ -107,7 +107,7 @@ void FontAtlas::reinit()
FontAtlas::~FontAtlas()
{
#if CC_ENABLE_CACHE_TEXTURE_DATA
#if AX_ENABLE_CACHE_TEXTURE_DATA
if (_fontFreeType && _rendererRecreatedListener)
{
auto eventDispatcher = Director::getInstance()->getEventDispatcher();
@ -119,9 +119,9 @@ FontAtlas::~FontAtlas()
_font->release();
releaseTextures();
CC_SAFE_DELETE_ARRAY(_currentPageData);
#if defined(CC_USE_METAL)
CC_SAFE_DELETE_ARRAY(_currentPageDataRGBA);
AX_SAFE_DELETE_ARRAY(_currentPageData);
#if defined(AX_USE_METAL)
AX_SAFE_DELETE_ARRAY(_currentPageDataRGBA);
#endif
}
@ -234,7 +234,7 @@ bool FontAtlas::prepareLetterDefinitions(const std::u32string& utf32Text)
Rect tempRect;
FontLetterDefinition tempDef;
auto scaleFactor = CC_CONTENT_SCALE_FACTOR();
auto scaleFactor = AX_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(CC_USE_METAL)
#if !defined(AX_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(CC_USE_METAL)
#if !defined(AX_USE_METAL)
texture->initWithData(_currentPageData, _currentPageDataSize, _pixelFormat, CacheTextureWidth, CacheTextureHeight);
#else
if (_strideShift)

View File

@ -59,7 +59,7 @@ struct FontLetterDefinition
bool rotated;
};
class CC_DLL FontAtlas : public Ref
class AX_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(CC_USE_METAL)
#if defined(AX_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())
{
CC_SAFE_RELEASE_NULL(it->second);
AX_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)
{
CC_SAFE_RELEASE_NULL(item->second);
AX_SAFE_RELEASE_NULL(item->second);
item = _atlasMap.erase(item);
}
else

View File

@ -38,7 +38,7 @@ class FontAtlas;
class Texture2D;
struct _ttfConfig;
class CC_DLL FontAtlasCache
class AX_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);
CC_DEPRECATED_ATTRIBUTE static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset);
AX_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);
CC_DEPRECATED_ATTRIBUTE static void reloadFontAtlasFNT(std::string_view fontFileName,
AX_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

@ -40,7 +40,7 @@ FontCharMap* FontCharMap::create(std::string_view plistFile)
ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(pathStr);
CCASSERT(dict["version"].asInt() == 1, "Unsupported version. Upgrade cocos2d version");
AXASSERT(dict["version"].asInt() == 1, "Unsupported version. Upgrade cocos2d version");
std::string textureFilename = relPathStr + dict["textureFilename"].asString();
@ -112,7 +112,7 @@ FontAtlas* FontCharMap::newFontAtlas()
tempAtlas->setLineHeight((float)_itemHeight);
auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR();
auto contentScaleFactor = AX_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;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
@ -117,17 +117,17 @@ BMFontConfiguration::BMFontConfiguration() : _commonHeight(0), _characterSet(nul
BMFontConfiguration::~BMFontConfiguration()
{
CCLOGINFO("deallocing BMFontConfiguration: %p", this);
AXLOGINFO("deallocing BMFontConfiguration: %p", this);
this->purgeFontDefDictionary();
this->purgeKerningDictionary();
_atlasName.clear();
CC_SAFE_DELETE(_characterSet);
AX_SAFE_DELETE(_characterSet);
}
std::string BMFontConfiguration::description() const
{
return StringUtils::format(
"<BMFontConfiguration = " CC_FORMAT_PRINTF_SIZE_T " | Glphys:%d Kernings:%d | Image = %s>", (size_t)this,
"<BMFontConfiguration = " AX_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());
}
@ -156,7 +156,7 @@ std::set<unsigned int>* BMFontConfiguration::parseConfigFile(std::string_view co
}
if (data[0] == 0)
{
CCLOG("cocos2d: Error parsing FNTfile %s", controlFile.data());
AXLOG("cocos2d: Error parsing FNTfile %s", controlFile.data());
return nullptr;
}
auto contents = data.c_str();
@ -231,7 +231,7 @@ std::set<unsigned int>* BMFontConfiguration::parseBinaryConfigFile(unsigned char
uint32_t remains = size;
CCASSERT(pData[3] == 3, "Only version 3 is supported");
AXASSERT(pData[3] == 3, "Only version 3 is supported");
pData += 4;
remains -= 4;
@ -293,13 +293,13 @@ std::set<unsigned int>* BMFontConfiguration::parseBinaryConfigFile(unsigned char
uint16_t scaleH = 0;
memcpy(&scaleH, pData + 6, 2);
CCASSERT(scaleW <= Configuration::getInstance()->getMaxTextureSize() &&
AXASSERT(scaleW <= Configuration::getInstance()->getMaxTextureSize() &&
scaleH <= Configuration::getInstance()->getMaxTextureSize(),
"CCLabelBMFont: page can't be larger than supported");
uint16_t pages = 0;
memcpy(&pages, pData + 8, 2);
CCASSERT(pages == 1, "CCBitfontAtlas: only supports 1 page");
AXASSERT(pages == 1, "CCBitfontAtlas: only supports 1 page");
}
else if (blockId == 3)
{
@ -308,7 +308,7 @@ std::set<unsigned int>* BMFontConfiguration::parseBinaryConfigFile(unsigned char
*/
const char* value = (const char*)pData;
CCASSERT(strlen(value) < blockSize, "Block size should be less then string");
AXASSERT(strlen(value) < blockSize, "Block size should be less then string");
_atlasName = FileUtils::getInstance()->fullPathFromRelativeFile(value, controlFile);
}
@ -409,7 +409,7 @@ void BMFontConfiguration::parseImageFileName(const char* line, std::string_view
// page ID. Sanity check
int pageId;
sscanf(line, "page id=%d", &pageId);
CCASSERT(pageId == 0, "LabelBMFont file could not be found");
AXASSERT(pageId == 0, "LabelBMFont file could not be found");
// file
char fileName[255];
@ -429,7 +429,7 @@ void BMFontConfiguration::parseInfoArguments(const char* line)
// padding
sscanf(strstr(line, "padding=") + 8, "%d,%d,%d,%d", &_padding.top, &_padding.right, &_padding.bottom,
&_padding.left);
// CCLOG("cocos2d: padding: %d,%d,%d,%d", _padding.left, _padding.top, _padding.right, _padding.bottom);
// AXLOG("cocos2d: padding: %d,%d,%d,%d", _padding.left, _padding.top, _padding.right, _padding.bottom);
}
void BMFontConfiguration::parseCommonArguments(const char* line)
@ -443,24 +443,24 @@ void BMFontConfiguration::parseCommonArguments(const char* line)
auto tmp = strstr(line, "lineHeight=") + 11;
sscanf(tmp, "%d", &_commonHeight);
#if COCOS2D_DEBUG > 0
#if AXIS_DEBUG > 0
// scaleW. sanity check
int value;
tmp = strstr(tmp, "scaleW=") + 7;
sscanf(tmp, "%d", &value);
int maxTextureSize = Configuration::getInstance()->getMaxTextureSize();
CCASSERT(value <= maxTextureSize, "CCLabelBMFont: page can't be larger than supported");
AXASSERT(value <= maxTextureSize, "CCLabelBMFont: page can't be larger than supported");
// scaleH. sanity check
tmp = strstr(tmp, "scaleH=") + 7;
sscanf(tmp, "%d", &value);
CCASSERT(value <= maxTextureSize, "CCLabelBMFont: page can't be larger than supported");
AXASSERT(value <= maxTextureSize, "CCLabelBMFont: page can't be larger than supported");
// pages. sanity check
tmp = strstr(tmp, "pages=") + 6;
sscanf(tmp, "%d", &value);
CCASSERT(value == 1, "CCBitfontAtlas: only supports 1 page");
AXASSERT(value == 1, "CCBitfontAtlas: only supports 1 page");
#endif
// packed (ignore) What does this mean ??
}
@ -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(CC_RECT_PIXELS_TO_POINTS(imageRect)), _imageRotated(imageRotated)
: _configuration(theContfig), _imageRectInPoints(AX_RECT_PIXELS_TO_POINTS(imageRect)), _imageRotated(imageRotated)
{
_configuration->retain();
}
@ -615,7 +615,7 @@ void FontFNT::purgeCachedData()
if (s_configurations)
{
s_configurations->clear();
CC_SAFE_DELETE(s_configurations);
AX_SAFE_DELETE(s_configurations);
}
}
@ -709,7 +709,7 @@ FontAtlas* FontFNT::newFontAtlas()
FontLetterDefinition tempDefinition;
const auto tempRect = CC_RECT_PIXELS_TO_POINTS(fontDef.rect);
const auto tempRect = AX_RECT_PIXELS_TO_POINTS(fontDef.rect);
tempDefinition.offsetX = fontDef.xOffset;
tempDefinition.offsetY = fontDef.yOffset;
@ -738,7 +738,7 @@ FontAtlas* FontFNT::newFontAtlas()
// add the new definition
if (65535 < fontDef.charID)
{
CCLOGWARN("Warning: 65535 < fontDef.charID (%u), ignored", fontDef.charID);
AXLOGWARN("Warning: 65535 < fontDef.charID (%u), ignored", fontDef.charID);
}
else
{
@ -751,7 +751,7 @@ FontAtlas* FontFNT::newFontAtlas()
Texture2D* tempTexture = Director::getInstance()->getTextureCache()->addImage(_configuration->getAtlasName());
if (!tempTexture)
{
CC_SAFE_RELEASE(tempAtlas);
AX_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 CC_DLL BMFontConfiguration : public Ref
class AX_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 CC_DLL FontFNT : public Font
class AX_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);
CC_DEPRECATED_ATTRIBUTE static FontFNT* create(std::string_view fntFilePath, const Vec2& imageOffset = Vec2::ZERO);
AX_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 * CC_CONTENT_SCALE_FACTOR();
_outlineSize = outline * AX_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 * CC_CONTENT_SCALE_FACTOR());
int fontSizePoints = (int)(64.f * fontSize * AX_CONTENT_SCALE_FACTOR());
if (FT_Set_Char_Size(face, fontSizePoints, fontSizePoints, dpi, dpi))
break;
@ -388,7 +388,7 @@ unsigned char* FontFreeType::getGlyphBitmap(char32_t charCode,
// @remark: glyphIndex=0 means character is missing on current font face
auto glyphIndex = FT_Get_Char_Index(_fontFace, static_cast<FT_ULong>(charCode));
#if defined(COCOS2D_DEBUG) && COCOS2D_DEBUG > 0
#if defined(AXIS_DEBUG) && AXIS_DEBUG > 0
if (glyphIndex == 0)
{
char32_t ntcs[2] = {charCode, (char32_t)0};

View File

@ -42,7 +42,7 @@ typedef struct FT_BBox_ FT_BBox;
NS_AX_BEGIN
class CC_DLL FontFreeType : public Font
class AX_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;
CC_SAFE_RETAIN(_texture);
AX_SAFE_RETAIN(_texture);
_isTextureFlipped = flipped;
#ifdef CC_USE_METAL
#ifdef AX_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();
CC_SAFE_RELEASE(_programState);
AX_SAFE_RELEASE(_programState);
auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE);
_programState = new backend::ProgramState(program);
pipelineDescriptor.programState = _programState;
@ -149,14 +149,14 @@ void GridBase::updateBlendState()
GridBase::~GridBase()
{
CCLOGINFO("deallocing GridBase: %p", this);
AXLOGINFO("deallocing GridBase: %p", this);
CC_SAFE_RELEASE(_renderTarget);
AX_SAFE_RELEASE(_renderTarget);
// TODO: ? why 2.0 comments this line: setActive(false);
CC_SAFE_RELEASE(_texture);
AX_SAFE_RELEASE(_texture);
CC_SAFE_RELEASE(_programState);
AX_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();
CC_SAFE_RELEASE(_renderTarget);
AX_SAFE_RELEASE(_renderTarget);
_renderTarget =
backend::Device::getInstance()->newRenderTarget(TargetBufferFlags::COLOR, _texture->getBackendTexture());
renderer->setRenderTarget(_renderTarget);
@ -344,11 +344,11 @@ Grid3D::Grid3D() {}
Grid3D::~Grid3D()
{
CC_SAFE_FREE(_texCoordinates);
CC_SAFE_FREE(_vertices);
CC_SAFE_FREE(_indices);
CC_SAFE_FREE(_originalVertices);
CC_SAFE_FREE(_vertexBuffer);
AX_SAFE_FREE(_texCoordinates);
AX_SAFE_FREE(_vertices);
AX_SAFE_FREE(_indices);
AX_SAFE_FREE(_originalVertices);
AX_SAFE_FREE(_vertexBuffer);
}
void Grid3D::beforeBlit()
@ -392,11 +392,11 @@ void Grid3D::calculateVertexPoints()
float height = (float)_texture->getPixelsHigh();
float imageH = _texture->getContentSizeInPixels().height;
CC_SAFE_FREE(_vertices);
CC_SAFE_FREE(_originalVertices);
CC_SAFE_FREE(_texCoordinates);
CC_SAFE_FREE(_vertexBuffer);
CC_SAFE_FREE(_indices);
AX_SAFE_FREE(_vertices);
AX_SAFE_FREE(_originalVertices);
AX_SAFE_FREE(_texCoordinates);
AX_SAFE_FREE(_vertexBuffer);
AX_SAFE_FREE(_indices);
size_t numOfPoints = static_cast<size_t>((_gridSize.width + 1) * (_gridSize.height + 1));
@ -470,7 +470,7 @@ void Grid3D::calculateVertexPoints()
Vec3 Grid3D::getVertex(const Vec2& pos) const
{
CCASSERT(pos.x == (unsigned int)pos.x && pos.y == (unsigned int)pos.y, "Numbers must be integers");
AXASSERT(pos.x == (unsigned int)pos.x && pos.y == (unsigned int)pos.y, "Numbers must be integers");
int index = (int)(pos.x * (_gridSize.height + 1) + pos.y) * 3;
float* vertArray = (float*)_vertices;
@ -482,7 +482,7 @@ Vec3 Grid3D::getVertex(const Vec2& pos) const
Vec3 Grid3D::getOriginalVertex(const Vec2& pos) const
{
CCASSERT(pos.x == (unsigned int)pos.x && pos.y == (unsigned int)pos.y, "Numbers must be integers");
AXASSERT(pos.x == (unsigned int)pos.x && pos.y == (unsigned int)pos.y, "Numbers must be integers");
int index = (int)(pos.x * (_gridSize.height + 1) + pos.y) * 3;
float* vertArray = (float*)_originalVertices;
@ -494,7 +494,7 @@ Vec3 Grid3D::getOriginalVertex(const Vec2& pos) const
void Grid3D::setVertex(const Vec2& pos, const Vec3& vertex)
{
CCASSERT(pos.x == (unsigned int)pos.x && pos.y == (unsigned int)pos.y, "Numbers must be integers");
AXASSERT(pos.x == (unsigned int)pos.x && pos.y == (unsigned int)pos.y, "Numbers must be integers");
int index = (int)(pos.x * (_gridSize.height + 1) + pos.y) * 3;
float* vertArray = (float*)_vertices;
vertArray[index] = vertex.x;
@ -552,10 +552,10 @@ void Grid3D::updateVertexAndTexCoordinate()
TiledGrid3D::~TiledGrid3D()
{
CC_SAFE_FREE(_texCoordinates);
CC_SAFE_FREE(_vertices);
CC_SAFE_FREE(_originalVertices);
CC_SAFE_FREE(_indices);
AX_SAFE_FREE(_texCoordinates);
AX_SAFE_FREE(_vertices);
AX_SAFE_FREE(_originalVertices);
AX_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);
CC_SAFE_FREE(_vertices);
CC_SAFE_FREE(_originalVertices);
CC_SAFE_FREE(_texCoordinates);
CC_SAFE_FREE(_indices);
CC_SAFE_FREE(_vertexBuffer);
AX_SAFE_FREE(_vertices);
AX_SAFE_FREE(_originalVertices);
AX_SAFE_FREE(_texCoordinates);
AX_SAFE_FREE(_indices);
AX_SAFE_FREE(_vertexBuffer);
_vertices = malloc(numQuads * 4 * sizeof(Vec3));
_originalVertices = malloc(numQuads * 4 * sizeof(Vec3));
@ -718,7 +718,7 @@ void TiledGrid3D::calculateVertexPoints()
void TiledGrid3D::setTile(const Vec2& pos, const Quad3& coords)
{
CCASSERT(pos.x == (unsigned int)pos.x && pos.y == (unsigned int)pos.y, "Numbers must be integers");
AXASSERT(pos.x == (unsigned int)pos.x && pos.y == (unsigned int)pos.y, "Numbers must be integers");
int idx = (int)(_gridSize.height * pos.x + pos.y) * 4 * 3;
float* vertArray = (float*)_vertices;
memcpy(&vertArray[idx], &coords, sizeof(Quad3));
@ -726,7 +726,7 @@ void TiledGrid3D::setTile(const Vec2& pos, const Quad3& coords)
Quad3 TiledGrid3D::getOriginalTile(const Vec2& pos) const
{
CCASSERT(pos.x == (unsigned int)pos.x && pos.y == (unsigned int)pos.y, "Numbers must be integers");
AXASSERT(pos.x == (unsigned int)pos.x && pos.y == (unsigned int)pos.y, "Numbers must be integers");
int idx = (int)(_gridSize.height * pos.x + pos.y) * 4 * 3;
float* vertArray = (float*)_originalVertices;
@ -738,7 +738,7 @@ Quad3 TiledGrid3D::getOriginalTile(const Vec2& pos) const
Quad3 TiledGrid3D::getTile(const Vec2& pos) const
{
CCASSERT(pos.x == (unsigned int)pos.x && pos.y == (unsigned int)pos.y, "Numbers must be integers");
AXASSERT(pos.x == (unsigned int)pos.x && pos.y == (unsigned int)pos.y, "Numbers must be integers");
int idx = (int)(_gridSize.height * pos.x + pos.y) * 4 * 3;
float* vertArray = (float*)_vertices;

View File

@ -53,7 +53,7 @@ class RenderTarget;
/** Base class for Other grid.
*/
class CC_DLL GridBase : public Ref
class AX_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 CC_DLL Grid3D : public GridBase
class AX_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 CC_DLL TiledGrid3D : public GridBase
class AX_DLL TiledGrid3D : public GridBase
{
public:
/** Create one Grid. */

View File

@ -95,7 +95,7 @@ public:
letter->autorelease();
return letter;
}
CC_SAFE_DELETE(letter);
AX_SAFE_DELETE(letter);
return nullptr;
}
@ -206,9 +206,9 @@ Label::BatchCommand::BatchCommand()
Label::BatchCommand::~BatchCommand()
{
CC_SAFE_RELEASE(textCommand.getPipelineDescriptor().programState);
CC_SAFE_RELEASE(shadowCommand.getPipelineDescriptor().programState);
CC_SAFE_RELEASE(outLineCommand.getPipelineDescriptor().programState);
AX_SAFE_RELEASE(textCommand.getPipelineDescriptor().programState);
AX_SAFE_RELEASE(shadowCommand.getPipelineDescriptor().programState);
AX_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;
CC_SAFE_RELEASE(programStateText);
AX_SAFE_RELEASE(programStateText);
programStateText = programState->clone();
auto& programStateShadow = shadowCommand.getPipelineDescriptor().programState;
CC_SAFE_RELEASE(programStateShadow);
AX_SAFE_RELEASE(programStateShadow);
programStateShadow = programState->clone();
auto& programStateOutline = outLineCommand.getPipelineDescriptor().programState;
CC_SAFE_RELEASE(programStateOutline);
AX_SAFE_RELEASE(programStateOutline);
programStateOutline = programState->clone();
}
@ -274,7 +274,7 @@ Label* Label::createWithTTF(std::string_view text,
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
@ -291,7 +291,7 @@ Label* Label::createWithTTF(const TTFConfig& ttfConfig,
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
@ -508,7 +508,7 @@ Label::Label(TextHAlignment hAlignment /* = TextHAlignment::LEFT */,
_hAlignment = hAlignment;
_vAlignment = vAlignment;
#if CC_LABEL_DEBUG_DRAW
#if AX_LABEL_DEBUG_DRAW
_debugDrawNode = DrawNode::create();
addChild(_debugDrawNode);
#endif
@ -557,7 +557,7 @@ Label::~Label()
if (_fontAtlas)
{
Node::removeAllChildrenWithCleanup(true);
CC_SAFE_RELEASE_NULL(_reusedLetter);
AX_SAFE_RELEASE_NULL(_reusedLetter);
_batchNodes.clear();
FontAtlasCache::releaseFontAtlas(_fontAtlas);
}
@ -565,16 +565,16 @@ Label::~Label()
_eventDispatcher->removeEventListener(_purgeTextureListener);
_eventDispatcher->removeEventListener(_resetTextureListener);
CC_SAFE_RELEASE_NULL(_textSprite);
CC_SAFE_RELEASE_NULL(_shadowNode);
AX_SAFE_RELEASE_NULL(_textSprite);
AX_SAFE_RELEASE_NULL(_shadowNode);
}
void Label::reset()
{
CC_SAFE_RELEASE_NULL(_textSprite);
CC_SAFE_RELEASE_NULL(_shadowNode);
AX_SAFE_RELEASE_NULL(_textSprite);
AX_SAFE_RELEASE_NULL(_shadowNode);
Node::removeAllChildrenWithCleanup(true);
CC_SAFE_RELEASE_NULL(_reusedLetter);
AX_SAFE_RELEASE_NULL(_reusedLetter);
_letters.clear();
_batchNodes.clear();
_batchCommands.clear();
@ -604,7 +604,7 @@ void Label::reset()
_systemFontDirty = false;
_systemFont = "Helvetica";
_systemFontSize = CC_DEFAULT_FONT_LABEL_SIZE;
_systemFontSize = AX_DEFAULT_FONT_LABEL_SIZE;
if (_horizontalKernings)
{
@ -780,7 +780,7 @@ void Label::updateShaderProgram()
void Label::updateBatchCommand(Label::BatchCommand& batch)
{
CCASSERT(_programState, "programState should be set!");
AXASSERT(_programState, "programState should be set!");
batch.setProgramState(_programState);
}
@ -803,7 +803,7 @@ void Label::setFontAtlas(FontAtlas* atlas, bool distanceFieldEnabled /* = false
if (atlas == _fontAtlas)
return;
CC_SAFE_RETAIN(atlas);
AX_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 / CC_CONTENT_SCALE_FACTOR();
_bmFontSize = originalFontSize / AX_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 / CC_CONTENT_SCALE_FACTOR();
_bmFontSize = originalFontSize / AX_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 / CC_CONTENT_SCALE_FACTOR();
_bmFontSize = originalFontSize / AX_CONTENT_SCALE_FACTOR();
}
}
@ -1157,7 +1157,7 @@ bool Label::alignText()
if (fontSize > 0 && isVerticalClamp())
{
this->shrinkLabelToContentSize(CC_CALLBACK_0(Label::isVerticalClamp, this));
this->shrinkLabelToContentSize(AX_CALLBACK_0(Label::isVerticalClamp, this));
}
}
@ -1166,7 +1166,7 @@ bool Label::alignText()
ret = false;
if (_overflow == Overflow::SHRINK)
{
this->shrinkLabelToContentSize(CC_CALLBACK_0(Label::isHorizontalClamp, this));
this->shrinkLabelToContentSize(AX_CALLBACK_0(Label::isHorizontalClamp, this));
}
break;
}
@ -1398,7 +1398,7 @@ void Label::enableGlow(const Color4B& glowColor)
void Label::enableOutline(const Color4B& outlineColor, int outlineSize /* = -1 */)
{
CCASSERT(_currentLabelType == LabelType::STRING_TEXTURE || _currentLabelType == LabelType::TTF,
AXASSERT(_currentLabelType == LabelType::STRING_TEXTURE || _currentLabelType == LabelType::TTF,
"Only supported system font and TTF!");
if (outlineSize > 0 || _currLabelEffect == LabelEffect::OUTLINE)
@ -1543,7 +1543,7 @@ void Label::disableEffect(LabelEffect effect)
if (_shadowEnabled)
{
_shadowEnabled = false;
CC_SAFE_RELEASE_NULL(_shadowNode);
AX_SAFE_RELEASE_NULL(_shadowNode);
updateShaderProgram();
}
break;
@ -1680,7 +1680,7 @@ void Label::updateContent()
{
_batchNodes.clear();
_batchCommands.clear();
CC_SAFE_RELEASE_NULL(_reusedLetter);
AX_SAFE_RELEASE_NULL(_reusedLetter);
FontAtlasCache::releaseFontAtlas(_fontAtlas);
_fontAtlas = nullptr;
}
@ -1688,8 +1688,8 @@ void Label::updateContent()
_systemFontDirty = false;
}
CC_SAFE_RELEASE_NULL(_textSprite);
CC_SAFE_RELEASE_NULL(_shadowNode);
AX_SAFE_RELEASE_NULL(_textSprite);
AX_SAFE_RELEASE_NULL(_shadowNode);
bool updateFinished = true;
if (_fontAtlas)
@ -1760,7 +1760,7 @@ void Label::updateContent()
_contentDirty = false;
}
#if CC_LABEL_DEBUG_DRAW
#if AX_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 CC_USE_CULLING
#if AX_USE_CULLING
auto visitingCamera = Camera::getVisitingCamera();
auto defaultCamera = Camera::getDefaultCamera();
if (visitingCamera == defaultCamera)
@ -2197,7 +2197,7 @@ Sprite* Label::getLetter(int letterIndex)
void Label::setLineHeight(float height)
{
CCASSERT(_currentLabelType != LabelType::STRING_TEXTURE, "Not supported system font!");
AXASSERT(_currentLabelType != LabelType::STRING_TEXTURE, "Not supported system font!");
if (_lineHeight != height)
{
@ -2208,7 +2208,7 @@ void Label::setLineHeight(float height)
float Label::getLineHeight() const
{
CCASSERT(_currentLabelType != LabelType::STRING_TEXTURE, "Not supported system font!");
AXASSERT(_currentLabelType != LabelType::STRING_TEXTURE, "Not supported system font!");
return _textSprite ? 0.0f : _lineHeight * _bmfontScale;
}
@ -2238,12 +2238,12 @@ void Label::setAdditionalKerning(float space)
}
}
else
CCLOG("Label::setAdditionalKerning not supported on LabelType::STRING_TEXTURE");
AXLOG("Label::setAdditionalKerning not supported on LabelType::STRING_TEXTURE");
}
float Label::getAdditionalKerning() const
{
CCASSERT(_currentLabelType != LabelType::STRING_TEXTURE, "Not supported system font!");
AXASSERT(_currentLabelType != LabelType::STRING_TEXTURE, "Not supported system font!");
return _additionalKerning;
}
@ -2356,7 +2356,7 @@ void Label::updateDisplayedOpacity(uint8_t parentOpacity)
// that's fine but it should be documented
void Label::setTextColor(const Color4B& color)
{
CCASSERT(_currentLabelType == LabelType::TTF || _currentLabelType == LabelType::STRING_TEXTURE,
AXASSERT(_currentLabelType == LabelType::TTF || _currentLabelType == LabelType::STRING_TEXTURE,
"Only supported system font and ttf!");
if (_currentLabelType == LabelType::STRING_TEXTURE && _textColor != color)
@ -2502,10 +2502,10 @@ FontDefinition Label::_getFontDefinition() const
systemFontDef._stroke._strokeEnabled = false;
}
#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS)
#if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) && (AX_TARGET_PLATFORM != AX_PLATFORM_IOS)
if (systemFontDef._stroke._strokeEnabled)
{
CCLOGERROR("Stroke Currently only supported on iOS and Android!");
AXLOGERROR("Stroke Currently only supported on iOS and Android!");
}
systemFontDef._stroke._strokeEnabled = false;
#endif
@ -2530,7 +2530,7 @@ void Label::setGlobalZOrder(float globalZOrder)
_underlineNode->setGlobalZOrder(globalZOrder);
}
#if CC_LABEL_DEBUG_DRAW
#if AX_LABEL_DEBUG_DRAW
_debugDrawNode->setGlobalZOrder(globalZOrder);
#endif
}

View File

@ -41,7 +41,7 @@ NS_AX_BEGIN
* @{
*/
#define CC_DEFAULT_FONT_LABEL_SIZE 12
#define AX_DEFAULT_FONT_LABEL_SIZE 12
/**
* @struct TTFConfig
@ -64,7 +64,7 @@ typedef struct _ttfConfig
bool strikethrough;
_ttfConfig(std::string_view filePath = {},
float size = CC_DEFAULT_FONT_LABEL_SIZE,
float size = AX_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 CC_DLL Label : public Node, public LabelProtocol, public BlendProtocol
class AX_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
*/
CC_DEPRECATED_ATTRIBUTE static Label* createWithBMFont(std::string_view bmfontPath,
AX_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 */
CC_DEPRECATED_ATTRIBUTE virtual bool setBMFontFilePath(std::string_view bmfontFilePath,
AX_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 CC_LABEL_DEBUG_DRAW
#if AX_LABEL_DEBUG_DRAW
DrawNode* _debugDrawNode;
#endif
@ -920,7 +920,7 @@ protected:
backend::UniformLocation _effectTypeLocation;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Label);
AX_DISALLOW_COPY_AND_ASSIGN(Label);
};
// end group

View File

@ -32,7 +32,7 @@ THE SOFTWARE.
#include "base/ccUTF8.h"
#include "renderer/CCTextureCache.h"
#if CC_LABELATLAS_DEBUG_DRAW
#if AX_LABELATLAS_DEBUG_DRAW
# include "renderer/CCRenderer.h"
#endif
@ -52,7 +52,7 @@ LabelAtlas* LabelAtlas::create(std::string_view string,
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
@ -91,7 +91,7 @@ LabelAtlas* LabelAtlas::create(std::string_view string, std::string_view fntFile
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
@ -111,7 +111,7 @@ LabelAtlas* LabelAtlas::create(std::string_view string,
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
@ -124,12 +124,12 @@ bool LabelAtlas::initWithString(std::string_view theString, std::string_view fnt
ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(pathStr);
CCASSERT(dict["version"].asInt() == 1, "Unsupported version. Upgrade cocos2d version");
AXASSERT(dict["version"].asInt() == 1, "Unsupported version. Upgrade cocos2d version");
std::string textureFilename = relPathStr + dict["textureFilename"].asString();
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 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 startChar = dict["firstChar"].asInt();
this->initWithString(theString, textureFilename, width, height, startChar);
@ -152,15 +152,15 @@ void LabelAtlas::updateAtlasValues()
Texture2D* texture = _textureAtlas->getTexture();
float textureWide = (float)texture->getPixelsWide();
float textureHigh = (float)texture->getPixelsHigh();
float itemWidthInPixels = _itemWidth * CC_CONTENT_SCALE_FACTOR();
float itemHeightInPixels = _itemHeight * CC_CONTENT_SCALE_FACTOR();
float itemWidthInPixels = _itemWidth * AX_CONTENT_SCALE_FACTOR();
float itemHeightInPixels = _itemHeight * AX_CONTENT_SCALE_FACTOR();
if (_ignoreContentScaleFactor)
{
itemWidthInPixels = static_cast<float>(_itemWidth);
itemHeightInPixels = static_cast<float>(_itemHeight);
}
CCASSERT(n <= _textureAtlas->getCapacity(), "updateAtlasValues: Invalid String length");
AXASSERT(n <= _textureAtlas->getCapacity(), "updateAtlasValues: Invalid String length");
V3F_C4B_T2F_Quad* quads = _textureAtlas->getQuads();
for (ssize_t i = 0; i < n; i++)
{
@ -169,7 +169,7 @@ void LabelAtlas::updateAtlasValues()
float row = (float)(a % _itemsPerRow);
float col = (float)(a / _itemsPerRow);
#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
#if AX_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 // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
#endif // ! AX_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 CC_LABELATLAS_DEBUG_DRAW
#if AX_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 CC_LABELATLAS_DEBUG_DRAW
#if AX_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 CC_DLL LabelAtlas : public AtlasNode, public LabelProtocol
class AX_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 CC_LABELATLAS_DEBUG_DRAW
#if AX_LABELATLAS_DEBUG_DRAW
virtual void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override;
#endif
LabelAtlas()
{
#if CC_LABELATLAS_DEBUG_DRAW
#if AX_LABELATLAS_DEBUG_DRAW
_debugDrawNode = DrawNode::create();
addChild(_debugDrawNode);
#endif
@ -124,7 +124,7 @@ public:
protected:
virtual void updateColor() override;
#if CC_LABELATLAS_DEBUG_DRAW
#if AX_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 = CC_CONTENT_SCALE_FACTOR();
auto contentScaleFactor = AX_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 * CC_CONTENT_SCALE_FACTOR() / originalFontSize;
_bmfontScale = _bmFontSize * AX_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 = CC_CONTENT_SCALE_FACTOR();
auto contentScaleFactor = AX_CONTENT_SCALE_FACTOR();
float lineSpacing = _lineSpacing * contentScaleFactor;
float highestY = 0.f;
float lowestY = 0.f;
@ -212,7 +212,7 @@ bool Label::multilineTextWrap(const std::function<int(const std::u32string&, int
if (!getFontLetterDef(character, letterDef))
{
recordPlaceholderInfo(letterIndex, character);
CCLOG("LabelTextFormatter error: can't find letter definition in font file for letter: 0x%x",
AXLOG("LabelTextFormatter error: can't find letter definition in font file for letter: 0x%x",
character);
continue;
}
@ -318,12 +318,12 @@ bool Label::multilineTextWrap(const std::function<int(const std::u32string&, int
bool Label::multilineTextWrapByWord()
{
return multilineTextWrap(CC_CALLBACK_3(Label::getFirstWordLen, this));
return multilineTextWrap(AX_CALLBACK_3(Label::getFirstWordLen, this));
}
bool Label::multilineTextWrapByChar()
{
return multilineTextWrap(CC_CALLBACK_3(Label::getFirstCharLen, this));
return multilineTextWrap(AX_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 (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC)
# include "platform/desktop/CCGLViewImpl-desktop.h"
#endif
@ -72,7 +72,7 @@ LayerColor* LayerColor::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -85,7 +85,7 @@ LayerColor* LayerColor::create(const Color4B& color, float width, float height)
layer->autorelease();
return layer;
}
CC_SAFE_DELETE(layer);
AX_SAFE_DELETE(layer);
return nullptr;
}
@ -97,7 +97,7 @@ LayerColor* LayerColor::create(const Color4B& color)
layer->autorelease();
return layer;
}
CC_SAFE_DELETE(layer);
AX_SAFE_DELETE(layer);
return nullptr;
}
@ -162,7 +162,7 @@ LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end)
layer->autorelease();
return layer;
}
CC_SAFE_DELETE(layer);
AX_SAFE_DELETE(layer);
return nullptr;
}
@ -174,7 +174,7 @@ LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end, c
layer->autorelease();
return layer;
}
CC_SAFE_DELETE(layer);
AX_SAFE_DELETE(layer);
return nullptr;
}
@ -187,7 +187,7 @@ LayerGradient* LayerGradient::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -406,7 +406,7 @@ LayerRadialGradient::LayerRadialGradient()
LayerRadialGradient::~LayerRadialGradient()
{
CC_SAFE_RELEASE_NULL(_customCommand.getPipelineDescriptor().programState);
AX_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);
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
@ -621,7 +621,7 @@ LayerMultiplex* LayerMultiplex::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -635,20 +635,20 @@ LayerMultiplex* LayerMultiplex::createWithArray(const Vector<Node*>& arrayOfLaye
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
void LayerMultiplex::addLayer(Node* layer)
{
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->retainScriptObject(this, layer);
}
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_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 CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->retainScriptObject(this, layer);
}
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
_layers.pushBack(layer);
Node* l = va_arg(params, Node*);
while (l)
{
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
if (sEngine)
{
sEngine->retainScriptObject(this, l);
}
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_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 CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
@ -713,7 +713,7 @@ bool LayerMultiplex::initWithArray(const Vector<Node*>& arrayOfLayers)
}
}
}
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
_layers.reserve(arrayOfLayers.size());
_layers.pushBack(arrayOfLayers);
@ -732,7 +732,7 @@ void LayerMultiplex::switchTo(int n)
void LayerMultiplex::switchTo(int n, bool cleanup)
{
CCASSERT(n < _layers.size(), "Invalid index in MultiplexLayer switchTo message");
AXASSERT(n < _layers.size(), "Invalid index in MultiplexLayer switchTo message");
this->removeChild(_layers.at(_enabledLayer), cleanup);
@ -743,16 +743,16 @@ void LayerMultiplex::switchTo(int n, bool cleanup)
void LayerMultiplex::switchToAndReleaseMe(int n)
{
CCASSERT(n < _layers.size(), "Invalid index in MultiplexLayer switchTo message");
AXASSERT(n < _layers.size(), "Invalid index in MultiplexLayer switchTo message");
this->removeChild(_layers.at(_enabledLayer), true);
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->releaseScriptObject(this, _layers.at(_enabledLayer));
}
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_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 CC_DLL Layer : public Node
class AX_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 CC_DLL LayerColor : public Sprite
class AX_DLL LayerColor : public Sprite
{
public:
@ -103,7 +103,7 @@ public:
bool initWithColor(const Color4B& color);
private:
CC_DISALLOW_COPY_AND_ASSIGN(LayerColor);
AX_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 CC_DLL LayerGradient : public LayerColor
class AX_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 CC_DLL LayerRadialGradient : public Node, BlendProtocol
class AX_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 CC_DLL LayerMultiplex : public Node
class AX_DLL LayerMultiplex : public Node
{
public:
/** Creates and initializes a LayerMultiplex object.
@ -439,7 +439,7 @@ protected:
Vector<Node*> _layers;
private:
CC_DISALLOW_COPY_AND_ASSIGN(LayerMultiplex);
AX_DISALLOW_COPY_AND_ASSIGN(LayerMultiplex);
};
// end of _2d group

View File

@ -29,7 +29,7 @@ NS_AX_BEGIN
void BaseLight::setIntensity(float intensity)
{
CC_ASSERT(intensity >= 0);
AX_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 = CC_RADIANS_TO_DEGREES(atan2f(-direction.x, -direction.z));
float rotX = -CC_RADIANS_TO_DEGREES(atan2f(-direction.y, projLen));
float rotY = AX_RADIANS_TO_DEGREES(atan2f(-direction.x, -direction.z));
float rotX = -AX_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 CC_DLL BaseLight : public Node
class AX_DLL BaseLight : public Node
{
public:
/**
@ -103,7 +103,7 @@ protected:
/**
@js NA
*/
class CC_DLL DirectionLight : public BaseLight
class AX_DLL DirectionLight : public BaseLight
{
public:
/**
@ -142,7 +142,7 @@ public:
/**
@js NA
*/
class CC_DLL PointLight : public BaseLight
class AX_DLL PointLight : public BaseLight
{
public:
/**
@ -172,7 +172,7 @@ protected:
/**
@js NA
*/
class CC_DLL SpotLight : public BaseLight
class AX_DLL SpotLight : public BaseLight
{
public:
/**
@ -270,7 +270,7 @@ protected:
/**
@js NA
*/
class CC_DLL AmbientLight : public BaseLight
class AX_DLL AmbientLight : public BaseLight
{
public:
/**

View File

@ -50,7 +50,7 @@ enum
Menu::~Menu()
{
CCLOGINFO("In the destructor of Menu. %p", this);
AXLOGINFO("In the destructor of Menu. %p", this);
}
Menu* Menu::create()
@ -79,7 +79,7 @@ Menu* Menu::createWithArray(const Vector<MenuItem*>& arrayOfItems)
}
else
{
CC_SAFE_DELETE(ret);
AX_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 = 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);
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);
_eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this);
@ -171,13 +171,13 @@ void Menu::addChild(Node* child, int zOrder)
void Menu::addChild(Node* child, int zOrder, int tag)
{
CCASSERT(dynamic_cast<MenuItem*>(child) != nullptr, "Menu only supports MenuItem objects as children");
AXASSERT(dynamic_cast<MenuItem*>(child) != nullptr, "Menu only supports MenuItem objects as children");
Node::addChild(child, zOrder, tag);
}
void Menu::addChild(Node* child, int zOrder, std::string_view name)
{
CCASSERT(dynamic_cast<MenuItem*>(child) != nullptr, "Menu only supports MenuItem objects as children");
AXASSERT(dynamic_cast<MenuItem*>(child) != nullptr, "Menu only supports MenuItem objects as children");
Node::addChild(child, zOrder, name);
}
@ -204,7 +204,7 @@ void Menu::onExit()
void Menu::removeChild(Node* child, bool cleanup)
{
CCASSERT(dynamic_cast<MenuItem*>(child) != nullptr, "Menu only supports MenuItem objects as children");
AXASSERT(dynamic_cast<MenuItem*>(child) != nullptr, "Menu only supports MenuItem objects as children");
if (_selectedItem == child)
{
@ -247,7 +247,7 @@ bool Menu::onTouchBegan(Touch* touch, Event* /*event*/)
void Menu::onTouchEnded(Touch* /*touch*/, Event* /*event*/)
{
CCASSERT(_state == Menu::State::TRACKING_TOUCH, "[Menu ccTouchEnded] -- invalid state");
AXASSERT(_state == Menu::State::TRACKING_TOUCH, "[Menu ccTouchEnded] -- invalid state");
this->retain();
if (_selectedItem)
{
@ -261,7 +261,7 @@ void Menu::onTouchEnded(Touch* /*touch*/, Event* /*event*/)
void Menu::onTouchCancelled(Touch* /*touch*/, Event* /*event*/)
{
CCASSERT(_state == Menu::State::TRACKING_TOUCH, "[Menu ccTouchCancelled] -- invalid state");
AXASSERT(_state == Menu::State::TRACKING_TOUCH, "[Menu ccTouchCancelled] -- invalid state");
this->retain();
if (_selectedItem)
{
@ -273,7 +273,7 @@ void Menu::onTouchCancelled(Touch* /*touch*/, Event* /*event*/)
void Menu::onTouchMoved(Touch* touch, Event* /*event*/)
{
CCASSERT(_state == Menu::State::TRACKING_TOUCH, "[Menu ccTouchMoved] -- invalid state");
AXASSERT(_state == Menu::State::TRACKING_TOUCH, "[Menu ccTouchMoved] -- invalid state");
MenuItem* currentItem = this->getItemForTouch(touch, _selectedWithCamera);
if (currentItem != _selectedItem)
{
@ -343,7 +343,7 @@ void Menu::alignItemsInColumns(int columns, ...)
void Menu::alignItemsInColumns(int columns, va_list args)
{
CCASSERT(columns >= 0, "Columns must be >= 0");
AXASSERT(columns >= 0, "Columns must be >= 0");
ValueVector rows;
while (columns)
{
@ -363,11 +363,11 @@ void Menu::alignItemsInColumnsWithArray(const ValueVector& rows)
for (const auto& child : _children)
{
CCASSERT(row < rows.size(), "row should less than rows.size()!");
AXASSERT(row < rows.size(), "row should less than rows.size()!");
rowColumns = rows[row].asInt();
// can not have zero columns on a row
CCASSERT(rowColumns, "rowColumns can't be 0.");
AXASSERT(rowColumns, "rowColumns can't be 0.");
float tmp = child->getContentSize().height;
rowHeight = (unsigned int)((rowHeight >= tmp || isnan(tmp)) ? rowHeight : tmp);
@ -384,7 +384,7 @@ void Menu::alignItemsInColumnsWithArray(const ValueVector& rows)
}
// check if too many rows/columns for available menu items
CCASSERT(!columnsOccupied, "columnsOccupied should be 0.");
AXASSERT(!columnsOccupied, "columnsOccupied should be 0.");
Vec2 winSize = getContentSize();
@ -460,11 +460,11 @@ void Menu::alignItemsInRowsWithArray(const ValueVector& columns)
for (const auto& child : _children)
{
// check if too many menu items for the amount of rows/columns
CCASSERT(column < columns.size(), "column should be less than columns.size().");
AXASSERT(column < columns.size(), "column should be less than columns.size().");
columnRows = columns[column].asInt();
// can't have zero rows on a column
CCASSERT(columnRows, "columnRows can't be 0.");
AXASSERT(columnRows, "columnRows can't be 0.");
// columnWidth = fmaxf(columnWidth, [item contentSize].width);
float tmp = child->getContentSize().width;
@ -487,7 +487,7 @@ void Menu::alignItemsInRowsWithArray(const ValueVector& columns)
}
// check if too many rows/columns for available menu items.
CCASSERT(!rowsOccupied, "rowsOccupied should be 0.");
AXASSERT(!rowsOccupied, "rowsOccupied should be 0.");
Vec2 winSize = getContentSize();

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 CC_DLL Menu : public Node
class AX_DLL Menu : public Node
{
public:
/**
@ -63,7 +63,7 @@ public:
static Menu* create();
/** Creates a Menu with MenuItem objects. */
static Menu* create(MenuItem* item, ...) CC_REQUIRES_NULL_TERMINATION;
static Menu* create(MenuItem* item, ...) AX_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, ...) CC_REQUIRES_NULL_TERMINATION;
void alignItemsInColumns(int columns, ...) AX_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, ...) CC_REQUIRES_NULL_TERMINATION;
void alignItemsInRows(int rows, ...) AX_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:
CC_DISALLOW_COPY_AND_ASSIGN(Menu);
AX_DISALLOW_COPY_AND_ASSIGN(Menu);
};
// end of _2d group

View File

@ -88,7 +88,7 @@ void MenuItem::activate()
{
_callback(this);
}
#if CC_ENABLE_SCRIPT_BINDING
#if AX_ENABLE_SCRIPT_BINDING
BasicScriptData data(this);
ScriptEvent scriptEvent(kMenuClickedEvent, &data);
ScriptEngineManager::sendEventToLua(scriptEvent);
@ -289,7 +289,7 @@ bool MenuItemAtlasFont::initWithString(std::string_view value,
char startCharMap,
const ccMenuCallback& callback)
{
CCASSERT(value.size() != 0, "value length must be greater than 0");
AXASSERT(value.size() != 0, "value length must be greater than 0");
LabelAtlas* label = LabelAtlas::create(value, charMapFile, itemWidth, itemHeight, startCharMap);
if (MenuItemLabel::initWithLabel(label, callback))
{
@ -347,12 +347,12 @@ MenuItemFont::MenuItemFont() : _fontSize(0), _fontName("") {}
MenuItemFont::~MenuItemFont()
{
CCLOGINFO("In the destructor of MenuItemFont (%p).", this);
AXLOGINFO("In the destructor of MenuItemFont (%p).", this);
}
bool MenuItemFont::initWithString(std::string_view value, const ccMenuCallback& callback)
{
CCASSERT(!value.empty(), "Value length must be greater than 0");
AXASSERT(!value.empty(), "Value length must be greater than 0");
_fontName = _globalFontName;
_fontSize = _globalFontSize;
@ -591,7 +591,7 @@ MenuItemImage* MenuItemImage::create()
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
@ -623,7 +623,7 @@ MenuItemImage* MenuItemImage::create(std::string_view normalImage,
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
@ -637,7 +637,7 @@ MenuItemImage* MenuItemImage::create(std::string_view normalImage,
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
AX_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 CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
@ -706,7 +706,7 @@ MenuItemToggle* MenuItemToggle::createWithCallback(const ccMenuCallback& callbac
}
}
}
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_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 CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
while (i)
{
z++;
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
if (sEngine)
{
sEngine->retainScriptObject(this, i);
}
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_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 CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->retainScriptObject(this, item);
}
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
_subItems.pushBack(item);
}
@ -801,7 +801,7 @@ void MenuItemToggle::cleanup()
{
for (const auto& item : _subItems)
{
#if defined(CC_NATIVE_CONTROL_SCRIPT) && !CC_NATIVE_CONTROL_SCRIPT
#if defined(AX_NATIVE_CONTROL_SCRIPT) && !AX_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 CC_DLL MenuItem : public Node
class AX_DLL MenuItem : public Node
{
public:
/** Creates a MenuItem with no target/selector. */
@ -113,7 +113,7 @@ protected:
ccMenuCallback _callback;
private:
CC_DISALLOW_COPY_AND_ASSIGN(MenuItem);
AX_DISALLOW_COPY_AND_ASSIGN(MenuItem);
};
/** @brief An abstract class for "label" MenuItemLabel items.
@ -124,7 +124,7 @@ private:
- LabelTTF
- Label
*/
class CC_DLL MenuItemLabel : public MenuItem
class AX_DLL MenuItemLabel : public MenuItem
{
public:
/** Creates a MenuItemLabel with a Label and a callback. */
@ -180,13 +180,13 @@ protected:
Node* _label;
private:
CC_DISALLOW_COPY_AND_ASSIGN(MenuItemLabel);
AX_DISALLOW_COPY_AND_ASSIGN(MenuItemLabel);
};
/** @brief A MenuItemAtlasFont.
Helper class that creates a MenuItemLabel class with a LabelAtlas.
*/
class CC_DLL MenuItemAtlasFont : public MenuItemLabel
class AX_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:
CC_DISALLOW_COPY_AND_ASSIGN(MenuItemAtlasFont);
AX_DISALLOW_COPY_AND_ASSIGN(MenuItemAtlasFont);
};
/** @brief A MenuItemFont.
Helper class that creates a MenuItemLabel class with a Label.
*/
class CC_DLL MenuItemFont : public MenuItemLabel
class AX_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:
CC_DISALLOW_COPY_AND_ASSIGN(MenuItemFont);
AX_DISALLOW_COPY_AND_ASSIGN(MenuItemFont);
};
/** @brief MenuItemSprite accepts Node<RGBAProtocol> objects as items.
@ -303,7 +303,7 @@ private:
@since v0.8.0
*/
class CC_DLL MenuItemSprite : public MenuItem
class AX_DLL MenuItemSprite : public MenuItem
{
public:
/** Creates a menu item with a normal, selected and disabled image.*/
@ -365,7 +365,7 @@ protected:
Node* _disabledImage;
private:
CC_DISALLOW_COPY_AND_ASSIGN(MenuItemSprite);
AX_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 CC_DLL MenuItemImage : public MenuItemSprite
class AX_DLL MenuItemImage : public MenuItemSprite
{
public:
/** Creates an MenuItemImage. */
@ -423,14 +423,14 @@ public:
const ccMenuCallback& callback);
private:
CC_DISALLOW_COPY_AND_ASSIGN(MenuItemImage);
AX_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 CC_DLL MenuItemToggle : public MenuItem
class AX_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,
...) CC_REQUIRES_NULL_TERMINATION;
...) AX_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:
CC_DISALLOW_COPY_AND_ASSIGN(MenuItemToggle);
AX_DISALLOW_COPY_AND_ASSIGN(MenuItemToggle);
};
// end of 2d group

View File

@ -44,12 +44,12 @@ MotionStreak::MotionStreak()
MotionStreak::~MotionStreak()
{
CC_SAFE_RELEASE(_texture);
CC_SAFE_FREE(_pointState);
CC_SAFE_FREE(_pointVertexes);
CC_SAFE_FREE(_vertices);
CC_SAFE_FREE(_colorPointer);
CC_SAFE_FREE(_texCoords);
AX_SAFE_RELEASE(_texture);
AX_SAFE_FREE(_pointState);
AX_SAFE_FREE(_pointVertexes);
AX_SAFE_FREE(_vertices);
AX_SAFE_FREE(_colorPointer);
AX_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;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
@ -74,13 +74,13 @@ MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return nullptr;
}
bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const Color3B& color, std::string_view path)
{
CCASSERT(!path.empty(), "Invalid filename");
AXASSERT(!path.empty(), "Invalid filename");
Texture2D* texture = _director->getTextureCache()->addImage(path);
return initWithFade(fade, minSeg, stroke, color, texture);
@ -215,8 +215,8 @@ void MotionStreak::setTexture(Texture2D* texture)
{
if (_texture != texture)
{
CC_SAFE_RETAIN(texture);
CC_SAFE_RELEASE(_texture);
AX_SAFE_RETAIN(texture);
AX_SAFE_RELEASE(_texture);
_texture = texture;
setProgramStateWithRegistry(backend::ProgramType::POSITION_TEXTURE_COLOR, _texture);
@ -227,7 +227,7 @@ bool MotionStreak::setProgramState(backend::ProgramState* programState, bool nee
{
if (Node::setProgramState(programState, needsRetain))
{
CCASSERT(programState, "argument should not be nullptr");
AXASSERT(programState, "argument should not be nullptr");
auto& pipelineDescriptor = _customCommand.getPipelineDescriptor();
pipelineDescriptor.programState = _programState;
@ -273,12 +273,12 @@ const BlendFunc& MotionStreak::getBlendFunc() const
void MotionStreak::setOpacity(uint8_t /*opacity*/)
{
CCASSERT(false, "Set opacity no supported");
AXASSERT(false, "Set opacity no supported");
}
uint8_t MotionStreak::getOpacity() const
{
CCASSERT(false, "Opacity no supported");
AXASSERT(false, "Opacity no supported");
return 0;
}

View File

@ -42,7 +42,7 @@ class Texture2D;
/** @class MotionStreak.
* @brief Creates a trailing path.
*/
class CC_DLL MotionStreak : public Node, public TextureProtocol
class AX_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:
CC_DISALLOW_COPY_AND_ASSIGN(MotionStreak);
AX_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 CC_NODE_RENDER_SUBPIXEL
#if AX_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 CC_HASH_NODE_NAME(name) (!name.empty() ? XXH3_64bits(name.data(), name.length()) : 0)
#define AX_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 CC_ENABLE_SCRIPT_BINDING
#if AX_ENABLE_SCRIPT_BINDING
, _scriptHandler(0)
, _updateScriptHandler(0)
#endif
@ -123,7 +123,7 @@ Node::Node()
, _onExitCallback(nullptr)
, _onEnterTransitionDidFinishCallback(nullptr)
, _onExitTransitionDidStartCallback(nullptr)
#if CC_USE_PHYSICS
#if AX_USE_PHYSICS
, _physicsBody(nullptr)
#endif
{
@ -148,18 +148,18 @@ Node* Node::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
Node::~Node()
{
CCLOGINFO("deallocing Node: %p - tag: %i", this, _tag);
AXLOGINFO("deallocing Node: %p - tag: %i", this, _tag);
CC_SAFE_DELETE(_childrenIndexer);
AX_SAFE_DELETE(_childrenIndexer);
#if CC_ENABLE_SCRIPT_BINDING
#if AX_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
// `CC_SAFE_RELEASE_NULL(_actionManager)`.
CC_SAFE_RELEASE_NULL(_userObject);
// `AX_SAFE_RELEASE_NULL(_actionManager)`.
AX_SAFE_RELEASE_NULL(_userObject);
for (auto& child : _children)
{
@ -178,26 +178,26 @@ Node::~Node()
removeAllComponents();
CC_SAFE_DELETE(_componentContainer);
AX_SAFE_DELETE(_componentContainer);
stopAllActions();
unscheduleAllCallbacks();
CC_SAFE_RELEASE_NULL(_actionManager);
CC_SAFE_RELEASE_NULL(_scheduler);
AX_SAFE_RELEASE_NULL(_actionManager);
AX_SAFE_RELEASE_NULL(_scheduler);
_eventDispatcher->removeEventListenersForTarget(this);
#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0
#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS && AXIS_DEBUG > 0
_eventDispatcher->debugCheckNodeHasNoEventListenersOnDestruction(this);
#endif
CCASSERT(!_running,
AXASSERT(!_running,
"Node still marked as running on node destruction! Was base class onExit() called in derived class "
"onExit() implementations?");
CC_SAFE_RELEASE(_eventDispatcher);
AX_SAFE_RELEASE(_eventDispatcher);
delete[] _additionalTransform;
CC_SAFE_RELEASE(_programState);
AX_SAFE_RELEASE(_programState);
}
bool Node::init()
@ -214,9 +214,9 @@ bool Node::initLayer() {
void Node::cleanup()
{
#if CC_ENABLE_SCRIPT_BINDING
#if AX_ENABLE_SCRIPT_BINDING
ScriptEngineManager::sendNodeEventToLua(this, kNodeOnCleanup);
#endif // #if CC_ENABLE_SCRIPT_BINDING
#endif // #if AX_ENABLE_SCRIPT_BINDING
// actions
this->stopAllActions();
@ -310,7 +310,7 @@ void Node::setGlobalZOrder(float globalZOrder)
/// rotation getter
float Node::getRotation() const
{
CCASSERT(_rotationZ_X == _rotationZ_Y, "CCNode#rotation. RotationX != RotationY. Don't know which one to return");
AXASSERT(_rotationZ_X == _rotationZ_Y, "CCNode#rotation. RotationX != RotationY. Don't know which one to return");
return _rotationZ_X;
}
@ -350,7 +350,7 @@ void Node::setRotation3D(const Vec3& rotation)
Vec3 Node::getRotation3D() const
{
// rotation Z is decomposed in 2 to simulate Skew for Flash animations
CCASSERT(_rotationZ_X == _rotationZ_Y, "_rotationZ_X != _rotationZ_Y");
AXASSERT(_rotationZ_X == _rotationZ_Y, "_rotationZ_X != _rotationZ_Y");
return Vec3(_rotationX, _rotationY, _rotationZ_X);
}
@ -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 = 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 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 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 = CC_RADIANS_TO_DEGREES(_rotationX);
_rotationY = CC_RADIANS_TO_DEGREES(_rotationY);
_rotationZ_X = _rotationZ_Y = -CC_RADIANS_TO_DEGREES(_rotationZ_X);
_rotationX = AX_RADIANS_TO_DEGREES(_rotationX);
_rotationY = AX_RADIANS_TO_DEGREES(_rotationY);
_rotationZ_X = _rotationZ_Y = -AX_RADIANS_TO_DEGREES(_rotationZ_X);
}
void Node::setRotationQuat(const Quaternion& quat)
@ -427,7 +427,7 @@ void Node::setRotationSkewY(float rotationY)
/// scale getter
float Node::getScale() const
{
CCASSERT(_scaleX == _scaleY, "CCNode#scale. ScaleX != ScaleY. Don't know which one to return");
AXASSERT(_scaleX == _scaleY, "CCNode#scale. ScaleX != ScaleY. Don't know which one to return");
return _scaleX;
}
@ -727,11 +727,11 @@ void Node::updateParentChildrenIndexer(int tag)
void Node::updateParentChildrenIndexer(std::string_view name)
{
uint64_t newHash = CC_HASH_NODE_NAME(name);
uint64_t newHash = AX_HASH_NODE_NAME(name);
auto parentChildrenIndexer = getParentChildrenIndexer();
if (parentChildrenIndexer)
{
auto oldHash = CC_HASH_NODE_NAME(_name);
auto oldHash = AX_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 CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_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 // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
CC_SAFE_RETAIN(userObject);
CC_SAFE_RELEASE(_userObject);
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
AX_SAFE_RETAIN(userObject);
AX_SAFE_RELEASE(_userObject);
_userObject = userObject;
}
@ -808,7 +808,7 @@ void Node::childrenAlloc()
Node* Node::getChildByTag(int tag) const
{
CCASSERT(tag != Node::INVALID_TAG, "Invalid tag");
AXASSERT(tag != Node::INVALID_TAG, "Invalid tag");
if (_childrenIndexer)
{
@ -827,8 +827,8 @@ Node* Node::getChildByTag(int tag) const
Node* Node::getChildByName(std::string_view name) const
{
// CCASSERT(!name.empty(), "Invalid name");
auto hash = CC_HASH_NODE_NAME(name);
// AXASSERT(!name.empty(), "Invalid name");
auto hash = AX_HASH_NODE_NAME(name);
if (_childrenIndexer)
{
auto it = _childrenIndexer->find(hash);
@ -847,8 +847,8 @@ Node* Node::getChildByName(std::string_view name) const
void Node::enumerateChildren(std::string_view name, std::function<bool(Node*)> callback) const
{
CCASSERT(!name.empty(), "Invalid name");
CCASSERT(callback != nullptr, "Invalid callback function");
AXASSERT(!name.empty(), "Invalid name");
AXASSERT(callback != nullptr, "Invalid callback function");
size_t length = name.length();
@ -968,16 +968,16 @@ bool Node::doEnumerate(std::string name, std::function<bool(Node*)> callback) co
*/
void Node::addChild(Node* child, int localZOrder, int tag)
{
CCASSERT(child != nullptr, "Argument must be non-nil");
CCASSERT(child->_parent == nullptr, "child already added. It can't be added again");
AXASSERT(child != nullptr, "Argument must be non-nil");
AXASSERT(child->_parent == nullptr, "child already added. It can't be added again");
addChildHelper(child, localZOrder, tag, "", true);
}
void Node::addChild(Node* child, int localZOrder, std::string_view name)
{
CCASSERT(child != nullptr, "Argument must be non-nil");
CCASSERT(child->_parent == nullptr, "child already added. It can't be added again");
AXASSERT(child != nullptr, "Argument must be non-nil");
AXASSERT(child->_parent == nullptr, "child already added. It can't be added again");
addChildHelper(child, localZOrder, INVALID_TAG, name, false);
}
@ -993,7 +993,7 @@ void Node::addChildHelper(Node* child, int localZOrder, int tag, std::string_vie
});
(void)assertNotSelfChild;
CCASSERT(assertNotSelfChild(), "A node cannot be the child of his own children");
AXASSERT(assertNotSelfChild(), "A node cannot be the child of his own children");
if (_children.empty())
{
@ -1046,13 +1046,13 @@ void Node::addChildHelper(Node* child, int localZOrder, int tag, std::string_vie
void Node::addChild(Node* child, int zOrder)
{
CCASSERT(child != nullptr, "Argument must be non-nil");
AXASSERT(child != nullptr, "Argument must be non-nil");
this->addChild(child, zOrder, child->_name);
}
void Node::addChild(Node* child)
{
CCASSERT(child != nullptr, "Argument must be non-nil");
AXASSERT(child != nullptr, "Argument must be non-nil");
this->addChild(child, child->getLocalZOrder(), child->_name);
}
@ -1082,19 +1082,19 @@ void Node::removeChild(Node* child, bool cleanup /* = true */)
}
ssize_t index = _children.getIndex(child);
if (index != CC_INVALID_INDEX)
if (index != AX_INVALID_INDEX)
this->detachChild(child, index, cleanup);
}
void Node::removeChildByTag(int tag, bool cleanup /* = true */)
{
CCASSERT(tag != Node::INVALID_TAG, "Invalid tag");
AXASSERT(tag != Node::INVALID_TAG, "Invalid tag");
Node* child = this->getChildByTag(tag);
if (child == nullptr)
{
CCLOG("cocos2d: removeChildByTag(tag = %d): child not found!", tag);
AXLOG("cocos2d: removeChildByTag(tag = %d): child not found!", tag);
}
else
{
@ -1104,13 +1104,13 @@ void Node::removeChildByTag(int tag, bool cleanup /* = true */)
void Node::removeChildByName(std::string_view name, bool cleanup)
{
CCASSERT(!name.empty(), "Invalid name");
AXASSERT(!name.empty(), "Invalid name");
Node* child = this->getChildByName(name);
if (child == nullptr)
{
CCLOG("cocos2d: removeChildByName(name = %s): child not found!", name.data());
AXLOG("cocos2d: removeChildByName(name = %s): child not found!", name.data());
}
else
{
@ -1132,7 +1132,7 @@ void Node::removeAllChildrenWithCleanup(bool cleanup)
}
_children.clear();
CC_SAFE_DELETE(_childrenIndexer);
AX_SAFE_DELETE(_childrenIndexer);
}
void Node::resetChild(Node* child, bool cleanup)
@ -1152,13 +1152,13 @@ void Node::resetChild(Node* child, bool cleanup)
child->cleanup();
}
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->releaseScriptObject(this, child);
}
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_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 CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->retainScriptObject(this, child);
}
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
_transformUpdated = true;
_reorderChildDirty = true;
_children.pushBack(child);
@ -1193,7 +1193,7 @@ void Node::insertChild(Node* child, int z)
void Node::reorderChild(Node* child, int zOrder)
{
CCASSERT(child != nullptr, "Child must be non-nil");
AXASSERT(child != nullptr, "Child must be non-nil");
_reorderChildDirty = true;
child->updateOrderOfArrival();
child->_setLocalZOrder(zOrder);
@ -1230,7 +1230,7 @@ uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFl
{
if (_usingNormalizedPosition)
{
CCASSERT(_parent, "setPositionNormalized() doesn't work with orphan nodes");
AXASSERT(_parent, "setPositionNormalized() doesn't work with orphan nodes");
if ((parentFlags & FLAGS_CONTENT_SIZE_DIRTY) || _normalizedPositionDirty)
{
auto& s = _parent->getContentSize();
@ -1350,7 +1350,7 @@ void Node::onEnter()
_running = true;
#if CC_ENABLE_SCRIPT_BINDING
#if AX_ENABLE_SCRIPT_BINDING
ScriptEngineManager::sendNodeEventToLua(this, kNodeOnEnter);
#endif
}
@ -1364,7 +1364,7 @@ void Node::onEnterTransitionDidFinish()
for (const auto& child : _children)
child->onEnterTransitionDidFinish();
#if CC_ENABLE_SCRIPT_BINDING
#if AX_ENABLE_SCRIPT_BINDING
ScriptEngineManager::sendNodeEventToLua(this, kNodeOnEnterTransitionDidFinish);
#endif
}
@ -1377,7 +1377,7 @@ void Node::onExitTransitionDidStart()
for (const auto& child : _children)
child->onExitTransitionDidStart();
#if CC_ENABLE_SCRIPT_BINDING
#if AX_ENABLE_SCRIPT_BINDING
ScriptEngineManager::sendNodeEventToLua(this, kNodeOnExitTransitionDidStart);
#endif
}
@ -1404,7 +1404,7 @@ void Node::onExit()
for (const auto& child : _children)
child->onExit();
#if CC_ENABLE_SCRIPT_BINDING
#if AX_ENABLE_SCRIPT_BINDING
ScriptEngineManager::sendNodeEventToLua(this, kNodeOnExit);
#endif
}
@ -1414,8 +1414,8 @@ void Node::setEventDispatcher(EventDispatcher* dispatcher)
if (dispatcher != _eventDispatcher)
{
_eventDispatcher->removeEventListenersForTarget(this);
CC_SAFE_RETAIN(dispatcher);
CC_SAFE_RELEASE(_eventDispatcher);
AX_SAFE_RETAIN(dispatcher);
AX_SAFE_RELEASE(_eventDispatcher);
_eventDispatcher = dispatcher;
}
}
@ -1425,8 +1425,8 @@ void Node::setActionManager(ActionManager* actionManager)
if (actionManager != _actionManager)
{
this->stopAllActions();
CC_SAFE_RETAIN(actionManager);
CC_SAFE_RELEASE(_actionManager);
AX_SAFE_RETAIN(actionManager);
AX_SAFE_RELEASE(_actionManager);
_actionManager = actionManager;
}
}
@ -1435,7 +1435,7 @@ void Node::setActionManager(ActionManager* actionManager)
Action* Node::runAction(Action* action)
{
CCASSERT(action != nullptr, "Argument must be non-nil");
AXASSERT(action != nullptr, "Argument must be non-nil");
_actionManager->addAction(action, this, !_running);
return action;
}
@ -1452,13 +1452,13 @@ void Node::stopAction(Action* action)
void Node::stopActionByTag(int tag)
{
CCASSERT(tag != Action::INVALID_TAG, "Invalid tag");
AXASSERT(tag != Action::INVALID_TAG, "Invalid tag");
_actionManager->removeActionByTag(tag, this);
}
void Node::stopAllActionsByTag(int tag)
{
CCASSERT(tag != Action::INVALID_TAG, "Invalid tag");
AXASSERT(tag != Action::INVALID_TAG, "Invalid tag");
_actionManager->removeAllActionsByTag(tag, this);
}
@ -1472,7 +1472,7 @@ void Node::stopActionsByFlags(unsigned int flags)
Action* Node::getActionByTag(int tag)
{
CCASSERT(tag != Action::INVALID_TAG, "Invalid tag");
AXASSERT(tag != Action::INVALID_TAG, "Invalid tag");
return _actionManager->getActionByTag(tag, this);
}
@ -1493,8 +1493,8 @@ void Node::setScheduler(Scheduler* scheduler)
if (scheduler != _scheduler)
{
this->unscheduleAllCallbacks();
CC_SAFE_RETAIN(scheduler);
CC_SAFE_RELEASE(_scheduler);
AX_SAFE_RETAIN(scheduler);
AX_SAFE_RELEASE(_scheduler);
_scheduler = scheduler;
}
}
@ -1523,7 +1523,7 @@ void Node::scheduleUpdateWithPriorityLua(int nHandler, int priority)
{
unscheduleUpdate();
#if CC_ENABLE_SCRIPT_BINDING
#if AX_ENABLE_SCRIPT_BINDING
_updateScriptHandler = nHandler;
#endif
@ -1534,7 +1534,7 @@ void Node::unscheduleUpdate()
{
_scheduler->unscheduleUpdate(this);
#if CC_ENABLE_SCRIPT_BINDING
#if AX_ENABLE_SCRIPT_BINDING
if (_updateScriptHandler)
{
ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_updateScriptHandler);
@ -1545,18 +1545,18 @@ void Node::unscheduleUpdate()
void Node::schedule(SEL_SCHEDULE selector)
{
this->schedule(selector, 0.0f, CC_REPEAT_FOREVER, 0.0f);
this->schedule(selector, 0.0f, AX_REPEAT_FOREVER, 0.0f);
}
void Node::schedule(SEL_SCHEDULE selector, float interval)
{
this->schedule(selector, interval, CC_REPEAT_FOREVER, 0.0f);
this->schedule(selector, interval, AX_REPEAT_FOREVER, 0.0f);
}
void Node::schedule(SEL_SCHEDULE selector, float interval, unsigned int repeat, float delay)
{
CCASSERT(selector, "Argument must be non-nil");
CCASSERT(interval >= 0, "Argument must be positive");
AXASSERT(selector, "Argument must be non-nil");
AXASSERT(interval >= 0, "Argument must be positive");
_scheduler->schedule(selector, this, interval, repeat, delay, !_running);
}
@ -1626,7 +1626,7 @@ void Node::pause()
// override me
void Node::update(float fDelta)
{
#if CC_ENABLE_SCRIPT_BINDING
#if AX_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 = -CC_DEGREES_TO_RADIANS(_rotationZ_X);
float radiansY = -CC_DEGREES_TO_RADIANS(_rotationZ_Y);
float radiansX = -AX_DEGREES_TO_RADIANS(_rotationZ_X);
float radiansY = -AX_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(CC_DEGREES_TO_RADIANS(_skewY)),
(float)tanf(AX_DEGREES_TO_RADIANS(_skewY)),
0,
0,
(float)tanf(CC_DEGREES_TO_RADIANS(_skewX)),
(float)tanf(AX_DEGREES_TO_RADIANS(_skewX)),
1,
0,
0,
@ -2225,10 +2225,10 @@ bool Node::setProgramState(backend::ProgramState* programState, bool needsRetain
{
if (_programState != programState)
{
CC_SAFE_RELEASE(_programState);
AX_SAFE_RELEASE(_programState);
_programState = programState;
if (needsRetain)
CC_SAFE_RETAIN(_programState);
AX_SAFE_RETAIN(_programState);
return !!_programState;
}
return false;

View File

@ -41,7 +41,7 @@
#include "2d/CCComponentContainer.h"
#include "2d/CCComponent.h"
#if CC_USE_PHYSICS
#if AX_USE_PHYSICS
# include "physics/CCPhysicsBody.h"
#endif
@ -114,7 +114,7 @@ Node and override `draw`.
*/
class CC_DLL Node : public Ref
class AX_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 CC_64BITS
#if AX_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(CC_SCHEDULE_SELECTOR(MyNode::TickMe), 0, 0, 0);
this->schedule(AX_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 CC_REPEAT_FOREVER for tick
* @param repeat The selector will be executed (repeat + 1) times, you can use AX_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 CC_REPEAT_FOREVER for tick
* @param repeat The selector will be executed (repeat + 1) times, you can use AX_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 CC_LITTLE_ENDIAN
#if AX_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 CC_ENABLE_SCRIPT_BINDING
#if AX_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 CC_USE_PHYSICS
#if AX_USE_PHYSICS
PhysicsBody* _physicsBody;
public:
@ -2025,7 +2025,7 @@ public:
static int __attachedNodeCount;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Node);
AX_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 CC_DLL isScreenPointInRect(const Vec2& pt, const Camera* camera, const Mat4& w2l, const Rect& rect, Vec3* p);
bool AX_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
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -56,7 +56,7 @@ NodeGrid::NodeGrid() {}
void NodeGrid::setTarget(Node* target)
{
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_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 // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
CC_SAFE_RELEASE(_gridTarget);
CC_SAFE_RETAIN(target);
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
AX_SAFE_RELEASE(_gridTarget);
AX_SAFE_RETAIN(target);
_gridTarget = target;
}
NodeGrid::~NodeGrid()
{
CC_SAFE_RELEASE(_nodeGrid);
CC_SAFE_RELEASE(_gridTarget);
AX_SAFE_RELEASE(_nodeGrid);
AX_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)
{
CC_SAFE_RELEASE(_nodeGrid);
CC_SAFE_RETAIN(grid);
AX_SAFE_RELEASE(_nodeGrid);
AX_SAFE_RETAIN(grid);
_nodeGrid = grid;
}

View File

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

View File

@ -88,17 +88,17 @@ ParallaxNode* ParallaxNode::create()
void ParallaxNode::addChild(Node* /*child*/, int /*zOrder*/, int /*tag*/)
{
CCASSERT(0, "ParallaxNode: use addChild:z:parallaxRatio:positionOffset instead");
AXASSERT(0, "ParallaxNode: use addChild:z:parallaxRatio:positionOffset instead");
}
void ParallaxNode::addChild(Node* /*child*/, int /*zOrder*/, std::string_view /*name*/)
{
CCASSERT(0, "ParallaxNode: use addChild:z:parallaxRatio:positionOffset instead");
AXASSERT(0, "ParallaxNode: use addChild:z:parallaxRatio:positionOffset instead");
}
void ParallaxNode::addChild(Node* child, int z, const Vec2& ratio, const Vec2& offset)
{
CCASSERT(child != nullptr, "Argument must be non-nil");
AXASSERT(child != nullptr, "Argument must be non-nil");
PointObject* obj = PointObject::create(ratio, offset);
obj->setChild(child);
ccArrayAppendObjectWithResize(_parallaxArray, (Ref*)obj);

View File

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

View File

@ -85,8 +85,8 @@ ParticleBatchNode::ParticleBatchNode()
ParticleBatchNode::~ParticleBatchNode()
{
CC_SAFE_RELEASE(_textureAtlas);
CC_SAFE_RELEASE(_customCommand.getPipelineDescriptor().programState);
AX_SAFE_RELEASE(_textureAtlas);
AX_SAFE_RELEASE(_customCommand.getPipelineDescriptor().programState);
}
/*
* creation with Texture2D
@ -100,7 +100,7 @@ ParticleBatchNode* ParticleBatchNode::createWithTexture(Texture2D* tex, int capa
p->autorelease();
return p;
}
CC_SAFE_DELETE(p);
AX_SAFE_DELETE(p);
return nullptr;
}
@ -116,7 +116,7 @@ ParticleBatchNode* ParticleBatchNode::create(std::string_view imageFile, int cap
p->autorelease();
return p;
}
CC_SAFE_DELETE(p);
AX_SAFE_DELETE(p);
return nullptr;
}
@ -183,11 +183,11 @@ void ParticleBatchNode::visit(Renderer* renderer, const Mat4& parentTransform, u
// override addChild:
void ParticleBatchNode::addChild(Node* aChild, int zOrder, int tag)
{
CCASSERT(aChild != nullptr, "Argument must be non-nullptr");
CCASSERT(dynamic_cast<ParticleSystem*>(aChild) != nullptr,
AXASSERT(aChild != nullptr, "Argument must be non-nullptr");
AXASSERT(dynamic_cast<ParticleSystem*>(aChild) != nullptr,
"CCParticleBatchNode only supports QuadParticleSystems as children");
ParticleSystem* child = static_cast<ParticleSystem*>(aChild);
CCASSERT(child->getTexture()->getBackendTexture() == _textureAtlas->getTexture()->getBackendTexture(),
AXASSERT(child->getTexture()->getBackendTexture() == _textureAtlas->getTexture()->getBackendTexture(),
"CCParticleSystem is not using the same texture id");
addChildByTagOrName(child, zOrder, tag, "", true);
@ -195,11 +195,11 @@ void ParticleBatchNode::addChild(Node* aChild, int zOrder, int tag)
void ParticleBatchNode::addChild(Node* aChild, int zOrder, std::string_view name)
{
CCASSERT(aChild != nullptr, "Argument must be non-nullptr");
CCASSERT(dynamic_cast<ParticleSystem*>(aChild) != nullptr,
AXASSERT(aChild != nullptr, "Argument must be non-nullptr");
AXASSERT(dynamic_cast<ParticleSystem*>(aChild) != nullptr,
"CCParticleBatchNode only supports QuadParticleSystems as children");
ParticleSystem* child = static_cast<ParticleSystem*>(aChild);
CCASSERT(child->getTexture()->getBackendTexture() == _textureAtlas->getTexture()->getBackendTexture(),
AXASSERT(child->getTexture()->getBackendTexture() == _textureAtlas->getTexture()->getBackendTexture(),
"CCParticleSystem is not using the same texture id");
addChildByTagOrName(child, zOrder, 0, name, false);
@ -217,7 +217,7 @@ void ParticleBatchNode::addChildByTagOrName(ParticleSystem* child,
setBlendFunc(child->getBlendFunc());
}
CCASSERT(_blendFunc.src == child->getBlendFunc().src && _blendFunc.dst == child->getBlendFunc().dst,
AXASSERT(_blendFunc.src == child->getBlendFunc().src && _blendFunc.dst == child->getBlendFunc().dst,
"Can't add a ParticleSystem that uses a different blending function");
// no lazy sorting, so don't call super addChild, call helper instead
@ -253,8 +253,8 @@ void ParticleBatchNode::addChildByTagOrName(ParticleSystem* child,
// this helper is almost equivalent to Node's addChild, but doesn't make use of the lazy sorting
int ParticleBatchNode::addChildHelper(ParticleSystem* child, int z, int aTag, std::string_view name, bool setTag)
{
CCASSERT(child != nullptr, "Argument must be non-nil");
CCASSERT(child->getParent() == nullptr, "child already added. It can't be added again");
AXASSERT(child != nullptr, "Argument must be non-nil");
AXASSERT(child->getParent() == nullptr, "child already added. It can't be added again");
_children.reserve(4);
@ -283,10 +283,10 @@ int ParticleBatchNode::addChildHelper(ParticleSystem* child, int z, int aTag, st
// Reorder will be done in this function, no "lazy" reorder to particles
void ParticleBatchNode::reorderChild(Node* aChild, int zOrder)
{
CCASSERT(aChild != nullptr, "Child must be non-nullptr");
CCASSERT(dynamic_cast<ParticleSystem*>(aChild) != nullptr,
AXASSERT(aChild != nullptr, "Child must be non-nullptr");
AXASSERT(dynamic_cast<ParticleSystem*>(aChild) != nullptr,
"CCParticleBatchNode only supports QuadParticleSystems as children");
CCASSERT(_children.contains(aChild), "Child doesn't belong to batch");
AXASSERT(_children.contains(aChild), "Child doesn't belong to batch");
ParticleSystem* child = static_cast<ParticleSystem*>(aChild);
@ -411,9 +411,9 @@ void ParticleBatchNode::removeChild(Node* aChild, bool cleanup)
if (aChild == nullptr)
return;
CCASSERT(dynamic_cast<ParticleSystem*>(aChild) != nullptr,
AXASSERT(dynamic_cast<ParticleSystem*>(aChild) != nullptr,
"CCParticleBatchNode only supports QuadParticleSystems as children");
CCASSERT(_children.contains(aChild), "CCParticleBatchNode doesn't contain the sprite. Can't remove it");
AXASSERT(_children.contains(aChild), "CCParticleBatchNode doesn't contain the sprite. Can't remove it");
ParticleSystem* child = static_cast<ParticleSystem*>(aChild);
@ -447,7 +447,7 @@ void ParticleBatchNode::removeAllChildrenWithCleanup(bool doCleanup)
void ParticleBatchNode::draw(Renderer* renderer, const Mat4& transform, uint32_t flags)
{
CC_PROFILER_START("CCParticleBatchNode - draw");
AX_PROFILER_START("CCParticleBatchNode - draw");
if (_textureAtlas->getTotalQuads() == 0)
return;
@ -476,19 +476,19 @@ void ParticleBatchNode::draw(Renderer* renderer, const Mat4& transform, uint32_t
renderer->addCommand(&_customCommand);
CC_PROFILER_STOP("CCParticleBatchNode - draw");
AX_PROFILER_STOP("CCParticleBatchNode - draw");
}
void ParticleBatchNode::increaseAtlasCapacityTo(ssize_t quantity)
{
CCLOG("cocos2d: ParticleBatchNode: resizing TextureAtlas capacity from [%d] to [%d].",
AXLOG("cocos2d: ParticleBatchNode: resizing TextureAtlas capacity from [%d] to [%d].",
(int)_textureAtlas->getCapacity(), (int)quantity);
if (!_textureAtlas->resizeCapacity(quantity))
{
// serious problems
CCLOGWARN("cocos2d: WARNING: Not enough memory to resize the atlas");
CCASSERT(false, "XXX: ParticleBatchNode #increaseAtlasCapacity SHALL handle this assert");
AXLOGWARN("cocos2d: WARNING: Not enough memory to resize the atlas");
AXASSERT(false, "XXX: ParticleBatchNode #increaseAtlasCapacity SHALL handle this assert");
}
}
@ -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 == CC_BLEND_SRC && _blendFunc.dst == CC_BLEND_DST))
if (!texture->hasPremultipliedAlpha() && (_blendFunc.src == AX_BLEND_SRC && _blendFunc.dst == AX_BLEND_DST))
_blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;
}

View File

@ -68,7 +68,7 @@ class ParticleSystem;
* @since v1.1
*/
class CC_DLL ParticleBatchNode : public Node, public TextureProtocol
class AX_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);
CC_BREAK_IF(texture != nullptr);
AX_BREAK_IF(texture != nullptr);
image = new Image();
bool ret = image->initWithImageData(__firePngData, sizeof(__firePngData));
CC_BREAK_IF(!ret);
AX_BREAK_IF(!ret);
texture = Director::getInstance()->getTextureCache()->addImage(image, key);
} while (0);
CC_SAFE_RELEASE(image);
AX_SAFE_RELEASE(image);
return texture;
}
@ -67,7 +67,7 @@ ParticleFire* ParticleFire::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -81,7 +81,7 @@ ParticleFire* ParticleFire::createWithTotalParticles(int numberOfParticles)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -171,7 +171,7 @@ ParticleFireworks* ParticleFireworks::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -185,7 +185,7 @@ ParticleFireworks* ParticleFireworks::createWithTotalParticles(int numberOfParti
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -272,7 +272,7 @@ ParticleSun* ParticleSun::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -286,7 +286,7 @@ ParticleSun* ParticleSun::createWithTotalParticles(int numberOfParticles)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -378,7 +378,7 @@ ParticleGalaxy* ParticleGalaxy::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -392,7 +392,7 @@ ParticleGalaxy* ParticleGalaxy::createWithTotalParticles(int numberOfParticles)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -487,7 +487,7 @@ ParticleFlower* ParticleFlower::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -501,7 +501,7 @@ ParticleFlower* ParticleFlower::createWithTotalParticles(int numberOfParticles)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -595,7 +595,7 @@ ParticleMeteor* ParticleMeteor::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -609,7 +609,7 @@ ParticleMeteor* ParticleMeteor::createWithTotalParticles(int numberOfParticles)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -704,7 +704,7 @@ ParticleSpiral* ParticleSpiral::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -718,7 +718,7 @@ ParticleSpiral* ParticleSpiral::createWithTotalParticles(int numberOfParticles)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -813,7 +813,7 @@ ParticleExplosion* ParticleExplosion::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -827,7 +827,7 @@ ParticleExplosion* ParticleExplosion::createWithTotalParticles(int numberOfParti
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -921,7 +921,7 @@ ParticleSmoke* ParticleSmoke::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -935,7 +935,7 @@ ParticleSmoke* ParticleSmoke::createWithTotalParticles(int numberOfParticles)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -1026,7 +1026,7 @@ ParticleSnow* ParticleSnow::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -1040,7 +1040,7 @@ ParticleSnow* ParticleSnow::createWithTotalParticles(int numberOfParticles)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -1134,7 +1134,7 @@ ParticleRain* ParticleRain::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -1148,7 +1148,7 @@ ParticleRain* ParticleRain::createWithTotalParticles(int numberOfParticles)
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}

View File

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

View File

@ -147,47 +147,47 @@ bool ParticleData::init(int count)
void ParticleData::release()
{
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(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(modeA.dirX);
CC_SAFE_FREE(modeA.dirY);
CC_SAFE_FREE(modeA.radialAccel);
CC_SAFE_FREE(modeA.tangentialAccel);
AX_SAFE_FREE(modeA.dirX);
AX_SAFE_FREE(modeA.dirY);
AX_SAFE_FREE(modeA.radialAccel);
AX_SAFE_FREE(modeA.tangentialAccel);
CC_SAFE_FREE(modeB.angle);
CC_SAFE_FREE(modeB.degreesPerSecond);
CC_SAFE_FREE(modeB.deltaRadius);
CC_SAFE_FREE(modeB.radius);
AX_SAFE_FREE(modeB.angle);
AX_SAFE_FREE(modeB.degreesPerSecond);
AX_SAFE_FREE(modeB.deltaRadius);
AX_SAFE_FREE(modeB.radius);
}
Vector<ParticleSystem*> ParticleSystem::__allInstances;
@ -279,7 +279,7 @@ ParticleSystem* ParticleSystem::create(std::string_view plistFile)
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return ret;
}
@ -291,7 +291,7 @@ ParticleSystem* ParticleSystem::createWithTotalParticles(int numberOfParticles)
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return ret;
}
@ -321,10 +321,10 @@ bool ParticleSystem::allocAnimationMem()
void ParticleSystem::deallocAnimationMem()
{
CC_SAFE_FREE(_particleData.animTimeLength);
CC_SAFE_FREE(_particleData.animTimeDelta);
CC_SAFE_FREE(_particleData.animIndex);
CC_SAFE_FREE(_particleData.animCellIndex);
AX_SAFE_FREE(_particleData.animTimeLength);
AX_SAFE_FREE(_particleData.animTimeDelta);
AX_SAFE_FREE(_particleData.animIndex);
AX_SAFE_FREE(_particleData.animCellIndex);
_isAnimAllocated = false;
}
@ -346,9 +346,9 @@ bool ParticleSystem::allocHSVMem()
void ParticleSystem::deallocHSVMem()
{
CC_SAFE_FREE(_particleData.hue);
CC_SAFE_FREE(_particleData.sat);
CC_SAFE_FREE(_particleData.val);
AX_SAFE_FREE(_particleData.hue);
AX_SAFE_FREE(_particleData.sat);
AX_SAFE_FREE(_particleData.val);
_isHSVAllocated = false;
}
@ -369,8 +369,8 @@ bool ParticleSystem::allocOpacityFadeInMem()
void ParticleSystem::deallocOpacityFadeInMem()
{
CC_SAFE_FREE(_particleData.opacityFadeInDelta);
CC_SAFE_FREE(_particleData.opacityFadeInLength);
AX_SAFE_FREE(_particleData.opacityFadeInDelta);
AX_SAFE_FREE(_particleData.opacityFadeInLength);
_isOpacityFadeInAllocated = false;
}
@ -391,8 +391,8 @@ bool ParticleSystem::allocScaleInMem()
void ParticleSystem::deallocScaleInMem()
{
CC_SAFE_FREE(_particleData.scaleInDelta);
CC_SAFE_FREE(_particleData.scaleInLength);
AX_SAFE_FREE(_particleData.scaleInDelta);
AX_SAFE_FREE(_particleData.scaleInLength);
_isScaleInAllocated = false;
}
@ -412,7 +412,7 @@ bool ParticleSystem::initWithFile(std::string_view plistFile)
_plistFile = FileUtils::getInstance()->fullPathForFilename(plistFile);
ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(_plistFile);
CCASSERT(!dict.empty(), "Particles: file not found");
AXASSERT(!dict.empty(), "Particles: file not found");
// FIXME: compute path from a path, should define a function somewhere to do it
auto listFilePath = plistFile;
@ -573,8 +573,8 @@ bool ParticleSystem::initWithDictionary(const ValueMap& dictionary, std::string_
}
else
{
CCASSERT(false, "Invalid emitterType in config file");
CC_BREAK_IF(true);
AXASSERT(false, "Invalid emitterType in config file");
AX_BREAK_IF(true);
}
// life span
@ -630,7 +630,7 @@ bool ParticleSystem::initWithDictionary(const ValueMap& dictionary, std::string_
else if (dictionary.find("textureImageData") != dictionary.end())
{
std::string textureData = dictionary.at("textureImageData").asString();
CCASSERT(!textureData.empty(), "textureData can't be empty!");
AXASSERT(!textureData.empty(), "textureData can't be empty!");
auto dataLen = textureData.size();
if (dataLen != 0)
@ -638,20 +638,20 @@ bool ParticleSystem::initWithDictionary(const ValueMap& dictionary, std::string_
// if it fails, try to get it from the base64-gzipped data
int decodeLen =
base64Decode((unsigned char*)textureData.c_str(), (unsigned int)dataLen, &buffer);
CCASSERT(buffer != nullptr, "CCParticleSystem: error decoding textureImageData");
CC_BREAK_IF(!buffer);
AXASSERT(buffer != nullptr, "CCParticleSystem: error decoding textureImageData");
AX_BREAK_IF(!buffer);
unsigned char* deflated = nullptr;
ssize_t deflatedLen = ZipUtils::inflateMemory(buffer, decodeLen, &deflated);
CCASSERT(deflated != nullptr, "CCParticleSystem: error ungzipping textureImageData");
CC_BREAK_IF(!deflated);
AXASSERT(deflated != nullptr, "CCParticleSystem: error ungzipping textureImageData");
AX_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");
CC_BREAK_IF(!isOK);
AXASSERT(isOK, "CCParticleSystem: error init image with Data");
AX_BREAK_IF(!isOK);
setTexture(_director->getTextureCache()->addImage(image, _plistFile + textureName));
@ -662,7 +662,7 @@ bool ParticleSystem::initWithDictionary(const ValueMap& dictionary, std::string_
_yCoordFlipped = optValue(dictionary, "yCoordFlipped").asInt(1);
if (!this->_texture)
CCLOGWARN("cocos2d: Warning: ParticleSystemQuad system without a texture");
AXLOGWARN("cocos2d: Warning: ParticleSystemQuad system without a texture");
}
ret = true;
}
@ -679,7 +679,7 @@ bool ParticleSystem::initWithTotalParticles(int numberOfParticles)
if (!_particleData.init(_totalParticles))
{
CCLOG("Particle system: not enough memory");
AXLOG("Particle system: not enough memory");
this->release();
return false;
}
@ -712,7 +712,7 @@ bool ParticleSystem::initWithTotalParticles(int numberOfParticles)
// Optimization: compile updateParticle method
// updateParticleSel = @selector(updateQuadWithParticle:newPosition:);
// updateParticleImp = (CC_UPDATE_PARTICLE_IMP) [self methodForSelector:updateParticleSel];
// updateParticleImp = (AX_UPDATE_PARTICLE_IMP) [self methodForSelector:updateParticleSel];
// for batchNode
_transformSystemDirty = false;
@ -726,7 +726,7 @@ ParticleSystem::~ParticleSystem()
// unscheduleUpdate();
_particleData.release();
_animations.clear();
CC_SAFE_RELEASE(_texture);
AX_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, -CC_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef()));
point = point.rotateByAngle(Vec2::ZERO, -AX_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, -CC_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef()));
point = point.rotateByAngle(Vec2::ZERO, -AX_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, -CC_DEGREES_TO_RADIANS(angle));
point = point.rotateByAngle(Vec2::ZERO, -AX_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 = CC_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef());
float a = AX_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] = -CC_RADIANS_TO_DEGREES(dir.getAngle());
_particleData.rotation[i] = -AX_RADIANS_TO_DEGREES(dir.getAngle());
}
}
else
{
for (int i = start; i < _particleCount; ++i)
{
float a = CC_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef());
float a = AX_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] = CC_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef());
_particleData.modeB.angle[i] = AX_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef());
}
for (int i = start; i < _particleCount; ++i)
{
_particleData.modeB.degreesPerSecond[i] =
CC_DEGREES_TO_RADIANS(modeB.rotatePerSecond + modeB.rotatePerSecondVar * _rng.rangef());
AX_DEGREES_TO_RADIANS(modeB.rotatePerSecond + modeB.rotatePerSecondVar * _rng.rangef());
}
if (modeB.endRadius == START_RADIUS_EQUAL_TO_END_RADIUS)
@ -1386,12 +1386,12 @@ void ParticleSystem::setAnimationIndicesAtlas()
return;
}
CCASSERT(false, "Couldn't figure out the atlas size and direction.");
AXASSERT(false, "Couldn't figure out the atlas size and direction.");
}
void ParticleSystem::setAnimationIndicesAtlas(unsigned int unifiedCellSize, TexAnimDir direction)
{
CCASSERT(unifiedCellSize > 0, "A cell cannot have a size of zero.");
AXASSERT(unifiedCellSize > 0, "A cell cannot have a size of zero.");
resetAnimationIndices();
@ -1558,7 +1558,7 @@ void ParticleSystem::update(float dt)
if (!_visible)
return;
CC_PROFILER_START_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update");
AX_PROFILER_START_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update");
if (_componentContainer && !_componentContainer->isEmpty())
{
@ -1572,7 +1572,7 @@ void ParticleSystem::update(float dt)
{
updateParticleQuads();
_transformSystemDirty = false;
CC_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update");
AX_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update");
return;
}
dt = _fixedFPSDelta;
@ -1838,7 +1838,7 @@ void ParticleSystem::update(float dt)
postStep();
}
CC_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update");
AX_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update");
}
void ParticleSystem::updateWithNoTime()
@ -1861,8 +1861,8 @@ void ParticleSystem::setTexture(Texture2D* var)
{
if (_texture != var)
{
CC_SAFE_RETAIN(var);
CC_SAFE_RELEASE(_texture);
AX_SAFE_RETAIN(var);
AX_SAFE_RELEASE(_texture);
_texture = var;
updateBlendFunc();
}
@ -1870,7 +1870,7 @@ void ParticleSystem::setTexture(Texture2D* var)
void ParticleSystem::updateBlendFunc()
{
CCASSERT(!_batchNode, "Can't change blending functions when the particle is being batched");
AXASSERT(!_batchNode, "Can't change blending functions when the particle is being batched");
if (_texture)
{
@ -1878,7 +1878,7 @@ void ParticleSystem::updateBlendFunc()
_opacityModifyRGB = false;
if (_texture && (_blendFunc.src == CC_BLEND_SRC && _blendFunc.dst == CC_BLEND_DST))
if (_texture && (_blendFunc.src == AX_BLEND_SRC && _blendFunc.dst == AX_BLEND_DST))
{
if (premultiplied)
{
@ -1921,170 +1921,170 @@ bool ParticleSystem::isBlendAdditive() const
// ParticleSystem - Properties of Gravity Mode
void ParticleSystem::setTangentialAccel(float t)
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
modeA.tangentialAccel = t;
}
float ParticleSystem::getTangentialAccel() const
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
return modeA.tangentialAccel;
}
void ParticleSystem::setTangentialAccelVar(float t)
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
modeA.tangentialAccelVar = t;
}
float ParticleSystem::getTangentialAccelVar() const
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
return modeA.tangentialAccelVar;
}
void ParticleSystem::setRadialAccel(float t)
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
modeA.radialAccel = t;
}
float ParticleSystem::getRadialAccel() const
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
return modeA.radialAccel;
}
void ParticleSystem::setRadialAccelVar(float t)
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
modeA.radialAccelVar = t;
}
float ParticleSystem::getRadialAccelVar() const
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
return modeA.radialAccelVar;
}
void ParticleSystem::setRotationIsDir(bool t)
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
modeA.rotationIsDir = t;
}
bool ParticleSystem::getRotationIsDir() const
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
return modeA.rotationIsDir;
}
void ParticleSystem::setGravity(const Vec2& g)
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
modeA.gravity = g;
}
const Vec2& ParticleSystem::getGravity()
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
return modeA.gravity;
}
void ParticleSystem::setSpeed(float speed)
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
modeA.speed = speed;
}
float ParticleSystem::getSpeed() const
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
return modeA.speed;
}
void ParticleSystem::setSpeedVar(float speedVar)
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
modeA.speedVar = speedVar;
}
float ParticleSystem::getSpeedVar() const
{
CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
AXASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity");
return modeA.speedVar;
}
// ParticleSystem - Properties of Radius Mode
void ParticleSystem::setStartRadius(float startRadius)
{
CCASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
AXASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
modeB.startRadius = startRadius;
}
float ParticleSystem::getStartRadius() const
{
CCASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
AXASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
return modeB.startRadius;
}
void ParticleSystem::setStartRadiusVar(float startRadiusVar)
{
CCASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
AXASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
modeB.startRadiusVar = startRadiusVar;
}
float ParticleSystem::getStartRadiusVar() const
{
CCASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
AXASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
return modeB.startRadiusVar;
}
void ParticleSystem::setEndRadius(float endRadius)
{
CCASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
AXASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
modeB.endRadius = endRadius;
}
float ParticleSystem::getEndRadius() const
{
CCASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
AXASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
return modeB.endRadius;
}
void ParticleSystem::setEndRadiusVar(float endRadiusVar)
{
CCASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
AXASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
modeB.endRadiusVar = endRadiusVar;
}
float ParticleSystem::getEndRadiusVar() const
{
CCASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
AXASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
return modeB.endRadiusVar;
}
void ParticleSystem::setRotatePerSecond(float degrees)
{
CCASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
AXASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
modeB.rotatePerSecond = degrees;
}
float ParticleSystem::getRotatePerSecond() const
{
CCASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
AXASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
return modeB.rotatePerSecond;
}
void ParticleSystem::setRotatePerSecondVar(float degrees)
{
CCASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
AXASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
modeB.rotatePerSecondVar = degrees;
}
float ParticleSystem::getRotatePerSecondVar() const
{
CCASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
AXASSERT(_emitterMode == Mode::RADIUS, "Particle Mode should be Radius");
return modeB.rotatePerSecondVar;
}
@ -2141,7 +2141,7 @@ int ParticleSystem::getTotalParticles() const
void ParticleSystem::setTotalParticles(int var)
{
CCASSERT(var <= _allocatedParticles, "Particle: resizing particle array only supported for quads");
AXASSERT(var <= _allocatedParticles, "Particle: resizing particle array only supported for quads");
_totalParticles = var;
}
@ -2286,7 +2286,7 @@ void ParticleEmissionMaskCache::bakeEmissionMask(std::string_view maskId,
img->Image::initWithImageFile(texturePath);
img->autorelease();
CCASSERT(img, "image texture was nullptr.");
AXASSERT(img, "image texture was nullptr.");
bakeEmissionMask(maskId, img, alphaThreshold, inverted, inbetweenSamples);
}
@ -2297,8 +2297,8 @@ void ParticleEmissionMaskCache::bakeEmissionMask(std::string_view maskId,
int inbetweenSamples)
{
auto img = imageTexture;
CCASSERT(img, "image texture was nullptr.");
CCASSERT(img->hasAlpha(), "image data should contain an alpha channel.");
AXASSERT(img, "image texture was nullptr.");
AXASSERT(img->hasAlpha(), "image data should contain an alpha channel.");
vector<Vec2> points;
@ -2341,7 +2341,7 @@ void ParticleEmissionMaskCache::bakeEmissionMask(std::string_view maskId,
iter->second = desc;
CCLOG("Particle emission mask '%u' baked (%dx%d), %zu samples generated taking %.2fmb of memory.",
AXLOG("Particle emission mask '%u' baked (%dx%d), %zu samples generated taking %.2fmb of memory.",
(unsigned int)htonl(fourccId), w, h, desc.points.size(), desc.points.size() * 8 / 1e+6);
}

View File

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

View File

@ -83,11 +83,11 @@ ParticleSystemQuad::~ParticleSystemQuad()
{
if (nullptr == _batchNode)
{
CC_SAFE_FREE(_quads);
CC_SAFE_FREE(_indices);
AX_SAFE_FREE(_quads);
AX_SAFE_FREE(_indices);
}
CC_SAFE_RELEASE_NULL(_quadCommand.getPipelineDescriptor().programState);
AX_SAFE_RELEASE_NULL(_quadCommand.getPipelineDescriptor().programState);
}
// implementation ParticleSystemQuad
@ -100,13 +100,13 @@ ParticleSystemQuad* ParticleSystemQuad::create(std::string_view filename)
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return ret;
}
ParticleSystemQuad* ParticleSystemQuad::createWithTotalParticles(int numberOfParticles)
{
CCASSERT(numberOfParticles <= 10000,
AXASSERT(numberOfParticles <= 10000,
"Adding more than 10000 particles will crash the renderer, the mesh generated has an index format of "
"U_SHORT (uint16_t)");
@ -116,7 +116,7 @@ ParticleSystemQuad* ParticleSystemQuad::createWithTotalParticles(int numberOfPar
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return ret;
}
@ -128,7 +128,7 @@ ParticleSystemQuad* ParticleSystemQuad::create(ValueMap& dictionary)
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
return ret;
}
@ -149,10 +149,10 @@ bool ParticleSystemQuad::initWithTotalParticles(int numberOfParticles)
initIndices();
// setupVBO();
#if CC_ENABLE_CACHE_TEXTURE_DATA
#if AX_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,
CC_CALLBACK_1(ParticleSystemQuad::listenRendererRecreated, this));
AX_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 * 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());
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());
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 CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
#if AX_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 // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
#endif // ! AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL
// Important. Texture in cocos2d are inverted, so the Y component should be inverted
std::swap(top, bottom);
@ -257,7 +257,7 @@ void ParticleSystemQuad::setTexture(Texture2D* texture)
void ParticleSystemQuad::setDisplayFrame(SpriteFrame* spriteFrame)
{
CCASSERT(spriteFrame->getOffsetInPixels().isZero(), "QuadParticle only supports SpriteFrames with no offsets");
AXASSERT(spriteFrame->getOffsetInPixels().isZero(), "QuadParticle only supports SpriteFrames with no offsets");
this->setTextureWithRect(spriteFrame->getTexture(), spriteFrame->getRect());
}
@ -295,7 +295,7 @@ inline void updatePosWithParticle(V3F_C4B_T2F_Quad* quad,
float x = newPosition.x;
float y = newPosition.y;
float r = (float)-CC_DEGREES_TO_RADIANS(rotation + staticRotation);
float r = (float)-AX_DEGREES_TO_RADIANS(rotation + staticRotation);
float cr = cosf(r);
float sr = sinf(r);
float ax = x1 * cr - y1 * sr + x;
@ -731,7 +731,7 @@ void ParticleSystemQuad::setTotalParticles(int tp)
_particleData.release();
if (!_particleData.init(tp))
{
CCLOG("Particle system: not enough memory");
AXLOG("Particle system: not enough memory");
return;
}
V3F_C4B_T2F_Quad* quadsNew = (V3F_C4B_T2F_Quad*)realloc(_quads, quadsSize);
@ -757,7 +757,7 @@ void ParticleSystemQuad::setTotalParticles(int tp)
if (indicesNew)
_indices = indicesNew;
CCLOG("Particle system: out of memory");
AXLOG("Particle system: out of memory");
return;
}
@ -809,19 +809,19 @@ void ParticleSystemQuad::listenRendererRecreated(EventCustom* /*event*/)
bool ParticleSystemQuad::allocMemory()
{
CCASSERT(!_batchNode, "Memory should not be alloced when not using batchNode");
AXASSERT(!_batchNode, "Memory should not be alloced when not using batchNode");
CC_SAFE_FREE(_quads);
CC_SAFE_FREE(_indices);
AX_SAFE_FREE(_quads);
AX_SAFE_FREE(_indices);
_quads = (V3F_C4B_T2F_Quad*)malloc(_totalParticles * sizeof(V3F_C4B_T2F_Quad));
_indices = (unsigned short*)malloc(_totalParticles * 6 * sizeof(unsigned short));
if (!_quads || !_indices)
{
CCLOG("cocos2d: Particle system: not enough memory");
CC_SAFE_FREE(_quads);
CC_SAFE_FREE(_indices);
AXLOG("cocos2d: Particle system: not enough memory");
AX_SAFE_FREE(_quads);
AX_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]));
CC_SAFE_FREE(_quads);
CC_SAFE_FREE(_indices);
AX_SAFE_FREE(_quads);
AX_SAFE_FREE(_indices);
}
}
}
@ -870,7 +870,7 @@ ParticleSystemQuad* ParticleSystemQuad::create()
particleSystemQuad->autorelease();
return particleSystemQuad;
}
CC_SAFE_DELETE(particleSystemQuad);
AX_SAFE_DELETE(particleSystemQuad);
return nullptr;
}

View File

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

View File

@ -20,13 +20,13 @@ NS_AX_BEGIN
void PlistSpriteSheetLoader::load(std::string_view filePath, SpriteFrameCache& cache)
{
CCASSERT(!filePath.empty(), "plist filename should not be nullptr");
AXASSERT(!filePath.empty(), "plist filename should not be nullptr");
const auto fullPath = FileUtils::getInstance()->fullPathForFilename(filePath);
if (fullPath.empty())
{
// return if plist file doesn't exist
CCLOG("cocos2d: SpriteFrameCache: can not find %s", filePath.data());
AXLOG("cocos2d: SpriteFrameCache: can not find %s", filePath.data());
return;
}
@ -61,7 +61,7 @@ void PlistSpriteSheetLoader::load(std::string_view filePath, SpriteFrameCache& c
// append .png
texturePath = texturePath.append(".png");
CCLOG("cocos2d: SpriteFrameCache: Trying to use file %s as texture", texturePath.c_str());
AXLOG("cocos2d: SpriteFrameCache: Trying to use file %s as texture", texturePath.c_str());
}
addSpriteFramesWithDictionary(dict, texturePath, filePath, cache);
}
@ -76,7 +76,7 @@ void PlistSpriteSheetLoader::load(std::string_view filePath, Texture2D* texture,
void PlistSpriteSheetLoader::load(std::string_view filePath, std::string_view textureFileName, SpriteFrameCache& cache)
{
CCASSERT(!textureFileName.empty(), "texture name should not be null");
AXASSERT(!textureFileName.empty(), "texture name should not be null");
const auto fullPath = FileUtils::getInstance()->fullPathForFilename(filePath);
auto dict = FileUtils::getInstance()->getValueMapFromFile(fullPath);
addSpriteFramesWithDictionary(dict, textureFileName, filePath, cache);
@ -143,7 +143,7 @@ void PlistSpriteSheetLoader::reload(std::string_view filePath, SpriteFrameCache&
}
else
{
CCLOG("cocos2d: SpriteFrameCache: Couldn't load texture");
AXLOG("cocos2d: SpriteFrameCache: Couldn't load texture");
}
}
@ -189,7 +189,7 @@ void PlistSpriteSheetLoader::addSpriteFramesWithDictionary(ValueMap& dictionary,
}
// check the format
CCASSERT(format >= 0 && format <= 3,
AXASSERT(format >= 0 && format <= 3,
"format is not supported for SpriteFrameCache addSpriteFramesWithDictionary:textureFilename:");
std::vector<std::string> frameAliases;
@ -219,7 +219,7 @@ void PlistSpriteSheetLoader::addSpriteFramesWithDictionary(ValueMap& dictionary,
// check ow/oh
if (!ow || !oh)
{
CCLOGWARN(
AXLOGWARN(
"cocos2d: WARNING: originalWidth/Height not found on the SpriteFrame. AnchorPoint won't work as "
"expected. Regenerate the .plist");
}
@ -268,7 +268,7 @@ void PlistSpriteSheetLoader::addSpriteFramesWithDictionary(ValueMap& dictionary,
}
else
{
CCLOGWARN("cocos2d: WARNING: an alias with name %s already exists", oneAlias.c_str());
AXLOGWARN("cocos2d: WARNING: an alias with name %s already exists", oneAlias.c_str());
}
}
@ -317,7 +317,7 @@ void PlistSpriteSheetLoader::addSpriteFramesWithDictionary(ValueMap& dictionary,
spriteSheet->full = true;
CC_SAFE_DELETE(image);
AX_SAFE_DELETE(image);
}
void PlistSpriteSheetLoader::addSpriteFramesWithDictionary(ValueMap& dict,
@ -367,7 +367,7 @@ void PlistSpriteSheetLoader::addSpriteFramesWithDictionary(ValueMap& dict,
}
else
{
CCLOG("cocos2d: SpriteFrameCache: Couldn't load texture");
AXLOG("cocos2d: SpriteFrameCache: Couldn't load texture");
}
}
@ -387,7 +387,7 @@ void PlistSpriteSheetLoader::reloadSpriteFramesWithDictionary(ValueMap& dict,
}
// check the format
CCASSERT(format >= 0 && format <= 3,
AXASSERT(format >= 0 && format <= 3,
"format is not supported for SpriteFrameCache addSpriteFramesWithDictionary:textureFilename:");
auto spriteSheet = std::make_shared<SpriteSheet>();
@ -417,7 +417,7 @@ void PlistSpriteSheetLoader::reloadSpriteFramesWithDictionary(ValueMap& dict,
// check ow/oh
if (!ow || !oh)
{
CCLOGWARN(
AXLOGWARN(
"cocos2d: WARNING: originalWidth/Height not found on the SpriteFrame. AnchorPoint won't work as "
"expected. Regenerate the .plist");
}
@ -466,7 +466,7 @@ void PlistSpriteSheetLoader::reloadSpriteFramesWithDictionary(ValueMap& dict,
}
else
{
CCLOGWARN("cocos2d: WARNING: an alias with name %s already exists", oneAlias.c_str());
AXLOGWARN("cocos2d: WARNING: an alias with name %s already exists", oneAlias.c_str());
}
}

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);
CC_SAFE_RELEASE(pipelieDescriptor.programState);
AX_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
CC_SAFE_RELEASE(_programState2);
AX_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()
{
CC_SAFE_RELEASE(_sprite);
CC_SAFE_RELEASE(_programState2);
AX_SAFE_RELEASE(_sprite);
AX_SAFE_RELEASE(_programState2);
}
void ProgressTimer::setPercentage(float percentage)
@ -143,7 +143,7 @@ void ProgressTimer::setSprite(Sprite* sprite)
{
if (_sprite != sprite)
{
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_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 // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
CC_SAFE_RETAIN(sprite);
CC_SAFE_RELEASE(_sprite);
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
AX_SAFE_RETAIN(sprite);
AX_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 CC_DLL ProgressTimer : public Node
class AX_DLL ProgressTimer : public Node
{
public:
/** Types of progress
@ -201,7 +201,7 @@ protected:
backend::UniformLocation _locTex2;
private:
CC_DISALLOW_COPY_AND_ASSIGN(ProgressTimer);
AX_DISALLOW_COPY_AND_ASSIGN(ProgressTimer);
};
// end of misc_nodes group

View File

@ -38,7 +38,7 @@ ProtectedNode::ProtectedNode() : _reorderProtectedChildDirty(false) {}
ProtectedNode::~ProtectedNode()
{
CCLOGINFO("deallocing ProtectedNode: %p - tag: %i", this, _tag);
AXLOGINFO("deallocing ProtectedNode: %p - tag: %i", this, _tag);
removeAllProtectedChildren();
}
@ -51,7 +51,7 @@ ProtectedNode* ProtectedNode::create()
}
else
{
CC_SAFE_DELETE(ret);
AX_SAFE_DELETE(ret);
}
return ret;
}
@ -80,8 +80,8 @@ void ProtectedNode::addProtectedChild(axis::Node* child, int localZOrder)
*/
void ProtectedNode::addProtectedChild(Node* child, int zOrder, int tag)
{
CCASSERT(child != nullptr, "Argument must be non-nil");
CCASSERT(child->getParent() == nullptr, "child already added. It can't be added again");
AXASSERT(child != nullptr, "Argument must be non-nil");
AXASSERT(child->getParent() == nullptr, "child already added. It can't be added again");
if (_protectedChildren.empty())
{
@ -118,7 +118,7 @@ void ProtectedNode::addProtectedChild(Node* child, int zOrder, int tag)
Node* ProtectedNode::getProtectedChildByTag(int tag)
{
CCASSERT(tag != Node::INVALID_TAG, "Invalid tag");
AXASSERT(tag != Node::INVALID_TAG, "Invalid tag");
for (auto& child : _protectedChildren)
{
@ -141,7 +141,7 @@ void ProtectedNode::removeProtectedChild(axis::Node* child, bool cleanup)
}
ssize_t index = _protectedChildren.getIndex(child);
if (index != CC_INVALID_INDEX)
if (index != AX_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 CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->releaseScriptObject(this, child);
}
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
_protectedChildren.erase(index);
}
}
@ -197,13 +197,13 @@ void ProtectedNode::removeAllProtectedChildrenWithCleanup(bool cleanup)
{
child->cleanup();
}
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->releaseScriptObject(this, child);
}
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
// set parent nil at the end
child->setParent(nullptr);
}
@ -213,13 +213,13 @@ void ProtectedNode::removeAllProtectedChildrenWithCleanup(bool cleanup)
void ProtectedNode::removeProtectedChildByTag(int tag, bool cleanup)
{
CCASSERT(tag != Node::INVALID_TAG, "Invalid tag");
AXASSERT(tag != Node::INVALID_TAG, "Invalid tag");
Node* child = this->getProtectedChildByTag(tag);
if (child == nullptr)
{
CCLOG("cocos2d: removeChildByTag(tag = %d): child not found!", tag);
AXLOG("cocos2d: removeChildByTag(tag = %d): child not found!", tag);
}
else
{
@ -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 CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (sEngine)
{
sEngine->retainScriptObject(this, child);
}
#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS
#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS
_reorderProtectedChildDirty = true;
_protectedChildren.pushBack(child);
child->setLocalZOrder(z);
@ -253,7 +253,7 @@ void ProtectedNode::sortAllProtectedChildren()
void ProtectedNode::reorderProtectedChild(axis::Node* child, int localZOrder)
{
CCASSERT(child != nullptr, "Child must be non-nil");
AXASSERT(child != nullptr, "Child must be non-nil");
_reorderProtectedChildDirty = true;
child->updateOrderOfArrival();
child->setLocalZOrder(localZOrder);

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