diff --git a/cmake/Modules/AxisBuildHelpers.cmake b/cmake/Modules/AxisBuildHelpers.cmake index 47f0ff4612..a6be72cc41 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 AX_DEPEND_DLLS) + PROPERTY CC_DEPEND_DLLS) if(pre_dlls) set(_dlls ${pre_dlls} ${_dlls}) endif() set_property(TARGET ${target} PROPERTY - AX_DEPEND_DLLS ${_dlls} + CC_DEPEND_DLLS ${_dlls} ) endif() endif() diff --git a/cmake/Modules/AxisConfigDefine.cmake b/cmake/Modules/AxisConfigDefine.cmake index 90d83bdf06..69e48d2cda 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 AX_LUA_DEPEND + PROPERTY CC_LUA_DEPEND BRIEF_DOCS "axis lua depend libs" FULL_DOCS "use to save depend libs of axis lua project" ) @@ -151,7 +151,7 @@ function(use_axis_compile_define target) PRIVATE _USEGUIDLL # ui ) else() - target_compile_definitions(${target} PUBLIC AX_STATIC) + target_compile_definitions(${target} PUBLIC CC_STATIC) endif() endif() endfunction() diff --git a/cmake/Modules/AxisLinkHelpers.cmake b/cmake/Modules/AxisLinkHelpers.cmake index ff2fa7f6c5..3ed0e9d788 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 AX_STATIC=1 + PRIVATE CC_STATIC=1 ) endif() diff --git a/core/2d/CCAction.cpp b/core/2d/CCAction.cpp index 8f9f1eb846..af862d357c 100644 --- a/core/2d/CCAction.cpp +++ b/core/2d/CCAction.cpp @@ -81,7 +81,7 @@ Speed::Speed() : _speed(0.0), _innerAction(nullptr) {} Speed::~Speed() { - AX_SAFE_RELEASE(_innerAction); + CC_SAFE_RELEASE(_innerAction); } Speed* Speed::create(ActionInterval* action, float speed) @@ -92,7 +92,7 @@ Speed* Speed::create(ActionInterval* action, float speed) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -161,9 +161,9 @@ void Speed::setInnerAction(ActionInterval* action) { if (_innerAction != action) { - AX_SAFE_RELEASE(_innerAction); + CC_SAFE_RELEASE(_innerAction); _innerAction = action; - AX_SAFE_RETAIN(_innerAction); + CC_SAFE_RETAIN(_innerAction); } } @@ -172,7 +172,7 @@ void Speed::setInnerAction(ActionInterval* action) // Follow::~Follow() { - AX_SAFE_RELEASE(_followedNode); + CC_SAFE_RELEASE(_followedNode); } Follow* Follow::create(Node* followedNode, const Rect& rect /* = Rect::ZERO*/) diff --git a/core/2d/CCAction.h b/core/2d/CCAction.h index e9dca51e4d..e4d2b90266 100644 --- a/core/2d/CCAction.h +++ b/core/2d/CCAction.h @@ -50,7 +50,7 @@ enum /** * @brief Base class for Action objects. */ -class AX_DLL Action : public Ref, public Clonable +class CC_DLL Action : public Ref, public Clonable { public: /** Default tag used for all the actions. */ @@ -67,7 +67,7 @@ public: */ virtual Action* clone() const { - AX_ASSERT(0); + CC_ASSERT(0); return nullptr; } @@ -78,7 +78,7 @@ public: */ virtual Action* reverse() const { - AX_ASSERT(0); + CC_ASSERT(0); return nullptr; } @@ -180,7 +180,7 @@ protected: unsigned int _flags; private: - AX_DISALLOW_COPY_AND_ASSIGN(Action); + CC_DISALLOW_COPY_AND_ASSIGN(Action); }; /** @class FiniteTimeAction @@ -191,7 +191,7 @@ private: * - An action with a duration of 35.5 seconds. * Infinite time actions are valid. */ -class AX_DLL FiniteTimeAction : public Action +class CC_DLL FiniteTimeAction : public Action { public: /** Get duration in seconds of the action. @@ -210,12 +210,12 @@ public: // virtual FiniteTimeAction* reverse() const override { - AX_ASSERT(0); + CC_ASSERT(0); return nullptr; } virtual FiniteTimeAction* clone() const override { - AX_ASSERT(0); + CC_ASSERT(0); return nullptr; } @@ -227,7 +227,7 @@ protected: float _duration; private: - AX_DISALLOW_COPY_AND_ASSIGN(FiniteTimeAction); + CC_DISALLOW_COPY_AND_ASSIGN(FiniteTimeAction); }; class ActionInterval; @@ -239,7 +239,7 @@ class RepeatForever; * Useful to simulate 'slow motion' or 'fast forward' effect. * @warning This action can't be Sequenceable because it is not an IntervalAction. */ -class AX_DLL Speed : public Action +class CC_DLL Speed : public Action { public: /** Create the action and set the speed. @@ -297,7 +297,7 @@ protected: ActionInterval* _innerAction; private: - AX_DISALLOW_COPY_AND_ASSIGN(Speed); + CC_DISALLOW_COPY_AND_ASSIGN(Speed); }; /** @class Follow @@ -309,7 +309,7 @@ private: * Instead of using Camera as a "follower", use this action instead. * @since v0.99.2 */ -class AX_DLL Follow : public Action +class CC_DLL Follow : public Action { public: /** @@ -439,7 +439,7 @@ protected: Rect _worldRect; private: - AX_DISALLOW_COPY_AND_ASSIGN(Follow); + CC_DISALLOW_COPY_AND_ASSIGN(Follow); }; // end of actions group diff --git a/core/2d/CCActionCamera.cpp b/core/2d/CCActionCamera.cpp index 3e7edf952f..a4fd4d9f3b 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)AX_DEGREES_TO_RADIANS(deltaAngleZ); - _radDeltaX = (float)AX_DEGREES_TO_RADIANS(deltaAngleX); + _radDeltaZ = (float)CC_DEGREES_TO_RADIANS(deltaAngleZ); + _radDeltaX = (float)CC_DEGREES_TO_RADIANS(deltaAngleX); return true; } return false; @@ -196,12 +196,12 @@ void OrbitCamera::startWithTarget(Node* target) if (std::isnan(_radius)) _radius = r; if (std::isnan(_angleZ)) - _angleZ = (float)AX_RADIANS_TO_DEGREES(zenith); + _angleZ = (float)CC_RADIANS_TO_DEGREES(zenith); if (std::isnan(_angleX)) - _angleX = (float)AX_RADIANS_TO_DEGREES(azimuth); + _angleX = (float)CC_RADIANS_TO_DEGREES(azimuth); - _radZ = (float)AX_DEGREES_TO_RADIANS(_angleZ); - _radX = (float)AX_DEGREES_TO_RADIANS(_angleX); + _radZ = (float)CC_DEGREES_TO_RADIANS(_angleZ); + _radX = (float)CC_DEGREES_TO_RADIANS(_angleX); } void OrbitCamera::update(float dt) diff --git a/core/2d/CCActionCamera.h b/core/2d/CCActionCamera.h index a6be928594..ca40675180 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 AX_DLL ActionCamera : public ActionInterval +class CC_DLL ActionCamera : public ActionInterval { public: /** @@ -117,7 +117,7 @@ protected: * Orbits the camera around the center of the screen using spherical coordinates. * @ingroup Actions */ -class AX_DLL OrbitCamera : public ActionCamera +class CC_DLL OrbitCamera : public ActionCamera { public: /** Creates a OrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX. diff --git a/core/2d/CCActionCatmullRom.cpp b/core/2d/CCActionCatmullRom.cpp index 84059238d9..2ba989acf1 100644 --- a/core/2d/CCActionCatmullRom.cpp +++ b/core/2d/CCActionCatmullRom.cpp @@ -197,7 +197,7 @@ CardinalSplineTo* CardinalSplineTo::create(float duration, PointArray* points, f } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -220,7 +220,7 @@ bool CardinalSplineTo::initWithDuration(float duration, PointArray* points, floa CardinalSplineTo::~CardinalSplineTo() { - AX_SAFE_RELEASE_NULL(_points); + CC_SAFE_RELEASE_NULL(_points); } CardinalSplineTo::CardinalSplineTo() : _points(nullptr), _deltaT(0.f), _tension(0.f) {} @@ -275,7 +275,7 @@ void CardinalSplineTo::update(float time) Vec2 newPos = ccCardinalSplineAt(pp0, pp1, pp2, pp3, _tension, lt); -#if AX_ENABLE_STACKABLE_ACTIONS +#if CC_ENABLE_STACKABLE_ACTIONS // Support for stacked actions Node* node = _target; Vec2 diff = node->getPosition() - _previousPosition; @@ -314,7 +314,7 @@ CardinalSplineBy* CardinalSplineBy::create(float duration, PointArray* points, f } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -398,7 +398,7 @@ CatmullRomTo* CatmullRomTo::create(float dt, PointArray* points) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -441,7 +441,7 @@ CatmullRomBy* CatmullRomBy::create(float dt, PointArray* points) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } diff --git a/core/2d/CCActionCatmullRom.h b/core/2d/CCActionCatmullRom.h index 7c4baee081..5695b89ca9 100644 --- a/core/2d/CCActionCatmullRom.h +++ b/core/2d/CCActionCatmullRom.h @@ -55,7 +55,7 @@ class Node; * @ingroup Actions * @js NA */ -class AX_DLL PointArray : public Ref, public Clonable +class CC_DLL PointArray : public Ref, public Clonable { public: /** Creates and initializes a Points array with capacity. @@ -163,7 +163,7 @@ private: * http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline * @ingroup Actions */ -class AX_DLL CardinalSplineTo : public ActionInterval +class CC_DLL CardinalSplineTo : public ActionInterval { public: /** Creates an action with a Cardinal Spline array of points and tension. @@ -212,8 +212,8 @@ public: */ void setPoints(PointArray* points) { - AX_SAFE_RETAIN(points); - AX_SAFE_RELEASE(_points); + CC_SAFE_RETAIN(points); + CC_SAFE_RELEASE(_points); _points = points; } @@ -241,7 +241,7 @@ protected: * http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline * @ingroup Actions */ -class AX_DLL CardinalSplineBy : public CardinalSplineTo +class CC_DLL CardinalSplineBy : public CardinalSplineTo { public: /** Creates an action with a Cardinal Spline array of points and tension. @@ -274,7 +274,7 @@ protected: * http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline * @ingroup Actions */ -class AX_DLL CatmullRomTo : public CardinalSplineTo +class CC_DLL CatmullRomTo : public CardinalSplineTo { public: /** Creates an action with a Cardinal Spline array of points and tension. @@ -307,7 +307,7 @@ public: * http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline * @ingroup Actions */ -class AX_DLL CatmullRomBy : public CardinalSplineBy +class CC_DLL CatmullRomBy : public CardinalSplineBy { public: /** Creates an action with a Cardinal Spline array of points and tension. @@ -334,7 +334,7 @@ public: }; /** Returns the Cardinal Spline position for a given set of control points, tension and time */ -extern AX_DLL Vec2 +extern CC_DLL Vec2 ccCardinalSplineAt(const Vec2& p0, const Vec2& p1, const Vec2& p2, const Vec2& p3, float tension, float t); // end of actions group diff --git a/core/2d/CCActionEase.cpp b/core/2d/CCActionEase.cpp index e1b7b77137..167cc76efb 100644 --- a/core/2d/CCActionEase.cpp +++ b/core/2d/CCActionEase.cpp @@ -66,7 +66,7 @@ bool ActionEase::initWithAction(ActionInterval* action) ActionEase::~ActionEase() { - AX_SAFE_RELEASE(_inner); + CC_SAFE_RELEASE(_inner); } void ActionEase::startWithTarget(Node* target) @@ -115,7 +115,7 @@ EaseRateAction* EaseRateAction::create(ActionInterval* action, float rate) return easeRateAction; } - AX_SAFE_DELETE(easeRateAction); + CC_SAFE_DELETE(easeRateAction); return nullptr; } @@ -141,7 +141,7 @@ bool EaseRateAction::initWithAction(ActionInterval* action, float rate) if (ease->initWithAction(action)) \ ease->autorelease(); \ else \ - AX_SAFE_DELETE(ease); \ + CC_SAFE_DELETE(ease); \ return ease; \ } \ CLASSNAME* CLASSNAME::clone() const \ @@ -192,7 +192,7 @@ EASE_TEMPLATE_IMPL(EaseCubicActionInOut, tweenfunc::cubicEaseInOut, EaseCubicAct if (ease->initWithAction(action, rate)) \ ease->autorelease(); \ else \ - AX_SAFE_DELETE(ease); \ + CC_SAFE_DELETE(ease); \ return ease; \ } \ CLASSNAME* CLASSNAME::clone() const \ @@ -235,7 +235,7 @@ bool EaseElastic::initWithAction(ActionInterval* action, float period /* = 0.3f* if (ease->initWithAction(action, period)) \ ease->autorelease(); \ else \ - AX_SAFE_DELETE(ease); \ + CC_SAFE_DELETE(ease); \ return ease; \ } \ CLASSNAME* CLASSNAME::clone() const \ diff --git a/core/2d/CCActionEase.h b/core/2d/CCActionEase.h index 4062bcddbd..0da2574c30 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 AX_DLL ActionEase : public ActionInterval +class CC_DLL ActionEase : public ActionInterval { public: /** @@ -75,7 +75,7 @@ protected: ActionInterval* _inner; private: - AX_DISALLOW_COPY_AND_ASSIGN(ActionEase); + CC_DISALLOW_COPY_AND_ASSIGN(ActionEase); }; /** @@ -84,7 +84,7 @@ private: @details Ease the inner action with specified rate. @ingroup Actions */ -class AX_DLL EaseRateAction : public ActionEase +class CC_DLL EaseRateAction : public ActionEase { public: static EaseRateAction* create(ActionInterval* action, float rate); @@ -113,7 +113,7 @@ protected: float _rate; private: - AX_DISALLOW_COPY_AND_ASSIGN(EaseRateAction); + CC_DISALLOW_COPY_AND_ASSIGN(EaseRateAction); }; // @@ -121,7 +121,7 @@ private: // issue #16159 [https://github.com/cocos2d/cocos2d-x/pull/16159] for further info // #define EASE_TEMPLATE_DECL_CLASS(CLASSNAME) \ - class AX_DLL CLASSNAME : public ActionEase \ + class CC_DLL CLASSNAME : public ActionEase \ { \ public: \ virtual ~CLASSNAME() {} \ @@ -134,7 +134,7 @@ private: virtual ActionEase* reverse() const override; \ \ private: \ - AX_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \ + CC_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \ }; /** @@ -199,7 +199,7 @@ EASE_TEMPLATE_DECL_CLASS(EaseSineInOut); @since v0.8.2 @ingroup Actions */ -class AX_DLL EaseBounce : public ActionEase +class CC_DLL EaseBounce : public ActionEase {}; /** @@ -373,7 +373,7 @@ EASE_TEMPLATE_DECL_CLASS(EaseCubicActionInOut); // #define EASERATE_TEMPLATE_DECL_CLASS(CLASSNAME) \ - class AX_DLL CLASSNAME : public EaseRateAction \ + class CC_DLL CLASSNAME : public EaseRateAction \ { \ public: \ virtual ~CLASSNAME() {} \ @@ -385,7 +385,7 @@ EASE_TEMPLATE_DECL_CLASS(EaseCubicActionInOut); virtual EaseRateAction* reverse() const override; \ \ private: \ - AX_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \ + CC_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \ }; /** @@ -423,7 +423,7 @@ EASERATE_TEMPLATE_DECL_CLASS(EaseInOut); @since v0.8.2 @ingroup Actions */ -class AX_DLL EaseElastic : public ActionEase +class CC_DLL EaseElastic : public ActionEase { public: /** @@ -451,7 +451,7 @@ protected: float _period; private: - AX_DISALLOW_COPY_AND_ASSIGN(EaseElastic); + CC_DISALLOW_COPY_AND_ASSIGN(EaseElastic); }; // @@ -459,7 +459,7 @@ private: // issue #16159 [https://github.com/cocos2d/cocos2d-x/pull/16159] for further info // #define EASEELASTIC_TEMPLATE_DECL_CLASS(CLASSNAME) \ - class AX_DLL CLASSNAME : public EaseElastic \ + class CC_DLL CLASSNAME : public EaseElastic \ { \ public: \ virtual ~CLASSNAME() {} \ @@ -471,7 +471,7 @@ private: virtual EaseElastic* reverse() const override; \ \ private: \ - AX_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \ + CC_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \ }; /** @@ -516,7 +516,7 @@ EASEELASTIC_TEMPLATE_DECL_CLASS(EaseElasticInOut); @brief Ease Bezier @ingroup Actions */ -class AX_DLL EaseBezierAction : public axis::ActionEase +class CC_DLL EaseBezierAction : public axis::ActionEase { public: /** @@ -545,7 +545,7 @@ protected: float _p3; private: - AX_DISALLOW_COPY_AND_ASSIGN(EaseBezierAction); + CC_DISALLOW_COPY_AND_ASSIGN(EaseBezierAction); }; // end of actions group diff --git a/core/2d/CCActionGrid.cpp b/core/2d/CCActionGrid.cpp index ac8c667ab3..1516e1e3e9 100644 --- a/core/2d/CCActionGrid.cpp +++ b/core/2d/CCActionGrid.cpp @@ -206,7 +206,7 @@ AccelDeccelAmplitude* AccelDeccelAmplitude::clone() const AccelDeccelAmplitude::~AccelDeccelAmplitude() { - AX_SAFE_RELEASE(_other); + CC_SAFE_RELEASE(_other); } void AccelDeccelAmplitude::startWithTarget(Node* target) @@ -276,7 +276,7 @@ AccelAmplitude* AccelAmplitude::clone() const AccelAmplitude::~AccelAmplitude() { - AX_SAFE_DELETE(_other); + CC_SAFE_DELETE(_other); } void AccelAmplitude::startWithTarget(Node* target) @@ -330,7 +330,7 @@ bool DeccelAmplitude::initWithAction(Action* action, float duration) DeccelAmplitude::~DeccelAmplitude() { - AX_SAFE_RELEASE(_other); + CC_SAFE_RELEASE(_other); } void DeccelAmplitude::startWithTarget(Node* target) diff --git a/core/2d/CCActionGrid.h b/core/2d/CCActionGrid.h index 547f3e4f32..cb9c3abbff 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 AX_DLL GridAction : public ActionInterval +class CC_DLL GridAction : public ActionInterval { public: /** @@ -57,7 +57,7 @@ public: // overrides virtual GridAction* clone() const override { - AX_ASSERT(0); + CC_ASSERT(0); return nullptr; } virtual GridAction* reverse() const override; @@ -81,14 +81,14 @@ protected: void cacheTargetAsGridNode(); private: - AX_DISALLOW_COPY_AND_ASSIGN(GridAction); + CC_DISALLOW_COPY_AND_ASSIGN(GridAction); }; /** @brief Base class for Grid3D actions. @details Grid3D actions can modify a non-tiled grid. */ -class AX_DLL Grid3DAction : public GridAction +class CC_DLL Grid3DAction : public GridAction { public: virtual GridBase* getGrid() override; @@ -122,7 +122,7 @@ public: // Overrides virtual Grid3DAction* clone() const override { - AX_ASSERT(0); + CC_ASSERT(0); return nullptr; } @@ -136,7 +136,7 @@ public: /** @brief Base class for TiledGrid3D actions. */ -class AX_DLL TiledGrid3DAction : public GridAction +class CC_DLL TiledGrid3DAction : public GridAction { public: /** @@ -180,7 +180,7 @@ public: // Override virtual TiledGrid3DAction* clone() const override { - AX_ASSERT(0); + CC_ASSERT(0); return nullptr; } }; @@ -189,7 +189,7 @@ public: @brief AccelDeccelAmplitude action. @js NA */ -class AX_DLL AccelDeccelAmplitude : public ActionInterval +class CC_DLL AccelDeccelAmplitude : public ActionInterval { public: /** @@ -233,14 +233,14 @@ protected: ActionInterval* _other; private: - AX_DISALLOW_COPY_AND_ASSIGN(AccelDeccelAmplitude); + CC_DISALLOW_COPY_AND_ASSIGN(AccelDeccelAmplitude); }; /** @brief AccelAmplitude action. @js NA */ -class AX_DLL AccelAmplitude : public ActionInterval +class CC_DLL AccelAmplitude : public ActionInterval { public: /** @@ -278,14 +278,14 @@ protected: ActionInterval* _other; private: - AX_DISALLOW_COPY_AND_ASSIGN(AccelAmplitude); + CC_DISALLOW_COPY_AND_ASSIGN(AccelAmplitude); }; /** @brief DeccelAmplitude action. @js NA */ -class AX_DLL DeccelAmplitude : public ActionInterval +class CC_DLL DeccelAmplitude : public ActionInterval { public: /** @@ -329,7 +329,7 @@ protected: ActionInterval* _other; private: - AX_DISALLOW_COPY_AND_ASSIGN(DeccelAmplitude); + CC_DISALLOW_COPY_AND_ASSIGN(DeccelAmplitude); }; /** @@ -340,7 +340,7 @@ private: Sequence::create(Lens3D::create(...), StopGrid::create(), nullptr); @endcode */ -class AX_DLL StopGrid : public ActionInstant +class CC_DLL StopGrid : public ActionInstant { public: /** @@ -363,13 +363,13 @@ protected: void cacheTargetAsGridNode(); private: - AX_DISALLOW_COPY_AND_ASSIGN(StopGrid); + CC_DISALLOW_COPY_AND_ASSIGN(StopGrid); }; /** @brief ReuseGrid action. */ -class AX_DLL ReuseGrid : public ActionInstant +class CC_DLL ReuseGrid : public ActionInstant { public: /** @@ -402,7 +402,7 @@ protected: int _times; private: - AX_DISALLOW_COPY_AND_ASSIGN(ReuseGrid); + CC_DISALLOW_COPY_AND_ASSIGN(ReuseGrid); }; // end of actions group diff --git a/core/2d/CCActionGrid3D.cpp b/core/2d/CCActionGrid3D.cpp index b188d41a11..b363d45c24 100644 --- a/core/2d/CCActionGrid3D.cpp +++ b/core/2d/CCActionGrid3D.cpp @@ -209,7 +209,7 @@ FlipY3D* FlipY3D::create(float duration) } else { - AX_SAFE_DELETE(action); + CC_SAFE_DELETE(action); } return action; @@ -291,7 +291,7 @@ Lens3D* Lens3D::create(float duration, const Vec2& gridSize, const Vec2& positio } else { - AX_SAFE_DELETE(action); + CC_SAFE_DELETE(action); } return action; @@ -392,7 +392,7 @@ Ripple3D* Ripple3D::create(float duration, } else { - AX_SAFE_DELETE(action); + CC_SAFE_DELETE(action); } return action; @@ -470,7 +470,7 @@ Shaky3D* Shaky3D::create(float duration, const Vec2& gridSize, int range, bool s } else { - AX_SAFE_DELETE(action); + CC_SAFE_DELETE(action); } return action; } @@ -531,7 +531,7 @@ Liquid* Liquid::create(float duration, const Vec2& gridSize, unsigned int waves, } else { - AX_SAFE_DELETE(action); + CC_SAFE_DELETE(action); } return action; @@ -594,7 +594,7 @@ Waves* Waves::create(float duration, } else { - AX_SAFE_DELETE(action); + CC_SAFE_DELETE(action); } return action; @@ -668,7 +668,7 @@ Twirl* Twirl::create(float duration, const Vec2& gridSize, const Vec2& position, } else { - AX_SAFE_DELETE(action); + CC_SAFE_DELETE(action); } return action; diff --git a/core/2d/CCActionGrid3D.h b/core/2d/CCActionGrid3D.h index ed7fae5e3f..22c6a93653 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 AX_DLL Waves3D : public Grid3DAction +class CC_DLL Waves3D : public Grid3DAction { public: /** @@ -100,14 +100,14 @@ protected: float _amplitudeRate; private: - AX_DISALLOW_COPY_AND_ASSIGN(Waves3D); + CC_DISALLOW_COPY_AND_ASSIGN(Waves3D); }; /** @brief FlipX3D action. @details This action is used for flipping the target node on the x axis. */ -class AX_DLL FlipX3D : public Grid3DAction +class CC_DLL FlipX3D : public Grid3DAction { public: /** @@ -140,14 +140,14 @@ public: virtual bool initWithSize(const Vec2& gridSize, float duration); private: - AX_DISALLOW_COPY_AND_ASSIGN(FlipX3D); + CC_DISALLOW_COPY_AND_ASSIGN(FlipX3D); }; /** @brief FlipY3D action. @details This action is used for flipping the target node on the y axis. */ -class AX_DLL FlipY3D : public FlipX3D +class CC_DLL FlipY3D : public FlipX3D { public: /** @@ -165,7 +165,7 @@ public: virtual ~FlipY3D() {} private: - AX_DISALLOW_COPY_AND_ASSIGN(FlipY3D); + CC_DISALLOW_COPY_AND_ASSIGN(FlipY3D); }; /** @@ -175,7 +175,7 @@ private: duration, grid size, center position of lens, radius of lens. Also you can change the lens effect value & whether effect is concave by the setter methods. */ -class AX_DLL Lens3D : public Grid3DAction +class CC_DLL Lens3D : public Grid3DAction { public: /** @@ -247,7 +247,7 @@ protected: bool _dirty; private: - AX_DISALLOW_COPY_AND_ASSIGN(Lens3D); + CC_DISALLOW_COPY_AND_ASSIGN(Lens3D); }; /** @@ -257,7 +257,7 @@ private: duration, grid size, center position of ripple, radius of ripple, waves count, amplitude. */ -class AX_DLL Ripple3D : public Grid3DAction +class CC_DLL Ripple3D : public Grid3DAction { public: /** @@ -343,7 +343,7 @@ protected: float _amplitudeRate; private: - AX_DISALLOW_COPY_AND_ASSIGN(Ripple3D); + CC_DISALLOW_COPY_AND_ASSIGN(Ripple3D); }; /** @@ -352,7 +352,7 @@ private: You can create the action by these parameters: duration, grid size, range, whether shake on the z axis. */ -class AX_DLL Shaky3D : public Grid3DAction +class CC_DLL Shaky3D : public Grid3DAction { public: /** @@ -387,7 +387,7 @@ protected: bool _shakeZ; private: - AX_DISALLOW_COPY_AND_ASSIGN(Shaky3D); + CC_DISALLOW_COPY_AND_ASSIGN(Shaky3D); }; /** @@ -396,7 +396,7 @@ private: You can create the action by these parameters: duration, grid size, waves count, amplitude of the liquid effect. */ -class AX_DLL Liquid : public Grid3DAction +class CC_DLL Liquid : public Grid3DAction { public: /** @@ -454,7 +454,7 @@ protected: float _amplitudeRate; private: - AX_DISALLOW_COPY_AND_ASSIGN(Liquid); + CC_DISALLOW_COPY_AND_ASSIGN(Liquid); }; /** @@ -464,7 +464,7 @@ private: duration, grid size, waves count, amplitude, whether waves on horizontal and whether waves on vertical. */ -class AX_DLL Waves : public Grid3DAction +class CC_DLL Waves : public Grid3DAction { public: /** @@ -538,7 +538,7 @@ protected: bool _horizontal; private: - AX_DISALLOW_COPY_AND_ASSIGN(Waves); + CC_DISALLOW_COPY_AND_ASSIGN(Waves); }; /** @@ -547,7 +547,7 @@ private: You can control the effect by these parameters: duration, grid size, center position, twirls count, amplitude. */ -class AX_DLL Twirl : public Grid3DAction +class CC_DLL Twirl : public Grid3DAction { public: /** @@ -628,7 +628,7 @@ protected: float _amplitudeRate; private: - AX_DISALLOW_COPY_AND_ASSIGN(Twirl); + CC_DISALLOW_COPY_AND_ASSIGN(Twirl); }; // end of actions group diff --git a/core/2d/CCActionInstant.cpp b/core/2d/CCActionInstant.cpp index 729840dcf5..d0380c98b5 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 - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return ret; } @@ -192,7 +192,7 @@ FlipX* FlipX::create(bool x) return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -232,7 +232,7 @@ FlipY* FlipY::create(bool y) return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -315,7 +315,7 @@ CallFunc* CallFunc::create(const std::function& func) return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -370,7 +370,7 @@ CallFuncN* CallFuncN::create(const std::function& func) return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } diff --git a/core/2d/CCActionInstant.h b/core/2d/CCActionInstant.h index 32d193657a..0a1706c541 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 AX_DLL ActionInstant : public FiniteTimeAction +class CC_DLL ActionInstant : public FiniteTimeAction { public: // @@ -50,13 +50,13 @@ public: // virtual ActionInstant* clone() const override { - AX_ASSERT(0); + CC_ASSERT(0); return nullptr; } virtual ActionInstant* reverse() const override { - AX_ASSERT(0); + CC_ASSERT(0); return nullptr; } @@ -79,7 +79,7 @@ private: /** @class Show * @brief Show the node. **/ -class AX_DLL Show : public ActionInstant +class CC_DLL Show : public ActionInstant { public: /** Allocates and initializes the action. @@ -102,13 +102,13 @@ public: virtual ~Show() {} private: - AX_DISALLOW_COPY_AND_ASSIGN(Show); + CC_DISALLOW_COPY_AND_ASSIGN(Show); }; /** @class Hide * @brief Hide the node. */ -class AX_DLL Hide : public ActionInstant +class CC_DLL Hide : public ActionInstant { public: /** Allocates and initializes the action. @@ -131,13 +131,13 @@ public: virtual ~Hide() {} private: - AX_DISALLOW_COPY_AND_ASSIGN(Hide); + CC_DISALLOW_COPY_AND_ASSIGN(Hide); }; /** @class ToggleVisibility * @brief Toggles the visibility of a node. */ -class AX_DLL ToggleVisibility : public ActionInstant +class CC_DLL ToggleVisibility : public ActionInstant { public: /** Allocates and initializes the action. @@ -160,13 +160,13 @@ public: virtual ~ToggleVisibility() {} private: - AX_DISALLOW_COPY_AND_ASSIGN(ToggleVisibility); + CC_DISALLOW_COPY_AND_ASSIGN(ToggleVisibility); }; /** @class RemoveSelf * @brief Remove the node. */ -class AX_DLL RemoveSelf : public ActionInstant +class CC_DLL RemoveSelf : public ActionInstant { public: /** Create the action. @@ -196,14 +196,14 @@ protected: bool _isNeedCleanUp; private: - AX_DISALLOW_COPY_AND_ASSIGN(RemoveSelf); + CC_DISALLOW_COPY_AND_ASSIGN(RemoveSelf); }; /** @class FlipX * @brief Flips the sprite horizontally. * @since v0.99.0 */ -class AX_DLL FlipX : public ActionInstant +class CC_DLL FlipX : public ActionInstant { public: /** Create the action. @@ -233,14 +233,14 @@ protected: bool _flipX; private: - AX_DISALLOW_COPY_AND_ASSIGN(FlipX); + CC_DISALLOW_COPY_AND_ASSIGN(FlipX); }; /** @class FlipY * @brief Flips the sprite vertically. * @since v0.99.0 */ -class AX_DLL FlipY : public ActionInstant +class CC_DLL FlipY : public ActionInstant { public: /** Create the action. @@ -270,13 +270,13 @@ protected: bool _flipY; private: - AX_DISALLOW_COPY_AND_ASSIGN(FlipY); + CC_DISALLOW_COPY_AND_ASSIGN(FlipY); }; /** @class Place * @brief Places the node in a certain position. */ -class AX_DLL Place : public ActionInstant +class CC_DLL Place : public ActionInstant { public: /** Creates a Place action with a position. @@ -306,13 +306,13 @@ protected: Vec2 _position; private: - AX_DISALLOW_COPY_AND_ASSIGN(Place); + CC_DISALLOW_COPY_AND_ASSIGN(Place); }; /** @class CallFunc * @brief Calls a 'callback'. */ -class AX_DLL CallFunc : public ActionInstant +class CC_DLL CallFunc : public ActionInstant { public: /** Creates the action with the callback of type std::function. @@ -354,14 +354,14 @@ protected: std::function _function; private: - AX_DISALLOW_COPY_AND_ASSIGN(CallFunc); + CC_DISALLOW_COPY_AND_ASSIGN(CallFunc); }; /** @class CallFuncN * @brief Calls a 'callback' with the node as the first argument. N means Node. * @js NA */ -class AX_DLL CallFuncN : public CallFunc +class CC_DLL CallFuncN : public CallFunc { public: /** Creates the action with the callback of type std::function. @@ -389,7 +389,7 @@ protected: std::function _functionN; private: - AX_DISALLOW_COPY_AND_ASSIGN(CallFuncN); + CC_DISALLOW_COPY_AND_ASSIGN(CallFuncN); }; // end of actions group diff --git a/core/2d/CCActionInterval.cpp b/core/2d/CCActionInterval.cpp index 733c6716bb..cc2c7b5ba1 100644 --- a/core/2d/CCActionInterval.cpp +++ b/core/2d/CCActionInterval.cpp @@ -287,8 +287,8 @@ Sequence::Sequence() : _split(0) Sequence::~Sequence() { - AX_SAFE_RELEASE(_actions[0]); - AX_SAFE_RELEASE(_actions[1]); + CC_SAFE_RELEASE(_actions[0]); + CC_SAFE_RELEASE(_actions[1]); } void Sequence::startWithTarget(Node* target) @@ -448,7 +448,7 @@ Repeat* Repeat::clone() const Repeat::~Repeat() { - AX_SAFE_RELEASE(_innerAction); + CC_SAFE_RELEASE(_innerAction); } void Repeat::startWithTarget(Node* target) @@ -531,7 +531,7 @@ Repeat* Repeat::reverse() const // RepeatForever::~RepeatForever() { - AX_SAFE_RELEASE(_innerAction); + CC_SAFE_RELEASE(_innerAction); } RepeatForever* RepeatForever::create(ActionInterval* action) @@ -742,8 +742,8 @@ Spawn::Spawn() : _one(nullptr), _two(nullptr) {} Spawn::~Spawn() { - AX_SAFE_RELEASE(_one); - AX_SAFE_RELEASE(_two); + CC_SAFE_RELEASE(_one); + CC_SAFE_RELEASE(_two); } void Spawn::startWithTarget(Node* target) @@ -932,7 +932,7 @@ void RotateTo::update(float time) } else { -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS if (_startAngle.x == _startAngle.y && _diffAngle.x == _diffAngle.y) { _target->setRotation(_startAngle.x + _diffAngle.x * time); @@ -945,7 +945,7 @@ void RotateTo::update(float time) #else _target->setRotationSkewX(_startAngle.x + _diffAngle.x * time); _target->setRotationSkewY(_startAngle.y + _diffAngle.y * time); -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS } } } @@ -1077,7 +1077,7 @@ void RotateBy::update(float time) } else { -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS if (_startAngle.x == _startAngle.y && _deltaAngle.x == _deltaAngle.y) { _target->setRotation(_startAngle.x + _deltaAngle.x * time); @@ -1090,7 +1090,7 @@ void RotateBy::update(float time) #else _target->setRotationSkewX(_startAngle.x + _deltaAngle.x * time); _target->setRotationSkewY(_startAngle.y + _deltaAngle.y * time); -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS } } } @@ -1174,7 +1174,7 @@ void MoveBy::update(float t) { if (_target) { -#if AX_ENABLE_STACKABLE_ACTIONS +#if CC_ENABLE_STACKABLE_ACTIONS Vec3 currentPos = _target->getPosition3D(); Vec3 diff = currentPos - _previousPosition; _startPosition = _startPosition + diff; @@ -1183,7 +1183,7 @@ void MoveBy::update(float t) _previousPosition = newPos; #else _target->setPosition3D(_startPosition + _positionDelta * t); -#endif // AX_ENABLE_STACKABLE_ACTIONS +#endif // CC_ENABLE_STACKABLE_ACTIONS } } @@ -1583,7 +1583,7 @@ void JumpBy::update(float t) y += _delta.y * t; float x = _delta.x * t; -#if AX_ENABLE_STACKABLE_ACTIONS +#if CC_ENABLE_STACKABLE_ACTIONS Vec2 currentPos = _target->getPosition(); Vec2 diff = currentPos - _previousPos; @@ -1595,7 +1595,7 @@ void JumpBy::update(float t) _previousPos = newPos; #else _target->setPosition(_startPosition + Vec2(x, y)); -#endif // !AX_ENABLE_STACKABLE_ACTIONS +#endif // !CC_ENABLE_STACKABLE_ACTIONS } } @@ -1726,7 +1726,7 @@ void BezierBy::update(float time) float x = bezierat(xa, xb, xc, xd, time); float y = bezierat(ya, yb, yc, yd, time); -#if AX_ENABLE_STACKABLE_ACTIONS +#if CC_ENABLE_STACKABLE_ACTIONS Vec2 currentPos = _target->getPosition(); Vec2 diff = currentPos - _previousPosition; _startPosition = _startPosition + diff; @@ -1737,7 +1737,7 @@ void BezierBy::update(float time) _previousPosition = newPos; #else _target->setPosition(_startPosition + Vec2(x, y)); -#endif // !AX_ENABLE_STACKABLE_ACTIONS +#endif // !CC_ENABLE_STACKABLE_ACTIONS } } @@ -2393,7 +2393,7 @@ bool ReverseTime::initWithAction(FiniteTimeAction* action) if (ActionInterval::initWithDuration(action->getDuration())) { // Don't leak if action is reused - AX_SAFE_RELEASE(_other); + CC_SAFE_RELEASE(_other); _other = action; action->retain(); @@ -2414,7 +2414,7 @@ ReverseTime::ReverseTime() : _other(nullptr) {} ReverseTime::~ReverseTime() { - AX_SAFE_RELEASE(_other); + CC_SAFE_RELEASE(_other); } void ReverseTime::startWithTarget(Node* target) @@ -2464,10 +2464,10 @@ Animate::Animate() {} Animate::~Animate() { - AX_SAFE_RELEASE(_animation); - AX_SAFE_RELEASE(_origFrame); - AX_SAFE_DELETE(_splitTimes); - AX_SAFE_RELEASE(_frameDisplayedEvent); + CC_SAFE_RELEASE(_animation); + CC_SAFE_RELEASE(_origFrame); + CC_SAFE_DELETE(_splitTimes); + CC_SAFE_RELEASE(_frameDisplayedEvent); } bool Animate::initWithAnimation(Animation* animation) @@ -2510,8 +2510,8 @@ void Animate::setAnimation(axis::Animation* animation) { if (_animation != animation) { - AX_SAFE_RETAIN(animation); - AX_SAFE_RELEASE(_animation); + CC_SAFE_RETAIN(animation); + CC_SAFE_RELEASE(_animation); _animation = animation; } } @@ -2527,7 +2527,7 @@ void Animate::startWithTarget(Node* target) ActionInterval::startWithTarget(target); Sprite* sprite = static_cast(target); - AX_SAFE_RELEASE(_origFrame); + CC_SAFE_RELEASE(_origFrame); if (_animation->getRestoreOriginalFrame()) { @@ -2637,8 +2637,8 @@ TargetedAction::TargetedAction() : _action(nullptr), _forcedTarget(nullptr) {} TargetedAction::~TargetedAction() { - AX_SAFE_RELEASE(_forcedTarget); - AX_SAFE_RELEASE(_action); + CC_SAFE_RELEASE(_forcedTarget); + CC_SAFE_RELEASE(_action); } TargetedAction* TargetedAction::create(Node* target, FiniteTimeAction* action) @@ -2658,9 +2658,9 @@ bool TargetedAction::initWithTarget(Node* target, FiniteTimeAction* action) { if (ActionInterval::initWithDuration(action->getDuration())) { - AX_SAFE_RETAIN(target); + CC_SAFE_RETAIN(target); _forcedTarget = target; - AX_SAFE_RETAIN(action); + CC_SAFE_RETAIN(action); _action = action; return true; } @@ -2704,8 +2704,8 @@ void TargetedAction::setForcedTarget(Node* forcedTarget) { if (_forcedTarget != forcedTarget) { - AX_SAFE_RETAIN(forcedTarget); - AX_SAFE_RELEASE(_forcedTarget); + CC_SAFE_RETAIN(forcedTarget); + CC_SAFE_RELEASE(_forcedTarget); _forcedTarget = forcedTarget; } } diff --git a/core/2d/CCActionInterval.h b/core/2d/CCActionInterval.h index 08ad4622f8..5ec0f87d83 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 AX_DLL ActionInterval : public FiniteTimeAction +class CC_DLL ActionInterval : public FiniteTimeAction { public: /** How many seconds had elapsed since the actions started to run. @@ -100,13 +100,13 @@ public: virtual void startWithTarget(Node* target) override; virtual ActionInterval* reverse() const override { - AX_ASSERT(0); + CC_ASSERT(0); return nullptr; } virtual ActionInterval* clone() const override { - AX_ASSERT(0); + CC_ASSERT(0); return nullptr; } @@ -125,14 +125,14 @@ protected: /** @class Sequence * @brief Runs actions sequentially, one after another. */ -class AX_DLL Sequence : public ActionInterval +class CC_DLL Sequence : public ActionInterval { public: /** Helper constructor to create an array of sequenceable actions. * * @return An autoreleased Sequence object. */ - static Sequence* create(FiniteTimeAction* action1, ...) AX_REQUIRES_NULL_TERMINATION; + static Sequence* create(FiniteTimeAction* action1, ...) CC_REQUIRES_NULL_TERMINATION; /** Helper constructor to create an array of sequenceable actions given an array. * @code @@ -187,14 +187,14 @@ protected: int _last; private: - AX_DISALLOW_COPY_AND_ASSIGN(Sequence); + CC_DISALLOW_COPY_AND_ASSIGN(Sequence); }; /** @class Repeat * @brief Repeats an action a number of times. * To repeat an action forever use the RepeatForever action. */ -class AX_DLL Repeat : public ActionInterval +class CC_DLL Repeat : public ActionInterval { public: /** Creates a Repeat action. Times is an unsigned integer between 1 and pow(2,30). @@ -213,8 +213,8 @@ public: { if (_innerAction != action) { - AX_SAFE_RETAIN(action); - AX_SAFE_RELEASE(_innerAction); + CC_SAFE_RETAIN(action); + CC_SAFE_RELEASE(_innerAction); _innerAction = action; } } @@ -253,7 +253,7 @@ protected: FiniteTimeAction* _innerAction; private: - AX_DISALLOW_COPY_AND_ASSIGN(Repeat); + CC_DISALLOW_COPY_AND_ASSIGN(Repeat); }; /** @class RepeatForever @@ -261,7 +261,7 @@ private: To repeat the an action for a limited number of times use the Repeat action. * @warning This action can't be Sequenceable because it is not an IntervalAction. */ -class AX_DLL RepeatForever : public ActionInterval +class CC_DLL RepeatForever : public ActionInterval { public: /** Creates the action. @@ -279,9 +279,9 @@ public: { if (_innerAction != action) { - AX_SAFE_RELEASE(_innerAction); + CC_SAFE_RELEASE(_innerAction); _innerAction = action; - AX_SAFE_RETAIN(_innerAction); + CC_SAFE_RETAIN(_innerAction); } } @@ -314,13 +314,13 @@ protected: ActionInterval* _innerAction; private: - AX_DISALLOW_COPY_AND_ASSIGN(RepeatForever); + CC_DISALLOW_COPY_AND_ASSIGN(RepeatForever); }; /** @class Spawn * @brief Spawn a new action immediately */ -class AX_DLL Spawn : public ActionInterval +class CC_DLL Spawn : public ActionInterval { public: /** Helper constructor to create an array of spawned actions. @@ -332,7 +332,7 @@ public: * * @return An autoreleased Spawn object. */ - static Spawn* create(FiniteTimeAction* action1, ...) AX_REQUIRES_NULL_TERMINATION; + static Spawn* create(FiniteTimeAction* action1, ...) CC_REQUIRES_NULL_TERMINATION; /** Helper constructor to create an array of spawned actions. * @@ -383,14 +383,14 @@ protected: FiniteTimeAction* _two; private: - AX_DISALLOW_COPY_AND_ASSIGN(Spawn); + CC_DISALLOW_COPY_AND_ASSIGN(Spawn); }; /** @class RotateTo * @brief Rotates a Node object to a certain angle by modifying it's rotation attribute. The direction will be decided by the shortest angle. */ -class AX_DLL RotateTo : public ActionInterval +class CC_DLL RotateTo : public ActionInterval { public: /** @@ -460,13 +460,13 @@ protected: Vec3 _diffAngle; private: - AX_DISALLOW_COPY_AND_ASSIGN(RotateTo); + CC_DISALLOW_COPY_AND_ASSIGN(RotateTo); }; /** @class RotateBy * @brief Rotates a Node object clockwise a number of degrees by modifying it's rotation attribute. */ -class AX_DLL RotateBy : public ActionInterval +class CC_DLL RotateBy : public ActionInterval { public: /** @@ -525,7 +525,7 @@ protected: Vec3 _startAngle; private: - AX_DISALLOW_COPY_AND_ASSIGN(RotateBy); + CC_DISALLOW_COPY_AND_ASSIGN(RotateBy); }; /** @class MoveBy @@ -535,7 +535,7 @@ private: movement will be the sum of individual movements. @since v2.1beta2-custom */ -class AX_DLL MoveBy : public ActionInterval +class CC_DLL MoveBy : public ActionInterval { public: /** @@ -580,7 +580,7 @@ protected: Vec3 _previousPosition; private: - AX_DISALLOW_COPY_AND_ASSIGN(MoveBy); + CC_DISALLOW_COPY_AND_ASSIGN(MoveBy); }; /** @class MoveTo @@ -589,7 +589,7 @@ private: movements. @since v2.1beta2-custom */ -class AX_DLL MoveTo : public MoveBy +class CC_DLL MoveTo : public MoveBy { public: /** @@ -632,14 +632,14 @@ protected: Vec3 _endPosition; private: - AX_DISALLOW_COPY_AND_ASSIGN(MoveTo); + CC_DISALLOW_COPY_AND_ASSIGN(MoveTo); }; /** @class SkewTo * @brief Skews a Node object to given angles by modifying it's skewX and skewY attributes @since v1.0 */ -class AX_DLL SkewTo : public ActionInterval +class CC_DLL SkewTo : public ActionInterval { public: /** @@ -680,14 +680,14 @@ protected: float _deltaY; private: - AX_DISALLOW_COPY_AND_ASSIGN(SkewTo); + CC_DISALLOW_COPY_AND_ASSIGN(SkewTo); }; /** @class SkewBy * @brief Skews a Node object by skewX and skewY degrees. @since v1.0 */ -class AX_DLL SkewBy : public SkewTo +class CC_DLL SkewBy : public SkewTo { public: /** @@ -714,13 +714,13 @@ public: bool initWithDuration(float t, float sx, float sy); private: - AX_DISALLOW_COPY_AND_ASSIGN(SkewBy); + CC_DISALLOW_COPY_AND_ASSIGN(SkewBy); }; /** @class ResizeTo * @brief Resize a Node object to the final size by modifying it's 'size' attribute. */ -class AX_DLL ResizeTo : public ActionInterval +class CC_DLL ResizeTo : public ActionInterval { public: /** @@ -756,14 +756,14 @@ protected: Vec2 _sizeDelta; private: - AX_DISALLOW_COPY_AND_ASSIGN(ResizeTo); + CC_DISALLOW_COPY_AND_ASSIGN(ResizeTo); }; /** @class ResizeBy * @brief Resize a Node object by a size. Works on all nodes where setContentSize is effective. But it's mostly useful * for nodes where 9-slice is enabled */ -class AX_DLL ResizeBy : public ActionInterval +class CC_DLL ResizeBy : public ActionInterval { public: /** @@ -798,13 +798,13 @@ protected: Vec2 _previousSize; private: - AX_DISALLOW_COPY_AND_ASSIGN(ResizeBy); + CC_DISALLOW_COPY_AND_ASSIGN(ResizeBy); }; /** @class JumpBy * @brief Moves a Node object simulating a parabolic jump movement by modifying it's position attribute. */ -class AX_DLL JumpBy : public ActionInterval +class CC_DLL JumpBy : public ActionInterval { public: /** @@ -845,13 +845,13 @@ protected: Vec2 _previousPos; private: - AX_DISALLOW_COPY_AND_ASSIGN(JumpBy); + CC_DISALLOW_COPY_AND_ASSIGN(JumpBy); }; /** @class JumpTo * @brief Moves a Node object to a parabolic position simulating a jump movement by modifying it's position attribute. */ -class AX_DLL JumpTo : public JumpBy +class CC_DLL JumpTo : public JumpBy { public: /** @@ -884,7 +884,7 @@ protected: Vec2 _endPosition; private: - AX_DISALLOW_COPY_AND_ASSIGN(JumpTo); + CC_DISALLOW_COPY_AND_ASSIGN(JumpTo); }; /** @struct Bezier configuration structure @@ -902,7 +902,7 @@ typedef struct _ccBezierConfig /** @class BezierBy * @brief An action that moves the target with a cubic Bezier curve by a certain distance. */ -class AX_DLL BezierBy : public ActionInterval +class CC_DLL BezierBy : public ActionInterval { public: /** Creates the action with a duration and a bezier configuration. @@ -943,14 +943,14 @@ protected: Vec2 _previousPosition; private: - AX_DISALLOW_COPY_AND_ASSIGN(BezierBy); + CC_DISALLOW_COPY_AND_ASSIGN(BezierBy); }; /** @class BezierTo * @brief An action that moves the target with a cubic Bezier curve to a destination point. @since v0.8.2 */ -class AX_DLL BezierTo : public BezierBy +class CC_DLL BezierTo : public BezierBy { public: /** Creates the action with a duration and a bezier configuration. @@ -983,7 +983,7 @@ protected: ccBezierConfig _toConfig; private: - AX_DISALLOW_COPY_AND_ASSIGN(BezierTo); + CC_DISALLOW_COPY_AND_ASSIGN(BezierTo); }; /** @class ScaleTo @@ -991,7 +991,7 @@ private: @warning This action doesn't support "reverse". @warning The physics body contained in Node doesn't support this action. */ -class AX_DLL ScaleTo : public ActionInterval +class CC_DLL ScaleTo : public ActionInterval { public: /** @@ -1066,14 +1066,14 @@ protected: float _deltaZ; private: - AX_DISALLOW_COPY_AND_ASSIGN(ScaleTo); + CC_DISALLOW_COPY_AND_ASSIGN(ScaleTo); }; /** @class ScaleBy * @brief Scales a Node object a zoom factor by modifying it's scale attribute. @warning The physics body contained in Node doesn't support this action. */ -class AX_DLL ScaleBy : public ScaleTo +class CC_DLL ScaleBy : public ScaleTo { public: /** @@ -1114,13 +1114,13 @@ public: virtual ~ScaleBy() {} private: - AX_DISALLOW_COPY_AND_ASSIGN(ScaleBy); + CC_DISALLOW_COPY_AND_ASSIGN(ScaleBy); }; /** @class Blink * @brief Blinks a Node object by modifying it's visible attribute. */ -class AX_DLL Blink : public ActionInterval +class CC_DLL Blink : public ActionInterval { public: /** @@ -1157,7 +1157,7 @@ protected: bool _originalState; private: - AX_DISALLOW_COPY_AND_ASSIGN(Blink); + CC_DISALLOW_COPY_AND_ASSIGN(Blink); }; /** @class FadeTo @@ -1165,7 +1165,7 @@ private: custom one. @warning This action doesn't support "reverse" */ -class AX_DLL FadeTo : public ActionInterval +class CC_DLL FadeTo : public ActionInterval { public: /** @@ -1203,14 +1203,14 @@ protected: friend class FadeIn; private: - AX_DISALLOW_COPY_AND_ASSIGN(FadeTo); + CC_DISALLOW_COPY_AND_ASSIGN(FadeTo); }; /** @class FadeIn * @brief Fades In an object that implements the RGBAProtocol protocol. It modifies the opacity from 0 to 255. The "reverse" of this action is FadeOut */ -class AX_DLL FadeIn : public FadeTo +class CC_DLL FadeIn : public FadeTo { public: /** @@ -1236,7 +1236,7 @@ public: virtual ~FadeIn() {} private: - AX_DISALLOW_COPY_AND_ASSIGN(FadeIn); + CC_DISALLOW_COPY_AND_ASSIGN(FadeIn); FadeTo* _reverseAction; }; @@ -1244,7 +1244,7 @@ private: * @brief Fades Out an object that implements the RGBAProtocol protocol. It modifies the opacity from 255 to 0. The "reverse" of this action is FadeIn */ -class AX_DLL FadeOut : public FadeTo +class CC_DLL FadeOut : public FadeTo { public: /** @@ -1269,7 +1269,7 @@ public: virtual ~FadeOut() {} private: - AX_DISALLOW_COPY_AND_ASSIGN(FadeOut); + CC_DISALLOW_COPY_AND_ASSIGN(FadeOut); FadeTo* _reverseAction; }; @@ -1278,7 +1278,7 @@ private: @warning This action doesn't support "reverse" @since v0.7.2 */ -class AX_DLL TintTo : public ActionInterval +class CC_DLL TintTo : public ActionInterval { public: /** @@ -1320,14 +1320,14 @@ protected: Color3B _from; private: - AX_DISALLOW_COPY_AND_ASSIGN(TintTo); + CC_DISALLOW_COPY_AND_ASSIGN(TintTo); }; /** @class TintBy @brief Tints a Node that implements the NodeRGB protocol from current tint to a custom one. @since v0.7.2 */ -class AX_DLL TintBy : public ActionInterval +class CC_DLL TintBy : public ActionInterval { public: /** @@ -1367,13 +1367,13 @@ protected: int16_t _fromB; private: - AX_DISALLOW_COPY_AND_ASSIGN(TintBy); + CC_DISALLOW_COPY_AND_ASSIGN(TintBy); }; /** @class DelayTime * @brief Delays the action a certain amount of seconds. */ -class AX_DLL DelayTime : public ActionInterval +class CC_DLL DelayTime : public ActionInterval { public: /** @@ -1397,7 +1397,7 @@ public: virtual ~DelayTime() {} private: - AX_DISALLOW_COPY_AND_ASSIGN(DelayTime); + CC_DISALLOW_COPY_AND_ASSIGN(DelayTime); }; /** @class ReverseTime @@ -1408,7 +1408,7 @@ private: of your own actions, but using it outside the "reversed" scope is not recommended. */ -class AX_DLL ReverseTime : public ActionInterval +class CC_DLL ReverseTime : public ActionInterval { public: /** Creates the action. @@ -1440,14 +1440,14 @@ protected: FiniteTimeAction* _other; private: - AX_DISALLOW_COPY_AND_ASSIGN(ReverseTime); + CC_DISALLOW_COPY_AND_ASSIGN(ReverseTime); }; class Texture2D; /** @class Animate * @brief Animates a sprite given the name of an Animation. */ -class AX_DLL Animate : public ActionInterval +class CC_DLL Animate : public ActionInterval { public: /** Creates the action with an Animation and will restore the original frame when the animation is over. @@ -1504,14 +1504,14 @@ protected: AnimationFrame::DisplayedEventInfo _frameDisplayedEventInfo; private: - AX_DISALLOW_COPY_AND_ASSIGN(Animate); + CC_DISALLOW_COPY_AND_ASSIGN(Animate); }; /** @class TargetedAction * @brief Overrides the target of an action so that it always runs on the target * specified at action creation rather than the one specified by runAction. */ -class AX_DLL TargetedAction : public ActionInterval +class CC_DLL TargetedAction : public ActionInterval { public: /** Create an action with the specified action and forced target. @@ -1557,14 +1557,14 @@ protected: Node* _forcedTarget; private: - AX_DISALLOW_COPY_AND_ASSIGN(TargetedAction); + CC_DISALLOW_COPY_AND_ASSIGN(TargetedAction); }; /** * @class ActionFloat * @brief Action used to animate any value in range [from,to] over specified time interval */ -class AX_DLL ActionFloat : public ActionInterval +class CC_DLL ActionFloat : public ActionInterval { public: /** @@ -1609,7 +1609,7 @@ protected: ActionFloatCallback _callback; private: - AX_DISALLOW_COPY_AND_ASSIGN(ActionFloat); + CC_DISALLOW_COPY_AND_ASSIGN(ActionFloat); }; // end of actions group diff --git a/core/2d/CCActionManager.cpp b/core/2d/CCActionManager.cpp index e350879610..c11b69f3be 100644 --- a/core/2d/CCActionManager.cpp +++ b/core/2d/CCActionManager.cpp @@ -245,7 +245,7 @@ void ActionManager::removeAction(Action* action) if (element) { auto i = ccArrayGetIndexOfObject(element->actions, action); - if (i != AX_INVALID_INDEX) + if (i != CC_INVALID_INDEX) { removeActionAtIndex(i, element); } diff --git a/core/2d/CCActionManager.h b/core/2d/CCActionManager.h index e5a6c0ce98..497f93f1e3 100644 --- a/core/2d/CCActionManager.h +++ b/core/2d/CCActionManager.h @@ -56,7 +56,7 @@ struct _hashElement; @since v0.8 */ -class AX_DLL ActionManager : public Ref +class CC_DLL ActionManager : public Ref { public: /** diff --git a/core/2d/CCActionPageTurn3D.h b/core/2d/CCActionPageTurn3D.h index ae08c0b776..1ad129dd32 100644 --- a/core/2d/CCActionPageTurn3D.h +++ b/core/2d/CCActionPageTurn3D.h @@ -45,7 +45,7 @@ NS_AX_BEGIN @since v0.8.2 */ -class AX_DLL PageTurn3D : public Grid3DAction +class CC_DLL PageTurn3D : public Grid3DAction { public: /** diff --git a/core/2d/CCActionProgressTimer.h b/core/2d/CCActionProgressTimer.h index 431f8305cc..e50ec02532 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 AX_DLL ProgressTo : public ActionInterval +class CC_DLL ProgressTo : public ActionInterval { public: /** @@ -77,14 +77,14 @@ protected: float _from; private: - AX_DISALLOW_COPY_AND_ASSIGN(ProgressTo); + CC_DISALLOW_COPY_AND_ASSIGN(ProgressTo); }; /** @brief Progress from a percentage to another percentage. @since v0.99.1 */ -class AX_DLL ProgressFromTo : public ActionInterval +class CC_DLL ProgressFromTo : public ActionInterval { public: /** @@ -121,7 +121,7 @@ protected: float _from; private: - AX_DISALLOW_COPY_AND_ASSIGN(ProgressFromTo); + CC_DISALLOW_COPY_AND_ASSIGN(ProgressFromTo); }; // end of actions group diff --git a/core/2d/CCActionTiledGrid.cpp b/core/2d/CCActionTiledGrid.cpp index 4ec55fb513..a4ce4f680a 100644 --- a/core/2d/CCActionTiledGrid.cpp +++ b/core/2d/CCActionTiledGrid.cpp @@ -225,8 +225,8 @@ ShuffleTiles* ShuffleTiles::clone() const ShuffleTiles::~ShuffleTiles() { - AX_SAFE_DELETE_ARRAY(_tilesOrder); - AX_SAFE_DELETE_ARRAY(_tiles); + CC_SAFE_DELETE_ARRAY(_tilesOrder); + CC_SAFE_DELETE_ARRAY(_tiles); } void ShuffleTiles::shuffle(unsigned int* array, unsigned int len) @@ -569,7 +569,7 @@ TurnOffTiles* TurnOffTiles::clone() const TurnOffTiles::~TurnOffTiles() { - AX_SAFE_DELETE_ARRAY(_tilesOrder); + CC_SAFE_DELETE_ARRAY(_tilesOrder); } void TurnOffTiles::shuffle(unsigned int* array, unsigned int len) diff --git a/core/2d/CCActionTiledGrid.h b/core/2d/CCActionTiledGrid.h index c32d0e6b8a..71a65eb8ca 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 AX_DLL ShakyTiles3D : public TiledGrid3DAction +class CC_DLL ShakyTiles3D : public TiledGrid3DAction { public: /** @@ -77,7 +77,7 @@ protected: bool _shakeZ; private: - AX_DISALLOW_COPY_AND_ASSIGN(ShakyTiles3D); + CC_DISALLOW_COPY_AND_ASSIGN(ShakyTiles3D); }; /** @@ -86,7 +86,7 @@ private: You can create the action by these parameters: duration, grid size, range, whether shatter on the z axis. */ -class AX_DLL ShatteredTiles3D : public TiledGrid3DAction +class CC_DLL ShatteredTiles3D : public TiledGrid3DAction { public: /** @@ -122,7 +122,7 @@ protected: bool _shatterZ; private: - AX_DISALLOW_COPY_AND_ASSIGN(ShatteredTiles3D); + CC_DISALLOW_COPY_AND_ASSIGN(ShatteredTiles3D); }; struct Tile; @@ -132,7 +132,7 @@ struct Tile; You can create the action by these parameters: duration, grid size, the random seed. */ -class AX_DLL ShuffleTiles : public TiledGrid3DAction +class CC_DLL ShuffleTiles : public TiledGrid3DAction { public: /** @@ -172,14 +172,14 @@ protected: Tile* _tiles; private: - AX_DISALLOW_COPY_AND_ASSIGN(ShuffleTiles); + CC_DISALLOW_COPY_AND_ASSIGN(ShuffleTiles); }; /** @brief FadeOutTRTiles action. @details Fades out the target node with many tiles from Bottom-Left to Top-Right. */ -class AX_DLL FadeOutTRTiles : public TiledGrid3DAction +class CC_DLL FadeOutTRTiles : public TiledGrid3DAction { public: /** @@ -225,14 +225,14 @@ public: virtual ~FadeOutTRTiles() {} private: - AX_DISALLOW_COPY_AND_ASSIGN(FadeOutTRTiles); + CC_DISALLOW_COPY_AND_ASSIGN(FadeOutTRTiles); }; /** @brief FadeOutBLTiles action. @details Fades out the target node with many tiles from Top-Right to Bottom-Left. */ -class AX_DLL FadeOutBLTiles : public FadeOutTRTiles +class CC_DLL FadeOutBLTiles : public FadeOutTRTiles { public: /** @@ -251,14 +251,14 @@ public: virtual ~FadeOutBLTiles() {} private: - AX_DISALLOW_COPY_AND_ASSIGN(FadeOutBLTiles); + CC_DISALLOW_COPY_AND_ASSIGN(FadeOutBLTiles); }; /** @brief FadeOutUpTiles action. @details Fades out the target node with many tiles from bottom to top. */ -class AX_DLL FadeOutUpTiles : public FadeOutTRTiles +class CC_DLL FadeOutUpTiles : public FadeOutTRTiles { public: /** @@ -279,14 +279,14 @@ public: virtual ~FadeOutUpTiles() {} private: - AX_DISALLOW_COPY_AND_ASSIGN(FadeOutUpTiles); + CC_DISALLOW_COPY_AND_ASSIGN(FadeOutUpTiles); }; /** @brief FadeOutDownTiles action. @details Fades out the target node with many tiles from top to bottom. */ -class AX_DLL FadeOutDownTiles : public FadeOutUpTiles +class CC_DLL FadeOutDownTiles : public FadeOutUpTiles { public: /** @@ -305,14 +305,14 @@ public: virtual ~FadeOutDownTiles() {} private: - AX_DISALLOW_COPY_AND_ASSIGN(FadeOutDownTiles); + CC_DISALLOW_COPY_AND_ASSIGN(FadeOutDownTiles); }; /** @brief TurnOffTiles action. @details Turn off the target node with many tiles in random order. */ -class AX_DLL TurnOffTiles : public TiledGrid3DAction +class CC_DLL TurnOffTiles : public TiledGrid3DAction { public: /** @@ -373,14 +373,14 @@ protected: unsigned int* _tilesOrder; private: - AX_DISALLOW_COPY_AND_ASSIGN(TurnOffTiles); + CC_DISALLOW_COPY_AND_ASSIGN(TurnOffTiles); }; /** @brief WavesTiles3D action. @details This action wave the target node with many tiles. */ -class AX_DLL WavesTiles3D : public TiledGrid3DAction +class CC_DLL WavesTiles3D : public TiledGrid3DAction { public: /** @@ -438,14 +438,14 @@ protected: float _amplitudeRate; private: - AX_DISALLOW_COPY_AND_ASSIGN(WavesTiles3D); + CC_DISALLOW_COPY_AND_ASSIGN(WavesTiles3D); }; /** @brief JumpTiles3D action. @details Move the tiles of a target node across the Z axis. */ -class AX_DLL JumpTiles3D : public TiledGrid3DAction +class CC_DLL JumpTiles3D : public TiledGrid3DAction { public: /** @@ -503,7 +503,7 @@ protected: float _amplitudeRate; private: - AX_DISALLOW_COPY_AND_ASSIGN(JumpTiles3D); + CC_DISALLOW_COPY_AND_ASSIGN(JumpTiles3D); }; /** @@ -511,7 +511,7 @@ private: @details Split the target node in many rows. Then move out some rows from left, move out the other rows from right. */ -class AX_DLL SplitRows : public TiledGrid3DAction +class CC_DLL SplitRows : public TiledGrid3DAction { public: /** @@ -543,7 +543,7 @@ protected: Vec2 _winSize; private: - AX_DISALLOW_COPY_AND_ASSIGN(SplitRows); + CC_DISALLOW_COPY_AND_ASSIGN(SplitRows); }; /** @@ -551,7 +551,7 @@ private: @details Split the target node in many columns. Then move out some columns from top, move out the other columns from bottom. */ -class AX_DLL SplitCols : public TiledGrid3DAction +class CC_DLL SplitCols : public TiledGrid3DAction { public: /** @@ -586,7 +586,7 @@ protected: Vec2 _winSize; private: - AX_DISALLOW_COPY_AND_ASSIGN(SplitCols); + CC_DISALLOW_COPY_AND_ASSIGN(SplitCols); }; // end of actions group diff --git a/core/2d/CCActionTween.h b/core/2d/CCActionTween.h index 5e6aeddaa2..9cd0b3b3e6 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 AX_DLL ActionTweenDelegate +class CC_DLL ActionTweenDelegate { public: /** @@ -82,7 +82,7 @@ public: @since v0.99.2 */ -class AX_DLL ActionTween : public ActionInterval +class CC_DLL ActionTween : public ActionInterval { public: /** diff --git a/core/2d/CCAnimation.cpp b/core/2d/CCAnimation.cpp index d667671a24..c99ad186df 100644 --- a/core/2d/CCAnimation.cpp +++ b/core/2d/CCAnimation.cpp @@ -41,7 +41,7 @@ AnimationFrame* AnimationFrame::create(SpriteFrame* spriteFrame, float delayUnit } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -61,7 +61,7 @@ AnimationFrame::~AnimationFrame() { CCLOGINFO("deallocing AnimationFrame: %p", this); - AX_SAFE_RELEASE(_spriteFrame); + CC_SAFE_RELEASE(_spriteFrame); } AnimationFrame* AnimationFrame::clone() const diff --git a/core/2d/CCAnimation.h b/core/2d/CCAnimation.h index 2d91411d75..d4279ed9bb 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 __AX_ANIMATION_H__ -#define __AX_ANIMATION_H__ +#ifndef __CC_ANIMATION_H__ +#define __CC_ANIMATION_H__ #include "platform/CCPlatformConfig.h" #include "base/CCRef.h" @@ -55,7 +55,7 @@ class SpriteFrame; @since v2.0 */ -class AX_DLL AnimationFrame : public Ref, public Clonable +class CC_DLL AnimationFrame : public Ref, public Clonable { public: /** @struct DisplayedEventInfo @@ -87,8 +87,8 @@ public: */ void setSpriteFrame(SpriteFrame* frame) { - AX_SAFE_RETAIN(frame); - AX_SAFE_RELEASE(_spriteFrame); + CC_SAFE_RETAIN(frame); + CC_SAFE_RELEASE(_spriteFrame); _spriteFrame = frame; } @@ -146,7 +146,7 @@ protected: ValueMap _userInfo; private: - AX_DISALLOW_COPY_AND_ASSIGN(AnimationFrame); + CC_DISALLOW_COPY_AND_ASSIGN(AnimationFrame); }; /** @class Animation @@ -157,7 +157,7 @@ private: * sprite->runAction(Animate::create(animation)); * @endcode */ -class AX_DLL Animation : public Ref, public Clonable +class CC_DLL Animation : public Ref, public Clonable { public: /** Creates an animation. @@ -314,7 +314,7 @@ protected: unsigned int _loops; private: - AX_DISALLOW_COPY_AND_ASSIGN(Animation); + CC_DISALLOW_COPY_AND_ASSIGN(Animation); }; // end of sprite_nodes group @@ -322,4 +322,4 @@ private: NS_AX_END -#endif // __AX_ANIMATION_H__ +#endif // __CC_ANIMATION_H__ diff --git a/core/2d/CCAnimationCache.cpp b/core/2d/CCAnimationCache.cpp index efb18e971d..d098a5b1ef 100644 --- a/core/2d/CCAnimationCache.cpp +++ b/core/2d/CCAnimationCache.cpp @@ -48,7 +48,7 @@ AnimationCache* AnimationCache::getInstance() void AnimationCache::destroyInstance() { - AX_SAFE_RELEASE_NULL(s_sharedAnimationCache); + CC_SAFE_RELEASE_NULL(s_sharedAnimationCache); } bool AnimationCache::init() diff --git a/core/2d/CCAnimationCache.h b/core/2d/CCAnimationCache.h index b8ffaebd3b..228364739d 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 __AX_ANIMATION_CACHE_H__ -#define __AX_ANIMATION_CACHE_H__ +#ifndef __CC_ANIMATION_CACHE_H__ +#define __CC_ANIMATION_CACHE_H__ #include "base/CCRef.h" #include "base/CCMap.h" @@ -52,7 +52,7 @@ Before v0.99.5, the recommend way was to save them on the Sprite. Since v0.99.5, @since v0.99.5 @js cc.animationCache */ -class AX_DLL AnimationCache : public Ref +class CC_DLL AnimationCache : public Ref { public: /** @@ -129,4 +129,4 @@ private: NS_AX_END -#endif // __AX_ANIMATION_CACHE_H__ +#endif // __CC_ANIMATION_CACHE_H__ diff --git a/core/2d/CCAtlasNode.cpp b/core/2d/CCAtlasNode.cpp index 9185e2ff31..670676e267 100644 --- a/core/2d/CCAtlasNode.cpp +++ b/core/2d/CCAtlasNode.cpp @@ -44,7 +44,7 @@ NS_AX_BEGIN AtlasNode::~AtlasNode() { - AX_SAFE_RELEASE(_textureAtlas); + CC_SAFE_RELEASE(_textureAtlas); } AtlasNode* AtlasNode::create(std::string_view tile, int tileWidth, int tileHeight, int itemsToRender) @@ -55,7 +55,7 @@ AtlasNode* AtlasNode::create(std::string_view tile, int tileWidth, int tileHeigh ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -270,8 +270,8 @@ Texture2D* AtlasNode::getTexture() const void AtlasNode::setTextureAtlas(TextureAtlas* textureAtlas) { - AX_SAFE_RETAIN(textureAtlas); - AX_SAFE_RELEASE(_textureAtlas); + CC_SAFE_RETAIN(textureAtlas); + CC_SAFE_RELEASE(_textureAtlas); _textureAtlas = textureAtlas; } diff --git a/core/2d/CCAtlasNode.h b/core/2d/CCAtlasNode.h index 6a7ec0d2a3..6e1f01b898 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 AX_DLL AtlasNode : public Node, public TextureProtocol +class CC_DLL AtlasNode : public Node, public TextureProtocol { public: /** creates a AtlasNode with an Atlas file the width and height of each item and the quantity of items to render. @@ -147,7 +147,7 @@ protected: backend::UniformLocation _mvpMatrixLocation; private: - AX_DISALLOW_COPY_AND_ASSIGN(AtlasNode); + CC_DISALLOW_COPY_AND_ASSIGN(AtlasNode); }; // end of base_node group diff --git a/core/2d/CCAutoPolygon.cpp b/core/2d/CCAutoPolygon.cpp index bdf0ca293f..dedce69b69 100644 --- a/core/2d/CCAutoPolygon.cpp +++ b/core/2d/CCAutoPolygon.cpp @@ -133,12 +133,12 @@ void PolygonInfo::releaseVertsAndIndices() { if (nullptr != triangles.verts) { - AX_SAFE_DELETE_ARRAY(triangles.verts); + CC_SAFE_DELETE_ARRAY(triangles.verts); } if (nullptr != triangles.indices) { - AX_SAFE_DELETE_ARRAY(triangles.indices); + CC_SAFE_DELETE_ARRAY(triangles.indices); } } } @@ -184,7 +184,7 @@ AutoPolygon::AutoPolygon(std::string_view filename) AutoPolygon::~AutoPolygon() { - AX_SAFE_DELETE(_image); + CC_SAFE_DELETE(_image); } std::vector AutoPolygon::trace(const Rect& rect, float threshold) @@ -694,7 +694,7 @@ Rect AutoPolygon::getRealRect(const Rect& rect) else { // rect is specified, so convert to real rect - realRect = AX_RECT_POINTS_TO_PIXELS(rect); + realRect = CC_RECT_POINTS_TO_PIXELS(rect); } return realRect; } diff --git a/core/2d/CCAutoPolygon.h b/core/2d/CCAutoPolygon.h index 09ebdc2ac2..b6efcff087 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 AX_DLL PolygonInfo +class CC_DLL PolygonInfo { public: /// @name Creators @@ -138,7 +138,7 @@ private: * It has functions for each step in the process, from tracing all the points, to triangulation * the result can be then passed to Sprite::create() to create a Polygon Sprite */ -class AX_DLL AutoPolygon +class CC_DLL AutoPolygon { public: /** diff --git a/core/2d/CCCamera.cpp b/core/2d/CCCamera.cpp index d0573caae0..75798fe6d9 100644 --- a/core/2d/CCCamera.cpp +++ b/core/2d/CCCamera.cpp @@ -119,7 +119,7 @@ Camera::Camera() Camera::~Camera() { - AX_SAFE_RELEASE(_clearBrush); + CC_SAFE_RELEASE(_clearBrush); } const Mat4& Camera::getProjectionMatrix() const @@ -572,8 +572,8 @@ void Camera::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t par void Camera::setBackgroundBrush(CameraBackgroundBrush* clearBrush) { - AX_SAFE_RETAIN(clearBrush); - AX_SAFE_RELEASE(_clearBrush); + CC_SAFE_RETAIN(clearBrush); + CC_SAFE_RELEASE(_clearBrush); _clearBrush = clearBrush; } diff --git a/core/2d/CCCamera.h b/core/2d/CCCamera.h index 8d446db44d..8fffddbdd6 100644 --- a/core/2d/CCCamera.h +++ b/core/2d/CCCamera.h @@ -63,7 +63,7 @@ enum class CameraFlag /** * Defines a camera . */ -class AX_DLL Camera : public Node +class CC_DLL Camera : public Node { friend class Scene; friend class Director; diff --git a/core/2d/CCCameraBackgroundBrush.cpp b/core/2d/CCCameraBackgroundBrush.cpp index 745941b700..f992caf6d9 100644 --- a/core/2d/CCCameraBackgroundBrush.cpp +++ b/core/2d/CCCameraBackgroundBrush.cpp @@ -36,7 +36,7 @@ #include "renderer/CCTextureCube.h" #include "renderer/ccShaders.h" -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA # include "base/CCEventCustom.h" # include "base/CCEventListenerCustom.h" # include "base/CCEventType.h" @@ -49,7 +49,7 @@ CameraBackgroundBrush::CameraBackgroundBrush() {} CameraBackgroundBrush::~CameraBackgroundBrush() { - AX_SAFE_RELEASE_NULL(_programState); + CC_SAFE_RELEASE_NULL(_programState); } CameraBackgroundBrush* CameraBackgroundBrush::createNoneBrush() @@ -86,11 +86,11 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundBrush::createSkyboxBrush(std::strin CameraBackgroundDepthBrush::CameraBackgroundDepthBrush() : _depth(0.f) , _clearColor(false) -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA , _backToForegroundListener(nullptr) #endif { -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { initBuffer(); }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1); @@ -98,7 +98,7 @@ CameraBackgroundDepthBrush::CameraBackgroundDepthBrush() } CameraBackgroundDepthBrush::~CameraBackgroundDepthBrush() { -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -114,7 +114,7 @@ CameraBackgroundDepthBrush* CameraBackgroundDepthBrush::create(float depth) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -122,7 +122,7 @@ CameraBackgroundDepthBrush* CameraBackgroundDepthBrush::create(float depth) bool CameraBackgroundDepthBrush::init() { - AX_SAFE_RELEASE_NULL(_programState); + CC_SAFE_RELEASE_NULL(_programState); auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::CAMERA_CLEAR); _programState = new backend::ProgramState(program); @@ -166,8 +166,8 @@ bool CameraBackgroundDepthBrush::init() _vertices[2].texCoords = Tex2F(1, 1); _vertices[3].texCoords = Tex2F(0, 1); - _customCommand.setBeforeCallback(AX_CALLBACK_0(CameraBackgroundDepthBrush::onBeforeDraw, this)); - _customCommand.setAfterCallback(AX_CALLBACK_0(CameraBackgroundDepthBrush::onAfterDraw, this)); + _customCommand.setBeforeCallback(CC_CALLBACK_0(CameraBackgroundDepthBrush::onBeforeDraw, this)); + _customCommand.setAfterCallback(CC_CALLBACK_0(CameraBackgroundDepthBrush::onAfterDraw, this)); initBuffer(); return true; @@ -273,7 +273,7 @@ CameraBackgroundColorBrush* CameraBackgroundColorBrush::create(const Color4F& co } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -284,11 +284,11 @@ CameraBackgroundSkyBoxBrush::CameraBackgroundSkyBoxBrush() : _texture(nullptr) , _actived(true) , _textureValid(true) -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA , _backToForegroundListener(nullptr) #endif { -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { initBuffer(); }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1); @@ -297,8 +297,8 @@ CameraBackgroundSkyBoxBrush::CameraBackgroundSkyBoxBrush() CameraBackgroundSkyBoxBrush::~CameraBackgroundSkyBoxBrush() { - AX_SAFE_RELEASE(_texture); -#if AX_ENABLE_CACHE_TEXTURE_DATA + CC_SAFE_RELEASE(_texture); +#if CC_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -333,8 +333,8 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundSkyBoxBrush::create(std::string_vie } else { - AX_SAFE_DELETE(texture); - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(texture); + CC_SAFE_DELETE(ret); } } @@ -351,7 +351,7 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundSkyBoxBrush::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -386,16 +386,16 @@ void CameraBackgroundSkyBoxBrush::drawBackground(Camera* camera) renderer->popGroup(); - AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8); + CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8); } bool CameraBackgroundSkyBoxBrush::init() { - _customCommand.setBeforeCallback(AX_CALLBACK_0(CameraBackgroundSkyBoxBrush::onBeforeDraw, this)); - _customCommand.setAfterCallback(AX_CALLBACK_0(CameraBackgroundSkyBoxBrush::onAfterDraw, this)); + _customCommand.setBeforeCallback(CC_CALLBACK_0(CameraBackgroundSkyBoxBrush::onBeforeDraw, this)); + _customCommand.setAfterCallback(CC_CALLBACK_0(CameraBackgroundSkyBoxBrush::onAfterDraw, this)); - AX_SAFE_RELEASE_NULL(_programState); + CC_SAFE_RELEASE_NULL(_programState); auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::SKYBOX_3D); _programState = new backend::ProgramState(program); _uniformColorLoc = _programState->getUniformLocation("u_color"); @@ -444,8 +444,8 @@ void CameraBackgroundSkyBoxBrush::initBuffer() void CameraBackgroundSkyBoxBrush::setTexture(TextureCube* texture) { - AX_SAFE_RETAIN(texture); - AX_SAFE_RELEASE(_texture); + CC_SAFE_RETAIN(texture); + CC_SAFE_RELEASE(_texture); _texture = texture; _programState->setTexture(_uniformEnvLoc, 0, _texture->getBackendTexture()); } diff --git a/core/2d/CCCameraBackgroundBrush.h b/core/2d/CCCameraBackgroundBrush.h index cfc3aa6e7b..715f824c52 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 AX_DLL CameraBackgroundBrush : public Ref +class CC_DLL CameraBackgroundBrush : public Ref { public: /** @@ -130,7 +130,7 @@ protected: /** * Depth brush clear depth buffer with given depth */ -class AX_DLL CameraBackgroundDepthBrush : public CameraBackgroundBrush +class CC_DLL CameraBackgroundDepthBrush : public CameraBackgroundBrush { public: /** @@ -167,7 +167,7 @@ private: void onAfterDraw(); protected: -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener; #endif void initBuffer(); @@ -191,7 +191,7 @@ protected: /** * Color brush clear buffer with given depth and color */ -class AX_DLL CameraBackgroundColorBrush : public CameraBackgroundDepthBrush +class CC_DLL CameraBackgroundColorBrush : public CameraBackgroundDepthBrush { public: /** @@ -235,7 +235,7 @@ class EventListenerCustom; /** * Skybox brush clear buffer with a skybox */ -class AX_DLL CameraBackgroundSkyBoxBrush : public CameraBackgroundBrush +class CC_DLL CameraBackgroundSkyBoxBrush : public CameraBackgroundBrush { public: /** @@ -298,7 +298,7 @@ protected: TextureCube* _texture; -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener; #endif diff --git a/core/2d/CCClippingNode.cpp b/core/2d/CCClippingNode.cpp index c0e0b25881..c1cc0dcdb3 100644 --- a/core/2d/CCClippingNode.cpp +++ b/core/2d/CCClippingNode.cpp @@ -43,7 +43,7 @@ ClippingNode::~ClippingNode() _stencil->stopAllActions(); _stencil->release(); } - AX_SAFE_DELETE(_stencilStateManager); + CC_SAFE_DELETE(_stencilStateManager); } ClippingNode* ClippingNode::create() @@ -55,7 +55,7 @@ ClippingNode* ClippingNode::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -70,7 +70,7 @@ ClippingNode* ClippingNode::create(Node* pStencil) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -153,7 +153,7 @@ void ClippingNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32 renderer->pushGroup(_groupCommandStencil.getRenderQueueID()); // _beforeVisitCmd.init(_globalZOrder); - // _beforeVisitCmd.func = AX_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilStateManager); + // _beforeVisitCmd.func = CC_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilStateManager); // renderer->addCommand(&_beforeVisitCmd); _stencilStateManager->onBeforeVisit(_globalZOrder); @@ -166,14 +166,14 @@ void ClippingNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32 programState->setUniform(alphaLocation, &alphaThreshold, sizeof(alphaThreshold)); setProgramStateRecursively(_stencil, programState); - AX_SAFE_RELEASE_NULL(programState); + CC_SAFE_RELEASE_NULL(programState); } _stencil->visit(renderer, _modelViewTransform, flags); auto afterDrawStencilCmd = renderer->nextCallbackCommand(); afterDrawStencilCmd->init(_globalZOrder); - afterDrawStencilCmd->func = AX_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilStateManager); + afterDrawStencilCmd->func = CC_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilStateManager); renderer->addCommand(afterDrawStencilCmd); bool visibleByCamera = isVisitableByVisitingCamera(); @@ -215,7 +215,7 @@ void ClippingNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32 auto _afterVisitCmd = renderer->nextCallbackCommand(); _afterVisitCmd->init(_globalZOrder); - _afterVisitCmd->func = AX_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager); + _afterVisitCmd->func = CC_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager); renderer->addCommand(_afterVisitCmd); renderer->popGroup(); @@ -242,7 +242,7 @@ void ClippingNode::setStencil(Node* stencil) if (_stencil == stencil) return; -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -251,7 +251,7 @@ void ClippingNode::setStencil(Node* stencil) if (stencil) sEngine->retainScriptObject(this, stencil); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS // cleanup current stencil if (_stencil != nullptr && _stencil->isRunning()) @@ -259,11 +259,11 @@ void ClippingNode::setStencil(Node* stencil) _stencil->onExitTransitionDidStart(); _stencil->onExit(); } - AX_SAFE_RELEASE_NULL(_stencil); + CC_SAFE_RELEASE_NULL(_stencil); // initialise new stencil _stencil = stencil; - AX_SAFE_RETAIN(_stencil); + CC_SAFE_RETAIN(_stencil); if (_stencil != nullptr && this->isRunning()) { _stencil->onEnter(); diff --git a/core/2d/CCClippingNode.h b/core/2d/CCClippingNode.h index 806f97d9fb..16901a2ad0 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 AX_DLL ClippingNode : public Node +class CC_DLL ClippingNode : public Node { public: /** Creates and initializes a clipping node without a stencil. @@ -166,7 +166,7 @@ protected: std::unordered_map _originalStencilProgramState; private: - AX_DISALLOW_COPY_AND_ASSIGN(ClippingNode); + CC_DISALLOW_COPY_AND_ASSIGN(ClippingNode); }; /** @} */ NS_AX_END diff --git a/core/2d/CCClippingRectangleNode.cpp b/core/2d/CCClippingRectangleNode.cpp index 862e236866..60f68536f4 100644 --- a/core/2d/CCClippingRectangleNode.cpp +++ b/core/2d/CCClippingRectangleNode.cpp @@ -38,7 +38,7 @@ ClippingRectangleNode* ClippingRectangleNode::create(const Rect& clippingRegion) node->autorelease(); } else - AX_SAFE_DELETE(node); + CC_SAFE_DELETE(node); return node; } @@ -49,7 +49,7 @@ ClippingRectangleNode* ClippingRectangleNode::create() if (node->init()) node->autorelease(); else - AX_SAFE_DELETE(node); + CC_SAFE_DELETE(node); return node; } @@ -94,14 +94,14 @@ void ClippingRectangleNode::visit(Renderer* renderer, const Mat4& parentTransfor { auto beforeVisitCmdScissor = renderer->nextCallbackCommand(); beforeVisitCmdScissor->init(_globalZOrder); - beforeVisitCmdScissor->func = AX_CALLBACK_0(ClippingRectangleNode::onBeforeVisitScissor, this); + beforeVisitCmdScissor->func = CC_CALLBACK_0(ClippingRectangleNode::onBeforeVisitScissor, this); renderer->addCommand(beforeVisitCmdScissor); Node::visit(renderer, parentTransform, parentFlags); auto afterVisitCmdScissor = renderer->nextCallbackCommand(); afterVisitCmdScissor->init(_globalZOrder); - afterVisitCmdScissor->func = AX_CALLBACK_0(ClippingRectangleNode::onAfterVisitScissor, this); + afterVisitCmdScissor->func = CC_CALLBACK_0(ClippingRectangleNode::onAfterVisitScissor, this); renderer->addCommand(afterVisitCmdScissor); } diff --git a/core/2d/CCClippingRectangleNode.h b/core/2d/CCClippingRectangleNode.h index 77e6595168..d4c849f517 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 AX_DLL ClippingRectangleNode : public Node +class CC_DLL ClippingRectangleNode : public Node { public: /** diff --git a/core/2d/CCComponent.cpp b/core/2d/CCComponent.cpp index 4b731562c2..5222172b32 100644 --- a/core/2d/CCComponent.cpp +++ b/core/2d/CCComponent.cpp @@ -61,7 +61,7 @@ Component* Component::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; diff --git a/core/2d/CCComponent.h b/core/2d/CCComponent.h index 375f0b8d62..fc79a90d63 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 __AX_FRAMEWORK_COMPONENT_H__ -#define __AX_FRAMEWORK_COMPONENT_H__ +#ifndef __CC_FRAMEWORK_COMPONENT_H__ +#define __CC_FRAMEWORK_COMPONENT_H__ /// @cond DO_NOT_SHOW #include @@ -44,7 +44,7 @@ enum kComponentOnUpdate }; -class AX_DLL Component : public Ref +class CC_DLL Component : public Ref { public: static Component* create(); @@ -88,4 +88,4 @@ protected: NS_AX_END /// @endcond -#endif // __AX_FRAMEWORK_COMPONENT_H__ +#endif // __CC_FRAMEWORK_COMPONENT_H__ diff --git a/core/2d/CCComponentContainer.cpp b/core/2d/CCComponentContainer.cpp index ebaf27e470..50993f5ffb 100644 --- a/core/2d/CCComponentContainer.cpp +++ b/core/2d/CCComponentContainer.cpp @@ -76,7 +76,7 @@ bool ComponentContainer::remove(std::string_view componentName) do { auto iter = _componentMap.find(componentName); - AX_BREAK_IF(iter == _componentMap.end()); + CC_BREAK_IF(iter == _componentMap.end()); auto component = iter->second; _componentMap.erase(componentName); @@ -116,12 +116,12 @@ void ComponentContainer::visit(float delta) { if (!_componentMap.empty()) { - AX_SAFE_RETAIN(_owner); + CC_SAFE_RETAIN(_owner); for (auto& iter : _componentMap) { iter.second->update(delta); } - AX_SAFE_RELEASE(_owner); + CC_SAFE_RELEASE(_owner); } } diff --git a/core/2d/CCComponentContainer.h b/core/2d/CCComponentContainer.h index d6ff59d268..89f9afa86e 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 __AX_FRAMEWORK_COMCONTAINER_H__ -#define __AX_FRAMEWORK_COMCONTAINER_H__ +#ifndef __CC_FRAMEWORK_COMCONTAINER_H__ +#define __CC_FRAMEWORK_COMCONTAINER_H__ /// @cond DO_NOT_SHOW @@ -36,7 +36,7 @@ NS_AX_BEGIN class Component; class Node; -class AX_DLL ComponentContainer +class CC_DLL ComponentContainer { protected: /** @@ -77,4 +77,4 @@ private: NS_AX_END /// @endcond -#endif // __AX_FRAMEWORK_COMCONTAINER_H__ +#endif // __CC_FRAMEWORK_COMCONTAINER_H__ diff --git a/core/2d/CCDrawNode.cpp b/core/2d/CCDrawNode.cpp index 73f32ac113..1e85611338 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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // TODO new-renderer: interface setupBuffer removal // Need to listen the event only when not use batchnode, because it will use VBO @@ -64,9 +64,9 @@ DrawNode::DrawNode(float lineWidth) : _lineWidth(lineWidth), _defaultLineWidth(l DrawNode::~DrawNode() { - AX_SAFE_FREE(_bufferTriangle); - AX_SAFE_FREE(_bufferPoint); - AX_SAFE_FREE(_bufferLine); + CC_SAFE_FREE(_bufferTriangle); + CC_SAFE_FREE(_bufferPoint); + CC_SAFE_FREE(_bufferLine); freeShaderInternal(_customCommandTriangle); freeShaderInternal(_customCommandPoint); @@ -82,7 +82,7 @@ DrawNode* DrawNode::create(float defaultLineWidth) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -166,7 +166,7 @@ void DrawNode::updateShaderInternal(CustomCommand& cmd, CustomCommand::PrimitiveType primitiveType) { auto& pipelinePS = cmd.getPipelineDescriptor().programState; - AX_SAFE_RELEASE(pipelinePS); + CC_SAFE_RELEASE(pipelinePS); auto program = backend::Program::getBuiltinProgram(programType); pipelinePS = new backend::ProgramState(program); @@ -178,7 +178,7 @@ void DrawNode::updateShaderInternal(CustomCommand& cmd, void DrawNode::freeShaderInternal(CustomCommand& cmd) { auto& pipelinePS = cmd.getPipelineDescriptor().programState; - AX_SAFE_RELEASE_NULL(pipelinePS); + CC_SAFE_RELEASE_NULL(pipelinePS); } void DrawNode::setVertexLayout(CustomCommand& cmd) diff --git a/core/2d/CCDrawNode.h b/core/2d/CCDrawNode.h index ad952fb497..049cd93c0b 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 AX_DLL DrawNode : public Node +class CC_DLL DrawNode : public Node { public: /** creates and initialize a DrawNode node. @@ -412,7 +412,7 @@ protected: axis::any_buffer _abuf; private: - AX_DISALLOW_COPY_AND_ASSIGN(DrawNode); + CC_DISALLOW_COPY_AND_ASSIGN(DrawNode); }; /** @} */ NS_AX_END diff --git a/core/2d/CCFastTMXLayer.cpp b/core/2d/CCFastTMXLayer.cpp index af2c574468..22265096a6 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; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -88,7 +88,7 @@ bool FastTMXLayer::initWithTilesetInfo(TMXTilesetInfo* tilesetInfo, TMXLayerInfo // tilesetInfo _tileSet = tilesetInfo; - AX_SAFE_RETAIN(_tileSet); + CC_SAFE_RETAIN(_tileSet); // mapInfo _mapTileSize = mapInfo->getTileSize(); @@ -98,10 +98,10 @@ bool FastTMXLayer::initWithTilesetInfo(TMXTilesetInfo* tilesetInfo, TMXLayerInfo // offset (after layer orientation is set); Vec2 offset = this->calculateLayerOffset(layerInfo->_offset); - this->setPosition(AX_POINT_PIXELS_TO_POINTS(offset)); + this->setPosition(CC_POINT_PIXELS_TO_POINTS(offset)); this->setContentSize( - AX_SIZE_PIXELS_TO_POINTS(Vec2(_layerSize.width * _mapTileSize.width, _layerSize.height * _mapTileSize.height))); + CC_SIZE_PIXELS_TO_POINTS(Vec2(_layerSize.width * _mapTileSize.width, _layerSize.height * _mapTileSize.height))); this->tileToNodeTransform(); @@ -115,15 +115,15 @@ FastTMXLayer::FastTMXLayer() {} FastTMXLayer::~FastTMXLayer() { - AX_SAFE_RELEASE(_tileSet); - AX_SAFE_RELEASE(_texture); - AX_SAFE_FREE(_tiles); - AX_SAFE_RELEASE(_vertexBuffer); - AX_SAFE_RELEASE(_indexBuffer); + CC_SAFE_RELEASE(_tileSet); + CC_SAFE_RELEASE(_texture); + CC_SAFE_FREE(_tiles); + CC_SAFE_RELEASE(_vertexBuffer); + CC_SAFE_RELEASE(_indexBuffer); for (auto& e : _customCommands) { - AX_SAFE_RELEASE(e.second->getPipelineDescriptor().programState); + CC_SAFE_RELEASE(e.second->getPipelineDescriptor().programState); delete e.second; } } @@ -167,8 +167,8 @@ void FastTMXLayer::draw(Renderer* renderer, const Mat4& transform, uint32_t flag void FastTMXLayer::updateTiles(const Rect& culledRect) { Rect visibleTiles = Rect(culledRect.origin, culledRect.size * _director->getContentScaleFactor()); - Vec2 mapTileSize = AX_SIZE_PIXELS_TO_POINTS(_mapTileSize); - Vec2 tileSize = AX_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize); + Vec2 mapTileSize = CC_SIZE_PIXELS_TO_POINTS(_mapTileSize); + Vec2 tileSize = CC_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize); Mat4 nodeToTileTransform = _tileToNodeTransform.getInversed(); // transform to tile visibleTiles = RectApplyTransform(visibleTiles, nodeToTileTransform); @@ -275,7 +275,7 @@ void FastTMXLayer::updateVertexBuffer() void FastTMXLayer::updateIndexBuffer() { -#ifdef AX_FAST_TILEMAP_32_BIT_INDICES +#ifdef CC_FAST_TILEMAP_32_BIT_INDICES unsigned int indexBufferSize = (unsigned int)(sizeof(unsigned int) * _indices.size()); #else unsigned int indexBufferSize = (unsigned int)(sizeof(unsigned short) * _indices.size()); @@ -384,8 +384,8 @@ void FastTMXLayer::setupTiles() Mat4 FastTMXLayer::tileToNodeTransform() { - float w = _mapTileSize.width / AX_CONTENT_SCALE_FACTOR(); - float h = _mapTileSize.height / AX_CONTENT_SCALE_FACTOR(); + float w = _mapTileSize.width / CC_CONTENT_SCALE_FACTOR(); + float h = _mapTileSize.height / CC_CONTENT_SCALE_FACTOR(); float offY = (_layerSize.height - 1) * h; switch (_layerOrientation) @@ -432,7 +432,7 @@ void FastTMXLayer::updatePrimitives() command->setVertexBuffer(_vertexBuffer); CustomCommand::IndexFormat indexFormat = CustomCommand::IndexFormat::U_SHORT; -#if AX_FAST_TILEMAP_32_BIT_INDICES +#if CC_FAST_TILEMAP_32_BIT_INDICES indexFormat = CustomCommand::IndexFormat::U_INT; #endif command->setIndexBuffer(_indexBuffer, indexFormat); @@ -443,7 +443,7 @@ void FastTMXLayer::updatePrimitives() if (_useAutomaticVertexZ) { - AX_SAFE_RELEASE(pipelineDescriptor.programState); + CC_SAFE_RELEASE(pipelineDescriptor.programState); auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE_COLOR_ALPHA_TEST); auto programState = new backend::ProgramState(program); @@ -454,7 +454,7 @@ void FastTMXLayer::updatePrimitives() } else { - AX_SAFE_RELEASE(pipelineDescriptor.programState); + CC_SAFE_RELEASE(pipelineDescriptor.programState); auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE_COLOR); auto programState = new backend::ProgramState(program); pipelineDescriptor.programState = programState; @@ -504,7 +504,7 @@ void FastTMXLayer::updateTotalQuads() { if (_quadsDirty) { - Vec2 tileSize = AX_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize); + Vec2 tileSize = CC_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize); Vec2 texSize = _tileSet->_imageSize; _tileToQuadIndex.clear(); _totalQuads.resize(int(_layerSize.width * _layerSize.height)); @@ -669,7 +669,7 @@ Sprite* FastTMXLayer::getTileAt(const Vec2& tileCoordinate) { // tile not created yet. create it Rect rect = _tileSet->getRectForGID(gid); - rect = AX_RECT_PIXELS_TO_POINTS(rect); + rect = CC_RECT_PIXELS_TO_POINTS(rect); tile = Sprite::createWithTexture(_texture, rect); Vec2 p = this->getPositionAt(tileCoordinate); @@ -890,7 +890,7 @@ void FastTMXLayer::setTileGID(int gid, const Vec2& tileCoordinate, TMXTileFlags { Sprite* sprite = it->second.first; Rect rect = _tileSet->getRectForGID(gid); - rect = AX_RECT_PIXELS_TO_POINTS(rect); + rect = CC_RECT_PIXELS_TO_POINTS(rect); sprite->setTextureRect(rect, false, rect.size); this->reorderChild(sprite, z); @@ -1026,7 +1026,7 @@ TMXTileAnimTask::TMXTileAnimTask(FastTMXLayer* layer, TMXTileAnimInfo* animation void TMXTileAnimTask::tickAndScheduleNext(float dt) { setCurrFrame(); - _layer->getParent()->scheduleOnce(AX_CALLBACK_1(TMXTileAnimTask::tickAndScheduleNext, this), + _layer->getParent()->scheduleOnce(CC_CALLBACK_1(TMXTileAnimTask::tickAndScheduleNext, this), _animation->_frames[_currentFrame]._duration / 1000.0f, _key); } diff --git a/core/2d/CCFastTMXLayer.h b/core/2d/CCFastTMXLayer.h index e07cadc53b..8c0adb5439 100644 --- a/core/2d/CCFastTMXLayer.h +++ b/core/2d/CCFastTMXLayer.h @@ -81,7 +81,7 @@ class Buffer; * @js NA */ -class AX_DLL FastTMXLayer : public Node +class CC_DLL FastTMXLayer : public Node { public: /** Possible orientations of the TMX map */ @@ -222,8 +222,8 @@ public: */ void setTileSet(TMXTilesetInfo* info) { - AX_SAFE_RETAIN(info); - AX_SAFE_RELEASE(_tileSet); + CC_SAFE_RETAIN(info); + CC_SAFE_RELEASE(_tileSet); _tileSet = info; } @@ -363,7 +363,7 @@ protected: bool _quadsDirty = true; std::vector _tileToQuadIndex; std::vector _totalQuads; -#ifdef AX_FAST_TILEMAP_32_BIT_INDICES +#ifdef CC_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 AX_DLL TMXTileAnimTask : public Ref +class CC_DLL TMXTileAnimTask : public Ref { public: TMXTileAnimTask(FastTMXLayer* layer, TMXTileAnimInfo* animation, const Vec2& tilePos); @@ -418,7 +418,7 @@ protected: /** @brief TMXTileAnimManager controls all tile animation of a layer. */ -class AX_DLL TMXTileAnimManager : public Ref +class CC_DLL TMXTileAnimManager : public Ref { public: static TMXTileAnimManager* create(FastTMXLayer* layer); diff --git a/core/2d/CCFastTMXTiledMap.cpp b/core/2d/CCFastTMXTiledMap.cpp index fadf34e839..ba63586670 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; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -53,7 +53,7 @@ FastTMXTiledMap* FastTMXTiledMap::createWithXML(std::string_view tmxString, std: ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } diff --git a/core/2d/CCFastTMXTiledMap.h b/core/2d/CCFastTMXTiledMap.h index 497776d54f..d4aeb26de2 100644 --- a/core/2d/CCFastTMXTiledMap.h +++ b/core/2d/CCFastTMXTiledMap.h @@ -94,7 +94,7 @@ class FastTMXLayer; * @since v3.2 * @js NA */ -class AX_DLL FastTMXTiledMap : public Node +class CC_DLL FastTMXTiledMap : public Node { public: /** Creates a TMX Tiled Map with a TMX file. @@ -203,7 +203,7 @@ public: */ void setTileAnimEnabled(bool enabled); - AX_DEPRECATED_ATTRIBUTE int getLayerNum() const { return getLayerCount(); } + CC_DEPRECATED_ATTRIBUTE int getLayerNum() const { return getLayerCount(); } int getLayerCount() const { return _layerCount; } @@ -249,7 +249,7 @@ protected: std::string _tmxFile; private: - AX_DISALLOW_COPY_AND_ASSIGN(FastTMXTiledMap); + CC_DISALLOW_COPY_AND_ASSIGN(FastTMXTiledMap); }; // end of tilemap_parallax_nodes group diff --git a/core/2d/CCFont.h b/core/2d/CCFont.h index 6fdff63689..e699b03dbd 100644 --- a/core/2d/CCFont.h +++ b/core/2d/CCFont.h @@ -38,7 +38,7 @@ NS_AX_BEGIN class FontAtlas; -class AX_DLL Font : public Ref +class CC_DLL Font : public Ref { public: virtual FontAtlas* newFontAtlas() = 0; diff --git a/core/2d/CCFontAtlas.cpp b/core/2d/CCFontAtlas.cpp index 753f8ad131..850e1f3360 100644 --- a/core/2d/CCFontAtlas.cpp +++ b/core/2d/CCFontAtlas.cpp @@ -26,8 +26,8 @@ ****************************************************************************/ #include "2d/CCFontAtlas.h" -#if AX_TARGET_PLATFORM != AX_PLATFORM_WIN32 && AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID -#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID +#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID # include "platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" #endif #include @@ -63,7 +63,7 @@ FontAtlas::FontAtlas(Font* theFont) : _font(theFont) _pixelFormat = backend::PixelFormat::LA8; _currentPageDataSize = CacheTextureWidth * CacheTextureHeight << _strideShift; -#if defined(AX_USE_METAL) +#if defined(CC_USE_METAL) _currentPageDataSizeRGBA = CacheTextureWidth * CacheTextureHeight * 4; #endif @@ -81,11 +81,11 @@ FontAtlas::FontAtlas(Font* theFont) : _font(theFont) _letterPadding += 2 * FontFreeType::DistanceMapSpread; } -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA auto eventDispatcher = Director::getInstance()->getEventDispatcher(); _rendererRecreatedListener = EventListenerCustom::create( - EVENT_RENDERER_RECREATED, AX_CALLBACK_1(FontAtlas::listenRendererRecreated, this)); + EVENT_RENDERER_RECREATED, CC_CALLBACK_1(FontAtlas::listenRendererRecreated, this)); eventDispatcher->addEventListenerWithFixedPriority(_rendererRecreatedListener, 1); #endif } @@ -97,7 +97,7 @@ void FontAtlas::reinit() _currentPageData = new uint8_t[_currentPageDataSize]; _currentPage = -1; -#if defined(AX_USE_METAL) +#if defined(CC_USE_METAL) if (_strideShift && !_currentPageDataRGBA) _currentPageDataRGBA = new uint8_t[_currentPageDataSizeRGBA]; #endif @@ -107,7 +107,7 @@ void FontAtlas::reinit() FontAtlas::~FontAtlas() { -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA if (_fontFreeType && _rendererRecreatedListener) { auto eventDispatcher = Director::getInstance()->getEventDispatcher(); @@ -119,9 +119,9 @@ FontAtlas::~FontAtlas() _font->release(); releaseTextures(); - AX_SAFE_DELETE_ARRAY(_currentPageData); -#if defined(AX_USE_METAL) - AX_SAFE_DELETE_ARRAY(_currentPageDataRGBA); + CC_SAFE_DELETE_ARRAY(_currentPageData); +#if defined(CC_USE_METAL) + CC_SAFE_DELETE_ARRAY(_currentPageDataRGBA); #endif } @@ -234,7 +234,7 @@ bool FontAtlas::prepareLetterDefinitions(const std::u32string& utf32Text) Rect tempRect; FontLetterDefinition tempDef; - auto scaleFactor = AX_CONTENT_SCALE_FACTOR(); + auto scaleFactor = CC_CONTENT_SCALE_FACTOR(); auto pixelFormat = _pixelFormat; int startY = (int)_currentPageOrigY; @@ -309,7 +309,7 @@ bool FontAtlas::prepareLetterDefinitions(const std::u32string& utf32Text) void FontAtlas::updateTextureContent(backend::PixelFormat format, int startY) { -#if !defined(AX_USE_METAL) +#if !defined(CC_USE_METAL) auto data = _currentPageData + (CacheTextureWidth * (int)startY << _strideShift); _atlasTextures[_currentPage]->updateWithSubData(data, 0, startY, CacheTextureWidth, (int)_currentPageOrigY - startY + _currLineHeight); @@ -343,7 +343,7 @@ void FontAtlas::addNewPage() memset(_currentPageData, 0, _currentPageDataSize); -#if !defined(AX_USE_METAL) +#if !defined(CC_USE_METAL) texture->initWithData(_currentPageData, _currentPageDataSize, _pixelFormat, CacheTextureWidth, CacheTextureHeight); #else if (_strideShift) diff --git a/core/2d/CCFontAtlas.h b/core/2d/CCFontAtlas.h index 65afc0122f..eb2b6bb96e 100644 --- a/core/2d/CCFontAtlas.h +++ b/core/2d/CCFontAtlas.h @@ -59,7 +59,7 @@ struct FontLetterDefinition bool rotated; }; -class AX_DLL FontAtlas : public Ref +class CC_DLL FontAtlas : public Ref { public: static const int CacheTextureWidth; @@ -147,7 +147,7 @@ protected: int _strideShift = 0; uint8_t* _currentPageData = nullptr; int _currentPageDataSize = 0; -#if defined(AX_USE_METAL) +#if defined(CC_USE_METAL) // Notes: // Metal backend doesn't support PixelFormat::LA8 // Currently we use RGBA for texture data upload diff --git a/core/2d/CCFontAtlasCache.cpp b/core/2d/CCFontAtlasCache.cpp index bdbf72639d..752c7b133b 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()) { - AX_SAFE_RELEASE_NULL(it->second); + CC_SAFE_RELEASE_NULL(it->second); _atlasMap.erase(it); } FontFNT::reloadBMFontResource(fontFileName); @@ -297,7 +297,7 @@ void FontAtlasCache::unloadFontAtlasTTF(std::string_view fontFileName) { if (item->first.find(fontFileName) != std::string::npos) { - AX_SAFE_RELEASE_NULL(item->second); + CC_SAFE_RELEASE_NULL(item->second); item = _atlasMap.erase(item); } else diff --git a/core/2d/CCFontAtlasCache.h b/core/2d/CCFontAtlasCache.h index ac75932201..3a93dbd114 100644 --- a/core/2d/CCFontAtlasCache.h +++ b/core/2d/CCFontAtlasCache.h @@ -38,7 +38,7 @@ class FontAtlas; class Texture2D; struct _ttfConfig; -class AX_DLL FontAtlasCache +class CC_DLL FontAtlasCache { public: static FontAtlas* getFontAtlasTTF(const _ttfConfig* config); @@ -46,7 +46,7 @@ public: static FontAtlas* getFontAtlasFNT(std::string_view fontFileName); static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, std::string_view subTextureKey); static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Rect& imageRect, bool imageRotated); - AX_DEPRECATED_ATTRIBUTE static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset); + CC_DEPRECATED_ATTRIBUTE static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset); static FontAtlas* getFontAtlasCharMap(std::string_view charMapFile, int itemWidth, @@ -68,7 +68,7 @@ public: */ static void reloadFontAtlasFNT(std::string_view fontFileName, const Rect& imageRect, bool imageRotated); - AX_DEPRECATED_ATTRIBUTE static void reloadFontAtlasFNT(std::string_view fontFileName, + CC_DEPRECATED_ATTRIBUTE static void reloadFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset = Vec2::ZERO); /** Unload all texture atlas texture create by special file name. diff --git a/core/2d/CCFontCharMap.cpp b/core/2d/CCFontCharMap.cpp index aba79dbd22..2f56e84683 100644 --- a/core/2d/CCFontCharMap.cpp +++ b/core/2d/CCFontCharMap.cpp @@ -112,7 +112,7 @@ FontAtlas* FontCharMap::newFontAtlas() tempAtlas->setLineHeight((float)_itemHeight); - auto contentScaleFactor = AX_CONTENT_SCALE_FACTOR(); + auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR(); FontLetterDefinition tempDefinition; tempDefinition.textureID = 0; diff --git a/core/2d/CCFontFNT.cpp b/core/2d/CCFontFNT.cpp index 1555dabc2d..4d77b9b4c7 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; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -121,13 +121,13 @@ BMFontConfiguration::~BMFontConfiguration() this->purgeFontDefDictionary(); this->purgeKerningDictionary(); _atlasName.clear(); - AX_SAFE_DELETE(_characterSet); + CC_SAFE_DELETE(_characterSet); } std::string BMFontConfiguration::description() const { return StringUtils::format( - "", (size_t)this, + "", (size_t)this, static_cast(_fontDefDictionary.size()), static_cast(_kerningDictionary.size()), _atlasName.c_str()); } @@ -596,7 +596,7 @@ FontFNT* FontFNT::create(std::string_view fntFilePath, const Vec2& imageOffset) } FontFNT::FontFNT(BMFontConfiguration* theContfig, const Rect& imageRect, bool imageRotated) - : _configuration(theContfig), _imageRectInPoints(AX_RECT_PIXELS_TO_POINTS(imageRect)), _imageRotated(imageRotated) + : _configuration(theContfig), _imageRectInPoints(CC_RECT_PIXELS_TO_POINTS(imageRect)), _imageRotated(imageRotated) { _configuration->retain(); } @@ -615,7 +615,7 @@ void FontFNT::purgeCachedData() if (s_configurations) { s_configurations->clear(); - AX_SAFE_DELETE(s_configurations); + CC_SAFE_DELETE(s_configurations); } } @@ -709,7 +709,7 @@ FontAtlas* FontFNT::newFontAtlas() FontLetterDefinition tempDefinition; - const auto tempRect = AX_RECT_PIXELS_TO_POINTS(fontDef.rect); + const auto tempRect = CC_RECT_PIXELS_TO_POINTS(fontDef.rect); tempDefinition.offsetX = fontDef.xOffset; tempDefinition.offsetY = fontDef.yOffset; @@ -751,7 +751,7 @@ FontAtlas* FontFNT::newFontAtlas() Texture2D* tempTexture = Director::getInstance()->getTextureCache()->addImage(_configuration->getAtlasName()); if (!tempTexture) { - AX_SAFE_RELEASE(tempAtlas); + CC_SAFE_RELEASE(tempAtlas); return nullptr; } diff --git a/core/2d/CCFontFNT.h b/core/2d/CCFontFNT.h index 46bb5bd654..0c5e854780 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 AX_DLL BMFontConfiguration : public Ref +class CC_DLL BMFontConfiguration : public Ref { // FIXME: Creating a public interface so that the bitmapFontArray[] is accessible public: //@public @@ -141,7 +141,7 @@ private: void purgeFontDefDictionary(); }; -class AX_DLL FontFNT : public Font +class CC_DLL FontFNT : public Font { public: @@ -149,7 +149,7 @@ public: static FontFNT* create(std::string_view fntFilePath, std::string_view subTextureKey); static FontFNT* create(std::string_view fntFilePath); - AX_DEPRECATED_ATTRIBUTE static FontFNT* create(std::string_view fntFilePath, const Vec2& imageOffset = Vec2::ZERO); + CC_DEPRECATED_ATTRIBUTE static FontFNT* create(std::string_view fntFilePath, const Vec2& imageOffset = Vec2::ZERO); /** Purges the cached data. Removes from memory the cached configurations and the atlas name dictionary. diff --git a/core/2d/CCFontFreeType.cpp b/core/2d/CCFontFreeType.cpp index 4645aae952..d6328b08a6 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 * AX_CONTENT_SCALE_FACTOR(); + _outlineSize = outline * CC_CONTENT_SCALE_FACTOR(); FT_Stroker_New(FontFreeType::getFTLibrary(), &_stroker); FT_Stroker_Set(_stroker, (int)(_outlineSize * 64), @@ -255,7 +255,7 @@ bool FontFreeType::loadFontFace(std::string_view fontPath, float fontSize) // set the requested font size int dpi = 72; - int fontSizePoints = (int)(64.f * fontSize * AX_CONTENT_SCALE_FACTOR()); + int fontSizePoints = (int)(64.f * fontSize * CC_CONTENT_SCALE_FACTOR()); if (FT_Set_Char_Size(face, fontSizePoints, fontSizePoints, dpi, dpi)) break; diff --git a/core/2d/CCFontFreeType.h b/core/2d/CCFontFreeType.h index 697a19086d..b7fc133856 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 AX_DLL FontFreeType : public Font +class CC_DLL FontFreeType : public Font { public: static const int DistanceMapSpread; diff --git a/core/2d/CCGrid.cpp b/core/2d/CCGrid.cpp index bd8d7cd270..0818c70f53 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; - AX_SAFE_RETAIN(_texture); + CC_SAFE_RETAIN(_texture); _isTextureFlipped = flipped; -#ifdef AX_USE_METAL +#ifdef CC_USE_METAL _isTextureFlipped = !flipped; #endif @@ -104,7 +104,7 @@ bool GridBase::initWithSize(const Vec2& gridSize, Texture2D* texture, bool flipp _step.y = _gridRect.size.height / _gridSize.height; auto& pipelineDescriptor = _drawCommand.getPipelineDescriptor(); - AX_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_programState); auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE); _programState = new backend::ProgramState(program); pipelineDescriptor.programState = _programState; @@ -151,12 +151,12 @@ GridBase::~GridBase() { CCLOGINFO("deallocing GridBase: %p", this); - AX_SAFE_RELEASE(_renderTarget); + CC_SAFE_RELEASE(_renderTarget); // TODO: ? why 2.0 comments this line: setActive(false); - AX_SAFE_RELEASE(_texture); + CC_SAFE_RELEASE(_texture); - AX_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_programState); } // properties @@ -216,7 +216,7 @@ void GridBase::beforeDraw() renderer->setViewPort(0, 0, (unsigned int)size.width, (unsigned int)size.height); _oldRenderTarget = renderer->getRenderTarget(); - AX_SAFE_RELEASE(_renderTarget); + CC_SAFE_RELEASE(_renderTarget); _renderTarget = backend::Device::getInstance()->newRenderTarget(TargetBufferFlags::COLOR, _texture->getBackendTexture()); renderer->setRenderTarget(_renderTarget); @@ -344,11 +344,11 @@ Grid3D::Grid3D() {} Grid3D::~Grid3D() { - AX_SAFE_FREE(_texCoordinates); - AX_SAFE_FREE(_vertices); - AX_SAFE_FREE(_indices); - AX_SAFE_FREE(_originalVertices); - AX_SAFE_FREE(_vertexBuffer); + CC_SAFE_FREE(_texCoordinates); + CC_SAFE_FREE(_vertices); + CC_SAFE_FREE(_indices); + CC_SAFE_FREE(_originalVertices); + CC_SAFE_FREE(_vertexBuffer); } void Grid3D::beforeBlit() @@ -392,11 +392,11 @@ void Grid3D::calculateVertexPoints() float height = (float)_texture->getPixelsHigh(); float imageH = _texture->getContentSizeInPixels().height; - AX_SAFE_FREE(_vertices); - AX_SAFE_FREE(_originalVertices); - AX_SAFE_FREE(_texCoordinates); - AX_SAFE_FREE(_vertexBuffer); - AX_SAFE_FREE(_indices); + CC_SAFE_FREE(_vertices); + CC_SAFE_FREE(_originalVertices); + CC_SAFE_FREE(_texCoordinates); + CC_SAFE_FREE(_vertexBuffer); + CC_SAFE_FREE(_indices); size_t numOfPoints = static_cast((_gridSize.width + 1) * (_gridSize.height + 1)); @@ -552,10 +552,10 @@ void Grid3D::updateVertexAndTexCoordinate() TiledGrid3D::~TiledGrid3D() { - AX_SAFE_FREE(_texCoordinates); - AX_SAFE_FREE(_vertices); - AX_SAFE_FREE(_originalVertices); - AX_SAFE_FREE(_indices); + CC_SAFE_FREE(_texCoordinates); + CC_SAFE_FREE(_vertices); + CC_SAFE_FREE(_originalVertices); + CC_SAFE_FREE(_indices); } TiledGrid3D* TiledGrid3D::create(const Vec2& gridSize) @@ -643,11 +643,11 @@ void TiledGrid3D::calculateVertexPoints() float imageH = _texture->getContentSizeInPixels().height; int numQuads = (int)(_gridSize.width * _gridSize.height); - AX_SAFE_FREE(_vertices); - AX_SAFE_FREE(_originalVertices); - AX_SAFE_FREE(_texCoordinates); - AX_SAFE_FREE(_indices); - AX_SAFE_FREE(_vertexBuffer); + CC_SAFE_FREE(_vertices); + CC_SAFE_FREE(_originalVertices); + CC_SAFE_FREE(_texCoordinates); + CC_SAFE_FREE(_indices); + CC_SAFE_FREE(_vertexBuffer); _vertices = malloc(numQuads * 4 * sizeof(Vec3)); _originalVertices = malloc(numQuads * 4 * sizeof(Vec3)); diff --git a/core/2d/CCGrid.h b/core/2d/CCGrid.h index efc2fc5914..07aaa769cc 100644 --- a/core/2d/CCGrid.h +++ b/core/2d/CCGrid.h @@ -53,7 +53,7 @@ class RenderTarget; /** Base class for Other grid. */ -class AX_DLL GridBase : public Ref +class CC_DLL GridBase : public Ref { public: /** @@ -174,7 +174,7 @@ protected: /** Grid3D is a 3D grid implementation. Each vertex has 3 dimensions: x,y,z */ -class AX_DLL Grid3D : public GridBase +class CC_DLL Grid3D : public GridBase { public: /** create one Grid. */ @@ -248,7 +248,7 @@ protected: TiledGrid3D is a 3D grid implementation. It differs from Grid3D in that the tiles can be separated from the grid. */ -class AX_DLL TiledGrid3D : public GridBase +class CC_DLL TiledGrid3D : public GridBase { public: /** Create one Grid. */ diff --git a/core/2d/CCLabel.cpp b/core/2d/CCLabel.cpp index f7d36f2387..07417f0b09 100644 --- a/core/2d/CCLabel.cpp +++ b/core/2d/CCLabel.cpp @@ -95,7 +95,7 @@ public: letter->autorelease(); return letter; } - AX_SAFE_DELETE(letter); + CC_SAFE_DELETE(letter); return nullptr; } @@ -206,9 +206,9 @@ Label::BatchCommand::BatchCommand() Label::BatchCommand::~BatchCommand() { - AX_SAFE_RELEASE(textCommand.getPipelineDescriptor().programState); - AX_SAFE_RELEASE(shadowCommand.getPipelineDescriptor().programState); - AX_SAFE_RELEASE(outLineCommand.getPipelineDescriptor().programState); + CC_SAFE_RELEASE(textCommand.getPipelineDescriptor().programState); + CC_SAFE_RELEASE(shadowCommand.getPipelineDescriptor().programState); + CC_SAFE_RELEASE(outLineCommand.getPipelineDescriptor().programState); } void Label::BatchCommand::setProgramState(backend::ProgramState* programState) @@ -216,15 +216,15 @@ void Label::BatchCommand::setProgramState(backend::ProgramState* programState) assert(programState); auto& programStateText = textCommand.getPipelineDescriptor().programState; - AX_SAFE_RELEASE(programStateText); + CC_SAFE_RELEASE(programStateText); programStateText = programState->clone(); auto& programStateShadow = shadowCommand.getPipelineDescriptor().programState; - AX_SAFE_RELEASE(programStateShadow); + CC_SAFE_RELEASE(programStateShadow); programStateShadow = programState->clone(); auto& programStateOutline = outLineCommand.getPipelineDescriptor().programState; - AX_SAFE_RELEASE(programStateOutline); + CC_SAFE_RELEASE(programStateOutline); programStateOutline = programState->clone(); } @@ -274,7 +274,7 @@ Label* Label::createWithTTF(std::string_view text, return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -291,7 +291,7 @@ Label* Label::createWithTTF(const TTFConfig& ttfConfig, return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -508,7 +508,7 @@ Label::Label(TextHAlignment hAlignment /* = TextHAlignment::LEFT */, _hAlignment = hAlignment; _vAlignment = vAlignment; -#if AX_LABEL_DEBUG_DRAW +#if CC_LABEL_DEBUG_DRAW _debugDrawNode = DrawNode::create(); addChild(_debugDrawNode); #endif @@ -557,7 +557,7 @@ Label::~Label() if (_fontAtlas) { Node::removeAllChildrenWithCleanup(true); - AX_SAFE_RELEASE_NULL(_reusedLetter); + CC_SAFE_RELEASE_NULL(_reusedLetter); _batchNodes.clear(); FontAtlasCache::releaseFontAtlas(_fontAtlas); } @@ -565,16 +565,16 @@ Label::~Label() _eventDispatcher->removeEventListener(_purgeTextureListener); _eventDispatcher->removeEventListener(_resetTextureListener); - AX_SAFE_RELEASE_NULL(_textSprite); - AX_SAFE_RELEASE_NULL(_shadowNode); + CC_SAFE_RELEASE_NULL(_textSprite); + CC_SAFE_RELEASE_NULL(_shadowNode); } void Label::reset() { - AX_SAFE_RELEASE_NULL(_textSprite); - AX_SAFE_RELEASE_NULL(_shadowNode); + CC_SAFE_RELEASE_NULL(_textSprite); + CC_SAFE_RELEASE_NULL(_shadowNode); Node::removeAllChildrenWithCleanup(true); - AX_SAFE_RELEASE_NULL(_reusedLetter); + CC_SAFE_RELEASE_NULL(_reusedLetter); _letters.clear(); _batchNodes.clear(); _batchCommands.clear(); @@ -604,7 +604,7 @@ void Label::reset() _systemFontDirty = false; _systemFont = "Helvetica"; - _systemFontSize = AX_DEFAULT_FONT_LABEL_SIZE; + _systemFontSize = CC_DEFAULT_FONT_LABEL_SIZE; if (_horizontalKernings) { @@ -803,7 +803,7 @@ void Label::setFontAtlas(FontAtlas* atlas, bool distanceFieldEnabled /* = false if (atlas == _fontAtlas) return; - AX_SAFE_RETAIN(atlas); + CC_SAFE_RETAIN(atlas); if (_fontAtlas) { _batchNodes.clear(); @@ -858,7 +858,7 @@ bool Label::setBMFontFilePath(std::string_view bmfontFilePath, float fontSize) if (bmFont) { float originalFontSize = bmFont->getOriginalFontSize(); - _bmFontSize = originalFontSize / AX_CONTENT_SCALE_FACTOR(); + _bmFontSize = originalFontSize / CC_CONTENT_SCALE_FACTOR(); } } @@ -892,7 +892,7 @@ bool Label::setBMFontFilePath(std::string_view bmfontFilePath, const Rect& image if (bmFont) { float originalFontSize = bmFont->getOriginalFontSize(); - _bmFontSize = originalFontSize / AX_CONTENT_SCALE_FACTOR(); + _bmFontSize = originalFontSize / CC_CONTENT_SCALE_FACTOR(); } } @@ -928,7 +928,7 @@ bool Label::setBMFontFilePath(std::string_view bmfontFilePath, std::string_view if (bmFont) { float originalFontSize = bmFont->getOriginalFontSize(); - _bmFontSize = originalFontSize / AX_CONTENT_SCALE_FACTOR(); + _bmFontSize = originalFontSize / CC_CONTENT_SCALE_FACTOR(); } } @@ -1157,7 +1157,7 @@ bool Label::alignText() if (fontSize > 0 && isVerticalClamp()) { - this->shrinkLabelToContentSize(AX_CALLBACK_0(Label::isVerticalClamp, this)); + this->shrinkLabelToContentSize(CC_CALLBACK_0(Label::isVerticalClamp, this)); } } @@ -1166,7 +1166,7 @@ bool Label::alignText() ret = false; if (_overflow == Overflow::SHRINK) { - this->shrinkLabelToContentSize(AX_CALLBACK_0(Label::isHorizontalClamp, this)); + this->shrinkLabelToContentSize(CC_CALLBACK_0(Label::isHorizontalClamp, this)); } break; } @@ -1543,7 +1543,7 @@ void Label::disableEffect(LabelEffect effect) if (_shadowEnabled) { _shadowEnabled = false; - AX_SAFE_RELEASE_NULL(_shadowNode); + CC_SAFE_RELEASE_NULL(_shadowNode); updateShaderProgram(); } break; @@ -1680,7 +1680,7 @@ void Label::updateContent() { _batchNodes.clear(); _batchCommands.clear(); - AX_SAFE_RELEASE_NULL(_reusedLetter); + CC_SAFE_RELEASE_NULL(_reusedLetter); FontAtlasCache::releaseFontAtlas(_fontAtlas); _fontAtlas = nullptr; } @@ -1688,8 +1688,8 @@ void Label::updateContent() _systemFontDirty = false; } - AX_SAFE_RELEASE_NULL(_textSprite); - AX_SAFE_RELEASE_NULL(_shadowNode); + CC_SAFE_RELEASE_NULL(_textSprite); + CC_SAFE_RELEASE_NULL(_shadowNode); bool updateFinished = true; if (_fontAtlas) @@ -1760,7 +1760,7 @@ void Label::updateContent() _contentDirty = false; } -#if AX_LABEL_DEBUG_DRAW +#if CC_LABEL_DEBUG_DRAW _debugDrawNode->clear(); Vec2 vertices[4] = {Vec2::ZERO, Vec2(_contentSize.width, 0.0f), Vec2(_contentSize.width, _contentSize.height), Vec2(0.0f, _contentSize.height)}; @@ -1920,7 +1920,7 @@ void Label::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) } // Don't do calculate the culling if the transform was not updated bool transformUpdated = flags & FLAGS_TRANSFORM_DIRTY; -#if AX_USE_CULLING +#if CC_USE_CULLING auto visitingCamera = Camera::getVisitingCamera(); auto defaultCamera = Camera::getDefaultCamera(); if (visitingCamera == defaultCamera) @@ -2502,7 +2502,7 @@ FontDefinition Label::_getFontDefinition() const systemFontDef._stroke._strokeEnabled = false; } -#if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) && (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) if (systemFontDef._stroke._strokeEnabled) { CCLOGERROR("Stroke Currently only supported on iOS and Android!"); @@ -2530,7 +2530,7 @@ void Label::setGlobalZOrder(float globalZOrder) _underlineNode->setGlobalZOrder(globalZOrder); } -#if AX_LABEL_DEBUG_DRAW +#if CC_LABEL_DEBUG_DRAW _debugDrawNode->setGlobalZOrder(globalZOrder); #endif } diff --git a/core/2d/CCLabel.h b/core/2d/CCLabel.h index 48d08e0673..26ff70520c 100644 --- a/core/2d/CCLabel.h +++ b/core/2d/CCLabel.h @@ -41,7 +41,7 @@ NS_AX_BEGIN * @{ */ -#define AX_DEFAULT_FONT_LABEL_SIZE 12 +#define CC_DEFAULT_FONT_LABEL_SIZE 12 /** * @struct TTFConfig @@ -64,7 +64,7 @@ typedef struct _ttfConfig bool strikethrough; _ttfConfig(std::string_view filePath = {}, - float size = AX_DEFAULT_FONT_LABEL_SIZE, + float size = CC_DEFAULT_FONT_LABEL_SIZE, const GlyphCollection& glyphCollection = GlyphCollection::DYNAMIC, const char* customGlyphCollection = nullptr, /* nullable */ bool useDistanceField = false, @@ -113,7 +113,7 @@ class TextureAtlas; * - http://www.angelcode.com/products/bmfont/ (Free, Windows only) * @js NA */ -class AX_DLL Label : public Node, public LabelProtocol, public BlendProtocol +class CC_DLL Label : public Node, public LabelProtocol, public BlendProtocol { public: enum class Overflow @@ -274,7 +274,7 @@ public: * @return An automatically released Label object. * @see setBMFontFilePath setMaxLineWidth */ - AX_DEPRECATED_ATTRIBUTE static Label* createWithBMFont(std::string_view bmfontPath, + CC_DEPRECATED_ATTRIBUTE static Label* createWithBMFont(std::string_view bmfontPath, std::string_view text, const TextHAlignment& hAlignment, int maxLineWidth, @@ -344,7 +344,7 @@ public: virtual bool setBMFontFilePath(std::string_view bmfontFilePath, std::string_view subTextureKey, float fontSize = 0); /** Sets a new bitmap font to Label */ - AX_DEPRECATED_ATTRIBUTE virtual bool setBMFontFilePath(std::string_view bmfontFilePath, + CC_DEPRECATED_ATTRIBUTE virtual bool setBMFontFilePath(std::string_view bmfontFilePath, const Vec2& imageOffset, float fontSize = 0); @@ -899,7 +899,7 @@ protected: EventListenerCustom* _purgeTextureListener; EventListenerCustom* _resetTextureListener; -#if AX_LABEL_DEBUG_DRAW +#if CC_LABEL_DEBUG_DRAW DrawNode* _debugDrawNode; #endif @@ -920,7 +920,7 @@ protected: backend::UniformLocation _effectTypeLocation; private: - AX_DISALLOW_COPY_AND_ASSIGN(Label); + CC_DISALLOW_COPY_AND_ASSIGN(Label); }; // end group diff --git a/core/2d/CCLabelAtlas.cpp b/core/2d/CCLabelAtlas.cpp index 977ca04a0c..7cf365f084 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 AX_LABELATLAS_DEBUG_DRAW +#if CC_LABELATLAS_DEBUG_DRAW # include "renderer/CCRenderer.h" #endif @@ -52,7 +52,7 @@ LabelAtlas* LabelAtlas::create(std::string_view string, ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -91,7 +91,7 @@ LabelAtlas* LabelAtlas::create(std::string_view string, std::string_view fntFile } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -111,7 +111,7 @@ LabelAtlas* LabelAtlas::create(std::string_view string, } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -128,8 +128,8 @@ bool LabelAtlas::initWithString(std::string_view theString, std::string_view fnt std::string textureFilename = relPathStr + dict["textureFilename"].asString(); - unsigned int width = static_cast(dict["itemWidth"].asInt() / AX_CONTENT_SCALE_FACTOR()); - unsigned int height = static_cast(dict["itemHeight"].asInt() / AX_CONTENT_SCALE_FACTOR()); + 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 startChar = dict["firstChar"].asInt(); this->initWithString(theString, textureFilename, width, height, startChar); @@ -152,8 +152,8 @@ void LabelAtlas::updateAtlasValues() Texture2D* texture = _textureAtlas->getTexture(); float textureWide = (float)texture->getPixelsWide(); float textureHigh = (float)texture->getPixelsHigh(); - float itemWidthInPixels = _itemWidth * AX_CONTENT_SCALE_FACTOR(); - float itemHeightInPixels = _itemHeight * AX_CONTENT_SCALE_FACTOR(); + float itemWidthInPixels = _itemWidth * CC_CONTENT_SCALE_FACTOR(); + float itemHeightInPixels = _itemHeight * CC_CONTENT_SCALE_FACTOR(); if (_ignoreContentScaleFactor) { itemWidthInPixels = static_cast(_itemWidth); @@ -169,7 +169,7 @@ void LabelAtlas::updateAtlasValues() float row = (float)(a % _itemsPerRow); float col = (float)(a / _itemsPerRow); -#if AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL // Issue #938. Don't use texStepX & texStepY float left = (2 * row * itemWidthInPixels + 1) / (2 * textureWide); float right = left + (itemWidthInPixels * 2 - 2) / (2 * textureWide); @@ -180,7 +180,7 @@ void LabelAtlas::updateAtlasValues() float right = left + itemWidthInPixels / textureWide; float top = col * itemHeightInPixels / textureHigh; float bottom = top + itemHeightInPixels / textureHigh; -#endif // ! AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL quads[i].tl.texCoords.u = left; quads[i].tl.texCoords.v = top; @@ -269,7 +269,7 @@ void LabelAtlas::updateColor() } // CCLabelAtlas - draw -#if AX_LABELATLAS_DEBUG_DRAW +#if CC_LABELATLAS_DEBUG_DRAW void LabelAtlas::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) { AtlasNode::draw(renderer, transform, _transformUpdated); diff --git a/core/2d/CCLabelAtlas.h b/core/2d/CCLabelAtlas.h index 68343f0b89..15d7e0284a 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 AX_LABELATLAS_DEBUG_DRAW +#if CC_LABELATLAS_DEBUG_DRAW # include "renderer/CCCustomCommand.h" # include "2d/CCDrawNode.h" #endif @@ -53,7 +53,7 @@ NS_AX_BEGIN * * A more flexible class is LabelBMFont. It supports variable width characters and it also has a nice editor. */ -class AX_DLL LabelAtlas : public AtlasNode, public LabelProtocol +class CC_DLL LabelAtlas : public AtlasNode, public LabelProtocol { public: /** Creates the LabelAtlas with a string, a char map file(the atlas), the width and height of each element and the @@ -107,13 +107,13 @@ public: */ virtual std::string getDescription() const override; -#if AX_LABELATLAS_DEBUG_DRAW +#if CC_LABELATLAS_DEBUG_DRAW virtual void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override; #endif LabelAtlas() { -#if AX_LABELATLAS_DEBUG_DRAW +#if CC_LABELATLAS_DEBUG_DRAW _debugDrawNode = DrawNode::create(); addChild(_debugDrawNode); #endif @@ -124,7 +124,7 @@ public: protected: virtual void updateColor() override; -#if AX_LABELATLAS_DEBUG_DRAW +#if CC_LABELATLAS_DEBUG_DRAW DrawNode* _debugDrawNode; #endif diff --git a/core/2d/CCLabelTextFormatter.cpp b/core/2d/CCLabelTextFormatter.cpp index 25ad9c77d7..559303b610 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 = AX_CONTENT_SCALE_FACTOR(); + auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR(); for (int index = startIndex; index < textLen; ++index) { @@ -141,7 +141,7 @@ void Label::updateBMFontScale() { FontFNT* bmFont = (FontFNT*)font; auto originalFontSize = bmFont->getOriginalFontSize(); - _bmfontScale = _bmFontSize * AX_CONTENT_SCALE_FACTOR() / originalFontSize; + _bmfontScale = _bmFontSize * CC_CONTENT_SCALE_FACTOR() / originalFontSize; } else { @@ -159,7 +159,7 @@ bool Label::multilineTextWrap(const std::functionautorelease(); return layer; } - AX_SAFE_DELETE(layer); + CC_SAFE_DELETE(layer); return nullptr; } @@ -97,7 +97,7 @@ LayerColor* LayerColor::create(const Color4B& color) layer->autorelease(); return layer; } - AX_SAFE_DELETE(layer); + CC_SAFE_DELETE(layer); return nullptr; } @@ -162,7 +162,7 @@ LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end) layer->autorelease(); return layer; } - AX_SAFE_DELETE(layer); + CC_SAFE_DELETE(layer); return nullptr; } @@ -174,7 +174,7 @@ LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end, c layer->autorelease(); return layer; } - AX_SAFE_DELETE(layer); + CC_SAFE_DELETE(layer); return nullptr; } @@ -187,7 +187,7 @@ LayerGradient* LayerGradient::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -406,7 +406,7 @@ LayerRadialGradient::LayerRadialGradient() LayerRadialGradient::~LayerRadialGradient() { - AX_SAFE_RELEASE_NULL(_customCommand.getPipelineDescriptor().programState); + CC_SAFE_RELEASE_NULL(_customCommand.getPipelineDescriptor().programState); } bool LayerRadialGradient::initWithColor(const axis::Color4B& startColor, @@ -603,7 +603,7 @@ LayerMultiplex* LayerMultiplex::create(Node* layer, ...) return ret; } va_end(args); - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -621,7 +621,7 @@ LayerMultiplex* LayerMultiplex::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -635,20 +635,20 @@ LayerMultiplex* LayerMultiplex::createWithArray(const Vector& arrayOfLaye } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } void LayerMultiplex::addLayer(Node* layer) { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, layer); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.pushBack(layer); } @@ -667,24 +667,24 @@ bool LayerMultiplex::initWithLayers(Node* layer, va_list params) if (Node::initLayer()) { _layers.reserve(5); -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, layer); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.pushBack(layer); Node* l = va_arg(params, Node*); while (l) { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS if (sEngine) { sEngine->retainScriptObject(this, l); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.pushBack(l); l = va_arg(params, Node*); } @@ -701,7 +701,7 @@ bool LayerMultiplex::initWithArray(const Vector& arrayOfLayers) { if (Node::initLayer()) { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -713,7 +713,7 @@ bool LayerMultiplex::initWithArray(const Vector& arrayOfLayers) } } } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.reserve(arrayOfLayers.size()); _layers.pushBack(arrayOfLayers); @@ -746,13 +746,13 @@ void LayerMultiplex::switchToAndReleaseMe(int n) CCASSERT(n < _layers.size(), "Invalid index in MultiplexLayer switchTo message"); this->removeChild(_layers.at(_enabledLayer), true); -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, _layers.at(_enabledLayer)); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.replace(_enabledLayer, nullptr); diff --git a/core/2d/CCLayer.h b/core/2d/CCLayer.h index 41b5a8a4dc..4575b72e8e 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 AX_DLL Layer : public Node +class CC_DLL Layer : public Node { public: static Layer* create(); @@ -56,7 +56,7 @@ All features from Layer are valid, plus the following new features: - opacity - RGB colors */ -class AX_DLL LayerColor : public Sprite +class CC_DLL LayerColor : public Sprite { public: @@ -103,7 +103,7 @@ public: bool initWithColor(const Color4B& color); private: - AX_DISALLOW_COPY_AND_ASSIGN(LayerColor); + CC_DISALLOW_COPY_AND_ASSIGN(LayerColor); }; @@ -130,7 +130,7 @@ If ' compressedInterpolation' is enabled (default mode) you will see both the st @since v0.99.5 */ -class AX_DLL LayerGradient : public LayerColor +class CC_DLL LayerGradient : public LayerColor { public: /** Creates a fullscreen black layer. @@ -257,7 +257,7 @@ protected: * @brief LayerRadialGradient is a subclass of Layer that draws radial gradients across the background. @since v3.16 */ -class AX_DLL LayerRadialGradient : public Node, BlendProtocol +class CC_DLL LayerRadialGradient : public Node, BlendProtocol { public: /** Create a LayerRadialGradient @@ -349,7 +349,7 @@ Features: - It supports one or more children - Only one children will be active a time */ -class AX_DLL LayerMultiplex : public Node +class CC_DLL LayerMultiplex : public Node { public: /** Creates and initializes a LayerMultiplex object. @@ -439,7 +439,7 @@ protected: Vector _layers; private: - AX_DISALLOW_COPY_AND_ASSIGN(LayerMultiplex); + CC_DISALLOW_COPY_AND_ASSIGN(LayerMultiplex); }; // end of _2d group diff --git a/core/2d/CCLight.cpp b/core/2d/CCLight.cpp index 5f25441e62..d5e6ef8ba7 100644 --- a/core/2d/CCLight.cpp +++ b/core/2d/CCLight.cpp @@ -29,7 +29,7 @@ NS_AX_BEGIN void BaseLight::setIntensity(float intensity) { - AX_ASSERT(intensity >= 0); + CC_ASSERT(intensity >= 0); _intensity = intensity; } @@ -61,8 +61,8 @@ void BaseLight::onExit() void BaseLight::setRotationFromDirection(const Vec3& direction) { float projLen = sqrt(direction.x * direction.x + direction.z * direction.z); - float rotY = AX_RADIANS_TO_DEGREES(atan2f(-direction.x, -direction.z)); - float rotX = -AX_RADIANS_TO_DEGREES(atan2f(-direction.y, projLen)); + float rotY = CC_RADIANS_TO_DEGREES(atan2f(-direction.x, -direction.z)); + float rotX = -CC_RADIANS_TO_DEGREES(atan2f(-direction.y, projLen)); setRotation3D(Vec3(rotX, rotY, 0.0f)); } diff --git a/core/2d/CCLight.h b/core/2d/CCLight.h index 631dff828a..67ca1e1a4e 100644 --- a/core/2d/CCLight.h +++ b/core/2d/CCLight.h @@ -61,7 +61,7 @@ enum class LightFlag /** @js NA */ -class AX_DLL BaseLight : public Node +class CC_DLL BaseLight : public Node { public: /** @@ -103,7 +103,7 @@ protected: /** @js NA */ -class AX_DLL DirectionLight : public BaseLight +class CC_DLL DirectionLight : public BaseLight { public: /** @@ -142,7 +142,7 @@ public: /** @js NA */ -class AX_DLL PointLight : public BaseLight +class CC_DLL PointLight : public BaseLight { public: /** @@ -172,7 +172,7 @@ protected: /** @js NA */ -class AX_DLL SpotLight : public BaseLight +class CC_DLL SpotLight : public BaseLight { public: /** @@ -270,7 +270,7 @@ protected: /** @js NA */ -class AX_DLL AmbientLight : public BaseLight +class CC_DLL AmbientLight : public BaseLight { public: /** diff --git a/core/2d/CCMenu.cpp b/core/2d/CCMenu.cpp index 5e53c882eb..85d5a7c709 100644 --- a/core/2d/CCMenu.cpp +++ b/core/2d/CCMenu.cpp @@ -79,7 +79,7 @@ Menu* Menu::createWithArray(const Vector& arrayOfItems) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -144,10 +144,10 @@ bool Menu::initWithArray(const Vector& arrayOfItems) auto touchListener = EventListenerTouchOneByOne::create(); touchListener->setSwallowTouches(true); - touchListener->onTouchBegan = AX_CALLBACK_2(Menu::onTouchBegan, this); - touchListener->onTouchMoved = AX_CALLBACK_2(Menu::onTouchMoved, this); - touchListener->onTouchEnded = AX_CALLBACK_2(Menu::onTouchEnded, this); - touchListener->onTouchCancelled = AX_CALLBACK_2(Menu::onTouchCancelled, this); + touchListener->onTouchBegan = CC_CALLBACK_2(Menu::onTouchBegan, this); + touchListener->onTouchMoved = CC_CALLBACK_2(Menu::onTouchMoved, this); + touchListener->onTouchEnded = CC_CALLBACK_2(Menu::onTouchEnded, this); + touchListener->onTouchCancelled = CC_CALLBACK_2(Menu::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); diff --git a/core/2d/CCMenu.h b/core/2d/CCMenu.h index 062864a39c..a288360a4d 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 AX_DLL Menu : public Node +class CC_DLL Menu : public Node { public: /** @@ -63,7 +63,7 @@ public: static Menu* create(); /** Creates a Menu with MenuItem objects. */ - static Menu* create(MenuItem* item, ...) AX_REQUIRES_NULL_TERMINATION; + static Menu* create(MenuItem* item, ...) CC_REQUIRES_NULL_TERMINATION; /** * Creates a Menu with a Array of MenuItem objects. @@ -101,7 +101,7 @@ public: void alignItemsHorizontallyWithPadding(float padding); /** Align items in rows of columns. */ - void alignItemsInColumns(int columns, ...) AX_REQUIRES_NULL_TERMINATION; + void alignItemsInColumns(int columns, ...) CC_REQUIRES_NULL_TERMINATION; /** Align items in rows of columns. */ void alignItemsInColumns(int columns, va_list args); @@ -112,7 +112,7 @@ public: void alignItemsInColumnsWithArray(const ValueVector& rows); /** Align items in columns of rows. */ - void alignItemsInRows(int rows, ...) AX_REQUIRES_NULL_TERMINATION; + void alignItemsInRows(int rows, ...) CC_REQUIRES_NULL_TERMINATION; /** Align items in columns of rows. */ void alignItemsInRows(int rows, va_list args); @@ -179,7 +179,7 @@ protected: const Camera* _selectedWithCamera; private: - AX_DISALLOW_COPY_AND_ASSIGN(Menu); + CC_DISALLOW_COPY_AND_ASSIGN(Menu); }; // end of _2d group diff --git a/core/2d/CCMenuItem.cpp b/core/2d/CCMenuItem.cpp index f94e27e3c2..6bfab4ce64 100644 --- a/core/2d/CCMenuItem.cpp +++ b/core/2d/CCMenuItem.cpp @@ -88,7 +88,7 @@ void MenuItem::activate() { _callback(this); } -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING BasicScriptData data(this); ScriptEvent scriptEvent(kMenuClickedEvent, &data); ScriptEngineManager::sendEventToLua(scriptEvent); @@ -591,7 +591,7 @@ MenuItemImage* MenuItemImage::create() ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -623,7 +623,7 @@ MenuItemImage* MenuItemImage::create(std::string_view normalImage, ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -637,7 +637,7 @@ MenuItemImage* MenuItemImage::create(std::string_view normalImage, ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -694,7 +694,7 @@ MenuItemToggle* MenuItemToggle::createWithCallback(const ccMenuCallback& callbac MenuItemToggle* ret = new MenuItemToggle(); ret->MenuItem::initWithCallback(callback); ret->autorelease(); -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -706,7 +706,7 @@ MenuItemToggle* MenuItemToggle::createWithCallback(const ccMenuCallback& callbac } } } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS ret->_subItems = menuItems; ret->_selectedIndex = UINT_MAX; ret->setSelectedIndex(0); @@ -739,19 +739,19 @@ bool MenuItemToggle::initWithCallback(const ccMenuCallback& callback, MenuItem* int z = 0; MenuItem* i = item; -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS while (i) { z++; -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS if (sEngine) { sEngine->retainScriptObject(this, i); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _subItems.pushBack(i); i = va_arg(args, MenuItem*); } @@ -787,13 +787,13 @@ bool MenuItemToggle::initWithItem(MenuItem* item) void MenuItemToggle::addSubItem(MenuItem* item) { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, item); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _subItems.pushBack(item); } @@ -801,7 +801,7 @@ void MenuItemToggle::cleanup() { for (const auto& item : _subItems) { -#if defined(AX_NATIVE_CONTROL_SCRIPT) && !AX_NATIVE_CONTROL_SCRIPT +#if defined(CC_NATIVE_CONTROL_SCRIPT) && !CC_NATIVE_CONTROL_SCRIPT ScriptEngineManager::getInstance()->getScriptEngine()->releaseScriptObject(this, item); #endif item->cleanup(); diff --git a/core/2d/CCMenuItem.h b/core/2d/CCMenuItem.h index 4f0aa761c0..a75648a545 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 AX_DLL MenuItem : public Node +class CC_DLL MenuItem : public Node { public: /** Creates a MenuItem with no target/selector. */ @@ -113,7 +113,7 @@ protected: ccMenuCallback _callback; private: - AX_DISALLOW_COPY_AND_ASSIGN(MenuItem); + CC_DISALLOW_COPY_AND_ASSIGN(MenuItem); }; /** @brief An abstract class for "label" MenuItemLabel items. @@ -124,7 +124,7 @@ private: - LabelTTF - Label */ -class AX_DLL MenuItemLabel : public MenuItem +class CC_DLL MenuItemLabel : public MenuItem { public: /** Creates a MenuItemLabel with a Label and a callback. */ @@ -180,13 +180,13 @@ protected: Node* _label; private: - AX_DISALLOW_COPY_AND_ASSIGN(MenuItemLabel); + CC_DISALLOW_COPY_AND_ASSIGN(MenuItemLabel); }; /** @brief A MenuItemAtlasFont. Helper class that creates a MenuItemLabel class with a LabelAtlas. */ -class AX_DLL MenuItemAtlasFont : public MenuItemLabel +class CC_DLL MenuItemAtlasFont : public MenuItemLabel { public: /** Creates a menu item from a string and atlas with a target/selector. */ @@ -222,13 +222,13 @@ public: const ccMenuCallback& callback); private: - AX_DISALLOW_COPY_AND_ASSIGN(MenuItemAtlasFont); + CC_DISALLOW_COPY_AND_ASSIGN(MenuItemAtlasFont); }; /** @brief A MenuItemFont. Helper class that creates a MenuItemLabel class with a Label. */ -class AX_DLL MenuItemFont : public MenuItemLabel +class CC_DLL MenuItemFont : public MenuItemLabel { public: /** Creates a menu item from a string without target/selector. To be used with MenuItemToggle. */ @@ -292,7 +292,7 @@ protected: std::string _fontName; private: - AX_DISALLOW_COPY_AND_ASSIGN(MenuItemFont); + CC_DISALLOW_COPY_AND_ASSIGN(MenuItemFont); }; /** @brief MenuItemSprite accepts Node objects as items. @@ -303,7 +303,7 @@ private: @since v0.8.0 */ -class AX_DLL MenuItemSprite : public MenuItem +class CC_DLL MenuItemSprite : public MenuItem { public: /** Creates a menu item with a normal, selected and disabled image.*/ @@ -365,7 +365,7 @@ protected: Node* _disabledImage; private: - AX_DISALLOW_COPY_AND_ASSIGN(MenuItemSprite); + CC_DISALLOW_COPY_AND_ASSIGN(MenuItemSprite); }; /** @brief MenuItemImage accepts images as items. @@ -376,7 +376,7 @@ private: For best results try that all images are of the same size. */ -class AX_DLL MenuItemImage : public MenuItemSprite +class CC_DLL MenuItemImage : public MenuItemSprite { public: /** Creates an MenuItemImage. */ @@ -423,14 +423,14 @@ public: const ccMenuCallback& callback); private: - AX_DISALLOW_COPY_AND_ASSIGN(MenuItemImage); + CC_DISALLOW_COPY_AND_ASSIGN(MenuItemImage); }; /** @brief A MenuItemToggle. A simple container class that "toggles" it's inner items. The inner items can be any MenuItem. */ -class AX_DLL MenuItemToggle : public MenuItem +class CC_DLL MenuItemToggle : public MenuItem { public: /** @@ -440,7 +440,7 @@ public: /** Creates a menu item from a list of items with a callable object. */ static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, MenuItem* item, - ...) AX_REQUIRES_NULL_TERMINATION; + ...) CC_REQUIRES_NULL_TERMINATION; /** Creates a menu item with no target/selector and no items. */ static MenuItemToggle* create(); @@ -501,7 +501,7 @@ protected: Vector _subItems; private: - AX_DISALLOW_COPY_AND_ASSIGN(MenuItemToggle); + CC_DISALLOW_COPY_AND_ASSIGN(MenuItemToggle); }; // end of 2d group diff --git a/core/2d/CCMotionStreak.cpp b/core/2d/CCMotionStreak.cpp index 8f5b0b4b1b..053f211086 100644 --- a/core/2d/CCMotionStreak.cpp +++ b/core/2d/CCMotionStreak.cpp @@ -44,12 +44,12 @@ MotionStreak::MotionStreak() MotionStreak::~MotionStreak() { - AX_SAFE_RELEASE(_texture); - AX_SAFE_FREE(_pointState); - AX_SAFE_FREE(_pointVertexes); - AX_SAFE_FREE(_vertices); - AX_SAFE_FREE(_colorPointer); - AX_SAFE_FREE(_texCoords); + CC_SAFE_RELEASE(_texture); + CC_SAFE_FREE(_pointState); + CC_SAFE_FREE(_pointVertexes); + CC_SAFE_FREE(_vertices); + CC_SAFE_FREE(_colorPointer); + CC_SAFE_FREE(_texCoords); } MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const Color3B& color, std::string_view path) @@ -61,7 +61,7 @@ MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -74,7 +74,7 @@ MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -215,8 +215,8 @@ void MotionStreak::setTexture(Texture2D* texture) { if (_texture != texture) { - AX_SAFE_RETAIN(texture); - AX_SAFE_RELEASE(_texture); + CC_SAFE_RETAIN(texture); + CC_SAFE_RELEASE(_texture); _texture = texture; setProgramStateWithRegistry(backend::ProgramType::POSITION_TEXTURE_COLOR, _texture); diff --git a/core/2d/CCMotionStreak.h b/core/2d/CCMotionStreak.h index a9c3f01ab0..1340fec9b5 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 AX_DLL MotionStreak : public Node, public TextureProtocol +class CC_DLL MotionStreak : public Node, public TextureProtocol { public: /** Creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture @@ -200,7 +200,7 @@ protected: backend::UniformLocation _textureLocation; private: - AX_DISALLOW_COPY_AND_ASSIGN(MotionStreak); + CC_DISALLOW_COPY_AND_ASSIGN(MotionStreak); }; // end of _2d group diff --git a/core/2d/CCNode.cpp b/core/2d/CCNode.cpp index e93b167d5a..cf5bb7ca20 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 AX_NODE_RENDER_SUBPIXEL +#if CC_NODE_RENDER_SUBPIXEL # define RENDER_IN_SUBPIXEL #else # define RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__)) @@ -56,7 +56,7 @@ THE SOFTWARE. /* * 4.5x faster than std::hash in release mode */ -#define AX_HASH_NODE_NAME(name) (!name.empty() ? XXH3_64bits(name.data(), name.length()) : 0) +#define CC_HASH_NODE_NAME(name) (!name.empty() ? XXH3_64bits(name.data(), name.length()) : 0) NS_AX_BEGIN @@ -106,7 +106,7 @@ Node::Node() , _ignoreAnchorPointForPosition(false) , _reorderChildDirty(false) , _isTransitionFinished(false) -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING , _scriptHandler(0) , _updateScriptHandler(0) #endif @@ -123,7 +123,7 @@ Node::Node() , _onExitCallback(nullptr) , _onEnterTransitionDidFinishCallback(nullptr) , _onExitTransitionDidStartCallback(nullptr) -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS , _physicsBody(nullptr) #endif { @@ -148,7 +148,7 @@ Node* Node::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -157,9 +157,9 @@ Node::~Node() { CCLOGINFO("deallocing Node: %p - tag: %i", this, _tag); - AX_SAFE_DELETE(_childrenIndexer); + CC_SAFE_DELETE(_childrenIndexer); -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING if (_updateScriptHandler) { ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_updateScriptHandler); @@ -168,8 +168,8 @@ Node::~Node() // User object has to be released before others, since userObject may have a weak reference of this node // It may invoke `node->stopAllActions();` while `_actionManager` is null if the next line is after - // `AX_SAFE_RELEASE_NULL(_actionManager)`. - AX_SAFE_RELEASE_NULL(_userObject); + // `CC_SAFE_RELEASE_NULL(_actionManager)`. + CC_SAFE_RELEASE_NULL(_userObject); for (auto& child : _children) { @@ -178,26 +178,26 @@ Node::~Node() removeAllComponents(); - AX_SAFE_DELETE(_componentContainer); + CC_SAFE_DELETE(_componentContainer); stopAllActions(); unscheduleAllCallbacks(); - AX_SAFE_RELEASE_NULL(_actionManager); - AX_SAFE_RELEASE_NULL(_scheduler); + CC_SAFE_RELEASE_NULL(_actionManager); + CC_SAFE_RELEASE_NULL(_scheduler); _eventDispatcher->removeEventListenersForTarget(this); -#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 +#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 _eventDispatcher->debugCheckNodeHasNoEventListenersOnDestruction(this); #endif CCASSERT(!_running, "Node still marked as running on node destruction! Was base class onExit() called in derived class " "onExit() implementations?"); - AX_SAFE_RELEASE(_eventDispatcher); + CC_SAFE_RELEASE(_eventDispatcher); delete[] _additionalTransform; - AX_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_programState); } bool Node::init() @@ -214,9 +214,9 @@ bool Node::initLayer() { void Node::cleanup() { -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING ScriptEngineManager::sendNodeEventToLua(this, kNodeOnCleanup); -#endif // #if AX_ENABLE_SCRIPT_BINDING +#endif // #if CC_ENABLE_SCRIPT_BINDING // actions this->stopAllActions(); @@ -360,8 +360,8 @@ void Node::updateRotationQuat() // convert Euler angle to quaternion // when _rotationZ_X == _rotationZ_Y, _rotationQuat = RotationZ_X * RotationY * RotationX // when _rotationZ_X != _rotationZ_Y, _rotationQuat = RotationY * RotationX - float halfRadx = AX_DEGREES_TO_RADIANS(_rotationX / 2.f), halfRady = AX_DEGREES_TO_RADIANS(_rotationY / 2.f), - halfRadz = _rotationZ_X == _rotationZ_Y ? -AX_DEGREES_TO_RADIANS(_rotationZ_X / 2.f) : 0; + float halfRadx = CC_DEGREES_TO_RADIANS(_rotationX / 2.f), halfRady = CC_DEGREES_TO_RADIANS(_rotationY / 2.f), + halfRadz = _rotationZ_X == _rotationZ_Y ? -CC_DEGREES_TO_RADIANS(_rotationZ_X / 2.f) : 0; float coshalfRadx = cosf(halfRadx), sinhalfRadx = sinf(halfRadx), coshalfRady = cosf(halfRady), sinhalfRady = sinf(halfRady), coshalfRadz = cosf(halfRadz), sinhalfRadz = sinf(halfRadz); _rotationQuat.x = sinhalfRadx * coshalfRady * coshalfRadz - coshalfRadx * sinhalfRady * sinhalfRadz; @@ -380,9 +380,9 @@ void Node::updateRotation3D() _rotationY = asinf(sy); _rotationZ_X = atan2f(2.f * (w * z + x * y), 1.f - 2.f * (y * y + z * z)); - _rotationX = AX_RADIANS_TO_DEGREES(_rotationX); - _rotationY = AX_RADIANS_TO_DEGREES(_rotationY); - _rotationZ_X = _rotationZ_Y = -AX_RADIANS_TO_DEGREES(_rotationZ_X); + _rotationX = CC_RADIANS_TO_DEGREES(_rotationX); + _rotationY = CC_RADIANS_TO_DEGREES(_rotationY); + _rotationZ_X = _rotationZ_Y = -CC_RADIANS_TO_DEGREES(_rotationZ_X); } void Node::setRotationQuat(const Quaternion& quat) @@ -727,11 +727,11 @@ void Node::updateParentChildrenIndexer(int tag) void Node::updateParentChildrenIndexer(std::string_view name) { - uint64_t newHash = AX_HASH_NODE_NAME(name); + uint64_t newHash = CC_HASH_NODE_NAME(name); auto parentChildrenIndexer = getParentChildrenIndexer(); if (parentChildrenIndexer) { - auto oldHash = AX_HASH_NODE_NAME(_name); + auto oldHash = CC_HASH_NODE_NAME(_name); if (oldHash != newHash) parentChildrenIndexer->erase(oldHash); (*parentChildrenIndexer)[newHash] = this; @@ -763,7 +763,7 @@ void Node::setUserData(void* userData) void Node::setUserObject(Ref* userObject) { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -772,9 +772,9 @@ void Node::setUserObject(Ref* userObject) if (_userObject) sEngine->releaseScriptObject(this, _userObject); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS - AX_SAFE_RETAIN(userObject); - AX_SAFE_RELEASE(_userObject); +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS + CC_SAFE_RETAIN(userObject); + CC_SAFE_RELEASE(_userObject); _userObject = userObject; } @@ -828,7 +828,7 @@ Node* Node::getChildByTag(int tag) const Node* Node::getChildByName(std::string_view name) const { // CCASSERT(!name.empty(), "Invalid name"); - auto hash = AX_HASH_NODE_NAME(name); + auto hash = CC_HASH_NODE_NAME(name); if (_childrenIndexer) { auto it = _childrenIndexer->find(hash); @@ -1082,7 +1082,7 @@ void Node::removeChild(Node* child, bool cleanup /* = true */) } ssize_t index = _children.getIndex(child); - if (index != AX_INVALID_INDEX) + if (index != CC_INVALID_INDEX) this->detachChild(child, index, cleanup); } @@ -1132,7 +1132,7 @@ void Node::removeAllChildrenWithCleanup(bool cleanup) } _children.clear(); - AX_SAFE_DELETE(_childrenIndexer); + CC_SAFE_DELETE(_childrenIndexer); } void Node::resetChild(Node* child, bool cleanup) @@ -1152,13 +1152,13 @@ void Node::resetChild(Node* child, bool cleanup) child->cleanup(); } -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, child); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS // set parent nil at the end child->setParent(nullptr); } @@ -1178,13 +1178,13 @@ void Node::detachChild(Node* child, ssize_t childIndex, bool cleanup) // helper used by reorderChild & add void Node::insertChild(Node* child, int z) { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, child); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _transformUpdated = true; _reorderChildDirty = true; _children.pushBack(child); @@ -1350,7 +1350,7 @@ void Node::onEnter() _running = true; -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING ScriptEngineManager::sendNodeEventToLua(this, kNodeOnEnter); #endif } @@ -1364,7 +1364,7 @@ void Node::onEnterTransitionDidFinish() for (const auto& child : _children) child->onEnterTransitionDidFinish(); -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING ScriptEngineManager::sendNodeEventToLua(this, kNodeOnEnterTransitionDidFinish); #endif } @@ -1377,7 +1377,7 @@ void Node::onExitTransitionDidStart() for (const auto& child : _children) child->onExitTransitionDidStart(); -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING ScriptEngineManager::sendNodeEventToLua(this, kNodeOnExitTransitionDidStart); #endif } @@ -1404,7 +1404,7 @@ void Node::onExit() for (const auto& child : _children) child->onExit(); -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING ScriptEngineManager::sendNodeEventToLua(this, kNodeOnExit); #endif } @@ -1414,8 +1414,8 @@ void Node::setEventDispatcher(EventDispatcher* dispatcher) if (dispatcher != _eventDispatcher) { _eventDispatcher->removeEventListenersForTarget(this); - AX_SAFE_RETAIN(dispatcher); - AX_SAFE_RELEASE(_eventDispatcher); + CC_SAFE_RETAIN(dispatcher); + CC_SAFE_RELEASE(_eventDispatcher); _eventDispatcher = dispatcher; } } @@ -1425,8 +1425,8 @@ void Node::setActionManager(ActionManager* actionManager) if (actionManager != _actionManager) { this->stopAllActions(); - AX_SAFE_RETAIN(actionManager); - AX_SAFE_RELEASE(_actionManager); + CC_SAFE_RETAIN(actionManager); + CC_SAFE_RELEASE(_actionManager); _actionManager = actionManager; } } @@ -1493,8 +1493,8 @@ void Node::setScheduler(Scheduler* scheduler) if (scheduler != _scheduler) { this->unscheduleAllCallbacks(); - AX_SAFE_RETAIN(scheduler); - AX_SAFE_RELEASE(_scheduler); + CC_SAFE_RETAIN(scheduler); + CC_SAFE_RELEASE(_scheduler); _scheduler = scheduler; } } @@ -1523,7 +1523,7 @@ void Node::scheduleUpdateWithPriorityLua(int nHandler, int priority) { unscheduleUpdate(); -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING _updateScriptHandler = nHandler; #endif @@ -1534,7 +1534,7 @@ void Node::unscheduleUpdate() { _scheduler->unscheduleUpdate(this); -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING if (_updateScriptHandler) { ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_updateScriptHandler); @@ -1545,12 +1545,12 @@ void Node::unscheduleUpdate() void Node::schedule(SEL_SCHEDULE selector) { - this->schedule(selector, 0.0f, AX_REPEAT_FOREVER, 0.0f); + this->schedule(selector, 0.0f, CC_REPEAT_FOREVER, 0.0f); } void Node::schedule(SEL_SCHEDULE selector, float interval) { - this->schedule(selector, interval, AX_REPEAT_FOREVER, 0.0f); + this->schedule(selector, interval, CC_REPEAT_FOREVER, 0.0f); } void Node::schedule(SEL_SCHEDULE selector, float interval, unsigned int repeat, float delay) @@ -1626,7 +1626,7 @@ void Node::pause() // override me void Node::update(float fDelta) { -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING if (0 != _updateScriptHandler) { // only lua use @@ -1702,8 +1702,8 @@ const Mat4& Node::getNodeToParentTransform() const // Rotation values // Change rotation code to handle X and Y // If we skew with the exact same value for both x and y then we're simply just rotating - float radiansX = -AX_DEGREES_TO_RADIANS(_rotationZ_X); - float radiansY = -AX_DEGREES_TO_RADIANS(_rotationZ_Y); + float radiansX = -CC_DEGREES_TO_RADIANS(_rotationZ_X); + float radiansY = -CC_DEGREES_TO_RADIANS(_rotationZ_Y); float cx = cosf(radiansX); float sx = sinf(radiansX); float cy = cosf(radiansY); @@ -1744,10 +1744,10 @@ const Mat4& Node::getNodeToParentTransform() const if (needsSkewMatrix) { float skewMatArray[16] = {1, - (float)tanf(AX_DEGREES_TO_RADIANS(_skewY)), + (float)tanf(CC_DEGREES_TO_RADIANS(_skewY)), 0, 0, - (float)tanf(AX_DEGREES_TO_RADIANS(_skewX)), + (float)tanf(CC_DEGREES_TO_RADIANS(_skewX)), 1, 0, 0, @@ -2225,10 +2225,10 @@ bool Node::setProgramState(backend::ProgramState* programState, bool needsRetain { if (_programState != programState) { - AX_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_programState); _programState = programState; if (needsRetain) - AX_SAFE_RETAIN(_programState); + CC_SAFE_RETAIN(_programState); return !!_programState; } return false; diff --git a/core/2d/CCNode.h b/core/2d/CCNode.h index 2dcc696c96..3b467fadd8 100644 --- a/core/2d/CCNode.h +++ b/core/2d/CCNode.h @@ -41,7 +41,7 @@ #include "2d/CCComponentContainer.h" #include "2d/CCComponent.h" -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS # include "physics/CCPhysicsBody.h" #endif @@ -114,7 +114,7 @@ Node and override `draw`. */ -class AX_DLL Node : public Ref +class CC_DLL Node : public Ref { public: /** Default tag used for all the nodes */ @@ -949,7 +949,7 @@ public: inline static void sortNodes(axis::Vector<_T*>& nodes) { static_assert(std::is_base_of::value, "Node::sortNodes: Only accept derived of Node!"); -#if AX_64BITS +#if CC_64BITS std::sort(std::begin(nodes), std::end(nodes), [](_T* n1, _T* n2) { return (n1->_localZOrder$Arrival < n2->_localZOrder$Arrival); }); #else @@ -1344,13 +1344,13 @@ public: // firstly, implement a schedule function void MyNode::TickMe(float dt); // wrap this function into a selector via schedule_selector macro. - this->schedule(AX_SCHEDULE_SELECTOR(MyNode::TickMe), 0, 0, 0); + this->schedule(CC_SCHEDULE_SELECTOR(MyNode::TickMe), 0, 0, 0); @endcode * * @param selector The SEL_SCHEDULE selector to be scheduled. * @param interval Tick interval in seconds. 0 means tick every frame. If interval = 0, it's recommended to use scheduleUpdate() instead. - * @param repeat The selector will be executed (repeat + 1) times, you can use AX_REPEAT_FOREVER for tick + * @param repeat The selector will be executed (repeat + 1) times, you can use CC_REPEAT_FOREVER for tick infinitely. * @param delay The amount of time that the first tick will wait before execution. * @lua NA @@ -1420,7 +1420,7 @@ public: * * @param callback The lambda function to be schedule. * @param interval Tick interval in seconds. 0 means tick every frame. - * @param repeat The selector will be executed (repeat + 1) times, you can use AX_REPEAT_FOREVER for tick + * @param repeat The selector will be executed (repeat + 1) times, you can use CC_REPEAT_FOREVER for tick * infinitely. * @param delay The amount of time that the first tick will wait before execution. * @param key The key of the lambda function. To be used if you want to unschedule it. @@ -1915,7 +1915,7 @@ protected: mutable Mat4 _inverse; ///< inverse transform mutable Mat4* _additionalTransform; ///< two transforms needed by additional transforms -#if AX_LITTLE_ENDIAN +#if CC_LITTLE_ENDIAN union { struct @@ -1982,7 +1982,7 @@ protected: // camera mask, it is visible only when _cameraMask & current camera' camera flag is true unsigned short _cameraMask; -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING int _scriptHandler; ///< script handler for onEnter() & onExit(), used in Javascript binding and Lua binding. int _updateScriptHandler; ///< script handler for update() callback per frame, which is invoked from lua & ///< javascript. @@ -2004,7 +2004,7 @@ protected: backend::ProgramState* _programState = nullptr; // Physics:remaining backwardly compatible -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS PhysicsBody* _physicsBody; public: @@ -2025,7 +2025,7 @@ public: static int __attachedNodeCount; private: - AX_DISALLOW_COPY_AND_ASSIGN(Node); + CC_DISALLOW_COPY_AND_ASSIGN(Node); }; /** @@ -2043,7 +2043,7 @@ private: * @parma p Point to a Vec3 for store the intersect point, if don't need them set to nullptr. * @return true if the point is in content rectangle, false otherwise. */ -bool AX_DLL isScreenPointInRect(const Vec2& pt, const Camera* camera, const Mat4& w2l, const Rect& rect, Vec3* p); +bool CC_DLL isScreenPointInRect(const Vec2& pt, const Camera* camera, const Mat4& w2l, const Rect& rect, Vec3* p); // end of _2d group /// @} diff --git a/core/2d/CCNodeGrid.cpp b/core/2d/CCNodeGrid.cpp index 1bfd47da6a..6ef17ddf29 100644 --- a/core/2d/CCNodeGrid.cpp +++ b/core/2d/CCNodeGrid.cpp @@ -37,7 +37,7 @@ NodeGrid* NodeGrid::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -56,7 +56,7 @@ NodeGrid::NodeGrid() {} void NodeGrid::setTarget(Node* target) { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -65,16 +65,16 @@ void NodeGrid::setTarget(Node* target) if (target) sEngine->retainScriptObject(this, target); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS - AX_SAFE_RELEASE(_gridTarget); - AX_SAFE_RETAIN(target); +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS + CC_SAFE_RELEASE(_gridTarget); + CC_SAFE_RETAIN(target); _gridTarget = target; } NodeGrid::~NodeGrid() { - AX_SAFE_RELEASE(_nodeGrid); - AX_SAFE_RELEASE(_gridTarget); + CC_SAFE_RELEASE(_nodeGrid); + CC_SAFE_RELEASE(_gridTarget); } void NodeGrid::onGridBeginDraw() @@ -173,8 +173,8 @@ void NodeGrid::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t p void NodeGrid::setGrid(GridBase* grid) { - AX_SAFE_RELEASE(_nodeGrid); - AX_SAFE_RETAIN(grid); + CC_SAFE_RELEASE(_nodeGrid); + CC_SAFE_RETAIN(grid); _nodeGrid = grid; } diff --git a/core/2d/CCNodeGrid.h b/core/2d/CCNodeGrid.h index 4d25d38c47..2f5eb54503 100644 --- a/core/2d/CCNodeGrid.h +++ b/core/2d/CCNodeGrid.h @@ -40,7 +40,7 @@ class GridBase; * @brief Base class for Grid Node. */ -class AX_DLL NodeGrid : public Node +class CC_DLL NodeGrid : public Node { public: /** Create a Grid Node. @@ -104,7 +104,7 @@ protected: Rect _gridRect = Rect::ZERO; private: - AX_DISALLOW_COPY_AND_ASSIGN(NodeGrid); + CC_DISALLOW_COPY_AND_ASSIGN(NodeGrid); }; /** @} */ NS_AX_END diff --git a/core/2d/CCParallaxNode.h b/core/2d/CCParallaxNode.h index 1a8e01799d..ef4a3008a5 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 AX_DLL ParallaxNode : public Node +class CC_DLL ParallaxNode : public Node { public: /** Create a Parallax node. @@ -107,7 +107,7 @@ protected: struct _ccArray* _parallaxArray; private: - AX_DISALLOW_COPY_AND_ASSIGN(ParallaxNode); + CC_DISALLOW_COPY_AND_ASSIGN(ParallaxNode); }; // end of _2d group diff --git a/core/2d/CCParticleBatchNode.cpp b/core/2d/CCParticleBatchNode.cpp index 1c9129bfc5..5afcbcc5ef 100644 --- a/core/2d/CCParticleBatchNode.cpp +++ b/core/2d/CCParticleBatchNode.cpp @@ -85,8 +85,8 @@ ParticleBatchNode::ParticleBatchNode() ParticleBatchNode::~ParticleBatchNode() { - AX_SAFE_RELEASE(_textureAtlas); - AX_SAFE_RELEASE(_customCommand.getPipelineDescriptor().programState); + CC_SAFE_RELEASE(_textureAtlas); + CC_SAFE_RELEASE(_customCommand.getPipelineDescriptor().programState); } /* * creation with Texture2D @@ -100,7 +100,7 @@ ParticleBatchNode* ParticleBatchNode::createWithTexture(Texture2D* tex, int capa p->autorelease(); return p; } - AX_SAFE_DELETE(p); + CC_SAFE_DELETE(p); return nullptr; } @@ -116,7 +116,7 @@ ParticleBatchNode* ParticleBatchNode::create(std::string_view imageFile, int cap p->autorelease(); return p; } - AX_SAFE_DELETE(p); + CC_SAFE_DELETE(p); return nullptr; } @@ -447,7 +447,7 @@ void ParticleBatchNode::removeAllChildrenWithCleanup(bool doCleanup) void ParticleBatchNode::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) { - AX_PROFILER_START("CCParticleBatchNode - draw"); + CC_PROFILER_START("CCParticleBatchNode - draw"); if (_textureAtlas->getTotalQuads() == 0) return; @@ -476,7 +476,7 @@ void ParticleBatchNode::draw(Renderer* renderer, const Mat4& transform, uint32_t renderer->addCommand(&_customCommand); - AX_PROFILER_STOP("CCParticleBatchNode - draw"); + CC_PROFILER_STOP("CCParticleBatchNode - draw"); } void ParticleBatchNode::increaseAtlasCapacityTo(ssize_t quantity) @@ -564,7 +564,7 @@ void ParticleBatchNode::updateProgramStateTexture() auto programState = _customCommand.getPipelineDescriptor().programState; programState->setTexture(texture->getBackendTexture()); // If the new texture has No premultiplied alpha, AND the blendFunc hasn't been changed, then update it - if (!texture->hasPremultipliedAlpha() && (_blendFunc.src == AX_BLEND_SRC && _blendFunc.dst == AX_BLEND_DST)) + if (!texture->hasPremultipliedAlpha() && (_blendFunc.src == CC_BLEND_SRC && _blendFunc.dst == CC_BLEND_DST)) _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED; } diff --git a/core/2d/CCParticleBatchNode.h b/core/2d/CCParticleBatchNode.h index 0d35b5fee0..03539690fa 100644 --- a/core/2d/CCParticleBatchNode.h +++ b/core/2d/CCParticleBatchNode.h @@ -68,7 +68,7 @@ class ParticleSystem; * @since v1.1 */ -class AX_DLL ParticleBatchNode : public Node, public TextureProtocol +class CC_DLL ParticleBatchNode : public Node, public TextureProtocol { public: /** Create the particle system with Texture2D, a capacity of particles, which particle system to use. diff --git a/core/2d/CCParticleExamples.cpp b/core/2d/CCParticleExamples.cpp index 0834e12701..4ec7944b69 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); - AX_BREAK_IF(texture != nullptr); + CC_BREAK_IF(texture != nullptr); image = new Image(); bool ret = image->initWithImageData(__firePngData, sizeof(__firePngData)); - AX_BREAK_IF(!ret); + CC_BREAK_IF(!ret); texture = Director::getInstance()->getTextureCache()->addImage(image, key); } while (0); - AX_SAFE_RELEASE(image); + CC_SAFE_RELEASE(image); return texture; } @@ -67,7 +67,7 @@ ParticleFire* ParticleFire::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -81,7 +81,7 @@ ParticleFire* ParticleFire::createWithTotalParticles(int numberOfParticles) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -171,7 +171,7 @@ ParticleFireworks* ParticleFireworks::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -185,7 +185,7 @@ ParticleFireworks* ParticleFireworks::createWithTotalParticles(int numberOfParti } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -272,7 +272,7 @@ ParticleSun* ParticleSun::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -286,7 +286,7 @@ ParticleSun* ParticleSun::createWithTotalParticles(int numberOfParticles) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -378,7 +378,7 @@ ParticleGalaxy* ParticleGalaxy::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -392,7 +392,7 @@ ParticleGalaxy* ParticleGalaxy::createWithTotalParticles(int numberOfParticles) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -487,7 +487,7 @@ ParticleFlower* ParticleFlower::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -501,7 +501,7 @@ ParticleFlower* ParticleFlower::createWithTotalParticles(int numberOfParticles) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -595,7 +595,7 @@ ParticleMeteor* ParticleMeteor::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -609,7 +609,7 @@ ParticleMeteor* ParticleMeteor::createWithTotalParticles(int numberOfParticles) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -704,7 +704,7 @@ ParticleSpiral* ParticleSpiral::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -718,7 +718,7 @@ ParticleSpiral* ParticleSpiral::createWithTotalParticles(int numberOfParticles) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -813,7 +813,7 @@ ParticleExplosion* ParticleExplosion::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -827,7 +827,7 @@ ParticleExplosion* ParticleExplosion::createWithTotalParticles(int numberOfParti } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -921,7 +921,7 @@ ParticleSmoke* ParticleSmoke::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -935,7 +935,7 @@ ParticleSmoke* ParticleSmoke::createWithTotalParticles(int numberOfParticles) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -1026,7 +1026,7 @@ ParticleSnow* ParticleSnow::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -1040,7 +1040,7 @@ ParticleSnow* ParticleSnow::createWithTotalParticles(int numberOfParticles) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -1134,7 +1134,7 @@ ParticleRain* ParticleRain::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -1148,7 +1148,7 @@ ParticleRain* ParticleRain::createWithTotalParticles(int numberOfParticles) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } diff --git a/core/2d/CCParticleExamples.h b/core/2d/CCParticleExamples.h index 107130b39f..a067ae3958 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 AX_DLL ParticleFire : public ParticleSystemQuad +class CC_DLL ParticleFire : public ParticleSystemQuad { public: /** Create a fire particle system. @@ -70,13 +70,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles) override; private: - AX_DISALLOW_COPY_AND_ASSIGN(ParticleFire); + CC_DISALLOW_COPY_AND_ASSIGN(ParticleFire); }; /** @class ParticleFireworks * @brief A fireworks particle system. */ -class AX_DLL ParticleFireworks : public ParticleSystemQuad +class CC_DLL ParticleFireworks : public ParticleSystemQuad { public: /** Create a fireworks particle system. @@ -106,13 +106,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - AX_DISALLOW_COPY_AND_ASSIGN(ParticleFireworks); + CC_DISALLOW_COPY_AND_ASSIGN(ParticleFireworks); }; /** @class ParticleSun * @brief A sun particle system. */ -class AX_DLL ParticleSun : public ParticleSystemQuad +class CC_DLL ParticleSun : public ParticleSystemQuad { public: /** Create a sun particle system. @@ -142,13 +142,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - AX_DISALLOW_COPY_AND_ASSIGN(ParticleSun); + CC_DISALLOW_COPY_AND_ASSIGN(ParticleSun); }; /** @class ParticleGalaxy * @brief A galaxy particle system. */ -class AX_DLL ParticleGalaxy : public ParticleSystemQuad +class CC_DLL ParticleGalaxy : public ParticleSystemQuad { public: /** Create a galaxy particle system. @@ -178,13 +178,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - AX_DISALLOW_COPY_AND_ASSIGN(ParticleGalaxy); + CC_DISALLOW_COPY_AND_ASSIGN(ParticleGalaxy); }; /** @class ParticleFlower * @brief A flower particle system. */ -class AX_DLL ParticleFlower : public ParticleSystemQuad +class CC_DLL ParticleFlower : public ParticleSystemQuad { public: /** Create a flower particle system. @@ -214,13 +214,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - AX_DISALLOW_COPY_AND_ASSIGN(ParticleFlower); + CC_DISALLOW_COPY_AND_ASSIGN(ParticleFlower); }; /** @class ParticleMeteor * @brief A meteor particle system. */ -class AX_DLL ParticleMeteor : public ParticleSystemQuad +class CC_DLL ParticleMeteor : public ParticleSystemQuad { public: /** Create a meteor particle system. @@ -250,13 +250,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - AX_DISALLOW_COPY_AND_ASSIGN(ParticleMeteor); + CC_DISALLOW_COPY_AND_ASSIGN(ParticleMeteor); }; /** @class ParticleSpiral * @brief An spiral particle system. */ -class AX_DLL ParticleSpiral : public ParticleSystemQuad +class CC_DLL ParticleSpiral : public ParticleSystemQuad { public: /** Create a spiral particle system. @@ -286,13 +286,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - AX_DISALLOW_COPY_AND_ASSIGN(ParticleSpiral); + CC_DISALLOW_COPY_AND_ASSIGN(ParticleSpiral); }; /** @class ParticleExplosion * @brief An explosion particle system. */ -class AX_DLL ParticleExplosion : public ParticleSystemQuad +class CC_DLL ParticleExplosion : public ParticleSystemQuad { public: /** Create a explosion particle system. @@ -322,13 +322,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - AX_DISALLOW_COPY_AND_ASSIGN(ParticleExplosion); + CC_DISALLOW_COPY_AND_ASSIGN(ParticleExplosion); }; /** @class ParticleSmoke * @brief An smoke particle system. */ -class AX_DLL ParticleSmoke : public ParticleSystemQuad +class CC_DLL ParticleSmoke : public ParticleSystemQuad { public: /** Create a smoke particle system. @@ -358,13 +358,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - AX_DISALLOW_COPY_AND_ASSIGN(ParticleSmoke); + CC_DISALLOW_COPY_AND_ASSIGN(ParticleSmoke); }; /** @class ParticleSnow * @brief An snow particle system. */ -class AX_DLL ParticleSnow : public ParticleSystemQuad +class CC_DLL ParticleSnow : public ParticleSystemQuad { public: /** Create a snow particle system. @@ -394,13 +394,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - AX_DISALLOW_COPY_AND_ASSIGN(ParticleSnow); + CC_DISALLOW_COPY_AND_ASSIGN(ParticleSnow); }; /** @class ParticleRain * @brief A rain particle system. */ -class AX_DLL ParticleRain : public ParticleSystemQuad +class CC_DLL ParticleRain : public ParticleSystemQuad { public: /** Create a rain particle system. @@ -430,7 +430,7 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - AX_DISALLOW_COPY_AND_ASSIGN(ParticleRain); + CC_DISALLOW_COPY_AND_ASSIGN(ParticleRain); }; // end of _2d group diff --git a/core/2d/CCParticleSystem.cpp b/core/2d/CCParticleSystem.cpp index 5a540076d6..b5a0754405 100644 --- a/core/2d/CCParticleSystem.cpp +++ b/core/2d/CCParticleSystem.cpp @@ -147,47 +147,47 @@ bool ParticleData::init(int count) void ParticleData::release() { - AX_SAFE_FREE(posx); - AX_SAFE_FREE(posy); - AX_SAFE_FREE(startPosX); - AX_SAFE_FREE(startPosY); - AX_SAFE_FREE(colorR); - AX_SAFE_FREE(colorG); - AX_SAFE_FREE(colorB); - AX_SAFE_FREE(colorA); - AX_SAFE_FREE(deltaColorR); - AX_SAFE_FREE(deltaColorG); - AX_SAFE_FREE(deltaColorB); - AX_SAFE_FREE(deltaColorA); - AX_SAFE_FREE(hue); - AX_SAFE_FREE(sat); - AX_SAFE_FREE(val); - AX_SAFE_FREE(opacityFadeInDelta); - AX_SAFE_FREE(opacityFadeInLength); - AX_SAFE_FREE(scaleInDelta); - AX_SAFE_FREE(scaleInLength); - AX_SAFE_FREE(size); - AX_SAFE_FREE(deltaSize); - AX_SAFE_FREE(rotation); - AX_SAFE_FREE(staticRotation); - AX_SAFE_FREE(deltaRotation); - AX_SAFE_FREE(totalTimeToLive); - AX_SAFE_FREE(timeToLive); - AX_SAFE_FREE(animTimeLength); - AX_SAFE_FREE(animTimeDelta); - AX_SAFE_FREE(animIndex); - AX_SAFE_FREE(animCellIndex); - AX_SAFE_FREE(atlasIndex); + CC_SAFE_FREE(posx); + CC_SAFE_FREE(posy); + CC_SAFE_FREE(startPosX); + CC_SAFE_FREE(startPosY); + CC_SAFE_FREE(colorR); + CC_SAFE_FREE(colorG); + CC_SAFE_FREE(colorB); + CC_SAFE_FREE(colorA); + CC_SAFE_FREE(deltaColorR); + CC_SAFE_FREE(deltaColorG); + CC_SAFE_FREE(deltaColorB); + CC_SAFE_FREE(deltaColorA); + CC_SAFE_FREE(hue); + CC_SAFE_FREE(sat); + CC_SAFE_FREE(val); + CC_SAFE_FREE(opacityFadeInDelta); + CC_SAFE_FREE(opacityFadeInLength); + CC_SAFE_FREE(scaleInDelta); + CC_SAFE_FREE(scaleInLength); + CC_SAFE_FREE(size); + CC_SAFE_FREE(deltaSize); + CC_SAFE_FREE(rotation); + CC_SAFE_FREE(staticRotation); + CC_SAFE_FREE(deltaRotation); + CC_SAFE_FREE(totalTimeToLive); + CC_SAFE_FREE(timeToLive); + CC_SAFE_FREE(animTimeLength); + CC_SAFE_FREE(animTimeDelta); + CC_SAFE_FREE(animIndex); + CC_SAFE_FREE(animCellIndex); + CC_SAFE_FREE(atlasIndex); - AX_SAFE_FREE(modeA.dirX); - AX_SAFE_FREE(modeA.dirY); - AX_SAFE_FREE(modeA.radialAccel); - AX_SAFE_FREE(modeA.tangentialAccel); + CC_SAFE_FREE(modeA.dirX); + CC_SAFE_FREE(modeA.dirY); + CC_SAFE_FREE(modeA.radialAccel); + CC_SAFE_FREE(modeA.tangentialAccel); - AX_SAFE_FREE(modeB.angle); - AX_SAFE_FREE(modeB.degreesPerSecond); - AX_SAFE_FREE(modeB.deltaRadius); - AX_SAFE_FREE(modeB.radius); + CC_SAFE_FREE(modeB.angle); + CC_SAFE_FREE(modeB.degreesPerSecond); + CC_SAFE_FREE(modeB.deltaRadius); + CC_SAFE_FREE(modeB.radius); } Vector ParticleSystem::__allInstances; @@ -279,7 +279,7 @@ ParticleSystem* ParticleSystem::create(std::string_view plistFile) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return ret; } @@ -291,7 +291,7 @@ ParticleSystem* ParticleSystem::createWithTotalParticles(int numberOfParticles) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return ret; } @@ -321,10 +321,10 @@ bool ParticleSystem::allocAnimationMem() void ParticleSystem::deallocAnimationMem() { - AX_SAFE_FREE(_particleData.animTimeLength); - AX_SAFE_FREE(_particleData.animTimeDelta); - AX_SAFE_FREE(_particleData.animIndex); - AX_SAFE_FREE(_particleData.animCellIndex); + CC_SAFE_FREE(_particleData.animTimeLength); + CC_SAFE_FREE(_particleData.animTimeDelta); + CC_SAFE_FREE(_particleData.animIndex); + CC_SAFE_FREE(_particleData.animCellIndex); _isAnimAllocated = false; } @@ -346,9 +346,9 @@ bool ParticleSystem::allocHSVMem() void ParticleSystem::deallocHSVMem() { - AX_SAFE_FREE(_particleData.hue); - AX_SAFE_FREE(_particleData.sat); - AX_SAFE_FREE(_particleData.val); + CC_SAFE_FREE(_particleData.hue); + CC_SAFE_FREE(_particleData.sat); + CC_SAFE_FREE(_particleData.val); _isHSVAllocated = false; } @@ -369,8 +369,8 @@ bool ParticleSystem::allocOpacityFadeInMem() void ParticleSystem::deallocOpacityFadeInMem() { - AX_SAFE_FREE(_particleData.opacityFadeInDelta); - AX_SAFE_FREE(_particleData.opacityFadeInLength); + CC_SAFE_FREE(_particleData.opacityFadeInDelta); + CC_SAFE_FREE(_particleData.opacityFadeInLength); _isOpacityFadeInAllocated = false; } @@ -391,8 +391,8 @@ bool ParticleSystem::allocScaleInMem() void ParticleSystem::deallocScaleInMem() { - AX_SAFE_FREE(_particleData.scaleInDelta); - AX_SAFE_FREE(_particleData.scaleInLength); + CC_SAFE_FREE(_particleData.scaleInDelta); + CC_SAFE_FREE(_particleData.scaleInLength); _isScaleInAllocated = false; } @@ -574,7 +574,7 @@ bool ParticleSystem::initWithDictionary(const ValueMap& dictionary, std::string_ else { CCASSERT(false, "Invalid emitterType in config file"); - AX_BREAK_IF(true); + CC_BREAK_IF(true); } // life span @@ -639,19 +639,19 @@ bool ParticleSystem::initWithDictionary(const ValueMap& dictionary, std::string_ int decodeLen = base64Decode((unsigned char*)textureData.c_str(), (unsigned int)dataLen, &buffer); CCASSERT(buffer != nullptr, "CCParticleSystem: error decoding textureImageData"); - AX_BREAK_IF(!buffer); + CC_BREAK_IF(!buffer); unsigned char* deflated = nullptr; ssize_t deflatedLen = ZipUtils::inflateMemory(buffer, decodeLen, &deflated); CCASSERT(deflated != nullptr, "CCParticleSystem: error ungzipping textureImageData"); - AX_BREAK_IF(!deflated); + CC_BREAK_IF(!deflated); // For android, we should retain it in VolatileTexture::addImage which invoked in // Director::getInstance()->getTextureCache()->addUIImage() image = new Image(); bool isOK = image->initWithImageData(deflated, deflatedLen, true); CCASSERT(isOK, "CCParticleSystem: error init image with Data"); - AX_BREAK_IF(!isOK); + CC_BREAK_IF(!isOK); setTexture(_director->getTextureCache()->addImage(image, _plistFile + textureName)); @@ -712,7 +712,7 @@ bool ParticleSystem::initWithTotalParticles(int numberOfParticles) // Optimization: compile updateParticle method // updateParticleSel = @selector(updateQuadWithParticle:newPosition:); - // updateParticleImp = (AX_UPDATE_PARTICLE_IMP) [self methodForSelector:updateParticleSel]; + // updateParticleImp = (CC_UPDATE_PARTICLE_IMP) [self methodForSelector:updateParticleSel]; // for batchNode _transformSystemDirty = false; @@ -726,7 +726,7 @@ ParticleSystem::~ParticleSystem() // unscheduleUpdate(); _particleData.release(); _animations.clear(); - AX_SAFE_RELEASE(_texture); + CC_SAFE_RELEASE(_texture); } void ParticleSystem::addParticles(int count, int animationIndex, int animationCellIndex) @@ -798,7 +798,7 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe auto val = _rng.float01() * shape.innerRadius / shape.innerRadius; val = powf(val, 1 / shape.edgeBias); auto point = Vec2(0.0F, val * shape.innerRadius); - point = point.rotateByAngle(Vec2::ZERO, -AX_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef())); + point = point.rotateByAngle(Vec2::ZERO, -CC_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef())); _particleData.posx[i] = _sourcePosition.x + shape.x + point.x / 2; _particleData.posy[i] = _sourcePosition.y + shape.y + point.y / 2; @@ -809,7 +809,7 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe auto val = _rng.float01() * shape.outerRadius / shape.outerRadius; val = powf(val, 1 / shape.edgeBias); auto point = Vec2(0.0F, ((val * (shape.outerRadius - shape.innerRadius) + shape.outerRadius) - (shape.outerRadius - shape.innerRadius))); - point = point.rotateByAngle(Vec2::ZERO, -AX_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef())); + point = point.rotateByAngle(Vec2::ZERO, -CC_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef())); _particleData.posx[i] = _sourcePosition.x + shape.x + point.x / 2; _particleData.posy[i] = _sourcePosition.y + shape.y + point.y / 2; @@ -839,7 +839,7 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe point.x = point.x / size.x * overrideSize.x * scale.x; point.y = point.y / size.y * overrideSize.y * scale.y; - point = point.rotateByAngle(Vec2::ZERO, -AX_DEGREES_TO_RADIANS(angle)); + point = point.rotateByAngle(Vec2::ZERO, -CC_DEGREES_TO_RADIANS(angle)); _particleData.posx[i] = _sourcePosition.x + shape.x + point.x; _particleData.posy[i] = _sourcePosition.y + shape.y + point.y; @@ -1053,20 +1053,20 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe { for (int i = start; i < _particleCount; ++i) { - float a = AX_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef()); + float a = CC_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef()); Vec2 v(cosf(a), sinf(a)); float s = modeA.speed + modeA.speedVar * _rng.rangef(); Vec2 dir = v * s; _particleData.modeA.dirX[i] = dir.x; // v * s ; _particleData.modeA.dirY[i] = dir.y; - _particleData.rotation[i] = -AX_RADIANS_TO_DEGREES(dir.getAngle()); + _particleData.rotation[i] = -CC_RADIANS_TO_DEGREES(dir.getAngle()); } } else { for (int i = start; i < _particleCount; ++i) { - float a = AX_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef()); + float a = CC_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef()); Vec2 v(cosf(a), sinf(a)); float s = modeA.speed + modeA.speedVar * _rng.rangef(); Vec2 dir = v * s; @@ -1088,13 +1088,13 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe for (int i = start; i < _particleCount; ++i) { - _particleData.modeB.angle[i] = AX_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef()); + _particleData.modeB.angle[i] = CC_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef()); } for (int i = start; i < _particleCount; ++i) { _particleData.modeB.degreesPerSecond[i] = - AX_DEGREES_TO_RADIANS(modeB.rotatePerSecond + modeB.rotatePerSecondVar * _rng.rangef()); + CC_DEGREES_TO_RADIANS(modeB.rotatePerSecond + modeB.rotatePerSecondVar * _rng.rangef()); } if (modeB.endRadius == START_RADIUS_EQUAL_TO_END_RADIUS) @@ -1558,7 +1558,7 @@ void ParticleSystem::update(float dt) if (!_visible) return; - AX_PROFILER_START_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update"); + CC_PROFILER_START_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update"); if (_componentContainer && !_componentContainer->isEmpty()) { @@ -1572,7 +1572,7 @@ void ParticleSystem::update(float dt) { updateParticleQuads(); _transformSystemDirty = false; - AX_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update"); + CC_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update"); return; } dt = _fixedFPSDelta; @@ -1838,7 +1838,7 @@ void ParticleSystem::update(float dt) postStep(); } - AX_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update"); + CC_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update"); } void ParticleSystem::updateWithNoTime() @@ -1861,8 +1861,8 @@ void ParticleSystem::setTexture(Texture2D* var) { if (_texture != var) { - AX_SAFE_RETAIN(var); - AX_SAFE_RELEASE(_texture); + CC_SAFE_RETAIN(var); + CC_SAFE_RELEASE(_texture); _texture = var; updateBlendFunc(); } @@ -1878,7 +1878,7 @@ void ParticleSystem::updateBlendFunc() _opacityModifyRGB = false; - if (_texture && (_blendFunc.src == AX_BLEND_SRC && _blendFunc.dst == AX_BLEND_DST)) + if (_texture && (_blendFunc.src == CC_BLEND_SRC && _blendFunc.dst == CC_BLEND_DST)) { if (premultiplied) { diff --git a/core/2d/CCParticleSystem.h b/core/2d/CCParticleSystem.h index 46ef4c35d0..acb00b6ac6 100644 --- a/core/2d/CCParticleSystem.h +++ b/core/2d/CCParticleSystem.h @@ -103,7 +103,7 @@ struct ParticleFrameDescriptor bool isRotated; }; -class AX_DLL ParticleData +class CC_DLL ParticleData { public: float* posx; @@ -239,7 +239,7 @@ public: * Particle emission mask cache. * @since axis-1.0.0b8 */ -class AX_DLL ParticleEmissionMaskCache : public axis::Ref +class CC_DLL ParticleEmissionMaskCache : public axis::Ref { public: static ParticleEmissionMaskCache* getInstance(); @@ -306,7 +306,7 @@ private: }; -// typedef void (*AX_UPDATE_PARTICLE_IMP)(id, SEL, tParticle*, Vec2); +// typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tParticle*, Vec2); class Texture2D; @@ -354,7 +354,7 @@ emitter.startSpin = 0; @endcode */ -class AX_DLL ParticleSystem : public Node, public TextureProtocol, public PlayableProtocol +class CC_DLL ParticleSystem : public Node, public TextureProtocol, public PlayableProtocol { public: /** Mode @@ -1535,7 +1535,7 @@ protected: float _emitCounter; // Optimization - // AX_UPDATE_PARTICLE_IMP updateParticleImp; + // CC_UPDATE_PARTICLE_IMP updateParticleImp; // SEL updateParticleSel; /** weak reference to the SpriteBatchNode that renders the Sprite */ @@ -1684,7 +1684,7 @@ protected: FastRNG _rng; private: - AX_DISALLOW_COPY_AND_ASSIGN(ParticleSystem); + CC_DISALLOW_COPY_AND_ASSIGN(ParticleSystem); }; // end of _2d group diff --git a/core/2d/CCParticleSystemQuad.cpp b/core/2d/CCParticleSystemQuad.cpp index dfff526ed0..e83713ee21 100644 --- a/core/2d/CCParticleSystemQuad.cpp +++ b/core/2d/CCParticleSystemQuad.cpp @@ -83,11 +83,11 @@ ParticleSystemQuad::~ParticleSystemQuad() { if (nullptr == _batchNode) { - AX_SAFE_FREE(_quads); - AX_SAFE_FREE(_indices); + CC_SAFE_FREE(_quads); + CC_SAFE_FREE(_indices); } - AX_SAFE_RELEASE_NULL(_quadCommand.getPipelineDescriptor().programState); + CC_SAFE_RELEASE_NULL(_quadCommand.getPipelineDescriptor().programState); } // implementation ParticleSystemQuad @@ -100,7 +100,7 @@ ParticleSystemQuad* ParticleSystemQuad::create(std::string_view filename) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return ret; } @@ -116,7 +116,7 @@ ParticleSystemQuad* ParticleSystemQuad::createWithTotalParticles(int numberOfPar ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return ret; } @@ -128,7 +128,7 @@ ParticleSystemQuad* ParticleSystemQuad::create(ValueMap& dictionary) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return ret; } @@ -149,10 +149,10 @@ bool ParticleSystemQuad::initWithTotalParticles(int numberOfParticles) initIndices(); // setupVBO(); -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // Need to listen the event only when not use batchnode, because it will use VBO auto listener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, - AX_CALLBACK_1(ParticleSystemQuad::listenRendererRecreated, this)); + CC_CALLBACK_1(ParticleSystemQuad::listenRendererRecreated, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); #endif @@ -167,8 +167,8 @@ void ParticleSystemQuad::initTexCoordsWithRect(const Rect& pointRect) // convert to Tex coords Rect rect = - Rect(pointRect.origin.x * AX_CONTENT_SCALE_FACTOR(), pointRect.origin.y * AX_CONTENT_SCALE_FACTOR(), - pointRect.size.width * AX_CONTENT_SCALE_FACTOR(), pointRect.size.height * AX_CONTENT_SCALE_FACTOR()); + Rect(pointRect.origin.x * CC_CONTENT_SCALE_FACTOR(), pointRect.origin.y * CC_CONTENT_SCALE_FACTOR(), + pointRect.size.width * CC_CONTENT_SCALE_FACTOR(), pointRect.size.height * CC_CONTENT_SCALE_FACTOR()); float wide = (float)pointRect.size.width; float high = (float)pointRect.size.height; @@ -179,7 +179,7 @@ void ParticleSystemQuad::initTexCoordsWithRect(const Rect& pointRect) high = (float)_texture->getPixelsHigh(); } -#if AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL float left = (rect.origin.x * 2 + 1) / (wide * 2); float bottom = (rect.origin.y * 2 + 1) / (high * 2); float right = left + (rect.size.width * 2 - 2) / (wide * 2); @@ -189,7 +189,7 @@ void ParticleSystemQuad::initTexCoordsWithRect(const Rect& pointRect) float bottom = rect.origin.y / high; float right = left + rect.size.width / wide; float top = bottom + rect.size.height / high; -#endif // ! AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL // Important. Texture in cocos2d are inverted, so the Y component should be inverted std::swap(top, bottom); @@ -295,7 +295,7 @@ inline void updatePosWithParticle(V3F_C4B_T2F_Quad* quad, float x = newPosition.x; float y = newPosition.y; - float r = (float)-AX_DEGREES_TO_RADIANS(rotation + staticRotation); + float r = (float)-CC_DEGREES_TO_RADIANS(rotation + staticRotation); float cr = cosf(r); float sr = sinf(r); float ax = x1 * cr - y1 * sr + x; @@ -811,8 +811,8 @@ bool ParticleSystemQuad::allocMemory() { CCASSERT(!_batchNode, "Memory should not be alloced when not using batchNode"); - AX_SAFE_FREE(_quads); - AX_SAFE_FREE(_indices); + CC_SAFE_FREE(_quads); + CC_SAFE_FREE(_indices); _quads = (V3F_C4B_T2F_Quad*)malloc(_totalParticles * sizeof(V3F_C4B_T2F_Quad)); _indices = (unsigned short*)malloc(_totalParticles * 6 * sizeof(unsigned short)); @@ -820,8 +820,8 @@ bool ParticleSystemQuad::allocMemory() if (!_quads || !_indices) { CCLOG("cocos2d: Particle system: not enough memory"); - AX_SAFE_FREE(_quads); - AX_SAFE_FREE(_indices); + CC_SAFE_FREE(_quads); + CC_SAFE_FREE(_indices); return false; } @@ -856,8 +856,8 @@ void ParticleSystemQuad::setBatchNode(ParticleBatchNode* batchNode) V3F_C4B_T2F_Quad* quad = &(batchQuads[_atlasIndex]); memcpy(quad, _quads, _totalParticles * sizeof(_quads[0])); - AX_SAFE_FREE(_quads); - AX_SAFE_FREE(_indices); + CC_SAFE_FREE(_quads); + CC_SAFE_FREE(_indices); } } } @@ -870,7 +870,7 @@ ParticleSystemQuad* ParticleSystemQuad::create() particleSystemQuad->autorelease(); return particleSystemQuad; } - AX_SAFE_DELETE(particleSystemQuad); + CC_SAFE_DELETE(particleSystemQuad); return nullptr; } diff --git a/core/2d/CCParticleSystemQuad.h b/core/2d/CCParticleSystemQuad.h index 6ee53372f9..a84eb4c3a0 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 AX_DLL ParticleSystemQuad : public ParticleSystem +class CC_DLL ParticleSystemQuad : public ParticleSystem { public: /** Creates a Particle Emitter. @@ -176,7 +176,7 @@ protected: backend::UniformLocation _textureLocation; private: - AX_DISALLOW_COPY_AND_ASSIGN(ParticleSystemQuad); + CC_DISALLOW_COPY_AND_ASSIGN(ParticleSystemQuad); }; // end of _2d group diff --git a/core/2d/CCPlistSpriteSheetLoader.cpp b/core/2d/CCPlistSpriteSheetLoader.cpp index b7415db851..af98e06652 100644 --- a/core/2d/CCPlistSpriteSheetLoader.cpp +++ b/core/2d/CCPlistSpriteSheetLoader.cpp @@ -317,7 +317,7 @@ void PlistSpriteSheetLoader::addSpriteFramesWithDictionary(ValueMap& dictionary, spriteSheet->full = true; - AX_SAFE_DELETE(image); + CC_SAFE_DELETE(image); } void PlistSpriteSheetLoader::addSpriteFramesWithDictionary(ValueMap& dict, diff --git a/core/2d/CCProgressTimer.cpp b/core/2d/CCProgressTimer.cpp index 6a0e30279e..c1adb585b6 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); - AX_SAFE_RELEASE(pipelieDescriptor.programState); + CC_SAFE_RELEASE(pipelieDescriptor.programState); pipelieDescriptor.programState = programState; // set vertexLayout according to V2F_C4B_T2F structure @@ -117,7 +117,7 @@ bool ProgressTimer::initWithSprite(Sprite* sp) setSprite(sp); // TODO: Use ProgramState Vector to Node - AX_SAFE_RELEASE(_programState2); + CC_SAFE_RELEASE(_programState2); setProgramState(initPipelineDescriptor(_customCommand, true, _locMVP1, _locTex1), false); _programState2 = initPipelineDescriptor(_customCommand2, false, _locMVP2, _locTex2); @@ -126,8 +126,8 @@ bool ProgressTimer::initWithSprite(Sprite* sp) ProgressTimer::~ProgressTimer() { - AX_SAFE_RELEASE(_sprite); - AX_SAFE_RELEASE(_programState2); + CC_SAFE_RELEASE(_sprite); + CC_SAFE_RELEASE(_programState2); } void ProgressTimer::setPercentage(float percentage) @@ -143,7 +143,7 @@ void ProgressTimer::setSprite(Sprite* sprite) { if (_sprite != sprite) { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -152,9 +152,9 @@ void ProgressTimer::setSprite(Sprite* sprite) if (sprite) sEngine->retainScriptObject(this, sprite); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS - AX_SAFE_RETAIN(sprite); - AX_SAFE_RELEASE(_sprite); +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS + CC_SAFE_RETAIN(sprite); + CC_SAFE_RELEASE(_sprite); _sprite = sprite; setContentSize(_sprite->getContentSize()); diff --git a/core/2d/CCProgressTimer.h b/core/2d/CCProgressTimer.h index 073f44b123..ff2591db31 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 AX_DLL ProgressTimer : public Node +class CC_DLL ProgressTimer : public Node { public: /** Types of progress @@ -201,7 +201,7 @@ protected: backend::UniformLocation _locTex2; private: - AX_DISALLOW_COPY_AND_ASSIGN(ProgressTimer); + CC_DISALLOW_COPY_AND_ASSIGN(ProgressTimer); }; // end of misc_nodes group diff --git a/core/2d/CCProtectedNode.cpp b/core/2d/CCProtectedNode.cpp index ab18a6cfa0..728e13977b 100644 --- a/core/2d/CCProtectedNode.cpp +++ b/core/2d/CCProtectedNode.cpp @@ -51,7 +51,7 @@ ProtectedNode* ProtectedNode::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -141,7 +141,7 @@ void ProtectedNode::removeProtectedChild(axis::Node* child, bool cleanup) } ssize_t index = _protectedChildren.getIndex(child); - if (index != AX_INVALID_INDEX) + if (index != CC_INVALID_INDEX) { // IMPORTANT: @@ -163,13 +163,13 @@ void ProtectedNode::removeProtectedChild(axis::Node* child, bool cleanup) // set parent nil at the end child->setParent(nullptr); -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, child); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _protectedChildren.erase(index); } } @@ -197,13 +197,13 @@ void ProtectedNode::removeAllProtectedChildrenWithCleanup(bool cleanup) { child->cleanup(); } -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, child); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS // set parent nil at the end child->setParent(nullptr); } @@ -230,13 +230,13 @@ void ProtectedNode::removeProtectedChildByTag(int tag, bool cleanup) // helper used by reorderChild & add void ProtectedNode::insertProtectedChild(axis::Node* child, int z) { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, child); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _reorderProtectedChildDirty = true; _protectedChildren.pushBack(child); child->setLocalZOrder(z); diff --git a/core/2d/CCProtectedNode.h b/core/2d/CCProtectedNode.h index 76fd415be9..8259da729d 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 AX_DLL ProtectedNode : public Node +class CC_DLL ProtectedNode : public Node { public: /** @@ -199,7 +199,7 @@ protected: bool _reorderProtectedChildDirty; private: - AX_DISALLOW_COPY_AND_ASSIGN(ProtectedNode); + CC_DISALLOW_COPY_AND_ASSIGN(ProtectedNode); }; // end of 2d group diff --git a/core/2d/CCRenderTexture.cpp b/core/2d/CCRenderTexture.cpp index 14da71e21b..d56e10d399 100644 --- a/core/2d/CCRenderTexture.cpp +++ b/core/2d/CCRenderTexture.cpp @@ -45,39 +45,39 @@ NS_AX_BEGIN // implementation RenderTexture RenderTexture::RenderTexture() { -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // Listen this event to save render texture before come to background. // Then it can be restored after coming to foreground on Android. auto toBackgroundListener = - EventListenerCustom::create(EVENT_COME_TO_BACKGROUND, AX_CALLBACK_1(RenderTexture::listenToBackground, this)); + EventListenerCustom::create(EVENT_COME_TO_BACKGROUND, CC_CALLBACK_1(RenderTexture::listenToBackground, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(toBackgroundListener, this); auto toForegroundListener = - EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, AX_CALLBACK_1(RenderTexture::listenToForeground, this)); + EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(RenderTexture::listenToForeground, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(toForegroundListener, this); #endif } RenderTexture::~RenderTexture() { - AX_SAFE_RELEASE(_renderTarget); - AX_SAFE_RELEASE(_sprite); - AX_SAFE_RELEASE(_depthStencilTexture); - AX_SAFE_RELEASE(_UITextureImage); + CC_SAFE_RELEASE(_renderTarget); + CC_SAFE_RELEASE(_sprite); + CC_SAFE_RELEASE(_depthStencilTexture); + CC_SAFE_RELEASE(_UITextureImage); } void RenderTexture::listenToBackground(EventCustom* /*event*/) { // We have not found a way to dispatch the enter background message before the texture data are destroyed. // So we disable this pair of message handler at present. -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // to get the rendered texture data auto func = [&](Image* uiTextureImage) { if (uiTextureImage) { - AX_SAFE_RELEASE(_UITextureImage); + CC_SAFE_RELEASE(_UITextureImage); _UITextureImage = uiTextureImage; - AX_SAFE_RETAIN(_UITextureImage); + CC_SAFE_RETAIN(_UITextureImage); const Vec2& s = _texture2D->getContentSizeInPixels(); VolatileTextureMgr::addDataTexture(_texture2D, uiTextureImage->getData(), s.width * s.height * 4, backend::PixelFormat::RGBA8, s); @@ -86,7 +86,7 @@ void RenderTexture::listenToBackground(EventCustom* /*event*/) { CCLOG("Cache rendertexture failed!"); } - AX_SAFE_RELEASE(uiTextureImage); + CC_SAFE_RELEASE(uiTextureImage); }; auto callback = std::bind(func, std::placeholders::_1); newImage(callback, false); @@ -96,7 +96,7 @@ void RenderTexture::listenToBackground(EventCustom* /*event*/) void RenderTexture::listenToForeground(EventCustom* /*event*/) { -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA const Vec2& s = _texture2D->getContentSizeInPixels(); // TODO new-renderer: field _depthAndStencilFormat removal // if (_depthAndStencilFormat != 0) @@ -117,7 +117,7 @@ RenderTexture* RenderTexture::create(int w, int h, backend::PixelFormat eFormat, ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -130,7 +130,7 @@ RenderTexture* RenderTexture::create(int w, int h, backend::PixelFormat eFormat, ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -143,7 +143,7 @@ RenderTexture* RenderTexture::create(int w, int h, bool sharedRenderTarget) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -164,8 +164,8 @@ bool RenderTexture::initWithWidthAndHeight(int w, do { _fullRect = _rtTextureRect = Rect(0, 0, w, h); - w = (int)(w * AX_CONTENT_SCALE_FACTOR()); - h = (int)(h * AX_CONTENT_SCALE_FACTOR()); + w = (int)(w * CC_CONTENT_SCALE_FACTOR()); + h = (int)(h * CC_CONTENT_SCALE_FACTOR()); _fullviewPort = Rect(0, 0, w, h); // textures must be power of two squared @@ -189,7 +189,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, descriptor.textureUsage = TextureUsage::RENDER_TARGET; descriptor.textureFormat = PixelFormat::RGBA8; _texture2D = new Texture2D(); - _texture2D->updateTextureDescriptor(descriptor, !!AX_ENABLE_PREMULTIPLIED_ALPHA); + _texture2D->updateTextureDescriptor(descriptor, !!CC_ENABLE_PREMULTIPLIED_ALPHA); _renderTargetFlags = RenderTargetFlag::COLOR; if (PixelFormat::D24S8 == depthStencilFormat) @@ -201,7 +201,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, _depthStencilTexture->updateTextureDescriptor(descriptor); } - AX_SAFE_RELEASE(_renderTarget); + CC_SAFE_RELEASE(_renderTarget); if (sharedRenderTarget) { @@ -229,7 +229,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, // retained setSprite(Sprite::createWithTexture(_texture2D)); -#if defined(AX_USE_GL) || defined(AX_USE_GLES) +#if defined(CC_USE_GL) || defined(CC_USE_GLES) _sprite->setFlippedY(true); #endif @@ -260,7 +260,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, void RenderTexture::setSprite(Sprite* sprite) { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -269,9 +269,9 @@ void RenderTexture::setSprite(Sprite* sprite) if (_sprite) sEngine->releaseScriptObject(this, _sprite); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS - AX_SAFE_RETAIN(sprite); - AX_SAFE_RELEASE(_sprite); +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS + CC_SAFE_RETAIN(sprite); + CC_SAFE_RELEASE(_sprite); _sprite = sprite; } @@ -430,7 +430,7 @@ bool RenderTexture::saveToFileAsNonPMA(std::string_view fileName, auto renderer = _director->getRenderer(); auto saveToFileCommand = renderer->nextCallbackCommand(); saveToFileCommand->init(_globalZOrder); - saveToFileCommand->func = AX_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, true); + saveToFileCommand->func = CC_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, true); renderer->addCommand(saveToFileCommand); return true; @@ -453,7 +453,7 @@ bool RenderTexture::saveToFile(std::string_view fileName, auto renderer = _director->getRenderer(); auto saveToFileCommand = renderer->nextCallbackCommand(); saveToFileCommand->init(_globalZOrder); - saveToFileCommand->func = AX_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, false); + saveToFileCommand->func = CC_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, false); _director->getRenderer()->addCommand(saveToFileCommand); return true; @@ -619,7 +619,7 @@ void RenderTexture::begin() auto beginCommand = renderer->nextCallbackCommand(); beginCommand->init(_globalZOrder); - beginCommand->func = AX_CALLBACK_0(RenderTexture::onBegin, this); + beginCommand->func = CC_CALLBACK_0(RenderTexture::onBegin, this); renderer->addCommand(beginCommand); } @@ -629,7 +629,7 @@ void RenderTexture::end() auto endCommand = renderer->nextCallbackCommand(); endCommand->init(_globalZOrder); - endCommand->func = AX_CALLBACK_0(RenderTexture::onEnd, this); + endCommand->func = CC_CALLBACK_0(RenderTexture::onEnd, this); renderer->addCommand(endCommand); renderer->popGroup(); diff --git a/core/2d/CCRenderTexture.h b/core/2d/CCRenderTexture.h index e90f494582..6137342dcc 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 AX_DLL RenderTexture : public Node +class CC_DLL RenderTexture : public Node { public: using SaveFileCallbackType = std::function; @@ -430,7 +430,7 @@ protected: Mat4 _transformMatrix, _projectionMatrix; private: - AX_DISALLOW_COPY_AND_ASSIGN(RenderTexture); + CC_DISALLOW_COPY_AND_ASSIGN(RenderTexture); }; // end of textures group diff --git a/core/2d/CCScene.cpp b/core/2d/CCScene.cpp index 8c70db3621..7b547d97d5 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 AX_USE_PHYSICS +#if CC_USE_PHYSICS # include "physics/CCPhysicsWorld.h" #endif -#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION # include "physics3d/CCPhysics3DWorld.h" # include "physics3d/CCPhysics3DComponent.h" #endif -#if AX_USE_NAVMESH +#if CC_USE_NAVMESH # include "navmesh/CCNavMesh.h" #endif @@ -64,36 +64,36 @@ Scene::Scene() Scene::~Scene() { -#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION - AX_SAFE_RELEASE(_physics3DWorld); - AX_SAFE_RELEASE(_physics3dDebugCamera); +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION + CC_SAFE_RELEASE(_physics3DWorld); + CC_SAFE_RELEASE(_physics3dDebugCamera); #endif -#if AX_USE_NAVMESH - AX_SAFE_RELEASE(_navMesh); +#if CC_USE_NAVMESH + CC_SAFE_RELEASE(_navMesh); #endif _director->getEventDispatcher()->removeEventListener(_event); - AX_SAFE_RELEASE(_event); + CC_SAFE_RELEASE(_event); -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS delete _physicsWorld; #endif -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseAllChildrenRecursive(this); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS } -#if AX_USE_NAVMESH +#if CC_USE_NAVMESH void Scene::setNavMesh(NavMesh* navMesh) { if (_navMesh != navMesh) { - AX_SAFE_RETAIN(navMesh); - AX_SAFE_RELEASE(_navMesh); + CC_SAFE_RETAIN(navMesh); + CC_SAFE_RELEASE(_navMesh); _navMesh = navMesh; } } @@ -131,7 +131,7 @@ Scene* Scene::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } } @@ -146,7 +146,7 @@ Scene* Scene::createWithSize(const Vec2& size) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } } @@ -215,7 +215,7 @@ void Scene::render(Renderer* renderer, const Mat4& eyeTransform, const Mat4* eye camera->clearBackground(); // visit the scene visit(renderer, transform, 0); -#if AX_USE_NAVMESH +#if CC_USE_NAVMESH if (_navMesh && _navMeshDebugCamera == camera) { _navMesh->debugDraw(renderer); @@ -231,7 +231,7 @@ void Scene::render(Renderer* renderer, const Mat4& eyeTransform, const Mat4* eye // camera->setNodeToParentTransform(eyeCopy); } -#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION if (_physics3DWorld && _physics3DWorld->isDebugDrawEnabled()) { Camera* physics3dDebugCamera = _physics3dDebugCamera != nullptr ? _physics3dDebugCamera : defaultCamera; @@ -272,26 +272,26 @@ void Scene::removeAllChildren() } } -#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION void Scene::setPhysics3DDebugCamera(Camera* camera) { - AX_SAFE_RETAIN(camera); - AX_SAFE_RELEASE(_physics3dDebugCamera); + CC_SAFE_RETAIN(camera); + CC_SAFE_RELEASE(_physics3dDebugCamera); _physics3dDebugCamera = camera; } #endif -#if AX_USE_NAVMESH +#if CC_USE_NAVMESH void Scene::setNavMeshDebugCamera(Camera* camera) { - AX_SAFE_RETAIN(camera); - AX_SAFE_RELEASE(_navMeshDebugCamera); + CC_SAFE_RETAIN(camera); + CC_SAFE_RELEASE(_navMeshDebugCamera); _navMeshDebugCamera = camera; } #endif -#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION)) +#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION)) Scene* Scene::createWithPhysics() { @@ -303,7 +303,7 @@ Scene* Scene::createWithPhysics() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } } @@ -316,7 +316,7 @@ bool Scene::initWithPhysics() bool Scene::initPhysicsWorld() { -# if AX_USE_PHYSICS +# if CC_USE_PHYSICS _physicsWorld = PhysicsWorld::construct(this); # endif @@ -325,9 +325,9 @@ bool Scene::initPhysicsWorld() { this->setContentSize(_director->getWinSize()); -# if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +# if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION Physics3DWorldDes info; - AX_BREAK_IF(!(_physics3DWorld = Physics3DWorld::create(&info))); + CC_BREAK_IF(!(_physics3DWorld = Physics3DWorld::create(&info))); _physics3DWorld->retain(); # endif @@ -339,21 +339,21 @@ bool Scene::initPhysicsWorld() #endif -#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION) || AX_USE_NAVMESH) +#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION) || CC_USE_NAVMESH) void Scene::stepPhysicsAndNavigation(float deltaTime) { -# if AX_USE_PHYSICS +# if CC_USE_PHYSICS if (_physicsWorld && _physicsWorld->isAutoStep()) _physicsWorld->update(deltaTime); # endif -# if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +# if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION if (_physics3DWorld) { _physics3DWorld->stepSimulate(deltaTime); } # endif -# if AX_USE_NAVMESH +# if CC_USE_NAVMESH if (_navMesh) { _navMesh->update(deltaTime); diff --git a/core/2d/CCScene.h b/core/2d/CCScene.h index d22e7da1b5..47d7967282 100644 --- a/core/2d/CCScene.h +++ b/core/2d/CCScene.h @@ -40,13 +40,13 @@ class BaseLight; class Renderer; class EventListenerCustom; class EventCustom; -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS class PhysicsWorld; #endif -#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION class Physics3DWorld; #endif -#if AX_USE_NAVMESH +#if CC_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 AX_DLL Scene : public Node +class CC_DLL Scene : public Node { public: /** Creates a new Scene object. @@ -151,11 +151,11 @@ protected: std::vector _lights; private: - AX_DISALLOW_COPY_AND_ASSIGN(Scene); + CC_DISALLOW_COPY_AND_ASSIGN(Scene); -#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION)) +#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION)) public: -# if AX_USE_PHYSICS +# if CC_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 AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +# if CC_USE_3D_PHYSICS && CC_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 AX_USE_PHYSICS +# if CC_USE_PHYSICS PhysicsWorld* _physicsWorld = nullptr; # endif -# if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +# if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION Physics3DWorld* _physics3DWorld = nullptr; Camera* _physics3dDebugCamera = nullptr; # endif -#endif // (AX_USE_PHYSICS || AX_USE_3D_PHYSICS) +#endif // (CC_USE_PHYSICS || CC_USE_3D_PHYSICS) -#if AX_USE_NAVMESH +#if CC_USE_NAVMESH public: /** set navigation mesh */ void setNavMesh(NavMesh* navMesh); @@ -215,7 +215,7 @@ protected: Camera* _navMeshDebugCamera = nullptr; #endif -#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION) || AX_USE_NAVMESH) +#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION) || CC_USE_NAVMESH) public: void stepPhysicsAndNavigation(float deltaTime); #endif diff --git a/core/2d/CCSprite.cpp b/core/2d/CCSprite.cpp index 89ec39279e..e09e8f6aa4 100644 --- a/core/2d/CCSprite.cpp +++ b/core/2d/CCSprite.cpp @@ -57,7 +57,7 @@ Sprite* Sprite::createWithTexture(Texture2D* texture) sprite->autorelease(); return sprite; } - AX_SAFE_DELETE(sprite); + CC_SAFE_DELETE(sprite); return nullptr; } @@ -69,7 +69,7 @@ Sprite* Sprite::createWithTexture(Texture2D* texture, const Rect& rect, bool rot sprite->autorelease(); return sprite; } - AX_SAFE_DELETE(sprite); + CC_SAFE_DELETE(sprite); return nullptr; } @@ -86,7 +86,7 @@ Sprite* Sprite::create(std::string_view filename, PixelFormat format) sprite->autorelease(); return sprite; } - AX_SAFE_DELETE(sprite); + CC_SAFE_DELETE(sprite); return nullptr; } @@ -98,7 +98,7 @@ Sprite* Sprite::create(const PolygonInfo& info) sprite->autorelease(); return sprite; } - AX_SAFE_DELETE(sprite); + CC_SAFE_DELETE(sprite); return nullptr; } @@ -110,7 +110,7 @@ Sprite* Sprite::create(std::string_view filename, const Rect& rect) sprite->autorelease(); return sprite; } - AX_SAFE_DELETE(sprite); + CC_SAFE_DELETE(sprite); return nullptr; } @@ -122,7 +122,7 @@ Sprite* Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame) sprite->autorelease(); return sprite; } - AX_SAFE_DELETE(sprite); + CC_SAFE_DELETE(sprite); return nullptr; } @@ -147,7 +147,7 @@ Sprite* Sprite::create() sprite->autorelease(); return sprite; } - AX_SAFE_DELETE(sprite); + CC_SAFE_DELETE(sprite); return nullptr; } @@ -307,18 +307,18 @@ bool Sprite::initWithTexture(Texture2D* texture, const Rect& rect, bool rotated) Sprite::Sprite() { -#if AX_SPRITE_DEBUG_DRAW +#if CC_SPRITE_DEBUG_DRAW _debugDrawNode = DrawNode::create(); addChild(_debugDrawNode); -#endif // AX_SPRITE_DEBUG_DRAW +#endif // CC_SPRITE_DEBUG_DRAW } Sprite::~Sprite() { - AX_SAFE_FREE(_trianglesVertex); - AX_SAFE_FREE(_trianglesIndex); - AX_SAFE_RELEASE(_spriteFrame); - AX_SAFE_RELEASE(_texture); + CC_SAFE_FREE(_trianglesVertex); + CC_SAFE_FREE(_trianglesIndex); + CC_SAFE_RELEASE(_spriteFrame); + CC_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 AX_2x2_WHITE_IMAGE_KEY "/cc_2x2_white_image" +#define CC_2x2_WHITE_IMAGE_KEY "/cc_2x2_white_image" // MARK: texture void Sprite::setTexture(std::string_view filename) @@ -409,17 +409,17 @@ void Sprite::setTexture(Texture2D* texture) if (texture == nullptr) { // Gets the texture by key firstly. - texture = _director->getTextureCache()->getTextureForKey(AX_2x2_WHITE_IMAGE_KEY); + texture = _director->getTextureCache()->getTextureForKey(CC_2x2_WHITE_IMAGE_KEY); // If texture wasn't in cache, create it from RAW data. if (texture == nullptr) { Image* image = new Image(); - bool AX_UNUSED isOK = image->initWithRawData(cc_2x2_white_image, sizeof(cc_2x2_white_image), 2, 2, 8); + 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."); - texture = _director->getTextureCache()->addImage(image, AX_2x2_WHITE_IMAGE_KEY); - AX_SAFE_RELEASE(image); + texture = _director->getTextureCache()->addImage(image, CC_2x2_WHITE_IMAGE_KEY); + CC_SAFE_RELEASE(image); } } @@ -431,8 +431,8 @@ void Sprite::setTexture(Texture2D* texture) { if (_texture != texture) { - AX_SAFE_RETAIN(texture); - AX_SAFE_RELEASE(_texture); + CC_SAFE_RETAIN(texture); + CC_SAFE_RELEASE(_texture); _texture = texture; } updateBlendFunc(); @@ -817,7 +817,7 @@ void Sprite::setTextureCoords(const Rect& rectInPoints, V3F_C4B_T2F_Quad* outQua if (tex == nullptr) return; - const auto rectInPixels = AX_RECT_POINTS_TO_PIXELS(rectInPoints); + const auto rectInPixels = CC_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 AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#if CC_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 // AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#endif // CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL if ((!_rectRotated && _flippedX) || (_rectRotated && _flippedY)) std::swap(left, right); @@ -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 AX_USE_CULLING +#if CC_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 AX_SPRITE_DEBUG_DRAW +#if CC_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 // AX_SPRITE_DEBUG_DRAW +#endif // CC_SPRITE_DEBUG_DRAW } } @@ -1316,7 +1316,7 @@ void Sprite::setScaleX(float scaleX) void Sprite::setScaleY(float scaleY) { -#ifdef AX_USE_METAL +#ifdef CC_USE_METAL if (_texture->isRenderTarget()) scaleY = std::abs(scaleY); #endif @@ -1445,7 +1445,7 @@ bool Sprite::isFlippedX() const void Sprite::setFlippedY(bool flippedY) { -#ifdef AX_USE_METAL +#ifdef CC_USE_METAL if (_texture->isRenderTarget()) flippedY = !flippedY; #endif @@ -1570,7 +1570,7 @@ void Sprite::setSpriteFrame(SpriteFrame* spriteFrame) // do not removed by SpriteFrameCache::removeUnusedSpriteFrames if (_spriteFrame != spriteFrame) { - AX_SAFE_RELEASE(_spriteFrame); + CC_SAFE_RELEASE(_spriteFrame); _spriteFrame = spriteFrame; spriteFrame->retain(); } @@ -1631,9 +1631,9 @@ SpriteFrame* Sprite::getSpriteFrame() const if (nullptr != this->_spriteFrame) return this->_spriteFrame; - return SpriteFrame::createWithTexture(_texture, AX_RECT_POINTS_TO_PIXELS(_rect), _rectRotated, - AX_POINT_POINTS_TO_PIXELS(_unflippedOffsetPositionFromCenter), - AX_SIZE_POINTS_TO_PIXELS(_originalContentSize)); + return SpriteFrame::createWithTexture(_texture, CC_RECT_POINTS_TO_PIXELS(_rect), _rectRotated, + CC_POINT_POINTS_TO_PIXELS(_unflippedOffsetPositionFromCenter), + CC_SIZE_POINTS_TO_PIXELS(_originalContentSize)); } SpriteBatchNode* Sprite::getBatchNode() const diff --git a/core/2d/CCSprite.h b/core/2d/CCSprite.h index d0062fcd34..0b30510d35 100644 --- a/core/2d/CCSprite.h +++ b/core/2d/CCSprite.h @@ -52,7 +52,7 @@ struct transformValues_; # undef SPRITE_RENDER_IN_SUBPIXEL #endif -#if AX_SPRITEBATCHNODE_RENDER_SUBPIXEL +#if CC_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 AX_DLL Sprite : public Node, public TextureProtocol +class CC_DLL Sprite : public Node, public TextureProtocol { public: enum class RenderMode @@ -660,9 +660,9 @@ protected: TrianglesCommand _trianglesCommand; backend::UniformLocation _mvpMatrixLocation; -#if AX_SPRITE_DEBUG_DRAW +#if CC_SPRITE_DEBUG_DRAW DrawNode* _debugDrawNode = nullptr; -#endif // AX_SPRITE_DEBUG_DRAW +#endif // CC_SPRITE_DEBUG_DRAW // // Shared data // @@ -702,7 +702,7 @@ protected: bool _stretchEnabled = true; private: - AX_DISALLOW_COPY_AND_ASSIGN(Sprite); + CC_DISALLOW_COPY_AND_ASSIGN(Sprite); }; // end of sprite_nodes group diff --git a/core/2d/CCSpriteBatchNode.cpp b/core/2d/CCSpriteBatchNode.cpp index d0d6e43ae1..e459a776d1 100644 --- a/core/2d/CCSpriteBatchNode.cpp +++ b/core/2d/CCSpriteBatchNode.cpp @@ -178,14 +178,14 @@ SpriteBatchNode::SpriteBatchNode() {} SpriteBatchNode::~SpriteBatchNode() { - AX_SAFE_RELEASE(_textureAtlas); + CC_SAFE_RELEASE(_textureAtlas); } // override visit // don't call visit on it's children void SpriteBatchNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t parentFlags) { - AX_PROFILER_START_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); + CC_PROFILER_START_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); // CAREFUL: // This visit is almost identical to CocosNode#visit @@ -218,7 +218,7 @@ void SpriteBatchNode::visit(Renderer* renderer, const Mat4& parentTransform, uin // Please refer to https://github.com/cocos2d/cocos2d-x/pull/6920 // setOrderOfArrival(0); - AX_PROFILER_STOP_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); + CC_PROFILER_STOP_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); } } @@ -629,8 +629,8 @@ void SpriteBatchNode::appendChild(Sprite* sprite) for (auto iter = children.begin(); iter != children.end();) { auto child = *iter; -#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 +#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 // as children in SpriteBatchNode // Github issue #14730 if (dynamic_cast(child)) diff --git a/core/2d/CCSpriteBatchNode.h b/core/2d/CCSpriteBatchNode.h index c22d33d3a6..4cd189adf6 100644 --- a/core/2d/CCSpriteBatchNode.h +++ b/core/2d/CCSpriteBatchNode.h @@ -62,7 +62,7 @@ class Sprite; * * @since v0.7.1 */ -class AX_DLL SpriteBatchNode : public Node, public TextureProtocol +class CC_DLL SpriteBatchNode : public Node, public TextureProtocol { static const int DEFAULT_CAPACITY = 29; @@ -100,8 +100,8 @@ public: { if (textureAtlas != _textureAtlas) { - AX_SAFE_RETAIN(textureAtlas); - AX_SAFE_RELEASE(_textureAtlas); + CC_SAFE_RETAIN(textureAtlas); + CC_SAFE_RELEASE(_textureAtlas); _textureAtlas = textureAtlas; } } diff --git a/core/2d/CCSpriteFrame.cpp b/core/2d/CCSpriteFrame.cpp index c162563da3..6a31ea18cc 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 = AX_RECT_POINTS_TO_PIXELS(rect); + Rect rectInPixels = CC_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 = AX_RECT_POINTS_TO_PIXELS(rect); + Rect rectInPixels = CC_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 = AX_RECT_PIXELS_TO_POINTS(rect); + _rect = CC_RECT_PIXELS_TO_POINTS(rect); _offsetInPixels = offset; - _offset = AX_POINT_PIXELS_TO_POINTS(_offsetInPixels); + _offset = CC_POINT_PIXELS_TO_POINTS(_offsetInPixels); _originalSizeInPixels = originalSize; - _originalSize = AX_SIZE_PIXELS_TO_POINTS(_originalSizeInPixels); + _originalSize = CC_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 = AX_RECT_PIXELS_TO_POINTS(rect); + _rect = CC_RECT_PIXELS_TO_POINTS(rect); _offsetInPixels = offset; - _offset = AX_POINT_PIXELS_TO_POINTS(_offsetInPixels); + _offset = CC_POINT_PIXELS_TO_POINTS(_offsetInPixels); _originalSizeInPixels = originalSize; - _originalSize = AX_SIZE_PIXELS_TO_POINTS(_originalSizeInPixels); + _originalSize = CC_SIZE_PIXELS_TO_POINTS(_originalSizeInPixels); _rotated = rotated; _anchorPoint = Vec2(NAN, NAN); _centerRect = Rect(NAN, NAN, NAN, NAN); @@ -153,7 +153,7 @@ bool SpriteFrame::initWithTextureFilename(std::string_view filename, SpriteFrame::~SpriteFrame() { CCLOGINFO("deallocing SpriteFrame: %p", this); - AX_SAFE_RELEASE(_texture); + CC_SAFE_RELEASE(_texture); } SpriteFrame* SpriteFrame::clone() const @@ -169,18 +169,18 @@ SpriteFrame* SpriteFrame::clone() const void SpriteFrame::setRect(const Rect& rect) { _rect = rect; - _rectInPixels = AX_RECT_POINTS_TO_PIXELS(_rect); + _rectInPixels = CC_RECT_POINTS_TO_PIXELS(_rect); } void SpriteFrame::setRectInPixels(const Rect& rectInPixels) { _rectInPixels = rectInPixels; - _rect = AX_RECT_PIXELS_TO_POINTS(rectInPixels); + _rect = CC_RECT_PIXELS_TO_POINTS(rectInPixels); } void SpriteFrame::setCenterRectInPixels(const Rect& centerRect) { - _centerRect = AX_RECT_PIXELS_TO_POINTS(centerRect); + _centerRect = CC_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 = AX_POINT_POINTS_TO_PIXELS(_offset); + _offsetInPixels = CC_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 = AX_POINT_PIXELS_TO_POINTS(_offsetInPixels); + _offset = CC_POINT_PIXELS_TO_POINTS(_offsetInPixels); } const Vec2& SpriteFrame::getAnchorPoint() const @@ -229,8 +229,8 @@ void SpriteFrame::setTexture(Texture2D* texture) { if (_texture != texture) { - AX_SAFE_RELEASE(_texture); - AX_SAFE_RETAIN(texture); + CC_SAFE_RELEASE(_texture); + CC_SAFE_RETAIN(texture); _texture = texture; } } diff --git a/core/2d/CCSpriteFrame.h b/core/2d/CCSpriteFrame.h index efeb30a3f0..77b460bd96 100644 --- a/core/2d/CCSpriteFrame.h +++ b/core/2d/CCSpriteFrame.h @@ -56,7 +56,7 @@ class Texture2D; sprite->setSpriteFrame(frame); @endcode */ -class AX_DLL SpriteFrame : public Ref, public Clonable +class CC_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 dfe4fcbeae..f256b0babe 100644 --- a/core/2d/CCSpriteFrameCache.cpp +++ b/core/2d/CCSpriteFrameCache.cpp @@ -60,7 +60,7 @@ SpriteFrameCache* SpriteFrameCache::getInstance() void SpriteFrameCache::destroyInstance() { - AX_SAFE_RELEASE_NULL(_sharedSpriteFrameCache); + CC_SAFE_RELEASE_NULL(_sharedSpriteFrameCache); } bool SpriteFrameCache::init() diff --git a/core/2d/CCSpriteFrameCache.h b/core/2d/CCSpriteFrameCache.h index a06dd5aa55..21650ca919 100644 --- a/core/2d/CCSpriteFrameCache.h +++ b/core/2d/CCSpriteFrameCache.h @@ -88,7 +88,7 @@ class PolygonInfo; @since v0.9 @js cc.spriteFrameCache */ -class AX_DLL SpriteFrameCache : public Ref +class CC_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 d745d6729e..5a0db4af95 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 = AX_CONTENT_SCALE_FACTOR(); + const auto scaleFactor = CC_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.h b/core/2d/CCTMXObjectGroup.h index eaa83831c9..4f4fe76ec5 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 AX_DLL TMXObjectGroup : public Ref +class CC_DLL TMXObjectGroup : public Ref { public: /** diff --git a/core/2d/CCTMXXMLParser.cpp b/core/2d/CCTMXXMLParser.cpp index 9a4bc34f15..f18ea8ada7 100644 --- a/core/2d/CCTMXXMLParser.cpp +++ b/core/2d/CCTMXXMLParser.cpp @@ -100,7 +100,7 @@ TMXMapInfo* TMXMapInfo::create(std::string_view tmxFile) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -112,7 +112,7 @@ TMXMapInfo* TMXMapInfo::createWithXML(std::string_view tmxString, std::string_vi ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -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 = AX_POINT_PIXELS_TO_POINTS(p); + p = CC_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 = AX_SIZE_PIXELS_TO_POINTS(s); + s = CC_SIZE_PIXELS_TO_POINTS(s); dict["width"] = Value(s.width); dict["height"] = Value(s.height); @@ -705,7 +705,7 @@ 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 AX_UNUSED inflatedLen = ZipUtils::inflateMemoryWithHint(buffer, len, &deflated, sizeHint); + ssize_t CC_UNUSED inflatedLen = ZipUtils::inflateMemoryWithHint(buffer, len, &deflated, sizeHint); CCASSERT(inflatedLen == sizeHint, "inflatedLen should be equal to sizeHint!"); free(buffer); diff --git a/core/2d/CCTMXXMLParser.h b/core/2d/CCTMXXMLParser.h index 084a51ac65..3afe4de1e8 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 __AX_TM_XML_PARSER__ -#define __AX_TM_XML_PARSER__ +#ifndef __CC_TM_XML_PARSER__ +#define __CC_TM_XML_PARSER__ /// @cond DO_NOT_SHOW @@ -134,7 +134,7 @@ enum This information is obtained from the TMX file. */ -struct AX_DLL TMXTileAnimFrame +struct CC_DLL TMXTileAnimFrame { TMXTileAnimFrame(uint32_t tileID, float duration); /** gid of the frame */ @@ -149,7 +149,7 @@ struct AX_DLL TMXTileAnimFrame This information is obtained from the TMX file. */ -struct AX_DLL TMXTileAnimInfo : public Ref +struct CC_DLL TMXTileAnimInfo : public Ref { static TMXTileAnimInfo* create(uint32_t tileID); explicit TMXTileAnimInfo(uint32_t tileID); @@ -167,7 +167,7 @@ struct AX_DLL TMXTileAnimInfo : public Ref This information is obtained from the TMX file. */ -class AX_DLL TMXLayerInfo : public Ref +class CC_DLL TMXLayerInfo : public Ref { public: /** @@ -203,7 +203,7 @@ public: This information is obtained from the TMX file. */ -class AX_DLL TMXTilesetInfo : public Ref +class CC_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 AX_DLL TMXMapInfo : public Ref, public SAXDelegator +class CC_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 dc59873acb..ed44395d5c 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)) { - AX_BREAK_IF(!ch); + CC_BREAK_IF(!ch); if (0x80 != (0xC0 & ch)) { @@ -125,7 +125,7 @@ TextFieldTTF* TextFieldTTF::textFieldWithPlaceHolder(std::string_view placeholde } return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -143,7 +143,7 @@ TextFieldTTF* TextFieldTTF::textFieldWithPlaceHolder(std::string_view placeholde } return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -186,8 +186,8 @@ bool TextFieldTTF::initWithPlaceHolder(std::string_view placeholder, std::string setTextColorInternally(_colorSpaceHolder); Label::setString(_placeHolder); -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ - AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ + CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) // On desktop default enable cursor if (_currentLabelType == LabelType::TTF) { diff --git a/core/2d/CCTextFieldTTF.h b/core/2d/CCTextFieldTTF.h index 744a9db8fd..cb0d8f7704 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 __AX_TEXT_FIELD_H__ -#define __AX_TEXT_FIELD_H__ +#ifndef __CC_TEXT_FIELD_H__ +#define __CC_TEXT_FIELD_H__ #include "2d/CCLabel.h" #include "base/CCIMEDelegate.h" @@ -41,7 +41,7 @@ class TextFieldTTF; /** * A input protocol for TextField. */ -class AX_DLL TextFieldDelegate +class CC_DLL TextFieldDelegate { public: /** @@ -79,7 +79,7 @@ public: /** *@brief A simple text input field with TTF font. */ -class AX_DLL TextFieldTTF : public Label, public IMEDelegate +class CC_DLL TextFieldTTF : public Label, public IMEDelegate { public: /** @@ -300,4 +300,4 @@ NS_AX_END // end of ui group /// @} -#endif // __AX_TEXT_FIELD_H__ +#endif // __CC_TEXT_FIELD_H__ diff --git a/core/2d/CCTileMapAtlas.cpp b/core/2d/CCTileMapAtlas.cpp index 5b658d9b60..d860eb00be 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; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -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 * AX_CONTENT_SCALE_FACTOR(); - float itemHeightInPixels = _itemHeight * AX_CONTENT_SCALE_FACTOR(); + float itemWidthInPixels = _itemWidth * CC_CONTENT_SCALE_FACTOR(); + float itemHeightInPixels = _itemHeight * CC_CONTENT_SCALE_FACTOR(); -#if AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#if CC_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); diff --git a/core/2d/CCTileMapAtlas.h b/core/2d/CCTileMapAtlas.h index fae1197ac3..97d529f9a5 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 AX_DLL TileMapAtlas : public AtlasNode +class CC_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 b466102185..3fc8f6e519 100644 --- a/core/2d/CCTransition.cpp +++ b/core/2d/CCTransition.cpp @@ -49,8 +49,8 @@ TransitionScene::TransitionScene() TransitionScene::~TransitionScene() { - AX_SAFE_RELEASE(_inScene); - AX_SAFE_RELEASE(_outScene); + CC_SAFE_RELEASE(_inScene); + CC_SAFE_RELEASE(_outScene); } TransitionScene* TransitionScene::create(float t, Scene* scene) @@ -61,7 +61,7 @@ TransitionScene* TransitionScene::create(float t, Scene* scene) pScene->autorelease(); return pScene; } - AX_SAFE_DELETE(pScene); + CC_SAFE_DELETE(pScene); return nullptr; } @@ -74,13 +74,13 @@ bool TransitionScene::initWithDuration(float t, Scene* scene) _duration = t; // retain -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, scene); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _inScene = scene; _inScene->retain(); _outScene = _director->getRunningScene(); @@ -142,24 +142,24 @@ void TransitionScene::finish() _outScene->setAdditionalTransform(nullptr); //[self schedule:@selector(setNewScene:) interval:0]; - this->schedule(AX_SCHEDULE_SELECTOR(TransitionScene::setNewScene), 0); + this->schedule(CC_SCHEDULE_SELECTOR(TransitionScene::setNewScene), 0); } void TransitionScene::setNewScene(float /*dt*/) { - this->unschedule(AX_SCHEDULE_SELECTOR(TransitionScene::setNewScene)); + this->unschedule(CC_SCHEDULE_SELECTOR(TransitionScene::setNewScene)); // Before replacing, save the "send cleanup to scene" _isSendCleanupToScene = _director->isSendCleanupToScene(); _director->replaceScene(_inScene); -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, _inScene); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS // issue #267 _outScene->setVisible(true); @@ -199,10 +199,10 @@ void TransitionScene::onExit() // only the onEnterTransitionDidFinish _inScene->onEnterTransitionDidFinish(); -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING if (ScriptEngineManager::getInstance()->getScriptEngine()) ScriptEngineManager::getInstance()->getScriptEngine()->garbageCollect(); -#endif // AX_ENABLE_SCRIPT_BINDING +#endif // CC_ENABLE_SCRIPT_BINDING } // custom cleanup @@ -252,7 +252,7 @@ TransitionRotoZoom* TransitionRotoZoom::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -274,7 +274,7 @@ void TransitionRotoZoom::onEnter() _outScene->runAction(rotozoom); _inScene->runAction( - Sequence::create(rotozoom->reverse(), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); + Sequence::create(rotozoom->reverse(), CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr)); } // @@ -291,7 +291,7 @@ TransitionJumpZoom* TransitionJumpZoom::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -316,7 +316,7 @@ void TransitionJumpZoom::onEnter() _outScene->runAction(jumpZoomOut); _inScene->runAction( - Sequence::create(delay, jumpZoomIn, CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); + Sequence::create(delay, jumpZoomIn, CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr)); } // @@ -334,7 +334,7 @@ TransitionMoveInL* TransitionMoveInL::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_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(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); + CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr)); } ActionInterval* TransitionMoveInL::action() @@ -380,7 +380,7 @@ TransitionMoveInR* TransitionMoveInR::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -404,7 +404,7 @@ TransitionMoveInT* TransitionMoveInT::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -428,7 +428,7 @@ TransitionMoveInB* TransitionMoveInB::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -461,7 +461,7 @@ void TransitionSlideInL::onEnter() ActionInterval* inAction = easeActionWithAction(in); ActionInterval* outAction = Sequence::create( - easeActionWithAction(out), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); + easeActionWithAction(out), CallFunc::create(CC_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; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -514,7 +514,7 @@ TransitionSlideInR* TransitionSlideInR::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -549,7 +549,7 @@ TransitionSlideInT* TransitionSlideInT::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -584,7 +584,7 @@ TransitionSlideInB* TransitionSlideInB::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -619,7 +619,7 @@ TransitionShrinkGrow* TransitionShrinkGrow::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_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(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); + CallFunc::create(CC_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(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(CC_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(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(CC_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(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(CC_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(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(CC_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(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(CC_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(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); + Show::create(), CallFunc::create(CC_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(AX_CALLBACK_0(TransitionScene::hideOutShowIn, this)), - FadeOut::create(_duration / 2), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), + FadeIn::create(_duration / 2), CallFunc::create(CC_CALLBACK_0(TransitionScene::hideOutShowIn, this)), + FadeOut::create(_duration / 2), CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); f->runAction(a); @@ -1058,7 +1058,7 @@ TransitionCrossFade* TransitionCrossFade::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_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(AX_CALLBACK_0(TransitionScene::hideOutShowIn, this)), - CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(CC_CALLBACK_0(TransitionScene::hideOutShowIn, this)), + CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); // run the blend action outTexture->getSprite()->runAction(layerAction); @@ -1152,7 +1152,7 @@ TransitionTurnOffTiles::TransitionTurnOffTiles() TransitionTurnOffTiles::~TransitionTurnOffTiles() { - AX_SAFE_RELEASE(_outSceneProxy); + CC_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; } - AX_SAFE_DELETE(newScene); + CC_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(AX_CALLBACK_0(TransitionScene::finish, this)), + _outSceneProxy->runAction(Sequence::create(action, CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } @@ -1228,7 +1228,7 @@ TransitionSplitCols::TransitionSplitCols() } TransitionSplitCols::~TransitionSplitCols() { - AX_SAFE_RELEASE(_gridProxy); + CC_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; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -1252,11 +1252,11 @@ void TransitionSplitCols::onEnter() ActionInterval* split = action(); auto seq = - Sequence::create(split, CallFunc::create(AX_CALLBACK_0(TransitionSplitCols::switchTargetToInscene, this)), + Sequence::create(split, CallFunc::create(CC_CALLBACK_0(TransitionSplitCols::switchTargetToInscene, this)), split->reverse(), nullptr); _gridProxy->runAction(Sequence::create(easeActionWithAction(seq), - CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), + CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } @@ -1308,7 +1308,7 @@ TransitionSplitRows* TransitionSplitRows::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -1322,7 +1322,7 @@ TransitionFadeTR::TransitionFadeTR() } TransitionFadeTR::~TransitionFadeTR() { - AX_SAFE_RELEASE(_outSceneProxy); + CC_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; } - AX_SAFE_DELETE(newScene); + CC_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(AX_CALLBACK_0(TransitionScene::finish, this)), + CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } @@ -1409,7 +1409,7 @@ TransitionFadeBL* TransitionFadeBL::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -1433,7 +1433,7 @@ TransitionFadeUp* TransitionFadeUp::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -1456,7 +1456,7 @@ TransitionFadeDown* TransitionFadeDown::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } diff --git a/core/2d/CCTransition.h b/core/2d/CCTransition.h index 9894771c24..8980bb3296 100644 --- a/core/2d/CCTransition.h +++ b/core/2d/CCTransition.h @@ -51,7 +51,7 @@ class NodeGrid; @since v0.8.2 @js NA */ -class AX_DLL TransitionEaseScene // : public Ref +class CC_DLL TransitionEaseScene // : public Ref { public: /** Constructor. @@ -70,7 +70,7 @@ public: /** @class TransitionScene * @brief Base class for Transition scenes. */ -class AX_DLL TransitionScene : public Scene +class CC_DLL TransitionScene : public Scene { public: /** Orientation Type used by some transitions. @@ -130,14 +130,14 @@ protected: bool _isSendCleanupToScene; private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionScene); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionScene); }; /** @class TransitionSceneOriented * @brief A Transition that supports orientation like. * Possible orientation: LeftOver, RightOver, UpOver, DownOver */ -class AX_DLL TransitionSceneOriented : public TransitionScene +class CC_DLL TransitionSceneOriented : public TransitionScene { public: /** Creates a transition with duration, incoming scene and orientation. @@ -159,14 +159,14 @@ protected: Orientation _orientation; private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionSceneOriented); + CC_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 AX_DLL TransitionRotoZoom : public TransitionScene +class CC_DLL TransitionRotoZoom : public TransitionScene { public: /** Creates a transition with duration and incoming scene. @@ -186,14 +186,14 @@ public: virtual ~TransitionRotoZoom(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionRotoZoom); + CC_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 AX_DLL TransitionJumpZoom : public TransitionScene +class CC_DLL TransitionJumpZoom : public TransitionScene { public: /** Creates a transition with duration and incoming scene. @@ -213,14 +213,14 @@ public: virtual ~TransitionJumpZoom(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionJumpZoom); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionJumpZoom); }; /** @class TransitionMoveInL * @brief TransitionMoveInL: Move in from to the left the incoming scene. */ -class AX_DLL TransitionMoveInL : public TransitionScene, public TransitionEaseScene +class CC_DLL TransitionMoveInL : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -252,14 +252,14 @@ protected: virtual void initScenes(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInL); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInL); }; /** @class TransitionMoveInR * @brief TransitionMoveInR: Move in from to the right the incoming scene. */ -class AX_DLL TransitionMoveInR : public TransitionMoveInL +class CC_DLL TransitionMoveInR : public TransitionMoveInL { public: /** Creates a transition with duration and incoming scene. @@ -277,14 +277,14 @@ protected: virtual void initScenes(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInR); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInR); }; /** @class TransitionMoveInT * @brief TransitionMoveInT: Move in from to the top the incoming scene. */ -class AX_DLL TransitionMoveInT : public TransitionMoveInL +class CC_DLL TransitionMoveInT : public TransitionMoveInL { public: /** Creates a transition with duration and incoming scene. @@ -302,14 +302,14 @@ protected: virtual void initScenes(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInT); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInT); }; /** @class TransitionMoveInB * @brief TransitionMoveInB: Move in from to the bottom the incoming scene. */ -class AX_DLL TransitionMoveInB : public TransitionMoveInL +class CC_DLL TransitionMoveInB : public TransitionMoveInL { public: /** Creates a transition with duration and incoming scene. @@ -327,14 +327,14 @@ protected: virtual void initScenes(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInB); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInB); }; /** @class TransitionSlideInL * @brief TransitionSlideInL: Slide in the incoming scene from the left border. */ -class AX_DLL TransitionSlideInL : public TransitionScene, public TransitionEaseScene +class CC_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: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInL); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInL); }; /** @class TransitionSlideInR *@brief TransitionSlideInR: Slide in the incoming scene from the right border. */ -class AX_DLL TransitionSlideInR : public TransitionSlideInL +class CC_DLL TransitionSlideInR : public TransitionSlideInL { public: /** Creates a transition with duration and incoming scene. @@ -399,14 +399,14 @@ protected: virtual void sceneOrder() override; private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInR); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInR); }; /** @class TransitionSlideInB * @brief TransitionSlideInB: Slide in the incoming scene from the bottom border. */ -class AX_DLL TransitionSlideInB : public TransitionSlideInL +class CC_DLL TransitionSlideInB : public TransitionSlideInL { public: /** Creates a transition with duration and incoming scene. @@ -430,14 +430,14 @@ protected: virtual void sceneOrder() override; private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInB); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInB); }; /** @class TransitionSlideInT * @brief TransitionSlideInT: Slide in the incoming scene from the top border. */ -class AX_DLL TransitionSlideInT : public TransitionSlideInL +class CC_DLL TransitionSlideInT : public TransitionSlideInL { public: /** Creates a transition with duration and incoming scene. @@ -461,13 +461,13 @@ protected: virtual void sceneOrder() override; private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInT); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInT); }; /** @class TransitionShrinkGrow * @brief Shrink the outgoing scene while grow the incoming scene */ -class AX_DLL TransitionShrinkGrow : public TransitionScene, public TransitionEaseScene +class CC_DLL TransitionShrinkGrow : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -491,7 +491,7 @@ public: virtual ~TransitionShrinkGrow(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionShrinkGrow); + CC_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 AX_DLL TransitionFlipX : public TransitionSceneOriented +class CC_DLL TransitionFlipX : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -530,7 +530,7 @@ public: virtual ~TransitionFlipX(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionFlipX); + CC_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 AX_DLL TransitionFlipY : public TransitionSceneOriented +class CC_DLL TransitionFlipY : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -569,7 +569,7 @@ public: virtual ~TransitionFlipY(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionFlipY); + CC_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 AX_DLL TransitionFlipAngular : public TransitionSceneOriented +class CC_DLL TransitionFlipAngular : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -608,7 +608,7 @@ public: virtual ~TransitionFlipAngular(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionFlipAngular); + CC_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 AX_DLL TransitionZoomFlipX : public TransitionSceneOriented +class CC_DLL TransitionZoomFlipX : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -647,7 +647,7 @@ public: virtual ~TransitionZoomFlipX(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipX); + CC_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 AX_DLL TransitionZoomFlipY : public TransitionSceneOriented +class CC_DLL TransitionZoomFlipY : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -686,7 +686,7 @@ public: virtual ~TransitionZoomFlipY(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipY); + CC_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 AX_DLL TransitionZoomFlipAngular : public TransitionSceneOriented +class CC_DLL TransitionZoomFlipAngular : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -725,14 +725,14 @@ public: virtual ~TransitionZoomFlipAngular(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipAngular); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipAngular); }; /** @class TransitionFade * @brief TransitionFade: Fade out the outgoing scene and then fade in the incoming scene.''' */ -class AX_DLL TransitionFade : public TransitionScene +class CC_DLL TransitionFade : public TransitionScene { public: /** Creates the transition with a duration and with an RGB color @@ -772,7 +772,7 @@ protected: Color4B _color; private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionFade); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionFade); }; class RenderTexture; @@ -780,7 +780,7 @@ class RenderTexture; @brief TransitionCrossFade: Cross fades two scenes using the RenderTexture object. */ -class AX_DLL TransitionCrossFade : public TransitionScene +class CC_DLL TransitionCrossFade : public TransitionScene { public: /** Creates a transition with duration and incoming scene. @@ -811,14 +811,14 @@ public: virtual ~TransitionCrossFade(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionCrossFade); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionCrossFade); }; /** @class TransitionTurnOffTiles * @brief TransitionTurnOffTiles: Turn off the tiles of the outgoing scene in random order */ -class AX_DLL TransitionTurnOffTiles : public TransitionScene, public TransitionEaseScene +class CC_DLL TransitionTurnOffTiles : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -854,14 +854,14 @@ protected: NodeGrid* _outSceneProxy; private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionTurnOffTiles); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionTurnOffTiles); }; /** @class TransitionSplitCols * @brief TransitionSplitCols: The odd columns goes upwards while the even columns goes downwards. */ -class AX_DLL TransitionSplitCols : public TransitionScene, public TransitionEaseScene +class CC_DLL TransitionSplitCols : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -897,14 +897,14 @@ protected: NodeGrid* _gridProxy; private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionSplitCols); + CC_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 AX_DLL TransitionSplitRows : public TransitionSplitCols +class CC_DLL TransitionSplitRows : public TransitionSplitCols { public: /** Creates a transition with duration and incoming scene. @@ -924,14 +924,14 @@ public: virtual ~TransitionSplitRows(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionSplitRows); + CC_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 AX_DLL TransitionFadeTR : public TransitionScene, public TransitionEaseScene +class CC_DLL TransitionFadeTR : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -970,14 +970,14 @@ protected: NodeGrid* _outSceneProxy; private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionFadeTR); + CC_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 AX_DLL TransitionFadeBL : public TransitionFadeTR +class CC_DLL TransitionFadeBL : public TransitionFadeTR { public: /** Creates a transition with duration and incoming scene. @@ -997,14 +997,14 @@ public: virtual ~TransitionFadeBL(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionFadeBL); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeBL); }; /** @class TransitionFadeUp * @brief TransitionFadeUp: * Fade the tiles of the outgoing scene from the bottom to the top. */ -class AX_DLL TransitionFadeUp : public TransitionFadeTR +class CC_DLL TransitionFadeUp : public TransitionFadeTR { public: /** Creates a transition with duration and incoming scene. @@ -1024,14 +1024,14 @@ public: virtual ~TransitionFadeUp(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionFadeUp); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeUp); }; /** @class TransitionFadeDown * @brief TransitionFadeDown: * Fade the tiles of the outgoing scene from the top to the bottom. */ -class AX_DLL TransitionFadeDown : public TransitionFadeTR +class CC_DLL TransitionFadeDown : public TransitionFadeTR { public: /** Creates a transition with duration and incoming scene. @@ -1051,7 +1051,7 @@ public: virtual ~TransitionFadeDown(); private: - AX_DISALLOW_COPY_AND_ASSIGN(TransitionFadeDown); + CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeDown); }; // end of _2d group diff --git a/core/2d/CCTransitionPageTurn.cpp b/core/2d/CCTransitionPageTurn.cpp index af87b7f2cd..b43f0ffd78 100644 --- a/core/2d/CCTransitionPageTurn.cpp +++ b/core/2d/CCTransitionPageTurn.cpp @@ -44,8 +44,8 @@ TransitionPageTurn::TransitionPageTurn() TransitionPageTurn::~TransitionPageTurn() { - AX_SAFE_RELEASE(_inSceneProxy); - AX_SAFE_RELEASE(_outSceneProxy); + CC_SAFE_RELEASE(_inSceneProxy); + CC_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(AX_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); + action, CallFunc::create(CC_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(AX_CALLBACK_0(TransitionScene::finish, this)), + CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } } diff --git a/core/2d/CCTransitionPageTurn.h b/core/2d/CCTransitionPageTurn.h index 047306b22a..34cc305eaf 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 AX_DLL TransitionPageTurn : public TransitionScene +class CC_DLL TransitionPageTurn : public TransitionScene { public: /** diff --git a/core/2d/CCTransitionProgress.cpp b/core/2d/CCTransitionProgress.cpp index 4d22024edb..c412ad92f9 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; } - AX_SAFE_DELETE(newScene); + CC_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(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); // run the blend action node->runAction(layerAction); @@ -150,7 +150,7 @@ TransitionProgressRadialCCW* TransitionProgressRadialCCW::create(float t, Scene* newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -163,7 +163,7 @@ TransitionProgressRadialCW* TransitionProgressRadialCW::create(float t, Scene* s newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -195,7 +195,7 @@ TransitionProgressHorizontal* TransitionProgressHorizontal::create(float t, Scen newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -228,7 +228,7 @@ TransitionProgressVertical* TransitionProgressVertical::create(float t, Scene* s newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -261,7 +261,7 @@ TransitionProgressInOut* TransitionProgressInOut::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } @@ -306,7 +306,7 @@ TransitionProgressOutIn* TransitionProgressOutIn::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - AX_SAFE_DELETE(newScene); + CC_SAFE_DELETE(newScene); return nullptr; } diff --git a/core/2d/CCTransitionProgress.h b/core/2d/CCTransitionProgress.h index d2a163d82c..db5330c897 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 AX_DLL TransitionProgress : public TransitionScene +class CC_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 AX_DLL TransitionProgressRadialCCW : public TransitionProgress +class CC_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 AX_DLL TransitionProgressRadialCW : public TransitionProgress +class CC_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 AX_DLL TransitionProgressHorizontal : public TransitionProgress +class CC_DLL TransitionProgressHorizontal : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. @@ -163,7 +163,7 @@ protected: /** @class TransitionProgressVertical * @brief TransitionProgressVertical transition. */ -class AX_DLL TransitionProgressVertical : public TransitionProgress +class CC_DLL TransitionProgressVertical : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. @@ -190,7 +190,7 @@ protected: /** @class TransitionProgressInOut * @brief TransitionProgressInOut transition. */ -class AX_DLL TransitionProgressInOut : public TransitionProgress +class CC_DLL TransitionProgressInOut : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. @@ -219,7 +219,7 @@ protected: /** @class TransitionProgressOutIn * @brief TransitionProgressOutIn transition. */ -class AX_DLL TransitionProgressOutIn : public TransitionProgress +class CC_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 49d0fd9935..47f168adcc 100644 --- a/core/2d/CCTweenFunction.h +++ b/core/2d/CCTweenFunction.h @@ -87,210 +87,210 @@ enum TweenType /** * @param time in seconds. */ -float AX_DLL easeIn(float time, float rate); +float CC_DLL easeIn(float time, float rate); /** * @param time in seconds. */ -float AX_DLL easeOut(float time, float rate); +float CC_DLL easeOut(float time, float rate); /** * @param time in seconds. */ -float AX_DLL easeInOut(float time, float rate); +float CC_DLL easeInOut(float time, float rate); /** * @param time in seconds. */ -float AX_DLL bezieratFunction(float a, float b, float c, float d, float t); +float CC_DLL bezieratFunction(float a, float b, float c, float d, float t); /** * @param time in seconds. */ -float AX_DLL quadraticIn(float time); +float CC_DLL quadraticIn(float time); /** * @param time in seconds. */ -float AX_DLL quadraticOut(float time); +float CC_DLL quadraticOut(float time); /** * @param time in seconds. */ -float AX_DLL quadraticInOut(float time); +float CC_DLL quadraticInOut(float time); /** * @param time in seconds. */ -float AX_DLL quadraticInOut(float time); +float CC_DLL quadraticInOut(float time); /** * @param time in seconds. */ -float AX_DLL tweenTo(float time, TweenType type, float* easingParam); +float CC_DLL tweenTo(float time, TweenType type, float* easingParam); /** * @param time in seconds. */ -float AX_DLL linear(float time); +float CC_DLL linear(float time); /** * @param time in seconds. */ -float AX_DLL sineEaseIn(float time); +float CC_DLL sineEaseIn(float time); /** * @param time in seconds. */ -float AX_DLL sineEaseOut(float time); +float CC_DLL sineEaseOut(float time); /** * @param time in seconds. */ -float AX_DLL sineEaseInOut(float time); +float CC_DLL sineEaseInOut(float time); /** * @param time in seconds. */ -float AX_DLL quadEaseIn(float time); +float CC_DLL quadEaseIn(float time); /** * @param time in seconds. */ -float AX_DLL quadEaseOut(float time); +float CC_DLL quadEaseOut(float time); /** * @param time in seconds. */ -float AX_DLL quadEaseInOut(float time); +float CC_DLL quadEaseInOut(float time); /** * @param time in seconds. */ -float AX_DLL cubicEaseIn(float time); +float CC_DLL cubicEaseIn(float time); /** * @param time in seconds. */ -float AX_DLL cubicEaseOut(float time); +float CC_DLL cubicEaseOut(float time); /** * @param time in seconds. */ -float AX_DLL cubicEaseInOut(float time); +float CC_DLL cubicEaseInOut(float time); /** * @param time in seconds. */ -float AX_DLL quartEaseIn(float time); +float CC_DLL quartEaseIn(float time); /** * @param time in seconds. */ -float AX_DLL quartEaseOut(float time); +float CC_DLL quartEaseOut(float time); /** * @param time in seconds. */ -float AX_DLL quartEaseInOut(float time); +float CC_DLL quartEaseInOut(float time); /** * @param time in seconds. */ -float AX_DLL quintEaseIn(float time); +float CC_DLL quintEaseIn(float time); /** * @param time in seconds. */ -float AX_DLL quintEaseOut(float time); +float CC_DLL quintEaseOut(float time); /** @param time in seconds. */ -float AX_DLL quintEaseInOut(float time); +float CC_DLL quintEaseInOut(float time); /** * @param time in seconds. */ -float AX_DLL expoEaseIn(float time); +float CC_DLL expoEaseIn(float time); /** @param time in seconds. */ -float AX_DLL expoEaseOut(float time); +float CC_DLL expoEaseOut(float time); /** * @param time in seconds. */ -float AX_DLL expoEaseInOut(float time); +float CC_DLL expoEaseInOut(float time); /** * @param time in seconds. */ -float AX_DLL circEaseIn(float time); +float CC_DLL circEaseIn(float time); /** * @param time in seconds. */ -float AX_DLL circEaseOut(float time); +float CC_DLL circEaseOut(float time); /** * @param time in seconds. */ -float AX_DLL circEaseInOut(float time); +float CC_DLL circEaseInOut(float time); /** * @param time in seconds. * @param period in seconds. */ -float AX_DLL elasticEaseIn(float time, float period); +float CC_DLL elasticEaseIn(float time, float period); /** * @param time in seconds. * @param period in seconds. */ -float AX_DLL elasticEaseOut(float time, float period); +float CC_DLL elasticEaseOut(float time, float period); /** * @param time in seconds. * @param period in seconds. */ -float AX_DLL elasticEaseInOut(float time, float period); +float CC_DLL elasticEaseInOut(float time, float period); /** * @param time in seconds. */ -float AX_DLL backEaseIn(float time); +float CC_DLL backEaseIn(float time); /** * @param time in seconds. */ -float AX_DLL backEaseOut(float time); +float CC_DLL backEaseOut(float time); /** * @param time in seconds. */ -float AX_DLL backEaseInOut(float time); +float CC_DLL backEaseInOut(float time); /** * @param time in seconds. */ -float AX_DLL bounceEaseIn(float time); +float CC_DLL bounceEaseIn(float time); /** * @param time in seconds. */ -float AX_DLL bounceEaseOut(float time); +float CC_DLL bounceEaseOut(float time); /** * @param time in seconds. */ -float AX_DLL bounceEaseInOut(float time); +float CC_DLL bounceEaseInOut(float time); /** * @param time in seconds. */ -float AX_DLL customEase(float time, float* easingParam); +float CC_DLL customEase(float time, float* easingParam); } // namespace tweenfunc NS_AX_END diff --git a/core/3d/CC3DProgramInfo.cpp b/core/3d/CC3DProgramInfo.cpp index 6dd455893d..da98282e27 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 = "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"; +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"; } // namespace uniform namespace attribute diff --git a/core/3d/CCAABB.h b/core/3d/CCAABB.h index 82120f5ce1..05205a1c49 100644 --- a/core/3d/CCAABB.h +++ b/core/3d/CCAABB.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_AABB_H__ -#define __AX_AABB_H__ +#ifndef __CC_AABB_H__ +#define __CC_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 AX_DLL AABB +class CC_DLL AABB { public: diff --git a/core/3d/CCAnimate3D.cpp b/core/3d/CCAnimate3D.cpp index ea1d6761e0..c87e2f6ef6 100644 --- a/core/3d/CCAnimate3D.cpp +++ b/core/3d/CCAnimate3D.cpp @@ -513,7 +513,7 @@ Animate3D::~Animate3D() } _keyFrameEvent.clear(); - AX_SAFE_RELEASE(_animation); + CC_SAFE_RELEASE(_animation); } void Animate3D::removeFromMap() diff --git a/core/3d/CCAnimate3D.h b/core/3d/CCAnimate3D.h index af741c856d..0f07a450b3 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 AX_DLL Animate3D : public ActionInterval +class CC_DLL Animate3D : public ActionInterval { public: /**create Animate3D using Animation.*/ diff --git a/core/3d/CCAnimation3D.cpp b/core/3d/CCAnimation3D.cpp index a6d15cf3e4..05fd8adc35 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 { - AX_SAFE_DELETE(animation); + CC_SAFE_DELETE(animation); } return animation; @@ -86,16 +86,16 @@ Animation3D::~Animation3D() for (const auto& itor : _boneCurves) { Curve* curve = itor.second; - AX_SAFE_DELETE(curve); + CC_SAFE_DELETE(curve); } } Animation3D::Curve::Curve() : translateCurve(nullptr), rotCurve(nullptr), scaleCurve(nullptr) {} Animation3D::Curve::~Curve() { - AX_SAFE_RELEASE_NULL(translateCurve); - AX_SAFE_RELEASE_NULL(rotCurve); - AX_SAFE_RELEASE_NULL(scaleCurve); + CC_SAFE_RELEASE_NULL(translateCurve); + CC_SAFE_RELEASE_NULL(rotCurve); + CC_SAFE_RELEASE_NULL(scaleCurve); } bool Animation3D::init(const Animation3DData& data) @@ -196,7 +196,7 @@ Animation3DCache* Animation3DCache::getInstance() } void Animation3DCache::destroyInstance() { - AX_SAFE_DELETE(_cacheInstance); + CC_SAFE_DELETE(_cacheInstance); } Animation3D* Animation3DCache::getAnimation(std::string_view key) @@ -222,7 +222,7 @@ void Animation3DCache::removeAllAnimations() { for (auto itor : _animations) { - AX_SAFE_RELEASE(itor.second); + CC_SAFE_RELEASE(itor.second); } _animations.clear(); } diff --git a/core/3d/CCAnimation3D.h b/core/3d/CCAnimation3D.h index ae6cafa094..34b8c02d1d 100644 --- a/core/3d/CCAnimation3D.h +++ b/core/3d/CCAnimation3D.h @@ -43,7 +43,7 @@ NS_AX_BEGIN /** * @brief static animation data, shared */ -class AX_DLL Animation3D : public Ref +class CC_DLL Animation3D : public Ref { friend class Bundle3D; diff --git a/core/3d/CCAnimationCurve.inl b/core/3d/CCAnimationCurve.inl index 346e09d95b..9c2c7da90e 100644 --- a/core/3d/CCAnimationCurve.inl +++ b/core/3d/CCAnimationCurve.inl @@ -117,8 +117,8 @@ AnimationCurve::AnimationCurve() template AnimationCurve::~AnimationCurve() { - AX_SAFE_DELETE_ARRAY(_keytime); - AX_SAFE_DELETE_ARRAY(_value); + CC_SAFE_DELETE_ARRAY(_keytime); + CC_SAFE_DELETE_ARRAY(_value); } template diff --git a/core/3d/CCAttachNode.h b/core/3d/CCAttachNode.h index c59cfa5bcf..8077535a6e 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 AX_DLL AttachNode : public Node +class CC_DLL AttachNode : public Node { public: /** diff --git a/core/3d/CCBillBoard.cpp b/core/3d/CCBillBoard.cpp index 925cfb34bd..91365a70f1 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; } - AX_SAFE_DELETE(billboard); + CC_SAFE_DELETE(billboard); return nullptr; } @@ -62,7 +62,7 @@ BillBoard* BillBoard::create(std::string_view filename, Mode mode) billboard->autorelease(); return billboard; } - AX_SAFE_DELETE(billboard); + CC_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; } - AX_SAFE_DELETE(billboard); + CC_SAFE_DELETE(billboard); return nullptr; } @@ -88,7 +88,7 @@ BillBoard* BillBoard::create(Mode mode) billboard->autorelease(); return billboard; } - AX_SAFE_DELETE(billboard); + CC_SAFE_DELETE(billboard); return nullptr; } diff --git a/core/3d/CCBillBoard.h b/core/3d/CCBillBoard.h index 0d439acd2c..c0e37373c3 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 AX_DLL BillBoard : public Sprite +class CC_DLL BillBoard : public Sprite { public: enum class Mode @@ -118,7 +118,7 @@ protected: bool _modeDirty; private: - AX_DISALLOW_COPY_AND_ASSIGN(BillBoard); + CC_DISALLOW_COPY_AND_ASSIGN(BillBoard); }; // end of 3d group diff --git a/core/3d/CCBundle3D.cpp b/core/3d/CCBundle3D.cpp index 0bdb3e875b..6ffe71093e 100644 --- a/core/3d/CCBundle3D.cpp +++ b/core/3d/CCBundle3D.cpp @@ -161,7 +161,7 @@ void Bundle3D::clear() if (_isBinary) { _binaryBuffer.clear(); - AX_SAFE_DELETE_ARRAY(_references); + CC_SAFE_DELETE_ARRAY(_references); } else { @@ -489,7 +489,7 @@ bool Bundle3D::loadMeshDatasBinary(MeshDatas& meshdatas) FAILED: { - AX_SAFE_DELETE(meshData); + CC_SAFE_DELETE(meshData); for (auto& meshdata : meshdatas.meshDatas) { delete meshdata; @@ -512,7 +512,7 @@ bool Bundle3D::loadMeshDatasBinary_0_1(MeshDatas& meshdatas) if (_binaryReader.read(&attribSize, 4, 1) != 1 || attribSize < 1) { CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); - AX_SAFE_DELETE(meshdata); + CC_SAFE_DELETE(meshdata); return false; } enum @@ -536,7 +536,7 @@ bool Bundle3D::loadMeshDatasBinary_0_1(MeshDatas& meshdatas) 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()); - AX_SAFE_DELETE(meshdata); + CC_SAFE_DELETE(meshdata); return false; } @@ -575,7 +575,7 @@ bool Bundle3D::loadMeshDatasBinary_0_1(MeshDatas& meshdatas) if (_binaryReader.read(&meshdata->vertexSizeInFloat, 4, 1) != 1 || meshdata->vertexSizeInFloat == 0) { CCLOG("warning: Failed to read meshdata: vertexSizeInFloat '%s'.", _path.c_str()); - AX_SAFE_DELETE(meshdata); + CC_SAFE_DELETE(meshdata); return false; } @@ -583,7 +583,7 @@ bool Bundle3D::loadMeshDatasBinary_0_1(MeshDatas& meshdatas) if (_binaryReader.read(&meshdata->vertex[0], 4, meshdata->vertexSizeInFloat) != meshdata->vertexSizeInFloat) { CCLOG("warning: Failed to read meshdata: vertex element '%s'.", _path.c_str()); - AX_SAFE_DELETE(meshdata); + CC_SAFE_DELETE(meshdata); return false; } @@ -595,7 +595,7 @@ bool Bundle3D::loadMeshDatasBinary_0_1(MeshDatas& meshdatas) if (_binaryReader.read(&nIndexCount, 4, 1) != 1) { CCLOG("warning: Failed to read meshdata: nIndexCount '%s'.", _path.c_str()); - AX_SAFE_DELETE(meshdata); + CC_SAFE_DELETE(meshdata); return false; } @@ -604,7 +604,7 @@ bool Bundle3D::loadMeshDatasBinary_0_1(MeshDatas& meshdatas) if (_binaryReader.read(indices.data(), 2, nIndexCount) != nIndexCount) { CCLOG("warning: Failed to read meshdata: indices '%s'.", _path.c_str()); - AX_SAFE_DELETE(meshdata); + CC_SAFE_DELETE(meshdata); return false; } @@ -630,7 +630,7 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas) if (_binaryReader.read(&attribSize, 4, 1) != 1 || attribSize < 1) { CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); - AX_SAFE_DELETE(meshdata); + CC_SAFE_DELETE(meshdata); return false; } enum @@ -654,7 +654,7 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas) 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()); - AX_SAFE_DELETE(meshdata); + CC_SAFE_DELETE(meshdata); return false; } @@ -689,7 +689,7 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas) if (_binaryReader.read(&meshdata->vertexSizeInFloat, 4, 1) != 1 || meshdata->vertexSizeInFloat == 0) { CCLOG("warning: Failed to read meshdata: vertexSizeInFloat '%s'.", _path.c_str()); - AX_SAFE_DELETE(meshdata); + CC_SAFE_DELETE(meshdata); return false; } @@ -697,7 +697,7 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas) if (_binaryReader.read(&meshdata->vertex[0], 4, meshdata->vertexSizeInFloat) != meshdata->vertexSizeInFloat) { CCLOG("warning: Failed to read meshdata: vertex element '%s'.", _path.c_str()); - AX_SAFE_DELETE(meshdata); + CC_SAFE_DELETE(meshdata); return false; } @@ -706,7 +706,7 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas) if (_binaryReader.read(&submeshCount, 4, 1) != 1) { CCLOG("warning: Failed to read meshdata: submeshCount '%s'.", _path.c_str()); - AX_SAFE_DELETE(meshdata); + CC_SAFE_DELETE(meshdata); return false; } @@ -716,7 +716,7 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas) if (_binaryReader.read(&nIndexCount, 4, 1) != 1) { CCLOG("warning: Failed to read meshdata: nIndexCount '%s'.", _path.c_str()); - AX_SAFE_DELETE(meshdata); + CC_SAFE_DELETE(meshdata); return false; } @@ -725,7 +725,7 @@ bool Bundle3D::loadMeshDatasBinary_0_2(MeshDatas& meshdatas) if (_binaryReader.read(indices.data(), 2, nIndexCount) != nIndexCount) { CCLOG("warning: Failed to read meshdata: indices '%s'.", _path.c_str()); - AX_SAFE_DELETE(meshdata); + CC_SAFE_DELETE(meshdata); return false; } @@ -1131,7 +1131,7 @@ bool Bundle3D::loadBinary(std::string_view path) } // Read all refs - AX_SAFE_DELETE_ARRAY(_references); + CC_SAFE_DELETE_ARRAY(_references); _references = new Reference[_referenceCount]; for (unsigned int i = 0; i < _referenceCount; ++i) { @@ -1141,7 +1141,7 @@ bool Bundle3D::loadBinary(std::string_view path) { clear(); CCLOG("warning: Failed to read ref number %u for bundle '%s'.", i, path.data()); - AX_SAFE_DELETE_ARRAY(_references); + CC_SAFE_DELETE_ARRAY(_references); return false; } } @@ -1749,8 +1749,8 @@ 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()); - AX_SAFE_DELETE(modelnodedata); - AX_SAFE_DELETE(nodedata); + CC_SAFE_DELETE(modelnodedata); + CC_SAFE_DELETE(nodedata); return nullptr; } @@ -1766,8 +1766,8 @@ NodeData* Bundle3D::parseNodesRecursivelyJson(const rapidjson::Value& jvalue, bo if (!bone.HasMember(NODE)) { CCLOG("warning: Bone node ID missing"); - AX_SAFE_DELETE(modelnodedata); - AX_SAFE_DELETE(nodedata); + CC_SAFE_DELETE(modelnodedata); + CC_SAFE_DELETE(nodedata); return nullptr; } @@ -1894,8 +1894,8 @@ 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()); - AX_SAFE_DELETE(modelnodedata); - AX_SAFE_DELETE(nodedata); + CC_SAFE_DELETE(modelnodedata); + CC_SAFE_DELETE(nodedata); return nullptr; } @@ -1904,8 +1904,8 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit if (_binaryReader.read(&bonesSize, 4, 1) != 1) { CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); - AX_SAFE_DELETE(modelnodedata); - AX_SAFE_DELETE(nodedata); + CC_SAFE_DELETE(modelnodedata); + CC_SAFE_DELETE(nodedata); return nullptr; } @@ -1919,8 +1919,8 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit Mat4 invbindpos; if (!_binaryReader.readMatrix(invbindpos.m)) { - AX_SAFE_DELETE(modelnodedata); - AX_SAFE_DELETE(nodedata); + CC_SAFE_DELETE(modelnodedata); + CC_SAFE_DELETE(nodedata); return nullptr; } @@ -1932,8 +1932,8 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit if (_binaryReader.read(&uvMapping, 4, 1) != 1) { CCLOG("warning: Failed to read nodedata: uvMapping '%s'.", _path.c_str()); - AX_SAFE_DELETE(modelnodedata); - AX_SAFE_DELETE(nodedata); + CC_SAFE_DELETE(modelnodedata); + CC_SAFE_DELETE(nodedata); return nullptr; } for (unsigned int j = 0; j < uvMapping; ++j) @@ -1942,8 +1942,8 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit if (_binaryReader.read(&textureIndexSize, 4, 1) != 1) { CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); - AX_SAFE_DELETE(modelnodedata); - AX_SAFE_DELETE(nodedata); + CC_SAFE_DELETE(modelnodedata); + CC_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) { - AX_SAFE_DELETE(modelnodedata); - AX_SAFE_DELETE(nodedata); + CC_SAFE_DELETE(modelnodedata); + CC_SAFE_DELETE(nodedata); return nullptr; } } @@ -1983,7 +1983,7 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit if (_binaryReader.read(&childrenSize, 4, 1) != 1) { CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str()); - AX_SAFE_DELETE(nodedata); + CC_SAFE_DELETE(nodedata); return nullptr; } if (childrenSize > 0) diff --git a/core/3d/CCBundle3D.h b/core/3d/CCBundle3D.h index b375ea2565..e76bb039a5 100644 --- a/core/3d/CCBundle3D.h +++ b/core/3d/CCBundle3D.h @@ -49,7 +49,7 @@ class Animation3D; * @js NA * @lua NA */ -class AX_DLL Bundle3D +class CC_DLL Bundle3D { public: /** diff --git a/core/3d/CCBundle3DData.h b/core/3d/CCBundle3DData.h index d7b5996ec0..a0e9480ca3 100644 --- a/core/3d/CCBundle3DData.h +++ b/core/3d/CCBundle3DData.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_BUNDLE_3D_DATA_H__ -#define __AX_BUNDLE_3D_DATA_H__ +#ifndef __CC_BUNDLE_3D_DATA_H__ +#define __CC_BUNDLE_3D_DATA_H__ #include "base/CCRef.h" #include "base/ccTypes.h" @@ -229,7 +229,7 @@ protected: * @js NA * @lua NA */ -struct AX_DLL MeshVertexAttrib +struct CC_DLL MeshVertexAttrib { backend::VertexFormat type; shaderinfos::VertexKey vertexAttrib; @@ -583,4 +583,4 @@ struct Reference NS_AX_END -#endif //__AX_BUNDLE_3D_DATA_H__ +#endif //__CC_BUNDLE_3D_DATA_H__ diff --git a/core/3d/CCBundleReader.h b/core/3d/CCBundleReader.h index 57159c766d..c4ecc117fe 100644 --- a/core/3d/CCBundleReader.h +++ b/core/3d/CCBundleReader.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_BUNDLE_READER_H__ -#define __AX_BUNDLE_READER_H__ +#ifndef __CC_BUNDLE_READER_H__ +#define __CC_BUNDLE_READER_H__ #include #include diff --git a/core/3d/CCFrustum.h b/core/3d/CCFrustum.h index 1f0a092cf6..e5d6ba1ed7 100644 --- a/core/3d/CCFrustum.h +++ b/core/3d/CCFrustum.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_FRUSTUM_H_ -#define __AX_FRUSTUM_H_ +#ifndef __CC_FRUSTUM_H_ +#define __CC_FRUSTUM_H_ #include "base/ccMacros.h" #include "math/CCMath.h" @@ -42,7 +42,7 @@ class Camera; * @js NA * @lua NA */ -class AX_DLL Frustum +class CC_DLL Frustum { friend class Camera; @@ -86,4 +86,4 @@ protected: NS_AX_END -#endif //__AX_FRUSTUM_H_ +#endif //__CC_FRUSTUM_H_ diff --git a/core/3d/CCMesh.cpp b/core/3d/CCMesh.cpp index 1090ae62cb..65fb72976e 100644 --- a/core/3d/CCMesh.cpp +++ b/core/3d/CCMesh.cpp @@ -124,11 +124,11 @@ Mesh::~Mesh() { for (auto& tex : _textures) { - AX_SAFE_RELEASE(tex.second); + CC_SAFE_RELEASE(tex.second); } - AX_SAFE_RELEASE(_skin); - AX_SAFE_RELEASE(_meshIndexData); - AX_SAFE_RELEASE(_material); + CC_SAFE_RELEASE(_skin); + CC_SAFE_RELEASE(_meshIndexData); + CC_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(); - AX_SAFE_RETAIN(tex); - AX_SAFE_RELEASE(_textures[usage]); + CC_SAFE_RETAIN(tex); + CC_SAFE_RELEASE(_textures[usage]); _textures[usage] = tex; if (usage == NTextureData::Usage::Diffuse) @@ -331,9 +331,9 @@ void Mesh::setMaterial(Material* material) { if (_material != material) { - AX_SAFE_RELEASE(_material); + CC_SAFE_RELEASE(_material); _material = material; - AX_SAFE_RETAIN(_material); + CC_SAFE_RETAIN(_material); } _meshCommands.clear(); @@ -450,8 +450,8 @@ void Mesh::setSkin(MeshSkin* skin) { if (_skin != skin) { - AX_SAFE_RETAIN(skin); - AX_SAFE_RELEASE(_skin); + CC_SAFE_RETAIN(skin); + CC_SAFE_RELEASE(_skin); _skin = skin; calculateAABB(); } @@ -461,8 +461,8 @@ void Mesh::setMeshIndexData(MeshIndexData* subMesh) { if (_meshIndexData != subMesh) { - AX_SAFE_RETAIN(subMesh); - AX_SAFE_RELEASE(_meshIndexData); + CC_SAFE_RETAIN(subMesh); + CC_SAFE_RELEASE(_meshIndexData); _meshIndexData = subMesh; calculateAABB(); bindMeshCommand(); diff --git a/core/3d/CCMesh.h b/core/3d/CCMesh.h index f412ff0e92..d4da0068e4 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 AX_DLL Mesh : public Ref +class CC_DLL Mesh : public Ref { friend class MeshRenderer; @@ -293,7 +293,7 @@ protected: /// @} /// @cond -extern std::string AX_DLL s_uniformSamplerName[]; // uniform sampler names array +extern std::string CC_DLL s_uniformSamplerName[]; // uniform sampler names array /// @endcond NS_AX_END diff --git a/core/3d/CCMeshMaterial.cpp b/core/3d/CCMeshMaterial.cpp index 4ccf6ba504..088052ba4b 100644 --- a/core/3d/CCMeshMaterial.cpp +++ b/core/3d/CCMeshMaterial.cpp @@ -155,30 +155,30 @@ void MeshMaterial::createBuiltInMaterial() void MeshMaterial::releaseBuiltInMaterial() { - AX_SAFE_RELEASE_NULL(_unLitMaterial); - AX_SAFE_RELEASE_NULL(_unLitMaterialSkin); + CC_SAFE_RELEASE_NULL(_unLitMaterial); + CC_SAFE_RELEASE_NULL(_unLitMaterialSkin); - 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(_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(_vertexLitMaterialSkin); - AX_SAFE_RELEASE_NULL(_diffuseMaterialSkin); - AX_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialSkin); + CC_SAFE_RELEASE_NULL(_vertexLitMaterialSkin); + CC_SAFE_RELEASE_NULL(_diffuseMaterialSkin); + CC_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialSkin); // release program states - 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(_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(_unLitMaterialSkinProgState); - AX_SAFE_RELEASE_NULL(_vertexLitMaterialSkinProgState); - AX_SAFE_RELEASE_NULL(_diffuseMaterialSkinProgState); - AX_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialSkinProgState); + CC_SAFE_RELEASE_NULL(_unLitMaterialSkinProgState); + CC_SAFE_RELEASE_NULL(_vertexLitMaterialSkinProgState); + CC_SAFE_RELEASE_NULL(_diffuseMaterialSkinProgState); + CC_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialSkinProgState); } void MeshMaterial::releaseCachedMaterial() @@ -284,7 +284,7 @@ MeshMaterial* MeshMaterial::createWithFilename(std::string_view path) return (MeshMaterial*)material->clone(); } - AX_SAFE_DELETE(material); + CC_SAFE_DELETE(material); } return nullptr; } @@ -300,7 +300,7 @@ MeshMaterial* MeshMaterial::createWithProgramState(backend::ProgramState* progra mat->autorelease(); return mat; } - AX_SAFE_DELETE(mat); + CC_SAFE_DELETE(mat); return nullptr; } @@ -336,7 +336,7 @@ void MeshMaterialCache::destroyInstance() { if (_cacheInstance) { - AX_SAFE_DELETE(_cacheInstance); + CC_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()) { - AX_SAFE_RETAIN(texture); + CC_SAFE_RETAIN(texture); _materials.emplace(key, texture); return true; } @@ -366,7 +366,7 @@ void MeshMaterialCache::removeAllMeshMaterial() { for (auto& itr : _materials) { - AX_SAFE_RELEASE_NULL(itr.second); + CC_SAFE_RELEASE_NULL(itr.second); } _materials.clear(); } diff --git a/core/3d/CCMeshMaterial.h b/core/3d/CCMeshMaterial.h index 4ade01dd64..2e88a4552e 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 AX_DLL MeshMaterial : public Material +class CC_DLL MeshMaterial : public Material { public: /** diff --git a/core/3d/CCMeshRenderer.cpp b/core/3d/CCMeshRenderer.cpp index 297cfef339..8d745c5094 100644 --- a/core/3d/CCMeshRenderer.cpp +++ b/core/3d/CCMeshRenderer.cpp @@ -58,7 +58,7 @@ MeshRenderer* MeshRenderer::create() mesh->autorelease(); return mesh; } - AX_SAFE_DELETE(mesh); + CC_SAFE_DELETE(mesh); return nullptr; } @@ -73,7 +73,7 @@ MeshRenderer* MeshRenderer::create(std::string_view modelPath) mesh->autorelease(); return mesh; } - AX_SAFE_DELETE(mesh); + CC_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, AX_CALLBACK_1(MeshRenderer::afterAsyncLoad, mesh), + AsyncTaskPool::TaskType::TASK_IO, CC_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(); - AX_SAFE_RELEASE_NULL(_skeleton); + CC_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); - AX_SAFE_DELETE(meshdatas); + CC_SAFE_DELETE(meshdatas); materialdatas = nullptr; nodeDatas = nullptr; } } - AX_SAFE_DELETE(meshdatas); - AX_SAFE_DELETE(materialdatas); - AX_SAFE_DELETE(nodeDatas); + CC_SAFE_DELETE(meshdatas); + CC_SAFE_DELETE(materialdatas); + CC_SAFE_DELETE(nodeDatas); if (asyncParam->texPath != "") { @@ -207,7 +207,7 @@ bool MeshRenderer::loadFromCache(std::string_view path) _meshVertexDatas.pushBack(it); } _skeleton = Skeleton3D::create(meshdata->nodedatas->skeleton); - AX_SAFE_RETAIN(_skeleton); + CC_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(); - AX_SAFE_RELEASE_NULL(_skeleton); + CC_SAFE_RELEASE_NULL(_skeleton); removeAllAttachNode(); } @@ -301,7 +301,7 @@ bool MeshRenderer::initWithFile(std::string_view path) _aabbDirty = true; _meshes.clear(); _meshVertexDatas.clear(); - AX_SAFE_RELEASE_NULL(_skeleton); + CC_SAFE_RELEASE_NULL(_skeleton); removeAllAttachNode(); if (loadFromCache(path)) @@ -325,14 +325,14 @@ bool MeshRenderer::initWithFile(std::string_view path) } MeshRendererCache::getInstance()->addMeshRenderData(path, data); - AX_SAFE_DELETE(meshdatas); + CC_SAFE_DELETE(meshdatas); _contentSize = getBoundingBox().size; return true; } } - AX_SAFE_DELETE(meshdatas); - AX_SAFE_DELETE(materialdatas); - AX_SAFE_DELETE(nodeDatas); + CC_SAFE_DELETE(meshdatas); + CC_SAFE_DELETE(materialdatas); + CC_SAFE_DELETE(nodeDatas); return false; } @@ -350,7 +350,7 @@ bool MeshRenderer::initFrom(const NodeDatas& nodeDatas, const MeshDatas& meshdat } } _skeleton = Skeleton3D::create(nodeDatas.skeleton); - AX_SAFE_RETAIN(_skeleton); + CC_SAFE_RETAIN(_skeleton); auto size = nodeDatas.nodes.size(); for (const auto& it : nodeDatas.nodes) @@ -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 AX_USE_CULLING +#if CC_USE_CULLING // TODO new-renderer: interface isVisibleInFrustum removal // camera clipping // if(_children.empty() && Camera::getVisitingCamera() && diff --git a/core/3d/CCMeshRenderer.h b/core/3d/CCMeshRenderer.h index 0c9cc61c88..995cbf6e4a 100644 --- a/core/3d/CCMeshRenderer.h +++ b/core/3d/CCMeshRenderer.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_MESH_RENDERER_H__ -#define __AX_MESH_RENDERER_H__ +#ifndef __CC_MESH_RENDERER_H__ +#define __CC_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 AX_DLL MeshRenderer : public Node, public BlendProtocol +class CC_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 AX_DLL MeshRendererCache +class CC_DLL MeshRendererCache { public: struct MeshRenderData @@ -341,4 +341,4 @@ protected: /// @} NS_AX_END -#endif // __AX_MESH_RENDERER_H__ +#endif // __CC_MESH_RENDERER_H__ diff --git a/core/3d/CCMeshSkin.cpp b/core/3d/CCMeshSkin.cpp index df25bc23a6..65f893251e 100644 --- a/core/3d/CCMeshSkin.cpp +++ b/core/3d/CCMeshSkin.cpp @@ -36,7 +36,7 @@ MeshSkin::MeshSkin() : _rootBone(nullptr), _skeleton(nullptr) {} MeshSkin::~MeshSkin() { removeAllBones(); - AX_SAFE_RELEASE(_skeleton); + CC_SAFE_RELEASE(_skeleton); } MeshSkin* MeshSkin::create(Skeleton3D* skeleton, @@ -127,7 +127,7 @@ ssize_t MeshSkin::getMatrixPaletteSizeInBytes() const void MeshSkin::removeAllBones() { _skinBones.clear(); - AX_SAFE_RELEASE(_rootBone); + CC_SAFE_RELEASE(_rootBone); } void MeshSkin::addSkinBone(Bone3D* bone) diff --git a/core/3d/CCMeshSkin.h b/core/3d/CCMeshSkin.h index 51c65afc5f..b61d77b8c8 100644 --- a/core/3d/CCMeshSkin.h +++ b/core/3d/CCMeshSkin.h @@ -48,7 +48,7 @@ class Skeleton3D; * @js NA * @lua NA */ -class AX_DLL MeshSkin : public Ref +class CC_DLL MeshSkin : public Ref { friend class Mesh; diff --git a/core/3d/CCMeshVertexIndexData.cpp b/core/3d/CCMeshVertexIndexData.cpp index 00188bd664..0e0677e4ef 100644 --- a/core/3d/CCMeshVertexIndexData.cpp +++ b/core/3d/CCMeshVertexIndexData.cpp @@ -73,7 +73,7 @@ backend::Buffer* MeshIndexData::getVertexBuffer() const MeshIndexData::MeshIndexData() { -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA if (!_indexData.empty()) return; _indexData = indexdata; @@ -92,16 +92,16 @@ void MeshIndexData::setIndexData(const axis::MeshData::IndexArray& indexdata) MeshIndexData::~MeshIndexData() { - AX_SAFE_RELEASE(_indexBuffer); + CC_SAFE_RELEASE(_indexBuffer); _indexData.clear(); -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } void MeshVertexData::setVertexData(const std::vector& vertexData) { -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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); - // AX_SAFE_RETAIN(vertexdata->_vertexBuffer); + // CC_SAFE_RETAIN(vertexdata->_vertexBuffer); vertexdata->_sizePerVertex = meshdata.getPerVertexSize(); @@ -121,7 +121,7 @@ MeshVertexData* MeshVertexData::create(const MeshData& meshdata, CustomCommand:: if (vertexdata->_vertexBuffer) { -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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() { - AX_SAFE_RELEASE(_vertexBuffer); + CC_SAFE_RELEASE(_vertexBuffer); _indices.clear(); _vertexData.clear(); -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } diff --git a/core/3d/CCMeshVertexIndexData.h b/core/3d/CCMeshVertexIndexData.h index 0282c2db06..e32bb9ed90 100644 --- a/core/3d/CCMeshVertexIndexData.h +++ b/core/3d/CCMeshVertexIndexData.h @@ -51,7 +51,7 @@ class MeshVertexData; * @js NA * @lua NA */ -class AX_DLL MeshIndexData : public Ref +class CC_DLL MeshIndexData : public Ref { public: /** create */ @@ -96,7 +96,7 @@ protected: friend class MeshVertexData; friend class MeshRenderer; -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_DLL MeshVertexData : public Ref +class CC_DLL MeshVertexData : public Ref { friend class MeshRenderer; friend class Mesh; @@ -149,7 +149,7 @@ protected: int _vertexCount = 0; // vertex count std::vector _vertexData; -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener = nullptr; #endif }; diff --git a/core/3d/CCMotionStreak3D.cpp b/core/3d/CCMotionStreak3D.cpp index 964d680f9f..5befbc9cd4 100644 --- a/core/3d/CCMotionStreak3D.cpp +++ b/core/3d/CCMotionStreak3D.cpp @@ -54,7 +54,7 @@ MotionStreak3D::MotionStreak3D() MotionStreak3D::~MotionStreak3D() { - AX_SAFE_RELEASE(_texture); + CC_SAFE_RELEASE(_texture); } MotionStreak3D* MotionStreak3D::create(float fade, @@ -70,7 +70,7 @@ MotionStreak3D* MotionStreak3D::create(float fade, return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -83,7 +83,7 @@ MotionStreak3D* MotionStreak3D::create(float fade, float minSeg, float stroke, c return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -274,8 +274,8 @@ void MotionStreak3D::setTexture(Texture2D* texture) { if (_texture != texture) { - AX_SAFE_RETAIN(texture); - AX_SAFE_RELEASE(_texture); + CC_SAFE_RETAIN(texture); + CC_SAFE_RELEASE(_texture); _texture = texture; _programState->setTexture(_locTexture, 0, _texture->getBackendTexture()); } @@ -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 = AX_CALLBACK_0(MotionStreak3D::onBeforeDraw, this); - afterCommand->func = AX_CALLBACK_0(MotionStreak3D::onAfterDraw, this); + beforeCommand->func = CC_CALLBACK_0(MotionStreak3D::onBeforeDraw, this); + afterCommand->func = CC_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); - AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _nuPoints * 2); + CC_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 a93ad8ef85..eb8282327d 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 __AX_MOTION_STREAK3D_H__ -#define __AX_MOTION_STREAK3D_H__ +#ifndef __CC_MOTION_STREAK3D_H__ +#define __CC_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 AX_DLL MotionStreak3D : public Node, public TextureProtocol +class CC_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: - AX_DISALLOW_COPY_AND_ASSIGN(MotionStreak3D); + CC_DISALLOW_COPY_AND_ASSIGN(MotionStreak3D); //CallbackCommand _beforeCommand; //CallbackCommand _afterCommand; @@ -222,4 +222,4 @@ private: NS_AX_END -#endif //__AX_MOTION_STREAK3D_H__ +#endif //__CC_MOTION_STREAK3D_H__ diff --git a/core/3d/CCOBB.cpp b/core/3d/CCOBB.cpp index 63dcc7fc9d..c7846bb762 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; - AX_ASSERT(0); + CC_ASSERT(0); return point.x; } diff --git a/core/3d/CCOBB.h b/core/3d/CCOBB.h index 58819e1e98..2cd6babbd6 100644 --- a/core/3d/CCOBB.h +++ b/core/3d/CCOBB.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_OBB_H__ -#define __AX_OBB_H__ +#ifndef __CC_OBB_H__ +#define __CC_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 AX_DLL OBB +class CC_DLL OBB { public: OBB(); diff --git a/core/3d/CCPlane.h b/core/3d/CCPlane.h index 6301068226..f8e8cd0913 100644 --- a/core/3d/CCPlane.h +++ b/core/3d/CCPlane.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PLANE_H_ -#define __AX_PLANE_H_ +#ifndef __CC_PLANE_H_ +#define __CC_PLANE_H_ #include "base/ccMacros.h" #include "math/CCMath.h" @@ -43,7 +43,7 @@ enum class PointSide * @js NA * @lua NA **/ -class AX_DLL Plane +class CC_DLL Plane { public: /** diff --git a/core/3d/CCRay.h b/core/3d/CCRay.h index e0575c19c1..dccea23361 100644 --- a/core/3d/CCRay.h +++ b/core/3d/CCRay.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_RAY_H_ -#define __AX_RAY_H_ +#ifndef __CC_RAY_H_ +#define __CC_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 AX_DLL Ray +class CC_DLL Ray { public: /** diff --git a/core/3d/CCSkeleton3D.h b/core/3d/CCSkeleton3D.h index 1b52540074..ea86fc6367 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 AX_DLL Bone3D : public Ref +class CC_DLL Bone3D : public Ref { friend class Skeleton3D; friend class MeshSkin; @@ -177,7 +177,7 @@ protected: * Skeleton * */ -class AX_DLL Skeleton3D : public Ref +class CC_DLL Skeleton3D : public Ref { public: /** diff --git a/core/3d/CCSkybox.cpp b/core/3d/CCSkybox.cpp index 07926f50eb..5b78572db3 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(AX_CALLBACK_0(Skybox::onBeforeDraw, this)); - _customCommand.setAfterCallback(AX_CALLBACK_0(Skybox::onAfterDraw, this)); + _customCommand.setBeforeCallback(CC_CALLBACK_0(Skybox::onBeforeDraw, this)); + _customCommand.setAfterCallback(CC_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)); - AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 4); + CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 4); } void Skybox::setTexture(TextureCube* texture) { CCASSERT(texture != nullptr, __FUNCTION__); - AX_SAFE_RELEASE_NULL(_texture); + CC_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 0a8acd6a0b..62497d0893 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 AX_DLL Skybox : public Node +class CC_DLL Skybox : public Node { public: CREATE_FUNC(Skybox); @@ -109,7 +109,7 @@ protected: TextureCube* _texture; private: - AX_DISALLOW_COPY_AND_ASSIGN(Skybox); + CC_DISALLOW_COPY_AND_ASSIGN(Skybox); backend::UniformLocation _uniformColorLoc; backend::UniformLocation _uniformCameraRotLoc; diff --git a/core/3d/CCTerrain.cpp b/core/3d/CCTerrain.cpp index c72375ee7f..e8dcb8b369 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; } - AX_SAFE_DELETE(terrain); + CC_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) { - AX_SAFE_RELEASE(_lightMap); + CC_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 AX_USE_METAL +#ifdef CC_USE_METAL _programState->setTexture(_lightMapLocation, 5, _dummyTexture->getBackendTexture()); #endif } @@ -255,22 +255,22 @@ Terrain::Terrain() : _alphaMap(nullptr) , _lightMap(nullptr) , _lightDir(-1.f, -1.f, 0.f) -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA , _backToForegroundListener(nullptr) #endif { -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { reload(); }); _director->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, 1); #endif -#ifdef AX_USE_METAL +#ifdef CC_USE_METAL auto image = new Image(); - bool AX_UNUSED isOK = image->initWithRawData(cc_2x2_white_image, sizeof(cc_2x2_white_image), 2, 2, 8); + 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."); _dummyTexture = new Texture2D(); _dummyTexture->initWithImage(image); - AX_SAFE_RELEASE(image); + CC_SAFE_RELEASE(image); #endif } @@ -465,10 +465,10 @@ void Terrain::setIsEnableFrustumCull(bool bool_value) Terrain::~Terrain() { - AX_SAFE_RELEASE(_alphaMap); - AX_SAFE_RELEASE(_lightMap); - AX_SAFE_RELEASE(_heightMapImage); - AX_SAFE_RELEASE(_dummyTexture); + CC_SAFE_RELEASE(_alphaMap); + CC_SAFE_RELEASE(_lightMap); + CC_SAFE_RELEASE(_heightMapImage); + CC_SAFE_RELEASE(_dummyTexture); delete _quadRoot; for (int i = 0; i < 4; ++i) { @@ -488,7 +488,7 @@ Terrain::~Terrain() } } -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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) { - AX_SAFE_RETAIN(newAlphaMapTexture); - AX_SAFE_RELEASE(_alphaMap); + CC_SAFE_RETAIN(newAlphaMapTexture); + CC_SAFE_RELEASE(_alphaMap); _alphaMap = newAlphaMapTexture; } @@ -738,7 +738,7 @@ Terrain::ChunkIndices Terrain::insertIndicesLOD(int neighborLod[4], int selfLod, backend::BufferUsage::STATIC); buffer->updateData(indices, sizeof(uint16_t) * size); - AX_SAFE_RELEASE_NULL(lodIndices._chunkIndices._indexBuffer); + CC_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); - AX_SAFE_RELEASE_NULL(skirtIndices._chunkIndices._indexBuffer); + CC_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 - AX_SAFE_RELEASE_NULL(_buffer); + CC_SAFE_RELEASE_NULL(_buffer); _buffer = backend::Device::getInstance()->newBuffer(sizeof(TerrainVertexData) * _originalVertices.size(), backend::BufferType::VERTEX, backend::BufferUsage::DYNAMIC); @@ -977,7 +977,7 @@ void Terrain::Chunk::bindAndDraw() _command.getPipelineDescriptor().programState = _terrain->_programState; _command.setIndexDrawInfo(0, _chunkIndices._size); renderer->addCommand(&_command); - AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _chunkIndices._size); + CC_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(AX_CALLBACK_0(Terrain::onBeforeDraw, terrain)); - _command.setAfterCallback(AX_CALLBACK_0(Terrain::onAfterDraw, terrain)); + _command.setBeforeCallback(CC_CALLBACK_0(Terrain::onBeforeDraw, terrain)); + _command.setAfterCallback(CC_CALLBACK_0(Terrain::onAfterDraw, terrain)); auto& pipelineDescriptor = _command.getPipelineDescriptor(); pipelineDescriptor.blendDescriptor.blendEnabled = false; @@ -1438,7 +1438,7 @@ void Terrain::Chunk::updateVerticesForLOD() Terrain::Chunk::~Chunk() { - AX_SAFE_RELEASE_NULL(_buffer); + CC_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; - AX_SAFE_RETAIN(_indexBuffer); + CC_SAFE_RETAIN(_indexBuffer); _size = other._size; } @@ -1716,9 +1716,9 @@ Terrain::ChunkIndices& Terrain::ChunkIndices::operator=(const Terrain::ChunkIndi { if (other._indexBuffer != _indexBuffer) { - AX_SAFE_RELEASE_NULL(_indexBuffer); + CC_SAFE_RELEASE_NULL(_indexBuffer); _indexBuffer = other._indexBuffer; - AX_SAFE_RETAIN(_indexBuffer); + CC_SAFE_RETAIN(_indexBuffer); } _size = other._size; return *this; @@ -1726,7 +1726,7 @@ Terrain::ChunkIndices& Terrain::ChunkIndices::operator=(const Terrain::ChunkIndi Terrain::ChunkIndices::~ChunkIndices() { - AX_SAFE_RELEASE_NULL(_indexBuffer); + CC_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 12f0ec15ca..619027a4db 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 AX_DLL Terrain : public Node +class CC_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 AX_DLL DetailMap + struct CC_DLL DetailMap { /*Constructors*/ DetailMap(); @@ -131,7 +131,7 @@ public: *TerrainData *This TerrainData struct warp all parameter that Terrain need to create */ - struct AX_DLL TerrainData + struct CC_DLL TerrainData { /**empty constructor*/ TerrainData(); @@ -205,7 +205,7 @@ private: /* *terrain vertices internal data format **/ - struct AX_DLL TerrainVertexData + struct CC_DLL TerrainVertexData { /*constructor*/ TerrainVertexData(){}; @@ -220,7 +220,7 @@ private: axis::Vec3 _normal; }; - struct AX_DLL QuadTree; + struct CC_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 AX_DLL QuadTree + struct CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener; #endif }; diff --git a/core/3d/CCVertexAttribBinding.cpp b/core/3d/CCVertexAttribBinding.cpp index 9db0148f41..21ac744d76 100644 --- a/core/3d/CCVertexAttribBinding.cpp +++ b/core/3d/CCVertexAttribBinding.cpp @@ -43,8 +43,8 @@ VertexAttribBinding::~VertexAttribBinding() __vertexAttribBindingCache.erase(itr); } - AX_SAFE_RELEASE(_meshIndexData); - AX_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_meshIndexData); + CC_SAFE_RELEASE(_programState); _attributes.clear(); } @@ -57,7 +57,7 @@ VertexAttribBinding* VertexAttribBinding::create(MeshIndexData* meshIndexData, P for (size_t i = 0, count = __vertexAttribBindingCache.size(); i < count; ++i) { b = __vertexAttribBindingCache[i]; - AX_ASSERT(b); + CC_ASSERT(b); if (b->_meshIndexData == meshIndexData && b->_programState == pass->getProgramState()) { // Found a match! diff --git a/core/3d/CCVertexAttribBinding.h b/core/3d/CCVertexAttribBinding.h index 79ee0463d8..c4bad32dc1 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 AX_DLL VertexAttribBinding : public Ref +class CC_DLL VertexAttribBinding : public Ref { public: /** diff --git a/core/audio/AudioCache.h b/core/audio/AudioCache.h index 020cd19d72..32a3abfe8b 100644 --- a/core/audio/AudioCache.h +++ b/core/audio/AudioCache.h @@ -43,7 +43,7 @@ NS_AX_BEGIN class AudioEngineImpl; class AudioPlayer; -class AX_DLL AudioCache +class CC_DLL AudioCache { public: enum class State diff --git a/core/audio/AudioDecoderMp3.cpp b/core/audio/AudioDecoderMp3.cpp index bd60e87fb3..2280f3a208 100644 --- a/core/audio/AudioDecoderMp3.cpp +++ b/core/audio/AudioDecoderMp3.cpp @@ -32,7 +32,7 @@ #include "base/CCConsole.h" -#if !AX_USE_MPG123 +#if !CC_USE_MPG123 # define MINIMP3_IMPLEMENTATION # include "minimp3/minimp3_ex.h" #else @@ -41,12 +41,12 @@ # include "mpg123.h" #endif -#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID # include # include #endif -#if !AX_USE_MPG123 +#if !CC_USE_MPG123 struct mp3dec_impl { mp3dec_ex_t _dec; @@ -56,7 +56,7 @@ struct mp3dec_impl NS_AX_BEGIN -#if !AX_USE_MPG123 +#if !CC_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 AX_USE_MPG123 +#if CC_USE_MPG123 if (!__mp3Inited) { int error = mpg123_init(); @@ -107,7 +107,7 @@ bool AudioDecoderMp3::lazyInit() void AudioDecoderMp3::destroy() { -#if AX_USE_MPG123 +#if CC_USE_MPG123 if (__mp3Inited) { mpg123_exit(); @@ -128,7 +128,7 @@ AudioDecoderMp3::~AudioDecoderMp3() bool AudioDecoderMp3::open(std::string_view fullPath) { -#if !AX_USE_MPG123 +#if !CC_USE_MPG123 do { _fileStream = FileUtils::getInstance()->openFileStream(fullPath, FileStream::Mode::READ); @@ -245,7 +245,7 @@ void AudioDecoderMp3::close() { if (isOpened()) { -#if !AX_USE_MPG123 +#if !CC_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 !AX_USE_MPG123 +#if !CC_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 !AX_USE_MPG123 +#if !CC_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 a240c0418c..c942cab42d 100644 --- a/core/audio/AudioDecoderMp3.h +++ b/core/audio/AudioDecoderMp3.h @@ -29,11 +29,11 @@ #include "audio/AudioDecoder.h" #include -#if !defined(AX_USE_MPG123) -# define AX_USE_MPG123 0 +#if !defined(CC_USE_MPG123) +# define CC_USE_MPG123 0 #endif -#if !AX_USE_MPG123 +#if !CC_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 27da9595f5..21ef0bb452 100644 --- a/core/audio/AudioDecoderOgg.cpp +++ b/core/audio/AudioDecoderOgg.cpp @@ -30,7 +30,7 @@ #include "audio/AudioMacros.h" #include "platform/CCFileUtils.h" -#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID # include # include #endif diff --git a/core/audio/AudioEngine.cpp b/core/audio/AudioEngine.cpp index 2410772e5b..92909701de 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) { - AX_ASSERT(!profile->name.empty()); + CC_ASSERT(!profile->name.empty()); profileHelper = &_audioPathProfileHelperMap[profile->name]; profileHelper->profile = *profile; } diff --git a/core/audio/AudioEngine.h b/core/audio/AudioEngine.h index 90fdaca512..a239877efa 100644 --- a/core/audio/AudioEngine.h +++ b/core/audio/AudioEngine.h @@ -52,7 +52,7 @@ NS_AX_BEGIN * @brief * @js NA */ -class AX_DLL AudioProfile +class CC_DLL AudioProfile { public: // Profile name can't be empty. @@ -82,7 +82,7 @@ class AudioEngineImpl; * @js NA */ -class AX_DLL AudioEngine +class CC_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 4834d22f6c..aacf28172e 100644 --- a/core/audio/AudioEngineImpl.cpp +++ b/core/audio/AudioEngineImpl.cpp @@ -31,7 +31,7 @@ #include "audio/AudioEngineImpl.h" #include "audio/AudioDecoderManager.h" -#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC # import #endif @@ -41,7 +41,7 @@ #include "base/CCScheduler.h" #include "base/ccUtils.h" -#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS # import #endif @@ -100,7 +100,7 @@ static ALenum alSourceAddNotificationExt(ALuint sid, return AL_INVALID_VALUE; } -# if AX_TARGET_PLATFORM == AX_PLATFORM_IOS +# if CC_TARGET_PLATFORM == CC_PLATFORM_IOS @interface AudioEngineSessionHandler : NSObject { } @@ -269,7 +269,7 @@ AudioEngineImpl::~AudioEngineImpl() { if (_scheduled && _scheduler != nullptr) { - _scheduler->unschedule(AX_SCHEDULE_SELECTOR(AudioEngineImpl::update), this); + _scheduler->unschedule(CC_SCHEDULE_SELECTOR(AudioEngineImpl::update), this); } if (s_ALContext) @@ -291,7 +291,7 @@ AudioEngineImpl::~AudioEngineImpl() AudioDecoderManager::destroy(); -#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS [s_AudioEngineSessionHandler release]; #endif s_instance = nullptr; @@ -302,7 +302,7 @@ bool AudioEngineImpl::init() bool ret = false; do { -#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#if CC_TARGET_PLATFORM == CC_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(AX_SCHEDULE_SELECTOR(AudioEngineImpl::update), this, 0.05f, false); + _scheduler->schedule(CC_SCHEDULE_SELECTOR(AudioEngineImpl::update), this, 0.05f, false); } return _currentAudioID; @@ -852,7 +852,7 @@ void AudioEngineImpl::_unscheduleUpdate() if (_scheduled) { _scheduled = false; - _scheduler->unschedule(AX_SCHEDULE_SELECTOR(AudioEngineImpl::update), this); + _scheduler->unschedule(CC_SCHEDULE_SELECTOR(AudioEngineImpl::update), this); } } diff --git a/core/audio/AudioEngineImpl.h b/core/audio/AudioEngineImpl.h index f8a9c3a342..9ec33a0b16 100644 --- a/core/audio/AudioEngineImpl.h +++ b/core/audio/AudioEngineImpl.h @@ -42,7 +42,7 @@ NS_AX_BEGIN class Scheduler; -class AX_DLL AudioEngineImpl : public axis::Ref +class CC_DLL AudioEngineImpl : public axis::Ref { public: AudioEngineImpl(); diff --git a/core/audio/AudioMacros.h b/core/audio/AudioMacros.h index 2498535b15..5de56024da 100644 --- a/core/audio/AudioMacros.h +++ b/core/audio/AudioMacros.h @@ -39,10 +39,10 @@ // log, CCLOG 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 AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 # include "base/ccUTF8.h" // for StringUtils::format # define AUDIO_LOG(fmt, ...) OutputDebugStringA(StringUtils::format((fmt "\r\n"), ##__VA_ARGS__).c_str()) -#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID # include # define AUDIO_LOG(fmt, ...) __android_log_print(ANDROID_LOG_DEBUG, "AudioEngine", fmt, ##__VA_ARGS__) #else // other platforms diff --git a/core/audio/AudioPlayer.cpp b/core/audio/AudioPlayer.cpp index 622c131975..50ef6bab0b 100644 --- a/core/audio/AudioPlayer.cpp +++ b/core/audio/AudioPlayer.cpp @@ -125,7 +125,7 @@ void AudioPlayer::destroy() _rotateBufferThread = nullptr; ALOGVV("rotateBufferThread exited!"); -#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#if CC_TARGET_PLATFORM == CC_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 bb4e19ece2..048b79fe4e 100644 --- a/core/audio/AudioPlayer.h +++ b/core/audio/AudioPlayer.h @@ -43,7 +43,7 @@ NS_AX_BEGIN class AudioCache; class AudioEngineImpl; -class AX_DLL AudioPlayer +class CC_DLL AudioPlayer { friend class AudioEngineImpl; diff --git a/core/axis.cpp b/core/axis.cpp index 6e5ab82c80..f83161bdcc 100644 --- a/core/axis.cpp +++ b/core/axis.cpp @@ -31,12 +31,12 @@ THE SOFTWARE. NS_AX_BEGIN -AX_DLL const char* axisVersion() +CC_DLL const char* axisVersion() { return "axis-1.0.0b9"; } -AX_DLL const char* cocos2dVersion() +CC_DLL const char* cocos2dVersion() { return axisVersion(); } diff --git a/core/axis.h b/core/axis.h index 584ca965eb..cc115694ff 100644 --- a/core/axis.h +++ b/core/axis.h @@ -183,13 +183,13 @@ THE SOFTWARE. #include "platform/CCPlatformMacros.h" #include "platform/CCSAXParser.h" -#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) # include "platform/ios/CCApplication-ios.h" # include "platform/ios/CCGLViewImpl-ios.h" # include "platform/ios/CCStdC-ios.h" -#endif // AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 // AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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 // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) # include "platform/desktop/CCGLViewImpl-desktop.h" # include "platform/mac/CCApplication-mac.h" # include "platform/mac/CCStdC-mac.h" -#endif // AX_TARGET_PLATFORM == AX_PLATFORM_MAC +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC -#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +#if (CC_TARGET_PLATFORM == CC_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 // AX_TARGET_PLATFORM == AX_PLATFORM_LINUX +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX // script_support #include "base/CCScriptSupport.h" @@ -272,7 +272,7 @@ THE SOFTWARE. NS_AX_BEGIN -AX_DLL const char* axisVersion(); +CC_DLL const char* axisVersion(); NS_AX_END diff --git a/core/base/CCAsyncTaskPool.h b/core/base/CCAsyncTaskPool.h index 27218ccca1..da9711419c 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 AX_DLL AsyncTaskPool +class CC_DLL AsyncTaskPool { public: typedef std::function TaskCallBack; @@ -174,7 +174,7 @@ protected: // don't allow enqueueing after stopping the pool if (_stop) { - AX_ASSERT(0 && "already stop"); + CC_ASSERT(0 && "already stop"); return; } diff --git a/core/base/CCAutoreleasePool.cpp b/core/base/CCAutoreleasePool.cpp index d288326b3d..9b7230a57d 100644 --- a/core/base/CCAutoreleasePool.cpp +++ b/core/base/CCAutoreleasePool.cpp @@ -162,7 +162,7 @@ void PoolManager::push(AutoreleasePool* pool) void PoolManager::pop() { - AX_ASSERT(!_releasePoolStack.empty()); + CC_ASSERT(!_releasePoolStack.empty()); _releasePoolStack.pop_back(); } diff --git a/core/base/CCAutoreleasePool.h b/core/base/CCAutoreleasePool.h index 1e310b1d70..583558cde8 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 AX_DLL AutoreleasePool +class CC_DLL AutoreleasePool { public: /** @@ -149,7 +149,7 @@ private: /** * @cond */ -class AX_DLL PoolManager +class CC_DLL PoolManager { public: static PoolManager* getInstance(); diff --git a/core/base/CCConfiguration.cpp b/core/base/CCConfiguration.cpp index 6876585dfe..561fad0d88 100644 --- a/core/base/CCConfiguration.cpp +++ b/core/base/CCConfiguration.cpp @@ -68,13 +68,13 @@ bool Configuration::init() { _valueDict["axis.version"] = Value(axisVersion()); -#if AX_ENABLE_PROFILERS +#if CC_ENABLE_PROFILERS _valueDict["axis.compiled_with_profiler"] = Value(true); #else _valueDict["axis.compiled_with_profiler"] = Value(false); #endif -#if AX_ENABLE_GL_STATE_CACHE == 0 +#if CC_ENABLE_GL_STATE_CACHE == 0 _valueDict["axis.compiled_with_gl_state_cache"] = Value(false); #else _valueDict["axis.compiled_with_gl_state_cache"] = Value(true); @@ -91,21 +91,21 @@ bool Configuration::init() Configuration::~Configuration() { - AX_SAFE_DELETE(_loadedEvent); + CC_SAFE_DELETE(_loadedEvent); } std::string Configuration::getInfo() const { // And Dump some warnings as well -#if AX_ENABLE_PROFILERS +#if CC_ENABLE_PROFILERS CCLOG( - "cocos2d: **** WARNING **** AX_ENABLE_PROFILERS is defined. Disable it when you finish profiling (from " + "cocos2d: **** WARNING **** CC_ENABLE_PROFILERS is defined. Disable it when you finish profiling (from " "ccConfig.h)\n"); #endif -#if AX_ENABLE_GL_STATE_CACHE == 0 +#if CC_ENABLE_GL_STATE_CACHE == 0 CCLOG( - "cocos2d: **** WARNING **** AX_ENABLE_GL_STATE_CACHE is disabled. To improve performance, enable it (from " + "cocos2d: **** WARNING **** CC_ENABLE_GL_STATE_CACHE is disabled. To improve performance, enable it (from " "ccConfig.h)\n"); #endif @@ -183,7 +183,7 @@ Configuration* Configuration::getInstance() void Configuration::destroyInstance() { - AX_SAFE_RELEASE_NULL(s_sharedConfiguration); + CC_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 AX_TEXTURE_ATLAS_USE_VAO +#if CC_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(AX_USE_GLES) && !defined(__APPLE__) +#if defined(CC_USE_GLES) && !defined(__APPLE__) return _supportsOESMapBuffer; #else return true; diff --git a/core/base/CCConfiguration.h b/core/base/CCConfiguration.h index fa6012c1a1..254181c40f 100644 --- a/core/base/CCConfiguration.h +++ b/core/base/CCConfiguration.h @@ -47,7 +47,7 @@ class EventCustom; * @since v0.99.0 * @js NA */ -class AX_DLL Configuration : public Ref +class CC_DLL Configuration : public Ref { public: /** Returns a shared instance of Configuration. diff --git a/core/base/CCConsole.cpp b/core/base/CCConsole.cpp index cee6f9a13e..a4d353ce00 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(AX_LOG_MULTITHREAD) -# define AX_LOG_MULTITHREAD 1 +#if !defined(CC_LOG_MULTITHREAD) +# define CC_LOG_MULTITHREAD 1 #endif -#if !defined(AX_LOG_TO_CONSOLE) -# define AX_LOG_TO_CONSOLE 1 +#if !defined(CC_LOG_TO_CONSOLE) +# define CC_LOG_TO_CONSOLE 1 #endif NS_AX_BEGIN @@ -102,7 +102,7 @@ const char* inet_ntop(int af, const void* src, char* dst, int cnt) // Free functions to log // -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) void SendLogToWindow(const char* log) { static const int CCLOG_STRING_TAG = 1; @@ -123,17 +123,17 @@ void SendLogToWindow(const char* log) void log(const char* format, ...) { -#define AX_VSNPRINTF_BUFFER_LENGTH 512 +#define CC_VSNPRINTF_BUFFER_LENGTH 512 va_list args; va_start(args, format); auto buf = StringUtils::vformat(format, args); va_end(args); -#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID __android_log_print(ANDROID_LOG_DEBUG, "axis debug info", "%s", buf.c_str()); -#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#elif CC_TARGET_PLATFORM == CC_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 AX_LOG_TO_CONSOLE +# if CC_LOG_TO_CONSOLE auto hStdout = ::GetStdHandle(STD_OUTPUT_HANDLE); if (hStdout) { @@ -153,7 +153,7 @@ void log(const char* format, ...) } # endif -# if !AX_LOG_MULTITHREAD +# if !CC_LOG_MULTITHREAD // print to log window SendLogToWindow(buf.c_str()); # endif @@ -164,7 +164,7 @@ void log(const char* format, ...) fflush(stdout); #endif -#if !AX_LOG_MULTITHREAD +#if !CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) WSADATA wsaData; n = WSAStartup(MAKEWORD(2, 2), &wsaData); #endif if ((n = getaddrinfo(nullptr, serv, &hints, &res)) != 0) { -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) closesocket(fd); #else close(fd); #endif } -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#if CC_TARGET_PLATFORM == CC_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 | ]", - AX_CALLBACK_2(Console::commandAllocator, this)}); + CC_CALLBACK_2(Console::commandAllocator, this)}); } void Console::createCommandConfig() { addCommand({"config", "Print the Configuration object. Args: [-h | help | ]", - AX_CALLBACK_2(Console::commandConfig, this)}); + CC_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 | ]", - AX_CALLBACK_2(Console::commandDebugMsg, this)}); + CC_CALLBACK_2(Console::commandDebugMsg, this)}); addSubCommand("debugmsg", - {"on", "enable debug logging", AX_CALLBACK_2(Console::commandDebugMsgSubCommandOnOff, this)}); + {"on", "enable debug logging", CC_CALLBACK_2(Console::commandDebugMsgSubCommandOnOff, this)}); addSubCommand("debugmsg", - {"off", "disable debug logging", AX_CALLBACK_2(Console::commandDebugMsgSubCommandOnOff, this)}); + {"off", "disable debug logging", CC_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", - AX_CALLBACK_2(Console::commandDirectorSubCommandPause, this)}); + CC_CALLBACK_2(Console::commandDirectorSubCommandPause, this)}); addSubCommand("director", {"resume", "resume all scheduled timers", - AX_CALLBACK_2(Console::commandDirectorSubCommandResume, this)}); + CC_CALLBACK_2(Console::commandDirectorSubCommandResume, this)}); addSubCommand("director", {"stop", "Stops the animation. Nothing will be drawn.", - AX_CALLBACK_2(Console::commandDirectorSubCommandStop, this)}); + CC_CALLBACK_2(Console::commandDirectorSubCommandStop, this)}); addSubCommand( "director", {"start", "Restart the animation again, Call this function only if [director stop] was called earlier", - AX_CALLBACK_2(Console::commandDirectorSubCommandStart, this)}); - addSubCommand("director", {"end", "exit this app.", AX_CALLBACK_2(Console::commandDirectorSubCommandEnd, this)}); + CC_CALLBACK_2(Console::commandDirectorSubCommandStart, this)}); + addSubCommand("director", {"end", "exit this app.", CC_CALLBACK_2(Console::commandDirectorSubCommandEnd, this)}); } void Console::createCommandExit() { addCommand( - {"exit", "Close connection to the console. Args: [-h | help | ]", AX_CALLBACK_2(Console::commandExit, this)}); + {"exit", "Close connection to the console. Args: [-h | help | ]", CC_CALLBACK_2(Console::commandExit, this)}); } void Console::createCommandFileUtils() { addCommand({"fileutils", "Flush or print the FileUtils info. Args: [-h | help | flush | ]", - AX_CALLBACK_2(Console::commandFileUtils, this)}); + CC_CALLBACK_2(Console::commandFileUtils, this)}); addSubCommand("fileutils", {"flush", "Purges the file searching cache.", - AX_CALLBACK_2(Console::commandFileUtilsSubCommandFlush, this)}); + CC_CALLBACK_2(Console::commandFileUtilsSubCommandFlush, this)}); } void Console::createCommandFps() { addCommand( - {"fps", "Turn on / off the FPS. Args: [-h | help | on | off | ]", AX_CALLBACK_2(Console::commandFps, this)}); + {"fps", "Turn on / off the FPS. Args: [-h | help | on | off | ]", CC_CALLBACK_2(Console::commandFps, this)}); addSubCommand("fps", {"on", "Display the FPS on the bottom-left corner.", - AX_CALLBACK_2(Console::commandFpsSubCommandOnOff, this)}); + CC_CALLBACK_2(Console::commandFpsSubCommandOnOff, this)}); addSubCommand("fps", {"off", "Hide the FPS on the bottom-left corner.", - AX_CALLBACK_2(Console::commandFpsSubCommandOnOff, this)}); + CC_CALLBACK_2(Console::commandFpsSubCommandOnOff, this)}); } void Console::createCommandHelp() { - addCommand({"help", "Print this message. Args: [ ]", AX_CALLBACK_2(Console::commandHelp, this)}); + addCommand({"help", "Print this message. Args: [ ]", CC_CALLBACK_2(Console::commandHelp, this)}); } void Console::createCommandProjection() { addCommand({"projection", "Change or print the current projection. Args: [-h | help | 2d | 3d | ]", - AX_CALLBACK_2(Console::commandProjection, this)}); + CC_CALLBACK_2(Console::commandProjection, this)}); addSubCommand("projection", {"2d", "sets a 2D projection (orthogonal projection).", - AX_CALLBACK_2(Console::commandProjectionSubCommand2d, this)}); + CC_CALLBACK_2(Console::commandProjectionSubCommand2d, this)}); addSubCommand("projection", {"3d", "sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500.", - AX_CALLBACK_2(Console::commandProjectionSubCommand3d, this)}); + CC_CALLBACK_2(Console::commandProjectionSubCommand3d, this)}); } void Console::createCommandResolution() { addCommand({"resolution", "Change or print the window resolution. Args: [-h | help | width height resolution_policy | ]", - AX_CALLBACK_2(Console::commandResolution, this)}); - addSubCommand("resolution", {"", "", AX_CALLBACK_2(Console::commandResolutionSubCommandEmpty, this)}); + CC_CALLBACK_2(Console::commandResolution, this)}); + addSubCommand("resolution", {"", "", CC_CALLBACK_2(Console::commandResolutionSubCommandEmpty, this)}); } void Console::createCommandSceneGraph() { - addCommand({"scenegraph", "Print the scene graph", AX_CALLBACK_2(Console::commandSceneGraph, this)}); + addCommand({"scenegraph", "Print the scene graph", CC_CALLBACK_2(Console::commandSceneGraph, this)}); } void Console::createCommandTexture() { addCommand({"texture", "Flush or print the TextureCache info. Args: [-h | help | flush | ] ", - AX_CALLBACK_2(Console::commandTextures, this)}); + CC_CALLBACK_2(Console::commandTextures, this)}); addSubCommand("texture", {"flush", "Purges the dictionary of loaded textures.", - AX_CALLBACK_2(Console::commandTexturesSubCommandFlush, this)}); + CC_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).", - AX_CALLBACK_2(Console::commandTouchSubCommandTap, this)}); + CC_CALLBACK_2(Console::commandTouchSubCommandTap, this)}); addSubCommand("touch", {"swipe", "touch swipe x1 y1 x2 y2: simulate touch swipe from (x1,y1) to (x2,y2).", - AX_CALLBACK_2(Console::commandTouchSubCommandSwipe, this)}); + CC_CALLBACK_2(Console::commandTouchSubCommandSwipe, this)}); } void Console::createCommandUpload() { addCommand( - {"upload", "upload file. Args: [filename base64_encoded_data]", AX_CALLBACK_1(Console::commandUpload, this)}); + {"upload", "upload file. Args: [filename base64_encoded_data]", CC_CALLBACK_1(Console::commandUpload, this)}); } void Console::createCommandVersion() { - addCommand({"version", "print version string ", AX_CALLBACK_2(Console::commandVersion, this)}); + addCommand({"version", "print version string ", CC_CALLBACK_2(Console::commandVersion, this)}); } // @@ -1165,12 +1165,12 @@ void Console::createCommandVersion() void Console::commandAllocator(socket_native_type fd, std::string_view /*args*/) { -#if AX_ENABLE_ALLOCATOR_DIAGNOSTICS +#if CC_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. AX_ENABLE_ALLOCATOR_DIAGNOSTICS must be set to 1 in ccConfig.h\n"); + fd, "allocator diagnostics not available. CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) closesocket(fd); #else close(fd); diff --git a/core/base/CCConsole.h b/core/base/CCConsole.h index e5e38a782f..dd0f20ad7d 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 AX_DLL log(const char* format, ...) AX_FORMAT_PRINTF(1, 2); +void CC_DLL log(const char* format, ...) CC_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 AX_DLL log(const char* format, ...) AX_FORMAT_PRINTF(1, 2); ``` */ -class AX_DLL Console : public Ref +class CC_DLL Console : public Ref { public: /** Console Utils */ @@ -108,7 +108,7 @@ public: }; /** Command Struct */ - class AX_DLL Command + class CC_DLL Command { public: using Callback = std::function; @@ -208,7 +208,7 @@ public: bool isIpv6Server() const; /** The command separator */ - AX_SYNTHESIZE(char, _commandSeparator, CommandSeparator); + CC_SYNTHESIZE(char, _commandSeparator, CommandSeparator); protected: // Main Loop @@ -291,7 +291,7 @@ protected: std::string _bindAddress; private: - AX_DISALLOW_COPY_AND_ASSIGN(Console); + CC_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 306895de6d..7a1c3dcf9b 100644 --- a/core/base/CCController-android.cpp +++ b/core/base/CCController-android.cpp @@ -26,7 +26,7 @@ #include "base/CCController.h" -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) # include # include "base/ccMacros.h" # include "base/CCDirector.h" @@ -212,4 +212,4 @@ JNIEXPORT void JNICALL Java_org_cocos2dx_lib_GameControllerAdapter_nativeControl } // extern "C" { -#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) diff --git a/core/base/CCController-apple.mm b/core/base/CCController-apple.mm index 7be0fb7366..203d4500bc 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 (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) # include "base/ccMacros.h" # include "base/CCEventDispatcher.h" @@ -325,7 +325,7 @@ void Controller::registerListeners() } }; } -# if defined(AX_TARGET_OS_TVOS) +# if defined(CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) diff --git a/core/base/CCController-linux-win32.cpp b/core/base/CCController-linux-win32.cpp index 1bf9f42bfe..c33aa4f7eb 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 (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) # include # include "base/ccMacros.h" # include "base/CCDirector.h" @@ -37,7 +37,7 @@ THE SOFTWARE. NS_AX_BEGIN -class AX_DLL ControllerImpl +class CC_DLL ControllerImpl { public: ControllerImpl() @@ -4454,4 +4454,4 @@ Controller::~Controller() NS_AX_END -#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) diff --git a/core/base/CCController.cpp b/core/base/CCController.cpp index aeaadb11b8..455b3c68bd 100644 --- a/core/base/CCController.cpp +++ b/core/base/CCController.cpp @@ -26,9 +26,9 @@ #include "base/CCController.h" -#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) +#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) # 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 // (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) +#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) diff --git a/core/base/CCController.h b/core/base/CCController.h index 7ecc8d99b7..5877e34174 100644 --- a/core/base/CCController.h +++ b/core/base/CCController.h @@ -25,9 +25,9 @@ #ifndef __cocos2d_libs__CCController__ #define __cocos2d_libs__CCController__ -#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) +#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) # include "platform/CCPlatformMacros.h" # include @@ -51,7 +51,7 @@ class EventDispatcher; * @brief A Controller object represents a connected physical game controller. * @js NA */ -class AX_DLL Controller +class CC_DLL Controller { public: /** @@ -223,7 +223,7 @@ private: EventController* _keyEvent; EventController* _axisEvent; -# if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +# if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_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.h b/core/base/CCData.h index 91735bd848..95b465a164 100644 --- a/core/base/CCData.h +++ b/core/base/CCData.h @@ -39,7 +39,7 @@ */ NS_AX_BEGIN -class AX_DLL Data +class CC_DLL Data { friend class Properties; diff --git a/core/base/CCDirector.cpp b/core/base/CCDirector.cpp index 0ead658042..d0df40eded 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 AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING # include "base/CCScriptSupport.h" #endif @@ -150,40 +150,40 @@ Director::~Director() { CCLOGINFO("deallocing Director: %p", this); - AX_SAFE_RELEASE(_FPSLabel); - AX_SAFE_RELEASE(_drawnVerticesLabel); - AX_SAFE_RELEASE(_drawnBatchesLabel); + CC_SAFE_RELEASE(_FPSLabel); + CC_SAFE_RELEASE(_drawnVerticesLabel); + CC_SAFE_RELEASE(_drawnBatchesLabel); - AX_SAFE_RELEASE(_runningScene); - AX_SAFE_RELEASE(_notificationNode); - AX_SAFE_RELEASE(_scheduler); - AX_SAFE_RELEASE(_actionManager); + CC_SAFE_RELEASE(_runningScene); + CC_SAFE_RELEASE(_notificationNode); + CC_SAFE_RELEASE(_scheduler); + CC_SAFE_RELEASE(_actionManager); - 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); + 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); delete _renderer; delete _console; - AX_SAFE_RELEASE(_eventDispatcher); + CC_SAFE_RELEASE(_eventDispatcher); Configuration::destroyInstance(); ObjectFactory::destroyInstance(); s_SharedDirector = nullptr; -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING ScriptEngineManager::destroyInstance(); #endif -#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) exit(0); #endif } @@ -285,7 +285,7 @@ void Director::drawScene() if (_runningScene) { -#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION) || AX_USE_NAVMESH) +#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION) || CC_USE_NAVMESH) _runningScene->stepPhysicsAndNavigation(_deltaTime); #endif // clear draw stats @@ -308,7 +308,7 @@ void Director::drawScene() if (_statsDisplay) { -#if !AX_STRIP_FPS +#if !CC_STRIP_FPS showStats(); #endif } @@ -331,7 +331,7 @@ void Director::drawScene() if (_statsDisplay) { -#if !AX_STRIP_FPS +#if !CC_STRIP_FPS calculateMPF(); #endif } @@ -421,7 +421,7 @@ void Director::destroyTextureCache() if (_textureCache) { _textureCache->waitForQuit(); - AX_SAFE_RELEASE_NULL(_textureCache); + CC_SAFE_RELEASE_NULL(_textureCache); } } @@ -820,14 +820,14 @@ void Director::replaceScene(Scene* scene) ssize_t index = _scenesStack.size() - 1; _sendCleanupToScene = true; -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, scene); sEngine->releaseScriptObject(this, _scenesStack.at(index)); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.replace(index, scene); _nextScene = scene; @@ -839,13 +839,13 @@ void Director::pushScene(Scene* scene) _sendCleanupToScene = false; -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, scene); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.pushBack(scene); _nextScene = scene; } @@ -854,13 +854,13 @@ void Director::popScene() { CCASSERT(_runningScene != nullptr, "running scene should not null"); -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, _scenesStack.back()); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.popBack(); ssize_t c = _scenesStack.size(); @@ -899,13 +899,13 @@ void Director::popToSceneStackLevel(int level) auto firstOnStackScene = _scenesStack.back(); if (firstOnStackScene == _runningScene) { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, _scenesStack.back()); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.popBack(); --c; } @@ -921,13 +921,13 @@ void Director::popToSceneStackLevel(int level) } current->cleanup(); -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, _scenesStack.back()); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.popBack(); --c; } @@ -950,18 +950,18 @@ void Director::restart() void Director::reset() { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS if (_runningScene) { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS if (sEngine) { sEngine->releaseScriptObject(this, _runningScene); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_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 AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS if (sEngine) { for (const auto& scene : _scenesStack) @@ -1006,7 +1006,7 @@ void Director::reset() sEngine->releaseScriptObject(this, scene); } } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS while (!_scenesStack.empty()) { @@ -1015,10 +1015,10 @@ void Director::reset() stopAnimation(); - AX_SAFE_RELEASE_NULL(_notificationNode); - AX_SAFE_RELEASE_NULL(_FPSLabel); - AX_SAFE_RELEASE_NULL(_drawnBatchesLabel); - AX_SAFE_RELEASE_NULL(_drawnVerticesLabel); + CC_SAFE_RELEASE_NULL(_notificationNode); + CC_SAFE_RELEASE_NULL(_FPSLabel); + CC_SAFE_RELEASE_NULL(_drawnBatchesLabel); + CC_SAFE_RELEASE_NULL(_drawnVerticesLabel); // purge bitmap cache FontFNT::purgeCachedData(); @@ -1074,7 +1074,7 @@ void Director::restartDirector() startAnimation(); // Real restart in script level -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING ScriptEvent scriptEvent(kRestartGame, nullptr); ScriptEngineManager::sendEventToLua(scriptEvent); #endif @@ -1132,7 +1132,7 @@ void Director::pause() _oldAnimationInterval = _animationInterval; -#if AX_REDUCE_PAUSED_CPU_USAGE +#if CC_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 AX_REDUCE_PAUSED_CPU_USAGE +#if CC_REDUCE_PAUSED_CPU_USAGE setAnimationInterval(_oldAnimationInterval, SetIntervalReason::BY_ENGINE); #endif @@ -1169,7 +1169,7 @@ void Director::updateFrameRate() _frameRate = 1.0f / _deltaTime; } -#if !AX_STRIP_FPS +#if !CC_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 > AX_DIRECTOR_STATS_INTERVAL) + if (_accumDt > CC_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(); - AX_SAFE_RELEASE_NULL(_FPSLabel); - AX_SAFE_RELEASE_NULL(_drawnBatchesLabel); - AX_SAFE_RELEASE_NULL(_drawnVerticesLabel); + CC_SAFE_RELEASE_NULL(_FPSLabel); + CC_SAFE_RELEASE_NULL(_drawnBatchesLabel); + CC_SAFE_RELEASE_NULL(_drawnVerticesLabel); _textureCache->removeTextureForKey("/cc_fps_images"); FileUtils::getInstance()->purgeCachedEntries(); } @@ -1276,7 +1276,7 @@ void Director::createStatsLabel() } texture = _textureCache->addImage(image, "/cc_fps_images", PixelFormat::RGBA4); - AX_SAFE_RELEASE(image); + CC_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 / AX_CONTENT_SCALE_FACTOR(); + float scaleFactor = 1 / CC_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 / AX_CONTENT_SCALE_FACTOR()); + const int height_spacing = (int)(22 / CC_CONTENT_SCALE_FACTOR()); switch (anchor) { @@ -1391,7 +1391,7 @@ void Director::setStatsAnchor(AnchorPreset anchor) } } -#endif // #if !AX_STRIP_FPS +#endif // #if !CC_STRIP_FPS void Director::setContentScaleFactor(float scaleFactor) { @@ -1410,22 +1410,22 @@ void Director::setNotificationNode(Node* node) _notificationNode->onExit(); _notificationNode->cleanup(); } - AX_SAFE_RELEASE(_notificationNode); + CC_SAFE_RELEASE(_notificationNode); _notificationNode = node; if (node == nullptr) return; _notificationNode->onEnter(); _notificationNode->onEnterTransitionDidFinish(); - AX_SAFE_RETAIN(_notificationNode); + CC_SAFE_RETAIN(_notificationNode); } void Director::setScheduler(Scheduler* scheduler) { if (_scheduler != scheduler) { - AX_SAFE_RETAIN(scheduler); - AX_SAFE_RELEASE(_scheduler); + CC_SAFE_RETAIN(scheduler); + CC_SAFE_RELEASE(_scheduler); _scheduler = scheduler; } } @@ -1434,8 +1434,8 @@ void Director::setActionManager(ActionManager* actionManager) { if (_actionManager != actionManager) { - AX_SAFE_RETAIN(actionManager); - AX_SAFE_RELEASE(_actionManager); + CC_SAFE_RETAIN(actionManager); + CC_SAFE_RELEASE(_actionManager); _actionManager = actionManager; } } @@ -1444,8 +1444,8 @@ void Director::setEventDispatcher(EventDispatcher* dispatcher) { if (_eventDispatcher != dispatcher) { - AX_SAFE_RETAIN(dispatcher); - AX_SAFE_RELEASE(_eventDispatcher); + CC_SAFE_RETAIN(dispatcher); + CC_SAFE_RELEASE(_eventDispatcher); _eventDispatcher = dispatcher; } } diff --git a/core/base/CCDirector.h b/core/base/CCDirector.h index 27b6ff93a4..9a63a5dafb 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 AX_DLL Director : public Ref +class CC_DLL Director : public Ref { public: /** Director will trigger an event before set next scene. */ @@ -524,7 +524,7 @@ protected: void setNextScene(); void updateFrameRate(); -#if !AX_STRIP_FPS +#if !CC_STRIP_FPS void showStats(); void createStatsLabel(); void calculateMPF(); diff --git a/core/base/CCEvent.h b/core/base/CCEvent.h index 80950b9ca8..649a56eaae 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 AX_DLL Event : public Ref +class CC_DLL Event : public Ref { public: /** Type Event type.*/ diff --git a/core/base/CCEventAcceleration.h b/core/base/CCEventAcceleration.h index 6786abb1e5..f396e0445a 100644 --- a/core/base/CCEventAcceleration.h +++ b/core/base/CCEventAcceleration.h @@ -39,7 +39,7 @@ NS_AX_BEGIN /** @class EventAcceleration * @brief Accelerometer event. */ -class AX_DLL EventAcceleration : public Event +class CC_DLL EventAcceleration : public Event { public: /** Constructor. diff --git a/core/base/CCEventController.h b/core/base/CCEventController.h index afe0cff186..9bbcf28153 100644 --- a/core/base/CCEventController.h +++ b/core/base/CCEventController.h @@ -44,7 +44,7 @@ class EventListenerController; /** @class EventController * @brief Controller event. */ -class AX_DLL EventController : public Event +class CC_DLL EventController : public Event { public: /** ControllerEventType Controller event type.*/ diff --git a/core/base/CCEventCustom.h b/core/base/CCEventCustom.h index c0912a4331..69190a4031 100644 --- a/core/base/CCEventCustom.h +++ b/core/base/CCEventCustom.h @@ -39,7 +39,7 @@ NS_AX_BEGIN /** @class EventCustom * @brief Custom event. */ -class AX_DLL EventCustom : public Event +class CC_DLL EventCustom : public Event { public: /** Constructor. diff --git a/core/base/CCEventDispatcher.cpp b/core/base/CCEventDispatcher.cpp index a3aeb7f85d..36408c7917 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 (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) +#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) # include "base/CCEventListenerController.h" #endif #include "2d/CCScene.h" @@ -90,9 +90,9 @@ static EventListener::ListenerID __getListenerID(Event* event) // EventListenerTouchAllAtOnce. return UNKNOWN instead. CCASSERT(false, "Don't call this method if the event is for touch."); break; -#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) +#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) case Event::Type::GAME_CONTROLLER: ret = EventListenerController::LISTENER_ID; break; @@ -111,8 +111,8 @@ EventDispatcher::EventListenerVector::EventListenerVector() EventDispatcher::EventListenerVector::~EventListenerVector() { - AX_SAFE_DELETE(_sceneGraphListeners); - AX_SAFE_DELETE(_fixedListeners); + CC_SAFE_DELETE(_sceneGraphListeners); + CC_SAFE_DELETE(_fixedListeners); } size_t EventDispatcher::EventListenerVector::size() const @@ -134,7 +134,7 @@ bool EventDispatcher::EventListenerVector::empty() const void EventDispatcher::EventListenerVector::push_back(EventListener* listener) { -#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS +#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS CCASSERT(_sceneGraphListeners == nullptr || std::count(_sceneGraphListeners->begin(), _sceneGraphListeners->end(), listener) == 0, "Listener should not be added twice!"); @@ -439,13 +439,13 @@ void EventDispatcher::addEventListener(EventListener* listener) { _toAddedListeners.push_back(listener); } -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, listener); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS listener->retain(); } @@ -502,7 +502,7 @@ void EventDispatcher::addEventListenerWithSceneGraphPriority(EventListener* list addEventListener(listener); } -#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 +#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 void EventDispatcher::debugCheckNodeHasNoEventListenersOnDestruction(Node* node) { @@ -559,7 +559,7 @@ void EventDispatcher::debugCheckNodeHasNoEventListenersOnDestruction(Node* node) } } -#endif // #if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 +#endif // #if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 void EventDispatcher::addEventListenerWithFixedPriority(EventListener* listener, int fixedPriority) { @@ -607,7 +607,7 @@ void EventDispatcher::removeEventListener(EventListener* listener) auto l = *iter; if (l == listener) { - AX_SAFE_RETAIN(l); + CC_SAFE_RETAIN(l); l->setRegistered(false); if (l->getAssociatedNode() != nullptr) { @@ -653,7 +653,7 @@ void EventDispatcher::removeEventListener(EventListener* listener) } } -#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS +#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS CCASSERT( _inDispatch != 0 || !sceneGraphPriorityListeners || std::count(sceneGraphPriorityListeners->begin(), sceneGraphPriorityListeners->end(), listener) == 0, @@ -669,7 +669,7 @@ void EventDispatcher::removeEventListener(EventListener* listener) _priorityDirtyFlagMap.erase(listener->getListenerID()); auto list = iter->second; iter = _listenerMap.erase(iter); - AX_SAFE_DELETE(list); + CC_SAFE_DELETE(list); } else { @@ -1603,7 +1603,7 @@ void EventDispatcher::cleanToRemovedListeners() } } else - AX_SAFE_RELEASE(l); + CC_SAFE_RELEASE(l); } _toRemovedListeners.clear(); @@ -1611,14 +1611,14 @@ void EventDispatcher::cleanToRemovedListeners() void EventDispatcher::releaseListener(EventListener* listener) { -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (listener && sEngine) { sEngine->releaseScriptObject(this, listener); } -#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS - AX_SAFE_RELEASE(listener); +#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS + CC_SAFE_RELEASE(listener); } NS_AX_END diff --git a/core/base/CCEventDispatcher.h b/core/base/CCEventDispatcher.h index 4a36dc636a..9f0e0d86bb 100644 --- a/core/base/CCEventDispatcher.h +++ b/core/base/CCEventDispatcher.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_EVENT_DISPATCHER_H__ -#define __AX_EVENT_DISPATCHER_H__ +#ifndef __CC_EVENT_DISPATCHER_H__ +#define __CC_EVENT_DISPATCHER_H__ #include #include @@ -60,7 +60,7 @@ from within an EventListener, while events are being dispatched. @js NA */ -class AX_DLL EventDispatcher : public Ref +class CC_DLL EventDispatcher : public Ref { public: // Adds event listener. @@ -196,7 +196,7 @@ public: */ ~EventDispatcher(); -#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 +#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 /** * To help track down event listener issues in debug builds. @@ -360,4 +360,4 @@ NS_AX_END // end of base group /// @} -#endif // __AX_EVENT_DISPATCHER_H__ +#endif // __CC_EVENT_DISPATCHER_H__ diff --git a/core/base/CCEventFocus.h b/core/base/CCEventFocus.h index 86f6373735..3a0958846d 100644 --- a/core/base/CCEventFocus.h +++ b/core/base/CCEventFocus.h @@ -44,7 +44,7 @@ class Widget; /** @class EventFocus * @brief Focus event. */ -class AX_DLL EventFocus : public Event +class CC_DLL EventFocus : public Event { public: /** Constructor. diff --git a/core/base/CCEventKeyboard.h b/core/base/CCEventKeyboard.h index 7fd206de63..38823e029c 100644 --- a/core/base/CCEventKeyboard.h +++ b/core/base/CCEventKeyboard.h @@ -39,7 +39,7 @@ NS_AX_BEGIN /** @class EventKeyboard * @brief Keyboard event. */ -class AX_DLL EventKeyboard : public Event +class CC_DLL EventKeyboard : public Event { public: /** diff --git a/core/base/CCEventListener.h b/core/base/CCEventListener.h index 2b61aa9998..02f4d0ac44 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 AX_DLL EventListener : public Ref +class CC_DLL EventListener : public Ref { public: /** Type Event type.*/ diff --git a/core/base/CCEventListenerAcceleration.cpp b/core/base/CCEventListenerAcceleration.cpp index 2e2ee39de2..bf43f27831 100644 --- a/core/base/CCEventListenerAcceleration.cpp +++ b/core/base/CCEventListenerAcceleration.cpp @@ -47,7 +47,7 @@ EventListenerAcceleration* EventListenerAcceleration::create(const std::function } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -79,7 +79,7 @@ EventListenerAcceleration* EventListenerAcceleration::clone() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; diff --git a/core/base/CCEventListenerAcceleration.h b/core/base/CCEventListenerAcceleration.h index 1aec200528..52b355ac2c 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 AX_DLL EventListenerAcceleration : public EventListener +class CC_DLL EventListenerAcceleration : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerController.cpp b/core/base/CCEventListenerController.cpp index 380b011f33..1b50f52231 100644 --- a/core/base/CCEventListenerController.cpp +++ b/core/base/CCEventListenerController.cpp @@ -42,7 +42,7 @@ EventListenerController* EventListenerController::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerController.h b/core/base/CCEventListenerController.h index e612b2ee00..a0d44df411 100644 --- a/core/base/CCEventListenerController.h +++ b/core/base/CCEventListenerController.h @@ -44,7 +44,7 @@ class Controller; * @param Controller event listener. * @js NA */ -class AX_DLL EventListenerController : public EventListener +class CC_DLL EventListenerController : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerCustom.cpp b/core/base/CCEventListenerCustom.cpp index cac8bca754..0ca3e279d7 100644 --- a/core/base/CCEventListenerCustom.cpp +++ b/core/base/CCEventListenerCustom.cpp @@ -40,7 +40,7 @@ EventListenerCustom* EventListenerCustom::create(std::string_view eventName, } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -74,7 +74,7 @@ EventListenerCustom* EventListenerCustom::clone() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerCustom.h b/core/base/CCEventListenerCustom.h index 37fa114582..f4b22d06f2 100644 --- a/core/base/CCEventListenerCustom.h +++ b/core/base/CCEventListenerCustom.h @@ -58,7 +58,7 @@ class EventCustom; * \endcode * @js cc._EventListenerCustom */ -class AX_DLL EventListenerCustom : public EventListener +class CC_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 ba56eed15b..b67da31491 100644 --- a/core/base/CCEventListenerFocus.cpp +++ b/core/base/CCEventListenerFocus.cpp @@ -47,7 +47,7 @@ EventListenerFocus* EventListenerFocus::create() ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -62,7 +62,7 @@ EventListenerFocus* EventListenerFocus::clone() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerFocus.h b/core/base/CCEventListenerFocus.h index 5d32b53311..ab8e407786 100644 --- a/core/base/CCEventListenerFocus.h +++ b/core/base/CCEventListenerFocus.h @@ -44,7 +44,7 @@ class Widget; /** @class EventListenerFocus * @brief Focus event listener. */ -class AX_DLL EventListenerFocus : public EventListener +class CC_DLL EventListenerFocus : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerKeyboard.cpp b/core/base/CCEventListenerKeyboard.cpp index a19d338b7c..dcd464af8a 100644 --- a/core/base/CCEventListenerKeyboard.cpp +++ b/core/base/CCEventListenerKeyboard.cpp @@ -51,7 +51,7 @@ EventListenerKeyboard* EventListenerKeyboard::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -67,7 +67,7 @@ EventListenerKeyboard* EventListenerKeyboard::clone() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerKeyboard.h b/core/base/CCEventListenerKeyboard.h index eeb5b69269..c25f9e4e31 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 AX_DLL EventListenerKeyboard : public EventListener +class CC_DLL EventListenerKeyboard : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerMouse.cpp b/core/base/CCEventListenerMouse.cpp index 6bc360a72f..d7c6999216 100644 --- a/core/base/CCEventListenerMouse.cpp +++ b/core/base/CCEventListenerMouse.cpp @@ -44,7 +44,7 @@ EventListenerMouse* EventListenerMouse::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -62,7 +62,7 @@ EventListenerMouse* EventListenerMouse::clone() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerMouse.h b/core/base/CCEventListenerMouse.h index 6fce6bae7e..00631ab177 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 AX_DLL EventListenerMouse : public EventListener +class CC_DLL EventListenerMouse : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerTouch.cpp b/core/base/CCEventListenerTouch.cpp index 6140914cfc..f4c136afac 100644 --- a/core/base/CCEventListenerTouch.cpp +++ b/core/base/CCEventListenerTouch.cpp @@ -76,7 +76,7 @@ EventListenerTouchOneByOne* EventListenerTouchOneByOne::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -111,7 +111,7 @@ EventListenerTouchOneByOne* EventListenerTouchOneByOne::clone() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -148,7 +148,7 @@ EventListenerTouchAllAtOnce* EventListenerTouchAllAtOnce::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -179,7 +179,7 @@ EventListenerTouchAllAtOnce* EventListenerTouchAllAtOnce::clone() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerTouch.h b/core/base/CCEventListenerTouch.h index d7c9beb717..7ec050ffe0 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 AX_DLL EventListenerTouchOneByOne : public EventListener +class CC_DLL EventListenerTouchOneByOne : public EventListener { public: static const std::string LISTENER_ID; @@ -96,7 +96,7 @@ private: /** @class EventListenerTouchAllAtOnce * @brief Multiple touches event listener. */ -class AX_DLL EventListenerTouchAllAtOnce : public EventListener +class CC_DLL EventListenerTouchAllAtOnce : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventMouse.h b/core/base/CCEventMouse.h index c1a81c34b5..24ed182cc9 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 AX_DLL EventMouse : public Event +class CC_DLL EventMouse : public Event { public: /** diff --git a/core/base/CCEventTouch.h b/core/base/CCEventTouch.h index 2b0347d40b..f2a042ed1f 100644 --- a/core/base/CCEventTouch.h +++ b/core/base/CCEventTouch.h @@ -43,7 +43,7 @@ class Touch; /** @class EventTouch * @brief Touch event. */ -class AX_DLL EventTouch : public Event +class CC_DLL EventTouch : public Event { public: static const int MAX_TOUCHES = 15; diff --git a/core/base/CCIMEDelegate.h b/core/base/CCIMEDelegate.h index 1ad7499a4a..29ff4fb0e9 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 __AX_IME_DELEGATE_H__ -#define __AX_IME_DELEGATE_H__ +#ifndef __CC_IME_DELEGATE_H__ +#define __CC_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 AX_DLL STD_STRING_EMPTY; +extern const std::string CC_DLL STD_STRING_EMPTY; /** * Keyboard notification event type. @@ -55,7 +55,7 @@ typedef struct /** *@brief Input method editor delegate. */ -class AX_DLL IMEDelegate +class CC_DLL IMEDelegate { public: /** @@ -175,4 +175,4 @@ NS_AX_END // end of base group /// @} -#endif // __AX_IME_DELEGATE_H__ +#endif // __CC_IME_DELEGATE_H__ diff --git a/core/base/CCIMEDispatcher.cpp b/core/base/CCIMEDispatcher.cpp index c1a06332c1..4bfed04244 100644 --- a/core/base/CCIMEDispatcher.cpp +++ b/core/base/CCIMEDispatcher.cpp @@ -100,7 +100,7 @@ IMEDispatcher::IMEDispatcher() : _impl(new IMEDispatcher::Impl) IMEDispatcher::~IMEDispatcher() { - AX_SAFE_DELETE(_impl); + CC_SAFE_DELETE(_impl); } ////////////////////////////////////////////////////////////////////////// @@ -126,13 +126,13 @@ bool IMEDispatcher::attachDelegateWithIME(IMEDelegate* delegate) bool ret = false; do { - AX_BREAK_IF(!_impl || !delegate); + CC_BREAK_IF(!_impl || !delegate); DelegateIter end = _impl->_delegateList.end(); DelegateIter iter = _impl->findDelegate(delegate); // if pDelegate is not in delegate list, return - AX_BREAK_IF(end == iter); + CC_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. - AX_BREAK_IF(!_impl->_delegateWithIme->canDetachWithIME() || !delegate->canAttachWithIME()); + CC_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 - AX_BREAK_IF(!delegate->canAttachWithIME()); + CC_BREAK_IF(!delegate->canAttachWithIME()); _impl->_delegateWithIme = *iter; delegate->didAttachWithIME(); @@ -170,12 +170,12 @@ bool IMEDispatcher::detachDelegateWithIME(IMEDelegate* delegate) bool ret = false; do { - AX_BREAK_IF(!_impl || !delegate); + CC_BREAK_IF(!_impl || !delegate); // if pDelegate is not the current delegate attached to IME, return - AX_BREAK_IF(_impl->_delegateWithIme != delegate); + CC_BREAK_IF(_impl->_delegateWithIme != delegate); - AX_BREAK_IF(!delegate->canDetachWithIME()); + CC_BREAK_IF(!delegate->canDetachWithIME()); _impl->_delegateWithIme = 0; delegate->didDetachWithIME(); @@ -188,11 +188,11 @@ void IMEDispatcher::removeDelegate(IMEDelegate* delegate) { do { - AX_BREAK_IF(!delegate || !_impl); + CC_BREAK_IF(!delegate || !_impl); DelegateIter iter = _impl->findDelegate(delegate); DelegateIter end = _impl->_delegateList.end(); - AX_BREAK_IF(end == iter); + CC_BREAK_IF(end == iter); if (_impl->_delegateWithIme) @@ -212,10 +212,10 @@ void IMEDispatcher::dispatchInsertText(const char* text, size_t len) { do { - AX_BREAK_IF(!_impl || !text || len <= 0); + CC_BREAK_IF(!_impl || !text || len <= 0); // there is no delegate attached to IME - AX_BREAK_IF(!_impl->_delegateWithIme); + CC_BREAK_IF(!_impl->_delegateWithIme); _impl->_delegateWithIme->insertText(text, len); } while (0); @@ -225,10 +225,10 @@ void IMEDispatcher::dispatchDeleteBackward() { do { - AX_BREAK_IF(!_impl); + CC_BREAK_IF(!_impl); // there is no delegate attached to IME - AX_BREAK_IF(!_impl->_delegateWithIme); + CC_BREAK_IF(!_impl->_delegateWithIme); _impl->_delegateWithIme->deleteBackward(); } while (0); @@ -238,10 +238,10 @@ void IMEDispatcher::dispatchControlKey(EventKeyboard::KeyCode keyCode) { do { - AX_BREAK_IF(!_impl); + CC_BREAK_IF(!_impl); // there is no delegate attached to IME - AX_BREAK_IF(!_impl->_delegateWithIme); + CC_BREAK_IF(!_impl->_delegateWithIme); _impl->_delegateWithIme->controlKey(keyCode); } while (0); diff --git a/core/base/CCIMEDispatcher.h b/core/base/CCIMEDispatcher.h index dc83a7ceeb..eafd22bf45 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 __AX_IME_DISPATCHER_H__ -#define __AX_IME_DISPATCHER_H__ +#ifndef __CC_IME_DISPATCHER_H__ +#define __CC_IME_DISPATCHER_H__ #include "base/CCIMEDelegate.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN /** @brief Input Method Edit Message Dispatcher. */ -class AX_DLL IMEDispatcher +class CC_DLL IMEDispatcher { public: /** @@ -140,4 +140,4 @@ NS_AX_END // end of base group /// @} -#endif // __AX_IME_DISPATCHER_H__ +#endif // __CC_IME_DISPATCHER_H__ diff --git a/core/base/CCNS.cpp b/core/base/CCNS.cpp index d4439d9fd4..97fcdc03e6 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 { - AX_BREAK_IF(content.empty()); + CC_BREAK_IF(content.empty()); size_t nPosLeft = content.find('{'); size_t nPosRight = content.find('}'); // don't have '{' and '}' - AX_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); + CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); // '}' is before '{' - AX_BREAK_IF(nPosLeft > nPosRight); + CC_BREAK_IF(nPosLeft > nPosRight); auto pointStr = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1); // nothing between '{' and '}' - AX_BREAK_IF(pointStr.empty()); + CC_BREAK_IF(pointStr.empty()); size_t nPos1 = pointStr.find('{'); size_t nPos2 = pointStr.find('}'); // contain '{' or '}' - AX_BREAK_IF(nPos1 != std::string::npos || nPos2 != std::string::npos); + CC_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 { - AX_BREAK_IF(str.empty()); + CC_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); } - AX_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); + CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); content = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1); size_t nPointEnd = content.find('}'); - AX_BREAK_IF(nPointEnd == std::string::npos); + CC_BREAK_IF(nPointEnd == std::string::npos); nPointEnd = content.find(',', nPointEnd); - AX_BREAK_IF(nPointEnd == std::string::npos); + CC_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; - AX_BREAK_IF(!splitWithForm(pointStr, pointInfo)); + CC_BREAK_IF(!splitWithForm(pointStr, pointInfo)); strArray sizeInfo; - AX_BREAK_IF(!splitWithForm(sizeStr, sizeInfo)); + CC_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; - AX_BREAK_IF(!splitWithForm(str, strs)); + CC_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; - AX_BREAK_IF(!splitWithForm(pszContent, strs)); + CC_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 0dc9c7a1fb..e0f3b9114f 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 AX_DLL RectFromString(std::string_view str); +Rect CC_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 AX_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 AX_DLL PointFromString(std::string_view str); +Vec2 CC_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 AX_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 AX_DLL SizeFromString(std::string_view str); +Vec2 CC_DLL SizeFromString(std::string_view str); // end of data_structure group /** @} */ diff --git a/core/base/CCNinePatchImageParser.cpp b/core/base/CCNinePatchImageParser.cpp index 3d765e4e39..64ffd0c67e 100644 --- a/core/base/CCNinePatchImageParser.cpp +++ b/core/base/CCNinePatchImageParser.cpp @@ -166,7 +166,7 @@ Rect NinePatchImageParser::parseCapInset() const verticalLine.y - verticalLine.x); } - capInsets = AX_RECT_PIXELS_TO_POINTS(capInsets); + capInsets = CC_RECT_PIXELS_TO_POINTS(capInsets); return capInsets; } diff --git a/core/base/CCNinePatchImageParser.h b/core/base/CCNinePatchImageParser.h index d248b2598c..ec189a16c6 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 AX_DLL NinePatchImageParser +class CC_DLL NinePatchImageParser { public: /** diff --git a/core/base/CCProfiling.h b/core/base/CCProfiling.h index 340160af94..fbb1f551bc 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 AX_ENABLE_PROFILERS=1 in the ccConfig.h file + To use it, enable set the CC_ENABLE_PROFILERS=1 in the ccConfig.h file */ -class AX_DLL Profiler : public Ref +class CC_DLL Profiler : public Ref { public: /** @@ -140,9 +140,9 @@ public: int32_t numberOfCalls; }; -extern void AX_DLL ProfilingBeginTimingBlock(const char* timerName); -extern void AX_DLL ProfilingEndTimingBlock(const char* timerName); -extern void AX_DLL ProfilingResetTimingBlock(const char* timerName); +extern void CC_DLL ProfilingBeginTimingBlock(const char* timerName); +extern void CC_DLL ProfilingEndTimingBlock(const char* timerName); +extern void CC_DLL ProfilingResetTimingBlock(const char* timerName); /* * cocos2d profiling categories diff --git a/core/base/CCProperties.cpp b/core/base/CCProperties.cpp index dbaacfcb88..4d1f768ecb 100644 --- a/core/base/CCProperties.cpp +++ b/core/base/CCProperties.cpp @@ -123,7 +123,7 @@ Properties* Properties::createNonRefCounted(std::string_view url) if (!p) { CCLOGWARN("Failed to load properties from url '%s'.", url.data()); - AX_SAFE_DELETE(properties); + CC_SAFE_DELETE(properties); return nullptr; } @@ -133,7 +133,7 @@ Properties* Properties::createNonRefCounted(std::string_view url) if (p != properties) { p = p->clone(); - AX_SAFE_DELETE(properties); + CC_SAFE_DELETE(properties); } // XXX // p->setDirectoryPath(FileSystem::getDirectoryName(fileString)); @@ -411,13 +411,13 @@ void Properties::readProperties() Properties::~Properties() { - AX_SAFE_DELETE(_dirPath); + CC_SAFE_DELETE(_dirPath); for (size_t i = 0, count = _namespaces.size(); i < count; ++i) { - AX_SAFE_DELETE(_namespaces[i]); + CC_SAFE_DELETE(_namespaces[i]); } - AX_SAFE_DELETE(_variables); + CC_SAFE_DELETE(_variables); } // @@ -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++) { - AX_SAFE_DELETE(derived->_namespaces[i]); + CC_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. - AX_SAFE_DELETE(overrides); + CC_SAFE_DELETE(overrides); } } @@ -1089,7 +1089,7 @@ void Properties::setDirectoryPath(const std::string* path) } else { - AX_SAFE_DELETE(_dirPath); + CC_SAFE_DELETE(_dirPath); } } diff --git a/core/base/CCProperties.h b/core/base/CCProperties.h index ba9668fa4d..1025134ff0 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 AX_DLL Properties +class CC_DLL Properties { public: /** diff --git a/core/base/CCProtocols.h b/core/base/CCProtocols.h index 00b02cf263..8625dea95a 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 AX_DLL __RGBAProtocol +class CC_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 AX_DLL BlendProtocol +class CC_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 AX_DLL TextureProtocol : public BlendProtocol +class CC_DLL TextureProtocol : public BlendProtocol { public: virtual ~TextureProtocol() {} @@ -229,7 +229,7 @@ public: /** * Common interface for Labels */ -class AX_DLL LabelProtocol +class CC_DLL LabelProtocol { public: virtual ~LabelProtocol() {} @@ -256,7 +256,7 @@ public: /** * OpenGL projection protocol */ -class AX_DLL DirectorDelegate +class CC_DLL DirectorDelegate { public: virtual ~DirectorDelegate() {} @@ -272,7 +272,7 @@ public: /** * interface for playable items */ -class AX_DLL PlayableProtocol +class CC_DLL PlayableProtocol { public: virtual ~PlayableProtocol() {} diff --git a/core/base/CCRef.cpp b/core/base/CCRef.cpp index 9b01d0123a..e1af11b336 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 AX_REF_LEAK_DETECTION +#if CC_REF_LEAK_DETECTION # include // std::find # include # include @@ -38,41 +38,41 @@ THE SOFTWARE. NS_AX_BEGIN -#if AX_REF_LEAK_DETECTION +#if CC_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 AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING , _luaID(0) , _scriptObject(nullptr) , _rooted(false) #endif { -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING static unsigned int uObjectCount = 0; _ID = ++uObjectCount; #endif -#if AX_REF_LEAK_DETECTION +#if CC_REF_LEAK_DETECTION trackRef(this); #endif } Ref::~Ref() { -#if AX_ENABLE_SCRIPT_BINDING +#if CC_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 // AX_ENABLE_SCRIPT_BINDING +#endif // CC_ENABLE_SCRIPT_BINDING -#if AX_REF_LEAK_DETECTION +#if CC_REF_LEAK_DETECTION if (_referenceCount != 0) untrackRef(this); #endif @@ -127,7 +127,7 @@ void Ref::release() } #endif -#if AX_REF_LEAK_DETECTION +#if CC_REF_LEAK_DETECTION untrackRef(this); #endif delete this; @@ -145,7 +145,7 @@ unsigned int Ref::getReferenceCount() const return _referenceCount; } -#if AX_REF_LEAK_DETECTION +#if CC_REF_LEAK_DETECTION static std::vector __refAllocationList; static std::mutex __refMutex; @@ -164,7 +164,7 @@ void Ref::printLeaks() for (const auto& ref : __refAllocationList) { - AX_ASSERT(ref); + CC_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()); @@ -194,6 +194,6 @@ static void untrackRef(Ref* ref) __refAllocationList.erase(iter); } -#endif // #if AX_REF_LEAK_DETECTION +#endif // #if CC_REF_LEAK_DETECTION NS_AX_END diff --git a/core/base/CCRef.h b/core/base/CCRef.h index 9a74e8ded1..7beeedd2e6 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 AX_REF_LEAK_DETECTION 0 +#define CC_REF_LEAK_DETECTION 0 /** * @addtogroup base @@ -45,7 +45,7 @@ class Ref; * @lua NA * @js NA */ -class AX_DLL Clonable +class CC_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 AX_DLL Ref +class CC_DLL Ref { public: /** @@ -138,7 +138,7 @@ protected: friend class AutoreleasePool; -#if AX_ENABLE_SCRIPT_BINDING +#if CC_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 AX_REF_LEAK_DETECTION is defined and its value isn't zero) -#if AX_REF_LEAK_DETECTION + // Memory leak diagnostic data (only included when CC_REF_LEAK_DETECTION is defined and its value isn't zero) +#if CC_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 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) +#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) NS_AX_END // end of base group diff --git a/core/base/CCRefPtr.h b/core/base/CCRefPtr.h index 4b78ee6637..7e92da5fe2 100644 --- a/core/base/CCRefPtr.h +++ b/core/base/CCRefPtr.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_REF_PTR_H__ -#define __AX_REF_PTR_H__ +#ifndef __CC_REF_PTR_H__ +#define __CC_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 AX_REF_PTR_SAFE_RETAIN(ptr) \ +#define CC_REF_PTR_SAFE_RETAIN(ptr) \ \ do \ { \ @@ -50,7 +50,7 @@ NS_AX_BEGIN \ } while (0); -#define AX_REF_PTR_SAFE_RELEASE(ptr) \ +#define CC_REF_PTR_SAFE_RELEASE(ptr) \ \ do \ { \ @@ -61,7 +61,7 @@ NS_AX_BEGIN \ } while (0); -#define AX_REF_PTR_SAFE_RELEASE_NULL(ptr) \ +#define CC_REF_PTR_SAFE_RELEASE_NULL(ptr) \ \ do \ { \ @@ -102,7 +102,7 @@ public: other._ptr = nullptr; } - RefPtr(T* ptr) : _ptr(ptr) { AX_REF_PTR_SAFE_RETAIN(_ptr); } + RefPtr(T* ptr) : _ptr(ptr) { CC_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) { AX_REF_PTR_SAFE_RETAIN(_ptr); } + RefPtr(const RefPtr& other) : _ptr(other._ptr) { CC_REF_PTR_SAFE_RETAIN(_ptr); } - ~RefPtr() { AX_REF_PTR_SAFE_RELEASE_NULL(_ptr); } + ~RefPtr() { CC_REF_PTR_SAFE_RELEASE_NULL(_ptr); } RefPtr& operator=(const RefPtr& other) { if (other._ptr != _ptr) { - AX_REF_PTR_SAFE_RETAIN(other._ptr); - AX_REF_PTR_SAFE_RELEASE(_ptr); + CC_REF_PTR_SAFE_RETAIN(other._ptr); + CC_REF_PTR_SAFE_RELEASE(_ptr); _ptr = other._ptr; } @@ -130,7 +130,7 @@ public: { if (&other != this) { - AX_REF_PTR_SAFE_RELEASE(_ptr); + CC_REF_PTR_SAFE_RELEASE(_ptr); _ptr = other._ptr; other._ptr = nullptr; } @@ -142,8 +142,8 @@ public: { if (other != _ptr) { - AX_REF_PTR_SAFE_RETAIN(other); - AX_REF_PTR_SAFE_RELEASE(_ptr); + CC_REF_PTR_SAFE_RETAIN(other); + CC_REF_PTR_SAFE_RELEASE(_ptr); _ptr = other; } @@ -152,7 +152,7 @@ public: RefPtr& operator=(std::nullptr_t other) { - AX_REF_PTR_SAFE_RELEASE_NULL(_ptr); + CC_REF_PTR_SAFE_RELEASE_NULL(_ptr); return *this; } @@ -214,7 +214,7 @@ public: explicit operator bool() const { return _ptr != nullptr; } - void reset() { AX_REF_PTR_SAFE_RELEASE_NULL(_ptr); } + void reset() { CC_REF_PTR_SAFE_RELEASE_NULL(_ptr); } void swap(RefPtr& other) { @@ -242,7 +242,7 @@ public: */ void weakAssign(const RefPtr& other) { - AX_REF_PTR_SAFE_RELEASE(_ptr); + CC_REF_PTR_SAFE_RELEASE(_ptr); _ptr = other._ptr; } @@ -328,11 +328,11 @@ RefPtr dynamic_pointer_cast(const RefPtr& r) /** * Done with these macros. */ -#undef AX_REF_PTR_SAFE_RETAIN -#undef AX_REF_PTR_SAFE_RELEASE -#undef AX_REF_PTR_SAFE_RELEASE_NULL +#undef CC_REF_PTR_SAFE_RETAIN +#undef CC_REF_PTR_SAFE_RELEASE +#undef CC_REF_PTR_SAFE_RELEASE_NULL NS_AX_END /// @endcond -#endif // __AX_REF_PTR_H__ +#endif // __CC_REF_PTR_H__ diff --git a/core/base/CCScheduler.cpp b/core/base/CCScheduler.cpp index 8f79c23985..1109449b2f 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 == AX_REPEAT_FOREVER) ? true : false; + _runForever = (_repeat == CC_REPEAT_FOREVER) ? true : false; _timesExecuted = 0; } @@ -214,7 +214,7 @@ void TimerTargetCallback::cancel() _scheduler->unschedule(_key, _target); } -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING // TimerScriptHandler @@ -259,7 +259,7 @@ Scheduler::Scheduler() , _currentTarget(nullptr) , _currentTargetSalvaged(false) , _updateHashLocked(false) -#if AX_ENABLE_SCRIPT_BINDING +#if CC_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, AX_REPEAT_FOREVER, 0.0f, paused, key); + this->schedule(callback, target, interval, CC_REPEAT_FOREVER, 0.0f, paused, key); } void Scheduler::schedule(const ccSchedulerFunc& callback, @@ -553,7 +553,7 @@ void Scheduler::removeUpdateFromHash(struct _listEntry* entry) // list entry DL_DELETE(*element->list, element->entry); if (!_updateHashLocked) - AX_SAFE_DELETE(element->entry); + CC_SAFE_DELETE(element->entry); else { element->entry->markedForDeletion = true; @@ -623,7 +623,7 @@ void Scheduler::unscheduleAllWithMinPriority(int minPriority) unscheduleUpdate(entry->target); } } -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING _scriptHandlerEntries.clear(); #endif } @@ -663,7 +663,7 @@ void Scheduler::unscheduleAllForTarget(void* target) unscheduleUpdate(target); } -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING unsigned int Scheduler::scheduleScriptFunc(unsigned int handler, float interval, bool paused) { SchedulerScriptHandlerEntry* entry = SchedulerScriptHandlerEntry::create(handler, interval, paused); @@ -916,7 +916,7 @@ void Scheduler::update(float dt) _updateHashLocked = false; _currentTarget = nullptr; -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING // // Script callbacks // @@ -1015,7 +1015,7 @@ void Scheduler::schedule(SEL_SCHEDULE selector, void Scheduler::schedule(SEL_SCHEDULE selector, Ref* target, float interval, bool paused) { - this->schedule(selector, target, interval, AX_REPEAT_FOREVER, 0.0f, paused); + this->schedule(selector, target, interval, CC_REPEAT_FOREVER, 0.0f, paused); } bool Scheduler::isScheduled(SEL_SCHEDULE selector, const Ref* target) const diff --git a/core/base/CCScheduler.h b/core/base/CCScheduler.h index c49837b411..4051b355a4 100644 --- a/core/base/CCScheduler.h +++ b/core/base/CCScheduler.h @@ -46,7 +46,7 @@ typedef std::function ccSchedulerFunc; /** * @cond */ -class AX_DLL Timer : public Ref +class CC_DLL Timer : public Ref { protected: Timer(); @@ -75,7 +75,7 @@ protected: bool _aborted; }; -class AX_DLL TimerTargetSelector : public Timer +class CC_DLL TimerTargetSelector : public Timer { public: TimerTargetSelector(); @@ -99,7 +99,7 @@ protected: SEL_SCHEDULE _selector; }; -class AX_DLL TimerTargetCallback : public Timer +class CC_DLL TimerTargetCallback : public Timer { public: TimerTargetCallback(); @@ -126,9 +126,9 @@ protected: std::string _key; }; -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING -class AX_DLL TimerScriptHandler : public Timer +class CC_DLL TimerScriptHandler : public Timer { public: bool initWithScriptHandler(int handler, float seconds); @@ -156,7 +156,7 @@ struct _listEntry; struct _hashSelectorEntry; struct _hashUpdateEntry; -#if AX_ENABLE_SCRIPT_BINDING +#if CC_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 AX_DLL Scheduler : public Ref +class CC_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 AX_REPEAT_FOREVER to let the action run continuously + again. repeat let the action be repeated repeat + 1 times, use CC_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 AX_REPEAT_FOREVER to let the action run continuously + again. repeat let the action be repeated repeat + 1 times, use CC_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 AX_ENABLE_SCRIPT_BINDING +#if CC_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 AX_ENABLE_SCRIPT_BINDING +#if CC_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 AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING Vector _scriptHandlerEntries; #endif diff --git a/core/base/CCScriptSupport.cpp b/core/base/CCScriptSupport.cpp index 5c526a362b..136382a740 100644 --- a/core/base/CCScriptSupport.cpp +++ b/core/base/CCScriptSupport.cpp @@ -26,12 +26,12 @@ #include "base/CCScriptSupport.h" -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING # include "base/CCScheduler.h" # include "2d/CCNode.h" -bool AX_DLL cc_assert_script_compatible(const char* msg) +bool CC_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 AX_ENABLE_SCRIPT_BINDING +#endif // #if CC_ENABLE_SCRIPT_BINDING diff --git a/core/base/CCScriptSupport.h b/core/base/CCScriptSupport.h index d2fa6edfe1..314a421d4c 100644 --- a/core/base/CCScriptSupport.h +++ b/core/base/CCScriptSupport.h @@ -41,7 +41,7 @@ * @{ */ -#if AX_ENABLE_SCRIPT_BINDING +#if CC_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 AX_DLL ScriptEngineProtocol +class CC_DLL ScriptEngineProtocol { public: /** @@ -783,7 +783,7 @@ class Node; * @since v0.99.5-x-0.8.5 * @js NA */ -class AX_DLL ScriptEngineManager +class CC_DLL ScriptEngineManager { public: /** @@ -866,7 +866,7 @@ private: NS_AX_END -#endif // #if AX_ENABLE_SCRIPT_BINDING +#endif // #if CC_ENABLE_SCRIPT_BINDING // end group /// @} diff --git a/core/base/CCStencilStateManager.cpp b/core/base/CCStencilStateManager.cpp index a682af37c4..48d9d12f85 100644 --- a/core/base/CCStencilStateManager.cpp +++ b/core/base/CCStencilStateManager.cpp @@ -66,7 +66,7 @@ StencilStateManager::StencilStateManager() StencilStateManager::~StencilStateManager() { - AX_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_programState); } void StencilStateManager::drawFullScreenQuadClearStencil(float globalZOrder) @@ -111,8 +111,8 @@ void StencilStateManager::updateLayerMask() void StencilStateManager::onBeforeVisit(float globalZOrder) { - _customCommand.setBeforeCallback(AX_CALLBACK_0(StencilStateManager::onBeforeDrawQuadCmd, this)); - _customCommand.setAfterCallback(AX_CALLBACK_0(StencilStateManager::onAfterDrawQuadCmd, this)); + _customCommand.setBeforeCallback(CC_CALLBACK_0(StencilStateManager::onBeforeDrawQuadCmd, this)); + _customCommand.setAfterCallback(CC_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 2b1ba78310..0d168495bc 100644 --- a/core/base/CCStencilStateManager.h +++ b/core/base/CCStencilStateManager.h @@ -36,7 +36,7 @@ */ NS_AX_BEGIN -class AX_DLL StencilStateManager +class CC_DLL StencilStateManager { public: StencilStateManager(); @@ -50,7 +50,7 @@ public: float getAlphaThreshold() const; private: - AX_DISALLOW_COPY_AND_ASSIGN(StencilStateManager); + CC_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 0f6723d0f3..cf9b02f283 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 __AX_TOUCH_H__ -#define __AX_TOUCH_H__ +#ifndef __CC_TOUCH_H__ +#define __CC_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 AX_DLL Touch : public Ref +class CC_DLL Touch : public Ref { public: /** diff --git a/core/base/CCUserDefault.cpp b/core/base/CCUserDefault.cpp index 8c9b97f697..6b00d4b473 100644 --- a/core/base/CCUserDefault.cpp +++ b/core/base/CCUserDefault.cpp @@ -365,7 +365,7 @@ UserDefault* UserDefault::getInstance() void UserDefault::destroyInstance() { - AX_SAFE_DELETE(_userDefault); + CC_SAFE_DELETE(_userDefault); } void UserDefault::setDelegate(UserDefault* delegate) diff --git a/core/base/CCUserDefault.h b/core/base/CCUserDefault.h index 04106f25bb..a74540750c 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 AX_DLL UserDefault +class CC_DLL UserDefault { public: // get value methods diff --git a/core/base/CCValue.cpp b/core/base/CCValue.cpp index bb582c6816..d4986694ba 100644 --- a/core/base/CCValue.cpp +++ b/core/base/CCValue.cpp @@ -924,16 +924,16 @@ void Value::clear() _field.boolVal = false; break; case Type::STRING: - AX_SAFE_DELETE(_field.strVal); + CC_SAFE_DELETE(_field.strVal); break; case Type::VECTOR: - AX_SAFE_DELETE(_field.vectorVal); + CC_SAFE_DELETE(_field.vectorVal); break; case Type::MAP: - AX_SAFE_DELETE(_field.mapVal); + CC_SAFE_DELETE(_field.mapVal); break; case Type::INT_KEY_MAP: - AX_SAFE_DELETE(_field.intKeyMapVal); + CC_SAFE_DELETE(_field.intKeyMapVal); break; default: break; diff --git a/core/base/CCValue.h b/core/base/CCValue.h index b01c53be9d..afc2ff139e 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; -AX_DLL extern const ValueVector ValueVectorNull; -AX_DLL extern const ValueMap ValueMapNull; -AX_DLL extern const ValueMapIntKey ValueMapIntKeyNull; +CC_DLL extern const ValueVector ValueVectorNull; +CC_DLL extern const ValueMap ValueMapNull; +CC_DLL extern const ValueMapIntKey ValueMapIntKeyNull; /* * This class is provide as a wrapper of basic types, such as int and bool. */ -class AX_DLL Value +class CC_DLL Value { public: /** A predefined Value that has not value. */ diff --git a/core/base/ObjectFactory.cpp b/core/base/ObjectFactory.cpp index 7ed5428996..643b093ede 100644 --- a/core/base/ObjectFactory.cpp +++ b/core/base/ObjectFactory.cpp @@ -82,7 +82,7 @@ ObjectFactory* ObjectFactory::getInstance() void ObjectFactory::destroyInstance() { - AX_SAFE_DELETE(_sharedFactory); + CC_SAFE_DELETE(_sharedFactory); } Ref* ObjectFactory::createObject(std::string_view name) diff --git a/core/base/ObjectFactory.h b/core/base/ObjectFactory.h index 8e9b732c5f..0b9c6ed24b 100644 --- a/core/base/ObjectFactory.h +++ b/core/base/ObjectFactory.h @@ -34,12 +34,12 @@ THE SOFTWARE. NS_AX_BEGIN -class AX_DLL ObjectFactory +class CC_DLL ObjectFactory { public: typedef axis::Ref* (*Instance)(void); typedef std::function InstanceFunc; - struct AX_DLL TInfo + struct CC_DLL TInfo { TInfo(); TInfo(std::string_view type, Instance ins = nullptr); diff --git a/core/base/SimpleTimer.h b/core/base/SimpleTimer.h index 9bf757933c..7d5482a068 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; -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); +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); } // namespace stimer NS_AX_END diff --git a/core/base/TGAlib.cpp b/core/base/TGAlib.cpp index 7948ac5474..d5c89805ea 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; - AX_BREAK_IF((step + sizeof(unsigned char)) > bufSize); + CC_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; - AX_BREAK_IF((step + sizeof(signed short) * 2 + sizeof(unsigned char)) > bufSize); + CC_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; - AX_BREAK_IF((step + sizeof(unsigned char)) > bufSize); + CC_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; - AX_BREAK_IF((step + dataSize) > bufSize); + CC_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 - AX_BREAK_IF((step + sizeof(unsigned char)) > bufSize); + CC_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 - AX_BREAK_IF((step + sizeof(unsigned char) * mode) > bufSize); + CC_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 { - AX_BREAK_IF(!buffer); + CC_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 d460530fbf..db5bf1c4a4 100644 --- a/core/base/ZipUtils.cpp +++ b/core/base/ZipUtils.cpp @@ -398,7 +398,7 @@ 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 = AX_SWAP_INT16_BIG_TO_HOST(header->version); + unsigned int version = CC_SWAP_INT16_BIG_TO_HOST(header->version); if (version > 2) { CCLOG("cocos2d: Unsupported CCZ header format"); @@ -406,7 +406,7 @@ int ZipUtils::inflateCCZBuffer(const unsigned char* buffer, ssize_t bufferLen, u } // verify compression format - if (AX_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB) + if (CC_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB) { CCLOG("cocos2d: CCZ Unsupported compression method"); return -1; @@ -418,7 +418,7 @@ int ZipUtils::inflateCCZBuffer(const unsigned char* buffer, ssize_t bufferLen, u header = (struct CCZHeader*)buffer; // verify header version - unsigned int version = AX_SWAP_INT16_BIG_TO_HOST(header->version); + unsigned int version = CC_SWAP_INT16_BIG_TO_HOST(header->version); if (version > 0) { CCLOG("cocos2d: Unsupported CCZ header format"); @@ -426,7 +426,7 @@ int ZipUtils::inflateCCZBuffer(const unsigned char* buffer, ssize_t bufferLen, u } // verify compression format - if (AX_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB) + if (CC_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB) { CCLOG("cocos2d: CCZ Unsupported compression method"); return -1; @@ -441,7 +441,7 @@ int ZipUtils::inflateCCZBuffer(const unsigned char* buffer, ssize_t bufferLen, u #if COCOS2D_DEBUG > 0 // verify checksum in debug mode unsigned int calculated = checksumPvr(ints, enclen); - unsigned int required = AX_SWAP_INT32_BIG_TO_HOST(header->reserved); + unsigned int required = CC_SWAP_INT32_BIG_TO_HOST(header->reserved); if (calculated != required) { @@ -456,7 +456,7 @@ int ZipUtils::inflateCCZBuffer(const unsigned char* buffer, ssize_t bufferLen, u return -1; } - unsigned int len = AX_SWAP_INT32_BIG_TO_HOST(header->len); + unsigned int len = CC_SWAP_INT32_BIG_TO_HOST(header->len); *out = (unsigned char*)malloc(len); if (!*out) @@ -697,7 +697,7 @@ ZipFile::~ZipFile() unzClose(_data->zipFile); } - AX_SAFE_DELETE(_data); + CC_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 { - AX_BREAK_IF(!_data); - AX_BREAK_IF(!_data->zipFile); + CC_BREAK_IF(!_data); + CC_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 { - AX_BREAK_IF(!_data); + CC_BREAK_IF(!_data); ret = _data->fileList.find(fileName) != _data->fileList.end(); } while (false); @@ -798,24 +798,24 @@ unsigned char* ZipFile::getFileData(std::string_view fileName, ssize_t* size) do { - AX_BREAK_IF(!_data->zipFile); - AX_BREAK_IF(fileName.empty()); + CC_BREAK_IF(!_data->zipFile); + CC_BREAK_IF(fileName.empty()); auto it = _data->fileList.find(fileName); - AX_BREAK_IF(it == _data->fileList.end()); + CC_BREAK_IF(it == _data->fileList.end()); ZipEntryInfo& fileInfo = it->second; std::unique_lock lck(_data->zipFileMtx); int nRet = unzGoToFilePos(_data->zipFile, &fileInfo.pos); - AX_BREAK_IF(UNZ_OK != nRet); + CC_BREAK_IF(UNZ_OK != nRet); nRet = unzOpenCurrentFile(_data->zipFile); - AX_BREAK_IF(UNZ_OK != nRet); + CC_BREAK_IF(UNZ_OK != nRet); buffer = (unsigned char*)malloc(fileInfo.uncompressed_size); - int AX_UNUSED nSize = + int CC_UNUSED nSize = unzReadCurrentFile(_data->zipFile, buffer, static_cast(fileInfo.uncompressed_size)); CCASSERT(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong"); @@ -834,24 +834,24 @@ bool ZipFile::getFileData(std::string_view fileName, ResizableBuffer* buffer) bool res = false; do { - AX_BREAK_IF(!_data->zipFile); - AX_BREAK_IF(fileName.empty()); + CC_BREAK_IF(!_data->zipFile); + CC_BREAK_IF(fileName.empty()); ZipFilePrivate::FileListContainer::iterator it = _data->fileList.find(fileName); - AX_BREAK_IF(it == _data->fileList.end()); + CC_BREAK_IF(it == _data->fileList.end()); ZipEntryInfo& fileInfo = it->second; std::unique_lock lck(_data->zipFileMtx); int nRet = unzGoToFilePos(_data->zipFile, &fileInfo.pos); - AX_BREAK_IF(UNZ_OK != nRet); + CC_BREAK_IF(UNZ_OK != nRet); nRet = unzOpenCurrentFile(_data->zipFile); - AX_BREAK_IF(UNZ_OK != nRet); + CC_BREAK_IF(UNZ_OK != nRet); buffer->resize(fileInfo.uncompressed_size); - int AX_UNUSED nSize = + int CC_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"); unzCloseCurrentFile(_data->zipFile); @@ -937,12 +937,12 @@ int ZipFile::zfread(ZipFileStream* zfs, void* buf, unsigned int size) int n = 0; do { - AX_BREAK_IF(zfs == nullptr || zfs->offset >= zfs->entry->uncompressed_size); + CC_BREAK_IF(zfs == nullptr || zfs->offset >= zfs->entry->uncompressed_size); std::unique_lock lck(_data->zipFileMtx); int nRet = unzGoToFilePos(_data->zipFile, &zfs->entry->pos); - AX_BREAK_IF(UNZ_OK != nRet); + CC_BREAK_IF(UNZ_OK != nRet); nRet = unzOpenCurrentFile(_data->zipFile); unzSeek64(_data->zipFile, zfs->offset, SEEK_SET); @@ -1014,26 +1014,26 @@ unsigned char* ZipFile::getFileDataFromZip(std::string_view zipFilePath, std::st do { - AX_BREAK_IF(zipFilePath.empty()); + CC_BREAK_IF(zipFilePath.empty()); file = unzOpen(zipFilePath.data()); - AX_BREAK_IF(!file); + CC_BREAK_IF(!file); // minizip 1.2.0 is same with other platforms int ret = unzLocateFile(file, filename.data(), nullptr); - AX_BREAK_IF(UNZ_OK != ret); + CC_BREAK_IF(UNZ_OK != ret); char filePathA[260]; unz_file_info_s fileInfo; ret = unzGetCurrentFileInfo(file, &fileInfo, filePathA, sizeof(filePathA), nullptr, 0, nullptr, 0); - AX_BREAK_IF(UNZ_OK != ret); + CC_BREAK_IF(UNZ_OK != ret); ret = unzOpenCurrentFile(file); - AX_BREAK_IF(UNZ_OK != ret); + CC_BREAK_IF(UNZ_OK != ret); buffer = (unsigned char*)malloc(fileInfo.uncompressed_size); - int AX_UNUSED readedSize = unzReadCurrentFile(file, buffer, static_cast(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"); *size = fileInfo.uncompressed_size; diff --git a/core/base/ZipUtils.h b/core/base/ZipUtils.h index 49dabc5314..8c044f4334 100644 --- a/core/base/ZipUtils.h +++ b/core/base/ZipUtils.h @@ -33,9 +33,9 @@ THE SOFTWARE. #include "platform/CCFileUtils.h" #include -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) # include "platform/android/CCFileUtils-android.h" -#elif (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#elif (CC_TARGET_PLATFORM == CC_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 AX_DLL ZipUtils +class CC_DLL ZipUtils { public: /** @@ -237,7 +237,7 @@ struct ZipFileStream * * @since v2.0.5 */ -class AX_DLL ZipFile +class CC_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. */ - AX_DEPRECATED() + CC_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 179a26207d..745dde04bc 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 (AX_TARGET_PLATFORM != AX_PLATFORM_BADA) +#if (CC_TARGET_PLATFORM != CC_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 (AX_TARGET_PLATFORM != AX_PLATFORM_BADA) +#if (CC_TARGET_PLATFORM != CC_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 (AX_TARGET_PLATFORM != AX_PLATFORM_BADA) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) printf("Base64Utils: error decoding"); #endif free(*out); diff --git a/core/base/base64.h b/core/base/base64.h index 8e54029415..a6e16f5e7c 100644 --- a/core/base/base64.h +++ b/core/base/base64.h @@ -44,7 +44,7 @@ NS_AX_BEGIN * @since v0.8.1 */ -int AX_DLL base64Decode(const unsigned char* in, unsigned int inLength, unsigned char** out); +int CC_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 AX_DLL base64Decode(const unsigned char* in, unsigned int inLength, unsigned * @since v2.1.4 */ -int AX_DLL base64Encode(const unsigned char* in, unsigned int inLength, char** out); +int CC_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 497c5c1b90..8e84e46484 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 AX_ENABLE_BITMASK_OPS(_BITMASK) \ +#define CC_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 AX_ENABLE_BITSHIFT_OPS(_BITMASK) \ +#define CC_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 e8668c2177..8ee244c4d9 100644 --- a/core/base/ccCArray.cpp +++ b/core/base/ccCArray.cpp @@ -101,7 +101,7 @@ void ccArrayShrink(ccArray* arr) } } -/** Returns index of first occurrence of object, AX_INVALID_INDEX if object not found. */ +/** Returns index of first occurrence of object, CC_INVALID_INDEX if object not found. */ ssize_t ccArrayGetIndexOfObject(ccArray* arr, Ref* object) { const auto arrNum = arr->num; @@ -112,13 +112,13 @@ ssize_t ccArrayGetIndexOfObject(ccArray* arr, Ref* object) return i; } - return AX_INVALID_INDEX; + return CC_INVALID_INDEX; } /** Returns a Boolean value that indicates whether object is present in array. */ bool ccArrayContainsObject(ccArray* arr, Ref* object) { - return ccArrayGetIndexOfObject(arr, object) != AX_INVALID_INDEX; + return ccArrayGetIndexOfObject(arr, object) != CC_INVALID_INDEX; } /** Appends an object. Behavior undefined if array doesn't have enough capacity. */ @@ -201,7 +201,7 @@ void ccArrayRemoveObjectAtIndex(ccArray* arr, ssize_t index, bool releaseObj /* CCASSERT(arr && arr->num > 0 && index >= 0 && index < arr->num, "Invalid index. Out of bounds"); if (releaseObj) { - AX_SAFE_RELEASE(arr->arr[index]); + CC_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) { - AX_SAFE_RELEASE(arr->arr[index]); + CC_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 != AX_INVALID_INDEX) + if (index != CC_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 != AX_INVALID_INDEX) + if (index != CC_INVALID_INDEX) { ccArrayRemoveObjectAtIndex(arr, index, releaseObj); } @@ -263,7 +263,7 @@ void ccArrayFullRemoveArray(ccArray* arr, ccArray* minusArr) { if (ccArrayContainsObject(minusArr, arr->arr[i])) { - AX_SAFE_RELEASE(arr->arr[i]); + CC_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, AX_INVALID_INDEX if value not found. */ +/** Returns index of first occurrence of value, CC_INVALID_INDEX if value not found. */ ssize_t ccCArrayGetIndexOfValue(ccCArray* arr, void* value) { for (ssize_t i = 0; i < arr->num; i++) @@ -327,13 +327,13 @@ ssize_t ccCArrayGetIndexOfValue(ccCArray* arr, void* value) if (arr->arr[i] == value) return i; } - return AX_INVALID_INDEX; + return CC_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) != AX_INVALID_INDEX; + return ccCArrayGetIndexOfValue(arr, value) != CC_INVALID_INDEX; } /** Inserts a value at a certain position. Behavior undefined if array doesn't have 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 != AX_INVALID_INDEX) + if (index != CC_INVALID_INDEX) { ccCArrayRemoveValueAtIndex(arr, index); } diff --git a/core/base/ccCArray.h b/core/base/ccCArray.h index 5fc91056fb..d029fbc731 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 AX_ARRAY_H -#define AX_ARRAY_H +#ifndef CC_ARRAY_H +#define CC_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 */ -AX_DLL ccArray* ccArrayNew(ssize_t capacity); +CC_DLL ccArray* ccArrayNew(ssize_t capacity); /** Frees array after removing all remaining objects. Silently ignores nil arr. */ -AX_DLL void ccArrayFree(ccArray*& arr); +CC_DLL void ccArrayFree(ccArray*& arr); /** Doubles array capacity */ -AX_DLL void ccArrayDoubleCapacity(ccArray* arr); +CC_DLL void ccArrayDoubleCapacity(ccArray* arr); /** Increases array capacity such that max >= num + extra. */ -AX_DLL void ccArrayEnsureExtraCapacity(ccArray* arr, ssize_t extra); +CC_DLL void ccArrayEnsureExtraCapacity(ccArray* arr, ssize_t extra); /** shrinks the array so the memory footprint corresponds with the number of items */ -AX_DLL void ccArrayShrink(ccArray* arr); +CC_DLL void ccArrayShrink(ccArray* arr); /** Returns index of first occurrence of object, NSNotFound if object not found. */ -AX_DLL ssize_t ccArrayGetIndexOfObject(ccArray* arr, Ref* object); +CC_DLL ssize_t ccArrayGetIndexOfObject(ccArray* arr, Ref* object); /** Returns a Boolean value that indicates whether object is present in array. */ -AX_DLL bool ccArrayContainsObject(ccArray* arr, Ref* object); +CC_DLL bool ccArrayContainsObject(ccArray* arr, Ref* object); /** Appends an object. Behavior undefined if array doesn't have enough capacity. */ -AX_DLL void ccArrayAppendObject(ccArray* arr, Ref* object); +CC_DLL void ccArrayAppendObject(ccArray* arr, Ref* object); /** Appends an object. Capacity of arr is increased if needed. */ -AX_DLL void ccArrayAppendObjectWithResize(ccArray* arr, Ref* object); +CC_DLL void ccArrayAppendObjectWithResize(ccArray* arr, Ref* object); /** Appends objects from plusArr to arr. Behavior undefined if arr doesn't have enough capacity. */ -AX_DLL void ccArrayAppendArray(ccArray* arr, ccArray* plusArr); +CC_DLL void ccArrayAppendArray(ccArray* arr, ccArray* plusArr); /** Appends objects from plusArr to arr. Capacity of arr is increased if needed. */ -AX_DLL void ccArrayAppendArrayWithResize(ccArray* arr, ccArray* plusArr); +CC_DLL void ccArrayAppendArrayWithResize(ccArray* arr, ccArray* plusArr); /** Inserts an object at index */ -AX_DLL void ccArrayInsertObjectAtIndex(ccArray* arr, Ref* object, ssize_t index); +CC_DLL void ccArrayInsertObjectAtIndex(ccArray* arr, Ref* object, ssize_t index); /** Swaps two objects */ -AX_DLL void ccArraySwapObjectsAtIndexes(ccArray* arr, ssize_t index1, ssize_t index2); +CC_DLL void ccArraySwapObjectsAtIndexes(ccArray* arr, ssize_t index1, ssize_t index2); /** Removes all objects from arr */ -AX_DLL void ccArrayRemoveAllObjects(ccArray* arr); +CC_DLL void ccArrayRemoveAllObjects(ccArray* arr); /** Removes object at specified index and pushes back all subsequent objects. Behavior undefined if index outside [0, num-1]. */ -AX_DLL void ccArrayRemoveObjectAtIndex(ccArray* arr, ssize_t index, bool releaseObj = true); +CC_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]. */ -AX_DLL void ccArrayFastRemoveObjectAtIndex(ccArray* arr, ssize_t index); +CC_DLL void ccArrayFastRemoveObjectAtIndex(ccArray* arr, ssize_t index); -AX_DLL void ccArrayFastRemoveObject(ccArray* arr, Ref* object); +CC_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. */ -AX_DLL void ccArrayRemoveObject(ccArray* arr, Ref* object, bool releaseObj = true); +CC_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. */ -AX_DLL void ccArrayRemoveArray(ccArray* arr, ccArray* minusArr); +CC_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. */ -AX_DLL void ccArrayFullRemoveArray(ccArray* arr, ccArray* minusArr); +CC_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 */ -AX_DLL ccCArray* ccCArrayNew(ssize_t capacity); +CC_DLL ccCArray* ccCArrayNew(ssize_t capacity); /** Frees C array after removing all remaining values. Silently ignores nil arr. */ -AX_DLL void ccCArrayFree(ccCArray* arr); +CC_DLL void ccCArrayFree(ccCArray* arr); /** Doubles C array capacity */ -AX_DLL void ccCArrayDoubleCapacity(ccCArray* arr); +CC_DLL void ccCArrayDoubleCapacity(ccCArray* arr); /** Increases array capacity such that max >= num + extra. */ -AX_DLL void ccCArrayEnsureExtraCapacity(ccCArray* arr, ssize_t extra); +CC_DLL void ccCArrayEnsureExtraCapacity(ccCArray* arr, ssize_t extra); /** Returns index of first occurrence of value, NSNotFound if value not found. */ -AX_DLL ssize_t ccCArrayGetIndexOfValue(ccCArray* arr, void* value); +CC_DLL ssize_t ccCArrayGetIndexOfValue(ccCArray* arr, void* value); /** Returns a Boolean value that indicates whether value is present in the C array. */ -AX_DLL bool ccCArrayContainsValue(ccCArray* arr, void* value); +CC_DLL bool ccCArrayContainsValue(ccCArray* arr, void* value); /** Inserts a value at a certain position. Behavior undefined if array doesn't have enough capacity */ -AX_DLL void ccCArrayInsertValueAtIndex(ccCArray* arr, void* value, ssize_t index); +CC_DLL void ccCArrayInsertValueAtIndex(ccCArray* arr, void* value, ssize_t index); /** Appends an value. Behavior undefined if array doesn't have enough capacity. */ -AX_DLL void ccCArrayAppendValue(ccCArray* arr, void* value); +CC_DLL void ccCArrayAppendValue(ccCArray* arr, void* value); /** Appends an value. Capacity of arr is increased if needed. */ -AX_DLL void ccCArrayAppendValueWithResize(ccCArray* arr, void* value); +CC_DLL void ccCArrayAppendValueWithResize(ccCArray* arr, void* value); /** Appends values from plusArr to arr. Behavior undefined if arr doesn't have enough capacity. */ -AX_DLL void ccCArrayAppendArray(ccCArray* arr, ccCArray* plusArr); +CC_DLL void ccCArrayAppendArray(ccCArray* arr, ccCArray* plusArr); /** Appends values from plusArr to arr. Capacity of arr is increased if needed. */ -AX_DLL void ccCArrayAppendArrayWithResize(ccCArray* arr, ccCArray* plusArr); +CC_DLL void ccCArrayAppendArrayWithResize(ccCArray* arr, ccCArray* plusArr); /** Removes all values from arr */ -AX_DLL void ccCArrayRemoveAllValues(ccCArray* arr); +CC_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 */ -AX_DLL void ccCArrayRemoveValueAtIndex(ccCArray* arr, ssize_t index); +CC_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 */ -AX_DLL void ccCArrayFastRemoveValueAtIndex(ccCArray* arr, ssize_t index); +CC_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 */ -AX_DLL void ccCArrayRemoveValue(ccCArray* arr, void* value); +CC_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 */ -AX_DLL void ccCArrayRemoveArray(ccCArray* arr, ccCArray* minusArr); +CC_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 */ -AX_DLL void ccCArrayFullRemoveArray(ccCArray* arr, ccCArray* minusArr); +CC_DLL void ccCArrayFullRemoveArray(ccCArray* arr, ccCArray* minusArr); NS_AX_END /// @endcond -#endif // AX_ARRAY_H +#endif // CC_ARRAY_H diff --git a/core/base/ccConfig.h b/core/base/ccConfig.h index 173b589df5..d8b90a0c54 100644 --- a/core/base/ccConfig.h +++ b/core/base/ccConfig.h @@ -34,18 +34,18 @@ THE SOFTWARE. * cocos2d (cc) configuration file. */ -/** @def AX_ENABLE_STACKABLE_ACTIONS +/** @def CC_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 AX_ENABLE_STACKABLE_ACTIONS -# define AX_ENABLE_STACKABLE_ACTIONS 1 +#ifndef CC_ENABLE_STACKABLE_ACTIONS +# define CC_ENABLE_STACKABLE_ACTIONS 1 #endif -/** @def AX_ENABLE_GL_STATE_CACHE +/** @def CC_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 AX_ENABLE_GL_STATE_CACHE -# define AX_ENABLE_GL_STATE_CACHE 1 +#ifndef CC_ENABLE_GL_STATE_CACHE +# define CC_ENABLE_GL_STATE_CACHE 1 #endif -/** @def AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL +/** @def CC_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 AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL -# define AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0 +#ifndef CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +# define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0 #endif -/** @def AX_DIRECTOR_STATS_INTERVAL +/** @def CC_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 AX_DIRECTOR_STATS_INTERVAL -# define AX_DIRECTOR_STATS_INTERVAL (0.5f) +#ifndef CC_DIRECTOR_STATS_INTERVAL +# define CC_DIRECTOR_STATS_INTERVAL (0.5f) #endif -/** @def AX_DIRECTOR_FPS_POSITION +/** @def CC_DIRECTOR_FPS_POSITION * Position of the FPS. * Default: 0,0 (bottom-left corner). */ -#ifndef AX_DIRECTOR_FPS_POSITION -# define AX_DIRECTOR_FPS_POSITION Vec2(0, 0) +#ifndef CC_DIRECTOR_FPS_POSITION +# define CC_DIRECTOR_FPS_POSITION Vec2(0, 0) #endif -/** @def AX_DIRECTOR_DISPATCH_FAST_EVENTS +/** @def CC_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 AX_DIRECTOR_DISPATCH_FAST_EVENTS -# define AX_DIRECTOR_DISPATCH_FAST_EVENTS 0 +#ifndef CC_DIRECTOR_DISPATCH_FAST_EVENTS +# define CC_DIRECTOR_DISPATCH_FAST_EVENTS 0 #endif -/** @def AX_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD +/** @def CC_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 AX_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD -# define AX_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD 1 +#ifndef CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD +# define CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD 1 #endif -/** @def AX_NODE_RENDER_SUBPIXEL +/** @def CC_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 AX_NODE_RENDER_SUBPIXEL -# define AX_NODE_RENDER_SUBPIXEL 1 +#ifndef CC_NODE_RENDER_SUBPIXEL +# define CC_NODE_RENDER_SUBPIXEL 1 #endif -/** @def AX_SPRITEBATCHNODE_RENDER_SUBPIXEL +/** @def CC_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 AX_SPRITEBATCHNODE_RENDER_SUBPIXEL -# define AX_SPRITEBATCHNODE_RENDER_SUBPIXEL 1 +#ifndef CC_SPRITEBATCHNODE_RENDER_SUBPIXEL +# define CC_SPRITEBATCHNODE_RENDER_SUBPIXEL 1 #endif -/** @def AX_TEXTURE_ATLAS_USE_VAO +/** @def CC_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 AX_TEXTURE_ATLAS_USE_VAO -# define AX_TEXTURE_ATLAS_USE_VAO 1 +#ifndef CC_TEXTURE_ATLAS_USE_VAO +# define CC_TEXTURE_ATLAS_USE_VAO 1 #endif -/** @def AX_USE_LA88_LABELS +/** @def CC_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 AX_USE_LA88_LABELS -# define AX_USE_LA88_LABELS 1 +#ifndef CC_USE_LA88_LABELS +# define CC_USE_LA88_LABELS 1 #endif -/** @def AX_SPRITE_DEBUG_DRAW +/** @def CC_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 AX_SPRITE_DEBUG_DRAW -# define AX_SPRITE_DEBUG_DRAW 0 +#ifndef CC_SPRITE_DEBUG_DRAW +# define CC_SPRITE_DEBUG_DRAW 0 #endif -/** @def AX_LABEL_DEBUG_DRAW +/** @def CC_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 AX_LABEL_DEBUG_DRAW -# define AX_LABEL_DEBUG_DRAW 0 +#ifndef CC_LABEL_DEBUG_DRAW +# define CC_LABEL_DEBUG_DRAW 0 #endif -/** @def AX_SPRITEBATCHNODE_DEBUG_DRAW +/** @def CC_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 AX_SPRITEBATCHNODE_DEBUG_DRAW -# define AX_SPRITEBATCHNODE_DEBUG_DRAW 0 +#ifndef CC_SPRITEBATCHNODE_DEBUG_DRAW +# define CC_SPRITEBATCHNODE_DEBUG_DRAW 0 #endif -/** @def AX_LABELBMFONT_DEBUG_DRAW +/** @def CC_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 AX_LABELBMFONT_DEBUG_DRAW -# define AX_LABELBMFONT_DEBUG_DRAW 0 +#ifndef CC_LABELBMFONT_DEBUG_DRAW +# define CC_LABELBMFONT_DEBUG_DRAW 0 #endif -/** @def AX_LABELATLAS_DEBUG_DRAW +/** @def CC_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 AX_LABELATLAS_DEBUG_DRAW -# define AX_LABELATLAS_DEBUG_DRAW 0 +#ifndef CC_LABELATLAS_DEBUG_DRAW +# define CC_LABELATLAS_DEBUG_DRAW 0 #endif -/** @def AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS +/** @def CC_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 AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS -# define AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS 0 +#ifndef CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS +# define CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS 0 #endif -/** @def AX_ENABLE_PROFILERS +/** @def CC_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 AX_ENABLE_PROFILERS -# define AX_ENABLE_PROFILERS 0 +#ifndef CC_ENABLE_PROFILERS +# define CC_ENABLE_PROFILERS 0 #endif /** Enable Lua engine debug log. */ -#ifndef AX_LUA_ENGINE_DEBUG -# define AX_LUA_ENGINE_DEBUG 0 +#ifndef CC_LUA_ENGINE_DEBUG +# define CC_LUA_ENGINE_DEBUG 0 #endif /** Use physics integration API. */ // It works with: // Chipmunk2D or Box2D -#ifndef AX_USE_PHYSICS -# define AX_USE_PHYSICS 1 +#ifndef CC_USE_PHYSICS +# define CC_USE_PHYSICS 1 #endif -#if (AX_USE_PHYSICS) +#if (CC_USE_PHYSICS) /** Use Chipmunk2D physics 2d engine on physics integration API. */ -# ifndef AX_ENABLE_CHIPMUNK_INTEGRATION -# define AX_ENABLE_CHIPMUNK_INTEGRATION 0 +# ifndef CC_ENABLE_CHIPMUNK_INTEGRATION +# define CC_ENABLE_CHIPMUNK_INTEGRATION 0 # endif /** or use Box2D physics 2d engine on physics integration API. */ -# ifndef AX_ENABLE_BOX2D_INTEGRATION -# define AX_ENABLE_BOX2D_INTEGRATION 1 +# ifndef CC_ENABLE_BOX2D_INTEGRATION +# define CC_ENABLE_BOX2D_INTEGRATION 1 # endif -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS /** Use 3d physics integration API. */ -#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 +#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 # endif #endif -#if (AX_USE_3D_PHYSICS) +#if (CC_USE_3D_PHYSICS) /** Use bullet physics engine. */ -# ifndef AX_ENABLE_BULLET_INTEGRATION -# define AX_ENABLE_BULLET_INTEGRATION 1 +# ifndef CC_ENABLE_BULLET_INTEGRATION +# define CC_ENABLE_BULLET_INTEGRATION 1 # endif #endif /** Use 3D navigation API */ -#ifndef AX_USE_NAVMESH -# define AX_USE_NAVMESH 1 +#ifndef CC_USE_NAVMESH +# define CC_USE_NAVMESH 1 #endif /** Use culling or not. */ -#ifndef AX_USE_CULLING -# define AX_USE_CULLING 1 +#ifndef CC_USE_CULLING +# define CC_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 AX_USE_PNG -# define AX_USE_PNG 1 -#endif // AX_USE_PNG +#ifndef CC_USE_PNG +# define CC_USE_PNG 1 +#endif // CC_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 AX_USE_JPEG -# define AX_USE_JPEG 1 -#endif // AX_USE_JPEG +#ifndef CC_USE_JPEG +# define CC_USE_JPEG 1 +#endif // CC_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 AX_USE_WEBP -# define AX_USE_WEBP 1 -#endif // AX_USE_WEBP +#ifndef CC_USE_WEBP +# define CC_USE_WEBP 1 +#endif // CC_USE_WEBP /** Enable Lua Script binding */ -#ifndef AX_ENABLE_SCRIPT_BINDING -# define AX_ENABLE_SCRIPT_BINDING 1 +#ifndef CC_ENABLE_SCRIPT_BINDING +# define CC_ENABLE_SCRIPT_BINDING 1 #endif -/** When AX_ENABLE_SCRIPT_BINDING and AX_ENABLE_GC_FOR_NATIVE_OBJECTS are both 1 +/** When CC_ENABLE_SCRIPT_BINDING and CC_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 AX_ENABLE_SCRIPT_BINDING -# ifndef AX_ENABLE_GC_FOR_NATIVE_OBJECTS -# define AX_ENABLE_GC_FOR_NATIVE_OBJECTS 0 +#ifdef CC_ENABLE_SCRIPT_BINDING +# ifndef CC_ENABLE_GC_FOR_NATIVE_OBJECTS +# define CC_ENABLE_GC_FOR_NATIVE_OBJECTS 0 # endif #endif -#ifndef AX_FILEUTILS_APPLE_ENABLE_OBJC -# define AX_FILEUTILS_APPLE_ENABLE_OBJC 1 +#ifndef CC_FILEUTILS_APPLE_ENABLE_OBJC +# define CC_FILEUTILS_APPLE_ENABLE_OBJC 1 #endif -/** @def AX_ENABLE_PREMULTIPLIED_ALPHA +/** @def CC_ENABLE_PREMULTIPLIED_ALPHA * If enabled, all textures will be preprocessed to multiply its rgb components * by its alpha component. */ -#ifndef AX_ENABLE_PREMULTIPLIED_ALPHA -# define AX_ENABLE_PREMULTIPLIED_ALPHA 1 +#ifndef CC_ENABLE_PREMULTIPLIED_ALPHA +# define CC_ENABLE_PREMULTIPLIED_ALPHA 1 #endif -/** @def AX_STRIP_FPS +/** @def CC_STRIP_FPS * Whether to strip FPS related data and functions, such as cc_fps_images_png */ -#ifndef AX_STRIP_FPS -# define AX_STRIP_FPS 0 +#ifndef CC_STRIP_FPS +# define CC_STRIP_FPS 0 #endif -#ifndef AX_REDUCE_PAUSED_CPU_USAGE -# define AX_REDUCE_PAUSED_CPU_USAGE 0 +#ifndef CC_REDUCE_PAUSED_CPU_USAGE +# define CC_REDUCE_PAUSED_CPU_USAGE 0 #endif -#ifndef AX_META_TEXTURES -# define AX_META_TEXTURES 2 +#ifndef CC_META_TEXTURES +# define CC_META_TEXTURES 2 #endif diff --git a/core/base/ccFPSImages.c b/core/base/ccFPSImages.c index a1df969be3..8ff5e48907 100644 --- a/core/base/ccFPSImages.c +++ b/core/base/ccFPSImages.c @@ -26,7 +26,7 @@ #include "base/ccFPSImages.h" -#if !AX_STRIP_FPS +#if !CC_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 !AX_STRIP_FPS +#endif // #if !CC_STRIP_FPS diff --git a/core/base/ccFPSImages.h b/core/base/ccFPSImages.h index 087acde554..4bf7924604 100644 --- a/core/base/ccFPSImages.h +++ b/core/base/ccFPSImages.h @@ -33,7 +33,7 @@ THE SOFTWARE. extern "C" { #endif -#if !AX_STRIP_FPS +#if !CC_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 544d28ea50..ab316812a1 100644 --- a/core/base/ccMacros.h +++ b/core/base/ccMacros.h @@ -38,8 +38,8 @@ THE SOFTWARE. #ifndef CCASSERT # if COCOS2D_DEBUG > 0 -# if AX_ENABLE_SCRIPT_BINDING -extern bool AX_DLL cc_assert_script_compatible(const char* msg); +# if CC_ENABLE_SCRIPT_BINDING +extern bool CC_DLL cc_assert_script_compatible(const char* msg); # define CCASSERT(cond, msg) \ do \ { \ @@ -47,11 +47,11 @@ extern bool AX_DLL cc_assert_script_compatible(const char* msg); { \ if (msg && *msg && !cc_assert_script_compatible(msg)) \ axis::log("Assert failed: %s", msg); \ - AX_ASSERT(cond); \ + CC_ASSERT(cond); \ } \ } while (0) # else -# define CCASSERT(cond, msg) AX_ASSERT(cond) +# define CCASSERT(cond, msg) CC_ASSERT(cond) # endif # else # define CCASSERT(cond, msg) @@ -67,9 +67,9 @@ extern bool AX_DLL cc_assert_script_compatible(const char* msg); #include "base/ccRandom.h" -#define AX_HALF_PI (M_PI * 0.5f) +#define CC_HALF_PI (M_PI * 0.5f) -#define AX_DOUBLE_PI (M_PI * 2) +#define CC_DOUBLE_PI (M_PI * 2) /** @def CCRANDOM_MINUS1_1 returns a random float between -1 and 1 @@ -81,96 +81,96 @@ extern bool AX_DLL cc_assert_script_compatible(const char* msg); */ #define CCRANDOM_0_1() axis::rand_0_1() -/** @def AX_DEGREES_TO_RADIANS +/** @def CC_DEGREES_TO_RADIANS converts degrees to radians */ -#define AX_DEGREES_TO_RADIANS(__ANGLE__) ((__ANGLE__)*0.01745329252f) // PI / 180 +#define CC_DEGREES_TO_RADIANS(__ANGLE__) ((__ANGLE__)*0.01745329252f) // PI / 180 -/** @def AX_RADIANS_TO_DEGREES +/** @def CC_RADIANS_TO_DEGREES converts radians to degrees */ -#define AX_RADIANS_TO_DEGREES(__ANGLE__) ((__ANGLE__)*57.29577951f) // PI * 180 +#define CC_RADIANS_TO_DEGREES(__ANGLE__) ((__ANGLE__)*57.29577951f) // PI * 180 -#define AX_REPEAT_FOREVER (UINT_MAX - 1) -#define kRepeatForever AX_REPEAT_FOREVER +#define CC_REPEAT_FOREVER (UINT_MAX - 1) +#define kRepeatForever CC_REPEAT_FOREVER -/** @def AX_BLEND_SRC +/** @def CC_BLEND_SRC default gl blend src function. Compatible with premultiplied alpha images. */ -#define AX_BLEND_SRC axis::backend::BlendFactor::ONE -#define AX_BLEND_DST axis::backend::BlendFactor::ONE_MINUS_SRC_ALPHA +#define CC_BLEND_SRC axis::backend::BlendFactor::ONE +#define CC_BLEND_DST axis::backend::BlendFactor::ONE_MINUS_SRC_ALPHA -/** @def AX_NODE_DRAW_SETUP [DEPRECATED] +/** @def CC_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 AX_NODE_DRAW_SETUP() +#define CC_NODE_DRAW_SETUP() -/** @def AX_DIRECTOR_END +/** @def CC_DIRECTOR_END Stops and removes the director from memory. Removes the GLView from its parent @since v0.99.4 */ -#define AX_DIRECTOR_END() \ +#define CC_DIRECTOR_END() \ do \ { \ Director* __director = axis::Director::getInstance(); \ __director->end(); \ } while (0) -/** @def AX_CONTENT_SCALE_FACTOR +/** @def CC_CONTENT_SCALE_FACTOR On Mac it returns 1; On iPhone it returns 2 if RetinaDisplay is On. Otherwise it returns 1 */ -#define AX_CONTENT_SCALE_FACTOR() axis::Director::getInstance()->getContentScaleFactor() +#define CC_CONTENT_SCALE_FACTOR() axis::Director::getInstance()->getContentScaleFactor() /****************************/ /** RETINA DISPLAY ENABLED **/ /****************************/ -/** @def AX_RECT_PIXELS_TO_POINTS +/** @def CC_RECT_PIXELS_TO_POINTS Converts a rect in pixels to points */ -#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()) +#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()) -/** @def AX_RECT_POINTS_TO_PIXELS +/** @def CC_RECT_POINTS_TO_PIXELS Converts a rect in points to pixels */ -#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()) +#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()) -/** @def AX_POINT_PIXELS_TO_POINTS +/** @def CC_POINT_PIXELS_TO_POINTS Converts a rect in pixels to points */ -#define AX_POINT_PIXELS_TO_POINTS(__pixels__) \ - axis::Vec2((__pixels__).x / AX_CONTENT_SCALE_FACTOR(), (__pixels__).y / AX_CONTENT_SCALE_FACTOR()) +#define CC_POINT_PIXELS_TO_POINTS(__pixels__) \ + axis::Vec2((__pixels__).x / CC_CONTENT_SCALE_FACTOR(), (__pixels__).y / CC_CONTENT_SCALE_FACTOR()) -/** @def AX_POINT_POINTS_TO_PIXELS +/** @def CC_POINT_POINTS_TO_PIXELS Converts a rect in points to pixels */ -#define AX_POINT_POINTS_TO_PIXELS(__points__) \ - axis::Vec2((__points__).x* AX_CONTENT_SCALE_FACTOR(), (__points__).y* AX_CONTENT_SCALE_FACTOR()) +#define CC_POINT_POINTS_TO_PIXELS(__points__) \ + axis::Vec2((__points__).x* CC_CONTENT_SCALE_FACTOR(), (__points__).y* CC_CONTENT_SCALE_FACTOR()) -/** @def AX_POINT_PIXELS_TO_POINTS +/** @def CC_POINT_PIXELS_TO_POINTS Converts a rect in pixels to points */ -#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()) +#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()) -/** @def AX_POINT_POINTS_TO_PIXELS +/** @def CC_POINT_POINTS_TO_PIXELS Converts a rect in points to pixels */ -#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()) +#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()) #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 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)) +#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)) /**********************/ /** Profiling Macros **/ /**********************/ -#if AX_ENABLE_PROFILERS +#if CC_ENABLE_PROFILERS -# define AX_PROFILER_DISPLAY_TIMERS() NS_AX::Profiler::getInstance()->displayTimers() -# define AX_PROFILER_PURGE_ALL() NS_AX::Profiler::getInstance()->releaseAllTimers() +# define CC_PROFILER_DISPLAY_TIMERS() NS_AX::Profiler::getInstance()->displayTimers() +# define CC_PROFILER_PURGE_ALL() NS_AX::Profiler::getInstance()->releaseAllTimers() -# 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(__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_CATEGORY(__cat__, __name__) \ +# define CC_PROFILER_START_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ NS_AX::ProfilingBeginTimingBlock(__name__); \ } while (0) -# define AX_PROFILER_STOP_CATEGORY(__cat__, __name__) \ +# define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ NS_AX::ProfilingEndTimingBlock(__name__); \ } while (0) -# define AX_PROFILER_RESET_CATEGORY(__cat__, __name__) \ +# define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ NS_AX::ProfilingResetTimingBlock(__name__); \ } while (0) -# define AX_PROFILER_START_INSTANCE(__id__, __name__) \ +# define CC_PROFILER_START_INSTANCE(__id__, __name__) \ do \ { \ NS_AX::ProfilingBeginTimingBlock( \ NS_AX::String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ } while (0) -# define AX_PROFILER_STOP_INSTANCE(__id__, __name__) \ +# define CC_PROFILER_STOP_INSTANCE(__id__, __name__) \ do \ { \ NS_AX::ProfilingEndTimingBlock( \ NS_AX::String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ } while (0) -# define AX_PROFILER_RESET_INSTANCE(__id__, __name__) \ +# define CC_PROFILER_RESET_INSTANCE(__id__, __name__) \ do \ { \ NS_AX::ProfilingResetTimingBlock( \ @@ -248,50 +248,50 @@ It should work same as apples CFSwapInt32LittleToHost(..) #else -# define AX_PROFILER_DISPLAY_TIMERS() \ +# define CC_PROFILER_DISPLAY_TIMERS() \ do \ { \ } while (0) -# define AX_PROFILER_PURGE_ALL() \ +# define CC_PROFILER_PURGE_ALL() \ do \ { \ } while (0) -# define AX_PROFILER_START(__name__) \ +# define CC_PROFILER_START(__name__) \ do \ { \ } while (0) -# define AX_PROFILER_STOP(__name__) \ +# define CC_PROFILER_STOP(__name__) \ do \ { \ } while (0) -# define AX_PROFILER_RESET(__name__) \ +# define CC_PROFILER_RESET(__name__) \ do \ { \ } while (0) -# define AX_PROFILER_START_CATEGORY(__cat__, __name__) \ +# define CC_PROFILER_START_CATEGORY(__cat__, __name__) \ do \ { \ } while (0) -# define AX_PROFILER_STOP_CATEGORY(__cat__, __name__) \ +# define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) \ do \ { \ } while (0) -# define AX_PROFILER_RESET_CATEGORY(__cat__, __name__) \ +# define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) \ do \ { \ } while (0) -# define AX_PROFILER_START_INSTANCE(__id__, __name__) \ +# define CC_PROFILER_START_INSTANCE(__id__, __name__) \ do \ { \ } while (0) -# define AX_PROFILER_STOP_INSTANCE(__id__, __name__) \ +# define CC_PROFILER_STOP_INSTANCE(__id__, __name__) \ do \ { \ } while (0) -# define AX_PROFILER_RESET_INSTANCE(__id__, __name__) \ +# define CC_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 AX_64BITS 1 +# define CC_64BITS 1 #else -# define AX_64BITS 0 +# define CC_64BITS 0 #endif /******************************************************************************************/ @@ -314,8 +314,8 @@ It should work same as apples CFSwapInt32LittleToHost(..) /******************************************************************************************/ #ifdef _WIN32 // Assuming windows is always little-endian. -# if !defined(AX_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) -# define AX_LITTLE_ENDIAN 1 +# if !defined(CC_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) +# define CC_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(AX_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) -# define AX_LITTLE_ENDIAN 1 + !defined(CC_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) +# define CC_LITTLE_ENDIAN 1 # endif #endif -/** @def AX_INCREMENT_GL_DRAWS_BY_ONE +/** @def CC_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 AX_INCREMENT_GL_DRAWS(__n__) axis::Director::getInstance()->getRenderer()->addDrawnBatches(__n__) -#define AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(__drawcalls__, __vertices__) \ +#define CC_INCREMENT_GL_DRAWS(__n__) axis::Director::getInstance()->getRenderer()->addDrawnBatches(__n__) +#define CC_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 AX_CALLBACK_0(__selector__, __target__, ...) std::bind(&__selector__, __target__, ##__VA_ARGS__) -#define AX_CALLBACK_1(__selector__, __target__, ...) \ +#define CC_CALLBACK_0(__selector__, __target__, ...) std::bind(&__selector__, __target__, ##__VA_ARGS__) +#define CC_CALLBACK_1(__selector__, __target__, ...) \ std::bind(&__selector__, __target__, std::placeholders::_1, ##__VA_ARGS__) -#define AX_CALLBACK_2(__selector__, __target__, ...) \ +#define CC_CALLBACK_2(__selector__, __target__, ...) \ std::bind(&__selector__, __target__, std::placeholders::_1, std::placeholders::_2, ##__VA_ARGS__) -#define AX_CALLBACK_3(__selector__, __target__, ...) \ +#define CC_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 789fd37a98..e86987ec16 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 AX_DLL RandomHelper +class CC_DLL RandomHelper { public: template diff --git a/core/base/ccTypes.cpp b/core/base/ccTypes.cpp index d92e7c568e..c8df7f2ce4 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 AX_INVALID_INDEX = -1; +const ssize_t CC_INVALID_INDEX = -1; /** * Color3B diff --git a/core/base/ccTypes.h b/core/base/ccTypes.h index 9e01b4a2d0..0130a95443 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 AX_DLL Color3B +struct CC_DLL Color3B { Color3B(); Color3B(uint8_t _r, uint8_t _g, uint8_t _b); @@ -86,7 +86,7 @@ struct AX_DLL Color3B * RGBA color composed of 4 bytes. * @since v3.0 */ -struct AX_DLL Color4B +struct CC_DLL Color4B { Color4B(); Color4B(uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a); @@ -128,7 +128,7 @@ struct AX_DLL Color4B * RGBA color composed of 4 floats. * @since v3.0 */ -struct AX_DLL Color4F +struct CC_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 AX_DLL HSV +struct CC_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 AX_DLL HSL +struct CC_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 AX_DLL PointSprite +struct CC_DLL PointSprite { Vec2 pos; // 8 bytes Color4B color; // 4 bytes @@ -295,7 +295,7 @@ struct AX_DLL PointSprite /** @struct Quad2 * A 2D Quad. 4 * 2 floats. */ -struct AX_DLL Quad2 +struct CC_DLL Quad2 { Vec2 tl; Vec2 tr; @@ -306,7 +306,7 @@ struct AX_DLL Quad2 /** @struct Quad3 * A 3D Quad. 4 * 3 floats. */ -struct AX_DLL Quad3 +struct CC_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 AX_DLL V2F_C4F_T2F +struct CC_DLL V2F_C4F_T2F { /// vertices (2F) Vec2 vertices; @@ -356,7 +356,7 @@ struct AX_DLL V2F_C4F_T2F /** @struct V3F_C4B_T2F * A Vec2 with a vertex point, a tex coord point and a color 4B. */ -struct AX_DLL V3F_C4B_T2F +struct CC_DLL V3F_C4B_T2F { /// vertices (3F) Vec3 vertices; // 12 bytes @@ -371,7 +371,7 @@ struct AX_DLL V3F_C4B_T2F /** @struct V3F_T2F * A Vec2 with a vertex point, a tex coord point. */ -struct AX_DLL V3F_T2F +struct CC_DLL V3F_T2F { /// vertices (2F) Vec3 vertices; @@ -382,7 +382,7 @@ struct AX_DLL V3F_T2F /** @struct V3F_C4F * A Vec3 with a vertex point, a color. */ -struct AX_DLL V3F_C4F +struct CC_DLL V3F_C4F { /// vertices (3F) Vec3 vertices; @@ -393,7 +393,7 @@ struct AX_DLL V3F_C4F /** @struct V2F_C4B_T2F_Triangle * A Triangle of V2F_C4B_T2F. */ -struct AX_DLL V2F_C4B_T2F_Triangle +struct CC_DLL V2F_C4B_T2F_Triangle { V2F_C4B_T2F a; V2F_C4B_T2F b; @@ -403,7 +403,7 @@ struct AX_DLL V2F_C4B_T2F_Triangle /** @struct V2F_C4B_T2F_Quad * A Quad of V2F_C4B_T2F. */ -struct AX_DLL V2F_C4B_T2F_Quad +struct CC_DLL V2F_C4B_T2F_Quad { /// bottom left V2F_C4B_T2F bl; @@ -418,7 +418,7 @@ struct AX_DLL V2F_C4B_T2F_Quad /** @struct V3F_C4B_T2F_Quad * 4 Vertex3FTex2FColor4B. */ -struct AX_DLL V3F_C4B_T2F_Quad +struct CC_DLL V3F_C4B_T2F_Quad { /// top left V3F_C4B_T2F tl; @@ -433,7 +433,7 @@ struct AX_DLL V3F_C4B_T2F_Quad /** @struct V2F_C4F_T2F_Quad * 4 Vertex2FTex2FColor4F Quad. */ -struct AX_DLL V2F_C4F_T2F_Quad +struct CC_DLL V2F_C4F_T2F_Quad { /// bottom left V2F_C4F_T2F bl; @@ -448,7 +448,7 @@ struct AX_DLL V2F_C4F_T2F_Quad /** @struct V3F_T2F_Quad * */ -struct AX_DLL V3F_T2F_Quad +struct CC_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 AX_DLL BlendFunc +struct CC_DLL BlendFunc { /** source blend function */ backend::BlendFactor src; @@ -498,7 +498,7 @@ struct AX_DLL BlendFunc * * @note If any of these enums are edited and/or reordered, update Texture2D.m. */ -enum class AX_DLL TextVAlignment +enum class CC_DLL TextVAlignment { TOP, CENTER, @@ -510,7 +510,7 @@ enum class AX_DLL TextVAlignment * * @note If any of these enums are edited and/or reordered, update Texture2D.m. */ -enum class AX_DLL TextHAlignment +enum class CC_DLL TextHAlignment { LEFT, CENTER, @@ -536,7 +536,7 @@ enum class GlyphCollection /** @struct T2F_Quad * Texture coordinates for a quad. */ -struct AX_DLL T2F_Quad +struct CC_DLL T2F_Quad { /// bottom left Tex2F bl; @@ -551,7 +551,7 @@ struct AX_DLL T2F_Quad /** @struct AnimationFrameData * Struct that holds the size in pixels, texture coordinates and delays for animated ParticleSystemQuad. */ -struct AX_DLL AnimationFrameData +struct CC_DLL AnimationFrameData { T2F_Quad texCoords; Vec2 size; @@ -565,7 +565,7 @@ struct AX_DLL AnimationFrameData /** @struct FontShadow * Shadow attributes. */ -struct AX_DLL FontShadow +struct CC_DLL FontShadow { /// shadow x and y offset Vec2 _shadowOffset; @@ -580,7 +580,7 @@ struct AX_DLL FontShadow /** @struct FontStroke * Stroke attributes. */ -struct AX_DLL FontStroke +struct CC_DLL FontStroke { /// stroke color Color3B _strokeColor = Color3B::BLACK; @@ -595,7 +595,7 @@ struct AX_DLL FontStroke /** @struct FontDefinition * Font attributes. */ -struct AX_DLL FontDefinition +struct CC_DLL FontDefinition { /// font name std::string _fontName; @@ -627,7 +627,7 @@ struct AX_DLL FontDefinition /** @struct Acceleration * The device accelerometer reports values for each axis in units of g-force. */ -class AX_DLL Acceleration : public Ref +class CC_DLL Acceleration : public Ref { public: double x = 0; @@ -637,10 +637,10 @@ public: double timestamp = 0; }; -extern const std::string AX_DLL STD_STRING_EMPTY; -extern const ssize_t AX_DLL AX_INVALID_INDEX; +extern const std::string CC_DLL STD_STRING_EMPTY; +extern const ssize_t CC_DLL CC_INVALID_INDEX; -struct AX_DLL Viewport +struct CC_DLL Viewport { int x = 0; int y = 0; @@ -648,7 +648,7 @@ struct AX_DLL Viewport unsigned int h = 0; }; -struct AX_DLL ScissorRect +struct CC_DLL ScissorRect { float x = 0; float y = 0; diff --git a/core/base/ccUTF8.cpp b/core/base/ccUTF8.cpp index 8a9a4fd1a8..892f6ec899 100644 --- a/core/base/ccUTF8.cpp +++ b/core/base/ccUTF8.cpp @@ -38,7 +38,7 @@ NS_AX_BEGIN namespace StringUtils { -std::string AX_DLL format(const char* format, ...) +std::string CC_DLL format(const char* format, ...) { va_list args; va_start(args, format); @@ -56,8 +56,8 @@ std::string AX_DLL format(const char* format, ...) */ std::string vformat(const char* format, va_list ap) { -#define AX_VSNPRINTF_BUFFER_LENGTH 512 - std::string buf(AX_VSNPRINTF_BUFFER_LENGTH, '\0'); +#define CC_VSNPRINTF_BUFFER_LENGTH 512 + std::string buf(CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret) { std::string utf8Str; diff --git a/core/base/ccUTF8.h b/core/base/ccUTF8.h index 527bacc050..acfa9ed16a 100644 --- a/core/base/ccUTF8.h +++ b/core/base/ccUTF8.h @@ -33,7 +33,7 @@ #include #include -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) # include "platform/android/jni/JniHelper.h" #endif @@ -67,8 +67,8 @@ std::string toString(T arg) return ss.str(); } -std::string AX_DLL format(const char* format, ...) AX_FORMAT_PRINTF(1, 2); -std::string AX_DLL vformat(const char* format, va_list ap); +std::string CC_DLL format(const char* format, ...) CC_FORMAT_PRINTF(1, 2); +std::string CC_DLL vformat(const char* format, va_list ap); /** * @brief Converts from UTF8 string to UTF16 string. @@ -90,44 +90,44 @@ std::string AX_DLL vformat(const char* format, va_list ap); * } * @endcode */ -AX_DLL bool UTF8ToUTF16(std::string_view inUtf8, std::u16string& outUtf16); +CC_DLL bool UTF8ToUTF16(std::string_view inUtf8, std::u16string& outUtf16); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF8 to UTF32. * * @see UTF8ToUTF16 */ -AX_DLL bool UTF8ToUTF32(std::string_view inUtf8, std::u32string& outUtf32); +CC_DLL bool UTF8ToUTF32(std::string_view inUtf8, std::u32string& outUtf32); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF16 to UTF8. * * @see UTF8ToUTF16 */ -AX_DLL bool UTF16ToUTF8(std::u16string_view inUtf16, std::string& outUtf8); +CC_DLL bool UTF16ToUTF8(std::u16string_view inUtf16, std::string& outUtf8); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF16 to UTF32. * * @see UTF8ToUTF16 */ -AX_DLL bool UTF16ToUTF32(std::u16string_view inUtf16, std::u32string& outUtf32); +CC_DLL bool UTF16ToUTF32(std::u16string_view inUtf16, std::u32string& outUtf32); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF32 to UTF8. * * @see UTF8ToUTF16 */ -AX_DLL bool UTF32ToUTF8(std::u32string_view inUtf32, std::string& outUtf8); +CC_DLL bool UTF32ToUTF8(std::u32string_view inUtf32, std::string& outUtf8); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF32 to UTF16. * * @see UTF8ToUTF16 */ -AX_DLL bool UTF32ToUTF16(std::u32string_view inUtf32, std::u16string& outUtf16); +CC_DLL bool UTF32ToUTF16(std::u32string_view inUtf32, std::u16string& outUtf16); -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) /** * @brief convert jstring to utf8 std::string, same function with env->getStringUTFChars. @@ -137,7 +137,7 @@ AX_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 */ -AX_DLL std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret = nullptr); +CC_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 @@ AX_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); */ -AX_DLL jstring newStringUTFJNI(JNIEnv* env, std::string_view utf8Str, bool* ret = nullptr); +CC_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. */ -AX_DLL void trimUTF16Vector(std::vector& str); +CC_DLL void trimUTF16Vector(std::vector& str); /** * @brief Trims the unicode spaces at the end of char32_t vector. */ -AX_DLL void trimUTF32Vector(std::vector& str); +CC_DLL void trimUTF32Vector(std::vector& str); /** * @brief Whether the character is a whitespace character. @@ -168,7 +168,7 @@ AX_DLL void trimUTF32Vector(std::vector& str); * @see http://en.wikipedia.org/wiki/Whitespace_character#Unicode * */ -AX_DLL bool isUnicodeSpace(char32_t ch); +CC_DLL bool isUnicodeSpace(char32_t ch); /** * @brief Whether the character is a Chinese/Japanese/Korean character. @@ -179,7 +179,7 @@ AX_DLL bool isUnicodeSpace(char32_t ch); * @see http://tieba.baidu.com/p/748765987 * */ -AX_DLL bool isCJKUnicode(char32_t ch); +CC_DLL bool isCJKUnicode(char32_t ch); /** * @brief Whether the character is a non-breaking character. @@ -192,14 +192,14 @@ AX_DLL bool isCJKUnicode(char32_t ch); * @see https://en.wikipedia.org/wiki/Word_joiner * */ -AX_DLL bool isUnicodeNonBreaking(char32_t ch); +CC_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. */ -AX_DLL int32_t getCharacterCountInUTF8String(std::string_view utf8); +CC_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 @@ AX_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. */ -AX_DLL unsigned int getIndexOfLastNotChar16(const std::vector& str, char16_t c); +CC_DLL unsigned int getIndexOfLastNotChar16(const std::vector& str, char16_t c); /** * @brief Gets char16_t vector from a given utf16 string. */ -AX_DLL std::vector getChar16VectorFromUTF16String(const std::u16string& utf16); +CC_DLL std::vector getChar16VectorFromUTF16String(const std::u16string& utf16); /** * @brief Whether has non-ascii utf-8 characters */ -AX_DLL bool hasNonAsciiUTF8(const char* str, size_t len); +CC_DLL bool hasNonAsciiUTF8(const char* str, size_t len); /** * @brief Whether contains utf-8 or all characters are ascii */ -AX_DLL bool detectNonAsciiUTF8(const char* str, size_t len, bool restrictUTF8, bool* pAllCharsAreAscii); +CC_DLL bool detectNonAsciiUTF8(const char* str, size_t len, bool restrictUTF8, bool* pAllCharsAreAscii); /** * @brief isLegalUTF8String, contains ascii characters */ -AX_DLL bool isLegalUTF8String(const char* str, size_t len); +CC_DLL bool isLegalUTF8String(const char* str, size_t len); /** * Utf8 sequence * Store all utf8 chars as std::string * Build from std::string */ -class AX_DLL StringUTF8 +class CC_DLL StringUTF8 { public: struct CharUTF8 diff --git a/core/base/ccUtils.cpp b/core/base/ccUtils.cpp index d5ec1e2273..63ec1ebe51 100644 --- a/core/base/ccUtils.cpp +++ b/core/base/ccUtils.cpp @@ -91,7 +91,7 @@ void captureScreen(std::function)> imageCallback) auto eventDispatcher = director->getEventDispatcher(); // !!!Metal: needs setFrameBufferOnly before draw -#if defined(AX_USE_METAL) +#if defined(CC_USE_METAL) s_captureScreenListener = eventDispatcher->addCustomEventListener(Director::EVENT_BEFORE_DRAW, [=](EventCustom* /*event*/) { #else @@ -309,7 +309,7 @@ Sprite* createSpriteFromBase64Cached(const char* base64String, const char* key) if (!imageResult) { - AX_SAFE_RELEASE_NULL(image); + CC_SAFE_RELEASE_NULL(image); return nullptr; } @@ -333,7 +333,7 @@ Sprite* createSpriteFromBase64(const char* base64String) if (!imageResult) { - AX_SAFE_RELEASE_NULL(image); + CC_SAFE_RELEASE_NULL(image); return nullptr; } @@ -780,7 +780,7 @@ std::string urlDecode(std::string_view st) return decoded; } -AX_DLL uint32_t fourccValue(std::string_view str) +CC_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 585b4629c8..8a75bffd83 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 __AX_UTILS_H__ -#define __AX_UTILS_H__ +#ifndef __CC_UTILS_H__ +#define __CC_UTILS_H__ #include #include @@ -73,7 +73,7 @@ namespace utils * etc.). * @since v4.0 with axis */ -AX_DLL void captureScreen(std::function)> imageCallback); +CC_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 @@ AX_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 */ -AX_DLL void captureNode(Node* startNode, std::function)> imageCallback, float scale = 1.0f); +CC_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 @@ AX_DLL void captureNode(Node* startNode, std::function)> imag * etc.). * @since v4.0 */ -AX_DLL void captureScreen(std::function afterCap, std::string_view filename); +CC_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 @@ AX_DLL void captureScreen(std::function afterCap, * @return Array of Nodes that matches the name * @since v3.2 */ -AX_DLL std::vector findChildren(const Node& node, std::string_view name); +CC_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 @@ AX_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. */ -AX_DLL double atof(const char* str); +CC_DLL double atof(const char* str); /** Get current exact time, accurate to nanoseconds. * @return Returns the time in seconds since the Epoch. */ -AX_DLL double gettime(); +CC_DLL double gettime(); /** * Get current time in milliseconds, accurate to nanoseconds * * @return Returns the time in milliseconds since the Epoch. */ -AX_DLL long long getTimeInMilliseconds(); +CC_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. */ -AX_DLL Rect getCascadeBoundingBox(Node* node); +CC_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 */ -AX_DLL Sprite* createSpriteFromBase64Cached(const char* base64String, const char* key); +CC_DLL Sprite* createSpriteFromBase64Cached(const char* base64String, const char* key); /** * Create a sprite instance from base64 encoded image. * @return Returns an instance of sprite */ -AX_DLL Sprite* createSpriteFromBase64(const char* base64String); +CC_DLL Sprite* createSpriteFromBase64(const char* base64String); /** * Find a child by name recursively * @return Returns found node or nullptr */ -AX_DLL Node* findChild(Node* levelRoot, std::string_view name); +CC_DLL Node* findChild(Node* levelRoot, std::string_view name); /** * Find a child by tag recursively * @return Returns found node or nullptr */ -AX_DLL Node* findChild(Node* levelRoot, int tag); +CC_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 */ -AX_DLL std::string getFileMD5Hash(std::string_view filename); +CC_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 */ -AX_DLL std::string getDataMD5Hash(const Data& data); +CC_DLL std::string getDataMD5Hash(const Data& data); /** * Gets the hash for the given buffer with specific algorithm. @@ -202,7 +202,7 @@ AX_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 */ -AX_DLL std::string computeDigest(std::string_view data, std::string_view algorithm); +CC_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 @@ AX_DLL std::string computeDigest(std::string_view data, std::string_view algorit * @js NA * @lua NA */ -AX_DLL LanguageType getLanguageTypeByISO2(const char* code); +CC_DLL LanguageType getLanguageTypeByISO2(const char* code); -AX_DLL backend::BlendFactor toBackendBlendFactor(int factor); +CC_DLL backend::BlendFactor toBackendBlendFactor(int factor); -AX_DLL int toGLBlendFactor(backend::BlendFactor blendFactor); +CC_DLL int toGLBlendFactor(backend::BlendFactor blendFactor); -AX_DLL backend::SamplerFilter toBackendSamplerFilter(int mode); +CC_DLL backend::SamplerFilter toBackendSamplerFilter(int mode); -AX_DLL backend::SamplerAddressMode toBackendAddressMode(int mode); +CC_DLL backend::SamplerAddressMode toBackendAddressMode(int mode); // Adjust matrix for metal. -AX_DLL const Mat4& getAdjustMatrix(); +CC_DLL const Mat4& getAdjustMatrix(); /** Get the Normal Matrix of matrixMV */ -AX_DLL std::vector getNormalMat3OfMat4(const Mat4& mat); +CC_DLL std::vector getNormalMat3OfMat4(const Mat4& mat); /** @brief Parses a list of space-separated integers. @@ -234,7 +234,7 @@ AX_DLL std::vector getNormalMat3OfMat4(const Mat4& mat); * @js NA * @lua NA */ -AX_DLL std::vector parseIntegerList(std::string_view intsString); +CC_DLL std::vector parseIntegerList(std::string_view intsString); /** @brief translate charstring/binarystream to hexstring. @@ -242,7 +242,7 @@ AX_DLL std::vector parseIntegerList(std::string_view intsString); * @js NA * @lua NA */ -AX_DLL std::string bin2hex(std::string_view binary /*charstring also regard as binary in C/C++*/, +CC_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 @@ AX_DLL std::string bin2hex(std::string_view binary /*charstring also regard as b * @js NA * @lua NA */ -AX_DLL void killCurrentProcess(); +CC_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; } -AX_DLL std::string urlEncode(std::string_view s); +CC_DLL std::string urlEncode(std::string_view s); -AX_DLL std::string urlDecode(std::string_view st); +CC_DLL std::string urlDecode(std::string_view st); -AX_DLL uint32_t fourccValue(std::string_view str); +CC_DLL uint32_t fourccValue(std::string_view str); } // namespace utils NS_AX_END -#endif // __SUPPORT_AX_UTILS_H__ +#endif // __SUPPORT_CC_UTILS_H__ diff --git a/core/cocos2d.h b/core/cocos2d.h index 7e5b95c698..244d8549db 100644 --- a/core/cocos2d.h +++ b/core/cocos2d.h @@ -36,7 +36,7 @@ THE SOFTWARE. NS_AX_BEGIN -AX_DLL const char* cocos2dVersion(); +CC_DLL const char* cocos2dVersion(); /** Backward compatibility with old axis projects */ diff --git a/core/math/CCAffineTransform.h b/core/math/CCAffineTransform.h index 03a2c13b99..99ad200934 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 AX_DLL AffineTransform +struct CC_DLL AffineTransform { float a, b, c, d; float tx, ty; @@ -60,25 +60,25 @@ struct AX_DLL AffineTransform /**@}*/ /**Make affine transform.*/ -AX_DLL AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty); +CC_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.*/ -AX_DLL Vec2 __CCPointApplyAffineTransform(const Vec2& point, const AffineTransform& t); +CC_DLL Vec2 __CCPointApplyAffineTransform(const Vec2& point, const AffineTransform& t); #define PointApplyAffineTransform __CCPointApplyAffineTransform /**Multiply size (width,height,0) by a affine transform.*/ -AX_DLL Vec2 __CCSizeApplyAffineTransform(const Vec2& size, const AffineTransform& t); +CC_DLL Vec2 __CCSizeApplyAffineTransform(const Vec2& size, const AffineTransform& t); #define SizeApplyAffineTransform __CCSizeApplyAffineTransform /**Make identity affine transform.*/ -AX_DLL AffineTransform AffineTransformMakeIdentity(); +CC_DLL AffineTransform AffineTransformMakeIdentity(); /**Transform Rect, which will transform the four vertices of the point.*/ -AX_DLL Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform); +CC_DLL Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform); /**@{ Transform vec2 and Rect by Mat4. */ -AX_DLL Rect RectApplyTransform(const Rect& rect, const Mat4& transform); -AX_DLL Vec2 PointApplyTransform(const Vec2& point, const Mat4& transform); +CC_DLL Rect RectApplyTransform(const Rect& rect, const Mat4& transform); +CC_DLL Vec2 PointApplyTransform(const Vec2& point, const Mat4& transform); /**@}*/ /** Translation, equals @@ -86,31 +86,31 @@ AX_DLL Vec2 PointApplyTransform(const Vec2& point, const Mat4& transform); 0 1 0 * affine transform tx ty 1 */ -AX_DLL AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty); +CC_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 */ -AX_DLL AffineTransform AffineTransformRotate(const AffineTransform& aTransform, float anAngle); +CC_DLL AffineTransform AffineTransformRotate(const AffineTransform& aTransform, float anAngle); /** Scale, equals sx 0 0 0 sy 0 * affineTransform 0 0 1 */ -AX_DLL AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy); +CC_DLL AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy); /**Concat two affine transform, t1 * t2*/ -AX_DLL AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2); +CC_DLL AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2); /**Compare affine transform.*/ -AX_DLL bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2); +CC_DLL bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2); /**Get the inverse of affine transform.*/ -AX_DLL AffineTransform AffineTransformInvert(const AffineTransform& t); +CC_DLL AffineTransform AffineTransformInvert(const AffineTransform& t); /**Concat Mat4, return t1 * t2.*/ -AX_DLL Mat4 TransformConcat(const Mat4& t1, const Mat4& t2); +CC_DLL Mat4 TransformConcat(const Mat4& t1, const Mat4& t2); -extern AX_DLL const AffineTransform AffineTransformIdentity; +extern CC_DLL const AffineTransform AffineTransformIdentity; NS_AX_END diff --git a/core/math/CCMath.h b/core/math/CCMath.h index 0dea46eaf1..9970ea55dd 100644 --- a/core/math/CCMath.h +++ b/core/math/CCMath.h @@ -22,8 +22,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_MATH_H__ -#define __AX_MATH_H__ +#ifndef __CC_MATH_H__ +#define __CC_MATH_H__ #include "math/Vec2.h" #include "math/Vec3.h" diff --git a/core/math/CCVertex.cpp b/core/math/CCVertex.cpp index d837efa845..7973d0baad 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 < AX_DEGREES_TO_RADIANS(70)) + if (angle < CC_DEGREES_TO_RADIANS(70)) perpVector = p2p1.getMidpoint(p0p1).getNormalized().getPerp(); - else if (angle < AX_DEGREES_TO_RADIANS(170)) + else if (angle < CC_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 a85f2776b3..56d3f38e96 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 AX_DLL +void CC_DLL ccVertexLineToPolygon(Vec2* points, float stroke, Vec2* vertices, unsigned int offset, unsigned int nuPoints); /** returns whether or not the line intersects */ -bool AX_DLL +bool CC_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 0ab9228c2b..32ac43cc49 100644 --- a/core/math/Mat4.cpp +++ b/core/math/Mat4.cpp @@ -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 AX_USE_METAL +#ifdef CC_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 AX_USE_METAL +#ifdef CC_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 9f8721395c..5118e56f14 100644 --- a/core/math/Mat4.h +++ b/core/math/Mat4.h @@ -72,7 +72,7 @@ NS_AX_MATH_BEGIN * * @see Transform */ -class AX_DLL Mat4 +class CC_DLL Mat4 { public: // //temp add conversion diff --git a/core/math/MathUtil.cpp b/core/math/MathUtil.cpp index 0a38766fae..76450f6625 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#elif (CC_TARGET_PLATFORM == CC_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) && (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)) +#elif (defined(INCLUDE_NEON32) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)) class AnrdoidNeonChecker { public: diff --git a/core/math/MathUtil.h b/core/math/MathUtil.h index cad9960928..aba75e31bb 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 AX_DLL MathUtil +class CC_DLL MathUtil { friend class Mat4; friend class Vec3; diff --git a/core/math/Quaternion.h b/core/math/Quaternion.h index 9c04056b68..7258a82172 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 AX_DLL Quaternion +class CC_DLL Quaternion { friend class Curve; friend class Transform; diff --git a/core/math/Rect.h b/core/math/Rect.h index 78f08d9d12..29818057b7 100644 --- a/core/math/Rect.h +++ b/core/math/Rect.h @@ -38,7 +38,7 @@ THE SOFTWARE. NS_AX_BEGIN /**Rectangle area.*/ -class AX_DLL Rect +class CC_DLL Rect { public: /**Low left point of rect.*/ diff --git a/core/math/TransformUtils.h b/core/math/TransformUtils.h index cd5d7ce98c..32b11d38dc 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. */ -AX_DLL void CGAffineToGL(const AffineTransform& t, float* m); -AX_DLL void GLToCGAffine(const float* m, AffineTransform* t); +CC_DLL void CGAffineToGL(const AffineTransform& t, float* m); +CC_DLL void GLToCGAffine(const float* m, AffineTransform* t); /**@}*/ } // namespace cocos2d /** diff --git a/core/math/Vec2.h b/core/math/Vec2.h index 54c0f0fe6d..fef1349ea4 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 AX_DLL Vec2 +class CC_DLL Vec2 { public: union diff --git a/core/math/Vec3.h b/core/math/Vec3.h index 6a337ceb16..71bb9d413f 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 AX_DLL Vec3 +class CC_DLL Vec3 { public: /** diff --git a/core/math/Vec4.h b/core/math/Vec4.h index 5f4d928b7b..b8876f3ca9 100644 --- a/core/math/Vec4.h +++ b/core/math/Vec4.h @@ -41,7 +41,7 @@ class Mat4; /** * Defines 4-element floating point vector. */ -class AX_DLL Vec4 +class CC_DLL Vec4 { public: #ifdef __SSE__ diff --git a/core/navmesh/CCNavMesh.cpp b/core/navmesh/CCNavMesh.cpp index 49f1fd72e7..3c8882c2f2 100644 --- a/core/navmesh/CCNavMesh.cpp +++ b/core/navmesh/CCNavMesh.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "navmesh/CCNavMesh.h" -#if AX_USE_NAVMESH +#if CC_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; } - AX_SAFE_DELETE(ref); + CC_SAFE_DELETE(ref); return nullptr; } @@ -120,20 +120,20 @@ NavMesh::~NavMesh() dtFreeCrowd(_crowed); dtFreeNavMesh(_navMesh); dtFreeNavMeshQuery(_navMeshQuery); - AX_SAFE_DELETE(_allocator); - AX_SAFE_DELETE(_compressor); - AX_SAFE_DELETE(_meshProcess); - AX_SAFE_DELETE(_geomData); + CC_SAFE_DELETE(_allocator); + CC_SAFE_DELETE(_compressor); + CC_SAFE_DELETE(_meshProcess); + CC_SAFE_DELETE(_geomData); for (auto iter : _agentList) { - AX_SAFE_RELEASE(iter); + CC_SAFE_RELEASE(iter); } _agentList.clear(); for (auto iter : _obstacleList) { - AX_SAFE_RELEASE(iter); + CC_SAFE_RELEASE(iter); } _obstacleList.clear(); } @@ -662,4 +662,4 @@ void axis::NavMesh::findPath(const Vec3& start, const Vec3& end, std::vectorautorelease(); return ref; } - AX_SAFE_DELETE(ref); + CC_SAFE_DELETE(ref); return nullptr; } @@ -424,4 +424,4 @@ Vec3 NavMeshAgent::getVelocity() const NS_AX_END -#endif // AX_USE_NAVMESH +#endif // CC_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshAgent.h b/core/navmesh/CCNavMeshAgent.h index 32f9d85afc..3afbc9ba64 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 AX_USE_NAVMESH +#if CC_USE_NAVMESH # include "2d/CCComponent.h" # include "base/CCRef.h" @@ -41,7 +41,7 @@ NS_AX_BEGIN * @addtogroup 3d * @{ */ -struct AX_DLL NavMeshAgentParam +struct CC_DLL NavMeshAgentParam { NavMeshAgentParam(); @@ -69,14 +69,14 @@ struct AX_DLL NavMeshAgentParam unsigned char queryFilterType; }; -struct AX_DLL OffMeshLinkData +struct CC_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 AX_DLL NavMeshAgent : public Component +class CC_DLL NavMeshAgent : public Component { friend class NavMesh; @@ -232,6 +232,6 @@ private: NS_AX_END -#endif // AX_USE_NAVMESH +#endif // CC_USE_NAVMESH #endif // __CCNAV_MESH_AGENT_H__ diff --git a/core/navmesh/CCNavMeshDebugDraw.cpp b/core/navmesh/CCNavMeshDebugDraw.cpp index e9e59703cc..f82c5c6a64 100644 --- a/core/navmesh/CCNavMeshDebugDraw.cpp +++ b/core/navmesh/CCNavMeshDebugDraw.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "navmesh/CCNavMeshDebugDraw.h" -#if AX_USE_NAVMESH +#if CC_USE_NAVMESH # include // offsetof # include "base/ccTypes.h" # include "renderer/backend/ProgramState.h" @@ -98,8 +98,8 @@ NavMeshDebugDraw::~NavMeshDebugDraw() { delete iter; } - AX_SAFE_RELEASE_NULL(_programState); - AX_SAFE_RELEASE_NULL(_vertexBuffer); + CC_SAFE_RELEASE_NULL(_programState); + CC_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 = AX_CALLBACK_0(NavMeshDebugDraw::onBeforeVisitCmd, this); - afterCommand->func = AX_CALLBACK_0(NavMeshDebugDraw::onAfterVisitCmd, this); + beforeCommand->func = CC_CALLBACK_0(NavMeshDebugDraw::onBeforeVisitCmd, this); + afterCommand->func = CC_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(AX_CALLBACK_0(NavMeshDebugDraw::onBeforeEachCommand, this, iter->depthMask)); + command.setBeforeCallback(CC_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); - AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, iter->end - iter->start); + CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, iter->end - iter->start); idx++; } @@ -264,4 +264,4 @@ void NavMeshDebugDraw::clear() NS_AX_END -#endif // AX_USE_NAVMESH +#endif // CC_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshDebugDraw.h b/core/navmesh/CCNavMeshDebugDraw.h index d7de6d727a..786603955d 100644 --- a/core/navmesh/CCNavMeshDebugDraw.h +++ b/core/navmesh/CCNavMeshDebugDraw.h @@ -26,7 +26,7 @@ #pragma once #include "base/ccConfig.h" -#if AX_USE_NAVMESH +#if CC_USE_NAVMESH # include "renderer/CCRenderState.h" # include "renderer/backend/ProgramState.h" @@ -122,4 +122,4 @@ private: NS_AX_END -#endif // AX_USE_NAVMESH +#endif // CC_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshObstacle.cpp b/core/navmesh/CCNavMeshObstacle.cpp index 819125e28c..a8aeebaf96 100644 --- a/core/navmesh/CCNavMeshObstacle.cpp +++ b/core/navmesh/CCNavMeshObstacle.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "navmesh/CCNavMeshObstacle.h" -#if AX_USE_NAVMESH +#if CC_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; } - AX_SAFE_DELETE(ref); + CC_SAFE_DELETE(ref); return nullptr; } @@ -164,4 +164,4 @@ void NavMeshObstacle::syncToObstacle() NS_AX_END -#endif // AX_USE_NAVMESH +#endif // CC_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshObstacle.h b/core/navmesh/CCNavMeshObstacle.h index bd7cf15b5d..3503c5f4e4 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 AX_USE_NAVMESH +#if CC_USE_NAVMESH # include "2d/CCComponent.h" @@ -44,7 +44,7 @@ NS_AX_BEGIN */ /** @brief NavMeshObstacle: The code wrapping of dtTileCacheObstacle, use component mode. */ -class AX_DLL NavMeshObstacle : public Component +class CC_DLL NavMeshObstacle : public Component { friend class NavMesh; @@ -117,6 +117,6 @@ private: NS_AX_END -#endif // AX_USE_NAVMESH +#endif // CC_USE_NAVMESH #endif // __CCNAV_MESH_OBSTACLE_H__ diff --git a/core/navmesh/CCNavMeshUtils.cpp b/core/navmesh/CCNavMeshUtils.cpp index e303b41fe3..45e3789ec7 100644 --- a/core/navmesh/CCNavMeshUtils.cpp +++ b/core/navmesh/CCNavMeshUtils.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "navmesh/CCNavMeshUtils.h" -#if AX_USE_NAVMESH +#if CC_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 // AX_USE_NAVMESH +#endif // CC_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshUtils.h b/core/navmesh/CCNavMeshUtils.h index 00e66f0006..122671b4ad 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 AX_USE_NAVMESH +#if CC_USE_NAVMESH # include "platform/CCPlatformMacros.h" # include "math/CCMath.h" @@ -143,6 +143,6 @@ bool getSteerTarget(dtNavMeshQuery* navQuery, NS_AX_END -#endif // AX_USE_NAVMESH +#endif // CC_USE_NAVMESH #endif // __CCNAV_MESH_H__ diff --git a/core/network/CCDownloader-curl.cpp b/core/network/CCDownloader-curl.cpp index 2e2381aa56..db6f3a3e75 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 AX_CURL_POLL_TIMEOUT_MS 50 // wait until DNS query done +#define CC_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(AX_CURL_POLL_TIMEOUT_MS)); + std::this_thread::sleep_for(std::chrono::milliseconds(CC_CURL_POLL_TIMEOUT_MS)); rc = 0; } else diff --git a/core/network/CCDownloader.h b/core/network/CCDownloader.h index d59464d2a9..e3a32e1bf5 100644 --- a/core/network/CCDownloader.h +++ b/core/network/CCDownloader.h @@ -43,7 +43,7 @@ class IDownloaderImpl; class Downloader; class DownloaderCURL; -class AX_DLL DownloadTask final +class CC_DLL DownloadTask final { public: const static int ERROR_NO_ERROR = 0; @@ -96,7 +96,7 @@ private: std::unique_ptr _coTask; }; -class AX_DLL DownloaderHints +class CC_DLL DownloaderHints { public: uint32_t countOfMaxProcessingTasks; @@ -104,7 +104,7 @@ public: std::string tempFileNameSuffix; }; -class AX_DLL Downloader final +class CC_DLL Downloader final { public: Downloader(); diff --git a/core/network/CCIDownloaderImpl.h b/core/network/CCIDownloaderImpl.h index 3ea7927d31..9bd5339f78 100644 --- a/core/network/CCIDownloaderImpl.h +++ b/core/network/CCIDownloaderImpl.h @@ -32,8 +32,8 @@ #include "base/CCConsole.h" -// #define AX_DOWNLOADER_DEBUG -#if defined(AX_DOWNLOADER_DEBUG) || defined(_DEBUG) +// #define CC_DOWNLOADER_DEBUG +#if defined(CC_DOWNLOADER_DEBUG) || defined(_DEBUG) # define DLLOG(format, ...) axis::log(format, ##__VA_ARGS__) #else # define DLLOG(...) \ @@ -48,7 +48,7 @@ namespace network { class DownloadTask; -class AX_DLL IDownloadTask +class CC_DLL IDownloadTask { public: virtual ~IDownloadTask() {} diff --git a/core/network/HttpClient.cpp b/core/network/HttpClient.cpp index 18a15688bb..cd6273f814 100644 --- a/core/network/HttpClient.cpp +++ b/core/network/HttpClient.cpp @@ -442,7 +442,7 @@ void HttpClient::dispatchResponseCallbacks() if (_finishedResponseQueue.unsafe_empty()) return; - auto AX_UNUSED lck = _finishedResponseQueue.get_lock(); + auto CC_UNUSED lck = _finishedResponseQueue.get_lock(); if (!_finishedResponseQueue.unsafe_empty()) { HttpResponse* response = _finishedResponseQueue.front(); @@ -495,13 +495,13 @@ void HttpClient::clearResponseQueue() void HttpClient::clearPendingResponseQueue() { - auto AX_UNUSED lck = _pendingResponseQueue.get_lock(); + auto CC_UNUSED lck = _pendingResponseQueue.get_lock(); __clearQueueUnsafe(_pendingResponseQueue, ClearResponsePredicate{}); } void HttpClient::clearFinishedResponseQueue() { - auto AX_UNUSED lck = _finishedResponseQueue.get_lock(); + auto CC_UNUSED lck = _finishedResponseQueue.get_lock(); __clearQueueUnsafe(_finishedResponseQueue, ClearResponsePredicate{}); } diff --git a/core/network/HttpClient.h b/core/network/HttpClient.h index dfe4a92e40..8881aac357 100644 --- a/core/network/HttpClient.h +++ b/core/network/HttpClient.h @@ -56,7 +56,7 @@ namespace network * * @lua NA */ -class AX_DLL HttpClient +class CC_DLL HttpClient { public: /** diff --git a/core/network/HttpRequest.h b/core/network/HttpRequest.h index 77cfc7eb18..06095520e4 100644 --- a/core/network/HttpRequest.h +++ b/core/network/HttpRequest.h @@ -60,7 +60,7 @@ typedef std::function ccHttpRe * @lua NA */ -class AX_DLL HttpRequest : public Ref +class CC_DLL HttpRequest : public Ref { friend class HttpClient; diff --git a/core/network/HttpResponse.h b/core/network/HttpResponse.h index f3c185ea02..3e2858c7ff 100644 --- a/core/network/HttpResponse.h +++ b/core/network/HttpResponse.h @@ -51,7 +51,7 @@ class HttpClient; * @since v2.0.2. * @lua NA */ -class AX_DLL HttpResponse : public axis::Ref +class CC_DLL HttpResponse : public axis::Ref { friend class HttpClient; diff --git a/core/network/Uri.h b/core/network/Uri.h index 7933aa7ce7..15d60d83d0 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 AX_DLL Uri +class CC_DLL Uri { public: /** diff --git a/core/physics/CCPhysicsBody.cpp b/core/physics/CCPhysicsBody.cpp index b7ceaa6f32..817399b9c5 100644 --- a/core/physics/CCPhysicsBody.cpp +++ b/core/physics/CCPhysicsBody.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "physics/CCPhysicsBody.h" -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS # include # include @@ -137,7 +137,7 @@ PhysicsBody* PhysicsBody::create() return body; } - AX_SAFE_DELETE(body); + CC_SAFE_DELETE(body); return nullptr; } @@ -155,7 +155,7 @@ PhysicsBody* PhysicsBody::create(float mass) } } - AX_SAFE_DELETE(body); + CC_SAFE_DELETE(body); return nullptr; } @@ -175,7 +175,7 @@ PhysicsBody* PhysicsBody::create(float mass, float moment) } } - AX_SAFE_DELETE(body); + CC_SAFE_DELETE(body); return nullptr; } @@ -189,7 +189,7 @@ PhysicsBody* PhysicsBody::createCircle(float radius, const PhysicsMaterial& mate return body; } - AX_SAFE_DELETE(body); + CC_SAFE_DELETE(body); return nullptr; } @@ -203,7 +203,7 @@ PhysicsBody* PhysicsBody::createBox(const Vec2& size, const PhysicsMaterial& mat return body; } - AX_SAFE_DELETE(body); + CC_SAFE_DELETE(body); return nullptr; } @@ -220,7 +220,7 @@ PhysicsBody* PhysicsBody::createPolygon(const Vec2* points, return body; } - AX_SAFE_DELETE(body); + CC_SAFE_DELETE(body); return nullptr; } @@ -238,7 +238,7 @@ PhysicsBody* PhysicsBody::createEdgeSegment(const Vec2& a, return body; } - AX_SAFE_DELETE(body); + CC_SAFE_DELETE(body); return nullptr; } @@ -256,7 +256,7 @@ PhysicsBody* PhysicsBody::createEdgeBox(const Vec2& size, return body; } - AX_SAFE_DELETE(body); + CC_SAFE_DELETE(body); return nullptr; } @@ -275,7 +275,7 @@ PhysicsBody* PhysicsBody::createEdgePolygon(const Vec2* points, return body; } - AX_SAFE_DELETE(body); + CC_SAFE_DELETE(body); return nullptr; } @@ -294,7 +294,7 @@ PhysicsBody* PhysicsBody::createEdgeChain(const Vec2* points, return body; } - AX_SAFE_DELETE(body); + CC_SAFE_DELETE(body); return nullptr; } @@ -308,7 +308,7 @@ bool PhysicsBody::init() cpBodySetUserData(_cpBody, this); cpBodySetVelocityUpdateFunc(_cpBody, internalBodyUpdateVelocity); - AX_BREAK_IF(_cpBody == nullptr); + CC_BREAK_IF(_cpBody == nullptr); return true; } while (false); @@ -1011,4 +1011,4 @@ void PhysicsBody::removeFromPhysicsWorld() NS_AX_END -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS diff --git a/core/physics/CCPhysicsBody.h b/core/physics/CCPhysicsBody.h index ad69381e54..389b5ffaad 100644 --- a/core/physics/CCPhysicsBody.h +++ b/core/physics/CCPhysicsBody.h @@ -28,7 +28,7 @@ #define __CCPHYSICS_BODY_H__ #include "base/ccConfig.h" -#if AX_USE_PHYSICS +#if CC_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 AX_DLL PhysicsBody : public Component +class CC_DLL PhysicsBody : public Component { public: const static std::string COMPONENT_NAME; @@ -618,5 +618,5 @@ protected: NS_AX_END -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS #endif // __CCPHYSICS_BODY_H__ diff --git a/core/physics/CCPhysicsContact.cpp b/core/physics/CCPhysicsContact.cpp index 2eb2f9b5fc..cdb9759fad 100644 --- a/core/physics/CCPhysicsContact.cpp +++ b/core/physics/CCPhysicsContact.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "physics/CCPhysicsContact.h" -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS # include "chipmunk/chipmunk.h" # include "physics/CCPhysicsBody.h" @@ -50,8 +50,8 @@ PhysicsContact::PhysicsContact() PhysicsContact::~PhysicsContact() { - AX_SAFE_DELETE(_contactData); - AX_SAFE_DELETE(_preContactData); + CC_SAFE_DELETE(_contactData); + CC_SAFE_DELETE(_preContactData); } PhysicsContact* PhysicsContact::construct(PhysicsShape* a, PhysicsShape* b) @@ -62,7 +62,7 @@ PhysicsContact* PhysicsContact::construct(PhysicsShape* a, PhysicsShape* b) return contact; } - AX_SAFE_DELETE(contact); + CC_SAFE_DELETE(contact); return nullptr; } @@ -70,7 +70,7 @@ bool PhysicsContact::init(PhysicsShape* a, PhysicsShape* b) { do { - AX_BREAK_IF(a == nullptr || b == nullptr); + CC_BREAK_IF(a == nullptr || b == nullptr); _shapeA = a; _shapeB = b; @@ -89,7 +89,7 @@ void PhysicsContact::generateContactData() } cpArbiter* arb = static_cast(_contactInfo); - AX_SAFE_DELETE(_preContactData); + CC_SAFE_DELETE(_preContactData); _preContactData = _contactData; _contactData = new PhysicsContactData(); _contactData->count = cpArbiterGetCount(arb); @@ -245,7 +245,7 @@ EventListenerPhysicsContact* EventListenerPhysicsContact::create() return obj; } - AX_SAFE_DELETE(obj); + CC_SAFE_DELETE(obj); return nullptr; } @@ -280,7 +280,7 @@ EventListenerPhysicsContact* EventListenerPhysicsContact::clone() return obj; } - AX_SAFE_DELETE(obj); + CC_SAFE_DELETE(obj); return nullptr; } @@ -297,7 +297,7 @@ EventListenerPhysicsContactWithBodies* EventListenerPhysicsContactWithBodies::cr return obj; } - AX_SAFE_DELETE(obj); + CC_SAFE_DELETE(obj); return nullptr; } @@ -329,7 +329,7 @@ EventListenerPhysicsContactWithBodies* EventListenerPhysicsContactWithBodies::cl return obj; } - AX_SAFE_DELETE(obj); + CC_SAFE_DELETE(obj); return nullptr; } @@ -350,7 +350,7 @@ EventListenerPhysicsContactWithShapes* EventListenerPhysicsContactWithShapes::cr return obj; } - AX_SAFE_DELETE(obj); + CC_SAFE_DELETE(obj); return nullptr; } @@ -378,7 +378,7 @@ EventListenerPhysicsContactWithShapes* EventListenerPhysicsContactWithShapes::cl return obj; } - AX_SAFE_DELETE(obj); + CC_SAFE_DELETE(obj); return nullptr; } @@ -397,7 +397,7 @@ EventListenerPhysicsContactWithGroup* EventListenerPhysicsContactWithGroup::crea return obj; } - AX_SAFE_DELETE(obj); + CC_SAFE_DELETE(obj); return nullptr; } @@ -425,9 +425,9 @@ EventListenerPhysicsContactWithGroup* EventListenerPhysicsContactWithGroup::clon return obj; } - AX_SAFE_DELETE(obj); + CC_SAFE_DELETE(obj); return nullptr; } NS_AX_END -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS diff --git a/core/physics/CCPhysicsContact.h b/core/physics/CCPhysicsContact.h index 693a01a740..7e4200e5d0 100644 --- a/core/physics/CCPhysicsContact.h +++ b/core/physics/CCPhysicsContact.h @@ -27,7 +27,7 @@ #define __CCPHYSICS_CONTACT_H__ #include "base/ccConfig.h" -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS # include "base/CCRef.h" # include "math/CCMath.h" @@ -41,7 +41,7 @@ class PhysicsShape; class PhysicsBody; class PhysicsWorld; -typedef struct AX_DLL PhysicsContactData +typedef struct CC_DLL PhysicsContactData { static const int POINT_MAX = 4; Vec2 points[POINT_MAX]; @@ -64,7 +64,7 @@ typedef struct AX_DLL PhysicsContactData * It will created automatically when two shape contact with each other. And it will destroyed automatically when two shape separated. */ -class AX_DLL PhysicsContact : public EventCustom +class CC_DLL PhysicsContact : public EventCustom { public: enum class EventCode @@ -151,7 +151,7 @@ private: /** * @brief Presolve value generated when onContactPreSolve called. */ -class AX_DLL PhysicsContactPreSolve +class CC_DLL PhysicsContactPreSolve { public: /** Get restitution between two bodies.*/ @@ -182,7 +182,7 @@ private: /** * @brief Postsolve value generated when onContactPostSolve called. */ -class AX_DLL PhysicsContactPostSolve +class CC_DLL PhysicsContactPostSolve { public: /** Get restitution between two bodies.*/ @@ -203,7 +203,7 @@ private: }; /** Contact listener. It will receive all the contact callbacks. */ -class AX_DLL EventListenerPhysicsContact : public EventListenerCustom +class CC_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 AX_DLL EventListenerPhysicsContactWithBodies : public EventListenerPhysicsContact +class CC_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 AX_DLL EventListenerPhysicsContactWithShapes : public EventListenerPhysicsContact +class CC_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 AX_DLL EventListenerPhysicsContactWithGroup : public EventListenerPhysicsContact +class CC_DLL EventListenerPhysicsContactWithGroup : public EventListenerPhysicsContact { public: /** Create the listener. */ @@ -321,5 +321,5 @@ protected: NS_AX_END -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS #endif //__CCPHYSICS_CONTACT_H__ diff --git a/core/physics/CCPhysicsHelper.h b/core/physics/CCPhysicsHelper.h index 557c432c9f..6dab709a11 100644 --- a/core/physics/CCPhysicsHelper.h +++ b/core/physics/CCPhysicsHelper.h @@ -28,7 +28,7 @@ #define __CCPHYSICS_HELPER_H__ #include "base/ccConfig.h" -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS # include "chipmunk/chipmunk.h" # include "platform/CCPlatformMacros.h" @@ -112,5 +112,5 @@ public: NS_AX_END -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS #endif // __CCPHYSICS_HELPER_H__ diff --git a/core/physics/CCPhysicsJoint.cpp b/core/physics/CCPhysicsJoint.cpp index 9dd3efbb63..8bf9dadd47 100644 --- a/core/physics/CCPhysicsJoint.cpp +++ b/core/physics/CCPhysicsJoint.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "physics/CCPhysicsJoint.h" -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS # include "chipmunk/chipmunk.h" # include "physics/CCPhysicsBody.h" @@ -92,7 +92,7 @@ public: # define UNLIKELY(x) (x) # endif -# define AX_PJOINT_CACHE_READ(field) \ +# define CC_PJOINT_CACHE_READ(field) \ do \ { \ if (UNLIKELY(_initDirty)) \ @@ -101,7 +101,7 @@ public: } \ } while (0) -# define AX_PJOINT_CACHE_WRITE2(field, method, arg, convertedArg) \ +# define CC_PJOINT_CACHE_WRITE2(field, method, arg, convertedArg) \ do \ { \ if (UNLIKELY(_initDirty)) \ @@ -115,7 +115,7 @@ public: } \ } while (0) -# define AX_PJOINT_CACHE_WRITE(field, method, arg) AX_PJOINT_CACHE_WRITE2(field, method, arg, arg) +# define CC_PJOINT_CACHE_WRITE(field, method, arg) CC_PJOINT_CACHE_WRITE2(field, method, arg, arg) PhysicsJoint::PhysicsJoint() : _bodyA(nullptr) @@ -169,7 +169,7 @@ bool PhysicsJoint::initJoint() while (_initDirty) { ret = createConstraints(); - AX_BREAK_IF(!ret); + CC_BREAK_IF(!ret); for (auto subjoint : _cpConstraints) { @@ -261,7 +261,7 @@ PhysicsJointFixed* PhysicsJointFixed::construct(PhysicsBody* a, PhysicsBody* b, return joint; } - AX_SAFE_DELETE(joint); + CC_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)); - AX_BREAK_IF(joint == nullptr); + CC_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); - AX_BREAK_IF(joint == nullptr); + CC_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); _collisionEnable = false; @@ -301,7 +301,7 @@ PhysicsJointPin* PhysicsJointPin::construct(PhysicsBody* a, PhysicsBody* b, cons return joint; } - AX_SAFE_DELETE(joint); + CC_SAFE_DELETE(joint); return nullptr; } @@ -318,7 +318,7 @@ PhysicsJointPin* PhysicsJointPin::construct(PhysicsBody* a, PhysicsBody* b, cons return joint; } - AX_SAFE_DELETE(joint); + CC_SAFE_DELETE(joint); return nullptr; } @@ -337,7 +337,7 @@ bool PhysicsJointPin::createConstraints() joint = cpPivotJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), PhysicsHelper::vec22cpv(_anchr1)); } - AX_BREAK_IF(joint == nullptr); + CC_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -365,7 +365,7 @@ PhysicsJointLimit* PhysicsJointLimit::construct(PhysicsBody* a, return joint; } - AX_SAFE_DELETE(joint); + CC_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); - AX_BREAK_IF(joint == nullptr); + CC_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -392,46 +392,46 @@ bool PhysicsJointLimit::createConstraints() float PhysicsJointLimit::getMin() const { - AX_PJOINT_CACHE_READ(_min); + CC_PJOINT_CACHE_READ(_min); return PhysicsHelper::cpfloat2float(cpSlideJointGetMin(_cpConstraints.front())); } void PhysicsJointLimit::setMin(float min) { - AX_PJOINT_CACHE_WRITE(_min, cpSlideJointSetMin, min); + CC_PJOINT_CACHE_WRITE(_min, cpSlideJointSetMin, min); } float PhysicsJointLimit::getMax() const { - AX_PJOINT_CACHE_READ(_max); + CC_PJOINT_CACHE_READ(_max); return PhysicsHelper::cpfloat2float(cpSlideJointGetMax(_cpConstraints.front())); } void PhysicsJointLimit::setMax(float max) { - AX_PJOINT_CACHE_WRITE(_max, cpSlideJointSetMax, max); + CC_PJOINT_CACHE_WRITE(_max, cpSlideJointSetMax, max); } Vec2 PhysicsJointLimit::getAnchr1() const { - AX_PJOINT_CACHE_READ(_anchr1); + CC_PJOINT_CACHE_READ(_anchr1); return PhysicsHelper::cpv2vec2(cpSlideJointGetAnchorA(_cpConstraints.front())); } void PhysicsJointLimit::setAnchr1(const Vec2& anchr) { - AX_PJOINT_CACHE_WRITE2(_anchr1, cpSlideJointSetAnchorA, anchr, PhysicsHelper::vec22cpv(anchr)); + CC_PJOINT_CACHE_WRITE2(_anchr1, cpSlideJointSetAnchorA, anchr, PhysicsHelper::vec22cpv(anchr)); } Vec2 PhysicsJointLimit::getAnchr2() const { - AX_PJOINT_CACHE_READ(_anchr2); + CC_PJOINT_CACHE_READ(_anchr2); return PhysicsHelper::cpv2vec2(cpSlideJointGetAnchorB(_cpConstraints.front())); } void PhysicsJointLimit::setAnchr2(const Vec2& anchr) { - AX_PJOINT_CACHE_WRITE2(_anchr2, cpSlideJointSetAnchorB, anchr, PhysicsHelper::vec22cpv(anchr)); + CC_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; } - AX_SAFE_DELETE(joint); + CC_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)); - AX_BREAK_IF(joint == nullptr); + CC_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -470,13 +470,13 @@ bool PhysicsJointDistance::createConstraints() float PhysicsJointDistance::getDistance() const { - AX_PJOINT_CACHE_READ(_distance); + CC_PJOINT_CACHE_READ(_distance); return PhysicsHelper::cpfloat2float(cpPinJointGetDist(_cpConstraints.front())); } void PhysicsJointDistance::setDistance(float distance) { - AX_PJOINT_CACHE_WRITE(_distance, cpPinJointSetDist, distance); + CC_PJOINT_CACHE_WRITE(_distance, cpPinJointSetDist, distance); } PhysicsJointSpring* PhysicsJointSpring::construct(PhysicsBody* a, @@ -498,7 +498,7 @@ PhysicsJointSpring* PhysicsJointSpring::construct(PhysicsBody* a, return joint; } - AX_SAFE_DELETE(joint); + CC_SAFE_DELETE(joint); return nullptr; } @@ -511,7 +511,7 @@ bool PhysicsJointSpring::createConstraints() _bodyB->local2World(_anchr1).getDistance(_bodyA->local2World(_anchr2)), _stiffness, _damping); - AX_BREAK_IF(joint == nullptr); + CC_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -522,57 +522,57 @@ bool PhysicsJointSpring::createConstraints() Vec2 PhysicsJointSpring::getAnchr1() const { - AX_PJOINT_CACHE_READ(_anchr1); + CC_PJOINT_CACHE_READ(_anchr1); return PhysicsHelper::cpv2vec2(cpDampedSpringGetAnchorA(_cpConstraints.front())); } void PhysicsJointSpring::setAnchr1(const Vec2& anchr) { - AX_PJOINT_CACHE_WRITE2(_anchr1, cpDampedSpringSetAnchorA, anchr, PhysicsHelper::vec22cpv(anchr)); + CC_PJOINT_CACHE_WRITE2(_anchr1, cpDampedSpringSetAnchorA, anchr, PhysicsHelper::vec22cpv(anchr)); } Vec2 PhysicsJointSpring::getAnchr2() const { - AX_PJOINT_CACHE_READ(_anchr2); + CC_PJOINT_CACHE_READ(_anchr2); return PhysicsHelper::cpv2vec2(cpDampedSpringGetAnchorB(_cpConstraints.front())); } void PhysicsJointSpring::setAnchr2(const Vec2& anchr) { - AX_PJOINT_CACHE_WRITE2(_anchr2, cpDampedSpringSetAnchorB, anchr, PhysicsHelper::vec22cpv(anchr)); + CC_PJOINT_CACHE_WRITE2(_anchr2, cpDampedSpringSetAnchorB, anchr, PhysicsHelper::vec22cpv(anchr)); } float PhysicsJointSpring::getRestLength() const { - AX_PJOINT_CACHE_READ(_restLength); + CC_PJOINT_CACHE_READ(_restLength); return PhysicsHelper::cpfloat2float(cpDampedSpringGetRestLength(_cpConstraints.front())); } void PhysicsJointSpring::setRestLength(float restLength) { - AX_PJOINT_CACHE_WRITE(_restLength, cpDampedSpringSetRestLength, restLength); + CC_PJOINT_CACHE_WRITE(_restLength, cpDampedSpringSetRestLength, restLength); } float PhysicsJointSpring::getStiffness() const { - AX_PJOINT_CACHE_READ(_stiffness); + CC_PJOINT_CACHE_READ(_stiffness); return PhysicsHelper::cpfloat2float(cpDampedSpringGetStiffness(_cpConstraints.front())); } void PhysicsJointSpring::setStiffness(float stiffness) { - AX_PJOINT_CACHE_WRITE(_stiffness, cpDampedSpringSetStiffness, stiffness); + CC_PJOINT_CACHE_WRITE(_stiffness, cpDampedSpringSetStiffness, stiffness); } float PhysicsJointSpring::getDamping() const { - AX_PJOINT_CACHE_READ(_damping); + CC_PJOINT_CACHE_READ(_damping); return PhysicsHelper::cpfloat2float(cpDampedSpringGetDamping(_cpConstraints.front())); } void PhysicsJointSpring::setDamping(float damping) { - AX_PJOINT_CACHE_WRITE(_damping, cpDampedSpringSetDamping, damping); + CC_PJOINT_CACHE_WRITE(_damping, cpDampedSpringSetDamping, damping); } PhysicsJointGroove* PhysicsJointGroove::construct(PhysicsBody* a, @@ -592,7 +592,7 @@ PhysicsJointGroove* PhysicsJointGroove::construct(PhysicsBody* a, return joint; } - AX_SAFE_DELETE(joint); + CC_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)); - AX_BREAK_IF(joint == nullptr); + CC_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -614,35 +614,35 @@ bool PhysicsJointGroove::createConstraints() Vec2 PhysicsJointGroove::getGrooveA() const { - AX_PJOINT_CACHE_READ(_grooveA); + CC_PJOINT_CACHE_READ(_grooveA); return PhysicsHelper::cpv2vec2(cpGrooveJointGetGrooveA(_cpConstraints.front())); } void PhysicsJointGroove::setGrooveA(const Vec2& grooveA) { - AX_PJOINT_CACHE_WRITE2(_grooveA, cpGrooveJointSetGrooveA, grooveA, PhysicsHelper::vec22cpv(grooveA)); + CC_PJOINT_CACHE_WRITE2(_grooveA, cpGrooveJointSetGrooveA, grooveA, PhysicsHelper::vec22cpv(grooveA)); } Vec2 PhysicsJointGroove::getGrooveB() const { - AX_PJOINT_CACHE_READ(_grooveB); + CC_PJOINT_CACHE_READ(_grooveB); return PhysicsHelper::cpv2vec2(cpGrooveJointGetGrooveB(_cpConstraints.front())); } void PhysicsJointGroove::setGrooveB(const Vec2& grooveB) { - AX_PJOINT_CACHE_WRITE2(_grooveB, cpGrooveJointSetGrooveB, grooveB, PhysicsHelper::vec22cpv(grooveB)); + CC_PJOINT_CACHE_WRITE2(_grooveB, cpGrooveJointSetGrooveB, grooveB, PhysicsHelper::vec22cpv(grooveB)); } Vec2 PhysicsJointGroove::getAnchr2() const { - AX_PJOINT_CACHE_READ(_anchr2); + CC_PJOINT_CACHE_READ(_anchr2); return PhysicsHelper::cpv2vec2(cpGrooveJointGetAnchorB(_cpConstraints.front())); } void PhysicsJointGroove::setAnchr2(const Vec2& anchr2) { - AX_PJOINT_CACHE_WRITE2(_anchr2, cpGrooveJointSetAnchorB, anchr2, PhysicsHelper::vec22cpv(anchr2)); + CC_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; } - AX_SAFE_DELETE(joint); + CC_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); - AX_BREAK_IF(joint == nullptr); + CC_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -682,35 +682,35 @@ bool PhysicsJointRotarySpring::createConstraints() float PhysicsJointRotarySpring::getRestAngle() const { - AX_PJOINT_CACHE_READ(_restAngle); + CC_PJOINT_CACHE_READ(_restAngle); return PhysicsHelper::cpfloat2float(cpDampedRotarySpringGetRestAngle(_cpConstraints.front())); } void PhysicsJointRotarySpring::setRestAngle(float restAngle) { - AX_PJOINT_CACHE_WRITE(_restAngle, cpDampedRotarySpringSetRestAngle, restAngle); + CC_PJOINT_CACHE_WRITE(_restAngle, cpDampedRotarySpringSetRestAngle, restAngle); } float PhysicsJointRotarySpring::getStiffness() const { - AX_PJOINT_CACHE_READ(_stiffness); + CC_PJOINT_CACHE_READ(_stiffness); return PhysicsHelper::cpfloat2float(cpDampedRotarySpringGetStiffness(_cpConstraints.front())); } void PhysicsJointRotarySpring::setStiffness(float stiffness) { - AX_PJOINT_CACHE_WRITE(_stiffness, cpDampedRotarySpringSetStiffness, stiffness); + CC_PJOINT_CACHE_WRITE(_stiffness, cpDampedRotarySpringSetStiffness, stiffness); } float PhysicsJointRotarySpring::getDamping() const { - AX_PJOINT_CACHE_READ(_damping); + CC_PJOINT_CACHE_READ(_damping); return PhysicsHelper::cpfloat2float(cpDampedRotarySpringGetDamping(_cpConstraints.front())); } void PhysicsJointRotarySpring::setDamping(float damping) { - AX_PJOINT_CACHE_WRITE(_damping, cpDampedRotarySpringSetDamping, damping); + CC_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; } - AX_SAFE_DELETE(joint); + CC_SAFE_DELETE(joint); return nullptr; } @@ -740,7 +740,7 @@ bool PhysicsJointRotaryLimit::createConstraints() { auto joint = cpRotaryLimitJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _min, _max); - AX_BREAK_IF(joint == nullptr); + CC_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -751,24 +751,24 @@ bool PhysicsJointRotaryLimit::createConstraints() float PhysicsJointRotaryLimit::getMin() const { - AX_PJOINT_CACHE_READ(_min); + CC_PJOINT_CACHE_READ(_min); return PhysicsHelper::cpfloat2float(cpRotaryLimitJointGetMin(_cpConstraints.front())); } void PhysicsJointRotaryLimit::setMin(float min) { - AX_PJOINT_CACHE_WRITE(_min, cpRotaryLimitJointSetMin, min); + CC_PJOINT_CACHE_WRITE(_min, cpRotaryLimitJointSetMin, min); } float PhysicsJointRotaryLimit::getMax() const { - AX_PJOINT_CACHE_READ(_max); + CC_PJOINT_CACHE_READ(_max); return PhysicsHelper::cpfloat2float(cpRotaryLimitJointGetMax(_cpConstraints.front())); } void PhysicsJointRotaryLimit::setMax(float max) { - AX_PJOINT_CACHE_WRITE(_max, cpRotaryLimitJointSetMax, max); + CC_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; } - AX_SAFE_DELETE(joint); + CC_SAFE_DELETE(joint); return nullptr; } @@ -794,7 +794,7 @@ bool PhysicsJointRatchet::createConstraints() auto joint = cpRatchetJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _phase, PhysicsHelper::cpfloat2float(_ratchet)); - AX_BREAK_IF(joint == nullptr); + CC_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -805,35 +805,35 @@ bool PhysicsJointRatchet::createConstraints() float PhysicsJointRatchet::getAngle() const { - AX_PJOINT_CACHE_READ(_angle); + CC_PJOINT_CACHE_READ(_angle); return PhysicsHelper::cpfloat2float(cpRatchetJointGetAngle(_cpConstraints.front())); } void PhysicsJointRatchet::setAngle(float angle) { - AX_PJOINT_CACHE_WRITE(_angle, cpRatchetJointSetAngle, angle); + CC_PJOINT_CACHE_WRITE(_angle, cpRatchetJointSetAngle, angle); } float PhysicsJointRatchet::getPhase() const { - AX_PJOINT_CACHE_READ(_phase); + CC_PJOINT_CACHE_READ(_phase); return PhysicsHelper::cpfloat2float(cpRatchetJointGetPhase(_cpConstraints.front())); } void PhysicsJointRatchet::setPhase(float phase) { - AX_PJOINT_CACHE_WRITE(_phase, cpRatchetJointSetPhase, phase); + CC_PJOINT_CACHE_WRITE(_phase, cpRatchetJointSetPhase, phase); } float PhysicsJointRatchet::getRatchet() const { - AX_PJOINT_CACHE_READ(_ratchet); + CC_PJOINT_CACHE_READ(_ratchet); return PhysicsHelper::cpfloat2float(cpRatchetJointGetRatchet(_cpConstraints.front())); } void PhysicsJointRatchet::setRatchet(float ratchet) { - AX_PJOINT_CACHE_WRITE(_ratchet, cpRatchetJointSetRatchet, ratchet); + CC_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; } - AX_SAFE_DELETE(joint); + CC_SAFE_DELETE(joint); return nullptr; } @@ -858,7 +858,7 @@ bool PhysicsJointGear::createConstraints() { auto joint = cpGearJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _phase, _ratio); - AX_BREAK_IF(joint == nullptr); + CC_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -869,24 +869,24 @@ bool PhysicsJointGear::createConstraints() float PhysicsJointGear::getPhase() const { - AX_PJOINT_CACHE_READ(_phase); + CC_PJOINT_CACHE_READ(_phase); return PhysicsHelper::cpfloat2float(cpGearJointGetPhase(_cpConstraints.front())); } void PhysicsJointGear::setPhase(float phase) { - AX_PJOINT_CACHE_WRITE(_phase, cpGearJointSetPhase, phase); + CC_PJOINT_CACHE_WRITE(_phase, cpGearJointSetPhase, phase); } float PhysicsJointGear::getRatio() const { - AX_PJOINT_CACHE_READ(_ratio); + CC_PJOINT_CACHE_READ(_ratio); return PhysicsHelper::cpfloat2float(cpGearJointGetRatio(_cpConstraints.front())); } void PhysicsJointGear::setRatio(float ratio) { - AX_PJOINT_CACHE_WRITE(_ratio, cpGearJointSetRatio, ratio); + CC_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; } - AX_SAFE_DELETE(joint); + CC_SAFE_DELETE(joint); return nullptr; } @@ -910,7 +910,7 @@ bool PhysicsJointMotor::createConstraints() { auto joint = cpSimpleMotorNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _rate); - AX_BREAK_IF(joint == nullptr); + CC_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -921,14 +921,14 @@ bool PhysicsJointMotor::createConstraints() float PhysicsJointMotor::getRate() const { - AX_PJOINT_CACHE_READ(_rate); + CC_PJOINT_CACHE_READ(_rate); return PhysicsHelper::cpfloat2float(cpSimpleMotorGetRate(_cpConstraints.front())); } void PhysicsJointMotor::setRate(float rate) { - AX_PJOINT_CACHE_WRITE(_rate, cpSimpleMotorSetRate, rate); + CC_PJOINT_CACHE_WRITE(_rate, cpSimpleMotorSetRate, rate); } NS_AX_END -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS diff --git a/core/physics/CCPhysicsJoint.h b/core/physics/CCPhysicsJoint.h index 459b3c0ca1..55d54c07dd 100644 --- a/core/physics/CCPhysicsJoint.h +++ b/core/physics/CCPhysicsJoint.h @@ -29,7 +29,7 @@ #include #include "base/ccConfig.h" -#if AX_USE_PHYSICS +#if CC_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 AX_DLL PhysicsJoint +class CC_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 AX_DLL PhysicsJointFixed : public PhysicsJoint +class CC_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 AX_DLL PhysicsJointLimit : public PhysicsJoint +class CC_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 AX_DLL PhysicsJointPin : public PhysicsJoint +class CC_DLL PhysicsJointPin : public PhysicsJoint { public: /** Create a pin joint. @@ -270,7 +270,7 @@ protected: }; /** Set the fixed distance with two bodies */ -class AX_DLL PhysicsJointDistance : public PhysicsJoint +class CC_DLL PhysicsJointDistance : public PhysicsJoint { public: /** Create a fixed distance joint. @@ -298,7 +298,7 @@ protected: }; /** Connecting two physics bodies together with a spring. */ -class AX_DLL PhysicsJointSpring : public PhysicsJoint +class CC_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 AX_DLL PhysicsJointGroove : public PhysicsJoint +class CC_DLL PhysicsJointGroove : public PhysicsJoint { public: /** Create a groove joint. @@ -409,7 +409,7 @@ protected: }; /** Likes a spring joint, but works with rotary. */ -class AX_DLL PhysicsJointRotarySpring : public PhysicsJoint +class CC_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 AX_DLL PhysicsJointRotaryLimit : public PhysicsJoint +class CC_DLL PhysicsJointRotaryLimit : public PhysicsJoint { public: /** Create a limit rotary joint. @@ -495,7 +495,7 @@ protected: }; /** Works like a socket wrench. */ -class AX_DLL PhysicsJointRatchet : public PhysicsJoint +class CC_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 AX_DLL PhysicsJointGear : public PhysicsJoint +class CC_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 AX_DLL PhysicsJointMotor : public PhysicsJoint +class CC_DLL PhysicsJointMotor : public PhysicsJoint { public: /** Create a motor joint. @@ -603,5 +603,5 @@ protected: NS_AX_END -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS #endif // __CCPHYSICS_JOINT_H__ diff --git a/core/physics/CCPhysicsShape.cpp b/core/physics/CCPhysicsShape.cpp index 79f4039abe..607fa2074a 100644 --- a/core/physics/CCPhysicsShape.cpp +++ b/core/physics/CCPhysicsShape.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "physics/CCPhysicsShape.h" -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS # include # include @@ -288,7 +288,7 @@ PhysicsShapeCircle* PhysicsShapeCircle::create(float radius, return shape; } - AX_SAFE_DELETE(shape); + CC_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)); - AX_BREAK_IF(shape == nullptr); + CC_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); @@ -380,7 +380,7 @@ PhysicsShapeEdgeSegment* PhysicsShapeEdgeSegment::create(const Vec2& a, return shape; } - AX_SAFE_DELETE(shape); + CC_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); - AX_BREAK_IF(shape == nullptr); + CC_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); @@ -457,7 +457,7 @@ PhysicsShapeBox* PhysicsShapeBox::create(const Vec2& size, return shape; } - AX_SAFE_DELETE(shape); + CC_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); - AX_BREAK_IF(shape == nullptr); + CC_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); @@ -517,7 +517,7 @@ PhysicsShapePolygon* PhysicsShapePolygon::create(const Vec2* points, return shape; } - AX_SAFE_DELETE(shape); + CC_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); - AX_SAFE_DELETE_ARRAY(vecs); + CC_SAFE_DELETE_ARRAY(vecs); - AX_BREAK_IF(shape == nullptr); + CC_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)); - AX_SAFE_DELETE_ARRAY(vecs); + CC_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)); - AX_SAFE_DELETE_ARRAY(vecs); + CC_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))); - AX_SAFE_DELETE_ARRAY(vecs); + CC_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))); - AX_SAFE_DELETE_ARRAY(vecs); + CC_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); - AX_SAFE_DELETE_ARRAY(vecs); + CC_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)); - AX_SAFE_DELETE_ARRAY(vecs); + CC_SAFE_DELETE_ARRAY(vecs); return center; } @@ -674,7 +674,7 @@ void PhysicsShapePolygon::updateScale() } cpPolyShapeSetVertsRaw(shape, count, vects); - AX_SAFE_DELETE_ARRAY(vects); + CC_SAFE_DELETE_ARRAY(vects); PhysicsShape::updateScale(); } @@ -692,7 +692,7 @@ PhysicsShapeEdgeBox* PhysicsShapeEdgeBox::create(const Vec2& size, return shape; } - AX_SAFE_DELETE(shape); + CC_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); - AX_BREAK_IF(shape == nullptr); + CC_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); } - AX_BREAK_IF(i < 4); + CC_BREAK_IF(i < 4); _mass = PHYSICS_INFINITY; _moment = PHYSICS_INFINITY; @@ -745,7 +745,7 @@ PhysicsShapeEdgePolygon* PhysicsShapeEdgePolygon::create(const Vec2* points, return shape; } - AX_SAFE_DELETE(shape); + CC_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); - AX_BREAK_IF(shape == nullptr); + CC_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); cpShapeSetElasticity(shape, 1.0f); cpShapeSetFriction(shape, 1.0f); addShape(shape); } - AX_SAFE_DELETE_ARRAY(vec); + CC_SAFE_DELETE_ARRAY(vec); - AX_BREAK_IF(i < count); + CC_BREAK_IF(i < count); _mass = PHYSICS_INFINITY; _moment = PHYSICS_INFINITY; @@ -784,7 +784,7 @@ bool PhysicsShapeEdgePolygon::init(const Vec2* points, return true; } while (false); - AX_SAFE_DELETE_ARRAY(vec); + CC_SAFE_DELETE_ARRAY(vec); return false; } @@ -832,7 +832,7 @@ PhysicsShapeEdgeChain* PhysicsShapeEdgeChain::create(const Vec2* points, return shape; } - AX_SAFE_DELETE(shape); + CC_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); - AX_BREAK_IF(shape == nullptr); + CC_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); cpShapeSetElasticity(shape, 1.0f); cpShapeSetFriction(shape, 1.0f); addShape(shape); } - AX_SAFE_DELETE_ARRAY(vec); - AX_BREAK_IF(i < count - 1); + CC_SAFE_DELETE_ARRAY(vec); + CC_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); - AX_SAFE_DELETE_ARRAY(vec); + CC_SAFE_DELETE_ARRAY(vec); return false; } @@ -975,4 +975,4 @@ bool PhysicsShape::containsPoint(const Vec2& point) const NS_AX_END -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS diff --git a/core/physics/CCPhysicsShape.h b/core/physics/CCPhysicsShape.h index 6819123b00..dba8bcb012 100644 --- a/core/physics/CCPhysicsShape.h +++ b/core/physics/CCPhysicsShape.h @@ -28,7 +28,7 @@ #define __CCPHYSICS_SHAPE_H__ #include "base/ccConfig.h" -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS # include "base/CCRef.h" # include "math/CCMath.h" @@ -39,7 +39,7 @@ NS_AX_BEGIN class PhysicsBody; -typedef struct AX_DLL PhysicsMaterial +typedef struct CC_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 AX_DLL PhysicsShape : public Ref +class CC_DLL PhysicsShape : public Ref { public: enum class Type @@ -383,7 +383,7 @@ protected: }; /** A circle shape. */ -class AX_DLL PhysicsShapeCircle : public PhysicsShape +class CC_DLL PhysicsShapeCircle : public PhysicsShape { public: /** @@ -450,7 +450,7 @@ protected: }; /** A polygon shape. */ -class AX_DLL PhysicsShapePolygon : public PhysicsShape +class CC_DLL PhysicsShapePolygon : public PhysicsShape { public: /** @@ -543,7 +543,7 @@ protected: }; /** A box shape. */ -class AX_DLL PhysicsShapeBox : public PhysicsShapePolygon +class CC_DLL PhysicsShapeBox : public PhysicsShapePolygon { public: /** @@ -585,7 +585,7 @@ protected: }; /** A segment shape. */ -class AX_DLL PhysicsShapeEdgeSegment : public PhysicsShape +class CC_DLL PhysicsShapeEdgeSegment : public PhysicsShape { public: /** @@ -638,7 +638,7 @@ protected: }; /** An edge polygon shape. */ -class AX_DLL PhysicsShapeEdgePolygon : public PhysicsShape +class CC_DLL PhysicsShapeEdgePolygon : public PhysicsShape { public: /** @@ -691,7 +691,7 @@ protected: }; /** An edge box shape. */ -class AX_DLL PhysicsShapeEdgeBox : public PhysicsShapeEdgePolygon +class CC_DLL PhysicsShapeEdgeBox : public PhysicsShapeEdgePolygon { public: /** @@ -729,7 +729,7 @@ protected: }; /** A chain shape. */ -class AX_DLL PhysicsShapeEdgeChain : public PhysicsShape +class CC_DLL PhysicsShapeEdgeChain : public PhysicsShape { public: /** @@ -786,5 +786,5 @@ protected: NS_AX_END -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS #endif // __CCPHYSICS_FIXTURE_H__ diff --git a/core/physics/CCPhysicsWorld.cpp b/core/physics/CCPhysicsWorld.cpp index db59f92dfe..5048072c6b 100644 --- a/core/physics/CCPhysicsWorld.cpp +++ b/core/physics/CCPhysicsWorld.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "physics/CCPhysicsWorld.h" -#if AX_USE_PHYSICS +#if CC_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)); - AX_ASSERT(shapeA != nullptr && shapeB != nullptr); + CC_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)); - AX_ASSERT(physicsShape != nullptr); + CC_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)); - AX_ASSERT(physicsShape != nullptr); + CC_ASSERT(physicsShape != nullptr); if (!PhysicsWorldCallback::continues) { @@ -189,7 +189,7 @@ void PhysicsWorldCallback::getShapesAtPointFunc(cpShape* shape, Vector* arr) { PhysicsShape* physicsShape = static_cast(cpShapeGetUserData(shape)); - AX_ASSERT(physicsShape != nullptr); + CC_ASSERT(physicsShape != nullptr); arr->pushBack(physicsShape); } @@ -200,7 +200,7 @@ void PhysicsWorldCallback::queryPointFunc(cpShape* shape, PointQueryCallbackInfo* info) { PhysicsShape* physicsShape = static_cast(cpShapeGetUserData(shape)); - AX_ASSERT(physicsShape != nullptr); + CC_ASSERT(physicsShape != nullptr); PhysicsWorldCallback::continues = info->func(*info->world, *physicsShape, info->data); } @@ -518,13 +518,13 @@ bool PhysicsWorld::init() { do { -# if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +# if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 _cpSpace = cpSpaceNew(); # else _cpSpace = cpHastySpaceNew(); cpHastySpaceSetThreads(_cpSpace, 0); # endif - AX_BREAK_IF(_cpSpace == nullptr); + CC_BREAK_IF(_cpSpace == nullptr); cpSpaceSetGravity(_cpSpace, PhysicsHelper::vec22cpv(_gravity)); @@ -652,7 +652,7 @@ void PhysicsWorld::removeBody(PhysicsBody* body) void PhysicsWorld::removeBodyOrDelay(PhysicsBody* body) { - if (_delayAddBodies.getIndex(body) != AX_INVALID_INDEX) + if (_delayAddBodies.getIndex(body) != CC_INVALID_INDEX) { _delayAddBodies.eraseObject(body); return; @@ -660,7 +660,7 @@ void PhysicsWorld::removeBodyOrDelay(PhysicsBody* body) if (cpSpaceIsLocked(_cpSpace)) { - if (_delayRemoveBodies.getIndex(body) == AX_INVALID_INDEX) + if (_delayRemoveBodies.getIndex(body) == CC_INVALID_INDEX) { _delayRemoveBodies.pushBack(body); } @@ -855,7 +855,7 @@ void PhysicsWorld::setDebugDrawMask(int mask) if (mask == DEBUGDRAW_NONE && _debugDraw) { _debugDraw->removeFromParent(); - AX_SAFE_RELEASE_NULL(_debugDraw); + CC_SAFE_RELEASE_NULL(_debugDraw); } _debugDrawMask = mask; @@ -939,7 +939,7 @@ void PhysicsWorld::update(float delta, bool userCall /* = false*/) if (userCall) { -# if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +# if CC_TARGET_PLATFORM == CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +# if CC_TARGET_PLATFORM == CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +# if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 cpSpaceStep(_cpSpace, dt); # else cpHastySpaceStep(_cpSpace, dt); @@ -1008,7 +1008,7 @@ PhysicsWorld* PhysicsWorld::construct(Scene* scene) return world; } - AX_SAFE_DELETE(world); + CC_SAFE_DELETE(world); return nullptr; } @@ -1035,13 +1035,13 @@ PhysicsWorld::~PhysicsWorld() removeAllBodies(); if (_cpSpace) { -# if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +# if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 cpSpaceFree(_cpSpace); # else cpHastySpaceFree(_cpSpace); # endif } - AX_SAFE_RELEASE_NULL(_debugDraw); + CC_SAFE_RELEASE_NULL(_debugDraw); } void PhysicsWorld::beforeSimulation(Node* node, @@ -1093,4 +1093,4 @@ void PhysicsWorld::setPreUpdateCallback(const std::function& callback) NS_AX_END -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS diff --git a/core/physics/CCPhysicsWorld.h b/core/physics/CCPhysicsWorld.h index df35cb6b9a..43c7b1e7d3 100644 --- a/core/physics/CCPhysicsWorld.h +++ b/core/physics/CCPhysicsWorld.h @@ -27,7 +27,7 @@ #define __CCPHYSICS_WORLD_H__ #include "base/ccConfig.h" -#if AX_USE_PHYSICS +#if CC_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 AX_DLL PhysicsWorld +class CC_DLL PhysicsWorld { public: static const int DEBUGDRAW_NONE; ///< draw nothing @@ -449,12 +449,12 @@ protected: friend class PhysicsDebugDraw; }; -extern const float AX_DLL PHYSICS_INFINITY; +extern const float CC_DLL PHYSICS_INFINITY; /** @} */ /** @} */ NS_AX_END -#endif // AX_USE_PHYSICS +#endif // CC_USE_PHYSICS #endif // __CCPHYSICS_WORLD_H__ diff --git a/core/physics3d/CCPhysics3D.cpp b/core/physics3d/CCPhysics3D.cpp index fcddebf429..2c6127d1dc 100644 --- a/core/physics3d/CCPhysics3D.cpp +++ b/core/physics3d/CCPhysics3D.cpp @@ -25,15 +25,15 @@ #include "physics3d/CCPhysics3D.h" -#if AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN -AX_DLL const char* physics3dVersion() +CC_DLL const char* physics3dVersion() { -# if AX_ENABLE_BULLET_INTEGRATION +# if CC_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 // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3D.h b/core/physics3d/CCPhysics3D.h index 23323ea307..5a0bb139ea 100644 --- a/core/physics3d/CCPhysics3D.h +++ b/core/physics3d/CCPhysics3D.h @@ -29,7 +29,7 @@ #include "base/ccConfig.h" #include "math/CCMath.h" -#if AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS # include "physics3d/CCPhysics3DShape.h" # include "physics3d/CCPhysicsMeshRenderer.h" @@ -41,11 +41,11 @@ NS_AX_BEGIN -AX_DLL const char* physics3dVersion(); +CC_DLL const char* physics3dVersion(); NS_AX_END -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_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 // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS #endif // __PHYSICS_3D_H__ diff --git a/core/physics3d/CCPhysics3DComponent.cpp b/core/physics3d/CCPhysics3DComponent.cpp index 96737d9135..f143cbfd7d 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 AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN Physics3DComponent::~Physics3DComponent() { - AX_SAFE_RELEASE(_physics3DObj); + CC_SAFE_RELEASE(_physics3DObj); } std::string& Physics3DComponent::getPhysics3DComponentName() @@ -62,14 +62,14 @@ Physics3DComponent* Physics3DComponent::create(Physics3DObject* physicsObj, ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } void Physics3DComponent::setPhysics3DObject(Physics3DObject* physicsObj) { - AX_SAFE_RETAIN(physicsObj); - AX_SAFE_RELEASE(_physics3DObj); + CC_SAFE_RETAIN(physicsObj); + CC_SAFE_RELEASE(_physics3DObj); _physics3DObj = physicsObj; } @@ -250,6 +250,6 @@ void Physics3DComponent::syncNodeToPhysics() NS_AX_END -# endif // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DComponent.h b/core/physics3d/CCPhysics3DComponent.h index b6c8c6f63e..95bd325612 100644 --- a/core/physics3d/CCPhysics3DComponent.h +++ b/core/physics3d/CCPhysics3DComponent.h @@ -31,9 +31,9 @@ #include "2d/CCComponent.h" -#if AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_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 AX_DLL Physics3DComponent : public axis::Component +class CC_DLL Physics3DComponent : public axis::Component { friend class Physics3DWorld; @@ -143,8 +143,8 @@ protected: /// @} NS_AX_END -# endif // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS #endif // __PHYSICS_3D_COMPONENT_H__ diff --git a/core/physics3d/CCPhysics3DConstraint.cpp b/core/physics3d/CCPhysics3DConstraint.cpp index 67f94ce3f1..ef0ff76172 100644 --- a/core/physics3d/CCPhysics3DConstraint.cpp +++ b/core/physics3d/CCPhysics3DConstraint.cpp @@ -25,9 +25,9 @@ #include "physics3d/CCPhysics3D.h" -#if AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -41,9 +41,9 @@ Physics3DConstraint::Physics3DConstraint() Physics3DConstraint::~Physics3DConstraint() { - AX_SAFE_RELEASE(_bodyA); - AX_SAFE_RELEASE(_bodyB); - AX_SAFE_DELETE(_constraint); + CC_SAFE_RELEASE(_bodyA); + CC_SAFE_RELEASE(_bodyB); + CC_SAFE_DELETE(_constraint); } float Physics3DConstraint::getBreakingImpulse() const @@ -89,7 +89,7 @@ Physics3DPointToPointConstraint* Physics3DPointToPointConstraint::create(Physics return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return ret; } @@ -105,7 +105,7 @@ Physics3DPointToPointConstraint* Physics3DPointToPointConstraint::create(Physics return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return ret; } @@ -880,6 +880,6 @@ void Physics3D6DofConstraint::setUseFrameOffset(bool frameOffsetOnOff) const NS_AX_END -# endif // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DConstraint.h b/core/physics3d/CCPhysics3DConstraint.h index 020bacc62f..72404c0bed 100644 --- a/core/physics3d/CCPhysics3DConstraint.h +++ b/core/physics3d/CCPhysics3DConstraint.h @@ -30,9 +30,9 @@ #include "base/CCRef.h" #include "base/ccConfig.h" -#if AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_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 AX_DLL Physics3DConstraint : public Ref +class CC_DLL Physics3DConstraint : public Ref { public: enum class ConstraintType @@ -115,7 +115,7 @@ public: */ void setOverrideNumSolverIterations(int overrideNumIterations); -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_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 AX_DLL Physics3DPointToPointConstraint : public Physics3DConstraint +class CC_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 AX_DLL Physics3DHingeConstraint : public Physics3DConstraint +class CC_DLL Physics3DHingeConstraint : public Physics3DConstraint { public: /** @@ -334,7 +334,7 @@ public: * LimAng - hitting angular limit * OrthoLin, OrthoAng - against constraint axis */ -class AX_DLL Physics3DSliderConstraint : public Physics3DConstraint +class CC_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 AX_DLL Physics3DConeTwistConstraint : public Physics3DConstraint +class CC_DLL Physics3DConeTwistConstraint : public Physics3DConstraint { public: /** @@ -544,7 +544,7 @@ public: * Lowerlimit > Upperlimit -> axis is free * Lowerlimit < Upperlimit -> axis it limited in that range */ -class AX_DLL Physics3D6DofConstraint : public Physics3DConstraint +class CC_DLL Physics3D6DofConstraint : public Physics3DConstraint { public: /** @@ -615,8 +615,8 @@ public: NS_AX_END -# endif // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS #endif // __PHYSICS_3D_CONSTRAINT_H__ diff --git a/core/physics3d/CCPhysics3DDebugDrawer.cpp b/core/physics3d/CCPhysics3DDebugDrawer.cpp index 926e1c27aa..1f9f336742 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 AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -110,7 +110,7 @@ void Physics3DDebugDrawer::draw(Renderer* renderer) _customCommand.setVertexDrawInfo(0, _buffer.size()); - AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _buffer.size()); + CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _buffer.size()); renderer->addCommand(&_customCommand); } @@ -122,12 +122,12 @@ Physics3DDebugDrawer::Physics3DDebugDrawer() Physics3DDebugDrawer::~Physics3DDebugDrawer() { - AX_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_programState); } void Physics3DDebugDrawer::init() { - AX_SAFE_RELEASE_NULL(_programState); + CC_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(AX_CALLBACK_0(Physics3DDebugDrawer::onBeforeDraw, this)); - _customCommand.setAfterCallback(AX_CALLBACK_0(Physics3DDebugDrawer::onAfterDraw, this)); + _customCommand.setBeforeCallback(CC_CALLBACK_0(Physics3DDebugDrawer::onBeforeDraw, this)); + _customCommand.setAfterCallback(CC_CALLBACK_0(Physics3DDebugDrawer::onAfterDraw, this)); } void Physics3DDebugDrawer::onBeforeDraw() @@ -172,6 +172,6 @@ void Physics3DDebugDrawer::clear() NS_AX_END -# endif // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DDebugDrawer.h b/core/physics3d/CCPhysics3DDebugDrawer.h index 8587b20a25..69ad88b7e0 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 AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_ENABLE_BULLET_INTEGRATION) # include "bullet/LinearMath/btIDebugDraw.h" NS_AX_BEGIN @@ -102,8 +102,8 @@ private: NS_AX_END -# endif // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS #endif // __PHYSICS_3D_VIEWER_H__ diff --git a/core/physics3d/CCPhysics3DObject.cpp b/core/physics3d/CCPhysics3DObject.cpp index 81ae7c3214..366ffd4647 100644 --- a/core/physics3d/CCPhysics3DObject.cpp +++ b/core/physics3d/CCPhysics3DObject.cpp @@ -26,9 +26,9 @@ #include "physics3d/CCPhysics3D.h" #include "base/ccUTF8.h" -#if AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_ENABLE_BULLET_INTEGRATION) # include "bullet/btBulletCollisionCommon.h" # include "bullet/btBulletDynamicsCommon.h" @@ -48,9 +48,9 @@ Physics3DRigidBody::~Physics3DRigidBody() _constraintList.clear(); } auto ms = _btRigidBody->getMotionState(); - AX_SAFE_DELETE(ms); - AX_SAFE_DELETE(_btRigidBody); - AX_SAFE_RELEASE(_physics3DShape); + CC_SAFE_DELETE(ms); + CC_SAFE_DELETE(_btRigidBody); + CC_SAFE_RELEASE(_physics3DShape); } Physics3DRigidBody* Physics3DRigidBody::create(Physics3DRigidBodyDes* info) @@ -62,7 +62,7 @@ Physics3DRigidBody* Physics3DRigidBody::create(Physics3DRigidBodyDes* info) return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return ret; } @@ -436,8 +436,8 @@ Physics3DCollider::Physics3DCollider() : _btGhostObject(nullptr), _physics3DShap Physics3DCollider::~Physics3DCollider() { - AX_SAFE_DELETE(_btGhostObject); - AX_SAFE_RELEASE(_physics3DShape); + CC_SAFE_DELETE(_btGhostObject); + CC_SAFE_RELEASE(_physics3DShape); } Physics3DCollider* Physics3DCollider::create(Physics3DColliderDes* info) @@ -449,7 +449,7 @@ Physics3DCollider* Physics3DCollider::create(Physics3DColliderDes* info) return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return ret; } @@ -551,6 +551,6 @@ axis::Mat4 Physics3DCollider::getWorldTransform() const NS_AX_END -# endif // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DObject.h b/core/physics3d/CCPhysics3DObject.h index eb4ec27c05..a929fba0b9 100644 --- a/core/physics3d/CCPhysics3DObject.h +++ b/core/physics3d/CCPhysics3DObject.h @@ -32,9 +32,9 @@ #include -#if AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_ENABLE_BULLET_INTEGRATION) class btCollisionShape; class btRigidBody; @@ -54,7 +54,7 @@ class Physics3DObject; /** * @brief The collision information of Physics3DObject. */ -struct AX_DLL Physics3DCollisionInfo +struct CC_DLL Physics3DCollisionInfo { struct CollisionPoint { @@ -72,7 +72,7 @@ struct AX_DLL Physics3DCollisionInfo /** * @brief Inherit from Ref, base class */ -class AX_DLL Physics3DObject : public Ref +class CC_DLL Physics3DObject : public Ref { public: typedef std::function CollisionCallbackFunc; @@ -134,7 +134,7 @@ protected: /** * @brief The description of Physics3DRigidBody. */ -struct AX_DLL Physics3DRigidBodyDes +struct CC_DLL Physics3DRigidBodyDes { float mass; // Note: mass equals zero means static, default 0 axis::Vec3 localInertia; // default (0, 0, 0) @@ -148,7 +148,7 @@ struct AX_DLL Physics3DRigidBodyDes /** * @brief Inherit from Physics3DObject, the main class for rigid body objects */ -class AX_DLL Physics3DRigidBody : public Physics3DObject +class CC_DLL Physics3DRigidBody : public Physics3DObject { friend class Physics3DWorld; @@ -349,7 +349,7 @@ protected: /** * @brief The description of Physics3DCollider. */ -struct AX_DLL Physics3DColliderDes +struct CC_DLL Physics3DColliderDes { /**shape pointer*/ Physics3DShape* shape; @@ -385,7 +385,7 @@ struct AX_DLL Physics3DColliderDes /** * @brief Inherit from Physics3DObject, the main class for Colliders. */ -class AX_DLL Physics3DCollider : public Physics3DObject +class CC_DLL Physics3DCollider : public Physics3DObject { public: /** @@ -495,8 +495,8 @@ protected: NS_AX_END -# endif // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS #endif // __PHYSICS_3D_OBJECT_H__ diff --git a/core/physics3d/CCPhysics3DShape.cpp b/core/physics3d/CCPhysics3DShape.cpp index 10eed4ac3e..cef34c3717 100644 --- a/core/physics3d/CCPhysics3DShape.cpp +++ b/core/physics3d/CCPhysics3DShape.cpp @@ -25,9 +25,9 @@ #include "physics3d/CCPhysics3D.h" -#if AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_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 (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_ENABLE_BULLET_INTEGRATION) _btShape = nullptr; _heightfieldData = nullptr; # endif } Physics3DShape::~Physics3DShape() { -# if (AX_ENABLE_BULLET_INTEGRATION) - AX_SAFE_DELETE(_btShape); - AX_SAFE_DELETE_ARRAY(_heightfieldData); +# if (CC_ENABLE_BULLET_INTEGRATION) + CC_SAFE_DELETE(_btShape); + CC_SAFE_DELETE_ARRAY(_heightfieldData); for (auto iter : _compoundChildShapes) { - AX_SAFE_RELEASE(iter); + CC_SAFE_RELEASE(iter); } _compoundChildShapes.clear(); # endif @@ -209,7 +209,7 @@ bool Physics3DShape::initCompoundShape(const std::vectoraddChildShape(convertMat4TobtTransform(iter.second), iter.first->getbtShape()); - AX_SAFE_RETAIN(iter.first); + CC_SAFE_RETAIN(iter.first); _compoundChildShapes.push_back(iter.first); } _btShape = compound; @@ -218,6 +218,6 @@ bool Physics3DShape::initCompoundShape(const std::vector>& shapes); -# if AX_ENABLE_BULLET_INTEGRATION +# if CC_ENABLE_BULLET_INTEGRATION btCollisionShape* getbtShape() const { return _btShape; } # endif @@ -158,7 +158,7 @@ public: protected: ShapeType _shapeType; // shape type -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_ENABLE_BULLET_INTEGRATION) btCollisionShape* _btShape; unsigned char* _heightfieldData; std::vector _compoundChildShapes; @@ -170,8 +170,8 @@ protected: NS_AX_END -# endif // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS #endif // __PHYSICS_3D_SHAPE_H__ diff --git a/core/physics3d/CCPhysics3DWorld.cpp b/core/physics3d/CCPhysics3DWorld.cpp index 1ccffe709d..c0b1911730 100644 --- a/core/physics3d/CCPhysics3DWorld.cpp +++ b/core/physics3d/CCPhysics3DWorld.cpp @@ -26,9 +26,9 @@ #include "physics3d/CCPhysics3D.h" #include "renderer/CCRenderer.h" -#if AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -49,13 +49,13 @@ Physics3DWorld::~Physics3DWorld() removeAllPhysics3DConstraints(); removeAllPhysics3DObjects(); - 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); + 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); 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) { - AX_ASSERT(shape->getShapeType() != Physics3DShape::ShapeType::HEIGHT_FIELD && + CC_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 // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DWorld.h b/core/physics3d/CCPhysics3DWorld.h index 47fb72521d..542e2c0186 100644 --- a/core/physics3d/CCPhysics3DWorld.h +++ b/core/physics3d/CCPhysics3DWorld.h @@ -30,9 +30,9 @@ #include "base/CCRef.h" #include "base/ccConfig.h" -#if AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_ENABLE_BULLET_INTEGRATION) class btDynamicsWorld; class btDefaultCollisionConfiguration; @@ -59,7 +59,7 @@ class Renderer; /** * @brief The description of Physics3DWorld. */ -struct AX_DLL Physics3DWorldDes +struct CC_DLL Physics3DWorldDes { bool isDebugDrawEnabled; // using physics debug draw?, false by default axis::Vec3 gravity; // gravity, (0, -9.8, 0) @@ -74,7 +74,7 @@ struct AX_DLL Physics3DWorldDes * @brief The physics information container, include Physics3DObjects, Physics3DConstraints, collision information and * so on. */ -class AX_DLL Physics3DWorld : public Ref +class CC_DLL Physics3DWorld : public Ref { friend class Physics3DComponent; @@ -167,7 +167,7 @@ protected: bool _collisionCheckingFlag; bool _needGhostPairCallbackChecking; -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_ENABLE_BULLET_INTEGRATION) btDynamicsWorld* _btPhyiscsWorld; btDefaultCollisionConfiguration* _collisionConfiguration; btCollisionDispatcher* _dispatcher; @@ -175,7 +175,7 @@ protected: btSequentialImpulseConstraintSolver* _solver; btGhostPairCallback* _ghostCallback; Physics3DDebugDrawer* _debugDrawer; -# endif // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION }; // end of 3d group @@ -184,6 +184,6 @@ NS_AX_END # endif -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS #endif // __PHYSICS_3D_WORLD_H__ diff --git a/core/physics3d/CCPhysicsMeshRenderer.cpp b/core/physics3d/CCPhysicsMeshRenderer.cpp index 3dcd41a611..5fdef7d474 100644 --- a/core/physics3d/CCPhysicsMeshRenderer.cpp +++ b/core/physics3d/CCPhysicsMeshRenderer.cpp @@ -25,9 +25,9 @@ #include "physics3d/CCPhysics3D.h" -#if AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -46,7 +46,7 @@ PhysicsMeshRenderer* PhysicsMeshRenderer::create(std::string_view modelPath, ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return ret; } @@ -65,7 +65,7 @@ PhysicsMeshRenderer* PhysicsMeshRenderer::createWithCollider(std::string_view mo ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return ret; } @@ -97,6 +97,6 @@ PhysicsMeshRenderer::~PhysicsMeshRenderer() {} NS_AX_END -# endif // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysicsMeshRenderer.h b/core/physics3d/CCPhysicsMeshRenderer.h index ef434b62f7..f0bfdb6a4e 100644 --- a/core/physics3d/CCPhysicsMeshRenderer.h +++ b/core/physics3d/CCPhysicsMeshRenderer.h @@ -31,9 +31,9 @@ #include "physics3d/CCPhysics3DObject.h" #include "physics3d/CCPhysics3DComponent.h" -#if AX_USE_3D_PHYSICS +#if CC_USE_3D_PHYSICS -# if (AX_ENABLE_BULLET_INTEGRATION) +# if (CC_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 AX_DLL PhysicsMeshRenderer : public axis::MeshRenderer +class CC_DLL PhysicsMeshRenderer : public axis::MeshRenderer { public: /** creates a PhysicsMeshRenderer */ @@ -82,8 +82,8 @@ protected: /// @} NS_AX_END -# endif // AX_ENABLE_BULLET_INTEGRATION +# endif // CC_ENABLE_BULLET_INTEGRATION -#endif // AX_USE_3D_PHYSICS +#endif // CC_USE_3D_PHYSICS #endif // __PHYSICS_MESH_RENDERER_H__ diff --git a/core/platform/CCApplication.h b/core/platform/CCApplication.h index 1d96165338..9ab3da2ece 100644 --- a/core/platform/CCApplication.h +++ b/core/platform/CCApplication.h @@ -30,15 +30,15 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if AX_TARGET_PLATFORM == AX_PLATFORM_MAC +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC # include "platform/mac/CCApplication-mac.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS # include "platform/ios/CCApplication-ios.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID # include "platform/android/CCApplication-android.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 # include "platform/win32/CCApplication-win32.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_LINUX +#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX # include "platform/linux/CCApplication-linux.h" #endif diff --git a/core/platform/CCApplicationProtocol.h b/core/platform/CCApplicationProtocol.h index 6da7553d62..35bbc95631 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 __AX_APPLICATION_PROTOCOL_H__ -#define __AX_APPLICATION_PROTOCOL_H__ +#ifndef __CC_APPLICATION_PROTOCOL_H__ +#define __CC_APPLICATION_PROTOCOL_H__ #include "platform/CCPlatformMacros.h" #include "base/CCAutoreleasePool.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN * @{ */ -class AX_DLL ApplicationProtocol +class CC_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 // __AX_APPLICATION_PROTOCOL_H__ +#endif // __CC_APPLICATION_PROTOCOL_H__ diff --git a/core/platform/CCCommon.h b/core/platform/CCCommon.h index 073f204e85..7a182cc8b7 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 __AX_COMMON_H__ -#define __AX_COMMON_H__ +#ifndef __CC_COMMON_H__ +#define __CC_COMMON_H__ /// @cond DO_NOT_SHOW #include "platform/CCPlatformMacros.h" @@ -40,12 +40,12 @@ NS_AX_BEGIN /** * lua can not deal with ... */ -void AX_DLL LuaLog(const char* format); +void CC_DLL LuaLog(const char* format); /** @brief Pop out a message box */ -void AX_DLL ccMessageBox(const char* msg, const char* title); +void CC_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 // __AX_COMMON_H__ +#endif // __CC_COMMON_H__ diff --git a/core/platform/CCDevice.h b/core/platform/CCDevice.h index c7c21d51df..0e24daee81 100644 --- a/core/platform/CCDevice.h +++ b/core/platform/CCDevice.h @@ -44,7 +44,7 @@ struct FontDefinition; * @class Device * @brief */ -class AX_DLL Device +class CC_DLL Device { public: /** Defines the alignment of text. */ @@ -104,7 +104,7 @@ public: bool& hasPremultipliedAlpha); private: - AX_DISALLOW_IMPLICIT_CONSTRUCTORS(Device); + CC_DISALLOW_IMPLICIT_CONSTRUCTORS(Device); }; // end group diff --git a/core/platform/CCFileStream.h b/core/platform/CCFileStream.h index 7e2996acec..9221a9b196 100644 --- a/core/platform/CCFileStream.h +++ b/core/platform/CCFileStream.h @@ -9,7 +9,7 @@ NS_AX_BEGIN -class AX_DLL FileStream +class CC_DLL FileStream { public: virtual ~FileStream() = default; diff --git a/core/platform/CCFileUtils.cpp b/core/platform/CCFileUtils.cpp index 813918be96..b497a1c83f 100644 --- a/core/platform/CCFileUtils.cpp +++ b/core/platform/CCFileUtils.cpp @@ -465,7 +465,7 @@ FileUtils* FileUtils::s_sharedFileUtils = nullptr; void FileUtils::destroyInstance() { - AX_SAFE_DELETE(s_sharedFileUtils); + CC_SAFE_DELETE(s_sharedFileUtils); } void FileUtils::setDelegate(FileUtils* delegate) @@ -519,7 +519,7 @@ bool FileUtils::writeBinaryToFile(const void* data, size_t dataSize, std::string { auto fileStream = fileUtils->openFileStream(fullPath, FileStream::Mode::WRITE); // Read the file from hardware - AX_BREAK_IF(!fileStream); + CC_BREAK_IF(!fileStream); fileStream->write(data, static_cast(dataSize)); return true; @@ -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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +# if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) +# if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) # include # endif @@ -1307,7 +1307,7 @@ bool FileUtils::createDirectory(std::string_view path) const namespace { -# if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) +# if (CC_TARGET_PLATFORM != CC_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(AX_TARGET_OS_TVOS) +# if !defined(CC_TARGET_OS_TVOS) -# if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) +# if (CC_TARGET_PLATFORM != CC_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 // (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) +# endif // (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) # else return false; -# endif // !defined(AX_TARGET_OS_TVOS) +# endif // !defined(CC_TARGET_OS_TVOS) } bool FileUtils::removeFile(std::string_view path) const diff --git a/core/platform/CCFileUtils.h b/core/platform/CCFileUtils.h index 9482b40d78..bf663662af 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 __AX_FILEUTILS_H__ -#define __AX_FILEUTILS_H__ +#ifndef __CC_FILEUTILS_H__ +#define __CC_FILEUTILS_H__ #include #include @@ -98,7 +98,7 @@ public: }; /** Helper class to handle file operations. */ -class AX_DLL FileUtils +class CC_DLL FileUtils { public: /** @@ -943,4 +943,4 @@ protected: NS_AX_END -#endif // __AX_FILEUTILS_H__ +#endif // __CC_FILEUTILS_H__ diff --git a/core/platform/CCGL.h b/core/platform/CCGL.h index 8e88c1dc2e..054c5c5ac2 100644 --- a/core/platform/CCGL.h +++ b/core/platform/CCGL.h @@ -31,17 +31,17 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID # include "platform/android/CCGL-android.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 # include "platform/win32/CCGL-win32.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_LINUX +#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX # include "platform/linux/CCGL-linux.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS # if AX_USE_COMPAT_GL # include "platform/ios/CCGL-ios.h" # endif -#elif AX_TARGET_PLATFORM == AX_PLATFORM_MAC +#elif CC_TARGET_PLATFORM == CC_PLATFORM_MAC # if AX_USE_COMPAT_GL # include "platform/mac/CCGL-mac.h" # endif diff --git a/core/platform/CCGLView.h b/core/platform/CCGLView.h index 88c57c9c01..edc6e2cf27 100644 --- a/core/platform/CCGLView.h +++ b/core/platform/CCGLView.h @@ -32,17 +32,17 @@ THE SOFTWARE. #include -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) # include -#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ +#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) typedef void* id; -#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) */ +#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) */ -#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) */ +#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) */ /** 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 AX_DLL GLView : public Ref +class CC_DLL GLView : public Ref { public: /** @@ -219,9 +219,9 @@ public: */ virtual bool isRetinaDisplay() const { return false; } -#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) virtual void* getEAGLView() const { return nullptr; } -#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) */ +#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */ /** * Get the visible area size of opengl viewport. @@ -416,14 +416,14 @@ public: */ ResolutionPolicy getResolutionPolicy() const { return _resolutionPolicy; } -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) virtual HWND getWin32Window() = 0; -#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ +#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) virtual id getCocoaWindow() = 0; virtual id getNSGLContext() = 0; // stevetranby: added -#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) */ +#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) */ /** * Renders a Scene with a Renderer diff --git a/core/platform/CCImage.cpp b/core/platform/CCImage.cpp index 208492a8a4..c47a0adb79 100644 --- a/core/platform/CCImage.cpp +++ b/core/platform/CCImage.cpp @@ -32,7 +32,7 @@ THE SOFTWARE. #include #include -#include "base/ccConfig.h" // AX_USE_JPEG, AX_USE_WEBP +#include "base/ccConfig.h" // CC_USE_JPEG, CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#if CC_TARGET_PLATFORM == CC_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) || (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if defined(__unix) || (CC_TARGET_PLATFORM == CC_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 AX_USE_PNG +#if CC_USE_PNG # include "png.h" -#endif // AX_USE_PNG +#endif // CC_USE_PNG -#if AX_USE_JPEG +#if CC_USE_JPEG # include "jpeglib.h" # include -#endif // AX_USE_JPEG +#endif // CC_USE_JPEG } /* extern "C" */ #include "base/ktxspec_v1.h" @@ -115,9 +115,9 @@ struct dirent* readdir$INODE64(DIR* dir) #include "base/astc.h" -#if AX_USE_WEBP +#if CC_USE_WEBP # include "decode.h" -#endif // AX_USE_WEBP +#endif // CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) # include "platform/android/CCFileUtils-android.h" # include "platform/CCGL.h" #endif @@ -422,7 +422,7 @@ typedef struct int offset; } tImageSource; -#if AX_USE_PNG +#if CC_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 // AX_USE_PNG +#endif // CC_USE_PNG } // namespace /* @@ -567,12 +567,12 @@ Image::~Image() { if (!_unpack) { - AX_SAFE_FREE(_data); + CC_SAFE_FREE(_data); } else { for (int i = 0; i < _numberOfMipmaps; ++i) - AX_SAFE_FREE(_mipmaps[i].address); + CC_SAFE_FREE(_mipmaps[i].address); } } @@ -621,7 +621,7 @@ bool Image::initWithImageData(uint8_t* data, ssize_t dataLen, bool ownData) do { - AX_BREAK_IF(!data || dataLen == 0); + CC_BREAK_IF(!data || dataLen == 0); uint8_t* unpackedData = nullptr; ssize_t unpackedLen = 0; @@ -719,7 +719,7 @@ bool Image::initWithRawData(const uint8_t* data, bool ret = false; do { - AX_BREAK_IF(0 == width || 0 == height); + CC_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)); - AX_BREAK_IF(!_data); + CC_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 || - AX_SWAP_INT32_BIG_TO_HOST(headerv3->version) == 0x50565203; + CC_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 AX_USE_JPEG +#if CC_USE_JPEG struct MyErrorMgr { struct jpeg_error_mgr pub; /* "public" fields */ @@ -955,12 +955,12 @@ myErrorExit(j_common_ptr cinfo) /* Return control to the setjmp point */ longjmp(myerr->setjmp_buffer, 1); } -#endif // AX_USE_JPEG +#endif // CC_USE_JPEG } // namespace bool Image::initWithJpgData(uint8_t* data, ssize_t dataLen) { -#if AX_USE_JPEG +#if CC_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 AX_TARGET_QT5 +# ifndef CC_TARGET_QT5 jpeg_mem_src(&cinfo, const_cast(data), dataLen); -# endif /* AX_TARGET_QT5 */ +# endif /* CC_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)); - AX_BREAK_IF(!_data); + CC_BREAK_IF(!_data); /* now actually read the jpeg into the raw buffer */ /* read one scan line at a time */ @@ -1049,12 +1049,12 @@ bool Image::initWithJpgData(uint8_t* data, ssize_t dataLen) #else CCLOG("jpeg is not enabled, please enable it in ccConfig.h"); return false; -#endif // AX_USE_JPEG +#endif // CC_USE_JPEG } bool Image::initWithPngData(uint8_t* data, ssize_t dataLen) { -#if AX_USE_PNG +#if CC_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 - AX_BREAK_IF(dataLen < PNGSIGSIZE); + CC_BREAK_IF(dataLen < PNGSIGSIZE); // check the data is png or not memcpy(header, data, PNGSIGSIZE); - AX_BREAK_IF(png_sig_cmp(header, 0, PNGSIGSIZE)); + CC_BREAK_IF(png_sig_cmp(header, 0, PNGSIGSIZE)); // init png_struct png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0); - AX_BREAK_IF(!png_ptr); + CC_BREAK_IF(!png_ptr); // init png_info info_ptr = png_create_info_struct(png_ptr); - AX_BREAK_IF(!info_ptr); + CC_BREAK_IF(!info_ptr); - AX_BREAK_IF(setjmp(png_jmpbuf(png_ptr))); + CC_BREAK_IF(setjmp(png_jmpbuf(png_ptr))); // set the read call back function tImageSource imageSource; @@ -1184,9 +1184,9 @@ bool Image::initWithPngData(uint8_t* data, ssize_t dataLen) } else { - // if PNG_PREMULTIPLIED_ALPHA_ENABLED == false && AX_ENABLE_PREMULTIPLIED_ALPHA != 0, + // if PNG_PREMULTIPLIED_ALPHA_ENABLED == false && CC_ENABLE_PREMULTIPLIED_ALPHA != 0, // you must do PMA at shader, such as modify positionTextureColor.frag - _hasPremultipliedAlpha = !!AX_ENABLE_PREMULTIPLIED_ALPHA; + _hasPremultipliedAlpha = !!CC_ENABLE_PREMULTIPLIED_ALPHA; } } @@ -1206,7 +1206,7 @@ bool Image::initWithPngData(uint8_t* data, ssize_t dataLen) #else CCLOG("png is not enabled, please enable it in ccConfig.h"); return false; -#endif // AX_USE_PNG +#endif // CC_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 AX_USE_WEBP +#if CC_USE_WEBP bool ret = false; do @@ -1267,7 +1267,7 @@ bool Image::initWithWebpData(uint8_t* data, ssize_t dataLen) #else CCLOG("webp is not enabled, please enable it in ccConfig.h"); return false; -#endif // AX_USE_WEBP +#endif // CC_USE_WEBP } bool Image::initWithTGAData(tImageTGA* tgaData) @@ -1276,7 +1276,7 @@ bool Image::initWithTGAData(tImageTGA* tgaData) do { - AX_BREAK_IF(tgaData == nullptr); + CC_BREAK_IF(tgaData == nullptr); // tgaLoadBuffer only support type 2, 3, 10 if (2 == tgaData->type || 10 == tgaData->type) @@ -1365,7 +1365,7 @@ 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 = AX_SWAP_INT32_LITTLE_TO_HOST(header->flags); + unsigned int flags = CC_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) @@ -1411,8 +1411,8 @@ bool Image::initWithPVRv2Data(uint8_t* data, ssize_t dataLen, bool ownData) _numberOfMipmaps = 0; // Get size of mipmap - _width = width = AX_SWAP_INT32_LITTLE_TO_HOST(header->width); - _height = height = AX_SWAP_INT32_LITTLE_TO_HOST(header->height); + _width = width = CC_SWAP_INT32_LITTLE_TO_HOST(header->width); + _height = height = CC_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 = AX_SWAP_INT32_LITTLE_TO_HOST(header->dataLength); + int dataLength = CC_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) @@ -1520,7 +1520,7 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) const PVRv3TexHeader* header = static_cast(static_cast(data)); // validate version - if (AX_SWAP_INT32_BIG_TO_HOST(header->version) != 0x50565203) + if (CC_SWAP_INT32_BIG_TO_HOST(header->version) != 0x50565203) { CCLOG("cocos2d: WARNING: pvr file version mismatch"); return false; @@ -1562,7 +1562,7 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) _pixelFormat = finalPixelFormat; // flags - int flags = AX_SWAP_INT32_LITTLE_TO_HOST(header->flags); + int flags = CC_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 = AX_SWAP_INT32_LITTLE_TO_HOST(header->width); - int height = AX_SWAP_INT32_LITTLE_TO_HOST(header->height); + int width = CC_SWAP_INT32_LITTLE_TO_HOST(header->width); + int height = CC_SWAP_INT32_LITTLE_TO_HOST(header->height); _width = width; _height = height; @@ -1585,7 +1585,7 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) _numberOfMipmaps = header->numberOfMipmaps; CCASSERT(_numberOfMipmaps < MIPMAP_MAX, - "Image: Maximum number of mimpaps reached. Increase the AX_MIPMAP_MAX value"); + "Image: Maximum number of mimpaps reached. Increase the CC_MIPMAP_MAX value"); for (int i = 0; i < _numberOfMipmaps; i++) { @@ -1748,7 +1748,7 @@ bool Image::initWithETCData(uint8_t* data, ssize_t dataLen, bool ownData) } // software decode fail, release pixels data - AX_SAFE_FREE(_data); + CC_SAFE_FREE(_data); _dataLen = 0; return false; } @@ -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 - AX_SAFE_FREE(_data); + CC_SAFE_FREE(_data); _dataLen = 0; break; } @@ -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)) { - AX_SAFE_FREE(_data); + CC_SAFE_FREE(_data); _dataLen = 0; break; } @@ -2197,7 +2197,7 @@ void Image::forwardPixels(uint8_t* data, ssize_t dataLen, int offset, bool ownDa } } -#if (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) bool Image::saveToFile(std::string_view filename, bool isToRGB) { // only support for backend::PixelFormat::RGB8 or backend::PixelFormat::RGBA8 uncompressed data @@ -2229,7 +2229,7 @@ bool Image::saveToFile(std::string_view filename, bool isToRGB) bool Image::saveImageToPNG(std::string_view filePath, bool isToRGB) { -#if AX_USE_PNG +#if CC_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); - AX_BREAK_IF(nullptr == outStream); + CC_BREAK_IF(nullptr == outStream); png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); @@ -2367,12 +2367,12 @@ bool Image::saveImageToPNG(std::string_view filePath, bool isToRGB) #else CCLOG("png is not enabled, please enable it in ccConfig.h"); return false; -#endif // AX_USE_PNG +#endif // CC_USE_PNG } bool Image::saveImageToJPG(std::string_view filePath) { -#if AX_USE_JPEG +#if CC_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); - AX_BREAK_IF(nullptr == outfile); + CC_BREAK_IF(nullptr == outfile); unsigned char* outputBuffer = nullptr; unsigned long outputSize = 0; @@ -2472,19 +2472,19 @@ bool Image::saveImageToJPG(std::string_view filePath) #else CCLOG("jpeg is not enabled, please enable it in ccConfig.h"); return false; -#endif // AX_USE_JPEG +#endif // CC_USE_JPEG } void Image::premultiplyAlpha() { -#if AX_ENABLE_PREMULTIPLIED_ALPHA +#if CC_ENABLE_PREMULTIPLIED_ALPHA CCASSERT(_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] = AX_RGB_PREMULTIPLY_ALPHA(p[0], p[1], p[2], p[3]); + fourBytes[i] = CC_RGB_PREMULTIPLY_ALPHA(p[0], p[1], p[2], p[3]); } _hasPremultipliedAlpha = true; diff --git a/core/platform/CCImage.h b/core/platform/CCImage.h index 0af8b9171b..b1b3196c05 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 __AX_IMAGE_H__ -#define __AX_IMAGE_H__ +#ifndef __CC_IMAGE_H__ +#define __CC_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 AX_RGB_PREMULTIPLY_ALPHA(vr, vg, vb, va) \ +#define CC_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 AX_DLL Image : public Ref +class CC_DLL Image : public Ref { public: friend class TextureCache; @@ -269,4 +269,4 @@ protected: NS_AX_END -#endif // __AX_IMAGE_H__ +#endif // __CC_IMAGE_H__ diff --git a/core/platform/CCPlatformConfig.h b/core/platform/CCPlatformConfig.h index e58ac1de88..5b62df246d 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_AX_PLATFORM_CONFIG_H__ -#define __BASE_AX_PLATFORM_CONFIG_H__ +#ifndef __BASE_CC_PLATFORM_CONFIG_H__ +#define __BASE_CC_PLATFORM_CONFIG_H__ /// @cond DO_NOT_SHOW /** @@ -40,53 +40,53 @@ THE SOFTWARE. ////////////////////////////////////////////////////////////////////////// // define supported target platform macro which CC uses. -#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 +#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 // Determine target platform by compile environment macro. -#define AX_TARGET_PLATFORM AX_PLATFORM_UNKNOWN +#define CC_TARGET_PLATFORM CC_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 AX_TARGET_PLATFORM -# define AX_TARGET_PLATFORM AX_PLATFORM_IOS +# undef CC_TARGET_PLATFORM +# define CC_TARGET_PLATFORM CC_PLATFORM_IOS # elif TARGET_OS_MAC -# undef AX_TARGET_PLATFORM -# define AX_TARGET_PLATFORM AX_PLATFORM_MAC +# undef CC_TARGET_PLATFORM +# define CC_TARGET_PLATFORM CC_PLATFORM_MAC # endif #endif // android #if defined(__ANDROID__) -# undef AX_TARGET_PLATFORM -# define AX_TARGET_PLATFORM AX_PLATFORM_ANDROID +# undef CC_TARGET_PLATFORM +# define CC_TARGET_PLATFORM CC_PLATFORM_ANDROID #endif // win32 #if defined(_WIN32) && defined(_WINDOWS) -# undef AX_TARGET_PLATFORM -# define AX_TARGET_PLATFORM AX_PLATFORM_WIN32 +# undef CC_TARGET_PLATFORM +# define CC_TARGET_PLATFORM CC_PLATFORM_WIN32 #endif // linux #if defined(LINUX) && !defined(__APPLE__) -# undef AX_TARGET_PLATFORM -# define AX_TARGET_PLATFORM AX_PLATFORM_LINUX +# undef CC_TARGET_PLATFORM +# define CC_TARGET_PLATFORM CC_PLATFORM_LINUX #endif ////////////////////////////////////////////////////////////////////////// @@ -94,15 +94,15 @@ THE SOFTWARE. ////////////////////////////////////////////////////////////////////////// // check user set platform -#if !AX_TARGET_PLATFORM +#if !CC_TARGET_PLATFORM # error "Cannot recognize the target platform; are you targeting an unsupported platform?" #endif -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) # ifndef __MINGW32__ # pragma warning(disable : 4127) # endif -#endif // AX_PLATFORM_WIN32 +#endif // CC_PLATFORM_WIN32 /* windows: https://github.com/google/angle @@ -114,35 +114,35 @@ other: GL # define AX_USE_COMPAT_GL 0 #endif -#if ((AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || (AX_TARGET_PLATFORM == AX_PLATFORM_IOS)) -# define AX_PLATFORM_MOBILE +#if ((CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)) +# define CC_PLATFORM_MOBILE #else -# define AX_PLATFORM_PC +# define CC_PLATFORM_PC #endif -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) # if !AX_USE_COMPAT_GL -# define AX_USE_METAL +# define CC_USE_METAL # else -# define AX_USE_GL +# define CC_USE_GL # endif -#elif (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) # if !AX_USE_COMPAT_GL -# define AX_USE_METAL +# define CC_USE_METAL # else -# define AX_USE_GLES +# define CC_USE_GLES # endif -#elif (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) -# define AX_USE_GLES -#elif (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +# define CC_USE_GLES +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) # if !AX_USE_COMPAT_GL -# define AX_USE_GL +# define CC_USE_GL # else -# define AX_USE_GLES +# define CC_USE_GLES # endif #else -# define AX_USE_GL +# define CC_USE_GL #endif /// @endcond -#endif // __BASE_AX_PLATFORM_CONFIG_H__ +#endif // __BASE_CC_PLATFORM_CONFIG_H__ diff --git a/core/platform/CCPlatformDefine.h b/core/platform/CCPlatformDefine.h index 843d4b1574..5e4371bc14 100644 --- a/core/platform/CCPlatformDefine.h +++ b/core/platform/CCPlatformDefine.h @@ -29,14 +29,14 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if AX_TARGET_PLATFORM == AX_PLATFORM_MAC +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC # include "platform/mac/CCPlatformDefine-mac.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS # include "platform/ios/CCPlatformDefine-ios.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID # include "platform/android/CCPlatformDefine-android.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 # include "platform/win32/CCPlatformDefine-win32.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_LINUX +#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX # include "platform/linux/CCPlatformDefine-linux.h" #endif diff --git a/core/platform/CCPlatformMacros.h b/core/platform/CCPlatformMacros.h index d67324da52..d29e60d8d6 100644 --- a/core/platform/CCPlatformMacros.h +++ b/core/platform/CCPlatformMacros.h @@ -25,8 +25,8 @@ Copyright (c) 2021 Bytedance Inc. THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PLATFORM_MACROS_H__ -#define __AX_PLATFORM_MACROS_H__ +#ifndef __CC_PLATFORM_MACROS_H__ +#define __CC_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__) \ - AX_DEPRECATED_ATTRIBUTE static __TYPE__* node() \ + CC_DEPRECATED_ATTRIBUTE static __TYPE__* node() \ { \ __TYPE__* pRet = new __TYPE__(); \ if (pRet->init()) \ @@ -81,26 +81,26 @@ Copyright (c) 2021 Bytedance Inc. } \ } -/** @def AX_ENABLE_CACHE_TEXTURE_DATA +/** @def CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) -# define AX_ENABLE_CACHE_TEXTURE_DATA 1 +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +# define CC_ENABLE_CACHE_TEXTURE_DATA 1 #else -# define AX_ENABLE_CACHE_TEXTURE_DATA 0 +# define CC_ENABLE_CACHE_TEXTURE_DATA 0 #endif -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_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 AX_REBIND_INDICES_BUFFER 1 +# define CC_REBIND_INDICES_BUFFER 1 #else -# define AX_REBIND_INDICES_BUFFER 0 +# define CC_REBIND_INDICES_BUFFER 0 #endif // Generic macros @@ -126,31 +126,31 @@ namespace ax = axis; // end of namespace group /// @} -/** @def AX_PROPERTY_READONLY +/** @def CC_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 AX_PROPERTY_READONLY are all public. + * The variables and methods declared after CC_PROPERTY_READONLY are all public. * If you need protected or private, please declare. */ -#define AX_PROPERTY_READONLY(varType, varName, funName) \ +#define CC_PROPERTY_READONLY(varType, varName, funName) \ protected: \ varType varName; \ \ public: \ virtual varType get##funName() const; -#define AX_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName) \ +#define CC_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName) \ protected: \ varType varName; \ \ public: \ virtual const varType& get##funName() const; -/** @def AX_PROPERTY +/** @def CC_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 AX_PROPERTY are all public. + * The variables and methods declared after CC_PROPERTY are all public. * If you need protected or private, please declare. */ -#define AX_PROPERTY(varType, varName, funName) \ +#define CC_PROPERTY(varType, varName, funName) \ protected: \ varType varName; \ \ @@ -170,7 +170,7 @@ public: \ virtual varType get##funName() const; \ virtual void set##funName(varType var); -#define AX_PROPERTY_PASS_BY_REF(varType, varName, funName) \ +#define CC_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 AX_SYNTHESIZE_READONLY +/** @def CC_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 AX_SYNTHESIZE_READONLY are all public. + * The variables and methods declared after CC_SYNTHESIZE_READONLY are all public. * If you need protected or private, please declare. */ -#define AX_SYNTHESIZE_READONLY(varType, varName, funName) \ +#define CC_SYNTHESIZE_READONLY(varType, varName, funName) \ protected: \ varType varName; \ \ public: \ virtual inline varType get##funName() const { return varName; } -#define AX_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName) \ +#define CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName) \ protected: \ varType varName; \ \ public: \ virtual inline const varType& get##funName() const { return varName; } -/** @def AX_SYNTHESIZE +/** @def CC_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 AX_SYNTHESIZE are all public. + * The variables and methods declared after CC_SYNTHESIZE are all public. * If you need protected or private, please declare. */ -#define AX_SYNTHESIZE(varType, varName, funName) \ +#define CC_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 AX_SYNTHESIZE_PASS_BY_REF(varType, varName, funName) \ +#define CC_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 AX_SYNTHESIZE_RETAIN(varType, varName, funName) \ +#define CC_SYNTHESIZE_RETAIN(varType, varName, funName) \ private: \ varType varName; \ \ @@ -240,19 +240,19 @@ public: \ { \ if (varName != var) \ { \ - AX_SAFE_RETAIN(var); \ - AX_SAFE_RELEASE(varName); \ + CC_SAFE_RETAIN(var); \ + CC_SAFE_RELEASE(varName); \ varName = var; \ } \ } -#define AX_SAFE_DELETE(p) \ +#define CC_SAFE_DELETE(p) \ do \ { \ delete (p); \ (p) = nullptr; \ } while (0) -#define AX_SAFE_DELETE_ARRAY(p) \ +#define CC_SAFE_DELETE_ARRAY(p) \ do \ { \ if (p) \ @@ -261,7 +261,7 @@ public: \ (p) = nullptr; \ } \ } while (0) -#define AX_SAFE_FREE(p) \ +#define CC_SAFE_FREE(p) \ do \ { \ if (p) \ @@ -270,7 +270,7 @@ public: \ (p) = nullptr; \ } \ } while (0) -#define AX_SAFE_RELEASE(p) \ +#define CC_SAFE_RELEASE(p) \ do \ { \ if (p) \ @@ -278,7 +278,7 @@ public: \ (p)->release(); \ } \ } while (0) -#define AX_SAFE_RELEASE_NULL(p) \ +#define CC_SAFE_RELEASE_NULL(p) \ do \ { \ if (p) \ @@ -287,7 +287,7 @@ public: \ (p) = nullptr; \ } \ } while (0) -#define AX_SAFE_RETAIN(p) \ +#define CC_SAFE_RETAIN(p) \ do \ { \ if (p) \ @@ -295,7 +295,7 @@ public: \ (p)->retain(); \ } \ } while (0) -#define AX_BREAK_IF(cond) \ +#define CC_BREAK_IF(cond) \ if (cond) \ break @@ -339,7 +339,7 @@ public: \ #endif // COCOS2D_DEBUG /** Lua engine debug */ -#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 || AX_LUA_ENGINE_DEBUG == 0 +#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 || CC_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 AX_DISALLOW_COPY_AND_ASSIGN(TypeName) +/** @def CC_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 AX_DISALLOW_COPY_AND_ASSIGN(TypeName) \ +# define CC_DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&) = delete; \ TypeName& operator=(const TypeName&) = delete; #else -# define AX_DISALLOW_COPY_AND_ASSIGN(TypeName) \ +# define CC_DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ TypeName& operator=(const TypeName&); #endif -/** @def AX_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) +/** @def CC_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 AX_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ +#define CC_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ TypeName(); \ - AX_DISALLOW_COPY_AND_ASSIGN(TypeName) + CC_DISALLOW_COPY_AND_ASSIGN(TypeName) -/** @def AX_DEPRECATED_ATTRIBUTE +/** @def CC_DEPRECATED_ATTRIBUTE * Only certain compilers support __attribute__((deprecated)). */ #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) -# define AX_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) +# define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) #elif _MSC_VER >= 1400 // vs 2005 or higher -# define AX_DEPRECATED_ATTRIBUTE __declspec(deprecated) +# define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated) #else -# define AX_DEPRECATED_ATTRIBUTE +# define CC_DEPRECATED_ATTRIBUTE #endif -/** @def AX_DEPRECATED(...) +/** @def CC_DEPRECATED(...) * Macro to mark things deprecated as of a particular version * can be used with arbitrary parameters which are thrown away. - * e.g. AX_DEPRECATED(4.0) or AX_DEPRECATED(4.0, "not going to need this anymore") etc. + * e.g. CC_DEPRECATED(4.0) or CC_DEPRECATED(4.0, "not going to need this anymore") etc. */ -#define AX_DEPRECATED(...) AX_DEPRECATED_ATTRIBUTE +#define CC_DEPRECATED(...) CC_DEPRECATED_ATTRIBUTE -/** @def AX_FORMAT_PRINTF(formatPos, argPos) +/** @def CC_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 AX_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) +# define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) #elif defined(__has_attribute) # if __has_attribute(format) -# define AX_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) +# define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) # else -# define AX_FORMAT_PRINTF(formatPos, argPos) +# define CC_FORMAT_PRINTF(formatPos, argPos) # endif // __has_attribute(format) #else -# define AX_FORMAT_PRINTF(formatPos, argPos) +# define CC_FORMAT_PRINTF(formatPos, argPos) #endif #if defined(_MSC_VER) -# define AX_FORMAT_PRINTF_SIZE_T "%08lX" +# define CC_FORMAT_PRINTF_SIZE_T "%08lX" #else -# define AX_FORMAT_PRINTF_SIZE_T "%08zX" +# define CC_FORMAT_PRINTF_SIZE_T "%08zX" #endif #ifdef __GNUC__ -# define AX_UNUSED __attribute__((unused)) +# define CC_UNUSED __attribute__((unused)) #else -# define AX_UNUSED +# define CC_UNUSED #endif -/** @def AX_REQUIRES_NULL_TERMINATION +/** @def CC_REQUIRES_NULL_TERMINATION * */ -#if !defined(AX_REQUIRES_NULL_TERMINATION) -# if defined(__APPLE_AX__) && (__APPLE_AX__ >= 5549) -# define AX_REQUIRES_NULL_TERMINATION __attribute__((sentinel(0, 1))) +#if !defined(CC_REQUIRES_NULL_TERMINATION) +# if defined(__APPLE_CC__) && (__APPLE_CC__ >= 5549) +# define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel(0, 1))) # elif defined(__GNUC__) -# define AX_REQUIRES_NULL_TERMINATION __attribute__((sentinel)) +# define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel)) # else -# define AX_REQUIRES_NULL_TERMINATION +# define CC_REQUIRES_NULL_TERMINATION # endif #endif @@ -460,4 +460,4 @@ public: \ # define UTILS_UNLIKELY(exp) (!!(exp)) #endif -#endif // __AX_PLATFORM_MACROS_H__ +#endif // __CC_PLATFORM_MACROS_H__ diff --git a/core/platform/CCPosixFileStream.cpp b/core/platform/CCPosixFileStream.cpp index 89c93c6acb..83692837ac 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 AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_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 AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM != CC_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 AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM != CC_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 1908abce5c..52804def31 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 AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 # include # include #else @@ -17,7 +17,7 @@ #include "platform/CCPlatformMacros.h" -#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID # include "platform/android/CCFileUtils-android.h" # include # include @@ -70,7 +70,7 @@ struct UnzFileStream; union PXFileHandle { int _fd = -1; -#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID AAsset* _asset; ZipFileStream _zfs; #endif @@ -78,7 +78,7 @@ union PXFileHandle struct PXIoF; -class AX_DLL PosixFileStream : public FileStream +class CC_DLL PosixFileStream : public FileStream { public: PosixFileStream() = default; diff --git a/core/platform/CCSAXParser.cpp b/core/platform/CCSAXParser.cpp index d2bc715c65..1819e63df0 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 AX_XML_CHAR*)_curEleName.c_str(), - (const AX_XML_CHAR**)&_curEleAttrs[0]); + SAXParser::startElement(_ccsaxParserImp, (const CC_XML_CHAR*)_curEleName.c_str(), + (const CC_XML_CHAR**)&_curEleAttrs[0]); _curEleAttrs.clear(); } else { const char* attr = nullptr; const char** attrs = &attr; - SAXParser::startElement(_ccsaxParserImp, (const AX_XML_CHAR*)_curEleName.c_str(), - (const AX_XML_CHAR**)attrs); + SAXParser::startElement(_ccsaxParserImp, (const CC_XML_CHAR*)_curEleName.c_str(), + (const CC_XML_CHAR**)attrs); } }; _sax3Handler.xml_end_element_cb = [=](const char* name, size_t len) { - SAXParser::endElement(_ccsaxParserImp, (const AX_XML_CHAR*)name); + SAXParser::endElement(_ccsaxParserImp, (const CC_XML_CHAR*)name); }; _sax3Handler.xml_text_cb = [=](const char* s, size_t len) { - SAXParser::textHandler(_ccsaxParserImp, (const AX_XML_CHAR*)s, len); + SAXParser::textHandler(_ccsaxParserImp, (const CC_XML_CHAR*)s, len); }; }; @@ -139,16 +139,16 @@ bool SAXParser::parseIntrusive(char* xmlData, size_t dataLength) return false; } -void SAXParser::startElement(void* ctx, const AX_XML_CHAR* name, const AX_XML_CHAR** atts) +void SAXParser::startElement(void* ctx, const CC_XML_CHAR* name, const CC_XML_CHAR** atts) { ((SAXParser*)(ctx))->_delegator->startElement(ctx, (char*)name, (const char**)atts); } -void SAXParser::endElement(void* ctx, const AX_XML_CHAR* name) +void SAXParser::endElement(void* ctx, const CC_XML_CHAR* name) { ((SAXParser*)(ctx))->_delegator->endElement(ctx, (char*)name); } -void SAXParser::textHandler(void* ctx, const AX_XML_CHAR* name, size_t len) +void SAXParser::textHandler(void* ctx, const CC_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 1c19681f65..2de23a8484 100644 --- a/core/platform/CCSAXParser.h +++ b/core/platform/CCSAXParser.h @@ -37,9 +37,9 @@ NS_AX_BEGIN * @{ */ -typedef unsigned char AX_XML_CHAR; +typedef unsigned char CC_XML_CHAR; -class AX_DLL SAXDelegator +class CC_DLL SAXDelegator { public: virtual ~SAXDelegator() {} @@ -61,7 +61,7 @@ public: virtual void textHandler(void* ctx, const char* s, size_t len) = 0; }; -class AX_DLL SAXParser +class CC_DLL SAXParser { SAXDelegator* _delegator; @@ -106,17 +106,17 @@ public: * @js NA * @lua NA */ - static void startElement(void* ctx, const AX_XML_CHAR* name, const AX_XML_CHAR** atts); + static void startElement(void* ctx, const CC_XML_CHAR* name, const CC_XML_CHAR** atts); /** * @js NA * @lua NA */ - static void endElement(void* ctx, const AX_XML_CHAR* name); + static void endElement(void* ctx, const CC_XML_CHAR* name); /** * @js NA * @lua NA */ - static void textHandler(void* ctx, const AX_XML_CHAR* name, size_t len); + static void textHandler(void* ctx, const CC_XML_CHAR* name, size_t len); }; // end of platform group diff --git a/core/platform/CCStdC.h b/core/platform/CCStdC.h index 0f3283e99d..ed0cd377fa 100644 --- a/core/platform/CCStdC.h +++ b/core/platform/CCStdC.h @@ -29,15 +29,15 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if AX_TARGET_PLATFORM == AX_PLATFORM_MAC +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC # include "platform/mac/CCStdC-mac.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS # include "platform/ios/CCStdC-ios.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID # include "platform/android/CCStdC-android.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 # include "platform/win32/CCStdC-win32.h" -#elif AX_TARGET_PLATFORM == AX_PLATFORM_LINUX +#elif CC_TARGET_PLATFORM == CC_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 a3b2d8ff00..dfa56b4383 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 AX_DLL Application : public ApplicationProtocol +class CC_DLL Application : public ApplicationProtocol { public: /** @@ -61,7 +61,7 @@ public: static Application* getInstance(); /** @deprecated Use getInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); + CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); /** @brief Get current language config diff --git a/core/platform/android/CCEnhanceAPI-android.h b/core/platform/android/CCEnhanceAPI-android.h index 2492975d61..04b7db35a9 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 AX_DLL EnhanceAPI +class CC_DLL EnhanceAPI { public: /** diff --git a/core/platform/android/CCFileUtils-android.h b/core/platform/android/CCFileUtils-android.h index b72cdc38c7..7c5ccbc743 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 AX_DLL FileUtilsAndroid : public FileUtils +class CC_DLL FileUtilsAndroid : public FileUtils { friend class FileUtils; diff --git a/core/platform/android/CCGLViewImpl-android.cpp b/core/platform/android/CCGLViewImpl-android.cpp index dca7163635..e86b883970 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; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -70,7 +70,7 @@ GLViewImpl* GLViewImpl::create(std::string_view viewName) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -82,7 +82,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } diff --git a/core/platform/android/CCGLViewImpl-android.h b/core/platform/android/CCGLViewImpl-android.h index 1def117b5c..cfb2503990 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 AX_DLL GLViewImpl : public GLView +class CC_DLL GLViewImpl : public GLView { public: // static function diff --git a/core/platform/android/CCPlatformDefine-android.h b/core/platform/android/CCPlatformDefine-android.h index c7d9598b74..2aae5c5521 100644 --- a/core/platform/android/CCPlatformDefine-android.h +++ b/core/platform/android/CCPlatformDefine-android.h @@ -27,25 +27,25 @@ THE SOFTWARE. #include -#define AX_DLL +#define CC_DLL -#define AX_NO_MESSAGE_PSEUDOASSERT(cond) \ +#define CC_NO_MESSAGE_PSEUDOASSERT(cond) \ if (!(cond)) \ { \ __android_log_print(ANDROID_LOG_ERROR, "cocos2d-x assert", "%s function:%s line:%d", __FILE__, __FUNCTION__, \ __LINE__); \ } -#define AX_MESSAGE_PSEUDOASSERT(cond, msg) \ +#define CC_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 AX_ASSERT(cond) AX_NO_MESSAGE_PSEUDOASSERT(cond) +#define CC_ASSERT(cond) CC_NO_MESSAGE_PSEUDOASSERT(cond) -#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam +#define CC_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 2e6f89af2a..0b1a2cbd6b 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 AX_DLL JniHelper +class CC_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 91e2c324a9..0ee63febf3 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 AX_TARGET_PLATFORM == AX_PLATFORM_MAC +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC # include # include # include -#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS # import diff --git a/core/platform/apple/CCFileUtils-apple.h b/core/platform/apple/CCFileUtils-apple.h index 09ad5df731..ea4315cc71 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 __AX_FILEUTILS_APPLE_H__ -#define __AX_FILEUTILS_APPLE_H__ +#ifndef __CC_FILEUTILS_APPLE_H__ +#define __CC_FILEUTILS_APPLE_H__ #include #include @@ -43,7 +43,7 @@ NS_AX_BEGIN */ //! @brief Helper class to handle file operations -class AX_DLL FileUtilsApple : public FileUtils +class CC_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 AX_FILEUTILS_APPLE_ENABLE_OBJC +#if CC_FILEUTILS_APPLE_ENABLE_OBJC void setBundle(NSBundle* bundle); #endif @@ -76,4 +76,4 @@ private: NS_AX_END -#endif // __AX_FILEUTILS_APPLE_H__ +#endif // __CC_FILEUTILS_APPLE_H__ diff --git a/core/platform/apple/CCFileUtils-apple.mm b/core/platform/apple/CCFileUtils-apple.mm index 1a213ce7c8..d8bb0b5b93 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 AX_FILEUTILS_APPLE_ENABLE_OBJC +#if CC_FILEUTILS_APPLE_ENABLE_OBJC void FileUtilsApple::setBundle(NSBundle* bundle) { pimpl_->setBundle(bundle); diff --git a/core/platform/desktop/CCGLViewImpl-desktop.cpp b/core/platform/desktop/CCGLViewImpl-desktop.cpp index c30378bb83..5e2a33000b 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 AX_ICON_SET_SUPPORT +#if CC_ICON_SET_SUPPORT # include "platform/CCImage.h" -#endif /* AX_ICON_SET_SUPPORT */ +#endif /* CC_ICON_SET_SUPPORT */ #include "renderer/CCRenderer.h" @@ -306,7 +306,7 @@ GLViewImpl::GLViewImpl(bool initglfw) if (initglfw) { glfwSetErrorCallback(GLFWEventHandler::onGLFWError); -#if defined(AX_USE_GLES) && GLFW_VERSION_MAJOR >= 3 && GLFW_VERSION_MINOR >= 4 +#if defined(CC_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) @@ -341,7 +341,7 @@ GLViewImpl* GLViewImpl::create(std::string_view viewName, bool resizable) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -353,7 +353,7 @@ GLViewImpl* GLViewImpl::createWithRect(std::string_view viewName, Rect rect, flo ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -365,7 +365,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -379,7 +379,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName, ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -389,7 +389,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ _frameZoomFactor = frameZoomFactor; -#if defined(AX_USE_GLES) +#if defined(CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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(AX_USE_GL) +#if defined(CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) + // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) // _isRetinaEnabled = enabled; // if (_isRetinaEnabled) // { @@ -593,7 +593,7 @@ void GLViewImpl::enableRetina(bool enabled) void GLViewImpl::setIMEKeyboardState(bool /*bOpen*/) {} -#if AX_ICON_SET_SUPPORT +#if CC_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 { - AX_SAFE_DELETE(icon); + CC_SAFE_DELETE(icon); } } @@ -633,10 +633,10 @@ void GLViewImpl::setIcon(const std::vector& filelist) const GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, iconsCount, images); - AX_SAFE_DELETE_ARRAY(images); + CC_SAFE_DELETE_ARRAY(images); for (auto& icon : icons) { - AX_SAFE_DELETE(icon); + CC_SAFE_DELETE(icon); } } @@ -645,7 +645,7 @@ void GLViewImpl::setDefaultIcon() const GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, 0, nullptr); } -#endif /* AX_ICON_SET_SUPPORT */ +#endif /* CC_ICON_SET_SUPPORT */ void GLViewImpl::setCursorVisible(bool isVisible) { @@ -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 (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) // on mac window will sometimes lose title when windowed glfwSetWindowTitle(_mainWindow, _viewName.c_str()); #endif @@ -1194,11 +1194,11 @@ static bool loadFboExtensions() // helper bool GLViewImpl::loadGL() { -#if (AX_TARGET_PLATFORM != AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) // glad: load all OpenGL function pointers // --------------------------------------- -# if defined(AX_USE_GL) +# if defined(CC_USE_GL) if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) { log("glad: Failed to Load GL"); @@ -1222,7 +1222,7 @@ bool GLViewImpl::loadGL() loadFboExtensions(); -#endif // (AX_TARGET_PLATFORM != AX_PLATFORM_MAC) +#endif // (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) return true; } diff --git a/core/platform/desktop/CCGLViewImpl-desktop.h b/core/platform/desktop/CCGLViewImpl-desktop.h index 45e0b9242d..ec9c68d525 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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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 /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ +#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) NS_AX_BEGIN class GLFWEventHandler; -class AX_DLL GLViewImpl : public GLView +class CC_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 AX_ICON_SET_SUPPORT +#if CC_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 /* AX_ICON_SET_SUPPORT */ +#endif /* CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) HWND getWin32Window() { return glfwGetWin32Window(_mainWindow); } -#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ +#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) id getCocoaWindow() override { return glfwGetCocoaWindow(_mainWindow); } id getNSGLContext() override { return glfwGetNSGLContext(_mainWindow); } // stevetranby: added -#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) protected: GLViewImpl(bool initglfw = true); @@ -202,7 +202,7 @@ public: static const std::string EVENT_WINDOW_UNFOCUSED; private: - AX_DISALLOW_COPY_AND_ASSIGN(GLViewImpl); + CC_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 bdb721dfb6..52f355a06f 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 AX_DLL Application : public ApplicationProtocol +class CC_DLL Application : public ApplicationProtocol { public: /** diff --git a/core/platform/ios/CCApplication-ios.mm b/core/platform/ios/CCApplication-ios.mm index 4efe993e1b..02ade1b8f3 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() { - AX_ASSERT(!sm_pSharedApplication); + CC_ASSERT(!sm_pSharedApplication); sm_pSharedApplication = this; } Application::~Application() { - AX_ASSERT(this == sm_pSharedApplication); + CC_ASSERT(this == sm_pSharedApplication); sm_pSharedApplication = 0; } @@ -67,7 +67,7 @@ void Application::setAnimationInterval(float interval) Application* Application::getInstance() { - AX_ASSERT(sm_pSharedApplication); + CC_ASSERT(sm_pSharedApplication); return sm_pSharedApplication; } diff --git a/core/platform/ios/CCCommon-ios.mm b/core/platform/ios/CCCommon-ios.mm index 549aabd01c..9b135c617f 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(AX_TARGET_OS_TVOS) +#if !defined(CC_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 f2c8c42b2a..6b87000ffd 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(AX_TARGET_OS_TVOS) +#if !defined(CC_TARGET_OS_TVOS) # import #endif #import @@ -189,7 +189,7 @@ static CGSize _calculateShrinkedSizeForString(NSAttributedString** str, #define SENSOR_DELAY_GAME 0.02 -#if !defined(AX_TARGET_OS_TVOS) +#if !defined(CC_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(AX_TARGET_OS_TVOS) +#endif // !defined(CC_TARGET_OS_TVOS) // @@ -340,14 +340,14 @@ int Device::getDPI() void Device::setAccelerometerEnabled(bool isEnabled) { -#if !defined(AX_TARGET_OS_TVOS) +#if !defined(CC_TARGET_OS_TVOS) [[CCAccelerometerDispatcher sharedAccelerometerDispatcher] setAccelerometerEnabled:isEnabled]; #endif } void Device::setAccelerometerInterval(float interval) { -#if !defined(AX_TARGET_OS_TVOS) +#if !defined(CC_TARGET_OS_TVOS) [[CCAccelerometerDispatcher sharedAccelerometerDispatcher] setAccelerometerInterval:interval]; #endif } @@ -443,14 +443,14 @@ static bool _initWithString(const char* text, bool bRet = false; do { - AX_BREAK_IF(!text || !info); + CC_BREAK_IF(!text || !info); id font = _createSystemFont(fontName, size); - AX_BREAK_IF(!font); + CC_BREAK_IF(!font); NSString* str = [NSString stringWithUTF8String:text]; - AX_BREAK_IF(!str); + CC_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); } - AX_BREAK_IF(realDimensions.width <= 0 || realDimensions.height <= 0); + CC_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); - AX_SAFE_FREE(data); + CC_SAFE_FREE(data); break; } diff --git a/core/platform/ios/CCDirectorCaller-ios.mm b/core/platform/ios/CCDirectorCaller-ios.mm index a7210ba839..9cbd9a2139 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(AX_USE_GLES) +#if defined(CC_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 5ad547b20a..5c70cf73b0 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(AX_USE_GLES) +#if defined(CC_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(AX_USE_GLES) +#if defined(CC_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(AX_USE_GLES) +#if defined(CC_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 40ff8f96cc..716c8b8af2 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(AX_USE_METAL) +#if defined(CC_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(AX_USE_METAL) +#if !defined(CC_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(AX_USE_METAL) +#if defined(CC_USE_METAL) return [CAMetalLayer class]; #else return [CAEAGLLayer class]; @@ -190,7 +190,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. self.contentScaleFactor = [[UIScreen mainScreen] scale]; } -#if defined(AX_USE_METAL) +#if defined(CC_USE_METAL) id device = MTLCreateSystemDefaultDevice(); if (!device) { @@ -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(AX_USE_METAL) +#if defined(CC_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(AX_USE_METAL) +#if !defined(CC_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(AX_USE_METAL) +#if !defined(CC_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(AX_USE_METAL) +#if defined(CC_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(AX_USE_METAL) +#if defined(CC_USE_METAL) - (void)swapBuffers {} #else @@ -582,7 +582,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. dis /= self.contentScaleFactor; -#if defined(AX_TARGET_OS_TVOS) +#if defined(CC_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(AX_TARGET_OS_TVOS) +#if !defined(CC_TARGET_OS_TVOS) namespace { UIInterfaceOrientation getFixedOrientation(UIInterfaceOrientation statusBarOrientation) @@ -642,7 +642,7 @@ UIInterfaceOrientation getFixedOrientation(UIInterfaceOrientation statusBarOrien - (void)didMoveToWindow { -#if !defined(AX_TARGET_OS_TVOS) +#if !defined(CC_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 7270125c81..6dfccb9f7a 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 AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS # import "platform/ios/CCESRenderer-ios.h" @@ -80,4 +80,4 @@ - (BOOL)resizeFromLayer:(CAEAGLLayer*)layer; @end -#endif // AX_PLATFORM_IOS +#endif // CC_PLATFORM_IOS diff --git a/core/platform/ios/CCES2Renderer-ios.m b/core/platform/ios/CCES2Renderer-ios.m index f12c53a248..0a41819426 100644 --- a/core/platform/ios/CCES2Renderer-ios.m +++ b/core/platform/ios/CCES2Renderer-ios.m @@ -30,7 +30,7 @@ #include "platform/CCPlatformConfig.h" -#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS #import "platform/ios/CCES2Renderer-ios.h" // #import "platform/CCPlatformMacros.h" @@ -254,4 +254,4 @@ @end -#endif // AX_PLATFORM_IOS +#endif // CC_PLATFORM_IOS diff --git a/core/platform/ios/CCESRenderer-ios.h b/core/platform/ios/CCESRenderer-ios.h index f75de29a38..33602e8a46 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 AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS // # include "platform/CCPlatformMacros.h" # import @@ -57,4 +57,4 @@ - (unsigned int)msaaColorBuffer; @end -#endif // AX_PLATFORM_IOS +#endif // CC_PLATFORM_IOS diff --git a/core/platform/ios/CCGL-ios.h b/core/platform/ios/CCGL-ios.h index cfbdbe9724..74a2ae6efd 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 AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#if CC_TARGET_PLATFORM == CC_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 // AX_PLATFORM_IOS +#endif // CC_PLATFORM_IOS #endif // __PLATFORM_IOS_CCGL_H__ diff --git a/core/platform/ios/CCGLViewImpl-ios.h b/core/platform/ios/CCGLViewImpl-ios.h index 9125c14c48..dcd5104ac7 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 AX_DLL GLViewImpl : public GLView +class CC_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 e483af0481..b704ebce4e 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; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -57,7 +57,7 @@ GLViewImpl* GLViewImpl::create(std::string_view viewName) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -69,7 +69,7 @@ GLViewImpl* GLViewImpl::createWithRect(std::string_view viewName, const Rect& re ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -81,7 +81,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -151,7 +151,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, const Rect& rect, float numberOfSamples:0]; // Not available on tvOS -#if !defined(AX_TARGET_OS_TVOS) +#if !defined(CC_TARGET_OS_TVOS) [eaglview setMultipleTouchEnabled:YES]; #endif @@ -183,7 +183,7 @@ bool GLViewImpl::isOpenGLReady() bool GLViewImpl::setContentScaleFactor(float contentScaleFactor) { - AX_ASSERT(_resolutionPolicy == ResolutionPolicy::UNKNOWN); // cannot enable retina mode + CC_ASSERT(_resolutionPolicy == ResolutionPolicy::UNKNOWN); // cannot enable retina mode _scaleX = _scaleY = contentScaleFactor; CCEAGLView* eaglview = (CCEAGLView*)_eaglview; diff --git a/core/platform/ios/CCPlatformDefine-ios.h b/core/platform/ios/CCPlatformDefine-ios.h index a7b94804a4..29d76f68ee 100644 --- a/core/platform/ios/CCPlatformDefine-ios.h +++ b/core/platform/ios/CCPlatformDefine-ios.h @@ -27,11 +27,11 @@ THE SOFTWARE. #include -#define AX_DLL +#define CC_DLL -#define AX_ASSERT(cond) assert(cond) +#define CC_ASSERT(cond) assert(cond) -#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam +#define CC_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 66d685a842..c9c888d902 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 AX_TARGET_PLATFORM == AX_PLATFORM_IOS +#if CC_TARGET_PLATFORM == CC_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 // AX_PLATFORM_IOS +#endif // CC_PLATFORM_IOS diff --git a/core/platform/linux/CCApplication-linux.cpp b/core/platform/linux/CCApplication-linux.cpp index b41cadfa1a..7d7b6580b2 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) { - AX_ASSERT(!sm_pSharedApplication); + CC_ASSERT(!sm_pSharedApplication); sm_pSharedApplication = this; } Application::~Application() { - AX_ASSERT(this == sm_pSharedApplication); + CC_ASSERT(this == sm_pSharedApplication); sm_pSharedApplication = nullptr; } @@ -145,7 +145,7 @@ bool Application::openURL(std::string_view url) ////////////////////////////////////////////////////////////////////////// Application* Application::getInstance() { - AX_ASSERT(sm_pSharedApplication); + CC_ASSERT(sm_pSharedApplication); return sm_pSharedApplication; } diff --git a/core/platform/linux/CCApplication-linux.h b/core/platform/linux/CCApplication-linux.h index 3fb5d00250..fdcb1933b5 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 */ - AX_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); + CC_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. */ - AX_DEPRECATED_ATTRIBUTE void setResourceRootPath(std::string_view rootResDir); + CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(std::string_view rootResDir); /** * Gets the Resource root path. * @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. */ - AX_DEPRECATED_ATTRIBUTE std::string_view getResourceRootPath(); + CC_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 e39d167a5d..297bcbacc6 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(); - AX_BREAK_IF(!dc.getBitmap(text, textDefinition, align)); - AX_BREAK_IF(!dc._data); + CC_BREAK_IF(!dc.getBitmap(text, textDefinition, align)); + CC_BREAK_IF(!dc._data); width = dc.iMaxLineWidth; height = dc.iMaxLineHeight; dc.reset(); diff --git a/core/platform/linux/CCFileUtils-linux.h b/core/platform/linux/CCFileUtils-linux.h index 19f23eabf1..cb27c0c02b 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 AX_DLL FileUtilsLinux : public FileUtils +class CC_DLL FileUtilsLinux : public FileUtils { friend class FileUtils; diff --git a/core/platform/linux/CCPlatformDefine-linux.h b/core/platform/linux/CCPlatformDefine-linux.h index 5d25b55a84..af6bfc961f 100644 --- a/core/platform/linux/CCPlatformDefine-linux.h +++ b/core/platform/linux/CCPlatformDefine-linux.h @@ -27,11 +27,11 @@ THE SOFTWARE. #include -#define AX_DLL +#define CC_DLL #include -#define AX_ASSERT(cond) assert(cond) -#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam +#define CC_ASSERT(cond) assert(cond) +#define CC_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 eababe7373..635fa06431 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 AX_DLL Application : public ApplicationProtocol +class CC_DLL Application : public ApplicationProtocol { public: /** diff --git a/core/platform/mac/CCDevice-mac.mm b/core/platform/mac/CCDevice-mac.mm index 3f59fcd85e..2458a0d452 100644 --- a/core/platform/mac/CCDevice-mac.mm +++ b/core/platform/mac/CCDevice-mac.mm @@ -287,10 +287,10 @@ static bool _initWithString(const char* text, do { NSString* string = [NSString stringWithUTF8String:text]; - AX_BREAK_IF(!string); + CC_BREAK_IF(!string); id font = _createSystemFont(fontName, size); - AX_BREAK_IF(!font); + CC_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 - AX_BREAK_IF(realDimensions.width <= 0 || realDimensions.height <= 0); + CC_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 5a932ef8ed..91a7e42189 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 AX_TARGET_PLATFORM == AX_PLATFORM_MAC +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC # import # import # import -# define AX_GL_DEPTH24_STENCIL8 -1 +# define CC_GL_DEPTH24_STENCIL8 -1 # define glDeleteVertexArrays glDeleteVertexArraysAPPLE # define glGenVertexArrays glGenVertexArraysAPPLE @@ -109,4 +109,4 @@ THE SOFTWARE. #endif // __PLATFORM_MAC_CCGL_H__ -#endif // s AX_TARGET_PLATFORM == AX_PLATFORM_MAC +#endif // s CC_TARGET_PLATFORM == CC_PLATFORM_MAC diff --git a/core/platform/mac/CCGLViewImpl-mac.h b/core/platform/mac/CCGLViewImpl-mac.h index a59cc5bf31..b1bceb5e98 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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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 /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ +#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) NS_AX_BEGIN class GLFWEventHandler; -class AX_DLL GLViewImpl : public GLView +class CC_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 AX_ICON_SET_SUPPORT +#if CC_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 /* AX_ICON_SET_SUPPORT */ +#endif /* CC_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: - AX_DISALLOW_COPY_AND_ASSIGN(GLViewImpl); + CC_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 20c028078d..22f825d7d2 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 AX_ICON_SET_SUPPORT +#if CC_ICON_SET_SUPPORT # include "platform/CCImage.h" -#endif /* AX_ICON_SET_SUPPORT */ +#endif /* CC_ICON_SET_SUPPORT */ #include "renderer/backend/metal/DeviceMTL.h" #include "renderer/CCRenderer.h" #include "renderer/backend/metal/UtilsMTL.h" @@ -322,7 +322,7 @@ GLViewImpl* GLViewImpl::create(std::string_view viewName, bool resizable) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -334,7 +334,7 @@ GLViewImpl* GLViewImpl::createWithRect(std::string_view viewName, Rect rect, flo ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -346,7 +346,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -360,7 +360,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName, ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_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(AX_USE_METAL) +#if defined(CC_USE_METAL) // Don't create gl context. glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); #endif @@ -410,7 +410,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ size.width = static_cast(fbWidth); size.height = static_cast(fbHeight); -#if defined(AX_USE_METAL) +#if defined(CC_USE_METAL) // Initialize device. id device = MTLCreateSystemDefaultDevice(); if (!device) @@ -452,7 +452,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ rect.size.height = realH / _frameZoomFactor; } -#if defined(AX_USE_GL) +#if defined(CC_USE_GL) glfwMakeContextCurrent(_mainWindow); glfwSwapInterval(_glContextAttrs.vsync ? 1 : 0); #endif @@ -519,7 +519,7 @@ void GLViewImpl::end() void GLViewImpl::swapBuffers() { -#if defined(AX_USE_GL) +#if defined(CC_USE_GL) if (_mainWindow) glfwSwapBuffers(_mainWindow); #endif @@ -554,7 +554,7 @@ void GLViewImpl::enableRetina(bool enabled) void GLViewImpl::setIMEKeyboardState(bool /*bOpen*/) {} -#if AX_ICON_SET_SUPPORT +#if CC_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 { - AX_SAFE_DELETE(icon); + CC_SAFE_DELETE(icon); } } @@ -595,10 +595,10 @@ void GLViewImpl::setIcon(const std::vector& filelist) const GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, iconsCount, images); - AX_SAFE_DELETE_ARRAY(images); + CC_SAFE_DELETE_ARRAY(images); for (auto& icon : icons) { - AX_SAFE_DELETE(icon); + CC_SAFE_DELETE(icon); } } @@ -607,7 +607,7 @@ void GLViewImpl::setDefaultIcon() const GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, 0, nullptr); } -#endif /* AX_ICON_SET_SUPPORT */ +#endif /* CC_ICON_SET_SUPPORT */ void GLViewImpl::setCursorVisible(bool isVisible) { @@ -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 (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) // on mac window will sometimes lose title when windowed glfwSetWindowTitle(_mainWindow, _viewName.c_str()); #endif @@ -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(AX_USE_METAL) +#if defined(CC_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 41e403f93e..8681478aac 100644 --- a/core/platform/mac/CCPlatformDefine-mac.h +++ b/core/platform/mac/CCPlatformDefine-mac.h @@ -27,15 +27,15 @@ THE SOFTWARE. #include -#define AX_DLL +#define CC_DLL -#if AX_DISABLE_ASSERT > 0 -# define AX_ASSERT(cond) +#if CC_DISABLE_ASSERT > 0 +# define CC_ASSERT(cond) #else -# define AX_ASSERT(cond) assert(cond) +# define CC_ASSERT(cond) assert(cond) #endif -#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam +#define CC_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 6bb58c55ca..8bf743da57 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; - AX_ASSERT(!sm_pSharedApplication); + CC_ASSERT(!sm_pSharedApplication); sm_pSharedApplication = this; } Application::~Application() { - AX_ASSERT(this == sm_pSharedApplication); + CC_ASSERT(this == sm_pSharedApplication); sm_pSharedApplication = nullptr; } @@ -155,7 +155,7 @@ void Application::setAnimationInterval(float interval) ////////////////////////////////////////////////////////////////////////// Application* Application::getInstance() { - AX_ASSERT(sm_pSharedApplication); + CC_ASSERT(sm_pSharedApplication); return sm_pSharedApplication; } diff --git a/core/platform/win32/CCApplication-win32.h b/core/platform/win32/CCApplication-win32.h index bc2f3344c8..d31ced54f1 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 AX_DLL Application : public ApplicationProtocol +class CC_DLL Application : public ApplicationProtocol { public: /** @@ -84,13 +84,13 @@ public: * Sets the Resource root path. * @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead. */ - AX_DEPRECATED_ATTRIBUTE void setResourceRootPath(std::string_view rootResDir); + CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(std::string_view rootResDir); /** * Gets the Resource root path. * @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. */ - AX_DEPRECATED_ATTRIBUTE std::string_view getResourceRootPath(); + CC_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 f89546d4b8..e18b7eebca 100644 --- a/core/platform/win32/CCDevice-win32.cpp +++ b/core/platform/win32/CCDevice-win32.cpp @@ -143,7 +143,7 @@ public: SIZE tRet = {0}; do { - AX_BREAK_IF(!pszText || nLen <= 0); + CC_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 { - AX_BREAK_IF(!pszText); + CC_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]; - AX_BREAK_IF(!pwszBuffer); + CC_BREAK_IF(!pwszBuffer); memset(pwszBuffer, 0, sizeof(wchar_t) * nBufLen); nLen = MultiByteToWideChar(CP_UTF8, 0, pszText, nLen, pwszBuffer, nBufLen); @@ -353,7 +353,7 @@ public: } } - AX_BREAK_IF(!prepareBitmap(tSize.cx, tSize.cy)); + CC_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); - AX_SAFE_DELETE_ARRAY(pwszBuffer); + CC_SAFE_DELETE_ARRAY(pwszBuffer); delete[] fixedText; return nRet; } - AX_SYNTHESIZE_READONLY(HDC, _DC, DC); - AX_SYNTHESIZE_READONLY(HBITMAP, _bmp, Bitmap); + CC_SYNTHESIZE_READONLY(HDC, _DC, DC); + CC_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}; - AX_BREAK_IF(!dc.drawText(text, size, align, textDefinition._fontName.c_str(), (int)textDefinition._fontSize, + CC_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); - AX_BREAK_IF(!dataBuf); + CC_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); - AX_BREAK_IF(!GetDIBits(dc.getDC(), dc.getBitmap(), 0, 0, nullptr, (LPBITMAPINFO)&bi, DIB_RGB_COLORS)); + CC_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) { - AX_UNUSED_PARAM(value); + CC_UNUSED_PARAM(value); } void Device::vibrate(float duration) { - AX_UNUSED_PARAM(duration); + CC_UNUSED_PARAM(duration); } NS_AX_END diff --git a/core/platform/win32/CCFileUtils-win32.h b/core/platform/win32/CCFileUtils-win32.h index d47d1a48ca..6a248f28fe 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 AX_DLL FileUtilsWin32 : public FileUtils +class CC_DLL FileUtilsWin32 : public FileUtils { friend class FileUtils; diff --git a/core/platform/win32/CCGL-win32.h b/core/platform/win32/CCGL-win32.h index 449b3b6252..86f919dd6c 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 AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 # include "glad/glad.h" -# if defined(AX_USE_GLES) +# if defined(CC_USE_GLES) # undef GL_DEPTH_STENCIL # undef GL_DEPTH24_STENCIL8 # undef GL_UNSIGNED_INT_24_8 @@ -90,4 +90,4 @@ THE SOFTWARE. # endif -#endif // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 diff --git a/core/platform/win32/CCPlatformDefine-win32.h b/core/platform/win32/CCPlatformDefine-win32.h index e3c65800e0..1ccc2dc0cf 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(AX_STATIC) -# define AX_DLL +#if defined(CC_STATIC) +# define CC_DLL #else # if defined(_USRDLL) -# define AX_DLL __declspec(dllexport) +# define CC_DLL __declspec(dllexport) # else /* use a DLL library */ -# define AX_DLL __declspec(dllimport) +# define CC_DLL __declspec(dllimport) # endif #endif #include -#if AX_DISABLE_ASSERT > 0 -# define AX_ASSERT(cond) +#if CC_DISABLE_ASSERT > 0 +# define CC_ASSERT(cond) #else -# define AX_ASSERT(cond) assert(cond) +# define CC_ASSERT(cond) assert(cond) #endif -#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam +#define CC_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 bac118457f..ad177da6a6 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 AX_DLL gettimeofday(struct timeval*, struct timezone*); +int CC_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 cb188c58c1..7b95775d5a 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 AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#if CC_TARGET_PLATFORM == CC_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 // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #endif // _MSC_STDINT_H_ ] diff --git a/core/renderer/CCCallbackCommand.h b/core/renderer/CCCallbackCommand.h index cde6b6e29e..7b8d6c467c 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 AX_DLL CallbackCommand : public RenderCommand +class CC_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 dcf568492e..0aa10ff499 100644 --- a/core/renderer/CCColorizer.h +++ b/core/renderer/CCColorizer.h @@ -11,7 +11,7 @@ # include NS_AX_BEGIN -class AX_DLL Colorizer +class CC_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 88f0d794d3..f14c9cce2b 100644 --- a/core/renderer/CCCustomCommand.cpp +++ b/core/renderer/CCCustomCommand.cpp @@ -38,8 +38,8 @@ CustomCommand::CustomCommand() CustomCommand::~CustomCommand() { - AX_SAFE_RELEASE(_vertexBuffer); - AX_SAFE_RELEASE(_indexBuffer); + CC_SAFE_RELEASE(_vertexBuffer); + CC_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); - AX_SAFE_RETAIN(_vertexBuffer); - AX_SAFE_RETAIN(_indexBuffer); + CC_SAFE_RETAIN(_vertexBuffer); + CC_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) { - AX_SAFE_RELEASE(_vertexBuffer); + CC_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) { - AX_SAFE_RELEASE(_indexBuffer); + CC_SAFE_RELEASE(_indexBuffer); _indexFormat = format; _indexSize = computeIndexSize(); @@ -175,9 +175,9 @@ void CustomCommand::setVertexBuffer(backend::Buffer* vertexBuffer) if (_vertexBuffer == vertexBuffer) return; - AX_SAFE_RELEASE(_vertexBuffer); + CC_SAFE_RELEASE(_vertexBuffer); _vertexBuffer = vertexBuffer; - AX_SAFE_RETAIN(_vertexBuffer); + CC_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; - AX_SAFE_RELEASE(_indexBuffer); + CC_SAFE_RELEASE(_indexBuffer); _indexBuffer = indexBuffer; - AX_SAFE_RETAIN(_indexBuffer); + CC_SAFE_RETAIN(_indexBuffer); _indexFormat = format; _indexSize = computeIndexSize(); diff --git a/core/renderer/CCCustomCommand.h b/core/renderer/CCCustomCommand.h index ef67cf6b18..a9169df0f0 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 AX_DLL CustomCommand : public RenderCommand +class CC_DLL CustomCommand : public RenderCommand { public: enum class DrawType diff --git a/core/renderer/CCGroupCommand.h b/core/renderer/CCGroupCommand.h index d767bdaad5..92578b9f90 100644 --- a/core/renderer/CCGroupCommand.h +++ b/core/renderer/CCGroupCommand.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef _AX_GROUPCOMMAND_H_ -#define _AX_GROUPCOMMAND_H_ +#ifndef _CC_GROUPCOMMAND_H_ +#define _CC_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 AX_DLL GroupCommand : public RenderCommand +class CC_DLL GroupCommand : public RenderCommand { public: /**@{ @@ -85,4 +85,4 @@ NS_AX_END end of support group @} */ -#endif //_AX_GROUPCOMMAND_H_ +#endif //_CC_GROUPCOMMAND_H_ diff --git a/core/renderer/CCMaterial.cpp b/core/renderer/CCMaterial.cpp index 9e17fca1d1..0cb537791a 100644 --- a/core/renderer/CCMaterial.cpp +++ b/core/renderer/CCMaterial.cpp @@ -40,7 +40,7 @@ #include -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) # define strcasecmp _stricmp #endif @@ -138,7 +138,7 @@ bool Material::initWithFile(std::string_view validfilename) // get the first material parseProperties((strlen(properties->getNamespace()) > 0) ? properties : properties->getNextNamespace()); - AX_SAFE_DELETE(properties); + CC_SAFE_DELETE(properties); return true; } @@ -408,8 +408,8 @@ bool Material::parseShader(Pass* pass, Properties* shaderProperties) } space = shaderProperties->getNextNamespace(); } - AX_SAFE_RELEASE(program); - AX_SAFE_RELEASE(programState); + CC_SAFE_RELEASE(program); + CC_SAFE_RELEASE(programState); } return true; @@ -554,7 +554,7 @@ Technique* Material::getTechniqueByName(std::string_view name) Technique* Material::getTechniqueByIndex(ssize_t index) { - AX_ASSERT(index >= 0 && index < _techniques.size() && "Invalid size"); + CC_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 95505e8d8c..2908d341fa 100644 --- a/core/renderer/CCMaterial.h +++ b/core/renderer/CCMaterial.h @@ -58,7 +58,7 @@ class ProgramState; } /// Material -class AX_DLL Material : public Ref +class CC_DLL Material : public Ref { friend class Node; friend class Technique; diff --git a/core/renderer/CCMeshCommand.cpp b/core/renderer/CCMeshCommand.cpp index 145e309d7a..3cfe278a70 100644 --- a/core/renderer/CCMeshCommand.cpp +++ b/core/renderer/CCMeshCommand.cpp @@ -44,16 +44,16 @@ NS_AX_BEGIN MeshCommand::MeshCommand() -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA : _rendererRecreatedListener(nullptr) #endif { _type = RenderCommand::Type::MESH_COMMAND; _is3D = true; -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // listen the event that renderer was recreated on Android/WP8 _rendererRecreatedListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, - AX_CALLBACK_1(MeshCommand::listenRendererRecreated, this)); + CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_rendererRecreatedListener); #endif } -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA void MeshCommand::listenRendererRecreated(EventCustom* event) {} #endif diff --git a/core/renderer/CCMeshCommand.h b/core/renderer/CCMeshCommand.h index 6c912a2824..ce78a53ed5 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 AX_DLL MeshCommand : public CustomCommand +class CC_DLL MeshCommand : public CustomCommand { public: // using PrimitiveType = backend::PrimitiveType; @@ -73,12 +73,12 @@ public: void init(float globalZOrder, const Mat4& transform); -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA void listenRendererRecreated(EventCustom* event); #endif protected: -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _rendererRecreatedListener; #endif }; diff --git a/core/renderer/CCPass.cpp b/core/renderer/CCPass.cpp index 6a2137071d..b3c27d98ff 100644 --- a/core/renderer/CCPass.cpp +++ b/core/renderer/CCPass.cpp @@ -70,7 +70,7 @@ Pass* Pass::create(Technique* technique) pass->autorelease(); return pass; } - AX_SAFE_DELETE(pass); + CC_SAFE_DELETE(pass); return nullptr; } @@ -82,7 +82,7 @@ Pass* Pass::createWithProgramState(Technique* technique, backend::ProgramState* pass->autorelease(); return pass; } - AX_SAFE_DELETE(pass); + CC_SAFE_DELETE(pass); return nullptr; } @@ -103,8 +103,8 @@ Pass::Pass() {} Pass::~Pass() { - AX_SAFE_RELEASE(_vertexAttribBinding); - AX_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_vertexAttribBinding); + CC_SAFE_RELEASE(_programState); } Pass* Pass::clone() const @@ -115,7 +115,7 @@ Pass* Pass::clone() const pass->setProgramState(_programState->clone()); pass->_vertexAttribBinding = _vertexAttribBinding; - AX_SAFE_RETAIN(pass->_vertexAttribBinding); + CC_SAFE_RETAIN(pass->_vertexAttribBinding); pass->setTechnique(_technique); @@ -133,9 +133,9 @@ void Pass::setProgramState(backend::ProgramState* programState) { if (_programState != programState) { - AX_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_programState); _programState = programState; - AX_SAFE_RETAIN(_programState); + CC_SAFE_RETAIN(_programState); initUniformLocations(); _hashDirty = true; } @@ -183,8 +183,8 @@ void Pass::draw(MeshCommand* meshCommand, const Mat4& modelView) { - meshCommand->setBeforeCallback(AX_CALLBACK_0(Pass::onBeforeVisitCmd, this, meshCommand)); - meshCommand->setAfterCallback(AX_CALLBACK_0(Pass::onAfterVisitCmd, this, meshCommand)); + meshCommand->setBeforeCallback(CC_CALLBACK_0(Pass::onBeforeVisitCmd, this, meshCommand)); + meshCommand->setAfterCallback(CC_CALLBACK_0(Pass::onAfterVisitCmd, this, meshCommand)); meshCommand->init(globalZOrder, modelView); meshCommand->setPrimitiveType(primitive); meshCommand->setIndexBuffer(indexBuffer, indexFormat); @@ -263,9 +263,9 @@ void Pass::setVertexAttribBinding(VertexAttribBinding* binding) { if (_vertexAttribBinding != binding) { - AX_SAFE_RELEASE(_vertexAttribBinding); + CC_SAFE_RELEASE(_vertexAttribBinding); _vertexAttribBinding = binding; - AX_SAFE_RETAIN(_vertexAttribBinding); + CC_SAFE_RETAIN(_vertexAttribBinding); } } diff --git a/core/renderer/CCPass.h b/core/renderer/CCPass.h index 1c8ee68000..26963d9974 100644 --- a/core/renderer/CCPass.h +++ b/core/renderer/CCPass.h @@ -51,7 +51,7 @@ class ProgramState; class Buffer; } // namespace backend -class AX_DLL Pass : public Ref +class CC_DLL Pass : public Ref { friend class Material; friend class Technique; diff --git a/core/renderer/CCPipelineDescriptor.h b/core/renderer/CCPipelineDescriptor.h index 92a109eecc..8b24a2cec0 100644 --- a/core/renderer/CCPipelineDescriptor.h +++ b/core/renderer/CCPipelineDescriptor.h @@ -38,7 +38,7 @@ */ NS_AX_BEGIN -struct AX_DLL PipelineDescriptor +struct CC_DLL PipelineDescriptor { backend::ProgramState* programState = nullptr; backend::BlendDescriptor blendDescriptor; diff --git a/core/renderer/CCQuadCommand.cpp b/core/renderer/CCQuadCommand.cpp index 60433a394e..3442c1095f 100644 --- a/core/renderer/CCQuadCommand.cpp +++ b/core/renderer/CCQuadCommand.cpp @@ -43,7 +43,7 @@ QuadCommand::~QuadCommand() { for (auto& indices : _ownedIndices) { - AX_SAFE_DELETE_ARRAY(indices); + CC_SAFE_DELETE_ARRAY(indices); } } diff --git a/core/renderer/CCQuadCommand.h b/core/renderer/CCQuadCommand.h index dd33a45eb6..ec36111b35 100644 --- a/core/renderer/CCQuadCommand.h +++ b/core/renderer/CCQuadCommand.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef _AX_QUADCOMMAND_H_ -#define _AX_QUADCOMMAND_H_ +#ifndef _CC_QUADCOMMAND_H_ +#define _CC_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 AX_DLL QuadCommand : public TrianglesCommand +class CC_DLL QuadCommand : public TrianglesCommand { public: /**Constructor.*/ @@ -84,4 +84,4 @@ NS_AX_END end of support group @} */ -#endif //_AX_QUADCOMMAND_H_ +#endif //_CC_QUADCOMMAND_H_ diff --git a/core/renderer/CCRenderCommand.h b/core/renderer/CCRenderCommand.h index be72676521..7804bb1fbc 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 AX_DLL RenderCommand +class CC_DLL RenderCommand { public: /**Enum the type of render command. */ diff --git a/core/renderer/CCRenderCommandPool.h b/core/renderer/CCRenderCommandPool.h index 599c168934..17474a772d 100644 --- a/core/renderer/CCRenderCommandPool.h +++ b/core/renderer/CCRenderCommandPool.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_RENDERCOMMANDPOOL_H__ -#define __AX_RENDERCOMMANDPOOL_H__ +#ifndef __CC_RENDERCOMMANDPOOL_H__ +#define __CC_RENDERCOMMANDPOOL_H__ /// @cond DO_NOT_SHOW #include diff --git a/core/renderer/CCRenderState.cpp b/core/renderer/CCRenderState.cpp index e5a6f3c866..cb34e99396 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) { - AX_ASSERT(pass); + CC_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) { - // AX_ASSERT(_globalState); + // CC_ASSERT(_globalState); auto renderer = Director::getInstance()->getRenderer(); auto& blend = pipelineDescriptor->blendDescriptor; diff --git a/core/renderer/CCRenderState.h b/core/renderer/CCRenderState.h index e2f2c09214..1a36017f33 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 AX_DLL RenderState : public Ref +class CC_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 AX_DLL StateBlock // : public Ref + class CC_DLL StateBlock // : public Ref { friend class RenderState; friend class Pass; diff --git a/core/renderer/CCRenderer.cpp b/core/renderer/CCRenderer.cpp index 875de6bf89..e8ba9d3197 100644 --- a/core/renderer/CCRenderer.cpp +++ b/core/renderer/CCRenderer.cpp @@ -185,11 +185,11 @@ Renderer::~Renderer() free(_triBatchesToDraw); - AX_SAFE_RELEASE(_depthStencilState); - AX_SAFE_RELEASE(_commandBuffer); - AX_SAFE_RELEASE(_renderPipeline); - AX_SAFE_RELEASE(_defaultRT); - AX_SAFE_RELEASE(_offscreenRT); + CC_SAFE_RELEASE(_depthStencilState); + CC_SAFE_RELEASE(_commandBuffer); + CC_SAFE_RELEASE(_renderPipeline); + CC_SAFE_RELEASE(_defaultRT); + CC_SAFE_RELEASE(_offscreenRT); } void Renderer::init() @@ -298,7 +298,7 @@ void Renderer::processRenderCommand(RenderCommand* command) drawBatchedTriangles(); _queuedTotalIndexCount = _queuedTotalVertexCount = 0; -#ifdef AX_USE_METAL +#ifdef CC_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 AX_USE_METAL +#ifdef CC_USE_METAL _queuedIndexCount += cmd->getIndexCount(); _queuedVertexCount += cmd->getVertexCount(); #endif @@ -408,7 +408,7 @@ void Renderer::endFrame() { _commandBuffer->endFrame(); -#ifdef AX_USE_METAL +#ifdef CC_USE_METAL _triangleCommandBufferManager.putbackAllBuffers(); _vertexBuffer = _triangleCommandBufferManager.getVertexBuffer(); _indexBuffer = _triangleCommandBufferManager.getIndexBuffer(); @@ -609,7 +609,7 @@ void Renderer::drawBatchedTriangles() return; /************** 1: Setup up vertices/indices *************/ -#ifdef AX_USE_METAL +#ifdef CC_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)) { - AX_ASSERT((firstCommand || _triBatchesToDraw[batchesTotal].cmd->getMaterialID() == cmd->getMaterialID()) && + CC_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 AX_USE_METAL +#ifdef CC_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 AX_USE_METAL +#ifdef CC_USE_METAL _queuedIndexCount = 0; _queuedVertexCount = 0; #endif @@ -975,7 +975,7 @@ void Renderer::TriangleCommandBufferManager::createBuffer() { auto device = backend::Device::getInstance(); -#ifdef AX_USE_METAL +#ifdef CC_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 0162654ab9..8f479cfa7d 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 AX_DLL Renderer +class CC_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 4e0620839d..35d3d30a47 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 { - AX_ASSERT(index >= 0 && index < _passes.size() && "Invalid index"); + CC_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 e7c8cb0cbd..8b4dbd6b99 100644 --- a/core/renderer/CCTechnique.h +++ b/core/renderer/CCTechnique.h @@ -46,7 +46,7 @@ class ProgramState; } /// Technique -class AX_DLL Technique : public Ref +class CC_DLL Technique : public Ref { friend class Material; friend class Renderer; diff --git a/core/renderer/CCTexture2D.cpp b/core/renderer/CCTexture2D.cpp index f1e2b78007..f9c206e2b3 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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA # include "renderer/CCTextureCache.h" #endif @@ -80,15 +80,15 @@ Texture2D::Texture2D() Texture2D::~Texture2D() { -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA VolatileTextureMgr::removeTexture(this); #endif CCLOGINFO("deallocing Texture2D: %p - id=%u", this, _name); - AX_SAFE_DELETE(_ninePatchInfo); + CC_SAFE_DELETE(_ninePatchInfo); - AX_SAFE_RELEASE(_texture); - AX_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_texture); + CC_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 / AX_CONTENT_SCALE_FACTOR(); - ret.height = _contentSize.height / AX_CONTENT_SCALE_FACTOR(); + ret.width = _contentSize.width / CC_CONTENT_SCALE_FACTOR(); + ret.height = _contentSize.height / CC_CONTENT_SCALE_FACTOR(); return ret; } @@ -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 AX_USE_METAL +#ifdef CC_USE_METAL //! override renderFormat, since some render format is not supported by metal switch (renderFormat) { -# if (AX_TARGET_PLATFORM != AX_PLATFORM_IOS || TARGET_OS_SIMULATOR) +# if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS || TARGET_OS_SIMULATOR) // packed 16 bits pixels only available on iOS case PixelFormat::RGB565: case PixelFormat::RGB5A1: @@ -308,7 +308,7 @@ bool Texture2D::updateWithMipmaps(MipmapInfo* mipmaps, if (!pfd.bpp) { CCLOG("cocos2d: WARNING: unsupported pixelformat: %x", (uint32_t)pixelFormat); -#ifdef AX_USE_METAL +#ifdef CC_USE_METAL CCASSERT(false, "pixeformat not found in _pixelFormatInfoTables, register required!"); #endif return false; @@ -324,7 +324,7 @@ bool Texture2D::updateWithMipmaps(MipmapInfo* mipmaps, return false; } -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA VolatileTextureMgr::findVolotileTexture(this); #endif @@ -361,7 +361,7 @@ bool Texture2D::updateWithMipmaps(MipmapInfo* mipmaps, { auto convertedFormat = backend::PixelFormatUtils::convertDataToFormat(data, dataLen, oriPixelFormat, renderFormat, &outData, &outDataLen); -#ifdef AX_USE_METAL +#ifdef CC_USE_METAL CCASSERT(convertedFormat == renderFormat, "PixelFormat convert failed!"); #endif if (convertedFormat == renderFormat) @@ -487,7 +487,7 @@ bool Texture2D::initWithString(const char* text, const FontDefinition& textDefin if (!text || !(*text)) return false; -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // cache the texture data VolatileTextureMgr::addStringTexture(this, text, textDefinition); #endif @@ -519,7 +519,7 @@ bool Texture2D::initWithString(const char* text, const FontDefinition& textDefin return false; } -#if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) && (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) CCASSERT(textDefinition._stroke._strokeEnabled == false, "Currently stroke only supported on iOS and Android!"); #endif @@ -530,7 +530,7 @@ bool Texture2D::initWithString(const char* text, const FontDefinition& textDefin int imageWidth; int imageHeight; auto textDef = textDefinition; - auto contentScaleFactor = AX_CONTENT_SCALE_FACTOR(); + auto contentScaleFactor = CC_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) { - AX_ASSERT(_texture); + CC_ASSERT(_texture); _texture->updateTextureDescriptor(descriptor); _pixelsWide = _contentSize.width = _texture->getWidth(); diff --git a/core/renderer/CCTexture2D.h b/core/renderer/CCTexture2D.h index 6ad6461337..f8fcd106c8 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 AX_DLL Texture2D : public Ref +class CC_DLL Texture2D : public Ref { public: struct PixelFormatInfo diff --git a/core/renderer/CCTextureAtlas.cpp b/core/renderer/CCTextureAtlas.cpp index 96dfdc64ee..a32d30da72 100644 --- a/core/renderer/CCTextureAtlas.cpp +++ b/core/renderer/CCTextureAtlas.cpp @@ -53,12 +53,12 @@ TextureAtlas::~TextureAtlas() { CCLOGINFO("deallocing TextureAtlas: %p", this); - AX_SAFE_FREE(_quads); - AX_SAFE_FREE(_indices); + CC_SAFE_FREE(_quads); + CC_SAFE_FREE(_indices); - AX_SAFE_RELEASE(_texture); + CC_SAFE_RELEASE(_texture); -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_rendererRecreatedListener); #endif } @@ -80,8 +80,8 @@ Texture2D* TextureAtlas::getTexture() const void TextureAtlas::setTexture(Texture2D* var) { - AX_SAFE_RETAIN(var); - AX_SAFE_RELEASE(_texture); + CC_SAFE_RETAIN(var); + CC_SAFE_RELEASE(_texture); _texture = var; } @@ -107,7 +107,7 @@ TextureAtlas* TextureAtlas::create(std::string_view file, ssize_t capacity) textureAtlas->autorelease(); return textureAtlas; } - AX_SAFE_DELETE(textureAtlas); + CC_SAFE_DELETE(textureAtlas); return nullptr; } @@ -119,7 +119,7 @@ TextureAtlas* TextureAtlas::createWithTexture(Texture2D* texture, ssize_t capaci textureAtlas->autorelease(); return textureAtlas; } - AX_SAFE_DELETE(textureAtlas); + CC_SAFE_DELETE(textureAtlas); return nullptr; } @@ -149,7 +149,7 @@ bool TextureAtlas::initWithTexture(Texture2D* texture, ssize_t capacity) // retained in property this->_texture = texture; - AX_SAFE_RETAIN(_texture); + CC_SAFE_RETAIN(_texture); // Re-initialization is not allowed CCASSERT(_quads == nullptr && _indices == nullptr, "_quads and _indices should be nullptr."); @@ -160,12 +160,12 @@ bool TextureAtlas::initWithTexture(Texture2D* texture, ssize_t capacity) if (!(_quads && _indices) && _capacity > 0) { // CCLOG("cocos2d: TextureAtlas: not enough memory"); - AX_SAFE_FREE(_quads); - AX_SAFE_FREE(_indices); + CC_SAFE_FREE(_quads); + CC_SAFE_FREE(_indices); // release texture, should set it to null, because the destruction will // release it too. see cocos2d-x issue #484 - AX_SAFE_RELEASE_NULL(_texture); + CC_SAFE_RELEASE_NULL(_texture); return false; } @@ -399,10 +399,10 @@ bool TextureAtlas::resizeCapacity(ssize_t newCapacity) if (!(tmpQuads && tmpIndices)) { CCLOG("cocos2d: TextureAtlas: not enough memory"); - AX_SAFE_FREE(tmpQuads); - AX_SAFE_FREE(tmpIndices); - AX_SAFE_FREE(_quads); - AX_SAFE_FREE(_indices); + CC_SAFE_FREE(tmpQuads); + CC_SAFE_FREE(tmpIndices); + CC_SAFE_FREE(_quads); + CC_SAFE_FREE(_indices); _capacity = _totalQuads = 0; return false; } diff --git a/core/renderer/CCTextureAtlas.h b/core/renderer/CCTextureAtlas.h index c7eb69e055..971353e03e 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 AX_DLL TextureAtlas : public Ref +class CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _rendererRecreatedListener = nullptr; #endif }; diff --git a/core/renderer/CCTextureCache.cpp b/core/renderer/CCTextureCache.cpp index cbf6aad4dc..1fa66a7573 100644 --- a/core/renderer/CCTextureCache.cpp +++ b/core/renderer/CCTextureCache.cpp @@ -72,7 +72,7 @@ TextureCache::~TextureCache() for (auto& texture : _textures) texture.second->release(); - AX_SAFE_DELETE(_loadingThread); + CC_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(AX_SCHEDULE_SELECTOR(TextureCache::addImageAsyncCallBack), + Director::getInstance()->getScheduler()->schedule(CC_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 - AX_ASSERT(asyncStruct == _asyncStructQueue.front()); + CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // cache the texture file name VolatileTextureMgr::addImageTexture(texture, asyncStruct->filename); #endif @@ -379,7 +379,7 @@ void TextureCache::addImageAsyncCallBack(float /*dt*/) if (0 == _asyncRefCount) { - Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(TextureCache::addImageAsyncCallBack), + Director::getInstance()->getScheduler()->unschedule(CC_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); - AX_BREAK_IF(!bRet); + CC_BREAK_IF(!bRet); texture = new Texture2D(); if (texture->initWithImage(image, format)) { -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // cache the texture file name VolatileTextureMgr::addImageTexture(texture, fullpath); #endif @@ -446,13 +446,13 @@ Texture2D* TextureCache::addImage(std::string_view path, PixelFormat format) else { CCLOG("cocos2d: Couldn't create texture for file:%s in TextureCache", path.data()); - AX_SAFE_RELEASE(texture); + CC_SAFE_RELEASE(texture); texture = nullptr; } } while (0); } - AX_SAFE_RELEASE(image); + CC_SAFE_RELEASE(image); return texture; } @@ -495,14 +495,14 @@ Texture2D* TextureCache::addImage(Image* image, std::string_view key, PixelForma } else { - AX_SAFE_RELEASE(texture); + CC_SAFE_RELEASE(texture); texture = nullptr; CCLOG("cocos2d: initWithImage failed!"); } } while (0); -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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); - AX_BREAK_IF(!bRet); + CC_BREAK_IF(!bRet); ret = texture->initWithImage(&image); } while (0); @@ -712,7 +712,7 @@ void TextureCache::renameTextureWithKey(std::string_view srcName, std::string_vi } } -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA std::list VolatileTextureMgr::_textures; bool VolatileTextureMgr::_isReloading = false; @@ -729,7 +729,7 @@ VolatileTexture::VolatileTexture(Texture2D* t) VolatileTexture::~VolatileTexture() { - AX_SAFE_RELEASE(_uiImage); + CC_SAFE_RELEASE(_uiImage); } void VolatileTextureMgr::addImageTexture(Texture2D* tt, std::string_view imageFileName) @@ -886,9 +886,9 @@ void VolatileTextureMgr::reloadTexture(Texture2D* texture, std::string_view file if (image->initWithImageData(data.getBytes(), data.getSize())) texture->initWithImage(image, pixelFormat); - AX_SAFE_DELETE(image); + CC_SAFE_DELETE(image); } -#endif // AX_ENABLE_CACHE_TEXTURE_DATA +#endif // CC_ENABLE_CACHE_TEXTURE_DATA NS_AX_END diff --git a/core/renderer/CCTextureCache.h b/core/renderer/CCTextureCache.h index c0f31d3e2b..a8db9976b2 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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_DLL TextureCache : public Ref +class CC_DLL TextureCache : public Ref { public: // ETC1 ALPHA supports. @@ -235,7 +235,7 @@ protected: static std::string s_etc1AlphaFileSuffix; }; -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA class VolatileTexture { @@ -275,7 +275,7 @@ protected: FontDefinition _fontDefinition; }; -class AX_DLL VolatileTextureMgr +class CC_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 c22c58f6ee..7a80f4ed14 100644 --- a/core/renderer/CCTextureCube.cpp +++ b/core/renderer/CCTextureCube.cpp @@ -149,7 +149,7 @@ TextureCube::TextureCube() TextureCube::~TextureCube() { - AX_SAFE_RELEASE_NULL(_texture); + CC_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; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -256,7 +256,7 @@ bool TextureCube::init(std::string_view positive_x, for (auto img : images) { - AX_SAFE_RELEASE(img); + CC_SAFE_RELEASE(img); } return true; diff --git a/core/renderer/CCTextureCube.h b/core/renderer/CCTextureCube.h index fc4b439d31..dc29227cdf 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 AX_DLL TextureCube : public Ref +class CC_DLL TextureCube : public Ref { public: /** create cube texture from 6 textures. diff --git a/core/renderer/CCTrianglesCommand.h b/core/renderer/CCTrianglesCommand.h index 6bd790faae..d26052dea9 100644 --- a/core/renderer/CCTrianglesCommand.h +++ b/core/renderer/CCTrianglesCommand.h @@ -46,7 +46,7 @@ class Program; class Texture2D; -class AX_DLL TrianglesCommand : public RenderCommand +class CC_DLL TrianglesCommand : public RenderCommand { public: /**The structure of Triangles. */ diff --git a/core/renderer/backend/Device.h b/core/renderer/backend/Device.h index 8a8a05852f..a8cff2254a 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 AX_DLL Device : public axis::Ref +class CC_DLL Device : public axis::Ref { public: friend class ProgramCache; diff --git a/core/renderer/backend/Enums.h b/core/renderer/backend/Enums.h index 8c67b16c33..d656ad61b7 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 }; -AX_ENABLE_BITMASK_OPS(ColorWriteMask) -AX_ENABLE_BITSHIFT_OPS(ColorWriteMask) +CC_ENABLE_BITMASK_OPS(ColorWriteMask) +CC_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. }; -AX_ENABLE_BITMASK_OPS(TargetBufferFlags) +CC_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, }; -AX_ENABLE_BITMASK_OPS(DepthStencilFlags) -AX_ENABLE_BITSHIFT_OPS(DepthStencilFlags) +CC_ENABLE_BITMASK_OPS(DepthStencilFlags) +CC_ENABLE_BITSHIFT_OPS(DepthStencilFlags) enum class CullMode : uint32_t { diff --git a/core/renderer/backend/Macros.h b/core/renderer/backend/Macros.h index b39c39dbef..a82235311e 100644 --- a/core/renderer/backend/Macros.h +++ b/core/renderer/backend/Macros.h @@ -38,4 +38,4 @@ #define MAX_INFLIGHT_BUFFER 3 -#define AX_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0])) +#define CC_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0])) diff --git a/core/renderer/backend/PixelFormatUtils.cpp b/core/renderer/backend/PixelFormatUtils.cpp index 6f9b4bac5c..82c670bf3e 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 (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM != CC_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(AX_ARRAYSIZE(s_pixelFormatDescriptors) == (int)PixelFormat::COUNT, +static_assert(CC_ARRAYSIZE(s_pixelFormatDescriptors) == (int)PixelFormat::COUNT, "The pixel format descriptor table incomplete!"); ////////////////////////////////////////////////////////////////////////// diff --git a/core/renderer/backend/Program.h b/core/renderer/backend/Program.h index ef18a85245..0fca197332 100644 --- a/core/renderer/backend/Program.h +++ b/core/renderer/backend/Program.h @@ -46,7 +46,7 @@ class ShaderModule; /** * A program. */ -class AX_DLL Program : public Ref +class CC_DLL Program : public Ref { public: /** @@ -153,7 +153,7 @@ protected: */ Program(std::string_view vs, std::string_view fs); -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 080b3a3684..d73178e303 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()) { - AX_SAFE_DELETE(_sharedProgramCache); + CC_SAFE_DELETE(_sharedProgramCache); } } return _sharedProgramCache; @@ -66,14 +66,14 @@ ProgramCache* ProgramCache::getInstance() void ProgramCache::destroyInstance() { - AX_SAFE_RELEASE_NULL(_sharedProgramCache); + CC_SAFE_RELEASE_NULL(_sharedProgramCache); } ProgramCache::~ProgramCache() { for (auto& program : _cachedPrograms) { - AX_SAFE_RELEASE(program.second); + CC_SAFE_RELEASE(program.second); } CCLOGINFO("deallocing ProgramCache: %p", this); ShaderCache::destroyInstance(); diff --git a/core/renderer/backend/ProgramState.cpp b/core/renderer/backend/ProgramState.cpp index 267ac6e688..ffe359731d 100644 --- a/core/renderer/backend/ProgramState.cpp +++ b/core/renderer/backend/ProgramState.cpp @@ -35,7 +35,7 @@ #include "xxhash.h" -#ifdef AX_USE_METAL +#ifdef CC_USE_METAL # include "glsl_optimizer.h" #endif @@ -125,13 +125,13 @@ TextureInfo::~TextureInfo() void TextureInfo::retainTextures() { for (auto& texture : textures) - AX_SAFE_RETAIN(texture); + CC_SAFE_RETAIN(texture); } void TextureInfo::releaseTextures() { for (auto& texture : textures) - AX_SAFE_RELEASE(texture); + CC_SAFE_RELEASE(texture); textures.clear(); } @@ -158,7 +158,7 @@ void TextureInfo::assign(const TextureInfo& other) textures = other.textures; retainTextures(); -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA location = other.location; other.location = -1; #endif @@ -189,19 +189,19 @@ ProgramState::ProgramState(Program* program) bool ProgramState::init(Program* program) { - AX_SAFE_RETAIN(program); + CC_SAFE_RETAIN(program); _program = program; _vertexUniformBufferSize = _program->getUniformBufferSize(ShaderStage::VERTEX); _vertexUniformBuffer = (char*)calloc(1, _vertexUniformBufferSize); -#ifdef AX_USE_METAL +#ifdef CC_USE_METAL _fragmentUniformBufferSize = _program->getUniformBufferSize(ShaderStage::FRAGMENT); _fragmentUniformBuffer = (char*)calloc(1, _fragmentUniformBufferSize); #endif -#ifdef AX_USE_METAL +#ifdef CC_USE_METAL _uniformHashState = XXH32_createState(); #endif -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA if (_program == nullptr) return; @@ -232,14 +232,14 @@ void ProgramState::resetUniforms() ProgramState::~ProgramState() { -#ifdef AX_USE_METAL +#ifdef CC_USE_METAL XXH32_freeState(_uniformHashState); #endif - AX_SAFE_RELEASE(_program); - AX_SAFE_FREE(_vertexUniformBuffer); - AX_SAFE_FREE(_fragmentUniformBuffer); + CC_SAFE_RELEASE(_program); + CC_SAFE_FREE(_vertexUniformBuffer); + CC_SAFE_FREE(_fragmentUniformBuffer); -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_USE_METAL +#ifdef CC_USE_METAL memcpy(cp->_fragmentUniformBuffer, _fragmentUniformBuffer, _fragmentUniformBufferSize); #endif cp->_uniformID = _uniformID; @@ -292,7 +292,7 @@ void ProgramState::setUniform(const backend::UniformLocation& uniformLocation, c } } -#ifdef AX_USE_METAL +#ifdef CC_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: - AX_ASSERT(false); + CC_ASSERT(false); break; } memcpy((char*)buffer + uniformInfo.location, convertedData, uniformInfo.size); - AX_SAFE_DELETE_ARRAY(convertedData); + CC_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 AX_USE_METAL +#ifdef CC_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 AX_USE_METAL +#ifdef CC_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 AX_USE_METAL +#ifdef CC_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 < AX_META_TEXTURES; ++slot) + for (int slot = 0; slot < texture->getCount() && slot < CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA info.location = location; #endif } diff --git a/core/renderer/backend/ProgramState.h b/core/renderer/backend/ProgramState.h index e3af9e3cf0..f054f5e281 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 AX_USE_METAL +#ifdef CC_USE_METAL struct XXH32_state_s; #endif @@ -54,7 +54,7 @@ class VertexLayout; /** * Store texture information. */ -struct AX_DLL TextureInfo +struct CC_DLL TextureInfo { TextureInfo(std::vector&& _slots, std::vector&& _textures); TextureInfo(std::vector&& _slots, @@ -78,7 +78,7 @@ struct AX_DLL TextureInfo std::vector slots; std::vector indexs; std::vector textures; -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA int location = -1; #endif }; @@ -87,7 +87,7 @@ struct AX_DLL TextureInfo * A program state object can create or reuse a program. * Each program state object keep its own unifroms and textures data. */ -class AX_DLL ProgramState : public Ref +class CC_DLL ProgramState : public Ref { public: using UniformCallback = std::function; @@ -256,7 +256,7 @@ public: * * @script{ignore} */ - class AX_DLL AutoBindingResolver + class CC_DLL AutoBindingResolver { public: AutoBindingResolver(); @@ -358,7 +358,7 @@ protected: /// Initialize. bool init(Program* program); -#ifdef AX_USE_METAL +#ifdef CC_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 AX_USE_METAL +#ifdef CC_USE_METAL struct XXH32_state_s* _uniformHashState = nullptr; #endif -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener = nullptr; #endif }; diff --git a/core/renderer/backend/ProgramStateRegistry.cpp b/core/renderer/backend/ProgramStateRegistry.cpp index 0bfbef39e5..5705da8875 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()) { - AX_SAFE_DELETE(_sharedStateRegistry); + CC_SAFE_DELETE(_sharedStateRegistry); } return _sharedStateRegistry; @@ -21,7 +21,7 @@ ProgramStateRegistry* ProgramStateRegistry::getInstance() /** purges the cache. It releases the retained instance. */ void ProgramStateRegistry::destroyInstance() { - AX_SAFE_RELEASE_NULL(_sharedStateRegistry); + CC_SAFE_RELEASE_NULL(_sharedStateRegistry); } bool ProgramStateRegistry::init() diff --git a/core/renderer/backend/RenderTarget.h b/core/renderer/backend/RenderTarget.h index e4d57ce3bc..07ae3bf108 100644 --- a/core/renderer/backend/RenderTarget.h +++ b/core/renderer/backend/RenderTarget.h @@ -21,9 +21,9 @@ public: virtual ~RenderTarget() { for (auto colorItem : _color) - AX_SAFE_RELEASE(colorItem.texture); - AX_SAFE_RELEASE(_depth.texture); - AX_SAFE_RELEASE(_stencil.texture); + CC_SAFE_RELEASE(colorItem.texture); + CC_SAFE_RELEASE(_depth.texture); + CC_SAFE_RELEASE(_stencil.texture); } bool isDefaultRenderTarget() const { return _defaultRenderTarget; } @@ -44,37 +44,37 @@ public: void setColorAttachment(ColorAttachment attachment) { for (auto colorItem : _color) - AX_SAFE_RELEASE(colorItem.texture); + CC_SAFE_RELEASE(colorItem.texture); memcpy(_color, attachment, sizeof(ColorAttachment)); for (auto colorItem : _color) - AX_SAFE_RETAIN(colorItem.texture); + CC_SAFE_RETAIN(colorItem.texture); _dirty = true; }; void setColorAttachment(TextureBackend* attachment, int level = 0, int index = 0) { - AX_SAFE_RELEASE(_color[index].texture); + CC_SAFE_RELEASE(_color[index].texture); _color[index].texture = attachment; _color[index].level = level; - AX_SAFE_RETAIN(_color[index].texture); + CC_SAFE_RETAIN(_color[index].texture); _dirty = true; } void setDepthAttachment(TextureBackend* attachment, int level = 0) { - AX_SAFE_RELEASE(_depth.texture); + CC_SAFE_RELEASE(_depth.texture); _depth.texture = attachment; _depth.level = level; - AX_SAFE_RETAIN(_depth.texture); + CC_SAFE_RETAIN(_depth.texture); _dirty = true; }; void setStencilAttachment(TextureBackend* attachment, int level = 0) { - AX_SAFE_RELEASE(_stencil.texture); + CC_SAFE_RELEASE(_stencil.texture); _stencil.texture = attachment; _stencil.level = level; - AX_SAFE_RETAIN(_stencil.texture); + CC_SAFE_RETAIN(_stencil.texture); _dirty = true; }; diff --git a/core/renderer/backend/ShaderCache.cpp b/core/renderer/backend/ShaderCache.cpp index a84c150626..eba07ad07f 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()) { - AX_SAFE_DELETE(_sharedShaderCache); + CC_SAFE_DELETE(_sharedShaderCache); } } return _sharedShaderCache; @@ -45,14 +45,14 @@ ShaderCache* ShaderCache::getInstance() void ShaderCache::destroyInstance() { - AX_SAFE_RELEASE_NULL(_sharedShaderCache); + CC_SAFE_RELEASE_NULL(_sharedShaderCache); } ShaderCache::~ShaderCache() { for (auto& shaderModule : _cachedShaders) { - AX_SAFE_RELEASE(shaderModule.second); + CC_SAFE_RELEASE(shaderModule.second); } CCLOGINFO("deallocing ProgramCache: %p", this); } diff --git a/core/renderer/backend/ShaderCache.h b/core/renderer/backend/ShaderCache.h index 8a9e4515b7..5c22ac23e5 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 AX_DLL ShaderCache : public Ref +class CC_DLL ShaderCache : public Ref { public: /** returns the shared instance */ diff --git a/core/renderer/backend/ShaderModule.h b/core/renderer/backend/ShaderModule.h index 574b9bcb08..a36522e29d 100644 --- a/core/renderer/backend/ShaderModule.h +++ b/core/renderer/backend/ShaderModule.h @@ -62,7 +62,7 @@ enum Attribute : uint32_t /** * Create shader. */ -class AX_DLL ShaderModule : public axis::Ref +class CC_DLL ShaderModule : public axis::Ref { public: /** diff --git a/core/renderer/backend/VertexLayout.h b/core/renderer/backend/VertexLayout.h index 243e8813c0..dce25560b1 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 AX_DLL VertexLayout +class CC_DLL VertexLayout { public: struct Attribute diff --git a/core/renderer/backend/metal/CommandBufferMTL.mm b/core/renderer/backend/metal/CommandBufferMTL.mm index 1ed47f3002..8b6d78f77e 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 (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) case MTLPixelFormatDepth24Unorm_Stencil8: return byte(4); #else @@ -275,8 +275,8 @@ void CommandBufferMTL::setVertexBuffer(Buffer* buffer) void CommandBufferMTL::setProgramState(ProgramState* programState) { - AX_SAFE_RETAIN(programState); - AX_SAFE_RELEASE(_programState); + CC_SAFE_RETAIN(programState); + CC_SAFE_RELEASE(_programState); _programState = programState; } @@ -321,7 +321,7 @@ void CommandBufferMTL::readPixels(RenderTarget* rt, std::function_color[0].texture; - AX_SAFE_RETAIN(texture); + CC_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); - AX_SAFE_RELEASE(texture); + CC_SAFE_RELEASE(texture); cb.second(pixelData); } } @@ -406,7 +406,7 @@ void CommandBufferMTL::afterDraw() _mtlIndexBuffer = nullptr; } - AX_SAFE_RELEASE_NULL(_programState); + CC_SAFE_RELEASE_NULL(_programState); } void CommandBufferMTL::prepareDrawing() const @@ -569,7 +569,7 @@ void CommandBufferMTL::readPixels(id texture, destinationLevel:0 destinationOrigin:region.origin]; -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_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 a16e32b59d..50eecdb46c 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 (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_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/ProgramMTL.mm b/core/renderer/backend/metal/ProgramMTL.mm index 5ff5330dd4..4f9f284224 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))); - AX_SAFE_RETAIN(_vertexShader); - AX_SAFE_RETAIN(_fragmentShader); + CC_SAFE_RETAIN(_vertexShader); + CC_SAFE_RETAIN(_fragmentShader); } ProgramMTL::~ProgramMTL() { - AX_SAFE_RELEASE(_vertexShader); - AX_SAFE_RELEASE(_fragmentShader); + CC_SAFE_RELEASE(_vertexShader); + CC_SAFE_RELEASE(_fragmentShader); } int ProgramMTL::getAttributeLocation(Attribute name) const diff --git a/core/renderer/backend/metal/TextureMTL.h b/core/renderer/backend/metal/TextureMTL.h index a4d09bf8c8..3242519689 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, AX_META_TEXTURES + 1> _mtlTextures; + std::array, CC_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 479f88851a..0ed8f4340e 100644 --- a/core/renderer/backend/metal/TextureMTL.mm +++ b/core/renderer/backend/metal/TextureMTL.mm @@ -89,7 +89,7 @@ bool isColorRenderable(PixelFormat textureFormat) /// CLASS TextureInfoMTL id TextureInfoMTL::ensure(int index, int target) { - if (index < AX_META_TEXTURES) + if (index < CC_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 a6d9a42560..714df700c9 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 (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_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(AX_ARRAYSIZE(s_textureFormats) == (int)PixelFormat::COUNT, +static_assert(CC_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 f542bdb77c..7ed7023420 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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA - AX_SAFE_DELETE_ARRAY(_data); +#if CC_ENABLE_CACHE_TEXTURE_DATA + CC_SAFE_DELETE_ARRAY(_data); Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } void BufferGL::usingDefaultStoredData(bool needDefaultStoredData) { -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA _needDefaultStoredData = needDefaultStoredData; #endif } -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA fillBuffer(data, 0, size); #endif } @@ -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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 3c2e1b7eb3..c2062693da 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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 f1be71681a..eac9209330 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(); - AX_SAFE_RELEASE(_indexBuffer); + CC_SAFE_RELEASE(_indexBuffer); _indexBuffer = static_cast(buffer); } @@ -200,14 +200,14 @@ void CommandBufferGL::setVertexBuffer(Buffer* buffer) return; buffer->retain(); - AX_SAFE_RELEASE(_vertexBuffer); + CC_SAFE_RELEASE(_vertexBuffer); _vertexBuffer = static_cast(buffer); } void CommandBufferGL::setProgramState(ProgramState* programState) { - AX_SAFE_RETAIN(programState); - AX_SAFE_RELEASE(_programState); + CC_SAFE_RETAIN(programState); + CC_SAFE_RELEASE(_programState); _programState = programState; } @@ -234,8 +234,8 @@ void CommandBufferGL::drawElements(PrimitiveType primitiveType, void CommandBufferGL::endRenderPass() { - AX_SAFE_RELEASE_NULL(_indexBuffer); - AX_SAFE_RELEASE_NULL(_vertexBuffer); + CC_SAFE_RELEASE_NULL(_indexBuffer); + CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA location = iter.second.location; #endif int i = 0; @@ -425,7 +425,7 @@ void CommandBufferGL::setUniform(bool isArray, GLuint location, unsigned int siz void CommandBufferGL::cleanResources() { - AX_SAFE_RELEASE_NULL(_programState); + CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 && defined(GL_ES_VERSION_3_0)) || \ - (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID && defined(GL_PIXEL_PACK_BUFFER)) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(GL_ES_VERSION_3_0)) || \ + (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 && defined(GL_ES_VERSION_3_0)) || \ - (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID && defined(GL_PIXEL_PACK_BUFFER)) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(GL_ES_VERSION_3_0)) || \ + (CC_TARGET_PLATFORM == CC_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 95c68fb409..f49ff943cf 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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 3dfdcbd999..baf8b5a801 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(AX_USE_GL) +#if defined(CC_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 AX_PLATFORM_PC +#ifdef CC_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 fed49a33c9..81a5f35b97 100644 --- a/core/renderer/backend/opengl/MacrosGL.h +++ b/core/renderer/backend/opengl/MacrosGL.h @@ -59,13 +59,13 @@ * function calls. */ #if defined(NDEBUG) || (defined(__APPLE__) && !defined(DEBUG)) -# define AX_GL_ASSERT(gl_code) gl_code +# define CC_GL_ASSERT(gl_code) gl_code #else -# define AX_GL_ASSERT(gl_code) \ +# define CC_GL_ASSERT(gl_code) \ do \ { \ gl_code; \ __gl_error_code = glGetError(); \ - AX_ASSERT(__gl_error_code == GL_NO_ERROR, "Error"); \ + CC_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 618849ea38..131497787c 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(AX_USE_GLES) +#if defined(CC_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 - AX_SAFE_RETAIN(_vertexShaderModule); - AX_SAFE_RETAIN(_fragmentShaderModule); + CC_SAFE_RETAIN(_vertexShaderModule); + CC_SAFE_RETAIN(_fragmentShaderModule); compileProgram(); computeUniformInfos(); computeLocations(); -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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() { - AX_SAFE_RELEASE(_vertexShaderModule); - AX_SAFE_RELEASE(_fragmentShaderModule); + CC_SAFE_RELEASE(_vertexShaderModule); + CC_SAFE_RELEASE(_fragmentShaderModule); if (_program) glDeleteProgram(_program); -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA void ProgramGL::reloadProgram() { _activeUniformInfos.clear(); @@ -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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 59c2607631..1e521b3152 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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 5da3e075f5..e9bad70c3b 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()) { - AX_SAFE_RELEASE(_programGL); + CC_SAFE_RELEASE(_programGL); _programGL = static_cast(pipelineDescirptor.programState->getProgram()); - AX_SAFE_RETAIN(_programGL); + CC_SAFE_RETAIN(_programGL); } updateBlendState(pipelineDescirptor.blendDescriptor); @@ -74,7 +74,7 @@ void RenderPipelineGL::updateBlendState(const BlendDescriptor& descriptor) RenderPipelineGL::~RenderPipelineGL() { - AX_SAFE_RELEASE(_programGL); + CC_SAFE_RELEASE(_programGL); } NS_AX_BACKEND_END diff --git a/core/renderer/backend/opengl/RenderTargetGL.cpp b/core/renderer/backend/opengl/RenderTargetGL.cpp index b42932cf8c..9e7b44189a 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 AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX + #if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX glDrawBuffers(MAX_COLOR_ATTCHMENT, bufs); #endif CHECK_GL_ERROR_DEBUG(); diff --git a/core/renderer/backend/opengl/TextureGL.cpp b/core/renderer/backend/opengl/TextureGL.cpp index 6056eeefc0..1e6075b5d6 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 < AX_META_TEXTURES ? textures[index] : textures[0]); + glBindTexture(target, index < CC_META_TEXTURES ? textures[index] : textures[0]); } GLuint TextureInfoGL::ensure(int index, GLenum target) { - if (index >= AX_META_TEXTURES) + if (index >= CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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 39ceffece9..eb59fa87a5 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 19f48e4ce1..daa9182b93 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(AX_USE_GLES) +#if defined(CC_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(AX_ARRAYSIZE(s_textureFormats) == (int)PixelFormat::COUNT, "The OpenGL GPU texture format info table incomplete!"); +static_assert(CC_ARRAYSIZE(s_textureFormats) == (int)PixelFormat::COUNT, "The OpenGL GPU texture format info table incomplete!"); // clang-format on /* diff --git a/core/renderer/ccShaders.h b/core/renderer/ccShaders.h index b26e65f3b9..9ca49efc41 100644 --- a/core/renderer/ccShaders.h +++ b/core/renderer/ccShaders.h @@ -37,53 +37,53 @@ THE SOFTWARE. NS_AX_BEGIN -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* 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* 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* 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* CC2D_quadTexture_frag; -extern AX_DLL const char* CC2D_quadColor_frag; -extern AX_DLL const char* CC2D_quad_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* hsv_frag; -extern AX_DLL const char* dualSampler_hsv_frag; +extern CC_DLL const char* hsv_frag; +extern CC_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 acf8b0fc38..40dca1fcea 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 */ -AX_GUI_DLL const char* CocosGUIVersion(); +CC_GUI_DLL const char* CocosGUIVersion(); } // namespace ui diff --git a/core/ui/GUIDefine.h b/core/ui/GUIDefine.h index 1ae676a088..460c0874dd 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 AX_VIDEOPLAYER_DEBUG_DRAW 0 +#define CC_VIDEOPLAYER_DEBUG_DRAW 0 #define __LAYOUT_COMPONENT_NAME "__ui_layout" ///@endcond NS_AX_BEGIN -struct AX_DLL ResourceData +struct CC_DLL ResourceData { int type; std::string file; diff --git a/core/ui/GUIExport.h b/core/ui/GUIExport.h index aa8a8371fd..55e42ac99c 100644 --- a/core/ui/GUIExport.h +++ b/core/ui/GUIExport.h @@ -30,13 +30,13 @@ # include # endif -# if defined(AX_STATIC) -# define AX_GUI_DLL +# if defined(CC_STATIC) +# define CC_GUI_DLL # else # if defined(_USEGUIDLL) -# define AX_GUI_DLL __declspec(dllexport) +# define CC_GUI_DLL __declspec(dllexport) # else -# define AX_GUI_DLL __declspec(dllimport) +# define CC_GUI_DLL __declspec(dllimport) # endif # endif @@ -49,9 +49,9 @@ # endif # endif #elif defined(_SHARED_) -# define AX_GUI_DLL __attribute__((visibility("default"))) +# define CC_GUI_DLL __attribute__((visibility("default"))) #else -# define AX_GUI_DLL +# define CC_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 8f88ac2ffe..8b817171f0 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) { - AX_ASSERT(pNode); + CC_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) { - AX_ASSERT(pNode); + CC_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) { - AX_ASSERT(pNode); + CC_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) { - AX_ASSERT(pNode); + CC_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) { - AX_ASSERT(pNode); + CC_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 - AX_ASSERT(pNode); + CC_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 - AX_ASSERT(pNode); + CC_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 - AX_ASSERT(pNode); + CC_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) { - AX_ASSERT(pNode); + CC_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 - AX_ASSERT(pNode); + CC_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 - AX_ASSERT(pNode); + CC_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 - AX_ASSERT(pNode); + CC_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 - AX_ASSERT(pNode); + CC_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) { - AX_ASSERT(pNode); + CC_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) { - AX_ASSERT(pNode); + CC_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) { - AX_ASSERT(pNode); + CC_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 1215af1283..65073d2db1 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 AX_DLL LayoutHelper +struct CC_DLL LayoutHelper { static Vec2 s_designSize; @@ -222,7 +222,7 @@ struct AX_DLL LayoutHelper // @version 2 static void centerNodeX(axis::Node* pNode, const Vec2& parentSize) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -235,7 +235,7 @@ struct AX_DLL LayoutHelper static void centerNodeY(axis::Node* pNode, const Vec2& parentSize) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -248,7 +248,7 @@ struct AX_DLL LayoutHelper static void centerNode(axis::Node* pNode, const Vec2& parentSize) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achor = axis::Vec2::ZERO; @@ -375,7 +375,7 @@ struct AX_DLL LayoutHelper // @version 2 used as internal interfaces static void setNodeLeft(axis::Node* pNode, const Vec2& parentSize, float left, float anchor = 0.0f) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -387,7 +387,7 @@ struct AX_DLL LayoutHelper } static float getNodeLeft(axis::Node* pNode, const Vec2& parentSize, float anchor = 0.0f) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -400,7 +400,7 @@ struct AX_DLL LayoutHelper static void setNodeTop(axis::Node* pNode, const Vec2& parentSize, float top, float anchor = 0.0f) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -412,7 +412,7 @@ struct AX_DLL LayoutHelper } static float getNodeTop(axis::Node* pNode, const Vec2& parentSize, float anchor = 0.0f) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -425,7 +425,7 @@ struct AX_DLL LayoutHelper static void setNodeRight(axis::Node* pNode, const Vec2& parentSize, float right) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -438,7 +438,7 @@ struct AX_DLL LayoutHelper static float getNodeRight(axis::Node* pNode, const Vec2& parentSize, float anchor = 0.0f) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -451,7 +451,7 @@ struct AX_DLL LayoutHelper static void setNodeBottom(axis::Node* pNode, const Vec2& parentSize, float bottom, float anchor = 0.0f) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -464,7 +464,7 @@ struct AX_DLL LayoutHelper static float getNodeBottom(axis::Node* pNode, const Vec2& parentSize, float anchor = 0.f) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -477,7 +477,7 @@ struct AX_DLL LayoutHelper static void setNodeLB(axis::Node* pNode, const Vec2& parentSize, const axis::Point& p) { // left bottom - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achorPoint = axis::Vec2::ZERO; @@ -491,7 +491,7 @@ struct AX_DLL LayoutHelper static void setNodeRB(axis::Node* pNode, const Vec2& parentSize, const axis::Point& p) { // right bottom - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achorPoint = axis::Vec2::ZERO; @@ -505,7 +505,7 @@ struct AX_DLL LayoutHelper static void setNodeLT(axis::Node* pNode, const Vec2& parentSize, const axis::Point& p) { // left top - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achorPoint = axis::Vec2::ZERO; @@ -519,7 +519,7 @@ struct AX_DLL LayoutHelper static void setNodeRT(axis::Node* pNode, const Vec2& parentSize, const axis::Point& p) { // right top - AX_ASSERT(pNode); + CC_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achorPoint = axis::Vec2::ZERO; @@ -561,20 +561,20 @@ struct AX_DLL LayoutHelper /* set node position as normalized: @version 2 */ static void setNodeNormalizedPositionX(axis::Node* pNode, const Vec2& parentSize, float ratio) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); pNode->setPositionX(parentSize.width * ratio); } static void setNodeNormalizedPositionY(axis::Node* pNode, const Vec2& parentSize, float ratio) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); pNode->setPositionY(parentSize.height * ratio); } static void setNodeNormalizedPosition(axis::Node* pNode, const Vec2& parentSize, const axis::Point& ratio) { - AX_ASSERT(pNode); + CC_ASSERT(pNode); pNode->setPosition(axis::Point(parentSize.width * ratio.x, parentSize.height * ratio.y)); } @@ -773,7 +773,7 @@ struct AX_DLL LayoutHelper /// /// CLASS VisibleRect /// - class AX_DLL VisibleRect + class CC_DLL VisibleRect { public: static void refresh(void); diff --git a/core/ui/UIAbstractCheckButton.h b/core/ui/UIAbstractCheckButton.h index 25f8ab3c05..a77ff6cc7a 100644 --- a/core/ui/UIAbstractCheckButton.h +++ b/core/ui/UIAbstractCheckButton.h @@ -35,7 +35,7 @@ THE SOFTWARE. */ NS_AX_BEGIN class Sprite; -struct AX_DLL ResourceData; +struct CC_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 AX_GUI_DLL AbstractCheckButton : public Widget +class CC_GUI_DLL AbstractCheckButton : public Widget { public: diff --git a/core/ui/UIButton.cpp b/core/ui/UIButton.cpp index 5880455abd..f4003b9940 100644 --- a/core/ui/UIButton.cpp +++ b/core/ui/UIButton.cpp @@ -88,7 +88,7 @@ Button* Button::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -103,7 +103,7 @@ Button* Button::create(std::string_view normalImage, btn->autorelease(); return btn; } - AX_SAFE_DELETE(btn); + CC_SAFE_DELETE(btn); return nullptr; } @@ -170,9 +170,9 @@ void Button::setTitleLabel(Label* label) { if (_titleRenderer != label) { - AX_SAFE_RELEASE(_titleRenderer); + CC_SAFE_RELEASE(_titleRenderer); _titleRenderer = label; - AX_SAFE_RETAIN(_titleRenderer); + CC_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(AX_DEFAULT_FONT_LABEL_SIZE); + setTitleFontSize(CC_DEFAULT_FONT_LABEL_SIZE); } _titleRenderer->setString(text); diff --git a/core/ui/UIButton.h b/core/ui/UIButton.h index 0d4d628bcb..05e0f5f1cd 100644 --- a/core/ui/UIButton.h +++ b/core/ui/UIButton.h @@ -38,7 +38,7 @@ NS_AX_BEGIN class Label; class SpriteFrame; -struct AX_DLL ResourceData; +struct CC_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 AX_GUI_DLL Button : public Widget +class CC_GUI_DLL Button : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UICheckBox.cpp b/core/ui/UICheckBox.cpp index 7456dd120c..50d6999e42 100644 --- a/core/ui/UICheckBox.cpp +++ b/core/ui/UICheckBox.cpp @@ -44,7 +44,7 @@ CheckBox* CheckBox::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -61,7 +61,7 @@ CheckBox* CheckBox::create(std::string_view backGround, pWidget->autorelease(); return pWidget; } - AX_SAFE_DELETE(pWidget); + CC_SAFE_DELETE(pWidget); return nullptr; } @@ -73,7 +73,7 @@ CheckBox* CheckBox::create(std::string_view backGround, std::string_view cross, pWidget->autorelease(); return pWidget; } - AX_SAFE_DELETE(pWidget); + CC_SAFE_DELETE(pWidget); return nullptr; } diff --git a/core/ui/UICheckBox.h b/core/ui/UICheckBox.h index c18f1f18a0..caae7404ee 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 AX_GUI_DLL CheckBox : public AbstractCheckButton +class CC_GUI_DLL CheckBox : public AbstractCheckButton { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UIEditBox/UIEditBox.cpp b/core/ui/UIEditBox/UIEditBox.cpp index 24ef528813..e24b8703dd 100644 --- a/core/ui/UIEditBox/UIEditBox.cpp +++ b/core/ui/UIEditBox/UIEditBox.cpp @@ -45,8 +45,8 @@ EditBox::EditBox() EditBox::~EditBox() { - AX_SAFE_DELETE(_editBoxImpl); -#if AX_ENABLE_SCRIPT_BINDING + CC_SAFE_DELETE(_editBoxImpl); +#if CC_ENABLE_SCRIPT_BINDING unregisterScriptEditBoxHandler(); #endif } @@ -74,7 +74,7 @@ EditBox* EditBox::create(const Vec2& size, } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -92,7 +92,7 @@ EditBox* EditBox::create(const Vec2& size, } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; } @@ -797,8 +797,8 @@ void EditBox::onEnter() { _editBoxImpl->onEnter(); } -#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) - this->schedule(AX_SCHEDULE_SELECTOR(EditBox::updatePosition), CHECK_EDITBOX_POSITION_INTERVAL); +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) + this->schedule(CC_SCHEDULE_SELECTOR(EditBox::updatePosition), CHECK_EDITBOX_POSITION_INTERVAL); #endif } @@ -873,7 +873,7 @@ void EditBox::setGlobalZOrder(float globalZOrder) } } -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING void EditBox::registerScriptEditBoxHandler(int handler) { unregisterScriptEditBoxHandler(); diff --git a/core/ui/UIEditBox/UIEditBox.h b/core/ui/UIEditBox/UIEditBox.h index 37515e83d1..67aa27ec1e 100644 --- a/core/ui/UIEditBox/UIEditBox.h +++ b/core/ui/UIEditBox/UIEditBox.h @@ -51,7 +51,7 @@ class EditBoxImpl; * @js NA * @lua NA */ -class AX_GUI_DLL EditBoxDelegate +class CC_GUI_DLL EditBoxDelegate { public: /** @@ -100,7 +100,7 @@ public: * You can use this widget to gather small amounts of text from the user. * */ -class AX_GUI_DLL EditBox : public Widget, public IMEDelegate +class CC_GUI_DLL EditBox : public Widget, public IMEDelegate { public: /** @@ -381,7 +381,7 @@ public: */ EditBoxDelegate* getDelegate(); -#if AX_ENABLE_SCRIPT_BINDING +#if CC_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 AX_ENABLE_SCRIPT_BINDING +#endif // #if CC_ENABLE_SCRIPT_BINDING /** * Set the text entered in the edit box. @@ -706,7 +706,7 @@ protected: EditBoxDelegate* _delegate = nullptr; float _adjustHeight = 0.f; -#if AX_ENABLE_SCRIPT_BINDING +#if CC_ENABLE_SCRIPT_BINDING int _scriptEditBoxHandler = 0; #endif }; diff --git a/core/ui/UIEditBox/UIEditBoxImpl-android.cpp b/core/ui/UIEditBox/UIEditBoxImpl-android.cpp index d348b9e953..b537baa5a7 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) # include "ui/UIEditBox/UIEditBox.h" # include @@ -249,4 +249,4 @@ const char* EditBoxImplAndroid::getNativeDefaultFontName() NS_AX_END -#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) */ +#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-android.h b/core/ui/UIEditBox/UIEditBoxImpl-android.h index 562bd8fc4a..4ae9c8b3cc 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-android.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-android.h @@ -29,7 +29,7 @@ #include "platform/CCPlatformConfig.h" -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) # include "ui/UIEditBox/UIEditBoxImpl-common.h" @@ -82,6 +82,6 @@ private: NS_AX_END -#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) */ +#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) */ #endif /* __UIEDITBOXIMPLANDROID_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-common.cpp b/core/ui/UIEditBox/UIEditBoxImpl-common.cpp index 24aef5d2e5..c8203f4854 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 AX_EDIT_BOX_PADDING = 5; +static const int CC_EDIT_BOX_PADDING = 5; -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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 - AX_EDIT_BOX_PADDING * 2, sizeToCorrect.height); + return Vec2(sizeToCorrect.width - CC_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)AX_EDIT_BOX_PADDING, size.height - AX_EDIT_BOX_PADDING)); + _label->setPosition(Vec2((float)CC_EDIT_BOX_PADDING, size.height - CC_EDIT_BOX_PADDING)); _label->setVerticalAlignment(TextVAlignment::TOP); _label->enableWrap(true); - _labelPlaceHolder->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, size.height - AX_EDIT_BOX_PADDING)); + _labelPlaceHolder->setPosition(Vec2((float)CC_EDIT_BOX_PADDING, size.height - CC_EDIT_BOX_PADDING)); _labelPlaceHolder->setVerticalAlignment(TextVAlignment::TOP); } else { _label->enableWrap(false); - _label->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, size.height)); + _label->setPosition(Vec2((float)CC_EDIT_BOX_PADDING, size.height)); _label->setVerticalAlignment(TextVAlignment::CENTER); - _labelPlaceHolder->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, (size.height + placeholderSize.height) / 2)); + _labelPlaceHolder->setPosition(Vec2((float)CC_EDIT_BOX_PADDING, (size.height + placeholderSize.height) / 2)); _labelPlaceHolder->setVerticalAlignment(TextVAlignment::CENTER); } } @@ -364,7 +364,7 @@ void EditBoxImplCommon::editBoxEditingDidBegin() pDelegate->editBoxEditingDidBegin(_editBox); } -#if AX_ENABLE_SCRIPT_BINDING +#if CC_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 AX_ENABLE_SCRIPT_BINDING +#if CC_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 AX_ENABLE_SCRIPT_BINDING +#if CC_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 942b5c0a24..7831f886d1 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-common.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-common.h @@ -40,7 +40,7 @@ namespace ui class EditBox; -class AX_GUI_DLL EditBoxImplCommon : public EditBoxImpl +class CC_GUI_DLL EditBoxImplCommon : public EditBoxImpl { public: /** diff --git a/core/ui/UIEditBox/UIEditBoxImpl-ios.h b/core/ui/UIEditBox/UIEditBoxImpl-ios.h index 96717cf7d8..a8d8869506 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 (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) # include "ui/UIEditBox/UIEditBoxImpl-common.h" @@ -87,6 +87,6 @@ private: NS_AX_END -#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) */ +#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */ #endif /* __UIEditBoxIMPLIOS_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-ios.mm b/core/ui/UIEditBox/UIEditBoxImpl-ios.mm index 934f895845..d4ed934606 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 (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) # define kLabelZOrder 9999 @@ -245,4 +245,4 @@ UIFont* EditBoxImplIOS::constructFont(const char* fontName, int fontSize) NS_AX_END -#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) */ +#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-linux.cpp b/core/ui/UIEditBox/UIEditBoxImpl-linux.cpp index d9f40229c1..15d1c30405 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 (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) # include "ui/UIEditBox/UIEditBox.h" # include "2d/CCLabel.h" @@ -112,4 +112,4 @@ void EditBoxImplLinux::nativeOpenKeyboard() NS_AX_END -#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) */ +#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-linux.h b/core/ui/UIEditBox/UIEditBoxImpl-linux.h index b3dcb03c2f..643c150321 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-linux.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-linux.h @@ -29,7 +29,7 @@ #include "platform/CCPlatformConfig.h" -#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) # include "ui/UIEditBox/UIEditBoxImpl-common.h" @@ -82,6 +82,6 @@ private: NS_AX_END -#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) */ +#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) */ #endif /* __UIEDITBOXIMPLLINUX_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-mac.h b/core/ui/UIEditBox/UIEditBoxImpl-mac.h index 1fae64cc00..fedcc8bed1 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-mac.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-mac.h @@ -29,7 +29,7 @@ #include "platform/CCPlatformConfig.h" -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) # include "ui/UIEditBox/UIEditBoxImpl-common.h" @@ -86,6 +86,6 @@ private: NS_AX_END -#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) #endif /* __UIEditBoxIMPLMAC_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-mac.mm b/core/ui/UIEditBox/UIEditBoxImpl-mac.mm index 3cb0fed134..b0731d5f1f 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-mac.mm +++ b/core/ui/UIEditBox/UIEditBoxImpl-mac.mm @@ -25,7 +25,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) # include "ui/UIEditBox/UIEditBoxImpl-mac.h" # include "base/CCDirector.h" @@ -221,4 +221,4 @@ void EditBoxImplMac::nativeCloseKeyboard() NS_AX_END -#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) diff --git a/core/ui/UIEditBox/UIEditBoxImpl-stub.cpp b/core/ui/UIEditBox/UIEditBoxImpl-stub.cpp index f1ca12ca5d..5272d23752 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 (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) && (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) && \ - (AX_TARGET_PLATFORM != AX_PLATFORM_WIN32) && (AX_TARGET_PLATFORM != AX_PLATFORM_MAC) +#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) NS_AX_BEGIN diff --git a/core/ui/UIEditBox/UIEditBoxImpl-win32.cpp b/core/ui/UIEditBox/UIEditBoxImpl-win32.cpp index ba44c86764..8c83cdfa47 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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) # include "ui/UIEditBox/UIEditBox.h" # include @@ -438,4 +438,4 @@ LRESULT EditBoxImplWin::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l NS_AX_END -#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ +#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-win32.h b/core/ui/UIEditBox/UIEditBoxImpl-win32.h index c58e7adb59..a7c502b17a 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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) # include "ui/UIEditBox/UIEditBoxImpl-common.h" NS_AX_BEGIN @@ -39,7 +39,7 @@ namespace ui class EditBox; -class AX_GUI_DLL EditBoxImplWin : public EditBoxImplCommon +class CC_GUI_DLL EditBoxImplWin : public EditBoxImplCommon { public: EditBoxImplWin(EditBox* pEditText); @@ -92,6 +92,6 @@ private: NS_AX_END -#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ +#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ #endif /* __UIEditBoxIMPLWIN_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl.h b/core/ui/UIEditBox/UIEditBoxImpl.h index 10daff1f82..1cfd169956 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl.h +++ b/core/ui/UIEditBox/UIEditBoxImpl.h @@ -34,7 +34,7 @@ NS_AX_BEGIN namespace ui { -class AX_GUI_DLL EditBoxImpl +class CC_GUI_DLL EditBoxImpl { public: /** diff --git a/core/ui/UIEditBox/iOS/CCUIMultilineTextField.mm b/core/ui/UIEditBox/iOS/CCUIMultilineTextField.mm index b08185cf68..3cfb050f60 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 = AX_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); + float padding = CC_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 = AX_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); + float padding = CC_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 aae6d137c4..4f59d8e786 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 = AX_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); + float padding = CC_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 3a493c3cde..9706ad5741 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 AX_EDIT_BOX_PADDING = 5; +static const int CC_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 afbc15c87c..f68c375bb3 100644 --- a/core/ui/UIHBox.cpp +++ b/core/ui/UIHBox.cpp @@ -42,7 +42,7 @@ HBox* HBox::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -54,7 +54,7 @@ HBox* HBox::create(const Vec2& size) widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIHBox.h b/core/ui/UIHBox.h index c5fbe7a9e5..4ee6b1b014 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 AX_GUI_DLL HBox : public Layout +class CC_GUI_DLL HBox : public Layout { public: /** diff --git a/core/ui/UIHelper.h b/core/ui/UIHelper.h index 2516d2481e..c90493b93e 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 AX_GUI_DLL Helper +class CC_GUI_DLL Helper { public: /** diff --git a/core/ui/UIImageView.cpp b/core/ui/UIImageView.cpp index de5c3cc1ca..fb3cbaad0a 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; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -70,7 +70,7 @@ ImageView* ImageView::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIImageView.h b/core/ui/UIImageView.h index 61a31f474c..cd7049a3b0 100644 --- a/core/ui/UIImageView.h +++ b/core/ui/UIImageView.h @@ -35,7 +35,7 @@ THE SOFTWARE. */ NS_AX_BEGIN -struct AX_DLL ResourceData; +struct CC_DLL ResourceData; namespace ui { @@ -43,7 +43,7 @@ class Scale9Sprite; /** * @brief A widget to display images. */ -class AX_GUI_DLL ImageView : public Widget, public axis::BlendProtocol +class CC_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 89b01ae7c1..d71c364f39 100644 --- a/core/ui/UILayout.cpp +++ b/core/ui/UILayout.cpp @@ -84,8 +84,8 @@ Layout::Layout() Layout::~Layout() { - AX_SAFE_RELEASE(_clippingStencil); - AX_SAFE_DELETE(_stencilStateManager); + CC_SAFE_RELEASE(_clippingStencil); + CC_SAFE_DELETE(_stencilStateManager); } void Layout::onEnter() @@ -128,7 +128,7 @@ Layout* Layout::create() layout->autorelease(); return layout; } - AX_SAFE_DELETE(layout); + CC_SAFE_DELETE(layout); return nullptr; } @@ -139,7 +139,7 @@ bool Layout::init() ignoreContentAdaptWithSize(false); setContentSize(Vec2::ZERO); setAnchorPoint(Vec2::ZERO); - onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = CC_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 = AX_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilStateManager); + // _beforeVisitCmdStencil.func = CC_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 = AX_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilStateManager); + afterDrawStencilCmd->func = CC_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 = AX_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager); + afterVisitCmdStencil->func = CC_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 = AX_CALLBACK_0(Layout::onBeforeVisitScissor, this); + beforeVisitCmdScissor->func = CC_CALLBACK_0(Layout::onBeforeVisitScissor, this); renderer->addCommand(beforeVisitCmdScissor); ProtectedNode::visit(renderer, parentTransform, parentFlags); auto afterVisitCmdScissor = renderer->nextCallbackCommand(); afterVisitCmdScissor->init(_globalZOrder); - afterVisitCmdScissor->func = AX_CALLBACK_0(Layout::onAfterVisitScissor, this); + afterVisitCmdScissor->func = CC_CALLBACK_0(Layout::onAfterVisitScissor, this); renderer->addCommand(afterVisitCmdScissor); renderer->popGroup(); @@ -1312,44 +1312,44 @@ void Layout::findProperSearchingFunctor(FocusDirection dir, Widget* baseWidget) { if (previousWidgetPosition.x > widgetPosition.x) { - onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); } else { - onPassFocusToChild = AX_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); + onPassFocusToChild = CC_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); } } else if (dir == FocusDirection::RIGHT) { if (previousWidgetPosition.x > widgetPosition.x) { - onPassFocusToChild = AX_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); + onPassFocusToChild = CC_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); } else { - onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); } } else if (dir == FocusDirection::DOWN) { if (previousWidgetPosition.y > widgetPosition.y) { - onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); } else { - onPassFocusToChild = AX_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); + onPassFocusToChild = CC_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); } } else if (dir == FocusDirection::UP) { if (previousWidgetPosition.y < widgetPosition.y) { - onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); } else { - onPassFocusToChild = AX_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); + onPassFocusToChild = CC_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); } } else diff --git a/core/ui/UILayout.h b/core/ui/UILayout.h index 78d2ddd714..00533ffb52 100644 --- a/core/ui/UILayout.h +++ b/core/ui/UILayout.h @@ -43,7 +43,7 @@ class DrawNode; class LayerColor; class LayerGradient; class StencilStateManager; -struct AX_DLL ResourceData; +struct CC_DLL ResourceData; namespace ui { @@ -55,7 +55,7 @@ class Scale9Sprite; *@brief Layout interface for creating LayoutManger and do actual layout. * @js NA */ -class AX_GUI_DLL LayoutProtocol +class CC_GUI_DLL LayoutProtocol { public: /** @@ -109,7 +109,7 @@ public: * - Relative layout: child elements are arranged relative to certain rules. * */ -class AX_GUI_DLL Layout : public Widget, public LayoutProtocol +class CC_GUI_DLL Layout : public Widget, public LayoutProtocol { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UILayoutComponent.cpp b/core/ui/UILayoutComponent.cpp index b47f938623..a6755c7578 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; } - AX_SAFE_DELETE(layout); + CC_SAFE_DELETE(layout); return nullptr; } diff --git a/core/ui/UILayoutComponent.h b/core/ui/UILayoutComponent.h index 0bb2651ebf..1300b22926 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 AX_GUI_DLL LayoutComponent : public Component +class CC_GUI_DLL LayoutComponent : public Component { public: /** diff --git a/core/ui/UILayoutManager.h b/core/ui/UILayoutManager.h index 7162241b97..f67331781e 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 AX_GUI_DLL LayoutManager : public Ref +class CC_GUI_DLL LayoutManager : public Ref { public: virtual ~LayoutManager(){}; @@ -67,7 +67,7 @@ public: * @lua NA * @js NA */ -class AX_GUI_DLL LinearVerticalLayoutManager : public LayoutManager +class CC_GUI_DLL LinearVerticalLayoutManager : public LayoutManager { private: LinearVerticalLayoutManager(){}; @@ -84,7 +84,7 @@ private: * @lua NA * @js NA */ -class AX_GUI_DLL LinearHorizontalLayoutManager : public LayoutManager +class CC_GUI_DLL LinearHorizontalLayoutManager : public LayoutManager { private: LinearHorizontalLayoutManager(){}; @@ -101,7 +101,7 @@ private: * @lua NA * @js NA */ -class AX_GUI_DLL LinearCenterVerticalLayoutManager : public LayoutManager +class CC_GUI_DLL LinearCenterVerticalLayoutManager : public LayoutManager { private: LinearCenterVerticalLayoutManager(){}; @@ -118,7 +118,7 @@ private: * @lua NA * @js NA */ -class AX_GUI_DLL RelativeLayoutManager : public LayoutManager +class CC_GUI_DLL RelativeLayoutManager : public LayoutManager { private: RelativeLayoutManager() diff --git a/core/ui/UILayoutParameter.h b/core/ui/UILayoutParameter.h index f193ab3095..b16ca4c585 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 AX_GUI_DLL Margin +class CC_GUI_DLL Margin { public: /** @@ -113,7 +113,7 @@ public: /** *@brief Base class for various LayoutParameter. */ -class AX_GUI_DLL LayoutParameter : public Ref +class CC_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 AX_GUI_DLL LayoutParameterProtocol +class CC_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 AX_GUI_DLL LinearLayoutParameter : public LayoutParameter +class CC_GUI_DLL LinearLayoutParameter : public LayoutParameter { public: /** @@ -283,7 +283,7 @@ protected: * @brief Relative layout parameter. * It is mainly used by `RelativeLayoutManager`. */ -class AX_GUI_DLL RelativeLayoutParameter : public LayoutParameter +class CC_GUI_DLL RelativeLayoutParameter : public LayoutParameter { public: /** diff --git a/core/ui/UIListView.cpp b/core/ui/UIListView.cpp index 0883a6d8e6..e8dc2f3ee4 100644 --- a/core/ui/UIListView.cpp +++ b/core/ui/UIListView.cpp @@ -56,7 +56,7 @@ ListView::ListView() ListView::~ListView() { _items.clear(); - AX_SAFE_RELEASE(_model); + CC_SAFE_RELEASE(_model); } ListView* ListView::create() @@ -67,7 +67,7 @@ ListView* ListView::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -88,9 +88,9 @@ void ListView::setItemModel(Widget* model) CCLOG("Can't set a nullptr to item model!"); return; } - AX_SAFE_RELEASE_NULL(_model); + CC_SAFE_RELEASE_NULL(_model); _model = model; - AX_SAFE_RETAIN(_model); + CC_SAFE_RETAIN(_model); } void ListView::handleReleaseLogic(Touch* touch) diff --git a/core/ui/UIListView.h b/core/ui/UIListView.h index cacf2ad644..f81d887308 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 AX_GUI_DLL ListView : public ScrollView +class CC_GUI_DLL ListView : public ScrollView { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UILoadingBar.cpp b/core/ui/UILoadingBar.cpp index 5e8584aaa9..a0e28e0678 100644 --- a/core/ui/UILoadingBar.cpp +++ b/core/ui/UILoadingBar.cpp @@ -67,7 +67,7 @@ LoadingBar* LoadingBar::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -86,7 +86,7 @@ LoadingBar* LoadingBar::create(std::string_view textureName, TextureResType texT widget->setPercent(percentage); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UILoadingBar.h b/core/ui/UILoadingBar.h index acfce004d2..531454f12f 100644 --- a/core/ui/UILoadingBar.h +++ b/core/ui/UILoadingBar.h @@ -35,7 +35,7 @@ NS_AX_BEGIN * @{ */ -struct AX_DLL ResourceData; +struct CC_DLL ResourceData; namespace ui { @@ -46,7 +46,7 @@ class Scale9Sprite; * Displays a bar to the user representing how far the operation has progressed. * */ -class AX_GUI_DLL LoadingBar : public Widget +class CC_GUI_DLL LoadingBar : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UIPageView.cpp b/core/ui/UIPageView.cpp index 4eb6f6161e..02b2a8355a 100644 --- a/core/ui/UIPageView.cpp +++ b/core/ui/UIPageView.cpp @@ -54,7 +54,7 @@ PageView* PageView::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIPageView.h b/core/ui/UIPageView.h index e5947db2c0..627b966ce5 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 AX_GUI_DLL PageView : public ListView +class CC_GUI_DLL PageView : public ListView { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UIPageViewIndicator.cpp b/core/ui/UIPageViewIndicator.cpp index a22a3ec572..5c1a44b98c 100644 --- a/core/ui/UIPageViewIndicator.cpp +++ b/core/ui/UIPageViewIndicator.cpp @@ -54,7 +54,7 @@ PageViewIndicator* PageViewIndicator::create() node->autorelease(); return node; } - AX_SAFE_DELETE(node); + CC_SAFE_DELETE(node); return nullptr; } diff --git a/core/ui/UIRadioButton.cpp b/core/ui/UIRadioButton.cpp index bed44e8862..e1c620c7c4 100644 --- a/core/ui/UIRadioButton.cpp +++ b/core/ui/UIRadioButton.cpp @@ -48,7 +48,7 @@ RadioButton* RadioButton::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -65,7 +65,7 @@ RadioButton* RadioButton::create(std::string_view backGround, pWidget->autorelease(); return pWidget; } - AX_SAFE_DELETE(pWidget); + CC_SAFE_DELETE(pWidget); return nullptr; } @@ -77,7 +77,7 @@ RadioButton* RadioButton::create(std::string_view backGround, std::string_view c pWidget->autorelease(); return pWidget; } - AX_SAFE_DELETE(pWidget); + CC_SAFE_DELETE(pWidget); return nullptr; } @@ -158,7 +158,7 @@ RadioButtonGroup* RadioButtonGroup::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -185,7 +185,7 @@ void RadioButtonGroup::addRadioButton(RadioButton* radioButton) void RadioButtonGroup::removeRadioButton(RadioButton* radioButton) { ssize_t index = _radioButtons.getIndex(radioButton); - if (index == AX_INVALID_INDEX) + if (index == CC_INVALID_INDEX) { CCLOGERROR("The radio button does not belong to this group!"); return; diff --git a/core/ui/UIRadioButton.h b/core/ui/UIRadioButton.h index 58a00a9012..af832a3622 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 AX_GUI_DLL RadioButton : public AbstractCheckButton +class CC_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 AX_GUI_DLL RadioButtonGroup : public Widget +class CC_GUI_DLL RadioButtonGroup : public Widget { friend class RadioButton; diff --git a/core/ui/UIRelativeBox.cpp b/core/ui/UIRelativeBox.cpp index e5be927d6f..f99df58f3e 100644 --- a/core/ui/UIRelativeBox.cpp +++ b/core/ui/UIRelativeBox.cpp @@ -42,7 +42,7 @@ RelativeBox* RelativeBox::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -54,7 +54,7 @@ RelativeBox* RelativeBox::create(const Vec2& size) widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIRelativeBox.h b/core/ui/UIRelativeBox.h index 1989cd5bbf..1fef1d4a05 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 AX_GUI_DLL RelativeBox : public Layout +class CC_GUI_DLL RelativeBox : public Layout { public: diff --git a/core/ui/UIRichText.cpp b/core/ui/UIRichText.cpp index dd877f9fb5..ad03db9bc0 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 = AX_CALLBACK_2(ListenerComponent::onTouchesEnded, this); + _touchListener->onTouchesEnded = CC_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; } - AX_SAFE_DELETE(element); + CC_SAFE_DELETE(element); return nullptr; } @@ -194,7 +194,7 @@ RichElementImage* RichElementImage::create(int tag, element->autorelease(); return element; } - AX_SAFE_DELETE(element); + CC_SAFE_DELETE(element); return nullptr; } @@ -243,7 +243,7 @@ RichElementCustomNode* RichElementCustomNode::create(int tag, element->autorelease(); return element; } - AX_SAFE_DELETE(element); + CC_SAFE_DELETE(element); return nullptr; } @@ -266,7 +266,7 @@ RichElementNewLine* RichElementNewLine::create(int tag, const Color3B& color, ui element->autorelease(); return element; } - AX_SAFE_DELETE(element); + CC_SAFE_DELETE(element); return nullptr; } @@ -1006,7 +1006,7 @@ RichText* RichText::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -1018,7 +1018,7 @@ RichText* RichText::createWithXML(std::string_view xml, const ValueMap& defaults widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIRichText.h b/core/ui/UIRichText.h index f001f888ed..eec6903ccd 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 AX_GUI_DLL RichElement : public Ref +class CC_GUI_DLL RichElement : public Ref { public: /** @@ -97,7 +97,7 @@ protected: /** *@brief Rich element for displaying text. */ -class AX_GUI_DLL RichElementText : public RichElement +class CC_GUI_DLL RichElementText : public RichElement { public: /** @@ -212,7 +212,7 @@ protected: /** *@brief Rich element for displaying images. */ -class AX_GUI_DLL RichElementImage : public RichElement +class CC_GUI_DLL RichElementImage : public RichElement { public: /** @@ -283,7 +283,7 @@ protected: /** *@brief Rich element for displaying custom node type. */ -class AX_GUI_DLL RichElementCustomNode : public RichElement +class CC_GUI_DLL RichElementCustomNode : public RichElement { public: /** @@ -298,7 +298,7 @@ public: * @js NA * @lua NA */ - virtual ~RichElementCustomNode() { AX_SAFE_RELEASE(_customNode); }; + virtual ~RichElementCustomNode() { CC_SAFE_RELEASE(_customNode); }; /** * @brief Initialize a RichElementCustomNode with various arguments. @@ -330,7 +330,7 @@ protected: /** *@brief Rich element for new line. */ -class AX_GUI_DLL RichElementNewLine : public RichElement +class CC_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 AX_GUI_DLL RichText : public Widget +class CC_GUI_DLL RichText : public Widget { public: enum WrapMode diff --git a/core/ui/UIScale9Sprite.cpp b/core/ui/UIScale9Sprite.cpp index 65945bba47..296e19e36b 100644 --- a/core/ui/UIScale9Sprite.cpp +++ b/core/ui/UIScale9Sprite.cpp @@ -49,7 +49,7 @@ Scale9Sprite* Scale9Sprite::create() ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -61,7 +61,7 @@ Scale9Sprite* Scale9Sprite::create(std::string_view filename, const Rect& rect, ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -78,7 +78,7 @@ Scale9Sprite* Scale9Sprite::create(const Rect& capInsets, std::string_view file) ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -95,7 +95,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame, cons ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -112,7 +112,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(std::string_view spriteFra ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -124,7 +124,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(std::string_view spriteFra ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_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(), AX_RECT_POINTS_TO_PIXELS(textureRect), rotated, - AX_POINT_POINTS_TO_PIXELS(offset), AX_SIZE_POINTS_TO_PIXELS(originalSize)); + SpriteFrame::createWithTexture(sprite->getTexture(), CC_RECT_POINTS_TO_PIXELS(textureRect), rotated, + CC_POINT_POINTS_TO_PIXELS(offset), CC_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; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } diff --git a/core/ui/UIScale9Sprite.h b/core/ui/UIScale9Sprite.h index 521769c56a..b1d859482d 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 AX_GUI_DLL Scale9Sprite : public Sprite +class CC_GUI_DLL Scale9Sprite : public Sprite { public: /** diff --git a/core/ui/UIScrollView.cpp b/core/ui/UIScrollView.cpp index 1bb782673e..e431d55bd2 100644 --- a/core/ui/UIScrollView.cpp +++ b/core/ui/UIScrollView.cpp @@ -98,7 +98,7 @@ ScrollView* ScrollView::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIScrollView.h b/core/ui/UIScrollView.h index 1e8ab6ead7..a102e22271 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 AX_GUI_DLL ScrollView : public Layout +class CC_GUI_DLL ScrollView : public Layout { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UIScrollViewBar.cpp b/core/ui/UIScrollViewBar.cpp index f4d3ea9292..653e4b6285 100644 --- a/core/ui/UIScrollViewBar.cpp +++ b/core/ui/UIScrollViewBar.cpp @@ -78,7 +78,7 @@ ScrollViewBar* ScrollViewBar::create(ScrollView* parent, ScrollView::Direction d node->autorelease(); return node; } - AX_SAFE_DELETE(node); + CC_SAFE_DELETE(node); return nullptr; } diff --git a/core/ui/UIScrollViewBar.h b/core/ui/UIScrollViewBar.h index 32c4081d46..37e3fc4839 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 AX_GUI_DLL ScrollViewBar : public ProtectedNode +class CC_GUI_DLL ScrollViewBar : public ProtectedNode { public: diff --git a/core/ui/UISlider.cpp b/core/ui/UISlider.cpp index 4f669c987f..3e443bdd06 100644 --- a/core/ui/UISlider.cpp +++ b/core/ui/UISlider.cpp @@ -99,7 +99,7 @@ Slider* Slider::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -113,7 +113,7 @@ Slider* Slider::create(std::string_view barTextureName, std::string_view normalB widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UISlider.h b/core/ui/UISlider.h index ae2164f671..982a00bdc9 100644 --- a/core/ui/UISlider.h +++ b/core/ui/UISlider.h @@ -37,7 +37,7 @@ NS_AX_BEGIN */ class Sprite; -struct AX_DLL ResourceData; +struct CC_DLL ResourceData; namespace ui { @@ -54,7 +54,7 @@ typedef void (Ref::*SEL_SlidPercentChangedEvent)(Ref*, SliderEventType); /** * @brief UI Slider widget. */ -class AX_GUI_DLL Slider : public Widget +class CC_GUI_DLL Slider : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITabControl.cpp b/core/ui/UITabControl.cpp index 818d3db686..58adb94143 100644 --- a/core/ui/UITabControl.cpp +++ b/core/ui/UITabControl.cpp @@ -53,7 +53,7 @@ TabControl::~TabControl() for (auto& item : _tabItems) { if (item) - AX_SAFE_DELETE(item); + CC_SAFE_DELETE(item); } _tabItems.clear(); } @@ -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 = - AX_CALLBACK_2(TabControl::dispatchSelectedTabChanged, this); // binding tab selected event + CC_CALLBACK_2(TabControl::dispatchSelectedTabChanged, this); // binding tab selected event initAfterInsert(index); } @@ -134,7 +134,7 @@ void TabControl::removeTab(int index) auto header = tabItem->header; auto container = tabItem->container; if (tabItem) - AX_SAFE_DELETE(tabItem); + CC_SAFE_DELETE(tabItem); _tabItems.erase(_tabItems.begin() + index); if (header != nullptr) @@ -366,7 +366,7 @@ TabControl* TabControl::create() tabview->autorelease(); return tabview; } - AX_SAFE_DELETE(tabview); + CC_SAFE_DELETE(tabview); return nullptr; } @@ -483,7 +483,7 @@ TabHeader* TabHeader::create() tabcell->autorelease(); return tabcell; } - AX_SAFE_DELETE(tabcell); + CC_SAFE_DELETE(tabcell); return nullptr; } @@ -501,7 +501,7 @@ TabHeader* TabHeader::create(std::string_view titleStr, tabcell->autorelease(); return tabcell; } - AX_SAFE_DELETE(tabcell); + CC_SAFE_DELETE(tabcell); return nullptr; } @@ -522,7 +522,7 @@ TabHeader* TabHeader::create(std::string_view titleStr, tabcell->autorelease(); return tabcell; } - AX_SAFE_DELETE(tabcell); + CC_SAFE_DELETE(tabcell); return nullptr; } diff --git a/core/ui/UITabControl.h b/core/ui/UITabControl.h index 9bab96b028..9d03bab184 100644 --- a/core/ui/UITabControl.h +++ b/core/ui/UITabControl.h @@ -45,7 +45,7 @@ class TabControl; /** * the header button in TabControl */ -class AX_GUI_DLL TabHeader : public AbstractCheckButton +class CC_GUI_DLL TabHeader : public AbstractCheckButton { friend class TabControl; @@ -188,7 +188,7 @@ private: /** * TabControl, use header button switch container */ -class AX_GUI_DLL TabControl : public Widget +class CC_GUI_DLL TabControl : public Widget { public: enum class Dock diff --git a/core/ui/UIText.cpp b/core/ui/UIText.cpp index a4f04ea627..9b934b647c 100644 --- a/core/ui/UIText.cpp +++ b/core/ui/UIText.cpp @@ -58,7 +58,7 @@ Text* Text::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_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; } - AX_SAFE_DELETE(text); + CC_SAFE_DELETE(text); return nullptr; } diff --git a/core/ui/UIText.h b/core/ui/UIText.h index 0388d18c20..0273813a10 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 AX_GUI_DLL Text : public Widget, public axis::BlendProtocol +class CC_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 0bdf7bf3df..b2bc2fe05b 100644 --- a/core/ui/UITextAtlas.cpp +++ b/core/ui/UITextAtlas.cpp @@ -55,7 +55,7 @@ TextAtlas* TextAtlas::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_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; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UITextAtlas.h b/core/ui/UITextAtlas.h index 89aaca1529..4c8e21473d 100644 --- a/core/ui/UITextAtlas.h +++ b/core/ui/UITextAtlas.h @@ -37,7 +37,7 @@ NS_AX_BEGIN */ class Label; -struct AX_DLL ResourceData; +struct CC_DLL ResourceData; namespace ui { @@ -45,7 +45,7 @@ namespace ui /** * @brief UI TextAtlas widget. */ -class AX_GUI_DLL TextAtlas : public Widget +class CC_GUI_DLL TextAtlas : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITextBMFont.cpp b/core/ui/UITextBMFont.cpp index b23eb56724..e4c2f2b271 100644 --- a/core/ui/UITextBMFont.cpp +++ b/core/ui/UITextBMFont.cpp @@ -49,7 +49,7 @@ TextBMFont* TextBMFont::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -63,7 +63,7 @@ TextBMFont* TextBMFont::create(std::string_view text, std::string_view filename) widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UITextBMFont.h b/core/ui/UITextBMFont.h index f9dfeb0832..eb171b4484 100644 --- a/core/ui/UITextBMFont.h +++ b/core/ui/UITextBMFont.h @@ -36,7 +36,7 @@ THE SOFTWARE. NS_AX_BEGIN class Label; -struct AX_DLL ResourceData; +struct CC_DLL ResourceData; namespace ui { @@ -44,7 +44,7 @@ namespace ui /** * A widget for displaying BMFont label. */ -class AX_GUI_DLL TextBMFont : public Widget +class CC_GUI_DLL TextBMFont : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITextField.cpp b/core/ui/UITextField.cpp index 2f7b56edf5..61a879f073 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; } - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); return nullptr; } @@ -288,7 +288,7 @@ TextField* TextField::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -303,7 +303,7 @@ TextField* TextField::create(std::string_view placeholder, std::string_view font widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UITextField.h b/core/ui/UITextField.h index 32d5f1363b..61a17db0d3 100644 --- a/core/ui/UITextField.h +++ b/core/ui/UITextField.h @@ -45,7 +45,7 @@ namespace ui * @js NA * @lua NA */ -class AX_GUI_DLL UICCTextField : public TextFieldTTF, public TextFieldDelegate +class CC_GUI_DLL UICCTextField : public TextFieldTTF, public TextFieldDelegate { public: /** @@ -223,7 +223,7 @@ protected: * @js NA * @lua NA */ -class AX_GUI_DLL TextField : public Widget +class CC_GUI_DLL TextField : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITextFieldEx.cpp b/core/ui/UITextFieldEx.cpp index e9f3cd381f..4a18a51b41 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) { - // AX_ASSERT(theNode != NULL); + // CC_ASSERT(theNode != NULL); bool visible = false; for (Node* ptr = theNode; (ptr != nullptr && (visible = ptr->isVisible())); ptr = ptr->getParent()) ; @@ -126,7 +126,7 @@ static int _calcCharCount(const char* text) char ch = 0; while ((ch = *text) != 0x0) { - AX_BREAK_IF(!ch); + CC_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) { - AX_BREAK_IF(!ch || n > limit); + CC_BREAK_IF(!ch || n > limit); if (0x80 != (0xC0 & ch)) { @@ -281,7 +281,7 @@ TextFieldEx* TextFieldEx::create(std::string_view placeholder, } return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } diff --git a/core/ui/UITextFieldEx.h b/core/ui/UITextFieldEx.h index ff563351d9..d683e81a4e 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 AX_DLL TextFieldEx : public axis::Node, public IMEDelegate +class CC_DLL TextFieldEx : public axis::Node, public IMEDelegate { public: /** @@ -100,7 +100,7 @@ public: void setTextFontName(std::string_view fontName); std::string_view getTextFontName() const; - AX_SYNTHESIZE(size_t, charLimit, CharLimit); + CC_SYNTHESIZE(size_t, charLimit, CharLimit); bool isSystemFont(void) const { return systemFontUsed; } diff --git a/core/ui/UIVBox.cpp b/core/ui/UIVBox.cpp index 2f7bdfe4d3..93e5ff064b 100644 --- a/core/ui/UIVBox.cpp +++ b/core/ui/UIVBox.cpp @@ -42,7 +42,7 @@ VBox* VBox::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -54,7 +54,7 @@ VBox* VBox::create(const Vec2& size) widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIVBox.h b/core/ui/UIVBox.h index 40f0b1f140..cb5e6065b7 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 AX_GUI_DLL VBox : public Layout +class CC_GUI_DLL VBox : public Layout { public: /** diff --git a/core/ui/UIVideoPlayer/UIVideoPlayer-android.cpp b/core/ui/UIVideoPlayer/UIVideoPlayer-android.cpp index 7b2d3f9e04..3370643f07 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) # include # include # include @@ -113,7 +113,7 @@ VideoPlayer::VideoPlayer() _videoPlayerIndex = createVideoWidgetJNI(); s_allVideoPlayers[_videoPlayerIndex] = this; -# if AX_VIDEOPLAYER_DEBUG_DRAW +# if CC_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 AX_VIDEOPLAYER_DEBUG_DRAW +# if CC_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 34410204c0..38aa9d8729 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 AX_TARGET_PLATFORM == AX_PLATFORM_IOS && !defined(AX_TARGET_OS_TVOS) +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS && !defined(CC_TARGET_OS_TVOS) using namespace axis::ui; //------------------------------------------------------------------------------------- @@ -283,7 +283,7 @@ VideoPlayer::VideoPlayer() { _videoContext = [[UIVideoViewWrapperIos alloc] init:this]; -# if AX_VIDEOPLAYER_DEBUG_DRAW +# if CC_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 AX_VIDEOPLAYER_DEBUG_DRAW +# if CC_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 1d666a0bbf..9682a84957 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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) # include # include # include @@ -273,7 +273,7 @@ VideoPlayer::VideoPlayer() { auto pvd = new PrivateVideoDescriptor{}; _videoContext = pvd; -# if AX_VIDEOPLAYER_DEBUG_DRAW +# if CC_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 AX_VIDEOPLAYER_DEBUG_DRAW +# if CC_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 a025a5fd8f..68a65ef578 100644 --- a/core/ui/UIVideoPlayer/UIVideoPlayer.h +++ b/core/ui/UIVideoPlayer/UIVideoPlayer.h @@ -25,13 +25,13 @@ ****************************************************************************/ #pragma once -#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) +#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) # include "ui/UIWidget.h" -# if AX_VIDEOPLAYER_DEBUG_DRAW +# if CC_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 AX_VIDEOPLAYER_DEBUG_DRAW +# if CC_VIDEOPLAYER_DEBUG_DRAW DrawNode* _debugDrawNode; # endif diff --git a/core/ui/UIWebView/UIWebView-inl.h b/core/ui/UIWebView/UIWebView-inl.h index 4341e238c3..26a2fd73f1 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() { - AX_SAFE_DELETE(_impl); + CC_SAFE_DELETE(_impl); } WebView* WebView::create() @@ -49,7 +49,7 @@ WebView* WebView::create() webView->autorelease(); return webView; } - AX_SAFE_DELETE(webView); + CC_SAFE_DELETE(webView); return nullptr; } diff --git a/core/ui/UIWebView/UIWebView.cpp b/core/ui/UIWebView/UIWebView.cpp index ac480535c4..7e1ba2e758 100644 --- a/core/ui/UIWebView/UIWebView.cpp +++ b/core/ui/UIWebView/UIWebView.cpp @@ -24,12 +24,12 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) # include "ui/UIWebView/UIWebViewImpl-android.h" # include "ui/UIWebView/UIWebView-inl.h" -#elif (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#elif (CC_TARGET_PLATFORM == CC_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 80a55f2acc..34f71dab84 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) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if defined(_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_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 AX_GUI_DLL WebView : public axis::ui::Widget +class CC_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 4b9cad508f..dc4d6940f8 100644 --- a/core/ui/UIWebView/UIWebViewImpl-win32.cpp +++ b/core/ui/UIWebView/UIWebViewImpl-win32.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ -#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2) +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2) # include "UIWebViewImpl-win32.h" # include "UIWebView.h" @@ -1082,4 +1082,4 @@ void Win32WebControl::setBackgroundTransparent() } } -#endif // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 diff --git a/core/ui/UIWebView/UIWebViewImpl-win32.h b/core/ui/UIWebView/UIWebViewImpl-win32.h index 10e03d240d..23c5d59b64 100644 --- a/core/ui/UIWebView/UIWebViewImpl-win32.h +++ b/core/ui/UIWebView/UIWebViewImpl-win32.h @@ -28,7 +28,7 @@ #include "platform/CCPlatformMacros.h" -#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2) +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2) # include # include "CCStdC.h" @@ -92,6 +92,6 @@ private: } // namespace ui NS_AX_END // namespace axis -#endif // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #endif // __COCOS2D__UI__WEBVIEWIMPL_WIN32_H_ diff --git a/core/ui/UIWidget.cpp b/core/ui/UIWidget.cpp index 0b5a7f1a6f..fdce7d7d46 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 = AX_CALLBACK_2(Widget::FocusNavigationController::onKeypadKeyPressed, this); + _keyboardListener->onKeyReleased = CC_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); - AX_SAFE_RELEASE_NULL(_touchListener); + CC_SAFE_RELEASE_NULL(_touchListener); // cleanup focused widget and focus navigation controller if (_focusedWidget == this) { // delete - AX_SAFE_DELETE(_focusNavigationController); + CC_SAFE_DELETE(_focusNavigationController); _focusedWidget = nullptr; } } @@ -205,7 +205,7 @@ Widget* Widget::create() widget->autorelease(); return widget; } - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return nullptr; } @@ -215,7 +215,7 @@ bool Widget::init() { initRenderer(); setBright(true); - onFocusChanged = AX_CALLBACK_2(Widget::onFocusChange, this); + onFocusChanged = CC_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(); - AX_SAFE_RETAIN(_touchListener); + CC_SAFE_RETAIN(_touchListener); _touchListener->setSwallowTouches(true); - _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); + _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); _eventDispatcher->addEventListenerWithSceneGraphPriority(_touchListener, this); } else { _eventDispatcher->removeEventListener(_touchListener); - AX_SAFE_RELEASE_NULL(_touchListener); + CC_SAFE_RELEASE_NULL(_touchListener); } } @@ -1415,7 +1415,7 @@ void Widget::enableDpadNavigation(bool enable) } else { - AX_SAFE_DELETE(_focusNavigationController); + CC_SAFE_DELETE(_focusNavigationController); } if (nullptr != _focusNavigationController) diff --git a/core/ui/UIWidget.h b/core/ui/UIWidget.h index bf4b46f9c0..bd9f461a59 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 AX_GUI_DLL Widget : public ProtectedNode, public LayoutParameterProtocol +class CC_GUI_DLL Widget : public ProtectedNode, public LayoutParameterProtocol { public: /** diff --git a/extensions/DragonBones/CCArmatureDisplay.cpp b/extensions/DragonBones/CCArmatureDisplay.cpp index 0596bd2345..f545ce78a7 100644 --- a/extensions/DragonBones/CCArmatureDisplay.cpp +++ b/extensions/DragonBones/CCArmatureDisplay.cpp @@ -12,7 +12,7 @@ CCArmatureDisplay* CCArmatureDisplay::create() } else { - AX_SAFE_DELETE(displayContainer); + CC_SAFE_DELETE(displayContainer); } return displayContainer; @@ -28,7 +28,7 @@ void CCArmatureDisplay::dbClear() setEventDispatcher(axis::Director::getInstance()->getEventDispatcher()); _armature = nullptr; - AX_SAFE_RELEASE(_dispatcher); + CC_SAFE_RELEASE(_dispatcher); release(); } @@ -124,7 +124,7 @@ DBCCSprite* DBCCSprite::create() } else { - AX_SAFE_DELETE(sprite); + CC_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 AX_USE_CULLING +#if CC_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 AX_SPRITE_DEBUG_DRAW +#if CC_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 // AX_SPRITE_DEBUG_DRAW +#endif // CC_SPRITE_DEBUG_DRAW } } diff --git a/extensions/DragonBones/CCArmatureDisplay.h b/extensions/DragonBones/CCArmatureDisplay.h index 9ebc450292..a06db8dd18 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_AX_ARMATURE_DISPLAY_CONTAINER_H -#define DRAGONBONES_AX_ARMATURE_DISPLAY_CONTAINER_H +#ifndef DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H +#define DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H #include "DragonBones/DragonBonesHeaders.h" #include "cocos2d.h" @@ -140,4 +140,4 @@ public: }; DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_AX_ARMATURE_DISPLAY_CONTAINER_H +#endif // DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H diff --git a/extensions/DragonBones/CCDragonBonesHeaders.h b/extensions/DragonBones/CCDragonBonesHeaders.h index 6afbe16ba6..2bab803b9c 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_AX_HEADERS_H -#define DRAGONBONES_AX_HEADERS_H +#ifndef DRAGONBONES_CC_HEADERS_H +#define DRAGONBONES_CC_HEADERS_H #include "CCTextureAtlasData.h" #include "CCArmatureDisplay.h" #include "CCSlot.h" #include "CCFactory.h" -#endif // DRAGONBONES_AX_HEADERS_H +#endif // DRAGONBONES_CC_HEADERS_H diff --git a/extensions/DragonBones/CCFactory.h b/extensions/DragonBones/CCFactory.h index 35097b36d3..29dc2f462e 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_AX_FACTORY_H -#define DRAGONBONES_AX_FACTORY_H +#ifndef DRAGONBONES_CC_FACTORY_H +#define DRAGONBONES_CC_FACTORY_H #include "DragonBonesHeaders.h" #include "cocos2d.h" @@ -219,4 +219,4 @@ public: }; DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_AX_FACTORY_H +#endif // DRAGONBONES_CC_FACTORY_H diff --git a/extensions/DragonBones/CCSlot.h b/extensions/DragonBones/CCSlot.h index 7c988a91fe..1ece5d8a01 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_AX_SLOT_H -#define DRAGONBONES_AX_SLOT_H +#ifndef DRAGONBONES_CC_SLOT_H +#define DRAGONBONES_CC_SLOT_H #include "DragonBonesHeaders.h" #include "cocos2d.h" @@ -73,4 +73,4 @@ public: }; DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_AX_SLOT_H +#endif // DRAGONBONES_CC_SLOT_H diff --git a/extensions/DragonBones/CCTextureAtlasData.h b/extensions/DragonBones/CCTextureAtlasData.h index 5362911c6f..7cd0bfe3d3 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_AX_TEXTUREATLAS_DATA_H -#define DRAGONBONES_AX_TEXTUREATLAS_DATA_H +#ifndef DRAGONBONES_CC_TEXTUREATLAS_DATA_H +#define DRAGONBONES_CC_TEXTUREATLAS_DATA_H #include "DragonBonesHeaders.h" #include "cocos2d.h" @@ -76,4 +76,4 @@ protected: virtual void _onClear() override; }; DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_AX_TEXTUREATLAS_DATA_H +#endif // DRAGONBONES_CC_TEXTUREATLAS_DATA_H diff --git a/extensions/ExtensionExport.h b/extensions/ExtensionExport.h index 204cf4ac0a..cc4b764060 100644 --- a/extensions/ExtensionExport.h +++ b/extensions/ExtensionExport.h @@ -30,13 +30,13 @@ # include # endif -# if defined(AX_STATIC) -# define AX_EX_DLL +# if defined(CC_STATIC) +# define CC_EX_DLL # else # if defined(_USREXDLL) -# define AX_EX_DLL __declspec(dllexport) +# define CC_EX_DLL __declspec(dllexport) # else /* use a DLL library */ -# define AX_EX_DLL __declspec(dllimport) +# define CC_EX_DLL __declspec(dllimport) # endif # endif @@ -49,9 +49,9 @@ # endif # endif #elif defined(_SHARED_) -# define AX_EX_DLL __attribute__((visibility("default"))) +# define CC_EX_DLL __attribute__((visibility("default"))) #else -# define AX_EX_DLL +# define CC_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 4c07ca450c..848a2f82bd 100644 --- a/extensions/GUI/CCControlExtension/CCControl.cpp +++ b/extensions/GUI/CCControlExtension/CCControl.cpp @@ -58,7 +58,7 @@ Control* Control::create() } else { - AX_SAFE_DELETE(pRet); + CC_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 = 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); + 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); dispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); @@ -117,7 +117,7 @@ void Control::sendActionsForControlEvents(EventType controlEvents) { invocation->invoke(this); } -#if AX_ENABLE_SCRIPT_BINDING +#if CC_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 eeff256c5a..0af905388f 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 AX_EX_DLL Control : public Layer +class CC_EX_DLL Control : public Layer { public: /** Kinds of possible events for the control objects. */ - enum class AX_EX_DLL EventType + enum class CC_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. */ - AX_SYNTHESIZE_READONLY(State, _state, State); + CC_SYNTHESIZE_READONLY(State, _state, State); private: - AX_DISALLOW_COPY_AND_ASSIGN(Control); + CC_DISALLOW_COPY_AND_ASSIGN(Control); }; -AX_EX_DLL Control::EventType operator|(Control::EventType a, Control::EventType b); +CC_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 3d95f564a2..334a60428f 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -55,8 +55,8 @@ ControlButton::ControlButton() ControlButton::~ControlButton() { - AX_SAFE_RELEASE(_titleLabel); - AX_SAFE_RELEASE(_backgroundSprite); + CC_SAFE_RELEASE(_titleLabel); + CC_SAFE_RELEASE(_backgroundSprite); } // initialisers @@ -740,7 +740,7 @@ ControlButton* ControlButton::create() pControlButton->autorelease(); return pControlButton; } - AX_SAFE_DELETE(pControlButton); + CC_SAFE_DELETE(pControlButton); return nullptr; } diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index a6777d6065..7eb5b97df7 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 AX_EX_DLL ControlButton : public Control +class CC_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. */ - AX_SYNTHESIZE_READONLY_PASS_BY_REF(Color3B, _currentTitleColor, CurrentTitleColor); + CC_SYNTHESIZE_READONLY_PASS_BY_REF(Color3B, _currentTitleColor, CurrentTitleColor); /** The current title label. */ - AX_SYNTHESIZE_RETAIN(Node*, _titleLabel, TitleLabel); + CC_SYNTHESIZE_RETAIN(Node*, _titleLabel, TitleLabel); /** The current background sprite. */ - AX_SYNTHESIZE_RETAIN(axis::ui::Scale9Sprite*, _backgroundSprite, BackgroundSprite); + CC_SYNTHESIZE_RETAIN(axis::ui::Scale9Sprite*, _backgroundSprite, BackgroundSprite); /** The preferred size of the button, if label is larger it will be expanded. */ - AX_PROPERTY_PASS_BY_REF(Size, _preferredSize, PreferredSize); + CC_PROPERTY_PASS_BY_REF(Size, _preferredSize, PreferredSize); /** Adjust the button zooming on touchdown. Default value is YES. */ - AX_PROPERTY(bool, _zoomOnTouchDown, ZoomOnTouchDown); + CC_PROPERTY(bool, _zoomOnTouchDown, ZoomOnTouchDown); /** Scale ratio button on touchdown. Default value 1.1f */ - AX_SYNTHESIZE(float, _scaleRatio, ScaleRatio); + CC_SYNTHESIZE(float, _scaleRatio, ScaleRatio); - AX_PROPERTY_PASS_BY_REF(Vec2, _labelAnchorPoint, LabelAnchorPoint); + CC_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 */ - AX_SYNTHESIZE_READONLY(int, _marginV, VerticalMargin); + CC_SYNTHESIZE_READONLY(int, _marginV, VerticalMargin); /* Define the button margin for Left/Right edge */ - AX_SYNTHESIZE_READONLY(int, _marginH, HorizontalOrigin); + CC_SYNTHESIZE_READONLY(int, _marginH, HorizontalOrigin); private: - AX_DISALLOW_COPY_AND_ASSIGN(ControlButton); + CC_DISALLOW_COPY_AND_ASSIGN(ControlButton); }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp index f73e4c918d..21fd888482 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp @@ -41,9 +41,9 @@ ControlColourPicker::ControlColourPicker() : _colourPicker(nullptr), _huePicker( ControlColourPicker::~ControlColourPicker() { - AX_SAFE_RELEASE(_background); - AX_SAFE_RELEASE(_huePicker); - AX_SAFE_RELEASE(_colourPicker); + CC_SAFE_RELEASE(_background); + CC_SAFE_RELEASE(_huePicker); + CC_SAFE_RELEASE(_colourPicker); } bool ControlColourPicker::init() @@ -77,7 +77,7 @@ bool ControlColourPicker::init() Vec2::ZERO, Vec2(0.5f, 0.5f)); if (!_background) return false; - AX_SAFE_RETAIN(_background); + CC_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 3b8d1a3755..e93def4280 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.h +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.h @@ -49,7 +49,7 @@ NS_AX_EXT_BEGIN * @{ */ -class AX_EX_DLL ControlColourPicker : public Control +class CC_EX_DLL ControlColourPicker : public Control { public: static ControlColourPicker* create(); @@ -79,9 +79,9 @@ protected: virtual bool onTouchBegan(Touch* touch, Event* pEvent) override; HSV _hsv; - AX_SYNTHESIZE_RETAIN(ControlSaturationBrightnessPicker*, _colourPicker, colourPicker) - AX_SYNTHESIZE_RETAIN(ControlHuePicker*, _huePicker, HuePicker) - AX_SYNTHESIZE_RETAIN(Sprite*, _background, Background) + CC_SYNTHESIZE_RETAIN(ControlSaturationBrightnessPicker*, _colourPicker, colourPicker) + CC_SYNTHESIZE_RETAIN(ControlHuePicker*, _huePicker, HuePicker) + CC_SYNTHESIZE_RETAIN(Sprite*, _background, Background) }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp b/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp index e84bd0d5dd..59f2cfcb56 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); - AX_SAFE_RELEASE(_background); - AX_SAFE_RELEASE(_slider); + CC_SAFE_RELEASE(_background); + CC_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 = AX_DEGREES_TO_RADIANS(angleDeg); + float angle = CC_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 = AX_RADIANS_TO_DEGREES(angle) + 180.0f; + float angleDeg = CC_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 f5e311d864..88f7bafad6 100644 --- a/extensions/GUI/CCControlExtension/CCControlHuePicker.h +++ b/extensions/GUI/CCControlExtension/CCControlHuePicker.h @@ -47,7 +47,7 @@ NS_AX_EXT_BEGIN * @{ */ -class AX_EX_DLL ControlHuePicker : public Control +class CC_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 - AX_SYNTHESIZE_READONLY(float, _hue, Hue); + CC_SYNTHESIZE_READONLY(float, _hue, Hue); virtual void setHue(float val); - AX_SYNTHESIZE_READONLY(float, _huePercentage, HuePercentage); + CC_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? - AX_SYNTHESIZE_RETAIN(Sprite*, _background, Background); - AX_SYNTHESIZE_RETAIN(Sprite*, _slider, Slider); - AX_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); + CC_SYNTHESIZE_RETAIN(Sprite*, _background, Background); + CC_SYNTHESIZE_RETAIN(Sprite*, _slider, Slider); + CC_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp index fb4408b485..d74dc94af3 100644 --- a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp +++ b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp @@ -37,8 +37,8 @@ ControlPotentiometer::ControlPotentiometer() ControlPotentiometer::~ControlPotentiometer() { - AX_SAFE_RELEASE(_thumbSprite); - AX_SAFE_RELEASE(_progressTimer); + CC_SAFE_RELEASE(_thumbSprite); + CC_SAFE_RELEASE(_progressTimer); } ControlPotentiometer* ControlPotentiometer::create(const char* backgroundFile, @@ -61,7 +61,7 @@ ControlPotentiometer* ControlPotentiometer::create(const char* backgroundFile, } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/GUI/CCControlExtension/CCControlPotentiometer.h b/extensions/GUI/CCControlExtension/CCControlPotentiometer.h index 166d046393..8a6051821a 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 AX_EX_DLL ControlPotentiometer : public Control +class CC_EX_DLL ControlPotentiometer : public Control { public: /** @@ -110,9 +110,9 @@ protected: * The default value of this property is 1.0. */ float _maximumValue; - AX_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) - AX_SYNTHESIZE_RETAIN(ProgressTimer*, _progressTimer, ProgressTimer) - AX_SYNTHESIZE(Vec2, _previousLocation, PreviousLocation) + CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) + CC_SYNTHESIZE_RETAIN(ProgressTimer*, _progressTimer, ProgressTimer) + CC_SYNTHESIZE(Vec2, _previousLocation, PreviousLocation) }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h index a0063c5b40..c2a7df3f8d 100644 --- a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h +++ b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h @@ -47,19 +47,19 @@ NS_AX_EXT_BEGIN * @{ */ -class AX_EX_DLL ControlSaturationBrightnessPicker : public Control +class CC_EX_DLL ControlSaturationBrightnessPicker : public Control { /** Contains the receiver's current saturation value. */ - AX_SYNTHESIZE_READONLY(float, _saturation, Saturation); + CC_SYNTHESIZE_READONLY(float, _saturation, Saturation); /** Contains the receiver's current brightness value. */ - AX_SYNTHESIZE_READONLY(float, _brightness, Brightness); + CC_SYNTHESIZE_READONLY(float, _brightness, Brightness); // not sure if these need to be there actually. I suppose someone might want to access the sprite? - 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); + 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); protected: int boxPos; diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.cpp b/extensions/GUI/CCControlExtension/CCControlSlider.cpp index eea7142279..16dbd88431 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSlider.cpp @@ -49,10 +49,10 @@ ControlSlider::ControlSlider() ControlSlider::~ControlSlider() { - AX_SAFE_RELEASE(_thumbSprite); - AX_SAFE_RELEASE(_selectedThumbSprite); - AX_SAFE_RELEASE(_progressSprite); - AX_SAFE_RELEASE(_backgroundSprite); + CC_SAFE_RELEASE(_thumbSprite); + CC_SAFE_RELEASE(_selectedThumbSprite); + CC_SAFE_RELEASE(_progressSprite); + CC_SAFE_RELEASE(_backgroundSprite); } ControlSlider* ControlSlider::create(const char* bgFile, const char* progressFile, const char* thumbFile) diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.h b/extensions/GUI/CCControlExtension/CCControlSlider.h index a48bc2dd6f..482632da66 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.h +++ b/extensions/GUI/CCControlExtension/CCControlSlider.h @@ -44,7 +44,7 @@ NS_AX_EXT_BEGIN * @{ */ -class AX_EX_DLL ControlSlider : public Control +class CC_EX_DLL ControlSlider : public Control { public: /** @@ -138,24 +138,24 @@ protected: // manually put in the setters /** Contains the receiver's current value. */ - AX_SYNTHESIZE_READONLY(float, _value, Value); + CC_SYNTHESIZE_READONLY(float, _value, Value); /** Contains the minimum value of the receiver. * The default value of this property is 0.0. */ - AX_SYNTHESIZE_READONLY(float, _minimumValue, MinimumValue); + CC_SYNTHESIZE_READONLY(float, _minimumValue, MinimumValue); /** Contains the maximum value of the receiver. * The default value of this property is 1.0. */ - AX_SYNTHESIZE_READONLY(float, _maximumValue, MaximumValue); + CC_SYNTHESIZE_READONLY(float, _maximumValue, MaximumValue); - AX_SYNTHESIZE(float, _minimumAllowedValue, MinimumAllowedValue); - AX_SYNTHESIZE(float, _maximumAllowedValue, MaximumAllowedValue); + CC_SYNTHESIZE(float, _minimumAllowedValue, MinimumAllowedValue); + CC_SYNTHESIZE(float, _maximumAllowedValue, MaximumAllowedValue); // maybe this should be read-only - AX_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite); - AX_SYNTHESIZE_RETAIN(Sprite*, _selectedThumbSprite, SelectedThumbSprite); - AX_SYNTHESIZE_RETAIN(Sprite*, _progressSprite, ProgressSprite); - AX_SYNTHESIZE_RETAIN(Sprite*, _backgroundSprite, BackgroundSprite); + CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite); + CC_SYNTHESIZE_RETAIN(Sprite*, _selectedThumbSprite, SelectedThumbSprite); + CC_SYNTHESIZE_RETAIN(Sprite*, _progressSprite, ProgressSprite); + CC_SYNTHESIZE_RETAIN(Sprite*, _backgroundSprite, BackgroundSprite); }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlStepper.cpp b/extensions/GUI/CCControlExtension/CCControlStepper.cpp index f38f7514e5..9c3fb23471 100644 --- a/extensions/GUI/CCControlExtension/CCControlStepper.cpp +++ b/extensions/GUI/CCControlExtension/CCControlStepper.cpp @@ -60,10 +60,10 @@ ControlStepper::~ControlStepper() { unscheduleAllCallbacks(); - AX_SAFE_RELEASE(_minusSprite); - AX_SAFE_RELEASE(_plusSprite); - AX_SAFE_RELEASE(_minusLabel); - AX_SAFE_RELEASE(_plusLabel); + CC_SAFE_RELEASE(_minusSprite); + CC_SAFE_RELEASE(_plusSprite); + CC_SAFE_RELEASE(_minusLabel); + CC_SAFE_RELEASE(_plusLabel); } bool ControlStepper::initWithMinusSpriteAndPlusSprite(Sprite* minusSprite, Sprite* plusSprite) @@ -124,7 +124,7 @@ ControlStepper* ControlStepper::create(Sprite* minusSprite, Sprite* plusSprite) } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; } @@ -224,14 +224,14 @@ void ControlStepper::startAutorepeat() { _autorepeatCount = -1; - this->schedule(AX_SCHEDULE_SELECTOR(ControlStepper::update), kAutorepeatDeltaTime, AX_REPEAT_FOREVER, + this->schedule(CC_SCHEDULE_SELECTOR(ControlStepper::update), kAutorepeatDeltaTime, CC_REPEAT_FOREVER, kAutorepeatDeltaTime * 3); } /** Stop the autorepeat. */ void ControlStepper::stopAutorepeat() { - this->unschedule(AX_SCHEDULE_SELECTOR(ControlStepper::update)); + this->unschedule(CC_SCHEDULE_SELECTOR(ControlStepper::update)); } void ControlStepper::update(float /*dt*/) diff --git a/extensions/GUI/CCControlExtension/CCControlStepper.h b/extensions/GUI/CCControlExtension/CCControlStepper.h index 0c1a20a224..b38e149b53 100644 --- a/extensions/GUI/CCControlExtension/CCControlStepper.h +++ b/extensions/GUI/CCControlExtension/CCControlStepper.h @@ -43,7 +43,7 @@ NS_AX_EXT_BEGIN * @{ */ -class AX_EX_DLL ControlStepper : public Control +class CC_EX_DLL ControlStepper : public Control { public: enum class Part @@ -113,10 +113,10 @@ protected: int _autorepeatCount; // Weak links to children - AX_SYNTHESIZE_RETAIN(Sprite*, _minusSprite, MinusSprite) - AX_SYNTHESIZE_RETAIN(Sprite*, _plusSprite, PlusSprite) - AX_SYNTHESIZE_RETAIN(Label*, _minusLabel, MinusLabel) - AX_SYNTHESIZE_RETAIN(Label*, _plusLabel, PlusLabel) + CC_SYNTHESIZE_RETAIN(Sprite*, _minusSprite, MinusSprite) + CC_SYNTHESIZE_RETAIN(Sprite*, _plusSprite, PlusSprite) + CC_SYNTHESIZE_RETAIN(Label*, _minusLabel, MinusLabel) + CC_SYNTHESIZE_RETAIN(Label*, _plusLabel, PlusLabel) }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp index c6a01c405e..6ce82e48d8 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; - AX_SYNTHESIZE(float, _onPosition, OnPosition) - AX_SYNTHESIZE(float, _offPosition, OffPosition) + CC_SYNTHESIZE(float, _onPosition, OnPosition) + CC_SYNTHESIZE(float, _offPosition, OffPosition) - AX_SYNTHESIZE_RETAIN(Texture2D*, _maskTexture, MaskTexture) - AX_SYNTHESIZE(uint32_t, _textureLocation, TextureLocation) - AX_SYNTHESIZE(uint32_t, _maskLocation, MaskLocation) + CC_SYNTHESIZE_RETAIN(Texture2D*, _maskTexture, MaskTexture) + CC_SYNTHESIZE(uint32_t, _textureLocation, TextureLocation) + CC_SYNTHESIZE(uint32_t, _maskLocation, MaskLocation) - 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) + 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) Sprite* _clipperStencil; @@ -120,7 +120,7 @@ protected: Label* offLabel); private: - AX_DISALLOW_COPY_AND_ASSIGN(ControlSwitchSprite); + CC_DISALLOW_COPY_AND_ASSIGN(ControlSwitchSprite); }; ControlSwitchSprite* ControlSwitchSprite::create(Sprite* maskSprite, @@ -153,13 +153,13 @@ ControlSwitchSprite::ControlSwitchSprite() ControlSwitchSprite::~ControlSwitchSprite() { - 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); + 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); } bool ControlSwitchSprite::initWithMaskSprite(Sprite* maskSprite, @@ -282,7 +282,7 @@ ControlSwitch::ControlSwitch() : _switchSprite(nullptr), _initialTouchXPosition( ControlSwitch::~ControlSwitch() { - AX_SAFE_RELEASE(_switchSprite); + CC_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 { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; } @@ -348,7 +348,7 @@ ControlSwitch* ControlSwitch::create(Sprite* maskSprite, } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.h b/extensions/GUI/CCControlExtension/CCControlSwitch.h index 02ba46b79c..3231a314c3 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 AX_EX_DLL ControlSwitch : public Control +class CC_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 4e3ded4d95..3d59cbcea3 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 AX_EX_DLL Color3bObject : public Ref +class CC_EX_DLL Color3bObject : public Ref { public: Color3B value; @@ -76,7 +76,7 @@ public: Color3bObject(Color3B s_value) : value(s_value) {} }; -class AX_EX_DLL ControlUtils +class CC_EX_DLL ControlUtils { public: /** diff --git a/extensions/GUI/CCControlExtension/CCInvocation.h b/extensions/GUI/CCControlExtension/CCInvocation.h index 931a3dd62e..1cfbd2c51d 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 AX_EX_DLL Invocation : public Ref +class CC_EX_DLL Invocation : public Ref { public: /** @@ -69,9 +69,9 @@ public: void invoke(Ref* sender); protected: - AX_SYNTHESIZE_READONLY(Control::Handler, _action, Action); - AX_SYNTHESIZE_READONLY(Ref*, _target, Target); - AX_SYNTHESIZE_READONLY(Control::EventType, _controlEvent, ControlEvent); + CC_SYNTHESIZE_READONLY(Control::Handler, _action, Action); + CC_SYNTHESIZE_READONLY(Ref*, _target, Target); + CC_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 ac0c692a27..d9331addda 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 { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; } @@ -92,7 +92,7 @@ ScrollView* ScrollView::create() } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; } @@ -186,10 +186,10 @@ void ScrollView::setTouchEnabled(bool enabled) { _touchListener = EventListenerTouchOneByOne::create(); _touchListener->setSwallowTouches(true); - _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); + _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); _eventDispatcher->addEventListenerWithSceneGraphPriority(_touchListener, this); } @@ -244,10 +244,10 @@ void ScrollView::setContentOffsetInDuration(Vec2 offset, float dt) stopAnimatedContentOffset(); } scroll = MoveTo::create(dt, offset); - expire = CallFuncN::create(AX_CALLBACK_1(ScrollView::stoppedAnimatedScroll, this)); + expire = CallFuncN::create(CC_CALLBACK_1(ScrollView::stoppedAnimatedScroll, this)); _animatedScrollAction = _container->runAction(Sequence::create(scroll, expire, nullptr)); _animatedScrollAction->retain(); - this->schedule(AX_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); + this->schedule(CC_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); } void ScrollView::stopAnimatedContentOffset() @@ -426,7 +426,7 @@ void ScrollView::deaccelerateScrolling(float /*dt*/) { if (_dragging) { - this->unschedule(AX_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); + this->unschedule(CC_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(AX_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); + this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); this->relocateContainer(true); } } void ScrollView::stoppedAnimatedScroll(Node* /*node*/) { - this->unschedule(AX_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); + this->unschedule(CC_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(AX_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); + this->unschedule(CC_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 = AX_CALLBACK_0(ScrollView::onBeforeDraw, this); + // _beforeDrawCommand.func = CC_CALLBACK_0(ScrollView::onBeforeDraw, this); // Director::getInstance()->getRenderer()->addCommand(&_beforeDrawCommand); } @@ -610,7 +610,7 @@ void ScrollView::afterDraw() { // TODO: minggo // _afterDrawCommand.init(_globalZOrder); - // _afterDrawCommand.func = AX_CALLBACK_0(ScrollView::onAfterDraw, this); + // _afterDrawCommand.func = CC_CALLBACK_0(ScrollView::onAfterDraw, this); // Director::getInstance()->getRenderer()->addCommand(&_afterDrawCommand); } @@ -850,7 +850,7 @@ void ScrollView::onTouchEnded(Touch* touch, Event* /*event*/) { if (_touches.size() == 1 && _touchMoved) { - this->schedule(AX_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); + this->schedule(CC_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); } _touches.erase(touchIter); } diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index b5fb41f36a..8e90324f62 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -41,7 +41,7 @@ NS_AX_EXT_BEGIN class ScrollView; -class AX_EX_DLL ScrollViewDelegate +class CC_EX_DLL ScrollViewDelegate { public: /** @@ -65,7 +65,7 @@ public: * ScrollView support for cocos2d-x. * It provides scroll view functionalities to cocos2d projects natively. */ -class AX_EX_DLL ScrollView : public Layer, public ActionTweenDelegate +class CC_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 a634d809cb..8b01add9ce 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)) { - AX_SAFE_DELETE(_indices); + CC_SAFE_DELETE(_indices); _indices = new std::set(); _vordering = VerticalFillOrder::BOTTOM_UP; this->setDirection(Direction::VERTICAL); @@ -93,7 +93,7 @@ TableView::TableView() TableView::~TableView() { - AX_SAFE_DELETE(_indices); + CC_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 == AX_INVALID_INDEX) + if (idx == CC_INVALID_INDEX) { return; } @@ -184,7 +184,7 @@ void TableView::updateCellAtIndex(ssize_t idx) void TableView::insertCellAtIndex(ssize_t idx) { - if (idx == AX_INVALID_INDEX) + if (idx == CC_INVALID_INDEX) { return; } @@ -220,7 +220,7 @@ void TableView::insertCellAtIndex(ssize_t idx) void TableView::removeCellAtIndex(ssize_t idx) { - if (idx == AX_INVALID_INDEX) + if (idx == CC_INVALID_INDEX) { return; } @@ -364,7 +364,7 @@ long TableView::_indexFromOffset(Vec2 offset) index = MAX(0, index); if (index > maxIdx) { - index = AX_INVALID_INDEX; + index = CC_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 == AX_INVALID_INDEX) + if (startIdx == CC_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 == AX_INVALID_INDEX) + if (endIdx == CC_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 == AX_INVALID_INDEX) + if (index == CC_INVALID_INDEX) { _touchedCell = nullptr; } diff --git a/extensions/GUI/CCScrollView/CCTableView.h b/extensions/GUI/CCScrollView/CCTableView.h index 972f3c3051..bcb9f1125b 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 AX_EX_DLL TableViewDelegate : public ScrollViewDelegate +class CC_EX_DLL TableViewDelegate : public ScrollViewDelegate { public: /** @@ -94,7 +94,7 @@ public: /** * Data source that governs table backend data. */ -class AX_EX_DLL TableViewDataSource +class CC_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 AX_EX_DLL TableView : public ScrollView, public ScrollViewDelegate +class CC_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 2c8a8ca2fd..da0280fe31 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 = AX_INVALID_INDEX; + _idx = CC_INVALID_INDEX; } ssize_t TableViewCell::getIdx() const diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.h b/extensions/GUI/CCScrollView/CCTableViewCell.h index 4b4b5a69ab..cd39fe5009 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 AX_EX_DLL TableViewCell : public Node +class CC_EX_DLL TableViewCell : public Node { public: CREATE_FUNC(TableViewCell); diff --git a/extensions/ImGui/ImGuiPresenter.cpp b/extensions/ImGui/ImGuiPresenter.cpp index 3eca8ac863..8c78179a1e 100644 --- a/extensions/ImGui/ImGuiPresenter.cpp +++ b/extensions/ImGui/ImGuiPresenter.cpp @@ -4,10 +4,10 @@ #include "imgui_internal.h" // TODO: mac metal -#if (defined(AX_USE_GL) || defined(AX_USE_GLES)) -# define AX_IMGUI_ENABLE_MULTI_VIEWPORT 1 +#if (defined(CC_USE_GL) || defined(CC_USE_GLES)) +# define CC_IMGUI_ENABLE_MULTI_VIEWPORT 1 #else -# define AX_IMGUI_ENABLE_MULTI_VIEWPORT 0 +# define CC_IMGUI_ENABLE_MULTI_VIEWPORT 0 #endif NS_AX_EXT_BEGIN @@ -33,7 +33,7 @@ class ImGuiSceneEventTracker : public ImGuiEventTracker public: bool initWithScene(Scene* scene) { -#ifdef AX_PLATFORM_PC +#ifdef CC_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 AX_PLATFORM_PC +#ifdef CC_PLATFORM_PC if (_trackLayer) { if (_trackLayer->getParent()) @@ -96,7 +96,7 @@ class ImGuiGlobalEventTracker : public ImGuiEventTracker public: bool init() { -#ifdef AX_PLATFORM_PC +#ifdef CC_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 AX_PLATFORM_PC +#ifdef CC_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 AX_IMGUI_ENABLE_MULTI_VIEWPORT +#if CC_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(); - AX_SAFE_RELEASE_NULL(_fontsTexture); + CC_SAFE_RELEASE_NULL(_fontsTexture); ImGui::DestroyContext(); } @@ -372,7 +372,7 @@ void ImGuiPresenter::endFrame() ImGui_ImplAxis_RenderPlatform(); --_beginFrames; - AX_SAFE_RELEASE_NULL(_fontsTexture); + CC_SAFE_RELEASE_NULL(_fontsTexture); } } diff --git a/extensions/ImGui/README.md b/extensions/ImGui/README.md index 5890e1493b..b1df1191a0 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", AX_CALLBACK_0(GameScene::onImGuiDraw, this), this); + ImGuiPresenter::getInstance()->addRenderLoop("#im01", CC_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 2a40860240..37b557e93e 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 AX_PTR_CAST(v, pointer_type) reinterpret_cast(v) +#define CC_PTR_CAST(v, pointer_type) reinterpret_cast(v) // fps macro -#define AX_IMGUI_DEFAULT_DELTA (1 / 60.f) -#define AX_IMGUI_MIN_DELTA (1 / 1000.f) -#define AX_IMGUI_MAX_DELTA (1 / 30.f) +#define CC_IMGUI_DEFAULT_DELTA (1 / 60.f) +#define CC_IMGUI_MIN_DELTA (1 / 1000.f) +#define CC_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(); - AX_SAFE_RELEASE_NULL(bd->ProgramInfo.program); - AX_SAFE_RELEASE_NULL(bd->ProgramFontInfo.program); + CC_SAFE_RELEASE_NULL(bd->ProgramInfo.program); + CC_SAFE_RELEASE_NULL(bd->ProgramFontInfo.program); ImGui_ImplAxis_DestroyFontsTexture(); } @@ -1442,8 +1442,8 @@ static bool ImGui_ImplAxis_createShaderPrograms() auto bd = ImGui_ImplGlfw_GetBackendData(); - AX_SAFE_RELEASE(bd->ProgramInfo.program); - AX_SAFE_RELEASE(bd->ProgramFontInfo.program); + CC_SAFE_RELEASE(bd->ProgramInfo.program); + CC_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); - AX_SAFE_RELEASE(bd->FontTexture); + CC_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; - AX_SAFE_RELEASE_NULL(bd->FontTexture); + CC_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 = AX_PTR_CAST(pcmd->TextureId, Texture2D*); + auto tex = CC_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 = AX_PTR_CAST(pcmd->TextureId, Node*); + auto node = CC_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 a5edc5f81e..cf76d05743 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) { - AX_SAFE_RELEASE_NULL(_renderTexture); + CC_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 538dfb3052..ee3fe99663 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(AX_PLATFORM_MOBILE) && !defined(AX_USE_GLES) +#if !defined(CC_PLATFORM_MOBILE) && !defined(CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_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(AX_PLATFORM_MOBILE) && !defined(AX_USE_GLES) +#if !defined(CC_PLATFORM_MOBILE) && !defined(CC_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(AX_PLATFORM_MOBILE) && !defined(AX_USE_GLES) +#if !defined(CC_PLATFORM_MOBILE) && !defined(CC_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(AX_USE_METAL) +#if defined(CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_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 3f44cade54..6889673261 100644 --- a/extensions/Particle3D/CCParticle3DAffector.h +++ b/extensions/Particle3D/CCParticle3DAffector.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PARTICLE_3D_AFFECTOR_H__ -#define __AX_PARTICLE_3D_AFFECTOR_H__ +#ifndef __CC_PARTICLE_3D_AFFECTOR_H__ +#define __CC_PARTICLE_3D_AFFECTOR_H__ #include "base/CCRef.h" #include @@ -35,7 +35,7 @@ NS_AX_BEGIN class ParticleSystem3D; struct Particle3D; -class AX_EX_DLL Particle3DAffector : public Ref +class CC_EX_DLL Particle3DAffector : public Ref { friend class ParticleSystem3D; diff --git a/extensions/Particle3D/CCParticle3DEmitter.h b/extensions/Particle3D/CCParticle3DEmitter.h index 040d163728..ea84104aae 100644 --- a/extensions/Particle3D/CCParticle3DEmitter.h +++ b/extensions/Particle3D/CCParticle3DEmitter.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PARTICLE_3D_EMITTER_H__ -#define __AX_PARTICLE_3D_EMITTER_H__ +#ifndef __CC_PARTICLE_3D_EMITTER_H__ +#define __CC_PARTICLE_3D_EMITTER_H__ #include "base/CCRef.h" #include @@ -37,7 +37,7 @@ struct Particle3D; /** * 3d particle emitter */ -class AX_EX_DLL Particle3DEmitter : public Ref +class CC_EX_DLL Particle3DEmitter : public Ref { friend class ParticleSystem3D; diff --git a/extensions/Particle3D/CCParticle3DRender.cpp b/extensions/Particle3D/CCParticle3DRender.cpp index 1c14d49f58..fe378faf5b 100644 --- a/extensions/Particle3D/CCParticle3DRender.cpp +++ b/extensions/Particle3D/CCParticle3DRender.cpp @@ -45,10 +45,10 @@ Particle3DQuadRender::Particle3DQuadRender() Particle3DQuadRender::~Particle3DQuadRender() { - // AX_SAFE_RELEASE(_texture); - AX_SAFE_RELEASE(_programState); - AX_SAFE_RELEASE(_vertexBuffer); - AX_SAFE_RELEASE(_indexBuffer); + // CC_SAFE_RELEASE(_texture); + CC_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_vertexBuffer); + CC_SAFE_RELEASE(_indexBuffer); } Particle3DQuadRender* Particle3DQuadRender::create(std::string_view texFile) @@ -61,7 +61,7 @@ Particle3DQuadRender* Particle3DQuadRender::create(std::string_view texFile) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -167,8 +167,8 @@ void Particle3DQuadRender::render(Renderer* renderer, const Mat4& transform, Par auto afterCommand = renderer->nextCallbackCommand(); afterCommand->init(depthZ); - beforeCommand->func = [=]() { onBeforeDraw(); }; // AX_CALLBACK_0(Particle3DQuadRender::onBeforeDraw, this); - afterCommand->func = [=]() { onAfterDraw(); }; // AX_CALLBACK_0(Particle3DQuadRender::onAfterDraw, this); + beforeCommand->func = [=]() { onBeforeDraw(); }; // CC_CALLBACK_0(Particle3DQuadRender::onBeforeDraw, this); + afterCommand->func = [=]() { onAfterDraw(); }; // CC_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) { - AX_SAFE_RELEASE_NULL(_programState); + CC_SAFE_RELEASE_NULL(_programState); if (!texFile.empty()) { diff --git a/extensions/Particle3D/CCParticle3DRender.h b/extensions/Particle3D/CCParticle3DRender.h index 9e2049f0ed..eff20b1857 100644 --- a/extensions/Particle3D/CCParticle3DRender.h +++ b/extensions/Particle3D/CCParticle3DRender.h @@ -50,7 +50,7 @@ class Texture2D; /** * 3d particle render */ -class AX_EX_DLL Particle3DRender : public Ref +class CC_EX_DLL Particle3DRender : public Ref { friend class ParticleSystem3D; @@ -92,7 +92,7 @@ protected: }; // particle render for quad -class AX_EX_DLL Particle3DQuadRender : public Particle3DRender +class CC_EX_DLL Particle3DQuadRender : public Particle3DRender { public: static Particle3DQuadRender* create(std::string_view texFile = ""); @@ -142,7 +142,7 @@ protected: }; // particle renderer using MeshRenderer -class AX_EX_DLL Particle3DModelRender : public Particle3DRender +class CC_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 b03c955293..845cfdac0c 100644 --- a/extensions/Particle3D/CCParticleSystem3D.cpp +++ b/extensions/Particle3D/CCParticleSystem3D.cpp @@ -48,8 +48,8 @@ ParticleSystem3D::~ParticleSystem3D() { // stopParticle(); removeAllAffector(); - AX_SAFE_RELEASE(_emitter); - AX_SAFE_RELEASE(_render); + CC_SAFE_RELEASE(_emitter); + CC_SAFE_RELEASE(_render); } void ParticleSystem3D::startParticleSystem() @@ -96,10 +96,10 @@ void ParticleSystem3D::setEmitter(Particle3DEmitter* emitter) { if (_emitter != emitter) { - AX_SAFE_RELEASE(_emitter); + CC_SAFE_RELEASE(_emitter); emitter->_particleSystem = this; _emitter = emitter; - AX_SAFE_RETAIN(_emitter); + CC_SAFE_RETAIN(_emitter); } } @@ -107,10 +107,10 @@ void ParticleSystem3D::setRender(Particle3DRender* render) { if (_render != render) { - AX_SAFE_RELEASE(_render); + CC_SAFE_RELEASE(_render); _render = render; _render->_particleSystem = this; - AX_SAFE_RETAIN(_render); + CC_SAFE_RETAIN(_render); } } diff --git a/extensions/Particle3D/CCParticleSystem3D.h b/extensions/Particle3D/CCParticleSystem3D.h index 4bca820146..fcb0e126d9 100644 --- a/extensions/Particle3D/CCParticleSystem3D.h +++ b/extensions/Particle3D/CCParticleSystem3D.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PARTICLE_SYSTEM_3D_H__ -#define __AX_PARTICLE_SYSTEM_3D_H__ +#ifndef __CC_PARTICLE_SYSTEM_3D_H__ +#define __CC_PARTICLE_SYSTEM_3D_H__ #include "2d/CCNode.h" #include "math/CCMath.h" @@ -42,7 +42,7 @@ class Particle3DEmitter; class Particle3DAffector; class Particle3DRender; -struct AX_EX_DLL Particle3D +struct CC_EX_DLL Particle3D { Particle3D(); virtual ~Particle3D(); @@ -61,7 +61,7 @@ struct AX_EX_DLL Particle3D }; template -class AX_EX_DLL DataPool +class CC_EX_DLL DataPool { public: typedef typename std::list PoolList; @@ -157,7 +157,7 @@ private: typedef DataPool ParticlePool; -class AX_EX_DLL ParticleSystem3D : public Node, public BlendProtocol +class CC_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 318aea6c0a..a76f174f62 100644 --- a/extensions/Particle3D/PU/CCPUAffector.h +++ b/extensions/Particle3D/PU/CCPUAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_AFFECTOR_H__ +#define __CC_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 AX_EX_DLL PUAffector : public Particle3DAffector +class CC_EX_DLL PUAffector : public Particle3DAffector { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/PU/CCPUAffectorManager.h b/extensions/Particle3D/PU/CCPUAffectorManager.h index f98e7261ab..86979b25cc 100644 --- a/extensions/Particle3D/PU/CCPUAffectorManager.h +++ b/extensions/Particle3D/PU/CCPUAffectorManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ -#define __AX_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ +#ifndef __CC_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ +#define __CC_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" @@ -59,7 +59,7 @@ NS_AX_BEGIN -class AX_EX_DLL PUAffectorManager +class CC_EX_DLL PUAffectorManager { public: static PUAffectorManager* Instance(); diff --git a/extensions/Particle3D/PU/CCPUAffectorTranslator.h b/extensions/Particle3D/PU/CCPUAffectorTranslator.h index 44063be30a..8abfb0261b 100644 --- a/extensions/Particle3D/PU/CCPUAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_AFFECTOR_TRANSLATOR_H__ +#define __CC_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 AX_EX_DLL PUAffectorTranslator : public PUScriptTranslator +class CC_EX_DLL PUAffectorTranslator : public PUScriptTranslator { protected: PUAffector* _affector; diff --git a/extensions/Particle3D/PU/CCPUAlignAffector.h b/extensions/Particle3D/PU/CCPUAlignAffector.h index d80beaf57f..478382ac9d 100644 --- a/extensions/Particle3D/PU/CCPUAlignAffector.h +++ b/extensions/Particle3D/PU/CCPUAlignAffector.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ALIGN_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_ALIGN_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_ALIGN_AFFECTOR_H__ +#define __CC_PU_PARTICLE_3D_ALIGN_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" NS_AX_BEGIN -class AX_EX_DLL PUAlignAffector : public PUAffector +class CC_EX_DLL PUAlignAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUAlignAffectorTranslator.h b/extensions/Particle3D/PU/CCPUAlignAffectorTranslator.h index f80817f7b4..f0437c70ef 100644 --- a/extensions/Particle3D/PU/CCPUAlignAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUAlignAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ALIGN_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_ALIGN_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_ALIGN_AFFECTOR_TRANSLATOR_H__ +#define __CC_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 AX_EX_DLL PUAlignAffectorTranslator : public PUScriptTranslator +class CC_EX_DLL PUAlignAffectorTranslator : public PUScriptTranslator { public: PUAlignAffectorTranslator(); diff --git a/extensions/Particle3D/PU/CCPUBaseCollider.h b/extensions/Particle3D/PU/CCPUBaseCollider.h index 2f09f89adb..739c92c621 100644 --- a/extensions/Particle3D/PU/CCPUBaseCollider.h +++ b/extensions/Particle3D/PU/CCPUBaseCollider.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_BASE_COLLIDER_H__ -#define __AX_PU_PARTICLE_3D_BASE_COLLIDER_H__ +#ifndef __CC_PU_PARTICLE_3D_BASE_COLLIDER_H__ +#define __CC_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 AX_EX_DLL PUBaseCollider : public PUAffector +class CC_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 f8dfd22c4e..cee8a94671 100644 --- a/extensions/Particle3D/PU/CCPUBaseColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUBaseColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_BASE_COLLIDER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_BASE_COLLIDER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_BASE_COLLIDER_TRANSLATOR_H__ +#define __CC_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 AX_EX_DLL PUBaseColliderTranslator : public PUScriptTranslator +class CC_EX_DLL PUBaseColliderTranslator : public PUScriptTranslator { public: PUBaseColliderTranslator(); diff --git a/extensions/Particle3D/PU/CCPUBaseForceAffector.h b/extensions/Particle3D/PU/CCPUBaseForceAffector.h index f7d22b95fa..05358425e1 100644 --- a/extensions/Particle3D/PU/CCPUBaseForceAffector.h +++ b/extensions/Particle3D/PU/CCPUBaseForceAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_BASE_FORCE_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_BASE_FORCE_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_BASE_FORCE_AFFECTOR_H__ +#define __CC_PU_PARTICLE_3D_BASE_FORCE_AFFECTOR_H__ #include "math/CCMath.h" #include "extensions/Particle3D/PU/CCPUAffector.h" NS_AX_BEGIN -class AX_EX_DLL PUBaseForceAffector : public PUAffector +class CC_EX_DLL PUBaseForceAffector : public PUAffector { public: enum ForceApplication diff --git a/extensions/Particle3D/PU/CCPUBaseForceAffectorTranslator.h b/extensions/Particle3D/PU/CCPUBaseForceAffectorTranslator.h index 339eb635f1..101eca3c83 100644 --- a/extensions/Particle3D/PU/CCPUBaseForceAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUBaseForceAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_BASE_FORCE_AFFECT_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_BASE_FORCE_AFFECT_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_BASE_FORCE_AFFECT_TRANSLATOR_H__ +#define __CC_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 AX_EX_DLL PUBaseForceAffectorTranslator : public PUScriptTranslator +class CC_EX_DLL PUBaseForceAffectorTranslator : public PUScriptTranslator { public: PUBaseForceAffectorTranslator(); diff --git a/extensions/Particle3D/PU/CCPUBeamRender.cpp b/extensions/Particle3D/PU/CCPUBeamRender.cpp index 6f5e892cb6..b8696c2be6 100644 --- a/extensions/Particle3D/PU/CCPUBeamRender.cpp +++ b/extensions/Particle3D/PU/CCPUBeamRender.cpp @@ -340,7 +340,7 @@ void PUBeamRender::destroyAll() static_cast(_particleSystem)->removeListener(this); // Delete the BillboardChain - AX_SAFE_DELETE(_billboardChain); + CC_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 56c55bb6c7..cb567edd5f 100644 --- a/extensions/Particle3D/PU/CCPUBeamRender.h +++ b/extensions/Particle3D/PU/CCPUBeamRender.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_BEAM_RENDER_H__ -#define __AX_PU_PARTICLE_3D_BEAM_RENDER_H__ +#ifndef __CC_PU_PARTICLE_3D_BEAM_RENDER_H__ +#define __CC_PU_PARTICLE_3D_BEAM_RENDER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -76,7 +76,7 @@ public: }; // particle render for quad -class AX_EX_DLL PUBeamRender : public PURender, public PUListener +class CC_EX_DLL PUBeamRender : public PURender, public PUListener { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUBehaviour.h b/extensions/Particle3D/PU/CCPUBehaviour.h index 85a1b8b52c..37e5dc4edc 100644 --- a/extensions/Particle3D/PU/CCPUBehaviour.h +++ b/extensions/Particle3D/PU/CCPUBehaviour.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_BEHAVIOUR_H__ -#define __AX_PU_PARTICLE_3D_BEHAVIOUR_H__ +#ifndef __CC_PU_PARTICLE_3D_BEHAVIOUR_H__ +#define __CC_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 AX_EX_DLL PUBehaviour : public Ref +class CC_EX_DLL PUBehaviour : public Ref { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/PU/CCPUBehaviourManager.h b/extensions/Particle3D/PU/CCPUBehaviourManager.h index 3e9081ec59..f56d3085d3 100644 --- a/extensions/Particle3D/PU/CCPUBehaviourManager.h +++ b/extensions/Particle3D/PU/CCPUBehaviourManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__ -#define __AX_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__ +#ifndef __CC_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__ +#define __CC_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 1ea887043b..7b5a3a91c5 100644 --- a/extensions/Particle3D/PU/CCPUBehaviourTranslator.h +++ b/extensions/Particle3D/PU/CCPUBehaviourTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_BEHAVIOUR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_BEHAVIOUR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_BEHAVIOUR_TRANSLATOR_H__ +#define __CC_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 4c429d44bf..fff5ec20ff 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() { - // AX_SAFE_RELEASE(_texture); - AX_SAFE_RELEASE(_programState); - AX_SAFE_RELEASE(_vertexBuffer); - AX_SAFE_RELEASE(_indexBuffer); + // CC_SAFE_RELEASE(_texture); + CC_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_vertexBuffer); + CC_SAFE_RELEASE(_indexBuffer); } //----------------------------------------------------------------------- void PUBillboardChain::setupChainContainers() @@ -153,8 +153,8 @@ void PUBillboardChain::setupBuffers() // setupVertexDeclaration(); if (_buffersNeedRecreating) { - AX_SAFE_RELEASE_NULL(_vertexBuffer); - AX_SAFE_RELEASE_NULL(_indexBuffer); + CC_SAFE_RELEASE_NULL(_vertexBuffer); + CC_SAFE_RELEASE_NULL(_indexBuffer); size_t stride = sizeof(VertexInfo); _vertexBuffer = backend::Device::getInstance()->newBuffer( @@ -629,7 +629,7 @@ void PUBillboardChain::updateIndexBuffer() //----------------------------------------------------------------------- void PUBillboardChain::init(std::string_view texFile) { - AX_SAFE_RELEASE_NULL(_programState); + CC_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(AX_CALLBACK_0(PUBillboardChain::onBeforeDraw, this)); - _meshCommand.setAfterCallback(AX_CALLBACK_0(PUBillboardChain::onAfterDraw, this)); + _meshCommand.setBeforeCallback(CC_CALLBACK_0(PUBillboardChain::onBeforeDraw, this)); + _meshCommand.setAfterCallback(CC_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 e2b37a8727..7fb7f3f90e 100644 --- a/extensions/Particle3D/PU/CCPUBoxCollider.h +++ b/extensions/Particle3D/PU/CCPUBoxCollider.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_BOX_COLLIDER_H__ -#define __AX_PU_PARTICLE_3D_BOX_COLLIDER_H__ +#ifndef __CC_PU_PARTICLE_3D_BOX_COLLIDER_H__ +#define __CC_PU_PARTICLE_3D_BOX_COLLIDER_H__ #include "CCPUBaseCollider.h" NS_AX_BEGIN -class AX_EX_DLL PUBoxCollider : public PUBaseCollider +class CC_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 5546a359a4..943108edca 100644 --- a/extensions/Particle3D/PU/CCPUBoxColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUBoxColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_BOX_COLLIDER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_BOX_COLLIDER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_BOX_COLLIDER_TRANSLATOR_H__ +#define __CC_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.h b/extensions/Particle3D/PU/CCPUBoxEmitter.h index 1689c5d720..146c65fcef 100644 --- a/extensions/Particle3D/PU/CCPUBoxEmitter.h +++ b/extensions/Particle3D/PU/CCPUBoxEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_BOX_EMITTER_H__ -#define __AX_PU_PARTICLE_3D_BOX_EMITTER_H__ +#ifndef __CC_PU_PARTICLE_3D_BOX_EMITTER_H__ +#define __CC_PU_PARTICLE_3D_BOX_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class AX_EX_DLL CCPUBoxEmitter : public PUEmitter +class CC_EX_DLL CCPUBoxEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUBoxEmitterTranslator.h b/extensions/Particle3D/PU/CCPUBoxEmitterTranslator.h index 282b24cac1..8c35623e86 100644 --- a/extensions/Particle3D/PU/CCPUBoxEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUBoxEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_BOX_EMITTER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_BOX_EMITTER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_BOX_EMITTER_TRANSLATOR_H__ +#define __CC_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 641899e73c..e101d3c3e5 100644 --- a/extensions/Particle3D/PU/CCPUCircleEmitter.h +++ b/extensions/Particle3D/PU/CCPUCircleEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_CIRCLE_EMITTER_H__ -#define __AX_PU_PARTICLE_3D_CIRCLE_EMITTER_H__ +#ifndef __CC_PU_PARTICLE_3D_CIRCLE_EMITTER_H__ +#define __CC_PU_PARTICLE_3D_CIRCLE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class AX_EX_DLL PUCircleEmitter : public PUEmitter +class CC_EX_DLL PUCircleEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUCircleEmitterTranslator.h b/extensions/Particle3D/PU/CCPUCircleEmitterTranslator.h index d64b03f955..5e03d54b00 100644 --- a/extensions/Particle3D/PU/CCPUCircleEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUCircleEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_CIRCLE_EMITTER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_CIRCLE_EMITTER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_CIRCLE_EMITTER_TRANSLATOR_H__ +#define __CC_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.h b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.h index 7c0eceab35..0ce443269f 100644 --- a/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.h +++ b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_H__ +#define __CC_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" NS_AX_BEGIN -class AX_EX_DLL PUCollisionAvoidanceAffector : public PUAffector +class CC_EX_DLL PUCollisionAvoidanceAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffectorTranslator.h b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffectorTranslator.h index 1060648226..bb16906a5c 100644 --- a/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_TRANSLATOR_H__ +#define __CC_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 3b680de222..e9ae4841d0 100644 --- a/extensions/Particle3D/PU/CCPUColorAffector.h +++ b/extensions/Particle3D/PU/CCPUColorAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_COLOR_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_COLOR_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_COLOR_AFFECTOR_H__ +#define __CC_PU_PARTICLE_3D_COLOR_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class AX_EX_DLL PUColorAffector : public PUAffector +class CC_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 d9d65741ab..2fe9683a64 100644 --- a/extensions/Particle3D/PU/CCPUColorAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUColorAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_COLOR_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_COLOR_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_COLOR_AFFECTOR_TRANSLATOR_H__ +#define __CC_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 16aa6d3bcc..f0770e81dc 100644 --- a/extensions/Particle3D/PU/CCPUDoAffectorEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoAffectorEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_H__ -#define __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_H__ +#define __CC_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 AX_EX_DLL PUDoAffectorEventHandler : public PUEventHandler +class CC_EX_DLL PUDoAffectorEventHandler : public PUEventHandler { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUDoAffectorEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoAffectorEventHandlerTranslator.h index b380e5e7d3..2595f85277 100644 --- a/extensions/Particle3D/PU/CCPUDoAffectorEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoAffectorEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_TRANSLATOR_H__ +#define __CC_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 5cc64a9361..3404cd65c3 100644 --- a/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_H__ -#define __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_H__ +#define __CC_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 AX_EX_DLL PUDoEnableComponentEventHandler : public PUEventHandler +class CC_EX_DLL PUDoEnableComponentEventHandler : public PUEventHandler { public: static PUDoEnableComponentEventHandler* create(); diff --git a/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandlerTranslator.h index 9c6bd55f68..deaa3a711d 100644 --- a/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_TRANSLATOR_H__ +#define __CC_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 29f44d89f9..97780aada0 100644 --- a/extensions/Particle3D/PU/CCPUDoExpireEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoExpireEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_H__ -#define __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_H__ +#define __CC_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 AX_EX_DLL PUDoExpireEventHandler : public PUEventHandler +class CC_EX_DLL PUDoExpireEventHandler : public PUEventHandler { public: static PUDoExpireEventHandler* create(); diff --git a/extensions/Particle3D/PU/CCPUDoExpireEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoExpireEventHandlerTranslator.h index 1ed398c8f1..ebbeafe75f 100644 --- a/extensions/Particle3D/PU/CCPUDoExpireEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoExpireEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_TRANSLATOR_H__ +#define __CC_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 b818002fbd..ec2d6b41ff 100644 --- a/extensions/Particle3D/PU/CCPUDoFreezeEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoFreezeEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_H__ -#define __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_H__ +#define __CC_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 AX_EX_DLL PUDoFreezeEventHandler : public PUEventHandler +class CC_EX_DLL PUDoFreezeEventHandler : public PUEventHandler { public: static PUDoFreezeEventHandler* create(); diff --git a/extensions/Particle3D/PU/CCPUDoFreezeEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoFreezeEventHandlerTranslator.h index f76f7d9ebf..343b8dab3b 100644 --- a/extensions/Particle3D/PU/CCPUDoFreezeEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoFreezeEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_TRANSLATOR_H__ +#define __CC_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 99d985eb41..2ef7910abe 100644 --- a/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_H__ -#define __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_H__ +#define __CC_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 AX_EX_DLL PUDoPlacementParticleEventHandler : public PUEventHandler, public PUListener +class CC_EX_DLL PUDoPlacementParticleEventHandler : public PUEventHandler, public PUListener { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandlerTranslator.h index 989373b1f6..0e7fedb4e9 100644 --- a/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_TRANSLATOR_H__ +#define __CC_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 a0661b5a1b..1ac2fdf61f 100644 --- a/extensions/Particle3D/PU/CCPUDoScaleEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoScaleEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_H__ -#define __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_H__ +#define __CC_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 AX_EX_DLL PUDoScaleEventHandler : public PUEventHandler +class CC_EX_DLL PUDoScaleEventHandler : public PUEventHandler { public: enum ScaleType diff --git a/extensions/Particle3D/PU/CCPUDoScaleEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoScaleEventHandlerTranslator.h index 1d33d1e00b..6454f543eb 100644 --- a/extensions/Particle3D/PU/CCPUDoScaleEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoScaleEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_TRANSLATOR_H__ +#define __CC_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 3f9febdd0b..1dcde9f3bb 100644 --- a/extensions/Particle3D/PU/CCPUDoStopSystemEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoStopSystemEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_STOP_SYSTEM_EVENT_HANDLER_H__ -#define __AX_PU_PARTICLE_3D_DO_STOP_SYSTEM_EVENT_HANDLER_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_STOP_SYSTEM_EVENT_HANDLER_H__ +#define __CC_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 AX_EX_DLL PUDoStopSystemEventHandler : public PUEventHandler +class CC_EX_DLL PUDoStopSystemEventHandler : public PUEventHandler { protected: public: diff --git a/extensions/Particle3D/PU/CCPUDoStopSystemEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoStopSystemEventHandlerTranslator.h index 8236934efe..0b9d6e818b 100644 --- a/extensions/Particle3D/PU/CCPUDoStopSystemEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoStopSystemEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_STOP_EVENT_HANDLER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_DO_STOP_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_STOP_EVENT_HANDLER_TRANSLATOR_H__ +#define __CC_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 67495e0201..5bbeec74e1 100644 --- a/extensions/Particle3D/PU/CCPUDynamicAttribute.h +++ b/extensions/Particle3D/PU/CCPUDynamicAttribute.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_H__ -#define __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_H__ +#ifndef __CC_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_H__ +#define __CC_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 AX_EX_DLL PUDynamicAttribute : public Ref +class CC_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 AX_EX_DLL PUDynamicAttributeFixed : public PUDynamicAttribute +class CC_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 AX_EX_DLL PUDynamicAttributeRandom : public PUDynamicAttribute +class CC_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 AX_EX_DLL PUDynamicAttributeCurved : public PUDynamicAttribute +class CC_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 AX_EX_DLL PUDynamicAttributeOscillate : public PUDynamicAttribute +class CC_EX_DLL PUDynamicAttributeOscillate : public PUDynamicAttribute { public: enum OscillationType diff --git a/extensions/Particle3D/PU/CCPUDynamicAttributeTranslator.h b/extensions/Particle3D/PU/CCPUDynamicAttributeTranslator.h index 2b044cb113..b26412e3c0 100644 --- a/extensions/Particle3D/PU/CCPUDynamicAttributeTranslator.h +++ b/extensions/Particle3D/PU/CCPUDynamicAttributeTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_TRANSLATOR_H__ +#define __CC_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 7f78c6524a..b25a5414ac 100644 --- a/extensions/Particle3D/PU/CCPUEmitter.cpp +++ b/extensions/Particle3D/PU/CCPUEmitter.cpp @@ -236,7 +236,7 @@ void PUEmitter::initParticleDirection(PUParticle3D* particle) void PUEmitter::generateAngle(float& angle) { - float a = AX_DEGREES_TO_RADIANS(_dynamicAttributeHelper.calculate( + float a = CC_DEGREES_TO_RADIANS(_dynamicAttributeHelper.calculate( _dynAngle, (static_cast(_particleSystem))->getTimeElapsedSinceStart())); angle = a; if (_dynAngle->getType() == PUDynamicAttribute::DAT_FIXED) diff --git a/extensions/Particle3D/PU/CCPUEmitter.h b/extensions/Particle3D/PU/CCPUEmitter.h index ff9c78e5d4..6eadc7f9f6 100644 --- a/extensions/Particle3D/PU/CCPUEmitter.h +++ b/extensions/Particle3D/PU/CCPUEmitter.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_EMITTER_H__ -#define __AX_PU_PARTICLE_3D_EMITTER_H__ +#ifndef __CC_PU_PARTICLE_3D_EMITTER_H__ +#define __CC_PU_PARTICLE_3D_EMITTER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -41,7 +41,7 @@ class PUParticleSystem3D; /** * 3d particle emitter */ -class AX_EX_DLL PUEmitter : public Particle3DEmitter +class CC_EX_DLL PUEmitter : public Particle3DEmitter { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/PU/CCPUEmitterManager.h b/extensions/Particle3D/PU/CCPUEmitterManager.h index 79bd13f291..d302e6dc2a 100644 --- a/extensions/Particle3D/PU/CCPUEmitterManager.h +++ b/extensions/Particle3D/PU/CCPUEmitterManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_EMITTER_MANAGER_H__ -#define __AX_PU_PARTICLE_3D_EMITTER_MANAGER_H__ +#ifndef __CC_PU_PARTICLE_3D_EMITTER_MANAGER_H__ +#define __CC_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 b5a46e81bf..676ed8afd4 100644 --- a/extensions/Particle3D/PU/CCPUEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_EMITTER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_EMITTER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_EMITTER_TRANSLATOR_H__ +#define __CC_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 c0f037dc37..e5bb16c050 100644 --- a/extensions/Particle3D/PU/CCPUEventHandler.h +++ b/extensions/Particle3D/PU/CCPUEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_EVENT_HANDLER_H__ -#define __AX_PU_PARTICLE_3D_EVENT_HANDLER_H__ +#ifndef __CC_PU_PARTICLE_3D_EVENT_HANDLER_H__ +#define __CC_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 AX_EX_DLL PUEventHandler : public Ref +class CC_EX_DLL PUEventHandler : public Ref { public: /** Todo diff --git a/extensions/Particle3D/PU/CCPUEventHandlerManager.h b/extensions/Particle3D/PU/CCPUEventHandlerManager.h index 03b51b1d00..26052cb8b9 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 __AX_PU_PARTICLE_3D_EVENT_HANDLER_MANAGER_H__ -#define __AX_PU_PARTICLE_3D_EVENT_HANDLER_MANAGER_H__ +#ifndef __CC_PU_PARTICLE_3D_EVENT_HANDLER_MANAGER_H__ +#define __CC_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 e6c906de8d..769aecdf96 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 __AX_PU_PARTICLE_3D_EVENT_HANDLER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_EVENT_HANDLER_TRANSLATOR_H__ +#define __CC_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 e1221283f5..0910d16caa 100644 --- a/extensions/Particle3D/PU/CCPUFlockCenteringAffector.h +++ b/extensions/Particle3D/PU/CCPUFlockCenteringAffector.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_H__ +#define __CC_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_H__ #include "Particle3D/PU/CCPUAffector.h" NS_AX_BEGIN -class AX_EX_DLL PUFlockCenteringAffector : public PUAffector +class CC_EX_DLL PUFlockCenteringAffector : public PUAffector { public: static PUFlockCenteringAffector* create(); diff --git a/extensions/Particle3D/PU/CCPUFlockCenteringAffectorTranslator.h b/extensions/Particle3D/PU/CCPUFlockCenteringAffectorTranslator.h index 8fe55887ad..2c6e0cfd48 100644 --- a/extensions/Particle3D/PU/CCPUFlockCenteringAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUFlockCenteringAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_TRANSLATOR_H__ +#define __CC_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 2f0f622bce..ca6b58e7c4 100644 --- a/extensions/Particle3D/PU/CCPUForceField.h +++ b/extensions/Particle3D/PU/CCPUForceField.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_FORCE_FIELD_H__ -#define __AX_PU_PARTICLE_3D_FORCE_FIELD_H__ +#ifndef __CC_PU_PARTICLE_3D_FORCE_FIELD_H__ +#define __CC_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 2a93f26aa4..7f05f23862 100644 --- a/extensions/Particle3D/PU/CCPUForceFieldAffector.h +++ b/extensions/Particle3D/PU/CCPUForceFieldAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_H__ +#define __CC_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUForceField.h" NS_AX_BEGIN -class AX_EX_DLL PUForceFieldAffector : public PUAffector +class CC_EX_DLL PUForceFieldAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUForceFieldAffectorTranslator.h b/extensions/Particle3D/PU/CCPUForceFieldAffectorTranslator.h index 9f454bfcc3..7344b7c2ab 100644 --- a/extensions/Particle3D/PU/CCPUForceFieldAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUForceFieldAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_TRANSLATOR_H__ +#define __CC_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 a7ec9cf0fc..76723b21c2 100644 --- a/extensions/Particle3D/PU/CCPUGeometryRotator.cpp +++ b/extensions/Particle3D/PU/CCPUGeometryRotator.cpp @@ -51,7 +51,7 @@ PUGeometryRotator::PUGeometryRotator() PUGeometryRotator::~PUGeometryRotator() { if (_dynRotationSpeed) - AX_SAFE_DELETE(_dynRotationSpeed); + CC_SAFE_DELETE(_dynRotationSpeed); } //----------------------------------------------------------------------- const Vec3& PUGeometryRotator::getRotationAxis() const @@ -80,7 +80,7 @@ PUDynamicAttribute* PUGeometryRotator::getRotationSpeed() const void PUGeometryRotator::setRotationSpeed(PUDynamicAttribute* dynRotationSpeed) { if (_dynRotationSpeed) - AX_SAFE_DELETE(_dynRotationSpeed); + CC_SAFE_DELETE(_dynRotationSpeed); _dynRotationSpeed = dynRotationSpeed; } //----------------------------------------------------------------------- diff --git a/extensions/Particle3D/PU/CCPUGeometryRotator.h b/extensions/Particle3D/PU/CCPUGeometryRotator.h index 980fb0688b..a2d22fcbf5 100644 --- a/extensions/Particle3D/PU/CCPUGeometryRotator.h +++ b/extensions/Particle3D/PU/CCPUGeometryRotator.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_GEOMETRY_ROTATOR_H__ -#define __AX_PU_PARTICLE_3D_GEOMETRY_ROTATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_GEOMETRY_ROTATOR_H__ +#define __CC_PU_PARTICLE_3D_GEOMETRY_ROTATOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" NS_AX_BEGIN struct PUParticle3D; -class AX_EX_DLL PUGeometryRotator : public PUAffector +class CC_EX_DLL PUGeometryRotator : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUGeometryRotatorTranslator.h b/extensions/Particle3D/PU/CCPUGeometryRotatorTranslator.h index c42396cfa1..4459bb9c3d 100644 --- a/extensions/Particle3D/PU/CCPUGeometryRotatorTranslator.h +++ b/extensions/Particle3D/PU/CCPUGeometryRotatorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_GEOMETRY_ROTATOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_GEOMETRY_ROTATOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_GEOMETRY_ROTATOR_TRANSLATOR_H__ +#define __CC_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 124bdd2c3f..0f7f651507 100644 --- a/extensions/Particle3D/PU/CCPUGravityAffector.h +++ b/extensions/Particle3D/PU/CCPUGravityAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_GRAVITY_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_GRAVITY_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_GRAVITY_AFFECTOR_H__ +#define __CC_PU_PARTICLE_3D_GRAVITY_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class AX_EX_DLL PUGravityAffector : public PUAffector +class CC_EX_DLL PUGravityAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUGravityAffectorTranslator.h b/extensions/Particle3D/PU/CCPUGravityAffectorTranslator.h index c02768f3f3..f8c89c5f29 100644 --- a/extensions/Particle3D/PU/CCPUGravityAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUGravityAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_GRAVITY_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_GRAVITY_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_GRAVITY_AFFECTOR_TRANSLATOR_H__ +#define __CC_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.h b/extensions/Particle3D/PU/CCPUInterParticleCollider.h index 9906b67697..15aac1489d 100644 --- a/extensions/Particle3D/PU/CCPUInterParticleCollider.h +++ b/extensions/Particle3D/PU/CCPUInterParticleCollider.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_H__ -#define __AX_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_H__ +#ifndef __CC_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_H__ +#define __CC_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_H__ #include "CCPUBaseCollider.h" #include "base/ccTypes.h" NS_AX_BEGIN struct PUParticle3D; -class AX_EX_DLL PUParticle3DInterParticleCollider : public PUBaseCollider +class CC_EX_DLL PUParticle3DInterParticleCollider : public PUBaseCollider { public: enum InterParticleCollisionResponse diff --git a/extensions/Particle3D/PU/CCPUInterParticleColliderTranslator.h b/extensions/Particle3D/PU/CCPUInterParticleColliderTranslator.h index ef3c858338..bcdb5ded08 100644 --- a/extensions/Particle3D/PU/CCPUInterParticleColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUInterParticleColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_TRANSLATOR_H__ +#define __CC_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 f5d428375f..08ba3ffd08 100644 --- a/extensions/Particle3D/PU/CCPUJetAffector.cpp +++ b/extensions/Particle3D/PU/CCPUJetAffector.cpp @@ -44,14 +44,14 @@ PUJetAffector::~PUJetAffector() if (!_dynAcceleration) return; - AX_SAFE_DELETE(_dynAcceleration); + CC_SAFE_DELETE(_dynAcceleration); _dynAcceleration = 0; } //----------------------------------------------------------------------- void PUJetAffector::setDynAcceleration(PUDynamicAttribute* dynAcceleration) { if (_dynAcceleration) - AX_SAFE_DELETE(_dynAcceleration); + CC_SAFE_DELETE(_dynAcceleration); _dynAcceleration = dynAcceleration; } diff --git a/extensions/Particle3D/PU/CCPUJetAffector.h b/extensions/Particle3D/PU/CCPUJetAffector.h index 0a35e09663..656ef3d7a9 100644 --- a/extensions/Particle3D/PU/CCPUJetAffector.h +++ b/extensions/Particle3D/PU/CCPUJetAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_JET_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_JET_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_JET_AFFECTOR_H__ +#define __CC_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 AX_EX_DLL PUJetAffector : public PUAffector +class CC_EX_DLL PUJetAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUJetAffectorTranslator.h b/extensions/Particle3D/PU/CCPUJetAffectorTranslator.h index 034ceeea67..18642ca58f 100644 --- a/extensions/Particle3D/PU/CCPUJetAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUJetAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_JET_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_JET_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_JET_AFFECTOR_TRANSLATOR_H__ +#define __CC_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.h b/extensions/Particle3D/PU/CCPULineAffector.h index 3d63d60a2f..150fa8deb7 100644 --- a/extensions/Particle3D/PU/CCPULineAffector.h +++ b/extensions/Particle3D/PU/CCPULineAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_LINE_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_LINE_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_LINE_AFFECTOR_H__ +#define __CC_PU_PARTICLE_3D_LINE_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class AX_EX_DLL PULineAffector : public PUAffector +class CC_EX_DLL PULineAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPULineAffectorTranslator.h b/extensions/Particle3D/PU/CCPULineAffectorTranslator.h index 6ed17311c8..70294a4bbb 100644 --- a/extensions/Particle3D/PU/CCPULineAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPULineAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_LINE_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_LINE_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_LINE_AFFECTOR_TRANSLATOR_H__ +#define __CC_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.h b/extensions/Particle3D/PU/CCPULineEmitter.h index fe1ec7bb85..118b825035 100644 --- a/extensions/Particle3D/PU/CCPULineEmitter.h +++ b/extensions/Particle3D/PU/CCPULineEmitter.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_LINE_EMITTER_H__ -#define __AX_PU_PARTICLE_3D_LINE_EMITTER_H__ +#ifndef __CC_PU_PARTICLE_3D_LINE_EMITTER_H__ +#define __CC_PU_PARTICLE_3D_LINE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN struct PUParticle3D; -class AX_EX_DLL PULineEmitter : public PUEmitter +class CC_EX_DLL PULineEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPULineEmitterTranslator.h b/extensions/Particle3D/PU/CCPULineEmitterTranslator.h index e8f5dd211e..7e51a8217d 100644 --- a/extensions/Particle3D/PU/CCPULineEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPULineEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_LINE_EMITTER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_LINE_EMITTER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_LINE_EMITTER_TRANSLATOR_H__ +#define __CC_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 73bf1078b6..5800a6ad40 100644 --- a/extensions/Particle3D/PU/CCPULinearForceAffector.h +++ b/extensions/Particle3D/PU/CCPULinearForceAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_H__ +#define __CC_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_H__ #include "CCPUBaseForceAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class AX_EX_DLL PULinearForceAffector : public PUBaseForceAffector +class CC_EX_DLL PULinearForceAffector : public PUBaseForceAffector { public: static PULinearForceAffector* create(); diff --git a/extensions/Particle3D/PU/CCPULinearForceAffectorTranslator.h b/extensions/Particle3D/PU/CCPULinearForceAffectorTranslator.h index 9d5ba25793..98ab3296e9 100644 --- a/extensions/Particle3D/PU/CCPULinearForceAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPULinearForceAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_TRANSLATOR_H__ +#define __CC_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 16b2a7ebf7..e50e365f14 100644 --- a/extensions/Particle3D/PU/CCPUListener.h +++ b/extensions/Particle3D/PU/CCPUListener.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_LISTENER_H__ -#define __AX_PU_PARTICLE_3D_LISTENER_H__ +#ifndef __CC_PU_PARTICLE_3D_LISTENER_H__ +#define __CC_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 AX_EX_DLL PUListener +class CC_EX_DLL PUListener { public: PUListener(); diff --git a/extensions/Particle3D/PU/CCPUMaterialManager.cpp b/extensions/Particle3D/PU/CCPUMaterialManager.cpp index adcefd9f2b..c5f40e0332 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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) # include -#elif (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) # include "platform/android/CCFileUtils-android.h" # include -#elif (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) # include -#elif (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) # include # include # include @@ -116,7 +116,7 @@ void PUMaterialCache::addMaterial(PUMaterial* material) _materialMap.push_back(material); } -#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_WINRT) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID /* || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX*/) +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID /* || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX*/) std::string::size_type pos = fileFolder.find("assets/"); std::string_view relativePath = fileFolder; if (pos != std::string::npos) @@ -171,9 +171,9 @@ bool PUMaterialCache::loadMaterialsFromSearchPaths(std::string_view fileFolder) } AAssetDir_close(dir); -#elif (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) ftw(fileFolder.data(), iterPath, 500); -#elif (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_TIZEN) +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) DIR* d; // dir handle struct dirent* file; // readdir struct stat statbuf; diff --git a/extensions/Particle3D/PU/CCPUMaterialManager.h b/extensions/Particle3D/PU/CCPUMaterialManager.h index cbaf2fb499..168da5ffc2 100644 --- a/extensions/Particle3D/PU/CCPUMaterialManager.h +++ b/extensions/Particle3D/PU/CCPUMaterialManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_MATERIAL_MANAGER_H__ -#define __AX_PU_PARTICLE_3D_MATERIAL_MANAGER_H__ +#ifndef __CC_PU_PARTICLE_3D_MATERIAL_MANAGER_H__ +#define __CC_PU_PARTICLE_3D_MATERIAL_MANAGER_H__ #include "math/CCMath.h" #include "base/ccTypes.h" #include @@ -33,7 +33,7 @@ NS_AX_BEGIN -class AX_EX_DLL PUMaterial : public Ref +class CC_EX_DLL PUMaterial : public Ref { public: PUMaterial(); @@ -55,7 +55,7 @@ public: backend::SamplerAddressMode wrapMode; }; -class AX_EX_DLL PUMaterialCache +class CC_EX_DLL PUMaterialCache { public: PUMaterialCache(); diff --git a/extensions/Particle3D/PU/CCPUMaterialTranslator.h b/extensions/Particle3D/PU/CCPUMaterialTranslator.h index 7c681b0a0d..cebb718beb 100644 --- a/extensions/Particle3D/PU/CCPUMaterialTranslator.h +++ b/extensions/Particle3D/PU/CCPUMaterialTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_MATERIAL_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_MATERIAL_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_MATERIAL_TRANSLATOR_H__ +#define __CC_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 c007df054b..deb58d8a3b 100644 --- a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.cpp +++ b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.cpp @@ -418,7 +418,7 @@ PUMeshSurfaceEmitter::~PUMeshSurfaceEmitter() { if (_meshInfo) { - AX_SAFE_DELETE(_meshInfo); + CC_SAFE_DELETE(_meshInfo); } } //----------------------------------------------------------------------- @@ -569,7 +569,7 @@ void PUMeshSurfaceEmitter::build() // Delete the mesh info if already existing if (_meshInfo) { - AX_SAFE_DELETE(_meshInfo); + CC_SAFE_DELETE(_meshInfo); } // Generate meshinfo. diff --git a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.h b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.h index 63b7bcee71..ab62c87d01 100644 --- a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.h +++ b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_MESH_SURFACE_EMITTER_H__ -#define __AX_PU_PARTICLE_MESH_SURFACE_EMITTER_H__ +#ifndef __CC_PU_PARTICLE_MESH_SURFACE_EMITTER_H__ +#define __CC_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 AX_EX_DLL PUMeshSurfaceEmitter : public PUEmitter +class CC_EX_DLL PUMeshSurfaceEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitterTranslator.h b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitterTranslator.h index d681a335d0..521a43192d 100644 --- a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_MESH_SURFACE_EMITTER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_MESH_SURFACE_EMITTER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_MESH_SURFACE_EMITTER_TRANSLATOR_H__ +#define __CC_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 dea4b3342b..f070b0dfd0 100644 --- a/extensions/Particle3D/PU/CCPUNoise.h +++ b/extensions/Particle3D/PU/CCPUNoise.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_NOISE_H__ -#define __AX_PU_PARTICLE_3D_NOISE_H__ +#ifndef __CC_PU_PARTICLE_3D_NOISE_H__ +#define __CC_PU_PARTICLE_3D_NOISE_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPUObserver.h b/extensions/Particle3D/PU/CCPUObserver.h index aacdb7dcb5..a82a984979 100644 --- a/extensions/Particle3D/PU/CCPUObserver.h +++ b/extensions/Particle3D/PU/CCPUObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_OBSERVER_H__ -#define __AX_PU_PARTICLE_3D_OBSERVER_H__ +#ifndef __CC_PU_PARTICLE_3D_OBSERVER_H__ +#define __CC_PU_PARTICLE_3D_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -46,7 +46,7 @@ enum PUComparisionOperator CO_GREATER_THAN }; -class AX_EX_DLL PUObserver : public Ref +class CC_EX_DLL PUObserver : public Ref { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/PU/CCPUObserverManager.h b/extensions/Particle3D/PU/CCPUObserverManager.h index 4b0b3d9502..1373c6a2d5 100644 --- a/extensions/Particle3D/PU/CCPUObserverManager.h +++ b/extensions/Particle3D/PU/CCPUObserverManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_OBSERVER_MANAGER_H__ -#define __AX_PU_PARTICLE_3D_OBSERVER_MANAGER_H__ +#ifndef __CC_PU_PARTICLE_3D_OBSERVER_MANAGER_H__ +#define __CC_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 14f06104db..5bb7f5d0c1 100644 --- a/extensions/Particle3D/PU/CCPUObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_OBSERVER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_OBSERVER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_OBSERVER_TRANSLATOR_H__ +#define __CC_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 ab5a5ac4ff..812d0623ad 100644 --- a/extensions/Particle3D/PU/CCPUOnClearObserver.h +++ b/extensions/Particle3D/PU/CCPUOnClearObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_H__ -#define __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_H__ +#define __CC_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 AX_EX_DLL PUOnClearObserver : public PUObserver +class CC_EX_DLL PUOnClearObserver : public PUObserver { public: static PUOnClearObserver* create(); diff --git a/extensions/Particle3D/PU/CCPUOnClearObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnClearObserverTranslator.h index f8fcd1a6b2..cc684ae8e1 100644 --- a/extensions/Particle3D/PU/CCPUOnClearObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnClearObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_TRANSLATOR_H__ +#define __CC_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 c60a1a1e17..97268414b0 100644 --- a/extensions/Particle3D/PU/CCPUOnCollisionObserver.h +++ b/extensions/Particle3D/PU/CCPUOnCollisionObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_H__ -#define __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_H__ +#define __CC_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 AX_EX_DLL PUOnCollisionObserver : public PUObserver +class CC_EX_DLL PUOnCollisionObserver : public PUObserver { public: static PUOnCollisionObserver* create(); diff --git a/extensions/Particle3D/PU/CCPUOnCollisionObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnCollisionObserverTranslator.h index f4327566ca..daa40aa245 100644 --- a/extensions/Particle3D/PU/CCPUOnCollisionObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnCollisionObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_TRANSLATOR_H__ +#define __CC_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 3ce7468d4d..51f090c08a 100644 --- a/extensions/Particle3D/PU/CCPUOnCountObserver.h +++ b/extensions/Particle3D/PU/CCPUOnCountObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_H__ -#define __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_COUNT_OBSERVER_H__ +#define __CC_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 AX_EX_DLL PUOnCountObserver : public PUObserver +class CC_EX_DLL PUOnCountObserver : public PUObserver { protected: unsigned int _count; diff --git a/extensions/Particle3D/PU/CCPUOnCountObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnCountObserverTranslator.h index f4affba5e7..e7101752ee 100644 --- a/extensions/Particle3D/PU/CCPUOnCountObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnCountObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_COUNT_OBSERVER_TRANSLATOR_H__ +#define __CC_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 ff527bc748..7988ab4d35 100644 --- a/extensions/Particle3D/PU/CCPUOnEmissionObserver.h +++ b/extensions/Particle3D/PU/CCPUOnEmissionObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_H__ -#define __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_H__ +#define __CC_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 AX_EX_DLL PUOnEmissionObserver : public PUObserver +class CC_EX_DLL PUOnEmissionObserver : public PUObserver { public: static PUOnEmissionObserver* create(); diff --git a/extensions/Particle3D/PU/CCPUOnEmissionObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnEmissionObserverTranslator.h index 7ec67da5bf..0f2deea70c 100644 --- a/extensions/Particle3D/PU/CCPUOnEmissionObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnEmissionObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_TRANSLATOR_H__ +#define __CC_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 9d072d274d..acdf443a54 100644 --- a/extensions/Particle3D/PU/CCPUOnEventFlagObserver.h +++ b/extensions/Particle3D/PU/CCPUOnEventFlagObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_H__ -#define __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_H__ +#define __CC_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 AX_EX_DLL PUOnEventFlagObserver : public PUObserver +class CC_EX_DLL PUOnEventFlagObserver : public PUObserver { protected: unsigned int _eventFlag; diff --git a/extensions/Particle3D/PU/CCPUOnEventFlagObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnEventFlagObserverTranslator.h index dc3f7001d6..3cd35ba067 100644 --- a/extensions/Particle3D/PU/CCPUOnEventFlagObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnEventFlagObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_TRANSLATOR_H__ +#define __CC_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 042f9124aa..04f917a2a6 100644 --- a/extensions/Particle3D/PU/CCPUOnExpireObserver.h +++ b/extensions/Particle3D/PU/CCPUOnExpireObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_H__ -#define __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_H__ +#define __CC_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 AX_EX_DLL PUOnExpireObserver : public PUObserver +class CC_EX_DLL PUOnExpireObserver : public PUObserver { protected: public: diff --git a/extensions/Particle3D/PU/CCPUOnExpireObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnExpireObserverTranslator.h index 7147be55cf..9b61294092 100644 --- a/extensions/Particle3D/PU/CCPUOnExpireObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnExpireObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_TRANSLATOR_H__ +#define __CC_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 2af387cc87..55192e099f 100644 --- a/extensions/Particle3D/PU/CCPUOnPositionObserver.h +++ b/extensions/Particle3D/PU/CCPUOnPositionObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_H__ -#define __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_POSITION_OBSERVER_H__ +#define __CC_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 AX_EX_DLL PUOnPositionObserver : public PUObserver +class CC_EX_DLL PUOnPositionObserver : public PUObserver { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUOnPositionObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnPositionObserverTranslator.h index f7b3b96a48..caae34f7b0 100644 --- a/extensions/Particle3D/PU/CCPUOnPositionObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnPositionObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_POSITION_OBSERVER_TRANSLATOR_H__ +#define __CC_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 6359e855e0..ffdbcc84bf 100644 --- a/extensions/Particle3D/PU/CCPUOnQuotaObserver.h +++ b/extensions/Particle3D/PU/CCPUOnQuotaObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_H__ -#define __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_H__ +#define __CC_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 AX_EX_DLL PUOnQuotaObserver : public PUObserver +class CC_EX_DLL PUOnQuotaObserver : public PUObserver { public: static PUOnQuotaObserver* create(); diff --git a/extensions/Particle3D/PU/CCPUOnQuotaObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnQuotaObserverTranslator.h index 0d5ad0df93..5c266c9854 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 __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_TRANSLATOR_H__ +#define __CC_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.h b/extensions/Particle3D/PU/CCPUOnRandomObserver.h index 1d19a5e56f..43130e6c4b 100644 --- a/extensions/Particle3D/PU/CCPUOnRandomObserver.h +++ b/extensions/Particle3D/PU/CCPUOnRandomObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_H__ -#define __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_H__ +#define __CC_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 AX_EX_DLL PUOnRandomObserver : public PUObserver +class CC_EX_DLL PUOnRandomObserver : public PUObserver { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUOnRandomObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnRandomObserverTranslator.h index 5aa467f58e..c2897972bb 100644 --- a/extensions/Particle3D/PU/CCPUOnRandomObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnRandomObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_TRANSLATOR_H__ +#define __CC_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 43830829c6..704d9ca12b 100644 --- a/extensions/Particle3D/PU/CCPUOnTimeObserver.h +++ b/extensions/Particle3D/PU/CCPUOnTimeObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_H__ -#define __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_TIME_OBSERVER_H__ +#define __CC_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 AX_EX_DLL PUOnTimeObserver : public PUObserver +class CC_EX_DLL PUOnTimeObserver : public PUObserver { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUOnTimeObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnTimeObserverTranslator.h index f41bd3fe4e..cf8b5b9f16 100644 --- a/extensions/Particle3D/PU/CCPUOnTimeObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnTimeObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_TIME_OBSERVER_TRANSLATOR_H__ +#define __CC_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 a099633182..510e1799ba 100644 --- a/extensions/Particle3D/PU/CCPUOnVelocityObserver.h +++ b/extensions/Particle3D/PU/CCPUOnVelocityObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_ON_VELOCITY_OBSERVER_H__ -#define __AX_PU_PARTICLE_3D_ON_VELOCITY_OBSERVER_H__ +#ifndef __CC_PU_PARTICLE_3D_ON_VELOCITY_OBSERVER_H__ +#define __CC_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 AX_EX_DLL PUOnVelocityObserver : public PUObserver +class CC_EX_DLL PUOnVelocityObserver : public PUObserver { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUOnVelocityObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnVelocityObserverTranslator.h index 3762443cc7..5c85830641 100644 --- a/extensions/Particle3D/PU/CCPUOnVelocityObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnVelocityObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_DO_CLEAR_OBSERVER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_DO_CLEAR_OBSERVER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_DO_CLEAR_OBSERVER_TRANSLATOR_H__ +#define __CC_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 0edb7d7c69..e28af1da2d 100644 --- a/extensions/Particle3D/PU/CCPUParticleFollower.h +++ b/extensions/Particle3D/PU/CCPUParticleFollower.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_PARTICLE_FOLLOWER_H__ -#define __AX_PU_PARTICLE_3D_PARTICLE_FOLLOWER_H__ +#ifndef __CC_PU_PARTICLE_3D_PARTICLE_FOLLOWER_H__ +#define __CC_PU_PARTICLE_3D_PARTICLE_FOLLOWER_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class AX_EX_DLL PUParticleFollower : public PUAffector +class CC_EX_DLL PUParticleFollower : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUParticleFollowerTranslator.h b/extensions/Particle3D/PU/CCPUParticleFollowerTranslator.h index 1cd77b258b..6488c34188 100644 --- a/extensions/Particle3D/PU/CCPUParticleFollowerTranslator.h +++ b/extensions/Particle3D/PU/CCPUParticleFollowerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_PARTICLE_FOLLOWER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_PARTICLE_FOLLOWER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_PARTICLE_FOLLOWER_TRANSLATOR_H__ +#define __CC_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 77e95f3e03..0edbf91be8 100644 --- a/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp +++ b/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp @@ -163,7 +163,7 @@ PUParticle3D::~PUParticle3D() it->release(); } - // AX_SAFE_RELEASE(particleEntityPtr); + // CC_SAFE_RELEASE(particleEntityPtr); } void PUParticle3D::copyBehaviours(const ParticleBehaviourList& list) @@ -269,7 +269,7 @@ PUParticleSystem3D* PUParticleSystem3D::create(std::string_view filePath, std::s } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } } @@ -284,7 +284,7 @@ PUParticleSystem3D* PUParticleSystem3D::create(std::string_view filePath) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } } @@ -1148,14 +1148,14 @@ void PUParticleSystem3D::addBehaviourTemplate(PUBehaviour* behaviour) void PUParticleSystem3D::convertToUnixStylePath(std::string& path) { -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) for (auto& iter : path) { if (iter == '\\') iter = '/'; } #else - AX_UNUSED_PARAM(path); + CC_UNUSED_PARAM(path); #endif } diff --git a/extensions/Particle3D/PU/CCPUParticleSystem3D.h b/extensions/Particle3D/PU/CCPUParticleSystem3D.h index ec82c23740..0686fd6177 100644 --- a/extensions/Particle3D/PU/CCPUParticleSystem3D.h +++ b/extensions/Particle3D/PU/CCPUParticleSystem3D.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_SYSTEM_3D_H__ -#define __AX_PU_PARTICLE_SYSTEM_3D_H__ +#ifndef __CC_PU_PARTICLE_SYSTEM_3D_H__ +#define __CC_PU_PARTICLE_SYSTEM_3D_H__ #include "2d/CCNode.h" #include "base/CCProtocols.h" @@ -56,7 +56,7 @@ enum PUComponentType CT_OBSERVER }; -struct AX_EX_DLL PUParticle3D : public Particle3D +struct CC_EX_DLL PUParticle3D : public Particle3D { static float DEFAULT_TTL; static float DEFAULT_MASS; @@ -204,7 +204,7 @@ struct AX_EX_DLL PUParticle3D : public Particle3D // float depthInWorld; }; -class AX_EX_DLL PUParticleSystem3D : public ParticleSystem3D +class CC_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 2c81eb5aa5..dfec22739e 100644 --- a/extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h +++ b/extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_SYSTEM_3D_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_SYSTEM_3D_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_SYSTEM_3D_TRANSLATOR_H__ +#define __CC_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 9349ff00ee..e7820d0872 100644 --- a/extensions/Particle3D/PU/CCPUPathFollower.h +++ b/extensions/Particle3D/PU/CCPUPathFollower.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_PATH_FOLLOWER_H__ -#define __AX_PU_PARTICLE_3D_PATH_FOLLOWER_H__ +#ifndef __CC_PU_PARTICLE_3D_PATH_FOLLOWER_H__ +#define __CC_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 AX_EX_DLL PUPathFollower : public PUAffector +class CC_EX_DLL PUPathFollower : public PUAffector { public: static PUPathFollower* create(); diff --git a/extensions/Particle3D/PU/CCPUPathFollowerTranslator.h b/extensions/Particle3D/PU/CCPUPathFollowerTranslator.h index 3a5f13b271..075d3db8e8 100644 --- a/extensions/Particle3D/PU/CCPUPathFollowerTranslator.h +++ b/extensions/Particle3D/PU/CCPUPathFollowerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_PATH_FOLLOWER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_PATH_FOLLOWER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_PATH_FOLLOWER_TRANSLATOR_H__ +#define __CC_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 691d07d0bd..5fe6f943e5 100644 --- a/extensions/Particle3D/PU/CCPUPlane.h +++ b/extensions/Particle3D/PU/CCPUPlane.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_PLANE_H__ -#define __AX_PU_PARTICLE_3D_PLANE_H__ +#ifndef __CC_PU_PARTICLE_3D_PLANE_H__ +#define __CC_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 6aafa1f214..4b64ab86ee 100644 --- a/extensions/Particle3D/PU/CCPUPlaneCollider.h +++ b/extensions/Particle3D/PU/CCPUPlaneCollider.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_PLANE_COLLIDER_H__ -#define __AX_PU_PARTICLE_3D_PLANE_COLLIDER_H__ +#ifndef __CC_PU_PARTICLE_3D_PLANE_COLLIDER_H__ +#define __CC_PU_PARTICLE_3D_PLANE_COLLIDER_H__ #include "CCPUBaseCollider.h" #include "extensions/Particle3D/PU/CCPUPlane.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class AX_EX_DLL PUPlaneCollider : public PUBaseCollider +class CC_EX_DLL PUPlaneCollider : public PUBaseCollider { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUPlaneColliderTranslator.h b/extensions/Particle3D/PU/CCPUPlaneColliderTranslator.h index 0dbe8c29d1..8caa7c66db 100644 --- a/extensions/Particle3D/PU/CCPUPlaneColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUPlaneColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_PLANE_COLLIDER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_PLANE_COLLIDER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_PLANE_COLLIDER_TRANSLATOR_H__ +#define __CC_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 092a7193df..aa18f6a740 100644 --- a/extensions/Particle3D/PU/CCPUPointEmitter.h +++ b/extensions/Particle3D/PU/CCPUPointEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_POINT_EMITTER_H__ -#define __AX_PU_PARTICLE_3D_POINT_EMITTER_H__ +#ifndef __CC_PU_PARTICLE_3D_POINT_EMITTER_H__ +#define __CC_PU_PARTICLE_3D_POINT_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class AX_EX_DLL PUPointEmitter : public PUEmitter +class CC_EX_DLL PUPointEmitter : public PUEmitter { public: static PUPointEmitter* create(); diff --git a/extensions/Particle3D/PU/CCPUPointEmitterTranslator.h b/extensions/Particle3D/PU/CCPUPointEmitterTranslator.h index 00c78ece31..79b0b44e0f 100644 --- a/extensions/Particle3D/PU/CCPUPointEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUPointEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_POINT_EMITTER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_POINT_EMITTER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_POINT_EMITTER_TRANSLATOR_H__ +#define __CC_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.h b/extensions/Particle3D/PU/CCPUPositionEmitter.h index 82f9a87912..e71103d1a4 100644 --- a/extensions/Particle3D/PU/CCPUPositionEmitter.h +++ b/extensions/Particle3D/PU/CCPUPositionEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_POSITION_EMITTER_H__ -#define __AX_PU_PARTICLE_3D_POSITION_EMITTER_H__ +#ifndef __CC_PU_PARTICLE_3D_POSITION_EMITTER_H__ +#define __CC_PU_PARTICLE_3D_POSITION_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class AX_EX_DLL PUPositionEmitter : public PUEmitter +class CC_EX_DLL PUPositionEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUPositionEmitterTranslator.h b/extensions/Particle3D/PU/CCPUPositionEmitterTranslator.h index 51ae06fca4..6e9160448b 100644 --- a/extensions/Particle3D/PU/CCPUPositionEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUPositionEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_POSITION_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_POSITION_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_POSITION_TRANSLATOR_H__ +#define __CC_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.h b/extensions/Particle3D/PU/CCPURandomiser.h index ee73fdc72c..1f7f0f42bc 100644 --- a/extensions/Particle3D/PU/CCPURandomiser.h +++ b/extensions/Particle3D/PU/CCPURandomiser.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_RANDOMISER_H__ -#define __AX_PU_PARTICLE_3D_RANDOMISER_H__ +#ifndef __CC_PU_PARTICLE_3D_RANDOMISER_H__ +#define __CC_PU_PARTICLE_3D_RANDOMISER_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class AX_EX_DLL PURandomiser : public PUAffector +class CC_EX_DLL PURandomiser : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPURandomiserTranslator.h b/extensions/Particle3D/PU/CCPURandomiserTranslator.h index 69778af3fe..1eb34a9068 100644 --- a/extensions/Particle3D/PU/CCPURandomiserTranslator.h +++ b/extensions/Particle3D/PU/CCPURandomiserTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_RANDOMISER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_RANDOMISER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_RANDOMISER_TRANSLATOR_H__ +#define __CC_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 35d085e4e2..87f3c00236 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 { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -607,15 +607,15 @@ PUParticle3DEntityRender::PUParticle3DEntityRender() PUParticle3DEntityRender::~PUParticle3DEntityRender() { ; - // AX_SAFE_RELEASE(_texture); - AX_SAFE_RELEASE(_programState); - AX_SAFE_RELEASE(_vertexBuffer); - AX_SAFE_RELEASE(_indexBuffer); + // CC_SAFE_RELEASE(_texture); + CC_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_vertexBuffer); + CC_SAFE_RELEASE(_indexBuffer); } bool PUParticle3DEntityRender::initRender(std::string_view texFile) { - AX_SAFE_RELEASE_NULL(_programState); + CC_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(AX_CALLBACK_0(PUParticle3DEntityRender::onBeforeDraw, this)); - _meshCommand.setAfterCallback(AX_CALLBACK_0(PUParticle3DEntityRender::onAfterDraw, this)); + _meshCommand.setBeforeCallback(CC_CALLBACK_0(PUParticle3DEntityRender::onBeforeDraw, this)); + _meshCommand.setAfterCallback(CC_CALLBACK_0(PUParticle3DEntityRender::onAfterDraw, this)); return true; } @@ -701,7 +701,7 @@ PUParticle3DBoxRender* PUParticle3DBoxRender::create(std::string_view texFile) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -891,7 +891,7 @@ PUSphereRender* PUSphereRender::create(std::string_view texFile) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } diff --git a/extensions/Particle3D/PU/CCPURender.h b/extensions/Particle3D/PU/CCPURender.h index 1abb123a4b..082833cc13 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 AX_EX_DLL PURender : public Particle3DRender +class CC_EX_DLL PURender : public Particle3DRender { public: virtual void prepare(){}; @@ -61,7 +61,7 @@ protected: std::string _renderType; }; -class AX_EX_DLL PUParticle3DEntityRender : public PURender +class CC_EX_DLL PUParticle3DEntityRender : public PURender { public: void copyAttributesTo(PUParticle3DEntityRender* render); @@ -109,7 +109,7 @@ protected: bool _rendererDepthWrite = false; }; -class AX_EX_DLL PUParticle3DQuadRender : public PUParticle3DEntityRender +class CC_EX_DLL PUParticle3DQuadRender : public PUParticle3DEntityRender { public: enum Type @@ -188,7 +188,7 @@ protected: }; // particle render for MeshRenderer -class AX_EX_DLL PUParticle3DModelRender : public PURender +class CC_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 AX_EX_DLL PUParticle3DBoxRender : public PUParticle3DEntityRender +class CC_EX_DLL PUParticle3DBoxRender : public PUParticle3DEntityRender { public: static PUParticle3DBoxRender* create(std::string_view texFile = ""); @@ -225,7 +225,7 @@ protected: void reBuildIndices(unsigned short count); }; -class AX_EX_DLL PUSphereRender : public PUParticle3DEntityRender +class CC_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 775eeb0c4f..54d8afe466 100644 --- a/extensions/Particle3D/PU/CCPURendererTranslator.h +++ b/extensions/Particle3D/PU/CCPURendererTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_RENDERER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_RENDERER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_RENDERER_TRANSLATOR_H__ +#define __CC_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.h b/extensions/Particle3D/PU/CCPURibbonTrail.h index ad8bee4c79..2a3a6a5df8 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrail.h +++ b/extensions/Particle3D/PU/CCPURibbonTrail.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_RIBBON_TRAIL_H__ -#define __AX_PU_PARTICLE_3D_RIBBON_TRAIL_H__ +#ifndef __CC_PU_PARTICLE_3D_RIBBON_TRAIL_H__ +#define __CC_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 8fd11da706..c0f77101df 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp +++ b/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp @@ -332,7 +332,7 @@ void PURibbonTrailRender::destroyAll() } // Delete the Ribbontrail - AX_SAFE_DELETE(_trail); + CC_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 0ca85b7d57..cc3a17b78d 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrailRender.h +++ b/extensions/Particle3D/PU/CCPURibbonTrailRender.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_RIBBON_TRAIL_RENDER_H__ -#define __AX_PU_PARTICLE_3D_RIBBON_TRAIL_RENDER_H__ +#ifndef __CC_PU_PARTICLE_3D_RIBBON_TRAIL_RENDER_H__ +#define __CC_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 AX_EX_DLL PURibbonTrailRender : public PURender, public PUListener +class CC_EX_DLL PURibbonTrailRender : public PURender, public PUListener { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUScaleAffector.cpp b/extensions/Particle3D/PU/CCPUScaleAffector.cpp index 5e387c31ae..4129908837 100644 --- a/extensions/Particle3D/PU/CCPUScaleAffector.cpp +++ b/extensions/Particle3D/PU/CCPUScaleAffector.cpp @@ -59,26 +59,26 @@ PUScaleAffector::~PUScaleAffector() { if (_dynScaleX) { - AX_SAFE_DELETE(_dynScaleX); + CC_SAFE_DELETE(_dynScaleX); } if (_dynScaleY) { - AX_SAFE_DELETE(_dynScaleY); + CC_SAFE_DELETE(_dynScaleY); } if (_dynScaleZ) { - AX_SAFE_DELETE(_dynScaleZ); + CC_SAFE_DELETE(_dynScaleZ); } if (_dynScaleXYZ) { - AX_SAFE_DELETE(_dynScaleXYZ); + CC_SAFE_DELETE(_dynScaleXYZ); } } //----------------------------------------------------------------------- void PUScaleAffector::setDynScaleX(PUDynamicAttribute* dynScaleX) { if (_dynScaleX) - AX_SAFE_DELETE(_dynScaleX); + CC_SAFE_DELETE(_dynScaleX); _dynScaleX = dynScaleX; _dynScaleXSet = true; @@ -88,7 +88,7 @@ void PUScaleAffector::resetDynScaleX(bool resetToDefault) { if (resetToDefault) { - AX_SAFE_DELETE(_dynScaleX); + CC_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) - AX_SAFE_DELETE(_dynScaleY); + CC_SAFE_DELETE(_dynScaleY); _dynScaleY = dynScaleY; _dynScaleYSet = true; @@ -113,7 +113,7 @@ void PUScaleAffector::resetDynScaleY(bool resetToDefault) if (resetToDefault) { - AX_SAFE_DELETE(_dynScaleY); + CC_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) - AX_SAFE_DELETE(_dynScaleZ); + CC_SAFE_DELETE(_dynScaleZ); _dynScaleZ = dynScaleZ; _dynScaleZSet = true; @@ -137,7 +137,7 @@ void PUScaleAffector::resetDynScaleZ(bool resetToDefault) { if (resetToDefault) { - AX_SAFE_DELETE(_dynScaleZ); + CC_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) - AX_SAFE_DELETE(_dynScaleXYZ); + CC_SAFE_DELETE(_dynScaleXYZ); _dynScaleXYZ = dynScaleXYZ; _dynScaleXYZSet = true; @@ -161,7 +161,7 @@ void PUScaleAffector::resetDynScaleXYZ(bool resetToDefault) { if (resetToDefault) { - AX_SAFE_DELETE(_dynScaleXYZ); + CC_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 e67cbd0c0a..45ef1929fb 100644 --- a/extensions/Particle3D/PU/CCPUScaleAffector.h +++ b/extensions/Particle3D/PU/CCPUScaleAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SCALE_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_SCALE_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_SCALE_AFFECTOR_H__ +#define __CC_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 AX_EX_DLL PUScaleAffector : public PUAffector +class CC_EX_DLL PUScaleAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUScaleAffectorTranslator.h b/extensions/Particle3D/PU/CCPUScaleAffectorTranslator.h index 993471bfaa..198ed845ee 100644 --- a/extensions/Particle3D/PU/CCPUScaleAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUScaleAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SCALE_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_SCALE_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_SCALE_AFFECTOR_TRANSLATOR_H__ +#define __CC_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 7d192ac6d5..9e4172cc24 100644 --- a/extensions/Particle3D/PU/CCPUScaleVelocityAffector.cpp +++ b/extensions/Particle3D/PU/CCPUScaleVelocityAffector.cpp @@ -42,7 +42,7 @@ PUScaleVelocityAffector::~PUScaleVelocityAffector() { if (_dynScaleVelocity) { - AX_SAFE_DELETE(_dynScaleVelocity); + CC_SAFE_DELETE(_dynScaleVelocity); } } //----------------------------------------------------------------------- @@ -91,7 +91,7 @@ void PUScaleVelocityAffector::updatePUAffector(PUParticle3D* particle, float del void PUScaleVelocityAffector::setDynScaleVelocity(PUDynamicAttribute* dynScaleVelocity) { if (_dynScaleVelocity) - AX_SAFE_DELETE(_dynScaleVelocity); + CC_SAFE_DELETE(_dynScaleVelocity); _dynScaleVelocity = dynScaleVelocity; } @@ -100,7 +100,7 @@ void PUScaleVelocityAffector::resetDynScaleVelocity(bool resetToDefault) { if (resetToDefault) { - AX_SAFE_DELETE(_dynScaleVelocity); + CC_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 511c235eda..011f7b15e8 100644 --- a/extensions/Particle3D/PU/CCPUScaleVelocityAffector.h +++ b/extensions/Particle3D/PU/CCPUScaleVelocityAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_H__ +#define __CC_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 AX_EX_DLL PUScaleVelocityAffector : public PUAffector +class CC_EX_DLL PUScaleVelocityAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUScaleVelocityAffectorTranslator.h b/extensions/Particle3D/PU/CCPUScaleVelocityAffectorTranslator.h index ed1a1de115..378ec45405 100644 --- a/extensions/Particle3D/PU/CCPUScaleVelocityAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUScaleVelocityAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_TRANSLATOR_H__ +#define __CC_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 a015ca063a..86f381ca41 100644 --- a/extensions/Particle3D/PU/CCPUScriptCompiler.h +++ b/extensions/Particle3D/PU/CCPUScriptCompiler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_SCRIPT_COMPILER_H__ -#define __AX_PU_SCRIPT_COMPILER_H__ +#ifndef __CC_PU_SCRIPT_COMPILER_H__ +#define __CC_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 AX_EX_DLL PUAbstractNode; +class CC_EX_DLL PUAbstractNode; typedef std::list PUAbstractNodeList; -class AX_EX_DLL PUAbstractNode +class CC_EX_DLL PUAbstractNode { public: std::string file; @@ -69,7 +69,7 @@ public: }; /** This specific abstract node represents a script object */ -class AX_EX_DLL PUObjectAbstractNode : public PUAbstractNode +class CC_EX_DLL PUObjectAbstractNode : public PUAbstractNode { private: hlookup::string_map _env; @@ -95,7 +95,7 @@ public: }; /** This abstract node represents a script property */ -class AX_EX_DLL PUPropertyAbstractNode : public PUAbstractNode +class CC_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 AX_EX_DLL PUAtomAbstractNode : public PUAbstractNode +class CC_EX_DLL PUAtomAbstractNode : public PUAbstractNode { public: std::string value; @@ -125,8 +125,8 @@ private: void parseNumber() const; }; -class AX_EX_DLL PUParticleSystem3D; -class AX_EX_DLL PUScriptCompiler +class CC_EX_DLL PUParticleSystem3D; +class CC_EX_DLL PUScriptCompiler { private: diff --git a/extensions/Particle3D/PU/CCPUScriptLexer.h b/extensions/Particle3D/PU/CCPUScriptLexer.h index 3dd937dd42..65845d09b4 100644 --- a/extensions/Particle3D/PU/CCPUScriptLexer.h +++ b/extensions/Particle3D/PU/CCPUScriptLexer.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_SCRIPT_LEXER_H__ -#define __AX_PU_SCRIPT_LEXER_H__ +#ifndef __CC_PU_SCRIPT_LEXER_H__ +#define __CC_PU_SCRIPT_LEXER_H__ #include "base/CCRef.h" #include diff --git a/extensions/Particle3D/PU/CCPUScriptParser.h b/extensions/Particle3D/PU/CCPUScriptParser.h index 2999f7c55c..2f76123dc9 100644 --- a/extensions/Particle3D/PU/CCPUScriptParser.h +++ b/extensions/Particle3D/PU/CCPUScriptParser.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_SCRIPT_PARSER_H__ -#define __AX_PU_SCRIPT_PARSER_H__ +#ifndef __CC_PU_SCRIPT_PARSER_H__ +#define __CC_PU_SCRIPT_PARSER_H__ #include #include diff --git a/extensions/Particle3D/PU/CCPUScriptTranslator.h b/extensions/Particle3D/PU/CCPUScriptTranslator.h index 3e82d92524..74fbe3ded4 100644 --- a/extensions/Particle3D/PU/CCPUScriptTranslator.h +++ b/extensions/Particle3D/PU/CCPUScriptTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_SCRIPT_TRANSLATOR_H__ -#define __AX_PU_SCRIPT_TRANSLATOR_H__ +#ifndef __CC_PU_SCRIPT_TRANSLATOR_H__ +#define __CC_PU_SCRIPT_TRANSLATOR_H__ #include diff --git a/extensions/Particle3D/PU/CCPUSimpleSpline.h b/extensions/Particle3D/PU/CCPUSimpleSpline.h index 1a9c1ba7d7..e029a6f2f5 100644 --- a/extensions/Particle3D/PU/CCPUSimpleSpline.h +++ b/extensions/Particle3D/PU/CCPUSimpleSpline.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SIMPLE_SPLINE_H__ -#define __AX_PU_PARTICLE_3D_SIMPLE_SPLINE_H__ +#ifndef __CC_PU_PARTICLE_3D_SIMPLE_SPLINE_H__ +#define __CC_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 3d7fd8ee74..818fd5e94b 100644 --- a/extensions/Particle3D/PU/CCPUSineForceAffector.h +++ b/extensions/Particle3D/PU/CCPUSineForceAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_H__ +#define __CC_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_H__ #include "CCPUBaseForceAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class AX_EX_DLL PUSineForceAffector : public PUBaseForceAffector +class CC_EX_DLL PUSineForceAffector : public PUBaseForceAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUSineForceAffectorTranslator.h b/extensions/Particle3D/PU/CCPUSineForceAffectorTranslator.h index bbc0836f0a..66ccf66868 100644 --- a/extensions/Particle3D/PU/CCPUSineForceAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUSineForceAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_TRANSLATOR_H__ +#define __CC_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 d8ca31784a..dcbe042ded 100644 --- a/extensions/Particle3D/PU/CCPUSlaveBehaviour.h +++ b/extensions/Particle3D/PU/CCPUSlaveBehaviour.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__ -#define __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__ +#ifndef __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__ +#define __CC_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 AX_EX_DLL PUSlaveBehaviour : public PUBehaviour +class CC_EX_DLL PUSlaveBehaviour : public PUBehaviour { public: static PUSlaveBehaviour* create(); diff --git a/extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.h b/extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.h index 3702bbf7e3..491c18b6c3 100644 --- a/extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.h +++ b/extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_TRANSLATOR_H__ +#define __CC_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 6f393c56fa..290d07ad67 100644 --- a/extensions/Particle3D/PU/CCPUSlaveEmitter.h +++ b/extensions/Particle3D/PU/CCPUSlaveEmitter.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SLAVE_EMITTER_H__ -#define __AX_PU_PARTICLE_3D_SLAVE_EMITTER_H__ +#ifndef __CC_PU_PARTICLE_3D_SLAVE_EMITTER_H__ +#define __CC_PU_PARTICLE_3D_SLAVE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" #include "extensions/Particle3D/PU/CCPUListener.h" NS_AX_BEGIN // FIXME -class AX_EX_DLL PUSlaveEmitter : public PUEmitter, public PUListener +class CC_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 98a39a3ff3..35ec9dc36c 100644 --- a/extensions/Particle3D/PU/CCPUSlaveEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUSlaveEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SLAVE_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_SLAVE_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_SLAVE_TRANSLATOR_H__ +#define __CC_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 f35d6a0c53..1650682c17 100644 --- a/extensions/Particle3D/PU/CCPUSphere.h +++ b/extensions/Particle3D/PU/CCPUSphere.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SPHERE_H__ -#define __AX_PU_PARTICLE_3D_SPHERE_H__ +#ifndef __CC_PU_PARTICLE_3D_SPHERE_H__ +#define __CC_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 14413a8b97..7d080b7fde 100644 --- a/extensions/Particle3D/PU/CCPUSphereCollider.h +++ b/extensions/Particle3D/PU/CCPUSphereCollider.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SPHERE_COLLIDER_H__ -#define __AX_PU_PARTICLE_3D_SPHERE_COLLIDER_H__ +#ifndef __CC_PU_PARTICLE_3D_SPHERE_COLLIDER_H__ +#define __CC_PU_PARTICLE_3D_SPHERE_COLLIDER_H__ #include "CCPUBaseCollider.h" #include "extensions/Particle3D/PU/CCPUSphere.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class AX_EX_DLL PUSphereCollider : public PUBaseCollider +class CC_EX_DLL PUSphereCollider : public PUBaseCollider { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUSphereColliderTranslator.h b/extensions/Particle3D/PU/CCPUSphereColliderTranslator.h index 0cd2fa2f40..e12edc90a9 100644 --- a/extensions/Particle3D/PU/CCPUSphereColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUSphereColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SPHERE_COLLIDER_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_SPHERE_COLLIDER_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_SPHERE_COLLIDER_TRANSLATOR_H__ +#define __CC_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.h b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.h index 2ed2770084..44fa5f690c 100644 --- a/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.h +++ b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SPHERE_SURFACE_EMITTER_H__ -#define __AX_PU_PARTICLE_3D_SPHERE_SURFACE_EMITTER_H__ +#ifndef __CC_PU_PARTICLE_3D_SPHERE_SURFACE_EMITTER_H__ +#define __CC_PU_PARTICLE_3D_SPHERE_SURFACE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class AX_EX_DLL PUSphereSurfaceEmitter : public PUEmitter +class CC_EX_DLL PUSphereSurfaceEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUSphereSurfaceEmitterTranslator.h b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitterTranslator.h index fa9e723a76..3fc10b4e5e 100644 --- a/extensions/Particle3D/PU/CCPUSphereSurfaceEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_SPHERE_SURFACE_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_SPHERE_SURFACE_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_SPHERE_SURFACE_TRANSLATOR_H__ +#define __CC_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 f31222aec3..2fcecf412f 100644 --- a/extensions/Particle3D/PU/CCPUTechniqueTranslator.h +++ b/extensions/Particle3D/PU/CCPUTechniqueTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_TECHNIQUE_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_TECHNIQUE_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_TECHNIQUE_TRANSLATOR_H__ +#define __CC_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 99ab8ffbc8..a602caf9a3 100644 --- a/extensions/Particle3D/PU/CCPUTextureAnimator.h +++ b/extensions/Particle3D/PU/CCPUTextureAnimator.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_TEXTURE_ANIMATOR_H__ -#define __AX_PU_PARTICLE_3D_TEXTURE_ANIMATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_TEXTURE_ANIMATOR_H__ +#define __CC_PU_PARTICLE_3D_TEXTURE_ANIMATOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class AX_EX_DLL PUTextureAnimator : public PUAffector +class CC_EX_DLL PUTextureAnimator : public PUAffector { public: enum TextureAnimationType diff --git a/extensions/Particle3D/PU/CCPUTextureAnimatorTranslator.h b/extensions/Particle3D/PU/CCPUTextureAnimatorTranslator.h index 0626cc5f47..d00edc86f3 100644 --- a/extensions/Particle3D/PU/CCPUTextureAnimatorTranslator.h +++ b/extensions/Particle3D/PU/CCPUTextureAnimatorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_TEXTURE_ANIMATOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_TEXTURE_ANIMATOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_TEXTURE_ANIMATOR_TRANSLATOR_H__ +#define __CC_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 1d89267b1b..b76464c702 100644 --- a/extensions/Particle3D/PU/CCPUTextureRotator.cpp +++ b/extensions/Particle3D/PU/CCPUTextureRotator.cpp @@ -50,12 +50,12 @@ PUTextureRotator::~PUTextureRotator() { if (_dynRotation) { - AX_SAFE_DELETE(_dynRotation); + CC_SAFE_DELETE(_dynRotation); } if (_dynRotationSpeed) { - AX_SAFE_DELETE(_dynRotationSpeed); + CC_SAFE_DELETE(_dynRotationSpeed); } } //----------------------------------------------------------------------- @@ -77,7 +77,7 @@ PUDynamicAttribute* PUTextureRotator::getRotation() const void PUTextureRotator::setRotation(PUDynamicAttribute* dynRotation) { if (_dynRotation) - AX_SAFE_DELETE(_dynRotation); + CC_SAFE_DELETE(_dynRotation); _dynRotation = dynRotation; } @@ -90,7 +90,7 @@ PUDynamicAttribute* PUTextureRotator::getRotationSpeed() const void PUTextureRotator::setRotationSpeed(PUDynamicAttribute* dynRotationSpeed) { if (_dynRotationSpeed) - AX_SAFE_DELETE(_dynRotationSpeed); + CC_SAFE_DELETE(_dynRotationSpeed); _dynRotationSpeed = dynRotationSpeed; } diff --git a/extensions/Particle3D/PU/CCPUTextureRotator.h b/extensions/Particle3D/PU/CCPUTextureRotator.h index ac1a71f822..92efa9c34e 100644 --- a/extensions/Particle3D/PU/CCPUTextureRotator.h +++ b/extensions/Particle3D/PU/CCPUTextureRotator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_TEXTURE_ROTATOR_H__ -#define __AX_PU_PARTICLE_3D_TEXTURE_ROTATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_TEXTURE_ROTATOR_H__ +#define __CC_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 AX_EX_DLL PUTextureRotator : public PUAffector +class CC_EX_DLL PUTextureRotator : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUTextureRotatorTranslator.h b/extensions/Particle3D/PU/CCPUTextureRotatorTranslator.h index fe9031871a..2ec37ecc8d 100644 --- a/extensions/Particle3D/PU/CCPUTextureRotatorTranslator.h +++ b/extensions/Particle3D/PU/CCPUTextureRotatorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_TEXTURE_ROTATOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_TEXTURE_ROTATOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_TEXTURE_ROTATOR_TRANSLATOR_H__ +#define __CC_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 fe7831eb68..e96f8c1fd2 100644 --- a/extensions/Particle3D/PU/CCPUTranslateManager.h +++ b/extensions/Particle3D/PU/CCPUTranslateManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ -#define __AX_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ +#ifndef __CC_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ +#define __CC_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUUtil.h b/extensions/Particle3D/PU/CCPUUtil.h index 8e885f0bb0..75aae20fd3 100644 --- a/extensions/Particle3D/PU/CCPUUtil.h +++ b/extensions/Particle3D/PU/CCPUUtil.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_UTIL_H__ -#define __AX_PU_PARTICLE_3D_UTIL_H__ +#ifndef __CC_PU_PARTICLE_3D_UTIL_H__ +#define __CC_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 7c26161d87..d6a25085cc 100644 --- a/extensions/Particle3D/PU/CCPUVelocityMatchingAffector.h +++ b/extensions/Particle3D/PU/CCPUVelocityMatchingAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_H__ +#define __CC_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class AX_EX_DLL PUVelocityMatchingAffector : public PUAffector +class CC_EX_DLL PUVelocityMatchingAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.h b/extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.h index 0256235e02..654ce49713 100644 --- a/extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_TRANSLATOR_H__ +#define __CC_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 d0c947b3d6..c7e0a3a731 100644 --- a/extensions/Particle3D/PU/CCPUVertexEmitter.h +++ b/extensions/Particle3D/PU/CCPUVertexEmitter.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_VERTEX_EMITTER_H__ -#define __AX_PU_PARTICLE_3D_VERTEX_EMITTER_H__ +#ifndef __CC_PU_PARTICLE_3D_VERTEX_EMITTER_H__ +#define __CC_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 b36fbd8bd1..5c338692dc 100644 --- a/extensions/Particle3D/PU/CCPUVortexAffector.cpp +++ b/extensions/Particle3D/PU/CCPUVortexAffector.cpp @@ -44,7 +44,7 @@ PUVortexAffector::~PUVortexAffector() { if (_dynRotationSpeed) { - AX_SAFE_DELETE(_dynRotationSpeed); + CC_SAFE_DELETE(_dynRotationSpeed); } } //----------------------------------------------------------------------- @@ -66,7 +66,7 @@ PUDynamicAttribute* PUVortexAffector::getRotationSpeed() const void PUVortexAffector::setRotationSpeed(PUDynamicAttribute* dynRotationSpeed) { if (_dynRotationSpeed) - AX_SAFE_DELETE(_dynRotationSpeed); + CC_SAFE_DELETE(_dynRotationSpeed); _dynRotationSpeed = dynRotationSpeed; } diff --git a/extensions/Particle3D/PU/CCPUVortexAffector.h b/extensions/Particle3D/PU/CCPUVortexAffector.h index 13ec67a75d..7af688df65 100644 --- a/extensions/Particle3D/PU/CCPUVortexAffector.h +++ b/extensions/Particle3D/PU/CCPUVortexAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_VORTEX_AFFECTOR_H__ -#define __AX_PU_PARTICLE_3D_VORTEX_AFFECTOR_H__ +#ifndef __CC_PU_PARTICLE_3D_VORTEX_AFFECTOR_H__ +#define __CC_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 AX_EX_DLL PUVortexAffector : public PUAffector +class CC_EX_DLL PUVortexAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUVortexAffectorTranslator.h b/extensions/Particle3D/PU/CCPUVortexAffectorTranslator.h index 24c7d08cb4..3f1675a3a8 100644 --- a/extensions/Particle3D/PU/CCPUVortexAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUVortexAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_PU_PARTICLE_3D_VORTEX_AFFECTOR_TRANSLATOR_H__ -#define __AX_PU_PARTICLE_3D_VORTEX_AFFECTOR_TRANSLATOR_H__ +#ifndef __CC_PU_PARTICLE_3D_VORTEX_AFFECTOR_TRANSLATOR_H__ +#define __CC_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 7494c4c4ba..78e28c2f88 100644 --- a/extensions/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/AssetsManager.cpp @@ -266,7 +266,7 @@ AssetsManager::~AssetsManager() { delete _delegate; } - AX_SAFE_DELETE(_downloader); + CC_SAFE_DELETE(_downloader); } void AssetsManager::checkStoragePath() diff --git a/extensions/assets-manager/AssetsManager.h b/extensions/assets-manager/AssetsManager.h index 14f78125be..0fe26d6926 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 AX_EX_DLL AssetsManager : public Node +class CC_EX_DLL AssetsManager : public Node { public: enum class ErrorCode diff --git a/extensions/assets-manager/AssetsManagerEx.cpp b/extensions/assets-manager/AssetsManagerEx.cpp index 97ae5fdedb..5b54625462 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); - AX_SAFE_RELEASE(_localManifest); + CC_SAFE_RELEASE(_localManifest); // _tempManifest could share a ptr with _remoteManifest or _localManifest if (_tempManifest != _localManifest && _tempManifest != _remoteManifest) - AX_SAFE_RELEASE(_tempManifest); - AX_SAFE_RELEASE(_remoteManifest); + CC_SAFE_RELEASE(_tempManifest); + CC_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); - AX_SAFE_RELEASE(_tempManifest); + CC_SAFE_RELEASE(_tempManifest); _tempManifest = nullptr; } } @@ -241,9 +241,9 @@ void AssetsManagerEx::initManifests(std::string_view manifestUrl) if (!_inited) { - AX_SAFE_RELEASE(_localManifest); - AX_SAFE_RELEASE(_tempManifest); - AX_SAFE_RELEASE(_remoteManifest); + CC_SAFE_RELEASE(_localManifest); + CC_SAFE_RELEASE(_tempManifest); + CC_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); - AX_SAFE_RELEASE(cachedManifest); + CC_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); - AX_SAFE_RELEASE(cachedManifest); + CC_SAFE_RELEASE(cachedManifest); } else { - AX_SAFE_RELEASE(_localManifest); + CC_SAFE_RELEASE(_localManifest); _localManifest = cachedManifest; } } @@ -775,7 +775,7 @@ void AssetsManagerEx::startUpdate() { // Remove all temp files _fileUtils->removeDirectory(_tempStoragePath); - AX_SAFE_RELEASE(_tempManifest); + CC_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 - AX_SAFE_RELEASE(_localManifest); + CC_SAFE_RELEASE(_localManifest); _localManifest = _remoteManifest; _localManifest->setManifestRoot(_storagePath); _remoteManifest = nullptr; diff --git a/extensions/assets-manager/AssetsManagerEx.h b/extensions/assets-manager/AssetsManagerEx.h index 2c4d1c1934..3270c3442e 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 AX_EX_DLL AssetsManagerEx : public Ref +class CC_EX_DLL AssetsManagerEx : public Ref { public: //! Update states diff --git a/extensions/assets-manager/CCEventAssetsManagerEx.h b/extensions/assets-manager/CCEventAssetsManagerEx.h index c57f19d846..c966449633 100644 --- a/extensions/assets-manager/CCEventAssetsManagerEx.h +++ b/extensions/assets-manager/CCEventAssetsManagerEx.h @@ -35,7 +35,7 @@ NS_AX_EXT_BEGIN class AssetsManagerEx; -class AX_EX_DLL EventAssetsManagerEx : public axis::EventCustom +class CC_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 b85bf26085..8efa185729 100644 --- a/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp +++ b/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp @@ -47,7 +47,7 @@ EventListenerAssetsManagerEx* EventListenerAssetsManagerEx::create( } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -81,7 +81,7 @@ EventListenerAssetsManagerEx* EventListenerAssetsManagerEx::clone() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } diff --git a/extensions/assets-manager/CCEventListenerAssetsManagerEx.h b/extensions/assets-manager/CCEventListenerAssetsManagerEx.h index 9bf1481c9f..55b2068877 100644 --- a/extensions/assets-manager/CCEventListenerAssetsManagerEx.h +++ b/extensions/assets-manager/CCEventListenerAssetsManagerEx.h @@ -50,7 +50,7 @@ class AssetsManagerEx; * * dispatcher->removeEventListener(listener); */ -class AX_EX_DLL EventListenerAssetsManagerEx : public axis::EventListenerCustom +class CC_EX_DLL EventListenerAssetsManagerEx : public axis::EventListenerCustom { public: friend class AssetsManagerEx; diff --git a/extensions/assets-manager/Manifest.h b/extensions/assets-manager/Manifest.h index ac3cd61445..0297b4e5c2 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 AX_EX_DLL Manifest : public Ref +class CC_EX_DLL Manifest : public Ref { public: friend class AssetsManagerEx; diff --git a/extensions/cocostudio/ActionTimeline/CCActionTimeline.cpp b/extensions/cocostudio/ActionTimeline/CCActionTimeline.cpp index 9641ee3599..02aa848038 100644 --- a/extensions/cocostudio/ActionTimeline/CCActionTimeline.cpp +++ b/extensions/cocostudio/ActionTimeline/CCActionTimeline.cpp @@ -41,7 +41,7 @@ ActionTimelineData* ActionTimelineData::create(int actionTag) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -67,7 +67,7 @@ ActionTimeline* ActionTimeline::create() ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } diff --git a/extensions/cocostudio/ActionTimeline/CCActionTimelineCache.cpp b/extensions/cocostudio/ActionTimeline/CCActionTimelineCache.cpp index 93c308244d..6b505560e2 100644 --- a/extensions/cocostudio/ActionTimeline/CCActionTimelineCache.cpp +++ b/extensions/cocostudio/ActionTimeline/CCActionTimelineCache.cpp @@ -99,7 +99,7 @@ ActionTimelineCache* ActionTimelineCache::getInstance() void ActionTimelineCache::destroyInstance() { - AX_SAFE_DELETE(_sharedActionCache); + CC_SAFE_DELETE(_sharedActionCache); } void ActionTimelineCache::purge() @@ -443,7 +443,7 @@ ActionTimeline* ActionTimelineCache::loadAnimationActionWithFlatBuffersFile(std: std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName); - AX_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); + CC_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); - AX_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); + CC_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); action = createActionWithDataBuffer(data); _animationActions.insert(fileName, action); diff --git a/extensions/cocostudio/ActionTimeline/CCActionTimelineData.cpp b/extensions/cocostudio/ActionTimeline/CCActionTimelineData.cpp index d88a1c3ffb..84c5db52c1 100644 --- a/extensions/cocostudio/ActionTimeline/CCActionTimelineData.cpp +++ b/extensions/cocostudio/ActionTimeline/CCActionTimelineData.cpp @@ -12,7 +12,7 @@ ActionTimelineData* ActionTimelineData::create(int actionTag) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } diff --git a/extensions/cocostudio/ActionTimeline/CCActionTimelineNode.cpp b/extensions/cocostudio/ActionTimeline/CCActionTimelineNode.cpp index 4a79912ff7..1d378fc376 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; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } diff --git a/extensions/cocostudio/ActionTimeline/CCBoneNode.cpp b/extensions/cocostudio/ActionTimeline/CCBoneNode.cpp index f21c43c9ee..4520e9da06 100644 --- a/extensions/cocostudio/ActionTimeline/CCBoneNode.cpp +++ b/extensions/cocostudio/ActionTimeline/CCBoneNode.cpp @@ -41,7 +41,7 @@ BoneNode* BoneNode::create() ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -55,7 +55,7 @@ BoneNode* BoneNode::create(int length) } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -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::AX_INVALID_INDEX) + if (index != axis::CC_INVALID_INDEX) { removeFromChildrenListHelper(child); Node::removeChild(child, cleanup); @@ -420,7 +420,7 @@ void BoneNode::draw(axis::Renderer* renderer, const axis::Mat4& transform, uint3 _customCommand.init(_globalZOrder, _blendFunc); renderer->addCommand(&_customCommand); -#ifdef AX_STUDIO_ENABLED_VIEW +#ifdef CC_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); -// AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8); -#endif // AX_STUDIO_ENABLED_VIEW +// CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8); +#endif // CC_STUDIO_ENABLED_VIEW for (int i = 0; i < 4; ++i) { @@ -564,7 +564,7 @@ SkeletonNode* BoneNode::getRootSkeletonNode() const return _rootSkeleton; } -#ifdef AX_STUDIO_ENABLED_VIEW +#ifdef CC_STUDIO_ENABLED_VIEW bool BoneNode::isPointOnRack(const axis::Vec2& bonePoint) { @@ -584,7 +584,7 @@ bool BoneNode::isPointOnRack(const axis::Vec2& bonePoint) } return false; } -#endif // AX_STUDIO_ENABLED_VIEW +#endif // CC_STUDIO_ENABLED_VIEW void BoneNode::batchBoneDrawToSkeleton(BoneNode* bone) const { diff --git a/extensions/cocostudio/ActionTimeline/CCBoneNode.h b/extensions/cocostudio/ActionTimeline/CCBoneNode.h index f2ecb3fae5..7b02ad1998 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 AX_STUDIO_ENABLED_VIEW +#ifdef CC_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]; - AX_DISALLOW_COPY_AND_ASSIGN(BoneNode); + CC_DISALLOW_COPY_AND_ASSIGN(BoneNode); }; NS_TIMELINE_END diff --git a/extensions/cocostudio/ActionTimeline/CCFrame.h b/extensions/cocostudio/ActionTimeline/CCFrame.h index 8d242bc98d..0a360112d0 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 */ - AX_DEPRECATED_ATTRIBUTE inline void setAlpha(uint8_t alpha) { _alpha = alpha; } - AX_DEPRECATED_ATTRIBUTE inline uint8_t getAlpha() const { return _alpha; } + CC_DEPRECATED_ATTRIBUTE inline void setAlpha(uint8_t alpha) { _alpha = alpha; } + CC_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 882ffd6ee4..74847baef2 100644 --- a/extensions/cocostudio/ActionTimeline/CCSkeletonNode.cpp +++ b/extensions/cocostudio/ActionTimeline/CCSkeletonNode.cpp @@ -40,7 +40,7 @@ SkeletonNode* SkeletonNode::create() skeletonNode->autorelease(); return skeletonNode; } - AX_SAFE_DELETE(skeletonNode); + CC_SAFE_DELETE(skeletonNode); return nullptr; } @@ -268,7 +268,7 @@ void SkeletonNode::batchDrawAllSubBones() axis::CustomCommand::BufferUsage::DYNAMIC); _batchBoneCommand.updateVertexBuffer(_batchedBoneVertexData.data(), sizeof(VertexData) * _batchedVeticesCount); -#ifdef AX_STUDIO_ENABLED_VIEW +#ifdef CC_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); // } -// AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _batchedVeticesCount); +// CC_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 // AX_STUDIO_ENABLED_VIEW +#endif // CC_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 4282034fa3..cf66fda305 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> > - AX_DISALLOW_COPY_AND_ASSIGN(SkeletonNode); + CC_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 9d2df6e5f2..ac9a476eff 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 __AX_TIMELINE_MACROS_H__ -#define __AX_TIMELINE_MACROS_H__ +#ifndef __CC_TIMELINE_MACROS_H__ +#define __CC_TIMELINE_MACROS_H__ #ifdef __cplusplus # define NS_TIMELINE_BEGIN \ diff --git a/extensions/cocostudio/ActionTimeline/CSLoader.cpp b/extensions/cocostudio/ActionTimeline/CSLoader.cpp index 33977d1ef0..cd8ca5c348 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(AX_BUILD_WITH_SPINE) && AX_BUILD_WITH_SPINE +#if defined(CC_BUILD_WITH_SPINE) && CC_BUILD_WITH_SPINE # include "WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h" #endif #include "WidgetReader/RichTextReader/RichTextReader.h" @@ -197,7 +197,7 @@ CSLoader* CSLoader::getInstance() void CSLoader::destroyInstance() { - AX_SAFE_DELETE(_sharedCSLoader); + CC_SAFE_DELETE(_sharedCSLoader); ActionTimelineCache::destroyInstance(); } @@ -238,7 +238,7 @@ CSLoader::CSLoader() /// Added by x-studio CREATE_CLASS_NODE_READER_INFO(RichTextReader); -#if defined(AX_BUILD_WITH_SPINE) && AX_BUILD_WITH_SPINE +#if defined(CC_BUILD_WITH_SPINE) && CC_BUILD_WITH_SPINE CREATE_CLASS_NODE_READER_INFO(SpineSkeletonReader); #endif CREATE_CLASS_NODE_READER_INFO(RadioButtonReader); @@ -897,9 +897,9 @@ Node* CSLoader::createNode(const Data& data, const ccNodeLoadCallback& callback) Node* node = nullptr; do { - AX_BREAK_IF(data.isNull() || data.getSize() <= 0); + CC_BREAK_IF(data.isNull() || data.getSize() <= 0); auto csparsebinary = GetCSParseBinary(data.getBytes()); - AX_BREAK_IF(nullptr == csparsebinary); + CC_BREAK_IF(nullptr == csparsebinary); auto csBuildId = csparsebinary->version(); if (csBuildId) { @@ -1004,14 +1004,14 @@ Node* CSLoader::nodeWithFlatBuffersFile(std::string_view fileName, const ccNodeL { std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName); - AX_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); + CC_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); Data buf = FileUtils::getInstance()->getDataFromFile(fullPath); if (buf.isNull()) { CCLOG("CSLoader::nodeWithFlatBuffersFile - failed read file: %s", fileName.data()); - AX_ASSERT(false); + CC_ASSERT(false); return nullptr; } @@ -1308,7 +1308,7 @@ bool CSLoader::isCustomWidget(std::string_view type) Widget* widget = dynamic_cast(ObjectFactory::getInstance()->createObject(type)); if (widget) { - AX_SAFE_DELETE(widget); + CC_SAFE_DELETE(widget); return true; } diff --git a/extensions/cocostudio/ActionTimeline/CSLoader.h b/extensions/cocostudio/ActionTimeline/CSLoader.h index d026d018b1..2c4e19f2bc 100644 --- a/extensions/cocostudio/ActionTimeline/CSLoader.h +++ b/extensions/cocostudio/ActionTimeline/CSLoader.h @@ -75,7 +75,7 @@ public: CSLoader(); /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE void purge(); + CC_DEPRECATED_ATTRIBUTE void purge(); void init(); diff --git a/extensions/cocostudio/CCActionManagerEx.cpp b/extensions/cocostudio/CCActionManagerEx.cpp index ea59f0356f..0868543dd5 100644 --- a/extensions/cocostudio/CCActionManagerEx.cpp +++ b/extensions/cocostudio/CCActionManagerEx.cpp @@ -46,7 +46,7 @@ void ActionManagerEx::destroyInstance() if (sharedActionManager != nullptr) { sharedActionManager->releaseActions(); - AX_SAFE_DELETE(sharedActionManager); + CC_SAFE_DELETE(sharedActionManager); } } diff --git a/extensions/cocostudio/CCActionNode.cpp b/extensions/cocostudio/CCActionNode.cpp index 6d8e042def..e92fafe34b 100644 --- a/extensions/cocostudio/CCActionNode.cpp +++ b/extensions/cocostudio/CCActionNode.cpp @@ -58,20 +58,20 @@ ActionNode::~ActionNode() { if (_action == nullptr) { - AX_SAFE_RELEASE_NULL(_actionSpawn); + CC_SAFE_RELEASE_NULL(_actionSpawn); } else { - AX_SAFE_RELEASE_NULL(_action); - AX_SAFE_RELEASE_NULL(_actionSpawn); + CC_SAFE_RELEASE_NULL(_action); + CC_SAFE_RELEASE_NULL(_actionSpawn); } - AX_SAFE_RELEASE(_object); + CC_SAFE_RELEASE(_object); for (auto object : _frameArray) { object->clear(); - AX_SAFE_DELETE(object); + CC_SAFE_DELETE(object); } _frameArray.clear(); } @@ -395,9 +395,9 @@ int ActionNode::getActionTag() void ActionNode::setObject(Ref* node) { - AX_SAFE_RELEASE(_object); + CC_SAFE_RELEASE(_object); _object = node; - AX_SAFE_RETAIN(_object); + CC_SAFE_RETAIN(_object); } Ref* ActionNode::getObject() @@ -527,16 +527,16 @@ Spawn* ActionNode::refreshActionProperty() if (_action == nullptr) { - AX_SAFE_RELEASE_NULL(_actionSpawn); + CC_SAFE_RELEASE_NULL(_actionSpawn); } else { - AX_SAFE_RELEASE_NULL(_action); - AX_SAFE_RELEASE_NULL(_actionSpawn); + CC_SAFE_RELEASE_NULL(_action); + CC_SAFE_RELEASE_NULL(_actionSpawn); } _actionSpawn = Spawn::create(cSpawnArray); - AX_SAFE_RETAIN(_actionSpawn); + CC_SAFE_RETAIN(_actionSpawn); return _actionSpawn; } diff --git a/extensions/cocostudio/CCActionObject.cpp b/extensions/cocostudio/CCActionObject.cpp index 3e6c7d8917..459fdcc355 100644 --- a/extensions/cocostudio/CCActionObject.cpp +++ b/extensions/cocostudio/CCActionObject.cpp @@ -47,7 +47,7 @@ ActionObject::ActionObject() , _fTotalTime(0.0f) { _pScheduler = Director::getInstance()->getScheduler(); - AX_SAFE_RETAIN(_pScheduler); + CC_SAFE_RETAIN(_pScheduler); } ActionObject::~ActionObject() @@ -55,8 +55,8 @@ ActionObject::~ActionObject() _loop = false; _pScheduler->unscheduleAllForTarget(this); _actionNodeList.clear(); - AX_SAFE_RELEASE(_pScheduler); - AX_SAFE_RELEASE(_CallBack); + CC_SAFE_RELEASE(_pScheduler); + CC_SAFE_RELEASE(_CallBack); } void ActionObject::setName(const char* name) @@ -233,12 +233,12 @@ void ActionObject::play() } if (_loop) { - _pScheduler->schedule(AX_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this, 0.0f, AX_REPEAT_FOREVER, + _pScheduler->schedule(CC_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this, 0.0f, CC_REPEAT_FOREVER, 0.0f, false); } else { - _pScheduler->schedule(AX_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this, 0.0f, false); + _pScheduler->schedule(CC_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this, 0.0f, false); } } @@ -246,7 +246,7 @@ void ActionObject::play(CallFunc* func) { this->play(); this->_CallBack = func; - AX_SAFE_RETAIN(_CallBack); + CC_SAFE_RETAIN(_CallBack); } void ActionObject::pause() { @@ -261,7 +261,7 @@ void ActionObject::stop() e->stopAction(); } _bPlaying = false; - _pScheduler->unschedule(AX_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this); + _pScheduler->unschedule(CC_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this); _bPause = false; } @@ -300,7 +300,7 @@ void ActionObject::simulationActionUpdate(float /*dt*/) else { _bPlaying = false; - _pScheduler->unschedule(AX_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this); + _pScheduler->unschedule(CC_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this); } } } diff --git a/extensions/cocostudio/CCArmature.cpp b/extensions/cocostudio/CCArmature.cpp index f400df5f83..eab47c2e9b 100644 --- a/extensions/cocostudio/CCArmature.cpp +++ b/extensions/cocostudio/CCArmature.cpp @@ -53,7 +53,7 @@ Armature* Armature::create() armature->autorelease(); return armature; } - AX_SAFE_DELETE(armature); + CC_SAFE_DELETE(armature); return nullptr; } @@ -65,7 +65,7 @@ Armature* Armature::create(std::string_view name) armature->autorelease(); return armature; } - AX_SAFE_DELETE(armature); + CC_SAFE_DELETE(armature); return nullptr; } @@ -77,7 +77,7 @@ Armature* Armature::create(std::string_view name, Bone* parentBone) armature->autorelease(); return armature; } - AX_SAFE_DELETE(armature); + CC_SAFE_DELETE(armature); return nullptr; } @@ -94,7 +94,7 @@ Armature::~Armature() _boneDic.clear(); _topBoneList.clear(); - AX_SAFE_DELETE(_animation); + CC_SAFE_DELETE(_animation); } bool Armature::init() @@ -109,7 +109,7 @@ bool Armature::init(std::string_view name) { removeAllChildren(); - AX_SAFE_DELETE(_animation); + CC_SAFE_DELETE(_animation); _animation = new ArmatureAnimation(); _animation->init(this); @@ -142,13 +142,13 @@ bool Armature::init(std::string_view name) do { MovementData* movData = animationData->getMovement(animationData->movementNames.at(0)); - AX_BREAK_IF(!movData); + CC_BREAK_IF(!movData); MovementBoneData* movBoneData = movData->getMovementBoneData(bone->getName()); - AX_BREAK_IF(!movBoneData || movBoneData->frameList.size() <= 0); + CC_BREAK_IF(!movBoneData || movBoneData->frameList.size() <= 0); FrameData* frameData = movBoneData->getFrameData(0); - AX_BREAK_IF(!frameData); + CC_BREAK_IF(!frameData); bone->getTweenData()->copy(frameData); bone->changeDisplayWithIndex(frameData->displayIndex, false); @@ -372,7 +372,7 @@ void Armature::draw(axis::Renderer* renderer, const Mat4& transform, uint32_t fl { if (_parentBone == nullptr && _batchNode == nullptr) { - // AX_NODE_DRAW_SETUP(); + // CC_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); - // AX_NODE_DRAW_SETUP(); + // CC_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); - // AX_NODE_DRAW_SETUP(); + // CC_NODE_DRAW_SETUP(); } } } diff --git a/extensions/cocostudio/CCArmature.h b/extensions/cocostudio/CCArmature.h index 480a1d5cb7..a472bc8405 100644 --- a/extensions/cocostudio/CCArmature.h +++ b/extensions/cocostudio/CCArmature.h @@ -40,34 +40,34 @@ struct cpBody; namespace cocostudio { -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; +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; 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 - AX_DEPRECATED_ATTRIBUTE virtual void drawContour(); + CC_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 ed34ecce4b..a1ad553f2c 100644 --- a/extensions/cocostudio/CCArmatureAnimation.cpp +++ b/extensions/cocostudio/CCArmatureAnimation.cpp @@ -41,7 +41,7 @@ ArmatureAnimation* ArmatureAnimation::create(Armature* armature) pArmatureAnimation->autorelease(); return pArmatureAnimation; } - AX_SAFE_DELETE(pArmatureAnimation); + CC_SAFE_DELETE(pArmatureAnimation); return nullptr; } @@ -69,9 +69,9 @@ ArmatureAnimation::ArmatureAnimation() ArmatureAnimation::~ArmatureAnimation(void) { - AX_SAFE_RELEASE_NULL(_animationData); + CC_SAFE_RELEASE_NULL(_animationData); - AX_SAFE_RELEASE_NULL(_userObject); + CC_SAFE_RELEASE_NULL(_userObject); } bool ArmatureAnimation::init(Armature* armature) @@ -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; - AX_ASSERT((animationIndex > -1) && ((unsigned int)animationIndex < movName.size())); + CC_ASSERT((animationIndex > -1) && ((unsigned int)animationIndex < movName.size())); std::string animationName = movName.at(animationIndex); play(animationName, durationTo, loop); @@ -366,7 +366,7 @@ void ArmatureAnimation::update(float dt) _ignoreFrameEvent = false; - AX_SAFE_DELETE(event); + CC_SAFE_DELETE(event); } while (_movementEventQueue.size() > 0) @@ -384,7 +384,7 @@ void ArmatureAnimation::update(float dt) _movementEventListener(event->armature, event->movementType, event->movementID); } - AX_SAFE_DELETE(event); + CC_SAFE_DELETE(event); } } @@ -482,8 +482,8 @@ void ArmatureAnimation::setFrameEventCallFunc( void ArmatureAnimation::setUserObject(Ref* pUserObject) { - AX_SAFE_RETAIN(pUserObject); - AX_SAFE_RELEASE(_userObject); + CC_SAFE_RETAIN(pUserObject); + CC_SAFE_RELEASE(_userObject); _userObject = pUserObject; } diff --git a/extensions/cocostudio/CCArmatureAnimation.h b/extensions/cocostudio/CCArmatureAnimation.h index f9abd11ae9..6b61f316ce 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 */ - AX_DEPRECATED_ATTRIBUTE virtual void setAnimationScale(float animationScale); - AX_DEPRECATED_ATTRIBUTE virtual float getAnimationScale() const; + CC_DEPRECATED_ATTRIBUTE virtual void setAnimationScale(float animationScale); + CC_DEPRECATED_ATTRIBUTE virtual float getAnimationScale() const; /** * Scale animation play speed. @@ -106,7 +106,7 @@ public: virtual float getSpeedScale() const; //! The animation update speed - AX_DEPRECATED_ATTRIBUTE virtual void setAnimationInternal(float animationInternal) {} + CC_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 */ - AX_DEPRECATED_ATTRIBUTE virtual void playByIndex(int animationIndex, int durationTo = -1, int loop = -1); + CC_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); */ - AX_DEPRECATED_ATTRIBUTE void setMovementEventCallFunc(axis::Ref* target, SEL_MovementEventCallFunc callFunc); + CC_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); */ - AX_DEPRECATED_ATTRIBUTE void setFrameEventCallFunc(axis::Ref* target, SEL_FrameEventCallFunc callFunc); + CC_DEPRECATED_ATTRIBUTE void setFrameEventCallFunc(axis::Ref* target, SEL_FrameEventCallFunc callFunc); void setMovementEventCallFunc( std::function listener); @@ -201,8 +201,8 @@ public: { if (_animationData != data) { - AX_SAFE_RETAIN(data); - AX_SAFE_RELEASE(_animationData); + CC_SAFE_RETAIN(data); + CC_SAFE_RELEASE(_animationData); _animationData = data; } } diff --git a/extensions/cocostudio/CCArmatureDataManager.cpp b/extensions/cocostudio/CCArmatureDataManager.cpp index 14a4cdcea5..4ddff62d8f 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()) { - AX_SAFE_DELETE(s_sharedArmatureDataManager); + CC_SAFE_DELETE(s_sharedArmatureDataManager); } } return s_sharedArmatureDataManager; @@ -52,7 +52,7 @@ void ArmatureDataManager::destroyInstance() { SpriteFrameCacheHelper::purge(); DataReaderHelper::purge(); - AX_SAFE_RELEASE_NULL(s_sharedArmatureDataManager); + CC_SAFE_RELEASE_NULL(s_sharedArmatureDataManager); } ArmatureDataManager::ArmatureDataManager(void) diff --git a/extensions/cocostudio/CCArmatureDataManager.h b/extensions/cocostudio/CCArmatureDataManager.h index 646df7f2ce..8409791162 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 */ - AX_DEPRECATED_ATTRIBUTE static ArmatureDataManager* sharedArmatureDataManager() + CC_DEPRECATED_ATTRIBUTE static ArmatureDataManager* sharedArmatureDataManager() { return ArmatureDataManager::getInstance(); } /** @deprecated Use destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge() { ArmatureDataManager::destroyInstance(); }; + CC_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 bb69ff6391..2817166847 100644 --- a/extensions/cocostudio/CCBatchNode.cpp +++ b/extensions/cocostudio/CCBatchNode.cpp @@ -40,13 +40,13 @@ BatchNode* BatchNode::create() batchNode->autorelease(); return batchNode; } - AX_SAFE_DELETE(batchNode); + CC_SAFE_DELETE(batchNode); return nullptr; } BatchNode::BatchNode() : _groupCommand(nullptr) {} BatchNode::~BatchNode() { - AX_SAFE_DELETE(_groupCommand); + CC_SAFE_DELETE(_groupCommand); } bool BatchNode::init() @@ -131,7 +131,7 @@ void BatchNode::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) return; } - // AX_NODE_DRAW_SETUP(); + // CC_NODE_DRAW_SETUP(); bool pushed = false; for (auto object : _children) diff --git a/extensions/cocostudio/CCBone.cpp b/extensions/cocostudio/CCBone.cpp index b178534c57..b43e6b88dd 100644 --- a/extensions/cocostudio/CCBone.cpp +++ b/extensions/cocostudio/CCBone.cpp @@ -43,7 +43,7 @@ Bone* Bone::create() pBone->autorelease(); return pBone; } - AX_SAFE_DELETE(pBone); + CC_SAFE_DELETE(pBone); return nullptr; } @@ -56,7 +56,7 @@ Bone* Bone::create(std::string_view name) pBone->autorelease(); return pBone; } - AX_SAFE_DELETE(pBone); + CC_SAFE_DELETE(pBone); return nullptr; } @@ -80,14 +80,14 @@ Bone::Bone() Bone::~Bone(void) { - AX_SAFE_DELETE(_tweenData); - AX_SAFE_DELETE(_tween); - AX_SAFE_DELETE(_displayManager); - AX_SAFE_DELETE(_worldInfo); + CC_SAFE_DELETE(_tweenData); + CC_SAFE_DELETE(_tween); + CC_SAFE_DELETE(_displayManager); + CC_SAFE_DELETE(_worldInfo); - AX_SAFE_RELEASE_NULL(_boneData); + CC_SAFE_RELEASE_NULL(_boneData); - AX_SAFE_RELEASE(_childArmature); + CC_SAFE_RELEASE(_childArmature); } bool Bone::init() @@ -103,21 +103,21 @@ bool Bone::init(std::string_view name) _name = name; - AX_SAFE_DELETE(_tweenData); + CC_SAFE_DELETE(_tweenData); _tweenData = new FrameData(); - AX_SAFE_DELETE(_tween); + CC_SAFE_DELETE(_tween); _tween = new Tween(); _tween->init(this); - AX_SAFE_DELETE(_displayManager); + CC_SAFE_DELETE(_displayManager); _displayManager = new DisplayManager(); _displayManager->init(this); - AX_SAFE_DELETE(_worldInfo); + CC_SAFE_DELETE(_worldInfo); _worldInfo = new BaseData(); - AX_SAFE_DELETE(_boneData); + CC_SAFE_DELETE(_boneData); _boneData = new BoneData(); bRet = true; @@ -132,8 +132,8 @@ void Bone::setBoneData(BoneData* boneData) if (_boneData != boneData) { - AX_SAFE_RETAIN(boneData); - AX_SAFE_RELEASE(_boneData); + CC_SAFE_RETAIN(boneData); + CC_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 + AX_DEGREES_TO_RADIANS(_rotationZ_X); - _worldInfo->skewY = _worldInfo->skewY + _skewY - AX_DEGREES_TO_RADIANS(_rotationZ_Y); + _worldInfo->skewX = _worldInfo->skewX + _skewX + CC_DEGREES_TO_RADIANS(_rotationZ_X); + _worldInfo->skewY = _worldInfo->skewY + _skewY - CC_DEGREES_TO_RADIANS(_rotationZ_Y); if (_parentBone) { @@ -249,17 +249,17 @@ void Bone::setBlendFunc(const BlendFunc& blendFunc) void Bone::updateDisplayedColor(const Color3B& parentColor) { -#ifdef AX_STUDIO_ENABLED_VIEW +#ifdef CC_STUDIO_ENABLED_VIEW _realColor = Color3B(255, 255, 255); -#endif // AX_STUDIO_ENABLED_VIEW +#endif // CC_STUDIO_ENABLED_VIEW Node::updateDisplayedColor(parentColor); } void Bone::updateDisplayedOpacity(uint8_t parentOpacity) { -#ifdef AX_STUDIO_ENABLED_VIEW +#ifdef CC_STUDIO_ENABLED_VIEW _realOpacity = 255; -#endif // AX_STUDIO_ENABLED_VIEW +#endif // CC_STUDIO_ENABLED_VIEW Node::updateDisplayedOpacity(parentOpacity); } @@ -297,7 +297,7 @@ void Bone::addChildBone(Bone* child) _children.reserve(4); } - if (_children.getIndex(child) == AX_INVALID_INDEX) + if (_children.getIndex(child) == CC_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) != AX_INVALID_INDEX) + if (!_children.empty() && _children.getIndex(bone) != CC_INVALID_INDEX) { if (recursion) { @@ -354,8 +354,8 @@ void Bone::setChildArmature(Armature* armature) _childArmature->setParentBone(nullptr); } - AX_SAFE_RETAIN(armature); - AX_SAFE_RELEASE(_childArmature); + CC_SAFE_RETAIN(armature); + CC_SAFE_RELEASE(_childArmature); _childArmature = armature; } } diff --git a/extensions/cocostudio/CCBone.h b/extensions/cocostudio/CCBone.h index 3964bc7a4b..1ab62afcf9 100644 --- a/extensions/cocostudio/CCBone.h +++ b/extensions/cocostudio/CCBone.h @@ -94,8 +94,8 @@ public: void removeDisplay(int index); - AX_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); - AX_DEPRECATED_ATTRIBUTE void changeDisplayByName(std::string_view name, bool force); + CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); + CC_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 */ - AX_DEPRECATED_ATTRIBUTE virtual bool getIgnoreMovementBoneData() const { return isIgnoreMovementBoneData(); } + CC_DEPRECATED_ATTRIBUTE virtual bool getIgnoreMovementBoneData() const { return isIgnoreMovementBoneData(); } /* * Set blend function diff --git a/extensions/cocostudio/CCColliderDetector.cpp b/extensions/cocostudio/CCColliderDetector.cpp index 93399d3b06..e6d0b8cf8a 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) { - AX_SAFE_RETAIN(_contourData); + CC_SAFE_RETAIN(_contourData); _filter = new ColliderFilter(); # if ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX _calculatedVertexList = Array::create(); - AX_SAFE_RETAIN(_calculatedVertexList); + CC_SAFE_RETAIN(_calculatedVertexList); # endif } #elif ENABLE_PHYSICS_CHIPMUNK_DETECT ColliderBody::ColliderBody(ContourData* contourData) : _shape(nullptr), _contourData(contourData) { - AX_SAFE_RETAIN(_contourData); + CC_SAFE_RETAIN(_contourData); _filter = new ColliderFilter(); # if ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX _calculatedVertexList = Array::create(); - AX_SAFE_RETAIN(_calculatedVertexList); + CC_SAFE_RETAIN(_calculatedVertexList); # endif } #elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX ColliderBody::ColliderBody(ContourData* contourData) : _contourData(contourData) { - AX_SAFE_RETAIN(_contourData); + CC_SAFE_RETAIN(_contourData); } #endif ColliderBody::~ColliderBody() { - AX_SAFE_RELEASE(_contourData); + CC_SAFE_RELEASE(_contourData); #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT - AX_SAFE_DELETE(_filter); + CC_SAFE_DELETE(_filter); #endif } @@ -115,7 +115,7 @@ ColliderDetector* ColliderDetector::create() pColliderDetector->autorelease(); return pColliderDetector; } - AX_SAFE_DELETE(pColliderDetector); + CC_SAFE_DELETE(pColliderDetector); return nullptr; } @@ -127,7 +127,7 @@ ColliderDetector* ColliderDetector::create(Bone* bone) pColliderDetector->autorelease(); return pColliderDetector; } - AX_SAFE_DELETE(pColliderDetector); + CC_SAFE_DELETE(pColliderDetector); return nullptr; } @@ -144,7 +144,7 @@ ColliderDetector::~ColliderDetector() _colliderBodyList.clear(); #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT - AX_SAFE_DELETE(_filter); + CC_SAFE_DELETE(_filter); #endif } @@ -413,7 +413,7 @@ void ColliderDetector::setBody(b2Body* pBody) b2PolygonShape polygon; polygon.Set(b2bv, (int)contourData->vertexList.size()); - AX_SAFE_DELETE(b2bv); + CC_SAFE_DELETE(b2bv); b2FixtureDef fixtureDef; fixtureDef.shape = &polygon; diff --git a/extensions/cocostudio/CCComAttribute.cpp b/extensions/cocostudio/CCComAttribute.cpp index 36ad7dfb4b..e1c3334c09 100644 --- a/extensions/cocostudio/CCComAttribute.cpp +++ b/extensions/cocostudio/CCComAttribute.cpp @@ -141,7 +141,7 @@ ComAttribute* ComAttribute::create() } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; } @@ -151,7 +151,7 @@ bool ComAttribute::serialize(void* r) bool ret = false; do { - AX_BREAK_IF(r == nullptr); + CC_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"); - AX_BREAK_IF(className == nullptr); + CC_BREAK_IF(className == nullptr); comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value& fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); - AX_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); file = DICTOOL->getStringValue_json(fileData, "path"); - AX_BREAK_IF(file == nullptr); + CC_BREAK_IF(file == nullptr); resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); - AX_BREAK_IF(resType != 0); + CC_BREAK_IF(resType != 0); } else if (cocoNode != nullptr) { className = cocoNode[1].GetValue(cocoLoader); - AX_BREAK_IF(className == nullptr); + CC_BREAK_IF(className == nullptr); comName = cocoNode[2].GetValue(cocoLoader); stExpCocoNode* fileData = cocoNode[3].GetChildArray(cocoLoader); - AX_BREAK_IF(!fileData); + CC_BREAK_IF(!fileData); file = fileData[0].GetValue(cocoLoader); - AX_BREAK_IF(file == nullptr); + CC_BREAK_IF(file == nullptr); resType = atoi(fileData[2].GetValue(cocoLoader)); - AX_BREAK_IF(resType != 0); + CC_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()); - AX_BREAK_IF(_doc.HasParseError()); + CC_BREAK_IF(_doc.HasParseError()); ret = true; } while (0); return ret; diff --git a/extensions/cocostudio/CCComAttribute.h b/extensions/cocostudio/CCComAttribute.h index d30d153b09..453ac8327f 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 __AX_EXTENTIONS_CCCOMATTRIBUTE_H__ -#define __AX_EXTENTIONS_CCCOMATTRIBUTE_H__ +#ifndef __CC_EXTENTIONS_CCCOMATTRIBUTE_H__ +#define __CC_EXTENTIONS_CCCOMATTRIBUTE_H__ #include "CCComBase.h" #include "2d/CCComponent.h" @@ -71,4 +71,4 @@ private: } // namespace cocostudio -#endif // __AX_EXTENTIONS_CCCOMATTRIBUTE_H__ +#endif // __CC_EXTENTIONS_CCCOMATTRIBUTE_H__ diff --git a/extensions/cocostudio/CCComAudio.cpp b/extensions/cocostudio/CCComAudio.cpp index 769b0c5011..4da00aa3ff 100644 --- a/extensions/cocostudio/CCComAudio.cpp +++ b/extensions/cocostudio/CCComAudio.cpp @@ -65,7 +65,7 @@ bool ComAudio::serialize(void* r) bool ret = false; do { - AX_BREAK_IF(r == nullptr); + CC_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"); - AX_BREAK_IF(className == nullptr); + CC_BREAK_IF(className == nullptr); comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value& fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); - AX_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); file = DICTOOL->getStringValue_json(fileData, "path"); - AX_BREAK_IF(file == nullptr); + CC_BREAK_IF(file == nullptr); resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); - AX_BREAK_IF(resType != 0); + CC_BREAK_IF(resType != 0); loop = DICTOOL->getIntValue_json(*v, "loop") != 0 ? true : false; } else if (cocoNode != nullptr) { className = cocoNode[1].GetValue(cocoLoader); - AX_BREAK_IF(className == nullptr); + CC_BREAK_IF(className == nullptr); comName = cocoNode[2].GetValue(cocoLoader); stExpCocoNode* pfileData = cocoNode[4].GetChildArray(cocoLoader); - AX_BREAK_IF(!pfileData); + CC_BREAK_IF(!pfileData); file = pfileData[0].GetValue(cocoLoader); - AX_BREAK_IF(file == nullptr); + CC_BREAK_IF(file == nullptr); resType = atoi(pfileData[2].GetValue(cocoLoader)); - AX_BREAK_IF(resType != 0); + CC_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 { - AX_BREAK_IF(true); + CC_BREAK_IF(true); } ret = true; } while (0); @@ -147,7 +147,7 @@ ComAudio* ComAudio::create() } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/cocostudio/CCComAudio.h b/extensions/cocostudio/CCComAudio.h index 3f3947c4ff..e4268bb9e8 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 __AX_EXTENTIONS_CCCOMAUDIO_H__ -#define __AX_EXTENTIONS_CCCOMAUDIO_H__ +#ifndef __CC_EXTENTIONS_CCCOMAUDIO_H__ +#define __CC_EXTENTIONS_CCCOMAUDIO_H__ #include "CCComBase.h" #include "base/CCProtocols.h" @@ -129,4 +129,4 @@ private: } // namespace cocostudio -#endif // __AX_EXTENTIONS_CCCOMAUDIO_H__ +#endif // __CC_EXTENTIONS_CCCOMAUDIO_H__ diff --git a/extensions/cocostudio/CCComBase.h b/extensions/cocostudio/CCComBase.h index 001a805bab..46aa627cd0 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 __AX_EXTENTIONS_CCCOMBASE_H__ -#define __AX_EXTENTIONS_CCCOMBASE_H__ +#ifndef __CC_EXTENTIONS_CCCOMBASE_H__ +#define __CC_EXTENTIONS_CCCOMBASE_H__ #include #include "DictionaryHelper.h" diff --git a/extensions/cocostudio/CCComController.cpp b/extensions/cocostudio/CCComController.cpp index 61ac4616e1..ef748246e0 100644 --- a/extensions/cocostudio/CCComController.cpp +++ b/extensions/cocostudio/CCComController.cpp @@ -75,7 +75,7 @@ ComController* ComController::create() } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/cocostudio/CCComController.h b/extensions/cocostudio/CCComController.h index 5ab0f482c8..c6dcff7589 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 __AX_EXTENTIONS_CCCOMCONTROLLER_H__ -#define __AX_EXTENTIONS_CCCOMCONTROLLER_H__ +#ifndef __CC_EXTENTIONS_CCCOMCONTROLLER_H__ +#define __CC_EXTENTIONS_CCCOMCONTROLLER_H__ #include "CCComBase.h" #include "CCInputDelegate.h" @@ -83,4 +83,4 @@ public: } // namespace cocostudio -#endif // __AX_EXTENTIONS_CCCOMCONTROLLER_H__ +#endif // __CC_EXTENTIONS_CCCOMCONTROLLER_H__ diff --git a/extensions/cocostudio/CCComExtensionData.cpp b/extensions/cocostudio/CCComExtensionData.cpp index 040d721bdb..629c808870 100644 --- a/extensions/cocostudio/CCComExtensionData.cpp +++ b/extensions/cocostudio/CCComExtensionData.cpp @@ -38,7 +38,7 @@ ComExtensionData::ComExtensionData() : _customProperty(""), _timelineData(nullpt ComExtensionData::~ComExtensionData() { - AX_SAFE_RELEASE(_timelineData); + CC_SAFE_RELEASE(_timelineData); } ComExtensionData* ComExtensionData::create() @@ -50,7 +50,7 @@ ComExtensionData* ComExtensionData::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -58,7 +58,7 @@ ComExtensionData* ComExtensionData::create() bool ComExtensionData::init() { _timelineData = cocostudio::timeline::ActionTimelineData::create(0); - AX_SAFE_RETAIN(_timelineData); + CC_SAFE_RETAIN(_timelineData); return true; } diff --git a/extensions/cocostudio/CCComRender.cpp b/extensions/cocostudio/CCComRender.cpp index da42f5422c..28876357a8 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() { - AX_SAFE_RELEASE_NULL(_render); + CC_SAFE_RELEASE_NULL(_render); } void ComRender::onEnter() @@ -116,7 +116,7 @@ bool ComRender::serialize(void* r) bool ret = false; do { - AX_BREAK_IF(r == nullptr); + CC_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"); - AX_BREAK_IF(className == nullptr); + CC_BREAK_IF(className == nullptr); comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value& fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); - AX_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); file = DICTOOL->getStringValue_json(fileData, "path"); plist = DICTOOL->getStringValue_json(fileData, "plistFile"); - AX_BREAK_IF(file == nullptr && plist == nullptr); + CC_BREAK_IF(file == nullptr && plist == nullptr); resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); } else if (cocoNode != nullptr) { className = cocoNode[1].GetValue(cocoLoader); - AX_BREAK_IF(className == nullptr); + CC_BREAK_IF(className == nullptr); comName = cocoNode[2].GetValue(cocoLoader); stExpCocoNode* pfileData = cocoNode[4].GetChildArray(cocoLoader); - AX_BREAK_IF(!pfileData); + CC_BREAK_IF(!pfileData); file = pfileData[0].GetValue(cocoLoader); plist = pfileData[1].GetValue(cocoLoader); - AX_BREAK_IF(file == nullptr && plist == nullptr); + CC_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(); - AX_BREAK_IF(fileData.isNull()); + CC_BREAK_IF(fileData.isNull()); CocoLoader tCocoLoader; if (tCocoLoader.ReadCocoBinBuff((char*)fileDataBytes)) { @@ -321,7 +321,7 @@ bool ComRender::serialize(void* r) } else { - AX_BREAK_IF(true); + CC_BREAK_IF(true); } } else if (resType == 1) @@ -343,12 +343,12 @@ bool ComRender::serialize(void* r) } else { - AX_BREAK_IF(true); + CC_BREAK_IF(true); } } else { - AX_BREAK_IF(true); + CC_BREAK_IF(true); } } while (0); @@ -364,7 +364,7 @@ ComRender* ComRender::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -378,7 +378,7 @@ ComRender* ComRender::create(axis::Node* node, const char* comName) } else { - AX_SAFE_DELETE(ret); + CC_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()); - AX_BREAK_IF(doc.HasParseError()); + CC_BREAK_IF(doc.HasParseError()); ret = true; } while (0); return ret; diff --git a/extensions/cocostudio/CCComRender.h b/extensions/cocostudio/CCComRender.h index 4b1262e18a..226bb2cec1 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 __AX_EXTENTIONS_CCCOMRENDER_H__ -#define __AX_EXTENTIONS_CCCOMRENDER_H__ +#ifndef __CC_EXTENTIONS_CCCOMRENDER_H__ +#define __CC_EXTENTIONS_CCCOMRENDER_H__ #include "CCComBase.h" #include "2d/CCComponent.h" @@ -83,4 +83,4 @@ private: }; } // namespace cocostudio -#endif // __AX_EXTENTIONS_CCCOMRENDER_H__ +#endif // __CC_EXTENTIONS_CCCOMRENDER_H__ diff --git a/extensions/cocostudio/CCDataReaderHelper.cpp b/extensions/cocostudio/CCDataReaderHelper.cpp index 7448e66940..606d08cc8d 100644 --- a/extensions/cocostudio/CCDataReaderHelper.cpp +++ b/extensions/cocostudio/CCDataReaderHelper.cpp @@ -240,7 +240,7 @@ float DataReaderHelper::getPositionReadScale() void DataReaderHelper::purge() { _configFileList.clear(); - AX_SAFE_RELEASE_NULL(_dataReaderHelper); + CC_SAFE_RELEASE_NULL(_dataReaderHelper); } DataReaderHelper::DataReaderHelper() @@ -260,7 +260,7 @@ DataReaderHelper::~DataReaderHelper() if (_loadingThread) _loadingThread->join(); - AX_SAFE_DELETE(_loadingThread); + CC_SAFE_DELETE(_loadingThread); _dataReaderHelper = nullptr; } @@ -367,7 +367,7 @@ void DataReaderHelper::addDataFromFileAsync(std::string_view imagePath, if (0 == _asyncRefCount) { - Director::getInstance()->getScheduler()->schedule(AX_SCHEDULE_SELECTOR(DataReaderHelper::addDataAsyncCallBack), + Director::getInstance()->getScheduler()->schedule(CC_SCHEDULE_SELECTOR(DataReaderHelper::addDataAsyncCallBack), this, 0, false); } @@ -477,7 +477,7 @@ void DataReaderHelper::addDataAsyncCallBack(float /*dt*/) { _asyncRefTotalCount = 0; Director::getInstance()->getScheduler()->unschedule( - AX_SCHEDULE_SELECTOR(DataReaderHelper::addDataAsyncCallBack), this); + CC_SCHEDULE_SELECTOR(DataReaderHelper::addDataAsyncCallBack), this); } } } @@ -928,7 +928,7 @@ FrameData* DataReaderHelper::decodeFrame(pugi::xml_node& frameXML, } } - auto degrees2radius = [](float v) { return AX_DEGREES_TO_RADIANS(v); }; + auto degrees2radius = [](float v) { return CC_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 = AX_BLEND_SRC; - frameData->blendFunc.dst = AX_BLEND_DST; + frameData->blendFunc.src = CC_BLEND_SRC; + frameData->blendFunc.dst = CC_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 = AX_DEGREES_TO_RADIANS(helpNode.skewX); - helpNode.skewY = AX_DEGREES_TO_RADIANS(-helpNode.skewY); + helpNode.skewX = CC_DEGREES_TO_RADIANS(helpNode.skewX); + helpNode.skewY = CC_DEGREES_TO_RADIANS(-helpNode.skewY); TransformHelp::transformFromParent(*frameData, helpNode); } diff --git a/extensions/cocostudio/CCDataReaderHelper.h b/extensions/cocostudio/CCDataReaderHelper.h index 0b089667d6..f362b87841 100644 --- a/extensions/cocostudio/CCDataReaderHelper.h +++ b/extensions/cocostudio/CCDataReaderHelper.h @@ -87,7 +87,7 @@ protected: public: /** @deprecated Use getInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static DataReaderHelper* sharedDataReaderHelper() + CC_DEPRECATED_ATTRIBUTE static DataReaderHelper* sharedDataReaderHelper() { return DataReaderHelper::getInstance(); } diff --git a/extensions/cocostudio/CCDatas.cpp b/extensions/cocostudio/CCDatas.cpp index 97087bb48d..bd57787988 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)AX_DOUBLE_PI; + skewX -= (float)CC_DOUBLE_PI; } if (skewX < -M_PI) { - skewX += (float)AX_DOUBLE_PI; + skewX += (float)CC_DOUBLE_PI; } if (skewY > M_PI) { - skewY -= (float)AX_DOUBLE_PI; + skewY -= (float)CC_DOUBLE_PI; } if (skewY < -M_PI) { - skewY += (float)AX_DOUBLE_PI; + skewY += (float)CC_DOUBLE_PI; } } @@ -241,7 +241,7 @@ FrameData::FrameData(void) FrameData::~FrameData(void) { - AX_SAFE_DELETE(easingParams); + CC_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; - AX_SAFE_DELETE(easingParams); + CC_SAFE_DELETE(easingParams); if (easingParamNumber != 0) { easingParams = new float[easingParamNumber]; diff --git a/extensions/cocostudio/CCDatas.h b/extensions/cocostudio/CCDatas.h index fa6e204d7f..a43fa0dc8b 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 AX_CREATE_NO_PARAM_NO_INIT(varType) \ +#define CC_CREATE_NO_PARAM_NO_INIT(varType) \ public: \ static inline varType* create(void) \ { \ @@ -44,7 +44,7 @@ public: \ return var; \ } -#define AX_CREATE_NO_PARAM(varType) \ +#define CC_CREATE_NO_PARAM(varType) \ public: \ static inline varType* create(void) \ { \ @@ -54,7 +54,7 @@ public: \ var->autorelease(); \ return var; \ } \ - AX_SAFE_DELETE(var); \ + CC_SAFE_DELETE(var); \ return nullptr; \ } @@ -69,7 +69,7 @@ namespace cocostudio class CCS_DLL BaseData : public axis::Ref { public: - AX_CREATE_NO_PARAM_NO_INIT(BaseData) + CC_CREATE_NO_PARAM_NO_INIT(BaseData) public: /** * @js ctor @@ -138,7 +138,7 @@ enum DisplayType class CCS_DLL DisplayData : public axis::Ref { public: - AX_CREATE_NO_PARAM_NO_INIT(DisplayData) + CC_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: - AX_CREATE_NO_PARAM_NO_INIT(SpriteDisplayData) + CC_CREATE_NO_PARAM_NO_INIT(SpriteDisplayData) public: /** * @js ctor @@ -191,7 +191,7 @@ public: class CCS_DLL ArmatureDisplayData : public DisplayData { public: - AX_CREATE_NO_PARAM_NO_INIT(ArmatureDisplayData) + CC_CREATE_NO_PARAM_NO_INIT(ArmatureDisplayData) public: /** * @js ctor @@ -211,7 +211,7 @@ public: class CCS_DLL ParticleDisplayData : public DisplayData { public: - AX_CREATE_NO_PARAM_NO_INIT(ParticleDisplayData) + CC_CREATE_NO_PARAM_NO_INIT(ParticleDisplayData) public: /** * @js ctor @@ -234,7 +234,7 @@ public: class CCS_DLL BoneData : public BaseData { public: - AX_CREATE_NO_PARAM(BoneData) + CC_CREATE_NO_PARAM(BoneData) public: /** * @js ctor @@ -268,7 +268,7 @@ public: class CCS_DLL ArmatureData : public axis::Ref { public: - AX_CREATE_NO_PARAM(ArmatureData) + CC_CREATE_NO_PARAM(ArmatureData) public: /** * @js ctor @@ -315,7 +315,7 @@ enum BlendType class CCS_DLL FrameData : public BaseData { public: - AX_CREATE_NO_PARAM_NO_INIT(FrameData) + CC_CREATE_NO_PARAM_NO_INIT(FrameData) public: /** * @js ctor @@ -363,7 +363,7 @@ public: class CCS_DLL MovementBoneData : public axis::Ref { public: - AX_CREATE_NO_PARAM(MovementBoneData) + CC_CREATE_NO_PARAM(MovementBoneData) public: /** * @js ctor @@ -396,7 +396,7 @@ public: class CCS_DLL MovementData : public axis::Ref { public: - AX_CREATE_NO_PARAM_NO_INIT(MovementData) + CC_CREATE_NO_PARAM_NO_INIT(MovementData) public: /** * @js ctor @@ -459,7 +459,7 @@ public: class CCS_DLL AnimationData : public axis::Ref { public: - AX_CREATE_NO_PARAM_NO_INIT(AnimationData) + CC_CREATE_NO_PARAM_NO_INIT(AnimationData) public: /** * @js ctor @@ -489,7 +489,7 @@ public: class CCS_DLL ContourData : public axis::Ref { public: - AX_CREATE_NO_PARAM(ContourData) + CC_CREATE_NO_PARAM(ContourData) public: /** * @js ctor @@ -516,7 +516,7 @@ public: class CCS_DLL TextureData : public axis::Ref { public: - AX_CREATE_NO_PARAM(TextureData) + CC_CREATE_NO_PARAM(TextureData) public: /** * @js ctor diff --git a/extensions/cocostudio/CCDecorativeDisplay.cpp b/extensions/cocostudio/CCDecorativeDisplay.cpp index 2d38e3923d..7b4d3599c4 100644 --- a/extensions/cocostudio/CCDecorativeDisplay.cpp +++ b/extensions/cocostudio/CCDecorativeDisplay.cpp @@ -38,7 +38,7 @@ DecorativeDisplay* DecorativeDisplay::create() pDisplay->autorelease(); return pDisplay; } - AX_SAFE_DELETE(pDisplay); + CC_SAFE_DELETE(pDisplay); return nullptr; } @@ -52,11 +52,11 @@ DecorativeDisplay::DecorativeDisplay() : _display(nullptr), _displayData(nullptr DecorativeDisplay::~DecorativeDisplay(void) { - AX_SAFE_RELEASE_NULL(_displayData); - AX_SAFE_RELEASE_NULL(_display); + CC_SAFE_RELEASE_NULL(_displayData); + CC_SAFE_RELEASE_NULL(_display); #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT || ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX - AX_SAFE_RELEASE_NULL(_colliderDetector); + CC_SAFE_RELEASE_NULL(_colliderDetector); #endif } @@ -69,8 +69,8 @@ void DecorativeDisplay::setDisplay(axis::Node* display) { if (_display != display) { - AX_SAFE_RETAIN(display); - AX_SAFE_RELEASE(_display); + CC_SAFE_RETAIN(display); + CC_SAFE_RELEASE(_display); _display = display; } } diff --git a/extensions/cocostudio/CCDecorativeDisplay.h b/extensions/cocostudio/CCDecorativeDisplay.h index 6b98fbfb1e..076201788f 100644 --- a/extensions/cocostudio/CCDecorativeDisplay.h +++ b/extensions/cocostudio/CCDecorativeDisplay.h @@ -62,8 +62,8 @@ public: { if (_displayData != data) { - AX_SAFE_RETAIN(data); - AX_SAFE_RELEASE(_displayData); + CC_SAFE_RETAIN(data); + CC_SAFE_RELEASE(_displayData); _displayData = data; } } @@ -74,8 +74,8 @@ public: { if (_colliderDetector != detector) { - AX_SAFE_RETAIN(detector); - AX_SAFE_RELEASE(_colliderDetector); + CC_SAFE_RETAIN(detector); + CC_SAFE_RELEASE(_colliderDetector); _colliderDetector = detector; } } diff --git a/extensions/cocostudio/CCDisplayFactory.cpp b/extensions/cocostudio/CCDisplayFactory.cpp index 0b240312a3..5a3f884091 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 - AX_BREAK_IF(!detector->getBody()); + CC_BREAK_IF(!detector->getBody()); # endif Mat4 displayTransform = display->getNodeToParentTransform(); diff --git a/extensions/cocostudio/CCDisplayManager.cpp b/extensions/cocostudio/CCDisplayManager.cpp index dba1f5e1ae..1210d7e881 100644 --- a/extensions/cocostudio/CCDisplayManager.cpp +++ b/extensions/cocostudio/CCDisplayManager.cpp @@ -42,7 +42,7 @@ DisplayManager* DisplayManager::create(Bone* bone) pDisplayManager->autorelease(); return pDisplayManager; } - AX_SAFE_DELETE(pDisplayManager); + CC_SAFE_DELETE(pDisplayManager); return nullptr; } @@ -64,7 +64,7 @@ DisplayManager::~DisplayManager() { _displayRenderNode->removeFromParentAndCleanup(true); if (_displayRenderNode->getReferenceCount() > 0) - AX_SAFE_RELEASE_NULL(_displayRenderNode); + CC_SAFE_RELEASE_NULL(_displayRenderNode); } } diff --git a/extensions/cocostudio/CCDisplayManager.h b/extensions/cocostudio/CCDisplayManager.h index 9976b48c06..460e8673f2 100644 --- a/extensions/cocostudio/CCDisplayManager.h +++ b/extensions/cocostudio/CCDisplayManager.h @@ -79,8 +79,8 @@ public: /* * @deprecated, please use changeDisplayWithIndex and changeDisplayWithName */ - AX_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); - AX_DEPRECATED_ATTRIBUTE void changeDisplayByName(std::string_view name, bool force); + CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); + CC_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 ffcbb3318a..a44c1695bd 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 = 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); + 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); dispatcher->addEventListenerWithFixedPriority(listener, _touchPriority); _touchListener = listener; @@ -133,10 +133,10 @@ void InputDelegate::setTouchEnabled(bool enabled) auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - 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); + 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); dispatcher->addEventListenerWithFixedPriority(listener, _touchPriority); _touchListener = listener; @@ -206,7 +206,7 @@ void InputDelegate::setAccelerometerEnabled(bool enabled) if (enabled) { - auto listener = EventListenerAcceleration::create(AX_CALLBACK_2(InputDelegate::onAcceleration, this)); + auto listener = EventListenerAcceleration::create(CC_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 = AX_CALLBACK_2(InputDelegate::onKeyPressed, this); - listener->onKeyReleased = AX_CALLBACK_2(InputDelegate::onKeyReleased, this); + listener->onKeyPressed = CC_CALLBACK_2(InputDelegate::onKeyPressed, this); + listener->onKeyReleased = CC_CALLBACK_2(InputDelegate::onKeyReleased, this); dispatcher->addEventListenerWithFixedPriority(listener, -1); _keyboardListener = listener; diff --git a/extensions/cocostudio/CCInputDelegate.h b/extensions/cocostudio/CCInputDelegate.h index f513e3c387..47791301b3 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 __AX_EXTENTIONS_CCINPUTDELEGATE_H__ -#define __AX_EXTENTIONS_CCINPUTDELEGATE_H__ +#ifndef __CC_EXTENTIONS_CCINPUTDELEGATE_H__ +#define __CC_EXTENTIONS_CCINPUTDELEGATE_H__ #include "platform/CCPlatformMacros.h" #include "base/CCTouch.h" @@ -68,40 +68,40 @@ public: /** * @js NA */ - AX_DEPRECATED_ATTRIBUTE virtual void didAccelerate(axis::Acceleration* accelerationValue) final; + CC_DEPRECATED_ATTRIBUTE virtual void didAccelerate(axis::Acceleration* accelerationValue) final; // Deprecated touch callbacks. /** * @js NA */ - AX_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(axis::Touch* touch, axis::Event* event) final; + CC_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(axis::Touch* touch, axis::Event* event) final; /** * @js NA */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(axis::Touch* touch, axis::Event* event) final; + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(axis::Touch* touch, axis::Event* event) final; /** * @js NA */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(axis::Touch* touch, axis::Event* event) final; + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(axis::Touch* touch, axis::Event* event) final; /** * @js NA */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(axis::Touch* touch, axis::Event* event) final; + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(axis::Touch* touch, axis::Event* event) final; /** * @js NA */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(axis::__Set* touches, axis::Event* event) final; + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(axis::__Set* touches, axis::Event* event) final; /** * @js NA */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(axis::__Set* touches, axis::Event* event) final; + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(axis::__Set* touches, axis::Event* event) final; /** * @js NA */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(axis::__Set* touches, axis::Event* event) final; + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(axis::__Set* touches, axis::Event* event) final; /** * @js NA */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(axis::__Set* touches, axis::Event* event) final; + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(axis::__Set* touches, axis::Event* event) final; /** * @js NA */ @@ -162,4 +162,4 @@ private: } // namespace cocostudio -#endif // __AX_EXTENTIONS_CCINPUTDELEGATE_H__ +#endif // __CC_EXTENTIONS_CCINPUTDELEGATE_H__ diff --git a/extensions/cocostudio/CCSGUIReader.cpp b/extensions/cocostudio/CCSGUIReader.cpp index 5116760b74..08430ae749 100644 --- a/extensions/cocostudio/CCSGUIReader.cpp +++ b/extensions/cocostudio/CCSGUIReader.cpp @@ -102,7 +102,7 @@ GUIReader* GUIReader::getInstance() void GUIReader::destroyInstance() { - AX_SAFE_DELETE(sharedReader); + CC_SAFE_DELETE(sharedReader); } int GUIReader::getVersionInteger(const char* str) @@ -239,7 +239,7 @@ Widget* GUIReader::widgetFromJsonFile(const char* fileName) widget = pReader->createWidget(jsonDict, this->m_strFilePath.c_str(), fileName); } - AX_SAFE_DELETE(pReader); + CC_SAFE_DELETE(pReader); return widget; } @@ -420,7 +420,7 @@ Widget* GUIReader::widgetFromBinaryFile(const char* fileName) widget = pReader->createWidgetFromBinary(&tCocoLoader, tpRootCocoNode, fileName); } - AX_SAFE_DELETE(pReader); + CC_SAFE_DELETE(pReader); } } } @@ -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") / AX_CONTENT_SCALE_FACTOR(), - DICTOOL->getIntValue_json(options, "itemHeight") / AX_CONTENT_SCALE_FACTOR(), + DICTOOL->getIntValue_json(options, "itemWidth") / CC_CONTENT_SCALE_FACTOR(), + DICTOOL->getIntValue_json(options, "itemHeight") / CC_CONTENT_SCALE_FACTOR(), DICTOOL->getStringValue_json(options, "startCharMap")); } setColorPropsForWidgetFromJsonDictionary(widget, options); diff --git a/extensions/cocostudio/CCSGUIReader.h b/extensions/cocostudio/CCSGUIReader.h index 5ab79b61f7..aa2d9a80e8 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: - AX_DEPRECATED_ATTRIBUTE static GUIReader* shareReader() { return GUIReader::getInstance(); }; - AX_DEPRECATED_ATTRIBUTE static void purgeGUIReader() { GUIReader::destroyInstance(); }; + CC_DEPRECATED_ATTRIBUTE static GUIReader* shareReader() { return GUIReader::getInstance(); }; + CC_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 9a1a322a58..2b9dbf559b 100644 --- a/extensions/cocostudio/CCSSceneReader.cpp +++ b/extensions/cocostudio/CCSSceneReader.cpp @@ -63,7 +63,7 @@ axis::Node* SceneReader::createNodeWithSceneFile( rapidjson::Document jsonDict; do { - AX_BREAK_IF(!readJson(fileName, jsonDict)); + CC_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(); - AX_BREAK_IF(fileData.isNull()); + CC_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); - AX_BREAK_IF(tpRootCocoNode->GetChildNum() == 0); + CC_BREAK_IF(tpRootCocoNode->GetChildNum() == 0); _node = Node::create(); int nCount = 0; std::vector _vecComs; @@ -131,7 +131,7 @@ axis::Node* SceneReader::createNodeWithSceneFile( } else { - AX_SAFE_RELEASE_NULL(pCom); + CC_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()); - AX_BREAK_IF(doc.HasParseError()); + CC_BREAK_IF(doc.HasParseError()); ret = true; } while (0); return ret; @@ -292,7 +292,7 @@ Node* SceneReader::createObject(const rapidjson::Value& dict, } } } - AX_SAFE_DELETE(data); + CC_SAFE_DELETE(data); if (_fnSelector != nullptr) { _fnSelector(com, data); @@ -406,7 +406,7 @@ axis::Node* SceneReader::createObject(CocoLoader* cocoLoader, } else { - AX_SAFE_RELEASE_NULL(pCom); + CC_SAFE_RELEASE_NULL(pCom); } } if (_fnSelector != nullptr) @@ -414,7 +414,7 @@ axis::Node* SceneReader::createObject(CocoLoader* cocoLoader, _fnSelector(pCom, (void*)(data)); } } - AX_SAFE_DELETE(data); + CC_SAFE_DELETE(data); if (parent != nullptr) { @@ -431,7 +431,7 @@ axis::Node* SceneReader::createObject(CocoLoader* cocoLoader, gb = pRender->getNode(); gb->retain(); pRender->setNode(nullptr); - AX_SAFE_RELEASE_NULL(pRender); + CC_SAFE_RELEASE_NULL(pRender); } parent->addChild(gb); } @@ -562,7 +562,7 @@ void SceneReader::destroyInstance() DictionaryHelper::destroyInstance(); TriggerMng::destroyInstance(); // CocosDenshion::SimpleAudioEngine::end(); - AX_SAFE_DELETE(s_sharedReader); + CC_SAFE_DELETE(s_sharedReader); } } // namespace cocostudio diff --git a/extensions/cocostudio/CCSkin.cpp b/extensions/cocostudio/CCSkin.cpp index dc6e2c3427..0684ee742b 100644 --- a/extensions/cocostudio/CCSkin.cpp +++ b/extensions/cocostudio/CCSkin.cpp @@ -37,7 +37,7 @@ USING_NS_AX; namespace cocostudio { -#if AX_SPRITEBATCHNODE_RENDER_SUBPIXEL +#if CC_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; } - AX_SAFE_DELETE(skin); + CC_SAFE_DELETE(skin); return nullptr; } @@ -63,7 +63,7 @@ Skin* Skin::createWithSpriteFrameName(std::string_view pszSpriteFrameName) skin->autorelease(); return skin; } - AX_SAFE_DELETE(skin); + CC_SAFE_DELETE(skin); return nullptr; } @@ -75,7 +75,7 @@ Skin* Skin::create(std::string_view pszFileName) skin->autorelease(); return skin; } - AX_SAFE_DELETE(skin); + CC_SAFE_DELETE(skin); return nullptr; } @@ -118,8 +118,8 @@ void Skin::setSkinData(const BaseData& var) setScaleX(_skinData.scaleX); setScaleY(_skinData.scaleY); - setRotationSkewX(AX_RADIANS_TO_DEGREES(_skinData.skewX)); - setRotationSkewY(AX_RADIANS_TO_DEGREES(-_skinData.skewY)); + setRotationSkewX(CC_RADIANS_TO_DEGREES(_skinData.skewX)); + setRotationSkewY(CC_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 3706bf0662..b6d58592a5 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); - AX_SAFE_RETAIN(spriteFrame); + CC_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()) { - AX_SAFE_RELEASE(*itFrame); + CC_SAFE_RELEASE(*itFrame); ++itFrame; } vec.clear(); diff --git a/extensions/cocostudio/CCSpriteFrameCacheHelper.h b/extensions/cocostudio/CCSpriteFrameCacheHelper.h index d744e5e46b..889bb43508 100644 --- a/extensions/cocostudio/CCSpriteFrameCacheHelper.h +++ b/extensions/cocostudio/CCSpriteFrameCacheHelper.h @@ -46,7 +46,7 @@ class CCS_DLL SpriteFrameCacheHelper { public: /** @deprecated Use getInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static SpriteFrameCacheHelper* sharedSpriteFrameCacheHelper() + CC_DEPRECATED_ATTRIBUTE static SpriteFrameCacheHelper* sharedSpriteFrameCacheHelper() { return SpriteFrameCacheHelper::getInstance(); } diff --git a/extensions/cocostudio/CCTween.cpp b/extensions/cocostudio/CCTween.cpp index 1f60fd8180..bb363df941 100644 --- a/extensions/cocostudio/CCTween.cpp +++ b/extensions/cocostudio/CCTween.cpp @@ -41,7 +41,7 @@ Tween* Tween::create(Bone* bone) pTween->autorelease(); return pTween; } - AX_SAFE_DELETE(pTween); + CC_SAFE_DELETE(pTween); return nullptr; } @@ -62,8 +62,8 @@ Tween::Tween() Tween::~Tween(void) { - AX_SAFE_DELETE(_from); - AX_SAFE_DELETE(_between); + CC_SAFE_DELETE(_from); + CC_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 * AX_HALF_PI); + _currentPercent = sin(_currentPercent * CC_HALF_PI); } float percent = _currentPercent; diff --git a/extensions/cocostudio/CocosStudioExport.h b/extensions/cocostudio/CocosStudioExport.h index 7f88c5b847..c5612b730e 100644 --- a/extensions/cocostudio/CocosStudioExport.h +++ b/extensions/cocostudio/CocosStudioExport.h @@ -7,7 +7,7 @@ # include # endif -# if defined(AX_STATIC) +# if defined(CC_STATIC) # define CCS_DLL # else # if defined(_USRCCS_DLL) diff --git a/extensions/cocostudio/DictionaryHelper.cpp b/extensions/cocostudio/DictionaryHelper.cpp index 38a3e4d74c..09fccc8624 100644 --- a/extensions/cocostudio/DictionaryHelper.cpp +++ b/extensions/cocostudio/DictionaryHelper.cpp @@ -45,7 +45,7 @@ DictionaryHelper* DictionaryHelper::getInstance() void DictionaryHelper::destroyInstance() { - AX_SAFE_DELETE(sharedHelper); + CC_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 { - AX_BREAK_IF(root.IsNull()); - AX_BREAK_IF(!root.HasMember(key)); - AX_BREAK_IF(root[key].IsNull()); + CC_BREAK_IF(root.IsNull()); + CC_BREAK_IF(!root.HasMember(key)); + CC_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 { - AX_BREAK_IF(root.IsNull()); - AX_BREAK_IF(!root.HasMember(key)); - AX_BREAK_IF(root[key].IsNull()); + CC_BREAK_IF(root.IsNull()); + CC_BREAK_IF(!root.HasMember(key)); + CC_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 { - AX_BREAK_IF(root.IsNull()); - AX_BREAK_IF(!root.HasMember(key)); - AX_BREAK_IF(root[key].IsNull()); + CC_BREAK_IF(root.IsNull()); + CC_BREAK_IF(!root.HasMember(key)); + CC_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 { - AX_BREAK_IF(root.IsNull()); - AX_BREAK_IF(!root.HasMember(key)); - AX_BREAK_IF(root[key].IsNull()); + CC_BREAK_IF(root.IsNull()); + CC_BREAK_IF(!root.HasMember(key)); + CC_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 { - AX_BREAK_IF(root.IsNull()); - AX_BREAK_IF(!root.HasMember(key)); - AX_BREAK_IF(root[key].IsNull()); + CC_BREAK_IF(root.IsNull()); + CC_BREAK_IF(!root.HasMember(key)); + CC_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 { - AX_BREAK_IF(root.IsNull()); - AX_BREAK_IF(!root.HasMember(arrayKey)); - AX_BREAK_IF(root[arrayKey].IsNull()); - AX_BREAK_IF(root[arrayKey][idx].IsNull()); + CC_BREAK_IF(root.IsNull()); + CC_BREAK_IF(!root.HasMember(arrayKey)); + CC_BREAK_IF(root[arrayKey].IsNull()); + CC_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 { - AX_BREAK_IF(root.IsNull()); - AX_BREAK_IF(root[arrayKey].IsNull()); - AX_BREAK_IF(root[arrayKey][idx].IsNull()); + CC_BREAK_IF(root.IsNull()); + CC_BREAK_IF(root[arrayKey].IsNull()); + CC_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 { - AX_BREAK_IF(root.IsNull()); - AX_BREAK_IF(root[arrayKey].IsNull()); - AX_BREAK_IF(root[arrayKey][idx].IsNull()); + CC_BREAK_IF(root.IsNull()); + CC_BREAK_IF(root[arrayKey].IsNull()); + CC_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 { - AX_BREAK_IF(root.IsNull()); - AX_BREAK_IF(root[arrayKey].IsNull()); - AX_BREAK_IF(root[arrayKey][idx].IsNull()); + CC_BREAK_IF(root.IsNull()); + CC_BREAK_IF(root[arrayKey].IsNull()); + CC_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 { - AX_BREAK_IF(root.IsNull()); + CC_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 { - AX_BREAK_IF(root.IsNull()); + CC_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 { - AX_BREAK_IF(root.IsNull()); - AX_BREAK_IF(!root.IsArray()); - AX_BREAK_IF(index < 0 || root.Size() <= (unsigned int)index); + CC_BREAK_IF(root.IsNull()); + CC_BREAK_IF(!root.IsArray()); + CC_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 d091de9614..0e16ceacda 100644 --- a/extensions/cocostudio/FlatBuffersSerialize.cpp +++ b/extensions/cocostudio/FlatBuffersSerialize.cpp @@ -124,12 +124,12 @@ FlatBuffersSerialize* FlatBuffersSerialize::getInstance() void FlatBuffersSerialize::purge() { - AX_SAFE_DELETE(_instanceFlatBuffersSerialize); + CC_SAFE_DELETE(_instanceFlatBuffersSerialize); } void FlatBuffersSerialize::destroyInstance() { - AX_SAFE_DELETE(_instanceFlatBuffersSerialize); + CC_SAFE_DELETE(_instanceFlatBuffersSerialize); } void FlatBuffersSerialize::deleteFlatBufferBuilder() @@ -137,7 +137,7 @@ void FlatBuffersSerialize::deleteFlatBufferBuilder() if (_builder != nullptr) { _builder->Clear(); - AX_SAFE_DELETE(_builder); + CC_SAFE_DELETE(_builder); } } diff --git a/extensions/cocostudio/FlatBuffersSerialize.h b/extensions/cocostudio/FlatBuffersSerialize.h index 0e3bc9e6a4..fca7ced434 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); FlatBuffersSerialize(); diff --git a/extensions/cocostudio/LocalizationManager.cpp b/extensions/cocostudio/LocalizationManager.cpp index c0ab1f66b8..7352bf60ce 100644 --- a/extensions/cocostudio/LocalizationManager.cpp +++ b/extensions/cocostudio/LocalizationManager.cpp @@ -31,7 +31,7 @@ JsonLocalizationManager::JsonLocalizationManager() : languageData(nullptr) {} JsonLocalizationManager::~JsonLocalizationManager() { - AX_SAFE_DELETE(languageData); + CC_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 - AX_SAFE_DELETE(languageData); + CC_SAFE_DELETE(languageData); } return result; diff --git a/extensions/cocostudio/SpineSkeletonDataCache.cpp b/extensions/cocostudio/SpineSkeletonDataCache.cpp index 7285a8e49f..029c1f0718 100644 --- a/extensions/cocostudio/SpineSkeletonDataCache.cpp +++ b/extensions/cocostudio/SpineSkeletonDataCache.cpp @@ -1,6 +1,6 @@ #include "SpineSkeletonDataCache.h" -#if !defined(AX_USE_SPINE_CPP) || AX_USE_SPINE_CPP +#if !defined(CC_USE_SPINE_CPP) || CC_USE_SPINE_CPP SpineSkeletonDataCache* SpineSkeletonDataCache::getInstance() { static SpineSkeletonDataCache internalShared; diff --git a/extensions/cocostudio/SpineSkeletonDataCache.h b/extensions/cocostudio/SpineSkeletonDataCache.h index a5ea3e08ae..6557a4fca4 100644 --- a/extensions/cocostudio/SpineSkeletonDataCache.h +++ b/extensions/cocostudio/SpineSkeletonDataCache.h @@ -6,7 +6,7 @@ #include "CocosStudioExport.h" #include -#if !defined(AX_USE_SPINE_CPP) || AX_USE_SPINE_CPP +#if !defined(CC_USE_SPINE_CPP) || CC_USE_SPINE_CPP class CCS_DLL SpineSkeletonDataCache { public: diff --git a/extensions/cocostudio/TriggerMng.cpp b/extensions/cocostudio/TriggerMng.cpp index 07034fd863..99a4cf0d84 100644 --- a/extensions/cocostudio/TriggerMng.cpp +++ b/extensions/cocostudio/TriggerMng.cpp @@ -49,9 +49,9 @@ TriggerMng::~TriggerMng(void) _triggerObjs.clear(); removeAllArmatureMovementCallBack(); - AX_SAFE_DELETE(_movementDispatches); + CC_SAFE_DELETE(_movementDispatches); - AX_SAFE_RELEASE(_eventDispatcher); + CC_SAFE_RELEASE(_eventDispatcher); } const char* TriggerMng::triggerMngVersion() @@ -70,7 +70,7 @@ TriggerMng* TriggerMng::getInstance() void TriggerMng::destroyInstance() { - AX_SAFE_DELETE(_sharedTriggerMng); + CC_SAFE_DELETE(_sharedTriggerMng); } void TriggerMng::parse(const rapidjson::Value& root) @@ -78,7 +78,7 @@ void TriggerMng::parse(const rapidjson::Value& root) CCLOG("%s", triggerMngVersion()); int count = DICTOOL->getArrayCount_json(root, "Triggers"); -#if AX_ENABLE_SCRIPT_BINDING +#if CC_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 AX_ENABLE_SCRIPT_BINDING +#endif // #if CC_ENABLE_SCRIPT_BINDING { for (int i = 0; i < count; ++i) { @@ -115,7 +115,7 @@ void TriggerMng::parse(cocostudio::CocoLoader* pCocoLoader, cocostudio::stExpCoc int count = pCocoNode[13].GetChildNum(); stExpCocoNode* pTriggersArray = pCocoNode[13].GetChildArray(pCocoLoader); -#if AX_ENABLE_SCRIPT_BINDING +#if CC_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 AX_ENABLE_SCRIPT_BINDING +#endif // #if CC_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(); - AX_SAFE_DELETE(etIter->second); + CC_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(AX_CALLBACK_0(ArmatureMovementDispatcher::animationEvent, amd, + pAr->getAnimation()->setMovementEventCallFunc(CC_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 { - AX_SAFE_DELETE(iter->second); + CC_SAFE_DELETE(iter->second); _movementDispatches->erase(iter); } } @@ -500,7 +500,7 @@ ArmatureMovementDispatcher::ArmatureMovementDispatcher(void) : _mapEventAnimatio ArmatureMovementDispatcher::~ArmatureMovementDispatcher(void) { _mapEventAnimation->clear(); - AX_SAFE_DELETE(_mapEventAnimation); + CC_SAFE_DELETE(_mapEventAnimation); } void ArmatureMovementDispatcher::animationEvent(Armature* armature, diff --git a/extensions/cocostudio/TriggerObj.cpp b/extensions/cocostudio/TriggerObj.cpp index 06f2026f62..f67c5d9ca8 100644 --- a/extensions/cocostudio/TriggerObj.cpp +++ b/extensions/cocostudio/TriggerObj.cpp @@ -84,7 +84,7 @@ TriggerObj* TriggerObj::create() } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp b/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp index e4de3e220f..88d545de54 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(AX_BUILD_WITH_DRANGBONES) && AX_BUILD_WITH_DRANGBONES +#if defined(CC_BUILD_WITH_DRANGBONES) && CC_BUILD_WITH_DRANGBONES # include "DragonBones/CCDragonBonesHeaders.h" #endif @@ -34,7 +34,7 @@ ArmatureNodeReader* ArmatureNodeReader::getInstance() void ArmatureNodeReader::destroyInstance() { - AX_SAFE_DELETE(_instanceArmatureNodeReader); + CC_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(AX_BUILD_WITH_DRANGBONES) && AX_BUILD_WITH_DRANGBONES +#if defined(CC_BUILD_WITH_DRANGBONES) && CC_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 3abe8079bf..4e767494a8 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 ebe152a284..2a0511eeb8 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() { - AX_SAFE_DELETE(instanceButtonReader); + CC_SAFE_DELETE(instanceButtonReader); } void ButtonReader::destroyInstance() { - AX_SAFE_DELETE(instanceButtonReader); + CC_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 - AX_BASIC_PROPERTY_BINARY_READER + CC_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - AX_COLOR_PROPERTY_BINARY_READER + CC_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 1f27a393a0..c2a0c837b3 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 4258aad24a..64848dbe90 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() { - AX_SAFE_DELETE(instanceCheckBoxReader); + CC_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 - AX_BASIC_PROPERTY_BINARY_READER + CC_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - AX_COLOR_PROPERTY_BINARY_READER + CC_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 59003e2f42..a6a26c3f97 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 ecc98affc6..99e15f2447 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() { - AX_SAFE_DELETE(_instanceComAudioReader); + CC_SAFE_DELETE(_instanceComAudioReader); } void ComAudioReader::destroyInstance() { - AX_SAFE_DELETE(_instanceComAudioReader); + CC_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 336f84a5c9..c480a42c12 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 a7a67e9e82..00ee259ead 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() { - AX_SAFE_DELETE(_instanceTMXTiledMapReader); + CC_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 6e04fc06e3..ac6fd6b602 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 221938102d..64ab0199e4 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() { - AX_SAFE_DELETE(_instanceNode3DReader); + CC_SAFE_DELETE(_instanceNode3DReader); } void GameNode3DReader::destroyInstance() { - AX_SAFE_DELETE(_instanceNode3DReader); + CC_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 4d3938522f..1d5af11bc9 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 d9ad630589..8117f9e1d0 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() { - AX_SAFE_DELETE(instanceImageViewReader); + CC_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 - AX_BASIC_PROPERTY_BINARY_READER + CC_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - AX_COLOR_PROPERTY_BINARY_READER + CC_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 8bfe44fa0b..9b3be9fb5e 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 503afd44bc..6ec925e3ab 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() { - AX_SAFE_DELETE(instanceLayoutReader); + CC_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 - AX_BASIC_PROPERTY_BINARY_READER + CC_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - AX_COLOR_PROPERTY_BINARY_READER + CC_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 ad35162066..1e21e9ce59 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 416140f9ba..3bdabc16a0 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() { - AX_SAFE_DELETE(_instanceLight3DReader); + CC_SAFE_DELETE(_instanceLight3DReader); } void Light3DReader::destroyInstance() { - AX_SAFE_DELETE(_instanceLight3DReader); + CC_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, AX_DEGREES_TO_RADIANS(outerAngle), range); + SpotLight::create(Vec3::UNIT_Z, Vec3::ZERO, Color3B::WHITE, 0, CC_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 2952762268..353edfcb9b 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 842fca5e09..aca256f011 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() { - AX_SAFE_DELETE(instanceListViewReader); + CC_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 ca96b53cd8..f0f795aeda 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 4467b8f5f3..f9fa8c337c 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() { - AX_SAFE_DELETE(instanceLoadingBar); + CC_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 - AX_BASIC_PROPERTY_BINARY_READER + CC_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - AX_COLOR_PROPERTY_BINARY_READER + CC_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 5f18b35cab..05dbe0aa87 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 088ae2717a..83573dae9d 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() { - AX_SAFE_DELETE(_instanceMeshReader); + CC_SAFE_DELETE(_instanceMeshReader); } void MeshReader::destroyInstance() { - AX_SAFE_DELETE(_instanceMeshReader); + CC_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 c9cbff63c6..4d82d3f914 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 1f7c31e3dd..418371a655 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() { - AX_SAFE_DELETE(_instanceNode3DReader); + CC_SAFE_DELETE(_instanceNode3DReader); } void Node3DReader::destroyInstance() { - AX_SAFE_DELETE(_instanceNode3DReader); + CC_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 fc209726f0..1f6d3a34ae 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 7354d479d3..74a15ee41e 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() { - AX_SAFE_DELETE(_instanceNodeReader); + CC_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 17ce65cc25..84dde876ac 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 15a930f316..beaa5723e4 100644 --- a/extensions/cocostudio/WidgetReader/NodeReaderProtocol.h +++ b/extensions/cocostudio/WidgetReader/NodeReaderProtocol.h @@ -134,7 +134,7 @@ namespace wext { // engine extends APIs // TODO-2020 -AX_DLL extern APP_LOGERROR_FUNC getAppErrorLogFunc(); +CC_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 7769e80813..4599666cb7 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() { - AX_SAFE_DELETE(instancePageViewReader); + CC_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 197720147d..c90083508e 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 c880545efb..c1719f34c7 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() { - AX_SAFE_DELETE(_instanceParticle3DReader); + CC_SAFE_DELETE(_instanceParticle3DReader); } void Particle3DReader::destroyInstance() { - AX_SAFE_DELETE(_instanceParticle3DReader); + CC_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 a4cb542a10..555c1f6e45 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 5ac1761483..5c31abfa1b 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() { - AX_SAFE_DELETE(_instanceParticleReader); + CC_SAFE_DELETE(_instanceParticleReader); } void ParticleReader::destroyInstance() { - AX_SAFE_DELETE(_instanceParticleReader); + CC_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 75c9aa47bf..099bbb1c46 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 82b5cbf287..c817d6dc82 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() { - AX_SAFE_DELETE(_instanceProjectNodeReader); + CC_SAFE_DELETE(_instanceProjectNodeReader); } void ProjectNodeReader::destroyInstance() { - AX_SAFE_DELETE(_instanceProjectNodeReader); + CC_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 6b069251de..560385bb38 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 d0cb6f7b7b..a1cb3abac8 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() { - AX_SAFE_DELETE(s_readerInstance); + CC_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 1e5f9927f7..fa232ffff9 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 fca7cc9c45..1181118833 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() { - AX_SAFE_DELETE(instanceCheckBoxReader); + CC_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 d26506f886..1ea45967a5 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 c6f1126f29..b806536752 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() { - AX_SAFE_DELETE(instanceTextBMFontReader); + CC_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 3ab385c202..ef63953e8f 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 ff9eefe75f..c38e50f149 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() { - AX_SAFE_DELETE(instanceScrollViewReader); + CC_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 17a9765978..0e364bbca2 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 f9c1984888..29aad3a48a 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() { - AX_SAFE_DELETE(_instanceSingleNodeReader); + CC_SAFE_DELETE(_instanceSingleNodeReader); } void SingleNodeReader::destroyInstance() { - AX_SAFE_DELETE(_instanceSingleNodeReader); + CC_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 1e9a2249c3..0c3aaf2764 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 c65cd0c588..5a69bf37e8 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() { - AX_SAFE_DELETE(_instanceBoneNodeReader); + CC_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 58900d8c44..c6aa8e1dd6 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 bf2a126890..46138fd143 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() { - AX_SAFE_DELETE(_instanceSkeletonNodeReader); + CC_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 165adf2df9..ced3d5f725 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 62efe0c015..d0e3def5d4 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() { - AX_SAFE_DELETE(instanceSliderReader); + CC_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 - AX_BASIC_PROPERTY_BINARY_READER + CC_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - AX_COLOR_PROPERTY_BINARY_READER + CC_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 6354350bbe..a70ac3fa7e 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 83f8eb9aeb..4349aa3ea9 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(AX_BUILD_WITH_SPINE) +#if defined(CC_BUILD_WITH_SPINE) # include "SpineSkeletonDataCache.h" # include "2d/CCSprite.h" @@ -62,12 +62,12 @@ SpineSkeletonReader* SpineSkeletonReader::getInstance() void SpineSkeletonReader::purge() { - AX_SAFE_DELETE(_instanceSpriteReader); + CC_SAFE_DELETE(_instanceSpriteReader); } void SpineSkeletonReader::destroyInstance() { - AX_SAFE_DELETE(_instanceSpriteReader); + CC_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 6cc84e7db3..9eae4303fa 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(AX_BUILD_WITH_SPINE) +#if defined(CC_BUILD_WITH_SPINE) namespace cocostudio { @@ -43,7 +43,7 @@ public: static SpineSkeletonReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 bd1ab92d27..263bd65142 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() { - AX_SAFE_DELETE(_instanceSpriteReader); + CC_SAFE_DELETE(_instanceSpriteReader); } void SpriteReader::destroyInstance() { - AX_SAFE_DELETE(_instanceSpriteReader); + CC_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 e9b70e9f30..761d284b3b 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 6e4fecd7ed..b5912853d5 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() { - AX_SAFE_DELETE(_tabReaderInstance); + CC_SAFE_DELETE(_tabReaderInstance); } flatbuffers::Offset TabControlReader::createOptionsWithFlatBuffers( @@ -217,7 +217,7 @@ TabHeaderReader* TabHeaderReader::getInstance() void TabHeaderReader::destroyInstance() { - AX_SAFE_DELETE(_tabheaderReaderInstance); + CC_SAFE_DELETE(_tabheaderReaderInstance); } flatbuffers::Offset TabHeaderReader::createOptionsWithFlatBuffers( @@ -900,7 +900,7 @@ TabItemReader* TabItemReader::getInstance() void TabItemReader::destroyInstance() { - AX_SAFE_DELETE(_tabItemReaderInstance); + CC_SAFE_DELETE(_tabItemReaderInstance); } flatbuffers::Offset TabItemReader::createTabItemOptionWithFlatBuffers( diff --git a/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp b/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp index 486b97da70..f9155c9306 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() { - AX_SAFE_DELETE(instanceTextAtlasReader); + CC_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 - AX_BASIC_PROPERTY_BINARY_READER + CC_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - AX_COLOR_PROPERTY_BINARY_READER + CC_COLOR_PROPERTY_BINARY_READER else if (key == P_StringValue) { stringValue = value; } else if (key == P_CharMapFileData) diff --git a/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h b/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h index 2adac40e41..5e00f8edaa 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 1a3632718c..69fdba9c97 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() { - AX_SAFE_DELETE(instanceTextBMFontReader); + CC_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 - AX_BASIC_PROPERTY_BINARY_READER + CC_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - AX_COLOR_PROPERTY_BINARY_READER + CC_COLOR_PROPERTY_BINARY_READER else if (key == P_FileNameData) { diff --git a/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h b/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h index c2901d0d3e..baf112a1e3 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 1eac411b78..adb491cf47 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() { - AX_SAFE_DELETE(instanceTextFieldExReader); + CC_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 dae94a0515..897db93379 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 afdd34405c..e378e7b01a 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() { - AX_SAFE_DELETE(instanceTextFieldReader); + CC_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 - AX_BASIC_PROPERTY_BINARY_READER + CC_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - AX_COLOR_PROPERTY_BINARY_READER + CC_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 00f92933b4..95d4bfa675 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 b78c68bbf5..cd2f194aad 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() { - AX_SAFE_DELETE(instanceTextReader); + CC_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 - AX_BASIC_PROPERTY_BINARY_READER + CC_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - AX_COLOR_PROPERTY_BINARY_READER + CC_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 224a357e17..1fbf26280d 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 e9f586e2a3..6aa9b289d4 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() { - AX_SAFE_DELETE(_instanceUserCameraReader); + CC_SAFE_DELETE(_instanceUserCameraReader); } void UserCameraReader::destroyInstance() { - AX_SAFE_DELETE(_instanceUserCameraReader); + CC_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 bbedaf8fe7..93dd8d11eb 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 6c4dcb0232..52e1175cc9 100644 --- a/extensions/cocostudio/WidgetReader/WidgetReader.cpp +++ b/extensions/cocostudio/WidgetReader/WidgetReader.cpp @@ -128,12 +128,12 @@ WidgetReader* WidgetReader::getInstance() void WidgetReader::purge() { - AX_SAFE_DELETE(instanceWidgetReader); + CC_SAFE_DELETE(instanceWidgetReader); } void WidgetReader::destroyInstance() { - AX_SAFE_DELETE(instanceWidgetReader); + CC_SAFE_DELETE(instanceWidgetReader); } void WidgetReader::setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options) @@ -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); - AX_BASIC_PROPERTY_BINARY_READER + CC_BASIC_PROPERTY_BINARY_READER } this->endSetBasicProperties(widget); diff --git a/extensions/cocostudio/WidgetReader/WidgetReader.h b/extensions/cocostudio/WidgetReader/WidgetReader.h index cd58e0af95..3b7f8dfff9 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 */ - AX_DEPRECATED_ATTRIBUTE static void purge(); + CC_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 AX_BASIC_PROPERTY_BINARY_READER \ +#define CC_BASIC_PROPERTY_BINARY_READER \ if (key == P_IgnoreSize) \ { \ widget->ignoreContentAdaptWithSize(valueToBool(value)); \ @@ -287,7 +287,7 @@ extern const char* P_Path; } \ } -#define AX_COLOR_PROPERTY_BINARY_READER \ +#define CC_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/DragDropManager.cpp b/extensions/fairygui/DragDropManager.cpp index 2cdd7ef5fc..ff27bdcef4 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, AX_CALLBACK_1(DragDropManager::onDragEnd, this)); + _agent->addEventListener(UIEventType::DragEnd, CC_CALLBACK_1(DragDropManager::onDragEnd, this)); } DragDropManager::~DragDropManager() { - AX_SAFE_RELEASE(_agent); + CC_SAFE_RELEASE(_agent); } DragDropManager* DragDropManager::getInstance() diff --git a/extensions/fairygui/FairyGUIMacros.h b/extensions/fairygui/FairyGUIMacros.h index b244d2b6da..6168ede2eb 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(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this);\ + axis::Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this);\ __FUNC__(); \ }\ void __FUNC__() #define CALL_LATER(__TYPE__,__FUNC__,...) \ -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) +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) #define CALL_LATER_CANCEL(__TYPE__,__FUNC__) \ -axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this) +axis::Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this) #define CALL_PER_FRAME(__TYPE__,__FUNC__) \ -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) +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) #define CALL_PER_FRAME_CANCEL(__TYPE__,__FUNC__) \ -axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this) +axis::Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this) #define UIRoot GRoot::getInstance() diff --git a/extensions/fairygui/GButton.cpp b/extensions/fairygui/GButton.cpp index 55966f41bb..ac332beceb 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, 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)); + 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)); } void GButton::setup_afterAdd(ByteBuffer* buffer, int beginPos) diff --git a/extensions/fairygui/GComboBox.cpp b/extensions/fairygui/GComboBox.cpp index 154733093f..3898a4080a 100644 --- a/extensions/fairygui/GComboBox.cpp +++ b/extensions/fairygui/GComboBox.cpp @@ -28,7 +28,7 @@ GComboBox::GComboBox() GComboBox::~GComboBox() { - AX_SAFE_RELEASE(_dropdown); + CC_SAFE_RELEASE(_dropdown); } const std::string& GComboBox::getTitle() const @@ -314,7 +314,7 @@ void GComboBox::constructExtension(ByteBuffer* buffer) _list = dynamic_cast(_dropdown->getChild("list")); CCASSERT(_list != nullptr, "FairyGUI: should container a list component named list."); - _list->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(GComboBox::onClickItem, this)); + _list->addEventListener(UIEventType::ClickItem, CC_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, AX_CALLBACK_1(GComboBox::onPopupWinClosed, this)); + _dropdown->addEventListener(UIEventType::Exit, CC_CALLBACK_1(GComboBox::onPopupWinClosed, 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)); + 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)); } void GComboBox::setup_afterAdd(ByteBuffer* buffer, int beginPos) diff --git a/extensions/fairygui/GComponent.cpp b/extensions/fairygui/GComponent.cpp index af0bce8028..bbfa0748de 100644 --- a/extensions/fairygui/GComponent.cpp +++ b/extensions/fairygui/GComponent.cpp @@ -36,10 +36,10 @@ GComponent::~GComponent() _children.clear(); _controllers.clear(); _transitions.clear(); - AX_SAFE_RELEASE(_maskOwner); - AX_SAFE_RELEASE(_container); - AX_SAFE_RELEASE(_scrollPane); - AX_SAFE_DELETE(_hitArea); + CC_SAFE_RELEASE(_maskOwner); + CC_SAFE_RELEASE(_container); + CC_SAFE_RELEASE(_scrollPane); + CC_SAFE_DELETE(_hitArea); CALL_LATER_CANCEL(GComponent, doUpdateBounds); CALL_LATER_CANCEL(GComponent, buildNativeDisplayList); } @@ -580,7 +580,7 @@ void GComponent::setHitArea(IHitTest* value) { if (_hitArea != value) { - AX_SAFE_DELETE(_hitArea); + CC_SAFE_DELETE(_hitArea); _hitArea = value; } } diff --git a/extensions/fairygui/GGraph.cpp b/extensions/fairygui/GGraph.cpp index 6dfb917c9c..c0444e0a4f 100644 --- a/extensions/fairygui/GGraph.cpp +++ b/extensions/fairygui/GGraph.cpp @@ -27,9 +27,9 @@ GGraph::GGraph() : _shape(nullptr), GGraph::~GGraph() { - AX_SAFE_DELETE(_cornerRadius); - AX_SAFE_DELETE(_polygonPoints); - AX_SAFE_DELETE(_distances); + CC_SAFE_DELETE(_cornerRadius); + CC_SAFE_DELETE(_polygonPoints); + CC_SAFE_DELETE(_distances); } void GGraph::handleInit() diff --git a/extensions/fairygui/GList.cpp b/extensions/fairygui/GList.cpp index ab8288e4b9..b90db9952f 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, 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)); + 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)); return child; } @@ -1033,7 +1033,7 @@ void GList::setVirtual(bool loop) _scrollPane->_loop = 1; } - addEventListener(UIEventType::Scroll, AX_CALLBACK_1(GList::onScroll, this)); + addEventListener(UIEventType::Scroll, CC_CALLBACK_1(GList::onScroll, this)); setVirtualListChangedFlag(true); } } diff --git a/extensions/fairygui/GLoader.cpp b/extensions/fairygui/GLoader.cpp index cf0a36770b..db73e20854 100644 --- a/extensions/fairygui/GLoader.cpp +++ b/extensions/fairygui/GLoader.cpp @@ -28,9 +28,9 @@ GLoader::GLoader() GLoader::~GLoader() { - AX_SAFE_RELEASE(_playAction); - AX_SAFE_RELEASE(_content); - AX_SAFE_RELEASE(_content2); + CC_SAFE_RELEASE(_playAction); + CC_SAFE_RELEASE(_content); + CC_SAFE_RELEASE(_content2); } void GLoader::handleInit() @@ -321,7 +321,7 @@ void GLoader::clearContent() if (_content2 != nullptr) { _displayObject->removeChild(_content2->displayObject()); - AX_SAFE_RELEASE_NULL(_content2); + CC_SAFE_RELEASE_NULL(_content2); } ((FUISprite*)_content)->clearContent(); diff --git a/extensions/fairygui/GLoader3D.cpp b/extensions/fairygui/GLoader3D.cpp index db467d39ab..03e4ecd8fd 100644 --- a/extensions/fairygui/GLoader3D.cpp +++ b/extensions/fairygui/GLoader3D.cpp @@ -30,8 +30,8 @@ GLoader3D::GLoader3D() GLoader3D::~GLoader3D() { - AX_SAFE_RELEASE(_content); - AX_SAFE_RELEASE(_container); + CC_SAFE_RELEASE(_content); + CC_SAFE_RELEASE(_container); } void GLoader3D::handleInit() @@ -235,7 +235,7 @@ void GLoader3D::onChangeSpine() if (skeletonAni == nullptr) return; -#if !defined(AX_USE_SPINE_CPP) || AX_USE_SPINE_CPP +#if !defined(CC_USE_SPINE_CPP) || CC_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); - AX_SAFE_RELEASE_NULL(_content); + CC_SAFE_RELEASE_NULL(_content); } _contentItem = nullptr; diff --git a/extensions/fairygui/GMovieClip.cpp b/extensions/fairygui/GMovieClip.cpp index 216c925812..e3e7f3c7ba 100644 --- a/extensions/fairygui/GMovieClip.cpp +++ b/extensions/fairygui/GMovieClip.cpp @@ -18,7 +18,7 @@ GMovieClip::GMovieClip() GMovieClip::~GMovieClip() { - AX_SAFE_RELEASE(_playAction); + CC_SAFE_RELEASE(_playAction); } void GMovieClip::handleInit() @@ -192,7 +192,7 @@ _timeScale(1) ActionMovieClip::~ActionMovieClip() { - AX_SAFE_RELEASE(_animation); + CC_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 { - AX_ASSERT(0); + CC_ASSERT(0); return nullptr; } @@ -421,8 +421,8 @@ void ActionMovieClip::setAnimation(axis::Animation* animation, float repeatDelay { if (_animation != animation) { - AX_SAFE_RETAIN(animation); - AX_SAFE_RELEASE(_animation); + CC_SAFE_RETAIN(animation); + CC_SAFE_RELEASE(_animation); _animation = animation; } diff --git a/extensions/fairygui/GMovieClip.h b/extensions/fairygui/GMovieClip.h index accf88f81c..5a6d140489 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 - AX_DISALLOW_COPY_AND_ASSIGN(ActionMovieClip); + CC_DISALLOW_COPY_AND_ASSIGN(ActionMovieClip); }; NS_FGUI_END diff --git a/extensions/fairygui/GObject.cpp b/extensions/fairygui/GObject.cpp index fe598baf86..b089044ed6 100644 --- a/extensions/fairygui/GObject.cpp +++ b/extensions/fairygui/GObject.cpp @@ -66,12 +66,12 @@ GObject::~GObject() if (_displayObject) { _displayObject->removeFromParent(); - AX_SAFE_RELEASE(_displayObject); + CC_SAFE_RELEASE(_displayObject); } for (int i = 0; i < 10; i++) - AX_SAFE_DELETE(_gears[i]); - AX_SAFE_DELETE(_relations); - AX_SAFE_DELETE(_dragBounds); + CC_SAFE_DELETE(_gears[i]); + CC_SAFE_DELETE(_relations); + CC_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(AX_CALLBACK_0(GObject::onEnter, this)); - _displayObject->setOnExitCallback(AX_CALLBACK_0(GObject::onExit, this)); + _displayObject->setOnEnterCallback(CC_CALLBACK_0(GObject::onEnter, this)); + _displayObject->setOnExitCallback(CC_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, AX_CALLBACK_1(GObject::onRollOver, this), EventTag(this)); - addEventListener(UIEventType::RollOut, AX_CALLBACK_1(GObject::onRollOut, this), EventTag(this)); + addEventListener(UIEventType::RollOver, CC_CALLBACK_1(GObject::onRollOver, this), EventTag(this)); + addEventListener(UIEventType::RollOut, CC_CALLBACK_1(GObject::onRollOut, this), EventTag(this)); } } @@ -908,9 +908,9 @@ void GObject::initDrag() { if (_draggable) { - 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)); + 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)); } else { @@ -937,8 +937,8 @@ void GObject::dragBegin(int touchId) _dragTesting = true; UIRoot->getInputProcessor()->addTouchMonitor(touchId, this); - addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(GObject::onTouchMove, this), EventTag(this)); - addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(GObject::onTouchEnd, 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)); } void GObject::dragEnd() @@ -964,7 +964,7 @@ void GObject::onTouchMove(EventContext* context) if (_draggingObject != this && _draggable && _dragTesting) { int sensitivity; -#ifdef AX_PLATFORM_PC +#ifdef CC_PLATFORM_PC sensitivity = UIConfig::clickDragSensitivity; #else sensitivity = UIConfig::touchDragSensitivity; diff --git a/extensions/fairygui/GRoot.cpp b/extensions/fairygui/GRoot.cpp index d0da72ab1b..4325968dc7 100644 --- a/extensions/fairygui/GRoot.cpp +++ b/extensions/fairygui/GRoot.cpp @@ -43,9 +43,9 @@ GRoot::GRoot() : _windowSizeListener(nullptr), GRoot::~GRoot() { delete _inputProcessor; - AX_SAFE_RELEASE(_modalWaitPane); - AX_SAFE_RELEASE(_defaultTooltipWin); - AX_SAFE_RELEASE(_modalLayer); + CC_SAFE_RELEASE(_modalWaitPane); + CC_SAFE_RELEASE(_defaultTooltipWin); + CC_SAFE_RELEASE(_modalLayer); CALL_LATER_CANCEL(GRoot, doShowTooltipsWin); if (_windowSizeListener) @@ -533,10 +533,10 @@ bool GRoot::initWithScene(axis::Scene* scene, int zOrder) _inst = this; _inputProcessor = new InputProcessor(this); - _inputProcessor->setCaptureCallback(AX_CALLBACK_1(GRoot::onTouchEvent, this)); + _inputProcessor->setCaptureCallback(CC_CALLBACK_1(GRoot::onTouchEvent, this)); -#ifdef AX_PLATFORM_PC - _windowSizeListener = Director::getInstance()->getEventDispatcher()->addCustomEventListener(GLViewImpl::EVENT_WINDOW_RESIZED, AX_CALLBACK_0(GRoot::onWindowSizeChanged, this)); +#ifdef CC_PLATFORM_PC + _windowSizeListener = Director::getInstance()->getEventDispatcher()->addCustomEventListener(GLViewImpl::EVENT_WINDOW_RESIZED, CC_CALLBACK_0(GRoot::onWindowSizeChanged, this)); #endif onWindowSizeChanged(); diff --git a/extensions/fairygui/GScrollBar.cpp b/extensions/fairygui/GScrollBar.cpp index ec15f4bf71..c031e4cc3d 100644 --- a/extensions/fairygui/GScrollBar.cpp +++ b/extensions/fairygui/GScrollBar.cpp @@ -78,16 +78,16 @@ void GScrollBar::constructExtension(ByteBuffer* buffer) _arrowButton1 = getChild("arrow1"); _arrowButton2 = getChild("arrow2"); - _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)); + _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)); - this->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GScrollBar::onTouchBegin, this)); + this->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GScrollBar::onTouchBegin, this)); if (_arrowButton1 != nullptr) - _arrowButton1->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GScrollBar::onArrowButton1Click, this)); + _arrowButton1->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GScrollBar::onArrowButton1Click, this)); if (_arrowButton2 != nullptr) - _arrowButton2->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GScrollBar::onArrowButton2Click, this)); + _arrowButton2->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GScrollBar::onArrowButton2Click, this)); } void GScrollBar::onTouchBegin(EventContext* context) diff --git a/extensions/fairygui/GSlider.cpp b/extensions/fairygui/GSlider.cpp index 98688b33de..ceb2831b4b 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, AX_CALLBACK_1(GSlider::onGripTouchBegin, this)); - _gripObject->addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(GSlider::onGripTouchMove, this)); + _gripObject->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GSlider::onGripTouchBegin, this)); + _gripObject->addEventListener(UIEventType::TouchMove, CC_CALLBACK_1(GSlider::onGripTouchMove, this)); } - addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GSlider::onTouchBegin, this)); + addEventListener(UIEventType::TouchBegin, CC_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 f518400f9d..f8124d4566 100644 --- a/extensions/fairygui/GTextField.cpp +++ b/extensions/fairygui/GTextField.cpp @@ -14,7 +14,7 @@ GTextField::GTextField() GTextField::~GTextField() { - AX_SAFE_DELETE(_templateVars); + CC_SAFE_DELETE(_templateVars); } void GTextField::setText(const std::string& value) @@ -71,7 +71,7 @@ void GTextField::setTemplateVars(axis::ValueMap* value) return; if (value == nullptr) - AX_SAFE_DELETE(_templateVars); + CC_SAFE_DELETE(_templateVars); else { if (_templateVars == nullptr) diff --git a/extensions/fairygui/GTree.cpp b/extensions/fairygui/GTree.cpp index 0f86d57d8e..3d9ef86338 100644 --- a/extensions/fairygui/GTree.cpp +++ b/extensions/fairygui/GTree.cpp @@ -16,7 +16,7 @@ GTree::GTree() GTree::~GTree() { - AX_SAFE_RELEASE(_rootNode); + CC_SAFE_RELEASE(_rootNode); } void GTree::handleInit() @@ -96,9 +96,9 @@ void GTree::createCell(GTreeNode* node) child->_treeNode = node; if (node->_cell != child) { - AX_SAFE_RELEASE(node->_cell); + CC_SAFE_RELEASE(node->_cell); node->_cell = child; - AX_SAFE_RETAIN(node->_cell); + CC_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, AX_CALLBACK_1(GTree::onExpandedStateChanged, this)); + cc->addEventListener(UIEventType::Changed, CC_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, AX_CALLBACK_1(GTree::onCellTouchBegin, this)); + child->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GTree::onCellTouchBegin, this)); if (treeNodeRender != nullptr) treeNodeRender(node, child); diff --git a/extensions/fairygui/GTreeNode.cpp b/extensions/fairygui/GTreeNode.cpp index ddf015db10..6cb12933f4 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 { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -41,7 +41,7 @@ GTreeNode::~GTreeNode() if (_parent) _parent->removeChild(this); - AX_SAFE_RELEASE(_cell); + CC_SAFE_RELEASE(_cell); } bool GTreeNode::init(bool isFolder, const std::string& resURL) diff --git a/extensions/fairygui/PackageItem.cpp b/extensions/fairygui/PackageItem.cpp index f594d3d699..5d2e53a0dd 100644 --- a/extensions/fairygui/PackageItem.cpp +++ b/extensions/fairygui/PackageItem.cpp @@ -29,18 +29,18 @@ PackageItem::PackageItem() : owner(nullptr), PackageItem::~PackageItem() { - AX_SAFE_DELETE(scale9Grid); + CC_SAFE_DELETE(scale9Grid); - AX_SAFE_DELETE(rawData); + CC_SAFE_DELETE(rawData); if (bitmapFont) //bitmapfont will be released by fontatlas bitmapFont->releaseAtlas(); bitmapFont = nullptr; - AX_SAFE_RELEASE(animation); - AX_SAFE_RELEASE(texture); - AX_SAFE_RELEASE(spriteFrame); + CC_SAFE_RELEASE(animation); + CC_SAFE_RELEASE(texture); + CC_SAFE_RELEASE(spriteFrame); - AX_SAFE_DELETE(branches); - AX_SAFE_DELETE(highResolution); + CC_SAFE_DELETE(branches); + CC_SAFE_DELETE(highResolution); } void PackageItem::load() diff --git a/extensions/fairygui/PopupMenu.cpp b/extensions/fairygui/PopupMenu.cpp index 30d45b4c7a..9f08af23a4 100644 --- a/extensions/fairygui/PopupMenu.cpp +++ b/extensions/fairygui/PopupMenu.cpp @@ -32,7 +32,7 @@ PopupMenu::PopupMenu() : PopupMenu::~PopupMenu() { - AX_SAFE_RELEASE(_contentPane); + CC_SAFE_RELEASE(_contentPane); } bool PopupMenu::init(const std::string & resourceURL) @@ -50,7 +50,7 @@ bool PopupMenu::init(const std::string & resourceURL) _contentPane = UIPackage::createObjectFromURL(url)->as(); _contentPane->retain(); - _contentPane->addEventListener(UIEventType::Enter, AX_CALLBACK_1(PopupMenu::onEnter, this)); + _contentPane->addEventListener(UIEventType::Enter, CC_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, AX_CALLBACK_1(PopupMenu::onClickItem, this)); + _list->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(PopupMenu::onClickItem, this)); return true; } diff --git a/extensions/fairygui/RelationItem.cpp b/extensions/fairygui/RelationItem.cpp index c0274b5889..c0357c24a2 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, AX_CALLBACK_1(RelationItem::onTargetXYChanged, this), EventTag(this)); - target->addEventListener(UIEventType::SizeChange, AX_CALLBACK_1(RelationItem::onTargetSizeChanged, this), EventTag(this)); + target->addEventListener(UIEventType::PositionChange, CC_CALLBACK_1(RelationItem::onTargetXYChanged, this), EventTag(this)); + target->addEventListener(UIEventType::SizeChange, CC_CALLBACK_1(RelationItem::onTargetSizeChanged, this), EventTag(this)); _targetData.x = target->_position.x; _targetData.y = target->_position.y; diff --git a/extensions/fairygui/ScrollPane.cpp b/extensions/fairygui/ScrollPane.cpp index 4faa914db0..29768e2867 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, 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::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::Exit, [this](EventContext*) { if (_draggingPane == this) _draggingPane = nullptr; @@ -146,7 +146,7 @@ void ScrollPane::setup(ByteBuffer* buffer) if (scrollBarDisplay == ScrollBarDisplayType::DEFAULT) { -#ifdef AX_PLATFORM_PC +#ifdef CC_PLATFORM_PC scrollBarDisplay = UIConfig::defaultScrollBarDisplay; #else scrollBarDisplay = ScrollBarDisplayType::AUTO; @@ -198,8 +198,8 @@ void ScrollPane::setup(ByteBuffer* buffer) if (_hzScrollBar != nullptr) _hzScrollBar->setVisible(false); - _owner->addEventListener(UIEventType::RollOver, AX_CALLBACK_1(ScrollPane::onRollOver, this)); - _owner->addEventListener(UIEventType::RollOut, AX_CALLBACK_1(ScrollPane::onRollOut, this)); + _owner->addEventListener(UIEventType::RollOver, CC_CALLBACK_1(ScrollPane::onRollOver, this)); + _owner->addEventListener(UIEventType::RollOut, CC_CALLBACK_1(ScrollPane::onRollOut, this)); } } else @@ -994,7 +994,7 @@ void ScrollPane::updateScrollBarVisible2(GScrollBar* bar) if (bar->isVisible()) GTween::to(1, 0, 0.5f) ->setDelay(0.5f) - ->onComplete1(AX_CALLBACK_1(ScrollPane::onBarTweenComplete, this)) + ->onComplete1(CC_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 AX_PLATFORM_PC +#ifdef CC_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 AX_PLATFORM_PC +#ifdef CC_PLATFORM_PC sensitivity = 8; #else sensitivity = UIConfig::touchScrollSensitivity; diff --git a/extensions/fairygui/Transition.cpp b/extensions/fairygui/Transition.cpp index 7b43fa232b..aa22215732 100644 --- a/extensions/fairygui/Transition.cpp +++ b/extensions/fairygui/Transition.cpp @@ -158,9 +158,9 @@ TweenConfig::TweenConfig() TweenConfig::~TweenConfig() { - AX_SAFE_DELETE(path); - AX_SAFE_DELETE(startValue); - AX_SAFE_DELETE(endValue); + CC_SAFE_DELETE(path); + CC_SAFE_DELETE(startValue); + CC_SAFE_DELETE(endValue); } class TransitionItem @@ -253,7 +253,7 @@ TransitionItem::~TransitionItem() delete tweenConfig; } - AX_SAFE_DELETE(value); + CC_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(AX_CALLBACK_0(Transition::onDelayedPlay, this)); + GTween::delayedCall(delay)->setTarget(this)->onComplete(CC_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(AX_CALLBACK_1(Transition::onTweenStart, this)) - ->onUpdate(AX_CALLBACK_1(Transition::onTweenUpdate, this)) - ->onComplete1(AX_CALLBACK_1(Transition::onTweenComplete, this)); + ->onStart(CC_CALLBACK_1(Transition::onTweenStart, this)) + ->onUpdate(CC_CALLBACK_1(Transition::onTweenUpdate, this)) + ->onComplete1(CC_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(AX_CALLBACK_1(Transition::onTweenStart, this)) - ->onUpdate(AX_CALLBACK_1(Transition::onTweenUpdate, this)) - ->onComplete1(AX_CALLBACK_1(Transition::onTweenComplete, this)); + ->onStart(CC_CALLBACK_1(Transition::onTweenStart, this)) + ->onUpdate(CC_CALLBACK_1(Transition::onTweenUpdate, this)) + ->onComplete1(CC_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(AX_CALLBACK_1(Transition::onDelayedPlayItem, this)); + ->onComplete1(CC_CALLBACK_1(Transition::onDelayedPlayItem, this)); } } diff --git a/extensions/fairygui/UIPackage.cpp b/extensions/fairygui/UIPackage.cpp index 3e7baf60b6..c5b5b3aa33 100644 --- a/extensions/fairygui/UIPackage.cpp +++ b/extensions/fairygui/UIPackage.cpp @@ -720,7 +720,7 @@ void UIPackage::loadMovieClip(PackageItem* item) Vector frames(frameCount); Size mcSizeInPixels = Size(item->width, item->height); - Size mcSize = AX_SIZE_PIXELS_TO_POINTS(mcSizeInPixels); + Size mcSize = CC_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 = AX_RECT_PIXELS_TO_POINTS(tempRect); + tempRect = CC_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 = AX_RECT_PIXELS_TO_POINTS(tempRect); + tempRect = CC_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 0ef2b3b9fd..d62a0e921e 100644 --- a/extensions/fairygui/Window.cpp +++ b/extensions/fairygui/Window.cpp @@ -23,18 +23,18 @@ Window::Window() : Window::~Window() { - AX_SAFE_RELEASE(_contentPane); - AX_SAFE_RELEASE(_frame); - AX_SAFE_RELEASE(_closeButton); - AX_SAFE_RELEASE(_dragArea); - AX_SAFE_RELEASE(_modalWaitPane); + CC_SAFE_RELEASE(_contentPane); + CC_SAFE_RELEASE(_frame); + CC_SAFE_RELEASE(_closeButton); + CC_SAFE_RELEASE(_dragArea); + CC_SAFE_RELEASE(_modalWaitPane); } void Window::handleInit() { GComponent::handleInit(); - addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(Window::onTouchBegin, this)); + addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(Window::onTouchBegin, this)); } void Window::setContentPane(GComponent* value) @@ -45,7 +45,7 @@ void Window::setContentPane(GComponent* value) { removeChild(_contentPane); - AX_SAFE_RELEASE(_frame); + CC_SAFE_RELEASE(_frame); _contentPane->release(); } _contentPane = value; @@ -82,7 +82,7 @@ void Window::setCloseButton(GObject * value) if (_closeButton != nullptr) { _closeButton->retain(); - _closeButton->addClickListener(AX_CALLBACK_1(Window::closeEventHandler, this), EventTag(this)); + _closeButton->addClickListener(CC_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, AX_CALLBACK_1(Window::onDragStart, this), EventTag(this)); + _dragArea->addEventListener(UIEventType::DragStart, CC_CALLBACK_1(Window::onDragStart, this), EventTag(this)); } } } @@ -204,7 +204,7 @@ void Window::initWindow() IUISource* lib = _uiSources.at(i); if (!lib->isLoaded()) { - lib->load(AX_CALLBACK_0(Window::onUILoadComplete, this)); + lib->load(CC_CALLBACK_0(Window::onUILoadComplete, this)); _loading = true; } } diff --git a/extensions/fairygui/display/BitmapFont.h b/extensions/fairygui/display/BitmapFont.h index e6aff965ce..478d5eff57 100644 --- a/extensions/fairygui/display/BitmapFont.h +++ b/extensions/fairygui/display/BitmapFont.h @@ -25,7 +25,7 @@ public: { if (_fontAtlas != fontAtlas) { - AX_SAFE_RELEASE(_fontAtlas); + CC_SAFE_RELEASE(_fontAtlas); _fontAtlas = fontAtlas; } return _fontAtlas; diff --git a/extensions/fairygui/display/FUIContainer.cpp b/extensions/fairygui/display/FUIContainer.cpp index 35555e7671..7d0b8a244d 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 (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) -#define AX_CLIPPING_NODE_OPENGLES 0 +#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 #else -#define AX_CLIPPING_NODE_OPENGLES 1 +#define CC_CLIPPING_NODE_OPENGLES 1 #endif -#if AX_CLIPPING_NODE_OPENGLES +#if CC_CLIPPING_NODE_OPENGLES static void setProgram(Node *n, GLProgram *p) { n->setGLProgram(p); @@ -49,7 +49,7 @@ FUIContainer::FUIContainer() : FUIContainer::~FUIContainer() { - AX_SAFE_DELETE(_rectClippingSupport); + CC_SAFE_DELETE(_rectClippingSupport); if (_stencilClippingSupport) { if (_stencilClippingSupport->_stencil) @@ -57,7 +57,7 @@ FUIContainer::~FUIContainer() _stencilClippingSupport->_stencil->stopAllActions(); _stencilClippingSupport->_stencil->release(); } - AX_SAFE_DELETE(_stencilClippingSupport->_stencilStateManager); + CC_SAFE_DELETE(_stencilClippingSupport->_stencilStateManager); delete _stencilClippingSupport; } } @@ -121,7 +121,7 @@ void FUIContainer::setStencil(axis::Node * stencil) if (_stencilClippingSupport->_stencil == stencil) return; -#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#if CC_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 // AX_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // CC_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(); } - AX_SAFE_RELEASE_NULL(_stencilClippingSupport->_stencil); + CC_SAFE_RELEASE_NULL(_stencilClippingSupport->_stencil); //initialise new stencil _stencilClippingSupport->_stencil = stencil; - AX_SAFE_RETAIN(_stencilClippingSupport->_stencil); + CC_SAFE_RETAIN(_stencilClippingSupport->_stencil); if (_stencilClippingSupport->_stencil != nullptr && this->isRunning()) { _stencilClippingSupport->_stencil->onEnter(); @@ -180,7 +180,7 @@ void FUIContainer::setAlphaThreshold(float alphaThreshold) } } #else -#if AX_CLIPPING_NODE_OPENGLES +#if CC_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 AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if CC_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 AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if CC_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 AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if CC_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 AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if CC_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 if (_scriptType == kScriptTypeJavascript) { if (ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnExit)) @@ -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 = AX_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilClippingSupport->_stencilStateManager); + _stencilClippingSupport->_beforeVisitCmd.func = CC_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); - AX_SAFE_RELEASE_NULL(programState); + CC_SAFE_RELEASE_NULL(programState); #else -#if AX_CLIPPING_NODE_OPENGLES +#if CC_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 = AX_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilClippingSupport->_stencilStateManager); + afterDrawStencilCmd->func = CC_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 = AX_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilClippingSupport->_stencilStateManager); + afterVisitCmd->func = CC_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 = AX_CALLBACK_0(FUIContainer::onBeforeVisitScissor, this); + beforeVisitCmdScissor->func = CC_CALLBACK_0(FUIContainer::onBeforeVisitScissor, this); renderer->addCommand(beforeVisitCmdScissor); Node::visit(renderer, parentTransform, parentFlags); auto afterVisitCmdScissor = renderer->nextCallbackCommand(); afterVisitCmdScissor->init(_globalZOrder); - afterVisitCmdScissor->func = AX_CALLBACK_0(FUIContainer::onAfterVisitScissor, this); + afterVisitCmdScissor->func = CC_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 278fce0767..33a4f13e9e 100644 --- a/extensions/fairygui/display/FUIInput.cpp +++ b/extensions/fairygui/display/FUIInput.cpp @@ -17,7 +17,7 @@ FUIInput * FUIInput::create() } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -91,7 +91,7 @@ void FUIInput::continueInit() //disable default behavior this->setTouchEnabled(false); - this->addTouchEventListener(AX_CALLBACK_2(FUIInput::_touchDownAction, this)); + this->addTouchEventListener(CC_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 9786cf65dd..6545e111d1 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 / AX_CONTENT_SCALE_FACTOR(); + _bmFontSize = originalFontSize / CC_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 * AX_CONTENT_SCALE_FACTOR() / originalFontSize; + _bmfontScale = _bmFontSize * CC_CONTENT_SCALE_FACTOR() / originalFontSize; } else { diff --git a/extensions/fairygui/display/FUIRichText.cpp b/extensions/fairygui/display/FUIRichText.cpp index 200d081c0f..762a6386bb 100644 --- a/extensions/fairygui/display/FUIRichText.cpp +++ b/extensions/fairygui/display/FUIRichText.cpp @@ -15,7 +15,7 @@ USING_NS_AX; using namespace std; -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_WINRT) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) #define strcasecmp _stricmp #endif diff --git a/extensions/fairygui/display/FUISprite.cpp b/extensions/fairygui/display/FUISprite.cpp index 39b0aa6739..57ec625ed2 100644 --- a/extensions/fairygui/display/FUISprite.cpp +++ b/extensions/fairygui/display/FUISprite.cpp @@ -23,14 +23,14 @@ FUISprite::FUISprite() FUISprite::~FUISprite() { - AX_SAFE_FREE(_vertexData); - AX_SAFE_FREE(_vertexIndex); + CC_SAFE_FREE(_vertexData); + CC_SAFE_FREE(_vertexIndex); } void FUISprite::clearContent() { setTexture(nullptr); - AX_SAFE_RELEASE_NULL(_spriteFrame); + CC_SAFE_RELEASE_NULL(_spriteFrame); setCenterRectNormalized(Rect(0, 0, 1, 1)); _empty = _texture; @@ -130,8 +130,8 @@ void FUISprite::setFillMethod(FillMethod value) setupFill(); else { - AX_SAFE_FREE(_vertexData); - AX_SAFE_FREE(_vertexIndex); + CC_SAFE_FREE(_vertexData); + CC_SAFE_FREE(_vertexIndex); } } } @@ -335,8 +335,8 @@ void FUISprite::updateRadial(void) if (_vertexDataCount != index + 3) { sameIndexCount = false; - AX_SAFE_FREE(_vertexData); - AX_SAFE_FREE(_vertexIndex); + CC_SAFE_FREE(_vertexData); + CC_SAFE_FREE(_vertexIndex); _vertexDataCount = 0; } @@ -497,7 +497,7 @@ void FUISprite::draw(axis::Renderer* renderer, const axis::Mat4& transform, uint setMVPMatrixUniform(); #endif -#if AX_USE_CULLING +#if CC_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 82eba39d77..44dc5b4ede 100644 --- a/extensions/fairygui/event/HitTest.cpp +++ b/extensions/fairygui/event/HitTest.cpp @@ -15,7 +15,7 @@ PixelHitTestData::PixelHitTestData() : PixelHitTestData::~PixelHitTestData() { - AX_SAFE_DELETE(pixels); + CC_SAFE_DELETE(pixels); } void PixelHitTestData::load(ByteBuffer* buffer) diff --git a/extensions/fairygui/event/InputProcessor.cpp b/extensions/fairygui/event/InputProcessor.cpp index 809446057f..d002656a03 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 AX_PLATFORM_PC +#ifdef CC_PLATFORM_PC _mouseListener = EventListenerMouse::create(); - 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); + 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); _owner->displayObject()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(_mouseListener, _owner->displayObject()); #endif _touchListener = EventListenerTouchOneByOne::create(); - AX_SAFE_RETAIN(_touchListener); + CC_SAFE_RETAIN(_touchListener); _touchListener->setSwallowTouches(false); - _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); + _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); _owner->displayObject()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(_touchListener, _owner->displayObject()); _keyboardListener = EventListenerKeyboard::create(); - AX_SAFE_RETAIN(_keyboardListener); - _keyboardListener->onKeyPressed = AX_CALLBACK_2(InputProcessor::onKeyDown, this); - _keyboardListener->onKeyReleased = AX_CALLBACK_2(InputProcessor::onKeyUp, this); + CC_SAFE_RETAIN(_keyboardListener); + _keyboardListener->onKeyPressed = CC_CALLBACK_2(InputProcessor::onKeyDown, this); + _keyboardListener->onKeyReleased = CC_CALLBACK_2(InputProcessor::onKeyUp, this); _owner->displayObject()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(_keyboardListener, _owner->displayObject()); } InputProcessor::~InputProcessor() { -#ifdef AX_PLATFORM_PC +#ifdef CC_PLATFORM_PC _owner->displayObject()->getEventDispatcher()->removeEventListener(_mouseListener); #endif _owner->displayObject()->getEventDispatcher()->removeEventListener(_touchListener); _owner->displayObject()->getEventDispatcher()->removeEventListener(_keyboardListener); - AX_SAFE_RELEASE_NULL(_touchListener); - AX_SAFE_RELEASE_NULL(_mouseListener); - AX_SAFE_RELEASE_NULL(_keyboardListener); + CC_SAFE_RELEASE_NULL(_touchListener); + CC_SAFE_RELEASE_NULL(_mouseListener); + CC_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 AX_PLATFORM_PC +#ifndef CC_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 f56a35be06..6fe7386f85 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(); - AX_SAFE_DELETE(_tweenConfig); + CC_SAFE_DELETE(_tweenConfig); } void GearBase::setController(GController* value) diff --git a/extensions/fairygui/gears/GearColor.cpp b/extensions/fairygui/gears/GearColor.cpp index e238ce5629..6afaa3f9a3 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(AX_CALLBACK_1(GearColor::onTweenUpdate, this)) - ->onComplete(AX_CALLBACK_0(GearColor::onTweenComplete, this)); + ->onUpdate(CC_CALLBACK_1(GearColor::onTweenUpdate, this)) + ->onComplete(CC_CALLBACK_0(GearColor::onTweenComplete, this)); } } else diff --git a/extensions/fairygui/gears/GearLook.cpp b/extensions/fairygui/gears/GearLook.cpp index 369c8204b4..472d1de754 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(AX_CALLBACK_1(GearLook::onTweenUpdate, this)) - ->onComplete(AX_CALLBACK_0(GearLook::onTweenComplete, this)); + ->onUpdate(CC_CALLBACK_1(GearLook::onTweenUpdate, this)) + ->onComplete(CC_CALLBACK_0(GearLook::onTweenComplete, this)); } } else diff --git a/extensions/fairygui/gears/GearSize.cpp b/extensions/fairygui/gears/GearSize.cpp index 0770938eff..6f99a371c8 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(AX_CALLBACK_1(GearSize::onTweenUpdate, this)) - ->onComplete(AX_CALLBACK_0(GearSize::onTweenComplete, this)); + ->onUpdate(CC_CALLBACK_1(GearSize::onTweenUpdate, this)) + ->onComplete(CC_CALLBACK_0(GearSize::onTweenComplete, this)); } } else diff --git a/extensions/fairygui/gears/GearXY.cpp b/extensions/fairygui/gears/GearXY.cpp index d5dc5b89b0..4f312e3f28 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(AX_CALLBACK_1(GearXY::onTweenUpdate, this)) - ->onComplete(AX_CALLBACK_0(GearXY::onTweenComplete, this)); + ->onUpdate(CC_CALLBACK_1(GearXY::onTweenUpdate, this)) + ->onComplete(CC_CALLBACK_0(GearXY::onTweenComplete, this)); } } else diff --git a/extensions/fairygui/tween/GTweener.cpp b/extensions/fairygui/tween/GTweener.cpp index cc26b596ff..4125f1c743 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) { - AX_SAFE_RELEASE(_refTarget); + CC_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) { - AX_SAFE_RELEASE(_refTarget); + CC_SAFE_RELEASE(_refTarget); _target = _refTarget = target; _propType = propType; - AX_SAFE_RETAIN(_refTarget); + CC_SAFE_RETAIN(_refTarget); return this; } @@ -278,7 +278,7 @@ void GTweener::_init() void GTweener::_reset() { - AX_SAFE_RELEASE(_refTarget); + CC_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 dec6684054..14b5df0854 100644 --- a/extensions/fairygui/utils/html/HtmlObject.cpp +++ b/extensions/fairygui/utils/html/HtmlObject.cpp @@ -36,7 +36,7 @@ HtmlObject::~HtmlObject() } } - AX_SAFE_RELEASE(_ui); + CC_SAFE_RELEASE(_ui); } void HtmlObject::create(FUIRichText* owner, HtmlElement* element) diff --git a/extensions/fairygui/utils/html/HtmlParser.cpp b/extensions/fairygui/utils/html/HtmlParser.cpp index 8f834b1105..cee83ccd3e 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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_WINRT) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) #define strcasecmp _stricmp #endif diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.cpp b/extensions/physics-nodes/CCPhysicsDebugNode.cpp index 2baa0d0fe4..b46d4b454f 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); } - AX_SAFE_DELETE_ARRAY(pPoints); + CC_SAFE_DELETE_ARRAY(pPoints); } break; default: diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.h b/extensions/physics-nodes/CCPhysicsDebugNode.h index f688fe3c38..832eed84ac 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.h +++ b/extensions/physics-nodes/CCPhysicsDebugNode.h @@ -43,7 +43,7 @@ NS_AX_EXT_BEGIN * @lua NA */ -class AX_EX_DLL PhysicsDebugNode : public DrawNode +class CC_EX_DLL PhysicsDebugNode : public DrawNode { public: diff --git a/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.cpp b/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.cpp index 79ded5910b..d2f7852749 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, - AX_DEGREES_TO_RADIANS(0), 30, true, 1.0f, 1.0f, Color4F(color.r, color.g, color.b, color.a)); + CC_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, AX_DEGREES_TO_RADIANS(0), 20, 1.0f, 1.0f, + drawBP->drawSolidCircle(c, radius * mRatio, CC_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 e74713d1c9..be3f13d66f 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 AX_EX_DLL PhysicsDebugNodeBox2D : public b2Draw +class CC_EX_DLL PhysicsDebugNodeBox2D : public b2Draw { public: PhysicsDebugNodeBox2D(); diff --git a/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.cpp b/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.cpp index 36aa79ad85..3345623f9d 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); } - AX_SAFE_DELETE_ARRAY(pPoints); + CC_SAFE_DELETE_ARRAY(pPoints); } break; default: diff --git a/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.h b/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.h index 364a25e89f..6f4f9374a9 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.h +++ b/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.h @@ -45,7 +45,7 @@ extern Vec2 physicsDebugNodeOffset; * @lua NA */ -class AX_EX_DLL PhysicsDebugNodeChipmunk2D : public DrawNode +class CC_EX_DLL PhysicsDebugNodeChipmunk2D : public DrawNode { public: diff --git a/extensions/physics-nodes/CCPhysicsSprite.cpp b/extensions/physics-nodes/CCPhysicsSprite.cpp index bbc25a5d33..0ec61d3141 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 (AX_ENABLE_CHIPMUNK_INTEGRATION || AX_ENABLE_BOX2D_INTEGRATION) +#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) -# if AX_ENABLE_CHIPMUNK_INTEGRATION +# if CC_ENABLE_CHIPMUNK_INTEGRATION # include "chipmunk/chipmunk.h" -# elif AX_ENABLE_BOX2D_INTEGRATION +# elif CC_ENABLE_BOX2D_INTEGRATION # include "box2d/box2d.h" # endif @@ -49,7 +49,7 @@ PhysicsSprite* PhysicsSprite::create() } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -64,7 +64,7 @@ PhysicsSprite* PhysicsSprite::createWithTexture(Texture2D* pTexture) } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -79,7 +79,7 @@ PhysicsSprite* PhysicsSprite::createWithTexture(Texture2D* pTexture, const Rect& } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -94,7 +94,7 @@ PhysicsSprite* PhysicsSprite::createWithSpriteFrame(SpriteFrame* pSpriteFrame) } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -109,7 +109,7 @@ PhysicsSprite* PhysicsSprite::createWithSpriteFrameName(const char* pszSpriteFra } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -124,7 +124,7 @@ PhysicsSprite* PhysicsSprite::create(const char* pszFileName) } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -139,7 +139,7 @@ PhysicsSprite* PhysicsSprite::create(const char* pszFileName, const Rect& rect) } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -202,7 +202,7 @@ Vec3 PhysicsSprite::getPosition3D() const cpBody* PhysicsSprite::getCPBody() const { -# if AX_ENABLE_CHIPMUNK_INTEGRATION +# if CC_ENABLE_CHIPMUNK_INTEGRATION return _CPBody; # else CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); @@ -212,7 +212,7 @@ cpBody* PhysicsSprite::getCPBody() const void PhysicsSprite::setCPBody(cpBody* pBody) { -# if AX_ENABLE_CHIPMUNK_INTEGRATION +# if CC_ENABLE_CHIPMUNK_INTEGRATION _CPBody = pBody; # else CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); @@ -221,7 +221,7 @@ void PhysicsSprite::setCPBody(cpBody* pBody) b2Body* PhysicsSprite::getB2Body() const { -# if AX_ENABLE_BOX2D_INTEGRATION +# if CC_ENABLE_BOX2D_INTEGRATION return _pB2Body; # else CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); @@ -231,17 +231,17 @@ b2Body* PhysicsSprite::getB2Body() const void PhysicsSprite::setB2Body(b2Body* pBody) { -# if AX_ENABLE_BOX2D_INTEGRATION +# if CC_ENABLE_BOX2D_INTEGRATION _pB2Body = pBody; # else - AX_UNUSED_PARAM(pBody); + CC_UNUSED_PARAM(pBody); CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); # endif } float PhysicsSprite::getPTMRatio() const { -# if AX_ENABLE_BOX2D_INTEGRATION +# if CC_ENABLE_BOX2D_INTEGRATION return _PTMRatio; # else CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); @@ -251,10 +251,10 @@ float PhysicsSprite::getPTMRatio() const void PhysicsSprite::setPTMRatio(float fRatio) { -# if AX_ENABLE_BOX2D_INTEGRATION +# if CC_ENABLE_BOX2D_INTEGRATION _PTMRatio = fRatio; # else - AX_UNUSED_PARAM(fRatio); + CC_UNUSED_PARAM(fRatio); CCASSERT(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 AX_ENABLE_CHIPMUNK_INTEGRATION +# if CC_ENABLE_CHIPMUNK_INTEGRATION cpVect cpPos = cpBodyGetPosition(_CPBody); s_physicPosion = Vec2(cpPos.x, cpPos.y); -# elif AX_ENABLE_BOX2D_INTEGRATION +# elif CC_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 AX_ENABLE_CHIPMUNK_INTEGRATION +# if CC_ENABLE_CHIPMUNK_INTEGRATION cpVect cpPos = cpv(x, y); cpBodySetPosition(_CPBody, cpPos); -# elif AX_ENABLE_BOX2D_INTEGRATION +# elif CC_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 AX_ENABLE_CHIPMUNK_INTEGRATION +# if CC_ENABLE_CHIPMUNK_INTEGRATION - return (_ignoreBodyRotation ? Sprite::getRotation() : -AX_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); + return (_ignoreBodyRotation ? Sprite::getRotation() : -CC_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); -# elif AX_ENABLE_BOX2D_INTEGRATION +# elif CC_ENABLE_BOX2D_INTEGRATION - return (_ignoreBodyRotation ? Sprite::getRotation() : AX_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); + return (_ignoreBodyRotation ? Sprite::getRotation() : CC_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); # else return 0.0f; # endif @@ -336,17 +336,17 @@ void PhysicsSprite::setRotation(float fRotation) Sprite::setRotation(fRotation); } -# if AX_ENABLE_CHIPMUNK_INTEGRATION +# if CC_ENABLE_CHIPMUNK_INTEGRATION else { - cpBodySetAngle(_CPBody, -AX_DEGREES_TO_RADIANS(fRotation)); + cpBodySetAngle(_CPBody, -CC_DEGREES_TO_RADIANS(fRotation)); } -# elif AX_ENABLE_BOX2D_INTEGRATION +# elif CC_ENABLE_BOX2D_INTEGRATION else { b2Vec2 p = _pB2Body->GetPosition(); - float radians = AX_DEGREES_TO_RADIANS(fRotation); + float radians = CC_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 AX_ENABLE_CHIPMUNK_INTEGRATION +# if CC_ENABLE_CHIPMUNK_INTEGRATION - cpVect rot = (_ignoreBodyRotation ? cpvforangle(-AX_DEGREES_TO_RADIANS(_rotationX)) : cpBodyGetRotation(_CPBody)); + cpVect rot = (_ignoreBodyRotation ? cpvforangle(-CC_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 AX_ENABLE_BOX2D_INTEGRATION +# elif CC_ENABLE_BOX2D_INTEGRATION b2Vec2 pos = _pB2Body->GetPosition(); @@ -467,4 +467,4 @@ void PhysicsSprite::afterUpdate(EventCustom* /*event*/) NS_AX_EXT_END -#endif // AX_ENABLE_CHIPMUNK_INTEGRATION || AX_ENABLE_BOX2D_INTEGRATION +#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION diff --git a/extensions/physics-nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h index a931d73b36..16a0eb49b0 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 (AX_ENABLE_CHIPMUNK_INTEGRATION || AX_ENABLE_BOX2D_INTEGRATION) +#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_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 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 + - 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 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 AX_EX_DLL PhysicsSprite : public Sprite +class CC_EX_DLL PhysicsSprite : public Sprite { public: static PhysicsSprite* create(); @@ -149,6 +149,6 @@ protected: NS_AX_EXT_END -#endif // AX_ENABLE_CHIPMUNK_INTEGRATION || AX_ENABLE_BOX2D_INTEGRATION +#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION #endif // __PHYSICSNODES_CCPHYSICSSPRITE_H__ diff --git a/extensions/physics-nodes/CCPhysicsSpriteBox2D.cpp b/extensions/physics-nodes/CCPhysicsSpriteBox2D.cpp index 604d58d8a4..6add6591cb 100644 --- a/extensions/physics-nodes/CCPhysicsSpriteBox2D.cpp +++ b/extensions/physics-nodes/CCPhysicsSpriteBox2D.cpp @@ -43,7 +43,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::create() } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -58,7 +58,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::createWithTexture(Texture2D* pTexture) } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -73,7 +73,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::createWithTexture(Texture2D* pTexture, c } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -88,7 +88,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::createWithSpriteFrame(SpriteFrame* pSpri } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -103,7 +103,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::createWithSpriteFrameName(const char* ps } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -118,7 +118,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::create(const char* pszFileName) } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -133,7 +133,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::create(const char* pszFileName, const Re } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -254,7 +254,7 @@ void PhysicsSpriteBox2D::setPosition3D(const Vec3& position) float PhysicsSpriteBox2D::getRotation() const { - return (_ignoreBodyRotation ? Sprite::getRotation() : AX_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); + return (_ignoreBodyRotation ? Sprite::getRotation() : CC_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 = AX_DEGREES_TO_RADIANS(fRotation); + float radians = CC_DEGREES_TO_RADIANS(fRotation); _pB2Body->SetTransform(p, radians); } } diff --git a/extensions/physics-nodes/CCPhysicsSpriteBox2D.h b/extensions/physics-nodes/CCPhysicsSpriteBox2D.h index 2f4a0e83c0..5a39e38263 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 AX_EX_DLL PhysicsSpriteBox2D : public Sprite +class CC_EX_DLL PhysicsSpriteBox2D : public Sprite { public: static PhysicsSpriteBox2D* create(); diff --git a/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.cpp b/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.cpp index 8b911b7112..a5e21a679f 100644 --- a/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.cpp +++ b/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.cpp @@ -43,7 +43,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::create() } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -58,7 +58,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::createWithTexture(Texture2D* p } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -73,7 +73,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::createWithTexture(Texture2D* p } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -88,7 +88,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::createWithSpriteFrame(SpriteFr } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -103,7 +103,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::createWithSpriteFrameName(cons } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -118,7 +118,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::create(const char* pszFileName } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -133,7 +133,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::create(const char* pszFileName } else { - AX_SAFE_DELETE(pRet); + CC_SAFE_DELETE(pRet); } return pRet; @@ -246,7 +246,7 @@ void PhysicsSpriteChipmunk2D::setPosition3D(const Vec3& position) float PhysicsSpriteChipmunk2D::getRotation() const { - return (_ignoreBodyRotation ? Sprite::getRotation() : -AX_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); + return (_ignoreBodyRotation ? Sprite::getRotation() : -CC_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); } void PhysicsSpriteChipmunk2D::setRotation(float fRotation) @@ -257,7 +257,7 @@ void PhysicsSpriteChipmunk2D::setRotation(float fRotation) } else { - cpBodySetAngle(_CPBody, -AX_DEGREES_TO_RADIANS(fRotation)); + cpBodySetAngle(_CPBody, -CC_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(-AX_DEGREES_TO_RADIANS(_rotationX)) : cpBodyGetRotation(_CPBody)); + cpVect rot = (_ignoreBodyRotation ? cpvforangle(-CC_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 6962b09a3c..d948a02fee 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 AX_EX_DLL PhysicsSpriteChipmunk2D : public Sprite +class CC_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 2958fead41..b8c2ed63bc 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 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 +#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 #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 b399dba4dd..87ea5ced94 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 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 +#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 #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 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 +#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 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 0f9ce39185..c75a7663d3 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) #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 8db961ac8a..810535c8e2 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) #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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_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 70a9f5035c..af7309c2c7 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 AX_USE_NAVMESH +#if CC_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 3471c278fb..5737b928d8 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 AX_USE_NAVMESH +#if CC_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 AX_USE_NAVMESH +#endif //#if CC_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 30802a10e9..592a42f75c 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 AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +#if CC_USE_3D_PHYSICS && CC_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 23d83858f0..8daec8990d 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 AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +#if CC_USE_3D_PHYSICS && CC_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 AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +#endif //#if CC_USE_3D_PHYSICS && CC_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 ed229eec1c..85fc79f8af 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 AX_USE_PHYSICS +#if CC_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 2c847ad9f3..efaee4a1ca 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 AX_USE_PHYSICS +#if CC_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 AX_USE_PHYSICS +#endif //#if CC_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 cc5ae1d27b..8f675d7dce 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); - AX_SAFE_DELETE(self); + CC_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); } - AX_SAFE_DELETE_ARRAY(arg0); + CC_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); - AX_SAFE_DELETE(self); + CC_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); - AX_SAFE_DELETE(self); + CC_SAFE_DELETE(self); return 0; } diff --git a/extensions/scripting/lua-bindings/manual/CCComponentLua.cpp b/extensions/scripting/lua-bindings/manual/CCComponentLua.cpp index df7177b712..b437d7c2da 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) { - AX_ASSERT(!scriptFileName.empty()); + CC_ASSERT(!scriptFileName.empty()); initClass(); diff --git a/extensions/scripting/lua-bindings/manual/CCLuaEngine.cpp b/extensions/scripting/lua-bindings/manual/CCLuaEngine.cpp index fd1cac2acd..3c74184c36 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) { - AX_SAFE_RELEASE(_stack); + CC_SAFE_RELEASE(_stack); _defaultEngine = nullptr; } diff --git a/extensions/scripting/lua-bindings/manual/CCLuaEngine.h b/extensions/scripting/lua-bindings/manual/CCLuaEngine.h index acf85cd1f3..753f46b12d 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaEngine.h +++ b/extensions/scripting/lua-bindings/manual/CCLuaEngine.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_LUA_ENGINE_H__ -#define __AX_LUA_ENGINE_H__ +#ifndef __CC_LUA_ENGINE_H__ +#define __CC_LUA_ENGINE_H__ extern "C" { #include "lua.h" @@ -50,7 +50,7 @@ NS_AX_BEGIN * @lua NA * @js NA */ -class AX_LUA_DLL LuaEngine : public ScriptEngineProtocol +class CC_LUA_DLL LuaEngine : public ScriptEngineProtocol { public: /** @@ -64,7 +64,7 @@ public: * * @return the instance of LuaEngine. */ - AX_DEPRECATED_ATTRIBUTE static LuaEngine* defaultEngine(void) { return LuaEngine::getInstance(); } + CC_DEPRECATED_ATTRIBUTE static LuaEngine* defaultEngine(void) { return LuaEngine::getInstance(); } /** * Destructor of LuaEngine. @@ -264,4 +264,4 @@ NS_AX_END // end group /// @} -#endif // __AX_LUA_ENGINE_H__ +#endif // __CC_LUA_ENGINE_H__ diff --git a/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp b/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp index a61b721eac..3b4741fc1b 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 (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) # include "scripting/lua-bindings/manual/platform/ios/CCLuaObjcBridge.h" #endif -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) # include "scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.h" #endif @@ -154,16 +154,16 @@ bool LuaStack::init() tolua_luanode_open(_state); register_luanode_manual(_state); -#if AX_USE_PHYSICS +#if CC_USE_PHYSICS register_all_axis_physics(_state); register_all_axis_physics_manual(_state); #endif -#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) LuaObjcBridge::luaopen_luaoc(_state); #endif -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) LuaJavaBridge::luaopen_luaj(_state); #endif diff --git a/extensions/scripting/lua-bindings/manual/CCLuaStack.h b/extensions/scripting/lua-bindings/manual/CCLuaStack.h index 2fd6583d8c..f0df2a2cbf 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaStack.h +++ b/extensions/scripting/lua-bindings/manual/CCLuaStack.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_LUA_STACK_H_ -#define __AX_LUA_STACK_H_ +#ifndef __CC_LUA_STACK_H_ +#define __CC_LUA_STACK_H_ extern "C" { #include "lua.h" @@ -332,4 +332,4 @@ NS_AX_END // end group /// @} -#endif // __AX_LUA_STACK_H_ +#endif // __CC_LUA_STACK_H_ diff --git a/extensions/scripting/lua-bindings/manual/CCLuaValue.h b/extensions/scripting/lua-bindings/manual/CCLuaValue.h index db5afc19ad..7aea56eadd 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaValue.h +++ b/extensions/scripting/lua-bindings/manual/CCLuaValue.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __AX_LUA_VALUE_H_ -#define __AX_LUA_VALUE_H_ +#ifndef __CC_LUA_VALUE_H_ +#define __CC_LUA_VALUE_H_ #include #include @@ -38,7 +38,7 @@ extern "C" { #include "base/ccTypes.h" #include "base/CCRef.h" -#if AX_TARGET_PLATFORM == AX_PLATFORM_BLACKBERRY +#if CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY using std::memcpy; using std::memset; #endif @@ -281,4 +281,4 @@ NS_AX_END // end group /// @} -#endif // __AX_LUA_VALUE_H_ +#endif // __CC_LUA_VALUE_H_ diff --git a/extensions/scripting/lua-bindings/manual/Lua-BindingsExport.h b/extensions/scripting/lua-bindings/manual/Lua-BindingsExport.h index 199f7a6775..48e73786ea 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 AX_LUA_DLL +# define CC_LUA_DLL # else # if defined(_USRLUADLL) -# define AX_LUA_DLL __declspec(dllexport) +# define CC_LUA_DLL __declspec(dllexport) # else /* use a DLL library */ -# define AX_LUA_DLL __declspec(dllimport) +# define CC_LUA_DLL __declspec(dllimport) # endif # endif @@ -49,9 +49,9 @@ # endif # endif #elif defined(_SHARED_) -# define AX_LUA_DLL __attribute__((visibility("default"))) +# define CC_LUA_DLL __attribute__((visibility("default"))) #else -# define AX_LUA_DLL +# define CC_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 b532ff2382..f2b180e899 100644 --- a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.cpp +++ b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.cpp @@ -506,7 +506,7 @@ bool luaval_to_blendfunc(lua_State* L, int lo, axis::BlendFunc* outValue, const return ok; } -#if AX_USE_PHYSICS +#if CC_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 AX_USE_PHYSICS +#endif //#if CC_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); - AX_SAFE_DELETE_ARRAY(array); + CC_SAFE_DELETE_ARRAY(array); return false; } ok &= luaval_to_vec2(L, lua_gettop(L), &array[i]); if (!ok) { lua_pop(L, 1); - AX_SAFE_DELETE_ARRAY(array); + CC_SAFE_DELETE_ARRAY(array); return false; } lua_pop(L, 1); @@ -2255,7 +2255,7 @@ int vec4_to_luaval(lua_State* L, const axis::Vec4& vec4) return 1; } -#if AX_USE_PHYSICS +#if CC_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 AX_USE_PHYSICS +#endif //#if CC_USE_PHYSICS void size_to_luaval(lua_State* L, const Size& sz) { diff --git a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h index 7f078c8685..3036e6a929 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 AX_LUA_DLL bool luaval_to_boolean(lua_State* L, int lo, bool* outValue, const char* funcName = ""); +extern CC_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 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, +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, 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 AX_LUA_DLL bool luaval_to_color3b(lua_State* L, int lo, Color3B* outValue, const char* funcName = ""); +extern CC_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 AX_USE_PHYSICS +#if CC_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 AX_USE_PHYSICS +#endif //#if CC_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); } -AX_DEPRECATED_ATTRIBUTE static inline bool luaval_to_kmMat4(lua_State* L, +CC_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); } -AX_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L, +CC_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. */ -AX_LUA_DLL bool luaval_to_std_vector_string(lua_State* L, +CC_LUA_DLL bool luaval_to_std_vector_string(lua_State* L, int lo, std::vector* ret, const char* funcName = ""); -AX_LUA_DLL bool luaval_to_std_vector_string_view(lua_State* L, +CC_LUA_DLL bool luaval_to_std_vector_string_view(lua_State* L, int lo, std::vector* ret, const char* funcName = ""); @@ -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 AX_LUA_DLL void color3b_to_luaval(lua_State* L, const Color3B& cc); +extern CC_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 AX_USE_PHYSICS +#if CC_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 AX_USE_PHYSICS +#endif //#if CC_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); } -AX_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L, const axis::Vec2* points, int count) +CC_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 -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); +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); /** * convert lua object VertexLayout to native object */ -AX_LUA_DLL bool luaval_to_vertexLayout(lua_State* L, +CC_LUA_DLL bool luaval_to_vertexLayout(lua_State* L, int pos, axis::backend::VertexLayout& outLayout, const char* message); @@ -1343,7 +1343,7 @@ AX_LUA_DLL bool luaval_to_vertexLayout(lua_State* L, /** * convert lua object SamplerDescriptor to native object */ -AX_LUA_DLL bool luaval_to_samplerDescriptor(lua_State* L, +CC_LUA_DLL bool luaval_to_samplerDescriptor(lua_State* L, int pos, axis::backend::SamplerDescriptor& desc, const char* message); @@ -1351,7 +1351,7 @@ AX_LUA_DLL bool luaval_to_samplerDescriptor(lua_State* L, /** * convert lua object to axis::backend::UniformLocation */ -AX_LUA_DLL bool luaval_to_uniformLocation(lua_State* L, +CC_LUA_DLL bool luaval_to_uniformLocation(lua_State* L, int pos, axis::backend::UniformLocation& desc, const char* message); @@ -1359,9 +1359,9 @@ AX_LUA_DLL bool luaval_to_uniformLocation(lua_State* L, /** * convert axis::backend::UniformLocation to lua object */ -AX_LUA_DLL void uniformLocation_to_luaval(lua_State* L, const axis::backend::UniformLocation& desc); +CC_LUA_DLL void uniformLocation_to_luaval(lua_State* L, const axis::backend::UniformLocation& desc); -AX_LUA_DLL void program_activeattrs_to_luaval(lua_State* L, +CC_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 8760d03b4b..b257bcaa6b 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; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -120,7 +120,7 @@ ScriptHandlerMgr* ScriptHandlerMgr::getInstance() void ScriptHandlerMgr::destroyInstance() { - AX_SAFE_DELETE(_scriptHandlerMgr); + CC_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 25a75e9e20..458ed657d2 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 AX_USE_NAVMESH +#if CC_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 AX_USE_NAVMESH +#endif //#if CC_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) { - AX_SAFE_DELETE_ARRAY(arr); + CC_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2696,7 +2696,7 @@ int lua_cocos2d_CardinalSplineBy_create(lua_State* tolua_S) if (NULL == points) { - AX_SAFE_DELETE_ARRAY(arr); + CC_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2705,7 +2705,7 @@ int lua_cocos2d_CardinalSplineBy_create(lua_State* tolua_S) points->addControlPoint(arr[i]); } - AX_SAFE_DELETE_ARRAY(arr); + CC_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) { - AX_SAFE_DELETE_ARRAY(arr); + CC_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2772,7 +2772,7 @@ int tolua_cocos2d_CatmullRomBy_create(lua_State* tolua_S) points->addControlPoint(arr[i]); } - AX_SAFE_DELETE_ARRAY(arr); + CC_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) { - AX_SAFE_DELETE_ARRAY(arr); + CC_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2838,7 +2838,7 @@ int tolua_cocos2d_CatmullRomTo_create(lua_State* tolua_S) points->addControlPoint(arr[i]); } - AX_SAFE_DELETE_ARRAY(arr); + CC_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) { - AX_SAFE_DELETE_ARRAY(arr); + CC_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]; - AX_SAFE_DELETE_ARRAY(arr); + CC_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) { - AX_SAFE_DELETE_ARRAY(arr); + CC_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]; - AX_SAFE_DELETE_ARRAY(arr); + CC_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)) { - AX_SAFE_DELETE_ARRAY(points); + CC_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); - AX_SAFE_DELETE_ARRAY(points); + CC_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")) { - AX_SAFE_DELETE_ARRAY(points); + CC_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")) { - AX_SAFE_DELETE_ARRAY(points); + CC_SAFE_DELETE_ARRAY(points); return 0; } self->drawPolygon(points, (int)size, fillColor, borderWidth, borderColor); - AX_SAFE_DELETE_ARRAY(points); + CC_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)) { - AX_SAFE_DELETE_ARRAY(points); + CC_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); - AX_SAFE_DELETE_ARRAY(points); + CC_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); - AX_SAFE_DELETE_ARRAY(points); + CC_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)) { - AX_SAFE_DELETE_ARRAY(points); + CC_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); - AX_SAFE_DELETE_ARRAY(points); + CC_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); - AX_SAFE_DELETE_ARRAY(points); + CC_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) { - AX_SAFE_DELETE_ARRAY(arr); + CC_SAFE_DELETE_ARRAY(arr); return 0; } @@ -3269,7 +3269,7 @@ int tolua_axis_DrawNode_drawCardinalSpline(lua_State* tolua_S) { config->addControlPoint(arr[i]); } - AX_SAFE_DELETE_ARRAY(arr); + CC_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) { - AX_SAFE_DELETE_ARRAY(arr); + CC_SAFE_DELETE_ARRAY(arr); return 0; } @@ -3337,7 +3337,7 @@ int tolua_axis_DrawNode_drawCatmullRom(lua_State* tolua_S) { config->addControlPoint(arr[i]); } - AX_SAFE_DELETE_ARRAY(arr); + CC_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)) { - AX_SAFE_DELETE_ARRAY(points); + CC_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); - AX_SAFE_DELETE_ARRAY(points); + CC_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)) { - AX_SAFE_DELETE_ARRAY(points); + CC_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); - AX_SAFE_DELETE_ARRAY(points); + CC_SAFE_DELETE_ARRAY(points); return 0; } lua_pop(tolua_S, 1); @@ -3786,7 +3786,7 @@ tolua_lerror: return 0; } -#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +#if CC_USE_3D_PHYSICS && CC_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 AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION tolua_function(tolua_S, "getPhysics3DWorld", lua_axis_Scene_getPhysics3DWorld); tolua_function(tolua_S, "setPhysics3DDebugCamera", lua_axis_Scene_setPhysics3DDebugCamera); #endif -#if AX_USE_NAVMESH +#if CC_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 { - AX_SAFE_DELETE(eventAcceleration); + CC_SAFE_DELETE(eventAcceleration); } return eventAcceleration; } @@ -4558,7 +4558,7 @@ EventListenerCustom* LuaEventListenerCustom::create(std::string_view eventName) } else { - AX_SAFE_DELETE(eventCustom); + CC_SAFE_DELETE(eventCustom); } return eventCustom; } @@ -6329,7 +6329,7 @@ int lua_axis_TMXLayer_setTiles(lua_State* tolua_S) cobj->setTiles(arg0); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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); - AX_SAFE_DELETE(self); + CC_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); - AX_SAFE_DELETE(self); + CC_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); - AX_SAFE_DELETE(self); + CC_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 5c613b26e1..bac7b9e1f4 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 = AX_CALLBACK_0(CustomGUIReader::createInstance, this); + t._func = CC_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 0eb224f1a9..6ada683d8a 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, - AX_SCHEDULE_SELECTOR(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback)); + CC_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, - AX_SCHEDULE_SELECTOR(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback)); + CC_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 d19c95393e..5d4041c27b 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) # include "scripting/lua-bindings/manual/tolua_fix.h" # include "scripting/lua-bindings/manual/LuaBasicConversions.h" @@ -381,4 +381,4 @@ int register_all_axis_controller_manual(lua_State* L) return 0; } -#endif //#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_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 a76ca137c3..5f2d0a692d 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) TOLUA_API int register_all_axis_controller_manual(lua_State* L); -#endif //#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_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 1c97a36492..eaacb1b4c6 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 AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION register_physics3d_module(L); #endif -#if AX_USE_NAVMESH +#if CC_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 be92f7d819..2601c1d0c9 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" -AX_LUA_DLL int lua_module_register(lua_State* L); +CC_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 803a551977..0110acaddb 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 AX_USE_NAVMESH +#if CC_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 cadc4143ad..db2a574f36 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 AX_USE_NAVMESH +#if CC_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 AX_USE_NAVMESH +#endif // #if CC_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 602d9554b2..ad027d2cfd 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 AX_USE_NAVMESH +#if CC_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 af664e1120..344be3c703 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 AX_USE_NAVMESH +#if CC_USE_NAVMESH #include "tolua++.h" @@ -47,5 +47,5 @@ TOLUA_API int register_navmesh_module(lua_State* L); // end group /// @} -#endif // #if AX_USE_NAVMESH +#endif // #if CC_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 f163ab04de..10ddd0a6ad 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(); - AX_SAFE_RELEASE_NULL(_httpRequest); + CC_SAFE_RELEASE_NULL(_httpRequest); } /** @@ -714,7 +714,7 @@ static int lua_get_XMLHttpRequest_response(lua_State* L) pStack->pushLuaValueArray(array); - AX_SAFE_DELETE_ARRAY(tmpData); + CC_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 1f5bb6b830..538949c5e2 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 AX_USE_PHYSICS +#if CC_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 AX_SAFE_DELETE_ARRAY +# ifndef CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createPolygon(arg0, arg1); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createPolygon(arg0, arg1, arg2); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createPolygon(arg0, arg1, arg2, arg3); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgePolygon(arg0, arg1); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgePolygon(arg0, arg1, arg2); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgePolygon(arg0, arg1, arg2, arg3); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgeChain(arg0, arg1); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgeChain(arg0, arg1, arg2); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgeChain(arg0, arg1, arg2, arg3); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShape::recenterPoints(arg0, arg1); vec2_array_to_luaval(tolua_S, arg0, arg1); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShape::recenterPoints(arg0, arg1, arg2); vec2_array_to_luaval(tolua_S, arg0, arg1); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::Vec2 ret = axis::PhysicsShape::getPolygonCenter(arg0, arg1); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapePolygon* ret = axis::PhysicsShapePolygon::create(arg0, arg1); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapePolygon* ret = axis::PhysicsShapePolygon::create(arg0, arg1, arg2); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapePolygon* ret = axis::PhysicsShapePolygon::create(arg0, arg1, arg2, arg3); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } double ret = axis::PhysicsShapePolygon::calculateArea(arg0, arg1); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg1); + CC_SAFE_DELETE_ARRAY(arg1); return 0; } double ret = axis::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2); - AX_SAFE_DELETE_ARRAY(arg1); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg1); + CC_SAFE_DELETE_ARRAY(arg1); return 0; } double ret = axis::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2, arg3); - AX_SAFE_DELETE_ARRAY(arg1); + CC_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); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgePolygon* ret = axis::PhysicsShapeEdgePolygon::create(arg0, arg1); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgePolygon* ret = axis::PhysicsShapeEdgePolygon::create(arg0, arg1, arg2); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgePolygon* ret = axis::PhysicsShapeEdgePolygon::create(arg0, arg1, arg2, arg3); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgeChain* ret = axis::PhysicsShapeEdgeChain::create(arg0, arg1); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgeChain* ret = axis::PhysicsShapeEdgeChain::create(arg0, arg1, arg2); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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) { - AX_SAFE_DELETE_ARRAY(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgeChain* ret = axis::PhysicsShapeEdgeChain::create(arg0, arg1, arg2, arg3); - AX_SAFE_DELETE_ARRAY(arg0); + CC_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 73603f7d34..1e7f814d9d 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 AX_USE_PHYSICS +#if CC_USE_PHYSICS #ifdef __cplusplus extern "C" { @@ -40,6 +40,6 @@ extern "C" { int register_all_axis_physics_manual(lua_State* tolua_S); -#endif // AX_USE_PHYSICS +#endif // CC_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 873346690a..19eb0e5db1 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 AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +#if CC_USE_3D_PHYSICS && CC_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 299002eb72..8a8e3b9383 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 AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION #include "tolua++.h" @@ -47,5 +47,5 @@ TOLUA_API int register_physics3d_module(lua_State* L); // end group /// @} -#endif // #if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +#endif // #if CC_USE_3D_PHYSICS && CC_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 861690190f..152eeda705 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) && !defined(AX_TARGET_OS_TVOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#elif CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) && !defined(AX_TARGET_OS_TVOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#elif CC_TARGET_PLATFORM == CC_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 7b4144746e..d8ba7cabd2 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 = '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.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.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 0bfc8f80f0..8d06f9403c 100644 --- a/extensions/scripting/lua-bindings/script/extension/ExtensionConstants.lua +++ b/extensions/scripting/lua-bindings/script/extension/ExtensionConstants.lua @@ -1,7 +1,3 @@ -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 d12666df15..014aa0e496 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 AX_DESIGN_RESOLUTION then - if AX_DESIGN_RESOLUTION.width then - width = AX_DESIGN_RESOLUTION.width + if CC_DESIGN_RESOLUTION then + if CC_DESIGN_RESOLUTION.width then + width = CC_DESIGN_RESOLUTION.width end - if AX_DESIGN_RESOLUTION.height then - height = AX_DESIGN_RESOLUTION.height + if CC_DESIGN_RESOLUTION.height then + height = CC_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(AX_DESIGN_RESOLUTION) == "table" then - display.setAutoScale(AX_DESIGN_RESOLUTION) +if type(CC_DESIGN_RESOLUTION) == "table" then + display.setAutoScale(CC_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 d5a53267fe..edf8ca9803 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 AX_DISABLE_GLOBAL then +if CC_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 842b306222..be4a4dc615 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 AX_USE_FRAMEWORK then +if CC_USE_FRAMEWORK then require "cocos.framework.init" end diff --git a/extensions/spine/SkeletonAnimation.h b/extensions/spine/SkeletonAnimation.h index 91bb19e182..6387c20a45 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 - AX_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale = 1) + CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale = 1) { return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlas, scale); } // Use createWithJsonFile instead - AX_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale = 1) + CC_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 531e7b46ac..9e5bdb395b 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++) { - AX_SAFE_RELEASE(_commandsPool[i]->getPipelineDescriptor().programState); + CC_SAFE_RELEASE(_commandsPool[i]->getPipelineDescriptor().programState); delete _commandsPool[i]; _commandsPool[i] = nullptr; } - AX_SAFE_RELEASE(_programState); + CC_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 - AX_SAFE_RELEASE(currentState); + CC_SAFE_RELEASE(currentState); currentState = programState->clone(); auto vertexLayout = currentState->getVertexLayout(); diff --git a/extensions/spine/SkeletonRenderer.cpp b/extensions/spine/SkeletonRenderer.cpp index ecde3e1168..9019cb47b0 100644 --- a/extensions/spine/SkeletonRenderer.cpp +++ b/extensions/spine/SkeletonRenderer.cpp @@ -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 AX_USE_CULLING +#if CC_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 AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if CC_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 AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if CC_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 abe9c369c6..fcdcbc6466 100644 --- a/extensions/spine/SkeletonTwoColorBatch.cpp +++ b/extensions/spine/SkeletonTwoColorBatch.cpp @@ -194,15 +194,15 @@ void TwoColorTrianglesCommand::updateCommandPipelineDescriptor(axis::backend::Pr if (programState != nullptr) { if (_programState != programState) { - AX_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_programState); _programState = programState; // Because the programState belong to Node, so no need to clone - AX_SAFE_RETAIN(_programState); + CC_SAFE_RETAIN(_programState); needsUpdateStateLayout = true; } } else { needsUpdateStateLayout = _programState != nullptr && _programState->getProgram() != __twoColorProgramState->getProgram(); - AX_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(_programState); _programState = __twoColorProgramState->clone(); } @@ -218,7 +218,7 @@ void TwoColorTrianglesCommand::updateCommandPipelineDescriptor(axis::backend::Pr TwoColorTrianglesCommand::~TwoColorTrianglesCommand() { - AX_SAFE_RELEASE_NULL(_programState); + CC_SAFE_RELEASE_NULL(_programState); } void TwoColorTrianglesCommand::generateMaterialID() { diff --git a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp index 4581fe3358..772a9af1ae 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(AX_CALLBACK_0(CrashTest::removeThis, this)), nullptr)); + CallFunc::create(CC_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(AX_CALLBACK_1(LogicTest::bugMe, this)), nullptr)); + CallFuncN::create(CC_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(AX_SCHEDULE_SELECTOR(PauseTest::unpause), 3); + schedule(CC_SCHEDULE_SELECTOR(PauseTest::unpause), 3); } void PauseTest::unpause(float dt) { - unschedule(AX_SCHEDULE_SELECTOR(PauseTest::unpause)); + unschedule(CC_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(AX_CALLBACK_0(StopActionTest::stopAction, this)); + auto pCallback = CallFunc::create(CC_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(AX_SCHEDULE_SELECTOR(ResumeTest::resumeGrossini), 3.0f); + this->schedule(CC_SCHEDULE_SELECTOR(ResumeTest::resumeGrossini), 3.0f); } void ResumeTest::resumeGrossini(float time) { - this->unschedule(AX_SCHEDULE_SELECTOR(ResumeTest::resumeGrossini)); + this->unschedule(CC_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 c5bd488149..8f87c0a626 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(AX_SCHEDULE_SELECTOR(SpriteEase::testStopAction), 6.25f); + schedule(CC_SCHEDULE_SELECTOR(SpriteEase::testStopAction), 6.25f); } void SpriteEase::testStopAction(float dt) { - unschedule(AX_SCHEDULE_SELECTOR(SpriteEase::testStopAction)); + unschedule(CC_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(AX_SCHEDULE_SELECTOR(SpeedTest::altertime), 1.0f); //:@selector(altertime:) interval:1.0f]; + this->schedule(CC_SCHEDULE_SELECTOR(SpeedTest::altertime), 1.0f); //:@selector(altertime:) interval:1.0f]; } void SpeedTest::altertime(float dt) diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp index 7b1b1415df..c8a5fefa31 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(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); + 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); _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(AX_CALLBACK_1(ActionCallFuncN::callback, this)), nullptr); + CallFuncN::create(CC_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(AX_CALLBACK_1(ActionCallFuncND::doRemoveFromParentAndCleanup, this, true)), nullptr); + CallFuncN::create(CC_CALLBACK_1(ActionCallFuncND::doRemoveFromParentAndCleanup, this, true)), nullptr); _grossini->runAction(action); } @@ -1371,7 +1371,7 @@ void ActionStacked::onEnter() this->centerSprites(0); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = AX_CALLBACK_2(ActionStacked::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(ActionStacked::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); diff --git a/tests/cpp-tests/Classes/AppDelegate.cpp b/tests/cpp-tests/Classes/AppDelegate.cpp index e3fe4149e3..666b3b77b3 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 AX_PLATFORM_PC +#ifdef CC_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 86e77670a1..bb5434a283 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 = AX_CALLBACK_1(TestCustomTableView::onMouseScroll, this); + mouseListener->onMouseScroll = CC_CALLBACK_1(TestCustomTableView::onMouseScroll, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(mouseListener, this); } }; @@ -133,7 +133,7 @@ void TestList::deatchTableView() { if (_tableView) _tableView->setDataSource(nullptr); - AX_SAFE_RELEASE_NULL(_tableView); + CC_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(AX_PLATFORM_PC) +#if defined(CC_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, AX_CALLBACK_1(TestCase::priorTestCallback, this)); + _priorTestItem = MenuItemImage::create(s_pathB1, s_pathB2, CC_CALLBACK_1(TestCase::priorTestCallback, this)); _restartTestItem = - 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)); + 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)); ttfConfig.fontSize = 20; auto backLabel = Label::createWithTTF(ttfConfig, "Back"); - auto backItem = MenuItemLabel::create(backLabel, AX_CALLBACK_1(TestCase::onBackCallback, this)); + auto backItem = MenuItemLabel::create(backLabel, CC_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 b91c240b8c..9be5cdae41 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 = AX_CALLBACK_2(BillBoardTest::onTouchesMoved, this); + listener->onTouchesMoved = CC_CALLBACK_2(BillBoardTest::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto layer3D = Layer::create(); @@ -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, AX_CALLBACK_1(BillBoardTest::rotateCameraCallback, this, 10)); + auto menuItem1 = MenuItemLabel::create(label1, CC_CALLBACK_1(BillBoardTest::rotateCameraCallback, this, 10)); auto label2 = Label::createWithTTF(ttfConfig, "rotate-"); - auto menuItem2 = MenuItemLabel::create(label2, AX_CALLBACK_1(BillBoardTest::rotateCameraCallback, this, -10)); + auto menuItem2 = MenuItemLabel::create(label2, CC_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, AX_CALLBACK_1(BillBoardTest::menuCallback_orientedPoint, this)); + menuItem1 = MenuItemLabel::create(label1, CC_CALLBACK_1(BillBoardTest::menuCallback_orientedPoint, this)); label2 = Label::createWithTTF(ttfConfig, "Plane Oriented"); - menuItem2 = MenuItemLabel::create(label2, AX_CALLBACK_1(BillBoardTest::menuCallback_orientedPlane, this)); + menuItem2 = MenuItemLabel::create(label2, CC_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(AX_SCHEDULE_SELECTOR(BillBoardTest::update)); + schedule(CC_SCHEDULE_SELECTOR(BillBoardTest::update)); } void BillBoardTest::menuCallback_orientedPoint(Ref* sender) diff --git a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp index 7a01db484a..e4a26ac934 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 = AX_CALLBACK_2(Box2DTest::onTouchesEnded, this); + touchListener->onTouchesEnded = CC_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", AX_CALLBACK_1(Box2DTest::toggleDebugCallback, this)); + auto item = MenuItemFont::create("Toggle debug", CC_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() { - AX_SAFE_DELETE(world); + CC_SAFE_DELETE(world); } void Box2DTest::toggleDebugCallback(Ref* sender) diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp b/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp index 373c9c6986..90df124323 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 = AX_CALLBACK_2(Box2DTestBed::onTouchBegan, this); - _touchListener->onTouchMoved = AX_CALLBACK_2(Box2DTestBed::onTouchMoved, this); - _touchListener->onTouchEnded = AX_CALLBACK_2(Box2DTestBed::onTouchEnded, this); + _touchListener->onTouchBegan = CC_CALLBACK_2(Box2DTestBed::onTouchBegan, this); + _touchListener->onTouchMoved = CC_CALLBACK_2(Box2DTestBed::onTouchMoved, this); + _touchListener->onTouchEnded = CC_CALLBACK_2(Box2DTestBed::onTouchEnded, this); TestCase::_eventDispatcher->addEventListenerWithFixedPriority(_touchListener, 10); // Adds Keyboard event listener _keyboardListener = EventListenerKeyboard::create(); - _keyboardListener->onKeyPressed = AX_CALLBACK_2(Box2DTestBed::onKeyPressed, this); - _keyboardListener->onKeyReleased = AX_CALLBACK_2(Box2DTestBed::onKeyReleased, this); + _keyboardListener->onKeyPressed = CC_CALLBACK_2(Box2DTestBed::onKeyPressed, this); + _keyboardListener->onKeyReleased = CC_CALLBACK_2(Box2DTestBed::onKeyReleased, this); TestCase::_eventDispatcher->addEventListenerWithFixedPriority(_keyboardListener, 11); auto _mouseListener = EventListenerMouse::create(); - _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); + _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); TestCase::_eventDispatcher->addEventListenerWithFixedPriority(_mouseListener, 12); // Demo messageString @@ -237,7 +237,7 @@ void Box2DTestBed::onEnter() { Scene::onEnter(); ImGuiPresenter::getInstance()->addFont(FileUtils::getInstance()->fullPathForFilename("fonts/arial.ttf")); - ImGuiPresenter::getInstance()->addRenderLoop("#im01", AX_CALLBACK_0(Box2DTestBed::onDrawImGui, this), this); + ImGuiPresenter::getInstance()->addRenderLoop("#im01", CC_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 5ca3c4105d..51f47aa572 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(AX_PLATFORM_PC) +#if defined(CC_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(AX_PLATFORM_PC) +#if defined(CC_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(AX_PLATFORM_PC) +#if defined(CC_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 fe3184671b..bc42f7feac 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), - AX_CALLBACK_1(Bug1159Layer::callBack, this)); + CC_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-14327.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-14327.cpp index 9bd9a32cb2..54ba591e62 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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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 6c8e7c7ca0..9a19f0effc 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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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 6f07a7adb1..bc2d41fed1 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp @@ -57,9 +57,9 @@ void Bug422Layer::reset() removeChild(node, true); // [self removeChildByTag:localtag-1 cleanup:NO]; - auto item1 = MenuItemFont::create("One", AX_CALLBACK_1(Bug422Layer::menuCallback, this)); + auto item1 = MenuItemFont::create("One", CC_CALLBACK_1(Bug422Layer::menuCallback, this)); log("MenuItemFont: %p", item1); - MenuItem* item2 = MenuItemFont::create("Two", AX_CALLBACK_1(Bug422Layer::menuCallback, this)); + MenuItem* item2 = MenuItemFont::create("Two", CC_CALLBACK_1(Bug422Layer::menuCallback, this)); auto menu = Menu::create(item1, item2, nullptr); menu->alignItemsVertically(); 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 1a7833fc0b..9630652967 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, AX_CALLBACK_1(Bug458Layer::selectAnswer, this)); + auto sprite = MenuItemSprite::create(question2, question, CC_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, AX_CALLBACK_1(Bug458Layer::selectAnswer, this)); + auto sprite2 = MenuItemSprite::create(layer, layer2, CC_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 7f2906674a..84d8466c23 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(AX_CALLBACK_2(Bug624Layer::onAcceleration, this)); + auto listener = EventListenerAcceleration::create(CC_CALLBACK_2(Bug624Layer::onAcceleration, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); - schedule(AX_SCHEDULE_SELECTOR(Bug624Layer::switchLayer), 5.0f); + schedule(CC_SCHEDULE_SELECTOR(Bug624Layer::switchLayer), 5.0f); return true; } @@ -65,7 +65,7 @@ bool Bug624Layer::init() void Bug624Layer::switchLayer(float dt) { - unschedule(AX_SCHEDULE_SELECTOR(Bug624Layer::switchLayer)); + unschedule(CC_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(AX_CALLBACK_2(Bug624Layer2::onAcceleration, this)); + auto listener = EventListenerAcceleration::create(CC_CALLBACK_2(Bug624Layer2::onAcceleration, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); - schedule(AX_SCHEDULE_SELECTOR(Bug624Layer2::switchLayer), 5.0f); + schedule(CC_SCHEDULE_SELECTOR(Bug624Layer2::switchLayer), 5.0f); return true; } @@ -111,7 +111,7 @@ bool Bug624Layer2::init() void Bug624Layer2::switchLayer(float dt) { - unschedule(AX_SCHEDULE_SELECTOR(Bug624Layer::switchLayer)); + unschedule(CC_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 5742affbef..971785f289 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 = AX_CALLBACK_2(Bug914Layer::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(Bug914Layer::onTouchesMoved, this); + listener->onTouchesBegan = CC_CALLBACK_2(Bug914Layer::onTouchesBegan, this); + listener->onTouchesMoved = CC_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", AX_CALLBACK_1(Bug914Layer::restart, this)); + auto item1 = MenuItemFont::create("restart", CC_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 ccb5a4d67c..dfe20001f0 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", AX_CALLBACK_1(BugChild::switchChild, this)); + auto item1 = MenuItemFont::create("Switch Child", CC_CALLBACK_1(BugChild::switchChild, this)); menu = Menu::create(item1, nullptr); @@ -104,7 +104,7 @@ bool BugCameraMask::init() camera->setCameraFlag(CameraFlag::USER1); addChild(camera); - auto item1 = MenuItemFont::create("Switch Child", AX_CALLBACK_1(BugCameraMask::switchSpriteFlag, this)); + auto item1 = MenuItemFont::create("Switch Child", CC_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 c056deed95..bae480c537 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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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 16e1d38949..c86e6b3345 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(AX_SCHEDULE_SELECTOR(CameraRotationTest::update)); + schedule(CC_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 = AX_CALLBACK_2(Camera3DTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(Camera3DTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(Camera3DTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = CC_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 = AX_CALLBACK_2(Camera3DTestDemo::onTouchesZoomOut, this); - listener1->onTouchEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesZoomOutEnd, this); + listener1->onTouchBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesZoomOut, this); + listener1->onTouchEnded = CC_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 = AX_CALLBACK_2(Camera3DTestDemo::onTouchesZoomIn, this); - listener2->onTouchEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesZoomInEnd, this); + listener2->onTouchBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesZoomIn, this); + listener2->onTouchEnded = CC_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 = AX_CALLBACK_2(Camera3DTestDemo::onTouchesRotateLeft, this); - listener3->onTouchEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesRotateLeftEnd, this); + listener3->onTouchBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesRotateLeft, this); + listener3->onTouchEnded = CC_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 = AX_CALLBACK_2(Camera3DTestDemo::onTouchesRotateRight, this); - listener4->onTouchEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesRotateRightEnd, this); + listener4->onTouchBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesRotateRight, this); + listener4->onTouchEnded = CC_CALLBACK_2(Camera3DTestDemo::onTouchesRotateRightEnd, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener4, _RotateRightlabel); auto label1 = Label::createWithTTF(ttfConfig, "free "); auto menuItem1 = - MenuItemLabel::create(label1, AX_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::Free)); + MenuItemLabel::create(label1, CC_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::Free)); auto label2 = Label::createWithTTF(ttfConfig, "third person"); auto menuItem2 = MenuItemLabel::create( - label2, AX_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::ThirdPerson)); + label2, CC_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::ThirdPerson)); auto label3 = Label::createWithTTF(ttfConfig, "first person"); auto menuItem3 = MenuItemLabel::create( - label3, AX_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::FirstPerson)); + label3, CC_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(AX_SCHEDULE_SELECTOR(Camera3DTestDemo::updateCamera), 0.0f); + schedule(CC_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(AX_SCHEDULE_SELECTOR(CameraCullingDemo::update), 0.0f); + schedule(CC_SCHEDULE_SELECTOR(CameraCullingDemo::update), 0.0f); auto s = Director::getInstance()->getWinSize(); /*auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = AX_CALLBACK_2(Camera3DTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(Camera3DTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(Camera3DTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = CC_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", AX_CALLBACK_1(CameraCullingDemo::switchViewCallback, this)); + auto menuItem1 = MenuItemFont::create("Switch Camera", CC_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(" - ", AX_CALLBACK_1(CameraCullingDemo::delMeshCallback, this)); + auto decrease = MenuItemFont::create(" - ", CC_CALLBACK_1(CameraCullingDemo::delMeshCallback, this)); decrease->setColor(Color3B(0, 200, 20)); - auto increase = MenuItemFont::create(" + ", AX_CALLBACK_1(CameraCullingDemo::addMeshCallback, this)); + auto increase = MenuItemFont::create(" + ", CC_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(AX_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr); + CallFunc::create(CC_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(AX_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr); + _moveAction, CallFunc::create(CC_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(AX_SCHEDULE_SELECTOR(CameraArcBallDemo::update), 0.0f); + schedule(CC_SCHEDULE_SELECTOR(CameraArcBallDemo::update), 0.0f); auto s = Director::getInstance()->getWinSize(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = AX_CALLBACK_2(CameraArcBallDemo::onTouchsMoved, this); + listener->onTouchesMoved = CC_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", AX_CALLBACK_1(CameraArcBallDemo::switchOperateCallback, this)); + MenuItemFont::create("Switch Operation", CC_CALLBACK_1(CameraArcBallDemo::switchOperateCallback, this)); menuItem1->setColor(Color3B(0, 200, 20)); auto menuItem2 = - MenuItemFont::create("Switch Target", AX_CALLBACK_1(CameraArcBallDemo::switchTargetCallback, this)); + MenuItemFont::create("Switch Target", CC_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() { - AX_SAFE_RELEASE_NULL(_programState1); - AX_SAFE_RELEASE_NULL(_programState2); + CC_SAFE_RELEASE_NULL(_programState1); + CC_SAFE_RELEASE_NULL(_programState2); } std::string FogTestDemo::title() const @@ -1220,23 +1220,23 @@ std::string FogTestDemo::title() const void FogTestDemo::onEnter() { CameraBaseTest::onEnter(); - schedule(AX_SCHEDULE_SELECTOR(FogTestDemo::update), 0.0f); + schedule(CC_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 = AX_CALLBACK_2(FogTestDemo::onTouchesMoved, this); + listener->onTouchesMoved = CC_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, AX_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 0)); + auto menuItem1 = MenuItemLabel::create(label1, CC_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 0)); auto label2 = Label::createWithTTF(ttfConfig, "Exp"); - auto menuItem2 = MenuItemLabel::create(label2, AX_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 1)); + auto menuItem2 = MenuItemLabel::create(label2, CC_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 1)); auto label3 = Label::createWithTTF(ttfConfig, "Exp2"); - auto menuItem3 = MenuItemLabel::create(label3, AX_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 2)); + auto menuItem3 = MenuItemLabel::create(label3, CC_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; - AX_SAFE_RELEASE_NULL(_programState1); - AX_SAFE_RELEASE_NULL(_programState2); + CC_SAFE_RELEASE_NULL(_programState1); + CC_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); - AX_SAFE_RELEASE(program); + CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { Director::getInstance()->setClearColor(Color4F(0.5, 0.5, 0.5, 1)); - AX_SAFE_RELEASE_NULL(_programState1); - AX_SAFE_RELEASE_NULL(_programState2); + CC_SAFE_RELEASE_NULL(_programState1); + CC_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); - AX_SAFE_RELEASE(program); + CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 c8100672c4..223ceeeacf 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 ec361c00bd..7c8fdedabe 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 = AX_CALLBACK_2(ChipmunkTest::onTouchesEnded, this); + touchListener->onTouchesEnded = CC_CALLBACK_2(ChipmunkTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); Device::setAccelerometerEnabled(true); - auto accListener = EventListenerAcceleration::create(AX_CALLBACK_2(ChipmunkTest::onAcceleration, this)); + auto accListener = EventListenerAcceleration::create(CC_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", AX_CALLBACK_1(ChipmunkTest::toggleDebugCallback, this)); + auto item = MenuItemFont::create("Toggle debug", CC_CALLBACK_1(ChipmunkTest::toggleDebugCallback, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -110,7 +110,7 @@ ChipmunkTest::~ChipmunkTest() cpShapeFree(_walls[i]); } -#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 cpSpaceFree(_space); #else cpHastySpaceFree(_space); @@ -125,7 +125,7 @@ void ChipmunkTest::initPhysics() // init chipmunk // cpInitChipmunk(); -#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 _space = cpSpaceNew(); #else _space = cpHastySpaceNew(); @@ -179,7 +179,7 @@ void ChipmunkTest::update(float delta) for (int i = 0; i < steps; i++) { -#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#if CC_TARGET_PLATFORM == CC_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", AX_CALLBACK_1(ChipmunkTest::reset, this)); + auto reset = MenuItemImage::create("Images/r1.png", "Images/r2.png", CC_CALLBACK_1(ChipmunkTest::reset, this)); auto menu = Menu::create(reset, nullptr); diff --git a/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp b/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp index 103b0ffeb8..402d0844e5 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, AX_DEGREES_TO_RADIANS(90), 50, true, 1.0f, + drawCP->drawCircle(Vec2(pos.x, pos.y) + physicsDebugNodeOffset, 100, CC_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 = AX_CALLBACK_1(ChipmunkTestBed::onMouseMove, this); - _mouseListener->onMouseUp = AX_CALLBACK_1(ChipmunkTestBed::onMouseUp, this); - _mouseListener->onMouseDown = AX_CALLBACK_1(ChipmunkTestBed::onMouseDown, this); + _mouseListener->onMouseMove = CC_CALLBACK_1(ChipmunkTestBed::onMouseMove, this); + _mouseListener->onMouseUp = CC_CALLBACK_1(ChipmunkTestBed::onMouseUp, this); + _mouseListener->onMouseDown = CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 + //#if CC_TARGET_PLATFORM == CC_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", AX_CALLBACK_1(ChipmunkTestBed::reset, this)); + auto reset = MenuItemImage::create("Images/r1.png", "Images/r2.png", CC_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/ClickAndMoveTest/ClickAndMoveTest.cpp b/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp index a5d070819e..38190cf496 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 = AX_CALLBACK_2(ClickAndMoveTestCase::onTouchBegan, this); - listener->onTouchEnded = AX_CALLBACK_2(ClickAndMoveTestCase::onTouchEnded, this); + listener->onTouchBegan = CC_CALLBACK_2(ClickAndMoveTestCase::onTouchBegan, this); + listener->onTouchEnded = CC_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)AX_RADIANS_TO_DEGREES(atanf(o / a)); + float at = (float)CC_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 a8b23be490..a09c4b9a57 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() { - AX_SAFE_RELEASE(_outerClipper); - AX_SAFE_RELEASE(_holes); - AX_SAFE_RELEASE(_holesStencil); + CC_SAFE_RELEASE(_outerClipper); + CC_SAFE_RELEASE(_holes); + CC_SAFE_RELEASE(_holesStencil); } std::string HoleDemo::title() const @@ -396,7 +396,7 @@ void HoleDemo::setup() this->addChild(_outerClipper); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = AX_CALLBACK_2(HoleDemo::onTouchesBegan, this); + listener->onTouchesBegan = CC_CALLBACK_2(HoleDemo::onTouchesBegan, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -474,9 +474,9 @@ void ScrollViewDemo::setup() _scrolling = false; auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = AX_CALLBACK_2(ScrollViewDemo::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(ScrollViewDemo::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(ScrollViewDemo::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(ScrollViewDemo::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(ScrollViewDemo::onTouchesMoved, this); + listener->onTouchesEnded = CC_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(AX_CALLBACK_0(RawStencilBufferTest::onBeforeDrawClip, this, i)); + cmd.setBeforeCallback(CC_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(AX_CALLBACK_0(RawStencilBufferTest::onBeforeDrawSprite, this, i)); + cmd2.setBeforeCallback(CC_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)); diff --git a/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp b/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp index 8734ad3543..230da0f134 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 (AX_TARGET_PLATFORM != AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) # include # include # include @@ -145,7 +145,7 @@ void ConsoleUploadFile::uploadFile() hints.ai_flags = 0; hints.ai_protocol = 0; /* Any protocol */ -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) WSADATA wsaData; WSAStartup(MAKEWORD(2, 2), &wsaData); #endif @@ -177,7 +177,7 @@ void ConsoleUploadFile::uploadFile() if (connect(sfd, rp->ai_addr, rp->ai_addrlen) != -1) break; /* Success */ -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) closesocket(sfd); #else close(sfd); @@ -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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_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 acb93afa81..503665ec2b 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: - AX_DISALLOW_COPY_AND_ASSIGN(ConsoleCustomCommand); + CC_DISALLOW_COPY_AND_ASSIGN(ConsoleCustomCommand); }; class ConsoleUploadFile : public BaseTestConsole @@ -74,7 +74,7 @@ protected: void uploadFile(); private: - AX_DISALLOW_COPY_AND_ASSIGN(ConsoleUploadFile); + CC_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 f98c3cd193..6e150b9e5b 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 = AX_CALLBACK_2(CurlTest::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(CurlTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // create a label to display the tip string diff --git a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp index 52da2fb8b2..477fb6eb23 100644 --- a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp +++ b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp @@ -69,10 +69,10 @@ DrawNodeTest::DrawNodeTest() Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); // draw a circle - draw->drawCircle(VisibleRect::center() + Vec2(140, 0), 100, AX_DEGREES_TO_RADIANS(90), 50, true, 1.0f, 2.0f, + draw->drawCircle(VisibleRect::center() + Vec2(140, 0), 100, CC_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, AX_DEGREES_TO_RADIANS(90), 30, false, + 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 some beziers @@ -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, AX_DEGREES_TO_RADIANS(90), 50, 2.0f, 2.0f, + draw->drawSolidCircle(VisibleRect::center() + Vec2(140.0f, 0.0f), 40, CC_DEGREES_TO_RADIANS(90), 50, 2.0f, 2.0f, Color4F(0.0f, 1.0f, 0.0f, 1.0f)); // Draw segment @@ -222,10 +222,10 @@ Issue11942Test::Issue11942Test() // draw a circle draw->setLineWidth(1); - draw->drawCircle(VisibleRect::center() - Vec2(140.0f, 0.0f), 50, AX_DEGREES_TO_RADIANS(90), 30, false, + 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->setLineWidth(10); - draw->drawCircle(VisibleRect::center() + Vec2(140.0f, 0.0f), 50, AX_DEGREES_TO_RADIANS(90), 30, false, + 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)); } diff --git a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp index b6fc9eae92..2d3fb4896d 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(AX_SCHEDULE_SELECTOR(EffectBaseTest::checkAnim)); + schedule(CC_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 661ec440b0..898bb25b72 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, AX_CALLBACK_1(AssetsManagerExLoaderScene::startDownloadCallback, this)); + MenuItemLabel::create(downloadLabel, CC_CALLBACK_1(AssetsManagerExLoaderScene::startDownloadCallback, this)); downloadItem->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y + 100)); _downloadMenu = Menu::create(downloadItem, nullptr); _downloadMenu->setPosition(Vec2::ZERO); diff --git a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp index a1165fb1d8..5c7feffd64 100644 --- a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp +++ b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp @@ -164,7 +164,7 @@ void TestSearchPath::onEnter() } // FIXME: should fix the issue on Android -#if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) // Save old resource root path std::string oldDefaultRootPath = sharedFileUtils->getDefaultResourceRootPath(); diff --git a/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.cpp b/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.cpp index dc047adafd..5f9327e680 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(AX_PLATFORM_PC) +#if defined(CC_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", AX_CALLBACK_0(ImGuiTest::onDrawImGui, this), this); + ImGuiPresenter::getInstance()->addRenderLoop("#test", CC_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 e7963c295b..35619b777d 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(AX_PLATFORM_PC) +#if defined(CC_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 acca7e7fed..bbea5819c0 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 = 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); + _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); _eventDispatcher->addEventListenerWithSceneGraphPriority(_mouseListener, this); } diff --git a/tests/cpp-tests/Classes/JNITest/JNITest.cpp b/tests/cpp-tests/Classes/JNITest/JNITest.cpp index ceeffda90b..c7391063c6 100644 --- a/tests/cpp-tests/Classes/JNITest/JNITest.cpp +++ b/tests/cpp-tests/Classes/JNITest/JNITest.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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)); - AX_ASSERT(b1 == true); + CC_ASSERT(b1 == true); bool b2 = JniHelper::callStaticBooleanMethod(classPath, "booleanMethod", int(-3)); - AX_ASSERT(b2 == false); + CC_ASSERT(b2 == false); int i = JniHelper::callStaticIntMethod(classPath, "intMethod", int(10), int(10)); - AX_ASSERT(i == 20); + CC_ASSERT(i == 20); float f = JniHelper::callStaticFloatMethod(classPath, "floatMethod", float(2.35), float(7.65)); - AX_ASSERT(f == 10.0); + CC_ASSERT(f == 10.0); double d = JniHelper::callStaticDoubleMethod(classPath, "doubleMethod", double(2.5), int(4)); - AX_ASSERT(d == 10.0); + CC_ASSERT(d == 10.0); std::string str = "ABCDEF"; std::string s1 = JniHelper::callStaticStringMethod(classPath, "stringMethod", str, true); - AX_ASSERT(s1 == "FEDCBA"); + CC_ASSERT(s1 == "FEDCBA"); std::string s2 = JniHelper::callStaticStringMethod(classPath, "stringMethod", str, false); - AX_ASSERT(s2 == "ABCDEF"); + CC_ASSERT(s2 == "ABCDEF"); const char* cstr = "XYZ"; std::string s3 = JniHelper::callStaticStringMethod(classPath, "stringMethod", cstr, true); - AX_ASSERT(s3 == "ZYX"); + CC_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 530065bcb6..c89cc8f8a6 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 b15facf5ab..b484b50344 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(AX_CALLBACK_1(LabelFNTColorAndOpacity::step, this), "step_key"); + schedule(CC_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(AX_CALLBACK_1(LabelFNTSpriteActions::step, this), 0.1f, "step_key"); + schedule(CC_CALLBACK_1(LabelFNTSpriteActions::step, this), 0.1f, "step_key"); } void LabelFNTSpriteActions::step(float dt) @@ -473,7 +473,7 @@ LabelFNTandTTFEmpty::LabelFNTandTTFEmpty() addChild(label3, 0, kTagBitmapAtlas3); label3->setPosition(Vec2(s.width / 2, 100.0f)); - schedule(AX_CALLBACK_1(LabelFNTandTTFEmpty::updateStrings, this), 1.0f, "update_strings_key"); + schedule(CC_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 = AX_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesMoved, this); + listener->onTouchesEnded = CC_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", AX_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); + MenuItemFont::create("Long Flowing Sentences", CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); auto lineBreaks = MenuItemFont::create("Short Sentences With Intentional Line Breaks", - AX_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); + CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); auto mixed = MenuItemFont::create("Long Sentences Mixed With Intentional Line Breaks", - AX_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); + CC_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", 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 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 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", 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); + 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); 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(AX_CALLBACK_2(LabelShadowTest::sliderEvent, this)); + slider->addEventListener(CC_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(AX_CALLBACK_2(LabelShadowTest::sliderEvent, this)); + slider2->addEventListener(CC_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(AX_CALLBACK_1(LabelCharMapTest::step, this), "step_key"); + schedule(CC_CALLBACK_1(LabelCharMapTest::step, this), "step_key"); } void LabelCharMapTest::step(float dt) @@ -1513,14 +1513,14 @@ LabelCharMapColorTest::LabelCharMapColorTest() auto fade = FadeOut::create(1.0f); auto fade_in = fade->reverse(); - auto cb = CallFunc::create(AX_CALLBACK_0(LabelCharMapColorTest::actionFinishCallback, this)); + auto cb = CallFunc::create(CC_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(AX_CALLBACK_1(LabelCharMapColorTest::step, this), "step_key"); + schedule(CC_CALLBACK_1(LabelCharMapColorTest::step, this), "step_key"); } void LabelCharMapColorTest::actionFinishCallback() @@ -1661,16 +1661,16 @@ LabelAlignmentTest::LabelAlignmentTest() MenuItemFont::setFontSize(30); auto menu = Menu::create( - 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); + 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); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(50.0f, s.height / 2 - 20)); this->addChild(menu); - 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)), + 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)), 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(AX_CALLBACK_2(LabelLineHeightTest::sliderEvent, this)); + slider->addEventListener(CC_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(AX_CALLBACK_2(LabelAdditionalKerningTest::sliderEvent, this)); + slider->addEventListener(CC_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", 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); + 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); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(50.0f, size.height / 2 - 20)); this->addChild(menu); - 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)), + 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)), nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(size.width - 50, size.height / 2 - 20)); @@ -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(AX_CALLBACK_2(LabelToggleTypeTest::onChangedRadioButtonSelect, this)); + radioButton->addEventListener(CC_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(AX_CALLBACK_2(LabelSystemFontTest::onChangedRadioButtonSelect, this)); + radioButton->addEventListener(CC_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(AX_CALLBACK_2(LabelLocalizationTest::onChangedRadioButtonSelect, this)); + radioButton->addEventListener(CC_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(AX_CALLBACK_0(LabelIssue17902::purgeCachedData, this), 1.0f, "purge_cached_data"); + scheduleOnce(CC_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, AX_REPEAT_FOREVER, 0, "repeat"); + 1, CC_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 c3c0026b2c..9204a3e344 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 = AX_CALLBACK_2(LayerTest1::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(LayerTest1::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(LayerTest1::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(LayerTest1::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(LayerTest1::onTouchesMoved, this); + listener->onTouchesEnded = CC_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(AX_SCHEDULE_SELECTOR(LayerTestBlend::newBlend), 1.0f); + schedule(CC_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 = AX_CALLBACK_2(LayerGradientTest::onTouchesMoved, this); + listener->onTouchesMoved = CC_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(AX_CALLBACK_1(LayerGradientTest::toggleItem, this), item1, item2, nullptr); + MenuItemToggle::createWithCallback(CC_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", AX_CALLBACK_1(LayerIgnoreAnchorPointPos::onToggle, this)); + MenuItemFont::create("Toggle ignore anchor point", CC_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", AX_CALLBACK_1(LayerIgnoreAnchorPointRot::onToggle, this)); + MenuItemFont::create("Toggle ignore anchor point", CC_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", AX_CALLBACK_1(LayerIgnoreAnchorPointScale::onToggle, this)); + MenuItemFont::create("Toggle ignore anchor point", CC_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(AX_SCHEDULE_SELECTOR(LayerBug3162A::step), 0.5, AX_REPEAT_FOREVER, 0); + schedule(CC_SCHEDULE_SELECTOR(LayerBug3162A::step), 0.5, CC_REPEAT_FOREVER, 0); } void LayerBug3162A::step(float dt) @@ -782,7 +782,7 @@ void LayerBug3162B::onEnter() _layer[1]->setCascadeColorEnabled(true); _layer[2]->setCascadeColorEnabled(true); - schedule(AX_SCHEDULE_SELECTOR(LayerBug3162B::step), 0.5, AX_REPEAT_FOREVER, 0); + schedule(CC_SCHEDULE_SELECTOR(LayerBug3162B::step), 0.5, CC_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(AX_CALLBACK_2(LayerRadialGradientTest::sliderCallback, this)); + slider->addEventListener(CC_CALLBACK_2(LayerRadialGradientTest::sliderCallback, this)); slider->setRotation(90); slider->setTag(101); slider->setPercent(50); @@ -980,7 +980,7 @@ axis::ui::ListView* LayerRadialGradientTest::createListView() listview->setCurSelectedIndex(0); listview->setTouchEnabled(true); listview->addEventListener( - (ui::ListView::ccListViewCallback)AX_CALLBACK_2(LayerRadialGradientTest::listviewCallback, this)); + (ui::ListView::ccListViewCallback)CC_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 a108e668f0..268acd7679 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, AX_CALLBACK_1(LightTest::SwitchLight, this, LightType::AMBIENT)); + MenuItemLabel::create(_ambientLightLabel, CC_CALLBACK_1(LightTest::SwitchLight, this, LightType::AMBIENT)); _directionalLightLabel = Label::createWithTTF(ttfConfig, "Directional Light OFF"); _directionalLightLabel->retain(); auto menuItem1 = MenuItemLabel::create(_directionalLightLabel, - AX_CALLBACK_1(LightTest::SwitchLight, this, LightType::DIRECTIONAL)); + CC_CALLBACK_1(LightTest::SwitchLight, this, LightType::DIRECTIONAL)); _pointLightLabel = Label::createWithTTF(ttfConfig, "Point Light OFF"); _pointLightLabel->retain(); auto menuItem2 = - MenuItemLabel::create(_pointLightLabel, AX_CALLBACK_1(LightTest::SwitchLight, this, LightType::POINT)); + MenuItemLabel::create(_pointLightLabel, CC_CALLBACK_1(LightTest::SwitchLight, this, LightType::POINT)); _spotLightLabel = Label::createWithTTF(ttfConfig, "Spot Light OFF"); _spotLightLabel->retain(); auto menuItem3 = - MenuItemLabel::create(_spotLightLabel, AX_CALLBACK_1(LightTest::SwitchLight, this, LightType::SPOT)); + MenuItemLabel::create(_spotLightLabel, CC_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, -AX_RADIANS_TO_DEGREES(angleDelta), 0.0f)); + _directionalLight->setRotation3D(Vec3(-45.0, -CC_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 c890335c57..57b8685a44 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(AX_SCHEDULE_SELECTOR(Material_2DEffects::updateCCTimeUniforms)); + schedule(CC_SCHEDULE_SELECTOR(Material_2DEffects::updateCCTimeUniforms)); // properties is not a "Ref" object - AX_SAFE_DELETE(properties); + CC_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, AX_CALLBACK_2(EffectAutoBindingResolver::callbackRadius, this)); + programState->setCallbackUniform(loc, CC_CALLBACK_2(EffectAutoBindingResolver::callbackRadius, this)); return true; } else if (autoBinding.compare("OUTLINE_COLOR") == 0) { auto loc = programState->getUniformLocation(uniform); - programState->setCallbackUniform(loc, AX_CALLBACK_2(EffectAutoBindingResolver::callbackColor, this)); + programState->setCallbackUniform(loc, CC_CALLBACK_2(EffectAutoBindingResolver::callbackColor, this)); return true; } return false; @@ -268,9 +268,9 @@ void Material_AutoBindings::onEnter() _noiseProgramState = meshNoise->getProgramState(); _locationTime = _noiseProgramState->getUniformLocation("u_Time"); - schedule(AX_SCHEDULE_SELECTOR(Material_AutoBindings::updateUniformTime)); + schedule(CC_SCHEDULE_SELECTOR(Material_AutoBindings::updateUniformTime)); // properties is not a "Ref" object - AX_SAFE_DELETE(properties); + CC_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(AX_CALLBACK_1(Material_setTechnique::changeMaterial, this), 1, "cookie"); + this->schedule(CC_CALLBACK_1(Material_setTechnique::changeMaterial, this), 1, "cookie"); _techniqueState = 0; auto rot = RotateBy::create(5, Vec3(30.0f, 60.0f, 270.0f)); diff --git a/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp b/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp index 49f541b0ce..06b20683d5 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 = 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); + _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); _eventDispatcher->addEventListenerWithFixedPriority(_touchListener, 1); // Font Item @@ -72,15 +72,15 @@ MenuLayerMainMenu::MenuLayerMainMenu() auto spriteDisabled = Sprite::create(s_MenuItem, Rect(0, 23 * 0, 115, 23)); auto item1 = MenuItemSprite::create(spriteNormal, spriteSelected, spriteDisabled, - AX_CALLBACK_1(MenuLayerMainMenu::menuCallback, this)); + CC_CALLBACK_1(MenuLayerMainMenu::menuCallback, this)); // Image Item auto item2 = - MenuItemImage::create(s_SendScore, s_PressSendScore, AX_CALLBACK_1(MenuLayerMainMenu::menuCallback2, this)); + MenuItemImage::create(s_SendScore, s_PressSendScore, CC_CALLBACK_1(MenuLayerMainMenu::menuCallback2, this)); // Label Item (LabelAtlas) auto labelAtlas = LabelAtlas::create("0123456789", "fonts/labelatlas.png", 16, 24, '.'); - auto item3 = MenuItemLabel::create(labelAtlas, AX_CALLBACK_1(MenuLayerMainMenu::menuCallbackDisabled, this)); + auto item3 = MenuItemLabel::create(labelAtlas, CC_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()); @@ -93,7 +93,7 @@ MenuLayerMainMenu::MenuLayerMainMenu() // Label Item (LabelBMFont) auto label = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", "configuration"); - auto item5 = MenuItemLabel::create(label, AX_CALLBACK_1(MenuLayerMainMenu::menuCallbackConfig, this)); + auto item5 = MenuItemLabel::create(label, CC_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", AX_CALLBACK_1(MenuLayerMainMenu::menuCallbackBugsTest, this)); + auto item6 = MenuItemFont::create("Bugs", CC_CALLBACK_1(MenuLayerMainMenu::menuCallbackBugsTest, this)); // Font Item - auto item7 = MenuItemFont::create("Quit", AX_CALLBACK_1(MenuLayerMainMenu::onQuit, this)); + auto item7 = MenuItemFont::create("Quit", CC_CALLBACK_1(MenuLayerMainMenu::onQuit, this)); auto item8 = MenuItemFont::create("Remove menu item when moving", - AX_CALLBACK_1(MenuLayerMainMenu::menuMovingCallback, this)); + CC_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(AX_SCHEDULE_SELECTOR(MenuLayerMainMenu::allowTouches), 5.0f); + schedule(CC_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, AX_CALLBACK_1(MenuLayer2::menuCallback, this)); + auto item1 = MenuItemImage::create(s_PlayNormal, s_PlaySelect, CC_CALLBACK_1(MenuLayer2::menuCallback, this)); auto item2 = - MenuItemImage::create(s_HighNormal, s_HighSelect, AX_CALLBACK_1(MenuLayer2::menuCallbackOpacity, this)); + MenuItemImage::create(s_HighNormal, s_HighSelect, CC_CALLBACK_1(MenuLayer2::menuCallbackOpacity, this)); auto item3 = - MenuItemImage::create(s_AboutNormal, s_AboutSelect, AX_CALLBACK_1(MenuLayer2::menuCallbackAlign, this)); + MenuItemImage::create(s_AboutNormal, s_AboutSelect, CC_CALLBACK_1(MenuLayer2::menuCallbackAlign, this)); item1->setScaleX(1.5f); item2->setScaleX(0.5f); @@ -387,7 +387,7 @@ MenuLayer4::MenuLayer4() title1->setEnabled(false); MenuItemFont::setFontName("fonts/Marker Felt.ttf"); MenuItemFont::setFontSize(34); - auto item1 = MenuItemToggle::createWithCallback(AX_CALLBACK_1(MenuLayer4::menuCallback, this), + auto item1 = MenuItemToggle::createWithCallback(CC_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(AX_CALLBACK_1(MenuLayer4::menuCallback, this), + auto item2 = MenuItemToggle::createWithCallback(CC_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(AX_CALLBACK_1(MenuLayer4::menuCallback, this), + auto item3 = MenuItemToggle::createWithCallback(CC_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(AX_CALLBACK_1(MenuLayer4::menuCallback, this), + auto item4 = MenuItemToggle::createWithCallback(CC_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, AX_CALLBACK_1(MenuLayer4::backCallback, this)); + auto back = MenuItemLabel::create(label, CC_CALLBACK_1(MenuLayer4::backCallback, this)); auto menu = Menu::create(title1, title2, item1, item2, title3, title4, item3, item4, back, nullptr); // 9 items. @@ -457,9 +457,9 @@ void MenuLayer4::backCallback(Ref* sender) // BugsTest BugsTest::BugsTest() { - 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 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 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", AX_CALLBACK_1(RemoveMenuItemWhenMove::goBack, this)); + auto back = MenuItemFont::create("go back", CC_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 = AX_CALLBACK_2(RemoveMenuItemWhenMove::onTouchBegan, this); - _touchListener->onTouchMoved = AX_CALLBACK_2(RemoveMenuItemWhenMove::onTouchMoved, this); + _touchListener->onTouchBegan = CC_CALLBACK_2(RemoveMenuItemWhenMove::onTouchBegan, this); + _touchListener->onTouchMoved = CC_CALLBACK_2(RemoveMenuItemWhenMove::onTouchMoved, this); _eventDispatcher->addEventListenerWithFixedPriority(_touchListener, -129); } @@ -529,7 +529,7 @@ void RemoveMenuItemWhenMove::goBack(Ref* pSender) RemoveMenuItemWhenMove::~RemoveMenuItemWhenMove() { _eventDispatcher->removeEventListener(_touchListener); - AX_SAFE_RELEASE(item); + CC_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 9355b455b7..8a4964a36f 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() { - AX_SAFE_RELEASE_NULL(_programStateLine); - AX_SAFE_DELETE(_depthstencilDescriptor); + CC_SAFE_RELEASE_NULL(_programStateLine); + CC_SAFE_DELETE(_depthstencilDescriptor); } DrawNode3D* DrawNode3D::create() @@ -47,7 +47,7 @@ DrawNode3D* DrawNode3D::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -79,8 +79,8 @@ bool DrawNode3D::init() _locMVPMatrix = _programStateLine->getUniformLocation("u_MVPMatrix"); - _customCommand.setBeforeCallback(AX_CALLBACK_0(DrawNode3D::onBeforeDraw, this)); - _customCommand.setAfterCallback(AX_CALLBACK_0(DrawNode3D::onAfterDraw, this)); + _customCommand.setBeforeCallback(CC_CALLBACK_0(DrawNode3D::onBeforeDraw, this)); + _customCommand.setAfterCallback(CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // Need to listen the event only when not use batchnode, because it will use VBO auto listener = EventListenerCustom::create(EVENT_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; - AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _bufferLines.size()); + CC_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 719f119f6c..df9e7c5102 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: - AX_DISALLOW_COPY_AND_ASSIGN(DrawNode3D); + CC_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 e9b4638ad4..435bb1104d 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 = AX_CALLBACK_2(MeshRendererBasicTest::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererBasicTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -258,9 +258,9 @@ MeshRendererUVAnimationTest::MeshRendererUVAnimationTest() cylinder->setRotation3D(Vec3(-90.0f, 0.0f, 0.0f)); // the callback function update cylinder's texcoord - schedule(AX_SCHEDULE_SELECTOR(MeshRendererUVAnimationTest::cylinderUpdate)); + schedule(CC_SCHEDULE_SELECTOR(MeshRendererUVAnimationTest::cylinderUpdate)); -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 = AX_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesMoved, this); + listener->onTouchesEnded = CC_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(AX_SCHEDULE_SELECTOR(MeshRendererFakeShadowTest::updateCamera), 0.0f); + schedule(CC_SCHEDULE_SELECTOR(MeshRendererFakeShadowTest::updateCamera), 0.0f); -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -564,7 +564,7 @@ MeshRendererBasicToonShaderTest::MeshRendererBasicToonShaderTest() addChild(teapot); addChild(_camera); setCameraMask(2); -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -620,7 +620,7 @@ MeshRendererLightMapTest::MeshRendererLightMapTest() // create a listener auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = AX_CALLBACK_2(MeshRendererLightMapTest::onTouchesMoved, this); + listener->onTouchesMoved = CC_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 = AX_CALLBACK_2(MeshRendererEffectTest::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererEffectTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -823,7 +823,7 @@ AsyncLoadMeshRendererTest::AsyncLoadMeshRendererTest() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "AsyncLoad MeshRenderer"); auto item1 = - MenuItemLabel::create(label1, AX_CALLBACK_1(AsyncLoadMeshRendererTest::menuCallback_asyncLoadMesh, this)); + MenuItemLabel::create(label1, CC_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, AX_CALLBACK_2(AsyncLoadMeshRendererTest::asyncLoad_Callback, this), (void*)index++); + MeshRenderer::createAsync(path, CC_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 = AX_CALLBACK_2(MeshRendererWithSkinTest::onTouchesEnded, this); + listener->onTouchesEnded = CC_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(), - AX_CALLBACK_1(MeshRendererWithSkinTest::switchAnimationQualityCallback, this)); + CC_CALLBACK_1(MeshRendererWithSkinTest::switchAnimationQualityCallback, this)); _menuItem->setColor(Color3B(0, 200, 20)); auto menu = Menu::create(_menuItem, NULL); menu->setPosition(Vec2::ZERO); @@ -987,13 +987,13 @@ void MeshRendererWithSkinTest::onTouchesEnded(const std::vector& touches MeshRendererWithSkinOutlineTest::MeshRendererWithSkinOutlineTest() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererWithSkinOutlineTest::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererWithSkinOutlineTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); addNewMeshWithCoords(Vec2(s.width / 2, s.height / 2)); -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -1073,7 +1073,7 @@ Animate3DTest::Animate3DTest() addMeshRenderer(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = AX_CALLBACK_2(Animate3DTest::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(Animate3DTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); scheduleUpdate(); @@ -1081,9 +1081,9 @@ Animate3DTest::Animate3DTest() Animate3DTest::~Animate3DTest() { - AX_SAFE_RELEASE(_moveAction); - AX_SAFE_RELEASE(_hurt); - AX_SAFE_RELEASE(_swim); + CC_SAFE_RELEASE(_moveAction); + CC_SAFE_RELEASE(_hurt); + CC_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(AX_CALLBACK_0(Animate3DTest::reachEndCallBack, this)), nullptr); + Sequence::create(_moveAction, CallFunc::create(CC_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(AX_CALLBACK_0(Animate3DTest::reachEndCallBack, this)), nullptr); + CallFunc::create(CC_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(AX_CALLBACK_0(Animate3DTest::renewCallBack, this)), nullptr); + delay, CallFunc::create(CC_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 = AX_CALLBACK_2(AttachmentTest::onTouchesEnded, this); + listener->onTouchesEnded = CC_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 = AX_CALLBACK_2(MeshRendererReskinTest::onTouchesEnded, this); + listener->onTouchesEnded = CC_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, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); auto label2 = Label::createWithTTF(ttfConfig, "Glasses"); - auto item2 = MenuItemLabel::create(label2, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item2 = MenuItemLabel::create(label2, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); auto label3 = Label::createWithTTF(ttfConfig, "Coat"); - auto item3 = MenuItemLabel::create(label3, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item3 = MenuItemLabel::create(label3, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); auto label4 = Label::createWithTTF(ttfConfig, "Pants"); - auto item4 = MenuItemLabel::create(label4, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item4 = MenuItemLabel::create(label4, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); auto label5 = Label::createWithTTF(ttfConfig, "Shoes"); - auto item5 = MenuItemLabel::create(label5, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item5 = MenuItemLabel::create(label5, CC_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 = AX_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesBegan, this); - listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesEnded, this); - listener->onTouchesMoved = AX_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesMoved, this); + listener->onTouchesBegan = CC_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesBegan, this); + listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesEnded, this); + listener->onTouchesMoved = CC_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(" - ", AX_CALLBACK_1(MeshRendererWithOBBPerformanceTest::delOBBCallback, this)); + auto decrease = MenuItemFont::create(" - ", CC_CALLBACK_1(MeshRendererWithOBBPerformanceTest::delOBBCallback, this)); decrease->setColor(Color3B(0, 200, 20)); - auto increase = MenuItemFont::create(" + ", AX_CALLBACK_1(MeshRendererWithOBBPerformanceTest::addOBBCallback, this)); + auto increase = MenuItemFont::create(" + ", CC_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(AX_CALLBACK_0(MeshRendererWithOBBPerformanceTest::reachEndCallBack, this)), nullptr); + _moveAction, CallFunc::create(CC_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(AX_CALLBACK_0(MeshRendererWithOBBPerformanceTest::reachEndCallBack, this)), + CallFunc::create(CC_CALLBACK_0(MeshRendererWithOBBPerformanceTest::reachEndCallBack, this)), nullptr); seq->setTag(100); _mesh->runAction(seq); @@ -1693,7 +1693,7 @@ void MeshRendererMirrorTest::addNewMeshWithCoords(Vec2 p) _mirrorMesh = mesh; } -QuaternionTest::QuaternionTest() : _arcSpeed(AX_DEGREES_TO_RADIANS(90)), _radius(100.f), _accAngle(0.f) +QuaternionTest::QuaternionTest() : _arcSpeed(CC_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, AX_CALLBACK_1(UseCaseMeshRenderer::menuCallback_Message, this)); + auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UseCaseMeshRenderer::menuCallback_Message, this)); auto label2 = Label::createWithTTF(ttfConfig, "Message"); - auto item2 = MenuItemLabel::create(label2, AX_CALLBACK_1(UseCaseMeshRenderer::menuCallback_Message, this)); + auto item2 = MenuItemLabel::create(label2, CC_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 * AX_DEGREES_TO_RADIANS(60); + accAngle += delta * CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 = AX_CALLBACK_2(MeshRendererCubeMapTest::onTouchesMoved, this); + listener->onTouchesMoved = CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { - AX_SAFE_RELEASE(_textureCube); + CC_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 -= AX_DEGREES_TO_RADIANS(delta.x); + _angle -= CC_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, AX_CALLBACK_1(Issue9767::menuCallback_SwitchShader, this)); + auto item1 = MenuItemLabel::create(label1, CC_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) { - AX_SAFE_RELEASE_NULL(_programState); + CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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, AX_CALLBACK_1(CameraBackgroundClearTest::switch_CameraClearMode, this)); + auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(CameraBackgroundClearTest::switch_CameraClearMode, this)); item1->setPosition(Vec2(VisibleRect::left().x + 50, VisibleRect::bottom().y + item1->getContentSize().height * 4)); @@ -2553,17 +2553,17 @@ MeshRendererPropertyTest::MeshRendererPropertyTest() setCameraMask(2); // auto listener = EventListenerTouchAllAtOnce::create(); - ////listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererReskinTest::onTouchesEnded, this); + ////listener->onTouchesEnded = CC_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, AX_CALLBACK_1(MeshRendererPropertyTest::printMeshName, this)); + auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(MeshRendererPropertyTest::printMeshName, this)); auto label2 = Label::createWithTTF(ttfConfig, "Remove Used Texture"); - auto item2 = MenuItemLabel::create(label2, AX_CALLBACK_1(MeshRendererPropertyTest::removeUsedTexture, this)); + auto item2 = MenuItemLabel::create(label2, CC_CALLBACK_1(MeshRendererPropertyTest::removeUsedTexture, this)); auto label3 = Label::createWithTTF(ttfConfig, "Reset"); - auto item3 = MenuItemLabel::create(label3, AX_CALLBACK_1(MeshRendererPropertyTest::resetTexture, this)); + auto item3 = MenuItemLabel::create(label3, CC_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)); diff --git a/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h b/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h index 5c0ccbb6ee..f06cef6c74 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -132,7 +132,7 @@ private: axis::MeshRenderer* _orc; axis::backend::ProgramState* _state = nullptr; -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -163,7 +163,7 @@ public: protected: axis::backend::ProgramState* _state; -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -193,7 +193,7 @@ public: protected: std::vector _meshes; -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -252,7 +252,7 @@ public: protected: std::vector _meshes; -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -486,7 +486,7 @@ protected: axis::MeshRenderer* _teapot; axis::Camera* _camera; -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -565,7 +565,7 @@ public: protected: axis::MeshRenderer* _mesh; -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 a1ba0ab326..b3b2bb7df6 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(AX_SCHEDULE_SELECTOR(MotionStreakTest1::onUpdate)); + schedule(CC_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 = AX_CALLBACK_2(MotionStreakTest2::onTouchesMoved, this); + listener->onTouchesMoved = CC_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(AX_SCHEDULE_SELECTOR(Issue1358::update), 0); + schedule(CC_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 * AX_DEGREES_TO_RADIANS(outer->getRotation() + 90.0f)), - outer->getPositionY() + length * sinf(-1 * AX_DEGREES_TO_RADIANS(outer->getRotation() + 90.0f))); + 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))); _streak->setPosition(position); }; - outer->schedule(updateMotionStreak, 1 / 240.0f, AX_REPEAT_FOREVER, 0, "motion1scheduler"); + outer->schedule(updateMotionStreak, 1 / 240.0f, CC_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(AX_CALLBACK_1(MotionStreakTest::modeCallback, this), + auto itemMode = MenuItemToggle::createWithCallback(CC_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 7cd9ed6f79..d08cae63bf 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 = AX_CALLBACK_2(MultiTouchTest::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(MultiTouchTest::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(MultiTouchTest::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(MultiTouchTest::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(MultiTouchTest::onTouchesMoved, this); + listener->onTouchesEnded = CC_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 26976152f6..27651c7f13 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 (AX_USE_NAVMESH == 0) || (AX_USE_PHYSICS == 0) +#if (CC_USE_NAVMESH == 0) || (CC_USE_PHYSICS == 0) ADD_TEST_CASE(NavMeshDisabled); #else ADD_TEST_CASE(NavMeshBasicTestDemo); @@ -48,12 +48,12 @@ NavMeshTests::NavMeshTests() #endif }; -#if (AX_USE_NAVMESH == 0) || (AX_USE_PHYSICS == 0) +#if (CC_USE_NAVMESH == 0) || (CC_USE_PHYSICS == 0) void NavMeshDisabled::onEnter() { TTFConfig ttfConfig("fonts/arial.ttf", 16); auto label = - Label::createWithTTF(ttfConfig, "Should define AX_USE_NAVMESH & AX_USE_PHYSICS\n to run this test case"); + Label::createWithTTF(ttfConfig, "Should define CC_USE_NAVMESH & CC_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 = AX_CALLBACK_2(NavMeshBaseTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(NavMeshBaseTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(NavMeshBaseTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(NavMeshBaseTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(NavMeshBaseTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = CC_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 -= AX_DEGREES_TO_RADIANS(delta.x); + _angle -= CC_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 5bcfcb28ae..83f138ee4d 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 (AX_USE_NAVMESH == 0) || (AX_USE_PHYSICS == 0) +#if (CC_USE_NAVMESH == 0) || (CC_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 32a5f8e236..794599a07d 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); - AX_SAFE_RELEASE(texture); + CC_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); - AX_SAFE_RELEASE(texture); + CC_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 7168f126f2..ded15ee714 100644 --- a/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp +++ b/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp @@ -62,32 +62,32 @@ HttpClientTest::HttpClientTest() : _labelStatusCode(nullptr) // Get auto labelGet = Label::createWithTTF("Test Get", "fonts/arial.ttf", 22); - auto itemGet = MenuItemLabel::create(labelGet, AX_CALLBACK_1(HttpClientTest::onMenuGetTestClicked, this)); + auto itemGet = MenuItemLabel::create(labelGet, CC_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, AX_CALLBACK_1(HttpClientTest::onMenuPostTestClicked, this)); + auto itemPost = MenuItemLabel::create(labelPost, CC_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, AX_CALLBACK_1(HttpClientTest::onMenuPostBinaryTestClicked, this)); + MenuItemLabel::create(labelPostBinary, CC_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, AX_CALLBACK_1(HttpClientTest::onMenuPutTestClicked, this)); + auto itemPut = MenuItemLabel::create(labelPut, CC_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, AX_CALLBACK_1(HttpClientTest::onMenuDeleteTestClicked, this)); + auto itemDelete = MenuItemLabel::create(labelDelete, CC_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(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + // request->setResponseCallback(CC_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(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(CC_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(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(CC_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(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(CC_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(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(CC_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(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(CC_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(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(CC_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(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(CC_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(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(CC_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(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(CC_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(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(CC_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(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(CC_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, AX_CALLBACK_1(HttpClientClearRequestsTest::onMenuCancelAllClicked, this)); + MenuItemLabel::create(labelGet, CC_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, AX_CALLBACK_1(HttpClientClearRequestsTest::onMenuCancelSomeClicked, this)); + MenuItemLabel::create(labelPost, CC_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(AX_CALLBACK_2(HttpClientClearRequestsTest::onHttpRequestCompleted, this)); + request->setResponseCallback(CC_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(AX_CALLBACK_2(HttpClientClearRequestsTest::onHttpRequestCompleted, this)); + request->setResponseCallback(CC_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 2e4a4c32c0..dab995f0e4 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 = AX_CALLBACK_2(TextButton::onTouchBegan, this); - listener->onTouchEnded = AX_CALLBACK_2(TextButton::onTouchEnded, this); - listener->onTouchCancelled = AX_CALLBACK_2(TextButton::onTouchCancelled, this); + listener->onTouchBegan = CC_CALLBACK_2(TextButton::onTouchBegan, this); + listener->onTouchEnded = CC_CALLBACK_2(TextButton::onTouchEnded, this); + listener->onTouchCancelled = CC_CALLBACK_2(TextButton::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -176,7 +176,7 @@ public: return ret; } - AX_SAFE_DELETE(ret); + CC_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(AX_CALLBACK_1(AudioControlTest::update, this), 0.1f, "update_key"); + this->schedule(CC_CALLBACK_1(AudioControlTest::update, this), 0.1f, "update_key"); return ret; } @@ -583,7 +583,7 @@ bool AudioProfileTest::init() char text[30]; _files[0] = "background.mp3"; -#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC _files[1] = "background.caf"; #else _files[1] = "background.ogg"; @@ -648,7 +648,7 @@ bool AudioProfileTest::init() addChild(timeSlider); _timeSlider = timeSlider; - this->schedule(AX_CALLBACK_1(AudioProfileTest::update, this), 0.05f, "update_key"); + this->schedule(CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC AudioEngine::play2d("background.ogg"); -#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 AudioEngine::play2d("background.caf"); #endif }); @@ -819,54 +819,54 @@ std::string AudioIssue11143Test::subtitle() const } // Enable profiles for this file -#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_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_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 +#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_CATEGORY -#define AX_PROFILER_START_CATEGORY(__cat__, __name__) \ +#undef CC_PROFILER_START_CATEGORY +#define CC_PROFILER_START_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ ProfilingBeginTimingBlock(__name__); \ } while (0) -#undef AX_PROFILER_STOP_CATEGORY -#define AX_PROFILER_STOP_CATEGORY(__cat__, __name__) \ +#undef CC_PROFILER_STOP_CATEGORY +#define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ ProfilingEndTimingBlock(__name__); \ } while (0) -#undef AX_PROFILER_RESET_CATEGORY -#define AX_PROFILER_RESET_CATEGORY(__cat__, __name__) \ +#undef CC_PROFILER_RESET_CATEGORY +#define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ ProfilingResetTimingBlock(__name__); \ } while (0) -#undef AX_PROFILER_START_INSTANCE -#define AX_PROFILER_START_INSTANCE(__id__, __name__) \ +#undef CC_PROFILER_START_INSTANCE +#define CC_PROFILER_START_INSTANCE(__id__, __name__) \ do \ { \ ProfilingBeginTimingBlock(String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ } while (0) -#undef AX_PROFILER_STOP_INSTANCE -#define AX_PROFILER_STOP_INSTANCE(__id__, __name__) \ +#undef CC_PROFILER_STOP_INSTANCE +#define CC_PROFILER_STOP_INSTANCE(__id__, __name__) \ do \ { \ ProfilingEndTimingBlock(String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ } while (0) -#undef AX_PROFILER_RESET_INSTANCE -#define AX_PROFILER_RESET_INSTANCE(__id__, __name__) \ +#undef CC_PROFILER_RESET_INSTANCE +#define CC_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)); - AX_PROFILER_START("play2d"); + CC_PROFILER_START("play2d"); AudioEngine::play2d(audioFiles[index]); - AX_PROFILER_STOP("play2d"); + CC_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(); - AX_PROFILER_DISPLAY_TIMERS(); + CC_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 5481cc5baf..6ac70b1a2a 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 = AX_CALLBACK_2(TextButton::onTouchBegan, this); - listener->onTouchEnded = AX_CALLBACK_2(TextButton::onTouchEnded, this); - listener->onTouchCancelled = AX_CALLBACK_2(TextButton::onTouchCancelled, this); + listener->onTouchBegan = CC_CALLBACK_2(TextButton::onTouchBegan, this); + listener->onTouchEnded = CC_CALLBACK_2(TextButton::onTouchEnded, this); + listener->onTouchCancelled = CC_CALLBACK_2(TextButton::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -266,7 +266,7 @@ public: } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; } @@ -483,7 +483,7 @@ void CustomEventTest::onEnter() EventCustom event("game_custom_event1"); event.setUserData(buf); _eventDispatcher->dispatchEvent(&event); - AX_SAFE_DELETE_ARRAY(buf); + CC_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); - AX_SAFE_DELETE_ARRAY(buf); + CC_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 AX_PLATFORM_PC +#ifdef CC_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 AX_PLATFORM_PC +#ifdef CC_PLATFORM_PC return "Press keys 1 through 9 to change the stats anchor on the screen."; #else return "Change the stats anchor [1-9]"; @@ -1120,7 +1120,7 @@ StopPropagationTest::StopPropagationTest() auto keyboardEventListener = EventListenerKeyboard::create(); keyboardEventListener->onKeyPressed = [](EventKeyboard::KeyCode /*key*/, Event* event) { auto target = static_cast(event->getCurrentTarget()); - AX_UNUSED_PARAM(target); + CC_UNUSED_PARAM(target); CCASSERT(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. @@ -1528,7 +1528,7 @@ public: return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } @@ -1571,7 +1571,7 @@ private: DanglingNodePointersTest::DanglingNodePointersTest() { -#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1 && COCOS2D_DEBUG > 0 +#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1 && COCOS2D_DEBUG > 0 Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); @@ -1619,11 +1619,11 @@ std::string DanglingNodePointersTest::title() const std::string DanglingNodePointersTest::subtitle() const { -#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1 && COCOS2D_DEBUG > 0 +#if CC_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" - "AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1\n&& COCOS2D_DEBUG > 0"; + "CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1\n&& COCOS2D_DEBUG > 0"; #endif } @@ -1668,8 +1668,8 @@ std::string RegisterAndUnregisterWhileEventHanldingTest::subtitle() const // WindowEventsTest::WindowEventsTest() { -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) || \ - (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || \ + (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) || \ - (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || \ + (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) return "Resize and Switch to another window and back. Read Logs."; #else return "Unsupported platform."; diff --git a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp index 7b49565214..267e582363 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 = AX_CALLBACK_2(NewSpriteTest::onTouchesEnded, this); + touchListener->onTouchesEnded = CC_CALLBACK_2(NewSpriteTest::onTouchesEnded, this); createSpriteTest(); createNewSpriteTest(); @@ -281,9 +281,9 @@ NewClippingNodeTest::NewClippingNodeTest() _scrolling = false; auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = AX_CALLBACK_2(NewClippingNodeTest::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(NewClippingNodeTest::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(NewClippingNodeTest::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(NewClippingNodeTest::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(NewClippingNodeTest::onTouchesMoved, this); + listener->onTouchesEnded = CC_CALLBACK_2(NewClippingNodeTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -382,8 +382,8 @@ NewCullingTest::NewCullingTest() auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - listener->onTouchBegan = AX_CALLBACK_2(NewCullingTest::onTouchBegan, this); - listener->onTouchMoved = AX_CALLBACK_2(NewCullingTest::onTouchMoved, this); + listener->onTouchBegan = CC_CALLBACK_2(NewCullingTest::onTouchBegan, this); + listener->onTouchMoved = CC_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(" - ", AX_CALLBACK_1(SpriteCreation::delSpritesCallback, this)); + auto decrease = MenuItemFont::create(" - ", CC_CALLBACK_1(SpriteCreation::delSpritesCallback, this)); decrease->setColor(Color3B(0, 200, 20)); - auto increase = MenuItemFont::create(" + ", AX_CALLBACK_1(SpriteCreation::addSpritesCallback, this)); + auto increase = MenuItemFont::create(" + ", CC_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, AX_CALLBACK_1(CaptureScreenTest::onCaptured, this)); + auto mi1 = MenuItemLabel::create(label1, CC_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(AX_CALLBACK_2(CaptureScreenTest::afterCaptured, this), _filename); + utils::captureScreen(CC_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, AX_CALLBACK_1(CaptureNodeTest::onCaptured, this)); + auto mi1 = MenuItemLabel::create(label1, CC_CALLBACK_1(CaptureNodeTest::onCaptured, this)); auto menu = Menu::create(mi1, nullptr); addChild(menu); menu->setPosition(s.width / 2, s.height / 4); diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp index 24f4292816..418989ae23 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(AX_CALLBACK_1(NodeTest4::delay2, this), 2.0f, "delay2_key"); - schedule(AX_CALLBACK_1(NodeTest4::delay4, this), 4.0f, "delay4_key"); + schedule(CC_CALLBACK_1(NodeTest4::delay2, this), 2.0f, "delay2_key"); + schedule(CC_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(AX_CALLBACK_1(NodeTest5::addAndRemove, this), 2.0f, "add_and_remove_key"); + schedule(CC_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(AX_CALLBACK_1(NodeTest6::addAndRemove, this), 2.0f, "add_and_remove_key"); + schedule(CC_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(AX_CALLBACK_1(StressTest1::shouldNotCrash, this), 1.0f, "should_not_crash_key"); + schedule(CC_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(AX_CALLBACK_1(StressTest1::removeMe, this)), + runAction(Sequence::create(RotateBy::create(2, 360), CallFuncN::create(CC_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(AX_CALLBACK_1(StressTest2::shouldNotLeak, this), 6.0f, "should_not_leak_key"); + schedule(CC_CALLBACK_1(StressTest2::shouldNotLeak, this), 6.0f, "should_not_leak_key"); addChild(sublayer, 0, kTagSprite1); } @@ -390,7 +390,7 @@ SchedulerTest1::SchedulerTest1() addChild(layer, 0); // CCLOG("retain count after addChild is %d", layer->getReferenceCount()); // 2 - layer->schedule(AX_CALLBACK_1(SchedulerTest1::doSomething, this), "do_something_key"); + 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 // win32 version is still 2, because Timer class don't save target. @@ -763,7 +763,7 @@ std::string CameraCenterTest::subtitle() const ConvertToNode::ConvertToNode() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = AX_CALLBACK_2(ConvertToNode::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(ConvertToNode::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -1224,7 +1224,7 @@ void NodeNameTest::onEnter() { TestCocosNodeDemo::onEnter(); - this->scheduleOnce(AX_CALLBACK_1(NodeNameTest::test, this), 0.05f, "test_key"); + this->scheduleOnce(CC_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 9181b569e2..2d397c0846 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 = AX_CALLBACK_2(OpenURLTest::onTouchesEnded, this); + listener->onTouchesEnded = CC_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 98ea6fc9b7..4751a28a27 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 = AX_CALLBACK_2(Parallax2::onTouchesMoved, this); + listener->onTouchesMoved = CC_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 b04c6af65e..42b909f51a 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 = AX_CALLBACK_2(Particle3DTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(Particle3DTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(Particle3DTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(Particle3DTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(Particle3DTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = CC_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 -= AX_DEGREES_TO_RADIANS(delta.x); + _angle -= CC_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 9c13ae0608..b5ba510e8c 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(AX_SCHEDULE_SELECTOR(DemoPause::pauseEmitter), 2.0f); + schedule(CC_SCHEDULE_SELECTOR(DemoPause::pauseEmitter), 2.0f); } void DemoPause::pauseEmitter(float time) { @@ -2072,7 +2072,7 @@ void Issue870::onEnter() _emitter->retain(); _index = 0; - schedule(AX_SCHEDULE_SELECTOR(Issue870::updateQuads), 2.0f); + schedule(CC_SCHEDULE_SELECTOR(Issue870::updateQuads), 2.0f); } void Issue870::updateQuads(float dt) @@ -2220,7 +2220,7 @@ ParticleTests::ParticleTests() ParticleDemo::~ParticleDemo() { - AX_SAFE_RELEASE(_emitter); + CC_SAFE_RELEASE(_emitter); } void ParticleDemo::onEnter() @@ -2235,15 +2235,15 @@ void ParticleDemo::onEnter() _emitter = nullptr; auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = AX_CALLBACK_2(ParticleDemo::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(ParticleDemo::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(ParticleDemo::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(ParticleDemo::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(ParticleDemo::onTouchesMoved, this); + listener->onTouchesEnded = CC_CALLBACK_2(ParticleDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); auto item4 = MenuItemToggle::createWithCallback( - AX_CALLBACK_1(ParticleDemo::toggleCallback, this), MenuItemFont::create("Free Movement"), + CC_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(AX_SCHEDULE_SELECTOR(ParticleBatchHybrid::switchRender), 2.0f); + schedule(CC_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(AX_SCHEDULE_SELECTOR(ParticleReorder::reorderParticles), 1.0f); + schedule(CC_SCHEDULE_SELECTOR(ParticleReorder::reorderParticles), 1.0f); } std::string ParticleReorder::title() const @@ -2780,7 +2780,7 @@ void AddAndDeleteParticleSystems::onEnter() _batchNode->addChild(particleSystem, randZ, -1); } - schedule(AX_SCHEDULE_SELECTOR(AddAndDeleteParticleSystems::removeSystem), 0.5f); + schedule(CC_SCHEDULE_SELECTOR(AddAndDeleteParticleSystems::removeSystem), 0.5f); _emitter = nullptr; } @@ -2928,7 +2928,7 @@ void ReorderParticleSystems::onEnter() //[pBNode addChild:particleSystem z:10 tag:0); } - schedule(AX_SCHEDULE_SELECTOR(ReorderParticleSystems::reorderSystem), 2.0f); + schedule(CC_SCHEDULE_SELECTOR(ReorderParticleSystems::reorderSystem), 2.0f); _emitter = nullptr; } @@ -3023,7 +3023,7 @@ void PremultipliedAlphaTest::onEnter() this->addChild(_emitter, 10); _hasEmitter = true; - schedule(AX_SCHEDULE_SELECTOR(PremultipliedAlphaTest::readdParticle), 1.0f); + schedule(CC_SCHEDULE_SELECTOR(PremultipliedAlphaTest::readdParticle), 1.0f); } // PremultipliedAlphaTest2 @@ -3093,7 +3093,7 @@ void ParticleVisibleTest::onEnter() _emitter->setTexture(Director::getInstance()->getTextureCache()->addImage(s_stars1)); - schedule(AX_SCHEDULE_SELECTOR(ParticleVisibleTest::callback), 1); + schedule(CC_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 0a9810d271..8ede42f65e 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 AX_USE_3D_PHYSICS == 0 +#if CC_USE_3D_PHYSICS == 0 ADD_TEST_CASE(Physics3DDemoDisabled); #else ADD_TEST_CASE(BasicPhysics3DDemo); @@ -64,11 +64,11 @@ Physics3DTests::Physics3DTests() #endif }; -#if AX_USE_3D_PHYSICS == 0 +#if CC_USE_3D_PHYSICS == 0 void Physics3DDemoDisabled::onEnter() { TTFConfig ttfConfig("fonts/arial.ttf", 16); - auto label = Label::createWithTTF(ttfConfig, "Should define AX_USE_3D_PHYSICS\n to run this test case"); + auto label = Label::createWithTTF(ttfConfig, "Should define CC_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 = AX_CALLBACK_2(Physics3DTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(Physics3DTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(Physics3DTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(Physics3DTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(Physics3DTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = CC_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 -= AX_DEGREES_TO_RADIANS(delta.x); + _angle -= CC_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), AX_DEGREES_TO_RADIANS(180), &quat); + Quaternion::createFromAxisAngle(Vec3(0.f, 1.f, 0.f), CC_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(AX_DEGREES_TO_RADIANS(90), &frameInA); + Mat4::createRotationZ(CC_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(AX_DEGREES_TO_RADIANS(90), &frameInA); + Mat4::createRotationZ(CC_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(AX_DEGREES_TO_RADIANS(10), AX_DEGREES_TO_RADIANS(10), AX_DEGREES_TO_RADIANS(40)); + ->setLimit(CC_DEGREES_TO_RADIANS(10), CC_DEGREES_TO_RADIANS(10), CC_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), AX_DEGREES_TO_RADIANS(15.0f), &localTrans); + Mat4::createRotation(Vec3(1.0f, 0.0f, 0.0f), CC_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), AX_DEGREES_TO_RADIANS(-15.0f), &localTrans); + Mat4::createRotation(Vec3(1.0f, 0.0f, 0.0f), CC_DEGREES_TO_RADIANS(-15.0f), &localTrans); localTrans.m[12] = 2.0f; localTrans.m[13] = 2.5f; localTrans.m[14] = 1.f; diff --git a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h index 923485479e..083c5142f1 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 AX_USE_3D_PHYSICS == 0 +#if CC_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 b92b649b83..e2dd28fd18 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 AX_USE_PHYSICS +#if CC_USE_PHYSICS # include # include "ui/CocosGUI.h" @@ -62,7 +62,7 @@ const int DRAG_BODYS_TAG = 0x80; void PhysicsDemo::toggleDebug() { -# if AX_USE_PHYSICS +# if CC_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", AX_CALLBACK_1(PhysicsDemo::toggleDebugCallback, this)); + auto item = MenuItemFont::create("Toggle debug", CC_CALLBACK_1(PhysicsDemo::toggleDebugCallback, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -372,11 +372,11 @@ void PhysicsDemoClickAdd::onEnter() PhysicsDemo::onEnter(); auto touchListener = EventListenerTouchAllAtOnce::create(); - touchListener->onTouchesEnded = AX_CALLBACK_2(PhysicsDemoClickAdd::onTouchesEnded, this); + touchListener->onTouchesEnded = CC_CALLBACK_2(PhysicsDemoClickAdd::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); Device::setAccelerometerEnabled(true); - auto accListener = EventListenerAcceleration::create(AX_CALLBACK_2(PhysicsDemoClickAdd::onAcceleration, this)); + auto accListener = EventListenerAcceleration::create(CC_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 = AX_CALLBACK_2(PhysicsDemoPyramidStack::onTouchBegan, this); - touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemoPyramidStack::onTouchMoved, this); - touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoPyramidStack::onTouchEnded, this); + touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemoPyramidStack::onTouchBegan, this); + touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemoPyramidStack::onTouchMoved, this); + touchListener->onTouchEnded = CC_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(AX_SCHEDULE_SELECTOR(PhysicsDemoPyramidStack::updateOnce), 3.0); + scheduleOnce(CC_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 = AX_CALLBACK_2(PhysicsDemoRayCast::onTouchesEnded, this); + listener->onTouchesEnded = CC_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)", AX_CALLBACK_1(PhysicsDemoRayCast::changeModeCallback, this)); + auto item = MenuItemFont::create("Change Mode(any)", CC_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 = AX_CALLBACK_3(PhysicsDemoRayCast::anyRay, this); + auto func = CC_CALLBACK_3(PhysicsDemoRayCast::anyRay, this); _physicsWorld->rayCast(func, point1, point2, &point3); _node->drawSegment(point1, point3, 0.5f, STATIC_COLOR); @@ -651,9 +651,9 @@ void PhysicsDemoActions::onEnter() _physicsWorld->setGravity(Vec2::ZERO); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemoActions::onTouchBegan, this); - touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemoActions::onTouchMoved, this); - touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoActions::onTouchEnded, this); + touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemoActions::onTouchBegan, this); + touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemoActions::onTouchMoved, this); + touchListener->onTouchEnded = CC_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 = AX_CALLBACK_2(PhysicsDemo::onTouchBegan, this); - listener->onTouchMoved = AX_CALLBACK_2(PhysicsDemo::onTouchMoved, this); - listener->onTouchEnded = AX_CALLBACK_2(PhysicsDemo::onTouchEnded, this); + listener->onTouchBegan = CC_CALLBACK_2(PhysicsDemo::onTouchBegan, this); + listener->onTouchMoved = CC_CALLBACK_2(PhysicsDemo::onTouchMoved, this); + listener->onTouchEnded = CC_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 = AX_CALLBACK_2(PhysicsDemoPump::onTouchBegan, this); - touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemoPump::onTouchMoved, this); - touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoPump::onTouchEnded, this); + touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemoPump::onTouchBegan, this); + touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemoPump::onTouchMoved, this); + touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemoPump::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); scheduleUpdate(); @@ -1120,9 +1120,9 @@ void PhysicsDemoOneWayPlatform::onEnter() PhysicsDemo::onEnter(); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchBegan, this); - touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchMoved, this); - touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchEnded, this); + touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchBegan, this); + touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchMoved, this); + touchListener->onTouchEnded = CC_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 = AX_CALLBACK_1(PhysicsDemoOneWayPlatform::onContactBegin, this); + contactListener->onContactBegin = CC_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 = AX_CALLBACK_2(PhysicsDemoSlice::onTouchEnded, this); + touchListener->onTouchEnded = CC_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 = AX_CALLBACK_3(PhysicsDemoSlice::slice, this); + auto func = CC_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(" - ", AX_CALLBACK_1(PhysicsContactTest::onDecrease, this)); + auto decrease1 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease1->setColor(Color3B(0, 200, 20)); - auto increase1 = MenuItemFont::create(" + ", AX_CALLBACK_1(PhysicsContactTest::onIncrease, this)); + auto increase1 = MenuItemFont::create(" + ", CC_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(" - ", AX_CALLBACK_1(PhysicsContactTest::onDecrease, this)); + auto decrease2 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease2->setColor(Color3B(0, 200, 20)); - auto increase2 = MenuItemFont::create(" + ", AX_CALLBACK_1(PhysicsContactTest::onIncrease, this)); + auto increase2 = MenuItemFont::create(" + ", CC_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(" - ", AX_CALLBACK_1(PhysicsContactTest::onDecrease, this)); + auto decrease3 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease3->setColor(Color3B(0, 200, 20)); - auto increase3 = MenuItemFont::create(" + ", AX_CALLBACK_1(PhysicsContactTest::onIncrease, this)); + auto increase3 = MenuItemFont::create(" + ", CC_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(" - ", AX_CALLBACK_1(PhysicsContactTest::onDecrease, this)); + auto decrease4 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease4->setColor(Color3B(0, 200, 20)); - auto increase4 = MenuItemFont::create(" + ", AX_CALLBACK_1(PhysicsContactTest::onIncrease, this)); + auto increase4 = MenuItemFont::create(" + ", CC_CALLBACK_1(PhysicsContactTest::onIncrease, this)); increase4->setColor(Color3B(0, 200, 20)); decrease4->setTag(4); increase4->setTag(4); @@ -1462,7 +1462,7 @@ void PhysicsContactTest::resetTest() root->addChild(wall); auto contactListener = EventListenerPhysicsContact::create(); - contactListener->onContactBegin = AX_CALLBACK_1(PhysicsContactTest::onContactBegin, this); + contactListener->onContactBegin = CC_CALLBACK_1(PhysicsContactTest::onContactBegin, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(contactListener, this); // yellow box, will collide with itself and blue box. @@ -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; - AX_ASSERT(body->getCategoryBitmask() == 0x04 || body->getCategoryBitmask() == 0x08); + CC_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 = AX_CALLBACK_2(PhysicsDemo::onTouchBegan, this); - touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemo::onTouchMoved, this); - touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemo::onTouchEnded, this); + touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemo::onTouchBegan, this); + touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemo::onTouchMoved, this); + touchListener->onTouchEnded = CC_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 = AX_CALLBACK_2(PhysicsDemo::onTouchBegan, this); - touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemo::onTouchMoved, this); - touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemo::onTouchEnded, this); + touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemo::onTouchBegan, this); + touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemo::onTouchMoved, this); + touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemo::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); // wall @@ -1665,7 +1665,7 @@ void PhysicsSetGravityEnableTest::onEnter() ballBody->setMass(50); addChild(ball); - scheduleOnce(AX_SCHEDULE_SELECTOR(PhysicsSetGravityEnableTest::onScheduleOnce), 1.0); + scheduleOnce(CC_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 = AX_CALLBACK_2(PhysicsDemo::onTouchBegan, this); - touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemo::onTouchMoved, this); - touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemo::onTouchEnded, this); + touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemo::onTouchBegan, this); + touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemo::onTouchMoved, this); + touchListener->onTouchEnded = CC_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", AX_CALLBACK_1(PhysicsDemoBug5482::changeBodyCallback, this)); + _button = MenuItemFont::create("Set Body To A", CC_CALLBACK_1(PhysicsDemoBug5482::changeBodyCallback, this)); auto menu = Menu::create(_button, nullptr); this->addChild(menu); @@ -1783,7 +1783,7 @@ void PhysicsFixedUpdate::onEnter() addBall(); - scheduleOnce(AX_SCHEDULE_SELECTOR(PhysicsFixedUpdate::updateStart), 2); + scheduleOnce(CC_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 = AX_CALLBACK_2(PhysicsTransformTest::onTouchBegan, this); + touchListener->onTouchBegan = CC_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 a70092c8e2..803ef2a55f 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 AX_USE_PHYSICS +#if CC_USE_PHYSICS DEFINE_TEST_SUITE(PhysicsTests); @@ -308,4 +308,4 @@ public: virtual std::string subtitle() const override; }; -#endif // #if AX_USE_PHYSICS \ No newline at end of file +#endif // #if CC_USE_PHYSICS \ No newline at end of file diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp index dbe28026d1..18d1ec4e11 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 = AX_CALLBACK_2(RenderTextureSave::onTouchesMoved, this); + listener->onTouchesMoved = CC_CALLBACK_2(RenderTextureSave::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // Save Image menu MenuItemFont::setFontSize(16); auto item1 = - MenuItemFont::create("Save Image PMA", AX_CALLBACK_1(RenderTextureSave::saveImageWithPremultipliedAlpha, this)); + MenuItemFont::create("Save Image PMA", CC_CALLBACK_1(RenderTextureSave::saveImageWithPremultipliedAlpha, this)); auto item2 = MenuItemFont::create("Save Image Non-PMA", - 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)); + 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)); auto item5 = - MenuItemFont::create("Clear to Transparent", AX_CALLBACK_1(RenderTextureSave::clearImageTransparent, this)); + MenuItemFont::create("Clear to Transparent", CC_CALLBACK_1(RenderTextureSave::clearImageTransparent, this)); auto menu = Menu::create(item1, item2, item3, item4, item5, nullptr); this->addChild(menu); menu->alignItemsVertically(); @@ -286,9 +286,9 @@ std::string RenderTextureIssue937::subtitle() const RenderTextureZbuffer::RenderTextureZbuffer() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = AX_CALLBACK_2(RenderTextureZbuffer::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(RenderTextureZbuffer::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(RenderTextureZbuffer::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(RenderTextureZbuffer::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(RenderTextureZbuffer::onTouchesMoved, this); + listener->onTouchesEnded = CC_CALLBACK_2(RenderTextureZbuffer::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto size = Director::getInstance()->getWinSize(); @@ -467,7 +467,7 @@ RenderTexturePartTest::RenderTexturePartTest() RenderTexturePartTest::~RenderTexturePartTest() { - AX_SAFE_RELEASE(_rend); + CC_SAFE_RELEASE(_rend); } std::string RenderTexturePartTest::title() const @@ -514,8 +514,8 @@ RenderTextureTestDepthStencil::RenderTextureTestDepthStencil() RenderTextureTestDepthStencil::~RenderTextureTestDepthStencil() { - AX_SAFE_RELEASE(_spriteDraw); - AX_SAFE_RELEASE(_spriteDS); + CC_SAFE_RELEASE(_spriteDraw); + CC_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 = AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this); - renderer->addCallbackCommand(AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this), _globalZOrder); +// _renderCmds[0].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this); + renderer->addCallbackCommand(CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this), _globalZOrder); // _renderCmds[1].init(_globalZOrder); -// _renderCmds[1].func = AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this); - renderer->addCallbackCommand(AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this), _globalZOrder); +// _renderCmds[1].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this); + renderer->addCallbackCommand(CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this), _globalZOrder); _spriteDS->visit(); // _renderCmds[2].init(_globalZOrder); -// _renderCmds[2].func = AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeDraw, this); - renderer->addCallbackCommand(AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeDraw, this), _globalZOrder); +// _renderCmds[2].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeDraw, this); + renderer->addCallbackCommand(CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeDraw, this), _globalZOrder); _spriteDraw->visit(); // _renderCmds[3].init(_globalZOrder); -// _renderCmds[3].func = AX_CALLBACK_0(RenderTextureTestDepthStencil::onAfterDraw, this); - renderer->addCallbackCommand(AX_CALLBACK_0(RenderTextureTestDepthStencil::onAfterDraw, this), _globalZOrder); +// _renderCmds[3].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onAfterDraw, this); + renderer->addCallbackCommand(CC_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", AX_CALLBACK_1(RenderTextureTargetNode::touched, this)); + auto item = MenuItemFont::create("Clear On/Off", CC_CALLBACK_1(RenderTextureTargetNode::touched, this)); auto menu = Menu::create(item, nullptr); addChild(menu); @@ -678,7 +678,7 @@ std::string RenderTextureTargetNode::subtitle() const SpriteRenderTextureBug::SimpleSprite::SimpleSprite() : _rt(nullptr) {} SpriteRenderTextureBug::SimpleSprite::~SimpleSprite() { - AX_SAFE_RELEASE(_rt); + CC_SAFE_RELEASE(_rt); } SpriteRenderTextureBug::SimpleSprite* SpriteRenderTextureBug::SimpleSprite::create(const char* filename, @@ -691,7 +691,7 @@ SpriteRenderTextureBug::SimpleSprite* SpriteRenderTextureBug::SimpleSprite::crea } else { - AX_SAFE_DELETE(sprite); + CC_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 = AX_CALLBACK_2(SpriteRenderTextureBug::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(SpriteRenderTextureBug::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); diff --git a/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp b/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp index 112850770d..3c0c0befef 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 { - AX_BREAK_IF(false == TestCase::init()); + CC_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 = AX_CALLBACK_2(Scene3DTestScene::onTouchBegan, this); - listener->onTouchEnded = AX_CALLBACK_2(Scene3DTestScene::onTouchEnd, this); + listener->onTouchBegan = CC_CALLBACK_2(Scene3DTestScene::onTouchBegan, this); + listener->onTouchEnded = CC_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 93f4121b8b..8ab329dbca 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", AX_CALLBACK_1(SceneTestLayer1::onPushScene, this)); + auto item1 = MenuItemFont::create("Test pushScene", CC_CALLBACK_1(SceneTestLayer1::onPushScene, this)); auto item2 = - MenuItemFont::create("Test pushScene w/transition", AX_CALLBACK_1(SceneTestLayer1::onPushSceneTran, this)); - auto item3 = MenuItemFont::create("Quit", AX_CALLBACK_1(SceneTestLayer1::onQuit, this)); + MenuItemFont::create("Test pushScene w/transition", CC_CALLBACK_1(SceneTestLayer1::onPushSceneTran, this)); + auto item3 = MenuItemFont::create("Quit", CC_CALLBACK_1(SceneTestLayer1::onQuit, this)); auto menu = Menu::create(item1, item2, item3, nullptr); menu->alignItemsVertically(); @@ -67,7 +67,7 @@ SceneTestLayer1::SceneTestLayer1() auto repeat = RepeatForever::create(rotate); sprite->runAction(repeat); - schedule(AX_SCHEDULE_SELECTOR(SceneTestLayer1::testDealloc)); + schedule(CC_SCHEDULE_SELECTOR(SceneTestLayer1::testDealloc)); } void SceneTestLayer1::testDealloc(float dt) @@ -125,10 +125,10 @@ SceneTestLayer2::SceneTestLayer2() { _timeCounter = 0; - auto item1 = MenuItemFont::create("replaceScene", AX_CALLBACK_1(SceneTestLayer2::onReplaceScene, this)); + auto item1 = MenuItemFont::create("replaceScene", CC_CALLBACK_1(SceneTestLayer2::onReplaceScene, this)); auto item2 = - MenuItemFont::create("replaceScene w/transition", AX_CALLBACK_1(SceneTestLayer2::onReplaceSceneTran, this)); - auto item3 = MenuItemFont::create("Go Back", AX_CALLBACK_1(SceneTestLayer2::onGoBack, this)); + MenuItemFont::create("replaceScene w/transition", CC_CALLBACK_1(SceneTestLayer2::onReplaceSceneTran, this)); + auto item3 = MenuItemFont::create("Go Back", CC_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(AX_SCHEDULE_SELECTOR(SceneTestLayer2::testDealloc)); + schedule(CC_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)", AX_CALLBACK_1(SceneTestLayer3::item0Clicked, this)); - auto item1 = MenuItemFont::create("Touch to popScene", AX_CALLBACK_1(SceneTestLayer3::item1Clicked, this)); + 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)); auto item2 = - MenuItemFont::create("Touch to popToRootScene", AX_CALLBACK_1(SceneTestLayer3::item2Clicked, this)); + MenuItemFont::create("Touch to popToRootScene", CC_CALLBACK_1(SceneTestLayer3::item2Clicked, this)); auto item3 = MenuItemFont::create("Touch to popToSceneStackLevel(2)", - AX_CALLBACK_1(SceneTestLayer3::item3Clicked, this)); + CC_CALLBACK_1(SceneTestLayer3::item3Clicked, this)); auto menu = Menu::create(item0, item1, item2, item3, nullptr); this->addChild(menu); menu->alignItemsVertically(); - this->schedule(AX_SCHEDULE_SELECTOR(SceneTestLayer3::testDealloc)); + this->schedule(CC_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 e340d7ea79..6272d15a0a 100644 --- a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp +++ b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp @@ -73,8 +73,8 @@ void SchedulerAutoremove::onEnter() { SchedulerTestLayer::onEnter(); - schedule(AX_SCHEDULE_SELECTOR(SchedulerAutoremove::autoremove), 0.5f); - schedule(AX_SCHEDULE_SELECTOR(SchedulerAutoremove::tick), 0.5f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerAutoremove::autoremove), 0.5f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerAutoremove::tick), 0.5f); accum = 0; } @@ -85,7 +85,7 @@ void SchedulerAutoremove::autoremove(float dt) if (accum > 3) { - unschedule(AX_SCHEDULE_SELECTOR(SchedulerAutoremove::autoremove)); + unschedule(CC_SCHEDULE_SELECTOR(SchedulerAutoremove::autoremove)); CCLOG("autoremove scheduler: scheduler removed"); } } @@ -113,9 +113,9 @@ std::string SchedulerAutoremove::subtitle() const void SchedulerPauseResume::onEnter() { SchedulerTestLayer::onEnter(); - schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResume::tick1), 0.5f); - schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResume::tick2), 0.5f); - schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResume::pause), 3.0f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResume::tick1), 0.5f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResume::tick2), 0.5f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResume::pause), 3.0f); } void SchedulerPauseResume::tick1(float /*dt*/) @@ -164,9 +164,9 @@ void SchedulerPauseResumeAll::onEnter() sprite->runAction(RepeatForever::create(RotateBy::create(3.0f, 360.0f))); sprite->setTag(123); scheduleUpdate(); - schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::tick1), 0.5f); - schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::tick2), 1.0f); - scheduleOnce(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::pause), 3.0f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::tick1), 0.5f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::tick2), 1.0f); + scheduleOnce(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::pause), 3.0f); } void SchedulerPauseResumeAll::update(float /*delta*/) @@ -246,9 +246,9 @@ void SchedulerPauseResumeAllUser::onEnter() this->addChild(sprite); sprite->runAction(RepeatForever::create(RotateBy::create(3.0f, 360.0f))); - 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); + 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); } void SchedulerPauseResumeAllUser::onExit() @@ -305,11 +305,11 @@ void SchedulerUnscheduleAll::onEnter() { SchedulerTestLayer::onEnter(); - 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); + 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); } void SchedulerUnscheduleAll::tick1(float /*dt*/) @@ -365,11 +365,11 @@ void SchedulerUnscheduleAllHard::onEnter() _actionManagerActive = true; - 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); + 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); } void SchedulerUnscheduleAllHard::onExit() @@ -436,11 +436,11 @@ void SchedulerUnscheduleAllUserLevel::onEnter() this->addChild(sprite); sprite->runAction(RepeatForever::create(RotateBy::create(3.0f, 360.0f))); - 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); + 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); } void SchedulerUnscheduleAllUserLevel::tick1(float /*dt*/) @@ -487,9 +487,9 @@ void SchedulerSchedulesAndRemove::onEnter() { SchedulerTestLayer::onEnter(); - schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick1), 0.5f); - schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick2), 1.0f); - schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::scheduleAndUnschedule), 4.0f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick1), 0.5f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick2), 1.0f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::scheduleAndUnschedule), 4.0f); } void SchedulerSchedulesAndRemove::tick1(float /*dt*/) @@ -524,12 +524,12 @@ std::string SchedulerSchedulesAndRemove::subtitle() const void SchedulerSchedulesAndRemove::scheduleAndUnschedule(float /*dt*/) { - unschedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick1)); - unschedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick2)); - unschedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::scheduleAndUnschedule)); + unschedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick1)); + unschedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick2)); + unschedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::scheduleAndUnschedule)); - schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick3), 1.0f); - schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick4), 1.0f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick3), 1.0f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick4), 1.0f); } //------------------------------------------------------------------ @@ -589,7 +589,7 @@ void SchedulerUpdate::onEnter() addChild(f); f->release(); - schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdate::removeUpdates), 4.0f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdate::removeUpdates), 4.0f); } void SchedulerUpdate::removeUpdates(float /*dt*/) @@ -629,8 +629,8 @@ void SchedulerUpdateAndCustom::onEnter() SchedulerTestLayer::onEnter(); scheduleUpdate(); - schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateAndCustom::tick)); - schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateAndCustom::stopSelectors), 0.4f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateAndCustom::tick)); + schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateAndCustom::stopSelectors), 0.4f); } void SchedulerUpdateAndCustom::update(float dt) @@ -668,7 +668,7 @@ void SchedulerUpdateFromCustom::onEnter() { SchedulerTestLayer::onEnter(); - schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::schedUpdate), 2.0f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::schedUpdate), 2.0f); } void SchedulerUpdateFromCustom::update(float dt) @@ -678,15 +678,15 @@ void SchedulerUpdateFromCustom::update(float dt) void SchedulerUpdateFromCustom::schedUpdate(float /*dt*/) { - unschedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::schedUpdate)); + unschedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::schedUpdate)); scheduleUpdate(); - schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::stopUpdate), 2.0f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::stopUpdate), 2.0f); } void SchedulerUpdateFromCustom::stopUpdate(float /*dt*/) { unscheduleUpdate(); - unschedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::stopUpdate)); + unschedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::stopUpdate)); } std::string SchedulerUpdateFromCustom::title() const @@ -710,7 +710,7 @@ void RescheduleSelector::onEnter() _interval = 1.0f; _ticks = 0; - schedule(AX_SCHEDULE_SELECTOR(RescheduleSelector::schedUpdate), _interval); + schedule(CC_SCHEDULE_SELECTOR(RescheduleSelector::schedUpdate), _interval); } std::string RescheduleSelector::title() const @@ -731,7 +731,7 @@ void RescheduleSelector::schedUpdate(float dt) if (_ticks > 3) { _interval += 1.0f; - schedule(AX_SCHEDULE_SELECTOR(RescheduleSelector::schedUpdate), _interval); + schedule(CC_SCHEDULE_SELECTOR(RescheduleSelector::schedUpdate), _interval); _ticks = 0; } } @@ -741,7 +741,7 @@ void RescheduleSelector::schedUpdate(float dt) void SchedulerDelayAndRepeat::onEnter() { SchedulerTestLayer::onEnter(); - schedule(AX_SCHEDULE_SELECTOR(SchedulerDelayAndRepeat::update), 0, 4, 3.f); + schedule(CC_SCHEDULE_SELECTOR(SchedulerDelayAndRepeat::update), 0, 4, 3.f); CCLOG("update is scheduled should begin after 3 seconds"); } @@ -1040,7 +1040,7 @@ void SchedulerIssue2268::update(float /*dt*/) } SchedulerIssue2268::~SchedulerIssue2268() { - AX_SAFE_RELEASE(testNode); + CC_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(AX_CALLBACK_1(XXX::member_function), this), this, ...)\n\ +schedule(CC_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(AX_CALLBACK_1(ScheduleCallbackTest::callback, this), this, 1.0f, false, "member_function"); + _scheduler->schedule(CC_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(AX_CALLBACK_1(XXX::member_function), this), this, ...), dt = %f", dt); + log("In the callback of schedule(CC_CALLBACK_1(XXX::member_function), this), this, ...), dt = %f", dt); } // ScheduleUpdatePriority @@ -1179,7 +1179,7 @@ void ScheduleUpdatePriority::onEnter() scheduleUpdate(); auto listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = AX_CALLBACK_2(ScheduleUpdatePriority::onTouchBegan, this); + listener->onTouchBegan = CC_CALLBACK_2(ScheduleUpdatePriority::onTouchBegan, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -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, AX_REPEAT_FOREVER, + scheduler->schedule(SEL_SCHEDULE(&SchedulerRemoveSelectorDuringCall::callback), this, 0.01f, CC_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 d4c2656ef3..9319646c46 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: AX_USE_METAL , AX_USE_GL + * keywords: CC_USE_METAL , CC_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); - AX_SAFE_RELEASE(programState); - AX_SAFE_RELEASE(program); + CC_SAFE_RELEASE(programState); + CC_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); - AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 6); + CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 6); } void ShaderNode::updateUniforms() @@ -421,7 +421,7 @@ SpriteBlur* SpriteBlur::create(const char* pszFileName) } else { - AX_SAFE_DELETE(pRet); + CC_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 AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_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); - AX_SAFE_RELEASE(programState); - AX_SAFE_RELEASE(program); + CC_SAFE_RELEASE(programState); + CC_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); - AX_SAFE_RELEASE(p); + CC_SAFE_RELEASE(p); _label->setPosition(Vec2(s.width / 2, s.height / 2)); addChild(_label); scheduleUpdate(); - AX_SAFE_RELEASE(program); + CC_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, AX_CALLBACK_1(ShaderMultiTexture::changeTexture, this)); + auto mi = MenuItemLabel::create(label, CC_CALLBACK_1(ShaderMultiTexture::changeTexture, this)); auto menu = Menu::create(mi, nullptr); addChild(menu); menu->setPosition(s.width * 7 / 8, s.height / 2); - AX_SAFE_RELEASE(programState); - AX_SAFE_RELEASE(program); + CC_SAFE_RELEASE(programState); + CC_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 68aa81afc5..06c0a17bc2 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 = AX_MVPMatrix * a_position; } + void main() { gl_Position = CC_MVPMatrix * a_position; } ); diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp index b4239200c1..1cdeab29ee 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; } - AX_SAFE_RELEASE(ret); + CC_SAFE_RELEASE(ret); return nullptr; } @@ -97,9 +97,9 @@ public: { effect->setTarget(this); - AX_SAFE_RELEASE(_defaultEffect); + CC_SAFE_RELEASE(_defaultEffect); _defaultEffect = effect; - AX_SAFE_RETAIN(_defaultEffect); + CC_SAFE_RETAIN(_defaultEffect); setProgramState(_defaultEffect->getProgramState()); } @@ -116,7 +116,7 @@ public: void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override { -#if AX_USE_CULLING +#if CC_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(); } - AX_SAFE_RELEASE(_defaultEffect); + CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) _fragSource = fragSource; #endif auto program = backend::Device::getInstance()->newProgram(positionTextureColor_vert, fragSource.c_str()); auto programState = new backend::ProgramState(program); - AX_SAFE_RELEASE(_programState); - AX_SAFE_RELEASE(program); + CC_SAFE_RELEASE(_programState); + CC_SAFE_RELEASE(program); _programState = programState; return _programState != nullptr; @@ -203,7 +203,7 @@ Effect::Effect() {} Effect::~Effect() { - AX_SAFE_RELEASE_NULL(_programState); + CC_SAFE_RELEASE_NULL(_programState); } // Blur @@ -416,7 +416,7 @@ public: normalMappedSprite->autorelease(); return normalMappedSprite; } - AX_SAFE_DELETE(normalMappedSprite); + CC_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 = AX_CALLBACK_2(EffectSpriteLamp::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(EffectSpriteLamp::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(EffectSpriteLamp::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(EffectSpriteLamp::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(EffectSpriteLamp::onTouchesMoved, this); + listener->onTouchesEnded = CC_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 4611ba839d..d025387e96 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 ca839d53ea..fbd2c0be7f 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 = AX_Time[1]; // shader playback time (in seconds) + float iGlobalTime = CC_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 = AX_Time[1]; // shader playback time (in seconds) + float iGlobalTime = CC_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 = AX_Time[1]; // shader playback time (in seconds) + float iGlobalTime = CC_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/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp b/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp index 0fc08879ea..54a61163d0 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 AX_USE_METAL - AX_ASSERT(texture->getPixelFormat() == expectedFormat); +#ifndef CC_USE_METAL + CC_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(); - AX_ASSERT(texture->getPixelFormat() == expectedFormat); + CC_ASSERT(texture->getPixelFormat() == expectedFormat); SpriteFrameCache::getInstance()->removeSpriteFrameByName("sprite_frames_test/grossini.png"); Director::getInstance()->getTextureCache()->removeTexture(texture); @@ -411,7 +411,7 @@ protected: spriteSheet->full = true; - AX_SAFE_DELETE(image); + CC_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 AX_USE_METAL - AX_ASSERT(texture->getPixelFormat() == expectedFormat); +#ifndef CC_USE_METAL + CC_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 0e9f4edcf2..921b9bfc9f 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(AX_CALLBACK_2(SpritePolygonTestSlider::changeEpsilon, this)); + slider->addEventListener(CC_CALLBACK_2(SpritePolygonTestSlider::changeEpsilon, this)); slider->setPercent((int)(sqrtf(1.0f / 19.0f) * 100)); } diff --git a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp index 01fec9f83e..1760c1584e 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 = AX_CALLBACK_2(Sprite1::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(Sprite1::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -214,7 +214,7 @@ std::string Sprite1::subtitle() const SpriteBatchNode1::SpriteBatchNode1() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = AX_CALLBACK_2(SpriteBatchNode1::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(SpriteBatchNode1::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto BatchNode = SpriteBatchNode::create("Images/grossini_dance_atlas.png", 50); @@ -336,7 +336,7 @@ SpriteColorOpacity::SpriteColorOpacity() addChild(sprite7, 0, kTagSprite7); addChild(sprite8, 0, kTagSprite8); - schedule(AX_CALLBACK_1(SpriteColorOpacity::removeAndAddSprite, this), 2, "remove_add_key"); + schedule(CC_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(AX_CALLBACK_1(SpriteColorOpacityHSVHSL::removeAndAddSprite, this), 2, "remove_add_key"); + schedule(CC_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(AX_CALLBACK_1(SpriteBatchNodeColorOpacity::removeAndAddSprite, this), 2, "remove_add_key"); + schedule(CC_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(AX_CALLBACK_1(SpriteZOrder::reorderSprite, this), 1, "reorder_key"); + schedule(CC_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(AX_CALLBACK_1(SpriteBatchNodeZOrder::reorderSprite, this), 1, "reorder_key"); + schedule(CC_CALLBACK_1(SpriteBatchNodeZOrder::reorderSprite, this), 1, "reorder_key"); } void SpriteBatchNodeZOrder::reorderSprite(float dt) @@ -722,7 +722,7 @@ SpriteBatchNodeReorder::SpriteBatchNodeReorder() } } - ssize_t AX_UNUSED prev = -1; + ssize_t CC_UNUSED prev = -1; auto& children = asmtest->getChildren(); @@ -797,23 +797,23 @@ std::string SpriteBatchNodeReorderIssue744::subtitle() const Sprite* SpriteBatchNodeReorderIssue766::makeSpriteZ(int aZ) { Rect rcw(128, 0, 64, 64); - rcw = AX_RECT_PIXELS_TO_POINTS(rcw); + rcw = CC_RECT_PIXELS_TO_POINTS(rcw); auto sprite = Sprite::createWithTexture(batchNode->getTexture(), rcw); - sprite->setScale(AX_CONTENT_SCALE_FACTOR()); + sprite->setScale(CC_CONTENT_SCALE_FACTOR()); batchNode->addChild(sprite, aZ + 1, 0); // children Rect rc1(0, 0, 64, 64); - rc1 = AX_RECT_PIXELS_TO_POINTS(rc1); + rc1 = CC_RECT_PIXELS_TO_POINTS(rc1); auto spriteShadow = Sprite::createWithTexture(batchNode->getTexture(), rc1); spriteShadow->setOpacity(128); - sprite->setScale(AX_CONTENT_SCALE_FACTOR()); + sprite->setScale(CC_CONTENT_SCALE_FACTOR()); sprite->addChild(spriteShadow, aZ, 3); Rect rc2(64, 0, 64, 64); - rc2 = AX_RECT_PIXELS_TO_POINTS(rc2); + rc2 = CC_RECT_PIXELS_TO_POINTS(rc2); auto spriteTop = Sprite::createWithTexture(batchNode->getTexture(), rc2); - sprite->setScale(AX_CONTENT_SCALE_FACTOR()); + sprite->setScale(CC_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(AX_CALLBACK_1(SpriteBatchNodeReorderIssue766::reorderSprite, this), 2, "issue_766_key"); + schedule(CC_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(AX_CALLBACK_1(SpriteBatchNodeReorderIssue767::reorderSprites, this), 1, "issue_767_key"); + schedule(CC_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(AX_CALLBACK_1(SpriteFlip::flipSprites, this), 1, "sprite_flip_key"); + schedule(CC_CALLBACK_1(SpriteFlip::flipSprites, this), 1, "sprite_flip_key"); } void SpriteFlip::flipSprites(float dt) @@ -1409,7 +1409,7 @@ SpriteBatchNodeFlip::SpriteBatchNodeFlip() sprite2->setPosition(Vec2(s.width / 2 + 100, s.height / 2)); batch->addChild(sprite2, 0, kTagSprite2); - schedule(AX_CALLBACK_1(SpriteBatchNodeFlip::flipSprites, this), 1, "flip_sprites_key"); + schedule(CC_CALLBACK_1(SpriteBatchNodeFlip::flipSprites, this), 1, "flip_sprites_key"); } void SpriteBatchNodeFlip::flipSprites(float dt) @@ -1562,7 +1562,7 @@ std::string SpriteBatchNodeAliased::subtitle() const SpriteNewTexture::SpriteNewTexture() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = AX_CALLBACK_2(SpriteNewTexture::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(SpriteNewTexture::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto node = Node::create(); @@ -1670,7 +1670,7 @@ std::string SpriteNewTexture::subtitle() const SpriteBatchNodeNewTexture::SpriteBatchNodeNewTexture() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = AX_CALLBACK_2(SpriteBatchNodeNewTexture::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(SpriteBatchNodeNewTexture::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto batch = SpriteBatchNode::create("Images/grossini_dance_atlas.png", 50); @@ -1825,7 +1825,7 @@ void SpriteFrameTest::onEnter() _sprite2->setFlippedX(false); _sprite2->setFlippedY(false); - schedule(AX_CALLBACK_1(SpriteFrameTest::startIn05Secs, this), 0.5f, "in_05_secs_key"); + schedule(CC_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(AX_CALLBACK_1(SpriteFrameTest::flipSprites, this), 1.0f, "flip_sprites_key"); + schedule(CC_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(); - AX_SAFE_RELEASE(image); + CC_SAFE_RELEASE(image); auto cache = SpriteFrameCache::getInstance(); cache->addSpriteFramesWithFileContent(plist_content, texture); @@ -2471,7 +2471,7 @@ SpriteHybrid::SpriteHybrid() _usingSpriteBatchNode = false; - schedule(AX_CALLBACK_1(SpriteHybrid::reparentSprite, this), 2, "reparent_sprite_key"); + schedule(CC_CALLBACK_1(SpriteHybrid::reparentSprite, this), 2, "reparent_sprite_key"); } void SpriteHybrid::reparentSprite(float dt) @@ -4285,7 +4285,7 @@ NodeSort::NodeSort() _sprite5->setPosition(Vec2(356.0f, 160.0f)); _node->addChild(_sprite5, -3, 5); - schedule(AX_CALLBACK_1(NodeSort::reorderSprite, this), "reorder_sprite_key"); + schedule(CC_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(AX_CALLBACK_1(SpriteBatchNodeReorderSameIndex::reorderSprite, this), 2, "reorder_sprite_key"); + scheduleOnce(CC_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(AX_CALLBACK_1(SpriteBatchNodeReorderOneChild::reorderSprite, this), 2.0f, "reorder_sprite_key"); + scheduleOnce(CC_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(AX_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); + s3->setTextureRect(CC_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(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))); + 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))); } // "anchor points" @@ -5356,7 +5356,7 @@ SpriteSlice9Test5::SpriteSlice9Test5() auto s1 = Sprite::create("Images/grossinis_heads.png"); addChild(s1); s1->getTexture()->setAliasTexParameters(); - s1->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); + s1->setTextureRect(CC_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(AX_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); + s2->setTextureRect(CC_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(AX_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); + s3->setTextureRect(CC_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(AX_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); + s1->setTextureRect(CC_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(AX_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); + s2->setTextureRect(CC_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(AX_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); + s3->setTextureRect(CC_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(AX_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); + s1->setTextureRect(CC_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(AX_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); + s2->setTextureRect(CC_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(AX_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); + s3->setTextureRect(CC_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 a5f1b0fed2..93613aa65d 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 = AX_CALLBACK_2(TerrainSimple::onTouchesMoved, this); + listener->onTouchesMoved = CC_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 = AX_CALLBACK_2(TerrainWalkThru::onTouchesBegan, this); - listener->onTouchesEnded = AX_CALLBACK_2(TerrainWalkThru::onTouchesEnd, this); + listener->onTouchesBegan = CC_CALLBACK_2(TerrainWalkThru::onTouchesBegan, this); + listener->onTouchesEnded = CC_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; } - AX_SAFE_DELETE(player); + CC_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 = AX_CALLBACK_2(TerrainWithLightMap::onTouchesMoved, this); + listener->onTouchesMoved = CC_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 d9d2908cf4..8efaf45fca 100644 --- a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp +++ b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp @@ -60,8 +60,8 @@ KeyboardNotificationLayer::KeyboardNotificationLayer() : _trackNode(0) { // Register Touch Event auto listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = AX_CALLBACK_2(KeyboardNotificationLayer::onTouchBegan, this); - listener->onTouchEnded = AX_CALLBACK_2(KeyboardNotificationLayer::onTouchEnded, this); + listener->onTouchBegan = CC_CALLBACK_2(KeyboardNotificationLayer::onTouchBegan, this); + listener->onTouchEnded = CC_CALLBACK_2(KeyboardNotificationLayer::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -174,7 +174,7 @@ void TextFieldTTFDefaultTest::onEnter() auto pTextField = TextFieldTTF::textFieldWithPlaceHolder("", FONT_NAME, FONT_SIZE); addChild(pTextField); -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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)); @@ -229,7 +229,7 @@ void TextFieldTTFActionTest::onEnter() _textField->setDelegate(this); -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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(AX_CALLBACK_1(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction, this)), nullptr); + CallFuncN::create(CC_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(AX_CALLBACK_1(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction, this)), nullptr); + CallFuncN::create(CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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)); @@ -418,7 +418,7 @@ void TextFieldTTSetCursorFromPoint::onEnter() auto pTextField = TextFieldTTF::textFieldWithPlaceHolder("", FONT_NAME, FONT_SIZE); addChild(pTextField); -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 892c24f229..1fb9c1766d 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 = AX_CALLBACK_2(TextureETC1Alpha::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(TextureETC1Alpha::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -269,7 +269,7 @@ std::string TextureETC1Alpha::subtitle() const TextureETC2::TextureETC2() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = AX_CALLBACK_2(TextureETC2::onTouchesEnded, this); + listener->onTouchesEnded = CC_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 = AX_CALLBACK_2(TextureBMP::onTouchesEnded, this); + listener->onTouchesEnded = CC_CALLBACK_2(TextureBMP::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -875,7 +875,7 @@ void TexturePVRRGBA4444GZ::onEnter() TextureDemo::onEnter(); auto s = Director::getInstance()->getWinSize(); -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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(AX_SCHEDULE_SELECTOR(TextureAsync::loadImages), 1.0f); + scheduleOnce(CC_SCHEDULE_SELECTOR(TextureAsync::loadImages), 1.0f); } TextureAsync::~TextureAsync() @@ -1758,15 +1758,15 @@ void TextureAsync::loadImages(float dt) { char szSpriteName[100] = {0}; sprintf(szSpriteName, "Images/sprites_test/sprite-%d-%d.png", i, j); - textureCache->addImageAsync(szSpriteName, AX_CALLBACK_1(TextureAsync::imageLoaded, this)); + textureCache->addImageAsync(szSpriteName, 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)); + 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)); } void TextureAsync::imageLoaded(Texture2D* texture) @@ -2096,19 +2096,19 @@ void TextureMemoryAlloc::onEnter() MenuItemFont::setFontSize(24); - auto item1 = MenuItemFont::create("PNG", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item1 = MenuItemFont::create("PNG", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item1->setTag(0); - auto item2 = MenuItemFont::create("RGBA8", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item2 = MenuItemFont::create("RGBA8", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item2->setTag(1); - auto item3 = MenuItemFont::create("RGB8", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item3 = MenuItemFont::create("RGB8", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item3->setTag(2); - auto item4 = MenuItemFont::create("RGBA4", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item4 = MenuItemFont::create("RGBA4", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item4->setTag(3); - auto item5 = MenuItemFont::create("A8", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item5 = MenuItemFont::create("A8", CC_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", AX_CALLBACK_1(TextureMemoryAlloc::changeBackgroundVisible, this)); + MenuItemFont::create("warm up texture", CC_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 af64d60eef..97070a63bb 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", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_01.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_02.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_03.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_04.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_05.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_06.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_07.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_08.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_09.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_10.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_11.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_12.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_13.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_14.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/background1.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/background2.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/background3.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/blocks.png", - AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + CC_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", AX_CALLBACK_1(TextureCacheUnbindTest::textureLoadedA, this), + cache->addImageAsync("Images/texture2048x2048.png", CC_CALLBACK_1(TextureCacheUnbindTest::textureLoadedA, this), "A"); - cache->addImageAsync("Images/texture2048x2048.png", AX_CALLBACK_1(TextureCacheUnbindTest::textureLoadedB, this), + cache->addImageAsync("Images/texture2048x2048.png", CC_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 6af03ff2c5..10b55810d5 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 = AX_CALLBACK_2(TileDemoNew::onTouchesMoved, this); + listener->onTouchesMoved = CC_CALLBACK_2(TileDemoNew::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -122,7 +122,7 @@ TileMapTestNew::TileMapTestNew() // Convert it to "alias" (GL_LINEAR filtering) map->getTexture()->setAntiAliasTexParameters(); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); // If you are not going to use the Map, you can free it now @@ -157,13 +157,13 @@ TileMapEditTestNew::TileMapEditTestNew() // Create an Aliased Atlas map->getTexture()->setAliasTexParameters(); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("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(AX_SCHEDULE_SELECTOR(TileMapEditTestNew::updateMap), 0.2f); + schedule(CC_SCHEDULE_SELECTOR(TileMapEditTestNew::updateMap), 0.2f); addChild(map, 0, kTagTileMap); @@ -227,7 +227,7 @@ TMXOrthoTestNew::TMXOrthoTestNew() addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); auto scale = ScaleBy::create(10, 0.1f); @@ -269,7 +269,7 @@ TMXOrthoTest2New::TMXOrthoTest2New() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test1.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); map->runAction(ScaleBy::create(2, 0.5f)); @@ -290,7 +290,7 @@ TMXOrthoTest3New::TMXOrthoTest3New() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test3.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); map->setScale(0.2f); @@ -312,7 +312,7 @@ TMXOrthoTest4New::TMXOrthoTest4New() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test4.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s1 = map->getContentSize(); + Size CC_UNUSED s1 = map->getContentSize(); CCLOG("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(AX_SCHEDULE_SELECTOR(TMXOrthoTest4New::removeSprite), 2); + schedule(CC_SCHEDULE_SELECTOR(TMXOrthoTest4New::removeSprite), 2); } void TMXOrthoTest4New::removeSprite(float dt) { - unschedule(AX_SCHEDULE_SELECTOR(TMXOrthoTest4New::removeSprite)); + unschedule(CC_SCHEDULE_SELECTOR(TMXOrthoTest4New::removeSprite)); auto map = static_cast(getChildByTag(kTagTileMap)); auto layer = map->getLayer("Layer 0"); @@ -373,7 +373,7 @@ TMXReadWriteTestNew::TMXReadWriteTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test2.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("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(AX_CALLBACK_1(TMXReadWriteTestNew::removeSprite, this)); + auto finish = CallFuncN::create(CC_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(); @@ -409,9 +409,9 @@ TMXReadWriteTestNew::TMXReadWriteTestNew() _gid = layer->getTileGIDAt(Vec2(0, 63)); ////----CCLOG("Tile GID at:(0,63) is: %d", _gid); - schedule(AX_SCHEDULE_SELECTOR(TMXReadWriteTestNew::updateCol), 2.0f); - schedule(AX_SCHEDULE_SELECTOR(TMXReadWriteTestNew::repaintWithGID), 2.05f); - schedule(AX_SCHEDULE_SELECTOR(TMXReadWriteTestNew::removeTiles), 1.0f); + schedule(CC_SCHEDULE_SELECTOR(TMXReadWriteTestNew::updateCol), 2.0f); + schedule(CC_SCHEDULE_SELECTOR(TMXReadWriteTestNew::repaintWithGID), 2.05f); + schedule(CC_SCHEDULE_SELECTOR(TMXReadWriteTestNew::removeTiles), 1.0f); ////----CCLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads()); ////----CCLOG("++++children: %d", layer->getChildren()->count() ); @@ -468,7 +468,7 @@ void TMXReadWriteTestNew::repaintWithGID(float dt) void TMXReadWriteTestNew::removeTiles(float dt) { - unschedule(AX_SCHEDULE_SELECTOR(TMXReadWriteTestNew::removeTiles)); + unschedule(CC_SCHEDULE_SELECTOR(TMXReadWriteTestNew::removeTiles)); auto map = (axis::FastTMXTiledMap*)getChildByTag(kTagTileMap); auto layer = (axis::FastTMXLayer*)map->getChildByTag(0); @@ -498,7 +498,7 @@ TMXHexTestNew::TMXHexTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/hexa-test.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); } @@ -544,7 +544,7 @@ TMXIsoTest1New::TMXIsoTest1New() auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test1.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); map->setAnchorPoint(Vec2(0.5f, 0.5f)); @@ -568,7 +568,7 @@ TMXIsoTest2New::TMXIsoTest2New() auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test2.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); // move map to the center of the screen @@ -595,7 +595,7 @@ TMXUncompressedTestNew::TMXUncompressedTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test2-uncompressed.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); // move map to the center of the screen @@ -629,7 +629,7 @@ TMXTilesetTestNew::TMXTilesetTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test5.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); } @@ -648,7 +648,7 @@ TMXOrthoObjectsTestNew::TMXOrthoObjectsTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/ortho-objects.tmx"); addChild(map, -1, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); auto group = map->getObjectGroup("Object Group 1"); @@ -697,7 +697,7 @@ TMXIsoObjectsTestNew::TMXIsoObjectsTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/iso-test-objectgroup.tmx"); addChild(map, -1, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); auto group = map->getObjectGroup("Object Group 1"); @@ -747,7 +747,7 @@ TMXResizeTestNew::TMXResizeTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test5.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); axis::FastTMXLayer* layer; @@ -792,7 +792,7 @@ TMXIsoZorderNew::TMXIsoZorderNew() map->addChild(_tamara, (int)map->getChildren().size()); _tamara->retain(); int mapWidth = map->getMapSize().width * map->getTileSize().width; - _tamara->setPosition(AX_POINT_PIXELS_TO_POINTS(Vec2(mapWidth / 2.0f, 0.0f))); + _tamara->setPosition(CC_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(AX_SCHEDULE_SELECTOR(TMXIsoZorderNew::repositionSprite)); + schedule(CC_SCHEDULE_SELECTOR(TMXIsoZorderNew::repositionSprite)); } TMXIsoZorderNew::~TMXIsoZorderNew() @@ -810,14 +810,14 @@ TMXIsoZorderNew::~TMXIsoZorderNew() void TMXIsoZorderNew::onExit() { - unschedule(AX_SCHEDULE_SELECTOR(TMXIsoZorderNew::repositionSprite)); + unschedule(CC_SCHEDULE_SELECTOR(TMXIsoZorderNew::repositionSprite)); TileDemoNew::onExit(); } void TMXIsoZorderNew::repositionSprite(float dt) { auto p = _tamara->getPosition(); - p = AX_POINT_POINTS_TO_PIXELS(p); + p = CC_POINT_POINTS_TO_PIXELS(p); auto map = getChildByTag(kTagTileMap); // there are only 4 layers. (grass and 3 trees layers) @@ -851,7 +851,7 @@ TMXOrthoZorderNew::TMXOrthoZorderNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test-zorder.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); _tamara = Sprite::create(s_pathSister1); @@ -864,7 +864,7 @@ TMXOrthoZorderNew::TMXOrthoZorderNew() auto seq = Sequence::create(move, back, nullptr); _tamara->runAction(RepeatForever::create(seq)); - schedule(AX_SCHEDULE_SELECTOR(TMXOrthoZorderNew::repositionSprite)); + schedule(CC_SCHEDULE_SELECTOR(TMXOrthoZorderNew::repositionSprite)); } TMXOrthoZorderNew::~TMXOrthoZorderNew() @@ -875,7 +875,7 @@ TMXOrthoZorderNew::~TMXOrthoZorderNew() void TMXOrthoZorderNew::repositionSprite(float dt) { auto p = _tamara->getPosition(); - p = AX_POINT_POINTS_TO_PIXELS(p); + p = CC_POINT_POINTS_TO_PIXELS(p); auto map = getChildByTag(kTagTileMap); // there are only 4 layers. (grass and 3 trees layers) @@ -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 / AX_CONTENT_SCALE_FACTOR())); + auto move = MoveBy::create(10, Vec2(300, 250) * (1 / CC_CONTENT_SCALE_FACTOR())); auto back = move->reverse(); auto seq = Sequence::create(move, back, nullptr); _tamara->runAction(RepeatForever::create(seq)); - schedule(AX_SCHEDULE_SELECTOR(TMXIsoVertexZNew::repositionSprite)); + schedule(CC_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 = AX_POINT_POINTS_TO_PIXELS(p); + p = CC_POINT_POINTS_TO_PIXELS(p); float newZ = -(p.y + 32) / 16; _tamara->setPositionZ(newZ); } @@ -982,7 +982,7 @@ TMXOrthoVertexZNew::TMXOrthoVertexZNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test-vertexz.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("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 @@ -992,12 +992,12 @@ TMXOrthoVertexZNew::TMXOrthoVertexZNew() CCLOG("%p vertexZ: %f", _tamara, _tamara->getPositionZ()); _tamara->retain(); - auto move = MoveBy::create(10, Vec2(400, 450) * (1 / AX_CONTENT_SCALE_FACTOR())); + auto move = MoveBy::create(10, Vec2(400, 450) * (1 / CC_CONTENT_SCALE_FACTOR())); auto back = move->reverse(); auto seq = Sequence::create(move, back, nullptr); _tamara->runAction(RepeatForever::create(seq)); - schedule(AX_SCHEDULE_SELECTOR(TMXOrthoVertexZNew::repositionSprite)); + schedule(CC_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 = AX_POINT_POINTS_TO_PIXELS(p); + p = CC_POINT_POINTS_TO_PIXELS(p); _tamara->setPositionZ(-((p.y + 81) / 81)); } @@ -1055,7 +1055,7 @@ TMXIsoMoveLayerNew::TMXIsoMoveLayerNew() map->setPosition(Vec2(-700.0f, -50.0f)); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); } @@ -1079,7 +1079,7 @@ TMXOrthoMoveLayerNew::TMXOrthoMoveLayerNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test-movelayer.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width, s.height); } @@ -1134,7 +1134,7 @@ TMXOrthoFlipTestNew::TMXOrthoFlipTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/ortho-rotation-test.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_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(AX_SCHEDULE_SELECTOR(TMXOrthoFlipRunTimeTestNew::flipIt), 1.0f); + schedule(CC_SCHEDULE_SELECTOR(TMXOrthoFlipRunTimeTestNew::flipIt), 1.0f); } std::string TMXOrthoFlipRunTimeTestNew::title() const @@ -1280,7 +1280,7 @@ TMXBug987New::TMXBug987New() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test6.tmx"); addChild(map, 0, kTagTileMap); - Size AX_UNUSED s1 = map->getContentSize(); + Size CC_UNUSED s1 = map->getContentSize(); CCLOG("ContentSize: %f, %f", s1.width, s1.height); map->setAnchorPoint(Vec2(0.0f, 0.0f)); @@ -1331,7 +1331,7 @@ TMXGIDObjectsTestNew::TMXGIDObjectsTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/test-object-layer.tmx"); addChild(map, -1, kTagTileMap); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("Contentsize: %f, %f", s.width, s.height); CCLOG("----> Iterating over all the group objects"); @@ -1379,10 +1379,10 @@ TileAnimTestNew::TileAnimTestNew() addChild(map, 0, kTagTileMap); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = AX_CALLBACK_2(TileAnimTestNew::onTouchBegan, this); + listener->onTouchesBegan = CC_CALLBACK_2(TileAnimTestNew::onTouchBegan, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); - Size AX_UNUSED s = map->getContentSize(); + Size CC_UNUSED s = map->getContentSize(); CCLOG("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 0bf53bddf0..1dde9bc49d 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 = AX_CALLBACK_2(Paddle::onTouchBegan, this); - listener->onTouchMoved = AX_CALLBACK_2(Paddle::onTouchMoved, this); - listener->onTouchEnded = AX_CALLBACK_2(Paddle::onTouchEnded, this); + listener->onTouchBegan = CC_CALLBACK_2(Paddle::onTouchBegan, this); + listener->onTouchMoved = CC_CALLBACK_2(Paddle::onTouchMoved, this); + listener->onTouchEnded = CC_CALLBACK_2(Paddle::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } diff --git a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp index c43ed65ac7..12fec743c3 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(AX_SCHEDULE_SELECTOR(PongLayer::doStep)); + schedule(CC_SCHEDULE_SELECTOR(PongLayer::doStep)); } PongLayer::~PongLayer() {} @@ -154,9 +154,9 @@ ForceTouchTest::ForceTouchTest() addChild(_infoLabel); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = AX_CALLBACK_2(ForceTouchTest::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(ForceTouchTest::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(ForceTouchTest::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(ForceTouchTest::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(ForceTouchTest::onTouchesMoved, this); + listener->onTouchesEnded = CC_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 9904eef0a7..29a5fd3cc9 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(AX_SCHEDULE_SELECTOR(TestLayer1::step), 1.0f); + schedule(CC_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(AX_SCHEDULE_SELECTOR(TestLayer2::step), 1.0f); + schedule(CC_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 8b8f5a24d8..af4ce1d2c0 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ - AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) && !defined(AX_TARGET_OS_TVOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ + CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) && !defined(CC_TARGET_OS_TVOS) # include "UIVideoPlayerTest/UIVideoPlayerTest.h" #endif -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) && !defined(AX_TARGET_OS_TVOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) # include "UIWebViewTest/UIWebViewTest.h" #endif #include "UIScale9SpriteTest.h" -#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) +#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) # include "UIEditBoxTest.h" #endif -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) # include "UIWebViewTest/UIWebViewTest.h" #endif GUIDynamicCreateTests::GUIDynamicCreateTests() { -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ - AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) && !defined(AX_TARGET_OS_TVOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ + CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) && !defined(CC_TARGET_OS_TVOS) addTest("VideoPlayer Test", []() { return new VideoPlayerTests; }); #endif -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) && \ - !defined(AX_TARGET_OS_TVOS) || \ - (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && \ + !defined(CC_TARGET_OS_TVOS) || \ + (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) addTest("WebView Test", []() { return new WebViewTests; }); #endif -#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) +#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) 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 41480b1d45..860cc52f92 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -81,7 +81,7 @@ bool UIButtonTest::init() CCLOG("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(AX_CALLBACK_2(UIButtonTest::touchEvent, this)); + button->addTouchEventListener(CC_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, AX_CALLBACK_1(UIButtonTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, CC_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); @@ -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(AX_CALLBACK_2(UIButtonTest_Scale9::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIButtonTest_Scale9_State_Change::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIButtonTest_Scale9_State_Change::touchEvent, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIButtonTest_PressedAction::touchEvent, this)); + button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_PressedAction::touchEvent, this)); button->setName("button"); _uiLayer->addChild(button); @@ -434,7 +434,7 @@ bool UIButtonTest_Title::init() 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(AX_CALLBACK_2(UIButtonTest_Title::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIButtonTestRemoveSelf::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIButtonTestSwitchScale9::touchEvent, this)); + button->addTouchEventListener(CC_CALLBACK_2(UIButtonTestSwitchScale9::touchEvent, this)); button->setTitleText("Button Title"); button->ignoreContentAdaptWithSize(false); @@ -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(AX_CALLBACK_2(UIButtonTestZoomScale::sliderEvent, this)); + slider->addEventListener(CC_CALLBACK_2(UIButtonTestZoomScale::sliderEvent, this)); slider->setPercent(button->getZoomScale() * 100); _uiLayer->addChild(slider); 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 7981908cd4..491eb11e09 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(AX_CALLBACK_2(UICheckBoxTest::selectedEvent, this)); + _checkBox->addEventListener(CC_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, AX_CALLBACK_1(UICheckBoxTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, CC_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); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp index 5e3977ccb0..e8e8628a4a 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", AX_CALLBACK_0(UIFocusTestBase::onLeftKeyPressed, this)); + auto leftItem = MenuItemFont::create("Left", CC_CALLBACK_0(UIFocusTestBase::onLeftKeyPressed, this)); leftItem->setPosition(Vec2(winSize.width - 100, winSize.height / 2)); _dpadMenu->addChild(leftItem); - auto rightItem = MenuItemFont::create("Right", AX_CALLBACK_0(UIFocusTestBase::onRightKeyPressed, this)); + auto rightItem = MenuItemFont::create("Right", CC_CALLBACK_0(UIFocusTestBase::onRightKeyPressed, this)); rightItem->setPosition(Vec2(winSize.width - 30, winSize.height / 2)); _dpadMenu->addChild(rightItem); - auto upItem = MenuItemFont::create("Up", AX_CALLBACK_0(UIFocusTestBase::onUpKeyPressed, this)); + auto upItem = MenuItemFont::create("Up", CC_CALLBACK_0(UIFocusTestBase::onUpKeyPressed, this)); upItem->setPosition(Vec2(winSize.width - 60, winSize.height / 2 + 50)); _dpadMenu->addChild(upItem); - auto downItem = MenuItemFont::create("Down", AX_CALLBACK_0(UIFocusTestBase::onDownKeyPressed, this)); + auto downItem = MenuItemFont::create("Down", CC_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 = AX_CALLBACK_2(UIFocusTestBase::onFocusChanged, this); + _eventListener->onFocusChanged = CC_CALLBACK_2(UIFocusTestBase::onFocusChanged, this); _eventDispatcher->addEventListenerWithFixedPriority(_eventListener, 1); @@ -195,7 +195,7 @@ bool UIFocusTestHorizontal::init() ImageView* w = ImageView::create("cocosui/scrollviewbg.png"); w->setTouchEnabled(true); w->setTag(i); - w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestHorizontal::onImageViewClicked, this)); + w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestHorizontal::onImageViewClicked, this)); _horizontalLayout->addChild(w); } @@ -204,7 +204,7 @@ bool UIFocusTestHorizontal::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestHorizontal::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(CC_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(AX_CALLBACK_2(UIFocusTestVertical::onImageViewClicked, this)); + w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestVertical::onImageViewClicked, this)); _verticalLayout->addChild(w); } @@ -264,7 +264,7 @@ bool UIFocusTestVertical::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestVertical::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(CC_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(AX_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); + w->addTouchEventListener(CC_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(AX_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); + w->addTouchEventListener(CC_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(AX_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); + w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); innerVBox->addChild(w); } @@ -360,7 +360,7 @@ bool UIFocusTestNestedLayout1::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout1::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(CC_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(AX_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); + w->addTouchEventListener(CC_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(AX_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); + w->addTouchEventListener(CC_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(AX_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); + w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); innerHBox->addChild(w); } @@ -456,7 +456,7 @@ bool UIFocusTestNestedLayout2::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout2::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(CC_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(AX_CALLBACK_2(UIFocusTestBase::onImageViewClicked, this)); + w->addTouchEventListener(CC_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(AX_CALLBACK_2(UIFocusTestBase::onImageViewClicked, this)); + w->addTouchEventListener(CC_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(AX_CALLBACK_2(UIFocusTestNestedLayout3::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(CC_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 37e7792398..1fc33daa7d 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, AX_CALLBACK_1(UIImageViewTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, CC_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); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp index 9c827650c0..992a0d5f02 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, AX_CALLBACK_1(UILayoutTest_BackGroundImage::printWidgetResources, this)); + MenuItemLabel::create(label1, CC_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); @@ -770,7 +770,7 @@ bool UILayoutComponentTest::init() CCLOG("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(AX_CALLBACK_2(UILayoutComponentTest::touchEvent, this)); + button->addTouchEventListener(CC_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 09343e3133..3c11c5ef20 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)AX_CALLBACK_2(UIListViewTest_Vertical::selectedItemEvent, this)); - _listView->addEventListener((ui::ListView::ccScrollViewCallback)AX_CALLBACK_2( + (ui::ListView::ccListViewCallback)CC_CALLBACK_2(UIListViewTest_Vertical::selectedItemEvent, this)); + _listView->addEventListener((ui::ListView::ccScrollViewCallback)CC_CALLBACK_2( UIListViewTest_Vertical::selectedItemEventScrollView, this)); _listView->setScrollBarPositionFromCorner(Vec2(7, 7)); _uiLayer->addChild(_listView); @@ -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)AX_CALLBACK_2(UIListViewTest_Horizontal::selectedItemEvent, this)); + (ui::ListView::ccListViewCallback)CC_CALLBACK_2(UIListViewTest_Horizontal::selectedItemEvent, this)); _listView->setScrollBarPositionFromCorner(Vec2(7, 7)); _uiLayer->addChild(_listView); @@ -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(AX_CALLBACK_2(UIListViewTest_Padding::sliderEvent, this)); + slider->addEventListener(CC_CALLBACK_2(UIListViewTest_Padding::sliderEvent, this)); slider->setTag(i); _uiLayer->addChild(slider); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp index 81cbd9a554..3eff94fa2e 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, AX_CALLBACK_1(UILoadingBarTest_Left::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, CC_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); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index 761ff19f6c..d68d1c8f8b 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(AX_CALLBACK_2(UIPageViewButtonTest::onButtonClicked, this)); + btn->addTouchEventListener(CC_CALLBACK_2(UIPageViewButtonTest::onButtonClicked, this)); innerBox->addChild(btn); } @@ -206,7 +206,7 @@ bool UIPageViewButtonTest::init() pageView->removeItem(0); pageView->addEventListener( - (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewButtonTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)CC_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(AX_CALLBACK_2(UIPageViewTouchPropagationTest::onButtonClicked, this)); + btn->addTouchEventListener(CC_CALLBACK_2(UIPageViewTouchPropagationTest::onButtonClicked, this)); innerBox->addChild(btn); } @@ -310,7 +310,7 @@ bool UIPageViewTouchPropagationTest::init() } pageView->addEventListener( - (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewTouchPropagationTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)CC_CALLBACK_2(UIPageViewTouchPropagationTest::pageViewEvent, this)); pageView->setName("pageView"); pageView->addTouchEventListener([](Ref* sender, Widget::TouchEventType type) { if (type == Widget::TouchEventType::BEGAN) @@ -502,7 +502,7 @@ bool UIPageViewDynamicAddAndRemoveTest::init() } pageView->addEventListener( - (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewDynamicAddAndRemoveTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)CC_CALLBACK_2(UIPageViewDynamicAddAndRemoveTest::pageViewEvent, this)); pageView->setName("pageView"); _uiLayer->addChild(pageView); @@ -762,7 +762,7 @@ bool UIPageViewVerticalTest::init() } pageView->addEventListener( - (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewVerticalTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)CC_CALLBACK_2(UIPageViewVerticalTest::pageViewEvent, this)); _uiLayer->addChild(pageView); @@ -911,7 +911,7 @@ bool UIPageViewChildSizeTest::init() } pageView->addEventListener( - (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewChildSizeTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)CC_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 5dbd2bbbc8..1e5b14a8d2 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(AX_CALLBACK_1(UIRadioButtonTest::addRadioButton, this)); + addButton->addClickEventListener(CC_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(AX_CALLBACK_1(UIRadioButtonTest::deleteRadioButton, this)); + deleteButton->addClickEventListener(CC_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( - AX_CALLBACK_3(UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup1, this)); + CC_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( - AX_CALLBACK_3(UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup2, this)); + CC_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( - AX_CALLBACK_2(UIRadioButtonTwoGroupsTest::onChangedRadioButtonSelect, this)); + CC_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(AX_CALLBACK_1(UIRadioButtonTwoGroupsTest::clearRadioButtonGroup, this)); + clearButton->addClickEventListener(CC_CALLBACK_1(UIRadioButtonTwoGroupsTest::clearRadioButtonGroup, this)); clearButton->setScale(0.8f); _uiLayer->addChild(clearButton); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp index ee69a885c3..e47b9e72b4 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp @@ -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(AX_CALLBACK_2(UIRichTextTest::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextTest::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextTest::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLBasic::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLBasic::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLBasic::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSmallBig::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSmallBig::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSmallBig::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLColor::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLColor::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLColor::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSUIB::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSUIB::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSUIB::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSUIB2::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSUIB2::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSUIB2::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSUIB3::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSUIB3::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSUIB3::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLImg::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLImg::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLImg::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLUrl::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLUrl::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLUrl::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLUrlImg::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLUrlImg::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLUrlImg::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLFace::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLFace::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLFace::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLBR::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLBR::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLBR::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLOutline::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLOutline::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLOutline::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLShadow::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLShadow::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLShadow::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLGlow::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLGlow::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLGlow::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLExtend::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLExtend::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLExtend::switchAlignment, this)); + button3->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSpace::touchEvent, this)); + button->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSpace::switchWrapMode, this)); + button2->addTouchEventListener(CC_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(AX_CALLBACK_2(UIRichTextXMLSpace::switchAlignment, this)); + button3->addTouchEventListener(CC_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 7a9120796c..7a8b2241af 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp @@ -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(AX_CALLBACK_2(UIS9GrayStateOpacityTest::sliderEvent, this)); + slider->addEventListener(CC_CALLBACK_2(UIS9GrayStateOpacityTest::sliderEvent, this)); _uiLayer->addChild(slider); return true; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp index 33235d3d50..7b903f4588 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(AX_CALLBACK_2(UISliderTest::sliderEvent, this)); + slider->addEventListener(CC_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, AX_CALLBACK_1(UISliderTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, CC_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); @@ -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(AX_CALLBACK_2(UISliderTest_Scale9::sliderEvent, this)); + slider->addEventListener(CC_CALLBACK_2(UISliderTest_Scale9::sliderEvent, this)); _uiLayer->addChild(slider); return true; @@ -362,7 +362,7 @@ 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; - AX_UNUSED_PARAM(slider); + CC_UNUSED_PARAM(slider); if (type == Slider::EventType::ON_SLIDEBALL_DOWN) { CCLOG("slider button pressed!"); @@ -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(AX_CALLBACK_2(UISliderIssue12249Test::sliderEvent, this)); + slider->addEventListener(CC_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 2eb6bb84d6..014bc4a43f 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, AX_CALLBACK_1(UITextAtlasTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, CC_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); @@ -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, AX_CALLBACK_1(UITextAtlasETC1ShadowTest::printWidgetResources, this)); + MenuItemLabel::create(label1, CC_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); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp index 024b761686..f6815ae8ea 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, AX_CALLBACK_1(UITextBMFontTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, CC_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); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp index 14caab74aa..527cb43030 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(AX_CALLBACK_2(UITextFieldTest::textFieldEvent, this)); + textField->addEventListener(CC_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(AX_CALLBACK_2(UITextFieldTest_MaxLength::textFieldEvent, this)); + textField->addEventListener(CC_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(AX_CALLBACK_2(UITextFieldTest_Password::textFieldEvent, this)); + textField->addEventListener(CC_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(AX_CALLBACK_2(UITextFieldTest_LineWrap::textFieldEvent, this)); + textField->addEventListener(CC_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(AX_CALLBACK_2(UITextFieldTest_TrueTypeFont::textFieldEvent, this)); + textField->addEventListener(CC_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(AX_CALLBACK_2(UITextFieldTest_BMFont::textFieldEvent, this)); + textField->addEventListener(CC_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(AX_CALLBACK_2(UITextFieldTest_PlaceHolderColor::textFieldEvent, this)); + textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_PlaceHolderColor::textFieldEvent, this)); _uiLayer->addChild(textField); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp index 14f95a4a57..aed5f0167b 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", AX_CALLBACK_1(VideoPlayerTest::menuFullScreenCallback, this)); + MenuItemFont::create("FullScreenSwitch", CC_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", AX_CALLBACK_1(VideoPlayerTest::menuPauseCallback, this)); + auto pauseItem = MenuItemFont::create("Pause", CC_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", AX_CALLBACK_1(VideoPlayerTest::menuResumeCallback, this)); + auto resumeItem = MenuItemFont::create("Resume", CC_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", AX_CALLBACK_1(VideoPlayerTest::menuStopCallback, this)); + auto stopItem = MenuItemFont::create("Stop", CC_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", AX_CALLBACK_1(VideoPlayerTest::menuHintCallback, this)); + auto hintItem = MenuItemFont::create("Hint", CC_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", AX_CALLBACK_1(VideoPlayerTest::menuResourceVideoCallback, this)); + MenuItemFont::create("Play resource video", CC_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", AX_CALLBACK_1(VideoPlayerTest::menuOnlineVideoCallback, this)); + MenuItemFont::create("Play online video", CC_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", AX_CALLBACK_1(VideoPlayerTest::menuRatioCallback, this)); + auto ratioSwitch = MenuItemFont::create("KeepRatioSwitch", CC_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", AX_CALLBACK_1(VideoPlayerTest::menuLoopCallback, this)); + auto loopToggle = MenuItemFont::create("LoopToogle", CC_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(AX_CALLBACK_2(VideoPlayerTest::videoEventCallback, this)); + _videoPlayer->addEventListener(CC_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(AX_CALLBACK_2(VideoPlayerTest::sliderCallback, this)); + hSlider->addEventListener(CC_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(AX_CALLBACK_2(VideoPlayerTest::sliderCallback, this)); + vSlider->addEventListener(CC_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", AX_CALLBACK_1(SimpleVideoPlayerTest::switchStyleCallback, this)); + MenuItemFont::create("Switch Style", CC_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", AX_CALLBACK_1(SimpleVideoPlayerTest::switchUserInputCallback, this)); + MenuItemFont::create("Enable User Input", CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) exit(0); #endif } @@ -433,7 +433,7 @@ void SimpleVideoPlayerTest::createVideo() _uiLayer->addChild(_videoPlayer); - // _videoPlayer->addEventListener(AX_CALLBACK_2(SimpleVideoPlayerTest::videoEventCallback, this)); + // _videoPlayer->addEventListener(CC_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 2d18c9f9da..1fa295c514 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(AX_CALLBACK_2(WebViewTest::onWebViewShouldStartLoading, this)); - _webView->setOnDidFinishLoading(AX_CALLBACK_2(WebViewTest::onWebViewDidFinishLoading, this)); - _webView->setOnDidFailLoading(AX_CALLBACK_2(WebViewTest::onWebViewDidFailLoading, this)); + _webView->setOnShouldStartLoading(CC_CALLBACK_2(WebViewTest::onWebViewShouldStartLoading, this)); + _webView->setOnDidFinishLoading(CC_CALLBACK_2(WebViewTest::onWebViewDidFinishLoading, this)); + _webView->setOnDidFailLoading(CC_CALLBACK_2(WebViewTest::onWebViewDidFailLoading, this)); this->addChild(_webView); diff --git a/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp b/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp index 5dea731bc9..99be32e2d1 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 (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) # if defined(__arm64__) || defined(__aarch64__) # define USE_NEON64 # define INCLUDE_NEON64 @@ -165,7 +165,7 @@ void TemplateVectorTest::onEnter() Vector vec4(createVector()); for (const auto& child : vec4) { - AX_UNUSED_PARAM(child); + CC_UNUSED_PARAM(child); CCASSERT(child->getReferenceCount() == 2, "child's reference count should be 2."); } @@ -189,7 +189,7 @@ void TemplateVectorTest::onEnter() for (const auto& child : vec5) { - AX_UNUSED_PARAM(child); + CC_UNUSED_PARAM(child); CCASSERT(child->getReferenceCount() == 2, "child's reference count is 2."); } @@ -284,7 +284,7 @@ void TemplateVectorTest::onEnter() CCASSERT(vec7.size() == 20, "vec7's size is 20."); for (const auto& child : vec7) { - AX_UNUSED_PARAM(child); + CC_UNUSED_PARAM(child); CCASSERT(child->getReferenceCount() == 2, "child's reference count is 2."); } @@ -339,7 +339,7 @@ void TemplateVectorTest::onEnter() for (const auto& child : vecSelfAssign) { - AX_UNUSED_PARAM(child); + CC_UNUSED_PARAM(child); CCASSERT(child->getReferenceCount() == 2, "child's reference count is 2."); } @@ -348,7 +348,7 @@ void TemplateVectorTest::onEnter() for (const auto& child : vecSelfAssign) { - AX_UNUSED_PARAM(child); + CC_UNUSED_PARAM(child); CCASSERT(child->getReferenceCount() == 2, "child's reference count is 2."); } @@ -396,7 +396,7 @@ void TemplateMapTest::onEnter() auto map2 = createMap(); for (const auto& e : map2) { - AX_UNUSED_PARAM(e); + CC_UNUSED_PARAM(e); CCASSERT(e.second->getReferenceCount() == 2, "e.second element's reference count is 2."); } @@ -404,7 +404,7 @@ void TemplateMapTest::onEnter() auto map3(map2); for (const auto& e : map3) { - AX_UNUSED_PARAM(e); + CC_UNUSED_PARAM(e); CCASSERT(e.second->getReferenceCount() == 3, "e.second's reference count is 3."); } @@ -416,7 +416,7 @@ void TemplateMapTest::onEnter() CCASSERT(unusedNode->getReferenceCount() == 1, "unusedNode's reference count is 1."); for (const auto& e : map4) { - AX_UNUSED_PARAM(e); + CC_UNUSED_PARAM(e); CCASSERT(e.second->getReferenceCount() == 2, "e.second's reference count is 2."); } @@ -425,7 +425,7 @@ void TemplateMapTest::onEnter() map5 = map4; for (const auto& e : map5) { - AX_UNUSED_PARAM(e); + CC_UNUSED_PARAM(e); CCASSERT(e.second->getReferenceCount() == 3, "e.second's reference count is 3."); } @@ -434,7 +434,7 @@ void TemplateMapTest::onEnter() for (const auto& e : map4) { - AX_UNUSED_PARAM(e); + CC_UNUSED_PARAM(e); CCASSERT(e.second == map5.find(e.first)->second, "e.second can't be found in map5."); } @@ -478,7 +478,7 @@ void TemplateMapTest::onEnter() // find auto nodeToFind = map4.find("10"); - AX_UNUSED_PARAM(nodeToFind); + CC_UNUSED_PARAM(nodeToFind); CCASSERT(nodeToFind->second->getTag() == 1010, "nodeToFind's tag value is 1010."); // insert @@ -524,7 +524,7 @@ void TemplateMapTest::onEnter() for (const auto& e : mapForClearCopy) { - AX_UNUSED_PARAM(e); + CC_UNUSED_PARAM(e); CCASSERT(e.second->getReferenceCount() == 2, "e.second's reference count is 2."); } @@ -546,7 +546,7 @@ void TemplateMapTest::onEnter() for (const auto& e : mapForSelfAssign) { - AX_UNUSED_PARAM(e); + CC_UNUSED_PARAM(e); CCASSERT(e.second->getReferenceCount() == 2, "e.second's reference count is 2."); } @@ -555,7 +555,7 @@ void TemplateMapTest::onEnter() for (const auto& e : mapForSelfAssign) { - AX_UNUSED_PARAM(e); + CC_UNUSED_PARAM(e); CCASSERT(e.second->getReferenceCount() == 2, "e.second's reference's count is 2."); } } @@ -775,101 +775,101 @@ void UIHelperSubStringTest::onEnter() { // Trivial case std::string source = "abcdefghij"; - AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 2) == "ab"); - AX_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 2) == "cd"); - AX_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 2) == "ef"); + CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 2) == "ab"); + CC_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 2) == "cd"); + CC_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 2) == "ef"); } { // Empty string std::string source = ""; // OK - AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); - AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); + CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); + CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); // Error: These cases cause "out of range" error - AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); - AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); + CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); + CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); } { // Ascii std::string source = "abc"; // OK - 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) == ""); + 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) == ""); // Error: These cases cause "out of range" error - AX_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 0) == ""); - AX_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 1) == ""); + CC_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 0) == ""); + CC_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 1) == ""); } { // CJK characters std::string source = "这里是中文测试例"; // OK - 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) == + 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) == "\xe8\xbf\x99\xe9\x87\x8c\xe6\x98\xaf\xe4\xb8\xad\xe6\x96\x87\xe6\xb5\x8b\xe8\xaf\x95\xe4\xbe\x8b"); - AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 100) == + CC_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"); - AX_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 5) == + CC_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 5) == "\xe6\x98\xaf\xe4\xb8\xad\xe6\x96\x87\xe6\xb5\x8b\xe8\xaf\x95"); - 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"); + 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"); // Error: These cases cause "out of range" error - AX_ASSERT(Helper::getSubStringOfUTF8String(source, 9, 0) == ""); - AX_ASSERT(Helper::getSubStringOfUTF8String(source, 9, 1) == ""); + CC_ASSERT(Helper::getSubStringOfUTF8String(source, 9, 0) == ""); + CC_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 - 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) == ""); + 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) == ""); } { // 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 - 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) == ""); + 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) == ""); } { // 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 - 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) == ""); + 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) == ""); } } diff --git a/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp b/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp index 276b811e14..65fd69b069 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 = AX_CALLBACK_2(TextButton::onTouchBegan, this); - listener->onTouchEnded = AX_CALLBACK_2(TextButton::onTouchEnded, this); - listener->onTouchCancelled = AX_CALLBACK_2(TextButton::onTouchCancelled, this); + listener->onTouchBegan = CC_CALLBACK_2(TextButton::onTouchBegan, this); + listener->onTouchEnded = CC_CALLBACK_2(TextButton::onTouchEnded, this); + listener->onTouchCancelled = CC_CALLBACK_2(TextButton::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -161,7 +161,7 @@ public: return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return ret; } diff --git a/tests/cpp-tests/Classes/WindowTest/WindowTest.cpp b/tests/cpp-tests/Classes/WindowTest/WindowTest.cpp index 1690944d6b..a77fde5041 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 (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ - AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ + CC_TARGET_PLATFORM == CC_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 b4cb5cde7e..7028669dd5 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 (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ - AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ + CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) # include "../BaseTest.h" DEFINE_TEST_SUITE(WindowTests); diff --git a/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp b/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp index 096d9683db..301fb40976 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(AX_SCHEDULE_SELECTOR(ZwoptexGenericTest::startIn05Secs), 1.0f); + schedule(CC_SCHEDULE_SELECTOR(ZwoptexGenericTest::startIn05Secs), 1.0f); sprite1->retain(); sprite2->retain(); @@ -80,8 +80,8 @@ void ZwoptexGenericTest::onEnter() void ZwoptexGenericTest::startIn05Secs(float dt) { - unschedule(AX_SCHEDULE_SELECTOR(ZwoptexGenericTest::startIn05Secs)); - schedule(AX_SCHEDULE_SELECTOR(ZwoptexGenericTest::flipSprites), 0.5f); + unschedule(CC_SCHEDULE_SELECTOR(ZwoptexGenericTest::startIn05Secs)); + schedule(CC_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 3ffabe05a8..265b91f7bd 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(AX_PLATFORM_PC) +#if defined(CC_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(AX_PLATFORM_PC) +#if defined(CC_PLATFORM_PC) addTest("Box2D - TestBed", []() { return new Box2DTestBedTests(); }); #endif addTest("Chipmunk2D - Basic", []() { return new ChipmunkTests(); }); -#if defined(AX_PLATFORM_PC) +#if defined(CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 AX_USE_PHYSICS +#if CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) addTest("Vibrate", []() { return new VibrateTests(); }); #endif addTest("Zwoptex", []() { return new ZwoptexTests(); }); addTest("SpriteFrameCache", []() { return new SpriteFrameCacheTests(); }); // TODO -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ - AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ + CC_TARGET_PLATFORM == CC_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 = AX_CALLBACK_2(TestController::blockTouchBegan, this); + _touchListener->onTouchBegan = CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID __android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", "%s", buff); -#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#elif CC_TARGET_PLATFORM == CC_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 AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 # include static long __stdcall windowExceptionFilter(_EXCEPTION_POINTERS* excp) @@ -511,10 +511,10 @@ static void disableCrashCatch() SetUnhandledExceptionFilter(UnhandledExceptionFilter); } -#elif AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ - AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +#elif CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ + CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID -# if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID +# if CC_TARGET_PLATFORM == CC_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 661cbb2c24..5fb6ffe782 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(AX_PLATFORM_PC) +#if defined(CC_PLATFORM_PC) # include "ChipmunkTestBed/ChipmunkTestBed.h" #endif -#if (AX_TARGET_PLATFORM != AX_PLATFORM_MARMALADE) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) # include "ClippingNodeTest/ClippingNodeTest.h" #endif #include "NewAudioEngineTest/NewAudioEngineTest.h" -#if (AX_TARGET_PLATFORM != AX_PLATFORM_EMSCRIPEN) -# if (AX_TARGET_PLATFORM != AX_PLATFORM_MARMALADE) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_EMSCRIPEN) +# if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) // bada don't support libcurl -# if (AX_TARGET_PLATFORM != AX_PLATFORM_BADA) +# if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) # include "CurlTest/CurlTest.h" # endif # endif #endif -#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) # include "JNITest/JNITest.h" #endif -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ - AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ + CC_TARGET_PLATFORM == CC_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(AX_PLATFORM_PC) +#if defined(CC_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 937f9461f5..d7c2da05d4 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(AX_TARGET_OS_TVOS) +#if !defined(CC_TARGET_OS_TVOS) [eaglView setMultipleTouchEnabled:YES]; #endif // Use RootViewController manage CCEAGLView viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; -#if !defined(AX_TARGET_OS_TVOS) +#if !defined(CC_TARGET_OS_TVOS) viewController.extendedLayoutIncludesOpaqueBars = YES; #endif viewController.view = eaglView; @@ -85,7 +85,7 @@ static AppDelegate s_sharedApplication; [window makeKeyAndVisible]; -#if !defined(AX_TARGET_OS_TVOS) +#if !defined(CC_TARGET_OS_TVOS) [viewController prefersStatusBarHidden]; #endif diff --git a/tests/fairygui-tests/Classes/AppDelegate.cpp b/tests/fairygui-tests/Classes/AppDelegate.cpp index 0db17f4941..8aa8059469 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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_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 AX_PLATFORM_PC +#ifdef CC_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 955c983ddb..7c83e454aa 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() { - AX_SAFE_RELEASE(_bagWindow); + CC_SAFE_RELEASE(_bagWindow); } void BagScene::continueInit() diff --git a/tests/fairygui-tests/Classes/BagWindow.cpp b/tests/fairygui-tests/Classes/BagWindow.cpp index e8a0c9dc02..3afa32194f 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, AX_CALLBACK_1(BagWindow::onClickItem, this)); - _list->itemRenderer = AX_CALLBACK_2(BagWindow::renderListItem, this); + _list->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(BagWindow::onClickItem, this)); + _list->itemRenderer = CC_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(AX_CALLBACK_0(BagWindow::onShown, this)); + GTween::to(getScale(), Vec2::ONE, 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(CC_CALLBACK_0(BagWindow::onShown, this)); } void BagWindow::doHideAnimation() { - GTween::to(getScale(), Vec2(0.1f, 0.1f), 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(AX_CALLBACK_0(BagWindow::hideImmediately, this)); + GTween::to(getScale(), Vec2(0.1f, 0.1f), 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(CC_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 8a8853689c..17eb0b1351 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(AX_CALLBACK_1(BasicsScene::onClickBack, this)); + _backBtn->addClickListener(CC_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(AX_CALLBACK_1(BasicsScene::runDemo, this)); + obj->addClickListener(CC_CALLBACK_1(BasicsScene::runDemo, this)); } } @@ -42,10 +42,10 @@ BasicsScene::BasicsScene() BasicsScene::~BasicsScene() { - AX_SAFE_RELEASE(_winA); - AX_SAFE_RELEASE(_winB); - AX_SAFE_RELEASE(_pm); - AX_SAFE_RELEASE(_popupCom); + CC_SAFE_RELEASE(_winA); + CC_SAFE_RELEASE(_winB); + CC_SAFE_RELEASE(_pm); + CC_SAFE_RELEASE(_popupCom); } void BasicsScene::onClickBack(EventContext* context) @@ -104,10 +104,10 @@ void BasicsScene::playPopup() { _pm = PopupMenu::create(); _pm->retain(); - _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)); + _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)); } if (_popupCom == nullptr) @@ -239,9 +239,9 @@ void BasicsScene::playProgress() { GComponent* obj = _demoObjects.at("ProgressBar"); axis::Director::getInstance()->getScheduler()->schedule( - AX_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this, 0.02f, false); + CC_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this, 0.02f, false); obj->addEventListener(UIEventType::Exit, [this](EventContext*) { - axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this); + axis::Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this); }); } diff --git a/tests/fairygui-tests/Classes/ChatScene.cpp b/tests/fairygui-tests/Classes/ChatScene.cpp index 8d14111e9c..69870f0fdc 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() { - AX_SAFE_RELEASE(_emojiSelectUI); + CC_SAFE_RELEASE(_emojiSelectUI); } void ChatScene::continueInit() @@ -22,18 +22,18 @@ void ChatScene::continueInit() _list = _view->getChild("list")->as(); _list->setVirtual(); - _list->itemProvider = AX_CALLBACK_1(ChatScene::getListItemResource, this); - _list->itemRenderer = AX_CALLBACK_2(ChatScene::renderListItem, this); + _list->itemProvider = CC_CALLBACK_1(ChatScene::getListItemResource, this); + _list->itemRenderer = CC_CALLBACK_2(ChatScene::renderListItem, this); _input = _view->getChild("input")->as(); - _input->addEventListener(UIEventType::Submit, AX_CALLBACK_1(ChatScene::onSubmit, this)); + _input->addEventListener(UIEventType::Submit, CC_CALLBACK_1(ChatScene::onSubmit, this)); - _view->getChild("btnSend")->addClickListener(AX_CALLBACK_1(ChatScene::onClickSendBtn, this)); - _view->getChild("btnEmoji")->addClickListener(AX_CALLBACK_1(ChatScene::onClickEmojiBtn, this)); + _view->getChild("btnSend")->addClickListener(CC_CALLBACK_1(ChatScene::onClickSendBtn, this)); + _view->getChild("btnEmoji")->addClickListener(CC_CALLBACK_1(ChatScene::onClickEmojiBtn, this)); _emojiSelectUI = UIPackage::createObject("Emoji", "EmojiSelectUI")->as(); _emojiSelectUI->retain(); - _emojiSelectUI->getChild("list")->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(ChatScene::onClickEmoji, this)); + _emojiSelectUI->getChild("list")->addEventListener(UIEventType::ClickItem, CC_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 ac6d23464a..3d1174b528 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(AX_CALLBACK_1(DemoScene::onClose, this)); + closeButton->addClickListener(CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) exit(0); #endif @@ -60,5 +60,5 @@ DemoScene::DemoScene() : DemoScene::~DemoScene() { - AX_SAFE_RELEASE(_groot); + CC_SAFE_RELEASE(_groot); } diff --git a/tests/fairygui-tests/Classes/GuideScene.cpp b/tests/fairygui-tests/Classes/GuideScene.cpp index 972e5e912d..4231136228 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() { - AX_SAFE_RELEASE(_guideLayer); + CC_SAFE_RELEASE(_guideLayer); } void GuideScene::continueInit() diff --git a/tests/fairygui-tests/Classes/JoystickModule.cpp b/tests/fairygui-tests/Classes/JoystickModule.cpp index d9655d6e01..2121f7cd59 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, 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)); + _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)); _tweener = nullptr; diff --git a/tests/fairygui-tests/Classes/JoystickScene.cpp b/tests/fairygui-tests/Classes/JoystickScene.cpp index 5e0230bc33..1ad53ab691 100644 --- a/tests/fairygui-tests/Classes/JoystickScene.cpp +++ b/tests/fairygui-tests/Classes/JoystickScene.cpp @@ -4,7 +4,7 @@ USING_NS_AX; JoystickScene::~JoystickScene() { - AX_SAFE_RELEASE(_joystick); + CC_SAFE_RELEASE(_joystick); } void JoystickScene::continueInit() diff --git a/tests/fairygui-tests/Classes/LoopListScene.cpp b/tests/fairygui-tests/Classes/LoopListScene.cpp index 6cbecb5137..9ac842eec2 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 = AX_CALLBACK_2(LoopListScene::renderListItem, this); + _list->itemRenderer = CC_CALLBACK_2(LoopListScene::renderListItem, this); _list->setVirtualAndLoop(); _list->setNumItems(5); - _list->addEventListener(UIEventType::Scroll, AX_CALLBACK_1(LoopListScene::doSpecialEffect, this)); + _list->addEventListener(UIEventType::Scroll, CC_CALLBACK_1(LoopListScene::doSpecialEffect, this)); doSpecialEffect(nullptr); } diff --git a/tests/fairygui-tests/Classes/ModalWaitingScene.cpp b/tests/fairygui-tests/Classes/ModalWaitingScene.cpp index 62b09fe133..c989cc5e65 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() { - AX_SAFE_RELEASE(_testWin); + CC_SAFE_RELEASE(_testWin); } void ModalWaitingScene::continueInit() diff --git a/tests/fairygui-tests/Classes/PullToRefreshScene.cpp b/tests/fairygui-tests/Classes/PullToRefreshScene.cpp index 82ca959c90..0600d04365 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, AX_CALLBACK_1(ScrollPaneHeader::onSizeChanged, this)); + addEventListener(UIEventType::SizeChange, CC_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 = AX_CALLBACK_2(PullToRefreshScene::renderListItem1, this); + _list1->itemRenderer = CC_CALLBACK_2(PullToRefreshScene::renderListItem1, this); _list1->setVirtual(); _list1->setNumItems(1); - _list1->addEventListener(UIEventType::PullDownRelease, AX_CALLBACK_1(PullToRefreshScene::onPullDownToRefresh, this)); + _list1->addEventListener(UIEventType::PullDownRelease, CC_CALLBACK_1(PullToRefreshScene::onPullDownToRefresh, this)); _list2 = _view->getChild("list2")->as(); - _list2->itemRenderer = AX_CALLBACK_2(PullToRefreshScene::renderListItem2, this); + _list2->itemRenderer = CC_CALLBACK_2(PullToRefreshScene::renderListItem2, this); _list2->setVirtual(); _list2->setNumItems(1); - _list2->addEventListener(UIEventType::PullUpRelease, AX_CALLBACK_1(PullToRefreshScene::onPullUpToRefresh, this)); + _list2->addEventListener(UIEventType::PullUpRelease, CC_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 af28613dbc..dc0029881c 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 = AX_CALLBACK_2(ScrollPaneScene::renderListItem, this); + _list->itemRenderer = CC_CALLBACK_2(ScrollPaneScene::renderListItem, this); _list->setVirtual(); _list->setNumItems(1000); - _list->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(ScrollPaneScene::onClickList, this)); + _list->addEventListener(UIEventType::TouchBegin, CC_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(AX_CALLBACK_1(ScrollPaneScene::onClickStick, this), EventTag(this)); - item->getChild("b1")->addClickListener(AX_CALLBACK_1(ScrollPaneScene::onClickDelete, this), EventTag(this)); + item->getChild("b0")->addClickListener(CC_CALLBACK_1(ScrollPaneScene::onClickStick, this), EventTag(this)); + item->getChild("b1")->addClickListener(CC_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 b4477d4fb1..0e6dd17394 100644 --- a/tests/fairygui-tests/Classes/TransitionDemoScene.cpp +++ b/tests/fairygui-tests/Classes/TransitionDemoScene.cpp @@ -4,12 +4,12 @@ USING_NS_AX; TransitionDemoScene::~TransitionDemoScene() { - AX_SAFE_RELEASE(_g1); - AX_SAFE_RELEASE(_g2); - AX_SAFE_RELEASE(_g3); - AX_SAFE_RELEASE(_g4); - AX_SAFE_RELEASE(_g5); - AX_SAFE_RELEASE(_g6); + CC_SAFE_RELEASE(_g1); + CC_SAFE_RELEASE(_g2); + CC_SAFE_RELEASE(_g3); + CC_SAFE_RELEASE(_g4); + CC_SAFE_RELEASE(_g5); + CC_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", AX_CALLBACK_0(TransitionDemoScene::playNum, this)); + _g5->getTransition("t0")->setHook("play_num_now", CC_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(AX_CALLBACK_1(TransitionDemoScene::__play4, this)); - _view->getChild("btn4")->addClickListener(AX_CALLBACK_1(TransitionDemoScene::__play5, this)); + _view->getChild("btn3")->addClickListener(CC_CALLBACK_1(TransitionDemoScene::__play4, this)); + _view->getChild("btn4")->addClickListener(CC_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 37da86bb5a..e63ed7da3c 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, AX_CALLBACK_1(TreeViewScene::onClickNode, this)); + _tree1->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(TreeViewScene::onClickNode, this)); _tree2 = _view->getChild("tree2")->as(); - _tree2->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(TreeViewScene::onClickNode, this)); - _tree2->treeNodeRender = AX_CALLBACK_2(TreeViewScene::renderTreeNode, this); + _tree2->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(TreeViewScene::onClickNode, this)); + _tree2->treeNodeRender = CC_CALLBACK_2(TreeViewScene::renderTreeNode, this); GTreeNode* topNode = GTreeNode::create(true); topNode->setData(Value("I'm a top node")); diff --git a/tests/fairygui-tests/Classes/VirtualListScene.cpp b/tests/fairygui-tests/Classes/VirtualListScene.cpp index 6dc02c3f50..b3ea94f235 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 = AX_CALLBACK_2(VirtualListScene::renderListItem, this); + _list->itemRenderer = CC_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 07fb457bef..fc7e803dcb 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(AX_CALLBACK_0(Window2::onShown, this)); + GTween::to(getScale(), Vec2::ONE, 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(CC_CALLBACK_0(Window2::onShown, this)); } void Window2::doHideAnimation() { - GTween::to(getScale(), Vec2(0.1f, 0.1f), 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(AX_CALLBACK_0(Window2::hideImmediately, this)); + GTween::to(getScale(), Vec2(0.1f, 0.1f), 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(CC_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 4aca219233..7904e7095d 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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_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 06b2349887..df8ffac86f 100644 --- a/tests/live2d-tests/Classes/LAppLive2DManager.cpp +++ b/tests/live2d-tests/Classes/LAppLive2DManager.cpp @@ -87,7 +87,7 @@ LAppLive2DManager::LAppLive2DManager() if (_renderBuffer) {// 描画ターゲット作成 -#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_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(AX_USE_METAL) +#if defined(CC_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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +#if (CC_TARGET_PLATFORM == CC_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 8ad6a1ddb9..b711b54d9f 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 (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#if (CC_TARGET_PLATFORM == CC_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 612e3863f3..f29f9db94b 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 = AX_CALLBACK_2(LAppView::onTouchesBegan, this); - listener->onTouchesMoved = AX_CALLBACK_2(LAppView::onTouchesMoved, this); - listener->onTouchesEnded = AX_CALLBACK_2(LAppView::onTouchesEnded, this); + listener->onTouchesBegan = CC_CALLBACK_2(LAppView::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(LAppView::onTouchesMoved, this); + listener->onTouchesEnded = CC_CALLBACK_2(LAppView::onTouchesEnded, this); // 優先度100でディスパッチャーに登録 this->getEventDispatcher()->addEventListenerWithFixedPriority(listener, 100); @@ -261,6 +261,6 @@ LAppView* LAppView::createDrawNode() ret->autorelease(); return ret; } - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); return nullptr; } diff --git a/tests/live2d-tests/Classes/SampleScene.cpp b/tests/live2d-tests/Classes/SampleScene.cpp index 5c321f788b..ef1e102684 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", - AX_CALLBACK_1(SampleScene::menuCloseCallback, this) + CC_CALLBACK_1(SampleScene::menuCloseCallback, this) ); if (_closeItem == nullptr || @@ -86,7 +86,7 @@ bool SampleScene::init() _changeItem = MenuItemImage::create( "icon_gear.png", "icon_gear.png", - AX_CALLBACK_1(SampleScene::menuChangeCallback, this) + CC_CALLBACK_1(SampleScene::menuChangeCallback, this) ); if (_changeItem == nullptr || @@ -191,7 +191,7 @@ void SampleScene::menuCloseCallback(Ref* pSender) Director::getInstance()->end(); -#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) exit(0); #endif } diff --git a/tests/lua-tests/project/Classes/AppDelegate.cpp b/tests/lua-tests/project/Classes/AppDelegate.cpp index 9cc3456f87..a15a770105 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 (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || \ - AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) +#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) 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 e7ccc209c0..ba919eefac 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 (AX_TARGET_PLATFORM != AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM != CC_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 (AX_TARGET_PLATFORM != AX_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) DIR* pDir = NULL; pDir = opendir(pathToSave.c_str()); @@ -90,7 +90,7 @@ static int lua_cocos2dx_deleteDownloadDir(lua_State* L) #endif std::string pathToSave = tolua_tostring(L, 1, ""); -#if AX_TARGET_OS_TVOS +#if CC_TARGET_OS_TVOS // Not implemented. "system" is not present on tvOS CCLOG("'lua_cocos2dx_deleteDownloadDir' not implemented on tvOS"); return 0; diff --git a/tests/lua-tests/project/Classes/lua_test_bindings.cpp b/tests/lua-tests/project/Classes/lua_test_bindings.cpp index 23625cf6a5..399462daaa 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: - AX_DISALLOW_COPY_AND_ASSIGN(DrawNode3D); + CC_DISALLOW_COPY_AND_ASSIGN(DrawNode3D); bool _rendererDepthTestEnabled = false; @@ -111,7 +111,7 @@ DrawNode3D::DrawNode3D() {} DrawNode3D::~DrawNode3D() { - AX_SAFE_RELEASE_NULL(_programState); + CC_SAFE_RELEASE_NULL(_programState); } DrawNode3D* DrawNode3D::create() @@ -123,7 +123,7 @@ DrawNode3D* DrawNode3D::create() } else { - AX_SAFE_DELETE(ret); + CC_SAFE_DELETE(ret); } return ret; @@ -176,10 +176,10 @@ bool DrawNode3D::init() _dirty = true; - _customCommand.setBeforeCallback(AX_CALLBACK_0(DrawNode3D::onBeforeDraw, this)); - _customCommand.setAfterCallback(AX_CALLBACK_0(DrawNode3D::onAfterDraw, this)); + _customCommand.setBeforeCallback(CC_CALLBACK_0(DrawNode3D::onBeforeDraw, this)); + _customCommand.setAfterCallback(CC_CALLBACK_0(DrawNode3D::onAfterDraw, this)); -#if AX_ENABLE_CACHE_TEXTURE_DATA +#if CC_ENABLE_CACHE_TEXTURE_DATA // Need to listen the event only when not use batchnode, because it will use VBO auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event) { /** listen the event that coming to foreground on Android */ 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 fe2c093ca3..3445999a14 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(AX_TARGET_OS_TVOS) +#if !defined(CC_TARGET_OS_TVOS) [eaglView setMultipleTouchEnabled:YES]; #endif // Use RootViewController manage CCEAGLView viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; -#if !defined(AX_TARGET_OS_TVOS) +#if !defined(CC_TARGET_OS_TVOS) viewController.wantsFullScreenLayout = YES; #endif viewController.view = eaglView; @@ -81,7 +81,7 @@ static AppDelegate s_sharedApplication; [window makeKeyAndVisible]; -#if !defined(AX_TARGET_OS_TVOS) +#if !defined(CC_TARGET_OS_TVOS) [[UIApplication sharedApplication] setStatusBarHidden:YES]; #endif 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 4b3fe1d864..7a795176b0 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", - AX_CALLBACK_1(HelloWorld::menuCloseCallback, this)); + CC_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 c656400d67..2a7389f3ae 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 -AX_USE_FRAMEWORK = true +CC_USE_FRAMEWORK = true -- show FPS on screen -AX_SHOW_FPS = true +CC_SHOW_FPS = true -- disable create unexpected global variable -AX_DISABLE_GLOBAL = true +CC_DISABLE_GLOBAL = true -- for module display -AX_DESIGN_RESOLUTION = { +CC_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 5666a2afd2..710fa0fcbf 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 = { - "AX_TARGET_OS_IPHONE,":"AX_TARGET_OS_IPHONE,\n\"COCOS2D_DEBUG=1\",", - "AX_TARGET_OS_MAC,":"AX_TARGET_OS_MAC,\n\"COCOS2D_DEBUG=1\",", + "CC_TARGET_OS_IPHONE,":"CC_TARGET_OS_IPHONE,\n\"COCOS2D_DEBUG=1\",", + "CC_TARGET_OS_MAC,":"CC_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 9db30b2be5..a34d8ccc5c 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 = ( - "AX_LUA_ENGINE_ENABLED=1", + "CC_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 = "AX_LUA_ENGINE_ENABLED=1"; + GCC_PREPROCESSOR_DEFINITIONS = "CC_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)", - AX_TARGET_OS_IPHONE, + CC_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)", - AX_TARGET_OS_IPHONE, + CC_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 0c4ec7379e..26aaa6ff24 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;AX_USE_CURL=1;AX_LUA_ENGINE_ENABLED=1;%(PreprocessorDefinitions) + WIN32;_WINDOWS;_DEBUG;_LIB;CC_USE_CURL=1;CC_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 ed7148f15d..89dd473c44 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 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 +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 android_headers = diff --git a/tools/tolua/axis_controller.ini b/tools/tolua/axis_controller.ini index c877ea8663..eab34991ae 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 (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) +macro_judgement = #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) android_headers = diff --git a/tools/tolua/axis_navmesh.ini b/tools/tolua/axis_navmesh.ini index 01cb7345ae..7392545e1e 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 AX_USE_NAVMESH +macro_judgement = #if CC_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__ -DAX__USE_NAVMESH +clang_flags = -nostdinc -x c++ -std=c++17 -fsigned-char -U__SSE__ -DCC_USE_NAVMESH win32_clang_flags = -U __SSE__ diff --git a/tools/tolua/axis_physics.ini b/tools/tolua/axis_physics.ini index 6a2ef15dbd..9671bcc6bd 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 AX_USE_PHYSICS +macro_judgement = #if CC_USE_PHYSICS android_headers = diff --git a/tools/tolua/axis_physics3d.ini b/tools/tolua/axis_physics3d.ini index ab17daa633..705fc9188a 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 AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION +macro_judgement = #if CC_USE_3D_PHYSICS && CC_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__ -DAX__ENABLE_BULLET_INTEGRATION +clang_flags = -nostdinc -x c++ -std=c++17 -fsigned-char -U__SSE__ -DCC_ENABLE_BULLET_INTEGRATION win32_clang_flags = -U __SSE__