diff --git a/APPENDIX.md b/APPENDIX.md index 7d16c6645f..a42f246370 100644 --- a/APPENDIX.md +++ b/APPENDIX.md @@ -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: diff --git a/cmake/Modules/AxisBuildHelpers.cmake b/cmake/Modules/AxisBuildHelpers.cmake index a6be72cc41..47f0ff4612 100644 --- a/cmake/Modules/AxisBuildHelpers.cmake +++ b/cmake/Modules/AxisBuildHelpers.cmake @@ -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() diff --git a/cmake/Modules/AxisConfigDefine.cmake b/cmake/Modules/AxisConfigDefine.cmake index 69e48d2cda..90d83bdf06 100644 --- a/cmake/Modules/AxisConfigDefine.cmake +++ b/cmake/Modules/AxisConfigDefine.cmake @@ -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() diff --git a/cmake/Modules/AxisLinkHelpers.cmake b/cmake/Modules/AxisLinkHelpers.cmake index 3ed0e9d788..ff2fa7f6c5 100644 --- a/cmake/Modules/AxisLinkHelpers.cmake +++ b/cmake/Modules/AxisLinkHelpers.cmake @@ -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() diff --git a/core/2d/CCAction.cpp b/core/2d/CCAction.cpp index af862d357c..a61424172a 100644 --- a/core/2d/CCAction.cpp +++ b/core/2d/CCAction.cpp @@ -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!"); diff --git a/core/2d/CCAction.h b/core/2d/CCAction.h index e4d2b90266..e9dca51e4d 100644 --- a/core/2d/CCAction.h +++ b/core/2d/CCAction.h @@ -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 diff --git a/core/2d/CCActionCamera.cpp b/core/2d/CCActionCamera.cpp index a4fd4d9f3b..3e7edf952f 100644 --- a/core/2d/CCActionCamera.cpp +++ b/core/2d/CCActionCamera.cpp @@ -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) diff --git a/core/2d/CCActionCamera.h b/core/2d/CCActionCamera.h index ca40675180..a6be928594 100644 --- a/core/2d/CCActionCamera.h +++ b/core/2d/CCActionCamera.h @@ -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. diff --git a/core/2d/CCActionCatmullRom.cpp b/core/2d/CCActionCatmullRom.cpp index 2ba989acf1..f4c05889d3 100644 --- a/core/2d/CCActionCatmullRom.cpp +++ b/core/2d/CCActionCatmullRom.cpp @@ -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; } diff --git a/core/2d/CCActionCatmullRom.h b/core/2d/CCActionCatmullRom.h index 5695b89ca9..7c4baee081 100644 --- a/core/2d/CCActionCatmullRom.h +++ b/core/2d/CCActionCatmullRom.h @@ -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 diff --git a/core/2d/CCActionEase.cpp b/core/2d/CCActionEase.cpp index 167cc76efb..a924fae365 100644 --- a/core/2d/CCActionEase.cpp +++ b/core/2d/CCActionEase.cpp @@ -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 \ diff --git a/core/2d/CCActionEase.h b/core/2d/CCActionEase.h index 0da2574c30..4062bcddbd 100644 --- a/core/2d/CCActionEase.h +++ b/core/2d/CCActionEase.h @@ -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 diff --git a/core/2d/CCActionGrid.cpp b/core/2d/CCActionGrid.cpp index 1516e1e3e9..e576180d32 100644 --- a/core/2d/CCActionGrid.cpp +++ b/core/2d/CCActionGrid.cpp @@ -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(_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(_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(_target); - CCASSERT(_gridNodeTarget, "GridActions can only used on NodeGrid"); + AXASSERT(_gridNodeTarget, "GridActions can only used on NodeGrid"); } ReuseGrid* ReuseGrid::clone() const diff --git a/core/2d/CCActionGrid.h b/core/2d/CCActionGrid.h index cb9c3abbff..547f3e4f32 100644 --- a/core/2d/CCActionGrid.h +++ b/core/2d/CCActionGrid.h @@ -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 diff --git a/core/2d/CCActionGrid3D.cpp b/core/2d/CCActionGrid3D.cpp index b363d45c24..d273132c55 100644 --- a/core/2d/CCActionGrid3D.cpp +++ b/core/2d/CCActionGrid3D.cpp @@ -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; diff --git a/core/2d/CCActionGrid3D.h b/core/2d/CCActionGrid3D.h index 22c6a93653..ed7fae5e3f 100644 --- a/core/2d/CCActionGrid3D.h +++ b/core/2d/CCActionGrid3D.h @@ -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 diff --git a/core/2d/CCActionInstant.cpp b/core/2d/CCActionInstant.cpp index d0380c98b5..729840dcf5 100644 --- a/core/2d/CCActionInstant.cpp +++ b/core/2d/CCActionInstant.cpp @@ -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& func) return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -370,7 +370,7 @@ CallFuncN* CallFuncN::create(const std::function& func) return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } diff --git a/core/2d/CCActionInstant.h b/core/2d/CCActionInstant.h index 0a1706c541..32d193657a 100644 --- a/core/2d/CCActionInstant.h +++ b/core/2d/CCActionInstant.h @@ -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. @@ -354,14 +354,14 @@ protected: std::function _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. @@ -389,7 +389,7 @@ protected: std::function _functionN; private: - CC_DISALLOW_COPY_AND_ASSIGN(CallFuncN); + AX_DISALLOW_COPY_AND_ASSIGN(CallFuncN); }; // end of actions group diff --git a/core/2d/CCActionInterval.cpp b/core/2d/CCActionInterval.cpp index cc2c7b5ba1..5601d748f9 100644 --- a/core/2d/CCActionInterval.cpp +++ b/core/2d/CCActionInterval.cpp @@ -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& 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& 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(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; } } diff --git a/core/2d/CCActionInterval.h b/core/2d/CCActionInterval.h index 5ec0f87d83..08ad4622f8 100644 --- a/core/2d/CCActionInterval.h +++ b/core/2d/CCActionInterval.h @@ -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 diff --git a/core/2d/CCActionManager.cpp b/core/2d/CCActionManager.cpp index c11b69f3be..5772c7cdc0 100644 --- a/core/2d/CCActionManager.cpp +++ b/core/2d/CCActionManager.cpp @@ -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& 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); diff --git a/core/2d/CCActionManager.h b/core/2d/CCActionManager.h index 497f93f1e3..e5a6c0ce98 100644 --- a/core/2d/CCActionManager.h +++ b/core/2d/CCActionManager.h @@ -56,7 +56,7 @@ struct _hashElement; @since v0.8 */ -class CC_DLL ActionManager : public Ref +class AX_DLL ActionManager : public Ref { public: /** diff --git a/core/2d/CCActionPageTurn3D.h b/core/2d/CCActionPageTurn3D.h index 1ad129dd32..ae08c0b776 100644 --- a/core/2d/CCActionPageTurn3D.h +++ b/core/2d/CCActionPageTurn3D.h @@ -45,7 +45,7 @@ NS_AX_BEGIN @since v0.8.2 */ -class CC_DLL PageTurn3D : public Grid3DAction +class AX_DLL PageTurn3D : public Grid3DAction { public: /** diff --git a/core/2d/CCActionProgressTimer.cpp b/core/2d/CCActionProgressTimer.cpp index 70b5a31b8c..5f09932abf 100644 --- a/core/2d/CCActionProgressTimer.cpp +++ b/core/2d/CCActionProgressTimer.cpp @@ -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; } diff --git a/core/2d/CCActionProgressTimer.h b/core/2d/CCActionProgressTimer.h index e50ec02532..431f8305cc 100644 --- a/core/2d/CCActionProgressTimer.h +++ b/core/2d/CCActionProgressTimer.h @@ -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 diff --git a/core/2d/CCActionTiledGrid.cpp b/core/2d/CCActionTiledGrid.cpp index a4ce4f680a..4ec55fb513 100644 --- a/core/2d/CCActionTiledGrid.cpp +++ b/core/2d/CCActionTiledGrid.cpp @@ -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) diff --git a/core/2d/CCActionTiledGrid.h b/core/2d/CCActionTiledGrid.h index 71a65eb8ca..c32d0e6b8a 100644 --- a/core/2d/CCActionTiledGrid.h +++ b/core/2d/CCActionTiledGrid.h @@ -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 diff --git a/core/2d/CCActionTween.cpp b/core/2d/CCActionTween.cpp index 9fcb6d9418..299401c42b 100644 --- a/core/2d/CCActionTween.cpp +++ b/core/2d/CCActionTween.cpp @@ -62,7 +62,7 @@ ActionTween* ActionTween::clone() const void ActionTween::startWithTarget(Node* target) { - CCASSERT(dynamic_cast(target), "target must implement ActionTweenDelegate"); + AXASSERT(dynamic_cast(target), "target must implement ActionTweenDelegate"); ActionInterval::startWithTarget(target); _delta = _to - _from; } diff --git a/core/2d/CCActionTween.h b/core/2d/CCActionTween.h index 9cd0b3b3e6..5e6aeddaa2 100644 --- a/core/2d/CCActionTween.h +++ b/core/2d/CCActionTween.h @@ -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: /** diff --git a/core/2d/CCAnimation.cpp b/core/2d/CCAnimation.cpp index c99ad186df..ab38c7e707 100644 --- a/core/2d/CCAnimation.cpp +++ b/core/2d/CCAnimation.cpp @@ -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) diff --git a/core/2d/CCAnimation.h b/core/2d/CCAnimation.h index d4279ed9bb..2d91411d75 100644 --- a/core/2d/CCAnimation.h +++ b/core/2d/CCAnimation.h @@ -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__ diff --git a/core/2d/CCAnimationCache.cpp b/core/2d/CCAnimationCache.cpp index d098a5b1ef..8b2e1c1921 100644 --- a/core/2d/CCAnimationCache.cpp +++ b/core/2d/CCAnimationCache.cpp @@ -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()); diff --git a/core/2d/CCAnimationCache.h b/core/2d/CCAnimationCache.h index 228364739d..b8ffaebd3b 100644 --- a/core/2d/CCAnimationCache.h +++ b/core/2d/CCAnimationCache.h @@ -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__ diff --git a/core/2d/CCAtlasNode.cpp b/core/2d/CCAtlasNode.cpp index 670676e267..dbae27c2f5 100644 --- a/core/2d/CCAtlasNode.cpp +++ b/core/2d/CCAtlasNode.cpp @@ -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; } diff --git a/core/2d/CCAtlasNode.h b/core/2d/CCAtlasNode.h index 6e1f01b898..6a7ec0d2a3 100644 --- a/core/2d/CCAtlasNode.h +++ b/core/2d/CCAtlasNode.h @@ -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 diff --git a/core/2d/CCAutoPolygon.cpp b/core/2d/CCAutoPolygon.cpp index dedce69b69..085dc6d17b 100644 --- a/core/2d/CCAutoPolygon.cpp +++ b/core/2d/CCAutoPolygon.cpp @@ -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 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 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 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; } diff --git a/core/2d/CCAutoPolygon.h b/core/2d/CCAutoPolygon.h index b6efcff087..09ebdc2ac2 100644 --- a/core/2d/CCAutoPolygon.h +++ b/core/2d/CCAutoPolygon.h @@ -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: /** diff --git a/core/2d/CCCamera.cpp b/core/2d/CCCamera.cpp index 75798fe6d9..6c650c5196 100644 --- a/core/2d/CCCamera.cpp +++ b/core/2d/CCCamera.cpp @@ -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; } diff --git a/core/2d/CCCamera.h b/core/2d/CCCamera.h index 8fffddbdd6..8d446db44d 100644 --- a/core/2d/CCCamera.h +++ b/core/2d/CCCamera.h @@ -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; diff --git a/core/2d/CCCameraBackgroundBrush.cpp b/core/2d/CCCameraBackgroundBrush.cpp index f992caf6d9..745941b700 100644 --- a/core/2d/CCCameraBackgroundBrush.cpp +++ b/core/2d/CCCameraBackgroundBrush.cpp @@ -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()); } diff --git a/core/2d/CCCameraBackgroundBrush.h b/core/2d/CCCameraBackgroundBrush.h index 715f824c52..cfc3aa6e7b 100644 --- a/core/2d/CCCameraBackgroundBrush.h +++ b/core/2d/CCCameraBackgroundBrush.h @@ -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 diff --git a/core/2d/CCClippingNode.cpp b/core/2d/CCClippingNode.cpp index c1cc0dcdb3..9feabc2976 100644 --- a/core/2d/CCClippingNode.cpp +++ b/core/2d/CCClippingNode.cpp @@ -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(); diff --git a/core/2d/CCClippingNode.h b/core/2d/CCClippingNode.h index 16901a2ad0..806f97d9fb 100644 --- a/core/2d/CCClippingNode.h +++ b/core/2d/CCClippingNode.h @@ -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 _originalStencilProgramState; private: - CC_DISALLOW_COPY_AND_ASSIGN(ClippingNode); + AX_DISALLOW_COPY_AND_ASSIGN(ClippingNode); }; /** @} */ NS_AX_END diff --git a/core/2d/CCClippingRectangleNode.cpp b/core/2d/CCClippingRectangleNode.cpp index 60f68536f4..862e236866 100644 --- a/core/2d/CCClippingRectangleNode.cpp +++ b/core/2d/CCClippingRectangleNode.cpp @@ -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); } diff --git a/core/2d/CCClippingRectangleNode.h b/core/2d/CCClippingRectangleNode.h index d4c849f517..77e6595168 100644 --- a/core/2d/CCClippingRectangleNode.h +++ b/core/2d/CCClippingRectangleNode.h @@ -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: /** diff --git a/core/2d/CCComponent.cpp b/core/2d/CCComponent.cpp index 5222172b32..4b731562c2 100644 --- a/core/2d/CCComponent.cpp +++ b/core/2d/CCComponent.cpp @@ -61,7 +61,7 @@ Component* Component::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; diff --git a/core/2d/CCComponent.h b/core/2d/CCComponent.h index fc79a90d63..375f0b8d62 100644 --- a/core/2d/CCComponent.h +++ b/core/2d/CCComponent.h @@ -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 @@ -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__ diff --git a/core/2d/CCComponentContainer.cpp b/core/2d/CCComponentContainer.cpp index 50993f5ffb..ee61eac8c2 100644 --- a/core/2d/CCComponentContainer.cpp +++ b/core/2d/CCComponentContainer.cpp @@ -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); } } diff --git a/core/2d/CCComponentContainer.h b/core/2d/CCComponentContainer.h index 89f9afa86e..d6ff59d268 100644 --- a/core/2d/CCComponentContainer.h +++ b/core/2d/CCComponentContainer.h @@ -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__ diff --git a/core/2d/CCDrawNode.cpp b/core/2d/CCDrawNode.cpp index 1e85611338..dc3fb85ffe 100644 --- a/core/2d/CCDrawNode.cpp +++ b/core/2d/CCDrawNode.cpp @@ -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); diff --git a/core/2d/CCDrawNode.h b/core/2d/CCDrawNode.h index 049cd93c0b..ad952fb497 100644 --- a/core/2d/CCDrawNode.h +++ b/core/2d/CCDrawNode.h @@ -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 diff --git a/core/2d/CCFastTMXLayer.cpp b/core/2d/CCFastTMXLayer.cpp index 22265096a6..2cd59291b1 100644 --- a/core/2d/CCFastTMXLayer.cpp +++ b/core/2d/CCFastTMXLayer.cpp @@ -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)tileCoordinate.x + (int)tileCoordinate.y * _layerSize.width)); @@ -737,10 +737,10 @@ int FastTMXLayer::getVertexZForPos(const Vec2& pos) ret = static_cast(-(_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, ¤tFlags); @@ -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); } diff --git a/core/2d/CCFastTMXLayer.h b/core/2d/CCFastTMXLayer.h index 8c0adb5439..e07cadc53b 100644 --- a/core/2d/CCFastTMXLayer.h +++ b/core/2d/CCFastTMXLayer.h @@ -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 _tileToQuadIndex; std::vector _totalQuads; -#ifdef CC_FAST_TILEMAP_32_BIT_INDICES +#ifdef AX_FAST_TILEMAP_32_BIT_INDICES std::vector _indices; #else std::vector _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); diff --git a/core/2d/CCFastTMXTiledMap.cpp b/core/2d/CCFastTMXTiledMap.cpp index ba63586670..e9894f1ee2 100644 --- a/core/2d/CCFastTMXTiledMap.cpp +++ b/core/2d/CCFastTMXTiledMap.cpp @@ -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) { diff --git a/core/2d/CCFastTMXTiledMap.h b/core/2d/CCFastTMXTiledMap.h index d4aeb26de2..497776d54f 100644 --- a/core/2d/CCFastTMXTiledMap.h +++ b/core/2d/CCFastTMXTiledMap.h @@ -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 diff --git a/core/2d/CCFont.h b/core/2d/CCFont.h index e699b03dbd..6fdff63689 100644 --- a/core/2d/CCFont.h +++ b/core/2d/CCFont.h @@ -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; diff --git a/core/2d/CCFontAtlas.cpp b/core/2d/CCFontAtlas.cpp index 850e1f3360..753f8ad131 100644 --- a/core/2d/CCFontAtlas.cpp +++ b/core/2d/CCFontAtlas.cpp @@ -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 @@ -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) diff --git a/core/2d/CCFontAtlas.h b/core/2d/CCFontAtlas.h index eb2b6bb96e..65afc0122f 100644 --- a/core/2d/CCFontAtlas.h +++ b/core/2d/CCFontAtlas.h @@ -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 diff --git a/core/2d/CCFontAtlasCache.cpp b/core/2d/CCFontAtlasCache.cpp index 752c7b133b..bdbf72639d 100644 --- a/core/2d/CCFontAtlasCache.cpp +++ b/core/2d/CCFontAtlasCache.cpp @@ -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 diff --git a/core/2d/CCFontAtlasCache.h b/core/2d/CCFontAtlasCache.h index 3a93dbd114..ac75932201 100644 --- a/core/2d/CCFontAtlasCache.h +++ b/core/2d/CCFontAtlasCache.h @@ -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. diff --git a/core/2d/CCFontCharMap.cpp b/core/2d/CCFontCharMap.cpp index 2f56e84683..04bd453218 100644 --- a/core/2d/CCFontCharMap.cpp +++ b/core/2d/CCFontCharMap.cpp @@ -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; diff --git a/core/2d/CCFontFNT.cpp b/core/2d/CCFontFNT.cpp index 4d77b9b4c7..8473d118db 100644 --- a/core/2d/CCFontFNT.cpp +++ b/core/2d/CCFontFNT.cpp @@ -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( - "", (size_t)this, + "", (size_t)this, static_cast(_fontDefDictionary.size()), static_cast(_kerningDictionary.size()), _atlasName.c_str()); } @@ -156,7 +156,7 @@ std::set* 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* 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* 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* 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; } diff --git a/core/2d/CCFontFNT.h b/core/2d/CCFontFNT.h index 0c5e854780..46bb5bd654 100644 --- a/core/2d/CCFontFNT.h +++ b/core/2d/CCFontFNT.h @@ -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. diff --git a/core/2d/CCFontFreeType.cpp b/core/2d/CCFontFreeType.cpp index d6328b08a6..6edebfb04d 100644 --- a/core/2d/CCFontFreeType.cpp +++ b/core/2d/CCFontFreeType.cpp @@ -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(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}; diff --git a/core/2d/CCFontFreeType.h b/core/2d/CCFontFreeType.h index b7fc133856..697a19086d 100644 --- a/core/2d/CCFontFreeType.h +++ b/core/2d/CCFontFreeType.h @@ -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; diff --git a/core/2d/CCGrid.cpp b/core/2d/CCGrid.cpp index 0818c70f53..52174efb6e 100644 --- a/core/2d/CCGrid.cpp +++ b/core/2d/CCGrid.cpp @@ -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((_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; diff --git a/core/2d/CCGrid.h b/core/2d/CCGrid.h index 07aaa769cc..efc2fc5914 100644 --- a/core/2d/CCGrid.h +++ b/core/2d/CCGrid.h @@ -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. */ diff --git a/core/2d/CCLabel.cpp b/core/2d/CCLabel.cpp index 07417f0b09..3768bc4ef9 100644 --- a/core/2d/CCLabel.cpp +++ b/core/2d/CCLabel.cpp @@ -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 } diff --git a/core/2d/CCLabel.h b/core/2d/CCLabel.h index 26ff70520c..48d08e0673 100644 --- a/core/2d/CCLabel.h +++ b/core/2d/CCLabel.h @@ -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 diff --git a/core/2d/CCLabelAtlas.cpp b/core/2d/CCLabelAtlas.cpp index 7cf365f084..7fd4211d14 100644 --- a/core/2d/CCLabelAtlas.cpp +++ b/core/2d/CCLabelAtlas.cpp @@ -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(dict["itemWidth"].asInt() / CC_CONTENT_SCALE_FACTOR()); - unsigned int height = static_cast(dict["itemHeight"].asInt() / CC_CONTENT_SCALE_FACTOR()); + unsigned int width = static_cast(dict["itemWidth"].asInt() / AX_CONTENT_SCALE_FACTOR()); + unsigned int height = static_cast(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(_itemWidth); itemHeightInPixels = static_cast(_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); diff --git a/core/2d/CCLabelAtlas.h b/core/2d/CCLabelAtlas.h index 15d7e0284a..68343f0b89 100644 --- a/core/2d/CCLabelAtlas.h +++ b/core/2d/CCLabelAtlas.h @@ -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 diff --git a/core/2d/CCLabelTextFormatter.cpp b/core/2d/CCLabelTextFormatter.cpp index 559303b610..5652f741d2 100644 --- a/core/2d/CCLabelTextFormatter.cpp +++ b/core/2d/CCLabelTextFormatter.cpp @@ -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::functionautorelease(); 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& 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& 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& 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); diff --git a/core/2d/CCLayer.h b/core/2d/CCLayer.h index 4575b72e8e..41b5a8a4dc 100644 --- a/core/2d/CCLayer.h +++ b/core/2d/CCLayer.h @@ -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 _layers; private: - CC_DISALLOW_COPY_AND_ASSIGN(LayerMultiplex); + AX_DISALLOW_COPY_AND_ASSIGN(LayerMultiplex); }; // end of _2d group diff --git a/core/2d/CCLight.cpp b/core/2d/CCLight.cpp index d5e6ef8ba7..5f25441e62 100644 --- a/core/2d/CCLight.cpp +++ b/core/2d/CCLight.cpp @@ -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)); } diff --git a/core/2d/CCLight.h b/core/2d/CCLight.h index 67ca1e1a4e..631dff828a 100644 --- a/core/2d/CCLight.h +++ b/core/2d/CCLight.h @@ -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: /** diff --git a/core/2d/CCMenu.cpp b/core/2d/CCMenu.cpp index 85d5a7c709..06511422ff 100644 --- a/core/2d/CCMenu.cpp +++ b/core/2d/CCMenu.cpp @@ -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& arrayOfItems) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -144,10 +144,10 @@ bool Menu::initWithArray(const Vector& 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(child) != nullptr, "Menu only supports MenuItem objects as children"); + AXASSERT(dynamic_cast(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(child) != nullptr, "Menu only supports MenuItem objects as children"); + AXASSERT(dynamic_cast(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(child) != nullptr, "Menu only supports MenuItem objects as children"); + AXASSERT(dynamic_cast(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(); diff --git a/core/2d/CCMenu.h b/core/2d/CCMenu.h index a288360a4d..062864a39c 100644 --- a/core/2d/CCMenu.h +++ b/core/2d/CCMenu.h @@ -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 diff --git a/core/2d/CCMenuItem.cpp b/core/2d/CCMenuItem.cpp index 6bfab4ce64..51fe37f93e 100644 --- a/core/2d/CCMenuItem.cpp +++ b/core/2d/CCMenuItem.cpp @@ -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(); diff --git a/core/2d/CCMenuItem.h b/core/2d/CCMenuItem.h index a75648a545..4f0aa761c0 100644 --- a/core/2d/CCMenuItem.h +++ b/core/2d/CCMenuItem.h @@ -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 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 _subItems; private: - CC_DISALLOW_COPY_AND_ASSIGN(MenuItemToggle); + AX_DISALLOW_COPY_AND_ASSIGN(MenuItemToggle); }; // end of 2d group diff --git a/core/2d/CCMotionStreak.cpp b/core/2d/CCMotionStreak.cpp index 053f211086..8ef758dbf8 100644 --- a/core/2d/CCMotionStreak.cpp +++ b/core/2d/CCMotionStreak.cpp @@ -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; } diff --git a/core/2d/CCMotionStreak.h b/core/2d/CCMotionStreak.h index 1340fec9b5..a9c3f01ab0 100644 --- a/core/2d/CCMotionStreak.h +++ b/core/2d/CCMotionStreak.h @@ -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 diff --git a/core/2d/CCNode.cpp b/core/2d/CCNode.cpp index cf5bb7ca20..e52045abd3 100644 --- a/core/2d/CCNode.cpp +++ b/core/2d/CCNode.cpp @@ -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 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 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; diff --git a/core/2d/CCNode.h b/core/2d/CCNode.h index 3b467fadd8..2dcc696c96 100644 --- a/core/2d/CCNode.h +++ b/core/2d/CCNode.h @@ -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::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 /// @} diff --git a/core/2d/CCNodeGrid.cpp b/core/2d/CCNodeGrid.cpp index 6ef17ddf29..1bfd47da6a 100644 --- a/core/2d/CCNodeGrid.cpp +++ b/core/2d/CCNodeGrid.cpp @@ -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; } diff --git a/core/2d/CCNodeGrid.h b/core/2d/CCNodeGrid.h index 2f5eb54503..4d25d38c47 100644 --- a/core/2d/CCNodeGrid.h +++ b/core/2d/CCNodeGrid.h @@ -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 diff --git a/core/2d/CCParallaxNode.cpp b/core/2d/CCParallaxNode.cpp index a03edf9153..cdf2d973e5 100644 --- a/core/2d/CCParallaxNode.cpp +++ b/core/2d/CCParallaxNode.cpp @@ -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); diff --git a/core/2d/CCParallaxNode.h b/core/2d/CCParallaxNode.h index ef4a3008a5..1a8e01799d 100644 --- a/core/2d/CCParallaxNode.h +++ b/core/2d/CCParallaxNode.h @@ -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 diff --git a/core/2d/CCParticleBatchNode.cpp b/core/2d/CCParticleBatchNode.cpp index 5afcbcc5ef..7791579382 100644 --- a/core/2d/CCParticleBatchNode.cpp +++ b/core/2d/CCParticleBatchNode.cpp @@ -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(aChild) != nullptr, + AXASSERT(aChild != nullptr, "Argument must be non-nullptr"); + AXASSERT(dynamic_cast(aChild) != nullptr, "CCParticleBatchNode only supports QuadParticleSystems as children"); ParticleSystem* child = static_cast(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(aChild) != nullptr, + AXASSERT(aChild != nullptr, "Argument must be non-nullptr"); + AXASSERT(dynamic_cast(aChild) != nullptr, "CCParticleBatchNode only supports QuadParticleSystems as children"); ParticleSystem* child = static_cast(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(aChild) != nullptr, + AXASSERT(aChild != nullptr, "Child must be non-nullptr"); + AXASSERT(dynamic_cast(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(aChild); @@ -411,9 +411,9 @@ void ParticleBatchNode::removeChild(Node* aChild, bool cleanup) if (aChild == nullptr) return; - CCASSERT(dynamic_cast(aChild) != nullptr, + AXASSERT(dynamic_cast(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(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; } diff --git a/core/2d/CCParticleBatchNode.h b/core/2d/CCParticleBatchNode.h index 03539690fa..0d35b5fee0 100644 --- a/core/2d/CCParticleBatchNode.h +++ b/core/2d/CCParticleBatchNode.h @@ -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. diff --git a/core/2d/CCParticleExamples.cpp b/core/2d/CCParticleExamples.cpp index 4ec7944b69..0834e12701 100644 --- a/core/2d/CCParticleExamples.cpp +++ b/core/2d/CCParticleExamples.cpp @@ -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; } diff --git a/core/2d/CCParticleExamples.h b/core/2d/CCParticleExamples.h index a067ae3958..107130b39f 100644 --- a/core/2d/CCParticleExamples.h +++ b/core/2d/CCParticleExamples.h @@ -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 diff --git a/core/2d/CCParticleSystem.cpp b/core/2d/CCParticleSystem.cpp index b5a0754405..404892db51 100644 --- a/core/2d/CCParticleSystem.cpp +++ b/core/2d/CCParticleSystem.cpp @@ -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::__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 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); } diff --git a/core/2d/CCParticleSystem.h b/core/2d/CCParticleSystem.h index acb00b6ac6..46ef4c35d0 100644 --- a/core/2d/CCParticleSystem.h +++ b/core/2d/CCParticleSystem.h @@ -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 diff --git a/core/2d/CCParticleSystemQuad.cpp b/core/2d/CCParticleSystemQuad.cpp index e83713ee21..19fc4469d3 100644 --- a/core/2d/CCParticleSystemQuad.cpp +++ b/core/2d/CCParticleSystemQuad.cpp @@ -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; } diff --git a/core/2d/CCParticleSystemQuad.h b/core/2d/CCParticleSystemQuad.h index a84eb4c3a0..6ee53372f9 100644 --- a/core/2d/CCParticleSystemQuad.h +++ b/core/2d/CCParticleSystemQuad.h @@ -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 diff --git a/core/2d/CCPlistSpriteSheetLoader.cpp b/core/2d/CCPlistSpriteSheetLoader.cpp index af98e06652..a3c848e7c8 100644 --- a/core/2d/CCPlistSpriteSheetLoader.cpp +++ b/core/2d/CCPlistSpriteSheetLoader.cpp @@ -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 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(); @@ -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()); } } diff --git a/core/2d/CCProgressTimer.cpp b/core/2d/CCProgressTimer.cpp index c1adb585b6..6a0e30279e 100644 --- a/core/2d/CCProgressTimer.cpp +++ b/core/2d/CCProgressTimer.cpp @@ -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()); diff --git a/core/2d/CCProgressTimer.h b/core/2d/CCProgressTimer.h index ff2591db31..073f44b123 100644 --- a/core/2d/CCProgressTimer.h +++ b/core/2d/CCProgressTimer.h @@ -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 diff --git a/core/2d/CCProtectedNode.cpp b/core/2d/CCProtectedNode.cpp index 728e13977b..c0a97b63e3 100644 --- a/core/2d/CCProtectedNode.cpp +++ b/core/2d/CCProtectedNode.cpp @@ -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); diff --git a/core/2d/CCProtectedNode.h b/core/2d/CCProtectedNode.h index 8259da729d..76fd415be9 100644 --- a/core/2d/CCProtectedNode.h +++ b/core/2d/CCProtectedNode.h @@ -43,7 +43,7 @@ NS_AX_BEGIN *@brief A inner node type mainly used for UI module. * It is useful for composing complex node type and it's children are protected. */ -class CC_DLL ProtectedNode : public Node +class AX_DLL ProtectedNode : public Node { public: /** @@ -199,7 +199,7 @@ protected: bool _reorderProtectedChildDirty; private: - CC_DISALLOW_COPY_AND_ASSIGN(ProtectedNode); + AX_DISALLOW_COPY_AND_ASSIGN(ProtectedNode); }; // end of 2d group diff --git a/core/2d/CCRenderTexture.cpp b/core/2d/CCRenderTexture.cpp index d56e10d399..df1f2b15bd 100644 --- a/core/2d/CCRenderTexture.cpp +++ b/core/2d/CCRenderTexture.cpp @@ -45,48 +45,48 @@ NS_AX_BEGIN // implementation RenderTexture RenderTexture::RenderTexture() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // Listen this event to save render texture before come to background. // Then it can be restored after coming to foreground on Android. auto toBackgroundListener = - EventListenerCustom::create(EVENT_COME_TO_BACKGROUND, CC_CALLBACK_1(RenderTexture::listenToBackground, this)); + EventListenerCustom::create(EVENT_COME_TO_BACKGROUND, AX_CALLBACK_1(RenderTexture::listenToBackground, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(toBackgroundListener, this); auto toForegroundListener = - EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(RenderTexture::listenToForeground, this)); + EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, AX_CALLBACK_1(RenderTexture::listenToForeground, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(toForegroundListener, this); #endif } RenderTexture::~RenderTexture() { - CC_SAFE_RELEASE(_renderTarget); - CC_SAFE_RELEASE(_sprite); - CC_SAFE_RELEASE(_depthStencilTexture); - CC_SAFE_RELEASE(_UITextureImage); + AX_SAFE_RELEASE(_renderTarget); + AX_SAFE_RELEASE(_sprite); + AX_SAFE_RELEASE(_depthStencilTexture); + AX_SAFE_RELEASE(_UITextureImage); } void RenderTexture::listenToBackground(EventCustom* /*event*/) { // We have not found a way to dispatch the enter background message before the texture data are destroyed. // So we disable this pair of message handler at present. -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // to get the rendered texture data auto func = [&](Image* uiTextureImage) { if (uiTextureImage) { - CC_SAFE_RELEASE(_UITextureImage); + AX_SAFE_RELEASE(_UITextureImage); _UITextureImage = uiTextureImage; - CC_SAFE_RETAIN(_UITextureImage); + AX_SAFE_RETAIN(_UITextureImage); const Vec2& s = _texture2D->getContentSizeInPixels(); VolatileTextureMgr::addDataTexture(_texture2D, uiTextureImage->getData(), s.width * s.height * 4, backend::PixelFormat::RGBA8, s); } else { - CCLOG("Cache rendertexture failed!"); + AXLOG("Cache rendertexture failed!"); } - CC_SAFE_RELEASE(uiTextureImage); + AX_SAFE_RELEASE(uiTextureImage); }; auto callback = std::bind(func, std::placeholders::_1); newImage(callback, false); @@ -96,7 +96,7 @@ void RenderTexture::listenToBackground(EventCustom* /*event*/) void RenderTexture::listenToForeground(EventCustom* /*event*/) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA const Vec2& s = _texture2D->getContentSizeInPixels(); // TODO new-renderer: field _depthAndStencilFormat removal // if (_depthAndStencilFormat != 0) @@ -117,7 +117,7 @@ RenderTexture* RenderTexture::create(int w, int h, backend::PixelFormat eFormat, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -130,7 +130,7 @@ RenderTexture* RenderTexture::create(int w, int h, backend::PixelFormat eFormat, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -143,7 +143,7 @@ RenderTexture* RenderTexture::create(int w, int h, bool sharedRenderTarget) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -158,14 +158,14 @@ bool RenderTexture::initWithWidthAndHeight(int w, PixelFormat depthStencilFormat, bool sharedRenderTarget) { - CCASSERT(format != backend::PixelFormat::A8, "only RGB and RGBA formats are valid for a render texture"); + AXASSERT(format != backend::PixelFormat::A8, "only RGB and RGBA formats are valid for a render texture"); bool ret = false; do { _fullRect = _rtTextureRect = Rect(0, 0, w, h); - w = (int)(w * CC_CONTENT_SCALE_FACTOR()); - h = (int)(h * CC_CONTENT_SCALE_FACTOR()); + w = (int)(w * AX_CONTENT_SCALE_FACTOR()); + h = (int)(h * AX_CONTENT_SCALE_FACTOR()); _fullviewPort = Rect(0, 0, w, h); // textures must be power of two squared @@ -189,7 +189,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, descriptor.textureUsage = TextureUsage::RENDER_TARGET; descriptor.textureFormat = PixelFormat::RGBA8; _texture2D = new Texture2D(); - _texture2D->updateTextureDescriptor(descriptor, !!CC_ENABLE_PREMULTIPLIED_ALPHA); + _texture2D->updateTextureDescriptor(descriptor, !!AX_ENABLE_PREMULTIPLIED_ALPHA); _renderTargetFlags = RenderTargetFlag::COLOR; if (PixelFormat::D24S8 == depthStencilFormat) @@ -201,7 +201,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, _depthStencilTexture->updateTextureDescriptor(descriptor); } - CC_SAFE_RELEASE(_renderTarget); + AX_SAFE_RELEASE(_renderTarget); if (sharedRenderTarget) { @@ -229,7 +229,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, // retained setSprite(Sprite::createWithTexture(_texture2D)); -#if defined(CC_USE_GL) || defined(CC_USE_GLES) +#if defined(AX_USE_GL) || defined(AX_USE_GLES) _sprite->setFlippedY(true); #endif @@ -260,7 +260,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, void RenderTexture::setSprite(Sprite* sprite) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -269,9 +269,9 @@ void RenderTexture::setSprite(Sprite* sprite) if (_sprite) sEngine->releaseScriptObject(this, _sprite); } -#endif // 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; } @@ -379,12 +379,12 @@ bool RenderTexture::saveToFileAsNonPMA(std::string_view filename, bool isRGBA, S else if (basename.find(".jpg") != std::string::npos) { if (isRGBA) - CCLOG("RGBA is not supported for JPG format."); + AXLOG("RGBA is not supported for JPG format."); return saveToFileAsNonPMA(filename, Image::Format::JPG, false, callback); } else { - CCLOG("Only PNG and JPG format are supported now!"); + AXLOG("Only PNG and JPG format are supported now!"); } return saveToFileAsNonPMA(filename, Image::Format::JPG, false, callback); @@ -402,12 +402,12 @@ bool RenderTexture::saveToFile(std::string_view filename, bool isRGBA, SaveFileC else if (basename.find(".jpg") != std::string::npos) { if (isRGBA) - CCLOG("RGBA is not supported for JPG format."); + AXLOG("RGBA is not supported for JPG format."); return saveToFile(filename, Image::Format::JPG, false, callback); } else { - CCLOG("Only PNG and JPG format are supported now!"); + AXLOG("Only PNG and JPG format are supported now!"); } return saveToFile(filename, Image::Format::JPG, false, callback); @@ -418,10 +418,10 @@ bool RenderTexture::saveToFileAsNonPMA(std::string_view fileName, bool isRGBA, SaveFileCallbackType callback) { - CCASSERT(format == Image::Format::JPG || format == Image::Format::PNG, + AXASSERT(format == Image::Format::JPG || format == Image::Format::PNG, "the image can only be saved as JPG or PNG format"); if (isRGBA && format == Image::Format::JPG) - CCLOG("RGBA is not supported for JPG format"); + AXLOG("RGBA is not supported for JPG format"); _saveFileCallback = callback; @@ -430,7 +430,7 @@ bool RenderTexture::saveToFileAsNonPMA(std::string_view fileName, auto renderer = _director->getRenderer(); auto saveToFileCommand = renderer->nextCallbackCommand(); saveToFileCommand->init(_globalZOrder); - saveToFileCommand->func = CC_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, true); + saveToFileCommand->func = AX_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, true); renderer->addCommand(saveToFileCommand); return true; @@ -441,10 +441,10 @@ bool RenderTexture::saveToFile(std::string_view fileName, bool isRGBA, SaveFileCallbackType callback) { - CCASSERT(format == Image::Format::JPG || format == Image::Format::PNG, + AXASSERT(format == Image::Format::JPG || format == Image::Format::PNG, "the image can only be saved as JPG or PNG format"); if (isRGBA && format == Image::Format::JPG) - CCLOG("RGBA is not supported for JPG format"); + AXLOG("RGBA is not supported for JPG format"); _saveFileCallback = callback; @@ -453,7 +453,7 @@ bool RenderTexture::saveToFile(std::string_view fileName, auto renderer = _director->getRenderer(); auto saveToFileCommand = renderer->nextCallbackCommand(); saveToFileCommand->init(_globalZOrder); - saveToFileCommand->func = CC_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, false); + saveToFileCommand->func = AX_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, false); _director->getRenderer()->addCommand(saveToFileCommand); return true; @@ -481,7 +481,7 @@ void RenderTexture::onSaveToFile(std::string_view filename, bool isRGBA, bool fo /* get buffer as Image */ void RenderTexture::newImage(std::function)> imageCallback, bool flipImage) { - CCASSERT(_pixelFormat == backend::PixelFormat::RGBA8, "only RGBA8888 can be saved as image"); + AXASSERT(_pixelFormat == backend::PixelFormat::RGBA8, "only RGBA8888 can be saved as image"); if ((nullptr == _texture2D)) { @@ -619,7 +619,7 @@ void RenderTexture::begin() auto beginCommand = renderer->nextCallbackCommand(); beginCommand->init(_globalZOrder); - beginCommand->func = CC_CALLBACK_0(RenderTexture::onBegin, this); + beginCommand->func = AX_CALLBACK_0(RenderTexture::onBegin, this); renderer->addCommand(beginCommand); } @@ -629,7 +629,7 @@ void RenderTexture::end() auto endCommand = renderer->nextCallbackCommand(); endCommand->init(_globalZOrder); - endCommand->func = CC_CALLBACK_0(RenderTexture::onEnd, this); + endCommand->func = AX_CALLBACK_0(RenderTexture::onEnd, this); renderer->addCommand(endCommand); renderer->popGroup(); diff --git a/core/2d/CCRenderTexture.h b/core/2d/CCRenderTexture.h index 6137342dcc..e90f494582 100644 --- a/core/2d/CCRenderTexture.h +++ b/core/2d/CCRenderTexture.h @@ -58,7 +58,7 @@ class EventCustom; * There are also functions for saving the render texture to disk in PNG or JPG format. * @since v0.8.1 */ -class CC_DLL RenderTexture : public Node +class AX_DLL RenderTexture : public Node { public: using SaveFileCallbackType = std::function; @@ -430,7 +430,7 @@ protected: Mat4 _transformMatrix, _projectionMatrix; private: - CC_DISALLOW_COPY_AND_ASSIGN(RenderTexture); + AX_DISALLOW_COPY_AND_ASSIGN(RenderTexture); }; // end of textures group diff --git a/core/2d/CCScene.cpp b/core/2d/CCScene.cpp index 7b547d97d5..8c70db3621 100644 --- a/core/2d/CCScene.cpp +++ b/core/2d/CCScene.cpp @@ -34,16 +34,16 @@ THE SOFTWARE. #include "base/ccUTF8.h" #include "renderer/CCRenderer.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "physics/CCPhysicsWorld.h" #endif -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION # include "physics3d/CCPhysics3DWorld.h" # include "physics3d/CCPhysics3DComponent.h" #endif -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "navmesh/CCNavMesh.h" #endif @@ -64,36 +64,36 @@ Scene::Scene() Scene::~Scene() { -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION - CC_SAFE_RELEASE(_physics3DWorld); - CC_SAFE_RELEASE(_physics3dDebugCamera); +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION + AX_SAFE_RELEASE(_physics3DWorld); + AX_SAFE_RELEASE(_physics3dDebugCamera); #endif -#if CC_USE_NAVMESH - CC_SAFE_RELEASE(_navMesh); +#if AX_USE_NAVMESH + AX_SAFE_RELEASE(_navMesh); #endif _director->getEventDispatcher()->removeEventListener(_event); - CC_SAFE_RELEASE(_event); + AX_SAFE_RELEASE(_event); -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS delete _physicsWorld; #endif -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseAllChildrenRecursive(this); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS } -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH void Scene::setNavMesh(NavMesh* navMesh) { if (_navMesh != navMesh) { - CC_SAFE_RETAIN(navMesh); - CC_SAFE_RELEASE(_navMesh); + AX_SAFE_RETAIN(navMesh); + AX_SAFE_RELEASE(_navMesh); _navMesh = navMesh; } } @@ -131,7 +131,7 @@ Scene* Scene::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } } @@ -146,7 +146,7 @@ Scene* Scene::createWithSize(const Vec2& size) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } } @@ -215,7 +215,7 @@ void Scene::render(Renderer* renderer, const Mat4& eyeTransform, const Mat4* eye camera->clearBackground(); // visit the scene visit(renderer, transform, 0); -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH if (_navMesh && _navMeshDebugCamera == camera) { _navMesh->debugDraw(renderer); @@ -231,7 +231,7 @@ void Scene::render(Renderer* renderer, const Mat4& eyeTransform, const Mat4* eye // camera->setNodeToParentTransform(eyeCopy); } -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION if (_physics3DWorld && _physics3DWorld->isDebugDrawEnabled()) { Camera* physics3dDebugCamera = _physics3dDebugCamera != nullptr ? _physics3dDebugCamera : defaultCamera; @@ -272,26 +272,26 @@ void Scene::removeAllChildren() } } -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION void Scene::setPhysics3DDebugCamera(Camera* camera) { - CC_SAFE_RETAIN(camera); - CC_SAFE_RELEASE(_physics3dDebugCamera); + AX_SAFE_RETAIN(camera); + AX_SAFE_RELEASE(_physics3dDebugCamera); _physics3dDebugCamera = camera; } #endif -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH void Scene::setNavMeshDebugCamera(Camera* camera) { - CC_SAFE_RETAIN(camera); - CC_SAFE_RELEASE(_navMeshDebugCamera); + AX_SAFE_RETAIN(camera); + AX_SAFE_RELEASE(_navMeshDebugCamera); _navMeshDebugCamera = camera; } #endif -#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION)) +#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION)) Scene* Scene::createWithPhysics() { @@ -303,7 +303,7 @@ Scene* Scene::createWithPhysics() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } } @@ -316,7 +316,7 @@ bool Scene::initWithPhysics() bool Scene::initPhysicsWorld() { -# if CC_USE_PHYSICS +# if AX_USE_PHYSICS _physicsWorld = PhysicsWorld::construct(this); # endif @@ -325,9 +325,9 @@ bool Scene::initPhysicsWorld() { this->setContentSize(_director->getWinSize()); -# if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +# if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION Physics3DWorldDes info; - CC_BREAK_IF(!(_physics3DWorld = Physics3DWorld::create(&info))); + AX_BREAK_IF(!(_physics3DWorld = Physics3DWorld::create(&info))); _physics3DWorld->retain(); # endif @@ -339,21 +339,21 @@ bool Scene::initPhysicsWorld() #endif -#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION) || CC_USE_NAVMESH) +#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION) || AX_USE_NAVMESH) void Scene::stepPhysicsAndNavigation(float deltaTime) { -# if CC_USE_PHYSICS +# if AX_USE_PHYSICS if (_physicsWorld && _physicsWorld->isAutoStep()) _physicsWorld->update(deltaTime); # endif -# if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +# if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION if (_physics3DWorld) { _physics3DWorld->stepSimulate(deltaTime); } # endif -# if CC_USE_NAVMESH +# if AX_USE_NAVMESH if (_navMesh) { _navMesh->update(deltaTime); diff --git a/core/2d/CCScene.h b/core/2d/CCScene.h index 47d7967282..d22e7da1b5 100644 --- a/core/2d/CCScene.h +++ b/core/2d/CCScene.h @@ -40,13 +40,13 @@ class BaseLight; class Renderer; class EventListenerCustom; class EventCustom; -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS class PhysicsWorld; #endif -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION class Physics3DWorld; #endif -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH class NavMesh; #endif @@ -68,7 +68,7 @@ It is a good practice to use a Scene as the parent of all your nodes. Scene will create a default camera for you. */ -class CC_DLL Scene : public Node +class AX_DLL Scene : public Node { public: /** Creates a new Scene object. @@ -151,11 +151,11 @@ protected: std::vector _lights; private: - CC_DISALLOW_COPY_AND_ASSIGN(Scene); + AX_DISALLOW_COPY_AND_ASSIGN(Scene); -#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION)) +#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION)) public: -# if CC_USE_PHYSICS +# if AX_USE_PHYSICS /** Get the physics world of the scene. * @return The physics world of the scene. * @js NA @@ -163,7 +163,7 @@ public: PhysicsWorld* getPhysicsWorld() const { return _physicsWorld; } # endif -# if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +# if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION /** Get the 3d physics world of the scene. * @return The 3d physics world of the scene. * @js NA @@ -189,17 +189,17 @@ public: protected: void addChildToPhysicsWorld(Node* child); -# if CC_USE_PHYSICS +# if AX_USE_PHYSICS PhysicsWorld* _physicsWorld = nullptr; # endif -# if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +# if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION Physics3DWorld* _physics3DWorld = nullptr; Camera* _physics3dDebugCamera = nullptr; # endif -#endif // (CC_USE_PHYSICS || CC_USE_3D_PHYSICS) +#endif // (AX_USE_PHYSICS || AX_USE_3D_PHYSICS) -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH public: /** set navigation mesh */ void setNavMesh(NavMesh* navMesh); @@ -215,7 +215,7 @@ protected: Camera* _navMeshDebugCamera = nullptr; #endif -#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION) || CC_USE_NAVMESH) +#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION) || AX_USE_NAVMESH) public: void stepPhysicsAndNavigation(float deltaTime); #endif diff --git a/core/2d/CCSprite.cpp b/core/2d/CCSprite.cpp index e09e8f6aa4..48f222eafd 100644 --- a/core/2d/CCSprite.cpp +++ b/core/2d/CCSprite.cpp @@ -57,7 +57,7 @@ Sprite* Sprite::createWithTexture(Texture2D* texture) sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -69,7 +69,7 @@ Sprite* Sprite::createWithTexture(Texture2D* texture, const Rect& rect, bool rot sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -86,7 +86,7 @@ Sprite* Sprite::create(std::string_view filename, PixelFormat format) sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -98,7 +98,7 @@ Sprite* Sprite::create(const PolygonInfo& info) sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -110,7 +110,7 @@ Sprite* Sprite::create(std::string_view filename, const Rect& rect) sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -122,7 +122,7 @@ Sprite* Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame) sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -130,10 +130,10 @@ Sprite* Sprite::createWithSpriteFrameName(std::string_view spriteFrameName) { SpriteFrame* frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName); -#if COCOS2D_DEBUG > 0 +#if AXIS_DEBUG > 0 char msg[256] = {0}; sprintf(msg, "Invalid spriteFrameName: %s", spriteFrameName.data()); - CCASSERT(frame != nullptr, msg); + AXASSERT(frame != nullptr, msg); #endif return createWithSpriteFrame(frame); @@ -147,7 +147,7 @@ Sprite* Sprite::create() sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -159,7 +159,7 @@ bool Sprite::init() bool Sprite::initWithTexture(Texture2D* texture) { - CCASSERT(texture != nullptr, "Invalid texture for sprite"); + AXASSERT(texture != nullptr, "Invalid texture for sprite"); Rect rect = Rect::ZERO; if (texture) @@ -182,7 +182,7 @@ bool Sprite::initWithFile(std::string_view filename, PixelFormat format) { if (filename.empty()) { - CCLOG("Call Sprite::initWithFile with blank resource filename."); + AXLOG("Call Sprite::initWithFile with blank resource filename."); return false; } @@ -204,7 +204,7 @@ bool Sprite::initWithFile(std::string_view filename, PixelFormat format) bool Sprite::initWithFile(std::string_view filename, const Rect& rect) { - CCASSERT(!filename.empty(), "Invalid filename"); + AXASSERT(!filename.empty(), "Invalid filename"); if (filename.empty()) return false; @@ -222,7 +222,7 @@ bool Sprite::initWithFile(std::string_view filename, const Rect& rect) bool Sprite::initWithSpriteFrameName(std::string_view spriteFrameName) { - CCASSERT(!spriteFrameName.empty(), "Invalid spriteFrameName"); + AXASSERT(!spriteFrameName.empty(), "Invalid spriteFrameName"); if (spriteFrameName.empty()) return false; @@ -235,7 +235,7 @@ bool Sprite::initWithSpriteFrameName(std::string_view spriteFrameName) bool Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame) { - CCASSERT(spriteFrame != nullptr, "spriteFrame can't be nullptr!"); + AXASSERT(spriteFrame != nullptr, "spriteFrame can't be nullptr!"); if (spriteFrame == nullptr) return false; @@ -307,18 +307,18 @@ bool Sprite::initWithTexture(Texture2D* texture, const Rect& rect, bool rotated) Sprite::Sprite() { -#if CC_SPRITE_DEBUG_DRAW +#if AX_SPRITE_DEBUG_DRAW _debugDrawNode = DrawNode::create(); addChild(_debugDrawNode); -#endif // CC_SPRITE_DEBUG_DRAW +#endif // AX_SPRITE_DEBUG_DRAW } Sprite::~Sprite() { - CC_SAFE_FREE(_trianglesVertex); - CC_SAFE_FREE(_trianglesIndex); - CC_SAFE_RELEASE(_spriteFrame); - CC_SAFE_RELEASE(_texture); + AX_SAFE_FREE(_trianglesVertex); + AX_SAFE_FREE(_trianglesIndex); + AX_SAFE_RELEASE(_spriteFrame); + AX_SAFE_RELEASE(_texture); } /* @@ -340,7 +340,7 @@ static unsigned char cc_2x2_white_image[] = { // RGBA8888 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; -#define CC_2x2_WHITE_IMAGE_KEY "/cc_2x2_white_image" +#define AX_2x2_WHITE_IMAGE_KEY "/cc_2x2_white_image" // MARK: texture void Sprite::setTexture(std::string_view filename) @@ -383,7 +383,7 @@ void Sprite::setProgramState(uint32_t type) bool Sprite::setProgramState(backend::ProgramState* programState, bool needsRetain) { - CCASSERT(programState, "argument should not be nullptr"); + AXASSERT(programState, "argument should not be nullptr"); if (Node::setProgramState(programState, needsRetain)) { auto& pipelineDescriptor = _trianglesCommand.getPipelineDescriptor(); @@ -401,25 +401,25 @@ bool Sprite::setProgramState(backend::ProgramState* programState, bool needsReta void Sprite::setTexture(Texture2D* texture) { - CCASSERT(!_batchNode || (texture && texture == _batchNode->getTexture()), + AXASSERT(!_batchNode || (texture && texture == _batchNode->getTexture()), "CCSprite: Batched sprites should use the same texture as the batchnode"); // accept texture==nil as argument - CCASSERT(!texture || dynamic_cast(texture), "setTexture expects a Texture2D. Invalid argument"); + AXASSERT(!texture || dynamic_cast(texture), "setTexture expects a Texture2D. Invalid argument"); if (texture == nullptr) { // Gets the texture by key firstly. - texture = _director->getTextureCache()->getTextureForKey(CC_2x2_WHITE_IMAGE_KEY); + texture = _director->getTextureCache()->getTextureForKey(AX_2x2_WHITE_IMAGE_KEY); // If texture wasn't in cache, create it from RAW data. if (texture == nullptr) { Image* image = new Image(); - bool CC_UNUSED isOK = image->initWithRawData(cc_2x2_white_image, sizeof(cc_2x2_white_image), 2, 2, 8); - CCASSERT(isOK, "The 2x2 empty texture was created unsuccessfully."); + bool AX_UNUSED isOK = image->initWithRawData(cc_2x2_white_image, sizeof(cc_2x2_white_image), 2, 2, 8); + AXASSERT(isOK, "The 2x2 empty texture was created unsuccessfully."); - texture = _director->getTextureCache()->addImage(image, CC_2x2_WHITE_IMAGE_KEY); - CC_SAFE_RELEASE(image); + texture = _director->getTextureCache()->addImage(image, AX_2x2_WHITE_IMAGE_KEY); + AX_SAFE_RELEASE(image); } } @@ -431,8 +431,8 @@ void Sprite::setTexture(Texture2D* texture) { if (_texture != texture) { - CC_SAFE_RETAIN(texture); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RETAIN(texture); + AX_SAFE_RELEASE(_texture); _texture = texture; } updateBlendFunc(); @@ -709,7 +709,7 @@ void Sprite::setCenterRectNormalized(const axis::Rect& rectTopLeft) { if (_renderMode != RenderMode::QUAD && _renderMode != RenderMode::SLICE9) { - CCLOGWARN("Warning: Sprite::setCenterRectNormalized() only works with QUAD and SLICE9 render modes"); + AXLOGWARN("Warning: Sprite::setCenterRectNormalized() only works with QUAD and SLICE9 render modes"); return; } @@ -765,7 +765,7 @@ void Sprite::setCenterRect(const axis::Rect& rectInPoints) { if (_renderMode != RenderMode::QUAD && _renderMode != RenderMode::SLICE9) { - CCLOGWARN("Warning: Sprite::setCenterRect() only works with QUAD and SLICE9 render modes"); + AXLOGWARN("Warning: Sprite::setCenterRect() only works with QUAD and SLICE9 render modes"); return; } @@ -817,7 +817,7 @@ void Sprite::setTextureCoords(const Rect& rectInPoints, V3F_C4B_T2F_Quad* outQua if (tex == nullptr) return; - const auto rectInPixels = CC_RECT_POINTS_TO_PIXELS(rectInPoints); + const auto rectInPixels = AX_RECT_POINTS_TO_PIXELS(rectInPoints); const float atlasWidth = (float)tex->getPixelsWide(); const float atlasHeight = (float)tex->getPixelsHigh(); @@ -838,7 +838,7 @@ void Sprite::setTextureCoords(const Rect& rectInPoints, V3F_C4B_T2F_Quad* outQua if (_rectRotated) std::swap(rw, rh); -#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#if AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL float left = (2 * rectInPixels.origin.x + 1) / (2 * atlasWidth); float right = left + (rw * 2 - 2) / (2 * atlasWidth); float top = (2 * rectInPixels.origin.y + 1) / (2 * atlasHeight); @@ -848,7 +848,7 @@ void Sprite::setTextureCoords(const Rect& rectInPoints, V3F_C4B_T2F_Quad* outQua float right = (rectInPixels.origin.x + rw) / atlasWidth; float top = rectInPixels.origin.y / atlasHeight; float bottom = (rectInPixels.origin.y + rh) / atlasHeight; -#endif // CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#endif // AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL if ((!_rectRotated && _flippedX) || (_rectRotated && _flippedY)) std::swap(left, right); @@ -928,7 +928,7 @@ void Sprite::setVertexCoords(const Rect& rect, V3F_C4B_T2F_Quad* outQuad) void Sprite::populateTriangle(int quadIndex, const V3F_C4B_T2F_Quad& quad) { - CCASSERT(quadIndex < 9, "Invalid quadIndex"); + AXASSERT(quadIndex < 9, "Invalid quadIndex"); // convert Quad intro Triangle since it takes less memory // Triangles are ordered like the following: @@ -986,7 +986,7 @@ void Sprite::populateTriangle(int quadIndex, const V3F_C4B_T2F_Quad& quad) void Sprite::updateTransform() { - CCASSERT(_renderMode == RenderMode::QUAD_BATCHNODE, + AXASSERT(_renderMode == RenderMode::QUAD_BATCHNODE, "updateTransform is only valid when Sprite is being rendered using an SpriteBatchNode"); // recalculate matrix only if it is dirty @@ -1009,7 +1009,7 @@ void Sprite::updateTransform() _transformToBatch = getNodeToParentTransform(); else { - CCASSERT(dynamic_cast(_parent), "Logic error in Sprite. Parent must be a Sprite"); + AXASSERT(dynamic_cast(_parent), "Logic error in Sprite. Parent must be a Sprite"); const Mat4& nodeToParent = getNodeToParentTransform(); Mat4& parentTransform = static_cast(_parent)->_transformToBatch; _transformToBatch = parentTransform * nodeToParent; @@ -1073,7 +1073,7 @@ void Sprite::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) // TODO: arnold: current camera can be a non-default one. setMVPMatrixUniform(); -#if CC_USE_CULLING +#if AX_USE_CULLING // Don't calculate the culling if the transform was not updated auto visitingCamera = Camera::getVisitingCamera(); auto defaultCamera = Camera::getDefaultCamera(); @@ -1093,7 +1093,7 @@ void Sprite::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) _trianglesCommand.init(_globalZOrder, _texture, _blendFunc, _polyInfo.triangles, transform, flags); renderer->addCommand(&_trianglesCommand); -#if CC_SPRITE_DEBUG_DRAW +#if AX_SPRITE_DEBUG_DRAW _debugDrawNode->clear(); auto count = _polyInfo.triangles.indexCount / 3; auto indices = _polyInfo.triangles.indices; @@ -1113,7 +1113,7 @@ void Sprite::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) to = verts[indices[i * 3]].vertices; _debugDrawNode->drawLine(Vec2(from.x, from.y), Vec2(to.x, to.y), Color4F::WHITE); } -#endif // CC_SPRITE_DEBUG_DRAW +#endif // AX_SPRITE_DEBUG_DRAW } } @@ -1121,15 +1121,15 @@ void Sprite::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) void Sprite::addChild(Node* child, int zOrder, int tag) { - CCASSERT(child != nullptr, "Argument must be non-nullptr"); + AXASSERT(child != nullptr, "Argument must be non-nullptr"); if (child == nullptr) return; if (_renderMode == RenderMode::QUAD_BATCHNODE) { Sprite* childSprite = dynamic_cast(child); - CCASSERT(childSprite, "CCSprite only supports Sprites as children when using SpriteBatchNode"); - CCASSERT(childSprite->getTexture() == _textureAtlas->getTexture(), + AXASSERT(childSprite, "CCSprite only supports Sprites as children when using SpriteBatchNode"); + AXASSERT(childSprite->getTexture() == _textureAtlas->getTexture(), "childSprite's texture name should be equal to _textureAtlas's texture name!"); // put it in descendants array of batch node _batchNode->appendChild(childSprite); @@ -1145,15 +1145,15 @@ void Sprite::addChild(Node* child, int zOrder, int tag) void Sprite::addChild(Node* child, int zOrder, std::string_view name) { - CCASSERT(child != nullptr, "Argument must be non-nullptr"); + AXASSERT(child != nullptr, "Argument must be non-nullptr"); if (child == nullptr) return; if (_renderMode == RenderMode::QUAD_BATCHNODE) { Sprite* childSprite = dynamic_cast(child); - CCASSERT(childSprite, "CCSprite only supports Sprites as children when using SpriteBatchNode"); - CCASSERT(childSprite->getTexture() == _textureAtlas->getTexture(), + AXASSERT(childSprite, "CCSprite only supports Sprites as children when using SpriteBatchNode"); + AXASSERT(childSprite->getTexture() == _textureAtlas->getTexture(), "childSprite's texture name should be equal to _textureAtlas's texture name."); // put it in descendants array of batch node _batchNode->appendChild(childSprite); @@ -1169,8 +1169,8 @@ void Sprite::addChild(Node* child, int zOrder, std::string_view name) void Sprite::reorderChild(Node* child, int zOrder) { - CCASSERT(child != nullptr, "child must be non null"); - CCASSERT(_children.contains(child), "child does not belong to this"); + AXASSERT(child != nullptr, "child must be non null"); + AXASSERT(_children.contains(child), "child does not belong to this"); if ((_renderMode == RenderMode::QUAD_BATCHNODE) && !_reorderChildDirty) { @@ -1316,7 +1316,7 @@ void Sprite::setScaleX(float scaleX) void Sprite::setScaleY(float scaleY) { -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL if (_texture->isRenderTarget()) scaleY = std::abs(scaleY); #endif @@ -1350,7 +1350,7 @@ void Sprite::setAnchorPoint(const Vec2& anchor) void Sprite::setIgnoreAnchorPointForPosition(bool value) { - CCASSERT(_renderMode != RenderMode::QUAD_BATCHNODE, "setIgnoreAnchorPointForPosition is invalid in Sprite"); + AXASSERT(_renderMode != RenderMode::QUAD_BATCHNODE, "setIgnoreAnchorPointForPosition is invalid in Sprite"); Node::setIgnoreAnchorPointForPosition(value); } @@ -1363,7 +1363,7 @@ void Sprite::setVisible(bool bVisible) void Sprite::setContentSize(const Vec2& size) { if (_renderMode == RenderMode::QUAD_BATCHNODE || _renderMode == RenderMode::POLYGON) - CCLOGWARN( + AXLOGWARN( "Sprite::setContentSize() doesn't stretch the sprite when using QUAD_BATCHNODE or POLYGON render modes"); Node::setContentSize(size); @@ -1445,7 +1445,7 @@ bool Sprite::isFlippedX() const void Sprite::setFlippedY(bool flippedY) { -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL if (_texture->isRenderTarget()) flippedY = !flippedY; #endif @@ -1552,14 +1552,14 @@ bool Sprite::isOpacityModifyRGB() const void Sprite::setSpriteFrame(std::string_view spriteFrameName) { - CCASSERT(!spriteFrameName.empty(), "spriteFrameName must not be empty"); + AXASSERT(!spriteFrameName.empty(), "spriteFrameName must not be empty"); if (spriteFrameName.empty()) return; SpriteFrameCache* cache = SpriteFrameCache::getInstance(); SpriteFrame* spriteFrame = cache->getSpriteFrameByName(spriteFrameName); - CCASSERT(spriteFrame, std::string("Invalid spriteFrameName :").append(spriteFrameName).c_str()); + AXASSERT(spriteFrame, std::string("Invalid spriteFrameName :").append(spriteFrameName).c_str()); setSpriteFrame(spriteFrame); } @@ -1570,7 +1570,7 @@ void Sprite::setSpriteFrame(SpriteFrame* spriteFrame) // do not removed by SpriteFrameCache::removeUnusedSpriteFrames if (_spriteFrame != spriteFrame) { - CC_SAFE_RELEASE(_spriteFrame); + AX_SAFE_RELEASE(_spriteFrame); _spriteFrame = spriteFrame; spriteFrame->retain(); } @@ -1603,17 +1603,17 @@ void Sprite::setSpriteFrame(SpriteFrame* spriteFrame) void Sprite::setDisplayFrameWithAnimationName(std::string_view animationName, unsigned int frameIndex) { - CCASSERT(!animationName.empty(), "CCSprite#setDisplayFrameWithAnimationName. animationName must not be nullptr"); + AXASSERT(!animationName.empty(), "CCSprite#setDisplayFrameWithAnimationName. animationName must not be nullptr"); if (animationName.empty()) return; Animation* a = AnimationCache::getInstance()->getAnimation(animationName); - CCASSERT(a, "CCSprite#setDisplayFrameWithAnimationName: Frame not found"); + AXASSERT(a, "CCSprite#setDisplayFrameWithAnimationName: Frame not found"); AnimationFrame* frame = a->getFrames().at(frameIndex); - CCASSERT(frame, "CCSprite#setDisplayFrame. Invalid frame"); + AXASSERT(frame, "CCSprite#setDisplayFrame. Invalid frame"); setSpriteFrame(frame->getSpriteFrame()); } @@ -1631,9 +1631,9 @@ SpriteFrame* Sprite::getSpriteFrame() const if (nullptr != this->_spriteFrame) return this->_spriteFrame; - return SpriteFrame::createWithTexture(_texture, CC_RECT_POINTS_TO_PIXELS(_rect), _rectRotated, - CC_POINT_POINTS_TO_PIXELS(_unflippedOffsetPositionFromCenter), - CC_SIZE_POINTS_TO_PIXELS(_originalContentSize)); + return SpriteFrame::createWithTexture(_texture, AX_RECT_POINTS_TO_PIXELS(_rect), _rectRotated, + AX_POINT_POINTS_TO_PIXELS(_unflippedOffsetPositionFromCenter), + AX_SIZE_POINTS_TO_PIXELS(_originalContentSize)); } SpriteBatchNode* Sprite::getBatchNode() const @@ -1677,7 +1677,7 @@ void Sprite::setBatchNode(SpriteBatchNode* spriteBatchNode) // MARK: Texture protocol void Sprite::updateBlendFunc() { - CCASSERT(_renderMode != RenderMode::QUAD_BATCHNODE, + AXASSERT(_renderMode != RenderMode::QUAD_BATCHNODE, "CCSprite: updateBlendFunc doesn't work when the sprite is rendered using a SpriteBatchNode"); // it is possible to have an untextured sprite diff --git a/core/2d/CCSprite.h b/core/2d/CCSprite.h index 0b30510d35..d0062fcd34 100644 --- a/core/2d/CCSprite.h +++ b/core/2d/CCSprite.h @@ -52,7 +52,7 @@ struct transformValues_; # undef SPRITE_RENDER_IN_SUBPIXEL #endif -#if CC_SPRITEBATCHNODE_RENDER_SUBPIXEL +#if AX_SPRITEBATCHNODE_RENDER_SUBPIXEL # define SPRITE_RENDER_IN_SUBPIXEL #else # define SPRITE_RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__)) @@ -98,7 +98,7 @@ struct transformValues_; * * The default anchorPoint in Sprite is (0.5, 0.5). */ -class CC_DLL Sprite : public Node, public TextureProtocol +class AX_DLL Sprite : public Node, public TextureProtocol { public: enum class RenderMode @@ -660,9 +660,9 @@ protected: TrianglesCommand _trianglesCommand; backend::UniformLocation _mvpMatrixLocation; -#if CC_SPRITE_DEBUG_DRAW +#if AX_SPRITE_DEBUG_DRAW DrawNode* _debugDrawNode = nullptr; -#endif // CC_SPRITE_DEBUG_DRAW +#endif // AX_SPRITE_DEBUG_DRAW // // Shared data // @@ -702,7 +702,7 @@ protected: bool _stretchEnabled = true; private: - CC_DISALLOW_COPY_AND_ASSIGN(Sprite); + AX_DISALLOW_COPY_AND_ASSIGN(Sprite); }; // end of sprite_nodes group diff --git a/core/2d/CCSpriteBatchNode.cpp b/core/2d/CCSpriteBatchNode.cpp index e459a776d1..ef670a2eb6 100644 --- a/core/2d/CCSpriteBatchNode.cpp +++ b/core/2d/CCSpriteBatchNode.cpp @@ -87,7 +87,7 @@ bool SpriteBatchNode::initWithTexture(Texture2D* tex, ssize_t capacity /* = DEFA return false; } - CCASSERT(capacity >= 0, "Capacity must be >= 0"); + AXASSERT(capacity >= 0, "Capacity must be >= 0"); _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; if (!tex->hasPremultipliedAlpha()) @@ -116,14 +116,14 @@ bool SpriteBatchNode::initWithTexture(Texture2D* tex, ssize_t capacity /* = DEFA void SpriteBatchNode::setUniformLocation() { - CCASSERT(_programState, "programState should not be nullptr"); + AXASSERT(_programState, "programState should not be nullptr"); _mvpMatrixLocaiton = _programState->getUniformLocation("u_MVPMatrix"); _textureLocation = _programState->getUniformLocation("u_tex0"); } void SpriteBatchNode::setVertexLayout() { - CCASSERT(_programState, "programState should not be nullptr"); + AXASSERT(_programState, "programState should not be nullptr"); // set vertexLayout according to V3F_C4B_T2F structure auto vertexLayout = _programState->getVertexLayout(); /// a_position @@ -144,7 +144,7 @@ void SpriteBatchNode::setVertexLayout() bool SpriteBatchNode::setProgramState(backend::ProgramState* programState, bool needsRetain) { - CCASSERT(programState, "programState should not be nullptr"); + AXASSERT(programState, "programState should not be nullptr"); if (Node::setProgramState(programState, needsRetain)) { auto& pipelineDescriptor = _quadCommand.getPipelineDescriptor(); @@ -178,14 +178,14 @@ SpriteBatchNode::SpriteBatchNode() {} SpriteBatchNode::~SpriteBatchNode() { - CC_SAFE_RELEASE(_textureAtlas); + AX_SAFE_RELEASE(_textureAtlas); } // override visit // don't call visit on it's children void SpriteBatchNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t parentFlags) { - CC_PROFILER_START_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); + AX_PROFILER_START_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); // CAREFUL: // This visit is almost identical to CocosNode#visit @@ -218,17 +218,17 @@ void SpriteBatchNode::visit(Renderer* renderer, const Mat4& parentTransform, uin // Please refer to https://github.com/cocos2d/cocos2d-x/pull/6920 // setOrderOfArrival(0); - CC_PROFILER_STOP_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); + AX_PROFILER_STOP_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); } } void SpriteBatchNode::addChild(Node* child, int zOrder, int tag) { - CCASSERT(child != nullptr, "child should not be null"); - CCASSERT(dynamic_cast(child) != nullptr, "CCSpriteBatchNode only supports Sprites as children"); + AXASSERT(child != nullptr, "child should not be null"); + AXASSERT(dynamic_cast(child) != nullptr, "CCSpriteBatchNode only supports Sprites as children"); Sprite* sprite = static_cast(child); // check Sprite is using the same texture id - CCASSERT(sprite->getTexture()->getBackendTexture() == _textureAtlas->getTexture()->getBackendTexture(), + AXASSERT(sprite->getTexture()->getBackendTexture() == _textureAtlas->getTexture()->getBackendTexture(), "CCSprite is not using the same texture id"); Node::addChild(child, zOrder, tag); @@ -238,11 +238,11 @@ void SpriteBatchNode::addChild(Node* child, int zOrder, int tag) void SpriteBatchNode::addChild(Node* child, int zOrder, std::string_view name) { - CCASSERT(child != nullptr, "child should not be null"); - CCASSERT(dynamic_cast(child) != nullptr, "CCSpriteBatchNode only supports Sprites as children"); + AXASSERT(child != nullptr, "child should not be null"); + AXASSERT(dynamic_cast(child) != nullptr, "CCSpriteBatchNode only supports Sprites as children"); Sprite* sprite = static_cast(child); // check Sprite is using the same texture id - CCASSERT(sprite->getTexture() == _textureAtlas->getTexture(), "CCSprite is not using the same texture id"); + AXASSERT(sprite->getTexture() == _textureAtlas->getTexture(), "CCSprite is not using the same texture id"); Node::addChild(child, zOrder, name); @@ -252,8 +252,8 @@ void SpriteBatchNode::addChild(Node* child, int zOrder, std::string_view name) // override reorderChild void SpriteBatchNode::reorderChild(Node* child, int zOrder) { - CCASSERT(child != nullptr, "the child should not be null"); - CCASSERT(_children.contains(child), "Child doesn't belong to Sprite"); + AXASSERT(child != nullptr, "the child should not be null"); + AXASSERT(_children.contains(child), "Child doesn't belong to Sprite"); if (zOrder == child->getLocalZOrder()) { @@ -275,7 +275,7 @@ void SpriteBatchNode::removeChild(Node* child, bool cleanup) return; } - CCASSERT(_children.contains(sprite), "sprite batch node should contain the child"); + AXASSERT(_children.contains(sprite), "sprite batch node should contain the child"); // cleanup before removing removeSpriteFromAtlas(sprite); @@ -285,7 +285,7 @@ void SpriteBatchNode::removeChild(Node* child, bool cleanup) void SpriteBatchNode::removeChildAtIndex(ssize_t index, bool doCleanup) { - CCASSERT(index >= 0 && index < _children.size(), "Invalid index"); + AXASSERT(index >= 0 && index < _children.size(), "Invalid index"); removeChild(_children.at(index), doCleanup); } @@ -407,7 +407,7 @@ void SpriteBatchNode::updateAtlasIndex(Sprite* sprite, ssize_t* curIndex) void SpriteBatchNode::swap(ssize_t oldIndex, ssize_t newIndex) { - CCASSERT( + AXASSERT( oldIndex >= 0 && oldIndex < (int)_descendants.size() && newIndex >= 0 && newIndex < (int)_descendants.size(), "Invalid index"); @@ -458,14 +458,14 @@ void SpriteBatchNode::increaseAtlasCapacity() // this is likely computationally expensive ssize_t quantity = (_textureAtlas->getCapacity() + 1) * 4 / 3; - CCLOG("cocos2d: SpriteBatchNode: resizing TextureAtlas capacity from [%d] to [%d].", + AXLOG("cocos2d: SpriteBatchNode: resizing TextureAtlas capacity from [%d] to [%d].", static_cast(_textureAtlas->getCapacity()), static_cast(quantity)); if (!_textureAtlas->resizeCapacity(quantity)) { // serious problems - CCLOGWARN("cocos2d: WARNING: Not enough memory to resize the atlas"); - CCASSERT(false, "Not enough memory to resize the atlas"); + AXLOGWARN("cocos2d: WARNING: Not enough memory to resize the atlas"); + AXASSERT(false, "Not enough memory to resize the atlas"); } } @@ -477,14 +477,14 @@ void SpriteBatchNode::reserveCapacity(ssize_t newCapacity) if (!_textureAtlas->resizeCapacity(newCapacity)) { // serious problems - CCLOGWARN("cocos2d: WARNING: Not enough memory to resize the atlas"); - CCASSERT(false, "Not enough memory to resize the atlas"); + AXLOGWARN("cocos2d: WARNING: Not enough memory to resize the atlas"); + AXASSERT(false, "Not enough memory to resize the atlas"); } } ssize_t SpriteBatchNode::rebuildIndexInOrder(Sprite* parent, ssize_t index) { - CCASSERT(index >= 0 && index < _children.size(), "Invalid index"); + AXASSERT(index >= 0 && index < _children.size(), "Invalid index"); auto& children = parent->getChildren(); for (const auto& child : children) @@ -598,7 +598,7 @@ ssize_t SpriteBatchNode::atlasIndexForChild(Sprite* sprite, int nZ) } // Should not happen. Error calculating Z on SpriteSheet - CCASSERT(0, "should not run here"); + AXASSERT(0, "should not run here"); return 0; } @@ -629,8 +629,8 @@ void SpriteBatchNode::appendChild(Sprite* sprite) for (auto iter = children.begin(); iter != children.end();) { auto child = *iter; -#if CC_SPRITE_DEBUG_DRAW - // when using CC_SPRITE_DEBUG_DRAW, a DrawNode is appended to sprites. remove it since only Sprites can be used +#if AX_SPRITE_DEBUG_DRAW + // when using AX_SPRITE_DEBUG_DRAW, a DrawNode is appended to sprites. remove it since only Sprites can be used // as children in SpriteBatchNode // Github issue #14730 if (dynamic_cast(child)) @@ -640,7 +640,7 @@ void SpriteBatchNode::appendChild(Sprite* sprite) continue; } #endif - CCASSERT(dynamic_cast(child) != nullptr, + AXASSERT(dynamic_cast(child) != nullptr, "You can only add Sprites (or subclass of Sprite) to SpriteBatchNode"); appendChild(static_cast(child)); ++iter; @@ -724,8 +724,8 @@ void SpriteBatchNode::setTexture(Texture2D* texture) void SpriteBatchNode::insertQuadFromSprite(Sprite* sprite, ssize_t index) { - CCASSERT(sprite != nullptr, "Argument must be non-nullptr"); - CCASSERT(dynamic_cast(sprite), "CCSpriteBatchNode only supports Sprites as children"); + AXASSERT(sprite != nullptr, "Argument must be non-nullptr"); + AXASSERT(dynamic_cast(sprite), "CCSpriteBatchNode only supports Sprites as children"); // make needed room while (index >= _textureAtlas->getCapacity() || _textureAtlas->getCapacity() == _textureAtlas->getTotalQuads()) @@ -749,8 +749,8 @@ void SpriteBatchNode::insertQuadFromSprite(Sprite* sprite, ssize_t index) void SpriteBatchNode::updateQuadFromSprite(Sprite* sprite, ssize_t index) { - CCASSERT(sprite != nullptr, "Argument must be non-nil"); - CCASSERT(dynamic_cast(sprite) != nullptr, "CCSpriteBatchNode only supports Sprites as children"); + AXASSERT(sprite != nullptr, "Argument must be non-nil"); + AXASSERT(dynamic_cast(sprite) != nullptr, "CCSpriteBatchNode only supports Sprites as children"); // make needed room while (index >= _textureAtlas->getCapacity() || _textureAtlas->getCapacity() == _textureAtlas->getTotalQuads()) @@ -772,8 +772,8 @@ void SpriteBatchNode::updateQuadFromSprite(Sprite* sprite, ssize_t index) SpriteBatchNode* SpriteBatchNode::addSpriteWithoutQuad(Sprite* child, int z, int aTag) { - CCASSERT(child != nullptr, "Argument must be non-nullptr"); - CCASSERT(dynamic_cast(child), "CCSpriteBatchNode only supports Sprites as children"); + AXASSERT(child != nullptr, "Argument must be non-nullptr"); + AXASSERT(dynamic_cast(child), "CCSpriteBatchNode only supports Sprites as children"); // quad index is Z child->setAtlasIndex(z); diff --git a/core/2d/CCSpriteBatchNode.h b/core/2d/CCSpriteBatchNode.h index 4cd189adf6..c22d33d3a6 100644 --- a/core/2d/CCSpriteBatchNode.h +++ b/core/2d/CCSpriteBatchNode.h @@ -62,7 +62,7 @@ class Sprite; * * @since v0.7.1 */ -class CC_DLL SpriteBatchNode : public Node, public TextureProtocol +class AX_DLL SpriteBatchNode : public Node, public TextureProtocol { static const int DEFAULT_CAPACITY = 29; @@ -100,8 +100,8 @@ public: { if (textureAtlas != _textureAtlas) { - CC_SAFE_RETAIN(textureAtlas); - CC_SAFE_RELEASE(_textureAtlas); + AX_SAFE_RETAIN(textureAtlas); + AX_SAFE_RELEASE(_textureAtlas); _textureAtlas = textureAtlas; } } diff --git a/core/2d/CCSpriteFrame.cpp b/core/2d/CCSpriteFrame.cpp index 6a31ea18cc..680fce797f 100644 --- a/core/2d/CCSpriteFrame.cpp +++ b/core/2d/CCSpriteFrame.cpp @@ -90,13 +90,13 @@ SpriteFrame::SpriteFrame() : _rotated(false), _texture(nullptr) {} bool SpriteFrame::initWithTexture(Texture2D* texture, const Rect& rect) { - Rect rectInPixels = CC_RECT_POINTS_TO_PIXELS(rect); + Rect rectInPixels = AX_RECT_POINTS_TO_PIXELS(rect); return initWithTexture(texture, rectInPixels, false, Vec2::ZERO, rectInPixels.size); } bool SpriteFrame::initWithTextureFilename(std::string_view filename, const Rect& rect) { - Rect rectInPixels = CC_RECT_POINTS_TO_PIXELS(rect); + Rect rectInPixels = AX_RECT_POINTS_TO_PIXELS(rect); return initWithTextureFilename(filename, rectInPixels, false, Vec2::ZERO, rectInPixels.size); } @@ -114,11 +114,11 @@ bool SpriteFrame::initWithTexture(Texture2D* texture, } _rectInPixels = rect; - _rect = CC_RECT_PIXELS_TO_POINTS(rect); + _rect = AX_RECT_PIXELS_TO_POINTS(rect); _offsetInPixels = offset; - _offset = CC_POINT_PIXELS_TO_POINTS(_offsetInPixels); + _offset = AX_POINT_PIXELS_TO_POINTS(_offsetInPixels); _originalSizeInPixels = originalSize; - _originalSize = CC_SIZE_PIXELS_TO_POINTS(_originalSizeInPixels); + _originalSize = AX_SIZE_PIXELS_TO_POINTS(_originalSizeInPixels); _rotated = rotated; _anchorPoint = Vec2(NAN, NAN); _centerRect = Rect(NAN, NAN, NAN, NAN); @@ -137,11 +137,11 @@ bool SpriteFrame::initWithTextureFilename(std::string_view filename, _texture = nullptr; _textureFilename = filename; _rectInPixels = rect; - _rect = CC_RECT_PIXELS_TO_POINTS(rect); + _rect = AX_RECT_PIXELS_TO_POINTS(rect); _offsetInPixels = offset; - _offset = CC_POINT_PIXELS_TO_POINTS(_offsetInPixels); + _offset = AX_POINT_PIXELS_TO_POINTS(_offsetInPixels); _originalSizeInPixels = originalSize; - _originalSize = CC_SIZE_PIXELS_TO_POINTS(_originalSizeInPixels); + _originalSize = AX_SIZE_PIXELS_TO_POINTS(_originalSizeInPixels); _rotated = rotated; _anchorPoint = Vec2(NAN, NAN); _centerRect = Rect(NAN, NAN, NAN, NAN); @@ -152,8 +152,8 @@ bool SpriteFrame::initWithTextureFilename(std::string_view filename, SpriteFrame::~SpriteFrame() { - CCLOGINFO("deallocing SpriteFrame: %p", this); - CC_SAFE_RELEASE(_texture); + AXLOGINFO("deallocing SpriteFrame: %p", this); + AX_SAFE_RELEASE(_texture); } SpriteFrame* SpriteFrame::clone() const @@ -169,18 +169,18 @@ SpriteFrame* SpriteFrame::clone() const void SpriteFrame::setRect(const Rect& rect) { _rect = rect; - _rectInPixels = CC_RECT_POINTS_TO_PIXELS(_rect); + _rectInPixels = AX_RECT_POINTS_TO_PIXELS(_rect); } void SpriteFrame::setRectInPixels(const Rect& rectInPixels) { _rectInPixels = rectInPixels; - _rect = CC_RECT_PIXELS_TO_POINTS(rectInPixels); + _rect = AX_RECT_PIXELS_TO_POINTS(rectInPixels); } void SpriteFrame::setCenterRectInPixels(const Rect& centerRect) { - _centerRect = CC_RECT_PIXELS_TO_POINTS(centerRect); + _centerRect = AX_RECT_PIXELS_TO_POINTS(centerRect); } bool SpriteFrame::hasCenterRect() const @@ -196,7 +196,7 @@ const Vec2& SpriteFrame::getOffset() const void SpriteFrame::setOffset(const Vec2& offsets) { _offset = offsets; - _offsetInPixels = CC_POINT_POINTS_TO_PIXELS(_offset); + _offsetInPixels = AX_POINT_POINTS_TO_PIXELS(_offset); } const Vec2& SpriteFrame::getOffsetInPixels() const @@ -207,7 +207,7 @@ const Vec2& SpriteFrame::getOffsetInPixels() const void SpriteFrame::setOffsetInPixels(const Vec2& offsetInPixels) { _offsetInPixels = offsetInPixels; - _offset = CC_POINT_PIXELS_TO_POINTS(_offsetInPixels); + _offset = AX_POINT_PIXELS_TO_POINTS(_offsetInPixels); } const Vec2& SpriteFrame::getAnchorPoint() const @@ -229,8 +229,8 @@ void SpriteFrame::setTexture(Texture2D* texture) { if (_texture != texture) { - CC_SAFE_RELEASE(_texture); - CC_SAFE_RETAIN(texture); + AX_SAFE_RELEASE(_texture); + AX_SAFE_RETAIN(texture); _texture = texture; } } diff --git a/core/2d/CCSpriteFrame.h b/core/2d/CCSpriteFrame.h index 77b460bd96..efeb30a3f0 100644 --- a/core/2d/CCSpriteFrame.h +++ b/core/2d/CCSpriteFrame.h @@ -56,7 +56,7 @@ class Texture2D; sprite->setSpriteFrame(frame); @endcode */ -class CC_DLL SpriteFrame : public Ref, public Clonable +class AX_DLL SpriteFrame : public Ref, public Clonable { public: /** Create a SpriteFrame with a texture filename, rect in points. diff --git a/core/2d/CCSpriteFrameCache.cpp b/core/2d/CCSpriteFrameCache.cpp index f256b0babe..ab80c61c24 100644 --- a/core/2d/CCSpriteFrameCache.cpp +++ b/core/2d/CCSpriteFrameCache.cpp @@ -60,7 +60,7 @@ SpriteFrameCache* SpriteFrameCache::getInstance() void SpriteFrameCache::destroyInstance() { - CC_SAFE_RELEASE_NULL(_sharedSpriteFrameCache); + AX_SAFE_RELEASE_NULL(_sharedSpriteFrameCache); } bool SpriteFrameCache::init() @@ -124,7 +124,7 @@ bool SpriteFrameCache::isSpriteFramesWithFileLoaded(std::string_view plist) cons void SpriteFrameCache::addSpriteFrame(SpriteFrame* frame, std::string_view frameName) { - CCASSERT(frame, "frame should not be nil"); + AXASSERT(frame, "frame should not be nil"); const std::string name = "by#addSpriteFrame()"; auto&& itr = _spriteSheets.find(name); @@ -158,7 +158,7 @@ void SpriteFrameCache::removeUnusedSpriteFrames() { toRemoveFrames.push_back(iter.first); spriteFrame->getTexture()->removeSpriteFrameCapInset(spriteFrame); - CCLOG("cocos2d: SpriteFrameCache: removing unused frame: %s", iter.first.c_str()); + AXLOG("cocos2d: SpriteFrameCache: removing unused frame: %s", iter.first.c_str()); removed = true; } } @@ -184,7 +184,7 @@ void SpriteFrameCache::removeSpriteFramesFromFile(std::string_view atlasPath) // auto dict = FileUtils::getInstance()->getValueMapFromFile(fullPath); // if (dict.empty()) //{ - // CCLOG("cocos2d:SpriteFrameCache:removeSpriteFramesFromFile: create dict by %s fail.",plist.c_str()); + // AXLOG("cocos2d:SpriteFrameCache:removeSpriteFramesFromFile: create dict by %s fail.",plist.c_str()); // return; // } // removeSpriteFramesFromDictionary(dict); @@ -199,7 +199,7 @@ void SpriteFrameCache::removeSpriteFramesFromFileContent(std::string_view plist_ FileUtils::getInstance()->getValueMapFromData(plist_content.data(), static_cast(plist_content.size())); if (dict.empty()) { - CCLOG("cocos2d:SpriteFrameCache:removeSpriteFramesFromFileContent: create dict by fail."); + AXLOG("cocos2d:SpriteFrameCache:removeSpriteFramesFromFileContent: create dict by fail."); return; } removeSpriteFramesFromDictionary(dict); @@ -246,14 +246,14 @@ SpriteFrame* SpriteFrameCache::getSpriteFrameByName(std::string_view name) auto* frame = findFrame(name); if (!frame) { - CCLOG("cocos2d: SpriteFrameCache: Frame '%s' isn't found", name.data()); + AXLOG("cocos2d: SpriteFrameCache: Frame '%s' isn't found", name.data()); } return frame; } bool SpriteFrameCache::reloadTexture(std::string_view spriteSheetFileName) { - CCASSERT(!spriteSheetFileName.empty(), "plist filename should not be nullptr"); + AXASSERT(!spriteSheetFileName.empty(), "plist filename should not be nullptr"); const auto spriteSheetItr = _spriteSheets.find(spriteSheetFileName); if (spriteSheetItr == _spriteSheets.end()) diff --git a/core/2d/CCSpriteFrameCache.h b/core/2d/CCSpriteFrameCache.h index 21650ca919..a06dd5aa55 100644 --- a/core/2d/CCSpriteFrameCache.h +++ b/core/2d/CCSpriteFrameCache.h @@ -88,7 +88,7 @@ class PolygonInfo; @since v0.9 @js cc.spriteFrameCache */ -class CC_DLL SpriteFrameCache : public Ref +class AX_DLL SpriteFrameCache : public Ref { public: /** Returns the shared instance of the Sprite Frame cache. diff --git a/core/2d/CCSpriteSheetLoader.cpp b/core/2d/CCSpriteSheetLoader.cpp index 5a0db4af95..d745d6729e 100644 --- a/core/2d/CCSpriteSheetLoader.cpp +++ b/core/2d/CCSpriteSheetLoader.cpp @@ -16,7 +16,7 @@ void SpriteSheetLoader::initializePolygonInfo(const Vec2& textureSize, const auto vertexCount = vertices.size(); const auto indexCount = triangleIndices.size(); - const auto scaleFactor = CC_CONTENT_SCALE_FACTOR(); + const auto scaleFactor = AX_CONTENT_SCALE_FACTOR(); auto* vertexData = new V3F_C4B_T2F[vertexCount]; for (size_t i = 0; i < vertexCount / 2; i++) diff --git a/core/2d/CCTMXObjectGroup.cpp b/core/2d/CCTMXObjectGroup.cpp index 3f1e99cf6b..978da8a880 100644 --- a/core/2d/CCTMXObjectGroup.cpp +++ b/core/2d/CCTMXObjectGroup.cpp @@ -37,7 +37,7 @@ TMXObjectGroup::TMXObjectGroup() : _groupName("") {} TMXObjectGroup::~TMXObjectGroup() { - CCLOGINFO("deallocing TMXObjectGroup: %p", this); + AXLOGINFO("deallocing TMXObjectGroup: %p", this); } ValueMap TMXObjectGroup::getObject(std::string_view objectName) const diff --git a/core/2d/CCTMXObjectGroup.h b/core/2d/CCTMXObjectGroup.h index 4f4fe76ec5..eaa83831c9 100644 --- a/core/2d/CCTMXObjectGroup.h +++ b/core/2d/CCTMXObjectGroup.h @@ -43,7 +43,7 @@ NS_AX_BEGIN /** @brief TMXObjectGroup represents the TMX object group. * @since v0.99.0 */ -class CC_DLL TMXObjectGroup : public Ref +class AX_DLL TMXObjectGroup : public Ref { public: /** diff --git a/core/2d/CCTMXXMLParser.cpp b/core/2d/CCTMXXMLParser.cpp index f18ea8ada7..aae7df86a6 100644 --- a/core/2d/CCTMXXMLParser.cpp +++ b/core/2d/CCTMXXMLParser.cpp @@ -45,7 +45,7 @@ TMXLayerInfo::TMXLayerInfo() : _name(""), _tiles(nullptr), _ownTiles(true) {} TMXLayerInfo::~TMXLayerInfo() { - CCLOGINFO("deallocing TMXLayerInfo: %p", this); + AXLOGINFO("deallocing TMXLayerInfo: %p", this); if (_ownTiles && _tiles) { free(_tiles); @@ -69,7 +69,7 @@ TMXTilesetInfo::TMXTilesetInfo() : _firstGid(0), _tileSize(Vec2::ZERO), _spacing TMXTilesetInfo::~TMXTilesetInfo() { - CCLOGINFO("deallocing TMXTilesetInfo: %p", this); + AXLOGINFO("deallocing TMXTilesetInfo: %p", this); } Rect TMXTilesetInfo::getRectForGID(uint32_t gid) @@ -100,7 +100,7 @@ TMXMapInfo* TMXMapInfo::create(std::string_view tmxFile) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -112,7 +112,7 @@ TMXMapInfo* TMXMapInfo::createWithXML(std::string_view tmxString, std::string_vi ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -168,7 +168,7 @@ TMXMapInfo::TMXMapInfo() TMXMapInfo::~TMXMapInfo() { - CCLOGINFO("deallocing TMXMapInfo: %p", this); + AXLOGINFO("deallocing TMXMapInfo: %p", this); } bool TMXMapInfo::parseXMLString(std::string_view xmlString) @@ -221,7 +221,7 @@ void TMXMapInfo::startElement(void* /*ctx*/, const char* name, const char** atts if (elementName == "map") { std::string version = attributeDict["version"].asString(); - CCLOG("cocos2d: TMXFormat: TMX version: %s", version.c_str()); + AXLOG("cocos2d: TMXFormat: TMX version: %s", version.c_str()); std::string orientationStr = attributeDict["orientation"].asString(); if (orientationStr == "orthogonal") @@ -242,7 +242,7 @@ void TMXMapInfo::startElement(void* /*ctx*/, const char* name, const char** atts } else { - CCLOG("cocos2d: TMXFomat: Unsupported orientation: %d", tmxMapInfo->getOrientation()); + AXLOG("cocos2d: TMXFomat: Unsupported orientation: %d", tmxMapInfo->getOrientation()); } std::string staggerAxisStr = attributeDict["staggeraxis"].asString(); @@ -467,7 +467,7 @@ void TMXMapInfo::startElement(void* /*ctx*/, const char* name, const char** atts layerAttribs = tmxMapInfo->getLayerAttribs(); tmxMapInfo->setLayerAttribs(layerAttribs | TMXLayerAttribZlib); } - CCASSERT(compression == "" || compression == "gzip" || compression == "zlib", + AXASSERT(compression == "" || compression == "gzip" || compression == "zlib", "TMX: unsupported compression method"); } else if (encoding == "csv") @@ -502,14 +502,14 @@ void TMXMapInfo::startElement(void* /*ctx*/, const char* name, const char** atts Vec2 p(x + objectGroup->getPositionOffset().x, _mapSize.height * _tileSize.height - y - objectGroup->getPositionOffset().y - attributeDict["height"].asInt()); - p = CC_POINT_PIXELS_TO_POINTS(p); + p = AX_POINT_PIXELS_TO_POINTS(p); dict["x"] = Value(p.x); dict["y"] = Value(p.y); int width = attributeDict["width"].asInt(); int height = attributeDict["height"].asInt(); Vec2 s(width, height); - s = CC_SIZE_PIXELS_TO_POINTS(s); + s = AX_SIZE_PIXELS_TO_POINTS(s); dict["width"] = Value(s.width); dict["height"] = Value(s.height); @@ -525,7 +525,7 @@ void TMXMapInfo::startElement(void* /*ctx*/, const char* name, const char** atts { if (tmxMapInfo->getParentElement() == TMXPropertyNone) { - CCLOG("TMX tile map: Parent element is unsupported. Cannot add property named '%s' with value '%s'", + AXLOG("TMX tile map: Parent element is unsupported. Cannot add property named '%s' with value '%s'", attributeDict["name"].asString().c_str(), attributeDict["value"].asString().c_str()); } else if (tmxMapInfo->getParentElement() == TMXPropertyMap) @@ -694,7 +694,7 @@ void TMXMapInfo::endElement(void* /*ctx*/, const char* name) base64Decode((unsigned char*)currentString.data(), (unsigned int)currentString.length(), &buffer); if (!buffer) { - CCLOG("cocos2d: TiledMap: decode data error"); + AXLOG("cocos2d: TiledMap: decode data error"); return; } @@ -705,15 +705,15 @@ void TMXMapInfo::endElement(void* /*ctx*/, const char* name) // int sizeHint = s.width * s.height * sizeof(uint32_t); ssize_t sizeHint = s.width * s.height * sizeof(unsigned int); - ssize_t CC_UNUSED inflatedLen = ZipUtils::inflateMemoryWithHint(buffer, len, &deflated, sizeHint); - CCASSERT(inflatedLen == sizeHint, "inflatedLen should be equal to sizeHint!"); + ssize_t AX_UNUSED inflatedLen = ZipUtils::inflateMemoryWithHint(buffer, len, &deflated, sizeHint); + AXASSERT(inflatedLen == sizeHint, "inflatedLen should be equal to sizeHint!"); free(buffer); buffer = nullptr; if (!deflated) { - CCLOG("cocos2d: TiledMap: inflate data error"); + AXLOG("cocos2d: TiledMap: inflate data error"); return; } @@ -753,7 +753,7 @@ void TMXMapInfo::endElement(void* /*ctx*/, const char* name) buffer = (unsigned char*)malloc(gidTokens.size() * 4); if (!buffer) { - CCLOG("cocos2d: TiledMap: CSV buffer not allocated."); + AXLOG("cocos2d: TiledMap: CSV buffer not allocated."); return; } diff --git a/core/2d/CCTMXXMLParser.h b/core/2d/CCTMXXMLParser.h index 3afe4de1e8..084a51ac65 100644 --- a/core/2d/CCTMXXMLParser.h +++ b/core/2d/CCTMXXMLParser.h @@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_TM_XML_PARSER__ -#define __CC_TM_XML_PARSER__ +#ifndef __AX_TM_XML_PARSER__ +#define __AX_TM_XML_PARSER__ /// @cond DO_NOT_SHOW @@ -134,7 +134,7 @@ enum This information is obtained from the TMX file. */ -struct CC_DLL TMXTileAnimFrame +struct AX_DLL TMXTileAnimFrame { TMXTileAnimFrame(uint32_t tileID, float duration); /** gid of the frame */ @@ -149,7 +149,7 @@ struct CC_DLL TMXTileAnimFrame This information is obtained from the TMX file. */ -struct CC_DLL TMXTileAnimInfo : public Ref +struct AX_DLL TMXTileAnimInfo : public Ref { static TMXTileAnimInfo* create(uint32_t tileID); explicit TMXTileAnimInfo(uint32_t tileID); @@ -167,7 +167,7 @@ struct CC_DLL TMXTileAnimInfo : public Ref This information is obtained from the TMX file. */ -class CC_DLL TMXLayerInfo : public Ref +class AX_DLL TMXLayerInfo : public Ref { public: /** @@ -203,7 +203,7 @@ public: This information is obtained from the TMX file. */ -class CC_DLL TMXTilesetInfo : public Ref +class AX_DLL TMXTilesetInfo : public Ref { public: std::string _name; @@ -246,7 +246,7 @@ And it also contains: This information is obtained from the TMX file. */ -class CC_DLL TMXMapInfo : public Ref, public SAXDelegator +class AX_DLL TMXMapInfo : public Ref, public SAXDelegator { public: /** creates a TMX Format with a tmx file */ diff --git a/core/2d/CCTextFieldTTF.cpp b/core/2d/CCTextFieldTTF.cpp index ed44395d5c..dc59873acb 100644 --- a/core/2d/CCTextFieldTTF.cpp +++ b/core/2d/CCTextFieldTTF.cpp @@ -42,7 +42,7 @@ static std::size_t _calcCharCount(const char* text) char ch = 0; while ((ch = *text)) { - CC_BREAK_IF(!ch); + AX_BREAK_IF(!ch); if (0x80 != (0xC0 & ch)) { @@ -125,7 +125,7 @@ TextFieldTTF* TextFieldTTF::textFieldWithPlaceHolder(std::string_view placeholde } return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -143,7 +143,7 @@ TextFieldTTF* TextFieldTTF::textFieldWithPlaceHolder(std::string_view placeholde } return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -186,8 +186,8 @@ bool TextFieldTTF::initWithPlaceHolder(std::string_view placeholder, std::string setTextColorInternally(_colorSpaceHolder); Label::setString(_placeHolder); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ - CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ + AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) // On desktop default enable cursor if (_currentLabelType == LabelType::TTF) { diff --git a/core/2d/CCTextFieldTTF.h b/core/2d/CCTextFieldTTF.h index cb0d8f7704..744a9db8fd 100644 --- a/core/2d/CCTextFieldTTF.h +++ b/core/2d/CCTextFieldTTF.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_TEXT_FIELD_H__ -#define __CC_TEXT_FIELD_H__ +#ifndef __AX_TEXT_FIELD_H__ +#define __AX_TEXT_FIELD_H__ #include "2d/CCLabel.h" #include "base/CCIMEDelegate.h" @@ -41,7 +41,7 @@ class TextFieldTTF; /** * A input protocol for TextField. */ -class CC_DLL TextFieldDelegate +class AX_DLL TextFieldDelegate { public: /** @@ -79,7 +79,7 @@ public: /** *@brief A simple text input field with TTF font. */ -class CC_DLL TextFieldTTF : public Label, public IMEDelegate +class AX_DLL TextFieldTTF : public Label, public IMEDelegate { public: /** @@ -300,4 +300,4 @@ NS_AX_END // end of ui group /// @} -#endif // __CC_TEXT_FIELD_H__ +#endif // __AX_TEXT_FIELD_H__ diff --git a/core/2d/CCTileMapAtlas.cpp b/core/2d/CCTileMapAtlas.cpp index d860eb00be..cbff475df4 100644 --- a/core/2d/CCTileMapAtlas.cpp +++ b/core/2d/CCTileMapAtlas.cpp @@ -44,7 +44,7 @@ TileMapAtlas* TileMapAtlas::create(std::string_view tile, std::string_view mapFi ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -83,7 +83,7 @@ void TileMapAtlas::releaseMap() void TileMapAtlas::calculateItemsToRender() { - CCASSERT(_TGAInfo != nullptr, "tgaInfo must be non-nil"); + AXASSERT(_TGAInfo != nullptr, "tgaInfo must be non-nil"); _itemsToRender = 0; for (int x = 0; x < _TGAInfo->width; x++) @@ -113,7 +113,7 @@ void TileMapAtlas::loadTGAfile(std::string_view file) #if 1 if (_TGAInfo->status != TGA_OK) { - CCASSERT(0, "TileMapAtlasLoadTGA : TileMapAtlas cannot load TGA file"); + AXASSERT(0, "TileMapAtlasLoadTGA : TileMapAtlas cannot load TGA file"); } #endif } @@ -121,16 +121,16 @@ void TileMapAtlas::loadTGAfile(std::string_view file) // TileMapAtlas - Atlas generation / updates void TileMapAtlas::setTile(const Color3B& tile, const Vec2& position) { - CCASSERT(_TGAInfo != nullptr, "tgaInfo must not be nil"); - CCASSERT(position.x < _TGAInfo->width, "Invalid position.x"); - CCASSERT(position.y < _TGAInfo->height, "Invalid position.x"); - CCASSERT(tile.r != 0, "R component must be non 0"); + AXASSERT(_TGAInfo != nullptr, "tgaInfo must not be nil"); + AXASSERT(position.x < _TGAInfo->width, "Invalid position.x"); + AXASSERT(position.y < _TGAInfo->height, "Invalid position.x"); + AXASSERT(tile.r != 0, "R component must be non 0"); Color3B* ptr = (Color3B*)_TGAInfo->imageData; Color3B value = ptr[(unsigned int)(position.x + position.y * _TGAInfo->width)]; if (value.r == 0) { - CCLOG("cocos2d: Value.r must be non 0."); + AXLOG("cocos2d: Value.r must be non 0."); } else { @@ -147,9 +147,9 @@ void TileMapAtlas::setTile(const Color3B& tile, const Vec2& position) Color3B TileMapAtlas::getTileAt(const Vec2& position) const { - CCASSERT(_TGAInfo != nullptr, "tgaInfo must not be nil"); - CCASSERT(position.x < _TGAInfo->width, "Invalid position.x"); - CCASSERT(position.y < _TGAInfo->height, "Invalid position.y"); + AXASSERT(_TGAInfo != nullptr, "tgaInfo must not be nil"); + AXASSERT(position.x < _TGAInfo->width, "Invalid position.x"); + AXASSERT(position.y < _TGAInfo->height, "Invalid position.y"); Color3B* ptr = (Color3B*)_TGAInfo->imageData; Color3B value = ptr[(unsigned int)(position.x + position.y * _TGAInfo->width)]; @@ -159,7 +159,7 @@ Color3B TileMapAtlas::getTileAt(const Vec2& position) const void TileMapAtlas::updateAtlasValueAt(const Vec2& pos, const Color3B& value, int index) { - CCASSERT(index >= 0 && index < _textureAtlas->getCapacity(), "updateAtlasValueAt: Invalid index"); + AXASSERT(index >= 0 && index < _textureAtlas->getCapacity(), "updateAtlasValueAt: Invalid index"); V3F_C4B_T2F_Quad* quad = &((_textureAtlas->getQuads())[index]); @@ -171,10 +171,10 @@ void TileMapAtlas::updateAtlasValueAt(const Vec2& pos, const Color3B& value, int float textureWide = (float)(_textureAtlas->getTexture()->getPixelsWide()); float textureHigh = (float)(_textureAtlas->getTexture()->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 CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#if AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL float left = (2 * row * itemWidthInPixels + 1) / (2 * textureWide); float right = left + (itemWidthInPixels * 2 - 2) / (2 * textureWide); float top = (2 * col * itemHeightInPixels + 1) / (2 * textureHigh); @@ -224,7 +224,7 @@ void TileMapAtlas::updateAtlasValueAt(const Vec2& pos, const Color3B& value, int void TileMapAtlas::updateAtlasValues() { - CCASSERT(_TGAInfo != nullptr, "tgaInfo must be non-nil"); + AXASSERT(_TGAInfo != nullptr, "tgaInfo must be non-nil"); int total = 0; diff --git a/core/2d/CCTileMapAtlas.h b/core/2d/CCTileMapAtlas.h index 97d529f9a5..fae1197ac3 100644 --- a/core/2d/CCTileMapAtlas.h +++ b/core/2d/CCTileMapAtlas.h @@ -53,7 +53,7 @@ You SHOULD not use this class. Instead, use the newer TMX file format: TMXTiledMap @js NA */ -class CC_DLL TileMapAtlas : public AtlasNode +class AX_DLL TileMapAtlas : public AtlasNode { public: /** creates a TileMap with a tile file (atlas) with a map file and the width and height of each tile in points. diff --git a/core/2d/CCTransition.cpp b/core/2d/CCTransition.cpp index 3fc8f6e519..53d88f27e6 100644 --- a/core/2d/CCTransition.cpp +++ b/core/2d/CCTransition.cpp @@ -49,8 +49,8 @@ TransitionScene::TransitionScene() TransitionScene::~TransitionScene() { - CC_SAFE_RELEASE(_inScene); - CC_SAFE_RELEASE(_outScene); + AX_SAFE_RELEASE(_inScene); + AX_SAFE_RELEASE(_outScene); } TransitionScene* TransitionScene::create(float t, Scene* scene) @@ -61,26 +61,26 @@ TransitionScene* TransitionScene::create(float t, Scene* scene) pScene->autorelease(); return pScene; } - CC_SAFE_DELETE(pScene); + AX_SAFE_DELETE(pScene); return nullptr; } bool TransitionScene::initWithDuration(float t, Scene* scene) { - CCASSERT(scene != nullptr, "Argument scene must be non-nil"); + AXASSERT(scene != nullptr, "Argument scene must be non-nil"); if (Scene::init()) { _duration = t; // retain -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, scene); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _inScene = scene; _inScene->retain(); _outScene = _director->getRunningScene(); @@ -93,7 +93,7 @@ bool TransitionScene::initWithDuration(float t, Scene* scene) } _outScene->retain(); - CCASSERT(_inScene != _outScene, "Incoming scene must be different from the outgoing scene"); + AXASSERT(_inScene != _outScene, "Incoming scene must be different from the outgoing scene"); sceneOrder(); @@ -142,24 +142,24 @@ void TransitionScene::finish() _outScene->setAdditionalTransform(nullptr); //[self schedule:@selector(setNewScene:) interval:0]; - this->schedule(CC_SCHEDULE_SELECTOR(TransitionScene::setNewScene), 0); + this->schedule(AX_SCHEDULE_SELECTOR(TransitionScene::setNewScene), 0); } void TransitionScene::setNewScene(float /*dt*/) { - this->unschedule(CC_SCHEDULE_SELECTOR(TransitionScene::setNewScene)); + this->unschedule(AX_SCHEDULE_SELECTOR(TransitionScene::setNewScene)); // Before replacing, save the "send cleanup to scene" _isSendCleanupToScene = _director->isSendCleanupToScene(); _director->replaceScene(_inScene); -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, _inScene); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS // issue #267 _outScene->setVisible(true); @@ -199,10 +199,10 @@ void TransitionScene::onExit() // only the onEnterTransitionDidFinish _inScene->onEnterTransitionDidFinish(); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING if (ScriptEngineManager::getInstance()->getScriptEngine()) ScriptEngineManager::getInstance()->getScriptEngine()->garbageCollect(); -#endif // CC_ENABLE_SCRIPT_BINDING +#endif // AX_ENABLE_SCRIPT_BINDING } // custom cleanup @@ -252,7 +252,7 @@ TransitionRotoZoom* TransitionRotoZoom::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -274,7 +274,7 @@ void TransitionRotoZoom::onEnter() _outScene->runAction(rotozoom); _inScene->runAction( - Sequence::create(rotozoom->reverse(), CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr)); + Sequence::create(rotozoom->reverse(), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); } // @@ -291,7 +291,7 @@ TransitionJumpZoom* TransitionJumpZoom::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -316,7 +316,7 @@ void TransitionJumpZoom::onEnter() _outScene->runAction(jumpZoomOut); _inScene->runAction( - Sequence::create(delay, jumpZoomIn, CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr)); + Sequence::create(delay, jumpZoomIn, CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); } // @@ -334,7 +334,7 @@ TransitionMoveInL* TransitionMoveInL::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -346,7 +346,7 @@ void TransitionMoveInL::onEnter() ActionInterval* a = this->action(); _inScene->runAction(Sequence::create(this->easeActionWithAction(a), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr)); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); } ActionInterval* TransitionMoveInL::action() @@ -380,7 +380,7 @@ TransitionMoveInR* TransitionMoveInR::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -404,7 +404,7 @@ TransitionMoveInT* TransitionMoveInT::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -428,7 +428,7 @@ TransitionMoveInB* TransitionMoveInB::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -461,7 +461,7 @@ void TransitionSlideInL::onEnter() ActionInterval* inAction = easeActionWithAction(in); ActionInterval* outAction = Sequence::create( - easeActionWithAction(out), CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + easeActionWithAction(out), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); _inScene->runAction(inAction); _outScene->runAction(outAction); } @@ -496,7 +496,7 @@ TransitionSlideInL* TransitionSlideInL::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -514,7 +514,7 @@ TransitionSlideInR* TransitionSlideInR::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -549,7 +549,7 @@ TransitionSlideInT* TransitionSlideInT::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -584,7 +584,7 @@ TransitionSlideInB* TransitionSlideInB::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -619,7 +619,7 @@ TransitionShrinkGrow* TransitionShrinkGrow::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -638,7 +638,7 @@ void TransitionShrinkGrow::onEnter() _inScene->runAction(this->easeActionWithAction(scaleIn)); _outScene->runAction(Sequence::create(this->easeActionWithAction(scaleOut), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr)); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); } ActionInterval* TransitionShrinkGrow::easeActionWithAction(ActionInterval* action) { @@ -678,7 +678,7 @@ void TransitionFlipX::onEnter() auto inA = Sequence::create(DelayTime::create(_duration / 2), Show::create(), OrbitCamera::create(_duration / 2, 1, 0, inAngleZ, inDeltaZ, 0, 0), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); auto outA = Sequence::create(OrbitCamera::create(_duration / 2, 1, 0, outAngleZ, outDeltaZ, 0, 0), Hide::create(), DelayTime::create(_duration / 2), nullptr); @@ -733,7 +733,7 @@ void TransitionFlipY::onEnter() auto inA = Sequence::create(DelayTime::create(_duration / 2), Show::create(), OrbitCamera::create(_duration / 2, 1, 0, inAngleZ, inDeltaZ, 90, 0), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); auto outA = Sequence::create(OrbitCamera::create(_duration / 2, 1, 0, outAngleZ, outDeltaZ, 90, 0), Hide::create(), DelayTime::create(_duration / 2), nullptr); @@ -788,7 +788,7 @@ void TransitionFlipAngular::onEnter() auto inA = Sequence::create(DelayTime::create(_duration / 2), Show::create(), OrbitCamera::create(_duration / 2, 1, 0, inAngleZ, inDeltaZ, -45, 0), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); auto outA = Sequence::create(OrbitCamera::create(_duration / 2, 1, 0, outAngleZ, outDeltaZ, 45, 0), Hide::create(), DelayTime::create(_duration / 2), nullptr); @@ -842,7 +842,7 @@ void TransitionZoomFlipX::onEnter() auto inA = Sequence::create(DelayTime::create(_duration / 2), Spawn::create(OrbitCamera::create(_duration / 2, 1, 0, inAngleZ, inDeltaZ, 0, 0), ScaleTo::create(_duration / 2, 1), Show::create(), nullptr), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); auto outA = Sequence::create(Spawn::create(OrbitCamera::create(_duration / 2, 1, 0, outAngleZ, outDeltaZ, 0, 0), ScaleTo::create(_duration / 2, 0.5f), nullptr), Hide::create(), DelayTime::create(_duration / 2), nullptr); @@ -900,7 +900,7 @@ void TransitionZoomFlipY::onEnter() auto inA = Sequence::create(DelayTime::create(_duration / 2), Spawn::create(OrbitCamera::create(_duration / 2, 1, 0, inAngleZ, inDeltaZ, 90, 0), ScaleTo::create(_duration / 2, 1), Show::create(), nullptr), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); auto outA = Sequence::create(Spawn::create(OrbitCamera::create(_duration / 2, 1, 0, outAngleZ, outDeltaZ, 90, 0), ScaleTo::create(_duration / 2, 0.5f), nullptr), @@ -959,7 +959,7 @@ void TransitionZoomFlipAngular::onEnter() Sequence::create(DelayTime::create(_duration / 2), Spawn::create(OrbitCamera::create(_duration / 2, 1, 0, inAngleZ, inDeltaZ, -45, 0), ScaleTo::create(_duration / 2, 1), Show::create(), nullptr), - Show::create(), CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + Show::create(), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); auto outA = Sequence::create(Spawn::create(OrbitCamera::create(_duration / 2, 1, 0, outAngleZ, outDeltaZ, 45, 0), ScaleTo::create(_duration / 2, 0.5f), nullptr), Hide::create(), DelayTime::create(_duration / 2), nullptr); @@ -1031,8 +1031,8 @@ void TransitionFade ::onEnter() Node* f = getChildByTag(kSceneFade); auto a = Sequence::create( - FadeIn::create(_duration / 2), CallFunc::create(CC_CALLBACK_0(TransitionScene::hideOutShowIn, this)), - FadeOut::create(_duration / 2), CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), + FadeIn::create(_duration / 2), CallFunc::create(AX_CALLBACK_0(TransitionScene::hideOutShowIn, this)), + FadeOut::create(_duration / 2), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); f->runAction(a); @@ -1058,7 +1058,7 @@ TransitionCrossFade* TransitionCrossFade::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1123,8 +1123,8 @@ void TransitionCrossFade::onEnter() // create the blend action Action* layerAction = Sequence::create(FadeTo::create(_duration, 0), - CallFunc::create(CC_CALLBACK_0(TransitionScene::hideOutShowIn, this)), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::hideOutShowIn, this)), + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); // run the blend action outTexture->getSprite()->runAction(layerAction); @@ -1152,7 +1152,7 @@ TransitionTurnOffTiles::TransitionTurnOffTiles() TransitionTurnOffTiles::~TransitionTurnOffTiles() { - CC_SAFE_RELEASE(_outSceneProxy); + AX_SAFE_RELEASE(_outSceneProxy); } TransitionTurnOffTiles* TransitionTurnOffTiles::create(float t, Scene* scene) @@ -1163,7 +1163,7 @@ TransitionTurnOffTiles* TransitionTurnOffTiles::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1186,7 +1186,7 @@ void TransitionTurnOffTiles::onEnter() TurnOffTiles* toff = TurnOffTiles::create(_duration, Vec2(x, y)); ActionInterval* action = easeActionWithAction(toff); - _outSceneProxy->runAction(Sequence::create(action, CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), + _outSceneProxy->runAction(Sequence::create(action, CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } @@ -1228,7 +1228,7 @@ TransitionSplitCols::TransitionSplitCols() } TransitionSplitCols::~TransitionSplitCols() { - CC_SAFE_RELEASE(_gridProxy); + AX_SAFE_RELEASE(_gridProxy); } TransitionSplitCols* TransitionSplitCols::create(float t, Scene* scene) @@ -1239,7 +1239,7 @@ TransitionSplitCols* TransitionSplitCols::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1252,11 +1252,11 @@ void TransitionSplitCols::onEnter() ActionInterval* split = action(); auto seq = - Sequence::create(split, CallFunc::create(CC_CALLBACK_0(TransitionSplitCols::switchTargetToInscene, this)), + Sequence::create(split, CallFunc::create(AX_CALLBACK_0(TransitionSplitCols::switchTargetToInscene, this)), split->reverse(), nullptr); _gridProxy->runAction(Sequence::create(easeActionWithAction(seq), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } @@ -1308,7 +1308,7 @@ TransitionSplitRows* TransitionSplitRows::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1322,7 +1322,7 @@ TransitionFadeTR::TransitionFadeTR() } TransitionFadeTR::~TransitionFadeTR() { - CC_SAFE_RELEASE(_outSceneProxy); + AX_SAFE_RELEASE(_outSceneProxy); } TransitionFadeTR* TransitionFadeTR::create(float t, Scene* scene) @@ -1333,7 +1333,7 @@ TransitionFadeTR* TransitionFadeTR::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1357,7 +1357,7 @@ void TransitionFadeTR::onEnter() ActionInterval* action = actionWithSize(Vec2(x, y)); _outSceneProxy->runAction(Sequence::create(easeActionWithAction(action), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } @@ -1409,7 +1409,7 @@ TransitionFadeBL* TransitionFadeBL::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1433,7 +1433,7 @@ TransitionFadeUp* TransitionFadeUp::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1456,7 +1456,7 @@ TransitionFadeDown* TransitionFadeDown::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } diff --git a/core/2d/CCTransition.h b/core/2d/CCTransition.h index 8980bb3296..9894771c24 100644 --- a/core/2d/CCTransition.h +++ b/core/2d/CCTransition.h @@ -51,7 +51,7 @@ class NodeGrid; @since v0.8.2 @js NA */ -class CC_DLL TransitionEaseScene // : public Ref +class AX_DLL TransitionEaseScene // : public Ref { public: /** Constructor. @@ -70,7 +70,7 @@ public: /** @class TransitionScene * @brief Base class for Transition scenes. */ -class CC_DLL TransitionScene : public Scene +class AX_DLL TransitionScene : public Scene { public: /** Orientation Type used by some transitions. @@ -130,14 +130,14 @@ protected: bool _isSendCleanupToScene; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionScene); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionScene); }; /** @class TransitionSceneOriented * @brief A Transition that supports orientation like. * Possible orientation: LeftOver, RightOver, UpOver, DownOver */ -class CC_DLL TransitionSceneOriented : public TransitionScene +class AX_DLL TransitionSceneOriented : public TransitionScene { public: /** Creates a transition with duration, incoming scene and orientation. @@ -159,14 +159,14 @@ protected: Orientation _orientation; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSceneOriented); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSceneOriented); }; /** @class TransitionRotoZoom * @brief TransitionRotoZoom: Rotate and zoom out the outgoing scene, and then rotate and zoom in the incoming */ -class CC_DLL TransitionRotoZoom : public TransitionScene +class AX_DLL TransitionRotoZoom : public TransitionScene { public: /** Creates a transition with duration and incoming scene. @@ -186,14 +186,14 @@ public: virtual ~TransitionRotoZoom(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionRotoZoom); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionRotoZoom); }; /** @class TransitionJumpZoom * @brief TransitionJumpZoom: Zoom out and jump the outgoing scene, and then jump and zoom in the incoming */ -class CC_DLL TransitionJumpZoom : public TransitionScene +class AX_DLL TransitionJumpZoom : public TransitionScene { public: /** Creates a transition with duration and incoming scene. @@ -213,14 +213,14 @@ public: virtual ~TransitionJumpZoom(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionJumpZoom); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionJumpZoom); }; /** @class TransitionMoveInL * @brief TransitionMoveInL: Move in from to the left the incoming scene. */ -class CC_DLL TransitionMoveInL : public TransitionScene, public TransitionEaseScene +class AX_DLL TransitionMoveInL : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -252,14 +252,14 @@ protected: virtual void initScenes(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInL); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInL); }; /** @class TransitionMoveInR * @brief TransitionMoveInR: Move in from to the right the incoming scene. */ -class CC_DLL TransitionMoveInR : public TransitionMoveInL +class AX_DLL TransitionMoveInR : public TransitionMoveInL { public: /** Creates a transition with duration and incoming scene. @@ -277,14 +277,14 @@ protected: virtual void initScenes(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInR); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInR); }; /** @class TransitionMoveInT * @brief TransitionMoveInT: Move in from to the top the incoming scene. */ -class CC_DLL TransitionMoveInT : public TransitionMoveInL +class AX_DLL TransitionMoveInT : public TransitionMoveInL { public: /** Creates a transition with duration and incoming scene. @@ -302,14 +302,14 @@ protected: virtual void initScenes(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInT); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInT); }; /** @class TransitionMoveInB * @brief TransitionMoveInB: Move in from to the bottom the incoming scene. */ -class CC_DLL TransitionMoveInB : public TransitionMoveInL +class AX_DLL TransitionMoveInB : public TransitionMoveInL { public: /** Creates a transition with duration and incoming scene. @@ -327,14 +327,14 @@ protected: virtual void initScenes(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInB); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInB); }; /** @class TransitionSlideInL * @brief TransitionSlideInL: Slide in the incoming scene from the left border. */ -class CC_DLL TransitionSlideInL : public TransitionScene, public TransitionEaseScene +class AX_DLL TransitionSlideInL : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -368,14 +368,14 @@ protected: virtual void sceneOrder() override; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInL); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInL); }; /** @class TransitionSlideInR *@brief TransitionSlideInR: Slide in the incoming scene from the right border. */ -class CC_DLL TransitionSlideInR : public TransitionSlideInL +class AX_DLL TransitionSlideInR : public TransitionSlideInL { public: /** Creates a transition with duration and incoming scene. @@ -399,14 +399,14 @@ protected: virtual void sceneOrder() override; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInR); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInR); }; /** @class TransitionSlideInB * @brief TransitionSlideInB: Slide in the incoming scene from the bottom border. */ -class CC_DLL TransitionSlideInB : public TransitionSlideInL +class AX_DLL TransitionSlideInB : public TransitionSlideInL { public: /** Creates a transition with duration and incoming scene. @@ -430,14 +430,14 @@ protected: virtual void sceneOrder() override; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInB); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInB); }; /** @class TransitionSlideInT * @brief TransitionSlideInT: Slide in the incoming scene from the top border. */ -class CC_DLL TransitionSlideInT : public TransitionSlideInL +class AX_DLL TransitionSlideInT : public TransitionSlideInL { public: /** Creates a transition with duration and incoming scene. @@ -461,13 +461,13 @@ protected: virtual void sceneOrder() override; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInT); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInT); }; /** @class TransitionShrinkGrow * @brief Shrink the outgoing scene while grow the incoming scene */ -class CC_DLL TransitionShrinkGrow : public TransitionScene, public TransitionEaseScene +class AX_DLL TransitionShrinkGrow : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -491,7 +491,7 @@ public: virtual ~TransitionShrinkGrow(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionShrinkGrow); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionShrinkGrow); }; /** @class TransitionFlipX @@ -499,7 +499,7 @@ private: Flips the screen horizontally. The front face is the outgoing scene and the back face is the incoming scene. */ -class CC_DLL TransitionFlipX : public TransitionSceneOriented +class AX_DLL TransitionFlipX : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -530,7 +530,7 @@ public: virtual ~TransitionFlipX(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipX); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFlipX); }; /** @class TransitionFlipY @@ -538,7 +538,7 @@ private: Flips the screen vertically. The front face is the outgoing scene and the back face is the incoming scene. */ -class CC_DLL TransitionFlipY : public TransitionSceneOriented +class AX_DLL TransitionFlipY : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -569,7 +569,7 @@ public: virtual ~TransitionFlipY(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipY); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFlipY); }; /** @class TransitionFlipAngular @@ -577,7 +577,7 @@ private: Flips the screen half horizontally and half vertically. The front face is the outgoing scene and the back face is the incoming scene. */ -class CC_DLL TransitionFlipAngular : public TransitionSceneOriented +class AX_DLL TransitionFlipAngular : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -608,7 +608,7 @@ public: virtual ~TransitionFlipAngular(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipAngular); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFlipAngular); }; /** @class TransitionZoomFlipX @@ -616,7 +616,7 @@ private: Flips the screen horizontally doing a zoom out/in The front face is the outgoing scene and the back face is the incoming scene. */ -class CC_DLL TransitionZoomFlipX : public TransitionSceneOriented +class AX_DLL TransitionZoomFlipX : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -647,7 +647,7 @@ public: virtual ~TransitionZoomFlipX(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipX); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipX); }; /** @class TransitionZoomFlipY @@ -655,7 +655,7 @@ private: Flips the screen vertically doing a little zooming out/in The front face is the outgoing scene and the back face is the incoming scene. */ -class CC_DLL TransitionZoomFlipY : public TransitionSceneOriented +class AX_DLL TransitionZoomFlipY : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -686,7 +686,7 @@ public: virtual ~TransitionZoomFlipY(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipY); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipY); }; /** @class TransitionZoomFlipAngular @@ -694,7 +694,7 @@ private: Flips the screen half horizontally and half vertically doing a little zooming out/in. The front face is the outgoing scene and the back face is the incoming scene. */ -class CC_DLL TransitionZoomFlipAngular : public TransitionSceneOriented +class AX_DLL TransitionZoomFlipAngular : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -725,14 +725,14 @@ public: virtual ~TransitionZoomFlipAngular(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipAngular); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipAngular); }; /** @class TransitionFade * @brief TransitionFade: Fade out the outgoing scene and then fade in the incoming scene.''' */ -class CC_DLL TransitionFade : public TransitionScene +class AX_DLL TransitionFade : public TransitionScene { public: /** Creates the transition with a duration and with an RGB color @@ -772,7 +772,7 @@ protected: Color4B _color; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFade); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFade); }; class RenderTexture; @@ -780,7 +780,7 @@ class RenderTexture; @brief TransitionCrossFade: Cross fades two scenes using the RenderTexture object. */ -class CC_DLL TransitionCrossFade : public TransitionScene +class AX_DLL TransitionCrossFade : public TransitionScene { public: /** Creates a transition with duration and incoming scene. @@ -811,14 +811,14 @@ public: virtual ~TransitionCrossFade(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionCrossFade); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionCrossFade); }; /** @class TransitionTurnOffTiles * @brief TransitionTurnOffTiles: Turn off the tiles of the outgoing scene in random order */ -class CC_DLL TransitionTurnOffTiles : public TransitionScene, public TransitionEaseScene +class AX_DLL TransitionTurnOffTiles : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -854,14 +854,14 @@ protected: NodeGrid* _outSceneProxy; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionTurnOffTiles); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionTurnOffTiles); }; /** @class TransitionSplitCols * @brief TransitionSplitCols: The odd columns goes upwards while the even columns goes downwards. */ -class CC_DLL TransitionSplitCols : public TransitionScene, public TransitionEaseScene +class AX_DLL TransitionSplitCols : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -897,14 +897,14 @@ protected: NodeGrid* _gridProxy; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSplitCols); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSplitCols); }; /** @class TransitionSplitRows * @brief TransitionSplitRows: The odd rows goes to the left while the even rows goes to the right. */ -class CC_DLL TransitionSplitRows : public TransitionSplitCols +class AX_DLL TransitionSplitRows : public TransitionSplitCols { public: /** Creates a transition with duration and incoming scene. @@ -924,14 +924,14 @@ public: virtual ~TransitionSplitRows(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSplitRows); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSplitRows); }; /** @class TransitionFadeTR * @brief TransitionFadeTR: Fade the tiles of the outgoing scene from the left-bottom corner the to top-right corner. */ -class CC_DLL TransitionFadeTR : public TransitionScene, public TransitionEaseScene +class AX_DLL TransitionFadeTR : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -970,14 +970,14 @@ protected: NodeGrid* _outSceneProxy; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeTR); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFadeTR); }; /** @class TransitionFadeBL * @brief TransitionFadeBL: Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner. */ -class CC_DLL TransitionFadeBL : public TransitionFadeTR +class AX_DLL TransitionFadeBL : public TransitionFadeTR { public: /** Creates a transition with duration and incoming scene. @@ -997,14 +997,14 @@ public: virtual ~TransitionFadeBL(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeBL); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFadeBL); }; /** @class TransitionFadeUp * @brief TransitionFadeUp: * Fade the tiles of the outgoing scene from the bottom to the top. */ -class CC_DLL TransitionFadeUp : public TransitionFadeTR +class AX_DLL TransitionFadeUp : public TransitionFadeTR { public: /** Creates a transition with duration and incoming scene. @@ -1024,14 +1024,14 @@ public: virtual ~TransitionFadeUp(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeUp); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFadeUp); }; /** @class TransitionFadeDown * @brief TransitionFadeDown: * Fade the tiles of the outgoing scene from the top to the bottom. */ -class CC_DLL TransitionFadeDown : public TransitionFadeTR +class AX_DLL TransitionFadeDown : public TransitionFadeTR { public: /** Creates a transition with duration and incoming scene. @@ -1051,7 +1051,7 @@ public: virtual ~TransitionFadeDown(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeDown); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFadeDown); }; // end of _2d group diff --git a/core/2d/CCTransitionPageTurn.cpp b/core/2d/CCTransitionPageTurn.cpp index b43f0ffd78..af87b7f2cd 100644 --- a/core/2d/CCTransitionPageTurn.cpp +++ b/core/2d/CCTransitionPageTurn.cpp @@ -44,8 +44,8 @@ TransitionPageTurn::TransitionPageTurn() TransitionPageTurn::~TransitionPageTurn() { - CC_SAFE_RELEASE(_inSceneProxy); - CC_SAFE_RELEASE(_outSceneProxy); + AX_SAFE_RELEASE(_inSceneProxy); + AX_SAFE_RELEASE(_outSceneProxy); } /** creates a base transition with duration and incoming scene */ @@ -119,14 +119,14 @@ void TransitionPageTurn::onEnter() if (!_back) { _outSceneProxy->runAction(Sequence::create( - action, CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); + action, CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } else { // to prevent initial flicker _inSceneProxy->setVisible(false); _inSceneProxy->runAction(Sequence::create(Show::create(), action, - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } } diff --git a/core/2d/CCTransitionPageTurn.h b/core/2d/CCTransitionPageTurn.h index 34cc305eaf..047306b22a 100644 --- a/core/2d/CCTransitionPageTurn.h +++ b/core/2d/CCTransitionPageTurn.h @@ -51,7 +51,7 @@ is turned on in Director using: @since v0.8.2 */ -class CC_DLL TransitionPageTurn : public TransitionScene +class AX_DLL TransitionPageTurn : public TransitionScene { public: /** diff --git a/core/2d/CCTransitionProgress.cpp b/core/2d/CCTransitionProgress.cpp index c412ad92f9..ed67207f0d 100644 --- a/core/2d/CCTransitionProgress.cpp +++ b/core/2d/CCTransitionProgress.cpp @@ -50,7 +50,7 @@ TransitionProgress* TransitionProgress::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -87,7 +87,7 @@ void TransitionProgress::onEnter() // create the blend action auto layerAction = Sequence::create(ProgressFromTo::create(_duration, _from, _to), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); // run the blend action node->runAction(layerAction); @@ -117,7 +117,7 @@ void TransitionProgress::setupTransition() ProgressTimer* TransitionProgress::progressTimerNodeWithRenderTexture(RenderTexture* /*texture*/) { - CCASSERT(false, "override me - abstract class"); + AXASSERT(false, "override me - abstract class"); return nullptr; } @@ -150,7 +150,7 @@ TransitionProgressRadialCCW* TransitionProgressRadialCCW::create(float t, Scene* newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -163,7 +163,7 @@ TransitionProgressRadialCW* TransitionProgressRadialCW::create(float t, Scene* s newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -195,7 +195,7 @@ TransitionProgressHorizontal* TransitionProgressHorizontal::create(float t, Scen newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -228,7 +228,7 @@ TransitionProgressVertical* TransitionProgressVertical::create(float t, Scene* s newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -261,7 +261,7 @@ TransitionProgressInOut* TransitionProgressInOut::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -306,7 +306,7 @@ TransitionProgressOutIn* TransitionProgressOutIn::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } diff --git a/core/2d/CCTransitionProgress.h b/core/2d/CCTransitionProgress.h index db5330c897..d2a163d82c 100644 --- a/core/2d/CCTransitionProgress.h +++ b/core/2d/CCTransitionProgress.h @@ -43,7 +43,7 @@ class RenderTexture; /** @class TransitionProgress * @brief A base class of progress transition. */ -class CC_DLL TransitionProgress : public TransitionScene +class AX_DLL TransitionProgress : public TransitionScene { public: /** Creates a transition with duration and incoming scene. @@ -80,7 +80,7 @@ protected: * @brief TransitionRadialCCW transition. A counter clock-wise radial transition to the next scene */ -class CC_DLL TransitionProgressRadialCCW : public TransitionProgress +class AX_DLL TransitionProgressRadialCCW : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. @@ -108,7 +108,7 @@ protected: * @brief TransitionRadialCW transition. A counter clock-wise radial transition to the next scene. */ -class CC_DLL TransitionProgressRadialCW : public TransitionProgress +class AX_DLL TransitionProgressRadialCW : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. @@ -136,7 +136,7 @@ protected: * @brief TransitionProgressHorizontal transition. A clock-wise radial transition to the next scene */ -class CC_DLL TransitionProgressHorizontal : public TransitionProgress +class AX_DLL TransitionProgressHorizontal : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. @@ -163,7 +163,7 @@ protected: /** @class TransitionProgressVertical * @brief TransitionProgressVertical transition. */ -class CC_DLL TransitionProgressVertical : public TransitionProgress +class AX_DLL TransitionProgressVertical : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. @@ -190,7 +190,7 @@ protected: /** @class TransitionProgressInOut * @brief TransitionProgressInOut transition. */ -class CC_DLL TransitionProgressInOut : public TransitionProgress +class AX_DLL TransitionProgressInOut : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. @@ -219,7 +219,7 @@ protected: /** @class TransitionProgressOutIn * @brief TransitionProgressOutIn transition. */ -class CC_DLL TransitionProgressOutIn : public TransitionProgress +class AX_DLL TransitionProgressOutIn : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. diff --git a/core/2d/CCTweenFunction.h b/core/2d/CCTweenFunction.h index 47f168adcc..49d0fd9935 100644 --- a/core/2d/CCTweenFunction.h +++ b/core/2d/CCTweenFunction.h @@ -87,210 +87,210 @@ enum TweenType /** * @param time in seconds. */ -float CC_DLL easeIn(float time, float rate); +float AX_DLL easeIn(float time, float rate); /** * @param time in seconds. */ -float CC_DLL easeOut(float time, float rate); +float AX_DLL easeOut(float time, float rate); /** * @param time in seconds. */ -float CC_DLL easeInOut(float time, float rate); +float AX_DLL easeInOut(float time, float rate); /** * @param time in seconds. */ -float CC_DLL bezieratFunction(float a, float b, float c, float d, float t); +float AX_DLL bezieratFunction(float a, float b, float c, float d, float t); /** * @param time in seconds. */ -float CC_DLL quadraticIn(float time); +float AX_DLL quadraticIn(float time); /** * @param time in seconds. */ -float CC_DLL quadraticOut(float time); +float AX_DLL quadraticOut(float time); /** * @param time in seconds. */ -float CC_DLL quadraticInOut(float time); +float AX_DLL quadraticInOut(float time); /** * @param time in seconds. */ -float CC_DLL quadraticInOut(float time); +float AX_DLL quadraticInOut(float time); /** * @param time in seconds. */ -float CC_DLL tweenTo(float time, TweenType type, float* easingParam); +float AX_DLL tweenTo(float time, TweenType type, float* easingParam); /** * @param time in seconds. */ -float CC_DLL linear(float time); +float AX_DLL linear(float time); /** * @param time in seconds. */ -float CC_DLL sineEaseIn(float time); +float AX_DLL sineEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL sineEaseOut(float time); +float AX_DLL sineEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL sineEaseInOut(float time); +float AX_DLL sineEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL quadEaseIn(float time); +float AX_DLL quadEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL quadEaseOut(float time); +float AX_DLL quadEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL quadEaseInOut(float time); +float AX_DLL quadEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL cubicEaseIn(float time); +float AX_DLL cubicEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL cubicEaseOut(float time); +float AX_DLL cubicEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL cubicEaseInOut(float time); +float AX_DLL cubicEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL quartEaseIn(float time); +float AX_DLL quartEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL quartEaseOut(float time); +float AX_DLL quartEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL quartEaseInOut(float time); +float AX_DLL quartEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL quintEaseIn(float time); +float AX_DLL quintEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL quintEaseOut(float time); +float AX_DLL quintEaseOut(float time); /** @param time in seconds. */ -float CC_DLL quintEaseInOut(float time); +float AX_DLL quintEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL expoEaseIn(float time); +float AX_DLL expoEaseIn(float time); /** @param time in seconds. */ -float CC_DLL expoEaseOut(float time); +float AX_DLL expoEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL expoEaseInOut(float time); +float AX_DLL expoEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL circEaseIn(float time); +float AX_DLL circEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL circEaseOut(float time); +float AX_DLL circEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL circEaseInOut(float time); +float AX_DLL circEaseInOut(float time); /** * @param time in seconds. * @param period in seconds. */ -float CC_DLL elasticEaseIn(float time, float period); +float AX_DLL elasticEaseIn(float time, float period); /** * @param time in seconds. * @param period in seconds. */ -float CC_DLL elasticEaseOut(float time, float period); +float AX_DLL elasticEaseOut(float time, float period); /** * @param time in seconds. * @param period in seconds. */ -float CC_DLL elasticEaseInOut(float time, float period); +float AX_DLL elasticEaseInOut(float time, float period); /** * @param time in seconds. */ -float CC_DLL backEaseIn(float time); +float AX_DLL backEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL backEaseOut(float time); +float AX_DLL backEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL backEaseInOut(float time); +float AX_DLL backEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL bounceEaseIn(float time); +float AX_DLL bounceEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL bounceEaseOut(float time); +float AX_DLL bounceEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL bounceEaseInOut(float time); +float AX_DLL bounceEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL customEase(float time, float* easingParam); +float AX_DLL customEase(float time, float* easingParam); } // namespace tweenfunc NS_AX_END diff --git a/core/3d/CC3DProgramInfo.cpp b/core/3d/CC3DProgramInfo.cpp index da98282e27..09a11be901 100644 --- a/core/3d/CC3DProgramInfo.cpp +++ b/core/3d/CC3DProgramInfo.cpp @@ -52,22 +52,22 @@ const char* SHADER_LAYER_RADIAL_GRADIENT = "ShaderLayerRadialGrad namespace uniform { // uniform names -const char* UNIFORM_NAME_AMBIENT_COLOR = "CC_AmbientColor"; -const char* UNIFORM_NAME_P_MATRIX = "CC_PMatrix"; -const char* UNIFORM_NAME_MULTIVIEW_P_MATRIX = "CC_MultiViewPMatrix"; -const char* UNIFORM_NAME_MV_MATRIX = "CC_MVMatrix"; -const char* UNIFORM_NAME_MVP_MATRIX = "CC_MVPMatrix"; -const char* UNIFORM_NAME_MULTIVIEW_MVP_MATRIX = "CC_MultiViewMVPMatrix"; -const char* UNIFORM_NAME_NORMAL_MATRIX = "CC_NormalMatrix"; -const char* UNIFORM_NAME_TIME = "CC_Time"; -const char* UNIFORM_NAME_SIN_TIME = "CC_SinTime"; -const char* UNIFORM_NAME_COS_TIME = "CC_CosTime"; -const char* UNIFORM_NAME_RANDOM01 = "CC_Random01"; -const char* UNIFORM_NAME_SAMPLER0 = "CC_Texture0"; -const char* UNIFORM_NAME_SAMPLER1 = "CC_Texture1"; -const char* UNIFORM_NAME_SAMPLER2 = "CC_Texture2"; -const char* UNIFORM_NAME_SAMPLER3 = "CC_Texture3"; -const char* UNIFORM_NAME_ALPHA_TEST_VALUE = "CC_alpha_value"; +const char* UNIFORM_NAME_AMBIENT_COLOR = "AX_AmbientColor"; +const char* UNIFORM_NAME_P_MATRIX = "AX_PMatrix"; +const char* UNIFORM_NAME_MULTIVIEW_P_MATRIX = "AX_MultiViewPMatrix"; +const char* UNIFORM_NAME_MV_MATRIX = "AX_MVMatrix"; +const char* UNIFORM_NAME_MVP_MATRIX = "AX_MVPMatrix"; +const char* UNIFORM_NAME_MULTIVIEW_MVP_MATRIX = "AX_MultiViewMVPMatrix"; +const char* UNIFORM_NAME_NORMAL_MATRIX = "AX_NormalMatrix"; +const char* UNIFORM_NAME_TIME = "AX_Time"; +const char* UNIFORM_NAME_SIN_TIME = "AX_SinTime"; +const char* UNIFORM_NAME_COS_TIME = "AX_CosTime"; +const char* UNIFORM_NAME_RANDOM01 = "AX_Random01"; +const char* UNIFORM_NAME_SAMPLER0 = "AX_Texture0"; +const char* UNIFORM_NAME_SAMPLER1 = "AX_Texture1"; +const char* UNIFORM_NAME_SAMPLER2 = "AX_Texture2"; +const char* UNIFORM_NAME_SAMPLER3 = "AX_Texture3"; +const char* UNIFORM_NAME_ALPHA_TEST_VALUE = "AX_alpha_value"; } // namespace uniform namespace attribute @@ -113,7 +113,7 @@ const std::string getAttributeName(const VertexKey& key) static int max = sizeof(s_attributeNames) / sizeof(s_attributeNames[0]); auto idx = static_cast(key); - CCASSERT(idx >= 0 && idx < max, "invalid key "); + AXASSERT(idx >= 0 && idx < max, "invalid key "); return s_attributeNames[idx]; } }; // namespace shaderinfos diff --git a/core/3d/CCAABB.h b/core/3d/CCAABB.h index 05205a1c49..82120f5ce1 100644 --- a/core/3d/CCAABB.h +++ b/core/3d/CCAABB.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_AABB_H__ -#define __CC_AABB_H__ +#ifndef __AX_AABB_H__ +#define __AX_AABB_H__ #include "base/ccMacros.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ NS_AX_BEGIN /** * Axis Aligned Bounding Box (AABB), usually calculate some rough but fast collision detection. */ -class CC_DLL AABB +class AX_DLL AABB { public: diff --git a/core/3d/CCAnimate3D.cpp b/core/3d/CCAnimate3D.cpp index c87e2f6ef6..12d3a269dc 100644 --- a/core/3d/CCAnimate3D.cpp +++ b/core/3d/CCAnimate3D.cpp @@ -224,7 +224,7 @@ void Animate3D::startWithTarget(Node* target) if (!hasCurve) { - CCLOG("warning: no animation found for the skeleton"); + AXLOG("warning: no animation found for the skeleton"); } } @@ -434,7 +434,7 @@ void Animate3D::setSpeed(float speed) void Animate3D::setWeight(float weight) { - CCASSERT(weight >= 0.0f, "invalid weight"); + AXASSERT(weight >= 0.0f, "invalid weight"); _weight = fabsf(weight); } @@ -513,7 +513,7 @@ Animate3D::~Animate3D() } _keyFrameEvent.clear(); - CC_SAFE_RELEASE(_animation); + AX_SAFE_RELEASE(_animation); } void Animate3D::removeFromMap() diff --git a/core/3d/CCAnimate3D.h b/core/3d/CCAnimate3D.h index 0f07a450b3..af741c856d 100644 --- a/core/3d/CCAnimate3D.h +++ b/core/3d/CCAnimate3D.h @@ -56,7 +56,7 @@ enum class Animate3DQuality /** * @brief Animate3D, Animates a MeshRenderer given with an Animation3D */ -class CC_DLL Animate3D : public ActionInterval +class AX_DLL Animate3D : public ActionInterval { public: /**create Animate3D using Animation.*/ diff --git a/core/3d/CCAnimation3D.cpp b/core/3d/CCAnimation3D.cpp index 05fd8adc35..a6d15cf3e4 100644 --- a/core/3d/CCAnimation3D.cpp +++ b/core/3d/CCAnimation3D.cpp @@ -44,7 +44,7 @@ Animation3D* Animation3D::create(std::string_view fileName, std::string_view ani } else { - CC_SAFE_DELETE(animation); + AX_SAFE_DELETE(animation); } return animation; @@ -86,16 +86,16 @@ Animation3D::~Animation3D() for (const auto& itor : _boneCurves) { Curve* curve = itor.second; - CC_SAFE_DELETE(curve); + AX_SAFE_DELETE(curve); } } Animation3D::Curve::Curve() : translateCurve(nullptr), rotCurve(nullptr), scaleCurve(nullptr) {} Animation3D::Curve::~Curve() { - CC_SAFE_RELEASE_NULL(translateCurve); - CC_SAFE_RELEASE_NULL(rotCurve); - CC_SAFE_RELEASE_NULL(scaleCurve); + AX_SAFE_RELEASE_NULL(translateCurve); + AX_SAFE_RELEASE_NULL(rotCurve); + AX_SAFE_RELEASE_NULL(scaleCurve); } bool Animation3D::init(const Animation3DData& data) @@ -196,7 +196,7 @@ Animation3DCache* Animation3DCache::getInstance() } void Animation3DCache::destroyInstance() { - CC_SAFE_DELETE(_cacheInstance); + AX_SAFE_DELETE(_cacheInstance); } Animation3D* Animation3DCache::getAnimation(std::string_view key) @@ -222,7 +222,7 @@ void Animation3DCache::removeAllAnimations() { for (auto itor : _animations) { - CC_SAFE_RELEASE(itor.second); + AX_SAFE_RELEASE(itor.second); } _animations.clear(); } diff --git a/core/3d/CCAnimation3D.h b/core/3d/CCAnimation3D.h index 34b8c02d1d..ae6cafa094 100644 --- a/core/3d/CCAnimation3D.h +++ b/core/3d/CCAnimation3D.h @@ -43,7 +43,7 @@ NS_AX_BEGIN /** * @brief static animation data, shared */ -class CC_DLL Animation3D : public Ref +class AX_DLL Animation3D : public Ref { friend class Bundle3D; diff --git a/core/3d/CCAnimationCurve.inl b/core/3d/CCAnimationCurve.inl index 9c2c7da90e..346e09d95b 100644 --- a/core/3d/CCAnimationCurve.inl +++ b/core/3d/CCAnimationCurve.inl @@ -117,8 +117,8 @@ AnimationCurve::AnimationCurve() template AnimationCurve::~AnimationCurve() { - CC_SAFE_DELETE_ARRAY(_keytime); - CC_SAFE_DELETE_ARRAY(_value); + AX_SAFE_DELETE_ARRAY(_keytime); + AX_SAFE_DELETE_ARRAY(_value); } template diff --git a/core/3d/CCAttachNode.h b/core/3d/CCAttachNode.h index 8077535a6e..c59cfa5bcf 100644 --- a/core/3d/CCAttachNode.h +++ b/core/3d/CCAttachNode.h @@ -43,7 +43,7 @@ class Bone3D; * auto attachNode = mesh->getAttachNode("left hand"); * attachNode->addChild(weapon); */ -class CC_DLL AttachNode : public Node +class AX_DLL AttachNode : public Node { public: /** diff --git a/core/3d/CCBillBoard.cpp b/core/3d/CCBillBoard.cpp index 91365a70f1..de8828c31d 100644 --- a/core/3d/CCBillBoard.cpp +++ b/core/3d/CCBillBoard.cpp @@ -49,7 +49,7 @@ BillBoard* BillBoard::createWithTexture(Texture2D* texture, Mode mode) billboard->autorelease(); return billboard; } - CC_SAFE_DELETE(billboard); + AX_SAFE_DELETE(billboard); return nullptr; } @@ -62,7 +62,7 @@ BillBoard* BillBoard::create(std::string_view filename, Mode mode) billboard->autorelease(); return billboard; } - CC_SAFE_DELETE(billboard); + AX_SAFE_DELETE(billboard); return nullptr; } @@ -75,7 +75,7 @@ BillBoard* BillBoard::create(std::string_view filename, const Rect& rect, Mode m billboard->autorelease(); return billboard; } - CC_SAFE_DELETE(billboard); + AX_SAFE_DELETE(billboard); return nullptr; } @@ -88,7 +88,7 @@ BillBoard* BillBoard::create(Mode mode) billboard->autorelease(); return billboard; } - CC_SAFE_DELETE(billboard); + AX_SAFE_DELETE(billboard); return nullptr; } @@ -178,7 +178,7 @@ bool BillBoard::calculateBillboardTransform() camWorldMat.transformVector(Vec3(0.0f, 0.0f, -1.0f), &camDir); break; default: - CCASSERT(false, "invalid billboard mode"); + AXASSERT(false, "invalid billboard mode"); break; } _modeDirty = false; diff --git a/core/3d/CCBillBoard.h b/core/3d/CCBillBoard.h index c0e37373c3..0d439acd2c 100644 --- a/core/3d/CCBillBoard.h +++ b/core/3d/CCBillBoard.h @@ -36,7 +36,7 @@ NS_AX_BEGIN /** * @brief Inherit from Sprite, achieve BillBoard. */ -class CC_DLL BillBoard : public Sprite +class AX_DLL BillBoard : public Sprite { public: enum class Mode @@ -118,7 +118,7 @@ protected: bool _modeDirty; private: - CC_DISALLOW_COPY_AND_ASSIGN(BillBoard); + AX_DISALLOW_COPY_AND_ASSIGN(BillBoard); }; // end of 3d group diff --git a/core/3d/CCBundle3D.cpp b/core/3d/CCBundle3D.cpp index 6ffe71093e..ab24f34ef2 100644 --- a/core/3d/CCBundle3D.cpp +++ b/core/3d/CCBundle3D.cpp @@ -161,7 +161,7 @@ void Bundle3D::clear() if (_isBinary) { _binaryBuffer.clear(); - CC_SAFE_DELETE_ARRAY(_references); + AX_SAFE_DELETE_ARRAY(_references); } else { @@ -193,7 +193,7 @@ bool Bundle3D::load(std::string_view path) } else { - CCLOG("warning: %s is invalid file formate", path.data()); + AXLOG("warning: %s is invalid file formate", path.data()); } ret ? (_path = path) : (_path = ""); @@ -329,7 +329,7 @@ bool Bundle3D::loadObj(MeshDatas& meshdatas, return true; } - CCLOG("warning: load %s file error: %s", fullPath.data(), ret.c_str()); + AXLOG("warning: load %s file error: %s", fullPath.data(), ret.c_str()); return false; } @@ -396,7 +396,7 @@ bool Bundle3D::loadMeshDatasBinary(MeshDatas& meshdatas) unsigned int meshSize = 0; if (_binaryReader.read(&meshSize, 4, 1) != 1) { - CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); + AXLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); return false; } MeshData* meshData = nullptr; @@ -406,7 +406,7 @@ bool Bundle3D::loadMeshDatasBinary(MeshDatas& meshdatas) // read mesh data if (_binaryReader.read(&attribSize, 4, 1) != 1 || attribSize < 1) { - CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); + AXLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); goto FAILED; } meshData = new MeshData(); @@ -418,7 +418,7 @@ bool Bundle3D::loadMeshDatasBinary(MeshDatas& meshdatas) unsigned int vSize; if (_binaryReader.read(&vSize, 4, 1) != 1) { - CCLOG("warning: Failed to read meshdata: usage or size '%s'.", _path.c_str()); + AXLOG("warning: Failed to read meshdata: usage or size '%s'.", _path.c_str()); goto FAILED; } std::string type = _binaryReader.readString(); @@ -430,14 +430,14 @@ bool Bundle3D::loadMeshDatasBinary(MeshDatas& meshdatas) // Read vertex data if (_binaryReader.read(&vertexSizeInFloat, 4, 1) != 1 || vertexSizeInFloat == 0) { - CCLOG("warning: Failed to read meshdata: vertexSizeInFloat '%s'.", _path.c_str()); + AXLOG("warning: Failed to read meshdata: vertexSizeInFloat '%s'.", _path.c_str()); goto FAILED; } meshData->vertex.resize(vertexSizeInFloat); if (_binaryReader.read(&meshData->vertex[0], 4, vertexSizeInFloat) != vertexSizeInFloat) { - CCLOG("warning: Failed to read meshdata: vertex element '%s'.", _path.c_str()); + AXLOG("warning: Failed to read meshdata: vertex element '%s'.", _path.c_str()); goto FAILED; } @@ -453,13 +453,13 @@ bool Bundle3D::loadMeshDatasBinary(MeshDatas& meshdatas) unsigned int nIndexCount; if (_binaryReader.read(&nIndexCount, 4, 1) != 1) { - CCLOG("warning: Failed to read meshdata: nIndexCount '%s'.", _path.c_str()); + AXLOG("warning: Failed to read meshdata: nIndexCount '%s'.", _path.c_str()); goto FAILED; } indexArray.resize(nIndexCount); if (_binaryReader.read(indexArray.data(), 2, nIndexCount) != nIndexCount) { - CCLOG("warning: Failed to read meshdata: indices '%s'.", _path.c_str()); + AXLOG("warning: Failed to read meshdata: indices '%s'.", _path.c_str()); goto FAILED; } auto& storedIndices = meshData->subMeshIndices.emplace_back(std::move(indexArray)); @@ -472,7 +472,7 @@ bool Bundle3D::loadMeshDatasBinary(MeshDatas& meshdatas) float aabb[6]; if (_binaryReader.read(aabb, 4, 6) != 6) { - CCLOG("warning: Failed to read meshdata: aabb '%s'.", _path.c_str()); + AXLOG("warning: Failed to read meshdata: aabb '%s'.", _path.c_str()); goto FAILED; } meshData->subMeshAABB.push_back(AABB(Vec3(aabb[0], aabb[1], aabb[2]), Vec3(aabb[3], aabb[4], aabb[5]))); @@ -489,7 +489,7 @@ bool Bundle3D::loadMeshDatasBinary(MeshDatas& meshdatas) FAILED: { - CC_SAFE_DELETE(meshData); + AX_SAFE_DELETE(meshData); for (auto& meshdata : meshdatas.meshDatas) { delete meshdata; @@ -511,8 +511,8 @@ bool Bundle3D::loadMeshDatasBinary_0_1(MeshDatas& meshdatas) unsigned int attribSize = 0; if (_binaryReader.read(&attribSize, 4, 1) != 1 || attribSize < 1) { - CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); - CC_SAFE_DELETE(meshdata); + AXLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); + AX_SAFE_DELETE(meshdata); return false; } enum @@ -535,8 +535,8 @@ bool Bundle3D::loadMeshDatasBinary_0_1(MeshDatas& meshdatas) shaderinfos::VertexKey usage; if (_binaryReader.read(&vUsage, 4, 1) != 1 || _binaryReader.read(&vSize, 4, 1) != 1) { - CCLOG("warning: Failed to read meshdata: usage or size '%s'.", _path.c_str()); - CC_SAFE_DELETE(meshdata); + AXLOG("warning: Failed to read meshdata: usage or size '%s'.", _path.c_str()); + AX_SAFE_DELETE(meshdata); return false; } @@ -564,7 +564,7 @@ bool Bundle3D::loadMeshDatasBinary_0_1(MeshDatas& meshdatas) } else { - CCASSERT(false, "invalidate usage value"); + AXASSERT(false, "invalidate usage value"); } meshVertexAttribute.vertexAttrib = usage; @@ -574,16 +574,16 @@ bool Bundle3D::loadMeshDatasBinary_0_1(MeshDatas& meshdatas) // Read vertex data if (_binaryReader.read(&meshdata->vertexSizeInFloat, 4, 1) != 1 || meshdata->vertexSizeInFloat == 0) { - CCLOG("warning: Failed to read meshdata: vertexSizeInFloat '%s'.", _path.c_str()); - CC_SAFE_DELETE(meshdata); + AXLOG("warning: Failed to read meshdata: vertexSizeInFloat '%s'.", _path.c_str()); + AX_SAFE_DELETE(meshdata); return false; } meshdata->vertex.resize(meshdata->vertexSizeInFloat); if (_binaryReader.read(&meshdata->vertex[0], 4, meshdata->vertexSizeInFloat) != meshdata->vertexSizeInFloat) { - CCLOG("warning: Failed to read meshdata: vertex element '%s'.", _path.c_str()); - CC_SAFE_DELETE(meshdata); + AXLOG("warning: Failed to read meshdata: vertex element '%s'.", _path.c_str()); + AX_SAFE_DELETE(meshdata); return false; } @@ -594,8 +594,8 @@ bool Bundle3D::loadMeshDatasBinary_0_1(MeshDatas& meshdatas) unsigned int nIndexCount; if (_binaryReader.read(&nIndexCount, 4, 1) != 1) { - CCLOG("warning: Failed to read meshdata: nIndexCount '%s'.", _path.c_str()); - CC_SAFE_DELETE(meshdata); + AXLOG("warning: Failed to read meshdata: nIndexCount '%s'.", _path.c_str()); + AX_SAFE_DELETE(meshdata); return false; } @@ -603,8 +603,8 @@ bool Bundle3D::loadMeshDatasBinary_0_1(MeshDatas& meshdatas) indices.resize(nIndexCount); if (_binaryReader.read(indices.data(), 2, nIndexCount) != nIndexCount) { - CCLOG("warning: Failed to read meshdata: indices '%s'.", _path.c_str()); - CC_SAFE_DELETE(meshdata); + AXLOG("warning: Failed to read meshdata: indices '%s'.", _path.c_str()); + AX_SAFE_DELETE(meshdata); return false; } @@ -629,8 +629,8 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas) unsigned int attribSize = 0; if (_binaryReader.read(&attribSize, 4, 1) != 1 || attribSize < 1) { - CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); - CC_SAFE_DELETE(meshdata); + AXLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); + AX_SAFE_DELETE(meshdata); return false; } enum @@ -653,8 +653,8 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas) shaderinfos::VertexKey usage = shaderinfos::VertexKey::VERTEX_ATTRIB_ERROR; if (_binaryReader.read(&vUsage, 4, 1) != 1 || _binaryReader.read(&vSize, 4, 1) != 1) { - CCLOG("warning: Failed to read meshdata: usage or size '%s'.", _path.c_str()); - CC_SAFE_DELETE(meshdata); + AXLOG("warning: Failed to read meshdata: usage or size '%s'.", _path.c_str()); + AX_SAFE_DELETE(meshdata); return false; } @@ -688,16 +688,16 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas) // Read vertex data if (_binaryReader.read(&meshdata->vertexSizeInFloat, 4, 1) != 1 || meshdata->vertexSizeInFloat == 0) { - CCLOG("warning: Failed to read meshdata: vertexSizeInFloat '%s'.", _path.c_str()); - CC_SAFE_DELETE(meshdata); + AXLOG("warning: Failed to read meshdata: vertexSizeInFloat '%s'.", _path.c_str()); + AX_SAFE_DELETE(meshdata); return false; } meshdata->vertex.resize(meshdata->vertexSizeInFloat); if (_binaryReader.read(&meshdata->vertex[0], 4, meshdata->vertexSizeInFloat) != meshdata->vertexSizeInFloat) { - CCLOG("warning: Failed to read meshdata: vertex element '%s'.", _path.c_str()); - CC_SAFE_DELETE(meshdata); + AXLOG("warning: Failed to read meshdata: vertex element '%s'.", _path.c_str()); + AX_SAFE_DELETE(meshdata); return false; } @@ -705,8 +705,8 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas) unsigned int submeshCount; if (_binaryReader.read(&submeshCount, 4, 1) != 1) { - CCLOG("warning: Failed to read meshdata: submeshCount '%s'.", _path.c_str()); - CC_SAFE_DELETE(meshdata); + AXLOG("warning: Failed to read meshdata: submeshCount '%s'.", _path.c_str()); + AX_SAFE_DELETE(meshdata); return false; } @@ -715,8 +715,8 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas) unsigned int nIndexCount; if (_binaryReader.read(&nIndexCount, 4, 1) != 1) { - CCLOG("warning: Failed to read meshdata: nIndexCount '%s'.", _path.c_str()); - CC_SAFE_DELETE(meshdata); + AXLOG("warning: Failed to read meshdata: nIndexCount '%s'.", _path.c_str()); + AX_SAFE_DELETE(meshdata); return false; } @@ -724,8 +724,8 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas) indices.resize(nIndexCount); if (_binaryReader.read(indices.data(), 2, nIndexCount) != nIndexCount) { - CCLOG("warning: Failed to read meshdata: indices '%s'.", _path.c_str()); - CC_SAFE_DELETE(meshdata); + AXLOG("warning: Failed to read meshdata: indices '%s'.", _path.c_str()); + AX_SAFE_DELETE(meshdata); return false; } @@ -943,13 +943,13 @@ bool Bundle3D::loadMaterialsBinary(MaterialDatas& materialdatas) textureData.id = _binaryReader.readString(); if (textureData.id.empty()) { - CCLOG("warning: Failed to read Materialdata: texturePath is empty '%s'.", textureData.id.c_str()); + AXLOG("warning: Failed to read Materialdata: texturePath is empty '%s'.", textureData.id.c_str()); return false; } std::string texturePath = _binaryReader.readString(); if (texturePath.empty()) { - CCLOG("warning: Failed to read Materialdata: texturePath is empty '%s'.", _path.c_str()); + AXLOG("warning: Failed to read Materialdata: texturePath is empty '%s'.", _path.c_str()); return false; } @@ -975,7 +975,7 @@ bool Bundle3D::loadMaterialsBinary_0_1(MaterialDatas& materialdatas) std::string texturePath = _binaryReader.readString(); if (texturePath.empty()) { - CCLOG("warning: Failed to read Materialdata: texturePath is empty '%s'.", _path.c_str()); + AXLOG("warning: Failed to read Materialdata: texturePath is empty '%s'.", _path.c_str()); return false; } @@ -1003,7 +1003,7 @@ bool Bundle3D::loadMaterialsBinary_0_2(MaterialDatas& materialdatas) std::string texturePath = _binaryReader.readString(); if (texturePath.empty()) { - CCLOG("warning: Failed to read Materialdata: texturePath is empty '%s'.", _path.c_str()); + AXLOG("warning: Failed to read Materialdata: texturePath is empty '%s'.", _path.c_str()); return true; } @@ -1070,7 +1070,7 @@ bool Bundle3D::loadJson(std::string_view path) if (_jsonReader.ParseInsitu<0>((char*)_jsonBuffer.c_str()).HasParseError()) { clear(); - CCLOG("Parse json failed in Bundle3D::loadJson function"); + AXLOG("Parse json failed in Bundle3D::loadJson function"); return false; } @@ -1093,7 +1093,7 @@ bool Bundle3D::loadBinary(std::string_view path) if (_binaryBuffer.isNull()) { clear(); - CCLOG("warning: Failed to read file: %s", path.data()); + AXLOG("warning: Failed to read file: %s", path.data()); return false; } @@ -1106,7 +1106,7 @@ bool Bundle3D::loadBinary(std::string_view path) if (_binaryReader.read(sig, 1, 4) != 4 || memcmp(sig, identifier, 4) != 0) { clear(); - CCLOG("warning: Invalid identifier: %s", path.data()); + AXLOG("warning: Invalid identifier: %s", path.data()); return false; } @@ -1114,7 +1114,7 @@ bool Bundle3D::loadBinary(std::string_view path) unsigned char ver[2]; if (_binaryReader.read(ver, 1, 2) != 2) { - CCLOG("warning: Failed to read version:"); + AXLOG("warning: Failed to read version:"); return false; } @@ -1126,12 +1126,12 @@ bool Bundle3D::loadBinary(std::string_view path) if (_binaryReader.read(&_referenceCount, 4, 1) != 1) { clear(); - CCLOG("warning: Failed to read ref table size '%s'.", path.data()); + AXLOG("warning: Failed to read ref table size '%s'.", path.data()); return false; } // Read all refs - CC_SAFE_DELETE_ARRAY(_references); + AX_SAFE_DELETE_ARRAY(_references); _references = new Reference[_referenceCount]; for (unsigned int i = 0; i < _referenceCount; ++i) { @@ -1140,8 +1140,8 @@ bool Bundle3D::loadBinary(std::string_view path) _binaryReader.read(&_references[i].offset, 4, 1) != 1) { clear(); - CCLOG("warning: Failed to read ref number %u for bundle '%s'.", i, path.data()); - CC_SAFE_DELETE_ARRAY(_references); + AXLOG("warning: Failed to read ref number %u for bundle '%s'.", i, path.data()); + AX_SAFE_DELETE_ARRAY(_references); return false; } } @@ -1259,7 +1259,7 @@ bool Bundle3D::loadSkinDataJson(SkinData* skindata) const rapidjson::Value& skin_data_array = _jsonReader[SKIN]; - CCASSERT(skin_data_array.IsArray(), "skin data is not an array"); + AXASSERT(skin_data_array.IsArray(), "skin data is not an array"); const rapidjson::Value& skin_data_array_val_0 = skin_data_array[(rapidjson::SizeType)0]; if (!skin_data_array_val_0.HasMember(BONES)) @@ -1301,7 +1301,7 @@ bool Bundle3D::loadSkinDataBinary(SkinData* skindata) float bindShape[16]; if (!_binaryReader.readMatrix(bindShape)) { - CCLOG("warning: Failed to read SkinData: bindShape matrix '%s'.", _path.c_str()); + AXLOG("warning: Failed to read SkinData: bindShape matrix '%s'.", _path.c_str()); return false; } @@ -1309,7 +1309,7 @@ bool Bundle3D::loadSkinDataBinary(SkinData* skindata) unsigned int boneNum; if (!_binaryReader.read(&boneNum)) { - CCLOG("warning: Failed to read SkinData: boneNum '%s'.", _path.c_str()); + AXLOG("warning: Failed to read SkinData: boneNum '%s'.", _path.c_str()); return false; } @@ -1325,7 +1325,7 @@ bool Bundle3D::loadSkinDataBinary(SkinData* skindata) skindata->skinBoneNames.push_back(skinBoneName); if (!_binaryReader.readMatrix(bindpos)) { - CCLOG("warning: Failed to load SkinData: bindpos '%s'.", _path.c_str()); + AXLOG("warning: Failed to load SkinData: bindpos '%s'.", _path.c_str()); return false; } skindata->inverseBindPoseMatrices.push_back(bindpos); @@ -1365,7 +1365,7 @@ bool Bundle3D::loadSkinDataBinary(SkinData* skindata) if (!_binaryReader.readMatrix(transform)) { - CCLOG("warning: Failed to load SkinData: transform '%s'.", _path.c_str()); + AXLOG("warning: Failed to load SkinData: transform '%s'.", _path.c_str()); return false; } @@ -1572,7 +1572,7 @@ bool Bundle3D::loadAnimationDataBinary(std::string_view id, Animation3DData* ani { if (!_binaryReader.read(&animNum)) { - CCLOG("warning: Failed to read AnimationData: animNum '%s'.", _path.c_str()); + AXLOG("warning: Failed to read AnimationData: animNum '%s'.", _path.c_str()); return false; } } @@ -1585,14 +1585,14 @@ bool Bundle3D::loadAnimationDataBinary(std::string_view id, Animation3DData* ani if (!_binaryReader.read(&animationdata->_totalTime)) { - CCLOG("warning: Failed to read AnimationData: totalTime '%s'.", _path.c_str()); + AXLOG("warning: Failed to read AnimationData: totalTime '%s'.", _path.c_str()); return false; } unsigned int nodeAnimationNum; if (!_binaryReader.read(&nodeAnimationNum)) { - CCLOG("warning: Failed to read AnimationData: animNum '%s'.", _path.c_str()); + AXLOG("warning: Failed to read AnimationData: animNum '%s'.", _path.c_str()); return false; } for (unsigned int i = 0; i < nodeAnimationNum; ++i) @@ -1601,7 +1601,7 @@ bool Bundle3D::loadAnimationDataBinary(std::string_view id, Animation3DData* ani unsigned int keyframeNum; if (!_binaryReader.read(&keyframeNum)) { - CCLOG("warning: Failed to read AnimationData: keyframeNum '%s'.", _path.c_str()); + AXLOG("warning: Failed to read AnimationData: keyframeNum '%s'.", _path.c_str()); return false; } @@ -1614,7 +1614,7 @@ bool Bundle3D::loadAnimationDataBinary(std::string_view id, Animation3DData* ani float keytime; if (!_binaryReader.read(&keytime)) { - CCLOG("warning: Failed to read AnimationData: keytime '%s'.", _path.c_str()); + AXLOG("warning: Failed to read AnimationData: keytime '%s'.", _path.c_str()); return false; } @@ -1624,7 +1624,7 @@ bool Bundle3D::loadAnimationDataBinary(std::string_view id, Animation3DData* ani { if (!_binaryReader.read(&transformFlag)) { - CCLOG("warning: Failed to read AnimationData: transformFlag '%s'.", _path.c_str()); + AXLOG("warning: Failed to read AnimationData: transformFlag '%s'.", _path.c_str()); return false; } } @@ -1639,7 +1639,7 @@ bool Bundle3D::loadAnimationDataBinary(std::string_view id, Animation3DData* ani Quaternion rotate; if (_binaryReader.read(&rotate, 4, 4) != 4) { - CCLOG("warning: Failed to read AnimationData: rotate '%s'.", _path.c_str()); + AXLOG("warning: Failed to read AnimationData: rotate '%s'.", _path.c_str()); return false; } animationdata->_rotationKeys[boneName].push_back(Animation3DData::QuatKey(keytime, rotate)); @@ -1655,7 +1655,7 @@ bool Bundle3D::loadAnimationDataBinary(std::string_view id, Animation3DData* ani Vec3 scale; if (_binaryReader.read(&scale, 4, 3) != 3) { - CCLOG("warning: Failed to read AnimationData: scale '%s'.", _path.c_str()); + AXLOG("warning: Failed to read AnimationData: scale '%s'.", _path.c_str()); return false; } animationdata->_scaleKeys[boneName].push_back(Animation3DData::Vec3Key(keytime, scale)); @@ -1671,7 +1671,7 @@ bool Bundle3D::loadAnimationDataBinary(std::string_view id, Animation3DData* ani Vec3 position; if (_binaryReader.read(&position, 4, 3) != 3) { - CCLOG("warning: Failed to read AnimationData: position '%s'.", _path.c_str()); + AXLOG("warning: Failed to read AnimationData: position '%s'.", _path.c_str()); return false; } animationdata->_translationKeys[boneName].push_back(Animation3DData::Vec3Key(keytime, position)); @@ -1748,9 +1748,9 @@ NodeData* Bundle3D::parseNodesRecursivelyJson(const rapidjson::Value& jvalue, bo if (modelnodedata->subMeshId == "" || modelnodedata->materialId == "") { - CCLOG("warning: Node %s part is missing meshPartId or materialId", nodedata->id.c_str()); - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AXLOG("warning: Node %s part is missing meshPartId or materialId", nodedata->id.c_str()); + AX_SAFE_DELETE(modelnodedata); + AX_SAFE_DELETE(nodedata); return nullptr; } @@ -1765,9 +1765,9 @@ NodeData* Bundle3D::parseNodesRecursivelyJson(const rapidjson::Value& jvalue, bo // node if (!bone.HasMember(NODE)) { - CCLOG("warning: Bone node ID missing"); - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AXLOG("warning: Bone node ID missing"); + AX_SAFE_DELETE(modelnodedata); + AX_SAFE_DELETE(nodedata); return nullptr; } @@ -1832,7 +1832,7 @@ bool Bundle3D::loadNodesBinary(NodeDatas& nodedatas) unsigned int nodeSize = 0; if (_binaryReader.read(&nodeSize, 4, 1) != 1) { - CCLOG("warning: Failed to read nodes"); + AXLOG("warning: Failed to read nodes"); return false; } @@ -1857,7 +1857,7 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit bool skeleton_; if (_binaryReader.read(&skeleton_, 1, 1) != 1) { - CCLOG("warning: Failed to read is skeleton"); + AXLOG("warning: Failed to read is skeleton"); return nullptr; } if (skeleton_) @@ -1867,14 +1867,14 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit Mat4 transform; if (!_binaryReader.readMatrix(transform.m)) { - CCLOG("warning: Failed to read transform matrix"); + AXLOG("warning: Failed to read transform matrix"); return nullptr; } // parts unsigned int partsSize = 0; if (_binaryReader.read(&partsSize, 4, 1) != 1) { - CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); + AXLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); return nullptr; } @@ -1893,9 +1893,9 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit if (modelnodedata->subMeshId.empty() || modelnodedata->materialId.empty()) { - CCLOG("Node %s part is missing meshPartId or materialId", nodedata->id.c_str()); - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AXLOG("Node %s part is missing meshPartId or materialId", nodedata->id.c_str()); + AX_SAFE_DELETE(modelnodedata); + AX_SAFE_DELETE(nodedata); return nullptr; } @@ -1903,9 +1903,9 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit unsigned int bonesSize = 0; if (_binaryReader.read(&bonesSize, 4, 1) != 1) { - CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AXLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); + AX_SAFE_DELETE(modelnodedata); + AX_SAFE_DELETE(nodedata); return nullptr; } @@ -1919,8 +1919,8 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit Mat4 invbindpos; if (!_binaryReader.readMatrix(invbindpos.m)) { - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AX_SAFE_DELETE(modelnodedata); + AX_SAFE_DELETE(nodedata); return nullptr; } @@ -1931,9 +1931,9 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit unsigned int uvMapping = 0; if (_binaryReader.read(&uvMapping, 4, 1) != 1) { - CCLOG("warning: Failed to read nodedata: uvMapping '%s'.", _path.c_str()); - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AXLOG("warning: Failed to read nodedata: uvMapping '%s'.", _path.c_str()); + AX_SAFE_DELETE(modelnodedata); + AX_SAFE_DELETE(nodedata); return nullptr; } for (unsigned int j = 0; j < uvMapping; ++j) @@ -1941,9 +1941,9 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit unsigned int textureIndexSize = 0; if (_binaryReader.read(&textureIndexSize, 4, 1) != 1) { - CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AXLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); + AX_SAFE_DELETE(modelnodedata); + AX_SAFE_DELETE(nodedata); return nullptr; } for (unsigned int k = 0; k < textureIndexSize; ++k) @@ -1951,8 +1951,8 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit unsigned int index = 0; if (_binaryReader.read(&index, 4, 1) != 1) { - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AX_SAFE_DELETE(modelnodedata); + AX_SAFE_DELETE(nodedata); return nullptr; } } @@ -1982,8 +1982,8 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit unsigned int childrenSize = 0; if (_binaryReader.read(&childrenSize, 4, 1) != 1) { - CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); - CC_SAFE_DELETE(nodedata); + AXLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); + AX_SAFE_DELETE(nodedata); return nullptr; } if (childrenSize > 0) @@ -2007,7 +2007,7 @@ backend::VertexFormat Bundle3D::parseGLDataType(std::string_view str, int size) case 4: return backend::VertexFormat::UBYTE4; default: - CCLOGERROR("parseVertexType GL_BYTE x %d error", size); + AXLOGERROR("parseVertexType GL_BYTE x %d error", size); } } else if (str == "GL_UNSIGNED_BYTE") @@ -2017,7 +2017,7 @@ backend::VertexFormat Bundle3D::parseGLDataType(std::string_view str, int size) case 4: return backend::VertexFormat::UBYTE4; default: - CCLOGERROR("parseVertexType GL_UNSIGNED_BYTE x %d error", size); + AXLOGERROR("parseVertexType GL_UNSIGNED_BYTE x %d error", size); } } else if (str == "GL_SHORT") @@ -2029,7 +2029,7 @@ backend::VertexFormat Bundle3D::parseGLDataType(std::string_view str, int size) case 4: return backend::VertexFormat::USHORT4; default: - CCLOGERROR("parseVertexType GL_SHORT x %d error", size); + AXLOGERROR("parseVertexType GL_SHORT x %d error", size); } } else if (str == "GL_UNSIGNED_SHORT") @@ -2041,7 +2041,7 @@ backend::VertexFormat Bundle3D::parseGLDataType(std::string_view str, int size) case 4: return backend::VertexFormat::USHORT4; default: - CCLOGERROR("parseVertexType GL_UNSIGNED_SHORT x %d error", size); + AXLOGERROR("parseVertexType GL_UNSIGNED_SHORT x %d error", size); } } else if (str == "GL_INT") @@ -2057,7 +2057,7 @@ backend::VertexFormat Bundle3D::parseGLDataType(std::string_view str, int size) case 4: return backend::VertexFormat::INT4; default: - CCLOGERROR("parseVertexType GL_INT x %d error", size); + AXLOGERROR("parseVertexType GL_INT x %d error", size); } } else if (str == "GL_UNSIGNED_INT") @@ -2073,7 +2073,7 @@ backend::VertexFormat Bundle3D::parseGLDataType(std::string_view str, int size) case 4: return backend::VertexFormat::INT4; default: - CCLOGERROR("parseVertexType GL_UNSIGNED_INT x %d error", size); + AXLOGERROR("parseVertexType GL_UNSIGNED_INT x %d error", size); } } else if (str == "GL_FLOAT") @@ -2089,10 +2089,10 @@ backend::VertexFormat Bundle3D::parseGLDataType(std::string_view str, int size) case 4: return backend::VertexFormat::FLOAT4; default: - CCLOGERROR("parseVertexType GL_UNSIGNED_INT x %d error", size); + AXLOGERROR("parseVertexType GL_UNSIGNED_INT x %d error", size); } } - CCASSERT(false, "parseVertexType failed!"); + AXASSERT(false, "parseVertexType failed!"); return ret; } @@ -2109,7 +2109,7 @@ backend::SamplerAddressMode Bundle3D::parseSamplerAddressMode(std::string_view s } else { - CCASSERT(false, "Invalid GL type"); + AXASSERT(false, "Invalid GL type"); return backend::SamplerAddressMode::REPEAT; } } @@ -2158,7 +2158,7 @@ NTextureData::Usage Bundle3D::parseGLTextureType(std::string_view str) } else { - CCASSERT(false, "Wrong Texture type"); + AXASSERT(false, "Wrong Texture type"); return NTextureData::Usage::Unknown; } } @@ -2227,7 +2227,7 @@ shaderinfos::VertexKey Bundle3D::parseGLProgramAttribute(std::string_view str) } else { - CCASSERT(false, "Wrong Attribute type"); + AXASSERT(false, "Wrong Attribute type"); return shaderinfos::VertexKey::VERTEX_ATTRIB_ERROR; } } @@ -2256,7 +2256,7 @@ Reference* Bundle3D::seekToFirstType(unsigned int type, std::string_view id) // Found a match if (_binaryReader.seek(ref->offset, SEEK_SET) == false) { - CCLOG("warning: Failed to seek to object '%s' in bundle '%s'.", ref->id.c_str(), _path.c_str()); + AXLOG("warning: Failed to seek to object '%s' in bundle '%s'.", ref->id.c_str(), _path.c_str()); return nullptr; } return ref; diff --git a/core/3d/CCBundle3D.h b/core/3d/CCBundle3D.h index e76bb039a5..b375ea2565 100644 --- a/core/3d/CCBundle3D.h +++ b/core/3d/CCBundle3D.h @@ -49,7 +49,7 @@ class Animation3D; * @js NA * @lua NA */ -class CC_DLL Bundle3D +class AX_DLL Bundle3D { public: /** diff --git a/core/3d/CCBundle3DData.cpp b/core/3d/CCBundle3DData.cpp index e181389e1e..6fdc93ff7d 100644 --- a/core/3d/CCBundle3DData.cpp +++ b/core/3d/CCBundle3DData.cpp @@ -23,7 +23,7 @@ int MeshVertexAttrib::getAttribSizeBytes() const case backend::VertexFormat::USHORT2: return 4; default: - CCASSERT(false, "VertexFormat convert to size error"); + AXASSERT(false, "VertexFormat convert to size error"); } return ret; } diff --git a/core/3d/CCBundle3DData.h b/core/3d/CCBundle3DData.h index a0e9480ca3..d7b5996ec0 100644 --- a/core/3d/CCBundle3DData.h +++ b/core/3d/CCBundle3DData.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_BUNDLE_3D_DATA_H__ -#define __CC_BUNDLE_3D_DATA_H__ +#ifndef __AX_BUNDLE_3D_DATA_H__ +#define __AX_BUNDLE_3D_DATA_H__ #include "base/CCRef.h" #include "base/ccTypes.h" @@ -229,7 +229,7 @@ protected: * @js NA * @lua NA */ -struct CC_DLL MeshVertexAttrib +struct AX_DLL MeshVertexAttrib { backend::VertexFormat type; shaderinfos::VertexKey vertexAttrib; @@ -583,4 +583,4 @@ struct Reference NS_AX_END -#endif //__CC_BUNDLE_3D_DATA_H__ +#endif //__AX_BUNDLE_3D_DATA_H__ diff --git a/core/3d/CCBundleReader.cpp b/core/3d/CCBundleReader.cpp index 066b55f7e3..8d5d9c2a1e 100644 --- a/core/3d/CCBundleReader.cpp +++ b/core/3d/CCBundleReader.cpp @@ -50,7 +50,7 @@ ssize_t BundleReader::read(void* ptr, ssize_t size, ssize_t count) { if (!_buffer || eof()) { - CCLOG("warning: bundle reader out of range"); + AXLOG("warning: bundle reader out of range"); return 0; } @@ -72,7 +72,7 @@ ssize_t BundleReader::read(void* ptr, ssize_t size, ssize_t count) _position += readLength; validCount += 1; } - CCLOG("warning: bundle reader out of range"); + AXLOG("warning: bundle reader out of range"); } else { diff --git a/core/3d/CCBundleReader.h b/core/3d/CCBundleReader.h index c4ecc117fe..cc3e458614 100644 --- a/core/3d/CCBundleReader.h +++ b/core/3d/CCBundleReader.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_BUNDLE_READER_H__ -#define __CC_BUNDLE_READER_H__ +#ifndef __AX_BUNDLE_READER_H__ +#define __AX_BUNDLE_READER_H__ #include #include @@ -188,7 +188,7 @@ inline bool BundleReader::read(char* ptr) template <> inline bool BundleReader::read(std::string* /*ptr*/) { - CCLOG("can not read std::string, use readString() instead"); + AXLOG("can not read std::string, use readString() instead"); return false; } diff --git a/core/3d/CCFrustum.h b/core/3d/CCFrustum.h index e5d6ba1ed7..1f0a092cf6 100644 --- a/core/3d/CCFrustum.h +++ b/core/3d/CCFrustum.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_FRUSTUM_H_ -#define __CC_FRUSTUM_H_ +#ifndef __AX_FRUSTUM_H_ +#define __AX_FRUSTUM_H_ #include "base/ccMacros.h" #include "math/CCMath.h" @@ -42,7 +42,7 @@ class Camera; * @js NA * @lua NA */ -class CC_DLL Frustum +class AX_DLL Frustum { friend class Camera; @@ -86,4 +86,4 @@ protected: NS_AX_END -#endif //__CC_FRUSTUM_H_ +#endif //__AX_FRUSTUM_H_ diff --git a/core/3d/CCMesh.cpp b/core/3d/CCMesh.cpp index 65fb72976e..7750752e5b 100644 --- a/core/3d/CCMesh.cpp +++ b/core/3d/CCMesh.cpp @@ -124,11 +124,11 @@ Mesh::~Mesh() { for (auto& tex : _textures) { - CC_SAFE_RELEASE(tex.second); + AX_SAFE_RELEASE(tex.second); } - CC_SAFE_RELEASE(_skin); - CC_SAFE_RELEASE(_meshIndexData); - CC_SAFE_RELEASE(_material); + AX_SAFE_RELEASE(_skin); + AX_SAFE_RELEASE(_meshIndexData); + AX_SAFE_RELEASE(_material); } backend::Buffer* Mesh::getVertexBuffer() const @@ -279,8 +279,8 @@ void Mesh::setTexture(Texture2D* tex, NTextureData::Usage usage, bool cacheFileN if (tex == nullptr) tex = getDummyTexture(); - CC_SAFE_RETAIN(tex); - CC_SAFE_RELEASE(_textures[usage]); + AX_SAFE_RETAIN(tex); + AX_SAFE_RELEASE(_textures[usage]); _textures[usage] = tex; if (usage == NTextureData::Usage::Diffuse) @@ -331,9 +331,9 @@ void Mesh::setMaterial(Material* material) { if (_material != material) { - CC_SAFE_RELEASE(_material); + AX_SAFE_RELEASE(_material); _material = material; - CC_SAFE_RETAIN(_material); + AX_SAFE_RETAIN(_material); } _meshCommands.clear(); @@ -349,7 +349,7 @@ void Mesh::setMaterial(Material* material) int i = 0; for (auto pass : technique->getPasses()) { -#ifdef COCOS2D_DEBUG +#ifdef AXIS_DEBUG // make it crashed when missing attribute data if (_material->getTechnique()->getName().compare(technique->getName()) == 0) { @@ -357,7 +357,7 @@ void Mesh::setMaterial(Material* material) auto attributes = program->getActiveAttributes(); auto meshVertexData = _meshIndexData->getMeshVertexData(); auto attributeCount = meshVertexData->getMeshVertexAttribCount(); - CCASSERT(attributes.size() <= attributeCount, "missing attribute data"); + AXASSERT(attributes.size() <= attributeCount, "missing attribute data"); } #endif // TODO @@ -450,8 +450,8 @@ void Mesh::setSkin(MeshSkin* skin) { if (_skin != skin) { - CC_SAFE_RETAIN(skin); - CC_SAFE_RELEASE(_skin); + AX_SAFE_RETAIN(skin); + AX_SAFE_RELEASE(_skin); _skin = skin; calculateAABB(); } @@ -461,8 +461,8 @@ void Mesh::setMeshIndexData(MeshIndexData* subMesh) { if (_meshIndexData != subMesh) { - CC_SAFE_RETAIN(subMesh); - CC_SAFE_RELEASE(_meshIndexData); + AX_SAFE_RETAIN(subMesh); + AX_SAFE_RELEASE(_meshIndexData); _meshIndexData = subMesh; calculateAABB(); bindMeshCommand(); @@ -534,8 +534,8 @@ void Mesh::bindMeshCommand() void Mesh::setLightUniforms(Pass* pass, Scene* scene, const Vec4& color, unsigned int lightmask) { - CCASSERT(pass, "Invalid Pass"); - CCASSERT(scene, "Invalid scene"); + AXASSERT(pass, "Invalid Pass"); + AXASSERT(scene, "Invalid scene"); const auto& conf = Configuration::getInstance(); int maxDirLight = conf->getMaxSupportDirLightInShader(); diff --git a/core/3d/CCMesh.h b/core/3d/CCMesh.h index d4da0068e4..f412ff0e92 100644 --- a/core/3d/CCMesh.h +++ b/core/3d/CCMesh.h @@ -59,7 +59,7 @@ class Buffer; /** * @brief Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on */ -class CC_DLL Mesh : public Ref +class AX_DLL Mesh : public Ref { friend class MeshRenderer; @@ -293,7 +293,7 @@ protected: /// @} /// @cond -extern std::string CC_DLL s_uniformSamplerName[]; // uniform sampler names array +extern std::string AX_DLL s_uniformSamplerName[]; // uniform sampler names array /// @endcond NS_AX_END diff --git a/core/3d/CCMeshMaterial.cpp b/core/3d/CCMeshMaterial.cpp index 088052ba4b..ad6b174d60 100644 --- a/core/3d/CCMeshMaterial.cpp +++ b/core/3d/CCMeshMaterial.cpp @@ -155,30 +155,30 @@ void MeshMaterial::createBuiltInMaterial() void MeshMaterial::releaseBuiltInMaterial() { - CC_SAFE_RELEASE_NULL(_unLitMaterial); - CC_SAFE_RELEASE_NULL(_unLitMaterialSkin); + AX_SAFE_RELEASE_NULL(_unLitMaterial); + AX_SAFE_RELEASE_NULL(_unLitMaterialSkin); - CC_SAFE_RELEASE_NULL(_unLitNoTexMaterial); - CC_SAFE_RELEASE_NULL(_vertexLitMaterial); - CC_SAFE_RELEASE_NULL(_diffuseMaterial); - CC_SAFE_RELEASE_NULL(_diffuseNoTexMaterial); - CC_SAFE_RELEASE_NULL(_bumpedDiffuseMaterial); + AX_SAFE_RELEASE_NULL(_unLitNoTexMaterial); + AX_SAFE_RELEASE_NULL(_vertexLitMaterial); + AX_SAFE_RELEASE_NULL(_diffuseMaterial); + AX_SAFE_RELEASE_NULL(_diffuseNoTexMaterial); + AX_SAFE_RELEASE_NULL(_bumpedDiffuseMaterial); - CC_SAFE_RELEASE_NULL(_vertexLitMaterialSkin); - CC_SAFE_RELEASE_NULL(_diffuseMaterialSkin); - CC_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialSkin); + AX_SAFE_RELEASE_NULL(_vertexLitMaterialSkin); + AX_SAFE_RELEASE_NULL(_diffuseMaterialSkin); + AX_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialSkin); // release program states - CC_SAFE_RELEASE_NULL(_unLitMaterialProgState); - CC_SAFE_RELEASE_NULL(_unLitNoTexMaterialProgState); - CC_SAFE_RELEASE_NULL(_vertexLitMaterialProgState); - CC_SAFE_RELEASE_NULL(_diffuseMaterialProgState); - CC_SAFE_RELEASE_NULL(_diffuseNoTexMaterialProgState); - CC_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialProgState); + AX_SAFE_RELEASE_NULL(_unLitMaterialProgState); + AX_SAFE_RELEASE_NULL(_unLitNoTexMaterialProgState); + AX_SAFE_RELEASE_NULL(_vertexLitMaterialProgState); + AX_SAFE_RELEASE_NULL(_diffuseMaterialProgState); + AX_SAFE_RELEASE_NULL(_diffuseNoTexMaterialProgState); + AX_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialProgState); - CC_SAFE_RELEASE_NULL(_unLitMaterialSkinProgState); - CC_SAFE_RELEASE_NULL(_vertexLitMaterialSkinProgState); - CC_SAFE_RELEASE_NULL(_diffuseMaterialSkinProgState); - CC_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialSkinProgState); + AX_SAFE_RELEASE_NULL(_unLitMaterialSkinProgState); + AX_SAFE_RELEASE_NULL(_vertexLitMaterialSkinProgState); + AX_SAFE_RELEASE_NULL(_diffuseMaterialSkinProgState); + AX_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialSkinProgState); } void MeshMaterial::releaseCachedMaterial() @@ -235,7 +235,7 @@ MeshMaterial* MeshMaterial::createBuiltInMaterial(MaterialType type, bool skinne break; case MeshMaterial::MaterialType::VERTEX_LIT: - CCASSERT(0, "not implemented"); + AXASSERT(0, "not implemented"); break; case MeshMaterial::MaterialType::DIFFUSE: @@ -284,14 +284,14 @@ MeshMaterial* MeshMaterial::createWithFilename(std::string_view path) return (MeshMaterial*)material->clone(); } - CC_SAFE_DELETE(material); + AX_SAFE_DELETE(material); } return nullptr; } MeshMaterial* MeshMaterial::createWithProgramState(backend::ProgramState* programState) { - CCASSERT(programState, "Invalid program state."); + AXASSERT(programState, "Invalid program state."); auto mat = new MeshMaterial(); if (mat->initWithProgramState(programState)) @@ -300,7 +300,7 @@ MeshMaterial* MeshMaterial::createWithProgramState(backend::ProgramState* progra mat->autorelease(); return mat; } - CC_SAFE_DELETE(mat); + AX_SAFE_DELETE(mat); return nullptr; } @@ -336,7 +336,7 @@ void MeshMaterialCache::destroyInstance() { if (_cacheInstance) { - CC_SAFE_DELETE(_cacheInstance); + AX_SAFE_DELETE(_cacheInstance); } } @@ -345,7 +345,7 @@ bool MeshMaterialCache::addMeshMaterial(std::string_view key, Texture2D* texture auto itr = _materials.find(key); if (itr == _materials.end()) { - CC_SAFE_RETAIN(texture); + AX_SAFE_RETAIN(texture); _materials.emplace(key, texture); return true; } @@ -366,7 +366,7 @@ void MeshMaterialCache::removeAllMeshMaterial() { for (auto& itr : _materials) { - CC_SAFE_RELEASE_NULL(itr.second); + AX_SAFE_RELEASE_NULL(itr.second); } _materials.clear(); } @@ -377,7 +377,7 @@ void MeshMaterialCache::removeUnusedMeshMaterial() auto value = it->second; if (value->getReferenceCount() == 1) { - CCLOG("cocos2d: MeshMaterialCache: removing unused mesh renderer materials."); + AXLOG("cocos2d: MeshMaterialCache: removing unused mesh renderer materials."); value->release(); it = _materials.erase(it); diff --git a/core/3d/CCMeshMaterial.h b/core/3d/CCMeshMaterial.h index 2e88a4552e..4ade01dd64 100644 --- a/core/3d/CCMeshMaterial.h +++ b/core/3d/CCMeshMaterial.h @@ -48,7 +48,7 @@ class ProgramState; /** * @brief MeshMaterial: a mesh material for MeshRenderers. */ -class CC_DLL MeshMaterial : public Material +class AX_DLL MeshMaterial : public Material { public: /** diff --git a/core/3d/CCMeshRenderer.cpp b/core/3d/CCMeshRenderer.cpp index 8d745c5094..84fbf5ef8d 100644 --- a/core/3d/CCMeshRenderer.cpp +++ b/core/3d/CCMeshRenderer.cpp @@ -58,13 +58,13 @@ MeshRenderer* MeshRenderer::create() mesh->autorelease(); return mesh; } - CC_SAFE_DELETE(mesh); + AX_SAFE_DELETE(mesh); return nullptr; } MeshRenderer* MeshRenderer::create(std::string_view modelPath) { - CCASSERT(modelPath.length() >= 4, "Invalid filename."); + AXASSERT(modelPath.length() >= 4, "Invalid filename."); auto mesh = new MeshRenderer(); if (mesh->initWithFile(modelPath)) @@ -73,7 +73,7 @@ MeshRenderer* MeshRenderer::create(std::string_view modelPath) mesh->autorelease(); return mesh; } - CC_SAFE_DELETE(mesh); + AX_SAFE_DELETE(mesh); return nullptr; } MeshRenderer* MeshRenderer::create(std::string_view modelPath, std::string_view texturePath) @@ -118,7 +118,7 @@ void MeshRenderer::createAsync(std::string_view modelPath, mesh->_asyncLoadParam.meshdatas = new MeshDatas(); mesh->_asyncLoadParam.nodeDatas = new NodeDatas(); AsyncTaskPool::getInstance()->enqueue( - AsyncTaskPool::TaskType::TASK_IO, CC_CALLBACK_1(MeshRenderer::afterAsyncLoad, mesh), + AsyncTaskPool::TaskType::TASK_IO, AX_CALLBACK_1(MeshRenderer::afterAsyncLoad, mesh), (void*)(&mesh->_asyncLoadParam), [mesh]() { mesh->_asyncLoadParam.result = mesh->loadFromFile(mesh->_asyncLoadParam.modelFullPath, mesh->_asyncLoadParam.nodeDatas, @@ -136,7 +136,7 @@ void MeshRenderer::afterAsyncLoad(void* param) { _meshes.clear(); _meshVertexDatas.clear(); - CC_SAFE_RELEASE_NULL(_skeleton); + AX_SAFE_RELEASE_NULL(_skeleton); removeAllAttachNode(); // create in the main thread @@ -160,14 +160,14 @@ void MeshRenderer::afterAsyncLoad(void* param) MeshRendererCache::getInstance()->addMeshRenderData(asyncParam->modelPath, data); - CC_SAFE_DELETE(meshdatas); + AX_SAFE_DELETE(meshdatas); materialdatas = nullptr; nodeDatas = nullptr; } } - CC_SAFE_DELETE(meshdatas); - CC_SAFE_DELETE(materialdatas); - CC_SAFE_DELETE(nodeDatas); + AX_SAFE_DELETE(meshdatas); + AX_SAFE_DELETE(materialdatas); + AX_SAFE_DELETE(nodeDatas); if (asyncParam->texPath != "") { @@ -176,7 +176,7 @@ void MeshRenderer::afterAsyncLoad(void* param) } else { - CCLOG("file load failed: %s\n", asyncParam->modelPath.c_str()); + AXLOG("file load failed: %s\n", asyncParam->modelPath.c_str()); } asyncParam->afterLoadCallback(this, asyncParam->callbackParam); } @@ -207,7 +207,7 @@ bool MeshRenderer::loadFromCache(std::string_view path) _meshVertexDatas.pushBack(it); } _skeleton = Skeleton3D::create(meshdata->nodedatas->skeleton); - CC_SAFE_RETAIN(_skeleton); + AX_SAFE_RETAIN(_skeleton); const bool singleMesh = (meshdata->nodedatas->nodes.size() == 1); for (const auto& it : meshdata->nodedatas->nodes) @@ -283,7 +283,7 @@ MeshRenderer::~MeshRenderer() { _meshes.clear(); _meshVertexDatas.clear(); - CC_SAFE_RELEASE_NULL(_skeleton); + AX_SAFE_RELEASE_NULL(_skeleton); removeAllAttachNode(); } @@ -301,7 +301,7 @@ bool MeshRenderer::initWithFile(std::string_view path) _aabbDirty = true; _meshes.clear(); _meshVertexDatas.clear(); - CC_SAFE_RELEASE_NULL(_skeleton); + AX_SAFE_RELEASE_NULL(_skeleton); removeAllAttachNode(); if (loadFromCache(path)) @@ -325,14 +325,14 @@ bool MeshRenderer::initWithFile(std::string_view path) } MeshRendererCache::getInstance()->addMeshRenderData(path, data); - CC_SAFE_DELETE(meshdatas); + AX_SAFE_DELETE(meshdatas); _contentSize = getBoundingBox().size; return true; } } - CC_SAFE_DELETE(meshdatas); - CC_SAFE_DELETE(materialdatas); - CC_SAFE_DELETE(nodeDatas); + AX_SAFE_DELETE(meshdatas); + AX_SAFE_DELETE(materialdatas); + AX_SAFE_DELETE(nodeDatas); return false; } @@ -350,7 +350,7 @@ bool MeshRenderer::initFrom(const NodeDatas& nodeDatas, const MeshDatas& meshdat } } _skeleton = Skeleton3D::create(nodeDatas.skeleton); - CC_SAFE_RETAIN(_skeleton); + AX_SAFE_RETAIN(_skeleton); auto size = nodeDatas.nodes.size(); for (const auto& it : nodeDatas.nodes) @@ -472,8 +472,8 @@ void MeshRenderer::setMaterial(Material* material) void MeshRenderer::setMaterial(Material* material, int meshIndex) { - CCASSERT(material, "Invalid Material"); - CCASSERT(meshIndex == -1 || (meshIndex >= 0 && meshIndex < _meshes.size()), "Invalid meshIndex."); + AXASSERT(material, "Invalid Material"); + AXASSERT(meshIndex == -1 || (meshIndex >= 0 && meshIndex < _meshes.size()), "Invalid meshIndex."); if (meshIndex == -1) { @@ -493,7 +493,7 @@ void MeshRenderer::setMaterial(Material* material, int meshIndex) Material* MeshRenderer::getMaterial(int meshIndex) const { - CCASSERT(meshIndex >= 0 && meshIndex < _meshes.size(), "Invalid meshIndex."); + AXASSERT(meshIndex >= 0 && meshIndex < _meshes.size(), "Invalid meshIndex."); return _meshes.at(meshIndex)->getMaterial(); } @@ -505,7 +505,7 @@ void MeshRenderer::genMaterial(bool useLight) for (auto meshVertexData : _meshVertexDatas) { auto material = getMeshRendererMaterialForAttribs(meshVertexData, useLight); - CCASSERT(material, "material should cannot be null."); + AXASSERT(material, "material should cannot be null."); materials[meshVertexData] = material; } @@ -774,7 +774,7 @@ void MeshRenderer::visit(axis::Renderer* renderer, const axis::Mat4& parentTrans void MeshRenderer::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) { -#if CC_USE_CULLING +#if AX_USE_CULLING // TODO new-renderer: interface isVisibleInFrustum removal // camera clipping // if(_children.empty() && Camera::getVisitingCamera() && @@ -911,7 +911,7 @@ void MeshRenderer::setCullFaceEnabled(bool enable) Mesh* MeshRenderer::getMeshByIndex(int index) const { - CCASSERT(index < _meshes.size(), "Invalid index."); + AXASSERT(index < _meshes.size(), "Invalid index."); return _meshes.at(index); } diff --git a/core/3d/CCMeshRenderer.h b/core/3d/CCMeshRenderer.h index 995cbf6e4a..0c9cc61c88 100644 --- a/core/3d/CCMeshRenderer.h +++ b/core/3d/CCMeshRenderer.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_MESH_RENDERER_H__ -#define __CC_MESH_RENDERER_H__ +#ifndef __AX_MESH_RENDERER_H__ +#define __AX_MESH_RENDERER_H__ #include @@ -53,7 +53,7 @@ struct NodeData; /** @brief MeshRenderer: A mesh can be loaded from model files, .obj, .c3t, .c3b *and a mesh renderer renders a list of these loaded meshes with specified materials */ -class CC_DLL MeshRenderer : public Node, public BlendProtocol +class AX_DLL MeshRenderer : public Node, public BlendProtocol { public: /** @@ -286,7 +286,7 @@ protected: /** * @brief MeshRendererCache: the cache data of MeshRenderer, used to speed up the creation process of MeshRenderer */ -class CC_DLL MeshRendererCache +class AX_DLL MeshRendererCache { public: struct MeshRenderData @@ -341,4 +341,4 @@ protected: /// @} NS_AX_END -#endif // __CC_MESH_RENDERER_H__ +#endif // __AX_MESH_RENDERER_H__ diff --git a/core/3d/CCMeshSkin.cpp b/core/3d/CCMeshSkin.cpp index 65f893251e..3fb45fefd3 100644 --- a/core/3d/CCMeshSkin.cpp +++ b/core/3d/CCMeshSkin.cpp @@ -36,7 +36,7 @@ MeshSkin::MeshSkin() : _rootBone(nullptr), _skeleton(nullptr) {} MeshSkin::~MeshSkin() { removeAllBones(); - CC_SAFE_RELEASE(_skeleton); + AX_SAFE_RELEASE(_skeleton); } MeshSkin* MeshSkin::create(Skeleton3D* skeleton, @@ -47,7 +47,7 @@ MeshSkin* MeshSkin::create(Skeleton3D* skeleton, skin->_skeleton = skeleton; skeleton->retain(); - CCASSERT(boneNames.size() == invBindPose.size(), "bone names' num should equals to invBindPose's num"); + AXASSERT(boneNames.size() == invBindPose.size(), "bone names' num should equals to invBindPose's num"); for (const auto& it : boneNames) { auto bone = skeleton->getBoneByName(it); @@ -127,7 +127,7 @@ ssize_t MeshSkin::getMatrixPaletteSizeInBytes() const void MeshSkin::removeAllBones() { _skinBones.clear(); - CC_SAFE_RELEASE(_rootBone); + AX_SAFE_RELEASE(_rootBone); } void MeshSkin::addSkinBone(Bone3D* bone) diff --git a/core/3d/CCMeshSkin.h b/core/3d/CCMeshSkin.h index b61d77b8c8..51c65afc5f 100644 --- a/core/3d/CCMeshSkin.h +++ b/core/3d/CCMeshSkin.h @@ -48,7 +48,7 @@ class Skeleton3D; * @js NA * @lua NA */ -class CC_DLL MeshSkin : public Ref +class AX_DLL MeshSkin : public Ref { friend class Mesh; diff --git a/core/3d/CCMeshVertexIndexData.cpp b/core/3d/CCMeshVertexIndexData.cpp index 0e0677e4ef..00188bd664 100644 --- a/core/3d/CCMeshVertexIndexData.cpp +++ b/core/3d/CCMeshVertexIndexData.cpp @@ -73,7 +73,7 @@ backend::Buffer* MeshIndexData::getVertexBuffer() const MeshIndexData::MeshIndexData() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { _indexBuffer->updateData((void*)_indexData.data(), _indexData.bsize()); }); @@ -83,7 +83,7 @@ MeshIndexData::MeshIndexData() void MeshIndexData::setIndexData(const axis::MeshData::IndexArray& indexdata) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA if (!_indexData.empty()) return; _indexData = indexdata; @@ -92,16 +92,16 @@ void MeshIndexData::setIndexData(const axis::MeshData::IndexArray& indexdata) MeshIndexData::~MeshIndexData() { - CC_SAFE_RELEASE(_indexBuffer); + AX_SAFE_RELEASE(_indexBuffer); _indexData.clear(); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } void MeshVertexData::setVertexData(const std::vector& vertexData) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA if (!_vertexData.empty()) return; _vertexData = vertexData; @@ -113,7 +113,7 @@ MeshVertexData* MeshVertexData::create(const MeshData& meshdata, CustomCommand:: auto vertexdata = new MeshVertexData(); vertexdata->_vertexBuffer = backend::Device::getInstance()->newBuffer( meshdata.vertex.size() * sizeof(meshdata.vertex[0]), backend::BufferType::VERTEX, backend::BufferUsage::STATIC); - // CC_SAFE_RETAIN(vertexdata->_vertexBuffer); + // AX_SAFE_RETAIN(vertexdata->_vertexBuffer); vertexdata->_sizePerVertex = meshdata.getPerVertexSize(); @@ -121,7 +121,7 @@ MeshVertexData* MeshVertexData::create(const MeshData& meshdata, CustomCommand:: if (vertexdata->_vertexBuffer) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA vertexdata->setVertexData(meshdata.vertex); vertexdata->_vertexBuffer->usingDefaultStoredData(false); #endif @@ -136,7 +136,7 @@ MeshVertexData* MeshVertexData::create(const MeshData& meshdata, CustomCommand:: auto indexBuffer = backend::Device::getInstance()->newBuffer( indices.bsize(), backend::BufferType::INDEX, backend::BufferUsage::STATIC); indexBuffer->autorelease(); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA indexBuffer->usingDefaultStoredData(false); #endif indexBuffer->updateData((void*)indices.data(), indices.bsize()); @@ -150,7 +150,7 @@ MeshVertexData* MeshVertexData::create(const MeshData& meshdata, CustomCommand:: } else indexdata = MeshIndexData::create(id, vertexdata, indexBuffer, meshdata.subMeshAABB[i]); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA indexdata->setIndexData(indices); #endif vertexdata->_indices.pushBack(indexdata); @@ -182,7 +182,7 @@ bool MeshVertexData::hasVertexAttrib(shaderinfos::VertexKey attrib) const MeshVertexData::MeshVertexData() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { _vertexBuffer->updateData((void*)_vertexData.data(), _vertexData.size() * sizeof(_vertexData[0])); }); @@ -192,10 +192,10 @@ MeshVertexData::MeshVertexData() MeshVertexData::~MeshVertexData() { - CC_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_vertexBuffer); _indices.clear(); _vertexData.clear(); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } diff --git a/core/3d/CCMeshVertexIndexData.h b/core/3d/CCMeshVertexIndexData.h index e32bb9ed90..0282c2db06 100644 --- a/core/3d/CCMeshVertexIndexData.h +++ b/core/3d/CCMeshVertexIndexData.h @@ -51,7 +51,7 @@ class MeshVertexData; * @js NA * @lua NA */ -class CC_DLL MeshIndexData : public Ref +class AX_DLL MeshIndexData : public Ref { public: /** create */ @@ -96,7 +96,7 @@ protected: friend class MeshVertexData; friend class MeshRenderer; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener = nullptr; #endif }; @@ -105,7 +105,7 @@ protected: * the MeshVertexData class. * @brief the MeshVertexData contain all of the vertices data which mesh need. */ -class CC_DLL MeshVertexData : public Ref +class AX_DLL MeshVertexData : public Ref { friend class MeshRenderer; friend class Mesh; @@ -149,7 +149,7 @@ protected: int _vertexCount = 0; // vertex count std::vector _vertexData; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener = nullptr; #endif }; diff --git a/core/3d/CCMotionStreak3D.cpp b/core/3d/CCMotionStreak3D.cpp index 5befbc9cd4..1c11e6cd53 100644 --- a/core/3d/CCMotionStreak3D.cpp +++ b/core/3d/CCMotionStreak3D.cpp @@ -54,7 +54,7 @@ MotionStreak3D::MotionStreak3D() MotionStreak3D::~MotionStreak3D() { - CC_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_texture); } MotionStreak3D* MotionStreak3D::create(float fade, @@ -70,7 +70,7 @@ MotionStreak3D* MotionStreak3D::create(float fade, return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -83,13 +83,13 @@ MotionStreak3D* MotionStreak3D::create(float fade, float minSeg, float stroke, c return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } bool MotionStreak3D::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); @@ -274,8 +274,8 @@ void MotionStreak3D::setTexture(Texture2D* texture) { if (_texture != texture) { - CC_SAFE_RETAIN(texture); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RETAIN(texture); + AX_SAFE_RELEASE(_texture); _texture = texture; _programState->setTexture(_locTexture, 0, _texture->getBackendTexture()); } @@ -293,12 +293,12 @@ const BlendFunc& MotionStreak3D::getBlendFunc() const void MotionStreak3D::setOpacity(uint8_t /*opacity*/) { - CCASSERT(false, "Set opacity no supported"); + AXASSERT(false, "Set opacity no supported"); } uint8_t MotionStreak3D::getOpacity() const { - CCASSERT(false, "Opacity no supported"); + AXASSERT(false, "Opacity no supported"); return 0; } @@ -432,8 +432,8 @@ void MotionStreak3D::draw(Renderer* renderer, const Mat4& transform, uint32_t fl _programState->setUniform(_locMVP, mvpMatrix.m, sizeof(mvpMatrix.m)); - beforeCommand->func = CC_CALLBACK_0(MotionStreak3D::onBeforeDraw, this); - afterCommand->func = CC_CALLBACK_0(MotionStreak3D::onAfterDraw, this); + beforeCommand->func = AX_CALLBACK_0(MotionStreak3D::onBeforeDraw, this); + afterCommand->func = AX_CALLBACK_0(MotionStreak3D::onAfterDraw, this); _customCommand.updateVertexBuffer(_vertexData.data(), sizeof(_vertexData[0]) * _nuPoints * 2); @@ -442,7 +442,7 @@ void MotionStreak3D::draw(Renderer* renderer, const Mat4& transform, uint32_t fl renderer->addCommand(beforeCommand); renderer->addCommand(&_customCommand); renderer->addCommand(afterCommand); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _nuPoints * 2); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _nuPoints * 2); } void MotionStreak3D::onBeforeDraw() diff --git a/core/3d/CCMotionStreak3D.h b/core/3d/CCMotionStreak3D.h index eb8282327d..a93ad8ef85 100644 --- a/core/3d/CCMotionStreak3D.h +++ b/core/3d/CCMotionStreak3D.h @@ -22,8 +22,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_MOTION_STREAK3D_H__ -#define __CC_MOTION_STREAK3D_H__ +#ifndef __AX_MOTION_STREAK3D_H__ +#define __AX_MOTION_STREAK3D_H__ #include "base/CCProtocols.h" #include "2d/CCNode.h" @@ -44,7 +44,7 @@ class Texture2D; /** @class MotionStreak3D. * @brief Creates a trailing path. It is created from a line segment sweeping along the path. */ -class CC_DLL MotionStreak3D : public Node, public TextureProtocol +class AX_DLL MotionStreak3D : public Node, public TextureProtocol { public: /** Creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture @@ -203,7 +203,7 @@ protected: CustomCommand _customCommand; private: - CC_DISALLOW_COPY_AND_ASSIGN(MotionStreak3D); + AX_DISALLOW_COPY_AND_ASSIGN(MotionStreak3D); //CallbackCommand _beforeCommand; //CallbackCommand _afterCommand; @@ -222,4 +222,4 @@ private: NS_AX_END -#endif //__CC_MOTION_STREAK3D_H__ +#endif //__AX_MOTION_STREAK3D_H__ diff --git a/core/3d/CCOBB.cpp b/core/3d/CCOBB.cpp index c7846bb762..106abab202 100644 --- a/core/3d/CCOBB.cpp +++ b/core/3d/CCOBB.cpp @@ -85,7 +85,7 @@ static float& _getElement(Vec3& point, int index) if (index == 2) return point.z; - CC_ASSERT(0); + AX_ASSERT(0); return point.x; } @@ -374,7 +374,7 @@ Vec3 OBB::getEdgeDirection(int index) const tmpLine.normalize(); break; default: - CCASSERT(0, "Invalid index!"); + AXASSERT(0, "Invalid index!"); break; } return tmpLine; @@ -407,7 +407,7 @@ Vec3 OBB::getFaceDirection(int index) const faceDirection.normalize(); break; default: - CCASSERT(0, "Invalid index!"); + AXASSERT(0, "Invalid index!"); break; } return faceDirection; diff --git a/core/3d/CCOBB.h b/core/3d/CCOBB.h index 2cd6babbd6..58819e1e98 100644 --- a/core/3d/CCOBB.h +++ b/core/3d/CCOBB.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_OBB_H__ -#define __CC_OBB_H__ +#ifndef __AX_OBB_H__ +#define __AX_OBB_H__ #include "3d/CCAABB.h" @@ -41,7 +41,7 @@ NS_AX_BEGIN * MeshRenderer. so collision detection is more precise than AABB. * @js NA */ -class CC_DLL OBB +class AX_DLL OBB { public: OBB(); diff --git a/core/3d/CCPlane.h b/core/3d/CCPlane.h index f8e8cd0913..6301068226 100644 --- a/core/3d/CCPlane.h +++ b/core/3d/CCPlane.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PLANE_H_ -#define __CC_PLANE_H_ +#ifndef __AX_PLANE_H_ +#define __AX_PLANE_H_ #include "base/ccMacros.h" #include "math/CCMath.h" @@ -43,7 +43,7 @@ enum class PointSide * @js NA * @lua NA **/ -class CC_DLL Plane +class AX_DLL Plane { public: /** diff --git a/core/3d/CCRay.h b/core/3d/CCRay.h index dccea23361..e0575c19c1 100644 --- a/core/3d/CCRay.h +++ b/core/3d/CCRay.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_RAY_H_ -#define __CC_RAY_H_ +#ifndef __AX_RAY_H_ +#define __AX_RAY_H_ #include "math/CCMath.h" #include "3d/CCAABB.h" @@ -42,7 +42,7 @@ NS_AX_BEGIN * @brief Ray is a line with one end. usually use it to check intersects with some object,such as Plane, OBB, AABB * @js NA **/ -class CC_DLL Ray +class AX_DLL Ray { public: /** diff --git a/core/3d/CCSkeleton3D.h b/core/3d/CCSkeleton3D.h index ea86fc6367..1b52540074 100644 --- a/core/3d/CCSkeleton3D.h +++ b/core/3d/CCSkeleton3D.h @@ -41,7 +41,7 @@ NS_AX_BEGIN * @brief Defines a basic hierarchical structure of transformation spaces. * @lua NA */ -class CC_DLL Bone3D : public Ref +class AX_DLL Bone3D : public Ref { friend class Skeleton3D; friend class MeshSkin; @@ -177,7 +177,7 @@ protected: * Skeleton * */ -class CC_DLL Skeleton3D : public Ref +class AX_DLL Skeleton3D : public Ref { public: /** diff --git a/core/3d/CCSkybox.cpp b/core/3d/CCSkybox.cpp index 5b78572db3..842d0a237f 100644 --- a/core/3d/CCSkybox.cpp +++ b/core/3d/CCSkybox.cpp @@ -60,8 +60,8 @@ bool Skybox::init() _customCommand.setTransparent(false); _customCommand.set3D(true); - _customCommand.setBeforeCallback(CC_CALLBACK_0(Skybox::onBeforeDraw, this)); - _customCommand.setAfterCallback(CC_CALLBACK_0(Skybox::onAfterDraw, this)); + _customCommand.setBeforeCallback(AX_CALLBACK_0(Skybox::onBeforeDraw, this)); + _customCommand.setAfterCallback(AX_CALLBACK_0(Skybox::onAfterDraw, this)); // create and set our custom shader auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::SKYBOX_3D); @@ -162,13 +162,13 @@ void Skybox::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) _programState->setUniform(_uniformColorLoc, &color, sizeof(color)); _programState->setUniform(_uniformCameraRotLoc, cameraModelMat.m, sizeof(cameraModelMat.m)); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 4); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 4); } void Skybox::setTexture(TextureCube* texture) { - CCASSERT(texture != nullptr, __FUNCTION__); - CC_SAFE_RELEASE_NULL(_texture); + AXASSERT(texture != nullptr, __FUNCTION__); + AX_SAFE_RELEASE_NULL(_texture); texture->retain(); _texture = texture; _programState->setTexture(_uniformEnvLoc, 0, _texture->getBackendTexture()); diff --git a/core/3d/CCSkybox.h b/core/3d/CCSkybox.h index 62497d0893..0a8acd6a0b 100644 --- a/core/3d/CCSkybox.h +++ b/core/3d/CCSkybox.h @@ -44,7 +44,7 @@ class TextureCube; /** * Sky box technology is usually used to simulate infinity sky, mountains and other phenomena. */ -class CC_DLL Skybox : public Node +class AX_DLL Skybox : public Node { public: CREATE_FUNC(Skybox); @@ -109,7 +109,7 @@ protected: TextureCube* _texture; private: - CC_DISALLOW_COPY_AND_ASSIGN(Skybox); + AX_DISALLOW_COPY_AND_ASSIGN(Skybox); backend::UniformLocation _uniformColorLoc; backend::UniformLocation _uniformCameraRotLoc; diff --git a/core/3d/CCTerrain.cpp b/core/3d/CCTerrain.cpp index e8dcb8b369..4106bac62a 100644 --- a/core/3d/CCTerrain.cpp +++ b/core/3d/CCTerrain.cpp @@ -61,7 +61,7 @@ Terrain* Terrain::create(TerrainData& parameter, CrackFixedType fixedType) terrain->autorelease(); return terrain; } - CC_SAFE_DELETE(terrain); + AX_SAFE_DELETE(terrain); return terrain; } bool Terrain::initWithTerrainData(TerrainData& parameter, CrackFixedType fixedType) @@ -85,7 +85,7 @@ bool Terrain::initWithTerrainData(TerrainData& parameter, CrackFixedType fixedTy void axis::Terrain::setLightMap(std::string_view fileName) { - CC_SAFE_RELEASE(_lightMap); + AX_SAFE_RELEASE(_lightMap); auto image = new Image(); image->initWithImageFile(fileName); _lightMap = new Texture2D(); @@ -162,7 +162,7 @@ void Terrain::draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32 { int hasLightMap = 0; _programState->setUniform(_lightMapCheckLocation, &hasLightMap, sizeof(hasLightMap)); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _programState->setTexture(_lightMapLocation, 5, _dummyTexture->getBackendTexture()); #endif } @@ -246,7 +246,7 @@ bool Terrain::initHeightMap(std::string_view heightMap) } else { - CCLOG("warning: the height map size is not POT or POT + 1"); + AXLOG("warning: the height map size is not POT or POT + 1"); return false; } } @@ -255,22 +255,22 @@ Terrain::Terrain() : _alphaMap(nullptr) , _lightMap(nullptr) , _lightDir(-1.f, -1.f, 0.f) -#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*) { reload(); }); _director->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, 1); #endif -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL auto image = new Image(); - bool CC_UNUSED isOK = image->initWithRawData(cc_2x2_white_image, sizeof(cc_2x2_white_image), 2, 2, 8); - CCASSERT(isOK, "The 2x2 empty texture was created unsuccessfully."); + bool AX_UNUSED isOK = image->initWithRawData(cc_2x2_white_image, sizeof(cc_2x2_white_image), 2, 2, 8); + AXASSERT(isOK, "The 2x2 empty texture was created unsuccessfully."); _dummyTexture = new Texture2D(); _dummyTexture->initWithImage(image); - CC_SAFE_RELEASE(image); + AX_SAFE_RELEASE(image); #endif } @@ -465,10 +465,10 @@ void Terrain::setIsEnableFrustumCull(bool bool_value) Terrain::~Terrain() { - CC_SAFE_RELEASE(_alphaMap); - CC_SAFE_RELEASE(_lightMap); - CC_SAFE_RELEASE(_heightMapImage); - CC_SAFE_RELEASE(_dummyTexture); + AX_SAFE_RELEASE(_alphaMap); + AX_SAFE_RELEASE(_lightMap); + AX_SAFE_RELEASE(_heightMapImage); + AX_SAFE_RELEASE(_dummyTexture); delete _quadRoot; for (int i = 0; i < 4; ++i) { @@ -488,7 +488,7 @@ Terrain::~Terrain() } } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _director->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -674,8 +674,8 @@ Terrain::Chunk* axis::Terrain::getChunkByIndex(int x, int y) const void Terrain::setAlphaMap(axis::Texture2D* newAlphaMapTexture) { - CC_SAFE_RETAIN(newAlphaMapTexture); - CC_SAFE_RELEASE(_alphaMap); + AX_SAFE_RETAIN(newAlphaMapTexture); + AX_SAFE_RELEASE(_alphaMap); _alphaMap = newAlphaMapTexture; } @@ -683,7 +683,7 @@ void Terrain::setDetailMap(unsigned int index, DetailMap detailMap) { if (index > 4) { - CCLOG("invalid DetailMap index %d\n", index); + AXLOG("invalid DetailMap index %d\n", index); } _terrainData._detailMaps[index] = detailMap; if (_detailMapTextures[index]) @@ -738,7 +738,7 @@ Terrain::ChunkIndices Terrain::insertIndicesLOD(int neighborLod[4], int selfLod, backend::BufferUsage::STATIC); buffer->updateData(indices, sizeof(uint16_t) * size); - CC_SAFE_RELEASE_NULL(lodIndices._chunkIndices._indexBuffer); + AX_SAFE_RELEASE_NULL(lodIndices._chunkIndices._indexBuffer); lodIndices._chunkIndices._indexBuffer = buffer; this->_chunkLodIndicesSet.push_back(lodIndices); return lodIndices._chunkIndices; @@ -776,7 +776,7 @@ Terrain::ChunkIndices Terrain::insertIndicesLODSkirt(int selfLod, uint16_t* indi backend::BufferUsage::STATIC); buffer->updateData(indices, sizeof(uint16_t) * size); - CC_SAFE_RELEASE_NULL(skirtIndices._chunkIndices._indexBuffer); + AX_SAFE_RELEASE_NULL(skirtIndices._chunkIndices._indexBuffer); skirtIndices._chunkIndices._indexBuffer = buffer; this->_chunkLodIndicesSkirtSet.push_back(skirtIndices); return skirtIndices._chunkIndices; @@ -931,7 +931,7 @@ void Terrain::Chunk::finish() // the second vbo for the indices, because we use level of detail technique to each chunk, so we will modified // frequently - CC_SAFE_RELEASE_NULL(_buffer); + AX_SAFE_RELEASE_NULL(_buffer); _buffer = backend::Device::getInstance()->newBuffer(sizeof(TerrainVertexData) * _originalVertices.size(), backend::BufferType::VERTEX, backend::BufferUsage::DYNAMIC); @@ -971,13 +971,13 @@ void Terrain::Chunk::bindAndDraw() } auto* renderer = Director::getInstance()->getRenderer(); - CCASSERT(_buffer && _chunkIndices._indexBuffer, "buffer should not be nullptr"); + AXASSERT(_buffer && _chunkIndices._indexBuffer, "buffer should not be nullptr"); _command.setIndexBuffer(_chunkIndices._indexBuffer, backend::IndexFormat::U_SHORT); _command.setVertexBuffer(_buffer); _command.getPipelineDescriptor().programState = _terrain->_programState; _command.setIndexDrawInfo(0, _chunkIndices._size); renderer->addCommand(&_command); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _chunkIndices._size); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _chunkIndices._size); } void Terrain::Chunk::generate(int imgWidth, int imageHei, int m, int n, const unsigned char* /*data*/) @@ -1099,8 +1099,8 @@ Terrain::Chunk::Chunk(Terrain* terrain) _command.setPrimitiveType(MeshCommand::PrimitiveType::TRIANGLE); _command.setDrawType(MeshCommand::DrawType::ELEMENT); - _command.setBeforeCallback(CC_CALLBACK_0(Terrain::onBeforeDraw, terrain)); - _command.setAfterCallback(CC_CALLBACK_0(Terrain::onAfterDraw, terrain)); + _command.setBeforeCallback(AX_CALLBACK_0(Terrain::onBeforeDraw, terrain)); + _command.setAfterCallback(AX_CALLBACK_0(Terrain::onAfterDraw, terrain)); auto& pipelineDescriptor = _command.getPipelineDescriptor(); pipelineDescriptor.blendDescriptor.blendEnabled = false; @@ -1438,7 +1438,7 @@ void Terrain::Chunk::updateVerticesForLOD() Terrain::Chunk::~Chunk() { - CC_SAFE_RELEASE_NULL(_buffer); + AX_SAFE_RELEASE_NULL(_buffer); } void Terrain::Chunk::updateIndicesLODSkirt() @@ -1708,7 +1708,7 @@ Terrain::TerrainData::TerrainData() {} Terrain::ChunkIndices::ChunkIndices(const Terrain::ChunkIndices& other) { _indexBuffer = other._indexBuffer; - CC_SAFE_RETAIN(_indexBuffer); + AX_SAFE_RETAIN(_indexBuffer); _size = other._size; } @@ -1716,9 +1716,9 @@ Terrain::ChunkIndices& Terrain::ChunkIndices::operator=(const Terrain::ChunkIndi { if (other._indexBuffer != _indexBuffer) { - CC_SAFE_RELEASE_NULL(_indexBuffer); + AX_SAFE_RELEASE_NULL(_indexBuffer); _indexBuffer = other._indexBuffer; - CC_SAFE_RETAIN(_indexBuffer); + AX_SAFE_RETAIN(_indexBuffer); } _size = other._size; return *this; @@ -1726,7 +1726,7 @@ Terrain::ChunkIndices& Terrain::ChunkIndices::operator=(const Terrain::ChunkIndi Terrain::ChunkIndices::~ChunkIndices() { - CC_SAFE_RELEASE_NULL(_indexBuffer); + AX_SAFE_RELEASE_NULL(_indexBuffer); } Terrain::DetailMap::DetailMap(std::string_view detailMapPath, float size /*= 35*/) diff --git a/core/3d/CCTerrain.h b/core/3d/CCTerrain.h index 619027a4db..12f0ec15ca 100644 --- a/core/3d/CCTerrain.h +++ b/core/3d/CCTerrain.h @@ -89,7 +89,7 @@ NS_AX_BEGIN * We can use ray-terrain intersection to pick a point of the terrain; * Also we can get an arbitrary point of the terrain's height and normal vector for convenience . **/ -class CC_DLL Terrain : public Node +class AX_DLL Terrain : public Node { public: /**the crack fix type. use to fix the gaps between different LOD chunks */ @@ -104,7 +104,7 @@ public: *this struct maintain a detail map data ,including source file ,detail size. *the DetailMap can use for terrain splatting **/ - struct CC_DLL DetailMap + struct AX_DLL DetailMap { /*Constructors*/ DetailMap(); @@ -131,7 +131,7 @@ public: *TerrainData *This TerrainData struct warp all parameter that Terrain need to create */ - struct CC_DLL TerrainData + struct AX_DLL TerrainData { /**empty constructor*/ TerrainData(); @@ -205,7 +205,7 @@ private: /* *terrain vertices internal data format **/ - struct CC_DLL TerrainVertexData + struct AX_DLL TerrainVertexData { /*constructor*/ TerrainVertexData(){}; @@ -220,7 +220,7 @@ private: axis::Vec3 _normal; }; - struct CC_DLL QuadTree; + struct AX_DLL QuadTree; /* *the terminal node of quad, use to subdivision terrain mesh and LOD **/ @@ -298,7 +298,7 @@ private: *QuadTree * @brief use to hierarchically frustum culling and set LOD **/ - struct CC_DLL QuadTree + struct AX_DLL QuadTree { /**constructor*/ QuadTree(int x, int y, int width, int height, Terrain* terrain); @@ -569,7 +569,7 @@ private: backend::UniformLocation _lightDirLocation; backend::UniformLocation _mvpMatrixLocation; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener; #endif }; diff --git a/core/3d/CCVertexAttribBinding.cpp b/core/3d/CCVertexAttribBinding.cpp index 21ac744d76..664a0037e4 100644 --- a/core/3d/CCVertexAttribBinding.cpp +++ b/core/3d/CCVertexAttribBinding.cpp @@ -43,21 +43,21 @@ VertexAttribBinding::~VertexAttribBinding() __vertexAttribBindingCache.erase(itr); } - CC_SAFE_RELEASE(_meshIndexData); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_meshIndexData); + AX_SAFE_RELEASE(_programState); _attributes.clear(); } VertexAttribBinding* VertexAttribBinding::create(MeshIndexData* meshIndexData, Pass* pass, MeshCommand* command) { - CCASSERT(meshIndexData && pass && pass->getProgramState(), "Invalid MeshIndexData and/or programState"); + AXASSERT(meshIndexData && pass && pass->getProgramState(), "Invalid MeshIndexData and/or programState"); // Search for an existing vertex attribute binding that can be used. VertexAttribBinding* b; for (size_t i = 0, count = __vertexAttribBindingCache.size(); i < count; ++i) { b = __vertexAttribBindingCache[i]; - CC_ASSERT(b); + AX_ASSERT(b); if (b->_meshIndexData == meshIndexData && b->_programState == pass->getProgramState()) { // Found a match! @@ -78,7 +78,7 @@ VertexAttribBinding* VertexAttribBinding::create(MeshIndexData* meshIndexData, P bool VertexAttribBinding::init(MeshIndexData* meshIndexData, Pass* pass, MeshCommand* command) { - CCASSERT(meshIndexData && pass && pass->getProgramState(), "Invalid arguments"); + AXASSERT(meshIndexData && pass && pass->getProgramState(), "Invalid arguments"); auto programState = pass->getProgramState(); @@ -105,7 +105,7 @@ bool VertexAttribBinding::init(MeshIndexData* meshIndexData, Pass* pass, MeshCom _vertexLayout->setLayout(offset); - CCASSERT(offset == meshVertexData->getSizePerVertex(), "vertex layout mismatch!"); + AXASSERT(offset == meshVertexData->getSizePerVertex(), "vertex layout mismatch!"); return true; } @@ -117,7 +117,7 @@ uint32_t VertexAttribBinding::getVertexAttribsFlags() const void VertexAttribBinding::parseAttributes() { - CCASSERT(_programState, "invalid glprogram"); + AXASSERT(_programState, "invalid glprogram"); _attributes.clear(); _vertexAttribsFlags = 0; @@ -149,13 +149,13 @@ void VertexAttribBinding::setVertexAttribPointer(std::string_view name, auto v = getVertexAttribValue(name); if (v) { - // CCLOG("cocos2d: set attribute '%s' location: %d, offset: %d", name.c_str(), v->location, offset); + // AXLOG("cocos2d: set attribute '%s' location: %d, offset: %d", name.c_str(), v->location, offset); _vertexLayout->setAttribute(name, v->location, type, offset, normalized); _vertexAttribsFlags |= flag; } else { - // CCLOG("cocos2d: warning: Attribute not found: %s", name.c_str()); + // AXLOG("cocos2d: warning: Attribute not found: %s", name.c_str()); } } diff --git a/core/3d/CCVertexAttribBinding.h b/core/3d/CCVertexAttribBinding.h index c4bad32dc1..79ee0463d8 100644 --- a/core/3d/CCVertexAttribBinding.h +++ b/core/3d/CCVertexAttribBinding.h @@ -54,7 +54,7 @@ class VertexAttribValue; * arrays, since it is slower than the server-side VAOs used by OpenGL * (when creating a VertexAttribBinding between a Mesh and Effect). */ -class CC_DLL VertexAttribBinding : public Ref +class AX_DLL VertexAttribBinding : public Ref { public: /** diff --git a/core/audio/AudioCache.h b/core/audio/AudioCache.h index 32a3abfe8b..020cd19d72 100644 --- a/core/audio/AudioCache.h +++ b/core/audio/AudioCache.h @@ -43,7 +43,7 @@ NS_AX_BEGIN class AudioEngineImpl; class AudioPlayer; -class CC_DLL AudioCache +class AX_DLL AudioCache { public: enum class State diff --git a/core/audio/AudioDecoderMp3.cpp b/core/audio/AudioDecoderMp3.cpp index 2280f3a208..bd60e87fb3 100644 --- a/core/audio/AudioDecoderMp3.cpp +++ b/core/audio/AudioDecoderMp3.cpp @@ -32,7 +32,7 @@ #include "base/CCConsole.h" -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 # define MINIMP3_IMPLEMENTATION # include "minimp3/minimp3_ex.h" #else @@ -41,12 +41,12 @@ # include "mpg123.h" #endif -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include # include #endif -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 struct mp3dec_impl { mp3dec_ex_t _dec; @@ -56,7 +56,7 @@ struct mp3dec_impl NS_AX_BEGIN -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 static size_t minimp3_read_r(void* buf, size_t size, void* user_data) { return ((FileStream*)user_data)->read(buf, size); @@ -87,7 +87,7 @@ void mpg123_close_r(void* handle) bool AudioDecoderMp3::lazyInit() { bool ret = true; -#if CC_USE_MPG123 +#if AX_USE_MPG123 if (!__mp3Inited) { int error = mpg123_init(); @@ -107,7 +107,7 @@ bool AudioDecoderMp3::lazyInit() void AudioDecoderMp3::destroy() { -#if CC_USE_MPG123 +#if AX_USE_MPG123 if (__mp3Inited) { mpg123_exit(); @@ -128,7 +128,7 @@ AudioDecoderMp3::~AudioDecoderMp3() bool AudioDecoderMp3::open(std::string_view fullPath) { -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 do { _fileStream = FileUtils::getInstance()->openFileStream(fullPath, FileStream::Mode::READ); @@ -245,7 +245,7 @@ void AudioDecoderMp3::close() { if (isOpened()) { -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 if (_handle) { mp3dec_ex_close(&_handle->_dec); @@ -270,7 +270,7 @@ void AudioDecoderMp3::close() uint32_t AudioDecoderMp3::read(uint32_t framesToRead, char* pcmBuf) { -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 auto sampelsToRead = framesToRead * _channelCount; auto samplesRead = mp3dec_ex_read(&_handle->_dec, (mp3d_sample_t*)pcmBuf, sampelsToRead); return static_cast(samplesRead / _channelCount); @@ -290,7 +290,7 @@ uint32_t AudioDecoderMp3::read(uint32_t framesToRead, char* pcmBuf) bool AudioDecoderMp3::seek(uint32_t frameOffset) { -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 return 0 == mp3dec_ex_seek(&_handle->_dec, frameOffset); #else off_t offset = mpg123_seek(_handle, frameOffset, SEEK_SET); diff --git a/core/audio/AudioDecoderMp3.h b/core/audio/AudioDecoderMp3.h index c942cab42d..a240c0418c 100644 --- a/core/audio/AudioDecoderMp3.h +++ b/core/audio/AudioDecoderMp3.h @@ -29,11 +29,11 @@ #include "audio/AudioDecoder.h" #include -#if !defined(CC_USE_MPG123) -# define CC_USE_MPG123 0 +#if !defined(AX_USE_MPG123) +# define AX_USE_MPG123 0 #endif -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 typedef struct mp3dec_impl* mp3dec_handle_t; #else typedef struct mpg123_handle_struct* mp3dec_handle_t; diff --git a/core/audio/AudioDecoderOgg.cpp b/core/audio/AudioDecoderOgg.cpp index 21ef0bb452..27da9595f5 100644 --- a/core/audio/AudioDecoderOgg.cpp +++ b/core/audio/AudioDecoderOgg.cpp @@ -30,7 +30,7 @@ #include "audio/AudioMacros.h" #include "platform/CCFileUtils.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include # include #endif diff --git a/core/audio/AudioEngine.cpp b/core/audio/AudioEngine.cpp index 92909701de..2410772e5b 100644 --- a/core/audio/AudioEngine.cpp +++ b/core/audio/AudioEngine.cpp @@ -196,7 +196,7 @@ AUDIO_ID AudioEngine::play2d(std::string_view filePath, bool loop, float volume, auto profileHelper = _defaultProfileHelper; if (profile && profile != &profileHelper->profile) { - CC_ASSERT(!profile->name.empty()); + AX_ASSERT(!profile->name.empty()); profileHelper = &_audioPathProfileHelperMap[profile->name]; profileHelper->profile = *profile; } diff --git a/core/audio/AudioEngine.h b/core/audio/AudioEngine.h index a239877efa..90fdaca512 100644 --- a/core/audio/AudioEngine.h +++ b/core/audio/AudioEngine.h @@ -52,7 +52,7 @@ NS_AX_BEGIN * @brief * @js NA */ -class CC_DLL AudioProfile +class AX_DLL AudioProfile { public: // Profile name can't be empty. @@ -82,7 +82,7 @@ class AudioEngineImpl; * @js NA */ -class CC_DLL AudioEngine +class AX_DLL AudioEngine { public: /** AudioState enum,all possible states of an audio instance.*/ diff --git a/core/audio/AudioEngineImpl.cpp b/core/audio/AudioEngineImpl.cpp index aacf28172e..4834d22f6c 100644 --- a/core/audio/AudioEngineImpl.cpp +++ b/core/audio/AudioEngineImpl.cpp @@ -31,7 +31,7 @@ #include "audio/AudioEngineImpl.h" #include "audio/AudioDecoderManager.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC # import #endif @@ -41,7 +41,7 @@ #include "base/CCScheduler.h" #include "base/ccUtils.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS # import #endif @@ -100,7 +100,7 @@ static ALenum alSourceAddNotificationExt(ALuint sid, return AL_INVALID_VALUE; } -# if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +# if AX_TARGET_PLATFORM == AX_PLATFORM_IOS @interface AudioEngineSessionHandler : NSObject { } @@ -269,7 +269,7 @@ AudioEngineImpl::~AudioEngineImpl() { if (_scheduled && _scheduler != nullptr) { - _scheduler->unschedule(CC_SCHEDULE_SELECTOR(AudioEngineImpl::update), this); + _scheduler->unschedule(AX_SCHEDULE_SELECTOR(AudioEngineImpl::update), this); } if (s_ALContext) @@ -291,7 +291,7 @@ AudioEngineImpl::~AudioEngineImpl() AudioDecoderManager::destroy(); -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS [s_AudioEngineSessionHandler release]; #endif s_instance = nullptr; @@ -302,7 +302,7 @@ bool AudioEngineImpl::init() bool ret = false; do { -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS s_AudioEngineSessionHandler = [[AudioEngineSessionHandler alloc] init]; #endif @@ -476,7 +476,7 @@ AUDIO_ID AudioEngineImpl::play2d(std::string_view filePath, bool loop, float vol if (!_scheduled) { _scheduled = true; - _scheduler->schedule(CC_SCHEDULE_SELECTOR(AudioEngineImpl::update), this, 0.05f, false); + _scheduler->schedule(AX_SCHEDULE_SELECTOR(AudioEngineImpl::update), this, 0.05f, false); } return _currentAudioID; @@ -852,7 +852,7 @@ void AudioEngineImpl::_unscheduleUpdate() if (_scheduled) { _scheduled = false; - _scheduler->unschedule(CC_SCHEDULE_SELECTOR(AudioEngineImpl::update), this); + _scheduler->unschedule(AX_SCHEDULE_SELECTOR(AudioEngineImpl::update), this); } } diff --git a/core/audio/AudioEngineImpl.h b/core/audio/AudioEngineImpl.h index 9ec33a0b16..f8a9c3a342 100644 --- a/core/audio/AudioEngineImpl.h +++ b/core/audio/AudioEngineImpl.h @@ -42,7 +42,7 @@ NS_AX_BEGIN class Scheduler; -class CC_DLL AudioEngineImpl : public axis::Ref +class AX_DLL AudioEngineImpl : public axis::Ref { public: AudioEngineImpl(); diff --git a/core/audio/AudioMacros.h b/core/audio/AudioMacros.h index 5de56024da..4a182f5ef4 100644 --- a/core/audio/AudioMacros.h +++ b/core/audio/AudioMacros.h @@ -37,19 +37,19 @@ #define QUOTEME_(x) #x #define QUOTEME(x) QUOTEME_(x) -// log, CCLOG aren't threadsafe, since we uses sub threads for parsing pcm data, threadsafe log output +// log, AXLOG aren't threadsafe, since we uses sub threads for parsing pcm data, threadsafe log output // is needed. Define the following macros (ALOGV, ALOGD, ALOGI, ALOGW, ALOGE) for threadsafe log output. -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include "base/ccUTF8.h" // for StringUtils::format # define AUDIO_LOG(fmt, ...) OutputDebugStringA(StringUtils::format((fmt "\r\n"), ##__VA_ARGS__).c_str()) -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include # define AUDIO_LOG(fmt, ...) __android_log_print(ANDROID_LOG_DEBUG, "AudioEngine", fmt, ##__VA_ARGS__) #else // other platforms # define AUDIO_LOG(fmt, ...) printf(fmt "\n", ##__VA_ARGS__) #endif -#if defined(COCOS2D_DEBUG) && COCOS2D_DEBUG > 0 +#if defined(AXIS_DEBUG) && AXIS_DEBUG > 0 # define ALOGV(fmt, ...) AUDIO_LOG("V/" LOG_TAG " (" QUOTEME(__LINE__) "): " fmt "", ##__VA_ARGS__) #else # define ALOGV(fmt, ...) \ @@ -62,7 +62,7 @@ #define ALOGW(fmt, ...) AUDIO_LOG("W/" LOG_TAG " (" QUOTEME(__LINE__) "): " fmt "", ##__VA_ARGS__) #define ALOGE(fmt, ...) AUDIO_LOG("E/" LOG_TAG " (" QUOTEME(__LINE__) "): " fmt "", ##__VA_ARGS__) -#if defined(COCOS2D_DEBUG) && COCOS2D_DEBUG > 0 +#if defined(AXIS_DEBUG) && AXIS_DEBUG > 0 # define CHECK_AL_ERROR_DEBUG() \ do \ { \ diff --git a/core/audio/AudioPlayer.cpp b/core/audio/AudioPlayer.cpp index 50ef6bab0b..622c131975 100644 --- a/core/audio/AudioPlayer.cpp +++ b/core/audio/AudioPlayer.cpp @@ -125,7 +125,7 @@ void AudioPlayer::destroy() _rotateBufferThread = nullptr; ALOGVV("rotateBufferThread exited!"); -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS // some specific OpenAL implement defects existed on iOS platform // refer to: https://github.com/cocos2d/cocos2d-x/issues/18597 ALint sourceState; diff --git a/core/audio/AudioPlayer.h b/core/audio/AudioPlayer.h index 048b79fe4e..bb4e19ece2 100644 --- a/core/audio/AudioPlayer.h +++ b/core/audio/AudioPlayer.h @@ -43,7 +43,7 @@ NS_AX_BEGIN class AudioCache; class AudioEngineImpl; -class CC_DLL AudioPlayer +class AX_DLL AudioPlayer { friend class AudioEngineImpl; diff --git a/core/axis.cpp b/core/axis.cpp index f83161bdcc..6e5ab82c80 100644 --- a/core/axis.cpp +++ b/core/axis.cpp @@ -31,12 +31,12 @@ THE SOFTWARE. NS_AX_BEGIN -CC_DLL const char* axisVersion() +AX_DLL const char* axisVersion() { return "axis-1.0.0b9"; } -CC_DLL const char* cocos2dVersion() +AX_DLL const char* cocos2dVersion() { return axisVersion(); } diff --git a/core/axis.h b/core/axis.h index cc115694ff..584ca965eb 100644 --- a/core/axis.h +++ b/core/axis.h @@ -183,13 +183,13 @@ THE SOFTWARE. #include "platform/CCPlatformMacros.h" #include "platform/CCSAXParser.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # include "platform/ios/CCApplication-ios.h" # include "platform/ios/CCGLViewImpl-ios.h" # include "platform/ios/CCStdC-ios.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_IOS -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "platform/android/CCApplication-android.h" # include "platform/android/CCGLViewImpl-android.h" # include "platform/android/CCGL-android.h" @@ -197,27 +197,27 @@ THE SOFTWARE. // Enhance modification begin # include "platform/android/CCEnhanceAPI-android.h" // Enhance modification end -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "platform/win32/CCApplication-win32.h" # include "platform/desktop/CCGLViewImpl-desktop.h" # include "platform/win32/CCGL-win32.h" # include "platform/win32/CCStdC-win32.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # include "platform/desktop/CCGLViewImpl-desktop.h" # include "platform/mac/CCApplication-mac.h" # include "platform/mac/CCStdC-mac.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_MAC -#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) # include "platform/linux/CCApplication-linux.h" # include "platform/desktop/CCGLViewImpl-desktop.h" # include "platform/linux/CCGL-linux.h" # include "platform/linux/CCStdC-linux.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_LINUX // script_support #include "base/CCScriptSupport.h" @@ -272,7 +272,7 @@ THE SOFTWARE. NS_AX_BEGIN -CC_DLL const char* axisVersion(); +AX_DLL const char* axisVersion(); NS_AX_END diff --git a/core/base/CCAsyncTaskPool.h b/core/base/CCAsyncTaskPool.h index da9711419c..27218ccca1 100644 --- a/core/base/CCAsyncTaskPool.h +++ b/core/base/CCAsyncTaskPool.h @@ -50,7 +50,7 @@ NS_AX_BEGIN * @brief This class allows to perform background operations without having to manipulate threads. * @js NA */ -class CC_DLL AsyncTaskPool +class AX_DLL AsyncTaskPool { public: typedef std::function TaskCallBack; @@ -174,7 +174,7 @@ protected: // don't allow enqueueing after stopping the pool if (_stop) { - CC_ASSERT(0 && "already stop"); + AX_ASSERT(0 && "already stop"); return; } diff --git a/core/base/CCAutoreleasePool.cpp b/core/base/CCAutoreleasePool.cpp index 9b7230a57d..62595abc4e 100644 --- a/core/base/CCAutoreleasePool.cpp +++ b/core/base/CCAutoreleasePool.cpp @@ -30,7 +30,7 @@ NS_AX_BEGIN AutoreleasePool::AutoreleasePool() : _name("") -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) +#if defined(AXIS_DEBUG) && (AXIS_DEBUG > 0) , _isClearing(false) #endif { @@ -40,7 +40,7 @@ AutoreleasePool::AutoreleasePool() AutoreleasePool::AutoreleasePool(std::string_view name) : _name(name) -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) +#if defined(AXIS_DEBUG) && (AXIS_DEBUG > 0) , _isClearing(false) #endif { @@ -50,7 +50,7 @@ AutoreleasePool::AutoreleasePool(std::string_view name) AutoreleasePool::~AutoreleasePool() { - CCLOGINFO("deallocing AutoreleasePool: %p", this); + AXLOGINFO("deallocing AutoreleasePool: %p", this); clear(); PoolManager::getInstance()->pop(); @@ -63,7 +63,7 @@ void AutoreleasePool::addObject(Ref* object) void AutoreleasePool::clear() { -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) +#if defined(AXIS_DEBUG) && (AXIS_DEBUG > 0) _isClearing = true; #endif std::vector releasings; @@ -72,7 +72,7 @@ void AutoreleasePool::clear() { obj->release(); } -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) +#if defined(AXIS_DEBUG) && (AXIS_DEBUG > 0) _isClearing = false; #endif } @@ -89,12 +89,12 @@ bool AutoreleasePool::contains(Ref* object) const void AutoreleasePool::dump() { - CCLOG("autorelease pool: %s, number of managed object %d\n", _name.c_str(), + AXLOG("autorelease pool: %s, number of managed object %d\n", _name.c_str(), static_cast(_managedObjectArray.size())); - CCLOG("%20s%20s%20s", "Object pointer", "Object id", "reference count"); + AXLOG("%20s%20s%20s", "Object pointer", "Object id", "reference count"); for (const auto& obj : _managedObjectArray) { - CCLOG("%20p%20u\n", obj, obj->getReferenceCount()); + AXLOG("%20p%20u\n", obj, obj->getReferenceCount()); } } @@ -130,7 +130,7 @@ PoolManager::PoolManager() PoolManager::~PoolManager() { - CCLOGINFO("deallocing PoolManager: %p", this); + AXLOGINFO("deallocing PoolManager: %p", this); while (!_releasePoolStack.empty()) { @@ -162,7 +162,7 @@ void PoolManager::push(AutoreleasePool* pool) void PoolManager::pop() { - CC_ASSERT(!_releasePoolStack.empty()); + AX_ASSERT(!_releasePoolStack.empty()); _releasePoolStack.pop_back(); } diff --git a/core/base/CCAutoreleasePool.h b/core/base/CCAutoreleasePool.h index 583558cde8..d1b308729e 100644 --- a/core/base/CCAutoreleasePool.h +++ b/core/base/CCAutoreleasePool.h @@ -40,7 +40,7 @@ NS_AX_BEGIN * A pool for managing autorelease objects. * @js NA */ -class CC_DLL AutoreleasePool +class AX_DLL AutoreleasePool { public: /** @@ -89,7 +89,7 @@ public: */ void clear(); -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) +#if defined(AXIS_DEBUG) && (AXIS_DEBUG > 0) /** * Whether the autorelease pool is doing `clear` operation. * @@ -135,7 +135,7 @@ private: std::vector _managedObjectArray; std::string _name; -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) +#if defined(AXIS_DEBUG) && (AXIS_DEBUG > 0) /** * The flag for checking whether the pool is doing `clear` operation. */ @@ -149,7 +149,7 @@ private: /** * @cond */ -class CC_DLL PoolManager +class AX_DLL PoolManager { public: static PoolManager* getInstance(); diff --git a/core/base/CCConfiguration.cpp b/core/base/CCConfiguration.cpp index 561fad0d88..dad5d69a12 100644 --- a/core/base/CCConfiguration.cpp +++ b/core/base/CCConfiguration.cpp @@ -68,19 +68,19 @@ bool Configuration::init() { _valueDict["axis.version"] = Value(axisVersion()); -#if CC_ENABLE_PROFILERS +#if AX_ENABLE_PROFILERS _valueDict["axis.compiled_with_profiler"] = Value(true); #else _valueDict["axis.compiled_with_profiler"] = Value(false); #endif -#if CC_ENABLE_GL_STATE_CACHE == 0 +#if AX_ENABLE_GL_STATE_CACHE == 0 _valueDict["axis.compiled_with_gl_state_cache"] = Value(false); #else _valueDict["axis.compiled_with_gl_state_cache"] = Value(true); #endif -#if COCOS2D_DEBUG +#if AXIS_DEBUG _valueDict["axis.build_type"] = Value("DEBUG"); #else _valueDict["axis.build_type"] = Value("RELEASE"); @@ -91,21 +91,21 @@ bool Configuration::init() Configuration::~Configuration() { - CC_SAFE_DELETE(_loadedEvent); + AX_SAFE_DELETE(_loadedEvent); } std::string Configuration::getInfo() const { // And Dump some warnings as well -#if CC_ENABLE_PROFILERS - CCLOG( - "cocos2d: **** WARNING **** CC_ENABLE_PROFILERS is defined. Disable it when you finish profiling (from " +#if AX_ENABLE_PROFILERS + AXLOG( + "cocos2d: **** WARNING **** AX_ENABLE_PROFILERS is defined. Disable it when you finish profiling (from " "ccConfig.h)\n"); #endif -#if CC_ENABLE_GL_STATE_CACHE == 0 - CCLOG( - "cocos2d: **** WARNING **** CC_ENABLE_GL_STATE_CACHE is disabled. To improve performance, enable it (from " +#if AX_ENABLE_GL_STATE_CACHE == 0 + AXLOG( + "cocos2d: **** WARNING **** AX_ENABLE_GL_STATE_CACHE is disabled. To improve performance, enable it (from " "ccConfig.h)\n"); #endif @@ -117,7 +117,7 @@ std::string Configuration::getInfo() const void Configuration::gatherGPUInfo() { auto _deviceInfo = backend::Device::getInstance()->getDeviceInfo(); - CCLOG("Supported extensions: %s", _deviceInfo->getExtension()); + AXLOG("Supported extensions: %s", _deviceInfo->getExtension()); _valueDict["vendor"] = Value(_deviceInfo->getVendor()); _valueDict["renderer"] = Value(_deviceInfo->getRenderer()); @@ -183,7 +183,7 @@ Configuration* Configuration::getInstance() void Configuration::destroyInstance() { - CC_SAFE_RELEASE_NULL(s_sharedConfiguration); + AX_SAFE_RELEASE_NULL(s_sharedConfiguration); } bool Configuration::checkForGLExtension(std::string_view searchName) const @@ -259,7 +259,7 @@ bool Configuration::supportsDiscardFramebuffer() const bool Configuration::supportsShareableVAO() const { -#if CC_TEXTURE_ATLAS_USE_VAO +#if AX_TEXTURE_ATLAS_USE_VAO return _supportsShareableVAO; #else return false; @@ -276,7 +276,7 @@ bool Configuration::supportsMapBuffer() const // is always implemented in OpenGL. // XXX: Warning. On iOS this is always `true`. Avoiding the comparison. -#if defined(CC_USE_GLES) && !defined(__APPLE__) +#if defined(AX_USE_GLES) && !defined(__APPLE__) return _supportsOESMapBuffer; #else return true; @@ -335,7 +335,7 @@ void Configuration::setValue(std::string_view key, const Value& value) void Configuration::loadConfigFile(std::string_view filename) { ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(filename); - CCASSERT(!dict.empty(), "cannot create dictionary"); + AXASSERT(!dict.empty(), "cannot create dictionary"); // search for metadata bool validMetadata = false; @@ -360,14 +360,14 @@ void Configuration::loadConfigFile(std::string_view filename) if (!validMetadata) { - CCLOG("Invalid config format for file: %s", filename.data()); + AXLOG("Invalid config format for file: %s", filename.data()); return; } auto dataIter = dict.find("data"); if (dataIter == dict.cend() || dataIter->second.getType() != Value::Type::MAP) { - CCLOG("Expected 'data' dict, but not found. Config file: %s", filename.data()); + AXLOG("Expected 'data' dict, but not found. Config file: %s", filename.data()); return; } @@ -379,7 +379,7 @@ void Configuration::loadConfigFile(std::string_view filename) if (_valueDict.find(dataMapIter.first) == _valueDict.cend()) _valueDict[dataMapIter.first] = dataMapIter.second; else - CCLOG("Key already present. Ignoring '%s'", dataMapIter.first.c_str()); + AXLOG("Key already present. Ignoring '%s'", dataMapIter.first.c_str()); } // light info diff --git a/core/base/CCConfiguration.h b/core/base/CCConfiguration.h index 254181c40f..fa6012c1a1 100644 --- a/core/base/CCConfiguration.h +++ b/core/base/CCConfiguration.h @@ -47,7 +47,7 @@ class EventCustom; * @since v0.99.0 * @js NA */ -class CC_DLL Configuration : public Ref +class AX_DLL Configuration : public Ref { public: /** Returns a shared instance of Configuration. diff --git a/core/base/CCConsole.cpp b/core/base/CCConsole.cpp index a4d353ce00..996603cd6a 100644 --- a/core/base/CCConsole.cpp +++ b/core/base/CCConsole.cpp @@ -60,12 +60,12 @@ // !FIXME: the previous version of axis::log not thread safe // since axis make it multi-threading safe by default -#if !defined(CC_LOG_MULTITHREAD) -# define CC_LOG_MULTITHREAD 1 +#if !defined(AX_LOG_MULTITHREAD) +# define AX_LOG_MULTITHREAD 1 #endif -#if !defined(CC_LOG_TO_CONSOLE) -# define CC_LOG_TO_CONSOLE 1 +#if !defined(AX_LOG_TO_CONSOLE) +# define AX_LOG_TO_CONSOLE 1 #endif NS_AX_BEGIN @@ -102,13 +102,13 @@ const char* inet_ntop(int af, const void* src, char* dst, int cnt) // Free functions to log // -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) void SendLogToWindow(const char* log) { - static const int CCLOG_STRING_TAG = 1; + static const int AXLOG_STRING_TAG = 1; // Send data as a message COPYDATASTRUCT myCDS; - myCDS.dwData = CCLOG_STRING_TAG; + myCDS.dwData = AXLOG_STRING_TAG; myCDS.cbData = (DWORD)strlen(log) + 1; myCDS.lpData = (PVOID)log; if (Director::getInstance()->getOpenGLView()) @@ -123,17 +123,17 @@ void SendLogToWindow(const char* log) void log(const char* format, ...) { -#define CC_VSNPRINTF_BUFFER_LENGTH 512 +#define AX_VSNPRINTF_BUFFER_LENGTH 512 va_list args; va_start(args, format); auto buf = StringUtils::vformat(format, args); va_end(args); -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID __android_log_print(ANDROID_LOG_DEBUG, "axis debug info", "%s", buf.c_str()); -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 buf.push_back('\n'); // print to debugger output window @@ -141,7 +141,7 @@ void log(const char* format, ...) OutputDebugStringW(wbuf.c_str()); -# if CC_LOG_TO_CONSOLE +# if AX_LOG_TO_CONSOLE auto hStdout = ::GetStdHandle(STD_OUTPUT_HANDLE); if (hStdout) { @@ -153,7 +153,7 @@ void log(const char* format, ...) } # endif -# if !CC_LOG_MULTITHREAD +# if !AX_LOG_MULTITHREAD // print to log window SendLogToWindow(buf.c_str()); # endif @@ -164,7 +164,7 @@ void log(const char* format, ...) fflush(stdout); #endif -#if !CC_LOG_MULTITHREAD +#if !AX_LOG_MULTITHREAD Director::getInstance()->getConsole()->log(buf.c_str()); #endif } @@ -502,14 +502,14 @@ bool Console::listenOnTCP(int port) hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) WSADATA wsaData; n = WSAStartup(MAKEWORD(2, 2), &wsaData); #endif if ((n = getaddrinfo(nullptr, serv, &hints, &res)) != 0) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) fprintf(stderr, "net_listen error for %s: %s", serv, gai_strerrorA(n)); #else fprintf(stderr, "net_listen error for %s: %s", serv, gai_strerror(n)); @@ -546,7 +546,7 @@ bool Console::listenOnTCP(int port) break; /* success */ /* bind error, close and try next one */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) closesocket(listenfd); #else close(listenfd); @@ -769,7 +769,7 @@ void Console::loop() // receive a SIGPIPE, which will cause linux system shutdown the sending process. // Add this ioctl code to check if the socket has been closed by peer. -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) u_long n = 0; ioctlsocket(fd, FIONREAD, &n); #else @@ -826,14 +826,14 @@ void Console::loop() // clean up: ignore stdin, stdout and stderr for (const auto& fd : _fds) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) closesocket(fd); #else close(fd); #endif } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) closesocket(_listenfd); WSACleanup(); #else @@ -1028,7 +1028,7 @@ void Console::addClient() * * The default behaviour for this signal is to end the process.So we make the process ignore SIGPIPE. */ -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS int set = 1; setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int)); #endif @@ -1042,24 +1042,24 @@ void Console::addClient() void Console::createCommandAllocator() { addCommand({"allocator", "Display allocator diagnostics for all allocators. Args: [-h | help | ]", - CC_CALLBACK_2(Console::commandAllocator, this)}); + AX_CALLBACK_2(Console::commandAllocator, this)}); } void Console::createCommandConfig() { addCommand({"config", "Print the Configuration object. Args: [-h | help | ]", - CC_CALLBACK_2(Console::commandConfig, this)}); + AX_CALLBACK_2(Console::commandConfig, this)}); } void Console::createCommandDebugMsg() { addCommand({"debugmsg", "Whether or not to forward the debug messages on the console. Args: [-h | help | on | off | ]", - CC_CALLBACK_2(Console::commandDebugMsg, this)}); + AX_CALLBACK_2(Console::commandDebugMsg, this)}); addSubCommand("debugmsg", - {"on", "enable debug logging", CC_CALLBACK_2(Console::commandDebugMsgSubCommandOnOff, this)}); + {"on", "enable debug logging", AX_CALLBACK_2(Console::commandDebugMsgSubCommandOnOff, this)}); addSubCommand("debugmsg", - {"off", "disable debug logging", CC_CALLBACK_2(Console::commandDebugMsgSubCommandOnOff, this)}); + {"off", "disable debug logging", AX_CALLBACK_2(Console::commandDebugMsgSubCommandOnOff, this)}); } void Console::createCommandDirector() @@ -1067,96 +1067,96 @@ void Console::createCommandDirector() addCommand({"director", "director commands, type -h or [director help] to list supported directives"}); addSubCommand("director", {"pause", "pause all scheduled timers, the draw rate will be 4 FPS to reduce CPU consumption", - CC_CALLBACK_2(Console::commandDirectorSubCommandPause, this)}); + AX_CALLBACK_2(Console::commandDirectorSubCommandPause, this)}); addSubCommand("director", {"resume", "resume all scheduled timers", - CC_CALLBACK_2(Console::commandDirectorSubCommandResume, this)}); + AX_CALLBACK_2(Console::commandDirectorSubCommandResume, this)}); addSubCommand("director", {"stop", "Stops the animation. Nothing will be drawn.", - CC_CALLBACK_2(Console::commandDirectorSubCommandStop, this)}); + AX_CALLBACK_2(Console::commandDirectorSubCommandStop, this)}); addSubCommand( "director", {"start", "Restart the animation again, Call this function only if [director stop] was called earlier", - CC_CALLBACK_2(Console::commandDirectorSubCommandStart, this)}); - addSubCommand("director", {"end", "exit this app.", CC_CALLBACK_2(Console::commandDirectorSubCommandEnd, this)}); + AX_CALLBACK_2(Console::commandDirectorSubCommandStart, this)}); + addSubCommand("director", {"end", "exit this app.", AX_CALLBACK_2(Console::commandDirectorSubCommandEnd, this)}); } void Console::createCommandExit() { addCommand( - {"exit", "Close connection to the console. Args: [-h | help | ]", CC_CALLBACK_2(Console::commandExit, this)}); + {"exit", "Close connection to the console. Args: [-h | help | ]", AX_CALLBACK_2(Console::commandExit, this)}); } void Console::createCommandFileUtils() { addCommand({"fileutils", "Flush or print the FileUtils info. Args: [-h | help | flush | ]", - CC_CALLBACK_2(Console::commandFileUtils, this)}); + AX_CALLBACK_2(Console::commandFileUtils, this)}); addSubCommand("fileutils", {"flush", "Purges the file searching cache.", - CC_CALLBACK_2(Console::commandFileUtilsSubCommandFlush, this)}); + AX_CALLBACK_2(Console::commandFileUtilsSubCommandFlush, this)}); } void Console::createCommandFps() { addCommand( - {"fps", "Turn on / off the FPS. Args: [-h | help | on | off | ]", CC_CALLBACK_2(Console::commandFps, this)}); + {"fps", "Turn on / off the FPS. Args: [-h | help | on | off | ]", AX_CALLBACK_2(Console::commandFps, this)}); addSubCommand("fps", {"on", "Display the FPS on the bottom-left corner.", - CC_CALLBACK_2(Console::commandFpsSubCommandOnOff, this)}); + AX_CALLBACK_2(Console::commandFpsSubCommandOnOff, this)}); addSubCommand("fps", {"off", "Hide the FPS on the bottom-left corner.", - CC_CALLBACK_2(Console::commandFpsSubCommandOnOff, this)}); + AX_CALLBACK_2(Console::commandFpsSubCommandOnOff, this)}); } void Console::createCommandHelp() { - addCommand({"help", "Print this message. Args: [ ]", CC_CALLBACK_2(Console::commandHelp, this)}); + addCommand({"help", "Print this message. Args: [ ]", AX_CALLBACK_2(Console::commandHelp, this)}); } void Console::createCommandProjection() { addCommand({"projection", "Change or print the current projection. Args: [-h | help | 2d | 3d | ]", - CC_CALLBACK_2(Console::commandProjection, this)}); + AX_CALLBACK_2(Console::commandProjection, this)}); addSubCommand("projection", {"2d", "sets a 2D projection (orthogonal projection).", - CC_CALLBACK_2(Console::commandProjectionSubCommand2d, this)}); + AX_CALLBACK_2(Console::commandProjectionSubCommand2d, this)}); addSubCommand("projection", {"3d", "sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500.", - CC_CALLBACK_2(Console::commandProjectionSubCommand3d, this)}); + AX_CALLBACK_2(Console::commandProjectionSubCommand3d, this)}); } void Console::createCommandResolution() { addCommand({"resolution", "Change or print the window resolution. Args: [-h | help | width height resolution_policy | ]", - CC_CALLBACK_2(Console::commandResolution, this)}); - addSubCommand("resolution", {"", "", CC_CALLBACK_2(Console::commandResolutionSubCommandEmpty, this)}); + AX_CALLBACK_2(Console::commandResolution, this)}); + addSubCommand("resolution", {"", "", AX_CALLBACK_2(Console::commandResolutionSubCommandEmpty, this)}); } void Console::createCommandSceneGraph() { - addCommand({"scenegraph", "Print the scene graph", CC_CALLBACK_2(Console::commandSceneGraph, this)}); + addCommand({"scenegraph", "Print the scene graph", AX_CALLBACK_2(Console::commandSceneGraph, this)}); } void Console::createCommandTexture() { addCommand({"texture", "Flush or print the TextureCache info. Args: [-h | help | flush | ] ", - CC_CALLBACK_2(Console::commandTextures, this)}); + AX_CALLBACK_2(Console::commandTextures, this)}); addSubCommand("texture", {"flush", "Purges the dictionary of loaded textures.", - CC_CALLBACK_2(Console::commandTexturesSubCommandFlush, this)}); + AX_CALLBACK_2(Console::commandTexturesSubCommandFlush, this)}); } void Console::createCommandTouch() { addCommand({"touch", "simulate touch event via console, type -h or [touch help] to list supported directives"}); addSubCommand("touch", {"tap", "touch tap x y: simulate touch tap at (x,y).", - CC_CALLBACK_2(Console::commandTouchSubCommandTap, this)}); + AX_CALLBACK_2(Console::commandTouchSubCommandTap, this)}); addSubCommand("touch", {"swipe", "touch swipe x1 y1 x2 y2: simulate touch swipe from (x1,y1) to (x2,y2).", - CC_CALLBACK_2(Console::commandTouchSubCommandSwipe, this)}); + AX_CALLBACK_2(Console::commandTouchSubCommandSwipe, this)}); } void Console::createCommandUpload() { addCommand( - {"upload", "upload file. Args: [filename base64_encoded_data]", CC_CALLBACK_1(Console::commandUpload, this)}); + {"upload", "upload file. Args: [filename base64_encoded_data]", AX_CALLBACK_1(Console::commandUpload, this)}); } void Console::createCommandVersion() { - addCommand({"version", "print version string ", CC_CALLBACK_2(Console::commandVersion, this)}); + addCommand({"version", "print version string ", AX_CALLBACK_2(Console::commandVersion, this)}); } // @@ -1165,12 +1165,12 @@ void Console::createCommandVersion() void Console::commandAllocator(socket_native_type fd, std::string_view /*args*/) { -#if CC_ENABLE_ALLOCATOR_DIAGNOSTICS +#if AX_ENABLE_ALLOCATOR_DIAGNOSTICS auto info = allocator::AllocatorDiagnostics::instance()->diagnostics(); Console::Utility::mydprintf(fd, info.c_str()); #else Console::Utility::mydprintf( - fd, "allocator diagnostics not available. CC_ENABLE_ALLOCATOR_DIAGNOSTICS must be set to 1 in ccConfig.h\n"); + fd, "allocator diagnostics not available. AX_ENABLE_ALLOCATOR_DIAGNOSTICS must be set to 1 in ccConfig.h\n"); #endif } @@ -1229,7 +1229,7 @@ void Console::commandExit(socket_native_type fd, std::string_view /*args*/) { FD_CLR(fd, &_read_set); _fds.erase(std::remove(_fds.begin(), _fds.end(), fd), _fds.end()); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) closesocket(fd); #else close(fd); diff --git a/core/base/CCConsole.h b/core/base/CCConsole.h index dd0f20ad7d..e5e38a782f 100644 --- a/core/base/CCConsole.h +++ b/core/base/CCConsole.h @@ -57,7 +57,7 @@ static const int MAX_LOG_LENGTH = 16 * 1024; /** @brief Output Debug message. */ -void CC_DLL log(const char* format, ...) CC_FORMAT_PRINTF(1, 2); +void AX_DLL log(const char* format, ...) AX_FORMAT_PRINTF(1, 2); /** Console is helper class that lets the developer control the game from TCP connection. Console will spawn a new thread that will listen to a specified TCP port. @@ -69,7 +69,7 @@ void CC_DLL log(const char* format, ...) CC_FORMAT_PRINTF(1, 2); ``` */ -class CC_DLL Console : public Ref +class AX_DLL Console : public Ref { public: /** Console Utils */ @@ -108,7 +108,7 @@ public: }; /** Command Struct */ - class CC_DLL Command + class AX_DLL Command { public: using Callback = std::function; @@ -208,7 +208,7 @@ public: bool isIpv6Server() const; /** The command separator */ - CC_SYNTHESIZE(char, _commandSeparator, CommandSeparator); + AX_SYNTHESIZE(char, _commandSeparator, CommandSeparator); protected: // Main Loop @@ -291,7 +291,7 @@ protected: std::string _bindAddress; private: - CC_DISALLOW_COPY_AND_ASSIGN(Console); + AX_DISALLOW_COPY_AND_ASSIGN(Console); // helper functions int printSceneGraph(socket_native_type fd, Node* node, int level); diff --git a/core/base/CCController-android.cpp b/core/base/CCController-android.cpp index 7a1c3dcf9b..6c7f72ce83 100644 --- a/core/base/CCController-android.cpp +++ b/core/base/CCController-android.cpp @@ -26,7 +26,7 @@ #include "base/CCController.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include # include "base/ccMacros.h" # include "base/CCDirector.h" @@ -53,7 +53,7 @@ public: static void onConnected(std::string_view deviceName, int deviceId) { // Check whether the controller is already connected. - CCLOG("onConnected %s,%d", deviceName.data(), deviceId); + AXLOG("onConnected %s,%d", deviceName.data(), deviceId); auto iter = findController(deviceName, deviceId); if (iter != Controller::s_allController.end()) @@ -70,12 +70,12 @@ public: static void onDisconnected(std::string_view deviceName, int deviceId) { - CCLOG("onDisconnected %s,%d", deviceName.data(), deviceId); + AXLOG("onDisconnected %s,%d", deviceName.data(), deviceId); auto iter = findController(deviceName, deviceId); if (iter == Controller::s_allController.end()) { - CCLOGERROR("Could not find the controller!"); + AXLOGERROR("Could not find the controller!"); return; } @@ -93,7 +93,7 @@ public: auto iter = findController(deviceName, deviceId); if (iter == Controller::s_allController.end()) { - CCLOG("onButtonEvent:connect new controller."); + AXLOG("onButtonEvent:connect new controller."); onConnected(deviceName, deviceId); iter = findController(deviceName, deviceId); } @@ -106,7 +106,7 @@ public: auto iter = findController(deviceName, deviceId); if (iter == Controller::s_allController.end()) { - CCLOG("onAxisEvent:connect new controller."); + AXLOG("onAxisEvent:connect new controller."); onConnected(deviceName, deviceId); iter = findController(deviceName, deviceId); } @@ -172,7 +172,7 @@ JNIEXPORT void JNICALL Java_org_cocos2dx_lib_GameControllerAdapter_nativeControl jstring deviceName, jint controllerID) { - CCLOG("controller id: %d connected!", controllerID); + AXLOG("controller id: %d connected!", controllerID); axis::ControllerImpl::onConnected(axis::JniHelper::jstring2string(deviceName), controllerID); } @@ -181,7 +181,7 @@ JNIEXPORT void JNICALL Java_org_cocos2dx_lib_GameControllerAdapter_nativeControl jstring deviceName, jint controllerID) { - CCLOG("controller id: %d disconnected!", controllerID); + AXLOG("controller id: %d disconnected!", controllerID); axis::ControllerImpl::onDisconnected(axis::JniHelper::jstring2string(deviceName), controllerID); } @@ -212,4 +212,4 @@ JNIEXPORT void JNICALL Java_org_cocos2dx_lib_GameControllerAdapter_nativeControl } // extern "C" { -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) diff --git a/core/base/CCController-apple.mm b/core/base/CCController-apple.mm index 203d4500bc..7be0fb7366 100644 --- a/core/base/CCController-apple.mm +++ b/core/base/CCController-apple.mm @@ -26,7 +26,7 @@ #include "base/CCController.h" #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # include "base/ccMacros.h" # include "base/CCEventDispatcher.h" @@ -325,7 +325,7 @@ void Controller::registerListeners() } }; } -# if defined(CC_TARGET_OS_TVOS) +# if defined(AX_TARGET_OS_TVOS) else if (_impl->_gcController.microGamepad != nil) { _impl->_gcController.microGamepad.dpad.up.valueChangedHandler = @@ -386,4 +386,4 @@ void Controller::receiveExternalKeyEvent(int externalKeyCode, bool receive) {} NS_AX_END -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) diff --git a/core/base/CCController-linux-win32.cpp b/core/base/CCController-linux-win32.cpp index c33aa4f7eb..ef47c412b5 100644 --- a/core/base/CCController-linux-win32.cpp +++ b/core/base/CCController-linux-win32.cpp @@ -27,7 +27,7 @@ THE SOFTWARE. #include "base/CCController.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include # include "base/ccMacros.h" # include "base/CCDirector.h" @@ -37,7 +37,7 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL ControllerImpl +class AX_DLL ControllerImpl { public: ControllerImpl() @@ -4222,14 +4222,14 @@ public: if (deviceName.compare(it.first) == 0) { // Found controller profile. Attach it to the controller: - CCLOG("ControllerImpl: Found input profile for controller: %s", deviceName.data()); + AXLOG("ControllerImpl: Found input profile for controller: %s", deviceName.data()); controller->_buttonInputMap = it.second.first; controller->_axisInputMap = it.second.second; // Show a one-time warning in debug mode for every button that's currently not matched in the input profile. // This will let the developers know that the mapping must be included in the constructor of ControllerImpl located // above. -# ifdef COCOS2D_DEBUG +# ifdef AXIS_DEBUG int count; glfwGetJoystickButtons(deviceId, &count); for (int i = 0; i < count; ++i) @@ -4238,7 +4238,7 @@ public: const auto& it = controller->_buttonInputMap.find(i); if (it == controller->_buttonInputMap.end()) { - CCLOG( + AXLOG( "ControllerImpl: Could not find a button input mapping for controller \"%s\", and keyCode " "\"%d\". This keyCode will not match any from Controller::Key", controller->getDeviceName().data(), i); @@ -4252,7 +4252,7 @@ public: const auto& it = controller->_axisInputMap.find(i); if (it == controller->_axisInputMap.end()) { - CCLOG( + AXLOG( "ControllerImpl: Could not find an axis input mapping for controller \"%s\", and keyCode " "\"%d\". This keyCode will not match any from Controller::Key", controller->getDeviceName().data(), i); @@ -4265,15 +4265,15 @@ public: } // Show a warning if the controller input profile is non-existent: -# ifdef COCOS2D_DEBUG +# ifdef AXIS_DEBUG if (controller->_buttonInputMap.empty()) { - CCLOG("ControllerImpl: Could not find a button input map for controller: %s", deviceName.data()); + AXLOG("ControllerImpl: Could not find a button input map for controller: %s", deviceName.data()); } if (controller->_axisInputMap.empty()) { - CCLOG("ControllerImpl: Could not find an axis input map for controller: %s", deviceName.data()); + AXLOG("ControllerImpl: Could not find an axis input map for controller: %s", deviceName.data()); } # endif @@ -4286,7 +4286,7 @@ public: auto iter = findController(deviceId); if (iter == Controller::s_allController.end()) { - CCLOGERROR("ControllerImpl Error: Could not find the controller!"); + AXLOGERROR("ControllerImpl Error: Could not find the controller!"); return; } @@ -4299,7 +4299,7 @@ public: auto iter = findController(deviceId); if (iter == Controller::s_allController.end()) { - CCLOG("ControllerImpl::onButtonEvent: new controller detected. Registering..."); + AXLOG("ControllerImpl::onButtonEvent: new controller detected. Registering..."); onConnected(glfwGetJoystickName(deviceId), deviceId); iter = findController(deviceId); } @@ -4312,7 +4312,7 @@ public: auto iter = findController(deviceId); if (iter == Controller::s_allController.end()) { - CCLOG("ControllerImpl::onAxisEvent: new controller detected. Registering..."); + AXLOG("ControllerImpl::onAxisEvent: new controller detected. Registering..."); onConnected(glfwGetJoystickName(deviceId), deviceId); iter = findController(deviceId); } @@ -4332,10 +4332,10 @@ public: { ControllerImpl::getInstance()->onDisconnected(deviceId); } -# ifdef COCOS2D_DEBUG +# ifdef AXIS_DEBUG else { - CCLOG("ControllerImpl: Unhandled GLFW joystick event: %d", event); + AXLOG("ControllerImpl: Unhandled GLFW joystick event: %d", event); } # endif } @@ -4454,4 +4454,4 @@ Controller::~Controller() NS_AX_END -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) diff --git a/core/base/CCController.cpp b/core/base/CCController.cpp index 455b3c68bd..aeaadb11b8 100644 --- a/core/base/CCController.cpp +++ b/core/base/CCController.cpp @@ -26,9 +26,9 @@ #include "base/CCController.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "base/CCEventDispatcher.h" # include "base/CCEventController.h" @@ -127,5 +127,5 @@ void Controller::onAxisEvent(int axisCode, float value, bool isAnalog) NS_AX_END -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == - // CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif // (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == + // AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) diff --git a/core/base/CCController.h b/core/base/CCController.h index 5877e34174..7ecc8d99b7 100644 --- a/core/base/CCController.h +++ b/core/base/CCController.h @@ -25,9 +25,9 @@ #ifndef __cocos2d_libs__CCController__ #define __cocos2d_libs__CCController__ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "platform/CCPlatformMacros.h" # include @@ -51,7 +51,7 @@ class EventDispatcher; * @brief A Controller object represents a connected physical game controller. * @js NA */ -class CC_DLL Controller +class AX_DLL Controller { public: /** @@ -223,7 +223,7 @@ private: EventController* _keyEvent; EventController* _axisEvent; -# if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +# if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) // FIXME: Once GLFW 3.3 is bundled with cocos2d-x, remove these unordered // maps. They won't be needed. We will only need to provide a mapping from // the GLFW gamepad key codes to the Controller::Key. diff --git a/core/base/CCData.cpp b/core/base/CCData.cpp index 2e369c184a..497689eadc 100644 --- a/core/base/CCData.cpp +++ b/core/base/CCData.cpp @@ -33,18 +33,18 @@ const Data Data::Null; Data::Data() : _bytes(nullptr), _size(0) { - CCLOGINFO("In the empty constructor of Data."); + AXLOGINFO("In the empty constructor of Data."); } Data::Data(Data&& other) : _bytes(nullptr), _size(0) { - CCLOGINFO("In the move constructor of Data."); + AXLOGINFO("In the move constructor of Data."); move(other); } Data::Data(const Data& other) : _bytes(nullptr), _size(0) { - CCLOGINFO("In the copy constructor of Data."); + AXLOGINFO("In the copy constructor of Data."); if (other._bytes && other._size) { copy(other._bytes, other._size); @@ -53,7 +53,7 @@ Data::Data(const Data& other) : _bytes(nullptr), _size(0) Data::~Data() { - CCLOGINFO("deallocing Data: %p", this); + AXLOGINFO("deallocing Data: %p", this); clear(); } @@ -61,7 +61,7 @@ Data& Data::operator=(const Data& other) { if (this != &other) { - CCLOGINFO("In the copy assignment of Data."); + AXLOGINFO("In the copy assignment of Data."); copy(other._bytes, other._size); } return *this; @@ -71,7 +71,7 @@ Data& Data::operator=(Data&& other) { if (this != &other) { - CCLOGINFO("In the move assignment of Data."); + AXLOGINFO("In the move assignment of Data."); move(other); } return *this; @@ -106,8 +106,8 @@ ssize_t Data::getSize() const ssize_t Data::copy(const unsigned char* bytes, const ssize_t size) { - CCASSERT(size >= 0, "copy size should be non-negative"); - CCASSERT(bytes, "bytes should not be nullptr"); + AXASSERT(size >= 0, "copy size should be non-negative"); + AXASSERT(bytes, "bytes should not be nullptr"); if (size <= 0) return 0; @@ -138,8 +138,8 @@ uint8_t* Data::resize(ssize_t size) void Data::fastSet(uint8_t* bytes, const ssize_t size) { - CCASSERT(size >= 0, "fastSet size should be non-negative"); - // CCASSERT(bytes, "bytes should not be nullptr"); + AXASSERT(size >= 0, "fastSet size should be non-negative"); + // AXASSERT(bytes, "bytes should not be nullptr"); _bytes = bytes; _size = size; } diff --git a/core/base/CCData.h b/core/base/CCData.h index 95b465a164..91735bd848 100644 --- a/core/base/CCData.h +++ b/core/base/CCData.h @@ -39,7 +39,7 @@ */ NS_AX_BEGIN -class CC_DLL Data +class AX_DLL Data { friend class Properties; diff --git a/core/base/CCDirector.cpp b/core/base/CCDirector.cpp index d0df40eded..cc507ce8ed 100644 --- a/core/base/CCDirector.cpp +++ b/core/base/CCDirector.cpp @@ -63,7 +63,7 @@ THE SOFTWARE. #include "renderer/backend/ProgramCache.h" #include "audio/AudioEngine.h" -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING # include "base/CCScriptSupport.h" #endif @@ -92,7 +92,7 @@ Director* Director::getInstance() if (!s_SharedDirector) { s_SharedDirector = new Director; - CCASSERT(s_SharedDirector, "FATAL: Not enough memory"); + AXASSERT(s_SharedDirector, "FATAL: Not enough memory"); s_SharedDirector->init(); } @@ -148,42 +148,42 @@ bool Director::init() Director::~Director() { - CCLOGINFO("deallocing Director: %p", this); + AXLOGINFO("deallocing Director: %p", this); - CC_SAFE_RELEASE(_FPSLabel); - CC_SAFE_RELEASE(_drawnVerticesLabel); - CC_SAFE_RELEASE(_drawnBatchesLabel); + AX_SAFE_RELEASE(_FPSLabel); + AX_SAFE_RELEASE(_drawnVerticesLabel); + AX_SAFE_RELEASE(_drawnBatchesLabel); - CC_SAFE_RELEASE(_runningScene); - CC_SAFE_RELEASE(_notificationNode); - CC_SAFE_RELEASE(_scheduler); - CC_SAFE_RELEASE(_actionManager); + AX_SAFE_RELEASE(_runningScene); + AX_SAFE_RELEASE(_notificationNode); + AX_SAFE_RELEASE(_scheduler); + AX_SAFE_RELEASE(_actionManager); - CC_SAFE_RELEASE(_beforeSetNextScene); - CC_SAFE_RELEASE(_afterSetNextScene); - CC_SAFE_RELEASE(_eventBeforeUpdate); - CC_SAFE_RELEASE(_eventAfterUpdate); - CC_SAFE_RELEASE(_eventAfterDraw); - CC_SAFE_RELEASE(_eventBeforeDraw); - CC_SAFE_RELEASE(_eventAfterVisit); - CC_SAFE_RELEASE(_eventProjectionChanged); - CC_SAFE_RELEASE(_eventResetDirector); + AX_SAFE_RELEASE(_beforeSetNextScene); + AX_SAFE_RELEASE(_afterSetNextScene); + AX_SAFE_RELEASE(_eventBeforeUpdate); + AX_SAFE_RELEASE(_eventAfterUpdate); + AX_SAFE_RELEASE(_eventAfterDraw); + AX_SAFE_RELEASE(_eventBeforeDraw); + AX_SAFE_RELEASE(_eventAfterVisit); + AX_SAFE_RELEASE(_eventProjectionChanged); + AX_SAFE_RELEASE(_eventResetDirector); delete _renderer; delete _console; - CC_SAFE_RELEASE(_eventDispatcher); + AX_SAFE_RELEASE(_eventDispatcher); Configuration::destroyInstance(); ObjectFactory::destroyInstance(); s_SharedDirector = nullptr; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEngineManager::destroyInstance(); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) exit(0); #endif } @@ -208,7 +208,7 @@ void Director::setDefaultValues() else if (projection == "custom") _projection = Projection::CUSTOM; else - CCASSERT(false, "Invalid projection value"); + AXASSERT(false, "Invalid projection value"); // Default pixel format for PNG images with alpha std::string pixel_format = conf->getValue("axis.texture.pixel_format_for_png", Value("rgba8888")).asString(); @@ -241,7 +241,7 @@ void Director::setDefaultValues() void Director::setGLDefaultValues() { // This method SHOULD be called only after openGLView_ was initialized - CCASSERT(_openGLView, "opengl view should not be null"); + AXASSERT(_openGLView, "opengl view should not be null"); _renderer->setDepthTest(false); _renderer->setDepthCompareFunction(backend::CompareFunction::LESS_EQUAL); @@ -285,7 +285,7 @@ void Director::drawScene() if (_runningScene) { -#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION) || CC_USE_NAVMESH) +#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION) || AX_USE_NAVMESH) _runningScene->stepPhysicsAndNavigation(_deltaTime); #endif // clear draw stats @@ -308,7 +308,7 @@ void Director::drawScene() if (_statsDisplay) { -#if !CC_STRIP_FPS +#if !AX_STRIP_FPS showStats(); #endif } @@ -331,7 +331,7 @@ void Director::drawScene() if (_statsDisplay) { -#if !CC_STRIP_FPS +#if !AX_STRIP_FPS calculateMPF(); #endif } @@ -358,7 +358,7 @@ void Director::calculateDeltaTime() _deltaTime = MAX(0, _deltaTime); } -#if COCOS2D_DEBUG +#if AXIS_DEBUG // If we are debugging our code, prevent big delta time if (_deltaTime > 0.2f) { @@ -373,14 +373,14 @@ float Director::getDeltaTime() const } void Director::setOpenGLView(GLView* openGLView) { - CCASSERT(openGLView, "opengl view should not be null"); + AXASSERT(openGLView, "opengl view should not be null"); if (_openGLView != openGLView) { // Configuration. Gather GPU info Configuration* conf = Configuration::getInstance(); conf->gatherGPUInfo(); - CCLOG("%s\n", conf->getInfo().c_str()); + AXLOG("%s\n", conf->getInfo().c_str()); if (_openGLView) _openGLView->release(); @@ -421,7 +421,7 @@ void Director::destroyTextureCache() if (_textureCache) { _textureCache->waitForQuit(); - CC_SAFE_RELEASE_NULL(_textureCache); + AX_SAFE_RELEASE_NULL(_textureCache); } } @@ -487,7 +487,7 @@ void Director::popMatrix(MATRIX_STACK_TYPE type) } else { - CCASSERT(false, "unknown matrix stack type"); + AXASSERT(false, "unknown matrix stack type"); } } @@ -507,7 +507,7 @@ void Director::loadIdentityMatrix(MATRIX_STACK_TYPE type) } else { - CCASSERT(false, "unknown matrix stack type"); + AXASSERT(false, "unknown matrix stack type"); } } @@ -527,7 +527,7 @@ void Director::loadMatrix(MATRIX_STACK_TYPE type, const Mat4& mat) } else { - CCASSERT(false, "unknown matrix stack type"); + AXASSERT(false, "unknown matrix stack type"); } } @@ -547,7 +547,7 @@ void Director::multiplyMatrix(MATRIX_STACK_TYPE type, const Mat4& mat) } else { - CCASSERT(false, "unknown matrix stack type"); + AXASSERT(false, "unknown matrix stack type"); } } @@ -567,7 +567,7 @@ void Director::pushMatrix(MATRIX_STACK_TYPE type) } else { - CCASSERT(false, "unknown matrix stack type"); + AXASSERT(false, "unknown matrix stack type"); } } @@ -586,7 +586,7 @@ const Mat4& Director::getMatrix(MATRIX_STACK_TYPE type) const return _textureMatrixStack.top(); } - CCASSERT(false, "unknown matrix stack type, will return modelview matrix instead"); + AXASSERT(false, "unknown matrix stack type, will return modelview matrix instead"); return _modelViewMatrixStack.top(); } @@ -596,7 +596,7 @@ void Director::setProjection(Projection projection) if (size.width == 0 || size.height == 0) { - CCLOGERROR("cocos2d: warning, Director::setProjection() failed because size is 0"); + AXLOGERROR("cocos2d: warning, Director::setProjection() failed because size is 0"); return; } @@ -638,7 +638,7 @@ void Director::setProjection(Projection projection) break; default: - CCLOG("cocos2d: Director: unrecognized projection"); + AXLOG("cocos2d: Director: unrecognized projection"); break; } @@ -680,7 +680,7 @@ static void GLToClipTransform(Mat4* transformOut) return; Director* director = Director::getInstance(); - CCASSERT(nullptr != director, "Director is null when setting matrix stack"); + AXASSERT(nullptr != director, "Director is null when setting matrix stack"); auto& projection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); auto& modelview = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -785,9 +785,9 @@ Rect Director::getSafeAreaRect() const void Director::runWithScene(Scene* scene) { - CCASSERT(scene != nullptr, + AXASSERT(scene != nullptr, "This command can only be used to start the Director. There is already a scene present."); - CCASSERT(_runningScene == nullptr, "_runningScene should be null"); + AXASSERT(_runningScene == nullptr, "_runningScene should be null"); pushScene(scene); startAnimation(); @@ -795,8 +795,8 @@ void Director::runWithScene(Scene* scene) void Director::replaceScene(Scene* scene) { - // CCASSERT(_runningScene, "Use runWithScene: instead to start the director"); - CCASSERT(scene != nullptr, "the scene should not be null"); + // AXASSERT(_runningScene, "Use runWithScene: instead to start the director"); + AXASSERT(scene != nullptr, "the scene should not be null"); if (_runningScene == nullptr) { @@ -820,14 +820,14 @@ void Director::replaceScene(Scene* scene) ssize_t index = _scenesStack.size() - 1; _sendCleanupToScene = true; -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, scene); sEngine->releaseScriptObject(this, _scenesStack.at(index)); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.replace(index, scene); _nextScene = scene; @@ -835,32 +835,32 @@ void Director::replaceScene(Scene* scene) void Director::pushScene(Scene* scene) { - CCASSERT(scene, "the scene should not null"); + AXASSERT(scene, "the scene should not null"); _sendCleanupToScene = false; -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, scene); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.pushBack(scene); _nextScene = scene; } void Director::popScene() { - CCASSERT(_runningScene != nullptr, "running scene should not null"); + AXASSERT(_runningScene != nullptr, "running scene should not null"); -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, _scenesStack.back()); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.popBack(); ssize_t c = _scenesStack.size(); @@ -882,7 +882,7 @@ void Director::popToRootScene() void Director::popToSceneStackLevel(int level) { - CCASSERT(_runningScene != nullptr, "A running Scene is needed"); + AXASSERT(_runningScene != nullptr, "A running Scene is needed"); ssize_t c = _scenesStack.size(); // level 0? -> end @@ -899,13 +899,13 @@ void Director::popToSceneStackLevel(int level) auto firstOnStackScene = _scenesStack.back(); if (firstOnStackScene == _runningScene) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, _scenesStack.back()); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.popBack(); --c; } @@ -921,13 +921,13 @@ void Director::popToSceneStackLevel(int level) } current->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, _scenesStack.back()); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.popBack(); --c; } @@ -950,18 +950,18 @@ void Director::restart() void Director::reset() { -#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 if (_runningScene) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS if (sEngine) { sEngine->releaseScriptObject(this, _runningScene); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _runningScene->onExit(); _runningScene->cleanup(); _runningScene->release(); @@ -997,7 +997,7 @@ void Director::reset() // remove all objects, but don't release it. // runWithScene might be executed after 'end'. -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS if (sEngine) { for (const auto& scene : _scenesStack) @@ -1006,7 +1006,7 @@ void Director::reset() sEngine->releaseScriptObject(this, scene); } } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS while (!_scenesStack.empty()) { @@ -1015,10 +1015,10 @@ void Director::reset() stopAnimation(); - CC_SAFE_RELEASE_NULL(_notificationNode); - CC_SAFE_RELEASE_NULL(_FPSLabel); - CC_SAFE_RELEASE_NULL(_drawnBatchesLabel); - CC_SAFE_RELEASE_NULL(_drawnVerticesLabel); + AX_SAFE_RELEASE_NULL(_notificationNode); + AX_SAFE_RELEASE_NULL(_FPSLabel); + AX_SAFE_RELEASE_NULL(_drawnBatchesLabel); + AX_SAFE_RELEASE_NULL(_drawnVerticesLabel); // purge bitmap cache FontFNT::purgeCachedData(); @@ -1074,7 +1074,7 @@ void Director::restartDirector() startAnimation(); // Real restart in script level -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEvent scriptEvent(kRestartGame, nullptr); ScriptEngineManager::sendEventToLua(scriptEvent); #endif @@ -1132,7 +1132,7 @@ void Director::pause() _oldAnimationInterval = _animationInterval; -#if CC_REDUCE_PAUSED_CPU_USAGE +#if AX_REDUCE_PAUSED_CPU_USAGE // when paused, don't consume CPU setAnimationInterval(1 / 4.0, SetIntervalReason::BY_DIRECTOR_PAUSE); #endif @@ -1146,7 +1146,7 @@ void Director::resume() return; } -#if CC_REDUCE_PAUSED_CPU_USAGE +#if AX_REDUCE_PAUSED_CPU_USAGE setAnimationInterval(_oldAnimationInterval, SetIntervalReason::BY_ENGINE); #endif @@ -1169,7 +1169,7 @@ void Director::updateFrameRate() _frameRate = 1.0f / _deltaTime; } -#if !CC_STRIP_FPS +#if !AX_STRIP_FPS // display the FPS using a LabelAtlas // updates the FPS every frame @@ -1194,7 +1194,7 @@ void Director::showStats() // Probably we don't need this anymore since // the framerate is using a low-pass filter // to make the FPS stable - if (_accumDt > CC_DIRECTOR_STATS_INTERVAL) + if (_accumDt > AX_DIRECTOR_STATS_INTERVAL) { sprintf(buffer, "%.1f / %.3f", _frames / _accumDt, _secondsPerFrame); _FPSLabel->setString(buffer); @@ -1254,9 +1254,9 @@ void Director::createStatsLabel() drawBatchString = _drawnBatchesLabel->getString(); drawVerticesString = _drawnVerticesLabel->getString(); - CC_SAFE_RELEASE_NULL(_FPSLabel); - CC_SAFE_RELEASE_NULL(_drawnBatchesLabel); - CC_SAFE_RELEASE_NULL(_drawnVerticesLabel); + AX_SAFE_RELEASE_NULL(_FPSLabel); + AX_SAFE_RELEASE_NULL(_drawnBatchesLabel); + AX_SAFE_RELEASE_NULL(_drawnVerticesLabel); _textureCache->removeTextureForKey("/cc_fps_images"); FileUtils::getInstance()->purgeCachedEntries(); } @@ -1271,12 +1271,12 @@ void Director::createStatsLabel() { if (image) delete image; - CCLOGERROR("%s", "Fails: init fps_images"); + AXLOGERROR("%s", "Fails: init fps_images"); return; } texture = _textureCache->addImage(image, "/cc_fps_images", PixelFormat::RGBA4); - CC_SAFE_RELEASE(image); + AX_SAFE_RELEASE(image); /* We want to use an image which is stored in the file named ccFPSImage.c @@ -1286,7 +1286,7 @@ void Director::createStatsLabel() So I added a new method called 'setIgnoreContentScaleFactor' for 'AtlasNode', this is not exposed to game developers, it's only used for displaying FPS now. */ - float scaleFactor = 1 / CC_CONTENT_SCALE_FACTOR(); + float scaleFactor = 1 / AX_CONTENT_SCALE_FACTOR(); _FPSLabel = LabelAtlas::create(fpsString, texture, 12, 32, '.'); _FPSLabel->retain(); @@ -1319,7 +1319,7 @@ void Director::setStatsAnchor(AnchorPreset anchor) static Vec2 _fpsPosition = {0, 0}; auto safeOrigin = getSafeAreaRect().origin; auto safeSize = getSafeAreaRect().size; - const int height_spacing = (int)(22 / CC_CONTENT_SCALE_FACTOR()); + const int height_spacing = (int)(22 / AX_CONTENT_SCALE_FACTOR()); switch (anchor) { @@ -1391,7 +1391,7 @@ void Director::setStatsAnchor(AnchorPreset anchor) } } -#endif // #if !CC_STRIP_FPS +#endif // #if !AX_STRIP_FPS void Director::setContentScaleFactor(float scaleFactor) { @@ -1410,22 +1410,22 @@ void Director::setNotificationNode(Node* node) _notificationNode->onExit(); _notificationNode->cleanup(); } - CC_SAFE_RELEASE(_notificationNode); + AX_SAFE_RELEASE(_notificationNode); _notificationNode = node; if (node == nullptr) return; _notificationNode->onEnter(); _notificationNode->onEnterTransitionDidFinish(); - CC_SAFE_RETAIN(_notificationNode); + AX_SAFE_RETAIN(_notificationNode); } void Director::setScheduler(Scheduler* scheduler) { if (_scheduler != scheduler) { - CC_SAFE_RETAIN(scheduler); - CC_SAFE_RELEASE(_scheduler); + AX_SAFE_RETAIN(scheduler); + AX_SAFE_RELEASE(_scheduler); _scheduler = scheduler; } } @@ -1434,8 +1434,8 @@ void Director::setActionManager(ActionManager* actionManager) { if (_actionManager != actionManager) { - CC_SAFE_RETAIN(actionManager); - CC_SAFE_RELEASE(_actionManager); + AX_SAFE_RETAIN(actionManager); + AX_SAFE_RELEASE(_actionManager); _actionManager = actionManager; } } @@ -1444,8 +1444,8 @@ void Director::setEventDispatcher(EventDispatcher* dispatcher) { if (_eventDispatcher != dispatcher) { - CC_SAFE_RETAIN(dispatcher); - CC_SAFE_RELEASE(_eventDispatcher); + AX_SAFE_RETAIN(dispatcher); + AX_SAFE_RELEASE(_eventDispatcher); _eventDispatcher = dispatcher; } } diff --git a/core/base/CCDirector.h b/core/base/CCDirector.h index 9a63a5dafb..27b6ff93a4 100644 --- a/core/base/CCDirector.h +++ b/core/base/CCDirector.h @@ -74,7 +74,7 @@ class Console; Since the Director is a singleton, the standard way to use it is by calling: _ Director::getInstance()->methodName(); */ -class CC_DLL Director : public Ref +class AX_DLL Director : public Ref { public: /** Director will trigger an event before set next scene. */ @@ -524,7 +524,7 @@ protected: void setNextScene(); void updateFrameRate(); -#if !CC_STRIP_FPS +#if !AX_STRIP_FPS void showStats(); void createStatsLabel(); void calculateMPF(); diff --git a/core/base/CCEvent.h b/core/base/CCEvent.h index 649a56eaae..80950b9ca8 100644 --- a/core/base/CCEvent.h +++ b/core/base/CCEvent.h @@ -41,7 +41,7 @@ class Node; /** @class Event * @brief Base class of all kinds of events. */ -class CC_DLL Event : public Ref +class AX_DLL Event : public Ref { public: /** Type Event type.*/ diff --git a/core/base/CCEventAcceleration.h b/core/base/CCEventAcceleration.h index f396e0445a..6786abb1e5 100644 --- a/core/base/CCEventAcceleration.h +++ b/core/base/CCEventAcceleration.h @@ -39,7 +39,7 @@ NS_AX_BEGIN /** @class EventAcceleration * @brief Accelerometer event. */ -class CC_DLL EventAcceleration : public Event +class AX_DLL EventAcceleration : public Event { public: /** Constructor. diff --git a/core/base/CCEventController.h b/core/base/CCEventController.h index 9bbcf28153..afe0cff186 100644 --- a/core/base/CCEventController.h +++ b/core/base/CCEventController.h @@ -44,7 +44,7 @@ class EventListenerController; /** @class EventController * @brief Controller event. */ -class CC_DLL EventController : public Event +class AX_DLL EventController : public Event { public: /** ControllerEventType Controller event type.*/ diff --git a/core/base/CCEventCustom.h b/core/base/CCEventCustom.h index 69190a4031..c0912a4331 100644 --- a/core/base/CCEventCustom.h +++ b/core/base/CCEventCustom.h @@ -39,7 +39,7 @@ NS_AX_BEGIN /** @class EventCustom * @brief Custom event. */ -class CC_DLL EventCustom : public Event +class AX_DLL EventCustom : public Event { public: /** Constructor. diff --git a/core/base/CCEventDispatcher.cpp b/core/base/CCEventDispatcher.cpp index 36408c7917..4a5de99334 100644 --- a/core/base/CCEventDispatcher.cpp +++ b/core/base/CCEventDispatcher.cpp @@ -32,9 +32,9 @@ #include "base/CCEventListenerKeyboard.h" #include "base/CCEventListenerCustom.h" #include "base/CCEventListenerFocus.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "base/CCEventListenerController.h" #endif #include "2d/CCScene.h" @@ -88,17 +88,17 @@ static EventListener::ListenerID __getListenerID(Event* event) case Event::Type::TOUCH: // Touch listener is very special, it contains two kinds of listeners, EventListenerTouchOneByOne and // EventListenerTouchAllAtOnce. return UNKNOWN instead. - CCASSERT(false, "Don't call this method if the event is for touch."); + AXASSERT(false, "Don't call this method if the event is for touch."); break; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) case Event::Type::GAME_CONTROLLER: ret = EventListenerController::LISTENER_ID; break; #endif default: - CCASSERT(false, "Invalid type!"); + AXASSERT(false, "Invalid type!"); break; } @@ -111,8 +111,8 @@ EventDispatcher::EventListenerVector::EventListenerVector() EventDispatcher::EventListenerVector::~EventListenerVector() { - CC_SAFE_DELETE(_sceneGraphListeners); - CC_SAFE_DELETE(_fixedListeners); + AX_SAFE_DELETE(_sceneGraphListeners); + AX_SAFE_DELETE(_fixedListeners); } size_t EventDispatcher::EventListenerVector::size() const @@ -134,12 +134,12 @@ bool EventDispatcher::EventListenerVector::empty() const void EventDispatcher::EventListenerVector::push_back(EventListener* listener) { -#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS - CCASSERT(_sceneGraphListeners == nullptr || +#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS + AXASSERT(_sceneGraphListeners == nullptr || std::count(_sceneGraphListeners->begin(), _sceneGraphListeners->end(), listener) == 0, "Listener should not be added twice!"); - CCASSERT(_fixedListeners == nullptr || std::count(_fixedListeners->begin(), _fixedListeners->end(), listener) == 0, + AXASSERT(_fixedListeners == nullptr || std::count(_fixedListeners->begin(), _fixedListeners->end(), listener) == 0, "Listener should not be added twice!"); #endif @@ -439,13 +439,13 @@ void EventDispatcher::addEventListener(EventListener* listener) { _toAddedListeners.push_back(listener); } -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, listener); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS listener->retain(); } @@ -472,7 +472,7 @@ void EventDispatcher::forceAddEventListener(EventListener* listener) setDirty(listenerID, DirtyFlag::SCENE_GRAPH_PRIORITY); auto node = listener->getAssociatedNode(); - CCASSERT(node != nullptr, "Invalid scene graph priority!"); + AXASSERT(node != nullptr, "Invalid scene graph priority!"); associateNodeAndEventListener(node, listener); @@ -489,8 +489,8 @@ void EventDispatcher::forceAddEventListener(EventListener* listener) void EventDispatcher::addEventListenerWithSceneGraphPriority(EventListener* listener, Node* node) { - CCASSERT(listener && node, "Invalid parameters."); - CCASSERT(!listener->isRegistered(), "The listener has been registered."); + AXASSERT(listener && node, "Invalid parameters."); + AXASSERT(!listener->isRegistered(), "The listener has been registered."); if (!listener->checkAvailable()) return; @@ -502,7 +502,7 @@ void EventDispatcher::addEventListenerWithSceneGraphPriority(EventListener* list addEventListener(listener); } -#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 +#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS && AXIS_DEBUG > 0 void EventDispatcher::debugCheckNodeHasNoEventListenersOnDestruction(Node* node) { @@ -517,7 +517,7 @@ void EventDispatcher::debugCheckNodeHasNoEventListenersOnDestruction(Node* node) { for (EventListener* listener : *eventListenerVector->getSceneGraphPriorityListeners()) { - CCASSERT(!listener || listener->getAssociatedNode() != node, + AXASSERT(!listener || listener->getAssociatedNode() != node, "Node should have no event listeners registered for it upon destruction!"); } } @@ -527,13 +527,13 @@ void EventDispatcher::debugCheckNodeHasNoEventListenersOnDestruction(Node* node) // Check the node listeners map for (const auto& keyValuePair : _nodeListenersMap) { - CCASSERT(keyValuePair.first != node, "Node should have no event listeners registered for it upon destruction!"); + AXASSERT(keyValuePair.first != node, "Node should have no event listeners registered for it upon destruction!"); if (keyValuePair.second) { for (EventListener* listener : *keyValuePair.second) { - CCASSERT(listener->getAssociatedNode() != node, + AXASSERT(listener->getAssociatedNode() != node, "Node should have no event listeners registered for it upon destruction!"); } } @@ -542,30 +542,30 @@ void EventDispatcher::debugCheckNodeHasNoEventListenersOnDestruction(Node* node) // Check the node priority map for (const auto& keyValuePair : _nodePriorityMap) { - CCASSERT(keyValuePair.first != node, "Node should have no event listeners registered for it upon destruction!"); + AXASSERT(keyValuePair.first != node, "Node should have no event listeners registered for it upon destruction!"); } // Check the to be added list for (EventListener* listener : _toAddedListeners) { - CCASSERT(listener->getAssociatedNode() != node, + AXASSERT(listener->getAssociatedNode() != node, "Node should have no event listeners registered for it upon destruction!"); } // Check the dirty nodes set for (Node* dirtyNode : _dirtyNodes) { - CCASSERT(dirtyNode != node, "Node should have no event listeners registered for it upon destruction!"); + AXASSERT(dirtyNode != node, "Node should have no event listeners registered for it upon destruction!"); } } -#endif // #if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 +#endif // #if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS && AXIS_DEBUG > 0 void EventDispatcher::addEventListenerWithFixedPriority(EventListener* listener, int fixedPriority) { - CCASSERT(listener, "Invalid parameters."); - CCASSERT(!listener->isRegistered(), "The listener has been registered."); - CCASSERT(fixedPriority != 0, + AXASSERT(listener, "Invalid parameters."); + AXASSERT(!listener->isRegistered(), "The listener has been registered."); + AXASSERT(fixedPriority != 0, "0 priority is forbidden for fixed priority since it's used for scene graph based priority."); if (!listener->checkAvailable()) @@ -607,7 +607,7 @@ void EventDispatcher::removeEventListener(EventListener* listener) auto l = *iter; if (l == listener) { - CC_SAFE_RETAIN(l); + AX_SAFE_RETAIN(l); l->setRegistered(false); if (l->getAssociatedNode() != nullptr) { @@ -653,13 +653,13 @@ void EventDispatcher::removeEventListener(EventListener* listener) } } -#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS - CCASSERT( +#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS + AXASSERT( _inDispatch != 0 || !sceneGraphPriorityListeners || std::count(sceneGraphPriorityListeners->begin(), sceneGraphPriorityListeners->end(), listener) == 0, "Listener should be in no lists after this is done if we're not currently in dispatch mode."); - CCASSERT(_inDispatch != 0 || !fixedPriorityListeners || + AXASSERT(_inDispatch != 0 || !fixedPriorityListeners || std::count(fixedPriorityListeners->begin(), fixedPriorityListeners->end(), listener) == 0, "Listener should be in no lists after this is done if we're not currently in dispatch mode."); #endif @@ -669,7 +669,7 @@ void EventDispatcher::removeEventListener(EventListener* listener) _priorityDirtyFlagMap.erase(listener->getListenerID()); auto list = iter->second; iter = _listenerMap.erase(iter); - CC_SAFE_DELETE(list); + AX_SAFE_DELETE(list); } else { @@ -712,7 +712,7 @@ void EventDispatcher::setPriority(EventListener* listener, int fixedPriority) auto found = std::find(fixedPriorityListeners->begin(), fixedPriorityListeners->end(), listener); if (found != fixedPriorityListeners->end()) { - CCASSERT(listener->getAssociatedNode() == nullptr, + AXASSERT(listener->getAssociatedNode() == nullptr, "Can't set fixed priority with scene graph based listener."); if (listener->getFixedPriority() != fixedPriority) @@ -737,7 +737,7 @@ void EventDispatcher::dispatchEventToListeners(EventListenerVector* listeners, // priority < 0 if (fixedPriorityListeners) { - CCASSERT(listeners->getGt0Index() <= static_cast(fixedPriorityListeners->size()), + AXASSERT(listeners->getGt0Index() <= static_cast(fixedPriorityListeners->size()), "Out of range exception!"); if (!fixedPriorityListeners->empty()) @@ -801,7 +801,7 @@ void EventDispatcher::dispatchTouchEventToListeners(EventListenerVector* listene // priority < 0 if (fixedPriorityListeners) { - CCASSERT(listeners->getGt0Index() <= static_cast(fixedPriorityListeners->size()), + AXASSERT(listeners->getGt0Index() <= static_cast(fixedPriorityListeners->size()), "Out of range exception!"); if (!fixedPriorityListeners->empty()) @@ -1032,7 +1032,7 @@ void EventDispatcher::dispatchTouchEvent(EventTouch* event) } break; default: - CCASSERT(false, "The eventcode is invalid."); + AXASSERT(false, "The eventcode is invalid."); break; } } @@ -1044,7 +1044,7 @@ void EventDispatcher::dispatchTouchEvent(EventTouch* event) return true; } - CCASSERT(touches->getID() == (*mutableTouchesIter)->getID(), + AXASSERT(touches->getID() == (*mutableTouchesIter)->getID(), "touches ID should be equal to mutableTouchesIter's ID."); if (isClaimed && listener->_isRegistered && listener->_needSwallow) @@ -1113,7 +1113,7 @@ void EventDispatcher::dispatchTouchEvent(EventTouch* event) } break; default: - CCASSERT(false, "The eventcode is invalid."); + AXASSERT(false, "The eventcode is invalid."); break; } @@ -1139,7 +1139,7 @@ void EventDispatcher::dispatchTouchEvent(EventTouch* event) void EventDispatcher::updateListeners(Event* event) { - CCASSERT(_inDispatch > 0, "If program goes here, there should be event in dispatch."); + AXASSERT(_inDispatch > 0, "If program goes here, there should be event in dispatch."); if (_inDispatch > 1) return; @@ -1217,7 +1217,7 @@ void EventDispatcher::updateListeners(Event* event) onUpdateListeners(__getListenerID(event)); } - CCASSERT(_inDispatch == 1, "_inDispatch should be 1 here."); + AXASSERT(_inDispatch == 1, "_inDispatch should be 1 here."); for (auto iter = _listenerMap.begin(); iter != _listenerMap.end();) { @@ -1474,7 +1474,7 @@ void EventDispatcher::removeEventListenersForType(EventListener::Type listenerTy } else { - CCASSERT(false, "Invalid listener type!"); + AXASSERT(false, "Invalid listener type!"); } } @@ -1603,7 +1603,7 @@ void EventDispatcher::cleanToRemovedListeners() } } else - CC_SAFE_RELEASE(l); + AX_SAFE_RELEASE(l); } _toRemovedListeners.clear(); @@ -1611,14 +1611,14 @@ void EventDispatcher::cleanToRemovedListeners() void EventDispatcher::releaseListener(EventListener* listener) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (listener && sEngine) { sEngine->releaseScriptObject(this, listener); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS - CC_SAFE_RELEASE(listener); +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS + AX_SAFE_RELEASE(listener); } NS_AX_END diff --git a/core/base/CCEventDispatcher.h b/core/base/CCEventDispatcher.h index 9f0e0d86bb..3d61943f6c 100644 --- a/core/base/CCEventDispatcher.h +++ b/core/base/CCEventDispatcher.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EVENT_DISPATCHER_H__ -#define __CC_EVENT_DISPATCHER_H__ +#ifndef __AX_EVENT_DISPATCHER_H__ +#define __AX_EVENT_DISPATCHER_H__ #include #include @@ -60,7 +60,7 @@ from within an EventListener, while events are being dispatched. @js NA */ -class CC_DLL EventDispatcher : public Ref +class AX_DLL EventDispatcher : public Ref { public: // Adds event listener. @@ -196,7 +196,7 @@ public: */ ~EventDispatcher(); -#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 +#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS && AXIS_DEBUG > 0 /** * To help track down event listener issues in debug builds. @@ -360,4 +360,4 @@ NS_AX_END // end of base group /// @} -#endif // __CC_EVENT_DISPATCHER_H__ +#endif // __AX_EVENT_DISPATCHER_H__ diff --git a/core/base/CCEventFocus.h b/core/base/CCEventFocus.h index 3a0958846d..86f6373735 100644 --- a/core/base/CCEventFocus.h +++ b/core/base/CCEventFocus.h @@ -44,7 +44,7 @@ class Widget; /** @class EventFocus * @brief Focus event. */ -class CC_DLL EventFocus : public Event +class AX_DLL EventFocus : public Event { public: /** Constructor. diff --git a/core/base/CCEventKeyboard.h b/core/base/CCEventKeyboard.h index 38823e029c..7fd206de63 100644 --- a/core/base/CCEventKeyboard.h +++ b/core/base/CCEventKeyboard.h @@ -39,7 +39,7 @@ NS_AX_BEGIN /** @class EventKeyboard * @brief Keyboard event. */ -class CC_DLL EventKeyboard : public Event +class AX_DLL EventKeyboard : public Event { public: /** diff --git a/core/base/CCEventListener.cpp b/core/base/CCEventListener.cpp index 8a35be5ac2..3cfbdaa7a8 100644 --- a/core/base/CCEventListener.cpp +++ b/core/base/CCEventListener.cpp @@ -32,7 +32,7 @@ EventListener::EventListener() {} EventListener::~EventListener() { - CCLOGINFO("In the destructor of EventListener. %p", this); + AXLOGINFO("In the destructor of EventListener. %p", this); } bool EventListener::init(Type t, std::string_view listenerID, const std::function& callback) diff --git a/core/base/CCEventListener.h b/core/base/CCEventListener.h index 02f4d0ac44..2b61aa9998 100644 --- a/core/base/CCEventListener.h +++ b/core/base/CCEventListener.h @@ -49,7 +49,7 @@ class Node; * For instance, you could refer to EventListenerAcceleration, EventListenerKeyboard, EventListenerTouchOneByOne, * EventListenerCustom. */ -class CC_DLL EventListener : public Ref +class AX_DLL EventListener : public Ref { public: /** Type Event type.*/ diff --git a/core/base/CCEventListenerAcceleration.cpp b/core/base/CCEventListenerAcceleration.cpp index bf43f27831..5dae00c4b8 100644 --- a/core/base/CCEventListenerAcceleration.cpp +++ b/core/base/CCEventListenerAcceleration.cpp @@ -35,7 +35,7 @@ EventListenerAcceleration::EventListenerAcceleration() {} EventListenerAcceleration::~EventListenerAcceleration() { - CCLOGINFO("In the destructor of AccelerationEventListener. %p", this); + AXLOGINFO("In the destructor of AccelerationEventListener. %p", this); } EventListenerAcceleration* EventListenerAcceleration::create(const std::function& callback) @@ -47,7 +47,7 @@ EventListenerAcceleration* EventListenerAcceleration::create(const std::function } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -79,7 +79,7 @@ EventListenerAcceleration* EventListenerAcceleration::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -87,7 +87,7 @@ EventListenerAcceleration* EventListenerAcceleration::clone() bool EventListenerAcceleration::checkAvailable() { - CCASSERT(onAccelerationEvent, "onAccelerationEvent can't be nullptr!"); + AXASSERT(onAccelerationEvent, "onAccelerationEvent can't be nullptr!"); return true; } diff --git a/core/base/CCEventListenerAcceleration.h b/core/base/CCEventListenerAcceleration.h index 52b355ac2c..1aec200528 100644 --- a/core/base/CCEventListenerAcceleration.h +++ b/core/base/CCEventListenerAcceleration.h @@ -40,7 +40,7 @@ NS_AX_BEGIN * @brief Acceleration event listener. * @js NA */ -class CC_DLL EventListenerAcceleration : public EventListener +class AX_DLL EventListenerAcceleration : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerController.cpp b/core/base/CCEventListenerController.cpp index 1b50f52231..3eba65bf50 100644 --- a/core/base/CCEventListenerController.cpp +++ b/core/base/CCEventListenerController.cpp @@ -42,7 +42,7 @@ EventListenerController* EventListenerController::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -93,7 +93,7 @@ bool EventListenerController::init() } break; default: - CCASSERT(false, "Invalid EventController type"); + AXASSERT(false, "Invalid EventController type"); break; } }; diff --git a/core/base/CCEventListenerController.h b/core/base/CCEventListenerController.h index a0d44df411..e612b2ee00 100644 --- a/core/base/CCEventListenerController.h +++ b/core/base/CCEventListenerController.h @@ -44,7 +44,7 @@ class Controller; * @param Controller event listener. * @js NA */ -class CC_DLL EventListenerController : public EventListener +class AX_DLL EventListenerController : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerCustom.cpp b/core/base/CCEventListenerCustom.cpp index 0ca3e279d7..cac8bca754 100644 --- a/core/base/CCEventListenerCustom.cpp +++ b/core/base/CCEventListenerCustom.cpp @@ -40,7 +40,7 @@ EventListenerCustom* EventListenerCustom::create(std::string_view eventName, } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -74,7 +74,7 @@ EventListenerCustom* EventListenerCustom::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerCustom.h b/core/base/CCEventListenerCustom.h index f4b22d06f2..37fa114582 100644 --- a/core/base/CCEventListenerCustom.h +++ b/core/base/CCEventListenerCustom.h @@ -58,7 +58,7 @@ class EventCustom; * \endcode * @js cc._EventListenerCustom */ -class CC_DLL EventListenerCustom : public EventListener +class AX_DLL EventListenerCustom : public EventListener { public: /** Creates an event listener with type and callback. diff --git a/core/base/CCEventListenerFocus.cpp b/core/base/CCEventListenerFocus.cpp index b67da31491..34604a0186 100644 --- a/core/base/CCEventListenerFocus.cpp +++ b/core/base/CCEventListenerFocus.cpp @@ -36,7 +36,7 @@ EventListenerFocus::EventListenerFocus() : onFocusChanged(nullptr) {} EventListenerFocus::~EventListenerFocus() { - CCLOGINFO("In the destructor of EventListenerFocus, %p", this); + AXLOGINFO("In the destructor of EventListenerFocus, %p", this); } EventListenerFocus* EventListenerFocus::create() @@ -47,7 +47,7 @@ EventListenerFocus* EventListenerFocus::create() ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -62,7 +62,7 @@ EventListenerFocus* EventListenerFocus::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -84,7 +84,7 @@ bool EventListenerFocus::checkAvailable() { if (onFocusChanged == nullptr) { - CCASSERT(false, "Invalid EventListenerFocus!"); + AXASSERT(false, "Invalid EventListenerFocus!"); return false; } diff --git a/core/base/CCEventListenerFocus.h b/core/base/CCEventListenerFocus.h index ab8e407786..5d32b53311 100644 --- a/core/base/CCEventListenerFocus.h +++ b/core/base/CCEventListenerFocus.h @@ -44,7 +44,7 @@ class Widget; /** @class EventListenerFocus * @brief Focus event listener. */ -class CC_DLL EventListenerFocus : public EventListener +class AX_DLL EventListenerFocus : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerKeyboard.cpp b/core/base/CCEventListenerKeyboard.cpp index dcd464af8a..057a378cf7 100644 --- a/core/base/CCEventListenerKeyboard.cpp +++ b/core/base/CCEventListenerKeyboard.cpp @@ -35,7 +35,7 @@ bool EventListenerKeyboard::checkAvailable() { if (onKeyPressed == nullptr && onKeyReleased == nullptr) { - CCASSERT(false, "Invalid EventListenerKeyboard!"); + AXASSERT(false, "Invalid EventListenerKeyboard!"); return false; } @@ -51,7 +51,7 @@ EventListenerKeyboard* EventListenerKeyboard::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -67,7 +67,7 @@ EventListenerKeyboard* EventListenerKeyboard::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerKeyboard.h b/core/base/CCEventListenerKeyboard.h index c25f9e4e31..eeb5b69269 100644 --- a/core/base/CCEventListenerKeyboard.h +++ b/core/base/CCEventListenerKeyboard.h @@ -43,7 +43,7 @@ class Event; * @brief Keyboard event listener. * @js cc._EventListenerKeyboard */ -class CC_DLL EventListenerKeyboard : public EventListener +class AX_DLL EventListenerKeyboard : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerMouse.cpp b/core/base/CCEventListenerMouse.cpp index d7c6999216..6bc360a72f 100644 --- a/core/base/CCEventListenerMouse.cpp +++ b/core/base/CCEventListenerMouse.cpp @@ -44,7 +44,7 @@ EventListenerMouse* EventListenerMouse::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -62,7 +62,7 @@ EventListenerMouse* EventListenerMouse::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerMouse.h b/core/base/CCEventListenerMouse.h index 00631ab177..6fce6bae7e 100644 --- a/core/base/CCEventListenerMouse.h +++ b/core/base/CCEventListenerMouse.h @@ -43,7 +43,7 @@ class Event; * @brief Mouse event listener. * @js cc._EventListenerMouse */ -class CC_DLL EventListenerMouse : public EventListener +class AX_DLL EventListenerMouse : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerTouch.cpp b/core/base/CCEventListenerTouch.cpp index f4c136afac..27b71f75fd 100644 --- a/core/base/CCEventListenerTouch.cpp +++ b/core/base/CCEventListenerTouch.cpp @@ -44,7 +44,7 @@ EventListenerTouchOneByOne::EventListenerTouchOneByOne() EventListenerTouchOneByOne::~EventListenerTouchOneByOne() { - CCLOGINFO("In the destructor of EventListenerTouchOneByOne, %p", this); + AXLOGINFO("In the destructor of EventListenerTouchOneByOne, %p", this); } bool EventListenerTouchOneByOne::init() @@ -76,7 +76,7 @@ EventListenerTouchOneByOne* EventListenerTouchOneByOne::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -87,7 +87,7 @@ bool EventListenerTouchOneByOne::checkAvailable() // message to 'EventListenerTouchOneByOne' or not. So 'onTouchBegan' needs to be set. if (onTouchBegan == nullptr) { - CCASSERT(false, "Invalid EventListenerTouchOneByOne!"); + AXASSERT(false, "Invalid EventListenerTouchOneByOne!"); return false; } @@ -111,7 +111,7 @@ EventListenerTouchOneByOne* EventListenerTouchOneByOne::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -126,7 +126,7 @@ EventListenerTouchAllAtOnce::EventListenerTouchAllAtOnce() EventListenerTouchAllAtOnce::~EventListenerTouchAllAtOnce() { - CCLOGINFO("In the destructor of EventListenerTouchAllAtOnce, %p", this); + AXLOGINFO("In the destructor of EventListenerTouchAllAtOnce, %p", this); } bool EventListenerTouchAllAtOnce::init() @@ -148,7 +148,7 @@ EventListenerTouchAllAtOnce* EventListenerTouchAllAtOnce::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -158,7 +158,7 @@ bool EventListenerTouchAllAtOnce::checkAvailable() if (onTouchesBegan == nullptr && onTouchesMoved == nullptr && onTouchesEnded == nullptr && onTouchesCancelled == nullptr) { - CCASSERT(false, "Invalid EventListenerTouchAllAtOnce!"); + AXASSERT(false, "Invalid EventListenerTouchAllAtOnce!"); return false; } @@ -179,7 +179,7 @@ EventListenerTouchAllAtOnce* EventListenerTouchAllAtOnce::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerTouch.h b/core/base/CCEventListenerTouch.h index 7ec050ffe0..d7c9beb717 100644 --- a/core/base/CCEventListenerTouch.h +++ b/core/base/CCEventListenerTouch.h @@ -43,7 +43,7 @@ class Touch; * @brief Single touch event listener. * @js cc._EventListenerTouchOneByOne */ -class CC_DLL EventListenerTouchOneByOne : public EventListener +class AX_DLL EventListenerTouchOneByOne : public EventListener { public: static const std::string LISTENER_ID; @@ -96,7 +96,7 @@ private: /** @class EventListenerTouchAllAtOnce * @brief Multiple touches event listener. */ -class CC_DLL EventListenerTouchAllAtOnce : public EventListener +class AX_DLL EventListenerTouchAllAtOnce : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventMouse.h b/core/base/CCEventMouse.h index 24ed182cc9..c1a81c34b5 100644 --- a/core/base/CCEventMouse.h +++ b/core/base/CCEventMouse.h @@ -40,7 +40,7 @@ NS_AX_BEGIN /** @class EventMouse * @brief The mouse event. */ -class CC_DLL EventMouse : public Event +class AX_DLL EventMouse : public Event { public: /** diff --git a/core/base/CCEventTouch.h b/core/base/CCEventTouch.h index f2a042ed1f..2b0347d40b 100644 --- a/core/base/CCEventTouch.h +++ b/core/base/CCEventTouch.h @@ -43,7 +43,7 @@ class Touch; /** @class EventTouch * @brief Touch event. */ -class CC_DLL EventTouch : public Event +class AX_DLL EventTouch : public Event { public: static const int MAX_TOUCHES = 15; diff --git a/core/base/CCIMEDelegate.h b/core/base/CCIMEDelegate.h index 29ff4fb0e9..1ad7499a4a 100644 --- a/core/base/CCIMEDelegate.h +++ b/core/base/CCIMEDelegate.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_IME_DELEGATE_H__ -#define __CC_IME_DELEGATE_H__ +#ifndef __AX_IME_DELEGATE_H__ +#define __AX_IME_DELEGATE_H__ #include #include "math/CCMath.h" @@ -40,7 +40,7 @@ NS_AX_BEGIN /** * A static global empty std::string install. */ -extern const std::string CC_DLL STD_STRING_EMPTY; +extern const std::string AX_DLL STD_STRING_EMPTY; /** * Keyboard notification event type. @@ -55,7 +55,7 @@ typedef struct /** *@brief Input method editor delegate. */ -class CC_DLL IMEDelegate +class AX_DLL IMEDelegate { public: /** @@ -175,4 +175,4 @@ NS_AX_END // end of base group /// @} -#endif // __CC_IME_DELEGATE_H__ +#endif // __AX_IME_DELEGATE_H__ diff --git a/core/base/CCIMEDispatcher.cpp b/core/base/CCIMEDispatcher.cpp index 4bfed04244..c1a06332c1 100644 --- a/core/base/CCIMEDispatcher.cpp +++ b/core/base/CCIMEDispatcher.cpp @@ -100,7 +100,7 @@ IMEDispatcher::IMEDispatcher() : _impl(new IMEDispatcher::Impl) IMEDispatcher::~IMEDispatcher() { - CC_SAFE_DELETE(_impl); + AX_SAFE_DELETE(_impl); } ////////////////////////////////////////////////////////////////////////// @@ -126,13 +126,13 @@ bool IMEDispatcher::attachDelegateWithIME(IMEDelegate* delegate) bool ret = false; do { - CC_BREAK_IF(!_impl || !delegate); + AX_BREAK_IF(!_impl || !delegate); DelegateIter end = _impl->_delegateList.end(); DelegateIter iter = _impl->findDelegate(delegate); // if pDelegate is not in delegate list, return - CC_BREAK_IF(end == iter); + AX_BREAK_IF(end == iter); if (_impl->_delegateWithIme) { @@ -141,7 +141,7 @@ bool IMEDispatcher::attachDelegateWithIME(IMEDelegate* delegate) // if old delegate canDetachWithIME return false // or pDelegate canAttachWithIME return false, // do nothing. - CC_BREAK_IF(!_impl->_delegateWithIme->canDetachWithIME() || !delegate->canAttachWithIME()); + AX_BREAK_IF(!_impl->_delegateWithIme->canDetachWithIME() || !delegate->canAttachWithIME()); // detach first IMEDelegate* oldDelegate = _impl->_delegateWithIme; @@ -156,7 +156,7 @@ bool IMEDispatcher::attachDelegateWithIME(IMEDelegate* delegate) } // delegate hasn't attached to IME yet - CC_BREAK_IF(!delegate->canAttachWithIME()); + AX_BREAK_IF(!delegate->canAttachWithIME()); _impl->_delegateWithIme = *iter; delegate->didAttachWithIME(); @@ -170,12 +170,12 @@ bool IMEDispatcher::detachDelegateWithIME(IMEDelegate* delegate) bool ret = false; do { - CC_BREAK_IF(!_impl || !delegate); + AX_BREAK_IF(!_impl || !delegate); // if pDelegate is not the current delegate attached to IME, return - CC_BREAK_IF(_impl->_delegateWithIme != delegate); + AX_BREAK_IF(_impl->_delegateWithIme != delegate); - CC_BREAK_IF(!delegate->canDetachWithIME()); + AX_BREAK_IF(!delegate->canDetachWithIME()); _impl->_delegateWithIme = 0; delegate->didDetachWithIME(); @@ -188,11 +188,11 @@ void IMEDispatcher::removeDelegate(IMEDelegate* delegate) { do { - CC_BREAK_IF(!delegate || !_impl); + AX_BREAK_IF(!delegate || !_impl); DelegateIter iter = _impl->findDelegate(delegate); DelegateIter end = _impl->_delegateList.end(); - CC_BREAK_IF(end == iter); + AX_BREAK_IF(end == iter); if (_impl->_delegateWithIme) @@ -212,10 +212,10 @@ void IMEDispatcher::dispatchInsertText(const char* text, size_t len) { do { - CC_BREAK_IF(!_impl || !text || len <= 0); + AX_BREAK_IF(!_impl || !text || len <= 0); // there is no delegate attached to IME - CC_BREAK_IF(!_impl->_delegateWithIme); + AX_BREAK_IF(!_impl->_delegateWithIme); _impl->_delegateWithIme->insertText(text, len); } while (0); @@ -225,10 +225,10 @@ void IMEDispatcher::dispatchDeleteBackward() { do { - CC_BREAK_IF(!_impl); + AX_BREAK_IF(!_impl); // there is no delegate attached to IME - CC_BREAK_IF(!_impl->_delegateWithIme); + AX_BREAK_IF(!_impl->_delegateWithIme); _impl->_delegateWithIme->deleteBackward(); } while (0); @@ -238,10 +238,10 @@ void IMEDispatcher::dispatchControlKey(EventKeyboard::KeyCode keyCode) { do { - CC_BREAK_IF(!_impl); + AX_BREAK_IF(!_impl); // there is no delegate attached to IME - CC_BREAK_IF(!_impl->_delegateWithIme); + AX_BREAK_IF(!_impl->_delegateWithIme); _impl->_delegateWithIme->controlKey(keyCode); } while (0); diff --git a/core/base/CCIMEDispatcher.h b/core/base/CCIMEDispatcher.h index eafd22bf45..dc83a7ceeb 100644 --- a/core/base/CCIMEDispatcher.h +++ b/core/base/CCIMEDispatcher.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_IME_DISPATCHER_H__ -#define __CC_IME_DISPATCHER_H__ +#ifndef __AX_IME_DISPATCHER_H__ +#define __AX_IME_DISPATCHER_H__ #include "base/CCIMEDelegate.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN /** @brief Input Method Edit Message Dispatcher. */ -class CC_DLL IMEDispatcher +class AX_DLL IMEDispatcher { public: /** @@ -140,4 +140,4 @@ NS_AX_END // end of base group /// @} -#endif // __CC_IME_DISPATCHER_H__ +#endif // __AX_IME_DISPATCHER_H__ diff --git a/core/base/CCMap.h b/core/base/CCMap.h index 2366ed8ac5..690d6c45a1 100644 --- a/core/base/CCMap.h +++ b/core/base/CCMap.h @@ -90,14 +90,14 @@ public: Map() : _data() { static_assert(std::is_convertible::value, "Invalid Type for axis::Map!"); - CCLOGINFO("In the default constructor of Map!"); + AXLOGINFO("In the default constructor of Map!"); } /** Constructor with capacity. */ explicit Map(ssize_t capacity) : _data() { static_assert(std::is_convertible::value, "Invalid Type for axis::Map!"); - CCLOGINFO("In the constructor with capacity of Map!"); + AXLOGINFO("In the constructor with capacity of Map!"); _data.reserve(capacity); } @@ -105,7 +105,7 @@ public: Map(const Map& other) { static_assert(std::is_convertible::value, "Invalid Type for axis::Map!"); - CCLOGINFO("In the copy constructor of Map!"); + AXLOGINFO("In the copy constructor of Map!"); _data = other._data; addRefForAllObjects(); } @@ -114,7 +114,7 @@ public: Map(Map&& other) { static_assert(std::is_convertible::value, "Invalid Type for axis::Map!"); - CCLOGINFO("In the move constructor of Map!"); + AXLOGINFO("In the move constructor of Map!"); _data = std::move(other._data); } @@ -124,7 +124,7 @@ public: */ ~Map() { - CCLOGINFO("In the destructor of Map!"); + AXLOGINFO("In the destructor of Map!"); clear(); } @@ -273,7 +273,7 @@ public: template void insert(const K2& key, V object) { - CCASSERT(object != nullptr, "Object is nullptr!"); + AXASSERT(object != nullptr, "Object is nullptr!"); object->retain(); erase(key); _data.emplace(key, object); @@ -287,14 +287,14 @@ public: */ iterator erase(const_iterator position) { - CCASSERT(position != _data.cend(), "Invalid iterator!"); + AXASSERT(position != _data.cend(), "Invalid iterator!"); position->second->release(); return _data.erase(position); } iterator erase(iterator position) { - CCASSERT(position != _data.cend(), "Invalid iterator!"); + AXASSERT(position != _data.cend(), "Invalid iterator!"); position->second->release(); return _data.erase(position); } @@ -379,25 +379,25 @@ public: // Don't uses operator since we could not decide whether it needs 'retain'/'release'. // V& operator[] ( const K& key ) // { - // CCLOG("copy: [] ref"); + // AXLOG("copy: [] ref"); // return _data[key]; // } // // V& operator[] ( K&& key ) // { - // CCLOG("move [] ref"); + // AXLOG("move [] ref"); // return _data[key]; // } // const V& operator[] ( const K& key ) const // { - // CCLOG("const copy []"); + // AXLOG("const copy []"); // return _data.at(key); // } // // const V& operator[] ( K&& key ) const // { - // CCLOG("const move []"); + // AXLOG("const move []"); // return _data.at(key); // } @@ -406,7 +406,7 @@ public: { if (this != &other) { - CCLOGINFO("In the copy assignment operator of Map!"); + AXLOGINFO("In the copy assignment operator of Map!"); clear(); _data = other._data; addRefForAllObjects(); @@ -419,7 +419,7 @@ public: { if (this != &other) { - CCLOGINFO("In the move assignment operator of Map!"); + AXLOGINFO("In the move assignment operator of Map!"); clear(); _data = std::move(other._data); } diff --git a/core/base/CCNS.cpp b/core/base/CCNS.cpp index 97fcdc03e6..d4439d9fd4 100644 --- a/core/base/CCNS.cpp +++ b/core/base/CCNS.cpp @@ -64,24 +64,24 @@ static bool splitWithForm(std::string_view content, strArray& strs) do { - CC_BREAK_IF(content.empty()); + AX_BREAK_IF(content.empty()); size_t nPosLeft = content.find('{'); size_t nPosRight = content.find('}'); // don't have '{' and '}' - CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); + AX_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); // '}' is before '{' - CC_BREAK_IF(nPosLeft > nPosRight); + AX_BREAK_IF(nPosLeft > nPosRight); auto pointStr = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1); // nothing between '{' and '}' - CC_BREAK_IF(pointStr.empty()); + AX_BREAK_IF(pointStr.empty()); size_t nPos1 = pointStr.find('{'); size_t nPos2 = pointStr.find('}'); // contain '{' or '}' - CC_BREAK_IF(nPos1 != std::string::npos || nPos2 != std::string::npos); + AX_BREAK_IF(nPos1 != std::string::npos || nPos2 != std::string::npos); split(pointStr, ",", strs); if (strs.size() != 2 || strs[0].empty() || strs[1].empty()) @@ -104,7 +104,7 @@ Rect RectFromString(std::string_view str) do { - CC_BREAK_IF(str.empty()); + AX_BREAK_IF(str.empty()); auto content = str; // find the first '{' and the third '}' @@ -118,13 +118,13 @@ Rect RectFromString(std::string_view str) } nPosRight = content.find('}', nPosRight + 1); } - CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); + AX_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); content = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1); size_t nPointEnd = content.find('}'); - CC_BREAK_IF(nPointEnd == std::string::npos); + AX_BREAK_IF(nPointEnd == std::string::npos); nPointEnd = content.find(',', nPointEnd); - CC_BREAK_IF(nPointEnd == std::string::npos); + AX_BREAK_IF(nPointEnd == std::string::npos); // get the point string and size string auto pointStr = content.substr(0, nPointEnd); @@ -132,9 +132,9 @@ Rect RectFromString(std::string_view str) // split the string with ',' strArray pointInfo; - CC_BREAK_IF(!splitWithForm(pointStr, pointInfo)); + AX_BREAK_IF(!splitWithForm(pointStr, pointInfo)); strArray sizeInfo; - CC_BREAK_IF(!splitWithForm(sizeStr, sizeInfo)); + AX_BREAK_IF(!splitWithForm(sizeStr, sizeInfo)); float x = (float)utils::atof(pointInfo[0].c_str()); float y = (float)utils::atof(pointInfo[1].c_str()); @@ -154,7 +154,7 @@ Vec2 PointFromString(std::string_view str) do { strArray strs; - CC_BREAK_IF(!splitWithForm(str, strs)); + AX_BREAK_IF(!splitWithForm(str, strs)); float x = (float)utils::atof(strs[0].c_str()); float y = (float)utils::atof(strs[1].c_str()); @@ -172,7 +172,7 @@ Vec2 SizeFromString(std::string_view pszContent) do { strArray strs; - CC_BREAK_IF(!splitWithForm(pszContent, strs)); + AX_BREAK_IF(!splitWithForm(pszContent, strs)); float width = (float)utils::atof(strs[0].c_str()); float height = (float)utils::atof(strs[1].c_str()); diff --git a/core/base/CCNS.h b/core/base/CCNS.h index e0f3b9114f..0dc9c7a1fb 100644 --- a/core/base/CCNS.h +++ b/core/base/CCNS.h @@ -46,7 +46,7 @@ NS_AX_BEGIN * @return A Core Graphics structure that represents a rectangle. * If the string is not well-formed, the function returns Rect::ZERO. */ -Rect CC_DLL RectFromString(std::string_view str); +Rect AX_DLL RectFromString(std::string_view str); /** * @brief Returns a Core Graphics point structure corresponding to the data in a given string. @@ -58,7 +58,7 @@ Rect CC_DLL RectFromString(std::string_view str); * @return A Core Graphics structure that represents a point. * If the string is not well-formed, the function returns Vec2::ZERO. */ -Vec2 CC_DLL PointFromString(std::string_view str); +Vec2 AX_DLL PointFromString(std::string_view str); /** * @brief Returns a Core Graphics size structure corresponding to the data in a given string. @@ -70,7 +70,7 @@ Vec2 CC_DLL PointFromString(std::string_view str); * @return A Core Graphics structure that represents a size. * If the string is not well-formed, the function returns Vec2::ZERO. */ -Vec2 CC_DLL SizeFromString(std::string_view str); +Vec2 AX_DLL SizeFromString(std::string_view str); // end of data_structure group /** @} */ diff --git a/core/base/CCNinePatchImageParser.cpp b/core/base/CCNinePatchImageParser.cpp index 64ffd0c67e..acdb538b19 100644 --- a/core/base/CCNinePatchImageParser.cpp +++ b/core/base/CCNinePatchImageParser.cpp @@ -35,14 +35,14 @@ NinePatchImageParser::NinePatchImageParser() : _image(nullptr), _imageFrame(Rect NinePatchImageParser::NinePatchImageParser(Image* image) : _image(image), _imageFrame(Rect::ZERO), _isRotated(false) { this->_imageFrame = Rect(0, 0, image->getWidth(), image->getHeight()); - CCASSERT(image->getPixelFormat() == backend::PixelFormat::RGBA8, + AXASSERT(image->getPixelFormat() == backend::PixelFormat::RGBA8, "unsupported format, currently only supports rgba8888"); } NinePatchImageParser::NinePatchImageParser(Image* image, const Rect& frame, bool rotated) : _image(image), _imageFrame(frame), _isRotated(rotated) { - CCASSERT(image->getPixelFormat() == backend::PixelFormat::RGBA8, + AXASSERT(image->getPixelFormat() == backend::PixelFormat::RGBA8, "unsupported format, currently only supports rgba8888"); } @@ -166,14 +166,14 @@ Rect NinePatchImageParser::parseCapInset() const verticalLine.y - verticalLine.x); } - capInsets = CC_RECT_PIXELS_TO_POINTS(capInsets); + capInsets = AX_RECT_PIXELS_TO_POINTS(capInsets); return capInsets; } void NinePatchImageParser::setSpriteFrameInfo(Image* image, const axis::Rect& frameRect, bool rotated) { this->_image = image; - CCASSERT(image->getPixelFormat() == backend::PixelFormat::RGBA8, + AXASSERT(image->getPixelFormat() == backend::PixelFormat::RGBA8, "unsupported format, currently only supports rgba8888"); this->_imageFrame = frameRect; this->_isRotated = rotated; diff --git a/core/base/CCNinePatchImageParser.h b/core/base/CCNinePatchImageParser.h index ec189a16c6..d248b2598c 100644 --- a/core/base/CCNinePatchImageParser.h +++ b/core/base/CCNinePatchImageParser.h @@ -42,7 +42,7 @@ class SpriteFrame; * - TexturePacker Trim mode is not supported at the moment. */ -class CC_DLL NinePatchImageParser +class AX_DLL NinePatchImageParser { public: /** diff --git a/core/base/CCProfiling.cpp b/core/base/CCProfiling.cpp index 75dcce055e..6e43641922 100644 --- a/core/base/CCProfiling.cpp +++ b/core/base/CCProfiling.cpp @@ -142,7 +142,7 @@ void ProfilingEndTimingBlock(const char* timerName) Profiler* p = Profiler::getInstance(); ProfilingTimer* timer = p->_activeTimers.at(timerName); - CCASSERT(timer, "CCProfilingTimer not found"); + AXASSERT(timer, "CCProfilingTimer not found"); int32_t duration = static_cast(chrono::duration_cast(now - timer->_startTime).count()); @@ -159,7 +159,7 @@ void ProfilingResetTimingBlock(const char* timerName) Profiler* p = Profiler::getInstance(); ProfilingTimer* timer = p->_activeTimers.at(timerName); - CCASSERT(timer, "CCProfilingTimer not found"); + AXASSERT(timer, "CCProfilingTimer not found"); timer->reset(); } diff --git a/core/base/CCProfiling.h b/core/base/CCProfiling.h index fbb1f551bc..340160af94 100644 --- a/core/base/CCProfiling.h +++ b/core/base/CCProfiling.h @@ -47,10 +47,10 @@ class ProfilingTimer; /** Profiler cocos2d builtin profiler. - To use it, enable set the CC_ENABLE_PROFILERS=1 in the ccConfig.h file + To use it, enable set the AX_ENABLE_PROFILERS=1 in the ccConfig.h file */ -class CC_DLL Profiler : public Ref +class AX_DLL Profiler : public Ref { public: /** @@ -140,9 +140,9 @@ public: int32_t numberOfCalls; }; -extern void CC_DLL ProfilingBeginTimingBlock(const char* timerName); -extern void CC_DLL ProfilingEndTimingBlock(const char* timerName); -extern void CC_DLL ProfilingResetTimingBlock(const char* timerName); +extern void AX_DLL ProfilingBeginTimingBlock(const char* timerName); +extern void AX_DLL ProfilingEndTimingBlock(const char* timerName); +extern void AX_DLL ProfilingResetTimingBlock(const char* timerName); /* * cocos2d profiling categories diff --git a/core/base/CCProperties.cpp b/core/base/CCProperties.cpp index 4d1f768ecb..5dfa96edd5 100644 --- a/core/base/CCProperties.cpp +++ b/core/base/CCProperties.cpp @@ -101,7 +101,7 @@ Properties* Properties::createNonRefCounted(std::string_view url) { if (url.empty()) { - CCLOGERROR("Attempting to create a Properties object from an empty URL!"); + AXLOGERROR("Attempting to create a Properties object from an empty URL!"); return nullptr; } @@ -122,8 +122,8 @@ Properties* Properties::createNonRefCounted(std::string_view url) Properties* p = getPropertiesFromNamespacePath(properties, namespacePath); if (!p) { - CCLOGWARN("Failed to load properties from url '%s'.", url.data()); - CC_SAFE_DELETE(properties); + AXLOGWARN("Failed to load properties from url '%s'.", url.data()); + AX_SAFE_DELETE(properties); return nullptr; } @@ -133,7 +133,7 @@ Properties* Properties::createNonRefCounted(std::string_view url) if (p != properties) { p = p->clone(); - CC_SAFE_DELETE(properties); + AX_SAFE_DELETE(properties); } // XXX // p->setDirectoryPath(FileSystem::getDirectoryName(fileString)); @@ -159,7 +159,7 @@ static bool isVariable(const char* str, char* outName, size_t outSize) void Properties::readProperties() { - CCASSERT(_data->getSize() > 0, "Invalid data"); + AXASSERT(_data->getSize() > 0, "Invalid data"); char line[2048]; char variable[256]; @@ -185,7 +185,7 @@ void Properties::readProperties() rc = readLine(line, 2048); if (rc == NULL) { - CCLOGERROR("Error reading line from file."); + AXLOGERROR("Error reading line from file."); return; } @@ -219,7 +219,7 @@ void Properties::readProperties() name = strtok(line, "="); if (name == NULL) { - CCLOGERROR("Error parsing properties file: attribute without name."); + AXLOGERROR("Error parsing properties file: attribute without name."); return; } @@ -230,7 +230,7 @@ void Properties::readProperties() value = strtok(NULL, ""); if (value == NULL) { - CCLOGERROR("Error parsing properties file: attribute with name ('%s') but no value.", name); + AXLOGERROR("Error parsing properties file: attribute with name ('%s') but no value.", name); return; } @@ -272,7 +272,7 @@ void Properties::readProperties() name = trimWhiteSpace(name); if (name == NULL) { - CCLOGERROR("Error parsing properties file: failed to determine a valid token for line '%s'.", line); + AXLOGERROR("Error parsing properties file: failed to determine a valid token for line '%s'.", line); return; } else if (name[0] == '}') @@ -299,20 +299,20 @@ void Properties::readProperties() { if (seekFromCurrent(-1) == false) { - CCLOGERROR("Failed to seek back to before a '}' character in properties file."); + AXLOGERROR("Failed to seek back to before a '}' character in properties file."); return; } while (readChar() != '}') { if (seekFromCurrent(-2) == false) { - CCLOGERROR("Failed to seek back to before a '}' character in properties file."); + AXLOGERROR("Failed to seek back to before a '}' character in properties file."); return; } } if (seekFromCurrent(-1) == false) { - CCLOGERROR("Failed to seek back to before a '}' character in properties file."); + AXLOGERROR("Failed to seek back to before a '}' character in properties file."); return; } } @@ -326,7 +326,7 @@ void Properties::readProperties() { if (seekFromCurrent(1) == false) { - CCLOGERROR("Failed to seek to immediately after a '}' character in properties file."); + AXLOGERROR("Failed to seek to immediately after a '}' character in properties file."); return; } } @@ -341,20 +341,20 @@ void Properties::readProperties() { if (seekFromCurrent(-1) == false) { - CCLOGERROR("Failed to seek back to before a '}' character in properties file."); + AXLOGERROR("Failed to seek back to before a '}' character in properties file."); return; } while (readChar() != '}') { if (seekFromCurrent(-2) == false) { - CCLOGERROR("Failed to seek back to before a '}' character in properties file."); + AXLOGERROR("Failed to seek back to before a '}' character in properties file."); return; } } if (seekFromCurrent(-1) == false) { - CCLOGERROR("Failed to seek back to before a '}' character in properties file."); + AXLOGERROR("Failed to seek back to before a '}' character in properties file."); return; } } @@ -368,7 +368,7 @@ void Properties::readProperties() { if (seekFromCurrent(1) == false) { - CCLOGERROR("Failed to seek to immediately after a '}' character in properties file."); + AXLOGERROR("Failed to seek to immediately after a '}' character in properties file."); return; } } @@ -388,7 +388,7 @@ void Properties::readProperties() { // Back up from fgetc() if (seekFromCurrent(-1) == false) - CCLOGERROR( + AXLOGERROR( "Failed to seek backwards a single character after testing if the next line starts " "with '{'."); @@ -411,13 +411,13 @@ void Properties::readProperties() Properties::~Properties() { - CC_SAFE_DELETE(_dirPath); + AX_SAFE_DELETE(_dirPath); for (size_t i = 0, count = _namespaces.size(); i < count; ++i) { - CC_SAFE_DELETE(_namespaces[i]); + AX_SAFE_DELETE(_namespaces[i]); } - CC_SAFE_DELETE(_variables); + AX_SAFE_DELETE(_variables); } // @@ -481,7 +481,7 @@ void Properties::skipWhiteSpace() { if (seekFromCurrent(-1) == false) { - CCLOGERROR("Failed to seek backwards one character after skipping whitespace."); + AXLOGERROR("Failed to seek backwards one character after skipping whitespace."); } } } @@ -546,7 +546,7 @@ void Properties::resolveInheritance(const char* id) // Delete the child's data. for (size_t i = 0, count = derived->_namespaces.size(); i < count; i++) { - CC_SAFE_DELETE(derived->_namespaces[i]); + AX_SAFE_DELETE(derived->_namespaces[i]); } // Copy data from the parent into the child. @@ -563,7 +563,7 @@ void Properties::resolveInheritance(const char* id) derived->mergeWith(overrides); // Delete the child copy. - CC_SAFE_DELETE(overrides); + AX_SAFE_DELETE(overrides); } } @@ -584,7 +584,7 @@ void Properties::resolveInheritance(const char* id) void Properties::mergeWith(Properties* overrides) { - CCASSERT(overrides, "Invalid overrides"); + AXASSERT(overrides, "Invalid overrides"); // Overwrite or add each property found in child. overrides->rewind(); @@ -674,7 +674,7 @@ void Properties::rewind() Properties* Properties::getNamespace(const char* id, bool searchNames, bool recurse) const { - CCASSERT(id, "invalid id"); + AXASSERT(id, "invalid id"); for (const auto& it : _namespaces) { @@ -720,7 +720,7 @@ bool Properties::exists(const char* name) const static bool isStringNumeric(const char* str) { - CCASSERT(str, "invalid str"); + AXASSERT(str, "invalid str"); // The first character may be '-' if (*str == '-') @@ -879,7 +879,7 @@ int Properties::getInt(const char* name) const scanned = sscanf(valueString, "%d", &value); if (scanned != 1) { - CCLOGERROR("Error attempting to parse property '%s' as an integer.", name); + AXLOGERROR("Error attempting to parse property '%s' as an integer.", name); return 0; } return value; @@ -898,7 +898,7 @@ float Properties::getFloat(const char* name) const scanned = sscanf(valueString, "%f", &value); if (scanned != 1) { - CCLOGERROR("Error attempting to parse property '%s' as a float.", name); + AXLOGERROR("Error attempting to parse property '%s' as a float.", name); return 0.0f; } return value; @@ -909,7 +909,7 @@ float Properties::getFloat(const char* name) const bool Properties::getMat4(const char* name, Mat4* out) const { - CCASSERT(out, "Invalid out"); + AXASSERT(out, "Invalid out"); const char* valueString = getString(name); if (valueString) @@ -921,7 +921,7 @@ bool Properties::getMat4(const char* name, Mat4* out) const if (scanned != 16) { - CCLOGERROR("Error attempting to parse property '%s' as a matrix.", name); + AXLOGERROR("Error attempting to parse property '%s' as a matrix.", name); out->setIdentity(); return false; } @@ -966,7 +966,7 @@ bool Properties::getColor(const char* name, Vec4* out) const bool Properties::getPath(const char* name, std::string* path) const { - CCASSERT(name && path, "Invalid name or path"); + AXASSERT(name && path, "Invalid name or path"); const char* valueString = getString(name); if (valueString) { @@ -1021,7 +1021,7 @@ const char* Properties::getVariable(const char* name, const char* defaultValue) void Properties::setVariable(const char* name, const char* value) { - CCASSERT(name, "Invalid name"); + AXASSERT(name, "Invalid name"); Property* prop = NULL; @@ -1071,7 +1071,7 @@ Properties* Properties::clone() for (size_t i = 0, count = _namespaces.size(); i < count; i++) { - CCASSERT(_namespaces[i], "Invalid namespace"); + AXASSERT(_namespaces[i], "Invalid namespace"); Properties* child = _namespaces[i]->clone(); p->_namespaces.push_back(child); child->_parent = p; @@ -1089,7 +1089,7 @@ void Properties::setDirectoryPath(const std::string* path) } else { - CC_SAFE_DELETE(_dirPath); + AX_SAFE_DELETE(_dirPath); } } @@ -1144,7 +1144,7 @@ Properties* getPropertiesFromNamespacePath(Properties* properties, const std::ve { if (iter == NULL) { - CCLOGWARN("Failed to load properties object from url."); + AXLOGWARN("Failed to load properties object from url."); return nullptr; } @@ -1185,7 +1185,7 @@ bool Properties::parseVec2(const char* str, Vec2* out) } else { - CCLOGWARN("Error attempting to parse property as a two-dimensional vector: %s", str); + AXLOGWARN("Error attempting to parse property as a two-dimensional vector: %s", str); } } @@ -1207,7 +1207,7 @@ bool Properties::parseVec3(const char* str, Vec3* out) } else { - CCLOGWARN("Error attempting to parse property as a three-dimensional vector: %s", str); + AXLOGWARN("Error attempting to parse property as a three-dimensional vector: %s", str); } } @@ -1229,7 +1229,7 @@ bool Properties::parseVec4(const char* str, Vec4* out) } else { - CCLOGWARN("Error attempting to parse property as a four-dimensional vector: %s", str); + AXLOGWARN("Error attempting to parse property as a four-dimensional vector: %s", str); } } @@ -1251,7 +1251,7 @@ bool Properties::parseAxisAngle(const char* str, Quaternion* out) } else { - CCLOGWARN("Error attempting to parse property as an axis-angle rotation: %s", str); + AXLOGWARN("Error attempting to parse property as an axis-angle rotation: %s", str); } } @@ -1277,13 +1277,13 @@ bool Properties::parseColor(const char* str, Vec3* out) else { // Invalid format - CCLOGWARN("Error attempting to parse property as an RGB color: %s", str); + AXLOGWARN("Error attempting to parse property as an RGB color: %s", str); } } else { // Not a color string. - CCLOGWARN("Error attempting to parse property as an RGB color (not specified as a color string): %s", str); + AXLOGWARN("Error attempting to parse property as an RGB color (not specified as a color string): %s", str); } } @@ -1309,13 +1309,13 @@ bool Properties::parseColor(const char* str, Vec4* out) else { // Invalid format - CCLOGWARN("Error attempting to parse property as an RGBA color: %s", str); + AXLOGWARN("Error attempting to parse property as an RGBA color: %s", str); } } else { // Not a color string. - CCLOGWARN("Error attempting to parse property as an RGBA color (not specified as a color string): %s", str); + AXLOGWARN("Error attempting to parse property as an RGBA color (not specified as a color string): %s", str); } } diff --git a/core/base/CCProperties.h b/core/base/CCProperties.h index 1025134ff0..ba9668fa4d 100644 --- a/core/base/CCProperties.h +++ b/core/base/CCProperties.h @@ -156,7 +156,7 @@ class Data; * of a property. If the type is unknown, its string can be retrieved and interpreted * as necessary. */ -class CC_DLL Properties +class AX_DLL Properties { public: /** diff --git a/core/base/CCProtocols.h b/core/base/CCProtocols.h index 8625dea95a..00b02cf263 100644 --- a/core/base/CCProtocols.h +++ b/core/base/CCProtocols.h @@ -39,7 +39,7 @@ NS_AX_BEGIN /** * RGBA protocol that affects Node's color and opacity */ -class CC_DLL __RGBAProtocol +class AX_DLL __RGBAProtocol { public: virtual ~__RGBAProtocol() {} @@ -168,7 +168,7 @@ public: * Please refer to glBlendFunc in OpenGL ES Manual * http://www.khronos.org/opengles/sdk/docs/man/xhtml/glBlendFunc.xml for more details. */ -class CC_DLL BlendProtocol +class AX_DLL BlendProtocol { public: virtual ~BlendProtocol() {} @@ -203,7 +203,7 @@ public: * src=BlendFactor::SRC_ALPHA dst= BlendFactor::ONE_MINUS_SRC_ALPHA * But you can change the blending function at any time. */ -class CC_DLL TextureProtocol : public BlendProtocol +class AX_DLL TextureProtocol : public BlendProtocol { public: virtual ~TextureProtocol() {} @@ -229,7 +229,7 @@ public: /** * Common interface for Labels */ -class CC_DLL LabelProtocol +class AX_DLL LabelProtocol { public: virtual ~LabelProtocol() {} @@ -256,7 +256,7 @@ public: /** * OpenGL projection protocol */ -class CC_DLL DirectorDelegate +class AX_DLL DirectorDelegate { public: virtual ~DirectorDelegate() {} @@ -272,7 +272,7 @@ public: /** * interface for playable items */ -class CC_DLL PlayableProtocol +class AX_DLL PlayableProtocol { public: virtual ~PlayableProtocol() {} diff --git a/core/base/CCRef.cpp b/core/base/CCRef.cpp index e1af11b336..9a0a66e842 100644 --- a/core/base/CCRef.cpp +++ b/core/base/CCRef.cpp @@ -29,7 +29,7 @@ THE SOFTWARE. #include "base/ccMacros.h" #include "base/CCScriptSupport.h" -#if CC_REF_LEAK_DETECTION +#if AX_REF_LEAK_DETECTION # include // std::find # include # include @@ -38,41 +38,41 @@ THE SOFTWARE. NS_AX_BEGIN -#if CC_REF_LEAK_DETECTION +#if AX_REF_LEAK_DETECTION static void trackRef(Ref* ref); static void untrackRef(Ref* ref); #endif Ref::Ref() : _referenceCount(1) // when the Ref is created, the reference count of it is 1 -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING , _luaID(0) , _scriptObject(nullptr) , _rooted(false) #endif { -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING static unsigned int uObjectCount = 0; _ID = ++uObjectCount; #endif -#if CC_REF_LEAK_DETECTION +#if AX_REF_LEAK_DETECTION trackRef(this); #endif } Ref::~Ref() { -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEngineProtocol* pEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (pEngine != nullptr && _luaID) { // if the object is referenced by Lua engine, remove it pEngine->removeScriptObjectByObject(this); } -#endif // CC_ENABLE_SCRIPT_BINDING +#endif // AX_ENABLE_SCRIPT_BINDING -#if CC_REF_LEAK_DETECTION +#if AX_REF_LEAK_DETECTION if (_referenceCount != 0) untrackRef(this); #endif @@ -80,18 +80,18 @@ Ref::~Ref() void Ref::retain() { - CCASSERT(_referenceCount > 0, "reference count should be greater than 0"); + AXASSERT(_referenceCount > 0, "reference count should be greater than 0"); ++_referenceCount; } void Ref::release() { - CCASSERT(_referenceCount > 0, "reference count should be greater than 0"); + AXASSERT(_referenceCount > 0, "reference count should be greater than 0"); --_referenceCount; if (_referenceCount == 0) { -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) +#if defined(AXIS_DEBUG) && (AXIS_DEBUG > 0) auto poolManager = PoolManager::getInstance(); if (!poolManager->getCurrentPool()->isClearing() && poolManager->isObjectInPools(this)) { @@ -123,11 +123,11 @@ void Ref::release() // auto obj = Node::create(); // obj->retain(); // obj->release(); // This `release` is the pair of `retain` of previous line. - CCASSERT(false, "The reference shouldn't be 0 because it is still in autorelease pool."); + AXASSERT(false, "The reference shouldn't be 0 because it is still in autorelease pool."); } #endif -#if CC_REF_LEAK_DETECTION +#if AX_REF_LEAK_DETECTION untrackRef(this); #endif delete this; @@ -145,7 +145,7 @@ unsigned int Ref::getReferenceCount() const return _referenceCount; } -#if CC_REF_LEAK_DETECTION +#if AX_REF_LEAK_DETECTION static std::vector __refAllocationList; static std::mutex __refMutex; @@ -164,7 +164,7 @@ void Ref::printLeaks() for (const auto& ref : __refAllocationList) { - CC_ASSERT(ref); + AX_ASSERT(ref); const char* type = typeid(*ref).name(); log("[memory] LEAK: Ref object '%s' still active with reference count %d.\n", (type ? type : ""), ref->getReferenceCount()); @@ -175,7 +175,7 @@ void Ref::printLeaks() static void trackRef(Ref* ref) { std::lock_guard refLockGuard(__refMutex); - CCASSERT(ref, "Invalid parameter, ref should not be null!"); + AXASSERT(ref, "Invalid parameter, ref should not be null!"); // Create memory allocation record. __refAllocationList.push_back(ref); @@ -194,6 +194,6 @@ static void untrackRef(Ref* ref) __refAllocationList.erase(iter); } -#endif // #if CC_REF_LEAK_DETECTION +#endif // #if AX_REF_LEAK_DETECTION NS_AX_END diff --git a/core/base/CCRef.h b/core/base/CCRef.h index 7beeedd2e6..9a74e8ded1 100644 --- a/core/base/CCRef.h +++ b/core/base/CCRef.h @@ -30,7 +30,7 @@ THE SOFTWARE. #include "platform/CCPlatformMacros.h" #include "base/ccConfig.h" -#define CC_REF_LEAK_DETECTION 0 +#define AX_REF_LEAK_DETECTION 0 /** * @addtogroup base @@ -45,7 +45,7 @@ class Ref; * @lua NA * @js NA */ -class CC_DLL Clonable +class AX_DLL Clonable { public: /** Returns a copy of the Ref. */ @@ -63,7 +63,7 @@ public: * then it is easy to be shared in different places. * @js NA */ -class CC_DLL Ref +class AX_DLL Ref { public: /** @@ -138,7 +138,7 @@ protected: friend class AutoreleasePool; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING public: /// object id, ScriptSupport need public _ID unsigned int _ID; @@ -153,8 +153,8 @@ public: bool _rooted; #endif - // Memory leak diagnostic data (only included when CC_REF_LEAK_DETECTION is defined and its value isn't zero) -#if CC_REF_LEAK_DETECTION + // Memory leak diagnostic data (only included when AX_REF_LEAK_DETECTION is defined and its value isn't zero) +#if AX_REF_LEAK_DETECTION public: static void printLeaks(); #endif @@ -169,12 +169,12 @@ typedef void (Ref::*SEL_CallFuncO)(Ref*); typedef void (Ref::*SEL_MenuHandler)(Ref*); typedef void (Ref::*SEL_SCHEDULE)(float); -#define CC_CALLFUNC_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) -#define CC_CALLFUNCN_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) -#define CC_CALLFUNCND_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) -#define CC_CALLFUNCO_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) -#define CC_MENU_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) -#define CC_SCHEDULE_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) +#define AX_CALLFUNC_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) +#define AX_CALLFUNCN_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) +#define AX_CALLFUNCND_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) +#define AX_CALLFUNCO_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) +#define AX_MENU_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) +#define AX_SCHEDULE_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) NS_AX_END // end of base group diff --git a/core/base/CCRefPtr.h b/core/base/CCRefPtr.h index 7e92da5fe2..89ba5449ff 100644 --- a/core/base/CCRefPtr.h +++ b/core/base/CCRefPtr.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_REF_PTR_H__ -#define __CC_REF_PTR_H__ +#ifndef __AX_REF_PTR_H__ +#define __AX_REF_PTR_H__ /// @cond DO_NOT_SHOW #include "base/CCRef.h" @@ -39,7 +39,7 @@ NS_AX_BEGIN * Utility/support macros. Defined to enable RefPtr to contain types like 'const T' because we do not * regard retain()/release() as affecting mutability of state. */ -#define CC_REF_PTR_SAFE_RETAIN(ptr) \ +#define AX_REF_PTR_SAFE_RETAIN(ptr) \ \ do \ { \ @@ -50,7 +50,7 @@ NS_AX_BEGIN \ } while (0); -#define CC_REF_PTR_SAFE_RELEASE(ptr) \ +#define AX_REF_PTR_SAFE_RELEASE(ptr) \ \ do \ { \ @@ -61,7 +61,7 @@ NS_AX_BEGIN \ } while (0); -#define CC_REF_PTR_SAFE_RELEASE_NULL(ptr) \ +#define AX_REF_PTR_SAFE_RELEASE_NULL(ptr) \ \ do \ { \ @@ -102,7 +102,7 @@ public: other._ptr = nullptr; } - RefPtr(T* ptr) : _ptr(ptr) { CC_REF_PTR_SAFE_RETAIN(_ptr); } + RefPtr(T* ptr) : _ptr(ptr) { AX_REF_PTR_SAFE_RETAIN(_ptr); } template RefPtr(ReferencedObject<_Other>&& ptr) : _ptr(ptr._ptr) @@ -110,16 +110,16 @@ public: RefPtr(std::nullptr_t ptr) : _ptr(nullptr) {} - RefPtr(const RefPtr& other) : _ptr(other._ptr) { CC_REF_PTR_SAFE_RETAIN(_ptr); } + RefPtr(const RefPtr& other) : _ptr(other._ptr) { AX_REF_PTR_SAFE_RETAIN(_ptr); } - ~RefPtr() { CC_REF_PTR_SAFE_RELEASE_NULL(_ptr); } + ~RefPtr() { AX_REF_PTR_SAFE_RELEASE_NULL(_ptr); } RefPtr& operator=(const RefPtr& other) { if (other._ptr != _ptr) { - CC_REF_PTR_SAFE_RETAIN(other._ptr); - CC_REF_PTR_SAFE_RELEASE(_ptr); + AX_REF_PTR_SAFE_RETAIN(other._ptr); + AX_REF_PTR_SAFE_RELEASE(_ptr); _ptr = other._ptr; } @@ -130,7 +130,7 @@ public: { if (&other != this) { - CC_REF_PTR_SAFE_RELEASE(_ptr); + AX_REF_PTR_SAFE_RELEASE(_ptr); _ptr = other._ptr; other._ptr = nullptr; } @@ -142,8 +142,8 @@ public: { if (other != _ptr) { - CC_REF_PTR_SAFE_RETAIN(other); - CC_REF_PTR_SAFE_RELEASE(_ptr); + AX_REF_PTR_SAFE_RETAIN(other); + AX_REF_PTR_SAFE_RELEASE(_ptr); _ptr = other; } @@ -152,7 +152,7 @@ public: RefPtr& operator=(std::nullptr_t other) { - CC_REF_PTR_SAFE_RELEASE_NULL(_ptr); + AX_REF_PTR_SAFE_RELEASE_NULL(_ptr); return *this; } @@ -160,13 +160,13 @@ public: T& operator*() const { - CCASSERT(_ptr, "Attempt to dereference a null pointer!"); + AXASSERT(_ptr, "Attempt to dereference a null pointer!"); return *_ptr; } T* operator->() const { - CCASSERT(_ptr, "Attempt to dereference a null pointer!"); + AXASSERT(_ptr, "Attempt to dereference a null pointer!"); return _ptr; } @@ -214,7 +214,7 @@ public: explicit operator bool() const { return _ptr != nullptr; } - void reset() { CC_REF_PTR_SAFE_RELEASE_NULL(_ptr); } + void reset() { AX_REF_PTR_SAFE_RELEASE_NULL(_ptr); } void swap(RefPtr& other) { @@ -242,7 +242,7 @@ public: */ void weakAssign(const RefPtr& other) { - CC_REF_PTR_SAFE_RELEASE(_ptr); + AX_REF_PTR_SAFE_RELEASE(_ptr); _ptr = other._ptr; } @@ -328,11 +328,11 @@ RefPtr dynamic_pointer_cast(const RefPtr& r) /** * Done with these macros. */ -#undef CC_REF_PTR_SAFE_RETAIN -#undef CC_REF_PTR_SAFE_RELEASE -#undef CC_REF_PTR_SAFE_RELEASE_NULL +#undef AX_REF_PTR_SAFE_RETAIN +#undef AX_REF_PTR_SAFE_RELEASE +#undef AX_REF_PTR_SAFE_RELEASE_NULL NS_AX_END /// @endcond -#endif // __CC_REF_PTR_H__ +#endif // __AX_REF_PTR_H__ diff --git a/core/base/CCScheduler.cpp b/core/base/CCScheduler.cpp index 1109449b2f..9ae3d570c4 100644 --- a/core/base/CCScheduler.cpp +++ b/core/base/CCScheduler.cpp @@ -89,7 +89,7 @@ void Timer::setupTimerWithInterval(float seconds, unsigned int repeat, float del _delay = delay; _useDelay = (_delay > 0.0f) ? true : false; _repeat = repeat; - _runForever = (_repeat == CC_REPEAT_FOREVER) ? true : false; + _runForever = (_repeat == AX_REPEAT_FOREVER) ? true : false; _timesExecuted = 0; } @@ -214,7 +214,7 @@ void TimerTargetCallback::cancel() _scheduler->unschedule(_key, _target); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING // TimerScriptHandler @@ -259,7 +259,7 @@ Scheduler::Scheduler() , _currentTarget(nullptr) , _currentTargetSalvaged(false) , _updateHashLocked(false) -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING , _scriptHandlerEntries(20) #endif { @@ -285,7 +285,7 @@ void Scheduler::schedule(const ccSchedulerFunc& callback, bool paused, std::string_view key) { - this->schedule(callback, target, interval, CC_REPEAT_FOREVER, 0.0f, paused, key); + this->schedule(callback, target, interval, AX_REPEAT_FOREVER, 0.0f, paused, key); } void Scheduler::schedule(const ccSchedulerFunc& callback, @@ -296,8 +296,8 @@ void Scheduler::schedule(const ccSchedulerFunc& callback, bool paused, std::string_view key) { - CCASSERT(target, "Argument target must be non-nullptr"); - CCASSERT(!key.empty(), "key should not be empty!"); + AXASSERT(target, "Argument target must be non-nullptr"); + AXASSERT(!key.empty(), "key should not be empty!"); tHashTimerEntry* element = nullptr; HASH_FIND_PTR(_hashForTimers, &target, element); @@ -314,7 +314,7 @@ void Scheduler::schedule(const ccSchedulerFunc& callback, } else { - CCASSERT(element->paused == paused, "element's paused should be paused!"); + AXASSERT(element->paused == paused, "element's paused should be paused!"); } if (element->timers == nullptr) @@ -329,7 +329,7 @@ void Scheduler::schedule(const ccSchedulerFunc& callback, if (timer && !timer->isExhausted() && key == timer->getKey()) { - CCLOG("CCScheduler#schedule. Reiniting timer with interval %.4f, repeat %u, delay %.4f", interval, + AXLOG("CCScheduler#schedule. Reiniting timer with interval %.4f, repeat %u, delay %.4f", interval, repeat, delay); timer->setupTimerWithInterval(interval, repeat, delay); return; @@ -352,8 +352,8 @@ void Scheduler::unschedule(std::string_view key, void* target) return; } - // CCASSERT(target); - // CCASSERT(selector); + // AXASSERT(target); + // AXASSERT(selector); tHashTimerEntry* element = nullptr; HASH_FIND_PTR(_hashForTimers, &target, element); @@ -514,8 +514,8 @@ void Scheduler::schedulePerFrame(const ccSchedulerFunc& callback, void* target, bool Scheduler::isScheduled(std::string_view key, const void* target) const { - CCASSERT(!key.empty(), "Argument key must not be empty"); - CCASSERT(target, "Argument target must be non-nullptr"); + AXASSERT(!key.empty(), "Argument key must not be empty"); + AXASSERT(target, "Argument target must be non-nullptr"); tHashTimerEntry* element = nullptr; HASH_FIND_PTR(_hashForTimers, &target, element); @@ -553,7 +553,7 @@ void Scheduler::removeUpdateFromHash(struct _listEntry* entry) // list entry DL_DELETE(*element->list, element->entry); if (!_updateHashLocked) - CC_SAFE_DELETE(element->entry); + AX_SAFE_DELETE(element->entry); else { element->entry->markedForDeletion = true; @@ -623,7 +623,7 @@ void Scheduler::unscheduleAllWithMinPriority(int minPriority) unscheduleUpdate(entry->target); } } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING _scriptHandlerEntries.clear(); #endif } @@ -663,7 +663,7 @@ void Scheduler::unscheduleAllForTarget(void* target) unscheduleUpdate(target); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING unsigned int Scheduler::scheduleScriptFunc(unsigned int handler, float interval, bool paused) { SchedulerScriptHandlerEntry* entry = SchedulerScriptHandlerEntry::create(handler, interval, paused); @@ -688,7 +688,7 @@ void Scheduler::unscheduleScriptEntry(unsigned int scheduleScriptEntryID) void Scheduler::resumeTarget(void* target) { - CCASSERT(target != nullptr, "target can't be nullptr!"); + AXASSERT(target != nullptr, "target can't be nullptr!"); // custom selectors tHashTimerEntry* element = nullptr; @@ -703,14 +703,14 @@ void Scheduler::resumeTarget(void* target) HASH_FIND_PTR(_hashForUpdates, &target, elementUpdate); if (elementUpdate) { - CCASSERT(elementUpdate->entry != nullptr, "elementUpdate's entry can't be nullptr!"); + AXASSERT(elementUpdate->entry != nullptr, "elementUpdate's entry can't be nullptr!"); elementUpdate->entry->paused = false; } } void Scheduler::pauseTarget(void* target) { - CCASSERT(target != nullptr, "target can't be nullptr!"); + AXASSERT(target != nullptr, "target can't be nullptr!"); // custom selectors tHashTimerEntry* element = nullptr; @@ -725,14 +725,14 @@ void Scheduler::pauseTarget(void* target) HASH_FIND_PTR(_hashForUpdates, &target, elementUpdate); if (elementUpdate) { - CCASSERT(elementUpdate->entry != nullptr, "elementUpdate's entry can't be nullptr!"); + AXASSERT(elementUpdate->entry != nullptr, "elementUpdate's entry can't be nullptr!"); elementUpdate->entry->paused = true; } } bool Scheduler::isTargetPaused(void* target) { - CCASSERT(target != nullptr, "target must be non nil"); + AXASSERT(target != nullptr, "target must be non nil"); // Custom selectors tHashTimerEntry* element = nullptr; @@ -880,7 +880,7 @@ void Scheduler::update(float dt) for (elt->timerIndex = 0; elt->timerIndex < elt->timers->num; ++(elt->timerIndex)) { elt->currentTimer = (Timer*)(elt->timers->arr[elt->timerIndex]); - CCASSERT(!elt->currentTimer->isAborted(), "An aborted timer should not be updated"); + AXASSERT(!elt->currentTimer->isAborted(), "An aborted timer should not be updated"); elt->currentTimer->update(dt); @@ -916,7 +916,7 @@ void Scheduler::update(float dt) _updateHashLocked = false; _currentTarget = nullptr; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING // // Script callbacks // @@ -966,7 +966,7 @@ void Scheduler::schedule(SEL_SCHEDULE selector, float delay, bool paused) { - CCASSERT(target, "Argument target must be non-nullptr"); + AXASSERT(target, "Argument target must be non-nullptr"); tHashTimerEntry* element = nullptr; HASH_FIND_PTR(_hashForTimers, &target, element); @@ -983,7 +983,7 @@ void Scheduler::schedule(SEL_SCHEDULE selector, } else { - CCASSERT(element->paused == paused, "element's paused should be paused."); + AXASSERT(element->paused == paused, "element's paused should be paused."); } if (element->timers == nullptr) @@ -998,7 +998,7 @@ void Scheduler::schedule(SEL_SCHEDULE selector, if (timer && !timer->isExhausted() && selector == timer->getSelector()) { - CCLOG("CCScheduler#schedule. Reiniting timer with interval %.4f, repeat %u, delay %.4f", interval, + AXLOG("CCScheduler#schedule. Reiniting timer with interval %.4f, repeat %u, delay %.4f", interval, repeat, delay); timer->setupTimerWithInterval(interval, repeat, delay); return; @@ -1015,13 +1015,13 @@ void Scheduler::schedule(SEL_SCHEDULE selector, void Scheduler::schedule(SEL_SCHEDULE selector, Ref* target, float interval, bool paused) { - this->schedule(selector, target, interval, CC_REPEAT_FOREVER, 0.0f, paused); + this->schedule(selector, target, interval, AX_REPEAT_FOREVER, 0.0f, paused); } bool Scheduler::isScheduled(SEL_SCHEDULE selector, const Ref* target) const { - CCASSERT(selector, "Argument selector must be non-nullptr"); - CCASSERT(target, "Argument target must be non-nullptr"); + AXASSERT(selector, "Argument selector must be non-nullptr"); + AXASSERT(target, "Argument target must be non-nullptr"); tHashTimerEntry* element = nullptr; HASH_FIND_PTR(_hashForTimers, &target, element); diff --git a/core/base/CCScheduler.h b/core/base/CCScheduler.h index 4051b355a4..c49837b411 100644 --- a/core/base/CCScheduler.h +++ b/core/base/CCScheduler.h @@ -46,7 +46,7 @@ typedef std::function ccSchedulerFunc; /** * @cond */ -class CC_DLL Timer : public Ref +class AX_DLL Timer : public Ref { protected: Timer(); @@ -75,7 +75,7 @@ protected: bool _aborted; }; -class CC_DLL TimerTargetSelector : public Timer +class AX_DLL TimerTargetSelector : public Timer { public: TimerTargetSelector(); @@ -99,7 +99,7 @@ protected: SEL_SCHEDULE _selector; }; -class CC_DLL TimerTargetCallback : public Timer +class AX_DLL TimerTargetCallback : public Timer { public: TimerTargetCallback(); @@ -126,9 +126,9 @@ protected: std::string _key; }; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING -class CC_DLL TimerScriptHandler : public Timer +class AX_DLL TimerScriptHandler : public Timer { public: bool initWithScriptHandler(int handler, float seconds); @@ -156,7 +156,7 @@ struct _listEntry; struct _hashSelectorEntry; struct _hashUpdateEntry; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING class SchedulerScriptHandlerEntry; #endif @@ -172,7 +172,7 @@ The 'custom selectors' should be avoided when possible. It is faster, and consum selector'. */ -class CC_DLL Scheduler : public Ref +class AX_DLL Scheduler : public Ref { public: /** Priority level reserved for system services. @@ -232,7 +232,7 @@ public: If paused is true, then it won't be called until it is resumed. If 'interval' is 0, it will be called every frame, but if so, it's recommended to use 'scheduleUpdate' instead. If the 'callback' is already scheduled, then only the interval parameter will be updated without re-scheduling it - again. repeat let the action be repeated repeat + 1 times, use CC_REPEAT_FOREVER to let the action run continuously + again. repeat let the action be repeated repeat + 1 times, use AX_REPEAT_FOREVER to let the action run continuously delay is the amount of time the action will wait before it'll start. @param callback The callback function. @param target The target of the callback function. @@ -269,7 +269,7 @@ public: If paused is true, then it won't be called until it is resumed. If 'interval' is 0, it will be called every frame, but if so, it's recommended to use 'scheduleUpdate' instead. If the selector is already scheduled, then only the interval parameter will be updated without re-scheduling it - again. repeat let the action be repeated repeat + 1 times, use CC_REPEAT_FOREVER to let the action run continuously + again. repeat let the action be repeated repeat + 1 times, use AX_REPEAT_FOREVER to let the action run continuously delay is the amount of time the action will wait before it'll start @param selector The callback function. @@ -306,7 +306,7 @@ public: this->schedulePerFrame([target](float dt) { target->update(dt); }, target, priority, paused); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING // Schedule for script bindings. /** The scheduled script callback will be called every 'interval' seconds. If paused is true, then it won't be called until it is resumed. @@ -367,7 +367,7 @@ public: */ void unscheduleAllWithMinPriority(int minPriority); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING /** Unschedule a script entry. * @warning Don't invoke this function unless you know what you are doing. * @js NA @@ -497,7 +497,7 @@ protected: // If true unschedule will not remove anything from a hash. Elements will only be marked for deletion. bool _updateHashLocked; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING Vector _scriptHandlerEntries; #endif diff --git a/core/base/CCScriptSupport.cpp b/core/base/CCScriptSupport.cpp index 136382a740..5c526a362b 100644 --- a/core/base/CCScriptSupport.cpp +++ b/core/base/CCScriptSupport.cpp @@ -26,12 +26,12 @@ #include "base/CCScriptSupport.h" -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING # include "base/CCScheduler.h" # include "2d/CCNode.h" -bool CC_DLL cc_assert_script_compatible(const char* msg) +bool AX_DLL cc_assert_script_compatible(const char* msg) { axis::ScriptEngineProtocol* engine = axis::ScriptEngineManager::getInstance()->getScriptEngine(); if (engine && engine->handleAssert(msg)) @@ -183,4 +183,4 @@ int ScriptEngineManager::sendEventToLua(const ScriptEvent& event) NS_AX_END -#endif // #if CC_ENABLE_SCRIPT_BINDING +#endif // #if AX_ENABLE_SCRIPT_BINDING diff --git a/core/base/CCScriptSupport.h b/core/base/CCScriptSupport.h index 314a421d4c..d2fa6edfe1 100644 --- a/core/base/CCScriptSupport.h +++ b/core/base/CCScriptSupport.h @@ -41,7 +41,7 @@ * @{ */ -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING typedef struct lua_State lua_State; @@ -587,7 +587,7 @@ struct ScriptEvent * ScriptEngine. So a crash will appear on Win32 if you click the close button. * @js NA */ -class CC_DLL ScriptEngineProtocol +class AX_DLL ScriptEngineProtocol { public: /** @@ -783,7 +783,7 @@ class Node; * @since v0.99.5-x-0.8.5 * @js NA */ -class CC_DLL ScriptEngineManager +class AX_DLL ScriptEngineManager { public: /** @@ -866,7 +866,7 @@ private: NS_AX_END -#endif // #if CC_ENABLE_SCRIPT_BINDING +#endif // #if AX_ENABLE_SCRIPT_BINDING // end group /// @} diff --git a/core/base/CCStencilStateManager.cpp b/core/base/CCStencilStateManager.cpp index 48d9d12f85..a682af37c4 100644 --- a/core/base/CCStencilStateManager.cpp +++ b/core/base/CCStencilStateManager.cpp @@ -66,7 +66,7 @@ StencilStateManager::StencilStateManager() StencilStateManager::~StencilStateManager() { - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); } void StencilStateManager::drawFullScreenQuadClearStencil(float globalZOrder) @@ -111,8 +111,8 @@ void StencilStateManager::updateLayerMask() void StencilStateManager::onBeforeVisit(float globalZOrder) { - _customCommand.setBeforeCallback(CC_CALLBACK_0(StencilStateManager::onBeforeDrawQuadCmd, this)); - _customCommand.setAfterCallback(CC_CALLBACK_0(StencilStateManager::onAfterDrawQuadCmd, this)); + _customCommand.setBeforeCallback(AX_CALLBACK_0(StencilStateManager::onBeforeDrawQuadCmd, this)); + _customCommand.setAfterCallback(AX_CALLBACK_0(StencilStateManager::onAfterDrawQuadCmd, this)); // draw a fullscreen solid rectangle to clear the stencil buffer drawFullScreenQuadClearStencil(globalZOrder); diff --git a/core/base/CCStencilStateManager.h b/core/base/CCStencilStateManager.h index 0d168495bc..2b1ba78310 100644 --- a/core/base/CCStencilStateManager.h +++ b/core/base/CCStencilStateManager.h @@ -36,7 +36,7 @@ */ NS_AX_BEGIN -class CC_DLL StencilStateManager +class AX_DLL StencilStateManager { public: StencilStateManager(); @@ -50,7 +50,7 @@ public: float getAlphaThreshold() const; private: - CC_DISALLOW_COPY_AND_ASSIGN(StencilStateManager); + AX_DISALLOW_COPY_AND_ASSIGN(StencilStateManager); static int s_layer; /**draw fullscreen quad to clear stencil bits */ diff --git a/core/base/CCTouch.h b/core/base/CCTouch.h index cf9b02f283..0f6723d0f3 100644 --- a/core/base/CCTouch.h +++ b/core/base/CCTouch.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_TOUCH_H__ -#define __CC_TOUCH_H__ +#ifndef __AX_TOUCH_H__ +#define __AX_TOUCH_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -41,7 +41,7 @@ NS_AX_BEGIN * @brief Encapsulates the Touch information, such as touch point, id and so on, and provides the methods that commonly used. */ -class CC_DLL Touch : public Ref +class AX_DLL Touch : public Ref { public: /** diff --git a/core/base/CCUserDefault.cpp b/core/base/CCUserDefault.cpp index 6b00d4b473..8c9b97f697 100644 --- a/core/base/CCUserDefault.cpp +++ b/core/base/CCUserDefault.cpp @@ -365,7 +365,7 @@ UserDefault* UserDefault::getInstance() void UserDefault::destroyInstance() { - CC_SAFE_DELETE(_userDefault); + AX_SAFE_DELETE(_userDefault); } void UserDefault::setDelegate(UserDefault* delegate) diff --git a/core/base/CCUserDefault.h b/core/base/CCUserDefault.h index a74540750c..04106f25bb 100644 --- a/core/base/CCUserDefault.h +++ b/core/base/CCUserDefault.h @@ -51,7 +51,7 @@ NS_AX_BEGIN * @warning: On windows, linux, use XML to store data, which means there are some limitations of * the key string, for example, `/` is not valid. */ -class CC_DLL UserDefault +class AX_DLL UserDefault { public: // get value methods diff --git a/core/base/CCValue.cpp b/core/base/CCValue.cpp index d4986694ba..3326394444 100644 --- a/core/base/CCValue.cpp +++ b/core/base/CCValue.cpp @@ -458,7 +458,7 @@ bool Value::operator==(const Value& v) const /// Convert value to a specified type unsigned char Value::asByte(unsigned char defaultValue) const { - CCASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, + AXASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, "Only base type (bool, string, float, double, int) could be converted"); switch (_type) @@ -491,7 +491,7 @@ unsigned char Value::asByte(unsigned char defaultValue) const int Value::asInt(int defaultValue) const { - CCASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, + AXASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, "Only base type (bool, string, float, double, int) could be converted"); switch (_type) { @@ -523,7 +523,7 @@ int Value::asInt(int defaultValue) const unsigned int Value::asUint(unsigned int defaultValue) const { - CCASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, + AXASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, "Only base type (bool, string, float, double, int) could be converted"); switch (_type) { @@ -556,7 +556,7 @@ unsigned int Value::asUint(unsigned int defaultValue) const int64_t Value::asInt64(int64_t defaultValue) const { - CCASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, + AXASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, "Only base type (bool, string, float, double, int) could be converted"); switch (_type) { @@ -589,7 +589,7 @@ int64_t Value::asInt64(int64_t defaultValue) const uint64_t Value::asUint64(uint64_t defaultValue) const { - CCASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, + AXASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, "Only base type (bool, string, float, double, int) could be converted"); switch (_type) { @@ -622,7 +622,7 @@ uint64_t Value::asUint64(uint64_t defaultValue) const float Value::asFloat(float defaultValue) const { - CCASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, + AXASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, "Only base type (bool, string, float, double, int) could be converted"); switch (_type) { @@ -654,7 +654,7 @@ float Value::asFloat(float defaultValue) const double Value::asDouble(double defaultValue) const { - CCASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, + AXASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, "Only base type (bool, string, float, double, int) could be converted"); switch (_type) { @@ -686,7 +686,7 @@ double Value::asDouble(double defaultValue) const bool Value::asBool(bool defaultValue) const { - CCASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, + AXASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, "Only base type (bool, string, float, double, int) could be converted"); switch (_type) { @@ -718,7 +718,7 @@ bool Value::asBool(bool defaultValue) const std::string Value::asString() const { - CCASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, + AXASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, "Only base type (bool, string, float, double, int) could be converted"); if (_type == Type::STRING) @@ -778,37 +778,37 @@ std::string_view Value::asStringRef() const ValueVector& Value::asValueVector() { - CCASSERT(_type == Type::VECTOR, "The value type isn't Type::VECTOR"); + AXASSERT(_type == Type::VECTOR, "The value type isn't Type::VECTOR"); return *_field.vectorVal; } const ValueVector& Value::asValueVector() const { - CCASSERT(_type == Type::VECTOR, "The value type isn't Type::VECTOR"); + AXASSERT(_type == Type::VECTOR, "The value type isn't Type::VECTOR"); return *_field.vectorVal; } ValueMap& Value::asValueMap() { - CCASSERT(_type == Type::MAP, "The value type isn't Type::MAP"); + AXASSERT(_type == Type::MAP, "The value type isn't Type::MAP"); return *_field.mapVal; } const ValueMap& Value::asValueMap() const { - CCASSERT(_type == Type::MAP, "The value type isn't Type::MAP"); + AXASSERT(_type == Type::MAP, "The value type isn't Type::MAP"); return *_field.mapVal; } ValueMapIntKey& Value::asIntKeyMap() { - CCASSERT(_type == Type::INT_KEY_MAP, "The value type isn't Type::INT_KEY_MAP"); + AXASSERT(_type == Type::INT_KEY_MAP, "The value type isn't Type::INT_KEY_MAP"); return *_field.intKeyMapVal; } const ValueMapIntKey& Value::asIntKeyMap() const { - CCASSERT(_type == Type::INT_KEY_MAP, "The value type isn't Type::INT_KEY_MAP"); + AXASSERT(_type == Type::INT_KEY_MAP, "The value type isn't Type::INT_KEY_MAP"); return *_field.intKeyMapVal; } @@ -892,7 +892,7 @@ static std::string visit(const Value& v, int depth) ret << visitMap(v.asIntKeyMap(), depth); break; default: - CCASSERT(false, "Invalid type!"); + AXASSERT(false, "Invalid type!"); break; } @@ -924,16 +924,16 @@ void Value::clear() _field.boolVal = false; break; case Type::STRING: - CC_SAFE_DELETE(_field.strVal); + AX_SAFE_DELETE(_field.strVal); break; case Type::VECTOR: - CC_SAFE_DELETE(_field.vectorVal); + AX_SAFE_DELETE(_field.vectorVal); break; case Type::MAP: - CC_SAFE_DELETE(_field.mapVal); + AX_SAFE_DELETE(_field.mapVal); break; case Type::INT_KEY_MAP: - CC_SAFE_DELETE(_field.intKeyMapVal); + AX_SAFE_DELETE(_field.intKeyMapVal); break; default: break; diff --git a/core/base/CCValue.h b/core/base/CCValue.h index afc2ff139e..b01c53be9d 100644 --- a/core/base/CCValue.h +++ b/core/base/CCValue.h @@ -46,14 +46,14 @@ typedef std::vector ValueVector; typedef hlookup::string_map ValueMap; typedef std::unordered_map ValueMapIntKey; -CC_DLL extern const ValueVector ValueVectorNull; -CC_DLL extern const ValueMap ValueMapNull; -CC_DLL extern const ValueMapIntKey ValueMapIntKeyNull; +AX_DLL extern const ValueVector ValueVectorNull; +AX_DLL extern const ValueMap ValueMapNull; +AX_DLL extern const ValueMapIntKey ValueMapIntKeyNull; /* * This class is provide as a wrapper of basic types, such as int and bool. */ -class CC_DLL Value +class AX_DLL Value { public: /** A predefined Value that has not value. */ diff --git a/core/base/CCVector.h b/core/base/CCVector.h index 6dc3028e3d..4902db18aa 100644 --- a/core/base/CCVector.h +++ b/core/base/CCVector.h @@ -120,7 +120,7 @@ public: explicit Vector(ssize_t capacity) : _data() { static_assert(std::is_convertible::value, "Invalid Type for axis::Vector!"); - CCLOGINFO("In the default constructor with capacity of Vector."); + AXLOGINFO("In the default constructor with capacity of Vector."); reserve(capacity); } @@ -136,7 +136,7 @@ public: /** Destructor. */ ~Vector() { - CCLOGINFO("In the destructor of Vector."); + AXLOGINFO("In the destructor of Vector."); clear(); } @@ -144,7 +144,7 @@ public: Vector(const Vector& other) { static_assert(std::is_convertible::value, "Invalid Type for axis::Vector!"); - CCLOGINFO("In the copy constructor!"); + AXLOGINFO("In the copy constructor!"); _data = other._data; addRefForAllObjects(); } @@ -153,7 +153,7 @@ public: Vector(Vector&& other) { static_assert(std::is_convertible::value, "Invalid Type for axis::Vector!"); - CCLOGINFO("In the move constructor of Vector!"); + AXLOGINFO("In the move constructor of Vector!"); _data = std::move(other._data); } @@ -162,7 +162,7 @@ public: { if (this != &other) { - CCLOGINFO("In the copy assignment operator!"); + AXLOGINFO("In the copy assignment operator!"); clear(); _data = other._data; addRefForAllObjects(); @@ -175,7 +175,7 @@ public: { if (this != &other) { - CCLOGINFO("In the move assignment operator!"); + AXLOGINFO("In the move assignment operator!"); clear(); _data = std::move(other._data); } @@ -251,7 +251,7 @@ public: /** Returns the element at position 'index' in the Vector. */ T at(ssize_t index) const { - CCASSERT(index >= 0 && index < size(), "index out of range in getObjectAtIndex()"); + AXASSERT(index >= 0 && index < size(), "index out of range in getObjectAtIndex()"); return _data[index]; } @@ -305,7 +305,7 @@ public: /** Adds a new element at the end of the Vector. */ void pushBack(T object) { - CCASSERT(object != nullptr, "The object should not be nullptr"); + AXASSERT(object != nullptr, "The object should not be nullptr"); _data.push_back(object); object->retain(); } @@ -327,8 +327,8 @@ public: */ void insert(ssize_t index, T object) { - CCASSERT(index >= 0 && index <= size(), "Invalid index!"); - CCASSERT(object != nullptr, "The object should not be nullptr"); + AXASSERT(index >= 0 && index <= size(), "Invalid index!"); + AXASSERT(object != nullptr, "The object should not be nullptr"); _data.insert((std::begin(_data) + index), object); object->retain(); } @@ -338,7 +338,7 @@ public: /** Removes the last element in the Vector. */ void popBack() { - CCASSERT(!_data.empty(), "no objects added"); + AXASSERT(!_data.empty(), "no objects added"); auto last = _data.back(); _data.pop_back(); last->release(); @@ -351,7 +351,7 @@ public: */ void eraseObject(T object, bool removeAll = false) { - CCASSERT(object != nullptr, "The object should not be nullptr"); + AXASSERT(object != nullptr, "The object should not be nullptr"); if (removeAll) { @@ -386,7 +386,7 @@ public: */ iterator erase(iterator position) { - CCASSERT(position >= _data.begin() && position < _data.end(), "Invalid position!"); + AXASSERT(position >= _data.begin() && position < _data.end(), "Invalid position!"); (*position)->release(); return _data.erase(position); } @@ -413,7 +413,7 @@ public: */ iterator erase(ssize_t index) { - CCASSERT(!_data.empty() && index >= 0 && index < size(), "Invalid index!"); + AXASSERT(!_data.empty() && index >= 0 && index < size(), "Invalid index!"); auto it = std::next(begin(), index); (*it)->release(); return _data.erase(it); @@ -439,7 +439,7 @@ public: ssize_t idx1 = getIndex(object1); ssize_t idx2 = getIndex(object2); - CCASSERT(idx1 >= 0 && idx2 >= 0, "invalid object index"); + AXASSERT(idx1 >= 0 && idx2 >= 0, "invalid object index"); std::swap(_data[idx1], _data[idx2]); } @@ -447,7 +447,7 @@ public: /** Swap two elements by indexes. */ void swap(ssize_t index1, ssize_t index2) { - CCASSERT(index1 >= 0 && index1 < size() && index2 >= 0 && index2 < size(), "Invalid indices"); + AXASSERT(index1 >= 0 && index1 < size() && index2 >= 0 && index2 < size(), "Invalid indices"); std::swap(_data[index1], _data[index2]); } @@ -455,8 +455,8 @@ public: /** Replace value at index with given object. */ void replace(ssize_t index, T object) { - CCASSERT(index >= 0 && index < size(), "Invalid index!"); - CCASSERT(object != nullptr, "The object should not be nullptr"); + AXASSERT(index >= 0 && index < size(), "Invalid index!"); + AXASSERT(object != nullptr, "The object should not be nullptr"); _data[index]->release(); _data[index] = object; diff --git a/core/base/ObjectFactory.cpp b/core/base/ObjectFactory.cpp index 643b093ede..7ed5428996 100644 --- a/core/base/ObjectFactory.cpp +++ b/core/base/ObjectFactory.cpp @@ -82,7 +82,7 @@ ObjectFactory* ObjectFactory::getInstance() void ObjectFactory::destroyInstance() { - CC_SAFE_DELETE(_sharedFactory); + AX_SAFE_DELETE(_sharedFactory); } Ref* ObjectFactory::createObject(std::string_view name) diff --git a/core/base/ObjectFactory.h b/core/base/ObjectFactory.h index 0b9c6ed24b..8e9b732c5f 100644 --- a/core/base/ObjectFactory.h +++ b/core/base/ObjectFactory.h @@ -34,12 +34,12 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL ObjectFactory +class AX_DLL ObjectFactory { public: typedef axis::Ref* (*Instance)(void); typedef std::function InstanceFunc; - struct CC_DLL TInfo + struct AX_DLL TInfo { TInfo(); TInfo(std::string_view type, Instance ins = nullptr); diff --git a/core/base/SimpleTimer.h b/core/base/SimpleTimer.h index 7d5482a068..9bf757933c 100644 --- a/core/base/SimpleTimer.h +++ b/core/base/SimpleTimer.h @@ -12,10 +12,10 @@ namespace stimer { typedef void* TIMER_ID; typedef std::function vcallback_t; -CC_DLL TIMER_ID loop(unsigned int n, float interval, vcallback_t callback, bool bNative = true); -CC_DLL TIMER_ID delay(float delay, vcallback_t callback, bool bNative = true); -CC_DLL void kill(TIMER_ID timerId, bool bNative = true); -CC_DLL void killAll(bool bNative = true); +AX_DLL TIMER_ID loop(unsigned int n, float interval, vcallback_t callback, bool bNative = true); +AX_DLL TIMER_ID delay(float delay, vcallback_t callback, bool bNative = true); +AX_DLL void kill(TIMER_ID timerId, bool bNative = true); +AX_DLL void killAll(bool bNative = true); } // namespace stimer NS_AX_END diff --git a/core/base/TGAlib.cpp b/core/base/TGAlib.cpp index d5c89805ea..7948ac5474 100644 --- a/core/base/TGAlib.cpp +++ b/core/base/TGAlib.cpp @@ -44,19 +44,19 @@ bool tgaLoadHeader(unsigned char* buffer, uint32_t bufSize, tImageTGA* info) do { size_t step = sizeof(unsigned char) * 2; - CC_BREAK_IF((step + sizeof(unsigned char)) > bufSize); + AX_BREAK_IF((step + sizeof(unsigned char)) > bufSize); memcpy(&info->type, buffer + step, sizeof(unsigned char)); step += sizeof(unsigned char) * 2; step += sizeof(signed short) * 4; - CC_BREAK_IF((step + sizeof(signed short) * 2 + sizeof(unsigned char)) > bufSize); + AX_BREAK_IF((step + sizeof(signed short) * 2 + sizeof(unsigned char)) > bufSize); memcpy(&info->width, buffer + step, sizeof(signed short)); memcpy(&info->height, buffer + step + sizeof(signed short), sizeof(signed short)); memcpy(&info->pixelDepth, buffer + step + sizeof(signed short) * 2, sizeof(unsigned char)); step += sizeof(unsigned char); step += sizeof(signed short) * 2; - CC_BREAK_IF((step + sizeof(unsigned char)) > bufSize); + AX_BREAK_IF((step + sizeof(unsigned char)) > bufSize); unsigned char cGarbage; memcpy(&cGarbage, buffer + step, sizeof(unsigned char)); @@ -87,7 +87,7 @@ bool tgaLoadImageData(unsigned char* Buffer, uint32_t bufSize, tImageTGA* info) total = info->height * info->width * mode; size_t dataSize = sizeof(unsigned char) * total; - CC_BREAK_IF((step + dataSize) > bufSize); + AX_BREAK_IF((step + dataSize) > bufSize); memcpy(info->imageData, Buffer + step, dataSize); // mode=3 or 4 implies that the image is RGB(A). However TGA @@ -132,7 +132,7 @@ static bool tgaLoadRLEImageData(unsigned char* buffer, uint32_t bufSize, tImageT else { // otherwise, read in the run length token - CC_BREAK_IF((step + sizeof(unsigned char)) > bufSize); + AX_BREAK_IF((step + sizeof(unsigned char)) > bufSize); memcpy(&runlength, buffer + step, sizeof(unsigned char)); step += sizeof(unsigned char); @@ -149,7 +149,7 @@ static bool tgaLoadRLEImageData(unsigned char* buffer, uint32_t bufSize, tImageT if (!skip) { // no, read in the pixel data - CC_BREAK_IF((step + sizeof(unsigned char) * mode) > bufSize); + AX_BREAK_IF((step + sizeof(unsigned char) * mode) > bufSize); memcpy(aux, buffer + step, sizeof(unsigned char) * mode); step += sizeof(unsigned char) * mode; @@ -203,7 +203,7 @@ tImageTGA* tgaLoadBuffer(unsigned char* buffer, int32_t size) do { - CC_BREAK_IF(!buffer); + AX_BREAK_IF(!buffer); info = (tImageTGA*)malloc(sizeof(tImageTGA)); // get the file header info diff --git a/core/base/ZipUtils.cpp b/core/base/ZipUtils.cpp index db5bf1c4a4..46a9daafd8 100644 --- a/core/base/ZipUtils.cpp +++ b/core/base/ZipUtils.cpp @@ -70,16 +70,16 @@ inline void ZipUtils::decodeEncodedPvr(unsigned int* data, ssize_t len) // check if key was set // make sure to call caw_setkey_part() for all 4 key parts - CCASSERT(s_uEncryptedPvrKeyParts[0] != 0, + AXASSERT(s_uEncryptedPvrKeyParts[0] != 0, "Cocos2D: CCZ file is encrypted but key part 0 is not set. Did you call " "ZipUtils::setPvrEncryptionKeyPart(...)?"); - CCASSERT(s_uEncryptedPvrKeyParts[1] != 0, + AXASSERT(s_uEncryptedPvrKeyParts[1] != 0, "Cocos2D: CCZ file is encrypted but key part 1 is not set. Did you call " "ZipUtils::setPvrEncryptionKeyPart(...)?"); - CCASSERT(s_uEncryptedPvrKeyParts[2] != 0, + AXASSERT(s_uEncryptedPvrKeyParts[2] != 0, "Cocos2D: CCZ file is encrypted but key part 2 is not set. Did you call " "ZipUtils::setPvrEncryptionKeyPart(...)?"); - CCASSERT(s_uEncryptedPvrKeyParts[3] != 0, + AXASSERT(s_uEncryptedPvrKeyParts[3] != 0, "Cocos2D: CCZ file is encrypted but key part 3 is not set. Did you call " "ZipUtils::setPvrEncryptionKeyPart(...)?"); @@ -211,7 +211,7 @@ int ZipUtils::inflateMemoryWithHint(unsigned char* in, /* not enough memory, ouch */ if (!*out) { - CCLOG("cocos2d: ZipUtils: realloc failed"); + AXLOG("cocos2d: ZipUtils: realloc failed"); inflateEnd(&d_stream); return Z_MEM_ERROR; } @@ -236,19 +236,19 @@ ssize_t ZipUtils::inflateMemoryWithHint(unsigned char* in, ssize_t inLength, uns { if (err == Z_MEM_ERROR) { - CCLOG("cocos2d: ZipUtils: Out of memory while decompressing map data!"); + AXLOG("cocos2d: ZipUtils: Out of memory while decompressing map data!"); } else if (err == Z_VERSION_ERROR) { - CCLOG("cocos2d: ZipUtils: Incompatible zlib version!"); + AXLOG("cocos2d: ZipUtils: Incompatible zlib version!"); } else if (err == Z_DATA_ERROR) { - CCLOG("cocos2d: ZipUtils: Incorrect zlib compressed data!"); + AXLOG("cocos2d: ZipUtils: Incorrect zlib compressed data!"); } else { - CCLOG("cocos2d: ZipUtils: Unknown error while decompressing map data!"); + AXLOG("cocos2d: ZipUtils: Unknown error while decompressing map data!"); } if (*out) @@ -273,13 +273,13 @@ int ZipUtils::inflateGZipFile(const char* path, unsigned char** out) int len; unsigned int offset = 0; - CCASSERT(out, "out can't be nullptr."); - CCASSERT(&*out, "&*out can't be nullptr."); + AXASSERT(out, "out can't be nullptr."); + AXASSERT(&*out, "&*out can't be nullptr."); gzFile inFile = gzopen(path, "rb"); if (inFile == nullptr) { - CCLOG("cocos2d: ZipUtils: error open gzip file: %s", path); + AXLOG("cocos2d: ZipUtils: error open gzip file: %s", path); return -1; } @@ -290,7 +290,7 @@ int ZipUtils::inflateGZipFile(const char* path, unsigned char** out) *out = (unsigned char*)malloc(bufferSize); if (*out == NULL) { - CCLOG("cocos2d: ZipUtils: out of memory"); + AXLOG("cocos2d: ZipUtils: out of memory"); return -1; } @@ -299,7 +299,7 @@ int ZipUtils::inflateGZipFile(const char* path, unsigned char** out) len = gzread(inFile, *out + offset, bufferSize); if (len < 0) { - CCLOG("cocos2d: ZipUtils: error in gzread"); + AXLOG("cocos2d: ZipUtils: error in gzread"); free(*out); *out = nullptr; return -1; @@ -323,7 +323,7 @@ int ZipUtils::inflateGZipFile(const char* path, unsigned char** out) if (!tmp) { - CCLOG("cocos2d: ZipUtils: out of memory"); + AXLOG("cocos2d: ZipUtils: out of memory"); free(*out); *out = nullptr; return -1; @@ -334,7 +334,7 @@ int ZipUtils::inflateGZipFile(const char* path, unsigned char** out) if (gzclose(inFile) != Z_OK) { - CCLOG("cocos2d: ZipUtils: gzclose failed"); + AXLOG("cocos2d: ZipUtils: gzclose failed"); } return offset; @@ -347,7 +347,7 @@ bool ZipUtils::isCCZFile(const char* path) if (compressedData.isNull()) { - CCLOG("cocos2d: ZipUtils: loading file failed"); + AXLOG("cocos2d: ZipUtils: loading file failed"); return false; } @@ -373,7 +373,7 @@ bool ZipUtils::isGZipFile(const char* path) if (compressedData.isNull()) { - CCLOG("cocos2d: ZipUtils: loading file failed"); + AXLOG("cocos2d: ZipUtils: loading file failed"); return false; } @@ -398,17 +398,17 @@ int ZipUtils::inflateCCZBuffer(const unsigned char* buffer, ssize_t bufferLen, u if (header->sig[0] == 'C' && header->sig[1] == 'C' && header->sig[2] == 'Z' && header->sig[3] == '!') { // verify header version - unsigned int version = CC_SWAP_INT16_BIG_TO_HOST(header->version); + unsigned int version = AX_SWAP_INT16_BIG_TO_HOST(header->version); if (version > 2) { - CCLOG("cocos2d: Unsupported CCZ header format"); + AXLOG("cocos2d: Unsupported CCZ header format"); return -1; } // verify compression format - if (CC_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB) + if (AX_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB) { - CCLOG("cocos2d: CCZ Unsupported compression method"); + AXLOG("cocos2d: CCZ Unsupported compression method"); return -1; } } @@ -418,17 +418,17 @@ int ZipUtils::inflateCCZBuffer(const unsigned char* buffer, ssize_t bufferLen, u header = (struct CCZHeader*)buffer; // verify header version - unsigned int version = CC_SWAP_INT16_BIG_TO_HOST(header->version); + unsigned int version = AX_SWAP_INT16_BIG_TO_HOST(header->version); if (version > 0) { - CCLOG("cocos2d: Unsupported CCZ header format"); + AXLOG("cocos2d: Unsupported CCZ header format"); return -1; } // verify compression format - if (CC_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB) + if (AX_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB) { - CCLOG("cocos2d: CCZ Unsupported compression method"); + AXLOG("cocos2d: CCZ Unsupported compression method"); return -1; } @@ -438,30 +438,30 @@ int ZipUtils::inflateCCZBuffer(const unsigned char* buffer, ssize_t bufferLen, u decodeEncodedPvr(ints, enclen); -#if COCOS2D_DEBUG > 0 +#if AXIS_DEBUG > 0 // verify checksum in debug mode unsigned int calculated = checksumPvr(ints, enclen); - unsigned int required = CC_SWAP_INT32_BIG_TO_HOST(header->reserved); + unsigned int required = AX_SWAP_INT32_BIG_TO_HOST(header->reserved); if (calculated != required) { - CCLOG("cocos2d: Can't decrypt image file. Is the decryption key valid?"); + AXLOG("cocos2d: Can't decrypt image file. Is the decryption key valid?"); return -1; } #endif } else { - CCLOG("cocos2d: Invalid CCZ file"); + AXLOG("cocos2d: Invalid CCZ file"); return -1; } - unsigned int len = CC_SWAP_INT32_BIG_TO_HOST(header->len); + unsigned int len = AX_SWAP_INT32_BIG_TO_HOST(header->len); *out = (unsigned char*)malloc(len); if (!*out) { - CCLOG("cocos2d: CCZ: Failed to allocate memory for texture"); + AXLOG("cocos2d: CCZ: Failed to allocate memory for texture"); return -1; } @@ -471,7 +471,7 @@ int ZipUtils::inflateCCZBuffer(const unsigned char* buffer, ssize_t bufferLen, u if (ret != Z_OK) { - CCLOG("cocos2d: CCZ: Failed to uncompress data"); + AXLOG("cocos2d: CCZ: Failed to uncompress data"); free(*out); *out = nullptr; return -1; @@ -482,14 +482,14 @@ int ZipUtils::inflateCCZBuffer(const unsigned char* buffer, ssize_t bufferLen, u int ZipUtils::inflateCCZFile(const char* path, unsigned char** out) { - CCASSERT(out, "Invalid pointer for buffer!"); + AXASSERT(out, "Invalid pointer for buffer!"); // load file into memory Data compressedData = FileUtils::getInstance()->getDataFromFile(path); if (compressedData.isNull()) { - CCLOG("cocos2d: Error loading CCZ compressed file"); + AXLOG("cocos2d: Error loading CCZ compressed file"); return -1; } @@ -498,8 +498,8 @@ int ZipUtils::inflateCCZFile(const char* path, unsigned char** out) void ZipUtils::setPvrEncryptionKeyPart(int index, unsigned int value) { - CCASSERT(index >= 0, "Cocos2d: key part index cannot be less than 0"); - CCASSERT(index <= 3, "Cocos2d: key part index cannot be greater than 3"); + AXASSERT(index >= 0, "Cocos2d: key part index cannot be less than 0"); + AXASSERT(index <= 3, "Cocos2d: key part index cannot be greater than 3"); if (s_uEncryptedPvrKeyParts[index] != value) { @@ -697,7 +697,7 @@ ZipFile::~ZipFile() unzClose(_data->zipFile); } - CC_SAFE_DELETE(_data); + AX_SAFE_DELETE(_data); } bool ZipFile::setFilter(std::string_view filter) @@ -705,8 +705,8 @@ bool ZipFile::setFilter(std::string_view filter) bool ret = false; do { - CC_BREAK_IF(!_data); - CC_BREAK_IF(!_data->zipFile); + AX_BREAK_IF(!_data); + AX_BREAK_IF(!_data->zipFile); // clear existing file list _data->fileList.clear(); @@ -748,7 +748,7 @@ bool ZipFile::fileExists(std::string_view fileName) const bool ret = false; do { - CC_BREAK_IF(!_data); + AX_BREAK_IF(!_data); ret = _data->fileList.find(fileName) != _data->fileList.end(); } while (false); @@ -798,26 +798,26 @@ unsigned char* ZipFile::getFileData(std::string_view fileName, ssize_t* size) do { - CC_BREAK_IF(!_data->zipFile); - CC_BREAK_IF(fileName.empty()); + AX_BREAK_IF(!_data->zipFile); + AX_BREAK_IF(fileName.empty()); auto it = _data->fileList.find(fileName); - CC_BREAK_IF(it == _data->fileList.end()); + AX_BREAK_IF(it == _data->fileList.end()); ZipEntryInfo& fileInfo = it->second; std::unique_lock lck(_data->zipFileMtx); int nRet = unzGoToFilePos(_data->zipFile, &fileInfo.pos); - CC_BREAK_IF(UNZ_OK != nRet); + AX_BREAK_IF(UNZ_OK != nRet); nRet = unzOpenCurrentFile(_data->zipFile); - CC_BREAK_IF(UNZ_OK != nRet); + AX_BREAK_IF(UNZ_OK != nRet); buffer = (unsigned char*)malloc(fileInfo.uncompressed_size); - int CC_UNUSED nSize = + int AX_UNUSED nSize = unzReadCurrentFile(_data->zipFile, buffer, static_cast(fileInfo.uncompressed_size)); - CCASSERT(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong"); + AXASSERT(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong"); if (size) { @@ -834,26 +834,26 @@ bool ZipFile::getFileData(std::string_view fileName, ResizableBuffer* buffer) bool res = false; do { - CC_BREAK_IF(!_data->zipFile); - CC_BREAK_IF(fileName.empty()); + AX_BREAK_IF(!_data->zipFile); + AX_BREAK_IF(fileName.empty()); ZipFilePrivate::FileListContainer::iterator it = _data->fileList.find(fileName); - CC_BREAK_IF(it == _data->fileList.end()); + AX_BREAK_IF(it == _data->fileList.end()); ZipEntryInfo& fileInfo = it->second; std::unique_lock lck(_data->zipFileMtx); int nRet = unzGoToFilePos(_data->zipFile, &fileInfo.pos); - CC_BREAK_IF(UNZ_OK != nRet); + AX_BREAK_IF(UNZ_OK != nRet); nRet = unzOpenCurrentFile(_data->zipFile); - CC_BREAK_IF(UNZ_OK != nRet); + AX_BREAK_IF(UNZ_OK != nRet); buffer->resize(fileInfo.uncompressed_size); - int CC_UNUSED nSize = + int AX_UNUSED nSize = unzReadCurrentFile(_data->zipFile, buffer->buffer(), static_cast(fileInfo.uncompressed_size)); - CCASSERT(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong"); + AXASSERT(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong"); unzCloseCurrentFile(_data->zipFile); res = true; } while (0); @@ -937,12 +937,12 @@ int ZipFile::zfread(ZipFileStream* zfs, void* buf, unsigned int size) int n = 0; do { - CC_BREAK_IF(zfs == nullptr || zfs->offset >= zfs->entry->uncompressed_size); + AX_BREAK_IF(zfs == nullptr || zfs->offset >= zfs->entry->uncompressed_size); std::unique_lock lck(_data->zipFileMtx); int nRet = unzGoToFilePos(_data->zipFile, &zfs->entry->pos); - CC_BREAK_IF(UNZ_OK != nRet); + AX_BREAK_IF(UNZ_OK != nRet); nRet = unzOpenCurrentFile(_data->zipFile); unzSeek64(_data->zipFile, zfs->offset, SEEK_SET); @@ -1014,27 +1014,27 @@ unsigned char* ZipFile::getFileDataFromZip(std::string_view zipFilePath, std::st do { - CC_BREAK_IF(zipFilePath.empty()); + AX_BREAK_IF(zipFilePath.empty()); file = unzOpen(zipFilePath.data()); - CC_BREAK_IF(!file); + AX_BREAK_IF(!file); // minizip 1.2.0 is same with other platforms int ret = unzLocateFile(file, filename.data(), nullptr); - CC_BREAK_IF(UNZ_OK != ret); + AX_BREAK_IF(UNZ_OK != ret); char filePathA[260]; unz_file_info_s fileInfo; ret = unzGetCurrentFileInfo(file, &fileInfo, filePathA, sizeof(filePathA), nullptr, 0, nullptr, 0); - CC_BREAK_IF(UNZ_OK != ret); + AX_BREAK_IF(UNZ_OK != ret); ret = unzOpenCurrentFile(file); - CC_BREAK_IF(UNZ_OK != ret); + AX_BREAK_IF(UNZ_OK != ret); buffer = (unsigned char*)malloc(fileInfo.uncompressed_size); - int CC_UNUSED readedSize = unzReadCurrentFile(file, buffer, static_cast(fileInfo.uncompressed_size)); - CCASSERT(readedSize == 0 || readedSize == (int)fileInfo.uncompressed_size, "the file size is wrong"); + int AX_UNUSED readedSize = unzReadCurrentFile(file, buffer, static_cast(fileInfo.uncompressed_size)); + AXASSERT(readedSize == 0 || readedSize == (int)fileInfo.uncompressed_size, "the file size is wrong"); *size = fileInfo.uncompressed_size; unzCloseCurrentFile(file); diff --git a/core/base/ZipUtils.h b/core/base/ZipUtils.h index 8c044f4334..49dabc5314 100644 --- a/core/base/ZipUtils.h +++ b/core/base/ZipUtils.h @@ -33,9 +33,9 @@ THE SOFTWARE. #include "platform/CCFileUtils.h" #include -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "platform/android/CCFileUtils-android.h" -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) // for import ssize_t on win32 platform # include "platform/CCStdC.h" #endif @@ -70,7 +70,7 @@ enum CCZ_COMPRESSION_NONE, /** plain (not supported yet). */ }; -class CC_DLL ZipUtils +class AX_DLL ZipUtils { public: /** @@ -237,7 +237,7 @@ struct ZipFileStream * * @since v2.0.5 */ -class CC_DLL ZipFile +class AX_DLL ZipFile { public: /** @@ -323,7 +323,7 @@ public: * @return Upon success, a pointer to the data is returned, otherwise nullptr. * @warning Recall: you are responsible for calling free() on any Non-nullptr pointer returned. */ - CC_DEPRECATED() + AX_DEPRECATED() static unsigned char* getFileDataFromZip(std::string_view zipFilePath, std::string_view filename, ssize_t* size); private: diff --git a/core/base/base64.cpp b/core/base/base64.cpp index 745dde04bc..179a26207d 100644 --- a/core/base/base64.cpp +++ b/core/base/base64.cpp @@ -76,7 +76,7 @@ int _base64Decode(const unsigned char* input, unsigned int input_len, unsigned c switch (char_count) { case 1: -#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_BADA) fprintf(stderr, "base64Decode: encoding incomplete: at least 2 bits missing"); #endif errors++; @@ -94,7 +94,7 @@ int _base64Decode(const unsigned char* input, unsigned int input_len, unsigned c { if (char_count) { -#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_BADA) fprintf(stderr, "base64 encoding incomplete: at least %d bits truncated", ((4 - char_count) * 6)); #endif errors++; @@ -169,7 +169,7 @@ int base64Decode(const unsigned char* in, unsigned int inLength, unsigned char** if (ret > 0) { -#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_BADA) printf("Base64Utils: error decoding"); #endif free(*out); diff --git a/core/base/base64.h b/core/base/base64.h index a6e16f5e7c..8e54029415 100644 --- a/core/base/base64.h +++ b/core/base/base64.h @@ -44,7 +44,7 @@ NS_AX_BEGIN * @since v0.8.1 */ -int CC_DLL base64Decode(const unsigned char* in, unsigned int inLength, unsigned char** out); +int AX_DLL base64Decode(const unsigned char* in, unsigned int inLength, unsigned char** out); /** * Encodes bytes into a 64base encoded memory with terminating '\0' character. @@ -54,7 +54,7 @@ int CC_DLL base64Decode(const unsigned char* in, unsigned int inLength, unsigned * @since v2.1.4 */ -int CC_DLL base64Encode(const unsigned char* in, unsigned int inLength, char** out); +int AX_DLL base64Encode(const unsigned char* in, unsigned int inLength, char** out); } // namespace cocos2d diff --git a/core/base/bitmask.h b/core/base/bitmask.h index 8e84e46484..497c5c1b90 100644 --- a/core/base/bitmask.h +++ b/core/base/bitmask.h @@ -33,7 +33,7 @@ Copyright (c) 2020 C4games Ltd. #endif // BITMASK OPERATIONS, modified from msvc++ for cross-platform compiling. -#define CC_ENABLE_BITMASK_OPS(_BITMASK) \ +#define AX_ENABLE_BITMASK_OPS(_BITMASK) \ constexpr _BITMASK operator&(_BITMASK _Left, _BITMASK _Right) noexcept \ { /* return _Left & _Right */ \ using _IntTy = _STD underlying_type<_BITMASK>::type; \ @@ -80,7 +80,7 @@ Copyright (c) 2020 C4games Ltd. } // BITSHIFT OPERATIONS, inspired from msvc++ . -#define CC_ENABLE_BITSHIFT_OPS(_BITMASK) \ +#define AX_ENABLE_BITSHIFT_OPS(_BITMASK) \ constexpr _BITMASK operator>>(_BITMASK _Left, _BITMASK _Right) noexcept \ { /* return _Left & _Right */ \ using _IntTy = _STD underlying_type<_BITMASK>::type; \ diff --git a/core/base/ccCArray.cpp b/core/base/ccCArray.cpp index 8ee244c4d9..2e6cca335e 100644 --- a/core/base/ccCArray.cpp +++ b/core/base/ccCArray.cpp @@ -64,7 +64,7 @@ void ccArrayDoubleCapacity(ccArray* arr) arr->max *= 2; Ref** newArr = (Ref**)realloc(arr->arr, arr->max * sizeof(Ref*)); // will fail when there's not enough memory - CCASSERT(newArr != 0, "ccArrayDoubleCapacity failed. Not enough memory"); + AXASSERT(newArr != 0, "ccArrayDoubleCapacity failed. Not enough memory"); arr->arr = newArr; } @@ -72,7 +72,7 @@ void ccArrayEnsureExtraCapacity(ccArray* arr, ssize_t extra) { while (arr->max < arr->num + extra) { - CCLOGINFO("cocos2d: ccCArray: resizing ccArray capacity from [%zd] to [%zd].", arr->max, arr->max * 2); + AXLOGINFO("cocos2d: ccCArray: resizing ccArray capacity from [%zd] to [%zd].", arr->max, arr->max * 2); ccArrayDoubleCapacity(arr); } @@ -97,11 +97,11 @@ void ccArrayShrink(ccArray* arr) } arr->arr = (Ref**)realloc(arr->arr, newSize * sizeof(Ref*)); - CCASSERT(arr->arr != nullptr, "could not reallocate the memory"); + AXASSERT(arr->arr != nullptr, "could not reallocate the memory"); } } -/** Returns index of first occurrence of object, CC_INVALID_INDEX if object not found. */ +/** Returns index of first occurrence of object, AX_INVALID_INDEX if object not found. */ ssize_t ccArrayGetIndexOfObject(ccArray* arr, Ref* object) { const auto arrNum = arr->num; @@ -112,19 +112,19 @@ ssize_t ccArrayGetIndexOfObject(ccArray* arr, Ref* object) return i; } - return CC_INVALID_INDEX; + return AX_INVALID_INDEX; } /** Returns a Boolean value that indicates whether object is present in array. */ bool ccArrayContainsObject(ccArray* arr, Ref* object) { - return ccArrayGetIndexOfObject(arr, object) != CC_INVALID_INDEX; + return ccArrayGetIndexOfObject(arr, object) != AX_INVALID_INDEX; } /** Appends an object. Behavior undefined if array doesn't have enough capacity. */ void ccArrayAppendObject(ccArray* arr, Ref* object) { - CCASSERT(object != nullptr, "Invalid parameter!"); + AXASSERT(object != nullptr, "Invalid parameter!"); object->retain(); arr->arr[arr->num] = object; arr->num++; @@ -157,8 +157,8 @@ void ccArrayAppendArrayWithResize(ccArray* arr, ccArray* plusArr) /** Inserts an object at index */ void ccArrayInsertObjectAtIndex(ccArray* arr, Ref* object, ssize_t index) { - CCASSERT(index <= arr->num, "Invalid index. Out of bounds"); - CCASSERT(object != nullptr, "Invalid parameter!"); + AXASSERT(index <= arr->num, "Invalid index. Out of bounds"); + AXASSERT(object != nullptr, "Invalid parameter!"); ccArrayEnsureExtraCapacity(arr, 1); @@ -176,8 +176,8 @@ void ccArrayInsertObjectAtIndex(ccArray* arr, Ref* object, ssize_t index) /** Swaps two objects */ void ccArraySwapObjectsAtIndexes(ccArray* arr, ssize_t index1, ssize_t index2) { - CCASSERT(index1 >= 0 && index1 < arr->num, "(1) Invalid index. Out of bounds"); - CCASSERT(index2 >= 0 && index2 < arr->num, "(2) Invalid index. Out of bounds"); + AXASSERT(index1 >= 0 && index1 < arr->num, "(1) Invalid index. Out of bounds"); + AXASSERT(index2 >= 0 && index2 < arr->num, "(2) Invalid index. Out of bounds"); Ref* object1 = arr->arr[index1]; @@ -198,10 +198,10 @@ void ccArrayRemoveAllObjects(ccArray* arr) Behavior undefined if index outside [0, num-1]. */ void ccArrayRemoveObjectAtIndex(ccArray* arr, ssize_t index, bool releaseObj /* = true*/) { - CCASSERT(arr && arr->num > 0 && index >= 0 && index < arr->num, "Invalid index. Out of bounds"); + AXASSERT(arr && arr->num > 0 && index >= 0 && index < arr->num, "Invalid index. Out of bounds"); if (releaseObj) { - CC_SAFE_RELEASE(arr->arr[index]); + AX_SAFE_RELEASE(arr->arr[index]); } arr->num--; @@ -218,7 +218,7 @@ void ccArrayRemoveObjectAtIndex(ccArray* arr, ssize_t index, bool releaseObj /* Behavior undefined if index outside [0, num-1]. */ void ccArrayFastRemoveObjectAtIndex(ccArray* arr, ssize_t index) { - CC_SAFE_RELEASE(arr->arr[index]); + AX_SAFE_RELEASE(arr->arr[index]); auto last = --arr->num; arr->arr[index] = arr->arr[last]; } @@ -226,7 +226,7 @@ void ccArrayFastRemoveObjectAtIndex(ccArray* arr, ssize_t index) void ccArrayFastRemoveObject(ccArray* arr, Ref* object) { auto index = ccArrayGetIndexOfObject(arr, object); - if (index != CC_INVALID_INDEX) + if (index != AX_INVALID_INDEX) { ccArrayFastRemoveObjectAtIndex(arr, index); } @@ -237,7 +237,7 @@ void ccArrayFastRemoveObject(ccArray* arr, Ref* object) void ccArrayRemoveObject(ccArray* arr, Ref* object, bool releaseObj /* = true*/) { auto index = ccArrayGetIndexOfObject(arr, object); - if (index != CC_INVALID_INDEX) + if (index != AX_INVALID_INDEX) { ccArrayRemoveObjectAtIndex(arr, index, releaseObj); } @@ -263,7 +263,7 @@ void ccArrayFullRemoveArray(ccArray* arr, ccArray* minusArr) { if (ccArrayContainsObject(minusArr, arr->arr[i])) { - CC_SAFE_RELEASE(arr->arr[i]); + AX_SAFE_RELEASE(arr->arr[i]); back++; } else @@ -319,7 +319,7 @@ void ccCArrayEnsureExtraCapacity(ccCArray* arr, ssize_t extra) ccArrayEnsureExtraCapacity((ccArray*)arr, extra); } -/** Returns index of first occurrence of value, CC_INVALID_INDEX if value not found. */ +/** Returns index of first occurrence of value, AX_INVALID_INDEX if value not found. */ ssize_t ccCArrayGetIndexOfValue(ccCArray* arr, void* value) { for (ssize_t i = 0; i < arr->num; i++) @@ -327,19 +327,19 @@ ssize_t ccCArrayGetIndexOfValue(ccCArray* arr, void* value) if (arr->arr[i] == value) return i; } - return CC_INVALID_INDEX; + return AX_INVALID_INDEX; } /** Returns a Boolean value that indicates whether value is present in the C array. */ bool ccCArrayContainsValue(ccCArray* arr, void* value) { - return ccCArrayGetIndexOfValue(arr, value) != CC_INVALID_INDEX; + return ccCArrayGetIndexOfValue(arr, value) != AX_INVALID_INDEX; } /** Inserts a value at a certain position. Behavior undefined if array doesn't have enough capacity */ void ccCArrayInsertValueAtIndex(ccCArray* arr, void* value, ssize_t index) { - CCASSERT(index < arr->max, "ccCArrayInsertValueAtIndex: invalid index"); + AXASSERT(index < arr->max, "ccCArrayInsertValueAtIndex: invalid index"); auto remaining = arr->num - index; // make sure it has enough capacity @@ -430,7 +430,7 @@ void ccCArrayFastRemoveValueAtIndex(ccCArray* arr, ssize_t index) void ccCArrayRemoveValue(ccCArray* arr, void* value) { auto index = ccCArrayGetIndexOfValue(arr, value); - if (index != CC_INVALID_INDEX) + if (index != AX_INVALID_INDEX) { ccCArrayRemoveValueAtIndex(arr, index); } diff --git a/core/base/ccCArray.h b/core/base/ccCArray.h index d029fbc731..5fc91056fb 100644 --- a/core/base/ccCArray.h +++ b/core/base/ccCArray.h @@ -41,8 +41,8 @@ THE SOFTWARE. - ccCArray functions that manipulates values like if they were standard C structures (no retain/release is performed) */ -#ifndef CC_ARRAY_H -#define CC_ARRAY_H +#ifndef AX_ARRAY_H +#define AX_ARRAY_H /// @cond DO_NOT_SHOW #include "base/ccMacros.h" @@ -66,70 +66,70 @@ typedef struct _ccArray } ccArray; /** Allocates and initializes a new array with specified capacity */ -CC_DLL ccArray* ccArrayNew(ssize_t capacity); +AX_DLL ccArray* ccArrayNew(ssize_t capacity); /** Frees array after removing all remaining objects. Silently ignores nil arr. */ -CC_DLL void ccArrayFree(ccArray*& arr); +AX_DLL void ccArrayFree(ccArray*& arr); /** Doubles array capacity */ -CC_DLL void ccArrayDoubleCapacity(ccArray* arr); +AX_DLL void ccArrayDoubleCapacity(ccArray* arr); /** Increases array capacity such that max >= num + extra. */ -CC_DLL void ccArrayEnsureExtraCapacity(ccArray* arr, ssize_t extra); +AX_DLL void ccArrayEnsureExtraCapacity(ccArray* arr, ssize_t extra); /** shrinks the array so the memory footprint corresponds with the number of items */ -CC_DLL void ccArrayShrink(ccArray* arr); +AX_DLL void ccArrayShrink(ccArray* arr); /** Returns index of first occurrence of object, NSNotFound if object not found. */ -CC_DLL ssize_t ccArrayGetIndexOfObject(ccArray* arr, Ref* object); +AX_DLL ssize_t ccArrayGetIndexOfObject(ccArray* arr, Ref* object); /** Returns a Boolean value that indicates whether object is present in array. */ -CC_DLL bool ccArrayContainsObject(ccArray* arr, Ref* object); +AX_DLL bool ccArrayContainsObject(ccArray* arr, Ref* object); /** Appends an object. Behavior undefined if array doesn't have enough capacity. */ -CC_DLL void ccArrayAppendObject(ccArray* arr, Ref* object); +AX_DLL void ccArrayAppendObject(ccArray* arr, Ref* object); /** Appends an object. Capacity of arr is increased if needed. */ -CC_DLL void ccArrayAppendObjectWithResize(ccArray* arr, Ref* object); +AX_DLL void ccArrayAppendObjectWithResize(ccArray* arr, Ref* object); /** Appends objects from plusArr to arr. Behavior undefined if arr doesn't have enough capacity. */ -CC_DLL void ccArrayAppendArray(ccArray* arr, ccArray* plusArr); +AX_DLL void ccArrayAppendArray(ccArray* arr, ccArray* plusArr); /** Appends objects from plusArr to arr. Capacity of arr is increased if needed. */ -CC_DLL void ccArrayAppendArrayWithResize(ccArray* arr, ccArray* plusArr); +AX_DLL void ccArrayAppendArrayWithResize(ccArray* arr, ccArray* plusArr); /** Inserts an object at index */ -CC_DLL void ccArrayInsertObjectAtIndex(ccArray* arr, Ref* object, ssize_t index); +AX_DLL void ccArrayInsertObjectAtIndex(ccArray* arr, Ref* object, ssize_t index); /** Swaps two objects */ -CC_DLL void ccArraySwapObjectsAtIndexes(ccArray* arr, ssize_t index1, ssize_t index2); +AX_DLL void ccArraySwapObjectsAtIndexes(ccArray* arr, ssize_t index1, ssize_t index2); /** Removes all objects from arr */ -CC_DLL void ccArrayRemoveAllObjects(ccArray* arr); +AX_DLL void ccArrayRemoveAllObjects(ccArray* arr); /** Removes object at specified index and pushes back all subsequent objects. Behavior undefined if index outside [0, num-1]. */ -CC_DLL void ccArrayRemoveObjectAtIndex(ccArray* arr, ssize_t index, bool releaseObj = true); +AX_DLL void ccArrayRemoveObjectAtIndex(ccArray* arr, ssize_t index, bool releaseObj = true); /** Removes object at specified index and fills the gap with the last object, thereby avoiding the need to push back subsequent objects. Behavior undefined if index outside [0, num-1]. */ -CC_DLL void ccArrayFastRemoveObjectAtIndex(ccArray* arr, ssize_t index); +AX_DLL void ccArrayFastRemoveObjectAtIndex(ccArray* arr, ssize_t index); -CC_DLL void ccArrayFastRemoveObject(ccArray* arr, Ref* object); +AX_DLL void ccArrayFastRemoveObject(ccArray* arr, Ref* object); /** Searches for the first occurrence of object and removes it. If object is not found the function has no effect. */ -CC_DLL void ccArrayRemoveObject(ccArray* arr, Ref* object, bool releaseObj = true); +AX_DLL void ccArrayRemoveObject(ccArray* arr, Ref* object, bool releaseObj = true); /** Removes from arr all objects in minusArr. For each object in minusArr, the first matching instance in arr will be removed. */ -CC_DLL void ccArrayRemoveArray(ccArray* arr, ccArray* minusArr); +AX_DLL void ccArrayRemoveArray(ccArray* arr, ccArray* minusArr); /** Removes from arr all objects in minusArr. For each object in minusArr, all matching instances in arr will be removed. */ -CC_DLL void ccArrayFullRemoveArray(ccArray* arr, ccArray* minusArr); +AX_DLL void ccArrayFullRemoveArray(ccArray* arr, ccArray* minusArr); // // // ccCArray for Values (c structures) @@ -141,72 +141,72 @@ typedef struct _ccCArray } ccCArray; /** Allocates and initializes a new C array with specified capacity */ -CC_DLL ccCArray* ccCArrayNew(ssize_t capacity); +AX_DLL ccCArray* ccCArrayNew(ssize_t capacity); /** Frees C array after removing all remaining values. Silently ignores nil arr. */ -CC_DLL void ccCArrayFree(ccCArray* arr); +AX_DLL void ccCArrayFree(ccCArray* arr); /** Doubles C array capacity */ -CC_DLL void ccCArrayDoubleCapacity(ccCArray* arr); +AX_DLL void ccCArrayDoubleCapacity(ccCArray* arr); /** Increases array capacity such that max >= num + extra. */ -CC_DLL void ccCArrayEnsureExtraCapacity(ccCArray* arr, ssize_t extra); +AX_DLL void ccCArrayEnsureExtraCapacity(ccCArray* arr, ssize_t extra); /** Returns index of first occurrence of value, NSNotFound if value not found. */ -CC_DLL ssize_t ccCArrayGetIndexOfValue(ccCArray* arr, void* value); +AX_DLL ssize_t ccCArrayGetIndexOfValue(ccCArray* arr, void* value); /** Returns a Boolean value that indicates whether value is present in the C array. */ -CC_DLL bool ccCArrayContainsValue(ccCArray* arr, void* value); +AX_DLL bool ccCArrayContainsValue(ccCArray* arr, void* value); /** Inserts a value at a certain position. Behavior undefined if array doesn't have enough capacity */ -CC_DLL void ccCArrayInsertValueAtIndex(ccCArray* arr, void* value, ssize_t index); +AX_DLL void ccCArrayInsertValueAtIndex(ccCArray* arr, void* value, ssize_t index); /** Appends an value. Behavior undefined if array doesn't have enough capacity. */ -CC_DLL void ccCArrayAppendValue(ccCArray* arr, void* value); +AX_DLL void ccCArrayAppendValue(ccCArray* arr, void* value); /** Appends an value. Capacity of arr is increased if needed. */ -CC_DLL void ccCArrayAppendValueWithResize(ccCArray* arr, void* value); +AX_DLL void ccCArrayAppendValueWithResize(ccCArray* arr, void* value); /** Appends values from plusArr to arr. Behavior undefined if arr doesn't have enough capacity. */ -CC_DLL void ccCArrayAppendArray(ccCArray* arr, ccCArray* plusArr); +AX_DLL void ccCArrayAppendArray(ccCArray* arr, ccCArray* plusArr); /** Appends values from plusArr to arr. Capacity of arr is increased if needed. */ -CC_DLL void ccCArrayAppendArrayWithResize(ccCArray* arr, ccCArray* plusArr); +AX_DLL void ccCArrayAppendArrayWithResize(ccCArray* arr, ccCArray* plusArr); /** Removes all values from arr */ -CC_DLL void ccCArrayRemoveAllValues(ccCArray* arr); +AX_DLL void ccCArrayRemoveAllValues(ccCArray* arr); /** Removes value at specified index and pushes back all subsequent values. Behavior undefined if index outside [0, num-1]. @since v0.99.4 */ -CC_DLL void ccCArrayRemoveValueAtIndex(ccCArray* arr, ssize_t index); +AX_DLL void ccCArrayRemoveValueAtIndex(ccCArray* arr, ssize_t index); /** Removes value at specified index and fills the gap with the last value, thereby avoiding the need to push back subsequent values. Behavior undefined if index outside [0, num-1]. @since v0.99.4 */ -CC_DLL void ccCArrayFastRemoveValueAtIndex(ccCArray* arr, ssize_t index); +AX_DLL void ccCArrayFastRemoveValueAtIndex(ccCArray* arr, ssize_t index); /** Searches for the first occurrence of value and removes it. If value is not found the function has no effect. @since v0.99.4 */ -CC_DLL void ccCArrayRemoveValue(ccCArray* arr, void* value); +AX_DLL void ccCArrayRemoveValue(ccCArray* arr, void* value); /** Removes from arr all values in minusArr. For each Value in minusArr, the first matching instance in arr will be removed. @since v0.99.4 */ -CC_DLL void ccCArrayRemoveArray(ccCArray* arr, ccCArray* minusArr); +AX_DLL void ccCArrayRemoveArray(ccCArray* arr, ccCArray* minusArr); /** Removes from arr all values in minusArr. For each value in minusArr, all matching instances in arr will be removed. @since v0.99.4 */ -CC_DLL void ccCArrayFullRemoveArray(ccCArray* arr, ccCArray* minusArr); +AX_DLL void ccCArrayFullRemoveArray(ccCArray* arr, ccCArray* minusArr); NS_AX_END /// @endcond -#endif // CC_ARRAY_H +#endif // AX_ARRAY_H diff --git a/core/base/ccConfig.h b/core/base/ccConfig.h index d8b90a0c54..173b589df5 100644 --- a/core/base/ccConfig.h +++ b/core/base/ccConfig.h @@ -34,18 +34,18 @@ THE SOFTWARE. * cocos2d (cc) configuration file. */ -/** @def CC_ENABLE_STACKABLE_ACTIONS +/** @def AX_ENABLE_STACKABLE_ACTIONS * If enabled, actions that alter the position property (eg: MoveBy, JumpBy, BezierBy, etc..) will be stacked. * If you run 2 or more 'position' actions at the same time on a node, then end position will be the sum of all the * positions. If disabled, only the last run action will take effect. Enabled by default. Disable to be compatible with * v2.0 and older versions. * @since v2.1 */ -#ifndef CC_ENABLE_STACKABLE_ACTIONS -# define CC_ENABLE_STACKABLE_ACTIONS 1 +#ifndef AX_ENABLE_STACKABLE_ACTIONS +# define AX_ENABLE_STACKABLE_ACTIONS 1 #endif -/** @def CC_ENABLE_GL_STATE_CACHE +/** @def AX_ENABLE_GL_STATE_CACHE * If enabled, cocos2d will maintain an OpenGL state cache internally to avoid unnecessary switches. * In order to use them, you have to use the following functions, instead of the GL ones: * - ccGLUseProgram() instead of glUseProgram(). @@ -63,11 +63,11 @@ THE SOFTWARE. * @since v2.0.0 */ -#ifndef CC_ENABLE_GL_STATE_CACHE -# define CC_ENABLE_GL_STATE_CACHE 1 +#ifndef AX_ENABLE_GL_STATE_CACHE +# define AX_ENABLE_GL_STATE_CACHE 1 #endif -/** @def CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +/** @def AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL * If enabled, the texture coordinates will be calculated by using this formula: * - texCoord.left = (rect.origin.x*2+1) / (texture.wide*2); * - texCoord.right = texCoord.left + (rect.size.width*2-2)/(texture.wide*2); @@ -87,31 +87,31 @@ THE SOFTWARE. * @since v0.99.5 */ -#ifndef CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL -# define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0 +#ifndef AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL +# define AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0 #endif -/** @def CC_DIRECTOR_STATS_INTERVAL +/** @def AX_DIRECTOR_STATS_INTERVAL * Seconds between FPS updates. * 0.5 seconds, means that the FPS number will be updated every 0.5 seconds. * Having a bigger number means a more reliable FPS. * Default value: 0.5f */ -#ifndef CC_DIRECTOR_STATS_INTERVAL -# define CC_DIRECTOR_STATS_INTERVAL (0.5f) +#ifndef AX_DIRECTOR_STATS_INTERVAL +# define AX_DIRECTOR_STATS_INTERVAL (0.5f) #endif -/** @def CC_DIRECTOR_FPS_POSITION +/** @def AX_DIRECTOR_FPS_POSITION * Position of the FPS. * Default: 0,0 (bottom-left corner). */ -#ifndef CC_DIRECTOR_FPS_POSITION -# define CC_DIRECTOR_FPS_POSITION Vec2(0, 0) +#ifndef AX_DIRECTOR_FPS_POSITION +# define AX_DIRECTOR_FPS_POSITION Vec2(0, 0) #endif -/** @def CC_DIRECTOR_DISPATCH_FAST_EVENTS +/** @def AX_DIRECTOR_DISPATCH_FAST_EVENTS * If enabled, and only when it is used with FastDirector, the main loop will wait 0.04 seconds to * dispatch all the events, even if there are not events to dispatch. * If your game uses lot's of events (eg: touches) it might be a good idea to enable this feature. @@ -121,62 +121,62 @@ THE SOFTWARE. * @warning This feature is experimental. */ -#ifndef CC_DIRECTOR_DISPATCH_FAST_EVENTS -# define CC_DIRECTOR_DISPATCH_FAST_EVENTS 0 +#ifndef AX_DIRECTOR_DISPATCH_FAST_EVENTS +# define AX_DIRECTOR_DISPATCH_FAST_EVENTS 0 #endif -/** @def CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD +/** @def AX_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD * If enabled, cocos2d-mac will run on the Display Link thread. If disabled cocos2d-mac will run in its own thread. * If enabled, the images will be drawn at the "correct" time, but the events might not be very responsive. * If disabled, some frames might be skipped, but the events will be dispatched as they arrived. * To enable set it to a 1, to disable it set to 0. Enabled by default. * Only valid for cocos2d-mac. Not supported on cocos2d-ios. */ -#ifndef CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD -# define CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD 1 +#ifndef AX_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD +# define AX_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD 1 #endif -/** @def CC_NODE_RENDER_SUBPIXEL +/** @def AX_NODE_RENDER_SUBPIXEL * If enabled, the Node objects (Sprite, Label,etc) will be able to render in subpixels. * If disabled, integer pixels will be used. * To enable set it to 1. Enabled by default. */ -#ifndef CC_NODE_RENDER_SUBPIXEL -# define CC_NODE_RENDER_SUBPIXEL 1 +#ifndef AX_NODE_RENDER_SUBPIXEL +# define AX_NODE_RENDER_SUBPIXEL 1 #endif -/** @def CC_SPRITEBATCHNODE_RENDER_SUBPIXEL +/** @def AX_SPRITEBATCHNODE_RENDER_SUBPIXEL * If enabled, the Sprite objects rendered with SpriteBatchNode will be able to render in subpixels. * If disabled, integer pixels will be used. * To enable set it to 1. Enabled by default. */ -#ifndef CC_SPRITEBATCHNODE_RENDER_SUBPIXEL -# define CC_SPRITEBATCHNODE_RENDER_SUBPIXEL 1 +#ifndef AX_SPRITEBATCHNODE_RENDER_SUBPIXEL +# define AX_SPRITEBATCHNODE_RENDER_SUBPIXEL 1 #endif -/** @def CC_TEXTURE_ATLAS_USE_VAO +/** @def AX_TEXTURE_ATLAS_USE_VAO * By default, TextureAtlas (used by many cocos2d classes) will use VAO (Vertex Array Objects). * Apple recommends its usage but they might consume a lot of memory, specially if you use many of them. * So for certain cases, where you might need hundreds of VAO objects, it might be a good idea to disable it. * To disable it set it to 0. Enabled by default. * If a device doesn't support VAO though it claims to support should add exceptions list here. */ -#ifndef CC_TEXTURE_ATLAS_USE_VAO -# define CC_TEXTURE_ATLAS_USE_VAO 1 +#ifndef AX_TEXTURE_ATLAS_USE_VAO +# define AX_TEXTURE_ATLAS_USE_VAO 1 #endif -/** @def CC_USE_LA88_LABELS +/** @def AX_USE_LA88_LABELS * If enabled, it will use LA88 (Luminance Alpha 16-bit textures) for LabelTTF objects. * If it is disabled, it will use A8 (Alpha 8-bit textures). * LA88 textures are 6% faster than A8 textures, but they will consume 2x memory. * This feature is enabled by default. * @since v0.99.5 */ -#ifndef CC_USE_LA88_LABELS -# define CC_USE_LA88_LABELS 1 +#ifndef AX_USE_LA88_LABELS +# define AX_USE_LA88_LABELS 1 #endif -/** @def CC_SPRITE_DEBUG_DRAW +/** @def AX_SPRITE_DEBUG_DRAW * If enabled, all subclasses of Sprite will draw a bounding box. * Useful for debugging purposes only. It is recommended to leave it disabled. * To enable set it to a value different than 0. Disabled by default: @@ -184,177 +184,177 @@ THE SOFTWARE. * 1 -- draw bounding box * 2 -- draw texture box */ -#ifndef CC_SPRITE_DEBUG_DRAW -# define CC_SPRITE_DEBUG_DRAW 0 +#ifndef AX_SPRITE_DEBUG_DRAW +# define AX_SPRITE_DEBUG_DRAW 0 #endif -/** @def CC_LABEL_DEBUG_DRAW +/** @def AX_LABEL_DEBUG_DRAW * If enabled, all subclasses of Label will draw a bounding box. * Useful for debugging purposes only. It is recommended to leave it disabled. * To enable set it to a value different than 0. Disabled by default: * 0 -- disabled * 1 -- draw bounding box */ -#ifndef CC_LABEL_DEBUG_DRAW -# define CC_LABEL_DEBUG_DRAW 0 +#ifndef AX_LABEL_DEBUG_DRAW +# define AX_LABEL_DEBUG_DRAW 0 #endif -/** @def CC_SPRITEBATCHNODE_DEBUG_DRAW +/** @def AX_SPRITEBATCHNODE_DEBUG_DRAW * If enabled, all subclasses of Sprite that are rendered using an SpriteBatchNode draw a bounding box. * Useful for debugging purposes only. It is recommended to leave it disabled. * To enable set it to a value different than 0. Disabled by default. */ -#ifndef CC_SPRITEBATCHNODE_DEBUG_DRAW -# define CC_SPRITEBATCHNODE_DEBUG_DRAW 0 +#ifndef AX_SPRITEBATCHNODE_DEBUG_DRAW +# define AX_SPRITEBATCHNODE_DEBUG_DRAW 0 #endif -/** @def CC_LABELBMFONT_DEBUG_DRAW +/** @def AX_LABELBMFONT_DEBUG_DRAW * If enabled, all subclasses of LabelBMFont will draw a bounding box. * Useful for debugging purposes only. It is recommended to leave it disabled. * To enable set it to a value different than 0. Disabled by default. */ -#ifndef CC_LABELBMFONT_DEBUG_DRAW -# define CC_LABELBMFONT_DEBUG_DRAW 0 +#ifndef AX_LABELBMFONT_DEBUG_DRAW +# define AX_LABELBMFONT_DEBUG_DRAW 0 #endif -/** @def CC_LABELATLAS_DEBUG_DRAW +/** @def AX_LABELATLAS_DEBUG_DRAW * If enabled, all subclasses of LabeltAtlas will draw a bounding box * Useful for debugging purposes only. It is recommended to leave it disabled. * To enable set it to a value different than 0. Disabled by default. */ -#ifndef CC_LABELATLAS_DEBUG_DRAW -# define CC_LABELATLAS_DEBUG_DRAW 0 +#ifndef AX_LABELATLAS_DEBUG_DRAW +# define AX_LABELATLAS_DEBUG_DRAW 0 #endif -/** @def CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS +/** @def AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS * If enabled (in conjunction with assertion macros) will verify on Node destruction that the node being destroyed has * no event listeners still associated with it in the event dispatcher. This can be used to track down problems where * the event dispatch system has dangling pointers to destroyed nodes. Note: event listener verification will always be * disabled in builds where assertions are disabled regardless of this setting. */ -#ifndef CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS -# define CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS 0 +#ifndef AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS +# define AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS 0 #endif -/** @def CC_ENABLE_PROFILERS +/** @def AX_ENABLE_PROFILERS * If enabled, will activate various profilers within cocos2d. This statistical data will be output to the console * once per second showing average time (in milliseconds) required to execute the specific routine(s). * Useful for debugging purposes only. It is recommended to leave it disabled. * To enable set it to a value different than 0. Disabled by default. */ -#ifndef CC_ENABLE_PROFILERS -# define CC_ENABLE_PROFILERS 0 +#ifndef AX_ENABLE_PROFILERS +# define AX_ENABLE_PROFILERS 0 #endif /** Enable Lua engine debug log. */ -#ifndef CC_LUA_ENGINE_DEBUG -# define CC_LUA_ENGINE_DEBUG 0 +#ifndef AX_LUA_ENGINE_DEBUG +# define AX_LUA_ENGINE_DEBUG 0 #endif /** Use physics integration API. */ // It works with: // Chipmunk2D or Box2D -#ifndef CC_USE_PHYSICS -# define CC_USE_PHYSICS 1 +#ifndef AX_USE_PHYSICS +# define AX_USE_PHYSICS 1 #endif -#if (CC_USE_PHYSICS) +#if (AX_USE_PHYSICS) /** Use Chipmunk2D physics 2d engine on physics integration API. */ -# ifndef CC_ENABLE_CHIPMUNK_INTEGRATION -# define CC_ENABLE_CHIPMUNK_INTEGRATION 0 +# ifndef AX_ENABLE_CHIPMUNK_INTEGRATION +# define AX_ENABLE_CHIPMUNK_INTEGRATION 0 # endif /** or use Box2D physics 2d engine on physics integration API. */ -# ifndef CC_ENABLE_BOX2D_INTEGRATION -# define CC_ENABLE_BOX2D_INTEGRATION 1 +# ifndef AX_ENABLE_BOX2D_INTEGRATION +# define AX_ENABLE_BOX2D_INTEGRATION 1 # endif -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS /** Use 3d physics integration API. */ -#ifndef CC_USE_3D_PHYSICS -# if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || \ - CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) -# define CC_USE_3D_PHYSICS 1 +#ifndef AX_USE_3D_PHYSICS +# if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || \ + AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +# define AX_USE_3D_PHYSICS 1 # endif #endif -#if (CC_USE_3D_PHYSICS) +#if (AX_USE_3D_PHYSICS) /** Use bullet physics engine. */ -# ifndef CC_ENABLE_BULLET_INTEGRATION -# define CC_ENABLE_BULLET_INTEGRATION 1 +# ifndef AX_ENABLE_BULLET_INTEGRATION +# define AX_ENABLE_BULLET_INTEGRATION 1 # endif #endif /** Use 3D navigation API */ -#ifndef CC_USE_NAVMESH -# define CC_USE_NAVMESH 1 +#ifndef AX_USE_NAVMESH +# define AX_USE_NAVMESH 1 #endif /** Use culling or not. */ -#ifndef CC_USE_CULLING -# define CC_USE_CULLING 1 +#ifndef AX_USE_CULLING +# define AX_USE_CULLING 1 #endif /** Support PNG or not. If your application don't use png format picture, you can undefine this macro to save package * size. */ -#ifndef CC_USE_PNG -# define CC_USE_PNG 1 -#endif // CC_USE_PNG +#ifndef AX_USE_PNG +# define AX_USE_PNG 1 +#endif // AX_USE_PNG /** Support JPEG or not. If your application don't use jpeg format picture, you can undefine this macro to save package * size. */ -#ifndef CC_USE_JPEG -# define CC_USE_JPEG 1 -#endif // CC_USE_JPEG +#ifndef AX_USE_JPEG +# define AX_USE_JPEG 1 +#endif // AX_USE_JPEG /** Support webp or not. If your application don't use webp format picture, you can undefine this macro to save package * size. */ -#ifndef CC_USE_WEBP -# define CC_USE_WEBP 1 -#endif // CC_USE_WEBP +#ifndef AX_USE_WEBP +# define AX_USE_WEBP 1 +#endif // AX_USE_WEBP /** Enable Lua Script binding */ -#ifndef CC_ENABLE_SCRIPT_BINDING -# define CC_ENABLE_SCRIPT_BINDING 1 +#ifndef AX_ENABLE_SCRIPT_BINDING +# define AX_ENABLE_SCRIPT_BINDING 1 #endif -/** When CC_ENABLE_SCRIPT_BINDING and CC_ENABLE_GC_FOR_NATIVE_OBJECTS are both 1 +/** When AX_ENABLE_SCRIPT_BINDING and AX_ENABLE_GC_FOR_NATIVE_OBJECTS are both 1 * then the Garbage collector will release the native objects, only when the JS/Lua objects * are collected. * The benefit is that users don't need to retain/release the JS/Lua objects manually. * Disabled by default. */ -#ifdef CC_ENABLE_SCRIPT_BINDING -# ifndef CC_ENABLE_GC_FOR_NATIVE_OBJECTS -# define CC_ENABLE_GC_FOR_NATIVE_OBJECTS 0 +#ifdef AX_ENABLE_SCRIPT_BINDING +# ifndef AX_ENABLE_GC_FOR_NATIVE_OBJECTS +# define AX_ENABLE_GC_FOR_NATIVE_OBJECTS 0 # endif #endif -#ifndef CC_FILEUTILS_APPLE_ENABLE_OBJC -# define CC_FILEUTILS_APPLE_ENABLE_OBJC 1 +#ifndef AX_FILEUTILS_APPLE_ENABLE_OBJC +# define AX_FILEUTILS_APPLE_ENABLE_OBJC 1 #endif -/** @def CC_ENABLE_PREMULTIPLIED_ALPHA +/** @def AX_ENABLE_PREMULTIPLIED_ALPHA * If enabled, all textures will be preprocessed to multiply its rgb components * by its alpha component. */ -#ifndef CC_ENABLE_PREMULTIPLIED_ALPHA -# define CC_ENABLE_PREMULTIPLIED_ALPHA 1 +#ifndef AX_ENABLE_PREMULTIPLIED_ALPHA +# define AX_ENABLE_PREMULTIPLIED_ALPHA 1 #endif -/** @def CC_STRIP_FPS +/** @def AX_STRIP_FPS * Whether to strip FPS related data and functions, such as cc_fps_images_png */ -#ifndef CC_STRIP_FPS -# define CC_STRIP_FPS 0 +#ifndef AX_STRIP_FPS +# define AX_STRIP_FPS 0 #endif -#ifndef CC_REDUCE_PAUSED_CPU_USAGE -# define CC_REDUCE_PAUSED_CPU_USAGE 0 +#ifndef AX_REDUCE_PAUSED_CPU_USAGE +# define AX_REDUCE_PAUSED_CPU_USAGE 0 #endif -#ifndef CC_META_TEXTURES -# define CC_META_TEXTURES 2 +#ifndef AX_META_TEXTURES +# define AX_META_TEXTURES 2 #endif diff --git a/core/base/ccFPSImages.c b/core/base/ccFPSImages.c index 8ff5e48907..a1df969be3 100644 --- a/core/base/ccFPSImages.c +++ b/core/base/ccFPSImages.c @@ -26,7 +26,7 @@ #include "base/ccFPSImages.h" -#if !CC_STRIP_FPS +#if !AX_STRIP_FPS unsigned char cc_fps_images_png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x03, @@ -1516,4 +1516,4 @@ unsigned int cc_fps_images_len(void) return sizeof(cc_fps_images_png); } -#endif // #if !CC_STRIP_FPS +#endif // #if !AX_STRIP_FPS diff --git a/core/base/ccFPSImages.h b/core/base/ccFPSImages.h index 4bf7924604..087acde554 100644 --- a/core/base/ccFPSImages.h +++ b/core/base/ccFPSImages.h @@ -33,7 +33,7 @@ THE SOFTWARE. extern "C" { #endif -#if !CC_STRIP_FPS +#if !AX_STRIP_FPS extern unsigned char cc_fps_images_png[]; extern unsigned int cc_fps_images_len(void); #endif diff --git a/core/base/ccMacros.h b/core/base/ccMacros.h index ab316812a1..016e2b3248 100644 --- a/core/base/ccMacros.h +++ b/core/base/ccMacros.h @@ -36,141 +36,141 @@ THE SOFTWARE. #include "base/CCConsole.h" #include "platform/CCStdC.h" -#ifndef CCASSERT -# if COCOS2D_DEBUG > 0 -# if CC_ENABLE_SCRIPT_BINDING -extern bool CC_DLL cc_assert_script_compatible(const char* msg); -# define CCASSERT(cond, msg) \ +#ifndef AXASSERT +# if AXIS_DEBUG > 0 +# if AX_ENABLE_SCRIPT_BINDING +extern bool AX_DLL cc_assert_script_compatible(const char* msg); +# define AXASSERT(cond, msg) \ do \ { \ if (!(cond)) \ { \ if (msg && *msg && !cc_assert_script_compatible(msg)) \ axis::log("Assert failed: %s", msg); \ - CC_ASSERT(cond); \ + AX_ASSERT(cond); \ } \ } while (0) # else -# define CCASSERT(cond, msg) CC_ASSERT(cond) +# define AXASSERT(cond, msg) AX_ASSERT(cond) # endif # else -# define CCASSERT(cond, msg) +# define AXASSERT(cond, msg) # endif -# define GP_ASSERT(cond) CCASSERT(cond, "") +# define GP_ASSERT(cond) AXASSERT(cond, "") // FIXME:: Backward compatible -# define CCAssert CCASSERT -#endif // CCASSERT +# define CCAssert AXASSERT +#endif // AXASSERT #include "base/ccConfig.h" #include "base/ccRandom.h" -#define CC_HALF_PI (M_PI * 0.5f) +#define AX_HALF_PI (M_PI * 0.5f) -#define CC_DOUBLE_PI (M_PI * 2) +#define AX_DOUBLE_PI (M_PI * 2) -/** @def CCRANDOM_MINUS1_1 +/** @def AXRANDOM_MINUS1_1 returns a random float between -1 and 1 */ -#define CCRANDOM_MINUS1_1() axis::rand_minus1_1() +#define AXRANDOM_MINUS1_1() axis::rand_minus1_1() -/** @def CCRANDOM_0_1 +/** @def AXRANDOM_0_1 returns a random float between 0 and 1 */ -#define CCRANDOM_0_1() axis::rand_0_1() +#define AXRANDOM_0_1() axis::rand_0_1() -/** @def CC_DEGREES_TO_RADIANS +/** @def AX_DEGREES_TO_RADIANS converts degrees to radians */ -#define CC_DEGREES_TO_RADIANS(__ANGLE__) ((__ANGLE__)*0.01745329252f) // PI / 180 +#define AX_DEGREES_TO_RADIANS(__ANGLE__) ((__ANGLE__)*0.01745329252f) // PI / 180 -/** @def CC_RADIANS_TO_DEGREES +/** @def AX_RADIANS_TO_DEGREES converts radians to degrees */ -#define CC_RADIANS_TO_DEGREES(__ANGLE__) ((__ANGLE__)*57.29577951f) // PI * 180 +#define AX_RADIANS_TO_DEGREES(__ANGLE__) ((__ANGLE__)*57.29577951f) // PI * 180 -#define CC_REPEAT_FOREVER (UINT_MAX - 1) -#define kRepeatForever CC_REPEAT_FOREVER +#define AX_REPEAT_FOREVER (UINT_MAX - 1) +#define kRepeatForever AX_REPEAT_FOREVER -/** @def CC_BLEND_SRC +/** @def AX_BLEND_SRC default gl blend src function. Compatible with premultiplied alpha images. */ -#define CC_BLEND_SRC axis::backend::BlendFactor::ONE -#define CC_BLEND_DST axis::backend::BlendFactor::ONE_MINUS_SRC_ALPHA +#define AX_BLEND_SRC axis::backend::BlendFactor::ONE +#define AX_BLEND_DST axis::backend::BlendFactor::ONE_MINUS_SRC_ALPHA -/** @def CC_NODE_DRAW_SETUP [DEPRECATED] +/** @def AX_NODE_DRAW_SETUP [DEPRECATED] Helpful macro that setups the GL server state, the correct GL program and sets the Model View Projection matrix @since v2.0 */ -#define CC_NODE_DRAW_SETUP() +#define AX_NODE_DRAW_SETUP() -/** @def CC_DIRECTOR_END +/** @def AX_DIRECTOR_END Stops and removes the director from memory. Removes the GLView from its parent @since v0.99.4 */ -#define CC_DIRECTOR_END() \ +#define AX_DIRECTOR_END() \ do \ { \ Director* __director = axis::Director::getInstance(); \ __director->end(); \ } while (0) -/** @def CC_CONTENT_SCALE_FACTOR +/** @def AX_CONTENT_SCALE_FACTOR On Mac it returns 1; On iPhone it returns 2 if RetinaDisplay is On. Otherwise it returns 1 */ -#define CC_CONTENT_SCALE_FACTOR() axis::Director::getInstance()->getContentScaleFactor() +#define AX_CONTENT_SCALE_FACTOR() axis::Director::getInstance()->getContentScaleFactor() /****************************/ /** RETINA DISPLAY ENABLED **/ /****************************/ -/** @def CC_RECT_PIXELS_TO_POINTS +/** @def AX_RECT_PIXELS_TO_POINTS Converts a rect in pixels to points */ -#define CC_RECT_PIXELS_TO_POINTS(__rect_in_pixels__) \ - axis::Rect((__rect_in_pixels__).origin.x / CC_CONTENT_SCALE_FACTOR(), \ - (__rect_in_pixels__).origin.y / CC_CONTENT_SCALE_FACTOR(), \ - (__rect_in_pixels__).size.width / CC_CONTENT_SCALE_FACTOR(), \ - (__rect_in_pixels__).size.height / CC_CONTENT_SCALE_FACTOR()) +#define AX_RECT_PIXELS_TO_POINTS(__rect_in_pixels__) \ + axis::Rect((__rect_in_pixels__).origin.x / AX_CONTENT_SCALE_FACTOR(), \ + (__rect_in_pixels__).origin.y / AX_CONTENT_SCALE_FACTOR(), \ + (__rect_in_pixels__).size.width / AX_CONTENT_SCALE_FACTOR(), \ + (__rect_in_pixels__).size.height / AX_CONTENT_SCALE_FACTOR()) -/** @def CC_RECT_POINTS_TO_PIXELS +/** @def AX_RECT_POINTS_TO_PIXELS Converts a rect in points to pixels */ -#define CC_RECT_POINTS_TO_PIXELS(__rect_in_points_points__) \ - axis::Rect((__rect_in_points_points__).origin.x* CC_CONTENT_SCALE_FACTOR(), \ - (__rect_in_points_points__).origin.y* CC_CONTENT_SCALE_FACTOR(), \ - (__rect_in_points_points__).size.width* CC_CONTENT_SCALE_FACTOR(), \ - (__rect_in_points_points__).size.height* CC_CONTENT_SCALE_FACTOR()) +#define AX_RECT_POINTS_TO_PIXELS(__rect_in_points_points__) \ + axis::Rect((__rect_in_points_points__).origin.x* AX_CONTENT_SCALE_FACTOR(), \ + (__rect_in_points_points__).origin.y* AX_CONTENT_SCALE_FACTOR(), \ + (__rect_in_points_points__).size.width* AX_CONTENT_SCALE_FACTOR(), \ + (__rect_in_points_points__).size.height* AX_CONTENT_SCALE_FACTOR()) -/** @def CC_POINT_PIXELS_TO_POINTS +/** @def AX_POINT_PIXELS_TO_POINTS Converts a rect in pixels to points */ -#define CC_POINT_PIXELS_TO_POINTS(__pixels__) \ - axis::Vec2((__pixels__).x / CC_CONTENT_SCALE_FACTOR(), (__pixels__).y / CC_CONTENT_SCALE_FACTOR()) +#define AX_POINT_PIXELS_TO_POINTS(__pixels__) \ + axis::Vec2((__pixels__).x / AX_CONTENT_SCALE_FACTOR(), (__pixels__).y / AX_CONTENT_SCALE_FACTOR()) -/** @def CC_POINT_POINTS_TO_PIXELS +/** @def AX_POINT_POINTS_TO_PIXELS Converts a rect in points to pixels */ -#define CC_POINT_POINTS_TO_PIXELS(__points__) \ - axis::Vec2((__points__).x* CC_CONTENT_SCALE_FACTOR(), (__points__).y* CC_CONTENT_SCALE_FACTOR()) +#define AX_POINT_POINTS_TO_PIXELS(__points__) \ + axis::Vec2((__points__).x* AX_CONTENT_SCALE_FACTOR(), (__points__).y* AX_CONTENT_SCALE_FACTOR()) -/** @def CC_POINT_PIXELS_TO_POINTS +/** @def AX_POINT_PIXELS_TO_POINTS Converts a rect in pixels to points */ -#define CC_SIZE_PIXELS_TO_POINTS(__size_in_pixels__) \ - Vec2((__size_in_pixels__).width / CC_CONTENT_SCALE_FACTOR(), \ - (__size_in_pixels__).height / CC_CONTENT_SCALE_FACTOR()) +#define AX_SIZE_PIXELS_TO_POINTS(__size_in_pixels__) \ + Vec2((__size_in_pixels__).width / AX_CONTENT_SCALE_FACTOR(), \ + (__size_in_pixels__).height / AX_CONTENT_SCALE_FACTOR()) -/** @def CC_POINT_POINTS_TO_PIXELS +/** @def AX_POINT_POINTS_TO_PIXELS Converts a rect in points to pixels */ -#define CC_SIZE_POINTS_TO_PIXELS(__size_in_points__) \ - Vec2((__size_in_points__).width* CC_CONTENT_SCALE_FACTOR(), (__size_in_points__).height* CC_CONTENT_SCALE_FACTOR()) +#define AX_SIZE_POINTS_TO_PIXELS(__size_in_points__) \ + Vec2((__size_in_points__).width* AX_CONTENT_SCALE_FACTOR(), (__size_in_points__).height* AX_CONTENT_SCALE_FACTOR()) #ifndef FLT_EPSILON # define FLT_EPSILON 1.192092896e-07F @@ -188,58 +188,58 @@ It should work same as apples CFSwapInt32LittleToHost(..) */ /// when define returns true it means that our architecture uses big endian -#define CC_HOST_IS_BIG_ENDIAN (bool)(*(unsigned short*)"\0\xff" < 0x100) -#define CC_SWAP32(i) ((i & 0x000000ff) << 24 | (i & 0x0000ff00) << 8 | (i & 0x00ff0000) >> 8 | (i & 0xff000000) >> 24) -#define CC_SWAP16(i) ((i & 0x00ff) << 8 | (i & 0xff00) >> 8) -#define CC_SWAP_INT32_LITTLE_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true) ? CC_SWAP32(i) : (i)) -#define CC_SWAP_INT16_LITTLE_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true) ? CC_SWAP16(i) : (i)) -#define CC_SWAP_INT32_BIG_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true) ? (i) : CC_SWAP32(i)) -#define CC_SWAP_INT16_BIG_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true) ? (i) : CC_SWAP16(i)) +#define AX_HOST_IS_BIG_ENDIAN (bool)(*(unsigned short*)"\0\xff" < 0x100) +#define AX_SWAP32(i) ((i & 0x000000ff) << 24 | (i & 0x0000ff00) << 8 | (i & 0x00ff0000) >> 8 | (i & 0xff000000) >> 24) +#define AX_SWAP16(i) ((i & 0x00ff) << 8 | (i & 0xff00) >> 8) +#define AX_SWAP_INT32_LITTLE_TO_HOST(i) ((AX_HOST_IS_BIG_ENDIAN == true) ? AX_SWAP32(i) : (i)) +#define AX_SWAP_INT16_LITTLE_TO_HOST(i) ((AX_HOST_IS_BIG_ENDIAN == true) ? AX_SWAP16(i) : (i)) +#define AX_SWAP_INT32_BIG_TO_HOST(i) ((AX_HOST_IS_BIG_ENDIAN == true) ? (i) : AX_SWAP32(i)) +#define AX_SWAP_INT16_BIG_TO_HOST(i) ((AX_HOST_IS_BIG_ENDIAN == true) ? (i) : AX_SWAP16(i)) /**********************/ /** Profiling Macros **/ /**********************/ -#if CC_ENABLE_PROFILERS +#if AX_ENABLE_PROFILERS -# define CC_PROFILER_DISPLAY_TIMERS() NS_AX::Profiler::getInstance()->displayTimers() -# define CC_PROFILER_PURGE_ALL() NS_AX::Profiler::getInstance()->releaseAllTimers() +# define AX_PROFILER_DISPLAY_TIMERS() NS_AX::Profiler::getInstance()->displayTimers() +# define AX_PROFILER_PURGE_ALL() NS_AX::Profiler::getInstance()->releaseAllTimers() -# define CC_PROFILER_START(__name__) NS_AX::ProfilingBeginTimingBlock(__name__) -# define CC_PROFILER_STOP(__name__) NS_AX::ProfilingEndTimingBlock(__name__) -# define CC_PROFILER_RESET(__name__) NS_AX::ProfilingResetTimingBlock(__name__) +# define AX_PROFILER_START(__name__) NS_AX::ProfilingBeginTimingBlock(__name__) +# define AX_PROFILER_STOP(__name__) NS_AX::ProfilingEndTimingBlock(__name__) +# define AX_PROFILER_RESET(__name__) NS_AX::ProfilingResetTimingBlock(__name__) -# define CC_PROFILER_START_CATEGORY(__cat__, __name__) \ +# define AX_PROFILER_START_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ NS_AX::ProfilingBeginTimingBlock(__name__); \ } while (0) -# define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) \ +# define AX_PROFILER_STOP_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ NS_AX::ProfilingEndTimingBlock(__name__); \ } while (0) -# define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) \ +# define AX_PROFILER_RESET_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ NS_AX::ProfilingResetTimingBlock(__name__); \ } while (0) -# define CC_PROFILER_START_INSTANCE(__id__, __name__) \ +# define AX_PROFILER_START_INSTANCE(__id__, __name__) \ do \ { \ NS_AX::ProfilingBeginTimingBlock( \ NS_AX::String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ } while (0) -# define CC_PROFILER_STOP_INSTANCE(__id__, __name__) \ +# define AX_PROFILER_STOP_INSTANCE(__id__, __name__) \ do \ { \ NS_AX::ProfilingEndTimingBlock( \ NS_AX::String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ } while (0) -# define CC_PROFILER_RESET_INSTANCE(__id__, __name__) \ +# define AX_PROFILER_RESET_INSTANCE(__id__, __name__) \ do \ { \ NS_AX::ProfilingResetTimingBlock( \ @@ -248,50 +248,50 @@ It should work same as apples CFSwapInt32LittleToHost(..) #else -# define CC_PROFILER_DISPLAY_TIMERS() \ +# define AX_PROFILER_DISPLAY_TIMERS() \ do \ { \ } while (0) -# define CC_PROFILER_PURGE_ALL() \ +# define AX_PROFILER_PURGE_ALL() \ do \ { \ } while (0) -# define CC_PROFILER_START(__name__) \ +# define AX_PROFILER_START(__name__) \ do \ { \ } while (0) -# define CC_PROFILER_STOP(__name__) \ +# define AX_PROFILER_STOP(__name__) \ do \ { \ } while (0) -# define CC_PROFILER_RESET(__name__) \ +# define AX_PROFILER_RESET(__name__) \ do \ { \ } while (0) -# define CC_PROFILER_START_CATEGORY(__cat__, __name__) \ +# define AX_PROFILER_START_CATEGORY(__cat__, __name__) \ do \ { \ } while (0) -# define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) \ +# define AX_PROFILER_STOP_CATEGORY(__cat__, __name__) \ do \ { \ } while (0) -# define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) \ +# define AX_PROFILER_RESET_CATEGORY(__cat__, __name__) \ do \ { \ } while (0) -# define CC_PROFILER_START_INSTANCE(__id__, __name__) \ +# define AX_PROFILER_START_INSTANCE(__id__, __name__) \ do \ { \ } while (0) -# define CC_PROFILER_STOP_INSTANCE(__id__, __name__) \ +# define AX_PROFILER_STOP_INSTANCE(__id__, __name__) \ do \ { \ } while (0) -# define CC_PROFILER_RESET_INSTANCE(__id__, __name__) \ +# define AX_PROFILER_RESET_INSTANCE(__id__, __name__) \ do \ { \ } while (0) @@ -303,9 +303,9 @@ It should work same as apples CFSwapInt32LittleToHost(..) /*********************************/ #if defined(_M_X64) || defined(_WIN64) || defined(__LP64__) || defined(_LP64) || defined(__x86_64) || \ defined(__arm64__) || defined(__aarch64__) -# define CC_64BITS 1 +# define AX_64BITS 1 #else -# define CC_64BITS 0 +# define AX_64BITS 0 #endif /******************************************************************************************/ @@ -314,8 +314,8 @@ It should work same as apples CFSwapInt32LittleToHost(..) /******************************************************************************************/ #ifdef _WIN32 // Assuming windows is always little-endian. -# if !defined(CC_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) -# define CC_LITTLE_ENDIAN 1 +# if !defined(AX_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) +# define AX_LITTLE_ENDIAN 1 # endif # if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(__INTEL_COMPILER) // If MSVC has "/RTCc" set, it will complain about truncating casts at @@ -334,17 +334,17 @@ It should work same as apples CFSwapInt32LittleToHost(..) # endif # if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN)) && \ - !defined(CC_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) -# define CC_LITTLE_ENDIAN 1 + !defined(AX_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) +# define AX_LITTLE_ENDIAN 1 # endif #endif -/** @def CC_INCREMENT_GL_DRAWS_BY_ONE +/** @def AX_INCREMENT_GL_DRAWS_BY_ONE Increments the GL Draws counts by one. The number of calls per frame are displayed on the screen when the Director's stats are enabled. */ -#define CC_INCREMENT_GL_DRAWS(__n__) axis::Director::getInstance()->getRenderer()->addDrawnBatches(__n__) -#define CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(__drawcalls__, __vertices__) \ +#define AX_INCREMENT_GL_DRAWS(__n__) axis::Director::getInstance()->getRenderer()->addDrawnBatches(__n__) +#define AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(__drawcalls__, __vertices__) \ do \ { \ auto __renderer__ = axis::Director::getInstance()->getRenderer(); \ @@ -369,12 +369,12 @@ It should work same as apples CFSwapInt32LittleToHost(..) #define Animate3DDisplayedNotification "CCAnimate3DDisplayedNotification" // new callbacks based on C++11 -#define CC_CALLBACK_0(__selector__, __target__, ...) std::bind(&__selector__, __target__, ##__VA_ARGS__) -#define CC_CALLBACK_1(__selector__, __target__, ...) \ +#define AX_CALLBACK_0(__selector__, __target__, ...) std::bind(&__selector__, __target__, ##__VA_ARGS__) +#define AX_CALLBACK_1(__selector__, __target__, ...) \ std::bind(&__selector__, __target__, std::placeholders::_1, ##__VA_ARGS__) -#define CC_CALLBACK_2(__selector__, __target__, ...) \ +#define AX_CALLBACK_2(__selector__, __target__, ...) \ std::bind(&__selector__, __target__, std::placeholders::_1, std::placeholders::_2, ##__VA_ARGS__) -#define CC_CALLBACK_3(__selector__, __target__, ...) \ +#define AX_CALLBACK_3(__selector__, __target__, ...) \ std::bind(&__selector__, __target__, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, \ ##__VA_ARGS__) diff --git a/core/base/ccRandom.h b/core/base/ccRandom.h index e86987ec16..789fd37a98 100644 --- a/core/base/ccRandom.h +++ b/core/base/ccRandom.h @@ -42,7 +42,7 @@ NS_AX_BEGIN * @class RandomHelper * @brief A helper class for creating random number. */ -class CC_DLL RandomHelper +class AX_DLL RandomHelper { public: template diff --git a/core/base/ccTypes.cpp b/core/base/ccTypes.cpp index c8df7f2ce4..d92e7c568e 100644 --- a/core/base/ccTypes.cpp +++ b/core/base/ccTypes.cpp @@ -32,7 +32,7 @@ Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. NS_AX_BEGIN const std::string STD_STRING_EMPTY(""); -const ssize_t CC_INVALID_INDEX = -1; +const ssize_t AX_INVALID_INDEX = -1; /** * Color3B diff --git a/core/base/ccTypes.h b/core/base/ccTypes.h index 0130a95443..9e01b4a2d0 100644 --- a/core/base/ccTypes.h +++ b/core/base/ccTypes.h @@ -51,7 +51,7 @@ struct HSV; * RGB color composed of bytes 3 bytes. * @since v3.0 */ -struct CC_DLL Color3B +struct AX_DLL Color3B { Color3B(); Color3B(uint8_t _r, uint8_t _g, uint8_t _b); @@ -86,7 +86,7 @@ struct CC_DLL Color3B * RGBA color composed of 4 bytes. * @since v3.0 */ -struct CC_DLL Color4B +struct AX_DLL Color4B { Color4B(); Color4B(uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a); @@ -128,7 +128,7 @@ struct CC_DLL Color4B * RGBA color composed of 4 floats. * @since v3.0 */ -struct CC_DLL Color4F +struct AX_DLL Color4F { Color4F(); Color4F(float _r, float _g, float _b, float _a); @@ -182,7 +182,7 @@ Color4F operator/(Color4F lhs, float rhs); * * Implementation source: https://gist.github.com/fairlight1337/4935ae72bcbcc1ba5c72 */ -struct CC_DLL HSV +struct AX_DLL HSV { HSV(); HSV(float _h, float _s, float _v, float _a = 1.0F); @@ -231,7 +231,7 @@ HSV operator/(HSV lhs, float rhs); * * Implementation source: https://gist.github.com/ciembor/1494530 */ -struct CC_DLL HSL +struct AX_DLL HSL { HSL(); HSL(float _h, float _s, float _l, float _a = 1.0F); @@ -285,7 +285,7 @@ typedef Vec2 Tex2F; /** @struct PointSprite * Vec2 Sprite component. */ -struct CC_DLL PointSprite +struct AX_DLL PointSprite { Vec2 pos; // 8 bytes Color4B color; // 4 bytes @@ -295,7 +295,7 @@ struct CC_DLL PointSprite /** @struct Quad2 * A 2D Quad. 4 * 2 floats. */ -struct CC_DLL Quad2 +struct AX_DLL Quad2 { Vec2 tl; Vec2 tr; @@ -306,7 +306,7 @@ struct CC_DLL Quad2 /** @struct Quad3 * A 3D Quad. 4 * 3 floats. */ -struct CC_DLL Quad3 +struct AX_DLL Quad3 { Vec3 bl; Vec3 br; @@ -343,7 +343,7 @@ struct V2F_C4B_PF /** @struct V2F_C4F_T2F * A Vec2 with a vertex point, a tex coord point and a color 4F. */ -struct CC_DLL V2F_C4F_T2F +struct AX_DLL V2F_C4F_T2F { /// vertices (2F) Vec2 vertices; @@ -356,7 +356,7 @@ struct CC_DLL V2F_C4F_T2F /** @struct V3F_C4B_T2F * A Vec2 with a vertex point, a tex coord point and a color 4B. */ -struct CC_DLL V3F_C4B_T2F +struct AX_DLL V3F_C4B_T2F { /// vertices (3F) Vec3 vertices; // 12 bytes @@ -371,7 +371,7 @@ struct CC_DLL V3F_C4B_T2F /** @struct V3F_T2F * A Vec2 with a vertex point, a tex coord point. */ -struct CC_DLL V3F_T2F +struct AX_DLL V3F_T2F { /// vertices (2F) Vec3 vertices; @@ -382,7 +382,7 @@ struct CC_DLL V3F_T2F /** @struct V3F_C4F * A Vec3 with a vertex point, a color. */ -struct CC_DLL V3F_C4F +struct AX_DLL V3F_C4F { /// vertices (3F) Vec3 vertices; @@ -393,7 +393,7 @@ struct CC_DLL V3F_C4F /** @struct V2F_C4B_T2F_Triangle * A Triangle of V2F_C4B_T2F. */ -struct CC_DLL V2F_C4B_T2F_Triangle +struct AX_DLL V2F_C4B_T2F_Triangle { V2F_C4B_T2F a; V2F_C4B_T2F b; @@ -403,7 +403,7 @@ struct CC_DLL V2F_C4B_T2F_Triangle /** @struct V2F_C4B_T2F_Quad * A Quad of V2F_C4B_T2F. */ -struct CC_DLL V2F_C4B_T2F_Quad +struct AX_DLL V2F_C4B_T2F_Quad { /// bottom left V2F_C4B_T2F bl; @@ -418,7 +418,7 @@ struct CC_DLL V2F_C4B_T2F_Quad /** @struct V3F_C4B_T2F_Quad * 4 Vertex3FTex2FColor4B. */ -struct CC_DLL V3F_C4B_T2F_Quad +struct AX_DLL V3F_C4B_T2F_Quad { /// top left V3F_C4B_T2F tl; @@ -433,7 +433,7 @@ struct CC_DLL V3F_C4B_T2F_Quad /** @struct V2F_C4F_T2F_Quad * 4 Vertex2FTex2FColor4F Quad. */ -struct CC_DLL V2F_C4F_T2F_Quad +struct AX_DLL V2F_C4F_T2F_Quad { /// bottom left V2F_C4F_T2F bl; @@ -448,7 +448,7 @@ struct CC_DLL V2F_C4F_T2F_Quad /** @struct V3F_T2F_Quad * */ -struct CC_DLL V3F_T2F_Quad +struct AX_DLL V3F_T2F_Quad { /// bottom left V3F_T2F bl; @@ -468,7 +468,7 @@ enum class BlendFactor : uint32_t; /** @struct BlendFunc * Blend Function used for textures. */ -struct CC_DLL BlendFunc +struct AX_DLL BlendFunc { /** source blend function */ backend::BlendFactor src; @@ -498,7 +498,7 @@ struct CC_DLL BlendFunc * * @note If any of these enums are edited and/or reordered, update Texture2D.m. */ -enum class CC_DLL TextVAlignment +enum class AX_DLL TextVAlignment { TOP, CENTER, @@ -510,7 +510,7 @@ enum class CC_DLL TextVAlignment * * @note If any of these enums are edited and/or reordered, update Texture2D.m. */ -enum class CC_DLL TextHAlignment +enum class AX_DLL TextHAlignment { LEFT, CENTER, @@ -536,7 +536,7 @@ enum class GlyphCollection /** @struct T2F_Quad * Texture coordinates for a quad. */ -struct CC_DLL T2F_Quad +struct AX_DLL T2F_Quad { /// bottom left Tex2F bl; @@ -551,7 +551,7 @@ struct CC_DLL T2F_Quad /** @struct AnimationFrameData * Struct that holds the size in pixels, texture coordinates and delays for animated ParticleSystemQuad. */ -struct CC_DLL AnimationFrameData +struct AX_DLL AnimationFrameData { T2F_Quad texCoords; Vec2 size; @@ -565,7 +565,7 @@ struct CC_DLL AnimationFrameData /** @struct FontShadow * Shadow attributes. */ -struct CC_DLL FontShadow +struct AX_DLL FontShadow { /// shadow x and y offset Vec2 _shadowOffset; @@ -580,7 +580,7 @@ struct CC_DLL FontShadow /** @struct FontStroke * Stroke attributes. */ -struct CC_DLL FontStroke +struct AX_DLL FontStroke { /// stroke color Color3B _strokeColor = Color3B::BLACK; @@ -595,7 +595,7 @@ struct CC_DLL FontStroke /** @struct FontDefinition * Font attributes. */ -struct CC_DLL FontDefinition +struct AX_DLL FontDefinition { /// font name std::string _fontName; @@ -627,7 +627,7 @@ struct CC_DLL FontDefinition /** @struct Acceleration * The device accelerometer reports values for each axis in units of g-force. */ -class CC_DLL Acceleration : public Ref +class AX_DLL Acceleration : public Ref { public: double x = 0; @@ -637,10 +637,10 @@ public: double timestamp = 0; }; -extern const std::string CC_DLL STD_STRING_EMPTY; -extern const ssize_t CC_DLL CC_INVALID_INDEX; +extern const std::string AX_DLL STD_STRING_EMPTY; +extern const ssize_t AX_DLL AX_INVALID_INDEX; -struct CC_DLL Viewport +struct AX_DLL Viewport { int x = 0; int y = 0; @@ -648,7 +648,7 @@ struct CC_DLL Viewport unsigned int h = 0; }; -struct CC_DLL ScissorRect +struct AX_DLL ScissorRect { float x = 0; float y = 0; diff --git a/core/base/ccUTF8.cpp b/core/base/ccUTF8.cpp index 892f6ec899..793f06b247 100644 --- a/core/base/ccUTF8.cpp +++ b/core/base/ccUTF8.cpp @@ -38,7 +38,7 @@ NS_AX_BEGIN namespace StringUtils { -std::string CC_DLL format(const char* format, ...) +std::string AX_DLL format(const char* format, ...) { va_list args; va_start(args, format); @@ -56,8 +56,8 @@ std::string CC_DLL format(const char* format, ...) */ std::string vformat(const char* format, va_list ap) { -#define CC_VSNPRINTF_BUFFER_LENGTH 512 - std::string buf(CC_VSNPRINTF_BUFFER_LENGTH, '\0'); +#define AX_VSNPRINTF_BUFFER_LENGTH 512 + std::string buf(AX_VSNPRINTF_BUFFER_LENGTH, '\0'); va_list args; va_copy(args, ap); @@ -344,7 +344,7 @@ bool UTF32ToUTF16(std::u32string_view utf32, std::u16string& outUtf16) return utfConvert(utf32, outUtf16, ConvertUTF32toUTF16); } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret) { std::string utf8Str; @@ -478,7 +478,7 @@ void StringUTF8::replace(std::string_view newStr) if (lengthString == 0) { - CCLOG("Bad utf-8 set string: %s", newStr.data()); + AXLOG("Bad utf-8 set string: %s", newStr.data()); return; } diff --git a/core/base/ccUTF8.h b/core/base/ccUTF8.h index acfa9ed16a..527bacc050 100644 --- a/core/base/ccUTF8.h +++ b/core/base/ccUTF8.h @@ -33,7 +33,7 @@ #include #include -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "platform/android/jni/JniHelper.h" #endif @@ -67,8 +67,8 @@ std::string toString(T arg) return ss.str(); } -std::string CC_DLL format(const char* format, ...) CC_FORMAT_PRINTF(1, 2); -std::string CC_DLL vformat(const char* format, va_list ap); +std::string AX_DLL format(const char* format, ...) AX_FORMAT_PRINTF(1, 2); +std::string AX_DLL vformat(const char* format, va_list ap); /** * @brief Converts from UTF8 string to UTF16 string. @@ -90,44 +90,44 @@ std::string CC_DLL vformat(const char* format, va_list ap); * } * @endcode */ -CC_DLL bool UTF8ToUTF16(std::string_view inUtf8, std::u16string& outUtf16); +AX_DLL bool UTF8ToUTF16(std::string_view inUtf8, std::u16string& outUtf16); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF8 to UTF32. * * @see UTF8ToUTF16 */ -CC_DLL bool UTF8ToUTF32(std::string_view inUtf8, std::u32string& outUtf32); +AX_DLL bool UTF8ToUTF32(std::string_view inUtf8, std::u32string& outUtf32); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF16 to UTF8. * * @see UTF8ToUTF16 */ -CC_DLL bool UTF16ToUTF8(std::u16string_view inUtf16, std::string& outUtf8); +AX_DLL bool UTF16ToUTF8(std::u16string_view inUtf16, std::string& outUtf8); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF16 to UTF32. * * @see UTF8ToUTF16 */ -CC_DLL bool UTF16ToUTF32(std::u16string_view inUtf16, std::u32string& outUtf32); +AX_DLL bool UTF16ToUTF32(std::u16string_view inUtf16, std::u32string& outUtf32); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF32 to UTF8. * * @see UTF8ToUTF16 */ -CC_DLL bool UTF32ToUTF8(std::u32string_view inUtf32, std::string& outUtf8); +AX_DLL bool UTF32ToUTF8(std::u32string_view inUtf32, std::string& outUtf8); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF32 to UTF16. * * @see UTF8ToUTF16 */ -CC_DLL bool UTF32ToUTF16(std::u32string_view inUtf32, std::u16string& outUtf16); +AX_DLL bool UTF32ToUTF16(std::u32string_view inUtf32, std::u16string& outUtf16); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) /** * @brief convert jstring to utf8 std::string, same function with env->getStringUTFChars. @@ -137,7 +137,7 @@ CC_DLL bool UTF32ToUTF16(std::u32string_view inUtf32, std::u16string& outUtf16); * @param ret True if the conversion succeeds and the ret pointer isn't null * @returns the result of utf8 string */ -CC_DLL std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret = nullptr); +AX_DLL std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret = nullptr); /** * @brief create a jstring with utf8 std::string, same function with env->newStringUTF @@ -147,18 +147,18 @@ CC_DLL std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret * @param ret True if the conversion succeeds and the ret pointer isn't null * @returns the result of jstring,the jstring need to DeleteLocalRef(jstring); */ -CC_DLL jstring newStringUTFJNI(JNIEnv* env, std::string_view utf8Str, bool* ret = nullptr); +AX_DLL jstring newStringUTFJNI(JNIEnv* env, std::string_view utf8Str, bool* ret = nullptr); #endif /** * @brief Trims the unicode spaces at the end of char16_t vector. */ -CC_DLL void trimUTF16Vector(std::vector& str); +AX_DLL void trimUTF16Vector(std::vector& str); /** * @brief Trims the unicode spaces at the end of char32_t vector. */ -CC_DLL void trimUTF32Vector(std::vector& str); +AX_DLL void trimUTF32Vector(std::vector& str); /** * @brief Whether the character is a whitespace character. @@ -168,7 +168,7 @@ CC_DLL void trimUTF32Vector(std::vector& str); * @see http://en.wikipedia.org/wiki/Whitespace_character#Unicode * */ -CC_DLL bool isUnicodeSpace(char32_t ch); +AX_DLL bool isUnicodeSpace(char32_t ch); /** * @brief Whether the character is a Chinese/Japanese/Korean character. @@ -179,7 +179,7 @@ CC_DLL bool isUnicodeSpace(char32_t ch); * @see http://tieba.baidu.com/p/748765987 * */ -CC_DLL bool isCJKUnicode(char32_t ch); +AX_DLL bool isCJKUnicode(char32_t ch); /** * @brief Whether the character is a non-breaking character. @@ -192,14 +192,14 @@ CC_DLL bool isCJKUnicode(char32_t ch); * @see https://en.wikipedia.org/wiki/Word_joiner * */ -CC_DLL bool isUnicodeNonBreaking(char32_t ch); +AX_DLL bool isUnicodeNonBreaking(char32_t ch); /** * @brief Returns the length of the string in characters. * @param utf8 An UTF-8 encoded string. * @returns The length of the string in characters. */ -CC_DLL int32_t getCharacterCountInUTF8String(std::string_view utf8); +AX_DLL int32_t getCharacterCountInUTF8String(std::string_view utf8); /** * @brief Gets the index of the last character that is not equal to the character given. @@ -207,34 +207,34 @@ CC_DLL int32_t getCharacterCountInUTF8String(std::string_view utf8); * @param c The character to be searched for. * @returns The index of the last character that is not \p c. */ -CC_DLL unsigned int getIndexOfLastNotChar16(const std::vector& str, char16_t c); +AX_DLL unsigned int getIndexOfLastNotChar16(const std::vector& str, char16_t c); /** * @brief Gets char16_t vector from a given utf16 string. */ -CC_DLL std::vector getChar16VectorFromUTF16String(const std::u16string& utf16); +AX_DLL std::vector getChar16VectorFromUTF16String(const std::u16string& utf16); /** * @brief Whether has non-ascii utf-8 characters */ -CC_DLL bool hasNonAsciiUTF8(const char* str, size_t len); +AX_DLL bool hasNonAsciiUTF8(const char* str, size_t len); /** * @brief Whether contains utf-8 or all characters are ascii */ -CC_DLL bool detectNonAsciiUTF8(const char* str, size_t len, bool restrictUTF8, bool* pAllCharsAreAscii); +AX_DLL bool detectNonAsciiUTF8(const char* str, size_t len, bool restrictUTF8, bool* pAllCharsAreAscii); /** * @brief isLegalUTF8String, contains ascii characters */ -CC_DLL bool isLegalUTF8String(const char* str, size_t len); +AX_DLL bool isLegalUTF8String(const char* str, size_t len); /** * Utf8 sequence * Store all utf8 chars as std::string * Build from std::string */ -class CC_DLL StringUTF8 +class AX_DLL StringUTF8 { public: struct CharUTF8 diff --git a/core/base/ccUtils.cpp b/core/base/ccUtils.cpp index 63ec1ebe51..cecc77290b 100644 --- a/core/base/ccUtils.cpp +++ b/core/base/ccUtils.cpp @@ -82,7 +82,7 @@ void captureScreen(std::function)> imageCallback) { if (s_captureScreenListener) { - CCLOG("Warning: CaptureScreen has been called already, don't call more than once in one frame."); + AXLOG("Warning: CaptureScreen has been called already, don't call more than once in one frame."); return; } @@ -91,7 +91,7 @@ void captureScreen(std::function)> imageCallback) auto eventDispatcher = director->getEventDispatcher(); // !!!Metal: needs setFrameBufferOnly before draw -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) s_captureScreenListener = eventDispatcher->addCustomEventListener(Director::EVENT_BEFORE_DRAW, [=](EventCustom* /*event*/) { #else @@ -119,7 +119,7 @@ void captureNode(Node* startNode, std::function)> imageCallba { if (s_captureNodeListener.find(startNode) != s_captureNodeListener.end()) { - CCLOG("Warning: current node has been captured already"); + AXLOG("Warning: current node has been captured already"); return; } @@ -305,11 +305,11 @@ Sprite* createSpriteFromBase64Cached(const char* base64String, const char* key) Image* image = new Image(); bool imageResult = image->initWithImageData(decoded, length, true); - CCASSERT(imageResult, "Failed to create image from base64!"); + AXASSERT(imageResult, "Failed to create image from base64!"); if (!imageResult) { - CC_SAFE_RELEASE_NULL(image); + AX_SAFE_RELEASE_NULL(image); return nullptr; } @@ -329,11 +329,11 @@ Sprite* createSpriteFromBase64(const char* base64String) Image* image = new Image(); bool imageResult = image->initWithImageData(decoded, length, decoded); - CCASSERT(imageResult, "Failed to create image from base64!"); + AXASSERT(imageResult, "Failed to create image from base64!"); if (!imageResult) { - CC_SAFE_RELEASE_NULL(image); + AX_SAFE_RELEASE_NULL(image); return nullptr; } @@ -609,7 +609,7 @@ backend::SamplerFilter toBackendSamplerFilter(int mode) case GLTexParamConst::NEAREST_MIPMAP_NEAREST: return backend::SamplerFilter::NEAREST; default: - CCASSERT(false, "invalid GL sampler filter!"); + AXASSERT(false, "invalid GL sampler filter!"); return backend::SamplerFilter::LINEAR; } } @@ -626,7 +626,7 @@ backend::SamplerAddressMode toBackendAddressMode(int mode) case GLTexParamConst::MIRROR_REPEAT: return backend::SamplerAddressMode::MIRROR_REPEAT; default: - CCASSERT(false, "invalid GL address mode"); + AXASSERT(false, "invalid GL address mode"); return backend::SamplerAddressMode::REPEAT; } } @@ -671,7 +671,7 @@ std::vector parseIntegerList(std::string_view intsString) if (errno == ERANGE) { errno = 0; - CCLOGWARN("%s contains out of range integers", intsString.data()); + AXLOGWARN("%s contains out of range integers", intsString.data()); } result.push_back(static_cast(i)); cStr = endptr; @@ -780,7 +780,7 @@ std::string urlDecode(std::string_view st) return decoded; } -CC_DLL uint32_t fourccValue(std::string_view str) +AX_DLL uint32_t fourccValue(std::string_view str) { if (str.empty() || str[0] != '#') return (uint32_t)-1; diff --git a/core/base/ccUtils.h b/core/base/ccUtils.h index 8a75bffd83..585b4629c8 100644 --- a/core/base/ccUtils.h +++ b/core/base/ccUtils.h @@ -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_UTILS_H__ -#define __CC_UTILS_H__ +#ifndef __AX_UTILS_H__ +#define __AX_UTILS_H__ #include #include @@ -73,7 +73,7 @@ namespace utils * etc.). * @since v4.0 with axis */ -CC_DLL void captureScreen(std::function)> imageCallback); +AX_DLL void captureScreen(std::function)> imageCallback); /** Capture a specific Node. * @param startNode specify the snapshot Node. It should be axis::Scene @@ -81,7 +81,7 @@ CC_DLL void captureScreen(std::function)> imageCallback); * @returns: return a Image, then can call saveToFile to save the image as "xxx.png or xxx.jpg". * @since v4.0 with axis */ -CC_DLL void captureNode(Node* startNode, std::function)> imageCallback, float scale = 1.0f); +AX_DLL void captureNode(Node* startNode, std::function)> imageCallback, float scale = 1.0f); /** Capture the entire screen. V4-copmatiable only, [DEPRECATED] * To ensure the snapshot is applied after everything is updated and rendered in the current frame, @@ -92,7 +92,7 @@ CC_DLL void captureNode(Node* startNode, std::function)> imag * etc.). * @since v4.0 */ -CC_DLL void captureScreen(std::function afterCap, std::string_view filename); +AX_DLL void captureScreen(std::function afterCap, std::string_view filename); /** Find children by name, it will return all child that has the same name. * It supports c++ 11 regular expression. It is a helper function of `Node::enumerateChildren()`. @@ -103,7 +103,7 @@ CC_DLL void captureScreen(std::function afterCap, * @return Array of Nodes that matches the name * @since v3.2 */ -CC_DLL std::vector findChildren(const Node& node, std::string_view name); +AX_DLL std::vector findChildren(const Node& node, std::string_view name); /** Same to ::atof, but strip the string, remain 7 numbers after '.' before call atof. * Why we need this? Because in android c++_static, atof ( and std::atof ) is unsupported for numbers have long decimal @@ -112,53 +112,53 @@ CC_DLL std::vector findChildren(const Node& node, std::string_view name); * @param str The string be to converted to double. * @return Returns converted value of a string. */ -CC_DLL double atof(const char* str); +AX_DLL double atof(const char* str); /** Get current exact time, accurate to nanoseconds. * @return Returns the time in seconds since the Epoch. */ -CC_DLL double gettime(); +AX_DLL double gettime(); /** * Get current time in milliseconds, accurate to nanoseconds * * @return Returns the time in milliseconds since the Epoch. */ -CC_DLL long long getTimeInMilliseconds(); +AX_DLL long long getTimeInMilliseconds(); /** * Calculate unionof bounding box of a node and its children. * @return Returns unionof bounding box of a node and its children. */ -CC_DLL Rect getCascadeBoundingBox(Node* node); +AX_DLL Rect getCascadeBoundingBox(Node* node); /** * Create a sprite instance from base64 encoded image and adds the texture to the Texture Cache. * @return Returns an instance of sprite */ -CC_DLL Sprite* createSpriteFromBase64Cached(const char* base64String, const char* key); +AX_DLL Sprite* createSpriteFromBase64Cached(const char* base64String, const char* key); /** * Create a sprite instance from base64 encoded image. * @return Returns an instance of sprite */ -CC_DLL Sprite* createSpriteFromBase64(const char* base64String); +AX_DLL Sprite* createSpriteFromBase64(const char* base64String); /** * Find a child by name recursively * @return Returns found node or nullptr */ -CC_DLL Node* findChild(Node* levelRoot, std::string_view name); +AX_DLL Node* findChild(Node* levelRoot, std::string_view name); /** * Find a child by tag recursively * @return Returns found node or nullptr */ -CC_DLL Node* findChild(Node* levelRoot, int tag); +AX_DLL Node* findChild(Node* levelRoot, int tag); /** * Find a child by name recursively @@ -187,14 +187,14 @@ inline T findChild(Node* levelRoot, int tag) * @param filename The file to calculate md5 hash. * @return The md5 hash for the file */ -CC_DLL std::string getFileMD5Hash(std::string_view filename); +AX_DLL std::string getFileMD5Hash(std::string_view filename); /** * Gets the md5 hash for the given buffer. * @param data The buffer to calculate md5 hash. * @return The md5 hash for the data */ -CC_DLL std::string getDataMD5Hash(const Data& data); +AX_DLL std::string getDataMD5Hash(const Data& data); /** * Gets the hash for the given buffer with specific algorithm. @@ -202,7 +202,7 @@ CC_DLL std::string getDataMD5Hash(const Data& data); * @param algorithm The hash algorithm, support "md5", "sha1", "sha256", "sha512" and more * @return The hash for the data */ -CC_DLL std::string computeDigest(std::string_view data, std::string_view algorithm); +AX_DLL std::string computeDigest(std::string_view data, std::string_view algorithm); /** @brief Converts language iso 639-1 code to LanguageType enum. @@ -210,23 +210,23 @@ CC_DLL std::string computeDigest(std::string_view data, std::string_view algorit * @js NA * @lua NA */ -CC_DLL LanguageType getLanguageTypeByISO2(const char* code); +AX_DLL LanguageType getLanguageTypeByISO2(const char* code); -CC_DLL backend::BlendFactor toBackendBlendFactor(int factor); +AX_DLL backend::BlendFactor toBackendBlendFactor(int factor); -CC_DLL int toGLBlendFactor(backend::BlendFactor blendFactor); +AX_DLL int toGLBlendFactor(backend::BlendFactor blendFactor); -CC_DLL backend::SamplerFilter toBackendSamplerFilter(int mode); +AX_DLL backend::SamplerFilter toBackendSamplerFilter(int mode); -CC_DLL backend::SamplerAddressMode toBackendAddressMode(int mode); +AX_DLL backend::SamplerAddressMode toBackendAddressMode(int mode); // Adjust matrix for metal. -CC_DLL const Mat4& getAdjustMatrix(); +AX_DLL const Mat4& getAdjustMatrix(); /** Get the Normal Matrix of matrixMV */ -CC_DLL std::vector getNormalMat3OfMat4(const Mat4& mat); +AX_DLL std::vector getNormalMat3OfMat4(const Mat4& mat); /** @brief Parses a list of space-separated integers. @@ -234,7 +234,7 @@ CC_DLL std::vector getNormalMat3OfMat4(const Mat4& mat); * @js NA * @lua NA */ -CC_DLL std::vector parseIntegerList(std::string_view intsString); +AX_DLL std::vector parseIntegerList(std::string_view intsString); /** @brief translate charstring/binarystream to hexstring. @@ -242,7 +242,7 @@ CC_DLL std::vector parseIntegerList(std::string_view intsString); * @js NA * @lua NA */ -CC_DLL std::string bin2hex(std::string_view binary /*charstring also regard as binary in C/C++*/, +AX_DLL std::string bin2hex(std::string_view binary /*charstring also regard as binary in C/C++*/, int delim = -1, bool prefix = false); @@ -252,7 +252,7 @@ CC_DLL std::string bin2hex(std::string_view binary /*charstring also regard as b * @js NA * @lua NA */ -CC_DLL void killCurrentProcess(); +AX_DLL void killCurrentProcess(); /** * Create a Game Object, like CREATE_FUNC, but more powerful @@ -401,13 +401,13 @@ inline char* char2hex(char* p, unsigned char c, unsigned char a = 'a') return p; } -CC_DLL std::string urlEncode(std::string_view s); +AX_DLL std::string urlEncode(std::string_view s); -CC_DLL std::string urlDecode(std::string_view st); +AX_DLL std::string urlDecode(std::string_view st); -CC_DLL uint32_t fourccValue(std::string_view str); +AX_DLL uint32_t fourccValue(std::string_view str); } // namespace utils NS_AX_END -#endif // __SUPPORT_CC_UTILS_H__ +#endif // __SUPPORT_AX_UTILS_H__ diff --git a/core/cocos2d.h b/core/cocos2d.h index 244d8549db..7e5b95c698 100644 --- a/core/cocos2d.h +++ b/core/cocos2d.h @@ -36,7 +36,7 @@ THE SOFTWARE. NS_AX_BEGIN -CC_DLL const char* cocos2dVersion(); +AX_DLL const char* cocos2dVersion(); /** Backward compatibility with old axis projects */ diff --git a/core/math/CCAffineTransform.h b/core/math/CCAffineTransform.h index 99ad200934..03a2c13b99 100644 --- a/core/math/CCAffineTransform.h +++ b/core/math/CCAffineTransform.h @@ -49,7 +49,7 @@ NS_AX_BEGIN 0 1 0 0 0 1 */ -struct CC_DLL AffineTransform +struct AX_DLL AffineTransform { float a, b, c, d; float tx, ty; @@ -60,25 +60,25 @@ struct CC_DLL AffineTransform /**@}*/ /**Make affine transform.*/ -CC_DLL AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty); +AX_DLL AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty); #define AffineTransformMake __CCAffineTransformMake /**Multiply point (x,y,1) by a affine transform.*/ -CC_DLL Vec2 __CCPointApplyAffineTransform(const Vec2& point, const AffineTransform& t); +AX_DLL Vec2 __CCPointApplyAffineTransform(const Vec2& point, const AffineTransform& t); #define PointApplyAffineTransform __CCPointApplyAffineTransform /**Multiply size (width,height,0) by a affine transform.*/ -CC_DLL Vec2 __CCSizeApplyAffineTransform(const Vec2& size, const AffineTransform& t); +AX_DLL Vec2 __CCSizeApplyAffineTransform(const Vec2& size, const AffineTransform& t); #define SizeApplyAffineTransform __CCSizeApplyAffineTransform /**Make identity affine transform.*/ -CC_DLL AffineTransform AffineTransformMakeIdentity(); +AX_DLL AffineTransform AffineTransformMakeIdentity(); /**Transform Rect, which will transform the four vertices of the point.*/ -CC_DLL Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform); +AX_DLL Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform); /**@{ Transform vec2 and Rect by Mat4. */ -CC_DLL Rect RectApplyTransform(const Rect& rect, const Mat4& transform); -CC_DLL Vec2 PointApplyTransform(const Vec2& point, const Mat4& transform); +AX_DLL Rect RectApplyTransform(const Rect& rect, const Mat4& transform); +AX_DLL Vec2 PointApplyTransform(const Vec2& point, const Mat4& transform); /**@}*/ /** Translation, equals @@ -86,31 +86,31 @@ CC_DLL Vec2 PointApplyTransform(const Vec2& point, const Mat4& transform); 0 1 0 * affine transform tx ty 1 */ -CC_DLL AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty); +AX_DLL AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty); /** Rotation, equals cos(angle) sin(angle) 0 -sin(angle) cos(angle) 0 * AffineTransform 0 0 1 */ -CC_DLL AffineTransform AffineTransformRotate(const AffineTransform& aTransform, float anAngle); +AX_DLL AffineTransform AffineTransformRotate(const AffineTransform& aTransform, float anAngle); /** Scale, equals sx 0 0 0 sy 0 * affineTransform 0 0 1 */ -CC_DLL AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy); +AX_DLL AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy); /**Concat two affine transform, t1 * t2*/ -CC_DLL AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2); +AX_DLL AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2); /**Compare affine transform.*/ -CC_DLL bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2); +AX_DLL bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2); /**Get the inverse of affine transform.*/ -CC_DLL AffineTransform AffineTransformInvert(const AffineTransform& t); +AX_DLL AffineTransform AffineTransformInvert(const AffineTransform& t); /**Concat Mat4, return t1 * t2.*/ -CC_DLL Mat4 TransformConcat(const Mat4& t1, const Mat4& t2); +AX_DLL Mat4 TransformConcat(const Mat4& t1, const Mat4& t2); -extern CC_DLL const AffineTransform AffineTransformIdentity; +extern AX_DLL const AffineTransform AffineTransformIdentity; NS_AX_END diff --git a/core/math/CCMath.h b/core/math/CCMath.h index 9970ea55dd..0dea46eaf1 100644 --- a/core/math/CCMath.h +++ b/core/math/CCMath.h @@ -22,8 +22,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_MATH_H__ -#define __CC_MATH_H__ +#ifndef __AX_MATH_H__ +#define __AX_MATH_H__ #include "math/Vec2.h" #include "math/Vec3.h" diff --git a/core/math/CCVertex.cpp b/core/math/CCVertex.cpp index 7973d0baad..d837efa845 100644 --- a/core/math/CCVertex.cpp +++ b/core/math/CCVertex.cpp @@ -62,9 +62,9 @@ void ccVertexLineToPolygon(Vec2* points, float stroke, Vec2* vertices, unsigned // Calculate angle between vectors float angle = acosf(p2p1.dot(p0p1)); - if (angle < CC_DEGREES_TO_RADIANS(70)) + if (angle < AX_DEGREES_TO_RADIANS(70)) perpVector = p2p1.getMidpoint(p0p1).getNormalized().getPerp(); - else if (angle < CC_DEGREES_TO_RADIANS(170)) + else if (angle < AX_DEGREES_TO_RADIANS(170)) perpVector = p2p1.getMidpoint(p0p1).getNormalized(); else perpVector = (p2 - p0).getNormalized().getPerp(); diff --git a/core/math/CCVertex.h b/core/math/CCVertex.h index 56d3f38e96..a85f2776b3 100644 --- a/core/math/CCVertex.h +++ b/core/math/CCVertex.h @@ -39,11 +39,11 @@ NS_AX_BEGIN /** @file CCVertex.h */ /** converts a line to a polygon */ -void CC_DLL +void AX_DLL ccVertexLineToPolygon(Vec2* points, float stroke, Vec2* vertices, unsigned int offset, unsigned int nuPoints); /** returns whether or not the line intersects */ -bool CC_DLL +bool AX_DLL ccVertexLineIntersect(float Ax, float Ay, float Bx, float By, float Cx, float Cy, float Dx, float Dy, float* T); NS_AX_END diff --git a/core/math/Mat4.cpp b/core/math/Mat4.cpp index 32ac43cc49..096794a2bb 100644 --- a/core/math/Mat4.cpp +++ b/core/math/Mat4.cpp @@ -131,7 +131,7 @@ void Mat4::createPerspective(float fieldOfView, float aspectRatio, float zNearPl float theta = MATH_DEG_TO_RAD(fieldOfView) * 0.5f; if (std::abs(std::fmod(theta, MATH_PIOVER2)) < MATH_EPSILON) { - CCLOGERROR("Invalid field of view value (%f) causes attempted calculation tan(%f), which is undefined.", + AXLOGERROR("Invalid field of view value (%f) causes attempted calculation tan(%f), which is undefined.", fieldOfView, theta); return; } @@ -149,7 +149,7 @@ void Mat4::createPerspective(float fieldOfView, float aspectRatio, float zNearPl dst->m[14] = -2.0f * zFarPlane * zNearPlane * f_n; // https://metashapes.com/blog/opengl-metal-projection-matrix-problem/ -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL dst->m[10] = -(zFarPlane)*f_n; dst->m[14] = -(zFarPlane * zNearPlane) * f_n; #endif @@ -186,7 +186,7 @@ void Mat4::createOrthographicOffCenter(float left, dst->m[15] = 1; //// https://metashapes.com/blog/opengl-metal-projection-matrix-problem/ -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL dst->m[10] = 1 / (zNearPlane - zFarPlane); dst->m[14] = zNearPlane / (zNearPlane - zFarPlane); #endif diff --git a/core/math/Mat4.h b/core/math/Mat4.h index 5118e56f14..9f8721395c 100644 --- a/core/math/Mat4.h +++ b/core/math/Mat4.h @@ -72,7 +72,7 @@ NS_AX_MATH_BEGIN * * @see Transform */ -class CC_DLL Mat4 +class AX_DLL Mat4 { public: // //temp add conversion diff --git a/core/math/MathUtil.cpp b/core/math/MathUtil.cpp index 76450f6625..0a38766fae 100644 --- a/core/math/MathUtil.cpp +++ b/core/math/MathUtil.cpp @@ -22,7 +22,7 @@ This file was modified to fit the cocos2d-x project #include "math/MathUtil.h" #include "base/ccMacros.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include #endif @@ -33,7 +33,7 @@ This file was modified to fit the cocos2d-x project //#define USE_SSE : SSE code used //#define INCLUDE_SSE : SSE code included -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # if defined(__arm64__) # define USE_NEON64 # define INCLUDE_NEON64 @@ -42,7 +42,7 @@ This file was modified to fit the cocos2d-x project # define INCLUDE_NEON32 # else # endif -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # if defined(__arm64__) || defined(__aarch64__) # define USE_NEON64 # define INCLUDE_NEON64 @@ -105,7 +105,7 @@ bool MathUtil::isNeon32Enabled() { #ifdef USE_NEON32 return true; -#elif (defined(INCLUDE_NEON32) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)) +#elif (defined(INCLUDE_NEON32) && (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)) class AnrdoidNeonChecker { public: diff --git a/core/math/MathUtil.h b/core/math/MathUtil.h index aba75e31bb..cad9960928 100644 --- a/core/math/MathUtil.h +++ b/core/math/MathUtil.h @@ -41,7 +41,7 @@ NS_AX_MATH_BEGIN * * This is primarily used for optimized internal math operations. */ -class CC_DLL MathUtil +class AX_DLL MathUtil { friend class Mat4; friend class Vec3; diff --git a/core/math/Quaternion.h b/core/math/Quaternion.h index 7258a82172..9c04056b68 100644 --- a/core/math/Quaternion.h +++ b/core/math/Quaternion.h @@ -71,7 +71,7 @@ class Mat4; * q4 = (-0.8, 0.0, -0.6, 0.0). * For the point p = (1.0, 1.0, 1.0), the following figures show the trajectories of p using lerp, slerp, and squad. */ -class CC_DLL Quaternion +class AX_DLL Quaternion { friend class Curve; friend class Transform; diff --git a/core/math/Rect.cpp b/core/math/Rect.cpp index 5d19e82c0e..fe78673ca5 100644 --- a/core/math/Rect.cpp +++ b/core/math/Rect.cpp @@ -63,7 +63,7 @@ Rect& Rect::operator=(const Rect& other) void Rect::setRect(float x, float y, float width, float height) { // CGRect can support width<0 or height<0 - // CCASSERT(width >= 0.0f && height >= 0.0f, "width and height of Rect must not less than 0."); + // AXASSERT(width >= 0.0f && height >= 0.0f, "width and height of Rect must not less than 0."); origin.x = x; origin.y = y; diff --git a/core/math/Rect.h b/core/math/Rect.h index 29818057b7..78f08d9d12 100644 --- a/core/math/Rect.h +++ b/core/math/Rect.h @@ -38,7 +38,7 @@ THE SOFTWARE. NS_AX_BEGIN /**Rectangle area.*/ -class CC_DLL Rect +class AX_DLL Rect { public: /**Low left point of rect.*/ diff --git a/core/math/TransformUtils.h b/core/math/TransformUtils.h index 32b11d38dc..cd5d7ce98c 100644 --- a/core/math/TransformUtils.h +++ b/core/math/TransformUtils.h @@ -43,8 +43,8 @@ struct AffineTransform; @param m The Mat4*4 pointer. @param t Affine transform. */ -CC_DLL void CGAffineToGL(const AffineTransform& t, float* m); -CC_DLL void GLToCGAffine(const float* m, AffineTransform* t); +AX_DLL void CGAffineToGL(const AffineTransform& t, float* m); +AX_DLL void GLToCGAffine(const float* m, AffineTransform* t); /**@}*/ } // namespace cocos2d /** diff --git a/core/math/Vec2.h b/core/math/Vec2.h index fef1349ea4..54c0f0fe6d 100644 --- a/core/math/Vec2.h +++ b/core/math/Vec2.h @@ -55,7 +55,7 @@ class Mat4; /** * Defines a 2-element floating point vector. */ -class CC_DLL Vec2 +class AX_DLL Vec2 { public: union diff --git a/core/math/Vec3.h b/core/math/Vec3.h index 71bb9d413f..6a337ceb16 100644 --- a/core/math/Vec3.h +++ b/core/math/Vec3.h @@ -45,7 +45,7 @@ class Quaternion; * the magnitude of the vector intact. When used as a point, * the elements of the vector represent a position in 3D space. */ -class CC_DLL Vec3 +class AX_DLL Vec3 { public: /** diff --git a/core/math/Vec4.h b/core/math/Vec4.h index b8876f3ca9..5f4d928b7b 100644 --- a/core/math/Vec4.h +++ b/core/math/Vec4.h @@ -41,7 +41,7 @@ class Mat4; /** * Defines 4-element floating point vector. */ -class CC_DLL Vec4 +class AX_DLL Vec4 { public: #ifdef __SSE__ diff --git a/core/navmesh/CCNavMesh.cpp b/core/navmesh/CCNavMesh.cpp index 3c8882c2f2..49f1fd72e7 100644 --- a/core/navmesh/CCNavMesh.cpp +++ b/core/navmesh/CCNavMesh.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "navmesh/CCNavMesh.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "platform/CCFileUtils.h" # include "renderer/CCRenderer.h" @@ -98,7 +98,7 @@ NavMesh* NavMesh::create(std::string_view navFilePath, std::string_view geomFile ref->autorelease(); return ref; } - CC_SAFE_DELETE(ref); + AX_SAFE_DELETE(ref); return nullptr; } @@ -120,20 +120,20 @@ NavMesh::~NavMesh() dtFreeCrowd(_crowed); dtFreeNavMesh(_navMesh); dtFreeNavMeshQuery(_navMeshQuery); - CC_SAFE_DELETE(_allocator); - CC_SAFE_DELETE(_compressor); - CC_SAFE_DELETE(_meshProcess); - CC_SAFE_DELETE(_geomData); + AX_SAFE_DELETE(_allocator); + AX_SAFE_DELETE(_compressor); + AX_SAFE_DELETE(_meshProcess); + AX_SAFE_DELETE(_geomData); for (auto iter : _agentList) { - CC_SAFE_RELEASE(iter); + AX_SAFE_RELEASE(iter); } _agentList.clear(); for (auto iter : _obstacleList) { - CC_SAFE_RELEASE(iter); + AX_SAFE_RELEASE(iter); } _obstacleList.clear(); } @@ -662,4 +662,4 @@ void axis::NavMesh::findPath(const Vec3& start, const Vec3& end, std::vectorautorelease(); return ref; } - CC_SAFE_DELETE(ref); + AX_SAFE_DELETE(ref); return nullptr; } @@ -424,4 +424,4 @@ Vec3 NavMeshAgent::getVelocity() const NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshAgent.h b/core/navmesh/CCNavMeshAgent.h index 3afbc9ba64..32f9d85afc 100644 --- a/core/navmesh/CCNavMeshAgent.h +++ b/core/navmesh/CCNavMeshAgent.h @@ -27,7 +27,7 @@ #define __CCNAV_MESH_AGENT_H__ #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "2d/CCComponent.h" # include "base/CCRef.h" @@ -41,7 +41,7 @@ NS_AX_BEGIN * @addtogroup 3d * @{ */ -struct CC_DLL NavMeshAgentParam +struct AX_DLL NavMeshAgentParam { NavMeshAgentParam(); @@ -69,14 +69,14 @@ struct CC_DLL NavMeshAgentParam unsigned char queryFilterType; }; -struct CC_DLL OffMeshLinkData +struct AX_DLL OffMeshLinkData { Vec3 startPosition; // position in local coordinate system. Vec3 endPosition; // position in local coordinate system. }; /** @brief NavMeshAgent: The code wrapping of dtCrowdAgent, use component mode. */ -class CC_DLL NavMeshAgent : public Component +class AX_DLL NavMeshAgent : public Component { friend class NavMesh; @@ -232,6 +232,6 @@ private: NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH #endif // __CCNAV_MESH_AGENT_H__ diff --git a/core/navmesh/CCNavMeshDebugDraw.cpp b/core/navmesh/CCNavMeshDebugDraw.cpp index f82c5c6a64..e9e59703cc 100644 --- a/core/navmesh/CCNavMeshDebugDraw.cpp +++ b/core/navmesh/CCNavMeshDebugDraw.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "navmesh/CCNavMeshDebugDraw.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include // offsetof # include "base/ccTypes.h" # include "renderer/backend/ProgramState.h" @@ -98,8 +98,8 @@ NavMeshDebugDraw::~NavMeshDebugDraw() { delete iter; } - CC_SAFE_RELEASE_NULL(_programState); - CC_SAFE_RELEASE_NULL(_vertexBuffer); + AX_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_vertexBuffer); } void NavMeshDebugDraw::depthMask(bool state) @@ -162,8 +162,8 @@ void NavMeshDebugDraw::draw(Renderer* renderer) beforeCommand->init(0, Mat4::IDENTITY, Node::FLAGS_RENDER_AS_3D); afterCommand->init(0, Mat4::IDENTITY, Node::FLAGS_RENDER_AS_3D); - beforeCommand->func = CC_CALLBACK_0(NavMeshDebugDraw::onBeforeVisitCmd, this); - afterCommand->func = CC_CALLBACK_0(NavMeshDebugDraw::onAfterVisitCmd, this); + beforeCommand->func = AX_CALLBACK_0(NavMeshDebugDraw::onBeforeVisitCmd, this); + afterCommand->func = AX_CALLBACK_0(NavMeshDebugDraw::onAfterVisitCmd, this); beforeCommand->set3D(true); beforeCommand->setTransparent(true); @@ -201,7 +201,7 @@ void NavMeshDebugDraw::draw(Renderer* renderer) auto& command = _commands[idx]; initCustomCommand(command); - command.setBeforeCallback(CC_CALLBACK_0(NavMeshDebugDraw::onBeforeEachCommand, this, iter->depthMask)); + command.setBeforeCallback(AX_CALLBACK_0(NavMeshDebugDraw::onBeforeEachCommand, this, iter->depthMask)); if (iter->type == backend::PrimitiveType::LINE) { @@ -214,7 +214,7 @@ void NavMeshDebugDraw::draw(Renderer* renderer) renderer->addCommand(&command); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, iter->end - iter->start); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, iter->end - iter->start); idx++; } @@ -264,4 +264,4 @@ void NavMeshDebugDraw::clear() NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshDebugDraw.h b/core/navmesh/CCNavMeshDebugDraw.h index 786603955d..d7de6d727a 100644 --- a/core/navmesh/CCNavMeshDebugDraw.h +++ b/core/navmesh/CCNavMeshDebugDraw.h @@ -26,7 +26,7 @@ #pragma once #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "renderer/CCRenderState.h" # include "renderer/backend/ProgramState.h" @@ -122,4 +122,4 @@ private: NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshObstacle.cpp b/core/navmesh/CCNavMeshObstacle.cpp index a8aeebaf96..819125e28c 100644 --- a/core/navmesh/CCNavMeshObstacle.cpp +++ b/core/navmesh/CCNavMeshObstacle.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "navmesh/CCNavMeshObstacle.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "navmesh/CCNavMesh.h" # include "2d/CCNode.h" @@ -41,7 +41,7 @@ NavMeshObstacle* NavMeshObstacle::create(float radius, float height) ref->autorelease(); return ref; } - CC_SAFE_DELETE(ref); + AX_SAFE_DELETE(ref); return nullptr; } @@ -164,4 +164,4 @@ void NavMeshObstacle::syncToObstacle() NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshObstacle.h b/core/navmesh/CCNavMeshObstacle.h index 3503c5f4e4..bd7cf15b5d 100644 --- a/core/navmesh/CCNavMeshObstacle.h +++ b/core/navmesh/CCNavMeshObstacle.h @@ -27,7 +27,7 @@ #define __CCNAV_MESH_OBSTACLE_H__ #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "2d/CCComponent.h" @@ -44,7 +44,7 @@ NS_AX_BEGIN */ /** @brief NavMeshObstacle: The code wrapping of dtTileCacheObstacle, use component mode. */ -class CC_DLL NavMeshObstacle : public Component +class AX_DLL NavMeshObstacle : public Component { friend class NavMesh; @@ -117,6 +117,6 @@ private: NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH #endif // __CCNAV_MESH_OBSTACLE_H__ diff --git a/core/navmesh/CCNavMeshUtils.cpp b/core/navmesh/CCNavMeshUtils.cpp index 45e3789ec7..e303b41fe3 100644 --- a/core/navmesh/CCNavMeshUtils.cpp +++ b/core/navmesh/CCNavMeshUtils.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "navmesh/CCNavMeshUtils.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "recast/DetourCommon.h" # include "recast/DetourNavMeshBuilder.h" @@ -291,4 +291,4 @@ bool inRange(const float* v1, const float* v2, const float r, const float h) NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshUtils.h b/core/navmesh/CCNavMeshUtils.h index 122671b4ad..00e66f0006 100644 --- a/core/navmesh/CCNavMeshUtils.h +++ b/core/navmesh/CCNavMeshUtils.h @@ -27,7 +27,7 @@ #define __CCNAV_MESH_TOOL_H__ #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "platform/CCPlatformMacros.h" # include "math/CCMath.h" @@ -143,6 +143,6 @@ bool getSteerTarget(dtNavMeshQuery* navQuery, NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH #endif // __CCNAV_MESH_H__ diff --git a/core/network/CCDownloader-curl.cpp b/core/network/CCDownloader-curl.cpp index db6f3a3e75..2e2381aa56 100644 --- a/core/network/CCDownloader-curl.cpp +++ b/core/network/CCDownloader-curl.cpp @@ -50,7 +50,7 @@ // https://curl.se/libcurl/c/curl_easy_getinfo.html // https://curl.se/libcurl/c/curl_easy_setopt.html -#define CC_CURL_POLL_TIMEOUT_MS 50 // wait until DNS query done +#define AX_CURL_POLL_TIMEOUT_MS 50 // wait until DNS query done enum { @@ -700,7 +700,7 @@ private: // do wait action if (maxfd == -1) { - std::this_thread::sleep_for(std::chrono::milliseconds(CC_CURL_POLL_TIMEOUT_MS)); + std::this_thread::sleep_for(std::chrono::milliseconds(AX_CURL_POLL_TIMEOUT_MS)); rc = 0; } else diff --git a/core/network/CCDownloader.h b/core/network/CCDownloader.h index e3a32e1bf5..d59464d2a9 100644 --- a/core/network/CCDownloader.h +++ b/core/network/CCDownloader.h @@ -43,7 +43,7 @@ class IDownloaderImpl; class Downloader; class DownloaderCURL; -class CC_DLL DownloadTask final +class AX_DLL DownloadTask final { public: const static int ERROR_NO_ERROR = 0; @@ -96,7 +96,7 @@ private: std::unique_ptr _coTask; }; -class CC_DLL DownloaderHints +class AX_DLL DownloaderHints { public: uint32_t countOfMaxProcessingTasks; @@ -104,7 +104,7 @@ public: std::string tempFileNameSuffix; }; -class CC_DLL Downloader final +class AX_DLL Downloader final { public: Downloader(); diff --git a/core/network/CCIDownloaderImpl.h b/core/network/CCIDownloaderImpl.h index 9bd5339f78..3ea7927d31 100644 --- a/core/network/CCIDownloaderImpl.h +++ b/core/network/CCIDownloaderImpl.h @@ -32,8 +32,8 @@ #include "base/CCConsole.h" -// #define CC_DOWNLOADER_DEBUG -#if defined(CC_DOWNLOADER_DEBUG) || defined(_DEBUG) +// #define AX_DOWNLOADER_DEBUG +#if defined(AX_DOWNLOADER_DEBUG) || defined(_DEBUG) # define DLLOG(format, ...) axis::log(format, ##__VA_ARGS__) #else # define DLLOG(...) \ @@ -48,7 +48,7 @@ namespace network { class DownloadTask; -class CC_DLL IDownloadTask +class AX_DLL IDownloadTask { public: virtual ~IDownloadTask() {} diff --git a/core/network/HttpClient.cpp b/core/network/HttpClient.cpp index cd6273f814..c8d0f3d6db 100644 --- a/core/network/HttpClient.cpp +++ b/core/network/HttpClient.cpp @@ -75,15 +75,15 @@ void HttpClient::destroyInstance() { if (nullptr == _httpClient) { - CCLOG("HttpClient singleton is nullptr"); + AXLOG("HttpClient singleton is nullptr"); return; } - CCLOG("HttpClient::destroyInstance begin"); + AXLOG("HttpClient::destroyInstance begin"); delete _httpClient; _httpClient = nullptr; - CCLOG("HttpClient::destroyInstance() finished!"); + AXLOG("HttpClient::destroyInstance() finished!"); } void HttpClient::enableCookies(const char* cookieFile) @@ -119,7 +119,7 @@ HttpClient::HttpClient() , _cookie(nullptr) , _clearResponsePredicate(nullptr) { - CCLOG("In the constructor of HttpClient!"); + AXLOG("In the constructor of HttpClient!"); _scheduler = Director::getInstance()->getScheduler(); _service = new yasio::io_service(HttpClient::MAX_CHANNELS); @@ -151,7 +151,7 @@ HttpClient::~HttpClient() delete _cookie; } - CCLOG("HttpClient destructor"); + AXLOG("HttpClient destructor"); } void HttpClient::setDispatchOnWorkThread(bool bVal) @@ -408,7 +408,7 @@ void HttpClient::handleNetworkEOF(HttpResponse* response, yasio::io_channel* cha { if (responseCode == 302) response->getHttpRequest()->setRequestType(HttpRequest::Type::GET); - CCLOG("Process url redirect (%d): %s", responseCode, iter->second.c_str()); + AXLOG("Process url redirect (%d): %s", responseCode, iter->second.c_str()); _availChannelQueue.push_front(channel->index()); processResponse(response, iter->second); response->release(); @@ -442,7 +442,7 @@ void HttpClient::dispatchResponseCallbacks() if (_finishedResponseQueue.unsafe_empty()) return; - auto CC_UNUSED lck = _finishedResponseQueue.get_lock(); + auto AX_UNUSED lck = _finishedResponseQueue.get_lock(); if (!_finishedResponseQueue.unsafe_empty()) { HttpResponse* response = _finishedResponseQueue.front(); @@ -495,13 +495,13 @@ void HttpClient::clearResponseQueue() void HttpClient::clearPendingResponseQueue() { - auto CC_UNUSED lck = _pendingResponseQueue.get_lock(); + auto AX_UNUSED lck = _pendingResponseQueue.get_lock(); __clearQueueUnsafe(_pendingResponseQueue, ClearResponsePredicate{}); } void HttpClient::clearFinishedResponseQueue() { - auto CC_UNUSED lck = _finishedResponseQueue.get_lock(); + auto AX_UNUSED lck = _finishedResponseQueue.get_lock(); __clearQueueUnsafe(_finishedResponseQueue, ClearResponsePredicate{}); } diff --git a/core/network/HttpClient.h b/core/network/HttpClient.h index 8881aac357..dfe4a92e40 100644 --- a/core/network/HttpClient.h +++ b/core/network/HttpClient.h @@ -56,7 +56,7 @@ namespace network * * @lua NA */ -class CC_DLL HttpClient +class AX_DLL HttpClient { public: /** diff --git a/core/network/HttpRequest.h b/core/network/HttpRequest.h index 06095520e4..31935e8d1e 100644 --- a/core/network/HttpRequest.h +++ b/core/network/HttpRequest.h @@ -60,7 +60,7 @@ typedef std::function ccHttpRe * @lua NA */ -class CC_DLL HttpRequest : public Ref +class AX_DLL HttpRequest : public Ref { friend class HttpClient; @@ -97,7 +97,7 @@ public: */ Ref* autorelease() { - CCASSERT(false, + AXASSERT(false, "HttpResponse is used between network thread and ui thread \ therefore, autorelease is forbidden here"); return nullptr; diff --git a/core/network/HttpResponse.h b/core/network/HttpResponse.h index 3e2858c7ff..1013a0cf94 100644 --- a/core/network/HttpResponse.h +++ b/core/network/HttpResponse.h @@ -51,7 +51,7 @@ class HttpClient; * @since v2.0.2. * @lua NA */ -class CC_DLL HttpResponse : public axis::Ref +class AX_DLL HttpResponse : public axis::Ref { friend class HttpClient; @@ -84,12 +84,12 @@ public: /** * Override autorelease method to prevent developers from calling it. - * If this method is called , it would trigger CCASSERT. + * If this method is called , it would trigger AXASSERT. * @return axis::Ref* always return nullptr. */ axis::Ref* autorelease() { - CCASSERT(false, + AXASSERT(false, "HttpResponse is used between network thread and ui thread \ therefore, autorelease is forbidden here"); return nullptr; diff --git a/core/network/Uri.cpp b/core/network/Uri.cpp index 4513751ac2..bc8661a5e4 100644 --- a/core/network/Uri.cpp +++ b/core/network/Uri.cpp @@ -19,7 +19,7 @@ */ #include "network/Uri.h" -#include "base/CCConsole.h" // For CCLOGERROR macro +#include "base/CCConsole.h" // For AXLOGERROR macro #include #include @@ -169,7 +169,7 @@ bool Uri::doParse(std::string_view str) if (str.empty()) { - CCLOGERROR("%s", "Empty URI is invalid!"); + AXLOGERROR("%s", "Empty URI is invalid!"); return false; } @@ -185,7 +185,7 @@ bool Uri::doParse(std::string_view str) std::smatch match; if (UNLIKELY(!std::regex_match(copied.cbegin(), copied.cend(), match, uriRegex))) { - CCLOGERROR("Invalid URI: %s", str.data()); + AXLOGERROR("Invalid URI: %s", str.data()); return false; } @@ -211,7 +211,7 @@ bool Uri::doParse(std::string_view str) if (!std::regex_match(authority.first, authority.second, authorityMatch, authorityRegex)) { std::string invalidAuthority(authority.first, authority.second); - CCLOGERROR("Invalid URI authority: %s", invalidAuthority.c_str()); + AXLOGERROR("Invalid URI authority: %s", invalidAuthority.c_str()); return false; } diff --git a/core/network/Uri.h b/core/network/Uri.h index 15d60d83d0..7933aa7ce7 100644 --- a/core/network/Uri.h +++ b/core/network/Uri.h @@ -52,7 +52,7 @@ namespace network * UriEscapeMode::QUERY) (for the query, but probably only after splitting at * '&' to identify the individual parameters). */ -class CC_DLL Uri +class AX_DLL Uri { public: /** diff --git a/core/physics/CCPhysicsBody.cpp b/core/physics/CCPhysicsBody.cpp index 817399b9c5..0a5de00c8c 100644 --- a/core/physics/CCPhysicsBody.cpp +++ b/core/physics/CCPhysicsBody.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "physics/CCPhysicsBody.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include # include @@ -137,7 +137,7 @@ PhysicsBody* PhysicsBody::create() return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -155,7 +155,7 @@ PhysicsBody* PhysicsBody::create(float mass) } } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -175,7 +175,7 @@ PhysicsBody* PhysicsBody::create(float mass, float moment) } } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -189,7 +189,7 @@ PhysicsBody* PhysicsBody::createCircle(float radius, const PhysicsMaterial& mate return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -203,7 +203,7 @@ PhysicsBody* PhysicsBody::createBox(const Vec2& size, const PhysicsMaterial& mat return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -220,7 +220,7 @@ PhysicsBody* PhysicsBody::createPolygon(const Vec2* points, return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -238,7 +238,7 @@ PhysicsBody* PhysicsBody::createEdgeSegment(const Vec2& a, return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -256,7 +256,7 @@ PhysicsBody* PhysicsBody::createEdgeBox(const Vec2& size, return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -275,7 +275,7 @@ PhysicsBody* PhysicsBody::createEdgePolygon(const Vec2* points, return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -294,7 +294,7 @@ PhysicsBody* PhysicsBody::createEdgeChain(const Vec2* points, return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -308,7 +308,7 @@ bool PhysicsBody::init() cpBodySetUserData(_cpBody, this); cpBodySetVelocityUpdateFunc(_cpBody, internalBodyUpdateVelocity); - CC_BREAK_IF(_cpBody == nullptr); + AX_BREAK_IF(_cpBody == nullptr); return true; } while (false); @@ -601,7 +601,7 @@ void PhysicsBody::setVelocity(const Vec2& velocity) { if (cpBodyGetType(_cpBody) == CP_BODY_TYPE_STATIC) { - CCLOG("physics warning: you can't set velocity for a static body."); + AXLOG("physics warning: you can't set velocity for a static body."); return; } @@ -627,7 +627,7 @@ void PhysicsBody::setAngularVelocity(float velocity) { if (cpBodyGetType(_cpBody) == CP_BODY_TYPE_STATIC) { - CCLOG("physics warning: you can't set angular velocity for a static body."); + AXLOG("physics warning: you can't set angular velocity for a static body."); return; } @@ -982,7 +982,7 @@ void PhysicsBody::onAdd() void PhysicsBody::onRemove() { - CCASSERT(_owner != nullptr, "_owner can't be nullptr"); + AXASSERT(_owner != nullptr, "_owner can't be nullptr"); removeFromPhysicsWorld(); @@ -1011,4 +1011,4 @@ void PhysicsBody::removeFromPhysicsWorld() NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS diff --git a/core/physics/CCPhysicsBody.h b/core/physics/CCPhysicsBody.h index 389b5ffaad..ad69381e54 100644 --- a/core/physics/CCPhysicsBody.h +++ b/core/physics/CCPhysicsBody.h @@ -28,7 +28,7 @@ #define __CCPHYSICS_BODY_H__ #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "2d/CCComponent.h" # include "math/CCMath.h" @@ -62,7 +62,7 @@ const PhysicsMaterial PHYSICSBODY_MATERIAL_DEFAULT(0.1f, 0.5f, 0.5f); * static body. You can change mass and moment with setMass() and setMoment(). And you can change the body to be dynamic * or static by use function setDynamic(). */ -class CC_DLL PhysicsBody : public Component +class AX_DLL PhysicsBody : public Component { public: const static std::string COMPONENT_NAME; @@ -618,5 +618,5 @@ protected: NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif // __CCPHYSICS_BODY_H__ diff --git a/core/physics/CCPhysicsContact.cpp b/core/physics/CCPhysicsContact.cpp index cdb9759fad..a83a1c2caf 100644 --- a/core/physics/CCPhysicsContact.cpp +++ b/core/physics/CCPhysicsContact.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "physics/CCPhysicsContact.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "chipmunk/chipmunk.h" # include "physics/CCPhysicsBody.h" @@ -50,8 +50,8 @@ PhysicsContact::PhysicsContact() PhysicsContact::~PhysicsContact() { - CC_SAFE_DELETE(_contactData); - CC_SAFE_DELETE(_preContactData); + AX_SAFE_DELETE(_contactData); + AX_SAFE_DELETE(_preContactData); } PhysicsContact* PhysicsContact::construct(PhysicsShape* a, PhysicsShape* b) @@ -62,7 +62,7 @@ PhysicsContact* PhysicsContact::construct(PhysicsShape* a, PhysicsShape* b) return contact; } - CC_SAFE_DELETE(contact); + AX_SAFE_DELETE(contact); return nullptr; } @@ -70,7 +70,7 @@ bool PhysicsContact::init(PhysicsShape* a, PhysicsShape* b) { do { - CC_BREAK_IF(a == nullptr || b == nullptr); + AX_BREAK_IF(a == nullptr || b == nullptr); _shapeA = a; _shapeB = b; @@ -89,7 +89,7 @@ void PhysicsContact::generateContactData() } cpArbiter* arb = static_cast(_contactInfo); - CC_SAFE_DELETE(_preContactData); + AX_SAFE_DELETE(_preContactData); _preContactData = _contactData; _contactData = new PhysicsContactData(); _contactData->count = cpArbiterGetCount(arb); @@ -245,7 +245,7 @@ EventListenerPhysicsContact* EventListenerPhysicsContact::create() return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -259,7 +259,7 @@ bool EventListenerPhysicsContact::checkAvailable() if (onContactBegin == nullptr && onContactPreSolve == nullptr && onContactPostSolve == nullptr && onContactSeparate == nullptr) { - CCASSERT(false, "Invalid PhysicsContactListener."); + AXASSERT(false, "Invalid PhysicsContactListener."); return false; } @@ -280,7 +280,7 @@ EventListenerPhysicsContact* EventListenerPhysicsContact::clone() return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -297,7 +297,7 @@ EventListenerPhysicsContactWithBodies* EventListenerPhysicsContactWithBodies::cr return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -329,7 +329,7 @@ EventListenerPhysicsContactWithBodies* EventListenerPhysicsContactWithBodies::cl return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -350,7 +350,7 @@ EventListenerPhysicsContactWithShapes* EventListenerPhysicsContactWithShapes::cr return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -378,7 +378,7 @@ EventListenerPhysicsContactWithShapes* EventListenerPhysicsContactWithShapes::cl return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -397,7 +397,7 @@ EventListenerPhysicsContactWithGroup* EventListenerPhysicsContactWithGroup::crea return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -425,9 +425,9 @@ EventListenerPhysicsContactWithGroup* EventListenerPhysicsContactWithGroup::clon return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS diff --git a/core/physics/CCPhysicsContact.h b/core/physics/CCPhysicsContact.h index 7e4200e5d0..693a01a740 100644 --- a/core/physics/CCPhysicsContact.h +++ b/core/physics/CCPhysicsContact.h @@ -27,7 +27,7 @@ #define __CCPHYSICS_CONTACT_H__ #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "base/CCRef.h" # include "math/CCMath.h" @@ -41,7 +41,7 @@ class PhysicsShape; class PhysicsBody; class PhysicsWorld; -typedef struct CC_DLL PhysicsContactData +typedef struct AX_DLL PhysicsContactData { static const int POINT_MAX = 4; Vec2 points[POINT_MAX]; @@ -64,7 +64,7 @@ typedef struct CC_DLL PhysicsContactData * It will created automatically when two shape contact with each other. And it will destroyed automatically when two shape separated. */ -class CC_DLL PhysicsContact : public EventCustom +class AX_DLL PhysicsContact : public EventCustom { public: enum class EventCode @@ -151,7 +151,7 @@ private: /** * @brief Presolve value generated when onContactPreSolve called. */ -class CC_DLL PhysicsContactPreSolve +class AX_DLL PhysicsContactPreSolve { public: /** Get restitution between two bodies.*/ @@ -182,7 +182,7 @@ private: /** * @brief Postsolve value generated when onContactPostSolve called. */ -class CC_DLL PhysicsContactPostSolve +class AX_DLL PhysicsContactPostSolve { public: /** Get restitution between two bodies.*/ @@ -203,7 +203,7 @@ private: }; /** Contact listener. It will receive all the contact callbacks. */ -class CC_DLL EventListenerPhysicsContact : public EventListenerCustom +class AX_DLL EventListenerPhysicsContact : public EventListenerCustom { public: /** Create the listener. */ @@ -260,7 +260,7 @@ protected: }; /** This event listener only be called when bodyA and bodyB have contacts. */ -class CC_DLL EventListenerPhysicsContactWithBodies : public EventListenerPhysicsContact +class AX_DLL EventListenerPhysicsContactWithBodies : public EventListenerPhysicsContact { public: /** Create the listener. */ @@ -280,7 +280,7 @@ protected: }; /** This event listener only be called when shapeA and shapeB have contacts. */ -class CC_DLL EventListenerPhysicsContactWithShapes : public EventListenerPhysicsContact +class AX_DLL EventListenerPhysicsContactWithShapes : public EventListenerPhysicsContact { public: /** Create the listener. */ @@ -299,7 +299,7 @@ protected: }; /** This event listener only be called when shapeA or shapeB is in the group your specified */ -class CC_DLL EventListenerPhysicsContactWithGroup : public EventListenerPhysicsContact +class AX_DLL EventListenerPhysicsContactWithGroup : public EventListenerPhysicsContact { public: /** Create the listener. */ @@ -321,5 +321,5 @@ protected: NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif //__CCPHYSICS_CONTACT_H__ diff --git a/core/physics/CCPhysicsHelper.h b/core/physics/CCPhysicsHelper.h index 6dab709a11..557c432c9f 100644 --- a/core/physics/CCPhysicsHelper.h +++ b/core/physics/CCPhysicsHelper.h @@ -28,7 +28,7 @@ #define __CCPHYSICS_HELPER_H__ #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "chipmunk/chipmunk.h" # include "platform/CCPlatformMacros.h" @@ -112,5 +112,5 @@ public: NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif // __CCPHYSICS_HELPER_H__ diff --git a/core/physics/CCPhysicsJoint.cpp b/core/physics/CCPhysicsJoint.cpp index 8bf9dadd47..1027880ff1 100644 --- a/core/physics/CCPhysicsJoint.cpp +++ b/core/physics/CCPhysicsJoint.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "physics/CCPhysicsJoint.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "chipmunk/chipmunk.h" # include "physics/CCPhysicsBody.h" @@ -49,7 +49,7 @@ public: T get() const { - CCASSERT(_isSet, "data should be set!"); + AXASSERT(_isSet, "data should be set!"); return _data; } void set(T d) @@ -92,7 +92,7 @@ public: # define UNLIKELY(x) (x) # endif -# define CC_PJOINT_CACHE_READ(field) \ +# define AX_PJOINT_CACHE_READ(field) \ do \ { \ if (UNLIKELY(_initDirty)) \ @@ -101,7 +101,7 @@ public: } \ } while (0) -# define CC_PJOINT_CACHE_WRITE2(field, method, arg, convertedArg) \ +# define AX_PJOINT_CACHE_WRITE2(field, method, arg, convertedArg) \ do \ { \ if (UNLIKELY(_initDirty)) \ @@ -115,7 +115,7 @@ public: } \ } while (0) -# define CC_PJOINT_CACHE_WRITE(field, method, arg) CC_PJOINT_CACHE_WRITE2(field, method, arg, arg) +# define AX_PJOINT_CACHE_WRITE(field, method, arg) AX_PJOINT_CACHE_WRITE2(field, method, arg, arg) PhysicsJoint::PhysicsJoint() : _bodyA(nullptr) @@ -149,8 +149,8 @@ bool PhysicsJoint::init(axis::PhysicsBody* a, axis::PhysicsBody* b) { do { - CCASSERT(a != nullptr && b != nullptr, "the body passed in is nil"); - CCASSERT(a != b, "the two bodies are equal"); + AXASSERT(a != nullptr && b != nullptr, "the body passed in is nil"); + AXASSERT(a != b, "the two bodies are equal"); _bodyA = a; _bodyB = b; @@ -169,7 +169,7 @@ bool PhysicsJoint::initJoint() while (_initDirty) { ret = createConstraints(); - CC_BREAK_IF(!ret); + AX_BREAK_IF(!ret); for (auto subjoint : _cpConstraints) { @@ -261,7 +261,7 @@ PhysicsJointFixed* PhysicsJointFixed::construct(PhysicsBody* a, PhysicsBody* b, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -274,12 +274,12 @@ bool PhysicsJointFixed::createConstraints() // add a pivot joint to fixed two body together auto joint = cpPivotJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), PhysicsHelper::vec22cpv(_anchr)); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); // add a gear joint to make two body have the same rotation. joint = cpGearJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), 0, 1); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); _collisionEnable = false; @@ -301,7 +301,7 @@ PhysicsJointPin* PhysicsJointPin::construct(PhysicsBody* a, PhysicsBody* b, cons return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -318,7 +318,7 @@ PhysicsJointPin* PhysicsJointPin::construct(PhysicsBody* a, PhysicsBody* b, cons return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -337,7 +337,7 @@ bool PhysicsJointPin::createConstraints() joint = cpPivotJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), PhysicsHelper::vec22cpv(_anchr1)); } - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -365,7 +365,7 @@ PhysicsJointLimit* PhysicsJointLimit::construct(PhysicsBody* a, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -381,7 +381,7 @@ bool PhysicsJointLimit::createConstraints() auto joint = cpSlideJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), PhysicsHelper::vec22cpv(_anchr1), PhysicsHelper::vec22cpv(_anchr2), _min, _max); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -392,46 +392,46 @@ bool PhysicsJointLimit::createConstraints() float PhysicsJointLimit::getMin() const { - CC_PJOINT_CACHE_READ(_min); + AX_PJOINT_CACHE_READ(_min); return PhysicsHelper::cpfloat2float(cpSlideJointGetMin(_cpConstraints.front())); } void PhysicsJointLimit::setMin(float min) { - CC_PJOINT_CACHE_WRITE(_min, cpSlideJointSetMin, min); + AX_PJOINT_CACHE_WRITE(_min, cpSlideJointSetMin, min); } float PhysicsJointLimit::getMax() const { - CC_PJOINT_CACHE_READ(_max); + AX_PJOINT_CACHE_READ(_max); return PhysicsHelper::cpfloat2float(cpSlideJointGetMax(_cpConstraints.front())); } void PhysicsJointLimit::setMax(float max) { - CC_PJOINT_CACHE_WRITE(_max, cpSlideJointSetMax, max); + AX_PJOINT_CACHE_WRITE(_max, cpSlideJointSetMax, max); } Vec2 PhysicsJointLimit::getAnchr1() const { - CC_PJOINT_CACHE_READ(_anchr1); + AX_PJOINT_CACHE_READ(_anchr1); return PhysicsHelper::cpv2vec2(cpSlideJointGetAnchorA(_cpConstraints.front())); } void PhysicsJointLimit::setAnchr1(const Vec2& anchr) { - CC_PJOINT_CACHE_WRITE2(_anchr1, cpSlideJointSetAnchorA, anchr, PhysicsHelper::vec22cpv(anchr)); + AX_PJOINT_CACHE_WRITE2(_anchr1, cpSlideJointSetAnchorA, anchr, PhysicsHelper::vec22cpv(anchr)); } Vec2 PhysicsJointLimit::getAnchr2() const { - CC_PJOINT_CACHE_READ(_anchr2); + AX_PJOINT_CACHE_READ(_anchr2); return PhysicsHelper::cpv2vec2(cpSlideJointGetAnchorB(_cpConstraints.front())); } void PhysicsJointLimit::setAnchr2(const Vec2& anchr) { - CC_PJOINT_CACHE_WRITE2(_anchr2, cpSlideJointSetAnchorB, anchr, PhysicsHelper::vec22cpv(anchr)); + AX_PJOINT_CACHE_WRITE2(_anchr2, cpSlideJointSetAnchorB, anchr, PhysicsHelper::vec22cpv(anchr)); } PhysicsJointDistance* PhysicsJointDistance::construct(PhysicsBody* a, @@ -449,7 +449,7 @@ PhysicsJointDistance* PhysicsJointDistance::construct(PhysicsBody* a, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -459,7 +459,7 @@ bool PhysicsJointDistance::createConstraints() { auto joint = cpPinJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), PhysicsHelper::vec22cpv(_anchr1), PhysicsHelper::vec22cpv(_anchr2)); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -470,13 +470,13 @@ bool PhysicsJointDistance::createConstraints() float PhysicsJointDistance::getDistance() const { - CC_PJOINT_CACHE_READ(_distance); + AX_PJOINT_CACHE_READ(_distance); return PhysicsHelper::cpfloat2float(cpPinJointGetDist(_cpConstraints.front())); } void PhysicsJointDistance::setDistance(float distance) { - CC_PJOINT_CACHE_WRITE(_distance, cpPinJointSetDist, distance); + AX_PJOINT_CACHE_WRITE(_distance, cpPinJointSetDist, distance); } PhysicsJointSpring* PhysicsJointSpring::construct(PhysicsBody* a, @@ -498,7 +498,7 @@ PhysicsJointSpring* PhysicsJointSpring::construct(PhysicsBody* a, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -511,7 +511,7 @@ bool PhysicsJointSpring::createConstraints() _bodyB->local2World(_anchr1).getDistance(_bodyA->local2World(_anchr2)), _stiffness, _damping); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -522,57 +522,57 @@ bool PhysicsJointSpring::createConstraints() Vec2 PhysicsJointSpring::getAnchr1() const { - CC_PJOINT_CACHE_READ(_anchr1); + AX_PJOINT_CACHE_READ(_anchr1); return PhysicsHelper::cpv2vec2(cpDampedSpringGetAnchorA(_cpConstraints.front())); } void PhysicsJointSpring::setAnchr1(const Vec2& anchr) { - CC_PJOINT_CACHE_WRITE2(_anchr1, cpDampedSpringSetAnchorA, anchr, PhysicsHelper::vec22cpv(anchr)); + AX_PJOINT_CACHE_WRITE2(_anchr1, cpDampedSpringSetAnchorA, anchr, PhysicsHelper::vec22cpv(anchr)); } Vec2 PhysicsJointSpring::getAnchr2() const { - CC_PJOINT_CACHE_READ(_anchr2); + AX_PJOINT_CACHE_READ(_anchr2); return PhysicsHelper::cpv2vec2(cpDampedSpringGetAnchorB(_cpConstraints.front())); } void PhysicsJointSpring::setAnchr2(const Vec2& anchr) { - CC_PJOINT_CACHE_WRITE2(_anchr2, cpDampedSpringSetAnchorB, anchr, PhysicsHelper::vec22cpv(anchr)); + AX_PJOINT_CACHE_WRITE2(_anchr2, cpDampedSpringSetAnchorB, anchr, PhysicsHelper::vec22cpv(anchr)); } float PhysicsJointSpring::getRestLength() const { - CC_PJOINT_CACHE_READ(_restLength); + AX_PJOINT_CACHE_READ(_restLength); return PhysicsHelper::cpfloat2float(cpDampedSpringGetRestLength(_cpConstraints.front())); } void PhysicsJointSpring::setRestLength(float restLength) { - CC_PJOINT_CACHE_WRITE(_restLength, cpDampedSpringSetRestLength, restLength); + AX_PJOINT_CACHE_WRITE(_restLength, cpDampedSpringSetRestLength, restLength); } float PhysicsJointSpring::getStiffness() const { - CC_PJOINT_CACHE_READ(_stiffness); + AX_PJOINT_CACHE_READ(_stiffness); return PhysicsHelper::cpfloat2float(cpDampedSpringGetStiffness(_cpConstraints.front())); } void PhysicsJointSpring::setStiffness(float stiffness) { - CC_PJOINT_CACHE_WRITE(_stiffness, cpDampedSpringSetStiffness, stiffness); + AX_PJOINT_CACHE_WRITE(_stiffness, cpDampedSpringSetStiffness, stiffness); } float PhysicsJointSpring::getDamping() const { - CC_PJOINT_CACHE_READ(_damping); + AX_PJOINT_CACHE_READ(_damping); return PhysicsHelper::cpfloat2float(cpDampedSpringGetDamping(_cpConstraints.front())); } void PhysicsJointSpring::setDamping(float damping) { - CC_PJOINT_CACHE_WRITE(_damping, cpDampedSpringSetDamping, damping); + AX_PJOINT_CACHE_WRITE(_damping, cpDampedSpringSetDamping, damping); } PhysicsJointGroove* PhysicsJointGroove::construct(PhysicsBody* a, @@ -592,7 +592,7 @@ PhysicsJointGroove* PhysicsJointGroove::construct(PhysicsBody* a, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -603,7 +603,7 @@ bool PhysicsJointGroove::createConstraints() auto joint = cpGrooveJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), PhysicsHelper::vec22cpv(_grooveA), PhysicsHelper::vec22cpv(_grooveB), PhysicsHelper::vec22cpv(_anchr2)); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -614,35 +614,35 @@ bool PhysicsJointGroove::createConstraints() Vec2 PhysicsJointGroove::getGrooveA() const { - CC_PJOINT_CACHE_READ(_grooveA); + AX_PJOINT_CACHE_READ(_grooveA); return PhysicsHelper::cpv2vec2(cpGrooveJointGetGrooveA(_cpConstraints.front())); } void PhysicsJointGroove::setGrooveA(const Vec2& grooveA) { - CC_PJOINT_CACHE_WRITE2(_grooveA, cpGrooveJointSetGrooveA, grooveA, PhysicsHelper::vec22cpv(grooveA)); + AX_PJOINT_CACHE_WRITE2(_grooveA, cpGrooveJointSetGrooveA, grooveA, PhysicsHelper::vec22cpv(grooveA)); } Vec2 PhysicsJointGroove::getGrooveB() const { - CC_PJOINT_CACHE_READ(_grooveB); + AX_PJOINT_CACHE_READ(_grooveB); return PhysicsHelper::cpv2vec2(cpGrooveJointGetGrooveB(_cpConstraints.front())); } void PhysicsJointGroove::setGrooveB(const Vec2& grooveB) { - CC_PJOINT_CACHE_WRITE2(_grooveB, cpGrooveJointSetGrooveB, grooveB, PhysicsHelper::vec22cpv(grooveB)); + AX_PJOINT_CACHE_WRITE2(_grooveB, cpGrooveJointSetGrooveB, grooveB, PhysicsHelper::vec22cpv(grooveB)); } Vec2 PhysicsJointGroove::getAnchr2() const { - CC_PJOINT_CACHE_READ(_anchr2); + AX_PJOINT_CACHE_READ(_anchr2); return PhysicsHelper::cpv2vec2(cpGrooveJointGetAnchorB(_cpConstraints.front())); } void PhysicsJointGroove::setAnchr2(const Vec2& anchr2) { - CC_PJOINT_CACHE_WRITE2(_anchr2, cpGrooveJointSetAnchorB, anchr2, PhysicsHelper::vec22cpv(anchr2)); + AX_PJOINT_CACHE_WRITE2(_anchr2, cpGrooveJointSetAnchorB, anchr2, PhysicsHelper::vec22cpv(anchr2)); } PhysicsJointRotarySpring* PhysicsJointRotarySpring::construct(PhysicsBody* a, @@ -660,7 +660,7 @@ PhysicsJointRotarySpring* PhysicsJointRotarySpring::construct(PhysicsBody* a, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -671,7 +671,7 @@ bool PhysicsJointRotarySpring::createConstraints() auto joint = cpDampedRotarySpringNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _bodyB->getRotation() - _bodyA->getRotation(), _stiffness, _damping); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -682,35 +682,35 @@ bool PhysicsJointRotarySpring::createConstraints() float PhysicsJointRotarySpring::getRestAngle() const { - CC_PJOINT_CACHE_READ(_restAngle); + AX_PJOINT_CACHE_READ(_restAngle); return PhysicsHelper::cpfloat2float(cpDampedRotarySpringGetRestAngle(_cpConstraints.front())); } void PhysicsJointRotarySpring::setRestAngle(float restAngle) { - CC_PJOINT_CACHE_WRITE(_restAngle, cpDampedRotarySpringSetRestAngle, restAngle); + AX_PJOINT_CACHE_WRITE(_restAngle, cpDampedRotarySpringSetRestAngle, restAngle); } float PhysicsJointRotarySpring::getStiffness() const { - CC_PJOINT_CACHE_READ(_stiffness); + AX_PJOINT_CACHE_READ(_stiffness); return PhysicsHelper::cpfloat2float(cpDampedRotarySpringGetStiffness(_cpConstraints.front())); } void PhysicsJointRotarySpring::setStiffness(float stiffness) { - CC_PJOINT_CACHE_WRITE(_stiffness, cpDampedRotarySpringSetStiffness, stiffness); + AX_PJOINT_CACHE_WRITE(_stiffness, cpDampedRotarySpringSetStiffness, stiffness); } float PhysicsJointRotarySpring::getDamping() const { - CC_PJOINT_CACHE_READ(_damping); + AX_PJOINT_CACHE_READ(_damping); return PhysicsHelper::cpfloat2float(cpDampedRotarySpringGetDamping(_cpConstraints.front())); } void PhysicsJointRotarySpring::setDamping(float damping) { - CC_PJOINT_CACHE_WRITE(_damping, cpDampedRotarySpringSetDamping, damping); + AX_PJOINT_CACHE_WRITE(_damping, cpDampedRotarySpringSetDamping, damping); } PhysicsJointRotaryLimit* PhysicsJointRotaryLimit::construct(PhysicsBody* a, PhysicsBody* b, float min, float max) @@ -725,7 +725,7 @@ PhysicsJointRotaryLimit* PhysicsJointRotaryLimit::construct(PhysicsBody* a, Phys return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -740,7 +740,7 @@ bool PhysicsJointRotaryLimit::createConstraints() { auto joint = cpRotaryLimitJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _min, _max); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -751,24 +751,24 @@ bool PhysicsJointRotaryLimit::createConstraints() float PhysicsJointRotaryLimit::getMin() const { - CC_PJOINT_CACHE_READ(_min); + AX_PJOINT_CACHE_READ(_min); return PhysicsHelper::cpfloat2float(cpRotaryLimitJointGetMin(_cpConstraints.front())); } void PhysicsJointRotaryLimit::setMin(float min) { - CC_PJOINT_CACHE_WRITE(_min, cpRotaryLimitJointSetMin, min); + AX_PJOINT_CACHE_WRITE(_min, cpRotaryLimitJointSetMin, min); } float PhysicsJointRotaryLimit::getMax() const { - CC_PJOINT_CACHE_READ(_max); + AX_PJOINT_CACHE_READ(_max); return PhysicsHelper::cpfloat2float(cpRotaryLimitJointGetMax(_cpConstraints.front())); } void PhysicsJointRotaryLimit::setMax(float max) { - CC_PJOINT_CACHE_WRITE(_max, cpRotaryLimitJointSetMax, max); + AX_PJOINT_CACHE_WRITE(_max, cpRotaryLimitJointSetMax, max); } PhysicsJointRatchet* PhysicsJointRatchet::construct(PhysicsBody* a, PhysicsBody* b, float phase, float ratchet) @@ -783,7 +783,7 @@ PhysicsJointRatchet* PhysicsJointRatchet::construct(PhysicsBody* a, PhysicsBody* return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -794,7 +794,7 @@ bool PhysicsJointRatchet::createConstraints() auto joint = cpRatchetJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _phase, PhysicsHelper::cpfloat2float(_ratchet)); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -805,35 +805,35 @@ bool PhysicsJointRatchet::createConstraints() float PhysicsJointRatchet::getAngle() const { - CC_PJOINT_CACHE_READ(_angle); + AX_PJOINT_CACHE_READ(_angle); return PhysicsHelper::cpfloat2float(cpRatchetJointGetAngle(_cpConstraints.front())); } void PhysicsJointRatchet::setAngle(float angle) { - CC_PJOINT_CACHE_WRITE(_angle, cpRatchetJointSetAngle, angle); + AX_PJOINT_CACHE_WRITE(_angle, cpRatchetJointSetAngle, angle); } float PhysicsJointRatchet::getPhase() const { - CC_PJOINT_CACHE_READ(_phase); + AX_PJOINT_CACHE_READ(_phase); return PhysicsHelper::cpfloat2float(cpRatchetJointGetPhase(_cpConstraints.front())); } void PhysicsJointRatchet::setPhase(float phase) { - CC_PJOINT_CACHE_WRITE(_phase, cpRatchetJointSetPhase, phase); + AX_PJOINT_CACHE_WRITE(_phase, cpRatchetJointSetPhase, phase); } float PhysicsJointRatchet::getRatchet() const { - CC_PJOINT_CACHE_READ(_ratchet); + AX_PJOINT_CACHE_READ(_ratchet); return PhysicsHelper::cpfloat2float(cpRatchetJointGetRatchet(_cpConstraints.front())); } void PhysicsJointRatchet::setRatchet(float ratchet) { - CC_PJOINT_CACHE_WRITE(_ratchet, cpRatchetJointSetRatchet, ratchet); + AX_PJOINT_CACHE_WRITE(_ratchet, cpRatchetJointSetRatchet, ratchet); } PhysicsJointGear* PhysicsJointGear::construct(PhysicsBody* a, PhysicsBody* b, float phase, float ratio) @@ -848,7 +848,7 @@ PhysicsJointGear* PhysicsJointGear::construct(PhysicsBody* a, PhysicsBody* b, fl return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -858,7 +858,7 @@ bool PhysicsJointGear::createConstraints() { auto joint = cpGearJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _phase, _ratio); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -869,24 +869,24 @@ bool PhysicsJointGear::createConstraints() float PhysicsJointGear::getPhase() const { - CC_PJOINT_CACHE_READ(_phase); + AX_PJOINT_CACHE_READ(_phase); return PhysicsHelper::cpfloat2float(cpGearJointGetPhase(_cpConstraints.front())); } void PhysicsJointGear::setPhase(float phase) { - CC_PJOINT_CACHE_WRITE(_phase, cpGearJointSetPhase, phase); + AX_PJOINT_CACHE_WRITE(_phase, cpGearJointSetPhase, phase); } float PhysicsJointGear::getRatio() const { - CC_PJOINT_CACHE_READ(_ratio); + AX_PJOINT_CACHE_READ(_ratio); return PhysicsHelper::cpfloat2float(cpGearJointGetRatio(_cpConstraints.front())); } void PhysicsJointGear::setRatio(float ratio) { - CC_PJOINT_CACHE_WRITE(_ratio, cpGearJointSetRatio, ratio); + AX_PJOINT_CACHE_WRITE(_ratio, cpGearJointSetRatio, ratio); } PhysicsJointMotor* PhysicsJointMotor::construct(PhysicsBody* a, PhysicsBody* b, float rate) @@ -900,7 +900,7 @@ PhysicsJointMotor* PhysicsJointMotor::construct(PhysicsBody* a, PhysicsBody* b, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -910,7 +910,7 @@ bool PhysicsJointMotor::createConstraints() { auto joint = cpSimpleMotorNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _rate); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -921,14 +921,14 @@ bool PhysicsJointMotor::createConstraints() float PhysicsJointMotor::getRate() const { - CC_PJOINT_CACHE_READ(_rate); + AX_PJOINT_CACHE_READ(_rate); return PhysicsHelper::cpfloat2float(cpSimpleMotorGetRate(_cpConstraints.front())); } void PhysicsJointMotor::setRate(float rate) { - CC_PJOINT_CACHE_WRITE(_rate, cpSimpleMotorSetRate, rate); + AX_PJOINT_CACHE_WRITE(_rate, cpSimpleMotorSetRate, rate); } NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS diff --git a/core/physics/CCPhysicsJoint.h b/core/physics/CCPhysicsJoint.h index 55d54c07dd..459b3c0ca1 100644 --- a/core/physics/CCPhysicsJoint.h +++ b/core/physics/CCPhysicsJoint.h @@ -29,7 +29,7 @@ #include #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "base/CCRef.h" # include "math/CCMath.h" @@ -54,7 +54,7 @@ class WriteCache; /** * @brief An PhysicsJoint object connects two physics bodies together. */ -class CC_DLL PhysicsJoint +class AX_DLL PhysicsJoint { protected: typedef std::function DelayTask; @@ -145,7 +145,7 @@ protected: * @brief A fixed joint fuses the two bodies together at a reference point. Fixed joints are useful for creating complex * shapes that can be broken apart later. */ -class CC_DLL PhysicsJointFixed : public PhysicsJoint +class AX_DLL PhysicsJointFixed : public PhysicsJoint { public: /** Create a fixed joint. @@ -169,7 +169,7 @@ protected: /** * @brief A limit joint imposes a maximum distance between the two bodies, as if they were connected by a rope. */ -class CC_DLL PhysicsJointLimit : public PhysicsJoint +class AX_DLL PhysicsJointLimit : public PhysicsJoint { public: /** Create a limit joint. @@ -236,7 +236,7 @@ protected: /** * @brief A pin joint allows the two bodies to independently rotate around the anchor point as if pinned together. */ -class CC_DLL PhysicsJointPin : public PhysicsJoint +class AX_DLL PhysicsJointPin : public PhysicsJoint { public: /** Create a pin joint. @@ -270,7 +270,7 @@ protected: }; /** Set the fixed distance with two bodies */ -class CC_DLL PhysicsJointDistance : public PhysicsJoint +class AX_DLL PhysicsJointDistance : public PhysicsJoint { public: /** Create a fixed distance joint. @@ -298,7 +298,7 @@ protected: }; /** Connecting two physics bodies together with a spring. */ -class CC_DLL PhysicsJointSpring : public PhysicsJoint +class AX_DLL PhysicsJointSpring : public PhysicsJoint { public: /** Create a fixed distance joint. @@ -361,7 +361,7 @@ protected: }; /** Attach body a to a line, and attach body b to a dot. */ -class CC_DLL PhysicsJointGroove : public PhysicsJoint +class AX_DLL PhysicsJointGroove : public PhysicsJoint { public: /** Create a groove joint. @@ -409,7 +409,7 @@ protected: }; /** Likes a spring joint, but works with rotary. */ -class CC_DLL PhysicsJointRotarySpring : public PhysicsJoint +class AX_DLL PhysicsJointRotarySpring : public PhysicsJoint { public: /** Create a damped rotary spring joint. @@ -451,7 +451,7 @@ protected: }; /** Likes a limit joint, but works with rotary. */ -class CC_DLL PhysicsJointRotaryLimit : public PhysicsJoint +class AX_DLL PhysicsJointRotaryLimit : public PhysicsJoint { public: /** Create a limit rotary joint. @@ -495,7 +495,7 @@ protected: }; /** Works like a socket wrench. */ -class CC_DLL PhysicsJointRatchet : public PhysicsJoint +class AX_DLL PhysicsJointRatchet : public PhysicsJoint { public: /** Create a ratchet joint. @@ -536,7 +536,7 @@ protected: }; /** Keeps the angular velocity ratio of a pair of bodies constant. */ -class CC_DLL PhysicsJointGear : public PhysicsJoint +class AX_DLL PhysicsJointGear : public PhysicsJoint { public: /** Create a gear joint. @@ -572,7 +572,7 @@ protected: }; /** Keeps the relative angular velocity of a pair of bodies constant. */ -class CC_DLL PhysicsJointMotor : public PhysicsJoint +class AX_DLL PhysicsJointMotor : public PhysicsJoint { public: /** Create a motor joint. @@ -603,5 +603,5 @@ protected: NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif // __CCPHYSICS_JOINT_H__ diff --git a/core/physics/CCPhysicsShape.cpp b/core/physics/CCPhysicsShape.cpp index 607fa2074a..77dab22b80 100644 --- a/core/physics/CCPhysicsShape.cpp +++ b/core/physics/CCPhysicsShape.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "physics/CCPhysicsShape.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include # include @@ -117,7 +117,7 @@ void PhysicsShape::setScale(float scaleX, float scaleY) { if (_type == Type::CIRCLE && scaleX != scaleY) { - CCLOG("PhysicsShapeCircle WARNING: CANNOT support setScale with different x and y"); + AXLOG("PhysicsShapeCircle WARNING: CANNOT support setScale with different x and y"); return; } _newScaleX = scaleX; @@ -288,7 +288,7 @@ PhysicsShapeCircle* PhysicsShapeCircle::create(float radius, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -301,7 +301,7 @@ bool PhysicsShapeCircle::init(float radius, _type = Type::CIRCLE; auto shape = cpCircleShapeNew(s_sharedBody, radius, PhysicsHelper::vec22cpv(offset)); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); @@ -380,7 +380,7 @@ PhysicsShapeEdgeSegment* PhysicsShapeEdgeSegment::create(const Vec2& a, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -394,7 +394,7 @@ bool PhysicsShapeEdgeSegment::init(const Vec2& a, _type = Type::EDGESEGMENT; auto shape = cpSegmentShapeNew(s_sharedBody, PhysicsHelper::vec22cpv(a), PhysicsHelper::vec22cpv(b), border); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); @@ -457,7 +457,7 @@ PhysicsShapeBox* PhysicsShapeBox::create(const Vec2& size, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -479,7 +479,7 @@ bool PhysicsShapeBox::init(const Vec2& size, cpTransform transform = cpTransformTranslate(PhysicsHelper::vec22cpv(offset)); auto shape = cpPolyShapeNew(s_sharedBody, 4, vec, transform, radius); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); @@ -517,7 +517,7 @@ PhysicsShapePolygon* PhysicsShapePolygon::create(const Vec2* points, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -536,9 +536,9 @@ bool PhysicsShapePolygon::init(const Vec2* points, // 0); cpTransform transform = cpTransformTranslate(PhysicsHelper::vec22cpv(offset)); auto shape = cpPolyShapeNew(s_sharedBody, count, vecs, transform, radius); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); @@ -560,7 +560,7 @@ float PhysicsShapePolygon::calculateArea(const Vec2* points, int count) cpVect* vecs = new cpVect[count]; PhysicsHelper::points2cpvs(points, vecs, count); float area = PhysicsHelper::cpfloat2float(cpAreaForPoly(count, vecs, 0.0f)); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); return area; } @@ -573,7 +573,7 @@ float PhysicsShapePolygon::calculateMoment(float mass, const Vec2* points, int c mass == PHYSICS_INFINITY ? PHYSICS_INFINITY : PhysicsHelper::cpfloat2float(cpMomentForPoly(mass, count, vecs, PhysicsHelper::vec22cpv(offset), radius)); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); return moment; } @@ -586,7 +586,7 @@ float PhysicsShapePolygon::calculateArea() for (int i = 0; i < count; ++i) vecs[i] = cpPolyShapeGetVert(shape, i); float area = PhysicsHelper::cpfloat2float(cpAreaForPoly(count, vecs, cpPolyShapeGetRadius(shape))); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); return area; } @@ -605,7 +605,7 @@ float PhysicsShapePolygon::calculateDefaultMoment() vecs[i] = cpPolyShapeGetVert(shape, i); float moment = PhysicsHelper::cpfloat2float(cpMomentForPoly(_mass, count, vecs, cpvzero, cpPolyShapeGetRadius(shape))); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); return moment; } } @@ -623,7 +623,7 @@ void PhysicsShapePolygon::getPoints(Vec2* outPoints) const for (int i = 0; i < count; ++i) vecs[i] = cpPolyShapeGetVert(shape, i); PhysicsHelper::cpvs2points(vecs, outPoints, count); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); } int PhysicsShapePolygon::getPointsCount() const @@ -640,7 +640,7 @@ Vec2 PhysicsShapePolygon::getCenter() vecs[i] = cpPolyShapeGetVert(shape, i); Vec2 center = PhysicsHelper::cpv2vec2(cpCentroidForPoly(count, vecs)); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); return center; } @@ -674,7 +674,7 @@ void PhysicsShapePolygon::updateScale() } cpPolyShapeSetVertsRaw(shape, count, vects); - CC_SAFE_DELETE_ARRAY(vects); + AX_SAFE_DELETE_ARRAY(vects); PhysicsShape::updateScale(); } @@ -692,7 +692,7 @@ PhysicsShapeEdgeBox* PhysicsShapeEdgeBox::create(const Vec2& size, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -715,11 +715,11 @@ bool PhysicsShapeEdgeBox::init(const Vec2& size, for (; i < 4; ++i) { auto shape = cpSegmentShapeNew(s_sharedBody, vec[i], vec[(i + 1) % 4], border); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); } - CC_BREAK_IF(i < 4); + AX_BREAK_IF(i < 4); _mass = PHYSICS_INFINITY; _moment = PHYSICS_INFINITY; @@ -745,7 +745,7 @@ PhysicsShapeEdgePolygon* PhysicsShapeEdgePolygon::create(const Vec2* points, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -766,15 +766,15 @@ bool PhysicsShapeEdgePolygon::init(const Vec2* points, for (; i < count; ++i) { auto shape = cpSegmentShapeNew(s_sharedBody, vec[i], vec[(i + 1) % count], border); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); cpShapeSetElasticity(shape, 1.0f); cpShapeSetFriction(shape, 1.0f); addShape(shape); } - CC_SAFE_DELETE_ARRAY(vec); + AX_SAFE_DELETE_ARRAY(vec); - CC_BREAK_IF(i < count); + AX_BREAK_IF(i < count); _mass = PHYSICS_INFINITY; _moment = PHYSICS_INFINITY; @@ -784,7 +784,7 @@ bool PhysicsShapeEdgePolygon::init(const Vec2* points, return true; } while (false); - CC_SAFE_DELETE_ARRAY(vec); + AX_SAFE_DELETE_ARRAY(vec); return false; } @@ -832,7 +832,7 @@ PhysicsShapeEdgeChain* PhysicsShapeEdgeChain::create(const Vec2* points, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -872,14 +872,14 @@ bool PhysicsShapeEdgeChain::init(const Vec2* points, for (; i < count - 1; ++i) { auto shape = cpSegmentShapeNew(s_sharedBody, vec[i], vec[i + 1], border); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); cpShapeSetElasticity(shape, 1.0f); cpShapeSetFriction(shape, 1.0f); addShape(shape); } - CC_SAFE_DELETE_ARRAY(vec); - CC_BREAK_IF(i < count - 1); + AX_SAFE_DELETE_ARRAY(vec); + AX_BREAK_IF(i < count - 1); _mass = PHYSICS_INFINITY; _moment = PHYSICS_INFINITY; @@ -889,7 +889,7 @@ bool PhysicsShapeEdgeChain::init(const Vec2* points, return true; } while (false); - CC_SAFE_DELETE_ARRAY(vec); + AX_SAFE_DELETE_ARRAY(vec); return false; } @@ -975,4 +975,4 @@ bool PhysicsShape::containsPoint(const Vec2& point) const NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS diff --git a/core/physics/CCPhysicsShape.h b/core/physics/CCPhysicsShape.h index dba8bcb012..6819123b00 100644 --- a/core/physics/CCPhysicsShape.h +++ b/core/physics/CCPhysicsShape.h @@ -28,7 +28,7 @@ #define __CCPHYSICS_SHAPE_H__ #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "base/CCRef.h" # include "math/CCMath.h" @@ -39,7 +39,7 @@ NS_AX_BEGIN class PhysicsBody; -typedef struct CC_DLL PhysicsMaterial +typedef struct AX_DLL PhysicsMaterial { float density; ///< The density of the object. float restitution; ///< The bounciness of the physics body. @@ -66,7 +66,7 @@ const PhysicsMaterial PHYSICSSHAPE_MATERIAL_DEFAULT; * @brief A shape for body. You do not create PhysicsWorld objects directly, instead, you can view PhysicsBody to see * how to create it. */ -class CC_DLL PhysicsShape : public Ref +class AX_DLL PhysicsShape : public Ref { public: enum class Type @@ -383,7 +383,7 @@ protected: }; /** A circle shape. */ -class CC_DLL PhysicsShapeCircle : public PhysicsShape +class AX_DLL PhysicsShapeCircle : public PhysicsShape { public: /** @@ -450,7 +450,7 @@ protected: }; /** A polygon shape. */ -class CC_DLL PhysicsShapePolygon : public PhysicsShape +class AX_DLL PhysicsShapePolygon : public PhysicsShape { public: /** @@ -543,7 +543,7 @@ protected: }; /** A box shape. */ -class CC_DLL PhysicsShapeBox : public PhysicsShapePolygon +class AX_DLL PhysicsShapeBox : public PhysicsShapePolygon { public: /** @@ -585,7 +585,7 @@ protected: }; /** A segment shape. */ -class CC_DLL PhysicsShapeEdgeSegment : public PhysicsShape +class AX_DLL PhysicsShapeEdgeSegment : public PhysicsShape { public: /** @@ -638,7 +638,7 @@ protected: }; /** An edge polygon shape. */ -class CC_DLL PhysicsShapeEdgePolygon : public PhysicsShape +class AX_DLL PhysicsShapeEdgePolygon : public PhysicsShape { public: /** @@ -691,7 +691,7 @@ protected: }; /** An edge box shape. */ -class CC_DLL PhysicsShapeEdgeBox : public PhysicsShapeEdgePolygon +class AX_DLL PhysicsShapeEdgeBox : public PhysicsShapeEdgePolygon { public: /** @@ -729,7 +729,7 @@ protected: }; /** A chain shape. */ -class CC_DLL PhysicsShapeEdgeChain : public PhysicsShape +class AX_DLL PhysicsShapeEdgeChain : public PhysicsShape { public: /** @@ -786,5 +786,5 @@ protected: NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif // __CCPHYSICS_FIXTURE_H__ diff --git a/core/physics/CCPhysicsWorld.cpp b/core/physics/CCPhysicsWorld.cpp index 5048072c6b..f1793f3133 100644 --- a/core/physics/CCPhysicsWorld.cpp +++ b/core/physics/CCPhysicsWorld.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "physics/CCPhysicsWorld.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include # include @@ -115,7 +115,7 @@ cpBool PhysicsWorldCallback::collisionBeginCallbackFunc(cpArbiter* arb, struct c PhysicsShape* shapeA = static_cast(cpShapeGetUserData(a)); PhysicsShape* shapeB = static_cast(cpShapeGetUserData(b)); - CC_ASSERT(shapeA != nullptr && shapeB != nullptr); + AX_ASSERT(shapeA != nullptr && shapeB != nullptr); auto contact = PhysicsContact::construct(shapeA, shapeB); cpArbiterSetUserData(arb, contact); @@ -155,7 +155,7 @@ void PhysicsWorldCallback::rayCastCallbackFunc(cpShape* shape, } PhysicsShape* physicsShape = static_cast(cpShapeGetUserData(shape)); - CC_ASSERT(physicsShape != nullptr); + AX_ASSERT(physicsShape != nullptr); PhysicsRayCastInfo callbackInfo = { physicsShape, @@ -172,7 +172,7 @@ void PhysicsWorldCallback::rayCastCallbackFunc(cpShape* shape, void PhysicsWorldCallback::queryRectCallbackFunc(cpShape* shape, RectQueryCallbackInfo* info) { PhysicsShape* physicsShape = static_cast(cpShapeGetUserData(shape)); - CC_ASSERT(physicsShape != nullptr); + AX_ASSERT(physicsShape != nullptr); if (!PhysicsWorldCallback::continues) { @@ -189,7 +189,7 @@ void PhysicsWorldCallback::getShapesAtPointFunc(cpShape* shape, Vector* arr) { PhysicsShape* physicsShape = static_cast(cpShapeGetUserData(shape)); - CC_ASSERT(physicsShape != nullptr); + AX_ASSERT(physicsShape != nullptr); arr->pushBack(physicsShape); } @@ -200,7 +200,7 @@ void PhysicsWorldCallback::queryPointFunc(cpShape* shape, PointQueryCallbackInfo* info) { PhysicsShape* physicsShape = static_cast(cpShapeGetUserData(shape)); - CC_ASSERT(physicsShape != nullptr); + AX_ASSERT(physicsShape != nullptr); PhysicsWorldCallback::continues = info->func(*info->world, *physicsShape, info->data); } @@ -445,7 +445,7 @@ void PhysicsWorld::collisionSeparateCallback(PhysicsContact& contact) void PhysicsWorld::rayCast(PhysicsRayCastCallbackFunc func, const Vec2& point1, const Vec2& point2, void* data) { - CCASSERT(func != nullptr, "func shouldn't be nullptr"); + AXASSERT(func != nullptr, "func shouldn't be nullptr"); if (func != nullptr) { @@ -464,7 +464,7 @@ void PhysicsWorld::rayCast(PhysicsRayCastCallbackFunc func, const Vec2& point1, void PhysicsWorld::queryRect(PhysicsQueryRectCallbackFunc func, const Rect& rect, void* data) { - CCASSERT(func != nullptr, "func shouldn't be nullptr"); + AXASSERT(func != nullptr, "func shouldn't be nullptr"); if (func != nullptr) { @@ -482,7 +482,7 @@ void PhysicsWorld::queryRect(PhysicsQueryRectCallbackFunc func, const Rect& rect void PhysicsWorld::queryPoint(PhysicsQueryPointCallbackFunc func, const Vec2& point, void* data) { - CCASSERT(func != nullptr, "func shouldn't be nullptr"); + AXASSERT(func != nullptr, "func shouldn't be nullptr"); if (func != nullptr) { @@ -518,13 +518,13 @@ bool PhysicsWorld::init() { do { -# if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +# if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 _cpSpace = cpSpaceNew(); # else _cpSpace = cpHastySpaceNew(); cpHastySpaceSetThreads(_cpSpace, 0); # endif - CC_BREAK_IF(_cpSpace == nullptr); + AX_BREAK_IF(_cpSpace == nullptr); cpSpaceSetGravity(_cpSpace, PhysicsHelper::vec22cpv(_gravity)); @@ -543,7 +543,7 @@ bool PhysicsWorld::init() void PhysicsWorld::addBody(PhysicsBody* body) { - CCASSERT(body != nullptr, "the body can not be nullptr"); + AXASSERT(body != nullptr, "the body can not be nullptr"); if (body->getWorld() == this) { @@ -633,7 +633,7 @@ void PhysicsWorld::removeBody(PhysicsBody* body) { if (body->getWorld() != this) { - CCLOG("Physics Warning: this body doesn't belong to this world"); + AXLOG("Physics Warning: this body doesn't belong to this world"); return; } @@ -652,7 +652,7 @@ void PhysicsWorld::removeBody(PhysicsBody* body) void PhysicsWorld::removeBodyOrDelay(PhysicsBody* body) { - if (_delayAddBodies.getIndex(body) != CC_INVALID_INDEX) + if (_delayAddBodies.getIndex(body) != AX_INVALID_INDEX) { _delayAddBodies.eraseObject(body); return; @@ -660,7 +660,7 @@ void PhysicsWorld::removeBodyOrDelay(PhysicsBody* body) if (cpSpaceIsLocked(_cpSpace)) { - if (_delayRemoveBodies.getIndex(body) == CC_INVALID_INDEX) + if (_delayRemoveBodies.getIndex(body) == AX_INVALID_INDEX) { _delayRemoveBodies.pushBack(body); } @@ -677,7 +677,7 @@ void PhysicsWorld::removeJoint(PhysicsJoint* joint, bool destroy) { if (joint->getWorld() != this && destroy) { - CCLOG( + AXLOG( "physics warning: the joint is not in this world, it won't be destroyed until the body it connects is " "destroyed"); return; @@ -760,7 +760,7 @@ void PhysicsWorld::addJoint(PhysicsJoint* joint) { if (joint) { - CCASSERT(joint->getWorld() == nullptr, "Can not add joint already add to other world!"); + AXASSERT(joint->getWorld() == nullptr, "Can not add joint already add to other world!"); joint->_world = this; auto it = std::find(_delayRemoveJoints.begin(), _delayRemoveJoints.end(), joint); @@ -799,7 +799,7 @@ void PhysicsWorld::addShape(PhysicsShape* physicsShape) void PhysicsWorld::doRemoveBody(PhysicsBody* body) { - CCASSERT(body != nullptr, "the body can not be nullptr"); + AXASSERT(body != nullptr, "the body can not be nullptr"); // remove shapes for (auto& shape : body->getShapes()) @@ -855,7 +855,7 @@ void PhysicsWorld::setDebugDrawMask(int mask) if (mask == DEBUGDRAW_NONE && _debugDraw) { _debugDraw->removeFromParent(); - CC_SAFE_RELEASE_NULL(_debugDraw); + AX_SAFE_RELEASE_NULL(_debugDraw); } _debugDrawMask = mask; @@ -901,7 +901,7 @@ void PhysicsWorld::step(float delta) { if (_autoStep) { - CCLOG("Physics Warning: You need to close auto step( setAutoStep(false) ) first"); + AXLOG("Physics Warning: You need to close auto step( setAutoStep(false) ) first"); } else { @@ -939,7 +939,7 @@ void PhysicsWorld::update(float delta, bool userCall /* = false*/) if (userCall) { -# if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +# if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 cpSpaceStep(_cpSpace, delta); # else cpHastySpaceStep(_cpSpace, delta); @@ -955,7 +955,7 @@ void PhysicsWorld::update(float delta, bool userCall /* = false*/) while (_updateTime > step) { _updateTime -= step; -# if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +# if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 cpSpaceStep(_cpSpace, dt); # else cpHastySpaceStep(_cpSpace, dt); @@ -969,7 +969,7 @@ void PhysicsWorld::update(float delta, bool userCall /* = false*/) const float dt = _updateTime * _speed / _substeps; for (int i = 0; i < _substeps; ++i) { -# if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +# if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 cpSpaceStep(_cpSpace, dt); # else cpHastySpaceStep(_cpSpace, dt); @@ -1008,7 +1008,7 @@ PhysicsWorld* PhysicsWorld::construct(Scene* scene) return world; } - CC_SAFE_DELETE(world); + AX_SAFE_DELETE(world); return nullptr; } @@ -1035,13 +1035,13 @@ PhysicsWorld::~PhysicsWorld() removeAllBodies(); if (_cpSpace) { -# if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +# if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 cpSpaceFree(_cpSpace); # else cpHastySpaceFree(_cpSpace); # endif } - CC_SAFE_RELEASE_NULL(_debugDraw); + AX_SAFE_RELEASE_NULL(_debugDraw); } void PhysicsWorld::beforeSimulation(Node* node, @@ -1093,4 +1093,4 @@ void PhysicsWorld::setPreUpdateCallback(const std::function& callback) NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS diff --git a/core/physics/CCPhysicsWorld.h b/core/physics/CCPhysicsWorld.h index 43c7b1e7d3..df35cb6b9a 100644 --- a/core/physics/CCPhysicsWorld.h +++ b/core/physics/CCPhysicsWorld.h @@ -27,7 +27,7 @@ #define __CCPHYSICS_WORLD_H__ #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include # include "base/CCVector.h" @@ -97,7 +97,7 @@ typedef PhysicsQueryRectCallbackFunc PhysicsQueryPointCallbackFunc; * @brief An PhysicsWorld object simulates collisions and other physical properties. You do not create PhysicsWorld * objects directly; instead, you can get it from an Scene object. */ -class CC_DLL PhysicsWorld +class AX_DLL PhysicsWorld { public: static const int DEBUGDRAW_NONE; ///< draw nothing @@ -449,12 +449,12 @@ protected: friend class PhysicsDebugDraw; }; -extern const float CC_DLL PHYSICS_INFINITY; +extern const float AX_DLL PHYSICS_INFINITY; /** @} */ /** @} */ NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif // __CCPHYSICS_WORLD_H__ diff --git a/core/physics3d/CCPhysics3D.cpp b/core/physics3d/CCPhysics3D.cpp index 2c6127d1dc..fcddebf429 100644 --- a/core/physics3d/CCPhysics3D.cpp +++ b/core/physics3d/CCPhysics3D.cpp @@ -25,15 +25,15 @@ #include "physics3d/CCPhysics3D.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN -CC_DLL const char* physics3dVersion() +AX_DLL const char* physics3dVersion() { -# if CC_ENABLE_BULLET_INTEGRATION +# if AX_ENABLE_BULLET_INTEGRATION return "bullet2.82"; # endif } @@ -91,6 +91,6 @@ btQuaternion convertQuatTobtQuat(const axis::Quaternion& quat) return btQuaternion(quat.x, quat.y, quat.z, quat.w); } -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3D.h b/core/physics3d/CCPhysics3D.h index 5a0bb139ea..23323ea307 100644 --- a/core/physics3d/CCPhysics3D.h +++ b/core/physics3d/CCPhysics3D.h @@ -29,7 +29,7 @@ #include "base/ccConfig.h" #include "math/CCMath.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS # include "physics3d/CCPhysics3DShape.h" # include "physics3d/CCPhysicsMeshRenderer.h" @@ -41,11 +41,11 @@ NS_AX_BEGIN -CC_DLL const char* physics3dVersion(); +AX_DLL const char* physics3dVersion(); NS_AX_END -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) // include bullet header files # include "bullet/LinearMath/btTransform.h" @@ -64,8 +64,8 @@ btTransform convertMat4TobtTransform(const axis::Mat4& mat4); axis::Quaternion convertbtQuatToQuat(const btQuaternion& btQuat); btQuaternion convertQuatTobtQuat(const axis::Quaternion& quat); -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_H__ diff --git a/core/physics3d/CCPhysics3DComponent.cpp b/core/physics3d/CCPhysics3DComponent.cpp index f143cbfd7d..96737d9135 100644 --- a/core/physics3d/CCPhysics3DComponent.cpp +++ b/core/physics3d/CCPhysics3DComponent.cpp @@ -27,15 +27,15 @@ THE SOFTWARE. #include "2d/CCNode.h" #include "2d/CCScene.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN Physics3DComponent::~Physics3DComponent() { - CC_SAFE_RELEASE(_physics3DObj); + AX_SAFE_RELEASE(_physics3DObj); } std::string& Physics3DComponent::getPhysics3DComponentName() @@ -62,14 +62,14 @@ Physics3DComponent* Physics3DComponent::create(Physics3DObject* physicsObj, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } void Physics3DComponent::setPhysics3DObject(Physics3DObject* physicsObj) { - CC_SAFE_RETAIN(physicsObj); - CC_SAFE_RELEASE(_physics3DObj); + AX_SAFE_RETAIN(physicsObj); + AX_SAFE_RELEASE(_physics3DObj); _physics3DObj = physicsObj; } @@ -250,6 +250,6 @@ void Physics3DComponent::syncNodeToPhysics() NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DComponent.h b/core/physics3d/CCPhysics3DComponent.h index 95bd325612..b6c8c6f63e 100644 --- a/core/physics3d/CCPhysics3DComponent.h +++ b/core/physics3d/CCPhysics3DComponent.h @@ -31,9 +31,9 @@ #include "2d/CCComponent.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -47,7 +47,7 @@ class Physics3DWorld; /** @brief Physics3DComponent: A component with 3D physics, you can add a rigid body to it, and then add this component * to a node, the node will move and rotate with this rigid body */ -class CC_DLL Physics3DComponent : public axis::Component +class AX_DLL Physics3DComponent : public axis::Component { friend class Physics3DWorld; @@ -143,8 +143,8 @@ protected: /// @} NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_COMPONENT_H__ diff --git a/core/physics3d/CCPhysics3DConstraint.cpp b/core/physics3d/CCPhysics3DConstraint.cpp index ef0ff76172..67f94ce3f1 100644 --- a/core/physics3d/CCPhysics3DConstraint.cpp +++ b/core/physics3d/CCPhysics3DConstraint.cpp @@ -25,9 +25,9 @@ #include "physics3d/CCPhysics3D.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -41,9 +41,9 @@ Physics3DConstraint::Physics3DConstraint() Physics3DConstraint::~Physics3DConstraint() { - CC_SAFE_RELEASE(_bodyA); - CC_SAFE_RELEASE(_bodyB); - CC_SAFE_DELETE(_constraint); + AX_SAFE_RELEASE(_bodyA); + AX_SAFE_RELEASE(_bodyB); + AX_SAFE_DELETE(_constraint); } float Physics3DConstraint::getBreakingImpulse() const @@ -89,7 +89,7 @@ Physics3DPointToPointConstraint* Physics3DPointToPointConstraint::create(Physics return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -105,7 +105,7 @@ Physics3DPointToPointConstraint* Physics3DPointToPointConstraint::create(Physics return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -880,6 +880,6 @@ void Physics3D6DofConstraint::setUseFrameOffset(bool frameOffsetOnOff) const NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DConstraint.h b/core/physics3d/CCPhysics3DConstraint.h index 72404c0bed..020bacc62f 100644 --- a/core/physics3d/CCPhysics3DConstraint.h +++ b/core/physics3d/CCPhysics3DConstraint.h @@ -30,9 +30,9 @@ #include "base/CCRef.h" #include "base/ccConfig.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) class btTypedConstraint; @@ -47,7 +47,7 @@ class Physics3DRigidBody; /** @brief Physics3DConstraint: Constraint affects the movement of physics object, it usually connect one or two physics * object. There are some types of physics constraints. */ -class CC_DLL Physics3DConstraint : public Ref +class AX_DLL Physics3DConstraint : public Ref { public: enum class ConstraintType @@ -115,7 +115,7 @@ public: */ void setOverrideNumSolverIterations(int overrideNumIterations); -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) btTypedConstraint* getbtContraint() { return _constraint; } # endif @@ -135,7 +135,7 @@ protected: /** * Point to point constraint limits the translation so that the local pivot points of 2 rigidbodies match in worldspace. */ -class CC_DLL Physics3DPointToPointConstraint : public Physics3DConstraint +class AX_DLL Physics3DPointToPointConstraint : public Physics3DConstraint { public: /** @@ -193,7 +193,7 @@ public: * the hinge axis. This can be useful to represent doors or wheels rotating around one axis. hinge constraint between * two rigidbodies each with a pivotpoint that describes the axis location in local space */ -class CC_DLL Physics3DHingeConstraint : public Physics3DConstraint +class AX_DLL Physics3DHingeConstraint : public Physics3DConstraint { public: /** @@ -334,7 +334,7 @@ public: * LimAng - hitting angular limit * OrthoLin, OrthoAng - against constraint axis */ -class CC_DLL Physics3DSliderConstraint : public Physics3DConstraint +class AX_DLL Physics3DSliderConstraint : public Physics3DConstraint { public: /** @@ -441,7 +441,7 @@ public: /** * It is a special point to point constraint that adds cone and twist axis limits. The x-axis serves as twist axis. */ -class CC_DLL Physics3DConeTwistConstraint : public Physics3DConstraint +class AX_DLL Physics3DConeTwistConstraint : public Physics3DConstraint { public: /** @@ -544,7 +544,7 @@ public: * Lowerlimit > Upperlimit -> axis is free * Lowerlimit < Upperlimit -> axis it limited in that range */ -class CC_DLL Physics3D6DofConstraint : public Physics3DConstraint +class AX_DLL Physics3D6DofConstraint : public Physics3DConstraint { public: /** @@ -615,8 +615,8 @@ public: NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_CONSTRAINT_H__ diff --git a/core/physics3d/CCPhysics3DDebugDrawer.cpp b/core/physics3d/CCPhysics3DDebugDrawer.cpp index 1f9f336742..1cebeeff3f 100644 --- a/core/physics3d/CCPhysics3DDebugDrawer.cpp +++ b/core/physics3d/CCPhysics3DDebugDrawer.cpp @@ -34,9 +34,9 @@ #include "renderer/ccShaders.h" #include "renderer/backend/Buffer.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -67,7 +67,7 @@ void Physics3DDebugDrawer::drawContactPoint(const btVector3& PointOnB, void Physics3DDebugDrawer::reportErrorWarning(const char* warningString) { - CCLOG("%s", warningString); + AXLOG("%s", warningString); } void Physics3DDebugDrawer::draw3dText(const btVector3& /*location*/, const char* /*textString*/) {} @@ -110,7 +110,7 @@ void Physics3DDebugDrawer::draw(Renderer* renderer) _customCommand.setVertexDrawInfo(0, _buffer.size()); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _buffer.size()); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _buffer.size()); renderer->addCommand(&_customCommand); } @@ -122,12 +122,12 @@ Physics3DDebugDrawer::Physics3DDebugDrawer() Physics3DDebugDrawer::~Physics3DDebugDrawer() { - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); } void Physics3DDebugDrawer::init() { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_COLOR); _programState = new backend::ProgramState(program); _locMVP = _programState->getUniformLocation("u_MVPMatrix"); @@ -148,8 +148,8 @@ void Physics3DDebugDrawer::init() _customCommand.getPipelineDescriptor().programState = _programState; _customCommand.setPrimitiveType(CustomCommand::PrimitiveType::LINE); _customCommand.setDrawType(CustomCommand::DrawType::ARRAY); - _customCommand.setBeforeCallback(CC_CALLBACK_0(Physics3DDebugDrawer::onBeforeDraw, this)); - _customCommand.setAfterCallback(CC_CALLBACK_0(Physics3DDebugDrawer::onAfterDraw, this)); + _customCommand.setBeforeCallback(AX_CALLBACK_0(Physics3DDebugDrawer::onBeforeDraw, this)); + _customCommand.setAfterCallback(AX_CALLBACK_0(Physics3DDebugDrawer::onAfterDraw, this)); } void Physics3DDebugDrawer::onBeforeDraw() @@ -172,6 +172,6 @@ void Physics3DDebugDrawer::clear() NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DDebugDrawer.h b/core/physics3d/CCPhysics3DDebugDrawer.h index 69ad88b7e0..8587b20a25 100644 --- a/core/physics3d/CCPhysics3DDebugDrawer.h +++ b/core/physics3d/CCPhysics3DDebugDrawer.h @@ -34,9 +34,9 @@ #include "renderer/backend/ProgramState.h" #include "renderer/backend/Types.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) # include "bullet/LinearMath/btIDebugDraw.h" NS_AX_BEGIN @@ -102,8 +102,8 @@ private: NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_VIEWER_H__ diff --git a/core/physics3d/CCPhysics3DObject.cpp b/core/physics3d/CCPhysics3DObject.cpp index 366ffd4647..1843a70637 100644 --- a/core/physics3d/CCPhysics3DObject.cpp +++ b/core/physics3d/CCPhysics3DObject.cpp @@ -26,9 +26,9 @@ #include "physics3d/CCPhysics3D.h" #include "base/ccUTF8.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) # include "bullet/btBulletCollisionCommon.h" # include "bullet/btBulletDynamicsCommon.h" @@ -48,9 +48,9 @@ Physics3DRigidBody::~Physics3DRigidBody() _constraintList.clear(); } auto ms = _btRigidBody->getMotionState(); - CC_SAFE_DELETE(ms); - CC_SAFE_DELETE(_btRigidBody); - CC_SAFE_RELEASE(_physics3DShape); + AX_SAFE_DELETE(ms); + AX_SAFE_DELETE(_btRigidBody); + AX_SAFE_RELEASE(_physics3DShape); } Physics3DRigidBody* Physics3DRigidBody::create(Physics3DRigidBodyDes* info) @@ -62,7 +62,7 @@ Physics3DRigidBody* Physics3DRigidBody::create(Physics3DRigidBodyDes* info) return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -326,13 +326,13 @@ void Physics3DRigidBody::removeConstraint(Physics3DConstraint* constraint) void Physics3DRigidBody::removeConstraint(unsigned int idx) { - CCASSERT(idx < _constraintList.size(), "idx < _constraintList.size()"); + AXASSERT(idx < _constraintList.size(), "idx < _constraintList.size()"); removeConstraint(_constraintList[idx]); } Physics3DConstraint* Physics3DRigidBody::getConstraint(unsigned int idx) const { - CCASSERT(idx < _constraintList.size(), "idx < _constraintList.size()"); + AXASSERT(idx < _constraintList.size(), "idx < _constraintList.size()"); return _constraintList[idx]; } @@ -436,8 +436,8 @@ Physics3DCollider::Physics3DCollider() : _btGhostObject(nullptr), _physics3DShap Physics3DCollider::~Physics3DCollider() { - CC_SAFE_DELETE(_btGhostObject); - CC_SAFE_RELEASE(_physics3DShape); + AX_SAFE_DELETE(_btGhostObject); + AX_SAFE_RELEASE(_physics3DShape); } Physics3DCollider* Physics3DCollider::create(Physics3DColliderDes* info) @@ -449,7 +449,7 @@ Physics3DCollider* Physics3DCollider::create(Physics3DColliderDes* info) return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -551,6 +551,6 @@ axis::Mat4 Physics3DCollider::getWorldTransform() const NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DObject.h b/core/physics3d/CCPhysics3DObject.h index a929fba0b9..eb4ec27c05 100644 --- a/core/physics3d/CCPhysics3DObject.h +++ b/core/physics3d/CCPhysics3DObject.h @@ -32,9 +32,9 @@ #include -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) class btCollisionShape; class btRigidBody; @@ -54,7 +54,7 @@ class Physics3DObject; /** * @brief The collision information of Physics3DObject. */ -struct CC_DLL Physics3DCollisionInfo +struct AX_DLL Physics3DCollisionInfo { struct CollisionPoint { @@ -72,7 +72,7 @@ struct CC_DLL Physics3DCollisionInfo /** * @brief Inherit from Ref, base class */ -class CC_DLL Physics3DObject : public Ref +class AX_DLL Physics3DObject : public Ref { public: typedef std::function CollisionCallbackFunc; @@ -134,7 +134,7 @@ protected: /** * @brief The description of Physics3DRigidBody. */ -struct CC_DLL Physics3DRigidBodyDes +struct AX_DLL Physics3DRigidBodyDes { float mass; // Note: mass equals zero means static, default 0 axis::Vec3 localInertia; // default (0, 0, 0) @@ -148,7 +148,7 @@ struct CC_DLL Physics3DRigidBodyDes /** * @brief Inherit from Physics3DObject, the main class for rigid body objects */ -class CC_DLL Physics3DRigidBody : public Physics3DObject +class AX_DLL Physics3DRigidBody : public Physics3DObject { friend class Physics3DWorld; @@ -349,7 +349,7 @@ protected: /** * @brief The description of Physics3DCollider. */ -struct CC_DLL Physics3DColliderDes +struct AX_DLL Physics3DColliderDes { /**shape pointer*/ Physics3DShape* shape; @@ -385,7 +385,7 @@ struct CC_DLL Physics3DColliderDes /** * @brief Inherit from Physics3DObject, the main class for Colliders. */ -class CC_DLL Physics3DCollider : public Physics3DObject +class AX_DLL Physics3DCollider : public Physics3DObject { public: /** @@ -495,8 +495,8 @@ protected: NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_OBJECT_H__ diff --git a/core/physics3d/CCPhysics3DShape.cpp b/core/physics3d/CCPhysics3DShape.cpp index cef34c3717..10eed4ac3e 100644 --- a/core/physics3d/CCPhysics3DShape.cpp +++ b/core/physics3d/CCPhysics3DShape.cpp @@ -25,9 +25,9 @@ #include "physics3d/CCPhysics3D.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) # include "bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h" NS_AX_BEGIN @@ -39,19 +39,19 @@ Physics3DShape::ShapeType Physics3DShape::getShapeType() const Physics3DShape::Physics3DShape() : _shapeType(ShapeType::UNKNOWN) { -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) _btShape = nullptr; _heightfieldData = nullptr; # endif } Physics3DShape::~Physics3DShape() { -# if (CC_ENABLE_BULLET_INTEGRATION) - CC_SAFE_DELETE(_btShape); - CC_SAFE_DELETE_ARRAY(_heightfieldData); +# if (AX_ENABLE_BULLET_INTEGRATION) + AX_SAFE_DELETE(_btShape); + AX_SAFE_DELETE_ARRAY(_heightfieldData); for (auto iter : _compoundChildShapes) { - CC_SAFE_RELEASE(iter); + AX_SAFE_RELEASE(iter); } _compoundChildShapes.clear(); # endif @@ -209,7 +209,7 @@ bool Physics3DShape::initCompoundShape(const std::vectoraddChildShape(convertMat4TobtTransform(iter.second), iter.first->getbtShape()); - CC_SAFE_RETAIN(iter.first); + AX_SAFE_RETAIN(iter.first); _compoundChildShapes.push_back(iter.first); } _btShape = compound; @@ -218,6 +218,6 @@ bool Physics3DShape::initCompoundShape(const std::vector>& shapes); -# if CC_ENABLE_BULLET_INTEGRATION +# if AX_ENABLE_BULLET_INTEGRATION btCollisionShape* getbtShape() const { return _btShape; } # endif @@ -158,7 +158,7 @@ public: protected: ShapeType _shapeType; // shape type -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) btCollisionShape* _btShape; unsigned char* _heightfieldData; std::vector _compoundChildShapes; @@ -170,8 +170,8 @@ protected: NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_SHAPE_H__ diff --git a/core/physics3d/CCPhysics3DWorld.cpp b/core/physics3d/CCPhysics3DWorld.cpp index c0b1911730..1ccffe709d 100644 --- a/core/physics3d/CCPhysics3DWorld.cpp +++ b/core/physics3d/CCPhysics3DWorld.cpp @@ -26,9 +26,9 @@ #include "physics3d/CCPhysics3D.h" #include "renderer/CCRenderer.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -49,13 +49,13 @@ Physics3DWorld::~Physics3DWorld() removeAllPhysics3DConstraints(); removeAllPhysics3DObjects(); - CC_SAFE_DELETE(_collisionConfiguration); - CC_SAFE_DELETE(_dispatcher); - CC_SAFE_DELETE(_broadphase); - CC_SAFE_DELETE(_ghostCallback); - CC_SAFE_DELETE(_solver); - CC_SAFE_DELETE(_btPhyiscsWorld); - CC_SAFE_DELETE(_debugDrawer); + AX_SAFE_DELETE(_collisionConfiguration); + AX_SAFE_DELETE(_dispatcher); + AX_SAFE_DELETE(_broadphase); + AX_SAFE_DELETE(_ghostCallback); + AX_SAFE_DELETE(_solver); + AX_SAFE_DELETE(_btPhyiscsWorld); + AX_SAFE_DELETE(_debugDrawer); for (auto it : _physicsComponents) it->setPhysics3DObject(nullptr); _physicsComponents.clear(); @@ -309,7 +309,7 @@ bool Physics3DWorld::sweepShape(Physics3DShape* shape, const axis::Mat4& endTransform, Physics3DWorld::HitResult* result) { - CC_ASSERT(shape->getShapeType() != Physics3DShape::ShapeType::HEIGHT_FIELD && + AX_ASSERT(shape->getShapeType() != Physics3DShape::ShapeType::HEIGHT_FIELD && shape->getShapeType() != Physics3DShape::ShapeType::MESH); auto btStart = convertMat4TobtTransform(startTransform); auto btEnd = convertMat4TobtTransform(endTransform); @@ -423,6 +423,6 @@ void Physics3DWorld::setGhostPairCallback() NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DWorld.h b/core/physics3d/CCPhysics3DWorld.h index 542e2c0186..47fb72521d 100644 --- a/core/physics3d/CCPhysics3DWorld.h +++ b/core/physics3d/CCPhysics3DWorld.h @@ -30,9 +30,9 @@ #include "base/CCRef.h" #include "base/ccConfig.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) class btDynamicsWorld; class btDefaultCollisionConfiguration; @@ -59,7 +59,7 @@ class Renderer; /** * @brief The description of Physics3DWorld. */ -struct CC_DLL Physics3DWorldDes +struct AX_DLL Physics3DWorldDes { bool isDebugDrawEnabled; // using physics debug draw?, false by default axis::Vec3 gravity; // gravity, (0, -9.8, 0) @@ -74,7 +74,7 @@ struct CC_DLL Physics3DWorldDes * @brief The physics information container, include Physics3DObjects, Physics3DConstraints, collision information and * so on. */ -class CC_DLL Physics3DWorld : public Ref +class AX_DLL Physics3DWorld : public Ref { friend class Physics3DComponent; @@ -167,7 +167,7 @@ protected: bool _collisionCheckingFlag; bool _needGhostPairCallbackChecking; -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) btDynamicsWorld* _btPhyiscsWorld; btDefaultCollisionConfiguration* _collisionConfiguration; btCollisionDispatcher* _dispatcher; @@ -175,7 +175,7 @@ protected: btSequentialImpulseConstraintSolver* _solver; btGhostPairCallback* _ghostCallback; Physics3DDebugDrawer* _debugDrawer; -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION }; // end of 3d group @@ -184,6 +184,6 @@ NS_AX_END # endif -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_WORLD_H__ diff --git a/core/physics3d/CCPhysicsMeshRenderer.cpp b/core/physics3d/CCPhysicsMeshRenderer.cpp index 5fdef7d474..3dcd41a611 100644 --- a/core/physics3d/CCPhysicsMeshRenderer.cpp +++ b/core/physics3d/CCPhysicsMeshRenderer.cpp @@ -25,9 +25,9 @@ #include "physics3d/CCPhysics3D.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -46,7 +46,7 @@ PhysicsMeshRenderer* PhysicsMeshRenderer::create(std::string_view modelPath, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -65,7 +65,7 @@ PhysicsMeshRenderer* PhysicsMeshRenderer::createWithCollider(std::string_view mo ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -97,6 +97,6 @@ PhysicsMeshRenderer::~PhysicsMeshRenderer() {} NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysicsMeshRenderer.h b/core/physics3d/CCPhysicsMeshRenderer.h index f0bfdb6a4e..ef434b62f7 100644 --- a/core/physics3d/CCPhysicsMeshRenderer.h +++ b/core/physics3d/CCPhysicsMeshRenderer.h @@ -31,9 +31,9 @@ #include "physics3d/CCPhysics3DObject.h" #include "physics3d/CCPhysics3DComponent.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN /** @@ -44,7 +44,7 @@ NS_AX_BEGIN /** * @brief Convenient class to create a rigid body with a MeshRenderer */ -class CC_DLL PhysicsMeshRenderer : public axis::MeshRenderer +class AX_DLL PhysicsMeshRenderer : public axis::MeshRenderer { public: /** creates a PhysicsMeshRenderer */ @@ -82,8 +82,8 @@ protected: /// @} NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_MESH_RENDERER_H__ diff --git a/core/platform/CCApplication.h b/core/platform/CCApplication.h index 9ab3da2ece..1d96165338 100644 --- a/core/platform/CCApplication.h +++ b/core/platform/CCApplication.h @@ -30,15 +30,15 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_MAC # include "platform/mac/CCApplication-mac.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS # include "platform/ios/CCApplication-ios.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include "platform/android/CCApplication-android.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include "platform/win32/CCApplication-win32.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#elif AX_TARGET_PLATFORM == AX_PLATFORM_LINUX # include "platform/linux/CCApplication-linux.h" #endif diff --git a/core/platform/CCApplicationProtocol.h b/core/platform/CCApplicationProtocol.h index 35bbc95631..6da7553d62 100644 --- a/core/platform/CCApplicationProtocol.h +++ b/core/platform/CCApplicationProtocol.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_APPLICATION_PROTOCOL_H__ -#define __CC_APPLICATION_PROTOCOL_H__ +#ifndef __AX_APPLICATION_PROTOCOL_H__ +#define __AX_APPLICATION_PROTOCOL_H__ #include "platform/CCPlatformMacros.h" #include "base/CCAutoreleasePool.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN * @{ */ -class CC_DLL ApplicationProtocol +class AX_DLL ApplicationProtocol { public: /** Since WINDOWS and ANDROID are defined as macros, we could not just use these keywords in enumeration(Platform). @@ -149,4 +149,4 @@ public: NS_AX_END -#endif // __CC_APPLICATION_PROTOCOL_H__ +#endif // __AX_APPLICATION_PROTOCOL_H__ diff --git a/core/platform/CCCommon.h b/core/platform/CCCommon.h index 7a182cc8b7..073f204e85 100644 --- a/core/platform/CCCommon.h +++ b/core/platform/CCCommon.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_COMMON_H__ -#define __CC_COMMON_H__ +#ifndef __AX_COMMON_H__ +#define __AX_COMMON_H__ /// @cond DO_NOT_SHOW #include "platform/CCPlatformMacros.h" @@ -40,12 +40,12 @@ NS_AX_BEGIN /** * lua can not deal with ... */ -void CC_DLL LuaLog(const char* format); +void AX_DLL LuaLog(const char* format); /** @brief Pop out a message box */ -void CC_DLL ccMessageBox(const char* msg, const char* title); +void AX_DLL ccMessageBox(const char* msg, const char* title); /** @brief Enum the language type supported now @@ -80,4 +80,4 @@ enum class LanguageType NS_AX_END /// @endcond -#endif // __CC_COMMON_H__ +#endif // __AX_COMMON_H__ diff --git a/core/platform/CCDevice.h b/core/platform/CCDevice.h index 0e24daee81..c7c21d51df 100644 --- a/core/platform/CCDevice.h +++ b/core/platform/CCDevice.h @@ -44,7 +44,7 @@ struct FontDefinition; * @class Device * @brief */ -class CC_DLL Device +class AX_DLL Device { public: /** Defines the alignment of text. */ @@ -104,7 +104,7 @@ public: bool& hasPremultipliedAlpha); private: - CC_DISALLOW_IMPLICIT_CONSTRUCTORS(Device); + AX_DISALLOW_IMPLICIT_CONSTRUCTORS(Device); }; // end group diff --git a/core/platform/CCFileStream.h b/core/platform/CCFileStream.h index 9221a9b196..7e2996acec 100644 --- a/core/platform/CCFileStream.h +++ b/core/platform/CCFileStream.h @@ -9,7 +9,7 @@ NS_AX_BEGIN -class CC_DLL FileStream +class AX_DLL FileStream { public: virtual ~FileStream() = default; diff --git a/core/platform/CCFileUtils.cpp b/core/platform/CCFileUtils.cpp index b497a1c83f..8e927f59c2 100644 --- a/core/platform/CCFileUtils.cpp +++ b/core/platform/CCFileUtils.cpp @@ -117,7 +117,7 @@ public: _resultType = SAX_RESULT_DICT; SAXParser parser; - CCASSERT(parser.init("UTF-8"), "The file format isn't UTF-8"); + AXASSERT(parser.init("UTF-8"), "The file format isn't UTF-8"); parser.setDelegator(this); parser.parse(fileName); @@ -129,7 +129,7 @@ public: _resultType = SAX_RESULT_DICT; SAXParser parser; - CCASSERT(parser.init("UTF-8"), "The file format isn't UTF-8"); + AXASSERT(parser.init("UTF-8"), "The file format isn't UTF-8"); parser.setDelegator(this); parser.parse(filedata, filesize); @@ -141,7 +141,7 @@ public: _resultType = SAX_RESULT_ARRAY; SAXParser parser; - CCASSERT(parser.init("UTF-8"), "The file format isn't UTF-8"); + AXASSERT(parser.init("UTF-8"), "The file format isn't UTF-8"); parser.setDelegator(this); parser.parse(fileName); @@ -175,7 +175,7 @@ public: else if (SAX_DICT == preState) { // add a new dictionary into the pre dictionary - CCASSERT(!_dictStack.empty(), "The state is wrong!"); + AXASSERT(!_dictStack.empty(), "The state is wrong!"); ValueMap* preDict = _dictStack.top(); auto& curVal = hlookup::set_item(*preDict, _curKey, Value(ValueMap()))->second; _curDict = &curVal.asValueMap(); @@ -222,7 +222,7 @@ public: } else if (preState == SAX_ARRAY) { - CCASSERT(!_arrayStack.empty(), "The state is wrong!"); + AXASSERT(!_arrayStack.empty(), "The state is wrong!"); ValueVector* preArray = _arrayStack.top(); preArray->push_back(Value(ValueVector())); _curArray = &(_curArray->rbegin())->asValueVector(); @@ -329,7 +329,7 @@ public: { if (curState == SAX_DICT) { - CCASSERT(!_curKey.empty(), "key not found : "); + AXASSERT(!_curKey.empty(), "key not found : "); } _curValue.append(text); @@ -465,7 +465,7 @@ FileUtils* FileUtils::s_sharedFileUtils = nullptr; void FileUtils::destroyInstance() { - CC_SAFE_DELETE(s_sharedFileUtils); + AX_SAFE_DELETE(s_sharedFileUtils); } void FileUtils::setDelegate(FileUtils* delegate) @@ -512,14 +512,14 @@ void FileUtils::writeDataToFile(Data data, std::string_view fullPath, std::funct bool FileUtils::writeBinaryToFile(const void* data, size_t dataSize, std::string_view fullPath) { - CCASSERT(!fullPath.empty() && dataSize > 0, "Invalid parameters."); + AXASSERT(!fullPath.empty() && dataSize > 0, "Invalid parameters."); auto* fileUtils = FileUtils::getInstance(); do { auto fileStream = fileUtils->openFileStream(fullPath, FileStream::Mode::WRITE); // Read the file from hardware - CC_BREAK_IF(!fileStream); + AX_BREAK_IF(!fileStream); fileStream->write(data, static_cast(dataSize)); return true; @@ -711,7 +711,7 @@ std::string FileUtils::fullPathForFilename(std::string_view filename) const if (isPopupNotify()) { - CCLOG("cocos2d: fullPathForFilename: No file found at %s. Possible missing file.", filename.data()); + AXLOG("cocos2d: fullPathForFilename: No file found at %s. Possible missing file.", filename.data()); } // The file wasn't found, return empty string. @@ -762,7 +762,7 @@ std::string FileUtils::fullPathForDirectory(std::string_view dir) const if (isPopupNotify()) { - CCLOG("cocos2d: fullPathForDirectory: No directory found at %s. Possible missing directory.", dir.data()); + AXLOG("cocos2d: fullPathForDirectory: No directory found at %s. Possible missing directory.", dir.data()); } // The file wasn't found, return empty string. @@ -910,7 +910,7 @@ void FileUtils::setSearchPaths(const std::vector& searchPaths) if (!existDefaultRootPath) { - // CCLOG("Default root path doesn't exist, adding it."); + // AXLOG("Default root path doesn't exist, adding it."); _searchPathArray.push_back(_defaultResRootPath); } } @@ -1002,7 +1002,7 @@ bool FileUtils::isAbsolutePathInternal(std::string_view path) bool FileUtils::isDirectoryExist(std::string_view dirPath) const { - CCASSERT(!dirPath.empty(), "Invalid path"); + AXASSERT(!dirPath.empty(), "Invalid path"); DECLARE_GUARD; @@ -1019,7 +1019,7 @@ bool FileUtils::isDirectoryExist(std::string_view dirPath) const void FileUtils::isDirectoryExist(std::string_view fullPath, std::function callback) const { - CCASSERT(isAbsolutePath(fullPath), "Async isDirectoryExist only accepts absolute file paths"); + AXASSERT(isAbsolutePath(fullPath), "Async isDirectoryExist only accepts absolute file paths"); performOperationOffthread( [path = std::string{fullPath}]() -> bool { return FileUtils::getInstance()->isDirectoryExist(path); }, std::move(callback)); @@ -1127,7 +1127,7 @@ std::vector FileUtils::listFiles(std::string_view dirPath) const const auto isDir = entry.is_directory(); if (isDir || entry.is_regular_file()) { -# if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +# if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # if defined(__cpp_lib_char8_t) std::u8string u8path = entry.path().u8string(); std::string pathStr = {u8path.begin(), u8path.end()}; @@ -1159,7 +1159,7 @@ void FileUtils::listFilesRecursively(std::string_view dirPath, std::vector // android doesn't have ftw.h -# if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +# if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) # include # endif @@ -1244,7 +1244,7 @@ bool FileUtils::isDirectoryExistInternal(std::string_view dirPath) const bool FileUtils::createDirectory(std::string_view path) const { - CCASSERT(!path.empty(), "Invalid path"); + AXASSERT(!path.empty(), "Invalid path"); if (isDirectoryExist(path)) return true; @@ -1307,7 +1307,7 @@ bool FileUtils::createDirectory(std::string_view path) const namespace { -# if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +# if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) int unlink_cb(const char* fpath, const struct stat* sb, int typeflag, struct FTW* ftwbuf) { int rv = remove(fpath); @@ -1322,9 +1322,9 @@ int unlink_cb(const char* fpath, const struct stat* sb, int typeflag, struct FTW bool FileUtils::removeDirectory(std::string_view path) const { -# if !defined(CC_TARGET_OS_TVOS) +# if !defined(AX_TARGET_OS_TVOS) -# if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +# if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) if (nftw(path.data(), unlink_cb, 64, FTW_DEPTH | FTW_PHYS) == -1) return false; else @@ -1337,11 +1337,11 @@ bool FileUtils::removeDirectory(std::string_view path) const return true; else return false; -# endif // (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +# endif // (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) # else return false; -# endif // !defined(CC_TARGET_OS_TVOS) +# endif // !defined(AX_TARGET_OS_TVOS) } bool FileUtils::removeFile(std::string_view path) const @@ -1358,14 +1358,14 @@ bool FileUtils::removeFile(std::string_view path) const bool FileUtils::renameFile(std::string_view oldfullpath, std::string_view newfullpath) const { - CCASSERT(!oldfullpath.empty(), "Invalid path"); - CCASSERT(!newfullpath.empty(), "Invalid path"); + AXASSERT(!oldfullpath.empty(), "Invalid path"); + AXASSERT(!newfullpath.empty(), "Invalid path"); int errorCode = rename(oldfullpath.data(), newfullpath.data()); if (0 != errorCode) { - CCLOGERROR("Fail to rename file %s to %s !Error code is %d", oldfullpath.data(), newfullpath.data(), errorCode); + AXLOGERROR("Fail to rename file %s to %s !Error code is %d", oldfullpath.data(), newfullpath.data(), errorCode); return false; } return true; @@ -1373,7 +1373,7 @@ bool FileUtils::renameFile(std::string_view oldfullpath, std::string_view newful bool FileUtils::renameFile(std::string_view path, std::string_view oldname, std::string_view name) const { - CCASSERT(!path.empty(), "Invalid path"); + AXASSERT(!path.empty(), "Invalid path"); std::string oldPath{path}; oldPath += oldname; std::string newPath{path}; @@ -1384,7 +1384,7 @@ bool FileUtils::renameFile(std::string_view path, std::string_view oldname, std: int64_t FileUtils::getFileSize(std::string_view filepath) const { - CCASSERT(!filepath.empty(), "Invalid path"); + AXASSERT(!filepath.empty(), "Invalid path"); std::string_view path; std::string fullpath; diff --git a/core/platform/CCFileUtils.h b/core/platform/CCFileUtils.h index bf663662af..9482b40d78 100644 --- a/core/platform/CCFileUtils.h +++ b/core/platform/CCFileUtils.h @@ -23,8 +23,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_FILEUTILS_H__ -#define __CC_FILEUTILS_H__ +#ifndef __AX_FILEUTILS_H__ +#define __AX_FILEUTILS_H__ #include #include @@ -98,7 +98,7 @@ public: }; /** Helper class to handle file operations. */ -class CC_DLL FileUtils +class AX_DLL FileUtils { public: /** @@ -943,4 +943,4 @@ protected: NS_AX_END -#endif // __CC_FILEUTILS_H__ +#endif // __AX_FILEUTILS_H__ diff --git a/core/platform/CCGL.h b/core/platform/CCGL.h index 054c5c5ac2..8e88c1dc2e 100644 --- a/core/platform/CCGL.h +++ b/core/platform/CCGL.h @@ -31,17 +31,17 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include "platform/android/CCGL-android.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include "platform/win32/CCGL-win32.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#elif AX_TARGET_PLATFORM == AX_PLATFORM_LINUX # include "platform/linux/CCGL-linux.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS # if AX_USE_COMPAT_GL # include "platform/ios/CCGL-ios.h" # endif -#elif CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#elif AX_TARGET_PLATFORM == AX_PLATFORM_MAC # if AX_USE_COMPAT_GL # include "platform/mac/CCGL-mac.h" # endif diff --git a/core/platform/CCGLView.cpp b/core/platform/CCGLView.cpp index 2e83e466d6..67b34fd43c 100644 --- a/core/platform/CCGLView.cpp +++ b/core/platform/CCGLView.cpp @@ -173,7 +173,7 @@ void GLView::updateDesignResolutionSize() void GLView::setDesignResolutionSize(float width, float height, ResolutionPolicy resolutionPolicy) { - CCASSERT(resolutionPolicy != ResolutionPolicy::UNKNOWN, "should set resolutionPolicy"); + AXASSERT(resolutionPolicy != ResolutionPolicy::UNKNOWN, "should set resolutionPolicy"); if (width == 0.0f || height == 0.0f) { @@ -313,7 +313,7 @@ void GLView::handleTouchesBegin(int num, intptr_t ids[], float xs[], float ys[]) // The touches is more than MAX_TOUCHES ? if (unusedIndex == -1) { - CCLOG("The touches is more than MAX_TOUCHES, unusedIndex = %d", unusedIndex); + AXLOG("The touches is more than MAX_TOUCHES, unusedIndex = %d", unusedIndex); continue; } @@ -321,7 +321,7 @@ void GLView::handleTouchesBegin(int num, intptr_t ids[], float xs[], float ys[]) touch->setTouchInfo(unusedIndex, (x - _viewPortRect.origin.x) / _scaleX, (y - _viewPortRect.origin.y) / _scaleY); - CCLOGINFO("x = %f y = %f", touch->getLocationInView().x, touch->getLocationInView().y); + AXLOGINFO("x = %f y = %f", touch->getLocationInView().x, touch->getLocationInView().y); g_touchIdReorderMap.emplace(id, unusedIndex); touchEvent._touches.push_back(touch); @@ -330,7 +330,7 @@ void GLView::handleTouchesBegin(int num, intptr_t ids[], float xs[], float ys[]) if (touchEvent._touches.empty()) { - CCLOG("touchesBegan: size = 0"); + AXLOG("touchesBegan: size = 0"); return; } @@ -364,11 +364,11 @@ void GLView::handleTouchesMove(int num, intptr_t ids[], float xs[], float ys[], auto iter = g_touchIdReorderMap.find(id); if (iter == g_touchIdReorderMap.end()) { - CCLOG("if the index doesn't exist, it is an error"); + AXLOG("if the index doesn't exist, it is an error"); continue; } - CCLOGINFO("Moving touches with id: %d, x=%f, y=%f, force=%f, maxFource=%f", (int)id, x, y, force, maxForce); + AXLOGINFO("Moving touches with id: %d, x=%f, y=%f, force=%f, maxFource=%f", (int)id, x, y, force, maxForce); Touch* touch = g_touches[iter->second]; if (touch) { @@ -380,14 +380,14 @@ void GLView::handleTouchesMove(int num, intptr_t ids[], float xs[], float ys[], else { // It is error, should return. - CCLOG("Moving touches with id: %d error", static_cast(id)); + AXLOG("Moving touches with id: %d error", static_cast(id)); return; } } if (touchEvent._touches.empty()) { - CCLOG("touchesMoved: size = 0"); + AXLOG("touchesMoved: size = 0"); return; } @@ -416,7 +416,7 @@ void GLView::handleTouchesOfEndOrCancel(EventTouch::EventCode eventCode, auto iter = g_touchIdReorderMap.find(id); if (iter == g_touchIdReorderMap.end()) { - CCLOG("if the index doesn't exist, it is an error"); + AXLOG("if the index doesn't exist, it is an error"); continue; } @@ -424,7 +424,7 @@ void GLView::handleTouchesOfEndOrCancel(EventTouch::EventCode eventCode, Touch* touch = g_touches[iter->second]; if (touch) { - CCLOGINFO("Ending touches with id: %d, x=%f, y=%f", (int)id, x, y); + AXLOGINFO("Ending touches with id: %d, x=%f, y=%f", (int)id, x, y); touch->setTouchInfo(iter->second, (x - _viewPortRect.origin.x) / _scaleX, (y - _viewPortRect.origin.y) / _scaleY); @@ -437,14 +437,14 @@ void GLView::handleTouchesOfEndOrCancel(EventTouch::EventCode eventCode, } else { - CCLOG("Ending touches with id: %d error", static_cast(id)); + AXLOG("Ending touches with id: %d error", static_cast(id)); return; } } if (touchEvent._touches.empty()) { - CCLOG("touchesEnded or touchesCancel: size = 0"); + AXLOG("touchesEnded or touchesCancel: size = 0"); return; } @@ -491,8 +491,8 @@ float GLView::getScaleY() const void GLView::renderScene(Scene* scene, Renderer* renderer) { - CCASSERT(scene, "Invalid Scene"); - CCASSERT(renderer, "Invalid Renderer"); + AXASSERT(scene, "Invalid Scene"); + AXASSERT(renderer, "Invalid Renderer"); scene->render(renderer, Mat4::IDENTITY, nullptr); } diff --git a/core/platform/CCGLView.h b/core/platform/CCGLView.h index edc6e2cf27..88c57c9c01 100644 --- a/core/platform/CCGLView.h +++ b/core/platform/CCGLView.h @@ -32,17 +32,17 @@ THE SOFTWARE. #include -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) typedef void* id; -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) -# define CC_ICON_SET_SUPPORT true -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) */ +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +# define AX_ICON_SET_SUPPORT true +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) */ /** There are some Resolution Policy for Adapt to the screen. */ enum class ResolutionPolicy @@ -108,7 +108,7 @@ class Renderer; /** * @brief By GLView you can operate the frame information of EGL view through some function. */ -class CC_DLL GLView : public Ref +class AX_DLL GLView : public Ref { public: /** @@ -219,9 +219,9 @@ public: */ virtual bool isRetinaDisplay() const { return false; } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) virtual void* getEAGLView() const { return nullptr; } -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) */ /** * Get the visible area size of opengl viewport. @@ -416,14 +416,14 @@ public: */ ResolutionPolicy getResolutionPolicy() const { return _resolutionPolicy; } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) virtual HWND getWin32Window() = 0; -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) virtual id getCocoaWindow() = 0; virtual id getNSGLContext() = 0; // stevetranby: added -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) */ /** * Renders a Scene with a Renderer diff --git a/core/platform/CCImage.cpp b/core/platform/CCImage.cpp index c47a0adb79..dc758aa2b8 100644 --- a/core/platform/CCImage.cpp +++ b/core/platform/CCImage.cpp @@ -32,7 +32,7 @@ THE SOFTWARE. #include #include -#include "base/ccConfig.h" // CC_USE_JPEG, CC_USE_WEBP +#include "base/ccConfig.h" // AX_USE_JPEG, AX_USE_WEBP #define STBI_NO_JPEG #define STBI_NO_PNG @@ -43,7 +43,7 @@ THE SOFTWARE. #define STBI_NO_HDR #define STBI_NO_TGA #define STB_IMAGE_IMPLEMENTATION -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS # define STBI_NO_THREAD_LOCALS #endif #include "stb/stb_image.h" @@ -51,7 +51,7 @@ THE SOFTWARE. extern "C" { // To resolve link error when building 32bits with Xcode 6. // More information please refer to the discussion in https://github.com/cocos2d/cocos2d-x/pull/6986 -#if defined(__unix) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if defined(__unix) || (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # ifndef __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ # define __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ # include @@ -93,14 +93,14 @@ struct dirent* readdir$INODE64(DIR* dir) # endif #endif -#if CC_USE_PNG +#if AX_USE_PNG # include "png.h" -#endif // CC_USE_PNG +#endif // AX_USE_PNG -#if CC_USE_JPEG +#if AX_USE_JPEG # include "jpeglib.h" # include -#endif // CC_USE_JPEG +#endif // AX_USE_JPEG } /* extern "C" */ #include "base/ktxspec_v1.h" @@ -115,9 +115,9 @@ struct dirent* readdir$INODE64(DIR* dir) #include "base/astc.h" -#if CC_USE_WEBP +#if AX_USE_WEBP # include "decode.h" -#endif // CC_USE_WEBP +#endif // AX_USE_WEBP #include "base/ccMacros.h" #include "platform/CCCommon.h" @@ -126,7 +126,7 @@ struct dirent* readdir$INODE64(DIR* dir) #include "base/CCConfiguration.h" #include "base/ccUtils.h" #include "base/ZipUtils.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "platform/android/CCFileUtils-android.h" # include "platform/CCGL.h" #endif @@ -422,7 +422,7 @@ typedef struct int offset; } tImageSource; -#if CC_USE_PNG +#if AX_USE_PNG void pngWriteCallback(png_structp png_ptr, png_bytep data, size_t length) { if (png_ptr == NULL) @@ -450,7 +450,7 @@ static void pngReadCallback(png_structp png_ptr, png_bytep data, png_size_t leng png_error(png_ptr, "pngReaderCallback failed"); } } -#endif // CC_USE_PNG +#endif // AX_USE_PNG } // namespace /* @@ -567,12 +567,12 @@ Image::~Image() { if (!_unpack) { - CC_SAFE_FREE(_data); + AX_SAFE_FREE(_data); } else { for (int i = 0; i < _numberOfMipmaps; ++i) - CC_SAFE_FREE(_mipmaps[i].address); + AX_SAFE_FREE(_mipmaps[i].address); } } @@ -621,7 +621,7 @@ bool Image::initWithImageData(uint8_t* data, ssize_t dataLen, bool ownData) do { - CC_BREAK_IF(!data || dataLen == 0); + AX_BREAK_IF(!data || dataLen == 0); uint8_t* unpackedData = nullptr; ssize_t unpackedLen = 0; @@ -693,7 +693,7 @@ bool Image::initWithImageData(uint8_t* data, ssize_t dataLen, bool ownData) } else { - CCLOG("cocos2d: unsupported image format!"); + AXLOG("cocos2d: unsupported image format!"); } free(tgaData); @@ -719,7 +719,7 @@ bool Image::initWithRawData(const uint8_t* data, bool ret = false; do { - CC_BREAK_IF(0 == width || 0 == height); + AX_BREAK_IF(0 == width || 0 == height); _height = height; _width = width; @@ -730,7 +730,7 @@ bool Image::initWithRawData(const uint8_t* data, int bytesPerComponent = 4; _dataLen = height * width * bytesPerComponent; _data = static_cast(malloc(_dataLen)); - CC_BREAK_IF(!_data); + AX_BREAK_IF(!_data); memcpy(_data, data, _dataLen); ret = true; @@ -819,7 +819,7 @@ bool Image::isPvr(const uint8_t* data, ssize_t dataLen) const PVRv3TexHeader* headerv3 = static_cast(static_cast(data)); return memcmp(&headerv2->pvrTag, gPVRTexIdentifier, strlen(gPVRTexIdentifier)) == 0 || - CC_SWAP_INT32_BIG_TO_HOST(headerv3->version) == 0x50565203; + AX_SWAP_INT32_BIG_TO_HOST(headerv3->version) == 0x50565203; } Image::Format Image::detectFormat(const uint8_t* data, ssize_t dataLen) @@ -923,7 +923,7 @@ namespace * * Here's the extended error handler struct: */ -#if CC_USE_JPEG +#if AX_USE_JPEG struct MyErrorMgr { struct jpeg_error_mgr pub; /* "public" fields */ @@ -950,17 +950,17 @@ myErrorExit(j_common_ptr cinfo) //(*cinfo->err->output_message) (cinfo); char buffer[JMSG_LENGTH_MAX]; (*cinfo->err->format_message)(cinfo, buffer); - CCLOG("jpeg error: %s", buffer); + AXLOG("jpeg error: %s", buffer); /* Return control to the setjmp point */ longjmp(myerr->setjmp_buffer, 1); } -#endif // CC_USE_JPEG +#endif // AX_USE_JPEG } // namespace bool Image::initWithJpgData(uint8_t* data, ssize_t dataLen) { -#if CC_USE_JPEG +#if AX_USE_JPEG /* these are standard libjpeg structures for reading(decompression) */ struct jpeg_decompress_struct cinfo; /* We use our private extension JPEG error handler. @@ -991,9 +991,9 @@ bool Image::initWithJpgData(uint8_t* data, ssize_t dataLen) /* setup decompression process and source, then read JPEG header */ jpeg_create_decompress(&cinfo); -# ifndef CC_TARGET_QT5 +# ifndef AX_TARGET_QT5 jpeg_mem_src(&cinfo, const_cast(data), dataLen); -# endif /* CC_TARGET_QT5 */ +# endif /* AX_TARGET_QT5 */ /* reading the image header which contains image information */ # if (JPEG_LIB_VERSION >= 90) @@ -1023,7 +1023,7 @@ bool Image::initWithJpgData(uint8_t* data, ssize_t dataLen) _dataLen = cinfo.output_width * cinfo.output_height * cinfo.output_components; _data = static_cast(malloc(_dataLen)); - CC_BREAK_IF(!_data); + AX_BREAK_IF(!_data); /* now actually read the jpeg into the raw buffer */ /* read one scan line at a time */ @@ -1047,14 +1047,14 @@ bool Image::initWithJpgData(uint8_t* data, ssize_t dataLen) return ret; #else - CCLOG("jpeg is not enabled, please enable it in ccConfig.h"); + AXLOG("jpeg is not enabled, please enable it in ccConfig.h"); return false; -#endif // CC_USE_JPEG +#endif // AX_USE_JPEG } bool Image::initWithPngData(uint8_t* data, ssize_t dataLen) { -#if CC_USE_PNG +#if AX_USE_PNG // length of bytes to check if it is a valid png file # define PNGSIGSIZE 8 bool ret = false; @@ -1065,21 +1065,21 @@ bool Image::initWithPngData(uint8_t* data, ssize_t dataLen) do { // png header len is 8 bytes - CC_BREAK_IF(dataLen < PNGSIGSIZE); + AX_BREAK_IF(dataLen < PNGSIGSIZE); // check the data is png or not memcpy(header, data, PNGSIGSIZE); - CC_BREAK_IF(png_sig_cmp(header, 0, PNGSIGSIZE)); + AX_BREAK_IF(png_sig_cmp(header, 0, PNGSIGSIZE)); // init png_struct png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0); - CC_BREAK_IF(!png_ptr); + AX_BREAK_IF(!png_ptr); // init png_info info_ptr = png_create_info_struct(png_ptr); - CC_BREAK_IF(!info_ptr); + AX_BREAK_IF(!info_ptr); - CC_BREAK_IF(setjmp(png_jmpbuf(png_ptr))); + AX_BREAK_IF(setjmp(png_jmpbuf(png_ptr))); // set the read call back function tImageSource imageSource; @@ -1098,7 +1098,7 @@ bool Image::initWithPngData(uint8_t* data, ssize_t dataLen) png_byte bit_depth = png_get_bit_depth(png_ptr, info_ptr); png_uint_32 color_type = png_get_color_type(png_ptr, info_ptr); - // CCLOG("color type %u", color_type); + // AXLOG("color type %u", color_type); // force palette images to be expanded to 24-bit RGB // it may include alpha channel @@ -1184,9 +1184,9 @@ bool Image::initWithPngData(uint8_t* data, ssize_t dataLen) } else { - // if PNG_PREMULTIPLIED_ALPHA_ENABLED == false && CC_ENABLE_PREMULTIPLIED_ALPHA != 0, + // if PNG_PREMULTIPLIED_ALPHA_ENABLED == false && AX_ENABLE_PREMULTIPLIED_ALPHA != 0, // you must do PMA at shader, such as modify positionTextureColor.frag - _hasPremultipliedAlpha = !!CC_ENABLE_PREMULTIPLIED_ALPHA; + _hasPremultipliedAlpha = !!AX_ENABLE_PREMULTIPLIED_ALPHA; } } @@ -1204,9 +1204,9 @@ bool Image::initWithPngData(uint8_t* data, ssize_t dataLen) } return ret; #else - CCLOG("png is not enabled, please enable it in ccConfig.h"); + AXLOG("png is not enabled, please enable it in ccConfig.h"); return false; -#endif // CC_USE_PNG +#endif // AX_USE_PNG } bool Image::initWithBmpData(uint8_t* data, ssize_t dataLen) @@ -1225,7 +1225,7 @@ bool Image::initWithBmpData(uint8_t* data, ssize_t dataLen) bool Image::initWithWebpData(uint8_t* data, ssize_t dataLen) { -#if CC_USE_WEBP +#if AX_USE_WEBP bool ret = false; do @@ -1265,9 +1265,9 @@ bool Image::initWithWebpData(uint8_t* data, ssize_t dataLen) } while (0); return ret; #else - CCLOG("webp is not enabled, please enable it in ccConfig.h"); + AXLOG("webp is not enabled, please enable it in ccConfig.h"); return false; -#endif // CC_USE_WEBP +#endif // AX_USE_WEBP } bool Image::initWithTGAData(tImageTGA* tgaData) @@ -1276,7 +1276,7 @@ bool Image::initWithTGAData(tImageTGA* tgaData) do { - CC_BREAK_IF(tgaData == nullptr); + AX_BREAK_IF(tgaData == nullptr); // tgaLoadBuffer only support type 2, 3, 10 if (2 == tgaData->type || 10 == tgaData->type) @@ -1297,7 +1297,7 @@ bool Image::initWithTGAData(tImageTGA* tgaData) } else { - CCLOG("Image WARNING: unsupported true color tga data pixel format. FILE: %s", _filePath.c_str()); + AXLOG("Image WARNING: unsupported true color tga data pixel format. FILE: %s", _filePath.c_str()); break; } } @@ -1311,7 +1311,7 @@ bool Image::initWithTGAData(tImageTGA* tgaData) else { // actually this won't happen, if it happens, maybe the image file is not a tga - CCLOG("Image WARNING: unsupported gray tga data pixel format. FILE: %s", _filePath.c_str()); + AXLOG("Image WARNING: unsupported gray tga data pixel format. FILE: %s", _filePath.c_str()); break; } } @@ -1330,7 +1330,7 @@ bool Image::initWithTGAData(tImageTGA* tgaData) { if (FileUtils::getInstance()->getFileExtension(_filePath) != ".tga") { - CCLOG("Image WARNING: the image file suffix is not tga, but parsed as a tga image file. FILE: %s", + AXLOG("Image WARNING: the image file suffix is not tga, but parsed as a tga image file. FILE: %s", _filePath.c_str()); } } @@ -1365,32 +1365,32 @@ bool Image::initWithPVRv2Data(uint8_t* data, ssize_t dataLen, bool ownData) // can not detect the premultiplied alpha from pvr file, use _PVRHaveAlphaPremultiplied instead. _hasPremultipliedAlpha = isCompressedImageHavePMA(CompressedImagePMAFlag::PVR); - unsigned int flags = CC_SWAP_INT32_LITTLE_TO_HOST(header->flags); + unsigned int flags = AX_SWAP_INT32_LITTLE_TO_HOST(header->flags); PVR2TexturePixelFormat formatFlags = static_cast(flags & PVR_TEXTURE_FLAG_TYPE_MASK); bool flipped = (flags & (unsigned int)PVR2TextureFlag::VerticalFlip) ? true : false; if (flipped) { - CCLOG("cocos2d: WARNING: Image is flipped. Regenerate it using PVRTexTool"); + AXLOG("cocos2d: WARNING: Image is flipped. Regenerate it using PVRTexTool"); } if (!configuration->supportsNPOT() && (static_cast(header->width) != ccNextPOT(header->width) || static_cast(header->height) != ccNextPOT(header->height))) { - CCLOG("cocos2d: ERROR: Loading an NPOT texture (%dx%d) but is not supported on this device", header->width, + AXLOG("cocos2d: ERROR: Loading an NPOT texture (%dx%d) but is not supported on this device", header->width, header->height); return false; } if (!testFormatForPvr2TCSupport(formatFlags)) { - CCLOG("cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant", + AXLOG("cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant", (int)formatFlags); return false; } if (v2_pixel_formathash.find(formatFlags) == v2_pixel_formathash.end()) { - CCLOG("cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant", + AXLOG("cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant", (int)formatFlags); return false; } @@ -1400,7 +1400,7 @@ bool Image::initWithPVRv2Data(uint8_t* data, ssize_t dataLen, bool ownData) int bpp = info.bpp; if (!bpp) { - CCLOG("cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant", + AXLOG("cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant", (int)formatFlags); return false; } @@ -1411,8 +1411,8 @@ bool Image::initWithPVRv2Data(uint8_t* data, ssize_t dataLen, bool ownData) _numberOfMipmaps = 0; // Get size of mipmap - _width = width = CC_SWAP_INT32_LITTLE_TO_HOST(header->width); - _height = height = CC_SWAP_INT32_LITTLE_TO_HOST(header->height); + _width = width = AX_SWAP_INT32_LITTLE_TO_HOST(header->width); + _height = height = AX_SWAP_INT32_LITTLE_TO_HOST(header->height); // Move by size of header const int pixelOffset = sizeof(PVRv2TexHeader); @@ -1420,7 +1420,7 @@ bool Image::initWithPVRv2Data(uint8_t* data, ssize_t dataLen, bool ownData) int dataOffset = 0, dataSize = 0; // Get ptr to where data starts.. - int dataLength = CC_SWAP_INT32_LITTLE_TO_HOST(header->dataLength); + int dataLength = AX_SWAP_INT32_LITTLE_TO_HOST(header->dataLength); // Calculate the data size for each texture level and respect the minimum number of blocks while (dataOffset < dataLength) @@ -1430,7 +1430,7 @@ bool Image::initWithPVRv2Data(uint8_t* data, ssize_t dataLen, bool ownData) case PVR2TexturePixelFormat::PVRTC2BPP_RGBA: if (!Configuration::getInstance()->supportsPVRTC()) { - CCLOG("cocos2d: Hardware PVR decoder not present. Using software decoder"); + AXLOG("cocos2d: Hardware PVR decoder not present. Using software decoder"); _unpack = true; _mipmaps[_numberOfMipmaps].len = width * height * 4; _mipmaps[_numberOfMipmaps].address = (uint8_t*)malloc(width * height * 4); @@ -1444,7 +1444,7 @@ bool Image::initWithPVRv2Data(uint8_t* data, ssize_t dataLen, bool ownData) case PVR2TexturePixelFormat::PVRTC4BPP_RGBA: if (!Configuration::getInstance()->supportsPVRTC()) { - CCLOG("cocos2d: Hardware PVR decoder not present. Using software decoder"); + AXLOG("cocos2d: Hardware PVR decoder not present. Using software decoder"); _unpack = true; _mipmaps[_numberOfMipmaps].len = width * height * 4; _mipmaps[_numberOfMipmaps].address = (uint8_t*)malloc(width * height * 4); @@ -1458,7 +1458,7 @@ bool Image::initWithPVRv2Data(uint8_t* data, ssize_t dataLen, bool ownData) case PVR2TexturePixelFormat::BGRA8888: if (!Configuration::getInstance()->supportsBGRA8888()) { - CCLOG("cocos2d: Image. BGRA8888 not supported on this device"); + AXLOG("cocos2d: Image. BGRA8888 not supported on this device"); return false; } default: @@ -1520,9 +1520,9 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) const PVRv3TexHeader* header = static_cast(static_cast(data)); // validate version - if (CC_SWAP_INT32_BIG_TO_HOST(header->version) != 0x50565203) + if (AX_SWAP_INT32_BIG_TO_HOST(header->version) != 0x50565203) { - CCLOG("cocos2d: WARNING: pvr file version mismatch"); + AXLOG("cocos2d: WARNING: pvr file version mismatch"); return false; } @@ -1531,7 +1531,7 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) if (!testFormatForPvr3TCSupport(pixelFormat)) { - CCLOG( + AXLOG( "cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%016llX. Re-encode it with a OpenGL pixel format " "variant", static_cast(pixelFormat)); @@ -1540,7 +1540,7 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) if (v3_pixel_formathash.find(pixelFormat) == v3_pixel_formathash.end()) { - CCLOG( + AXLOG( "cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%016llX. Re-encode it with a OpenGL pixel format " "variant", static_cast(pixelFormat)); @@ -1552,7 +1552,7 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) int bpp = info.bpp; if (!info.bpp) { - CCLOG( + AXLOG( "cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%016llX. Re-encode it with a OpenGL pixel format " "variant", static_cast(pixelFormat)); @@ -1562,7 +1562,7 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) _pixelFormat = finalPixelFormat; // flags - int flags = CC_SWAP_INT32_LITTLE_TO_HOST(header->flags); + int flags = AX_SWAP_INT32_LITTLE_TO_HOST(header->flags); // PVRv3 specifies premultiply alpha in a flag -- should always respect this in PVRv3 files if (flags & (unsigned int)PVR3TextureFlag::PremultipliedAlpha) @@ -1571,8 +1571,8 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) } // sizing - int width = CC_SWAP_INT32_LITTLE_TO_HOST(header->width); - int height = CC_SWAP_INT32_LITTLE_TO_HOST(header->height); + int width = AX_SWAP_INT32_LITTLE_TO_HOST(header->width); + int height = AX_SWAP_INT32_LITTLE_TO_HOST(header->height); _width = width; _height = height; @@ -1584,8 +1584,8 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) int blockSize = 0, widthBlocks = 0, heightBlocks = 0; _numberOfMipmaps = header->numberOfMipmaps; - CCASSERT(_numberOfMipmaps < MIPMAP_MAX, - "Image: Maximum number of mimpaps reached. Increase the CC_MIPMAP_MAX value"); + AXASSERT(_numberOfMipmaps < MIPMAP_MAX, + "Image: Maximum number of mimpaps reached. Increase the AX_MIPMAP_MAX value"); for (int i = 0; i < _numberOfMipmaps; i++) { @@ -1595,7 +1595,7 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) case PVR3TexturePixelFormat::PVRTC2BPP_RGBA: if (!Configuration::getInstance()->supportsPVRTC()) { - CCLOG("cocos2d: Hardware PVR decoder not present. Using software decoder"); + AXLOG("cocos2d: Hardware PVR decoder not present. Using software decoder"); _unpack = true; _mipmaps[i].len = width * height * 4; _mipmaps[i].address = (uint8_t*)malloc(width * height * 4); @@ -1610,7 +1610,7 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) case PVR3TexturePixelFormat::PVRTC4BPP_RGBA: if (!Configuration::getInstance()->supportsPVRTC()) { - CCLOG("cocos2d: Hardware PVR decoder not present. Using software decoder"); + AXLOG("cocos2d: Hardware PVR decoder not present. Using software decoder"); _unpack = true; _mipmaps[i].len = width * height * 4; _mipmaps[i].address = (uint8_t*)malloc(width * height * 4); @@ -1624,7 +1624,7 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) case PVR3TexturePixelFormat::ETC1: if (!Configuration::getInstance()->supportsETC1()) { - CCLOG("cocos2d: Hardware ETC1 decoder not present. Using software decoder"); + AXLOG("cocos2d: Hardware ETC1 decoder not present. Using software decoder"); const int bytePerPixel = 4; _unpack = true; _mipmaps[i].len = width * height * bytePerPixel; @@ -1642,7 +1642,7 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) case PVR3TexturePixelFormat::BGRA8888: if (!Configuration::getInstance()->supportsBGRA8888()) { - CCLOG("cocos2d: Image. BGRA8888 not supported on this device"); + AXLOG("cocos2d: Image. BGRA8888 not supported on this device"); return false; } default: @@ -1673,7 +1673,7 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) } dataOffset += packetLength; - CCASSERT(dataOffset <= pixelLen, "Image: Invalid length"); + AXASSERT(dataOffset <= pixelLen, "Image: Invalid length"); width = MAX(width >> 1, 1); height = MAX(height >> 1, 1); @@ -1735,7 +1735,7 @@ bool Image::initWithETCData(uint8_t* data, ssize_t dataLen, bool ownData) } else { - CCLOG("cocos2d: Hardware ETC1 decoder not present. Using software decoder"); + AXLOG("cocos2d: Hardware ETC1 decoder not present. Using software decoder"); _dataLen = _width * _height * 4; _data = static_cast(malloc(_dataLen)); @@ -1748,7 +1748,7 @@ bool Image::initWithETCData(uint8_t* data, ssize_t dataLen, bool ownData) } // software decode fail, release pixels data - CC_SAFE_FREE(_data); + AX_SAFE_FREE(_data); _dataLen = 0; return false; } @@ -1800,7 +1800,7 @@ bool Image::initWithETC2Data(uint8_t* data, ssize_t dataLen, bool ownData) } else { - CCLOG("cocos2d: Hardware ETC2 decoder not present. Using software decoder"); + AXLOG("cocos2d: Hardware ETC2 decoder not present. Using software decoder"); // if device do not support ETC2, decode texture by software // etc2_decode_image always decode to RGBA8888 @@ -1810,7 +1810,7 @@ bool Image::initWithETC2Data(uint8_t* data, ssize_t dataLen, bool ownData) static_cast(_data), _width, _height) != 0)) { // software decode fail, release pixels data - CC_SAFE_FREE(_data); + AX_SAFE_FREE(_data); _dataLen = 0; break; } @@ -1848,7 +1848,7 @@ bool Image::initWithASTCData(uint8_t* data, ssize_t dataLen, bool ownData) if (block_x < 4 || block_y < 4) { - CCLOG("cocos2d: The ASTC block with and height should be >= 4"); + AXLOG("cocos2d: The ASTC block with and height should be >= 4"); break; } @@ -1887,7 +1887,7 @@ bool Image::initWithASTCData(uint8_t* data, ssize_t dataLen, bool ownData) } else { - CCLOG("cocos2d: Hardware ASTC decoder not present. Using software decoder"); + AXLOG("cocos2d: Hardware ASTC decoder not present. Using software decoder"); _dataLen = _width * _height * 4; _data = static_cast(malloc(_dataLen)); @@ -1895,7 +1895,7 @@ bool Image::initWithASTCData(uint8_t* data, ssize_t dataLen, bool ownData) dataLen - ASTC_HEAD_SIZE, _data, _width, _height, block_x, block_y) != 0)) { - CC_SAFE_FREE(_data); + AX_SAFE_FREE(_data); _dataLen = 0; break; } @@ -1998,7 +1998,7 @@ bool Image::initWithS3TCData(uint8_t* data, ssize_t dataLen, bool ownData) else { // if it is not gles or device do not support S3TC, decode texture by software - CCLOG("cocos2d: Hardware S3TC decoder not present. Using software decoder"); + AXLOG("cocos2d: Hardware S3TC decoder not present. Using software decoder"); int bytePerPixel = 4; unsigned int stride = width * bytePerPixel; @@ -2073,7 +2073,7 @@ bool Image::initWithATITCData(uint8_t* data, ssize_t dataLen, bool ownData) bool hardware = Configuration::getInstance()->supportsATITC(); if (hardware) // compressed data length { - CCLOG("this is atitc H decode"); + AXLOG("this is atitc H decode"); switch (header->glInternalFormat) { @@ -2093,7 +2093,7 @@ bool Image::initWithATITCData(uint8_t* data, ssize_t dataLen, bool ownData) else // decompressed data length { /* if it is not gles or device do not support ATITC, decode texture by software */ - CCLOG("cocos2d: Hardware ATITC decoder not present. Using software decoder"); + AXLOG("cocos2d: Hardware ATITC decoder not present. Using software decoder"); _pixelFormat = backend::PixelFormat::RGBA8; @@ -2197,13 +2197,13 @@ void Image::forwardPixels(uint8_t* data, ssize_t dataLen, int offset, bool ownDa } } -#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) bool Image::saveToFile(std::string_view filename, bool isToRGB) { // only support for backend::PixelFormat::RGB8 or backend::PixelFormat::RGBA8 uncompressed data if (isCompressed() || (_pixelFormat != backend::PixelFormat::RGB8 && _pixelFormat != backend::PixelFormat::RGBA8)) { - CCLOG( + AXLOG( "cocos2d: Image: saveToFile is only support for backend::PixelFormat::RGB8 or backend::PixelFormat::RGBA8 " "uncompressed data for now"); return false; @@ -2221,7 +2221,7 @@ bool Image::saveToFile(std::string_view filename, bool isToRGB) } else { - CCLOG("cocos2d: Image: saveToFile no support file extension(only .png or .jpg) for file: %s", filename.data()); + AXLOG("cocos2d: Image: saveToFile no support file extension(only .png or .jpg) for file: %s", filename.data()); return false; } } @@ -2229,7 +2229,7 @@ bool Image::saveToFile(std::string_view filename, bool isToRGB) bool Image::saveImageToPNG(std::string_view filePath, bool isToRGB) { -#if CC_USE_PNG +#if AX_USE_PNG bool ret = false; do { @@ -2239,7 +2239,7 @@ bool Image::saveImageToPNG(std::string_view filePath, bool isToRGB) auto outStream = FileUtils::getInstance()->openFileStream(filePath, FileStream::Mode::WRITE); - CC_BREAK_IF(nullptr == outStream); + AX_BREAK_IF(nullptr == outStream); png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); @@ -2365,14 +2365,14 @@ bool Image::saveImageToPNG(std::string_view filePath, bool isToRGB) } while (0); return ret; #else - CCLOG("png is not enabled, please enable it in ccConfig.h"); + AXLOG("png is not enabled, please enable it in ccConfig.h"); return false; -#endif // CC_USE_PNG +#endif // AX_USE_PNG } bool Image::saveImageToJPG(std::string_view filePath) { -#if CC_USE_JPEG +#if AX_USE_JPEG bool ret = false; do { @@ -2387,7 +2387,7 @@ bool Image::saveImageToJPG(std::string_view filePath) jpeg_create_compress(&cinfo); outfile = FileUtils::getInstance()->openFileStream(filePath, FileStream::Mode::WRITE); - CC_BREAK_IF(nullptr == outfile); + AX_BREAK_IF(nullptr == outfile); unsigned char* outputBuffer = nullptr; unsigned long outputSize = 0; @@ -2470,21 +2470,21 @@ bool Image::saveImageToJPG(std::string_view filePath) } while (0); return ret; #else - CCLOG("jpeg is not enabled, please enable it in ccConfig.h"); + AXLOG("jpeg is not enabled, please enable it in ccConfig.h"); return false; -#endif // CC_USE_JPEG +#endif // AX_USE_JPEG } void Image::premultiplyAlpha() { -#if CC_ENABLE_PREMULTIPLIED_ALPHA - CCASSERT(_pixelFormat == backend::PixelFormat::RGBA8, "The pixel format should be RGBA8888!"); +#if AX_ENABLE_PREMULTIPLIED_ALPHA + AXASSERT(_pixelFormat == backend::PixelFormat::RGBA8, "The pixel format should be RGBA8888!"); unsigned int* fourBytes = (unsigned int*)_data; for (int i = 0; i < _width * _height; i++) { uint8_t* p = _data + i * 4; - fourBytes[i] = CC_RGB_PREMULTIPLY_ALPHA(p[0], p[1], p[2], p[3]); + fourBytes[i] = AX_RGB_PREMULTIPLY_ALPHA(p[0], p[1], p[2], p[3]); } _hasPremultipliedAlpha = true; @@ -2500,7 +2500,7 @@ static inline uint8_t clamp(int x) void Image::reversePremultipliedAlpha() { - CCASSERT(_pixelFormat == backend::PixelFormat::RGBA8, "The pixel format should be RGBA8888!"); + AXASSERT(_pixelFormat == backend::PixelFormat::RGBA8, "The pixel format should be RGBA8888!"); unsigned int* fourBytes = (unsigned int*)_data; for (int i = 0; i < _width * _height; i++) diff --git a/core/platform/CCImage.h b/core/platform/CCImage.h index b1b3196c05..0af8b9171b 100644 --- a/core/platform/CCImage.h +++ b/core/platform/CCImage.h @@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_IMAGE_H__ -#define __CC_IMAGE_H__ +#ifndef __AX_IMAGE_H__ +#define __AX_IMAGE_H__ #include "base/CCRef.h" #include "renderer/CCTexture2D.h" @@ -35,7 +35,7 @@ THE SOFTWARE. // premultiply alpha, or the effect will be wrong when using other pixel formats in Texture2D, // such as RGB888, RGB5A1 -#define CC_RGB_PREMULTIPLY_ALPHA(vr, vg, vb, va) \ +#define AX_RGB_PREMULTIPLY_ALPHA(vr, vg, vb, va) \ (unsigned)(((unsigned)((uint8_t)(vr) * ((uint8_t)(va) + 1)) >> 8) | \ ((unsigned)((uint8_t)(vg) * ((uint8_t)(va) + 1) >> 8) << 8) | \ ((unsigned)((uint8_t)(vb) * ((uint8_t)(va) + 1) >> 8) << 16) | ((unsigned)(uint8_t)(va) << 24)) @@ -58,7 +58,7 @@ typedef struct _MipmapInfo } MipmapInfo; /** The Image class for loading all images supported by axis . */ -class CC_DLL Image : public Ref +class AX_DLL Image : public Ref { public: friend class TextureCache; @@ -269,4 +269,4 @@ protected: NS_AX_END -#endif // __CC_IMAGE_H__ +#endif // __AX_IMAGE_H__ diff --git a/core/platform/CCPlatformConfig.h b/core/platform/CCPlatformConfig.h index 5b62df246d..e58ac1de88 100644 --- a/core/platform/CCPlatformConfig.h +++ b/core/platform/CCPlatformConfig.h @@ -25,8 +25,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __BASE_CC_PLATFORM_CONFIG_H__ -#define __BASE_CC_PLATFORM_CONFIG_H__ +#ifndef __BASE_AX_PLATFORM_CONFIG_H__ +#define __BASE_AX_PLATFORM_CONFIG_H__ /// @cond DO_NOT_SHOW /** @@ -40,53 +40,53 @@ THE SOFTWARE. ////////////////////////////////////////////////////////////////////////// // define supported target platform macro which CC uses. -#define CC_PLATFORM_UNKNOWN 0 -#define CC_PLATFORM_IOS 1 -#define CC_PLATFORM_ANDROID 2 -#define CC_PLATFORM_WIN32 3 -// #define CC_PLATFORM_MARMALADE 4 -#define CC_PLATFORM_LINUX 5 -// #define CC_PLATFORM_BADA 6 -// #define CC_PLATFORM_BLACKBERRY 7 -#define CC_PLATFORM_MAC 8 -// #define CC_PLATFORM_NACL 9 -// #define CC_PLATFORM_EMSCRIPTEN 10 -// #define CC_PLATFORM_TIZEN 11 -// #define CC_PLATFORM_QT5 12 -// #define CC_PLATFORM_WINRT 13 +#define AX_PLATFORM_UNKNOWN 0 +#define AX_PLATFORM_IOS 1 +#define AX_PLATFORM_ANDROID 2 +#define AX_PLATFORM_WIN32 3 +// #define AX_PLATFORM_MARMALADE 4 +#define AX_PLATFORM_LINUX 5 +// #define AX_PLATFORM_BADA 6 +// #define AX_PLATFORM_BLACKBERRY 7 +#define AX_PLATFORM_MAC 8 +// #define AX_PLATFORM_NACL 9 +// #define AX_PLATFORM_EMSCRIPTEN 10 +// #define AX_PLATFORM_TIZEN 11 +// #define AX_PLATFORM_QT5 12 +// #define AX_PLATFORM_WINRT 13 // Determine target platform by compile environment macro. -#define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN +#define AX_TARGET_PLATFORM AX_PLATFORM_UNKNOWN // Apple: Mac and iOS #if defined(__APPLE__) && !defined(__ANDROID__) // exclude android for binding generator. # include # if TARGET_OS_IPHONE // TARGET_OS_IPHONE includes TARGET_OS_IOS TARGET_OS_TV and TARGET_OS_WATCH. see // TargetConditionals.h -# undef CC_TARGET_PLATFORM -# define CC_TARGET_PLATFORM CC_PLATFORM_IOS +# undef AX_TARGET_PLATFORM +# define AX_TARGET_PLATFORM AX_PLATFORM_IOS # elif TARGET_OS_MAC -# undef CC_TARGET_PLATFORM -# define CC_TARGET_PLATFORM CC_PLATFORM_MAC +# undef AX_TARGET_PLATFORM +# define AX_TARGET_PLATFORM AX_PLATFORM_MAC # endif #endif // android #if defined(__ANDROID__) -# undef CC_TARGET_PLATFORM -# define CC_TARGET_PLATFORM CC_PLATFORM_ANDROID +# undef AX_TARGET_PLATFORM +# define AX_TARGET_PLATFORM AX_PLATFORM_ANDROID #endif // win32 #if defined(_WIN32) && defined(_WINDOWS) -# undef CC_TARGET_PLATFORM -# define CC_TARGET_PLATFORM CC_PLATFORM_WIN32 +# undef AX_TARGET_PLATFORM +# define AX_TARGET_PLATFORM AX_PLATFORM_WIN32 #endif // linux #if defined(LINUX) && !defined(__APPLE__) -# undef CC_TARGET_PLATFORM -# define CC_TARGET_PLATFORM CC_PLATFORM_LINUX +# undef AX_TARGET_PLATFORM +# define AX_TARGET_PLATFORM AX_PLATFORM_LINUX #endif ////////////////////////////////////////////////////////////////////////// @@ -94,15 +94,15 @@ THE SOFTWARE. ////////////////////////////////////////////////////////////////////////// // check user set platform -#if !CC_TARGET_PLATFORM +#if !AX_TARGET_PLATFORM # error "Cannot recognize the target platform; are you targeting an unsupported platform?" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # ifndef __MINGW32__ # pragma warning(disable : 4127) # endif -#endif // CC_PLATFORM_WIN32 +#endif // AX_PLATFORM_WIN32 /* windows: https://github.com/google/angle @@ -114,35 +114,35 @@ other: GL # define AX_USE_COMPAT_GL 0 #endif -#if ((CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)) -# define CC_PLATFORM_MOBILE +#if ((AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || (AX_TARGET_PLATFORM == AX_PLATFORM_IOS)) +# define AX_PLATFORM_MOBILE #else -# define CC_PLATFORM_PC +# define AX_PLATFORM_PC #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # if !AX_USE_COMPAT_GL -# define CC_USE_METAL +# define AX_USE_METAL # else -# define CC_USE_GL +# define AX_USE_GL # endif -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # if !AX_USE_COMPAT_GL -# define CC_USE_METAL +# define AX_USE_METAL # else -# define CC_USE_GLES +# define AX_USE_GLES # endif -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -# define CC_USE_GLES -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +# define AX_USE_GLES +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # if !AX_USE_COMPAT_GL -# define CC_USE_GL +# define AX_USE_GL # else -# define CC_USE_GLES +# define AX_USE_GLES # endif #else -# define CC_USE_GL +# define AX_USE_GL #endif /// @endcond -#endif // __BASE_CC_PLATFORM_CONFIG_H__ +#endif // __BASE_AX_PLATFORM_CONFIG_H__ diff --git a/core/platform/CCPlatformDefine.h b/core/platform/CCPlatformDefine.h index 5e4371bc14..843d4b1574 100644 --- a/core/platform/CCPlatformDefine.h +++ b/core/platform/CCPlatformDefine.h @@ -29,14 +29,14 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_MAC # include "platform/mac/CCPlatformDefine-mac.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS # include "platform/ios/CCPlatformDefine-ios.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include "platform/android/CCPlatformDefine-android.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include "platform/win32/CCPlatformDefine-win32.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#elif AX_TARGET_PLATFORM == AX_PLATFORM_LINUX # include "platform/linux/CCPlatformDefine-linux.h" #endif diff --git a/core/platform/CCPlatformMacros.h b/core/platform/CCPlatformMacros.h index d29e60d8d6..e8b48d159e 100644 --- a/core/platform/CCPlatformMacros.h +++ b/core/platform/CCPlatformMacros.h @@ -25,8 +25,8 @@ Copyright (c) 2021 Bytedance Inc. THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PLATFORM_MACROS_H__ -#define __CC_PLATFORM_MACROS_H__ +#ifndef __AX_PLATFORM_MACROS_H__ +#define __AX_PLATFORM_MACROS_H__ /** * Define some platform specific macros. @@ -65,7 +65,7 @@ Copyright (c) 2021 Bytedance Inc. * @deprecated This interface will be deprecated sooner or later. */ #define NODE_FUNC(__TYPE__) \ - CC_DEPRECATED_ATTRIBUTE static __TYPE__* node() \ + AX_DEPRECATED_ATTRIBUTE static __TYPE__* node() \ { \ __TYPE__* pRet = new __TYPE__(); \ if (pRet->init()) \ @@ -81,26 +81,26 @@ Copyright (c) 2021 Bytedance Inc. } \ } -/** @def CC_ENABLE_CACHE_TEXTURE_DATA +/** @def AX_ENABLE_CACHE_TEXTURE_DATA * Enable it if you want to cache the texture data. * Not enabling for Emscripten any more -- doesn't seem necessary and don't want * to be different from other platforms unless there's a good reason. * * @since v0.99.5 */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -# define CC_ENABLE_CACHE_TEXTURE_DATA 1 +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +# define AX_ENABLE_CACHE_TEXTURE_DATA 1 #else -# define CC_ENABLE_CACHE_TEXTURE_DATA 0 +# define AX_ENABLE_CACHE_TEXTURE_DATA 0 #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) /** Application will crash in glDrawElements function on some win32 computers and some android devices. * Indices should be bound again while drawing to avoid this bug. */ -# define CC_REBIND_INDICES_BUFFER 1 +# define AX_REBIND_INDICES_BUFFER 1 #else -# define CC_REBIND_INDICES_BUFFER 0 +# define AX_REBIND_INDICES_BUFFER 0 #endif // Generic macros @@ -126,31 +126,31 @@ namespace ax = axis; // end of namespace group /// @} -/** @def CC_PROPERTY_READONLY +/** @def AX_PROPERTY_READONLY * It is used to declare a protected variable. We can use getter to read the variable. * * @param varType the type of variable. * @param varName variable name. * @param funName "get + funName" will be the name of the getter. * @warning The getter is a public virtual function, you should rewrite it first. - * The variables and methods declared after CC_PROPERTY_READONLY are all public. + * The variables and methods declared after AX_PROPERTY_READONLY are all public. * If you need protected or private, please declare. */ -#define CC_PROPERTY_READONLY(varType, varName, funName) \ +#define AX_PROPERTY_READONLY(varType, varName, funName) \ protected: \ varType varName; \ \ public: \ virtual varType get##funName() const; -#define CC_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName) \ +#define AX_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName) \ protected: \ varType varName; \ \ public: \ virtual const varType& get##funName() const; -/** @def CC_PROPERTY +/** @def AX_PROPERTY * It is used to declare a protected variable. * We can use getter to read the variable, and use the setter to change the variable. * @@ -159,10 +159,10 @@ public: \ * @param funName "get + funName" will be the name of the getter. * "set + funName" will be the name of the setter. * @warning The getter and setter are public virtual functions, you should rewrite them first. - * The variables and methods declared after CC_PROPERTY are all public. + * The variables and methods declared after AX_PROPERTY are all public. * If you need protected or private, please declare. */ -#define CC_PROPERTY(varType, varName, funName) \ +#define AX_PROPERTY(varType, varName, funName) \ protected: \ varType varName; \ \ @@ -170,7 +170,7 @@ public: \ virtual varType get##funName() const; \ virtual void set##funName(varType var); -#define CC_PROPERTY_PASS_BY_REF(varType, varName, funName) \ +#define AX_PROPERTY_PASS_BY_REF(varType, varName, funName) \ protected: \ varType varName; \ \ @@ -178,31 +178,31 @@ public: \ virtual const varType& get##funName() const; \ virtual void set##funName(const varType& var); -/** @def CC_SYNTHESIZE_READONLY +/** @def AX_SYNTHESIZE_READONLY * It is used to declare a protected variable. We can use getter to read the variable. * * @param varType The type of variable. * @param varName Variable name. * @param funName "get + funName" will be the name of the getter. * @warning The getter is a public inline function. - * The variables and methods declared after CC_SYNTHESIZE_READONLY are all public. + * The variables and methods declared after AX_SYNTHESIZE_READONLY are all public. * If you need protected or private, please declare. */ -#define CC_SYNTHESIZE_READONLY(varType, varName, funName) \ +#define AX_SYNTHESIZE_READONLY(varType, varName, funName) \ protected: \ varType varName; \ \ public: \ virtual inline varType get##funName() const { return varName; } -#define CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName) \ +#define AX_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName) \ protected: \ varType varName; \ \ public: \ virtual inline const varType& get##funName() const { return varName; } -/** @def CC_SYNTHESIZE +/** @def AX_SYNTHESIZE * It is used to declare a protected variable. * We can use getter to read the variable, and use the setter to change the variable. * @@ -211,10 +211,10 @@ public: \ * @param funName "get + funName" will be the name of the getter. * "set + funName" will be the name of the setter. * @warning The getter and setter are public inline functions. - * The variables and methods declared after CC_SYNTHESIZE are all public. + * The variables and methods declared after AX_SYNTHESIZE are all public. * If you need protected or private, please declare. */ -#define CC_SYNTHESIZE(varType, varName, funName) \ +#define AX_SYNTHESIZE(varType, varName, funName) \ protected: \ varType varName; \ \ @@ -222,7 +222,7 @@ public: \ virtual inline varType get##funName() const { return varName; } \ virtual inline void set##funName(varType var) { varName = var; } -#define CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName) \ +#define AX_SYNTHESIZE_PASS_BY_REF(varType, varName, funName) \ protected: \ varType varName; \ \ @@ -230,7 +230,7 @@ public: \ virtual inline const varType& get##funName() const { return varName; } \ virtual inline void set##funName(const varType& var) { varName = var; } -#define CC_SYNTHESIZE_RETAIN(varType, varName, funName) \ +#define AX_SYNTHESIZE_RETAIN(varType, varName, funName) \ private: \ varType varName; \ \ @@ -240,19 +240,19 @@ public: \ { \ if (varName != var) \ { \ - CC_SAFE_RETAIN(var); \ - CC_SAFE_RELEASE(varName); \ + AX_SAFE_RETAIN(var); \ + AX_SAFE_RELEASE(varName); \ varName = var; \ } \ } -#define CC_SAFE_DELETE(p) \ +#define AX_SAFE_DELETE(p) \ do \ { \ delete (p); \ (p) = nullptr; \ } while (0) -#define CC_SAFE_DELETE_ARRAY(p) \ +#define AX_SAFE_DELETE_ARRAY(p) \ do \ { \ if (p) \ @@ -261,7 +261,7 @@ public: \ (p) = nullptr; \ } \ } while (0) -#define CC_SAFE_FREE(p) \ +#define AX_SAFE_FREE(p) \ do \ { \ if (p) \ @@ -270,7 +270,7 @@ public: \ (p) = nullptr; \ } \ } while (0) -#define CC_SAFE_RELEASE(p) \ +#define AX_SAFE_RELEASE(p) \ do \ { \ if (p) \ @@ -278,7 +278,7 @@ public: \ (p)->release(); \ } \ } while (0) -#define CC_SAFE_RELEASE_NULL(p) \ +#define AX_SAFE_RELEASE_NULL(p) \ do \ { \ if (p) \ @@ -287,7 +287,7 @@ public: \ (p) = nullptr; \ } \ } while (0) -#define CC_SAFE_RETAIN(p) \ +#define AX_SAFE_RETAIN(p) \ do \ { \ if (p) \ @@ -295,51 +295,51 @@ public: \ (p)->retain(); \ } \ } while (0) -#define CC_BREAK_IF(cond) \ +#define AX_BREAK_IF(cond) \ if (cond) \ break -#define __CCLOGWITHFUNCTION(s, ...) \ +#define __AXLOGWITHFUNCTION(s, ...) \ axis::log("%s : %s", __FUNCTION__, axis::StringUtils::format(s, ##__VA_ARGS__).c_str()) /// @name Cocos2d debug /// @{ -#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 -# define CCLOG(...) \ +#if !defined(AXIS_DEBUG) || AXIS_DEBUG == 0 +# define AXLOG(...) \ do \ { \ } while (0) -# define CCLOGINFO(...) \ +# define AXLOGINFO(...) \ do \ { \ } while (0) -# define CCLOGERROR(...) \ +# define AXLOGERROR(...) \ do \ { \ } while (0) -# define CCLOGWARN(...) \ +# define AXLOGWARN(...) \ do \ { \ } while (0) -#elif COCOS2D_DEBUG == 1 -# define CCLOG(format, ...) axis::log(format, ##__VA_ARGS__) -# define CCLOGERROR(format, ...) axis::log(format, ##__VA_ARGS__) -# define CCLOGINFO(format, ...) \ +#elif AXIS_DEBUG == 1 +# define AXLOG(format, ...) axis::log(format, ##__VA_ARGS__) +# define AXLOGERROR(format, ...) axis::log(format, ##__VA_ARGS__) +# define AXLOGINFO(format, ...) \ do \ { \ } while (0) -# define CCLOGWARN(...) __CCLOGWITHFUNCTION(__VA_ARGS__) +# define AXLOGWARN(...) __AXLOGWITHFUNCTION(__VA_ARGS__) -#elif COCOS2D_DEBUG > 1 -# define CCLOG(format, ...) axis::log(format, ##__VA_ARGS__) -# define CCLOGERROR(format, ...) axis::log(format, ##__VA_ARGS__) -# define CCLOGINFO(format, ...) axis::log(format, ##__VA_ARGS__) -# define CCLOGWARN(...) __CCLOGWITHFUNCTION(__VA_ARGS__) -#endif // COCOS2D_DEBUG +#elif AXIS_DEBUG > 1 +# define AXLOG(format, ...) axis::log(format, ##__VA_ARGS__) +# define AXLOGERROR(format, ...) axis::log(format, ##__VA_ARGS__) +# define AXLOGINFO(format, ...) axis::log(format, ##__VA_ARGS__) +# define AXLOGWARN(...) __AXLOGWITHFUNCTION(__VA_ARGS__) +#endif // AXIS_DEBUG /** Lua engine debug */ -#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 || CC_LUA_ENGINE_DEBUG == 0 +#if !defined(AXIS_DEBUG) || AXIS_DEBUG == 0 || AX_LUA_ENGINE_DEBUG == 0 # define LUALOG(...) #else # define LUALOG(format, ...) axis::log(format, ##__VA_ARGS__) @@ -348,22 +348,22 @@ public: \ // end of debug group /// @} -/** @def CC_DISALLOW_COPY_AND_ASSIGN(TypeName) +/** @def AX_DISALLOW_COPY_AND_ASSIGN(TypeName) * A macro to disallow the copy constructor and operator= functions. * This should be used in the private: declarations for a class */ #if defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUG__ == 4) && (__GNUC_MINOR__ >= 4))) || \ (defined(__clang__) && (__clang_major__ >= 3)) || (_MSC_VER >= 1800) -# define CC_DISALLOW_COPY_AND_ASSIGN(TypeName) \ +# define AX_DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&) = delete; \ TypeName& operator=(const TypeName&) = delete; #else -# define CC_DISALLOW_COPY_AND_ASSIGN(TypeName) \ +# define AX_DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ TypeName& operator=(const TypeName&); #endif -/** @def CC_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) +/** @def AX_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) * A macro to disallow all the implicit constructors, namely the * default constructor, copy constructor and operator= functions. * @@ -371,68 +371,68 @@ public: \ * that wants to prevent anyone from instantiating it. This is * especially useful for classes containing only static methods. */ -#define CC_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ +#define AX_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ TypeName(); \ - CC_DISALLOW_COPY_AND_ASSIGN(TypeName) + AX_DISALLOW_COPY_AND_ASSIGN(TypeName) -/** @def CC_DEPRECATED_ATTRIBUTE +/** @def AX_DEPRECATED_ATTRIBUTE * Only certain compilers support __attribute__((deprecated)). */ #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) -# define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) +# define AX_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) #elif _MSC_VER >= 1400 // vs 2005 or higher -# define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated) +# define AX_DEPRECATED_ATTRIBUTE __declspec(deprecated) #else -# define CC_DEPRECATED_ATTRIBUTE +# define AX_DEPRECATED_ATTRIBUTE #endif -/** @def CC_DEPRECATED(...) +/** @def AX_DEPRECATED(...) * Macro to mark things deprecated as of a particular version * can be used with arbitrary parameters which are thrown away. - * e.g. CC_DEPRECATED(4.0) or CC_DEPRECATED(4.0, "not going to need this anymore") etc. + * e.g. AX_DEPRECATED(4.0) or AX_DEPRECATED(4.0, "not going to need this anymore") etc. */ -#define CC_DEPRECATED(...) CC_DEPRECATED_ATTRIBUTE +#define AX_DEPRECATED(...) AX_DEPRECATED_ATTRIBUTE -/** @def CC_FORMAT_PRINTF(formatPos, argPos) +/** @def AX_FORMAT_PRINTF(formatPos, argPos) * Only certain compiler support __attribute__((format)) * * @param formatPos 1-based position of format string argument. * @param argPos 1-based position of first format-dependent argument. */ #if defined(__GNUC__) && (__GNUC__ >= 4) -# define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) +# define AX_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) #elif defined(__has_attribute) # if __has_attribute(format) -# define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) +# define AX_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) # else -# define CC_FORMAT_PRINTF(formatPos, argPos) +# define AX_FORMAT_PRINTF(formatPos, argPos) # endif // __has_attribute(format) #else -# define CC_FORMAT_PRINTF(formatPos, argPos) +# define AX_FORMAT_PRINTF(formatPos, argPos) #endif #if defined(_MSC_VER) -# define CC_FORMAT_PRINTF_SIZE_T "%08lX" +# define AX_FORMAT_PRINTF_SIZE_T "%08lX" #else -# define CC_FORMAT_PRINTF_SIZE_T "%08zX" +# define AX_FORMAT_PRINTF_SIZE_T "%08zX" #endif #ifdef __GNUC__ -# define CC_UNUSED __attribute__((unused)) +# define AX_UNUSED __attribute__((unused)) #else -# define CC_UNUSED +# define AX_UNUSED #endif -/** @def CC_REQUIRES_NULL_TERMINATION +/** @def AX_REQUIRES_NULL_TERMINATION * */ -#if !defined(CC_REQUIRES_NULL_TERMINATION) -# if defined(__APPLE_CC__) && (__APPLE_CC__ >= 5549) -# define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel(0, 1))) +#if !defined(AX_REQUIRES_NULL_TERMINATION) +# if defined(__APPLE_AX__) && (__APPLE_AX__ >= 5549) +# define AX_REQUIRES_NULL_TERMINATION __attribute__((sentinel(0, 1))) # elif defined(__GNUC__) -# define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel)) +# define AX_REQUIRES_NULL_TERMINATION __attribute__((sentinel)) # else -# define CC_REQUIRES_NULL_TERMINATION +# define AX_REQUIRES_NULL_TERMINATION # endif #endif @@ -460,4 +460,4 @@ public: \ # define UTILS_UNLIKELY(exp) (!!(exp)) #endif -#endif // __CC_PLATFORM_MACROS_H__ +#endif // __AX_PLATFORM_MACROS_H__ diff --git a/core/platform/CCPosixFileStream.cpp b/core/platform/CCPosixFileStream.cpp index 83692837ac..89c93c6acb 100644 --- a/core/platform/CCPosixFileStream.cpp +++ b/core/platform/CCPosixFileStream.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2020 C4games Ltd #include "platform/CCPosixFileStream.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include "base/ZipUtils.h" #endif @@ -76,7 +76,7 @@ static long long pfs_posix_size(PXFileHandle& handle) static PXIoF pfs_posix_iof = {pfs_posix_read, pfs_posix_seek, pfs_posix_close, pfs_posix_size}; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID // android AssetManager wrappers static int pfs_asset_read(PXFileHandle& handle, void* buf, unsigned int size) { @@ -130,7 +130,7 @@ PosixFileStream::~PosixFileStream() bool PosixFileStream::open(std::string_view path, FileStream::Mode mode) { bool ok = false; -#if CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID ok = pfs_posix_open(path, mode, _handle) != -1; #else // Android if (path[0] != '/') @@ -223,7 +223,7 @@ int64_t PosixFileStream::size() bool PosixFileStream::isOpen() const { -#if CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID return _handle._fd != -1; #else return _handle._fd != -1 && _handle._asset != nullptr; diff --git a/core/platform/CCPosixFileStream.h b/core/platform/CCPosixFileStream.h index 52804def31..1908abce5c 100644 --- a/core/platform/CCPosixFileStream.h +++ b/core/platform/CCPosixFileStream.h @@ -5,7 +5,7 @@ #include "platform/CCFileStream.h" #include "platform/CCPlatformConfig.h" #include -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include # include #else @@ -17,7 +17,7 @@ #include "platform/CCPlatformMacros.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include "platform/android/CCFileUtils-android.h" # include # include @@ -70,7 +70,7 @@ struct UnzFileStream; union PXFileHandle { int _fd = -1; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID AAsset* _asset; ZipFileStream _zfs; #endif @@ -78,7 +78,7 @@ union PXFileHandle struct PXIoF; -class CC_DLL PosixFileStream : public FileStream +class AX_DLL PosixFileStream : public FileStream { public: PosixFileStream() = default; diff --git a/core/platform/CCSAXParser.cpp b/core/platform/CCSAXParser.cpp index 1819e63df0..7111f0daec 100644 --- a/core/platform/CCSAXParser.cpp +++ b/core/platform/CCSAXParser.cpp @@ -54,23 +54,23 @@ public: if (!_curEleAttrs.empty()) { _curEleAttrs.push_back(nullptr); - SAXParser::startElement(_ccsaxParserImp, (const CC_XML_CHAR*)_curEleName.c_str(), - (const CC_XML_CHAR**)&_curEleAttrs[0]); + SAXParser::startElement(_ccsaxParserImp, (const AX_XML_CHAR*)_curEleName.c_str(), + (const AX_XML_CHAR**)&_curEleAttrs[0]); _curEleAttrs.clear(); } else { const char* attr = nullptr; const char** attrs = &attr; - SAXParser::startElement(_ccsaxParserImp, (const CC_XML_CHAR*)_curEleName.c_str(), - (const CC_XML_CHAR**)attrs); + SAXParser::startElement(_ccsaxParserImp, (const AX_XML_CHAR*)_curEleName.c_str(), + (const AX_XML_CHAR**)attrs); } }; _sax3Handler.xml_end_element_cb = [=](const char* name, size_t len) { - SAXParser::endElement(_ccsaxParserImp, (const CC_XML_CHAR*)name); + SAXParser::endElement(_ccsaxParserImp, (const AX_XML_CHAR*)name); }; _sax3Handler.xml_text_cb = [=](const char* s, size_t len) { - SAXParser::textHandler(_ccsaxParserImp, (const CC_XML_CHAR*)s, len); + SAXParser::textHandler(_ccsaxParserImp, (const AX_XML_CHAR*)s, len); }; }; @@ -132,23 +132,23 @@ bool SAXParser::parseIntrusive(char* xmlData, size_t dataLength) } catch (xsxml::parse_error& e) { - CCLOG("cocos2d: SAXParser: Error parsing xml: %s at %s", e.what(), e.where()); + AXLOG("cocos2d: SAXParser: Error parsing xml: %s at %s", e.what(), e.where()); return false; } return false; } -void SAXParser::startElement(void* ctx, const CC_XML_CHAR* name, const CC_XML_CHAR** atts) +void SAXParser::startElement(void* ctx, const AX_XML_CHAR* name, const AX_XML_CHAR** atts) { ((SAXParser*)(ctx))->_delegator->startElement(ctx, (char*)name, (const char**)atts); } -void SAXParser::endElement(void* ctx, const CC_XML_CHAR* name) +void SAXParser::endElement(void* ctx, const AX_XML_CHAR* name) { ((SAXParser*)(ctx))->_delegator->endElement(ctx, (char*)name); } -void SAXParser::textHandler(void* ctx, const CC_XML_CHAR* name, size_t len) +void SAXParser::textHandler(void* ctx, const AX_XML_CHAR* name, size_t len) { ((SAXParser*)(ctx))->_delegator->textHandler(ctx, (char*)name, len); } diff --git a/core/platform/CCSAXParser.h b/core/platform/CCSAXParser.h index 2de23a8484..1c19681f65 100644 --- a/core/platform/CCSAXParser.h +++ b/core/platform/CCSAXParser.h @@ -37,9 +37,9 @@ NS_AX_BEGIN * @{ */ -typedef unsigned char CC_XML_CHAR; +typedef unsigned char AX_XML_CHAR; -class CC_DLL SAXDelegator +class AX_DLL SAXDelegator { public: virtual ~SAXDelegator() {} @@ -61,7 +61,7 @@ public: virtual void textHandler(void* ctx, const char* s, size_t len) = 0; }; -class CC_DLL SAXParser +class AX_DLL SAXParser { SAXDelegator* _delegator; @@ -106,17 +106,17 @@ public: * @js NA * @lua NA */ - static void startElement(void* ctx, const CC_XML_CHAR* name, const CC_XML_CHAR** atts); + static void startElement(void* ctx, const AX_XML_CHAR* name, const AX_XML_CHAR** atts); /** * @js NA * @lua NA */ - static void endElement(void* ctx, const CC_XML_CHAR* name); + static void endElement(void* ctx, const AX_XML_CHAR* name); /** * @js NA * @lua NA */ - static void textHandler(void* ctx, const CC_XML_CHAR* name, size_t len); + static void textHandler(void* ctx, const AX_XML_CHAR* name, size_t len); }; // end of platform group diff --git a/core/platform/CCStdC.h b/core/platform/CCStdC.h index ed0cd377fa..0f3283e99d 100644 --- a/core/platform/CCStdC.h +++ b/core/platform/CCStdC.h @@ -29,15 +29,15 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_MAC # include "platform/mac/CCStdC-mac.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS # include "platform/ios/CCStdC-ios.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include "platform/android/CCStdC-android.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include "platform/win32/CCStdC-win32.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#elif AX_TARGET_PLATFORM == AX_PLATFORM_LINUX # include "platform/linux/CCStdC-linux.h" #endif diff --git a/core/platform/android/CCApplication-android.h b/core/platform/android/CCApplication-android.h index dfa56b4383..a3b2d8ff00 100644 --- a/core/platform/android/CCApplication-android.h +++ b/core/platform/android/CCApplication-android.h @@ -30,7 +30,7 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL Application : public ApplicationProtocol +class AX_DLL Application : public ApplicationProtocol { public: /** @@ -61,7 +61,7 @@ public: static Application* getInstance(); /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); + AX_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); /** @brief Get current language config diff --git a/core/platform/android/CCDevice-android.cpp b/core/platform/android/CCDevice-android.cpp index 4de8d440e4..ec82e189e6 100644 --- a/core/platform/android/CCDevice-android.cpp +++ b/core/platform/android/CCDevice-android.cpp @@ -82,7 +82,7 @@ public: "createTextBitmapShadowStroke", "([BLjava/lang/String;IIIIIIIIZFFFFZIIIIFZI)Z")) { - CCLOG("%s %d: error to get methodInfo", __FILE__, __LINE__); + AXLOG("%s %d: error to get methodInfo", __FILE__, __LINE__); return false; } diff --git a/core/platform/android/CCEnhanceAPI-android.h b/core/platform/android/CCEnhanceAPI-android.h index 04b7db35a9..2492975d61 100644 --- a/core/platform/android/CCEnhanceAPI-android.h +++ b/core/platform/android/CCEnhanceAPI-android.h @@ -24,7 +24,7 @@ NS_AX_BEGIN * Note: The minimum required Android version is 5.0. * */ -class CC_DLL EnhanceAPI +class AX_DLL EnhanceAPI { public: /** diff --git a/core/platform/android/CCFileUtils-android.cpp b/core/platform/android/CCFileUtils-android.cpp index b80eda88c7..980358ee3c 100644 --- a/core/platform/android/CCFileUtils-android.cpp +++ b/core/platform/android/CCFileUtils-android.cpp @@ -73,7 +73,7 @@ FileUtils* FileUtils::getInstance() { delete s_sharedFileUtils; s_sharedFileUtils = nullptr; - CCLOG("ERROR: Could not init CCFileUtilsAndroid"); + AXLOG("ERROR: Could not init CCFileUtilsAndroid"); } } return s_sharedFileUtils; @@ -140,7 +140,7 @@ bool FileUtilsAndroid::isFileExistInternal(std::string_view strFilePath) const } else { - // CCLOG("[AssetManager] ... in APK %s, found = false!", strFilePath.c_str()); + // AXLOG("[AssetManager] ... in APK %s, found = false!", strFilePath.c_str()); } } } @@ -175,7 +175,7 @@ bool FileUtilsAndroid::isDirectoryExistInternal(std::string_view dirPath) const // find absolute path in flash memory if (s[0] == '/') { - CCLOG("find in flash memory dirPath(%s)", s); + AXLOG("find in flash memory dirPath(%s)", s); struct stat st; if (stat(s, &st) == 0) { @@ -187,7 +187,7 @@ bool FileUtilsAndroid::isDirectoryExistInternal(std::string_view dirPath) const // find it in apk's assets dir // Found "assets/" at the beginning of the path and we don't want it - CCLOG("find in apk dirPath(%s)", s); + AXLOG("find in apk dirPath(%s)", s); if (dirPath.find(ASSETS_FOLDER_NAME) == 0) { s += ASSETS_FOLDER_NAME_LENGTH; diff --git a/core/platform/android/CCFileUtils-android.h b/core/platform/android/CCFileUtils-android.h index 7c5ccbc743..b72cdc38c7 100644 --- a/core/platform/android/CCFileUtils-android.h +++ b/core/platform/android/CCFileUtils-android.h @@ -45,7 +45,7 @@ class ZipFile; */ //! @brief Helper class to handle file operations -class CC_DLL FileUtilsAndroid : public FileUtils +class AX_DLL FileUtilsAndroid : public FileUtils { friend class FileUtils; diff --git a/core/platform/android/CCGLViewImpl-android.cpp b/core/platform/android/CCGLViewImpl-android.cpp index e86b883970..dca7163635 100644 --- a/core/platform/android/CCGLViewImpl-android.cpp +++ b/core/platform/android/CCGLViewImpl-android.cpp @@ -58,7 +58,7 @@ GLViewImpl* GLViewImpl::createWithRect(std::string_view viewName, Rect rect, flo ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -70,7 +70,7 @@ GLViewImpl* GLViewImpl::create(std::string_view viewName) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -82,7 +82,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } diff --git a/core/platform/android/CCGLViewImpl-android.h b/core/platform/android/CCGLViewImpl-android.h index cfb2503990..1def117b5c 100644 --- a/core/platform/android/CCGLViewImpl-android.h +++ b/core/platform/android/CCGLViewImpl-android.h @@ -31,7 +31,7 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL GLViewImpl : public GLView +class AX_DLL GLViewImpl : public GLView { public: // static function diff --git a/core/platform/android/CCPlatformDefine-android.h b/core/platform/android/CCPlatformDefine-android.h index 2aae5c5521..c7d9598b74 100644 --- a/core/platform/android/CCPlatformDefine-android.h +++ b/core/platform/android/CCPlatformDefine-android.h @@ -27,25 +27,25 @@ THE SOFTWARE. #include -#define CC_DLL +#define AX_DLL -#define CC_NO_MESSAGE_PSEUDOASSERT(cond) \ +#define AX_NO_MESSAGE_PSEUDOASSERT(cond) \ if (!(cond)) \ { \ __android_log_print(ANDROID_LOG_ERROR, "cocos2d-x assert", "%s function:%s line:%d", __FILE__, __FUNCTION__, \ __LINE__); \ } -#define CC_MESSAGE_PSEUDOASSERT(cond, msg) \ +#define AX_MESSAGE_PSEUDOASSERT(cond, msg) \ if (!(cond)) \ { \ __android_log_print(ANDROID_LOG_ERROR, "cocos2d-x assert", "file:%s function:%s line:%d, %s", __FILE__, \ __FUNCTION__, __LINE__, msg); \ } -#define CC_ASSERT(cond) CC_NO_MESSAGE_PSEUDOASSERT(cond) +#define AX_ASSERT(cond) AX_NO_MESSAGE_PSEUDOASSERT(cond) -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam +#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam /* Define NULL pointer value */ #ifndef NULL diff --git a/core/platform/android/jni/JniHelper.h b/core/platform/android/jni/JniHelper.h index 0b1a2cbd6b..2e6f89af2a 100644 --- a/core/platform/android/jni/JniHelper.h +++ b/core/platform/android/jni/JniHelper.h @@ -70,7 +70,7 @@ typedef struct JniMethodInfo_ jmethodID methodID; } JniMethodInfo; -class CC_DLL JniHelper +class AX_DLL JniHelper { public: typedef std::unordered_map> LocalRefMapType; diff --git a/core/platform/apple/CCDevice-apple.mm b/core/platform/apple/CCDevice-apple.mm index 0ee63febf3..91e2c324a9 100644 --- a/core/platform/apple/CCDevice-apple.mm +++ b/core/platform/apple/CCDevice-apple.mm @@ -27,13 +27,13 @@ #include "platform/CCPlatformConfig.h" #include "platform/CCDevice.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_MAC # include # include # include -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS # import diff --git a/core/platform/apple/CCFileUtils-apple.h b/core/platform/apple/CCFileUtils-apple.h index ea4315cc71..09ad5df731 100644 --- a/core/platform/apple/CCFileUtils-apple.h +++ b/core/platform/apple/CCFileUtils-apple.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_FILEUTILS_APPLE_H__ -#define __CC_FILEUTILS_APPLE_H__ +#ifndef __AX_FILEUTILS_APPLE_H__ +#define __AX_FILEUTILS_APPLE_H__ #include #include @@ -43,7 +43,7 @@ NS_AX_BEGIN */ //! @brief Helper class to handle file operations -class CC_DLL FileUtilsApple : public FileUtils +class AX_DLL FileUtilsApple : public FileUtils { public: FileUtilsApple(); @@ -54,7 +54,7 @@ public: virtual std::string getFullPathForFilenameWithinDirectory(std::string_view directory, std::string_view filename) const override; -#if CC_FILEUTILS_APPLE_ENABLE_OBJC +#if AX_FILEUTILS_APPLE_ENABLE_OBJC void setBundle(NSBundle* bundle); #endif @@ -76,4 +76,4 @@ private: NS_AX_END -#endif // __CC_FILEUTILS_APPLE_H__ +#endif // __AX_FILEUTILS_APPLE_H__ diff --git a/core/platform/apple/CCFileUtils-apple.mm b/core/platform/apple/CCFileUtils-apple.mm index d8bb0b5b93..13195eb08d 100644 --- a/core/platform/apple/CCFileUtils-apple.mm +++ b/core/platform/apple/CCFileUtils-apple.mm @@ -54,7 +54,7 @@ FileUtilsApple::FileUtilsApple() : pimpl_(new IMPL([NSBundle mainBundle])) {} FileUtilsApple::~FileUtilsApple() = default; -#if CC_FILEUTILS_APPLE_ENABLE_OBJC +#if AX_FILEUTILS_APPLE_ENABLE_OBJC void FileUtilsApple::setBundle(NSBundle* bundle) { pimpl_->setBundle(bundle); @@ -74,7 +74,7 @@ FileUtils* FileUtils::getInstance() { delete s_sharedFileUtils; s_sharedFileUtils = nullptr; - CCLOG("ERROR: Could not init CCFileUtilsApple"); + AXLOG("ERROR: Could not init CCFileUtilsApple"); } } return s_sharedFileUtils; @@ -161,7 +161,7 @@ bool FileUtilsApple::removeDirectory(std::string_view path) const { if (path.empty()) { - CCLOGERROR("Fail to remove directory, path is empty!"); + AXLOGERROR("Fail to remove directory, path is empty!"); return false; } @@ -231,7 +231,7 @@ std::string FileUtilsApple::getFullPathForFilenameWithinDirectory(std::string_vi bool FileUtilsApple::createDirectory(std::string_view path) const { - CCASSERT(!path.empty(), "Invalid path"); + AXASSERT(!path.empty(), "Invalid path"); if (isDirectoryExist(path)) return true; @@ -245,7 +245,7 @@ bool FileUtilsApple::createDirectory(std::string_view path) const if (!result && error != nil) { - CCLOGERROR("Fail to create directory \"%s\": %s", path.data(), [error.localizedDescription UTF8String]); + AXLOGERROR("Fail to create directory \"%s\": %s", path.data(), [error.localizedDescription UTF8String]); } return result; diff --git a/core/platform/desktop/CCGLViewImpl-desktop.cpp b/core/platform/desktop/CCGLViewImpl-desktop.cpp index 5e2a33000b..92c160eea8 100644 --- a/core/platform/desktop/CCGLViewImpl-desktop.cpp +++ b/core/platform/desktop/CCGLViewImpl-desktop.cpp @@ -48,9 +48,9 @@ THE SOFTWARE. # include "glfw3ext.h" #endif -#if CC_ICON_SET_SUPPORT +#if AX_ICON_SET_SUPPORT # include "platform/CCImage.h" -#endif /* CC_ICON_SET_SUPPORT */ +#endif /* AX_ICON_SET_SUPPORT */ #include "renderer/CCRenderer.h" @@ -306,7 +306,7 @@ GLViewImpl::GLViewImpl(bool initglfw) if (initglfw) { glfwSetErrorCallback(GLFWEventHandler::onGLFWError); -#if defined(CC_USE_GLES) && GLFW_VERSION_MAJOR >= 3 && GLFW_VERSION_MINOR >= 4 +#if defined(AX_USE_GLES) && GLFW_VERSION_MAJOR >= 3 && GLFW_VERSION_MINOR >= 4 glfwInitHint(GLFW_ANGLE_PLATFORM_TYPE, GLFW_ANGLE_PLATFORM_TYPE_D3D11); // since glfw-3.4 #endif #if defined(_WIN32) @@ -319,7 +319,7 @@ GLViewImpl::GLViewImpl(bool initglfw) GLViewImpl::~GLViewImpl() { - CCLOGINFO("deallocing GLViewImpl: %p", this); + AXLOGINFO("deallocing GLViewImpl: %p", this); GLFWEventHandler::setGLViewImpl(nullptr); #if defined(_WIN32) glfwxTerminate(); @@ -341,7 +341,7 @@ GLViewImpl* GLViewImpl::create(std::string_view viewName, bool resizable) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -353,7 +353,7 @@ GLViewImpl* GLViewImpl::createWithRect(std::string_view viewName, Rect rect, flo ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -365,7 +365,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -379,7 +379,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -389,7 +389,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ _frameZoomFactor = frameZoomFactor; -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); @@ -409,7 +409,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ glfwWindowHint(GLFW_VISIBLE, _glContextAttrs.visible); glfwWindowHint(GLFW_DECORATED, _glContextAttrs.decorated); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) // Don't create gl context. glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); #endif @@ -417,7 +417,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ int neededWidth = (int)(rect.size.width * _frameZoomFactor); int neededHeight = (int)(rect.size.height * _frameZoomFactor); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) glfwxSetParent((HWND)_glContextAttrs.viewParent); #endif @@ -489,7 +489,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ } // Will cause OpenGL error 0x0500 when use ANGLE-GLES on desktop -#if defined(CC_USE_GL) +#if defined(AX_USE_GL) // Enable point size by default. # if defined(GL_VERSION_2_0) glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); @@ -501,7 +501,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ #endif CHECK_GL_ERROR_DEBUG(); -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX glfwSwapInterval(_glContextAttrs.vsync ? 1 : 0); #endif @@ -577,7 +577,7 @@ void GLViewImpl::pollEvents() void GLViewImpl::enableRetina(bool enabled) { // official v4 comment follow sources - // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) + // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) // _isRetinaEnabled = enabled; // if (_isRetinaEnabled) // { @@ -593,7 +593,7 @@ void GLViewImpl::enableRetina(bool enabled) void GLViewImpl::setIMEKeyboardState(bool /*bOpen*/) {} -#if CC_ICON_SET_SUPPORT +#if AX_ICON_SET_SUPPORT void GLViewImpl::setIcon(std::string_view filename) const { this->setIcon(std::vector{filename}); @@ -613,7 +613,7 @@ void GLViewImpl::setIcon(const std::vector& filelist) const } else { - CC_SAFE_DELETE(icon); + AX_SAFE_DELETE(icon); } } @@ -633,10 +633,10 @@ void GLViewImpl::setIcon(const std::vector& filelist) const GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, iconsCount, images); - CC_SAFE_DELETE_ARRAY(images); + AX_SAFE_DELETE_ARRAY(images); for (auto& icon : icons) { - CC_SAFE_DELETE(icon); + AX_SAFE_DELETE(icon); } } @@ -645,7 +645,7 @@ void GLViewImpl::setDefaultIcon() const GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, 0, nullptr); } -#endif /* CC_ICON_SET_SUPPORT */ +#endif /* AX_ICON_SET_SUPPORT */ void GLViewImpl::setCursorVisible(bool isVisible) { @@ -660,7 +660,7 @@ void GLViewImpl::setCursorVisible(bool isVisible) void GLViewImpl::setFrameZoomFactor(float zoomFactor) { - CCASSERT(zoomFactor > 0.0f, "zoomFactor must be larger than 0"); + AXASSERT(zoomFactor > 0.0f, "zoomFactor must be larger than 0"); if (std::abs(_frameZoomFactor - zoomFactor) < FLT_EPSILON) { @@ -749,7 +749,7 @@ void GLViewImpl::setWindowed(int width, int height) ypos += (int)((videoMode->height - height) * 0.5f); _monitor = nullptr; glfwSetWindowMonitor(_mainWindow, nullptr, xpos, ypos, width, height, GLFW_DONT_CARE); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) // on mac window will sometimes lose title when windowed glfwSetWindowTitle(_mainWindow, _viewName.c_str()); #endif @@ -890,7 +890,7 @@ void GLViewImpl::onGLFWError(int errorID, const char* errorDesc) { _glfwError.append(StringUtils::format("GLFWError #%d Happen, %s\n", errorID, errorDesc)); } - CCLOGERROR("%s", _glfwError.c_str()); + AXLOGERROR("%s", _glfwError.c_str()); } void GLViewImpl::onGLFWMouseCallBack(GLFWwindow* /*window*/, int button, int action, int /*modify*/) @@ -1194,11 +1194,11 @@ static bool loadFboExtensions() // helper bool GLViewImpl::loadGL() { -#if (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_MAC) // glad: load all OpenGL function pointers // --------------------------------------- -# if defined(CC_USE_GL) +# if defined(AX_USE_GL) if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) { log("glad: Failed to Load GL"); @@ -1222,7 +1222,7 @@ bool GLViewImpl::loadGL() loadFboExtensions(); -#endif // (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) +#endif // (AX_TARGET_PLATFORM != AX_PLATFORM_MAC) return true; } diff --git a/core/platform/desktop/CCGLViewImpl-desktop.h b/core/platform/desktop/CCGLViewImpl-desktop.h index ec9c68d525..45e0b9242d 100644 --- a/core/platform/desktop/CCGLViewImpl-desktop.h +++ b/core/platform/desktop/CCGLViewImpl-desktop.h @@ -32,7 +32,7 @@ THE SOFTWARE. #include "platform/CCGLView.h" #include "glfw3.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # ifndef GLFW_EXPOSE_NATIVE_WIN32 # define GLFW_EXPOSE_NATIVE_WIN32 # endif @@ -40,9 +40,9 @@ THE SOFTWARE. # define GLFW_EXPOSE_NATIVE_WGL # endif # include "glfw3native.h" -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # ifndef GLFW_EXPOSE_NATIVE_NSGL # define GLFW_EXPOSE_NATIVE_NSGL # endif @@ -50,12 +50,12 @@ THE SOFTWARE. # define GLFW_EXPOSE_NATIVE_COCOA # endif # include "glfw3native.h" -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) NS_AX_BEGIN class GLFWEventHandler; -class CC_DLL GLViewImpl : public GLView +class AX_DLL GLViewImpl : public GLView { friend class GLFWEventHandler; @@ -120,11 +120,11 @@ public: virtual void setFrameSize(float width, float height) override; virtual void setIMEKeyboardState(bool bOpen) override; -#if CC_ICON_SET_SUPPORT +#if AX_ICON_SET_SUPPORT virtual void setIcon(std::string_view filename) const override; virtual void setIcon(const std::vector& filelist) const override; virtual void setDefaultIcon() const override; -#endif /* CC_ICON_SET_SUPPORT */ +#endif /* AX_ICON_SET_SUPPORT */ /* * Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop. @@ -144,14 +144,14 @@ public: /** Get retina factor */ int getRetinaFactor() const override { return _retinaFactor; } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) HWND getWin32Window() { return glfwGetWin32Window(_mainWindow); } -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) id getCocoaWindow() override { return glfwGetCocoaWindow(_mainWindow); } id getNSGLContext() override { return glfwGetNSGLContext(_mainWindow); } // stevetranby: added -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) protected: GLViewImpl(bool initglfw = true); @@ -202,7 +202,7 @@ public: static const std::string EVENT_WINDOW_UNFOCUSED; private: - CC_DISALLOW_COPY_AND_ASSIGN(GLViewImpl); + AX_DISALLOW_COPY_AND_ASSIGN(GLViewImpl); }; NS_AX_END // end of namespace cocos2d diff --git a/core/platform/ios/CCApplication-ios.h b/core/platform/ios/CCApplication-ios.h index 52f355a06f..bdb721dfb6 100644 --- a/core/platform/ios/CCApplication-ios.h +++ b/core/platform/ios/CCApplication-ios.h @@ -30,7 +30,7 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL Application : public ApplicationProtocol +class AX_DLL Application : public ApplicationProtocol { public: /** diff --git a/core/platform/ios/CCApplication-ios.mm b/core/platform/ios/CCApplication-ios.mm index 02ade1b8f3..4efe993e1b 100644 --- a/core/platform/ios/CCApplication-ios.mm +++ b/core/platform/ios/CCApplication-ios.mm @@ -37,13 +37,13 @@ Application* Application::sm_pSharedApplication = nullptr; Application::Application() { - CC_ASSERT(!sm_pSharedApplication); + AX_ASSERT(!sm_pSharedApplication); sm_pSharedApplication = this; } Application::~Application() { - CC_ASSERT(this == sm_pSharedApplication); + AX_ASSERT(this == sm_pSharedApplication); sm_pSharedApplication = 0; } @@ -67,7 +67,7 @@ void Application::setAnimationInterval(float interval) Application* Application::getInstance() { - CC_ASSERT(sm_pSharedApplication); + AX_ASSERT(sm_pSharedApplication); return sm_pSharedApplication; } diff --git a/core/platform/ios/CCCommon-ios.mm b/core/platform/ios/CCCommon-ios.mm index 9b135c617f..549aabd01c 100644 --- a/core/platform/ios/CCCommon-ios.mm +++ b/core/platform/ios/CCCommon-ios.mm @@ -40,7 +40,7 @@ void ccMessageBox(const char* msg, const char* title) { // only enable it on iOS. // FIXME: Implement it for tvOS -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) NSString* tmpTitle = (title) ? [NSString stringWithUTF8String:title] : nil; NSString* tmpMsg = (msg) ? [NSString stringWithUTF8String:msg] : nil; diff --git a/core/platform/ios/CCDevice-ios.mm b/core/platform/ios/CCDevice-ios.mm index 6b87000ffd..f2c8c42b2a 100644 --- a/core/platform/ios/CCDevice-ios.mm +++ b/core/platform/ios/CCDevice-ios.mm @@ -33,7 +33,7 @@ #include "platform/apple/CCDevice-apple.h" // Accelerometer -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) # import #endif #import @@ -189,7 +189,7 @@ static CGSize _calculateShrinkedSizeForString(NSAttributedString** str, #define SENSOR_DELAY_GAME 0.02 -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) @interface CCAccelerometerDispatcher : NSObject { axis::Acceleration* _acceleration; CMMotionManager* _motionManager; @@ -302,7 +302,7 @@ static CCAccelerometerDispatcher* s_pAccelerometerDispatcher; dispatcher->dispatchEvent(&event); } @end -#endif // !defined(CC_TARGET_OS_TVOS) +#endif // !defined(AX_TARGET_OS_TVOS) // @@ -340,14 +340,14 @@ int Device::getDPI() void Device::setAccelerometerEnabled(bool isEnabled) { -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [[CCAccelerometerDispatcher sharedAccelerometerDispatcher] setAccelerometerEnabled:isEnabled]; #endif } void Device::setAccelerometerInterval(float interval) { -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [[CCAccelerometerDispatcher sharedAccelerometerDispatcher] setAccelerometerInterval:interval]; #endif } @@ -443,14 +443,14 @@ static bool _initWithString(const char* text, bool bRet = false; do { - CC_BREAK_IF(!text || !info); + AX_BREAK_IF(!text || !info); id font = _createSystemFont(fontName, size); - CC_BREAK_IF(!font); + AX_BREAK_IF(!font); NSString* str = [NSString stringWithUTF8String:text]; - CC_BREAK_IF(!str); + AX_BREAK_IF(!str); CGSize dimensions; dimensions.width = info->width; @@ -487,7 +487,7 @@ static bool _initWithString(const char* text, realDimensions = _calculateStringSize(stringWithAttributes, font, &dimensions, enableWrap, overflow); } - CC_BREAK_IF(realDimensions.width <= 0 || realDimensions.height <= 0); + AX_BREAK_IF(realDimensions.width <= 0 || realDimensions.height <= 0); if (dimensions.width <= 0) { dimensions.width = realDimensions.width; @@ -517,7 +517,7 @@ static bool _initWithString(const char* text, if (!context) { CGColorSpaceRelease(colorSpace); - CC_SAFE_FREE(data); + AX_SAFE_FREE(data); break; } diff --git a/core/platform/ios/CCDirectorCaller-ios.mm b/core/platform/ios/CCDirectorCaller-ios.mm index 9cbd9a2139..a7210ba839 100644 --- a/core/platform/ios/CCDirectorCaller-ios.mm +++ b/core/platform/ios/CCDirectorCaller-ios.mm @@ -138,7 +138,7 @@ static id s_sharedDirectorCaller; if (isAppActive) { axis::Director* director = axis::Director::getInstance(); -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) EAGLContext* cocos2dxContext = [(CCEAGLView*)director->getOpenGLView()->getEAGLView() context]; if (cocos2dxContext != [EAGLContext currentContext]) glFlush(); diff --git a/core/platform/ios/CCEAGLView-ios.h b/core/platform/ios/CCEAGLView-ios.h index 5c70cf73b0..5ad547b20a 100644 --- a/core/platform/ios/CCEAGLView-ios.h +++ b/core/platform/ios/CCEAGLView-ios.h @@ -68,7 +68,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. #import #import "platform/CCPlatformConfig.h" -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) # import "platform/ios/CCESRenderer-ios.h" #endif @@ -80,7 +80,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. * Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. */ @interface CCEAGLView : UIView { -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) id renderer_; #endif BOOL preserveBackbuffer_; @@ -129,7 +129,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. /** returns surface size in pixels */ @property(nonatomic, readonly) CGSize surfaceSize; -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) /** OpenGL context */ @property(nonatomic, readonly) EAGLContext* context; #endif diff --git a/core/platform/ios/CCEAGLView-ios.mm b/core/platform/ios/CCEAGLView-ios.mm index 716c8b8af2..be2f0acd95 100644 --- a/core/platform/ios/CCEAGLView-ios.mm +++ b/core/platform/ios/CCEAGLView-ios.mm @@ -69,7 +69,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. #import "base/CCIMEDispatcher.h" #import "platform/ios/CCInputView-ios.h" -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) # import # import "renderer/backend/metal/DeviceMTL.h" # import "renderer/backend/metal/UtilsMTL.h" @@ -94,7 +94,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. @synthesize surfaceSize = size_; @synthesize pixelFormat = pixelformat_, depthFormat = depthFormat_; -#if !defined(CC_USE_METAL) +#if !defined(AX_USE_METAL) @synthesize context = context_; #endif @synthesize multiSampling = multiSampling_; @@ -104,7 +104,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. + (Class)layerClass { -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) return [CAMetalLayer class]; #else return [CAEAGLLayer class]; @@ -190,11 +190,11 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. self.contentScaleFactor = [[UIScreen mainScreen] scale]; } -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) id device = MTLCreateSystemDefaultDevice(); if (!device) { - CCLOG("Doesn't support metal."); + AXLOG("Doesn't support metal."); return nil; } CAMetalLayer* metalLayer = (CAMetalLayer*)[self layer]; @@ -224,7 +224,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. if ((self = [super initWithCoder:aDecoder])) { self.textInputView = [[CCInputView alloc] initWithCoder:aDecoder]; -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) size_ = [self bounds].size; #else CAEAGLLayer* eaglLayer = (CAEAGLLayer*)[self layer]; @@ -258,7 +258,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. return (int)bound.height * self.contentScaleFactor; } -#if !defined(CC_USE_METAL) +#if !defined(AX_USE_METAL) - (BOOL)setupSurfaceWithSharegroup:(EAGLSharegroup*)sharegroup { CAEAGLLayer* eaglLayer = (CAEAGLLayer*)self.layer; @@ -296,7 +296,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; // remove keyboard notification -#if !defined(CC_USE_METAL) +#if !defined(AX_USE_METAL) [renderer_ release]; #endif [self.textInputView release]; @@ -308,7 +308,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. if (!axis::Director::getInstance()->isValid()) return; -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) size_ = [self bounds].size; size_.width *= self.contentScaleFactor; size_.height *= self.contentScaleFactor; @@ -333,7 +333,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. } } -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) - (void)swapBuffers {} #else @@ -385,10 +385,10 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. if (![context_ presentRenderbuffer:GL_RENDERBUFFER]) { - // CCLOG(@"cocos2d: Failed to swap renderbuffer in %s\n", __FUNCTION__); + // AXLOG(@"cocos2d: Failed to swap renderbuffer in %s\n", __FUNCTION__); } -# if COCOS2D_DEBUG +# if AXIS_DEBUG CHECK_GL_ERROR(); # endif @@ -454,7 +454,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. { if (i >= IOS_MAX_TOUCHES_COUNT) { - CCLOG("warning: touches more than 10, should adjust IOS_MAX_TOUCHES_COUNT"); + AXLOG("warning: touches more than 10, should adjust IOS_MAX_TOUCHES_COUNT"); break; } @@ -481,7 +481,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. { if (i >= IOS_MAX_TOUCHES_COUNT) { - CCLOG("warning: touches more than 10, should adjust IOS_MAX_TOUCHES_COUNT"); + AXLOG("warning: touches more than 10, should adjust IOS_MAX_TOUCHES_COUNT"); break; } @@ -514,7 +514,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. { if (i >= IOS_MAX_TOUCHES_COUNT) { - CCLOG("warning: touches more than 10, should adjust IOS_MAX_TOUCHES_COUNT"); + AXLOG("warning: touches more than 10, should adjust IOS_MAX_TOUCHES_COUNT"); break; } @@ -539,7 +539,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. { if (i >= IOS_MAX_TOUCHES_COUNT) { - CCLOG("warning: touches more than 10, should adjust IOS_MAX_TOUCHES_COUNT"); + AXLOG("warning: touches more than 10, should adjust IOS_MAX_TOUCHES_COUNT"); break; } @@ -582,7 +582,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. dis /= self.contentScaleFactor; -#if defined(CC_TARGET_OS_TVOS) +#if defined(AX_TARGET_OS_TVOS) self.frame = CGRectMake(originalRect_.origin.x, originalRect_.origin.y - dis, originalRect_.size.width, originalRect_.size.height); #else @@ -626,7 +626,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. #pragma UIKeyboard notification -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) namespace { UIInterfaceOrientation getFixedOrientation(UIInterfaceOrientation statusBarOrientation) @@ -642,7 +642,7 @@ UIInterfaceOrientation getFixedOrientation(UIInterfaceOrientation statusBarOrien - (void)didMoveToWindow { -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onUIKeyboardNotification:) name:UIKeyboardWillShowNotification diff --git a/core/platform/ios/CCES2Renderer-ios.h b/core/platform/ios/CCES2Renderer-ios.h index 6dfccb9f7a..7270125c81 100644 --- a/core/platform/ios/CCES2Renderer-ios.h +++ b/core/platform/ios/CCES2Renderer-ios.h @@ -30,7 +30,7 @@ // But in case they are included, it won't be compiled. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS # import "platform/ios/CCESRenderer-ios.h" @@ -80,4 +80,4 @@ - (BOOL)resizeFromLayer:(CAEAGLLayer*)layer; @end -#endif // CC_PLATFORM_IOS +#endif // AX_PLATFORM_IOS diff --git a/core/platform/ios/CCES2Renderer-ios.m b/core/platform/ios/CCES2Renderer-ios.m index 0a41819426..7c6260b530 100644 --- a/core/platform/ios/CCES2Renderer-ios.m +++ b/core/platform/ios/CCES2Renderer-ios.m @@ -30,13 +30,13 @@ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS #import "platform/ios/CCES2Renderer-ios.h" // #import "platform/CCPlatformMacros.h" #import "platform/ios/OpenGL_Internal-ios.h" -#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 +#if !defined(AXIS_DEBUG) || AXIS_DEBUG == 0 #define NSLog(...) do {} while (0) #endif @@ -212,7 +212,7 @@ - (void)dealloc { -// CCLOGINFO("deallocing CCES2Renderer: %p", self); +// AXLOGINFO("deallocing CCES2Renderer: %p", self); // Tear down GL if (defaultFramebuffer_) { @@ -254,4 +254,4 @@ @end -#endif // CC_PLATFORM_IOS +#endif // AX_PLATFORM_IOS diff --git a/core/platform/ios/CCESRenderer-ios.h b/core/platform/ios/CCESRenderer-ios.h index 33602e8a46..f75de29a38 100644 --- a/core/platform/ios/CCESRenderer-ios.h +++ b/core/platform/ios/CCESRenderer-ios.h @@ -30,7 +30,7 @@ // But in case they are included, it won't be compiled. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS // # include "platform/CCPlatformMacros.h" # import @@ -57,4 +57,4 @@ - (unsigned int)msaaColorBuffer; @end -#endif // CC_PLATFORM_IOS +#endif // AX_PLATFORM_IOS diff --git a/core/platform/ios/CCGL-ios.h b/core/platform/ios/CCGL-ios.h index 74a2ae6efd..cfbdbe9724 100644 --- a/core/platform/ios/CCGL-ios.h +++ b/core/platform/ios/CCGL-ios.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __PLATFORM_IOS_CCGL_H__ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS # define glClearDepth glClearDepthf # define glDeleteVertexArrays glDeleteVertexArraysOES @@ -126,6 +126,6 @@ THE SOFTWARE. # define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD # endif -#endif // CC_PLATFORM_IOS +#endif // AX_PLATFORM_IOS #endif // __PLATFORM_IOS_CCGL_H__ diff --git a/core/platform/ios/CCGLViewImpl-ios.h b/core/platform/ios/CCGLViewImpl-ios.h index dcd5104ac7..9125c14c48 100644 --- a/core/platform/ios/CCGLViewImpl-ios.h +++ b/core/platform/ios/CCGLViewImpl-ios.h @@ -33,7 +33,7 @@ NS_AX_BEGIN /** Class that represent the OpenGL View */ -class CC_DLL GLViewImpl : public GLView +class AX_DLL GLViewImpl : public GLView { public: /** creates a GLViewImpl with a objective-c CCEAGLViewImpl instance */ diff --git a/core/platform/ios/CCGLViewImpl-ios.mm b/core/platform/ios/CCGLViewImpl-ios.mm index b704ebce4e..f6de3aa70e 100644 --- a/core/platform/ios/CCGLViewImpl-ios.mm +++ b/core/platform/ios/CCGLViewImpl-ios.mm @@ -45,7 +45,7 @@ GLViewImpl* GLViewImpl::createWithEAGLView(void* eaglview) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -57,7 +57,7 @@ GLViewImpl* GLViewImpl::create(std::string_view viewName) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -69,7 +69,7 @@ GLViewImpl* GLViewImpl::createWithRect(std::string_view viewName, const Rect& re ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -81,7 +81,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -99,7 +99,7 @@ void GLViewImpl::convertAttrs() } else { - CCASSERT(0, "Unsupported render buffer pixel format. Using default"); + AXASSERT(0, "Unsupported render buffer pixel format. Using default"); } if (_glContextAttrs.depthBits == 24 && _glContextAttrs.stencilBits == 8) @@ -112,7 +112,7 @@ void GLViewImpl::convertAttrs() } else { - CCASSERT(0, "Unsupported format for depth and stencil buffers. Using default"); + AXASSERT(0, "Unsupported format for depth and stencil buffers. Using default"); } _multisamplingCount = _glContextAttrs.multisamplingCount; @@ -151,7 +151,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, const Rect& rect, float numberOfSamples:0]; // Not available on tvOS -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [eaglview setMultipleTouchEnabled:YES]; #endif @@ -183,7 +183,7 @@ bool GLViewImpl::isOpenGLReady() bool GLViewImpl::setContentScaleFactor(float contentScaleFactor) { - CC_ASSERT(_resolutionPolicy == ResolutionPolicy::UNKNOWN); // cannot enable retina mode + AX_ASSERT(_resolutionPolicy == ResolutionPolicy::UNKNOWN); // cannot enable retina mode _scaleX = _scaleY = contentScaleFactor; CCEAGLView* eaglview = (CCEAGLView*)_eaglview; @@ -198,7 +198,7 @@ float GLViewImpl::getContentScaleFactor() const float scaleFactor = [eaglview contentScaleFactor]; - // CCASSERT(scaleFactor == _scaleX == _scaleY, "Logic error in GLView::getContentScaleFactor"); + // AXASSERT(scaleFactor == _scaleX == _scaleY, "Logic error in GLView::getContentScaleFactor"); return scaleFactor; } diff --git a/core/platform/ios/CCImage-ios.mm b/core/platform/ios/CCImage-ios.mm index 55b0f475fe..d81caba167 100644 --- a/core/platform/ios/CCImage-ios.mm +++ b/core/platform/ios/CCImage-ios.mm @@ -40,7 +40,7 @@ bool axis::Image::saveToFile(std::string_view filename, bool isToRGB) // only support for backend::PixelFormat::RGB8 or backend::PixelFormat::RGBA8 uncompressed data if (isCompressed() || (_pixelFormat != backend::PixelFormat::RGB8 && _pixelFormat != backend::PixelFormat::RGBA8)) { - CCLOG("cocos2d: Image: saveToFile is only support for backend::PixelFormat::RGB8 or " + AXLOG("cocos2d: Image: saveToFile is only support for backend::PixelFormat::RGB8 or " "backend::PixelFormat::RGBA8 uncompressed data for now"); return false; } diff --git a/core/platform/ios/CCInputView-ios.mm b/core/platform/ios/CCInputView-ios.mm index 09748b5fbb..e4ee343e82 100644 --- a/core/platform/ios/CCInputView-ios.mm +++ b/core/platform/ios/CCInputView-ios.mm @@ -83,7 +83,7 @@ THE SOFTWARE. - (void)setSelectedTextRange:(UITextRange*)aSelectedTextRange { - CCLOG("UITextRange:setSelectedTextRange"); + AXLOG("UITextRange:setSelectedTextRange"); } - (UITextRange*)selectedTextRange @@ -115,56 +115,56 @@ THE SOFTWARE. - (NSWritingDirection)baseWritingDirectionForPosition:(nonnull UITextPosition*)position inDirection:(UITextStorageDirection)direction { - CCLOG("baseWritingDirectionForPosition"); + AXLOG("baseWritingDirectionForPosition"); return NSWritingDirectionLeftToRight; } - (CGRect)caretRectForPosition:(nonnull UITextPosition*)position { - CCLOG("caretRectForPosition"); + AXLOG("caretRectForPosition"); return CGRectZero; } - (nullable UITextRange*)characterRangeAtPoint:(CGPoint)point { - CCLOG("characterRangeAtPoint"); + AXLOG("characterRangeAtPoint"); return nil; } - (nullable UITextRange*)characterRangeByExtendingPosition:(nonnull UITextPosition*)position inDirection:(UITextLayoutDirection)direction { - CCLOG("characterRangeByExtendingPosition"); + AXLOG("characterRangeByExtendingPosition"); return nil; } - (nullable UITextPosition*)closestPositionToPoint:(CGPoint)point { - CCLOG("closestPositionToPoint"); + AXLOG("closestPositionToPoint"); return nil; } - (nullable UITextPosition*)closestPositionToPoint:(CGPoint)point withinRange:(nonnull UITextRange*)range { - CCLOG("closestPositionToPoint"); + AXLOG("closestPositionToPoint"); return nil; } - (NSComparisonResult)comparePosition:(nonnull UITextPosition*)position toPosition:(nonnull UITextPosition*)other { - CCLOG("comparePosition"); + AXLOG("comparePosition"); return (NSComparisonResult)0; } - (CGRect)firstRectForRange:(nonnull UITextRange*)range { - CCLOG("firstRectForRange"); + AXLOG("firstRectForRange"); return CGRectNull; } - (NSInteger)offsetFromPosition:(nonnull UITextPosition*)from toPosition:(nonnull UITextPosition*)toPosition { - CCLOG("offsetFromPosition"); + AXLOG("offsetFromPosition"); return 0; } @@ -172,20 +172,20 @@ THE SOFTWARE. inDirection:(UITextLayoutDirection)direction offset:(NSInteger)offset { - CCLOG("positionFromPosition"); + AXLOG("positionFromPosition"); return nil; } - (nullable UITextPosition*)positionFromPosition:(nonnull UITextPosition*)position offset:(NSInteger)offset { - CCLOG("positionFromPosition"); + AXLOG("positionFromPosition"); return nil; } - (nullable UITextPosition*)positionWithinRange:(nonnull UITextRange*)range farthestInDirection:(UITextLayoutDirection)direction { - CCLOG("positionWithinRange"); + AXLOG("positionWithinRange"); return nil; } @@ -194,7 +194,7 @@ THE SOFTWARE. - (nonnull NSArray*)selectionRectsForRange:(nonnull UITextRange*)range { - CCLOG("selectionRectsForRange"); + AXLOG("selectionRectsForRange"); return nil; } @@ -203,7 +203,7 @@ THE SOFTWARE. - (void)setMarkedText:(nullable NSString*)markedText selectedRange:(NSRange)selectedRange { - CCLOG("setMarkedText"); + AXLOG("setMarkedText"); if (markedText == self.myMarkedText) { return; @@ -218,7 +218,7 @@ THE SOFTWARE. - (UITextRange*)markedTextRange { - CCLOG("markedTextRange"); + AXLOG("markedTextRange"); if (nil != self.myMarkedText) { return [[[UITextRange alloc] init] autorelease]; @@ -228,7 +228,7 @@ THE SOFTWARE. - (nullable NSString*)textInRange:(nonnull UITextRange*)range { - CCLOG("textInRange"); + AXLOG("textInRange"); if (nil != self.myMarkedText) { return self.myMarkedText; @@ -239,13 +239,13 @@ THE SOFTWARE. - (nullable UITextRange*)textRangeFromPosition:(nonnull UITextPosition*)fromPosition toPosition:(nonnull UITextPosition*)toPosition { - CCLOG("textRangeFromPosition"); + AXLOG("textRangeFromPosition"); return nil; } - (void)unmarkText { - CCLOG("unmarkText"); + AXLOG("unmarkText"); if (nil == self.myMarkedText) { return; diff --git a/core/platform/ios/CCPlatformDefine-ios.h b/core/platform/ios/CCPlatformDefine-ios.h index 29d76f68ee..a7b94804a4 100644 --- a/core/platform/ios/CCPlatformDefine-ios.h +++ b/core/platform/ios/CCPlatformDefine-ios.h @@ -27,11 +27,11 @@ THE SOFTWARE. #include -#define CC_DLL +#define AX_DLL -#define CC_ASSERT(cond) assert(cond) +#define AX_ASSERT(cond) assert(cond) -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam +#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam /* Define NULL pointer value */ #ifndef NULL diff --git a/core/platform/ios/OpenGL_Internal-ios.h b/core/platform/ios/OpenGL_Internal-ios.h index c9c888d902..66d685a842 100644 --- a/core/platform/ios/OpenGL_Internal-ios.h +++ b/core/platform/ios/OpenGL_Internal-ios.h @@ -62,7 +62,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. */ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS /* Generic error reporting */ # define REPORT_ERROR(__FORMAT__, ...) \ @@ -101,4 +101,4 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. self->__DELEGATE_METHODS_IVAR__ &= ~(1 << __BIT__); \ } -#endif // CC_PLATFORM_IOS +#endif // AX_PLATFORM_IOS diff --git a/core/platform/linux/CCApplication-linux.cpp b/core/platform/linux/CCApplication-linux.cpp index 7d7b6580b2..b41cadfa1a 100644 --- a/core/platform/linux/CCApplication-linux.cpp +++ b/core/platform/linux/CCApplication-linux.cpp @@ -39,13 +39,13 @@ Application* Application::sm_pSharedApplication = nullptr; Application::Application() : _animationInterval(16666667) { - CC_ASSERT(!sm_pSharedApplication); + AX_ASSERT(!sm_pSharedApplication); sm_pSharedApplication = this; } Application::~Application() { - CC_ASSERT(this == sm_pSharedApplication); + AX_ASSERT(this == sm_pSharedApplication); sm_pSharedApplication = nullptr; } @@ -145,7 +145,7 @@ bool Application::openURL(std::string_view url) ////////////////////////////////////////////////////////////////////////// Application* Application::getInstance() { - CC_ASSERT(sm_pSharedApplication); + AX_ASSERT(sm_pSharedApplication); return sm_pSharedApplication; } diff --git a/core/platform/linux/CCApplication-linux.h b/core/platform/linux/CCApplication-linux.h index fdcb1933b5..3fb5d00250 100644 --- a/core/platform/linux/CCApplication-linux.h +++ b/core/platform/linux/CCApplication-linux.h @@ -64,7 +64,7 @@ public: static Application* getInstance(); /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); + AX_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); /* override functions */ virtual LanguageType getCurrentLanguage() override; @@ -91,13 +91,13 @@ public: * Sets the Resource root path. * @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead. */ - CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(std::string_view rootResDir); + AX_DEPRECATED_ATTRIBUTE void setResourceRootPath(std::string_view rootResDir); /** * Gets the Resource root path. * @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. */ - CC_DEPRECATED_ATTRIBUTE std::string_view getResourceRootPath(); + AX_DEPRECATED_ATTRIBUTE std::string_view getResourceRootPath(); /** @brief Get target platform diff --git a/core/platform/linux/CCDevice-linux.cpp b/core/platform/linux/CCDevice-linux.cpp index 297bcbacc6..e39d167a5d 100644 --- a/core/platform/linux/CCDevice-linux.cpp +++ b/core/platform/linux/CCDevice-linux.cpp @@ -558,8 +558,8 @@ Data Device::getTextureDataForText(const char* text, { BitmapDC& dc = sharedBitmapDC(); - CC_BREAK_IF(!dc.getBitmap(text, textDefinition, align)); - CC_BREAK_IF(!dc._data); + AX_BREAK_IF(!dc.getBitmap(text, textDefinition, align)); + AX_BREAK_IF(!dc._data); width = dc.iMaxLineWidth; height = dc.iMaxLineHeight; dc.reset(); diff --git a/core/platform/linux/CCFileUtils-linux.cpp b/core/platform/linux/CCFileUtils-linux.cpp index 4aac1a8b99..5882090d91 100644 --- a/core/platform/linux/CCFileUtils-linux.cpp +++ b/core/platform/linux/CCFileUtils-linux.cpp @@ -49,7 +49,7 @@ FileUtils* FileUtils::getInstance() { delete s_sharedFileUtils; s_sharedFileUtils = nullptr; - CCLOG("ERROR: Could not init CCFileUtilsLinux"); + AXLOG("ERROR: Could not init CCFileUtilsLinux"); } } return s_sharedFileUtils; diff --git a/core/platform/linux/CCFileUtils-linux.h b/core/platform/linux/CCFileUtils-linux.h index cb27c0c02b..19f23eabf1 100644 --- a/core/platform/linux/CCFileUtils-linux.h +++ b/core/platform/linux/CCFileUtils-linux.h @@ -39,7 +39,7 @@ NS_AX_BEGIN */ //! @brief Helper class to handle file operations -class CC_DLL FileUtilsLinux : public FileUtils +class AX_DLL FileUtilsLinux : public FileUtils { friend class FileUtils; diff --git a/core/platform/linux/CCPlatformDefine-linux.h b/core/platform/linux/CCPlatformDefine-linux.h index af6bfc961f..5d25b55a84 100644 --- a/core/platform/linux/CCPlatformDefine-linux.h +++ b/core/platform/linux/CCPlatformDefine-linux.h @@ -27,11 +27,11 @@ THE SOFTWARE. #include -#define CC_DLL +#define AX_DLL #include -#define CC_ASSERT(cond) assert(cond) -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam +#define AX_ASSERT(cond) assert(cond) +#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam /* Define NULL pointer value */ #ifndef NULL diff --git a/core/platform/mac/CCApplication-mac.h b/core/platform/mac/CCApplication-mac.h index 635fa06431..eababe7373 100644 --- a/core/platform/mac/CCApplication-mac.h +++ b/core/platform/mac/CCApplication-mac.h @@ -32,7 +32,7 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL Application : public ApplicationProtocol +class AX_DLL Application : public ApplicationProtocol { public: /** diff --git a/core/platform/mac/CCApplication-mac.mm b/core/platform/mac/CCApplication-mac.mm index ff44955a95..61d54521c1 100644 --- a/core/platform/mac/CCApplication-mac.mm +++ b/core/platform/mac/CCApplication-mac.mm @@ -41,13 +41,13 @@ Application* Application::sm_pSharedApplication = nullptr; Application::Application() : _animationInterval(16666667) { - CCASSERT(!sm_pSharedApplication, "sm_pSharedApplication already exist"); + AXASSERT(!sm_pSharedApplication, "sm_pSharedApplication already exist"); sm_pSharedApplication = this; } Application::~Application() { - CCASSERT(this == sm_pSharedApplication, "sm_pSharedApplication != this"); + AXASSERT(this == sm_pSharedApplication, "sm_pSharedApplication != this"); sm_pSharedApplication = 0; } @@ -127,7 +127,7 @@ std::string Application::getVersion() Application* Application::getInstance() { - CCASSERT(sm_pSharedApplication, "sm_pSharedApplication not set"); + AXASSERT(sm_pSharedApplication, "sm_pSharedApplication not set"); return sm_pSharedApplication; } diff --git a/core/platform/mac/CCDevice-mac.mm b/core/platform/mac/CCDevice-mac.mm index 2458a0d452..13959cfc6f 100644 --- a/core/platform/mac/CCDevice-mac.mm +++ b/core/platform/mac/CCDevice-mac.mm @@ -281,16 +281,16 @@ static bool _initWithString(const char* text, { bool ret = false; - CCASSERT(text, "Invalid text"); - CCASSERT(info, "Invalid info"); + AXASSERT(text, "Invalid text"); + AXASSERT(info, "Invalid info"); do { NSString* string = [NSString stringWithUTF8String:text]; - CC_BREAK_IF(!string); + AX_BREAK_IF(!string); id font = _createSystemFont(fontName, size); - CC_BREAK_IF(!font); + AX_BREAK_IF(!font); // color NSColor* foregroundColor; @@ -328,7 +328,7 @@ static bool _initWithString(const char* text, realDimensions = _calculateStringSize(stringWithAttributes, font, &dimensions, enableWrap, overflow); // Mac crashes if the width or height is 0 - CC_BREAK_IF(realDimensions.width <= 0 || realDimensions.height <= 0); + AX_BREAK_IF(realDimensions.width <= 0 || realDimensions.height <= 0); if (dimensions.width <= 0.f) dimensions.width = realDimensions.width; diff --git a/core/platform/mac/CCGL-mac.h b/core/platform/mac/CCGL-mac.h index 91a7e42189..5a932ef8ed 100644 --- a/core/platform/mac/CCGL-mac.h +++ b/core/platform/mac/CCGL-mac.h @@ -28,13 +28,13 @@ THE SOFTWARE. #define __PLATFORM_MAC_CCGL_H__ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_MAC # import # import # import -# define CC_GL_DEPTH24_STENCIL8 -1 +# define AX_GL_DEPTH24_STENCIL8 -1 # define glDeleteVertexArrays glDeleteVertexArraysAPPLE # define glGenVertexArrays glGenVertexArraysAPPLE @@ -109,4 +109,4 @@ THE SOFTWARE. #endif // __PLATFORM_MAC_CCGL_H__ -#endif // s CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#endif // s AX_TARGET_PLATFORM == AX_PLATFORM_MAC diff --git a/core/platform/mac/CCGLViewImpl-mac.h b/core/platform/mac/CCGLViewImpl-mac.h index b1bceb5e98..a59cc5bf31 100644 --- a/core/platform/mac/CCGLViewImpl-mac.h +++ b/core/platform/mac/CCGLViewImpl-mac.h @@ -30,7 +30,7 @@ THE SOFTWARE. #include "platform/CCGLView.h" #include "glfw3.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # ifndef GLFW_EXPOSE_NATIVE_WIN32 # define GLFW_EXPOSE_NATIVE_WIN32 # endif @@ -38,9 +38,9 @@ THE SOFTWARE. # define GLFW_EXPOSE_NATIVE_WGL # endif # include "glfw3native.h" -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # ifndef GLFW_EXPOSE_NATIVE_NSGL # define GLFW_EXPOSE_NATIVE_NSGL # endif @@ -48,12 +48,12 @@ THE SOFTWARE. # define GLFW_EXPOSE_NATIVE_COCOA # endif # include "glfw3native.h" -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) NS_AX_BEGIN class GLFWEventHandler; -class CC_DLL GLViewImpl : public GLView +class AX_DLL GLViewImpl : public GLView { friend class GLFWEventHandler; @@ -118,11 +118,11 @@ public: virtual void setFrameSize(float width, float height) override; virtual void setIMEKeyboardState(bool bOpen) override; -#if CC_ICON_SET_SUPPORT +#if AX_ICON_SET_SUPPORT virtual void setIcon(std::string_view filename) const override; virtual void setIcon(const std::vector& filelist) const override; virtual void setDefaultIcon() const override; -#endif /* CC_ICON_SET_SUPPORT */ +#endif /* AX_ICON_SET_SUPPORT */ /* * Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop. @@ -191,7 +191,7 @@ public: static const std::string EVENT_WINDOW_UNFOCUSED; private: - CC_DISALLOW_COPY_AND_ASSIGN(GLViewImpl); + AX_DISALLOW_COPY_AND_ASSIGN(GLViewImpl); }; NS_AX_END // end of namespace cocos2d diff --git a/core/platform/mac/CCGLViewImpl-mac.mm b/core/platform/mac/CCGLViewImpl-mac.mm index 22f825d7d2..ed3f7d4cfb 100644 --- a/core/platform/mac/CCGLViewImpl-mac.mm +++ b/core/platform/mac/CCGLViewImpl-mac.mm @@ -39,9 +39,9 @@ THE SOFTWARE. #include "base/ccUtils.h" #include "base/ccUTF8.h" #include "2d/CCCamera.h" -#if CC_ICON_SET_SUPPORT +#if AX_ICON_SET_SUPPORT # include "platform/CCImage.h" -#endif /* CC_ICON_SET_SUPPORT */ +#endif /* AX_ICON_SET_SUPPORT */ #include "renderer/backend/metal/DeviceMTL.h" #include "renderer/CCRenderer.h" #include "renderer/backend/metal/UtilsMTL.h" @@ -304,7 +304,7 @@ GLViewImpl::GLViewImpl(bool initglfw) GLViewImpl::~GLViewImpl() { - CCLOGINFO("deallocing GLViewImpl: %p", this); + AXLOGINFO("deallocing GLViewImpl: %p", this); GLFWEventHandler::setGLViewImpl(nullptr); glfwTerminate(); } @@ -322,7 +322,7 @@ GLViewImpl* GLViewImpl::create(std::string_view viewName, bool resizable) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -334,7 +334,7 @@ GLViewImpl* GLViewImpl::createWithRect(std::string_view viewName, Rect rect, flo ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -346,7 +346,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -360,7 +360,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -380,7 +380,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ glfwWindowHint(GLFW_SAMPLES, _glContextAttrs.multisamplingCount); -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) // Don't create gl context. glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); #endif @@ -410,12 +410,12 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ size.width = static_cast(fbWidth); size.height = static_cast(fbHeight); -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) // Initialize device. id device = MTLCreateSystemDefaultDevice(); if (!device) { - CCLOG("Doesn't support metal."); + AXLOG("Doesn't support metal."); return false; } @@ -452,7 +452,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ rect.size.height = realH / _frameZoomFactor; } -#if defined(CC_USE_GL) +#if defined(AX_USE_GL) glfwMakeContextCurrent(_mainWindow); glfwSwapInterval(_glContextAttrs.vsync ? 1 : 0); #endif @@ -519,7 +519,7 @@ void GLViewImpl::end() void GLViewImpl::swapBuffers() { -#if defined(CC_USE_GL) +#if defined(AX_USE_GL) if (_mainWindow) glfwSwapBuffers(_mainWindow); #endif @@ -554,7 +554,7 @@ void GLViewImpl::enableRetina(bool enabled) void GLViewImpl::setIMEKeyboardState(bool /*bOpen*/) {} -#if CC_ICON_SET_SUPPORT +#if AX_ICON_SET_SUPPORT void GLViewImpl::setIcon(std::string_view filename) const { std::vector vec = {filename}; @@ -575,7 +575,7 @@ void GLViewImpl::setIcon(const std::vector& filelist) const } else { - CC_SAFE_DELETE(icon); + AX_SAFE_DELETE(icon); } } @@ -595,10 +595,10 @@ void GLViewImpl::setIcon(const std::vector& filelist) const GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, iconsCount, images); - CC_SAFE_DELETE_ARRAY(images); + AX_SAFE_DELETE_ARRAY(images); for (auto& icon : icons) { - CC_SAFE_DELETE(icon); + AX_SAFE_DELETE(icon); } } @@ -607,7 +607,7 @@ void GLViewImpl::setDefaultIcon() const GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, 0, nullptr); } -#endif /* CC_ICON_SET_SUPPORT */ +#endif /* AX_ICON_SET_SUPPORT */ void GLViewImpl::setCursorVisible(bool isVisible) { @@ -622,7 +622,7 @@ void GLViewImpl::setCursorVisible(bool isVisible) void GLViewImpl::setFrameZoomFactor(float zoomFactor) { - CCASSERT(zoomFactor > 0.0f, "zoomFactor must be larger than 0"); + AXASSERT(zoomFactor > 0.0f, "zoomFactor must be larger than 0"); if (std::abs(_frameZoomFactor - zoomFactor) < FLT_EPSILON) { @@ -711,7 +711,7 @@ void GLViewImpl::setWindowed(int width, int height) ypos += (int)((videoMode->height - height) * 0.5f); _monitor = nullptr; glfwSetWindowMonitor(_mainWindow, nullptr, xpos, ypos, width, height, GLFW_DONT_CARE); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) // on mac window will sometimes lose title when windowed glfwSetWindowTitle(_mainWindow, _viewName.c_str()); #endif @@ -852,7 +852,7 @@ void GLViewImpl::onGLFWError(int errorID, const char* errorDesc) { _glfwError.append(StringUtils::format("GLFWError #%d Happen, %s\n", errorID, errorDesc)); } - CCLOGERROR("%s", _glfwError.c_str()); + AXLOGERROR("%s", _glfwError.c_str()); } void GLViewImpl::onGLFWMouseCallBack(GLFWwindow* /*window*/, int button, int action, int /*modify*/) @@ -1030,7 +1030,7 @@ void GLViewImpl::onGLFWWindowSizeCallback(GLFWwindow* /*window*/, int width, int Director::getInstance()->setViewport(); Director::getInstance()->getEventDispatcher()->dispatchCustomEvent(GLViewImpl::EVENT_WINDOW_RESIZED, nullptr); -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) // update metal attachment texture size. int fbWidth, fbHeight; glfwGetFramebufferSize(_mainWindow, &fbWidth, &fbHeight); diff --git a/core/platform/mac/CCPlatformDefine-mac.h b/core/platform/mac/CCPlatformDefine-mac.h index 8681478aac..41e403f93e 100644 --- a/core/platform/mac/CCPlatformDefine-mac.h +++ b/core/platform/mac/CCPlatformDefine-mac.h @@ -27,15 +27,15 @@ THE SOFTWARE. #include -#define CC_DLL +#define AX_DLL -#if CC_DISABLE_ASSERT > 0 -# define CC_ASSERT(cond) +#if AX_DISABLE_ASSERT > 0 +# define AX_ASSERT(cond) #else -# define CC_ASSERT(cond) assert(cond) +# define AX_ASSERT(cond) assert(cond) #endif -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam +#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam /* Define NULL pointer value */ #ifndef NULL diff --git a/core/platform/win32/CCApplication-win32.cpp b/core/platform/win32/CCApplication-win32.cpp index 8bf743da57..6bb58c55ca 100644 --- a/core/platform/win32/CCApplication-win32.cpp +++ b/core/platform/win32/CCApplication-win32.cpp @@ -49,13 +49,13 @@ Application::Application() : _instance(nullptr), _accelTable(nullptr) { _instance = GetModuleHandle(nullptr); _animationInterval.QuadPart = 0; - CC_ASSERT(!sm_pSharedApplication); + AX_ASSERT(!sm_pSharedApplication); sm_pSharedApplication = this; } Application::~Application() { - CC_ASSERT(this == sm_pSharedApplication); + AX_ASSERT(this == sm_pSharedApplication); sm_pSharedApplication = nullptr; } @@ -155,7 +155,7 @@ void Application::setAnimationInterval(float interval) ////////////////////////////////////////////////////////////////////////// Application* Application::getInstance() { - CC_ASSERT(sm_pSharedApplication); + AX_ASSERT(sm_pSharedApplication); return sm_pSharedApplication; } diff --git a/core/platform/win32/CCApplication-win32.h b/core/platform/win32/CCApplication-win32.h index d31ced54f1..bc2f3344c8 100644 --- a/core/platform/win32/CCApplication-win32.h +++ b/core/platform/win32/CCApplication-win32.h @@ -32,7 +32,7 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL Application : public ApplicationProtocol +class AX_DLL Application : public ApplicationProtocol { public: /** @@ -84,13 +84,13 @@ public: * Sets the Resource root path. * @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead. */ - CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(std::string_view rootResDir); + AX_DEPRECATED_ATTRIBUTE void setResourceRootPath(std::string_view rootResDir); /** * Gets the Resource root path. * @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. */ - CC_DEPRECATED_ATTRIBUTE std::string_view getResourceRootPath(); + AX_DEPRECATED_ATTRIBUTE std::string_view getResourceRootPath(); void setStartupScriptFilename(std::string_view startupScriptFile); diff --git a/core/platform/win32/CCDevice-win32.cpp b/core/platform/win32/CCDevice-win32.cpp index e18b7eebca..f89546d4b8 100644 --- a/core/platform/win32/CCDevice-win32.cpp +++ b/core/platform/win32/CCDevice-win32.cpp @@ -143,7 +143,7 @@ public: SIZE tRet = {0}; do { - CC_BREAK_IF(!pszText || nLen <= 0); + AX_BREAK_IF(!pszText || nLen <= 0); RECT rc = {0, 0, 0, 0}; DWORD dwCalcFmt = DT_CALCRECT; @@ -232,7 +232,7 @@ public: wchar_t* fixedText = nullptr; do { - CC_BREAK_IF(!pszText); + AX_BREAK_IF(!pszText); DWORD dwFmt = DT_WORDBREAK; if (!enableWrap) @@ -259,7 +259,7 @@ public: // utf-8 to utf-16 int nBufLen = nLen + 1; pwszBuffer = new wchar_t[nBufLen]; - CC_BREAK_IF(!pwszBuffer); + AX_BREAK_IF(!pwszBuffer); memset(pwszBuffer, 0, sizeof(wchar_t) * nBufLen); nLen = MultiByteToWideChar(CP_UTF8, 0, pszText, nLen, pwszBuffer, nBufLen); @@ -353,7 +353,7 @@ public: } } - CC_BREAK_IF(!prepareBitmap(tSize.cx, tSize.cy)); + AX_BREAK_IF(!prepareBitmap(tSize.cx, tSize.cy)); // draw text HGDIOBJ hOldFont = SelectObject(_DC, _font); @@ -375,14 +375,14 @@ public: SelectObject(_DC, hOldBmp); SelectObject(_DC, hOldFont); } while (0); - CC_SAFE_DELETE_ARRAY(pwszBuffer); + AX_SAFE_DELETE_ARRAY(pwszBuffer); delete[] fixedText; return nRet; } - CC_SYNTHESIZE_READONLY(HDC, _DC, DC); - CC_SYNTHESIZE_READONLY(HBITMAP, _bmp, Bitmap); + AX_SYNTHESIZE_READONLY(HDC, _DC, DC); + AX_SYNTHESIZE_READONLY(HBITMAP, _bmp, Bitmap); private: friend class Image; @@ -426,12 +426,12 @@ Data Device::getTextureDataForText(const char* text, // draw text // does changing to SIZE here affects the font size by rounding from float? SIZE size = {(LONG)textDefinition._dimensions.width, (LONG)textDefinition._dimensions.height}; - CC_BREAK_IF(!dc.drawText(text, size, align, textDefinition._fontName.c_str(), (int)textDefinition._fontSize, + AX_BREAK_IF(!dc.drawText(text, size, align, textDefinition._fontName.c_str(), (int)textDefinition._fontSize, textDefinition._enableWrap, textDefinition._overflow)); int dataLen = size.cx * size.cy * 4; unsigned char* dataBuf = (unsigned char*)malloc(sizeof(unsigned char) * dataLen); - CC_BREAK_IF(!dataBuf); + AX_BREAK_IF(!dataBuf); struct { @@ -439,7 +439,7 @@ Data Device::getTextureDataForText(const char* text, int mask[4]; } bi = {0}; bi.bmiHeader.biSize = sizeof(bi.bmiHeader); - CC_BREAK_IF(!GetDIBits(dc.getDC(), dc.getBitmap(), 0, 0, nullptr, (LPBITMAPINFO)&bi, DIB_RGB_COLORS)); + AX_BREAK_IF(!GetDIBits(dc.getDC(), dc.getBitmap(), 0, 0, nullptr, (LPBITMAPINFO)&bi, DIB_RGB_COLORS)); width = (short)size.cx; height = (short)size.cy; @@ -473,12 +473,12 @@ Data Device::getTextureDataForText(const char* text, void Device::setKeepScreenOn(bool value) { - CC_UNUSED_PARAM(value); + AX_UNUSED_PARAM(value); } void Device::vibrate(float duration) { - CC_UNUSED_PARAM(duration); + AX_UNUSED_PARAM(duration); } NS_AX_END diff --git a/core/platform/win32/CCFileUtils-win32.cpp b/core/platform/win32/CCFileUtils-win32.cpp index 342cab1b5d..714274ab3b 100644 --- a/core/platform/win32/CCFileUtils-win32.cpp +++ b/core/platform/win32/CCFileUtils-win32.cpp @@ -98,7 +98,7 @@ FileUtils* FileUtils::getInstance() { delete s_sharedFileUtils; s_sharedFileUtils = nullptr; - CCLOG("ERROR: Could not init CCFileUtilsWin32"); + AXLOG("ERROR: Could not init CCFileUtilsWin32"); } } return s_sharedFileUtils; @@ -175,7 +175,7 @@ FileUtils::Status FileUtilsWin32::getContents(std::string_view filename, Resizab if (!successed) { - CCLOG("Get data from file(%s) failed, error code is %s", filename.data(), + AXLOG("Get data from file(%s) failed, error code is %s", filename.data(), std::to_string(::GetLastError()).data()); buffer->resize(sizeRead); return FileUtils::Status::ReadFailed; @@ -277,8 +277,8 @@ std::string FileUtilsWin32::getNativeWritableAbsolutePath() const bool FileUtilsWin32::renameFile(std::string_view oldfullpath, std::string_view newfullpath) const { - CCASSERT(!oldfullpath.empty(), "Invalid path"); - CCASSERT(!newfullpath.empty(), "Invalid path"); + AXASSERT(!oldfullpath.empty(), "Invalid path"); + AXASSERT(!newfullpath.empty(), "Invalid path"); std::wstring _wNew = ntcvt::from_chars(newfullpath); std::wstring _wOld = ntcvt::from_chars(oldfullpath); @@ -287,7 +287,7 @@ bool FileUtilsWin32::renameFile(std::string_view oldfullpath, std::string_view n { if (!DeleteFile(_wNew.c_str())) { - CCLOGERROR("Fail to delete file %s !Error code is 0x%x", newfullpath.data(), GetLastError()); + AXLOGERROR("Fail to delete file %s !Error code is 0x%x", newfullpath.data(), GetLastError()); } } @@ -297,7 +297,7 @@ bool FileUtilsWin32::renameFile(std::string_view oldfullpath, std::string_view n } else { - CCLOGERROR("Fail to rename file %s to %s !Error code is 0x%x", oldfullpath.data(), newfullpath.data(), + AXLOGERROR("Fail to rename file %s to %s !Error code is 0x%x", oldfullpath.data(), newfullpath.data(), GetLastError()); return false; } @@ -305,7 +305,7 @@ bool FileUtilsWin32::renameFile(std::string_view oldfullpath, std::string_view n bool FileUtilsWin32::renameFile(std::string_view path, std::string_view oldname, std::string_view name) const { - CCASSERT(!path.empty(), "Invalid path"); + AXASSERT(!path.empty(), "Invalid path"); std::string oldPath{path}; oldPath += oldname; std::string newPath{path}; @@ -320,7 +320,7 @@ bool FileUtilsWin32::renameFile(std::string_view path, std::string_view oldname, bool FileUtilsWin32::createDirectory(std::string_view dirPath) const { - CCASSERT(!dirPath.empty(), "Invalid path"); + AXASSERT(!dirPath.empty(), "Invalid path"); if (isDirectoryExist(dirPath)) return true; @@ -366,7 +366,7 @@ bool FileUtilsWin32::createDirectory(std::string_view dirPath) const BOOL ret = CreateDirectoryW(subpath.c_str(), NULL); if (!ret && ERROR_ALREADY_EXISTS != GetLastError()) { - CCLOGERROR("Fail create directory %s !Error code is 0x%x", utf8Path.c_str(), GetLastError()); + AXLOGERROR("Fail create directory %s !Error code is 0x%x", utf8Path.c_str(), GetLastError()); return false; } } @@ -385,7 +385,7 @@ bool FileUtilsWin32::removeFile(std::string_view filepath) const } else { - CCLOGERROR("Fail remove file %s !Error code is 0x%x", filepath.data(), GetLastError()); + AXLOGERROR("Fail remove file %s !Error code is 0x%x", filepath.data(), GetLastError()); return false; } } diff --git a/core/platform/win32/CCFileUtils-win32.h b/core/platform/win32/CCFileUtils-win32.h index 6a248f28fe..d47d1a48ca 100644 --- a/core/platform/win32/CCFileUtils-win32.h +++ b/core/platform/win32/CCFileUtils-win32.h @@ -41,7 +41,7 @@ NS_AX_BEGIN */ //! @brief Helper class to handle file operations -class CC_DLL FileUtilsWin32 : public FileUtils +class AX_DLL FileUtilsWin32 : public FileUtils { friend class FileUtils; diff --git a/core/platform/win32/CCGL-win32.h b/core/platform/win32/CCGL-win32.h index 86f919dd6c..449b3b6252 100644 --- a/core/platform/win32/CCGL-win32.h +++ b/core/platform/win32/CCGL-win32.h @@ -27,11 +27,11 @@ THE SOFTWARE. #pragma once #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include "glad/glad.h" -# if defined(CC_USE_GLES) +# if defined(AX_USE_GLES) # undef GL_DEPTH_STENCIL # undef GL_DEPTH24_STENCIL8 # undef GL_UNSIGNED_INT_24_8 @@ -90,4 +90,4 @@ THE SOFTWARE. # endif -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 diff --git a/core/platform/win32/CCPlatformDefine-win32.h b/core/platform/win32/CCPlatformDefine-win32.h index 1ccc2dc0cf..e3c65800e0 100644 --- a/core/platform/win32/CCPlatformDefine-win32.h +++ b/core/platform/win32/CCPlatformDefine-win32.h @@ -29,24 +29,24 @@ THE SOFTWARE. # include #endif -#if defined(CC_STATIC) -# define CC_DLL +#if defined(AX_STATIC) +# define AX_DLL #else # if defined(_USRDLL) -# define CC_DLL __declspec(dllexport) +# define AX_DLL __declspec(dllexport) # else /* use a DLL library */ -# define CC_DLL __declspec(dllimport) +# define AX_DLL __declspec(dllimport) # endif #endif #include -#if CC_DISABLE_ASSERT > 0 -# define CC_ASSERT(cond) +#if AX_DISABLE_ASSERT > 0 +# define AX_ASSERT(cond) #else -# define CC_ASSERT(cond) assert(cond) +# define AX_ASSERT(cond) assert(cond) #endif -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam +#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam /* Define NULL pointer value */ #ifndef NULL diff --git a/core/platform/win32/CCStdC-win32.h b/core/platform/win32/CCStdC-win32.h index ad177da6a6..bac118457f 100644 --- a/core/platform/win32/CCStdC-win32.h +++ b/core/platform/win32/CCStdC-win32.h @@ -106,7 +106,7 @@ struct timezone int tz_dsttime; }; -int CC_DLL gettimeofday(struct timeval*, struct timezone*); +int AX_DLL gettimeofday(struct timeval*, struct timezone*); NS_AX_END diff --git a/core/platform/win32/compat/stdint.h b/core/platform/win32/compat/stdint.h index 7b95775d5a..cb188c58c1 100644 --- a/core/platform/win32/compat/stdint.h +++ b/core/platform/win32/compat/stdint.h @@ -33,7 +33,7 @@ #define _MSC_STDINT_H_ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # ifndef _MSC_VER // [ # error "Use this header only with Microsoft Visual C++ compilers!" @@ -243,6 +243,6 @@ typedef uint64_t uintmax_t; # endif // __STDC_CONSTANT_MACROS ] -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 #endif // _MSC_STDINT_H_ ] diff --git a/core/renderer/CCCallbackCommand.h b/core/renderer/CCCallbackCommand.h index 7b8d6c467c..cde6b6e29e 100644 --- a/core/renderer/CCCallbackCommand.h +++ b/core/renderer/CCCallbackCommand.h @@ -46,7 +46,7 @@ executed. You can do some logic opertion in the callback, such as invoking renderer to set depth/stencil test. Don't suggest to invoke backen API in the callback function. */ -class CC_DLL CallbackCommand : public RenderCommand +class AX_DLL CallbackCommand : public RenderCommand { // only allow render to manage the callbackCommand friend class Renderer; diff --git a/core/renderer/CCColorizer.h b/core/renderer/CCColorizer.h index 0aa10ff499..dcf568492e 100644 --- a/core/renderer/CCColorizer.h +++ b/core/renderer/CCColorizer.h @@ -11,7 +11,7 @@ # include NS_AX_BEGIN -class CC_DLL Colorizer +class AX_DLL Colorizer { public: static bool enableNodeIntelliShading(Node* node, const Vec3& hsv, const Vec3& filter = Vec3(1.0f, 0.45f, 0.3109f)); diff --git a/core/renderer/CCCustomCommand.cpp b/core/renderer/CCCustomCommand.cpp index f14c9cce2b..88f0d794d3 100644 --- a/core/renderer/CCCustomCommand.cpp +++ b/core/renderer/CCCustomCommand.cpp @@ -38,8 +38,8 @@ CustomCommand::CustomCommand() CustomCommand::~CustomCommand() { - CC_SAFE_RELEASE(_vertexBuffer); - CC_SAFE_RELEASE(_indexBuffer); + AX_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_indexBuffer); } CustomCommand::CustomCommand(const CustomCommand& rhs) @@ -85,8 +85,8 @@ void CustomCommand::assign(const CustomCommand& rhs) auto podSize = offsetof(CustomCommand, _beforeCallback) - podOffset; memcpy((uint8_t*)this + podOffset, (const uint8_t*)&rhs + podOffset, podSize); - CC_SAFE_RETAIN(_vertexBuffer); - CC_SAFE_RETAIN(_indexBuffer); + AX_SAFE_RETAIN(_vertexBuffer); + AX_SAFE_RETAIN(_indexBuffer); _beforeCallback = rhs._beforeCallback; _afterCallback = rhs._afterCallback; @@ -136,7 +136,7 @@ void CustomCommand::init(float globalZOrder, const BlendFunc& blendFunc) void CustomCommand::createVertexBuffer(std::size_t vertexSize, std::size_t capacity, BufferUsage usage) { - CC_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_vertexBuffer); _vertexCapacity = capacity; _vertexDrawCount = capacity; @@ -147,7 +147,7 @@ void CustomCommand::createVertexBuffer(std::size_t vertexSize, std::size_t capac void CustomCommand::createIndexBuffer(IndexFormat format, std::size_t capacity, BufferUsage usage) { - CC_SAFE_RELEASE(_indexBuffer); + AX_SAFE_RELEASE(_indexBuffer); _indexFormat = format; _indexSize = computeIndexSize(); @@ -175,9 +175,9 @@ void CustomCommand::setVertexBuffer(backend::Buffer* vertexBuffer) if (_vertexBuffer == vertexBuffer) return; - CC_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_vertexBuffer); _vertexBuffer = vertexBuffer; - CC_SAFE_RETAIN(_vertexBuffer); + AX_SAFE_RETAIN(_vertexBuffer); } void CustomCommand::setIndexBuffer(backend::Buffer* indexBuffer, IndexFormat format) @@ -185,9 +185,9 @@ void CustomCommand::setIndexBuffer(backend::Buffer* indexBuffer, IndexFormat for if (_indexBuffer == indexBuffer && _indexFormat == format) return; - CC_SAFE_RELEASE(_indexBuffer); + AX_SAFE_RELEASE(_indexBuffer); _indexBuffer = indexBuffer; - CC_SAFE_RETAIN(_indexBuffer); + AX_SAFE_RETAIN(_indexBuffer); _indexFormat = format; _indexSize = computeIndexSize(); diff --git a/core/renderer/CCCustomCommand.h b/core/renderer/CCCustomCommand.h index a9169df0f0..ef67cf6b18 100644 --- a/core/renderer/CCCustomCommand.h +++ b/core/renderer/CCCustomCommand.h @@ -42,7 +42,7 @@ class Buffer; Custom command is used to draw all things except triangle commands. You can use this command to draw things, just provide vertex/index data and set corret flags. */ -class CC_DLL CustomCommand : public RenderCommand +class AX_DLL CustomCommand : public RenderCommand { public: enum class DrawType diff --git a/core/renderer/CCGroupCommand.h b/core/renderer/CCGroupCommand.h index 92578b9f90..d767bdaad5 100644 --- a/core/renderer/CCGroupCommand.h +++ b/core/renderer/CCGroupCommand.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef _CC_GROUPCOMMAND_H_ -#define _CC_GROUPCOMMAND_H_ +#ifndef _AX_GROUPCOMMAND_H_ +#define _AX_GROUPCOMMAND_H_ #include #include @@ -59,7 +59,7 @@ protected: GroupCommand is used to group several command together, and more, it can be nested. So it is used to generate the hierarchy for the rendcommands. Every group command will be assigned by a group ID. */ -class CC_DLL GroupCommand : public RenderCommand +class AX_DLL GroupCommand : public RenderCommand { public: /**@{ @@ -85,4 +85,4 @@ NS_AX_END end of support group @} */ -#endif //_CC_GROUPCOMMAND_H_ +#endif //_AX_GROUPCOMMAND_H_ diff --git a/core/renderer/CCMaterial.cpp b/core/renderer/CCMaterial.cpp index 0cb537791a..a9c5c59955 100644 --- a/core/renderer/CCMaterial.cpp +++ b/core/renderer/CCMaterial.cpp @@ -40,7 +40,7 @@ #include -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # define strcasecmp _stricmp #endif @@ -103,7 +103,7 @@ Material* Material::createWithProperties(Properties* materialProperties) Material* Material::createWithProgramState(backend::ProgramState* programState) { - CCASSERT(programState, "Invalid Program State"); + AXASSERT(programState, "Invalid Program State"); auto mat = new Material(); if (mat->initWithProgramState(programState)) @@ -138,7 +138,7 @@ bool Material::initWithFile(std::string_view validfilename) // get the first material parseProperties((strlen(properties->getNamespace()) > 0) ? properties : properties->getNextNamespace()); - CC_SAFE_DELETE(properties); + AX_SAFE_DELETE(properties); return true; } @@ -249,7 +249,7 @@ bool Material::parsePass(Technique* technique, Properties* passProperties) } else { - CCASSERT(false, "Invalid namespace"); + AXASSERT(false, "Invalid namespace"); return false; } @@ -262,7 +262,7 @@ bool Material::parsePass(Technique* technique, Properties* passProperties) // cocos2d-x doesn't support Samplers yet. But will be added soon bool Material::parseSampler(backend::ProgramState* programState, Properties* samplerProperties) { - CCASSERT(samplerProperties->getId(), "Sampler must have an id. The id is the uniform name"); + AXASSERT(samplerProperties->getId(), "Sampler must have an id. The id is the uniform name"); // required auto filename = samplerProperties->getString("path"); @@ -270,7 +270,7 @@ bool Material::parseSampler(backend::ProgramState* programState, Properties* sam auto texture = Director::getInstance()->getTextureCache()->addImage(filename); if (!texture) { - CCLOG("Invalid filepath"); + AXLOG("Invalid filepath"); return false; } @@ -294,7 +294,7 @@ bool Material::parseSampler(backend::ProgramState* programState, Properties* sam else if (strcasecmp(wrapS, "CLAMP_TO_EDGE") == 0) texParams.sAddressMode = backend::SamplerAddressMode::CLAMP_TO_EDGE; else - CCLOG("Invalid wrapS: %s", wrapS); + AXLOG("Invalid wrapS: %s", wrapS); // valid options: REPEAT, CLAMP const char* wrapT = getOptionalString(samplerProperties, "wrapT", "CLAMP_TO_EDGE"); @@ -303,7 +303,7 @@ bool Material::parseSampler(backend::ProgramState* programState, Properties* sam else if (strcasecmp(wrapT, "CLAMP_TO_EDGE") == 0) texParams.tAddressMode = backend::SamplerAddressMode::CLAMP_TO_EDGE; else - CCLOG("Invalid wrapT: %s", wrapT); + AXLOG("Invalid wrapT: %s", wrapT); // valid options: NEAREST, LINEAR, NEAREST_MIPMAP_NEAREST, LINEAR_MIPMAP_NEAREST, NEAREST_MIPMAP_LINEAR, // LINEAR_MIPMAP_LINEAR @@ -322,7 +322,7 @@ bool Material::parseSampler(backend::ProgramState* programState, Properties* sam else if (strcasecmp(minFilter, "LINEAR_MIPMAP_LINEAR") == 0) texParams.minFilter = backend::SamplerFilter::LINEAR; else - CCLOG("Invalid minFilter: %s", minFilter); + AXLOG("Invalid minFilter: %s", minFilter); // valid options: NEAREST, LINEAR const char* magFilter = getOptionalString(samplerProperties, "magFilter", "LINEAR"); @@ -331,7 +331,7 @@ bool Material::parseSampler(backend::ProgramState* programState, Properties* sam else if (strcasecmp(magFilter, "LINEAR") == 0) texParams.magFilter = backend::SamplerFilter::LINEAR; else - CCLOG("Invalid magFilter: %s", magFilter); + AXLOG("Invalid magFilter: %s", magFilter); texture->setTexParameters(texParams); } @@ -341,7 +341,7 @@ bool Material::parseSampler(backend::ProgramState* programState, Properties* sam if (!location) { - CCLOG("warning: failed to find texture uniform location %s when parsing material", textureName); + AXLOG("warning: failed to find texture uniform location %s when parsing material", textureName); return false; } @@ -408,8 +408,8 @@ bool Material::parseShader(Pass* pass, Properties* shaderProperties) } space = shaderProperties->getNextNamespace(); } - CC_SAFE_RELEASE(program); - CC_SAFE_RELEASE(programState); + AX_SAFE_RELEASE(program); + AX_SAFE_RELEASE(programState); } return true; @@ -554,7 +554,7 @@ Technique* Material::getTechniqueByName(std::string_view name) Technique* Material::getTechniqueByIndex(ssize_t index) { - CC_ASSERT(index >= 0 && index < _techniques.size() && "Invalid size"); + AX_ASSERT(index >= 0 && index < _techniques.size() && "Invalid size"); return _techniques.at(index); } diff --git a/core/renderer/CCMaterial.h b/core/renderer/CCMaterial.h index 2908d341fa..95505e8d8c 100644 --- a/core/renderer/CCMaterial.h +++ b/core/renderer/CCMaterial.h @@ -58,7 +58,7 @@ class ProgramState; } /// Material -class CC_DLL Material : public Ref +class AX_DLL Material : public Ref { friend class Node; friend class Technique; diff --git a/core/renderer/CCMeshCommand.cpp b/core/renderer/CCMeshCommand.cpp index 3cfe278a70..145e309d7a 100644 --- a/core/renderer/CCMeshCommand.cpp +++ b/core/renderer/CCMeshCommand.cpp @@ -44,16 +44,16 @@ NS_AX_BEGIN MeshCommand::MeshCommand() -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA : _rendererRecreatedListener(nullptr) #endif { _type = RenderCommand::Type::MESH_COMMAND; _is3D = true; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // listen the event that renderer was recreated on Android/WP8 _rendererRecreatedListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, - CC_CALLBACK_1(MeshCommand::listenRendererRecreated, this)); + AX_CALLBACK_1(MeshCommand::listenRendererRecreated, this)); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_rendererRecreatedListener, -1); #endif } @@ -75,12 +75,12 @@ void MeshCommand::init(float globalZOrder, const Mat4& transform) MeshCommand::~MeshCommand() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_rendererRecreatedListener); #endif } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA void MeshCommand::listenRendererRecreated(EventCustom* event) {} #endif diff --git a/core/renderer/CCMeshCommand.h b/core/renderer/CCMeshCommand.h index ce78a53ed5..6c912a2824 100644 --- a/core/renderer/CCMeshCommand.h +++ b/core/renderer/CCMeshCommand.h @@ -41,7 +41,7 @@ class EventCustom; class Material; // it is a common mesh -class CC_DLL MeshCommand : public CustomCommand +class AX_DLL MeshCommand : public CustomCommand { public: // using PrimitiveType = backend::PrimitiveType; @@ -73,12 +73,12 @@ public: void init(float globalZOrder, const Mat4& transform); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA void listenRendererRecreated(EventCustom* event); #endif protected: -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _rendererRecreatedListener; #endif }; diff --git a/core/renderer/CCPass.cpp b/core/renderer/CCPass.cpp index b3c27d98ff..d6d21f8407 100644 --- a/core/renderer/CCPass.cpp +++ b/core/renderer/CCPass.cpp @@ -70,7 +70,7 @@ Pass* Pass::create(Technique* technique) pass->autorelease(); return pass; } - CC_SAFE_DELETE(pass); + AX_SAFE_DELETE(pass); return nullptr; } @@ -82,7 +82,7 @@ Pass* Pass::createWithProgramState(Technique* technique, backend::ProgramState* pass->autorelease(); return pass; } - CC_SAFE_DELETE(pass); + AX_SAFE_DELETE(pass); return nullptr; } @@ -103,8 +103,8 @@ Pass::Pass() {} Pass::~Pass() { - CC_SAFE_RELEASE(_vertexAttribBinding); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_vertexAttribBinding); + AX_SAFE_RELEASE(_programState); } Pass* Pass::clone() const @@ -115,7 +115,7 @@ Pass* Pass::clone() const pass->setProgramState(_programState->clone()); pass->_vertexAttribBinding = _vertexAttribBinding; - CC_SAFE_RETAIN(pass->_vertexAttribBinding); + AX_SAFE_RETAIN(pass->_vertexAttribBinding); pass->setTechnique(_technique); @@ -133,9 +133,9 @@ void Pass::setProgramState(backend::ProgramState* programState) { if (_programState != programState) { - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); _programState = programState; - CC_SAFE_RETAIN(_programState); + AX_SAFE_RETAIN(_programState); initUniformLocations(); _hashDirty = true; } @@ -183,8 +183,8 @@ void Pass::draw(MeshCommand* meshCommand, const Mat4& modelView) { - meshCommand->setBeforeCallback(CC_CALLBACK_0(Pass::onBeforeVisitCmd, this, meshCommand)); - meshCommand->setAfterCallback(CC_CALLBACK_0(Pass::onAfterVisitCmd, this, meshCommand)); + meshCommand->setBeforeCallback(AX_CALLBACK_0(Pass::onBeforeVisitCmd, this, meshCommand)); + meshCommand->setAfterCallback(AX_CALLBACK_0(Pass::onAfterVisitCmd, this, meshCommand)); meshCommand->init(globalZOrder, modelView); meshCommand->setPrimitiveType(primitive); meshCommand->setIndexBuffer(indexBuffer, indexFormat); @@ -248,7 +248,7 @@ void Pass::onAfterVisitCmd(MeshCommand* command) Node* Pass::getTarget() const { - CCASSERT(_technique && _technique->_material, "Pass must have a Technique and Material"); + AXASSERT(_technique && _technique->_material, "Pass must have a Technique and Material"); Material* material = _technique->_material; return material->_target; @@ -263,9 +263,9 @@ void Pass::setVertexAttribBinding(VertexAttribBinding* binding) { if (_vertexAttribBinding != binding) { - CC_SAFE_RELEASE(_vertexAttribBinding); + AX_SAFE_RELEASE(_vertexAttribBinding); _vertexAttribBinding = binding; - CC_SAFE_RETAIN(_vertexAttribBinding); + AX_SAFE_RETAIN(_vertexAttribBinding); } } diff --git a/core/renderer/CCPass.h b/core/renderer/CCPass.h index 26963d9974..1c8ee68000 100644 --- a/core/renderer/CCPass.h +++ b/core/renderer/CCPass.h @@ -51,7 +51,7 @@ class ProgramState; class Buffer; } // namespace backend -class CC_DLL Pass : public Ref +class AX_DLL Pass : public Ref { friend class Material; friend class Technique; diff --git a/core/renderer/CCPipelineDescriptor.h b/core/renderer/CCPipelineDescriptor.h index 8b24a2cec0..92a109eecc 100644 --- a/core/renderer/CCPipelineDescriptor.h +++ b/core/renderer/CCPipelineDescriptor.h @@ -38,7 +38,7 @@ */ NS_AX_BEGIN -struct CC_DLL PipelineDescriptor +struct AX_DLL PipelineDescriptor { backend::ProgramState* programState = nullptr; backend::BlendDescriptor blendDescriptor; diff --git a/core/renderer/CCQuadCommand.cpp b/core/renderer/CCQuadCommand.cpp index 3442c1095f..a6224e041d 100644 --- a/core/renderer/CCQuadCommand.cpp +++ b/core/renderer/CCQuadCommand.cpp @@ -43,7 +43,7 @@ QuadCommand::~QuadCommand() { for (auto& indices : _ownedIndices) { - CC_SAFE_DELETE_ARRAY(indices); + AX_SAFE_DELETE_ARRAY(indices); } } @@ -61,7 +61,7 @@ void QuadCommand::reIndex(int indicesCount) indicesCount *= 1.25; indicesCount = std::min(indicesCount, 65536); - CCLOG("cocos2d: QuadCommand: resizing index size from [%d] to [%d]", __indexCapacity, indicesCount); + AXLOG("cocos2d: QuadCommand: resizing index size from [%d] to [%d]", __indexCapacity, indicesCount); _ownedIndices.push_back(__indices); __indices = new uint16_t[indicesCount]; diff --git a/core/renderer/CCQuadCommand.h b/core/renderer/CCQuadCommand.h index ec36111b35..dd33a45eb6 100644 --- a/core/renderer/CCQuadCommand.h +++ b/core/renderer/CCQuadCommand.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef _CC_QUADCOMMAND_H_ -#define _CC_QUADCOMMAND_H_ +#ifndef _AX_QUADCOMMAND_H_ +#define _AX_QUADCOMMAND_H_ #include @@ -42,7 +42,7 @@ NS_AX_BEGIN Every QuadCommand will have generate material ID by give textureID, glProgramState, Blend function if the material id is the same, these QuadCommands could be batched to save draw call. */ -class CC_DLL QuadCommand : public TrianglesCommand +class AX_DLL QuadCommand : public TrianglesCommand { public: /**Constructor.*/ @@ -84,4 +84,4 @@ NS_AX_END end of support group @} */ -#endif //_CC_QUADCOMMAND_H_ +#endif //_AX_QUADCOMMAND_H_ diff --git a/core/renderer/CCRenderCommand.h b/core/renderer/CCRenderCommand.h index 7804bb1fbc..be72676521 100644 --- a/core/renderer/CCRenderCommand.h +++ b/core/renderer/CCRenderCommand.h @@ -39,7 +39,7 @@ NS_AX_BEGIN * The `Renderer` knows how to render `RenderCommands` objects. */ -class CC_DLL RenderCommand +class AX_DLL RenderCommand { public: /**Enum the type of render command. */ diff --git a/core/renderer/CCRenderCommandPool.h b/core/renderer/CCRenderCommandPool.h index 17474a772d..e0777a81c4 100644 --- a/core/renderer/CCRenderCommandPool.h +++ b/core/renderer/CCRenderCommandPool.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_RENDERCOMMANDPOOL_H__ -#define __CC_RENDERCOMMANDPOOL_H__ +#ifndef __AX_RENDERCOMMANDPOOL_H__ +#define __AX_RENDERCOMMANDPOOL_H__ /// @cond DO_NOT_SHOW #include @@ -42,7 +42,7 @@ public: { // if( 0 != _usedPool.size()) // { - // CCLOG("All RenderCommand should not be used when Pool is released!"); + // AXLOG("All RenderCommand should not be used when Pool is released!"); // } _freePool.clear(); for (auto& allocatedPoolBlock : _allocatedPoolBlocks) @@ -70,7 +70,7 @@ public: { // if(_usedPool.find(ptr) == _usedPool.end()) // { - // CCLOG("push Back Wrong command!"); + // AXLOG("push Back Wrong command!"); // return; // } diff --git a/core/renderer/CCRenderState.cpp b/core/renderer/CCRenderState.cpp index cb34e99396..1685f810fa 100644 --- a/core/renderer/CCRenderState.cpp +++ b/core/renderer/CCRenderState.cpp @@ -46,7 +46,7 @@ std::string RenderState::getName() const void RenderState::bindPass(Pass* pass, MeshCommand* command) { - CC_ASSERT(pass); + AX_ASSERT(pass); assert(pass->_technique && pass->_technique->_material); auto* technique = pass->_technique; auto* material = technique->_material; @@ -87,7 +87,7 @@ void RenderState::StateBlock::bind(PipelineDescriptor* pipelineDescriptor) void RenderState::StateBlock::apply(PipelineDescriptor* pipelineDescriptor) { - // CC_ASSERT(_globalState); + // AX_ASSERT(_globalState); auto renderer = Director::getInstance()->getRenderer(); auto& blend = pipelineDescriptor->blendDescriptor; @@ -221,7 +221,7 @@ static backend::BlendFactor parseBlend(std::string_view value) return backend::BlendFactor::SRC_ALPHA_SATURATE; else { - CCLOG("Unsupported blend value (%s). (Will default to BLEND_ONE if errors are treated as warnings)", + AXLOG("Unsupported blend value (%s). (Will default to BLEND_ONE if errors are treated as warnings)", value.data()); return backend::BlendFactor::ONE; } @@ -250,7 +250,7 @@ static DepthFunction parseDepthFunc(std::string_view value) return DepthFunction::ALWAYS; else { - CCLOG("Unsupported depth function value (%s). Will default to DEPTH_LESS if errors are treated as warnings)", + AXLOG("Unsupported depth function value (%s). Will default to DEPTH_LESS if errors are treated as warnings)", value.data()); return DepthFunction::LESS; } @@ -270,7 +270,7 @@ static CullFaceSide parseCullFaceSide(std::string_view value) // return RenderState::CULL_FACE_SIDE_FRONT_AND_BACK; else { - CCLOG("Unsupported cull face side value (%s). Will default to BACK if errors are treated as warnings.", + AXLOG("Unsupported cull face side value (%s). Will default to BACK if errors are treated as warnings.", value.data()); return CullFaceSide::BACK; } @@ -287,7 +287,7 @@ static FrontFace parseFrontFace(std::string_view value) return FrontFace::CLOCK_WISE; else { - CCLOG("Unsupported front face side value (%s). Will default to CCW if errors are treated as warnings.", + AXLOG("Unsupported front face side value (%s). Will default to CCW if errors are treated as warnings.", value.data()); return FrontFace::COUNTER_CLOCK_WISE; } @@ -333,7 +333,7 @@ void RenderState::StateBlock::setState(std::string_view name, std::string_view v } else { - CCLOG("Unsupported render state string '%s'.", name.data()); + AXLOG("Unsupported render state string '%s'.", name.data()); } } diff --git a/core/renderer/CCRenderState.h b/core/renderer/CCRenderState.h index 1a36017f33..e2f2c09214 100644 --- a/core/renderer/CCRenderState.h +++ b/core/renderer/CCRenderState.h @@ -52,7 +52,7 @@ using DepthFunction = backend::CompareFunction; /** * Defines the rendering state of the graphics device. */ -class CC_DLL RenderState : public Ref +class AX_DLL RenderState : public Ref { friend class Material; friend class Technique; @@ -71,7 +71,7 @@ public: * Defines a block of fixed-function render states that can be applied to a * RenderState object. */ - class CC_DLL StateBlock // : public Ref + class AX_DLL StateBlock // : public Ref { friend class RenderState; friend class Pass; diff --git a/core/renderer/CCRenderer.cpp b/core/renderer/CCRenderer.cpp index e8ba9d3197..694bd30b05 100644 --- a/core/renderer/CCRenderer.cpp +++ b/core/renderer/CCRenderer.cpp @@ -131,7 +131,7 @@ RenderCommand* RenderQueue::operator[](ssize_t index) const } } - CCASSERT(false, "invalid index"); + AXASSERT(false, "invalid index"); return nullptr; } @@ -185,11 +185,11 @@ Renderer::~Renderer() free(_triBatchesToDraw); - CC_SAFE_RELEASE(_depthStencilState); - CC_SAFE_RELEASE(_commandBuffer); - CC_SAFE_RELEASE(_renderPipeline); - CC_SAFE_RELEASE(_defaultRT); - CC_SAFE_RELEASE(_offscreenRT); + AX_SAFE_RELEASE(_depthStencilState); + AX_SAFE_RELEASE(_commandBuffer); + AX_SAFE_RELEASE(_renderPipeline); + AX_SAFE_RELEASE(_defaultRT); + AX_SAFE_RELEASE(_offscreenRT); } void Renderer::init() @@ -234,22 +234,22 @@ void Renderer::addCommand(RenderCommand* command) void Renderer::addCommand(RenderCommand* command, int renderQueueID) { - CCASSERT(!_isRendering, "Cannot add command while rendering"); - CCASSERT(renderQueueID >= 0, "Invalid render queue"); - CCASSERT(command->getType() != RenderCommand::Type::UNKNOWN_COMMAND, "Invalid Command Type"); + AXASSERT(!_isRendering, "Cannot add command while rendering"); + AXASSERT(renderQueueID >= 0, "Invalid render queue"); + AXASSERT(command->getType() != RenderCommand::Type::UNKNOWN_COMMAND, "Invalid Command Type"); _renderGroups[renderQueueID].push_back(command); } void Renderer::pushGroup(int renderQueueID) { - CCASSERT(!_isRendering, "Cannot change render queue while rendering"); + AXASSERT(!_isRendering, "Cannot change render queue while rendering"); _commandGroupStack.push(renderQueueID); } void Renderer::popGroup() { - CCASSERT(!_isRendering, "Cannot change render queue while rendering"); + AXASSERT(!_isRendering, "Cannot change render queue while rendering"); _commandGroupStack.pop(); } @@ -291,14 +291,14 @@ void Renderer::processRenderCommand(RenderCommand* command) if (_queuedTotalVertexCount + cmd->getVertexCount() > VBO_SIZE || _queuedTotalIndexCount + cmd->getIndexCount() > INDEX_VBO_SIZE) { - CCASSERT(cmd->getVertexCount() >= 0 && cmd->getVertexCount() < VBO_SIZE, + AXASSERT(cmd->getVertexCount() >= 0 && cmd->getVertexCount() < VBO_SIZE, "VBO for vertex is not big enough, please break the data down or use customized render command"); - CCASSERT(cmd->getIndexCount() >= 0 && cmd->getIndexCount() < INDEX_VBO_SIZE, + AXASSERT(cmd->getIndexCount() >= 0 && cmd->getIndexCount() < INDEX_VBO_SIZE, "VBO for index is not big enough, please break the data down or use customized render command"); drawBatchedTriangles(); _queuedTotalIndexCount = _queuedTotalVertexCount = 0; -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _queuedIndexCount = _queuedVertexCount = 0; _triangleCommandBufferManager.prepareNextBuffer(); _vertexBuffer = _triangleCommandBufferManager.getVertexBuffer(); @@ -308,7 +308,7 @@ void Renderer::processRenderCommand(RenderCommand* command) // queue it _queuedTriangleCommands.push_back(cmd); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _queuedIndexCount += cmd->getIndexCount(); _queuedVertexCount += cmd->getVertexCount(); #endif @@ -408,7 +408,7 @@ void Renderer::endFrame() { _commandBuffer->endFrame(); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _triangleCommandBufferManager.putbackAllBuffers(); _vertexBuffer = _triangleCommandBufferManager.getVertexBuffer(); _indexBuffer = _triangleCommandBufferManager.getIndexBuffer(); @@ -609,7 +609,7 @@ void Renderer::drawBatchedTriangles() return; /************** 1: Setup up vertices/indices *************/ -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL unsigned int vertexBufferFillOffset = _queuedTotalVertexCount - _queuedVertexCount; unsigned int indexBufferFillOffset = _queuedTotalIndexCount - _queuedIndexCount; #else @@ -638,7 +638,7 @@ void Renderer::drawBatchedTriangles() // in the same batch ? if (batchable && (prevMaterialID == currentMaterialID || firstCommand)) { - CC_ASSERT((firstCommand || _triBatchesToDraw[batchesTotal].cmd->getMaterialID() == cmd->getMaterialID()) && + AX_ASSERT((firstCommand || _triBatchesToDraw[batchesTotal].cmd->getMaterialID() == cmd->getMaterialID()) && "argh... error in logic"); _triBatchesToDraw[batchesTotal].indicesToDraw += cmd->getIndexCount(); _triBatchesToDraw[batchesTotal].cmd = cmd; @@ -673,7 +673,7 @@ void Renderer::drawBatchedTriangles() firstCommand = false; } batchesTotal++; -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _vertexBuffer->updateSubData(_verts, vertexBufferFillOffset * sizeof(_verts[0]), _filledVertex * sizeof(_verts[0])); _indexBuffer->updateSubData(_indices, indexBufferFillOffset * sizeof(_indices[0]), _filledIndex * sizeof(_indices[0])); @@ -706,7 +706,7 @@ void Renderer::drawBatchedTriangles() /************** 3: Cleanup *************/ _queuedTriangleCommands.clear(); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _queuedIndexCount = 0; _queuedVertexCount = 0; #endif @@ -975,7 +975,7 @@ void Renderer::TriangleCommandBufferManager::createBuffer() { auto device = backend::Device::getInstance(); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL // Metal doesn't need to update buffer to make sure it has the correct size. auto vertexBuffer = device->newBuffer(Renderer::VBO_SIZE * sizeof(_verts[0]), backend::BufferType::VERTEX, backend::BufferUsage::DYNAMIC); diff --git a/core/renderer/CCRenderer.h b/core/renderer/CCRenderer.h index 8f479cfa7d..0162654ab9 100644 --- a/core/renderer/CCRenderer.h +++ b/core/renderer/CCRenderer.h @@ -126,7 +126,7 @@ class GroupCommandManager; Whenever possible prefer to use `TrianglesCommand` objects since the renderer will automatically batch them. */ -class CC_DLL Renderer +class AX_DLL Renderer { public: /**The max number of vertices in a vertex buffer object.*/ diff --git a/core/renderer/CCTechnique.cpp b/core/renderer/CCTechnique.cpp index 35d3d30a47..4e0620839d 100644 --- a/core/renderer/CCTechnique.cpp +++ b/core/renderer/CCTechnique.cpp @@ -105,7 +105,7 @@ void Technique::setName(std::string_view name) Pass* Technique::getPassByIndex(ssize_t index) const { - CC_ASSERT(index >= 0 && index < _passes.size() && "Invalid index"); + AX_ASSERT(index >= 0 && index < _passes.size() && "Invalid index"); return _passes.at(index); } diff --git a/core/renderer/CCTechnique.h b/core/renderer/CCTechnique.h index 8b4dbd6b99..e7c8cb0cbd 100644 --- a/core/renderer/CCTechnique.h +++ b/core/renderer/CCTechnique.h @@ -46,7 +46,7 @@ class ProgramState; } /// Technique -class CC_DLL Technique : public Ref +class AX_DLL Technique : public Ref { friend class Material; friend class Renderer; diff --git a/core/renderer/CCTexture2D.cpp b/core/renderer/CCTexture2D.cpp index f9c206e2b3..2e7f8d6df0 100644 --- a/core/renderer/CCTexture2D.cpp +++ b/core/renderer/CCTexture2D.cpp @@ -50,7 +50,7 @@ THE SOFTWARE. #include "renderer/backend/PixelFormatUtils.h" #include "renderer/CCRenderer.h" -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA # include "renderer/CCTextureCache.h" #endif @@ -80,15 +80,15 @@ Texture2D::Texture2D() Texture2D::~Texture2D() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA VolatileTextureMgr::removeTexture(this); #endif - CCLOGINFO("deallocing Texture2D: %p - id=%u", this, _name); + AXLOGINFO("deallocing Texture2D: %p - id=%u", this, _name); - CC_SAFE_DELETE(_ninePatchInfo); + AX_SAFE_DELETE(_ninePatchInfo); - CC_SAFE_RELEASE(_texture); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_programState); } backend::PixelFormat Texture2D::getPixelFormat() const @@ -114,8 +114,8 @@ backend::TextureBackend* Texture2D::getBackendTexture() const Vec2 Texture2D::getContentSize() const { Vec2 ret; - ret.width = _contentSize.width / CC_CONTENT_SCALE_FACTOR(); - ret.height = _contentSize.height / CC_CONTENT_SCALE_FACTOR(); + ret.width = _contentSize.width / AX_CONTENT_SCALE_FACTOR(); + ret.height = _contentSize.height / AX_CONTENT_SCALE_FACTOR(); return ret; } @@ -166,7 +166,7 @@ bool Texture2D::initWithData(const void* data, int pixelsHigh, bool preMultipliedAlpha) { - CCASSERT(dataLen > 0 && pixelsWide > 0 && pixelsHigh > 0, "Invalid size"); + AXASSERT(dataLen > 0 && pixelsWide > 0 && pixelsHigh > 0, "Invalid size"); // if data has no mipmaps, we will consider it has only one mipmap MipmapInfo mipmap; @@ -193,7 +193,7 @@ bool Texture2D::updateWithImage(Image* image, backend::PixelFormat format, int i { if (image == nullptr) { - CCLOG("cocos2d: Texture2D. Can't create Texture. UIImage is nil"); + AXLOG("cocos2d: Texture2D. Can't create Texture. UIImage is nil"); return false; } @@ -208,7 +208,7 @@ bool Texture2D::updateWithImage(Image* image, backend::PixelFormat format, int i int maxTextureSize = conf->getMaxTextureSize(); if (imageWidth > maxTextureSize || imageHeight > maxTextureSize) { - CCLOG("cocos2d: WARNING: Image (%u x %u) is bigger than the supported %u x %u", imageWidth, imageHeight, + AXLOG("cocos2d: WARNING: Image (%u x %u) is bigger than the supported %u x %u", imageWidth, imageHeight, maxTextureSize, maxTextureSize); return false; } @@ -219,11 +219,11 @@ bool Texture2D::updateWithImage(Image* image, backend::PixelFormat format, int i backend::PixelFormat imagePixelFormat = image->getPixelFormat(); size_t tempDataLen = image->getDataLen(); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL //! override renderFormat, since some render format is not supported by metal switch (renderFormat) { -# if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS || TARGET_OS_SIMULATOR) +# if (AX_TARGET_PLATFORM != AX_PLATFORM_IOS || TARGET_OS_SIMULATOR) // packed 16 bits pixels only available on iOS case PixelFormat::RGB565: case PixelFormat::RGB5A1: @@ -244,7 +244,7 @@ bool Texture2D::updateWithImage(Image* image, backend::PixelFormat format, int i { if (renderFormat != image->getPixelFormat()) { - CCLOG("cocos2d: WARNING: This image has more than 1 mipmaps and we will not convert the data format"); + AXLOG("cocos2d: WARNING: This image has more than 1 mipmaps and we will not convert the data format"); } // pixel format of data is not converted, renderFormat can be different from pixelFormat @@ -276,7 +276,7 @@ bool Texture2D::updateWithData(const void* data, bool preMultipliedAlpha, int index) { - CCASSERT(dataLen > 0 && pixelsWide > 0 && pixelsHigh > 0, "Invalid size"); + AXASSERT(dataLen > 0 && pixelsWide > 0 && pixelsHigh > 0, "Invalid size"); // if data has no mipmaps, we will consider it has only one mipmap MipmapInfo mipmap; @@ -295,21 +295,21 @@ bool Texture2D::updateWithMipmaps(MipmapInfo* mipmaps, int index) { // the pixelFormat must be a certain value - CCASSERT(pixelFormat != PixelFormat::NONE, "the \"pixelFormat\" param must be a certain value!"); - CCASSERT(pixelsWide > 0 && pixelsHigh > 0, "Invalid size"); + AXASSERT(pixelFormat != PixelFormat::NONE, "the \"pixelFormat\" param must be a certain value!"); + AXASSERT(pixelsWide > 0 && pixelsHigh > 0, "Invalid size"); if (mipmapsNum <= 0) { - CCLOG("cocos2d: WARNING: mipmap number is less than 1"); + AXLOG("cocos2d: WARNING: mipmap number is less than 1"); return false; } auto& pfd = backend::PixelFormatUtils::getFormatDescriptor(pixelFormat); if (!pfd.bpp) { - CCLOG("cocos2d: WARNING: unsupported pixelformat: %x", (uint32_t)pixelFormat); -#ifdef CC_USE_METAL - CCASSERT(false, "pixeformat not found in _pixelFormatInfoTables, register required!"); + AXLOG("cocos2d: WARNING: unsupported pixelformat: %x", (uint32_t)pixelFormat); +#ifdef AX_USE_METAL + AXASSERT(false, "pixeformat not found in _pixelFormatInfoTables, register required!"); #endif return false; } @@ -320,11 +320,11 @@ bool Texture2D::updateWithMipmaps(MipmapInfo* mipmaps, !Configuration::getInstance()->supportsETC2() && !Configuration::getInstance()->supportsS3TC() && !Configuration::getInstance()->supportsASTC() && !Configuration::getInstance()->supportsATITC()) { - CCLOG("cocos2d: WARNING: PVRTC/ETC images are not supported"); + AXLOG("cocos2d: WARNING: PVRTC/ETC images are not supported"); return false; } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA VolatileTextureMgr::findVolotileTexture(this); #endif @@ -361,15 +361,15 @@ bool Texture2D::updateWithMipmaps(MipmapInfo* mipmaps, { auto convertedFormat = backend::PixelFormatUtils::convertDataToFormat(data, dataLen, oriPixelFormat, renderFormat, &outData, &outDataLen); -#ifdef CC_USE_METAL - CCASSERT(convertedFormat == renderFormat, "PixelFormat convert failed!"); +#ifdef AX_USE_METAL + AXASSERT(convertedFormat == renderFormat, "PixelFormat convert failed!"); #endif if (convertedFormat == renderFormat) pixelFormat = renderFormat; } textureDescriptor.textureFormat = pixelFormat; - CCASSERT(textureDescriptor.textureFormat != backend::PixelFormat::NONE, "PixelFormat should not be NONE"); + AXASSERT(textureDescriptor.textureFormat != backend::PixelFormat::NONE, "PixelFormat should not be NONE"); if (_texture->getTextureFormat() != textureDescriptor.textureFormat) _texture->updateTextureDescriptor(textureDescriptor, index); @@ -392,7 +392,7 @@ bool Texture2D::updateWithMipmaps(MipmapInfo* mipmaps, if (i > 0 && (width != height || ccNextPOT(width) != width)) { - CCLOG( + AXLOG( "cocos2d: Texture2D. WARNING. Mipmap level %u is not squared. Texture won't render correctly. width=%d " "!= height=%d", i, width, height); @@ -446,7 +446,7 @@ bool Texture2D::initWithImage(Image* image, backend::PixelFormat format) { if (image == nullptr) { - CCLOG("cocos2d: Texture2D. Can't create Texture. UIImage is nil"); + AXLOG("cocos2d: Texture2D. Can't create Texture. UIImage is nil"); return false; } @@ -487,7 +487,7 @@ bool Texture2D::initWithString(const char* text, const FontDefinition& textDefin if (!text || !(*text)) return false; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // cache the texture data VolatileTextureMgr::addStringTexture(this, text, textDefinition); #endif @@ -515,12 +515,12 @@ bool Texture2D::initWithString(const char* text, const FontDefinition& textDefin } else { - CCASSERT(false, "Not supported alignment format!"); + AXASSERT(false, "Not supported alignment format!"); return false; } -#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) - CCASSERT(textDefinition._stroke._strokeEnabled == false, "Currently stroke only supported on iOS and Android!"); +#if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) && (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) + AXASSERT(textDefinition._stroke._strokeEnabled == false, "Currently stroke only supported on iOS and Android!"); #endif PixelFormat pixelFormat = g_defaultAlphaPixelFormat; @@ -530,7 +530,7 @@ bool Texture2D::initWithString(const char* text, const FontDefinition& textDefin int imageWidth; int imageHeight; auto textDef = textDefinition; - auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR(); + auto contentScaleFactor = AX_CONTENT_SCALE_FACTOR(); textDef._fontSize *= contentScaleFactor; textDef._dimensions.width *= contentScaleFactor; textDef._dimensions.height *= contentScaleFactor; @@ -562,7 +562,7 @@ bool Texture2D::initWithString(const char* text, const FontDefinition& textDefin bool Texture2D::updateTextureDescriptor(const backend::TextureDescriptor& descriptor, bool preMultipliedAlpha) { - CC_ASSERT(_texture); + AX_ASSERT(_texture); _texture->updateTextureDescriptor(descriptor); _pixelsWide = _contentSize.width = _texture->getWidth(); @@ -680,7 +680,7 @@ bool Texture2D::isContain9PatchInfo() const const Rect& Texture2D::getSpriteFrameCapInset(axis::SpriteFrame* spriteFrame) const { - CCASSERT(_ninePatchInfo != nullptr, + AXASSERT(_ninePatchInfo != nullptr, "Can't get the sprite frame capInset when the texture contains no 9-patch info."); if (nullptr == spriteFrame) { @@ -719,7 +719,7 @@ void Texture2D::setTexParameters(const Texture2D::TexParams& desc) void Texture2D::generateMipmap() { - CCASSERT(_pixelsWide == ccNextPOT(_pixelsWide) && _pixelsHigh == ccNextPOT(_pixelsHigh), + AXASSERT(_pixelsWide == ccNextPOT(_pixelsWide) && _pixelsHigh == ccNextPOT(_pixelsHigh), "Mipmap texture only works in POT textures"); _texture->generateMipmaps(); diff --git a/core/renderer/CCTexture2D.h b/core/renderer/CCTexture2D.h index f8fcd106c8..6ad6461337 100644 --- a/core/renderer/CCTexture2D.h +++ b/core/renderer/CCTexture2D.h @@ -71,7 +71,7 @@ class ProgramState; * texture dimensions i.e. "contentSize" != (pixelsWide, pixelsHigh) and (maxS, maxT) != (1.0, 1.0). Be aware that the * content of the generated textures will be upside-down! */ -class CC_DLL Texture2D : public Ref +class AX_DLL Texture2D : public Ref { public: struct PixelFormatInfo diff --git a/core/renderer/CCTextureAtlas.cpp b/core/renderer/CCTextureAtlas.cpp index a32d30da72..8b26a352aa 100644 --- a/core/renderer/CCTextureAtlas.cpp +++ b/core/renderer/CCTextureAtlas.cpp @@ -51,14 +51,14 @@ TextureAtlas::TextureAtlas() {} TextureAtlas::~TextureAtlas() { - CCLOGINFO("deallocing TextureAtlas: %p", this); + AXLOGINFO("deallocing TextureAtlas: %p", this); - CC_SAFE_FREE(_quads); - CC_SAFE_FREE(_indices); + AX_SAFE_FREE(_quads); + AX_SAFE_FREE(_indices); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_texture); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_rendererRecreatedListener); #endif } @@ -80,8 +80,8 @@ Texture2D* TextureAtlas::getTexture() const void TextureAtlas::setTexture(Texture2D* var) { - CC_SAFE_RETAIN(var); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RETAIN(var); + AX_SAFE_RELEASE(_texture); _texture = var; } @@ -107,7 +107,7 @@ TextureAtlas* TextureAtlas::create(std::string_view file, ssize_t capacity) textureAtlas->autorelease(); return textureAtlas; } - CC_SAFE_DELETE(textureAtlas); + AX_SAFE_DELETE(textureAtlas); return nullptr; } @@ -119,7 +119,7 @@ TextureAtlas* TextureAtlas::createWithTexture(Texture2D* texture, ssize_t capaci textureAtlas->autorelease(); return textureAtlas; } - CC_SAFE_DELETE(textureAtlas); + AX_SAFE_DELETE(textureAtlas); return nullptr; } @@ -134,38 +134,38 @@ bool TextureAtlas::initWithFile(std::string_view file, ssize_t capacity) } else { - CCLOG("cocos2d: Could not open file: %s", file.data()); + AXLOG("cocos2d: Could not open file: %s", file.data()); return false; } } bool TextureAtlas::initWithTexture(Texture2D* texture, ssize_t capacity) { - CCASSERT(capacity >= 0, "Capacity must be >= 0"); + AXASSERT(capacity >= 0, "Capacity must be >= 0"); - // CCASSERT(texture != nullptr, "texture should not be null"); + // AXASSERT(texture != nullptr, "texture should not be null"); _capacity = capacity; _totalQuads = 0; // retained in property this->_texture = texture; - CC_SAFE_RETAIN(_texture); + AX_SAFE_RETAIN(_texture); // Re-initialization is not allowed - CCASSERT(_quads == nullptr && _indices == nullptr, "_quads and _indices should be nullptr."); + AXASSERT(_quads == nullptr && _indices == nullptr, "_quads and _indices should be nullptr."); _quads = (V3F_C4B_T2F_Quad*)malloc(_capacity * sizeof(V3F_C4B_T2F_Quad)); _indices = (uint16_t*)malloc(_capacity * 6 * sizeof(uint16_t)); if (!(_quads && _indices) && _capacity > 0) { - // CCLOG("cocos2d: TextureAtlas: not enough memory"); - CC_SAFE_FREE(_quads); - CC_SAFE_FREE(_indices); + // AXLOG("cocos2d: TextureAtlas: not enough memory"); + AX_SAFE_FREE(_quads); + AX_SAFE_FREE(_indices); // release texture, should set it to null, because the destruction will // release it too. see cocos2d-x issue #484 - CC_SAFE_RELEASE_NULL(_texture); + AX_SAFE_RELEASE_NULL(_texture); return false; } @@ -206,7 +206,7 @@ void TextureAtlas::setupIndices() void TextureAtlas::updateQuad(V3F_C4B_T2F_Quad* quad, ssize_t index) { - CCASSERT(index >= 0 && index < _capacity, "updateQuadWithTexture: Invalid index"); + AXASSERT(index >= 0 && index < _capacity, "updateQuadWithTexture: Invalid index"); _totalQuads = MAX(index + 1, _totalQuads); @@ -217,10 +217,10 @@ void TextureAtlas::updateQuad(V3F_C4B_T2F_Quad* quad, ssize_t index) void TextureAtlas::insertQuad(V3F_C4B_T2F_Quad* quad, ssize_t index) { - CCASSERT(index >= 0 && index < _capacity, "insertQuadWithTexture: Invalid index"); + AXASSERT(index >= 0 && index < _capacity, "insertQuadWithTexture: Invalid index"); _totalQuads++; - CCASSERT(_totalQuads <= _capacity, "invalid totalQuads"); + AXASSERT(_totalQuads <= _capacity, "invalid totalQuads"); // issue #575. index can be > totalQuads auto remaining = (_totalQuads - 1) - index; @@ -239,11 +239,11 @@ void TextureAtlas::insertQuad(V3F_C4B_T2F_Quad* quad, ssize_t index) void TextureAtlas::insertQuads(V3F_C4B_T2F_Quad* quads, ssize_t index, ssize_t amount) { - CCASSERT(index >= 0 && amount >= 0 && index + amount <= _capacity, "insertQuadWithTexture: Invalid index + amount"); + AXASSERT(index >= 0 && amount >= 0 && index + amount <= _capacity, "insertQuadWithTexture: Invalid index + amount"); _totalQuads += amount; - CCASSERT(_totalQuads <= _capacity, "invalid totalQuads"); + AXASSERT(_totalQuads <= _capacity, "invalid totalQuads"); // issue #575. index can be > totalQuads auto remaining = (_totalQuads - 1) - index - amount; @@ -269,8 +269,8 @@ void TextureAtlas::insertQuads(V3F_C4B_T2F_Quad* quads, ssize_t index, ssize_t a void TextureAtlas::insertQuadFromIndex(ssize_t oldIndex, ssize_t newIndex) { - CCASSERT(newIndex >= 0 && newIndex < _totalQuads, "insertQuadFromIndex:atIndex: Invalid index"); - CCASSERT(oldIndex >= 0 && oldIndex < _totalQuads, "insertQuadFromIndex:atIndex: Invalid index"); + AXASSERT(newIndex >= 0 && newIndex < _totalQuads, "insertQuadFromIndex:atIndex: Invalid index"); + AXASSERT(oldIndex >= 0 && oldIndex < _totalQuads, "insertQuadFromIndex:atIndex: Invalid index"); if (oldIndex == newIndex) { @@ -297,7 +297,7 @@ void TextureAtlas::insertQuadFromIndex(ssize_t oldIndex, ssize_t newIndex) void TextureAtlas::removeQuadAtIndex(ssize_t index) { - CCASSERT(index >= 0 && index < _totalQuads, "removeQuadAtIndex: Invalid index"); + AXASSERT(index >= 0 && index < _totalQuads, "removeQuadAtIndex: Invalid index"); auto remaining = (_totalQuads - 1) - index; @@ -315,7 +315,7 @@ void TextureAtlas::removeQuadAtIndex(ssize_t index) void TextureAtlas::removeQuadsAtIndex(ssize_t index, ssize_t amount) { - CCASSERT(index >= 0 && amount >= 0 && index + amount <= _totalQuads, + AXASSERT(index >= 0 && amount >= 0 && index + amount <= _totalQuads, "removeQuadAtIndex: index + amount out of bounds"); auto remaining = (_totalQuads) - (index + amount); @@ -338,7 +338,7 @@ void TextureAtlas::removeAllQuads() // TextureAtlas - Resize bool TextureAtlas::resizeCapacity(ssize_t newCapacity) { - CCASSERT(newCapacity >= 0, "capacity >= 0"); + AXASSERT(newCapacity >= 0, "capacity >= 0"); if (newCapacity == _capacity) { return true; @@ -398,11 +398,11 @@ bool TextureAtlas::resizeCapacity(ssize_t newCapacity) if (!(tmpQuads && tmpIndices)) { - CCLOG("cocos2d: TextureAtlas: not enough memory"); - CC_SAFE_FREE(tmpQuads); - CC_SAFE_FREE(tmpIndices); - CC_SAFE_FREE(_quads); - CC_SAFE_FREE(_indices); + AXLOG("cocos2d: TextureAtlas: not enough memory"); + AX_SAFE_FREE(tmpQuads); + AX_SAFE_FREE(tmpIndices); + AX_SAFE_FREE(_quads); + AX_SAFE_FREE(_indices); _capacity = _totalQuads = 0; return false; } @@ -419,15 +419,15 @@ bool TextureAtlas::resizeCapacity(ssize_t newCapacity) void TextureAtlas::increaseTotalQuadsWith(ssize_t amount) { - CCASSERT(amount >= 0, "amount >= 0"); + AXASSERT(amount >= 0, "amount >= 0"); _totalQuads += amount; } void TextureAtlas::moveQuadsFromIndex(ssize_t oldIndex, ssize_t amount, ssize_t newIndex) { - CCASSERT(oldIndex >= 0 && amount >= 0 && newIndex >= 0, "values must be >= 0"); - CCASSERT(newIndex + amount <= _totalQuads, "insertQuadFromIndex:atIndex: Invalid index"); - CCASSERT(oldIndex < _totalQuads, "insertQuadFromIndex:atIndex: Invalid index"); + AXASSERT(oldIndex >= 0 && amount >= 0 && newIndex >= 0, "values must be >= 0"); + AXASSERT(newIndex + amount <= _totalQuads, "insertQuadFromIndex:atIndex: Invalid index"); + AXASSERT(oldIndex < _totalQuads, "insertQuadFromIndex:atIndex: Invalid index"); if (oldIndex == newIndex) { @@ -457,15 +457,15 @@ void TextureAtlas::moveQuadsFromIndex(ssize_t oldIndex, ssize_t amount, ssize_t void TextureAtlas::moveQuadsFromIndex(ssize_t index, ssize_t newIndex) { - CCASSERT(index >= 0 && newIndex >= 0, "values must be >= 0"); - CCASSERT(newIndex + (_totalQuads - index) <= _capacity, "moveQuadsFromIndex move is out of bounds"); + AXASSERT(index >= 0 && newIndex >= 0, "values must be >= 0"); + AXASSERT(newIndex + (_totalQuads - index) <= _capacity, "moveQuadsFromIndex move is out of bounds"); memmove(_quads + newIndex, _quads + index, (_totalQuads - index) * sizeof(_quads[0])); } void TextureAtlas::fillWithEmptyQuadsFromIndex(ssize_t index, ssize_t amount) { - CCASSERT(index >= 0 && amount >= 0, "values must be >= 0"); + AXASSERT(index >= 0 && amount >= 0, "values must be >= 0"); V3F_C4B_T2F_Quad quad; memset(&quad, 0, sizeof(quad)); diff --git a/core/renderer/CCTextureAtlas.h b/core/renderer/CCTextureAtlas.h index 971353e03e..c7eb69e055 100644 --- a/core/renderer/CCTextureAtlas.h +++ b/core/renderer/CCTextureAtlas.h @@ -59,7 +59,7 @@ To render the quads using an interleaved vertex array list, you should modify th @warning If you want to use TextureAtlas, you'd better setup GL status before it's rendered. Otherwise, the effect of TextureAtlas will be affected by the GL status of other nodes. */ -class CC_DLL TextureAtlas : public Ref +class AX_DLL TextureAtlas : public Ref { public: /** Creates a TextureAtlas with an filename and with an initial capacity for Quads. @@ -239,7 +239,7 @@ protected: /** Quads that are going to be rendered */ V3F_C4B_T2F_Quad* _quads = nullptr; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _rendererRecreatedListener = nullptr; #endif }; diff --git a/core/renderer/CCTextureCache.cpp b/core/renderer/CCTextureCache.cpp index 1fa66a7573..89dbf28020 100644 --- a/core/renderer/CCTextureCache.cpp +++ b/core/renderer/CCTextureCache.cpp @@ -67,12 +67,12 @@ TextureCache::TextureCache() : _loadingThread(nullptr), _needQuit(false), _async TextureCache::~TextureCache() { - CCLOGINFO("deallocing TextureCache: %p", this); + AXLOGINFO("deallocing TextureCache: %p", this); for (auto& texture : _textures) texture.second->release(); - CC_SAFE_DELETE(_loadingThread); + AX_SAFE_DELETE(_loadingThread); } std::string TextureCache::getDescription() const @@ -208,7 +208,7 @@ void TextureCache::addImageAsync(std::string_view path, if (0 == _asyncRefCount) { - Director::getInstance()->getScheduler()->schedule(CC_SCHEDULE_SELECTOR(TextureCache::addImageAsyncCallBack), + Director::getInstance()->getScheduler()->schedule(AX_SCHEDULE_SELECTOR(TextureCache::addImageAsyncCallBack), this, 0, false); } @@ -316,7 +316,7 @@ void TextureCache::addImageAsyncCallBack(float /*dt*/) _responseQueue.pop_front(); // the asyncStruct's sequence order in _asyncStructQueue must equal to the order in _responseQueue - CC_ASSERT(asyncStruct == _asyncStructQueue.front()); + AX_ASSERT(asyncStruct == _asyncStructQueue.front()); _asyncStructQueue.pop_front(); } _responseMutex.unlock(); @@ -344,7 +344,7 @@ void TextureCache::addImageAsyncCallBack(float /*dt*/) texture->initWithImage(image, asyncStruct->pixelFormat); // parse 9-patch info this->parseNinePatchImage(image, texture, asyncStruct->filename); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // cache the texture file name VolatileTextureMgr::addImageTexture(texture, asyncStruct->filename); #endif @@ -362,7 +362,7 @@ void TextureCache::addImageAsyncCallBack(float /*dt*/) else { texture = nullptr; - CCLOG("cocos2d: failed to call TextureCache::addImageAsync(%s)", asyncStruct->filename.c_str()); + AXLOG("cocos2d: failed to call TextureCache::addImageAsync(%s)", asyncStruct->filename.c_str()); } } @@ -379,7 +379,7 @@ void TextureCache::addImageAsyncCallBack(float /*dt*/) if (0 == _asyncRefCount) { - Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(TextureCache::addImageAsyncCallBack), + Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(TextureCache::addImageAsyncCallBack), this); } } @@ -414,13 +414,13 @@ Texture2D* TextureCache::addImage(std::string_view path, PixelFormat format) image = new Image(); bool bRet = image->initWithImageFile(fullpath); - CC_BREAK_IF(!bRet); + AX_BREAK_IF(!bRet); texture = new Texture2D(); if (texture->initWithImage(image, format)) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // cache the texture file name VolatileTextureMgr::addImageTexture(texture, fullpath); #endif @@ -445,14 +445,14 @@ Texture2D* TextureCache::addImage(std::string_view path, PixelFormat format) } else { - CCLOG("cocos2d: Couldn't create texture for file:%s in TextureCache", path.data()); - CC_SAFE_RELEASE(texture); + AXLOG("cocos2d: Couldn't create texture for file:%s in TextureCache", path.data()); + AX_SAFE_RELEASE(texture); texture = nullptr; } } while (0); } - CC_SAFE_RELEASE(image); + AX_SAFE_RELEASE(image); return texture; } @@ -474,8 +474,8 @@ Texture2D* TextureCache::addImage(Image* image, std::string_view key) Texture2D* TextureCache::addImage(Image* image, std::string_view key, PixelFormat format) { - CCASSERT(image != nullptr, "TextureCache: image MUST not be nil"); - CCASSERT(image->getData() != nullptr, "TextureCache: image MUST not be nil"); + AXASSERT(image != nullptr, "TextureCache: image MUST not be nil"); + AXASSERT(image->getData() != nullptr, "TextureCache: image MUST not be nil"); Texture2D* texture = nullptr; @@ -495,14 +495,14 @@ Texture2D* TextureCache::addImage(Image* image, std::string_view key, PixelForma } else { - CC_SAFE_RELEASE(texture); + AX_SAFE_RELEASE(texture); texture = nullptr; - CCLOG("cocos2d: initWithImage failed!"); + AXLOG("cocos2d: initWithImage failed!"); } } while (0); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA VolatileTextureMgr::addImage(texture, image); #endif @@ -538,7 +538,7 @@ bool TextureCache::reloadTexture(std::string_view fileName) Image image; bool bRet = image.initWithImageFile(fullpath); - CC_BREAK_IF(!bRet); + AX_BREAK_IF(!bRet); ret = texture->initWithImage(&image); } while (0); @@ -565,7 +565,7 @@ void TextureCache::removeUnusedTextures() Texture2D* tex = it->second; if (tex->getReferenceCount() == 1) { - CCLOG("cocos2d: TextureCache: removing unused texture: %s", it->first.c_str()); + AXLOG("cocos2d: TextureCache: removing unused texture: %s", it->first.c_str()); tex->release(); it = _textures.erase(it); @@ -712,7 +712,7 @@ void TextureCache::renameTextureWithKey(std::string_view srcName, std::string_vi } } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA std::list VolatileTextureMgr::_textures; bool VolatileTextureMgr::_isReloading = false; @@ -729,7 +729,7 @@ VolatileTexture::VolatileTexture(Texture2D* t) VolatileTexture::~VolatileTexture() { - CC_SAFE_RELEASE(_uiImage); + AX_SAFE_RELEASE(_uiImage); } void VolatileTextureMgr::addImageTexture(Texture2D* tt, std::string_view imageFileName) @@ -831,7 +831,7 @@ void VolatileTextureMgr::removeTexture(Texture2D* t) void VolatileTextureMgr::reloadAllTextures() { _isReloading = true; - CCLOG("reload all texture"); + AXLOG("reload all texture"); for (auto& texture : _textures) { @@ -886,9 +886,9 @@ void VolatileTextureMgr::reloadTexture(Texture2D* texture, std::string_view file if (image->initWithImageData(data.getBytes(), data.getSize())) texture->initWithImage(image, pixelFormat); - CC_SAFE_DELETE(image); + AX_SAFE_DELETE(image); } -#endif // CC_ENABLE_CACHE_TEXTURE_DATA +#endif // AX_ENABLE_CACHE_TEXTURE_DATA NS_AX_END diff --git a/core/renderer/CCTextureCache.h b/core/renderer/CCTextureCache.h index a8db9976b2..622082bf35 100644 --- a/core/renderer/CCTextureCache.h +++ b/core/renderer/CCTextureCache.h @@ -43,7 +43,7 @@ THE SOFTWARE. #include "renderer/CCTexture2D.h" #include "platform/CCImage.h" -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA # include #endif @@ -62,7 +62,7 @@ NS_AX_BEGIN * Once the texture is loaded, the next time it will return. * A reference of the previously loaded texture reducing GPU & CPU memory. */ -class CC_DLL TextureCache : public Ref +class AX_DLL TextureCache : public Ref { public: // ETC1 ALPHA supports. @@ -176,7 +176,7 @@ public: */ void removeTextureForKey(std::string_view key); - /** Output to CCLOG the current contents of this TextureCache. + /** Output to AXLOG the current contents of this TextureCache. * This will attempt to calculate the size of each texture, and the total texture memory in use. * * @since v1.0 @@ -235,7 +235,7 @@ protected: static std::string s_etc1AlphaFileSuffix; }; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA class VolatileTexture { @@ -275,7 +275,7 @@ protected: FontDefinition _fontDefinition; }; -class CC_DLL VolatileTextureMgr +class AX_DLL VolatileTextureMgr { public: static void addImageTexture(Texture2D* tt, std::string_view imageFileName); diff --git a/core/renderer/CCTextureCube.cpp b/core/renderer/CCTextureCube.cpp index 7a80f4ed14..afc0b24cb7 100644 --- a/core/renderer/CCTextureCube.cpp +++ b/core/renderer/CCTextureCube.cpp @@ -149,7 +149,7 @@ TextureCube::TextureCube() TextureCube::~TextureCube() { - CC_SAFE_RELEASE_NULL(_texture); + AX_SAFE_RELEASE_NULL(_texture); } TextureCube* TextureCube::create(std::string_view positive_x, @@ -165,7 +165,7 @@ TextureCube* TextureCube::create(std::string_view positive_x, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -198,12 +198,12 @@ bool TextureCube::init(std::string_view positive_x, Image* img = images[i]; if (img->getWidth() != img->getHeight()) { - CCASSERT(false, "TextureCubemap: width should be equal to height!"); + AXASSERT(false, "TextureCubemap: width should be equal to height!"); return false; } if (imageSize != img->getWidth()) { - CCASSERT(imageSize == img->getWidth(), "TextureCubmap: texture of each face should have same dimension"); + AXASSERT(imageSize == img->getWidth(), "TextureCubmap: texture of each face should have same dimension"); return false; } } @@ -217,7 +217,7 @@ bool TextureCube::init(std::string_view positive_x, textureDescriptor.samplerDescriptor.tAddressMode = backend::SamplerAddressMode::CLAMP_TO_EDGE; _texture = static_cast(backend::Device::getInstance()->newTexture(textureDescriptor)); - CCASSERT(_texture != nullptr, "TextureCubemap: texture can not be nullptr"); + AXASSERT(_texture != nullptr, "TextureCubemap: texture can not be nullptr"); for (int i = 0; i < 6; i++) { @@ -240,7 +240,7 @@ bool TextureCube::init(std::string_view positive_x, } else { - CCASSERT(false, + AXASSERT(false, "error: CubeMap texture may be incorrect, failed to convert pixel format data to RGBA8888"); } } @@ -256,7 +256,7 @@ bool TextureCube::init(std::string_view positive_x, for (auto img : images) { - CC_SAFE_RELEASE(img); + AX_SAFE_RELEASE(img); } return true; diff --git a/core/renderer/CCTextureCube.h b/core/renderer/CCTextureCube.h index dc29227cdf..fc4b439d31 100644 --- a/core/renderer/CCTextureCube.h +++ b/core/renderer/CCTextureCube.h @@ -44,7 +44,7 @@ NS_AX_BEGIN TextureCube is a collection of six separate square textures that are put onto the faces of an imaginary cube. */ -class CC_DLL TextureCube : public Ref +class AX_DLL TextureCube : public Ref { public: /** create cube texture from 6 textures. diff --git a/core/renderer/CCTrianglesCommand.cpp b/core/renderer/CCTrianglesCommand.cpp index bbe3a2575d..cec03ff61e 100644 --- a/core/renderer/CCTrianglesCommand.cpp +++ b/core/renderer/CCTrianglesCommand.cpp @@ -49,7 +49,7 @@ void TrianglesCommand::init(float globalOrder, { unsigned int count = _triangles.indexCount; _triangles.indexCount = count / 3 * 3; - CCLOGERROR("Resize indexCount from %d to %d, size must be multiple times of 3", count, _triangles.indexCount); + AXLOGERROR("Resize indexCount from %d to %d, size must be multiple times of 3", count, _triangles.indexCount); } _mv = mv; diff --git a/core/renderer/CCTrianglesCommand.h b/core/renderer/CCTrianglesCommand.h index d26052dea9..6bd790faae 100644 --- a/core/renderer/CCTrianglesCommand.h +++ b/core/renderer/CCTrianglesCommand.h @@ -46,7 +46,7 @@ class Program; class Texture2D; -class CC_DLL TrianglesCommand : public RenderCommand +class AX_DLL TrianglesCommand : public RenderCommand { public: /**The structure of Triangles. */ diff --git a/core/renderer/backend/Device.h b/core/renderer/backend/Device.h index a8cff2254a..8a8a05852f 100644 --- a/core/renderer/backend/Device.h +++ b/core/renderer/backend/Device.h @@ -54,7 +54,7 @@ class RenderTarget; /** * New or create resources from Device. */ -class CC_DLL Device : public axis::Ref +class AX_DLL Device : public axis::Ref { public: friend class ProgramCache; diff --git a/core/renderer/backend/Enums.h b/core/renderer/backend/Enums.h index d656ad61b7..8c67b16c33 100644 --- a/core/renderer/backend/Enums.h +++ b/core/renderer/backend/Enums.h @@ -263,8 +263,8 @@ enum class ColorWriteMask : uint32_t ALPHA = 1 << ALPHA_BIT, ALL = 0x0000000F }; -CC_ENABLE_BITMASK_OPS(ColorWriteMask) -CC_ENABLE_BITSHIFT_OPS(ColorWriteMask) +AX_ENABLE_BITMASK_OPS(ColorWriteMask) +AX_ENABLE_BITSHIFT_OPS(ColorWriteMask) /** * Bitmask for selecting render buffers @@ -283,7 +283,7 @@ enum class TargetBufferFlags : uint8_t DEPTH_AND_STENCIL = DEPTH | STENCIL, //!< depth and stencil buffer selected. ALL = COLOR_ALL | DEPTH | STENCIL //!< Color, depth and stencil buffer selected. }; -CC_ENABLE_BITMASK_OPS(TargetBufferFlags) +AX_ENABLE_BITMASK_OPS(TargetBufferFlags) enum class DepthStencilFlags : unsigned int { @@ -294,8 +294,8 @@ enum class DepthStencilFlags : unsigned int DEPTH_STENCIL_TEST = DEPTH_TEST | STENCIL_TEST, ALL = DEPTH_TEST | STENCIL_TEST | DEPTH_WRITE, }; -CC_ENABLE_BITMASK_OPS(DepthStencilFlags) -CC_ENABLE_BITSHIFT_OPS(DepthStencilFlags) +AX_ENABLE_BITMASK_OPS(DepthStencilFlags) +AX_ENABLE_BITSHIFT_OPS(DepthStencilFlags) enum class CullMode : uint32_t { diff --git a/core/renderer/backend/Macros.h b/core/renderer/backend/Macros.h index a82235311e..b39c39dbef 100644 --- a/core/renderer/backend/Macros.h +++ b/core/renderer/backend/Macros.h @@ -38,4 +38,4 @@ #define MAX_INFLIGHT_BUFFER 3 -#define CC_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0])) +#define AX_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0])) diff --git a/core/renderer/backend/PixelFormatUtils.cpp b/core/renderer/backend/PixelFormatUtils.cpp index 82c670bf3e..6c485b436f 100644 --- a/core/renderer/backend/PixelFormatUtils.cpp +++ b/core/renderer/backend/PixelFormatUtils.cpp @@ -72,14 +72,14 @@ static const PixelFormatDescriptor s_pixelFormatDescriptors[] = { {8, 1, 1, 1, 1, 1, true, "A8"}, // A8 {8, 1, 1, 1, 1, 1, false, "L8"}, // L8 {16, 1, 1, 2, 1, 1, true, "LA8"}, // LA8 -#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) {32, 1, 1, 4, 1, 1, false, "D24S8"}, // D24S8 #else {64, 1, 1, 8, 1, 1, false, "D32FS8"}, // D32FS8 iOS #endif }; -static_assert(CC_ARRAYSIZE(s_pixelFormatDescriptors) == (int)PixelFormat::COUNT, +static_assert(AX_ARRAYSIZE(s_pixelFormatDescriptors) == (int)PixelFormat::COUNT, "The pixel format descriptor table incomplete!"); ////////////////////////////////////////////////////////////////////////// @@ -542,7 +542,7 @@ axis::backend::PixelFormat convertL8ToFormat(const unsigned char* data, // unsupported conversion or don't need to convert if (format != PixelFormat::L8) { - CCLOG( + AXLOG( "Can not convert image format PixelFormat::L8 to format ID:%d, we will use it's origin format " "PixelFormat::L8", static_cast(format)); @@ -603,7 +603,7 @@ axis::backend::PixelFormat convertLA8ToFormat(const unsigned char* data, // unsupported conversion or don't need to convert if (format != PixelFormat::LA8) { - CCLOG( + AXLOG( "Can not convert image format PixelFormat::LA8 to format ID:%d, we will use it's origin format " "PixelFormat::LA8", static_cast(format)); @@ -664,7 +664,7 @@ axis::backend::PixelFormat convertRGB8ToFormat(const unsigned char* data, // unsupported conversion or don't need to convert if (format != PixelFormat::RGB8) { - CCLOG( + AXLOG( "Can not convert image format PixelFormat::RGB8 to format ID:%d, we will use it's origin format " "PixelFormat::RGB8", static_cast(format)); @@ -725,7 +725,7 @@ axis::backend::PixelFormat convertRGBA8ToFormat(const unsigned char* data, // unsupported conversion or don't need to convert if (format != PixelFormat::RGBA8) { - CCLOG( + AXLOG( "Can not convert image format PixelFormat::RGBA8 to format ID:%d, we will use it's origin format " "PixelFormat::RGBA8", static_cast(format)); @@ -760,7 +760,7 @@ axis::backend::PixelFormat convertRGB5A1ToFormat(const unsigned char* data, // unsupported conversion or don't need to convert if (format != PixelFormat::RGBA8) { - CCLOG( + AXLOG( "Can not convert image format PixelFormat::RGB5A1 to format ID:%d, we will use it's origin format " "PixelFormat::RGB51A", static_cast(format)); @@ -794,7 +794,7 @@ axis::backend::PixelFormat convertRGB565ToFormat(const unsigned char* data, // unsupported conversion or don't need to convert if (format != PixelFormat::RGBA8) { - CCLOG( + AXLOG( "Can not convert image format PixelFormat::RGB565 to format ID:%d, we will use it's origin format " "PixelFormat::RGB565", static_cast(format)); @@ -824,7 +824,7 @@ axis::backend::PixelFormat convertA8ToFormat(const unsigned char* data, // unsupported conversion or don't need to convert if (format != PixelFormat::RGBA8) { - CCLOG( + AXLOG( "Can not convert image format PixelFormat::A8 to format ID:%d, we will use it's origin format " "PixelFormat::A8", static_cast(format)); @@ -858,7 +858,7 @@ axis::backend::PixelFormat convertRGBA4ToFormat(const unsigned char* data, // unsupported conversion or don't need to convert if (format != PixelFormat::RGBA8) { - CCLOG( + AXLOG( "Can not convert image format PixelFormat::RGBA444 to format ID:%d, we will use it's origin format " "PixelFormat::RGBA4", static_cast(format)); @@ -944,7 +944,7 @@ axis::backend::PixelFormat convertDataToFormat(const unsigned char* data, case PixelFormat::BGRA8: return convertBGRA8ToFormat(data, dataLen, format, outData, outDataLen); default: - CCLOG("unsupported conversion from format %d to format %d", static_cast(originFormat), + AXLOG("unsupported conversion from format %d to format %d", static_cast(originFormat), static_cast(format)); *outData = (unsigned char*)data; *outDataLen = dataLen; diff --git a/core/renderer/backend/Program.h b/core/renderer/backend/Program.h index 0fca197332..ef18a85245 100644 --- a/core/renderer/backend/Program.h +++ b/core/renderer/backend/Program.h @@ -46,7 +46,7 @@ class ShaderModule; /** * A program. */ -class CC_DLL Program : public Ref +class AX_DLL Program : public Ref { public: /** @@ -153,7 +153,7 @@ protected: */ Program(std::string_view vs, std::string_view fs); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA /** * In case of EGL context lost, the engine will reload shaders. Thus location of uniform may changed. * The engine will maintain the relationship between the original uniform location and the current active uniform diff --git a/core/renderer/backend/ProgramCache.cpp b/core/renderer/backend/ProgramCache.cpp index d73178e303..6bbab6af69 100644 --- a/core/renderer/backend/ProgramCache.cpp +++ b/core/renderer/backend/ProgramCache.cpp @@ -58,7 +58,7 @@ ProgramCache* ProgramCache::getInstance() _sharedProgramCache = new ProgramCache(); if (!_sharedProgramCache->init()) { - CC_SAFE_DELETE(_sharedProgramCache); + AX_SAFE_DELETE(_sharedProgramCache); } } return _sharedProgramCache; @@ -66,16 +66,16 @@ ProgramCache* ProgramCache::getInstance() void ProgramCache::destroyInstance() { - CC_SAFE_RELEASE_NULL(_sharedProgramCache); + AX_SAFE_RELEASE_NULL(_sharedProgramCache); } ProgramCache::~ProgramCache() { for (auto& program : _cachedPrograms) { - CC_SAFE_RELEASE(program.second); + AX_SAFE_RELEASE(program.second); } - CCLOGINFO("deallocing ProgramCache: %p", this); + AXLOGINFO("deallocing ProgramCache: %p", this); ShaderCache::destroyInstance(); } @@ -241,7 +241,7 @@ void ProgramCache::removeUnusedProgram() auto program = iter->second; if (program->getReferenceCount() == 1) { - // CCLOG("cocos2d: TextureCache: removing unused program"); + // AXLOG("cocos2d: TextureCache: removing unused program"); program->release(); iter = _cachedPrograms.erase(iter); } diff --git a/core/renderer/backend/ProgramState.cpp b/core/renderer/backend/ProgramState.cpp index ffe359731d..267ac6e688 100644 --- a/core/renderer/backend/ProgramState.cpp +++ b/core/renderer/backend/ProgramState.cpp @@ -35,7 +35,7 @@ #include "xxhash.h" -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL # include "glsl_optimizer.h" #endif @@ -125,13 +125,13 @@ TextureInfo::~TextureInfo() void TextureInfo::retainTextures() { for (auto& texture : textures) - CC_SAFE_RETAIN(texture); + AX_SAFE_RETAIN(texture); } void TextureInfo::releaseTextures() { for (auto& texture : textures) - CC_SAFE_RELEASE(texture); + AX_SAFE_RELEASE(texture); textures.clear(); } @@ -158,7 +158,7 @@ void TextureInfo::assign(const TextureInfo& other) textures = other.textures; retainTextures(); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA location = other.location; #endif } @@ -174,7 +174,7 @@ void TextureInfo::assign(TextureInfo&& other) slots = std::move(other.slots); textures = std::move(other.textures); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA location = other.location; other.location = -1; #endif @@ -189,19 +189,19 @@ ProgramState::ProgramState(Program* program) bool ProgramState::init(Program* program) { - CC_SAFE_RETAIN(program); + AX_SAFE_RETAIN(program); _program = program; _vertexUniformBufferSize = _program->getUniformBufferSize(ShaderStage::VERTEX); _vertexUniformBuffer = (char*)calloc(1, _vertexUniformBufferSize); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _fragmentUniformBufferSize = _program->getUniformBufferSize(ShaderStage::FRAGMENT); _fragmentUniformBuffer = (char*)calloc(1, _fragmentUniformBufferSize); #endif -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _uniformHashState = XXH32_createState(); #endif -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { this->resetUniforms(); }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1); @@ -211,7 +211,7 @@ bool ProgramState::init(Program* program) void ProgramState::resetUniforms() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA if (_program == nullptr) return; @@ -232,14 +232,14 @@ void ProgramState::resetUniforms() ProgramState::~ProgramState() { -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL XXH32_freeState(_uniformHashState); #endif - CC_SAFE_RELEASE(_program); - CC_SAFE_FREE(_vertexUniformBuffer); - CC_SAFE_FREE(_fragmentUniformBuffer); + AX_SAFE_RELEASE(_program); + AX_SAFE_FREE(_vertexUniformBuffer); + AX_SAFE_FREE(_fragmentUniformBuffer); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -251,7 +251,7 @@ ProgramState* ProgramState::clone() const cp->_fragmentTextureInfos = _fragmentTextureInfos; memcpy(cp->_vertexUniformBuffer, _vertexUniformBuffer, _vertexUniformBufferSize); cp->_vertexLayout = _vertexLayout; -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL memcpy(cp->_fragmentUniformBuffer, _fragmentUniformBuffer, _fragmentUniformBufferSize); #endif cp->_uniformID = _uniformID; @@ -292,7 +292,7 @@ void ProgramState::setUniform(const backend::UniformLocation& uniformLocation, c } } -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL void ProgramState::convertAndCopyUniformData(const backend::UniformInfo& uniformInfo, const void* srcData, std::size_t srcSize, @@ -355,12 +355,12 @@ void ProgramState::convertAndCopyUniformData(const backend::UniformInfo& uniform break; } default: - CC_ASSERT(false); + AX_ASSERT(false); break; } memcpy((char*)buffer + uniformInfo.location, convertedData, uniformInfo.size); - CC_SAFE_DELETE_ARRAY(convertedData); + AX_SAFE_DELETE_ARRAY(convertedData); } #endif @@ -370,7 +370,7 @@ void ProgramState::setVertexUniform(int location, const void* data, std::size_t return; // float3 etc in Metal has both sizeof and alignment same as float4, need convert to correct laytout -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL const auto& uniformInfo = _program->getActiveUniformInfo(ShaderStage::VERTEX, location); if (uniformInfo.needConvert) { @@ -391,7 +391,7 @@ void ProgramState::setFragmentUniform(int location, const void* data, std::size_ return; // float3 etc in Metal has both sizeof and alignment same as float4, need convert to correct laytout -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL const auto& uniformInfo = _program->getActiveUniformInfo(ShaderStage::FRAGMENT, location); if (uniformInfo.needConvert) { @@ -408,7 +408,7 @@ void ProgramState::updateUniformID(int uniformID) { if (uniformID == -1) { -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL XXH32_reset(_uniformHashState, 0); XXH32_update(_uniformHashState, _vertexUniformBuffer, _vertexUniformBufferSize); XXH32_update(_uniformHashState, _fragmentUniformBuffer, _fragmentUniformBufferSize); @@ -425,7 +425,7 @@ void ProgramState::updateUniformID(int uniformID) void ProgramState::setTexture(backend::TextureBackend* texture) { - for (int slot = 0; slot < texture->getCount() && slot < CC_META_TEXTURES; ++slot) + for (int slot = 0; slot < texture->getCount() && slot < AX_META_TEXTURES; ++slot) { auto location = getUniformLocation((backend::Uniform)(backend::Uniform::TEXTURE + slot)); setTexture(location, slot, slot, texture); @@ -494,7 +494,7 @@ void ProgramState::setTexture(int location, auto& info = textureInfo[location]; info = {{slot}, {index}, {texture}}; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA info.location = location; #endif } @@ -509,7 +509,7 @@ void ProgramState::setTextureArray(int location, auto& info = textureInfo[location]; info = {std::move(slots), std::move(textures)}; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA info.location = location; #endif } diff --git a/core/renderer/backend/ProgramState.h b/core/renderer/backend/ProgramState.h index f054f5e281..e3af9e3cf0 100644 --- a/core/renderer/backend/ProgramState.h +++ b/core/renderer/backend/ProgramState.h @@ -37,7 +37,7 @@ #include "renderer/backend/Program.h" #include "renderer/backend/VertexLayout.h" -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL struct XXH32_state_s; #endif @@ -54,7 +54,7 @@ class VertexLayout; /** * Store texture information. */ -struct CC_DLL TextureInfo +struct AX_DLL TextureInfo { TextureInfo(std::vector&& _slots, std::vector&& _textures); TextureInfo(std::vector&& _slots, @@ -78,7 +78,7 @@ struct CC_DLL TextureInfo std::vector slots; std::vector indexs; std::vector textures; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA int location = -1; #endif }; @@ -87,7 +87,7 @@ struct CC_DLL TextureInfo * A program state object can create or reuse a program. * Each program state object keep its own unifroms and textures data. */ -class CC_DLL ProgramState : public Ref +class AX_DLL ProgramState : public Ref { public: using UniformCallback = std::function; @@ -256,7 +256,7 @@ public: * * @script{ignore} */ - class CC_DLL AutoBindingResolver + class AX_DLL AutoBindingResolver { public: AutoBindingResolver(); @@ -358,7 +358,7 @@ protected: /// Initialize. bool init(Program* program); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL /** * float3 etc in Metal has both sizeof and alignment same as float4, convert it before fill into uniform buffer * @param uniformInfo Specifies the uniform information. @@ -395,11 +395,11 @@ protected: std::shared_ptr _vertexLayout = std::make_shared(); uint32_t _uniformID = 0; -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL struct XXH32_state_s* _uniformHashState = nullptr; #endif -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener = nullptr; #endif }; diff --git a/core/renderer/backend/ProgramStateRegistry.cpp b/core/renderer/backend/ProgramStateRegistry.cpp index 5705da8875..0bfbef39e5 100644 --- a/core/renderer/backend/ProgramStateRegistry.cpp +++ b/core/renderer/backend/ProgramStateRegistry.cpp @@ -12,7 +12,7 @@ ProgramStateRegistry* ProgramStateRegistry::getInstance() _sharedStateRegistry = new ProgramStateRegistry(); if (!_sharedStateRegistry->init()) { - CC_SAFE_DELETE(_sharedStateRegistry); + AX_SAFE_DELETE(_sharedStateRegistry); } return _sharedStateRegistry; @@ -21,7 +21,7 @@ ProgramStateRegistry* ProgramStateRegistry::getInstance() /** purges the cache. It releases the retained instance. */ void ProgramStateRegistry::destroyInstance() { - CC_SAFE_RELEASE_NULL(_sharedStateRegistry); + AX_SAFE_RELEASE_NULL(_sharedStateRegistry); } bool ProgramStateRegistry::init() diff --git a/core/renderer/backend/RenderTarget.h b/core/renderer/backend/RenderTarget.h index 07ae3bf108..e4d57ce3bc 100644 --- a/core/renderer/backend/RenderTarget.h +++ b/core/renderer/backend/RenderTarget.h @@ -21,9 +21,9 @@ public: virtual ~RenderTarget() { for (auto colorItem : _color) - CC_SAFE_RELEASE(colorItem.texture); - CC_SAFE_RELEASE(_depth.texture); - CC_SAFE_RELEASE(_stencil.texture); + AX_SAFE_RELEASE(colorItem.texture); + AX_SAFE_RELEASE(_depth.texture); + AX_SAFE_RELEASE(_stencil.texture); } bool isDefaultRenderTarget() const { return _defaultRenderTarget; } @@ -44,37 +44,37 @@ public: void setColorAttachment(ColorAttachment attachment) { for (auto colorItem : _color) - CC_SAFE_RELEASE(colorItem.texture); + AX_SAFE_RELEASE(colorItem.texture); memcpy(_color, attachment, sizeof(ColorAttachment)); for (auto colorItem : _color) - CC_SAFE_RETAIN(colorItem.texture); + AX_SAFE_RETAIN(colorItem.texture); _dirty = true; }; void setColorAttachment(TextureBackend* attachment, int level = 0, int index = 0) { - CC_SAFE_RELEASE(_color[index].texture); + AX_SAFE_RELEASE(_color[index].texture); _color[index].texture = attachment; _color[index].level = level; - CC_SAFE_RETAIN(_color[index].texture); + AX_SAFE_RETAIN(_color[index].texture); _dirty = true; } void setDepthAttachment(TextureBackend* attachment, int level = 0) { - CC_SAFE_RELEASE(_depth.texture); + AX_SAFE_RELEASE(_depth.texture); _depth.texture = attachment; _depth.level = level; - CC_SAFE_RETAIN(_depth.texture); + AX_SAFE_RETAIN(_depth.texture); _dirty = true; }; void setStencilAttachment(TextureBackend* attachment, int level = 0) { - CC_SAFE_RELEASE(_stencil.texture); + AX_SAFE_RELEASE(_stencil.texture); _stencil.texture = attachment; _stencil.level = level; - CC_SAFE_RETAIN(_stencil.texture); + AX_SAFE_RETAIN(_stencil.texture); _dirty = true; }; diff --git a/core/renderer/backend/ShaderCache.cpp b/core/renderer/backend/ShaderCache.cpp index eba07ad07f..ae89046f08 100644 --- a/core/renderer/backend/ShaderCache.cpp +++ b/core/renderer/backend/ShaderCache.cpp @@ -37,7 +37,7 @@ ShaderCache* ShaderCache::getInstance() _sharedShaderCache = new ShaderCache(); if (!_sharedShaderCache->init()) { - CC_SAFE_DELETE(_sharedShaderCache); + AX_SAFE_DELETE(_sharedShaderCache); } } return _sharedShaderCache; @@ -45,16 +45,16 @@ ShaderCache* ShaderCache::getInstance() void ShaderCache::destroyInstance() { - CC_SAFE_RELEASE_NULL(_sharedShaderCache); + AX_SAFE_RELEASE_NULL(_sharedShaderCache); } ShaderCache::~ShaderCache() { for (auto& shaderModule : _cachedShaders) { - CC_SAFE_RELEASE(shaderModule.second); + AX_SAFE_RELEASE(shaderModule.second); } - CCLOGINFO("deallocing ProgramCache: %p", this); + AXLOGINFO("deallocing ProgramCache: %p", this); } bool ShaderCache::init() @@ -95,7 +95,7 @@ void ShaderCache::removeUnusedShader() auto shaderModule = iter->second; if (shaderModule->getReferenceCount() == 1) { - // CCLOG("cocos2d: TextureCache: removing unused program"); + // AXLOG("cocos2d: TextureCache: removing unused program"); shaderModule->release(); iter = _cachedShaders.erase(iter); } diff --git a/core/renderer/backend/ShaderCache.h b/core/renderer/backend/ShaderCache.h index 5c22ac23e5..8a9e4515b7 100644 --- a/core/renderer/backend/ShaderCache.h +++ b/core/renderer/backend/ShaderCache.h @@ -40,7 +40,7 @@ NS_AX_BACKEND_BEGIN /** * Create and reuse shader module. */ -class CC_DLL ShaderCache : public Ref +class AX_DLL ShaderCache : public Ref { public: /** returns the shared instance */ diff --git a/core/renderer/backend/ShaderModule.h b/core/renderer/backend/ShaderModule.h index a36522e29d..574b9bcb08 100644 --- a/core/renderer/backend/ShaderModule.h +++ b/core/renderer/backend/ShaderModule.h @@ -62,7 +62,7 @@ enum Attribute : uint32_t /** * Create shader. */ -class CC_DLL ShaderModule : public axis::Ref +class AX_DLL ShaderModule : public axis::Ref { public: /** diff --git a/core/renderer/backend/VertexLayout.h b/core/renderer/backend/VertexLayout.h index dce25560b1..243e8813c0 100644 --- a/core/renderer/backend/VertexLayout.h +++ b/core/renderer/backend/VertexLayout.h @@ -42,7 +42,7 @@ NS_AX_BACKEND_BEGIN /** * Store vertex attribute layout. */ -class CC_DLL VertexLayout +class AX_DLL VertexLayout { public: struct Attribute diff --git a/core/renderer/backend/metal/CommandBufferMTL.mm b/core/renderer/backend/metal/CommandBufferMTL.mm index 8b6d78f77e..1ed47f3002 100644 --- a/core/renderer/backend/metal/CommandBufferMTL.mm +++ b/core/renderer/backend/metal/CommandBufferMTL.mm @@ -51,7 +51,7 @@ static uint8_t getBitsPerElementMTL(MTLPixelFormat pixleFormat) case MTLPixelFormatRGBA8Unorm: case MTLPixelFormatDepth32Float: return byte(4); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) case MTLPixelFormatDepth24Unorm_Stencil8: return byte(4); #else @@ -275,8 +275,8 @@ void CommandBufferMTL::setVertexBuffer(Buffer* buffer) void CommandBufferMTL::setProgramState(ProgramState* programState) { - CC_SAFE_RETAIN(programState); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RETAIN(programState); + AX_SAFE_RELEASE(_programState); _programState = programState; } @@ -321,7 +321,7 @@ void CommandBufferMTL::readPixels(RenderTarget* rt, std::function_color[0].texture; - CC_SAFE_RETAIN(texture); + AX_SAFE_RETAIN(texture); _captureCallbacks.emplace_back(texture, std::move(callback)); } @@ -390,7 +390,7 @@ void CommandBufferMTL::flushCaptureCommands() auto texture = cb.first; assert(texture != nullptr); CommandBufferMTL::readPixels(texture, 0, 0, texture->getWidth(), texture->getHeight(), pixelData); - CC_SAFE_RELEASE(texture); + AX_SAFE_RELEASE(texture); cb.second(pixelData); } } @@ -406,7 +406,7 @@ void CommandBufferMTL::afterDraw() _mtlIndexBuffer = nullptr; } - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); } void CommandBufferMTL::prepareDrawing() const @@ -569,7 +569,7 @@ void CommandBufferMTL::readPixels(id texture, destinationLevel:0 destinationOrigin:region.origin]; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) [blitCommandEncoder synchronizeResource:readPixelsTexture]; #endif [blitCommandEncoder endEncoding]; diff --git a/core/renderer/backend/metal/DeviceInfoMTL.mm b/core/renderer/backend/metal/DeviceInfoMTL.mm index 50eecdb46c..a16e32b59d 100644 --- a/core/renderer/backend/metal/DeviceInfoMTL.mm +++ b/core/renderer/backend/metal/DeviceInfoMTL.mm @@ -374,7 +374,7 @@ DeviceInfoMTL::DeviceInfoMTL(id device) { _deviceName = [device.name UTF8String]; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) const FeatureSet minRequiredFeatureSet = FeatureSet::FeatureSet_iOS_GPUFamily1_v1; const FeatureSet maxKnownFeatureSet = FeatureSet::FeatureSet_iOS_GPUFamily4_v2; #else diff --git a/core/renderer/backend/metal/DeviceMTL.mm b/core/renderer/backend/metal/DeviceMTL.mm index e993f6f2e0..18cc1fa276 100644 --- a/core/renderer/backend/metal/DeviceMTL.mm +++ b/core/renderer/backend/metal/DeviceMTL.mm @@ -104,7 +104,7 @@ TextureBackend* DeviceMTL::newTexture(const TextureDescriptor& descriptor) case TextureType::TEXTURE_CUBE: return new TextureCubeMTL(_mtlDevice, descriptor); default: - CCASSERT(false, "invalidate texture type"); + AXASSERT(false, "invalidate texture type"); return nullptr; } } diff --git a/core/renderer/backend/metal/ProgramMTL.mm b/core/renderer/backend/metal/ProgramMTL.mm index 4f9f284224..4f1b651501 100644 --- a/core/renderer/backend/metal/ProgramMTL.mm +++ b/core/renderer/backend/metal/ProgramMTL.mm @@ -40,14 +40,14 @@ ProgramMTL::ProgramMTL(std::string_view vertexShader, std::string_view fragmentS combinedSource += fragmentShader; _fragmentShader = static_cast(ShaderCache::newFragmentShaderModule(std::move(combinedSource))); - CC_SAFE_RETAIN(_vertexShader); - CC_SAFE_RETAIN(_fragmentShader); + AX_SAFE_RETAIN(_vertexShader); + AX_SAFE_RETAIN(_fragmentShader); } ProgramMTL::~ProgramMTL() { - CC_SAFE_RELEASE(_vertexShader); - CC_SAFE_RELEASE(_fragmentShader); + AX_SAFE_RELEASE(_vertexShader); + AX_SAFE_RELEASE(_fragmentShader); } int ProgramMTL::getAttributeLocation(Attribute name) const @@ -132,7 +132,7 @@ const hlookup::string_map ProgramMTL::getActiveAttributes() c // case ShaderStage::FRAGMENT: // return _fragmentShader->cloneUniformBuffer(); // default: -// CCASSERT(false, "Invalid shader stage."); +// AXASSERT(false, "Invalid shader stage."); // break; // } // } @@ -146,7 +146,7 @@ const UniformInfo& ProgramMTL::getActiveUniformInfo(ShaderStage stage, int locat case ShaderStage::FRAGMENT: return _fragmentShader->getActiveUniform(location); default: - CCASSERT(false, "Invalid shader stage."); + AXASSERT(false, "Invalid shader stage."); break; } } @@ -160,7 +160,7 @@ std::size_t ProgramMTL::getUniformBufferSize(ShaderStage stage) const case ShaderStage::FRAGMENT: return _fragmentShader->getUniformBufferSize(); default: - CCASSERT(false, "Invalid shader stage."); + AXASSERT(false, "Invalid shader stage."); break; } return 0; @@ -175,7 +175,7 @@ const hlookup::string_map& ProgramMTL::getAllActiveUniformInfo(Shad case ShaderStage::FRAGMENT: return _fragmentShader->getAllActiveUniformInfo(); default: - CCASSERT(false, "Invalid shader stage."); + AXASSERT(false, "Invalid shader stage."); } } diff --git a/core/renderer/backend/metal/TextureMTL.h b/core/renderer/backend/metal/TextureMTL.h index 3242519689..a4d09bf8c8 100644 --- a/core/renderer/backend/metal/TextureMTL.h +++ b/core/renderer/backend/metal/TextureMTL.h @@ -65,7 +65,7 @@ struct TextureInfoMTL TextureDescriptor _descriptor; id _mtlDevice; - std::array, CC_META_TEXTURES + 1> _mtlTextures; + std::array, AX_META_TEXTURES + 1> _mtlTextures; int _maxIdx = -1; id _mtlSamplerState = nil; diff --git a/core/renderer/backend/metal/TextureMTL.mm b/core/renderer/backend/metal/TextureMTL.mm index 0ed8f4340e..11f5bda20a 100644 --- a/core/renderer/backend/metal/TextureMTL.mm +++ b/core/renderer/backend/metal/TextureMTL.mm @@ -48,7 +48,7 @@ MTLSamplerAddressMode toMTLSamplerAddressMode(SamplerAddressMode mode) ret = MTLSamplerAddressModeClampToEdge; break; default: - CCASSERT(false, "Not supported sampler address mode!"); + AXASSERT(false, "Not supported sampler address mode!"); break; } return ret; @@ -89,7 +89,7 @@ bool isColorRenderable(PixelFormat textureFormat) /// CLASS TextureInfoMTL id TextureInfoMTL::ensure(int index, int target) { - if (index < CC_META_TEXTURES) + if (index < AX_META_TEXTURES) { id& mtlTexture = _mtlTextures[index]; if (mtlTexture) diff --git a/core/renderer/backend/metal/UtilsMTL.mm b/core/renderer/backend/metal/UtilsMTL.mm index 714df700c9..a6d9a42560 100644 --- a/core/renderer/backend/metal/UtilsMTL.mm +++ b/core/renderer/backend/metal/UtilsMTL.mm @@ -41,7 +41,7 @@ namespace MTLPixelFormat getSupportedDepthStencilFormat() { MTLPixelFormat pixelFormat = MTLPixelFormatDepth32Float_Stencil8; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) bool isDepth24Stencil8PixelFormatSupported = DeviceInfoMTL::supportD24S8(); if (isDepth24Stencil8PixelFormatSupported) pixelFormat = MTLPixelFormatDepth24Unorm_Stencil8; @@ -79,7 +79,7 @@ static GPUTextureFormatInfo s_textureFormats[] = { {MTLPixelFormatInvalid, MTLPixelFormatInvalid}, // ATC_INTERPOLATED_ALPHA /* astc */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) {MTLPixelFormatASTC_4x4_LDR, MTLPixelFormatASTC_4x4_sRGB}, // ASTC4x4 {MTLPixelFormatASTC_5x5_LDR, MTLPixelFormatASTC_5x5_sRGB}, // ASTC5x5 {MTLPixelFormatASTC_6x6_LDR, MTLPixelFormatASTC_6x6_sRGB}, // ASTC6x6 @@ -111,7 +111,7 @@ static GPUTextureFormatInfo s_textureFormats[] = { /* depth stencil */ {MTLPixelFormat(255 /*Depth24Unorm_Stencil8*/), MTLPixelFormatInvalid}, // D24S8 }; -static_assert(CC_ARRAYSIZE(s_textureFormats) == (int)PixelFormat::COUNT, +static_assert(AX_ARRAYSIZE(s_textureFormats) == (int)PixelFormat::COUNT, "The OpenGL GPU texture format info table incomplete!"); void UtilsMTL::initGPUTextureFormats() diff --git a/core/renderer/backend/opengl/BufferGL.cpp b/core/renderer/backend/opengl/BufferGL.cpp index 7ed7023420..a2e574f9a9 100644 --- a/core/renderer/backend/opengl/BufferGL.cpp +++ b/core/renderer/backend/opengl/BufferGL.cpp @@ -51,7 +51,7 @@ BufferGL::BufferGL(std::size_t size, BufferType type, BufferUsage usage) : Buffe { glGenBuffers(1, &_buffer); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { this->reloadBuffer(); }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1); @@ -63,20 +63,20 @@ BufferGL::~BufferGL() if (_buffer) glDeleteBuffers(1, &_buffer); -#if CC_ENABLE_CACHE_TEXTURE_DATA - CC_SAFE_DELETE_ARRAY(_data); +#if AX_ENABLE_CACHE_TEXTURE_DATA + AX_SAFE_DELETE_ARRAY(_data); Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } void BufferGL::usingDefaultStoredData(bool needDefaultStoredData) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _needDefaultStoredData = needDefaultStoredData; #endif } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA void BufferGL::reloadBuffer() { glGenBuffers(1, &_buffer); @@ -121,7 +121,7 @@ void BufferGL::updateData(void* data, std::size_t size) CHECK_GL_ERROR_DEBUG(); _bufferAllocated = size; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA fillBuffer(data, 0, size); #endif } @@ -130,8 +130,8 @@ void BufferGL::updateData(void* data, std::size_t size) void BufferGL::updateSubData(void* data, std::size_t offset, std::size_t size) { - CCASSERT(_bufferAllocated != 0, "updateData should be invoke before updateSubData"); - CCASSERT(offset + size <= _bufferAllocated, "buffer size overflow"); + AXASSERT(_bufferAllocated != 0, "updateData should be invoke before updateSubData"); + AXASSERT(offset + size <= _bufferAllocated, "buffer size overflow"); if (_buffer) { @@ -147,7 +147,7 @@ void BufferGL::updateSubData(void* data, std::size_t offset, std::size_t size) glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, offset, size, data); } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA fillBuffer(data, offset, size); #endif CHECK_GL_ERROR_DEBUG(); diff --git a/core/renderer/backend/opengl/BufferGL.h b/core/renderer/backend/opengl/BufferGL.h index c2062693da..3c2e1b7eb3 100644 --- a/core/renderer/backend/opengl/BufferGL.h +++ b/core/renderer/backend/opengl/BufferGL.h @@ -85,7 +85,7 @@ public: inline GLuint getHandler() const { return _buffer; } private: -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA void reloadBuffer(); void fillBuffer(void* data, std::size_t offset, std::size_t size); diff --git a/core/renderer/backend/opengl/CommandBufferGL.cpp b/core/renderer/backend/opengl/CommandBufferGL.cpp index eac9209330..5871fc61ef 100644 --- a/core/renderer/backend/opengl/CommandBufferGL.cpp +++ b/core/renderer/backend/opengl/CommandBufferGL.cpp @@ -189,7 +189,7 @@ void CommandBufferGL::setIndexBuffer(Buffer* buffer) return; buffer->retain(); - CC_SAFE_RELEASE(_indexBuffer); + AX_SAFE_RELEASE(_indexBuffer); _indexBuffer = static_cast(buffer); } @@ -200,14 +200,14 @@ void CommandBufferGL::setVertexBuffer(Buffer* buffer) return; buffer->retain(); - CC_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_vertexBuffer); _vertexBuffer = static_cast(buffer); } void CommandBufferGL::setProgramState(ProgramState* programState) { - CC_SAFE_RETAIN(programState); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RETAIN(programState); + AX_SAFE_RELEASE(_programState); _programState = programState; } @@ -234,8 +234,8 @@ void CommandBufferGL::drawElements(PrimitiveType primitiveType, void CommandBufferGL::endRenderPass() { - CC_SAFE_RELEASE_NULL(_indexBuffer); - CC_SAFE_RELEASE_NULL(_vertexBuffer); + AX_SAFE_RELEASE_NULL(_indexBuffer); + AX_SAFE_RELEASE_NULL(_vertexBuffer); } void CommandBufferGL::endFrame() {} @@ -325,7 +325,7 @@ void CommandBufferGL::setUniforms(ProgramGL* program) const auto& slots = iter.second.slots; auto& indexs = iter.second.indexs; auto location = iter.first; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA location = iter.second.location; #endif int i = 0; @@ -418,14 +418,14 @@ void CommandBufferGL::setUniform(bool isArray, GLuint location, unsigned int siz break; default: - CCASSERT(false, "invalidate Uniform data type"); + AXASSERT(false, "invalidate Uniform data type"); break; } } void CommandBufferGL::cleanResources() { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); } void CommandBufferGL::setLineWidth(float lineWidth) @@ -483,8 +483,8 @@ void CommandBufferGL::readPixels(RenderTarget* rt, glPixelStorei(GL_PACK_ALIGNMENT, 1); auto bufferSize = bytesPerRow * height; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(GL_ES_VERSION_3_0)) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID && defined(GL_PIXEL_PACK_BUFFER)) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 && defined(GL_ES_VERSION_3_0)) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID && defined(GL_PIXEL_PACK_BUFFER)) GLuint pbo; glGenBuffers(1, &pbo); glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo); @@ -510,8 +510,8 @@ void CommandBufferGL::readPixels(RenderTarget* rt, pbd._width = width; pbd._height = height; } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(GL_ES_VERSION_3_0)) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID && defined(GL_PIXEL_PACK_BUFFER)) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 && defined(GL_ES_VERSION_3_0)) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID && defined(GL_PIXEL_PACK_BUFFER)) glUnmapBuffer(GL_PIXEL_PACK_BUFFER); glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); glDeleteBuffers(1, &pbo); diff --git a/core/renderer/backend/opengl/CommandBufferGL.h b/core/renderer/backend/opengl/CommandBufferGL.h index f49ff943cf..95c68fb409 100644 --- a/core/renderer/backend/opengl/CommandBufferGL.h +++ b/core/renderer/backend/opengl/CommandBufferGL.h @@ -218,7 +218,7 @@ private: Viewport _viewPort; GLboolean _alphaTestEnabled = false; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener = nullptr; #endif }; diff --git a/core/renderer/backend/opengl/DeviceInfoGL.cpp b/core/renderer/backend/opengl/DeviceInfoGL.cpp index baf8b5a801..3dfdcbd999 100644 --- a/core/renderer/backend/opengl/DeviceInfoGL.cpp +++ b/core/renderer/backend/opengl/DeviceInfoGL.cpp @@ -68,7 +68,7 @@ static bool checkReallySupportsASTC() astctexels); auto error = glGetError(); -#if defined(CC_USE_GL) +#if defined(AX_USE_GL) if (!error && glGetTexImage) { // read pixel RGB: should be: 255, 128, 0 @@ -148,7 +148,7 @@ bool DeviceInfoGL::checkForFeatureSupported(FeatureType feature) featureSupported = checkForGLExtension("GL_OES_packed_depth_stencil"); break; case FeatureType::VAO: -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC featureSupported = checkForGLExtension("vertex_array_object"); #else featureSupported = checkForGLExtension("GL_OES_vertex_array_object"); diff --git a/core/renderer/backend/opengl/MacrosGL.h b/core/renderer/backend/opengl/MacrosGL.h index 81a5f35b97..8e6f623d09 100644 --- a/core/renderer/backend/opengl/MacrosGL.h +++ b/core/renderer/backend/opengl/MacrosGL.h @@ -26,7 +26,7 @@ #include "base/ccMacros.h" -#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 +#if !defined(AXIS_DEBUG) || AXIS_DEBUG == 0 # define CHECK_GL_ERROR_DEBUG() #else # define CHECK_GL_ERROR_DEBUG() \ @@ -59,13 +59,13 @@ * function calls. */ #if defined(NDEBUG) || (defined(__APPLE__) && !defined(DEBUG)) -# define CC_GL_ASSERT(gl_code) gl_code +# define AX_GL_ASSERT(gl_code) gl_code #else -# define CC_GL_ASSERT(gl_code) \ +# define AX_GL_ASSERT(gl_code) \ do \ { \ gl_code; \ __gl_error_code = glGetError(); \ - CC_ASSERT(__gl_error_code == GL_NO_ERROR, "Error"); \ + AX_ASSERT(__gl_error_code == GL_NO_ERROR, "Error"); \ } while (0) #endif diff --git a/core/renderer/backend/opengl/ProgramGL.cpp b/core/renderer/backend/opengl/ProgramGL.cpp index 131497787c..72cda1c283 100644 --- a/core/renderer/backend/opengl/ProgramGL.cpp +++ b/core/renderer/backend/opengl/ProgramGL.cpp @@ -43,7 +43,7 @@ static const std::string SHADER_PREDEFINE = "#version 100\n precision highp floa ProgramGL::ProgramGL(std::string_view vertexShader, std::string_view fragmentShader) : Program(vertexShader, fragmentShader) { -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) // some device required manually specify the precision qualifiers for vertex shader. _vertexShaderModule = static_cast(ShaderCache::newVertexShaderModule(SHADER_PREDEFINE + _vertexShader)); @@ -54,12 +54,12 @@ ProgramGL::ProgramGL(std::string_view vertexShader, std::string_view fragmentSha _fragmentShaderModule = static_cast(ShaderCache::newFragmentShaderModule(_fragmentShader)); #endif - CC_SAFE_RETAIN(_vertexShaderModule); - CC_SAFE_RETAIN(_fragmentShaderModule); + AX_SAFE_RETAIN(_vertexShaderModule); + AX_SAFE_RETAIN(_fragmentShaderModule); compileProgram(); computeUniformInfos(); computeLocations(); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA for (const auto& uniform : _activeUniformInfos) { auto location = uniform.second.location; @@ -76,17 +76,17 @@ ProgramGL::ProgramGL(std::string_view vertexShader, std::string_view fragmentSha ProgramGL::~ProgramGL() { - CC_SAFE_RELEASE(_vertexShaderModule); - CC_SAFE_RELEASE(_fragmentShaderModule); + AX_SAFE_RELEASE(_vertexShaderModule); + AX_SAFE_RELEASE(_fragmentShaderModule); if (_program) glDeleteProgram(_program); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA void ProgramGL::reloadProgram() { _activeUniformInfos.clear(); @@ -203,7 +203,7 @@ bool ProgramGL::getAttributeLocation(std::string_view attributeName, unsigned in GLint loc = glGetAttribLocation(_program, attributeName.data()); if (-1 == loc) { - CCLOG("Cocos2d: %s: can not find vertex attribute of %s", __FUNCTION__, attributeName.data()); + AXLOG("Cocos2d: %s: can not find vertex attribute of %s", __FUNCTION__, attributeName.data()); return false; } @@ -310,7 +310,7 @@ UniformLocation ProgramGL::getUniformLocation(std::string_view uniform) const if (_activeUniformInfos.find(uniform) != _activeUniformInfos.end()) { const auto& uniformInfo = _activeUniformInfos.at(uniform); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA uniformLocation.location[0] = _mapToOriginalLocation.at(uniformInfo.location); #else uniformLocation.location[0] = uniformInfo.location; @@ -329,7 +329,7 @@ int ProgramGL::getMaxFragmentLocation() const return _maxLocation; } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA int ProgramGL::getMappedLocation(int location) const { if (_mapToCurrentActiveLocation.find(location) != _mapToCurrentActiveLocation.end()) diff --git a/core/renderer/backend/opengl/ProgramGL.h b/core/renderer/backend/opengl/ProgramGL.h index 1e521b3152..59c2607631 100644 --- a/core/renderer/backend/opengl/ProgramGL.h +++ b/core/renderer/backend/opengl/ProgramGL.h @@ -156,7 +156,7 @@ private: bool getAttributeLocation(std::string_view attributeName, unsigned int& location) const; void computeUniformInfos(); void computeLocations(); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA virtual void reloadProgram(); virtual int getMappedLocation(int location) const override; virtual int getOriginalLocation(int location) const override; @@ -172,7 +172,7 @@ private: std::vector _attributeInfos; hlookup::string_map _activeUniformInfos; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA std::unordered_map _originalUniformLocations; ///< record the uniform location when shader was first created. std::unordered_map _mapToCurrentActiveLocation; ///< diff --git a/core/renderer/backend/opengl/RenderPipelineGL.cpp b/core/renderer/backend/opengl/RenderPipelineGL.cpp index e9bad70c3b..5da3e075f5 100644 --- a/core/renderer/backend/opengl/RenderPipelineGL.cpp +++ b/core/renderer/backend/opengl/RenderPipelineGL.cpp @@ -37,9 +37,9 @@ void RenderPipelineGL::update(const RenderTarget*, const PipelineDescriptor& pip { if (_programGL != pipelineDescirptor.programState->getProgram()) { - CC_SAFE_RELEASE(_programGL); + AX_SAFE_RELEASE(_programGL); _programGL = static_cast(pipelineDescirptor.programState->getProgram()); - CC_SAFE_RETAIN(_programGL); + AX_SAFE_RETAIN(_programGL); } updateBlendState(pipelineDescirptor.blendDescriptor); @@ -74,7 +74,7 @@ void RenderPipelineGL::updateBlendState(const BlendDescriptor& descriptor) RenderPipelineGL::~RenderPipelineGL() { - CC_SAFE_RELEASE(_programGL); + AX_SAFE_RELEASE(_programGL); } NS_AX_BACKEND_END diff --git a/core/renderer/backend/opengl/RenderTargetGL.cpp b/core/renderer/backend/opengl/RenderTargetGL.cpp index 9e7b44189a..b42932cf8c 100644 --- a/core/renderer/backend/opengl/RenderTargetGL.cpp +++ b/core/renderer/backend/opengl/RenderTargetGL.cpp @@ -60,7 +60,7 @@ void RenderTargetGL::update() const { bufs[i] = GL_COLOR_ATTACHMENT0 + i; } } - #if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX glDrawBuffers(MAX_COLOR_ATTCHMENT, bufs); #endif CHECK_GL_ERROR_DEBUG(); diff --git a/core/renderer/backend/opengl/ShaderModuleGL.cpp b/core/renderer/backend/opengl/ShaderModuleGL.cpp index afbe54b52b..8c9716dcd5 100644 --- a/core/renderer/backend/opengl/ShaderModuleGL.cpp +++ b/core/renderer/backend/opengl/ShaderModuleGL.cpp @@ -72,7 +72,7 @@ void ShaderModuleGL::compileShader(ShaderStage stage, std::string_view source) } deleteShader(); - CCASSERT(false, "Shader compile failed!"); + AXASSERT(false, "Shader compile failed!"); } } diff --git a/core/renderer/backend/opengl/TextureGL.cpp b/core/renderer/backend/opengl/TextureGL.cpp index 1e6075b5d6..6056eeefc0 100644 --- a/core/renderer/backend/opengl/TextureGL.cpp +++ b/core/renderer/backend/opengl/TextureGL.cpp @@ -98,12 +98,12 @@ void TextureInfoGL::setCurrentTexParameters(GLenum target) void TextureInfoGL::apply(int slot, int index, GLenum target) const { glActiveTexture(GL_TEXTURE0 + slot); - glBindTexture(target, index < CC_META_TEXTURES ? textures[index] : textures[0]); + glBindTexture(target, index < AX_META_TEXTURES ? textures[index] : textures[0]); } GLuint TextureInfoGL::ensure(int index, GLenum target) { - if (index >= CC_META_TEXTURES) + if (index >= AX_META_TEXTURES) return 0; // glActiveTexture(GL_TEXTURE0 + index); auto& texID = this->textures[index]; @@ -139,7 +139,7 @@ Texture2DGL::Texture2DGL(const TextureDescriptor& descriptor) { updateTextureDescriptor(descriptor); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // Listen this event to restored texture id after coming to foreground on Android. _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { _textureInfo.recreateAll(GL_TEXTURE_2D); @@ -184,7 +184,7 @@ void Texture2DGL::initWithZeros() Texture2DGL::~Texture2DGL() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -318,7 +318,7 @@ TextureCubeGL::TextureCubeGL(const TextureDescriptor& descriptor) _textureType = TextureType::TEXTURE_CUBE; updateTextureDescriptor(descriptor); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // Listen this event to restored texture id after coming to foreground on Android. _backToForegroundListener = EventListenerCustom::create( EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { _textureInfo.recreateAll(GL_TEXTURE_CUBE_MAP); }); @@ -339,7 +339,7 @@ void TextureCubeGL::updateTextureDescriptor(const axis::backend::TextureDescript TextureCubeGL::~TextureCubeGL() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } diff --git a/core/renderer/backend/opengl/TextureGL.h b/core/renderer/backend/opengl/TextureGL.h index eb59fa87a5..39ceffece9 100644 --- a/core/renderer/backend/opengl/TextureGL.h +++ b/core/renderer/backend/opengl/TextureGL.h @@ -80,7 +80,7 @@ struct TextureInfoGL GLenum format = GL_RGBA; GLenum type = GL_UNSIGNED_BYTE; - std::array textures; + std::array textures; int maxIdx = 0; }; diff --git a/core/renderer/backend/opengl/UtilsGL.cpp b/core/renderer/backend/opengl/UtilsGL.cpp index daa9182b93..4039a5d9fe 100644 --- a/core/renderer/backend/opengl/UtilsGL.cpp +++ b/core/renderer/backend/opengl/UtilsGL.cpp @@ -90,13 +90,13 @@ static GPUTextureFormatInfo s_textureFormats[] = { GL_LUMINANCE_ALPHA, GL_SLUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, }, // LA8 /* depth stencil internalFormat | internalFormatSrgb | format | formatSrgb | type */ -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) { GL_DEPTH_STENCIL_OES, GL_ZERO, GL_DEPTH_STENCIL_OES, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, }, // D24S8 #else { GL_DEPTH24_STENCIL8, GL_ZERO, GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, }, // D24S8 #endif }; -static_assert(CC_ARRAYSIZE(s_textureFormats) == (int)PixelFormat::COUNT, "The OpenGL GPU texture format info table incomplete!"); +static_assert(AX_ARRAYSIZE(s_textureFormats) == (int)PixelFormat::COUNT, "The OpenGL GPU texture format info table incomplete!"); // clang-format on /* @@ -230,7 +230,7 @@ GLint UtilsGL::toGLMinFilter(SamplerFilter minFilter, bool hasMipmaps, bool isPo { if (hasMipmaps && !isPow2) { - CCLOG("Change minification filter to either NEAREST or LINEAR since non-power-of-two texture occur in %s %s %d", + AXLOG("Change minification filter to either NEAREST or LINEAR since non-power-of-two texture occur in %s %s %d", __FILE__, __FUNCTION__, __LINE__); if (SamplerFilter::LINEAR == minFilter) return GL_LINEAR; @@ -264,7 +264,7 @@ GLint UtilsGL::toGLAddressMode(SamplerAddressMode addressMode, bool isPow2) GLint ret = GL_REPEAT; if (!isPow2 && (addressMode != SamplerAddressMode::CLAMP_TO_EDGE)) { - CCLOG("Change texture wrap mode to CLAMP_TO_EDGE since non-power-of-two texture occur in %s %s %d", __FILE__, + AXLOG("Change texture wrap mode to CLAMP_TO_EDGE since non-power-of-two texture occur in %s %s %d", __FILE__, __FUNCTION__, __LINE__); return GL_CLAMP_TO_EDGE; } diff --git a/core/renderer/ccShaders.h b/core/renderer/ccShaders.h index 9ca49efc41..b26e65f3b9 100644 --- a/core/renderer/ccShaders.h +++ b/core/renderer/ccShaders.h @@ -37,53 +37,53 @@ THE SOFTWARE. NS_AX_BEGIN -extern CC_DLL const char* positionColor_vert; -extern CC_DLL const char* positionColor_frag; -extern CC_DLL const char* positionTexture_vert; -extern CC_DLL const char* positionTexture_frag; -extern CC_DLL const char* positionTextureColor_vert; -extern CC_DLL const char* positionTextureColor_frag; -extern CC_DLL const char* positionTextureColorAlphaTest_frag; -extern CC_DLL const char* label_normal_frag; -extern CC_DLL const char* label_distanceNormal_frag; -extern CC_DLL const char* labelOutline_frag; -extern CC_DLL const char* labelDistanceFieldGlow_frag; -extern CC_DLL const char* lineColor3D_frag; -extern CC_DLL const char* lineColor3D_vert; -extern CC_DLL const char* positionColorLengthTexture_vert; -extern CC_DLL const char* positionColorLengthTexture_frag; -extern CC_DLL const char* positionColorTextureAsPointsize_vert; -extern CC_DLL const char* position_vert; -extern CC_DLL const char* layer_radialGradient_frag; -extern CC_DLL const char* grayScale_frag; -extern CC_DLL const char* positionUColor_vert; -extern CC_DLL const char* dualSampler_frag; -extern CC_DLL const char* dualSampler_gray_frag; -extern CC_DLL const char* cameraClear_vert; -extern CC_DLL const char* cameraClear_frag; +extern AX_DLL const char* positionColor_vert; +extern AX_DLL const char* positionColor_frag; +extern AX_DLL const char* positionTexture_vert; +extern AX_DLL const char* positionTexture_frag; +extern AX_DLL const char* positionTextureColor_vert; +extern AX_DLL const char* positionTextureColor_frag; +extern AX_DLL const char* positionTextureColorAlphaTest_frag; +extern AX_DLL const char* label_normal_frag; +extern AX_DLL const char* label_distanceNormal_frag; +extern AX_DLL const char* labelOutline_frag; +extern AX_DLL const char* labelDistanceFieldGlow_frag; +extern AX_DLL const char* lineColor3D_frag; +extern AX_DLL const char* lineColor3D_vert; +extern AX_DLL const char* positionColorLengthTexture_vert; +extern AX_DLL const char* positionColorLengthTexture_frag; +extern AX_DLL const char* positionColorTextureAsPointsize_vert; +extern AX_DLL const char* position_vert; +extern AX_DLL const char* layer_radialGradient_frag; +extern AX_DLL const char* grayScale_frag; +extern AX_DLL const char* positionUColor_vert; +extern AX_DLL const char* dualSampler_frag; +extern AX_DLL const char* dualSampler_gray_frag; +extern AX_DLL const char* cameraClear_vert; +extern AX_DLL const char* cameraClear_frag; -extern CC_DLL const char* CC3D_color_frag; -extern CC_DLL const char* CC3D_colorNormal_frag; -extern CC_DLL const char* CC3D_colorNormalTexture_frag; -extern CC_DLL const char* CC3D_colorTexture_frag; -extern CC_DLL const char* CC3D_particleTexture_frag; -extern CC_DLL const char* CC3D_particleColor_frag; -extern CC_DLL const char* CC3D_particle_vert; -extern CC_DLL const char* CC3D_positionNormalTexture_vert; -extern CC_DLL const char* CC3D_skinPositionNormalTexture_vert; -extern CC_DLL const char* CC3D_positionTexture_vert; -extern CC_DLL const char* CC3D_skinPositionTexture_vert; -extern CC_DLL const char* CC3D_skybox_frag; -extern CC_DLL const char* CC3D_skybox_vert; -extern CC_DLL const char* CC3D_terrain_frag; -extern CC_DLL const char* CC3D_terrain_vert; +extern AX_DLL const char* CC3D_color_frag; +extern AX_DLL const char* CC3D_colorNormal_frag; +extern AX_DLL const char* CC3D_colorNormalTexture_frag; +extern AX_DLL const char* CC3D_colorTexture_frag; +extern AX_DLL const char* CC3D_particleTexture_frag; +extern AX_DLL const char* CC3D_particleColor_frag; +extern AX_DLL const char* CC3D_particle_vert; +extern AX_DLL const char* CC3D_positionNormalTexture_vert; +extern AX_DLL const char* CC3D_skinPositionNormalTexture_vert; +extern AX_DLL const char* CC3D_positionTexture_vert; +extern AX_DLL const char* CC3D_skinPositionTexture_vert; +extern AX_DLL const char* CC3D_skybox_frag; +extern AX_DLL const char* CC3D_skybox_vert; +extern AX_DLL const char* CC3D_terrain_frag; +extern AX_DLL const char* CC3D_terrain_vert; -extern CC_DLL const char* CC2D_quadTexture_frag; -extern CC_DLL const char* CC2D_quadColor_frag; -extern CC_DLL const char* CC2D_quad_vert; +extern AX_DLL const char* CC2D_quadTexture_frag; +extern AX_DLL const char* CC2D_quadColor_frag; +extern AX_DLL const char* CC2D_quad_vert; -extern CC_DLL const char* hsv_frag; -extern CC_DLL const char* dualSampler_hsv_frag; +extern AX_DLL const char* hsv_frag; +extern AX_DLL const char* dualSampler_hsv_frag; NS_AX_END /** end of support group diff --git a/core/ui/CocosGUI.h b/core/ui/CocosGUI.h index 40dca1fcea..acf8b0fc38 100644 --- a/core/ui/CocosGUI.h +++ b/core/ui/CocosGUI.h @@ -67,7 +67,7 @@ namespace ui * Get current cocos GUI module version string. *@return A string representation of GUI module version number */ -CC_GUI_DLL const char* CocosGUIVersion(); +AX_GUI_DLL const char* CocosGUIVersion(); } // namespace ui diff --git a/core/ui/GUIDefine.h b/core/ui/GUIDefine.h index 460c0874dd..1ae676a088 100644 --- a/core/ui/GUIDefine.h +++ b/core/ui/GUIDefine.h @@ -60,13 +60,13 @@ public: \ #define CREATE_CLASS_WIDGET_READER_INFO(className) axis::ObjectFactory::TInfo(#className, &className::createInstance) -#define CC_VIDEOPLAYER_DEBUG_DRAW 0 +#define AX_VIDEOPLAYER_DEBUG_DRAW 0 #define __LAYOUT_COMPONENT_NAME "__ui_layout" ///@endcond NS_AX_BEGIN -struct CC_DLL ResourceData +struct AX_DLL ResourceData { int type; std::string file; diff --git a/core/ui/GUIExport.h b/core/ui/GUIExport.h index 55e42ac99c..aa8a8371fd 100644 --- a/core/ui/GUIExport.h +++ b/core/ui/GUIExport.h @@ -30,13 +30,13 @@ # include # endif -# if defined(CC_STATIC) -# define CC_GUI_DLL +# if defined(AX_STATIC) +# define AX_GUI_DLL # else # if defined(_USEGUIDLL) -# define CC_GUI_DLL __declspec(dllexport) +# define AX_GUI_DLL __declspec(dllexport) # else -# define CC_GUI_DLL __declspec(dllimport) +# define AX_GUI_DLL __declspec(dllimport) # endif # endif @@ -49,9 +49,9 @@ # endif # endif #elif defined(_SHARED_) -# define CC_GUI_DLL __attribute__((visibility("default"))) +# define AX_GUI_DLL __attribute__((visibility("default"))) #else -# define CC_GUI_DLL +# define AX_GUI_DLL #endif #endif /* __CCEXTENSIONEXPORT_H__*/ \ No newline at end of file diff --git a/core/ui/LayoutHelper.cpp b/core/ui/LayoutHelper.cpp index 8b817171f0..8f88ac2ffe 100644 --- a/core/ui/LayoutHelper.cpp +++ b/core/ui/LayoutHelper.cpp @@ -1030,7 +1030,7 @@ float LayoutHelper::VisibleRect::getNodeTop(Node* pNode) void LayoutHelper::VisibleRect::setNodeLeft(Node* pNode, float left) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(0, scrSize.height) - LayoutHelper::VisibleRect::leftTop(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1045,7 +1045,7 @@ void LayoutHelper::VisibleRect::setNodeLeft(Node* pNode, float left) } void LayoutHelper::VisibleRect::setNodeTop(Node* pNode, float top) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(0, scrSize.height) - LayoutHelper::VisibleRect::leftTop(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1060,7 +1060,7 @@ void LayoutHelper::VisibleRect::setNodeTop(Node* pNode, float top) } void LayoutHelper::VisibleRect::setNodeRight(Node* pNode, float right) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, 0) - LayoutHelper::VisibleRect::rightBottom(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1075,7 +1075,7 @@ void LayoutHelper::VisibleRect::setNodeRight(Node* pNode, float right) } void LayoutHelper::VisibleRect::setNodeBottom(Node* pNode, float bottom) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, 0) - LayoutHelper::VisibleRect::rightBottom(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1091,7 +1091,7 @@ void LayoutHelper::VisibleRect::setNodeBottom(Node* pNode, float bottom) void LayoutHelper::VisibleRect::setNodeLT(Node* pNode, const axis::Point& p) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(0, scrSize.height) - LayoutHelper::VisibleRect::leftTop(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1108,7 +1108,7 @@ void LayoutHelper::VisibleRect::setNodeLT(Node* pNode, const axis::Point& p) } void LayoutHelper::VisibleRect::setNodeRT(Node* pNode, const axis::Point& p) { // right top - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, scrSize.height) - LayoutHelper::VisibleRect::rightTop(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1124,7 +1124,7 @@ void LayoutHelper::VisibleRect::setNodeRT(Node* pNode, const axis::Point& p) } void LayoutHelper::VisibleRect::setNodeLB(Node* pNode, const axis::Point& p) { // left bottom - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(0, 0) - LayoutHelper::VisibleRect::leftBottom(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1140,7 +1140,7 @@ void LayoutHelper::VisibleRect::setNodeLB(Node* pNode, const axis::Point& p) } void LayoutHelper::VisibleRect::setNodeRB(Node* pNode, const axis::Point& p) { // right bottom - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, 0) - LayoutHelper::VisibleRect::rightBottom(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1159,7 +1159,7 @@ void LayoutHelper::VisibleRect::setNodeRB(Node* pNode, const axis::Point& p) /// ratio position void LayoutHelper::VisibleRect::setNodeNormalizedLT(Node* pNode, const axis::Point& ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(0, scrSize.height) - LayoutHelper::VisibleRect::leftTop(); @@ -1181,7 +1181,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedLT(Node* pNode, const axis::Poi } void LayoutHelper::VisibleRect::setNodeNormalizedRT(Node* pNode, const axis::Point& ratio) { // right top - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, scrSize.height) - LayoutHelper::VisibleRect::rightTop(); @@ -1202,7 +1202,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedRT(Node* pNode, const axis::Poi } void LayoutHelper::VisibleRect::setNodeNormalizedLB(Node* pNode, const axis::Point& ratio) { // left bottom - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(0, 0) - LayoutHelper::VisibleRect::leftBottom(); @@ -1223,7 +1223,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedLB(Node* pNode, const axis::Poi } void LayoutHelper::VisibleRect::setNodeNormalizedRB(Node* pNode, const axis::Point& ratio) { // right bottom - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, 0) - LayoutHelper::VisibleRect::rightBottom(); @@ -1245,7 +1245,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedRB(Node* pNode, const axis::Poi void LayoutHelper::VisibleRect::setNodeNormalizedTop(Node* pNode, const float ratioTop) { // right top - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, scrSize.height) - LayoutHelper::VisibleRect::rightTop(); @@ -1265,7 +1265,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedTop(Node* pNode, const float ra void LayoutHelper::VisibleRect::setNodeNormalizedPositionX(axis::Node* pNode, float ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); axis::Rect visibleRect = LayoutHelper::LayoutHelper::VisibleRect::getScreenVisibleRect(); axis::Point ptWorld(visibleRect.size.width * ratio + visibleRect.origin.x, 0); auto ptLocal = pNode->getParent()->convertToNodeSpace(ptWorld); @@ -1274,7 +1274,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedPositionX(axis::Node* pNode, fl void LayoutHelper::VisibleRect::setNodeNormalizedPositionY(axis::Node* pNode, float ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); axis::Rect visibleRect = LayoutHelper::LayoutHelper::VisibleRect::getScreenVisibleRect(); axis::Point ptWorld(0, visibleRect.size.height * ratio + visibleRect.origin.y); @@ -1283,7 +1283,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedPositionY(axis::Node* pNode, fl } void LayoutHelper::VisibleRect::setNodeNormalizedPosition(Node* pNode, const axis::Point& ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); pNode->setIgnoreAnchorPointForPosition(false); pNode->setAnchorPoint(axis::Vec2(.5f, .5f)); axis::Rect visibleRect = LayoutHelper::LayoutHelper::VisibleRect::getScreenVisibleRect(); diff --git a/core/ui/LayoutHelper.h b/core/ui/LayoutHelper.h index 65073d2db1..1215af1283 100644 --- a/core/ui/LayoutHelper.h +++ b/core/ui/LayoutHelper.h @@ -37,7 +37,7 @@ USING_NS_AX; // return Vec2(left.width * right.x, left.height * right.y); // } -struct CC_DLL LayoutHelper +struct AX_DLL LayoutHelper { static Vec2 s_designSize; @@ -222,7 +222,7 @@ struct CC_DLL LayoutHelper // @version 2 static void centerNodeX(axis::Node* pNode, const Vec2& parentSize) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -235,7 +235,7 @@ struct CC_DLL LayoutHelper static void centerNodeY(axis::Node* pNode, const Vec2& parentSize) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -248,7 +248,7 @@ struct CC_DLL LayoutHelper static void centerNode(axis::Node* pNode, const Vec2& parentSize) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achor = axis::Vec2::ZERO; @@ -375,7 +375,7 @@ struct CC_DLL LayoutHelper // @version 2 used as internal interfaces static void setNodeLeft(axis::Node* pNode, const Vec2& parentSize, float left, float anchor = 0.0f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -387,7 +387,7 @@ struct CC_DLL LayoutHelper } static float getNodeLeft(axis::Node* pNode, const Vec2& parentSize, float anchor = 0.0f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -400,7 +400,7 @@ struct CC_DLL LayoutHelper static void setNodeTop(axis::Node* pNode, const Vec2& parentSize, float top, float anchor = 0.0f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -412,7 +412,7 @@ struct CC_DLL LayoutHelper } static float getNodeTop(axis::Node* pNode, const Vec2& parentSize, float anchor = 0.0f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -425,7 +425,7 @@ struct CC_DLL LayoutHelper static void setNodeRight(axis::Node* pNode, const Vec2& parentSize, float right) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -438,7 +438,7 @@ struct CC_DLL LayoutHelper static float getNodeRight(axis::Node* pNode, const Vec2& parentSize, float anchor = 0.0f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -451,7 +451,7 @@ struct CC_DLL LayoutHelper static void setNodeBottom(axis::Node* pNode, const Vec2& parentSize, float bottom, float anchor = 0.0f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -464,7 +464,7 @@ struct CC_DLL LayoutHelper static float getNodeBottom(axis::Node* pNode, const Vec2& parentSize, float anchor = 0.f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -477,7 +477,7 @@ struct CC_DLL LayoutHelper static void setNodeLB(axis::Node* pNode, const Vec2& parentSize, const axis::Point& p) { // left bottom - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achorPoint = axis::Vec2::ZERO; @@ -491,7 +491,7 @@ struct CC_DLL LayoutHelper static void setNodeRB(axis::Node* pNode, const Vec2& parentSize, const axis::Point& p) { // right bottom - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achorPoint = axis::Vec2::ZERO; @@ -505,7 +505,7 @@ struct CC_DLL LayoutHelper static void setNodeLT(axis::Node* pNode, const Vec2& parentSize, const axis::Point& p) { // left top - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achorPoint = axis::Vec2::ZERO; @@ -519,7 +519,7 @@ struct CC_DLL LayoutHelper static void setNodeRT(axis::Node* pNode, const Vec2& parentSize, const axis::Point& p) { // right top - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achorPoint = axis::Vec2::ZERO; @@ -561,20 +561,20 @@ struct CC_DLL LayoutHelper /* set node position as normalized: @version 2 */ static void setNodeNormalizedPositionX(axis::Node* pNode, const Vec2& parentSize, float ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); pNode->setPositionX(parentSize.width * ratio); } static void setNodeNormalizedPositionY(axis::Node* pNode, const Vec2& parentSize, float ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); pNode->setPositionY(parentSize.height * ratio); } static void setNodeNormalizedPosition(axis::Node* pNode, const Vec2& parentSize, const axis::Point& ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); pNode->setPosition(axis::Point(parentSize.width * ratio.x, parentSize.height * ratio.y)); } @@ -773,7 +773,7 @@ struct CC_DLL LayoutHelper /// /// CLASS VisibleRect /// - class CC_DLL VisibleRect + class AX_DLL VisibleRect { public: static void refresh(void); diff --git a/core/ui/UIAbstractCheckButton.h b/core/ui/UIAbstractCheckButton.h index a77ff6cc7a..25f8ab3c05 100644 --- a/core/ui/UIAbstractCheckButton.h +++ b/core/ui/UIAbstractCheckButton.h @@ -35,7 +35,7 @@ THE SOFTWARE. */ NS_AX_BEGIN class Sprite; -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -43,7 +43,7 @@ namespace ui /** * AbstractCheckButton is a specific type of two-states button that can be either checked or unchecked. */ -class CC_GUI_DLL AbstractCheckButton : public Widget +class AX_GUI_DLL AbstractCheckButton : public Widget { public: diff --git a/core/ui/UIButton.cpp b/core/ui/UIButton.cpp index f4003b9940..5880455abd 100644 --- a/core/ui/UIButton.cpp +++ b/core/ui/UIButton.cpp @@ -88,7 +88,7 @@ Button* Button::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -103,7 +103,7 @@ Button* Button::create(std::string_view normalImage, btn->autorelease(); return btn; } - CC_SAFE_DELETE(btn); + AX_SAFE_DELETE(btn); return nullptr; } @@ -170,9 +170,9 @@ void Button::setTitleLabel(Label* label) { if (_titleRenderer != label) { - CC_SAFE_RELEASE(_titleRenderer); + AX_SAFE_RELEASE(_titleRenderer); _titleRenderer = label; - CC_SAFE_RETAIN(_titleRenderer); + AX_SAFE_RETAIN(_titleRenderer); addProtectedChild(_titleRenderer, TITLE_RENDERER_Z, -1); updateTitleLocation(); @@ -729,7 +729,7 @@ void Button::setTitleText(std::string_view text) if (getTitleFontSize() <= 0) { - setTitleFontSize(CC_DEFAULT_FONT_LABEL_SIZE); + setTitleFontSize(AX_DEFAULT_FONT_LABEL_SIZE); } _titleRenderer->setString(text); diff --git a/core/ui/UIButton.h b/core/ui/UIButton.h index 05e0f5f1cd..0d4d628bcb 100644 --- a/core/ui/UIButton.h +++ b/core/ui/UIButton.h @@ -38,7 +38,7 @@ NS_AX_BEGIN class Label; class SpriteFrame; -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -48,7 +48,7 @@ class Scale9Sprite; * Represents a push-button widget. * Push-buttons can be pressed, or clicked, by the user to perform an action. */ -class CC_GUI_DLL Button : public Widget +class AX_GUI_DLL Button : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UICheckBox.cpp b/core/ui/UICheckBox.cpp index 50d6999e42..7456dd120c 100644 --- a/core/ui/UICheckBox.cpp +++ b/core/ui/UICheckBox.cpp @@ -44,7 +44,7 @@ CheckBox* CheckBox::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -61,7 +61,7 @@ CheckBox* CheckBox::create(std::string_view backGround, pWidget->autorelease(); return pWidget; } - CC_SAFE_DELETE(pWidget); + AX_SAFE_DELETE(pWidget); return nullptr; } @@ -73,7 +73,7 @@ CheckBox* CheckBox::create(std::string_view backGround, std::string_view cross, pWidget->autorelease(); return pWidget; } - CC_SAFE_DELETE(pWidget); + AX_SAFE_DELETE(pWidget); return nullptr; } diff --git a/core/ui/UICheckBox.h b/core/ui/UICheckBox.h index caae7404ee..c18f1f18a0 100644 --- a/core/ui/UICheckBox.h +++ b/core/ui/UICheckBox.h @@ -41,7 +41,7 @@ namespace ui /** * Checkbox is a specific type of two-states button that can be either checked or unchecked. */ -class CC_GUI_DLL CheckBox : public AbstractCheckButton +class AX_GUI_DLL CheckBox : public AbstractCheckButton { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UIEditBox/Mac/CCUIEditBoxMac.mm b/core/ui/UIEditBox/Mac/CCUIEditBoxMac.mm index c7bfa40ec4..5ac60cb3bb 100644 --- a/core/ui/UIEditBox/Mac/CCUIEditBoxMac.mm +++ b/core/ui/UIEditBox/Mac/CCUIEditBoxMac.mm @@ -248,19 +248,19 @@ self.dataInputMode = inputFlag; break; case axis::ui::EditBox::InputFlag::INITIAL_CAPS_WORD: - CCLOG("INITIAL_CAPS_WORD not implemented"); + AXLOG("INITIAL_CAPS_WORD not implemented"); break; case axis::ui::EditBox::InputFlag::INITIAL_CAPS_SENTENCE: - CCLOG("INITIAL_CAPS_SENTENCE not implemented"); + AXLOG("INITIAL_CAPS_SENTENCE not implemented"); break; case axis::ui::EditBox::InputFlag::INITIAL_CAPS_ALL_CHARACTERS: - CCLOG("INITIAL_CAPS_ALL_CHARACTERS not implemented"); + AXLOG("INITIAL_CAPS_ALL_CHARACTERS not implemented"); break; case axis::ui::EditBox::InputFlag::SENSITIVE: - CCLOG("SENSITIVE not implemented"); + AXLOG("SENSITIVE not implemented"); break; case axis::ui::EditBox::InputFlag::LOWERCASE_ALL_CHARACTERS: - CCLOG("LOWERCASE_ALL_CHARACTERS not implemented"); + AXLOG("LOWERCASE_ALL_CHARACTERS not implemented"); break; default: break; @@ -269,7 +269,7 @@ - (void)setReturnType:(axis::ui::EditBox::KeyboardReturnType)returnType { - CCLOG("setReturnType not implemented"); + AXLOG("setReturnType not implemented"); } - (void)setTextHorizontalAlignment:(axis::TextHAlignment)alignment diff --git a/core/ui/UIEditBox/UIEditBox.cpp b/core/ui/UIEditBox/UIEditBox.cpp index e24b8703dd..93ec6af703 100644 --- a/core/ui/UIEditBox/UIEditBox.cpp +++ b/core/ui/UIEditBox/UIEditBox.cpp @@ -45,8 +45,8 @@ EditBox::EditBox() EditBox::~EditBox() { - CC_SAFE_DELETE(_editBoxImpl); -#if CC_ENABLE_SCRIPT_BINDING + AX_SAFE_DELETE(_editBoxImpl); +#if AX_ENABLE_SCRIPT_BINDING unregisterScriptEditBoxHandler(); #endif } @@ -74,7 +74,7 @@ EditBox* EditBox::create(const Vec2& size, } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -92,7 +92,7 @@ EditBox* EditBox::create(const Vec2& size, } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } @@ -452,7 +452,7 @@ const char* EditBox::getText() const void EditBox::setFont(const char* pFontName, int fontSize) { - CCASSERT(pFontName != nullptr, "fontName can't be nullptr"); + AXASSERT(pFontName != nullptr, "fontName can't be nullptr"); if (pFontName != nullptr) { if (_editBoxImpl != nullptr) @@ -464,7 +464,7 @@ void EditBox::setFont(const char* pFontName, int fontSize) void EditBox::setFontName(const char* pFontName) { - CCASSERT(pFontName != nullptr, "fontName can't be nullptr"); + AXASSERT(pFontName != nullptr, "fontName can't be nullptr"); if (_editBoxImpl != nullptr) { _editBoxImpl->setFont(pFontName, _editBoxImpl->getFontSize()); @@ -520,7 +520,7 @@ const Color4B& EditBox::getFontColor() const void EditBox::setPlaceholderFont(const char* pFontName, int fontSize) { - CCASSERT(pFontName != nullptr, "fontName can't be nullptr"); + AXASSERT(pFontName != nullptr, "fontName can't be nullptr"); if (pFontName != nullptr) { if (_editBoxImpl != nullptr) @@ -532,7 +532,7 @@ void EditBox::setPlaceholderFont(const char* pFontName, int fontSize) void EditBox::setPlaceholderFontName(const char* pFontName) { - CCASSERT(pFontName != nullptr, "fontName can't be nullptr"); + AXASSERT(pFontName != nullptr, "fontName can't be nullptr"); if (_editBoxImpl != nullptr) { _editBoxImpl->setPlaceholderFont(pFontName, _editBoxImpl->getPlaceholderFontSize()); @@ -797,8 +797,8 @@ void EditBox::onEnter() { _editBoxImpl->onEnter(); } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) - this->schedule(CC_SCHEDULE_SELECTOR(EditBox::updatePosition), CHECK_EDITBOX_POSITION_INTERVAL); +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) + this->schedule(AX_SCHEDULE_SELECTOR(EditBox::updatePosition), CHECK_EDITBOX_POSITION_INTERVAL); #endif } @@ -829,7 +829,7 @@ static Rect getRect(Node* pNode) void EditBox::keyboardWillShow(IMEKeyboardNotificationInfo& info) { - // CCLOG("CCEditBox::keyboardWillShow"); + // AXLOG("CCEditBox::keyboardWillShow"); Rect rectTracked = getRect(this); // some adjustment for margin between the keyboard and the edit box. rectTracked.origin.y -= 4; @@ -837,13 +837,13 @@ void EditBox::keyboardWillShow(IMEKeyboardNotificationInfo& info) // if the keyboard area doesn't intersect with the tracking node area, nothing needs to be done. if (!rectTracked.intersectsRect(info.end)) { - CCLOG("needn't to adjust view layout."); + AXLOG("needn't to adjust view layout."); return; } // assume keyboard at the bottom of screen, calculate the vertical adjustment. _adjustHeight = info.end.getMaxY() - rectTracked.getMinY(); - // CCLOG("CCEditBox:needAdjustVerticalPosition(%f)", _adjustHeight); + // AXLOG("CCEditBox:needAdjustVerticalPosition(%f)", _adjustHeight); if (_editBoxImpl != nullptr) { @@ -855,7 +855,7 @@ void EditBox::keyboardDidShow(IMEKeyboardNotificationInfo& /*info*/) {} void EditBox::keyboardWillHide(IMEKeyboardNotificationInfo& info) { - // CCLOG("CCEditBox::keyboardWillHide"); + // AXLOG("CCEditBox::keyboardWillHide"); if (_editBoxImpl != nullptr) { _editBoxImpl->doAnimationWhenKeyboardMove(info.duration, -_adjustHeight); @@ -873,7 +873,7 @@ void EditBox::setGlobalZOrder(float globalZOrder) } } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING void EditBox::registerScriptEditBoxHandler(int handler) { unregisterScriptEditBoxHandler(); diff --git a/core/ui/UIEditBox/UIEditBox.h b/core/ui/UIEditBox/UIEditBox.h index 67aa27ec1e..37515e83d1 100644 --- a/core/ui/UIEditBox/UIEditBox.h +++ b/core/ui/UIEditBox/UIEditBox.h @@ -51,7 +51,7 @@ class EditBoxImpl; * @js NA * @lua NA */ -class CC_GUI_DLL EditBoxDelegate +class AX_GUI_DLL EditBoxDelegate { public: /** @@ -100,7 +100,7 @@ public: * You can use this widget to gather small amounts of text from the user. * */ -class CC_GUI_DLL EditBox : public Widget, public IMEDelegate +class AX_GUI_DLL EditBox : public Widget, public IMEDelegate { public: /** @@ -381,7 +381,7 @@ public: */ EditBoxDelegate* getDelegate(); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING /** * Registers a script function that will be called for EditBox events. * @@ -423,7 +423,7 @@ public: */ int getScriptEditBoxHandler() { return _scriptEditBoxHandler; } -#endif // #if CC_ENABLE_SCRIPT_BINDING +#endif // #if AX_ENABLE_SCRIPT_BINDING /** * Set the text entered in the edit box. @@ -706,7 +706,7 @@ protected: EditBoxDelegate* _delegate = nullptr; float _adjustHeight = 0.f; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING int _scriptEditBoxHandler = 0; #endif }; diff --git a/core/ui/UIEditBox/UIEditBoxImpl-android.cpp b/core/ui/UIEditBox/UIEditBoxImpl-android.cpp index b537baa5a7..38083277f5 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-android.cpp +++ b/core/ui/UIEditBox/UIEditBoxImpl-android.cpp @@ -28,7 +28,7 @@ #include "ui/UIEditBox/UIEditBoxImpl-android.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "ui/UIEditBox/UIEditBox.h" # include @@ -142,7 +142,7 @@ void EditBoxImplAndroid::setNativeFontColor(const Color4B& color) void EditBoxImplAndroid::setNativePlaceholderFont(const char* pFontName, int fontSize) { - CCLOG("Warning! You can't change Android Hint fontName and fontSize"); + AXLOG("Warning! You can't change Android Hint fontName and fontSize"); } void EditBoxImplAndroid::setNativePlaceholderFontColor(const Color4B& color) @@ -249,4 +249,4 @@ const char* EditBoxImplAndroid::getNativeDefaultFontName() NS_AX_END -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) */ +#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-android.h b/core/ui/UIEditBox/UIEditBoxImpl-android.h index 4ae9c8b3cc..562bd8fc4a 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-android.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-android.h @@ -29,7 +29,7 @@ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "ui/UIEditBox/UIEditBoxImpl-common.h" @@ -82,6 +82,6 @@ private: NS_AX_END -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) */ +#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) */ #endif /* __UIEDITBOXIMPLANDROID_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-common.cpp b/core/ui/UIEditBox/UIEditBoxImpl-common.cpp index c8203f4854..7b0c9c0c4c 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-common.cpp +++ b/core/ui/UIEditBox/UIEditBoxImpl-common.cpp @@ -33,9 +33,9 @@ #include "2d/CCLabel.h" #include "ui/UIHelper.h" -static const int CC_EDIT_BOX_PADDING = 5; +static const int AX_EDIT_BOX_PADDING = 5; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # define PASSWORD_CHAR "*" #else # define PASSWORD_CHAR "\u25CF" @@ -45,7 +45,7 @@ NS_AX_BEGIN static Vec2 applyPadding(const Vec2& sizeToCorrect) { - return Vec2(sizeToCorrect.width - CC_EDIT_BOX_PADDING * 2, sizeToCorrect.height); + return Vec2(sizeToCorrect.width - AX_EDIT_BOX_PADDING * 2, sizeToCorrect.height); } namespace ui @@ -116,20 +116,20 @@ void EditBoxImplCommon::placeInactiveLabels(const Vec2& size) if (_editBoxInputMode == EditBox::InputMode::ANY) { - _label->setPosition(Vec2((float)CC_EDIT_BOX_PADDING, size.height - CC_EDIT_BOX_PADDING)); + _label->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, size.height - AX_EDIT_BOX_PADDING)); _label->setVerticalAlignment(TextVAlignment::TOP); _label->enableWrap(true); - _labelPlaceHolder->setPosition(Vec2((float)CC_EDIT_BOX_PADDING, size.height - CC_EDIT_BOX_PADDING)); + _labelPlaceHolder->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, size.height - AX_EDIT_BOX_PADDING)); _labelPlaceHolder->setVerticalAlignment(TextVAlignment::TOP); } else { _label->enableWrap(false); - _label->setPosition(Vec2((float)CC_EDIT_BOX_PADDING, size.height)); + _label->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, size.height)); _label->setVerticalAlignment(TextVAlignment::CENTER); - _labelPlaceHolder->setPosition(Vec2((float)CC_EDIT_BOX_PADDING, (size.height + placeholderSize.height) / 2)); + _labelPlaceHolder->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, (size.height + placeholderSize.height) / 2)); _labelPlaceHolder->setVerticalAlignment(TextVAlignment::CENTER); } } @@ -295,7 +295,7 @@ void EditBoxImplCommon::setVisible(bool visible) void EditBoxImplCommon::setContentSize(const Vec2& size) { _contentSize = applyPadding(size); - CCLOG("[Edit text] content size = (%f, %f)", _contentSize.width, _contentSize.height); + AXLOG("[Edit text] content size = (%f, %f)", _contentSize.width, _contentSize.height); placeInactiveLabels(_contentSize); } @@ -364,7 +364,7 @@ void EditBoxImplCommon::editBoxEditingDidBegin() pDelegate->editBoxEditingDidBegin(_editBox); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING if (NULL != _editBox && 0 != _editBox->getScriptEditBoxHandler()) { axis::CommonScriptData data(_editBox->getScriptEditBoxHandler(), "began", _editBox); @@ -386,7 +386,7 @@ void EditBoxImplCommon::editBoxEditingDidEnd(std::string_view text, EditBoxDeleg pDelegate->editBoxReturn(_editBox); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING if (_editBox != nullptr && 0 != _editBox->getScriptEditBoxHandler()) { axis::CommonScriptData data(_editBox->getScriptEditBoxHandler(), "ended", _editBox); @@ -415,7 +415,7 @@ void EditBoxImplCommon::editBoxEditingChanged(std::string_view text) pDelegate->editBoxTextChanged(_editBox, text); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING if (NULL != _editBox && 0 != _editBox->getScriptEditBoxHandler()) { axis::CommonScriptData data(_editBox->getScriptEditBoxHandler(), "changed", _editBox); diff --git a/core/ui/UIEditBox/UIEditBoxImpl-common.h b/core/ui/UIEditBox/UIEditBoxImpl-common.h index 7831f886d1..942b5c0a24 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-common.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-common.h @@ -40,7 +40,7 @@ namespace ui class EditBox; -class CC_GUI_DLL EditBoxImplCommon : public EditBoxImpl +class AX_GUI_DLL EditBoxImplCommon : public EditBoxImpl { public: /** diff --git a/core/ui/UIEditBox/UIEditBoxImpl-ios.h b/core/ui/UIEditBox/UIEditBoxImpl-ios.h index a8d8869506..96717cf7d8 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-ios.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-ios.h @@ -27,7 +27,7 @@ #ifndef __UIEditBoxIMPLIOS_H__ #define __UIEditBoxIMPLIOS_H__ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # include "ui/UIEditBox/UIEditBoxImpl-common.h" @@ -87,6 +87,6 @@ private: NS_AX_END -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */ +#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) */ #endif /* __UIEditBoxIMPLIOS_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-ios.mm b/core/ui/UIEditBox/UIEditBoxImpl-ios.mm index d4ed934606..8f240c28f9 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-ios.mm +++ b/core/ui/UIEditBox/UIEditBoxImpl-ios.mm @@ -26,7 +26,7 @@ ****************************************************************************/ #include "ui/UIEditBox/UIEditBoxImpl-ios.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # define kLabelZOrder 9999 @@ -207,7 +207,7 @@ void EditBoxImplIOS::nativeCloseKeyboard() UIFont* EditBoxImplIOS::constructFont(const char* fontName, int fontSize) { - CCASSERT(fontName != nullptr, "fontName can't be nullptr"); + AXASSERT(fontName != nullptr, "fontName can't be nullptr"); CCEAGLView* eaglview = static_cast(axis::Director::getInstance()->getOpenGLView()->getEAGLView()); float retinaFactor = eaglview.contentScaleFactor; NSString* fntName = [NSString stringWithUTF8String:fontName]; @@ -245,4 +245,4 @@ UIFont* EditBoxImplIOS::constructFont(const char* fontName, int fontSize) NS_AX_END -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */ +#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-linux.cpp b/core/ui/UIEditBox/UIEditBoxImpl-linux.cpp index 15d1c30405..84feabfecb 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-linux.cpp +++ b/core/ui/UIEditBox/UIEditBoxImpl-linux.cpp @@ -26,7 +26,7 @@ #include "ui/UIEditBox/UIEditBoxImpl-linux.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) # include "ui/UIEditBox/UIEditBox.h" # include "2d/CCLabel.h" @@ -69,7 +69,7 @@ bool LinuxInputBox(std::string& entryLine) didChange = true; break; default: - // CCLOG("Undefined. Perhaps dialog was closed"); + // AXLOG("Undefined. Perhaps dialog was closed"); break; } @@ -112,4 +112,4 @@ void EditBoxImplLinux::nativeOpenKeyboard() NS_AX_END -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) */ +#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-linux.h b/core/ui/UIEditBox/UIEditBoxImpl-linux.h index 643c150321..b3dcb03c2f 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-linux.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-linux.h @@ -29,7 +29,7 @@ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) # include "ui/UIEditBox/UIEditBoxImpl-common.h" @@ -82,6 +82,6 @@ private: NS_AX_END -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) */ +#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) */ #endif /* __UIEDITBOXIMPLLINUX_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-mac.h b/core/ui/UIEditBox/UIEditBoxImpl-mac.h index fedcc8bed1..1fae64cc00 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-mac.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-mac.h @@ -29,7 +29,7 @@ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # include "ui/UIEditBox/UIEditBoxImpl-common.h" @@ -86,6 +86,6 @@ private: NS_AX_END -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) #endif /* __UIEditBoxIMPLMAC_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-mac.mm b/core/ui/UIEditBox/UIEditBoxImpl-mac.mm index b0731d5f1f..cee4c299d0 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-mac.mm +++ b/core/ui/UIEditBox/UIEditBoxImpl-mac.mm @@ -25,7 +25,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # include "ui/UIEditBox/UIEditBoxImpl-mac.h" # include "base/CCDirector.h" @@ -117,7 +117,7 @@ void EditBoxImplMac::setNativePlaceholderFont(const char* pFontName, int fontSiz if (!textFont) { - CCLOGWARN("Font not found: %s", pFontName); + AXLOGWARN("Font not found: %s", pFontName); return; } [_sysEdit setPlaceholderFont:textFont]; @@ -221,4 +221,4 @@ void EditBoxImplMac::nativeCloseKeyboard() NS_AX_END -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) diff --git a/core/ui/UIEditBox/UIEditBoxImpl-stub.cpp b/core/ui/UIEditBox/UIEditBoxImpl-stub.cpp index 5272d23752..f1ca12ca5d 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-stub.cpp +++ b/core/ui/UIEditBox/UIEditBoxImpl-stub.cpp @@ -24,8 +24,8 @@ #include "ui/UIEditBox/UIEditBox.h" -#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) && \ - (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) && (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) && \ + (AX_TARGET_PLATFORM != AX_PLATFORM_WIN32) && (AX_TARGET_PLATFORM != AX_PLATFORM_MAC) NS_AX_BEGIN diff --git a/core/ui/UIEditBox/UIEditBoxImpl-win32.cpp b/core/ui/UIEditBox/UIEditBoxImpl-win32.cpp index 8c83cdfa47..46d203c238 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-win32.cpp +++ b/core/ui/UIEditBox/UIEditBoxImpl-win32.cpp @@ -27,7 +27,7 @@ THE SOFTWARE. #include "ui/UIEditBox/UIEditBoxImpl-win32.h" #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "ui/UIEditBox/UIEditBox.h" # include @@ -376,7 +376,7 @@ std::string EditBoxImplWin::getText() const bool conversionResult = axis::StringUtils::UTF16ToUTF8(wstrResult, utf8Result); if (!conversionResult) { - CCLOG("warning, editbox input text conversion error."); + AXLOG("warning, editbox input text conversion error."); } return std::move(utf8Result); } @@ -438,4 +438,4 @@ LRESULT EditBoxImplWin::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l NS_AX_END -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-win32.h b/core/ui/UIEditBox/UIEditBoxImpl-win32.h index a7c502b17a..c58e7adb59 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-win32.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-win32.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "ui/UIEditBox/UIEditBoxImpl-common.h" NS_AX_BEGIN @@ -39,7 +39,7 @@ namespace ui class EditBox; -class CC_GUI_DLL EditBoxImplWin : public EditBoxImplCommon +class AX_GUI_DLL EditBoxImplWin : public EditBoxImplCommon { public: EditBoxImplWin(EditBox* pEditText); @@ -92,6 +92,6 @@ private: NS_AX_END -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ #endif /* __UIEditBoxIMPLWIN_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl.h b/core/ui/UIEditBox/UIEditBoxImpl.h index 1cfd169956..10daff1f82 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl.h +++ b/core/ui/UIEditBox/UIEditBoxImpl.h @@ -34,7 +34,7 @@ NS_AX_BEGIN namespace ui { -class CC_GUI_DLL EditBoxImpl +class AX_GUI_DLL EditBoxImpl { public: /** diff --git a/core/ui/UIEditBox/iOS/CCUIEditBoxIOS.mm b/core/ui/UIEditBox/iOS/CCUIEditBoxIOS.mm index 318ddc2f4f..fc1cf00165 100644 --- a/core/ui/UIEditBox/iOS/CCUIEditBoxIOS.mm +++ b/core/ui/UIEditBox/iOS/CCUIEditBoxIOS.mm @@ -371,7 +371,7 @@ - (BOOL)textViewShouldBeginEditing:(UITextView*)textView { - CCLOG("textFieldShouldBeginEditing..."); + AXLOG("textFieldShouldBeginEditing..."); _editState = YES; _returnPressed = NO; @@ -389,7 +389,7 @@ - (BOOL)textViewShouldEndEditing:(UITextView*)textView { - CCLOG("textFieldShouldEndEditing..."); + AXLOG("textFieldShouldEndEditing..."); _editState = NO; getEditBoxImplIOS()->refreshInactiveText(); @@ -464,7 +464,7 @@ - (BOOL)textFieldShouldBeginEditing:(UITextField*)sender // return NO to disallow editing. { - CCLOG("textFieldShouldBeginEditing..."); + AXLOG("textFieldShouldBeginEditing..."); _editState = YES; _returnPressed = NO; @@ -482,7 +482,7 @@ - (BOOL)textFieldShouldEndEditing:(UITextField*)sender { - CCLOG("textFieldShouldEndEditing..."); + AXLOG("textFieldShouldEndEditing..."); _editState = NO; const char* inputText = [sender.text UTF8String]; diff --git a/core/ui/UIEditBox/iOS/CCUIMultilineTextField.mm b/core/ui/UIEditBox/iOS/CCUIMultilineTextField.mm index 3cfb050f60..b08185cf68 100644 --- a/core/ui/UIEditBox/iOS/CCUIMultilineTextField.mm +++ b/core/ui/UIEditBox/iOS/CCUIMultilineTextField.mm @@ -85,7 +85,7 @@ CGFloat const UI_PLACEHOLDER_TEXT_CHANGED_ANIMATION_DURATION = 0.25; if (_placeHolderLabel == nil) { auto glview = axis::Director::getInstance()->getOpenGLView(); - float padding = CC_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); + float padding = AX_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); _placeHolderLabel = [[UILabel alloc] initWithFrame:CGRectMake(padding, padding, self.bounds.size.width - padding * 2, 0)]; @@ -108,7 +108,7 @@ CGFloat const UI_PLACEHOLDER_TEXT_CHANGED_ANIMATION_DURATION = 0.25; { auto glview = axis::Director::getInstance()->getOpenGLView(); - float padding = CC_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); + float padding = AX_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); return CGRectInset(bounds, padding, padding); } diff --git a/core/ui/UIEditBox/iOS/CCUISingleLineTextField.mm b/core/ui/UIEditBox/iOS/CCUISingleLineTextField.mm index 4f59d8e786..aae6d137c4 100644 --- a/core/ui/UIEditBox/iOS/CCUISingleLineTextField.mm +++ b/core/ui/UIEditBox/iOS/CCUISingleLineTextField.mm @@ -78,7 +78,7 @@ { auto glview = axis::Director::getInstance()->getOpenGLView(); - float padding = CC_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); + float padding = AX_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); return CGRectInset(bounds, padding, padding); } diff --git a/core/ui/UIEditBox/iOS/CCUITextInput.h b/core/ui/UIEditBox/iOS/CCUITextInput.h index 9706ad5741..3a493c3cde 100644 --- a/core/ui/UIEditBox/iOS/CCUITextInput.h +++ b/core/ui/UIEditBox/iOS/CCUITextInput.h @@ -26,7 +26,7 @@ #ifndef cocos2d_libs_CCUITextInput_h #define cocos2d_libs_CCUITextInput_h -static const int CC_EDIT_BOX_PADDING = 5; +static const int AX_EDIT_BOX_PADDING = 5; /** This protocol provides a common interface for consolidating text input method calls diff --git a/core/ui/UIHBox.cpp b/core/ui/UIHBox.cpp index f68c375bb3..afbc15c87c 100644 --- a/core/ui/UIHBox.cpp +++ b/core/ui/UIHBox.cpp @@ -42,7 +42,7 @@ HBox* HBox::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -54,7 +54,7 @@ HBox* HBox::create(const Vec2& size) widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIHBox.h b/core/ui/UIHBox.h index 4ee6b1b014..c5fbe7a9e5 100644 --- a/core/ui/UIHBox.h +++ b/core/ui/UIHBox.h @@ -42,7 +42,7 @@ namespace ui * HBox is just a convenient wrapper class for horizontal layout type. * HBox lays out its children in a single horizontal row. */ -class CC_GUI_DLL HBox : public Layout +class AX_GUI_DLL HBox : public Layout { public: /** diff --git a/core/ui/UIHelper.cpp b/core/ui/UIHelper.cpp index 5bfe2d507d..008506fdc8 100644 --- a/core/ui/UIHelper.cpp +++ b/core/ui/UIHelper.cpp @@ -123,18 +123,18 @@ std::string Helper::getSubStringOfUTF8String(std::string_view str, std::u32string utf32; if (!StringUtils::UTF8ToUTF32(str, utf32)) { - CCLOGERROR("Can't convert string to UTF-32: %s", str.data()); + AXLOGERROR("Can't convert string to UTF-32: %s", str.data()); return ""; } if (utf32.size() < start) { - CCLOGERROR("'start' is out of range: %d, %s", static_cast(start), str.data()); + AXLOGERROR("'start' is out of range: %d, %s", static_cast(start), str.data()); return ""; } std::string result; if (!StringUtils::UTF32ToUTF8(utf32.substr(start, length), result)) { - CCLOGERROR("Can't convert internal UTF-32 string to UTF-8: %s", str.data()); + AXLOGERROR("Can't convert internal UTF-32 string to UTF-8: %s", str.data()); return ""; } return result; diff --git a/core/ui/UIHelper.h b/core/ui/UIHelper.h index c90493b93e..2516d2481e 100644 --- a/core/ui/UIHelper.h +++ b/core/ui/UIHelper.h @@ -46,7 +46,7 @@ class Widget; * Helper class for traversing children in widget tree. * It also provides some helper functions for layout. */ -class CC_GUI_DLL Helper +class AX_GUI_DLL Helper { public: /** diff --git a/core/ui/UIImageView.cpp b/core/ui/UIImageView.cpp index fb3cbaad0a..e74049d803 100644 --- a/core/ui/UIImageView.cpp +++ b/core/ui/UIImageView.cpp @@ -58,7 +58,7 @@ ImageView* ImageView::create(std::string_view imageFileName, TextureResType texT widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -70,7 +70,7 @@ ImageView* ImageView::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -170,7 +170,7 @@ void ImageView::setTextureRect(const Rect& rect) } else { - CCLOG("Warning!! you should load texture before set the texture's rect!"); + AXLOG("Warning!! you should load texture before set the texture's rect!"); } } } diff --git a/core/ui/UIImageView.h b/core/ui/UIImageView.h index cd7049a3b0..61a31f474c 100644 --- a/core/ui/UIImageView.h +++ b/core/ui/UIImageView.h @@ -35,7 +35,7 @@ THE SOFTWARE. */ NS_AX_BEGIN -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -43,7 +43,7 @@ class Scale9Sprite; /** * @brief A widget to display images. */ -class CC_GUI_DLL ImageView : public Widget, public axis::BlendProtocol +class AX_GUI_DLL ImageView : public Widget, public axis::BlendProtocol { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UILayout.cpp b/core/ui/UILayout.cpp index d71c364f39..d5c98781b5 100644 --- a/core/ui/UILayout.cpp +++ b/core/ui/UILayout.cpp @@ -84,8 +84,8 @@ Layout::Layout() Layout::~Layout() { - CC_SAFE_RELEASE(_clippingStencil); - CC_SAFE_DELETE(_stencilStateManager); + AX_SAFE_RELEASE(_clippingStencil); + AX_SAFE_DELETE(_stencilStateManager); } void Layout::onEnter() @@ -128,7 +128,7 @@ Layout* Layout::create() layout->autorelease(); return layout; } - CC_SAFE_DELETE(layout); + AX_SAFE_DELETE(layout); return nullptr; } @@ -139,7 +139,7 @@ bool Layout::init() ignoreContentAdaptWithSize(false); setContentSize(Vec2::ZERO); setAnchorPoint(Vec2::ZERO); - onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); return true; } return false; @@ -254,7 +254,7 @@ void Layout::stencilClippingVisit(Renderer* renderer, const Mat4& parentTransfor renderer->pushGroup(_groupCommand.getRenderQueueID()); // _beforeVisitCmdStencil.init(_globalZOrder); - // _beforeVisitCmdStencil.func = CC_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilStateManager); + // _beforeVisitCmdStencil.func = AX_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilStateManager); // renderer->addCommand(&_beforeVisitCmdStencil); _stencilStateManager->onBeforeVisit(_globalZOrder); @@ -262,7 +262,7 @@ void Layout::stencilClippingVisit(Renderer* renderer, const Mat4& parentTransfor 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); int i = 0; // used by _children @@ -310,7 +310,7 @@ void Layout::stencilClippingVisit(Renderer* renderer, const Mat4& parentTransfor auto afterVisitCmdStencil = renderer->nextCallbackCommand(); afterVisitCmdStencil->init(_globalZOrder); - afterVisitCmdStencil->func = CC_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager); + afterVisitCmdStencil->func = AX_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager); renderer->addCommand(afterVisitCmdStencil); renderer->popGroup(); @@ -375,14 +375,14 @@ void Layout::scissorClippingVisit(Renderer* renderer, const Mat4& parentTransfor auto beforeVisitCmdScissor = renderer->nextCallbackCommand(); beforeVisitCmdScissor->init(_globalZOrder); - beforeVisitCmdScissor->func = CC_CALLBACK_0(Layout::onBeforeVisitScissor, this); + beforeVisitCmdScissor->func = AX_CALLBACK_0(Layout::onBeforeVisitScissor, this); renderer->addCommand(beforeVisitCmdScissor); ProtectedNode::visit(renderer, parentTransform, parentFlags); auto afterVisitCmdScissor = renderer->nextCallbackCommand(); afterVisitCmdScissor->init(_globalZOrder); - afterVisitCmdScissor->func = CC_CALLBACK_0(Layout::onAfterVisitScissor, this); + afterVisitCmdScissor->func = AX_CALLBACK_0(Layout::onAfterVisitScissor, this); renderer->addCommand(afterVisitCmdScissor); renderer->popGroup(); @@ -1065,7 +1065,7 @@ Vec2 Layout::getWorldCenterPoint(Widget* widget) const Layout* layout = dynamic_cast(widget); // FIXEDME: we don't need to calculate the content size of layout anymore Vec2 widgetSize = layout ? layout->getLayoutAccumulatedSize() : widget->getContentSize(); - // CCLOG("content size : width = %f, height = %f", widgetSize.width, widgetSize.height); + // AXLOG("content size : width = %f, height = %f", widgetSize.width, widgetSize.height); return widget->convertToWorldSpace(Vec2(widgetSize.width / 2, widgetSize.height / 2)); } @@ -1154,7 +1154,7 @@ int Layout::findFirstFocusEnabledWidgetIndex() } index++; } - CCASSERT(0, "invalid operation"); + AXASSERT(0, "invalid operation"); return 0; } @@ -1201,7 +1201,7 @@ int Layout::findNearestChildWidgetIndex(FocusDirection direction, Widget* baseWi return found; } - CCASSERT(0, "invalid focus direction!!!"); + AXASSERT(0, "invalid focus direction!!!"); return 0; } @@ -1248,7 +1248,7 @@ int Layout::findFarthestChildWidgetIndex(FocusDirection direction, axis::ui::Wid return found; } - CCASSERT(0, "invalid focus direction!!!"); + AXASSERT(0, "invalid focus direction!!!"); return 0; } @@ -1312,49 +1312,49 @@ void Layout::findProperSearchingFunctor(FocusDirection dir, Widget* baseWidget) { if (previousWidgetPosition.x > widgetPosition.x) { - onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); } else { - onPassFocusToChild = CC_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); } } else if (dir == FocusDirection::RIGHT) { if (previousWidgetPosition.x > widgetPosition.x) { - onPassFocusToChild = CC_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); } else { - onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); } } else if (dir == FocusDirection::DOWN) { if (previousWidgetPosition.y > widgetPosition.y) { - onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); } else { - onPassFocusToChild = CC_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); } } else if (dir == FocusDirection::UP) { if (previousWidgetPosition.y < widgetPosition.y) { - onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); } else { - onPassFocusToChild = CC_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); } } else { - CCASSERT(0, "invalid direction!"); + AXASSERT(0, "invalid direction!"); } } @@ -1708,7 +1708,7 @@ bool Layout::isLastWidgetInContainer(Widget* widget, FocusDirection direction) c } else { - CCASSERT(0, "invalid layout Type"); + AXASSERT(0, "invalid layout Type"); return false; } @@ -1749,7 +1749,7 @@ bool Layout::isWidgetAncestorSupportLoopFocus(Widget* widget, FocusDirection dir } else { - CCASSERT(0, "invalid layout type"); + AXASSERT(0, "invalid layout type"); return false; } } @@ -1822,7 +1822,7 @@ Widget* Layout::findNextFocusedWidget(FocusDirection direction, Widget* current) break; default: { - CCASSERT(0, "Invalid Focus Direction"); + AXASSERT(0, "Invalid Focus Direction"); return current; } break; @@ -1861,7 +1861,7 @@ Widget* Layout::findNextFocusedWidget(FocusDirection direction, Widget* current) break; default: { - CCASSERT(0, "Invalid Focus Direction"); + AXASSERT(0, "Invalid Focus Direction"); return current; } break; @@ -1869,7 +1869,7 @@ Widget* Layout::findNextFocusedWidget(FocusDirection direction, Widget* current) } else { - CCASSERT(0, "Un Supported Layout type, please use VBox and HBox instead!!!"); + AXASSERT(0, "Un Supported Layout type, please use VBox and HBox instead!!!"); return current; } } diff --git a/core/ui/UILayout.h b/core/ui/UILayout.h index 00533ffb52..78d2ddd714 100644 --- a/core/ui/UILayout.h +++ b/core/ui/UILayout.h @@ -43,7 +43,7 @@ class DrawNode; class LayerColor; class LayerGradient; class StencilStateManager; -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -55,7 +55,7 @@ class Scale9Sprite; *@brief Layout interface for creating LayoutManger and do actual layout. * @js NA */ -class CC_GUI_DLL LayoutProtocol +class AX_GUI_DLL LayoutProtocol { public: /** @@ -109,7 +109,7 @@ public: * - Relative layout: child elements are arranged relative to certain rules. * */ -class CC_GUI_DLL Layout : public Widget, public LayoutProtocol +class AX_GUI_DLL Layout : public Widget, public LayoutProtocol { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UILayoutComponent.cpp b/core/ui/UILayoutComponent.cpp index a6755c7578..b47f938623 100644 --- a/core/ui/UILayoutComponent.cpp +++ b/core/ui/UILayoutComponent.cpp @@ -71,7 +71,7 @@ LayoutComponent* LayoutComponent::bindLayoutComponent(Node* node) node->addComponent(layout); return layout; } - CC_SAFE_DELETE(layout); + AX_SAFE_DELETE(layout); return nullptr; } diff --git a/core/ui/UILayoutComponent.h b/core/ui/UILayoutComponent.h index 1300b22926..0bb2651ebf 100644 --- a/core/ui/UILayoutComponent.h +++ b/core/ui/UILayoutComponent.h @@ -41,7 +41,7 @@ namespace ui *@brief A component class used for layout. * The LayoutComponent holds all the data for layouting. */ -class CC_GUI_DLL LayoutComponent : public Component +class AX_GUI_DLL LayoutComponent : public Component { public: /** diff --git a/core/ui/UILayoutManager.h b/core/ui/UILayoutManager.h index f67331781e..7162241b97 100644 --- a/core/ui/UILayoutManager.h +++ b/core/ui/UILayoutManager.h @@ -47,7 +47,7 @@ class RelativeLayoutParameter; *@brief Base class for managing layout. * All the concrete layout manager should inherit from this class. */ -class CC_GUI_DLL LayoutManager : public Ref +class AX_GUI_DLL LayoutManager : public Ref { public: virtual ~LayoutManager(){}; @@ -67,7 +67,7 @@ public: * @lua NA * @js NA */ -class CC_GUI_DLL LinearVerticalLayoutManager : public LayoutManager +class AX_GUI_DLL LinearVerticalLayoutManager : public LayoutManager { private: LinearVerticalLayoutManager(){}; @@ -84,7 +84,7 @@ private: * @lua NA * @js NA */ -class CC_GUI_DLL LinearHorizontalLayoutManager : public LayoutManager +class AX_GUI_DLL LinearHorizontalLayoutManager : public LayoutManager { private: LinearHorizontalLayoutManager(){}; @@ -101,7 +101,7 @@ private: * @lua NA * @js NA */ -class CC_GUI_DLL LinearCenterVerticalLayoutManager : public LayoutManager +class AX_GUI_DLL LinearCenterVerticalLayoutManager : public LayoutManager { private: LinearCenterVerticalLayoutManager(){}; @@ -118,7 +118,7 @@ private: * @lua NA * @js NA */ -class CC_GUI_DLL RelativeLayoutManager : public LayoutManager +class AX_GUI_DLL RelativeLayoutManager : public LayoutManager { private: RelativeLayoutManager() diff --git a/core/ui/UILayoutParameter.h b/core/ui/UILayoutParameter.h index b16ca4c585..f193ab3095 100644 --- a/core/ui/UILayoutParameter.h +++ b/core/ui/UILayoutParameter.h @@ -43,7 +43,7 @@ namespace ui *@brief Margin of widget's in point. Margin value should be positive. *@lua NA */ -class CC_GUI_DLL Margin +class AX_GUI_DLL Margin { public: /** @@ -113,7 +113,7 @@ public: /** *@brief Base class for various LayoutParameter. */ -class CC_GUI_DLL LayoutParameter : public Ref +class AX_GUI_DLL LayoutParameter : public Ref { public: /** @@ -198,7 +198,7 @@ protected: * Protocol for getting a LayoutParameter. * Every element want to have layout parameter should inherit from this class. */ -class CC_GUI_DLL LayoutParameterProtocol +class AX_GUI_DLL LayoutParameterProtocol { public: /** @@ -217,7 +217,7 @@ public: * @brief Linear layout parameter. * It is used by linear layout manager for arranging elements linearly. */ -class CC_GUI_DLL LinearLayoutParameter : public LayoutParameter +class AX_GUI_DLL LinearLayoutParameter : public LayoutParameter { public: /** @@ -283,7 +283,7 @@ protected: * @brief Relative layout parameter. * It is mainly used by `RelativeLayoutManager`. */ -class CC_GUI_DLL RelativeLayoutParameter : public LayoutParameter +class AX_GUI_DLL RelativeLayoutParameter : public LayoutParameter { public: /** diff --git a/core/ui/UIListView.cpp b/core/ui/UIListView.cpp index e8dc2f3ee4..f693b587ce 100644 --- a/core/ui/UIListView.cpp +++ b/core/ui/UIListView.cpp @@ -56,7 +56,7 @@ ListView::ListView() ListView::~ListView() { _items.clear(); - CC_SAFE_RELEASE(_model); + AX_SAFE_RELEASE(_model); } ListView* ListView::create() @@ -67,7 +67,7 @@ ListView* ListView::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -85,12 +85,12 @@ void ListView::setItemModel(Widget* model) { if (nullptr == model) { - CCLOG("Can't set a nullptr to item model!"); + AXLOG("Can't set a nullptr to item model!"); return; } - CC_SAFE_RELEASE_NULL(_model); + AX_SAFE_RELEASE_NULL(_model); _model = model; - CC_SAFE_RETAIN(_model); + AX_SAFE_RETAIN(_model); } void ListView::handleReleaseLogic(Touch* touch) @@ -145,7 +145,7 @@ void ListView::updateInnerContainerSize() void ListView::remedyVerticalLayoutParameter(LinearLayoutParameter* layoutParameter, ssize_t itemIndex) { - CCASSERT(nullptr != layoutParameter, "Layout parameter can't be nullptr!"); + AXASSERT(nullptr != layoutParameter, "Layout parameter can't be nullptr!"); switch (_gravity) { @@ -178,7 +178,7 @@ void ListView::remedyVerticalLayoutParameter(LinearLayoutParameter* layoutParame void ListView::remedyHorizontalLayoutParameter(LinearLayoutParameter* layoutParameter, ssize_t itemIndex) { - CCASSERT(nullptr != layoutParameter, "Layout parameter can't be nullptr!"); + AXASSERT(nullptr != layoutParameter, "Layout parameter can't be nullptr!"); switch (_gravity) { @@ -210,7 +210,7 @@ void ListView::remedyHorizontalLayoutParameter(LinearLayoutParameter* layoutPara void ListView::remedyLayoutParameter(Widget* item) { - CCASSERT(nullptr != item, "ListView Item can't be nullptr!"); + AXASSERT(nullptr != item, "ListView Item can't be nullptr!"); LinearLayoutParameter* linearLayoutParameter = (LinearLayoutParameter*)(item->getLayoutParameter()); bool isLayoutParameterExists = true; @@ -657,7 +657,7 @@ static Widget* findClosestItem(const Vec2& targetPosition, ssize_t lastIndex, float distanceFromLast) { - CCASSERT(firstIndex >= 0 && lastIndex < items.size() && firstIndex <= lastIndex, ""); + AXASSERT(firstIndex >= 0 && lastIndex < items.size() && firstIndex <= lastIndex, ""); if (firstIndex == lastIndex) { return items.at(firstIndex); diff --git a/core/ui/UIListView.h b/core/ui/UIListView.h index f81d887308..cacf2ad644 100644 --- a/core/ui/UIListView.h +++ b/core/ui/UIListView.h @@ -45,7 +45,7 @@ namespace ui *to be displayed, use `TableView` instead. ListView is a subclass of `ScrollView`, so it shares many features of *ScrollView. */ -class CC_GUI_DLL ListView : public ScrollView +class AX_GUI_DLL ListView : public ScrollView { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UILoadingBar.cpp b/core/ui/UILoadingBar.cpp index a0e28e0678..5e8584aaa9 100644 --- a/core/ui/UILoadingBar.cpp +++ b/core/ui/UILoadingBar.cpp @@ -67,7 +67,7 @@ LoadingBar* LoadingBar::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -86,7 +86,7 @@ LoadingBar* LoadingBar::create(std::string_view textureName, TextureResType texT widget->setPercent(percentage); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UILoadingBar.h b/core/ui/UILoadingBar.h index 531454f12f..acfce004d2 100644 --- a/core/ui/UILoadingBar.h +++ b/core/ui/UILoadingBar.h @@ -35,7 +35,7 @@ NS_AX_BEGIN * @{ */ -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -46,7 +46,7 @@ class Scale9Sprite; * Displays a bar to the user representing how far the operation has progressed. * */ -class CC_GUI_DLL LoadingBar : public Widget +class AX_GUI_DLL LoadingBar : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UIPageView.cpp b/core/ui/UIPageView.cpp index 02b2a8355a..ec9b724dd6 100644 --- a/core/ui/UIPageView.cpp +++ b/core/ui/UIPageView.cpp @@ -54,7 +54,7 @@ PageView* PageView::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -377,7 +377,7 @@ void PageView::setIndicatorPosition(const Vec2& position) const Vec2& PageView::getIndicatorPosition() const { - CCASSERT(_indicator != nullptr, ""); + AXASSERT(_indicator != nullptr, ""); return _indicator->getPosition(); } @@ -390,7 +390,7 @@ void PageView::setIndicatorSpaceBetweenIndexNodes(float spaceBetweenIndexNodes) } float PageView::getIndicatorSpaceBetweenIndexNodes() const { - CCASSERT(_indicator != nullptr, ""); + AXASSERT(_indicator != nullptr, ""); return _indicator->getSpaceBetweenIndexNodes(); } @@ -404,7 +404,7 @@ void PageView::setIndicatorSelectedIndexColor(const Color3B& color) const Color3B& PageView::getIndicatorSelectedIndexColor() const { - CCASSERT(_indicator != nullptr, ""); + AXASSERT(_indicator != nullptr, ""); return _indicator->getSelectedIndexColor(); } @@ -418,7 +418,7 @@ void PageView::setIndicatorIndexNodesColor(const Color3B& color) const Color3B& PageView::getIndicatorIndexNodesColor() const { - CCASSERT(_indicator != nullptr, ""); + AXASSERT(_indicator != nullptr, ""); return _indicator->getIndexNodesColor(); } @@ -432,7 +432,7 @@ void PageView::setIndicatorSelectedIndexOpacity(uint8_t opacity) uint8_t PageView::getIndicatorSelectedIndexOpacity() const { - CCASSERT(_indicator != nullptr, ""); + AXASSERT(_indicator != nullptr, ""); return _indicator->getSelectedIndexOpacity(); } @@ -446,7 +446,7 @@ void PageView::setIndicatorIndexNodesOpacity(uint8_t opacity) uint8_t PageView::getIndicatorIndexNodesOpacity() const { - CCASSERT(_indicator != nullptr, ""); + AXASSERT(_indicator != nullptr, ""); return _indicator->getIndexNodesOpacity(); } @@ -461,7 +461,7 @@ void PageView::setIndicatorIndexNodesScale(float indexNodesScale) float PageView::getIndicatorIndexNodesScale() const { - CCASSERT(_indicator != nullptr, ""); + AXASSERT(_indicator != nullptr, ""); return _indicator->getIndexNodesScale(); } diff --git a/core/ui/UIPageView.h b/core/ui/UIPageView.h index 627b966ce5..e5947db2c0 100644 --- a/core/ui/UIPageView.h +++ b/core/ui/UIPageView.h @@ -44,7 +44,7 @@ class PageViewIndicator; *@brief Layout manager that allows the user to flip left & right and up & down through pages of data. * */ -class CC_GUI_DLL PageView : public ListView +class AX_GUI_DLL PageView : public ListView { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UIPageViewIndicator.cpp b/core/ui/UIPageViewIndicator.cpp index 5c1a44b98c..a22a3ec572 100644 --- a/core/ui/UIPageViewIndicator.cpp +++ b/core/ui/UIPageViewIndicator.cpp @@ -54,7 +54,7 @@ PageViewIndicator* PageViewIndicator::create() node->autorelease(); return node; } - CC_SAFE_DELETE(node); + AX_SAFE_DELETE(node); return nullptr; } diff --git a/core/ui/UIRadioButton.cpp b/core/ui/UIRadioButton.cpp index e1c620c7c4..cf8deea147 100644 --- a/core/ui/UIRadioButton.cpp +++ b/core/ui/UIRadioButton.cpp @@ -48,7 +48,7 @@ RadioButton* RadioButton::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -65,7 +65,7 @@ RadioButton* RadioButton::create(std::string_view backGround, pWidget->autorelease(); return pWidget; } - CC_SAFE_DELETE(pWidget); + AX_SAFE_DELETE(pWidget); return nullptr; } @@ -77,7 +77,7 @@ RadioButton* RadioButton::create(std::string_view backGround, std::string_view c pWidget->autorelease(); return pWidget; } - CC_SAFE_DELETE(pWidget); + AX_SAFE_DELETE(pWidget); return nullptr; } @@ -158,7 +158,7 @@ RadioButtonGroup* RadioButtonGroup::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -171,7 +171,7 @@ void RadioButtonGroup::addRadioButton(RadioButton* radioButton) { if (radioButton != nullptr) { - CCASSERT(!radioButton->_group, "It already belongs to a group!"); + AXASSERT(!radioButton->_group, "It already belongs to a group!"); radioButton->_group = this; _radioButtons.pushBack(radioButton); @@ -185,9 +185,9 @@ void RadioButtonGroup::addRadioButton(RadioButton* radioButton) void RadioButtonGroup::removeRadioButton(RadioButton* radioButton) { ssize_t index = _radioButtons.getIndex(radioButton); - if (index == CC_INVALID_INDEX) + if (index == AX_INVALID_INDEX) { - CCLOGERROR("The radio button does not belong to this group!"); + AXLOGERROR("The radio button does not belong to this group!"); return; } @@ -224,7 +224,7 @@ RadioButton* RadioButtonGroup::getRadioButtonByIndex(int index) const { if (index >= _radioButtons.size()) { - CCLOGERROR("Out of array index! length=%d, requestedIndex=%d", (int)_radioButtons.size(), index); + AXLOGERROR("Out of array index! length=%d, requestedIndex=%d", (int)_radioButtons.size(), index); return nullptr; } return _radioButtons.at(index); @@ -247,7 +247,7 @@ int RadioButtonGroup::getSelectedButtonIndex() const void RadioButtonGroup::setSelectedButton(int index) { - CCASSERT(index < _radioButtons.size(), "Out of array index!"); + AXASSERT(index < _radioButtons.size(), "Out of array index!"); setSelectedButton(_radioButtons.at(index)); } @@ -274,7 +274,7 @@ void RadioButtonGroup::setSelectedButtonWithoutEvent(RadioButton* radioButton) } if (radioButton != nullptr && !_radioButtons.contains(radioButton)) { - CCLOGERROR("The radio button does not belong to this group!"); + AXLOGERROR("The radio button does not belong to this group!"); return; } diff --git a/core/ui/UIRadioButton.h b/core/ui/UIRadioButton.h index af832a3622..58a00a9012 100644 --- a/core/ui/UIRadioButton.h +++ b/core/ui/UIRadioButton.h @@ -44,7 +44,7 @@ class RadioButtonGroup; * RadioButton is a specific type of two-states button that is similar to CheckBox. * Additionally, it can be used together with RadioButtonGroup to interact with other radio buttons. */ -class CC_GUI_DLL RadioButton : public AbstractCheckButton +class AX_GUI_DLL RadioButton : public AbstractCheckButton { DECLARE_CLASS_GUI_INFO @@ -141,7 +141,7 @@ protected: * RadioButtonGroup groups designated radio buttons to make them interact to each other. * In one RadioButtonGroup, only one or no RadioButton can be checked. */ -class CC_GUI_DLL RadioButtonGroup : public Widget +class AX_GUI_DLL RadioButtonGroup : public Widget { friend class RadioButton; diff --git a/core/ui/UIRelativeBox.cpp b/core/ui/UIRelativeBox.cpp index f99df58f3e..e5be927d6f 100644 --- a/core/ui/UIRelativeBox.cpp +++ b/core/ui/UIRelativeBox.cpp @@ -42,7 +42,7 @@ RelativeBox* RelativeBox::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -54,7 +54,7 @@ RelativeBox* RelativeBox::create(const Vec2& size) widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIRelativeBox.h b/core/ui/UIRelativeBox.h index 1fef1d4a05..1989cd5bbf 100644 --- a/core/ui/UIRelativeBox.h +++ b/core/ui/UIRelativeBox.h @@ -43,7 +43,7 @@ namespace ui *@brief RelativeBox is just a convenient wrapper class for relative layout type. * RelativeBox lays out its children relative to a widget or a position. */ -class CC_GUI_DLL RelativeBox : public Layout +class AX_GUI_DLL RelativeBox : public Layout { public: diff --git a/core/ui/UIRichText.cpp b/core/ui/UIRichText.cpp index ad03db9bc0..3dcce7dbdc 100644 --- a/core/ui/UIRichText.cpp +++ b/core/ui/UIRichText.cpp @@ -66,7 +66,7 @@ public: setName(ListenerComponent::COMPONENT_NAME); _touchListener = axis::EventListenerTouchAllAtOnce::create(); - _touchListener->onTouchesEnded = CC_CALLBACK_2(ListenerComponent::onTouchesEnded, this); + _touchListener->onTouchesEnded = AX_CALLBACK_2(ListenerComponent::onTouchesEnded, this); Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(_touchListener, _parent); _touchListener->retain(); @@ -144,7 +144,7 @@ RichElementText* RichElementText::create(int tag, element->autorelease(); return element; } - CC_SAFE_DELETE(element); + AX_SAFE_DELETE(element); return nullptr; } @@ -194,7 +194,7 @@ RichElementImage* RichElementImage::create(int tag, element->autorelease(); return element; } - CC_SAFE_DELETE(element); + AX_SAFE_DELETE(element); return nullptr; } @@ -243,7 +243,7 @@ RichElementCustomNode* RichElementCustomNode::create(int tag, element->autorelease(); return element; } - CC_SAFE_DELETE(element); + AX_SAFE_DELETE(element); return nullptr; } @@ -266,7 +266,7 @@ RichElementNewLine* RichElementNewLine::create(int tag, const Color3B& color, ui element->autorelease(); return element; } - CC_SAFE_DELETE(element); + AX_SAFE_DELETE(element); return nullptr; } @@ -1006,7 +1006,7 @@ RichText* RichText::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -1018,7 +1018,7 @@ RichText* RichText::createWithXML(std::string_view xml, const ValueMap& defaults widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -2042,7 +2042,7 @@ float getPaddingAmount(const RichText::HorizontalAlignment alignment, const floa case RichText::HorizontalAlignment::RIGHT: return leftOver; default: - CCASSERT(false, "invalid horizontal alignment!"); + AXASSERT(false, "invalid horizontal alignment!"); return 0.f; } } diff --git a/core/ui/UIRichText.h b/core/ui/UIRichText.h index eec6903ccd..f001f888ed 100644 --- a/core/ui/UIRichText.h +++ b/core/ui/UIRichText.h @@ -45,7 +45,7 @@ namespace ui *@brief Rich text element base class. * It defines the basic common properties for all rich text element. */ -class CC_GUI_DLL RichElement : public Ref +class AX_GUI_DLL RichElement : public Ref { public: /** @@ -97,7 +97,7 @@ protected: /** *@brief Rich element for displaying text. */ -class CC_GUI_DLL RichElementText : public RichElement +class AX_GUI_DLL RichElementText : public RichElement { public: /** @@ -212,7 +212,7 @@ protected: /** *@brief Rich element for displaying images. */ -class CC_GUI_DLL RichElementImage : public RichElement +class AX_GUI_DLL RichElementImage : public RichElement { public: /** @@ -283,7 +283,7 @@ protected: /** *@brief Rich element for displaying custom node type. */ -class CC_GUI_DLL RichElementCustomNode : public RichElement +class AX_GUI_DLL RichElementCustomNode : public RichElement { public: /** @@ -298,7 +298,7 @@ public: * @js NA * @lua NA */ - virtual ~RichElementCustomNode() { CC_SAFE_RELEASE(_customNode); }; + virtual ~RichElementCustomNode() { AX_SAFE_RELEASE(_customNode); }; /** * @brief Initialize a RichElementCustomNode with various arguments. @@ -330,7 +330,7 @@ protected: /** *@brief Rich element for new line. */ -class CC_GUI_DLL RichElementNewLine : public RichElement +class AX_GUI_DLL RichElementNewLine : public RichElement { public: /** @@ -366,7 +366,7 @@ protected: *@brief A container for displaying various RichElements. * We could use it to display texts with images easily. */ -class CC_GUI_DLL RichText : public Widget +class AX_GUI_DLL RichText : public Widget { public: enum WrapMode diff --git a/core/ui/UIScale9Sprite.cpp b/core/ui/UIScale9Sprite.cpp index 296e19e36b..a4cd5f83c2 100644 --- a/core/ui/UIScale9Sprite.cpp +++ b/core/ui/UIScale9Sprite.cpp @@ -49,7 +49,7 @@ Scale9Sprite* Scale9Sprite::create() ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -61,7 +61,7 @@ Scale9Sprite* Scale9Sprite::create(std::string_view filename, const Rect& rect, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -78,7 +78,7 @@ Scale9Sprite* Scale9Sprite::create(const Rect& capInsets, std::string_view file) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -95,7 +95,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame, cons ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -112,7 +112,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(std::string_view spriteFra ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -124,7 +124,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(std::string_view spriteFra ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); log("Could not allocate Scale9Sprite()"); return nullptr; @@ -272,8 +272,8 @@ bool Scale9Sprite::updateWithSprite(Sprite* sprite, const Rect& capInsets) { SpriteFrame* spriteframe = - SpriteFrame::createWithTexture(sprite->getTexture(), CC_RECT_POINTS_TO_PIXELS(textureRect), rotated, - CC_POINT_POINTS_TO_PIXELS(offset), CC_SIZE_POINTS_TO_PIXELS(originalSize)); + SpriteFrame::createWithTexture(sprite->getTexture(), AX_RECT_POINTS_TO_PIXELS(textureRect), rotated, + AX_POINT_POINTS_TO_PIXELS(offset), AX_SIZE_POINTS_TO_PIXELS(originalSize)); setSpriteFrame(spriteframe); setCapInsets(capInsets); return true; @@ -288,7 +288,7 @@ Scale9Sprite* Scale9Sprite::resizableSpriteWithCapInsets(const Rect& capInsets) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -396,7 +396,7 @@ void Scale9Sprite::setScale9Enabled(bool enabled) { if (_renderMode == RenderMode::POLYGON) { - CCLOGWARN("Scale9Sprite::setScale9Enabled() can't be called when using POLYGON render modes"); + AXLOGWARN("Scale9Sprite::setScale9Enabled() can't be called when using POLYGON render modes"); return; } @@ -475,7 +475,7 @@ void Scale9Sprite::setRenderingType(Scale9Sprite::RenderingType type) { if (_renderMode == RenderMode::POLYGON) { - CCLOGWARN("Scale9Sprite::setRenderingType() can't be called when using POLYGON render modes"); + AXLOGWARN("Scale9Sprite::setRenderingType() can't be called when using POLYGON render modes"); return; } if (_renderingType != type) diff --git a/core/ui/UIScale9Sprite.h b/core/ui/UIScale9Sprite.h index b1d859482d..521769c56a 100644 --- a/core/ui/UIScale9Sprite.h +++ b/core/ui/UIScale9Sprite.h @@ -57,7 +57,7 @@ namespace ui * Then you could call any methods of Sprite class with the return pointers. * */ -class CC_GUI_DLL Scale9Sprite : public Sprite +class AX_GUI_DLL Scale9Sprite : public Sprite { public: /** diff --git a/core/ui/UIScrollView.cpp b/core/ui/UIScrollView.cpp index e431d55bd2..8ca34861ff 100644 --- a/core/ui/UIScrollView.cpp +++ b/core/ui/UIScrollView.cpp @@ -98,7 +98,7 @@ ScrollView* ScrollView::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -760,7 +760,7 @@ void ScrollView::scrollToTopLeft(float timeInSec, bool attenuated) { if (_direction != Direction::BOTH) { - CCLOG("Scroll direction is not both!"); + AXLOG("Scroll direction is not both!"); return; } startAutoScrollToDestination(Vec2(0.0f, _contentSize.height - _innerContainer->getContentSize().height), timeInSec, @@ -771,7 +771,7 @@ void ScrollView::scrollToTopRight(float timeInSec, bool attenuated) { if (_direction != Direction::BOTH) { - CCLOG("Scroll direction is not both!"); + AXLOG("Scroll direction is not both!"); return; } startAutoScrollToDestination(Vec2(_contentSize.width - _innerContainer->getContentSize().width, @@ -783,7 +783,7 @@ void ScrollView::scrollToBottomLeft(float timeInSec, bool attenuated) { if (_direction != Direction::BOTH) { - CCLOG("Scroll direction is not both!"); + AXLOG("Scroll direction is not both!"); return; } startAutoScrollToDestination(Vec2::ZERO, timeInSec, attenuated); @@ -793,7 +793,7 @@ void ScrollView::scrollToBottomRight(float timeInSec, bool attenuated) { if (_direction != Direction::BOTH) { - CCLOG("Scroll direction is not both!"); + AXLOG("Scroll direction is not both!"); return; } startAutoScrollToDestination(Vec2(_contentSize.width - _innerContainer->getContentSize().width, 0.0f), timeInSec, @@ -868,7 +868,7 @@ void ScrollView::jumpToTopLeft() { if (_direction != Direction::BOTH) { - CCLOG("Scroll direction is not both!"); + AXLOG("Scroll direction is not both!"); return; } jumpToDestination(Vec2(0.0f, _contentSize.height - _innerContainer->getContentSize().height)); @@ -878,7 +878,7 @@ void ScrollView::jumpToTopRight() { if (_direction != Direction::BOTH) { - CCLOG("Scroll direction is not both!"); + AXLOG("Scroll direction is not both!"); return; } jumpToDestination(Vec2(_contentSize.width - _innerContainer->getContentSize().width, @@ -889,7 +889,7 @@ void ScrollView::jumpToBottomLeft() { if (_direction != Direction::BOTH) { - CCLOG("Scroll direction is not both!"); + AXLOG("Scroll direction is not both!"); return; } jumpToDestination(Vec2::ZERO); @@ -899,7 +899,7 @@ void ScrollView::jumpToBottomRight() { if (_direction != Direction::BOTH) { - CCLOG("Scroll direction is not both!"); + AXLOG("Scroll direction is not both!"); return; } jumpToDestination(Vec2(_contentSize.width - _innerContainer->getContentSize().width, 0.0f)); @@ -1285,35 +1285,35 @@ void ScrollView::setScrollBarPositionFromCorner(const Vec2& positionFromCorner) void ScrollView::setScrollBarPositionFromCornerForVertical(const Vec2& positionFromCorner) { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); - CCASSERT(_direction != Direction::HORIZONTAL, "Scroll view doesn't have a vertical scroll bar!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_direction != Direction::HORIZONTAL, "Scroll view doesn't have a vertical scroll bar!"); _verticalScrollBar->setPositionFromCorner(positionFromCorner); } Vec2 ScrollView::getScrollBarPositionFromCornerForVertical() const { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); - CCASSERT(_direction != Direction::HORIZONTAL, "Scroll view doesn't have a vertical scroll bar!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_direction != Direction::HORIZONTAL, "Scroll view doesn't have a vertical scroll bar!"); return _verticalScrollBar->getPositionFromCorner(); } void ScrollView::setScrollBarPositionFromCornerForHorizontal(const Vec2& positionFromCorner) { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); - CCASSERT(_direction != Direction::VERTICAL, "Scroll view doesn't have a horizontal scroll bar!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_direction != Direction::VERTICAL, "Scroll view doesn't have a horizontal scroll bar!"); _horizontalScrollBar->setPositionFromCorner(positionFromCorner); } Vec2 ScrollView::getScrollBarPositionFromCornerForHorizontal() const { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); - CCASSERT(_direction != Direction::VERTICAL, "Scroll view doesn't have a horizontal scroll bar!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_direction != Direction::VERTICAL, "Scroll view doesn't have a horizontal scroll bar!"); return _horizontalScrollBar->getPositionFromCorner(); } void ScrollView::setScrollBarWidth(float width) { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); if (_verticalScrollBar != nullptr) { _verticalScrollBar->setWidth(width); @@ -1326,7 +1326,7 @@ void ScrollView::setScrollBarWidth(float width) float ScrollView::getScrollBarWidth() const { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); if (_verticalScrollBar != nullptr) { return _verticalScrollBar->getWidth(); @@ -1340,7 +1340,7 @@ float ScrollView::getScrollBarWidth() const void ScrollView::setScrollBarColor(const Color3B& color) { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); if (_verticalScrollBar != nullptr) { _verticalScrollBar->setColor(color); @@ -1353,7 +1353,7 @@ void ScrollView::setScrollBarColor(const Color3B& color) const Color3B& ScrollView::getScrollBarColor() const { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); if (_verticalScrollBar != nullptr) { return _verticalScrollBar->getColor(); @@ -1367,7 +1367,7 @@ const Color3B& ScrollView::getScrollBarColor() const void ScrollView::setScrollBarOpacity(uint8_t opacity) { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); if (_verticalScrollBar != nullptr) { _verticalScrollBar->setOpacity(opacity); @@ -1380,7 +1380,7 @@ void ScrollView::setScrollBarOpacity(uint8_t opacity) uint8_t ScrollView::getScrollBarOpacity() const { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); if (_verticalScrollBar != nullptr) { return _verticalScrollBar->getOpacity(); @@ -1394,7 +1394,7 @@ uint8_t ScrollView::getScrollBarOpacity() const void ScrollView::setScrollBarAutoHideEnabled(bool autoHideEnabled) { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); if (_verticalScrollBar != nullptr) { _verticalScrollBar->setAutoHideEnabled(autoHideEnabled); @@ -1407,7 +1407,7 @@ void ScrollView::setScrollBarAutoHideEnabled(bool autoHideEnabled) bool ScrollView::isScrollBarAutoHideEnabled() const { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); if (_verticalScrollBar != nullptr) { return _verticalScrollBar->isAutoHideEnabled(); @@ -1421,7 +1421,7 @@ bool ScrollView::isScrollBarAutoHideEnabled() const void ScrollView::setScrollBarAutoHideTime(float autoHideTime) { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); if (_verticalScrollBar != nullptr) { _verticalScrollBar->setAutoHideTime(autoHideTime); @@ -1434,7 +1434,7 @@ void ScrollView::setScrollBarAutoHideTime(float autoHideTime) float ScrollView::getScrollBarAutoHideTime() const { - CCASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); + AXASSERT(_scrollBarEnabled, "Scroll bar should be enabled!"); if (_verticalScrollBar != nullptr) { return _verticalScrollBar->getAutoHideTime(); diff --git a/core/ui/UIScrollView.h b/core/ui/UIScrollView.h index a102e22271..1e8ab6ead7 100644 --- a/core/ui/UIScrollView.h +++ b/core/ui/UIScrollView.h @@ -47,7 +47,7 @@ class ScrollViewBar; * Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical * display. It holds a inner `Layout` container for storing child items horizontally or vertically. */ -class CC_GUI_DLL ScrollView : public Layout +class AX_GUI_DLL ScrollView : public Layout { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UIScrollViewBar.cpp b/core/ui/UIScrollViewBar.cpp index 653e4b6285..0be1a6058b 100644 --- a/core/ui/UIScrollViewBar.cpp +++ b/core/ui/UIScrollViewBar.cpp @@ -62,8 +62,8 @@ ScrollViewBar::ScrollViewBar(ScrollView* parent, ScrollView::Direction direction , _autoHideTime(DEFAULT_AUTO_HIDE_TIME) , _autoHideRemainingTime(0) { - CCASSERT(parent != nullptr, "Parent scroll view must not be null!"); - CCASSERT(direction != ScrollView::Direction::BOTH, "Illegal scroll direction for scroll bar!"); + AXASSERT(parent != nullptr, "Parent scroll view must not be null!"); + AXASSERT(direction != ScrollView::Direction::BOTH, "Illegal scroll direction for scroll bar!"); setCascadeColorEnabled(true); setCascadeOpacityEnabled(true); } @@ -78,7 +78,7 @@ ScrollViewBar* ScrollViewBar::create(ScrollView* parent, ScrollView::Direction d node->autorelease(); return node; } - CC_SAFE_DELETE(node); + AX_SAFE_DELETE(node); return nullptr; } diff --git a/core/ui/UIScrollViewBar.h b/core/ui/UIScrollViewBar.h index 37e3fc4839..32c4081d46 100644 --- a/core/ui/UIScrollViewBar.h +++ b/core/ui/UIScrollViewBar.h @@ -42,7 +42,7 @@ namespace ui /** * Scroll bar being attached to ScrollView layout container. */ -class CC_GUI_DLL ScrollViewBar : public ProtectedNode +class AX_GUI_DLL ScrollViewBar : public ProtectedNode { public: diff --git a/core/ui/UISlider.cpp b/core/ui/UISlider.cpp index 3e443bdd06..4f669c987f 100644 --- a/core/ui/UISlider.cpp +++ b/core/ui/UISlider.cpp @@ -99,7 +99,7 @@ Slider* Slider::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -113,7 +113,7 @@ Slider* Slider::create(std::string_view barTextureName, std::string_view normalB widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UISlider.h b/core/ui/UISlider.h index 982a00bdc9..ae2164f671 100644 --- a/core/ui/UISlider.h +++ b/core/ui/UISlider.h @@ -37,7 +37,7 @@ NS_AX_BEGIN */ class Sprite; -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -54,7 +54,7 @@ typedef void (Ref::*SEL_SlidPercentChangedEvent)(Ref*, SliderEventType); /** * @brief UI Slider widget. */ -class CC_GUI_DLL Slider : public Widget +class AX_GUI_DLL Slider : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITabControl.cpp b/core/ui/UITabControl.cpp index 58adb94143..552f4209d4 100644 --- a/core/ui/UITabControl.cpp +++ b/core/ui/UITabControl.cpp @@ -53,7 +53,7 @@ TabControl::~TabControl() for (auto& item : _tabItems) { if (item) - CC_SAFE_DELETE(item); + AX_SAFE_DELETE(item); } _tabItems.clear(); } @@ -63,7 +63,7 @@ void TabControl::insertTab(int index, TabHeader* header, Layout* container) int cellSize = (int)_tabItems.size(); if (index > cellSize) { - CCLOG("%s", "insert index error"); + AXLOG("%s", "insert index error"); return; } @@ -73,7 +73,7 @@ void TabControl::insertTab(int index, TabHeader* header, Layout* container) _tabItems.insert(_tabItems.begin() + index, new TabItem(header, container)); header->_tabView = this; header->_tabSelectedEvent = - CC_CALLBACK_2(TabControl::dispatchSelectedTabChanged, this); // binding tab selected event + AX_CALLBACK_2(TabControl::dispatchSelectedTabChanged, this); // binding tab selected event initAfterInsert(index); } @@ -123,7 +123,7 @@ void TabControl::removeTab(int index) int cellSize = (int)_tabItems.size(); if (cellSize == 0 || index >= cellSize) { - CCLOG("%s", "no tab or remove index error"); + AXLOG("%s", "no tab or remove index error"); return; } @@ -134,7 +134,7 @@ void TabControl::removeTab(int index) auto header = tabItem->header; auto container = tabItem->container; if (tabItem) - CC_SAFE_DELETE(tabItem); + AX_SAFE_DELETE(tabItem); _tabItems.erase(_tabItems.begin() + index); if (header != nullptr) @@ -366,7 +366,7 @@ TabControl* TabControl::create() tabview->autorelease(); return tabview; } - CC_SAFE_DELETE(tabview); + AX_SAFE_DELETE(tabview); return nullptr; } @@ -483,7 +483,7 @@ TabHeader* TabHeader::create() tabcell->autorelease(); return tabcell; } - CC_SAFE_DELETE(tabcell); + AX_SAFE_DELETE(tabcell); return nullptr; } @@ -501,7 +501,7 @@ TabHeader* TabHeader::create(std::string_view titleStr, tabcell->autorelease(); return tabcell; } - CC_SAFE_DELETE(tabcell); + AX_SAFE_DELETE(tabcell); return nullptr; } @@ -522,7 +522,7 @@ TabHeader* TabHeader::create(std::string_view titleStr, tabcell->autorelease(); return tabcell; } - CC_SAFE_DELETE(tabcell); + AX_SAFE_DELETE(tabcell); return nullptr; } diff --git a/core/ui/UITabControl.h b/core/ui/UITabControl.h index 9d03bab184..9bab96b028 100644 --- a/core/ui/UITabControl.h +++ b/core/ui/UITabControl.h @@ -45,7 +45,7 @@ class TabControl; /** * the header button in TabControl */ -class CC_GUI_DLL TabHeader : public AbstractCheckButton +class AX_GUI_DLL TabHeader : public AbstractCheckButton { friend class TabControl; @@ -188,7 +188,7 @@ private: /** * TabControl, use header button switch container */ -class CC_GUI_DLL TabControl : public Widget +class AX_GUI_DLL TabControl : public Widget { public: enum class Dock diff --git a/core/ui/UIText.cpp b/core/ui/UIText.cpp index 9b934b647c..a4f04ea627 100644 --- a/core/ui/UIText.cpp +++ b/core/ui/UIText.cpp @@ -58,7 +58,7 @@ Text* Text::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -79,7 +79,7 @@ Text* Text::create(std::string_view textContent, std::string_view fontName, floa text->autorelease(); return text; } - CC_SAFE_DELETE(text); + AX_SAFE_DELETE(text); return nullptr; } diff --git a/core/ui/UIText.h b/core/ui/UIText.h index 0273813a10..0388d18c20 100644 --- a/core/ui/UIText.h +++ b/core/ui/UIText.h @@ -46,7 +46,7 @@ namespace ui /** * For creating a system font or a TTF font Text */ -class CC_GUI_DLL Text : public Widget, public axis::BlendProtocol +class AX_GUI_DLL Text : public Widget, public axis::BlendProtocol { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITextAtlas.cpp b/core/ui/UITextAtlas.cpp index b2bc2fe05b..a339e4a8ee 100644 --- a/core/ui/UITextAtlas.cpp +++ b/core/ui/UITextAtlas.cpp @@ -55,7 +55,7 @@ TextAtlas* TextAtlas::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -79,7 +79,7 @@ TextAtlas* TextAtlas::create(std::string_view stringValue, widget->setProperty(stringValue, charMapFile, itemWidth, itemHeight, startCharMap); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -100,7 +100,7 @@ void TextAtlas::setProperty(std::string_view stringValue, updateContentSizeWithTextureSize(_labelAtlasRenderer->getContentSize()); _labelAtlasRendererAdaptDirty = true; - // CCLOG("cs w %f, h %f", _contentSize.width, _contentSize.height); + // AXLOG("cs w %f, h %f", _contentSize.width, _contentSize.height); } void TextAtlas::setString(std::string_view value) @@ -113,7 +113,7 @@ void TextAtlas::setString(std::string_view value) _labelAtlasRenderer->setString(value); updateContentSizeWithTextureSize(_labelAtlasRenderer->getContentSize()); _labelAtlasRendererAdaptDirty = true; - // CCLOG("cssss w %f, h %f", _contentSize.width, _contentSize.height); + // AXLOG("cssss w %f, h %f", _contentSize.width, _contentSize.height); } std::string_view TextAtlas::getString() const diff --git a/core/ui/UITextAtlas.h b/core/ui/UITextAtlas.h index 4c8e21473d..89aaca1529 100644 --- a/core/ui/UITextAtlas.h +++ b/core/ui/UITextAtlas.h @@ -37,7 +37,7 @@ NS_AX_BEGIN */ class Label; -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -45,7 +45,7 @@ namespace ui /** * @brief UI TextAtlas widget. */ -class CC_GUI_DLL TextAtlas : public Widget +class AX_GUI_DLL TextAtlas : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITextBMFont.cpp b/core/ui/UITextBMFont.cpp index e4c2f2b271..b23eb56724 100644 --- a/core/ui/UITextBMFont.cpp +++ b/core/ui/UITextBMFont.cpp @@ -49,7 +49,7 @@ TextBMFont* TextBMFont::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -63,7 +63,7 @@ TextBMFont* TextBMFont::create(std::string_view text, std::string_view filename) widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UITextBMFont.h b/core/ui/UITextBMFont.h index eb171b4484..f9dfeb0832 100644 --- a/core/ui/UITextBMFont.h +++ b/core/ui/UITextBMFont.h @@ -36,7 +36,7 @@ THE SOFTWARE. NS_AX_BEGIN class Label; -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -44,7 +44,7 @@ namespace ui /** * A widget for displaying BMFont label. */ -class CC_GUI_DLL TextBMFont : public Widget +class AX_GUI_DLL TextBMFont : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITextField.cpp b/core/ui/UITextField.cpp index 61a879f073..2f7b56edf5 100644 --- a/core/ui/UITextField.cpp +++ b/core/ui/UITextField.cpp @@ -65,7 +65,7 @@ UICCTextField* UICCTextField::create(std::string_view placeholder, std::string_v } return pRet; } - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); return nullptr; } @@ -288,7 +288,7 @@ TextField* TextField::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -303,7 +303,7 @@ TextField* TextField::create(std::string_view placeholder, std::string_view font widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UITextField.h b/core/ui/UITextField.h index 61a17db0d3..32d5f1363b 100644 --- a/core/ui/UITextField.h +++ b/core/ui/UITextField.h @@ -45,7 +45,7 @@ namespace ui * @js NA * @lua NA */ -class CC_GUI_DLL UICCTextField : public TextFieldTTF, public TextFieldDelegate +class AX_GUI_DLL UICCTextField : public TextFieldTTF, public TextFieldDelegate { public: /** @@ -223,7 +223,7 @@ protected: * @js NA * @lua NA */ -class CC_GUI_DLL TextField : public Widget +class AX_GUI_DLL TextField : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITextFieldEx.cpp b/core/ui/UITextFieldEx.cpp index 4a18a51b41..69eb966462 100644 --- a/core/ui/UITextFieldEx.cpp +++ b/core/ui/UITextFieldEx.cpp @@ -44,7 +44,7 @@ static Label* createLabel(std::string_view text, static bool engine_inj_checkVisibility(Node* theNode) { - // CC_ASSERT(theNode != NULL); + // AX_ASSERT(theNode != NULL); bool visible = false; for (Node* ptr = theNode; (ptr != nullptr && (visible = ptr->isVisible())); ptr = ptr->getParent()) ; @@ -63,7 +63,7 @@ static bool engine_inj_containsTouchPoint(axis::Node* target, axis::Touch* touch bool contains = (rc.containsPoint(pt)); - // CCLOG("check %#x coordinate:(%f, %f), contains:%d", target, pt.x, pt.y, contains); + // AXLOG("check %#x coordinate:(%f, %f), contains:%d", target, pt.x, pt.y, contains); return contains; } @@ -77,7 +77,7 @@ static bool engine_inj_containsPoint(axis::Node* target, const axis::Vec2& world bool contains = (rc.containsPoint(pt)); - // CCLOG("check %#x coordinate:(%f, %f), contains:%d", target, pt.x, pt.y, contains); + // AXLOG("check %#x coordinate:(%f, %f), contains:%d", target, pt.x, pt.y, contains); return contains; } @@ -126,7 +126,7 @@ static int _calcCharCount(const char* text) char ch = 0; while ((ch = *text) != 0x0) { - CC_BREAK_IF(!ch); + AX_BREAK_IF(!ch); if (0x80 != (0xC0 & ch)) { @@ -145,7 +145,7 @@ static int _truncateUTF8String(const char* text, int limit, int& nb) nb = 0; while ((ch = *text) != 0x0) { - CC_BREAK_IF(!ch || n > limit); + AX_BREAK_IF(!ch || n > limit); if (0x80 != (0xC0 & ch)) { @@ -281,7 +281,7 @@ TextFieldEx* TextFieldEx::create(std::string_view placeholder, } return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -515,7 +515,7 @@ void TextFieldEx::keyboardDidHide(IMEKeyboardNotificationInfo& /*info*/) void TextFieldEx::openIME(void) { - CCLOG("TextFieldEx:: openIME"); + AXLOG("TextFieldEx:: openIME"); this->attachWithIME(); __updateCursorPosition(); __showCursor(); @@ -526,7 +526,7 @@ void TextFieldEx::openIME(void) void TextFieldEx::closeIME(void) { - CCLOG("TextFieldEx:: closeIME"); + AXLOG("TextFieldEx:: closeIME"); __hideCursor(); this->detachWithIME(); diff --git a/core/ui/UITextFieldEx.h b/core/ui/UITextFieldEx.h index d683e81a4e..ff563351d9 100644 --- a/core/ui/UITextFieldEx.h +++ b/core/ui/UITextFieldEx.h @@ -16,7 +16,7 @@ namespace ui /** @brief A extension implementation of ui::TextField */ -class CC_DLL TextFieldEx : public axis::Node, public IMEDelegate +class AX_DLL TextFieldEx : public axis::Node, public IMEDelegate { public: /** @@ -100,7 +100,7 @@ public: void setTextFontName(std::string_view fontName); std::string_view getTextFontName() const; - CC_SYNTHESIZE(size_t, charLimit, CharLimit); + AX_SYNTHESIZE(size_t, charLimit, CharLimit); bool isSystemFont(void) const { return systemFontUsed; } diff --git a/core/ui/UIVBox.cpp b/core/ui/UIVBox.cpp index 93e5ff064b..2f7bdfe4d3 100644 --- a/core/ui/UIVBox.cpp +++ b/core/ui/UIVBox.cpp @@ -42,7 +42,7 @@ VBox* VBox::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -54,7 +54,7 @@ VBox* VBox::create(const Vec2& size) widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIVBox.h b/core/ui/UIVBox.h index cb5e6065b7..40f0b1f140 100644 --- a/core/ui/UIVBox.h +++ b/core/ui/UIVBox.h @@ -42,7 +42,7 @@ namespace ui * VBox is just a convenient wrapper class for vertical layout type. * VBox lays out its children in a single vertical column. */ -class CC_GUI_DLL VBox : public Layout +class AX_GUI_DLL VBox : public Layout { public: /** diff --git a/core/ui/UIVideoPlayer/UIVideoPlayer-android.cpp b/core/ui/UIVideoPlayer/UIVideoPlayer-android.cpp index 3370643f07..7b2d3f9e04 100644 --- a/core/ui/UIVideoPlayer/UIVideoPlayer-android.cpp +++ b/core/ui/UIVideoPlayer/UIVideoPlayer-android.cpp @@ -26,7 +26,7 @@ #include "ui/UIVideoPlayer/UIVideoPlayer.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include # include # include @@ -113,7 +113,7 @@ VideoPlayer::VideoPlayer() _videoPlayerIndex = createVideoWidgetJNI(); s_allVideoPlayers[_videoPlayerIndex] = this; -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW _debugDrawNode = DrawNode::create(); addChild(_debugDrawNode); # endif @@ -169,7 +169,7 @@ void VideoPlayer::draw(Renderer* renderer, const Mat4& transform, uint32_t flags (int)uiRect.origin.y, (int)uiRect.size.width, (int)uiRect.size.height); } -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW _debugDrawNode->clear(); auto size = getContentSize(); Point vertices[4] = {Point::ZERO, Point(size.width, 0), Point(size.width, size.height), Point(0, size.height)}; diff --git a/core/ui/UIVideoPlayer/UIVideoPlayer-ios.mm b/core/ui/UIVideoPlayer/UIVideoPlayer-ios.mm index 38aa9d8729..34410204c0 100644 --- a/core/ui/UIVideoPlayer/UIVideoPlayer-ios.mm +++ b/core/ui/UIVideoPlayer/UIVideoPlayer-ios.mm @@ -27,7 +27,7 @@ #include "ui/UIVideoPlayer/UIVideoPlayer.h" // No Available on tvOS -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS && !defined(CC_TARGET_OS_TVOS) +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS && !defined(AX_TARGET_OS_TVOS) using namespace axis::ui; //------------------------------------------------------------------------------------- @@ -283,7 +283,7 @@ VideoPlayer::VideoPlayer() { _videoContext = [[UIVideoViewWrapperIos alloc] init:this]; -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW _debugDrawNode = DrawNode::create(); addChild(_debugDrawNode); # endif @@ -366,7 +366,7 @@ void VideoPlayer::draw(Renderer* renderer, const Mat4& transform, uint32_t flags scaleFactor)]; } -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW _debugDrawNode->clear(); auto size = getContentSize(); Point vertices[4] = {Point::ZERO, Point(size.width, 0), Point(size.width, size.height), Point(0, size.height)}; diff --git a/core/ui/UIVideoPlayer/UIVideoPlayer-win.cpp b/core/ui/UIVideoPlayer/UIVideoPlayer-win.cpp index 9682a84957..1d666a0bbf 100644 --- a/core/ui/UIVideoPlayer/UIVideoPlayer-win.cpp +++ b/core/ui/UIVideoPlayer/UIVideoPlayer-win.cpp @@ -26,7 +26,7 @@ #include "ui/UIVideoPlayer/UIVideoPlayer.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include # include # include @@ -273,7 +273,7 @@ VideoPlayer::VideoPlayer() { auto pvd = new PrivateVideoDescriptor{}; _videoContext = pvd; -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW _debugDrawNode = DrawNode::create(); addChild(_debugDrawNode); # endif @@ -501,7 +501,7 @@ void VideoPlayer::draw(Renderer* renderer, const Mat4& transform, uint32_t flags if (pvd->_scaleDirty || (flags & FLAGS_TRANSFORM_DIRTY)) pvd->rescaleTo(this); -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW _debugDrawNode->clear(); auto size = getContentSize(); Point vertices[4] = {Point::ZERO, Point(size.width, 0), Point(size.width, size.height), Point(0, size.height)}; diff --git a/core/ui/UIVideoPlayer/UIVideoPlayer.h b/core/ui/UIVideoPlayer/UIVideoPlayer.h index 68a65ef578..a025a5fd8f 100644 --- a/core/ui/UIVideoPlayer/UIVideoPlayer.h +++ b/core/ui/UIVideoPlayer/UIVideoPlayer.h @@ -25,13 +25,13 @@ ****************************************************************************/ #pragma once -#if defined(_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) && \ - !defined(CC_PLATFORM_OS_TVOS) +#if defined(_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_TIZEN) && \ + !defined(AX_PLATFORM_OS_TVOS) # include "ui/UIWidget.h" -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW # include "2d/CCDrawNode.h" # endif @@ -247,7 +247,7 @@ protected: virtual axis::ui::Widget* createCloneInstance() override; virtual void copySpecialProperties(Widget* model) override; -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW DrawNode* _debugDrawNode; # endif diff --git a/core/ui/UIWebView/UIWebView-inl.h b/core/ui/UIWebView/UIWebView-inl.h index 26a2fd73f1..4341e238c3 100644 --- a/core/ui/UIWebView/UIWebView-inl.h +++ b/core/ui/UIWebView/UIWebView-inl.h @@ -38,7 +38,7 @@ WebView::WebView() : _impl(new WebViewImpl(this)) {} WebView::~WebView() { - CC_SAFE_DELETE(_impl); + AX_SAFE_DELETE(_impl); } WebView* WebView::create() @@ -49,7 +49,7 @@ WebView* WebView::create() webView->autorelease(); return webView; } - CC_SAFE_DELETE(webView); + AX_SAFE_DELETE(webView); return nullptr; } diff --git a/core/ui/UIWebView/UIWebView.cpp b/core/ui/UIWebView/UIWebView.cpp index 7e1ba2e758..ac480535c4 100644 --- a/core/ui/UIWebView/UIWebView.cpp +++ b/core/ui/UIWebView/UIWebView.cpp @@ -24,12 +24,12 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "ui/UIWebView/UIWebViewImpl-android.h" # include "ui/UIWebView/UIWebView-inl.h" -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "ui/UIWebView/UIWebViewImpl-win32.h" # include "ui/UIWebView/UIWebView-inl.h" diff --git a/core/ui/UIWebView/UIWebView.h b/core/ui/UIWebView/UIWebView.h index 34f71dab84..80a55f2acc 100644 --- a/core/ui/UIWebView/UIWebView.h +++ b/core/ui/UIWebView/UIWebView.h @@ -29,7 +29,7 @@ #include "ui/GUIExport.h" #include "base/CCData.h" -#if defined(_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if defined(_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) /** * @addtogroup ui * @{ @@ -48,7 +48,7 @@ class WebViewImpl; * It's mean WebView displays web pages above all graphical elements of cocos2d-x. * @js NA */ -class CC_GUI_DLL WebView : public axis::ui::Widget +class AX_GUI_DLL WebView : public axis::ui::Widget { public: /** diff --git a/core/ui/UIWebView/UIWebViewImpl-win32.cpp b/core/ui/UIWebView/UIWebViewImpl-win32.cpp index dc4d6940f8..778e5dee6a 100644 --- a/core/ui/UIWebView/UIWebViewImpl-win32.cpp +++ b/core/ui/UIWebView/UIWebViewImpl-win32.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2) +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2) # include "UIWebViewImpl-win32.h" # include "UIWebView.h" @@ -918,7 +918,7 @@ bool Win32WebControl::createWebView(const std::function& if (!embed(m_window, false, cb)) { - CCLOG("Cannot create edge chromium webview"); + AXLOG("Cannot create edge chromium webview"); ret = false; break; } @@ -1082,4 +1082,4 @@ void Win32WebControl::setBackgroundTransparent() } } -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 diff --git a/core/ui/UIWebView/UIWebViewImpl-win32.h b/core/ui/UIWebView/UIWebViewImpl-win32.h index 23c5d59b64..10e03d240d 100644 --- a/core/ui/UIWebView/UIWebViewImpl-win32.h +++ b/core/ui/UIWebView/UIWebViewImpl-win32.h @@ -28,7 +28,7 @@ #include "platform/CCPlatformMacros.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2) +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2) # include # include "CCStdC.h" @@ -92,6 +92,6 @@ private: } // namespace ui NS_AX_END // namespace axis -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 #endif // __COCOS2D__UI__WEBVIEWIMPL_WIN32_H_ diff --git a/core/ui/UIWidget.cpp b/core/ui/UIWidget.cpp index fdce7d7d46..8b8e3f4e13 100644 --- a/core/ui/UIWidget.cpp +++ b/core/ui/UIWidget.cpp @@ -129,7 +129,7 @@ void Widget::FocusNavigationController::addKeyboardEventListener() if (nullptr == _keyboardListener) { _keyboardListener = EventListenerKeyboard::create(); - _keyboardListener->onKeyReleased = CC_CALLBACK_2(Widget::FocusNavigationController::onKeypadKeyPressed, this); + _keyboardListener->onKeyReleased = AX_CALLBACK_2(Widget::FocusNavigationController::onKeypadKeyPressed, this); EventDispatcher* dispatcher = Director::getInstance()->getEventDispatcher(); dispatcher->addEventListenerWithFixedPriority(_keyboardListener, _keyboardEventPriority); } @@ -186,13 +186,13 @@ void Widget::cleanupWidget() { // clean up _touchListener _eventDispatcher->removeEventListener(_touchListener); - CC_SAFE_RELEASE_NULL(_touchListener); + AX_SAFE_RELEASE_NULL(_touchListener); // cleanup focused widget and focus navigation controller if (_focusedWidget == this) { // delete - CC_SAFE_DELETE(_focusNavigationController); + AX_SAFE_DELETE(_focusNavigationController); _focusedWidget = nullptr; } } @@ -205,7 +205,7 @@ Widget* Widget::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -215,7 +215,7 @@ bool Widget::init() { initRenderer(); setBright(true); - onFocusChanged = CC_CALLBACK_2(Widget::onFocusChange, this); + onFocusChanged = AX_CALLBACK_2(Widget::onFocusChange, this); onNextFocusedWidget = nullptr; this->setAnchorPoint(Vec2(0.5f, 0.5f)); @@ -560,18 +560,18 @@ void Widget::setTouchEnabled(bool enable) if (_touchEnabled) { _touchListener = EventListenerTouchOneByOne::create(); - CC_SAFE_RETAIN(_touchListener); + AX_SAFE_RETAIN(_touchListener); _touchListener->setSwallowTouches(true); - _touchListener->onTouchBegan = CC_CALLBACK_2(Widget::onTouchBegan, this); - _touchListener->onTouchMoved = CC_CALLBACK_2(Widget::onTouchMoved, this); - _touchListener->onTouchEnded = CC_CALLBACK_2(Widget::onTouchEnded, this); - _touchListener->onTouchCancelled = CC_CALLBACK_2(Widget::onTouchCancelled, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(Widget::onTouchBegan, this); + _touchListener->onTouchMoved = AX_CALLBACK_2(Widget::onTouchMoved, this); + _touchListener->onTouchEnded = AX_CALLBACK_2(Widget::onTouchEnded, this); + _touchListener->onTouchCancelled = AX_CALLBACK_2(Widget::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(_touchListener, this); } else { _eventDispatcher->removeEventListener(_touchListener); - CC_SAFE_RELEASE_NULL(_touchListener); + AX_SAFE_RELEASE_NULL(_touchListener); } } @@ -1262,7 +1262,7 @@ float Widget::getScaleY() const float Widget::getScale() const { - CCASSERT(this->getScaleX() == this->getScaleY(), "scaleX should be equal to scaleY."); + AXASSERT(this->getScaleX() == this->getScaleY(), "scaleX should be equal to scaleY."); return this->getScaleX(); } @@ -1415,7 +1415,7 @@ void Widget::enableDpadNavigation(bool enable) } else { - CC_SAFE_DELETE(_focusNavigationController); + AX_SAFE_DELETE(_focusNavigationController); } if (nullptr != _focusNavigationController) diff --git a/core/ui/UIWidget.h b/core/ui/UIWidget.h index bd9f461a59..bf4b46f9c0 100644 --- a/core/ui/UIWidget.h +++ b/core/ui/UIWidget.h @@ -52,7 +52,7 @@ class LayoutComponent; * This class inherent from `ProtectedNode` and `LayoutParameterProtocol`. * If you want to implements your own ui widget, you should subclass it. */ -class CC_GUI_DLL Widget : public ProtectedNode, public LayoutParameterProtocol +class AX_GUI_DLL Widget : public ProtectedNode, public LayoutParameterProtocol { public: /** diff --git a/docs/CODING_STYLE.md b/docs/CODING_STYLE.md index d1f7b51178..e51fd1a27d 100644 --- a/docs/CODING_STYLE.md +++ b/docs/CODING_STYLE.md @@ -1660,20 +1660,20 @@ int cstmrId; // Deletes internal letters. ## File Names -Filenames should be all in CamelCasel, and for cocos2d specific files, they should start with the `CC` prefix as well. +Filenames should be all in CamelCasel Examples of acceptable file names: - CCSprite.cpp - CCTextureCache.cpp - CCTexture2D.cpp + Sprite.cpp + TextureCache.cpp + Texture2D.cpp C++ files should end in `.cpp` and header files should end in `.h`. Do not use filenames that already exist in /usr/include, such as db.h. -In general, make your filenames very specific. For example, use `CCTexture2D.h` rather than `Texture.h`. A very common case is to have a pair of files called, e.g., `FooBar.h` and `FooBar.cpp` , defining a class called `FooBar` . +A very common case is to have a pair of files called, e.g., `FooBar.h` and `FooBar.cpp` , defining a class called `FooBar` . Inline functions must be in a `.h` file. If your inline functions are very short, they should go directly into your .h file. However, if your inline functions include a lot of code, they may go into a third file that ends in `-inl.h` . In a class with a lot of inline code, your class could have three files: @@ -1828,14 +1828,14 @@ enum class UrlTableErrors { ## Macro Names -You're not really going to define a macro, are you? If you do, they're like this: CC_MY_MACRO_THAT_SCARES_SMALL_CHILDREN. +You're not really going to define a macro, are you? If you do, they're like this: AX_MY_MACRO_THAT_SCARES_SMALL_CHILDREN. -Please see the description of macros; in general macros should not be used. However, if they are absolutely needed, then they should be named with all capitals and underscores, and they should be prefixed with `CC_` or `CC` +Please see the description of macros; in general macros should not be used. However, if they are absolutely needed, then they should be named with all capitals and underscores, and they should be prefixed with `AX_` or `AX` ```cpp -#define CC_ROUND(x) ... -#define CC_PI_ROUNDED 3.0 -#define CCLOG(x) ... +#define AX_ROUND(x) ... +#define AX_PI_ROUNDED 3.0 +#define AXLOG(x) ... ``` ## Exceptions to Naming Rules @@ -2150,7 +2150,7 @@ If your TODO is of the form "At a future date do something" make sure that you e ## Deprecation Comments -Use the `CC_DEPRECATED_ATTRIBUTE` macro to mark an methods as deprecated. +Use the `AX_DEPRECATED_ATTRIBUTE` macro to mark an methods as deprecated. Also use the ` ``deprecated ` doxygen docstring to mark it as deprecated in the documentation. @@ -2825,7 +2825,7 @@ It is worth reiterating a few of the guidelines that you might forget if you are * Windows defines many of its own synonyms for primitive types, such as DWORD, HANDLE, etc. It is perfectly acceptable, and encouraged, that you use these types when calling Windows API functions. Even so, keep as close as you can to the underlying C++ types. For example, use const TCHAR * instead of LPCTSTR. * When compiling with Microsoft Visual C++, set the compiler to warning level 3 or higher, and treat all warnings as errors. * Do not use #pragma once; instead use the standard Google include guards. The path in the include guards should be relative to the top of your project tree. -* In fact, do not use any nonstandard extensions, like #pragma and __declspec, unless you absolutely must. Using `__declspec(dllimport)` and `__declspec(dllexport)` is allowed; however, you must use them through macros such as `DLLIMPORT` and `DLLEXPORT` or `CC_DLL`, so that someone can easily disable the extensions if they share the code. +* In fact, do not use any nonstandard extensions, like #pragma and __declspec, unless you absolutely must. Using `__declspec(dllimport)` and `__declspec(dllexport)` is allowed; however, you must use them through macros such as `DLLIMPORT` and `DLLEXPORT` or `AX_DLL`, so that someone can easily disable the extensions if they share the code. However, there are just a few rules that we occasionally need to break on Windows: diff --git a/examples/SimpleSnake/Classes/AppDelegate.cpp b/examples/SimpleSnake/Classes/AppDelegate.cpp index 4a189f2d83..cbc3f2e14e 100644 --- a/examples/SimpleSnake/Classes/AppDelegate.cpp +++ b/examples/SimpleSnake/Classes/AppDelegate.cpp @@ -67,8 +67,8 @@ bool AppDelegate::applicationDidFinishLaunching() auto glview = director->getOpenGLView(); if (!glview) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) glview = GLViewImpl::createWithRect( "Example: Simple Snake", axis::Rect(0, 0, designResolutionSize.width, designResolutionSize.height)); #else diff --git a/examples/SimpleSnake/Classes/SimpleSnakeScene.cpp b/examples/SimpleSnake/Classes/SimpleSnakeScene.cpp index c880172d35..07b4c69a11 100644 --- a/examples/SimpleSnake/Classes/SimpleSnakeScene.cpp +++ b/examples/SimpleSnake/Classes/SimpleSnakeScene.cpp @@ -74,7 +74,7 @@ bool SimpleSnake::init() // add a "close" icon to exit the progress. it's an autorelease object auto closeItem = MenuItemImage::create("CloseNormal.png", "CloseSelected.png", - CC_CALLBACK_1(SimpleSnake::menuCloseCallback, this)); + AX_CALLBACK_1(SimpleSnake::menuCloseCallback, this)); if (closeItem == nullptr || closeItem->getContentSize().width <= 0 || closeItem->getContentSize().height <= 0) { @@ -96,7 +96,7 @@ bool SimpleSnake::init() // 3. add your codes below... auto listener = EventListenerKeyboard::create(); - listener->onKeyPressed = CC_CALLBACK_2(SimpleSnake::onKeyPressed, this); + listener->onKeyPressed = AX_CALLBACK_2(SimpleSnake::onKeyPressed, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // add a label shows "Hello World" diff --git a/extensions/DragonBones/CCArmatureDisplay.cpp b/extensions/DragonBones/CCArmatureDisplay.cpp index f545ce78a7..0596bd2345 100644 --- a/extensions/DragonBones/CCArmatureDisplay.cpp +++ b/extensions/DragonBones/CCArmatureDisplay.cpp @@ -12,7 +12,7 @@ CCArmatureDisplay* CCArmatureDisplay::create() } else { - CC_SAFE_DELETE(displayContainer); + AX_SAFE_DELETE(displayContainer); } return displayContainer; @@ -28,7 +28,7 @@ void CCArmatureDisplay::dbClear() setEventDispatcher(axis::Director::getInstance()->getEventDispatcher()); _armature = nullptr; - CC_SAFE_RELEASE(_dispatcher); + AX_SAFE_RELEASE(_dispatcher); release(); } @@ -124,7 +124,7 @@ DBCCSprite* DBCCSprite::create() } else { - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); } return sprite; @@ -168,7 +168,7 @@ bool DBCCSprite::_checkVisibility(const axis::Mat4& transform, const axis::Size& void DBCCSprite::draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) { -#if CC_USE_CULLING +#if AX_USE_CULLING # if COCOS2D_VERSION >= 0x00031400 const auto& rect = _polyInfo.getRect(); # else @@ -200,7 +200,7 @@ void DBCCSprite::draw(axis::Renderer* renderer, const axis::Mat4& transform, uin #endif renderer->addCommand(&_trianglesCommand); -#if CC_SPRITE_DEBUG_DRAW +#if AX_SPRITE_DEBUG_DRAW _debugDrawNode->clear(); auto count = _polyInfo.triangles.indexCount / 3; auto indices = _polyInfo.triangles.indices; @@ -220,7 +220,7 @@ void DBCCSprite::draw(axis::Renderer* renderer, const axis::Mat4& transform, uin to = verts[indices[i * 3]].vertices; _debugDrawNode->drawLine(axis::Vec2(from.x, from.y), axis::Vec2(to.x, to.y), axis::Color4F::WHITE); } -#endif // CC_SPRITE_DEBUG_DRAW +#endif // AX_SPRITE_DEBUG_DRAW } } diff --git a/extensions/DragonBones/CCArmatureDisplay.h b/extensions/DragonBones/CCArmatureDisplay.h index a06db8dd18..9ebc450292 100644 --- a/extensions/DragonBones/CCArmatureDisplay.h +++ b/extensions/DragonBones/CCArmatureDisplay.h @@ -20,8 +20,8 @@ * 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 DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H -#define DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H +#ifndef DRAGONBONES_AX_ARMATURE_DISPLAY_CONTAINER_H +#define DRAGONBONES_AX_ARMATURE_DISPLAY_CONTAINER_H #include "DragonBones/DragonBonesHeaders.h" #include "cocos2d.h" @@ -140,4 +140,4 @@ public: }; DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H +#endif // DRAGONBONES_AX_ARMATURE_DISPLAY_CONTAINER_H diff --git a/extensions/DragonBones/CCDragonBonesHeaders.h b/extensions/DragonBones/CCDragonBonesHeaders.h index 2bab803b9c..6afbe16ba6 100644 --- a/extensions/DragonBones/CCDragonBonesHeaders.h +++ b/extensions/DragonBones/CCDragonBonesHeaders.h @@ -20,12 +20,12 @@ * 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 DRAGONBONES_CC_HEADERS_H -#define DRAGONBONES_CC_HEADERS_H +#ifndef DRAGONBONES_AX_HEADERS_H +#define DRAGONBONES_AX_HEADERS_H #include "CCTextureAtlasData.h" #include "CCArmatureDisplay.h" #include "CCSlot.h" #include "CCFactory.h" -#endif // DRAGONBONES_CC_HEADERS_H +#endif // DRAGONBONES_AX_HEADERS_H diff --git a/extensions/DragonBones/CCFactory.h b/extensions/DragonBones/CCFactory.h index 29dc2f462e..35097b36d3 100644 --- a/extensions/DragonBones/CCFactory.h +++ b/extensions/DragonBones/CCFactory.h @@ -20,8 +20,8 @@ * 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 DRAGONBONES_CC_FACTORY_H -#define DRAGONBONES_CC_FACTORY_H +#ifndef DRAGONBONES_AX_FACTORY_H +#define DRAGONBONES_AX_FACTORY_H #include "DragonBonesHeaders.h" #include "cocos2d.h" @@ -219,4 +219,4 @@ public: }; DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_CC_FACTORY_H +#endif // DRAGONBONES_AX_FACTORY_H diff --git a/extensions/DragonBones/CCSlot.h b/extensions/DragonBones/CCSlot.h index 1ece5d8a01..7c988a91fe 100644 --- a/extensions/DragonBones/CCSlot.h +++ b/extensions/DragonBones/CCSlot.h @@ -20,8 +20,8 @@ * 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 DRAGONBONES_CC_SLOT_H -#define DRAGONBONES_CC_SLOT_H +#ifndef DRAGONBONES_AX_SLOT_H +#define DRAGONBONES_AX_SLOT_H #include "DragonBonesHeaders.h" #include "cocos2d.h" @@ -73,4 +73,4 @@ public: }; DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_CC_SLOT_H +#endif // DRAGONBONES_AX_SLOT_H diff --git a/extensions/DragonBones/CCTextureAtlasData.h b/extensions/DragonBones/CCTextureAtlasData.h index 7cd0bfe3d3..5362911c6f 100644 --- a/extensions/DragonBones/CCTextureAtlasData.h +++ b/extensions/DragonBones/CCTextureAtlasData.h @@ -20,8 +20,8 @@ * 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 DRAGONBONES_CC_TEXTUREATLAS_DATA_H -#define DRAGONBONES_CC_TEXTUREATLAS_DATA_H +#ifndef DRAGONBONES_AX_TEXTUREATLAS_DATA_H +#define DRAGONBONES_AX_TEXTUREATLAS_DATA_H #include "DragonBonesHeaders.h" #include "cocos2d.h" @@ -76,4 +76,4 @@ protected: virtual void _onClear() override; }; DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_CC_TEXTUREATLAS_DATA_H +#endif // DRAGONBONES_AX_TEXTUREATLAS_DATA_H diff --git a/extensions/ExtensionExport.h b/extensions/ExtensionExport.h index cc4b764060..204cf4ac0a 100644 --- a/extensions/ExtensionExport.h +++ b/extensions/ExtensionExport.h @@ -30,13 +30,13 @@ # include # endif -# if defined(CC_STATIC) -# define CC_EX_DLL +# if defined(AX_STATIC) +# define AX_EX_DLL # else # if defined(_USREXDLL) -# define CC_EX_DLL __declspec(dllexport) +# define AX_EX_DLL __declspec(dllexport) # else /* use a DLL library */ -# define CC_EX_DLL __declspec(dllimport) +# define AX_EX_DLL __declspec(dllimport) # endif # endif @@ -49,9 +49,9 @@ # endif # endif #elif defined(_SHARED_) -# define CC_EX_DLL __attribute__((visibility("default"))) +# define AX_EX_DLL __attribute__((visibility("default"))) #else -# define CC_EX_DLL +# define AX_EX_DLL #endif #endif /* __CCEXTENSIONEXPORT_H__*/ \ No newline at end of file diff --git a/extensions/GUI/CCControlExtension/CCControl.cpp b/extensions/GUI/CCControlExtension/CCControl.cpp index 848a2f82bd..4c07ca450c 100644 --- a/extensions/GUI/CCControlExtension/CCControl.cpp +++ b/extensions/GUI/CCControlExtension/CCControl.cpp @@ -58,7 +58,7 @@ Control* Control::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); return nullptr; } } @@ -76,10 +76,10 @@ bool Control::init() auto dispatcher = Director::getInstance()->getEventDispatcher(); auto touchListener = EventListenerTouchOneByOne::create(); touchListener->setSwallowTouches(true); - touchListener->onTouchBegan = CC_CALLBACK_2(Control::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(Control::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(Control::onTouchEnded, this); - touchListener->onTouchCancelled = CC_CALLBACK_2(Control::onTouchCancelled, this); + touchListener->onTouchBegan = AX_CALLBACK_2(Control::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(Control::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(Control::onTouchEnded, this); + touchListener->onTouchCancelled = AX_CALLBACK_2(Control::onTouchCancelled, this); dispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); @@ -117,7 +117,7 @@ void Control::sendActionsForControlEvents(EventType controlEvents) { invocation->invoke(this); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING axis::BasicScriptData data(this, (void*)&controlEvents); axis::ScriptEvent event(axis::kControlEvent, (void*)&data); auto scriptEngine = axis::ScriptEngineManager::getInstance()->getScriptEngine(); diff --git a/extensions/GUI/CCControlExtension/CCControl.h b/extensions/GUI/CCControlExtension/CCControl.h index 0af905388f..eeff256c5a 100644 --- a/extensions/GUI/CCControlExtension/CCControl.h +++ b/extensions/GUI/CCControlExtension/CCControl.h @@ -61,11 +61,11 @@ class Invocation; * * To use the Control you have to subclass it. */ -class CC_EX_DLL Control : public Layer +class AX_EX_DLL Control : public Layer { public: /** Kinds of possible events for the control objects. */ - enum class CC_EX_DLL EventType + enum class AX_EX_DLL EventType { TOUCH_DOWN = 1 << 0, // A touch-down event in the control. DRAG_INSIDE = 1 << 1, // An event where a finger is dragged inside the bounds of the control. @@ -267,13 +267,13 @@ protected: bool _isOpacityModifyRGB; /** The current control state constant. */ - CC_SYNTHESIZE_READONLY(State, _state, State); + AX_SYNTHESIZE_READONLY(State, _state, State); private: - CC_DISALLOW_COPY_AND_ASSIGN(Control); + AX_DISALLOW_COPY_AND_ASSIGN(Control); }; -CC_EX_DLL Control::EventType operator|(Control::EventType a, Control::EventType b); +AX_EX_DLL Control::EventType operator|(Control::EventType a, Control::EventType b); // end of GUI group /// @} diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index 334a60428f..58f970151a 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -55,8 +55,8 @@ ControlButton::ControlButton() ControlButton::~ControlButton() { - CC_SAFE_RELEASE(_titleLabel); - CC_SAFE_RELEASE(_backgroundSprite); + AX_SAFE_RELEASE(_titleLabel); + AX_SAFE_RELEASE(_backgroundSprite); } // initialisers @@ -73,10 +73,10 @@ bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, { if (Control::init()) { - CCASSERT(node != nullptr, "node must not be nil."); + AXASSERT(node != nullptr, "node must not be nil."); LabelProtocol* label = dynamic_cast(node); - CCASSERT(backgroundSprite != nullptr, "Background sprite must not be nil."); - CCASSERT(label != nullptr, "label must not be nil."); + AXASSERT(backgroundSprite != nullptr, "Background sprite must not be nil."); + AXASSERT(label != nullptr, "label must not be nil."); _parentInited = true; @@ -740,7 +740,7 @@ ControlButton* ControlButton::create() pControlButton->autorelease(); return pControlButton; } - CC_SAFE_DELETE(pControlButton); + AX_SAFE_DELETE(pControlButton); return nullptr; } diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index 7eb5b97df7..a6777d6065 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/extensions/GUI/CCControlExtension/CCControlButton.h @@ -51,7 +51,7 @@ NS_AX_EXT_BEGIN */ /** @class ControlButton Button control for Cocos2D. */ -class CC_EX_DLL ControlButton : public Control +class AX_EX_DLL ControlButton : public Control { public: static ControlButton* create(); @@ -217,23 +217,23 @@ protected: std::string _currentTitle; /** The current color used to display the title. */ - CC_SYNTHESIZE_READONLY_PASS_BY_REF(Color3B, _currentTitleColor, CurrentTitleColor); + AX_SYNTHESIZE_READONLY_PASS_BY_REF(Color3B, _currentTitleColor, CurrentTitleColor); /** The current title label. */ - CC_SYNTHESIZE_RETAIN(Node*, _titleLabel, TitleLabel); + AX_SYNTHESIZE_RETAIN(Node*, _titleLabel, TitleLabel); /** The current background sprite. */ - CC_SYNTHESIZE_RETAIN(axis::ui::Scale9Sprite*, _backgroundSprite, BackgroundSprite); + AX_SYNTHESIZE_RETAIN(axis::ui::Scale9Sprite*, _backgroundSprite, BackgroundSprite); /** The preferred size of the button, if label is larger it will be expanded. */ - CC_PROPERTY_PASS_BY_REF(Size, _preferredSize, PreferredSize); + AX_PROPERTY_PASS_BY_REF(Size, _preferredSize, PreferredSize); /** Adjust the button zooming on touchdown. Default value is YES. */ - CC_PROPERTY(bool, _zoomOnTouchDown, ZoomOnTouchDown); + AX_PROPERTY(bool, _zoomOnTouchDown, ZoomOnTouchDown); /** Scale ratio button on touchdown. Default value 1.1f */ - CC_SYNTHESIZE(float, _scaleRatio, ScaleRatio); + AX_SYNTHESIZE(float, _scaleRatio, ScaleRatio); - CC_PROPERTY_PASS_BY_REF(Vec2, _labelAnchorPoint, LabelAnchorPoint); + AX_PROPERTY_PASS_BY_REF(Vec2, _labelAnchorPoint, LabelAnchorPoint); std::unordered_map _titleDispatchTable; std::unordered_map _titleColorDispatchTable; @@ -242,12 +242,12 @@ protected: Map _backgroundSpriteDispatchTable; /* Define the button margin for Top/Bottom edge */ - CC_SYNTHESIZE_READONLY(int, _marginV, VerticalMargin); + AX_SYNTHESIZE_READONLY(int, _marginV, VerticalMargin); /* Define the button margin for Left/Right edge */ - CC_SYNTHESIZE_READONLY(int, _marginH, HorizontalOrigin); + AX_SYNTHESIZE_READONLY(int, _marginH, HorizontalOrigin); private: - CC_DISALLOW_COPY_AND_ASSIGN(ControlButton); + AX_DISALLOW_COPY_AND_ASSIGN(ControlButton); }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp index 21fd888482..f73e4c918d 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp @@ -41,9 +41,9 @@ ControlColourPicker::ControlColourPicker() : _colourPicker(nullptr), _huePicker( ControlColourPicker::~ControlColourPicker() { - CC_SAFE_RELEASE(_background); - CC_SAFE_RELEASE(_huePicker); - CC_SAFE_RELEASE(_colourPicker); + AX_SAFE_RELEASE(_background); + AX_SAFE_RELEASE(_huePicker); + AX_SAFE_RELEASE(_colourPicker); } bool ControlColourPicker::init() @@ -77,7 +77,7 @@ bool ControlColourPicker::init() Vec2::ZERO, Vec2(0.5f, 0.5f)); if (!_background) return false; - CC_SAFE_RETAIN(_background); + AX_SAFE_RETAIN(_background); Vec2 backgroundPointZero = _background->getPosition() - Vec2(_background->getContentSize().width / 2, _background->getContentSize().height / 2); diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.h b/extensions/GUI/CCControlExtension/CCControlColourPicker.h index e93def4280..3b8d1a3755 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.h +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.h @@ -49,7 +49,7 @@ NS_AX_EXT_BEGIN * @{ */ -class CC_EX_DLL ControlColourPicker : public Control +class AX_EX_DLL ControlColourPicker : public Control { public: static ControlColourPicker* create(); @@ -79,9 +79,9 @@ protected: virtual bool onTouchBegan(Touch* touch, Event* pEvent) override; HSV _hsv; - CC_SYNTHESIZE_RETAIN(ControlSaturationBrightnessPicker*, _colourPicker, colourPicker) - CC_SYNTHESIZE_RETAIN(ControlHuePicker*, _huePicker, HuePicker) - CC_SYNTHESIZE_RETAIN(Sprite*, _background, Background) + AX_SYNTHESIZE_RETAIN(ControlSaturationBrightnessPicker*, _colourPicker, colourPicker) + AX_SYNTHESIZE_RETAIN(ControlHuePicker*, _huePicker, HuePicker) + AX_SYNTHESIZE_RETAIN(Sprite*, _background, Background) }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp b/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp index 59f2cfcb56..e84bd0d5dd 100644 --- a/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp @@ -40,8 +40,8 @@ ControlHuePicker::ControlHuePicker() : _hue(0.0f), _huePercentage(0.0f), _backgr ControlHuePicker::~ControlHuePicker() { removeAllChildrenWithCleanup(true); - CC_SAFE_RELEASE(_background); - CC_SAFE_RELEASE(_slider); + AX_SAFE_RELEASE(_background); + AX_SAFE_RELEASE(_slider); } ControlHuePicker* ControlHuePicker::create(Node* target, Vec2 pos) @@ -102,7 +102,7 @@ void ControlHuePicker::setHuePercentage(float hueValueInPercent) // Update angle float angleDeg = _huePercentage * 360.0f - 180.0f; - float angle = CC_DEGREES_TO_RADIANS(angleDeg); + float angle = AX_DEGREES_TO_RADIANS(angleDeg); // Set new position of the slider float x = centerX + limit * cosf(angle); @@ -135,7 +135,7 @@ void ControlHuePicker::updateSliderPosition(Vec2 location) // Update angle by using the direction of the location float angle = atan2f(dy, dx); - float angleDeg = CC_RADIANS_TO_DEGREES(angle) + 180.0f; + float angleDeg = AX_RADIANS_TO_DEGREES(angle) + 180.0f; // use the position / slider width to determine the percentage the dragger is at setHue(angleDeg); diff --git a/extensions/GUI/CCControlExtension/CCControlHuePicker.h b/extensions/GUI/CCControlExtension/CCControlHuePicker.h index 88f7bafad6..f5e311d864 100644 --- a/extensions/GUI/CCControlExtension/CCControlHuePicker.h +++ b/extensions/GUI/CCControlExtension/CCControlHuePicker.h @@ -47,7 +47,7 @@ NS_AX_EXT_BEGIN * @{ */ -class CC_EX_DLL ControlHuePicker : public Control +class AX_EX_DLL ControlHuePicker : public Control { public: static ControlHuePicker* create(Node* target, Vec2 pos); @@ -73,15 +73,15 @@ protected: bool checkSliderPosition(Vec2 location); // manually put in the setters - CC_SYNTHESIZE_READONLY(float, _hue, Hue); + AX_SYNTHESIZE_READONLY(float, _hue, Hue); virtual void setHue(float val); - CC_SYNTHESIZE_READONLY(float, _huePercentage, HuePercentage); + AX_SYNTHESIZE_READONLY(float, _huePercentage, HuePercentage); virtual void setHuePercentage(float val); // not sure if these need to be there actually. I suppose someone might want to access the sprite? - CC_SYNTHESIZE_RETAIN(Sprite*, _background, Background); - CC_SYNTHESIZE_RETAIN(Sprite*, _slider, Slider); - CC_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); + AX_SYNTHESIZE_RETAIN(Sprite*, _background, Background); + AX_SYNTHESIZE_RETAIN(Sprite*, _slider, Slider); + AX_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp index d74dc94af3..fb4408b485 100644 --- a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp +++ b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp @@ -37,8 +37,8 @@ ControlPotentiometer::ControlPotentiometer() ControlPotentiometer::~ControlPotentiometer() { - CC_SAFE_RELEASE(_thumbSprite); - CC_SAFE_RELEASE(_progressTimer); + AX_SAFE_RELEASE(_thumbSprite); + AX_SAFE_RELEASE(_progressTimer); } ControlPotentiometer* ControlPotentiometer::create(const char* backgroundFile, @@ -61,7 +61,7 @@ ControlPotentiometer* ControlPotentiometer::create(const char* backgroundFile, } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/GUI/CCControlExtension/CCControlPotentiometer.h b/extensions/GUI/CCControlExtension/CCControlPotentiometer.h index 8a6051821a..166d046393 100644 --- a/extensions/GUI/CCControlExtension/CCControlPotentiometer.h +++ b/extensions/GUI/CCControlExtension/CCControlPotentiometer.h @@ -43,7 +43,7 @@ NS_AX_EXT_BEGIN */ /** @class ControlPotentiometer Potentiometer control for Cocos2D. */ -class CC_EX_DLL ControlPotentiometer : public Control +class AX_EX_DLL ControlPotentiometer : public Control { public: /** @@ -110,9 +110,9 @@ protected: * The default value of this property is 1.0. */ float _maximumValue; - CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) - CC_SYNTHESIZE_RETAIN(ProgressTimer*, _progressTimer, ProgressTimer) - CC_SYNTHESIZE(Vec2, _previousLocation, PreviousLocation) + AX_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) + AX_SYNTHESIZE_RETAIN(ProgressTimer*, _progressTimer, ProgressTimer) + AX_SYNTHESIZE(Vec2, _previousLocation, PreviousLocation) }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h index c2a7df3f8d..a0063c5b40 100644 --- a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h +++ b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h @@ -47,19 +47,19 @@ NS_AX_EXT_BEGIN * @{ */ -class CC_EX_DLL ControlSaturationBrightnessPicker : public Control +class AX_EX_DLL ControlSaturationBrightnessPicker : public Control { /** Contains the receiver's current saturation value. */ - CC_SYNTHESIZE_READONLY(float, _saturation, Saturation); + AX_SYNTHESIZE_READONLY(float, _saturation, Saturation); /** Contains the receiver's current brightness value. */ - CC_SYNTHESIZE_READONLY(float, _brightness, Brightness); + AX_SYNTHESIZE_READONLY(float, _brightness, Brightness); // not sure if these need to be there actually. I suppose someone might want to access the sprite? - CC_SYNTHESIZE_READONLY(Sprite*, _background, Background); - CC_SYNTHESIZE_READONLY(Sprite*, _overlay, Overlay); - CC_SYNTHESIZE_READONLY(Sprite*, _shadow, Shadow); - CC_SYNTHESIZE_READONLY(Sprite*, _slider, Slider); - CC_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); + AX_SYNTHESIZE_READONLY(Sprite*, _background, Background); + AX_SYNTHESIZE_READONLY(Sprite*, _overlay, Overlay); + AX_SYNTHESIZE_READONLY(Sprite*, _shadow, Shadow); + AX_SYNTHESIZE_READONLY(Sprite*, _slider, Slider); + AX_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); protected: int boxPos; diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.cpp b/extensions/GUI/CCControlExtension/CCControlSlider.cpp index 16dbd88431..b831cfdea2 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSlider.cpp @@ -49,10 +49,10 @@ ControlSlider::ControlSlider() ControlSlider::~ControlSlider() { - CC_SAFE_RELEASE(_thumbSprite); - CC_SAFE_RELEASE(_selectedThumbSprite); - CC_SAFE_RELEASE(_progressSprite); - CC_SAFE_RELEASE(_backgroundSprite); + AX_SAFE_RELEASE(_thumbSprite); + AX_SAFE_RELEASE(_selectedThumbSprite); + AX_SAFE_RELEASE(_progressSprite); + AX_SAFE_RELEASE(_backgroundSprite); } ControlSlider* ControlSlider::create(const char* bgFile, const char* progressFile, const char* thumbFile) @@ -122,10 +122,10 @@ bool ControlSlider::initWithSprites(Sprite* backgroundSprite, { if (Control::init()) { - CCASSERT(backgroundSprite, "Background sprite must be not nil"); - CCASSERT(progressSprite, "Progress sprite must be not nil"); - CCASSERT(thumbSprite, "Thumb sprite must be not nil"); - CCASSERT(selectedThumbSprite, "Thumb sprite must be not nil"); + AXASSERT(backgroundSprite, "Background sprite must be not nil"); + AXASSERT(progressSprite, "Progress sprite must be not nil"); + AXASSERT(thumbSprite, "Thumb sprite must be not nil"); + AXASSERT(selectedThumbSprite, "Thumb sprite must be not nil"); setIgnoreAnchorPointForPosition(false); diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.h b/extensions/GUI/CCControlExtension/CCControlSlider.h index 482632da66..a48bc2dd6f 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.h +++ b/extensions/GUI/CCControlExtension/CCControlSlider.h @@ -44,7 +44,7 @@ NS_AX_EXT_BEGIN * @{ */ -class CC_EX_DLL ControlSlider : public Control +class AX_EX_DLL ControlSlider : public Control { public: /** @@ -138,24 +138,24 @@ protected: // manually put in the setters /** Contains the receiver's current value. */ - CC_SYNTHESIZE_READONLY(float, _value, Value); + AX_SYNTHESIZE_READONLY(float, _value, Value); /** Contains the minimum value of the receiver. * The default value of this property is 0.0. */ - CC_SYNTHESIZE_READONLY(float, _minimumValue, MinimumValue); + AX_SYNTHESIZE_READONLY(float, _minimumValue, MinimumValue); /** Contains the maximum value of the receiver. * The default value of this property is 1.0. */ - CC_SYNTHESIZE_READONLY(float, _maximumValue, MaximumValue); + AX_SYNTHESIZE_READONLY(float, _maximumValue, MaximumValue); - CC_SYNTHESIZE(float, _minimumAllowedValue, MinimumAllowedValue); - CC_SYNTHESIZE(float, _maximumAllowedValue, MaximumAllowedValue); + AX_SYNTHESIZE(float, _minimumAllowedValue, MinimumAllowedValue); + AX_SYNTHESIZE(float, _maximumAllowedValue, MaximumAllowedValue); // maybe this should be read-only - CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite); - CC_SYNTHESIZE_RETAIN(Sprite*, _selectedThumbSprite, SelectedThumbSprite); - CC_SYNTHESIZE_RETAIN(Sprite*, _progressSprite, ProgressSprite); - CC_SYNTHESIZE_RETAIN(Sprite*, _backgroundSprite, BackgroundSprite); + AX_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite); + AX_SYNTHESIZE_RETAIN(Sprite*, _selectedThumbSprite, SelectedThumbSprite); + AX_SYNTHESIZE_RETAIN(Sprite*, _progressSprite, ProgressSprite); + AX_SYNTHESIZE_RETAIN(Sprite*, _backgroundSprite, BackgroundSprite); }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlStepper.cpp b/extensions/GUI/CCControlExtension/CCControlStepper.cpp index 9c3fb23471..e2f1159849 100644 --- a/extensions/GUI/CCControlExtension/CCControlStepper.cpp +++ b/extensions/GUI/CCControlExtension/CCControlStepper.cpp @@ -60,18 +60,18 @@ ControlStepper::~ControlStepper() { unscheduleAllCallbacks(); - CC_SAFE_RELEASE(_minusSprite); - CC_SAFE_RELEASE(_plusSprite); - CC_SAFE_RELEASE(_minusLabel); - CC_SAFE_RELEASE(_plusLabel); + AX_SAFE_RELEASE(_minusSprite); + AX_SAFE_RELEASE(_plusSprite); + AX_SAFE_RELEASE(_minusLabel); + AX_SAFE_RELEASE(_plusLabel); } bool ControlStepper::initWithMinusSpriteAndPlusSprite(Sprite* minusSprite, Sprite* plusSprite) { if (Control::init()) { - CCASSERT(minusSprite, "Minus sprite must be not nil"); - CCASSERT(plusSprite, "Plus sprite must be not nil"); + AXASSERT(minusSprite, "Minus sprite must be not nil"); + AXASSERT(plusSprite, "Plus sprite must be not nil"); // Set the default values _autorepeat = true; @@ -124,7 +124,7 @@ ControlStepper* ControlStepper::create(Sprite* minusSprite, Sprite* plusSprite) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } @@ -148,7 +148,7 @@ void ControlStepper::setMinimumValue(double minimumValue) { if (minimumValue >= _maximumValue) { - CCASSERT(0, "Must be numerically less than maximumValue."); + AXASSERT(0, "Must be numerically less than maximumValue."); } _minimumValue = minimumValue; @@ -159,7 +159,7 @@ void ControlStepper::setMaximumValue(double maximumValue) { if (maximumValue <= _minimumValue) { - CCASSERT(0, "Must be numerically greater than minimumValue."); + AXASSERT(0, "Must be numerically greater than minimumValue."); } _maximumValue = maximumValue; @@ -180,7 +180,7 @@ void ControlStepper::setStepValue(double stepValue) { if (stepValue <= 0) { - CCASSERT(0, "Must be numerically greater than 0."); + AXASSERT(0, "Must be numerically greater than 0."); } _stepValue = stepValue; @@ -224,14 +224,14 @@ void ControlStepper::startAutorepeat() { _autorepeatCount = -1; - this->schedule(CC_SCHEDULE_SELECTOR(ControlStepper::update), kAutorepeatDeltaTime, CC_REPEAT_FOREVER, + this->schedule(AX_SCHEDULE_SELECTOR(ControlStepper::update), kAutorepeatDeltaTime, AX_REPEAT_FOREVER, kAutorepeatDeltaTime * 3); } /** Stop the autorepeat. */ void ControlStepper::stopAutorepeat() { - this->unschedule(CC_SCHEDULE_SELECTOR(ControlStepper::update)); + this->unschedule(AX_SCHEDULE_SELECTOR(ControlStepper::update)); } void ControlStepper::update(float /*dt*/) diff --git a/extensions/GUI/CCControlExtension/CCControlStepper.h b/extensions/GUI/CCControlExtension/CCControlStepper.h index b38e149b53..0c1a20a224 100644 --- a/extensions/GUI/CCControlExtension/CCControlStepper.h +++ b/extensions/GUI/CCControlExtension/CCControlStepper.h @@ -43,7 +43,7 @@ NS_AX_EXT_BEGIN * @{ */ -class CC_EX_DLL ControlStepper : public Control +class AX_EX_DLL ControlStepper : public Control { public: enum class Part @@ -113,10 +113,10 @@ protected: int _autorepeatCount; // Weak links to children - CC_SYNTHESIZE_RETAIN(Sprite*, _minusSprite, MinusSprite) - CC_SYNTHESIZE_RETAIN(Sprite*, _plusSprite, PlusSprite) - CC_SYNTHESIZE_RETAIN(Label*, _minusLabel, MinusLabel) - CC_SYNTHESIZE_RETAIN(Label*, _plusLabel, PlusLabel) + AX_SYNTHESIZE_RETAIN(Sprite*, _minusSprite, MinusSprite) + AX_SYNTHESIZE_RETAIN(Sprite*, _plusSprite, PlusSprite) + AX_SYNTHESIZE_RETAIN(Label*, _minusLabel, MinusLabel) + AX_SYNTHESIZE_RETAIN(Label*, _plusLabel, PlusLabel) }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp index 6ce82e48d8..8309e38c14 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp @@ -82,18 +82,18 @@ public: /** Contains the position (in x-axis) of the slider inside the receiver. */ float _sliderXPosition; - CC_SYNTHESIZE(float, _onPosition, OnPosition) - CC_SYNTHESIZE(float, _offPosition, OffPosition) + AX_SYNTHESIZE(float, _onPosition, OnPosition) + AX_SYNTHESIZE(float, _offPosition, OffPosition) - CC_SYNTHESIZE_RETAIN(Texture2D*, _maskTexture, MaskTexture) - CC_SYNTHESIZE(uint32_t, _textureLocation, TextureLocation) - CC_SYNTHESIZE(uint32_t, _maskLocation, MaskLocation) + AX_SYNTHESIZE_RETAIN(Texture2D*, _maskTexture, MaskTexture) + AX_SYNTHESIZE(uint32_t, _textureLocation, TextureLocation) + AX_SYNTHESIZE(uint32_t, _maskLocation, MaskLocation) - CC_SYNTHESIZE_RETAIN(Sprite*, _onSprite, OnSprite) - CC_SYNTHESIZE_RETAIN(Sprite*, _offSprite, OffSprite) - CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) - CC_SYNTHESIZE_RETAIN(Label*, _onLabel, OnLabel) - CC_SYNTHESIZE_RETAIN(Label*, _offLabel, OffLabel) + AX_SYNTHESIZE_RETAIN(Sprite*, _onSprite, OnSprite) + AX_SYNTHESIZE_RETAIN(Sprite*, _offSprite, OffSprite) + AX_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) + AX_SYNTHESIZE_RETAIN(Label*, _onLabel, OnLabel) + AX_SYNTHESIZE_RETAIN(Label*, _offLabel, OffLabel) Sprite* _clipperStencil; @@ -120,7 +120,7 @@ protected: Label* offLabel); private: - CC_DISALLOW_COPY_AND_ASSIGN(ControlSwitchSprite); + AX_DISALLOW_COPY_AND_ASSIGN(ControlSwitchSprite); }; ControlSwitchSprite* ControlSwitchSprite::create(Sprite* maskSprite, @@ -153,13 +153,13 @@ ControlSwitchSprite::ControlSwitchSprite() ControlSwitchSprite::~ControlSwitchSprite() { - CC_SAFE_RELEASE(_onSprite); - CC_SAFE_RELEASE(_offSprite); - CC_SAFE_RELEASE(_thumbSprite); - CC_SAFE_RELEASE(_onLabel); - CC_SAFE_RELEASE(_offLabel); - CC_SAFE_RELEASE(_maskTexture); - CC_SAFE_RELEASE(_clipperStencil); + AX_SAFE_RELEASE(_onSprite); + AX_SAFE_RELEASE(_offSprite); + AX_SAFE_RELEASE(_thumbSprite); + AX_SAFE_RELEASE(_onLabel); + AX_SAFE_RELEASE(_offLabel); + AX_SAFE_RELEASE(_maskTexture); + AX_SAFE_RELEASE(_clipperStencil); } bool ControlSwitchSprite::initWithMaskSprite(Sprite* maskSprite, @@ -216,7 +216,7 @@ bool ControlSwitchSprite::initWithMaskSprite(Sprite* maskSprite, void ControlSwitchSprite::updateTweenAction(float value, std::string_view key) { - CCLOGINFO("key = %s, value = %f", key.c_str(), value); + AXLOGINFO("key = %s, value = %f", key.c_str(), value); setSliderXPosition(value); } @@ -282,7 +282,7 @@ ControlSwitch::ControlSwitch() : _switchSprite(nullptr), _initialTouchXPosition( ControlSwitch::~ControlSwitch() { - CC_SAFE_RELEASE(_switchSprite); + AX_SAFE_RELEASE(_switchSprite); } bool ControlSwitch::initWithMaskSprite(Sprite* maskSprite, Sprite* onSprite, Sprite* offSprite, Sprite* thumbSprite) @@ -299,7 +299,7 @@ ControlSwitch* ControlSwitch::create(Sprite* maskSprite, Sprite* onSprite, Sprit } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } @@ -313,10 +313,10 @@ bool ControlSwitch::initWithMaskSprite(Sprite* maskSprite, { if (Control::init()) { - CCASSERT(maskSprite, "Mask must not be nil."); - CCASSERT(onSprite, "onSprite must not be nil."); - CCASSERT(offSprite, "offSprite must not be nil."); - CCASSERT(thumbSprite, "thumbSprite must not be nil."); + AXASSERT(maskSprite, "Mask must not be nil."); + AXASSERT(onSprite, "onSprite must not be nil."); + AXASSERT(offSprite, "offSprite must not be nil."); + AXASSERT(thumbSprite, "thumbSprite must not be nil."); _on = true; @@ -348,7 +348,7 @@ ControlSwitch* ControlSwitch::create(Sprite* maskSprite, } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.h b/extensions/GUI/CCControlExtension/CCControlSwitch.h index 3231a314c3..02ba46b79c 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.h +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.h @@ -50,7 +50,7 @@ class ControlSwitchSprite; */ /** @class ControlSwitch Switch control for Cocos2D. */ -class CC_EX_DLL ControlSwitch : public Control +class AX_EX_DLL ControlSwitch : public Control { public: /** Creates a switch with a mask sprite, on/off sprites for on/off states, a thumb sprite and an on/off labels. */ diff --git a/extensions/GUI/CCControlExtension/CCControlUtils.h b/extensions/GUI/CCControlExtension/CCControlUtils.h index 3d59cbcea3..4e3ded4d95 100644 --- a/extensions/GUI/CCControlExtension/CCControlUtils.h +++ b/extensions/GUI/CCControlExtension/CCControlUtils.h @@ -65,7 +65,7 @@ typedef struct */ // helper class to store Color3B's in mutable arrays -class CC_EX_DLL Color3bObject : public Ref +class AX_EX_DLL Color3bObject : public Ref { public: Color3B value; @@ -76,7 +76,7 @@ public: Color3bObject(Color3B s_value) : value(s_value) {} }; -class CC_EX_DLL ControlUtils +class AX_EX_DLL ControlUtils { public: /** diff --git a/extensions/GUI/CCControlExtension/CCInvocation.h b/extensions/GUI/CCControlExtension/CCInvocation.h index 1cfbd2c51d..931a3dd62e 100644 --- a/extensions/GUI/CCControlExtension/CCInvocation.h +++ b/extensions/GUI/CCControlExtension/CCInvocation.h @@ -49,7 +49,7 @@ NS_AX_EXT_BEGIN #define cccontrol_selector(_SELECTOR) static_cast(&_SELECTOR) -class CC_EX_DLL Invocation : public Ref +class AX_EX_DLL Invocation : public Ref { public: /** @@ -69,9 +69,9 @@ public: void invoke(Ref* sender); protected: - CC_SYNTHESIZE_READONLY(Control::Handler, _action, Action); - CC_SYNTHESIZE_READONLY(Ref*, _target, Target); - CC_SYNTHESIZE_READONLY(Control::EventType, _controlEvent, ControlEvent); + AX_SYNTHESIZE_READONLY(Control::Handler, _action, Action); + AX_SYNTHESIZE_READONLY(Ref*, _target, Target); + AX_SYNTHESIZE_READONLY(Control::EventType, _controlEvent, ControlEvent); }; // end of GUI group diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index d9331addda..d67dce7d3a 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -78,7 +78,7 @@ ScrollView* ScrollView::create(Size size, Node* container /* = nullptr*/) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } @@ -92,7 +92,7 @@ ScrollView* ScrollView::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } @@ -186,10 +186,10 @@ void ScrollView::setTouchEnabled(bool enabled) { _touchListener = EventListenerTouchOneByOne::create(); _touchListener->setSwallowTouches(true); - _touchListener->onTouchBegan = CC_CALLBACK_2(ScrollView::onTouchBegan, this); - _touchListener->onTouchMoved = CC_CALLBACK_2(ScrollView::onTouchMoved, this); - _touchListener->onTouchEnded = CC_CALLBACK_2(ScrollView::onTouchEnded, this); - _touchListener->onTouchCancelled = CC_CALLBACK_2(ScrollView::onTouchCancelled, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(ScrollView::onTouchBegan, this); + _touchListener->onTouchMoved = AX_CALLBACK_2(ScrollView::onTouchMoved, this); + _touchListener->onTouchEnded = AX_CALLBACK_2(ScrollView::onTouchEnded, this); + _touchListener->onTouchCancelled = AX_CALLBACK_2(ScrollView::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(_touchListener, this); } @@ -244,10 +244,10 @@ void ScrollView::setContentOffsetInDuration(Vec2 offset, float dt) stopAnimatedContentOffset(); } scroll = MoveTo::create(dt, offset); - expire = CallFuncN::create(CC_CALLBACK_1(ScrollView::stoppedAnimatedScroll, this)); + expire = CallFuncN::create(AX_CALLBACK_1(ScrollView::stoppedAnimatedScroll, this)); _animatedScrollAction = _container->runAction(Sequence::create(scroll, expire, nullptr)); _animatedScrollAction->retain(); - this->schedule(CC_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); + this->schedule(AX_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); } void ScrollView::stopAnimatedContentOffset() @@ -426,7 +426,7 @@ void ScrollView::deaccelerateScrolling(float /*dt*/) { if (_dragging) { - this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); + this->unschedule(AX_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); return; } @@ -458,14 +458,14 @@ void ScrollView::deaccelerateScrolling(float /*dt*/) ((_direction == Direction::BOTH || _direction == Direction::HORIZONTAL) && (newX >= maxInset.x || newX <= minInset.x))) { - this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); + this->unschedule(AX_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); this->relocateContainer(true); } } void ScrollView::stoppedAnimatedScroll(Node* /*node*/) { - this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); + this->unschedule(AX_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); // After the animation stopped, "scrollViewDidScroll" should be invoked, this could fix the bug of lack of tableview // cells. if (_delegate != nullptr) @@ -478,7 +478,7 @@ void ScrollView::performedAnimatedScroll(float /*dt*/) { if (_dragging) { - this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); + this->unschedule(AX_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); return; } @@ -568,7 +568,7 @@ void ScrollView::beforeDraw() // TODO: minggo // ScrollView don't support drawing in 3D space // _beforeDrawCommand.init(_globalZOrder); - // _beforeDrawCommand.func = CC_CALLBACK_0(ScrollView::onBeforeDraw, this); + // _beforeDrawCommand.func = AX_CALLBACK_0(ScrollView::onBeforeDraw, this); // Director::getInstance()->getRenderer()->addCommand(&_beforeDrawCommand); } @@ -610,7 +610,7 @@ void ScrollView::afterDraw() { // TODO: minggo // _afterDrawCommand.init(_globalZOrder); - // _afterDrawCommand.func = CC_CALLBACK_0(ScrollView::onAfterDraw, this); + // _afterDrawCommand.func = AX_CALLBACK_0(ScrollView::onAfterDraw, this); // Director::getInstance()->getRenderer()->addCommand(&_afterDrawCommand); } @@ -650,7 +650,7 @@ void ScrollView::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t // 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 Director* director = Director::getInstance(); - 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); @@ -795,7 +795,7 @@ void ScrollView::onTouchMoved(Touch* touch, Event* /*event*/) if (!_touchMoved && fabs(convertDistanceFromPointToInch(dis)) < MOVE_INCH) { - // CCLOG("Invalid movement, distance = [%f, %f], disInch = %f", moveDistance.x, moveDistance.y); + // AXLOG("Invalid movement, distance = [%f, %f], disInch = %f", moveDistance.x, moveDistance.y); return; } @@ -850,7 +850,7 @@ void ScrollView::onTouchEnded(Touch* touch, Event* /*event*/) { if (_touches.size() == 1 && _touchMoved) { - this->schedule(CC_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); + this->schedule(AX_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); } _touches.erase(touchIter); } diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index 8e90324f62..b5fb41f36a 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -41,7 +41,7 @@ NS_AX_EXT_BEGIN class ScrollView; -class CC_EX_DLL ScrollViewDelegate +class AX_EX_DLL ScrollViewDelegate { public: /** @@ -65,7 +65,7 @@ public: * ScrollView support for cocos2d-x. * It provides scroll view functionalities to cocos2d projects natively. */ -class CC_EX_DLL ScrollView : public Layer, public ActionTweenDelegate +class AX_EX_DLL ScrollView : public Layer, public ActionTweenDelegate { public: enum class Direction diff --git a/extensions/GUI/CCScrollView/CCTableView.cpp b/extensions/GUI/CCScrollView/CCTableView.cpp index 8b01add9ce..a634d809cb 100644 --- a/extensions/GUI/CCScrollView/CCTableView.cpp +++ b/extensions/GUI/CCScrollView/CCTableView.cpp @@ -71,7 +71,7 @@ bool TableView::initWithViewSize(Size size, Node* container /* = nullptr*/) { if (ScrollView::initWithViewSize(size, container)) { - CC_SAFE_DELETE(_indices); + AX_SAFE_DELETE(_indices); _indices = new std::set(); _vordering = VerticalFillOrder::BOTTOM_UP; this->setDirection(Direction::VERTICAL); @@ -93,7 +93,7 @@ TableView::TableView() TableView::~TableView() { - CC_SAFE_DELETE(_indices); + AX_SAFE_DELETE(_indices); } void TableView::setVerticalFillOrder(VerticalFillOrder fillOrder) @@ -162,7 +162,7 @@ TableViewCell* TableView::cellAtIndex(ssize_t idx) void TableView::updateCellAtIndex(ssize_t idx) { - if (idx == CC_INVALID_INDEX) + if (idx == AX_INVALID_INDEX) { return; } @@ -184,7 +184,7 @@ void TableView::updateCellAtIndex(ssize_t idx) void TableView::insertCellAtIndex(ssize_t idx) { - if (idx == CC_INVALID_INDEX) + if (idx == AX_INVALID_INDEX) { return; } @@ -220,7 +220,7 @@ void TableView::insertCellAtIndex(ssize_t idx) void TableView::removeCellAtIndex(ssize_t idx) { - if (idx == CC_INVALID_INDEX) + if (idx == AX_INVALID_INDEX) { return; } @@ -364,7 +364,7 @@ long TableView::_indexFromOffset(Vec2 offset) index = MAX(0, index); if (index > maxIdx) { - index = CC_INVALID_INDEX; + index = AX_INVALID_INDEX; } } @@ -494,7 +494,7 @@ void TableView::scrollViewDidScroll(ScrollView* /*view*/) offset.y = offset.y + _viewSize.height / this->getContainer()->getScaleY(); } startIdx = this->_indexFromOffset(offset); - if (startIdx == CC_INVALID_INDEX) + if (startIdx == AX_INVALID_INDEX) { startIdx = countOfItems - 1; } @@ -510,7 +510,7 @@ void TableView::scrollViewDidScroll(ScrollView* /*view*/) offset.x += _viewSize.width / this->getContainer()->getScaleX(); endIdx = this->_indexFromOffset(offset); - if (endIdx == CC_INVALID_INDEX) + if (endIdx == AX_INVALID_INDEX) { endIdx = countOfItems - 1; } @@ -633,7 +633,7 @@ bool TableView::onTouchBegan(Touch* pTouch, Event* pEvent) point = this->getContainer()->convertTouchToNodeSpace(pTouch); index = this->_indexFromOffset(point); - if (index == CC_INVALID_INDEX) + if (index == AX_INVALID_INDEX) { _touchedCell = nullptr; } diff --git a/extensions/GUI/CCScrollView/CCTableView.h b/extensions/GUI/CCScrollView/CCTableView.h index bcb9f1125b..972f3c3051 100644 --- a/extensions/GUI/CCScrollView/CCTableView.h +++ b/extensions/GUI/CCScrollView/CCTableView.h @@ -45,7 +45,7 @@ class TableView; /** * Sole purpose of this delegate is to single touch event in this version. */ -class CC_EX_DLL TableViewDelegate : public ScrollViewDelegate +class AX_EX_DLL TableViewDelegate : public ScrollViewDelegate { public: /** @@ -94,7 +94,7 @@ public: /** * Data source that governs table backend data. */ -class CC_EX_DLL TableViewDataSource +class AX_EX_DLL TableViewDataSource { public: /** @@ -137,7 +137,7 @@ public: * * This is a very basic, minimal implementation to bring UITableView-like component into cocos2d world. */ -class CC_EX_DLL TableView : public ScrollView, public ScrollViewDelegate +class AX_EX_DLL TableView : public ScrollView, public ScrollViewDelegate { public: enum class VerticalFillOrder diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.cpp b/extensions/GUI/CCScrollView/CCTableViewCell.cpp index da0280fe31..2c8a8ca2fd 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.cpp +++ b/extensions/GUI/CCScrollView/CCTableViewCell.cpp @@ -30,7 +30,7 @@ NS_AX_EXT_BEGIN void TableViewCell::reset() { - _idx = CC_INVALID_INDEX; + _idx = AX_INVALID_INDEX; } ssize_t TableViewCell::getIdx() const diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.h b/extensions/GUI/CCScrollView/CCTableViewCell.h index cd39fe5009..4b4b5a69ab 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.h +++ b/extensions/GUI/CCScrollView/CCTableViewCell.h @@ -40,7 +40,7 @@ NS_AX_EXT_BEGIN /** * Abstract class for SWTableView cell node */ -class CC_EX_DLL TableViewCell : public Node +class AX_EX_DLL TableViewCell : public Node { public: CREATE_FUNC(TableViewCell); diff --git a/extensions/ImGui/ImGuiPresenter.cpp b/extensions/ImGui/ImGuiPresenter.cpp index 8c78179a1e..8798301bf3 100644 --- a/extensions/ImGui/ImGuiPresenter.cpp +++ b/extensions/ImGui/ImGuiPresenter.cpp @@ -4,10 +4,10 @@ #include "imgui_internal.h" // TODO: mac metal -#if (defined(CC_USE_GL) || defined(CC_USE_GLES)) -# define CC_IMGUI_ENABLE_MULTI_VIEWPORT 1 +#if (defined(AX_USE_GL) || defined(AX_USE_GLES)) +# define AX_IMGUI_ENABLE_MULTI_VIEWPORT 1 #else -# define CC_IMGUI_ENABLE_MULTI_VIEWPORT 0 +# define AX_IMGUI_ENABLE_MULTI_VIEWPORT 0 #endif NS_AX_EXT_BEGIN @@ -33,7 +33,7 @@ class ImGuiSceneEventTracker : public ImGuiEventTracker public: bool initWithScene(Scene* scene) { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC _trackLayer = utils::newInstance(&Node::initLayer); // note: when at the first click to focus the window, this will not take effect @@ -75,7 +75,7 @@ public: ~ImGuiSceneEventTracker() { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC if (_trackLayer) { if (_trackLayer->getParent()) @@ -96,7 +96,7 @@ class ImGuiGlobalEventTracker : public ImGuiEventTracker public: bool init() { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC // note: when at the first click to focus the window, this will not take effect auto eventDispatcher = Director::getInstance()->getEventDispatcher(); @@ -122,7 +122,7 @@ public: ~ImGuiGlobalEventTracker() { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC auto eventDispatcher = Director::getInstance()->getEventDispatcher(); eventDispatcher->removeEventListener(_mouseListener); eventDispatcher->removeEventListener(_touchListener); @@ -172,7 +172,7 @@ void ImGuiPresenter::init() // io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking -#if CC_IMGUI_ENABLE_MULTI_VIEWPORT +#if AX_IMGUI_ENABLE_MULTI_VIEWPORT io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows #endif // io.ConfigViewportsNoAutoMerge = true; @@ -220,7 +220,7 @@ void ImGuiPresenter::cleanup() ImGui_ImplAxis_Shutdown(); ImGui_ImplGlfw_Shutdown(); - CC_SAFE_RELEASE_NULL(_fontsTexture); + AX_SAFE_RELEASE_NULL(_fontsTexture); ImGui::DestroyContext(); } @@ -253,7 +253,7 @@ void ImGuiPresenter::loadCustomFonts(void* ud) } auto fontData = FileUtils::getInstance()->getDataFromFile(fontInfo.first); - CCASSERT(!fontData.isNull(), "Cannot load font for IMGUI"); + AXASSERT(!fontData.isNull(), "Cannot load font for IMGUI"); ssize_t bufferSize = 0; auto* buffer = fontData.takeBuffer(&bufferSize); // Buffer automatically freed by IMGUI @@ -372,7 +372,7 @@ void ImGuiPresenter::endFrame() ImGui_ImplAxis_RenderPlatform(); --_beginFrames; - CC_SAFE_RELEASE_NULL(_fontsTexture); + AX_SAFE_RELEASE_NULL(_fontsTexture); } } diff --git a/extensions/ImGui/README.md b/extensions/ImGui/README.md index b1df1191a0..5890e1493b 100644 --- a/extensions/ImGui/README.md +++ b/extensions/ImGui/README.md @@ -26,7 +26,7 @@ public: ImGuiPresenter::getInstance()->addFont(R"(C:\Windows\Fonts\msyh.ttc)", ImGuiPresenter::DEFAULT_FONT_SIZE, ImGuiPresenter::CHS_GLYPH_RANGE::GENERAL); */ - ImGuiPresenter::getInstance()->addRenderLoop("#im01", CC_CALLBACK_0(GameScene::onImGuiDraw, this), this); + ImGuiPresenter::getInstance()->addRenderLoop("#im01", AX_CALLBACK_0(GameScene::onImGuiDraw, this), this); } void onExit() override { diff --git a/extensions/ImGui/imgui_impl_axis.cpp b/extensions/ImGui/imgui_impl_axis.cpp index 37b557e93e..2a40860240 100644 --- a/extensions/ImGui/imgui_impl_axis.cpp +++ b/extensions/ImGui/imgui_impl_axis.cpp @@ -1187,13 +1187,13 @@ static void ImGui_ImplGlfw_ShutdownPlatformInterface() ////////////////////////// axis spec ///////////////////////// -#define CC_PTR_CAST(v, pointer_type) reinterpret_cast(v) +#define AX_PTR_CAST(v, pointer_type) reinterpret_cast(v) // fps macro -#define CC_IMGUI_DEFAULT_DELTA (1 / 60.f) -#define CC_IMGUI_MIN_DELTA (1 / 1000.f) -#define CC_IMGUI_MAX_DELTA (1 / 30.f) +#define AX_IMGUI_DEFAULT_DELTA (1 / 60.f) +#define AX_IMGUI_MIN_DELTA (1 / 1000.f) +#define AX_IMGUI_MAX_DELTA (1 / 30.f) enum { @@ -1396,8 +1396,8 @@ static bool ImGui_ImplAxis_CreateDeviceObjects() static void ImGui_ImplAxis_DestroyDeviceObjects() { auto bd = ImGui_ImplGlfw_GetBackendData(); - CC_SAFE_RELEASE_NULL(bd->ProgramInfo.program); - CC_SAFE_RELEASE_NULL(bd->ProgramFontInfo.program); + AX_SAFE_RELEASE_NULL(bd->ProgramInfo.program); + AX_SAFE_RELEASE_NULL(bd->ProgramFontInfo.program); ImGui_ImplAxis_DestroyFontsTexture(); } @@ -1442,8 +1442,8 @@ static bool ImGui_ImplAxis_createShaderPrograms() auto bd = ImGui_ImplGlfw_GetBackendData(); - CC_SAFE_RELEASE(bd->ProgramInfo.program); - CC_SAFE_RELEASE(bd->ProgramFontInfo.program); + AX_SAFE_RELEASE(bd->ProgramInfo.program); + AX_SAFE_RELEASE(bd->ProgramFontInfo.program); bd->ProgramInfo.program = backend::Device::getInstance()->newProgram(vertex_shader, fragment_shader); bd->ProgramFontInfo.program = backend::Device::getInstance()->newProgram(vertex_shader, fragment_shader_font); IM_ASSERT(bd->ProgramInfo.program); @@ -1486,7 +1486,7 @@ bool ImGui_ImplAxis_CreateFontsTexture() // consider calling GetTexDataAsAlpha8() instead to save on GPU memory. io.Fonts->GetTexDataAsAlpha8(&pixels, &width, &height); - CC_SAFE_RELEASE(bd->FontTexture); + AX_SAFE_RELEASE(bd->FontTexture); bd->FontTexture = new Texture2D(); bd->FontTexture->setAntiAliasTexParameters(); @@ -1501,7 +1501,7 @@ IMGUI_IMPL_API void ImGui_ImplAxis_DestroyFontsTexture() if (bd->FontTexture) { ImGui::GetIO().Fonts->TexID = nullptr; - CC_SAFE_RELEASE_NULL(bd->FontTexture); + AX_SAFE_RELEASE_NULL(bd->FontTexture); } } @@ -1640,7 +1640,7 @@ IMGUI_IMPL_API void ImGui_ImplAxis_RenderDrawData(ImDrawData* draw_data) if (typeid(*((Ref*)pcmd->TextureId)) == typeid(Texture2D)) { - auto tex = CC_PTR_CAST(pcmd->TextureId, Texture2D*); + auto tex = AX_PTR_CAST(pcmd->TextureId, Texture2D*); auto cmd = std::make_shared(); bd->CustomCommands.push_back(cmd); cmd->init(0.f, BlendFunc::ALPHA_NON_PREMULTIPLIED); @@ -1667,7 +1667,7 @@ IMGUI_IMPL_API void ImGui_ImplAxis_RenderDrawData(ImDrawData* draw_data) } else { - auto node = CC_PTR_CAST(pcmd->TextureId, Node*); + auto node = AX_PTR_CAST(pcmd->TextureId, Node*); const auto tr = node->getNodeToParentTransform(); node->setVisible(true); node->setNodeToParentTransform(tr); diff --git a/extensions/Live2D/Framework/src/Rendering/axis/CubismOffscreenSurface_Cocos2dx.cpp b/extensions/Live2D/Framework/src/Rendering/axis/CubismOffscreenSurface_Cocos2dx.cpp index cf76d05743..a5edc5f81e 100644 --- a/extensions/Live2D/Framework/src/Rendering/axis/CubismOffscreenSurface_Cocos2dx.cpp +++ b/extensions/Live2D/Framework/src/Rendering/axis/CubismOffscreenSurface_Cocos2dx.cpp @@ -146,7 +146,7 @@ void CubismOffscreenFrame_Cocos2dx::DestroyOffscreenFrame() { if ((_renderTexture != NULL) && !_isInheritedRenderTexture) { - CC_SAFE_RELEASE_NULL(_renderTexture); + AX_SAFE_RELEASE_NULL(_renderTexture); _colorBuffer = NULL; } } diff --git a/extensions/Live2D/Framework/src/Rendering/axis/CubismRenderer_Cocos2dx.cpp b/extensions/Live2D/Framework/src/Rendering/axis/CubismRenderer_Cocos2dx.cpp index ee3fe99663..538dfb3052 100644 --- a/extensions/Live2D/Framework/src/Rendering/axis/CubismRenderer_Cocos2dx.cpp +++ b/extensions/Live2D/Framework/src/Rendering/axis/CubismRenderer_Cocos2dx.cpp @@ -745,7 +745,7 @@ void CubismShader_Cocos2dx::ReleaseShaderProgram() // SetupMask static const csmChar* VertShaderSrcSetupMask = -#if !defined(CC_PLATFORM_MOBILE) && !defined(CC_USE_GLES) +#if !defined(AX_PLATFORM_MOBILE) && !defined(AX_USE_GLES) "#version 120\n" #endif "attribute vec2 a_position;" @@ -777,7 +777,7 @@ static const csmChar* FragShaderSrcSetupMask = "gl_FragColor = u_channelFlag * texture2D(s_texture0 , v_texCoord).a * isInside;" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcSetupMaskTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" @@ -801,7 +801,7 @@ static const csmChar* FragShaderSrcSetupMaskTegra = //----- バーテックスシェーダプログラム ----- // Normal & Add & Mult 共通 static const csmChar* VertShaderSrc = -#if !defined(CC_PLATFORM_MOBILE) && !defined(CC_USE_GLES) +#if !defined(AX_PLATFORM_MOBILE) && !defined(AX_USE_GLES) "#version 120\n" #endif "attribute vec2 a_position;" //v.vertex @@ -818,7 +818,7 @@ static const csmChar* VertShaderSrc = // Normal & Add & Mult 共通(クリッピングされたものの描画用) static const csmChar* VertShaderSrcMasked = -#if !defined(CC_PLATFORM_MOBILE) && !defined(CC_USE_GLES) +#if !defined(AX_PLATFORM_MOBILE) && !defined(AX_USE_GLES) "#version 120\n" #endif "attribute vec2 a_position;" @@ -832,7 +832,7 @@ static const csmChar* VertShaderSrcMasked = "vec4 pos = vec4(a_position.x, a_position.y, 0.0, 1.0);" "gl_Position = u_matrix * pos;" "v_clipPos = u_clipMatrix * pos;" -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) "v_clipPos = vec4(v_clipPos.x, 1.0 - v_clipPos.y, v_clipPos.zw);" #endif "v_texCoord = a_texCoord;" @@ -850,7 +850,7 @@ static const csmChar* FragShaderSrc = "vec4 color = texture2D(s_texture0 , v_texCoord) * u_baseColor;" "gl_FragColor = vec4(color.rgb * color.a, color.a);" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" @@ -873,7 +873,7 @@ static const csmChar* FragShaderSrcPremultipliedAlpha = "{" "gl_FragColor = texture2D(s_texture0 , v_texCoord) * u_baseColor;" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcPremultipliedAlphaTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" @@ -903,7 +903,7 @@ static const csmChar* FragShaderSrcMask = "col_formask = col_formask * maskVal;" "gl_FragColor = col_formask;" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcMaskTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" @@ -941,7 +941,7 @@ static const csmChar* FragShaderSrcMaskInverted = "col_formask = col_formask * (1.0 - maskVal);" "gl_FragColor = col_formask;" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcMaskInvertedTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" @@ -978,7 +978,7 @@ static const csmChar* FragShaderSrcMaskPremultipliedAlpha = "col_formask = col_formask * maskVal;" "gl_FragColor = col_formask;" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcMaskPremultipliedAlphaTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" @@ -1014,7 +1014,7 @@ static const csmChar* FragShaderSrcMaskInvertedPremultipliedAlpha = "col_formask = col_formask * (1.0 - maskVal);" "gl_FragColor = col_formask;" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcMaskInvertedPremultipliedAlphaTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" diff --git a/extensions/Particle3D/CCParticle3DAffector.h b/extensions/Particle3D/CCParticle3DAffector.h index 6889673261..3f44cade54 100644 --- a/extensions/Particle3D/CCParticle3DAffector.h +++ b/extensions/Particle3D/CCParticle3DAffector.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PARTICLE_3D_AFFECTOR_H__ -#define __CC_PARTICLE_3D_AFFECTOR_H__ +#ifndef __AX_PARTICLE_3D_AFFECTOR_H__ +#define __AX_PARTICLE_3D_AFFECTOR_H__ #include "base/CCRef.h" #include @@ -35,7 +35,7 @@ NS_AX_BEGIN class ParticleSystem3D; struct Particle3D; -class CC_EX_DLL Particle3DAffector : public Ref +class AX_EX_DLL Particle3DAffector : public Ref { friend class ParticleSystem3D; diff --git a/extensions/Particle3D/CCParticle3DEmitter.h b/extensions/Particle3D/CCParticle3DEmitter.h index ea84104aae..040d163728 100644 --- a/extensions/Particle3D/CCParticle3DEmitter.h +++ b/extensions/Particle3D/CCParticle3DEmitter.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PARTICLE_3D_EMITTER_H__ -#define __CC_PARTICLE_3D_EMITTER_H__ +#ifndef __AX_PARTICLE_3D_EMITTER_H__ +#define __AX_PARTICLE_3D_EMITTER_H__ #include "base/CCRef.h" #include @@ -37,7 +37,7 @@ struct Particle3D; /** * 3d particle emitter */ -class CC_EX_DLL Particle3DEmitter : public Ref +class AX_EX_DLL Particle3DEmitter : public Ref { friend class ParticleSystem3D; diff --git a/extensions/Particle3D/CCParticle3DRender.cpp b/extensions/Particle3D/CCParticle3DRender.cpp index fe378faf5b..06e884c3a9 100644 --- a/extensions/Particle3D/CCParticle3DRender.cpp +++ b/extensions/Particle3D/CCParticle3DRender.cpp @@ -45,10 +45,10 @@ Particle3DQuadRender::Particle3DQuadRender() Particle3DQuadRender::~Particle3DQuadRender() { - // CC_SAFE_RELEASE(_texture); - CC_SAFE_RELEASE(_programState); - CC_SAFE_RELEASE(_vertexBuffer); - CC_SAFE_RELEASE(_indexBuffer); + // AX_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_indexBuffer); } Particle3DQuadRender* Particle3DQuadRender::create(std::string_view texFile) @@ -61,7 +61,7 @@ Particle3DQuadRender* Particle3DQuadRender::create(std::string_view texFile) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -82,7 +82,7 @@ void Particle3DQuadRender::render(Renderer* renderer, const Mat4& transform, Par backend::BufferType::VERTEX, backend::BufferUsage::DYNAMIC); if (_vertexBuffer == nullptr) { - CCLOG("Particle3DQuadRender::render create vertex buffer failed"); + AXLOG("Particle3DQuadRender::render create vertex buffer failed"); return; } } @@ -94,7 +94,7 @@ void Particle3DQuadRender::render(Renderer* renderer, const Mat4& transform, Par backend::BufferType::INDEX, backend::BufferUsage::DYNAMIC); if (_indexBuffer == nullptr) { - CCLOG("Particle3DQuadRender::render create index buffer failed"); + AXLOG("Particle3DQuadRender::render create index buffer failed"); return; } } @@ -167,8 +167,8 @@ void Particle3DQuadRender::render(Renderer* renderer, const Mat4& transform, Par auto afterCommand = renderer->nextCallbackCommand(); afterCommand->init(depthZ); - beforeCommand->func = [=]() { onBeforeDraw(); }; // CC_CALLBACK_0(Particle3DQuadRender::onBeforeDraw, this); - afterCommand->func = [=]() { onAfterDraw(); }; // CC_CALLBACK_0(Particle3DQuadRender::onAfterDraw, this); + beforeCommand->func = [=]() { onBeforeDraw(); }; // AX_CALLBACK_0(Particle3DQuadRender::onBeforeDraw, this); + afterCommand->func = [=]() { onAfterDraw(); }; // AX_CALLBACK_0(Particle3DQuadRender::onAfterDraw, this); _meshCommand.setVertexBuffer(_vertexBuffer); _meshCommand.setIndexBuffer(_indexBuffer, MeshCommand::IndexFormat::U_SHORT); @@ -193,7 +193,7 @@ void Particle3DQuadRender::render(Renderer* renderer, const Mat4& transform, Par bool Particle3DQuadRender::initQuadRender(std::string_view texFile) { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); if (!texFile.empty()) { @@ -309,7 +309,7 @@ void Particle3DModelRender::render(Renderer* renderer, const Mat4& transform, Pa MeshRenderer* mesh = MeshRenderer::create(_modelFile); if (mesh == nullptr) { - CCLOG("failed to load file %s", _modelFile.c_str()); + AXLOG("failed to load file %s", _modelFile.c_str()); continue; } mesh->setTexture(_texFile); diff --git a/extensions/Particle3D/CCParticle3DRender.h b/extensions/Particle3D/CCParticle3DRender.h index eff20b1857..9e2049f0ed 100644 --- a/extensions/Particle3D/CCParticle3DRender.h +++ b/extensions/Particle3D/CCParticle3DRender.h @@ -50,7 +50,7 @@ class Texture2D; /** * 3d particle render */ -class CC_EX_DLL Particle3DRender : public Ref +class AX_EX_DLL Particle3DRender : public Ref { friend class ParticleSystem3D; @@ -92,7 +92,7 @@ protected: }; // particle render for quad -class CC_EX_DLL Particle3DQuadRender : public Particle3DRender +class AX_EX_DLL Particle3DQuadRender : public Particle3DRender { public: static Particle3DQuadRender* create(std::string_view texFile = ""); @@ -142,7 +142,7 @@ protected: }; // particle renderer using MeshRenderer -class CC_EX_DLL Particle3DModelRender : public Particle3DRender +class AX_EX_DLL Particle3DModelRender : public Particle3DRender { public: static Particle3DModelRender* create(std::string_view modelFile, std::string_view texFile = ""); diff --git a/extensions/Particle3D/CCParticleSystem3D.cpp b/extensions/Particle3D/CCParticleSystem3D.cpp index 845cfdac0c..a2bc66b5f0 100644 --- a/extensions/Particle3D/CCParticleSystem3D.cpp +++ b/extensions/Particle3D/CCParticleSystem3D.cpp @@ -48,8 +48,8 @@ ParticleSystem3D::~ParticleSystem3D() { // stopParticle(); removeAllAffector(); - CC_SAFE_RELEASE(_emitter); - CC_SAFE_RELEASE(_render); + AX_SAFE_RELEASE(_emitter); + AX_SAFE_RELEASE(_render); } void ParticleSystem3D::startParticleSystem() @@ -96,10 +96,10 @@ void ParticleSystem3D::setEmitter(Particle3DEmitter* emitter) { if (_emitter != emitter) { - CC_SAFE_RELEASE(_emitter); + AX_SAFE_RELEASE(_emitter); emitter->_particleSystem = this; _emitter = emitter; - CC_SAFE_RETAIN(_emitter); + AX_SAFE_RETAIN(_emitter); } } @@ -107,10 +107,10 @@ void ParticleSystem3D::setRender(Particle3DRender* render) { if (_render != render) { - CC_SAFE_RELEASE(_render); + AX_SAFE_RELEASE(_render); _render = render; _render->_particleSystem = this; - CC_SAFE_RETAIN(_render); + AX_SAFE_RETAIN(_render); } } @@ -126,7 +126,7 @@ void ParticleSystem3D::addAffector(Particle3DAffector* affector) void ParticleSystem3D::removeAffector(int index) { - CCASSERT((unsigned int)index < _affectors.size(), "wrong index"); + AXASSERT((unsigned int)index < _affectors.size(), "wrong index"); _affectors.erase(_affectors.begin() + index); } @@ -142,7 +142,7 @@ void ParticleSystem3D::removeAllAffector() Particle3DAffector* ParticleSystem3D::getAffector(int index) { - CCASSERT(index < (int)_affectors.size(), "wrong index"); + AXASSERT(index < (int)_affectors.size(), "wrong index"); return _affectors[index]; } diff --git a/extensions/Particle3D/CCParticleSystem3D.h b/extensions/Particle3D/CCParticleSystem3D.h index fcb0e126d9..4bca820146 100644 --- a/extensions/Particle3D/CCParticleSystem3D.h +++ b/extensions/Particle3D/CCParticleSystem3D.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PARTICLE_SYSTEM_3D_H__ -#define __CC_PARTICLE_SYSTEM_3D_H__ +#ifndef __AX_PARTICLE_SYSTEM_3D_H__ +#define __AX_PARTICLE_SYSTEM_3D_H__ #include "2d/CCNode.h" #include "math/CCMath.h" @@ -42,7 +42,7 @@ class Particle3DEmitter; class Particle3DAffector; class Particle3DRender; -struct CC_EX_DLL Particle3D +struct AX_EX_DLL Particle3D { Particle3D(); virtual ~Particle3D(); @@ -61,7 +61,7 @@ struct CC_EX_DLL Particle3D }; template -class CC_EX_DLL DataPool +class AX_EX_DLL DataPool { public: typedef typename std::list PoolList; @@ -157,7 +157,7 @@ private: typedef DataPool ParticlePool; -class CC_EX_DLL ParticleSystem3D : public Node, public BlendProtocol +class AX_EX_DLL ParticleSystem3D : public Node, public BlendProtocol { public: enum class State diff --git a/extensions/Particle3D/PU/CCPUAffector.h b/extensions/Particle3D/PU/CCPUAffector.h index a76f174f62..318aea6c0a 100644 --- a/extensions/Particle3D/PU/CCPUAffector.h +++ b/extensions/Particle3D/PU/CCPUAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_AFFECTOR_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUAffector : public Particle3DAffector +class AX_EX_DLL PUAffector : public Particle3DAffector { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/PU/CCPUAffectorManager.h b/extensions/Particle3D/PU/CCPUAffectorManager.h index 86979b25cc..f98e7261ab 100644 --- a/extensions/Particle3D/PU/CCPUAffectorManager.h +++ b/extensions/Particle3D/PU/CCPUAffectorManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" @@ -59,7 +59,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUAffectorManager +class AX_EX_DLL PUAffectorManager { public: static PUAffectorManager* Instance(); diff --git a/extensions/Particle3D/PU/CCPUAffectorTranslator.h b/extensions/Particle3D/PU/CCPUAffectorTranslator.h index 8abfb0261b..44063be30a 100644 --- a/extensions/Particle3D/PU/CCPUAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUAffectorTranslator : public PUScriptTranslator +class AX_EX_DLL PUAffectorTranslator : public PUScriptTranslator { protected: PUAffector* _affector; diff --git a/extensions/Particle3D/PU/CCPUAlignAffector.h b/extensions/Particle3D/PU/CCPUAlignAffector.h index 478382ac9d..d80beaf57f 100644 --- a/extensions/Particle3D/PU/CCPUAlignAffector.h +++ b/extensions/Particle3D/PU/CCPUAlignAffector.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ALIGN_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_ALIGN_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ALIGN_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_ALIGN_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" NS_AX_BEGIN -class CC_EX_DLL PUAlignAffector : public PUAffector +class AX_EX_DLL PUAlignAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUAlignAffectorTranslator.h b/extensions/Particle3D/PU/CCPUAlignAffectorTranslator.h index f0437c70ef..f80817f7b4 100644 --- a/extensions/Particle3D/PU/CCPUAlignAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUAlignAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ALIGN_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ALIGN_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ALIGN_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ALIGN_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUAlignAffectorTranslator : public PUScriptTranslator +class AX_EX_DLL PUAlignAffectorTranslator : public PUScriptTranslator { public: PUAlignAffectorTranslator(); diff --git a/extensions/Particle3D/PU/CCPUBaseCollider.cpp b/extensions/Particle3D/PU/CCPUBaseCollider.cpp index 6d74ffb453..721f64a55e 100644 --- a/extensions/Particle3D/PU/CCPUBaseCollider.cpp +++ b/extensions/Particle3D/PU/CCPUBaseCollider.cpp @@ -104,7 +104,7 @@ void PUBaseCollider::calculateRotationSpeedAfterCollision(PUParticle3D* particle if (particle->particleType != PUParticle3D::PT_VISUAL) return; - float signedFriction = CCRANDOM_0_1() > 0.5f ? -(_friction - 1) : (_friction - 1); + float signedFriction = AXRANDOM_0_1() > 0.5f ? -(_friction - 1) : (_friction - 1); particle->rotationSpeed *= signedFriction; particle->zRotationSpeed *= signedFriction; diff --git a/extensions/Particle3D/PU/CCPUBaseCollider.h b/extensions/Particle3D/PU/CCPUBaseCollider.h index 739c92c621..2f09f89adb 100644 --- a/extensions/Particle3D/PU/CCPUBaseCollider.h +++ b/extensions/Particle3D/PU/CCPUBaseCollider.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BASE_COLLIDER_H__ -#define __CC_PU_PARTICLE_3D_BASE_COLLIDER_H__ +#ifndef __AX_PU_PARTICLE_3D_BASE_COLLIDER_H__ +#define __AX_PU_PARTICLE_3D_BASE_COLLIDER_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "3d/CCAABB.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN struct PUParticle3D; -class CC_EX_DLL PUBaseCollider : public PUAffector +class AX_EX_DLL PUBaseCollider : public PUAffector { public: /** Determines how a particle collision should be determined. IT_POINT means that the position of diff --git a/extensions/Particle3D/PU/CCPUBaseColliderTranslator.h b/extensions/Particle3D/PU/CCPUBaseColliderTranslator.h index cee8a94671..f8dfd22c4e 100644 --- a/extensions/Particle3D/PU/CCPUBaseColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUBaseColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BASE_COLLIDER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_BASE_COLLIDER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_BASE_COLLIDER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_BASE_COLLIDER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUBaseColliderTranslator : public PUScriptTranslator +class AX_EX_DLL PUBaseColliderTranslator : public PUScriptTranslator { public: PUBaseColliderTranslator(); diff --git a/extensions/Particle3D/PU/CCPUBaseForceAffector.h b/extensions/Particle3D/PU/CCPUBaseForceAffector.h index 05358425e1..f7d22b95fa 100644 --- a/extensions/Particle3D/PU/CCPUBaseForceAffector.h +++ b/extensions/Particle3D/PU/CCPUBaseForceAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BASE_FORCE_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_BASE_FORCE_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_BASE_FORCE_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_BASE_FORCE_AFFECTOR_H__ #include "math/CCMath.h" #include "extensions/Particle3D/PU/CCPUAffector.h" NS_AX_BEGIN -class CC_EX_DLL PUBaseForceAffector : public PUAffector +class AX_EX_DLL PUBaseForceAffector : public PUAffector { public: enum ForceApplication diff --git a/extensions/Particle3D/PU/CCPUBaseForceAffectorTranslator.h b/extensions/Particle3D/PU/CCPUBaseForceAffectorTranslator.h index 101eca3c83..339eb635f1 100644 --- a/extensions/Particle3D/PU/CCPUBaseForceAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUBaseForceAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BASE_FORCE_AFFECT_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_BASE_FORCE_AFFECT_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_BASE_FORCE_AFFECT_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_BASE_FORCE_AFFECT_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUBaseForceAffectorTranslator : public PUScriptTranslator +class AX_EX_DLL PUBaseForceAffectorTranslator : public PUScriptTranslator { public: PUBaseForceAffectorTranslator(); diff --git a/extensions/Particle3D/PU/CCPUBeamRender.cpp b/extensions/Particle3D/PU/CCPUBeamRender.cpp index b8696c2be6..757dc4fec5 100644 --- a/extensions/Particle3D/PU/CCPUBeamRender.cpp +++ b/extensions/Particle3D/PU/CCPUBeamRender.cpp @@ -305,7 +305,7 @@ void PUBeamRender::updateRender(PUParticle3D* particle, float deltaTime, bool /* float divide = (float)_numberOfSegments + 1.0f; for (size_t numDev = 0; numDev < _numberOfSegments; ++numDev) { - Vec3::cross(end, Vec3(CCRANDOM_MINUS1_1(), CCRANDOM_MINUS1_1(), CCRANDOM_MINUS1_1()), &perpendicular); + Vec3::cross(end, Vec3(AXRANDOM_MINUS1_1(), AXRANDOM_MINUS1_1(), AXRANDOM_MINUS1_1()), &perpendicular); perpendicular.normalize(); beamRendererVisualData->destinationHalf[numDev] = (((float)numDev + 1.0f) / divide) * end + Vec3(_rendererScale.x * _deviation * perpendicular.x, @@ -340,7 +340,7 @@ void PUBeamRender::destroyAll() static_cast(_particleSystem)->removeListener(this); // Delete the BillboardChain - CC_SAFE_DELETE(_billboardChain); + AX_SAFE_DELETE(_billboardChain); // Delete the visual data std::vector::const_iterator it; diff --git a/extensions/Particle3D/PU/CCPUBeamRender.h b/extensions/Particle3D/PU/CCPUBeamRender.h index cb567edd5f..56c55bb6c7 100644 --- a/extensions/Particle3D/PU/CCPUBeamRender.h +++ b/extensions/Particle3D/PU/CCPUBeamRender.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BEAM_RENDER_H__ -#define __CC_PU_PARTICLE_3D_BEAM_RENDER_H__ +#ifndef __AX_PU_PARTICLE_3D_BEAM_RENDER_H__ +#define __AX_PU_PARTICLE_3D_BEAM_RENDER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -76,7 +76,7 @@ public: }; // particle render for quad -class CC_EX_DLL PUBeamRender : public PURender, public PUListener +class AX_EX_DLL PUBeamRender : public PURender, public PUListener { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUBehaviour.h b/extensions/Particle3D/PU/CCPUBehaviour.h index 37e5dc4edc..85a1b8b52c 100644 --- a/extensions/Particle3D/PU/CCPUBehaviour.h +++ b/extensions/Particle3D/PU/CCPUBehaviour.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BEHAVIOUR_H__ -#define __CC_PU_PARTICLE_3D_BEHAVIOUR_H__ +#ifndef __AX_PU_PARTICLE_3D_BEHAVIOUR_H__ +#define __AX_PU_PARTICLE_3D_BEHAVIOUR_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUBehaviour : public Ref +class AX_EX_DLL PUBehaviour : public Ref { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/PU/CCPUBehaviourManager.h b/extensions/Particle3D/PU/CCPUBehaviourManager.h index f56d3085d3..3e9081ec59 100644 --- a/extensions/Particle3D/PU/CCPUBehaviourManager.h +++ b/extensions/Particle3D/PU/CCPUBehaviourManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUBehaviourTranslator.h b/extensions/Particle3D/PU/CCPUBehaviourTranslator.h index 7b5a3a91c5..1ea887043b 100644 --- a/extensions/Particle3D/PU/CCPUBehaviourTranslator.h +++ b/extensions/Particle3D/PU/CCPUBehaviourTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BEHAVIOUR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_BEHAVIOUR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_BEHAVIOUR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_BEHAVIOUR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUBillboardChain.cpp b/extensions/Particle3D/PU/CCPUBillboardChain.cpp index fff5ec20ff..723e6d2334 100644 --- a/extensions/Particle3D/PU/CCPUBillboardChain.cpp +++ b/extensions/Particle3D/PU/CCPUBillboardChain.cpp @@ -91,10 +91,10 @@ PUBillboardChain::PUBillboardChain(std::string_view /*name*/, //----------------------------------------------------------------------- PUBillboardChain::~PUBillboardChain() { - // CC_SAFE_RELEASE(_texture); - CC_SAFE_RELEASE(_programState); - CC_SAFE_RELEASE(_vertexBuffer); - CC_SAFE_RELEASE(_indexBuffer); + // AX_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_indexBuffer); } //----------------------------------------------------------------------- void PUBillboardChain::setupChainContainers() @@ -153,8 +153,8 @@ void PUBillboardChain::setupBuffers() // setupVertexDeclaration(); if (_buffersNeedRecreating) { - CC_SAFE_RELEASE_NULL(_vertexBuffer); - CC_SAFE_RELEASE_NULL(_indexBuffer); + AX_SAFE_RELEASE_NULL(_vertexBuffer); + AX_SAFE_RELEASE_NULL(_indexBuffer); size_t stride = sizeof(VertexInfo); _vertexBuffer = backend::Device::getInstance()->newBuffer( @@ -240,7 +240,7 @@ void PUBillboardChain::setDynamic(bool dyn) //----------------------------------------------------------------------- void PUBillboardChain::addChainElement(size_t chainIndex, const PUBillboardChain::Element& dtls) { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); ChainSegment& seg = _chainSegmentList[chainIndex]; if (seg.head == SEGMENT_EMPTY) { @@ -285,7 +285,7 @@ void PUBillboardChain::addChainElement(size_t chainIndex, const PUBillboardChain //----------------------------------------------------------------------- void PUBillboardChain::removeChainElement(size_t chainIndex) { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); ChainSegment& seg = _chainSegmentList[chainIndex]; if (seg.head == SEGMENT_EMPTY) return; // do nothing, nothing to remove @@ -315,7 +315,7 @@ void PUBillboardChain::removeChainElement(size_t chainIndex) //----------------------------------------------------------------------- void PUBillboardChain::clearChain(size_t chainIndex) { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); ChainSegment& seg = _chainSegmentList[chainIndex]; // Just reset head & tail @@ -348,9 +348,9 @@ void PUBillboardChain::setFaceCamera(bool faceCamera, const Vec3& normalVector) //----------------------------------------------------------------------- void PUBillboardChain::updateChainElement(size_t chainIndex, size_t elementIndex, const PUBillboardChain::Element& dtls) { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); ChainSegment& seg = _chainSegmentList[chainIndex]; - CCASSERT(seg.head != SEGMENT_EMPTY, "Chain segment is empty"); + AXASSERT(seg.head != SEGMENT_EMPTY, "Chain segment is empty"); size_t idx = seg.head + elementIndex; // adjust for the edge and start @@ -368,7 +368,7 @@ void PUBillboardChain::updateChainElement(size_t chainIndex, size_t elementIndex //----------------------------------------------------------------------- const PUBillboardChain::Element& PUBillboardChain::getChainElement(size_t chainIndex, size_t elementIndex) const { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); const ChainSegment& seg = _chainSegmentList[chainIndex]; size_t idx = seg.head + elementIndex; @@ -380,7 +380,7 @@ const PUBillboardChain::Element& PUBillboardChain::getChainElement(size_t chainI //----------------------------------------------------------------------- size_t PUBillboardChain::getNumChainElements(size_t chainIndex) const { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); const ChainSegment& seg = _chainSegmentList[chainIndex]; if (seg.tail < seg.head) @@ -431,7 +431,7 @@ void PUBillboardChain::updateVertexBuffer(const Mat4& camMat) e = 0; Element& elem = _chainElementList[e + seg.start]; - CCASSERT(((e + seg.start) * 2) < 65536, "Too many elements!"); + AXASSERT(((e + seg.start) * 2) < 65536, "Too many elements!"); unsigned short vertexIndex = static_cast((e + seg.start) * 2); //// Determine base pointer to vertex #1 // void* pBase = static_cast( @@ -594,7 +594,7 @@ void PUBillboardChain::updateIndexBuffer() e = 0; // indexes of this element are (e * 2) and (e * 2) + 1 // indexes of the last element are the same, -2 - CCASSERT(((e + seg.start) * 2) < 65536, "Too many elements!"); + AXASSERT(((e + seg.start) * 2) < 65536, "Too many elements!"); unsigned short baseIdx = static_cast((e + seg.start) * 2); unsigned short lastBaseIdx = static_cast((laste + seg.start) * 2); @@ -629,7 +629,7 @@ void PUBillboardChain::updateIndexBuffer() //----------------------------------------------------------------------- void PUBillboardChain::init(std::string_view texFile) { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); if (!texFile.empty()) { @@ -684,8 +684,8 @@ void PUBillboardChain::init(std::string_view texFile) _stateBlock.setCullFaceSide(backend::CullMode::BACK); _stateBlock.setCullFace(true); - _meshCommand.setBeforeCallback(CC_CALLBACK_0(PUBillboardChain::onBeforeDraw, this)); - _meshCommand.setAfterCallback(CC_CALLBACK_0(PUBillboardChain::onAfterDraw, this)); + _meshCommand.setBeforeCallback(AX_CALLBACK_0(PUBillboardChain::onBeforeDraw, this)); + _meshCommand.setAfterCallback(AX_CALLBACK_0(PUBillboardChain::onAfterDraw, this)); } void PUBillboardChain::render(Renderer* renderer, const Mat4& transform, ParticleSystem3D* particleSystem) diff --git a/extensions/Particle3D/PU/CCPUBoxCollider.h b/extensions/Particle3D/PU/CCPUBoxCollider.h index 7fb7f3f90e..e2b37a8727 100644 --- a/extensions/Particle3D/PU/CCPUBoxCollider.h +++ b/extensions/Particle3D/PU/CCPUBoxCollider.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BOX_COLLIDER_H__ -#define __CC_PU_PARTICLE_3D_BOX_COLLIDER_H__ +#ifndef __AX_PU_PARTICLE_3D_BOX_COLLIDER_H__ +#define __AX_PU_PARTICLE_3D_BOX_COLLIDER_H__ #include "CCPUBaseCollider.h" NS_AX_BEGIN -class CC_EX_DLL PUBoxCollider : public PUBaseCollider +class AX_EX_DLL PUBoxCollider : public PUBaseCollider { public: static const float DEFAULT_WIDTH; diff --git a/extensions/Particle3D/PU/CCPUBoxColliderTranslator.h b/extensions/Particle3D/PU/CCPUBoxColliderTranslator.h index 943108edca..5546a359a4 100644 --- a/extensions/Particle3D/PU/CCPUBoxColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUBoxColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BOX_COLLIDER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_BOX_COLLIDER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_BOX_COLLIDER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_BOX_COLLIDER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUBoxEmitter.cpp b/extensions/Particle3D/PU/CCPUBoxEmitter.cpp index 3c33a6e16f..39351556d0 100644 --- a/extensions/Particle3D/PU/CCPUBoxEmitter.cpp +++ b/extensions/Particle3D/PU/CCPUBoxEmitter.cpp @@ -87,9 +87,9 @@ void CCPUBoxEmitter::initParticlePosition(PUParticle3D* particle) Mat4 rotMat; Mat4::createRotation(static_cast(_particleSystem)->getDerivedOrientation(), &rotMat); particle->position = getDerivedPosition() + rotMat * (/*_emitterScale **/ - Vec3(CCRANDOM_MINUS1_1() * _xRange * _emitterScale.x, - CCRANDOM_MINUS1_1() * _yRange * _emitterScale.y, - CCRANDOM_MINUS1_1() * _zRange * _emitterScale.z)); + Vec3(AXRANDOM_MINUS1_1() * _xRange * _emitterScale.x, + AXRANDOM_MINUS1_1() * _yRange * _emitterScale.y, + AXRANDOM_MINUS1_1() * _zRange * _emitterScale.z)); } // else //{ diff --git a/extensions/Particle3D/PU/CCPUBoxEmitter.h b/extensions/Particle3D/PU/CCPUBoxEmitter.h index 146c65fcef..1689c5d720 100644 --- a/extensions/Particle3D/PU/CCPUBoxEmitter.h +++ b/extensions/Particle3D/PU/CCPUBoxEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BOX_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_BOX_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_BOX_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_BOX_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class CC_EX_DLL CCPUBoxEmitter : public PUEmitter +class AX_EX_DLL CCPUBoxEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUBoxEmitterTranslator.h b/extensions/Particle3D/PU/CCPUBoxEmitterTranslator.h index 8c35623e86..282b24cac1 100644 --- a/extensions/Particle3D/PU/CCPUBoxEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUBoxEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BOX_EMITTER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_BOX_EMITTER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_BOX_EMITTER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_BOX_EMITTER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUCircleEmitter.h b/extensions/Particle3D/PU/CCPUCircleEmitter.h index e101d3c3e5..641899e73c 100644 --- a/extensions/Particle3D/PU/CCPUCircleEmitter.h +++ b/extensions/Particle3D/PU/CCPUCircleEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_CIRCLE_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_CIRCLE_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_CIRCLE_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_CIRCLE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class CC_EX_DLL PUCircleEmitter : public PUEmitter +class AX_EX_DLL PUCircleEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUCircleEmitterTranslator.h b/extensions/Particle3D/PU/CCPUCircleEmitterTranslator.h index 5e03d54b00..d64b03f955 100644 --- a/extensions/Particle3D/PU/CCPUCircleEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUCircleEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_CIRCLE_EMITTER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_CIRCLE_EMITTER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_CIRCLE_EMITTER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_CIRCLE_EMITTER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.cpp b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.cpp index d97cc45900..5d055f8ba4 100644 --- a/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.cpp +++ b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.cpp @@ -47,7 +47,7 @@ void PUCollisionAvoidanceAffector::setRadius(float radius) //----------------------------------------------------------------------- void PUCollisionAvoidanceAffector::updatePUAffector(PUParticle3D* /*particle*/, float /*deltaTime*/) { - CCASSERT(0, "nonsupport yet"); + AXASSERT(0, "nonsupport yet"); // for (auto iter : _particleSystem->getParticles()) //{ // PUParticle3D *particle = iter; diff --git a/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.h b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.h index 0ce443269f..7c0eceab35 100644 --- a/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.h +++ b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" NS_AX_BEGIN -class CC_EX_DLL PUCollisionAvoidanceAffector : public PUAffector +class AX_EX_DLL PUCollisionAvoidanceAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffectorTranslator.h b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffectorTranslator.h index bb16906a5c..1060648226 100644 --- a/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUColorAffector.h b/extensions/Particle3D/PU/CCPUColorAffector.h index e9ae4841d0..3b680de222 100644 --- a/extensions/Particle3D/PU/CCPUColorAffector.h +++ b/extensions/Particle3D/PU/CCPUColorAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_COLOR_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_COLOR_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_COLOR_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_COLOR_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUColorAffector : public PUAffector +class AX_EX_DLL PUColorAffector : public PUAffector { public: typedef std::map ColorMap; diff --git a/extensions/Particle3D/PU/CCPUColorAffectorTranslator.h b/extensions/Particle3D/PU/CCPUColorAffectorTranslator.h index 2fe9683a64..d9d65741ab 100644 --- a/extensions/Particle3D/PU/CCPUColorAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUColorAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_COLOR_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_COLOR_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_COLOR_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_COLOR_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoAffectorEventHandler.h b/extensions/Particle3D/PU/CCPUDoAffectorEventHandler.h index f0770e81dc..16aa6d3bcc 100644 --- a/extensions/Particle3D/PU/CCPUDoAffectorEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoAffectorEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ struct PUParticle3D; class PUObserver; class PUParticleSystem3D; -class CC_EX_DLL PUDoAffectorEventHandler : public PUEventHandler +class AX_EX_DLL PUDoAffectorEventHandler : public PUEventHandler { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUDoAffectorEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoAffectorEventHandlerTranslator.h index 2595f85277..b380e5e7d3 100644 --- a/extensions/Particle3D/PU/CCPUDoAffectorEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoAffectorEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandler.h b/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandler.h index 3404cd65c3..5cc64a9361 100644 --- a/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -40,7 +40,7 @@ struct PUParticle3D; class PUObserver; class PUParticleSystem3D; -class CC_EX_DLL PUDoEnableComponentEventHandler : public PUEventHandler +class AX_EX_DLL PUDoEnableComponentEventHandler : public PUEventHandler { public: static PUDoEnableComponentEventHandler* create(); diff --git a/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandlerTranslator.h index deaa3a711d..9c6bd55f68 100644 --- a/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoExpireEventHandler.h b/extensions/Particle3D/PU/CCPUDoExpireEventHandler.h index 97780aada0..29f44d89f9 100644 --- a/extensions/Particle3D/PU/CCPUDoExpireEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoExpireEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ struct PUParticle3D; class PUObserver; class PUParticleSystem3D; -class CC_EX_DLL PUDoExpireEventHandler : public PUEventHandler +class AX_EX_DLL PUDoExpireEventHandler : public PUEventHandler { public: static PUDoExpireEventHandler* create(); diff --git a/extensions/Particle3D/PU/CCPUDoExpireEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoExpireEventHandlerTranslator.h index ebbeafe75f..1ed398c8f1 100644 --- a/extensions/Particle3D/PU/CCPUDoExpireEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoExpireEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoFreezeEventHandler.h b/extensions/Particle3D/PU/CCPUDoFreezeEventHandler.h index ec2d6b41ff..b818002fbd 100644 --- a/extensions/Particle3D/PU/CCPUDoFreezeEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoFreezeEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ struct PUParticle3D; class PUObserver; class PUParticleSystem3D; -class CC_EX_DLL PUDoFreezeEventHandler : public PUEventHandler +class AX_EX_DLL PUDoFreezeEventHandler : public PUEventHandler { public: static PUDoFreezeEventHandler* create(); diff --git a/extensions/Particle3D/PU/CCPUDoFreezeEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoFreezeEventHandlerTranslator.h index 343b8dab3b..f76f7d9ebf 100644 --- a/extensions/Particle3D/PU/CCPUDoFreezeEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoFreezeEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandler.h b/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandler.h index 2ef7910abe..99d985eb41 100644 --- a/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -41,7 +41,7 @@ class PUObserver; class PUEmitter; class PUParticleSystem3D; -class CC_EX_DLL PUDoPlacementParticleEventHandler : public PUEventHandler, public PUListener +class AX_EX_DLL PUDoPlacementParticleEventHandler : public PUEventHandler, public PUListener { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandlerTranslator.h index 0e7fedb4e9..989373b1f6 100644 --- a/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoScaleEventHandler.h b/extensions/Particle3D/PU/CCPUDoScaleEventHandler.h index 1ac2fdf61f..a0661b5a1b 100644 --- a/extensions/Particle3D/PU/CCPUDoScaleEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoScaleEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUDoScaleEventHandler : public PUEventHandler +class AX_EX_DLL PUDoScaleEventHandler : public PUEventHandler { public: enum ScaleType diff --git a/extensions/Particle3D/PU/CCPUDoScaleEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoScaleEventHandlerTranslator.h index 6454f543eb..1d33d1e00b 100644 --- a/extensions/Particle3D/PU/CCPUDoScaleEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoScaleEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoStopSystemEventHandler.h b/extensions/Particle3D/PU/CCPUDoStopSystemEventHandler.h index 1dcde9f3bb..3f9febdd0b 100644 --- a/extensions/Particle3D/PU/CCPUDoStopSystemEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoStopSystemEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_STOP_SYSTEM_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_STOP_SYSTEM_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_STOP_SYSTEM_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_STOP_SYSTEM_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ struct PUParticle3D; class PUObserver; class PUParticleSystem3D; -class CC_EX_DLL PUDoStopSystemEventHandler : public PUEventHandler +class AX_EX_DLL PUDoStopSystemEventHandler : public PUEventHandler { protected: public: diff --git a/extensions/Particle3D/PU/CCPUDoStopSystemEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoStopSystemEventHandlerTranslator.h index 0b9d6e818b..8236934efe 100644 --- a/extensions/Particle3D/PU/CCPUDoStopSystemEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoStopSystemEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_STOP_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_STOP_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_STOP_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_STOP_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDynamicAttribute.h b/extensions/Particle3D/PU/CCPUDynamicAttribute.h index 5bbeec74e1..67495e0201 100644 --- a/extensions/Particle3D/PU/CCPUDynamicAttribute.h +++ b/extensions/Particle3D/PU/CCPUDynamicAttribute.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_H__ -#define __CC_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_H__ +#ifndef __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_H__ +#define __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -57,7 +57,7 @@ struct PUControlPointSorter but where implementation of this behaviour may not be scattered or duplicated within the application that needs it. */ -class CC_EX_DLL PUDynamicAttribute : public Ref +class AX_EX_DLL PUDynamicAttribute : public Ref { public: enum DynamicAttributeType @@ -106,7 +106,7 @@ protected: Although use of a regular attribute within the class that needs it is preferred, its benefit is that it makes use of the generic 'getValue' mechanism of a DynamicAttribute. */ -class CC_EX_DLL PUDynamicAttributeFixed : public PUDynamicAttribute +class AX_EX_DLL PUDynamicAttributeFixed : public PUDynamicAttribute { public: /** Constructor @@ -138,7 +138,7 @@ protected: /* This class generates random values within a given minimum and maximum interval. */ -class CC_EX_DLL PUDynamicAttributeRandom : public PUDynamicAttribute +class AX_EX_DLL PUDynamicAttributeRandom : public PUDynamicAttribute { public: /** Constructor @@ -178,7 +178,7 @@ protected: on these control points. Interpolation is done in different flavours. linear?provides linear interpolation of a value on the curve, while spline?generates a smooth curve and the returns a value that lies on that curve. */ -class CC_EX_DLL PUDynamicAttributeCurved : public PUDynamicAttribute +class AX_EX_DLL PUDynamicAttributeCurved : public PUDynamicAttribute { public: typedef std::vector ControlPointList; @@ -257,7 +257,7 @@ protected: /* This class generates values based on an oscillating function (i.e. Sine). */ -class CC_EX_DLL PUDynamicAttributeOscillate : public PUDynamicAttribute +class AX_EX_DLL PUDynamicAttributeOscillate : public PUDynamicAttribute { public: enum OscillationType diff --git a/extensions/Particle3D/PU/CCPUDynamicAttributeTranslator.h b/extensions/Particle3D/PU/CCPUDynamicAttributeTranslator.h index b26412e3c0..2b044cb113 100644 --- a/extensions/Particle3D/PU/CCPUDynamicAttributeTranslator.h +++ b/extensions/Particle3D/PU/CCPUDynamicAttributeTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUEmitter.cpp b/extensions/Particle3D/PU/CCPUEmitter.cpp index b25a5414ac..297febaf67 100644 --- a/extensions/Particle3D/PU/CCPUEmitter.cpp +++ b/extensions/Particle3D/PU/CCPUEmitter.cpp @@ -205,7 +205,7 @@ void PUEmitter::initParticleOrientation(PUParticle3D* particle) if (_particleOrientationRangeSet) { // Generate random orientation 'between' start en end. - Quaternion::lerp(_particleOrientationRangeStart, _particleOrientationRangeEnd, CCRANDOM_0_1(), + Quaternion::lerp(_particleOrientationRangeStart, _particleOrientationRangeEnd, AXRANDOM_0_1(), &particle->orientation); } else @@ -236,13 +236,13 @@ void PUEmitter::initParticleDirection(PUParticle3D* particle) void PUEmitter::generateAngle(float& angle) { - float a = CC_DEGREES_TO_RADIANS(_dynamicAttributeHelper.calculate( + float a = AX_DEGREES_TO_RADIANS(_dynamicAttributeHelper.calculate( _dynAngle, (static_cast(_particleSystem))->getTimeElapsedSinceStart())); angle = a; if (_dynAngle->getType() == PUDynamicAttribute::DAT_FIXED) { // Make an exception here and don't use the fixed angle. - angle = CCRANDOM_0_1() * angle; + angle = AXRANDOM_0_1() * angle; } } diff --git a/extensions/Particle3D/PU/CCPUEmitter.h b/extensions/Particle3D/PU/CCPUEmitter.h index 6eadc7f9f6..ff9c78e5d4 100644 --- a/extensions/Particle3D/PU/CCPUEmitter.h +++ b/extensions/Particle3D/PU/CCPUEmitter.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_EMITTER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -41,7 +41,7 @@ class PUParticleSystem3D; /** * 3d particle emitter */ -class CC_EX_DLL PUEmitter : public Particle3DEmitter +class AX_EX_DLL PUEmitter : public Particle3DEmitter { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/PU/CCPUEmitterManager.h b/extensions/Particle3D/PU/CCPUEmitterManager.h index d302e6dc2a..79bd13f291 100644 --- a/extensions/Particle3D/PU/CCPUEmitterManager.h +++ b/extensions/Particle3D/PU/CCPUEmitterManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_EMITTER_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_EMITTER_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_EMITTER_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_EMITTER_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUEmitterTranslator.h b/extensions/Particle3D/PU/CCPUEmitterTranslator.h index 676ed8afd4..b5a46e81bf 100644 --- a/extensions/Particle3D/PU/CCPUEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_EMITTER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_EMITTER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_EMITTER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_EMITTER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUEventHandler.h b/extensions/Particle3D/PU/CCPUEventHandler.h index e5bb16c050..c0f037dc37 100644 --- a/extensions/Particle3D/PU/CCPUEventHandler.h +++ b/extensions/Particle3D/PU/CCPUEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ struct PUParticle3D; class PUObserver; class PUParticleSystem3D; -class CC_EX_DLL PUEventHandler : public Ref +class AX_EX_DLL PUEventHandler : public Ref { public: /** Todo diff --git a/extensions/Particle3D/PU/CCPUEventHandlerManager.h b/extensions/Particle3D/PU/CCPUEventHandlerManager.h index 26052cb8b9..03b51b1d00 100644 --- a/extensions/Particle3D/PU/CCPUEventHandlerManager.h +++ b/extensions/Particle3D/PU/CCPUEventHandlerManager.h @@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_EVENT_HANDLER_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_EVENT_HANDLER_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_EVENT_HANDLER_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_EVENT_HANDLER_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUEventHandlerTranslator.h index 769aecdf96..e6c906de8d 100644 --- a/extensions/Particle3D/PU/CCPUEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUEventHandlerTranslator.h @@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUFlockCenteringAffector.h b/extensions/Particle3D/PU/CCPUFlockCenteringAffector.h index 0910d16caa..e1221283f5 100644 --- a/extensions/Particle3D/PU/CCPUFlockCenteringAffector.h +++ b/extensions/Particle3D/PU/CCPUFlockCenteringAffector.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_H__ #include "Particle3D/PU/CCPUAffector.h" NS_AX_BEGIN -class CC_EX_DLL PUFlockCenteringAffector : public PUAffector +class AX_EX_DLL PUFlockCenteringAffector : public PUAffector { public: static PUFlockCenteringAffector* create(); diff --git a/extensions/Particle3D/PU/CCPUFlockCenteringAffectorTranslator.h b/extensions/Particle3D/PU/CCPUFlockCenteringAffectorTranslator.h index 2c6e0cfd48..8fe55887ad 100644 --- a/extensions/Particle3D/PU/CCPUFlockCenteringAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUFlockCenteringAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_TRANSLATOR_H__ #include "Particle3D/PU/CCPUScriptTranslator.h" #include "Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUForceField.h b/extensions/Particle3D/PU/CCPUForceField.h index ca6b58e7c4..2f0f622bce 100644 --- a/extensions/Particle3D/PU/CCPUForceField.h +++ b/extensions/Particle3D/PU/CCPUForceField.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_FORCE_FIELD_H__ -#define __CC_PU_PARTICLE_3D_FORCE_FIELD_H__ +#ifndef __AX_PU_PARTICLE_3D_FORCE_FIELD_H__ +#define __AX_PU_PARTICLE_3D_FORCE_FIELD_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPUForceFieldAffector.h b/extensions/Particle3D/PU/CCPUForceFieldAffector.h index 7f05f23862..2a93f26aa4 100644 --- a/extensions/Particle3D/PU/CCPUForceFieldAffector.h +++ b/extensions/Particle3D/PU/CCPUForceFieldAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUForceField.h" NS_AX_BEGIN -class CC_EX_DLL PUForceFieldAffector : public PUAffector +class AX_EX_DLL PUForceFieldAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUForceFieldAffectorTranslator.h b/extensions/Particle3D/PU/CCPUForceFieldAffectorTranslator.h index 7344b7c2ab..9f454bfcc3 100644 --- a/extensions/Particle3D/PU/CCPUForceFieldAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUForceFieldAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUGeometryRotator.cpp b/extensions/Particle3D/PU/CCPUGeometryRotator.cpp index 76723b21c2..40e7407490 100644 --- a/extensions/Particle3D/PU/CCPUGeometryRotator.cpp +++ b/extensions/Particle3D/PU/CCPUGeometryRotator.cpp @@ -51,7 +51,7 @@ PUGeometryRotator::PUGeometryRotator() PUGeometryRotator::~PUGeometryRotator() { if (_dynRotationSpeed) - CC_SAFE_DELETE(_dynRotationSpeed); + AX_SAFE_DELETE(_dynRotationSpeed); } //----------------------------------------------------------------------- const Vec3& PUGeometryRotator::getRotationAxis() const @@ -80,7 +80,7 @@ PUDynamicAttribute* PUGeometryRotator::getRotationSpeed() const void PUGeometryRotator::setRotationSpeed(PUDynamicAttribute* dynRotationSpeed) { if (_dynRotationSpeed) - CC_SAFE_DELETE(_dynRotationSpeed); + AX_SAFE_DELETE(_dynRotationSpeed); _dynRotationSpeed = dynRotationSpeed; } //----------------------------------------------------------------------- @@ -110,14 +110,14 @@ void PUGeometryRotator::initParticleForEmission(PUParticle3D* particle) if (!_rotationAxisSet) { // Set initial random rotation axis and orientation(PU 1.4) - particle->orientation.x = CCRANDOM_MINUS1_1(); - particle->orientation.y = CCRANDOM_MINUS1_1(); - particle->orientation.z = CCRANDOM_MINUS1_1(); - particle->orientation.w = CCRANDOM_MINUS1_1(); + particle->orientation.x = AXRANDOM_MINUS1_1(); + particle->orientation.y = AXRANDOM_MINUS1_1(); + particle->orientation.z = AXRANDOM_MINUS1_1(); + particle->orientation.w = AXRANDOM_MINUS1_1(); particle->orientation.normalize(); - particle->rotationAxis.x = CCRANDOM_0_1(); - particle->rotationAxis.y = CCRANDOM_0_1(); - particle->rotationAxis.z = CCRANDOM_0_1(); + particle->rotationAxis.x = AXRANDOM_0_1(); + particle->rotationAxis.y = AXRANDOM_0_1(); + particle->rotationAxis.z = AXRANDOM_0_1(); particle->rotationAxis.normalize(); } diff --git a/extensions/Particle3D/PU/CCPUGeometryRotator.h b/extensions/Particle3D/PU/CCPUGeometryRotator.h index a2d22fcbf5..980fb0688b 100644 --- a/extensions/Particle3D/PU/CCPUGeometryRotator.h +++ b/extensions/Particle3D/PU/CCPUGeometryRotator.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_GEOMETRY_ROTATOR_H__ -#define __CC_PU_PARTICLE_3D_GEOMETRY_ROTATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_GEOMETRY_ROTATOR_H__ +#define __AX_PU_PARTICLE_3D_GEOMETRY_ROTATOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" NS_AX_BEGIN struct PUParticle3D; -class CC_EX_DLL PUGeometryRotator : public PUAffector +class AX_EX_DLL PUGeometryRotator : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUGeometryRotatorTranslator.h b/extensions/Particle3D/PU/CCPUGeometryRotatorTranslator.h index 4459bb9c3d..c42396cfa1 100644 --- a/extensions/Particle3D/PU/CCPUGeometryRotatorTranslator.h +++ b/extensions/Particle3D/PU/CCPUGeometryRotatorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_GEOMETRY_ROTATOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_GEOMETRY_ROTATOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_GEOMETRY_ROTATOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_GEOMETRY_ROTATOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUGravityAffector.h b/extensions/Particle3D/PU/CCPUGravityAffector.h index 0f7f651507..124bdd2c3f 100644 --- a/extensions/Particle3D/PU/CCPUGravityAffector.h +++ b/extensions/Particle3D/PU/CCPUGravityAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_GRAVITY_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_GRAVITY_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_GRAVITY_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_GRAVITY_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PUGravityAffector : public PUAffector +class AX_EX_DLL PUGravityAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUGravityAffectorTranslator.h b/extensions/Particle3D/PU/CCPUGravityAffectorTranslator.h index f8c89c5f29..c02768f3f3 100644 --- a/extensions/Particle3D/PU/CCPUGravityAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUGravityAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_GRAVITY_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_GRAVITY_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_GRAVITY_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_GRAVITY_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUInterParticleCollider.cpp b/extensions/Particle3D/PU/CCPUInterParticleCollider.cpp index 4577e1a128..934a38f411 100644 --- a/extensions/Particle3D/PU/CCPUInterParticleCollider.cpp +++ b/extensions/Particle3D/PU/CCPUInterParticleCollider.cpp @@ -130,7 +130,7 @@ bool PUParticle3DInterParticleCollider::validateAndExecuteSphereCollision(PUPart void PUParticle3DInterParticleCollider::updatePUAffector(PUParticle3D* /*particle*/, float /*deltaTime*/) { - // CCASSERT(0, "nonsupport yet"); + // AXASSERT(0, "nonsupport yet"); // for (auto iter : _particleSystem->getParticles()) //{ // PUParticle3D *particle = iter; diff --git a/extensions/Particle3D/PU/CCPUInterParticleCollider.h b/extensions/Particle3D/PU/CCPUInterParticleCollider.h index 15aac1489d..9906b67697 100644 --- a/extensions/Particle3D/PU/CCPUInterParticleCollider.h +++ b/extensions/Particle3D/PU/CCPUInterParticleCollider.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_H__ -#define __CC_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_H__ +#ifndef __AX_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_H__ +#define __AX_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_H__ #include "CCPUBaseCollider.h" #include "base/ccTypes.h" NS_AX_BEGIN struct PUParticle3D; -class CC_EX_DLL PUParticle3DInterParticleCollider : public PUBaseCollider +class AX_EX_DLL PUParticle3DInterParticleCollider : public PUBaseCollider { public: enum InterParticleCollisionResponse diff --git a/extensions/Particle3D/PU/CCPUInterParticleColliderTranslator.h b/extensions/Particle3D/PU/CCPUInterParticleColliderTranslator.h index bcdb5ded08..ef3c858338 100644 --- a/extensions/Particle3D/PU/CCPUInterParticleColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUInterParticleColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUJetAffector.cpp b/extensions/Particle3D/PU/CCPUJetAffector.cpp index 08ba3ffd08..f5d428375f 100644 --- a/extensions/Particle3D/PU/CCPUJetAffector.cpp +++ b/extensions/Particle3D/PU/CCPUJetAffector.cpp @@ -44,14 +44,14 @@ PUJetAffector::~PUJetAffector() if (!_dynAcceleration) return; - CC_SAFE_DELETE(_dynAcceleration); + AX_SAFE_DELETE(_dynAcceleration); _dynAcceleration = 0; } //----------------------------------------------------------------------- void PUJetAffector::setDynAcceleration(PUDynamicAttribute* dynAcceleration) { if (_dynAcceleration) - CC_SAFE_DELETE(_dynAcceleration); + AX_SAFE_DELETE(_dynAcceleration); _dynAcceleration = dynAcceleration; } diff --git a/extensions/Particle3D/PU/CCPUJetAffector.h b/extensions/Particle3D/PU/CCPUJetAffector.h index 656ef3d7a9..0a35e09663 100644 --- a/extensions/Particle3D/PU/CCPUJetAffector.h +++ b/extensions/Particle3D/PU/CCPUJetAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_JET_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_JET_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_JET_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_JET_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUJetAffector : public PUAffector +class AX_EX_DLL PUJetAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUJetAffectorTranslator.h b/extensions/Particle3D/PU/CCPUJetAffectorTranslator.h index 18642ca58f..034ceeea67 100644 --- a/extensions/Particle3D/PU/CCPUJetAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUJetAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_JET_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_JET_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_JET_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_JET_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPULineAffector.cpp b/extensions/Particle3D/PU/CCPULineAffector.cpp index c7a6aa1e4c..99c5094cd7 100644 --- a/extensions/Particle3D/PU/CCPULineAffector.cpp +++ b/extensions/Particle3D/PU/CCPULineAffector.cpp @@ -122,15 +122,15 @@ void PULineAffector::updatePUAffector(PUParticle3D* particle, float /*deltaTime* // PUParticle3D *particle = iter; (static_cast(_particleSystem)) ->rotationOffset(particle->originalPosition); // Always update - if (_update && CCRANDOM_0_1() > 0.5f && !_first) + if (_update && AXRANDOM_0_1() > 0.5f && !_first) { // Generate a random vector perpendicular on the line Vec3 perpendicular; - Vec3::cross(_end, Vec3(CCRANDOM_MINUS1_1(), CCRANDOM_MINUS1_1(), CCRANDOM_MINUS1_1()), &perpendicular); + Vec3::cross(_end, Vec3(AXRANDOM_MINUS1_1(), AXRANDOM_MINUS1_1(), AXRANDOM_MINUS1_1()), &perpendicular); perpendicular.normalize(); // Determine a random point near the line. - Vec3 targetPosition = particle->originalPosition + _scaledMaxDeviation * CCRANDOM_0_1() * perpendicular; + Vec3 targetPosition = particle->originalPosition + _scaledMaxDeviation * AXRANDOM_0_1() * perpendicular; /** Set the new position. @remarks diff --git a/extensions/Particle3D/PU/CCPULineAffector.h b/extensions/Particle3D/PU/CCPULineAffector.h index 150fa8deb7..3d63d60a2f 100644 --- a/extensions/Particle3D/PU/CCPULineAffector.h +++ b/extensions/Particle3D/PU/CCPULineAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LINE_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_LINE_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_LINE_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_LINE_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PULineAffector : public PUAffector +class AX_EX_DLL PULineAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPULineAffectorTranslator.h b/extensions/Particle3D/PU/CCPULineAffectorTranslator.h index 70294a4bbb..6ed17311c8 100644 --- a/extensions/Particle3D/PU/CCPULineAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPULineAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LINE_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_LINE_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_LINE_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_LINE_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPULineEmitter.cpp b/extensions/Particle3D/PU/CCPULineEmitter.cpp index 74af4e454d..2b6f84ce78 100644 --- a/extensions/Particle3D/PU/CCPULineEmitter.cpp +++ b/extensions/Particle3D/PU/CCPULineEmitter.cpp @@ -150,7 +150,7 @@ void PULineEmitter::initParticlePosition(PUParticle3D* particle) if (_autoDirection || (_scaledMaxDeviation > 0.0f && !_first)) { // Generate a random vector perpendicular on the line if this is required - Vec3::cross(_end, Vec3(CCRANDOM_MINUS1_1(), CCRANDOM_MINUS1_1(), CCRANDOM_MINUS1_1()), &_perpendicular); + Vec3::cross(_end, Vec3(AXRANDOM_MINUS1_1(), AXRANDOM_MINUS1_1(), AXRANDOM_MINUS1_1()), &_perpendicular); _perpendicular.normalize(); } @@ -160,7 +160,7 @@ void PULineEmitter::initParticlePosition(PUParticle3D* particle) { if (!_first) { - _increment += (_scaledMinIncrement + CCRANDOM_0_1() * _scaledMaxIncrement); + _increment += (_scaledMinIncrement + AXRANDOM_0_1() * _scaledMaxIncrement); if (_increment >= _scaledLength) { _incrementsLeft = false; @@ -170,7 +170,7 @@ void PULineEmitter::initParticlePosition(PUParticle3D* particle) } else { - fraction = CCRANDOM_0_1(); + fraction = AXRANDOM_0_1(); } // If the deviation has been set, generate a position with a certain distance from the line @@ -180,7 +180,7 @@ void PULineEmitter::initParticlePosition(PUParticle3D* particle) if (!_first) { Vec3 basePosition = _derivedPosition + fraction * _scaledEnd; - particle->position = basePosition + _scaledMaxDeviation * CCRANDOM_0_1() * _perpendicular; + particle->position = basePosition + _scaledMaxDeviation * AXRANDOM_0_1() * _perpendicular; particle->originalPosition = basePosition; // Position is without deviation from the line, // to make affectors a bit faster/easier. } diff --git a/extensions/Particle3D/PU/CCPULineEmitter.h b/extensions/Particle3D/PU/CCPULineEmitter.h index 118b825035..fe1ec7bb85 100644 --- a/extensions/Particle3D/PU/CCPULineEmitter.h +++ b/extensions/Particle3D/PU/CCPULineEmitter.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LINE_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_LINE_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_LINE_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_LINE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN struct PUParticle3D; -class CC_EX_DLL PULineEmitter : public PUEmitter +class AX_EX_DLL PULineEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPULineEmitterTranslator.h b/extensions/Particle3D/PU/CCPULineEmitterTranslator.h index 7e51a8217d..e8f5dd211e 100644 --- a/extensions/Particle3D/PU/CCPULineEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPULineEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LINE_EMITTER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_LINE_EMITTER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_LINE_EMITTER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_LINE_EMITTER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPULinearForceAffector.h b/extensions/Particle3D/PU/CCPULinearForceAffector.h index 5800a6ad40..73bf1078b6 100644 --- a/extensions/Particle3D/PU/CCPULinearForceAffector.h +++ b/extensions/Particle3D/PU/CCPULinearForceAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_H__ #include "CCPUBaseForceAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PULinearForceAffector : public PUBaseForceAffector +class AX_EX_DLL PULinearForceAffector : public PUBaseForceAffector { public: static PULinearForceAffector* create(); diff --git a/extensions/Particle3D/PU/CCPULinearForceAffectorTranslator.h b/extensions/Particle3D/PU/CCPULinearForceAffectorTranslator.h index 98ab3296e9..9d5ba25793 100644 --- a/extensions/Particle3D/PU/CCPULinearForceAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPULinearForceAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUListener.h b/extensions/Particle3D/PU/CCPUListener.h index e50e365f14..16b2a7ebf7 100644 --- a/extensions/Particle3D/PU/CCPUListener.h +++ b/extensions/Particle3D/PU/CCPUListener.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LISTENER_H__ -#define __CC_PU_PARTICLE_3D_LISTENER_H__ +#ifndef __AX_PU_PARTICLE_3D_LISTENER_H__ +#define __AX_PU_PARTICLE_3D_LISTENER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUListener +class AX_EX_DLL PUListener { public: PUListener(); diff --git a/extensions/Particle3D/PU/CCPUMaterialManager.cpp b/extensions/Particle3D/PU/CCPUMaterialManager.cpp index c5f40e0332..217a167339 100644 --- a/extensions/Particle3D/PU/CCPUMaterialManager.cpp +++ b/extensions/Particle3D/PU/CCPUMaterialManager.cpp @@ -31,14 +31,14 @@ #include "platform/CCPlatformMacros.h" #include "renderer/backend/Types.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "platform/android/CCFileUtils-android.h" # include -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # include -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) # include # include # include @@ -106,7 +106,7 @@ void PUMaterialCache::addMaterial(PUMaterial* material) { if (iter->name == material->name) { - CCLOG("warning: Material has existed (FilePath: %s, MaterialName: %s)", material->fileName.c_str(), + AXLOG("warning: Material has existed (FilePath: %s, MaterialName: %s)", material->fileName.c_str(), material->name.c_str()); return; } @@ -116,7 +116,7 @@ void PUMaterialCache::addMaterial(PUMaterial* material) _materialMap.push_back(material); } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) int iterPath(const char* fpath, const struct stat* /*sb*/, int typeflag) { if (typeflag == FTW_F) @@ -131,7 +131,7 @@ int iterPath(const char* fpath, const struct stat* /*sb*/, int typeflag) bool PUMaterialCache::loadMaterialsFromSearchPaths(std::string_view fileFolder) { bool state = false; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_WINRT) std::string seg("/"); std::string fullPath{fileFolder}; fullPath += seg; @@ -149,7 +149,7 @@ bool PUMaterialCache::loadMaterialsFromSearchPaths(std::string_view fileFolder) state = true; } _findclose(handle); -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID /* || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX*/) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID /* || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX*/) std::string::size_type pos = fileFolder.find("assets/"); std::string_view relativePath = fileFolder; if (pos != std::string::npos) @@ -171,16 +171,16 @@ bool PUMaterialCache::loadMaterialsFromSearchPaths(std::string_view fileFolder) } AAssetDir_close(dir); -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) ftw(fileFolder.data(), iterPath, 500); -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_TIZEN) DIR* d; // dir handle struct dirent* file; // readdir struct stat statbuf; if (!(d = opendir(fileFolder.data()))) { - CCLOG("error opendir %s!!!\n", fileFolder.data()); + AXLOG("error opendir %s!!!\n", fileFolder.data()); return false; } while ((file = readdir(d)) != NULL) @@ -194,14 +194,14 @@ bool PUMaterialCache::loadMaterialsFromSearchPaths(std::string_view fileFolder) { std::string fullpath{fileFolder}; fullpath.append("/"sv).append(file->d_name); - CCLOG("%s", fullpath.c_str()); + AXLOG("%s", fullpath.c_str()); loadMaterials(fullpath); state = true; } } closedir(d); #else - CCASSERT(0, "no implement for this platform"); + AXASSERT(0, "no implement for this platform"); #endif return state; diff --git a/extensions/Particle3D/PU/CCPUMaterialManager.h b/extensions/Particle3D/PU/CCPUMaterialManager.h index 168da5ffc2..cbaf2fb499 100644 --- a/extensions/Particle3D/PU/CCPUMaterialManager.h +++ b/extensions/Particle3D/PU/CCPUMaterialManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_MATERIAL_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_MATERIAL_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_MATERIAL_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_MATERIAL_MANAGER_H__ #include "math/CCMath.h" #include "base/ccTypes.h" #include @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUMaterial : public Ref +class AX_EX_DLL PUMaterial : public Ref { public: PUMaterial(); @@ -55,7 +55,7 @@ public: backend::SamplerAddressMode wrapMode; }; -class CC_EX_DLL PUMaterialCache +class AX_EX_DLL PUMaterialCache { public: PUMaterialCache(); diff --git a/extensions/Particle3D/PU/CCPUMaterialTranslator.h b/extensions/Particle3D/PU/CCPUMaterialTranslator.h index cebb718beb..7c681b0a0d 100644 --- a/extensions/Particle3D/PU/CCPUMaterialTranslator.h +++ b/extensions/Particle3D/PU/CCPUMaterialTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_MATERIAL_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_MATERIAL_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_MATERIAL_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_MATERIAL_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.cpp b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.cpp index deb58d8a3b..d67c1beb4f 100644 --- a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.cpp +++ b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.cpp @@ -90,8 +90,8 @@ const Vec3 PUTriangle::getRandomTrianglePosition() // in triangle ABC: the reflection step a=1-a; b=1-b gives a point (a,b) uniformly distributed in the // triangle (0,0)(1,0)(0,1), which is then mapped affinely to ABC. Now you have barycentric coordinates // a,b,c. Compute your point P = aA + bB + cC. - float a = CCRANDOM_0_1(); - float b = CCRANDOM_0_1(); + float a = AXRANDOM_0_1(); + float b = AXRANDOM_0_1(); if (a + b > 1) { a = 1 - a; @@ -103,8 +103,8 @@ const Vec3 PUTriangle::getRandomTrianglePosition() //----------------------------------------------------------------------- const PUTriangle::PositionAndNormal PUTriangle::getRandomEdgePositionAndNormal() { - float mult = CCRANDOM_0_1(); - float randomVal = CCRANDOM_0_1() * 3.0f; + float mult = AXRANDOM_0_1(); + float randomVal = AXRANDOM_0_1() * 3.0f; PositionAndNormal pAndN; pAndN.position.setZero(); pAndN.normal.setZero(); @@ -133,7 +133,7 @@ const PUTriangle::PositionAndNormal PUTriangle::getRandomEdgePositionAndNormal() //----------------------------------------------------------------------- const PUTriangle::PositionAndNormal PUTriangle::getRandomVertexAndNormal() { - float randomVal = CCRANDOM_0_1() * 3.0f; + float randomVal = AXRANDOM_0_1() * 3.0f; PositionAndNormal pAndN; pAndN.position.setZero(); pAndN.normal.setZero(); @@ -188,8 +188,8 @@ inline float MeshInfo::getGaussianRandom(float high, float cutoff) unsigned int max = 0; do { - x1 = CCRANDOM_0_1(); - x2 = CCRANDOM_0_1(); + x1 = AXRANDOM_0_1(); + x2 = AXRANDOM_0_1(); w = x1 * x1 + x2 * x2; // Prevent infinite loop @@ -220,7 +220,7 @@ size_t MeshInfo::getRandomTriangleIndex() index = (size_t)getGaussianRandom((float)_triangles.size() - 1); } else - index = (size_t)(CCRANDOM_0_1() * (float)(_triangles.size() - 1)); + index = (size_t)(AXRANDOM_0_1() * (float)(_triangles.size() - 1)); return index; } @@ -418,7 +418,7 @@ PUMeshSurfaceEmitter::~PUMeshSurfaceEmitter() { if (_meshInfo) { - CC_SAFE_DELETE(_meshInfo); + AX_SAFE_DELETE(_meshInfo); } } //----------------------------------------------------------------------- @@ -569,7 +569,7 @@ void PUMeshSurfaceEmitter::build() // Delete the mesh info if already existing if (_meshInfo) { - CC_SAFE_DELETE(_meshInfo); + AX_SAFE_DELETE(_meshInfo); } // Generate meshinfo. diff --git a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.h b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.h index ab62c87d01..63b7bcee71 100644 --- a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.h +++ b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_MESH_SURFACE_EMITTER_H__ -#define __CC_PU_PARTICLE_MESH_SURFACE_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_MESH_SURFACE_EMITTER_H__ +#define __AX_PU_PARTICLE_MESH_SURFACE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" @@ -162,7 +162,7 @@ protected: It is also possible to define whether more particles emit on larger faces. */ -class CC_EX_DLL PUMeshSurfaceEmitter : public PUEmitter +class AX_EX_DLL PUMeshSurfaceEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitterTranslator.h b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitterTranslator.h index 521a43192d..d681a335d0 100644 --- a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_MESH_SURFACE_EMITTER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_MESH_SURFACE_EMITTER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_MESH_SURFACE_EMITTER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_MESH_SURFACE_EMITTER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUNoise.h b/extensions/Particle3D/PU/CCPUNoise.h index f070b0dfd0..dea4b3342b 100644 --- a/extensions/Particle3D/PU/CCPUNoise.h +++ b/extensions/Particle3D/PU/CCPUNoise.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_NOISE_H__ -#define __CC_PU_PARTICLE_3D_NOISE_H__ +#ifndef __AX_PU_PARTICLE_3D_NOISE_H__ +#define __AX_PU_PARTICLE_3D_NOISE_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPUObserver.cpp b/extensions/Particle3D/PU/CCPUObserver.cpp index b1192bba5b..6860773fa9 100644 --- a/extensions/Particle3D/PU/CCPUObserver.cpp +++ b/extensions/Particle3D/PU/CCPUObserver.cpp @@ -164,7 +164,7 @@ void PUObserver::removeEventHandler(PUEventHandler* eventHandler) //----------------------------------------------------------------------- PUEventHandler* PUObserver::getEventHandler(size_t index) const { - CCASSERT(index < _eventHandlers.size(), "EventHandler index out of bounds!"); + AXASSERT(index < _eventHandlers.size(), "EventHandler index out of bounds!"); return _eventHandlers[index]; } //----------------------------------------------------------------------- @@ -193,7 +193,7 @@ size_t PUObserver::getNumEventHandlers() const //----------------------------------------------------------------------- void PUObserver::destroyEventHandler(PUEventHandler* eventHandler) { - CCASSERT(eventHandler, "EventHandler is null!"); + AXASSERT(eventHandler, "EventHandler is null!"); ParticleEventHandlerIterator it; for (it = _eventHandlers.begin(); it != _eventHandlers.end(); ++it) { diff --git a/extensions/Particle3D/PU/CCPUObserver.h b/extensions/Particle3D/PU/CCPUObserver.h index a82a984979..aacdb7dcb5 100644 --- a/extensions/Particle3D/PU/CCPUObserver.h +++ b/extensions/Particle3D/PU/CCPUObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -46,7 +46,7 @@ enum PUComparisionOperator CO_GREATER_THAN }; -class CC_EX_DLL PUObserver : public Ref +class AX_EX_DLL PUObserver : public Ref { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/PU/CCPUObserverManager.h b/extensions/Particle3D/PU/CCPUObserverManager.h index 1373c6a2d5..4b0b3d9502 100644 --- a/extensions/Particle3D/PU/CCPUObserverManager.h +++ b/extensions/Particle3D/PU/CCPUObserverManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_OBSERVER_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_OBSERVER_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_OBSERVER_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_OBSERVER_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUObserverTranslator.h b/extensions/Particle3D/PU/CCPUObserverTranslator.h index 5bb7f5d0c1..14f06104db 100644 --- a/extensions/Particle3D/PU/CCPUObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnClearObserver.h b/extensions/Particle3D/PU/CCPUOnClearObserver.h index 812d0623ad..ab5a5ac4ff 100644 --- a/extensions/Particle3D/PU/CCPUOnClearObserver.h +++ b/extensions/Particle3D/PU/CCPUOnClearObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnClearObserver : public PUObserver +class AX_EX_DLL PUOnClearObserver : public PUObserver { public: static PUOnClearObserver* create(); diff --git a/extensions/Particle3D/PU/CCPUOnClearObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnClearObserverTranslator.h index cc684ae8e1..f8fcd1a6b2 100644 --- a/extensions/Particle3D/PU/CCPUOnClearObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnClearObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnCollisionObserver.h b/extensions/Particle3D/PU/CCPUOnCollisionObserver.h index 97268414b0..c60a1a1e17 100644 --- a/extensions/Particle3D/PU/CCPUOnCollisionObserver.h +++ b/extensions/Particle3D/PU/CCPUOnCollisionObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -36,7 +36,7 @@ NS_AX_BEGIN struct PUParticle3D; -class CC_EX_DLL PUOnCollisionObserver : public PUObserver +class AX_EX_DLL PUOnCollisionObserver : public PUObserver { public: static PUOnCollisionObserver* create(); diff --git a/extensions/Particle3D/PU/CCPUOnCollisionObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnCollisionObserverTranslator.h index daa40aa245..f4327566ca 100644 --- a/extensions/Particle3D/PU/CCPUOnCollisionObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnCollisionObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnCountObserver.h b/extensions/Particle3D/PU/CCPUOnCountObserver.h index 51f090c08a..3ce7468d4d 100644 --- a/extensions/Particle3D/PU/CCPUOnCountObserver.h +++ b/extensions/Particle3D/PU/CCPUOnCountObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_COUNT_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_COUNT_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnCountObserver : public PUObserver +class AX_EX_DLL PUOnCountObserver : public PUObserver { protected: unsigned int _count; diff --git a/extensions/Particle3D/PU/CCPUOnCountObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnCountObserverTranslator.h index e7101752ee..f4affba5e7 100644 --- a/extensions/Particle3D/PU/CCPUOnCountObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnCountObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_COUNT_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_COUNT_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnEmissionObserver.h b/extensions/Particle3D/PU/CCPUOnEmissionObserver.h index 7988ab4d35..ff527bc748 100644 --- a/extensions/Particle3D/PU/CCPUOnEmissionObserver.h +++ b/extensions/Particle3D/PU/CCPUOnEmissionObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnEmissionObserver : public PUObserver +class AX_EX_DLL PUOnEmissionObserver : public PUObserver { public: static PUOnEmissionObserver* create(); diff --git a/extensions/Particle3D/PU/CCPUOnEmissionObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnEmissionObserverTranslator.h index 0f2deea70c..7ec67da5bf 100644 --- a/extensions/Particle3D/PU/CCPUOnEmissionObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnEmissionObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnEventFlagObserver.h b/extensions/Particle3D/PU/CCPUOnEventFlagObserver.h index acdf443a54..9d072d274d 100644 --- a/extensions/Particle3D/PU/CCPUOnEventFlagObserver.h +++ b/extensions/Particle3D/PU/CCPUOnEventFlagObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnEventFlagObserver : public PUObserver +class AX_EX_DLL PUOnEventFlagObserver : public PUObserver { protected: unsigned int _eventFlag; diff --git a/extensions/Particle3D/PU/CCPUOnEventFlagObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnEventFlagObserverTranslator.h index 3cd35ba067..dc3f7001d6 100644 --- a/extensions/Particle3D/PU/CCPUOnEventFlagObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnEventFlagObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnExpireObserver.h b/extensions/Particle3D/PU/CCPUOnExpireObserver.h index 04f917a2a6..042f9124aa 100644 --- a/extensions/Particle3D/PU/CCPUOnExpireObserver.h +++ b/extensions/Particle3D/PU/CCPUOnExpireObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnExpireObserver : public PUObserver +class AX_EX_DLL PUOnExpireObserver : public PUObserver { protected: public: diff --git a/extensions/Particle3D/PU/CCPUOnExpireObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnExpireObserverTranslator.h index 9b61294092..7147be55cf 100644 --- a/extensions/Particle3D/PU/CCPUOnExpireObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnExpireObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnPositionObserver.h b/extensions/Particle3D/PU/CCPUOnPositionObserver.h index 55192e099f..2af387cc87 100644 --- a/extensions/Particle3D/PU/CCPUOnPositionObserver.h +++ b/extensions/Particle3D/PU/CCPUOnPositionObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_POSITION_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_POSITION_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnPositionObserver : public PUObserver +class AX_EX_DLL PUOnPositionObserver : public PUObserver { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUOnPositionObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnPositionObserverTranslator.h index caae34f7b0..f7b3b96a48 100644 --- a/extensions/Particle3D/PU/CCPUOnPositionObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnPositionObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_POSITION_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_POSITION_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnQuotaObserver.h b/extensions/Particle3D/PU/CCPUOnQuotaObserver.h index ffdbcc84bf..6359e855e0 100644 --- a/extensions/Particle3D/PU/CCPUOnQuotaObserver.h +++ b/extensions/Particle3D/PU/CCPUOnQuotaObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnQuotaObserver : public PUObserver +class AX_EX_DLL PUOnQuotaObserver : public PUObserver { public: static PUOnQuotaObserver* create(); diff --git a/extensions/Particle3D/PU/CCPUOnQuotaObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnQuotaObserverTranslator.h index 5c266c9854..0d5ad0df93 100644 --- a/extensions/Particle3D/PU/CCPUOnQuotaObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnQuotaObserverTranslator.h @@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnRandomObserver.cpp b/extensions/Particle3D/PU/CCPUOnRandomObserver.cpp index 2ad04d1208..ccfbe5cdd8 100644 --- a/extensions/Particle3D/PU/CCPUOnRandomObserver.cpp +++ b/extensions/Particle3D/PU/CCPUOnRandomObserver.cpp @@ -51,7 +51,7 @@ void PUOnRandomObserver::updateObserver(PUParticle3D* /*particle*/, float /*delt //----------------------------------------------------------------------- bool PUOnRandomObserver::observe(PUParticle3D* /*particle*/, float /*timeElapsed*/) { - return (CCRANDOM_0_1() > _threshold); + return (AXRANDOM_0_1() > _threshold); } PUOnRandomObserver* PUOnRandomObserver::create() diff --git a/extensions/Particle3D/PU/CCPUOnRandomObserver.h b/extensions/Particle3D/PU/CCPUOnRandomObserver.h index 43130e6c4b..1d19a5e56f 100644 --- a/extensions/Particle3D/PU/CCPUOnRandomObserver.h +++ b/extensions/Particle3D/PU/CCPUOnRandomObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnRandomObserver : public PUObserver +class AX_EX_DLL PUOnRandomObserver : public PUObserver { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUOnRandomObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnRandomObserverTranslator.h index c2897972bb..5aa467f58e 100644 --- a/extensions/Particle3D/PU/CCPUOnRandomObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnRandomObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnTimeObserver.h b/extensions/Particle3D/PU/CCPUOnTimeObserver.h index 704d9ca12b..43830829c6 100644 --- a/extensions/Particle3D/PU/CCPUOnTimeObserver.h +++ b/extensions/Particle3D/PU/CCPUOnTimeObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_TIME_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_TIME_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnTimeObserver : public PUObserver +class AX_EX_DLL PUOnTimeObserver : public PUObserver { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUOnTimeObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnTimeObserverTranslator.h index cf8b5b9f16..f41bd3fe4e 100644 --- a/extensions/Particle3D/PU/CCPUOnTimeObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnTimeObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_TIME_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_TIME_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnVelocityObserver.h b/extensions/Particle3D/PU/CCPUOnVelocityObserver.h index 510e1799ba..a099633182 100644 --- a/extensions/Particle3D/PU/CCPUOnVelocityObserver.h +++ b/extensions/Particle3D/PU/CCPUOnVelocityObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_VELOCITY_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_VELOCITY_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_VELOCITY_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_VELOCITY_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnVelocityObserver : public PUObserver +class AX_EX_DLL PUOnVelocityObserver : public PUObserver { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUOnVelocityObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnVelocityObserverTranslator.h index 5c85830641..3762443cc7 100644 --- a/extensions/Particle3D/PU/CCPUOnVelocityObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnVelocityObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_CLEAR_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_CLEAR_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_CLEAR_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_CLEAR_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUParticleFollower.h b/extensions/Particle3D/PU/CCPUParticleFollower.h index e28af1da2d..0edb7d7c69 100644 --- a/extensions/Particle3D/PU/CCPUParticleFollower.h +++ b/extensions/Particle3D/PU/CCPUParticleFollower.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PARTICLE_FOLLOWER_H__ -#define __CC_PU_PARTICLE_3D_PARTICLE_FOLLOWER_H__ +#ifndef __AX_PU_PARTICLE_3D_PARTICLE_FOLLOWER_H__ +#define __AX_PU_PARTICLE_3D_PARTICLE_FOLLOWER_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PUParticleFollower : public PUAffector +class AX_EX_DLL PUParticleFollower : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUParticleFollowerTranslator.h b/extensions/Particle3D/PU/CCPUParticleFollowerTranslator.h index 6488c34188..1cd77b258b 100644 --- a/extensions/Particle3D/PU/CCPUParticleFollowerTranslator.h +++ b/extensions/Particle3D/PU/CCPUParticleFollowerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PARTICLE_FOLLOWER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_PARTICLE_FOLLOWER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_PARTICLE_FOLLOWER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_PARTICLE_FOLLOWER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp b/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp index 0edbf91be8..77e95f3e03 100644 --- a/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp +++ b/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp @@ -163,7 +163,7 @@ PUParticle3D::~PUParticle3D() it->release(); } - // CC_SAFE_RELEASE(particleEntityPtr); + // AX_SAFE_RELEASE(particleEntityPtr); } void PUParticle3D::copyBehaviours(const ParticleBehaviourList& list) @@ -269,7 +269,7 @@ PUParticleSystem3D* PUParticleSystem3D::create(std::string_view filePath, std::s } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } } @@ -284,7 +284,7 @@ PUParticleSystem3D* PUParticleSystem3D::create(std::string_view filePath) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } } @@ -1148,14 +1148,14 @@ void PUParticleSystem3D::addBehaviourTemplate(PUBehaviour* behaviour) void PUParticleSystem3D::convertToUnixStylePath(std::string& path) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) for (auto& iter : path) { if (iter == '\\') iter = '/'; } #else - CC_UNUSED_PARAM(path); + AX_UNUSED_PARAM(path); #endif } diff --git a/extensions/Particle3D/PU/CCPUParticleSystem3D.h b/extensions/Particle3D/PU/CCPUParticleSystem3D.h index 0686fd6177..ec82c23740 100644 --- a/extensions/Particle3D/PU/CCPUParticleSystem3D.h +++ b/extensions/Particle3D/PU/CCPUParticleSystem3D.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_SYSTEM_3D_H__ -#define __CC_PU_PARTICLE_SYSTEM_3D_H__ +#ifndef __AX_PU_PARTICLE_SYSTEM_3D_H__ +#define __AX_PU_PARTICLE_SYSTEM_3D_H__ #include "2d/CCNode.h" #include "base/CCProtocols.h" @@ -56,7 +56,7 @@ enum PUComponentType CT_OBSERVER }; -struct CC_EX_DLL PUParticle3D : public Particle3D +struct AX_EX_DLL PUParticle3D : public Particle3D { static float DEFAULT_TTL; static float DEFAULT_MASS; @@ -204,7 +204,7 @@ struct CC_EX_DLL PUParticle3D : public Particle3D // float depthInWorld; }; -class CC_EX_DLL PUParticleSystem3D : public ParticleSystem3D +class AX_EX_DLL PUParticleSystem3D : public ParticleSystem3D { public: typedef hlookup::string_map ParticlePoolMap; diff --git a/extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h b/extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h index dfec22739e..2c81eb5aa5 100644 --- a/extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h +++ b/extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_SYSTEM_3D_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_SYSTEM_3D_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_SYSTEM_3D_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_SYSTEM_3D_TRANSLATOR_H__ //#include #include "extensions/Particle3D/PU/CCPUParticleSystem3D.h" diff --git a/extensions/Particle3D/PU/CCPUPathFollower.h b/extensions/Particle3D/PU/CCPUPathFollower.h index e7820d0872..9349ff00ee 100644 --- a/extensions/Particle3D/PU/CCPUPathFollower.h +++ b/extensions/Particle3D/PU/CCPUPathFollower.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PATH_FOLLOWER_H__ -#define __CC_PU_PARTICLE_3D_PATH_FOLLOWER_H__ +#ifndef __AX_PU_PARTICLE_3D_PATH_FOLLOWER_H__ +#define __AX_PU_PARTICLE_3D_PATH_FOLLOWER_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUSimpleSpline.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUPathFollower : public PUAffector +class AX_EX_DLL PUPathFollower : public PUAffector { public: static PUPathFollower* create(); diff --git a/extensions/Particle3D/PU/CCPUPathFollowerTranslator.h b/extensions/Particle3D/PU/CCPUPathFollowerTranslator.h index 075d3db8e8..3a5f13b271 100644 --- a/extensions/Particle3D/PU/CCPUPathFollowerTranslator.h +++ b/extensions/Particle3D/PU/CCPUPathFollowerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PATH_FOLLOWER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_PATH_FOLLOWER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_PATH_FOLLOWER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_PATH_FOLLOWER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUPlane.h b/extensions/Particle3D/PU/CCPUPlane.h index 5fe6f943e5..691d07d0bd 100644 --- a/extensions/Particle3D/PU/CCPUPlane.h +++ b/extensions/Particle3D/PU/CCPUPlane.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PLANE_H__ -#define __CC_PU_PARTICLE_3D_PLANE_H__ +#ifndef __AX_PU_PARTICLE_3D_PLANE_H__ +#define __AX_PU_PARTICLE_3D_PLANE_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPUPlaneCollider.h b/extensions/Particle3D/PU/CCPUPlaneCollider.h index 4b64ab86ee..6aafa1f214 100644 --- a/extensions/Particle3D/PU/CCPUPlaneCollider.h +++ b/extensions/Particle3D/PU/CCPUPlaneCollider.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PLANE_COLLIDER_H__ -#define __CC_PU_PARTICLE_3D_PLANE_COLLIDER_H__ +#ifndef __AX_PU_PARTICLE_3D_PLANE_COLLIDER_H__ +#define __AX_PU_PARTICLE_3D_PLANE_COLLIDER_H__ #include "CCPUBaseCollider.h" #include "extensions/Particle3D/PU/CCPUPlane.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUPlaneCollider : public PUBaseCollider +class AX_EX_DLL PUPlaneCollider : public PUBaseCollider { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUPlaneColliderTranslator.h b/extensions/Particle3D/PU/CCPUPlaneColliderTranslator.h index 8caa7c66db..0dbe8c29d1 100644 --- a/extensions/Particle3D/PU/CCPUPlaneColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUPlaneColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PLANE_COLLIDER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_PLANE_COLLIDER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_PLANE_COLLIDER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_PLANE_COLLIDER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUPointEmitter.h b/extensions/Particle3D/PU/CCPUPointEmitter.h index aa18f6a740..092a7193df 100644 --- a/extensions/Particle3D/PU/CCPUPointEmitter.h +++ b/extensions/Particle3D/PU/CCPUPointEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_POINT_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_POINT_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_POINT_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_POINT_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class CC_EX_DLL PUPointEmitter : public PUEmitter +class AX_EX_DLL PUPointEmitter : public PUEmitter { public: static PUPointEmitter* create(); diff --git a/extensions/Particle3D/PU/CCPUPointEmitterTranslator.h b/extensions/Particle3D/PU/CCPUPointEmitterTranslator.h index 79b0b44e0f..00c78ece31 100644 --- a/extensions/Particle3D/PU/CCPUPointEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUPointEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_POINT_EMITTER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_POINT_EMITTER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_POINT_EMITTER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_POINT_EMITTER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUPositionEmitter.cpp b/extensions/Particle3D/PU/CCPUPositionEmitter.cpp index fb59e715fd..0190f8cf7e 100644 --- a/extensions/Particle3D/PU/CCPUPositionEmitter.cpp +++ b/extensions/Particle3D/PU/CCPUPositionEmitter.cpp @@ -104,7 +104,7 @@ void PUPositionEmitter::initParticlePosition(PUParticle3D* particle) */ if (_randomized) { - size_t i = (size_t)(CCRANDOM_0_1() * (_positionList.size() - 1)); + size_t i = (size_t)(AXRANDOM_0_1() * (_positionList.size() - 1)); particle->position = getDerivedPosition() + Vec3(_emitterScale.x * _positionList[i].x, _emitterScale.y * _positionList[i].y, _emitterScale.z * _positionList[i].z); diff --git a/extensions/Particle3D/PU/CCPUPositionEmitter.h b/extensions/Particle3D/PU/CCPUPositionEmitter.h index e71103d1a4..82f9a87912 100644 --- a/extensions/Particle3D/PU/CCPUPositionEmitter.h +++ b/extensions/Particle3D/PU/CCPUPositionEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_POSITION_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_POSITION_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_POSITION_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_POSITION_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class CC_EX_DLL PUPositionEmitter : public PUEmitter +class AX_EX_DLL PUPositionEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUPositionEmitterTranslator.h b/extensions/Particle3D/PU/CCPUPositionEmitterTranslator.h index 6e9160448b..51ae06fca4 100644 --- a/extensions/Particle3D/PU/CCPUPositionEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUPositionEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_POSITION_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_POSITION_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_POSITION_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_POSITION_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPURandomiser.cpp b/extensions/Particle3D/PU/CCPURandomiser.cpp index 9e4f38d991..829df83a16 100644 --- a/extensions/Particle3D/PU/CCPURandomiser.cpp +++ b/extensions/Particle3D/PU/CCPURandomiser.cpp @@ -122,8 +122,8 @@ void PURandomiser::updatePUAffector(PUParticle3D* particle, float /*deltaTime*/) if (_randomDirection) { // Random direction: Change the direction after each update - particle->direction.add(CCRANDOM_MINUS1_1() * _maxDeviationX, CCRANDOM_MINUS1_1() * _maxDeviationY, - CCRANDOM_MINUS1_1() * _maxDeviationZ); + particle->direction.add(AXRANDOM_MINUS1_1() * _maxDeviationX, AXRANDOM_MINUS1_1() * _maxDeviationY, + AXRANDOM_MINUS1_1() * _maxDeviationZ); } else { @@ -132,9 +132,9 @@ void PURandomiser::updatePUAffector(PUParticle3D* particle, float /*deltaTime*/) return; // Random position: Add the position deviation after each update - particle->position.add(CCRANDOM_MINUS1_1() * _maxDeviationX * _affectorScale.x, - CCRANDOM_MINUS1_1() * _maxDeviationY * _affectorScale.y, - CCRANDOM_MINUS1_1() * _maxDeviationZ * _affectorScale.z); + particle->position.add(AXRANDOM_MINUS1_1() * _maxDeviationX * _affectorScale.x, + AXRANDOM_MINUS1_1() * _maxDeviationY * _affectorScale.y, + AXRANDOM_MINUS1_1() * _maxDeviationZ * _affectorScale.z); } } } diff --git a/extensions/Particle3D/PU/CCPURandomiser.h b/extensions/Particle3D/PU/CCPURandomiser.h index 1f7f0f42bc..ee73fdc72c 100644 --- a/extensions/Particle3D/PU/CCPURandomiser.h +++ b/extensions/Particle3D/PU/CCPURandomiser.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_RANDOMISER_H__ -#define __CC_PU_PARTICLE_3D_RANDOMISER_H__ +#ifndef __AX_PU_PARTICLE_3D_RANDOMISER_H__ +#define __AX_PU_PARTICLE_3D_RANDOMISER_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PURandomiser : public PUAffector +class AX_EX_DLL PURandomiser : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPURandomiserTranslator.h b/extensions/Particle3D/PU/CCPURandomiserTranslator.h index 1eb34a9068..69778af3fe 100644 --- a/extensions/Particle3D/PU/CCPURandomiserTranslator.h +++ b/extensions/Particle3D/PU/CCPURandomiserTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_RANDOMISER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_RANDOMISER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_RANDOMISER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_RANDOMISER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPURender.cpp b/extensions/Particle3D/PU/CCPURender.cpp index 87f3c00236..0d440e95e0 100644 --- a/extensions/Particle3D/PU/CCPURender.cpp +++ b/extensions/Particle3D/PU/CCPURender.cpp @@ -66,7 +66,7 @@ PUParticle3DQuadRender* PUParticle3DQuadRender::create(std::string_view texFile) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -86,7 +86,7 @@ void PUParticle3DQuadRender::render(Renderer* renderer, const Mat4& transform, P backend::BufferType::VERTEX, backend::BufferUsage::DYNAMIC); if (_vertexBuffer == nullptr) { - CCLOG("PUParticle3DQuadRender::render create vertex buffer failed"); + AXLOG("PUParticle3DQuadRender::render create vertex buffer failed"); return; } } @@ -98,7 +98,7 @@ void PUParticle3DQuadRender::render(Renderer* renderer, const Mat4& transform, P backend::BufferType::INDEX, backend::BufferUsage::DYNAMIC); if (_indexBuffer == nullptr) { - CCLOG("PUParticle3DQuadRender::render create index buffer failed"); + AXLOG("PUParticle3DQuadRender::render create index buffer failed"); return; } } @@ -508,7 +508,7 @@ void PUParticle3DModelRender::render(Renderer* renderer, const Mat4& transform, MeshRenderer* mesh = MeshRenderer::create(_modelFile); if (mesh == nullptr) { - CCLOG("failed to load file %s", _modelFile.c_str()); + AXLOG("failed to load file %s", _modelFile.c_str()); continue; } mesh->setTexture(_texFile); @@ -607,15 +607,15 @@ PUParticle3DEntityRender::PUParticle3DEntityRender() PUParticle3DEntityRender::~PUParticle3DEntityRender() { ; - // CC_SAFE_RELEASE(_texture); - CC_SAFE_RELEASE(_programState); - CC_SAFE_RELEASE(_vertexBuffer); - CC_SAFE_RELEASE(_indexBuffer); + // AX_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_indexBuffer); } bool PUParticle3DEntityRender::initRender(std::string_view texFile) { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); if (!texFile.empty()) { auto tex = Director::getInstance()->getTextureCache()->addImage(texFile); @@ -669,8 +669,8 @@ bool PUParticle3DEntityRender::initRender(std::string_view texFile) _stateBlock.setCullFaceSide(backend::CullMode::BACK); _stateBlock.setCullFace(true); - _meshCommand.setBeforeCallback(CC_CALLBACK_0(PUParticle3DEntityRender::onBeforeDraw, this)); - _meshCommand.setAfterCallback(CC_CALLBACK_0(PUParticle3DEntityRender::onAfterDraw, this)); + _meshCommand.setBeforeCallback(AX_CALLBACK_0(PUParticle3DEntityRender::onBeforeDraw, this)); + _meshCommand.setAfterCallback(AX_CALLBACK_0(PUParticle3DEntityRender::onAfterDraw, this)); return true; } @@ -701,7 +701,7 @@ PUParticle3DBoxRender* PUParticle3DBoxRender::create(std::string_view texFile) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -725,7 +725,7 @@ void PUParticle3DBoxRender::render(Renderer* renderer, const Mat4& transform, Pa backend::BufferType::VERTEX, backend::BufferUsage::DYNAMIC); if (_vertexBuffer == nullptr) { - CCLOG("PUParticle3DBoxRender::render create vertex buffer failed"); + AXLOG("PUParticle3DBoxRender::render create vertex buffer failed"); return; } _vertices.resize(8 * particleSystem->getParticleQuota()); @@ -735,7 +735,7 @@ void PUParticle3DBoxRender::render(Renderer* renderer, const Mat4& transform, Pa backend::BufferType::INDEX, backend::BufferUsage::DYNAMIC); if (_indexBuffer == nullptr) { - CCLOG("PUParticle3DBoxRender::render create index buffer failed"); + AXLOG("PUParticle3DBoxRender::render create index buffer failed"); return; } _indices.resize(36 * particleSystem->getParticleQuota()); @@ -891,7 +891,7 @@ PUSphereRender* PUSphereRender::create(std::string_view texFile) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -917,7 +917,7 @@ void PUSphereRender::render(Renderer* renderer, const Mat4& transform, ParticleS backend::BufferType::VERTEX, backend::BufferUsage::DYNAMIC); if (_vertexBuffer == nullptr) { - CCLOG("PUSphereRender::render create vertex buffer failed"); + AXLOG("PUSphereRender::render create vertex buffer failed"); return; } _vertices.resize(vertexCount * particleSystem->getParticleQuota()); @@ -927,7 +927,7 @@ void PUSphereRender::render(Renderer* renderer, const Mat4& transform, ParticleS backend::BufferUsage::DYNAMIC); if (_indexBuffer == nullptr) { - CCLOG("PUSphereRender::render create index buffer failed"); + AXLOG("PUSphereRender::render create index buffer failed"); return; } _indices.resize(indexCount * particleSystem->getParticleQuota()); diff --git a/extensions/Particle3D/PU/CCPURender.h b/extensions/Particle3D/PU/CCPURender.h index 082833cc13..1abb123a4b 100644 --- a/extensions/Particle3D/PU/CCPURender.h +++ b/extensions/Particle3D/PU/CCPURender.h @@ -40,7 +40,7 @@ NS_AX_BEGIN // particle render for quad struct PUParticle3D; -class CC_EX_DLL PURender : public Particle3DRender +class AX_EX_DLL PURender : public Particle3DRender { public: virtual void prepare(){}; @@ -61,7 +61,7 @@ protected: std::string _renderType; }; -class CC_EX_DLL PUParticle3DEntityRender : public PURender +class AX_EX_DLL PUParticle3DEntityRender : public PURender { public: void copyAttributesTo(PUParticle3DEntityRender* render); @@ -109,7 +109,7 @@ protected: bool _rendererDepthWrite = false; }; -class CC_EX_DLL PUParticle3DQuadRender : public PUParticle3DEntityRender +class AX_EX_DLL PUParticle3DQuadRender : public PUParticle3DEntityRender { public: enum Type @@ -188,7 +188,7 @@ protected: }; // particle render for MeshRenderer -class CC_EX_DLL PUParticle3DModelRender : public PURender +class AX_EX_DLL PUParticle3DModelRender : public PURender { public: static PUParticle3DModelRender* create(std::string_view modelFile, std::string_view texFile = ""); @@ -209,7 +209,7 @@ protected: Vec3 _meshSize; }; -class CC_EX_DLL PUParticle3DBoxRender : public PUParticle3DEntityRender +class AX_EX_DLL PUParticle3DBoxRender : public PUParticle3DEntityRender { public: static PUParticle3DBoxRender* create(std::string_view texFile = ""); @@ -225,7 +225,7 @@ protected: void reBuildIndices(unsigned short count); }; -class CC_EX_DLL PUSphereRender : public PUParticle3DEntityRender +class AX_EX_DLL PUSphereRender : public PUParticle3DEntityRender { public: static PUSphereRender* create(std::string_view texFile = ""); diff --git a/extensions/Particle3D/PU/CCPURendererTranslator.h b/extensions/Particle3D/PU/CCPURendererTranslator.h index 54d8afe466..775eeb0c4f 100644 --- a/extensions/Particle3D/PU/CCPURendererTranslator.h +++ b/extensions/Particle3D/PU/CCPURendererTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_RENDERER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_RENDERER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_RENDERER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_RENDERER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPURender.h" #include "extensions/Particle3D/PU/CCPUBeamRender.h" diff --git a/extensions/Particle3D/PU/CCPURibbonTrail.cpp b/extensions/Particle3D/PU/CCPURibbonTrail.cpp index 4d75674e39..fe3c518fc0 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrail.cpp +++ b/extensions/Particle3D/PU/CCPURibbonTrail.cpp @@ -59,7 +59,7 @@ void PURibbonTrail::addNode(Node* n) { if (_nodeList.size() == _chainCount) { - CCASSERT(false, " cannot monitor any more nodes, chain count exceeded"); + AXASSERT(false, " cannot monitor any more nodes, chain count exceeded"); } // if (n->getListener()) @@ -87,7 +87,7 @@ size_t PURibbonTrail::getChainIndexForNode(const Node* n) NodeToChainSegmentMap::const_iterator i = _nodeToSegMap.find(n); if (i == _nodeToSegMap.end()) { - CCASSERT(false, "This node is not being tracked"); + AXASSERT(false, "This node is not being tracked"); } return i->second; } @@ -130,7 +130,7 @@ void PURibbonTrail::setMaxChainElements(size_t maxElements) //----------------------------------------------------------------------- void PURibbonTrail::setNumberOfChains(size_t numChains) { - CCASSERT(numChains >= _nodeList.size(), "Can't shrink the number of chains less than number of tracking nodes"); + AXASSERT(numChains >= _nodeList.size(), "Can't shrink the number of chains less than number of tracking nodes"); size_t oldChains = getNumberOfChains(); @@ -181,7 +181,7 @@ void PURibbonTrail::setInitialColour(size_t chainIndex, const Vec4& col) //----------------------------------------------------------------------- void PURibbonTrail::setInitialColour(size_t chainIndex, float r, float g, float b, float a) { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); _initialColor[chainIndex].x = r; _initialColor[chainIndex].y = g; _initialColor[chainIndex].z = b; @@ -190,19 +190,19 @@ void PURibbonTrail::setInitialColour(size_t chainIndex, float r, float g, float //----------------------------------------------------------------------- const Vec4& PURibbonTrail::getInitialColour(size_t chainIndex) const { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); return _initialColor[chainIndex]; } //----------------------------------------------------------------------- void PURibbonTrail::setInitialWidth(size_t chainIndex, float width) { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); _initialWidth[chainIndex] = width; } //----------------------------------------------------------------------- float PURibbonTrail::getInitialWidth(size_t chainIndex) const { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); return _initialWidth[chainIndex]; } //----------------------------------------------------------------------- @@ -213,7 +213,7 @@ void PURibbonTrail::setColourChange(size_t chainIndex, const Vec4& valuePerSecon //----------------------------------------------------------------------- void PURibbonTrail::setColourChange(size_t chainIndex, float r, float g, float b, float a) { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); _deltaColor[chainIndex].x = r; _deltaColor[chainIndex].y = g; _deltaColor[chainIndex].z = b; @@ -224,20 +224,20 @@ void PURibbonTrail::setColourChange(size_t chainIndex, float r, float g, float b //----------------------------------------------------------------------- const Vec4& PURibbonTrail::getColourChange(size_t chainIndex) const { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); return _deltaColor[chainIndex]; } //----------------------------------------------------------------------- void PURibbonTrail::setWidthChange(size_t chainIndex, float widthDeltaPerSecond) { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); _deltaWidth[chainIndex] = widthDeltaPerSecond; manageController(); } //----------------------------------------------------------------------- float PURibbonTrail::getWidthChange(size_t chainIndex) const { - CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); + AXASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); return _deltaWidth[chainIndex]; } //----------------------------------------------------------------------- diff --git a/extensions/Particle3D/PU/CCPURibbonTrail.h b/extensions/Particle3D/PU/CCPURibbonTrail.h index 2a3a6a5df8..ad8bee4c79 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrail.h +++ b/extensions/Particle3D/PU/CCPURibbonTrail.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_RIBBON_TRAIL_H__ -#define __CC_PU_PARTICLE_3D_RIBBON_TRAIL_H__ +#ifndef __AX_PU_PARTICLE_3D_RIBBON_TRAIL_H__ +#define __AX_PU_PARTICLE_3D_RIBBON_TRAIL_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp b/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp index c0f77101df..f70fb6d37f 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp +++ b/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp @@ -280,7 +280,7 @@ void PURibbonTrailRender::prepare() _visualData.push_back(visualData); // Used to assign to a particle if (_randomInitialColor) { - _trail->setInitialColour(i, CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1()); + _trail->setInitialColour(i, AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1()); } else { @@ -332,7 +332,7 @@ void PURibbonTrailRender::destroyAll() } // Delete the Ribbontrail - CC_SAFE_DELETE(_trail); + AX_SAFE_DELETE(_trail); // Delete the visual data std::vector::const_iterator it; diff --git a/extensions/Particle3D/PU/CCPURibbonTrailRender.h b/extensions/Particle3D/PU/CCPURibbonTrailRender.h index cc3a17b78d..0ca85b7d57 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrailRender.h +++ b/extensions/Particle3D/PU/CCPURibbonTrailRender.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_RIBBON_TRAIL_RENDER_H__ -#define __CC_PU_PARTICLE_3D_RIBBON_TRAIL_RENDER_H__ +#ifndef __AX_PU_PARTICLE_3D_RIBBON_TRAIL_RENDER_H__ +#define __AX_PU_PARTICLE_3D_RIBBON_TRAIL_RENDER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -71,7 +71,7 @@ public: }; // particle render for quad -class CC_EX_DLL PURibbonTrailRender : public PURender, public PUListener +class AX_EX_DLL PURibbonTrailRender : public PURender, public PUListener { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUScaleAffector.cpp b/extensions/Particle3D/PU/CCPUScaleAffector.cpp index 4129908837..5e387c31ae 100644 --- a/extensions/Particle3D/PU/CCPUScaleAffector.cpp +++ b/extensions/Particle3D/PU/CCPUScaleAffector.cpp @@ -59,26 +59,26 @@ PUScaleAffector::~PUScaleAffector() { if (_dynScaleX) { - CC_SAFE_DELETE(_dynScaleX); + AX_SAFE_DELETE(_dynScaleX); } if (_dynScaleY) { - CC_SAFE_DELETE(_dynScaleY); + AX_SAFE_DELETE(_dynScaleY); } if (_dynScaleZ) { - CC_SAFE_DELETE(_dynScaleZ); + AX_SAFE_DELETE(_dynScaleZ); } if (_dynScaleXYZ) { - CC_SAFE_DELETE(_dynScaleXYZ); + AX_SAFE_DELETE(_dynScaleXYZ); } } //----------------------------------------------------------------------- void PUScaleAffector::setDynScaleX(PUDynamicAttribute* dynScaleX) { if (_dynScaleX) - CC_SAFE_DELETE(_dynScaleX); + AX_SAFE_DELETE(_dynScaleX); _dynScaleX = dynScaleX; _dynScaleXSet = true; @@ -88,7 +88,7 @@ void PUScaleAffector::resetDynScaleX(bool resetToDefault) { if (resetToDefault) { - CC_SAFE_DELETE(_dynScaleX); + AX_SAFE_DELETE(_dynScaleX); _dynScaleX = new PUDynamicAttributeFixed(); (static_cast(_dynScaleX))->setValue(DEFAULT_X_SCALE); _dynScaleXSet = false; @@ -102,7 +102,7 @@ void PUScaleAffector::resetDynScaleX(bool resetToDefault) void PUScaleAffector::setDynScaleY(PUDynamicAttribute* dynScaleY) { if (_dynScaleY) - CC_SAFE_DELETE(_dynScaleY); + AX_SAFE_DELETE(_dynScaleY); _dynScaleY = dynScaleY; _dynScaleYSet = true; @@ -113,7 +113,7 @@ void PUScaleAffector::resetDynScaleY(bool resetToDefault) if (resetToDefault) { - CC_SAFE_DELETE(_dynScaleY); + AX_SAFE_DELETE(_dynScaleY); _dynScaleY = new PUDynamicAttributeFixed(); (static_cast(_dynScaleY))->setValue(DEFAULT_X_SCALE); _dynScaleYSet = false; @@ -127,7 +127,7 @@ void PUScaleAffector::resetDynScaleY(bool resetToDefault) void PUScaleAffector::setDynScaleZ(PUDynamicAttribute* dynScaleZ) { if (_dynScaleZ) - CC_SAFE_DELETE(_dynScaleZ); + AX_SAFE_DELETE(_dynScaleZ); _dynScaleZ = dynScaleZ; _dynScaleZSet = true; @@ -137,7 +137,7 @@ void PUScaleAffector::resetDynScaleZ(bool resetToDefault) { if (resetToDefault) { - CC_SAFE_DELETE(_dynScaleZ); + AX_SAFE_DELETE(_dynScaleZ); _dynScaleZ = new PUDynamicAttributeFixed(); (static_cast(_dynScaleZ))->setValue(DEFAULT_X_SCALE); _dynScaleYSet = false; @@ -151,7 +151,7 @@ void PUScaleAffector::resetDynScaleZ(bool resetToDefault) void PUScaleAffector::setDynScaleXYZ(PUDynamicAttribute* dynScaleXYZ) { if (_dynScaleXYZ) - CC_SAFE_DELETE(_dynScaleXYZ); + AX_SAFE_DELETE(_dynScaleXYZ); _dynScaleXYZ = dynScaleXYZ; _dynScaleXYZSet = true; @@ -161,7 +161,7 @@ void PUScaleAffector::resetDynScaleXYZ(bool resetToDefault) { if (resetToDefault) { - CC_SAFE_DELETE(_dynScaleXYZ); + AX_SAFE_DELETE(_dynScaleXYZ); _dynScaleXYZ = new PUDynamicAttributeFixed(); (static_cast(_dynScaleXYZ))->setValue(DEFAULT_XYZ_SCALE); _dynScaleXYZSet = false; diff --git a/extensions/Particle3D/PU/CCPUScaleAffector.h b/extensions/Particle3D/PU/CCPUScaleAffector.h index 45ef1929fb..e67cbd0c0a 100644 --- a/extensions/Particle3D/PU/CCPUScaleAffector.h +++ b/extensions/Particle3D/PU/CCPUScaleAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SCALE_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_SCALE_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SCALE_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_SCALE_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUScaleAffector : public PUAffector +class AX_EX_DLL PUScaleAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUScaleAffectorTranslator.h b/extensions/Particle3D/PU/CCPUScaleAffectorTranslator.h index 198ed845ee..993471bfaa 100644 --- a/extensions/Particle3D/PU/CCPUScaleAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUScaleAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SCALE_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SCALE_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SCALE_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SCALE_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUScaleVelocityAffector.cpp b/extensions/Particle3D/PU/CCPUScaleVelocityAffector.cpp index 9e4172cc24..7d192ac6d5 100644 --- a/extensions/Particle3D/PU/CCPUScaleVelocityAffector.cpp +++ b/extensions/Particle3D/PU/CCPUScaleVelocityAffector.cpp @@ -42,7 +42,7 @@ PUScaleVelocityAffector::~PUScaleVelocityAffector() { if (_dynScaleVelocity) { - CC_SAFE_DELETE(_dynScaleVelocity); + AX_SAFE_DELETE(_dynScaleVelocity); } } //----------------------------------------------------------------------- @@ -91,7 +91,7 @@ void PUScaleVelocityAffector::updatePUAffector(PUParticle3D* particle, float del void PUScaleVelocityAffector::setDynScaleVelocity(PUDynamicAttribute* dynScaleVelocity) { if (_dynScaleVelocity) - CC_SAFE_DELETE(_dynScaleVelocity); + AX_SAFE_DELETE(_dynScaleVelocity); _dynScaleVelocity = dynScaleVelocity; } @@ -100,7 +100,7 @@ void PUScaleVelocityAffector::resetDynScaleVelocity(bool resetToDefault) { if (resetToDefault) { - CC_SAFE_DELETE(_dynScaleVelocity); + AX_SAFE_DELETE(_dynScaleVelocity); _dynScaleVelocity = new PUDynamicAttributeFixed(); (static_cast(_dynScaleVelocity))->setValue(DEFAULT_VELOCITY_SCALE); } diff --git a/extensions/Particle3D/PU/CCPUScaleVelocityAffector.h b/extensions/Particle3D/PU/CCPUScaleVelocityAffector.h index 011f7b15e8..511c235eda 100644 --- a/extensions/Particle3D/PU/CCPUScaleVelocityAffector.h +++ b/extensions/Particle3D/PU/CCPUScaleVelocityAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUScaleVelocityAffector : public PUAffector +class AX_EX_DLL PUScaleVelocityAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUScaleVelocityAffectorTranslator.h b/extensions/Particle3D/PU/CCPUScaleVelocityAffectorTranslator.h index 378ec45405..ed1a1de115 100644 --- a/extensions/Particle3D/PU/CCPUScaleVelocityAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUScaleVelocityAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUScriptCompiler.h b/extensions/Particle3D/PU/CCPUScriptCompiler.h index 86f381ca41..a015ca063a 100644 --- a/extensions/Particle3D/PU/CCPUScriptCompiler.h +++ b/extensions/Particle3D/PU/CCPUScriptCompiler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_SCRIPT_COMPILER_H__ -#define __CC_PU_SCRIPT_COMPILER_H__ +#ifndef __AX_PU_SCRIPT_COMPILER_H__ +#define __AX_PU_SCRIPT_COMPILER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUScriptParser.h" @@ -45,10 +45,10 @@ enum PUAbstractNodeType ANT_VARIABLE_SET, ANT_VARIABLE_ACCESS }; -class CC_EX_DLL PUAbstractNode; +class AX_EX_DLL PUAbstractNode; typedef std::list PUAbstractNodeList; -class CC_EX_DLL PUAbstractNode +class AX_EX_DLL PUAbstractNode { public: std::string file; @@ -69,7 +69,7 @@ public: }; /** This specific abstract node represents a script object */ -class CC_EX_DLL PUObjectAbstractNode : public PUAbstractNode +class AX_EX_DLL PUObjectAbstractNode : public PUAbstractNode { private: hlookup::string_map _env; @@ -95,7 +95,7 @@ public: }; /** This abstract node represents a script property */ -class CC_EX_DLL PUPropertyAbstractNode : public PUAbstractNode +class AX_EX_DLL PUPropertyAbstractNode : public PUAbstractNode { public: std::string name; @@ -110,7 +110,7 @@ public: }; /** This is an abstract node which cannot be broken down further */ -class CC_EX_DLL PUAtomAbstractNode : public PUAbstractNode +class AX_EX_DLL PUAtomAbstractNode : public PUAbstractNode { public: std::string value; @@ -125,8 +125,8 @@ private: void parseNumber() const; }; -class CC_EX_DLL PUParticleSystem3D; -class CC_EX_DLL PUScriptCompiler +class AX_EX_DLL PUParticleSystem3D; +class AX_EX_DLL PUScriptCompiler { private: diff --git a/extensions/Particle3D/PU/CCPUScriptLexer.h b/extensions/Particle3D/PU/CCPUScriptLexer.h index 65845d09b4..3dd937dd42 100644 --- a/extensions/Particle3D/PU/CCPUScriptLexer.h +++ b/extensions/Particle3D/PU/CCPUScriptLexer.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_SCRIPT_LEXER_H__ -#define __CC_PU_SCRIPT_LEXER_H__ +#ifndef __AX_PU_SCRIPT_LEXER_H__ +#define __AX_PU_SCRIPT_LEXER_H__ #include "base/CCRef.h" #include diff --git a/extensions/Particle3D/PU/CCPUScriptParser.h b/extensions/Particle3D/PU/CCPUScriptParser.h index 2f76123dc9..2999f7c55c 100644 --- a/extensions/Particle3D/PU/CCPUScriptParser.h +++ b/extensions/Particle3D/PU/CCPUScriptParser.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_SCRIPT_PARSER_H__ -#define __CC_PU_SCRIPT_PARSER_H__ +#ifndef __AX_PU_SCRIPT_PARSER_H__ +#define __AX_PU_SCRIPT_PARSER_H__ #include #include diff --git a/extensions/Particle3D/PU/CCPUScriptTranslator.cpp b/extensions/Particle3D/PU/CCPUScriptTranslator.cpp index dca1ceb6b0..a011cd4785 100644 --- a/extensions/Particle3D/PU/CCPUScriptTranslator.cpp +++ b/extensions/Particle3D/PU/CCPUScriptTranslator.cpp @@ -739,7 +739,7 @@ bool PUScriptTranslator::passValidatePropertyValidQuaternion(PUScriptCompiler* / //------------------------------------------------------------------------- void PUScriptTranslator::errorUnexpectedToken(PUScriptCompiler* /*compiler*/, PUAbstractNode* /*token2*/) { - // CCLOGERROR("PU Compiler: token2 is not recognized tokenFile:%s tokenLine:%s",) + // AXLOGERROR("PU Compiler: token2 is not recognized tokenFile:%s tokenLine:%s",) // printf() // compiler->addError(ScriptCompiler::CE_UNEXPECTEDTOKEN, token.getPointer()->file, token.getPointer()->line, // ); diff --git a/extensions/Particle3D/PU/CCPUScriptTranslator.h b/extensions/Particle3D/PU/CCPUScriptTranslator.h index 74fbe3ded4..3e82d92524 100644 --- a/extensions/Particle3D/PU/CCPUScriptTranslator.h +++ b/extensions/Particle3D/PU/CCPUScriptTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_SCRIPT_TRANSLATOR_H__ -#define __CC_PU_SCRIPT_TRANSLATOR_H__ +#ifndef __AX_PU_SCRIPT_TRANSLATOR_H__ +#define __AX_PU_SCRIPT_TRANSLATOR_H__ #include diff --git a/extensions/Particle3D/PU/CCPUSimpleSpline.cpp b/extensions/Particle3D/PU/CCPUSimpleSpline.cpp index 66f86bb097..60ecfe5580 100644 --- a/extensions/Particle3D/PU/CCPUSimpleSpline.cpp +++ b/extensions/Particle3D/PU/CCPUSimpleSpline.cpp @@ -82,7 +82,7 @@ Vec3 PUSimpleSpline::interpolate(float t) const Vec3 PUSimpleSpline::interpolate(unsigned int fromIndex, float t) const { // Bounds check - CCASSERT(fromIndex < _points.size(), "fromIndex out of bounds"); + AXASSERT(fromIndex < _points.size(), "fromIndex out of bounds"); if ((fromIndex + 1) == _points.size()) { @@ -204,7 +204,7 @@ void PUSimpleSpline::recalcTangents() //--------------------------------------------------------------------- const Vec3& PUSimpleSpline::getPoint(unsigned short index) const { - CCASSERT(index < _points.size(), "Point index is out of bounds!!"); + AXASSERT(index < _points.size(), "Point index is out of bounds!!"); return _points[index]; } @@ -222,7 +222,7 @@ void PUSimpleSpline::clear() //--------------------------------------------------------------------- void PUSimpleSpline::updatePoint(unsigned short index, const Vec3& value) { - CCASSERT(index < _points.size(), "Point index is out of bounds!!"); + AXASSERT(index < _points.size(), "Point index is out of bounds!!"); _points[index] = value; if (_autoCalc) diff --git a/extensions/Particle3D/PU/CCPUSimpleSpline.h b/extensions/Particle3D/PU/CCPUSimpleSpline.h index e029a6f2f5..1a9c1ba7d7 100644 --- a/extensions/Particle3D/PU/CCPUSimpleSpline.h +++ b/extensions/Particle3D/PU/CCPUSimpleSpline.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SIMPLE_SPLINE_H__ -#define __CC_PU_PARTICLE_3D_SIMPLE_SPLINE_H__ +#ifndef __AX_PU_PARTICLE_3D_SIMPLE_SPLINE_H__ +#define __AX_PU_PARTICLE_3D_SIMPLE_SPLINE_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPUSineForceAffector.h b/extensions/Particle3D/PU/CCPUSineForceAffector.h index 818fd5e94b..3d7fd8ee74 100644 --- a/extensions/Particle3D/PU/CCPUSineForceAffector.h +++ b/extensions/Particle3D/PU/CCPUSineForceAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_H__ #include "CCPUBaseForceAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PUSineForceAffector : public PUBaseForceAffector +class AX_EX_DLL PUSineForceAffector : public PUBaseForceAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUSineForceAffectorTranslator.h b/extensions/Particle3D/PU/CCPUSineForceAffectorTranslator.h index 66ccf66868..bbc0836f0a 100644 --- a/extensions/Particle3D/PU/CCPUSineForceAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUSineForceAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUSlaveBehaviour.h b/extensions/Particle3D/PU/CCPUSlaveBehaviour.h index dcbe042ded..d8ca31784a 100644 --- a/extensions/Particle3D/PU/CCPUSlaveBehaviour.h +++ b/extensions/Particle3D/PU/CCPUSlaveBehaviour.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__ -#define __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__ +#ifndef __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__ +#define __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUSlaveBehaviour : public PUBehaviour +class AX_EX_DLL PUSlaveBehaviour : public PUBehaviour { public: static PUSlaveBehaviour* create(); diff --git a/extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.h b/extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.h index 491c18b6c3..3702bbf7e3 100644 --- a/extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.h +++ b/extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUSlaveEmitter.h b/extensions/Particle3D/PU/CCPUSlaveEmitter.h index 290d07ad67..6f393c56fa 100644 --- a/extensions/Particle3D/PU/CCPUSlaveEmitter.h +++ b/extensions/Particle3D/PU/CCPUSlaveEmitter.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SLAVE_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_SLAVE_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_SLAVE_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_SLAVE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" #include "extensions/Particle3D/PU/CCPUListener.h" NS_AX_BEGIN // FIXME -class CC_EX_DLL PUSlaveEmitter : public PUEmitter, public PUListener +class AX_EX_DLL PUSlaveEmitter : public PUEmitter, public PUListener { public: static PUSlaveEmitter* create(); diff --git a/extensions/Particle3D/PU/CCPUSlaveEmitterTranslator.h b/extensions/Particle3D/PU/CCPUSlaveEmitterTranslator.h index 35ec9dc36c..98a39a3ff3 100644 --- a/extensions/Particle3D/PU/CCPUSlaveEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUSlaveEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SLAVE_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SLAVE_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SLAVE_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SLAVE_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUSphere.h b/extensions/Particle3D/PU/CCPUSphere.h index 1650682c17..f35d6a0c53 100644 --- a/extensions/Particle3D/PU/CCPUSphere.h +++ b/extensions/Particle3D/PU/CCPUSphere.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SPHERE_H__ -#define __CC_PU_PARTICLE_3D_SPHERE_H__ +#ifndef __AX_PU_PARTICLE_3D_SPHERE_H__ +#define __AX_PU_PARTICLE_3D_SPHERE_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPUSphereCollider.h b/extensions/Particle3D/PU/CCPUSphereCollider.h index 7d080b7fde..14413a8b97 100644 --- a/extensions/Particle3D/PU/CCPUSphereCollider.h +++ b/extensions/Particle3D/PU/CCPUSphereCollider.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SPHERE_COLLIDER_H__ -#define __CC_PU_PARTICLE_3D_SPHERE_COLLIDER_H__ +#ifndef __AX_PU_PARTICLE_3D_SPHERE_COLLIDER_H__ +#define __AX_PU_PARTICLE_3D_SPHERE_COLLIDER_H__ #include "CCPUBaseCollider.h" #include "extensions/Particle3D/PU/CCPUSphere.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUSphereCollider : public PUBaseCollider +class AX_EX_DLL PUSphereCollider : public PUBaseCollider { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUSphereColliderTranslator.h b/extensions/Particle3D/PU/CCPUSphereColliderTranslator.h index e12edc90a9..0cd2fa2f40 100644 --- a/extensions/Particle3D/PU/CCPUSphereColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUSphereColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SPHERE_COLLIDER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SPHERE_COLLIDER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SPHERE_COLLIDER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SPHERE_COLLIDER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.cpp b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.cpp index 87df8cf1da..950864c2cf 100644 --- a/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.cpp +++ b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.cpp @@ -49,7 +49,7 @@ void PUSphereSurfaceEmitter::initParticlePosition(PUParticle3D* particle) { // Generate a random unit vector to calculate a point on the sphere. This unit vector is // also used as direction vector if mAutoDirection has been set. - _randomVector.set(CCRANDOM_MINUS1_1(), CCRANDOM_MINUS1_1(), CCRANDOM_MINUS1_1()); + _randomVector.set(AXRANDOM_MINUS1_1(), AXRANDOM_MINUS1_1(), AXRANDOM_MINUS1_1()); _randomVector.normalize(); // ParticleSystem* sys = mParentTechnique->getParentSystem(); // if (sys) diff --git a/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.h b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.h index 44fa5f690c..2ed2770084 100644 --- a/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.h +++ b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SPHERE_SURFACE_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_SPHERE_SURFACE_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_SPHERE_SURFACE_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_SPHERE_SURFACE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class CC_EX_DLL PUSphereSurfaceEmitter : public PUEmitter +class AX_EX_DLL PUSphereSurfaceEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUSphereSurfaceEmitterTranslator.h b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitterTranslator.h index 3fc10b4e5e..fa9e723a76 100644 --- a/extensions/Particle3D/PU/CCPUSphereSurfaceEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SPHERE_SURFACE_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SPHERE_SURFACE_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SPHERE_SURFACE_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SPHERE_SURFACE_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUTechniqueTranslator.h b/extensions/Particle3D/PU/CCPUTechniqueTranslator.h index 2fcecf412f..f31222aec3 100644 --- a/extensions/Particle3D/PU/CCPUTechniqueTranslator.h +++ b/extensions/Particle3D/PU/CCPUTechniqueTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_TECHNIQUE_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_TECHNIQUE_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_TECHNIQUE_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_TECHNIQUE_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUParticleSystem3D.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUTextureAnimator.h b/extensions/Particle3D/PU/CCPUTextureAnimator.h index a602caf9a3..99ab8ffbc8 100644 --- a/extensions/Particle3D/PU/CCPUTextureAnimator.h +++ b/extensions/Particle3D/PU/CCPUTextureAnimator.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_TEXTURE_ANIMATOR_H__ -#define __CC_PU_PARTICLE_3D_TEXTURE_ANIMATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_TEXTURE_ANIMATOR_H__ +#define __AX_PU_PARTICLE_3D_TEXTURE_ANIMATOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PUTextureAnimator : public PUAffector +class AX_EX_DLL PUTextureAnimator : public PUAffector { public: enum TextureAnimationType diff --git a/extensions/Particle3D/PU/CCPUTextureAnimatorTranslator.h b/extensions/Particle3D/PU/CCPUTextureAnimatorTranslator.h index d00edc86f3..0626cc5f47 100644 --- a/extensions/Particle3D/PU/CCPUTextureAnimatorTranslator.h +++ b/extensions/Particle3D/PU/CCPUTextureAnimatorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_TEXTURE_ANIMATOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_TEXTURE_ANIMATOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_TEXTURE_ANIMATOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_TEXTURE_ANIMATOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUTextureRotator.cpp b/extensions/Particle3D/PU/CCPUTextureRotator.cpp index b76464c702..1d89267b1b 100644 --- a/extensions/Particle3D/PU/CCPUTextureRotator.cpp +++ b/extensions/Particle3D/PU/CCPUTextureRotator.cpp @@ -50,12 +50,12 @@ PUTextureRotator::~PUTextureRotator() { if (_dynRotation) { - CC_SAFE_DELETE(_dynRotation); + AX_SAFE_DELETE(_dynRotation); } if (_dynRotationSpeed) { - CC_SAFE_DELETE(_dynRotationSpeed); + AX_SAFE_DELETE(_dynRotationSpeed); } } //----------------------------------------------------------------------- @@ -77,7 +77,7 @@ PUDynamicAttribute* PUTextureRotator::getRotation() const void PUTextureRotator::setRotation(PUDynamicAttribute* dynRotation) { if (_dynRotation) - CC_SAFE_DELETE(_dynRotation); + AX_SAFE_DELETE(_dynRotation); _dynRotation = dynRotation; } @@ -90,7 +90,7 @@ PUDynamicAttribute* PUTextureRotator::getRotationSpeed() const void PUTextureRotator::setRotationSpeed(PUDynamicAttribute* dynRotationSpeed) { if (_dynRotationSpeed) - CC_SAFE_DELETE(_dynRotationSpeed); + AX_SAFE_DELETE(_dynRotationSpeed); _dynRotationSpeed = dynRotationSpeed; } diff --git a/extensions/Particle3D/PU/CCPUTextureRotator.h b/extensions/Particle3D/PU/CCPUTextureRotator.h index 92efa9c34e..ac1a71f822 100644 --- a/extensions/Particle3D/PU/CCPUTextureRotator.h +++ b/extensions/Particle3D/PU/CCPUTextureRotator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_TEXTURE_ROTATOR_H__ -#define __CC_PU_PARTICLE_3D_TEXTURE_ROTATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_TEXTURE_ROTATOR_H__ +#define __AX_PU_PARTICLE_3D_TEXTURE_ROTATOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUTextureRotator : public PUAffector +class AX_EX_DLL PUTextureRotator : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUTextureRotatorTranslator.h b/extensions/Particle3D/PU/CCPUTextureRotatorTranslator.h index 2ec37ecc8d..fe9031871a 100644 --- a/extensions/Particle3D/PU/CCPUTextureRotatorTranslator.h +++ b/extensions/Particle3D/PU/CCPUTextureRotatorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_TEXTURE_ROTATOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_TEXTURE_ROTATOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_TEXTURE_ROTATOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_TEXTURE_ROTATOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUTranslateManager.h b/extensions/Particle3D/PU/CCPUTranslateManager.h index e96f8c1fd2..fe7831eb68 100644 --- a/extensions/Particle3D/PU/CCPUTranslateManager.h +++ b/extensions/Particle3D/PU/CCPUTranslateManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUUtil.cpp b/extensions/Particle3D/PU/CCPUUtil.cpp index e36edd17b6..43d43bda6e 100644 --- a/extensions/Particle3D/PU/CCPUUtil.cpp +++ b/extensions/Particle3D/PU/CCPUUtil.cpp @@ -54,7 +54,7 @@ axis::Vec3 PUUtil::randomDeviant(const Vec3& src, float angle, const Vec3& up /* Quaternion q; Mat4 mat; - Quaternion::createFromAxisAngle(src, CCRANDOM_0_1() * M_PI * 2.0f, &q); + Quaternion::createFromAxisAngle(src, AXRANDOM_0_1() * M_PI * 2.0f, &q); Mat4::createRotation(q, &mat); //{ diff --git a/extensions/Particle3D/PU/CCPUUtil.h b/extensions/Particle3D/PU/CCPUUtil.h index 75aae20fd3..8e885f0bb0 100644 --- a/extensions/Particle3D/PU/CCPUUtil.h +++ b/extensions/Particle3D/PU/CCPUUtil.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_UTIL_H__ -#define __CC_PU_PARTICLE_3D_UTIL_H__ +#ifndef __AX_PU_PARTICLE_3D_UTIL_H__ +#define __AX_PU_PARTICLE_3D_UTIL_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPUVelocityMatchingAffector.h b/extensions/Particle3D/PU/CCPUVelocityMatchingAffector.h index d6a25085cc..7c26161d87 100644 --- a/extensions/Particle3D/PU/CCPUVelocityMatchingAffector.h +++ b/extensions/Particle3D/PU/CCPUVelocityMatchingAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PUVelocityMatchingAffector : public PUAffector +class AX_EX_DLL PUVelocityMatchingAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.h b/extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.h index 654ce49713..0256235e02 100644 --- a/extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUVertexEmitter.h b/extensions/Particle3D/PU/CCPUVertexEmitter.h index c7e0a3a731..d0c947b3d6 100644 --- a/extensions/Particle3D/PU/CCPUVertexEmitter.h +++ b/extensions/Particle3D/PU/CCPUVertexEmitter.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_VERTEX_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_VERTEX_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_VERTEX_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_VERTEX_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" #include diff --git a/extensions/Particle3D/PU/CCPUVortexAffector.cpp b/extensions/Particle3D/PU/CCPUVortexAffector.cpp index 5c338692dc..b36fbd8bd1 100644 --- a/extensions/Particle3D/PU/CCPUVortexAffector.cpp +++ b/extensions/Particle3D/PU/CCPUVortexAffector.cpp @@ -44,7 +44,7 @@ PUVortexAffector::~PUVortexAffector() { if (_dynRotationSpeed) { - CC_SAFE_DELETE(_dynRotationSpeed); + AX_SAFE_DELETE(_dynRotationSpeed); } } //----------------------------------------------------------------------- @@ -66,7 +66,7 @@ PUDynamicAttribute* PUVortexAffector::getRotationSpeed() const void PUVortexAffector::setRotationSpeed(PUDynamicAttribute* dynRotationSpeed) { if (_dynRotationSpeed) - CC_SAFE_DELETE(_dynRotationSpeed); + AX_SAFE_DELETE(_dynRotationSpeed); _dynRotationSpeed = dynRotationSpeed; } diff --git a/extensions/Particle3D/PU/CCPUVortexAffector.h b/extensions/Particle3D/PU/CCPUVortexAffector.h index 7af688df65..13ec67a75d 100644 --- a/extensions/Particle3D/PU/CCPUVortexAffector.h +++ b/extensions/Particle3D/PU/CCPUVortexAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_VORTEX_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_VORTEX_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_VORTEX_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_VORTEX_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUVortexAffector : public PUAffector +class AX_EX_DLL PUVortexAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUVortexAffectorTranslator.h b/extensions/Particle3D/PU/CCPUVortexAffectorTranslator.h index 3f1675a3a8..24c7d08cb4 100644 --- a/extensions/Particle3D/PU/CCPUVortexAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUVortexAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_VORTEX_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_VORTEX_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_VORTEX_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_VORTEX_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/assets-manager/AssetsManager.cpp b/extensions/assets-manager/AssetsManager.cpp index 78e28c2f88..04d566a2e8 100644 --- a/extensions/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/AssetsManager.cpp @@ -210,7 +210,7 @@ AssetsManager::AssetsManager(const char* packageUrl /* =nullptr */, ? int(task.progressInfo.totalBytesReceived * 100 / task.progressInfo.totalBytesExpected) : 0; _delegate->onProgress(percent); - CCLOG("downloading... %d%%", percent); + AXLOG("downloading... %d%%", percent); }; // get version from version file when get data success @@ -225,7 +225,7 @@ AssetsManager::AssetsManager(const char* packageUrl /* =nullptr */, { _delegate->onError(ErrorCode::NO_NEW_VERSION); } - CCLOG("there is not new version"); + AXLOG("there is not new version"); // Set resource search path. setSearchPath(); _isDownloading = false; @@ -238,7 +238,7 @@ AssetsManager::AssetsManager(const char* packageUrl /* =nullptr */, if (_versionFileUrl.empty() || _packageUrl.empty() || FileUtils::getInstance()->getFileExtension(_packageUrl) != ".zip") { - CCLOG("no version file url, or no package url, or the package is not a zip file"); + AXLOG("no version file url, or no package url, or the package is not a zip file"); _isDownloading = false; return; } @@ -266,7 +266,7 @@ AssetsManager::~AssetsManager() { delete _delegate; } - CC_SAFE_DELETE(_downloader); + AX_SAFE_DELETE(_downloader); } void AssetsManager::checkStoragePath() @@ -341,7 +341,7 @@ void AssetsManager::downloadAndUncompress() string zipfileName = this->_storagePath + TEMP_PACKAGE_FILE_NAME; if (remove(zipfileName.c_str()) != 0) { - CCLOG("can not remove downloaded zip file %s", zipfileName.c_str()); + AXLOG("can not remove downloaded zip file %s", zipfileName.c_str()); } if (this->_delegate) @@ -377,7 +377,7 @@ bool AssetsManager::uncompress() unzFile zipfile = unzOpen2(outFileName.c_str(), &zipFunctionOverrides); if (!zipfile) { - CCLOG("can not open downloaded zip file %s", outFileName.c_str()); + AXLOG("can not open downloaded zip file %s", outFileName.c_str()); return false; } @@ -385,7 +385,7 @@ bool AssetsManager::uncompress() unz_global_info global_info; if (unzGetGlobalInfo(zipfile, &global_info) != UNZ_OK) { - CCLOG("can not read file global info of %s", outFileName.c_str()); + AXLOG("can not read file global info of %s", outFileName.c_str()); unzClose(zipfile); return false; } @@ -393,7 +393,7 @@ bool AssetsManager::uncompress() // Buffer to hold data read from the zip file char readBuffer[BUFFER_SIZE]; - CCLOG("start uncompressing"); + AXLOG("start uncompressing"); // Loop to extract all files. uLong i; @@ -404,7 +404,7 @@ bool AssetsManager::uncompress() char fileName[MAX_FILENAME]; if (unzGetCurrentFileInfo(zipfile, &fileInfo, fileName, MAX_FILENAME, nullptr, 0, nullptr, 0) != UNZ_OK) { - CCLOG("can not read file info"); + AXLOG("can not read file info"); unzClose(zipfile); return false; } @@ -419,7 +419,7 @@ bool AssetsManager::uncompress() // If the directory exists, it will failed silently. if (!FileUtils::getInstance()->createDirectory(fullPath)) { - CCLOG("can not create directory %s", fullPath.c_str()); + AXLOG("can not create directory %s", fullPath.c_str()); unzClose(zipfile); return false; } @@ -444,13 +444,13 @@ bool AssetsManager::uncompress() { if (!FileUtils::getInstance()->createDirectory(dir)) { - CCLOG("can not create directory %s", dir.c_str()); + AXLOG("can not create directory %s", dir.c_str()); unzClose(zipfile); return false; } else { - CCLOG("create directory %s", dir.c_str()); + AXLOG("create directory %s", dir.c_str()); } } else @@ -468,7 +468,7 @@ bool AssetsManager::uncompress() // Open current file. if (unzOpenCurrentFile(zipfile) != UNZ_OK) { - CCLOG("can not open file %s", fileName); + AXLOG("can not open file %s", fileName); unzClose(zipfile); return false; } @@ -477,7 +477,7 @@ bool AssetsManager::uncompress() auto fsOut = FileUtils::getInstance()->openFileStream(fullPath, FileStream::Mode::WRITE); if (!fsOut) { - CCLOG("can not open destination file %s", fullPath.c_str()); + AXLOG("can not open destination file %s", fullPath.c_str()); unzCloseCurrentFile(zipfile); unzClose(zipfile); return false; @@ -490,7 +490,7 @@ bool AssetsManager::uncompress() error = unzReadCurrentFile(zipfile, readBuffer, BUFFER_SIZE); if (error < 0) { - CCLOG("can not read zip file %s, error code is %d", fileName, error); + AXLOG("can not read zip file %s, error code is %d", fileName, error); unzCloseCurrentFile(zipfile); unzClose(zipfile); fsOut.reset(); @@ -513,14 +513,14 @@ bool AssetsManager::uncompress() { if (unzGoToNextFile(zipfile) != UNZ_OK) { - CCLOG("can not read next file"); + AXLOG("can not read next file"); unzClose(zipfile); return false; } } } - CCLOG("end uncompressing"); + AXLOG("end uncompressing"); unzClose(zipfile); return true; diff --git a/extensions/assets-manager/AssetsManager.h b/extensions/assets-manager/AssetsManager.h index 0fe26d6926..14f78125be 100644 --- a/extensions/assets-manager/AssetsManager.h +++ b/extensions/assets-manager/AssetsManager.h @@ -54,7 +54,7 @@ class AssetsManagerDelegateProtocol; * The updated package should be a zip file. And there should be a file named * version in the server, which contains version code. */ -class CC_EX_DLL AssetsManager : public Node +class AX_EX_DLL AssetsManager : public Node { public: enum class ErrorCode diff --git a/extensions/assets-manager/AssetsManagerEx.cpp b/extensions/assets-manager/AssetsManagerEx.cpp index 5b54625462..329877cb88 100644 --- a/extensions/assets-manager/AssetsManagerEx.cpp +++ b/extensions/assets-manager/AssetsManagerEx.cpp @@ -200,11 +200,11 @@ AssetsManagerEx::~AssetsManagerEx() _downloader->onTaskError = (nullptr); _downloader->onFileTaskSuccess = (nullptr); _downloader->onTaskProgress = (nullptr); - CC_SAFE_RELEASE(_localManifest); + AX_SAFE_RELEASE(_localManifest); // _tempManifest could share a ptr with _remoteManifest or _localManifest if (_tempManifest != _localManifest && _tempManifest != _remoteManifest) - CC_SAFE_RELEASE(_tempManifest); - CC_SAFE_RELEASE(_remoteManifest); + AX_SAFE_RELEASE(_tempManifest); + AX_SAFE_RELEASE(_remoteManifest); } AssetsManagerEx* AssetsManagerEx::create(std::string_view manifestUrl, std::string_view storagePath) @@ -231,7 +231,7 @@ void AssetsManagerEx::initManifests(std::string_view manifestUrl) if (!_tempManifest->isLoaded()) { _fileUtils->removeDirectory(_tempStoragePath); - CC_SAFE_RELEASE(_tempManifest); + AX_SAFE_RELEASE(_tempManifest); _tempManifest = nullptr; } } @@ -241,9 +241,9 @@ void AssetsManagerEx::initManifests(std::string_view manifestUrl) if (!_inited) { - CC_SAFE_RELEASE(_localManifest); - CC_SAFE_RELEASE(_tempManifest); - CC_SAFE_RELEASE(_remoteManifest); + AX_SAFE_RELEASE(_localManifest); + AX_SAFE_RELEASE(_tempManifest); + AX_SAFE_RELEASE(_remoteManifest); _localManifest = nullptr; _tempManifest = nullptr; _remoteManifest = nullptr; @@ -270,7 +270,7 @@ void AssetsManagerEx::loadLocalManifest(std::string_view /*manifestUrl*/) if (!cachedManifest->isLoaded()) { _fileUtils->removeFile(_cacheManifestPath); - CC_SAFE_RELEASE(cachedManifest); + AX_SAFE_RELEASE(cachedManifest); cachedManifest = nullptr; } } @@ -309,11 +309,11 @@ void AssetsManagerEx::loadLocalManifest(std::string_view /*manifestUrl*/) // Recreate storage, to empty the content _fileUtils->removeDirectory(_storagePath); _fileUtils->createDirectory(_storagePath); - CC_SAFE_RELEASE(cachedManifest); + AX_SAFE_RELEASE(cachedManifest); } else { - CC_SAFE_RELEASE(_localManifest); + AX_SAFE_RELEASE(_localManifest); _localManifest = cachedManifest; } } @@ -323,7 +323,7 @@ void AssetsManagerEx::loadLocalManifest(std::string_view /*manifestUrl*/) // Fail to load local manifest if (!_localManifest->isLoaded()) { - CCLOG("AssetsManagerEx : No local manifest file found error.\n"); + AXLOG("AssetsManagerEx : No local manifest file found error.\n"); dispatchUpdateEvent(EventAssetsManagerEx::EventCode::ERROR_NO_LOCAL_MANIFEST); } } @@ -394,7 +394,7 @@ bool AssetsManagerEx::decompress(std::string_view zip) size_t pos = zip.find_last_of("/\\"); if (pos == std::string::npos) { - CCLOG("AssetsManagerEx : no root path specified for zip file %s\n", zip.data()); + AXLOG("AssetsManagerEx : no root path specified for zip file %s\n", zip.data()); return false; } const std::string_view rootPath = zip.substr(0, pos + 1); @@ -411,7 +411,7 @@ bool AssetsManagerEx::decompress(std::string_view zip) unzFile zipfile = unzOpen2(zip.data(), &zipFunctionOverrides); if (!zipfile) { - CCLOG("AssetsManagerEx : can not open downloaded zip file %s\n", zip.data()); + AXLOG("AssetsManagerEx : can not open downloaded zip file %s\n", zip.data()); return false; } @@ -419,7 +419,7 @@ bool AssetsManagerEx::decompress(std::string_view zip) unz_global_info global_info; if (unzGetGlobalInfo(zipfile, &global_info) != UNZ_OK) { - CCLOG("AssetsManagerEx : can not read file global info of %s\n", zip.data()); + AXLOG("AssetsManagerEx : can not read file global info of %s\n", zip.data()); unzClose(zipfile); return false; } @@ -435,7 +435,7 @@ bool AssetsManagerEx::decompress(std::string_view zip) char fileName[MAX_FILENAME]; if (unzGetCurrentFileInfo(zipfile, &fileInfo, fileName, MAX_FILENAME, NULL, 0, NULL, 0) != UNZ_OK) { - CCLOG("AssetsManagerEx : can not read compressed file info\n"); + AXLOG("AssetsManagerEx : can not read compressed file info\n"); unzClose(zipfile); return false; } @@ -451,7 +451,7 @@ bool AssetsManagerEx::decompress(std::string_view zip) if (!_fileUtils->createDirectory(basename(fullPath))) { // Failed to create directory - CCLOG("AssetsManagerEx : can not create directory %s\n", fullPath.c_str()); + AXLOG("AssetsManagerEx : can not create directory %s\n", fullPath.c_str()); unzClose(zipfile); return false; } @@ -465,7 +465,7 @@ bool AssetsManagerEx::decompress(std::string_view zip) if (!_fileUtils->createDirectory(dir)) { // Failed to create directory - CCLOG("AssetsManagerEx : can not create directory %s\n", fullPath.c_str()); + AXLOG("AssetsManagerEx : can not create directory %s\n", fullPath.c_str()); unzClose(zipfile); return false; } @@ -474,7 +474,7 @@ bool AssetsManagerEx::decompress(std::string_view zip) // Open current file. if (unzOpenCurrentFile(zipfile) != UNZ_OK) { - CCLOG("AssetsManagerEx : can not extract file %s\n", fileName); + AXLOG("AssetsManagerEx : can not extract file %s\n", fileName); unzClose(zipfile); return false; } @@ -483,7 +483,7 @@ bool AssetsManagerEx::decompress(std::string_view zip) auto fsOut = FileUtils::getInstance()->openFileStream(fullPath, FileStream::Mode::WRITE); if (!fsOut) { - CCLOG("AssetsManagerEx : can not create decompress destination file %s (errno: %d)\n", fullPath.c_str(), + AXLOG("AssetsManagerEx : can not create decompress destination file %s (errno: %d)\n", fullPath.c_str(), errno); unzCloseCurrentFile(zipfile); unzClose(zipfile); @@ -497,7 +497,7 @@ bool AssetsManagerEx::decompress(std::string_view zip) error = unzReadCurrentFile(zipfile, readBuffer, BUFFER_SIZE); if (error < 0) { - CCLOG("AssetsManagerEx : can not read zip file %s, error code is %d\n", fileName, error); + AXLOG("AssetsManagerEx : can not read zip file %s, error code is %d\n", fileName, error); fsOut.reset(); unzCloseCurrentFile(zipfile); unzClose(zipfile); @@ -520,7 +520,7 @@ bool AssetsManagerEx::decompress(std::string_view zip) { if (unzGoToNextFile(zipfile) != UNZ_OK) { - CCLOG("AssetsManagerEx : can not read next file for decompressing\n"); + AXLOG("AssetsManagerEx : can not read next file for decompressing\n"); unzClose(zipfile); return false; } @@ -630,7 +630,7 @@ void AssetsManagerEx::downloadVersion() // No version file found else { - CCLOG("AssetsManagerEx : No version file found, step skipped\n"); + AXLOG("AssetsManagerEx : No version file found, step skipped\n"); _updateState = State::PREDOWNLOAD_MANIFEST; downloadManifest(); } @@ -645,7 +645,7 @@ void AssetsManagerEx::parseVersion() if (!_remoteManifest->isVersionLoaded()) { - CCLOG("AssetsManagerEx : Fail to parse version file, step skipped\n"); + AXLOG("AssetsManagerEx : Fail to parse version file, step skipped\n"); _updateState = State::PREDOWNLOAD_MANIFEST; downloadManifest(); } @@ -701,7 +701,7 @@ void AssetsManagerEx::downloadManifest() // No manifest file found else { - CCLOG("AssetsManagerEx : No manifest file found, check update failed\n"); + AXLOG("AssetsManagerEx : No manifest file found, check update failed\n"); dispatchUpdateEvent(EventAssetsManagerEx::EventCode::ERROR_DOWNLOAD_MANIFEST); _updateState = State::UNCHECKED; } @@ -716,7 +716,7 @@ void AssetsManagerEx::parseManifest() if (!_remoteManifest->isLoaded()) { - CCLOG("AssetsManagerEx : Error parsing manifest file, %s", _tempManifestPath.c_str()); + AXLOG("AssetsManagerEx : Error parsing manifest file, %s", _tempManifestPath.c_str()); dispatchUpdateEvent(EventAssetsManagerEx::EventCode::ERROR_PARSE_MANIFEST); _updateState = State::UNCHECKED; } @@ -775,7 +775,7 @@ void AssetsManagerEx::startUpdate() { // Remove all temp files _fileUtils->removeDirectory(_tempStoragePath); - CC_SAFE_RELEASE(_tempManifest); + AX_SAFE_RELEASE(_tempManifest); // Recreate temp storage path and save remote manifest _fileUtils->createDirectory(_tempStoragePath); _remoteManifest->saveToFile(_tempManifestPath); @@ -861,7 +861,7 @@ void AssetsManagerEx::updateSucceed() _fileUtils->removeDirectory(_tempStoragePath); } // 3. swap the localManifest - CC_SAFE_RELEASE(_localManifest); + AX_SAFE_RELEASE(_localManifest); _localManifest = _remoteManifest; _localManifest->setManifestRoot(_storagePath); _remoteManifest = nullptr; @@ -877,19 +877,19 @@ void AssetsManagerEx::checkUpdate() { if (_updateEntry != UpdateEntry::NONE) { - CCLOGERROR("AssetsManagerEx::checkUpdate, updateEntry isn't NONE"); + AXLOGERROR("AssetsManagerEx::checkUpdate, updateEntry isn't NONE"); return; } if (!_inited) { - CCLOG("AssetsManagerEx : Manifests uninited.\n"); + AXLOG("AssetsManagerEx : Manifests uninited.\n"); dispatchUpdateEvent(EventAssetsManagerEx::EventCode::ERROR_NO_LOCAL_MANIFEST); return; } if (!_localManifest->isLoaded()) { - CCLOG("AssetsManagerEx : No local manifest file found error.\n"); + AXLOG("AssetsManagerEx : No local manifest file found error.\n"); dispatchUpdateEvent(EventAssetsManagerEx::EventCode::ERROR_NO_LOCAL_MANIFEST); return; } @@ -924,19 +924,19 @@ void AssetsManagerEx::update() { if (_updateEntry != UpdateEntry::NONE) { - CCLOGERROR("AssetsManagerEx::update, updateEntry isn't NONE"); + AXLOGERROR("AssetsManagerEx::update, updateEntry isn't NONE"); return; } if (!_inited) { - CCLOG("AssetsManagerEx : Manifests uninited.\n"); + AXLOG("AssetsManagerEx : Manifests uninited.\n"); dispatchUpdateEvent(EventAssetsManagerEx::EventCode::ERROR_NO_LOCAL_MANIFEST); return; } if (!_localManifest->isLoaded()) { - CCLOG("AssetsManagerEx : No local manifest file found error.\n"); + AXLOG("AssetsManagerEx : No local manifest file found error.\n"); dispatchUpdateEvent(EventAssetsManagerEx::EventCode::ERROR_NO_LOCAL_MANIFEST); return; } @@ -998,7 +998,7 @@ void AssetsManagerEx::updateAssets(const DownloadUnits& assets) { if (!_inited) { - CCLOG("AssetsManagerEx : Manifests uninited.\n"); + AXLOG("AssetsManagerEx : Manifests uninited.\n"); dispatchUpdateEvent(EventAssetsManagerEx::EventCode::ERROR_NO_LOCAL_MANIFEST); return; } @@ -1031,7 +1031,7 @@ const DownloadUnits& AssetsManagerEx::getFailedAssets() const void AssetsManagerEx::downloadFailedAssets() { - CCLOG("AssetsManagerEx : Start update %lu failed assets.\n", static_cast(_failedUnits.size())); + AXLOG("AssetsManagerEx : Start update %lu failed assets.\n", static_cast(_failedUnits.size())); updateAssets(_failedUnits); } @@ -1095,7 +1095,7 @@ void AssetsManagerEx::onError(const network::DownloadTask& task, // Skip version error occurred if (task.identifier == VERSION_ID) { - CCLOG("AssetsManagerEx : Fail to download version file, step skipped\n"); + AXLOG("AssetsManagerEx : Fail to download version file, step skipped\n"); _updateState = State::PREDOWNLOAD_MANIFEST; downloadManifest(); } diff --git a/extensions/assets-manager/AssetsManagerEx.h b/extensions/assets-manager/AssetsManagerEx.h index 3270c3442e..2c4d1c1934 100644 --- a/extensions/assets-manager/AssetsManagerEx.h +++ b/extensions/assets-manager/AssetsManagerEx.h @@ -48,7 +48,7 @@ NS_AX_EXT_BEGIN /** * @brief This class is used to auto update resources, such as pictures or scripts. */ -class CC_EX_DLL AssetsManagerEx : public Ref +class AX_EX_DLL AssetsManagerEx : public Ref { public: //! Update states diff --git a/extensions/assets-manager/CCEventAssetsManagerEx.h b/extensions/assets-manager/CCEventAssetsManagerEx.h index c966449633..c57f19d846 100644 --- a/extensions/assets-manager/CCEventAssetsManagerEx.h +++ b/extensions/assets-manager/CCEventAssetsManagerEx.h @@ -35,7 +35,7 @@ NS_AX_EXT_BEGIN class AssetsManagerEx; -class CC_EX_DLL EventAssetsManagerEx : public axis::EventCustom +class AX_EX_DLL EventAssetsManagerEx : public axis::EventCustom { public: friend class AssetsManagerEx; diff --git a/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp b/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp index 8efa185729..b85bf26085 100644 --- a/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp +++ b/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp @@ -47,7 +47,7 @@ EventListenerAssetsManagerEx* EventListenerAssetsManagerEx::create( } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -81,7 +81,7 @@ EventListenerAssetsManagerEx* EventListenerAssetsManagerEx::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/extensions/assets-manager/CCEventListenerAssetsManagerEx.h b/extensions/assets-manager/CCEventListenerAssetsManagerEx.h index 55b2068877..9bf1481c9f 100644 --- a/extensions/assets-manager/CCEventListenerAssetsManagerEx.h +++ b/extensions/assets-manager/CCEventListenerAssetsManagerEx.h @@ -50,7 +50,7 @@ class AssetsManagerEx; * * dispatcher->removeEventListener(listener); */ -class CC_EX_DLL EventListenerAssetsManagerEx : public axis::EventListenerCustom +class AX_EX_DLL EventListenerAssetsManagerEx : public axis::EventListenerCustom { public: friend class AssetsManagerEx; diff --git a/extensions/assets-manager/Manifest.cpp b/extensions/assets-manager/Manifest.cpp index e2476caa57..4ea39f2bf4 100644 --- a/extensions/assets-manager/Manifest.cpp +++ b/extensions/assets-manager/Manifest.cpp @@ -97,7 +97,7 @@ void Manifest::loadJson(std::string_view url) if (content.empty()) { - CCLOG("Fail to retrieve local file content: %s\n", url.data()); + AXLOG("Fail to retrieve local file content: %s\n", url.data()); } else { @@ -110,7 +110,7 @@ void Manifest::loadJson(std::string_view url) if (offset > 0) offset--; std::string errorSnippet = content.substr(offset, 10); - CCLOG("File parse error %d at <%s>\n", _json.GetParseError(), errorSnippet.c_str()); + AXLOG("File parse error %d at <%s>\n", _json.GetParseError(), errorSnippet.c_str()); } } } diff --git a/extensions/assets-manager/Manifest.h b/extensions/assets-manager/Manifest.h index 0297b4e5c2..ac3cd61445 100644 --- a/extensions/assets-manager/Manifest.h +++ b/extensions/assets-manager/Manifest.h @@ -58,7 +58,7 @@ struct ManifestAsset typedef hlookup::string_map DownloadUnits; -class CC_EX_DLL Manifest : public Ref +class AX_EX_DLL Manifest : public Ref { public: friend class AssetsManagerEx; diff --git a/extensions/cocostudio/ActionTimeline/CCActionTimeline.cpp b/extensions/cocostudio/ActionTimeline/CCActionTimeline.cpp index 02aa848038..a19b06da39 100644 --- a/extensions/cocostudio/ActionTimeline/CCActionTimeline.cpp +++ b/extensions/cocostudio/ActionTimeline/CCActionTimeline.cpp @@ -41,7 +41,7 @@ ActionTimelineData* ActionTimelineData::create(int actionTag) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -67,7 +67,7 @@ ActionTimeline* ActionTimeline::create() ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -95,7 +95,7 @@ void ActionTimeline::play(std::string name, bool loop) { if (_animationInfos.find(name) == _animationInfos.end()) { - CCLOG("Can't find animation info for %s", name.c_str()); + AXLOG("Can't find animation info for %s", name.c_str()); return; } @@ -163,7 +163,7 @@ void ActionTimeline::setCurrentFrame(int frameIndex) } else { - CCLOG("frame index is not between start frame and end frame"); + AXLOG("frame index is not between start frame and end frame"); } } @@ -298,7 +298,7 @@ void ActionTimeline::addAnimationInfo(const AnimationInfo& animationInfo) { if (_animationInfos.find(animationInfo.name) != _animationInfos.end()) { - CCLOG("Animation (%s) already exists.", animationInfo.name.c_str()); + AXLOG("Animation (%s) already exists.", animationInfo.name.c_str()); return; } @@ -311,7 +311,7 @@ void ActionTimeline::removeAnimationInfo(std::string animationName) auto clipIter = _animationInfos.find(animationName); if (clipIter == _animationInfos.end()) { - CCLOG("AnimationInfo (%s) not exists.", animationName.c_str()); + AXLOG("AnimationInfo (%s) not exists.", animationName.c_str()); return; } @@ -334,7 +334,7 @@ void ActionTimeline::setAnimationEndCallFunc(const std::string animationName, st auto clipIter = _animationInfos.find(animationName); if (clipIter == _animationInfos.end()) { - CCLOG("AnimationInfo (%s) not exists.", animationName.c_str()); + AXLOG("AnimationInfo (%s) not exists.", animationName.c_str()); return; } clipIter->second.clipEndCallBack = func; diff --git a/extensions/cocostudio/ActionTimeline/CCActionTimelineCache.cpp b/extensions/cocostudio/ActionTimeline/CCActionTimelineCache.cpp index 6b505560e2..22989b718e 100644 --- a/extensions/cocostudio/ActionTimeline/CCActionTimelineCache.cpp +++ b/extensions/cocostudio/ActionTimeline/CCActionTimelineCache.cpp @@ -99,7 +99,7 @@ ActionTimelineCache* ActionTimelineCache::getInstance() void ActionTimelineCache::destroyInstance() { - CC_SAFE_DELETE(_sharedActionCache); + AX_SAFE_DELETE(_sharedActionCache); } void ActionTimelineCache::purge() @@ -194,7 +194,7 @@ ActionTimeline* ActionTimelineCache::loadAnimationActionWithContent(std::string_ doc.Parse<0>(content.data(), content.length()); if (doc.HasParseError()) { - CCLOG("GetParseError %d\n", doc.GetParseError()); + AXLOG("GetParseError %d\n", doc.GetParseError()); } const rapidjson::Value& json = DICTOOL->getSubDictionary_json(doc, ACTION); @@ -443,7 +443,7 @@ ActionTimeline* ActionTimelineCache::loadAnimationActionWithFlatBuffersFile(std: std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName); - CC_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); + AX_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); Data buf = FileUtils::getInstance()->getDataFromFile(fullPath); action = createActionWithDataBuffer(buf); @@ -461,7 +461,7 @@ ActionTimeline* ActionTimelineCache::loadAnimationWithDataBuffer(const axis::Dat std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName); - CC_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); + AX_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); action = createActionWithDataBuffer(data); _animationActions.insert(fileName, action); @@ -599,7 +599,7 @@ Timeline* ActionTimelineCache::loadTimelineWithFlatBuffers(const flatbuffers::Ti if (!frame) { - CCLOG("frame is invalid."); + AXLOG("frame is invalid."); continue; } timeline->addFrame(frame); diff --git a/extensions/cocostudio/ActionTimeline/CCActionTimelineData.cpp b/extensions/cocostudio/ActionTimeline/CCActionTimelineData.cpp index 84c5db52c1..d88a1c3ffb 100644 --- a/extensions/cocostudio/ActionTimeline/CCActionTimelineData.cpp +++ b/extensions/cocostudio/ActionTimeline/CCActionTimelineData.cpp @@ -12,7 +12,7 @@ ActionTimelineData* ActionTimelineData::create(int actionTag) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/extensions/cocostudio/ActionTimeline/CCActionTimelineNode.cpp b/extensions/cocostudio/ActionTimeline/CCActionTimelineNode.cpp index 1d378fc376..4a79912ff7 100644 --- a/extensions/cocostudio/ActionTimeline/CCActionTimelineNode.cpp +++ b/extensions/cocostudio/ActionTimeline/CCActionTimelineNode.cpp @@ -36,7 +36,7 @@ ActionTimelineNode* ActionTimelineNode::create(Node* root, ActionTimeline* actio ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } diff --git a/extensions/cocostudio/ActionTimeline/CCBoneNode.cpp b/extensions/cocostudio/ActionTimeline/CCBoneNode.cpp index 4520e9da06..14fa864c41 100644 --- a/extensions/cocostudio/ActionTimeline/CCBoneNode.cpp +++ b/extensions/cocostudio/ActionTimeline/CCBoneNode.cpp @@ -41,7 +41,7 @@ BoneNode* BoneNode::create() ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -55,7 +55,7 @@ BoneNode* BoneNode::create(int length) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -116,7 +116,7 @@ void BoneNode::addChild(Node* child, int localZOrder, std::string_view name) void BoneNode::addSkin(SkinNode* skin, bool isDisplay, bool hideOthers) { - CCASSERT(skin != nullptr, "Argument must be non-nil"); + AXASSERT(skin != nullptr, "Argument must be non-nil"); if (hideOthers) { for (auto& bonskin : _boneSkins) @@ -136,7 +136,7 @@ void BoneNode::addSkin(SkinNode* skin, bool display) void BoneNode::removeChild(Node* child, bool cleanup /* = true */) { ssize_t index = _children.getIndex(child); - if (index != axis::CC_INVALID_INDEX) + if (index != axis::AX_INVALID_INDEX) { removeFromChildrenListHelper(child); Node::removeChild(child, cleanup); @@ -198,7 +198,7 @@ void BoneNode::addToBoneList(BoneNode* bone) _rootSkeleton->_subBonesOrderDirty = true; } else - CCLOG("already has a bone named %s in skeleton %s", bonename.data(), + AXLOG("already has a bone named %s in skeleton %s", bonename.data(), _rootSkeleton->getName().data()); } } @@ -420,7 +420,7 @@ void BoneNode::draw(axis::Renderer* renderer, const axis::Mat4& transform, uint3 _customCommand.init(_globalZOrder, _blendFunc); renderer->addCommand(&_customCommand); -#ifdef CC_STUDIO_ENABLED_VIEW +#ifdef AX_STUDIO_ENABLED_VIEW // TODO // glVertexAttribPointer(axis::GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _noMVPVertices); // glVertexAttribPointer(axis::GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, _squareColors); @@ -428,8 +428,8 @@ void BoneNode::draw(axis::Renderer* renderer, const axis::Mat4& transform, uint3 // glEnable(GL_LINE_SMOOTH); // glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE); // glDrawArrays(GL_LINE_LOOP, 0, 4); -// CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8); -#endif // CC_STUDIO_ENABLED_VIEW +// AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8); +#endif // AX_STUDIO_ENABLED_VIEW for (int i = 0; i < 4; ++i) { @@ -564,7 +564,7 @@ SkeletonNode* BoneNode::getRootSkeletonNode() const return _rootSkeleton; } -#ifdef CC_STUDIO_ENABLED_VIEW +#ifdef AX_STUDIO_ENABLED_VIEW bool BoneNode::isPointOnRack(const axis::Vec2& bonePoint) { @@ -584,7 +584,7 @@ bool BoneNode::isPointOnRack(const axis::Vec2& bonePoint) } return false; } -#endif // CC_STUDIO_ENABLED_VIEW +#endif // AX_STUDIO_ENABLED_VIEW void BoneNode::batchBoneDrawToSkeleton(BoneNode* bone) const { diff --git a/extensions/cocostudio/ActionTimeline/CCBoneNode.h b/extensions/cocostudio/ActionTimeline/CCBoneNode.h index 7b02ad1998..f2ecb3fae5 100644 --- a/extensions/cocostudio/ActionTimeline/CCBoneNode.h +++ b/extensions/cocostudio/ActionTimeline/CCBoneNode.h @@ -156,7 +156,7 @@ public: // set localzorder, and recalculate debugdraw virtual void setAnchorPoint(const axis::Vec2& anchorPoint) override; -#ifdef CC_STUDIO_ENABLED_VIEW +#ifdef AX_STUDIO_ENABLED_VIEW // hit test , bonePoint is in self coordinate virtual bool isPointOnRack(const axis::Vec2& bonePoint); #endif @@ -235,7 +235,7 @@ private: axis::Vec2 _squareVertices[4]; VertexData _vertexData[4]; - CC_DISALLOW_COPY_AND_ASSIGN(BoneNode); + AX_DISALLOW_COPY_AND_ASSIGN(BoneNode); }; NS_TIMELINE_END diff --git a/extensions/cocostudio/ActionTimeline/CCFrame.cpp b/extensions/cocostudio/ActionTimeline/CCFrame.cpp index 4c6ed38050..306d199421 100644 --- a/extensions/cocostudio/ActionTimeline/CCFrame.cpp +++ b/extensions/cocostudio/ActionTimeline/CCFrame.cpp @@ -505,7 +505,7 @@ void InnerActionFrame::onEnter(Frame* /*nextFrame*/, int /*currentFrameIndex*/) } else { - CCLOG("Animation %s not exists!", _animationName.c_str()); + AXLOG("Animation %s not exists!", _animationName.c_str()); } } @@ -530,7 +530,7 @@ void InnerActionFrame::setStartFrameIndex(int frameIndex) { if (_enterWithName) { - CCLOG(" cannot set start when enter frame with name. setEnterWithName false firstly!"); + AXLOG(" cannot set start when enter frame with name. setEnterWithName false firstly!"); return; } @@ -541,7 +541,7 @@ void InnerActionFrame::setEndFrameIndex(int frameIndex) { if (_enterWithName) { - CCLOG(" cannot set end when enter frame with name. setEnterWithName false firstly!"); + AXLOG(" cannot set end when enter frame with name. setEnterWithName false firstly!"); return; } @@ -552,7 +552,7 @@ void InnerActionFrame::setAnimationName(std::string_view animationName) { if (!_enterWithName) { - CCLOG(" cannot set aniamtioname when enter frame with index. setEnterWithName true firstly!"); + AXLOG(" cannot set aniamtioname when enter frame with index. setEnterWithName true firstly!"); return; } diff --git a/extensions/cocostudio/ActionTimeline/CCFrame.h b/extensions/cocostudio/ActionTimeline/CCFrame.h index 0a360112d0..8d242bc98d 100644 --- a/extensions/cocostudio/ActionTimeline/CCFrame.h +++ b/extensions/cocostudio/ActionTimeline/CCFrame.h @@ -317,8 +317,8 @@ public: virtual Frame* clone() override; /** @deprecated Use method setAlpha() and getAlpha() of AlphaFrame instead */ - CC_DEPRECATED_ATTRIBUTE inline void setAlpha(uint8_t alpha) { _alpha = alpha; } - CC_DEPRECATED_ATTRIBUTE inline uint8_t getAlpha() const { return _alpha; } + AX_DEPRECATED_ATTRIBUTE inline void setAlpha(uint8_t alpha) { _alpha = alpha; } + AX_DEPRECATED_ATTRIBUTE inline uint8_t getAlpha() const { return _alpha; } inline void setColor(const axis::Color3B& color) { _color = color; } inline axis::Color3B getColor() const { return _color; } diff --git a/extensions/cocostudio/ActionTimeline/CCSkeletonNode.cpp b/extensions/cocostudio/ActionTimeline/CCSkeletonNode.cpp index 74847baef2..882ffd6ee4 100644 --- a/extensions/cocostudio/ActionTimeline/CCSkeletonNode.cpp +++ b/extensions/cocostudio/ActionTimeline/CCSkeletonNode.cpp @@ -40,7 +40,7 @@ SkeletonNode* SkeletonNode::create() skeletonNode->autorelease(); return skeletonNode; } - CC_SAFE_DELETE(skeletonNode); + AX_SAFE_DELETE(skeletonNode); return nullptr; } @@ -268,7 +268,7 @@ void SkeletonNode::batchDrawAllSubBones() axis::CustomCommand::BufferUsage::DYNAMIC); _batchBoneCommand.updateVertexBuffer(_batchedBoneVertexData.data(), sizeof(VertexData) * _batchedVeticesCount); -#ifdef CC_STUDIO_ENABLED_VIEW +#ifdef AX_STUDIO_ENABLED_VIEW // TODO // glLineWidth(1); // glEnable(GL_LINE_SMOOTH); @@ -278,7 +278,7 @@ void SkeletonNode::batchDrawAllSubBones() // glDrawArrays(GL_TRIANGLE_FAN, i, 4); // glDrawArrays(GL_LINE_LOOP, i, 4); // } -// CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _batchedVeticesCount); +// AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _batchedVeticesCount); #else unsigned short* indices = (unsigned short*)malloc(sizeof(unsigned short) * _batchedVeticesCount); for (int i = 0; i < _batchedVeticesCount; i += 4) @@ -295,7 +295,7 @@ void SkeletonNode::batchDrawAllSubBones() axis::CustomCommand::BufferUsage::DYNAMIC); _batchBoneCommand.updateIndexBuffer(indices, sizeof(unsigned short) * _batchedVeticesCount); free(indices); -#endif // CC_STUDIO_ENABLED_VIEW +#endif // AX_STUDIO_ENABLED_VIEW } void SkeletonNode::changeSkins(const hlookup::string_map& boneSkinNameMap) diff --git a/extensions/cocostudio/ActionTimeline/CCSkeletonNode.h b/extensions/cocostudio/ActionTimeline/CCSkeletonNode.h index cf66fda305..4282034fa3 100644 --- a/extensions/cocostudio/ActionTimeline/CCSkeletonNode.h +++ b/extensions/cocostudio/ActionTimeline/CCSkeletonNode.h @@ -100,7 +100,7 @@ private: hlookup::string_map> _skinGroupMap; // map< suit name, map< bone name, skin name> > - CC_DISALLOW_COPY_AND_ASSIGN(SkeletonNode); + AX_DISALLOW_COPY_AND_ASSIGN(SkeletonNode); void checkSubBonesDirty(); // for draw skins as ordered bones' local z diff --git a/extensions/cocostudio/ActionTimeline/CCTimelineMacro.h b/extensions/cocostudio/ActionTimeline/CCTimelineMacro.h index ac9a476eff..9d2df6e5f2 100644 --- a/extensions/cocostudio/ActionTimeline/CCTimelineMacro.h +++ b/extensions/cocostudio/ActionTimeline/CCTimelineMacro.h @@ -22,8 +22,8 @@ Copyright (c) 2013-2017 Chukong Technologies OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_TIMELINE_MACROS_H__ -#define __CC_TIMELINE_MACROS_H__ +#ifndef __AX_TIMELINE_MACROS_H__ +#define __AX_TIMELINE_MACROS_H__ #ifdef __cplusplus # define NS_TIMELINE_BEGIN \ diff --git a/extensions/cocostudio/ActionTimeline/CSLoader.cpp b/extensions/cocostudio/ActionTimeline/CSLoader.cpp index cd8ca5c348..6b3e0e80f4 100644 --- a/extensions/cocostudio/ActionTimeline/CSLoader.cpp +++ b/extensions/cocostudio/ActionTimeline/CSLoader.cpp @@ -79,7 +79,7 @@ #include "WidgetReader/SkeletonReader/BoneNodeReader.h" #include "WidgetReader/SkeletonReader/SkeletonNodeReader.h" -#if defined(CC_BUILD_WITH_SPINE) && CC_BUILD_WITH_SPINE +#if defined(AX_BUILD_WITH_SPINE) && AX_BUILD_WITH_SPINE # include "WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h" #endif #include "WidgetReader/RichTextReader/RichTextReader.h" @@ -197,7 +197,7 @@ CSLoader* CSLoader::getInstance() void CSLoader::destroyInstance() { - CC_SAFE_DELETE(_sharedCSLoader); + AX_SAFE_DELETE(_sharedCSLoader); ActionTimelineCache::destroyInstance(); } @@ -238,7 +238,7 @@ CSLoader::CSLoader() /// Added by x-studio CREATE_CLASS_NODE_READER_INFO(RichTextReader); -#if defined(CC_BUILD_WITH_SPINE) && CC_BUILD_WITH_SPINE +#if defined(AX_BUILD_WITH_SPINE) && AX_BUILD_WITH_SPINE CREATE_CLASS_NODE_READER_INFO(SpineSkeletonReader); #endif CREATE_CLASS_NODE_READER_INFO(RadioButtonReader); @@ -451,7 +451,7 @@ Node* CSLoader::loadNodeWithContent(std::string_view content) doc.Parse<0>(content.data(), content.length()); if (doc.HasParseError()) { - CCLOG("GetParseError %d\n", doc.GetParseError()); + AXLOG("GetParseError %d\n", doc.GetParseError()); } // cocos2dx version mono editor is based on @@ -566,7 +566,7 @@ Node* CSLoader::loadNode(const rapidjson::Value& json) } else { - CCLOG("Not supported NodeType: %s", nodeType.c_str()); + AXLOG("Not supported NodeType: %s", nodeType.c_str()); } return node; @@ -688,7 +688,7 @@ Node* CSLoader::loadSprite(const rapidjson::Value& json) if (!sprite) { sprite = Sprite::create(); - CCLOG("filePath is empty. Create a sprite with no texture"); + AXLOG("filePath is empty. Create a sprite with no texture"); } } else @@ -798,14 +798,14 @@ Node* CSLoader::loadWidget(const rapidjson::Value& json) customJsonDict.Parse<0>(customProperty); if (customJsonDict.HasParseError()) { - CCLOG("GetParseError %d\n", customJsonDict.GetParseError()); + AXLOG("GetParseError %d\n", customJsonDict.GetParseError()); } widgetPropertiesReader.setPropsForAllCustomWidgetFromJsonDictionary(classname, widget, customJsonDict); } else { - CCLOG("Widget or WidgetReader doesn't exists!!! Please check your protocol buffers file."); + AXLOG("Widget or WidgetReader doesn't exists!!! Please check your protocol buffers file."); } } @@ -897,9 +897,9 @@ Node* CSLoader::createNode(const Data& data, const ccNodeLoadCallback& callback) Node* node = nullptr; do { - CC_BREAK_IF(data.isNull() || data.getSize() <= 0); + AX_BREAK_IF(data.isNull() || data.getSize() <= 0); auto csparsebinary = GetCSParseBinary(data.getBytes()); - CC_BREAK_IF(nullptr == csparsebinary); + AX_BREAK_IF(nullptr == csparsebinary); auto csBuildId = csparsebinary->version(); if (csBuildId) { @@ -934,7 +934,7 @@ Node* CSLoader::createNode(const Data& data, const ccNodeLoadCallback& callback) } }); - CCASSERT(readerVersion >= writterVersion, + AXASSERT(readerVersion >= writterVersion, StringUtils::format( "%s%s%s%s%s%s%s%s%s%s", "The reader build id of your Cocos exported file(", csBuildId->c_str(), ") and the reader build id in your axis(", loader->_csBuildID.c_str(), @@ -946,7 +946,7 @@ Node* CSLoader::createNode(const Data& data, const ccNodeLoadCallback& callback) // decode plist auto textures = csparsebinary->textures(); int textureSize = csparsebinary->textures()->size(); - CCLOG("textureSize = %d", textureSize); + AXLOG("textureSize = %d", textureSize); for (int i = 0; i < textureSize; ++i) { std::string plist = textures->Get(i)->c_str(); @@ -985,12 +985,12 @@ inline void CSLoader::reconstructNestNode(axis::Node* node) if (_callbackHandlers.empty()) { _rootNode = nullptr; - CCLOG("Call back handler container has been clear."); + AXLOG("Call back handler container has been clear."); } else { _rootNode = _callbackHandlers.back(); - CCLOG("after pop back _rootNode name = %s", _rootNode->getName().data()); + AXLOG("after pop back _rootNode name = %s", _rootNode->getName().data()); } } } @@ -1004,14 +1004,14 @@ Node* CSLoader::nodeWithFlatBuffersFile(std::string_view fileName, const ccNodeL { std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName); - CC_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); + AX_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); Data buf = FileUtils::getInstance()->getDataFromFile(fullPath); if (buf.isNull()) { - CCLOG("CSLoader::nodeWithFlatBuffersFile - failed read file: %s", fileName.data()); - CC_ASSERT(false); + AXLOG("CSLoader::nodeWithFlatBuffersFile - failed read file: %s", fileName.data()); + AX_ASSERT(false); return nullptr; } @@ -1051,7 +1051,7 @@ Node* CSLoader::nodeWithFlatBuffersFile(std::string_view fileName, const ccNodeL } }); - CCASSERT(readerVersion >= writterVersion, + AXASSERT(readerVersion >= writterVersion, StringUtils::format( "%s%s%s%s%s%s%s%s%s%s", "The reader build id of your Cocos exported file(", csBuildId->c_str(), ") and the reader build id in your axis(", _csBuildID.c_str(), ") are not match.\n", @@ -1288,7 +1288,7 @@ bool CSLoader::bindCallback(std::string_view callbackName, } } - CCLOG("callBackName %s cannot be found", callbackName.data()); + AXLOG("callBackName %s cannot be found", callbackName.data()); return false; } @@ -1308,7 +1308,7 @@ bool CSLoader::isCustomWidget(std::string_view type) Widget* widget = dynamic_cast(ObjectFactory::getInstance()->createObject(type)); if (widget) { - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return true; } @@ -1436,7 +1436,7 @@ Node* CSLoader::createNodeWithFlatBuffersForSimulator(std::string_view filename) // decode plist auto textures = csparsebinary->textures(); int textureSize = csparsebinary->textures()->size(); - // CCLOG("textureSize = %d", textureSize); + // AXLOG("textureSize = %d", textureSize); for (int i = 0; i < textureSize; ++i) { SpriteFrameCache::getInstance()->addSpriteFramesWithFile(textures->Get(i)->c_str()); diff --git a/extensions/cocostudio/ActionTimeline/CSLoader.h b/extensions/cocostudio/ActionTimeline/CSLoader.h index 2c4e19f2bc..d026d018b1 100644 --- a/extensions/cocostudio/ActionTimeline/CSLoader.h +++ b/extensions/cocostudio/ActionTimeline/CSLoader.h @@ -75,7 +75,7 @@ public: CSLoader(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE void purge(); + AX_DEPRECATED_ATTRIBUTE void purge(); void init(); diff --git a/extensions/cocostudio/CCActionManagerEx.cpp b/extensions/cocostudio/CCActionManagerEx.cpp index 0868543dd5..ea59f0356f 100644 --- a/extensions/cocostudio/CCActionManagerEx.cpp +++ b/extensions/cocostudio/CCActionManagerEx.cpp @@ -46,7 +46,7 @@ void ActionManagerEx::destroyInstance() if (sharedActionManager != nullptr) { sharedActionManager->releaseActions(); - CC_SAFE_DELETE(sharedActionManager); + AX_SAFE_DELETE(sharedActionManager); } } diff --git a/extensions/cocostudio/CCActionNode.cpp b/extensions/cocostudio/CCActionNode.cpp index e92fafe34b..6d8e042def 100644 --- a/extensions/cocostudio/CCActionNode.cpp +++ b/extensions/cocostudio/CCActionNode.cpp @@ -58,20 +58,20 @@ ActionNode::~ActionNode() { if (_action == nullptr) { - CC_SAFE_RELEASE_NULL(_actionSpawn); + AX_SAFE_RELEASE_NULL(_actionSpawn); } else { - CC_SAFE_RELEASE_NULL(_action); - CC_SAFE_RELEASE_NULL(_actionSpawn); + AX_SAFE_RELEASE_NULL(_action); + AX_SAFE_RELEASE_NULL(_actionSpawn); } - CC_SAFE_RELEASE(_object); + AX_SAFE_RELEASE(_object); for (auto object : _frameArray) { object->clear(); - CC_SAFE_DELETE(object); + AX_SAFE_DELETE(object); } _frameArray.clear(); } @@ -395,9 +395,9 @@ int ActionNode::getActionTag() void ActionNode::setObject(Ref* node) { - CC_SAFE_RELEASE(_object); + AX_SAFE_RELEASE(_object); _object = node; - CC_SAFE_RETAIN(_object); + AX_SAFE_RETAIN(_object); } Ref* ActionNode::getObject() @@ -527,16 +527,16 @@ Spawn* ActionNode::refreshActionProperty() if (_action == nullptr) { - CC_SAFE_RELEASE_NULL(_actionSpawn); + AX_SAFE_RELEASE_NULL(_actionSpawn); } else { - CC_SAFE_RELEASE_NULL(_action); - CC_SAFE_RELEASE_NULL(_actionSpawn); + AX_SAFE_RELEASE_NULL(_action); + AX_SAFE_RELEASE_NULL(_actionSpawn); } _actionSpawn = Spawn::create(cSpawnArray); - CC_SAFE_RETAIN(_actionSpawn); + AX_SAFE_RETAIN(_actionSpawn); return _actionSpawn; } diff --git a/extensions/cocostudio/CCActionObject.cpp b/extensions/cocostudio/CCActionObject.cpp index 459fdcc355..3e6c7d8917 100644 --- a/extensions/cocostudio/CCActionObject.cpp +++ b/extensions/cocostudio/CCActionObject.cpp @@ -47,7 +47,7 @@ ActionObject::ActionObject() , _fTotalTime(0.0f) { _pScheduler = Director::getInstance()->getScheduler(); - CC_SAFE_RETAIN(_pScheduler); + AX_SAFE_RETAIN(_pScheduler); } ActionObject::~ActionObject() @@ -55,8 +55,8 @@ ActionObject::~ActionObject() _loop = false; _pScheduler->unscheduleAllForTarget(this); _actionNodeList.clear(); - CC_SAFE_RELEASE(_pScheduler); - CC_SAFE_RELEASE(_CallBack); + AX_SAFE_RELEASE(_pScheduler); + AX_SAFE_RELEASE(_CallBack); } void ActionObject::setName(const char* name) @@ -233,12 +233,12 @@ void ActionObject::play() } if (_loop) { - _pScheduler->schedule(CC_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this, 0.0f, CC_REPEAT_FOREVER, + _pScheduler->schedule(AX_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this, 0.0f, AX_REPEAT_FOREVER, 0.0f, false); } else { - _pScheduler->schedule(CC_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this, 0.0f, false); + _pScheduler->schedule(AX_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this, 0.0f, false); } } @@ -246,7 +246,7 @@ void ActionObject::play(CallFunc* func) { this->play(); this->_CallBack = func; - CC_SAFE_RETAIN(_CallBack); + AX_SAFE_RETAIN(_CallBack); } void ActionObject::pause() { @@ -261,7 +261,7 @@ void ActionObject::stop() e->stopAction(); } _bPlaying = false; - _pScheduler->unschedule(CC_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this); + _pScheduler->unschedule(AX_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this); _bPause = false; } @@ -300,7 +300,7 @@ void ActionObject::simulationActionUpdate(float /*dt*/) else { _bPlaying = false; - _pScheduler->unschedule(CC_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this); + _pScheduler->unschedule(AX_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this); } } } diff --git a/extensions/cocostudio/CCArmature.cpp b/extensions/cocostudio/CCArmature.cpp index eab47c2e9b..a653a96422 100644 --- a/extensions/cocostudio/CCArmature.cpp +++ b/extensions/cocostudio/CCArmature.cpp @@ -53,7 +53,7 @@ Armature* Armature::create() armature->autorelease(); return armature; } - CC_SAFE_DELETE(armature); + AX_SAFE_DELETE(armature); return nullptr; } @@ -65,7 +65,7 @@ Armature* Armature::create(std::string_view name) armature->autorelease(); return armature; } - CC_SAFE_DELETE(armature); + AX_SAFE_DELETE(armature); return nullptr; } @@ -77,7 +77,7 @@ Armature* Armature::create(std::string_view name, Bone* parentBone) armature->autorelease(); return armature; } - CC_SAFE_DELETE(armature); + AX_SAFE_DELETE(armature); return nullptr; } @@ -94,7 +94,7 @@ Armature::~Armature() _boneDic.clear(); _topBoneList.clear(); - CC_SAFE_DELETE(_animation); + AX_SAFE_DELETE(_animation); } bool Armature::init() @@ -109,7 +109,7 @@ bool Armature::init(std::string_view name) { removeAllChildren(); - CC_SAFE_DELETE(_animation); + AX_SAFE_DELETE(_animation); _animation = new ArmatureAnimation(); _animation->init(this); @@ -125,12 +125,12 @@ bool Armature::init(std::string_view name) if (!_name.empty()) { AnimationData* animationData = armatureDataManager->getAnimationData(name); - CCASSERT(animationData, "AnimationData not exist! "); + AXASSERT(animationData, "AnimationData not exist! "); _animation->setAnimationData(animationData); ArmatureData* armatureData = armatureDataManager->getArmatureData(name); - CCASSERT(armatureData, "armatureData doesn't exists!"); + AXASSERT(armatureData, "armatureData doesn't exists!"); _armatureData = armatureData; @@ -142,13 +142,13 @@ bool Armature::init(std::string_view name) do { MovementData* movData = animationData->getMovement(animationData->movementNames.at(0)); - CC_BREAK_IF(!movData); + AX_BREAK_IF(!movData); MovementBoneData* movBoneData = movData->getMovementBoneData(bone->getName()); - CC_BREAK_IF(!movBoneData || movBoneData->frameList.size() <= 0); + AX_BREAK_IF(!movBoneData || movBoneData->frameList.size() <= 0); FrameData* frameData = movBoneData->getFrameData(0); - CC_BREAK_IF(!frameData); + AX_BREAK_IF(!frameData); bone->getTweenData()->copy(frameData); bone->changeDisplayWithIndex(frameData->displayIndex, false); @@ -219,8 +219,8 @@ Bone* Armature::createBone(std::string_view boneName) void Armature::addBone(Bone* bone, std::string_view parentName) { - CCASSERT(bone != nullptr, "Argument must be non-nil"); - CCASSERT(_boneDic.at(bone->getName()) == nullptr, "bone already added. It can't be added again"); + AXASSERT(bone != nullptr, "Argument must be non-nil"); + AXASSERT(_boneDic.at(bone->getName()) == nullptr, "bone already added. It can't be added again"); if (!parentName.empty()) { @@ -247,7 +247,7 @@ void Armature::addBone(Bone* bone, std::string_view parentName) void Armature::removeBone(Bone* bone, bool recursion) { - CCASSERT(bone != nullptr, "bone must be added to the bone dictionary!"); + AXASSERT(bone != nullptr, "bone must be added to the bone dictionary!"); bone->setArmature(nullptr); bone->removeFromParent(recursion); @@ -267,7 +267,7 @@ Bone* Armature::getBone(std::string_view name) const void Armature::changeBoneParent(Bone* bone, std::string_view parentName) { - CCASSERT(bone != nullptr, "bone must be added to the bone dictionary!"); + AXASSERT(bone != nullptr, "bone must be added to the bone dictionary!"); if (bone->getParentBone()) { @@ -372,7 +372,7 @@ void Armature::draw(axis::Renderer* renderer, const Mat4& transform, uint32_t fl { if (_parentBone == nullptr && _batchNode == nullptr) { - // CC_NODE_DRAW_SETUP(); + // AX_NODE_DRAW_SETUP(); } for (auto& object : _children) @@ -419,7 +419,7 @@ void Armature::draw(axis::Renderer* renderer, const Mat4& transform, uint32_t fl default: { node->visit(renderer, transform, flags); - // CC_NODE_DRAW_SETUP(); + // AX_NODE_DRAW_SETUP(); } break; } @@ -427,7 +427,7 @@ void Armature::draw(axis::Renderer* renderer, const Mat4& transform, uint32_t fl else if (Node* node = dynamic_cast(object)) { node->visit(renderer, transform, flags); - // CC_NODE_DRAW_SETUP(); + // AX_NODE_DRAW_SETUP(); } } } @@ -460,7 +460,7 @@ void Armature::visit(axis::Renderer* renderer, const Mat4& parentTransform, uint // 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 Director* director = Director::getInstance(); - 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); diff --git a/extensions/cocostudio/CCArmature.h b/extensions/cocostudio/CCArmature.h index a472bc8405..480a1d5cb7 100644 --- a/extensions/cocostudio/CCArmature.h +++ b/extensions/cocostudio/CCArmature.h @@ -40,34 +40,34 @@ struct cpBody; namespace cocostudio { -CC_DEPRECATED_ATTRIBUTE typedef ProcessBase CCProcessBase; -CC_DEPRECATED_ATTRIBUTE typedef BaseData CCBaseData; -CC_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef SpriteDisplayData CCSpriteDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureDisplayData CCArmatureDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef ParticleDisplayData CCParticleDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef BoneData CCBoneData; -CC_DEPRECATED_ATTRIBUTE typedef FrameData CCFrameData; -CC_DEPRECATED_ATTRIBUTE typedef MovementBoneData CCMovementBoneData; -CC_DEPRECATED_ATTRIBUTE typedef MovementData CCMovementData; -CC_DEPRECATED_ATTRIBUTE typedef AnimationData CCAnimationData; -CC_DEPRECATED_ATTRIBUTE typedef ContourData CCContourData; -CC_DEPRECATED_ATTRIBUTE typedef TextureData CCTextureData; -CC_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; -CC_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef DisplayFactory CCDisplayFactory; -CC_DEPRECATED_ATTRIBUTE typedef BatchNode CCBatchNode; -CC_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; -CC_DEPRECATED_ATTRIBUTE typedef DisplayManager CCDisplayManager; -CC_DEPRECATED_ATTRIBUTE typedef ColliderBody CCColliderBody; -CC_DEPRECATED_ATTRIBUTE typedef ColliderDetector CCColliderDetector; -CC_DEPRECATED_ATTRIBUTE typedef SpriteFrameCacheHelper CCSpriteFrameCacheHelper; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureData CCArmatureData; -CC_DEPRECATED_ATTRIBUTE typedef Bone CCBone; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation; -CC_DEPRECATED_ATTRIBUTE typedef Armature CCArmature; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager; -CC_DEPRECATED_ATTRIBUTE typedef axis::tweenfunc::TweenType CCTweenType; +AX_DEPRECATED_ATTRIBUTE typedef ProcessBase CCProcessBase; +AX_DEPRECATED_ATTRIBUTE typedef BaseData CCBaseData; +AX_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; +AX_DEPRECATED_ATTRIBUTE typedef SpriteDisplayData CCSpriteDisplayData; +AX_DEPRECATED_ATTRIBUTE typedef ArmatureDisplayData CCArmatureDisplayData; +AX_DEPRECATED_ATTRIBUTE typedef ParticleDisplayData CCParticleDisplayData; +AX_DEPRECATED_ATTRIBUTE typedef BoneData CCBoneData; +AX_DEPRECATED_ATTRIBUTE typedef FrameData CCFrameData; +AX_DEPRECATED_ATTRIBUTE typedef MovementBoneData CCMovementBoneData; +AX_DEPRECATED_ATTRIBUTE typedef MovementData CCMovementData; +AX_DEPRECATED_ATTRIBUTE typedef AnimationData CCAnimationData; +AX_DEPRECATED_ATTRIBUTE typedef ContourData CCContourData; +AX_DEPRECATED_ATTRIBUTE typedef TextureData CCTextureData; +AX_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; +AX_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; +AX_DEPRECATED_ATTRIBUTE typedef DisplayFactory CCDisplayFactory; +AX_DEPRECATED_ATTRIBUTE typedef BatchNode CCBatchNode; +AX_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; +AX_DEPRECATED_ATTRIBUTE typedef DisplayManager CCDisplayManager; +AX_DEPRECATED_ATTRIBUTE typedef ColliderBody CCColliderBody; +AX_DEPRECATED_ATTRIBUTE typedef ColliderDetector CCColliderDetector; +AX_DEPRECATED_ATTRIBUTE typedef SpriteFrameCacheHelper CCSpriteFrameCacheHelper; +AX_DEPRECATED_ATTRIBUTE typedef ArmatureData CCArmatureData; +AX_DEPRECATED_ATTRIBUTE typedef Bone CCBone; +AX_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation; +AX_DEPRECATED_ATTRIBUTE typedef Armature CCArmature; +AX_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager; +AX_DEPRECATED_ATTRIBUTE typedef axis::tweenfunc::TweenType CCTweenType; class CCS_DLL Armature : public axis::Node, public axis::BlendProtocol { @@ -195,7 +195,7 @@ public: #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT virtual void setColliderFilter(ColliderFilter* filter); #elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX - CC_DEPRECATED_ATTRIBUTE virtual void drawContour(); + AX_DEPRECATED_ATTRIBUTE virtual void drawContour(); #endif virtual void setArmatureData(ArmatureData* armatureData) { _armatureData = armatureData; } diff --git a/extensions/cocostudio/CCArmatureAnimation.cpp b/extensions/cocostudio/CCArmatureAnimation.cpp index a1ad553f2c..03e03dc5b5 100644 --- a/extensions/cocostudio/CCArmatureAnimation.cpp +++ b/extensions/cocostudio/CCArmatureAnimation.cpp @@ -41,7 +41,7 @@ ArmatureAnimation* ArmatureAnimation::create(Armature* armature) pArmatureAnimation->autorelease(); return pArmatureAnimation; } - CC_SAFE_DELETE(pArmatureAnimation); + AX_SAFE_DELETE(pArmatureAnimation); return nullptr; } @@ -69,9 +69,9 @@ ArmatureAnimation::ArmatureAnimation() ArmatureAnimation::~ArmatureAnimation(void) { - CC_SAFE_RELEASE_NULL(_animationData); + AX_SAFE_RELEASE_NULL(_animationData); - CC_SAFE_RELEASE_NULL(_userObject); + AX_SAFE_RELEASE_NULL(_userObject); } bool ArmatureAnimation::init(Armature* armature) @@ -160,18 +160,18 @@ void ArmatureAnimation::play(std::string_view animationName, int durationTo, int { if (animationName.empty()) { - CCLOG("_animationData can not be null"); + AXLOG("_animationData can not be null"); return; } - // CCASSERT(_animationData, "_animationData can not be null"); + // AXASSERT(_animationData, "_animationData can not be null"); _movementData = _animationData->getMovement(animationName); if (nullptr == _movementData) { - CCLOG("_movementData can not be null"); + AXLOG("_movementData can not be null"); return; } - // CCASSERT(_movementData, "_movementData can not be null"); + // AXASSERT(_movementData, "_movementData can not be null"); //! Get key frame count _rawDuration = _movementData->duration; @@ -254,7 +254,7 @@ void ArmatureAnimation::playByIndex(int animationIndex, int durationTo, int loop void ArmatureAnimation::playWithIndex(int animationIndex, int durationTo, int loop) { std::vector& movName = _animationData->movementNames; - CC_ASSERT((animationIndex > -1) && ((unsigned int)animationIndex < movName.size())); + AX_ASSERT((animationIndex > -1) && ((unsigned int)animationIndex < movName.size())); std::string animationName = movName.at(animationIndex); play(animationName, durationTo, loop); @@ -296,7 +296,7 @@ void ArmatureAnimation::gotoAndPlay(int frameIndex) { if (!_movementData || frameIndex < 0 || frameIndex >= _movementData->duration) { - CCLOG("Please ensure you have played a movement, and the frameIndex is in the range."); + AXLOG("Please ensure you have played a movement, and the frameIndex is in the range."); return; } @@ -366,7 +366,7 @@ void ArmatureAnimation::update(float dt) _ignoreFrameEvent = false; - CC_SAFE_DELETE(event); + AX_SAFE_DELETE(event); } while (_movementEventQueue.size() > 0) @@ -384,7 +384,7 @@ void ArmatureAnimation::update(float dt) _movementEventListener(event->armature, event->movementType, event->movementID); } - CC_SAFE_DELETE(event); + AX_SAFE_DELETE(event); } } @@ -482,8 +482,8 @@ void ArmatureAnimation::setFrameEventCallFunc( void ArmatureAnimation::setUserObject(Ref* pUserObject) { - CC_SAFE_RETAIN(pUserObject); - CC_SAFE_RELEASE(_userObject); + AX_SAFE_RETAIN(pUserObject); + AX_SAFE_RELEASE(_userObject); _userObject = pUserObject; } diff --git a/extensions/cocostudio/CCArmatureAnimation.h b/extensions/cocostudio/CCArmatureAnimation.h index 6b61f316ce..f9abd11ae9 100644 --- a/extensions/cocostudio/CCArmatureAnimation.h +++ b/extensions/cocostudio/CCArmatureAnimation.h @@ -95,8 +95,8 @@ public: * This method is deprecated, please use setSpeedScale. * @param animationScale Scale value */ - CC_DEPRECATED_ATTRIBUTE virtual void setAnimationScale(float animationScale); - CC_DEPRECATED_ATTRIBUTE virtual float getAnimationScale() const; + AX_DEPRECATED_ATTRIBUTE virtual void setAnimationScale(float animationScale); + AX_DEPRECATED_ATTRIBUTE virtual float getAnimationScale() const; /** * Scale animation play speed. @@ -106,7 +106,7 @@ public: virtual float getSpeedScale() const; //! The animation update speed - CC_DEPRECATED_ATTRIBUTE virtual void setAnimationInternal(float animationInternal) {} + AX_DEPRECATED_ATTRIBUTE virtual void setAnimationInternal(float animationInternal) {} using ProcessBase::play; /** @@ -130,7 +130,7 @@ public: * @deprecated, please use playWithIndex * @param animationIndex the animation index you want to play */ - CC_DEPRECATED_ATTRIBUTE virtual void playByIndex(int animationIndex, int durationTo = -1, int loop = -1); + AX_DEPRECATED_ATTRIBUTE virtual void playByIndex(int animationIndex, int durationTo = -1, int loop = -1); virtual void playWithIndex(int animationIndex, int durationTo = -1, int loop = -1); virtual void playWithNames(const std::vector& movementNames, int durationTo = -1, bool loop = true); @@ -183,13 +183,13 @@ public: * Set armature's movement event callback function * To disconnect this event, just setMovementEventCallFunc(nullptr, nullptr); */ - CC_DEPRECATED_ATTRIBUTE void setMovementEventCallFunc(axis::Ref* target, SEL_MovementEventCallFunc callFunc); + AX_DEPRECATED_ATTRIBUTE void setMovementEventCallFunc(axis::Ref* target, SEL_MovementEventCallFunc callFunc); /** * Set armature's frame event callback function * To disconnect this event, just setFrameEventCallFunc(nullptr, nullptr); */ - CC_DEPRECATED_ATTRIBUTE void setFrameEventCallFunc(axis::Ref* target, SEL_FrameEventCallFunc callFunc); + AX_DEPRECATED_ATTRIBUTE void setFrameEventCallFunc(axis::Ref* target, SEL_FrameEventCallFunc callFunc); void setMovementEventCallFunc( std::function listener); @@ -201,8 +201,8 @@ public: { if (_animationData != data) { - CC_SAFE_RETAIN(data); - CC_SAFE_RELEASE(_animationData); + AX_SAFE_RETAIN(data); + AX_SAFE_RELEASE(_animationData); _animationData = data; } } diff --git a/extensions/cocostudio/CCArmatureDataManager.cpp b/extensions/cocostudio/CCArmatureDataManager.cpp index 4ddff62d8f..14a4cdcea5 100644 --- a/extensions/cocostudio/CCArmatureDataManager.cpp +++ b/extensions/cocostudio/CCArmatureDataManager.cpp @@ -42,7 +42,7 @@ ArmatureDataManager* ArmatureDataManager::getInstance() s_sharedArmatureDataManager = new ArmatureDataManager(); if (!s_sharedArmatureDataManager->init()) { - CC_SAFE_DELETE(s_sharedArmatureDataManager); + AX_SAFE_DELETE(s_sharedArmatureDataManager); } } return s_sharedArmatureDataManager; @@ -52,7 +52,7 @@ void ArmatureDataManager::destroyInstance() { SpriteFrameCacheHelper::purge(); DataReaderHelper::purge(); - CC_SAFE_RELEASE_NULL(s_sharedArmatureDataManager); + AX_SAFE_RELEASE_NULL(s_sharedArmatureDataManager); } ArmatureDataManager::ArmatureDataManager(void) diff --git a/extensions/cocostudio/CCArmatureDataManager.h b/extensions/cocostudio/CCArmatureDataManager.h index 8409791162..646df7f2ce 100644 --- a/extensions/cocostudio/CCArmatureDataManager.h +++ b/extensions/cocostudio/CCArmatureDataManager.h @@ -47,13 +47,13 @@ class CCS_DLL ArmatureDataManager : public axis::Ref { public: /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static ArmatureDataManager* sharedArmatureDataManager() + AX_DEPRECATED_ATTRIBUTE static ArmatureDataManager* sharedArmatureDataManager() { return ArmatureDataManager::getInstance(); } /** @deprecated Use destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge() { ArmatureDataManager::destroyInstance(); }; + AX_DEPRECATED_ATTRIBUTE static void purge() { ArmatureDataManager::destroyInstance(); }; static ArmatureDataManager* getInstance(); static void destroyInstance(); diff --git a/extensions/cocostudio/CCBatchNode.cpp b/extensions/cocostudio/CCBatchNode.cpp index 2817166847..bb69ff6391 100644 --- a/extensions/cocostudio/CCBatchNode.cpp +++ b/extensions/cocostudio/CCBatchNode.cpp @@ -40,13 +40,13 @@ BatchNode* BatchNode::create() batchNode->autorelease(); return batchNode; } - CC_SAFE_DELETE(batchNode); + AX_SAFE_DELETE(batchNode); return nullptr; } BatchNode::BatchNode() : _groupCommand(nullptr) {} BatchNode::~BatchNode() { - CC_SAFE_DELETE(_groupCommand); + AX_SAFE_DELETE(_groupCommand); } bool BatchNode::init() @@ -131,7 +131,7 @@ void BatchNode::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) return; } - // CC_NODE_DRAW_SETUP(); + // AX_NODE_DRAW_SETUP(); bool pushed = false; for (auto object : _children) diff --git a/extensions/cocostudio/CCBone.cpp b/extensions/cocostudio/CCBone.cpp index b43e6b88dd..ecfda6e184 100644 --- a/extensions/cocostudio/CCBone.cpp +++ b/extensions/cocostudio/CCBone.cpp @@ -43,7 +43,7 @@ Bone* Bone::create() pBone->autorelease(); return pBone; } - CC_SAFE_DELETE(pBone); + AX_SAFE_DELETE(pBone); return nullptr; } @@ -56,7 +56,7 @@ Bone* Bone::create(std::string_view name) pBone->autorelease(); return pBone; } - CC_SAFE_DELETE(pBone); + AX_SAFE_DELETE(pBone); return nullptr; } @@ -80,14 +80,14 @@ Bone::Bone() Bone::~Bone(void) { - CC_SAFE_DELETE(_tweenData); - CC_SAFE_DELETE(_tween); - CC_SAFE_DELETE(_displayManager); - CC_SAFE_DELETE(_worldInfo); + AX_SAFE_DELETE(_tweenData); + AX_SAFE_DELETE(_tween); + AX_SAFE_DELETE(_displayManager); + AX_SAFE_DELETE(_worldInfo); - CC_SAFE_RELEASE_NULL(_boneData); + AX_SAFE_RELEASE_NULL(_boneData); - CC_SAFE_RELEASE(_childArmature); + AX_SAFE_RELEASE(_childArmature); } bool Bone::init() @@ -103,21 +103,21 @@ bool Bone::init(std::string_view name) _name = name; - CC_SAFE_DELETE(_tweenData); + AX_SAFE_DELETE(_tweenData); _tweenData = new FrameData(); - CC_SAFE_DELETE(_tween); + AX_SAFE_DELETE(_tween); _tween = new Tween(); _tween->init(this); - CC_SAFE_DELETE(_displayManager); + AX_SAFE_DELETE(_displayManager); _displayManager = new DisplayManager(); _displayManager->init(this); - CC_SAFE_DELETE(_worldInfo); + AX_SAFE_DELETE(_worldInfo); _worldInfo = new BaseData(); - CC_SAFE_DELETE(_boneData); + AX_SAFE_DELETE(_boneData); _boneData = new BoneData(); bRet = true; @@ -128,12 +128,12 @@ bool Bone::init(std::string_view name) void Bone::setBoneData(BoneData* boneData) { - CCASSERT(nullptr != boneData, "_boneData must not be nullptr"); + AXASSERT(nullptr != boneData, "_boneData must not be nullptr"); if (_boneData != boneData) { - CC_SAFE_RETAIN(boneData); - CC_SAFE_RELEASE(_boneData); + AX_SAFE_RETAIN(boneData); + AX_SAFE_RELEASE(_boneData); _boneData = boneData; } @@ -192,8 +192,8 @@ void Bone::update(float delta) _worldInfo->y = _worldInfo->y + _position.y; _worldInfo->scaleX = _worldInfo->scaleX * _scaleX; _worldInfo->scaleY = _worldInfo->scaleY * _scaleY; - _worldInfo->skewX = _worldInfo->skewX + _skewX + CC_DEGREES_TO_RADIANS(_rotationZ_X); - _worldInfo->skewY = _worldInfo->skewY + _skewY - CC_DEGREES_TO_RADIANS(_rotationZ_Y); + _worldInfo->skewX = _worldInfo->skewX + _skewX + AX_DEGREES_TO_RADIANS(_rotationZ_X); + _worldInfo->skewY = _worldInfo->skewY + _skewY - AX_DEGREES_TO_RADIANS(_rotationZ_Y); if (_parentBone) { @@ -249,17 +249,17 @@ void Bone::setBlendFunc(const BlendFunc& blendFunc) void Bone::updateDisplayedColor(const Color3B& parentColor) { -#ifdef CC_STUDIO_ENABLED_VIEW +#ifdef AX_STUDIO_ENABLED_VIEW _realColor = Color3B(255, 255, 255); -#endif // CC_STUDIO_ENABLED_VIEW +#endif // AX_STUDIO_ENABLED_VIEW Node::updateDisplayedColor(parentColor); } void Bone::updateDisplayedOpacity(uint8_t parentOpacity) { -#ifdef CC_STUDIO_ENABLED_VIEW +#ifdef AX_STUDIO_ENABLED_VIEW _realOpacity = 255; -#endif // CC_STUDIO_ENABLED_VIEW +#endif // AX_STUDIO_ENABLED_VIEW Node::updateDisplayedOpacity(parentOpacity); } @@ -289,15 +289,15 @@ void Bone::updateZOrder() void Bone::addChildBone(Bone* child) { - CCASSERT(nullptr != child, "Argument must be non-nil"); - CCASSERT(nullptr == child->_parentBone, "child already added. It can't be added again"); + AXASSERT(nullptr != child, "Argument must be non-nil"); + AXASSERT(nullptr == child->_parentBone, "child already added. It can't be added again"); if (_children.empty()) { _children.reserve(4); } - if (_children.getIndex(child) == CC_INVALID_INDEX) + if (_children.getIndex(child) == AX_INVALID_INDEX) { _children.pushBack(child); child->setParentBone(this); @@ -306,7 +306,7 @@ void Bone::addChildBone(Bone* child) void Bone::removeChildBone(Bone* bone, bool recursion) { - if (!_children.empty() && _children.getIndex(bone) != CC_INVALID_INDEX) + if (!_children.empty() && _children.getIndex(bone) != AX_INVALID_INDEX) { if (recursion) { @@ -354,8 +354,8 @@ void Bone::setChildArmature(Armature* armature) _childArmature->setParentBone(nullptr); } - CC_SAFE_RETAIN(armature); - CC_SAFE_RELEASE(_childArmature); + AX_SAFE_RETAIN(armature); + AX_SAFE_RELEASE(_childArmature); _childArmature = armature; } } diff --git a/extensions/cocostudio/CCBone.h b/extensions/cocostudio/CCBone.h index 1ab62afcf9..3964bc7a4b 100644 --- a/extensions/cocostudio/CCBone.h +++ b/extensions/cocostudio/CCBone.h @@ -94,8 +94,8 @@ public: void removeDisplay(int index); - CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); - CC_DEPRECATED_ATTRIBUTE void changeDisplayByName(std::string_view name, bool force); + AX_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); + AX_DEPRECATED_ATTRIBUTE void changeDisplayByName(std::string_view name, bool force); void changeDisplayWithIndex(int index, bool force); void changeDisplayWithName(std::string_view name, bool force); @@ -194,7 +194,7 @@ public: * This function is deprecated, please use isIgnoreMovementBoneData() * @lua NA */ - CC_DEPRECATED_ATTRIBUTE virtual bool getIgnoreMovementBoneData() const { return isIgnoreMovementBoneData(); } + AX_DEPRECATED_ATTRIBUTE virtual bool getIgnoreMovementBoneData() const { return isIgnoreMovementBoneData(); } /* * Set blend function diff --git a/extensions/cocostudio/CCColliderDetector.cpp b/extensions/cocostudio/CCColliderDetector.cpp index e6d0b8cf8a..93399d3b06 100644 --- a/extensions/cocostudio/CCColliderDetector.cpp +++ b/extensions/cocostudio/CCColliderDetector.cpp @@ -60,39 +60,39 @@ void ColliderFilter::updateShape(cpShape* shape) #if ENABLE_PHYSICS_BOX2D_DETECT ColliderBody::ColliderBody(ContourData* contourData) : _fixture(nullptr), _contourData(contourData) { - CC_SAFE_RETAIN(_contourData); + AX_SAFE_RETAIN(_contourData); _filter = new ColliderFilter(); # if ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX _calculatedVertexList = Array::create(); - CC_SAFE_RETAIN(_calculatedVertexList); + AX_SAFE_RETAIN(_calculatedVertexList); # endif } #elif ENABLE_PHYSICS_CHIPMUNK_DETECT ColliderBody::ColliderBody(ContourData* contourData) : _shape(nullptr), _contourData(contourData) { - CC_SAFE_RETAIN(_contourData); + AX_SAFE_RETAIN(_contourData); _filter = new ColliderFilter(); # if ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX _calculatedVertexList = Array::create(); - CC_SAFE_RETAIN(_calculatedVertexList); + AX_SAFE_RETAIN(_calculatedVertexList); # endif } #elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX ColliderBody::ColliderBody(ContourData* contourData) : _contourData(contourData) { - CC_SAFE_RETAIN(_contourData); + AX_SAFE_RETAIN(_contourData); } #endif ColliderBody::~ColliderBody() { - CC_SAFE_RELEASE(_contourData); + AX_SAFE_RELEASE(_contourData); #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT - CC_SAFE_DELETE(_filter); + AX_SAFE_DELETE(_filter); #endif } @@ -115,7 +115,7 @@ ColliderDetector* ColliderDetector::create() pColliderDetector->autorelease(); return pColliderDetector; } - CC_SAFE_DELETE(pColliderDetector); + AX_SAFE_DELETE(pColliderDetector); return nullptr; } @@ -127,7 +127,7 @@ ColliderDetector* ColliderDetector::create(Bone* bone) pColliderDetector->autorelease(); return pColliderDetector; } - CC_SAFE_DELETE(pColliderDetector); + AX_SAFE_DELETE(pColliderDetector); return nullptr; } @@ -144,7 +144,7 @@ ColliderDetector::~ColliderDetector() _colliderBodyList.clear(); #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT - CC_SAFE_DELETE(_filter); + AX_SAFE_DELETE(_filter); #endif } @@ -413,7 +413,7 @@ void ColliderDetector::setBody(b2Body* pBody) b2PolygonShape polygon; polygon.Set(b2bv, (int)contourData->vertexList.size()); - CC_SAFE_DELETE(b2bv); + AX_SAFE_DELETE(b2bv); b2FixtureDef fixtureDef; fixtureDef.shape = &polygon; diff --git a/extensions/cocostudio/CCComAttribute.cpp b/extensions/cocostudio/CCComAttribute.cpp index e1c3334c09..36ad7dfb4b 100644 --- a/extensions/cocostudio/CCComAttribute.cpp +++ b/extensions/cocostudio/CCComAttribute.cpp @@ -141,7 +141,7 @@ ComAttribute* ComAttribute::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } @@ -151,7 +151,7 @@ bool ComAttribute::serialize(void* r) bool ret = false; do { - CC_BREAK_IF(r == nullptr); + AX_BREAK_IF(r == nullptr); SerData* serData = (SerData*)(r); const rapidjson::Value* v = serData->_rData; stExpCocoNode* cocoNode = serData->_cocoNode; @@ -164,26 +164,26 @@ bool ComAttribute::serialize(void* r) if (v != nullptr) { className = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(className == nullptr); + AX_BREAK_IF(className == nullptr); comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value& fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); - CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + AX_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); file = DICTOOL->getStringValue_json(fileData, "path"); - CC_BREAK_IF(file == nullptr); + AX_BREAK_IF(file == nullptr); resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); - CC_BREAK_IF(resType != 0); + AX_BREAK_IF(resType != 0); } else if (cocoNode != nullptr) { className = cocoNode[1].GetValue(cocoLoader); - CC_BREAK_IF(className == nullptr); + AX_BREAK_IF(className == nullptr); comName = cocoNode[2].GetValue(cocoLoader); stExpCocoNode* fileData = cocoNode[3].GetChildArray(cocoLoader); - CC_BREAK_IF(!fileData); + AX_BREAK_IF(!fileData); file = fileData[0].GetValue(cocoLoader); - CC_BREAK_IF(file == nullptr); + AX_BREAK_IF(file == nullptr); resType = atoi(fileData[2].GetValue(cocoLoader)); - CC_BREAK_IF(resType != 0); + AX_BREAK_IF(resType != 0); } if (comName != nullptr) { @@ -213,7 +213,7 @@ bool ComAttribute::parse(std::string_view jsonFile) { std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonFile); _doc.Parse<0>(contentStr.c_str()); - CC_BREAK_IF(_doc.HasParseError()); + AX_BREAK_IF(_doc.HasParseError()); ret = true; } while (0); return ret; diff --git a/extensions/cocostudio/CCComAttribute.h b/extensions/cocostudio/CCComAttribute.h index 453ac8327f..d30d153b09 100644 --- a/extensions/cocostudio/CCComAttribute.h +++ b/extensions/cocostudio/CCComAttribute.h @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EXTENTIONS_CCCOMATTRIBUTE_H__ -#define __CC_EXTENTIONS_CCCOMATTRIBUTE_H__ +#ifndef __AX_EXTENTIONS_CCCOMATTRIBUTE_H__ +#define __AX_EXTENTIONS_CCCOMATTRIBUTE_H__ #include "CCComBase.h" #include "2d/CCComponent.h" @@ -71,4 +71,4 @@ private: } // namespace cocostudio -#endif // __CC_EXTENTIONS_CCCOMATTRIBUTE_H__ +#endif // __AX_EXTENTIONS_CCCOMATTRIBUTE_H__ diff --git a/extensions/cocostudio/CCComAudio.cpp b/extensions/cocostudio/CCComAudio.cpp index 4da00aa3ff..769b0c5011 100644 --- a/extensions/cocostudio/CCComAudio.cpp +++ b/extensions/cocostudio/CCComAudio.cpp @@ -65,7 +65,7 @@ bool ComAudio::serialize(void* r) bool ret = false; do { - CC_BREAK_IF(r == nullptr); + AX_BREAK_IF(r == nullptr); SerData* serData = (SerData*)(r); const rapidjson::Value* v = serData->_rData; stExpCocoNode* cocoNode = serData->_cocoNode; @@ -79,27 +79,27 @@ bool ComAudio::serialize(void* r) if (v != nullptr) { className = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(className == nullptr); + AX_BREAK_IF(className == nullptr); comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value& fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); - CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + AX_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); file = DICTOOL->getStringValue_json(fileData, "path"); - CC_BREAK_IF(file == nullptr); + AX_BREAK_IF(file == nullptr); resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); - CC_BREAK_IF(resType != 0); + AX_BREAK_IF(resType != 0); loop = DICTOOL->getIntValue_json(*v, "loop") != 0 ? true : false; } else if (cocoNode != nullptr) { className = cocoNode[1].GetValue(cocoLoader); - CC_BREAK_IF(className == nullptr); + AX_BREAK_IF(className == nullptr); comName = cocoNode[2].GetValue(cocoLoader); stExpCocoNode* pfileData = cocoNode[4].GetChildArray(cocoLoader); - CC_BREAK_IF(!pfileData); + AX_BREAK_IF(!pfileData); file = pfileData[0].GetValue(cocoLoader); - CC_BREAK_IF(file == nullptr); + AX_BREAK_IF(file == nullptr); resType = atoi(pfileData[2].GetValue(cocoLoader)); - CC_BREAK_IF(resType != 0); + AX_BREAK_IF(resType != 0); loop = atoi(cocoNode[5].GetValue(cocoLoader)) != 0 ? true : false; ret = true; } @@ -131,7 +131,7 @@ bool ComAudio::serialize(void* r) } else { - CC_BREAK_IF(true); + AX_BREAK_IF(true); } ret = true; } while (0); @@ -147,7 +147,7 @@ ComAudio* ComAudio::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/cocostudio/CCComAudio.h b/extensions/cocostudio/CCComAudio.h index e4268bb9e8..3f3947c4ff 100644 --- a/extensions/cocostudio/CCComAudio.h +++ b/extensions/cocostudio/CCComAudio.h @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EXTENTIONS_CCCOMAUDIO_H__ -#define __CC_EXTENTIONS_CCCOMAUDIO_H__ +#ifndef __AX_EXTENTIONS_CCCOMAUDIO_H__ +#define __AX_EXTENTIONS_CCCOMAUDIO_H__ #include "CCComBase.h" #include "base/CCProtocols.h" @@ -129,4 +129,4 @@ private: } // namespace cocostudio -#endif // __CC_EXTENTIONS_CCCOMAUDIO_H__ +#endif // __AX_EXTENTIONS_CCCOMAUDIO_H__ diff --git a/extensions/cocostudio/CCComBase.h b/extensions/cocostudio/CCComBase.h index 46aa627cd0..001a805bab 100644 --- a/extensions/cocostudio/CCComBase.h +++ b/extensions/cocostudio/CCComBase.h @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EXTENTIONS_CCCOMBASE_H__ -#define __CC_EXTENTIONS_CCCOMBASE_H__ +#ifndef __AX_EXTENTIONS_CCCOMBASE_H__ +#define __AX_EXTENTIONS_CCCOMBASE_H__ #include #include "DictionaryHelper.h" diff --git a/extensions/cocostudio/CCComController.cpp b/extensions/cocostudio/CCComController.cpp index ef748246e0..61ac4616e1 100644 --- a/extensions/cocostudio/CCComController.cpp +++ b/extensions/cocostudio/CCComController.cpp @@ -75,7 +75,7 @@ ComController* ComController::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/cocostudio/CCComController.h b/extensions/cocostudio/CCComController.h index c6dcff7589..5ab0f482c8 100644 --- a/extensions/cocostudio/CCComController.h +++ b/extensions/cocostudio/CCComController.h @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EXTENTIONS_CCCOMCONTROLLER_H__ -#define __CC_EXTENTIONS_CCCOMCONTROLLER_H__ +#ifndef __AX_EXTENTIONS_CCCOMCONTROLLER_H__ +#define __AX_EXTENTIONS_CCCOMCONTROLLER_H__ #include "CCComBase.h" #include "CCInputDelegate.h" @@ -83,4 +83,4 @@ public: } // namespace cocostudio -#endif // __CC_EXTENTIONS_CCCOMCONTROLLER_H__ +#endif // __AX_EXTENTIONS_CCCOMCONTROLLER_H__ diff --git a/extensions/cocostudio/CCComExtensionData.cpp b/extensions/cocostudio/CCComExtensionData.cpp index 629c808870..040d721bdb 100644 --- a/extensions/cocostudio/CCComExtensionData.cpp +++ b/extensions/cocostudio/CCComExtensionData.cpp @@ -38,7 +38,7 @@ ComExtensionData::ComExtensionData() : _customProperty(""), _timelineData(nullpt ComExtensionData::~ComExtensionData() { - CC_SAFE_RELEASE(_timelineData); + AX_SAFE_RELEASE(_timelineData); } ComExtensionData* ComExtensionData::create() @@ -50,7 +50,7 @@ ComExtensionData* ComExtensionData::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -58,7 +58,7 @@ ComExtensionData* ComExtensionData::create() bool ComExtensionData::init() { _timelineData = cocostudio::timeline::ActionTimelineData::create(0); - CC_SAFE_RETAIN(_timelineData); + AX_SAFE_RETAIN(_timelineData); return true; } diff --git a/extensions/cocostudio/CCComRender.cpp b/extensions/cocostudio/CCComRender.cpp index 28876357a8..da42f5422c 100644 --- a/extensions/cocostudio/CCComRender.cpp +++ b/extensions/cocostudio/CCComRender.cpp @@ -56,7 +56,7 @@ ComRender::ComRender(axis::Node* node, const char* comName) ComRender::~ComRender() { - CC_SAFE_RELEASE_NULL(_render); + AX_SAFE_RELEASE_NULL(_render); } void ComRender::onEnter() @@ -116,7 +116,7 @@ bool ComRender::serialize(void* r) bool ret = false; do { - CC_BREAK_IF(r == nullptr); + AX_BREAK_IF(r == nullptr); SerData* serData = (SerData*)(r); const rapidjson::Value* v = serData->_rData; stExpCocoNode* cocoNode = serData->_cocoNode; @@ -131,25 +131,25 @@ bool ComRender::serialize(void* r) if (v != nullptr) { className = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(className == nullptr); + AX_BREAK_IF(className == nullptr); comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value& fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); - CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + AX_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); file = DICTOOL->getStringValue_json(fileData, "path"); plist = DICTOOL->getStringValue_json(fileData, "plistFile"); - CC_BREAK_IF(file == nullptr && plist == nullptr); + AX_BREAK_IF(file == nullptr && plist == nullptr); resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); } else if (cocoNode != nullptr) { className = cocoNode[1].GetValue(cocoLoader); - CC_BREAK_IF(className == nullptr); + AX_BREAK_IF(className == nullptr); comName = cocoNode[2].GetValue(cocoLoader); stExpCocoNode* pfileData = cocoNode[4].GetChildArray(cocoLoader); - CC_BREAK_IF(!pfileData); + AX_BREAK_IF(!pfileData); file = pfileData[0].GetValue(cocoLoader); plist = pfileData[1].GetValue(cocoLoader); - CC_BREAK_IF(file == nullptr && plist == nullptr); + AX_BREAK_IF(file == nullptr && plist == nullptr); resType = atoi(pfileData[2].GetValue(cocoLoader)); } if (comName != nullptr) @@ -232,7 +232,7 @@ bool ComRender::serialize(void* r) std::string binaryFilePath = FileUtils::getInstance()->fullPathForFilename(filePath); auto fileData = FileUtils::getInstance()->getDataFromFile(binaryFilePath); auto fileDataBytes = fileData.getBytes(); - CC_BREAK_IF(fileData.isNull()); + AX_BREAK_IF(fileData.isNull()); CocoLoader tCocoLoader; if (tCocoLoader.ReadCocoBinBuff((char*)fileDataBytes)) { @@ -321,7 +321,7 @@ bool ComRender::serialize(void* r) } else { - CC_BREAK_IF(true); + AX_BREAK_IF(true); } } else if (resType == 1) @@ -343,12 +343,12 @@ bool ComRender::serialize(void* r) } else { - CC_BREAK_IF(true); + AX_BREAK_IF(true); } } else { - CC_BREAK_IF(true); + AX_BREAK_IF(true); } } while (0); @@ -364,7 +364,7 @@ ComRender* ComRender::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -378,7 +378,7 @@ ComRender* ComRender::create(axis::Node* node, const char* comName) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -390,7 +390,7 @@ bool ComRender::readJson(std::string_view fileName, rapidjson::Document& doc) { std::string contentStr = FileUtils::getInstance()->getStringFromFile(fileName); doc.Parse<0>(contentStr.c_str()); - CC_BREAK_IF(doc.HasParseError()); + AX_BREAK_IF(doc.HasParseError()); ret = true; } while (0); return ret; diff --git a/extensions/cocostudio/CCComRender.h b/extensions/cocostudio/CCComRender.h index 226bb2cec1..4b1262e18a 100644 --- a/extensions/cocostudio/CCComRender.h +++ b/extensions/cocostudio/CCComRender.h @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EXTENTIONS_CCCOMRENDER_H__ -#define __CC_EXTENTIONS_CCCOMRENDER_H__ +#ifndef __AX_EXTENTIONS_CCCOMRENDER_H__ +#define __AX_EXTENTIONS_CCCOMRENDER_H__ #include "CCComBase.h" #include "2d/CCComponent.h" @@ -83,4 +83,4 @@ private: }; } // namespace cocostudio -#endif // __CC_EXTENTIONS_CCCOMRENDER_H__ +#endif // __AX_EXTENTIONS_CCCOMRENDER_H__ diff --git a/extensions/cocostudio/CCDataReaderHelper.cpp b/extensions/cocostudio/CCDataReaderHelper.cpp index 606d08cc8d..21bc2c4120 100644 --- a/extensions/cocostudio/CCDataReaderHelper.cpp +++ b/extensions/cocostudio/CCDataReaderHelper.cpp @@ -240,7 +240,7 @@ float DataReaderHelper::getPositionReadScale() void DataReaderHelper::purge() { _configFileList.clear(); - CC_SAFE_RELEASE_NULL(_dataReaderHelper); + AX_SAFE_RELEASE_NULL(_dataReaderHelper); } DataReaderHelper::DataReaderHelper() @@ -260,7 +260,7 @@ DataReaderHelper::~DataReaderHelper() if (_loadingThread) _loadingThread->join(); - CC_SAFE_DELETE(_loadingThread); + AX_SAFE_DELETE(_loadingThread); _dataReaderHelper = nullptr; } @@ -367,7 +367,7 @@ void DataReaderHelper::addDataFromFileAsync(std::string_view imagePath, if (0 == _asyncRefCount) { - Director::getInstance()->getScheduler()->schedule(CC_SCHEDULE_SELECTOR(DataReaderHelper::addDataAsyncCallBack), + Director::getInstance()->getScheduler()->schedule(AX_SCHEDULE_SELECTOR(DataReaderHelper::addDataAsyncCallBack), this, 0, false); } @@ -477,7 +477,7 @@ void DataReaderHelper::addDataAsyncCallBack(float /*dt*/) { _asyncRefTotalCount = 0; Director::getInstance()->getScheduler()->unschedule( - CC_SCHEDULE_SELECTOR(DataReaderHelper::addDataAsyncCallBack), this); + AX_SCHEDULE_SELECTOR(DataReaderHelper::addDataAsyncCallBack), this); } } } @@ -928,7 +928,7 @@ FrameData* DataReaderHelper::decodeFrame(pugi::xml_node& frameXML, } } - auto degrees2radius = [](float v) { return CC_DEGREES_TO_RADIANS(v); }; + auto degrees2radius = [](float v) { return AX_DEGREES_TO_RADIANS(v); }; pugiext::query_attribute(frameXML, A_SCALE_X, &frameData->scaleX); pugiext::query_attribute(frameXML, A_SCALE_Y, &frameData->scaleY); @@ -968,8 +968,8 @@ FrameData* DataReaderHelper::decodeFrame(pugi::xml_node& frameXML, break; default: { - frameData->blendFunc.src = CC_BLEND_SRC; - frameData->blendFunc.dst = CC_BLEND_DST; + frameData->blendFunc.src = AX_BLEND_SRC; + frameData->blendFunc.dst = AX_BLEND_DST; } break; } @@ -1035,8 +1035,8 @@ FrameData* DataReaderHelper::decodeFrame(pugi::xml_node& frameXML, pugiext::query_attribute(parentFrameXml, A_SKEW_Y, &helpNode.skewY); helpNode.y = -helpNode.y; - helpNode.skewX = CC_DEGREES_TO_RADIANS(helpNode.skewX); - helpNode.skewY = CC_DEGREES_TO_RADIANS(-helpNode.skewY); + helpNode.skewX = AX_DEGREES_TO_RADIANS(helpNode.skewX); + helpNode.skewY = AX_DEGREES_TO_RADIANS(-helpNode.skewY); TransformHelp::transformFromParent(*frameData, helpNode); } @@ -1131,7 +1131,7 @@ void DataReaderHelper::addDataFromJsonCache(std::string_view fileContent, DataIn json.ParseStream<0>(stream); if (json.HasParseError()) { - CCLOG("GetParseError %d\n", json.GetParseError()); + AXLOG("GetParseError %d\n", json.GetParseError()); } dataInfo->contentScale = DICTOOL->getFloatValue_json(json, CONTENT_SCALE, 1.0f); @@ -1208,7 +1208,7 @@ void DataReaderHelper::addDataFromJsonCache(std::string_view fileContent, DataIn i); // json[CONFIG_FILE_PATH][i].IsNull() ? nullptr : json[CONFIG_FILE_PATH][i].GetString(); if (path == nullptr) { - CCLOG("load CONFIG_FILE_PATH error."); + AXLOG("load CONFIG_FILE_PATH error."); return; } @@ -1753,7 +1753,7 @@ void DataReaderHelper::addDataFromBinaryCache(const char* fileContent, DataInfo* const char* path = pConfigFilePath[ii].GetValue(&tCocoLoader); if (path == nullptr) { - CCLOG("load CONFIG_FILE_PATH error."); + AXLOG("load CONFIG_FILE_PATH error."); return; } diff --git a/extensions/cocostudio/CCDataReaderHelper.h b/extensions/cocostudio/CCDataReaderHelper.h index f362b87841..0b089667d6 100644 --- a/extensions/cocostudio/CCDataReaderHelper.h +++ b/extensions/cocostudio/CCDataReaderHelper.h @@ -87,7 +87,7 @@ protected: public: /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static DataReaderHelper* sharedDataReaderHelper() + AX_DEPRECATED_ATTRIBUTE static DataReaderHelper* sharedDataReaderHelper() { return DataReaderHelper::getInstance(); } diff --git a/extensions/cocostudio/CCDatas.cpp b/extensions/cocostudio/CCDatas.cpp index bd57787988..97087bb48d 100644 --- a/extensions/cocostudio/CCDatas.cpp +++ b/extensions/cocostudio/CCDatas.cpp @@ -99,20 +99,20 @@ void BaseData::subtract(BaseData* from, BaseData* to, bool limit) { if (skewX > M_PI) { - skewX -= (float)CC_DOUBLE_PI; + skewX -= (float)AX_DOUBLE_PI; } if (skewX < -M_PI) { - skewX += (float)CC_DOUBLE_PI; + skewX += (float)AX_DOUBLE_PI; } if (skewY > M_PI) { - skewY -= (float)CC_DOUBLE_PI; + skewY -= (float)AX_DOUBLE_PI; } if (skewY < -M_PI) { - skewY += (float)CC_DOUBLE_PI; + skewY += (float)AX_DOUBLE_PI; } } @@ -241,7 +241,7 @@ FrameData::FrameData(void) FrameData::~FrameData(void) { - CC_SAFE_DELETE(easingParams); + AX_SAFE_DELETE(easingParams); } void FrameData::copy(const BaseData* baseData) @@ -256,7 +256,7 @@ void FrameData::copy(const BaseData* baseData) tweenEasing = frameData->tweenEasing; easingParamNumber = frameData->easingParamNumber; - CC_SAFE_DELETE(easingParams); + AX_SAFE_DELETE(easingParams); if (easingParamNumber != 0) { easingParams = new float[easingParamNumber]; diff --git a/extensions/cocostudio/CCDatas.h b/extensions/cocostudio/CCDatas.h index a43fa0dc8b..fa6e204d7f 100644 --- a/extensions/cocostudio/CCDatas.h +++ b/extensions/cocostudio/CCDatas.h @@ -35,7 +35,7 @@ THE SOFTWARE. #include "2d/CCTweenFunction.h" #include "CocosStudioExport.h" -#define CC_CREATE_NO_PARAM_NO_INIT(varType) \ +#define AX_CREATE_NO_PARAM_NO_INIT(varType) \ public: \ static inline varType* create(void) \ { \ @@ -44,7 +44,7 @@ public: \ return var; \ } -#define CC_CREATE_NO_PARAM(varType) \ +#define AX_CREATE_NO_PARAM(varType) \ public: \ static inline varType* create(void) \ { \ @@ -54,7 +54,7 @@ public: \ var->autorelease(); \ return var; \ } \ - CC_SAFE_DELETE(var); \ + AX_SAFE_DELETE(var); \ return nullptr; \ } @@ -69,7 +69,7 @@ namespace cocostudio class CCS_DLL BaseData : public axis::Ref { public: - CC_CREATE_NO_PARAM_NO_INIT(BaseData) + AX_CREATE_NO_PARAM_NO_INIT(BaseData) public: /** * @js ctor @@ -138,7 +138,7 @@ enum DisplayType class CCS_DLL DisplayData : public axis::Ref { public: - CC_CREATE_NO_PARAM_NO_INIT(DisplayData) + AX_CREATE_NO_PARAM_NO_INIT(DisplayData) static std::string changeDisplayToTexture(std::string_view displayName); @@ -166,7 +166,7 @@ public: class CCS_DLL SpriteDisplayData : public DisplayData { public: - CC_CREATE_NO_PARAM_NO_INIT(SpriteDisplayData) + AX_CREATE_NO_PARAM_NO_INIT(SpriteDisplayData) public: /** * @js ctor @@ -191,7 +191,7 @@ public: class CCS_DLL ArmatureDisplayData : public DisplayData { public: - CC_CREATE_NO_PARAM_NO_INIT(ArmatureDisplayData) + AX_CREATE_NO_PARAM_NO_INIT(ArmatureDisplayData) public: /** * @js ctor @@ -211,7 +211,7 @@ public: class CCS_DLL ParticleDisplayData : public DisplayData { public: - CC_CREATE_NO_PARAM_NO_INIT(ParticleDisplayData) + AX_CREATE_NO_PARAM_NO_INIT(ParticleDisplayData) public: /** * @js ctor @@ -234,7 +234,7 @@ public: class CCS_DLL BoneData : public BaseData { public: - CC_CREATE_NO_PARAM(BoneData) + AX_CREATE_NO_PARAM(BoneData) public: /** * @js ctor @@ -268,7 +268,7 @@ public: class CCS_DLL ArmatureData : public axis::Ref { public: - CC_CREATE_NO_PARAM(ArmatureData) + AX_CREATE_NO_PARAM(ArmatureData) public: /** * @js ctor @@ -315,7 +315,7 @@ enum BlendType class CCS_DLL FrameData : public BaseData { public: - CC_CREATE_NO_PARAM_NO_INIT(FrameData) + AX_CREATE_NO_PARAM_NO_INIT(FrameData) public: /** * @js ctor @@ -363,7 +363,7 @@ public: class CCS_DLL MovementBoneData : public axis::Ref { public: - CC_CREATE_NO_PARAM(MovementBoneData) + AX_CREATE_NO_PARAM(MovementBoneData) public: /** * @js ctor @@ -396,7 +396,7 @@ public: class CCS_DLL MovementData : public axis::Ref { public: - CC_CREATE_NO_PARAM_NO_INIT(MovementData) + AX_CREATE_NO_PARAM_NO_INIT(MovementData) public: /** * @js ctor @@ -459,7 +459,7 @@ public: class CCS_DLL AnimationData : public axis::Ref { public: - CC_CREATE_NO_PARAM_NO_INIT(AnimationData) + AX_CREATE_NO_PARAM_NO_INIT(AnimationData) public: /** * @js ctor @@ -489,7 +489,7 @@ public: class CCS_DLL ContourData : public axis::Ref { public: - CC_CREATE_NO_PARAM(ContourData) + AX_CREATE_NO_PARAM(ContourData) public: /** * @js ctor @@ -516,7 +516,7 @@ public: class CCS_DLL TextureData : public axis::Ref { public: - CC_CREATE_NO_PARAM(TextureData) + AX_CREATE_NO_PARAM(TextureData) public: /** * @js ctor diff --git a/extensions/cocostudio/CCDecorativeDisplay.cpp b/extensions/cocostudio/CCDecorativeDisplay.cpp index 7b4d3599c4..2d38e3923d 100644 --- a/extensions/cocostudio/CCDecorativeDisplay.cpp +++ b/extensions/cocostudio/CCDecorativeDisplay.cpp @@ -38,7 +38,7 @@ DecorativeDisplay* DecorativeDisplay::create() pDisplay->autorelease(); return pDisplay; } - CC_SAFE_DELETE(pDisplay); + AX_SAFE_DELETE(pDisplay); return nullptr; } @@ -52,11 +52,11 @@ DecorativeDisplay::DecorativeDisplay() : _display(nullptr), _displayData(nullptr DecorativeDisplay::~DecorativeDisplay(void) { - CC_SAFE_RELEASE_NULL(_displayData); - CC_SAFE_RELEASE_NULL(_display); + AX_SAFE_RELEASE_NULL(_displayData); + AX_SAFE_RELEASE_NULL(_display); #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT || ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX - CC_SAFE_RELEASE_NULL(_colliderDetector); + AX_SAFE_RELEASE_NULL(_colliderDetector); #endif } @@ -69,8 +69,8 @@ void DecorativeDisplay::setDisplay(axis::Node* display) { if (_display != display) { - CC_SAFE_RETAIN(display); - CC_SAFE_RELEASE(_display); + AX_SAFE_RETAIN(display); + AX_SAFE_RELEASE(_display); _display = display; } } diff --git a/extensions/cocostudio/CCDecorativeDisplay.h b/extensions/cocostudio/CCDecorativeDisplay.h index 076201788f..6b98fbfb1e 100644 --- a/extensions/cocostudio/CCDecorativeDisplay.h +++ b/extensions/cocostudio/CCDecorativeDisplay.h @@ -62,8 +62,8 @@ public: { if (_displayData != data) { - CC_SAFE_RETAIN(data); - CC_SAFE_RELEASE(_displayData); + AX_SAFE_RETAIN(data); + AX_SAFE_RELEASE(_displayData); _displayData = data; } } @@ -74,8 +74,8 @@ public: { if (_colliderDetector != detector) { - CC_SAFE_RETAIN(detector); - CC_SAFE_RELEASE(_colliderDetector); + AX_SAFE_RETAIN(detector); + AX_SAFE_RELEASE(_colliderDetector); _colliderDetector = detector; } } diff --git a/extensions/cocostudio/CCDisplayFactory.cpp b/extensions/cocostudio/CCDisplayFactory.cpp index 5a3f884091..0b240312a3 100644 --- a/extensions/cocostudio/CCDisplayFactory.cpp +++ b/extensions/cocostudio/CCDisplayFactory.cpp @@ -109,7 +109,7 @@ void DisplayFactory::updateDisplay(Bone* bone, float dt, bool dirty) do { # if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT - CC_BREAK_IF(!detector->getBody()); + AX_BREAK_IF(!detector->getBody()); # endif Mat4 displayTransform = display->getNodeToParentTransform(); diff --git a/extensions/cocostudio/CCDisplayManager.cpp b/extensions/cocostudio/CCDisplayManager.cpp index 1210d7e881..dd9da15108 100644 --- a/extensions/cocostudio/CCDisplayManager.cpp +++ b/extensions/cocostudio/CCDisplayManager.cpp @@ -42,7 +42,7 @@ DisplayManager* DisplayManager::create(Bone* bone) pDisplayManager->autorelease(); return pDisplayManager; } - CC_SAFE_DELETE(pDisplayManager); + AX_SAFE_DELETE(pDisplayManager); return nullptr; } @@ -64,7 +64,7 @@ DisplayManager::~DisplayManager() { _displayRenderNode->removeFromParentAndCleanup(true); if (_displayRenderNode->getReferenceCount() > 0) - CC_SAFE_RELEASE_NULL(_displayRenderNode); + AX_SAFE_RELEASE_NULL(_displayRenderNode); } } @@ -213,7 +213,7 @@ const axis::Vector& DisplayManager::getDecorativeDisplayList void DisplayManager::changeDisplayWithIndex(int index, bool force) { - CCASSERT(index < (int)_decoDisplayList.size(), "the _index value is out of range"); + AXASSERT(index < (int)_decoDisplayList.size(), "the _index value is out of range"); _forceChangeDisplay = force; diff --git a/extensions/cocostudio/CCDisplayManager.h b/extensions/cocostudio/CCDisplayManager.h index 460e8673f2..9976b48c06 100644 --- a/extensions/cocostudio/CCDisplayManager.h +++ b/extensions/cocostudio/CCDisplayManager.h @@ -79,8 +79,8 @@ public: /* * @deprecated, please use changeDisplayWithIndex and changeDisplayWithName */ - CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); - CC_DEPRECATED_ATTRIBUTE void changeDisplayByName(std::string_view name, bool force); + AX_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); + AX_DEPRECATED_ATTRIBUTE void changeDisplayByName(std::string_view name, bool force); /** * Change display by index. You can just use this method to change display in the display list. diff --git a/extensions/cocostudio/CCInputDelegate.cpp b/extensions/cocostudio/CCInputDelegate.cpp index a44c1695bd..ffcbb3318a 100644 --- a/extensions/cocostudio/CCInputDelegate.cpp +++ b/extensions/cocostudio/CCInputDelegate.cpp @@ -119,10 +119,10 @@ void InputDelegate::setTouchEnabled(bool enabled) // Register Touch Event auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(InputDelegate::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(InputDelegate::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(InputDelegate::onTouchesEnded, this); - listener->onTouchesCancelled = CC_CALLBACK_2(InputDelegate::onTouchesCancelled, this); + listener->onTouchesBegan = AX_CALLBACK_2(InputDelegate::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(InputDelegate::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(InputDelegate::onTouchesEnded, this); + listener->onTouchesCancelled = AX_CALLBACK_2(InputDelegate::onTouchesCancelled, this); dispatcher->addEventListenerWithFixedPriority(listener, _touchPriority); _touchListener = listener; @@ -133,10 +133,10 @@ void InputDelegate::setTouchEnabled(bool enabled) auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - listener->onTouchBegan = CC_CALLBACK_2(InputDelegate::onTouchBegan, this); - listener->onTouchMoved = CC_CALLBACK_2(InputDelegate::onTouchMoved, this); - listener->onTouchEnded = CC_CALLBACK_2(InputDelegate::onTouchEnded, this); - listener->onTouchCancelled = CC_CALLBACK_2(InputDelegate::onTouchCancelled, this); + listener->onTouchBegan = AX_CALLBACK_2(InputDelegate::onTouchBegan, this); + listener->onTouchMoved = AX_CALLBACK_2(InputDelegate::onTouchMoved, this); + listener->onTouchEnded = AX_CALLBACK_2(InputDelegate::onTouchEnded, this); + listener->onTouchCancelled = AX_CALLBACK_2(InputDelegate::onTouchCancelled, this); dispatcher->addEventListenerWithFixedPriority(listener, _touchPriority); _touchListener = listener; @@ -206,7 +206,7 @@ void InputDelegate::setAccelerometerEnabled(bool enabled) if (enabled) { - auto listener = EventListenerAcceleration::create(CC_CALLBACK_2(InputDelegate::onAcceleration, this)); + auto listener = EventListenerAcceleration::create(AX_CALLBACK_2(InputDelegate::onAcceleration, this)); dispatcher->addEventListenerWithFixedPriority(listener, -1); _accelerometerListener = listener; } @@ -230,8 +230,8 @@ void InputDelegate::setKeypadEnabled(bool enabled) if (enabled) { auto listener = EventListenerKeyboard::create(); - listener->onKeyPressed = CC_CALLBACK_2(InputDelegate::onKeyPressed, this); - listener->onKeyReleased = CC_CALLBACK_2(InputDelegate::onKeyReleased, this); + listener->onKeyPressed = AX_CALLBACK_2(InputDelegate::onKeyPressed, this); + listener->onKeyReleased = AX_CALLBACK_2(InputDelegate::onKeyReleased, this); dispatcher->addEventListenerWithFixedPriority(listener, -1); _keyboardListener = listener; diff --git a/extensions/cocostudio/CCInputDelegate.h b/extensions/cocostudio/CCInputDelegate.h index 47791301b3..f513e3c387 100644 --- a/extensions/cocostudio/CCInputDelegate.h +++ b/extensions/cocostudio/CCInputDelegate.h @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EXTENTIONS_CCINPUTDELEGATE_H__ -#define __CC_EXTENTIONS_CCINPUTDELEGATE_H__ +#ifndef __AX_EXTENTIONS_CCINPUTDELEGATE_H__ +#define __AX_EXTENTIONS_CCINPUTDELEGATE_H__ #include "platform/CCPlatformMacros.h" #include "base/CCTouch.h" @@ -68,40 +68,40 @@ public: /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void didAccelerate(axis::Acceleration* accelerationValue) final; + AX_DEPRECATED_ATTRIBUTE virtual void didAccelerate(axis::Acceleration* accelerationValue) final; // Deprecated touch callbacks. /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(axis::Touch* touch, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(axis::Touch* touch, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(axis::Touch* touch, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(axis::Touch* touch, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(axis::Touch* touch, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(axis::Touch* touch, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(axis::Touch* touch, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(axis::Touch* touch, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(axis::__Set* touches, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(axis::__Set* touches, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(axis::__Set* touches, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(axis::__Set* touches, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(axis::__Set* touches, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(axis::__Set* touches, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(axis::__Set* touches, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(axis::__Set* touches, axis::Event* event) final; /** * @js NA */ @@ -162,4 +162,4 @@ private: } // namespace cocostudio -#endif // __CC_EXTENTIONS_CCINPUTDELEGATE_H__ +#endif // __AX_EXTENTIONS_CCINPUTDELEGATE_H__ diff --git a/extensions/cocostudio/CCSGUIReader.cpp b/extensions/cocostudio/CCSGUIReader.cpp index 08430ae749..1a57b02667 100644 --- a/extensions/cocostudio/CCSGUIReader.cpp +++ b/extensions/cocostudio/CCSGUIReader.cpp @@ -102,7 +102,7 @@ GUIReader* GUIReader::getInstance() void GUIReader::destroyInstance() { - CC_SAFE_DELETE(sharedReader); + AX_SAFE_DELETE(sharedReader); } int GUIReader::getVersionInteger(const char* str) @@ -134,7 +134,7 @@ int GUIReader::getVersionInteger(const char* str) int is = atoi(s.c_str()); int iVersion = it * 1000 + ih * 100 + ite * 10 + is; - // CCLOG("iversion %d",iVersion); + // AXLOG("iversion %d",iVersion); return iVersion; /************************/ } @@ -214,7 +214,7 @@ Widget* GUIReader::widgetFromJsonFile(const char* fileName) jsonDict.Parse<0>(contentStr.c_str()); if (jsonDict.HasParseError()) { - CCLOG("GetParseError %d\n", jsonDict.GetParseError()); + AXLOG("GetParseError %d\n", jsonDict.GetParseError()); } Widget* widget = nullptr; const char* fileVersion = DICTOOL->getStringValue_json(jsonDict, "version"); @@ -239,7 +239,7 @@ Widget* GUIReader::widgetFromJsonFile(const char* fileName) widget = pReader->createWidget(jsonDict, this->m_strFilePath.c_str(), fileName); } - CC_SAFE_DELETE(pReader); + AX_SAFE_DELETE(pReader); return widget; } @@ -402,7 +402,7 @@ Widget* GUIReader::widgetFromBinaryFile(const char* fileName) int versionInteger = this->getVersionInteger(fileVersion); if (versionInteger < 250) { - CCASSERT( + AXASSERT( 0, "You current studio doesn't support binary format, please upgrade to the latest version!"); pReader = new WidgetPropertiesReader0250(); @@ -420,7 +420,7 @@ Widget* GUIReader::widgetFromBinaryFile(const char* fileName) widget = pReader->createWidgetFromBinary(&tCocoLoader, tpRootCocoNode, fileName); } - CC_SAFE_DELETE(pReader); + AX_SAFE_DELETE(pReader); } } } @@ -510,7 +510,7 @@ Widget* WidgetPropertiesReader0250::createWidget(const rapidjson::Value& data, float fileDesignHeight = DICTOOL->getFloatValue_json(data, "designHeight"); if (fileDesignWidth <= 0 || fileDesignHeight <= 0) { - CCLOGERROR("Read design size error!\n"); + AXLOGERROR("Read design size error!\n"); Size winSize = Director::getInstance()->getWinSize(); GUIReader::getInstance()->storeFileDesignSize(fileName, winSize); } @@ -534,7 +534,7 @@ Widget* WidgetPropertiesReader0250::createWidget(const rapidjson::Value& data, /* *********temp********* */ // ActionManager::getInstance()->releaseActions(); /* ********************** */ - // CCLOG("file name == [%s]",fileName); + // AXLOG("file name == [%s]",fileName); Ref* rootWidget = (Ref*)widget; ActionManagerEx::getInstance()->initWithDictionary(fileName, actions, rootWidget); return widget; @@ -965,8 +965,8 @@ void WidgetPropertiesReader0250::setPropsForLabelAtlasFromJsonDictionary(Widget* DICTOOL->getIntValue_json(options, "itemHeight"), DICTOOL->getStringValue_json(options, "startCharMap")); labelAtlas->setProperty(DICTOOL->getStringValue_json(options, "stringValue"), cmf_tp, - DICTOOL->getIntValue_json(options, "itemWidth") / CC_CONTENT_SCALE_FACTOR(), - DICTOOL->getIntValue_json(options, "itemHeight") / CC_CONTENT_SCALE_FACTOR(), + DICTOOL->getIntValue_json(options, "itemWidth") / AX_CONTENT_SCALE_FACTOR(), + DICTOOL->getIntValue_json(options, "itemHeight") / AX_CONTENT_SCALE_FACTOR(), DICTOOL->getStringValue_json(options, "startCharMap")); } setColorPropsForWidgetFromJsonDictionary(widget, options); @@ -1287,7 +1287,7 @@ Widget* WidgetPropertiesReader0300::createWidget(const rapidjson::Value& data, float fileDesignHeight = DICTOOL->getFloatValue_json(data, "designHeight"); if (fileDesignWidth <= 0 || fileDesignHeight <= 0) { - CCLOGERROR("Read design size error!\n"); + AXLOGERROR("Read design size error!\n"); Size winSize = Director::getInstance()->getWinSize(); GUIReader::getInstance()->storeFileDesignSize(fileName, winSize); } @@ -1311,7 +1311,7 @@ Widget* WidgetPropertiesReader0300::createWidget(const rapidjson::Value& data, /* *********temp********* */ // ActionManager::getInstance()->releaseActions(); /* ********************** */ - // CCLOG("file name == [%s]",fileName); + // AXLOG("file name == [%s]",fileName); Ref* rootWidget = (Ref*)widget; ActionManagerEx::getInstance()->initWithDictionary(fileName, actions, rootWidget); return widget; @@ -1356,7 +1356,7 @@ axis::ui::Widget* WidgetPropertiesReader0300::createWidgetFromBinary(CocoLoader* if (fileDesignWidth <= 0 || fileDesignHeight <= 0) { - CCLOGERROR("Read design size error!\n"); + AXLOGERROR("Read design size error!\n"); Size winSize = Director::getInstance()->getWinSize(); GUIReader::getInstance()->storeFileDesignSize(fileName, winSize); } @@ -1421,7 +1421,7 @@ Widget* WidgetPropertiesReader0300::widgetFromBinary(CocoLoader* cocoLoader, stE } else { - CCLOG("Warning!!! classname not found!"); + AXLOG("Warning!!! classname not found!"); } } else if (key == "children") @@ -1470,13 +1470,13 @@ Widget* WidgetPropertiesReader0300::widgetFromBinary(CocoLoader* cocoLoader, stE customJsonDict.Parse<0>(customProperty); if (customJsonDict.HasParseError()) { - CCLOG("GetParseError %d\n", customJsonDict.GetParseError()); + AXLOG("GetParseError %d\n", customJsonDict.GetParseError()); } setPropsForAllCustomWidgetFromJsonDictionary(classname, widget, customJsonDict); } else { - CCLOG("Widget or WidgetReader doesn't exists!!! Please check your csb file."); + AXLOG("Widget or WidgetReader doesn't exists!!! Please check your csb file."); } } @@ -1559,7 +1559,7 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va const char* classname = DICTOOL->getStringValue_json(data, "classname"); const rapidjson::Value& uiOptions = DICTOOL->getSubDictionary_json(data, "options"); Widget* widget = this->createGUI(classname); - // CCLOG("classname = %s", classname); + // AXLOG("classname = %s", classname); std::string readerName = this->getWidgetReaderClassName(classname); WidgetReaderProtocol* reader = this->createWidgetReaderProtocol(readerName); @@ -1585,13 +1585,13 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va customJsonDict.Parse<0>(customProperty); if (customJsonDict.HasParseError()) { - CCLOG("GetParseError %d\n", customJsonDict.GetParseError()); + AXLOG("GetParseError %d\n", customJsonDict.GetParseError()); } setPropsForAllCustomWidgetFromJsonDictionary(classname, widget, customJsonDict); } else { - CCLOG("Widget or WidgetReader doesn't exists!!! Please check your json file."); + AXLOG("Widget or WidgetReader doesn't exists!!! Please check your json file."); } } diff --git a/extensions/cocostudio/CCSGUIReader.h b/extensions/cocostudio/CCSGUIReader.h index aa2d9a80e8..5ab79b61f7 100644 --- a/extensions/cocostudio/CCSGUIReader.h +++ b/extensions/cocostudio/CCSGUIReader.h @@ -56,8 +56,8 @@ typedef void (axis::Ref::*SEL_ParseEvent)(std::string_view, axis::Ref*, const ra class CCS_DLL GUIReader : public axis::Ref { public: - CC_DEPRECATED_ATTRIBUTE static GUIReader* shareReader() { return GUIReader::getInstance(); }; - CC_DEPRECATED_ATTRIBUTE static void purgeGUIReader() { GUIReader::destroyInstance(); }; + AX_DEPRECATED_ATTRIBUTE static GUIReader* shareReader() { return GUIReader::getInstance(); }; + AX_DEPRECATED_ATTRIBUTE static void purgeGUIReader() { GUIReader::destroyInstance(); }; static GUIReader* getInstance(); static void destroyInstance(); diff --git a/extensions/cocostudio/CCSSceneReader.cpp b/extensions/cocostudio/CCSSceneReader.cpp index 2b9dbf559b..ee98cc0866 100644 --- a/extensions/cocostudio/CCSSceneReader.cpp +++ b/extensions/cocostudio/CCSSceneReader.cpp @@ -63,7 +63,7 @@ axis::Node* SceneReader::createNodeWithSceneFile( rapidjson::Document jsonDict; do { - CC_BREAK_IF(!readJson(fileName, jsonDict)); + AX_BREAK_IF(!readJson(fileName, jsonDict)); _node = createObject(jsonDict, nullptr, attachComponent); TriggerMng::getInstance()->parse(jsonDict); } while (0); @@ -77,7 +77,7 @@ axis::Node* SceneReader::createNodeWithSceneFile( std::string binaryFilePath = FileUtils::getInstance()->fullPathForFilename(fileName); auto fileData = FileUtils::getInstance()->getDataFromFile(binaryFilePath); auto fileDataBytes = fileData.getBytes(); - CC_BREAK_IF(fileData.isNull()); + AX_BREAK_IF(fileData.isNull()); CocoLoader tCocoLoader; if (tCocoLoader.ReadCocoBinBuff((char*)fileDataBytes)) { @@ -86,7 +86,7 @@ axis::Node* SceneReader::createNodeWithSceneFile( if (rapidjson::kObjectType == tType) { stExpCocoNode* tpChildArray = tpRootCocoNode->GetChildArray(&tCocoLoader); - CC_BREAK_IF(tpRootCocoNode->GetChildNum() == 0); + AX_BREAK_IF(tpRootCocoNode->GetChildNum() == 0); _node = Node::create(); int nCount = 0; std::vector _vecComs; @@ -131,7 +131,7 @@ axis::Node* SceneReader::createNodeWithSceneFile( } else { - CC_SAFE_RELEASE_NULL(pCom); + AX_SAFE_RELEASE_NULL(pCom); } } if (_fnSelector != nullptr) @@ -173,7 +173,7 @@ bool SceneReader::readJson(std::string_view fileName, rapidjson::Document& doc) std::string jsonpath = FileUtils::getInstance()->fullPathForFilename(fileName); std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonpath); doc.Parse<0>(contentStr.c_str()); - CC_BREAK_IF(doc.HasParseError()); + AX_BREAK_IF(doc.HasParseError()); ret = true; } while (0); return ret; @@ -242,7 +242,7 @@ std::string SceneReader::getComponentClassName(std::string_view name) } else { - CCASSERT(false, "Unregistered Component!"); + AXASSERT(false, "Unregistered Component!"); } return comName; @@ -292,7 +292,7 @@ Node* SceneReader::createObject(const rapidjson::Value& dict, } } } - CC_SAFE_DELETE(data); + AX_SAFE_DELETE(data); if (_fnSelector != nullptr) { _fnSelector(com, data); @@ -406,7 +406,7 @@ axis::Node* SceneReader::createObject(CocoLoader* cocoLoader, } else { - CC_SAFE_RELEASE_NULL(pCom); + AX_SAFE_RELEASE_NULL(pCom); } } if (_fnSelector != nullptr) @@ -414,7 +414,7 @@ axis::Node* SceneReader::createObject(CocoLoader* cocoLoader, _fnSelector(pCom, (void*)(data)); } } - CC_SAFE_DELETE(data); + AX_SAFE_DELETE(data); if (parent != nullptr) { @@ -431,7 +431,7 @@ axis::Node* SceneReader::createObject(CocoLoader* cocoLoader, gb = pRender->getNode(); gb->retain(); pRender->setNode(nullptr); - CC_SAFE_RELEASE_NULL(pRender); + AX_SAFE_RELEASE_NULL(pRender); } parent->addChild(gb); } @@ -562,7 +562,7 @@ void SceneReader::destroyInstance() DictionaryHelper::destroyInstance(); TriggerMng::destroyInstance(); // CocosDenshion::SimpleAudioEngine::end(); - CC_SAFE_DELETE(s_sharedReader); + AX_SAFE_DELETE(s_sharedReader); } } // namespace cocostudio diff --git a/extensions/cocostudio/CCSkin.cpp b/extensions/cocostudio/CCSkin.cpp index 0684ee742b..786e99b79a 100644 --- a/extensions/cocostudio/CCSkin.cpp +++ b/extensions/cocostudio/CCSkin.cpp @@ -37,7 +37,7 @@ USING_NS_AX; namespace cocostudio { -#if CC_SPRITEBATCHNODE_RENDER_SUBPIXEL +#if AX_SPRITEBATCHNODE_RENDER_SUBPIXEL # define RENDER_IN_SUBPIXEL #else # define RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__)) @@ -51,7 +51,7 @@ Skin* Skin::create() skin->autorelease(); return skin; } - CC_SAFE_DELETE(skin); + AX_SAFE_DELETE(skin); return nullptr; } @@ -63,7 +63,7 @@ Skin* Skin::createWithSpriteFrameName(std::string_view pszSpriteFrameName) skin->autorelease(); return skin; } - CC_SAFE_DELETE(skin); + AX_SAFE_DELETE(skin); return nullptr; } @@ -75,7 +75,7 @@ Skin* Skin::create(std::string_view pszFileName) skin->autorelease(); return skin; } - CC_SAFE_DELETE(skin); + AX_SAFE_DELETE(skin); return nullptr; } @@ -94,7 +94,7 @@ bool Skin::initWithSpriteFrameName(std::string_view spriteFrameName) } else { - CCLOG("Can't find CCSpriteFrame with %s. Please check your .plist file", spriteFrameName.data()); + AXLOG("Can't find CCSpriteFrame with %s. Please check your .plist file", spriteFrameName.data()); ret = false; } @@ -118,8 +118,8 @@ void Skin::setSkinData(const BaseData& var) setScaleX(_skinData.scaleX); setScaleY(_skinData.scaleY); - setRotationSkewX(CC_RADIANS_TO_DEGREES(_skinData.skewX)); - setRotationSkewY(CC_RADIANS_TO_DEGREES(-_skinData.skewY)); + setRotationSkewX(AX_RADIANS_TO_DEGREES(_skinData.skewX)); + setRotationSkewY(AX_RADIANS_TO_DEGREES(-_skinData.skewY)); setPosition(_skinData.x, _skinData.y); _skinTransform = getNodeToParentTransform(); diff --git a/extensions/cocostudio/CCSpriteFrameCacheHelper.cpp b/extensions/cocostudio/CCSpriteFrameCacheHelper.cpp index b6d58592a5..3706bf0662 100644 --- a/extensions/cocostudio/CCSpriteFrameCacheHelper.cpp +++ b/extensions/cocostudio/CCSpriteFrameCacheHelper.cpp @@ -67,7 +67,7 @@ void SpriteFrameCacheHelper::retainSpriteFrames(std::string_view plistPath) auto& spriteFrameName = iter->first; SpriteFrame* spriteFrame = spriteFramesCache->getSpriteFrameByName(spriteFrameName); vec.push_back(spriteFrame); - CC_SAFE_RETAIN(spriteFrame); + AX_SAFE_RETAIN(spriteFrame); } _usingSpriteFrames[plistPath] = vec; } @@ -82,7 +82,7 @@ void SpriteFrameCacheHelper::releaseSpriteFrames(std::string_view plistPath) auto itFrame = vec.begin(); while (itFrame != vec.end()) { - CC_SAFE_RELEASE(*itFrame); + AX_SAFE_RELEASE(*itFrame); ++itFrame; } vec.clear(); diff --git a/extensions/cocostudio/CCSpriteFrameCacheHelper.h b/extensions/cocostudio/CCSpriteFrameCacheHelper.h index 889bb43508..d744e5e46b 100644 --- a/extensions/cocostudio/CCSpriteFrameCacheHelper.h +++ b/extensions/cocostudio/CCSpriteFrameCacheHelper.h @@ -46,7 +46,7 @@ class CCS_DLL SpriteFrameCacheHelper { public: /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static SpriteFrameCacheHelper* sharedSpriteFrameCacheHelper() + AX_DEPRECATED_ATTRIBUTE static SpriteFrameCacheHelper* sharedSpriteFrameCacheHelper() { return SpriteFrameCacheHelper::getInstance(); } diff --git a/extensions/cocostudio/CCTween.cpp b/extensions/cocostudio/CCTween.cpp index bb363df941..1f60fd8180 100644 --- a/extensions/cocostudio/CCTween.cpp +++ b/extensions/cocostudio/CCTween.cpp @@ -41,7 +41,7 @@ Tween* Tween::create(Bone* bone) pTween->autorelease(); return pTween; } - CC_SAFE_DELETE(pTween); + AX_SAFE_DELETE(pTween); return nullptr; } @@ -62,8 +62,8 @@ Tween::Tween() Tween::~Tween(void) { - CC_SAFE_DELETE(_from); - CC_SAFE_DELETE(_between); + AX_SAFE_DELETE(_from); + AX_SAFE_DELETE(_between); } bool Tween::init(Bone* bone) @@ -260,7 +260,7 @@ void Tween::updateHandler() if (_currentPercent < 1 && _loopType <= ANIMATION_TO_LOOP_BACK) { - _currentPercent = sin(_currentPercent * CC_HALF_PI); + _currentPercent = sin(_currentPercent * AX_HALF_PI); } float percent = _currentPercent; diff --git a/extensions/cocostudio/CocosStudioExport.h b/extensions/cocostudio/CocosStudioExport.h index c5612b730e..7f88c5b847 100644 --- a/extensions/cocostudio/CocosStudioExport.h +++ b/extensions/cocostudio/CocosStudioExport.h @@ -7,7 +7,7 @@ # include # endif -# if defined(CC_STATIC) +# if defined(AX_STATIC) # define CCS_DLL # else # if defined(_USRCCS_DLL) diff --git a/extensions/cocostudio/DictionaryHelper.cpp b/extensions/cocostudio/DictionaryHelper.cpp index 09fccc8624..38a3e4d74c 100644 --- a/extensions/cocostudio/DictionaryHelper.cpp +++ b/extensions/cocostudio/DictionaryHelper.cpp @@ -45,7 +45,7 @@ DictionaryHelper* DictionaryHelper::getInstance() void DictionaryHelper::destroyInstance() { - CC_SAFE_DELETE(sharedHelper); + AX_SAFE_DELETE(sharedHelper); } const rapidjson::Value& DictionaryHelper::getSubDictionary_json(const rapidjson::Value& root, const char* key) @@ -68,9 +68,9 @@ int DictionaryHelper::getIntValue_json(const rapidjson::Value& root, const char* int nRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.HasMember(key)); - CC_BREAK_IF(root[key].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.HasMember(key)); + AX_BREAK_IF(root[key].IsNull()); nRet = root[key].GetInt(); } while (0); @@ -82,9 +82,9 @@ float DictionaryHelper::getFloatValue_json(const rapidjson::Value& root, const c float fRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.HasMember(key)); - CC_BREAK_IF(root[key].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.HasMember(key)); + AX_BREAK_IF(root[key].IsNull()); fRet = (float)root[key].GetDouble(); } while (0); @@ -96,9 +96,9 @@ bool DictionaryHelper::getBooleanValue_json(const rapidjson::Value& root, const bool bRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.HasMember(key)); - CC_BREAK_IF(root[key].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.HasMember(key)); + AX_BREAK_IF(root[key].IsNull()); bRet = root[key].GetBool(); } while (0); @@ -110,9 +110,9 @@ const char* DictionaryHelper::getStringValue_json(const rapidjson::Value& root, const char* sRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.HasMember(key)); - CC_BREAK_IF(root[key].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.HasMember(key)); + AX_BREAK_IF(root[key].IsNull()); sRet = root[key].GetString(); } while (0); @@ -124,9 +124,9 @@ int DictionaryHelper::getArrayCount_json(const rapidjson::Value& root, const cha int nRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.HasMember(key)); - CC_BREAK_IF(root[key].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.HasMember(key)); + AX_BREAK_IF(root[key].IsNull()); nRet = (int)(root[key].Size()); } while (0); @@ -138,10 +138,10 @@ int DictionaryHelper::getIntValueFromArray_json(const rapidjson::Value& root, co int nRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.HasMember(arrayKey)); - CC_BREAK_IF(root[arrayKey].IsNull()); - CC_BREAK_IF(root[arrayKey][idx].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.HasMember(arrayKey)); + AX_BREAK_IF(root[arrayKey].IsNull()); + AX_BREAK_IF(root[arrayKey][idx].IsNull()); nRet = root[arrayKey][idx].GetInt(); } while (0); @@ -156,9 +156,9 @@ float DictionaryHelper::getFloatValueFromArray_json(const rapidjson::Value& root float fRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(root[arrayKey].IsNull()); - CC_BREAK_IF(root[arrayKey][idx].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(root[arrayKey].IsNull()); + AX_BREAK_IF(root[arrayKey][idx].IsNull()); fRet = (float)root[arrayKey][idx].GetDouble(); } while (0); @@ -170,9 +170,9 @@ bool DictionaryHelper::getBoolValueFromArray_json(const rapidjson::Value& root, bool bRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(root[arrayKey].IsNull()); - CC_BREAK_IF(root[arrayKey][idx].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(root[arrayKey].IsNull()); + AX_BREAK_IF(root[arrayKey][idx].IsNull()); bRet = root[arrayKey][idx].GetBool(); } while (0); @@ -187,9 +187,9 @@ const char* DictionaryHelper::getStringValueFromArray_json(const rapidjson::Valu const char* sRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(root[arrayKey].IsNull()); - CC_BREAK_IF(root[arrayKey][idx].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(root[arrayKey].IsNull()); + AX_BREAK_IF(root[arrayKey][idx].IsNull()); sRet = root[arrayKey][idx].GetString(); } while (0); @@ -208,7 +208,7 @@ bool DictionaryHelper::checkObjectExist_json(const rapidjson::Value& root) bool bRet = false; do { - CC_BREAK_IF(root.IsNull()); + AX_BREAK_IF(root.IsNull()); bRet = true; } while (0); @@ -220,7 +220,7 @@ bool DictionaryHelper::checkObjectExist_json(const rapidjson::Value& root, const bool bRet = false; do { - CC_BREAK_IF(root.IsNull()); + AX_BREAK_IF(root.IsNull()); bRet = root.HasMember(key); } while (0); @@ -232,9 +232,9 @@ bool DictionaryHelper::checkObjectExist_json(const rapidjson::Value& root, int i bool bRet = false; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.IsArray()); - CC_BREAK_IF(index < 0 || root.Size() <= (unsigned int)index); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.IsArray()); + AX_BREAK_IF(index < 0 || root.Size() <= (unsigned int)index); bRet = true; } while (0); diff --git a/extensions/cocostudio/FlatBuffersSerialize.cpp b/extensions/cocostudio/FlatBuffersSerialize.cpp index 0e16ceacda..05eca9e327 100644 --- a/extensions/cocostudio/FlatBuffersSerialize.cpp +++ b/extensions/cocostudio/FlatBuffersSerialize.cpp @@ -124,12 +124,12 @@ FlatBuffersSerialize* FlatBuffersSerialize::getInstance() void FlatBuffersSerialize::purge() { - CC_SAFE_DELETE(_instanceFlatBuffersSerialize); + AX_SAFE_DELETE(_instanceFlatBuffersSerialize); } void FlatBuffersSerialize::destroyInstance() { - CC_SAFE_DELETE(_instanceFlatBuffersSerialize); + AX_SAFE_DELETE(_instanceFlatBuffersSerialize); } void FlatBuffersSerialize::deleteFlatBufferBuilder() @@ -137,7 +137,7 @@ void FlatBuffersSerialize::deleteFlatBufferBuilder() if (_builder != nullptr) { _builder->Clear(); - CC_SAFE_DELETE(_builder); + AX_SAFE_DELETE(_builder); } } @@ -176,7 +176,7 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithOpaque(void* opaque, s pugi::xml_document& document = *reinterpret_cast(opaque); pugi::xml_node rootElement = document.document_element(); // Root - // CCLOG("rootElement name = %s", rootelement.name()); + // AXLOG("rootElement name = %s", rootelement.name()); pugi::xml_node element = rootElement.first_child(); @@ -185,7 +185,7 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithOpaque(void* opaque, s while (element) { - // CCLOG("entity name = %s", element.name()); + // AXLOG("entity name = %s", element.name()); if ("PropertyGroup"sv == element.name()) { auto attribute = element.first_attribute(); @@ -214,7 +214,7 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithOpaque(void* opaque, s // { // std::string name = attribute.name(); // std::string_view value = attribute.value(); - // CCLOG("attribute name = %s, value = %s", name, value); + // AXLOG("attribute name = %s, value = %s", name, value); // if (name == "") // { // serializeEnabled = true; @@ -328,7 +328,7 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithOpaque(void* opaque, s Offset FlatBuffersSerialize::createNodeTree(pugi::xml_node objectData, std::string_view classType) { auto classname = classType.substr(0, classType.find("ObjectData")); - // CCLOG("classname = %s", classname.c_str()); + // AXLOG("classname = %s", classname.c_str()); Offset options; std::vector> children; @@ -366,7 +366,7 @@ Offset FlatBuffersSerialize::createNodeTree(pugi::xml_node objectData, while (child) { - // CCLOG("child name = %s", child.name()); + // AXLOG("child name = %s", child.name()); if ("Children" == child.name()) { @@ -380,7 +380,7 @@ Offset FlatBuffersSerialize::createNodeTree(pugi::xml_node objectData, if (containChildrenElement) { child = child.first_child(); - // CCLOG("element name = %s", child.name()); + // AXLOG("element name = %s", child.name()); while (child) { @@ -555,7 +555,7 @@ Offset FlatBuffersSerialize::createNodeAction(pugi::xml_node objectD float speed = 0.0f; std::string currentAnimationName; - // CCLOG("animation name = %s", objectData->Name()); + // AXLOG("animation name = %s", objectData->Name()); // ActionTimeline auto attribute = objectData.first_attribute(); @@ -1238,7 +1238,7 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato // xml read if (!FileUtils::getInstance()->isFileExist(inFullpath)) { - // CCLOG(".csd file does not exist."); + // AXLOG(".csd file does not exist."); } std::string content = FileUtils::getInstance()->getStringFromFile(inFullpath); @@ -1249,7 +1249,7 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato document.load_buffer_inplace(&content.front(), content.length()); pugi::xml_node rootElement = document.document_element(); // Root - // CCLOG("rootElement name = %s", rootelement.name()); + // AXLOG("rootElement name = %s", rootelement.name()); pugi::xml_node element = rootElement.first_child(); @@ -1258,7 +1258,7 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato while (element) { - // CCLOG("entity name = %s", element.name()); + // AXLOG("entity name = %s", element.name()); if ("PropertyGroup"sv == element.name()) { auto attribute = element.first_attribute(); @@ -1361,7 +1361,7 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato Offset FlatBuffersSerialize::createNodeTreeForSimulator(pugi::xml_node objectData, std::string_view classType) { auto classname = classType.substr(0, classType.find("ObjectData")); - // CCLOG("classname = %s", classname.c_str()); + // AXLOG("classname = %s", classname.c_str()); Offset options; std::vector> children; @@ -1399,7 +1399,7 @@ Offset FlatBuffersSerialize::createNodeTreeForSimulator(pugi::xml_node while (child) { - // CCLOG("child name = %s", child.name()); + // AXLOG("child name = %s", child.name()); if ("Children"sv == child.name()) { @@ -1413,7 +1413,7 @@ Offset FlatBuffersSerialize::createNodeTreeForSimulator(pugi::xml_node if (containChildrenElement) { child = child.first_child(); - // CCLOG("element name = %s", child.name()); + // AXLOG("element name = %s", child.name()); while (child) { diff --git a/extensions/cocostudio/FlatBuffersSerialize.h b/extensions/cocostudio/FlatBuffersSerialize.h index fca7ced434..0e3bc9e6a4 100644 --- a/extensions/cocostudio/FlatBuffersSerialize.h +++ b/extensions/cocostudio/FlatBuffersSerialize.h @@ -97,7 +97,7 @@ class CCS_DLL FlatBuffersSerialize public: static FlatBuffersSerialize* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); FlatBuffersSerialize(); diff --git a/extensions/cocostudio/LocalizationManager.cpp b/extensions/cocostudio/LocalizationManager.cpp index 7352bf60ce..c0ab1f66b8 100644 --- a/extensions/cocostudio/LocalizationManager.cpp +++ b/extensions/cocostudio/LocalizationManager.cpp @@ -31,7 +31,7 @@ JsonLocalizationManager::JsonLocalizationManager() : languageData(nullptr) {} JsonLocalizationManager::~JsonLocalizationManager() { - CC_SAFE_DELETE(languageData); + AX_SAFE_DELETE(languageData); } bool JsonLocalizationManager::initLanguageData(std::string file) @@ -47,7 +47,7 @@ bool JsonLocalizationManager::initLanguageData(std::string file) if (languageData->IsObject()) result = true; else - CC_SAFE_DELETE(languageData); + AX_SAFE_DELETE(languageData); } return result; diff --git a/extensions/cocostudio/SpineSkeletonDataCache.cpp b/extensions/cocostudio/SpineSkeletonDataCache.cpp index 029c1f0718..7285a8e49f 100644 --- a/extensions/cocostudio/SpineSkeletonDataCache.cpp +++ b/extensions/cocostudio/SpineSkeletonDataCache.cpp @@ -1,6 +1,6 @@ #include "SpineSkeletonDataCache.h" -#if !defined(CC_USE_SPINE_CPP) || CC_USE_SPINE_CPP +#if !defined(AX_USE_SPINE_CPP) || AX_USE_SPINE_CPP SpineSkeletonDataCache* SpineSkeletonDataCache::getInstance() { static SpineSkeletonDataCache internalShared; diff --git a/extensions/cocostudio/SpineSkeletonDataCache.h b/extensions/cocostudio/SpineSkeletonDataCache.h index 6557a4fca4..a5ea3e08ae 100644 --- a/extensions/cocostudio/SpineSkeletonDataCache.h +++ b/extensions/cocostudio/SpineSkeletonDataCache.h @@ -6,7 +6,7 @@ #include "CocosStudioExport.h" #include -#if !defined(CC_USE_SPINE_CPP) || CC_USE_SPINE_CPP +#if !defined(AX_USE_SPINE_CPP) || AX_USE_SPINE_CPP class CCS_DLL SpineSkeletonDataCache { public: diff --git a/extensions/cocostudio/TriggerMng.cpp b/extensions/cocostudio/TriggerMng.cpp index 99a4cf0d84..1204950e8e 100644 --- a/extensions/cocostudio/TriggerMng.cpp +++ b/extensions/cocostudio/TriggerMng.cpp @@ -49,9 +49,9 @@ TriggerMng::~TriggerMng(void) _triggerObjs.clear(); removeAllArmatureMovementCallBack(); - CC_SAFE_DELETE(_movementDispatches); + AX_SAFE_DELETE(_movementDispatches); - CC_SAFE_RELEASE(_eventDispatcher); + AX_SAFE_RELEASE(_eventDispatcher); } const char* TriggerMng::triggerMngVersion() @@ -70,15 +70,15 @@ TriggerMng* TriggerMng::getInstance() void TriggerMng::destroyInstance() { - CC_SAFE_DELETE(_sharedTriggerMng); + AX_SAFE_DELETE(_sharedTriggerMng); } void TriggerMng::parse(const rapidjson::Value& root) { - CCLOG("%s", triggerMngVersion()); + AXLOG("%s", triggerMngVersion()); int count = DICTOOL->getArrayCount_json(root, "Triggers"); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEngineProtocol* engine = ScriptEngineManager::getInstance()->getScriptEngine(); bool useBindings = engine != nullptr; @@ -95,7 +95,7 @@ void TriggerMng::parse(const rapidjson::Value& root) } } else -#endif // #if CC_ENABLE_SCRIPT_BINDING +#endif // #if AX_ENABLE_SCRIPT_BINDING { for (int i = 0; i < count; ++i) { @@ -110,12 +110,12 @@ void TriggerMng::parse(const rapidjson::Value& root) void TriggerMng::parse(cocostudio::CocoLoader* pCocoLoader, cocostudio::stExpCocoNode* pCocoNode) { - CCLOG("%s", triggerMngVersion()); + AXLOG("%s", triggerMngVersion()); int count = pCocoNode[13].GetChildNum(); stExpCocoNode* pTriggersArray = pCocoNode[13].GetChildArray(pCocoLoader); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEngineProtocol* engine = ScriptEngineManager::getInstance()->getScriptEngine(); bool useBindings = engine != nullptr; @@ -133,7 +133,7 @@ void TriggerMng::parse(cocostudio::CocoLoader* pCocoLoader, cocostudio::stExpCoc } } else -#endif // #if CC_ENABLE_SCRIPT_BINDING +#endif // #if AX_ENABLE_SCRIPT_BINDING { for (int i = 0; i < count; ++i) { @@ -161,7 +161,7 @@ void TriggerMng::removeAll(void) for (; etIter != _triggerObjs.end(); ++etIter) { etIter->second->removeAll(); - CC_SAFE_DELETE(etIter->second); + AX_SAFE_DELETE(etIter->second); } _triggerObjs.clear(); } @@ -415,7 +415,7 @@ void TriggerMng::addArmatureMovementCallBack(Armature* pAr, Ref* pTarget, SEL_Mo if (iter == _movementDispatches->end()) { amd = new ArmatureMovementDispatcher(); - pAr->getAnimation()->setMovementEventCallFunc(CC_CALLBACK_0(ArmatureMovementDispatcher::animationEvent, amd, + pAr->getAnimation()->setMovementEventCallFunc(AX_CALLBACK_0(ArmatureMovementDispatcher::animationEvent, amd, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); amd->addAnimationEventCallBack(pTarget, mecf); @@ -462,7 +462,7 @@ void TriggerMng::removeArmatureAllMovementCallBack(Armature* pAr) } else { - CC_SAFE_DELETE(iter->second); + AX_SAFE_DELETE(iter->second); _movementDispatches->erase(iter); } } @@ -500,7 +500,7 @@ ArmatureMovementDispatcher::ArmatureMovementDispatcher(void) : _mapEventAnimatio ArmatureMovementDispatcher::~ArmatureMovementDispatcher(void) { _mapEventAnimation->clear(); - CC_SAFE_DELETE(_mapEventAnimation); + AX_SAFE_DELETE(_mapEventAnimation); } void ArmatureMovementDispatcher::animationEvent(Armature* armature, diff --git a/extensions/cocostudio/TriggerObj.cpp b/extensions/cocostudio/TriggerObj.cpp index f67c5d9ca8..699f07856b 100644 --- a/extensions/cocostudio/TriggerObj.cpp +++ b/extensions/cocostudio/TriggerObj.cpp @@ -84,7 +84,7 @@ TriggerObj* TriggerObj::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } @@ -157,11 +157,11 @@ void TriggerObj::serialize(const rapidjson::Value& val) dynamic_cast(ObjectFactory::getInstance()->createObject(classname)); if (con == nullptr) { - CCLOG("class %s can not be implemented!", classname); - CCASSERT(con != nullptr, "con can't be nullptr!"); + AXLOG("class %s can not be implemented!", classname); + AXASSERT(con != nullptr, "con can't be nullptr!"); } - CCASSERT(con != nullptr, "con can't be nullptr!"); + AXASSERT(con != nullptr, "con can't be nullptr!"); con->serialize(subDict); con->init(); _cons.pushBack(con); @@ -180,8 +180,8 @@ void TriggerObj::serialize(const rapidjson::Value& val) dynamic_cast(ObjectFactory::getInstance()->createObject(classname)); if (act == nullptr) { - CCLOG("class %s can not be implemented!", classname); - CCASSERT(act != nullptr, "act can't be nullptr!"); + AXLOG("class %s can not be implemented!", classname); + AXASSERT(act != nullptr, "act can't be nullptr!"); } act->serialize(subDict); act->init(); diff --git a/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp b/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp index 88d545de54..e4de3e220f 100644 --- a/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp +++ b/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp @@ -7,7 +7,7 @@ #include "CSParseBinary_generated.h" #include "WidgetReader/ArmatureNodeReader/CSArmatureNode_generated.h" #include "CCArmature.h" -#if defined(CC_BUILD_WITH_DRANGBONES) && CC_BUILD_WITH_DRANGBONES +#if defined(AX_BUILD_WITH_DRANGBONES) && AX_BUILD_WITH_DRANGBONES # include "DragonBones/CCDragonBonesHeaders.h" #endif @@ -34,7 +34,7 @@ ArmatureNodeReader* ArmatureNodeReader::getInstance() void ArmatureNodeReader::destroyInstance() { - CC_SAFE_DELETE(_instanceArmatureNodeReader); + AX_SAFE_DELETE(_instanceArmatureNodeReader); } Offset ArmatureNodeReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, @@ -142,7 +142,7 @@ void ArmatureNodeReader::setPropsWithFlatBuffers(axis::Node* node, const flatbuf if (FileUtils::getInstance()->isFileExist(filepath)) { fileExist = true; -#if defined(CC_BUILD_WITH_DRANGBONES) && CC_BUILD_WITH_DRANGBONES +#if defined(AX_BUILD_WITH_DRANGBONES) && AX_BUILD_WITH_DRANGBONES auto filep = filepath.rfind('.'); if (filep != std::string::npos && strcmp(&filepath[filep], ".json") == 0) { // Currently, adjust by file ext, regard as DragonBones 4.5/5.0 diff --git a/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h b/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h index 4e767494a8..3abe8079bf 100644 --- a/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h +++ b/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h @@ -47,7 +47,7 @@ public: static ArmatureNodeReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers( diff --git a/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp b/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp index 2a0511eeb8..ebe152a284 100644 --- a/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp +++ b/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp @@ -56,12 +56,12 @@ ButtonReader* ButtonReader::getInstance() void ButtonReader::purge() { - CC_SAFE_DELETE(instanceButtonReader); + AX_SAFE_DELETE(instanceButtonReader); } void ButtonReader::destroyInstance() { - CC_SAFE_DELETE(instanceButtonReader); + AX_SAFE_DELETE(instanceButtonReader); } void ButtonReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -83,9 +83,9 @@ void ButtonReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* coco std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_Scale9Enable) { button->setScale9Enabled(valueToBool(value)); } else if (key == P_NormalData) diff --git a/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.h b/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.h index c2a0c837b3..1f27a393a0 100644 --- a/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.h +++ b/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.h @@ -40,7 +40,7 @@ public: static ButtonReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp b/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp index 64848dbe90..4258aad24a 100644 --- a/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp +++ b/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp @@ -42,7 +42,7 @@ CheckBoxReader* CheckBoxReader::getInstance() void CheckBoxReader::destroyInstance() { - CC_SAFE_DELETE(instanceCheckBoxReader); + AX_SAFE_DELETE(instanceCheckBoxReader); } void CheckBoxReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -57,9 +57,9 @@ void CheckBoxReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* co std::string key = stChildArray[i].GetName(cocoLoader); std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_BackGroundBoxData) { diff --git a/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h b/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h index a6a26c3f97..59003e2f42 100644 --- a/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h +++ b/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h @@ -40,7 +40,7 @@ public: static CheckBoxReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp b/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp index 99e15f2447..ecc98affc6 100644 --- a/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp +++ b/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp @@ -53,12 +53,12 @@ ComAudioReader* ComAudioReader::getInstance() void ComAudioReader::purge() { - CC_SAFE_DELETE(_instanceComAudioReader); + AX_SAFE_DELETE(_instanceComAudioReader); } void ComAudioReader::destroyInstance() { - CC_SAFE_DELETE(_instanceComAudioReader); + AX_SAFE_DELETE(_instanceComAudioReader); } Offset
ComAudioReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h b/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h index c480a42c12..336f84a5c9 100644 --- a/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h +++ b/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h @@ -42,7 +42,7 @@ public: static ComAudioReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp b/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp index 00ee259ead..a7a67e9e82 100644 --- a/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp +++ b/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp @@ -60,7 +60,7 @@ GameMapReader* GameMapReader::getInstance() void GameMapReader::destroyInstance() { - CC_SAFE_DELETE(_instanceTMXTiledMapReader); + AX_SAFE_DELETE(_instanceTMXTiledMapReader); } Offset
GameMapReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.h b/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.h index ac6fd6b602..6e04fc06e3 100644 --- a/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.h +++ b/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.h @@ -41,7 +41,7 @@ public: static GameMapReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp b/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp index 64ab0199e4..221938102d 100644 --- a/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp +++ b/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp @@ -65,12 +65,12 @@ CameraBackgroundBrush* GameNode3DReader::getSceneBrushInstance() void GameNode3DReader::purge() { - CC_SAFE_DELETE(_instanceNode3DReader); + AX_SAFE_DELETE(_instanceNode3DReader); } void GameNode3DReader::destroyInstance() { - CC_SAFE_DELETE(_instanceNode3DReader); + AX_SAFE_DELETE(_instanceNode3DReader); } Offset
GameNode3DReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h b/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h index 1d5af11bc9..4d3938522f 100644 --- a/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h +++ b/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h @@ -43,7 +43,7 @@ public: static GameNode3DReader* getInstance(); static axis::CameraBackgroundBrush* getSceneBrushInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp b/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp index 8117f9e1d0..d9ad630589 100644 --- a/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp +++ b/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp @@ -46,7 +46,7 @@ ImageViewReader* ImageViewReader::getInstance() void ImageViewReader::destroyInstance() { - CC_SAFE_DELETE(instanceImageViewReader); + AX_SAFE_DELETE(instanceImageViewReader); } void ImageViewReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -65,9 +65,9 @@ void ImageViewReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* c std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_Scale9Enable) { imageView->setScale9Enabled(valueToBool(value)); } else if (key == P_FileNameData) diff --git a/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h b/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h index 9b3be9fb5e..8bfe44fa0b 100644 --- a/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h +++ b/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h @@ -40,7 +40,7 @@ public: static ImageViewReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp b/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp index 6ec925e3ab..503afd44bc 100644 --- a/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp +++ b/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp @@ -62,7 +62,7 @@ LayoutReader* LayoutReader::getInstance() void LayoutReader::destroyInstance() { - CC_SAFE_DELETE(instanceLayoutReader); + AX_SAFE_DELETE(instanceLayoutReader); } void LayoutReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -88,9 +88,9 @@ void LayoutReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* coco std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_AdaptScreen) { _isAdaptScreen = valueToBool(value); } else if (key == P_ClipAble) { panel->setClippingEnabled(valueToBool(value)); } diff --git a/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.h b/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.h index 1e21e9ce59..ad35162066 100644 --- a/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.h +++ b/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.h @@ -41,7 +41,7 @@ public: static LayoutReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp b/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp index 3bdabc16a0..416140f9ba 100644 --- a/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp +++ b/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp @@ -58,12 +58,12 @@ Light3DReader* Light3DReader::getInstance() void Light3DReader::purge() { - CC_SAFE_DELETE(_instanceLight3DReader); + AX_SAFE_DELETE(_instanceLight3DReader); } void Light3DReader::destroyInstance() { - CC_SAFE_DELETE(_instanceLight3DReader); + AX_SAFE_DELETE(_instanceLight3DReader); } Offset
Light3DReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, @@ -181,7 +181,7 @@ Node* Light3DReader::createNodeWithFlatBuffers(const flatbuffers::Table* light3D break; case axis::LightType::SPOT: light = - SpotLight::create(Vec3::UNIT_Z, Vec3::ZERO, Color3B::WHITE, 0, CC_DEGREES_TO_RADIANS(outerAngle), range); + SpotLight::create(Vec3::UNIT_Z, Vec3::ZERO, Color3B::WHITE, 0, AX_DEGREES_TO_RADIANS(outerAngle), range); break; case axis::LightType::AMBIENT: light = AmbientLight::create(Color3B::WHITE); diff --git a/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.h b/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.h index 353edfcb9b..2952762268 100644 --- a/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.h +++ b/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.h @@ -41,7 +41,7 @@ public: static Light3DReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp b/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp index aca256f011..842fca5e09 100644 --- a/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp +++ b/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp @@ -39,7 +39,7 @@ ListViewReader* ListViewReader::getInstance() void ListViewReader::destroyInstance() { - CC_SAFE_DELETE(instanceListViewReader); + AX_SAFE_DELETE(instanceListViewReader); } void ListViewReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) diff --git a/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.h b/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.h index f0f795aeda..ca96b53cd8 100644 --- a/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.h +++ b/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.h @@ -40,7 +40,7 @@ public: static ListViewReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp b/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp index f9fa8c337c..4467b8f5f3 100644 --- a/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp +++ b/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp @@ -46,7 +46,7 @@ LoadingBarReader* LoadingBarReader::getInstance() void LoadingBarReader::destroyInstance() { - CC_SAFE_DELETE(instanceLoadingBar); + AX_SAFE_DELETE(instanceLoadingBar); } void LoadingBarReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -67,9 +67,9 @@ void LoadingBarReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_Scale9Enable) { loadingBar->setScale9Enabled(valueToBool(value)); } else if (key == P_TextureData) diff --git a/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h b/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h index 05dbe0aa87..5f18b35cab 100644 --- a/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h +++ b/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h @@ -40,7 +40,7 @@ public: static LoadingBarReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.cpp b/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.cpp index 83573dae9d..088ae2717a 100644 --- a/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.cpp +++ b/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.cpp @@ -63,12 +63,12 @@ MeshReader* MeshReader::getInstance() void MeshReader::purge() { - CC_SAFE_DELETE(_instanceMeshReader); + AX_SAFE_DELETE(_instanceMeshReader); } void MeshReader::destroyInstance() { - CC_SAFE_DELETE(_instanceMeshReader); + AX_SAFE_DELETE(_instanceMeshReader); } Vec2 MeshReader::getVec2Attribute(pugi::xml_attribute attribute) const diff --git a/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.h b/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.h index 4d82d3f914..c9cbff63c6 100644 --- a/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.h +++ b/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.h @@ -42,7 +42,7 @@ public: static MeshReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp b/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp index 418371a655..1f7c31e3dd 100644 --- a/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp +++ b/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp @@ -57,12 +57,12 @@ Node3DReader* Node3DReader::getInstance() void Node3DReader::purge() { - CC_SAFE_DELETE(_instanceNode3DReader); + AX_SAFE_DELETE(_instanceNode3DReader); } void Node3DReader::destroyInstance() { - CC_SAFE_DELETE(_instanceNode3DReader); + AX_SAFE_DELETE(_instanceNode3DReader); } Vec3 Node3DReader::getVec3Attribute(pugi::xml_attribute attribute) const diff --git a/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.h b/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.h index 1f6d3a34ae..fc209726f0 100644 --- a/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.h +++ b/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.h @@ -42,7 +42,7 @@ public: static Node3DReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.cpp b/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.cpp index 74a15ee41e..7354d479d3 100644 --- a/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.cpp +++ b/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.cpp @@ -74,7 +74,7 @@ NodeReader* NodeReader::getInstance() void NodeReader::destroyInstance() { - CC_SAFE_DELETE(_instanceNodeReader); + AX_SAFE_DELETE(_instanceNodeReader); } Offset
NodeReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.h b/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.h index 84dde876ac..17ce65cc25 100644 --- a/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.h +++ b/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.h @@ -41,7 +41,7 @@ public: static NodeReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/NodeReaderProtocol.h b/extensions/cocostudio/WidgetReader/NodeReaderProtocol.h index beaa5723e4..15a930f316 100644 --- a/extensions/cocostudio/WidgetReader/NodeReaderProtocol.h +++ b/extensions/cocostudio/WidgetReader/NodeReaderProtocol.h @@ -134,7 +134,7 @@ namespace wext { // engine extends APIs // TODO-2020 -CC_DLL extern APP_LOGERROR_FUNC getAppErrorLogFunc(); +AX_DLL extern APP_LOGERROR_FUNC getAppErrorLogFunc(); CCS_DLL extern void (*onLoadSpriteFramesWithFile)(std::string& file); diff --git a/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp b/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp index 4599666cb7..7769e80813 100644 --- a/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp +++ b/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp @@ -37,7 +37,7 @@ PageViewReader* PageViewReader::getInstance() void PageViewReader::destroyInstance() { - CC_SAFE_DELETE(instancePageViewReader); + AX_SAFE_DELETE(instancePageViewReader); } void PageViewReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) diff --git a/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.h b/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.h index c90083508e..197720147d 100644 --- a/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.h +++ b/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.h @@ -40,7 +40,7 @@ public: static PageViewReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp b/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp index c1719f34c7..c880545efb 100644 --- a/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp +++ b/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp @@ -59,12 +59,12 @@ Particle3DReader* Particle3DReader::getInstance() void Particle3DReader::purge() { - CC_SAFE_DELETE(_instanceParticle3DReader); + AX_SAFE_DELETE(_instanceParticle3DReader); } void Particle3DReader::destroyInstance() { - CC_SAFE_DELETE(_instanceParticle3DReader); + AX_SAFE_DELETE(_instanceParticle3DReader); } Offset
Particle3DReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h b/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h index 555c1f6e45..a4cb542a10 100644 --- a/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h +++ b/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h @@ -41,7 +41,7 @@ public: static Particle3DReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp b/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp index 5c31abfa1b..5ac1761483 100644 --- a/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp +++ b/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp @@ -58,12 +58,12 @@ ParticleReader* ParticleReader::getInstance() void ParticleReader::purge() { - CC_SAFE_DELETE(_instanceParticleReader); + AX_SAFE_DELETE(_instanceParticleReader); } void ParticleReader::destroyInstance() { - CC_SAFE_DELETE(_instanceParticleReader); + AX_SAFE_DELETE(_instanceParticleReader); } Offset
ParticleReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.h b/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.h index 099bbb1c46..75c9aa47bf 100644 --- a/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.h +++ b/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.h @@ -41,7 +41,7 @@ public: static ParticleReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp b/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp index c817d6dc82..82b5cbf287 100644 --- a/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp +++ b/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp @@ -52,12 +52,12 @@ ProjectNodeReader* ProjectNodeReader::getInstance() void ProjectNodeReader::purge() { - CC_SAFE_DELETE(_instanceProjectNodeReader); + AX_SAFE_DELETE(_instanceProjectNodeReader); } void ProjectNodeReader::destroyInstance() { - CC_SAFE_DELETE(_instanceProjectNodeReader); + AX_SAFE_DELETE(_instanceProjectNodeReader); } Offset
ProjectNodeReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h b/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h index 560385bb38..6b069251de 100644 --- a/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h +++ b/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h @@ -40,7 +40,7 @@ public: static ProjectNodeReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.cpp b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.cpp index a1cb3abac8..d0cb6f7b7b 100644 --- a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.cpp +++ b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.cpp @@ -46,7 +46,7 @@ RadioButtonGroupReader* RadioButtonGroupReader::getInstance() void RadioButtonGroupReader::destroyInstance() { - CC_SAFE_DELETE(s_readerInstance); + AX_SAFE_DELETE(s_readerInstance); } Offset
RadioButtonGroupReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h index fa232ffff9..1e5f9927f7 100644 --- a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h +++ b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h @@ -40,7 +40,7 @@ public: static RadioButtonGroupReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.cpp b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.cpp index 1181118833..fca7cc9c45 100644 --- a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.cpp +++ b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.cpp @@ -42,7 +42,7 @@ RadioButtonReader* RadioButtonReader::getInstance() void RadioButtonReader::destroyInstance() { - CC_SAFE_DELETE(instanceCheckBoxReader); + AX_SAFE_DELETE(instanceCheckBoxReader); } Offset
RadioButtonReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h index 1ea45967a5..d26506f886 100644 --- a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h +++ b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h @@ -40,7 +40,7 @@ public: static RadioButtonReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.cpp b/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.cpp index b806536752..c6f1126f29 100644 --- a/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.cpp +++ b/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.cpp @@ -36,7 +36,7 @@ RichTextReader* RichTextReader::getInstance() void RichTextReader::destroyInstance() { - CC_SAFE_DELETE(instanceTextBMFontReader); + AX_SAFE_DELETE(instanceTextBMFontReader); } Offset
RichTextReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.h b/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.h index ef63953e8f..3ab385c202 100644 --- a/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.h +++ b/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.h @@ -40,7 +40,7 @@ public: static RichTextReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp b/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp index c38e50f149..ff9eefe75f 100644 --- a/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp +++ b/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp @@ -41,7 +41,7 @@ ScrollViewReader* ScrollViewReader::getInstance() void ScrollViewReader::destroyInstance() { - CC_SAFE_DELETE(instanceScrollViewReader); + AX_SAFE_DELETE(instanceScrollViewReader); } void ScrollViewReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) diff --git a/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h b/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h index 0e364bbca2..17a9765978 100644 --- a/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h +++ b/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h @@ -40,7 +40,7 @@ public: static ScrollViewReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp b/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp index 29aad3a48a..f9c1984888 100644 --- a/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp +++ b/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp @@ -55,12 +55,12 @@ SingleNodeReader* SingleNodeReader::getInstance() void SingleNodeReader::purge() { - CC_SAFE_DELETE(_instanceSingleNodeReader); + AX_SAFE_DELETE(_instanceSingleNodeReader); } void SingleNodeReader::destroyInstance() { - CC_SAFE_DELETE(_instanceSingleNodeReader); + AX_SAFE_DELETE(_instanceSingleNodeReader); } Offset
SingleNodeReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h b/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h index 0c3aaf2764..1e9a2249c3 100644 --- a/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h +++ b/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h @@ -41,7 +41,7 @@ public: static SingleNodeReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.cpp b/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.cpp index 5a69bf37e8..c65cd0c588 100644 --- a/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.cpp +++ b/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.cpp @@ -55,7 +55,7 @@ BoneNodeReader* BoneNodeReader::getInstance() void BoneNodeReader::destroyInstance() { - CC_SAFE_DELETE(_instanceBoneNodeReader); + AX_SAFE_DELETE(_instanceBoneNodeReader); } Offset
BoneNodeReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h b/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h index c6aa8e1dd6..58900d8c44 100644 --- a/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h +++ b/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h @@ -38,7 +38,7 @@ public: static BoneNodeReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers( diff --git a/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.cpp b/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.cpp index 46138fd143..bf2a126890 100644 --- a/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.cpp +++ b/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.cpp @@ -53,7 +53,7 @@ SkeletonNodeReader* SkeletonNodeReader::getInstance() void SkeletonNodeReader::destroyInstance() { - CC_SAFE_DELETE(_instanceSkeletonNodeReader); + AX_SAFE_DELETE(_instanceSkeletonNodeReader); } axis::Node* SkeletonNodeReader::createNodeWithFlatBuffers(const flatbuffers::Table* nodeOptions) diff --git a/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h b/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h index ced3d5f725..165adf2df9 100644 --- a/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h +++ b/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h @@ -37,7 +37,7 @@ public: static SkeletonNodeReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); axis::Node* createNodeWithFlatBuffers(const flatbuffers::Table* boneOptions) override; diff --git a/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.cpp b/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.cpp index d0e3def5d4..62efe0c015 100644 --- a/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.cpp +++ b/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.cpp @@ -46,7 +46,7 @@ SliderReader* SliderReader::getInstance() void SliderReader::destroyInstance() { - CC_SAFE_DELETE(instanceSliderReader); + AX_SAFE_DELETE(instanceSliderReader); } void SliderReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -65,9 +65,9 @@ void SliderReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* coco std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER // control custom properties else if (key == P_Scale9Enable) { slider->setScale9Enabled(valueToBool(value)); } diff --git a/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.h b/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.h index a70ac3fa7e..6354350bbe 100644 --- a/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.h +++ b/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.h @@ -40,7 +40,7 @@ public: static SliderReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.cpp b/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.cpp index 4349aa3ea9..83f8eb9aeb 100644 --- a/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.cpp +++ b/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.cpp @@ -24,7 +24,7 @@ #include "WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h" -#if defined(CC_BUILD_WITH_SPINE) +#if defined(AX_BUILD_WITH_SPINE) # include "SpineSkeletonDataCache.h" # include "2d/CCSprite.h" @@ -62,12 +62,12 @@ SpineSkeletonReader* SpineSkeletonReader::getInstance() void SpineSkeletonReader::purge() { - CC_SAFE_DELETE(_instanceSpriteReader); + AX_SAFE_DELETE(_instanceSpriteReader); } void SpineSkeletonReader::destroyInstance() { - CC_SAFE_DELETE(_instanceSpriteReader); + AX_SAFE_DELETE(_instanceSpriteReader); } Offset
SpineSkeletonReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h b/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h index 9eae4303fa..6cc84e7db3 100644 --- a/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h +++ b/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h @@ -29,7 +29,7 @@ #include "WidgetReader/NodeReaderProtocol.h" #include "WidgetReader/NodeReaderDefine.h" -#if defined(CC_BUILD_WITH_SPINE) +#if defined(AX_BUILD_WITH_SPINE) namespace cocostudio { @@ -43,7 +43,7 @@ public: static SpineSkeletonReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp b/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp index 263bd65142..bd1ab92d27 100644 --- a/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp +++ b/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp @@ -63,12 +63,12 @@ SpriteReader* SpriteReader::getInstance() void SpriteReader::purge() { - CC_SAFE_DELETE(_instanceSpriteReader); + AX_SAFE_DELETE(_instanceSpriteReader); } void SpriteReader::destroyInstance() { - CC_SAFE_DELETE(_instanceSpriteReader); + AX_SAFE_DELETE(_instanceSpriteReader); } Offset
SpriteReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.h b/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.h index 761d284b3b..e9b70e9f30 100644 --- a/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.h +++ b/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.h @@ -41,7 +41,7 @@ public: static SpriteReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp b/extensions/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp index b5912853d5..6e4fecd7ed 100644 --- a/extensions/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp +++ b/extensions/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp @@ -53,7 +53,7 @@ TabControlReader* TabControlReader::getInstance() void TabControlReader::destroyInstance() { - CC_SAFE_DELETE(_tabReaderInstance); + AX_SAFE_DELETE(_tabReaderInstance); } flatbuffers::Offset TabControlReader::createOptionsWithFlatBuffers( @@ -217,7 +217,7 @@ TabHeaderReader* TabHeaderReader::getInstance() void TabHeaderReader::destroyInstance() { - CC_SAFE_DELETE(_tabheaderReaderInstance); + AX_SAFE_DELETE(_tabheaderReaderInstance); } flatbuffers::Offset TabHeaderReader::createOptionsWithFlatBuffers( @@ -900,7 +900,7 @@ TabItemReader* TabItemReader::getInstance() void TabItemReader::destroyInstance() { - CC_SAFE_DELETE(_tabItemReaderInstance); + AX_SAFE_DELETE(_tabItemReaderInstance); } flatbuffers::Offset TabItemReader::createTabItemOptionWithFlatBuffers( diff --git a/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp b/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp index f9155c9306..4102402553 100644 --- a/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp +++ b/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp @@ -42,7 +42,7 @@ TextAtlasReader* TextAtlasReader::getInstance() void TextAtlasReader::destroyInstance() { - CC_SAFE_DELETE(instanceTextAtlasReader); + AX_SAFE_DELETE(instanceTextAtlasReader); } void TextAtlasReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -67,9 +67,9 @@ void TextAtlasReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* c std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_StringValue) { stringValue = value; } else if (key == P_CharMapFileData) @@ -122,7 +122,7 @@ void TextAtlasReader::setPropsFromJsonDictionary(Widget* widget, const rapidjson break; } case 1: - CCLOG("Wrong res type of LabelAtlas!"); + AXLOG("Wrong res type of LabelAtlas!"); break; default: break; @@ -254,7 +254,7 @@ void TextAtlasReader::setPropsWithFlatBuffers(axis::Node* node, const flatbuffer } case 1: - CCLOG("Wrong res type of LabelAtlas!"); + AXLOG("Wrong res type of LabelAtlas!"); break; default: diff --git a/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h b/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h index 5e00f8edaa..2adac40e41 100644 --- a/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h +++ b/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h @@ -40,7 +40,7 @@ public: static TextAtlasReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp b/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp index 69fdba9c97..491ce5909b 100644 --- a/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp +++ b/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp @@ -39,7 +39,7 @@ TextBMFontReader* TextBMFontReader::getInstance() void TextBMFontReader::destroyInstance() { - CC_SAFE_DELETE(instanceTextBMFontReader); + AX_SAFE_DELETE(instanceTextBMFontReader); } void TextBMFontReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -55,9 +55,9 @@ void TextBMFontReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* std::string key = stChildArray[i].GetName(cocoLoader); std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_FileNameData) { @@ -99,7 +99,7 @@ void TextBMFontReader::setPropsFromJsonDictionary(Widget* widget, const rapidjso break; } case 1: - CCLOG("Wrong res type of LabelAtlas!"); + AXLOG("Wrong res type of LabelAtlas!"); break; default: break; diff --git a/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h b/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h index baf112a1e3..c2901d0d3e 100644 --- a/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h +++ b/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h @@ -40,7 +40,7 @@ public: static TextBMFontReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.cpp b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.cpp index adb491cf47..1eac411b78 100644 --- a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.cpp +++ b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.cpp @@ -58,7 +58,7 @@ TextFieldExReader* TextFieldExReader::getInstance() void TextFieldExReader::destroyInstance() { - CC_SAFE_DELETE(instanceTextFieldExReader); + AX_SAFE_DELETE(instanceTextFieldExReader); } Offset
TextFieldExReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h index 897db93379..dae94a0515 100644 --- a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h +++ b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h @@ -40,7 +40,7 @@ public: static TextFieldExReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp index e378e7b01a..afdd34405c 100644 --- a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp +++ b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp @@ -46,7 +46,7 @@ TextFieldReader* TextFieldReader::getInstance() void TextFieldReader::destroyInstance() { - CC_SAFE_DELETE(instanceTextFieldReader); + AX_SAFE_DELETE(instanceTextFieldReader); } void TextFieldReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -63,9 +63,9 @@ void TextFieldReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* c std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_PlaceHolder) { textField->setPlaceHolder(value); } else if (key == P_Text) { textField->setString(value); } diff --git a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h index 95d4bfa675..00f92933b4 100644 --- a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h +++ b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h @@ -40,7 +40,7 @@ public: static TextFieldReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/TextReader/TextReader.cpp b/extensions/cocostudio/WidgetReader/TextReader/TextReader.cpp index cd2f194aad..b78c68bbf5 100644 --- a/extensions/cocostudio/WidgetReader/TextReader/TextReader.cpp +++ b/extensions/cocostudio/WidgetReader/TextReader/TextReader.cpp @@ -46,7 +46,7 @@ TextReader* TextReader::getInstance() void TextReader::destroyInstance() { - CC_SAFE_DELETE(instanceTextReader); + AX_SAFE_DELETE(instanceTextReader); } void TextReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -64,9 +64,9 @@ void TextReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLo std::string key = stChildArray[i].GetName(cocoLoader); std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_TouchScaleEnable) { label->setTouchScaleChangeEnabled(valueToBool(value)); } diff --git a/extensions/cocostudio/WidgetReader/TextReader/TextReader.h b/extensions/cocostudio/WidgetReader/TextReader/TextReader.h index 1fbf26280d..224a357e17 100644 --- a/extensions/cocostudio/WidgetReader/TextReader/TextReader.h +++ b/extensions/cocostudio/WidgetReader/TextReader/TextReader.h @@ -40,7 +40,7 @@ public: static TextReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp b/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp index 6aa9b289d4..e9f586e2a3 100644 --- a/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp +++ b/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp @@ -60,12 +60,12 @@ UserCameraReader* UserCameraReader::getInstance() void UserCameraReader::purge() { - CC_SAFE_DELETE(_instanceUserCameraReader); + AX_SAFE_DELETE(_instanceUserCameraReader); } void UserCameraReader::destroyInstance() { - CC_SAFE_DELETE(_instanceUserCameraReader); + AX_SAFE_DELETE(_instanceUserCameraReader); } Vec2 UserCameraReader::getVec2Attribute(pugi::xml_attribute attribute) const diff --git a/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h b/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h index 93dd8d11eb..bbedaf8fe7 100644 --- a/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h +++ b/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h @@ -42,7 +42,7 @@ public: static UserCameraReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/WidgetReader.cpp b/extensions/cocostudio/WidgetReader/WidgetReader.cpp index 52e1175cc9..81b78a0d9c 100644 --- a/extensions/cocostudio/WidgetReader/WidgetReader.cpp +++ b/extensions/cocostudio/WidgetReader/WidgetReader.cpp @@ -128,12 +128,12 @@ WidgetReader* WidgetReader::getInstance() void WidgetReader::purge() { - CC_SAFE_DELETE(instanceWidgetReader); + AX_SAFE_DELETE(instanceWidgetReader); } void WidgetReader::destroyInstance() { - CC_SAFE_DELETE(instanceWidgetReader); + AX_SAFE_DELETE(instanceWidgetReader); } void WidgetReader::setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options) @@ -321,7 +321,7 @@ std::string WidgetReader::getResourcePath(const rapidjson::Value& dict, } else { - CCASSERT(0, "invalid TextureResType!!!"); + AXASSERT(0, "invalid TextureResType!!!"); } } return imageFileName_tp; @@ -354,7 +354,7 @@ std::string WidgetReader::getResourcePath(CocoLoader* cocoLoader, } else { - CCASSERT(0, "invalid TextureResType!!!"); + AXASSERT(0, "invalid TextureResType!!!"); } } return imageFileName_tp; @@ -403,7 +403,7 @@ void WidgetReader::setPropsFromBinary(axis::ui::Widget* widget, std::string key = stChildArray[i].GetName(cocoLoader); std::string value = stChildArray[i].GetValue(cocoLoader); - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER } this->endSetBasicProperties(widget); @@ -956,7 +956,7 @@ std::string WidgetReader::getResourcePath(std::string_view path, axis::ui::Widge } else { - CCASSERT(0, "invalid TextureResType!!!"); + AXASSERT(0, "invalid TextureResType!!!"); } } return imageFileName_tp; diff --git a/extensions/cocostudio/WidgetReader/WidgetReader.h b/extensions/cocostudio/WidgetReader/WidgetReader.h index 3b7f8dfff9..cd58e0af95 100644 --- a/extensions/cocostudio/WidgetReader/WidgetReader.h +++ b/extensions/cocostudio/WidgetReader/WidgetReader.h @@ -47,7 +47,7 @@ public: static WidgetReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); @@ -141,7 +141,7 @@ extern const char* P_AnchorPointY; extern const char* P_ResourceType; extern const char* P_Path; -#define CC_BASIC_PROPERTY_BINARY_READER \ +#define AX_BASIC_PROPERTY_BINARY_READER \ if (key == P_IgnoreSize) \ { \ widget->ignoreContentAdaptWithSize(valueToBool(value)); \ @@ -287,7 +287,7 @@ extern const char* P_Path; } \ } -#define CC_COLOR_PROPERTY_BINARY_READER \ +#define AX_COLOR_PROPERTY_BINARY_READER \ else if (key == P_Opacity) { _opacity = valueToInt(value); } \ else if (key == P_ColorR) { _color.r = valueToInt(value); } \ else if (key == P_ColorG) { _color.g = valueToInt(value); } \ diff --git a/extensions/fairygui/Controller.cpp b/extensions/fairygui/Controller.cpp index 9382210259..f106cb7ac0 100644 --- a/extensions/fairygui/Controller.cpp +++ b/extensions/fairygui/Controller.cpp @@ -25,7 +25,7 @@ void GController::setSelectedIndex(int value, bool triggerEvent) { if (_selectedIndex != value) { - CCASSERT(value < (int)_pageIds.size(), "Invalid selected index"); + AXASSERT(value < (int)_pageIds.size(), "Invalid selected index"); changing = true; diff --git a/extensions/fairygui/DragDropManager.cpp b/extensions/fairygui/DragDropManager.cpp index ff27bdcef4..2cdd7ef5fc 100644 --- a/extensions/fairygui/DragDropManager.cpp +++ b/extensions/fairygui/DragDropManager.cpp @@ -19,12 +19,12 @@ DragDropManager::DragDropManager() : _agent->setAlign(TextHAlignment::CENTER); _agent->setVerticalAlign(TextVAlignment::CENTER); _agent->setSortingOrder(INT_MAX); - _agent->addEventListener(UIEventType::DragEnd, CC_CALLBACK_1(DragDropManager::onDragEnd, this)); + _agent->addEventListener(UIEventType::DragEnd, AX_CALLBACK_1(DragDropManager::onDragEnd, this)); } DragDropManager::~DragDropManager() { - CC_SAFE_RELEASE(_agent); + AX_SAFE_RELEASE(_agent); } DragDropManager* DragDropManager::getInstance() diff --git a/extensions/fairygui/FairyGUIMacros.h b/extensions/fairygui/FairyGUIMacros.h index 6168ede2eb..b244d2b6da 100644 --- a/extensions/fairygui/FairyGUIMacros.h +++ b/extensions/fairygui/FairyGUIMacros.h @@ -10,24 +10,24 @@ #define CALL_LATER_FUNC(__TYPE__,__FUNC__) \ void __selector_##__FUNC__(float dt) \ {\ - axis::Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this);\ + axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this);\ __FUNC__(); \ }\ void __FUNC__() #define CALL_LATER(__TYPE__,__FUNC__,...) \ -if (!axis::Director::getInstance()->getScheduler()->isScheduled(CC_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this))\ - axis::Director::getInstance()->getScheduler()->schedule(CC_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this, (__VA_ARGS__+0), false) +if (!axis::Director::getInstance()->getScheduler()->isScheduled(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this))\ + axis::Director::getInstance()->getScheduler()->schedule(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this, (__VA_ARGS__+0), false) #define CALL_LATER_CANCEL(__TYPE__,__FUNC__) \ -axis::Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this) +axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this) #define CALL_PER_FRAME(__TYPE__,__FUNC__) \ -if (!axis::Director::getInstance()->getScheduler()->isScheduled(CC_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this))\ - axis::Director::getInstance()->getScheduler()->schedule(CC_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this, 0, false) +if (!axis::Director::getInstance()->getScheduler()->isScheduled(AX_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this))\ + axis::Director::getInstance()->getScheduler()->schedule(AX_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this, 0, false) #define CALL_PER_FRAME_CANCEL(__TYPE__,__FUNC__) \ -axis::Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this) +axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this) #define UIRoot GRoot::getInstance() diff --git a/extensions/fairygui/GButton.cpp b/extensions/fairygui/GButton.cpp index ac332beceb..55966f41bb 100644 --- a/extensions/fairygui/GButton.cpp +++ b/extensions/fairygui/GButton.cpp @@ -289,12 +289,12 @@ void GButton::constructExtension(ByteBuffer* buffer) if (_mode == ButtonMode::COMMON) setState(UP); - addEventListener(UIEventType::RollOver, CC_CALLBACK_1(GButton::onRollOver, this)); - addEventListener(UIEventType::RollOut, CC_CALLBACK_1(GButton::onRollOut, this)); - addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GButton::onTouchBegin, this)); - addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(GButton::onTouchEnd, this)); - addEventListener(UIEventType::Click, CC_CALLBACK_1(GButton::onClick, this)); - addEventListener(UIEventType::Exit, CC_CALLBACK_1(GButton::onExit, this)); + addEventListener(UIEventType::RollOver, AX_CALLBACK_1(GButton::onRollOver, this)); + addEventListener(UIEventType::RollOut, AX_CALLBACK_1(GButton::onRollOut, this)); + addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GButton::onTouchBegin, this)); + addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(GButton::onTouchEnd, this)); + addEventListener(UIEventType::Click, AX_CALLBACK_1(GButton::onClick, this)); + addEventListener(UIEventType::Exit, AX_CALLBACK_1(GButton::onExit, this)); } void GButton::setup_afterAdd(ByteBuffer* buffer, int beginPos) diff --git a/extensions/fairygui/GComboBox.cpp b/extensions/fairygui/GComboBox.cpp index 3898a4080a..b19ec37a26 100644 --- a/extensions/fairygui/GComboBox.cpp +++ b/extensions/fairygui/GComboBox.cpp @@ -28,7 +28,7 @@ GComboBox::GComboBox() GComboBox::~GComboBox() { - CC_SAFE_RELEASE(_dropdown); + AX_SAFE_RELEASE(_dropdown); } const std::string& GComboBox::getTitle() const @@ -307,14 +307,14 @@ void GComboBox::constructExtension(ByteBuffer* buffer) if (!dropdown.empty()) { _dropdown = dynamic_cast(UIPackage::createObjectFromURL(dropdown)); - CCASSERT(_dropdown != nullptr, "FairyGUI: should be a component."); + AXASSERT(_dropdown != nullptr, "FairyGUI: should be a component."); _dropdown->retain(); _list = dynamic_cast(_dropdown->getChild("list")); - CCASSERT(_list != nullptr, "FairyGUI: should container a list component named list."); + AXASSERT(_list != nullptr, "FairyGUI: should container a list component named list."); - _list->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(GComboBox::onClickItem, this)); + _list->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(GComboBox::onClickItem, this)); _list->addRelation(_dropdown, RelationType::Width); _list->removeRelation(_dropdown, RelationType::Height); @@ -322,13 +322,13 @@ void GComboBox::constructExtension(ByteBuffer* buffer) _dropdown->addRelation(_list, RelationType::Height); _dropdown->removeRelation(_list, RelationType::Width); - _dropdown->addEventListener(UIEventType::Exit, CC_CALLBACK_1(GComboBox::onPopupWinClosed, this)); + _dropdown->addEventListener(UIEventType::Exit, AX_CALLBACK_1(GComboBox::onPopupWinClosed, this)); } - addEventListener(UIEventType::RollOver, CC_CALLBACK_1(GComboBox::onRollover, this)); - addEventListener(UIEventType::RollOut, CC_CALLBACK_1(GComboBox::onRollout, this)); - addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GComboBox::onTouchBegin, this)); - addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(GComboBox::onTouchEnd, this)); + addEventListener(UIEventType::RollOver, AX_CALLBACK_1(GComboBox::onRollover, this)); + addEventListener(UIEventType::RollOut, AX_CALLBACK_1(GComboBox::onRollout, this)); + addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GComboBox::onTouchBegin, this)); + addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(GComboBox::onTouchEnd, this)); } void GComboBox::setup_afterAdd(ByteBuffer* buffer, int beginPos) diff --git a/extensions/fairygui/GComponent.cpp b/extensions/fairygui/GComponent.cpp index bbfa0748de..1adc721387 100644 --- a/extensions/fairygui/GComponent.cpp +++ b/extensions/fairygui/GComponent.cpp @@ -36,10 +36,10 @@ GComponent::~GComponent() _children.clear(); _controllers.clear(); _transitions.clear(); - CC_SAFE_RELEASE(_maskOwner); - CC_SAFE_RELEASE(_container); - CC_SAFE_RELEASE(_scrollPane); - CC_SAFE_DELETE(_hitArea); + AX_SAFE_RELEASE(_maskOwner); + AX_SAFE_RELEASE(_container); + AX_SAFE_RELEASE(_scrollPane); + AX_SAFE_DELETE(_hitArea); CALL_LATER_CANCEL(GComponent, doUpdateBounds); CALL_LATER_CANCEL(GComponent, buildNativeDisplayList); } @@ -66,7 +66,7 @@ GObject* GComponent::addChild(GObject* child) GObject* GComponent::addChildAt(GObject* child, int index) { - CCASSERT(child != nullptr, "Argument must be non-nil"); + AXASSERT(child != nullptr, "Argument must be non-nil"); if (child->_parent == this) { @@ -121,7 +121,7 @@ int GComponent::getInsertPosForSortingChild(GObject* target) void GComponent::removeChild(GObject* child) { - CCASSERT(child != nullptr, "Argument must be non-nil"); + AXASSERT(child != nullptr, "Argument must be non-nil"); int childIndex = (int)_children.getIndex(child); if (childIndex != -1) @@ -130,7 +130,7 @@ void GComponent::removeChild(GObject* child) void GComponent::removeChildAt(int index) { - CCASSERT(index >= 0 && index < _children.size(), "Invalid child index"); + AXASSERT(index >= 0 && index < _children.size(), "Invalid child index"); GObject* child = _children.at(index); @@ -162,7 +162,7 @@ void GComponent::removeChildren(int beginIndex, int endIndex) GObject* GComponent::getChildAt(int index) const { - CCASSERT(index >= 0 && index < _children.size(), "Invalid child index"); + AXASSERT(index >= 0 && index < _children.size(), "Invalid child index"); return _children.at(index); } @@ -211,7 +211,7 @@ GObject* GComponent::getChildByPath(const std::string& path) const GObject* GComponent::getChildInGroup(const GGroup* group, const std::string& name) const { - CCASSERT(group != nullptr, "Argument must be non-nil"); + AXASSERT(group != nullptr, "Argument must be non-nil"); for (const auto& child : _children) { @@ -235,17 +235,17 @@ GObject* GComponent::getChildById(const std::string& id) const int GComponent::getChildIndex(const GObject* child) const { - CCASSERT(child != nullptr, "Argument must be non-nil"); + AXASSERT(child != nullptr, "Argument must be non-nil"); return (int)_children.getIndex((GObject*)child); } void GComponent::setChildIndex(GObject* child, int index) { - CCASSERT(child != nullptr, "Argument must be non-nil"); + AXASSERT(child != nullptr, "Argument must be non-nil"); int oldIndex = (int)_children.getIndex(child); - CCASSERT(oldIndex != -1, "Not a child of this container"); + AXASSERT(oldIndex != -1, "Not a child of this container"); if (child->_sortingOrder != 0) //no effect return; @@ -262,10 +262,10 @@ void GComponent::setChildIndex(GObject* child, int index) int GComponent::setChildIndexBefore(GObject* child, int index) { - CCASSERT(child != nullptr, "Argument must be non-nil"); + AXASSERT(child != nullptr, "Argument must be non-nil"); int oldIndex = (int)_children.getIndex(child); - CCASSERT(oldIndex != -1, "Not a child of this container"); + AXASSERT(oldIndex != -1, "Not a child of this container"); if (child->_sortingOrder != 0) //no effect return oldIndex; @@ -335,14 +335,14 @@ int GComponent::moveChild(GObject* child, int oldIndex, int index) void GComponent::swapChildren(GObject* child1, GObject* child2) { - CCASSERT(child1 != nullptr, "Argument1 must be non-nil"); - CCASSERT(child2 != nullptr, "Argument2 must be non-nil"); + AXASSERT(child1 != nullptr, "Argument1 must be non-nil"); + AXASSERT(child2 != nullptr, "Argument2 must be non-nil"); int index1 = (int)_children.getIndex(child1); int index2 = (int)_children.getIndex(child2); - CCASSERT(index1 != -1, "Not a child of this container"); - CCASSERT(index2 != -1, "Not a child of this container"); + AXASSERT(index1 != -1, "Not a child of this container"); + AXASSERT(index2 != -1, "Not a child of this container"); swapChildrenAt(index1, index2); } @@ -417,24 +417,24 @@ GController* GComponent::getController(const std::string& name) const void GComponent::addController(GController* c) { - CCASSERT(c != nullptr, "Argument must be non-nil"); + AXASSERT(c != nullptr, "Argument must be non-nil"); _controllers.pushBack(c); } GController* GComponent::getControllerAt(int index) const { - CCASSERT(index >= 0 && index < _controllers.size(), "Invalid controller index"); + AXASSERT(index >= 0 && index < _controllers.size(), "Invalid controller index"); return _controllers.at(index); } void GComponent::removeController(GController* c) { - CCASSERT(c != nullptr, "Argument must be non-nil"); + AXASSERT(c != nullptr, "Argument must be non-nil"); ssize_t index = _controllers.getIndex(c); - CCASSERT(index != -1, "controller not exists"); + AXASSERT(index != -1, "controller not exists"); c->setParent(nullptr); applyController(c); @@ -473,7 +473,7 @@ Transition* GComponent::getTransition(const std::string& name) const Transition* GComponent::getTransitionAt(int index) const { - CCASSERT(index >= 0 && index < _transitions.size(), "Invalid transition index"); + AXASSERT(index >= 0 && index < _transitions.size(), "Invalid transition index"); return _transitions.at(index); } @@ -580,7 +580,7 @@ void GComponent::setHitArea(IHitTest* value) { if (_hitArea != value) { - CC_SAFE_DELETE(_hitArea); + AX_SAFE_DELETE(_hitArea); _hitArea = value; } } diff --git a/extensions/fairygui/GGraph.cpp b/extensions/fairygui/GGraph.cpp index c0444e0a4f..6dfb917c9c 100644 --- a/extensions/fairygui/GGraph.cpp +++ b/extensions/fairygui/GGraph.cpp @@ -27,9 +27,9 @@ GGraph::GGraph() : _shape(nullptr), GGraph::~GGraph() { - CC_SAFE_DELETE(_cornerRadius); - CC_SAFE_DELETE(_polygonPoints); - CC_SAFE_DELETE(_distances); + AX_SAFE_DELETE(_cornerRadius); + AX_SAFE_DELETE(_polygonPoints); + AX_SAFE_DELETE(_distances); } void GGraph::handleInit() diff --git a/extensions/fairygui/GList.cpp b/extensions/fairygui/GList.cpp index b90db9952f..8f392e249d 100644 --- a/extensions/fairygui/GList.cpp +++ b/extensions/fairygui/GList.cpp @@ -189,9 +189,9 @@ GObject* GList::addChildAt(GObject* child, int index) button->setChangeStateOnClick(false); } - child->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GList::onItemTouchBegin, this), EventTag(this)); - child->addClickListener(CC_CALLBACK_1(GList::onClickItem, this), EventTag(this)); - child->addEventListener(UIEventType::RightClick, CC_CALLBACK_1(GList::onClickItem, this), EventTag(this)); + child->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GList::onItemTouchBegin, this), EventTag(this)); + child->addClickListener(AX_CALLBACK_1(GList::onClickItem, this), EventTag(this)); + child->addEventListener(UIEventType::RightClick, AX_CALLBACK_1(GList::onClickItem, this), EventTag(this)); return child; } @@ -882,7 +882,7 @@ void GList::scrollToView(int index, bool ani, bool setFirst) checkVirtualList(); - CCASSERT(index >= 0 && index < (int)_virtualItems.size(), "Invalid child index"); + AXASSERT(index >= 0 && index < (int)_virtualItems.size(), "Invalid child index"); if (_loop) index = floor(_firstIndex / _numItems) * _numItems + index; @@ -996,11 +996,11 @@ void GList::setVirtual(bool loop) { if (!_virtual) { - CCASSERT(_scrollPane != nullptr, "FairyGUI: Virtual list must be scrollable!"); + AXASSERT(_scrollPane != nullptr, "FairyGUI: Virtual list must be scrollable!"); if (loop) { - CCASSERT(_layout != ListLayoutType::FLOW_HORIZONTAL && _layout != ListLayoutType::FLOW_VERTICAL, + AXASSERT(_layout != ListLayoutType::FLOW_HORIZONTAL && _layout != ListLayoutType::FLOW_VERTICAL, "FairyGUI: Loop list is not supported for FlowHorizontal or FlowVertical layout!"); _scrollPane->setBouncebackEffect(false); @@ -1013,7 +1013,7 @@ void GList::setVirtual(bool loop) if (_itemSize.x == 0 || _itemSize.y == 0) { GObject* obj = getFromPool(); - CCASSERT(obj != nullptr, "FairyGUI: Virtual List must have a default list item resource."); + AXASSERT(obj != nullptr, "FairyGUI: Virtual List must have a default list item resource."); _itemSize = obj->getSize(); _itemSize.x = ceil(_itemSize.x); _itemSize.y = ceil(_itemSize.y); @@ -1033,7 +1033,7 @@ void GList::setVirtual(bool loop) _scrollPane->_loop = 1; } - addEventListener(UIEventType::Scroll, CC_CALLBACK_1(GList::onScroll, this)); + addEventListener(UIEventType::Scroll, AX_CALLBACK_1(GList::onScroll, this)); setVirtualListChangedFlag(true); } } @@ -1050,7 +1050,7 @@ void GList::setNumItems(int value) { if (_virtual) { - CCASSERT(itemRenderer != nullptr, "FairyGUI: Set itemRenderer first!"); + AXASSERT(itemRenderer != nullptr, "FairyGUI: Set itemRenderer first!"); _numItems = value; if (_loop) @@ -1108,7 +1108,7 @@ void GList::setNumItems(int value) void GList::refreshVirtualList() { - CCASSERT(_virtual, "FairyGUI: not virtual list"); + AXASSERT(_virtual, "FairyGUI: not virtual list"); setVirtualListChangedFlag(false); } @@ -1445,7 +1445,7 @@ void GList::handleScroll(bool forceUpdate) forceUpdate = false; if (enterCounter > 20) { - CCLOG("FairyGUI: list will never be filled as the item renderer function always returns a different size."); + AXLOG("FairyGUI: list will never be filled as the item renderer function always returns a different size."); break; } } @@ -1460,7 +1460,7 @@ void GList::handleScroll(bool forceUpdate) forceUpdate = false; if (enterCounter > 20) { - CCLOG("FairyGUI: list will never be filled as the item renderer function always returns a different size."); + AXLOG("FairyGUI: list will never be filled as the item renderer function always returns a different size."); break; } } diff --git a/extensions/fairygui/GLoader.cpp b/extensions/fairygui/GLoader.cpp index db73e20854..cf0a36770b 100644 --- a/extensions/fairygui/GLoader.cpp +++ b/extensions/fairygui/GLoader.cpp @@ -28,9 +28,9 @@ GLoader::GLoader() GLoader::~GLoader() { - CC_SAFE_RELEASE(_playAction); - CC_SAFE_RELEASE(_content); - CC_SAFE_RELEASE(_content2); + AX_SAFE_RELEASE(_playAction); + AX_SAFE_RELEASE(_content); + AX_SAFE_RELEASE(_content2); } void GLoader::handleInit() @@ -321,7 +321,7 @@ void GLoader::clearContent() if (_content2 != nullptr) { _displayObject->removeChild(_content2->displayObject()); - CC_SAFE_RELEASE_NULL(_content2); + AX_SAFE_RELEASE_NULL(_content2); } ((FUISprite*)_content)->clearContent(); diff --git a/extensions/fairygui/GLoader3D.cpp b/extensions/fairygui/GLoader3D.cpp index 03e4ecd8fd..db467d39ab 100644 --- a/extensions/fairygui/GLoader3D.cpp +++ b/extensions/fairygui/GLoader3D.cpp @@ -30,8 +30,8 @@ GLoader3D::GLoader3D() GLoader3D::~GLoader3D() { - CC_SAFE_RELEASE(_content); - CC_SAFE_RELEASE(_container); + AX_SAFE_RELEASE(_content); + AX_SAFE_RELEASE(_container); } void GLoader3D::handleInit() @@ -235,7 +235,7 @@ void GLoader3D::onChangeSpine() if (skeletonAni == nullptr) return; -#if !defined(CC_USE_SPINE_CPP) || CC_USE_SPINE_CPP +#if !defined(AX_USE_SPINE_CPP) || AX_USE_SPINE_CPP spine::AnimationState* state = skeletonAni->getState(); spine::Animation* aniToUse = !_animationName.empty() ? skeletonAni->findAnimation(_animationName) : nullptr; @@ -311,7 +311,7 @@ void GLoader3D::clearContent() if (_content != nullptr) { _container->removeChild(_content); - CC_SAFE_RELEASE_NULL(_content); + AX_SAFE_RELEASE_NULL(_content); } _contentItem = nullptr; diff --git a/extensions/fairygui/GMovieClip.cpp b/extensions/fairygui/GMovieClip.cpp index e3e7f3c7ba..216c925812 100644 --- a/extensions/fairygui/GMovieClip.cpp +++ b/extensions/fairygui/GMovieClip.cpp @@ -18,7 +18,7 @@ GMovieClip::GMovieClip() GMovieClip::~GMovieClip() { - CC_SAFE_RELEASE(_playAction); + AX_SAFE_RELEASE(_playAction); } void GMovieClip::handleInit() @@ -192,7 +192,7 @@ _timeScale(1) ActionMovieClip::~ActionMovieClip() { - CC_SAFE_RELEASE(_animation); + AX_SAFE_RELEASE(_animation); } ActionMovieClip* ActionMovieClip::create(axis::Animation* animation, float repeatDelay, bool swing) @@ -307,7 +307,7 @@ void ActionMovieClip::startWithTarget(Node* target) ActionMovieClip* ActionMovieClip::reverse() const { - CC_ASSERT(0); + AX_ASSERT(0); return nullptr; } @@ -421,8 +421,8 @@ void ActionMovieClip::setAnimation(axis::Animation* animation, float repeatDelay { if (_animation != animation) { - CC_SAFE_RETAIN(animation); - CC_SAFE_RELEASE(_animation); + AX_SAFE_RETAIN(animation); + AX_SAFE_RELEASE(_animation); _animation = animation; } diff --git a/extensions/fairygui/GMovieClip.h b/extensions/fairygui/GMovieClip.h index 5a6d140489..accf88f81c 100644 --- a/extensions/fairygui/GMovieClip.h +++ b/extensions/fairygui/GMovieClip.h @@ -98,7 +98,7 @@ private: int _endAt; int _status; //0-none, 1-next loop, 2-ending, 3-ended - CC_DISALLOW_COPY_AND_ASSIGN(ActionMovieClip); + AX_DISALLOW_COPY_AND_ASSIGN(ActionMovieClip); }; NS_FGUI_END diff --git a/extensions/fairygui/GObject.cpp b/extensions/fairygui/GObject.cpp index b089044ed6..fe598baf86 100644 --- a/extensions/fairygui/GObject.cpp +++ b/extensions/fairygui/GObject.cpp @@ -66,12 +66,12 @@ GObject::~GObject() if (_displayObject) { _displayObject->removeFromParent(); - CC_SAFE_RELEASE(_displayObject); + AX_SAFE_RELEASE(_displayObject); } for (int i = 0; i < 10; i++) - CC_SAFE_DELETE(_gears[i]); - CC_SAFE_DELETE(_relations); - CC_SAFE_DELETE(_dragBounds); + AX_SAFE_DELETE(_gears[i]); + AX_SAFE_DELETE(_relations); + AX_SAFE_DELETE(_dragBounds); if (_weakPtrRef > 0) WeakPtr::markDisposed(this); @@ -85,8 +85,8 @@ bool GObject::init() { _displayObject->setAnchorPoint(Vec2(0, 1)); _displayObject->setCascadeOpacityEnabled(true); - _displayObject->setOnEnterCallback(CC_CALLBACK_0(GObject::onEnter, this)); - _displayObject->setOnExitCallback(CC_CALLBACK_0(GObject::onExit, this)); + _displayObject->setOnEnterCallback(AX_CALLBACK_0(GObject::onEnter, this)); + _displayObject->setOnExitCallback(AX_CALLBACK_0(GObject::onExit, this)); } return true; } @@ -402,8 +402,8 @@ void GObject::setTooltips(const std::string& value) _tooltips = value; if (!_tooltips.empty()) { - addEventListener(UIEventType::RollOver, CC_CALLBACK_1(GObject::onRollOver, this), EventTag(this)); - addEventListener(UIEventType::RollOut, CC_CALLBACK_1(GObject::onRollOut, this), EventTag(this)); + addEventListener(UIEventType::RollOver, AX_CALLBACK_1(GObject::onRollOver, this), EventTag(this)); + addEventListener(UIEventType::RollOut, AX_CALLBACK_1(GObject::onRollOut, this), EventTag(this)); } } @@ -908,9 +908,9 @@ void GObject::initDrag() { if (_draggable) { - addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GObject::onTouchBegin, this), EventTag(this)); - addEventListener(UIEventType::TouchMove, CC_CALLBACK_1(GObject::onTouchMove, this), EventTag(this)); - addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(GObject::onTouchEnd, this), EventTag(this)); + addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GObject::onTouchBegin, this), EventTag(this)); + addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(GObject::onTouchMove, this), EventTag(this)); + addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(GObject::onTouchEnd, this), EventTag(this)); } else { @@ -937,8 +937,8 @@ void GObject::dragBegin(int touchId) _dragTesting = true; UIRoot->getInputProcessor()->addTouchMonitor(touchId, this); - addEventListener(UIEventType::TouchMove, CC_CALLBACK_1(GObject::onTouchMove, this), EventTag(this)); - addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(GObject::onTouchEnd, this), EventTag(this)); + addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(GObject::onTouchMove, this), EventTag(this)); + addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(GObject::onTouchEnd, this), EventTag(this)); } void GObject::dragEnd() @@ -964,7 +964,7 @@ void GObject::onTouchMove(EventContext* context) if (_draggingObject != this && _draggable && _dragTesting) { int sensitivity; -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC sensitivity = UIConfig::clickDragSensitivity; #else sensitivity = UIConfig::touchDragSensitivity; diff --git a/extensions/fairygui/GRoot.cpp b/extensions/fairygui/GRoot.cpp index 4325968dc7..b4cfca9340 100644 --- a/extensions/fairygui/GRoot.cpp +++ b/extensions/fairygui/GRoot.cpp @@ -43,9 +43,9 @@ GRoot::GRoot() : _windowSizeListener(nullptr), GRoot::~GRoot() { delete _inputProcessor; - CC_SAFE_RELEASE(_modalWaitPane); - CC_SAFE_RELEASE(_defaultTooltipWin); - CC_SAFE_RELEASE(_modalLayer); + AX_SAFE_RELEASE(_modalWaitPane); + AX_SAFE_RELEASE(_defaultTooltipWin); + AX_SAFE_RELEASE(_modalLayer); CALL_LATER_CANCEL(GRoot, doShowTooltipsWin); if (_windowSizeListener) @@ -418,7 +418,7 @@ void GRoot::showTooltips(const std::string& msg) const std::string& resourceURL = UIConfig::tooltipsWin; if (resourceURL.empty()) { - CCLOGWARN("FairyGUI: UIConfig.tooltipsWin not defined"); + AXLOGWARN("FairyGUI: UIConfig.tooltipsWin not defined"); return; } @@ -533,10 +533,10 @@ bool GRoot::initWithScene(axis::Scene* scene, int zOrder) _inst = this; _inputProcessor = new InputProcessor(this); - _inputProcessor->setCaptureCallback(CC_CALLBACK_1(GRoot::onTouchEvent, this)); + _inputProcessor->setCaptureCallback(AX_CALLBACK_1(GRoot::onTouchEvent, this)); -#ifdef CC_PLATFORM_PC - _windowSizeListener = Director::getInstance()->getEventDispatcher()->addCustomEventListener(GLViewImpl::EVENT_WINDOW_RESIZED, CC_CALLBACK_0(GRoot::onWindowSizeChanged, this)); +#ifdef AX_PLATFORM_PC + _windowSizeListener = Director::getInstance()->getEventDispatcher()->addCustomEventListener(GLViewImpl::EVENT_WINDOW_RESIZED, AX_CALLBACK_0(GRoot::onWindowSizeChanged, this)); #endif onWindowSizeChanged(); diff --git a/extensions/fairygui/GScrollBar.cpp b/extensions/fairygui/GScrollBar.cpp index c031e4cc3d..92cb9593ab 100644 --- a/extensions/fairygui/GScrollBar.cpp +++ b/extensions/fairygui/GScrollBar.cpp @@ -71,23 +71,23 @@ void GScrollBar::constructExtension(ByteBuffer* buffer) _fixedGripSize = buffer->readBool(); _grip = getChild("grip"); - CCASSERT(_grip != nullptr, "FairyGUI: should define grip"); + AXASSERT(_grip != nullptr, "FairyGUI: should define grip"); _bar = getChild("bar"); - CCASSERT(_bar != nullptr, "FairyGUI: should define bar"); + AXASSERT(_bar != nullptr, "FairyGUI: should define bar"); _arrowButton1 = getChild("arrow1"); _arrowButton2 = getChild("arrow2"); - _grip->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GScrollBar::onGripTouchBegin, this)); - _grip->addEventListener(UIEventType::TouchMove, CC_CALLBACK_1(GScrollBar::onGripTouchMove, this)); - _grip->addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(GScrollBar::onGripTouchEnd, this)); + _grip->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GScrollBar::onGripTouchBegin, this)); + _grip->addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(GScrollBar::onGripTouchMove, this)); + _grip->addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(GScrollBar::onGripTouchEnd, this)); - this->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GScrollBar::onTouchBegin, this)); + this->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GScrollBar::onTouchBegin, this)); if (_arrowButton1 != nullptr) - _arrowButton1->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GScrollBar::onArrowButton1Click, this)); + _arrowButton1->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GScrollBar::onArrowButton1Click, this)); if (_arrowButton2 != nullptr) - _arrowButton2->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GScrollBar::onArrowButton2Click, this)); + _arrowButton2->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GScrollBar::onArrowButton2Click, this)); } void GScrollBar::onTouchBegin(EventContext* context) diff --git a/extensions/fairygui/GSlider.cpp b/extensions/fairygui/GSlider.cpp index ceb2831b4b..98688b33de 100644 --- a/extensions/fairygui/GSlider.cpp +++ b/extensions/fairygui/GSlider.cpp @@ -198,11 +198,11 @@ void GSlider::constructExtension(ByteBuffer* buffer) if (_gripObject != nullptr) { - _gripObject->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GSlider::onGripTouchBegin, this)); - _gripObject->addEventListener(UIEventType::TouchMove, CC_CALLBACK_1(GSlider::onGripTouchMove, this)); + _gripObject->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GSlider::onGripTouchBegin, this)); + _gripObject->addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(GSlider::onGripTouchMove, this)); } - addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GSlider::onTouchBegin, this)); + addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GSlider::onTouchBegin, this)); } void GSlider::setup_afterAdd(ByteBuffer* buffer, int beginPos) diff --git a/extensions/fairygui/GTextField.cpp b/extensions/fairygui/GTextField.cpp index f8124d4566..f518400f9d 100644 --- a/extensions/fairygui/GTextField.cpp +++ b/extensions/fairygui/GTextField.cpp @@ -14,7 +14,7 @@ GTextField::GTextField() GTextField::~GTextField() { - CC_SAFE_DELETE(_templateVars); + AX_SAFE_DELETE(_templateVars); } void GTextField::setText(const std::string& value) @@ -71,7 +71,7 @@ void GTextField::setTemplateVars(axis::ValueMap* value) return; if (value == nullptr) - CC_SAFE_DELETE(_templateVars); + AX_SAFE_DELETE(_templateVars); else { if (_templateVars == nullptr) diff --git a/extensions/fairygui/GTree.cpp b/extensions/fairygui/GTree.cpp index 3d9ef86338..a24140b170 100644 --- a/extensions/fairygui/GTree.cpp +++ b/extensions/fairygui/GTree.cpp @@ -16,7 +16,7 @@ GTree::GTree() GTree::~GTree() { - CC_SAFE_RELEASE(_rootNode); + AX_SAFE_RELEASE(_rootNode); } void GTree::handleInit() @@ -92,13 +92,13 @@ void GTree::createCell(GTreeNode* node) { const std::string& url = node->_resURL.empty() ? getDefaultItem() : node->_resURL; GComponent* child = getItemPool()->getObject(url)->as(); - CCASSERT(child, "Unable to create tree cell"); + AXASSERT(child, "Unable to create tree cell"); child->_treeNode = node; if (node->_cell != child) { - CC_SAFE_RELEASE(node->_cell); + AX_SAFE_RELEASE(node->_cell); node->_cell = child; - CC_SAFE_RETAIN(node->_cell); + AX_SAFE_RETAIN(node->_cell); } GObject* indentObj = node->_cell->getChild("indent"); @@ -110,7 +110,7 @@ void GTree::createCell(GTreeNode* node) cc = child->getController("expanded"); if (cc != nullptr) { - cc->addEventListener(UIEventType::Changed, CC_CALLBACK_1(GTree::onExpandedStateChanged, this)); + cc->addEventListener(UIEventType::Changed, AX_CALLBACK_1(GTree::onExpandedStateChanged, this)); cc->setSelectedIndex(node->isExpanded() ? 1 : 0); } @@ -119,7 +119,7 @@ void GTree::createCell(GTreeNode* node) cc->setSelectedIndex(node->isFolder() ? 0 : 1); if (node->isFolder()) - child->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GTree::onCellTouchBegin, this)); + child->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GTree::onCellTouchBegin, this)); if (treeNodeRender != nullptr) treeNodeRender(node, child); diff --git a/extensions/fairygui/GTreeNode.cpp b/extensions/fairygui/GTreeNode.cpp index 6cb12933f4..150230ac74 100644 --- a/extensions/fairygui/GTreeNode.cpp +++ b/extensions/fairygui/GTreeNode.cpp @@ -15,7 +15,7 @@ GTreeNode* GTreeNode::create(bool isFolder, const std::string& resURL) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -41,7 +41,7 @@ GTreeNode::~GTreeNode() if (_parent) _parent->removeChild(this); - CC_SAFE_RELEASE(_cell); + AX_SAFE_RELEASE(_cell); } bool GTreeNode::init(bool isFolder, const std::string& resURL) @@ -106,7 +106,7 @@ GTreeNode* GTreeNode::addChild(GTreeNode* child) GTreeNode* GTreeNode::addChildAt(GTreeNode* child, int index) { - CCASSERT(child != nullptr, "Argument must be non-nil"); + AXASSERT(child != nullptr, "Argument must be non-nil"); if (child->_parent == this) { @@ -136,7 +136,7 @@ GTreeNode* GTreeNode::addChildAt(GTreeNode* child, int index) void GTreeNode::removeChild(GTreeNode* child) { - CCASSERT(child != nullptr, "Argument must be non-nil"); + AXASSERT(child != nullptr, "Argument must be non-nil"); int childIndex = (int)_children.getIndex(child); if (childIndex != -1) @@ -145,7 +145,7 @@ void GTreeNode::removeChild(GTreeNode* child) void GTreeNode::removeChildAt(int index) { - CCASSERT(index >= 0 && index < _children.size(), "Invalid child index"); + AXASSERT(index >= 0 && index < _children.size(), "Invalid child index"); GTreeNode* child = _children.at(index); child->_parent = nullptr; @@ -170,7 +170,7 @@ void GTreeNode::removeChildren(int beginIndex, int endIndex) GTreeNode* GTreeNode::getChildAt(int index) const { - CCASSERT(index >= 0 && index < _children.size(), "Invalid child index"); + AXASSERT(index >= 0 && index < _children.size(), "Invalid child index"); return _children.at(index); } @@ -201,27 +201,27 @@ GTreeNode* GTreeNode::getNextSibling() const int GTreeNode::getChildIndex(const GTreeNode* child) const { - CCASSERT(child != nullptr, "Argument must be non-nil"); + AXASSERT(child != nullptr, "Argument must be non-nil"); return (int)_children.getIndex((GTreeNode*)child); } void GTreeNode::setChildIndex(GTreeNode* child, int index) { - CCASSERT(child != nullptr, "Argument must be non-nil"); + AXASSERT(child != nullptr, "Argument must be non-nil"); int oldIndex = (int)_children.getIndex(child); - CCASSERT(oldIndex != -1, "Not a child of this container"); + AXASSERT(oldIndex != -1, "Not a child of this container"); moveChild(child, oldIndex, index); } int GTreeNode::setChildIndexBefore(GTreeNode* child, int index) { - CCASSERT(child != nullptr, "Argument must be non-nil"); + AXASSERT(child != nullptr, "Argument must be non-nil"); int oldIndex = (int)_children.getIndex(child); - CCASSERT(oldIndex != -1, "Not a child of this container"); + AXASSERT(oldIndex != -1, "Not a child of this container"); if (oldIndex < index) return moveChild(child, oldIndex, index - 1); @@ -253,14 +253,14 @@ int GTreeNode::moveChild(GTreeNode* child, int oldIndex, int index) void GTreeNode::swapChildren(GTreeNode* child1, GTreeNode* child2) { - CCASSERT(child1 != nullptr, "Argument1 must be non-nil"); - CCASSERT(child2 != nullptr, "Argument2 must be non-nil"); + AXASSERT(child1 != nullptr, "Argument1 must be non-nil"); + AXASSERT(child2 != nullptr, "Argument2 must be non-nil"); int index1 = (int)_children.getIndex(child1); int index2 = (int)_children.getIndex(child2); - CCASSERT(index1 != -1, "Not a child of this container"); - CCASSERT(index2 != -1, "Not a child of this container"); + AXASSERT(index1 != -1, "Not a child of this container"); + AXASSERT(index2 != -1, "Not a child of this container"); swapChildrenAt(index1, index2); } diff --git a/extensions/fairygui/PackageItem.cpp b/extensions/fairygui/PackageItem.cpp index 5d2e53a0dd..f594d3d699 100644 --- a/extensions/fairygui/PackageItem.cpp +++ b/extensions/fairygui/PackageItem.cpp @@ -29,18 +29,18 @@ PackageItem::PackageItem() : owner(nullptr), PackageItem::~PackageItem() { - CC_SAFE_DELETE(scale9Grid); + AX_SAFE_DELETE(scale9Grid); - CC_SAFE_DELETE(rawData); + AX_SAFE_DELETE(rawData); if (bitmapFont) //bitmapfont will be released by fontatlas bitmapFont->releaseAtlas(); bitmapFont = nullptr; - CC_SAFE_RELEASE(animation); - CC_SAFE_RELEASE(texture); - CC_SAFE_RELEASE(spriteFrame); + AX_SAFE_RELEASE(animation); + AX_SAFE_RELEASE(texture); + AX_SAFE_RELEASE(spriteFrame); - CC_SAFE_DELETE(branches); - CC_SAFE_DELETE(highResolution); + AX_SAFE_DELETE(branches); + AX_SAFE_DELETE(highResolution); } void PackageItem::load() diff --git a/extensions/fairygui/PopupMenu.cpp b/extensions/fairygui/PopupMenu.cpp index 9f08af23a4..9c990478bd 100644 --- a/extensions/fairygui/PopupMenu.cpp +++ b/extensions/fairygui/PopupMenu.cpp @@ -32,7 +32,7 @@ PopupMenu::PopupMenu() : PopupMenu::~PopupMenu() { - CC_SAFE_RELEASE(_contentPane); + AX_SAFE_RELEASE(_contentPane); } bool PopupMenu::init(const std::string & resourceURL) @@ -43,14 +43,14 @@ bool PopupMenu::init(const std::string & resourceURL) url = UIConfig::popupMenu; if (url.empty()) { - CCLOGWARN("FairyGUI: UIConfig.popupMenu not defined"); + AXLOGWARN("FairyGUI: UIConfig.popupMenu not defined"); return false; } } _contentPane = UIPackage::createObjectFromURL(url)->as(); _contentPane->retain(); - _contentPane->addEventListener(UIEventType::Enter, CC_CALLBACK_1(PopupMenu::onEnter, this)); + _contentPane->addEventListener(UIEventType::Enter, AX_CALLBACK_1(PopupMenu::onEnter, this)); _list = _contentPane->getChild("list")->as(); _list->removeChildrenToPool(); @@ -59,7 +59,7 @@ bool PopupMenu::init(const std::string & resourceURL) _list->removeRelation(_contentPane, RelationType::Height); _contentPane->addRelation(_list, RelationType::Height); - _list->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(PopupMenu::onClickItem, this)); + _list->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(PopupMenu::onClickItem, this)); return true; } @@ -100,7 +100,7 @@ void PopupMenu::addSeperator() { if (UIConfig::popupMenu_seperator.empty()) { - CCLOGWARN("FairyGUI: UIConfig.popupMenu_seperator not defined"); + AXLOGWARN("FairyGUI: UIConfig.popupMenu_seperator not defined"); return; } diff --git a/extensions/fairygui/RelationItem.cpp b/extensions/fairygui/RelationItem.cpp index c0357c24a2..c0274b5889 100644 --- a/extensions/fairygui/RelationItem.cpp +++ b/extensions/fairygui/RelationItem.cpp @@ -544,8 +544,8 @@ void RelationItem::addRefTarget(GObject* target) return; if (target != _owner->_parent) - target->addEventListener(UIEventType::PositionChange, CC_CALLBACK_1(RelationItem::onTargetXYChanged, this), EventTag(this)); - target->addEventListener(UIEventType::SizeChange, CC_CALLBACK_1(RelationItem::onTargetSizeChanged, this), EventTag(this)); + target->addEventListener(UIEventType::PositionChange, AX_CALLBACK_1(RelationItem::onTargetXYChanged, this), EventTag(this)); + target->addEventListener(UIEventType::SizeChange, AX_CALLBACK_1(RelationItem::onTargetSizeChanged, this), EventTag(this)); _targetData.x = target->_position.x; _targetData.y = target->_position.y; diff --git a/extensions/fairygui/Relations.cpp b/extensions/fairygui/Relations.cpp index 793086b967..e7b53c96f0 100644 --- a/extensions/fairygui/Relations.cpp +++ b/extensions/fairygui/Relations.cpp @@ -23,7 +23,7 @@ void Relations::add(GObject * target, RelationType relationType) void Relations::add(GObject * target, RelationType relationType, bool usePercent) { - CCASSERT(target, "target is null"); + AXASSERT(target, "target is null"); for (auto it = _items.begin(); it != _items.end(); ++it) { diff --git a/extensions/fairygui/ScrollPane.cpp b/extensions/fairygui/ScrollPane.cpp index 29768e2867..232439582d 100644 --- a/extensions/fairygui/ScrollPane.cpp +++ b/extensions/fairygui/ScrollPane.cpp @@ -79,10 +79,10 @@ ScrollPane::ScrollPane(GComponent* owner) _container->removeFromParent(); _maskContainer->addChild(_container, 1); - _owner->addEventListener(UIEventType::MouseWheel, CC_CALLBACK_1(ScrollPane::onMouseWheel, this)); - _owner->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(ScrollPane::onTouchBegin, this)); - _owner->addEventListener(UIEventType::TouchMove, CC_CALLBACK_1(ScrollPane::onTouchMove, this)); - _owner->addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(ScrollPane::onTouchEnd, this)); + _owner->addEventListener(UIEventType::MouseWheel, AX_CALLBACK_1(ScrollPane::onMouseWheel, this)); + _owner->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(ScrollPane::onTouchBegin, this)); + _owner->addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(ScrollPane::onTouchMove, this)); + _owner->addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(ScrollPane::onTouchEnd, this)); _owner->addEventListener(UIEventType::Exit, [this](EventContext*) { if (_draggingPane == this) _draggingPane = nullptr; @@ -146,7 +146,7 @@ void ScrollPane::setup(ByteBuffer* buffer) if (scrollBarDisplay == ScrollBarDisplayType::DEFAULT) { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC scrollBarDisplay = UIConfig::defaultScrollBarDisplay; #else scrollBarDisplay = ScrollBarDisplayType::AUTO; @@ -162,7 +162,7 @@ void ScrollPane::setup(ByteBuffer* buffer) { _vtScrollBar = dynamic_cast(UIPackage::createObjectFromURL(res)); if (_vtScrollBar == nullptr) - CCLOGWARN("FairyGUI: cannot create scrollbar from %s", res.c_str()); + AXLOGWARN("FairyGUI: cannot create scrollbar from %s", res.c_str()); else { _vtScrollBar->retain(); @@ -179,7 +179,7 @@ void ScrollPane::setup(ByteBuffer* buffer) { _hzScrollBar = dynamic_cast(UIPackage::createObjectFromURL(res)); if (_hzScrollBar == nullptr) - CCLOGWARN("FairyGUI: cannot create scrollbar from %s", res.c_str()); + AXLOGWARN("FairyGUI: cannot create scrollbar from %s", res.c_str()); else { _hzScrollBar->retain(); @@ -198,8 +198,8 @@ void ScrollPane::setup(ByteBuffer* buffer) if (_hzScrollBar != nullptr) _hzScrollBar->setVisible(false); - _owner->addEventListener(UIEventType::RollOver, CC_CALLBACK_1(ScrollPane::onRollOver, this)); - _owner->addEventListener(UIEventType::RollOut, CC_CALLBACK_1(ScrollPane::onRollOut, this)); + _owner->addEventListener(UIEventType::RollOver, AX_CALLBACK_1(ScrollPane::onRollOver, this)); + _owner->addEventListener(UIEventType::RollOut, AX_CALLBACK_1(ScrollPane::onRollOut, this)); } } else @@ -209,7 +209,7 @@ void ScrollPane::setup(ByteBuffer* buffer) { _header = dynamic_cast(UIPackage::createObjectFromURL(headerRes)); if (_header == nullptr) - CCLOGWARN("FairyGUI: cannot create scrollPane header from %s", headerRes.c_str()); + AXLOGWARN("FairyGUI: cannot create scrollPane header from %s", headerRes.c_str()); else { _header->retain(); @@ -223,7 +223,7 @@ void ScrollPane::setup(ByteBuffer* buffer) { _footer = dynamic_cast(UIPackage::createObjectFromURL(footerRes)); if (_footer == nullptr) - CCLOGWARN("FairyGUI: cannot create scrollPane footer from %s", footerRes.c_str()); + AXLOGWARN("FairyGUI: cannot create scrollPane footer from %s", footerRes.c_str()); else { _footer->retain(); @@ -994,7 +994,7 @@ void ScrollPane::updateScrollBarVisible2(GScrollBar* bar) if (bar->isVisible()) GTween::to(1, 0, 0.5f) ->setDelay(0.5f) - ->onComplete1(CC_CALLBACK_1(ScrollPane::onBarTweenComplete, this)) + ->onComplete1(AX_CALLBACK_1(ScrollPane::onBarTweenComplete, this)) ->setTarget(bar, TweenPropType::Alpha); } else @@ -1221,7 +1221,7 @@ float ScrollPane::updateTargetAndDuration(float pos, int axis) { float v2 = std::abs(v) * _velocityScale; float ratio = 0; -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC if (v2 > 500) ratio = pow((v2 - 500) / 500, 2); #else @@ -1492,7 +1492,7 @@ void ScrollPane::onTouchMove(EventContext* context) Vec2 pt = _owner->globalToLocal(evt->getPosition()); int sensitivity; -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC sensitivity = 8; #else sensitivity = UIConfig::touchScrollSensitivity; diff --git a/extensions/fairygui/Transition.cpp b/extensions/fairygui/Transition.cpp index aa22215732..7b43fa232b 100644 --- a/extensions/fairygui/Transition.cpp +++ b/extensions/fairygui/Transition.cpp @@ -158,9 +158,9 @@ TweenConfig::TweenConfig() TweenConfig::~TweenConfig() { - CC_SAFE_DELETE(path); - CC_SAFE_DELETE(startValue); - CC_SAFE_DELETE(endValue); + AX_SAFE_DELETE(path); + AX_SAFE_DELETE(startValue); + AX_SAFE_DELETE(endValue); } class TransitionItem @@ -253,7 +253,7 @@ TransitionItem::~TransitionItem() delete tweenConfig; } - CC_SAFE_DELETE(value); + AX_SAFE_DELETE(value); } Transition::Transition(GComponent* owner) @@ -378,7 +378,7 @@ void Transition::play(int times, float delay, float startTime, float endTime, Pl if (delay == 0) onDelayedPlay(); else - GTween::delayedCall(delay)->setTarget(this)->onComplete(CC_CALLBACK_0(Transition::onDelayedPlay, this)); + GTween::delayedCall(delay)->setTarget(this)->onComplete(AX_CALLBACK_0(Transition::onDelayedPlay, this)); } void Transition::changePlayTimes(int value) @@ -867,9 +867,9 @@ void Transition::playItem(TransitionItem* item) ->setRepeat(item->tweenConfig->repeat, item->tweenConfig->yoyo) ->setTimeScale(_timeScale) ->setTargetAny(item) - ->onStart(CC_CALLBACK_1(Transition::onTweenStart, this)) - ->onUpdate(CC_CALLBACK_1(Transition::onTweenUpdate, this)) - ->onComplete1(CC_CALLBACK_1(Transition::onTweenComplete, this)); + ->onStart(AX_CALLBACK_1(Transition::onTweenStart, this)) + ->onUpdate(AX_CALLBACK_1(Transition::onTweenUpdate, this)) + ->onComplete1(AX_CALLBACK_1(Transition::onTweenComplete, this)); if (_endTime >= 0) item->tweener->setBreakpoint(_endTime - time); @@ -894,9 +894,9 @@ void Transition::playItem(TransitionItem* item) ->setDelay(time) ->setTimeScale(_timeScale) ->setTargetAny(item) - ->onStart(CC_CALLBACK_1(Transition::onTweenStart, this)) - ->onUpdate(CC_CALLBACK_1(Transition::onTweenUpdate, this)) - ->onComplete1(CC_CALLBACK_1(Transition::onTweenComplete, this)); + ->onStart(AX_CALLBACK_1(Transition::onTweenStart, this)) + ->onUpdate(AX_CALLBACK_1(Transition::onTweenUpdate, this)) + ->onComplete1(AX_CALLBACK_1(Transition::onTweenComplete, this)); if (_endTime >= 0) item->tweener->setBreakpoint(_endTime - item->time); @@ -922,7 +922,7 @@ void Transition::playItem(TransitionItem* item) item->tweener = GTween::delayedCall(time) ->setTimeScale(_timeScale) ->setTargetAny(item) - ->onComplete1(CC_CALLBACK_1(Transition::onDelayedPlayItem, this)); + ->onComplete1(AX_CALLBACK_1(Transition::onDelayedPlayItem, this)); } } diff --git a/extensions/fairygui/UIObjectFactory.cpp b/extensions/fairygui/UIObjectFactory.cpp index d80178c32b..66c7f45973 100644 --- a/extensions/fairygui/UIObjectFactory.cpp +++ b/extensions/fairygui/UIObjectFactory.cpp @@ -31,7 +31,7 @@ void UIObjectFactory::setPackageItemExtension(const string& url, GComponentCreat { if (url.size() == 0) { - CCLOG("Invaild url: %s", url.c_str()); + AXLOG("Invaild url: %s", url.c_str()); return; } PackageItem* pi = UIPackage::getItemByURL(url); diff --git a/extensions/fairygui/UIPackage.cpp b/extensions/fairygui/UIPackage.cpp index c5b5b3aa33..35cff5f664 100644 --- a/extensions/fairygui/UIPackage.cpp +++ b/extensions/fairygui/UIPackage.cpp @@ -108,7 +108,7 @@ UIPackage* UIPackage::addPackage(const string& assetPath) if (FileUtils::getInstance()->getContents(assetPath + ".fui", &data) != FileUtils::Status::OK) { - CCLOGERROR("FairyGUI: cannot load package from '%s'", assetPath.c_str()); + AXLOGERROR("FairyGUI: cannot load package from '%s'", assetPath.c_str()); return nullptr; } @@ -151,7 +151,7 @@ void UIPackage::removePackage(const string& packageIdOrName) pkg->release(); } else - CCLOGERROR("FairyGUI: invalid package name or id: %s", packageIdOrName.c_str()); + AXLOGERROR("FairyGUI: invalid package name or id: %s", packageIdOrName.c_str()); } void UIPackage::removeAllPackages() @@ -171,7 +171,7 @@ GObject* UIPackage::createObject(const string& pkgName, const string& resName) return pkg->createObject(resName); else { - CCLOGERROR("FairyGUI: package not found - %s", pkgName.c_str()); + AXLOGERROR("FairyGUI: package not found - %s", pkgName.c_str()); return nullptr; } } @@ -183,7 +183,7 @@ GObject* UIPackage::createObjectFromURL(const string& url) return pi->owner->createObject(pi); else { - CCLOGERROR("FairyGUI: resource not found - %s", url.c_str()); + AXLOGERROR("FairyGUI: resource not found - %s", url.c_str()); return nullptr; } } @@ -309,7 +309,7 @@ PackageItem* UIPackage::getItemByName(const string& itemName) GObject* UIPackage::createObject(const string& resName) { PackageItem* pi = getItemByName(resName); - CCASSERT(pi, StringUtils::format("FairyGUI: resource not found - %s in %s", + AXASSERT(pi, StringUtils::format("FairyGUI: resource not found - %s in %s", resName.c_str(), _name.c_str()) .c_str()); @@ -332,7 +332,7 @@ bool UIPackage::loadPackage(ByteBuffer* buffer) { if (buffer->readUint() != 0x46475549) { - CCLOGERROR("FairyGUI: old package format found in '%s'", _assetPath.c_str()); + AXLOGERROR("FairyGUI: old package format found in '%s'", _assetPath.c_str()); return false; } @@ -613,7 +613,7 @@ void UIPackage::loadAtlas(PackageItem* item) #if COCOS2D_VERSION < 0x00031702 Image::setPNGPremultipliedAlphaEnabled(true); #endif - CCLOGWARN("FairyGUI: texture '%s' not found in %s", item->file.c_str(), _name.c_str()); + AXLOGWARN("FairyGUI: texture '%s' not found in %s", item->file.c_str(), _name.c_str()); return; } #if COCOS2D_VERSION < 0x00031702 @@ -720,7 +720,7 @@ void UIPackage::loadMovieClip(PackageItem* item) Vector frames(frameCount); Size mcSizeInPixels = Size(item->width, item->height); - Size mcSize = CC_SIZE_PIXELS_TO_POINTS(mcSizeInPixels); + Size mcSize = AX_SIZE_PIXELS_TO_POINTS(mcSizeInPixels); AtlasSprite* sprite; SpriteFrame* spriteFrame; @@ -821,7 +821,7 @@ void UIPackage::loadFont(PackageItem* item) if (ttf) { Rect tempRect = Rect(bx + mainSprite->rect.origin.x, by + mainSprite->rect.origin.y, bw, bh); - tempRect = CC_RECT_PIXELS_TO_POINTS(tempRect); + tempRect = AX_RECT_PIXELS_TO_POINTS(tempRect); def.U = tempRect.origin.x; def.V = tempRect.origin.y; def.width = tempRect.size.width; @@ -848,7 +848,7 @@ void UIPackage::loadFont(PackageItem* item) getItemAsset(charImg); Rect tempRect = charImg->spriteFrame->getRectInPixels(); - tempRect = CC_RECT_PIXELS_TO_POINTS(tempRect); + tempRect = AX_RECT_PIXELS_TO_POINTS(tempRect); def.U = tempRect.origin.x; def.V = tempRect.origin.y; def.width = tempRect.size.width; diff --git a/extensions/fairygui/Window.cpp b/extensions/fairygui/Window.cpp index d62a0e921e..0ef2b3b9fd 100644 --- a/extensions/fairygui/Window.cpp +++ b/extensions/fairygui/Window.cpp @@ -23,18 +23,18 @@ Window::Window() : Window::~Window() { - CC_SAFE_RELEASE(_contentPane); - CC_SAFE_RELEASE(_frame); - CC_SAFE_RELEASE(_closeButton); - CC_SAFE_RELEASE(_dragArea); - CC_SAFE_RELEASE(_modalWaitPane); + AX_SAFE_RELEASE(_contentPane); + AX_SAFE_RELEASE(_frame); + AX_SAFE_RELEASE(_closeButton); + AX_SAFE_RELEASE(_dragArea); + AX_SAFE_RELEASE(_modalWaitPane); } void Window::handleInit() { GComponent::handleInit(); - addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(Window::onTouchBegin, this)); + addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(Window::onTouchBegin, this)); } void Window::setContentPane(GComponent* value) @@ -45,7 +45,7 @@ void Window::setContentPane(GComponent* value) { removeChild(_contentPane); - CC_SAFE_RELEASE(_frame); + AX_SAFE_RELEASE(_frame); _contentPane->release(); } _contentPane = value; @@ -82,7 +82,7 @@ void Window::setCloseButton(GObject * value) if (_closeButton != nullptr) { _closeButton->retain(); - _closeButton->addClickListener(CC_CALLBACK_1(Window::closeEventHandler, this), EventTag(this)); + _closeButton->addClickListener(AX_CALLBACK_1(Window::closeEventHandler, this), EventTag(this)); } } @@ -104,7 +104,7 @@ void Window::setDragArea(GObject * value) if (dynamic_cast(_dragArea) && ((GGraph*)_dragArea)->isEmpty()) ((GGraph*)_dragArea)->drawRect(_dragArea->getWidth(), _dragArea->getHeight(), 0, Color4F(0, 0, 0, 0), Color4F(0, 0, 0, 0)); _dragArea->setDraggable(true); - _dragArea->addEventListener(UIEventType::DragStart, CC_CALLBACK_1(Window::onDragStart, this), EventTag(this)); + _dragArea->addEventListener(UIEventType::DragStart, AX_CALLBACK_1(Window::onDragStart, this), EventTag(this)); } } } @@ -204,7 +204,7 @@ void Window::initWindow() IUISource* lib = _uiSources.at(i); if (!lib->isLoaded()) { - lib->load(CC_CALLBACK_0(Window::onUILoadComplete, this)); + lib->load(AX_CALLBACK_0(Window::onUILoadComplete, this)); _loading = true; } } diff --git a/extensions/fairygui/display/BitmapFont.h b/extensions/fairygui/display/BitmapFont.h index 478d5eff57..e6aff965ce 100644 --- a/extensions/fairygui/display/BitmapFont.h +++ b/extensions/fairygui/display/BitmapFont.h @@ -25,7 +25,7 @@ public: { if (_fontAtlas != fontAtlas) { - CC_SAFE_RELEASE(_fontAtlas); + AX_SAFE_RELEASE(_fontAtlas); _fontAtlas = fontAtlas; } return _fontAtlas; diff --git a/extensions/fairygui/display/FUIContainer.cpp b/extensions/fairygui/display/FUIContainer.cpp index 7d0b8a244d..c83b4856fb 100644 --- a/extensions/fairygui/display/FUIContainer.cpp +++ b/extensions/fairygui/display/FUIContainer.cpp @@ -7,13 +7,13 @@ NS_FGUI_BEGIN USING_NS_AX; #if COCOS2D_VERSION < 0x00040000 -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) -#define CC_CLIPPING_NODE_OPENGLES 0 +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +#define AX_CLIPPING_NODE_OPENGLES 0 #else -#define CC_CLIPPING_NODE_OPENGLES 1 +#define AX_CLIPPING_NODE_OPENGLES 1 #endif -#if CC_CLIPPING_NODE_OPENGLES +#if AX_CLIPPING_NODE_OPENGLES static void setProgram(Node *n, GLProgram *p) { n->setGLProgram(p); @@ -49,7 +49,7 @@ FUIContainer::FUIContainer() : FUIContainer::~FUIContainer() { - CC_SAFE_DELETE(_rectClippingSupport); + AX_SAFE_DELETE(_rectClippingSupport); if (_stencilClippingSupport) { if (_stencilClippingSupport->_stencil) @@ -57,7 +57,7 @@ FUIContainer::~FUIContainer() _stencilClippingSupport->_stencil->stopAllActions(); _stencilClippingSupport->_stencil->release(); } - CC_SAFE_DELETE(_stencilClippingSupport->_stencilStateManager); + AX_SAFE_DELETE(_stencilClippingSupport->_stencilStateManager); delete _stencilClippingSupport; } } @@ -121,7 +121,7 @@ void FUIContainer::setStencil(axis::Node * stencil) if (_stencilClippingSupport->_stencil == stencil) return; -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -130,7 +130,7 @@ void FUIContainer::setStencil(axis::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 (_stencilClippingSupport->_stencil != nullptr && _stencilClippingSupport->_stencil->isRunning()) @@ -138,11 +138,11 @@ void FUIContainer::setStencil(axis::Node * stencil) _stencilClippingSupport->_stencil->onExitTransitionDidStart(); _stencilClippingSupport->_stencil->onExit(); } - CC_SAFE_RELEASE_NULL(_stencilClippingSupport->_stencil); + AX_SAFE_RELEASE_NULL(_stencilClippingSupport->_stencil); //initialise new stencil _stencilClippingSupport->_stencil = stencil; - CC_SAFE_RETAIN(_stencilClippingSupport->_stencil); + AX_SAFE_RETAIN(_stencilClippingSupport->_stencil); if (_stencilClippingSupport->_stencil != nullptr && this->isRunning()) { _stencilClippingSupport->_stencil->onEnter(); @@ -180,7 +180,7 @@ void FUIContainer::setAlphaThreshold(float alphaThreshold) } } #else -#if CC_CLIPPING_NODE_OPENGLES +#if AX_CLIPPING_NODE_OPENGLES if (alphaThreshold == 1 && alphaThreshold != _stencilClippingSupport->_stencilStateManager->getAlphaThreshold()) { // should reset program used by _stencil @@ -211,7 +211,7 @@ void FUIContainer::setInverted(bool inverted) void FUIContainer::onEnter() { -#if CC_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 if (_scriptType == kScriptTypeJavascript) { if (ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnEnter)) @@ -230,7 +230,7 @@ void FUIContainer::onEnter() void FUIContainer::onEnterTransitionDidFinish() { -#if CC_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 if (_scriptType == kScriptTypeJavascript) { if (ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnEnterTransitionDidFinish)) @@ -248,7 +248,7 @@ void FUIContainer::onEnterTransitionDidFinish() void FUIContainer::onExitTransitionDidStart() { -#if CC_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 if (_scriptType == kScriptTypeJavascript) { if (ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnExitTransitionDidStart)) @@ -263,7 +263,7 @@ void FUIContainer::onExitTransitionDidStart() void FUIContainer::onExit() { -#if CC_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 if (_scriptType == kScriptTypeJavascript) { if (ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnExit)) @@ -381,7 +381,7 @@ void FUIContainer::visit(axis::Renderer * renderer, const axis::Mat4 & parentTra // 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 Director* director = Director::getInstance(); - 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); @@ -396,7 +396,7 @@ void FUIContainer::visit(axis::Renderer * renderer, const axis::Mat4 & parentTra _stencilClippingSupport->_stencilStateManager->onBeforeVisit(_globalZOrder); #else _stencilClippingSupport->_beforeVisitCmd.init(_globalZOrder); - _stencilClippingSupport->_beforeVisitCmd.func = CC_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilClippingSupport->_stencilStateManager); + _stencilClippingSupport->_beforeVisitCmd.func = AX_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilClippingSupport->_stencilStateManager); renderer->addCommand(&_stencilClippingSupport->_beforeVisitCmd); #endif @@ -409,9 +409,9 @@ void FUIContainer::visit(axis::Renderer * renderer, const axis::Mat4 & parentTra auto alphaLocation = programState->getUniformLocation("u_alpha_value"); programState->setUniform(alphaLocation, &alphaThreshold, sizeof(alphaThreshold)); setProgramStateRecursively(_stencilClippingSupport->_stencil, programState); - CC_SAFE_RELEASE_NULL(programState); + AX_SAFE_RELEASE_NULL(programState); #else -#if CC_CLIPPING_NODE_OPENGLES +#if AX_CLIPPING_NODE_OPENGLES // since glAlphaTest do not exists in OES, use a shader that writes // pixel only if greater than an alpha threshold GLProgram *program = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST_NO_MV); @@ -430,7 +430,7 @@ void FUIContainer::visit(axis::Renderer * renderer, const axis::Mat4 & parentTra auto afterDrawStencilCmd = renderer->nextCallbackCommand(); afterDrawStencilCmd->init(_globalZOrder); - afterDrawStencilCmd->func = CC_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilClippingSupport->_stencilStateManager); + afterDrawStencilCmd->func = AX_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilClippingSupport->_stencilStateManager); renderer->addCommand(afterDrawStencilCmd); int i = 0; @@ -463,7 +463,7 @@ void FUIContainer::visit(axis::Renderer * renderer, const axis::Mat4 & parentTra auto afterVisitCmd = renderer->nextCallbackCommand(); afterVisitCmd->init(_globalZOrder); - afterVisitCmd->func = CC_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilClippingSupport->_stencilStateManager); + afterVisitCmd->func = AX_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilClippingSupport->_stencilStateManager); renderer->addCommand(afterVisitCmd); renderer->popGroup(); @@ -483,14 +483,14 @@ void FUIContainer::visit(axis::Renderer * renderer, const axis::Mat4 & parentTra #endif auto beforeVisitCmdScissor = renderer->nextCallbackCommand(); beforeVisitCmdScissor->init(_globalZOrder); - beforeVisitCmdScissor->func = CC_CALLBACK_0(FUIContainer::onBeforeVisitScissor, this); + beforeVisitCmdScissor->func = AX_CALLBACK_0(FUIContainer::onBeforeVisitScissor, this); renderer->addCommand(beforeVisitCmdScissor); Node::visit(renderer, parentTransform, parentFlags); auto afterVisitCmdScissor = renderer->nextCallbackCommand(); afterVisitCmdScissor->init(_globalZOrder); - afterVisitCmdScissor->func = CC_CALLBACK_0(FUIContainer::onAfterVisitScissor, this); + afterVisitCmdScissor->func = AX_CALLBACK_0(FUIContainer::onAfterVisitScissor, this); renderer->addCommand(afterVisitCmdScissor); #if COCOS2D_VERSION >= 0x00040000 renderer->popGroup(); diff --git a/extensions/fairygui/display/FUIInput.cpp b/extensions/fairygui/display/FUIInput.cpp index 33a4f13e9e..278fce0767 100644 --- a/extensions/fairygui/display/FUIInput.cpp +++ b/extensions/fairygui/display/FUIInput.cpp @@ -17,7 +17,7 @@ FUIInput * FUIInput::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -91,7 +91,7 @@ void FUIInput::continueInit() //disable default behavior this->setTouchEnabled(false); - this->addTouchEventListener(CC_CALLBACK_2(FUIInput::_touchDownAction, this)); + this->addTouchEventListener(AX_CALLBACK_2(FUIInput::_touchDownAction, this)); } void FUIInput::_touchDownAction(axis::Ref *sender, axis::ui::Widget::TouchEventType controlEvent) diff --git a/extensions/fairygui/display/FUILabel.cpp b/extensions/fairygui/display/FUILabel.cpp index 6545e111d1..9786cf65dd 100644 --- a/extensions/fairygui/display/FUILabel.cpp +++ b/extensions/fairygui/display/FUILabel.cpp @@ -131,7 +131,7 @@ bool FUILabel::setBMFontFilePath(std::string_view bmfontFilePath, const Vec2& im if (std::abs(fontSize) < FLT_EPSILON) { float originalFontSize = bmFont->getOriginalFontSize(); - _bmFontSize = originalFontSize / CC_CONTENT_SCALE_FACTOR(); + _bmFontSize = originalFontSize / AX_CONTENT_SCALE_FACTOR(); } if (fontSize > 0.0f && bmFont->isResizable()) @@ -174,7 +174,7 @@ void FUILabel::updateBMFontScale() { BitmapFont* bmFont = (BitmapFont*)font; float originalFontSize = bmFont->getOriginalFontSize(); - _bmfontScale = _bmFontSize * CC_CONTENT_SCALE_FACTOR() / originalFontSize; + _bmfontScale = _bmFontSize * AX_CONTENT_SCALE_FACTOR() / originalFontSize; } else { diff --git a/extensions/fairygui/display/FUIRichText.cpp b/extensions/fairygui/display/FUIRichText.cpp index 762a6386bb..328c7f6a5d 100644 --- a/extensions/fairygui/display/FUIRichText.cpp +++ b/extensions/fairygui/display/FUIRichText.cpp @@ -15,7 +15,7 @@ USING_NS_AX; using namespace std; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_WINRT) #define strcasecmp _stricmp #endif @@ -50,7 +50,7 @@ static float getPaddingAmount(TextHAlignment alignment, const float leftOver) { case TextHAlignment::RIGHT: return leftOver; default: - CCASSERT(false, "invalid horizontal alignment!"); + AXASSERT(false, "invalid horizontal alignment!"); return 0.f; } } @@ -91,16 +91,16 @@ static std::string getSubStringOfUTF8String(const std::string& str, std::string: { std::u32string utf32; if (!StringUtils::UTF8ToUTF32(str, utf32)) { - CCLOGERROR("Can't convert string to UTF-32: %s", str.c_str()); + AXLOGERROR("Can't convert string to UTF-32: %s", str.c_str()); return ""; } if (utf32.size() < start) { - CCLOGERROR("'start' is out of range: %ld, %s", static_cast(start), str.c_str()); + AXLOGERROR("'start' is out of range: %ld, %s", static_cast(start), str.c_str()); return ""; } std::string result; if (!StringUtils::UTF32ToUTF8(utf32.substr(start, length), result)) { - CCLOGERROR("Can't convert internal UTF-32 string to UTF-8: %s", str.c_str()); + AXLOGERROR("Can't convert internal UTF-32 string to UTF-8: %s", str.c_str()); return ""; } return result; diff --git a/extensions/fairygui/display/FUISprite.cpp b/extensions/fairygui/display/FUISprite.cpp index 57ec625ed2..34fcef3468 100644 --- a/extensions/fairygui/display/FUISprite.cpp +++ b/extensions/fairygui/display/FUISprite.cpp @@ -23,14 +23,14 @@ FUISprite::FUISprite() FUISprite::~FUISprite() { - CC_SAFE_FREE(_vertexData); - CC_SAFE_FREE(_vertexIndex); + AX_SAFE_FREE(_vertexData); + AX_SAFE_FREE(_vertexIndex); } void FUISprite::clearContent() { setTexture(nullptr); - CC_SAFE_RELEASE_NULL(_spriteFrame); + AX_SAFE_RELEASE_NULL(_spriteFrame); setCenterRectNormalized(Rect(0, 0, 1, 1)); _empty = _texture; @@ -130,8 +130,8 @@ void FUISprite::setFillMethod(FillMethod value) setupFill(); else { - CC_SAFE_FREE(_vertexData); - CC_SAFE_FREE(_vertexIndex); + AX_SAFE_FREE(_vertexData); + AX_SAFE_FREE(_vertexIndex); } } } @@ -335,8 +335,8 @@ void FUISprite::updateRadial(void) if (_vertexDataCount != index + 3) { sameIndexCount = false; - CC_SAFE_FREE(_vertexData); - CC_SAFE_FREE(_vertexIndex); + AX_SAFE_FREE(_vertexData); + AX_SAFE_FREE(_vertexIndex); _vertexDataCount = 0; } @@ -346,7 +346,7 @@ void FUISprite::updateRadial(void) triangleCount = _vertexDataCount - 2; _vertexData = (V3F_C4B_T2F*)malloc(_vertexDataCount * sizeof(*_vertexData)); _vertexIndex = (unsigned short *)malloc(triangleCount * 3 * sizeof(*_vertexIndex)); - CCASSERT(_vertexData, "FUISprite. Not enough memory"); + AXASSERT(_vertexData, "FUISprite. Not enough memory"); } else { @@ -435,7 +435,7 @@ void FUISprite::updateBar(void) _vertexDataCount = 4; _vertexData = (V3F_C4B_T2F*)malloc(_vertexDataCount * sizeof(*_vertexData)); _vertexIndex = (unsigned short*)malloc(6 * sizeof(*_vertexIndex)); - CCASSERT(_vertexData, "FUISprite. Not enough memory"); + AXASSERT(_vertexData, "FUISprite. Not enough memory"); } // TOPLEFT _vertexData[0].texCoords = textureCoordFromAlphaPoint(Vec2(min.x, max.y)); @@ -497,7 +497,7 @@ void FUISprite::draw(axis::Renderer* renderer, const axis::Mat4& transform, uint setMVPMatrixUniform(); #endif -#if CC_USE_CULLING +#if AX_USE_CULLING // Don't calculate the culling if the transform was not updated auto visitingCamera = Camera::getVisitingCamera(); auto defaultCamera = Camera::getDefaultCamera(); diff --git a/extensions/fairygui/event/HitTest.cpp b/extensions/fairygui/event/HitTest.cpp index 44dc5b4ede..82eba39d77 100644 --- a/extensions/fairygui/event/HitTest.cpp +++ b/extensions/fairygui/event/HitTest.cpp @@ -15,7 +15,7 @@ PixelHitTestData::PixelHitTestData() : PixelHitTestData::~PixelHitTestData() { - CC_SAFE_DELETE(pixels); + AX_SAFE_DELETE(pixels); } void PixelHitTestData::load(ByteBuffer* buffer) diff --git a/extensions/fairygui/event/InputProcessor.cpp b/extensions/fairygui/event/InputProcessor.cpp index d002656a03..809446057f 100644 --- a/extensions/fairygui/event/InputProcessor.cpp +++ b/extensions/fairygui/event/InputProcessor.cpp @@ -45,42 +45,42 @@ InputProcessor::InputProcessor(GComponent* owner) : _owner = owner; _recentInput._inputProcessor = this; -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC _mouseListener = EventListenerMouse::create(); - CC_SAFE_RETAIN(_mouseListener); - _mouseListener->onMouseDown = CC_CALLBACK_1(InputProcessor::onMouseDown, this); - _mouseListener->onMouseUp = CC_CALLBACK_1(InputProcessor::onMouseUp, this); - _mouseListener->onMouseMove = CC_CALLBACK_1(InputProcessor::onMouseMove, this); - _mouseListener->onMouseScroll = CC_CALLBACK_1(InputProcessor::onMouseScroll, this); + AX_SAFE_RETAIN(_mouseListener); + _mouseListener->onMouseDown = AX_CALLBACK_1(InputProcessor::onMouseDown, this); + _mouseListener->onMouseUp = AX_CALLBACK_1(InputProcessor::onMouseUp, this); + _mouseListener->onMouseMove = AX_CALLBACK_1(InputProcessor::onMouseMove, this); + _mouseListener->onMouseScroll = AX_CALLBACK_1(InputProcessor::onMouseScroll, this); _owner->displayObject()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(_mouseListener, _owner->displayObject()); #endif _touchListener = EventListenerTouchOneByOne::create(); - CC_SAFE_RETAIN(_touchListener); + AX_SAFE_RETAIN(_touchListener); _touchListener->setSwallowTouches(false); - _touchListener->onTouchBegan = CC_CALLBACK_2(InputProcessor::onTouchBegan, this); - _touchListener->onTouchMoved = CC_CALLBACK_2(InputProcessor::onTouchMoved, this); - _touchListener->onTouchEnded = CC_CALLBACK_2(InputProcessor::onTouchEnded, this); - _touchListener->onTouchCancelled = CC_CALLBACK_2(InputProcessor::onTouchCancelled, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(InputProcessor::onTouchBegan, this); + _touchListener->onTouchMoved = AX_CALLBACK_2(InputProcessor::onTouchMoved, this); + _touchListener->onTouchEnded = AX_CALLBACK_2(InputProcessor::onTouchEnded, this); + _touchListener->onTouchCancelled = AX_CALLBACK_2(InputProcessor::onTouchCancelled, this); _owner->displayObject()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(_touchListener, _owner->displayObject()); _keyboardListener = EventListenerKeyboard::create(); - CC_SAFE_RETAIN(_keyboardListener); - _keyboardListener->onKeyPressed = CC_CALLBACK_2(InputProcessor::onKeyDown, this); - _keyboardListener->onKeyReleased = CC_CALLBACK_2(InputProcessor::onKeyUp, this); + AX_SAFE_RETAIN(_keyboardListener); + _keyboardListener->onKeyPressed = AX_CALLBACK_2(InputProcessor::onKeyDown, this); + _keyboardListener->onKeyReleased = AX_CALLBACK_2(InputProcessor::onKeyUp, this); _owner->displayObject()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(_keyboardListener, _owner->displayObject()); } InputProcessor::~InputProcessor() { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC _owner->displayObject()->getEventDispatcher()->removeEventListener(_mouseListener); #endif _owner->displayObject()->getEventDispatcher()->removeEventListener(_touchListener); _owner->displayObject()->getEventDispatcher()->removeEventListener(_keyboardListener); - CC_SAFE_RELEASE_NULL(_touchListener); - CC_SAFE_RELEASE_NULL(_mouseListener); - CC_SAFE_RELEASE_NULL(_keyboardListener); + AX_SAFE_RELEASE_NULL(_touchListener); + AX_SAFE_RELEASE_NULL(_mouseListener); + AX_SAFE_RELEASE_NULL(_keyboardListener); for (auto &ti : _touches) delete ti; @@ -475,7 +475,7 @@ void InputProcessor::onTouchEnded(Touch *touch, Event* /*unusedEvent*/) target = wptr.ptr(); } -#ifndef CC_PLATFORM_PC +#ifndef AX_PLATFORM_PC //on mobile platform, trigger RollOut on up event, but not on PC handleRollOver(ti, nullptr); #else diff --git a/extensions/fairygui/gears/GearBase.cpp b/extensions/fairygui/gears/GearBase.cpp index 6fe7386f85..f56a35be06 100644 --- a/extensions/fairygui/gears/GearBase.cpp +++ b/extensions/fairygui/gears/GearBase.cpp @@ -76,7 +76,7 @@ GearBase::~GearBase() { if (_tweenConfig && _tweenConfig->_tweener) _tweenConfig->_tweener->kill(); - CC_SAFE_DELETE(_tweenConfig); + AX_SAFE_DELETE(_tweenConfig); } void GearBase::setController(GController* value) diff --git a/extensions/fairygui/gears/GearColor.cpp b/extensions/fairygui/gears/GearColor.cpp index 6afaa3f9a3..e238ce5629 100644 --- a/extensions/fairygui/gears/GearColor.cpp +++ b/extensions/fairygui/gears/GearColor.cpp @@ -86,8 +86,8 @@ void GearColor::apply() ->setDelay(_tweenConfig->delay) ->setEase(_tweenConfig->easeType) ->setTargetAny(this) - ->onUpdate(CC_CALLBACK_1(GearColor::onTweenUpdate, this)) - ->onComplete(CC_CALLBACK_0(GearColor::onTweenComplete, this)); + ->onUpdate(AX_CALLBACK_1(GearColor::onTweenUpdate, this)) + ->onComplete(AX_CALLBACK_0(GearColor::onTweenComplete, this)); } } else diff --git a/extensions/fairygui/gears/GearLook.cpp b/extensions/fairygui/gears/GearLook.cpp index 472d1de754..369c8204b4 100644 --- a/extensions/fairygui/gears/GearLook.cpp +++ b/extensions/fairygui/gears/GearLook.cpp @@ -87,8 +87,8 @@ void GearLook::apply() ->setEase(_tweenConfig->easeType) ->setTargetAny(this) ->setUserData(Value((a ? 1 : 0) + (b ? 2 : 0))) - ->onUpdate(CC_CALLBACK_1(GearLook::onTweenUpdate, this)) - ->onComplete(CC_CALLBACK_0(GearLook::onTweenComplete, this)); + ->onUpdate(AX_CALLBACK_1(GearLook::onTweenUpdate, this)) + ->onComplete(AX_CALLBACK_0(GearLook::onTweenComplete, this)); } } else diff --git a/extensions/fairygui/gears/GearSize.cpp b/extensions/fairygui/gears/GearSize.cpp index 6f99a371c8..0770938eff 100644 --- a/extensions/fairygui/gears/GearSize.cpp +++ b/extensions/fairygui/gears/GearSize.cpp @@ -70,8 +70,8 @@ void GearSize::apply() ->setEase(_tweenConfig->easeType) ->setTargetAny(this) ->setUserData(Value((a ? 1 : 0) + (b ? 2 : 0))) - ->onUpdate(CC_CALLBACK_1(GearSize::onTweenUpdate, this)) - ->onComplete(CC_CALLBACK_0(GearSize::onTweenComplete, this)); + ->onUpdate(AX_CALLBACK_1(GearSize::onTweenUpdate, this)) + ->onComplete(AX_CALLBACK_0(GearSize::onTweenComplete, this)); } } else diff --git a/extensions/fairygui/gears/GearXY.cpp b/extensions/fairygui/gears/GearXY.cpp index 4f312e3f28..d5dc5b89b0 100644 --- a/extensions/fairygui/gears/GearXY.cpp +++ b/extensions/fairygui/gears/GearXY.cpp @@ -94,8 +94,8 @@ void GearXY::apply() ->setDelay(_tweenConfig->delay) ->setEase(_tweenConfig->easeType) ->setTargetAny(this) - ->onUpdate(CC_CALLBACK_1(GearXY::onTweenUpdate, this)) - ->onComplete(CC_CALLBACK_0(GearXY::onTweenComplete, this)); + ->onUpdate(AX_CALLBACK_1(GearXY::onTweenUpdate, this)) + ->onComplete(AX_CALLBACK_0(GearXY::onTweenComplete, this)); } } else diff --git a/extensions/fairygui/tween/GTweener.cpp b/extensions/fairygui/tween/GTweener.cpp index 4125f1c743..cc26b596ff 100644 --- a/extensions/fairygui/tween/GTweener.cpp +++ b/extensions/fairygui/tween/GTweener.cpp @@ -78,7 +78,7 @@ GTweener* GTweener::setSnapping(bool value) GTweener* GTweener::setTargetAny(void* value) { - CC_SAFE_RELEASE(_refTarget); + AX_SAFE_RELEASE(_refTarget); _refTarget = nullptr; _target = value; return this; @@ -91,10 +91,10 @@ GTweener* GTweener::setTarget(axis::Ref* value) GTweener* GTweener::setTarget(axis::Ref* target, TweenPropType propType) { - CC_SAFE_RELEASE(_refTarget); + AX_SAFE_RELEASE(_refTarget); _target = _refTarget = target; _propType = propType; - CC_SAFE_RETAIN(_refTarget); + AX_SAFE_RETAIN(_refTarget); return this; } @@ -278,7 +278,7 @@ void GTweener::_init() void GTweener::_reset() { - CC_SAFE_RELEASE(_refTarget); + AX_SAFE_RELEASE(_refTarget); _target = nullptr; _refTarget = nullptr; _userData = nullptr; diff --git a/extensions/fairygui/utils/html/HtmlObject.cpp b/extensions/fairygui/utils/html/HtmlObject.cpp index 14b5df0854..6e928725a0 100644 --- a/extensions/fairygui/utils/html/HtmlObject.cpp +++ b/extensions/fairygui/utils/html/HtmlObject.cpp @@ -36,7 +36,7 @@ HtmlObject::~HtmlObject() } } - CC_SAFE_RELEASE(_ui); + AX_SAFE_RELEASE(_ui); } void HtmlObject::create(FUIRichText* owner, HtmlElement* element) @@ -143,7 +143,7 @@ void HtmlObject::createButton() else { _ui = GComponent::create(); - CCLOGWARN("Set HtmlObject.buttonResource first"); + AXLOGWARN("Set HtmlObject.buttonResource first"); } _ui->retain(); @@ -168,7 +168,7 @@ void HtmlObject::createInput() else { _ui = GComponent::create(); - CCLOGWARN("Set HtmlObject.inputResource first"); + AXLOGWARN("Set HtmlObject.inputResource first"); } _ui->retain(); @@ -211,7 +211,7 @@ void HtmlObject::createSelect() else { _ui = GComponent::create(); - CCLOGWARN("Set HtmlObject.selectResource first"); + AXLOGWARN("Set HtmlObject.selectResource first"); } _ui->retain(); diff --git a/extensions/fairygui/utils/html/HtmlParser.cpp b/extensions/fairygui/utils/html/HtmlParser.cpp index cee83ccd3e..8f834b1105 100644 --- a/extensions/fairygui/utils/html/HtmlParser.cpp +++ b/extensions/fairygui/utils/html/HtmlParser.cpp @@ -12,7 +12,7 @@ USING_NS_AX; using namespace std; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_WINRT) #define strcasecmp _stricmp #endif diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.cpp b/extensions/physics-nodes/CCPhysicsDebugNode.cpp index b46d4b454f..74a1834ad9 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.cpp +++ b/extensions/physics-nodes/CCPhysicsDebugNode.cpp @@ -114,7 +114,7 @@ static void DrawShape(cpShape* shape, DrawNode* renderer) renderer->drawPolygon(pPoints, num, color, 1.0, line); } - CC_SAFE_DELETE_ARRAY(pPoints); + AX_SAFE_DELETE_ARRAY(pPoints); } break; default: @@ -205,7 +205,7 @@ static void DrawConstraint(cpConstraint* constraint, DrawNode* renderer) } else { - CCLOG("Cannot draw constraint"); + AXLOG("Cannot draw constraint"); } } diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.h b/extensions/physics-nodes/CCPhysicsDebugNode.h index 832eed84ac..f688fe3c38 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.h +++ b/extensions/physics-nodes/CCPhysicsDebugNode.h @@ -43,7 +43,7 @@ NS_AX_EXT_BEGIN * @lua NA */ -class CC_EX_DLL PhysicsDebugNode : public DrawNode +class AX_EX_DLL PhysicsDebugNode : public DrawNode { public: diff --git a/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.cpp b/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.cpp index d2f7852749..79ded5910b 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.cpp +++ b/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.cpp @@ -68,7 +68,7 @@ void PhysicsDebugNodeBox2D::DrawSolidPolygon(const b2Vec2* verts, int vertexCoun void PhysicsDebugNodeBox2D::DrawCircle(const b2Vec2& center, float radius, const b2Color& color) { drawBP->drawCircle(Vec2(center.x * mRatio, center.y * mRatio) + debugNodeOffset, radius * mRatio, - CC_DEGREES_TO_RADIANS(0), 30, true, 1.0f, 1.0f, Color4F(color.r, color.g, color.b, color.a)); + AX_DEGREES_TO_RADIANS(0), 30, true, 1.0f, 1.0f, Color4F(color.r, color.g, color.b, color.a)); } void PhysicsDebugNodeBox2D::DrawSolidCircle(const b2Vec2& center, @@ -77,7 +77,7 @@ void PhysicsDebugNodeBox2D::DrawSolidCircle(const b2Vec2& center, const b2Color& color) { Vec2 c = {Vec2(center.x * mRatio, center.y * mRatio) + debugNodeOffset}; - drawBP->drawSolidCircle(c, radius * mRatio, CC_DEGREES_TO_RADIANS(0), 20, 1.0f, 1.0f, + drawBP->drawSolidCircle(c, radius * mRatio, AX_DEGREES_TO_RADIANS(0), 20, 1.0f, 1.0f, Color4F(color.r / 2, color.g / 2, color.b / 2, color.a), 0.4f, Color4F(color.r, color.g, color.b, color.a)); diff --git a/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.h b/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.h index be3f13d66f..e74713d1c9 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.h +++ b/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.h @@ -29,7 +29,7 @@ NS_AX_EXT_BEGIN // This class implements debug drawing callbacks that are invoked inside b2World::Step. -class CC_EX_DLL PhysicsDebugNodeBox2D : public b2Draw +class AX_EX_DLL PhysicsDebugNodeBox2D : public b2Draw { public: PhysicsDebugNodeBox2D(); diff --git a/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.cpp b/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.cpp index 3345623f9d..4057c27b0d 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.cpp +++ b/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.cpp @@ -116,7 +116,7 @@ static void DrawShape(cpShape* shape, DrawNode* renderer) renderer->drawPolygon(pPoints, num, color, 1.0, line); } - CC_SAFE_DELETE_ARRAY(pPoints); + AX_SAFE_DELETE_ARRAY(pPoints); } break; default: @@ -207,7 +207,7 @@ static void DrawConstraint(cpConstraint* constraint, DrawNode* renderer) } else { - CCLOG("Cannot draw constraint"); + AXLOG("Cannot draw constraint"); } } diff --git a/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.h b/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.h index 6f4f9374a9..364a25e89f 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.h +++ b/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.h @@ -45,7 +45,7 @@ extern Vec2 physicsDebugNodeOffset; * @lua NA */ -class CC_EX_DLL PhysicsDebugNodeChipmunk2D : public DrawNode +class AX_EX_DLL PhysicsDebugNodeChipmunk2D : public DrawNode { public: diff --git a/extensions/physics-nodes/CCPhysicsSprite.cpp b/extensions/physics-nodes/CCPhysicsSprite.cpp index 0ec61d3141..79dba182dd 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.cpp +++ b/extensions/physics-nodes/CCPhysicsSprite.cpp @@ -26,11 +26,11 @@ #include "base/CCDirector.h" #include "base/CCEventDispatcher.h" -#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) +#if (AX_ENABLE_CHIPMUNK_INTEGRATION || AX_ENABLE_BOX2D_INTEGRATION) -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION # include "chipmunk/chipmunk.h" -# elif CC_ENABLE_BOX2D_INTEGRATION +# elif AX_ENABLE_BOX2D_INTEGRATION # include "box2d/box2d.h" # endif @@ -49,7 +49,7 @@ PhysicsSprite* PhysicsSprite::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -64,7 +64,7 @@ PhysicsSprite* PhysicsSprite::createWithTexture(Texture2D* pTexture) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -79,7 +79,7 @@ PhysicsSprite* PhysicsSprite::createWithTexture(Texture2D* pTexture, const Rect& } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -94,7 +94,7 @@ PhysicsSprite* PhysicsSprite::createWithSpriteFrame(SpriteFrame* pSpriteFrame) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -109,7 +109,7 @@ PhysicsSprite* PhysicsSprite::createWithSpriteFrameName(const char* pszSpriteFra } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -124,7 +124,7 @@ PhysicsSprite* PhysicsSprite::create(const char* pszFileName) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -139,7 +139,7 @@ PhysicsSprite* PhysicsSprite::create(const char* pszFileName, const Rect& rect) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -202,60 +202,60 @@ Vec3 PhysicsSprite::getPosition3D() const cpBody* PhysicsSprite::getCPBody() const { -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION return _CPBody; # else - CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); + AXASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); return nullptr; # endif } void PhysicsSprite::setCPBody(cpBody* pBody) { -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION _CPBody = pBody; # else - CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); + AXASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); # endif } b2Body* PhysicsSprite::getB2Body() const { -# if CC_ENABLE_BOX2D_INTEGRATION +# if AX_ENABLE_BOX2D_INTEGRATION return _pB2Body; # else - CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); + AXASSERT(false, "Can't call box2d methods when Box2d is disabled"); return nullptr; # endif } void PhysicsSprite::setB2Body(b2Body* pBody) { -# if CC_ENABLE_BOX2D_INTEGRATION +# if AX_ENABLE_BOX2D_INTEGRATION _pB2Body = pBody; # else - CC_UNUSED_PARAM(pBody); - CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); + AX_UNUSED_PARAM(pBody); + AXASSERT(false, "Can't call box2d methods when Box2d is disabled"); # endif } float PhysicsSprite::getPTMRatio() const { -# if CC_ENABLE_BOX2D_INTEGRATION +# if AX_ENABLE_BOX2D_INTEGRATION return _PTMRatio; # else - CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); + AXASSERT(false, "Can't call box2d methods when Box2d is disabled"); return 0; # endif } void PhysicsSprite::setPTMRatio(float fRatio) { -# if CC_ENABLE_BOX2D_INTEGRATION +# if AX_ENABLE_BOX2D_INTEGRATION _PTMRatio = fRatio; # else - CC_UNUSED_PARAM(fRatio); - CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); + AX_UNUSED_PARAM(fRatio); + AXASSERT(false, "Can't call box2d methods when Box2d is disabled"); # endif } @@ -266,12 +266,12 @@ void PhysicsSprite::setPTMRatio(float fRatio) const Vec2& PhysicsSprite::getPosFromPhysics() const { static Vec2 s_physicPosion; -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION cpVect cpPos = cpBodyGetPosition(_CPBody); s_physicPosion = Vec2(cpPos.x, cpPos.y); -# elif CC_ENABLE_BOX2D_INTEGRATION +# elif AX_ENABLE_BOX2D_INTEGRATION b2Vec2 pos = _pB2Body->GetPosition(); float x = pos.x * _PTMRatio; @@ -283,12 +283,12 @@ const Vec2& PhysicsSprite::getPosFromPhysics() const void PhysicsSprite::setPosition(float x, float y) { -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION cpVect cpPos = cpv(x, y); cpBodySetPosition(_CPBody, cpPos); -# elif CC_ENABLE_BOX2D_INTEGRATION +# elif AX_ENABLE_BOX2D_INTEGRATION float angle = _pB2Body->GetAngle(); _pB2Body->SetTransform(b2Vec2(x / _PTMRatio, y / _PTMRatio), angle); @@ -317,13 +317,13 @@ void PhysicsSprite::setPosition3D(const Vec3& position) float PhysicsSprite::getRotation() const { -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION - return (_ignoreBodyRotation ? Sprite::getRotation() : -CC_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); + return (_ignoreBodyRotation ? Sprite::getRotation() : -AX_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); -# elif CC_ENABLE_BOX2D_INTEGRATION +# elif AX_ENABLE_BOX2D_INTEGRATION - return (_ignoreBodyRotation ? Sprite::getRotation() : CC_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); + return (_ignoreBodyRotation ? Sprite::getRotation() : AX_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); # else return 0.0f; # endif @@ -336,17 +336,17 @@ void PhysicsSprite::setRotation(float fRotation) Sprite::setRotation(fRotation); } -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION else { - cpBodySetAngle(_CPBody, -CC_DEGREES_TO_RADIANS(fRotation)); + cpBodySetAngle(_CPBody, -AX_DEGREES_TO_RADIANS(fRotation)); } -# elif CC_ENABLE_BOX2D_INTEGRATION +# elif AX_ENABLE_BOX2D_INTEGRATION else { b2Vec2 p = _pB2Body->GetPosition(); - float radians = CC_DEGREES_TO_RADIANS(fRotation); + float radians = AX_DEGREES_TO_RADIANS(fRotation); _pB2Body->SetTransform(p, radians); } # endif @@ -358,9 +358,9 @@ void PhysicsSprite::syncPhysicsTransform() const // the sprite is animated (scaled up/down) using actions. // For more info see: http://www.cocos2d-iphone.org/forum/topic/68990 -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION - cpVect rot = (_ignoreBodyRotation ? cpvforangle(-CC_DEGREES_TO_RADIANS(_rotationX)) : cpBodyGetRotation(_CPBody)); + cpVect rot = (_ignoreBodyRotation ? cpvforangle(-AX_DEGREES_TO_RADIANS(_rotationX)) : cpBodyGetRotation(_CPBody)); float x = cpBodyGetPosition(_CPBody).x + rot.x * -_anchorPointInPoints.x * _scaleX - rot.y * -_anchorPointInPoints.y * _scaleY; float y = cpBodyGetPosition(_CPBody).y + rot.y * -_anchorPointInPoints.x * _scaleX + @@ -391,7 +391,7 @@ void PhysicsSprite::syncPhysicsTransform() const _transform.set(mat); -# elif CC_ENABLE_BOX2D_INTEGRATION +# elif AX_ENABLE_BOX2D_INTEGRATION b2Vec2 pos = _pB2Body->GetPosition(); @@ -467,4 +467,4 @@ void PhysicsSprite::afterUpdate(EventCustom* /*event*/) NS_AX_EXT_END -#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION +#endif // AX_ENABLE_CHIPMUNK_INTEGRATION || AX_ENABLE_BOX2D_INTEGRATION diff --git a/extensions/physics-nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h index 16a0eb49b0..a931d73b36 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.h +++ b/extensions/physics-nodes/CCPhysicsSprite.h @@ -30,7 +30,7 @@ #include "extensions/ExtensionExport.h" #include "base/CCEventListenerCustom.h" -#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) +#if (AX_ENABLE_CHIPMUNK_INTEGRATION || AX_ENABLE_BOX2D_INTEGRATION) struct cpBody; class b2Body; @@ -39,9 +39,9 @@ NS_AX_EXT_BEGIN /** A Sprite subclass that is bound to a physics body. It works with: - - Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined - - Objective-Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined - - Box2d: Preprocessor macro CC_ENABLE_BOX2D_INTEGRATION should be defined + - Chipmunk: Preprocessor macro AX_ENABLE_CHIPMUNK_INTEGRATION should be defined + - Objective-Chipmunk: Preprocessor macro AX_ENABLE_CHIPMUNK_INTEGRATION should be defined + - Box2d: Preprocessor macro AX_ENABLE_BOX2D_INTEGRATION should be defined Features and Limitations: - Scale and Skew properties are ignored. @@ -50,7 +50,7 @@ NS_AX_EXT_BEGIN - You can't enble both Chipmunk support and Box2d support at the same time. Only one can be enabled at compile time * @lua NA */ -class CC_EX_DLL PhysicsSprite : public Sprite +class AX_EX_DLL PhysicsSprite : public Sprite { public: static PhysicsSprite* create(); @@ -149,6 +149,6 @@ protected: NS_AX_EXT_END -#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION +#endif // AX_ENABLE_CHIPMUNK_INTEGRATION || AX_ENABLE_BOX2D_INTEGRATION #endif // __PHYSICSNODES_CCPHYSICSSPRITE_H__ diff --git a/extensions/physics-nodes/CCPhysicsSpriteBox2D.cpp b/extensions/physics-nodes/CCPhysicsSpriteBox2D.cpp index 6add6591cb..604d58d8a4 100644 --- a/extensions/physics-nodes/CCPhysicsSpriteBox2D.cpp +++ b/extensions/physics-nodes/CCPhysicsSpriteBox2D.cpp @@ -43,7 +43,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -58,7 +58,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::createWithTexture(Texture2D* pTexture) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -73,7 +73,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::createWithTexture(Texture2D* pTexture, c } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -88,7 +88,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::createWithSpriteFrame(SpriteFrame* pSpri } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -103,7 +103,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::createWithSpriteFrameName(const char* ps } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -118,7 +118,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::create(const char* pszFileName) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -133,7 +133,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::create(const char* pszFileName, const Re } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -254,7 +254,7 @@ void PhysicsSpriteBox2D::setPosition3D(const Vec3& position) float PhysicsSpriteBox2D::getRotation() const { - return (_ignoreBodyRotation ? Sprite::getRotation() : CC_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); + return (_ignoreBodyRotation ? Sprite::getRotation() : AX_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); } void PhysicsSpriteBox2D::setRotation(float fRotation) @@ -267,7 +267,7 @@ void PhysicsSpriteBox2D::setRotation(float fRotation) else { b2Vec2 p = _pB2Body->GetPosition(); - float radians = CC_DEGREES_TO_RADIANS(fRotation); + float radians = AX_DEGREES_TO_RADIANS(fRotation); _pB2Body->SetTransform(p, radians); } } diff --git a/extensions/physics-nodes/CCPhysicsSpriteBox2D.h b/extensions/physics-nodes/CCPhysicsSpriteBox2D.h index 5a39e38263..2f4a0e83c0 100644 --- a/extensions/physics-nodes/CCPhysicsSpriteBox2D.h +++ b/extensions/physics-nodes/CCPhysicsSpriteBox2D.h @@ -45,7 +45,7 @@ NS_AX_EXT_BEGIN - You can't enble both Chipmunk support and Box2d support at the same time. Only one can be enabled at compile time * @lua NA */ -class CC_EX_DLL PhysicsSpriteBox2D : public Sprite +class AX_EX_DLL PhysicsSpriteBox2D : public Sprite { public: static PhysicsSpriteBox2D* create(); diff --git a/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.cpp b/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.cpp index a5e21a679f..8b911b7112 100644 --- a/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.cpp +++ b/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.cpp @@ -43,7 +43,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -58,7 +58,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::createWithTexture(Texture2D* p } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -73,7 +73,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::createWithTexture(Texture2D* p } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -88,7 +88,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::createWithSpriteFrame(SpriteFr } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -103,7 +103,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::createWithSpriteFrameName(cons } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -118,7 +118,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::create(const char* pszFileName } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -133,7 +133,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::create(const char* pszFileName } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -246,7 +246,7 @@ void PhysicsSpriteChipmunk2D::setPosition3D(const Vec3& position) float PhysicsSpriteChipmunk2D::getRotation() const { - return (_ignoreBodyRotation ? Sprite::getRotation() : -CC_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); + return (_ignoreBodyRotation ? Sprite::getRotation() : -AX_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); } void PhysicsSpriteChipmunk2D::setRotation(float fRotation) @@ -257,7 +257,7 @@ void PhysicsSpriteChipmunk2D::setRotation(float fRotation) } else { - cpBodySetAngle(_CPBody, -CC_DEGREES_TO_RADIANS(fRotation)); + cpBodySetAngle(_CPBody, -AX_DEGREES_TO_RADIANS(fRotation)); } } @@ -267,7 +267,7 @@ void PhysicsSpriteChipmunk2D::syncPhysicsTransform() const // the sprite is animated (scaled up/down) using actions. // For more info see: http://www.cocos2d-iphone.org/forum/topic/68990 - cpVect rot = (_ignoreBodyRotation ? cpvforangle(-CC_DEGREES_TO_RADIANS(_rotationX)) : cpBodyGetRotation(_CPBody)); + cpVect rot = (_ignoreBodyRotation ? cpvforangle(-AX_DEGREES_TO_RADIANS(_rotationX)) : cpBodyGetRotation(_CPBody)); float x = cpBodyGetPosition(_CPBody).x + rot.x * -_anchorPointInPoints.x * _scaleX - rot.y * -_anchorPointInPoints.y * _scaleY; float y = cpBodyGetPosition(_CPBody).y + rot.y * -_anchorPointInPoints.x * _scaleX + diff --git a/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.h b/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.h index d948a02fee..6962b09a3c 100644 --- a/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.h +++ b/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.h @@ -45,7 +45,7 @@ NS_AX_EXT_BEGIN - You can't enble both Chipmunk support and Box2d support at the same time. Only one can be enabled at compile time * @lua NA */ -class CC_EX_DLL PhysicsSpriteChipmunk2D : public Sprite +class AX_EX_DLL PhysicsSpriteChipmunk2D : public Sprite { public: static PhysicsSpriteChipmunk2D* create(); diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.cpp b/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.cpp index b8c2ed63bc..2958fead41 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/lua-bindings/auto/lua_axis_audioengine_auto.hpp" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX #include "audio/AudioEngine.h" #include "scripting/lua-bindings/manual/tolua_fix.h" #include "scripting/lua-bindings/manual/LuaBasicConversions.h" diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.hpp b/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.hpp index 87ea5ced94..b399dba4dd 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.hpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.hpp @@ -1,5 +1,5 @@ #include "base/ccConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX #ifndef __axis_audioengine_h__ #define __axis_audioengine_h__ @@ -38,4 +38,4 @@ int register_all_axis_audioengine(lua_State* tolua_S); #endif // __axis_audioengine_h__ -#endif //#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#endif //#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.cpp b/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.cpp index c75a7663d3..0f9ce39185 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/lua-bindings/auto/lua_axis_controller_auto.hpp" -#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) #include "base/CCGameController.h" #include "scripting/lua-bindings/manual/tolua_fix.h" #include "scripting/lua-bindings/manual/LuaBasicConversions.h" diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.hpp b/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.hpp index 810535c8e2..8db961ac8a 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.hpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.hpp @@ -1,5 +1,5 @@ #include "base/ccConfig.h" -#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) #ifndef __axis_controller_h__ #define __axis_controller_h__ @@ -29,4 +29,4 @@ int register_all_axis_controller(lua_State* tolua_S); #endif // __axis_controller_h__ -#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#endif //#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.cpp b/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.cpp index af7309c2c7..70a9f5035c 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/lua-bindings/auto/lua_axis_navmesh_auto.hpp" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH #include "navmesh/CCNavMesh.h" #include "scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.h" #include "scripting/lua-bindings/manual/tolua_fix.h" diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.hpp b/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.hpp index 5737b928d8..3471c278fb 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.hpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.hpp @@ -1,5 +1,5 @@ #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH #ifndef __axis_navmesh_h__ #define __axis_navmesh_h__ @@ -63,4 +63,4 @@ int register_all_axis_navmesh(lua_State* tolua_S); #endif // __axis_navmesh_h__ -#endif //#if CC_USE_NAVMESH +#endif //#if AX_USE_NAVMESH diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.cpp b/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.cpp index 592a42f75c..30802a10e9 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/lua-bindings/auto/lua_axis_physics3d_auto.hpp" -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION #include "physics3d/CCPhysics3D.h" #include "scripting/lua-bindings/manual/tolua_fix.h" #include "scripting/lua-bindings/manual/LuaBasicConversions.h" diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.hpp b/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.hpp index 8daec8990d..23d83858f0 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.hpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.hpp @@ -1,5 +1,5 @@ #include "base/ccConfig.h" -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION #ifndef __axis_physics3d_h__ #define __axis_physics3d_h__ @@ -260,4 +260,4 @@ int register_all_axis_physics3d(lua_State* tolua_S); #endif // __axis_physics3d_h__ -#endif //#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#endif //#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.cpp b/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.cpp index 85fc79f8af..ed229eec1c 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/lua-bindings/auto/lua_axis_physics_auto.hpp" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS #include "cocos2d.h" #include "scripting/lua-bindings/manual/tolua_fix.h" #include "scripting/lua-bindings/manual/LuaBasicConversions.h" diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.hpp b/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.hpp index efaee4a1ca..2c847ad9f3 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.hpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.hpp @@ -1,5 +1,5 @@ #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS #ifndef __axis_physics_h__ #define __axis_physics_h__ @@ -277,4 +277,4 @@ int register_all_axis_physics(lua_State* tolua_S); #endif // __axis_physics_h__ -#endif //#if CC_USE_PHYSICS +#endif //#if AX_USE_PHYSICS diff --git a/extensions/scripting/lua-bindings/manual/3d/lua_axis_3d_manual.cpp b/extensions/scripting/lua-bindings/manual/3d/lua_axis_3d_manual.cpp index 8f675d7dce..cc5ae1d27b 100644 --- a/extensions/scripting/lua-bindings/manual/3d/lua_axis_3d_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/3d/lua_axis_3d_manual.cpp @@ -1228,7 +1228,7 @@ tolua_lerror: int lua_axis_3d_AABB_finalize(lua_State* L) { axis::AABB* self = (axis::AABB*)tolua_tousertype(L, 1, 0); - CC_SAFE_DELETE(self); + AX_SAFE_DELETE(self); return 0; } @@ -1979,7 +1979,7 @@ int lua_axis_3d_OBB_getCorners(lua_State* L) vec3_to_luaval(L, arg0[i - 1]); lua_rawset(L, -3); } - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } @@ -1997,7 +1997,7 @@ tolua_lerror: int lua_axis_3d_OBB_finalize(lua_State* L) { axis::OBB* self = (axis::OBB*)tolua_tousertype(L, 1, 0); - CC_SAFE_DELETE(self); + AX_SAFE_DELETE(self); return 0; } @@ -2362,7 +2362,7 @@ tolua_lerror: int lua_axis_3d_Ray_finalize(lua_State* L) { axis::Ray* self = (axis::Ray*)tolua_tousertype(L, 1, 0); - CC_SAFE_DELETE(self); + AX_SAFE_DELETE(self); return 0; } diff --git a/extensions/scripting/lua-bindings/manual/AxisLuaLoader.cpp b/extensions/scripting/lua-bindings/manual/AxisLuaLoader.cpp index 20bfc756be..9836f360d7 100644 --- a/extensions/scripting/lua-bindings/manual/AxisLuaLoader.cpp +++ b/extensions/scripting/lua-bindings/manual/AxisLuaLoader.cpp @@ -93,7 +93,7 @@ int axis_lua_loader(lua_State* L) resolvedPath.c_str()); } else - CCLOG("can not get file data of %s", resolvedPath.c_str()); + AXLOG("can not get file data of %s", resolvedPath.c_str()); return nret; } } diff --git a/extensions/scripting/lua-bindings/manual/CCComponentLua.cpp b/extensions/scripting/lua-bindings/manual/CCComponentLua.cpp index b437d7c2da..3fb050044e 100644 --- a/extensions/scripting/lua-bindings/manual/CCComponentLua.cpp +++ b/extensions/scripting/lua-bindings/manual/CCComponentLua.cpp @@ -68,7 +68,7 @@ int ComponentLua::_index = 0; ComponentLua* ComponentLua::create(std::string_view scriptFileName) { - CC_ASSERT(!scriptFileName.empty()); + AX_ASSERT(!scriptFileName.empty()); initClass(); @@ -154,7 +154,7 @@ bool ComponentLua::getLuaFunction(std::string_view functionName) int type = lua_type(l, -1); // if (type != LUA_TFUNCTION) // { - // CCLOG("can not get %s function from %s", functionName.c_str(), _scriptFileName.c_str()); + // AXLOG("can not get %s function from %s", functionName.c_str(), _scriptFileName.c_str()); // } return type == LUA_TFUNCTION; @@ -176,7 +176,7 @@ bool ComponentLua::loadAndExecuteScript() fullPathOfScript.c_str()); if (error) { - CCLOG("ComponentLua::loadAndExecuteScript: %s", lua_tostring(l, -1)); + AXLOG("ComponentLua::loadAndExecuteScript: %s", lua_tostring(l, -1)); lua_pop(l, 1); return false; } @@ -185,7 +185,7 @@ bool ComponentLua::loadAndExecuteScript() error = lua_pcall(l, 0, 1, 0); if (error) { - CCLOG("ComponentLua::loadAndExecuteScript: %s", lua_tostring(l, -1)); + AXLOG("ComponentLua::loadAndExecuteScript: %s", lua_tostring(l, -1)); lua_pop(l, 1); return false; } @@ -194,7 +194,7 @@ bool ComponentLua::loadAndExecuteScript() int type = lua_type(l, -1); if (type != LUA_TTABLE) { - CCLOG("%s should return a table, or the script component can not work currectly", _scriptFileName.c_str()); + AXLOG("%s should return a table, or the script component can not work currectly", _scriptFileName.c_str()); return false; } diff --git a/extensions/scripting/lua-bindings/manual/CCLuaBridge.cpp b/extensions/scripting/lua-bindings/manual/CCLuaBridge.cpp index d201cee7a4..04dcbd272e 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaBridge.cpp +++ b/extensions/scripting/lua-bindings/manual/CCLuaBridge.cpp @@ -93,7 +93,7 @@ int LuaBridge::retainLuaFunctionById(int functionId) lua_rawset(L, -3); /* id_r[id] = r, L: id_r */ lua_pop(L, 1); - CCLOG("CCLuaBridge::retainLuaFunctionById(%d) - retain count = %d", functionId, retainCount); + AXLOG("CCLuaBridge::retainLuaFunctionById(%d) - retain count = %d", functionId, retainCount); return retainCount; } @@ -107,7 +107,7 @@ int LuaBridge::releaseLuaFunctionById(int functionId) if (!lua_istable(L, -1)) { lua_pop(L, 1); - CCLOG("CCLuaBridge::releaseLuaFunctionById() - LUA_BRIDGE_REGISTRY_FUNCTION not exists"); + AXLOG("CCLuaBridge::releaseLuaFunctionById() - LUA_BRIDGE_REGISTRY_FUNCTION not exists"); return 0; } @@ -116,7 +116,7 @@ int LuaBridge::releaseLuaFunctionById(int functionId) if (!lua_istable(L, -1)) { lua_pop(L, 2); - CCLOG("CCLuaBridge::releaseLuaFunctionById() - LUA_BRIDGE_REGISTRY_RETAIN not exists"); + AXLOG("CCLuaBridge::releaseLuaFunctionById() - LUA_BRIDGE_REGISTRY_RETAIN not exists"); return 0; } @@ -125,7 +125,7 @@ int LuaBridge::releaseLuaFunctionById(int functionId) if (lua_type(L, -1) != LUA_TNUMBER) { lua_pop(L, 3); - CCLOG("CCLuaBridge::releaseLuaFunctionById() - function id %d not found", functionId); + AXLOG("CCLuaBridge::releaseLuaFunctionById() - function id %d not found", functionId); return 0; } @@ -140,7 +140,7 @@ int LuaBridge::releaseLuaFunctionById(int functionId) lua_pushinteger(L, retainCount); /* L: f_id id_r id r */ lua_rawset(L, -3); /* id_r[id] = r, L: f_id id_r */ lua_pop(L, 2); - CCLOG("CCLuaBridge::releaseLuaFunctionById() - function id %d retain count = %d", functionId, retainCount); + AXLOG("CCLuaBridge::releaseLuaFunctionById() - function id %d retain count = %d", functionId, retainCount); return retainCount; } @@ -165,7 +165,7 @@ int LuaBridge::releaseLuaFunctionById(int functionId) } /* L: f_id */ lua_pop(L, 1); - CCLOG("CCLuaBridge::releaseLuaFunctionById() - function id %d released", functionId); + AXLOG("CCLuaBridge::releaseLuaFunctionById() - function id %d released", functionId); return 0; } diff --git a/extensions/scripting/lua-bindings/manual/CCLuaEngine.cpp b/extensions/scripting/lua-bindings/manual/CCLuaEngine.cpp index 3c74184c36..828be96ff1 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaEngine.cpp +++ b/extensions/scripting/lua-bindings/manual/CCLuaEngine.cpp @@ -52,7 +52,7 @@ LuaEngine* LuaEngine::getInstance(void) LuaEngine::~LuaEngine(void) { - CC_SAFE_RELEASE(_stack); + AX_SAFE_RELEASE(_stack); _defaultEngine = nullptr; } @@ -179,7 +179,7 @@ bool LuaEngine::parseConfig(ConfigType type, std::string_view str) lua_getglobal(_stack->getLuaState(), "__onParseConfig"); if (!lua_isfunction(_stack->getLuaState(), -1)) { - CCLOG("[LUA ERROR] name '%s' does not represent a Lua function", "__onParseConfig"); + AXLOG("[LUA ERROR] name '%s' does not represent a Lua function", "__onParseConfig"); lua_pop(_stack->getLuaState(), 1); return false; } diff --git a/extensions/scripting/lua-bindings/manual/CCLuaEngine.h b/extensions/scripting/lua-bindings/manual/CCLuaEngine.h index 753f46b12d..acf85cd1f3 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaEngine.h +++ b/extensions/scripting/lua-bindings/manual/CCLuaEngine.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_LUA_ENGINE_H__ -#define __CC_LUA_ENGINE_H__ +#ifndef __AX_LUA_ENGINE_H__ +#define __AX_LUA_ENGINE_H__ extern "C" { #include "lua.h" @@ -50,7 +50,7 @@ NS_AX_BEGIN * @lua NA * @js NA */ -class CC_LUA_DLL LuaEngine : public ScriptEngineProtocol +class AX_LUA_DLL LuaEngine : public ScriptEngineProtocol { public: /** @@ -64,7 +64,7 @@ public: * * @return the instance of LuaEngine. */ - CC_DEPRECATED_ATTRIBUTE static LuaEngine* defaultEngine(void) { return LuaEngine::getInstance(); } + AX_DEPRECATED_ATTRIBUTE static LuaEngine* defaultEngine(void) { return LuaEngine::getInstance(); } /** * Destructor of LuaEngine. @@ -264,4 +264,4 @@ NS_AX_END // end group /// @} -#endif // __CC_LUA_ENGINE_H__ +#endif // __AX_LUA_ENGINE_H__ diff --git a/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp b/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp index 3b4741fc1b..ffb92d4c90 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp +++ b/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp @@ -37,11 +37,11 @@ extern "C" { #include "scripting/lua-bindings/manual/AxisLuaLoader.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # include "scripting/lua-bindings/manual/platform/ios/CCLuaObjcBridge.h" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.h" #endif @@ -85,7 +85,7 @@ int lua_print(lua_State* L) { std::string t; get_string_for_print(L, &t); - CCLOG("[LUA-print] %s", t.c_str()); + AXLOG("[LUA-print] %s", t.c_str()); return 0; } @@ -154,16 +154,16 @@ bool LuaStack::init() tolua_luanode_open(_state); register_luanode_manual(_state); -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS register_all_axis_physics(_state); register_all_axis_physics_manual(_state); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) LuaObjcBridge::luaopen_luaoc(_state); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) LuaJavaBridge::luaopen_luaj(_state); #endif @@ -262,7 +262,7 @@ int LuaStack::executeGlobalFunction(const char* functionName) lua_getglobal(_state, functionName); /* query function by name, stack: function */ if (!lua_isfunction(_state, -1)) { - CCLOG("[LUA ERROR] name '%s' does not represent a Lua function", functionName); + AXLOG("[LUA ERROR] name '%s' does not represent a Lua function", functionName); lua_pop(_state, 1); return 0; } @@ -375,7 +375,7 @@ bool LuaStack::pushFunctionByHandler(int nHandler) toluafix_get_function_by_refid(_state, nHandler); /* L: ... func */ if (!lua_isfunction(_state, -1)) { - CCLOG("[LUA ERROR] function refid '%d' does not reference a Lua function", nHandler); + AXLOG("[LUA ERROR] function refid '%d' does not reference a Lua function", nHandler); lua_pop(_state, 1); return false; } @@ -387,7 +387,7 @@ int LuaStack::executeFunction(int numArgs) int functionIndex = -(numArgs + 1); if (!lua_isfunction(_state, functionIndex)) { - CCLOG("value at stack [%d] is not function", functionIndex); + AXLOG("value at stack [%d] is not function", functionIndex); lua_pop(_state, numArgs + 1); // remove function and arguments return 0; } @@ -412,7 +412,7 @@ int LuaStack::executeFunction(int numArgs) { if (traceback == 0) { - CCLOG("[LUA ERROR] %s", lua_tostring(_state, -1)); /* L: ... error */ + AXLOG("[LUA ERROR] %s", lua_tostring(_state, -1)); /* L: ... error */ lua_pop(_state, 1); // remove error message from stack } else /* L: ... G error */ @@ -480,7 +480,7 @@ int LuaStack::reallocateScriptHandler(int nHandler) toluafix_get_function_by_refid(_state,nNewHandle); if (!lua_isfunction(_state, -1)) { - CCLOG("Error!"); + AXLOG("Error!"); } lua_settop(_state, 0); */ @@ -503,7 +503,7 @@ int LuaStack::executeFunction(int handler, if (!lua_isfunction(_state, functionIndex)) { - CCLOG("value at stack [%d] is not function", functionIndex); + AXLOG("value at stack [%d] is not function", functionIndex); lua_pop(_state, numArgs + 1); // remove function and arguments return 0; } @@ -529,7 +529,7 @@ int LuaStack::executeFunction(int handler, { if (traceCallback == 0) { - CCLOG("[LUA ERROR] %s", lua_tostring(_state, -1)); /* L: ... error */ + AXLOG("[LUA ERROR] %s", lua_tostring(_state, -1)); /* L: ... error */ lua_pop(_state, 1); // remove error message from stack } else /* L: ... G error */ @@ -563,7 +563,7 @@ int LuaStack::reload(const char* moduleFileName) { if (nullptr == moduleFileName || strlen(moduleFileName) == 0) { - CCLOG("moudulFileName is null"); + AXLOG("moudulFileName is null"); return 1; } @@ -597,7 +597,7 @@ int LuaStack::luaLoadChunksFromZIP(lua_State* L) { if (lua_gettop(L) < 1) { - CCLOG("luaLoadChunksFromZIP() - invalid arguments"); + AXLOG("luaLoadChunksFromZIP() - invalid arguments"); return 0; } @@ -627,7 +627,7 @@ int LuaStack::luaLoadChunksFromZIP(lua_State* L) if (zip) { - CCLOG("lua_loadChunksFromZIP() - load zip file: %s", zipFilePath.c_str()); + AXLOG("lua_loadChunksFromZIP() - load zip file: %s", zipFilePath.c_str()); lua_getglobal(L, "package"); lua_getfield(L, -1, "preload"); @@ -658,7 +658,7 @@ int LuaStack::luaLoadChunksFromZIP(lua_State* L) character = '.'; } } - CCLOG("[luaLoadChunksFromZIP] add %s to preload", filename.c_str()); + AXLOG("[luaLoadChunksFromZIP] add %s to preload", filename.c_str()); if (stack->luaLoadBuffer(L, (char*)zbuffer, (int)bufferSize, filename.c_str()) == 0) { lua_setfield(L, -2, filename.c_str()); @@ -668,7 +668,7 @@ int LuaStack::luaLoadChunksFromZIP(lua_State* L) } filename = zip->getNextFilename(); } - CCLOG("lua_loadChunksFromZIP() - loaded chunks count: %d", count); + AXLOG("lua_loadChunksFromZIP() - loaded chunks count: %d", count); lua_pop(L, 2); lua_pushboolean(L, 1); @@ -676,7 +676,7 @@ int LuaStack::luaLoadChunksFromZIP(lua_State* L) } else { - CCLOG("lua_loadChunksFromZIP() - not found or invalid zip file: %s", zipFilePath.c_str()); + AXLOG("lua_loadChunksFromZIP() - not found or invalid zip file: %s", zipFilePath.c_str()); lua_pushboolean(L, 0); } @@ -718,19 +718,19 @@ int LuaStack::luaLoadBuffer(lua_State* L, const char* chunk, int chunkSize, cons switch (r) { case LUA_ERRSYNTAX: - CCLOG("[LUA ERROR] load \"%s\", error: syntax error during pre-compilation.", chunkName); + AXLOG("[LUA ERROR] load \"%s\", error: syntax error during pre-compilation.", chunkName); break; case LUA_ERRMEM: - CCLOG("[LUA ERROR] load \"%s\", error: memory allocation error.", chunkName); + AXLOG("[LUA ERROR] load \"%s\", error: memory allocation error.", chunkName); break; case LUA_ERRFILE: - CCLOG("[LUA ERROR] load \"%s\", error: cannot open/read file.", chunkName); + AXLOG("[LUA ERROR] load \"%s\", error: cannot open/read file.", chunkName); break; default: - CCLOG("[LUA ERROR] load \"%s\", error: unknown.", chunkName); + AXLOG("[LUA ERROR] load \"%s\", error: unknown.", chunkName); } } #endif diff --git a/extensions/scripting/lua-bindings/manual/CCLuaStack.h b/extensions/scripting/lua-bindings/manual/CCLuaStack.h index f0df2a2cbf..2fd6583d8c 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaStack.h +++ b/extensions/scripting/lua-bindings/manual/CCLuaStack.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_LUA_STACK_H_ -#define __CC_LUA_STACK_H_ +#ifndef __AX_LUA_STACK_H_ +#define __AX_LUA_STACK_H_ extern "C" { #include "lua.h" @@ -332,4 +332,4 @@ NS_AX_END // end group /// @} -#endif // __CC_LUA_STACK_H_ +#endif // __AX_LUA_STACK_H_ diff --git a/extensions/scripting/lua-bindings/manual/CCLuaValue.h b/extensions/scripting/lua-bindings/manual/CCLuaValue.h index 7aea56eadd..db5afc19ad 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaValue.h +++ b/extensions/scripting/lua-bindings/manual/CCLuaValue.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_LUA_VALUE_H_ -#define __CC_LUA_VALUE_H_ +#ifndef __AX_LUA_VALUE_H_ +#define __AX_LUA_VALUE_H_ #include #include @@ -38,7 +38,7 @@ extern "C" { #include "base/ccTypes.h" #include "base/CCRef.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY +#if AX_TARGET_PLATFORM == AX_PLATFORM_BLACKBERRY using std::memcpy; using std::memset; #endif @@ -281,4 +281,4 @@ NS_AX_END // end group /// @} -#endif // __CC_LUA_VALUE_H_ +#endif // __AX_LUA_VALUE_H_ diff --git a/extensions/scripting/lua-bindings/manual/Lua-BindingsExport.h b/extensions/scripting/lua-bindings/manual/Lua-BindingsExport.h index 48e73786ea..199f7a6775 100644 --- a/extensions/scripting/lua-bindings/manual/Lua-BindingsExport.h +++ b/extensions/scripting/lua-bindings/manual/Lua-BindingsExport.h @@ -31,12 +31,12 @@ # endif # if defined(_USRLUASTATIC) -# define CC_LUA_DLL +# define AX_LUA_DLL # else # if defined(_USRLUADLL) -# define CC_LUA_DLL __declspec(dllexport) +# define AX_LUA_DLL __declspec(dllexport) # else /* use a DLL library */ -# define CC_LUA_DLL __declspec(dllimport) +# define AX_LUA_DLL __declspec(dllimport) # endif # endif @@ -49,9 +49,9 @@ # endif # endif #elif defined(_SHARED_) -# define CC_LUA_DLL __attribute__((visibility("default"))) +# define AX_LUA_DLL __attribute__((visibility("default"))) #else -# define CC_LUA_DLL +# define AX_LUA_DLL #endif #endif /* __CCEXTENSIONEXPORT_H__*/ \ No newline at end of file diff --git a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.cpp b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.cpp index f2b180e899..d8f5abc7ce 100644 --- a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.cpp +++ b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.cpp @@ -46,19 +46,19 @@ void luaval_to_native_err(lua_State* L, const char* msg, tolua_Error* err, const { int narg = err->index; if (err->array) - CCLOG("%s\n %s argument #%d is array of '%s'; array of '%s' expected.\n", msg + 2, funcName, narg, + AXLOG("%s\n %s argument #%d is array of '%s'; array of '%s' expected.\n", msg + 2, funcName, narg, provided, expected); else - CCLOG("%s\n %s argument #%d is '%s'; '%s' expected.\n", msg + 2, funcName, narg, provided, + AXLOG("%s\n %s argument #%d is '%s'; '%s' expected.\n", msg + 2, funcName, narg, provided, expected); } else if (msg[1] == 'v') { if (err->array) - CCLOG("%s\n %s value is array of '%s'; array of '%s' expected.\n", funcName, msg + 2, provided, + AXLOG("%s\n %s value is array of '%s'; array of '%s' expected.\n", funcName, msg + 2, provided, expected); else - CCLOG("%s\n %s value is '%s'; '%s' expected.\n", msg + 2, funcName, provided, expected); + AXLOG("%s\n %s value is '%s'; '%s' expected.\n", msg + 2, funcName, provided, expected); } } } @@ -506,7 +506,7 @@ bool luaval_to_blendfunc(lua_State* L, int lo, axis::BlendFunc* outValue, const return ok; } -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS bool luaval_to_physics_material(lua_State* L, int lo, PhysicsMaterial* outValue, const char* funcName) { if (NULL == L || NULL == outValue) @@ -542,7 +542,7 @@ bool luaval_to_physics_material(lua_State* L, int lo, PhysicsMaterial* outValue, } return ok; } -#endif //#if CC_USE_PHYSICS +#endif //#if AX_USE_PHYSICS bool luaval_to_ssize_t(lua_State* L, int lo, ssize_t* outValue, const char* funcName) { @@ -1149,14 +1149,14 @@ bool luaval_to_array_of_vec2(lua_State* L, int lo, axis::Vec2** points, int* num luaval_to_native_err(L, "#ferror:", &tolua_err, funcName); #endif lua_pop(L, 1); - CC_SAFE_DELETE_ARRAY(array); + AX_SAFE_DELETE_ARRAY(array); return false; } ok &= luaval_to_vec2(L, lua_gettop(L), &array[i]); if (!ok) { lua_pop(L, 1); - CC_SAFE_DELETE_ARRAY(array); + AX_SAFE_DELETE_ARRAY(array); return false; } lua_pop(L, 1); @@ -1221,7 +1221,7 @@ bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, axis::ValueVector } else { - CCASSERT(false, "not supported type"); + AXASSERT(false, "not supported type"); } } @@ -1361,7 +1361,7 @@ bool luaval_to_ccvaluemap(lua_State* L, int lo, axis::ValueMap* ret, const char* } else { - CCASSERT(false, "not supported type"); + AXASSERT(false, "not supported type"); } } @@ -1449,7 +1449,7 @@ bool luaval_to_ccvaluemapintkey(lua_State* L, int lo, axis::ValueMapIntKey* ret, } else { - CCASSERT(false, "not supported type"); + AXASSERT(false, "not supported type"); } } @@ -1532,7 +1532,7 @@ bool luaval_to_ccvaluevector(lua_State* L, int lo, axis::ValueVector* ret, const } else { - CCASSERT(false, "not supported type"); + AXASSERT(false, "not supported type"); } lua_pop(L, 1); } @@ -1572,7 +1572,7 @@ bool luaval_to_std_vector_string(lua_State* L, int lo, std::vector* } else { - CCASSERT(false, "string type is needed"); + AXASSERT(false, "string type is needed"); } lua_pop(L, 1); @@ -1613,7 +1613,7 @@ bool luaval_to_std_vector_string_view(lua_State* L, int lo, std::vector* ret, const } else { - CCASSERT(false, "int type is needed"); + AXASSERT(false, "int type is needed"); } lua_pop(L, 1); @@ -1723,7 +1723,7 @@ bool luaval_to_std_vector_float(lua_State* L, int lo, std::vector* ret, c } else { - CCASSERT(false, "float type is needed"); + AXASSERT(false, "float type is needed"); } lua_pop(L, 1); @@ -1762,7 +1762,7 @@ bool luaval_to_std_vector_ushort(lua_State* L, int lo, std::vector* re } else { - CCASSERT(false, "vec2 type is needed"); + AXASSERT(false, "vec2 type is needed"); } lua_pop(L, 1); } @@ -2029,7 +2029,7 @@ bool luaval_to_std_vector_vec3(lua_State* L, int lo, std::vector* re } else { - CCASSERT(false, "vec3 type is needed"); + AXASSERT(false, "vec3 type is needed"); } lua_pop(L, 1); } @@ -2075,7 +2075,7 @@ bool luaval_to_std_vector_v3f_c4b_t2f(lua_State* L, } else { - CCASSERT(false, "V3F_C4B_T2F type is needed"); + AXASSERT(false, "V3F_C4B_T2F type is needed"); } lua_pop(L, 1); } @@ -2255,7 +2255,7 @@ int vec4_to_luaval(lua_State* L, const axis::Vec4& vec4) return 1; } -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS void physics_material_to_luaval(lua_State* L, const PhysicsMaterial& pm) { if (nullptr == L) @@ -2333,7 +2333,7 @@ void physics_contactdata_to_luaval(lua_State* L, const PhysicsContactData* data) lua_pushnumber(L, data->POINT_MAX); lua_rawset(L, -3); } -#endif //#if CC_USE_PHYSICS +#endif //#if AX_USE_PHYSICS void size_to_luaval(lua_State* L, const Size& sz) { @@ -3007,7 +3007,7 @@ bool luaval_to_std_map_string_string(lua_State* L, int lo, hlookup::string_map(lua_tointeger(L, -1)); lua_pop(L, 1); diff --git a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h index 3036e6a929..215c127a1d 100644 --- a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -175,7 +175,7 @@ extern bool luaval_to_uint16(lua_State* L, int lo, uint16_t* outValue, const cha * @return Return true if the value at the given acceptable index of stack is a number or a string convertible to a * number, otherwise return false. */ -extern CC_LUA_DLL bool luaval_to_boolean(lua_State* L, int lo, bool* outValue, const char* funcName = ""); +extern AX_LUA_DLL bool luaval_to_boolean(lua_State* L, int lo, bool* outValue, const char* funcName = ""); /** * Get a double value from the given acceptable index of stack. @@ -217,8 +217,8 @@ extern bool luaval_to_long_long(lua_State* L, int lo, long long* outValue, const * @return Return true if the value at the given acceptable index of stack is a string or a number convertible to a * string, otherwise return false. */ -extern CC_LUA_DLL bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue, const char* funcName = ""); -extern CC_LUA_DLL bool luaval_to_std_string_view(lua_State* L, +extern AX_LUA_DLL bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue, const char* funcName = ""); +extern AX_LUA_DLL bool luaval_to_std_string_view(lua_State* L, int lo, cxx17::string_view* outValue, const char* funcName = ""); @@ -277,7 +277,7 @@ extern bool luaval_to_rect(lua_State* L, int lo, Rect* outValue, const char* fun * @param funcName the name of calling function, it is used for error output in the debug model. * @return Return true if the value at the given acceptable index of stack is a table, otherwise return false. */ -extern CC_LUA_DLL bool luaval_to_color3b(lua_State* L, int lo, Color3B* outValue, const char* funcName = ""); +extern AX_LUA_DLL bool luaval_to_color3b(lua_State* L, int lo, Color3B* outValue, const char* funcName = ""); /** * Get a Color4B object value from the given acceptable index of stack. @@ -306,7 +306,7 @@ extern bool luaval_to_color4b(lua_State* L, int lo, Color4B* outValue, const cha * @return Return true if the value at the given acceptable index of stack is a table, otherwise return false. */ extern bool luaval_to_color4f(lua_State* L, int lo, Color4F* outValue, const char* funcName = ""); -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS /** * Get a PhysicsMaterial object value from the given acceptable index of stack. @@ -325,7 +325,7 @@ extern bool luaval_to_physics_material(lua_State* L, int lo, axis::PhysicsMaterial* outValue, const char* funcName = ""); -#endif //#if CC_USE_PHYSICS +#endif //#if AX_USE_PHYSICS /** * If the value at the given acceptable index of stack is a table it returns true, otherwise returns false. @@ -478,14 +478,14 @@ static inline bool luaval_to_point(lua_State* L, int lo, axis::Vec2* outValue, c return luaval_to_vec2(L, lo, outValue); } -CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_kmMat4(lua_State* L, +AX_DEPRECATED_ATTRIBUTE static inline bool luaval_to_kmMat4(lua_State* L, int lo, axis::Mat4* outValue, const char* funcName = "") { return luaval_to_mat4(L, lo, outValue); } -CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L, +AX_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L, int lo, axis::Vec2** points, int* numPoints, @@ -585,12 +585,12 @@ bool luaval_to_ccvector(lua_State* L, int lo, axis::Vector* ret, const char* * @param funcName the name of calling function, it is used for error output in the debug model. * @return Return true if the value at the given acceptable index of stack is a table, otherwise return false. */ -CC_LUA_DLL bool luaval_to_std_vector_string(lua_State* L, +AX_LUA_DLL bool luaval_to_std_vector_string(lua_State* L, int lo, std::vector* ret, const char* funcName = ""); -CC_LUA_DLL bool luaval_to_std_vector_string_view(lua_State* L, +AX_LUA_DLL bool luaval_to_std_vector_string_view(lua_State* L, int lo, std::vector* ret, const char* funcName = ""); @@ -731,7 +731,7 @@ bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret, const cha *ret = static_cast(tolua_tousertype(L, lo, 0)); if (nullptr == *ret) - CCLOG("Warning: %s argument %d is invalid native object(nullptr)", funcName, lo); + AXLOG("Warning: %s argument %d is invalid native object(nullptr)", funcName, lo); return true; } @@ -949,7 +949,7 @@ extern void rect_to_luaval(lua_State* L, const Rect& rt); * @param L the current lua_State. * @param cc a axis::Color3B object. */ -extern CC_LUA_DLL void color3b_to_luaval(lua_State* L, const Color3B& cc); +extern AX_LUA_DLL void color3b_to_luaval(lua_State* L, const Color3B& cc); /** * Push a table converted from a axis::Color4B object into the Lua stack. @@ -968,7 +968,7 @@ extern void color4b_to_luaval(lua_State* L, const Color4B& cc); * @param cc a axis::Color4F object. */ extern void color4f_to_luaval(lua_State* L, const Color4F& cc); -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS /** * Push a table converted from a axis::PhysicsMaterial object into the Lua stack. @@ -997,7 +997,7 @@ extern void physics_raycastinfo_to_luaval(lua_State* L, const PhysicsRayCastInfo * @param data a axis::PhysicsContactData object. */ extern void physics_contactdata_to_luaval(lua_State* L, const PhysicsContactData* data); -#endif //#if CC_USE_PHYSICS +#endif //#if AX_USE_PHYSICS /** * Push a table converted from a axis::AffineTransform object into the Lua stack. @@ -1054,7 +1054,7 @@ static inline void point_to_luaval(lua_State* L, const axis::Vec2& pt) vec2_to_luaval(L, pt); } -CC_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L, const axis::Vec2* points, int count) +AX_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L, const axis::Vec2* points, int count) { vec2_array_to_luaval(L, points, count); } @@ -1329,13 +1329,13 @@ void std_vector_vec3_to_luaval(lua_State* L, const std::vector& inVa void std_map_string_string_to_luaval(lua_State* L, const std::map& inValue); // Follow 2 function is added for Cocos Studio to make lua lib can be compile as dynamic library -CC_LUA_DLL extern bool luaval_to_node(lua_State* L, int lo, const char* type, axis::Node** node); -CC_LUA_DLL extern void node_to_luaval(lua_State* L, const char* type, axis::Node* node); +AX_LUA_DLL extern bool luaval_to_node(lua_State* L, int lo, const char* type, axis::Node** node); +AX_LUA_DLL extern void node_to_luaval(lua_State* L, const char* type, axis::Node* node); /** * convert lua object VertexLayout to native object */ -CC_LUA_DLL bool luaval_to_vertexLayout(lua_State* L, +AX_LUA_DLL bool luaval_to_vertexLayout(lua_State* L, int pos, axis::backend::VertexLayout& outLayout, const char* message); @@ -1343,7 +1343,7 @@ CC_LUA_DLL bool luaval_to_vertexLayout(lua_State* L, /** * convert lua object SamplerDescriptor to native object */ -CC_LUA_DLL bool luaval_to_samplerDescriptor(lua_State* L, +AX_LUA_DLL bool luaval_to_samplerDescriptor(lua_State* L, int pos, axis::backend::SamplerDescriptor& desc, const char* message); @@ -1351,7 +1351,7 @@ CC_LUA_DLL bool luaval_to_samplerDescriptor(lua_State* L, /** * convert lua object to axis::backend::UniformLocation */ -CC_LUA_DLL bool luaval_to_uniformLocation(lua_State* L, +AX_LUA_DLL bool luaval_to_uniformLocation(lua_State* L, int pos, axis::backend::UniformLocation& desc, const char* message); @@ -1359,9 +1359,9 @@ CC_LUA_DLL bool luaval_to_uniformLocation(lua_State* L, /** * convert axis::backend::UniformLocation to lua object */ -CC_LUA_DLL void uniformLocation_to_luaval(lua_State* L, const axis::backend::UniformLocation& desc); +AX_LUA_DLL void uniformLocation_to_luaval(lua_State* L, const axis::backend::UniformLocation& desc); -CC_LUA_DLL void program_activeattrs_to_luaval(lua_State* L, +AX_LUA_DLL void program_activeattrs_to_luaval(lua_State* L, const hlookup::string_map& map); // end group diff --git a/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.cpp b/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.cpp index b257bcaa6b..8760d03b4b 100644 --- a/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.cpp +++ b/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.cpp @@ -56,7 +56,7 @@ LuaCallFunc* LuaCallFunc::create(const std::function& func) return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -120,7 +120,7 @@ ScriptHandlerMgr* ScriptHandlerMgr::getInstance() void ScriptHandlerMgr::destroyInstance() { - CC_SAFE_DELETE(_scriptHandlerMgr); + AX_SAFE_DELETE(_scriptHandlerMgr); } void ScriptHandlerMgr::init() diff --git a/extensions/scripting/lua-bindings/manual/base/lua_axis_base_manual.cpp b/extensions/scripting/lua-bindings/manual/base/lua_axis_base_manual.cpp index 458ed657d2..25a75e9e20 100644 --- a/extensions/scripting/lua-bindings/manual/base/lua_axis_base_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/base/lua_axis_base_manual.cpp @@ -2439,7 +2439,7 @@ tolua_lerror: return 0; } -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "navmesh/CCNavMesh.h" int lua_axis_Scene_setNavMeshDebugCamera(lua_State* tolua_S) { @@ -2591,7 +2591,7 @@ tolua_lerror: return 0; } -#endif //#if CC_USE_NAVMESH +#endif //#if AX_USE_NAVMESH static int tolua_cocos2d_Spawn_create(lua_State* tolua_S) { @@ -2686,7 +2686,7 @@ int lua_cocos2d_CardinalSplineBy_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4, &ten, "ax.CardinalSplineBy:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2696,7 +2696,7 @@ int lua_cocos2d_CardinalSplineBy_create(lua_State* tolua_S) if (NULL == points) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2705,7 +2705,7 @@ int lua_cocos2d_CardinalSplineBy_create(lua_State* tolua_S) points->addControlPoint(arr[i]); } - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); CardinalSplineBy* tolua_ret = CardinalSplineBy::create((float)dur, points, (float)ten); if (NULL != tolua_ret) { @@ -2763,7 +2763,7 @@ int tolua_cocos2d_CatmullRomBy_create(lua_State* tolua_S) if (NULL == points) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2772,7 +2772,7 @@ int tolua_cocos2d_CatmullRomBy_create(lua_State* tolua_S) points->addControlPoint(arr[i]); } - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); CatmullRomBy* tolua_ret = CatmullRomBy::create((float)dur, points); if (NULL != tolua_ret) { @@ -2829,7 +2829,7 @@ int tolua_cocos2d_CatmullRomTo_create(lua_State* tolua_S) if (NULL == points) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2838,7 +2838,7 @@ int tolua_cocos2d_CatmullRomTo_create(lua_State* tolua_S) points->addControlPoint(arr[i]); } - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); CatmullRomTo* tolua_ret = CatmullRomTo::create((float)dur, points); if (NULL != tolua_ret) { @@ -2891,7 +2891,7 @@ int tolua_cocos2d_BezierBy_create(lua_State* tolua_S) if (num < 3) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2899,7 +2899,7 @@ int tolua_cocos2d_BezierBy_create(lua_State* tolua_S) config.controlPoint_1 = arr[0]; config.controlPoint_2 = arr[1]; config.endPosition = arr[2]; - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); BezierBy* tolua_ret = BezierBy::create((float)t, config); if (NULL != tolua_ret) @@ -2952,7 +2952,7 @@ int tolua_cocos2d_BezierTo_create(lua_State* tolua_S) if (num < 3) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2960,7 +2960,7 @@ int tolua_cocos2d_BezierTo_create(lua_State* tolua_S) config.controlPoint_1 = arr[0]; config.controlPoint_2 = arr[1]; config.endPosition = arr[2]; - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); BezierTo* tolua_ret = BezierTo::create((float)t, config); if (NULL != tolua_ret) @@ -3026,7 +3026,7 @@ static int tolua_axis_DrawNode_drawPolygon(lua_State* tolua_S) lua_gettable(tolua_S, 2); if (!tolua_istable(tolua_S, -1, 0, &tolua_err)) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); #if COCOS2D_DEBUG >= 1 goto tolua_lerror; #endif @@ -3035,7 +3035,7 @@ static int tolua_axis_DrawNode_drawPolygon(lua_State* tolua_S) if (!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i], "ax.DrawNode:drawPolygon")) { lua_pop(tolua_S, 1); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } lua_pop(tolua_S, 1); @@ -3044,7 +3044,7 @@ static int tolua_axis_DrawNode_drawPolygon(lua_State* tolua_S) Color4F fillColor; if (!luaval_to_color4f(tolua_S, 4, &fillColor, "ax.DrawNode:drawPolygon")) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } @@ -3053,12 +3053,12 @@ static int tolua_axis_DrawNode_drawPolygon(lua_State* tolua_S) Color4F borderColor; if (!luaval_to_color4f(tolua_S, 6, &borderColor, "ax.DrawNode:drawPolygon")) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } self->drawPolygon(points, (int)size, fillColor, borderWidth, borderColor); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } } @@ -3110,7 +3110,7 @@ int tolua_axis_DrawNode_drawSolidPoly(lua_State* tolua_S) lua_gettable(tolua_S, 2); if (!tolua_istable(tolua_S, -1, 0, &tolua_err)) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); #if COCOS2D_DEBUG >= 1 goto tolua_lerror; #endif @@ -3119,7 +3119,7 @@ int tolua_axis_DrawNode_drawSolidPoly(lua_State* tolua_S) if (!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i], "ax.DrawNode:drawSolidPoly")) { lua_pop(tolua_S, 1); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } lua_pop(tolua_S, 1); @@ -3131,7 +3131,7 @@ int tolua_axis_DrawNode_drawSolidPoly(lua_State* tolua_S) if (!ok) return 0; self->drawSolidPoly(points, size, arg2); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } } @@ -3188,7 +3188,7 @@ int tolua_axis_DrawNode_drawPoly(lua_State* tolua_S) lua_gettable(tolua_S, 2); if (!tolua_istable(tolua_S, -1, 0, &tolua_err)) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); #if COCOS2D_DEBUG >= 1 goto tolua_lerror; #endif @@ -3197,7 +3197,7 @@ int tolua_axis_DrawNode_drawPoly(lua_State* tolua_S) if (!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i], "ax.DrawNode:drawPoly")) { lua_pop(tolua_S, 1); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } lua_pop(tolua_S, 1); @@ -3213,7 +3213,7 @@ int tolua_axis_DrawNode_drawPoly(lua_State* tolua_S) return 0; self->drawPoly(points, size, arg2, arg3); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } } @@ -3261,7 +3261,7 @@ int tolua_axis_DrawNode_drawCardinalSpline(lua_State* tolua_S) PointArray* config = PointArray::create(num); if (NULL == config) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -3269,7 +3269,7 @@ int tolua_axis_DrawNode_drawCardinalSpline(lua_State* tolua_S) { config->addControlPoint(arr[i]); } - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); double arg1; unsigned int arg2; @@ -3329,7 +3329,7 @@ int tolua_axis_DrawNode_drawCatmullRom(lua_State* tolua_S) PointArray* config = PointArray::create(num); if (NULL == config) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -3337,7 +3337,7 @@ int tolua_axis_DrawNode_drawCatmullRom(lua_State* tolua_S) { config->addControlPoint(arr[i]); } - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); unsigned int arg1; axis::Color4F arg2; @@ -3400,7 +3400,7 @@ int tolua_axis_DrawNode_drawPoints(lua_State* tolua_S) lua_gettable(tolua_S, 2); if (!tolua_istable(tolua_S, -1, 0, &tolua_err)) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); #if COCOS2D_DEBUG >= 1 goto tolua_lerror; #endif @@ -3409,7 +3409,7 @@ int tolua_axis_DrawNode_drawPoints(lua_State* tolua_S) if (!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i], "ax.DrawNode:drawPoints")) { lua_pop(tolua_S, 1); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } lua_pop(tolua_S, 1); @@ -3437,7 +3437,7 @@ int tolua_axis_DrawNode_drawPoints(lua_State* tolua_S) lua_gettable(tolua_S, 2); if (!tolua_istable(tolua_S, -1, 0, &tolua_err)) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); #if COCOS2D_DEBUG >= 1 goto tolua_lerror; #endif @@ -3446,7 +3446,7 @@ int tolua_axis_DrawNode_drawPoints(lua_State* tolua_S) if (!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i], "ax.DrawNode:drawPoints")) { lua_pop(tolua_S, 1); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } lua_pop(tolua_S, 1); @@ -3786,7 +3786,7 @@ tolua_lerror: return 0; } -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION # include "physics3d/CCPhysics3DWorld.h" int lua_axis_Scene_getPhysics3DWorld(lua_State* tolua_S) { @@ -3895,12 +3895,12 @@ static void extendScene(lua_State* tolua_S) lua_rawget(tolua_S, LUA_REGISTRYINDEX); if (lua_istable(tolua_S, -1)) { -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION tolua_function(tolua_S, "getPhysics3DWorld", lua_axis_Scene_getPhysics3DWorld); tolua_function(tolua_S, "setPhysics3DDebugCamera", lua_axis_Scene_setPhysics3DDebugCamera); #endif -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH tolua_function(tolua_S, "setNavMeshDebugCamera", lua_axis_Scene_setNavMeshDebugCamera); tolua_function(tolua_S, "setNavMesh", lua_axis_Scene_setNavMesh); tolua_function(tolua_S, "getNavMesh", lua_axis_Scene_getNavMesh); @@ -4541,7 +4541,7 @@ EventListenerAcceleration* LuaEventListenerAcceleration::create() } else { - CC_SAFE_DELETE(eventAcceleration); + AX_SAFE_DELETE(eventAcceleration); } return eventAcceleration; } @@ -4558,7 +4558,7 @@ EventListenerCustom* LuaEventListenerCustom::create(std::string_view eventName) } else { - CC_SAFE_DELETE(eventCustom); + AX_SAFE_DELETE(eventCustom); } return eventCustom; } @@ -6329,7 +6329,7 @@ int lua_axis_TMXLayer_setTiles(lua_State* tolua_S) cobj->setTiles(arg0); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); lua_settop(tolua_S, 1); return 1; } @@ -6817,7 +6817,7 @@ tolua_lerror: static int lua_collect_Properties(lua_State* tolua_S) { axis::Properties* self = (axis::Properties*)tolua_tousertype(tolua_S, 1, 0); - CC_SAFE_DELETE(self); + AX_SAFE_DELETE(self); return 0; } @@ -6980,7 +6980,7 @@ tolua_lerror: static int lua_collect_PolygonInfo(lua_State* tolua_S) { axis::PolygonInfo* self = (axis::PolygonInfo*)tolua_tousertype(tolua_S, 1, 0); - CC_SAFE_DELETE(self); + AX_SAFE_DELETE(self); return 0; } @@ -7336,7 +7336,7 @@ tolua_lerror: static int lua_collect_AutoPolygon(lua_State* tolua_S) { axis::AutoPolygon* self = (axis::AutoPolygon*)tolua_tousertype(tolua_S, 1, 0); - CC_SAFE_DELETE(self); + AX_SAFE_DELETE(self); return 0; } diff --git a/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp b/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp index bac7b9e1f4..5c613b26e1 100644 --- a/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp +++ b/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp @@ -75,7 +75,7 @@ void CustomGUIReader::init(std::string& className, int createFunc, int setPropsF ObjectFactory* factoryCreate = ObjectFactory::getInstance(); ObjectFactory::TInfo t; t._class = className; - t._func = CC_CALLBACK_0(CustomGUIReader::createInstance, this); + t._func = AX_CALLBACK_0(CustomGUIReader::createInstance, this); factoryCreate->registerType(t); auto guiReader = GUIReader::getInstance(); diff --git a/extensions/scripting/lua-bindings/manual/cocostudio/lua_axis_cocostudio_manual.cpp b/extensions/scripting/lua-bindings/manual/cocostudio/lua_axis_cocostudio_manual.cpp index 6ada683d8a..0eb224f1a9 100644 --- a/extensions/scripting/lua-bindings/manual/cocostudio/lua_axis_cocostudio_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/cocostudio/lua_axis_cocostudio_manual.cpp @@ -276,7 +276,7 @@ static int lua_axis_ArmatureDataManager_addArmatureFileInfoAsyncCallFunc(lua_Sta ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); self->addArmatureFileInfoAsync(configFilePath, wrapper, - CC_SCHEDULE_SELECTOR(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback)); + AX_SCHEDULE_SELECTOR(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback)); return 0; } @@ -302,7 +302,7 @@ static int lua_axis_ArmatureDataManager_addArmatureFileInfoAsyncCallFunc(lua_Sta ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); self->addArmatureFileInfoAsync(imagePath, plistPath, configFilePath, wrapper, - CC_SCHEDULE_SELECTOR(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback)); + AX_SCHEDULE_SELECTOR(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback)); return 0; } diff --git a/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.cpp b/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.cpp index 5d4041c27b..6c9ce2b4b8 100644 --- a/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.cpp @@ -25,7 +25,7 @@ ****************************************************************************/ #include "scripting/lua-bindings/manual/controller/lua_axis_controller_manual.hpp" -#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) # include "scripting/lua-bindings/manual/tolua_fix.h" # include "scripting/lua-bindings/manual/LuaBasicConversions.h" @@ -138,7 +138,7 @@ static int tolua_axis_EventListenerController_clone(lua_State* tolua_S) return 1; } - CCLOG("'clone' has wrong number of arguments: %d, was expecting %d\n", argc, 0); + AXLOG("'clone' has wrong number of arguments: %d, was expecting %d\n", argc, 0); return 0; # if COCOS2D_DEBUG >= 1 @@ -280,7 +280,7 @@ static int tolua_axis_EventListenerController_registerScriptHandler(lua_State* t return 0; } - CCLOG("'registerScriptHandler' has wrong number of arguments: %d, was expecting %d\n", argc, 2); + AXLOG("'registerScriptHandler' has wrong number of arguments: %d, was expecting %d\n", argc, 2); return 0; # if COCOS2D_DEBUG >= 1 @@ -349,7 +349,7 @@ static int tolua_axis_Controller_getKeyStatus(lua_State* tolua_S) return 1; } - CCLOG("'clone' has wrong number of arguments: %d, was expecting %d\n", argc, 0); + AXLOG("'clone' has wrong number of arguments: %d, was expecting %d\n", argc, 0); return 0; # if COCOS2D_DEBUG >= 1 @@ -381,4 +381,4 @@ int register_all_axis_controller_manual(lua_State* L) return 0; } -#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#endif //#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) diff --git a/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.hpp b/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.hpp index 5f2d0a692d..a76ca137c3 100644 --- a/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.hpp +++ b/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.hpp @@ -27,10 +27,10 @@ #include "tolua++.h" -#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) TOLUA_API int register_all_axis_controller_manual(lua_State* L); -#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#endif //#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) #endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_CONTROLLER_MANUAL_H diff --git a/extensions/scripting/lua-bindings/manual/lua_module_register.cpp b/extensions/scripting/lua-bindings/manual/lua_module_register.cpp index eaacb1b4c6..1c97a36492 100644 --- a/extensions/scripting/lua-bindings/manual/lua_module_register.cpp +++ b/extensions/scripting/lua-bindings/manual/lua_module_register.cpp @@ -66,10 +66,10 @@ int lua_module_register(lua_State* L) register_spine_module(L); register_cocos3d_module(L); register_audioengine_module(L); -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION register_physics3d_module(L); #endif -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH register_navmesh_module(L); #endif diff --git a/extensions/scripting/lua-bindings/manual/lua_module_register.h b/extensions/scripting/lua-bindings/manual/lua_module_register.h index 2601c1d0c9..be92f7d819 100644 --- a/extensions/scripting/lua-bindings/manual/lua_module_register.h +++ b/extensions/scripting/lua-bindings/manual/lua_module_register.h @@ -28,6 +28,6 @@ #include "lua.h" #include "scripting/lua-bindings/manual/Lua-BindingsExport.h" -CC_LUA_DLL int lua_module_register(lua_State* L); +AX_LUA_DLL int lua_module_register(lua_State* L); #endif // __LUA_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_LUA_MODULE_REGISTER_H__ diff --git a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.cpp b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.cpp index 0110acaddb..803a551977 100644 --- a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.cpp +++ b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.cpp @@ -25,7 +25,7 @@ #include "scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.h" #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "scripting/lua-bindings/manual/LuaBasicConversions.h" # include "navmesh/CCNavMeshAgent.h" diff --git a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.h b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.h index db2a574f36..cadc4143ad 100644 --- a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.h +++ b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.h @@ -25,7 +25,7 @@ #ifndef __SCRIPTING_LUA_BINDING_MANUAL_NAVMESH_LUA_AXIS_NAVMESH_CONVERSIONS_H__ #define __SCRIPTING_LUA_BINDING_MANUAL_NAVMESH_LUA_AXIS_NAVMESH_CONVERSIONS_H__ -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "scripting/lua-bindings/manual/tolua_fix.h" # include "platform/CCPlatformMacros.h" @@ -47,5 +47,5 @@ extern bool luaval_to_offmeshlinkdata(lua_State* L, extern void navmeshagentparam_to_luaval(lua_State* L, const axis::NavMeshAgentParam& inValue); extern void offmeshlinkdata_to_luaval(lua_State* L, const axis::OffMeshLinkData& inValue); -#endif // #if CC_USE_NAVMESH +#endif // #if AX_USE_NAVMESH #endif // __COCOS_SCRIPTING_LUA_BINDING_MANUAL_NAVMESH_LUA_NAVMESH_CONVERSIONS_H__ diff --git a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.cpp b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.cpp index ad027d2cfd..602d9554b2 100644 --- a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.h" # include "scripting/lua-bindings/auto/lua_axis_navmesh_auto.hpp" # include "scripting/lua-bindings/manual/tolua_fix.h" diff --git a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.h b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.h index 344be3c703..af664e1120 100644 --- a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.h +++ b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.h @@ -25,7 +25,7 @@ #ifndef SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_AXIS_NAVMESH_MANUAL_H__ #define SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_AXIS_NAVMESH_MANUAL_H__ -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH #include "tolua++.h" @@ -47,5 +47,5 @@ TOLUA_API int register_navmesh_module(lua_State* L); // end group /// @} -#endif // #if CC_USE_NAVMESH +#endif // #if AX_USE_NAVMESH #endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_COCOS2DX_NAVMESH_MANUAL_H__ diff --git a/extensions/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp b/extensions/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp index 10ddd0a6ad..c7ecbc1592 100644 --- a/extensions/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp +++ b/extensions/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp @@ -152,7 +152,7 @@ LuaMinXmlHttpRequest::~LuaMinXmlHttpRequest() { _httpHeader.clear(); _requestHeader.clear(); - CC_SAFE_RELEASE_NULL(_httpRequest); + AX_SAFE_RELEASE_NULL(_httpRequest); } /** @@ -212,14 +212,14 @@ void LuaMinXmlHttpRequest::_sendRequest() if (0 != strlen(response->getHttpRequest()->getTag())) { - CCLOG("%s completed", response->getHttpRequest()->getTag()); + AXLOG("%s completed", response->getHttpRequest()->getTag()); } int statusCode = response->getResponseCode(); if (!response->isSucceed()) { - CCLOG("Response failed, statusCode: %d", statusCode); + AXLOG("Response failed, statusCode: %d", statusCode); if (statusCode == 0) { _errorFlag = true; @@ -232,7 +232,7 @@ void LuaMinXmlHttpRequest::_sendRequest() if (0 != handler) { - CCLOG("come in handler, handler is %d", handler); + AXLOG("come in handler, handler is %d", handler); axis::CommonScriptData data(handler, ""); axis::ScriptEvent event(axis::ScriptEventType::kCommonEvent, (void*)&data); axis::ScriptEngineManager::sendEventToLua(event); @@ -714,7 +714,7 @@ static int lua_get_XMLHttpRequest_response(lua_State* L) pStack->pushLuaValueArray(array); - CC_SAFE_DELETE_ARRAY(tmpData); + AX_SAFE_DELETE_ARRAY(tmpData); return 1; } else diff --git a/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.cpp b/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.cpp index 538949c5e2..1f5bb6b830 100644 --- a/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.cpp @@ -25,14 +25,14 @@ #include "scripting/lua-bindings/manual/base/lua_axis_base_manual.hpp" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "scripting/lua-bindings/manual/tolua_fix.h" # include "scripting/lua-bindings/manual/LuaBasicConversions.h" # include "scripting/lua-bindings/manual/CCLuaValue.h" # include "scripting/lua-bindings/manual/CCLuaEngine.h" # include "2d/CCScene.h" -# ifndef CC_SAFE_DELETE_ARRAY +# ifndef AX_SAFE_DELETE_ARRAY # define do \ { \ if (p) \ @@ -375,11 +375,11 @@ int lua_axis_physics_PhysicsBody_createPolygon(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createPolygon(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -411,11 +411,11 @@ int lua_axis_physics_PhysicsBody_createPolygon(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "ax.PhysicsBody:createPolygon"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createPolygon(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { @@ -450,11 +450,11 @@ int lua_axis_physics_PhysicsBody_createPolygon(lua_State* tolua_S) ok &= luaval_to_vec2(tolua_S, 4, &arg3, "ax.PhysicsBody:createPolygon"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createPolygon(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -509,11 +509,11 @@ int lua_axis_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgePolygon(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -545,11 +545,11 @@ int lua_axis_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "ax.PhysicsBody:createEdgePolygon"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgePolygon(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -583,11 +583,11 @@ int lua_axis_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4, &arg3, "ax.PhysicsBody:createEdgePolygon"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgePolygon(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -642,11 +642,11 @@ int lua_axis_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgeChain(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -678,11 +678,11 @@ int lua_axis_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "ax.PhysicsBody:createEdgeChain"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgeChain(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -716,11 +716,11 @@ int lua_axis_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4, &arg3, "ax.PhysicsBody:createEdgeChain"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgeChain(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -775,12 +775,12 @@ int lua_axis_physics_PhysicsShape_recenterPoints(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShape::recenterPoints(arg0, arg1); vec2_array_to_luaval(tolua_S, arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } @@ -800,12 +800,12 @@ int lua_axis_physics_PhysicsShape_recenterPoints(lua_State* tolua_S) ok &= luaval_to_vec2(tolua_S, 3, &arg2, "ax.PhysicsShape:recenterPoints"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShape::recenterPoints(arg0, arg1, arg2); vec2_array_to_luaval(tolua_S, arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "recenterPoints", argc, 2); @@ -847,11 +847,11 @@ int lua_axis_physics_PhysicsShape_getPolygonCenter(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::Vec2 ret = axis::PhysicsShape::getPolygonCenter(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); vec2_to_luaval(tolua_S, ret); return 1; } @@ -938,7 +938,7 @@ int lua_axis_physics_PhysicsShapePolygon_getPoints(lua_State* tolua_S) axis::Vec2* arg0 = new axis::Vec2[count]; cobj->getPoints(arg0); vec2_array_to_luaval(tolua_S, arg0, count); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getPoints", argc, 1); @@ -983,11 +983,11 @@ int lua_axis_physics_PhysicsShapePolygon_create(lua_State* tolua_S) if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapePolygon* ret = axis::PhysicsShapePolygon::create(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapePolygon", (axis::PhysicsShapePolygon*)ret); return 1; @@ -1008,11 +1008,11 @@ int lua_axis_physics_PhysicsShapePolygon_create(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "ax.PhysicsShapePolygon:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapePolygon* ret = axis::PhysicsShapePolygon::create(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapePolygon", (axis::PhysicsShapePolygon*)ret); return 1; @@ -1035,11 +1035,11 @@ int lua_axis_physics_PhysicsShapePolygon_create(lua_State* tolua_S) ok &= luaval_to_vec2(tolua_S, 4, &arg3, "ax.PhysicsShapePolygon:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapePolygon* ret = axis::PhysicsShapePolygon::create(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapePolygon", (axis::PhysicsShapePolygon*)ret); return 1; @@ -1082,11 +1082,11 @@ int lua_axis_physics_PhysicsShapePolygon_calculateArea(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } double ret = axis::PhysicsShapePolygon::calculateArea(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); tolua_pushnumber(tolua_S, (lua_Number)ret); return 1; } @@ -1130,11 +1130,11 @@ int lua_axis_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg1); + AX_SAFE_DELETE_ARRAY(arg1); return 0; } double ret = axis::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg1); + AX_SAFE_DELETE_ARRAY(arg1); tolua_pushnumber(tolua_S, (lua_Number)ret); return 1; } @@ -1156,11 +1156,11 @@ int lua_axis_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S) ok &= luaval_to_vec2(tolua_S, 4, &arg3, "ax.PhysicsShapePolygon:calculateMoment"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg1); + AX_SAFE_DELETE_ARRAY(arg1); return 0; } double ret = axis::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg1); + AX_SAFE_DELETE_ARRAY(arg1); tolua_pushnumber(tolua_S, (lua_Number)ret); return 1; } @@ -1204,7 +1204,7 @@ int lua_axis_physics_PhysicsShapeEdgeBox_getPoints(lua_State* tolua_S) axis::Vec2* arg0 = new axis::Vec2[count]; cobj->getPoints(arg0); vec2_array_to_luaval(tolua_S, arg0, count); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getPoints", argc, 1); @@ -1250,7 +1250,7 @@ int lua_axis_physics_PhysicsShapeEdgePolygon_getPoints(lua_State* tolua_S) axis::Vec2* arg0 = new axis::Vec2[count]; cobj->getPoints(arg0); vec2_array_to_luaval(tolua_S, arg0, count); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getPoints", argc, 1); @@ -1295,7 +1295,7 @@ int lua_axis_physics_PhysicsShapeEdgeChain_getPoints(lua_State* tolua_S) axis::Vec2* arg0 = new axis::Vec2[count]; cobj->getPoints(arg0); vec2_array_to_luaval(tolua_S, arg0, count); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getPoints", argc, 1); @@ -1449,11 +1449,11 @@ int lua_axis_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgePolygon* ret = axis::PhysicsShapeEdgePolygon::create(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapeEdgePolygon", (axis::PhysicsShapeEdgePolygon*)ret); return 1; @@ -1474,11 +1474,11 @@ int lua_axis_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "ax.PhysicsShapeEdgePolygon:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgePolygon* ret = axis::PhysicsShapeEdgePolygon::create(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapeEdgePolygon", (axis::PhysicsShapeEdgePolygon*)ret); return 1; @@ -1501,11 +1501,11 @@ int lua_axis_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4, &arg3, "ax.PhysicsShapeEdgePolygon:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgePolygon* ret = axis::PhysicsShapeEdgePolygon::create(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapeEdgePolygon", (axis::PhysicsShapeEdgePolygon*)ret); return 1; @@ -1549,11 +1549,11 @@ int lua_axis_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgeChain* ret = axis::PhysicsShapeEdgeChain::create(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapeEdgeChain", (axis::PhysicsShapeEdgeChain*)ret); return 1; @@ -1574,11 +1574,11 @@ int lua_axis_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "ax.PhysicsShapeEdgeChain:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgeChain* ret = axis::PhysicsShapeEdgeChain::create(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapeEdgeChain", (axis::PhysicsShapeEdgeChain*)ret); return 1; @@ -1601,11 +1601,11 @@ int lua_axis_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4, &arg3, "ax.PhysicsShapeEdgeChain:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgeChain* ret = axis::PhysicsShapeEdgeChain::create(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapeEdgeChain", (axis::PhysicsShapeEdgeChain*)ret); return 1; diff --git a/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.hpp b/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.hpp index 1e7f814d9d..73603f7d34 100644 --- a/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.hpp +++ b/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.hpp @@ -25,7 +25,7 @@ #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_PHYSICS_MANUAL_H #define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_PHYSICS_MANUAL_H -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS #ifdef __cplusplus extern "C" { @@ -40,6 +40,6 @@ extern "C" { int register_all_axis_physics_manual(lua_State* tolua_S); -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif // #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_PHYSICS_MANUAL_H diff --git a/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.cpp b/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.cpp index 19eb0e5db1..873346690a 100644 --- a/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" #include "base/ccConfig.h" -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION # include "scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.h" # include "scripting/lua-bindings/auto/lua_axis_physics3d_auto.hpp" # include "scripting/lua-bindings/manual/tolua_fix.h" diff --git a/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.h b/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.h index 8a8e3b9383..299002eb72 100644 --- a/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.h +++ b/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.h @@ -25,7 +25,7 @@ #ifndef SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_AXIS_PHYSICS3D_MANUAL_H__ #define SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_AXIS_PHYSICS3D_MANUAL_H__ -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION #include "tolua++.h" @@ -47,5 +47,5 @@ TOLUA_API int register_physics3d_module(lua_State* L); // end group /// @} -#endif // #if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#endif // #if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION #endif // #ifndef SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_AXIS_PHYSICS3D_MANUAL_H__ diff --git a/extensions/scripting/lua-bindings/manual/ui/lua_axis_ui_manual.cpp b/extensions/scripting/lua-bindings/manual/ui/lua_axis_ui_manual.cpp index 152eeda705..861690190f 100644 --- a/extensions/scripting/lua-bindings/manual/ui/lua_axis_ui_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/ui/lua_axis_ui_manual.cpp @@ -24,12 +24,12 @@ ****************************************************************************/ #include "scripting/lua-bindings/manual/ui/lua_axis_ui_manual.hpp" #include "scripting/lua-bindings/auto/lua_axis_ui_auto.hpp" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) && !defined(AX_TARGET_OS_TVOS) # include "scripting/lua-bindings/auto/lua_axis_video_auto.hpp" # include "scripting/lua-bindings/manual/ui/lua_axis_video_manual.hpp" # include "scripting/lua-bindings/auto/lua_axis_webview_auto.hpp" # include "scripting/lua-bindings/manual/ui/lua_axis_webview_manual.hpp" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # if defined(AX_ENABLE_MFMEDIA) # include "scripting/lua-bindings/auto/lua_axis_video_auto.hpp" # include "scripting/lua-bindings/manual/ui/lua_axis_video_manual.hpp" @@ -1243,12 +1243,12 @@ int register_ui_module(lua_State* L) { register_all_axis_ui(L); register_all_axis_ui_manual(L); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) && !defined(AX_TARGET_OS_TVOS) register_all_axis_video(L); register_all_axis_video_manual(L); register_all_axis_webview(L); register_all_axis_webview_manual(L); -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # if defined(AX_ENABLE_MFMEDIA) register_all_axis_video(L); register_all_axis_video_manual(L); diff --git a/extensions/scripting/lua-bindings/script/cocos2d/Cocos2dConstants.lua b/extensions/scripting/lua-bindings/script/cocos2d/Cocos2dConstants.lua index d8ba7cabd2..7b4144746e 100644 --- a/extensions/scripting/lua-bindings/script/cocos2d/Cocos2dConstants.lua +++ b/extensions/scripting/lua-bindings/script/cocos2d/Cocos2dConstants.lua @@ -180,15 +180,15 @@ cc.SHADER_POSITION_TEXTURE_COLOR = 'ShaderPositionTextureColor' cc.SHADER_POSITION_TEXTURE_COLOR_ALPHA_TEST = 'ShaderPositionTextureColorAlphaTest' cc.SHADER_POSITION_TEXTURE_U_COLOR = 'ShaderPositionTexture_uColor' cc.SHADER_POSITION_U_COLOR = 'ShaderPosition_uColor' -cc.UNIFORM_ALPHA_TEST_VALUE_S = 'CC_AlphaValue' -cc.UNIFORM_COS_TIME_S = 'CC_CosTime' -cc.UNIFORM_MV_MATRIX_S = 'CC_MVMatrix' -cc.UNIFORM_MVP_MATRIX_S = 'CC_MVPMatrix' -cc.UNIFORM_P_MATRIX_S = 'CC_PMatrix' -cc.UNIFORM_RANDOM01_S = 'CC_Random01' -cc.UNIFORM_SAMPLER_S = 'CC_Texture0' -cc.UNIFORM_SIN_TIME_S = 'CC_SinTime' -cc.UNIFORM_TIME_S = 'CC_Time' +cc.UNIFORM_ALPHA_TEST_VALUE_S = 'AX_AlphaValue' +cc.UNIFORM_COS_TIME_S = 'AX_CosTime' +cc.UNIFORM_MV_MATRIX_S = 'AX_MVMatrix' +cc.UNIFORM_MVP_MATRIX_S = 'AX_MVPMatrix' +cc.UNIFORM_P_MATRIX_S = 'AX_PMatrix' +cc.UNIFORM_RANDOM01_S = 'AX_Random01' +cc.UNIFORM_SAMPLER_S = 'AX_Texture0' +cc.UNIFORM_SIN_TIME_S = 'AX_SinTime' +cc.UNIFORM_TIME_S = 'AX_Time' cc.PLATFORM_OS_WINDOWS = 0 cc.PLATFORM_OS_LINUX = 1 diff --git a/extensions/scripting/lua-bindings/script/extension/ExtensionConstants.lua b/extensions/scripting/lua-bindings/script/extension/ExtensionConstants.lua index 8d06f9403c..0bfc8f80f0 100644 --- a/extensions/scripting/lua-bindings/script/extension/ExtensionConstants.lua +++ b/extensions/scripting/lua-bindings/script/extension/ExtensionConstants.lua @@ -1,3 +1,7 @@ +if nil == cc.Control then + return +end + cc.CONTROL_STATE_NORMAL = 1 cc.CONTROL_STATE_HIGH_LIGHTED = 2 cc.CONTROL_STATE_DISABLED = 4 diff --git a/extensions/scripting/lua-bindings/script/framework/display.lua b/extensions/scripting/lua-bindings/script/framework/display.lua index 014aa0e496..d12666df15 100644 --- a/extensions/scripting/lua-bindings/script/framework/display.lua +++ b/extensions/scripting/lua-bindings/script/framework/display.lua @@ -30,12 +30,12 @@ local view = director:getOpenGLView() if not view then local width = 960 local height = 640 - if CC_DESIGN_RESOLUTION then - if CC_DESIGN_RESOLUTION.width then - width = CC_DESIGN_RESOLUTION.width + if AX_DESIGN_RESOLUTION then + if AX_DESIGN_RESOLUTION.width then + width = AX_DESIGN_RESOLUTION.width end - if CC_DESIGN_RESOLUTION.height then - height = CC_DESIGN_RESOLUTION.height + if AX_DESIGN_RESOLUTION.height then + height = AX_DESIGN_RESOLUTION.height end end view = cc.GLViewImpl:createWithRect("Cocos2d-Lua", cc.rect(0, 0, width, height)) @@ -157,8 +157,8 @@ function display.setAutoScale(configs) setConstants() end -if type(CC_DESIGN_RESOLUTION) == "table" then - display.setAutoScale(CC_DESIGN_RESOLUTION) +if type(AX_DESIGN_RESOLUTION) == "table" then + display.setAutoScale(AX_DESIGN_RESOLUTION) end display.COLOR_WHITE = cc.c3b(255, 255, 255) diff --git a/extensions/scripting/lua-bindings/script/framework/init.lua b/extensions/scripting/lua-bindings/script/framework/init.lua index edf8ca9803..d5a53267fe 100644 --- a/extensions/scripting/lua-bindings/script/framework/init.lua +++ b/extensions/scripting/lua-bindings/script/framework/init.lua @@ -76,6 +76,6 @@ function cc.disable_global() }) end -if CC_DISABLE_GLOBAL then +if AX_DISABLE_GLOBAL then cc.disable_global() end diff --git a/extensions/scripting/lua-bindings/script/init.lua b/extensions/scripting/lua-bindings/script/init.lua index be4a4dc615..842b306222 100644 --- a/extensions/scripting/lua-bindings/script/init.lua +++ b/extensions/scripting/lua-bindings/script/init.lua @@ -106,6 +106,6 @@ require "cocos.cocos2d.bitExtend" -- physics3d require "cocos.physics3d.physics3d-constants" -if CC_USE_FRAMEWORK then +if AX_USE_FRAMEWORK then require "cocos.framework.init" end diff --git a/extensions/spine/SkeletonAnimation.cpp b/extensions/spine/SkeletonAnimation.cpp index 2edc8687c7..0ddba15f56 100644 --- a/extensions/spine/SkeletonAnimation.cpp +++ b/extensions/spine/SkeletonAnimation.cpp @@ -151,7 +151,7 @@ void SkeletonAnimation::draw(axis::Renderer *renderer, const axis::Mat4 &transfo } void SkeletonAnimation::setAnimationStateData (AnimationStateData* stateData) { - CCASSERT(stateData, "stateData cannot be null."); + AXASSERT(stateData, "stateData cannot be null."); if (_ownsAnimationStateData) delete _state->getData(); delete _state; diff --git a/extensions/spine/SkeletonAnimation.h b/extensions/spine/SkeletonAnimation.h index 6387c20a45..91bb19e182 100644 --- a/extensions/spine/SkeletonAnimation.h +++ b/extensions/spine/SkeletonAnimation.h @@ -58,12 +58,12 @@ public: static SkeletonAnimation* createWithBinaryFile (const std::string& skeletonBinaryFile, const std::string& atlasFile, float scale = 1); // Use createWithJsonFile instead - CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale = 1) + AX_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale = 1) { return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlas, scale); } // Use createWithJsonFile instead - CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale = 1) + AX_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale = 1) { return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlasFile, scale); } diff --git a/extensions/spine/SkeletonBatch.cpp b/extensions/spine/SkeletonBatch.cpp index 9e5bdb395b..21471df885 100644 --- a/extensions/spine/SkeletonBatch.cpp +++ b/extensions/spine/SkeletonBatch.cpp @@ -77,11 +77,11 @@ SkeletonBatch::~SkeletonBatch () { Director::getInstance()->getEventDispatcher()->removeCustomEventListeners(EVENT_AFTER_DRAW_RESET_POSITION); for (unsigned int i = 0; i < _commandsPool.size(); i++) { - CC_SAFE_RELEASE(_commandsPool[i]->getPipelineDescriptor().programState); + AX_SAFE_RELEASE(_commandsPool[i]->getPipelineDescriptor().programState); delete _commandsPool[i]; _commandsPool[i] = nullptr; } - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); } backend::ProgramState* SkeletonBatch::updateCommandPipelinePS(SkeletonCommand* command, backend::ProgramState* programState) @@ -92,7 +92,7 @@ backend::ProgramState* SkeletonBatch::updateCommandPipelinePS(SkeletonCommand* c #else if(currentState == nullptr || currentState->getProgram() != programState->getProgram()) { #endif - CC_SAFE_RELEASE(currentState); + AX_SAFE_RELEASE(currentState); currentState = programState->clone(); auto vertexLayout = currentState->getVertexLayout(); @@ -169,7 +169,7 @@ axis::TrianglesCommand* SkeletonBatch::addCommand(axis::Renderer* renderer, floa if (programState == nullptr) programState = _programState; - CCASSERT(programState, "programState should not be null"); + AXASSERT(programState, "programState should not be null"); auto pipelinePS = updateCommandPipelinePS(command, programState); diff --git a/extensions/spine/SkeletonRenderer.cpp b/extensions/spine/SkeletonRenderer.cpp index 9019cb47b0..43828e72be 100644 --- a/extensions/spine/SkeletonRenderer.cpp +++ b/extensions/spine/SkeletonRenderer.cpp @@ -188,7 +188,7 @@ void SkeletonRenderer::initWithJsonFile (const std::string& skeletonDataFile, At SkeletonJson json(_attachmentLoader); json.setScale(scale); SkeletonData* skeletonData = json.readSkeletonDataFile(skeletonDataFile.c_str()); - CCASSERT(skeletonData, (!json.getError().isEmpty() ? json.getError().buffer() : "Error reading skeleton data.")); + AXASSERT(skeletonData, (!json.getError().isEmpty() ? json.getError().buffer() : "Error reading skeleton data.")); _ownsSkeleton = true; setSkeletonData(skeletonData, true); @@ -198,14 +198,14 @@ void SkeletonRenderer::initWithJsonFile (const std::string& skeletonDataFile, At void SkeletonRenderer::initWithJsonFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) { _atlas = new (__FILE__, __LINE__) Atlas(atlasFile.c_str(), &textureLoader, true); - CCASSERT(_atlas, "Error reading atlas file."); + AXASSERT(_atlas, "Error reading atlas file."); _attachmentLoader = new (__FILE__, __LINE__) Cocos2dAtlasAttachmentLoader(_atlas); SkeletonJson json(_attachmentLoader); json.setScale(scale); SkeletonData* skeletonData = json.readSkeletonDataFile(skeletonDataFile.c_str()); - CCASSERT(skeletonData, (!json.getError().isEmpty() ? json.getError().buffer() : "Error reading skeleton data.")); + AXASSERT(skeletonData, (!json.getError().isEmpty() ? json.getError().buffer() : "Error reading skeleton data.")); _ownsSkeleton = true; _ownsAtlas = true; @@ -221,7 +221,7 @@ void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile, SkeletonBinary binary(_attachmentLoader); binary.setScale(scale); SkeletonData* skeletonData = binary.readSkeletonDataFile(skeletonDataFile.c_str()); - CCASSERT(skeletonData, (!binary.getError().isEmpty() ? binary.getError().buffer() : "Error reading skeleton data.")); + AXASSERT(skeletonData, (!binary.getError().isEmpty() ? binary.getError().buffer() : "Error reading skeleton data.")); _ownsSkeleton = true; setSkeletonData(skeletonData, true); @@ -230,14 +230,14 @@ void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile, void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) { _atlas = new (__FILE__, __LINE__) Atlas(atlasFile.c_str(), &textureLoader, true); - CCASSERT(_atlas, "Error reading atlas file."); + AXASSERT(_atlas, "Error reading atlas file."); _attachmentLoader = new (__FILE__, __LINE__) Cocos2dAtlasAttachmentLoader(_atlas); SkeletonBinary binary(_attachmentLoader); binary.setScale(scale); SkeletonData* skeletonData = binary.readSkeletonDataFile(skeletonDataFile.c_str()); - CCASSERT(skeletonData, (!binary.getError().isEmpty() ? binary.getError().buffer() : "Error reading skeleton data.")); + AXASSERT(skeletonData, (!binary.getError().isEmpty() ? binary.getError().buffer() : "Error reading skeleton data.")); _ownsSkeleton = true; _ownsAtlas = true; setSkeletonData(skeletonData, true); @@ -266,7 +266,7 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t VLA(float, worldCoords, coordCount); transformWorldVertices(worldCoords, coordCount, *_skeleton, _startSlotIndex, _endSlotIndex); -#if CC_USE_CULLING +#if AX_USE_CULLING const axis::Rect bb = computeBoundingRect(worldCoords, coordCount / 2); if (cullRectangle(renderer, transform, bb)) { @@ -851,7 +851,7 @@ bool SkeletonRenderer::getDebugBoundingRectEnabled() const { } void SkeletonRenderer::onEnter () { -#if CC_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 if (_scriptType == kScriptTypeJavascript && ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnEnter)) return; #endif Node::onEnter(); @@ -859,7 +859,7 @@ void SkeletonRenderer::onEnter () { } void SkeletonRenderer::onExit () { -#if CC_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 if (_scriptType == kScriptTypeJavascript && ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnExit)) return; #endif Node::onExit(); diff --git a/extensions/spine/SkeletonTwoColorBatch.cpp b/extensions/spine/SkeletonTwoColorBatch.cpp index fcdcbc6466..8b08c061f4 100644 --- a/extensions/spine/SkeletonTwoColorBatch.cpp +++ b/extensions/spine/SkeletonTwoColorBatch.cpp @@ -157,7 +157,7 @@ void TwoColorTrianglesCommand::init(float globalOrder, axis::Texture2D *texture, if (_triangles.indexCount % 3 != 0) { int count = _triangles.indexCount; _triangles.indexCount = count / 3 * 3; - CCLOGERROR("Resize indexCount from %d to %d, size must be multiple times of 3", count, _triangles.indexCount); + AXLOGERROR("Resize indexCount from %d to %d, size must be multiple times of 3", count, _triangles.indexCount); } _mv = mv; @@ -194,19 +194,19 @@ void TwoColorTrianglesCommand::updateCommandPipelineDescriptor(axis::backend::Pr if (programState != nullptr) { if (_programState != programState) { - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); _programState = programState; // Because the programState belong to Node, so no need to clone - CC_SAFE_RETAIN(_programState); + AX_SAFE_RETAIN(_programState); needsUpdateStateLayout = true; } } else { needsUpdateStateLayout = _programState != nullptr && _programState->getProgram() != __twoColorProgramState->getProgram(); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); _programState = __twoColorProgramState->clone(); } - CCASSERT(_programState, "programState should not be null"); + AXASSERT(_programState, "programState should not be null"); pipelinePS = _programState; if (needsUpdateStateLayout) @@ -218,7 +218,7 @@ void TwoColorTrianglesCommand::updateCommandPipelineDescriptor(axis::backend::Pr TwoColorTrianglesCommand::~TwoColorTrianglesCommand() { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); } void TwoColorTrianglesCommand::generateMaterialID() { diff --git a/extensions/spine/spine-cocos2dx.cpp b/extensions/spine/spine-cocos2dx.cpp index ebeeb4a930..f198e96783 100644 --- a/extensions/spine/spine-cocos2dx.cpp +++ b/extensions/spine/spine-cocos2dx.cpp @@ -139,7 +139,7 @@ Cocos2dTextureLoader::~Cocos2dTextureLoader() { } void Cocos2dTextureLoader::load(AtlasPage& page, const spine::String& path) { Texture2D* texture = Director::getInstance()->getTextureCache()->addImage(path.buffer()); - CCASSERT(texture != nullptr, "Invalid image"); + AXASSERT(texture != nullptr, "Invalid image"); if (texture) { texture->retain(); #if COCOS2D_VERSION >= 0x0040000 diff --git a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp index 772a9af1ae..4581fe3358 100644 --- a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp +++ b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp @@ -86,7 +86,7 @@ void CrashTest::onEnter() // After 1.5 second, self will be removed. child->runAction(Sequence::create(DelayTime::create(1.4f), - CallFunc::create(CC_CALLBACK_0(CrashTest::removeThis, this)), nullptr)); + CallFunc::create(AX_CALLBACK_0(CrashTest::removeThis, this)), nullptr)); } void CrashTest::removeThis() @@ -116,7 +116,7 @@ void LogicTest::onEnter() grossini->setPosition(VisibleRect::center()); grossini->runAction(Sequence::create(MoveBy::create(1, Vec2(150.0f, 0.0f)), - CallFuncN::create(CC_CALLBACK_1(LogicTest::bugMe, this)), nullptr)); + CallFuncN::create(AX_CALLBACK_1(LogicTest::bugMe, this)), nullptr)); } void LogicTest::bugMe(Node* node) @@ -160,12 +160,12 @@ void PauseTest::onEnter() auto director = Director::getInstance(); director->getActionManager()->addAction(action, grossini, true); - schedule(CC_SCHEDULE_SELECTOR(PauseTest::unpause), 3); + schedule(AX_SCHEDULE_SELECTOR(PauseTest::unpause), 3); } void PauseTest::unpause(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(PauseTest::unpause)); + unschedule(AX_SCHEDULE_SELECTOR(PauseTest::unpause)); auto node = getChildByTag(kTagGrossini); auto director = Director::getInstance(); director->getActionManager()->resumeTarget(node); @@ -190,7 +190,7 @@ void StopActionTest::onEnter() l->setPosition(VisibleRect::center().x, VisibleRect::top().y - 75); auto pMove = MoveBy::create(2, Vec2(200.0f, 0.0f)); - auto pCallback = CallFunc::create(CC_CALLBACK_0(StopActionTest::stopAction, this)); + auto pCallback = CallFunc::create(AX_CALLBACK_0(StopActionTest::stopAction, this)); auto pSequence = Sequence::create(pMove, pCallback, nullptr); pSequence->setTag(kTagSequence); @@ -290,12 +290,12 @@ void ResumeTest::onEnter() director->getActionManager()->pauseTarget(pGrossini); pGrossini->runAction(RotateBy::create(2, 360)); - this->schedule(CC_SCHEDULE_SELECTOR(ResumeTest::resumeGrossini), 3.0f); + this->schedule(AX_SCHEDULE_SELECTOR(ResumeTest::resumeGrossini), 3.0f); } void ResumeTest::resumeGrossini(float time) { - this->unschedule(CC_SCHEDULE_SELECTOR(ResumeTest::resumeGrossini)); + this->unschedule(AX_SCHEDULE_SELECTOR(ResumeTest::resumeGrossini)); auto pGrossini = getChildByTag(kTagGrossini); auto director = Director::getInstance(); diff --git a/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp b/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp index 8f87c0a626..3f13c5796f 100644 --- a/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp +++ b/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp @@ -105,12 +105,12 @@ void SpriteEase::onEnter() auto a = _kathia->runAction(RepeatForever::create(seq3)); a->setTag(1); - schedule(CC_SCHEDULE_SELECTOR(SpriteEase::testStopAction), 6.25f); + schedule(AX_SCHEDULE_SELECTOR(SpriteEase::testStopAction), 6.25f); } void SpriteEase::testStopAction(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(SpriteEase::testStopAction)); + unschedule(AX_SCHEDULE_SELECTOR(SpriteEase::testStopAction)); _tamara->stopActionByTag(1); _kathia->stopActionByTag(1); _grossini->stopActionByTag(1); @@ -922,7 +922,7 @@ void SpeedTest::onEnter() _tamara->runAction(action3); _kathia->runAction(action); - this->schedule(CC_SCHEDULE_SELECTOR(SpeedTest::altertime), 1.0f); //:@selector(altertime:) interval:1.0f]; + this->schedule(AX_SCHEDULE_SELECTOR(SpeedTest::altertime), 1.0f); //:@selector(altertime:) interval:1.0f]; } void SpeedTest::altertime(float dt) @@ -931,9 +931,9 @@ void SpeedTest::altertime(float dt) auto action2 = static_cast(_tamara->getActionByTag(kTagAction1)); auto action3 = static_cast(_kathia->getActionByTag(kTagAction1)); - action1->setSpeed(CCRANDOM_MINUS1_1() * 2); - action2->setSpeed(CCRANDOM_MINUS1_1() * 2); - action3->setSpeed(CCRANDOM_MINUS1_1() * 2); + action1->setSpeed(rand_minus1_1() * 2); + action2->setSpeed(rand_minus1_1() * 2); + action3->setSpeed(rand_minus1_1() * 2); } std::string SpeedTest::subtitle() const diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp index c8a5fefa31..ff9b06705f 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp @@ -740,9 +740,9 @@ void ActionSequence2::onEnter() auto action = Sequence::create( Place::create(Vec2(200.0f, 200.0f)), Show::create(), MoveBy::create(1, Vec2(100.0f, 0.0f)), - CallFunc::create(CC_CALLBACK_0(ActionSequence2::callback1, this)), - CallFunc::create(CC_CALLBACK_0(ActionSequence2::callback2, this, _grossini)), - CallFunc::create(CC_CALLBACK_0(ActionSequence2::callback3, this, _grossini, 0xbebabeba)), nullptr); + CallFunc::create(AX_CALLBACK_0(ActionSequence2::callback1, this)), + CallFunc::create(AX_CALLBACK_0(ActionSequence2::callback2, this, _grossini)), + CallFunc::create(AX_CALLBACK_0(ActionSequence2::callback3, this, _grossini, 0xbebabeba)), nullptr); _grossini->runAction(action); } @@ -822,7 +822,7 @@ void ActionCallFuncN::onEnter() centerSprites(1); auto action = Sequence::create(MoveBy::create(2.0f, Vec2(150.0f, 0.0f)), - CallFuncN::create(CC_CALLBACK_1(ActionCallFuncN::callback, this)), nullptr); + CallFuncN::create(AX_CALLBACK_1(ActionCallFuncN::callback, this)), nullptr); _grossini->runAction(action); } @@ -856,7 +856,7 @@ void ActionCallFuncND::onEnter() auto action = Sequence::create( MoveBy::create(2.0f, Vec2(200.0f, 0.0f)), - CallFuncN::create(CC_CALLBACK_1(ActionCallFuncND::doRemoveFromParentAndCleanup, this, true)), nullptr); + CallFuncN::create(AX_CALLBACK_1(ActionCallFuncND::doRemoveFromParentAndCleanup, this, true)), nullptr); _grossini->runAction(action); } @@ -929,7 +929,7 @@ void ActionCallFunction::callback2(Node* sender) addChild(label); - CCLOG("sender is: %p", sender); + AXLOG("sender is: %p", sender); } void ActionCallFunction::callback3(Node* sender, int32_t data) @@ -939,7 +939,7 @@ void ActionCallFunction::callback3(Node* sender, int32_t data) label->setPosition(s.width / 4 * 3, s.height / 2); addChild(label); - CCLOG("target is: %p, data is: %d", sender, data); + AXLOG("target is: %p, data is: %d", sender, data); } std::string ActionCallFunction::subtitle() const @@ -1243,7 +1243,7 @@ void ActionFollow::onEnter() float y = s.height; Vec2 vertices[] = {Vec2(5.0f, 5.0f), Vec2(x - 5, 5.0f), Vec2(x - 5, y - 5), Vec2(5.0f, y - 5)}; - drawNode->drawPoly(vertices, 4, true, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1.0f)); + drawNode->drawPoly(vertices, 4, true, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); this->addChild(drawNode); @@ -1280,7 +1280,7 @@ void ActionFollowWithOffset::onEnter() float y = s.height; Vec2 vertices[] = {Vec2(5.0f, 5.0f), Vec2(x - 5, 5.0f), Vec2(x - 5, y - 5), Vec2(5.0f, y - 5)}; - drawNode->drawPoly(vertices, 4, true, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1.0f)); + drawNode->drawPoly(vertices, 4, true, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); this->addChild(drawNode); @@ -1371,7 +1371,7 @@ void ActionStacked::onEnter() this->centerSprites(0); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(ActionStacked::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(ActionStacked::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -1380,7 +1380,7 @@ void ActionStacked::onEnter() void ActionStacked::addNewSpriteWithCoords(Vec2 p) { - int idx = static_cast(CCRANDOM_0_1() * 1400 / 100); + int idx = static_cast(AXRANDOM_0_1() * 1400 / 100); float w = 85.0f; float h = 121.0f; float x = (idx % 5) * w; diff --git a/tests/cpp-tests/Classes/AppDelegate.cpp b/tests/cpp-tests/Classes/AppDelegate.cpp index 666b3b77b3..e3fe4149e3 100644 --- a/tests/cpp-tests/Classes/AppDelegate.cpp +++ b/tests/cpp-tests/Classes/AppDelegate.cpp @@ -86,7 +86,7 @@ bool AppDelegate::applicationDidFinishLaunching() director->setStatsDisplay(true); -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC director->setAnimationInterval(1.0f / glfwGetVideoMode(glfwGetPrimaryMonitor())->refreshRate); #else director->setAnimationInterval(1.0f / 60); diff --git a/tests/cpp-tests/Classes/BaseTest.cpp b/tests/cpp-tests/Classes/BaseTest.cpp index bb5434a283..86e77670a1 100644 --- a/tests/cpp-tests/Classes/BaseTest.cpp +++ b/tests/cpp-tests/Classes/BaseTest.cpp @@ -113,7 +113,7 @@ protected: TestCustomTableView() { auto mouseListener = EventListenerMouse::create(); - mouseListener->onMouseScroll = CC_CALLBACK_1(TestCustomTableView::onMouseScroll, this); + mouseListener->onMouseScroll = AX_CALLBACK_1(TestCustomTableView::onMouseScroll, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(mouseListener, this); } }; @@ -133,7 +133,7 @@ void TestList::deatchTableView() { if (_tableView) _tableView->setDataSource(nullptr); - CC_SAFE_RELEASE_NULL(_tableView); + AX_SAFE_RELEASE_NULL(_tableView); } void TestList::addTest(std::string_view testName, std::function callback) @@ -156,7 +156,7 @@ void TestList::runThisTest() */ GLViewImpl* glview = (GLViewImpl*)Director::getInstance()->getOpenGLView(); -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) Size resourceSize(960, 640); glview->setWindowed(resourceSize.width, resourceSize.height); #endif @@ -421,14 +421,14 @@ bool TestCase::init() addChild(_subtitleLabel, 9999); _subtitleLabel->setPosition(VisibleRect::center().x, VisibleRect::top().y - 60); - _priorTestItem = MenuItemImage::create(s_pathB1, s_pathB2, CC_CALLBACK_1(TestCase::priorTestCallback, this)); + _priorTestItem = MenuItemImage::create(s_pathB1, s_pathB2, AX_CALLBACK_1(TestCase::priorTestCallback, this)); _restartTestItem = - MenuItemImage::create(s_pathR1, s_pathR2, CC_CALLBACK_1(TestCase::restartTestCallback, this)); - _nextTestItem = MenuItemImage::create(s_pathF1, s_pathF2, CC_CALLBACK_1(TestCase::nextTestCallback, this)); + MenuItemImage::create(s_pathR1, s_pathR2, AX_CALLBACK_1(TestCase::restartTestCallback, this)); + _nextTestItem = MenuItemImage::create(s_pathF1, s_pathF2, AX_CALLBACK_1(TestCase::nextTestCallback, this)); ttfConfig.fontSize = 20; auto backLabel = Label::createWithTTF(ttfConfig, "Back"); - auto backItem = MenuItemLabel::create(backLabel, CC_CALLBACK_1(TestCase::onBackCallback, this)); + auto backItem = MenuItemLabel::create(backLabel, AX_CALLBACK_1(TestCase::onBackCallback, this)); auto menu = Menu::create(_priorTestItem, _restartTestItem, _nextTestItem, backItem, nullptr); diff --git a/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.cpp b/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.cpp index 9be5cdae41..73a847cf7c 100644 --- a/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.cpp +++ b/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.cpp @@ -110,7 +110,7 @@ BillBoardTest::BillBoardTest() : _camera(nullptr) { // Create touch listener auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(BillBoardTest::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(BillBoardTest::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto layer3D = Layer::create(); @@ -129,14 +129,14 @@ BillBoardTest::BillBoardTest() : _camera(nullptr) for (unsigned int i = 0; i < 4; ++i) { Layer* layer = Layer::create(); - auto billboard = BillBoard::create(imgs[(unsigned int)(CCRANDOM_0_1() * 1 + 0.5f)]); + auto billboard = BillBoard::create(imgs[(unsigned int)(AXRANDOM_0_1() * 1 + 0.5f)]); billboard->setScale(0.5f); - billboard->setPosition3D(Vec3(0.0f, 0.0f, CCRANDOM_MINUS1_1() * 150.0f)); - billboard->setOpacity(static_cast(CCRANDOM_0_1() * 128 + 128)); + billboard->setPosition3D(Vec3(0.0f, 0.0f, rand_minus1_1() * 150.0f)); + billboard->setOpacity(static_cast(AXRANDOM_0_1() * 128 + 128)); _billboards.push_back(billboard); layer->addChild(billboard); _layerBillBoard->addChild(layer); - layer->runAction(RepeatForever::create(RotateBy::create(CCRANDOM_0_1() * 10, Vec3(0.0f, 45.0f, 0.0f)))); + layer->runAction(RepeatForever::create(RotateBy::create(AXRANDOM_0_1() * 10, Vec3(0.0f, 45.0f, 0.0f)))); } { @@ -174,9 +174,9 @@ BillBoardTest::BillBoardTest() : _camera(nullptr) TTFConfig ttfConfig("fonts/arial.ttf", 16); auto label1 = Label::createWithTTF(ttfConfig, "rotate+"); - auto menuItem1 = MenuItemLabel::create(label1, CC_CALLBACK_1(BillBoardTest::rotateCameraCallback, this, 10)); + auto menuItem1 = MenuItemLabel::create(label1, AX_CALLBACK_1(BillBoardTest::rotateCameraCallback, this, 10)); auto label2 = Label::createWithTTF(ttfConfig, "rotate-"); - auto menuItem2 = MenuItemLabel::create(label2, CC_CALLBACK_1(BillBoardTest::rotateCameraCallback, this, -10)); + auto menuItem2 = MenuItemLabel::create(label2, AX_CALLBACK_1(BillBoardTest::rotateCameraCallback, this, -10)); auto menu = Menu::create(menuItem1, menuItem2, nullptr); menu->setPosition(Vec2::ZERO); menuItem1->setPosition(Vec2(s.width - 80, VisibleRect::top().y - 160)); @@ -185,9 +185,9 @@ BillBoardTest::BillBoardTest() : _camera(nullptr) _layerBillBoard->setCameraMask(2); label1 = Label::createWithTTF(ttfConfig, "Point Oriented"); - menuItem1 = MenuItemLabel::create(label1, CC_CALLBACK_1(BillBoardTest::menuCallback_orientedPoint, this)); + menuItem1 = MenuItemLabel::create(label1, AX_CALLBACK_1(BillBoardTest::menuCallback_orientedPoint, this)); label2 = Label::createWithTTF(ttfConfig, "Plane Oriented"); - menuItem2 = MenuItemLabel::create(label2, CC_CALLBACK_1(BillBoardTest::menuCallback_orientedPlane, this)); + menuItem2 = MenuItemLabel::create(label2, AX_CALLBACK_1(BillBoardTest::menuCallback_orientedPlane, this)); menuItem1->setPosition(Vec2(s.width - 80, VisibleRect::top().y - 100)); menuItem2->setPosition(Vec2(s.width - 80, VisibleRect::top().y - 130)); @@ -196,7 +196,7 @@ BillBoardTest::BillBoardTest() : _camera(nullptr) this->addChild(menu, 10); menuCallback_orientedPoint(nullptr); - schedule(CC_SCHEDULE_SELECTOR(BillBoardTest::update)); + schedule(AX_SCHEDULE_SELECTOR(BillBoardTest::update)); } void BillBoardTest::menuCallback_orientedPoint(Ref* sender) @@ -235,10 +235,10 @@ void BillBoardTest::addNewBillBoardWithCoords(Vec3 p) std::string imgs[3] = {"Images/Icon.png", "Images/r2.png"}; for (unsigned int i = 0; i < 10; ++i) { - auto billboard = BillBoard::create(imgs[(unsigned int)(CCRANDOM_0_1() * 1 + 0.5f)]); + auto billboard = BillBoard::create(imgs[(unsigned int)(AXRANDOM_0_1() * 1 + 0.5f)]); billboard->setScale(0.5f); billboard->setPosition3D(Vec3(p.x, p.y, -150.0f + 30 * i)); - billboard->setOpacity(static_cast(CCRANDOM_0_1() * 128 + 128)); + billboard->setOpacity(static_cast(AXRANDOM_0_1() * 128 + 128)); _layerBillBoard->addChild(billboard); _billboards.push_back(billboard); @@ -266,7 +266,7 @@ void BillBoardTest::addNewAniBillBoardWithCoords(Vec3 p) auto action = Animate::create(animation); billboardAni->runAction(RepeatForever::create(action)); - billboardAni->setOpacity(static_cast(CCRANDOM_0_1() * 128 + 128)); + billboardAni->setOpacity(static_cast(AXRANDOM_0_1() * 128 + 128)); _billboards.push_back(billboardAni); } } diff --git a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp index e4a26ac934..a9980bcad2 100644 --- a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp +++ b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp @@ -58,7 +58,7 @@ bool Box2DTest::init() auto dispatcher = Director::getInstance()->getEventDispatcher(); auto touchListener = EventListenerTouchAllAtOnce::create(); - touchListener->onTouchesEnded = CC_CALLBACK_2(Box2DTest::onTouchesEnded, this); + touchListener->onTouchesEnded = AX_CALLBACK_2(Box2DTest::onTouchesEnded, this); dispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); // init physics @@ -88,7 +88,7 @@ bool Box2DTest::init() // menu for debug layer MenuItemFont::setFontSize(18); - auto item = MenuItemFont::create("Toggle debug", CC_CALLBACK_1(Box2DTest::toggleDebugCallback, this)); + auto item = MenuItemFont::create("Toggle debug", AX_CALLBACK_1(Box2DTest::toggleDebugCallback, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -107,7 +107,7 @@ Box2DTest::Box2DTest() : _spriteTexture(nullptr), world(nullptr) {} Box2DTest::~Box2DTest() { - CC_SAFE_DELETE(world); + AX_SAFE_DELETE(world); } void Box2DTest::toggleDebugCallback(Ref* sender) @@ -257,7 +257,7 @@ void Box2DTest::createResetButton() void Box2DTest::addNewSpriteAtPosition(Vec2 p) { - CCLOG("Add sprite %0.2f x %02.f", p.x, p.y); + AXLOG("Add sprite %0.2f x %02.f", p.x, p.y); // Define the dynamic body. // Set up a 1m squared box in the physics world @@ -265,7 +265,7 @@ void Box2DTest::addNewSpriteAtPosition(Vec2 p) bodyDef.type = b2_dynamicBody; bodyDef.position.Set(p.x / PTM_RATIO, p.y / PTM_RATIO); - CCLOG("Add PTM_RATIO sprite %0.2f x %0.2f", p.x / PTM_RATIO, p.y / PTM_RATIO); + AXLOG("Add PTM_RATIO sprite %0.2f x %0.2f", p.x / PTM_RATIO, p.y / PTM_RATIO); b2Body* body = world->CreateBody(&bodyDef); @@ -284,8 +284,8 @@ void Box2DTest::addNewSpriteAtPosition(Vec2 p) // We have a 64x64 sprite sheet with 4 different 32x32 images. The following code is // just randomly picking one of the images - int idx = (CCRANDOM_0_1() > .5 ? 0 : 1); - int idy = (CCRANDOM_0_1() > .5 ? 0 : 1); + int idx = (AXRANDOM_0_1() > .5 ? 0 : 1); + int idy = (AXRANDOM_0_1() > .5 ? 0 : 1); auto sprite = PhysicsSpriteBox2D::createWithTexture(_spriteTexture, Rect(32 * idx, 32 * idy, 32, 32)); parent->addChild(sprite); sprite->setB2Body(body); diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp b/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp index 90df124323..929ebfec93 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp +++ b/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp @@ -124,22 +124,22 @@ bool Box2DTestBed::initWithEntryID(int entryId) // Adds touch event listener _touchListener = EventListenerTouchOneByOne::create(); _touchListener->setSwallowTouches(true); - _touchListener->onTouchBegan = CC_CALLBACK_2(Box2DTestBed::onTouchBegan, this); - _touchListener->onTouchMoved = CC_CALLBACK_2(Box2DTestBed::onTouchMoved, this); - _touchListener->onTouchEnded = CC_CALLBACK_2(Box2DTestBed::onTouchEnded, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(Box2DTestBed::onTouchBegan, this); + _touchListener->onTouchMoved = AX_CALLBACK_2(Box2DTestBed::onTouchMoved, this); + _touchListener->onTouchEnded = AX_CALLBACK_2(Box2DTestBed::onTouchEnded, this); TestCase::_eventDispatcher->addEventListenerWithFixedPriority(_touchListener, 10); // Adds Keyboard event listener _keyboardListener = EventListenerKeyboard::create(); - _keyboardListener->onKeyPressed = CC_CALLBACK_2(Box2DTestBed::onKeyPressed, this); - _keyboardListener->onKeyReleased = CC_CALLBACK_2(Box2DTestBed::onKeyReleased, this); + _keyboardListener->onKeyPressed = AX_CALLBACK_2(Box2DTestBed::onKeyPressed, this); + _keyboardListener->onKeyReleased = AX_CALLBACK_2(Box2DTestBed::onKeyReleased, this); TestCase::_eventDispatcher->addEventListenerWithFixedPriority(_keyboardListener, 11); auto _mouseListener = EventListenerMouse::create(); - _mouseListener->onMouseMove = CC_CALLBACK_1(Box2DTestBed::onMouseMove, this); - _mouseListener->onMouseUp = CC_CALLBACK_1(Box2DTestBed::onMouseUp, this); - _mouseListener->onMouseDown = CC_CALLBACK_1(Box2DTestBed::onMouseDown, this); - _mouseListener->onMouseScroll = CC_CALLBACK_1(Box2DTestBed::onMouseScroll, this); + _mouseListener->onMouseMove = AX_CALLBACK_1(Box2DTestBed::onMouseMove, this); + _mouseListener->onMouseUp = AX_CALLBACK_1(Box2DTestBed::onMouseUp, this); + _mouseListener->onMouseDown = AX_CALLBACK_1(Box2DTestBed::onMouseDown, this); + _mouseListener->onMouseScroll = AX_CALLBACK_1(Box2DTestBed::onMouseScroll, this); TestCase::_eventDispatcher->addEventListenerWithFixedPriority(_mouseListener, 12); // Demo messageString @@ -177,13 +177,13 @@ void Box2DTestBed::onTouchEnded(Touch* touch, Event* event) void Box2DTestBed::onKeyPressed(EventKeyboard::KeyCode code, Event* event) { - CCLOG("onKeyPressed, keycode: %d", static_cast(code)); + AXLOG("onKeyPressed, keycode: %d", static_cast(code)); m_test->Keyboard((static_cast(code) - 59)); // its a bad hack! } void Box2DTestBed::onKeyReleased(EventKeyboard::KeyCode code, Event* event) { - CCLOG("onKeyPressed, keycode: %d", static_cast(code)); + AXLOG("onKeyPressed, keycode: %d", static_cast(code)); m_test->KeyboardUp((static_cast(code) - 59)); // its a bad hack! } @@ -237,7 +237,7 @@ void Box2DTestBed::onEnter() { Scene::onEnter(); ImGuiPresenter::getInstance()->addFont(FileUtils::getInstance()->fullPathForFilename("fonts/arial.ttf")); - ImGuiPresenter::getInstance()->addRenderLoop("#im01", CC_CALLBACK_0(Box2DTestBed::onDrawImGui, this), this); + ImGuiPresenter::getInstance()->addRenderLoop("#im01", AX_CALLBACK_0(Box2DTestBed::onDrawImGui, this), this); } void Box2DTestBed::onExit() { diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp b/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp index 51f47aa572..5ca3c4105d 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp +++ b/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp @@ -27,7 +27,7 @@ USING_NS_AX; USING_NS_AX_EXT; -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) extern axis::Label* labelDebugDraw; #endif @@ -464,7 +464,7 @@ void Test::initShader(void) void Test::DrawString(int x, int y, const char* fmt, ...) { -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) debugString.append(std::string(fmt)); debugString.append("\n"); labelDebugDraw->setString(debugString); @@ -474,7 +474,7 @@ void Test::DrawString(int x, int y, const char* fmt, ...) void Test::DrawString(const b2Vec2& pw, const char* fmt, ...) { -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) debugString.append(std::string(fmt)); debugString.append("\n"); labelDebugDraw->setString(debugString); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp index bc42f7feac..fe3184671b 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp @@ -51,7 +51,7 @@ bool Bug1159Layer::init() addChild(sprite_b); auto label = MenuItemLabel::create(Label::createWithSystemFont("Flip Me", "Helvetica", 24), - CC_CALLBACK_1(Bug1159Layer::callBack, this)); + AX_CALLBACK_1(Bug1159Layer::callBack, this)); auto menu = Menu::create(label, nullptr); menu->setPosition(s.width - 200.0f, 50.0f); addChild(menu); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-1174.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-1174.cpp index b20dec1707..8928010700 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-1174.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-1174.cpp @@ -78,26 +78,26 @@ bool Bug1174Layer::init() // A | b // ----- // c | d - float ax = CCRANDOM_0_1() * -5000; - float ay = CCRANDOM_0_1() * 5000; + float ax = AXRANDOM_0_1() * -5000; + float ay = AXRANDOM_0_1() * 5000; // a | b // ----- // c | D - float dx = CCRANDOM_0_1() * 5000; - float dy = CCRANDOM_0_1() * -5000; + float dx = AXRANDOM_0_1() * 5000; + float dy = AXRANDOM_0_1() * -5000; // a | B // ----- // c | d - float bx = CCRANDOM_0_1() * 5000; - float by = CCRANDOM_0_1() * 5000; + float bx = AXRANDOM_0_1() * 5000; + float by = AXRANDOM_0_1() * 5000; // a | b // ----- // C | d - float cx = CCRANDOM_0_1() * -5000; - float cy = CCRANDOM_0_1() * -5000; + float cx = AXRANDOM_0_1() * -5000; + float cy = AXRANDOM_0_1() * -5000; A = Vec2(ax, ay); B = Vec2(bx, by); @@ -141,15 +141,15 @@ bool Bug1174Layer::init() // A | b // ----- // c | d - float ax = CCRANDOM_0_1() * -500; - float ay = CCRANDOM_0_1() * 500; + float ax = AXRANDOM_0_1() * -500; + float ay = AXRANDOM_0_1() * 500; p1 = Vec2(ax, ay); // a | b // ----- // c | D - float dx = CCRANDOM_0_1() * 500; - float dy = CCRANDOM_0_1() * -500; + float dx = AXRANDOM_0_1() * 500; + float dy = AXRANDOM_0_1() * -500; p2 = Vec2(dx, dy); ////// @@ -159,13 +159,13 @@ bool Bug1174Layer::init() // a | b // ----- // C | d - float cx = CCRANDOM_0_1() * -500; + float cx = AXRANDOM_0_1() * -500; p3 = Vec2(cx, y); // a | B // ----- // c | d - float bx = CCRANDOM_0_1() * 500; + float bx = AXRANDOM_0_1() * 500; p4 = Vec2(bx, y); s = 0.0f; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-14327.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-14327.cpp index 54ba591e62..9bd9a32cb2 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-14327.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-14327.cpp @@ -33,7 +33,7 @@ #include "Bug-14327.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) USING_NS_AX; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-14327.h b/tests/cpp-tests/Classes/BugsTest/Bug-14327.h index 9a19f0effc..6c8e7c7ca0 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-14327.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-14327.h @@ -27,7 +27,7 @@ #include "BugsTest.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "ui/UIEditBox/UIEditBox.h" diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp index bc2d41fed1..631c2d1358 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp @@ -57,14 +57,14 @@ void Bug422Layer::reset() removeChild(node, true); // [self removeChildByTag:localtag-1 cleanup:NO]; - auto item1 = MenuItemFont::create("One", CC_CALLBACK_1(Bug422Layer::menuCallback, this)); + auto item1 = MenuItemFont::create("One", AX_CALLBACK_1(Bug422Layer::menuCallback, this)); log("MenuItemFont: %p", item1); - MenuItem* item2 = MenuItemFont::create("Two", CC_CALLBACK_1(Bug422Layer::menuCallback, this)); + MenuItem* item2 = MenuItemFont::create("Two", AX_CALLBACK_1(Bug422Layer::menuCallback, this)); auto menu = Menu::create(item1, item2, nullptr); menu->alignItemsVertically(); - float x = CCRANDOM_0_1() * 50; - float y = CCRANDOM_0_1() * 50; + float x = AXRANDOM_0_1() * 50; + float y = AXRANDOM_0_1() * 50; menu->setPosition(menu->getPosition() + Vec2(x, y)); addChild(menu, 0, localtag); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp index 9630652967..1a7833fc0b 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp @@ -47,13 +47,13 @@ bool Bug458Layer::init() // [question setContentSize:CGSizeMake(50,50)]; // [question2 setContentSize:CGSizeMake(50,50)]; - auto sprite = MenuItemSprite::create(question2, question, CC_CALLBACK_1(Bug458Layer::selectAnswer, this)); + auto sprite = MenuItemSprite::create(question2, question, AX_CALLBACK_1(Bug458Layer::selectAnswer, this)); auto layer = LayerColor::create(Color4B(0, 0, 255, 255), 100, 100); question->release(); question2->release(); auto layer2 = LayerColor::create(Color4B(255, 0, 0, 255), 100, 100); - auto sprite2 = MenuItemSprite::create(layer, layer2, CC_CALLBACK_1(Bug458Layer::selectAnswer, this)); + auto sprite2 = MenuItemSprite::create(layer, layer2, AX_CALLBACK_1(Bug458Layer::selectAnswer, this)); auto menu = Menu::create(sprite, sprite2, nullptr); menu->alignItemsVerticallyWithPadding(100); menu->setPosition(size.width / 2, size.height / 2); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp index 84d8466c23..7f2906674a 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp @@ -52,10 +52,10 @@ bool Bug624Layer::init() addChild(label); Device::setAccelerometerEnabled(true); - auto listener = EventListenerAcceleration::create(CC_CALLBACK_2(Bug624Layer::onAcceleration, this)); + auto listener = EventListenerAcceleration::create(AX_CALLBACK_2(Bug624Layer::onAcceleration, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); - schedule(CC_SCHEDULE_SELECTOR(Bug624Layer::switchLayer), 5.0f); + schedule(AX_SCHEDULE_SELECTOR(Bug624Layer::switchLayer), 5.0f); return true; } @@ -65,7 +65,7 @@ bool Bug624Layer::init() void Bug624Layer::switchLayer(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(Bug624Layer::switchLayer)); + unschedule(AX_SCHEDULE_SELECTOR(Bug624Layer::switchLayer)); auto scene = Scene::create(); scene->addChild(Bug624Layer2::create(), 0); @@ -98,10 +98,10 @@ bool Bug624Layer2::init() addChild(label); Device::setAccelerometerEnabled(true); - auto listener = EventListenerAcceleration::create(CC_CALLBACK_2(Bug624Layer2::onAcceleration, this)); + auto listener = EventListenerAcceleration::create(AX_CALLBACK_2(Bug624Layer2::onAcceleration, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); - schedule(CC_SCHEDULE_SELECTOR(Bug624Layer2::switchLayer), 5.0f); + schedule(AX_SCHEDULE_SELECTOR(Bug624Layer2::switchLayer), 5.0f); return true; } @@ -111,7 +111,7 @@ bool Bug624Layer2::init() void Bug624Layer2::switchLayer(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(Bug624Layer::switchLayer)); + unschedule(AX_SCHEDULE_SELECTOR(Bug624Layer::switchLayer)); auto scene = Scene::create(); scene->addChild(Bug624Layer::create(), 0); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp index 971785f289..5742affbef 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp @@ -35,8 +35,8 @@ bool Bug914Layer::init() if (BugsTestBase::init()) { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(Bug914Layer::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(Bug914Layer::onTouchesMoved, this); + listener->onTouchesBegan = AX_CALLBACK_2(Bug914Layer::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(Bug914Layer::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // ask director the the window size @@ -54,7 +54,7 @@ bool Bug914Layer::init() // create and initialize a Label auto label = Label::createWithTTF("Hello World", "fonts/Marker Felt.ttf", 64.0f); - auto item1 = MenuItemFont::create("restart", CC_CALLBACK_1(Bug914Layer::restart, this)); + auto item1 = MenuItemFont::create("restart", AX_CALLBACK_1(Bug914Layer::restart, this)); auto menu = Menu::create(item1, nullptr); menu->alignItemsVertically(); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp index dfe20001f0..4c8233a921 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp @@ -41,7 +41,7 @@ bool BugChild::init() auto size = Director::getInstance()->getWinSize(); // create and initialize a Label - auto item1 = MenuItemFont::create("Switch Child", CC_CALLBACK_1(BugChild::switchChild, this)); + auto item1 = MenuItemFont::create("Switch Child", AX_CALLBACK_1(BugChild::switchChild, this)); menu = Menu::create(item1, nullptr); @@ -73,13 +73,13 @@ void BugChild::switchChild(Ref* sender) { parent1->removeChild(child, false); parent2->addChild(child); - CCLOG("Child attached to parent2"); + AXLOG("Child attached to parent2"); } else { parent2->removeChild(child, false); parent1->addChild(child); - CCLOG("Child attached to parent1"); + AXLOG("Child attached to parent1"); } } @@ -104,7 +104,7 @@ bool BugCameraMask::init() camera->setCameraFlag(CameraFlag::USER1); addChild(camera); - auto item1 = MenuItemFont::create("Switch Child", CC_CALLBACK_1(BugCameraMask::switchSpriteFlag, this)); + auto item1 = MenuItemFont::create("Switch Child", AX_CALLBACK_1(BugCameraMask::switchSpriteFlag, this)); auto menu = Menu::create(item1, nullptr); diff --git a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp index bae480c537..c056deed95 100644 --- a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp +++ b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp @@ -38,7 +38,7 @@ #include "Bug-15594.h" #include "Bug-15776.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "Bug-14327.h" #endif @@ -62,7 +62,7 @@ BugsTests::BugsTests() // NOTE: comment this out because it currently crashes during autotest // ADD_TEST_CASE(Bug15776Layer); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) ADD_TEST_CASE(Bug14327Layer); #endif } diff --git a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp index c86e6b3345..16e1d38949 100644 --- a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp +++ b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp @@ -147,7 +147,7 @@ CameraRotationTest::CameraRotationTest() Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(_lis, this); - schedule(CC_SCHEDULE_SELECTOR(CameraRotationTest::update)); + schedule(AX_SCHEDULE_SELECTOR(CameraRotationTest::update)); } CameraRotationTest::~CameraRotationTest() @@ -264,9 +264,9 @@ void Camera3DTestDemo::onEnter() _mesh = nullptr; auto s = Director::getInstance()->getWinSize(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(Camera3DTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(Camera3DTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(Camera3DTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(Camera3DTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto layer3D = Layer::create(); addChild(layer3D, 0); @@ -284,8 +284,8 @@ void Camera3DTestDemo::onEnter() auto listener1 = EventListenerTouchOneByOne::create(); listener1->setSwallowTouches(true); - listener1->onTouchBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesZoomOut, this); - listener1->onTouchEnded = CC_CALLBACK_2(Camera3DTestDemo::onTouchesZoomOutEnd, this); + listener1->onTouchBegan = AX_CALLBACK_2(Camera3DTestDemo::onTouchesZoomOut, this); + listener1->onTouchEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesZoomOutEnd, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener1, _ZoomOutlabel); @@ -298,8 +298,8 @@ void Camera3DTestDemo::onEnter() auto listener2 = EventListenerTouchOneByOne::create(); listener2->setSwallowTouches(true); - listener2->onTouchBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesZoomIn, this); - listener2->onTouchEnded = CC_CALLBACK_2(Camera3DTestDemo::onTouchesZoomInEnd, this); + listener2->onTouchBegan = AX_CALLBACK_2(Camera3DTestDemo::onTouchesZoomIn, this); + listener2->onTouchEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesZoomInEnd, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener2, _ZoomInlabel); @@ -312,8 +312,8 @@ void Camera3DTestDemo::onEnter() auto listener3 = EventListenerTouchOneByOne::create(); listener3->setSwallowTouches(true); - listener3->onTouchBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesRotateLeft, this); - listener3->onTouchEnded = CC_CALLBACK_2(Camera3DTestDemo::onTouchesRotateLeftEnd, this); + listener3->onTouchBegan = AX_CALLBACK_2(Camera3DTestDemo::onTouchesRotateLeft, this); + listener3->onTouchEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesRotateLeftEnd, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener3, _RotateLeftlabel); @@ -326,20 +326,20 @@ void Camera3DTestDemo::onEnter() auto listener4 = EventListenerTouchOneByOne::create(); listener4->setSwallowTouches(true); - listener4->onTouchBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesRotateRight, this); - listener4->onTouchEnded = CC_CALLBACK_2(Camera3DTestDemo::onTouchesRotateRightEnd, this); + listener4->onTouchBegan = AX_CALLBACK_2(Camera3DTestDemo::onTouchesRotateRight, this); + listener4->onTouchEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesRotateRightEnd, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener4, _RotateRightlabel); auto label1 = Label::createWithTTF(ttfConfig, "free "); auto menuItem1 = - MenuItemLabel::create(label1, CC_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::Free)); + MenuItemLabel::create(label1, AX_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::Free)); auto label2 = Label::createWithTTF(ttfConfig, "third person"); auto menuItem2 = MenuItemLabel::create( - label2, CC_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::ThirdPerson)); + label2, AX_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::ThirdPerson)); auto label3 = Label::createWithTTF(ttfConfig, "first person"); auto menuItem3 = MenuItemLabel::create( - label3, CC_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::FirstPerson)); + label3, AX_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::FirstPerson)); auto menu = Menu::create(menuItem1, menuItem2, menuItem3, nullptr); menu->setPosition(Vec2::ZERO); @@ -348,7 +348,7 @@ void Camera3DTestDemo::onEnter() menuItem2->setPosition(VisibleRect::left().x + 100, VisibleRect::top().y - 100); menuItem3->setPosition(VisibleRect::left().x + 100, VisibleRect::top().y - 150); addChild(menu, 0); - schedule(CC_SCHEDULE_SELECTOR(Camera3DTestDemo::updateCamera), 0.0f); + schedule(AX_SCHEDULE_SELECTOR(Camera3DTestDemo::updateCamera), 0.0f); if (_camera == nullptr) { _camera = Camera::createPerspective(60, (float)s.width / s.height, 1, 1000); @@ -722,13 +722,13 @@ void CameraCullingDemo::onEnter() { CameraBaseTest::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(CameraCullingDemo::update), 0.0f); + schedule(AX_SCHEDULE_SELECTOR(CameraCullingDemo::update), 0.0f); auto s = Director::getInstance()->getWinSize(); /*auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(Camera3DTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(Camera3DTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(Camera3DTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(Camera3DTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);*/ auto layer3D = Layer::create(); addChild(layer3D, 0); @@ -738,7 +738,7 @@ void CameraCullingDemo::onEnter() MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(20); - auto menuItem1 = MenuItemFont::create("Switch Camera", CC_CALLBACK_1(CameraCullingDemo::switchViewCallback, this)); + auto menuItem1 = MenuItemFont::create("Switch Camera", AX_CALLBACK_1(CameraCullingDemo::switchViewCallback, this)); menuItem1->setColor(Color3B(0, 200, 20)); auto menu = Menu::create(menuItem1, NULL); menu->setPosition(Vec2::ZERO); @@ -747,9 +747,9 @@ void CameraCullingDemo::onEnter() // + - MenuItemFont::setFontSize(40); - auto decrease = MenuItemFont::create(" - ", CC_CALLBACK_1(CameraCullingDemo::delMeshCallback, this)); + auto decrease = MenuItemFont::create(" - ", AX_CALLBACK_1(CameraCullingDemo::delMeshCallback, this)); decrease->setColor(Color3B(0, 200, 20)); - auto increase = MenuItemFont::create(" + ", CC_CALLBACK_1(CameraCullingDemo::addMeshCallback, this)); + auto increase = MenuItemFont::create(" + ", AX_CALLBACK_1(CameraCullingDemo::addMeshCallback, this)); increase->setColor(Color3B(0, 200, 20)); menu = Menu::create(decrease, increase, nullptr); @@ -824,7 +824,7 @@ void CameraCullingDemo::reachEndCallBack() _moveAction = inverse; auto rot = RotateBy::create(1.f, Vec3(0.f, 180.f, 0.f)); auto seq = Sequence::create(rot, _moveAction, - CallFunc::create(CC_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr); seq->setTag(100); _cameraFirst->runAction(seq); } @@ -842,7 +842,7 @@ void CameraCullingDemo::switchViewCallback(Ref* sender) _moveAction = MoveTo::create(4.f, Vec2(-_cameraFirst->getPositionX(), 0.0f)); _moveAction->retain(); auto seq = Sequence::create( - _moveAction, CallFunc::create(CC_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr); + _moveAction, CallFunc::create(AX_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr); seq->setTag(100); _cameraFirst->runAction(seq); addChild(_cameraFirst); @@ -1007,10 +1007,10 @@ void CameraArcBallDemo::onEnter() { CameraBaseTest::onEnter(); _rotationQuat.set(0.0f, 0.0f, 0.0f, 1.0f); - schedule(CC_SCHEDULE_SELECTOR(CameraArcBallDemo::update), 0.0f); + schedule(AX_SCHEDULE_SELECTOR(CameraArcBallDemo::update), 0.0f); auto s = Director::getInstance()->getWinSize(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(CameraArcBallDemo::onTouchsMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(CameraArcBallDemo::onTouchsMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // switch camera @@ -1018,10 +1018,10 @@ void CameraArcBallDemo::onEnter() MenuItemFont::setFontSize(20); auto menuItem1 = - MenuItemFont::create("Switch Operation", CC_CALLBACK_1(CameraArcBallDemo::switchOperateCallback, this)); + MenuItemFont::create("Switch Operation", AX_CALLBACK_1(CameraArcBallDemo::switchOperateCallback, this)); menuItem1->setColor(Color3B(0, 200, 20)); auto menuItem2 = - MenuItemFont::create("Switch Target", CC_CALLBACK_1(CameraArcBallDemo::switchTargetCallback, this)); + MenuItemFont::create("Switch Target", AX_CALLBACK_1(CameraArcBallDemo::switchTargetCallback, this)); menuItem2->setColor(Color3B(0, 200, 20)); auto menu = Menu::create(menuItem1, menuItem2, NULL); menu->setPosition(Vec2::ZERO); @@ -1208,8 +1208,8 @@ void CameraArcBallDemo::update(float dt) FogTestDemo::FogTestDemo() : CameraBaseTest() {} FogTestDemo::~FogTestDemo() { - CC_SAFE_RELEASE_NULL(_programState1); - CC_SAFE_RELEASE_NULL(_programState2); + AX_SAFE_RELEASE_NULL(_programState1); + AX_SAFE_RELEASE_NULL(_programState2); } std::string FogTestDemo::title() const @@ -1220,23 +1220,23 @@ std::string FogTestDemo::title() const void FogTestDemo::onEnter() { CameraBaseTest::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(FogTestDemo::update), 0.0f); + schedule(AX_SCHEDULE_SELECTOR(FogTestDemo::update), 0.0f); Director::getInstance()->setClearColor(Color4F(0.5, 0.5, 0.5, 1)); auto s = Director::getInstance()->getWinSize(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(FogTestDemo::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(FogTestDemo::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // switch fog type TTFConfig ttfConfig("fonts/arial.ttf", 20); auto label1 = Label::createWithTTF(ttfConfig, "Linear "); - auto menuItem1 = MenuItemLabel::create(label1, CC_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 0)); + auto menuItem1 = MenuItemLabel::create(label1, AX_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 0)); auto label2 = Label::createWithTTF(ttfConfig, "Exp"); - auto menuItem2 = MenuItemLabel::create(label2, CC_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 1)); + auto menuItem2 = MenuItemLabel::create(label2, AX_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 1)); auto label3 = Label::createWithTTF(ttfConfig, "Exp2"); - auto menuItem3 = MenuItemLabel::create(label3, CC_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 2)); + auto menuItem3 = MenuItemLabel::create(label3, AX_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 2)); auto menu = Menu::create(menuItem1, menuItem2, menuItem3, nullptr); menu->setPosition(Vec2::ZERO); @@ -1250,15 +1250,15 @@ void FogTestDemo::onEnter() addChild(layer3D, 0); _layer3D = layer3D; - CC_SAFE_RELEASE_NULL(_programState1); - CC_SAFE_RELEASE_NULL(_programState2); + AX_SAFE_RELEASE_NULL(_programState1); + AX_SAFE_RELEASE_NULL(_programState2); auto vertexSource = FileUtils::getInstance()->getStringFromFile("MeshRendererTest/fog.vert"); auto fragSource = FileUtils::getInstance()->getStringFromFile("MeshRendererTest/fog.frag"); auto program = backend::Device::getInstance()->newProgram(vertexSource, fragSource); _programState1 = new backend::ProgramState(program); _programState2 = new backend::ProgramState(program); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(program); _mesh1 = MeshRenderer::create("MeshRendererTest/teapot.c3b"); _mesh2 = MeshRenderer::create("MeshRendererTest/teapot.c3b"); @@ -1297,11 +1297,11 @@ void FogTestDemo::onEnter() } _layer3D->setCameraMask(2); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { Director::getInstance()->setClearColor(Color4F(0.5, 0.5, 0.5, 1)); - CC_SAFE_RELEASE_NULL(_programState1); - CC_SAFE_RELEASE_NULL(_programState2); + AX_SAFE_RELEASE_NULL(_programState1); + AX_SAFE_RELEASE_NULL(_programState2); auto vertexSource = FileUtils::getInstance()->getStringFromFile("MeshRendererTest/fog.vert"); auto fragSource = FileUtils::getInstance()->getStringFromFile("MeshRendererTest/fog.frag"); @@ -1311,7 +1311,7 @@ void FogTestDemo::onEnter() _mesh1->setProgramState(_programState1); _mesh2->setProgramState(_programState2); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(program); auto fogColor = Vec4(0.5, 0.5, 0.5, 1.0); float fogStart = 10; @@ -1372,7 +1372,7 @@ void FogTestDemo::onExit() _camera = nullptr; } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } diff --git a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.h b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.h index 223ceeeacf..c8100672c4 100644 --- a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.h +++ b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.h @@ -263,7 +263,7 @@ protected: axis::backend::ProgramState* _programState1 = nullptr; axis::backend::ProgramState* _programState2 = nullptr; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; diff --git a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp index 7c8fdedabe..4821cbc6b6 100644 --- a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp +++ b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp @@ -53,11 +53,11 @@ ChipmunkTest::ChipmunkTest() // enable events auto touchListener = EventListenerTouchAllAtOnce::create(); - touchListener->onTouchesEnded = CC_CALLBACK_2(ChipmunkTest::onTouchesEnded, this); + touchListener->onTouchesEnded = AX_CALLBACK_2(ChipmunkTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); Device::setAccelerometerEnabled(true); - auto accListener = EventListenerAcceleration::create(CC_CALLBACK_2(ChipmunkTest::onAcceleration, this)); + auto accListener = EventListenerAcceleration::create(AX_CALLBACK_2(ChipmunkTest::onAcceleration, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(accListener, this); // title @@ -88,7 +88,7 @@ ChipmunkTest::ChipmunkTest() // menu for debug layer MenuItemFont::setFontSize(18); - auto item = MenuItemFont::create("Toggle debug", CC_CALLBACK_1(ChipmunkTest::toggleDebugCallback, this)); + auto item = MenuItemFont::create("Toggle debug", AX_CALLBACK_1(ChipmunkTest::toggleDebugCallback, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -110,7 +110,7 @@ ChipmunkTest::~ChipmunkTest() cpShapeFree(_walls[i]); } -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 cpSpaceFree(_space); #else cpHastySpaceFree(_space); @@ -125,7 +125,7 @@ void ChipmunkTest::initPhysics() // init chipmunk // cpInitChipmunk(); -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 _space = cpSpaceNew(); #else _space = cpHastySpaceNew(); @@ -179,7 +179,7 @@ void ChipmunkTest::update(float delta) for (int i = 0; i < steps; i++) { -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 cpSpaceStep(_space, dt); #else cpHastySpaceStep(_space, dt); @@ -189,7 +189,7 @@ void ChipmunkTest::update(float delta) void ChipmunkTest::createResetButton() { - auto reset = MenuItemImage::create("Images/r1.png", "Images/r2.png", CC_CALLBACK_1(ChipmunkTest::reset, this)); + auto reset = MenuItemImage::create("Images/r1.png", "Images/r2.png", AX_CALLBACK_1(ChipmunkTest::reset, this)); auto menu = Menu::create(reset, nullptr); @@ -208,8 +208,8 @@ void ChipmunkTest::addNewSpriteAtPosition(axis::Vec2 pos) auto parent = getChildByTag(kTagParentNode); - posx = CCRANDOM_0_1() * 200.0f; - posy = CCRANDOM_0_1() * 200.0f; + posx = AXRANDOM_0_1() * 200.0f; + posy = AXRANDOM_0_1() * 200.0f; posx = (posx % 4) * 85; posy = (posy % 3) * 121; diff --git a/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp b/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp index 402d0844e5..103b0ffeb8 100644 --- a/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp +++ b/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp @@ -118,7 +118,7 @@ void ChipmunkDebugDrawCircle(cpVect pos, cpSpaceDebugColor fillColor) { - drawCP->drawCircle(Vec2(pos.x, pos.y) + physicsDebugNodeOffset, 100, CC_DEGREES_TO_RADIANS(90), 50, true, 1.0f, + drawCP->drawCircle(Vec2(pos.x, pos.y) + physicsDebugNodeOffset, 100, AX_DEGREES_TO_RADIANS(90), 50, true, 1.0f, 2.0f, Color4F(fillColor.r, fillColor.g, fillColor.b, fillColor.a)); } @@ -339,9 +339,9 @@ ChipmunkTestBed::ChipmunkTestBed() // creating a mouse event listener _mouseListener = EventListenerMouse::create(); - _mouseListener->onMouseMove = CC_CALLBACK_1(ChipmunkTestBed::onMouseMove, this); - _mouseListener->onMouseUp = CC_CALLBACK_1(ChipmunkTestBed::onMouseUp, this); - _mouseListener->onMouseDown = CC_CALLBACK_1(ChipmunkTestBed::onMouseDown, this); + _mouseListener->onMouseMove = AX_CALLBACK_1(ChipmunkTestBed::onMouseMove, this); + _mouseListener->onMouseUp = AX_CALLBACK_1(ChipmunkTestBed::onMouseUp, this); + _mouseListener->onMouseDown = AX_CALLBACK_1(ChipmunkTestBed::onMouseDown, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(_mouseListener, this); // Some info text @@ -394,7 +394,7 @@ void ChipmunkTestBed::initPhysics() void ChipmunkTestBed::update(float delta) { - //#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + //#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 // cpSpaceStep(_space, delta); //#else // cpHastySpaceStep(_space, delta); @@ -403,7 +403,7 @@ void ChipmunkTestBed::update(float delta) void ChipmunkTestBed::createResetButton() { - auto reset = MenuItemImage::create("Images/r1.png", "Images/r2.png", CC_CALLBACK_1(ChipmunkTestBed::reset, this)); + auto reset = MenuItemImage::create("Images/r1.png", "Images/r2.png", AX_CALLBACK_1(ChipmunkTestBed::reset, this)); auto menu = Menu::create(reset, nullptr); menu->setPosition(VisibleRect::center().x, VisibleRect::bottom().y); this->addChild(menu, -1); diff --git a/tests/cpp-tests/Classes/ChipmunkTestBed/demo/Bench.c b/tests/cpp-tests/Classes/ChipmunkTestBed/demo/Bench.c index d85a8d6fe1..b3abc22b50 100644 --- a/tests/cpp-tests/Classes/ChipmunkTestBed/demo/Bench.c +++ b/tests/cpp-tests/Classes/ChipmunkTestBed/demo/Bench.c @@ -496,7 +496,7 @@ static cpFloat pentagon_moment = 0.0f; static cpBool NoCollide_begin(cpArbiter* arb, cpSpace* space, void* data) { - // CCLOG("NoCollide_begin"); + // AXLOG("NoCollide_begin"); return cpTrue; } diff --git a/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp b/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp index 38190cf496..a5d070819e 100644 --- a/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp +++ b/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp @@ -40,8 +40,8 @@ ClickAndMoveTest::ClickAndMoveTest() ClickAndMoveTestCase::ClickAndMoveTestCase() { auto listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = CC_CALLBACK_2(ClickAndMoveTestCase::onTouchBegan, this); - listener->onTouchEnded = CC_CALLBACK_2(ClickAndMoveTestCase::onTouchEnded, this); + listener->onTouchBegan = AX_CALLBACK_2(ClickAndMoveTestCase::onTouchBegan, this); + listener->onTouchEnded = AX_CALLBACK_2(ClickAndMoveTestCase::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto sprite = Sprite::create(s_pathGrossini); @@ -71,7 +71,7 @@ void ClickAndMoveTestCase::onTouchEnded(Touch* touch, Event* event) s->runAction(MoveTo::create(1, Vec2(location.x, location.y))); float o = location.x - s->getPosition().x; float a = location.y - s->getPosition().y; - float at = (float)CC_RADIANS_TO_DEGREES(atanf(o / a)); + float at = (float)AX_RADIANS_TO_DEGREES(atanf(o / a)); if (a < 0) { diff --git a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp index a09c4b9a57..0f18f43b8d 100644 --- a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp +++ b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp @@ -342,9 +342,9 @@ void NestedTest::setup() HoleDemo::~HoleDemo() { - CC_SAFE_RELEASE(_outerClipper); - CC_SAFE_RELEASE(_holes); - CC_SAFE_RELEASE(_holesStencil); + AX_SAFE_RELEASE(_outerClipper); + AX_SAFE_RELEASE(_holes); + AX_SAFE_RELEASE(_holesStencil); } std::string HoleDemo::title() const @@ -396,14 +396,14 @@ void HoleDemo::setup() this->addChild(_outerClipper); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(HoleDemo::onTouchesBegan, this); + listener->onTouchesBegan = AX_CALLBACK_2(HoleDemo::onTouchesBegan, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } void HoleDemo::pokeHoleAtPoint(Vec2 point) { - float scale = CCRANDOM_0_1() * 0.2 + 0.9; - float rotation = CCRANDOM_0_1() * 360; + float scale = AXRANDOM_0_1() * 0.2 + 0.9; + float rotation = AXRANDOM_0_1() * 360; auto hole = Sprite::create("Images/hole_effect.png"); hole->setPosition(point); @@ -474,9 +474,9 @@ void ScrollViewDemo::setup() _scrolling = false; auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(ScrollViewDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(ScrollViewDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(ScrollViewDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(ScrollViewDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(ScrollViewDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(ScrollViewDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -583,7 +583,7 @@ void RawStencilBufferTest::initCommands() auto& cmd = _renderCmds[cmdIndex]; cmdIndex++; cmd.init(_globalZOrder, blend); - cmd.setBeforeCallback(CC_CALLBACK_0(RawStencilBufferTest::onBeforeDrawClip, this, i)); + cmd.setBeforeCallback(AX_CALLBACK_0(RawStencilBufferTest::onBeforeDrawClip, this, i)); Vec2 vertices[] = {Vec2::ZERO, Vec2(stencilPoint.x, 0.0f), stencilPoint, Vec2(0.0f, stencilPoint.y)}; unsigned short indices[] = {0, 2, 1, 0, 3, 2}; cmd.createVertexBuffer(sizeof(Vec2), 4, backend::BufferUsage::STATIC); @@ -601,7 +601,7 @@ void RawStencilBufferTest::initCommands() auto& cmd2 = _renderCmds[cmdIndex]; cmdIndex++; cmd2.init(_globalZOrder, blend); - cmd2.setBeforeCallback(CC_CALLBACK_0(RawStencilBufferTest::onBeforeDrawSprite, this, i)); + cmd2.setBeforeCallback(AX_CALLBACK_0(RawStencilBufferTest::onBeforeDrawSprite, this, i)); Vec2 vertices2[] = {Vec2::ZERO, Vec2(winPoint.x, 0.0f), winPoint, Vec2(0.0f, winPoint.y)}; cmd2.createVertexBuffer(sizeof(Vec2), 4, backend::BufferUsage::STATIC); cmd2.updateVertexBuffer(vertices2, sizeof(vertices2)); @@ -632,7 +632,7 @@ void RawStencilBufferTest::draw(Renderer* renderer, const Mat4& transform, uint3 cmdIndex++; Director* director = Director::getInstance(); - 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); _modelViewTransform = this->transform(transform); diff --git a/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp b/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp index 230da0f134..5c86d78762 100644 --- a/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp +++ b/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp @@ -27,7 +27,7 @@ #include "../testResource.h" #include #include -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_WIN32) # include # include # include @@ -128,7 +128,7 @@ void ConsoleUploadFile::uploadFile() Data srcFileData = FileUtils::getInstance()->getDataFromFile(s_pathGrossini); if (srcFileData.isNull()) { - CCLOGERROR("ConsoleUploadFile: could not open file %s", s_pathGrossini); + AXLOGERROR("ConsoleUploadFile: could not open file %s", s_pathGrossini); } std::string targetFileName = _targetFileName; @@ -145,7 +145,7 @@ void ConsoleUploadFile::uploadFile() hints.ai_flags = 0; hints.ai_protocol = 0; /* Any protocol */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) WSADATA wsaData; WSAStartup(MAKEWORD(2, 2), &wsaData); #endif @@ -159,7 +159,7 @@ void ConsoleUploadFile::uploadFile() s = getaddrinfo(nodeName.c_str(), "5678", &hints, &result); if (s != 0) { - CCLOG("ConsoleUploadFile: getaddrinfo error"); + AXLOG("ConsoleUploadFile: getaddrinfo error"); return; } @@ -177,7 +177,7 @@ void ConsoleUploadFile::uploadFile() if (connect(sfd, rp->ai_addr, rp->ai_addrlen) != -1) break; /* Success */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) closesocket(sfd); #else close(sfd); @@ -186,7 +186,7 @@ void ConsoleUploadFile::uploadFile() if (rp == nullptr) { /* No address succeeded */ - CCLOG("ConsoleUploadFile: could not connect!"); + AXLOG("ConsoleUploadFile: could not connect!"); return; } @@ -246,7 +246,7 @@ void ConsoleUploadFile::uploadFile() // Sleep 1s to wait server to receive all data. std::this_thread::sleep_for(std::chrono::seconds(1)); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) closesocket(sfd); WSACleanup(); #else diff --git a/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.h b/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.h index 503665ec2b..acb93afa81 100644 --- a/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.h +++ b/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.h @@ -55,7 +55,7 @@ protected: axis::Console* _console; private: - CC_DISALLOW_COPY_AND_ASSIGN(ConsoleCustomCommand); + AX_DISALLOW_COPY_AND_ASSIGN(ConsoleCustomCommand); }; class ConsoleUploadFile : public BaseTestConsole @@ -74,7 +74,7 @@ protected: void uploadFile(); private: - CC_DISALLOW_COPY_AND_ASSIGN(ConsoleUploadFile); + AX_DISALLOW_COPY_AND_ASSIGN(ConsoleUploadFile); std::string _targetFileName; }; diff --git a/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp b/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp index 6e150b9e5b..f98c3cd193 100644 --- a/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp +++ b/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp @@ -42,7 +42,7 @@ CurlTest::CurlTest() label->setPosition(VisibleRect::center().x, VisibleRect::top().y - 50); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(CurlTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(CurlTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // create a label to display the tip string diff --git a/tests/cpp-tests/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp b/tests/cpp-tests/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp index ad9b32154a..249bced5a8 100644 --- a/tests/cpp-tests/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp +++ b/tests/cpp-tests/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp @@ -96,7 +96,7 @@ CurrentLanguageTest::CurrentLanguageTest() labelLanguage->setString("current language is Polish"); break; default: - CCASSERT(false, "Invalid language type."); + AXASSERT(false, "Invalid language type."); break; } diff --git a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp index 477fb6eb23..cbe0bb6c11 100644 --- a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp +++ b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp @@ -50,14 +50,14 @@ DrawNodeTest::DrawNodeTest() addChild(draw, 10); draw->drawPoint(Vec2(s.width / 2 - 120, s.height / 2 - 120), 10, - Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); + Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); draw->drawPoint(Vec2(s.width / 2 + 120, s.height / 2 + 120), 10, - Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); + Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); // draw 4 small points Vec2 position[] = {Vec2(60, 60), Vec2(70, 70), Vec2(60, 70), Vec2(70, 60)}; - draw->drawPoints(position, 4, 5, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); + draw->drawPoints(position, 4, 5, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); // draw a line draw->drawLine(Vec2(0, 0), Vec2(s.width, s.height), Color4F(1.0, 0.0, 0.0, 0.5)); @@ -66,30 +66,30 @@ DrawNodeTest::DrawNodeTest() draw->drawRect(Vec2(23, 23), Vec2(7, 7), Color4F(1, 1, 0, 1)); draw->drawRect(Vec2(15, 30), Vec2(30, 15), Vec2(15, 0), Vec2(0, 15), - Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); + Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); // draw a circle - draw->drawCircle(VisibleRect::center() + Vec2(140, 0), 100, CC_DEGREES_TO_RADIANS(90), 50, true, 1.0f, 2.0f, + draw->drawCircle(VisibleRect::center() + Vec2(140, 0), 100, AX_DEGREES_TO_RADIANS(90), 50, true, 1.0f, 2.0f, Color4F(1.0f, 0.0f, 0.0f, 0.5f)); - draw->drawCircle(VisibleRect::center() - Vec2(140, 0), 50, CC_DEGREES_TO_RADIANS(90), 30, false, - Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1.0f)); + draw->drawCircle(VisibleRect::center() - Vec2(140, 0), 50, AX_DEGREES_TO_RADIANS(90), 30, false, + Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // Draw some beziers draw->drawQuadBezier(Vec2(s.width - 150, s.height - 150), Vec2(s.width - 70, s.height - 10), Vec2(s.width - 10, s.height - 10), 10, - Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5f)); + Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); draw->drawQuadBezier(Vec2(0.0f, s.height), Vec2(s.width / 2, s.height / 2), Vec2(s.width, s.height), 50, - Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5f)); + Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); draw->drawCubicBezier(VisibleRect::center(), Vec2(VisibleRect::center().x + 30, VisibleRect::center().y + 50), Vec2(VisibleRect::center().x + 60, VisibleRect::center().y - 50), VisibleRect::right(), 100, - Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5f)); + Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); draw->drawCubicBezier(Vec2(s.width - 250, 40.0f), Vec2(s.width - 70, 100.0f), Vec2(s.width - 30, 250.0f), Vec2(s.width - 10, s.height - 50), 10, - Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5f)); + Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); auto array = PointArray::create(20); array->addControlPoint(Vec2(0.0f, 0.0f)); @@ -99,7 +99,7 @@ DrawNodeTest::DrawNodeTest() array->addControlPoint(Vec2(80.0f, s.height - 80)); array->addControlPoint(Vec2(80.0f, 80.0f)); array->addControlPoint(Vec2(s.width / 2, s.height / 2)); - draw->drawCardinalSpline(array, 0.5f, 50, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5f)); + draw->drawCardinalSpline(array, 0.5f, 50, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); auto array2 = PointArray::create(20); array2->addControlPoint(Vec2(s.width / 2, 30.0f)); @@ -107,22 +107,22 @@ DrawNodeTest::DrawNodeTest() array2->addControlPoint(Vec2(s.width - 80, s.height - 80)); array2->addControlPoint(Vec2(s.width / 2, s.height - 80)); array2->addControlPoint(Vec2(s.width / 2, 30.0f)); - draw->drawCatmullRom(array2, 50, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5f)); + draw->drawCatmullRom(array2, 50, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); // open random color poly Vec2 vertices[] = {Vec2(0.0f, 0.0f), Vec2(50.0f, 50.0f), Vec2(100.0f, 50.0f), Vec2(100.0f, 100.0f), Vec2(50.0f, 100.0f)}; - draw->drawPoly(vertices, 5, false, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1.0f)); + draw->drawPoly(vertices, 5, false, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // closed random color poly Vec2 vertices2[] = {Vec2(30.0f, 130.0f), Vec2(30.0f, 230.0f), Vec2(50.0f, 200.0f)}; - draw->drawPoly(vertices2, 3, true, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1.0f)); + draw->drawPoly(vertices2, 3, true, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); // Draw 10 circles for (int i = 0; i < 10; i++) { draw->drawDot(Vec2(s.width / 2, s.height / 2), 10 * (10 - i), - Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1.0f)); + Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } // Draw polygons @@ -174,7 +174,7 @@ DrawNodeTest::DrawNodeTest() draw->drawSolidRect(Vec2(10.0f, 10.0f), Vec2(20.0f, 20.0f), Color4F(1.0f, 1.0f, 0.0f, 1.0f)); // draw a solid circle - draw->drawSolidCircle(VisibleRect::center() + Vec2(140.0f, 0.0f), 40, CC_DEGREES_TO_RADIANS(90), 50, 2.0f, 2.0f, + draw->drawSolidCircle(VisibleRect::center() + Vec2(140.0f, 0.0f), 40, AX_DEGREES_TO_RADIANS(90), 50, 2.0f, 2.0f, Color4F(0.0f, 1.0f, 0.0f, 1.0f)); // Draw segment @@ -184,12 +184,12 @@ DrawNodeTest::DrawNodeTest() // Draw triangle draw->drawTriangle(Vec2(10.0f, 10.0f), Vec2(70.0f, 30.0f), Vec2(100.0f, 140.0f), - Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5f)); + Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 0.5f)); for (int i = 0; i < 100; i++) { draw->drawPoint(Vec2(i * 7.0f, 5.0f), (float)i / 5 + 1, - Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1.0f)); + Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f)); } auto draw1 = DrawNode::create(); @@ -222,11 +222,11 @@ Issue11942Test::Issue11942Test() // draw a circle draw->setLineWidth(1); - draw->drawCircle(VisibleRect::center() - Vec2(140.0f, 0.0f), 50, CC_DEGREES_TO_RADIANS(90), 30, false, - Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); + draw->drawCircle(VisibleRect::center() - Vec2(140.0f, 0.0f), 50, AX_DEGREES_TO_RADIANS(90), 30, false, + Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); draw->setLineWidth(10); - draw->drawCircle(VisibleRect::center() + Vec2(140.0f, 0.0f), 50, CC_DEGREES_TO_RADIANS(90), 30, false, - Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); + draw->drawCircle(VisibleRect::center() + Vec2(140.0f, 0.0f), 50, AX_DEGREES_TO_RADIANS(90), 30, false, + Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); } string Issue11942Test::title() const diff --git a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp index 2d3fb4896d..b6fc9eae92 100644 --- a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp +++ b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp @@ -385,7 +385,7 @@ bool EffectBaseTest::init() auto sc2_back = sc2->reverse(); tamara->runAction(RepeatForever::create(Sequence::create(sc2, sc2_back, nullptr))); - schedule(CC_SCHEDULE_SELECTOR(EffectBaseTest::checkAnim)); + schedule(AX_SCHEDULE_SELECTOR(EffectBaseTest::checkAnim)); return true; } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp index 898bb25b72..3253389b59 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp @@ -77,7 +77,7 @@ bool AssetsManagerExLoaderScene::init() auto downloadLabel = Label::createWithTTF("Start Download", "fonts/arial.ttf", 16); auto downloadItem = - MenuItemLabel::create(downloadLabel, CC_CALLBACK_1(AssetsManagerExLoaderScene::startDownloadCallback, this)); + MenuItemLabel::create(downloadLabel, AX_CALLBACK_1(AssetsManagerExLoaderScene::startDownloadCallback, this)); downloadItem->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y + 100)); _downloadMenu = Menu::create(downloadItem, nullptr); _downloadMenu->setPosition(Vec2::ZERO); @@ -97,7 +97,7 @@ bool AssetsManagerExLoaderScene::init() std::string manifestPath = sceneManifests[_testIndex], storagePath = FileUtils::getInstance()->getWritablePath() + storagePaths[_testIndex]; - CCLOG("Storage path for this test : %s", storagePath.c_str()); + AXLOG("Storage path for this test : %s", storagePath.c_str()); _am = AssetsManagerEx::create(manifestPath, storagePath); _am->retain(); @@ -121,7 +121,7 @@ void AssetsManagerExLoaderScene::startDownloadCallback(Ref* sender) if (!_am->getLocalManifest()->isLoaded()) { - CCLOG("Fail to update assets, step skipped."); + AXLOG("Fail to update assets, step skipped."); onLoadEnd(); } else @@ -133,7 +133,7 @@ void AssetsManagerExLoaderScene::startDownloadCallback(Ref* sender) { case EventAssetsManagerEx::EventCode::ERROR_NO_LOCAL_MANIFEST: { - CCLOG("No local manifest file found, skip assets update."); + AXLOG("No local manifest file found, skip assets update."); this->onLoadEnd(); } break; @@ -153,7 +153,7 @@ void AssetsManagerExLoaderScene::startDownloadCallback(Ref* sender) else { str = StringUtils::format("%.2f", percent) + "%"; - CCLOG("%.2f Percent", percent); + AXLOG("%.2f Percent", percent); } if (this->_progress != nullptr) this->_progress->setString(str); @@ -162,20 +162,20 @@ void AssetsManagerExLoaderScene::startDownloadCallback(Ref* sender) case EventAssetsManagerEx::EventCode::ERROR_DOWNLOAD_MANIFEST: case EventAssetsManagerEx::EventCode::ERROR_PARSE_MANIFEST: { - CCLOG("Fail to download manifest file, update skipped."); + AXLOG("Fail to download manifest file, update skipped."); this->onLoadEnd(); } break; case EventAssetsManagerEx::EventCode::ALREADY_UP_TO_DATE: case EventAssetsManagerEx::EventCode::UPDATE_FINISHED: { - CCLOG("Update finished. %s", event->getMessage().c_str()); + AXLOG("Update finished. %s", event->getMessage().c_str()); this->onLoadEnd(); } break; case EventAssetsManagerEx::EventCode::UPDATE_FAILED: { - CCLOG("Update failed. %s", event->getMessage().c_str()); + AXLOG("Update failed. %s", event->getMessage().c_str()); failCount++; if (failCount < 5) @@ -184,7 +184,7 @@ void AssetsManagerExLoaderScene::startDownloadCallback(Ref* sender) } else { - CCLOG("Reach maximum fail count, exit update process"); + AXLOG("Reach maximum fail count, exit update process"); failCount = 0; this->onLoadEnd(); } @@ -192,12 +192,12 @@ void AssetsManagerExLoaderScene::startDownloadCallback(Ref* sender) break; case EventAssetsManagerEx::EventCode::ERROR_UPDATING: { - CCLOG("Asset %s : %s", event->getAssetId().c_str(), event->getMessage().c_str()); + AXLOG("Asset %s : %s", event->getAssetId().c_str(), event->getMessage().c_str()); } break; case EventAssetsManagerEx::EventCode::ERROR_DECOMPRESS: { - CCLOG("%s", event->getMessage().c_str()); + AXLOG("%s", event->getMessage().c_str()); } break; default: diff --git a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp index a199e6341f..47b2254e60 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp @@ -70,7 +70,7 @@ bool TableViewTest::init() void TableViewTest::tableCellTouched(TableView* table, TableViewCell* cell) { - CCLOG("cell touched at index: %d", static_cast(cell->getIdx())); + AXLOG("cell touched at index: %d", static_cast(cell->getIdx())); } Size TableViewTest::tableCellSizeForIndex(TableView* table, ssize_t idx) diff --git a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp index 5c7feffd64..a306552eeb 100644 --- a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp +++ b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp @@ -123,7 +123,7 @@ void TestSearchPath::onEnter() if (fp) { size_t ret = fwrite(szBuf, 1, strlen(szBuf), fp); - CCASSERT(ret != 0, "fwrite function returned zero value"); + AXASSERT(ret != 0, "fwrite function returned zero value"); fclose(fp); if (ret != 0) log("Writing file to writable path succeed."); @@ -164,7 +164,7 @@ void TestSearchPath::onEnter() } // FIXME: should fix the issue on Android -#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) // Save old resource root path std::string oldDefaultRootPath = sharedFileUtils->getDefaultResourceRootPath(); @@ -977,7 +977,7 @@ void TestIsFileExistAsync::onEnter() auto sharedFileUtils = FileUtils::getInstance(); sharedFileUtils->isFileExist("Images/grossini.png", [=](bool isExist) { - CCASSERT(std::this_thread::get_id() == Director::getInstance()->getCocos2dThreadId(), + AXASSERT(std::this_thread::get_id() == Director::getInstance()->getCocos2dThreadId(), "Callback should be on cocos thread"); auto label = Label::createWithSystemFont( isExist ? "Images/grossini.png exists" : "Images/grossini.png doesn't exist", "", 20); @@ -1070,7 +1070,7 @@ void TestFileFuncsAsync::onEnter() fclose(out); sharedFileUtils->isFileExist(filepath, [=](bool exists) { - CCASSERT(exists, "File could not be found"); + AXASSERT(exists, "File could not be found"); auto label = Label::createWithSystemFont("Test file '__test.test' created", "", 20); label->setPosition(x, y * 4); this->addChild(label); @@ -1082,13 +1082,13 @@ void TestFileFuncsAsync::onEnter() this->addChild(label); sharedFileUtils->renameFile(sharedFileUtils->getWritablePath(), filename, filename2, [=](bool success) { - CCASSERT(success, "Was not able to properly rename file"); + AXASSERT(success, "Was not able to properly rename file"); auto label = Label::createWithSystemFont("renameFile: Test file renamed to '__newtest.test'", "", 20); label->setPosition(x, y * 2); this->addChild(label); sharedFileUtils->removeFile(sharedFileUtils->getWritablePath() + filename2, [=](bool success) { - CCASSERT(success, "Was not able to remove file"); + AXASSERT(success, "Was not able to remove file"); auto label = Label::createWithSystemFont("removeFile: Test file removed", "", 20); label->setPosition(x, y * 1); this->addChild(label); @@ -1130,11 +1130,11 @@ void TestWriteStringAsync::onEnter() std::string fullPath = writablePath + fileName; FileUtils::getInstance()->writeStringToFile(writeDataStr, fullPath, [=](bool success) { - CCASSERT(success, "Write String to data failed"); + AXASSERT(success, "Write String to data failed"); writeResult->setString("write success:" + writeDataStr); FileUtils::getInstance()->getStringFromFile(fullPath, [=](std::string_view value) { - CCASSERT(!value.empty(), "String should be readable"); + AXASSERT(!value.empty(), "String should be readable"); std::string strVal = "read success: "; readResult->setString(strVal.append(value)); @@ -1240,12 +1240,12 @@ void TestListFiles::onEnter() for (int i = 0; i < listFonts.size(); i++) { - CCLOG("fonts/ %d: \t %s", i, listFonts[i].c_str()); + AXLOG("fonts/ %d: \t %s", i, listFonts[i].c_str()); } for (int i = 0; i < list.size(); i++) { - CCLOG("defResRootPath %d: \t %s", i, list[i].c_str()); + AXLOG("defResRootPath %d: \t %s", i, list[i].c_str()); } cntLabel->setString(cntBuffer); diff --git a/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.cpp b/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.cpp index 5f9327e680..dc047adafd 100644 --- a/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.cpp +++ b/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.cpp @@ -6,7 +6,7 @@ USING_NS_AX; USING_NS_AX_EXT; -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) static bool show_test_window = true; static bool show_another_window = true; @@ -28,7 +28,7 @@ void ImGuiTest::onEnter() TestCase::onEnter(); ImGuiPresenter::getInstance()->addFont(FileUtils::getInstance()->fullPathForFilename("fonts/arial.ttf")); - ImGuiPresenter::getInstance()->addRenderLoop("#test", CC_CALLBACK_0(ImGuiTest::onDrawImGui, this), this); + ImGuiPresenter::getInstance()->addRenderLoop("#test", AX_CALLBACK_0(ImGuiTest::onDrawImGui, this), this); } void ImGuiTest::onExit() diff --git a/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.h b/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.h index 35619b777d..e7963c295b 100644 --- a/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.h +++ b/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.h @@ -30,7 +30,7 @@ #include "cocos2d.h" #include "../BaseTest.h" -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) DEFINE_TEST_SUITE(ImGuiTests); diff --git a/tests/cpp-tests/Classes/InputTest/MouseTest.cpp b/tests/cpp-tests/Classes/InputTest/MouseTest.cpp index bbea5819c0..acca7e7fed 100644 --- a/tests/cpp-tests/Classes/InputTest/MouseTest.cpp +++ b/tests/cpp-tests/Classes/InputTest/MouseTest.cpp @@ -60,10 +60,10 @@ MouseEventTest::MouseEventTest() addChild(_labelPosition); _mouseListener = EventListenerMouse::create(); - _mouseListener->onMouseMove = CC_CALLBACK_1(MouseEventTest::onMouseMove, this); - _mouseListener->onMouseUp = CC_CALLBACK_1(MouseEventTest::onMouseUp, this); - _mouseListener->onMouseDown = CC_CALLBACK_1(MouseEventTest::onMouseDown, this); - _mouseListener->onMouseScroll = CC_CALLBACK_1(MouseEventTest::onMouseScroll, this); + _mouseListener->onMouseMove = AX_CALLBACK_1(MouseEventTest::onMouseMove, this); + _mouseListener->onMouseUp = AX_CALLBACK_1(MouseEventTest::onMouseUp, this); + _mouseListener->onMouseDown = AX_CALLBACK_1(MouseEventTest::onMouseDown, this); + _mouseListener->onMouseScroll = AX_CALLBACK_1(MouseEventTest::onMouseScroll, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(_mouseListener, this); } diff --git a/tests/cpp-tests/Classes/JNITest/JNITest.cpp b/tests/cpp-tests/Classes/JNITest/JNITest.cpp index c7391063c6..ceeffda90b 100644 --- a/tests/cpp-tests/Classes/JNITest/JNITest.cpp +++ b/tests/cpp-tests/Classes/JNITest/JNITest.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "JNITest.h" @@ -57,28 +57,28 @@ JNITest::JNITest() JniHelper::callStaticVoidMethod(classPath, "voidMethod3", int(4), float(2.5), "JNI is really easy"); bool b1 = JniHelper::callStaticBooleanMethod(classPath, "booleanMethod", int(5)); - CC_ASSERT(b1 == true); + AX_ASSERT(b1 == true); bool b2 = JniHelper::callStaticBooleanMethod(classPath, "booleanMethod", int(-3)); - CC_ASSERT(b2 == false); + AX_ASSERT(b2 == false); int i = JniHelper::callStaticIntMethod(classPath, "intMethod", int(10), int(10)); - CC_ASSERT(i == 20); + AX_ASSERT(i == 20); float f = JniHelper::callStaticFloatMethod(classPath, "floatMethod", float(2.35), float(7.65)); - CC_ASSERT(f == 10.0); + AX_ASSERT(f == 10.0); double d = JniHelper::callStaticDoubleMethod(classPath, "doubleMethod", double(2.5), int(4)); - CC_ASSERT(d == 10.0); + AX_ASSERT(d == 10.0); std::string str = "ABCDEF"; std::string s1 = JniHelper::callStaticStringMethod(classPath, "stringMethod", str, true); - CC_ASSERT(s1 == "FEDCBA"); + AX_ASSERT(s1 == "FEDCBA"); std::string s2 = JniHelper::callStaticStringMethod(classPath, "stringMethod", str, false); - CC_ASSERT(s2 == "ABCDEF"); + AX_ASSERT(s2 == "ABCDEF"); const char* cstr = "XYZ"; std::string s3 = JniHelper::callStaticStringMethod(classPath, "stringMethod", cstr, true); - CC_ASSERT(s3 == "ZYX"); + AX_ASSERT(s3 == "ZYX"); // should not crash for (int i = 0; i < 10000; i++) diff --git a/tests/cpp-tests/Classes/JNITest/JNITest.h b/tests/cpp-tests/Classes/JNITest/JNITest.h index c89cc8f8a6..530065bcb6 100644 --- a/tests/cpp-tests/Classes/JNITest/JNITest.h +++ b/tests/cpp-tests/Classes/JNITest/JNITest.h @@ -25,7 +25,7 @@ #ifndef _JNI_TEST_H_ #define _JNI_TEST_H_ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "cocos2d.h" # include "../BaseTest.h" diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp index b484b50344..7068cf7304 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp @@ -180,7 +180,7 @@ LabelFNTColorAndOpacity::LabelFNTColorAndOpacity() label2->setPosition(VisibleRect::center()); label3->setPosition(VisibleRect::rightTop()); - schedule(CC_CALLBACK_1(LabelFNTColorAndOpacity::step, this), "step_key"); + schedule(AX_CALLBACK_1(LabelFNTColorAndOpacity::step, this), "step_key"); } void LabelFNTColorAndOpacity::step(float dt) @@ -259,7 +259,7 @@ LabelFNTSpriteActions::LabelFNTSpriteActions() auto lastChar = (Sprite*)label2->getLetter(3); lastChar->runAction(rot_4ever->clone()); - schedule(CC_CALLBACK_1(LabelFNTSpriteActions::step, this), 0.1f, "step_key"); + schedule(AX_CALLBACK_1(LabelFNTSpriteActions::step, this), 0.1f, "step_key"); } void LabelFNTSpriteActions::step(float dt) @@ -397,7 +397,7 @@ LabelFNTHundredLabels::LabelFNTHundredLabels() auto s = Director::getInstance()->getWinSize(); - auto p = Vec2(CCRANDOM_0_1() * s.width, CCRANDOM_0_1() * s.height); + auto p = Vec2(AXRANDOM_0_1() * s.width, AXRANDOM_0_1() * s.height); label->setPosition(p); } } @@ -422,14 +422,14 @@ LabelFNTMultiLine::LabelFNTMultiLine() addChild(label1, 0, kTagBitmapAtlas1); s = label1->getContentSize(); - CCLOG("content size: %.2fx%.2f", s.width, s.height); + AXLOG("content size: %.2fx%.2f", s.width, s.height); // Center auto label2 = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", "Multi line\nCenter"); addChild(label2, 0, kTagBitmapAtlas2); s = label2->getContentSize(); - CCLOG("content size: %.2fx%.2f", s.width, s.height); + AXLOG("content size: %.2fx%.2f", s.width, s.height); // right auto label3 = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", "Multi line\nRight\nThree lines Three"); @@ -437,7 +437,7 @@ LabelFNTMultiLine::LabelFNTMultiLine() addChild(label3, 0, kTagBitmapAtlas3); s = label3->getContentSize(); - CCLOG("content size: %.2fx%.2f", s.width, s.height); + AXLOG("content size: %.2fx%.2f", s.width, s.height); label1->setPosition(VisibleRect::leftBottom()); label2->setPosition(VisibleRect::center()); @@ -473,7 +473,7 @@ LabelFNTandTTFEmpty::LabelFNTandTTFEmpty() addChild(label3, 0, kTagBitmapAtlas3); label3->setPosition(Vec2(s.width / 2, 100.0f)); - schedule(CC_CALLBACK_1(LabelFNTandTTFEmpty::updateStrings, this), 1.0f, "update_strings_key"); + schedule(AX_CALLBACK_1(LabelFNTandTTFEmpty::updateStrings, this), 1.0f, "update_strings_key"); setEmpty = false; } @@ -593,9 +593,9 @@ bool LabelFNTMultiLineAlignment::init() } auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // ask director the the window size @@ -609,11 +609,11 @@ bool LabelFNTMultiLineAlignment::init() MenuItemFont::setFontSize(20); auto longSentences = - MenuItemFont::create("Long Flowing Sentences", CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); + MenuItemFont::create("Long Flowing Sentences", AX_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); auto lineBreaks = MenuItemFont::create("Short Sentences With Intentional Line Breaks", - CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); + AX_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); auto mixed = MenuItemFont::create("Long Sentences Mixed With Intentional Line Breaks", - CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); + AX_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); auto stringMenu = Menu::create(longSentences, lineBreaks, mixed, nullptr); stringMenu->alignItemsVertically(); @@ -627,9 +627,9 @@ bool LabelFNTMultiLineAlignment::init() MenuItemFont::setFontSize(30); - auto left = MenuItemFont::create("Left", CC_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); - auto center = MenuItemFont::create("Center", CC_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); - auto right = MenuItemFont::create("Right", CC_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); + auto left = MenuItemFont::create("Left", AX_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); + auto center = MenuItemFont::create("Center", AX_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); + auto right = MenuItemFont::create("Right", AX_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); auto alignmentMenu = Menu::create(left, center, right, nullptr); alignmentMenu->alignItemsHorizontallyWithPadding(alignmentItemPadding); @@ -1055,9 +1055,9 @@ LabelTTFDynamicAlignment::LabelTTFDynamicAlignment() addChild(_label); auto menu = Menu::create( - MenuItemFont::create("Left", CC_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentLeft, this)), - MenuItemFont::create("Center", CC_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentCenter, this)), - MenuItemFont::create("Right", CC_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentRight, this)), nullptr); + MenuItemFont::create("Left", AX_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentLeft, this)), + MenuItemFont::create("Center", AX_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentCenter, this)), + MenuItemFont::create("Right", AX_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentRight, this)), nullptr); menu->alignItemsHorizontallyWithPadding(20); menu->setPosition(winSize.width / 2, winSize.height * 0.25f); @@ -1376,7 +1376,7 @@ void LabelShadowTest::onEnter() slider->loadProgressBarTexture("cocosui/sliderProgress.png"); slider->setPosition(Vec2(size.width / 2.0f, size.height * 0.15f + slider->getContentSize().height * 2.0f)); slider->setPercent(52); - slider->addEventListener(CC_CALLBACK_2(LabelShadowTest::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(LabelShadowTest::sliderEvent, this)); addChild(slider, 999); auto slider2 = ui::Slider::create(); @@ -1388,7 +1388,7 @@ void LabelShadowTest::onEnter() slider2->setPosition(Vec2(size.width * 0.15f, size.height / 2.0f)); slider2->setRotation(90); slider2->setPercent(52); - slider2->addEventListener(CC_CALLBACK_2(LabelShadowTest::sliderEvent, this)); + slider2->addEventListener(AX_CALLBACK_2(LabelShadowTest::sliderEvent, this)); addChild(slider2, 999); float subtitleY = _subtitleLabel->getPosition().y; @@ -1465,7 +1465,7 @@ LabelCharMapTest::LabelCharMapTest() label2->setPosition(Vec2(10, 200)); label2->setOpacity(32); - schedule(CC_CALLBACK_1(LabelCharMapTest::step, this), "step_key"); + schedule(AX_CALLBACK_1(LabelCharMapTest::step, this), "step_key"); } void LabelCharMapTest::step(float dt) @@ -1513,19 +1513,19 @@ LabelCharMapColorTest::LabelCharMapColorTest() auto fade = FadeOut::create(1.0f); auto fade_in = fade->reverse(); - auto cb = CallFunc::create(CC_CALLBACK_0(LabelCharMapColorTest::actionFinishCallback, this)); + auto cb = CallFunc::create(AX_CALLBACK_0(LabelCharMapColorTest::actionFinishCallback, this)); auto seq = Sequence::create(fade, fade_in, cb, nullptr); auto repeat = RepeatForever::create(seq); label2->runAction(repeat); _time = 0; - schedule(CC_CALLBACK_1(LabelCharMapColorTest::step, this), "step_key"); + schedule(AX_CALLBACK_1(LabelCharMapColorTest::step, this), "step_key"); } void LabelCharMapColorTest::actionFinishCallback() { - CCLOG("Action finished"); + AXLOG("Action finished"); } void LabelCharMapColorTest::step(float dt) @@ -1661,16 +1661,16 @@ LabelAlignmentTest::LabelAlignmentTest() MenuItemFont::setFontSize(30); auto menu = Menu::create( - MenuItemFont::create("Left", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentLeft, this)), - MenuItemFont::create("Center", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentCenter, this)), - MenuItemFont::create("Right", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentRight, this)), nullptr); + MenuItemFont::create("Left", AX_CALLBACK_1(LabelAlignmentTest::setAlignmentLeft, this)), + MenuItemFont::create("Center", AX_CALLBACK_1(LabelAlignmentTest::setAlignmentCenter, this)), + MenuItemFont::create("Right", AX_CALLBACK_1(LabelAlignmentTest::setAlignmentRight, this)), nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(50.0f, s.height / 2 - 20)); this->addChild(menu); - menu = Menu::create(MenuItemFont::create("Top", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentTop, this)), - MenuItemFont::create("Middle", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentMiddle, this)), - MenuItemFont::create("Bottom", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentBottom, this)), + menu = Menu::create(MenuItemFont::create("Top", AX_CALLBACK_1(LabelAlignmentTest::setAlignmentTop, this)), + MenuItemFont::create("Middle", AX_CALLBACK_1(LabelAlignmentTest::setAlignmentMiddle, this)), + MenuItemFont::create("Bottom", AX_CALLBACK_1(LabelAlignmentTest::setAlignmentBottom, this)), nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(s.width - 50, s.height / 2 - 20)); @@ -1793,7 +1793,7 @@ LabelLineHeightTest::LabelLineHeightTest() slider->loadProgressBarTexture("cocosui/sliderProgress.png"); slider->setPosition(Vec2(size.width / 2.0f, size.height * 0.15f + slider->getContentSize().height * 2.0f)); slider->setPercent(label->getLineHeight()); - slider->addEventListener(CC_CALLBACK_2(LabelLineHeightTest::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(LabelLineHeightTest::sliderEvent, this)); addChild(slider); } @@ -1837,7 +1837,7 @@ LabelAdditionalKerningTest::LabelAdditionalKerningTest() slider->loadProgressBarTexture("cocosui/sliderProgress.png"); slider->setPosition(Vec2(size.width / 2.0f, size.height * 0.15f + slider->getContentSize().height * 2.0f)); slider->setPercent(0); - slider->addEventListener(CC_CALLBACK_2(LabelAdditionalKerningTest::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(LabelAdditionalKerningTest::sliderEvent, this)); addChild(slider); } @@ -2352,16 +2352,16 @@ void LabelLayoutBaseTest::initAlignmentOption(const axis::Size& size) // add text alignment settings MenuItemFont::setFontSize(30); auto menu = Menu::create( - MenuItemFont::create("Left", CC_CALLBACK_1(LabelLayoutBaseTest::setAlignmentLeft, this)), - MenuItemFont::create("Center", CC_CALLBACK_1(LabelLayoutBaseTest::setAlignmentCenter, this)), - MenuItemFont::create("Right", CC_CALLBACK_1(LabelLayoutBaseTest::setAlignmentRight, this)), nullptr); + MenuItemFont::create("Left", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentLeft, this)), + MenuItemFont::create("Center", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentCenter, this)), + MenuItemFont::create("Right", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentRight, this)), nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(50.0f, size.height / 2 - 20)); this->addChild(menu); - menu = Menu::create(MenuItemFont::create("Top", CC_CALLBACK_1(LabelLayoutBaseTest::setAlignmentTop, this)), - MenuItemFont::create("Middle", CC_CALLBACK_1(LabelLayoutBaseTest::setAlignmentMiddle, this)), - MenuItemFont::create("Bottom", CC_CALLBACK_1(LabelLayoutBaseTest::setAlignmentBottom, this)), + menu = Menu::create(MenuItemFont::create("Top", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentTop, this)), + MenuItemFont::create("Middle", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentMiddle, this)), + MenuItemFont::create("Bottom", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentBottom, this)), nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(size.width - 50, size.height / 2 - 20)); @@ -2498,7 +2498,7 @@ void LabelLayoutBaseTest::valueChanged(axis::Ref* sender, axis::extension::Contr // letterSprite->stopAllActions(); // letterSprite->runAction(Sequence::create(moveBy, moveBy->clone()->reverse(), nullptr )); // - // CCLOG("label line height = %f", _label->getLineHeight()); + // AXLOG("label line height = %f", _label->getLineHeight()); } void LabelLayoutBaseTest::updateDrawNodeSize(const axis::Size& drawNodeSize) @@ -2767,7 +2767,7 @@ void LabelToggleTypeTest::initToggleCheckboxes() float posX = startPosX + BUTTON_WIDTH * i; radioButton->setPosition(Vec2(posX, winSize.height / 2.0f + 70)); radioButton->setScale(1.2f); - radioButton->addEventListener(CC_CALLBACK_2(LabelToggleTypeTest::onChangedRadioButtonSelect, this)); + radioButton->addEventListener(AX_CALLBACK_2(LabelToggleTypeTest::onChangedRadioButtonSelect, this)); radioButton->setTag(i); radioButtonGroup->addRadioButton(radioButton); this->addChild(radioButton); @@ -2913,7 +2913,7 @@ void LabelSystemFontTest::initToggleCheckboxes() float posX = startPosX + BUTTON_WIDTH * i; radioButton->setPosition(Vec2(posX, winSize.height / 2.0f + 70)); radioButton->setScale(1.2f); - radioButton->addEventListener(CC_CALLBACK_2(LabelSystemFontTest::onChangedRadioButtonSelect, this)); + radioButton->addEventListener(AX_CALLBACK_2(LabelSystemFontTest::onChangedRadioButtonSelect, this)); radioButton->setTag(i); radioButtonGroup->addRadioButton(radioButton); this->addChild(radioButton); @@ -3313,7 +3313,7 @@ LabelLocalizationTest::LabelLocalizationTest() float posX = startPosX + BUTTON_WIDTH * i; radioButton->setPosition(Vec2(posX, winSize.height / 2.0f + 70)); radioButton->setScale(1.2f); - radioButton->addEventListener(CC_CALLBACK_2(LabelLocalizationTest::onChangedRadioButtonSelect, this)); + radioButton->addEventListener(AX_CALLBACK_2(LabelLocalizationTest::onChangedRadioButtonSelect, this)); radioButton->setTag(i); radioButtonGroup->addRadioButton(radioButton); this->addChild(radioButton); @@ -3571,7 +3571,7 @@ LabelIssue17902::LabelIssue17902() label->setPosition(center); addChild(label); - scheduleOnce(CC_CALLBACK_0(LabelIssue17902::purgeCachedData, this), 1.0f, "purge_cached_data"); + scheduleOnce(AX_CALLBACK_0(LabelIssue17902::purgeCachedData, this), 1.0f, "purge_cached_data"); } void LabelIssue17902::purgeCachedData() @@ -3606,7 +3606,7 @@ LabelIssue20523::LabelIssue20523() ++_i; _crashingLabel->setString(std::to_string(_i)); }, - 1, CC_REPEAT_FOREVER, 0, "repeat"); + 1, AX_REPEAT_FOREVER, 0, "repeat"); } std::string LabelIssue20523::title() const diff --git a/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp b/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp index 9204a3e344..0c00ccde1b 100644 --- a/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp +++ b/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp @@ -315,9 +315,9 @@ void LayerTest1::onEnter() LayerTest::onEnter(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(LayerTest1::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(LayerTest1::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(LayerTest1::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(LayerTest1::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(LayerTest1::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(LayerTest1::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); @@ -419,7 +419,7 @@ LayerTestBlend::LayerTestBlend() sister1->setPosition(Vec2(s.width * 1 / 3, s.height / 2)); sister2->setPosition(Vec2(s.width * 2 / 3, s.height / 2)); - schedule(CC_SCHEDULE_SELECTOR(LayerTestBlend::newBlend), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(LayerTestBlend::newBlend), 1.0f); } void LayerTestBlend::newBlend(float dt) @@ -460,7 +460,7 @@ LayerGradientTest::LayerGradientTest() addChild(layer1, 0, kTagLayer); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(LayerGradientTest::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(LayerGradientTest::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto label1 = Label::createWithTTF("Compressed Interpolation: Enabled", "fonts/Marker Felt.ttf", 26); @@ -468,7 +468,7 @@ LayerGradientTest::LayerGradientTest() auto item1 = MenuItemLabel::create(label1); auto item2 = MenuItemLabel::create(label2); auto item = - MenuItemToggle::createWithCallback(CC_CALLBACK_1(LayerGradientTest::toggleItem, this), item1, item2, nullptr); + MenuItemToggle::createWithCallback(AX_CALLBACK_1(LayerGradientTest::toggleItem, this), item1, item2, nullptr); auto menu = Menu::create(item, nullptr); addChild(menu); @@ -554,7 +554,7 @@ void LayerIgnoreAnchorPointPos::onEnter() child->setPosition(Vec2(lsize.width / 2, lsize.height / 2)); auto item = - MenuItemFont::create("Toggle ignore anchor point", CC_CALLBACK_1(LayerIgnoreAnchorPointPos::onToggle, this)); + MenuItemFont::create("Toggle ignore anchor point", AX_CALLBACK_1(LayerIgnoreAnchorPointPos::onToggle, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -602,7 +602,7 @@ void LayerIgnoreAnchorPointRot::onEnter() child->setPosition(Vec2(lsize.width / 2, lsize.height / 2)); auto item = - MenuItemFont::create("Toggle ignore anchor point", CC_CALLBACK_1(LayerIgnoreAnchorPointRot::onToggle, this)); + MenuItemFont::create("Toggle ignore anchor point", AX_CALLBACK_1(LayerIgnoreAnchorPointRot::onToggle, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -653,7 +653,7 @@ void LayerIgnoreAnchorPointScale::onEnter() child->setPosition(Vec2(lsize.width / 2, lsize.height / 2)); auto item = - MenuItemFont::create("Toggle ignore anchor point", CC_CALLBACK_1(LayerIgnoreAnchorPointScale::onToggle, this)); + MenuItemFont::create("Toggle ignore anchor point", AX_CALLBACK_1(LayerIgnoreAnchorPointScale::onToggle, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -736,7 +736,7 @@ void LayerBug3162A::onEnter() this->addChild(_layer[0]); - schedule(CC_SCHEDULE_SELECTOR(LayerBug3162A::step), 0.5, CC_REPEAT_FOREVER, 0); + schedule(AX_SCHEDULE_SELECTOR(LayerBug3162A::step), 0.5, AX_REPEAT_FOREVER, 0); } void LayerBug3162A::step(float dt) @@ -782,7 +782,7 @@ void LayerBug3162B::onEnter() _layer[1]->setCascadeColorEnabled(true); _layer[2]->setCascadeColorEnabled(true); - schedule(CC_SCHEDULE_SELECTOR(LayerBug3162B::step), 0.5, CC_REPEAT_FOREVER, 0); + schedule(AX_SCHEDULE_SELECTOR(LayerBug3162B::step), 0.5, AX_REPEAT_FOREVER, 0); } void LayerBug3162B::step(float dt) @@ -862,7 +862,7 @@ axis::ui::Slider* LayerRadialGradientTest::createSlider() slider->loadBarTexture("cocosui/sliderTrack.png"); slider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); slider->loadProgressBarTexture("cocosui/sliderProgress.png"); - slider->addEventListener(CC_CALLBACK_2(LayerRadialGradientTest::sliderCallback, this)); + slider->addEventListener(AX_CALLBACK_2(LayerRadialGradientTest::sliderCallback, this)); slider->setRotation(90); slider->setTag(101); slider->setPercent(50); @@ -919,27 +919,27 @@ void LayerRadialGradientTest::sliderCallback(axis::Ref* sender, axis::ui::Slider case 0: // scale _layer->setScale(percent * 2); - CCLOG("scale is %f", percent * 2); + AXLOG("scale is %f", percent * 2); break; case 1: // skewx _layer->setSkewX(90 * percent); - CCLOG("SkewX is %f", 90 * percent); + AXLOG("SkewX is %f", 90 * percent); break; case 2: // skewy _layer->setSkewY(90 * percent); - CCLOG("SkewY is %f", 90 * percent); + AXLOG("SkewY is %f", 90 * percent); break; case 3: // expand _layer->setExpand(percent); - CCLOG("expand is %f", percent); + AXLOG("expand is %f", percent); break; case 4: // radius _layer->setRadius(300 * percent); - CCLOG("radius is %f", 300 * percent); + AXLOG("radius is %f", 300 * percent); break; default: break; @@ -980,7 +980,7 @@ axis::ui::ListView* LayerRadialGradientTest::createListView() listview->setCurSelectedIndex(0); listview->setTouchEnabled(true); listview->addEventListener( - (ui::ListView::ccListViewCallback)CC_CALLBACK_2(LayerRadialGradientTest::listviewCallback, this)); + (ui::ListView::ccListViewCallback)AX_CALLBACK_2(LayerRadialGradientTest::listviewCallback, this)); listview->setTag(100); return listview; diff --git a/tests/cpp-tests/Classes/LightTest/LightTest.cpp b/tests/cpp-tests/Classes/LightTest/LightTest.cpp index 268acd7679..a108e668f0 100644 --- a/tests/cpp-tests/Classes/LightTest/LightTest.cpp +++ b/tests/cpp-tests/Classes/LightTest/LightTest.cpp @@ -48,19 +48,19 @@ LightTest::LightTest() : _directionalLight(nullptr), _pointLight(nullptr), _spot _ambientLightLabel = Label::createWithTTF(ttfConfig, "Ambient Light ON"); _ambientLightLabel->retain(); auto menuItem0 = - MenuItemLabel::create(_ambientLightLabel, CC_CALLBACK_1(LightTest::SwitchLight, this, LightType::AMBIENT)); + MenuItemLabel::create(_ambientLightLabel, AX_CALLBACK_1(LightTest::SwitchLight, this, LightType::AMBIENT)); _directionalLightLabel = Label::createWithTTF(ttfConfig, "Directional Light OFF"); _directionalLightLabel->retain(); auto menuItem1 = MenuItemLabel::create(_directionalLightLabel, - CC_CALLBACK_1(LightTest::SwitchLight, this, LightType::DIRECTIONAL)); + AX_CALLBACK_1(LightTest::SwitchLight, this, LightType::DIRECTIONAL)); _pointLightLabel = Label::createWithTTF(ttfConfig, "Point Light OFF"); _pointLightLabel->retain(); auto menuItem2 = - MenuItemLabel::create(_pointLightLabel, CC_CALLBACK_1(LightTest::SwitchLight, this, LightType::POINT)); + MenuItemLabel::create(_pointLightLabel, AX_CALLBACK_1(LightTest::SwitchLight, this, LightType::POINT)); _spotLightLabel = Label::createWithTTF(ttfConfig, "Spot Light OFF"); _spotLightLabel->retain(); auto menuItem3 = - MenuItemLabel::create(_spotLightLabel, CC_CALLBACK_1(LightTest::SwitchLight, this, LightType::SPOT)); + MenuItemLabel::create(_spotLightLabel, AX_CALLBACK_1(LightTest::SwitchLight, this, LightType::SPOT)); auto menu = Menu::create(menuItem0, menuItem1, menuItem2, menuItem3, nullptr); menu->setPosition(Vec2::ZERO); menuItem0->setAnchorPoint(Vec2::ANCHOR_TOP_LEFT); @@ -234,7 +234,7 @@ void LightTest::update(float delta) if (_directionalLight) { - _directionalLight->setRotation3D(Vec3(-45.0, -CC_RADIANS_TO_DEGREES(angleDelta), 0.0f)); + _directionalLight->setRotation3D(Vec3(-45.0, -AX_RADIANS_TO_DEGREES(angleDelta), 0.0f)); } if (_pointLight) diff --git a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp index 57b8685a44..f892fe1f4c 100644 --- a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp +++ b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp @@ -150,10 +150,10 @@ void Material_2DEffects::onEnter() FETCH_CCTIME_LOCATION(meshNoise); FETCH_CCTIME_LOCATION(meshEdgeDetect); - schedule(CC_SCHEDULE_SELECTOR(Material_2DEffects::updateCCTimeUniforms)); + schedule(AX_SCHEDULE_SELECTOR(Material_2DEffects::updateCCTimeUniforms)); // properties is not a "Ref" object - CC_SAFE_DELETE(properties); + AX_SAFE_DELETE(properties); } std::string Material_2DEffects::subtitle() const @@ -195,13 +195,13 @@ bool EffectAutoBindingResolver::resolveAutoBinding(backend::ProgramState* progra if (autoBinding.compare("DYNAMIC_RADIUS") == 0) { auto loc = programState->getUniformLocation(uniform); - programState->setCallbackUniform(loc, CC_CALLBACK_2(EffectAutoBindingResolver::callbackRadius, this)); + programState->setCallbackUniform(loc, AX_CALLBACK_2(EffectAutoBindingResolver::callbackRadius, this)); return true; } else if (autoBinding.compare("OUTLINE_COLOR") == 0) { auto loc = programState->getUniformLocation(uniform); - programState->setCallbackUniform(loc, CC_CALLBACK_2(EffectAutoBindingResolver::callbackColor, this)); + programState->setCallbackUniform(loc, AX_CALLBACK_2(EffectAutoBindingResolver::callbackColor, this)); return true; } return false; @@ -209,15 +209,15 @@ bool EffectAutoBindingResolver::resolveAutoBinding(backend::ProgramState* progra void EffectAutoBindingResolver::callbackRadius(backend::ProgramState* programState, backend::UniformLocation uniform) { - float f = CCRANDOM_0_1() * 10; + float f = AXRANDOM_0_1() * 10; programState->setUniform(uniform, &f, sizeof(f)); } void EffectAutoBindingResolver::callbackColor(backend::ProgramState* programState, backend::UniformLocation uniform) { - float r = CCRANDOM_0_1(); - float g = CCRANDOM_0_1(); - float b = CCRANDOM_0_1(); + float r = AXRANDOM_0_1(); + float g = AXRANDOM_0_1(); + float b = AXRANDOM_0_1(); Vec3 color(r, g, b); programState->setUniform(uniform, &color, sizeof(color)); @@ -268,9 +268,9 @@ void Material_AutoBindings::onEnter() _noiseProgramState = meshNoise->getProgramState(); _locationTime = _noiseProgramState->getUniformLocation("u_Time"); - schedule(CC_SCHEDULE_SELECTOR(Material_AutoBindings::updateUniformTime)); + schedule(AX_SCHEDULE_SELECTOR(Material_AutoBindings::updateUniformTime)); // properties is not a "Ref" object - CC_SAFE_DELETE(properties); + AX_SAFE_DELETE(properties); } std::string Material_AutoBindings::subtitle() const @@ -308,7 +308,7 @@ void Material_setTechnique::onEnter() auto light2 = DirectionLight::create(Vec3(-1, 1, 0), Color3B::GREEN); addChild(light2); - this->schedule(CC_CALLBACK_1(Material_setTechnique::changeMaterial, this), 1, "cookie"); + this->schedule(AX_CALLBACK_1(Material_setTechnique::changeMaterial, this), 1, "cookie"); _techniqueState = 0; auto rot = RotateBy::create(5, Vec3(30.0f, 60.0f, 270.0f)); @@ -417,7 +417,7 @@ void Material_parsePerformance::onEnter() ui::Slider* slider = dynamic_cast(sender); float p = slider->getPercent() / 100.0f; slider->setTouchEnabled(false); - CCLOG("Will parsing material %d times", (int)(p * _maxParsingCoumt)); + AXLOG("Will parsing material %d times", (int)(p * _maxParsingCoumt)); Label* label = dynamic_cast(this->getChildByTag(SHOW_LEBAL_TAG)); if (label) { @@ -467,7 +467,7 @@ void Material_parsePerformance::parsingTesting(unsigned int count) elapsed_secs, count); label->setString(str); - CCLOG("Took: %.3f seconds for parsing material %d times.", elapsed_secs, count); + AXLOG("Took: %.3f seconds for parsing material %d times.", elapsed_secs, count); } } diff --git a/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp b/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp index 06b20683d5..92692e0d2c 100644 --- a/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp +++ b/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp @@ -60,10 +60,10 @@ MenuLayerMainMenu::MenuLayerMainMenu() { _touchListener = EventListenerTouchOneByOne::create(); _touchListener->setSwallowTouches(true); - _touchListener->onTouchBegan = CC_CALLBACK_2(MenuLayerMainMenu::touchBegan, this); - _touchListener->onTouchMoved = CC_CALLBACK_2(MenuLayerMainMenu::touchMoved, this); - _touchListener->onTouchEnded = CC_CALLBACK_2(MenuLayerMainMenu::touchEnded, this); - _touchListener->onTouchCancelled = CC_CALLBACK_2(MenuLayerMainMenu::touchCancelled, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(MenuLayerMainMenu::touchBegan, this); + _touchListener->onTouchMoved = AX_CALLBACK_2(MenuLayerMainMenu::touchMoved, this); + _touchListener->onTouchEnded = AX_CALLBACK_2(MenuLayerMainMenu::touchEnded, this); + _touchListener->onTouchCancelled = AX_CALLBACK_2(MenuLayerMainMenu::touchCancelled, this); _eventDispatcher->addEventListenerWithFixedPriority(_touchListener, 1); // Font Item @@ -72,18 +72,18 @@ MenuLayerMainMenu::MenuLayerMainMenu() auto spriteDisabled = Sprite::create(s_MenuItem, Rect(0, 23 * 0, 115, 23)); auto item1 = MenuItemSprite::create(spriteNormal, spriteSelected, spriteDisabled, - CC_CALLBACK_1(MenuLayerMainMenu::menuCallback, this)); + AX_CALLBACK_1(MenuLayerMainMenu::menuCallback, this)); // Image Item auto item2 = - MenuItemImage::create(s_SendScore, s_PressSendScore, CC_CALLBACK_1(MenuLayerMainMenu::menuCallback2, this)); + MenuItemImage::create(s_SendScore, s_PressSendScore, AX_CALLBACK_1(MenuLayerMainMenu::menuCallback2, this)); // Label Item (LabelAtlas) auto labelAtlas = LabelAtlas::create("0123456789", "fonts/labelatlas.png", 16, 24, '.'); - auto item3 = MenuItemLabel::create(labelAtlas, CC_CALLBACK_1(MenuLayerMainMenu::menuCallbackDisabled, this)); + auto item3 = MenuItemLabel::create(labelAtlas, AX_CALLBACK_1(MenuLayerMainMenu::menuCallbackDisabled, this)); item3->setDisabledColor(Color3B(32, 32, 64)); item3->setColor(Color3B(200, 200, 255)); - CCLOG("test MenuItem Label getString: %s", item3->getString().data()); + AXLOG("test MenuItem Label getString: %s", item3->getString().data()); // Font Item auto item4 = MenuItemFont::create("I toggle enable items", [&](Ref* sender) { _disabledItem->setEnabled(!_disabledItem->isEnabled()); }); @@ -93,7 +93,7 @@ MenuLayerMainMenu::MenuLayerMainMenu() // Label Item (LabelBMFont) auto label = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", "configuration"); - auto item5 = MenuItemLabel::create(label, CC_CALLBACK_1(MenuLayerMainMenu::menuCallbackConfig, this)); + auto item5 = MenuItemLabel::create(label, AX_CALLBACK_1(MenuLayerMainMenu::menuCallbackConfig, this)); // Testing issue #500 item5->setScale(0.8f); @@ -101,13 +101,13 @@ MenuLayerMainMenu::MenuLayerMainMenu() // Events MenuItemFont::setFontName("fonts/Marker Felt.ttf"); // Bugs Item - auto item6 = MenuItemFont::create("Bugs", CC_CALLBACK_1(MenuLayerMainMenu::menuCallbackBugsTest, this)); + auto item6 = MenuItemFont::create("Bugs", AX_CALLBACK_1(MenuLayerMainMenu::menuCallbackBugsTest, this)); // Font Item - auto item7 = MenuItemFont::create("Quit", CC_CALLBACK_1(MenuLayerMainMenu::onQuit, this)); + auto item7 = MenuItemFont::create("Quit", AX_CALLBACK_1(MenuLayerMainMenu::onQuit, this)); auto item8 = MenuItemFont::create("Remove menu item when moving", - CC_CALLBACK_1(MenuLayerMainMenu::menuMovingCallback, this)); + AX_CALLBACK_1(MenuLayerMainMenu::menuMovingCallback, this)); auto color_action = TintBy::create(0.5f, 0, -255, -255); auto color_back = color_action->reverse(); @@ -182,7 +182,7 @@ void MenuLayerMainMenu::menuCallbackDisabled(Ref* sender) { // hijack all touch events for 5 seconds _eventDispatcher->setPriority(_touchListener, -1); - schedule(CC_SCHEDULE_SELECTOR(MenuLayerMainMenu::allowTouches), 5.0f); + schedule(AX_SCHEDULE_SELECTOR(MenuLayerMainMenu::allowTouches), 5.0f); log("TOUCHES DISABLED FOR 5 SECONDS"); } @@ -216,11 +216,11 @@ MenuLayer2::MenuLayer2() { for (int i = 0; i < 2; i++) { - auto item1 = MenuItemImage::create(s_PlayNormal, s_PlaySelect, CC_CALLBACK_1(MenuLayer2::menuCallback, this)); + auto item1 = MenuItemImage::create(s_PlayNormal, s_PlaySelect, AX_CALLBACK_1(MenuLayer2::menuCallback, this)); auto item2 = - MenuItemImage::create(s_HighNormal, s_HighSelect, CC_CALLBACK_1(MenuLayer2::menuCallbackOpacity, this)); + MenuItemImage::create(s_HighNormal, s_HighSelect, AX_CALLBACK_1(MenuLayer2::menuCallbackOpacity, this)); auto item3 = - MenuItemImage::create(s_AboutNormal, s_AboutSelect, CC_CALLBACK_1(MenuLayer2::menuCallbackAlign, this)); + MenuItemImage::create(s_AboutNormal, s_AboutSelect, AX_CALLBACK_1(MenuLayer2::menuCallbackAlign, this)); item1->setScaleX(1.5f); item2->setScaleX(0.5f); @@ -327,7 +327,7 @@ MenuLayer3::MenuLayer3() auto label = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", "Enable AtlasItem"); auto item1 = MenuItemLabel::create(label, [&](Ref* sender) { - // CCLOG("Label clicked. Toggling AtlasSprite"); + // AXLOG("Label clicked. Toggling AtlasSprite"); _disabledItem->setEnabled(!_disabledItem->isEnabled()); _disabledItem->stopAllActions(); }); @@ -387,7 +387,7 @@ MenuLayer4::MenuLayer4() title1->setEnabled(false); MenuItemFont::setFontName("fonts/Marker Felt.ttf"); MenuItemFont::setFontSize(34); - auto item1 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), + auto item1 = MenuItemToggle::createWithCallback(AX_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create("On"), MenuItemFont::create("Off"), nullptr); MenuItemFont::setFontName("American Typewriter"); @@ -396,7 +396,7 @@ MenuLayer4::MenuLayer4() title2->setEnabled(false); MenuItemFont::setFontName("fonts/Marker Felt.ttf"); MenuItemFont::setFontSize(34); - auto item2 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), + auto item2 = MenuItemToggle::createWithCallback(AX_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create("On"), MenuItemFont::create("Off"), nullptr); MenuItemFont::setFontName("American Typewriter"); @@ -405,7 +405,7 @@ MenuLayer4::MenuLayer4() title3->setEnabled(false); MenuItemFont::setFontName("fonts/Marker Felt.ttf"); MenuItemFont::setFontSize(34); - auto item3 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), + auto item3 = MenuItemToggle::createWithCallback(AX_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create("High"), MenuItemFont::create("Low"), nullptr); MenuItemFont::setFontName("American Typewriter"); @@ -414,7 +414,7 @@ MenuLayer4::MenuLayer4() title4->setEnabled(false); MenuItemFont::setFontName("fonts/Marker Felt.ttf"); MenuItemFont::setFontSize(34); - auto item4 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), + auto item4 = MenuItemToggle::createWithCallback(AX_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create("Off"), nullptr); // TIP: you can manipulate the items like any other MutableArray @@ -429,7 +429,7 @@ MenuLayer4::MenuLayer4() MenuItemFont::setFontSize(34); auto label = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", "go back"); - auto back = MenuItemLabel::create(label, CC_CALLBACK_1(MenuLayer4::backCallback, this)); + auto back = MenuItemLabel::create(label, AX_CALLBACK_1(MenuLayer4::backCallback, this)); auto menu = Menu::create(title1, title2, item1, item2, title3, title4, item3, item4, back, nullptr); // 9 items. @@ -445,7 +445,7 @@ MenuLayer4::~MenuLayer4() {} void MenuLayer4::menuCallback(Ref* sender) { - // CCLOG("selected item: %x index:%d", dynamic_cast(sender)->selectedItem(), + // AXLOG("selected item: %x index:%d", dynamic_cast(sender)->selectedItem(), // dynamic_cast(sender)->selectedIndex() ); } @@ -457,9 +457,9 @@ void MenuLayer4::backCallback(Ref* sender) // BugsTest BugsTest::BugsTest() { - auto issue1410 = MenuItemFont::create("Issue 1410", CC_CALLBACK_1(BugsTest::issue1410MenuCallback, this)); - auto issue1410_2 = MenuItemFont::create("Issue 1410 #2", CC_CALLBACK_1(BugsTest::issue1410v2MenuCallback, this)); - auto back = MenuItemFont::create("Back", CC_CALLBACK_1(BugsTest::backMenuCallback, this)); + auto issue1410 = MenuItemFont::create("Issue 1410", AX_CALLBACK_1(BugsTest::issue1410MenuCallback, this)); + auto issue1410_2 = MenuItemFont::create("Issue 1410 #2", AX_CALLBACK_1(BugsTest::issue1410v2MenuCallback, this)); + auto back = MenuItemFont::create("Back", AX_CALLBACK_1(BugsTest::backMenuCallback, this)); auto menu = Menu::create(issue1410, issue1410_2, back, nullptr); addChild(menu); @@ -503,7 +503,7 @@ RemoveMenuItemWhenMove::RemoveMenuItemWhenMove() item = MenuItemFont::create("item 1"); item->retain(); - auto back = MenuItemFont::create("go back", CC_CALLBACK_1(RemoveMenuItemWhenMove::goBack, this)); + auto back = MenuItemFont::create("go back", AX_CALLBACK_1(RemoveMenuItemWhenMove::goBack, this)); auto menu = Menu::create(item, back, nullptr); addChild(menu); @@ -515,8 +515,8 @@ RemoveMenuItemWhenMove::RemoveMenuItemWhenMove() _touchListener = EventListenerTouchOneByOne::create(); _touchListener->setSwallowTouches(false); - _touchListener->onTouchBegan = CC_CALLBACK_2(RemoveMenuItemWhenMove::onTouchBegan, this); - _touchListener->onTouchMoved = CC_CALLBACK_2(RemoveMenuItemWhenMove::onTouchMoved, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(RemoveMenuItemWhenMove::onTouchBegan, this); + _touchListener->onTouchMoved = AX_CALLBACK_2(RemoveMenuItemWhenMove::onTouchMoved, this); _eventDispatcher->addEventListenerWithFixedPriority(_touchListener, -129); } @@ -529,7 +529,7 @@ void RemoveMenuItemWhenMove::goBack(Ref* pSender) RemoveMenuItemWhenMove::~RemoveMenuItemWhenMove() { _eventDispatcher->removeEventListener(_touchListener); - CC_SAFE_RELEASE(item); + AX_SAFE_RELEASE(item); } bool RemoveMenuItemWhenMove::onTouchBegan(Touch* touch, Event* event) diff --git a/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.cpp b/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.cpp index 8a4964a36f..de7d5553e4 100644 --- a/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.cpp +++ b/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.cpp @@ -34,8 +34,8 @@ DrawNode3D::DrawNode3D() DrawNode3D::~DrawNode3D() { - CC_SAFE_RELEASE_NULL(_programStateLine); - CC_SAFE_DELETE(_depthstencilDescriptor); + AX_SAFE_RELEASE_NULL(_programStateLine); + AX_SAFE_DELETE(_depthstencilDescriptor); } DrawNode3D* DrawNode3D::create() @@ -47,7 +47,7 @@ DrawNode3D* DrawNode3D::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -55,7 +55,7 @@ DrawNode3D* DrawNode3D::create() void DrawNode3D::ensureCapacity(int count) { - CCASSERT(count >= 0, "capacity must be >= 0"); + AXASSERT(count >= 0, "capacity must be >= 0"); auto EXTENDED_SIZE = _bufferLines.size() + count; @@ -79,8 +79,8 @@ bool DrawNode3D::init() _locMVPMatrix = _programStateLine->getUniformLocation("u_MVPMatrix"); - _customCommand.setBeforeCallback(CC_CALLBACK_0(DrawNode3D::onBeforeDraw, this)); - _customCommand.setAfterCallback(CC_CALLBACK_0(DrawNode3D::onAfterDraw, this)); + _customCommand.setBeforeCallback(AX_CALLBACK_0(DrawNode3D::onBeforeDraw, this)); + _customCommand.setAfterCallback(AX_CALLBACK_0(DrawNode3D::onAfterDraw, this)); auto layout = _programStateLine->getVertexLayout(); #define INITIAL_VERTEX_BUFFER_LENGTH 512 @@ -107,7 +107,7 @@ bool DrawNode3D::init() CustomCommand::BufferUsage::DYNAMIC); _isDirty = true; -#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_COME_TO_FOREGROUND, [this](EventCustom* event) { /** listen the event that coming to foreground on Android */ @@ -152,7 +152,7 @@ void DrawNode3D::updateCommand(axis::Renderer* renderer, const Mat4& transform, blend.sourceRGBBlendFactor = blend.sourceAlphaBlendFactor = _blendFunc.src; blend.destinationRGBBlendFactor = blend.destinationAlphaBlendFactor = _blendFunc.dst; - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _bufferLines.size()); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _bufferLines.size()); } void DrawNode3D::drawLine(const Vec3& from, const Vec3& to, const Color4F& color) diff --git a/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.h b/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.h index df9e7c5102..719f119f6c 100644 --- a/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.h +++ b/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.h @@ -105,7 +105,7 @@ protected: std::vector _bufferLines; private: - CC_DISALLOW_COPY_AND_ASSIGN(DrawNode3D); + AX_DISALLOW_COPY_AND_ASSIGN(DrawNode3D); bool _isDirty = true; bool _rendererDepthTestEnabled = true; diff --git a/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.cpp b/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.cpp index 435bb1104d..9e78bfad12 100644 --- a/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.cpp +++ b/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.cpp @@ -158,7 +158,7 @@ std::string MeshRendererEmptyTest::subtitle() const MeshRendererBasicTest::MeshRendererBasicTest() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererBasicTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererBasicTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -167,7 +167,7 @@ MeshRendererBasicTest::MeshRendererBasicTest() void MeshRendererBasicTest::addNewMeshWithCoords(Vec2 p) { - // int idx = (int)(CCRANDOM_0_1() * 1400.0f / 100.0f); + // int idx = (int)(AXRANDOM_0_1() * 1400.0f / 100.0f); // int x = (idx%5) * 85; // int y = (idx/5) * 121; @@ -188,7 +188,7 @@ void MeshRendererBasicTest::addNewMeshWithCoords(Vec2 p) mesh->setPosition(Vec2(p.x, p.y)); ActionInterval* action; - float random = CCRANDOM_0_1(); + float random = AXRANDOM_0_1(); if (random < 0.20) action = ScaleBy::create(3, 2); @@ -258,9 +258,9 @@ MeshRendererUVAnimationTest::MeshRendererUVAnimationTest() cylinder->setRotation3D(Vec3(-90.0f, 0.0f, 0.0f)); // the callback function update cylinder's texcoord - schedule(CC_SCHEDULE_SELECTOR(MeshRendererUVAnimationTest::cylinderUpdate)); + schedule(AX_SCHEDULE_SELECTOR(MeshRendererUVAnimationTest::cylinderUpdate)); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [=](EventCustom*) { auto mat = MeshMaterial::createWithFilename("MeshRendererTest/UVAnimation.material"); @@ -273,7 +273,7 @@ MeshRendererUVAnimationTest::MeshRendererUVAnimationTest() MeshRendererUVAnimationTest::~MeshRendererUVAnimationTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -324,9 +324,9 @@ MeshRendererFakeShadowTest::MeshRendererFakeShadowTest() Size visibleSize = Director::getInstance()->getVisibleSize(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto layer = Layer::create(); @@ -363,9 +363,9 @@ MeshRendererFakeShadowTest::MeshRendererFakeShadowTest() layer->addChild(_camera); layer->setCameraMask(2); - schedule(CC_SCHEDULE_SELECTOR(MeshRendererFakeShadowTest::updateCamera), 0.0f); + schedule(AX_SCHEDULE_SELECTOR(MeshRendererFakeShadowTest::updateCamera), 0.0f); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { auto mat = MeshMaterial::createWithFilename("MeshRendererTest/FakeShadow.material"); _state = mat->getTechniqueByIndex(0)->getPassByIndex(0)->getProgramState(); @@ -383,7 +383,7 @@ MeshRendererFakeShadowTest::MeshRendererFakeShadowTest() MeshRendererFakeShadowTest::~MeshRendererFakeShadowTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -564,7 +564,7 @@ MeshRendererBasicToonShaderTest::MeshRendererBasicToonShaderTest() addChild(teapot); addChild(_camera); setCameraMask(2); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [=](EventCustom*) { auto mat = MeshMaterial::createWithFilename("MeshRendererTest/BasicToon.material"); _state = mat->getTechniqueByIndex(0)->getPassByIndex(0)->getProgramState(); @@ -576,7 +576,7 @@ MeshRendererBasicToonShaderTest::MeshRendererBasicToonShaderTest() MeshRendererBasicToonShaderTest::~MeshRendererBasicToonShaderTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -620,7 +620,7 @@ MeshRendererLightMapTest::MeshRendererLightMapTest() // create a listener auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(MeshRendererLightMapTest::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(MeshRendererLightMapTest::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } MeshRendererLightMapTest::~MeshRendererLightMapTest() {} @@ -737,9 +737,9 @@ MeshRendererEffectTest::MeshRendererEffectTest() addNewMeshWithCoords(Vec2(s.width / 2, s.height / 2)); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererEffectTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererEffectTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { auto material = MeshMaterial::createWithFilename("MeshRendererTest/outline.material"); material->setTechnique("outline_noneskinned"); @@ -754,7 +754,7 @@ MeshRendererEffectTest::MeshRendererEffectTest() MeshRendererEffectTest::~MeshRendererEffectTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -784,7 +784,7 @@ void MeshRendererEffectTest::addNewMeshWithCoords(Vec2 p) mesh->setPosition(Vec2(p.x, p.y)); ActionInterval* action; - float random = CCRANDOM_0_1(); + float random = AXRANDOM_0_1(); if (random < 0.20) action = ScaleBy::create(3, 2); @@ -823,7 +823,7 @@ AsyncLoadMeshRendererTest::AsyncLoadMeshRendererTest() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "AsyncLoad MeshRenderer"); auto item1 = - MenuItemLabel::create(label1, CC_CALLBACK_1(AsyncLoadMeshRendererTest::menuCallback_asyncLoadMesh, this)); + MenuItemLabel::create(label1, AX_CALLBACK_1(AsyncLoadMeshRendererTest::menuCallback_asyncLoadMesh, this)); auto s = Director::getInstance()->getWinSize(); item1->setPosition(s.width * .5f, s.height * .8f); @@ -863,7 +863,7 @@ void AsyncLoadMeshRendererTest::menuCallback_asyncLoadMesh(Ref* sender) int32_t index = 0; for (const auto& path : _paths) { - MeshRenderer::createAsync(path, CC_CALLBACK_2(AsyncLoadMeshRendererTest::asyncLoad_Callback, this), (void*)index++); + MeshRenderer::createAsync(path, AX_CALLBACK_2(AsyncLoadMeshRendererTest::asyncLoad_Callback, this), (void*)index++); } } @@ -881,7 +881,7 @@ void AsyncLoadMeshRendererTest::asyncLoad_Callback(MeshRenderer* mesh, void* par MeshRendererWithSkinTest::MeshRendererWithSkinTest() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererWithSkinTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererWithSkinTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // switch animation quality. In fact, you can set the mesh3d out of frustum to Animate3DQuality::QUALITY_NONE, it @@ -890,7 +890,7 @@ MeshRendererWithSkinTest::MeshRendererWithSkinTest() MenuItemFont::setFontSize(15); _animateQuality = (int)Animate3DQuality::QUALITY_LOW; _menuItem = MenuItemFont::create(getAnimationQualityMessage(), - CC_CALLBACK_1(MeshRendererWithSkinTest::switchAnimationQualityCallback, this)); + AX_CALLBACK_1(MeshRendererWithSkinTest::switchAnimationQualityCallback, this)); _menuItem->setColor(Color3B(0, 200, 20)); auto menu = Menu::create(_menuItem, NULL); menu->setPosition(Vec2::ZERO); @@ -931,11 +931,11 @@ void MeshRendererWithSkinTest::addNewMeshWithCoords(Vec2 p) float speed = 1.0f; if (rand2 % 3 == 1) { - speed = animate->getSpeed() + CCRANDOM_0_1(); + speed = animate->getSpeed() + AXRANDOM_0_1(); } else if (rand2 % 3 == 2) { - speed = animate->getSpeed() - 0.5 * CCRANDOM_0_1(); + speed = animate->getSpeed() - 0.5 * AXRANDOM_0_1(); } animate->setSpeed(inverse ? -speed : speed); animate->setTag(110); @@ -987,13 +987,13 @@ void MeshRendererWithSkinTest::onTouchesEnded(const std::vector& touches MeshRendererWithSkinOutlineTest::MeshRendererWithSkinOutlineTest() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererWithSkinOutlineTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererWithSkinOutlineTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); addNewMeshWithCoords(Vec2(s.width / 2, s.height / 2)); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { auto material = MeshMaterial::createWithFilename("MeshRendererTest/outline.material"); material->setTechnique("outline_skinned"); @@ -1007,7 +1007,7 @@ MeshRendererWithSkinOutlineTest::MeshRendererWithSkinOutlineTest() } MeshRendererWithSkinOutlineTest::~MeshRendererWithSkinOutlineTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -1045,11 +1045,11 @@ void MeshRendererWithSkinOutlineTest::addNewMeshWithCoords(Vec2 p) float speed = 1.0f; if (rand2 % 3 == 1) { - speed = animate->getSpeed() + CCRANDOM_0_1(); + speed = animate->getSpeed() + AXRANDOM_0_1(); } else if (rand2 % 3 == 2) { - speed = animate->getSpeed() - 0.5 * CCRANDOM_0_1(); + speed = animate->getSpeed() - 0.5 * AXRANDOM_0_1(); } animate->setSpeed(inverse ? -speed : speed); @@ -1073,7 +1073,7 @@ Animate3DTest::Animate3DTest() addMeshRenderer(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(Animate3DTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(Animate3DTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); scheduleUpdate(); @@ -1081,9 +1081,9 @@ Animate3DTest::Animate3DTest() Animate3DTest::~Animate3DTest() { - CC_SAFE_RELEASE(_moveAction); - CC_SAFE_RELEASE(_hurt); - CC_SAFE_RELEASE(_swim); + AX_SAFE_RELEASE(_moveAction); + AX_SAFE_RELEASE(_hurt); + AX_SAFE_RELEASE(_swim); } std::string Animate3DTest::title() const @@ -1144,7 +1144,7 @@ void Animate3DTest::addMeshRenderer() _moveAction = MoveTo::create(4.f, Vec2(s.width / 5.f, s.height / 2.f)); _moveAction->retain(); auto seq = - Sequence::create(_moveAction, CallFunc::create(CC_CALLBACK_0(Animate3DTest::reachEndCallBack, this)), nullptr); + Sequence::create(_moveAction, CallFunc::create(AX_CALLBACK_0(Animate3DTest::reachEndCallBack, this)), nullptr); seq->setTag(100); mesh->runAction(seq); } @@ -1159,7 +1159,7 @@ void Animate3DTest::reachEndCallBack() _moveAction = inverse; auto rot = RotateBy::create(1.f, Vec3(0.f, 180.f, 0.f)); auto seq = Sequence::create(rot, _moveAction, - CallFunc::create(CC_CALLBACK_0(Animate3DTest::reachEndCallBack, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(Animate3DTest::reachEndCallBack, this)), nullptr); seq->setTag(100); _mesh->runAction(seq); } @@ -1192,7 +1192,7 @@ void Animate3DTest::onTouchesEnded(const std::vector& touches, Event* ev _mesh->runAction(_hurt); auto delay = DelayTime::create(_hurt->getDuration() - Animate3D::getTransitionTime()); auto seq = Sequence::create( - delay, CallFunc::create(CC_CALLBACK_0(Animate3DTest::renewCallBack, this)), nullptr); + delay, CallFunc::create(AX_CALLBACK_0(Animate3DTest::renewCallBack, this)), nullptr); seq->setTag(101); _mesh->runAction(seq); } @@ -1208,7 +1208,7 @@ AttachmentTest::AttachmentTest() : _hasWeapon(false), _mesh(nullptr) addNewMeshWithCoords(Vec2(s.width / 2, s.height / 2)); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(AttachmentTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(AttachmentTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } std::string AttachmentTest::title() const @@ -1264,19 +1264,19 @@ MeshRendererReskinTest::MeshRendererReskinTest() : _mesh(nullptr) addNewMeshWithCoords(Vec2(s.width / 2, s.height / 2)); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererReskinTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererReskinTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); TTFConfig ttfConfig("fonts/arial.ttf", 20); auto label1 = Label::createWithTTF(ttfConfig, "Hair"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); auto label2 = Label::createWithTTF(ttfConfig, "Glasses"); - auto item2 = MenuItemLabel::create(label2, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item2 = MenuItemLabel::create(label2, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); auto label3 = Label::createWithTTF(ttfConfig, "Coat"); - auto item3 = MenuItemLabel::create(label3, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item3 = MenuItemLabel::create(label3, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); auto label4 = Label::createWithTTF(ttfConfig, "Pants"); - auto item4 = MenuItemLabel::create(label4, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item4 = MenuItemLabel::create(label4, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); auto label5 = Label::createWithTTF(ttfConfig, "Shoes"); - auto item5 = MenuItemLabel::create(label5, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item5 = MenuItemLabel::create(label5, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); item1->setPosition(Vec2(VisibleRect::left().x + 50, VisibleRect::bottom().y + item1->getContentSize().height * 4)); item2->setPosition(Vec2(VisibleRect::left().x + 50, VisibleRect::bottom().y + item1->getContentSize().height * 5)); item3->setPosition(Vec2(VisibleRect::left().x + 50, VisibleRect::bottom().y + item1->getContentSize().height * 6)); @@ -1383,9 +1383,9 @@ void MeshRendererReskinTest::applyCurSkin() MeshRendererWithOBBPerformanceTest::MeshRendererWithOBBPerformanceTest() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesBegan, this); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesEnded, this); - listener->onTouchesMoved = CC_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesMoved, this); + listener->onTouchesBegan = AX_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesBegan, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesEnded, this); + listener->onTouchesMoved = AX_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); initDrawBox(); @@ -1393,9 +1393,9 @@ MeshRendererWithOBBPerformanceTest::MeshRendererWithOBBPerformanceTest() addNewMeshWithCoords(Vec2(s.width / 2, s.height / 2)); MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(65); - auto decrease = MenuItemFont::create(" - ", CC_CALLBACK_1(MeshRendererWithOBBPerformanceTest::delOBBCallback, this)); + auto decrease = MenuItemFont::create(" - ", AX_CALLBACK_1(MeshRendererWithOBBPerformanceTest::delOBBCallback, this)); decrease->setColor(Color3B(0, 200, 20)); - auto increase = MenuItemFont::create(" + ", CC_CALLBACK_1(MeshRendererWithOBBPerformanceTest::addOBBCallback, this)); + auto increase = MenuItemFont::create(" + ", AX_CALLBACK_1(MeshRendererWithOBBPerformanceTest::addOBBCallback, this)); increase->setColor(Color3B(0, 200, 20)); auto menu = Menu::create(decrease, increase, nullptr); @@ -1530,7 +1530,7 @@ void MeshRendererWithOBBPerformanceTest::addNewMeshWithCoords(Vec2 p) _moveAction = MoveTo::create(4.f, Vec2(s.width / 5.f, s.height / 2.f)); _moveAction->retain(); auto seq = Sequence::create( - _moveAction, CallFunc::create(CC_CALLBACK_0(MeshRendererWithOBBPerformanceTest::reachEndCallBack, this)), nullptr); + _moveAction, CallFunc::create(AX_CALLBACK_0(MeshRendererWithOBBPerformanceTest::reachEndCallBack, this)), nullptr); seq->setTag(100); mesh->runAction(seq); @@ -1548,7 +1548,7 @@ void MeshRendererWithOBBPerformanceTest::reachEndCallBack() _moveAction = inverse; auto rot = RotateBy::create(1.0f, Vec3(0.f, 180.f, 0.f)); auto seq = Sequence::create(rot, _moveAction, - CallFunc::create(CC_CALLBACK_0(MeshRendererWithOBBPerformanceTest::reachEndCallBack, this)), + CallFunc::create(AX_CALLBACK_0(MeshRendererWithOBBPerformanceTest::reachEndCallBack, this)), nullptr); seq->setTag(100); _mesh->runAction(seq); @@ -1563,8 +1563,8 @@ void MeshRendererWithOBBPerformanceTest::addOBBWithCount(float value) { for (int i = 0; i < value; i++) { - Vec2 randompos = Vec2(CCRANDOM_0_1() * Director::getInstance()->getWinSize().width, - CCRANDOM_0_1() * Director::getInstance()->getWinSize().height); + Vec2 randompos = Vec2(AXRANDOM_0_1() * Director::getInstance()->getWinSize().width, + AXRANDOM_0_1() * Director::getInstance()->getWinSize().height); Vec3 extents = Vec3(10, 10, 10); AABB aabb(-extents, extents); auto obb = OBB(aabb); @@ -1693,7 +1693,7 @@ void MeshRendererMirrorTest::addNewMeshWithCoords(Vec2 p) _mirrorMesh = mesh; } -QuaternionTest::QuaternionTest() : _arcSpeed(CC_DEGREES_TO_RADIANS(90)), _radius(100.f), _accAngle(0.f) +QuaternionTest::QuaternionTest() : _arcSpeed(AX_DEGREES_TO_RADIANS(90)), _radius(100.f), _accAngle(0.f) { auto s = Director::getInstance()->getWinSize(); addNewMeshWithCoords(Vec2(s.width / 2.f, s.height / 2.f)); @@ -1858,9 +1858,9 @@ void UseCaseMeshRenderer::switchCase() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Message"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UseCaseMeshRenderer::menuCallback_Message, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UseCaseMeshRenderer::menuCallback_Message, this)); auto label2 = Label::createWithTTF(ttfConfig, "Message"); - auto item2 = MenuItemLabel::create(label2, CC_CALLBACK_1(UseCaseMeshRenderer::menuCallback_Message, this)); + auto item2 = MenuItemLabel::create(label2, AX_CALLBACK_1(UseCaseMeshRenderer::menuCallback_Message, this)); item1->setPosition(Vec2(s.width * 0.5f - item1->getContentSize().width * 0.5f, s.height * 0.5f - item1->getContentSize().height)); @@ -1902,7 +1902,7 @@ void UseCaseMeshRenderer::update(float delta) if (_caseIdx == 0) { static float accAngle = 0.f; - accAngle += delta * CC_DEGREES_TO_RADIANS(60); + accAngle += delta * AX_DEGREES_TO_RADIANS(60); float radius = 30.f; float x = cosf(accAngle) * radius, z = sinf(accAngle) * radius; @@ -2021,7 +2021,7 @@ MeshRendererCubeMapTest::MeshRendererCubeMapTest() : _textureCube(nullptr), _sky MeshRendererCubeMapTest::~MeshRendererCubeMapTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif @@ -2048,7 +2048,7 @@ void MeshRendererCubeMapTest::addNewMeshWithCoords(Vec2 p) _camera->setCameraFlag(CameraFlag::USER1); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(MeshRendererCubeMapTest::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(MeshRendererCubeMapTest::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // create a teapot @@ -2097,9 +2097,9 @@ void MeshRendererCubeMapTest::addNewMeshWithCoords(Vec2 p) addChild(_camera); setCameraMask(2); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { - CC_SAFE_RELEASE(_textureCube); + AX_SAFE_RELEASE(_textureCube); _textureCube = TextureCube::create("MeshRendererTest/skybox/left.jpg", "MeshRendererTest/skybox/right.jpg", "MeshRendererTest/skybox/top.jpg", "MeshRendererTest/skybox/bottom.jpg", "MeshRendererTest/skybox/front.jpg", "MeshRendererTest/skybox/back.jpg"); @@ -2133,7 +2133,7 @@ void MeshRendererCubeMapTest::onTouchesMoved(const std::vector& touches, auto delta = touch->getDelta(); static float _angle = 0.f; - _angle -= CC_DEGREES_TO_RADIANS(delta.x); + _angle -= AX_DEGREES_TO_RADIANS(delta.x); _camera->setPosition3D(Vec3(50.0f * sinf(_angle), 0.0f, 50.0f * cosf(_angle))); _camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f)); } @@ -2153,7 +2153,7 @@ Issue9767::Issue9767() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "switch shader"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(Issue9767::menuCallback_SwitchShader, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(Issue9767::menuCallback_SwitchShader, this)); item1->setPosition( Vec2(s.width * 0.9f - item1->getContentSize().width * 0.5f, s.height * 0.5f - item1->getContentSize().height)); @@ -2167,7 +2167,7 @@ Issue9767::~Issue9767() {} void Issue9767::menuCallback_SwitchShader(axis::Ref* sender) { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); if (_shaderType == Issue9767::ShaderType::SHADER_TEX) { _shaderType = Issue9767::ShaderType::SHADER_COLOR; @@ -2310,7 +2310,7 @@ MeshRendererVertexColorTest::MeshRendererVertexColorTest() camera->lookAt(Vec3(0.f, 0.f, 0.f)); addChild(camera); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [=](EventCustom*) { auto mat = MeshMaterial::createWithFilename("MeshRendererTest/VertexColor.material"); mesh->setMaterial(mat); @@ -2321,7 +2321,7 @@ MeshRendererVertexColorTest::MeshRendererVertexColorTest() MeshRendererVertexColorTest::~MeshRendererVertexColorTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -2340,7 +2340,7 @@ CameraBackgroundClearTest::CameraBackgroundClearTest() { TTFConfig ttfConfig("fonts/arial.ttf", 20); auto label1 = Label::createWithTTF(ttfConfig, "Clear Mode"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(CameraBackgroundClearTest::switch_CameraClearMode, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(CameraBackgroundClearTest::switch_CameraClearMode, this)); item1->setPosition(Vec2(VisibleRect::left().x + 50, VisibleRect::bottom().y + item1->getContentSize().height * 4)); @@ -2371,7 +2371,7 @@ void CameraBackgroundClearTest::switch_CameraClearMode(axis::Ref* sender) CameraBackgroundBrush::BrushType type = CameraBackgroundBrush::BrushType::NONE; if (!brush) { - CCLOG("No brash found!"); + AXLOG("No brash found!"); } else { @@ -2383,7 +2383,7 @@ void CameraBackgroundClearTest::switch_CameraClearMode(axis::Ref* sender) _camera->setBackgroundBrush(CameraBackgroundBrush::createDepthBrush(1.f)); _label->setString("Depth Clear Brush"); // Test brush valid when set by user scene setting - CCLOG("Background brush valid status is : %s", _camera->isBrushValid() ? "true" : "false"); + AXLOG("Background brush valid status is : %s", _camera->isBrushValid() ? "true" : "false"); } else if (type == CameraBackgroundBrush::BrushType::DEPTH) { @@ -2473,7 +2473,7 @@ MeshRendererNormalMappingTest::MeshRendererNormalMappingTest() } int maxAttributes = Configuration::getInstance()->getMaxAttributes(); - CCASSERT(maxAttributes > 8, "attributes supported must be greater than 8"); + AXASSERT(maxAttributes > 8, "attributes supported must be greater than 8"); if (maxAttributes > 8) { auto mesh = MeshRenderer::create("MeshRendererTest/sphere_bumped.c3b"); @@ -2553,17 +2553,17 @@ MeshRendererPropertyTest::MeshRendererPropertyTest() setCameraMask(2); // auto listener = EventListenerTouchAllAtOnce::create(); - ////listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererReskinTest::onTouchesEnded, this); + ////listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererReskinTest::onTouchesEnded, this); //_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); TTFConfig ttfConfig("fonts/arial.ttf", 20); auto label1 = Label::createWithTTF(ttfConfig, "Print Mesh Name"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(MeshRendererPropertyTest::printMeshName, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(MeshRendererPropertyTest::printMeshName, this)); auto label2 = Label::createWithTTF(ttfConfig, "Remove Used Texture"); - auto item2 = MenuItemLabel::create(label2, CC_CALLBACK_1(MeshRendererPropertyTest::removeUsedTexture, this)); + auto item2 = MenuItemLabel::create(label2, AX_CALLBACK_1(MeshRendererPropertyTest::removeUsedTexture, this)); auto label3 = Label::createWithTTF(ttfConfig, "Reset"); - auto item3 = MenuItemLabel::create(label3, CC_CALLBACK_1(MeshRendererPropertyTest::resetTexture, this)); + auto item3 = MenuItemLabel::create(label3, AX_CALLBACK_1(MeshRendererPropertyTest::resetTexture, this)); item1->setPosition(Vec2(VisibleRect::left().x + 100, VisibleRect::bottom().y + item1->getContentSize().height * 4)); item2->setPosition(Vec2(VisibleRect::left().x + 100, VisibleRect::bottom().y + item1->getContentSize().height * 5)); @@ -2587,13 +2587,13 @@ std::string MeshRendererPropertyTest::subtitle() const void MeshRendererPropertyTest::update(float delta) {} void MeshRendererPropertyTest::printMeshName(axis::Ref* sender) { - CCLOG("MeshName Begin"); + AXLOG("MeshName Begin"); Vector meshes = _mesh->getMeshes(); for (Mesh* mesh : meshes) { log("MeshName: %s ", mesh->getName().data()); } - CCLOG("MeshName End"); + AXLOG("MeshName End"); } void MeshRendererPropertyTest::removeUsedTexture(axis::Ref* sender) { diff --git a/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h b/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h index f06cef6c74..5c0ccbb6ee 100644 --- a/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h +++ b/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h @@ -95,7 +95,7 @@ protected: float _shining_duration; axis::backend::ProgramState* _state = nullptr; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -132,7 +132,7 @@ private: axis::MeshRenderer* _orc; axis::backend::ProgramState* _state = nullptr; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -163,7 +163,7 @@ public: protected: axis::backend::ProgramState* _state; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -193,7 +193,7 @@ public: protected: std::vector _meshes; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -252,7 +252,7 @@ public: protected: std::vector _meshes; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -486,7 +486,7 @@ protected: axis::MeshRenderer* _teapot; axis::Camera* _camera; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -565,7 +565,7 @@ public: protected: axis::MeshRenderer* _mesh; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; diff --git a/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp b/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp index b3b2bb7df6..a1ba0ab326 100644 --- a/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp +++ b/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp @@ -68,7 +68,7 @@ void MotionStreakTest1::onEnter() _streak = MotionStreak::create(2, 3, 32, Color3B::GREEN, s_streak); addChild(_streak); // schedule an update on each frame so we can synchronize the streak with the target - schedule(CC_SCHEDULE_SELECTOR(MotionStreakTest1::onUpdate)); + schedule(AX_SCHEDULE_SELECTOR(MotionStreakTest1::onUpdate)); auto a1 = RotateBy::create(2, 360); @@ -106,7 +106,7 @@ void MotionStreakTest2::onEnter() MotionStreakTest::onEnter(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(MotionStreakTest2::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(MotionStreakTest2::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -155,7 +155,7 @@ void Issue1358::onEnter() _radius = size.width / 3; _angle = 0.0f; - schedule(CC_SCHEDULE_SELECTOR(Issue1358::update), 0); + schedule(AX_SCHEDULE_SELECTOR(Issue1358::update), 0); } void Issue1358::update(float dt) @@ -206,13 +206,13 @@ void Issue12226::onEnter() std::function updateMotionStreak = [=](float dt) { Vec2 position = - Vec2(outer->getPositionX() + length * cosf(-1 * CC_DEGREES_TO_RADIANS(outer->getRotation() + 90.0f)), - outer->getPositionY() + length * sinf(-1 * CC_DEGREES_TO_RADIANS(outer->getRotation() + 90.0f))); + Vec2(outer->getPositionX() + length * cosf(-1 * AX_DEGREES_TO_RADIANS(outer->getRotation() + 90.0f)), + outer->getPositionY() + length * sinf(-1 * AX_DEGREES_TO_RADIANS(outer->getRotation() + 90.0f))); _streak->setPosition(position); }; - outer->schedule(updateMotionStreak, 1 / 240.0f, CC_REPEAT_FOREVER, 0, "motion1scheduler"); + outer->schedule(updateMotionStreak, 1 / 240.0f, AX_REPEAT_FOREVER, 0, "motion1scheduler"); auto rot = RotateBy::create(2, 360); auto forever = RepeatForever::create(rot); @@ -255,7 +255,7 @@ void MotionStreakTest::onEnter() auto s = Director::getInstance()->getWinSize(); - auto itemMode = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MotionStreakTest::modeCallback, this), + auto itemMode = MenuItemToggle::createWithCallback(AX_CALLBACK_1(MotionStreakTest::modeCallback, this), MenuItemFont::create("Use High Quality Mode"), MenuItemFont::create("Use Fast Mode"), nullptr); diff --git a/tests/cpp-tests/Classes/MultiTouchTest/MultiTouchTest.cpp b/tests/cpp-tests/Classes/MultiTouchTest/MultiTouchTest.cpp index d08cae63bf..7cd9ed6f79 100644 --- a/tests/cpp-tests/Classes/MultiTouchTest/MultiTouchTest.cpp +++ b/tests/cpp-tests/Classes/MultiTouchTest/MultiTouchTest.cpp @@ -63,9 +63,9 @@ bool MultiTouchTest::init() if (TestCase::init()) { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(MultiTouchTest::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(MultiTouchTest::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(MultiTouchTest::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(MultiTouchTest::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(MultiTouchTest::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(MultiTouchTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto title = Label::createWithSystemFont("Please touch the screen!", "", 24); diff --git a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.cpp b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.cpp index 27651c7f13..26976152f6 100644 --- a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.cpp +++ b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.cpp @@ -40,7 +40,7 @@ struct AgentUserData NavMeshTests::NavMeshTests() { -#if (CC_USE_NAVMESH == 0) || (CC_USE_PHYSICS == 0) +#if (AX_USE_NAVMESH == 0) || (AX_USE_PHYSICS == 0) ADD_TEST_CASE(NavMeshDisabled); #else ADD_TEST_CASE(NavMeshBasicTestDemo); @@ -48,12 +48,12 @@ NavMeshTests::NavMeshTests() #endif }; -#if (CC_USE_NAVMESH == 0) || (CC_USE_PHYSICS == 0) +#if (AX_USE_NAVMESH == 0) || (AX_USE_PHYSICS == 0) void NavMeshDisabled::onEnter() { TTFConfig ttfConfig("fonts/arial.ttf", 16); auto label = - Label::createWithTTF(ttfConfig, "Should define CC_USE_NAVMESH & CC_USE_PHYSICS\n to run this test case"); + Label::createWithTTF(ttfConfig, "Should define AX_USE_NAVMESH & AX_USE_PHYSICS\n to run this test case"); auto size = Director::getInstance()->getWinSize(); label->setPosition(Vec2(size.width / 2, size.height / 2)); @@ -93,9 +93,9 @@ bool NavMeshBaseTestDemo::init() this->addChild(_camera); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(NavMeshBaseTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(NavMeshBaseTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(NavMeshBaseTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(NavMeshBaseTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(NavMeshBaseTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(NavMeshBaseTestDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); initScene(); @@ -118,7 +118,7 @@ void NavMeshBaseTestDemo::onTouchesMoved(const std::vector& touche auto touch = touches[0]; auto delta = touch->getDelta(); - _angle -= CC_DEGREES_TO_RADIANS(delta.x); + _angle -= AX_DEGREES_TO_RADIANS(delta.x); _camera->setPosition3D(Vec3(100.0f * sinf(_angle), 50.0f, 100.0f * cosf(_angle))); _camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f)); diff --git a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h index 83f138ee4d..5bcfcb28ae 100644 --- a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h +++ b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h @@ -32,7 +32,7 @@ DEFINE_TEST_SUITE(NavMeshTests); -#if (CC_USE_NAVMESH == 0) || (CC_USE_PHYSICS == 0) +#if (AX_USE_NAVMESH == 0) || (AX_USE_PHYSICS == 0) class NavMeshDisabled : public TestCase { public: diff --git a/tests/cpp-tests/Classes/NetworkTest/DownloaderTest/DownloaderTest.cpp b/tests/cpp-tests/Classes/NetworkTest/DownloaderTest/DownloaderTest.cpp index 794599a07d..32a5f8e236 100644 --- a/tests/cpp-tests/Classes/NetworkTest/DownloaderTest/DownloaderTest.cpp +++ b/tests/cpp-tests/Classes/NetworkTest/DownloaderTest/DownloaderTest.cpp @@ -249,7 +249,7 @@ struct DownloaderTest : public TestCase auto bar = (ui::LoadingBar*)view->getChildByTag(TAG_PROGRESS_BAR); bar->setVisible(false); } while (0); - CC_SAFE_RELEASE(texture); + AX_SAFE_RELEASE(texture); }; downloader->onFileTaskSuccess = [this](const axis::network::DownloadTask& task) { @@ -268,7 +268,7 @@ struct DownloaderTest : public TestCase MIN((viewSize.height - 20) / spriteSize.height, (viewSize.width - 20) / spriteSize.width); sprite->setScale(scale); view->addChild(sprite, 5, TAG_SPRITE); - CC_SAFE_RELEASE(texture); + AX_SAFE_RELEASE(texture); } else { diff --git a/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp b/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp index ded15ee714..a440cc0790 100644 --- a/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp +++ b/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp @@ -48,7 +48,7 @@ HttpClientTest::HttpClientTest() : _labelStatusCode(nullptr) auto cafile = FileUtils::getInstance()->fullPathForFilename("cacert.pem"); httpClient->setSSLVerification(cafile); httpClient->enableCookies(nullptr); - CCLOG("The http cookie will store to: %s", httpClient->getCookieFilename().data()); + AXLOG("The http cookie will store to: %s", httpClient->getCookieFilename().data()); const int MARGIN = 40; const int SPACE = 35; @@ -62,32 +62,32 @@ HttpClientTest::HttpClientTest() : _labelStatusCode(nullptr) // Get auto labelGet = Label::createWithTTF("Test Get", "fonts/arial.ttf", 22); - auto itemGet = MenuItemLabel::create(labelGet, CC_CALLBACK_1(HttpClientTest::onMenuGetTestClicked, this)); + auto itemGet = MenuItemLabel::create(labelGet, AX_CALLBACK_1(HttpClientTest::onMenuGetTestClicked, this)); itemGet->setPosition(LEFT, winSize.height - MARGIN - SPACE); menuRequest->addChild(itemGet); // Post auto labelPost = Label::createWithTTF("Test Post", "fonts/arial.ttf", 22); - auto itemPost = MenuItemLabel::create(labelPost, CC_CALLBACK_1(HttpClientTest::onMenuPostTestClicked, this)); + auto itemPost = MenuItemLabel::create(labelPost, AX_CALLBACK_1(HttpClientTest::onMenuPostTestClicked, this)); itemPost->setPosition(LEFT, winSize.height - MARGIN - 2 * SPACE); menuRequest->addChild(itemPost); // Post Binary auto labelPostBinary = Label::createWithTTF("Test Post Binary", "fonts/arial.ttf", 22); auto itemPostBinary = - MenuItemLabel::create(labelPostBinary, CC_CALLBACK_1(HttpClientTest::onMenuPostBinaryTestClicked, this)); + MenuItemLabel::create(labelPostBinary, AX_CALLBACK_1(HttpClientTest::onMenuPostBinaryTestClicked, this)); itemPostBinary->setPosition(LEFT, winSize.height - MARGIN - 3 * SPACE); menuRequest->addChild(itemPostBinary); // Put auto labelPut = Label::createWithTTF("Test Put", "fonts/arial.ttf", 22); - auto itemPut = MenuItemLabel::create(labelPut, CC_CALLBACK_1(HttpClientTest::onMenuPutTestClicked, this)); + auto itemPut = MenuItemLabel::create(labelPut, AX_CALLBACK_1(HttpClientTest::onMenuPutTestClicked, this)); itemPut->setPosition(LEFT, winSize.height - MARGIN - 4 * SPACE); menuRequest->addChild(itemPut); // Delete auto labelDelete = Label::createWithTTF("Test Delete", "fonts/arial.ttf", 22); - auto itemDelete = MenuItemLabel::create(labelDelete, CC_CALLBACK_1(HttpClientTest::onMenuDeleteTestClicked, this)); + auto itemDelete = MenuItemLabel::create(labelDelete, AX_CALLBACK_1(HttpClientTest::onMenuDeleteTestClicked, this)); itemDelete->setPosition(LEFT, winSize.height - MARGIN - 5 * SPACE); menuRequest->addChild(itemDelete); @@ -110,7 +110,7 @@ void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender) request->setUrl("https://tool.chinaz.com"); request->setRequestType(HttpRequest::Type::GET); request->setHeaders(std::vector{CHROME_UA}); - // request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + // request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("GET test1"); HttpResponse* response = HttpClient::getInstance()->sendSync(request); if (response) @@ -127,7 +127,7 @@ void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender) request->setUrl("https://just-make-this-request-failed.com"); request->setRequestType(HttpRequest::Type::GET); request->setHeaders(std::vector{CHROME_UA}); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("GET test2"); HttpClient::getInstance()->send(request); request->release(); @@ -140,7 +140,7 @@ void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender) request->setUrl("https://httpbin.org/ip"); request->setRequestType(HttpRequest::Type::GET); request->setHeaders(std::vector{CHROME_UA}); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("GET test3"); HttpClient::getInstance()->send(request); // don't forget to release it, pair to new @@ -153,7 +153,7 @@ void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender) request->setUrl("https://httpbin.org/get"); request->setRequestType(HttpRequest::Type::GET); request->setHeaders(std::vector{CHROME_UA}); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("GET test4"); HttpClient::getInstance()->send(request); request->release(); @@ -165,7 +165,7 @@ void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender) request->setUrl("https://github.com/yasio/yasio"); request->setRequestType(HttpRequest::Type::GET); request->setHeaders(std::vector{CHROME_UA}); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("GET test5"); HttpClient::getInstance()->send(request); request->release(); @@ -183,7 +183,7 @@ void HttpClientTest::onMenuPostTestClicked(axis::Ref* sender) request->setUrl("https://httpbin.org/post"); request->setRequestType(HttpRequest::Type::POST); request->setHeaders(std::vector{CHROME_UA}); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); // write the post data const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest"; @@ -199,7 +199,7 @@ void HttpClientTest::onMenuPostTestClicked(axis::Ref* sender) request->setUrl("https://httpbin.org/post"); request->setRequestType(HttpRequest::Type::POST); request->setHeaders(std::vector{CHROME_UA, "Content-Type: application/json; charset=utf-8"}); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); // write the post data const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest"; @@ -218,7 +218,7 @@ void HttpClientTest::onMenuPostBinaryTestClicked(axis::Ref* sender) HttpRequest* request = new HttpRequest(); request->setUrl("https://httpbin.org/post"); request->setRequestType(HttpRequest::Type::POST); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); // write the post data char postData[22] = "binary=hello\0\0cocos2d"; // including \0, the strings after \0 should not be cut in response @@ -238,7 +238,7 @@ void HttpClientTest::onMenuPutTestClicked(Ref* sender) HttpRequest* request = new HttpRequest(); request->setUrl("https://httpbin.org/put"); request->setRequestType(HttpRequest::Type::PUT); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); // write the post data const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest"; @@ -256,7 +256,7 @@ void HttpClientTest::onMenuPutTestClicked(Ref* sender) std::vector headers; headers.push_back("Content-Type: application/json; charset=utf-8"); request->setHeaders(headers); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); // write the post data const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest"; @@ -277,7 +277,7 @@ void HttpClientTest::onMenuDeleteTestClicked(Ref* sender) HttpRequest* request = new HttpRequest(); request->setUrl("https://just-make-this-request-failed.com"); request->setRequestType(HttpRequest::Type::DELETE); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("DELETE test1"); HttpClient::getInstance()->send(request); request->release(); @@ -288,7 +288,7 @@ void HttpClientTest::onMenuDeleteTestClicked(Ref* sender) HttpRequest* request = new HttpRequest(); request->setUrl("https://httpbin.org/delete"); request->setRequestType(HttpRequest::Type::DELETE); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("DELETE test2"); HttpClient::getInstance()->send(request); request->release(); @@ -351,14 +351,14 @@ HttpClientClearRequestsTest::HttpClientClearRequestsTest() : _labelStatusCode(nu // Get auto labelGet = Label::createWithTTF("Test Clear all Get", "fonts/arial.ttf", 22); auto itemGet = - MenuItemLabel::create(labelGet, CC_CALLBACK_1(HttpClientClearRequestsTest::onMenuCancelAllClicked, this)); + MenuItemLabel::create(labelGet, AX_CALLBACK_1(HttpClientClearRequestsTest::onMenuCancelAllClicked, this)); itemGet->setPosition(CENTER, winSize.height - MARGIN - SPACE); menuRequest->addChild(itemGet); // Post auto labelPost = Label::createWithTTF("Test Clear but only with the tag DELETE", "fonts/arial.ttf", 22); auto itemPost = - MenuItemLabel::create(labelPost, CC_CALLBACK_1(HttpClientClearRequestsTest::onMenuCancelSomeClicked, this)); + MenuItemLabel::create(labelPost, AX_CALLBACK_1(HttpClientClearRequestsTest::onMenuCancelSomeClicked, this)); itemPost->setPosition(CENTER, winSize.height - MARGIN - 2 * SPACE); menuRequest->addChild(itemPost); @@ -390,7 +390,7 @@ void HttpClientClearRequestsTest::onMenuCancelAllClicked(axis::Ref* sender) url << "https://cocos2d-x.org/images/logo.png?id=" << std::to_string(i); request->setUrl(url.str()); request->setRequestType(HttpRequest::Type::GET); - request->setResponseCallback(CC_CALLBACK_2(HttpClientClearRequestsTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientClearRequestsTest::onHttpRequestCompleted, this)); url.str(""); url << "TEST_" << std::to_string(i); @@ -419,7 +419,7 @@ void HttpClientClearRequestsTest::onMenuCancelSomeClicked(axis::Ref* sender) url << "https://cocos2d-x.org/images/logo.png?id=" << std::to_string(i); request->setUrl(url.str()); request->setRequestType(HttpRequest::Type::GET); - request->setResponseCallback(CC_CALLBACK_2(HttpClientClearRequestsTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientClearRequestsTest::onHttpRequestCompleted, this)); url.str(""); if (i < 5) diff --git a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp index dab995f0e4..788048588a 100644 --- a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp +++ b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp @@ -103,9 +103,9 @@ private: auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - listener->onTouchBegan = CC_CALLBACK_2(TextButton::onTouchBegan, this); - listener->onTouchEnded = CC_CALLBACK_2(TextButton::onTouchEnded, this); - listener->onTouchCancelled = CC_CALLBACK_2(TextButton::onTouchCancelled, this); + listener->onTouchBegan = AX_CALLBACK_2(TextButton::onTouchBegan, this); + listener->onTouchEnded = AX_CALLBACK_2(TextButton::onTouchEnded, this); + listener->onTouchCancelled = AX_CALLBACK_2(TextButton::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -176,7 +176,7 @@ public: return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -374,7 +374,7 @@ bool AudioControlTest::init() timeLabel->setPosition(timeSliderPos.x - sliderSize.width / 2, timeSliderPos.y); addChild(timeLabel); - this->schedule(CC_CALLBACK_1(AudioControlTest::update, this), 0.1f, "update_key"); + this->schedule(AX_CALLBACK_1(AudioControlTest::update, this), 0.1f, "update_key"); return ret; } @@ -422,7 +422,7 @@ bool AudioLoadTest::init() AudioEngine::preload("audio/SoundEffectsFX009/FX082.mp3", [isDestroyed, stateLabel](bool isSuccess) { if (*isDestroyed) { - CCLOG("AudioLoadTest scene was destroyed, no need to set the label text."); + AXLOG("AudioLoadTest scene was destroyed, no need to set the label text."); return; } @@ -583,7 +583,7 @@ bool AudioProfileTest::init() char text[30]; _files[0] = "background.mp3"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC _files[1] = "background.caf"; #else _files[1] = "background.ogg"; @@ -648,7 +648,7 @@ bool AudioProfileTest::init() addChild(timeSlider); _timeSlider = timeSlider; - this->schedule(CC_CALLBACK_1(AudioProfileTest::update, this), 0.05f, "update_key"); + this->schedule(AX_CALLBACK_1(AudioProfileTest::update, this), 0.05f, "update_key"); return ret; } @@ -680,9 +680,9 @@ bool InvalidAudioFileTest::init() auto ret = AudioEngineTestDemo::init(); auto playItem = TextButton::create("play unsupported media type", [&](TextButton* button) { -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC AudioEngine::play2d("background.ogg"); -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 AudioEngine::play2d("background.caf"); #endif }); @@ -738,7 +738,7 @@ bool AudioIssue18597Test::init() // test case for https://github.com/cocos2d/cocos2d-x/issues/18597 this->schedule( [=](float dt) { - CCLOG("issues 18597 audio crash test"); + AXLOG("issues 18597 audio crash test"); for (int i = 0; i < 2; ++i) { auto id = AudioEngine::play2d("audio/MUS_BGM_Battle_Round1_v1.caf", true, 1.0f); @@ -819,54 +819,54 @@ std::string AudioIssue11143Test::subtitle() const } // Enable profiles for this file -#undef CC_PROFILER_DISPLAY_TIMERS -#define CC_PROFILER_DISPLAY_TIMERS() Profiler::getInstance()->displayTimers() -#undef CC_PROFILER_PURGE_ALL -#define CC_PROFILER_PURGE_ALL() Profiler::getInstance()->releaseAllTimers() +#undef AX_PROFILER_DISPLAY_TIMERS +#define AX_PROFILER_DISPLAY_TIMERS() Profiler::getInstance()->displayTimers() +#undef AX_PROFILER_PURGE_ALL +#define AX_PROFILER_PURGE_ALL() Profiler::getInstance()->releaseAllTimers() -#undef CC_PROFILER_START -#define CC_PROFILER_START(__name__) ProfilingBeginTimingBlock(__name__) -#undef CC_PROFILER_STOP -#define CC_PROFILER_STOP(__name__) ProfilingEndTimingBlock(__name__) -#undef CC_PROFILER_RESET -#define CC_PROFILER_RESET(__name__) ProfilingResetTimingBlock(__name__) +#undef AX_PROFILER_START +#define AX_PROFILER_START(__name__) ProfilingBeginTimingBlock(__name__) +#undef AX_PROFILER_STOP +#define AX_PROFILER_STOP(__name__) ProfilingEndTimingBlock(__name__) +#undef AX_PROFILER_RESET +#define AX_PROFILER_RESET(__name__) ProfilingResetTimingBlock(__name__) -#undef CC_PROFILER_START_CATEGORY -#define CC_PROFILER_START_CATEGORY(__cat__, __name__) \ +#undef AX_PROFILER_START_CATEGORY +#define AX_PROFILER_START_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ ProfilingBeginTimingBlock(__name__); \ } while (0) -#undef CC_PROFILER_STOP_CATEGORY -#define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) \ +#undef AX_PROFILER_STOP_CATEGORY +#define AX_PROFILER_STOP_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ ProfilingEndTimingBlock(__name__); \ } while (0) -#undef CC_PROFILER_RESET_CATEGORY -#define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) \ +#undef AX_PROFILER_RESET_CATEGORY +#define AX_PROFILER_RESET_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ ProfilingResetTimingBlock(__name__); \ } while (0) -#undef CC_PROFILER_START_INSTANCE -#define CC_PROFILER_START_INSTANCE(__id__, __name__) \ +#undef AX_PROFILER_START_INSTANCE +#define AX_PROFILER_START_INSTANCE(__id__, __name__) \ do \ { \ ProfilingBeginTimingBlock(String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ } while (0) -#undef CC_PROFILER_STOP_INSTANCE -#define CC_PROFILER_STOP_INSTANCE(__id__, __name__) \ +#undef AX_PROFILER_STOP_INSTANCE +#define AX_PROFILER_STOP_INSTANCE(__id__, __name__) \ do \ { \ ProfilingEndTimingBlock(String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ } while (0) -#undef CC_PROFILER_RESET_INSTANCE -#define CC_PROFILER_RESET_INSTANCE(__id__, __name__) \ +#undef AX_PROFILER_RESET_INSTANCE +#define AX_PROFILER_RESET_INSTANCE(__id__, __name__) \ do \ { \ ProfilingResetTimingBlock(String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ @@ -898,9 +898,9 @@ bool AudioPerformanceTest::init() schedule( [audioFiles](float dt) { int index = axis::random(0, (int)(audioFiles.size() - 1)); - CC_PROFILER_START("play2d"); + AX_PROFILER_START("play2d"); AudioEngine::play2d(audioFiles[index]); - CC_PROFILER_STOP("play2d"); + AX_PROFILER_STOP("play2d"); }, 0.25f, "test"); }); @@ -911,7 +911,7 @@ bool AudioPerformanceTest::init() auto displayItem = TextButton::create("Display Result", [this, playItem](TextButton* button) { unschedule("test"); AudioEngine::stopAll(); - CC_PROFILER_DISPLAY_TIMERS(); + AX_PROFILER_DISPLAY_TIMERS(); playItem->setEnabled(true); button->setEnabled(false); }); diff --git a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp index 6ac70b1a2a..be2c103215 100644 --- a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -71,9 +71,9 @@ namespace { auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - listener->onTouchBegan = CC_CALLBACK_2(TextButton::onTouchBegan, this); - listener->onTouchEnded = CC_CALLBACK_2(TextButton::onTouchEnded, this); - listener->onTouchCancelled = CC_CALLBACK_2(TextButton::onTouchCancelled, this); + listener->onTouchBegan = AX_CALLBACK_2(TextButton::onTouchBegan, this); + listener->onTouchEnded = AX_CALLBACK_2(TextButton::onTouchEnded, this); + listener->onTouchCancelled = AX_CALLBACK_2(TextButton::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -266,7 +266,7 @@ public: } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -483,7 +483,7 @@ void CustomEventTest::onEnter() EventCustom event("game_custom_event1"); event.setUserData(buf); _eventDispatcher->dispatchEvent(&event); - CC_SAFE_DELETE_ARRAY(buf); + AX_SAFE_DELETE_ARRAY(buf); }); sendItem->setPosition(origin + Vec2(size.width / 2, size.height / 2)); @@ -509,7 +509,7 @@ void CustomEventTest::onEnter() EventCustom event("game_custom_event2"); event.setUserData(buf); _eventDispatcher->dispatchEvent(&event); - CC_SAFE_DELETE_ARRAY(buf); + AX_SAFE_DELETE_ARRAY(buf); }); sendItem2->setPosition(origin + Vec2(size.width / 2, size.height / 2 - 40)); @@ -544,7 +544,7 @@ void LabelKeyboardEventTest::onEnter() Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC auto statusLabel = Label::createWithSystemFont("No keyboard event received!", "", 20); statusLabel->setPosition(origin + Vec2(size.width / 2, size.height / 2)); addChild(statusLabel); @@ -632,7 +632,7 @@ std::string LabelKeyboardEventTest::title() const std::string LabelKeyboardEventTest::subtitle() const { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC return "Press keys 1 through 9 to change the stats anchor on the screen."; #else return "Change the stats anchor [1-9]"; @@ -782,7 +782,7 @@ void RemoveListenerAfterAddingTest::onEnter() auto item1 = MenuItemFont::create("Click Me 1", [this](Ref* sender) { auto listener = EventListenerTouchOneByOne::create(); listener->onTouchBegan = [](Touch* touch, Event* event) -> bool { - CCASSERT(false, "Should not come here!"); + AXASSERT(false, "Should not come here!"); return true; }; @@ -806,7 +806,7 @@ void RemoveListenerAfterAddingTest::onEnter() auto item2 = MenuItemFont::create("Click Me 2", [=](Ref* sender) { auto listener = EventListenerTouchOneByOne::create(); listener->onTouchBegan = [](Touch* touch, Event* event) -> bool { - CCASSERT(false, "Should not come here!"); + AXASSERT(false, "Should not come here!"); return true; }; @@ -821,7 +821,7 @@ void RemoveListenerAfterAddingTest::onEnter() auto item3 = MenuItemFont::create("Click Me 3", [=](Ref* sender) { auto listener = EventListenerTouchOneByOne::create(); listener->onTouchBegan = [](Touch* touch, Event* event) -> bool { - CCASSERT(false, "Should not come here!"); + AXASSERT(false, "Should not come here!"); return true; }; @@ -1066,7 +1066,7 @@ StopPropagationTest::StopPropagationTest() return false; auto target = static_cast(event->getCurrentTarget()); - CCASSERT(target->getTag() == TAG_BLUE_SPRITE, "Yellow blocks shouldn't response event."); + AXASSERT(target->getTag() == TAG_BLUE_SPRITE, "Yellow blocks shouldn't response event."); if (this->isPointInNode(touch->getLocation(), target)) { @@ -1091,7 +1091,7 @@ StopPropagationTest::StopPropagationTest() return; auto target = static_cast(event->getCurrentTarget()); - CCASSERT(target->getTag() == TAG_BLUE_SPRITE2, "Yellow blocks shouldn't response event."); + AXASSERT(target->getTag() == TAG_BLUE_SPRITE2, "Yellow blocks shouldn't response event."); if (this->isPointInNode(touches[0]->getLocation(), target)) { @@ -1107,7 +1107,7 @@ StopPropagationTest::StopPropagationTest() return; auto target = static_cast(event->getCurrentTarget()); - CCASSERT(target->getTag() == TAG_BLUE_SPRITE2, "Yellow blocks shouldn't response event."); + AXASSERT(target->getTag() == TAG_BLUE_SPRITE2, "Yellow blocks shouldn't response event."); if (this->isPointInNode(touches[0]->getLocation(), target)) { @@ -1120,8 +1120,8 @@ StopPropagationTest::StopPropagationTest() auto keyboardEventListener = EventListenerKeyboard::create(); keyboardEventListener->onKeyPressed = [](EventKeyboard::KeyCode /*key*/, Event* event) { auto target = static_cast(event->getCurrentTarget()); - CC_UNUSED_PARAM(target); - CCASSERT(target->getTag() == TAG_BLUE_SPRITE || target->getTag() == TAG_BLUE_SPRITE2, + AX_UNUSED_PARAM(target); + AXASSERT(target->getTag() == TAG_BLUE_SPRITE || target->getTag() == TAG_BLUE_SPRITE2, "Yellow blocks shouldn't response event."); // Stop propagation, so yellow blocks will not be able to receive event. event->stopPropagation(); @@ -1434,7 +1434,7 @@ Issue4129::Issue4129() : _bugFixed(false) _eventDispatcher->removeAllEventListeners(); auto nextItem = MenuItemFont::create("Reset", [=](Ref* sender) { - CCASSERT(_bugFixed, "This issue was not fixed!"); + AXASSERT(_bugFixed, "This issue was not fixed!"); getTestSuite()->restartCurrTest(); }); @@ -1528,7 +1528,7 @@ public: return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -1571,20 +1571,20 @@ private: DanglingNodePointersTest::DanglingNodePointersTest() { -#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1 && COCOS2D_DEBUG > 0 +#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1 && COCOS2D_DEBUG > 0 Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); auto callback2 = [](DanglingNodePointersTestSprite* sprite2) { - CCASSERT(false, "This should never be called because the sprite gets removed from it's parent and destroyed!"); + AXASSERT(false, "This should never be called because the sprite gets removed from it's parent and destroyed!"); exit(1); }; auto callback1 = [callback2, origin, size](DanglingNodePointersTestSprite* sprite1) { DanglingNodePointersTestSprite* sprite2 = dynamic_cast(sprite1->getChildren().at(0)); - CCASSERT(sprite2, "The first child of sprite 1 should be sprite 2!"); - CCASSERT( + AXASSERT(sprite2, "The first child of sprite 1 should be sprite 2!"); + AXASSERT( sprite2->getReferenceCount() == 1, "There should only be 1 reference to sprite 1, from it's parent node. Hence removing it will destroy it!"); sprite1->removeAllChildren(); // This call should cause sprite 2 to be destroyed @@ -1619,11 +1619,11 @@ std::string DanglingNodePointersTest::title() const std::string DanglingNodePointersTest::subtitle() const { -#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1 && COCOS2D_DEBUG > 0 +#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1 && COCOS2D_DEBUG > 0 return "Tap the square - should not crash!"; #else return "For test to work, must be compiled with:\n" - "CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1\n&& COCOS2D_DEBUG > 0"; + "AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1\n&& COCOS2D_DEBUG > 0"; #endif } @@ -1634,7 +1634,7 @@ RegisterAndUnregisterWhileEventHanldingTest::RegisterAndUnregisterWhileEventHanl auto callback1 = [=](DanglingNodePointersTestSprite* sprite) { auto callback2 = [](DanglingNodePointersTestSprite* sprite) { - CCASSERT(false, "This should never get called!"); + AXASSERT(false, "This should never get called!"); }; { @@ -1668,8 +1668,8 @@ std::string RegisterAndUnregisterWhileEventHanldingTest::subtitle() const // WindowEventsTest::WindowEventsTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) auto dispatcher = Director::getInstance()->getEventDispatcher(); dispatcher->addCustomEventListener(GLViewImpl::EVENT_WINDOW_RESIZED, [](EventCustom* event) { // TODO: need to create resizeable window @@ -1689,8 +1689,8 @@ std::string WindowEventsTest::title() const std::string WindowEventsTest::subtitle() const { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) return "Resize and Switch to another window and back. Read Logs."; #else return "Unsupported platform."; @@ -1710,7 +1710,7 @@ Issue8194::Issue8194() getEventDispatcher()->addCustomEventListener(Director::EVENT_AFTER_UPDATE, [this](axis::EventCustom* event) { if (nodesAdded) { - // CCLOG("Fire Issue8194 Event"); + // AXLOG("Fire Issue8194 Event"); getEventDispatcher()->dispatchCustomEvent("Issue8194"); // clear test nodes and listeners diff --git a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp index 267e582363..8c285606f7 100644 --- a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp +++ b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp @@ -110,7 +110,7 @@ std::string MultiSceneTest::subtitle() const NewSpriteTest::NewSpriteTest() { auto touchListener = EventListenerTouchAllAtOnce::create(); - touchListener->onTouchesEnded = CC_CALLBACK_2(NewSpriteTest::onTouchesEnded, this); + touchListener->onTouchesEnded = AX_CALLBACK_2(NewSpriteTest::onTouchesEnded, this); createSpriteTest(); createNewSpriteTest(); @@ -213,7 +213,7 @@ SpriteInGroupCommand* SpriteInGroupCommand::create(std::string_view filename) void SpriteInGroupCommand::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) { - CCASSERT(renderer, "Render is null"); + AXASSERT(renderer, "Render is null"); _spriteWrapperCommand.init(_globalZOrder); renderer->addCommand(&_spriteWrapperCommand); renderer->pushGroup(_spriteWrapperCommand.getRenderQueueID()); @@ -281,9 +281,9 @@ NewClippingNodeTest::NewClippingNodeTest() _scrolling = false; auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(NewClippingNodeTest::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(NewClippingNodeTest::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(NewClippingNodeTest::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(NewClippingNodeTest::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(NewClippingNodeTest::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(NewClippingNodeTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -382,8 +382,8 @@ NewCullingTest::NewCullingTest() auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - listener->onTouchBegan = CC_CALLBACK_2(NewCullingTest::onTouchBegan, this); - listener->onTouchMoved = CC_CALLBACK_2(NewCullingTest::onTouchMoved, this); + listener->onTouchBegan = AX_CALLBACK_2(NewCullingTest::onTouchBegan, this); + listener->onTouchMoved = AX_CALLBACK_2(NewCullingTest::onTouchMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -436,9 +436,9 @@ SpriteCreation::SpriteCreation() MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(65); - auto decrease = MenuItemFont::create(" - ", CC_CALLBACK_1(SpriteCreation::delSpritesCallback, this)); + auto decrease = MenuItemFont::create(" - ", AX_CALLBACK_1(SpriteCreation::delSpritesCallback, this)); decrease->setColor(Color3B(0, 200, 20)); - auto increase = MenuItemFont::create(" + ", CC_CALLBACK_1(SpriteCreation::addSpritesCallback, this)); + auto increase = MenuItemFont::create(" + ", AX_CALLBACK_1(SpriteCreation::addSpritesCallback, this)); increase->setColor(Color3B(0, 200, 20)); auto menu = Menu::create(decrease, increase, nullptr); @@ -630,7 +630,7 @@ CaptureScreenTest::CaptureScreenTest() sp2->runAction(seq2); auto label1 = Label::createWithTTF(TTFConfig("fonts/arial.ttf"), "capture all"); - auto mi1 = MenuItemLabel::create(label1, CC_CALLBACK_1(CaptureScreenTest::onCaptured, this)); + auto mi1 = MenuItemLabel::create(label1, AX_CALLBACK_1(CaptureScreenTest::onCaptured, this)); auto menu = Menu::create(mi1, nullptr); addChild(menu); menu->setPosition(s.width / 2, s.height / 4); @@ -660,7 +660,7 @@ void CaptureScreenTest::onCaptured(Ref*) _filename = "CaptureScreenTest.png"; // retain it to avoid crash caused by invoking afterCaptured this->retain(); - utils::captureScreen(CC_CALLBACK_2(CaptureScreenTest::afterCaptured, this), _filename); + utils::captureScreen(AX_CALLBACK_2(CaptureScreenTest::afterCaptured, this), _filename); } void CaptureScreenTest::afterCaptured(bool succeed, std::string_view outputFile) @@ -703,7 +703,7 @@ CaptureNodeTest::CaptureNodeTest() sp2->runAction(seq2); auto label1 = Label::createWithTTF(TTFConfig("fonts/arial.ttf"), "capture this scene"); - auto mi1 = MenuItemLabel::create(label1, CC_CALLBACK_1(CaptureNodeTest::onCaptured, this)); + auto mi1 = MenuItemLabel::create(label1, AX_CALLBACK_1(CaptureNodeTest::onCaptured, this)); auto menu = Menu::create(mi1, nullptr); addChild(menu); menu->setPosition(s.width / 2, s.height / 4); @@ -792,8 +792,8 @@ RendererBatchQuadTri::RendererBatchQuadTri() for (int i = 0; i < 250; i++) { - int x = CCRANDOM_0_1() * s.width; - int y = CCRANDOM_0_1() * s.height; + int x = AXRANDOM_0_1() * s.width; + int y = AXRANDOM_0_1() * s.height; auto label = LabelAtlas::create("This is a label", "fonts/tuffy_bold_italic-charmap.plist"); label->setColor(Color3B::RED); @@ -919,7 +919,7 @@ RendererUniformBatch2::RendererUniformBatch2() sprite->setScale(0.4); addChild(sprite); - auto r = CCRANDOM_0_1(); + auto r = AXRANDOM_0_1(); if (r < 0.33) sprite->setProgramState(sepiaState); else if (r < 0.66) diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp index 418989ae23..e6a3480f41 100644 --- a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp +++ b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp @@ -147,8 +147,8 @@ NodeTest4::NodeTest4() addChild(sp1, 0, 2); addChild(sp2, 0, 3); - schedule(CC_CALLBACK_1(NodeTest4::delay2, this), 2.0f, "delay2_key"); - schedule(CC_CALLBACK_1(NodeTest4::delay4, this), 4.0f, "delay4_key"); + schedule(AX_CALLBACK_1(NodeTest4::delay2, this), 2.0f, "delay2_key"); + schedule(AX_CALLBACK_1(NodeTest4::delay4, this), 4.0f, "delay4_key"); } void NodeTest4::delay2(float dt) @@ -195,7 +195,7 @@ NodeTest5::NodeTest5() sp1->runAction(forever); sp2->runAction(forever2); - schedule(CC_CALLBACK_1(NodeTest5::addAndRemove, this), 2.0f, "add_and_remove_key"); + schedule(AX_CALLBACK_1(NodeTest5::addAndRemove, this), 2.0f, "add_and_remove_key"); } void NodeTest5::addAndRemove(float dt) @@ -255,7 +255,7 @@ NodeTest6::NodeTest6() sp2->runAction(forever2); sp21->runAction(forever21); - schedule(CC_CALLBACK_1(NodeTest6::addAndRemove, this), 2.0f, "add_and_remove_key"); + schedule(AX_CALLBACK_1(NodeTest6::addAndRemove, this), 2.0f, "add_and_remove_key"); } void NodeTest6::addAndRemove(float dt) @@ -295,7 +295,7 @@ StressTest1::StressTest1() sp1->setPosition(Vec2(s.width / 2, s.height / 2)); - schedule(CC_CALLBACK_1(StressTest1::shouldNotCrash, this), 1.0f, "should_not_crash_key"); + schedule(AX_CALLBACK_1(StressTest1::shouldNotCrash, this), 1.0f, "should_not_crash_key"); } void StressTest1::shouldNotCrash(float dt) @@ -313,7 +313,7 @@ void StressTest1::shouldNotCrash(float dt) explosion->setPosition(Vec2(s.width / 2, s.height / 2)); - runAction(Sequence::create(RotateBy::create(2, 360), CallFuncN::create(CC_CALLBACK_1(StressTest1::removeMe, this)), + runAction(Sequence::create(RotateBy::create(2, 360), CallFuncN::create(AX_CALLBACK_1(StressTest1::removeMe, this)), nullptr)); addChild(explosion); @@ -360,7 +360,7 @@ StressTest2::StressTest2() fire->runAction(RepeatForever::create(copy_seq3)); sublayer->addChild(fire, 2); - schedule(CC_CALLBACK_1(StressTest2::shouldNotLeak, this), 6.0f, "should_not_leak_key"); + schedule(AX_CALLBACK_1(StressTest2::shouldNotLeak, this), 6.0f, "should_not_leak_key"); addChild(sublayer, 0, kTagSprite1); } @@ -385,17 +385,17 @@ std::string StressTest2::subtitle() const SchedulerTest1::SchedulerTest1() { auto layer = Layer::create(); - // CCLOG("retain count after init is %d", layer->getReferenceCount()); // 1 + // AXLOG("retain count after init is %d", layer->getReferenceCount()); // 1 addChild(layer, 0); - // CCLOG("retain count after addChild is %d", layer->getReferenceCount()); // 2 + // AXLOG("retain count after addChild is %d", layer->getReferenceCount()); // 2 - layer->schedule(CC_CALLBACK_1(SchedulerTest1::doSomething, this), "do_something_key"); - // CCLOG("retain count after schedule is %d", layer->getReferenceCount()); // 3 : (objective-c version), but + layer->schedule(AX_CALLBACK_1(SchedulerTest1::doSomething, this), "do_something_key"); + // AXLOG("retain count after schedule is %d", layer->getReferenceCount()); // 3 : (objective-c version), but // win32 version is still 2, because Timer class don't save target. layer->unschedule("do_something_key"); - // CCLOG("retain count after unschedule is %d", layer->getReferenceCount()); // STILL 3! (win32 is '2') + // AXLOG("retain count after unschedule is %d", layer->getReferenceCount()); // STILL 3! (win32 is '2') } void SchedulerTest1::doSomething(float dt) {} @@ -763,7 +763,7 @@ std::string CameraCenterTest::subtitle() const ConvertToNode::ConvertToNode() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(ConvertToNode::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(ConvertToNode::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -814,7 +814,7 @@ void ConvertToNode::onTouchesEnded(const std::vector& touches, Event* ev p1 = node->convertToNodeSpaceAR(location); p2 = node->convertToNodeSpace(location); - CCLOG("AR: x=%.2f, y=%.2f -- Not AR: x=%.2f, y=%.2f", p1.x, p1.y, p2.x, p2.y); + AXLOG("AR: x=%.2f, y=%.2f -- Not AR: x=%.2f, y=%.2f", p1.x, p1.y, p2.x, p2.y); } } } @@ -1170,7 +1170,7 @@ void NodeNormalizedPositionTest2::update(float dt) Size s = Size(_copyContentSize.width * norm, _copyContentSize.height * norm); setContentSize(s); - CCLOG("s: %f,%f", s.width, s.height); + AXLOG("s: %f,%f", s.width, s.height); } //------------------------------------------------------------------ @@ -1224,7 +1224,7 @@ void NodeNameTest::onEnter() { TestCocosNodeDemo::onEnter(); - this->scheduleOnce(CC_CALLBACK_1(NodeNameTest::test, this), 0.05f, "test_key"); + this->scheduleOnce(AX_CALLBACK_1(NodeNameTest::test, this), 0.05f, "test_key"); } void NodeNameTest::onExit() diff --git a/tests/cpp-tests/Classes/OpenURLTest/OpenURLTest.cpp b/tests/cpp-tests/Classes/OpenURLTest/OpenURLTest.cpp index 2d397c0846..9181b569e2 100644 --- a/tests/cpp-tests/Classes/OpenURLTest/OpenURLTest.cpp +++ b/tests/cpp-tests/Classes/OpenURLTest/OpenURLTest.cpp @@ -38,7 +38,7 @@ OpenURLTest::OpenURLTest() label->setPosition(VisibleRect::center().x, VisibleRect::top().y - 50); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(OpenURLTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(OpenURLTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // create a label to display the tip string diff --git a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp index 4751a28a27..98ea6fc9b7 100644 --- a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp +++ b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp @@ -113,7 +113,7 @@ std::string Parallax1::title() const Parallax2::Parallax2() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(Parallax2::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(Parallax2::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // Top Layer, a simple image diff --git a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp index 42b909f51a..b04c6af65e 100644 --- a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp +++ b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp @@ -74,9 +74,9 @@ bool Particle3DTestDemo::init() this->addChild(_camera); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(Particle3DTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(Particle3DTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(Particle3DTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(Particle3DTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(Particle3DTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(Particle3DTestDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); TTFConfig config("fonts/tahoma.ttf", 10); @@ -99,7 +99,7 @@ void Particle3DTestDemo::onTouchesMoved(const std::vector& touches, axis auto touch = touches[0]; auto delta = touch->getDelta(); - _angle -= CC_DEGREES_TO_RADIANS(delta.x); + _angle -= AX_DEGREES_TO_RADIANS(delta.x); _camera->setPosition3D(Vec3(100.0f * sinf(_angle), 0.0f, 100.0f * cosf(_angle))); _camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f)); } diff --git a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp index b5ba510e8c..7cfa3d869b 100644 --- a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp +++ b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp @@ -120,7 +120,7 @@ void DemoPause::onEnter() _emitter->setTexture(Director::getInstance()->getTextureCache()->addImage(s_fire)); setEmitterPosition(); - schedule(CC_SCHEDULE_SELECTOR(DemoPause::pauseEmitter), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(DemoPause::pauseEmitter), 2.0f); } void DemoPause::pauseEmitter(float time) { @@ -2072,7 +2072,7 @@ void Issue870::onEnter() _emitter->retain(); _index = 0; - schedule(CC_SCHEDULE_SELECTOR(Issue870::updateQuads), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(Issue870::updateQuads), 2.0f); } void Issue870::updateQuads(float dt) @@ -2220,7 +2220,7 @@ ParticleTests::ParticleTests() ParticleDemo::~ParticleDemo() { - CC_SAFE_RELEASE(_emitter); + AX_SAFE_RELEASE(_emitter); } void ParticleDemo::onEnter() @@ -2235,15 +2235,15 @@ void ParticleDemo::onEnter() _emitter = nullptr; auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(ParticleDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(ParticleDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(ParticleDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(ParticleDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(ParticleDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(ParticleDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); auto item4 = MenuItemToggle::createWithCallback( - CC_CALLBACK_1(ParticleDemo::toggleCallback, this), MenuItemFont::create("Free Movement"), + AX_CALLBACK_1(ParticleDemo::toggleCallback, this), MenuItemFont::create("Free Movement"), MenuItemFont::create("Relative Movement"), MenuItemFont::create("Grouped Movement"), nullptr); auto menu = Menu::create(item4, nullptr); @@ -2360,7 +2360,7 @@ void ParticleBatchHybrid::onEnter() addChild(batch, 10); - schedule(CC_SCHEDULE_SELECTOR(ParticleBatchHybrid::switchRender), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(ParticleBatchHybrid::switchRender), 2.0f); auto node = Node::create(); addChild(node); @@ -2477,7 +2477,7 @@ void ParticleReorder::onEnter() addChild(parent, 10, 1000 + i); } - schedule(CC_SCHEDULE_SELECTOR(ParticleReorder::reorderParticles), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(ParticleReorder::reorderParticles), 1.0f); } std::string ParticleReorder::title() const @@ -2780,7 +2780,7 @@ void AddAndDeleteParticleSystems::onEnter() _batchNode->addChild(particleSystem, randZ, -1); } - schedule(CC_SCHEDULE_SELECTOR(AddAndDeleteParticleSystems::removeSystem), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(AddAndDeleteParticleSystems::removeSystem), 0.5f); _emitter = nullptr; } @@ -2789,7 +2789,7 @@ void AddAndDeleteParticleSystems::removeSystem(float dt) ssize_t nChildrenCount = _batchNode->getChildren().size(); if (nChildrenCount > 0) { - CCLOG("remove random system"); + AXLOG("remove random system"); unsigned int uRand = rand() % (nChildrenCount - 1); _batchNode->removeChild(_batchNode->getChildren().at(uRand), true); @@ -2801,7 +2801,7 @@ void AddAndDeleteParticleSystems::removeSystem(float dt) particleSystem->setPosition(Vec2(rand() % 300, rand() % 400)); - CCLOG("add a new system"); + AXLOG("add a new system"); unsigned int randZ = rand() % 100; _batchNode->addChild(particleSystem, randZ, -1); } @@ -2928,7 +2928,7 @@ void ReorderParticleSystems::onEnter() //[pBNode addChild:particleSystem z:10 tag:0); } - schedule(CC_SCHEDULE_SELECTOR(ReorderParticleSystems::reorderSystem), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(ReorderParticleSystems::reorderSystem), 2.0f); _emitter = nullptr; } @@ -3010,7 +3010,7 @@ void PremultipliedAlphaTest::onEnter() // Cocos2d "normal" blend func for premul causes alpha to be ignored (oversaturates colors) _emitter->setBlendFunc(BlendFunc::ALPHA_PREMULTIPLIED); - CCASSERT(_emitter->isOpacityModifyRGB(), "Particle texture does not have premultiplied alpha, test is useless"); + AXASSERT(_emitter->isOpacityModifyRGB(), "Particle texture does not have premultiplied alpha, test is useless"); // Toggle next line to see old behavior // this->emitter.opacityModifyRGB = NO; @@ -3023,7 +3023,7 @@ void PremultipliedAlphaTest::onEnter() this->addChild(_emitter, 10); _hasEmitter = true; - schedule(CC_SCHEDULE_SELECTOR(PremultipliedAlphaTest::readdParticle), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(PremultipliedAlphaTest::readdParticle), 1.0f); } // PremultipliedAlphaTest2 @@ -3093,7 +3093,7 @@ void ParticleVisibleTest::onEnter() _emitter->setTexture(Director::getInstance()->getTextureCache()->addImage(s_stars1)); - schedule(CC_SCHEDULE_SELECTOR(ParticleVisibleTest::callback), 1); + schedule(AX_SCHEDULE_SELECTOR(ParticleVisibleTest::callback), 1); setEmitterPosition(); } diff --git a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.cpp b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.cpp index 8ede42f65e..5e796d2947 100644 --- a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.cpp +++ b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.cpp @@ -52,7 +52,7 @@ static axis::Scene* physicsScene = nullptr; Physics3DTests::Physics3DTests() { -#if CC_USE_3D_PHYSICS == 0 +#if AX_USE_3D_PHYSICS == 0 ADD_TEST_CASE(Physics3DDemoDisabled); #else ADD_TEST_CASE(BasicPhysics3DDemo); @@ -64,11 +64,11 @@ Physics3DTests::Physics3DTests() #endif }; -#if CC_USE_3D_PHYSICS == 0 +#if AX_USE_3D_PHYSICS == 0 void Physics3DDemoDisabled::onEnter() { TTFConfig ttfConfig("fonts/arial.ttf", 16); - auto label = Label::createWithTTF(ttfConfig, "Should define CC_USE_3D_PHYSICS\n to run this test case"); + auto label = Label::createWithTTF(ttfConfig, "Should define AX_USE_3D_PHYSICS\n to run this test case"); auto size = Director::getInstance()->getWinSize(); label->setPosition(Vec2(size.width / 2, size.height / 2)); @@ -106,9 +106,9 @@ bool Physics3DTestDemo::init() this->addChild(_camera); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(Physics3DTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(Physics3DTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(Physics3DTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(Physics3DTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(Physics3DTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(Physics3DTestDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); TTFConfig ttfConfig("fonts/arial.ttf", 10); @@ -152,7 +152,7 @@ void Physics3DTestDemo::onTouchesMoved(const std::vector& touches, axis: auto touch = touches[0]; auto delta = touch->getDelta(); - _angle -= CC_DEGREES_TO_RADIANS(delta.x); + _angle -= AX_DEGREES_TO_RADIANS(delta.x); _camera->setPosition3D(Vec3(100.0f * sinf(_angle), 50.0f, 100.0f * cosf(_angle))); _camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f)); @@ -379,7 +379,7 @@ bool Physics3DConstraintDemo::init() rbDes.shape = Physics3DShape::createBox(Vec3(5.0f, 5.0f, 5.0f)); auto rigidBody = Physics3DRigidBody::create(&rbDes); Quaternion quat; - Quaternion::createFromAxisAngle(Vec3(0.f, 1.f, 0.f), CC_DEGREES_TO_RADIANS(180), &quat); + Quaternion::createFromAxisAngle(Vec3(0.f, 1.f, 0.f), AX_DEGREES_TO_RADIANS(180), &quat); auto component = Physics3DComponent::create(rigidBody, Vec3(0.f, -3.f, 0.f), quat); mesh->addComponent(component); @@ -446,7 +446,7 @@ bool Physics3DConstraintDemo::init() component->syncNodeToPhysics(); Mat4 frameInA, frameInB; - Mat4::createRotationZ(CC_DEGREES_TO_RADIANS(90), &frameInA); + Mat4::createRotationZ(AX_DEGREES_TO_RADIANS(90), &frameInA); frameInB = frameInA; frameInA.m[13] = -5.f; frameInB.m[13] = 5.f; @@ -469,14 +469,14 @@ bool Physics3DConstraintDemo::init() this->addChild(mesh); component->syncNodeToPhysics(); - Mat4::createRotationZ(CC_DEGREES_TO_RADIANS(90), &frameInA); + Mat4::createRotationZ(AX_DEGREES_TO_RADIANS(90), &frameInA); frameInA.m[12] = 0.f; frameInA.m[13] = -10.f; frameInA.m[14] = 0.f; constraint = Physics3DConeTwistConstraint::create(rigidBody, frameInA); physicsScene->getPhysics3DWorld()->addPhysics3DConstraint(constraint, true); ((Physics3DConeTwistConstraint*)constraint) - ->setLimit(CC_DEGREES_TO_RADIANS(10), CC_DEGREES_TO_RADIANS(10), CC_DEGREES_TO_RADIANS(40)); + ->setLimit(AX_DEGREES_TO_RADIANS(10), AX_DEGREES_TO_RADIANS(10), AX_DEGREES_TO_RADIANS(40)); // create 6 dof constraint rbDes.mass = 1.0f; @@ -652,13 +652,13 @@ bool Physics3DTerrainDemo::init() Mat4::createTranslation(0.6f, 5.0f, -1.5f, &localTrans); shapeList.push_back(std::make_pair(headshape, localTrans)); auto lhandshape = Physics3DShape::createBox(Vec3(1.0f, 3.0f, 1.0f)); - Mat4::createRotation(Vec3(1.0f, 0.0f, 0.0f), CC_DEGREES_TO_RADIANS(15.0f), &localTrans); + Mat4::createRotation(Vec3(1.0f, 0.0f, 0.0f), AX_DEGREES_TO_RADIANS(15.0f), &localTrans); localTrans.m[12] = -1.5f; localTrans.m[13] = 2.5f; localTrans.m[14] = -2.5f; shapeList.push_back(std::make_pair(lhandshape, localTrans)); auto rhandshape = Physics3DShape::createBox(Vec3(1.0f, 3.0f, 1.0f)); - Mat4::createRotation(Vec3(1.0f, 0.0f, 0.0f), CC_DEGREES_TO_RADIANS(-15.0f), &localTrans); + Mat4::createRotation(Vec3(1.0f, 0.0f, 0.0f), AX_DEGREES_TO_RADIANS(-15.0f), &localTrans); localTrans.m[12] = 2.0f; localTrans.m[13] = 2.5f; localTrans.m[14] = 1.f; @@ -734,15 +734,15 @@ bool Physics3DCollisionCallbackDemo::init() ci.objA->setMask(0); } } - // CCLOG("------------BoxB Collision Info------------"); - // CCLOG("Collision Point Num: %d", ci.collisionPointList.size()); + // AXLOG("------------BoxB Collision Info------------"); + // AXLOG("Collision Point Num: %d", ci.collisionPointList.size()); // for (auto &iter : ci.collisionPointList){ - // CCLOG("Collision Position On A: (%.2f, %.2f, %.2f)", iter.worldPositionOnA.x, iter.worldPositionOnA.y, - // iter.worldPositionOnA.z); CCLOG("Collision Position On B: (%.2f, %.2f, %.2f)", - // iter.worldPositionOnB.x, iter.worldPositionOnB.y, iter.worldPositionOnB.z); CCLOG("Collision Normal + // AXLOG("Collision Position On A: (%.2f, %.2f, %.2f)", iter.worldPositionOnA.x, iter.worldPositionOnA.y, + // iter.worldPositionOnA.z); AXLOG("Collision Position On B: (%.2f, %.2f, %.2f)", + // iter.worldPositionOnB.x, iter.worldPositionOnB.y, iter.worldPositionOnB.z); AXLOG("Collision Normal // On B: (%.2f, %.2f, %.2f)", iter.worldNormalOnB.x, iter.worldNormalOnB.y, iter.worldNormalOnB.z); // } - // CCLOG("------------BoxB Collision Info------------"); + // AXLOG("------------BoxB Collision Info------------"); }); } diff --git a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h index 083c5142f1..923485479e 100644 --- a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h +++ b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h @@ -37,7 +37,7 @@ NS_AX_END DEFINE_TEST_SUITE(Physics3DTests); -#if CC_USE_3D_PHYSICS == 0 +#if AX_USE_3D_PHYSICS == 0 class Physics3DDemoDisabled : public TestCase { public: diff --git a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp index e2dd28fd18..74f1f736d8 100644 --- a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp +++ b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp @@ -24,7 +24,7 @@ #include "PhysicsTest.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include # include "ui/CocosGUI.h" @@ -62,7 +62,7 @@ const int DRAG_BODYS_TAG = 0x80; void PhysicsDemo::toggleDebug() { -# if CC_USE_PHYSICS +# if AX_USE_PHYSICS _debugDraw = !_debugDraw; _physicsWorld->setDebugDrawMask(_debugDraw ? PhysicsWorld::DEBUGDRAW_ALL : PhysicsWorld::DEBUGDRAW_NONE); # endif @@ -91,7 +91,7 @@ void PhysicsDemo::onEnter() // menu for debug layer MenuItemFont::setFontSize(18); - auto item = MenuItemFont::create("Toggle debug", CC_CALLBACK_1(PhysicsDemo::toggleDebugCallback, this)); + auto item = MenuItemFont::create("Toggle debug", AX_CALLBACK_1(PhysicsDemo::toggleDebugCallback, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -101,12 +101,12 @@ void PhysicsDemo::onEnter() Sprite* PhysicsDemo::addGrossiniAtPosition(Vec2 p, float scale /* = 1.0*/) { - CCLOG("Add sprite %0.2f x %02.f", p.x, p.y); + AXLOG("Add sprite %0.2f x %02.f", p.x, p.y); int posx, posy; - posx = CCRANDOM_0_1() * 200.0f; - posy = CCRANDOM_0_1() * 200.0f; + posx = AXRANDOM_0_1() * 200.0f; + posy = AXRANDOM_0_1() * 200.0f; posx = (posx % 4) * 85; posy = (posy % 3) * 121; @@ -205,7 +205,7 @@ Sprite* PhysicsDemo::makeBox(Vec2 point, Size size, int color, PhysicsMaterial m bool yellow = false; if (color == 0) { - yellow = CCRANDOM_0_1() > 0.5f; + yellow = AXRANDOM_0_1() > 0.5f; } else { @@ -228,7 +228,7 @@ Sprite* PhysicsDemo::makeTriangle(Vec2 point, Size size, int color, PhysicsMater bool yellow = false; if (color == 0) { - yellow = CCRANDOM_0_1() > 0.5f; + yellow = AXRANDOM_0_1() > 0.5f; } else { @@ -372,11 +372,11 @@ void PhysicsDemoClickAdd::onEnter() PhysicsDemo::onEnter(); auto touchListener = EventListenerTouchAllAtOnce::create(); - touchListener->onTouchesEnded = CC_CALLBACK_2(PhysicsDemoClickAdd::onTouchesEnded, this); + touchListener->onTouchesEnded = AX_CALLBACK_2(PhysicsDemoClickAdd::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); Device::setAccelerometerEnabled(true); - auto accListener = EventListenerAcceleration::create(CC_CALLBACK_2(PhysicsDemoClickAdd::onAcceleration, this)); + auto accListener = EventListenerAcceleration::create(AX_CALLBACK_2(PhysicsDemoClickAdd::onAcceleration, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(accListener, this); auto node = Node::create(); @@ -427,9 +427,9 @@ void PhysicsDemoPyramidStack::onEnter() PhysicsDemo::onEnter(); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemoPyramidStack::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemoPyramidStack::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemoPyramidStack::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemoPyramidStack::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemoPyramidStack::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoPyramidStack::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); auto node = Node::create(); @@ -446,7 +446,7 @@ void PhysicsDemoPyramidStack::onEnter() ball->setPosition(VisibleRect::bottom() + Vec2(0.0f, 60.0f)); this->addChild(ball); - scheduleOnce(CC_SCHEDULE_SELECTOR(PhysicsDemoPyramidStack::updateOnce), 3.0); + scheduleOnce(AX_SCHEDULE_SELECTOR(PhysicsDemoPyramidStack::updateOnce), 3.0); for (int i = 0; i < 14; i++) { @@ -477,7 +477,7 @@ void PhysicsDemoRayCast::onEnter() PhysicsDemo::onEnter(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(PhysicsDemoRayCast::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(PhysicsDemoRayCast::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); _physicsWorld->setGravity(Point::ZERO); @@ -489,7 +489,7 @@ void PhysicsDemoRayCast::onEnter() this->addChild(node); MenuItemFont::setFontSize(18); - auto item = MenuItemFont::create("Change Mode(any)", CC_CALLBACK_1(PhysicsDemoRayCast::changeModeCallback, this)); + auto item = MenuItemFont::create("Change Mode(any)", AX_CALLBACK_1(PhysicsDemoRayCast::changeModeCallback, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -539,7 +539,7 @@ void PhysicsDemoRayCast::update(float /*delta*/) case 0: { Vec2 point3 = point2; - auto func = CC_CALLBACK_3(PhysicsDemoRayCast::anyRay, this); + auto func = AX_CALLBACK_3(PhysicsDemoRayCast::anyRay, this); _physicsWorld->rayCast(func, point1, point2, &point3); _node->drawSegment(point1, point3, 0.5f, STATIC_COLOR); @@ -623,19 +623,19 @@ void PhysicsDemoRayCast::onTouchesEnded(const std::vector& touches, Even { auto location = touch->getLocation(); - float r = CCRANDOM_0_1(); + float r = AXRANDOM_0_1(); if (r < 1.0f / 3.0f) { - addChild(makeBall(location, 5 + CCRANDOM_0_1() * 10)); + addChild(makeBall(location, 5 + AXRANDOM_0_1() * 10)); } else if (r < 2.0f / 3.0f) { - addChild(makeBox(location, Size(10 + CCRANDOM_0_1() * 15, 10 + CCRANDOM_0_1() * 15))); + addChild(makeBox(location, Size(10 + AXRANDOM_0_1() * 15, 10 + AXRANDOM_0_1() * 15))); } else { - addChild(makeTriangle(location, Size(10 + CCRANDOM_0_1() * 20, 10 + CCRANDOM_0_1() * 20))); + addChild(makeTriangle(location, Size(10 + AXRANDOM_0_1() * 20, 10 + AXRANDOM_0_1() * 20))); } } } @@ -651,9 +651,9 @@ void PhysicsDemoActions::onEnter() _physicsWorld->setGravity(Vec2::ZERO); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemoActions::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemoActions::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemoActions::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemoActions::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemoActions::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoActions::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); auto node = Node::create(); @@ -698,9 +698,9 @@ void PhysicsDemoJoints::onEnter() toggleDebug(); auto listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = CC_CALLBACK_2(PhysicsDemo::onTouchBegan, this); - listener->onTouchMoved = CC_CALLBACK_2(PhysicsDemo::onTouchMoved, this); - listener->onTouchEnded = CC_CALLBACK_2(PhysicsDemo::onTouchEnded, this); + listener->onTouchBegan = AX_CALLBACK_2(PhysicsDemo::onTouchBegan, this); + listener->onTouchMoved = AX_CALLBACK_2(PhysicsDemo::onTouchMoved, this); + listener->onTouchEnded = AX_CALLBACK_2(PhysicsDemo::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); float width = (VisibleRect::getVisibleRect().size.width - 10) / 4; @@ -949,9 +949,9 @@ void PhysicsDemoPump::onEnter() _distance = 0.0f; _rotationV = 0.0f; auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemoPump::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemoPump::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemoPump::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemoPump::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemoPump::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoPump::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); scheduleUpdate(); @@ -983,7 +983,7 @@ void PhysicsDemoPump::onEnter() // balls for (int i = 0; i < 6; ++i) { - auto ball = makeBall(VisibleRect::leftTop() + Vec2(75 + CCRANDOM_0_1() * 90, 0.0f), 22, + auto ball = makeBall(VisibleRect::leftTop() + Vec2(75 + AXRANDOM_0_1() * 90, 0.0f), 22, PhysicsMaterial(0.05f, 0.0f, 0.1f)); ball->getPhysicsBody()->setTag(DRAG_BODYS_TAG); addChild(ball); @@ -1056,7 +1056,7 @@ void PhysicsDemoPump::update(float delta) { if (body->getNode() != nullptr) { - body->getNode()->setPosition(VisibleRect::leftTop() + Vec2(75 + CCRANDOM_0_1() * 90, 0.0f)); + body->getNode()->setPosition(VisibleRect::leftTop() + Vec2(75 + AXRANDOM_0_1() * 90, 0.0f)); } body->setVelocity(Vec2(0.0f, 0.0f)); @@ -1120,9 +1120,9 @@ void PhysicsDemoOneWayPlatform::onEnter() PhysicsDemo::onEnter(); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); auto ground = Node::create(); @@ -1145,7 +1145,7 @@ void PhysicsDemoOneWayPlatform::onEnter() this->addChild(ball); auto contactListener = EventListenerPhysicsContactWithBodies::create(platformBody, ballBody); - contactListener->onContactBegin = CC_CALLBACK_1(PhysicsDemoOneWayPlatform::onContactBegin, this); + contactListener->onContactBegin = AX_CALLBACK_1(PhysicsDemoOneWayPlatform::onContactBegin, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(contactListener, this); } @@ -1168,7 +1168,7 @@ void PhysicsDemoSlice::onEnter() auto touchListener = EventListenerTouchOneByOne::create(); touchListener->onTouchBegan = [](Touch* /*touch*/, Event* /*event*/) -> bool { return true; }; - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemoSlice::onTouchEnded, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoSlice::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); auto ground = Node::create(); @@ -1250,7 +1250,7 @@ void PhysicsDemoSlice::clipPoly(PhysicsShapePolygon* shape, Vec2 normal, float d void PhysicsDemoSlice::onTouchEnded(Touch* touch, Event* /*event*/) { - auto func = CC_CALLBACK_3(PhysicsDemoSlice::slice, this); + auto func = AX_CALLBACK_3(PhysicsDemoSlice::slice, this); getPhysicsWorld()->rayCast(func, touch->getStartLocation(), touch->getLocation(), nullptr); } @@ -1302,9 +1302,9 @@ void PhysicsContactTest::onEnter() _blueTriangleNum = 50; MenuItemFont::setFontSize(65); - auto decrease1 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); + auto decrease1 = MenuItemFont::create(" - ", AX_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease1->setColor(Color3B(0, 200, 20)); - auto increase1 = MenuItemFont::create(" + ", CC_CALLBACK_1(PhysicsContactTest::onIncrease, this)); + auto increase1 = MenuItemFont::create(" + ", AX_CALLBACK_1(PhysicsContactTest::onIncrease, this)); increase1->setColor(Color3B(0, 200, 20)); decrease1->setTag(1); increase1->setTag(1); @@ -1320,9 +1320,9 @@ void PhysicsContactTest::onEnter() addChild(label, 1); label->setPosition(Vec2(s.width / 2 - 150, prevMenuPos)); - auto decrease2 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); + auto decrease2 = MenuItemFont::create(" - ", AX_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease2->setColor(Color3B(0, 200, 20)); - auto increase2 = MenuItemFont::create(" + ", CC_CALLBACK_1(PhysicsContactTest::onIncrease, this)); + auto increase2 = MenuItemFont::create(" + ", AX_CALLBACK_1(PhysicsContactTest::onIncrease, this)); increase2->setColor(Color3B(0, 200, 20)); decrease2->setTag(2); increase2->setTag(2); @@ -1336,9 +1336,9 @@ void PhysicsContactTest::onEnter() addChild(label, 1); label->setPosition(Vec2(s.width / 2 - 150, prevMenuPos)); - auto decrease3 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); + auto decrease3 = MenuItemFont::create(" - ", AX_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease3->setColor(Color3B(0, 200, 20)); - auto increase3 = MenuItemFont::create(" + ", CC_CALLBACK_1(PhysicsContactTest::onIncrease, this)); + auto increase3 = MenuItemFont::create(" + ", AX_CALLBACK_1(PhysicsContactTest::onIncrease, this)); increase3->setColor(Color3B(0, 200, 20)); decrease3->setTag(3); increase3->setTag(3); @@ -1352,9 +1352,9 @@ void PhysicsContactTest::onEnter() addChild(label, 1); label->setPosition(Vec2(s.width / 2 - 150, prevMenuPos)); - auto decrease4 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); + auto decrease4 = MenuItemFont::create(" - ", AX_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease4->setColor(Color3B(0, 200, 20)); - auto increase4 = MenuItemFont::create(" + ", CC_CALLBACK_1(PhysicsContactTest::onIncrease, this)); + auto increase4 = MenuItemFont::create(" + ", AX_CALLBACK_1(PhysicsContactTest::onIncrease, this)); increase4->setColor(Color3B(0, 200, 20)); decrease4->setTag(4); increase4->setTag(4); @@ -1462,19 +1462,19 @@ void PhysicsContactTest::resetTest() root->addChild(wall); auto contactListener = EventListenerPhysicsContact::create(); - contactListener->onContactBegin = CC_CALLBACK_1(PhysicsContactTest::onContactBegin, this); + contactListener->onContactBegin = AX_CALLBACK_1(PhysicsContactTest::onContactBegin, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(contactListener, this); // yellow box, will collide with itself and blue box. for (int i = 0; i < _yellowBoxNum; ++i) { - Size size(10 + CCRANDOM_0_1() * 10, 10 + CCRANDOM_0_1() * 10); + Size size(10 + AXRANDOM_0_1() * 10, 10 + AXRANDOM_0_1() * 10); Size winSize = VisibleRect::getVisibleRect().size; Vec2 position = Vec2(winSize.width, winSize.height) - Vec2(size.width, size.height); - position.x = position.x * CCRANDOM_0_1(); - position.y = position.y * CCRANDOM_0_1(); + position.x = position.x * AXRANDOM_0_1(); + position.y = position.y * AXRANDOM_0_1(); position = VisibleRect::leftBottom() + position + Vec2(size.width / 2, size.height / 2); - Vec2 velocity((float)(CCRANDOM_0_1() - 0.5) * 200, (float)(CCRANDOM_0_1() - 0.5) * 200); + Vec2 velocity((float)(AXRANDOM_0_1() - 0.5) * 200, (float)(AXRANDOM_0_1() - 0.5) * 200); auto box = makeBox(position, size, 1, PhysicsMaterial(0.1f, 1, 0.0f)); auto boxBody = box->getPhysicsBody(); boxBody->setVelocity(velocity); @@ -1487,13 +1487,13 @@ void PhysicsContactTest::resetTest() // blue box, will collide with blue box. for (int i = 0; i < _blueBoxNum; ++i) { - Size size(10 + CCRANDOM_0_1() * 10, 10 + CCRANDOM_0_1() * 10); + Size size(10 + AXRANDOM_0_1() * 10, 10 + AXRANDOM_0_1() * 10); Size winSize = VisibleRect::getVisibleRect().size; Vec2 position = Vec2(winSize.width, winSize.height) - Vec2(size.width, size.height); - position.x = position.x * CCRANDOM_0_1(); - position.y = position.y * CCRANDOM_0_1(); + position.x = position.x * AXRANDOM_0_1(); + position.y = position.y * AXRANDOM_0_1(); position = VisibleRect::leftBottom() + position + Vec2(size.width / 2, size.height / 2); - Vec2 velocity((float)(CCRANDOM_0_1() - 0.5) * 200, (float)(CCRANDOM_0_1() - 0.5) * 200); + Vec2 velocity((float)(AXRANDOM_0_1() - 0.5) * 200, (float)(AXRANDOM_0_1() - 0.5) * 200); auto box = makeBox(position, size, 2, PhysicsMaterial(0.1f, 1, 0.0f)); auto boxBody = box->getPhysicsBody(); boxBody->setVelocity(velocity); @@ -1506,13 +1506,13 @@ void PhysicsContactTest::resetTest() // yellow triangle, will collide with itself and blue box. for (int i = 0; i < _yellowTriangleNum; ++i) { - Size size(10 + CCRANDOM_0_1() * 10, 10 + CCRANDOM_0_1() * 10); + Size size(10 + AXRANDOM_0_1() * 10, 10 + AXRANDOM_0_1() * 10); Size winSize = VisibleRect::getVisibleRect().size; Vec2 position = Vec2(winSize.width, winSize.height) - Vec2(size.width, size.height); - position.x = position.x * CCRANDOM_0_1(); - position.y = position.y * CCRANDOM_0_1(); + position.x = position.x * AXRANDOM_0_1(); + position.y = position.y * AXRANDOM_0_1(); position = VisibleRect::leftBottom() + position + Vec2(size.width / 2, size.height / 2); - Vec2 velocity((float)(CCRANDOM_0_1() - 0.5) * 300, (float)(CCRANDOM_0_1() - 0.5) * 300); + Vec2 velocity((float)(AXRANDOM_0_1() - 0.5) * 300, (float)(AXRANDOM_0_1() - 0.5) * 300); auto triangle = makeTriangle(position, size, 1, PhysicsMaterial(0.1f, 1, 0.0f)); auto triangleBody = triangle->getPhysicsBody(); triangleBody->setVelocity(velocity); @@ -1525,13 +1525,13 @@ void PhysicsContactTest::resetTest() // blue triangle, will collide with yellow box. for (int i = 0; i < _blueTriangleNum; ++i) { - Size size(10 + CCRANDOM_0_1() * 10, 10 + CCRANDOM_0_1() * 10); + Size size(10 + AXRANDOM_0_1() * 10, 10 + AXRANDOM_0_1() * 10); Size winSize = VisibleRect::getVisibleRect().size; Vec2 position = Vec2(winSize.width, winSize.height) - Vec2(size.width, size.height); - position.x = position.x * CCRANDOM_0_1(); - position.y = position.y * CCRANDOM_0_1(); + position.x = position.x * AXRANDOM_0_1(); + position.y = position.y * AXRANDOM_0_1(); position = VisibleRect::leftBottom() + position + Vec2(size.width / 2, size.height / 2); - Vec2 velocity((float)(CCRANDOM_0_1() - 0.5) * 300, (float)(CCRANDOM_0_1() - 0.5) * 300); + Vec2 velocity((float)(AXRANDOM_0_1() - 0.5) * 300, (float)(AXRANDOM_0_1() - 0.5) * 300); auto triangle = makeTriangle(position, size, 2, PhysicsMaterial(0.1f, 1, 0.0f)); auto triangleBody = triangle->getPhysicsBody(); triangleBody->setVelocity(velocity); @@ -1547,7 +1547,7 @@ bool PhysicsContactTest::onContactBegin(PhysicsContact& contact) PhysicsBody* a = contact.getShapeA()->getBody(); PhysicsBody* b = contact.getShapeB()->getBody(); PhysicsBody* body = (a->getCategoryBitmask() == 0x04 || a->getCategoryBitmask() == 0x08) ? a : b; - CC_ASSERT(body->getCategoryBitmask() == 0x04 || body->getCategoryBitmask() == 0x08); + AX_ASSERT(body->getCategoryBitmask() == 0x04 || body->getCategoryBitmask() == 0x08); return true; } @@ -1569,9 +1569,9 @@ void PhysicsPositionRotationTest::onEnter() _physicsWorld->setGravity(Point::ZERO); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemo::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemo::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemo::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemo::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemo::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemo::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); auto wall = Node::create(); @@ -1632,9 +1632,9 @@ void PhysicsSetGravityEnableTest::onEnter() PhysicsDemo::onEnter(); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemo::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemo::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemo::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemo::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemo::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemo::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); // wall @@ -1665,7 +1665,7 @@ void PhysicsSetGravityEnableTest::onEnter() ballBody->setMass(50); addChild(ball); - scheduleOnce(CC_SCHEDULE_SELECTOR(PhysicsSetGravityEnableTest::onScheduleOnce), 1.0); + scheduleOnce(AX_SCHEDULE_SELECTOR(PhysicsSetGravityEnableTest::onScheduleOnce), 1.0); } void PhysicsSetGravityEnableTest::onScheduleOnce(float /*delta*/) @@ -1693,9 +1693,9 @@ void PhysicsDemoBug5482::onEnter() toggleDebug(); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemo::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemo::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemo::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemo::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemo::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemo::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); _bodyInA = false; @@ -1709,7 +1709,7 @@ void PhysicsDemoBug5482::onEnter() // button MenuItemFont::setFontSize(18); - _button = MenuItemFont::create("Set Body To A", CC_CALLBACK_1(PhysicsDemoBug5482::changeBodyCallback, this)); + _button = MenuItemFont::create("Set Body To A", AX_CALLBACK_1(PhysicsDemoBug5482::changeBodyCallback, this)); auto menu = Menu::create(_button, nullptr); this->addChild(menu); @@ -1783,7 +1783,7 @@ void PhysicsFixedUpdate::onEnter() addBall(); - scheduleOnce(CC_SCHEDULE_SELECTOR(PhysicsFixedUpdate::updateStart), 2); + scheduleOnce(AX_SCHEDULE_SELECTOR(PhysicsFixedUpdate::updateStart), 2); } void PhysicsFixedUpdate::addBall() @@ -1837,7 +1837,7 @@ void PhysicsTransformTest::onEnter() _physicsWorld->setGravity(Point::ZERO); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsTransformTest::onTouchBegan, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsTransformTest::onTouchBegan, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); _rootLayer = Layer::create(); diff --git a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h index 803ef2a55f..a70092c8e2 100644 --- a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h +++ b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h @@ -28,7 +28,7 @@ #include "../BaseTest.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS DEFINE_TEST_SUITE(PhysicsTests); @@ -308,4 +308,4 @@ public: virtual std::string subtitle() const override; }; -#endif // #if CC_USE_PHYSICS \ No newline at end of file +#endif // #if AX_USE_PHYSICS \ No newline at end of file diff --git a/tests/cpp-tests/Classes/ReleasePoolTest/ReleasePoolTest.cpp b/tests/cpp-tests/Classes/ReleasePoolTest/ReleasePoolTest.cpp index 6fb7594aad..1fc3279d46 100644 --- a/tests/cpp-tests/Classes/ReleasePoolTest/ReleasePoolTest.cpp +++ b/tests/cpp-tests/Classes/ReleasePoolTest/ReleasePoolTest.cpp @@ -36,12 +36,12 @@ class TestObject : public Ref public: TestObject() : _name("") {} - TestObject(std::string name) : _name(name) { CCLOG("TestObject:%s is created", _name.c_str()); } + TestObject(std::string name) : _name(name) { AXLOG("TestObject:%s is created", _name.c_str()); } ~TestObject() { if (_name.size() > 0) - CCLOG("TestObject:%s is destroyed", _name.c_str()); + AXLOG("TestObject:%s is destroyed", _name.c_str()); } private: diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp index 18d1ec4e11..ad871b0377 100644 --- a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -56,19 +56,19 @@ RenderTextureSave::RenderTextureSave() this->addChild(_target, -1); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(RenderTextureSave::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(RenderTextureSave::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // Save Image menu MenuItemFont::setFontSize(16); auto item1 = - MenuItemFont::create("Save Image PMA", CC_CALLBACK_1(RenderTextureSave::saveImageWithPremultipliedAlpha, this)); + MenuItemFont::create("Save Image PMA", AX_CALLBACK_1(RenderTextureSave::saveImageWithPremultipliedAlpha, this)); auto item2 = MenuItemFont::create("Save Image Non-PMA", - CC_CALLBACK_1(RenderTextureSave::saveImageWithNonPremultipliedAlpha, this)); - auto item3 = MenuItemFont::create("Add Image", CC_CALLBACK_1(RenderTextureSave::addImage, this)); - auto item4 = MenuItemFont::create("Clear to Random", CC_CALLBACK_1(RenderTextureSave::clearImage, this)); + AX_CALLBACK_1(RenderTextureSave::saveImageWithNonPremultipliedAlpha, this)); + auto item3 = MenuItemFont::create("Add Image", AX_CALLBACK_1(RenderTextureSave::addImage, this)); + auto item4 = MenuItemFont::create("Clear to Random", AX_CALLBACK_1(RenderTextureSave::clearImage, this)); auto item5 = - MenuItemFont::create("Clear to Transparent", CC_CALLBACK_1(RenderTextureSave::clearImageTransparent, this)); + MenuItemFont::create("Clear to Transparent", AX_CALLBACK_1(RenderTextureSave::clearImageTransparent, this)); auto menu = Menu::create(item1, item2, item3, item4, item5, nullptr); this->addChild(menu); menu->alignItemsVertically(); @@ -87,7 +87,7 @@ std::string RenderTextureSave::subtitle() const void RenderTextureSave::clearImage(axis::Ref* sender) { - _target->clear(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1()); + _target->clear(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1()); } void RenderTextureSave::clearImageTransparent(axis::Ref* sender) @@ -115,7 +115,7 @@ void RenderTextureSave::saveImageWithPremultipliedAlpha(axis::Ref* sender) _target->saveToFile(png, Image::Format::PNG, true, callback); // Add this function to avoid crash if we switch to a new scene. Director::getInstance()->getRenderer()->render(); - CCLOG("Image saved %s", png); + AXLOG("Image saved %s", png); counter++; } @@ -141,7 +141,7 @@ void RenderTextureSave::saveImageWithNonPremultipliedAlpha(axis::Ref* sender) // Add this function to avoid crash if we switch to a new scene. Director::getInstance()->getRenderer()->render(); - CCLOG("Image saved %s", png); + AXLOG("Image saved %s", png); counter++; } @@ -155,8 +155,8 @@ void RenderTextureSave::addImage(axis::Ref* sender) Sprite* sprite = Sprite::create("Images/test-rgba1.png"); sprite->setPosition( - sprite->getContentSize().width + CCRANDOM_0_1() * (s.width - sprite->getContentSize().width), - sprite->getContentSize().height + CCRANDOM_0_1() * (s.height - sprite->getContentSize().height)); + sprite->getContentSize().width + AXRANDOM_0_1() * (s.width - sprite->getContentSize().width), + sprite->getContentSize().height + AXRANDOM_0_1() * (s.height - sprite->getContentSize().height)); sprite->visit(); // finish drawing and return context back to the screen @@ -201,8 +201,8 @@ void RenderTextureSave::onTouchesMoved(const std::vector& touches, Event _brushs.at(i)->setRotation(rand() % 360); float r = (float)(rand() % 50 / 50.f) + 0.25f; _brushs.at(i)->setScale(r); - /*_brush->setColor(Color3B(CCRANDOM_0_1() * 127 + 128, 255, 255));*/ - // Use CCRANDOM_0_1() will cause error when loading libtests.so on android, I don't know why. + /*_brush->setColor(Color3B(AXRANDOM_0_1() * 127 + 128, 255, 255));*/ + // Use AXRANDOM_0_1() will cause error when loading libtests.so on android, I don't know why. _brushs.at(i)->setColor(Color3B(rand() % 127 + 128, 255, 255)); // Call visit to draw the brush, don't call draw.. _brushs.at(i)->visit(); @@ -286,9 +286,9 @@ std::string RenderTextureIssue937::subtitle() const RenderTextureZbuffer::RenderTextureZbuffer() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(RenderTextureZbuffer::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(RenderTextureZbuffer::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(RenderTextureZbuffer::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(RenderTextureZbuffer::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(RenderTextureZbuffer::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(RenderTextureZbuffer::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto size = Director::getInstance()->getWinSize(); @@ -467,7 +467,7 @@ RenderTexturePartTest::RenderTexturePartTest() RenderTexturePartTest::~RenderTexturePartTest() { - CC_SAFE_RELEASE(_rend); + AX_SAFE_RELEASE(_rend); } std::string RenderTexturePartTest::title() const @@ -514,8 +514,8 @@ RenderTextureTestDepthStencil::RenderTextureTestDepthStencil() RenderTextureTestDepthStencil::~RenderTextureTestDepthStencil() { - CC_SAFE_RELEASE(_spriteDraw); - CC_SAFE_RELEASE(_spriteDS); + AX_SAFE_RELEASE(_spriteDraw); + AX_SAFE_RELEASE(_spriteDS); // restore depth stencil desc _renderer->setDepthStencilDesc(_dsDesc); @@ -527,24 +527,24 @@ void RenderTextureTestDepthStencil::draw(Renderer* renderer, const Mat4& transfo _rtx->beginWithClear(0, 0, 0, 0, 0, 0); // _renderCmds[0].init(_globalZOrder); -// _renderCmds[0].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this); - renderer->addCallbackCommand(CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this), _globalZOrder); +// _renderCmds[0].func = AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this); + renderer->addCallbackCommand(AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this), _globalZOrder); // _renderCmds[1].init(_globalZOrder); -// _renderCmds[1].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this); - renderer->addCallbackCommand(CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this), _globalZOrder); +// _renderCmds[1].func = AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this); + renderer->addCallbackCommand(AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this), _globalZOrder); _spriteDS->visit(); // _renderCmds[2].init(_globalZOrder); -// _renderCmds[2].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeDraw, this); - renderer->addCallbackCommand(CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeDraw, this), _globalZOrder); +// _renderCmds[2].func = AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeDraw, this); + renderer->addCallbackCommand(AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeDraw, this), _globalZOrder); _spriteDraw->visit(); // _renderCmds[3].init(_globalZOrder); -// _renderCmds[3].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onAfterDraw, this); - renderer->addCallbackCommand(CC_CALLBACK_0(RenderTextureTestDepthStencil::onAfterDraw, this), _globalZOrder); +// _renderCmds[3].func = AX_CALLBACK_0(RenderTextureTestDepthStencil::onAfterDraw, this); + renderer->addCallbackCommand(AX_CALLBACK_0(RenderTextureTestDepthStencil::onAfterDraw, this), _globalZOrder); /// !!!end will set current render target to default renderTarget /// !!!all render target share one depthStencilDesc, TODO: optimize me? @@ -632,7 +632,7 @@ RenderTextureTargetNode::RenderTextureTargetNode() scheduleUpdate(); // Toggle clear on / off - auto item = MenuItemFont::create("Clear On/Off", CC_CALLBACK_1(RenderTextureTargetNode::touched, this)); + auto item = MenuItemFont::create("Clear On/Off", AX_CALLBACK_1(RenderTextureTargetNode::touched, this)); auto menu = Menu::create(item, nullptr); addChild(menu); @@ -649,7 +649,7 @@ void RenderTextureTargetNode::touched(Ref* sender) else { renderTexture->setClearFlags(ClearFlag::NONE); - renderTexture->setClearColor(Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); + renderTexture->setClearColor(Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1)); } } @@ -678,7 +678,7 @@ std::string RenderTextureTargetNode::subtitle() const SpriteRenderTextureBug::SimpleSprite::SimpleSprite() : _rt(nullptr) {} SpriteRenderTextureBug::SimpleSprite::~SimpleSprite() { - CC_SAFE_RELEASE(_rt); + AX_SAFE_RELEASE(_rt); } SpriteRenderTextureBug::SimpleSprite* SpriteRenderTextureBug::SimpleSprite::create(const char* filename, @@ -691,7 +691,7 @@ SpriteRenderTextureBug::SimpleSprite* SpriteRenderTextureBug::SimpleSprite::crea } else { - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); } return sprite; @@ -714,7 +714,7 @@ void SpriteRenderTextureBug::SimpleSprite::draw(Renderer* renderer, const Mat4& SpriteRenderTextureBug::SpriteRenderTextureBug() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(SpriteRenderTextureBug::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(SpriteRenderTextureBug::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -723,7 +723,7 @@ SpriteRenderTextureBug::SpriteRenderTextureBug() SpriteRenderTextureBug::SimpleSprite* SpriteRenderTextureBug::addNewSpriteWithCoords(const Vec2& p) { - int idx = CCRANDOM_0_1() * 1400 / 100; + int idx = AXRANDOM_0_1() * 1400 / 100; int x = (idx % 5) * 85; int y = (idx / 5) * 121; @@ -733,7 +733,7 @@ SpriteRenderTextureBug::SimpleSprite* SpriteRenderTextureBug::addNewSpriteWithCo sprite->setPosition(p); FiniteTimeAction* action = nullptr; - float rd = CCRANDOM_0_1(); + float rd = AXRANDOM_0_1(); if (rd < 0.20) action = ScaleBy::create(3, 2); diff --git a/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp b/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp index 3c0c0befef..112850770d 100644 --- a/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp +++ b/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp @@ -240,7 +240,7 @@ bool Scene3DTestScene::init() bool ret = false; do { - CC_BREAK_IF(false == TestCase::init()); + AX_BREAK_IF(false == TestCase::init()); // prepare for camera creation, we need several custom cameras _gameCameras.resize(CAMERA_COUNT); @@ -350,8 +350,8 @@ bool Scene3DTestScene::init() //////////////////////////////////////////////////////////////////////// // add touch event callback auto listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = CC_CALLBACK_2(Scene3DTestScene::onTouchBegan, this); - listener->onTouchEnded = CC_CALLBACK_2(Scene3DTestScene::onTouchEnd, this); + listener->onTouchBegan = AX_CALLBACK_2(Scene3DTestScene::onTouchBegan, this); + listener->onTouchEnded = AX_CALLBACK_2(Scene3DTestScene::onTouchEnd, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); ret = true; diff --git a/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp b/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp index 8ab329dbca..187e11f1d1 100644 --- a/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp +++ b/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp @@ -49,10 +49,10 @@ enum SceneTestLayer1::SceneTestLayer1() { - auto item1 = MenuItemFont::create("Test pushScene", CC_CALLBACK_1(SceneTestLayer1::onPushScene, this)); + auto item1 = MenuItemFont::create("Test pushScene", AX_CALLBACK_1(SceneTestLayer1::onPushScene, this)); auto item2 = - MenuItemFont::create("Test pushScene w/transition", CC_CALLBACK_1(SceneTestLayer1::onPushSceneTran, this)); - auto item3 = MenuItemFont::create("Quit", CC_CALLBACK_1(SceneTestLayer1::onQuit, this)); + MenuItemFont::create("Test pushScene w/transition", AX_CALLBACK_1(SceneTestLayer1::onPushSceneTran, this)); + auto item3 = MenuItemFont::create("Quit", AX_CALLBACK_1(SceneTestLayer1::onQuit, this)); auto menu = Menu::create(item1, item2, item3, nullptr); menu->alignItemsVertically(); @@ -67,23 +67,23 @@ SceneTestLayer1::SceneTestLayer1() auto repeat = RepeatForever::create(rotate); sprite->runAction(repeat); - schedule(CC_SCHEDULE_SELECTOR(SceneTestLayer1::testDealloc)); + schedule(AX_SCHEDULE_SELECTOR(SceneTestLayer1::testDealloc)); } void SceneTestLayer1::testDealloc(float dt) { - // CCLOG("SceneTestLayer1:testDealloc"); + // AXLOG("SceneTestLayer1:testDealloc"); } void SceneTestLayer1::onEnter() { - CCLOG("SceneTestLayer1#onEnter"); + AXLOG("SceneTestLayer1#onEnter"); Layer::onEnter(); } void SceneTestLayer1::onEnterTransitionDidFinish() { - CCLOG("SceneTestLayer1#onEnterTransitionDidFinish"); + AXLOG("SceneTestLayer1#onEnterTransitionDidFinish"); Layer::onEnterTransitionDidFinish(); } @@ -125,10 +125,10 @@ SceneTestLayer2::SceneTestLayer2() { _timeCounter = 0; - auto item1 = MenuItemFont::create("replaceScene", CC_CALLBACK_1(SceneTestLayer2::onReplaceScene, this)); + auto item1 = MenuItemFont::create("replaceScene", AX_CALLBACK_1(SceneTestLayer2::onReplaceScene, this)); auto item2 = - MenuItemFont::create("replaceScene w/transition", CC_CALLBACK_1(SceneTestLayer2::onReplaceSceneTran, this)); - auto item3 = MenuItemFont::create("Go Back", CC_CALLBACK_1(SceneTestLayer2::onGoBack, this)); + MenuItemFont::create("replaceScene w/transition", AX_CALLBACK_1(SceneTestLayer2::onReplaceSceneTran, this)); + auto item3 = MenuItemFont::create("Go Back", AX_CALLBACK_1(SceneTestLayer2::onGoBack, this)); auto menu = Menu::create(item1, item2, item3, nullptr); menu->alignItemsVertically(); @@ -143,7 +143,7 @@ SceneTestLayer2::SceneTestLayer2() auto repeat = RepeatForever::create(rotate); sprite->runAction(repeat); - schedule(CC_SCHEDULE_SELECTOR(SceneTestLayer2::testDealloc)); + schedule(AX_SCHEDULE_SELECTOR(SceneTestLayer2::testDealloc)); } void SceneTestLayer2::testDealloc(float dt) @@ -185,18 +185,18 @@ bool SceneTestLayer3::init() auto s = Director::getInstance()->getWinSize(); auto item0 = - MenuItemFont::create("Touch to pushScene (self)", CC_CALLBACK_1(SceneTestLayer3::item0Clicked, this)); - auto item1 = MenuItemFont::create("Touch to popScene", CC_CALLBACK_1(SceneTestLayer3::item1Clicked, this)); + MenuItemFont::create("Touch to pushScene (self)", AX_CALLBACK_1(SceneTestLayer3::item0Clicked, this)); + auto item1 = MenuItemFont::create("Touch to popScene", AX_CALLBACK_1(SceneTestLayer3::item1Clicked, this)); auto item2 = - MenuItemFont::create("Touch to popToRootScene", CC_CALLBACK_1(SceneTestLayer3::item2Clicked, this)); + MenuItemFont::create("Touch to popToRootScene", AX_CALLBACK_1(SceneTestLayer3::item2Clicked, this)); auto item3 = MenuItemFont::create("Touch to popToSceneStackLevel(2)", - CC_CALLBACK_1(SceneTestLayer3::item3Clicked, this)); + AX_CALLBACK_1(SceneTestLayer3::item3Clicked, this)); auto menu = Menu::create(item0, item1, item2, item3, nullptr); this->addChild(menu); menu->alignItemsVertically(); - this->schedule(CC_SCHEDULE_SELECTOR(SceneTestLayer3::testDealloc)); + this->schedule(AX_SCHEDULE_SELECTOR(SceneTestLayer3::testDealloc)); auto sprite = Sprite::create(s_pathGrossini); addChild(sprite); diff --git a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp index 6272d15a0a..cb837c517b 100644 --- a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp +++ b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp @@ -73,26 +73,26 @@ void SchedulerAutoremove::onEnter() { SchedulerTestLayer::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerAutoremove::autoremove), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerAutoremove::tick), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerAutoremove::autoremove), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerAutoremove::tick), 0.5f); accum = 0; } void SchedulerAutoremove::autoremove(float dt) { accum += dt; - CCLOG("autoremove scheduler: Time: %f", accum); + AXLOG("autoremove scheduler: Time: %f", accum); if (accum > 3) { - unschedule(CC_SCHEDULE_SELECTOR(SchedulerAutoremove::autoremove)); - CCLOG("autoremove scheduler: scheduler removed"); + unschedule(AX_SCHEDULE_SELECTOR(SchedulerAutoremove::autoremove)); + AXLOG("autoremove scheduler: scheduler removed"); } } void SchedulerAutoremove::tick(float /*dt*/) { - CCLOG("tick scheduler: This scheduler should not be removed"); + AXLOG("tick scheduler: This scheduler should not be removed"); } std::string SchedulerAutoremove::title() const @@ -113,24 +113,24 @@ std::string SchedulerAutoremove::subtitle() const void SchedulerPauseResume::onEnter() { SchedulerTestLayer::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResume::tick1), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResume::tick2), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResume::pause), 3.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResume::tick1), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResume::tick2), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResume::pause), 3.0f); } void SchedulerPauseResume::tick1(float /*dt*/) { - CCLOG("tick1"); + AXLOG("tick1"); } void SchedulerPauseResume::tick2(float /*dt*/) { - CCLOG("tick2"); + AXLOG("tick2"); } void SchedulerPauseResume::pause(float /*dt*/) { - CCLOG("paused, tick1 and tick2 should called six times"); + AXLOG("paused, tick1 and tick2 should called six times"); Director::getInstance()->getScheduler()->pauseTarget(this); } @@ -164,9 +164,9 @@ void SchedulerPauseResumeAll::onEnter() sprite->runAction(RepeatForever::create(RotateBy::create(3.0f, 360.0f))); sprite->setTag(123); scheduleUpdate(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::tick1), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::tick2), 1.0f); - scheduleOnce(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::pause), 3.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::tick1), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::tick2), 1.0f); + scheduleOnce(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::pause), 3.0f); } void SchedulerPauseResumeAll::update(float /*delta*/) @@ -200,7 +200,7 @@ void SchedulerPauseResumeAll::pause(float /*dt*/) _pausedTargets = scheduler->pauseAllTargets(); // should have only 2 items: ActionManager, self - CCASSERT(_pausedTargets.size() == 2, "Error: pausedTargets should have only 2 items"); + AXASSERT(_pausedTargets.size() == 2, "Error: pausedTargets should have only 2 items"); // because target 'this' has been paused above, so use another node(tag:123) as target getChildByTag(123)->scheduleOnce([this](float dt) { this->resume(dt); }, 2.0f, "test resume"); @@ -246,9 +246,9 @@ void SchedulerPauseResumeAllUser::onEnter() this->addChild(sprite); sprite->runAction(RepeatForever::create(RotateBy::create(3.0f, 360.0f))); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAllUser::tick1), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAllUser::tick2), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAllUser::pause), 3.0f, false, 0); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAllUser::tick1), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAllUser::tick2), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAllUser::pause), 3.0f, false, 0); } void SchedulerPauseResumeAllUser::onExit() @@ -305,31 +305,31 @@ void SchedulerUnscheduleAll::onEnter() { SchedulerTestLayer::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick1), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick2), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick3), 1.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick4), 1.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::unscheduleAll), 4); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick1), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick2), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick3), 1.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick4), 1.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::unscheduleAll), 4); } void SchedulerUnscheduleAll::tick1(float /*dt*/) { - CCLOG("tick1"); + AXLOG("tick1"); } void SchedulerUnscheduleAll::tick2(float /*dt*/) { - CCLOG("tick2"); + AXLOG("tick2"); } void SchedulerUnscheduleAll::tick3(float /*dt*/) { - CCLOG("tick3"); + AXLOG("tick3"); } void SchedulerUnscheduleAll::tick4(float /*dt*/) { - CCLOG("tick4"); + AXLOG("tick4"); } void SchedulerUnscheduleAll::unscheduleAll(float /*dt*/) @@ -365,11 +365,11 @@ void SchedulerUnscheduleAllHard::onEnter() _actionManagerActive = true; - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick1), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick2), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick3), 1.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick4), 1.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::unscheduleAll), 4); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick1), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick2), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick3), 1.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick4), 1.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::unscheduleAll), 4); } void SchedulerUnscheduleAllHard::onExit() @@ -386,22 +386,22 @@ void SchedulerUnscheduleAllHard::onExit() void SchedulerUnscheduleAllHard::tick1(float /*dt*/) { - CCLOG("tick1"); + AXLOG("tick1"); } void SchedulerUnscheduleAllHard::tick2(float /*dt*/) { - CCLOG("tick2"); + AXLOG("tick2"); } void SchedulerUnscheduleAllHard::tick3(float /*dt*/) { - CCLOG("tick3"); + AXLOG("tick3"); } void SchedulerUnscheduleAllHard::tick4(float /*dt*/) { - CCLOG("tick4"); + AXLOG("tick4"); } void SchedulerUnscheduleAllHard::unscheduleAll(float /*dt*/) @@ -436,31 +436,31 @@ void SchedulerUnscheduleAllUserLevel::onEnter() this->addChild(sprite); sprite->runAction(RepeatForever::create(RotateBy::create(3.0f, 360.0f))); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick1), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick2), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick3), 1.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick4), 1.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::unscheduleAll), 4); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick1), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick2), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick3), 1.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick4), 1.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::unscheduleAll), 4); } void SchedulerUnscheduleAllUserLevel::tick1(float /*dt*/) { - CCLOG("tick1"); + AXLOG("tick1"); } void SchedulerUnscheduleAllUserLevel::tick2(float /*dt*/) { - CCLOG("tick2"); + AXLOG("tick2"); } void SchedulerUnscheduleAllUserLevel::tick3(float /*dt*/) { - CCLOG("tick3"); + AXLOG("tick3"); } void SchedulerUnscheduleAllUserLevel::tick4(float /*dt*/) { - CCLOG("tick4"); + AXLOG("tick4"); } void SchedulerUnscheduleAllUserLevel::unscheduleAll(float /*dt*/) @@ -487,29 +487,29 @@ void SchedulerSchedulesAndRemove::onEnter() { SchedulerTestLayer::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick1), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick2), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::scheduleAndUnschedule), 4.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick1), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick2), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::scheduleAndUnschedule), 4.0f); } void SchedulerSchedulesAndRemove::tick1(float /*dt*/) { - CCLOG("tick1"); + AXLOG("tick1"); } void SchedulerSchedulesAndRemove::tick2(float /*dt*/) { - CCLOG("tick2"); + AXLOG("tick2"); } void SchedulerSchedulesAndRemove::tick3(float /*dt*/) { - CCLOG("tick3"); + AXLOG("tick3"); } void SchedulerSchedulesAndRemove::tick4(float /*dt*/) { - CCLOG("tick4"); + AXLOG("tick4"); } std::string SchedulerSchedulesAndRemove::title() const @@ -524,12 +524,12 @@ std::string SchedulerSchedulesAndRemove::subtitle() const void SchedulerSchedulesAndRemove::scheduleAndUnschedule(float /*dt*/) { - unschedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick1)); - unschedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick2)); - unschedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::scheduleAndUnschedule)); + unschedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick1)); + unschedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick2)); + unschedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::scheduleAndUnschedule)); - schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick3), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick4), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick3), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick4), 1.0f); } //------------------------------------------------------------------ @@ -589,7 +589,7 @@ void SchedulerUpdate::onEnter() addChild(f); f->release(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdate::removeUpdates), 4.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdate::removeUpdates), 4.0f); } void SchedulerUpdate::removeUpdates(float /*dt*/) @@ -629,18 +629,18 @@ void SchedulerUpdateAndCustom::onEnter() SchedulerTestLayer::onEnter(); scheduleUpdate(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateAndCustom::tick)); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateAndCustom::stopSelectors), 0.4f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateAndCustom::tick)); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateAndCustom::stopSelectors), 0.4f); } void SchedulerUpdateAndCustom::update(float dt) { - CCLOG("update called:%f", dt); + AXLOG("update called:%f", dt); } void SchedulerUpdateAndCustom::tick(float dt) { - CCLOG("custom selector called:%f", dt); + AXLOG("custom selector called:%f", dt); } void SchedulerUpdateAndCustom::stopSelectors(float /*dt*/) @@ -668,25 +668,25 @@ void SchedulerUpdateFromCustom::onEnter() { SchedulerTestLayer::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::schedUpdate), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::schedUpdate), 2.0f); } void SchedulerUpdateFromCustom::update(float dt) { - CCLOG("update called:%f", dt); + AXLOG("update called:%f", dt); } void SchedulerUpdateFromCustom::schedUpdate(float /*dt*/) { - unschedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::schedUpdate)); + unschedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::schedUpdate)); scheduleUpdate(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::stopUpdate), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::stopUpdate), 2.0f); } void SchedulerUpdateFromCustom::stopUpdate(float /*dt*/) { unscheduleUpdate(); - unschedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::stopUpdate)); + unschedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::stopUpdate)); } std::string SchedulerUpdateFromCustom::title() const @@ -710,7 +710,7 @@ void RescheduleSelector::onEnter() _interval = 1.0f; _ticks = 0; - schedule(CC_SCHEDULE_SELECTOR(RescheduleSelector::schedUpdate), _interval); + schedule(AX_SCHEDULE_SELECTOR(RescheduleSelector::schedUpdate), _interval); } std::string RescheduleSelector::title() const @@ -727,11 +727,11 @@ void RescheduleSelector::schedUpdate(float dt) { _ticks++; - CCLOG("schedUpdate: %.4f", dt); + AXLOG("schedUpdate: %.4f", dt); if (_ticks > 3) { _interval += 1.0f; - schedule(CC_SCHEDULE_SELECTOR(RescheduleSelector::schedUpdate), _interval); + schedule(AX_SCHEDULE_SELECTOR(RescheduleSelector::schedUpdate), _interval); _ticks = 0; } } @@ -741,8 +741,8 @@ void RescheduleSelector::schedUpdate(float dt) void SchedulerDelayAndRepeat::onEnter() { SchedulerTestLayer::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerDelayAndRepeat::update), 0, 4, 3.f); - CCLOG("update is scheduled should begin after 3 seconds"); + schedule(AX_SCHEDULE_SELECTOR(SchedulerDelayAndRepeat::update), 0, 4, 3.f); + AXLOG("update is scheduled should begin after 3 seconds"); } std::string SchedulerDelayAndRepeat::title() const @@ -1040,7 +1040,7 @@ void SchedulerIssue2268::update(float /*dt*/) } SchedulerIssue2268::~SchedulerIssue2268() { - CC_SAFE_RELEASE(testNode); + AX_SAFE_RELEASE(testNode); } std::string SchedulerIssue2268::title() const @@ -1125,7 +1125,7 @@ std::string ScheduleCallbackTest::subtitle() const { return "\n\n\n\nPlease see console.\n\ schedule(lambda, ...)\n\ -schedule(CC_CALLBACK_1(XXX::member_function), this), this, ...)\n\ +schedule(AX_CALLBACK_1(XXX::member_function), this), this, ...)\n\ schedule(global_function, ...)\n\ "; } @@ -1142,14 +1142,14 @@ void ScheduleCallbackTest::onEnter() _scheduler->schedule([](float dt) { log("In the callback of schedule(lambda, ...), dt = %f", dt); }, this, 1.0f, false, "lambda"); - _scheduler->schedule(CC_CALLBACK_1(ScheduleCallbackTest::callback, this), this, 1.0f, false, "member_function"); + _scheduler->schedule(AX_CALLBACK_1(ScheduleCallbackTest::callback, this), this, 1.0f, false, "member_function"); _scheduler->schedule(ScheduleCallbackTest_global_callback, this, 1.0f, false, "global_function"); } void ScheduleCallbackTest::callback(float dt) { - log("In the callback of schedule(CC_CALLBACK_1(XXX::member_function), this), this, ...), dt = %f", dt); + log("In the callback of schedule(AX_CALLBACK_1(XXX::member_function), this), this, ...), dt = %f", dt); } // ScheduleUpdatePriority @@ -1166,8 +1166,8 @@ std::string ScheduleUpdatePriority::subtitle() const bool ScheduleUpdatePriority::onTouchBegan(Touch* /*touch*/, Event* /*event*/) { - int priority = static_cast(CCRANDOM_0_1() * 11) - 5; // -5 ~ 5 - CCLOG("change update priority to %d", priority); + int priority = static_cast(AXRANDOM_0_1() * 11) - 5; // -5 ~ 5 + AXLOG("change update priority to %d", priority); scheduleUpdateWithPriority(priority); return true; } @@ -1179,7 +1179,7 @@ void ScheduleUpdatePriority::onEnter() scheduleUpdate(); auto listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = CC_CALLBACK_2(ScheduleUpdatePriority::onTouchBegan, this); + listener->onTouchBegan = AX_CALLBACK_2(ScheduleUpdatePriority::onTouchBegan, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -1313,12 +1313,12 @@ void SchedulerIssue17149::onEnter() void SchedulerIssue17149::update(float dt) { auto classa = new (_memoryPool) ClassA(); - CCLOG("Address one: %p", classa); + AXLOG("Address one: %p", classa); Director::getInstance()->getScheduler()->scheduleUpdate(classa, 1, false); Director::getInstance()->getScheduler()->unscheduleUpdate(classa); auto classb = new (_memoryPool) ClassB(); - CCLOG("Address one: %p", classb); + AXLOG("Address one: %p", classb); Director::getInstance()->getScheduler()->scheduleUpdate(classb, 1, false); unscheduleUpdate(); @@ -1328,14 +1328,14 @@ SchedulerIssue17149::ClassA::ClassA() : _member1(1), _member2(2), _member3(3) {} void SchedulerIssue17149::ClassA::update(float dt) { - CCLOG("i'm ClassA: %d%d%d", _member1, _member2, _member3); + AXLOG("i'm ClassA: %d%d%d", _member1, _member2, _member3); } SchedulerIssue17149::ClassB::ClassB() : _member1(4), _member2(5), _member3(6) {} void SchedulerIssue17149::ClassB::update(float dt) { - CCLOG("i'm ClassB: %d%d%d", _member1, _member2, _member3); + AXLOG("i'm ClassB: %d%d%d", _member1, _member2, _member3); Director::getInstance()->getScheduler()->unscheduleUpdate(this); } @@ -1391,7 +1391,7 @@ void SchedulerRemoveEntryWhileUpdate::TestClass::update(float dt) { if (_cleanedUp) { - CCLOG("Error: cleaned object must not be called."); + AXLOG("Error: cleaned object must not be called."); return; } @@ -1425,7 +1425,7 @@ void SchedulerRemoveSelectorDuringCall::onEnter() Scheduler* const scheduler(Director::getInstance()->getScheduler()); scheduler->setTimeScale(10); - scheduler->schedule(SEL_SCHEDULE(&SchedulerRemoveSelectorDuringCall::callback), this, 0.01f, CC_REPEAT_FOREVER, + scheduler->schedule(SEL_SCHEDULE(&SchedulerRemoveSelectorDuringCall::callback), this, 0.01f, AX_REPEAT_FOREVER, 0.0f, !isRunning()); _scheduled = true; diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp index 9319646c46..d4c2656ef3 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp @@ -113,7 +113,7 @@ bool ShaderNode::initWithVertex(std::string_view vert, std::string_view frag) /* * TODO: the Y-coordinate of subclasses are flipped in metal * - * keywords: CC_USE_METAL , CC_USE_GL + * keywords: AX_USE_METAL , AX_USE_GL */ _customCommand.createVertexBuffer(sizeof(Vec2), 6, CustomCommand::BufferUsage::STATIC); @@ -146,8 +146,8 @@ void ShaderNode::loadShaderVertex(std::string_view vert, std::string_view frag) auto program = backend::Device::getInstance()->newProgram(vertSource.c_str(), fragSource.c_str()); auto programState = new backend::ProgramState(program); setProgramState(programState); - CC_SAFE_RELEASE(programState); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(programState); + AX_SAFE_RELEASE(program); } void ShaderNode::update(float dt) @@ -188,7 +188,7 @@ void ShaderNode::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) _programState->setUniform(_locCosTime, &cosTime, sizeof(cosTime)); renderer->addCommand(&_customCommand); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 6); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 6); } void ShaderNode::updateUniforms() @@ -421,7 +421,7 @@ SpriteBlur* SpriteBlur::create(const char* pszFileName) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -432,7 +432,7 @@ bool SpriteBlur::initWithTexture(Texture2D* texture, const Rect& rect) _blurRadius = 0; if (Sprite::initWithTexture(texture, rect)) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA auto listener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom* event) { initProgram(); }); @@ -455,8 +455,8 @@ void SpriteBlur::initProgram() auto program = backend::Device::getInstance()->newProgram(positionTextureColor_vert, fragSource.data()); auto programState = new backend::ProgramState(program); setProgramState(programState); - CC_SAFE_RELEASE(programState); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(programState); + AX_SAFE_RELEASE(program); auto size = getTexture()->getContentSizeInPixels(); @@ -599,14 +599,14 @@ bool ShaderRetroEffect::init() _label = Label::createWithBMFont("fonts/west_england-64.fnt", "RETRO EFFECT"); _label->setAnchorPoint(Vec2::ANCHOR_MIDDLE); _label->setProgramState(p); - CC_SAFE_RELEASE(p); + AX_SAFE_RELEASE(p); _label->setPosition(Vec2(s.width / 2, s.height / 2)); addChild(_label); scheduleUpdate(); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(program); return true; } @@ -780,13 +780,13 @@ bool ShaderMultiTexture::init() // menu auto label = Label::createWithTTF(TTFConfig("fonts/arial.ttf"), "change"); - auto mi = MenuItemLabel::create(label, CC_CALLBACK_1(ShaderMultiTexture::changeTexture, this)); + auto mi = MenuItemLabel::create(label, AX_CALLBACK_1(ShaderMultiTexture::changeTexture, this)); auto menu = Menu::create(mi, nullptr); addChild(menu); menu->setPosition(s.width * 7 / 8, s.height / 2); - CC_SAFE_RELEASE(programState); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(programState); + AX_SAFE_RELEASE(program); return true; } diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.vsh.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.vsh.h index 06c0a17bc2..68aa81afc5 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.vsh.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.vsh.h @@ -27,6 +27,6 @@ static const char* shadertestvsh = STRINGIFY( attribute vec4 a_position; - void main() { gl_Position = CC_MVPMatrix * a_position; } + void main() { gl_Position = AX_MVPMatrix * a_position; } ); diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp index 1cdeab29ee..b4239200c1 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp @@ -87,7 +87,7 @@ public: ret->autorelease(); return ret; } - CC_SAFE_RELEASE(ret); + AX_SAFE_RELEASE(ret); return nullptr; } @@ -97,9 +97,9 @@ public: { effect->setTarget(this); - CC_SAFE_RELEASE(_defaultEffect); + AX_SAFE_RELEASE(_defaultEffect); _defaultEffect = effect; - CC_SAFE_RETAIN(_defaultEffect); + AX_SAFE_RETAIN(_defaultEffect); setProgramState(_defaultEffect->getProgramState()); } @@ -116,7 +116,7 @@ public: void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override { -#if CC_USE_CULLING +#if AX_USE_CULLING // Don't do calculate the culling if the transform was not updated _insideBounds = (flags & FLAGS_TRANSFORM_DIRTY) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; @@ -170,7 +170,7 @@ protected: { std::get<1>(tuple)->release(); } - CC_SAFE_RELEASE(_defaultEffect); + AX_SAFE_RELEASE(_defaultEffect); } std::vector> _effects; @@ -187,13 +187,13 @@ bool Effect::initProgramState(std::string_view fragmentFilename) auto fragmentFullPath = fileUtiles->fullPathForFilename(fragmentFilename); auto fragSource = fileUtiles->getStringFromFile(fragmentFullPath); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _fragSource = fragSource; #endif auto program = backend::Device::getInstance()->newProgram(positionTextureColor_vert, fragSource.c_str()); auto programState = new backend::ProgramState(program); - CC_SAFE_RELEASE(_programState); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(program); _programState = programState; return _programState != nullptr; @@ -203,7 +203,7 @@ Effect::Effect() {} Effect::~Effect() { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); } // Blur @@ -416,7 +416,7 @@ public: normalMappedSprite->autorelease(); return normalMappedSprite; } - CC_SAFE_DELETE(normalMappedSprite); + AX_SAFE_DELETE(normalMappedSprite); return nullptr; } void setKBump(float value); @@ -566,9 +566,9 @@ bool EffectSpriteLamp::init() _sprite->setEffect(lampEffect); _effect = lampEffect; auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(EffectSpriteLamp::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(EffectSpriteLamp::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(EffectSpriteLamp::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(EffectSpriteLamp::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(EffectSpriteLamp::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(EffectSpriteLamp::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); return true; } diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h index d025387e96..4611ba839d 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h @@ -52,7 +52,7 @@ protected: Effect(); virtual ~Effect(); axis::backend::ProgramState* _programState = nullptr; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) std::string _fragSource; axis::EventListenerCustom* _backgroundListener; #endif diff --git a/tests/cpp-tests/Classes/ShaderTest/shaderTest.psh.h b/tests/cpp-tests/Classes/ShaderTest/shaderTest.psh.h index fbd2c0be7f..ca839d53ea 100644 --- a/tests/cpp-tests/Classes/ShaderTest/shaderTest.psh.h +++ b/tests/cpp-tests/Classes/ShaderTest/shaderTest.psh.h @@ -29,7 +29,7 @@ static const char* starFlame = STRINGIFY( uniform vec2 center; uniform vec2 resolution; vec2 iResolution = resolution; // viewport resolution (in pixels) - float iGlobalTime = CC_Time[1]; // shader playback time (in seconds) + float iGlobalTime = AX_Time[1]; // shader playback time (in seconds) // uniform float iChannelTime[4]; // channel playback time (in seconds) // uniform vec3 iChannelResolution[4]; // channel resolution (in pixels) vec4 iMouse = vec4(0, 0, 0, 0); // mouse pixel coords. xy: current (if MLB down), zw: click @@ -102,7 +102,7 @@ static const char* starNestFrg = STRINGIFY( vec2 iCenter = center; vec2 iResolution = resolution; // viewport resolution (in pixels) - float iGlobalTime = CC_Time[1]; // shader playback time (in seconds) + float iGlobalTime = AX_Time[1]; // shader playback time (in seconds) // uniform float iChannelTime[4]; // channel playback time (in seconds) // uniform vec3 iChannelResolution[4]; // channel resolution (in pixels) vec4 iMouse = vec4(0, 0, 0, 0); // mouse pixel coords. xy: current (if MLB down), zw: click @@ -189,7 +189,7 @@ static const char* shadertoyRelentlessFrag = STRINGIFY( vec2 iCenter = center; vec2 iResolution = resolution; // viewport resolution (in pixels) - float iGlobalTime = CC_Time[1]; // shader playback time (in seconds) + float iGlobalTime = AX_Time[1]; // shader playback time (in seconds) // uniform float iChannelTime[4]; // channel playback time (in seconds) // uniform vec3 iChannelResolution[4]; // channel resolution (in pixels) diff --git a/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp b/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp index 5df58d1732..bf3fb12ea3 100644 --- a/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp +++ b/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp @@ -140,7 +140,7 @@ bool BatchingExample::init() _title = "Batching"; _atlas = new (__FILE__, __LINE__) Atlas("spineboy.atlas", &textureLoader, true); - CCASSERT(_atlas, "Error reading atlas file."); + AXASSERT(_atlas, "Error reading atlas file."); // This attachment loader configures attachments with data needed for cocos2d-x rendering. // Do not dispose the attachment loader until the skeleton data is disposed! @@ -150,7 +150,7 @@ bool BatchingExample::init() SkeletonJson* json = new (__FILE__, __LINE__) SkeletonJson(_attachmentLoader); json->setScale(0.6f); // Resizes skeleton data to 60% of the size it was in Spine. _skeletonData = json->readSkeletonDataFile("spineboy-pro.json"); - CCASSERT(_skeletonData, + AXASSERT(_skeletonData, (json->getError().isEmpty() ? json->getError().buffer() : "Error reading skeleton data file.")); delete json; diff --git a/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp b/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp index 54a61163d0..2aa4c56741 100644 --- a/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp +++ b/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp @@ -85,8 +85,8 @@ void SpriteFrameCachePixelFormatTest::loadSpriteFrames(std::string_view file, const ssize_t bitsPerKB = 8 * 1024; const double memorySize = 1.0 * texture->getBitsPerPixelForFormat() * texture->getContentSizeInPixels().width * texture->getContentSizeInPixels().height / bitsPerKB; -#ifndef CC_USE_METAL - CC_ASSERT(texture->getPixelFormat() == expectedFormat); +#ifndef AX_USE_METAL + AX_ASSERT(texture->getPixelFormat() == expectedFormat); #endif const std::string textureInfo = StringUtils::format("%s%s: %.2f KB\r\n", infoLabel->getString().data(), texture->getStringForFormat(), memorySize); @@ -113,7 +113,7 @@ void SpriteFrameCacheLoadMultipleTimes::loadSpriteFrames(std::string_view file, SpriteFrameCache::getInstance()->addSpriteFramesWithFile(file); SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName("sprite_frames_test/grossini.png"); Texture2D* texture = spriteFrame->getTexture(); - CC_ASSERT(texture->getPixelFormat() == expectedFormat); + AX_ASSERT(texture->getPixelFormat() == expectedFormat); SpriteFrameCache::getInstance()->removeSpriteFrameByName("sprite_frames_test/grossini.png"); Director::getInstance()->getTextureCache()->removeTexture(texture); @@ -130,19 +130,19 @@ void SpriteFrameCacheFullCheck::loadSpriteFrames(std::string_view file, axis::ba { auto cache = SpriteFrameCache::getInstance(); - CCASSERT(cache->isSpriteFramesWithFileLoaded("plist which not exists") == false, "Plist not exists"); + AXASSERT(cache->isSpriteFramesWithFileLoaded("plist which not exists") == false, "Plist not exists"); cache->addSpriteFramesWithFile(file); - CCASSERT(cache->isSpriteFramesWithFileLoaded(file) == true, "Plist should be full after loaded"); + AXASSERT(cache->isSpriteFramesWithFileLoaded(file) == true, "Plist should be full after loaded"); cache->removeSpriteFrameByName("not_exists_grossinis_sister.png"); - CCASSERT(cache->isSpriteFramesWithFileLoaded(file) == true, "Plist should not be still full"); + AXASSERT(cache->isSpriteFramesWithFileLoaded(file) == true, "Plist should not be still full"); cache->removeSpriteFrameByName("grossinis_sister1.png"); - CCASSERT(cache->isSpriteFramesWithFileLoaded(file) == false, "Plist should not be full after remove any sprite"); + AXASSERT(cache->isSpriteFramesWithFileLoaded(file) == false, "Plist should not be full after remove any sprite"); cache->addSpriteFramesWithFile(file); - CCASSERT(cache->isSpriteFramesWithFileLoaded(file) == true, "Plist should be full after reloaded"); + AXASSERT(cache->isSpriteFramesWithFileLoaded(file) == true, "Plist should be full after reloaded"); } class GenericJsonArraySpriteSheetLoader : public SpriteSheetLoader @@ -154,13 +154,13 @@ public: void load(std::string_view filePath, SpriteFrameCache& cache) override { - CCASSERT(!filePath.empty(), "atlas filename should not be nullptr"); + AXASSERT(!filePath.empty(), "atlas filename should not be nullptr"); const auto fullPath = FileUtils::getInstance()->fullPathForFilename(filePath); if (fullPath.empty()) { // return if plist file doesn't exist - CCLOG("GenericJsonArraySpriteSheetLoader: can not find %s", filePath.data()); + AXLOG("GenericJsonArraySpriteSheetLoader: can not find %s", filePath.data()); return; } @@ -197,7 +197,7 @@ public: // append .png texturePath = texturePath.append(".png"); - CCLOG("GenericJsonArraySpriteSheetLoader::load: Trying to use file %s as texture", texturePath.c_str()); + AXLOG("GenericJsonArraySpriteSheetLoader::load: Trying to use file %s as texture", texturePath.c_str()); } addSpriteFramesWithJson(jDoc, texturePath, filePath, cache); @@ -215,7 +215,7 @@ public: void load(std::string_view filePath, std::string_view textureFileName, SpriteFrameCache& cache) override { - 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); rapidjson::Document jDoc; const auto data = FileUtils::getInstance()->getStringFromFile(fullPath); @@ -284,7 +284,7 @@ public: } else { - CCLOG("GenericJsonArraySpriteSheetLoader::reload: Couldn't load texture"); + AXLOG("GenericJsonArraySpriteSheetLoader::reload: Couldn't load texture"); } } @@ -337,7 +337,7 @@ protected: } else { - CCLOG("GenericJsonArraySpriteSheetLoader::addSpriteFramesWithJson: Couldn't load texture"); + AXLOG("GenericJsonArraySpriteSheetLoader::addSpriteFramesWithJson: Couldn't load texture"); } } @@ -411,7 +411,7 @@ protected: spriteSheet->full = true; - CC_SAFE_DELETE(image); + AX_SAFE_DELETE(image); } void reloadSpriteFramesWithDictionary(const rapidjson::Document& doc, @@ -500,8 +500,8 @@ void SpriteFrameCacheJsonAtlasTest::loadSpriteFrames(std::string_view file, const ssize_t bitsPerKB = 8 * 1024; const double memorySize = 1.0 * texture->getBitsPerPixelForFormat() * texture->getContentSizeInPixels().width * texture->getContentSizeInPixels().height / bitsPerKB; -#ifndef CC_USE_METAL - CC_ASSERT(texture->getPixelFormat() == expectedFormat); +#ifndef AX_USE_METAL + AX_ASSERT(texture->getPixelFormat() == expectedFormat); #endif const std::string textureInfo = StringUtils::format("%s%s: %.2f KB\r\n", infoLabel->getString().data(), texture->getStringForFormat(), memorySize); diff --git a/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.cpp b/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.cpp index 921b9bfc9f..42713807ce 100644 --- a/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.cpp +++ b/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.cpp @@ -306,7 +306,7 @@ void SpritePolygonTestSlider::initSliders() _epsilonLabel->setPosition(Vec2(vsize.width / 2, vsize.height / 4 + 15)); addChild(slider); - slider->addEventListener(CC_CALLBACK_2(SpritePolygonTestSlider::changeEpsilon, this)); + slider->addEventListener(AX_CALLBACK_2(SpritePolygonTestSlider::changeEpsilon, this)); slider->setPercent((int)(sqrtf(1.0f / 19.0f) * 100)); } @@ -459,7 +459,7 @@ void SpritePolygonTest5::loadDefaultSprites() sprites[i] = Sprite::create(_polygonInfo); sprites[i]->setTag(_tagIndex); _tagIndex++; - sprites[i]->setPosition(s.width * CCRANDOM_0_1(), s.height * CCRANDOM_0_1()); + sprites[i]->setPosition(s.width * AXRANDOM_0_1(), s.height * AXRANDOM_0_1()); this->addChild(sprites[i]); auto drawNode = DrawNode::create(); _drawNodes.pushBack(drawNode); @@ -493,7 +493,7 @@ void SpritePolygonTest5::addSpritePolygon(const Vec2& pos) sprite->addChild(drawNode); ActionInterval* action; - float random = CCRANDOM_0_1(); + float random = AXRANDOM_0_1(); if (random < 0.20) action = ScaleBy::create(3, 2); else if (random < 0.40) diff --git a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp index 1760c1584e..75e0689d80 100644 --- a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp +++ b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp @@ -148,7 +148,7 @@ SpriteTests::SpriteTests() Sprite1::Sprite1() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(Sprite1::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(Sprite1::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -157,7 +157,7 @@ Sprite1::Sprite1() void Sprite1::addNewSpriteWithCoords(Vec2 p) { - int idx = (int)(CCRANDOM_0_1() * 1400.0f / 100.0f); + int idx = (int)(AXRANDOM_0_1() * 1400.0f / 100.0f); int x = (idx % 5) * 85; int y = (idx / 5) * 121; @@ -167,7 +167,7 @@ void Sprite1::addNewSpriteWithCoords(Vec2 p) sprite->setPosition(Vec2(p.x, p.y)); ActionInterval* action; - float random = CCRANDOM_0_1(); + float random = AXRANDOM_0_1(); if (random < 0.20) action = ScaleBy::create(3, 2); @@ -214,7 +214,7 @@ std::string Sprite1::subtitle() const SpriteBatchNode1::SpriteBatchNode1() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(SpriteBatchNode1::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(SpriteBatchNode1::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto BatchNode = SpriteBatchNode::create("Images/grossini_dance_atlas.png", 50); @@ -228,7 +228,7 @@ void SpriteBatchNode1::addNewSpriteWithCoords(Vec2 p) { auto BatchNode = static_cast(getChildByTag(kTagSpriteBatchNode)); - int idx = CCRANDOM_0_1() * 1400 / 100; + int idx = AXRANDOM_0_1() * 1400 / 100; int x = (idx % 5) * 85; int y = (idx / 5) * 121; @@ -238,7 +238,7 @@ void SpriteBatchNode1::addNewSpriteWithCoords(Vec2 p) sprite->setPosition(Vec2(p.x, p.y)); ActionInterval* action; - float random = CCRANDOM_0_1(); + float random = AXRANDOM_0_1(); if (random < 0.20) action = ScaleBy::create(3, 2); @@ -336,7 +336,7 @@ SpriteColorOpacity::SpriteColorOpacity() addChild(sprite7, 0, kTagSprite7); addChild(sprite8, 0, kTagSprite8); - schedule(CC_CALLBACK_1(SpriteColorOpacity::removeAndAddSprite, this), 2, "remove_add_key"); + schedule(AX_CALLBACK_1(SpriteColorOpacity::removeAndAddSprite, this), 2, "remove_add_key"); } // this function test if remove and add works as expected: @@ -448,7 +448,7 @@ SpriteColorOpacityHSVHSL::SpriteColorOpacityHSVHSL() addChild(sprite7, 0, kTagSprite7); addChild(sprite8, 0, kTagSprite8); - schedule(CC_CALLBACK_1(SpriteColorOpacityHSVHSL::removeAndAddSprite, this), 2, "remove_add_key"); + schedule(AX_CALLBACK_1(SpriteColorOpacityHSVHSL::removeAndAddSprite, this), 2, "remove_add_key"); } // this function test if remove and add works as expected: @@ -538,7 +538,7 @@ SpriteBatchNodeColorOpacity::SpriteBatchNodeColorOpacity() batch->addChild(sprite7, 0, kTagSprite7); batch->addChild(sprite8, 0, kTagSprite8); - schedule(CC_CALLBACK_1(SpriteBatchNodeColorOpacity::removeAndAddSprite, this), 2, "remove_add_key"); + schedule(AX_CALLBACK_1(SpriteBatchNodeColorOpacity::removeAndAddSprite, this), 2, "remove_add_key"); } // this function test if remove and add works as expected: @@ -599,7 +599,7 @@ SpriteZOrder::SpriteZOrder() sprite->setScaleX(6); sprite->setColor(Color3B::RED); - schedule(CC_CALLBACK_1(SpriteZOrder::reorderSprite, this), 1, "reorder_key"); + schedule(AX_CALLBACK_1(SpriteZOrder::reorderSprite, this), 1, "reorder_key"); } void SpriteZOrder::reorderSprite(float dt) @@ -666,7 +666,7 @@ SpriteBatchNodeZOrder::SpriteBatchNodeZOrder() sprite->setScaleX(6); sprite->setColor(Color3B::RED); - schedule(CC_CALLBACK_1(SpriteBatchNodeZOrder::reorderSprite, this), 1, "reorder_key"); + schedule(AX_CALLBACK_1(SpriteBatchNodeZOrder::reorderSprite, this), 1, "reorder_key"); } void SpriteBatchNodeZOrder::reorderSprite(float dt) @@ -722,7 +722,7 @@ SpriteBatchNodeReorder::SpriteBatchNodeReorder() } } - ssize_t CC_UNUSED prev = -1; + ssize_t AX_UNUSED prev = -1; auto& children = asmtest->getChildren(); @@ -731,8 +731,8 @@ SpriteBatchNodeReorder::SpriteBatchNodeReorder() auto child = static_cast(obj); ssize_t currentIndex = child->getAtlasIndex(); - CCASSERT(prev == currentIndex - 1, "Child order failed"); - ////----CCLOG("children %x - atlasIndex:%d", child, currentIndex); + AXASSERT(prev == currentIndex - 1, "Child order failed"); + ////----AXLOG("children %x - atlasIndex:%d", child, currentIndex); prev = currentIndex; } @@ -741,8 +741,8 @@ SpriteBatchNodeReorder::SpriteBatchNodeReorder() for (const auto& sprite : descendants) { ssize_t currentIndex = sprite->getAtlasIndex(); - CCASSERT(prev == currentIndex - 1, "Child order failed"); - ////----CCLOG("descendant %x - atlasIndex:%d", child, currentIndex); + AXASSERT(prev == currentIndex - 1, "Child order failed"); + ////----AXLOG("descendant %x - atlasIndex:%d", child, currentIndex); prev = currentIndex; } } @@ -797,23 +797,23 @@ std::string SpriteBatchNodeReorderIssue744::subtitle() const Sprite* SpriteBatchNodeReorderIssue766::makeSpriteZ(int aZ) { Rect rcw(128, 0, 64, 64); - rcw = CC_RECT_PIXELS_TO_POINTS(rcw); + rcw = AX_RECT_PIXELS_TO_POINTS(rcw); auto sprite = Sprite::createWithTexture(batchNode->getTexture(), rcw); - sprite->setScale(CC_CONTENT_SCALE_FACTOR()); + sprite->setScale(AX_CONTENT_SCALE_FACTOR()); batchNode->addChild(sprite, aZ + 1, 0); // children Rect rc1(0, 0, 64, 64); - rc1 = CC_RECT_PIXELS_TO_POINTS(rc1); + rc1 = AX_RECT_PIXELS_TO_POINTS(rc1); auto spriteShadow = Sprite::createWithTexture(batchNode->getTexture(), rc1); spriteShadow->setOpacity(128); - sprite->setScale(CC_CONTENT_SCALE_FACTOR()); + sprite->setScale(AX_CONTENT_SCALE_FACTOR()); sprite->addChild(spriteShadow, aZ, 3); Rect rc2(64, 0, 64, 64); - rc2 = CC_RECT_PIXELS_TO_POINTS(rc2); + rc2 = AX_RECT_PIXELS_TO_POINTS(rc2); auto spriteTop = Sprite::createWithTexture(batchNode->getTexture(), rc2); - sprite->setScale(CC_CONTENT_SCALE_FACTOR()); + sprite->setScale(AX_CONTENT_SCALE_FACTOR()); sprite->addChild(spriteTop, aZ + 2, 3); return sprite; @@ -841,7 +841,7 @@ SpriteBatchNodeReorderIssue766::SpriteBatchNodeReorderIssue766() sprite3 = makeSpriteZ(4); sprite3->setPosition(Vec2(328.0f, 160.0f)); - schedule(CC_CALLBACK_1(SpriteBatchNodeReorderIssue766::reorderSprite, this), 2, "issue_766_key"); + schedule(AX_CALLBACK_1(SpriteBatchNodeReorderIssue766::reorderSprite, this), 2, "issue_766_key"); } std::string SpriteBatchNodeReorderIssue766::title() const @@ -915,7 +915,7 @@ SpriteBatchNodeReorderIssue767::SpriteBatchNodeReorderIssue767() l3b2->setPosition(Vec2(0 + l2bSize.width / 2, +50 + l2bSize.height / 2)); l2b->addChild(l3b2, 1); - schedule(CC_CALLBACK_1(SpriteBatchNodeReorderIssue767::reorderSprites, this), 1, "issue_767_key"); + schedule(AX_CALLBACK_1(SpriteBatchNodeReorderIssue767::reorderSprites, this), 1, "issue_767_key"); } std::string SpriteBatchNodeReorderIssue767::title() const @@ -1362,7 +1362,7 @@ SpriteFlip::SpriteFlip() sprite2->setPosition(Vec2(s.width / 2 + 100, s.height / 2)); addChild(sprite2, 0, kTagSprite2); - schedule(CC_CALLBACK_1(SpriteFlip::flipSprites, this), 1, "sprite_flip_key"); + schedule(AX_CALLBACK_1(SpriteFlip::flipSprites, this), 1, "sprite_flip_key"); } void SpriteFlip::flipSprites(float dt) @@ -1373,10 +1373,10 @@ void SpriteFlip::flipSprites(float dt) bool x = sprite1->isFlippedX(); bool y = sprite2->isFlippedY(); - CCLOG("Pre: %g", sprite1->getContentSize().height); + AXLOG("Pre: %g", sprite1->getContentSize().height); sprite1->setFlippedX(!x); sprite2->setFlippedY(!y); - CCLOG("Post: %g", sprite1->getContentSize().height); + AXLOG("Post: %g", sprite1->getContentSize().height); } std::string SpriteFlip::title() const @@ -1409,7 +1409,7 @@ SpriteBatchNodeFlip::SpriteBatchNodeFlip() sprite2->setPosition(Vec2(s.width / 2 + 100, s.height / 2)); batch->addChild(sprite2, 0, kTagSprite2); - schedule(CC_CALLBACK_1(SpriteBatchNodeFlip::flipSprites, this), 1, "flip_sprites_key"); + schedule(AX_CALLBACK_1(SpriteBatchNodeFlip::flipSprites, this), 1, "flip_sprites_key"); } void SpriteBatchNodeFlip::flipSprites(float dt) @@ -1421,10 +1421,10 @@ void SpriteBatchNodeFlip::flipSprites(float dt) bool x = sprite1->isFlippedX(); bool y = sprite2->isFlippedY(); - CCLOG("Pre: %g", sprite1->getContentSize().height); + AXLOG("Pre: %g", sprite1->getContentSize().height); sprite1->setFlippedX(!x); sprite2->setFlippedY(!y); - CCLOG("Post: %g", sprite1->getContentSize().height); + AXLOG("Post: %g", sprite1->getContentSize().height); } std::string SpriteBatchNodeFlip::title() const @@ -1562,7 +1562,7 @@ std::string SpriteBatchNodeAliased::subtitle() const SpriteNewTexture::SpriteNewTexture() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(SpriteNewTexture::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(SpriteNewTexture::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto node = Node::create(); @@ -1589,9 +1589,9 @@ void SpriteNewTexture::addNewSprite() { auto s = Director::getInstance()->getWinSize(); - auto p = Vec2(CCRANDOM_0_1() * s.width, CCRANDOM_0_1() * s.height); + auto p = Vec2(AXRANDOM_0_1() * s.width, AXRANDOM_0_1() * s.height); - int idx = CCRANDOM_0_1() * 1400 / 100; + int idx = AXRANDOM_0_1() * 1400 / 100; int x = (idx % 5) * 85; int y = (idx / 5) * 121; @@ -1602,7 +1602,7 @@ void SpriteNewTexture::addNewSprite() sprite->setPosition(Vec2(p.x, p.y)); ActionInterval* action; - float random = CCRANDOM_0_1(); + float random = AXRANDOM_0_1(); if (random < 0.20) action = ScaleBy::create(3, 2); @@ -1670,7 +1670,7 @@ std::string SpriteNewTexture::subtitle() const SpriteBatchNodeNewTexture::SpriteBatchNodeNewTexture() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(SpriteBatchNodeNewTexture::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(SpriteBatchNodeNewTexture::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto batch = SpriteBatchNode::create("Images/grossini_dance_atlas.png", 50); @@ -1695,11 +1695,11 @@ void SpriteBatchNodeNewTexture::addNewSprite() { auto s = Director::getInstance()->getWinSize(); - auto p = Vec2(CCRANDOM_0_1() * s.width, CCRANDOM_0_1() * s.height); + auto p = Vec2(AXRANDOM_0_1() * s.width, AXRANDOM_0_1() * s.height); auto batch = static_cast(getChildByTag(kTagSpriteBatchNode)); - int idx = CCRANDOM_0_1() * 1400 / 100; + int idx = AXRANDOM_0_1() * 1400 / 100; int x = (idx % 5) * 85; int y = (idx / 5) * 121; @@ -1709,7 +1709,7 @@ void SpriteBatchNodeNewTexture::addNewSprite() sprite->setPosition(Vec2(p.x, p.y)); ActionInterval* action; - float random = CCRANDOM_0_1(); + float random = AXRANDOM_0_1(); if (random < 0.20) action = ScaleBy::create(3, 2); @@ -1825,7 +1825,7 @@ void SpriteFrameTest::onEnter() _sprite2->setFlippedX(false); _sprite2->setFlippedY(false); - schedule(CC_CALLBACK_1(SpriteFrameTest::startIn05Secs, this), 0.5f, "in_05_secs_key"); + schedule(AX_CALLBACK_1(SpriteFrameTest::startIn05Secs, this), 0.5f, "in_05_secs_key"); _counter = 0; } @@ -1851,7 +1851,7 @@ std::string SpriteFrameTest::subtitle() const void SpriteFrameTest::startIn05Secs(float dt) { unschedule("in_05_secs_key"); - schedule(CC_CALLBACK_1(SpriteFrameTest::flipSprites, this), 1.0f, "flip_sprites_key"); + schedule(AX_CALLBACK_1(SpriteFrameTest::flipSprites, this), 1.0f, "flip_sprites_key"); } void SpriteFrameTest::flipSprites(float dt) @@ -1984,7 +1984,7 @@ void SpriteFramesFromFileContent::onEnter() texture->initWithImage(image); texture->autorelease(); - CC_SAFE_RELEASE(image); + AX_SAFE_RELEASE(image); auto cache = SpriteFrameCache::getInstance(); cache->addSpriteFramesWithFileContent(plist_content, texture); @@ -2449,7 +2449,7 @@ SpriteHybrid::SpriteHybrid() // only show 80% of them for (int i = 0; i < 250; i++) { - int spriteIdx = CCRANDOM_0_1() * 14; + int spriteIdx = AXRANDOM_0_1() * 14; char str[25] = {0}; sprintf(str, "grossini_dance_%02d.png", (spriteIdx + 1)); auto frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(str); @@ -2458,10 +2458,10 @@ SpriteHybrid::SpriteHybrid() float x = -1000; float y = -1000; - if (CCRANDOM_0_1() < 0.2f) + if (AXRANDOM_0_1() < 0.2f) { - x = CCRANDOM_0_1() * s.width; - y = CCRANDOM_0_1() * s.height; + x = AXRANDOM_0_1() * s.width; + y = AXRANDOM_0_1() * s.height; } sprite->setPosition(Vec2(x, y)); @@ -2471,7 +2471,7 @@ SpriteHybrid::SpriteHybrid() _usingSpriteBatchNode = false; - schedule(CC_CALLBACK_1(SpriteHybrid::reparentSprite, this), 2, "reparent_sprite_key"); + schedule(AX_CALLBACK_1(SpriteHybrid::reparentSprite, this), 2, "reparent_sprite_key"); } void SpriteHybrid::reparentSprite(float dt) @@ -2484,7 +2484,7 @@ void SpriteHybrid::reparentSprite(float dt) if (_usingSpriteBatchNode) std::swap(p1, p2); - ////----CCLOG("New parent is: %x", p2); + ////----AXLOG("New parent is: %x", p2); auto& p1Children = p1->getChildren(); for (const auto& node : p1Children) @@ -4285,7 +4285,7 @@ NodeSort::NodeSort() _sprite5->setPosition(Vec2(356.0f, 160.0f)); _node->addChild(_sprite5, -3, 5); - schedule(CC_CALLBACK_1(NodeSort::reorderSprite, this), "reorder_sprite_key"); + schedule(AX_CALLBACK_1(NodeSort::reorderSprite, this), "reorder_sprite_key"); } std::string NodeSort::title() const @@ -4348,7 +4348,7 @@ SpriteBatchNodeReorderSameIndex::SpriteBatchNodeReorderSameIndex() _sprite5->setPosition(Vec2(356.0f, 160.0f)); _batchNode->addChild(_sprite5, 6, 5); - scheduleOnce(CC_CALLBACK_1(SpriteBatchNodeReorderSameIndex::reorderSprite, this), 2, "reorder_sprite_key"); + scheduleOnce(AX_CALLBACK_1(SpriteBatchNodeReorderSameIndex::reorderSprite, this), 2, "reorder_sprite_key"); } std::string SpriteBatchNodeReorderSameIndex::title() const @@ -4444,7 +4444,7 @@ SpriteBatchNodeReorderOneChild::SpriteBatchNodeReorderOneChild() l3b2->setPosition(Vec2(0 + l2bSize.width / 2, +50 + l2bSize.height / 2)); l2b->addChild(l3b2); - scheduleOnce(CC_CALLBACK_1(SpriteBatchNodeReorderOneChild::reorderSprite, this), 2.0f, "reorder_sprite_key"); + scheduleOnce(AX_CALLBACK_1(SpriteBatchNodeReorderOneChild::reorderSprite, this), 2.0f, "reorder_sprite_key"); } void SpriteBatchNodeReorderOneChild::reorderSprite(float dt) @@ -5075,7 +5075,7 @@ SpriteGetSpriteFrameTest::SpriteGetSpriteFrameTest() // Create reference sprite that's rotating based on there anchor point auto s3 = Sprite::createWithSpriteFrameName("grossini.png"); addChild(s3); - s3->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); + s3->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); s3->setPosition(s.width / 2 + s.width / 3, s.height / 2); s3->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s3->setSpriteFrame(s3->getSpriteFrame()); @@ -5317,9 +5317,9 @@ SpriteSlice9Test4::SpriteSlice9Test4() // enable slice 9, only in the first row if (i == 2) { - s1->setCenterRect(CC_RECT_PIXELS_TO_POINTS(Rect(6, 14, 2, 4))); - s2->setCenterRect(CC_RECT_PIXELS_TO_POINTS(Rect(6, 14, 2, 4))); - s3->setCenterRect(CC_RECT_PIXELS_TO_POINTS(Rect(6, 14, 2, 4))); + s1->setCenterRect(AX_RECT_PIXELS_TO_POINTS(Rect(6, 14, 2, 4))); + s2->setCenterRect(AX_RECT_PIXELS_TO_POINTS(Rect(6, 14, 2, 4))); + s3->setCenterRect(AX_RECT_PIXELS_TO_POINTS(Rect(6, 14, 2, 4))); } // "anchor points" @@ -5356,7 +5356,7 @@ SpriteSlice9Test5::SpriteSlice9Test5() auto s1 = Sprite::create("Images/grossinis_heads.png"); addChild(s1); s1->getTexture()->setAliasTexParameters(); - s1->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); + s1->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); s1->setPosition(s.width / 2 - s.width / 3, s.height / 2); s1->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s1->setContentSize(Size(s.width / 3, s.height)); @@ -5366,7 +5366,7 @@ SpriteSlice9Test5::SpriteSlice9Test5() // Create reference sprite that's rotating based on there anchor point auto s2 = Sprite::create("Images/grossinis_heads.png"); addChild(s2); - s2->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); + s2->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); s2->setPosition(s.width * 2 / 4, s.height / 2); s2->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s2->setContentSize(Size(s.width / 3, s.height)); @@ -5376,7 +5376,7 @@ SpriteSlice9Test5::SpriteSlice9Test5() // Create reference sprite that's rotating based on there anchor point auto s3 = Sprite::create("Images/grossinis_heads.png"); addChild(s3); - s3->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); + s3->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); s3->setPosition(s.width / 2 + s.width / 3, s.height / 2); s3->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s3->setContentSize(Size(s.width / 3, s.height)); @@ -5432,7 +5432,7 @@ SpriteSlice9Test6::SpriteSlice9Test6() auto s1 = Sprite::create("Images/grossinis_heads.png"); addChild(s1); s1->getTexture()->setAliasTexParameters(); - s1->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); + s1->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); s1->setPosition(s.width / 2 - s.width / 3, s.height / 2); s1->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s1->setContentSize(Size(s.width / 3, s.height)); @@ -5442,7 +5442,7 @@ SpriteSlice9Test6::SpriteSlice9Test6() // Create reference sprite that's rotating based on there anchor point auto s2 = Sprite::create("Images/grossinis_heads.png"); addChild(s2); - s2->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); + s2->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); s2->setPosition(s.width * 2 / 4, s.height / 2); s2->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s2->setContentSize(Size(s.width / 3, s.height)); @@ -5452,7 +5452,7 @@ SpriteSlice9Test6::SpriteSlice9Test6() // Create reference sprite that's rotating based on there anchor point auto s3 = Sprite::create("Images/grossinis_heads.png"); addChild(s3); - s3->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); + s3->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); s3->setPosition(s.width / 2 + s.width / 3, s.height / 2); s3->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s3->setContentSize(Size(s.width / 3, s.height)); @@ -5508,7 +5508,7 @@ SpriteSlice9Test7::SpriteSlice9Test7() auto s1 = Sprite::create("Images/grossinis_heads.png"); addChild(s1); s1->getTexture()->setAliasTexParameters(); - s1->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); + s1->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); s1->setPosition(s.width / 2 - s.width / 3, s.height / 2); s1->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s1->setContentSize(Size(s.width / 3, s.height)); @@ -5517,7 +5517,7 @@ SpriteSlice9Test7::SpriteSlice9Test7() // Create reference sprite that's rotating based on there anchor point auto s2 = Sprite::create("Images/grossinis_heads.png"); addChild(s2); - s2->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); + s2->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); s2->setPosition(s.width * 2 / 4, s.height / 2); s2->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s2->setContentSize(Size(s.width / 3, s.height)); @@ -5526,7 +5526,7 @@ SpriteSlice9Test7::SpriteSlice9Test7() // Create reference sprite that's rotating based on there anchor point auto s3 = Sprite::create("Images/grossinis_heads.png"); addChild(s3); - s3->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); + s3->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); s3->setPosition(s.width / 2 + s.width / 3, s.height / 2); s3->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s3->setContentSize(Size(s.width / 3, s.height)); diff --git a/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp b/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp index 93613aa65d..a5f1b0fed2 100644 --- a/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp +++ b/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp @@ -58,7 +58,7 @@ TerrainSimple::TerrainSimple() _terrain->setCameraMask(2); _terrain->setDrawWire(false); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(TerrainSimple::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(TerrainSimple::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // add Particle3D for test blend auto rootps = PUParticleSystem3D::create("Particle3D/scripts/mp_torch.pu"); @@ -113,8 +113,8 @@ std::string TerrainWalkThru::subtitle() const TerrainWalkThru::TerrainWalkThru() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(TerrainWalkThru::onTouchesBegan, this); - listener->onTouchesEnded = CC_CALLBACK_2(TerrainWalkThru::onTouchesEnd, this); + listener->onTouchesBegan = AX_CALLBACK_2(TerrainWalkThru::onTouchesBegan, this); + listener->onTouchesEnded = AX_CALLBACK_2(TerrainWalkThru::onTouchesEnd, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); Size visibleSize = Director::getInstance()->getVisibleSize(); @@ -334,7 +334,7 @@ Player* Player::create(const char* file, Camera* cam, Terrain* terrain) player->scheduleUpdate(); return player; } - CC_SAFE_DELETE(player); + AX_SAFE_DELETE(player); return nullptr; } @@ -361,7 +361,7 @@ TerrainWithLightMap::TerrainWithLightMap() _terrain->setDrawWire(false); _terrain->setLightMap("TerrainTest/Lightmap.png"); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(TerrainWithLightMap::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(TerrainWithLightMap::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } std::string TerrainWithLightMap::title() const diff --git a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp index 8efaf45fca..41cde7f4a7 100644 --- a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp +++ b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp @@ -60,14 +60,14 @@ KeyboardNotificationLayer::KeyboardNotificationLayer() : _trackNode(0) { // Register Touch Event auto listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = CC_CALLBACK_2(KeyboardNotificationLayer::onTouchBegan, this); - listener->onTouchEnded = CC_CALLBACK_2(KeyboardNotificationLayer::onTouchEnded, this); + listener->onTouchBegan = AX_CALLBACK_2(KeyboardNotificationLayer::onTouchBegan, this); + listener->onTouchEnded = AX_CALLBACK_2(KeyboardNotificationLayer::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } void KeyboardNotificationLayer::keyboardWillShow(IMEKeyboardNotificationInfo& info) { - CCLOG("TextInputTest:keyboardWillShowAt(origin:%f,%f, size:%f,%f)", info.end.origin.x, info.end.origin.y, + AXLOG("TextInputTest:keyboardWillShowAt(origin:%f,%f, size:%f,%f)", info.end.origin.x, info.end.origin.y, info.end.size.width, info.end.size.height); if (!_trackNode) @@ -76,7 +76,7 @@ void KeyboardNotificationLayer::keyboardWillShow(IMEKeyboardNotificationInfo& in } auto rectTracked = getRect(_trackNode); - CCLOG("TextInputTest:trackingNodeAt(origin:%f,%f, size:%f,%f)", rectTracked.origin.x, rectTracked.origin.y, + AXLOG("TextInputTest:trackingNodeAt(origin:%f,%f, size:%f,%f)", rectTracked.origin.x, rectTracked.origin.y, rectTracked.size.width, rectTracked.size.height); // if the keyboard area doesn't intersect with the tracking node area, nothing need to do. @@ -87,7 +87,7 @@ void KeyboardNotificationLayer::keyboardWillShow(IMEKeyboardNotificationInfo& in // assume keyboard at the bottom of screen, calculate the vertical adjustment. float adjustVert = info.end.getMaxY() - rectTracked.getMinY(); - CCLOG("TextInputTest:needAdjustVerticalPosition(%f)", adjustVert); + AXLOG("TextInputTest:needAdjustVerticalPosition(%f)", adjustVert); // move all the children node of KeyboardNotificationLayer auto& children = getChildren(); @@ -107,7 +107,7 @@ void KeyboardNotificationLayer::keyboardWillShow(IMEKeyboardNotificationInfo& in bool KeyboardNotificationLayer::onTouchBegan(Touch* touch, Event* event) { - CCLOG("++++++++++++++++++++++++++++++++++++++++++++"); + AXLOG("++++++++++++++++++++++++++++++++++++++++++++"); _beginPos = touch->getLocation(); return true; } @@ -135,7 +135,7 @@ void KeyboardNotificationLayer::onTouchEnded(Touch* touch, Event* event) auto clicked = isScreenPointInRect(endPos, Camera::getVisitingCamera(), _trackNode->getWorldToNodeTransform(), rect, nullptr); this->onClickTrackNode(clicked, endPos); - CCLOG("----------------------------------"); + AXLOG("----------------------------------"); } ////////////////////////////////////////////////////////////////////////// @@ -153,13 +153,13 @@ void TextFieldTTFDefaultTest::onClickTrackNode(bool bClicked, const Vec2& touchP if (bClicked) { // TextFieldTTFTest be clicked - CCLOG("TextFieldTTFDefaultTest:TextFieldTTF attachWithIME"); + AXLOG("TextFieldTTFDefaultTest:TextFieldTTF attachWithIME"); pTextField->attachWithIME(); } else { // TextFieldTTFTest not be clicked - CCLOG("TextFieldTTFDefaultTest:TextFieldTTF detachWithIME"); + AXLOG("TextFieldTTFDefaultTest:TextFieldTTF detachWithIME"); pTextField->detachWithIME(); } } @@ -174,7 +174,7 @@ void TextFieldTTFDefaultTest::onEnter() auto pTextField = TextFieldTTF::textFieldWithPlaceHolder("", FONT_NAME, FONT_SIZE); addChild(pTextField); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) // on android, TextFieldTTF cannot auto adjust its position when soft-keyboard pop up // so we had to set a higher position to make it visible pTextField->setPosition(Vec2(s.width / 2, s.height / 2 + 50)); @@ -200,13 +200,13 @@ void TextFieldTTFActionTest::onClickTrackNode(bool bClicked, const Vec2& touchPo if (bClicked) { // TextFieldTTFTest be clicked - CCLOG("TextFieldTTFActionTest:TextFieldTTF attachWithIME"); + AXLOG("TextFieldTTFActionTest:TextFieldTTF attachWithIME"); pTextField->attachWithIME(); } else { // TextFieldTTFTest not be clicked - CCLOG("TextFieldTTFActionTest:TextFieldTTF detachWithIME"); + AXLOG("TextFieldTTFActionTest:TextFieldTTF detachWithIME"); pTextField->detachWithIME(); } } @@ -229,7 +229,7 @@ void TextFieldTTFActionTest::onEnter() _textField->setDelegate(this); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) // on android, TextFieldTTF cannot auto adjust its position when soft-keyboard pop up // so we had to set a higher position _textField->setPosition(Vec2(s.width / 2, s.height / 2 + 50)); @@ -304,7 +304,7 @@ bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF* sender, const c auto seq = Sequence::create( Spawn::create(MoveTo::create(duration, endPos), ScaleTo::create(duration, 1), FadeOut::create(duration), nullptr), - CallFuncN::create(CC_CALLBACK_1(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction, this)), nullptr); + CallFuncN::create(AX_CALLBACK_1(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction, this)), nullptr); label->runAction(seq); return false; } @@ -333,7 +333,7 @@ bool TextFieldTTFActionTest::onTextFieldDeleteBackward(TextFieldTTF* sender, con Spawn::create(MoveTo::create(duration, endPos), Repeat::create(RotateBy::create(rotateDuration, (rand() % 2) ? 360 : -360), repeatTime), FadeOut::create(duration), nullptr), - CallFuncN::create(CC_CALLBACK_1(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction, this)), nullptr); + CallFuncN::create(AX_CALLBACK_1(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction, this)), nullptr); label->runAction(seq); return false; } @@ -367,7 +367,7 @@ void TextFieldTTFSecureTextEntryTest::onEnter() auto pTextField = TextFieldTTF::textFieldWithPlaceHolder("", FONT_NAME, FONT_SIZE); addChild(pTextField); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) // on android, TextFieldTTF cannot auto adjust its position when soft-keyboard pop up // so we had to set a higher position to make it visible pTextField->setPosition(Vec2(s.width / 2, s.height / 2 + 50)); @@ -394,7 +394,7 @@ void TextFieldTTSetCursorFromPoint::onClickTrackNode(bool bClicked, const Vec2& if (bClicked) { // TextFieldTTFTest be clicked - CCLOG("TextFieldTTSetCursorFromPoint:TextFieldTTF attachWithIME"); + AXLOG("TextFieldTTSetCursorFromPoint:TextFieldTTF attachWithIME"); pTextField->attachWithIME(); // Set new position cursor @@ -403,7 +403,7 @@ void TextFieldTTSetCursorFromPoint::onClickTrackNode(bool bClicked, const Vec2& else { // TextFieldTTFTest not be clicked - CCLOG("TextFieldTTSetCursorFromPoint:TextFieldTTF detachWithIME"); + AXLOG("TextFieldTTSetCursorFromPoint:TextFieldTTF detachWithIME"); pTextField->detachWithIME(); } } @@ -418,7 +418,7 @@ void TextFieldTTSetCursorFromPoint::onEnter() auto pTextField = TextFieldTTF::textFieldWithPlaceHolder("", FONT_NAME, FONT_SIZE); addChild(pTextField); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) // on android, TextFieldTTF cannot auto adjust its position when soft-keyboard pop up // so we had to set a higher position to make it visible pTextField->setPosition(Vec2(s.width / 2, s.height / 2 + 50)); diff --git a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp index 1fb9c1766d..fd11278b19 100644 --- a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp +++ b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp @@ -188,7 +188,7 @@ std::string TextureASTC::title() const TextureETC1Alpha::TextureETC1Alpha() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(TextureETC1Alpha::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(TextureETC1Alpha::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -222,7 +222,7 @@ void TextureETC1Alpha::addNewSpriteWithCoords(Vec2 p) sprite->setPosition(Vec2(p.x, p.y)); ActionInterval* action; - float random = CCRANDOM_0_1(); + float random = AXRANDOM_0_1(); if (random < 0.20) action = ScaleBy::create(3, 2); @@ -269,7 +269,7 @@ std::string TextureETC1Alpha::subtitle() const TextureETC2::TextureETC2() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(TextureETC2::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(TextureETC2::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -332,7 +332,7 @@ std::string TextureETC2::subtitle() const TextureBMP::TextureBMP() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(TextureBMP::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(TextureBMP::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -341,7 +341,7 @@ TextureBMP::TextureBMP() void TextureBMP::addNewSpriteWithCoords(Vec2 p) { - int idx = (int)(CCRANDOM_0_1() * 1400.0f / 100.0f); + int idx = (int)(AXRANDOM_0_1() * 1400.0f / 100.0f); int x = (idx % 5) * 85; int y = (idx / 5) * 121; @@ -351,7 +351,7 @@ void TextureBMP::addNewSpriteWithCoords(Vec2 p) sprite->setPosition(Vec2(p.x, p.y)); ActionInterval* action; - float random = CCRANDOM_0_1(); + float random = AXRANDOM_0_1(); if (random < 0.20) action = ScaleBy::create(3, 2); @@ -875,7 +875,7 @@ void TexturePVRRGBA4444GZ::onEnter() TextureDemo::onEnter(); auto s = Director::getInstance()->getWinSize(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) // android can not pack .gz file into apk file auto img = Sprite::create("Images/test_image_rgba4444.pvr"); #else @@ -1739,7 +1739,7 @@ void TextureAsync::onEnter() auto seq = Sequence::create(scale, scale_back, nullptr); label->runAction(RepeatForever::create(seq)); - scheduleOnce(CC_SCHEDULE_SELECTOR(TextureAsync::loadImages), 1.0f); + scheduleOnce(AX_SCHEDULE_SELECTOR(TextureAsync::loadImages), 1.0f); } TextureAsync::~TextureAsync() @@ -1758,22 +1758,22 @@ void TextureAsync::loadImages(float dt) { char szSpriteName[100] = {0}; sprintf(szSpriteName, "Images/sprites_test/sprite-%d-%d.png", i, j); - textureCache->addImageAsync(szSpriteName, CC_CALLBACK_1(TextureAsync::imageLoaded, this)); + textureCache->addImageAsync(szSpriteName, AX_CALLBACK_1(TextureAsync::imageLoaded, this)); } } - textureCache->addImageAsync("Images/background1.jpg", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); - textureCache->addImageAsync("Images/background2.jpg", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); - textureCache->addImageAsync("Images/background.png", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); - textureCache->addImageAsync("Images/atlastest.png", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); - textureCache->addImageAsync("Images/grossini_dance_atlas.png", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); + textureCache->addImageAsync("Images/background1.jpg", AX_CALLBACK_1(TextureAsync::imageLoaded, this)); + textureCache->addImageAsync("Images/background2.jpg", AX_CALLBACK_1(TextureAsync::imageLoaded, this)); + textureCache->addImageAsync("Images/background.png", AX_CALLBACK_1(TextureAsync::imageLoaded, this)); + textureCache->addImageAsync("Images/atlastest.png", AX_CALLBACK_1(TextureAsync::imageLoaded, this)); + textureCache->addImageAsync("Images/grossini_dance_atlas.png", AX_CALLBACK_1(TextureAsync::imageLoaded, this)); } void TextureAsync::imageLoaded(Texture2D* texture) { auto director = Director::getInstance(); - // CCASSERT( [NSThread currentThread] == [director runningThread], @"FAIL. Callback should be on cocos2d thread"); + // AXASSERT( [NSThread currentThread] == [director runningThread], @"FAIL. Callback should be on cocos2d thread"); // IMPORTANT: The order on the callback is not guaranteed. Don't depend on the callback @@ -2019,7 +2019,7 @@ void TextureDrawAtPoint::draw(Renderer* renderer, const Mat4& transform, uint32_ void TextureDrawAtPoint::onDraw(const Mat4& transform, uint32_t flags) { Director* director = Director::getInstance(); - 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, transform); @@ -2058,7 +2058,7 @@ void TextureDrawInRect::draw(Renderer* renderer, const Mat4& transform, uint32_t void TextureDrawInRect::onDraw(const Mat4& transform, uint32_t flags) { Director* director = Director::getInstance(); - 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, transform); @@ -2096,19 +2096,19 @@ void TextureMemoryAlloc::onEnter() MenuItemFont::setFontSize(24); - auto item1 = MenuItemFont::create("PNG", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item1 = MenuItemFont::create("PNG", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item1->setTag(0); - auto item2 = MenuItemFont::create("RGBA8", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item2 = MenuItemFont::create("RGBA8", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item2->setTag(1); - auto item3 = MenuItemFont::create("RGB8", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item3 = MenuItemFont::create("RGB8", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item3->setTag(2); - auto item4 = MenuItemFont::create("RGBA4", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item4 = MenuItemFont::create("RGBA4", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item4->setTag(3); - auto item5 = MenuItemFont::create("A8", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item5 = MenuItemFont::create("A8", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item5->setTag(4); auto menu = Menu::create(item1, item2, item3, item4, item5, nullptr); @@ -2117,7 +2117,7 @@ void TextureMemoryAlloc::onEnter() addChild(menu); auto warmup = - MenuItemFont::create("warm up texture", CC_CALLBACK_1(TextureMemoryAlloc::changeBackgroundVisible, this)); + MenuItemFont::create("warm up texture", AX_CALLBACK_1(TextureMemoryAlloc::changeBackgroundVisible, this)); auto menu2 = Menu::create(warmup, nullptr); diff --git a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp index 97070a63bb..af64d60eef 100644 --- a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp +++ b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp @@ -47,45 +47,45 @@ TextureCacheTest::TextureCacheTest() : _numberOfSprites(20), _numberOfLoadedSpri // load textures Director::getInstance()->getTextureCache()->addImageAsync("Images/HelloWorld.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_01.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_02.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_03.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_04.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_05.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_06.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_07.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_08.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_09.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_10.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_11.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_12.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_13.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_14.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/background1.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/background2.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/background3.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/blocks.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); } void TextureCacheTest::loadingCallBack(axis::Texture2D* texture) @@ -187,9 +187,9 @@ TextureCacheUnbindTest::TextureCacheUnbindTest() cache->removeTextureForKey("Images/texture2048x2048.png"); - cache->addImageAsync("Images/texture2048x2048.png", CC_CALLBACK_1(TextureCacheUnbindTest::textureLoadedA, this), + cache->addImageAsync("Images/texture2048x2048.png", AX_CALLBACK_1(TextureCacheUnbindTest::textureLoadedA, this), "A"); - cache->addImageAsync("Images/texture2048x2048.png", CC_CALLBACK_1(TextureCacheUnbindTest::textureLoadedB, this), + cache->addImageAsync("Images/texture2048x2048.png", AX_CALLBACK_1(TextureCacheUnbindTest::textureLoadedB, this), "B"); cache->unbindImageAsync("A"); } diff --git a/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp b/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp index 10b55810d5..e2a289dda2 100644 --- a/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp +++ b/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp @@ -78,7 +78,7 @@ TileDemoNew::TileDemoNew() Director::getInstance()->getRenderer()->setDepthWrite(true); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(TileDemoNew::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(TileDemoNew::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -122,8 +122,8 @@ TileMapTestNew::TileMapTestNew() // Convert it to "alias" (GL_LINEAR filtering) map->getTexture()->setAntiAliasTexParameters(); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); // If you are not going to use the Map, you can free it now // NEW since v0.7 @@ -157,13 +157,13 @@ TileMapEditTestNew::TileMapEditTestNew() // Create an Aliased Atlas map->getTexture()->setAliasTexParameters(); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); // If you are not going to use the Map, you can free it now // [tilemap releaseMap); // And if you are going to use, it you can access the data with: - schedule(CC_SCHEDULE_SELECTOR(TileMapEditTestNew::updateMap), 0.2f); + schedule(AX_SCHEDULE_SELECTOR(TileMapEditTestNew::updateMap), 0.2f); addChild(map, 0, kTagTileMap); @@ -187,7 +187,7 @@ void TileMapEditTestNew::updateMap(float dt) // for(int y=0; y < tilemap.tgaInfo->height; y++) { // Color3B c =[tilemap tileAt:Size(x,y)); // if( c.r != 0 ) { - // ////----CCLOG("%d,%d = %d", x,y,c.r); + // ////----AXLOG("%d,%d = %d", x,y,c.r); // } // } // } @@ -227,8 +227,8 @@ TMXOrthoTestNew::TMXOrthoTestNew() addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); auto scale = ScaleBy::create(10, 0.1f); auto back = scale->reverse(); @@ -269,8 +269,8 @@ TMXOrthoTest2New::TMXOrthoTest2New() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test1.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); map->runAction(ScaleBy::create(2, 0.5f)); } @@ -290,8 +290,8 @@ TMXOrthoTest3New::TMXOrthoTest3New() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test3.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); map->setScale(0.2f); map->setAnchorPoint(Vec2(0.5f, 0.5f)); @@ -312,8 +312,8 @@ TMXOrthoTest4New::TMXOrthoTest4New() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test4.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s1 = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s1.width, s1.height); + Size AX_UNUSED s1 = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s1.width, s1.height); map->setAnchorPoint(Vec2(0.0f, 0.0f)); @@ -330,12 +330,12 @@ TMXOrthoTest4New::TMXOrthoTest4New() sprite = layer->getTileAt(Vec2(s.width - 1, s.height - 1)); sprite->setScale(2); - schedule(CC_SCHEDULE_SELECTOR(TMXOrthoTest4New::removeSprite), 2); + schedule(AX_SCHEDULE_SELECTOR(TMXOrthoTest4New::removeSprite), 2); } void TMXOrthoTest4New::removeSprite(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(TMXOrthoTest4New::removeSprite)); + unschedule(AX_SCHEDULE_SELECTOR(TMXOrthoTest4New::removeSprite)); auto map = static_cast(getChildByTag(kTagTileMap)); auto layer = map->getLayer("Layer 0"); @@ -373,8 +373,8 @@ TMXReadWriteTestNew::TMXReadWriteTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test2.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); auto layer = map->getLayer("Layer 0"); @@ -395,7 +395,7 @@ TMXReadWriteTestNew::TMXReadWriteTestNew() auto opacity = FadeOut::create(2); auto fadein = FadeIn::create(2); auto scaleback = ScaleTo::create(1, 1); - auto finish = CallFuncN::create(CC_CALLBACK_1(TMXReadWriteTestNew::removeSprite, this)); + auto finish = CallFuncN::create(AX_CALLBACK_1(TMXReadWriteTestNew::removeSprite, this)); auto seq0 = Sequence::create(move, rotate, scale, opacity, fadein, scaleback, finish, nullptr); auto seq1 = seq0->clone(); auto seq2 = seq0->clone(); @@ -407,21 +407,21 @@ TMXReadWriteTestNew::TMXReadWriteTestNew() tile3->runAction(seq3); _gid = layer->getTileGIDAt(Vec2(0, 63)); - ////----CCLOG("Tile GID at:(0,63) is: %d", _gid); + ////----AXLOG("Tile GID at:(0,63) is: %d", _gid); - schedule(CC_SCHEDULE_SELECTOR(TMXReadWriteTestNew::updateCol), 2.0f); - schedule(CC_SCHEDULE_SELECTOR(TMXReadWriteTestNew::repaintWithGID), 2.05f); - schedule(CC_SCHEDULE_SELECTOR(TMXReadWriteTestNew::removeTiles), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(TMXReadWriteTestNew::updateCol), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(TMXReadWriteTestNew::repaintWithGID), 2.05f); + schedule(AX_SCHEDULE_SELECTOR(TMXReadWriteTestNew::removeTiles), 1.0f); - ////----CCLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads()); - ////----CCLOG("++++children: %d", layer->getChildren()->count() ); + ////----AXLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads()); + ////----AXLOG("++++children: %d", layer->getChildren()->count() ); _gid2 = 0; } void TMXReadWriteTestNew::removeSprite(Node* sender) { - ////----CCLOG("removing tile: %x", sender); + ////----AXLOG("removing tile: %x", sender); auto p = ((Node*)sender)->getParent(); if (p) @@ -429,7 +429,7 @@ void TMXReadWriteTestNew::removeSprite(Node* sender) p->removeChild((Node*)sender, true); } - //////----CCLOG("atlas quantity: %d", p->textureAtlas()->totalQuads()); + //////----AXLOG("atlas quantity: %d", p->textureAtlas()->totalQuads()); } void TMXReadWriteTestNew::updateCol(float dt) @@ -437,8 +437,8 @@ void TMXReadWriteTestNew::updateCol(float dt) auto map = (axis::FastTMXTiledMap*)getChildByTag(kTagTileMap); auto layer = (axis::FastTMXLayer*)map->getChildByTag(0); - ////----CCLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads()); - ////----CCLOG("++++children: %d", layer->getChildren()->count() ); + ////----AXLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads()); + ////----AXLOG("++++children: %d", layer->getChildren()->count() ); auto s = layer->getLayerSize(); @@ -468,7 +468,7 @@ void TMXReadWriteTestNew::repaintWithGID(float dt) void TMXReadWriteTestNew::removeTiles(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(TMXReadWriteTestNew::removeTiles)); + unschedule(AX_SCHEDULE_SELECTOR(TMXReadWriteTestNew::removeTiles)); auto map = (axis::FastTMXTiledMap*)getChildByTag(kTagTileMap); auto layer = (axis::FastTMXLayer*)map->getChildByTag(0); @@ -498,8 +498,8 @@ TMXHexTestNew::TMXHexTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/hexa-test.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); } std::string TMXHexTestNew::title() const @@ -544,8 +544,8 @@ TMXIsoTest1New::TMXIsoTest1New() auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test1.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); map->setAnchorPoint(Vec2(0.5f, 0.5f)); } @@ -568,8 +568,8 @@ TMXIsoTest2New::TMXIsoTest2New() auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test2.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); // move map to the center of the screen auto ms = map->getMapSize(); @@ -595,8 +595,8 @@ TMXUncompressedTestNew::TMXUncompressedTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test2-uncompressed.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); // move map to the center of the screen auto ms = map->getMapSize(); @@ -629,8 +629,8 @@ TMXTilesetTestNew::TMXTilesetTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test5.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); } std::string TMXTilesetTestNew::title() const @@ -648,14 +648,14 @@ TMXOrthoObjectsTestNew::TMXOrthoObjectsTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/ortho-objects.tmx"); addChild(map, -1, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); auto group = map->getObjectGroup("Object Group 1"); auto& objects = group->getObjects(); Value objectsVal = Value(objects); - CCLOG("%s", objectsVal.getDescription().c_str()); + AXLOG("%s", objectsVal.getDescription().c_str()); auto drawNode = DrawNode::create(); Color4F color(1.0, 1.0, 1.0, 1.0); @@ -697,15 +697,15 @@ TMXIsoObjectsTestNew::TMXIsoObjectsTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test-objectgroup.tmx"); addChild(map, -1, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); auto group = map->getObjectGroup("Object Group 1"); auto& objects = group->getObjects(); Value objectsVal = Value(objects); - CCLOG("%s", objectsVal.getDescription().c_str()); + AXLOG("%s", objectsVal.getDescription().c_str()); auto drawNode = DrawNode::create(); Color4F color(1.0, 1.0, 1.0, 1.0); @@ -747,8 +747,8 @@ TMXResizeTestNew::TMXResizeTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test5.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); axis::FastTMXLayer* layer; layer = map->getLayer("Layer 0"); @@ -785,14 +785,14 @@ TMXIsoZorderNew::TMXIsoZorderNew() addChild(map, 0, kTagTileMap); auto s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + AXLOG("ContentSize: %f, %f", s.width, s.height); map->setPosition(Vec2(-s.width / 2, 0.0f)); _tamara = Sprite::create(s_pathSister1); map->addChild(_tamara, (int)map->getChildren().size()); _tamara->retain(); int mapWidth = map->getMapSize().width * map->getTileSize().width; - _tamara->setPosition(CC_POINT_PIXELS_TO_POINTS(Vec2(mapWidth / 2.0f, 0.0f))); + _tamara->setPosition(AX_POINT_PIXELS_TO_POINTS(Vec2(mapWidth / 2.0f, 0.0f))); _tamara->setAnchorPoint(Vec2(0.5f, 0.0f)); auto move = MoveBy::create(10, Vec2(300.0f, 250.0f)); @@ -800,7 +800,7 @@ TMXIsoZorderNew::TMXIsoZorderNew() auto seq = Sequence::create(move, back, nullptr); _tamara->runAction(RepeatForever::create(seq)); - schedule(CC_SCHEDULE_SELECTOR(TMXIsoZorderNew::repositionSprite)); + schedule(AX_SCHEDULE_SELECTOR(TMXIsoZorderNew::repositionSprite)); } TMXIsoZorderNew::~TMXIsoZorderNew() @@ -810,14 +810,14 @@ TMXIsoZorderNew::~TMXIsoZorderNew() void TMXIsoZorderNew::onExit() { - unschedule(CC_SCHEDULE_SELECTOR(TMXIsoZorderNew::repositionSprite)); + unschedule(AX_SCHEDULE_SELECTOR(TMXIsoZorderNew::repositionSprite)); TileDemoNew::onExit(); } void TMXIsoZorderNew::repositionSprite(float dt) { auto p = _tamara->getPosition(); - p = CC_POINT_POINTS_TO_PIXELS(p); + p = AX_POINT_POINTS_TO_PIXELS(p); auto map = getChildByTag(kTagTileMap); // there are only 4 layers. (grass and 3 trees layers) @@ -851,8 +851,8 @@ TMXOrthoZorderNew::TMXOrthoZorderNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test-zorder.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); _tamara = Sprite::create(s_pathSister1); map->addChild(_tamara, (int)map->getChildren().size()); @@ -864,7 +864,7 @@ TMXOrthoZorderNew::TMXOrthoZorderNew() auto seq = Sequence::create(move, back, nullptr); _tamara->runAction(RepeatForever::create(seq)); - schedule(CC_SCHEDULE_SELECTOR(TMXOrthoZorderNew::repositionSprite)); + schedule(AX_SCHEDULE_SELECTOR(TMXOrthoZorderNew::repositionSprite)); } TMXOrthoZorderNew::~TMXOrthoZorderNew() @@ -875,7 +875,7 @@ TMXOrthoZorderNew::~TMXOrthoZorderNew() void TMXOrthoZorderNew::repositionSprite(float dt) { auto p = _tamara->getPosition(); - p = CC_POINT_POINTS_TO_PIXELS(p); + p = AX_POINT_POINTS_TO_PIXELS(p); auto map = getChildByTag(kTagTileMap); // there are only 4 layers. (grass and 3 trees layers) @@ -912,7 +912,7 @@ TMXIsoVertexZNew::TMXIsoVertexZNew() auto s = map->getContentSize(); map->setPosition(Vec2(-s.width / 2, 0.0f)); - CCLOG("ContentSize: %f, %f", s.width, s.height); + AXLOG("ContentSize: %f, %f", s.width, s.height); // because I'm lazy, I'm reusing a tile as an sprite, but since this method uses vertexZ, you // can use any Sprite and it will work OK. @@ -920,12 +920,12 @@ TMXIsoVertexZNew::TMXIsoVertexZNew() _tamara = layer->getTileAt(Vec2(29.0f, 29.0f)); _tamara->retain(); - auto move = MoveBy::create(10, Vec2(300, 250) * (1 / CC_CONTENT_SCALE_FACTOR())); + auto move = MoveBy::create(10, Vec2(300, 250) * (1 / AX_CONTENT_SCALE_FACTOR())); auto back = move->reverse(); auto seq = Sequence::create(move, back, nullptr); _tamara->runAction(RepeatForever::create(seq)); - schedule(CC_SCHEDULE_SELECTOR(TMXIsoVertexZNew::repositionSprite)); + schedule(AX_SCHEDULE_SELECTOR(TMXIsoVertexZNew::repositionSprite)); } TMXIsoVertexZNew::~TMXIsoVertexZNew() @@ -938,7 +938,7 @@ void TMXIsoVertexZNew::repositionSprite(float dt) // tile height is 64x32 // map size: 30x30 auto p = _tamara->getPosition(); - p = CC_POINT_POINTS_TO_PIXELS(p); + p = AX_POINT_POINTS_TO_PIXELS(p); float newZ = -(p.y + 32) / 16; _tamara->setPositionZ(newZ); } @@ -982,22 +982,22 @@ TMXOrthoVertexZNew::TMXOrthoVertexZNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test-vertexz.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); // because I'm lazy, I'm reusing a tile as an sprite, but since this method uses vertexZ, you // can use any Sprite and it will work OK. auto layer = map->getLayer("trees"); _tamara = layer->getTileAt(Vec2(0, 11)); - CCLOG("%p vertexZ: %f", _tamara, _tamara->getPositionZ()); + AXLOG("%p vertexZ: %f", _tamara, _tamara->getPositionZ()); _tamara->retain(); - auto move = MoveBy::create(10, Vec2(400, 450) * (1 / CC_CONTENT_SCALE_FACTOR())); + auto move = MoveBy::create(10, Vec2(400, 450) * (1 / AX_CONTENT_SCALE_FACTOR())); auto back = move->reverse(); auto seq = Sequence::create(move, back, nullptr); _tamara->runAction(RepeatForever::create(seq)); - schedule(CC_SCHEDULE_SELECTOR(TMXOrthoVertexZNew::repositionSprite)); + schedule(AX_SCHEDULE_SELECTOR(TMXOrthoVertexZNew::repositionSprite)); } TMXOrthoVertexZNew::~TMXOrthoVertexZNew() @@ -1010,7 +1010,7 @@ void TMXOrthoVertexZNew::repositionSprite(float dt) // tile height is 101x81 // map size: 12x12 auto p = _tamara->getPosition(); - p = CC_POINT_POINTS_TO_PIXELS(p); + p = AX_POINT_POINTS_TO_PIXELS(p); _tamara->setPositionZ(-((p.y + 81) / 81)); } @@ -1055,8 +1055,8 @@ TMXIsoMoveLayerNew::TMXIsoMoveLayerNew() map->setPosition(Vec2(-700.0f, -50.0f)); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); } std::string TMXIsoMoveLayerNew::title() const @@ -1079,8 +1079,8 @@ TMXOrthoMoveLayerNew::TMXOrthoMoveLayerNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test-movelayer.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); } std::string TMXOrthoMoveLayerNew::title() const @@ -1134,7 +1134,7 @@ TMXOrthoFlipTestNew::TMXOrthoFlipTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/ortho-rotation-test.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); + Size AX_UNUSED s = map->getContentSize(); log("ContentSize: %f, %f", s.width, s.height); auto action = ScaleBy::create(2, 0.5f); @@ -1163,7 +1163,7 @@ TMXOrthoFlipRunTimeTestNew::TMXOrthoFlipRunTimeTestNew() auto action = ScaleBy::create(2, 0.5f); map->runAction(action); - schedule(CC_SCHEDULE_SELECTOR(TMXOrthoFlipRunTimeTestNew::flipIt), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(TMXOrthoFlipRunTimeTestNew::flipIt), 1.0f); } std::string TMXOrthoFlipRunTimeTestNew::title() const @@ -1280,8 +1280,8 @@ TMXBug987New::TMXBug987New() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test6.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s1 = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s1.width, s1.height); + Size AX_UNUSED s1 = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s1.width, s1.height); map->setAnchorPoint(Vec2(0.0f, 0.0f)); auto layer = map->getLayer("Tile Layer 1"); @@ -1331,10 +1331,10 @@ TMXGIDObjectsTestNew::TMXGIDObjectsTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/test-object-layer.tmx"); addChild(map, -1, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("Contentsize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("Contentsize: %f, %f", s.width, s.height); - CCLOG("----> Iterating over all the group objects"); + AXLOG("----> Iterating over all the group objects"); auto drawNode = DrawNode::create(); Color4F color(1.0, 1.0, 1.0, 1.0); @@ -1379,11 +1379,11 @@ TileAnimTestNew::TileAnimTestNew() addChild(map, 0, kTagTileMap); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(TileAnimTestNew::onTouchBegan, this); + listener->onTouchesBegan = AX_CALLBACK_2(TileAnimTestNew::onTouchBegan, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); - Size CC_UNUSED s = map->getContentSize(); - CCLOG("ContentSize: %f, %f", s.width, s.height); + Size AX_UNUSED s = map->getContentSize(); + AXLOG("ContentSize: %f, %f", s.width, s.height); map->setTileAnimEnabled(_animStarted); } diff --git a/tests/cpp-tests/Classes/TouchesTest/Paddle.cpp b/tests/cpp-tests/Classes/TouchesTest/Paddle.cpp index 1dde9bc49d..cd10c7a2d2 100644 --- a/tests/cpp-tests/Classes/TouchesTest/Paddle.cpp +++ b/tests/cpp-tests/Classes/TouchesTest/Paddle.cpp @@ -63,9 +63,9 @@ void Paddle::onEnter() auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - listener->onTouchBegan = CC_CALLBACK_2(Paddle::onTouchBegan, this); - listener->onTouchMoved = CC_CALLBACK_2(Paddle::onTouchMoved, this); - listener->onTouchEnded = CC_CALLBACK_2(Paddle::onTouchEnded, this); + listener->onTouchBegan = AX_CALLBACK_2(Paddle::onTouchBegan, this); + listener->onTouchMoved = AX_CALLBACK_2(Paddle::onTouchMoved, this); + listener->onTouchEnded = AX_CALLBACK_2(Paddle::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -84,7 +84,7 @@ bool Paddle::containsTouchLocation(Touch* touch) bool Paddle::onTouchBegan(Touch* touch, Event* event) { - CCLOG("Paddle::onTouchBegan id = %d, x = %f, y = %f", touch->getID(), touch->getLocation().x, + AXLOG("Paddle::onTouchBegan id = %d, x = %f, y = %f", touch->getID(), touch->getLocation().x, touch->getLocation().y); if (_state != kPaddleStateUngrabbed) @@ -93,7 +93,7 @@ bool Paddle::onTouchBegan(Touch* touch, Event* event) return false; _state = kPaddleStateGrabbed; - CCLOG("return true"); + AXLOG("return true"); return true; } @@ -106,10 +106,10 @@ void Paddle::onTouchMoved(Touch* touch, Event* event) // you get Sets instead of 1 UITouch, so you'd need to loop through the set // in each touchXXX method. - CCLOG("Paddle::onTouchMoved id = %d, x = %f, y = %f", touch->getID(), touch->getLocation().x, + AXLOG("Paddle::onTouchMoved id = %d, x = %f, y = %f", touch->getID(), touch->getLocation().x, touch->getLocation().y); - CCASSERT(_state == kPaddleStateGrabbed, "Paddle - Unexpected state!"); + AXASSERT(_state == kPaddleStateGrabbed, "Paddle - Unexpected state!"); auto touchPoint = touch->getLocation(); @@ -127,7 +127,7 @@ Paddle* Paddle::clone() const void Paddle::onTouchEnded(Touch* touch, Event* event) { - CCASSERT(_state == kPaddleStateGrabbed, "Paddle - Unexpected state!"); + AXASSERT(_state == kPaddleStateGrabbed, "Paddle - Unexpected state!"); _state = kPaddleStateUngrabbed; } diff --git a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp index 12fec743c3..c43ed65ac7 100644 --- a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp +++ b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp @@ -110,7 +110,7 @@ PongLayer::PongLayer() addChild(paddle); } - schedule(CC_SCHEDULE_SELECTOR(PongLayer::doStep)); + schedule(AX_SCHEDULE_SELECTOR(PongLayer::doStep)); } PongLayer::~PongLayer() {} @@ -154,9 +154,9 @@ ForceTouchTest::ForceTouchTest() addChild(_infoLabel); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(ForceTouchTest::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(ForceTouchTest::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(ForceTouchTest::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(ForceTouchTest::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(ForceTouchTest::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(ForceTouchTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } diff --git a/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp b/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp index 29a5fd3cc9..9904eef0a7 100644 --- a/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp +++ b/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp @@ -286,7 +286,7 @@ TestLayer1::TestLayer1(std::string_view transitionName) label->setPosition(Vec2(x / 2, y / 2)); addChild(label); - schedule(CC_SCHEDULE_SELECTOR(TestLayer1::step), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(TestLayer1::step), 1.0f); } TestLayer1::~TestLayer1() {} @@ -356,7 +356,7 @@ TestLayer2::TestLayer2(std::string_view transitionName) label->setPosition(Vec2(x / 2, y / 2)); addChild(label); - schedule(CC_SCHEDULE_SELECTOR(TestLayer2::step), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(TestLayer2::step), 1.0f); } TestLayer2::~TestLayer2() {} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index af4ce1d2c0..8b8f5a24d8 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -44,36 +44,36 @@ #include "UIFocusTest/UIFocusTest.h" #include "UITabControlTest/UITabControlTest.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) && !defined(CC_TARGET_OS_TVOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) && !defined(AX_TARGET_OS_TVOS) # include "UIVideoPlayerTest/UIVideoPlayerTest.h" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) && !defined(AX_TARGET_OS_TVOS) # include "UIWebViewTest/UIWebViewTest.h" #endif #include "UIScale9SpriteTest.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "UIEditBoxTest.h" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "UIWebViewTest/UIWebViewTest.h" #endif GUIDynamicCreateTests::GUIDynamicCreateTests() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) && !defined(CC_TARGET_OS_TVOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) && !defined(AX_TARGET_OS_TVOS) addTest("VideoPlayer Test", []() { return new VideoPlayerTests; }); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && \ - !defined(CC_TARGET_OS_TVOS) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) && \ + !defined(AX_TARGET_OS_TVOS) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) addTest("WebView Test", []() { return new WebViewTests; }); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) addTest("EditBox Test", []() { return new UIEditBoxTests; }); #endif addTest("Focus Test", []() { return new UIFocusTests; }); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index 860cc52f92..b47d20a9b3 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -78,10 +78,10 @@ bool UIButtonTest::init() // Create the button Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); - CCLOG("content size should be greater than 0: width = %f, height = %f", button->getContentSize().width, + AXLOG("content size should be greater than 0: width = %f, height = %f", button->getContentSize().width, button->getContentSize().height); button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTest::touchEvent, this)); button->setZoomScale(0.4f); button->setPressedActionEnabled(true); _uiLayer->addChild(button); @@ -99,7 +99,7 @@ bool UIButtonTest::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UIButtonTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UIButtonTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); @@ -150,11 +150,11 @@ void UIButtonTest::touchEvent(Ref* pSender, Widget::TouchEventType type) void UIButtonTest::printWidgetResources(axis::Ref* sender) { axis::ResourceData normalFileName = _button->getNormalFile(); - CCLOG("normalFileName Name : %s, Type: %d", normalFileName.file.c_str(), normalFileName.type); + AXLOG("normalFileName Name : %s, Type: %d", normalFileName.file.c_str(), normalFileName.type); axis::ResourceData clickedFileName = _button->getPressedFile(); - CCLOG("clickedFileName Name : %s, Type: %d", clickedFileName.file.c_str(), clickedFileName.type); + AXLOG("clickedFileName Name : %s, Type: %d", clickedFileName.file.c_str(), clickedFileName.type); axis::ResourceData disabledFileName = _button->getDisabledFile(); - CCLOG("disabledFileName Name : %s, Type: %d", disabledFileName.file.c_str(), disabledFileName.type); + AXLOG("disabledFileName Name : %s, Type: %d", disabledFileName.file.c_str(), disabledFileName.type); } // UIButtonTest_Scale9 @@ -191,7 +191,7 @@ bool UIButtonTest_Scale9::init() auto moveByReverse = moveBy->reverse()->clone(); button->runAction(RepeatForever::create(Sequence::create(moveBy, moveByReverse, NULL))); button->setPressedActionEnabled(true); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Scale9::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTest_Scale9::touchEvent, this)); _uiLayer->addChild(button); // Create the imageview @@ -273,7 +273,7 @@ bool UIButtonTest_Scale9_State_Change::init() button->setContentSize(Size(180.0f, 60.0f)); button->setTitleText("Hello Scale9"); button->setPressedActionEnabled(false); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Scale9_State_Change::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTest_Scale9_State_Change::touchEvent, this)); _uiLayer->addChild(button); Button* button2 = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); @@ -284,7 +284,7 @@ bool UIButtonTest_Scale9_State_Change::init() button2->setPosition(Vec2(widgetSize.width / 2.0f + 100, widgetSize.height / 2.0f)); button2->setContentSize(Size(180.0f, 60.0f)); button2->setPressedActionEnabled(true); - button2->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Scale9_State_Change::touchEvent, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIButtonTest_Scale9_State_Change::touchEvent, this)); _uiLayer->addChild(button2); return true; } @@ -357,7 +357,7 @@ bool UIButtonTest_PressedAction::init() button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); button->setColor(Color3B::GREEN); button->setOpacity(30); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_PressedAction::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTest_PressedAction::touchEvent, this)); button->setName("button"); _uiLayer->addChild(button); @@ -433,8 +433,8 @@ bool UIButtonTest_Title::init() button->setTitleText("Title Button!"); button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); button->setTitleColor(Color3B::YELLOW); - CCASSERT(button->getTitleColor() == Color3B::YELLOW, "Button setTitleColor & getTitleColor not match!"); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Title::touchEvent, this)); + AXASSERT(button->getTitleColor() == Color3B::YELLOW, "Button setTitleColor & getTitleColor not match!"); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTest_Title::touchEvent, this)); _uiLayer->addChild(button); button->setFlippedX(true); auto label = button->getTitleRenderer(); @@ -541,7 +541,7 @@ bool UIButtonTestRemoveSelf::init() Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); button->setPosition(Vec2(layout->getContentSize().width / 2.0f, layout->getContentSize().height / 2.0f)); // button->addTouchEventListener(this, toucheventselector(UIButtonTest::touchEvent)); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTestRemoveSelf::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTestRemoveSelf::touchEvent, this)); layout->addChild(button); return true; @@ -598,7 +598,7 @@ bool UIButtonTestSwitchScale9::init() // Create the button Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTestSwitchScale9::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTestSwitchScale9::touchEvent, this)); button->setTitleText("Button Title"); button->ignoreContentAdaptWithSize(false); @@ -661,7 +661,7 @@ bool UIButtonTestZoomScale::init() button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + 20)); button->setPressedActionEnabled(true); button->addClickEventListener([=](Ref* sender) { - CCLOG("Button clicked, position = (%f, %f)", button->getPosition().x, button->getPosition().y); + AXLOG("Button clicked, position = (%f, %f)", button->getPosition().x, button->getPosition().y); }); button->setName("button"); _uiLayer->addChild(button); @@ -672,7 +672,7 @@ bool UIButtonTestZoomScale::init() slider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); slider->loadProgressBarTexture("cocosui/sliderProgress.png"); slider->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - 20)); - slider->addEventListener(CC_CALLBACK_2(UIButtonTestZoomScale::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(UIButtonTestZoomScale::sliderEvent, this)); slider->setPercent(button->getZoomScale() * 100); _uiLayer->addChild(slider); return true; @@ -715,11 +715,11 @@ bool UIButtonTextOnly::init() button->setPositionNormalized(Vec2(0.5f, 0.5f)); button->setTitleText("PLAY GAME"); - CCLOG("content size should be greater than 0: width = %f, height = %f", button->getContentSize().width, + AXLOG("content size should be greater than 0: width = %f, height = %f", button->getContentSize().width, button->getContentSize().height); button->setZoomScale(0.3f); button->setPressedActionEnabled(true); - button->addClickEventListener([](Ref* sender) { CCLOG("clicked!"); }); + button->addClickEventListener([](Ref* sender) { AXLOG("clicked!"); }); _uiLayer->addChild(button); return true; @@ -753,7 +753,7 @@ bool UIButtonIgnoreContentSizeTest::init() button->setZoomScale(0.3f); button->setPressedActionEnabled(true); button->addClickEventListener([=](Ref* sender) { - CCLOG("clicked!"); + AXLOG("clicked!"); button->setScale(1.2f); }); _uiLayer->addChild(button); @@ -768,7 +768,7 @@ bool UIButtonIgnoreContentSizeTest::init() button2->setPressedActionEnabled(true); button2->addClickEventListener([=](Ref* sender) { button2->runAction(ScaleTo::create(1.0f, 1.2f)); - CCLOG("clicked!"); + AXLOG("clicked!"); }); _uiLayer->addChild(button2); @@ -995,7 +995,7 @@ bool UIButtonCloneTest::init() button->setPosition(Vec2(widgetSize.width / 2.0f - 80, widgetSize.height / 2.0f + 40)); _uiLayer->addChild(button); - CCASSERT(button->getTitleRenderer() == nullptr, "Button title render must be nullptr "); + AXASSERT(button->getTitleRenderer() == nullptr, "Button title render must be nullptr "); auto buttonCopy = (Button*)button->clone(); buttonCopy->setPosition(Vec2(widgetSize.width / 2.0f + 80, widgetSize.height / 2.0f + 40)); @@ -1013,9 +1013,9 @@ bool UIButtonCloneTest::init() buttonScale9Copy2->setContentSize(buttonCopy->getContentSize() * 1.5f); this->addChild(buttonScale9Copy2); - CCASSERT(button->getTitleRenderer() == nullptr, "Original Button title render must be nullptr "); + AXASSERT(button->getTitleRenderer() == nullptr, "Original Button title render must be nullptr "); - CCASSERT(buttonCopy->getTitleRenderer() == nullptr, "Copied Button title render must be nullptr "); + AXASSERT(buttonCopy->getTitleRenderer() == nullptr, "Copied Button title render must be nullptr "); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp index 491eb11e09..36e2bbd618 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp @@ -64,12 +64,12 @@ bool UICheckBoxTest::init() "cocosui/check_box_active_disable.png"); _checkBox->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - _checkBox->addEventListener(CC_CALLBACK_2(UICheckBoxTest::selectedEvent, this)); + _checkBox->addEventListener(AX_CALLBACK_2(UICheckBoxTest::selectedEvent, this)); _uiLayer->addChild(_checkBox); TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UICheckBoxTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UICheckBoxTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); @@ -101,17 +101,17 @@ void UICheckBoxTest::selectedEvent(Ref* pSender, CheckBox::EventType type) void UICheckBoxTest::printWidgetResources(axis::Ref* sender) { axis::ResourceData backGroundFileName = _checkBox->getBackNormalFile(); - CCLOG("backGroundFile Name : %s, Type: %d", backGroundFileName.file.c_str(), backGroundFileName.type); + AXLOG("backGroundFile Name : %s, Type: %d", backGroundFileName.file.c_str(), backGroundFileName.type); axis::ResourceData backGroundSelectedFileName = _checkBox->getBackPressedFile(); - CCLOG("backGroundSelectedFile Name : %s, Type: %d", backGroundSelectedFileName.file.c_str(), + AXLOG("backGroundSelectedFile Name : %s, Type: %d", backGroundSelectedFileName.file.c_str(), backGroundSelectedFileName.type); axis::ResourceData backGroundDisabledFileName = _checkBox->getBackDisabledFile(); - CCLOG("backGroundDisabledFile Name : %s, Type: %d", backGroundDisabledFileName.file.c_str(), + AXLOG("backGroundDisabledFile Name : %s, Type: %d", backGroundDisabledFileName.file.c_str(), backGroundDisabledFileName.type); axis::ResourceData frontCrossFileName = _checkBox->getCrossNormalFile(); - CCLOG("frontCrossFile Name : %s, Type: %d", frontCrossFileName.file.c_str(), frontCrossFileName.type); + AXLOG("frontCrossFile Name : %s, Type: %d", frontCrossFileName.file.c_str(), frontCrossFileName.type); axis::ResourceData frontCrossDisabledFileName = _checkBox->getCrossDisabledFile(); - CCLOG("frontCrossDisabledFile Name : %s, Type: %d", frontCrossDisabledFileName.file.c_str(), + AXLOG("frontCrossDisabledFile Name : %s, Type: %d", frontCrossDisabledFileName.file.c_str(), frontCrossDisabledFileName.type); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp index e8e8628a4a..a7e28ac284 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp @@ -63,19 +63,19 @@ bool UIFocusTestBase::init() _dpadMenu = Menu::create(); auto winSize = Director::getInstance()->getVisibleSize(); - auto leftItem = MenuItemFont::create("Left", CC_CALLBACK_0(UIFocusTestBase::onLeftKeyPressed, this)); + auto leftItem = MenuItemFont::create("Left", AX_CALLBACK_0(UIFocusTestBase::onLeftKeyPressed, this)); leftItem->setPosition(Vec2(winSize.width - 100, winSize.height / 2)); _dpadMenu->addChild(leftItem); - auto rightItem = MenuItemFont::create("Right", CC_CALLBACK_0(UIFocusTestBase::onRightKeyPressed, this)); + auto rightItem = MenuItemFont::create("Right", AX_CALLBACK_0(UIFocusTestBase::onRightKeyPressed, this)); rightItem->setPosition(Vec2(winSize.width - 30, winSize.height / 2)); _dpadMenu->addChild(rightItem); - auto upItem = MenuItemFont::create("Up", CC_CALLBACK_0(UIFocusTestBase::onUpKeyPressed, this)); + auto upItem = MenuItemFont::create("Up", AX_CALLBACK_0(UIFocusTestBase::onUpKeyPressed, this)); upItem->setPosition(Vec2(winSize.width - 60, winSize.height / 2 + 50)); _dpadMenu->addChild(upItem); - auto downItem = MenuItemFont::create("Down", CC_CALLBACK_0(UIFocusTestBase::onDownKeyPressed, this)); + auto downItem = MenuItemFont::create("Down", AX_CALLBACK_0(UIFocusTestBase::onDownKeyPressed, this)); downItem->setPosition(Vec2(winSize.width - 60, winSize.height / 2 - 50)); _dpadMenu->addChild(downItem); @@ -86,7 +86,7 @@ bool UIFocusTestBase::init() Widget::enableDpadNavigation(true); _eventListener = EventListenerFocus::create(); - _eventListener->onFocusChanged = CC_CALLBACK_2(UIFocusTestBase::onFocusChanged, this); + _eventListener->onFocusChanged = AX_CALLBACK_2(UIFocusTestBase::onFocusChanged, this); _eventDispatcher->addEventListenerWithFixedPriority(_eventListener, 1); @@ -163,7 +163,7 @@ void UIFocusTestBase::onFocusChanged(axis::ui::Widget* widgetLostFocus, axis::ui if (widgetLostFocus && widgetGetFocus) { - CCLOG("on focus change, %d widget get focus, %d widget lose focus", widgetGetFocus->getTag(), + AXLOG("on focus change, %d widget get focus, %d widget lose focus", widgetGetFocus->getTag(), widgetLostFocus->getTag()); } } @@ -195,7 +195,7 @@ bool UIFocusTestHorizontal::init() ImageView* w = ImageView::create("cocosui/scrollviewbg.png"); w->setTouchEnabled(true); w->setTag(i); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestHorizontal::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestHorizontal::onImageViewClicked, this)); _horizontalLayout->addChild(w); } @@ -204,7 +204,7 @@ bool UIFocusTestHorizontal::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(CC_CALLBACK_2(UIFocusTestHorizontal::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestHorizontal::toggleFocusLoop, this)); return true; } @@ -255,7 +255,7 @@ bool UIFocusTestVertical::init() ImageView* w = ImageView::create("cocosui/scrollviewbg.png"); w->setTouchEnabled(true); w->setTag(i); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestVertical::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestVertical::onImageViewClicked, this)); _verticalLayout->addChild(w); } @@ -264,7 +264,7 @@ bool UIFocusTestVertical::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(CC_CALLBACK_2(UIFocusTestVertical::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestVertical::toggleFocusLoop, this)); return true; } @@ -317,7 +317,7 @@ bool UIFocusTestNestedLayout1::init() w->setTouchEnabled(true); w->setScaleX(2.5); w->setTag(i + count1); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); _verticalLayout->addChild(w); } @@ -335,7 +335,7 @@ bool UIFocusTestNestedLayout1::init() w->setScaleY(2.0); w->setTouchEnabled(true); w->setTag(i + count1 + count2); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); hbox->addChild(w); } @@ -351,7 +351,7 @@ bool UIFocusTestNestedLayout1::init() ImageView* w = ImageView::create("cocosui/scrollviewbg.png"); w->setTouchEnabled(true); w->setTag(i + count1 + count2 + count3); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); innerVBox->addChild(w); } @@ -360,7 +360,7 @@ bool UIFocusTestNestedLayout1::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout1::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout1::toggleFocusLoop, this)); return true; } @@ -413,7 +413,7 @@ bool UIFocusTestNestedLayout2::init() w->setTouchEnabled(true); w->setTag(i + count1); w->setScaleY(2.4f); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); _horizontalLayout->addChild(w); } @@ -431,7 +431,7 @@ bool UIFocusTestNestedLayout2::init() w->setScaleX(2.0); w->setTouchEnabled(true); w->setTag(i + count1 + count2); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); vbox->addChild(w); } @@ -447,7 +447,7 @@ bool UIFocusTestNestedLayout2::init() ImageView* w = ImageView::create("cocosui/scrollviewbg.png"); w->setTouchEnabled(true); w->setTag(i + count1 + count2 + count3); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); innerHBox->addChild(w); } @@ -456,7 +456,7 @@ bool UIFocusTestNestedLayout2::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout2::toggleFocusLoop, this)); return true; } @@ -526,7 +526,7 @@ bool UIFocusTestNestedLayout3::init() ImageView* w = ImageView::create("cocosui/scrollviewbg.png"); w->setTouchEnabled(true); w->setTag(j + firstVbox->getTag() + 1); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestBase::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestBase::onImageViewClicked, this)); firstVbox->addChild(w); } @@ -547,7 +547,7 @@ bool UIFocusTestNestedLayout3::init() w->setLayoutParameter(bottomParams); w->setTouchEnabled(true); w->setTag(i + 601); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestBase::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestBase::onImageViewClicked, this)); bottomHBox->addChild(w); } _verticalLayout->addChild(bottomHBox); @@ -557,7 +557,7 @@ bool UIFocusTestNestedLayout3::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout3::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout3::toggleFocusLoop, this)); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp index 1fc33daa7d..9b5ebd8831 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp @@ -62,7 +62,7 @@ bool UIImageViewTest::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UIImageViewTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UIImageViewTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); @@ -77,7 +77,7 @@ bool UIImageViewTest::init() void UIImageViewTest::printWidgetResources(axis::Ref* sender) { axis::ResourceData textureFile = _image->getRenderFile(); - CCLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); + AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); } // UIImageViewTest_Scale9 @@ -203,11 +203,11 @@ bool UIImageViewTest_ContentSize::init() imageView->addTouchEventListener([=](Ref* sender, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { - float width = CCRANDOM_0_1() * 200 + 50; - float height = CCRANDOM_0_1() * 80 + 30; + float width = AXRANDOM_0_1() * 200 + 50; + float height = AXRANDOM_0_1() * 80 + 30; imageView->setContentSize(Size(width, height)); - imageViewChild->setPositionPercent(Vec2(CCRANDOM_0_1(), CCRANDOM_0_1())); + imageViewChild->setPositionPercent(Vec2(AXRANDOM_0_1(), AXRANDOM_0_1())); status->setString(StringUtils::format("child ImageView position percent: %f, %f", imageViewChild->getPositionPercent().x, imageViewChild->getPositionPercent().y)); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp index 992a0d5f02..c1967a94b3 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp @@ -282,7 +282,7 @@ bool UILayoutTest_BackGroundImage::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); auto item1 = - MenuItemLabel::create(label1, CC_CALLBACK_1(UILayoutTest_BackGroundImage::printWidgetResources, this)); + MenuItemLabel::create(label1, AX_CALLBACK_1(UILayoutTest_BackGroundImage::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); @@ -297,7 +297,7 @@ bool UILayoutTest_BackGroundImage::init() void UILayoutTest_BackGroundImage::printWidgetResources(axis::Ref* sender) { axis::ResourceData textureFile = _layout->getRenderFile(); - CCLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); + AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); } // UILayoutTest_BackGroundImage_Scale9 @@ -767,10 +767,10 @@ bool UILayoutComponentTest::init() _uiLayer->addChild(_baseLayer); Button* button = Button::create("cocosui/animationbuttonnormal.png"); - CCLOG("content size should be greater than 0: width = %f, height = %f", button->getContentSize().width, + AXLOG("content size should be greater than 0: width = %f, height = %f", button->getContentSize().width, button->getContentSize().height); button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - button->addTouchEventListener(CC_CALLBACK_2(UILayoutComponentTest::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UILayoutComponentTest::touchEvent, this)); button->setZoomScale(0.4f); button->setPressedActionEnabled(true); _uiLayer->addChild(button); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp index 3c11c5ef20..48f3f91144 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp @@ -93,8 +93,8 @@ bool UIListViewTest_Vertical::init() _listView->setContentSize(Size(240.0f, 130.0f)); _listView->setPosition(Vec2((widgetSize - _listView->getContentSize()) / 2.0f)); _listView->addEventListener( - (ui::ListView::ccListViewCallback)CC_CALLBACK_2(UIListViewTest_Vertical::selectedItemEvent, this)); - _listView->addEventListener((ui::ListView::ccScrollViewCallback)CC_CALLBACK_2( + (ui::ListView::ccListViewCallback)AX_CALLBACK_2(UIListViewTest_Vertical::selectedItemEvent, this)); + _listView->addEventListener((ui::ListView::ccScrollViewCallback)AX_CALLBACK_2( UIListViewTest_Vertical::selectedItemEventScrollView, this)); _listView->setScrollBarPositionFromCorner(Vec2(7, 7)); _uiLayer->addChild(_listView); @@ -234,7 +234,7 @@ void UIListViewTest_Vertical::update(float dt) { int itemID = item->getTag() - (int)items.size(); item->setPositionY(item->getPositionY() + _reuseItemOffset); - CCLOG("itemPos = %f, itemID = %d, templateID = %d", itemPos, itemID, i); + AXLOG("itemPos = %f, itemID = %d, templateID = %d", itemPos, itemID, i); this->updateItem(itemID, i); } } @@ -245,7 +245,7 @@ void UIListViewTest_Vertical::update(float dt) item->setPositionY(item->getPositionY() - _reuseItemOffset); int itemID = item->getTag() + (int)items.size(); - CCLOG("itemPos = %f, itemID = %d, templateID = %d", itemPos, itemID, i); + AXLOG("itemPos = %f, itemID = %d, templateID = %d", itemPos, itemID, i); this->updateItem(itemID, i); } } @@ -282,10 +282,10 @@ void UIListViewTest_Vertical::selectedItemEventScrollView(Ref* pSender, ui::Scro switch (type) { case ui::ScrollView::EventType::SCROLL_TO_BOTTOM: - CCLOG("SCROLL_TO_BOTTOM"); + AXLOG("SCROLL_TO_BOTTOM"); break; case ui::ScrollView::EventType::SCROLL_TO_TOP: - CCLOG("SCROLL_TO_TOP"); + AXLOG("SCROLL_TO_TOP"); break; default: break; @@ -346,7 +346,7 @@ bool UIListViewTest_Horizontal::init() (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - _listView->getContentSize().height) / 2.0f)); _listView->addEventListener( - (ui::ListView::ccListViewCallback)CC_CALLBACK_2(UIListViewTest_Horizontal::selectedItemEvent, this)); + (ui::ListView::ccListViewCallback)AX_CALLBACK_2(UIListViewTest_Horizontal::selectedItemEvent, this)); _listView->setScrollBarPositionFromCorner(Vec2(7, 7)); _uiLayer->addChild(_listView); @@ -438,7 +438,7 @@ void UIListViewTest_Horizontal::update(float dt) { int itemID = item->getTag() + (int)items.size(); item->setPositionX(item->getPositionX() + _reuseItemOffset); - CCLOG("itemPos = %f, itemID = %d, templateID = %d", itemPos, itemID, i); + AXLOG("itemPos = %f, itemID = %d, templateID = %d", itemPos, itemID, i); this->updateItem(itemID, i); } } @@ -450,7 +450,7 @@ void UIListViewTest_Horizontal::update(float dt) item->setPositionX(item->getPositionX() - _reuseItemOffset); int itemID = item->getTag() - (int)items.size(); - CCLOG("itemPos = %f, itemID = %d, templateID = %d", itemPos, itemID, i); + AXLOG("itemPos = %f, itemID = %d, templateID = %d", itemPos, itemID, i); this->updateItem(itemID, i); } } @@ -937,7 +937,7 @@ bool UIListViewTest_Padding::init() slider->setCapInsets(Rect(0.0f, 0.0f, 0.0f, 0.0f)); slider->setContentSize(Size(30.0f, 10.0f)); slider->setPosition(Vec2(60.0f, 150.0f - (25 * i))); - slider->addEventListener(CC_CALLBACK_2(UIListViewTest_Padding::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(UIListViewTest_Padding::sliderEvent, this)); slider->setTag(i); _uiLayer->addChild(slider); @@ -1028,7 +1028,7 @@ void UIListViewTest_Padding::sliderEvent(Ref* pSender, Slider::EventType type) if (slider && slider->getTag() == 0) { int left = slider->getPercent() / 100.f * 50.f; - CCLOG("Left Padding: %d", left); + AXLOG("Left Padding: %d", left); _listView->setLeftPadding(left); _paddingLabels[0]->setString(StringUtils::format("Left\nPadding=%d", left)); } @@ -1036,7 +1036,7 @@ void UIListViewTest_Padding::sliderEvent(Ref* pSender, Slider::EventType type) if (slider && slider->getTag() == 1) { int top = slider->getPercent() / 100.f * 50.f; - CCLOG("Top Padding: %d", top); + AXLOG("Top Padding: %d", top); _listView->setTopPadding(top); _paddingLabels[1]->setString(StringUtils::format("Top\nPadding=%d", top)); } @@ -1044,7 +1044,7 @@ void UIListViewTest_Padding::sliderEvent(Ref* pSender, Slider::EventType type) if (slider && slider->getTag() == 2) { int right = slider->getPercent() / 100.f * 50.f; - CCLOG("Right Padding: %d", right); + AXLOG("Right Padding: %d", right); _listView->setRightPadding(right); _paddingLabels[2]->setString(StringUtils::format("Right\nPadding=%d", right)); } @@ -1052,7 +1052,7 @@ void UIListViewTest_Padding::sliderEvent(Ref* pSender, Slider::EventType type) if (slider && slider->getTag() == 3) { int bottom = slider->getPercent() / 100.f * 50.f; - CCLOG("Bottom Padding: %d", bottom); + AXLOG("Bottom Padding: %d", bottom); _listView->setBottomPadding(bottom); _paddingLabels[3]->setString(StringUtils::format("Bottom\nPadding=%d", bottom)); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp index 3eff94fa2e..b353353d95 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp @@ -101,7 +101,7 @@ bool UILoadingBarTest_Left::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UILoadingBarTest_Left::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UILoadingBarTest_Left::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); @@ -129,7 +129,7 @@ void UILoadingBarTest_Left::update(float delta) void UILoadingBarTest_Left::printWidgetResources(axis::Ref* sender) { axis::ResourceData textureFile = _loadingBar->getRenderFile(); - CCLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); + AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); } // UILoadingBarTest_Right diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index d68d1c8f8b..acc4fbafae 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -188,7 +188,7 @@ bool UIPageViewButtonTest::init() Button* btn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); btn->setName(StringUtils::format("button %d", j)); - btn->addTouchEventListener(CC_CALLBACK_2(UIPageViewButtonTest::onButtonClicked, this)); + btn->addTouchEventListener(AX_CALLBACK_2(UIPageViewButtonTest::onButtonClicked, this)); innerBox->addChild(btn); } @@ -206,7 +206,7 @@ bool UIPageViewButtonTest::init() pageView->removeItem(0); pageView->addEventListener( - (PageView::ccPageViewCallback)CC_CALLBACK_2(UIPageViewButtonTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewButtonTest::pageViewEvent, this)); _uiLayer->addChild(pageView); @@ -294,7 +294,7 @@ bool UIPageViewTouchPropagationTest::init() Button* btn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); btn->setName(StringUtils::format("button %d", j)); - btn->addTouchEventListener(CC_CALLBACK_2(UIPageViewTouchPropagationTest::onButtonClicked, this)); + btn->addTouchEventListener(AX_CALLBACK_2(UIPageViewTouchPropagationTest::onButtonClicked, this)); innerBox->addChild(btn); } @@ -310,24 +310,24 @@ bool UIPageViewTouchPropagationTest::init() } pageView->addEventListener( - (PageView::ccPageViewCallback)CC_CALLBACK_2(UIPageViewTouchPropagationTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewTouchPropagationTest::pageViewEvent, this)); pageView->setName("pageView"); pageView->addTouchEventListener([](Ref* sender, Widget::TouchEventType type) { if (type == Widget::TouchEventType::BEGAN) { - CCLOG("page view touch began"); + AXLOG("page view touch began"); } else if (type == Widget::TouchEventType::MOVED) { - CCLOG("page view touch moved"); + AXLOG("page view touch moved"); } else if (type == Widget::TouchEventType::ENDED) { - CCLOG("page view touch ended"); + AXLOG("page view touch ended"); } else { - CCLOG("page view touch cancelled"); + AXLOG("page view touch cancelled"); } }); _uiLayer->addChild(pageView); @@ -366,7 +366,7 @@ bool UIPageViewTouchPropagationTest::init() auto eventListener = EventListenerTouchOneByOne::create(); eventListener->onTouchBegan = [](Touch* touch, Event* event) -> bool { - CCLOG("layout receives touches"); + AXLOG("layout receives touches"); return true; }; _eventDispatcher->addEventListenerWithSceneGraphPriority(eventListener, this); @@ -409,7 +409,7 @@ void UIPageViewTouchPropagationTest::onButtonClicked(Ref* pSender, Widget::Touch } if (type == Widget::TouchEventType::ENDED) { - CCLOG("button clicked"); + AXLOG("button clicked"); } } @@ -502,7 +502,7 @@ bool UIPageViewDynamicAddAndRemoveTest::init() } pageView->addEventListener( - (PageView::ccPageViewCallback)CC_CALLBACK_2(UIPageViewDynamicAddAndRemoveTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewDynamicAddAndRemoveTest::pageViewEvent, this)); pageView->setName("pageView"); _uiLayer->addChild(pageView); @@ -537,7 +537,7 @@ bool UIPageViewDynamicAddAndRemoveTest::init() pageView->pushBackCustomItem(outerBox); _displayValueLabel->setString( StringUtils::format("page count = %d", static_cast(pageView->getItems().size()))); - CCLOG("current page index = %zd", pageView->getCurrentPageIndex()); + AXLOG("current page index = %zd", pageView->getCurrentPageIndex()); }); _uiLayer->addChild(button); @@ -554,11 +554,11 @@ bool UIPageViewDynamicAddAndRemoveTest::init() } else { - CCLOG("There is no page to remove!"); + AXLOG("There is no page to remove!"); } _displayValueLabel->setString( StringUtils::format("page count = %d", static_cast(pageView->getItems().size()))); - CCLOG("current page index = %zd", pageView->getCurrentPageIndex()); + AXLOG("current page index = %zd", pageView->getCurrentPageIndex()); }); _uiLayer->addChild(button2); @@ -572,7 +572,7 @@ bool UIPageViewDynamicAddAndRemoveTest::init() pageView->removeAllItems(); _displayValueLabel->setString( StringUtils::format("page count = %d", static_cast(pageView->getItems().size()))); - CCLOG("current page index = %zd", pageView->getCurrentPageIndex()); + AXLOG("current page index = %zd", pageView->getCurrentPageIndex()); }); _uiLayer->addChild(button3); @@ -581,7 +581,7 @@ bool UIPageViewDynamicAddAndRemoveTest::init() button4->setPositionNormalized(Vec2(0.85f, 0.5f)); button4->addClickEventListener([=](Ref* sender) { pageView->scrollToItem(3); - CCLOG("current page index = %zd", pageView->getCurrentPageIndex()); + AXLOG("current page index = %zd", pageView->getCurrentPageIndex()); }); _uiLayer->addChild(button4); @@ -674,14 +674,14 @@ bool UIPageViewJumpToPageTest::init() auto button1 = ui::Button::create(); button1->setPositionNormalized(Vec2(0.1f, 0.75f)); button1->setTitleText("Jump to Page1"); - CCLOG("button1 content Size = %f, %f", button1->getContentSize().width, button1->getContentSize().height); + AXLOG("button1 content Size = %f, %f", button1->getContentSize().width, button1->getContentSize().height); button1->addClickEventListener([=](Ref*) { pageView->setCurrentPageIndex(0); }); _uiLayer->addChild(button1); auto button2 = static_cast(button1->clone()); button2->setTitleText("Jump to Page2"); button2->setPositionNormalized(Vec2(0.1f, 0.65f)); - CCLOG("button2 content Size = %f, %f", button2->getContentSize().width, button2->getContentSize().height); + AXLOG("button2 content Size = %f, %f", button2->getContentSize().width, button2->getContentSize().height); button2->addClickEventListener([=](Ref*) { pageView->setCurrentPageIndex(1); }); _uiLayer->addChild(button2); @@ -762,7 +762,7 @@ bool UIPageViewVerticalTest::init() } pageView->addEventListener( - (PageView::ccPageViewCallback)CC_CALLBACK_2(UIPageViewVerticalTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewVerticalTest::pageViewEvent, this)); _uiLayer->addChild(pageView); @@ -911,7 +911,7 @@ bool UIPageViewChildSizeTest::init() } pageView->addEventListener( - (PageView::ccPageViewCallback)CC_CALLBACK_2(UIPageViewChildSizeTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewChildSizeTest::pageViewEvent, this)); _uiLayer->addChild(pageView); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp index 1e5b14a8d2..c553001e1b 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp @@ -69,7 +69,7 @@ bool UIRadioButtonTest::init() Button* addButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); addButton->setTitleText("Add"); addButton->setPosition(Vec2(widgetSize.width / 2.0f - 100, widgetSize.height / 2.0f - 65)); - addButton->addClickEventListener(CC_CALLBACK_1(UIRadioButtonTest::addRadioButton, this)); + addButton->addClickEventListener(AX_CALLBACK_1(UIRadioButtonTest::addRadioButton, this)); addButton->setScale(0.7f); _uiLayer->addChild(addButton); @@ -77,7 +77,7 @@ bool UIRadioButtonTest::init() Button* deleteButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); deleteButton->setTitleText("Delete"); deleteButton->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - 65)); - deleteButton->addClickEventListener(CC_CALLBACK_1(UIRadioButtonTest::deleteRadioButton, this)); + deleteButton->addClickEventListener(AX_CALLBACK_1(UIRadioButtonTest::deleteRadioButton, this)); deleteButton->setScale(0.7f); _uiLayer->addChild(deleteButton); @@ -181,7 +181,7 @@ bool UIRadioButtonTwoGroupsTest::init() if (type == 0) { _radioButtonGroups[type]->addEventListener( - CC_CALLBACK_3(UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup1, this)); + AX_CALLBACK_3(UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup1, this)); normalImage = "cocosui/radio_button_off.png"; selectedImage = "cocosui/radio_button_on.png"; posYAdjust = 35; @@ -189,7 +189,7 @@ bool UIRadioButtonTwoGroupsTest::init() else { _radioButtonGroups[type]->addEventListener( - CC_CALLBACK_3(UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup2, this)); + AX_CALLBACK_3(UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup2, this)); normalImage = "cocosui/UIEditorTest/2.1/Button/button_common_box03_003 copy 221.png"; selectedImage = "cocosui/UIEditorTest/2.1/Button/button_common_box03_001.png"; posYAdjust = -15; @@ -210,7 +210,7 @@ bool UIRadioButtonTwoGroupsTest::init() radioButton->setPosition(Vec2(posX, posY)); radioButton->addEventListener( - CC_CALLBACK_2(UIRadioButtonTwoGroupsTest::onChangedRadioButtonSelect, this)); + AX_CALLBACK_2(UIRadioButtonTwoGroupsTest::onChangedRadioButtonSelect, this)); radioButton->setTag(i); _uiLayer->addChild(radioButton); _radioButtonGroups[type]->addRadioButton(radioButton); @@ -220,7 +220,7 @@ bool UIRadioButtonTwoGroupsTest::init() Button* clearButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); clearButton->setTitleText("Clear"); clearButton->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - 65)); - clearButton->addClickEventListener(CC_CALLBACK_1(UIRadioButtonTwoGroupsTest::clearRadioButtonGroup, this)); + clearButton->addClickEventListener(AX_CALLBACK_1(UIRadioButtonTwoGroupsTest::clearRadioButtonGroup, this)); clearButton->setScale(0.8f); _uiLayer->addChild(clearButton); @@ -238,7 +238,7 @@ void UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup1(RadioButton* radioBu int index, axis::ui::RadioButtonGroup::EventType type) { - CCASSERT(index == _radioButtonGroups[0]->getSelectedButtonIndex(), "The two indexes must match!"); + AXASSERT(index == _radioButtonGroups[0]->getSelectedButtonIndex(), "The two indexes must match!"); auto text = StringUtils::format("RadioButtonGroup1 : %d", index); _groupEventLabel->setString(text); addLog(text); @@ -248,7 +248,7 @@ void UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup2(RadioButton* radioBu int index, axis::ui::RadioButtonGroup::EventType type) { - CCASSERT(index == _radioButtonGroups[1]->getSelectedButtonIndex(), "The two indexes must match!"); + AXASSERT(index == _radioButtonGroups[1]->getSelectedButtonIndex(), "The two indexes must match!"); auto text = StringUtils::format("RadioButtonGroup2 : %d", index); _groupEventLabel->setString(text); addLog(text); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp index e47b9e72b4..2391846b65 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp @@ -65,10 +65,10 @@ bool UIRichTextTest::init() std::string str1 = config->getValue("Chinese").asString(); std::string str2 = config->getValue("Japanese").asString(); - CCLOG("str1:%s ascii length = %d, utf8 length = %d, substr = %s", str1.c_str(), + AXLOG("str1:%s ascii length = %d, utf8 length = %d, substr = %s", str1.c_str(), static_cast(str1.length()), StringUtils::getCharacterCountInUTF8String(str1), Helper::getSubStringOfUTF8String(str1, 0, 5).c_str()); - CCLOG("str2:%s ascii length = %d, utf8 length = %d, substr = %s", str2.c_str(), + AXLOG("str2:%s ascii length = %d, utf8 length = %d, substr = %s", str2.c_str(), static_cast(str2.length()), StringUtils::getCharacterCountInUTF8String(str2), Helper::getSubStringOfUTF8String(str2, 0, 2).c_str()); @@ -84,7 +84,7 @@ bool UIRichTextTest::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextTest::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextTest::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -93,7 +93,7 @@ bool UIRichTextTest::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextTest::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextTest::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -102,7 +102,7 @@ bool UIRichTextTest::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextTest::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextTest::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -215,7 +215,7 @@ bool UIRichTextXMLBasic::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLBasic::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLBasic::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -224,7 +224,7 @@ bool UIRichTextXMLBasic::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLBasic::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLBasic::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -233,7 +233,7 @@ bool UIRichTextXMLBasic::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLBasic::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLBasic::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -322,7 +322,7 @@ bool UIRichTextXMLSmallBig::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSmallBig::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSmallBig::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -331,7 +331,7 @@ bool UIRichTextXMLSmallBig::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSmallBig::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSmallBig::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -340,7 +340,7 @@ bool UIRichTextXMLSmallBig::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSmallBig::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSmallBig::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -428,7 +428,7 @@ bool UIRichTextXMLColor::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLColor::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLColor::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -437,7 +437,7 @@ bool UIRichTextXMLColor::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLColor::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLColor::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -446,7 +446,7 @@ bool UIRichTextXMLColor::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLColor::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLColor::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -534,7 +534,7 @@ bool UIRichTextXMLSUIB::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -543,7 +543,7 @@ bool UIRichTextXMLSUIB::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -552,7 +552,7 @@ bool UIRichTextXMLSUIB::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -640,7 +640,7 @@ bool UIRichTextXMLSUIB2::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB2::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB2::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -649,7 +649,7 @@ bool UIRichTextXMLSUIB2::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB2::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB2::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -658,7 +658,7 @@ bool UIRichTextXMLSUIB2::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB2::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB2::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -747,7 +747,7 @@ bool UIRichTextXMLSUIB3::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB3::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB3::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -756,7 +756,7 @@ bool UIRichTextXMLSUIB3::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB3::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB3::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -765,7 +765,7 @@ bool UIRichTextXMLSUIB3::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB3::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB3::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -854,7 +854,7 @@ bool UIRichTextXMLImg::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLImg::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLImg::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -863,7 +863,7 @@ bool UIRichTextXMLImg::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLImg::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLImg::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -872,7 +872,7 @@ bool UIRichTextXMLImg::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLImg::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLImg::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -962,7 +962,7 @@ bool UIRichTextXMLUrl::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLUrl::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLUrl::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -971,7 +971,7 @@ bool UIRichTextXMLUrl::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLUrl::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLUrl::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -980,7 +980,7 @@ bool UIRichTextXMLUrl::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLUrl::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLUrl::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1068,7 +1068,7 @@ bool UIRichTextXMLUrlImg::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLUrlImg::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLUrlImg::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1077,7 +1077,7 @@ bool UIRichTextXMLUrlImg::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLUrlImg::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLUrlImg::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1086,7 +1086,7 @@ bool UIRichTextXMLUrlImg::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLUrlImg::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLUrlImg::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1175,7 +1175,7 @@ bool UIRichTextXMLFace::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLFace::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLFace::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1184,7 +1184,7 @@ bool UIRichTextXMLFace::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLFace::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLFace::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1193,7 +1193,7 @@ bool UIRichTextXMLFace::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLFace::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLFace::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1282,7 +1282,7 @@ bool UIRichTextXMLBR::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLBR::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLBR::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1291,7 +1291,7 @@ bool UIRichTextXMLBR::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLBR::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLBR::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1300,7 +1300,7 @@ bool UIRichTextXMLBR::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLBR::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLBR::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1424,7 +1424,7 @@ bool UIRichTextXMLOutline::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLOutline::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLOutline::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1433,7 +1433,7 @@ bool UIRichTextXMLOutline::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLOutline::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLOutline::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1442,7 +1442,7 @@ bool UIRichTextXMLOutline::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLOutline::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLOutline::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1531,7 +1531,7 @@ bool UIRichTextXMLShadow::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLShadow::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLShadow::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1540,7 +1540,7 @@ bool UIRichTextXMLShadow::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLShadow::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLShadow::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1549,7 +1549,7 @@ bool UIRichTextXMLShadow::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLShadow::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLShadow::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1638,7 +1638,7 @@ bool UIRichTextXMLGlow::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLGlow::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLGlow::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1647,7 +1647,7 @@ bool UIRichTextXMLGlow::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLGlow::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLGlow::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1656,7 +1656,7 @@ bool UIRichTextXMLGlow::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLGlow::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLGlow::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1744,7 +1744,7 @@ bool UIRichTextXMLExtend::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLExtend::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLExtend::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1753,7 +1753,7 @@ bool UIRichTextXMLExtend::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLExtend::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLExtend::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1762,7 +1762,7 @@ bool UIRichTextXMLExtend::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLExtend::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLExtend::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1886,7 +1886,7 @@ bool UIRichTextXMLSpace::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSpace::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSpace::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1895,7 +1895,7 @@ bool UIRichTextXMLSpace::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSpace::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSpace::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1904,7 +1904,7 @@ bool UIRichTextXMLSpace::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSpace::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSpace::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp index 7a8b2241af..59b3940c07 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp @@ -828,15 +828,15 @@ bool UIS9Flip::init() statusLabel->setString("Scale9Disabled"); } - CCLOG("scaleX = %f", flipXSprite->getScaleX()); - CCLOG("scaleY = %f", flipYSprite->getScale()); + AXLOG("scaleX = %f", flipXSprite->getScaleX()); + AXLOG("scaleY = %f", flipYSprite->getScale()); if (flipXSprite->isFlippedX()) { - CCLOG("xxxxxxx"); + AXLOG("xxxxxxx"); } if (flipYSprite->isFlippedY()) { - CCLOG("YYYYYY"); + AXLOG("YYYYYY"); } if (flipXSprite->isFlippedX()) @@ -890,10 +890,10 @@ bool UIS9ChangeAnchorPoint::init() { normalSprite->setAnchorPoint(Vec2::ZERO); normalSprite->setScale9Enabled(true); - CCLOG("position = %f, %f, anchor point = %f, %f", normalSprite->getPosition().x, + AXLOG("position = %f, %f, anchor point = %f, %f", normalSprite->getPosition().x, normalSprite->getPosition().y, normalSprite->getAnchorPoint().x, normalSprite->getAnchorPoint().y); - CCLOG("tests:content size : width = %f, height = %f", normalSprite->getContentSize().width, + AXLOG("tests:content size : width = %f, height = %f", normalSprite->getContentSize().width, normalSprite->getContentSize().height); } }); @@ -908,10 +908,10 @@ bool UIS9ChangeAnchorPoint::init() { normalSprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT); normalSprite->setScale9Enabled(false); - CCLOG("position = %f, %f, anchor point = %f, %f", normalSprite->getPosition().x, + AXLOG("position = %f, %f, anchor point = %f, %f", normalSprite->getPosition().x, normalSprite->getPosition().y, normalSprite->getAnchorPoint().x, normalSprite->getAnchorPoint().y); - CCLOG("tests:content size : width = %f, height = %f", normalSprite->getContentSize().width, + AXLOG("tests:content size : width = %f, height = %f", normalSprite->getContentSize().width, normalSprite->getContentSize().height); } }); @@ -939,14 +939,14 @@ bool UIS9NinePatchTest::init() playerSprite->setPosition(x, y); playerSprite->setContentSize(preferedSize); auto capInsets = playerSprite->getCapInsets(); - CCLOG("player sprite capInset = %g, %g %g, %g", capInsets.origin.x, capInsets.origin.y, capInsets.size.width, + AXLOG("player sprite capInset = %g, %g %g, %g", capInsets.origin.x, capInsets.origin.y, capInsets.size.width, capInsets.size.height); this->addChild(playerSprite); auto animationBtnSprite = ui::Scale9Sprite::createWithSpriteFrameName("animationbuttonpressed.png"); animationBtnSprite->setPosition(x - 100, y - 100); capInsets = animationBtnSprite->getCapInsets(); - CCLOG("animationBtnSprite capInset = %g, %g %g, %g", capInsets.origin.x, capInsets.origin.y, + AXLOG("animationBtnSprite capInset = %g, %g %g, %g", capInsets.origin.x, capInsets.origin.y, capInsets.size.width, capInsets.size.height); this->addChild(animationBtnSprite); @@ -954,7 +954,7 @@ bool UIS9NinePatchTest::init() monsterSprite->setPosition(x + 100, y - 100); capInsets = monsterSprite->getCapInsets(); monsterSprite->setContentSize(preferedSize); - CCLOG("monsterSprite capInset = %g, %g %g, %g", capInsets.origin.x, capInsets.origin.y, capInsets.size.width, + AXLOG("monsterSprite capInset = %g, %g %g, %g", capInsets.origin.x, capInsets.origin.y, capInsets.size.width, capInsets.size.height); this->addChild(monsterSprite); @@ -1174,7 +1174,7 @@ bool UIS9GrayStateOpacityTest::init() slider->setMaxPercent(100); slider->setPercent(100 * 100.0f / 255.0); slider->setPosition(Vec2(winSize.width / 2.0f, winSize.height / 2.0f - 100)); - slider->addEventListener(CC_CALLBACK_2(UIS9GrayStateOpacityTest::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(UIS9GrayStateOpacityTest::sliderEvent, this)); _uiLayer->addChild(slider); return true; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp index f195a097eb..06717ea6a4 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp @@ -820,13 +820,13 @@ bool UIScrollViewStopScrollingTest::init() switch (e) { case ui::ScrollView::EventType::SCROLLING_BEGAN: - CCLOG("scrolling began!"); + AXLOG("scrolling began!"); break; case ui::ScrollView::EventType::SCROLLING_ENDED: - CCLOG("scrolling ended!"); + AXLOG("scrolling ended!"); break; case ui::ScrollView::EventType::AUTOSCROLL_ENDED: - CCLOG("auto-scrolling ended!"); + AXLOG("auto-scrolling ended!"); break; default: break; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp index 7b903f4588..ef2312bea2 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp @@ -71,14 +71,14 @@ bool UISliderTest::init() slider->setMaxPercent(10000); slider->setPosition( Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f /* + slider->getSize().height * 2.0f*/)); - slider->addEventListener(CC_CALLBACK_2(UISliderTest::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(UISliderTest::sliderEvent, this)); _uiLayer->addChild(slider); _slider = slider; TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UISliderTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UISliderTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); @@ -103,18 +103,18 @@ void UISliderTest::sliderEvent(Ref* pSender, Slider::EventType type) void UISliderTest::printWidgetResources(axis::Ref* /*sender*/) { axis::ResourceData textureFile = _slider->getBackFile(); - CCLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); + AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); axis::ResourceData progressBarTextureFile = _slider->getProgressBarFile(); - CCLOG("progressBarTextureFile Name : %s, Type: %d", progressBarTextureFile.file.c_str(), + AXLOG("progressBarTextureFile Name : %s, Type: %d", progressBarTextureFile.file.c_str(), progressBarTextureFile.type); axis::ResourceData slidBallNormalTextureFile = _slider->getBallNormalFile(); - CCLOG("slidBallNormalTextureFile Name : %s, Type: %d", slidBallNormalTextureFile.file.c_str(), + AXLOG("slidBallNormalTextureFile Name : %s, Type: %d", slidBallNormalTextureFile.file.c_str(), slidBallNormalTextureFile.type); axis::ResourceData slidBallPressedTextureFile = _slider->getBallPressedFile(); - CCLOG("slidBallPressedTextureFile Name : %s, Type: %d", slidBallPressedTextureFile.file.c_str(), + AXLOG("slidBallPressedTextureFile Name : %s, Type: %d", slidBallPressedTextureFile.file.c_str(), slidBallPressedTextureFile.type); axis::ResourceData slidBallDisabledTextureFile = _slider->getBallDisabledFile(); - CCLOG("slidBallDisabledTextureFile Name : %s, Type: %d", slidBallDisabledTextureFile.file.c_str(), + AXLOG("slidBallDisabledTextureFile Name : %s, Type: %d", slidBallDisabledTextureFile.file.c_str(), slidBallDisabledTextureFile.type); } @@ -153,7 +153,7 @@ bool UISliderTest_Scale9::init() slider->setContentSize(Size(250.0f, 19.0f)); slider->setPosition( Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f /* + slider->getSize().height * 3.0f*/)); - slider->addEventListener(CC_CALLBACK_2(UISliderTest_Scale9::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(UISliderTest_Scale9::sliderEvent, this)); _uiLayer->addChild(slider); return true; @@ -362,18 +362,18 @@ bool UISliderNewEventCallbackTest::init() slider->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + 50)); slider->addEventListener([=](Ref* widget, Slider::EventType type) { Slider* slider = (Slider*)widget; - CC_UNUSED_PARAM(slider); + AX_UNUSED_PARAM(slider); if (type == Slider::EventType::ON_SLIDEBALL_DOWN) { - CCLOG("slider button pressed!"); + AXLOG("slider button pressed!"); } else if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) { - CCLOG("slider is moving! percent = %f", 100.0f * slider->getPercent() / slider->getMaxPercent()); + AXLOG("slider is moving! percent = %f", 100.0f * slider->getPercent() / slider->getMaxPercent()); } else if (type == Slider::EventType::ON_SLIDEBALL_UP) { - CCLOG("slider button is released."); + AXLOG("slider button is released."); } }); _uiLayer->addChild(slider); @@ -411,7 +411,7 @@ bool UISliderIssue12249Test::init() slider->setMaxPercent(10000); slider->setPosition( Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f /* + slider->getSize().height * 2.0f*/)); - slider->addEventListener(CC_CALLBACK_2(UISliderIssue12249Test::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(UISliderIssue12249Test::sliderEvent, this)); _uiLayer->addChild(slider); return true; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp index 014bc4a43f..aaa09af90c 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp @@ -63,7 +63,7 @@ bool UITextAtlasTest::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UITextAtlasTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UITextAtlasTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); @@ -76,7 +76,7 @@ bool UITextAtlasTest::init() void UITextAtlasTest::printWidgetResources(axis::Ref* sender) { axis::ResourceData textureFile = _textAtlas->getRenderFile(); - CCLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); + AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); } // UITextAtlasETC1ShadowTest @@ -113,7 +113,7 @@ bool UITextAtlasETC1ShadowTest::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); auto item1 = - MenuItemLabel::create(label1, CC_CALLBACK_1(UITextAtlasETC1ShadowTest::printWidgetResources, this)); + MenuItemLabel::create(label1, AX_CALLBACK_1(UITextAtlasETC1ShadowTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); @@ -126,5 +126,5 @@ bool UITextAtlasETC1ShadowTest::init() void UITextAtlasETC1ShadowTest::printWidgetResources(axis::Ref* sender) { axis::ResourceData textureFile = _textAtlas->getRenderFile(); - CCLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); + AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp index f6815ae8ea..366c55bf89 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp @@ -55,7 +55,7 @@ bool UITextBMFontTest::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UITextBMFontTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UITextBMFontTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); @@ -69,5 +69,5 @@ bool UITextBMFontTest::init() void UITextBMFontTest::printWidgetResources(axis::Ref* sender) { axis::ResourceData textureFile = _textBMFont->getRenderFile(); - CCLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); + AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp index 527cb43030..60cad84610 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp @@ -67,7 +67,7 @@ bool UITextFieldTest::init() TextField* textField = TextField::create("input words here", "Arial", 30); textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest::textFieldEvent, this)); _uiLayer->addChild(textField); return true; @@ -142,7 +142,7 @@ bool UITextFieldTest_MaxLength::init() textField->setMaxLengthEnabled(true); textField->setMaxLength(3); textField->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_MaxLength::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest_MaxLength::textFieldEvent, this)); _uiLayer->addChild(textField); return true; @@ -223,7 +223,7 @@ bool UITextFieldTest_Password::init() textField->setPasswordEnabled(true); textField->setPasswordStyleText("*"); textField->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_Password::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest_Password::textFieldEvent, this)); _uiLayer->addChild(textField); return true; @@ -302,7 +302,7 @@ bool UITextFieldTest_LineWrap::init() textField->setTextHorizontalAlignment(TextHAlignment::CENTER); textField->setTextVerticalAlignment(TextVAlignment::CENTER); textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_LineWrap::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest_LineWrap::textFieldEvent, this)); _uiLayer->addChild(textField); return true; @@ -376,7 +376,7 @@ bool UITextFieldTest_TrueTypeFont::init() TextField* textField = TextField::create("input words here", "fonts/A Damn Mess.ttf", 30); textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_TrueTypeFont::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest_TrueTypeFont::textFieldEvent, this)); _uiLayer->addChild(textField); return true; @@ -449,7 +449,7 @@ bool UITextFieldTest_BMFont::init() TextField* textField = TextField::create("BMFont Text", "fonts/bitmapFontTest3.fnt", 30); textField->setCursorEnabled(true); textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_BMFont::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest_BMFont::textFieldEvent, this)); _uiLayer->addChild(textField); return true; @@ -526,7 +526,7 @@ bool UITextFieldTest_PlaceHolderColor::init() textField->setPlaceHolderColor(Color4B::GREEN); textField->setTextColor(Color4B::RED); textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_PlaceHolderColor::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest_PlaceHolderColor::textFieldEvent, this)); _uiLayer->addChild(textField); return true; } @@ -560,7 +560,7 @@ void UITextFieldTest_PlaceHolderColor::textFieldEvent(Ref* pSender, TextField::E case TextField::EventType::INSERT_TEXT: { _displayValueLabel->setString(StringUtils::format("insert words")); - CCLOG("%f, %f", dynamic_cast(pSender)->getContentSize().width, + AXLOG("%f, %f", dynamic_cast(pSender)->getContentSize().width, dynamic_cast(pSender)->getContentSize().height); } break; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp index eb07f3fe35..a0dad0210e 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp @@ -148,14 +148,14 @@ bool UILabelTest_Effect::init() // create the label stroke and shadow Text* outline_label = Text::create(); outline_label->setString("Outline"); - CCLOG("content size without outline: %f %f", outline_label->getContentSize().width, + AXLOG("content size without outline: %f %f", outline_label->getContentSize().width, outline_label->getContentSize().height); outline_label->enableOutline(Color4B::GREEN, 4); outline_label->setPosition( Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - shadow_label->getContentSize().height - 50)); _uiLayer->addChild(outline_label); - CCLOG("content size after applying outline: %f %f", outline_label->getContentSize().width, + AXLOG("content size after applying outline: %f %f", outline_label->getContentSize().width, outline_label->getContentSize().height); // create buttons to disable effect and add @@ -166,7 +166,7 @@ bool UILabelTest_Effect::init() disableOutlineBtn->setPressedActionEnabled(true); disableOutlineBtn->addClickEventListener([=](Ref*) { outline_label->disableEffect(LabelEffect::OUTLINE); - CCLOG("content size after disable outline: %f %f", outline_label->getContentSize().width, + AXLOG("content size after disable outline: %f %f", outline_label->getContentSize().width, outline_label->getContentSize().height); }); this->addChild(disableOutlineBtn); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp index aed5f0167b..14f95a4a57 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp @@ -46,42 +46,42 @@ bool VideoPlayerTest::init() MenuItemFont::setFontSize(16); auto fullSwitch = - MenuItemFont::create("FullScreenSwitch", CC_CALLBACK_1(VideoPlayerTest::menuFullScreenCallback, this)); + MenuItemFont::create("FullScreenSwitch", AX_CALLBACK_1(VideoPlayerTest::menuFullScreenCallback, this)); fullSwitch->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); fullSwitch->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 50)); - auto pauseItem = MenuItemFont::create("Pause", CC_CALLBACK_1(VideoPlayerTest::menuPauseCallback, this)); + auto pauseItem = MenuItemFont::create("Pause", AX_CALLBACK_1(VideoPlayerTest::menuPauseCallback, this)); pauseItem->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); pauseItem->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 100)); - auto resumeItem = MenuItemFont::create("Resume", CC_CALLBACK_1(VideoPlayerTest::menuResumeCallback, this)); + auto resumeItem = MenuItemFont::create("Resume", AX_CALLBACK_1(VideoPlayerTest::menuResumeCallback, this)); resumeItem->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); resumeItem->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 150)); - auto stopItem = MenuItemFont::create("Stop", CC_CALLBACK_1(VideoPlayerTest::menuStopCallback, this)); + auto stopItem = MenuItemFont::create("Stop", AX_CALLBACK_1(VideoPlayerTest::menuStopCallback, this)); stopItem->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); stopItem->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 200)); - auto hintItem = MenuItemFont::create("Hint", CC_CALLBACK_1(VideoPlayerTest::menuHintCallback, this)); + auto hintItem = MenuItemFont::create("Hint", AX_CALLBACK_1(VideoPlayerTest::menuHintCallback, this)); hintItem->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); hintItem->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 250)); //------------------------------------------------------------------------------------------------------------------- auto resourceVideo = - MenuItemFont::create("Play resource video", CC_CALLBACK_1(VideoPlayerTest::menuResourceVideoCallback, this)); + MenuItemFont::create("Play resource video", AX_CALLBACK_1(VideoPlayerTest::menuResourceVideoCallback, this)); resourceVideo->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); resourceVideo->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10, _visibleRect.origin.y + 50)); auto onlineVideo = - MenuItemFont::create("Play online video", CC_CALLBACK_1(VideoPlayerTest::menuOnlineVideoCallback, this)); + MenuItemFont::create("Play online video", AX_CALLBACK_1(VideoPlayerTest::menuOnlineVideoCallback, this)); onlineVideo->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); onlineVideo->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10, _visibleRect.origin.y + 100)); - auto ratioSwitch = MenuItemFont::create("KeepRatioSwitch", CC_CALLBACK_1(VideoPlayerTest::menuRatioCallback, this)); + auto ratioSwitch = MenuItemFont::create("KeepRatioSwitch", AX_CALLBACK_1(VideoPlayerTest::menuRatioCallback, this)); ratioSwitch->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); ratioSwitch->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10, _visibleRect.origin.y + 150)); - auto loopToggle = MenuItemFont::create("LoopToogle", CC_CALLBACK_1(VideoPlayerTest::menuLoopCallback, this)); + auto loopToggle = MenuItemFont::create("LoopToogle", AX_CALLBACK_1(VideoPlayerTest::menuLoopCallback, this)); loopToggle->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); loopToggle->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10, _visibleRect.origin.y + 170)); @@ -215,7 +215,7 @@ void VideoPlayerTest::createVideo() _videoPlayer->setContentSize(Size(widgetSize.width * 0.4f, widgetSize.height * 0.4f)); _uiLayer->addChild(_videoPlayer); - _videoPlayer->addEventListener(CC_CALLBACK_2(VideoPlayerTest::videoEventCallback, this)); + _videoPlayer->addEventListener(AX_CALLBACK_2(VideoPlayerTest::videoEventCallback, this)); } void VideoPlayerTest::createSlider() @@ -230,7 +230,7 @@ void VideoPlayerTest::createSlider() hSlider->loadProgressBarTexture("cocosui/sliderProgress.png"); hSlider->setPosition(Vec2(centerPos.x, _visibleRect.origin.y + _visibleRect.size.height * 0.15f)); hSlider->setPercent(50); - hSlider->addEventListener(CC_CALLBACK_2(VideoPlayerTest::sliderCallback, this)); + hSlider->addEventListener(AX_CALLBACK_2(VideoPlayerTest::sliderCallback, this)); _uiLayer->addChild(hSlider, 0, 1); auto vSlider = ui::Slider::create(); @@ -241,7 +241,7 @@ void VideoPlayerTest::createSlider() vSlider->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width * 0.15f, centerPos.y)); vSlider->setRotation(90); vSlider->setPercent(50); - vSlider->addEventListener(CC_CALLBACK_2(VideoPlayerTest::sliderCallback, this)); + vSlider->addEventListener(AX_CALLBACK_2(VideoPlayerTest::sliderCallback, this)); _uiLayer->addChild(vSlider, 0, 2); } @@ -335,12 +335,12 @@ bool SimpleVideoPlayerTest::init() MenuItemFont::setFontSize(16); _switchStyle = - MenuItemFont::create("Switch Style", CC_CALLBACK_1(SimpleVideoPlayerTest::switchStyleCallback, this)); + MenuItemFont::create("Switch Style", AX_CALLBACK_1(SimpleVideoPlayerTest::switchStyleCallback, this)); _switchStyle->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); _switchStyle->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 50)); _switchUserInputEnabled = - MenuItemFont::create("Enable User Input", CC_CALLBACK_1(SimpleVideoPlayerTest::switchUserInputCallback, this)); + MenuItemFont::create("Enable User Input", AX_CALLBACK_1(SimpleVideoPlayerTest::switchUserInputCallback, this)); _switchUserInputEnabled->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); _switchUserInputEnabled->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 100)); @@ -372,7 +372,7 @@ void SimpleVideoPlayerTest::menuCloseCallback(Ref* sender) { Director::getInstance()->end(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) exit(0); #endif } @@ -433,7 +433,7 @@ void SimpleVideoPlayerTest::createVideo() _uiLayer->addChild(_videoPlayer); - // _videoPlayer->addEventListener(CC_CALLBACK_2(SimpleVideoPlayerTest::videoEventCallback, this)); + // _videoPlayer->addEventListener(AX_CALLBACK_2(SimpleVideoPlayerTest::videoEventCallback, this)); _videoPlayer->setFileName("cocosvideo.mp4"); _videoPlayer->play(); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp index 1fa295c514..ffe3732bb2 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp @@ -45,9 +45,9 @@ bool WebViewTest::init() _webView->loadURL("https://www.baidu.com"); _webView->setScalesPageToFit(true); - _webView->setOnShouldStartLoading(CC_CALLBACK_2(WebViewTest::onWebViewShouldStartLoading, this)); - _webView->setOnDidFinishLoading(CC_CALLBACK_2(WebViewTest::onWebViewDidFinishLoading, this)); - _webView->setOnDidFailLoading(CC_CALLBACK_2(WebViewTest::onWebViewDidFailLoading, this)); + _webView->setOnShouldStartLoading(AX_CALLBACK_2(WebViewTest::onWebViewShouldStartLoading, this)); + _webView->setOnDidFinishLoading(AX_CALLBACK_2(WebViewTest::onWebViewDidFinishLoading, this)); + _webView->setOnDidFailLoading(AX_CALLBACK_2(WebViewTest::onWebViewDidFailLoading, this)); this->addChild(_webView); @@ -174,7 +174,7 @@ bool WebViewTest::init() bool WebViewTest::onWebViewShouldStartLoading(ui::WebView* sender, std::string_view url) { - CCLOG("onWebViewShouldStartLoading, url is %s", url.data()); + AXLOG("onWebViewShouldStartLoading, url is %s", url.data()); // don't do any OpenGL operation here!! It's forbidden! return true; } @@ -183,10 +183,10 @@ void WebViewTest::onWebViewDidFinishLoading(ui::WebView* sender, std::string_vie { auto node = (ui::Button*)this->getChildByName("evalJs"); node->setTitleText("start loading..."); - CCLOG("onWebViewDidFinishLoading, url is %s", url.data()); + AXLOG("onWebViewDidFinishLoading, url is %s", url.data()); } void WebViewTest::onWebViewDidFailLoading(ui::WebView* sender, std::string_view url) { - CCLOG("onWebViewDidFailLoading, url is %s", url.data()); + AXLOG("onWebViewDidFailLoading, url is %s", url.data()); } diff --git a/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp b/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp index 99be32e2d1..b568c3efbc 100644 --- a/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp +++ b/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp @@ -32,7 +32,7 @@ USING_NS_AX; using namespace axis::network; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # if defined(__arm64__) # define USE_NEON64 # define INCLUDE_NEON64 @@ -41,7 +41,7 @@ using namespace axis::network; # define INCLUDE_NEON32 # else # endif -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # if defined(__arm64__) || defined(__aarch64__) # define USE_NEON64 # define INCLUDE_NEON64 @@ -96,51 +96,51 @@ void TemplateVectorTest::onEnter() UnitTestDemo::onEnter(); Vector vec; - CCASSERT(vec.empty(), "vec should be empty."); - CCASSERT(vec.capacity() == 0, "vec.capacity should be 0."); - CCASSERT(vec.size() == 0, "vec.size should be 0."); - CCASSERT(vec.max_size() > 0, "vec.max_size should > 0."); + AXASSERT(vec.empty(), "vec should be empty."); + AXASSERT(vec.capacity() == 0, "vec.capacity should be 0."); + AXASSERT(vec.size() == 0, "vec.size should be 0."); + AXASSERT(vec.max_size() > 0, "vec.max_size should > 0."); auto node1 = Node::create(); node1->setTag(1); vec.pushBack(node1); - CCASSERT(node1->getReferenceCount() == 2, "node1->getReferenceCount should be 2."); + AXASSERT(node1->getReferenceCount() == 2, "node1->getReferenceCount should be 2."); auto node2 = Node::create(); node2->setTag(2); vec.pushBack(node2); - CCASSERT(vec.getIndex(node1) == 0, "node1 should at index 0 in vec."); - CCASSERT(vec.getIndex(node2) == 1, "node2 should at index 1 in vec."); + AXASSERT(vec.getIndex(node1) == 0, "node1 should at index 0 in vec."); + AXASSERT(vec.getIndex(node2) == 1, "node2 should at index 1 in vec."); auto node3 = Node::create(); node3->setTag(3); vec.insert(1, node3); - CCASSERT(vec.at(0)->getTag() == 1, "The element at 0, tag should be 1."); - CCASSERT(vec.at(1)->getTag() == 3, "The element at 1, tag should be 3."); - CCASSERT(vec.at(2)->getTag() == 2, "The element at 2, tag should be 2."); + AXASSERT(vec.at(0)->getTag() == 1, "The element at 0, tag should be 1."); + AXASSERT(vec.at(1)->getTag() == 3, "The element at 1, tag should be 3."); + AXASSERT(vec.at(2)->getTag() == 2, "The element at 2, tag should be 2."); // Test copy constructor Vector vec2(vec); - CCASSERT(vec2.size() == vec.size(), "vec2 and vec should have equal size."); + AXASSERT(vec2.size() == vec.size(), "vec2 and vec should have equal size."); ssize_t size = vec.size(); for (ssize_t i = 0; i < size; ++i) { - CCASSERT(vec2.at(i) == vec.at(i), "The element at the same index in vec2 and vec2 should be equal."); - CCASSERT(vec.at(i)->getReferenceCount() == 3, "The reference count of element in vec is 3. "); - CCASSERT(vec2.at(i)->getReferenceCount() == 3, "The reference count of element in vec2 is 3. "); + AXASSERT(vec2.at(i) == vec.at(i), "The element at the same index in vec2 and vec2 should be equal."); + AXASSERT(vec.at(i)->getReferenceCount() == 3, "The reference count of element in vec is 3. "); + AXASSERT(vec2.at(i)->getReferenceCount() == 3, "The reference count of element in vec2 is 3. "); } // Test copy assignment operator Vector vec3; vec3 = vec2; - CCASSERT(vec3.size() == vec2.size(), "vec3 and vec2 should have equal size."); + AXASSERT(vec3.size() == vec2.size(), "vec3 and vec2 should have equal size."); size = vec3.size(); for (ssize_t i = 0; i < size; ++i) { - CCASSERT(vec3.at(i) == vec2.at(i), "The element at the same index in vec3 and vec2 should be equal."); - CCASSERT(vec3.at(i)->getReferenceCount() == 4, "The reference count of element in vec3 is 4. "); - CCASSERT(vec2.at(i)->getReferenceCount() == 4, "The reference count of element in vec2 is 4. "); - CCASSERT(vec.at(i)->getReferenceCount() == 4, "The reference count of element in vec is 4. "); + AXASSERT(vec3.at(i) == vec2.at(i), "The element at the same index in vec3 and vec2 should be equal."); + AXASSERT(vec3.at(i)->getReferenceCount() == 4, "The reference count of element in vec3 is 4. "); + AXASSERT(vec2.at(i)->getReferenceCount() == 4, "The reference count of element in vec2 is 4. "); + AXASSERT(vec.at(i)->getReferenceCount() == 4, "The reference count of element in vec is 4. "); } // Test move constructor @@ -165,76 +165,76 @@ void TemplateVectorTest::onEnter() Vector vec4(createVector()); for (const auto& child : vec4) { - CC_UNUSED_PARAM(child); - CCASSERT(child->getReferenceCount() == 2, "child's reference count should be 2."); + AX_UNUSED_PARAM(child); + AXASSERT(child->getReferenceCount() == 2, "child's reference count should be 2."); } // Test init Vector with capacity Vector vec5(10); - CCASSERT(vec5.capacity() == 10, "vec5's capacity should be 10."); + AXASSERT(vec5.capacity() == 10, "vec5's capacity should be 10."); vec5.reserve(20); - CCASSERT(vec5.capacity() == 20, "vec5's capacity should be 20."); + AXASSERT(vec5.capacity() == 20, "vec5's capacity should be 20."); - CCASSERT(vec5.size() == 0, "vec5's size should be 0."); - CCASSERT(vec5.empty(), "vec5 is empty now."); + AXASSERT(vec5.size() == 0, "vec5's size should be 0."); + AXASSERT(vec5.empty(), "vec5 is empty now."); auto toRemovedNode = Node::create(); vec5.pushBack(toRemovedNode); - CCASSERT(toRemovedNode->getReferenceCount() == 2, "toRemovedNode's reference count is 2."); + AXASSERT(toRemovedNode->getReferenceCount() == 2, "toRemovedNode's reference count is 2."); // Test move assignment operator vec5 = createVector(); - CCASSERT(toRemovedNode->getReferenceCount() == 1, "toRemovedNode's reference count is 1."); - CCASSERT(vec5.size() == 20, "size should be 20"); + AXASSERT(toRemovedNode->getReferenceCount() == 1, "toRemovedNode's reference count is 1."); + AXASSERT(vec5.size() == 20, "size should be 20"); for (const auto& child : vec5) { - CC_UNUSED_PARAM(child); - CCASSERT(child->getReferenceCount() == 2, "child's reference count is 2."); + AX_UNUSED_PARAM(child); + AXASSERT(child->getReferenceCount() == 2, "child's reference count is 2."); } // Test Vector::find - CCASSERT(vec.find(node3) == (vec.begin() + 1), "node3 is the 2nd element in vec."); - CCASSERT(std::find(std::begin(vec), std::end(vec), node2) == (vec.begin() + 2), "node2 is the 3rd element in vec."); + AXASSERT(vec.find(node3) == (vec.begin() + 1), "node3 is the 2nd element in vec."); + AXASSERT(std::find(std::begin(vec), std::end(vec), node2) == (vec.begin() + 2), "node2 is the 3rd element in vec."); - CCASSERT(vec.front()->getTag() == 1, "vec's front element's tag is 1."); - CCASSERT(vec.back()->getTag() == 2, "vec's back element's tag is 2."); + AXASSERT(vec.front()->getTag() == 1, "vec's front element's tag is 1."); + AXASSERT(vec.back()->getTag() == 2, "vec's back element's tag is 2."); - CCASSERT(vec.getRandomObject(), "vec getRandomObject should return true."); - CCASSERT(!vec.contains(Node::create()), "vec doesn't contain a empty Node instance."); - CCASSERT(vec.contains(node1), "vec contains node1."); - CCASSERT(vec.contains(node2), "vec contains node2."); - CCASSERT(vec.contains(node3), "vec contains node3."); - CCASSERT(vec.equals(vec2), "vec is equal to vec2."); - CCASSERT(vec.equals(vec3), "vec is equal to vec3."); + AXASSERT(vec.getRandomObject(), "vec getRandomObject should return true."); + AXASSERT(!vec.contains(Node::create()), "vec doesn't contain a empty Node instance."); + AXASSERT(vec.contains(node1), "vec contains node1."); + AXASSERT(vec.contains(node2), "vec contains node2."); + AXASSERT(vec.contains(node3), "vec contains node3."); + AXASSERT(vec.equals(vec2), "vec is equal to vec2."); + AXASSERT(vec.equals(vec3), "vec is equal to vec3."); // Insert vec5.insert(2, node1); - CCASSERT(vec5.at(2)->getTag() == 1, "vec5's 3rd element's tag is 1."); - CCASSERT(vec5.size() == 21, "vec5's size is 21."); + AXASSERT(vec5.at(2)->getTag() == 1, "vec5's 3rd element's tag is 1."); + AXASSERT(vec5.size() == 21, "vec5's size is 21."); vec5.back()->setTag(100); vec5.popBack(); - CCASSERT(vec5.size() == 20, "vec5's size is 20."); - CCASSERT(vec5.back()->getTag() != 100, "the back element of vec5's tag is 100."); + AXASSERT(vec5.size() == 20, "vec5's size is 20."); + AXASSERT(vec5.back()->getTag() != 100, "the back element of vec5's tag is 100."); // Erase and clear Vector vec6 = createVector(); Vector vec7 = vec6; // Copy for check - CCASSERT(vec6.size() == 20, "vec6's size is 20."); + AXASSERT(vec6.size() == 20, "vec6's size is 20."); vec6.erase(vec6.begin() + 1); // - CCASSERT(vec6.size() == 19, "vec6's size is 19."); - CCASSERT((*(vec6.begin() + 1))->getTag() == 1002, "The 2rd element in vec6's tag is 1002."); + AXASSERT(vec6.size() == 19, "vec6's size is 19."); + AXASSERT((*(vec6.begin() + 1))->getTag() == 1002, "The 2rd element in vec6's tag is 1002."); vec6.erase(vec6.begin() + 2, vec6.begin() + 10); - CCASSERT(vec6.size() == 11, "vec6's size is 11."); - CCASSERT(vec6.at(0)->getTag() == 1000, "vec6's first element's tag is 1000."); - CCASSERT(vec6.at(1)->getTag() == 1002, "vec6's second element's tag is 1002."); - CCASSERT(vec6.at(2)->getTag() == 1011, "vec6's third element's tag is 1011."); - CCASSERT(vec6.at(3)->getTag() == 1012, "vec6's fouth element's tag is 1012."); + AXASSERT(vec6.size() == 11, "vec6's size is 11."); + AXASSERT(vec6.at(0)->getTag() == 1000, "vec6's first element's tag is 1000."); + AXASSERT(vec6.at(1)->getTag() == 1002, "vec6's second element's tag is 1002."); + AXASSERT(vec6.at(2)->getTag() == 1011, "vec6's third element's tag is 1011."); + AXASSERT(vec6.at(3)->getTag() == 1012, "vec6's fouth element's tag is 1012."); vec6.erase(3); - CCASSERT(vec6.at(3)->getTag() == 1013, "vec6's 4th element's tag is 1013."); + AXASSERT(vec6.at(3)->getTag() == 1013, "vec6's 4th element's tag is 1013."); vec6.eraseObject(vec6.at(2)); - CCASSERT(vec6.at(2)->getTag() == 1013, "vec6's 3rd element's tag is 1013."); + AXASSERT(vec6.at(2)->getTag() == 1013, "vec6's 3rd element's tag is 1013."); vec6.clear(); auto objA = Node::create(); // retain count is 1 @@ -257,9 +257,9 @@ void TemplateVectorTest::onEnter() { array2.eraseObject(obj); } - CCASSERT(objA->getReferenceCount() == 4, "objA's reference count is 4."); + AXASSERT(objA->getReferenceCount() == 4, "objA's reference count is 4."); } - CCASSERT(objA->getReferenceCount() == 1, "objA's reference count is 1."); + AXASSERT(objA->getReferenceCount() == 1, "objA's reference count is 1."); { Vector array1; @@ -267,25 +267,25 @@ void TemplateVectorTest::onEnter() array1.pushBack(objA); // retain count is 2 array1.pushBack(objA); // retain count is 3 array1.pushBack(objA); // retain count is 4 - CCASSERT(objA->getReferenceCount() == 4, "objA's reference count is 4."); + AXASSERT(objA->getReferenceCount() == 4, "objA's reference count is 4."); array1.eraseObject(objA, true); // Remove all occurrences in the Vector. - CCASSERT(objA->getReferenceCount() == 1, "objA's reference count is 1."); + AXASSERT(objA->getReferenceCount() == 1, "objA's reference count is 1."); array1.pushBack(objA); // retain count is 2 array1.pushBack(objA); // retain count is 3 array1.pushBack(objA); // retain count is 4 array1.eraseObject(objA, false); - CCASSERT(objA->getReferenceCount() == 3, + AXASSERT(objA->getReferenceCount() == 3, "objA's reference count is 3."); // Only remove the first occurrence in the Vector. } // Check the retain count in vec7 - CCASSERT(vec7.size() == 20, "vec7's size is 20."); + AXASSERT(vec7.size() == 20, "vec7's size is 20."); for (const auto& child : vec7) { - CC_UNUSED_PARAM(child); - CCASSERT(child->getReferenceCount() == 2, "child's reference count is 2."); + AX_UNUSED_PARAM(child); + AXASSERT(child->getReferenceCount() == 2, "child's reference count is 2."); } // Sort @@ -294,32 +294,32 @@ void TemplateVectorTest::onEnter() for (int i = 0; i < 20; ++i) { - CCASSERT(vecForSort.at(i)->getTag() - 1000 == (19 - i), "vecForSort's element's tag is invalid."); + AXASSERT(vecForSort.at(i)->getTag() - 1000 == (19 - i), "vecForSort's element's tag is invalid."); } // Reverse vecForSort.reverse(); for (int i = 0; i < 20; ++i) { - CCASSERT(vecForSort.at(i)->getTag() - 1000 == i, "vecForSort's element's tag is invalid."); + AXASSERT(vecForSort.at(i)->getTag() - 1000 == i, "vecForSort's element's tag is invalid."); } // Swap Vector vecForSwap = createVector(); vecForSwap.swap(2, 4); - CCASSERT(vecForSwap.at(2)->getTag() == 1004, "vecForSwap's 3nd element's tag is 1004."); - CCASSERT(vecForSwap.at(4)->getTag() == 1002, "vecForSwap's 5rd element's tag is 1002."); + AXASSERT(vecForSwap.at(2)->getTag() == 1004, "vecForSwap's 3nd element's tag is 1004."); + AXASSERT(vecForSwap.at(4)->getTag() == 1002, "vecForSwap's 5rd element's tag is 1002."); vecForSwap.swap(vecForSwap.at(2), vecForSwap.at(4)); - CCASSERT(vecForSwap.at(2)->getTag() == 1002, "vecForSwap's 3rd element's tag is 1002."); - CCASSERT(vecForSwap.at(4)->getTag() == 1004, "vecForSwap's 5rd element's tag is 1004."); + AXASSERT(vecForSwap.at(2)->getTag() == 1002, "vecForSwap's 3rd element's tag is 1002."); + AXASSERT(vecForSwap.at(4)->getTag() == 1004, "vecForSwap's 5rd element's tag is 1004."); // shrinkToFit Vector vecForShrink = createVector(); vecForShrink.reserve(100); - CCASSERT(vecForShrink.capacity() == 100, "vecForShrink's capacity is 100."); + AXASSERT(vecForShrink.capacity() == 100, "vecForShrink's capacity is 100."); vecForShrink.pushBack(Node::create()); vecForShrink.shrinkToFit(); - CCASSERT(vecForShrink.capacity() == 21, "vecForShrink's capacity is 21."); + AXASSERT(vecForShrink.capacity() == 21, "vecForShrink's capacity is 21."); // get random object // Set the seed by time @@ -335,21 +335,21 @@ void TemplateVectorTest::onEnter() // Self assignment Vector vecSelfAssign = createVector(); vecSelfAssign = vecSelfAssign; - CCASSERT(vecSelfAssign.size() == 20, "vecSelfAssign's size is 20."); + AXASSERT(vecSelfAssign.size() == 20, "vecSelfAssign's size is 20."); for (const auto& child : vecSelfAssign) { - CC_UNUSED_PARAM(child); - CCASSERT(child->getReferenceCount() == 2, "child's reference count is 2."); + AX_UNUSED_PARAM(child); + AXASSERT(child->getReferenceCount() == 2, "child's reference count is 2."); } vecSelfAssign = std::move(vecSelfAssign); - CCASSERT(vecSelfAssign.size() == 20, "vecSelfAssign's size is 20."); + AXASSERT(vecSelfAssign.size() == 20, "vecSelfAssign's size is 20."); for (const auto& child : vecSelfAssign) { - CC_UNUSED_PARAM(child); - CCASSERT(child->getReferenceCount() == 2, "child's reference count is 2."); + AX_UNUSED_PARAM(child); + AXASSERT(child->getReferenceCount() == 2, "child's reference count is 2."); } // const at @@ -387,25 +387,25 @@ void TemplateMapTest::onEnter() // Default constructor Map map1; - CCASSERT(map1.empty(), "map1 is empty."); - CCASSERT(map1.size() == 0, "map1's size is 0."); - CCASSERT(map1.keys().empty(), "map1's keys are empty."); - CCASSERT(map1.keys(Node::create()).empty(), "map1's keys don't contain a empty Node."); + AXASSERT(map1.empty(), "map1 is empty."); + AXASSERT(map1.size() == 0, "map1's size is 0."); + AXASSERT(map1.keys().empty(), "map1's keys are empty."); + AXASSERT(map1.keys(Node::create()).empty(), "map1's keys don't contain a empty Node."); // Move constructor auto map2 = createMap(); for (const auto& e : map2) { - CC_UNUSED_PARAM(e); - CCASSERT(e.second->getReferenceCount() == 2, "e.second element's reference count is 2."); + AX_UNUSED_PARAM(e); + AXASSERT(e.second->getReferenceCount() == 2, "e.second element's reference count is 2."); } // Copy constructor auto map3(map2); for (const auto& e : map3) { - CC_UNUSED_PARAM(e); - CCASSERT(e.second->getReferenceCount() == 3, "e.second's reference count is 3."); + AX_UNUSED_PARAM(e); + AXASSERT(e.second->getReferenceCount() == 3, "e.second's reference count is 3."); } // Move assignment operator @@ -413,11 +413,11 @@ void TemplateMapTest::onEnter() auto unusedNode = Node::create(); map4.insert("unused", unusedNode); map4 = createMap(); - CCASSERT(unusedNode->getReferenceCount() == 1, "unusedNode's reference count is 1."); + AXASSERT(unusedNode->getReferenceCount() == 1, "unusedNode's reference count is 1."); for (const auto& e : map4) { - CC_UNUSED_PARAM(e); - CCASSERT(e.second->getReferenceCount() == 2, "e.second's reference count is 2."); + AX_UNUSED_PARAM(e); + AXASSERT(e.second->getReferenceCount() == 2, "e.second's reference count is 2."); } // Copy assignment operator @@ -425,17 +425,17 @@ void TemplateMapTest::onEnter() map5 = map4; for (const auto& e : map5) { - CC_UNUSED_PARAM(e); - CCASSERT(e.second->getReferenceCount() == 3, "e.second's reference count is 3."); + AX_UNUSED_PARAM(e); + AXASSERT(e.second->getReferenceCount() == 3, "e.second's reference count is 3."); } // Check size - CCASSERT(map4.size() == map5.size(), "map4's size is equal to map5.size."); + AXASSERT(map4.size() == map5.size(), "map4's size is equal to map5.size."); for (const auto& e : map4) { - CC_UNUSED_PARAM(e); - CCASSERT(e.second == map5.find(e.first)->second, "e.second can't be found in map5."); + AX_UNUSED_PARAM(e); + AXASSERT(e.second == map5.find(e.first)->second, "e.second can't be found in map5."); } // bucket_count, bucket_size(n), bucket @@ -478,8 +478,8 @@ void TemplateMapTest::onEnter() // find auto nodeToFind = map4.find("10"); - CC_UNUSED_PARAM(nodeToFind); - CCASSERT(nodeToFind->second->getTag() == 1010, "nodeToFind's tag value is 1010."); + AX_UNUSED_PARAM(nodeToFind); + AXASSERT(nodeToFind->second->getTag() == 1010, "nodeToFind's tag value is 1010."); // insert Map map6; @@ -493,29 +493,29 @@ void TemplateMapTest::onEnter() map6.insert("insert02", node2); map6.insert("insert03", node3); - CCASSERT(node1->getReferenceCount() == 2, "node1's reference count is 2."); - CCASSERT(node2->getReferenceCount() == 2, "node2's reference count is 2."); - CCASSERT(node3->getReferenceCount() == 2, "node3's reference count is 2."); - CCASSERT(map6.at("insert01") == node1, "The element at insert01 is equal to node1."); - CCASSERT(map6.at("insert02") == node2, "The element at insert02 is equal to node2."); - CCASSERT(map6.at("insert03") == node3, "The element at insert03 is equal to node3."); + AXASSERT(node1->getReferenceCount() == 2, "node1's reference count is 2."); + AXASSERT(node2->getReferenceCount() == 2, "node2's reference count is 2."); + AXASSERT(node3->getReferenceCount() == 2, "node3's reference count is 2."); + AXASSERT(map6.at("insert01") == node1, "The element at insert01 is equal to node1."); + AXASSERT(map6.at("insert02") == node2, "The element at insert02 is equal to node2."); + AXASSERT(map6.at("insert03") == node3, "The element at insert03 is equal to node3."); // erase StringMap mapForErase = createMap(); mapForErase.erase(mapForErase.find("9")); - CCASSERT(mapForErase.find("9") == mapForErase.end(), "9 is already removed."); - CCASSERT(mapForErase.size() == 19, "mapForErase's size is 19."); + AXASSERT(mapForErase.find("9") == mapForErase.end(), "9 is already removed."); + AXASSERT(mapForErase.size() == 19, "mapForErase's size is 19."); mapForErase.erase("7"); - CCASSERT(mapForErase.find("7") == mapForErase.end(), "7 is already removed."); - CCASSERT(mapForErase.size() == 18, "mapForErase's size is 18."); + AXASSERT(mapForErase.find("7") == mapForErase.end(), "7 is already removed."); + AXASSERT(mapForErase.size() == 18, "mapForErase's size is 18."); std::vector itemsToRemove; itemsToRemove.push_back("2"); itemsToRemove.push_back("3"); itemsToRemove.push_back("4"); mapForErase.erase(itemsToRemove); - CCASSERT(mapForErase.size() == 15, "mapForErase's size is 15."); + AXASSERT(mapForErase.size() == 15, "mapForErase's size is 15."); // clear StringMap mapForClear = createMap(); @@ -524,8 +524,8 @@ void TemplateMapTest::onEnter() for (const auto& e : mapForClearCopy) { - CC_UNUSED_PARAM(e); - CCASSERT(e.second->getReferenceCount() == 2, "e.second's reference count is 2."); + AX_UNUSED_PARAM(e); + AXASSERT(e.second->getReferenceCount() == 2, "e.second's reference count is 2."); } // get random object @@ -542,21 +542,21 @@ void TemplateMapTest::onEnter() // Self assignment StringMap mapForSelfAssign = createMap(); mapForSelfAssign = mapForSelfAssign; - CCASSERT(mapForSelfAssign.size() == 20, "mapForSelfAssign's size is 20."); + AXASSERT(mapForSelfAssign.size() == 20, "mapForSelfAssign's size is 20."); for (const auto& e : mapForSelfAssign) { - CC_UNUSED_PARAM(e); - CCASSERT(e.second->getReferenceCount() == 2, "e.second's reference count is 2."); + AX_UNUSED_PARAM(e); + AXASSERT(e.second->getReferenceCount() == 2, "e.second's reference count is 2."); } mapForSelfAssign = std::move(mapForSelfAssign); - CCASSERT(mapForSelfAssign.size() == 20, "mapForSelfAssign's size is 20."); + AXASSERT(mapForSelfAssign.size() == 20, "mapForSelfAssign's size is 20."); for (const auto& e : mapForSelfAssign) { - CC_UNUSED_PARAM(e); - CCASSERT(e.second->getReferenceCount() == 2, "e.second's reference's count is 2."); + AX_UNUSED_PARAM(e); + AXASSERT(e.second->getReferenceCount() == 2, "e.second's reference's count is 2."); } } @@ -578,37 +578,37 @@ void ValueTest::onEnter() UnitTestDemo::onEnter(); Value v1; - CCASSERT(v1.getType() == Value::Type::NONE, "v1's value type should be VALUE::Type::NONE."); - CCASSERT(v1.isNull(), "v1 is null."); + AXASSERT(v1.getType() == Value::Type::NONE, "v1's value type should be VALUE::Type::NONE."); + AXASSERT(v1.isNull(), "v1 is null."); Value v2(100); - CCASSERT(v2.getType() == Value::Type::INTEGER, "v2's value type should be VALUE::Type::INTEGER."); - CCASSERT(!v2.isNull(), "v2 is not null."); + AXASSERT(v2.getType() == Value::Type::INTEGER, "v2's value type should be VALUE::Type::INTEGER."); + AXASSERT(!v2.isNull(), "v2 is not null."); Value v3(101.4f); - CCASSERT(v3.getType() == Value::Type::FLOAT, "v3's value type should be VALUE::Type::FLOAT."); - CCASSERT(!v3.isNull(), "v3 is not null."); + AXASSERT(v3.getType() == Value::Type::FLOAT, "v3's value type should be VALUE::Type::FLOAT."); + AXASSERT(!v3.isNull(), "v3 is not null."); Value v4(106.1); - CCASSERT(v4.getType() == Value::Type::DOUBLE, "v4's value type should be VALUE::Type::DOUBLE."); - CCASSERT(!v4.isNull(), "v4 is not null."); + AXASSERT(v4.getType() == Value::Type::DOUBLE, "v4's value type should be VALUE::Type::DOUBLE."); + AXASSERT(!v4.isNull(), "v4 is not null."); unsigned char byte = 50; Value v5(byte); - CCASSERT(v5.getType() == Value::Type::INT_UI32, "v5's value type should be Value::Type::INT_UI32."); - CCASSERT(!v5.isNull(), "v5 is not null."); + AXASSERT(v5.getType() == Value::Type::INT_UI32, "v5's value type should be Value::Type::INT_UI32."); + AXASSERT(!v5.isNull(), "v5 is not null."); Value v6(true); - CCASSERT(v6.getType() == Value::Type::BOOLEAN, "v6's value type is Value::Type::BOOLEAN."); - CCASSERT(!v6.isNull(), "v6 is not null."); + AXASSERT(v6.getType() == Value::Type::BOOLEAN, "v6's value type is Value::Type::BOOLEAN."); + AXASSERT(!v6.isNull(), "v6 is not null."); Value v7("string"); - CCASSERT(v7.getType() == Value::Type::STRING, "v7's value type is Value::type::STRING."); - CCASSERT(!v7.isNull(), "v7 is not null."); + AXASSERT(v7.getType() == Value::Type::STRING, "v7's value type is Value::type::STRING."); + AXASSERT(!v7.isNull(), "v7 is not null."); Value v8(std::string("string2")); - CCASSERT(v8.getType() == Value::Type::STRING, "v8's value type is Value::Type::STRING."); - CCASSERT(!v8.isNull(), "v8 is not null."); + AXASSERT(v8.getType() == Value::Type::STRING, "v8's value type is Value::Type::STRING."); + AXASSERT(!v8.isNull(), "v8 is not null."); auto createValueVector = [&]() { ValueVector ret; @@ -619,8 +619,8 @@ void ValueTest::onEnter() }; Value v9(createValueVector()); - CCASSERT(v9.getType() == Value::Type::VECTOR, "v9's value type is Value::Type::VECTOR."); - CCASSERT(!v9.isNull(), "v9 is not null."); + AXASSERT(v9.getType() == Value::Type::VECTOR, "v9's value type is Value::Type::VECTOR."); + AXASSERT(!v9.isNull(), "v9 is not null."); auto createValueMap = [&]() { ValueMap ret; @@ -631,8 +631,8 @@ void ValueTest::onEnter() }; Value v10(createValueMap()); - CCASSERT(v10.getType() == Value::Type::MAP, "v10's value type is Value::Type::MAP."); - CCASSERT(!v10.isNull(), "v10 is not null."); + AXASSERT(v10.getType() == Value::Type::MAP, "v10's value type is Value::Type::MAP."); + AXASSERT(!v10.isNull(), "v10 is not null."); auto createValueMapIntKey = [&]() { ValueMapIntKey ret; @@ -643,8 +643,8 @@ void ValueTest::onEnter() }; Value v11(createValueMapIntKey()); - CCASSERT(v11.getType() == Value::Type::INT_KEY_MAP, "v11's value type is Value::Type::INT_KEY_MAP."); - CCASSERT(!v11.isNull(), "v11 is not null."); + AXASSERT(v11.getType() == Value::Type::INT_KEY_MAP, "v11's value type is Value::Type::INT_KEY_MAP."); + AXASSERT(!v11.isNull(), "v11 is not null."); } std::string ValueTest::subtitle() const @@ -690,7 +690,7 @@ static void doUTFConversion() isSuccess = memcmp(utf8Str.data(), originalUTF8.data(), originalUTF8.length() + 1) == 0; } - CCASSERT(isSuccess, "StringUtils::UTF16ToUTF8 failed"); + AXASSERT(isSuccess, "StringUtils::UTF16ToUTF8 failed"); //--------------------------- std::u16string utf16Str; @@ -701,12 +701,12 @@ static void doUTFConversion() isSuccess = memcmp(utf16Str.data(), originalUTF16.data(), originalUTF16.length() + 1) == 0; } - CCASSERT(isSuccess && (utf16Str.length() == TEST_CODE_NUM), "StringUtils::UTF8ToUTF16 failed"); + AXASSERT(isSuccess && (utf16Str.length() == TEST_CODE_NUM), "StringUtils::UTF8ToUTF16 failed"); //--------------------------- auto vec1 = StringUtils::getChar16VectorFromUTF16String(originalUTF16); - CCASSERT(vec1.size() == originalUTF16.length(), "StringUtils::getChar16VectorFromUTF16String failed"); + AXASSERT(vec1.size() == originalUTF16.length(), "StringUtils::getChar16VectorFromUTF16String failed"); //--------------------------- std::vector vec2(vec1); @@ -718,35 +718,35 @@ static void doUTFConversion() std::vector vec3(vec2); StringUtils::trimUTF16Vector(vec2); - CCASSERT(vec1.size() == vec2.size(), "StringUtils::trimUTF16Vector failed"); + AXASSERT(vec1.size() == vec2.size(), "StringUtils::trimUTF16Vector failed"); for (size_t i = 0; i < vec2.size(); i++) { - CCASSERT(vec1.at(i) == vec2.at(i), "StringUtils::trimUTF16Vector failed"); + AXASSERT(vec1.at(i) == vec2.at(i), "StringUtils::trimUTF16Vector failed"); } //--------------------------- - CCASSERT(StringUtils::getCharacterCountInUTF8String(originalUTF8) == TEST_CODE_NUM, + AXASSERT(StringUtils::getCharacterCountInUTF8String(originalUTF8) == TEST_CODE_NUM, "StringUtils::getCharacterCountInUTF8String failed"); //--------------------------- - CCASSERT(StringUtils::getIndexOfLastNotChar16(vec3, 0x2009) == (vec1.size() - 1), + AXASSERT(StringUtils::getIndexOfLastNotChar16(vec3, 0x2009) == (vec1.size() - 1), "StringUtils::getIndexOfLastNotChar16 failed"); //--------------------------- - CCASSERT(originalUTF16.length() == TEST_CODE_NUM, + AXASSERT(originalUTF16.length() == TEST_CODE_NUM, "The length of the original utf16 string isn't equal to TEST_CODE_NUM"); //--------------------------- size_t whiteCodeNum = sizeof(WHITE_SPACE_CODE) / sizeof(WHITE_SPACE_CODE[0]); for (size_t i = 0; i < whiteCodeNum; i++) { - CCASSERT(StringUtils::isUnicodeSpace(WHITE_SPACE_CODE[i]), "StringUtils::isUnicodeSpace failed"); + AXASSERT(StringUtils::isUnicodeSpace(WHITE_SPACE_CODE[i]), "StringUtils::isUnicodeSpace failed"); } - CCASSERT(!StringUtils::isUnicodeSpace(0xFFFF), "StringUtils::isUnicodeSpace failed"); + AXASSERT(!StringUtils::isUnicodeSpace(0xFFFF), "StringUtils::isUnicodeSpace failed"); - CCASSERT(!StringUtils::isCJKUnicode(0xFFFF) && StringUtils::isCJKUnicode(0x3100), + AXASSERT(!StringUtils::isCJKUnicode(0xFFFF) && StringUtils::isCJKUnicode(0x3100), "StringUtils::isCJKUnicode failed"); } @@ -775,101 +775,101 @@ void UIHelperSubStringTest::onEnter() { // Trivial case std::string source = "abcdefghij"; - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 2) == "ab"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 2) == "cd"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 2) == "ef"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 2) == "ab"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 2) == "cd"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 2) == "ef"); } { // Empty string std::string source = ""; // OK - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); // Error: These cases cause "out of range" error - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); } { // Ascii std::string source = "abc"; // OK - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 3, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 3) == "abc"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 4) == "abc"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 2) == "bc"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 3) == "bc"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 1) == "c"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 2) == "c"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 3, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 3, 2) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 3, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 3) == "abc"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 4) == "abc"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 2) == "bc"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 3) == "bc"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 1) == "c"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 2) == "c"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 3, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 3, 2) == ""); // Error: These cases cause "out of range" error - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 1) == ""); } { // CJK characters std::string source = "这里是中文测试例"; // OK - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 7, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 8, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 8, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == "\xe8\xbf\x99"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 4) == "\xe8\xbf\x99\xe9\x87\x8c\xe6\x98\xaf\xe4\xb8\xad"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 8) == + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 7, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 8, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 8, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == "\xe8\xbf\x99"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 4) == "\xe8\xbf\x99\xe9\x87\x8c\xe6\x98\xaf\xe4\xb8\xad"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 8) == "\xe8\xbf\x99\xe9\x87\x8c\xe6\x98\xaf\xe4\xb8\xad\xe6\x96\x87\xe6\xb5\x8b\xe8\xaf\x95\xe4\xbe\x8b"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 100) == + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 100) == "\xe8\xbf\x99\xe9\x87\x8c\xe6\x98\xaf\xe4\xb8\xad\xe6\x96\x87\xe6\xb5\x8b\xe8\xaf\x95\xe4\xbe\x8b"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 5) == + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 5) == "\xe6\x98\xaf\xe4\xb8\xad\xe6\x96\x87\xe6\xb5\x8b\xe8\xaf\x95"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 6, 2) == "\xe8\xaf\x95\xe4\xbe\x8b"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 6, 100) == "\xe8\xaf\x95\xe4\xbe\x8b"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 6, 2) == "\xe8\xaf\x95\xe4\xbe\x8b"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 6, 100) == "\xe8\xaf\x95\xe4\xbe\x8b"); // Error: These cases cause "out of range" error - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 9, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 9, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 9, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 9, 1) == ""); } { // Redundant UTF-8 sequence for Directory traversal attack (1) std::string source = "\xC0\xAF"; // Error: Can't convert string to correct encoding such as UTF-32 - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 2) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 2) == ""); } { // Redundant UTF-8 sequence for Directory traversal attack (2) std::string source = "\xE0\x80\xAF"; // Error: Can't convert string to correct encoding such as UTF-32 - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 3) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 3) == ""); } { // Redundant UTF-8 sequence for Directory traversal attack (3) std::string source = "\xF0\x80\x80\xAF"; // Error: Can't convert string to correct encoding such as UTF-32 - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 4) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 4) == ""); } } @@ -1449,7 +1449,7 @@ static void __checkMathUtilResult(const char* description, const float* a1, cons { log("Wrong: a1[%d]=%f, a2[%d]=%f", i, a1[i], i, a2[i]); } - CCASSERT(r, "The optimized instruction is implemented in a wrong way, please check it!"); + AXASSERT(r, "The optimized instruction is implemented in a wrong way, please check it!"); } } diff --git a/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp b/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp index 996f147e80..0992449398 100644 --- a/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp +++ b/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp @@ -69,7 +69,7 @@ UserDefaultTest::UserDefaultTest() // ss << buffer[i] << " "; // } // -// CCLOG("%s is %s", key, ss.str().c_str()); +// AXLOG("%s is %s", key, ss.str().c_str()); // } // template diff --git a/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp b/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp index 65fd69b069..276b811e14 100644 --- a/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp +++ b/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp @@ -79,9 +79,9 @@ private: auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - listener->onTouchBegan = CC_CALLBACK_2(TextButton::onTouchBegan, this); - listener->onTouchEnded = CC_CALLBACK_2(TextButton::onTouchEnded, this); - listener->onTouchCancelled = CC_CALLBACK_2(TextButton::onTouchCancelled, this); + listener->onTouchBegan = AX_CALLBACK_2(TextButton::onTouchBegan, this); + listener->onTouchEnded = AX_CALLBACK_2(TextButton::onTouchEnded, this); + listener->onTouchCancelled = AX_CALLBACK_2(TextButton::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -161,7 +161,7 @@ public: return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } diff --git a/tests/cpp-tests/Classes/WindowTest/WindowTest.cpp b/tests/cpp-tests/Classes/WindowTest/WindowTest.cpp index a77fde5041..1690944d6b 100644 --- a/tests/cpp-tests/Classes/WindowTest/WindowTest.cpp +++ b/tests/cpp-tests/Classes/WindowTest/WindowTest.cpp @@ -24,8 +24,8 @@ #include "WindowTest.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ - CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ + AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) USING_NS_AX; WindowTests::WindowTests() diff --git a/tests/cpp-tests/Classes/WindowTest/WindowTest.h b/tests/cpp-tests/Classes/WindowTest/WindowTest.h index 7028669dd5..b4cb5cde7e 100644 --- a/tests/cpp-tests/Classes/WindowTest/WindowTest.h +++ b/tests/cpp-tests/Classes/WindowTest/WindowTest.h @@ -25,8 +25,8 @@ #ifndef __WINDOWTEST_H__ #define __WINDOWTEST_H__ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ - CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ + AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) # include "../BaseTest.h" DEFINE_TEST_SUITE(WindowTests); diff --git a/tests/cpp-tests/Classes/ZipTest/ZipTests.cpp b/tests/cpp-tests/Classes/ZipTest/ZipTests.cpp index 696e91d650..4cb246174c 100644 --- a/tests/cpp-tests/Classes/ZipTest/ZipTests.cpp +++ b/tests/cpp-tests/Classes/ZipTest/ZipTests.cpp @@ -64,11 +64,11 @@ static void unzipTest(Label* label, if (fu->isFileExist(newLocal)) { - CCLOG("Remove file %s", newLocal.c_str()); + AXLOG("Remove file %s", newLocal.c_str()); fu->removeFile(newLocal); } - CCLOG("Copy %s to %s", zipFile.data(), newLocal.c_str()); + AXLOG("Copy %s to %s", zipFile.data(), newLocal.c_str()); auto writeSuccess = fu->writeDataToFile(fu->getDataFromFile(zipFile), newLocal); if (!writeSuccess) { @@ -79,7 +79,7 @@ static void unzipTest(Label* label, unzFile fp = unzOpen(newLocal.c_str()); if (!fp) { - CCLOG("Failed to open zip file %s", newLocal.c_str()); + AXLOG("Failed to open zip file %s", newLocal.c_str()); label->setString("Failed to open zip file"); return; } @@ -93,7 +93,7 @@ static void unzipTest(Label* label, unzGetCurrentFileInfo(fp, &fileInfo, fileName, sizeof(fileName) - 1, nullptr, 0, nullptr, 0); - CCASSERT(strncmp("10k.txt", fileName, 7) == 0, "file name should be 10k.txt"); + AXASSERT(strncmp("10k.txt", fileName, 7) == 0, "file name should be 10k.txt"); if (password.empty()) { diff --git a/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp b/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp index 301fb40976..096d9683db 100644 --- a/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp +++ b/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp @@ -70,7 +70,7 @@ void ZwoptexGenericTest::onEnter() sprite2->setFlippedX(false); sprite2->setFlippedY(false); - schedule(CC_SCHEDULE_SELECTOR(ZwoptexGenericTest::startIn05Secs), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(ZwoptexGenericTest::startIn05Secs), 1.0f); sprite1->retain(); sprite2->retain(); @@ -80,8 +80,8 @@ void ZwoptexGenericTest::onEnter() void ZwoptexGenericTest::startIn05Secs(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(ZwoptexGenericTest::startIn05Secs)); - schedule(CC_SCHEDULE_SELECTOR(ZwoptexGenericTest::flipSprites), 0.5f); + unschedule(AX_SCHEDULE_SELECTOR(ZwoptexGenericTest::startIn05Secs)); + schedule(AX_SCHEDULE_SELECTOR(ZwoptexGenericTest::flipSprites), 0.5f); } static int spriteFrameIndex = 0; diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index 265b91f7bd..3ffabe05a8 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -44,7 +44,7 @@ public: RootTests() { // addTest("Node: Scene3D", [](){return new Scene3DTests(); }); -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) addTest("ImGui", []() { return new ImGuiTests(); }); #endif addTest("Texture2D", []() { return new Texture2DTests(); }); @@ -55,11 +55,11 @@ public: addTest("Audio - NewAudioEngine", []() { return new AudioEngineTests(); }); addTest("Box2D - Basic", []() { return new Box2DTests(); }); -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) addTest("Box2D - TestBed", []() { return new Box2DTestBedTests(); }); #endif addTest("Chipmunk2D - Basic", []() { return new ChipmunkTests(); }); -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) addTest("Chipmunk2D - TestBed", []() { return new ChipmunkTestBedTests(); }); #endif addTest("Bugs", []() { return new BugsTests(); }); @@ -76,7 +76,7 @@ public: addTest("FileUtils", []() { return new FileUtilsTests(); }); addTest("Fonts", []() { return new FontTests(); }); addTest("Interval", []() { return new IntervalTests(); }); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) addTest("JNIHelper", []() { return new JNITests(); }); #endif addTest("Material System", []() { return new MaterialSystemTest(); }); @@ -94,7 +94,7 @@ public: addTest("Node: Parallax", []() { return new ParallaxTests(); }); addTest("Node: Particles", []() { return new ParticleTests(); }); addTest("Node: Particle3D (PU)", []() { return new Particle3DTests(); }); -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS addTest("Node: Physics", []() { return new PhysicsTests(); }); #endif addTest("Node: Physics3D", []() { return new Physics3DTests(); }); @@ -124,13 +124,13 @@ public: addTest("Unzip Test", []() { return new ZipTests(); }); addTest("URL Open Test", []() { return new OpenURLTests(); }); addTest("UserDefault", []() { return new UserDefaultTests(); }); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) addTest("Vibrate", []() { return new VibrateTests(); }); #endif addTest("Zwoptex", []() { return new ZwoptexTests(); }); addTest("SpriteFrameCache", []() { return new SpriteFrameCacheTests(); }); // TODO -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ - CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ + AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) addTest("Window Test", []() { return new WindowTests(); }); // TODO wrong effect #endif } @@ -143,7 +143,7 @@ TestController::TestController() : _stopAutoTest(true), _isRunInBackground(false _director = Director::getInstance(); _touchListener = EventListenerTouchOneByOne::create(); - _touchListener->onTouchBegan = CC_CALLBACK_2(TestController::blockTouchBegan, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(TestController::blockTouchBegan, this); _touchListener->setSwallowTouches(true); _director->getEventDispatcher()->addEventListenerWithFixedPriority(_touchListener, -200); @@ -441,10 +441,10 @@ void TestController::logEx(const char* format, ...) vsnprintf(buff, 1020, format, args); strcat(buff, "\n"); -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID __android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", "%s", buff); -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 WCHAR wszBuf[1024] = {0}; MultiByteToWideChar(CP_UTF8, 0, buff, -1, wszBuf, sizeof(wszBuf)); OutputDebugStringW(wszBuf); @@ -489,7 +489,7 @@ bool TestController::blockTouchBegan(Touch* touch, Event* event) } //================================================================================================== -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include static long __stdcall windowExceptionFilter(_EXCEPTION_POINTERS* excp) @@ -511,10 +511,10 @@ static void disableCrashCatch() SetUnhandledExceptionFilter(UnhandledExceptionFilter); } -#elif CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#elif AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID -# if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +# if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static int s_fatal_signals[] = { SIGILL, SIGABRT, SIGBUS, SIGFPE, SIGSEGV, SIGSTKFLT, SIGPIPE, }; diff --git a/tests/cpp-tests/Classes/tests.h b/tests/cpp-tests/Classes/tests.h index 5fb6ffe782..661cbb2c24 100644 --- a/tests/cpp-tests/Classes/tests.h +++ b/tests/cpp-tests/Classes/tests.h @@ -29,27 +29,27 @@ #include "Box2DTestBed/Box2DTestBed.h" #include "ChipmunkTest/ChipmunkTest.h" -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) # include "ChipmunkTestBed/ChipmunkTestBed.h" #endif -#if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_MARMALADE) # include "ClippingNodeTest/ClippingNodeTest.h" #endif #include "NewAudioEngineTest/NewAudioEngineTest.h" -#if (CC_TARGET_PLATFORM != CC_PLATFORM_EMSCRIPEN) -# if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_EMSCRIPEN) +# if (AX_TARGET_PLATFORM != AX_PLATFORM_MARMALADE) // bada don't support libcurl -# if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) +# if (AX_TARGET_PLATFORM != AX_PLATFORM_BADA) # include "CurlTest/CurlTest.h" # endif # endif #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "JNITest/JNITest.h" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ - CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ + AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) # include "WindowTest/WindowTest.h" #endif @@ -119,7 +119,7 @@ #include "ZwoptexTest/ZwoptexTest.h" #include "SpriteFrameCacheTest/SpriteFrameCacheTest.h" #include "ZipTest/ZipTests.h" -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) # include "ImGuiTest/ImGuiTest.h" #endif #endif diff --git a/tests/cpp-tests/proj.ios/Classes/testsAppDelegate.mm b/tests/cpp-tests/proj.ios/Classes/testsAppDelegate.mm index d7c2da05d4..937f9461f5 100644 --- a/tests/cpp-tests/proj.ios/Classes/testsAppDelegate.mm +++ b/tests/cpp-tests/proj.ios/Classes/testsAppDelegate.mm @@ -60,13 +60,13 @@ static AppDelegate s_sharedApplication; multiSampling:axis::GLViewImpl::_multisamplingCount > 0 ? YES : NO numberOfSamples:axis::GLViewImpl::_multisamplingCount]; -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [eaglView setMultipleTouchEnabled:YES]; #endif // Use RootViewController manage CCEAGLView viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) viewController.extendedLayoutIncludesOpaqueBars = YES; #endif viewController.view = eaglView; @@ -85,7 +85,7 @@ static AppDelegate s_sharedApplication; [window makeKeyAndVisible]; -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [viewController prefersStatusBarHidden]; #endif diff --git a/tests/fairygui-tests/Classes/AppDelegate.cpp b/tests/fairygui-tests/Classes/AppDelegate.cpp index 8aa8059469..0db17f4941 100644 --- a/tests/fairygui-tests/Classes/AppDelegate.cpp +++ b/tests/fairygui-tests/Classes/AppDelegate.cpp @@ -41,7 +41,7 @@ bool AppDelegate::applicationDidFinishLaunching() { auto director = Director::getInstance(); auto glview = director->getOpenGLView(); if (!glview) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) glview = GLViewImpl::createWithRect("Examples", axis::Rect(0, 0, 1280, 720)); #else glview = GLViewImpl::create("Examples"); @@ -79,7 +79,7 @@ bool AppDelegate::applicationDidFinishLaunching() { register_all_packages(); //showing how to regsiter a ttf font -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC UIConfig::registerFont(UIConfig::defaultFont, "fonts/DroidSansFallback.ttf"); #endif diff --git a/tests/fairygui-tests/Classes/BagScene.cpp b/tests/fairygui-tests/Classes/BagScene.cpp index 7c83e454aa..955c983ddb 100644 --- a/tests/fairygui-tests/Classes/BagScene.cpp +++ b/tests/fairygui-tests/Classes/BagScene.cpp @@ -8,7 +8,7 @@ BagScene::BagScene() :_bagWindow(nullptr) BagScene::~BagScene() { - CC_SAFE_RELEASE(_bagWindow); + AX_SAFE_RELEASE(_bagWindow); } void BagScene::continueInit() diff --git a/tests/fairygui-tests/Classes/BagWindow.cpp b/tests/fairygui-tests/Classes/BagWindow.cpp index 3afa32194f..e8a0c9dc02 100644 --- a/tests/fairygui-tests/Classes/BagWindow.cpp +++ b/tests/fairygui-tests/Classes/BagWindow.cpp @@ -9,8 +9,8 @@ void BagWindow::onInit() setModal(true); _list = _contentPane->getChild("list")->as(); - _list->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(BagWindow::onClickItem, this)); - _list->itemRenderer = CC_CALLBACK_2(BagWindow::renderListItem, this); + _list->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(BagWindow::onClickItem, this)); + _list->itemRenderer = AX_CALLBACK_2(BagWindow::renderListItem, this); _list->setNumItems(45); } @@ -25,12 +25,12 @@ void BagWindow::doShowAnimation() setScale(0.1f, 0.1f); setPivot(0.5f, 0.5f); - GTween::to(getScale(), Vec2::ONE, 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(CC_CALLBACK_0(BagWindow::onShown, this)); + GTween::to(getScale(), Vec2::ONE, 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(AX_CALLBACK_0(BagWindow::onShown, this)); } void BagWindow::doHideAnimation() { - GTween::to(getScale(), Vec2(0.1f, 0.1f), 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(CC_CALLBACK_0(BagWindow::hideImmediately, this)); + GTween::to(getScale(), Vec2(0.1f, 0.1f), 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(AX_CALLBACK_0(BagWindow::hideImmediately, this)); } void BagWindow::onClickItem(EventContext* context) diff --git a/tests/fairygui-tests/Classes/BasicsScene.cpp b/tests/fairygui-tests/Classes/BasicsScene.cpp index 17eb0b1351..691849fcfc 100644 --- a/tests/fairygui-tests/Classes/BasicsScene.cpp +++ b/tests/fairygui-tests/Classes/BasicsScene.cpp @@ -18,7 +18,7 @@ void BasicsScene::continueInit() _backBtn = _view->getChild("btn_Back"); _backBtn->setVisible(false); - _backBtn->addClickListener(CC_CALLBACK_1(BasicsScene::onClickBack, this)); + _backBtn->addClickListener(AX_CALLBACK_1(BasicsScene::onClickBack, this)); _demoContainer = _view->getChild("container")->as(); _cc = _view->getController("c1"); @@ -28,7 +28,7 @@ void BasicsScene::continueInit() { GObject* obj = _view->getChildAt(i); if (obj->getGroup() != nullptr && obj->getGroup()->name.compare("btns") == 0) - obj->addClickListener(CC_CALLBACK_1(BasicsScene::runDemo, this)); + obj->addClickListener(AX_CALLBACK_1(BasicsScene::runDemo, this)); } } @@ -42,10 +42,10 @@ BasicsScene::BasicsScene() BasicsScene::~BasicsScene() { - CC_SAFE_RELEASE(_winA); - CC_SAFE_RELEASE(_winB); - CC_SAFE_RELEASE(_pm); - CC_SAFE_RELEASE(_popupCom); + AX_SAFE_RELEASE(_winA); + AX_SAFE_RELEASE(_winB); + AX_SAFE_RELEASE(_pm); + AX_SAFE_RELEASE(_popupCom); } void BasicsScene::onClickBack(EventContext* context) @@ -104,10 +104,10 @@ void BasicsScene::playPopup() { _pm = PopupMenu::create(); _pm->retain(); - _pm->addItem("Item 1", CC_CALLBACK_1(BasicsScene::onClickMenu, this)); - _pm->addItem("Item 2", CC_CALLBACK_1(BasicsScene::onClickMenu, this)); - _pm->addItem("Item 3", CC_CALLBACK_1(BasicsScene::onClickMenu, this)); - _pm->addItem("Item 4", CC_CALLBACK_1(BasicsScene::onClickMenu, this)); + _pm->addItem("Item 1", AX_CALLBACK_1(BasicsScene::onClickMenu, this)); + _pm->addItem("Item 2", AX_CALLBACK_1(BasicsScene::onClickMenu, this)); + _pm->addItem("Item 3", AX_CALLBACK_1(BasicsScene::onClickMenu, this)); + _pm->addItem("Item 4", AX_CALLBACK_1(BasicsScene::onClickMenu, this)); } if (_popupCom == nullptr) @@ -133,7 +133,7 @@ void BasicsScene::playPopup() void BasicsScene::onClickMenu(EventContext* context) { GObject* itemObject = (GObject*)context->getData(); - CCLOG("click %s", itemObject->getText().c_str()); + AXLOG("click %s", itemObject->getText().c_str()); } void BasicsScene::playWindow() @@ -239,9 +239,9 @@ void BasicsScene::playProgress() { GComponent* obj = _demoObjects.at("ProgressBar"); axis::Director::getInstance()->getScheduler()->schedule( - CC_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this, 0.02f, false); + AX_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this, 0.02f, false); obj->addEventListener(UIEventType::Exit, [this](EventContext*) { - axis::Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this); + axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this); }); } diff --git a/tests/fairygui-tests/Classes/ChatScene.cpp b/tests/fairygui-tests/Classes/ChatScene.cpp index 69870f0fdc..8d14111e9c 100644 --- a/tests/fairygui-tests/Classes/ChatScene.cpp +++ b/tests/fairygui-tests/Classes/ChatScene.cpp @@ -9,7 +9,7 @@ ChatScene::ChatScene() :_emojiSelectUI(nullptr) ChatScene::~ChatScene() { - CC_SAFE_RELEASE(_emojiSelectUI); + AX_SAFE_RELEASE(_emojiSelectUI); } void ChatScene::continueInit() @@ -22,18 +22,18 @@ void ChatScene::continueInit() _list = _view->getChild("list")->as(); _list->setVirtual(); - _list->itemProvider = CC_CALLBACK_1(ChatScene::getListItemResource, this); - _list->itemRenderer = CC_CALLBACK_2(ChatScene::renderListItem, this); + _list->itemProvider = AX_CALLBACK_1(ChatScene::getListItemResource, this); + _list->itemRenderer = AX_CALLBACK_2(ChatScene::renderListItem, this); _input = _view->getChild("input")->as(); - _input->addEventListener(UIEventType::Submit, CC_CALLBACK_1(ChatScene::onSubmit, this)); + _input->addEventListener(UIEventType::Submit, AX_CALLBACK_1(ChatScene::onSubmit, this)); - _view->getChild("btnSend")->addClickListener(CC_CALLBACK_1(ChatScene::onClickSendBtn, this)); - _view->getChild("btnEmoji")->addClickListener(CC_CALLBACK_1(ChatScene::onClickEmojiBtn, this)); + _view->getChild("btnSend")->addClickListener(AX_CALLBACK_1(ChatScene::onClickSendBtn, this)); + _view->getChild("btnEmoji")->addClickListener(AX_CALLBACK_1(ChatScene::onClickEmojiBtn, this)); _emojiSelectUI = UIPackage::createObject("Emoji", "EmojiSelectUI")->as(); _emojiSelectUI->retain(); - _emojiSelectUI->getChild("list")->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(ChatScene::onClickEmoji, this)); + _emojiSelectUI->getChild("list")->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(ChatScene::onClickEmoji, this)); } void ChatScene::onClickSendBtn(EventContext * context) diff --git a/tests/fairygui-tests/Classes/DemoScene.cpp b/tests/fairygui-tests/Classes/DemoScene.cpp index 3d1174b528..ac6d23464a 100644 --- a/tests/fairygui-tests/Classes/DemoScene.cpp +++ b/tests/fairygui-tests/Classes/DemoScene.cpp @@ -21,7 +21,7 @@ bool DemoScene::init() closeButton->addRelation(_groot, RelationType::Right_Right); closeButton->addRelation(_groot, RelationType::Bottom_Bottom); closeButton->setSortingOrder(100000); - closeButton->addClickListener(CC_CALLBACK_1(DemoScene::onClose, this)); + closeButton->addClickListener(AX_CALLBACK_1(DemoScene::onClose, this)); _groot->addChild(closeButton); return true; @@ -42,7 +42,7 @@ void DemoScene::onClose(EventContext* context) //Close the cocos2d-x game scene and quit the application Director::getInstance()->end(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) exit(0); #endif @@ -60,5 +60,5 @@ DemoScene::DemoScene() : DemoScene::~DemoScene() { - CC_SAFE_RELEASE(_groot); + AX_SAFE_RELEASE(_groot); } diff --git a/tests/fairygui-tests/Classes/GuideScene.cpp b/tests/fairygui-tests/Classes/GuideScene.cpp index 4231136228..972e5e912d 100644 --- a/tests/fairygui-tests/Classes/GuideScene.cpp +++ b/tests/fairygui-tests/Classes/GuideScene.cpp @@ -9,7 +9,7 @@ GuideScene::GuideScene():_guideLayer(nullptr) GuideScene::~GuideScene() { - CC_SAFE_RELEASE(_guideLayer); + AX_SAFE_RELEASE(_guideLayer); } void GuideScene::continueInit() diff --git a/tests/fairygui-tests/Classes/JoystickModule.cpp b/tests/fairygui-tests/Classes/JoystickModule.cpp index 2121f7cd59..d9655d6e01 100644 --- a/tests/fairygui-tests/Classes/JoystickModule.cpp +++ b/tests/fairygui-tests/Classes/JoystickModule.cpp @@ -32,9 +32,9 @@ bool JoystickModule::init(GComponent * mainView) touchId = -1; _radius = 150; - _touchArea->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(JoystickModule::onTouchBegin, this)); - _touchArea->addEventListener(UIEventType::TouchMove, CC_CALLBACK_1(JoystickModule::onTouchMove, this)); - _touchArea->addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(JoystickModule::onTouchEnd, this)); + _touchArea->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(JoystickModule::onTouchBegin, this)); + _touchArea->addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(JoystickModule::onTouchMove, this)); + _touchArea->addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(JoystickModule::onTouchEnd, this)); _tweener = nullptr; diff --git a/tests/fairygui-tests/Classes/JoystickScene.cpp b/tests/fairygui-tests/Classes/JoystickScene.cpp index 1ad53ab691..5e0230bc33 100644 --- a/tests/fairygui-tests/Classes/JoystickScene.cpp +++ b/tests/fairygui-tests/Classes/JoystickScene.cpp @@ -4,7 +4,7 @@ USING_NS_AX; JoystickScene::~JoystickScene() { - CC_SAFE_RELEASE(_joystick); + AX_SAFE_RELEASE(_joystick); } void JoystickScene::continueInit() diff --git a/tests/fairygui-tests/Classes/LoopListScene.cpp b/tests/fairygui-tests/Classes/LoopListScene.cpp index 9ac842eec2..6cbecb5137 100644 --- a/tests/fairygui-tests/Classes/LoopListScene.cpp +++ b/tests/fairygui-tests/Classes/LoopListScene.cpp @@ -12,10 +12,10 @@ void LoopListScene::continueInit() _groot->addChild(_view); _list = _view->getChild("list")->as(); - _list->itemRenderer = CC_CALLBACK_2(LoopListScene::renderListItem, this); + _list->itemRenderer = AX_CALLBACK_2(LoopListScene::renderListItem, this); _list->setVirtualAndLoop(); _list->setNumItems(5); - _list->addEventListener(UIEventType::Scroll, CC_CALLBACK_1(LoopListScene::doSpecialEffect, this)); + _list->addEventListener(UIEventType::Scroll, AX_CALLBACK_1(LoopListScene::doSpecialEffect, this)); doSpecialEffect(nullptr); } diff --git a/tests/fairygui-tests/Classes/ModalWaitingScene.cpp b/tests/fairygui-tests/Classes/ModalWaitingScene.cpp index c989cc5e65..62b09fe133 100644 --- a/tests/fairygui-tests/Classes/ModalWaitingScene.cpp +++ b/tests/fairygui-tests/Classes/ModalWaitingScene.cpp @@ -8,7 +8,7 @@ ModalWaitingScene::ModalWaitingScene():_testWin(nullptr) ModalWaitingScene::~ModalWaitingScene() { - CC_SAFE_RELEASE(_testWin); + AX_SAFE_RELEASE(_testWin); } void ModalWaitingScene::continueInit() diff --git a/tests/fairygui-tests/Classes/PullToRefreshScene.cpp b/tests/fairygui-tests/Classes/PullToRefreshScene.cpp index 0600d04365..82ca959c90 100644 --- a/tests/fairygui-tests/Classes/PullToRefreshScene.cpp +++ b/tests/fairygui-tests/Classes/PullToRefreshScene.cpp @@ -24,7 +24,7 @@ void ScrollPaneHeader::onConstruct() { _c1 = getController("c1"); - addEventListener(UIEventType::SizeChange, CC_CALLBACK_1(ScrollPaneHeader::onSizeChanged, this)); + addEventListener(UIEventType::SizeChange, AX_CALLBACK_1(ScrollPaneHeader::onSizeChanged, this)); } void ScrollPaneHeader::onSizeChanged(EventContext*) @@ -52,16 +52,16 @@ void PullToRefreshScene::continueInit() _groot->addChild(_view); _list1 = _view->getChild("list1")->as(); - _list1->itemRenderer = CC_CALLBACK_2(PullToRefreshScene::renderListItem1, this); + _list1->itemRenderer = AX_CALLBACK_2(PullToRefreshScene::renderListItem1, this); _list1->setVirtual(); _list1->setNumItems(1); - _list1->addEventListener(UIEventType::PullDownRelease, CC_CALLBACK_1(PullToRefreshScene::onPullDownToRefresh, this)); + _list1->addEventListener(UIEventType::PullDownRelease, AX_CALLBACK_1(PullToRefreshScene::onPullDownToRefresh, this)); _list2 = _view->getChild("list2")->as(); - _list2->itemRenderer = CC_CALLBACK_2(PullToRefreshScene::renderListItem2, this); + _list2->itemRenderer = AX_CALLBACK_2(PullToRefreshScene::renderListItem2, this); _list2->setVirtual(); _list2->setNumItems(1); - _list2->addEventListener(UIEventType::PullUpRelease, CC_CALLBACK_1(PullToRefreshScene::onPullUpToRefresh, this)); + _list2->addEventListener(UIEventType::PullUpRelease, AX_CALLBACK_1(PullToRefreshScene::onPullUpToRefresh, this)); } void PullToRefreshScene::renderListItem1(int index, GObject* obj) diff --git a/tests/fairygui-tests/Classes/ScrollPaneScene.cpp b/tests/fairygui-tests/Classes/ScrollPaneScene.cpp index dc0029881c..af28613dbc 100644 --- a/tests/fairygui-tests/Classes/ScrollPaneScene.cpp +++ b/tests/fairygui-tests/Classes/ScrollPaneScene.cpp @@ -13,10 +13,10 @@ void ScrollPaneScene::continueInit() _groot->addChild(_view); _list = _view->getChild("list")->as(); - _list->itemRenderer = CC_CALLBACK_2(ScrollPaneScene::renderListItem, this); + _list->itemRenderer = AX_CALLBACK_2(ScrollPaneScene::renderListItem, this); _list->setVirtual(); _list->setNumItems(1000); - _list->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(ScrollPaneScene::onClickList, this)); + _list->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(ScrollPaneScene::onClickList, this)); } void ScrollPaneScene::renderListItem(int index, GObject* obj) @@ -26,8 +26,8 @@ void ScrollPaneScene::renderListItem(int index, GObject* obj) item->getScrollPane()->setPosX(0); //reset scroll pos //Be carefull, RenderListItem is calling repeatedly, add tag to avoid adding duplicately. - item->getChild("b0")->addClickListener(CC_CALLBACK_1(ScrollPaneScene::onClickStick, this), EventTag(this)); - item->getChild("b1")->addClickListener(CC_CALLBACK_1(ScrollPaneScene::onClickDelete, this), EventTag(this)); + item->getChild("b0")->addClickListener(AX_CALLBACK_1(ScrollPaneScene::onClickStick, this), EventTag(this)); + item->getChild("b1")->addClickListener(AX_CALLBACK_1(ScrollPaneScene::onClickDelete, this), EventTag(this)); } void ScrollPaneScene::onClickStick(EventContext * context) diff --git a/tests/fairygui-tests/Classes/TransitionDemoScene.cpp b/tests/fairygui-tests/Classes/TransitionDemoScene.cpp index 0e6dd17394..b4477d4fb1 100644 --- a/tests/fairygui-tests/Classes/TransitionDemoScene.cpp +++ b/tests/fairygui-tests/Classes/TransitionDemoScene.cpp @@ -4,12 +4,12 @@ USING_NS_AX; TransitionDemoScene::~TransitionDemoScene() { - CC_SAFE_RELEASE(_g1); - CC_SAFE_RELEASE(_g2); - CC_SAFE_RELEASE(_g3); - CC_SAFE_RELEASE(_g4); - CC_SAFE_RELEASE(_g5); - CC_SAFE_RELEASE(_g6); + AX_SAFE_RELEASE(_g1); + AX_SAFE_RELEASE(_g2); + AX_SAFE_RELEASE(_g3); + AX_SAFE_RELEASE(_g4); + AX_SAFE_RELEASE(_g5); + AX_SAFE_RELEASE(_g6); } void TransitionDemoScene::continueInit() @@ -30,15 +30,15 @@ void TransitionDemoScene::continueInit() _g4->retain(); _g5 = UIPackage::createObject("Transition", "PowerUp")->as(); _g5->retain(); - _g5->getTransition("t0")->setHook("play_num_now", CC_CALLBACK_0(TransitionDemoScene::playNum, this)); + _g5->getTransition("t0")->setHook("play_num_now", AX_CALLBACK_0(TransitionDemoScene::playNum, this)); _g6 = UIPackage::createObject("Transition", "PathDemo")->as(); _g6->retain(); _view->getChild("btn0")->addClickListener([this](EventContext*) { __play(_g1); }); _view->getChild("btn1")->addClickListener([this](EventContext*) { __play(_g2); }); _view->getChild("btn2")->addClickListener([this](EventContext*) { __play(_g3); }); - _view->getChild("btn3")->addClickListener(CC_CALLBACK_1(TransitionDemoScene::__play4, this)); - _view->getChild("btn4")->addClickListener(CC_CALLBACK_1(TransitionDemoScene::__play5, this)); + _view->getChild("btn3")->addClickListener(AX_CALLBACK_1(TransitionDemoScene::__play4, this)); + _view->getChild("btn4")->addClickListener(AX_CALLBACK_1(TransitionDemoScene::__play5, this)); _view->getChild("btn5")->addClickListener([this](EventContext*) { __play(_g6); }); } diff --git a/tests/fairygui-tests/Classes/TreeViewScene.cpp b/tests/fairygui-tests/Classes/TreeViewScene.cpp index e63ed7da3c..f825c0eb6d 100644 --- a/tests/fairygui-tests/Classes/TreeViewScene.cpp +++ b/tests/fairygui-tests/Classes/TreeViewScene.cpp @@ -18,11 +18,11 @@ void TreeViewScene::continueInit() _groot->addChild(_view); _tree1 = _view->getChild("tree")->as(); - _tree1->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(TreeViewScene::onClickNode, this)); + _tree1->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(TreeViewScene::onClickNode, this)); _tree2 = _view->getChild("tree2")->as(); - _tree2->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(TreeViewScene::onClickNode, this)); - _tree2->treeNodeRender = CC_CALLBACK_2(TreeViewScene::renderTreeNode, this); + _tree2->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(TreeViewScene::onClickNode, this)); + _tree2->treeNodeRender = AX_CALLBACK_2(TreeViewScene::renderTreeNode, this); GTreeNode* topNode = GTreeNode::create(true); topNode->setData(Value("I'm a top node")); @@ -59,7 +59,7 @@ void TreeViewScene::continueInit() void TreeViewScene::onClickNode(EventContext* context) { GTreeNode* node = ((GObject*)context->getData())->treeNode(); - CCLOG("click node %s", node->getText().c_str()); + AXLOG("click node %s", node->getText().c_str()); } void TreeViewScene::renderTreeNode(GTreeNode* node, GComponent* obj) diff --git a/tests/fairygui-tests/Classes/VirtualListScene.cpp b/tests/fairygui-tests/Classes/VirtualListScene.cpp index b3ea94f235..6dc02c3f50 100644 --- a/tests/fairygui-tests/Classes/VirtualListScene.cpp +++ b/tests/fairygui-tests/Classes/VirtualListScene.cpp @@ -18,7 +18,7 @@ void VirtualListScene::continueInit() _view->getChild("n8")->addClickListener([this](EventContext*) { _list->getScrollPane()->scrollBottom(); }); _list = _view->getChild("mailList")->as(); - _list->itemRenderer = CC_CALLBACK_2(VirtualListScene::renderListItem, this); + _list->itemRenderer = AX_CALLBACK_2(VirtualListScene::renderListItem, this); _list->setVirtual(); _list->setNumItems(1000); } diff --git a/tests/fairygui-tests/Classes/Window2.cpp b/tests/fairygui-tests/Classes/Window2.cpp index fc7e803dcb..07fb457bef 100644 --- a/tests/fairygui-tests/Classes/Window2.cpp +++ b/tests/fairygui-tests/Classes/Window2.cpp @@ -13,12 +13,12 @@ void Window2::doShowAnimation() setScale(0.1f, 0.1f); setPivot(0.5f, 0.5f); - GTween::to(getScale(), Vec2::ONE, 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(CC_CALLBACK_0(Window2::onShown, this)); + GTween::to(getScale(), Vec2::ONE, 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(AX_CALLBACK_0(Window2::onShown, this)); } void Window2::doHideAnimation() { - GTween::to(getScale(), Vec2(0.1f, 0.1f), 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(CC_CALLBACK_0(Window2::hideImmediately, this)); + GTween::to(getScale(), Vec2(0.1f, 0.1f), 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(AX_CALLBACK_0(Window2::hideImmediately, this)); } void Window2::onShown() diff --git a/tests/live2d-tests/Classes/AppDelegate.cpp b/tests/live2d-tests/Classes/AppDelegate.cpp index 7904e7095d..4aca219233 100644 --- a/tests/live2d-tests/Classes/AppDelegate.cpp +++ b/tests/live2d-tests/Classes/AppDelegate.cpp @@ -71,7 +71,7 @@ bool AppDelegate::applicationDidFinishLaunching() auto glview = director->getOpenGLView(); if(!glview) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) glview = GLViewImpl::createWithRect("Demo", axis::Rect(0, 0, designResolutionSize.width, designResolutionSize.height)); #else glview = GLViewImpl::create("Demo"); diff --git a/tests/live2d-tests/Classes/LAppLive2DManager.cpp b/tests/live2d-tests/Classes/LAppLive2DManager.cpp index df8ffac86f..06b2349887 100644 --- a/tests/live2d-tests/Classes/LAppLive2DManager.cpp +++ b/tests/live2d-tests/Classes/LAppLive2DManager.cpp @@ -87,7 +87,7 @@ LAppLive2DManager::LAppLive2DManager() if (_renderBuffer) {// 描画ターゲット作成 -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) // Retina対策でこっちからとる GLViewImpl *glimpl = (GLViewImpl *)Director::getInstance()->getOpenGLView(); glfwGetFramebufferSize(glimpl->getWindow(), &width, &height); @@ -323,7 +323,7 @@ void LAppLive2DManager::CreateShader() "attribute vec2 uv;" "varying vec2 vuv;" "void main(void){" -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) " gl_Position = vec4(position.x, -position.y, position.z, 1.0);" #else " gl_Position = vec4(position, 1.0);" @@ -332,7 +332,7 @@ void LAppLive2DManager::CreateShader() "}"; const char* fragmentShader = -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) "precision mediump float;" #endif "varying vec2 vuv;" diff --git a/tests/live2d-tests/Classes/LAppModel.cpp b/tests/live2d-tests/Classes/LAppModel.cpp index b711b54d9f..8ad6a1ddb9 100644 --- a/tests/live2d-tests/Classes/LAppModel.cpp +++ b/tests/live2d-tests/Classes/LAppModel.cpp @@ -762,7 +762,7 @@ void LAppModel::MakeRenderingTarget() float aspectFactor = 1.0f; int frameW = Director::getInstance()->getOpenGLView()->getFrameSize().width, frameH = Director::getInstance()->getOpenGLView()->getFrameSize().height; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) // Retina対策でこっちからとる GLViewImpl *glimpl = (GLViewImpl *)Director::getInstance()->getOpenGLView(); int renderW = frameW; diff --git a/tests/live2d-tests/Classes/LAppView.cpp b/tests/live2d-tests/Classes/LAppView.cpp index f29f9db94b..612e3863f3 100644 --- a/tests/live2d-tests/Classes/LAppView.cpp +++ b/tests/live2d-tests/Classes/LAppView.cpp @@ -77,9 +77,9 @@ void LAppView::onEnter() EventListenerTouchAllAtOnce* listener = EventListenerTouchAllAtOnce::create(); // タッチメソッド設定 - listener->onTouchesBegan = CC_CALLBACK_2(LAppView::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(LAppView::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(LAppView::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(LAppView::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(LAppView::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(LAppView::onTouchesEnded, this); // 優先度100でディスパッチャーに登録 this->getEventDispatcher()->addEventListenerWithFixedPriority(listener, 100); @@ -261,6 +261,6 @@ LAppView* LAppView::createDrawNode() ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } diff --git a/tests/live2d-tests/Classes/SampleScene.cpp b/tests/live2d-tests/Classes/SampleScene.cpp index ef1e102684..5c321f788b 100644 --- a/tests/live2d-tests/Classes/SampleScene.cpp +++ b/tests/live2d-tests/Classes/SampleScene.cpp @@ -67,7 +67,7 @@ bool SampleScene::init() _closeItem = MenuItemImage::create( "CloseNormal.png", "CloseSelected.png", - CC_CALLBACK_1(SampleScene::menuCloseCallback, this) + AX_CALLBACK_1(SampleScene::menuCloseCallback, this) ); if (_closeItem == nullptr || @@ -86,7 +86,7 @@ bool SampleScene::init() _changeItem = MenuItemImage::create( "icon_gear.png", "icon_gear.png", - CC_CALLBACK_1(SampleScene::menuChangeCallback, this) + AX_CALLBACK_1(SampleScene::menuChangeCallback, this) ); if (_changeItem == nullptr || @@ -191,7 +191,7 @@ void SampleScene::menuCloseCallback(Ref* pSender) Director::getInstance()->end(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) exit(0); #endif } diff --git a/tests/lua-tests/project/Classes/AppDelegate.cpp b/tests/lua-tests/project/Classes/AppDelegate.cpp index a15a770105..9cc3456f87 100644 --- a/tests/lua-tests/project/Classes/AppDelegate.cpp +++ b/tests/lua-tests/project/Classes/AppDelegate.cpp @@ -57,8 +57,8 @@ bool AppDelegate::applicationDidFinishLaunching() lua_getglobal(L, "_G"); if (lua_istable(L, -1)) // stack:...,_G, { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || \ - CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || \ + AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) register_assetsmanager_test_sample(L); #endif register_test_binding(L); diff --git a/tests/lua-tests/project/Classes/lua_assetsmanager_test_sample.cpp b/tests/lua-tests/project/Classes/lua_assetsmanager_test_sample.cpp index ba919eefac..667170f1f2 100644 --- a/tests/lua-tests/project/Classes/lua_assetsmanager_test_sample.cpp +++ b/tests/lua-tests/project/Classes/lua_assetsmanager_test_sample.cpp @@ -29,7 +29,7 @@ #include "cocos2d.h" #include "extensions/cocos-ext.h" -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_WIN32) # include # include #endif @@ -49,7 +49,7 @@ static int lua_cocos2dx_createDownloadDir(lua_State* L) std::string pathToSave = FileUtils::getInstance()->getWritablePath(); pathToSave += "tmpdir"; -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_WIN32) DIR* pDir = NULL; pDir = opendir(pathToSave.c_str()); @@ -67,7 +67,7 @@ static int lua_cocos2dx_createDownloadDir(lua_State* L) return 1; } - CCLOG("'createDownloadDir' function wrong number of arguments: %d, was expecting %d\n", argc, 0); + AXLOG("'createDownloadDir' function wrong number of arguments: %d, was expecting %d\n", argc, 0); return 0; } @@ -90,9 +90,9 @@ static int lua_cocos2dx_deleteDownloadDir(lua_State* L) #endif std::string pathToSave = tolua_tostring(L, 1, ""); -#if CC_TARGET_OS_TVOS +#if AX_TARGET_OS_TVOS // Not implemented. "system" is not present on tvOS - CCLOG("'lua_cocos2dx_deleteDownloadDir' not implemented on tvOS"); + AXLOG("'lua_cocos2dx_deleteDownloadDir' not implemented on tvOS"); return 0; #endif @@ -100,7 +100,7 @@ static int lua_cocos2dx_deleteDownloadDir(lua_State* L) return 0; } - CCLOG("'resetDownloadDir' function wrong number of arguments: %d, was expecting %d\n", argc, 1); + AXLOG("'resetDownloadDir' function wrong number of arguments: %d, was expecting %d\n", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 @@ -132,7 +132,7 @@ static int lua_cocos2dx_addSearchPath(lua_State* L) FileUtils::getInstance()->addSearchPath(pathToSave, before); return 0; } - CCLOG("'addSearchPath' function wrong number of arguments: %d, was expecting %d\n", argc, 2); + AXLOG("'addSearchPath' function wrong number of arguments: %d, was expecting %d\n", argc, 2); return 0; #if COCOS2D_DEBUG >= 1 diff --git a/tests/lua-tests/project/Classes/lua_test_bindings.cpp b/tests/lua-tests/project/Classes/lua_test_bindings.cpp index 399462daaa..260ce65393 100644 --- a/tests/lua-tests/project/Classes/lua_test_bindings.cpp +++ b/tests/lua-tests/project/Classes/lua_test_bindings.cpp @@ -99,7 +99,7 @@ protected: backend::UniformLocation _locMVPMatrix; private: - CC_DISALLOW_COPY_AND_ASSIGN(DrawNode3D); + AX_DISALLOW_COPY_AND_ASSIGN(DrawNode3D); bool _rendererDepthTestEnabled = false; @@ -111,7 +111,7 @@ DrawNode3D::DrawNode3D() {} DrawNode3D::~DrawNode3D() { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); } DrawNode3D* DrawNode3D::create() @@ -123,7 +123,7 @@ DrawNode3D* DrawNode3D::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -131,7 +131,7 @@ DrawNode3D* DrawNode3D::create() void DrawNode3D::ensureCapacity(int count) { - CCASSERT(count >= 0, "capacity must be >= 0"); + AXASSERT(count >= 0, "capacity must be >= 0"); if (_buffer.size() + count > _buffer.capacity()) { @@ -176,10 +176,10 @@ bool DrawNode3D::init() _dirty = true; - _customCommand.setBeforeCallback(CC_CALLBACK_0(DrawNode3D::onBeforeDraw, this)); - _customCommand.setAfterCallback(CC_CALLBACK_0(DrawNode3D::onAfterDraw, this)); + _customCommand.setBeforeCallback(AX_CALLBACK_0(DrawNode3D::onBeforeDraw, this)); + _customCommand.setAfterCallback(AX_CALLBACK_0(DrawNode3D::onAfterDraw, this)); -#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_COME_TO_FOREGROUND, [this](EventCustom* event) { /** listen the event that coming to foreground on Android */ @@ -316,12 +316,12 @@ ValueTypeJudgeInTable* ValueTypeJudgeInTable::create(ValueMap valueMap) Value::Type type = iter.second.getTypeFamily(); if (type == Value::Type::STRING) { - CCLOG("The type of index %d is string", index); + AXLOG("The type of index %d is string", index); } if (type == Value::Type::INTEGER || type == Value::Type::DOUBLE || type == Value::Type::FLOAT) { - CCLOG("The type of index %d is number", index); + AXLOG("The type of index %d is number", index); } ++index; @@ -365,7 +365,7 @@ int lua_cocos2dx_DrawNode3D_getBlendFunc(lua_State* L) blendfunc_to_luaval(L, ret); return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ax.DrawNode3D:getBlendFunc", argc, 0); + AXLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ax.DrawNode3D:getBlendFunc", argc, 0); return 0; #if COCOS2D_DEBUG >= 1 @@ -416,7 +416,7 @@ int lua_cocos2dx_DrawNode3D_setBlendFunc(lua_State* L) return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ax.DrawNode3D:setBlendFunc", argc, 1); + AXLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ax.DrawNode3D:setBlendFunc", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 @@ -469,7 +469,7 @@ int lua_cocos2dx_DrawNode3D_drawLine(lua_State* L) cobj->drawLine(arg0, arg1, arg2); return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ax.DrawNode3D:drawLine", argc, 3); + AXLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ax.DrawNode3D:drawLine", argc, 3); return 0; #if COCOS2D_DEBUG >= 1 @@ -513,7 +513,7 @@ int lua_cocos2dx_DrawNode3D_clear(lua_State* L) cobj->clear(); return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ax.DrawNode3D:clear", argc, 0); + AXLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ax.DrawNode3D:clear", argc, 0); return 0; #if COCOS2D_DEBUG >= 1 @@ -591,7 +591,7 @@ int lua_cocos2dx_DrawNode3D_drawCube(lua_State* L) cobj->drawCube(&arg0[0], arg1); return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ax.DrawNode3D:drawCube", argc, 2); + AXLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ax.DrawNode3D:drawCube", argc, 2); return 0; #if COCOS2D_DEBUG >= 1 @@ -626,7 +626,7 @@ int lua_cocos2dx_DrawNode3D_create(lua_State* L) object_to_luaval(L, "ax.DrawNode3D", (axis::DrawNode3D*)ret); return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "ax.DrawNode3D:create", argc, 0); + AXLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "ax.DrawNode3D:create", argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: @@ -680,7 +680,7 @@ int lua_cocos2dx_ValueTypeJudgeInTable_create(lua_State* L) (axis::ValueTypeJudgeInTable*)ret); return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "ax.ValueTypeJudgeInTable:create", argc, 1); + AXLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "ax.ValueTypeJudgeInTable:create", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: diff --git a/tests/lua-tests/project/proj.ios_mac/ios/AppController.mm b/tests/lua-tests/project/proj.ios_mac/ios/AppController.mm index 3445999a14..fe2c093ca3 100644 --- a/tests/lua-tests/project/proj.ios_mac/ios/AppController.mm +++ b/tests/lua-tests/project/proj.ios_mac/ios/AppController.mm @@ -56,13 +56,13 @@ static AppDelegate s_sharedApplication; multiSampling:axis::GLViewImpl::_multisamplingCount > 0 ? YES : NO numberOfSamples:axis::GLViewImpl::_multisamplingCount]; -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [eaglView setMultipleTouchEnabled:YES]; #endif // Use RootViewController manage CCEAGLView viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) viewController.wantsFullScreenLayout = YES; #endif viewController.view = eaglView; @@ -81,7 +81,7 @@ static AppDelegate s_sharedApplication; [window makeKeyAndVisible]; -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [[UIApplication sharedApplication] setStatusBarHidden:YES]; #endif diff --git a/tools/bindings-generator/targets/lua/templates/public_field.c b/tools/bindings-generator/targets/lua/templates/public_field.c index bfa3ff7c96..33daeceb3d 100644 --- a/tools/bindings-generator/targets/lua/templates/public_field.c +++ b/tools/bindings-generator/targets/lua/templates/public_field.c @@ -89,7 +89,7 @@ int ${signature_name}_set${name}(lua_State* tolua_S) return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "${generator.scriptname_from_native($namespaced_class_name, $namespace_name)}:${name}",argc, 1); + AXLOG("%s has wrong number of arguments: %d, was expecting %d \n", "${generator.scriptname_from_native($namespaced_class_name, $namespace_name)}:${name}",argc, 1); return 0; \#if COCOS2D_DEBUG >= 1 diff --git a/tools/console/plugins/plugin_generate/bin-templates/cpp-template-default/Classes/HelloWorldScene.cpp b/tools/console/plugins/plugin_generate/bin-templates/cpp-template-default/Classes/HelloWorldScene.cpp index 7a795176b0..4b3fe1d864 100644 --- a/tools/console/plugins/plugin_generate/bin-templates/cpp-template-default/Classes/HelloWorldScene.cpp +++ b/tools/console/plugins/plugin_generate/bin-templates/cpp-template-default/Classes/HelloWorldScene.cpp @@ -42,7 +42,7 @@ bool HelloWorld::init() auto closeItem = MenuItemImage::create( "CloseNormal.png", "CloseSelected.png", - CC_CALLBACK_1(HelloWorld::menuCloseCallback, this)); + AX_CALLBACK_1(HelloWorld::menuCloseCallback, this)); closeItem->setPosition(Vec2(origin.x + visibleSize.width - closeItem->getContentSize().width/2 , origin.y + closeItem->getContentSize().height/2)); diff --git a/tools/console/plugins/plugin_generate/bin-templates/lua-template-runtime/src/config.lua b/tools/console/plugins/plugin_generate/bin-templates/lua-template-runtime/src/config.lua index 2a7389f3ae..c656400d67 100644 --- a/tools/console/plugins/plugin_generate/bin-templates/lua-template-runtime/src/config.lua +++ b/tools/console/plugins/plugin_generate/bin-templates/lua-template-runtime/src/config.lua @@ -3,16 +3,16 @@ DEBUG = 2 -- use framework, will disable all deprecated API, false - use legacy API -CC_USE_FRAMEWORK = true +AX_USE_FRAMEWORK = true -- show FPS on screen -CC_SHOW_FPS = true +AX_SHOW_FPS = true -- disable create unexpected global variable -CC_DISABLE_GLOBAL = true +AX_DISABLE_GLOBAL = true -- for module display -CC_DESIGN_RESOLUTION = { +AX_DESIGN_RESOLUTION = { width = 960, height = 640, autoscale = "SHOW_ALL", diff --git a/tools/console/plugins/plugin_generate/gen_simulator.py b/tools/console/plugins/plugin_generate/gen_simulator.py index 710fa0fcbf..5666a2afd2 100644 --- a/tools/console/plugins/plugin_generate/gen_simulator.py +++ b/tools/console/plugins/plugin_generate/gen_simulator.py @@ -161,8 +161,8 @@ class SimulatorCompiler(axis.CCPlugin): def get_keywords(self): osx_keyword = { - "CC_TARGET_OS_IPHONE,":"CC_TARGET_OS_IPHONE,\n\"COCOS2D_DEBUG=1\",", - "CC_TARGET_OS_MAC,":"CC_TARGET_OS_MAC,\n\"COCOS2D_DEBUG=1\",", + "AX_TARGET_OS_IPHONE,":"AX_TARGET_OS_IPHONE,\n\"COCOS2D_DEBUG=1\",", + "AX_TARGET_OS_MAC,":"AX_TARGET_OS_MAC,\n\"COCOS2D_DEBUG=1\",", "COCOS2D_DEBUG=0":"COCOS2D_DEBUG=1", } diff --git a/tools/console/plugins/plugin_package/helper/template/proj.ios_mac/__PACKAGE_NAME__.xcodeproj/project.pbxproj b/tools/console/plugins/plugin_package/helper/template/proj.ios_mac/__PACKAGE_NAME__.xcodeproj/project.pbxproj index a34d8ccc5c..9db30b2be5 100644 --- a/tools/console/plugins/plugin_package/helper/template/proj.ios_mac/__PACKAGE_NAME__.xcodeproj/project.pbxproj +++ b/tools/console/plugins/plugin_package/helper/template/proj.ios_mac/__PACKAGE_NAME__.xcodeproj/project.pbxproj @@ -187,7 +187,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = ( - "CC_LUA_ENGINE_ENABLED=1", + "AX_LUA_ENGINE_ENABLED=1", "DEBUG=1", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; @@ -230,7 +230,7 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = "CC_LUA_ENGINE_ENABLED=1"; + GCC_PREPROCESSOR_DEFINITIONS = "AX_LUA_ENGINE_ENABLED=1"; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -273,7 +273,7 @@ GCC_PREFIX_HEADER = __PACKAGE_NAME__.pch; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", - CC_TARGET_OS_IPHONE, + AX_TARGET_OS_IPHONE, ); PRODUCT_NAME = "__PACKAGE_NAME__ IOS"; SDKROOT = iphoneos8.1; @@ -289,7 +289,7 @@ GCC_PREFIX_HEADER = __PACKAGE_NAME__.pch; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", - CC_TARGET_OS_IPHONE, + AX_TARGET_OS_IPHONE, ); PRODUCT_NAME = "__PACKAGE_NAME__ IOS"; SDKROOT = iphoneos8.1; diff --git a/tools/console/plugins/plugin_package/helper/template/proj.win32/__PACKAGE_NAME__.vcxproj b/tools/console/plugins/plugin_package/helper/template/proj.win32/__PACKAGE_NAME__.vcxproj index 26aaa6ff24..0c4ec7379e 100644 --- a/tools/console/plugins/plugin_package/helper/template/proj.win32/__PACKAGE_NAME__.vcxproj +++ b/tools/console/plugins/plugin_package/helper/template/proj.win32/__PACKAGE_NAME__.vcxproj @@ -53,7 +53,7 @@ NotUsing Level3 Disabled - WIN32;_WINDOWS;_DEBUG;_LIB;CC_USE_CURL=1;CC_LUA_ENGINE_ENABLED=1;%(PreprocessorDefinitions) + WIN32;_WINDOWS;_DEBUG;_LIB;AX_USE_CURL=1;AX_LUA_ENGINE_ENABLED=1;%(PreprocessorDefinitions) $(ProjectDir)..\..\..\frameworks\cocos2d-x\cocos;$(ProjectDir)..\..\..\frameworks\cocos2d-x\external;$(ProjectDir)..\..\..\frameworks\cocos2d-x\external\glfw3\include\win32;$(ProjectDir)..\..\..\frameworks\cocos2d-x\external\win32-specific\zlib\include;$(ProjectDir)..\..\..\frameworks\cocos2d-x\external\win32-specific\gles\include\OGLES/;$(ProjectDir)..\..\..\frameworks\cocos2d-x\external\curl\include\win32;$(ProjectDir)..\..\..\frameworks\cocos2d-x\extensions;%(AdditionalIncludeDirectories) true 4267;4251;4244;%(DisableSpecificWarnings) diff --git a/tools/tolua/axis_audioengine.ini b/tools/tolua/axis_audioengine.ini index 89dd473c44..ed7148f15d 100644 --- a/tools/tolua/axis_audioengine.ini +++ b/tools/tolua/axis_audioengine.ini @@ -7,7 +7,7 @@ prefix = axis_audioengine # all classes will be embedded in that namespace target_namespace = ax -macro_judgement = #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +macro_judgement = #if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX android_headers = diff --git a/tools/tolua/axis_controller.ini b/tools/tolua/axis_controller.ini index eab34991ae..c877ea8663 100644 --- a/tools/tolua/axis_controller.ini +++ b/tools/tolua/axis_controller.ini @@ -7,7 +7,7 @@ prefix = axis_controller # all classes will be embedded in that namespace target_namespace = ax -macro_judgement = #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +macro_judgement = #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) android_headers = diff --git a/tools/tolua/axis_navmesh.ini b/tools/tolua/axis_navmesh.ini index 7392545e1e..01cb7345ae 100644 --- a/tools/tolua/axis_navmesh.ini +++ b/tools/tolua/axis_navmesh.ini @@ -7,14 +7,14 @@ prefix = axis_navmesh # all classes will be embedded in that namespace target_namespace = ax -macro_judgement = #if CC_USE_NAVMESH +macro_judgement = #if AX_USE_NAVMESH android_headers = android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -DANDROID -D__ANDROID_API__=14 -gcc-toolchain %(gcc_toolchain_dir)s --sysroot=%(androidndkdir)s/platforms/android-14/arch-arm -idirafter %(androidndkdir)s/sources/android/support/include -idirafter %(androidndkdir)s/sysroot/usr/include -idirafter %(androidndkdir)s/sysroot/usr/include/arm-linux-androideabi -idirafter %(clangllvmdir)s/lib64/clang/5.0/include -I%(androidndkdir)s/sources/cxx-stl/llvm-libc++/include clang_headers = -clang_flags = -nostdinc -x c++ -std=c++17 -fsigned-char -U__SSE__ -DCC_USE_NAVMESH +clang_flags = -nostdinc -x c++ -std=c++17 -fsigned-char -U__SSE__ -DAX__USE_NAVMESH win32_clang_flags = -U __SSE__ diff --git a/tools/tolua/axis_physics.ini b/tools/tolua/axis_physics.ini index 9671bcc6bd..6a2ef15dbd 100644 --- a/tools/tolua/axis_physics.ini +++ b/tools/tolua/axis_physics.ini @@ -7,7 +7,7 @@ prefix = axis_physics # all classes will be embedded in that namespace target_namespace = ax -macro_judgement = #if CC_USE_PHYSICS +macro_judgement = #if AX_USE_PHYSICS android_headers = diff --git a/tools/tolua/axis_physics3d.ini b/tools/tolua/axis_physics3d.ini index 705fc9188a..ab17daa633 100644 --- a/tools/tolua/axis_physics3d.ini +++ b/tools/tolua/axis_physics3d.ini @@ -7,14 +7,14 @@ prefix = axis_physics3d # all classes will be embedded in that namespace target_namespace = ax -macro_judgement = #if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +macro_judgement = #if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION android_headers = android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -DANDROID -D__ANDROID_API__=14 -gcc-toolchain %(gcc_toolchain_dir)s --sysroot=%(androidndkdir)s/platforms/android-14/arch-arm -idirafter %(androidndkdir)s/sources/android/support/include -idirafter %(androidndkdir)s/sysroot/usr/include -idirafter %(androidndkdir)s/sysroot/usr/include/arm-linux-androideabi -idirafter %(clangllvmdir)s/lib64/clang/5.0/include -I%(androidndkdir)s/sources/cxx-stl/llvm-libc++/include clang_headers = -clang_flags = -nostdinc -x c++ -std=c++17 -fsigned-char -U__SSE__ -DCC_ENABLE_BULLET_INTEGRATION +clang_flags = -nostdinc -x c++ -std=c++17 -fsigned-char -U__SSE__ -DAX__ENABLE_BULLET_INTEGRATION win32_clang_flags = -U __SSE__