From 41d2c443083d5ef9ab548c02de955047190da3d2 Mon Sep 17 00:00:00 2001 From: halx99 Date: Fri, 15 Jul 2022 19:17:01 +0800 Subject: [PATCH] Migrate macros 'CC_' to 'AX_' --- cmake/Modules/AxisBuildHelpers.cmake | 4 +- cmake/Modules/AxisConfigDefine.cmake | 4 +- cmake/Modules/AxisLinkHelpers.cmake | 2 +- core/2d/CCAction.cpp | 10 +- core/2d/CCAction.h | 24 +- core/2d/CCActionCamera.cpp | 12 +- core/2d/CCActionCamera.h | 4 +- core/2d/CCActionCatmullRom.cpp | 12 +- core/2d/CCActionCatmullRom.h | 16 +- core/2d/CCActionEase.cpp | 10 +- core/2d/CCActionEase.h | 30 +-- core/2d/CCActionGrid.cpp | 6 +- core/2d/CCActionGrid.h | 34 +-- core/2d/CCActionGrid3D.cpp | 14 +- core/2d/CCActionGrid3D.h | 36 +-- core/2d/CCActionInstant.cpp | 10 +- core/2d/CCActionInstant.h | 42 ++-- core/2d/CCActionInterval.cpp | 62 +++--- core/2d/CCActionInterval.h | 134 ++++++------ core/2d/CCActionManager.cpp | 2 +- core/2d/CCActionManager.h | 2 +- core/2d/CCActionPageTurn3D.h | 2 +- core/2d/CCActionProgressTimer.h | 8 +- core/2d/CCActionTiledGrid.cpp | 6 +- core/2d/CCActionTiledGrid.h | 48 ++-- core/2d/CCActionTween.h | 4 +- core/2d/CCAnimation.cpp | 4 +- core/2d/CCAnimation.h | 18 +- core/2d/CCAnimationCache.cpp | 2 +- core/2d/CCAnimationCache.h | 8 +- core/2d/CCAtlasNode.cpp | 8 +- core/2d/CCAtlasNode.h | 4 +- core/2d/CCAutoPolygon.cpp | 8 +- core/2d/CCAutoPolygon.h | 4 +- core/2d/CCCamera.cpp | 6 +- core/2d/CCCamera.h | 2 +- core/2d/CCCameraBackgroundBrush.cpp | 46 ++-- core/2d/CCCameraBackgroundBrush.h | 12 +- core/2d/CCClippingNode.cpp | 22 +- core/2d/CCClippingNode.h | 4 +- core/2d/CCClippingRectangleNode.cpp | 8 +- core/2d/CCClippingRectangleNode.h | 2 +- core/2d/CCComponent.cpp | 2 +- core/2d/CCComponent.h | 8 +- core/2d/CCComponentContainer.cpp | 6 +- core/2d/CCComponentContainer.h | 8 +- core/2d/CCDrawNode.cpp | 14 +- core/2d/CCDrawNode.h | 4 +- core/2d/CCFastTMXLayer.cpp | 44 ++-- core/2d/CCFastTMXLayer.h | 12 +- core/2d/CCFastTMXTiledMap.cpp | 4 +- core/2d/CCFastTMXTiledMap.h | 6 +- core/2d/CCFont.h | 2 +- core/2d/CCFontAtlas.cpp | 26 +-- core/2d/CCFontAtlas.h | 4 +- core/2d/CCFontAtlasCache.cpp | 4 +- core/2d/CCFontAtlasCache.h | 6 +- core/2d/CCFontCharMap.cpp | 2 +- core/2d/CCFontFNT.cpp | 14 +- core/2d/CCFontFNT.h | 6 +- core/2d/CCFontFreeType.cpp | 4 +- core/2d/CCFontFreeType.h | 2 +- core/2d/CCGrid.cpp | 52 ++--- core/2d/CCGrid.h | 6 +- core/2d/CCLabel.cpp | 62 +++--- core/2d/CCLabel.h | 14 +- core/2d/CCLabelAtlas.cpp | 22 +- core/2d/CCLabelAtlas.h | 10 +- core/2d/CCLabelTextFormatter.cpp | 10 +- core/2d/CCLayer.cpp | 42 ++-- core/2d/CCLayer.h | 14 +- core/2d/CCLight.cpp | 6 +- core/2d/CCLight.h | 10 +- core/2d/CCMenu.cpp | 10 +- core/2d/CCMenu.h | 10 +- core/2d/CCMenuItem.cpp | 26 +-- core/2d/CCMenuItem.h | 30 +-- core/2d/CCMotionStreak.cpp | 20 +- core/2d/CCMotionStreak.h | 4 +- core/2d/CCNode.cpp | 112 +++++----- core/2d/CCNode.h | 22 +- core/2d/CCNodeGrid.cpp | 18 +- core/2d/CCNodeGrid.h | 4 +- core/2d/CCParallaxNode.h | 4 +- core/2d/CCParticleBatchNode.cpp | 14 +- core/2d/CCParticleBatchNode.h | 2 +- core/2d/CCParticleExamples.cpp | 50 ++--- core/2d/CCParticleExamples.h | 44 ++-- core/2d/CCParticleSystem.cpp | 144 ++++++------ core/2d/CCParticleSystem.h | 12 +- core/2d/CCParticleSystemQuad.cpp | 40 ++-- core/2d/CCParticleSystemQuad.h | 4 +- core/2d/CCPlistSpriteSheetLoader.cpp | 2 +- core/2d/CCProgressTimer.cpp | 16 +- core/2d/CCProgressTimer.h | 4 +- core/2d/CCProtectedNode.cpp | 16 +- core/2d/CCProtectedNode.h | 4 +- core/2d/CCRenderTexture.cpp | 56 ++--- core/2d/CCRenderTexture.h | 4 +- core/2d/CCScene.cpp | 68 +++--- core/2d/CCScene.h | 26 +-- core/2d/CCSprite.cpp | 64 +++--- core/2d/CCSprite.h | 10 +- core/2d/CCSpriteBatchNode.cpp | 10 +- core/2d/CCSpriteBatchNode.h | 6 +- core/2d/CCSpriteFrame.cpp | 32 +-- core/2d/CCSpriteFrame.h | 2 +- core/2d/CCSpriteFrameCache.cpp | 2 +- core/2d/CCSpriteFrameCache.h | 2 +- core/2d/CCSpriteSheetLoader.cpp | 2 +- core/2d/CCTMXObjectGroup.h | 2 +- core/2d/CCTMXXMLParser.cpp | 10 +- core/2d/CCTMXXMLParser.h | 14 +- core/2d/CCTextFieldTTF.cpp | 10 +- core/2d/CCTextFieldTTF.h | 10 +- core/2d/CCTileMapAtlas.cpp | 8 +- core/2d/CCTileMapAtlas.h | 2 +- core/2d/CCTransition.cpp | 104 ++++----- core/2d/CCTransition.h | 114 +++++----- core/2d/CCTransitionPageTurn.cpp | 8 +- core/2d/CCTransitionPageTurn.h | 2 +- core/2d/CCTransitionProgress.cpp | 16 +- core/2d/CCTransitionProgress.h | 14 +- core/2d/CCTweenFunction.h | 82 +++---- core/3d/CC3DProgramInfo.cpp | 32 +-- core/3d/CCAABB.h | 6 +- core/3d/CCAnimate3D.cpp | 2 +- core/3d/CCAnimate3D.h | 2 +- core/3d/CCAnimation3D.cpp | 14 +- core/3d/CCAnimation3D.h | 2 +- core/3d/CCAnimationCurve.inl | 4 +- core/3d/CCAttachNode.h | 2 +- core/3d/CCBillBoard.cpp | 8 +- core/3d/CCBillBoard.h | 4 +- core/3d/CCBundle3D.cpp | 68 +++--- core/3d/CCBundle3D.h | 2 +- core/3d/CCBundle3DData.h | 8 +- core/3d/CCBundleReader.h | 4 +- core/3d/CCFrustum.h | 8 +- core/3d/CCMesh.cpp | 24 +- core/3d/CCMesh.h | 4 +- core/3d/CCMeshMaterial.cpp | 50 ++--- core/3d/CCMeshMaterial.h | 2 +- core/3d/CCMeshRenderer.cpp | 34 +-- core/3d/CCMeshRenderer.h | 10 +- core/3d/CCMeshSkin.cpp | 4 +- core/3d/CCMeshSkin.h | 2 +- core/3d/CCMeshVertexIndexData.cpp | 24 +- core/3d/CCMeshVertexIndexData.h | 8 +- core/3d/CCMotionStreak3D.cpp | 16 +- core/3d/CCMotionStreak3D.h | 10 +- core/3d/CCOBB.cpp | 2 +- core/3d/CCOBB.h | 6 +- core/3d/CCPlane.h | 6 +- core/3d/CCRay.h | 6 +- core/3d/CCSkeleton3D.h | 4 +- core/3d/CCSkybox.cpp | 8 +- core/3d/CCSkybox.h | 4 +- core/3d/CCTerrain.cpp | 52 ++--- core/3d/CCTerrain.h | 14 +- core/3d/CCVertexAttribBinding.cpp | 6 +- core/3d/CCVertexAttribBinding.h | 2 +- core/audio/AudioCache.h | 2 +- core/audio/AudioDecoderMp3.cpp | 20 +- core/audio/AudioDecoderMp3.h | 6 +- core/audio/AudioDecoderOgg.cpp | 2 +- core/audio/AudioEngine.cpp | 2 +- core/audio/AudioEngine.h | 4 +- core/audio/AudioEngineImpl.cpp | 16 +- core/audio/AudioEngineImpl.h | 2 +- core/audio/AudioMacros.h | 4 +- core/audio/AudioPlayer.cpp | 2 +- core/audio/AudioPlayer.h | 2 +- core/axis.cpp | 4 +- core/axis.h | 22 +- core/base/CCAsyncTaskPool.h | 4 +- core/base/CCAutoreleasePool.cpp | 2 +- core/base/CCAutoreleasePool.h | 4 +- core/base/CCConfiguration.cpp | 20 +- core/base/CCConfiguration.h | 2 +- core/base/CCConsole.cpp | 100 ++++----- core/base/CCConsole.h | 10 +- core/base/CCController-android.cpp | 4 +- core/base/CCController-apple.mm | 6 +- core/base/CCController-linux-win32.cpp | 6 +- core/base/CCController.cpp | 10 +- core/base/CCController.h | 10 +- core/base/CCData.h | 2 +- core/base/CCDirector.cpp | 128 +++++------ core/base/CCDirector.h | 4 +- core/base/CCEvent.h | 2 +- core/base/CCEventAcceleration.h | 2 +- core/base/CCEventController.h | 2 +- core/base/CCEventCustom.h | 2 +- core/base/CCEventDispatcher.cpp | 40 ++-- core/base/CCEventDispatcher.h | 10 +- core/base/CCEventFocus.h | 2 +- core/base/CCEventKeyboard.h | 2 +- core/base/CCEventListener.h | 2 +- core/base/CCEventListenerAcceleration.cpp | 4 +- core/base/CCEventListenerAcceleration.h | 2 +- core/base/CCEventListenerController.cpp | 2 +- core/base/CCEventListenerController.h | 2 +- core/base/CCEventListenerCustom.cpp | 4 +- core/base/CCEventListenerCustom.h | 2 +- core/base/CCEventListenerFocus.cpp | 4 +- core/base/CCEventListenerFocus.h | 2 +- core/base/CCEventListenerKeyboard.cpp | 4 +- core/base/CCEventListenerKeyboard.h | 2 +- core/base/CCEventListenerMouse.cpp | 4 +- core/base/CCEventListenerMouse.h | 2 +- core/base/CCEventListenerTouch.cpp | 8 +- core/base/CCEventListenerTouch.h | 4 +- core/base/CCEventMouse.h | 2 +- core/base/CCEventTouch.h | 2 +- core/base/CCIMEDelegate.h | 10 +- core/base/CCIMEDispatcher.cpp | 32 +-- core/base/CCIMEDispatcher.h | 8 +- core/base/CCNS.cpp | 26 +-- core/base/CCNS.h | 6 +- core/base/CCNinePatchImageParser.cpp | 2 +- core/base/CCNinePatchImageParser.h | 2 +- core/base/CCProfiling.h | 10 +- core/base/CCProperties.cpp | 16 +- core/base/CCProperties.h | 2 +- core/base/CCProtocols.h | 12 +- core/base/CCRef.cpp | 24 +- core/base/CCRef.h | 24 +- core/base/CCRefPtr.h | 40 ++-- core/base/CCScheduler.cpp | 18 +- core/base/CCScheduler.h | 24 +- core/base/CCScriptSupport.cpp | 6 +- core/base/CCScriptSupport.h | 8 +- core/base/CCStencilStateManager.cpp | 6 +- core/base/CCStencilStateManager.h | 4 +- core/base/CCTouch.h | 6 +- core/base/CCUserDefault.cpp | 2 +- core/base/CCUserDefault.h | 2 +- core/base/CCValue.cpp | 8 +- core/base/CCValue.h | 8 +- core/base/ObjectFactory.cpp | 2 +- core/base/ObjectFactory.h | 4 +- core/base/SimpleTimer.h | 8 +- core/base/TGAlib.cpp | 14 +- core/base/ZipUtils.cpp | 60 ++--- core/base/ZipUtils.h | 10 +- core/base/base64.cpp | 6 +- core/base/base64.h | 4 +- core/base/bitmask.h | 4 +- core/base/ccCArray.cpp | 24 +- core/base/ccCArray.h | 80 +++---- core/base/ccConfig.h | 206 +++++++++--------- core/base/ccFPSImages.c | 4 +- core/base/ccFPSImages.h | 2 +- core/base/ccMacros.h | 178 +++++++-------- core/base/ccRandom.h | 2 +- core/base/ccTypes.cpp | 2 +- core/base/ccTypes.h | 60 ++--- core/base/ccUTF8.cpp | 8 +- core/base/ccUTF8.h | 48 ++-- core/base/ccUtils.cpp | 8 +- core/base/ccUtils.h | 62 +++--- core/cocos2d.h | 2 +- core/math/CCAffineTransform.h | 32 +-- core/math/CCMath.h | 4 +- core/math/CCVertex.cpp | 4 +- core/math/CCVertex.h | 4 +- core/math/Mat4.cpp | 4 +- core/math/Mat4.h | 2 +- core/math/MathUtil.cpp | 8 +- core/math/MathUtil.h | 2 +- core/math/Quaternion.h | 2 +- core/math/Rect.h | 2 +- core/math/TransformUtils.h | 4 +- core/math/Vec2.h | 2 +- core/math/Vec3.h | 2 +- core/math/Vec4.h | 2 +- core/navmesh/CCNavMesh.cpp | 18 +- core/navmesh/CCNavMesh.h | 6 +- core/navmesh/CCNavMeshAgent.cpp | 6 +- core/navmesh/CCNavMeshAgent.h | 10 +- core/navmesh/CCNavMeshDebugDraw.cpp | 16 +- core/navmesh/CCNavMeshDebugDraw.h | 4 +- core/navmesh/CCNavMeshObstacle.cpp | 6 +- core/navmesh/CCNavMeshObstacle.h | 6 +- core/navmesh/CCNavMeshUtils.cpp | 4 +- core/navmesh/CCNavMeshUtils.h | 4 +- core/network/CCDownloader-curl.cpp | 4 +- core/network/CCDownloader.h | 6 +- core/network/CCIDownloaderImpl.h | 6 +- core/network/HttpClient.cpp | 6 +- core/network/HttpClient.h | 2 +- core/network/HttpRequest.h | 2 +- core/network/HttpResponse.h | 2 +- core/network/Uri.h | 2 +- core/physics/CCPhysicsBody.cpp | 26 +-- core/physics/CCPhysicsBody.h | 6 +- core/physics/CCPhysicsContact.cpp | 30 +-- core/physics/CCPhysicsContact.h | 20 +- core/physics/CCPhysicsHelper.h | 4 +- core/physics/CCPhysicsJoint.cpp | 156 ++++++------- core/physics/CCPhysicsJoint.h | 28 +-- core/physics/CCPhysicsShape.cpp | 62 +++--- core/physics/CCPhysicsShape.h | 22 +- core/physics/CCPhysicsWorld.cpp | 36 +-- core/physics/CCPhysicsWorld.h | 8 +- core/physics3d/CCPhysics3D.cpp | 12 +- core/physics3d/CCPhysics3D.h | 10 +- core/physics3d/CCPhysics3DComponent.cpp | 16 +- core/physics3d/CCPhysics3DComponent.h | 10 +- core/physics3d/CCPhysics3DConstraint.cpp | 18 +- core/physics3d/CCPhysics3DConstraint.h | 22 +- core/physics3d/CCPhysics3DDebugDrawer.cpp | 18 +- core/physics3d/CCPhysics3DDebugDrawer.h | 8 +- core/physics3d/CCPhysics3DObject.cpp | 22 +- core/physics3d/CCPhysics3DObject.h | 20 +- core/physics3d/CCPhysics3DShape.cpp | 20 +- core/physics3d/CCPhysics3DShape.h | 14 +- core/physics3d/CCPhysics3DWorld.cpp | 24 +- core/physics3d/CCPhysics3DWorld.h | 14 +- core/physics3d/CCPhysicsMeshRenderer.cpp | 12 +- core/physics3d/CCPhysicsMeshRenderer.h | 10 +- core/platform/CCApplication.h | 10 +- core/platform/CCApplicationProtocol.h | 8 +- core/platform/CCCommon.h | 10 +- core/platform/CCDevice.h | 4 +- core/platform/CCFileStream.h | 2 +- core/platform/CCFileUtils.cpp | 22 +- core/platform/CCFileUtils.h | 8 +- core/platform/CCGL.h | 10 +- core/platform/CCGLView.h | 28 +-- core/platform/CCImage.cpp | 116 +++++----- core/platform/CCImage.h | 10 +- core/platform/CCPlatformConfig.h | 92 ++++---- core/platform/CCPlatformDefine.h | 10 +- core/platform/CCPlatformMacros.h | 132 +++++------ core/platform/CCPosixFileStream.cpp | 8 +- core/platform/CCPosixFileStream.h | 8 +- core/platform/CCSAXParser.cpp | 18 +- core/platform/CCSAXParser.h | 12 +- core/platform/CCStdC.h | 10 +- core/platform/android/CCApplication-android.h | 4 +- core/platform/android/CCEnhanceAPI-android.h | 2 +- core/platform/android/CCFileUtils-android.h | 2 +- .../platform/android/CCGLViewImpl-android.cpp | 6 +- core/platform/android/CCGLViewImpl-android.h | 2 +- .../android/CCPlatformDefine-android.h | 10 +- core/platform/android/jni/JniHelper.h | 2 +- core/platform/apple/CCDevice-apple.mm | 4 +- core/platform/apple/CCFileUtils-apple.h | 10 +- core/platform/apple/CCFileUtils-apple.mm | 2 +- .../platform/desktop/CCGLViewImpl-desktop.cpp | 44 ++-- core/platform/desktop/CCGLViewImpl-desktop.h | 24 +- core/platform/ios/CCApplication-ios.h | 2 +- core/platform/ios/CCApplication-ios.mm | 6 +- core/platform/ios/CCCommon-ios.mm | 2 +- core/platform/ios/CCDevice-ios.mm | 20 +- core/platform/ios/CCDirectorCaller-ios.mm | 2 +- core/platform/ios/CCEAGLView-ios.h | 6 +- core/platform/ios/CCEAGLView-ios.mm | 24 +- core/platform/ios/CCES2Renderer-ios.h | 4 +- core/platform/ios/CCES2Renderer-ios.m | 4 +- core/platform/ios/CCESRenderer-ios.h | 4 +- core/platform/ios/CCGL-ios.h | 4 +- core/platform/ios/CCGLViewImpl-ios.h | 2 +- core/platform/ios/CCGLViewImpl-ios.mm | 12 +- core/platform/ios/CCPlatformDefine-ios.h | 6 +- core/platform/ios/OpenGL_Internal-ios.h | 4 +- core/platform/linux/CCApplication-linux.cpp | 6 +- core/platform/linux/CCApplication-linux.h | 6 +- core/platform/linux/CCDevice-linux.cpp | 4 +- core/platform/linux/CCFileUtils-linux.h | 2 +- core/platform/linux/CCPlatformDefine-linux.h | 6 +- core/platform/mac/CCApplication-mac.h | 2 +- core/platform/mac/CCDevice-mac.mm | 6 +- core/platform/mac/CCGL-mac.h | 6 +- core/platform/mac/CCGLViewImpl-mac.h | 16 +- core/platform/mac/CCGLViewImpl-mac.mm | 34 +-- core/platform/mac/CCPlatformDefine-mac.h | 10 +- core/platform/win32/CCApplication-win32.cpp | 6 +- core/platform/win32/CCApplication-win32.h | 6 +- core/platform/win32/CCDevice-win32.cpp | 24 +- core/platform/win32/CCFileUtils-win32.h | 2 +- core/platform/win32/CCGL-win32.h | 6 +- core/platform/win32/CCPlatformDefine-win32.h | 16 +- core/platform/win32/CCStdC-win32.h | 2 +- core/platform/win32/compat/stdint.h | 4 +- core/renderer/CCCallbackCommand.h | 2 +- core/renderer/CCColorizer.h | 2 +- core/renderer/CCCustomCommand.cpp | 20 +- core/renderer/CCCustomCommand.h | 2 +- core/renderer/CCGroupCommand.h | 8 +- core/renderer/CCMaterial.cpp | 10 +- core/renderer/CCMaterial.h | 2 +- core/renderer/CCMeshCommand.cpp | 10 +- core/renderer/CCMeshCommand.h | 6 +- core/renderer/CCPass.cpp | 22 +- core/renderer/CCPass.h | 2 +- core/renderer/CCPipelineDescriptor.h | 2 +- core/renderer/CCQuadCommand.cpp | 2 +- core/renderer/CCQuadCommand.h | 8 +- core/renderer/CCRenderCommand.h | 2 +- core/renderer/CCRenderCommandPool.h | 4 +- core/renderer/CCRenderState.cpp | 4 +- core/renderer/CCRenderState.h | 4 +- core/renderer/CCRenderer.cpp | 26 +-- core/renderer/CCRenderer.h | 2 +- core/renderer/CCTechnique.cpp | 2 +- core/renderer/CCTechnique.h | 2 +- core/renderer/CCTexture2D.cpp | 32 +-- core/renderer/CCTexture2D.h | 2 +- core/renderer/CCTextureAtlas.cpp | 32 +-- core/renderer/CCTextureAtlas.h | 4 +- core/renderer/CCTextureCache.cpp | 32 +-- core/renderer/CCTextureCache.h | 8 +- core/renderer/CCTextureCube.cpp | 6 +- core/renderer/CCTextureCube.h | 2 +- core/renderer/CCTrianglesCommand.h | 2 +- core/renderer/backend/Device.h | 2 +- core/renderer/backend/Enums.h | 10 +- core/renderer/backend/Macros.h | 2 +- core/renderer/backend/PixelFormatUtils.cpp | 4 +- core/renderer/backend/Program.h | 4 +- core/renderer/backend/ProgramCache.cpp | 6 +- core/renderer/backend/ProgramState.cpp | 50 ++--- core/renderer/backend/ProgramState.h | 16 +- .../renderer/backend/ProgramStateRegistry.cpp | 4 +- core/renderer/backend/RenderTarget.h | 22 +- core/renderer/backend/ShaderCache.cpp | 6 +- core/renderer/backend/ShaderCache.h | 2 +- core/renderer/backend/ShaderModule.h | 2 +- core/renderer/backend/VertexLayout.h | 2 +- .../backend/metal/CommandBufferMTL.mm | 14 +- core/renderer/backend/metal/DeviceInfoMTL.mm | 2 +- core/renderer/backend/metal/ProgramMTL.mm | 8 +- core/renderer/backend/metal/TextureMTL.h | 2 +- core/renderer/backend/metal/TextureMTL.mm | 2 +- core/renderer/backend/metal/UtilsMTL.mm | 6 +- core/renderer/backend/opengl/BufferGL.cpp | 14 +- core/renderer/backend/opengl/BufferGL.h | 2 +- .../backend/opengl/CommandBufferGL.cpp | 24 +- .../renderer/backend/opengl/CommandBufferGL.h | 2 +- core/renderer/backend/opengl/DeviceInfoGL.cpp | 4 +- core/renderer/backend/opengl/MacrosGL.h | 6 +- core/renderer/backend/opengl/ProgramGL.cpp | 20 +- core/renderer/backend/opengl/ProgramGL.h | 4 +- .../backend/opengl/RenderPipelineGL.cpp | 6 +- .../backend/opengl/RenderTargetGL.cpp | 2 +- core/renderer/backend/opengl/TextureGL.cpp | 12 +- core/renderer/backend/opengl/TextureGL.h | 2 +- core/renderer/backend/opengl/UtilsGL.cpp | 4 +- core/renderer/ccShaders.h | 88 ++++---- core/ui/CocosGUI.h | 2 +- core/ui/GUIDefine.h | 4 +- core/ui/GUIExport.h | 12 +- core/ui/LayoutHelper.cpp | 32 +-- core/ui/LayoutHelper.h | 40 ++-- core/ui/UIAbstractCheckButton.h | 4 +- core/ui/UIButton.cpp | 10 +- core/ui/UIButton.h | 4 +- core/ui/UICheckBox.cpp | 6 +- core/ui/UICheckBox.h | 2 +- core/ui/UIEditBox/UIEditBox.cpp | 14 +- core/ui/UIEditBox/UIEditBox.h | 10 +- core/ui/UIEditBox/UIEditBoxImpl-android.cpp | 4 +- core/ui/UIEditBox/UIEditBoxImpl-android.h | 4 +- core/ui/UIEditBox/UIEditBoxImpl-common.cpp | 20 +- core/ui/UIEditBox/UIEditBoxImpl-common.h | 2 +- core/ui/UIEditBox/UIEditBoxImpl-ios.h | 4 +- core/ui/UIEditBox/UIEditBoxImpl-ios.mm | 4 +- core/ui/UIEditBox/UIEditBoxImpl-linux.cpp | 4 +- core/ui/UIEditBox/UIEditBoxImpl-linux.h | 4 +- core/ui/UIEditBox/UIEditBoxImpl-mac.h | 4 +- core/ui/UIEditBox/UIEditBoxImpl-mac.mm | 4 +- core/ui/UIEditBox/UIEditBoxImpl-stub.cpp | 4 +- core/ui/UIEditBox/UIEditBoxImpl-win32.cpp | 4 +- core/ui/UIEditBox/UIEditBoxImpl-win32.h | 6 +- core/ui/UIEditBox/UIEditBoxImpl.h | 2 +- .../UIEditBox/iOS/CCUIMultilineTextField.mm | 4 +- .../UIEditBox/iOS/CCUISingleLineTextField.mm | 2 +- core/ui/UIEditBox/iOS/CCUITextInput.h | 2 +- core/ui/UIHBox.cpp | 4 +- core/ui/UIHBox.h | 2 +- core/ui/UIHelper.h | 2 +- core/ui/UIImageView.cpp | 4 +- core/ui/UIImageView.h | 4 +- core/ui/UILayout.cpp | 34 +-- core/ui/UILayout.h | 6 +- core/ui/UILayoutComponent.cpp | 2 +- core/ui/UILayoutComponent.h | 2 +- core/ui/UILayoutManager.h | 10 +- core/ui/UILayoutParameter.h | 10 +- core/ui/UIListView.cpp | 8 +- core/ui/UIListView.h | 2 +- core/ui/UILoadingBar.cpp | 4 +- core/ui/UILoadingBar.h | 4 +- core/ui/UIPageView.cpp | 2 +- core/ui/UIPageView.h | 2 +- core/ui/UIPageViewIndicator.cpp | 2 +- core/ui/UIRadioButton.cpp | 10 +- core/ui/UIRadioButton.h | 4 +- core/ui/UIRelativeBox.cpp | 4 +- core/ui/UIRelativeBox.h | 2 +- core/ui/UIRichText.cpp | 14 +- core/ui/UIRichText.h | 14 +- core/ui/UIScale9Sprite.cpp | 18 +- core/ui/UIScale9Sprite.h | 2 +- core/ui/UIScrollView.cpp | 2 +- core/ui/UIScrollView.h | 2 +- core/ui/UIScrollViewBar.cpp | 2 +- core/ui/UIScrollViewBar.h | 2 +- core/ui/UISlider.cpp | 4 +- core/ui/UISlider.h | 4 +- core/ui/UITabControl.cpp | 14 +- core/ui/UITabControl.h | 4 +- core/ui/UIText.cpp | 4 +- core/ui/UIText.h | 2 +- core/ui/UITextAtlas.cpp | 4 +- core/ui/UITextAtlas.h | 4 +- core/ui/UITextBMFont.cpp | 4 +- core/ui/UITextBMFont.h | 4 +- core/ui/UITextField.cpp | 6 +- core/ui/UITextField.h | 4 +- core/ui/UITextFieldEx.cpp | 8 +- core/ui/UITextFieldEx.h | 4 +- core/ui/UIVBox.cpp | 4 +- core/ui/UIVBox.h | 2 +- .../UIVideoPlayer/UIVideoPlayer-android.cpp | 6 +- core/ui/UIVideoPlayer/UIVideoPlayer-ios.mm | 6 +- core/ui/UIVideoPlayer/UIVideoPlayer-win.cpp | 6 +- core/ui/UIVideoPlayer/UIVideoPlayer.h | 10 +- core/ui/UIWebView/UIWebView-inl.h | 4 +- core/ui/UIWebView/UIWebView.cpp | 4 +- core/ui/UIWebView/UIWebView.h | 4 +- core/ui/UIWebView/UIWebViewImpl-win32.cpp | 4 +- core/ui/UIWebView/UIWebViewImpl-win32.h | 4 +- core/ui/UIWidget.cpp | 24 +- core/ui/UIWidget.h | 2 +- extensions/DragonBones/CCArmatureDisplay.cpp | 12 +- extensions/DragonBones/CCArmatureDisplay.h | 6 +- extensions/DragonBones/CCDragonBonesHeaders.h | 6 +- extensions/DragonBones/CCFactory.h | 6 +- extensions/DragonBones/CCSlot.h | 6 +- extensions/DragonBones/CCTextureAtlasData.h | 6 +- extensions/ExtensionExport.h | 12 +- .../GUI/CCControlExtension/CCControl.cpp | 12 +- extensions/GUI/CCControlExtension/CCControl.h | 10 +- .../CCControlExtension/CCControlButton.cpp | 6 +- .../GUI/CCControlExtension/CCControlButton.h | 22 +- .../CCControlColourPicker.cpp | 8 +- .../CCControlColourPicker.h | 8 +- .../CCControlExtension/CCControlHuePicker.cpp | 8 +- .../CCControlExtension/CCControlHuePicker.h | 12 +- .../CCControlPotentiometer.cpp | 6 +- .../CCControlPotentiometer.h | 8 +- .../CCControlSaturationBrightnessPicker.h | 16 +- .../CCControlExtension/CCControlSlider.cpp | 8 +- .../GUI/CCControlExtension/CCControlSlider.h | 20 +- .../CCControlExtension/CCControlStepper.cpp | 14 +- .../GUI/CCControlExtension/CCControlStepper.h | 10 +- .../CCControlExtension/CCControlSwitch.cpp | 42 ++-- .../GUI/CCControlExtension/CCControlSwitch.h | 2 +- .../GUI/CCControlExtension/CCControlUtils.h | 4 +- .../GUI/CCControlExtension/CCInvocation.h | 8 +- extensions/GUI/CCScrollView/CCScrollView.cpp | 30 +-- extensions/GUI/CCScrollView/CCScrollView.h | 4 +- extensions/GUI/CCScrollView/CCTableView.cpp | 18 +- extensions/GUI/CCScrollView/CCTableView.h | 6 +- .../GUI/CCScrollView/CCTableViewCell.cpp | 2 +- extensions/GUI/CCScrollView/CCTableViewCell.h | 2 +- extensions/ImGui/ImGuiPresenter.cpp | 20 +- extensions/ImGui/README.md | 2 +- extensions/ImGui/imgui_impl_axis.cpp | 24 +- .../axis/CubismOffscreenSurface_Cocos2dx.cpp | 2 +- .../axis/CubismRenderer_Cocos2dx.cpp | 22 +- extensions/Particle3D/CCParticle3DAffector.h | 6 +- extensions/Particle3D/CCParticle3DEmitter.h | 6 +- extensions/Particle3D/CCParticle3DRender.cpp | 16 +- extensions/Particle3D/CCParticle3DRender.h | 6 +- extensions/Particle3D/CCParticleSystem3D.cpp | 12 +- extensions/Particle3D/CCParticleSystem3D.h | 10 +- extensions/Particle3D/PU/CCPUAffector.h | 6 +- .../Particle3D/PU/CCPUAffectorManager.h | 6 +- .../Particle3D/PU/CCPUAffectorTranslator.h | 6 +- extensions/Particle3D/PU/CCPUAlignAffector.h | 6 +- .../PU/CCPUAlignAffectorTranslator.h | 6 +- extensions/Particle3D/PU/CCPUBaseCollider.h | 6 +- .../PU/CCPUBaseColliderTranslator.h | 6 +- .../Particle3D/PU/CCPUBaseForceAffector.h | 6 +- .../PU/CCPUBaseForceAffectorTranslator.h | 6 +- extensions/Particle3D/PU/CCPUBeamRender.cpp | 2 +- extensions/Particle3D/PU/CCPUBeamRender.h | 6 +- extensions/Particle3D/PU/CCPUBehaviour.h | 6 +- .../Particle3D/PU/CCPUBehaviourManager.h | 4 +- .../Particle3D/PU/CCPUBehaviourTranslator.h | 4 +- .../Particle3D/PU/CCPUBillboardChain.cpp | 18 +- extensions/Particle3D/PU/CCPUBoxCollider.h | 6 +- .../Particle3D/PU/CCPUBoxColliderTranslator.h | 4 +- extensions/Particle3D/PU/CCPUBoxEmitter.h | 6 +- .../Particle3D/PU/CCPUBoxEmitterTranslator.h | 4 +- extensions/Particle3D/PU/CCPUCircleEmitter.h | 6 +- .../PU/CCPUCircleEmitterTranslator.h | 4 +- .../PU/CCPUCollisionAvoidanceAffector.h | 6 +- ...CCPUCollisionAvoidanceAffectorTranslator.h | 4 +- extensions/Particle3D/PU/CCPUColorAffector.h | 6 +- .../PU/CCPUColorAffectorTranslator.h | 4 +- .../PU/CCPUDoAffectorEventHandler.h | 6 +- .../PU/CCPUDoAffectorEventHandlerTranslator.h | 4 +- .../PU/CCPUDoEnableComponentEventHandler.h | 6 +- ...UDoEnableComponentEventHandlerTranslator.h | 4 +- .../Particle3D/PU/CCPUDoExpireEventHandler.h | 6 +- .../PU/CCPUDoExpireEventHandlerTranslator.h | 4 +- .../Particle3D/PU/CCPUDoFreezeEventHandler.h | 6 +- .../PU/CCPUDoFreezeEventHandlerTranslator.h | 4 +- .../PU/CCPUDoPlacementParticleEventHandler.h | 6 +- ...oPlacementParticleEventHandlerTranslator.h | 4 +- .../Particle3D/PU/CCPUDoScaleEventHandler.h | 6 +- .../PU/CCPUDoScaleEventHandlerTranslator.h | 4 +- .../PU/CCPUDoStopSystemEventHandler.h | 6 +- .../CCPUDoStopSystemEventHandlerTranslator.h | 4 +- .../Particle3D/PU/CCPUDynamicAttribute.h | 14 +- .../PU/CCPUDynamicAttributeTranslator.h | 4 +- extensions/Particle3D/PU/CCPUEmitter.cpp | 2 +- extensions/Particle3D/PU/CCPUEmitter.h | 6 +- extensions/Particle3D/PU/CCPUEmitterManager.h | 4 +- .../Particle3D/PU/CCPUEmitterTranslator.h | 4 +- extensions/Particle3D/PU/CCPUEventHandler.h | 6 +- .../Particle3D/PU/CCPUEventHandlerManager.h | 4 +- .../PU/CCPUEventHandlerTranslator.h | 4 +- .../PU/CCPUFlockCenteringAffector.h | 6 +- .../PU/CCPUFlockCenteringAffectorTranslator.h | 4 +- extensions/Particle3D/PU/CCPUForceField.h | 4 +- .../Particle3D/PU/CCPUForceFieldAffector.h | 6 +- .../PU/CCPUForceFieldAffectorTranslator.h | 4 +- .../Particle3D/PU/CCPUGeometryRotator.cpp | 4 +- .../Particle3D/PU/CCPUGeometryRotator.h | 6 +- .../PU/CCPUGeometryRotatorTranslator.h | 4 +- .../Particle3D/PU/CCPUGravityAffector.h | 6 +- .../PU/CCPUGravityAffectorTranslator.h | 4 +- .../Particle3D/PU/CCPUInterParticleCollider.h | 6 +- .../PU/CCPUInterParticleColliderTranslator.h | 4 +- extensions/Particle3D/PU/CCPUJetAffector.cpp | 4 +- extensions/Particle3D/PU/CCPUJetAffector.h | 6 +- .../Particle3D/PU/CCPUJetAffectorTranslator.h | 4 +- extensions/Particle3D/PU/CCPULineAffector.h | 6 +- .../PU/CCPULineAffectorTranslator.h | 4 +- extensions/Particle3D/PU/CCPULineEmitter.h | 6 +- .../Particle3D/PU/CCPULineEmitterTranslator.h | 4 +- .../Particle3D/PU/CCPULinearForceAffector.h | 6 +- .../PU/CCPULinearForceAffectorTranslator.h | 4 +- extensions/Particle3D/PU/CCPUListener.h | 6 +- .../Particle3D/PU/CCPUMaterialManager.cpp | 18 +- .../Particle3D/PU/CCPUMaterialManager.h | 8 +- .../Particle3D/PU/CCPUMaterialTranslator.h | 4 +- .../Particle3D/PU/CCPUMeshSurfaceEmitter.cpp | 4 +- .../Particle3D/PU/CCPUMeshSurfaceEmitter.h | 6 +- .../PU/CCPUMeshSurfaceEmitterTranslator.h | 4 +- extensions/Particle3D/PU/CCPUNoise.h | 4 +- extensions/Particle3D/PU/CCPUObserver.h | 6 +- .../Particle3D/PU/CCPUObserverManager.h | 4 +- .../Particle3D/PU/CCPUObserverTranslator.h | 4 +- .../Particle3D/PU/CCPUOnClearObserver.h | 6 +- .../PU/CCPUOnClearObserverTranslator.h | 4 +- .../Particle3D/PU/CCPUOnCollisionObserver.h | 6 +- .../PU/CCPUOnCollisionObserverTranslator.h | 4 +- .../Particle3D/PU/CCPUOnCountObserver.h | 6 +- .../PU/CCPUOnCountObserverTranslator.h | 4 +- .../Particle3D/PU/CCPUOnEmissionObserver.h | 6 +- .../PU/CCPUOnEmissionObserverTranslator.h | 4 +- .../Particle3D/PU/CCPUOnEventFlagObserver.h | 6 +- .../PU/CCPUOnEventFlagObserverTranslator.h | 4 +- .../Particle3D/PU/CCPUOnExpireObserver.h | 6 +- .../PU/CCPUOnExpireObserverTranslator.h | 4 +- .../Particle3D/PU/CCPUOnPositionObserver.h | 6 +- .../PU/CCPUOnPositionObserverTranslator.h | 4 +- .../Particle3D/PU/CCPUOnQuotaObserver.h | 6 +- .../PU/CCPUOnQuotaObserverTranslator.h | 4 +- .../Particle3D/PU/CCPUOnRandomObserver.h | 6 +- .../PU/CCPUOnRandomObserverTranslator.h | 4 +- extensions/Particle3D/PU/CCPUOnTimeObserver.h | 6 +- .../PU/CCPUOnTimeObserverTranslator.h | 4 +- .../Particle3D/PU/CCPUOnVelocityObserver.h | 6 +- .../PU/CCPUOnVelocityObserverTranslator.h | 4 +- .../Particle3D/PU/CCPUParticleFollower.h | 6 +- .../PU/CCPUParticleFollowerTranslator.h | 4 +- .../Particle3D/PU/CCPUParticleSystem3D.cpp | 10 +- .../Particle3D/PU/CCPUParticleSystem3D.h | 8 +- .../PU/CCPUParticleSystem3DTranslator.h | 4 +- extensions/Particle3D/PU/CCPUPathFollower.h | 6 +- .../PU/CCPUPathFollowerTranslator.h | 4 +- extensions/Particle3D/PU/CCPUPlane.h | 4 +- extensions/Particle3D/PU/CCPUPlaneCollider.h | 6 +- .../PU/CCPUPlaneColliderTranslator.h | 4 +- extensions/Particle3D/PU/CCPUPointEmitter.h | 6 +- .../PU/CCPUPointEmitterTranslator.h | 4 +- .../Particle3D/PU/CCPUPositionEmitter.h | 6 +- .../PU/CCPUPositionEmitterTranslator.h | 4 +- extensions/Particle3D/PU/CCPURandomiser.h | 6 +- .../Particle3D/PU/CCPURandomiserTranslator.h | 4 +- extensions/Particle3D/PU/CCPURender.cpp | 20 +- extensions/Particle3D/PU/CCPURender.h | 12 +- .../Particle3D/PU/CCPURendererTranslator.h | 4 +- extensions/Particle3D/PU/CCPURibbonTrail.h | 4 +- .../Particle3D/PU/CCPURibbonTrailRender.cpp | 2 +- .../Particle3D/PU/CCPURibbonTrailRender.h | 6 +- .../Particle3D/PU/CCPUScaleAffector.cpp | 24 +- extensions/Particle3D/PU/CCPUScaleAffector.h | 6 +- .../PU/CCPUScaleAffectorTranslator.h | 4 +- .../PU/CCPUScaleVelocityAffector.cpp | 6 +- .../Particle3D/PU/CCPUScaleVelocityAffector.h | 6 +- .../PU/CCPUScaleVelocityAffectorTranslator.h | 4 +- extensions/Particle3D/PU/CCPUScriptCompiler.h | 18 +- extensions/Particle3D/PU/CCPUScriptLexer.h | 4 +- extensions/Particle3D/PU/CCPUScriptParser.h | 4 +- .../Particle3D/PU/CCPUScriptTranslator.h | 4 +- extensions/Particle3D/PU/CCPUSimpleSpline.h | 4 +- .../Particle3D/PU/CCPUSineForceAffector.h | 6 +- .../PU/CCPUSineForceAffectorTranslator.h | 4 +- extensions/Particle3D/PU/CCPUSlaveBehaviour.h | 6 +- .../PU/CCPUSlaveBehaviourTranslator.h | 4 +- extensions/Particle3D/PU/CCPUSlaveEmitter.h | 6 +- .../PU/CCPUSlaveEmitterTranslator.h | 4 +- extensions/Particle3D/PU/CCPUSphere.h | 4 +- extensions/Particle3D/PU/CCPUSphereCollider.h | 6 +- .../PU/CCPUSphereColliderTranslator.h | 4 +- .../Particle3D/PU/CCPUSphereSurfaceEmitter.h | 6 +- .../PU/CCPUSphereSurfaceEmitterTranslator.h | 4 +- .../Particle3D/PU/CCPUTechniqueTranslator.h | 4 +- .../Particle3D/PU/CCPUTextureAnimator.h | 6 +- .../PU/CCPUTextureAnimatorTranslator.h | 4 +- .../Particle3D/PU/CCPUTextureRotator.cpp | 8 +- extensions/Particle3D/PU/CCPUTextureRotator.h | 6 +- .../PU/CCPUTextureRotatorTranslator.h | 4 +- .../Particle3D/PU/CCPUTranslateManager.h | 4 +- extensions/Particle3D/PU/CCPUUtil.h | 4 +- .../PU/CCPUVelocityMatchingAffector.h | 6 +- .../CCPUVelocityMatchingAffectorTranslator.h | 4 +- extensions/Particle3D/PU/CCPUVertexEmitter.h | 4 +- .../Particle3D/PU/CCPUVortexAffector.cpp | 4 +- extensions/Particle3D/PU/CCPUVortexAffector.h | 6 +- .../PU/CCPUVortexAffectorTranslator.h | 4 +- extensions/assets-manager/AssetsManager.cpp | 2 +- extensions/assets-manager/AssetsManager.h | 2 +- extensions/assets-manager/AssetsManagerEx.cpp | 24 +- extensions/assets-manager/AssetsManagerEx.h | 2 +- .../assets-manager/CCEventAssetsManagerEx.h | 2 +- .../CCEventListenerAssetsManagerEx.cpp | 4 +- .../CCEventListenerAssetsManagerEx.h | 2 +- extensions/assets-manager/Manifest.h | 2 +- .../ActionTimeline/CCActionTimeline.cpp | 4 +- .../ActionTimeline/CCActionTimelineCache.cpp | 6 +- .../ActionTimeline/CCActionTimelineData.cpp | 2 +- .../ActionTimeline/CCActionTimelineNode.cpp | 2 +- .../cocostudio/ActionTimeline/CCBoneNode.cpp | 16 +- .../cocostudio/ActionTimeline/CCBoneNode.h | 4 +- .../cocostudio/ActionTimeline/CCFrame.h | 4 +- .../ActionTimeline/CCSkeletonNode.cpp | 8 +- .../ActionTimeline/CCSkeletonNode.h | 2 +- .../ActionTimeline/CCTimelineMacro.h | 4 +- .../cocostudio/ActionTimeline/CSLoader.cpp | 16 +- .../cocostudio/ActionTimeline/CSLoader.h | 2 +- extensions/cocostudio/CCActionManagerEx.cpp | 2 +- extensions/cocostudio/CCActionNode.cpp | 22 +- extensions/cocostudio/CCActionObject.cpp | 16 +- extensions/cocostudio/CCArmature.cpp | 22 +- extensions/cocostudio/CCArmature.h | 58 ++--- extensions/cocostudio/CCArmatureAnimation.cpp | 16 +- extensions/cocostudio/CCArmatureAnimation.h | 16 +- .../cocostudio/CCArmatureDataManager.cpp | 4 +- extensions/cocostudio/CCArmatureDataManager.h | 4 +- extensions/cocostudio/CCBatchNode.cpp | 6 +- extensions/cocostudio/CCBone.cpp | 50 ++--- extensions/cocostudio/CCBone.h | 6 +- extensions/cocostudio/CCColliderDetector.cpp | 22 +- extensions/cocostudio/CCComAttribute.cpp | 22 +- extensions/cocostudio/CCComAttribute.h | 6 +- extensions/cocostudio/CCComAudio.cpp | 22 +- extensions/cocostudio/CCComAudio.h | 6 +- extensions/cocostudio/CCComBase.h | 4 +- extensions/cocostudio/CCComController.cpp | 2 +- extensions/cocostudio/CCComController.h | 6 +- extensions/cocostudio/CCComExtensionData.cpp | 6 +- extensions/cocostudio/CCComRender.cpp | 30 +-- extensions/cocostudio/CCComRender.h | 6 +- extensions/cocostudio/CCDataReaderHelper.cpp | 18 +- extensions/cocostudio/CCDataReaderHelper.h | 2 +- extensions/cocostudio/CCDatas.cpp | 12 +- extensions/cocostudio/CCDatas.h | 32 +-- extensions/cocostudio/CCDecorativeDisplay.cpp | 12 +- extensions/cocostudio/CCDecorativeDisplay.h | 8 +- extensions/cocostudio/CCDisplayFactory.cpp | 2 +- extensions/cocostudio/CCDisplayManager.cpp | 4 +- extensions/cocostudio/CCDisplayManager.h | 4 +- extensions/cocostudio/CCInputDelegate.cpp | 22 +- extensions/cocostudio/CCInputDelegate.h | 24 +- extensions/cocostudio/CCSGUIReader.cpp | 10 +- extensions/cocostudio/CCSGUIReader.h | 4 +- extensions/cocostudio/CCSSceneReader.cpp | 20 +- extensions/cocostudio/CCSkin.cpp | 12 +- .../cocostudio/CCSpriteFrameCacheHelper.cpp | 4 +- .../cocostudio/CCSpriteFrameCacheHelper.h | 2 +- extensions/cocostudio/CCTween.cpp | 8 +- extensions/cocostudio/CocosStudioExport.h | 2 +- extensions/cocostudio/DictionaryHelper.cpp | 68 +++--- .../cocostudio/FlatBuffersSerialize.cpp | 6 +- extensions/cocostudio/FlatBuffersSerialize.h | 2 +- extensions/cocostudio/LocalizationManager.cpp | 4 +- .../cocostudio/SpineSkeletonDataCache.cpp | 2 +- .../cocostudio/SpineSkeletonDataCache.h | 2 +- extensions/cocostudio/TriggerMng.cpp | 22 +- extensions/cocostudio/TriggerObj.cpp | 2 +- .../ArmatureNodeReader/ArmatureNodeReader.cpp | 6 +- .../ArmatureNodeReader/ArmatureNodeReader.h | 2 +- .../ButtonReader/ButtonReader.cpp | 8 +- .../WidgetReader/ButtonReader/ButtonReader.h | 2 +- .../CheckBoxReader/CheckBoxReader.cpp | 6 +- .../CheckBoxReader/CheckBoxReader.h | 2 +- .../ComAudioReader/ComAudioReader.cpp | 4 +- .../ComAudioReader/ComAudioReader.h | 2 +- .../GameMapReader/GameMapReader.cpp | 2 +- .../GameMapReader/GameMapReader.h | 2 +- .../GameNode3DReader/GameNode3DReader.cpp | 4 +- .../GameNode3DReader/GameNode3DReader.h | 2 +- .../ImageViewReader/ImageViewReader.cpp | 6 +- .../ImageViewReader/ImageViewReader.h | 2 +- .../LayoutReader/LayoutReader.cpp | 6 +- .../WidgetReader/LayoutReader/LayoutReader.h | 2 +- .../Light3DReader/Light3DReader.cpp | 6 +- .../Light3DReader/Light3DReader.h | 2 +- .../ListViewReader/ListViewReader.cpp | 2 +- .../ListViewReader/ListViewReader.h | 2 +- .../LoadingBarReader/LoadingBarReader.cpp | 6 +- .../LoadingBarReader/LoadingBarReader.h | 2 +- .../WidgetReader/MeshReader/MeshReader.cpp | 4 +- .../WidgetReader/MeshReader/MeshReader.h | 2 +- .../Node3DReader/Node3DReader.cpp | 4 +- .../WidgetReader/Node3DReader/Node3DReader.h | 2 +- .../WidgetReader/NodeReader/NodeReader.cpp | 2 +- .../WidgetReader/NodeReader/NodeReader.h | 2 +- .../WidgetReader/NodeReaderProtocol.h | 2 +- .../PageViewReader/PageViewReader.cpp | 2 +- .../PageViewReader/PageViewReader.h | 2 +- .../Particle3DReader/Particle3DReader.cpp | 4 +- .../Particle3DReader/Particle3DReader.h | 2 +- .../ParticleReader/ParticleReader.cpp | 4 +- .../ParticleReader/ParticleReader.h | 2 +- .../ProjectNodeReader/ProjectNodeReader.cpp | 4 +- .../ProjectNodeReader/ProjectNodeReader.h | 2 +- .../RadioButtonGroupReader.cpp | 2 +- .../RadioButtonGroupReader.h | 2 +- .../RadioButtonReader/RadioButtonReader.cpp | 2 +- .../RadioButtonReader/RadioButtonReader.h | 2 +- .../RichTextReader/RichTextReader.cpp | 2 +- .../RichTextReader/RichTextReader.h | 2 +- .../ScrollViewReader/ScrollViewReader.cpp | 2 +- .../ScrollViewReader/ScrollViewReader.h | 2 +- .../SingleNodeReader/SingleNodeReader.cpp | 4 +- .../SingleNodeReader/SingleNodeReader.h | 2 +- .../SkeletonReader/BoneNodeReader.cpp | 2 +- .../SkeletonReader/BoneNodeReader.h | 2 +- .../SkeletonReader/SkeletonNodeReader.cpp | 2 +- .../SkeletonReader/SkeletonNodeReader.h | 2 +- .../SliderReader/SliderReader.cpp | 6 +- .../WidgetReader/SliderReader/SliderReader.h | 2 +- .../SpineSkeletonReader.cpp | 6 +- .../SpineSkeletonReader/SpineSkeletonReader.h | 4 +- .../SpriteReader/SpriteReader.cpp | 4 +- .../WidgetReader/SpriteReader/SpriteReader.h | 2 +- .../TabControlReader/TabControlReader.cpp | 6 +- .../TextAtlasReader/TextAtlasReader.cpp | 6 +- .../TextAtlasReader/TextAtlasReader.h | 2 +- .../TextBMFontReader/TextBMFontReader.cpp | 6 +- .../TextBMFontReader/TextBMFontReader.h | 2 +- .../TextFieldReader/TextFieldExReader.cpp | 2 +- .../TextFieldReader/TextFieldExReader.h | 2 +- .../TextFieldReader/TextFieldReader.cpp | 6 +- .../TextFieldReader/TextFieldReader.h | 2 +- .../WidgetReader/TextReader/TextReader.cpp | 6 +- .../WidgetReader/TextReader/TextReader.h | 2 +- .../UserCameraReader/UserCameraReader.cpp | 4 +- .../UserCameraReader/UserCameraReader.h | 2 +- .../cocostudio/WidgetReader/WidgetReader.cpp | 6 +- .../cocostudio/WidgetReader/WidgetReader.h | 6 +- extensions/fairygui/DragDropManager.cpp | 4 +- extensions/fairygui/FairyGUIMacros.h | 14 +- extensions/fairygui/GButton.cpp | 12 +- extensions/fairygui/GComboBox.cpp | 14 +- extensions/fairygui/GComponent.cpp | 10 +- extensions/fairygui/GGraph.cpp | 6 +- extensions/fairygui/GList.cpp | 8 +- extensions/fairygui/GLoader.cpp | 8 +- extensions/fairygui/GLoader3D.cpp | 8 +- extensions/fairygui/GMovieClip.cpp | 10 +- extensions/fairygui/GMovieClip.h | 2 +- extensions/fairygui/GObject.cpp | 28 +-- extensions/fairygui/GRoot.cpp | 12 +- extensions/fairygui/GScrollBar.cpp | 12 +- extensions/fairygui/GSlider.cpp | 6 +- extensions/fairygui/GTextField.cpp | 4 +- extensions/fairygui/GTree.cpp | 10 +- extensions/fairygui/GTreeNode.cpp | 4 +- extensions/fairygui/PackageItem.cpp | 14 +- extensions/fairygui/PopupMenu.cpp | 6 +- extensions/fairygui/RelationItem.cpp | 4 +- extensions/fairygui/ScrollPane.cpp | 20 +- extensions/fairygui/Transition.cpp | 24 +- extensions/fairygui/UIPackage.cpp | 6 +- extensions/fairygui/Window.cpp | 20 +- extensions/fairygui/display/BitmapFont.h | 2 +- extensions/fairygui/display/FUIContainer.cpp | 44 ++-- extensions/fairygui/display/FUIInput.cpp | 4 +- extensions/fairygui/display/FUILabel.cpp | 4 +- extensions/fairygui/display/FUIRichText.cpp | 2 +- extensions/fairygui/display/FUISprite.cpp | 16 +- extensions/fairygui/event/HitTest.cpp | 2 +- extensions/fairygui/event/InputProcessor.cpp | 38 ++-- extensions/fairygui/gears/GearBase.cpp | 2 +- extensions/fairygui/gears/GearColor.cpp | 4 +- extensions/fairygui/gears/GearLook.cpp | 4 +- extensions/fairygui/gears/GearSize.cpp | 4 +- extensions/fairygui/gears/GearXY.cpp | 4 +- extensions/fairygui/tween/GTweener.cpp | 8 +- extensions/fairygui/utils/html/HtmlObject.cpp | 2 +- extensions/fairygui/utils/html/HtmlParser.cpp | 2 +- .../physics-nodes/CCPhysicsDebugNode.cpp | 2 +- extensions/physics-nodes/CCPhysicsDebugNode.h | 2 +- .../physics-nodes/CCPhysicsDebugNodeBox2D.cpp | 4 +- .../physics-nodes/CCPhysicsDebugNodeBox2D.h | 2 +- .../CCPhysicsDebugNodeChipmunk2D.cpp | 2 +- .../CCPhysicsDebugNodeChipmunk2D.h | 2 +- extensions/physics-nodes/CCPhysicsSprite.cpp | 68 +++--- extensions/physics-nodes/CCPhysicsSprite.h | 12 +- .../physics-nodes/CCPhysicsSpriteBox2D.cpp | 18 +- .../physics-nodes/CCPhysicsSpriteBox2D.h | 2 +- .../CCPhysicsSpriteChipmunk2D.cpp | 20 +- .../physics-nodes/CCPhysicsSpriteChipmunk2D.h | 2 +- .../auto/lua_axis_audioengine_auto.cpp | 2 +- .../auto/lua_axis_audioengine_auto.hpp | 4 +- .../auto/lua_axis_controller_auto.cpp | 2 +- .../auto/lua_axis_controller_auto.hpp | 4 +- .../auto/lua_axis_navmesh_auto.cpp | 2 +- .../auto/lua_axis_navmesh_auto.hpp | 4 +- .../auto/lua_axis_physics3d_auto.cpp | 2 +- .../auto/lua_axis_physics3d_auto.hpp | 4 +- .../auto/lua_axis_physics_auto.cpp | 2 +- .../auto/lua_axis_physics_auto.hpp | 4 +- .../manual/3d/lua_axis_3d_manual.cpp | 8 +- .../lua-bindings/manual/CCComponentLua.cpp | 2 +- .../lua-bindings/manual/CCLuaEngine.cpp | 2 +- .../lua-bindings/manual/CCLuaEngine.h | 10 +- .../lua-bindings/manual/CCLuaStack.cpp | 10 +- .../lua-bindings/manual/CCLuaStack.h | 6 +- .../lua-bindings/manual/CCLuaValue.h | 8 +- .../lua-bindings/manual/Lua-BindingsExport.h | 10 +- .../manual/LuaBasicConversions.cpp | 12 +- .../lua-bindings/manual/LuaBasicConversions.h | 42 ++-- .../manual/base/LuaScriptHandlerMgr.cpp | 4 +- .../manual/base/lua_axis_base_manual.cpp | 82 +++---- .../manual/cocostudio/CustomGUIReader.cpp | 2 +- .../cocostudio/lua_axis_cocostudio_manual.cpp | 4 +- .../controller/lua_axis_controller_manual.cpp | 4 +- .../controller/lua_axis_controller_manual.hpp | 4 +- .../manual/lua_module_register.cpp | 4 +- .../lua-bindings/manual/lua_module_register.h | 2 +- .../navmesh/lua_axis_navmesh_conversions.cpp | 2 +- .../navmesh/lua_axis_navmesh_conversions.h | 4 +- .../navmesh/lua_axis_navmesh_manual.cpp | 2 +- .../manual/navmesh/lua_axis_navmesh_manual.h | 4 +- .../manual/network/lua_xml_http_request.cpp | 4 +- .../physics/lua_axis_physics_manual.cpp | 108 ++++----- .../physics/lua_axis_physics_manual.hpp | 4 +- .../physics3d/lua_axis_physics3d_manual.cpp | 2 +- .../physics3d/lua_axis_physics3d_manual.h | 4 +- .../manual/ui/lua_axis_ui_manual.cpp | 8 +- .../script/cocos2d/Cocos2dConstants.lua | 18 +- .../lua-bindings/script/framework/display.lua | 14 +- .../lua-bindings/script/framework/init.lua | 2 +- .../scripting/lua-bindings/script/init.lua | 2 +- extensions/spine/SkeletonAnimation.h | 4 +- extensions/spine/SkeletonBatch.cpp | 6 +- extensions/spine/SkeletonRenderer.cpp | 6 +- extensions/spine/SkeletonTwoColorBatch.cpp | 8 +- .../ActionManagerTest/ActionManagerTest.cpp | 14 +- .../ActionsEaseTest/ActionsEaseTest.cpp | 6 +- .../Classes/ActionsTest/ActionsTest.cpp | 12 +- tests/cpp-tests/Classes/AppDelegate.cpp | 2 +- tests/cpp-tests/Classes/BaseTest.cpp | 14 +- .../Classes/BillBoardTest/BillBoardTest.cpp | 12 +- .../cpp-tests/Classes/Box2DTest/Box2dTest.cpp | 6 +- .../Classes/Box2DTestBed/Box2DTestBed.cpp | 20 +- tests/cpp-tests/Classes/Box2DTestBed/Test.cpp | 6 +- tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp | 2 +- .../cpp-tests/Classes/BugsTest/Bug-14327.cpp | 2 +- tests/cpp-tests/Classes/BugsTest/Bug-14327.h | 2 +- tests/cpp-tests/Classes/BugsTest/Bug-422.cpp | 4 +- .../Classes/BugsTest/Bug-458/Bug-458.cpp | 4 +- tests/cpp-tests/Classes/BugsTest/Bug-624.cpp | 12 +- tests/cpp-tests/Classes/BugsTest/Bug-914.cpp | 6 +- .../cpp-tests/Classes/BugsTest/Bug-Child.cpp | 4 +- tests/cpp-tests/Classes/BugsTest/BugsTest.cpp | 4 +- .../Classes/Camera3DTest/Camera3DTest.cpp | 88 ++++---- .../Classes/Camera3DTest/Camera3DTest.h | 2 +- .../Classes/ChipmunkTest/ChipmunkTest.cpp | 14 +- .../ChipmunkTestBed/ChipmunkTestBed.cpp | 12 +- .../ClickAndMoveTest/ClickAndMoveTest.cpp | 6 +- .../ClippingNodeTest/ClippingNodeTest.cpp | 18 +- .../Classes/ConsoleTest/ConsoleTest.cpp | 8 +- .../Classes/ConsoleTest/ConsoleTest.h | 4 +- tests/cpp-tests/Classes/CurlTest/CurlTest.cpp | 2 +- .../DrawPrimitivesTest/DrawPrimitivesTest.cpp | 10 +- .../Classes/EffectsTest/EffectsTest.cpp | 2 +- .../AssetsManagerExTest.cpp | 2 +- .../Classes/FileUtilsTest/FileUtilsTest.cpp | 2 +- .../cpp-tests/Classes/ImGuiTest/ImGuiTest.cpp | 4 +- tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.h | 2 +- .../cpp-tests/Classes/InputTest/MouseTest.cpp | 8 +- tests/cpp-tests/Classes/JNITest/JNITest.cpp | 18 +- tests/cpp-tests/Classes/JNITest/JNITest.h | 2 +- .../Classes/LabelTest/LabelTestNew.cpp | 78 +++---- .../cpp-tests/Classes/LayerTest/LayerTest.cpp | 26 +-- .../cpp-tests/Classes/LightTest/LightTest.cpp | 10 +- .../MaterialSystemTest/MaterialSystemTest.cpp | 14 +- tests/cpp-tests/Classes/MenuTest/MenuTest.cpp | 54 ++--- .../Classes/MeshRendererTest/DrawNode3D.cpp | 14 +- .../Classes/MeshRendererTest/DrawNode3D.h | 2 +- .../MeshRendererTest/MeshRendererTest.cpp | 124 +++++------ .../MeshRendererTest/MeshRendererTest.h | 14 +- .../MotionStreakTest/MotionStreakTest.cpp | 14 +- .../Classes/MultiTouchTest/MultiTouchTest.cpp | 6 +- .../Classes/NavMeshTest/NavMeshTest.cpp | 14 +- .../Classes/NavMeshTest/NavMeshTest.h | 2 +- .../DownloaderTest/DownloaderTest.cpp | 4 +- .../HttpClientTest/HttpClientTest.cpp | 42 ++-- .../NewAudioEngineTest/NewAudioEngineTest.cpp | 68 +++--- .../NewEventDispatcherTest.cpp | 34 +-- .../NewRendererTest/NewRendererTest.cpp | 22 +- tests/cpp-tests/Classes/NodeTest/NodeTest.cpp | 20 +- .../Classes/OpenURLTest/OpenURLTest.cpp | 2 +- .../Classes/ParallaxTest/ParallaxTest.cpp | 2 +- .../Classes/Particle3DTest/Particle3DTest.cpp | 8 +- .../Classes/ParticleTest/ParticleTest.cpp | 26 +-- .../Classes/Physics3DTest/Physics3DTest.cpp | 26 +-- .../Classes/Physics3DTest/Physics3DTest.h | 2 +- .../Classes/PhysicsTest/PhysicsTest.cpp | 100 ++++----- .../Classes/PhysicsTest/PhysicsTest.h | 4 +- .../RenderTextureTest/RenderTextureTest.cpp | 48 ++-- .../Classes/Scene3DTest/Scene3DTest.cpp | 6 +- .../cpp-tests/Classes/SceneTest/SceneTest.cpp | 26 +-- .../Classes/SchedulerTest/SchedulerTest.cpp | 102 ++++----- .../Classes/ShaderTest/ShaderTest.cpp | 26 +-- .../Classes/ShaderTest/ShaderTest.vsh.h | 2 +- .../Classes/ShaderTest/ShaderTest2.cpp | 26 +-- .../Classes/ShaderTest/ShaderTest2.h | 2 +- .../Classes/ShaderTest/shaderTest.psh.h | 6 +- .../SpriteFrameCacheTest.cpp | 12 +- .../SpritePolygonTest/SpritePolygonTest.cpp | 2 +- .../Classes/SpriteTest/SpriteTest.cpp | 80 +++---- .../Classes/TerrainTest/TerrainTest.cpp | 10 +- .../Classes/TextInputTest/TextInputTest.cpp | 16 +- .../Classes/Texture2dTest/Texture2dTest.cpp | 34 +-- .../TextureCacheTest/TextureCacheTest.cpp | 44 ++-- .../Classes/TileMapTest/TileMapTest2.cpp | 92 ++++---- .../cpp-tests/Classes/TouchesTest/Paddle.cpp | 6 +- .../Classes/TouchesTest/TouchesTest.cpp | 8 +- .../TransitionsTest/TransitionsTest.cpp | 4 +- .../CocoStudioGUITest/CocosGUIScene.cpp | 26 +-- .../UIButtonTest/UIButtonTest.cpp | 20 +- .../UICheckBoxTest/UICheckBoxTest.cpp | 4 +- .../UIFocusTest/UIFocusTest.cpp | 40 ++-- .../UIImageViewTest/UIImageViewTest.cpp | 2 +- .../UILayoutTest/UILayoutTest.cpp | 4 +- .../UIListViewTest/UIListViewTest.cpp | 8 +- .../UILoadingBarTest/UILoadingBarTest.cpp | 2 +- .../UIPageViewTest/UIPageViewTest.cpp | 14 +- .../UIRadioButtonTest/UIRadioButtonTest.cpp | 12 +- .../UIRichTextTest/UIRichTextTest.cpp | 102 ++++----- .../CocoStudioGUITest/UIScale9SpriteTest.cpp | 2 +- .../UISliderTest/UISliderTest.cpp | 10 +- .../UITextAtlasTest/UITextAtlasTest.cpp | 4 +- .../UITextBMFontTest/UITextBMFontTest.cpp | 2 +- .../UITextFieldTest/UITextFieldTest.cpp | 14 +- .../UIVideoPlayerTest/UIVideoPlayerTest.cpp | 32 +-- .../UIWebViewTest/UIWebViewTest.cpp | 6 +- tests/cpp-tests/Classes/UnitTest/UnitTest.cpp | 132 +++++------ .../Classes/VibrateTest/VibrateTest.cpp | 8 +- .../Classes/WindowTest/WindowTest.cpp | 4 +- .../cpp-tests/Classes/WindowTest/WindowTest.h | 4 +- .../Classes/ZwoptexTest/ZwoptexTest.cpp | 6 +- tests/cpp-tests/Classes/controller.cpp | 30 +-- tests/cpp-tests/Classes/tests.h | 18 +- .../proj.ios/Classes/testsAppDelegate.mm | 6 +- tests/fairygui-tests/Classes/AppDelegate.cpp | 4 +- tests/fairygui-tests/Classes/BagScene.cpp | 2 +- tests/fairygui-tests/Classes/BagWindow.cpp | 8 +- tests/fairygui-tests/Classes/BasicsScene.cpp | 24 +- tests/fairygui-tests/Classes/ChatScene.cpp | 14 +- tests/fairygui-tests/Classes/DemoScene.cpp | 6 +- tests/fairygui-tests/Classes/GuideScene.cpp | 2 +- .../fairygui-tests/Classes/JoystickModule.cpp | 6 +- .../fairygui-tests/Classes/JoystickScene.cpp | 2 +- .../fairygui-tests/Classes/LoopListScene.cpp | 4 +- .../Classes/ModalWaitingScene.cpp | 2 +- .../Classes/PullToRefreshScene.cpp | 10 +- .../Classes/ScrollPaneScene.cpp | 8 +- .../Classes/TransitionDemoScene.cpp | 18 +- .../fairygui-tests/Classes/TreeViewScene.cpp | 6 +- .../Classes/VirtualListScene.cpp | 2 +- tests/fairygui-tests/Classes/Window2.cpp | 4 +- tests/live2d-tests/Classes/AppDelegate.cpp | 2 +- .../Classes/LAppLive2DManager.cpp | 6 +- tests/live2d-tests/Classes/LAppModel.cpp | 2 +- tests/live2d-tests/Classes/LAppView.cpp | 8 +- tests/live2d-tests/Classes/SampleScene.cpp | 6 +- .../lua-tests/project/Classes/AppDelegate.cpp | 4 +- .../Classes/lua_assetsmanager_test_sample.cpp | 6 +- .../project/Classes/lua_test_bindings.cpp | 12 +- .../project/proj.ios_mac/ios/AppController.mm | 6 +- .../Classes/HelloWorldScene.cpp | 2 +- .../lua-template-runtime/src/config.lua | 8 +- .../plugins/plugin_generate/gen_simulator.py | 4 +- .../project.pbxproj | 8 +- .../proj.win32/__PACKAGE_NAME__.vcxproj | 2 +- tools/tolua/axis_audioengine.ini | 2 +- tools/tolua/axis_controller.ini | 2 +- tools/tolua/axis_navmesh.ini | 4 +- tools/tolua/axis_physics.ini | 2 +- tools/tolua/axis_physics3d.ini | 4 +- 1127 files changed, 6541 insertions(+), 6541 deletions(-) diff --git a/cmake/Modules/AxisBuildHelpers.cmake b/cmake/Modules/AxisBuildHelpers.cmake index a6be72cc41..47f0ff4612 100644 --- a/cmake/Modules/AxisBuildHelpers.cmake +++ b/cmake/Modules/AxisBuildHelpers.cmake @@ -474,13 +474,13 @@ function(cocos_use_pkg target pkg) # message(STATUS "${target} add dll: ${_dlls}") get_property(pre_dlls TARGET ${target} - PROPERTY CC_DEPEND_DLLS) + PROPERTY AX_DEPEND_DLLS) if(pre_dlls) set(_dlls ${pre_dlls} ${_dlls}) endif() set_property(TARGET ${target} PROPERTY - CC_DEPEND_DLLS ${_dlls} + AX_DEPEND_DLLS ${_dlls} ) endif() endif() diff --git a/cmake/Modules/AxisConfigDefine.cmake b/cmake/Modules/AxisConfigDefine.cmake index 69e48d2cda..90d83bdf06 100644 --- a/cmake/Modules/AxisConfigDefine.cmake +++ b/cmake/Modules/AxisConfigDefine.cmake @@ -55,7 +55,7 @@ message(STATUS "CMAKE_GENERATOR: ${CMAKE_GENERATOR}") # custom target property for lua/js link define_property(TARGET - PROPERTY CC_LUA_DEPEND + PROPERTY AX_LUA_DEPEND BRIEF_DOCS "axis lua depend libs" FULL_DOCS "use to save depend libs of axis lua project" ) @@ -151,7 +151,7 @@ function(use_axis_compile_define target) PRIVATE _USEGUIDLL # ui ) else() - target_compile_definitions(${target} PUBLIC CC_STATIC) + target_compile_definitions(${target} PUBLIC AX_STATIC) endif() endif() endfunction() diff --git a/cmake/Modules/AxisLinkHelpers.cmake b/cmake/Modules/AxisLinkHelpers.cmake index 3ed0e9d788..ff2fa7f6c5 100644 --- a/cmake/Modules/AxisLinkHelpers.cmake +++ b/cmake/Modules/AxisLinkHelpers.cmake @@ -17,7 +17,7 @@ message(STATUS "AX_ENABLE_MSEDGE_WEBVIEW2=${AX_ENABLE_MSEDGE_WEBVIEW2}") function(axis_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR) if (NOT AX_USE_SHARED_PREBUILT) target_compile_definitions(${APP_NAME} - PRIVATE CC_STATIC=1 + PRIVATE AX_STATIC=1 ) endif() diff --git a/core/2d/CCAction.cpp b/core/2d/CCAction.cpp index af862d357c..8f9f1eb846 100644 --- a/core/2d/CCAction.cpp +++ b/core/2d/CCAction.cpp @@ -81,7 +81,7 @@ Speed::Speed() : _speed(0.0), _innerAction(nullptr) {} Speed::~Speed() { - CC_SAFE_RELEASE(_innerAction); + AX_SAFE_RELEASE(_innerAction); } Speed* Speed::create(ActionInterval* action, float speed) @@ -92,7 +92,7 @@ Speed* Speed::create(ActionInterval* action, float speed) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -161,9 +161,9 @@ void Speed::setInnerAction(ActionInterval* action) { if (_innerAction != action) { - CC_SAFE_RELEASE(_innerAction); + AX_SAFE_RELEASE(_innerAction); _innerAction = action; - CC_SAFE_RETAIN(_innerAction); + AX_SAFE_RETAIN(_innerAction); } } @@ -172,7 +172,7 @@ void Speed::setInnerAction(ActionInterval* action) // Follow::~Follow() { - CC_SAFE_RELEASE(_followedNode); + AX_SAFE_RELEASE(_followedNode); } Follow* Follow::create(Node* followedNode, const Rect& rect /* = Rect::ZERO*/) diff --git a/core/2d/CCAction.h b/core/2d/CCAction.h index e4d2b90266..e9dca51e4d 100644 --- a/core/2d/CCAction.h +++ b/core/2d/CCAction.h @@ -50,7 +50,7 @@ enum /** * @brief Base class for Action objects. */ -class CC_DLL Action : public Ref, public Clonable +class AX_DLL Action : public Ref, public Clonable { public: /** Default tag used for all the actions. */ @@ -67,7 +67,7 @@ public: */ virtual Action* clone() const { - CC_ASSERT(0); + AX_ASSERT(0); return nullptr; } @@ -78,7 +78,7 @@ public: */ virtual Action* reverse() const { - CC_ASSERT(0); + AX_ASSERT(0); return nullptr; } @@ -180,7 +180,7 @@ protected: unsigned int _flags; private: - CC_DISALLOW_COPY_AND_ASSIGN(Action); + AX_DISALLOW_COPY_AND_ASSIGN(Action); }; /** @class FiniteTimeAction @@ -191,7 +191,7 @@ private: * - An action with a duration of 35.5 seconds. * Infinite time actions are valid. */ -class CC_DLL FiniteTimeAction : public Action +class AX_DLL FiniteTimeAction : public Action { public: /** Get duration in seconds of the action. @@ -210,12 +210,12 @@ public: // virtual FiniteTimeAction* reverse() const override { - CC_ASSERT(0); + AX_ASSERT(0); return nullptr; } virtual FiniteTimeAction* clone() const override { - CC_ASSERT(0); + AX_ASSERT(0); return nullptr; } @@ -227,7 +227,7 @@ protected: float _duration; private: - CC_DISALLOW_COPY_AND_ASSIGN(FiniteTimeAction); + AX_DISALLOW_COPY_AND_ASSIGN(FiniteTimeAction); }; class ActionInterval; @@ -239,7 +239,7 @@ class RepeatForever; * Useful to simulate 'slow motion' or 'fast forward' effect. * @warning This action can't be Sequenceable because it is not an IntervalAction. */ -class CC_DLL Speed : public Action +class AX_DLL Speed : public Action { public: /** Create the action and set the speed. @@ -297,7 +297,7 @@ protected: ActionInterval* _innerAction; private: - CC_DISALLOW_COPY_AND_ASSIGN(Speed); + AX_DISALLOW_COPY_AND_ASSIGN(Speed); }; /** @class Follow @@ -309,7 +309,7 @@ private: * Instead of using Camera as a "follower", use this action instead. * @since v0.99.2 */ -class CC_DLL Follow : public Action +class AX_DLL Follow : public Action { public: /** @@ -439,7 +439,7 @@ protected: Rect _worldRect; private: - CC_DISALLOW_COPY_AND_ASSIGN(Follow); + AX_DISALLOW_COPY_AND_ASSIGN(Follow); }; // end of actions group diff --git a/core/2d/CCActionCamera.cpp b/core/2d/CCActionCamera.cpp index a4fd4d9f3b..3e7edf952f 100644 --- a/core/2d/CCActionCamera.cpp +++ b/core/2d/CCActionCamera.cpp @@ -180,8 +180,8 @@ bool OrbitCamera::initWithDuration(float t, _angleX = angleX; _deltaAngleX = deltaAngleX; - _radDeltaZ = (float)CC_DEGREES_TO_RADIANS(deltaAngleZ); - _radDeltaX = (float)CC_DEGREES_TO_RADIANS(deltaAngleX); + _radDeltaZ = (float)AX_DEGREES_TO_RADIANS(deltaAngleZ); + _radDeltaX = (float)AX_DEGREES_TO_RADIANS(deltaAngleX); return true; } return false; @@ -196,12 +196,12 @@ void OrbitCamera::startWithTarget(Node* target) if (std::isnan(_radius)) _radius = r; if (std::isnan(_angleZ)) - _angleZ = (float)CC_RADIANS_TO_DEGREES(zenith); + _angleZ = (float)AX_RADIANS_TO_DEGREES(zenith); if (std::isnan(_angleX)) - _angleX = (float)CC_RADIANS_TO_DEGREES(azimuth); + _angleX = (float)AX_RADIANS_TO_DEGREES(azimuth); - _radZ = (float)CC_DEGREES_TO_RADIANS(_angleZ); - _radX = (float)CC_DEGREES_TO_RADIANS(_angleX); + _radZ = (float)AX_DEGREES_TO_RADIANS(_angleZ); + _radX = (float)AX_DEGREES_TO_RADIANS(_angleX); } void OrbitCamera::update(float dt) diff --git a/core/2d/CCActionCamera.h b/core/2d/CCActionCamera.h index ca40675180..a6be928594 100644 --- a/core/2d/CCActionCamera.h +++ b/core/2d/CCActionCamera.h @@ -45,7 +45,7 @@ class Camera; *@brief Base class for Camera actions. *@ingroup Actions */ -class CC_DLL ActionCamera : public ActionInterval +class AX_DLL ActionCamera : public ActionInterval { public: /** @@ -117,7 +117,7 @@ protected: * Orbits the camera around the center of the screen using spherical coordinates. * @ingroup Actions */ -class CC_DLL OrbitCamera : public ActionCamera +class AX_DLL OrbitCamera : public ActionCamera { public: /** Creates a OrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX. diff --git a/core/2d/CCActionCatmullRom.cpp b/core/2d/CCActionCatmullRom.cpp index 2ba989acf1..84059238d9 100644 --- a/core/2d/CCActionCatmullRom.cpp +++ b/core/2d/CCActionCatmullRom.cpp @@ -197,7 +197,7 @@ CardinalSplineTo* CardinalSplineTo::create(float duration, PointArray* points, f } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -220,7 +220,7 @@ bool CardinalSplineTo::initWithDuration(float duration, PointArray* points, floa CardinalSplineTo::~CardinalSplineTo() { - CC_SAFE_RELEASE_NULL(_points); + AX_SAFE_RELEASE_NULL(_points); } CardinalSplineTo::CardinalSplineTo() : _points(nullptr), _deltaT(0.f), _tension(0.f) {} @@ -275,7 +275,7 @@ void CardinalSplineTo::update(float time) Vec2 newPos = ccCardinalSplineAt(pp0, pp1, pp2, pp3, _tension, lt); -#if CC_ENABLE_STACKABLE_ACTIONS +#if AX_ENABLE_STACKABLE_ACTIONS // Support for stacked actions Node* node = _target; Vec2 diff = node->getPosition() - _previousPosition; @@ -314,7 +314,7 @@ CardinalSplineBy* CardinalSplineBy::create(float duration, PointArray* points, f } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -398,7 +398,7 @@ CatmullRomTo* CatmullRomTo::create(float dt, PointArray* points) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -441,7 +441,7 @@ CatmullRomBy* CatmullRomBy::create(float dt, PointArray* points) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/core/2d/CCActionCatmullRom.h b/core/2d/CCActionCatmullRom.h index 5695b89ca9..7c4baee081 100644 --- a/core/2d/CCActionCatmullRom.h +++ b/core/2d/CCActionCatmullRom.h @@ -55,7 +55,7 @@ class Node; * @ingroup Actions * @js NA */ -class CC_DLL PointArray : public Ref, public Clonable +class AX_DLL PointArray : public Ref, public Clonable { public: /** Creates and initializes a Points array with capacity. @@ -163,7 +163,7 @@ private: * http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline * @ingroup Actions */ -class CC_DLL CardinalSplineTo : public ActionInterval +class AX_DLL CardinalSplineTo : public ActionInterval { public: /** Creates an action with a Cardinal Spline array of points and tension. @@ -212,8 +212,8 @@ public: */ void setPoints(PointArray* points) { - CC_SAFE_RETAIN(points); - CC_SAFE_RELEASE(_points); + AX_SAFE_RETAIN(points); + AX_SAFE_RELEASE(_points); _points = points; } @@ -241,7 +241,7 @@ protected: * http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline * @ingroup Actions */ -class CC_DLL CardinalSplineBy : public CardinalSplineTo +class AX_DLL CardinalSplineBy : public CardinalSplineTo { public: /** Creates an action with a Cardinal Spline array of points and tension. @@ -274,7 +274,7 @@ protected: * http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline * @ingroup Actions */ -class CC_DLL CatmullRomTo : public CardinalSplineTo +class AX_DLL CatmullRomTo : public CardinalSplineTo { public: /** Creates an action with a Cardinal Spline array of points and tension. @@ -307,7 +307,7 @@ public: * http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline * @ingroup Actions */ -class CC_DLL CatmullRomBy : public CardinalSplineBy +class AX_DLL CatmullRomBy : public CardinalSplineBy { public: /** Creates an action with a Cardinal Spline array of points and tension. @@ -334,7 +334,7 @@ public: }; /** Returns the Cardinal Spline position for a given set of control points, tension and time */ -extern CC_DLL Vec2 +extern AX_DLL Vec2 ccCardinalSplineAt(const Vec2& p0, const Vec2& p1, const Vec2& p2, const Vec2& p3, float tension, float t); // end of actions group diff --git a/core/2d/CCActionEase.cpp b/core/2d/CCActionEase.cpp index 167cc76efb..e1b7b77137 100644 --- a/core/2d/CCActionEase.cpp +++ b/core/2d/CCActionEase.cpp @@ -66,7 +66,7 @@ bool ActionEase::initWithAction(ActionInterval* action) ActionEase::~ActionEase() { - CC_SAFE_RELEASE(_inner); + AX_SAFE_RELEASE(_inner); } void ActionEase::startWithTarget(Node* target) @@ -115,7 +115,7 @@ EaseRateAction* EaseRateAction::create(ActionInterval* action, float rate) return easeRateAction; } - CC_SAFE_DELETE(easeRateAction); + AX_SAFE_DELETE(easeRateAction); return nullptr; } @@ -141,7 +141,7 @@ bool EaseRateAction::initWithAction(ActionInterval* action, float rate) if (ease->initWithAction(action)) \ ease->autorelease(); \ else \ - CC_SAFE_DELETE(ease); \ + AX_SAFE_DELETE(ease); \ return ease; \ } \ CLASSNAME* CLASSNAME::clone() const \ @@ -192,7 +192,7 @@ EASE_TEMPLATE_IMPL(EaseCubicActionInOut, tweenfunc::cubicEaseInOut, EaseCubicAct if (ease->initWithAction(action, rate)) \ ease->autorelease(); \ else \ - CC_SAFE_DELETE(ease); \ + AX_SAFE_DELETE(ease); \ return ease; \ } \ CLASSNAME* CLASSNAME::clone() const \ @@ -235,7 +235,7 @@ bool EaseElastic::initWithAction(ActionInterval* action, float period /* = 0.3f* if (ease->initWithAction(action, period)) \ ease->autorelease(); \ else \ - CC_SAFE_DELETE(ease); \ + AX_SAFE_DELETE(ease); \ return ease; \ } \ CLASSNAME* CLASSNAME::clone() const \ diff --git a/core/2d/CCActionEase.h b/core/2d/CCActionEase.h index 0da2574c30..4062bcddbd 100644 --- a/core/2d/CCActionEase.h +++ b/core/2d/CCActionEase.h @@ -45,7 +45,7 @@ NS_AX_BEGIN The ease action will change the timeline of the inner action. @ingroup Actions */ -class CC_DLL ActionEase : public ActionInterval +class AX_DLL ActionEase : public ActionInterval { public: /** @@ -75,7 +75,7 @@ protected: ActionInterval* _inner; private: - CC_DISALLOW_COPY_AND_ASSIGN(ActionEase); + AX_DISALLOW_COPY_AND_ASSIGN(ActionEase); }; /** @@ -84,7 +84,7 @@ private: @details Ease the inner action with specified rate. @ingroup Actions */ -class CC_DLL EaseRateAction : public ActionEase +class AX_DLL EaseRateAction : public ActionEase { public: static EaseRateAction* create(ActionInterval* action, float rate); @@ -113,7 +113,7 @@ protected: float _rate; private: - CC_DISALLOW_COPY_AND_ASSIGN(EaseRateAction); + AX_DISALLOW_COPY_AND_ASSIGN(EaseRateAction); }; // @@ -121,7 +121,7 @@ private: // issue #16159 [https://github.com/cocos2d/cocos2d-x/pull/16159] for further info // #define EASE_TEMPLATE_DECL_CLASS(CLASSNAME) \ - class CC_DLL CLASSNAME : public ActionEase \ + class AX_DLL CLASSNAME : public ActionEase \ { \ public: \ virtual ~CLASSNAME() {} \ @@ -134,7 +134,7 @@ private: virtual ActionEase* reverse() const override; \ \ private: \ - CC_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \ + AX_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \ }; /** @@ -199,7 +199,7 @@ EASE_TEMPLATE_DECL_CLASS(EaseSineInOut); @since v0.8.2 @ingroup Actions */ -class CC_DLL EaseBounce : public ActionEase +class AX_DLL EaseBounce : public ActionEase {}; /** @@ -373,7 +373,7 @@ EASE_TEMPLATE_DECL_CLASS(EaseCubicActionInOut); // #define EASERATE_TEMPLATE_DECL_CLASS(CLASSNAME) \ - class CC_DLL CLASSNAME : public EaseRateAction \ + class AX_DLL CLASSNAME : public EaseRateAction \ { \ public: \ virtual ~CLASSNAME() {} \ @@ -385,7 +385,7 @@ EASE_TEMPLATE_DECL_CLASS(EaseCubicActionInOut); virtual EaseRateAction* reverse() const override; \ \ private: \ - CC_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \ + AX_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \ }; /** @@ -423,7 +423,7 @@ EASERATE_TEMPLATE_DECL_CLASS(EaseInOut); @since v0.8.2 @ingroup Actions */ -class CC_DLL EaseElastic : public ActionEase +class AX_DLL EaseElastic : public ActionEase { public: /** @@ -451,7 +451,7 @@ protected: float _period; private: - CC_DISALLOW_COPY_AND_ASSIGN(EaseElastic); + AX_DISALLOW_COPY_AND_ASSIGN(EaseElastic); }; // @@ -459,7 +459,7 @@ private: // issue #16159 [https://github.com/cocos2d/cocos2d-x/pull/16159] for further info // #define EASEELASTIC_TEMPLATE_DECL_CLASS(CLASSNAME) \ - class CC_DLL CLASSNAME : public EaseElastic \ + class AX_DLL CLASSNAME : public EaseElastic \ { \ public: \ virtual ~CLASSNAME() {} \ @@ -471,7 +471,7 @@ private: virtual EaseElastic* reverse() const override; \ \ private: \ - CC_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \ + AX_DISALLOW_COPY_AND_ASSIGN(CLASSNAME); \ }; /** @@ -516,7 +516,7 @@ EASEELASTIC_TEMPLATE_DECL_CLASS(EaseElasticInOut); @brief Ease Bezier @ingroup Actions */ -class CC_DLL EaseBezierAction : public axis::ActionEase +class AX_DLL EaseBezierAction : public axis::ActionEase { public: /** @@ -545,7 +545,7 @@ protected: float _p3; private: - CC_DISALLOW_COPY_AND_ASSIGN(EaseBezierAction); + AX_DISALLOW_COPY_AND_ASSIGN(EaseBezierAction); }; // end of actions group diff --git a/core/2d/CCActionGrid.cpp b/core/2d/CCActionGrid.cpp index 1516e1e3e9..ac8c667ab3 100644 --- a/core/2d/CCActionGrid.cpp +++ b/core/2d/CCActionGrid.cpp @@ -206,7 +206,7 @@ AccelDeccelAmplitude* AccelDeccelAmplitude::clone() const AccelDeccelAmplitude::~AccelDeccelAmplitude() { - CC_SAFE_RELEASE(_other); + AX_SAFE_RELEASE(_other); } void AccelDeccelAmplitude::startWithTarget(Node* target) @@ -276,7 +276,7 @@ AccelAmplitude* AccelAmplitude::clone() const AccelAmplitude::~AccelAmplitude() { - CC_SAFE_DELETE(_other); + AX_SAFE_DELETE(_other); } void AccelAmplitude::startWithTarget(Node* target) @@ -330,7 +330,7 @@ bool DeccelAmplitude::initWithAction(Action* action, float duration) DeccelAmplitude::~DeccelAmplitude() { - CC_SAFE_RELEASE(_other); + AX_SAFE_RELEASE(_other); } void DeccelAmplitude::startWithTarget(Node* target) diff --git a/core/2d/CCActionGrid.h b/core/2d/CCActionGrid.h index cb9c3abbff..547f3e4f32 100644 --- a/core/2d/CCActionGrid.h +++ b/core/2d/CCActionGrid.h @@ -45,7 +45,7 @@ class NodeGrid; @brief Base class for Grid actions. @details Grid actions are the actions take effect on GridBase. */ -class CC_DLL GridAction : public ActionInterval +class AX_DLL GridAction : public ActionInterval { public: /** @@ -57,7 +57,7 @@ public: // overrides virtual GridAction* clone() const override { - CC_ASSERT(0); + AX_ASSERT(0); return nullptr; } virtual GridAction* reverse() const override; @@ -81,14 +81,14 @@ protected: void cacheTargetAsGridNode(); private: - CC_DISALLOW_COPY_AND_ASSIGN(GridAction); + AX_DISALLOW_COPY_AND_ASSIGN(GridAction); }; /** @brief Base class for Grid3D actions. @details Grid3D actions can modify a non-tiled grid. */ -class CC_DLL Grid3DAction : public GridAction +class AX_DLL Grid3DAction : public GridAction { public: virtual GridBase* getGrid() override; @@ -122,7 +122,7 @@ public: // Overrides virtual Grid3DAction* clone() const override { - CC_ASSERT(0); + AX_ASSERT(0); return nullptr; } @@ -136,7 +136,7 @@ public: /** @brief Base class for TiledGrid3D actions. */ -class CC_DLL TiledGrid3DAction : public GridAction +class AX_DLL TiledGrid3DAction : public GridAction { public: /** @@ -180,7 +180,7 @@ public: // Override virtual TiledGrid3DAction* clone() const override { - CC_ASSERT(0); + AX_ASSERT(0); return nullptr; } }; @@ -189,7 +189,7 @@ public: @brief AccelDeccelAmplitude action. @js NA */ -class CC_DLL AccelDeccelAmplitude : public ActionInterval +class AX_DLL AccelDeccelAmplitude : public ActionInterval { public: /** @@ -233,14 +233,14 @@ protected: ActionInterval* _other; private: - CC_DISALLOW_COPY_AND_ASSIGN(AccelDeccelAmplitude); + AX_DISALLOW_COPY_AND_ASSIGN(AccelDeccelAmplitude); }; /** @brief AccelAmplitude action. @js NA */ -class CC_DLL AccelAmplitude : public ActionInterval +class AX_DLL AccelAmplitude : public ActionInterval { public: /** @@ -278,14 +278,14 @@ protected: ActionInterval* _other; private: - CC_DISALLOW_COPY_AND_ASSIGN(AccelAmplitude); + AX_DISALLOW_COPY_AND_ASSIGN(AccelAmplitude); }; /** @brief DeccelAmplitude action. @js NA */ -class CC_DLL DeccelAmplitude : public ActionInterval +class AX_DLL DeccelAmplitude : public ActionInterval { public: /** @@ -329,7 +329,7 @@ protected: ActionInterval* _other; private: - CC_DISALLOW_COPY_AND_ASSIGN(DeccelAmplitude); + AX_DISALLOW_COPY_AND_ASSIGN(DeccelAmplitude); }; /** @@ -340,7 +340,7 @@ private: Sequence::create(Lens3D::create(...), StopGrid::create(), nullptr); @endcode */ -class CC_DLL StopGrid : public ActionInstant +class AX_DLL StopGrid : public ActionInstant { public: /** @@ -363,13 +363,13 @@ protected: void cacheTargetAsGridNode(); private: - CC_DISALLOW_COPY_AND_ASSIGN(StopGrid); + AX_DISALLOW_COPY_AND_ASSIGN(StopGrid); }; /** @brief ReuseGrid action. */ -class CC_DLL ReuseGrid : public ActionInstant +class AX_DLL ReuseGrid : public ActionInstant { public: /** @@ -402,7 +402,7 @@ protected: int _times; private: - CC_DISALLOW_COPY_AND_ASSIGN(ReuseGrid); + AX_DISALLOW_COPY_AND_ASSIGN(ReuseGrid); }; // end of actions group diff --git a/core/2d/CCActionGrid3D.cpp b/core/2d/CCActionGrid3D.cpp index b363d45c24..b188d41a11 100644 --- a/core/2d/CCActionGrid3D.cpp +++ b/core/2d/CCActionGrid3D.cpp @@ -209,7 +209,7 @@ FlipY3D* FlipY3D::create(float duration) } else { - CC_SAFE_DELETE(action); + AX_SAFE_DELETE(action); } return action; @@ -291,7 +291,7 @@ Lens3D* Lens3D::create(float duration, const Vec2& gridSize, const Vec2& positio } else { - CC_SAFE_DELETE(action); + AX_SAFE_DELETE(action); } return action; @@ -392,7 +392,7 @@ Ripple3D* Ripple3D::create(float duration, } else { - CC_SAFE_DELETE(action); + AX_SAFE_DELETE(action); } return action; @@ -470,7 +470,7 @@ Shaky3D* Shaky3D::create(float duration, const Vec2& gridSize, int range, bool s } else { - CC_SAFE_DELETE(action); + AX_SAFE_DELETE(action); } return action; } @@ -531,7 +531,7 @@ Liquid* Liquid::create(float duration, const Vec2& gridSize, unsigned int waves, } else { - CC_SAFE_DELETE(action); + AX_SAFE_DELETE(action); } return action; @@ -594,7 +594,7 @@ Waves* Waves::create(float duration, } else { - CC_SAFE_DELETE(action); + AX_SAFE_DELETE(action); } return action; @@ -668,7 +668,7 @@ Twirl* Twirl::create(float duration, const Vec2& gridSize, const Vec2& position, } else { - CC_SAFE_DELETE(action); + AX_SAFE_DELETE(action); } return action; diff --git a/core/2d/CCActionGrid3D.h b/core/2d/CCActionGrid3D.h index 22c6a93653..ed7fae5e3f 100644 --- a/core/2d/CCActionGrid3D.h +++ b/core/2d/CCActionGrid3D.h @@ -42,7 +42,7 @@ NS_AX_BEGIN You can control the effect by these parameters: duration, grid size, waves count, amplitude. */ -class CC_DLL Waves3D : public Grid3DAction +class AX_DLL Waves3D : public Grid3DAction { public: /** @@ -100,14 +100,14 @@ protected: float _amplitudeRate; private: - CC_DISALLOW_COPY_AND_ASSIGN(Waves3D); + AX_DISALLOW_COPY_AND_ASSIGN(Waves3D); }; /** @brief FlipX3D action. @details This action is used for flipping the target node on the x axis. */ -class CC_DLL FlipX3D : public Grid3DAction +class AX_DLL FlipX3D : public Grid3DAction { public: /** @@ -140,14 +140,14 @@ public: virtual bool initWithSize(const Vec2& gridSize, float duration); private: - CC_DISALLOW_COPY_AND_ASSIGN(FlipX3D); + AX_DISALLOW_COPY_AND_ASSIGN(FlipX3D); }; /** @brief FlipY3D action. @details This action is used for flipping the target node on the y axis. */ -class CC_DLL FlipY3D : public FlipX3D +class AX_DLL FlipY3D : public FlipX3D { public: /** @@ -165,7 +165,7 @@ public: virtual ~FlipY3D() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(FlipY3D); + AX_DISALLOW_COPY_AND_ASSIGN(FlipY3D); }; /** @@ -175,7 +175,7 @@ private: duration, grid size, center position of lens, radius of lens. Also you can change the lens effect value & whether effect is concave by the setter methods. */ -class CC_DLL Lens3D : public Grid3DAction +class AX_DLL Lens3D : public Grid3DAction { public: /** @@ -247,7 +247,7 @@ protected: bool _dirty; private: - CC_DISALLOW_COPY_AND_ASSIGN(Lens3D); + AX_DISALLOW_COPY_AND_ASSIGN(Lens3D); }; /** @@ -257,7 +257,7 @@ private: duration, grid size, center position of ripple, radius of ripple, waves count, amplitude. */ -class CC_DLL Ripple3D : public Grid3DAction +class AX_DLL Ripple3D : public Grid3DAction { public: /** @@ -343,7 +343,7 @@ protected: float _amplitudeRate; private: - CC_DISALLOW_COPY_AND_ASSIGN(Ripple3D); + AX_DISALLOW_COPY_AND_ASSIGN(Ripple3D); }; /** @@ -352,7 +352,7 @@ private: You can create the action by these parameters: duration, grid size, range, whether shake on the z axis. */ -class CC_DLL Shaky3D : public Grid3DAction +class AX_DLL Shaky3D : public Grid3DAction { public: /** @@ -387,7 +387,7 @@ protected: bool _shakeZ; private: - CC_DISALLOW_COPY_AND_ASSIGN(Shaky3D); + AX_DISALLOW_COPY_AND_ASSIGN(Shaky3D); }; /** @@ -396,7 +396,7 @@ private: You can create the action by these parameters: duration, grid size, waves count, amplitude of the liquid effect. */ -class CC_DLL Liquid : public Grid3DAction +class AX_DLL Liquid : public Grid3DAction { public: /** @@ -454,7 +454,7 @@ protected: float _amplitudeRate; private: - CC_DISALLOW_COPY_AND_ASSIGN(Liquid); + AX_DISALLOW_COPY_AND_ASSIGN(Liquid); }; /** @@ -464,7 +464,7 @@ private: duration, grid size, waves count, amplitude, whether waves on horizontal and whether waves on vertical. */ -class CC_DLL Waves : public Grid3DAction +class AX_DLL Waves : public Grid3DAction { public: /** @@ -538,7 +538,7 @@ protected: bool _horizontal; private: - CC_DISALLOW_COPY_AND_ASSIGN(Waves); + AX_DISALLOW_COPY_AND_ASSIGN(Waves); }; /** @@ -547,7 +547,7 @@ private: You can control the effect by these parameters: duration, grid size, center position, twirls count, amplitude. */ -class CC_DLL Twirl : public Grid3DAction +class AX_DLL Twirl : public Grid3DAction { public: /** @@ -628,7 +628,7 @@ protected: float _amplitudeRate; private: - CC_DISALLOW_COPY_AND_ASSIGN(Twirl); + AX_DISALLOW_COPY_AND_ASSIGN(Twirl); }; // end of actions group diff --git a/core/2d/CCActionInstant.cpp b/core/2d/CCActionInstant.cpp index d0380c98b5..729840dcf5 100644 --- a/core/2d/CCActionInstant.cpp +++ b/core/2d/CCActionInstant.cpp @@ -150,7 +150,7 @@ RemoveSelf* RemoveSelf::create(bool isNeedCleanUp /*= true*/) if (ret->init(isNeedCleanUp)) ret->autorelease(); else - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -192,7 +192,7 @@ FlipX* FlipX::create(bool x) return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -232,7 +232,7 @@ FlipY* FlipY::create(bool y) return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -315,7 +315,7 @@ CallFunc* CallFunc::create(const std::function& func) return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -370,7 +370,7 @@ CallFuncN* CallFuncN::create(const std::function& func) return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } diff --git a/core/2d/CCActionInstant.h b/core/2d/CCActionInstant.h index 0a1706c541..32d193657a 100644 --- a/core/2d/CCActionInstant.h +++ b/core/2d/CCActionInstant.h @@ -42,7 +42,7 @@ NS_AX_BEGIN /** @class ActionInstant * @brief Instant actions are immediate actions. They don't have a duration like the IntervalAction actions. **/ -class CC_DLL ActionInstant : public FiniteTimeAction +class AX_DLL ActionInstant : public FiniteTimeAction { public: // @@ -50,13 +50,13 @@ public: // virtual ActionInstant* clone() const override { - CC_ASSERT(0); + AX_ASSERT(0); return nullptr; } virtual ActionInstant* reverse() const override { - CC_ASSERT(0); + AX_ASSERT(0); return nullptr; } @@ -79,7 +79,7 @@ private: /** @class Show * @brief Show the node. **/ -class CC_DLL Show : public ActionInstant +class AX_DLL Show : public ActionInstant { public: /** Allocates and initializes the action. @@ -102,13 +102,13 @@ public: virtual ~Show() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(Show); + AX_DISALLOW_COPY_AND_ASSIGN(Show); }; /** @class Hide * @brief Hide the node. */ -class CC_DLL Hide : public ActionInstant +class AX_DLL Hide : public ActionInstant { public: /** Allocates and initializes the action. @@ -131,13 +131,13 @@ public: virtual ~Hide() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(Hide); + AX_DISALLOW_COPY_AND_ASSIGN(Hide); }; /** @class ToggleVisibility * @brief Toggles the visibility of a node. */ -class CC_DLL ToggleVisibility : public ActionInstant +class AX_DLL ToggleVisibility : public ActionInstant { public: /** Allocates and initializes the action. @@ -160,13 +160,13 @@ public: virtual ~ToggleVisibility() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(ToggleVisibility); + AX_DISALLOW_COPY_AND_ASSIGN(ToggleVisibility); }; /** @class RemoveSelf * @brief Remove the node. */ -class CC_DLL RemoveSelf : public ActionInstant +class AX_DLL RemoveSelf : public ActionInstant { public: /** Create the action. @@ -196,14 +196,14 @@ protected: bool _isNeedCleanUp; private: - CC_DISALLOW_COPY_AND_ASSIGN(RemoveSelf); + AX_DISALLOW_COPY_AND_ASSIGN(RemoveSelf); }; /** @class FlipX * @brief Flips the sprite horizontally. * @since v0.99.0 */ -class CC_DLL FlipX : public ActionInstant +class AX_DLL FlipX : public ActionInstant { public: /** Create the action. @@ -233,14 +233,14 @@ protected: bool _flipX; private: - CC_DISALLOW_COPY_AND_ASSIGN(FlipX); + AX_DISALLOW_COPY_AND_ASSIGN(FlipX); }; /** @class FlipY * @brief Flips the sprite vertically. * @since v0.99.0 */ -class CC_DLL FlipY : public ActionInstant +class AX_DLL FlipY : public ActionInstant { public: /** Create the action. @@ -270,13 +270,13 @@ protected: bool _flipY; private: - CC_DISALLOW_COPY_AND_ASSIGN(FlipY); + AX_DISALLOW_COPY_AND_ASSIGN(FlipY); }; /** @class Place * @brief Places the node in a certain position. */ -class CC_DLL Place : public ActionInstant +class AX_DLL Place : public ActionInstant { public: /** Creates a Place action with a position. @@ -306,13 +306,13 @@ protected: Vec2 _position; private: - CC_DISALLOW_COPY_AND_ASSIGN(Place); + AX_DISALLOW_COPY_AND_ASSIGN(Place); }; /** @class CallFunc * @brief Calls a 'callback'. */ -class CC_DLL CallFunc : public ActionInstant +class AX_DLL CallFunc : public ActionInstant { public: /** Creates the action with the callback of type std::function. @@ -354,14 +354,14 @@ protected: std::function _function; private: - CC_DISALLOW_COPY_AND_ASSIGN(CallFunc); + AX_DISALLOW_COPY_AND_ASSIGN(CallFunc); }; /** @class CallFuncN * @brief Calls a 'callback' with the node as the first argument. N means Node. * @js NA */ -class CC_DLL CallFuncN : public CallFunc +class AX_DLL CallFuncN : public CallFunc { public: /** Creates the action with the callback of type std::function. @@ -389,7 +389,7 @@ protected: std::function _functionN; private: - CC_DISALLOW_COPY_AND_ASSIGN(CallFuncN); + AX_DISALLOW_COPY_AND_ASSIGN(CallFuncN); }; // end of actions group diff --git a/core/2d/CCActionInterval.cpp b/core/2d/CCActionInterval.cpp index cc2c7b5ba1..733c6716bb 100644 --- a/core/2d/CCActionInterval.cpp +++ b/core/2d/CCActionInterval.cpp @@ -287,8 +287,8 @@ Sequence::Sequence() : _split(0) Sequence::~Sequence() { - CC_SAFE_RELEASE(_actions[0]); - CC_SAFE_RELEASE(_actions[1]); + AX_SAFE_RELEASE(_actions[0]); + AX_SAFE_RELEASE(_actions[1]); } void Sequence::startWithTarget(Node* target) @@ -448,7 +448,7 @@ Repeat* Repeat::clone() const Repeat::~Repeat() { - CC_SAFE_RELEASE(_innerAction); + AX_SAFE_RELEASE(_innerAction); } void Repeat::startWithTarget(Node* target) @@ -531,7 +531,7 @@ Repeat* Repeat::reverse() const // RepeatForever::~RepeatForever() { - CC_SAFE_RELEASE(_innerAction); + AX_SAFE_RELEASE(_innerAction); } RepeatForever* RepeatForever::create(ActionInterval* action) @@ -742,8 +742,8 @@ Spawn::Spawn() : _one(nullptr), _two(nullptr) {} Spawn::~Spawn() { - CC_SAFE_RELEASE(_one); - CC_SAFE_RELEASE(_two); + AX_SAFE_RELEASE(_one); + AX_SAFE_RELEASE(_two); } void Spawn::startWithTarget(Node* target) @@ -932,7 +932,7 @@ void RotateTo::update(float time) } else { -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS if (_startAngle.x == _startAngle.y && _diffAngle.x == _diffAngle.y) { _target->setRotation(_startAngle.x + _diffAngle.x * time); @@ -945,7 +945,7 @@ void RotateTo::update(float time) #else _target->setRotationSkewX(_startAngle.x + _diffAngle.x * time); _target->setRotationSkewY(_startAngle.y + _diffAngle.y * time); -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS } } } @@ -1077,7 +1077,7 @@ void RotateBy::update(float time) } else { -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS if (_startAngle.x == _startAngle.y && _deltaAngle.x == _deltaAngle.y) { _target->setRotation(_startAngle.x + _deltaAngle.x * time); @@ -1090,7 +1090,7 @@ void RotateBy::update(float time) #else _target->setRotationSkewX(_startAngle.x + _deltaAngle.x * time); _target->setRotationSkewY(_startAngle.y + _deltaAngle.y * time); -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS } } } @@ -1174,7 +1174,7 @@ void MoveBy::update(float t) { if (_target) { -#if CC_ENABLE_STACKABLE_ACTIONS +#if AX_ENABLE_STACKABLE_ACTIONS Vec3 currentPos = _target->getPosition3D(); Vec3 diff = currentPos - _previousPosition; _startPosition = _startPosition + diff; @@ -1183,7 +1183,7 @@ void MoveBy::update(float t) _previousPosition = newPos; #else _target->setPosition3D(_startPosition + _positionDelta * t); -#endif // CC_ENABLE_STACKABLE_ACTIONS +#endif // AX_ENABLE_STACKABLE_ACTIONS } } @@ -1583,7 +1583,7 @@ void JumpBy::update(float t) y += _delta.y * t; float x = _delta.x * t; -#if CC_ENABLE_STACKABLE_ACTIONS +#if AX_ENABLE_STACKABLE_ACTIONS Vec2 currentPos = _target->getPosition(); Vec2 diff = currentPos - _previousPos; @@ -1595,7 +1595,7 @@ void JumpBy::update(float t) _previousPos = newPos; #else _target->setPosition(_startPosition + Vec2(x, y)); -#endif // !CC_ENABLE_STACKABLE_ACTIONS +#endif // !AX_ENABLE_STACKABLE_ACTIONS } } @@ -1726,7 +1726,7 @@ void BezierBy::update(float time) float x = bezierat(xa, xb, xc, xd, time); float y = bezierat(ya, yb, yc, yd, time); -#if CC_ENABLE_STACKABLE_ACTIONS +#if AX_ENABLE_STACKABLE_ACTIONS Vec2 currentPos = _target->getPosition(); Vec2 diff = currentPos - _previousPosition; _startPosition = _startPosition + diff; @@ -1737,7 +1737,7 @@ void BezierBy::update(float time) _previousPosition = newPos; #else _target->setPosition(_startPosition + Vec2(x, y)); -#endif // !CC_ENABLE_STACKABLE_ACTIONS +#endif // !AX_ENABLE_STACKABLE_ACTIONS } } @@ -2393,7 +2393,7 @@ bool ReverseTime::initWithAction(FiniteTimeAction* action) if (ActionInterval::initWithDuration(action->getDuration())) { // Don't leak if action is reused - CC_SAFE_RELEASE(_other); + AX_SAFE_RELEASE(_other); _other = action; action->retain(); @@ -2414,7 +2414,7 @@ ReverseTime::ReverseTime() : _other(nullptr) {} ReverseTime::~ReverseTime() { - CC_SAFE_RELEASE(_other); + AX_SAFE_RELEASE(_other); } void ReverseTime::startWithTarget(Node* target) @@ -2464,10 +2464,10 @@ Animate::Animate() {} Animate::~Animate() { - CC_SAFE_RELEASE(_animation); - CC_SAFE_RELEASE(_origFrame); - CC_SAFE_DELETE(_splitTimes); - CC_SAFE_RELEASE(_frameDisplayedEvent); + AX_SAFE_RELEASE(_animation); + AX_SAFE_RELEASE(_origFrame); + AX_SAFE_DELETE(_splitTimes); + AX_SAFE_RELEASE(_frameDisplayedEvent); } bool Animate::initWithAnimation(Animation* animation) @@ -2510,8 +2510,8 @@ void Animate::setAnimation(axis::Animation* animation) { if (_animation != animation) { - CC_SAFE_RETAIN(animation); - CC_SAFE_RELEASE(_animation); + AX_SAFE_RETAIN(animation); + AX_SAFE_RELEASE(_animation); _animation = animation; } } @@ -2527,7 +2527,7 @@ void Animate::startWithTarget(Node* target) ActionInterval::startWithTarget(target); Sprite* sprite = static_cast(target); - CC_SAFE_RELEASE(_origFrame); + AX_SAFE_RELEASE(_origFrame); if (_animation->getRestoreOriginalFrame()) { @@ -2637,8 +2637,8 @@ TargetedAction::TargetedAction() : _action(nullptr), _forcedTarget(nullptr) {} TargetedAction::~TargetedAction() { - CC_SAFE_RELEASE(_forcedTarget); - CC_SAFE_RELEASE(_action); + AX_SAFE_RELEASE(_forcedTarget); + AX_SAFE_RELEASE(_action); } TargetedAction* TargetedAction::create(Node* target, FiniteTimeAction* action) @@ -2658,9 +2658,9 @@ bool TargetedAction::initWithTarget(Node* target, FiniteTimeAction* action) { if (ActionInterval::initWithDuration(action->getDuration())) { - CC_SAFE_RETAIN(target); + AX_SAFE_RETAIN(target); _forcedTarget = target; - CC_SAFE_RETAIN(action); + AX_SAFE_RETAIN(action); _action = action; return true; } @@ -2704,8 +2704,8 @@ void TargetedAction::setForcedTarget(Node* forcedTarget) { if (_forcedTarget != forcedTarget) { - CC_SAFE_RETAIN(forcedTarget); - CC_SAFE_RELEASE(_forcedTarget); + AX_SAFE_RETAIN(forcedTarget); + AX_SAFE_RELEASE(_forcedTarget); _forcedTarget = forcedTarget; } } diff --git a/core/2d/CCActionInterval.h b/core/2d/CCActionInterval.h index 5ec0f87d83..08ad4622f8 100644 --- a/core/2d/CCActionInterval.h +++ b/core/2d/CCActionInterval.h @@ -68,7 +68,7 @@ auto action = MoveBy::create(1.0f, Vec2::ONE); auto pingPongAction = Sequence::create(action, action->reverse(), nullptr); @endcode */ -class CC_DLL ActionInterval : public FiniteTimeAction +class AX_DLL ActionInterval : public FiniteTimeAction { public: /** How many seconds had elapsed since the actions started to run. @@ -100,13 +100,13 @@ public: virtual void startWithTarget(Node* target) override; virtual ActionInterval* reverse() const override { - CC_ASSERT(0); + AX_ASSERT(0); return nullptr; } virtual ActionInterval* clone() const override { - CC_ASSERT(0); + AX_ASSERT(0); return nullptr; } @@ -125,14 +125,14 @@ protected: /** @class Sequence * @brief Runs actions sequentially, one after another. */ -class CC_DLL Sequence : public ActionInterval +class AX_DLL Sequence : public ActionInterval { public: /** Helper constructor to create an array of sequenceable actions. * * @return An autoreleased Sequence object. */ - static Sequence* create(FiniteTimeAction* action1, ...) CC_REQUIRES_NULL_TERMINATION; + static Sequence* create(FiniteTimeAction* action1, ...) AX_REQUIRES_NULL_TERMINATION; /** Helper constructor to create an array of sequenceable actions given an array. * @code @@ -187,14 +187,14 @@ protected: int _last; private: - CC_DISALLOW_COPY_AND_ASSIGN(Sequence); + AX_DISALLOW_COPY_AND_ASSIGN(Sequence); }; /** @class Repeat * @brief Repeats an action a number of times. * To repeat an action forever use the RepeatForever action. */ -class CC_DLL Repeat : public ActionInterval +class AX_DLL Repeat : public ActionInterval { public: /** Creates a Repeat action. Times is an unsigned integer between 1 and pow(2,30). @@ -213,8 +213,8 @@ public: { if (_innerAction != action) { - CC_SAFE_RETAIN(action); - CC_SAFE_RELEASE(_innerAction); + AX_SAFE_RETAIN(action); + AX_SAFE_RELEASE(_innerAction); _innerAction = action; } } @@ -253,7 +253,7 @@ protected: FiniteTimeAction* _innerAction; private: - CC_DISALLOW_COPY_AND_ASSIGN(Repeat); + AX_DISALLOW_COPY_AND_ASSIGN(Repeat); }; /** @class RepeatForever @@ -261,7 +261,7 @@ private: To repeat the an action for a limited number of times use the Repeat action. * @warning This action can't be Sequenceable because it is not an IntervalAction. */ -class CC_DLL RepeatForever : public ActionInterval +class AX_DLL RepeatForever : public ActionInterval { public: /** Creates the action. @@ -279,9 +279,9 @@ public: { if (_innerAction != action) { - CC_SAFE_RELEASE(_innerAction); + AX_SAFE_RELEASE(_innerAction); _innerAction = action; - CC_SAFE_RETAIN(_innerAction); + AX_SAFE_RETAIN(_innerAction); } } @@ -314,13 +314,13 @@ protected: ActionInterval* _innerAction; private: - CC_DISALLOW_COPY_AND_ASSIGN(RepeatForever); + AX_DISALLOW_COPY_AND_ASSIGN(RepeatForever); }; /** @class Spawn * @brief Spawn a new action immediately */ -class CC_DLL Spawn : public ActionInterval +class AX_DLL Spawn : public ActionInterval { public: /** Helper constructor to create an array of spawned actions. @@ -332,7 +332,7 @@ public: * * @return An autoreleased Spawn object. */ - static Spawn* create(FiniteTimeAction* action1, ...) CC_REQUIRES_NULL_TERMINATION; + static Spawn* create(FiniteTimeAction* action1, ...) AX_REQUIRES_NULL_TERMINATION; /** Helper constructor to create an array of spawned actions. * @@ -383,14 +383,14 @@ protected: FiniteTimeAction* _two; private: - CC_DISALLOW_COPY_AND_ASSIGN(Spawn); + AX_DISALLOW_COPY_AND_ASSIGN(Spawn); }; /** @class RotateTo * @brief Rotates a Node object to a certain angle by modifying it's rotation attribute. The direction will be decided by the shortest angle. */ -class CC_DLL RotateTo : public ActionInterval +class AX_DLL RotateTo : public ActionInterval { public: /** @@ -460,13 +460,13 @@ protected: Vec3 _diffAngle; private: - CC_DISALLOW_COPY_AND_ASSIGN(RotateTo); + AX_DISALLOW_COPY_AND_ASSIGN(RotateTo); }; /** @class RotateBy * @brief Rotates a Node object clockwise a number of degrees by modifying it's rotation attribute. */ -class CC_DLL RotateBy : public ActionInterval +class AX_DLL RotateBy : public ActionInterval { public: /** @@ -525,7 +525,7 @@ protected: Vec3 _startAngle; private: - CC_DISALLOW_COPY_AND_ASSIGN(RotateBy); + AX_DISALLOW_COPY_AND_ASSIGN(RotateBy); }; /** @class MoveBy @@ -535,7 +535,7 @@ private: movement will be the sum of individual movements. @since v2.1beta2-custom */ -class CC_DLL MoveBy : public ActionInterval +class AX_DLL MoveBy : public ActionInterval { public: /** @@ -580,7 +580,7 @@ protected: Vec3 _previousPosition; private: - CC_DISALLOW_COPY_AND_ASSIGN(MoveBy); + AX_DISALLOW_COPY_AND_ASSIGN(MoveBy); }; /** @class MoveTo @@ -589,7 +589,7 @@ private: movements. @since v2.1beta2-custom */ -class CC_DLL MoveTo : public MoveBy +class AX_DLL MoveTo : public MoveBy { public: /** @@ -632,14 +632,14 @@ protected: Vec3 _endPosition; private: - CC_DISALLOW_COPY_AND_ASSIGN(MoveTo); + AX_DISALLOW_COPY_AND_ASSIGN(MoveTo); }; /** @class SkewTo * @brief Skews a Node object to given angles by modifying it's skewX and skewY attributes @since v1.0 */ -class CC_DLL SkewTo : public ActionInterval +class AX_DLL SkewTo : public ActionInterval { public: /** @@ -680,14 +680,14 @@ protected: float _deltaY; private: - CC_DISALLOW_COPY_AND_ASSIGN(SkewTo); + AX_DISALLOW_COPY_AND_ASSIGN(SkewTo); }; /** @class SkewBy * @brief Skews a Node object by skewX and skewY degrees. @since v1.0 */ -class CC_DLL SkewBy : public SkewTo +class AX_DLL SkewBy : public SkewTo { public: /** @@ -714,13 +714,13 @@ public: bool initWithDuration(float t, float sx, float sy); private: - CC_DISALLOW_COPY_AND_ASSIGN(SkewBy); + AX_DISALLOW_COPY_AND_ASSIGN(SkewBy); }; /** @class ResizeTo * @brief Resize a Node object to the final size by modifying it's 'size' attribute. */ -class CC_DLL ResizeTo : public ActionInterval +class AX_DLL ResizeTo : public ActionInterval { public: /** @@ -756,14 +756,14 @@ protected: Vec2 _sizeDelta; private: - CC_DISALLOW_COPY_AND_ASSIGN(ResizeTo); + AX_DISALLOW_COPY_AND_ASSIGN(ResizeTo); }; /** @class ResizeBy * @brief Resize a Node object by a size. Works on all nodes where setContentSize is effective. But it's mostly useful * for nodes where 9-slice is enabled */ -class CC_DLL ResizeBy : public ActionInterval +class AX_DLL ResizeBy : public ActionInterval { public: /** @@ -798,13 +798,13 @@ protected: Vec2 _previousSize; private: - CC_DISALLOW_COPY_AND_ASSIGN(ResizeBy); + AX_DISALLOW_COPY_AND_ASSIGN(ResizeBy); }; /** @class JumpBy * @brief Moves a Node object simulating a parabolic jump movement by modifying it's position attribute. */ -class CC_DLL JumpBy : public ActionInterval +class AX_DLL JumpBy : public ActionInterval { public: /** @@ -845,13 +845,13 @@ protected: Vec2 _previousPos; private: - CC_DISALLOW_COPY_AND_ASSIGN(JumpBy); + AX_DISALLOW_COPY_AND_ASSIGN(JumpBy); }; /** @class JumpTo * @brief Moves a Node object to a parabolic position simulating a jump movement by modifying it's position attribute. */ -class CC_DLL JumpTo : public JumpBy +class AX_DLL JumpTo : public JumpBy { public: /** @@ -884,7 +884,7 @@ protected: Vec2 _endPosition; private: - CC_DISALLOW_COPY_AND_ASSIGN(JumpTo); + AX_DISALLOW_COPY_AND_ASSIGN(JumpTo); }; /** @struct Bezier configuration structure @@ -902,7 +902,7 @@ typedef struct _ccBezierConfig /** @class BezierBy * @brief An action that moves the target with a cubic Bezier curve by a certain distance. */ -class CC_DLL BezierBy : public ActionInterval +class AX_DLL BezierBy : public ActionInterval { public: /** Creates the action with a duration and a bezier configuration. @@ -943,14 +943,14 @@ protected: Vec2 _previousPosition; private: - CC_DISALLOW_COPY_AND_ASSIGN(BezierBy); + AX_DISALLOW_COPY_AND_ASSIGN(BezierBy); }; /** @class BezierTo * @brief An action that moves the target with a cubic Bezier curve to a destination point. @since v0.8.2 */ -class CC_DLL BezierTo : public BezierBy +class AX_DLL BezierTo : public BezierBy { public: /** Creates the action with a duration and a bezier configuration. @@ -983,7 +983,7 @@ protected: ccBezierConfig _toConfig; private: - CC_DISALLOW_COPY_AND_ASSIGN(BezierTo); + AX_DISALLOW_COPY_AND_ASSIGN(BezierTo); }; /** @class ScaleTo @@ -991,7 +991,7 @@ private: @warning This action doesn't support "reverse". @warning The physics body contained in Node doesn't support this action. */ -class CC_DLL ScaleTo : public ActionInterval +class AX_DLL ScaleTo : public ActionInterval { public: /** @@ -1066,14 +1066,14 @@ protected: float _deltaZ; private: - CC_DISALLOW_COPY_AND_ASSIGN(ScaleTo); + AX_DISALLOW_COPY_AND_ASSIGN(ScaleTo); }; /** @class ScaleBy * @brief Scales a Node object a zoom factor by modifying it's scale attribute. @warning The physics body contained in Node doesn't support this action. */ -class CC_DLL ScaleBy : public ScaleTo +class AX_DLL ScaleBy : public ScaleTo { public: /** @@ -1114,13 +1114,13 @@ public: virtual ~ScaleBy() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(ScaleBy); + AX_DISALLOW_COPY_AND_ASSIGN(ScaleBy); }; /** @class Blink * @brief Blinks a Node object by modifying it's visible attribute. */ -class CC_DLL Blink : public ActionInterval +class AX_DLL Blink : public ActionInterval { public: /** @@ -1157,7 +1157,7 @@ protected: bool _originalState; private: - CC_DISALLOW_COPY_AND_ASSIGN(Blink); + AX_DISALLOW_COPY_AND_ASSIGN(Blink); }; /** @class FadeTo @@ -1165,7 +1165,7 @@ private: custom one. @warning This action doesn't support "reverse" */ -class CC_DLL FadeTo : public ActionInterval +class AX_DLL FadeTo : public ActionInterval { public: /** @@ -1203,14 +1203,14 @@ protected: friend class FadeIn; private: - CC_DISALLOW_COPY_AND_ASSIGN(FadeTo); + AX_DISALLOW_COPY_AND_ASSIGN(FadeTo); }; /** @class FadeIn * @brief Fades In an object that implements the RGBAProtocol protocol. It modifies the opacity from 0 to 255. The "reverse" of this action is FadeOut */ -class CC_DLL FadeIn : public FadeTo +class AX_DLL FadeIn : public FadeTo { public: /** @@ -1236,7 +1236,7 @@ public: virtual ~FadeIn() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(FadeIn); + AX_DISALLOW_COPY_AND_ASSIGN(FadeIn); FadeTo* _reverseAction; }; @@ -1244,7 +1244,7 @@ private: * @brief Fades Out an object that implements the RGBAProtocol protocol. It modifies the opacity from 255 to 0. The "reverse" of this action is FadeIn */ -class CC_DLL FadeOut : public FadeTo +class AX_DLL FadeOut : public FadeTo { public: /** @@ -1269,7 +1269,7 @@ public: virtual ~FadeOut() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(FadeOut); + AX_DISALLOW_COPY_AND_ASSIGN(FadeOut); FadeTo* _reverseAction; }; @@ -1278,7 +1278,7 @@ private: @warning This action doesn't support "reverse" @since v0.7.2 */ -class CC_DLL TintTo : public ActionInterval +class AX_DLL TintTo : public ActionInterval { public: /** @@ -1320,14 +1320,14 @@ protected: Color3B _from; private: - CC_DISALLOW_COPY_AND_ASSIGN(TintTo); + AX_DISALLOW_COPY_AND_ASSIGN(TintTo); }; /** @class TintBy @brief Tints a Node that implements the NodeRGB protocol from current tint to a custom one. @since v0.7.2 */ -class CC_DLL TintBy : public ActionInterval +class AX_DLL TintBy : public ActionInterval { public: /** @@ -1367,13 +1367,13 @@ protected: int16_t _fromB; private: - CC_DISALLOW_COPY_AND_ASSIGN(TintBy); + AX_DISALLOW_COPY_AND_ASSIGN(TintBy); }; /** @class DelayTime * @brief Delays the action a certain amount of seconds. */ -class CC_DLL DelayTime : public ActionInterval +class AX_DLL DelayTime : public ActionInterval { public: /** @@ -1397,7 +1397,7 @@ public: virtual ~DelayTime() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(DelayTime); + AX_DISALLOW_COPY_AND_ASSIGN(DelayTime); }; /** @class ReverseTime @@ -1408,7 +1408,7 @@ private: of your own actions, but using it outside the "reversed" scope is not recommended. */ -class CC_DLL ReverseTime : public ActionInterval +class AX_DLL ReverseTime : public ActionInterval { public: /** Creates the action. @@ -1440,14 +1440,14 @@ protected: FiniteTimeAction* _other; private: - CC_DISALLOW_COPY_AND_ASSIGN(ReverseTime); + AX_DISALLOW_COPY_AND_ASSIGN(ReverseTime); }; class Texture2D; /** @class Animate * @brief Animates a sprite given the name of an Animation. */ -class CC_DLL Animate : public ActionInterval +class AX_DLL Animate : public ActionInterval { public: /** Creates the action with an Animation and will restore the original frame when the animation is over. @@ -1504,14 +1504,14 @@ protected: AnimationFrame::DisplayedEventInfo _frameDisplayedEventInfo; private: - CC_DISALLOW_COPY_AND_ASSIGN(Animate); + AX_DISALLOW_COPY_AND_ASSIGN(Animate); }; /** @class TargetedAction * @brief Overrides the target of an action so that it always runs on the target * specified at action creation rather than the one specified by runAction. */ -class CC_DLL TargetedAction : public ActionInterval +class AX_DLL TargetedAction : public ActionInterval { public: /** Create an action with the specified action and forced target. @@ -1557,14 +1557,14 @@ protected: Node* _forcedTarget; private: - CC_DISALLOW_COPY_AND_ASSIGN(TargetedAction); + AX_DISALLOW_COPY_AND_ASSIGN(TargetedAction); }; /** * @class ActionFloat * @brief Action used to animate any value in range [from,to] over specified time interval */ -class CC_DLL ActionFloat : public ActionInterval +class AX_DLL ActionFloat : public ActionInterval { public: /** @@ -1609,7 +1609,7 @@ protected: ActionFloatCallback _callback; private: - CC_DISALLOW_COPY_AND_ASSIGN(ActionFloat); + AX_DISALLOW_COPY_AND_ASSIGN(ActionFloat); }; // end of actions group diff --git a/core/2d/CCActionManager.cpp b/core/2d/CCActionManager.cpp index c11b69f3be..e350879610 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 != CC_INVALID_INDEX) + if (i != AX_INVALID_INDEX) { removeActionAtIndex(i, element); } diff --git a/core/2d/CCActionManager.h b/core/2d/CCActionManager.h index 497f93f1e3..e5a6c0ce98 100644 --- a/core/2d/CCActionManager.h +++ b/core/2d/CCActionManager.h @@ -56,7 +56,7 @@ struct _hashElement; @since v0.8 */ -class CC_DLL ActionManager : public Ref +class AX_DLL ActionManager : public Ref { public: /** diff --git a/core/2d/CCActionPageTurn3D.h b/core/2d/CCActionPageTurn3D.h index 1ad129dd32..ae08c0b776 100644 --- a/core/2d/CCActionPageTurn3D.h +++ b/core/2d/CCActionPageTurn3D.h @@ -45,7 +45,7 @@ NS_AX_BEGIN @since v0.8.2 */ -class CC_DLL PageTurn3D : public Grid3DAction +class AX_DLL PageTurn3D : public Grid3DAction { public: /** diff --git a/core/2d/CCActionProgressTimer.h b/core/2d/CCActionProgressTimer.h index e50ec02532..431f8305cc 100644 --- a/core/2d/CCActionProgressTimer.h +++ b/core/2d/CCActionProgressTimer.h @@ -42,7 +42,7 @@ NS_AX_BEGIN You should specify the destination percentage when creating the action. @since v0.99.1 */ -class CC_DLL ProgressTo : public ActionInterval +class AX_DLL ProgressTo : public ActionInterval { public: /** @@ -77,14 +77,14 @@ protected: float _from; private: - CC_DISALLOW_COPY_AND_ASSIGN(ProgressTo); + AX_DISALLOW_COPY_AND_ASSIGN(ProgressTo); }; /** @brief Progress from a percentage to another percentage. @since v0.99.1 */ -class CC_DLL ProgressFromTo : public ActionInterval +class AX_DLL ProgressFromTo : public ActionInterval { public: /** @@ -121,7 +121,7 @@ protected: float _from; private: - CC_DISALLOW_COPY_AND_ASSIGN(ProgressFromTo); + AX_DISALLOW_COPY_AND_ASSIGN(ProgressFromTo); }; // end of actions group diff --git a/core/2d/CCActionTiledGrid.cpp b/core/2d/CCActionTiledGrid.cpp index a4ce4f680a..4ec55fb513 100644 --- a/core/2d/CCActionTiledGrid.cpp +++ b/core/2d/CCActionTiledGrid.cpp @@ -225,8 +225,8 @@ ShuffleTiles* ShuffleTiles::clone() const ShuffleTiles::~ShuffleTiles() { - CC_SAFE_DELETE_ARRAY(_tilesOrder); - CC_SAFE_DELETE_ARRAY(_tiles); + AX_SAFE_DELETE_ARRAY(_tilesOrder); + AX_SAFE_DELETE_ARRAY(_tiles); } void ShuffleTiles::shuffle(unsigned int* array, unsigned int len) @@ -569,7 +569,7 @@ TurnOffTiles* TurnOffTiles::clone() const TurnOffTiles::~TurnOffTiles() { - CC_SAFE_DELETE_ARRAY(_tilesOrder); + AX_SAFE_DELETE_ARRAY(_tilesOrder); } void TurnOffTiles::shuffle(unsigned int* array, unsigned int len) diff --git a/core/2d/CCActionTiledGrid.h b/core/2d/CCActionTiledGrid.h index 71a65eb8ca..c32d0e6b8a 100644 --- a/core/2d/CCActionTiledGrid.h +++ b/core/2d/CCActionTiledGrid.h @@ -42,7 +42,7 @@ NS_AX_BEGIN You can create the action by these parameters: duration, grid size, range, whether shake on the z axis. */ -class CC_DLL ShakyTiles3D : public TiledGrid3DAction +class AX_DLL ShakyTiles3D : public TiledGrid3DAction { public: /** @@ -77,7 +77,7 @@ protected: bool _shakeZ; private: - CC_DISALLOW_COPY_AND_ASSIGN(ShakyTiles3D); + AX_DISALLOW_COPY_AND_ASSIGN(ShakyTiles3D); }; /** @@ -86,7 +86,7 @@ private: You can create the action by these parameters: duration, grid size, range, whether shatter on the z axis. */ -class CC_DLL ShatteredTiles3D : public TiledGrid3DAction +class AX_DLL ShatteredTiles3D : public TiledGrid3DAction { public: /** @@ -122,7 +122,7 @@ protected: bool _shatterZ; private: - CC_DISALLOW_COPY_AND_ASSIGN(ShatteredTiles3D); + AX_DISALLOW_COPY_AND_ASSIGN(ShatteredTiles3D); }; struct Tile; @@ -132,7 +132,7 @@ struct Tile; You can create the action by these parameters: duration, grid size, the random seed. */ -class CC_DLL ShuffleTiles : public TiledGrid3DAction +class AX_DLL ShuffleTiles : public TiledGrid3DAction { public: /** @@ -172,14 +172,14 @@ protected: Tile* _tiles; private: - CC_DISALLOW_COPY_AND_ASSIGN(ShuffleTiles); + AX_DISALLOW_COPY_AND_ASSIGN(ShuffleTiles); }; /** @brief FadeOutTRTiles action. @details Fades out the target node with many tiles from Bottom-Left to Top-Right. */ -class CC_DLL FadeOutTRTiles : public TiledGrid3DAction +class AX_DLL FadeOutTRTiles : public TiledGrid3DAction { public: /** @@ -225,14 +225,14 @@ public: virtual ~FadeOutTRTiles() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(FadeOutTRTiles); + AX_DISALLOW_COPY_AND_ASSIGN(FadeOutTRTiles); }; /** @brief FadeOutBLTiles action. @details Fades out the target node with many tiles from Top-Right to Bottom-Left. */ -class CC_DLL FadeOutBLTiles : public FadeOutTRTiles +class AX_DLL FadeOutBLTiles : public FadeOutTRTiles { public: /** @@ -251,14 +251,14 @@ public: virtual ~FadeOutBLTiles() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(FadeOutBLTiles); + AX_DISALLOW_COPY_AND_ASSIGN(FadeOutBLTiles); }; /** @brief FadeOutUpTiles action. @details Fades out the target node with many tiles from bottom to top. */ -class CC_DLL FadeOutUpTiles : public FadeOutTRTiles +class AX_DLL FadeOutUpTiles : public FadeOutTRTiles { public: /** @@ -279,14 +279,14 @@ public: virtual ~FadeOutUpTiles() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(FadeOutUpTiles); + AX_DISALLOW_COPY_AND_ASSIGN(FadeOutUpTiles); }; /** @brief FadeOutDownTiles action. @details Fades out the target node with many tiles from top to bottom. */ -class CC_DLL FadeOutDownTiles : public FadeOutUpTiles +class AX_DLL FadeOutDownTiles : public FadeOutUpTiles { public: /** @@ -305,14 +305,14 @@ public: virtual ~FadeOutDownTiles() {} private: - CC_DISALLOW_COPY_AND_ASSIGN(FadeOutDownTiles); + AX_DISALLOW_COPY_AND_ASSIGN(FadeOutDownTiles); }; /** @brief TurnOffTiles action. @details Turn off the target node with many tiles in random order. */ -class CC_DLL TurnOffTiles : public TiledGrid3DAction +class AX_DLL TurnOffTiles : public TiledGrid3DAction { public: /** @@ -373,14 +373,14 @@ protected: unsigned int* _tilesOrder; private: - CC_DISALLOW_COPY_AND_ASSIGN(TurnOffTiles); + AX_DISALLOW_COPY_AND_ASSIGN(TurnOffTiles); }; /** @brief WavesTiles3D action. @details This action wave the target node with many tiles. */ -class CC_DLL WavesTiles3D : public TiledGrid3DAction +class AX_DLL WavesTiles3D : public TiledGrid3DAction { public: /** @@ -438,14 +438,14 @@ protected: float _amplitudeRate; private: - CC_DISALLOW_COPY_AND_ASSIGN(WavesTiles3D); + AX_DISALLOW_COPY_AND_ASSIGN(WavesTiles3D); }; /** @brief JumpTiles3D action. @details Move the tiles of a target node across the Z axis. */ -class CC_DLL JumpTiles3D : public TiledGrid3DAction +class AX_DLL JumpTiles3D : public TiledGrid3DAction { public: /** @@ -503,7 +503,7 @@ protected: float _amplitudeRate; private: - CC_DISALLOW_COPY_AND_ASSIGN(JumpTiles3D); + AX_DISALLOW_COPY_AND_ASSIGN(JumpTiles3D); }; /** @@ -511,7 +511,7 @@ private: @details Split the target node in many rows. Then move out some rows from left, move out the other rows from right. */ -class CC_DLL SplitRows : public TiledGrid3DAction +class AX_DLL SplitRows : public TiledGrid3DAction { public: /** @@ -543,7 +543,7 @@ protected: Vec2 _winSize; private: - CC_DISALLOW_COPY_AND_ASSIGN(SplitRows); + AX_DISALLOW_COPY_AND_ASSIGN(SplitRows); }; /** @@ -551,7 +551,7 @@ private: @details Split the target node in many columns. Then move out some columns from top, move out the other columns from bottom. */ -class CC_DLL SplitCols : public TiledGrid3DAction +class AX_DLL SplitCols : public TiledGrid3DAction { public: /** @@ -586,7 +586,7 @@ protected: Vec2 _winSize; private: - CC_DISALLOW_COPY_AND_ASSIGN(SplitCols); + AX_DISALLOW_COPY_AND_ASSIGN(SplitCols); }; // end of actions group diff --git a/core/2d/CCActionTween.h b/core/2d/CCActionTween.h index 9cd0b3b3e6..5e6aeddaa2 100644 --- a/core/2d/CCActionTween.h +++ b/core/2d/CCActionTween.h @@ -45,7 +45,7 @@ NS_AX_BEGIN Then once you running ActionTween on the node, the method updateTweenAction will be invoked. */ -class CC_DLL ActionTweenDelegate +class AX_DLL ActionTweenDelegate { public: /** @@ -82,7 +82,7 @@ public: @since v0.99.2 */ -class CC_DLL ActionTween : public ActionInterval +class AX_DLL ActionTween : public ActionInterval { public: /** diff --git a/core/2d/CCAnimation.cpp b/core/2d/CCAnimation.cpp index c99ad186df..d667671a24 100644 --- a/core/2d/CCAnimation.cpp +++ b/core/2d/CCAnimation.cpp @@ -41,7 +41,7 @@ AnimationFrame* AnimationFrame::create(SpriteFrame* spriteFrame, float delayUnit } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -61,7 +61,7 @@ AnimationFrame::~AnimationFrame() { CCLOGINFO("deallocing AnimationFrame: %p", this); - CC_SAFE_RELEASE(_spriteFrame); + AX_SAFE_RELEASE(_spriteFrame); } AnimationFrame* AnimationFrame::clone() const diff --git a/core/2d/CCAnimation.h b/core/2d/CCAnimation.h index d4279ed9bb..2d91411d75 100644 --- a/core/2d/CCAnimation.h +++ b/core/2d/CCAnimation.h @@ -25,8 +25,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_ANIMATION_H__ -#define __CC_ANIMATION_H__ +#ifndef __AX_ANIMATION_H__ +#define __AX_ANIMATION_H__ #include "platform/CCPlatformConfig.h" #include "base/CCRef.h" @@ -55,7 +55,7 @@ class SpriteFrame; @since v2.0 */ -class CC_DLL AnimationFrame : public Ref, public Clonable +class AX_DLL AnimationFrame : public Ref, public Clonable { public: /** @struct DisplayedEventInfo @@ -87,8 +87,8 @@ public: */ void setSpriteFrame(SpriteFrame* frame) { - CC_SAFE_RETAIN(frame); - CC_SAFE_RELEASE(_spriteFrame); + AX_SAFE_RETAIN(frame); + AX_SAFE_RELEASE(_spriteFrame); _spriteFrame = frame; } @@ -146,7 +146,7 @@ protected: ValueMap _userInfo; private: - CC_DISALLOW_COPY_AND_ASSIGN(AnimationFrame); + AX_DISALLOW_COPY_AND_ASSIGN(AnimationFrame); }; /** @class Animation @@ -157,7 +157,7 @@ private: * sprite->runAction(Animate::create(animation)); * @endcode */ -class CC_DLL Animation : public Ref, public Clonable +class AX_DLL Animation : public Ref, public Clonable { public: /** Creates an animation. @@ -314,7 +314,7 @@ protected: unsigned int _loops; private: - CC_DISALLOW_COPY_AND_ASSIGN(Animation); + AX_DISALLOW_COPY_AND_ASSIGN(Animation); }; // end of sprite_nodes group @@ -322,4 +322,4 @@ private: NS_AX_END -#endif // __CC_ANIMATION_H__ +#endif // __AX_ANIMATION_H__ diff --git a/core/2d/CCAnimationCache.cpp b/core/2d/CCAnimationCache.cpp index d098a5b1ef..efb18e971d 100644 --- a/core/2d/CCAnimationCache.cpp +++ b/core/2d/CCAnimationCache.cpp @@ -48,7 +48,7 @@ AnimationCache* AnimationCache::getInstance() void AnimationCache::destroyInstance() { - CC_SAFE_RELEASE_NULL(s_sharedAnimationCache); + AX_SAFE_RELEASE_NULL(s_sharedAnimationCache); } bool AnimationCache::init() diff --git a/core/2d/CCAnimationCache.h b/core/2d/CCAnimationCache.h index 228364739d..b8ffaebd3b 100644 --- a/core/2d/CCAnimationCache.h +++ b/core/2d/CCAnimationCache.h @@ -25,8 +25,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_ANIMATION_CACHE_H__ -#define __CC_ANIMATION_CACHE_H__ +#ifndef __AX_ANIMATION_CACHE_H__ +#define __AX_ANIMATION_CACHE_H__ #include "base/CCRef.h" #include "base/CCMap.h" @@ -52,7 +52,7 @@ Before v0.99.5, the recommend way was to save them on the Sprite. Since v0.99.5, @since v0.99.5 @js cc.animationCache */ -class CC_DLL AnimationCache : public Ref +class AX_DLL AnimationCache : public Ref { public: /** @@ -129,4 +129,4 @@ private: NS_AX_END -#endif // __CC_ANIMATION_CACHE_H__ +#endif // __AX_ANIMATION_CACHE_H__ diff --git a/core/2d/CCAtlasNode.cpp b/core/2d/CCAtlasNode.cpp index 670676e267..9185e2ff31 100644 --- a/core/2d/CCAtlasNode.cpp +++ b/core/2d/CCAtlasNode.cpp @@ -44,7 +44,7 @@ NS_AX_BEGIN AtlasNode::~AtlasNode() { - CC_SAFE_RELEASE(_textureAtlas); + AX_SAFE_RELEASE(_textureAtlas); } AtlasNode* AtlasNode::create(std::string_view tile, int tileWidth, int tileHeight, int itemsToRender) @@ -55,7 +55,7 @@ AtlasNode* AtlasNode::create(std::string_view tile, int tileWidth, int tileHeigh ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -270,8 +270,8 @@ Texture2D* AtlasNode::getTexture() const void AtlasNode::setTextureAtlas(TextureAtlas* textureAtlas) { - CC_SAFE_RETAIN(textureAtlas); - CC_SAFE_RELEASE(_textureAtlas); + AX_SAFE_RETAIN(textureAtlas); + AX_SAFE_RELEASE(_textureAtlas); _textureAtlas = textureAtlas; } diff --git a/core/2d/CCAtlasNode.h b/core/2d/CCAtlasNode.h index 6e1f01b898..6a7ec0d2a3 100644 --- a/core/2d/CCAtlasNode.h +++ b/core/2d/CCAtlasNode.h @@ -47,7 +47,7 @@ class TextureAtlas; * All features from Node are valid, plus the following features: * - opacity and RGB colors. */ -class CC_DLL AtlasNode : public Node, public TextureProtocol +class AX_DLL AtlasNode : public Node, public TextureProtocol { public: /** creates a AtlasNode with an Atlas file the width and height of each item and the quantity of items to render. @@ -147,7 +147,7 @@ protected: backend::UniformLocation _mvpMatrixLocation; private: - CC_DISALLOW_COPY_AND_ASSIGN(AtlasNode); + AX_DISALLOW_COPY_AND_ASSIGN(AtlasNode); }; // end of base_node group diff --git a/core/2d/CCAutoPolygon.cpp b/core/2d/CCAutoPolygon.cpp index dedce69b69..bdf0ca293f 100644 --- a/core/2d/CCAutoPolygon.cpp +++ b/core/2d/CCAutoPolygon.cpp @@ -133,12 +133,12 @@ void PolygonInfo::releaseVertsAndIndices() { if (nullptr != triangles.verts) { - CC_SAFE_DELETE_ARRAY(triangles.verts); + AX_SAFE_DELETE_ARRAY(triangles.verts); } if (nullptr != triangles.indices) { - CC_SAFE_DELETE_ARRAY(triangles.indices); + AX_SAFE_DELETE_ARRAY(triangles.indices); } } } @@ -184,7 +184,7 @@ AutoPolygon::AutoPolygon(std::string_view filename) AutoPolygon::~AutoPolygon() { - CC_SAFE_DELETE(_image); + AX_SAFE_DELETE(_image); } std::vector AutoPolygon::trace(const Rect& rect, float threshold) @@ -694,7 +694,7 @@ Rect AutoPolygon::getRealRect(const Rect& rect) else { // rect is specified, so convert to real rect - realRect = CC_RECT_POINTS_TO_PIXELS(rect); + realRect = AX_RECT_POINTS_TO_PIXELS(rect); } return realRect; } diff --git a/core/2d/CCAutoPolygon.h b/core/2d/CCAutoPolygon.h index b6efcff087..09ebdc2ac2 100644 --- a/core/2d/CCAutoPolygon.h +++ b/core/2d/CCAutoPolygon.h @@ -45,7 +45,7 @@ NS_AX_BEGIN * PolygonInfo is an object holding the required data to display Sprites. * It can be a simple as a triangle, or as complex as a whole 3D mesh */ -class CC_DLL PolygonInfo +class AX_DLL PolygonInfo { public: /// @name Creators @@ -138,7 +138,7 @@ private: * It has functions for each step in the process, from tracing all the points, to triangulation * the result can be then passed to Sprite::create() to create a Polygon Sprite */ -class CC_DLL AutoPolygon +class AX_DLL AutoPolygon { public: /** diff --git a/core/2d/CCCamera.cpp b/core/2d/CCCamera.cpp index 75798fe6d9..d0573caae0 100644 --- a/core/2d/CCCamera.cpp +++ b/core/2d/CCCamera.cpp @@ -119,7 +119,7 @@ Camera::Camera() Camera::~Camera() { - CC_SAFE_RELEASE(_clearBrush); + AX_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) { - CC_SAFE_RETAIN(clearBrush); - CC_SAFE_RELEASE(_clearBrush); + AX_SAFE_RETAIN(clearBrush); + AX_SAFE_RELEASE(_clearBrush); _clearBrush = clearBrush; } diff --git a/core/2d/CCCamera.h b/core/2d/CCCamera.h index 8fffddbdd6..8d446db44d 100644 --- a/core/2d/CCCamera.h +++ b/core/2d/CCCamera.h @@ -63,7 +63,7 @@ enum class CameraFlag /** * Defines a camera . */ -class CC_DLL Camera : public Node +class AX_DLL Camera : public Node { friend class Scene; friend class Director; diff --git a/core/2d/CCCameraBackgroundBrush.cpp b/core/2d/CCCameraBackgroundBrush.cpp index f992caf6d9..745941b700 100644 --- a/core/2d/CCCameraBackgroundBrush.cpp +++ b/core/2d/CCCameraBackgroundBrush.cpp @@ -36,7 +36,7 @@ #include "renderer/CCTextureCube.h" #include "renderer/ccShaders.h" -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA # include "base/CCEventCustom.h" # include "base/CCEventListenerCustom.h" # include "base/CCEventType.h" @@ -49,7 +49,7 @@ CameraBackgroundBrush::CameraBackgroundBrush() {} CameraBackgroundBrush::~CameraBackgroundBrush() { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); } CameraBackgroundBrush* CameraBackgroundBrush::createNoneBrush() @@ -86,11 +86,11 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundBrush::createSkyboxBrush(std::strin CameraBackgroundDepthBrush::CameraBackgroundDepthBrush() : _depth(0.f) , _clearColor(false) -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA , _backToForegroundListener(nullptr) #endif { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { initBuffer(); }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1); @@ -98,7 +98,7 @@ CameraBackgroundDepthBrush::CameraBackgroundDepthBrush() } CameraBackgroundDepthBrush::~CameraBackgroundDepthBrush() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -114,7 +114,7 @@ CameraBackgroundDepthBrush* CameraBackgroundDepthBrush::create(float depth) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -122,7 +122,7 @@ CameraBackgroundDepthBrush* CameraBackgroundDepthBrush::create(float depth) bool CameraBackgroundDepthBrush::init() { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::CAMERA_CLEAR); _programState = new backend::ProgramState(program); @@ -166,8 +166,8 @@ bool CameraBackgroundDepthBrush::init() _vertices[2].texCoords = Tex2F(1, 1); _vertices[3].texCoords = Tex2F(0, 1); - _customCommand.setBeforeCallback(CC_CALLBACK_0(CameraBackgroundDepthBrush::onBeforeDraw, this)); - _customCommand.setAfterCallback(CC_CALLBACK_0(CameraBackgroundDepthBrush::onAfterDraw, this)); + _customCommand.setBeforeCallback(AX_CALLBACK_0(CameraBackgroundDepthBrush::onBeforeDraw, this)); + _customCommand.setAfterCallback(AX_CALLBACK_0(CameraBackgroundDepthBrush::onAfterDraw, this)); initBuffer(); return true; @@ -273,7 +273,7 @@ CameraBackgroundColorBrush* CameraBackgroundColorBrush::create(const Color4F& co } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -284,11 +284,11 @@ CameraBackgroundSkyBoxBrush::CameraBackgroundSkyBoxBrush() : _texture(nullptr) , _actived(true) , _textureValid(true) -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA , _backToForegroundListener(nullptr) #endif { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { initBuffer(); }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1); @@ -297,8 +297,8 @@ CameraBackgroundSkyBoxBrush::CameraBackgroundSkyBoxBrush() CameraBackgroundSkyBoxBrush::~CameraBackgroundSkyBoxBrush() { - CC_SAFE_RELEASE(_texture); -#if CC_ENABLE_CACHE_TEXTURE_DATA + AX_SAFE_RELEASE(_texture); +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -333,8 +333,8 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundSkyBoxBrush::create(std::string_vie } else { - CC_SAFE_DELETE(texture); - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(texture); + AX_SAFE_DELETE(ret); } } @@ -351,7 +351,7 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundSkyBoxBrush::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -386,16 +386,16 @@ void CameraBackgroundSkyBoxBrush::drawBackground(Camera* camera) renderer->popGroup(); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8); } bool CameraBackgroundSkyBoxBrush::init() { - _customCommand.setBeforeCallback(CC_CALLBACK_0(CameraBackgroundSkyBoxBrush::onBeforeDraw, this)); - _customCommand.setAfterCallback(CC_CALLBACK_0(CameraBackgroundSkyBoxBrush::onAfterDraw, this)); + _customCommand.setBeforeCallback(AX_CALLBACK_0(CameraBackgroundSkyBoxBrush::onBeforeDraw, this)); + _customCommand.setAfterCallback(AX_CALLBACK_0(CameraBackgroundSkyBoxBrush::onAfterDraw, this)); - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::SKYBOX_3D); _programState = new backend::ProgramState(program); _uniformColorLoc = _programState->getUniformLocation("u_color"); @@ -444,8 +444,8 @@ void CameraBackgroundSkyBoxBrush::initBuffer() void CameraBackgroundSkyBoxBrush::setTexture(TextureCube* texture) { - CC_SAFE_RETAIN(texture); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RETAIN(texture); + AX_SAFE_RELEASE(_texture); _texture = texture; _programState->setTexture(_uniformEnvLoc, 0, _texture->getBackendTexture()); } diff --git a/core/2d/CCCameraBackgroundBrush.h b/core/2d/CCCameraBackgroundBrush.h index 715f824c52..cfc3aa6e7b 100644 --- a/core/2d/CCCameraBackgroundBrush.h +++ b/core/2d/CCCameraBackgroundBrush.h @@ -54,7 +54,7 @@ class Buffer; * background with given color and depth, Skybox brush clear the background with a skybox. Camera uses depth brush by * default. */ -class CC_DLL CameraBackgroundBrush : public Ref +class AX_DLL CameraBackgroundBrush : public Ref { public: /** @@ -130,7 +130,7 @@ protected: /** * Depth brush clear depth buffer with given depth */ -class CC_DLL CameraBackgroundDepthBrush : public CameraBackgroundBrush +class AX_DLL CameraBackgroundDepthBrush : public CameraBackgroundBrush { public: /** @@ -167,7 +167,7 @@ private: void onAfterDraw(); protected: -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener; #endif void initBuffer(); @@ -191,7 +191,7 @@ protected: /** * Color brush clear buffer with given depth and color */ -class CC_DLL CameraBackgroundColorBrush : public CameraBackgroundDepthBrush +class AX_DLL CameraBackgroundColorBrush : public CameraBackgroundDepthBrush { public: /** @@ -235,7 +235,7 @@ class EventListenerCustom; /** * Skybox brush clear buffer with a skybox */ -class CC_DLL CameraBackgroundSkyBoxBrush : public CameraBackgroundBrush +class AX_DLL CameraBackgroundSkyBoxBrush : public CameraBackgroundBrush { public: /** @@ -298,7 +298,7 @@ protected: TextureCube* _texture; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener; #endif diff --git a/core/2d/CCClippingNode.cpp b/core/2d/CCClippingNode.cpp index c1cc0dcdb3..c0e0b25881 100644 --- a/core/2d/CCClippingNode.cpp +++ b/core/2d/CCClippingNode.cpp @@ -43,7 +43,7 @@ ClippingNode::~ClippingNode() _stencil->stopAllActions(); _stencil->release(); } - CC_SAFE_DELETE(_stencilStateManager); + AX_SAFE_DELETE(_stencilStateManager); } ClippingNode* ClippingNode::create() @@ -55,7 +55,7 @@ ClippingNode* ClippingNode::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -70,7 +70,7 @@ ClippingNode* ClippingNode::create(Node* pStencil) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -153,7 +153,7 @@ void ClippingNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32 renderer->pushGroup(_groupCommandStencil.getRenderQueueID()); // _beforeVisitCmd.init(_globalZOrder); - // _beforeVisitCmd.func = CC_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilStateManager); + // _beforeVisitCmd.func = AX_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilStateManager); // renderer->addCommand(&_beforeVisitCmd); _stencilStateManager->onBeforeVisit(_globalZOrder); @@ -166,14 +166,14 @@ void ClippingNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32 programState->setUniform(alphaLocation, &alphaThreshold, sizeof(alphaThreshold)); setProgramStateRecursively(_stencil, programState); - CC_SAFE_RELEASE_NULL(programState); + AX_SAFE_RELEASE_NULL(programState); } _stencil->visit(renderer, _modelViewTransform, flags); auto afterDrawStencilCmd = renderer->nextCallbackCommand(); afterDrawStencilCmd->init(_globalZOrder); - afterDrawStencilCmd->func = CC_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilStateManager); + afterDrawStencilCmd->func = AX_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilStateManager); renderer->addCommand(afterDrawStencilCmd); bool visibleByCamera = isVisitableByVisitingCamera(); @@ -215,7 +215,7 @@ void ClippingNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32 auto _afterVisitCmd = renderer->nextCallbackCommand(); _afterVisitCmd->init(_globalZOrder); - _afterVisitCmd->func = CC_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager); + _afterVisitCmd->func = AX_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager); renderer->addCommand(_afterVisitCmd); renderer->popGroup(); @@ -242,7 +242,7 @@ void ClippingNode::setStencil(Node* stencil) if (_stencil == stencil) return; -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -251,7 +251,7 @@ void ClippingNode::setStencil(Node* stencil) if (stencil) sEngine->retainScriptObject(this, stencil); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS // cleanup current stencil if (_stencil != nullptr && _stencil->isRunning()) @@ -259,11 +259,11 @@ void ClippingNode::setStencil(Node* stencil) _stencil->onExitTransitionDidStart(); _stencil->onExit(); } - CC_SAFE_RELEASE_NULL(_stencil); + AX_SAFE_RELEASE_NULL(_stencil); // initialise new stencil _stencil = stencil; - CC_SAFE_RETAIN(_stencil); + AX_SAFE_RETAIN(_stencil); if (_stencil != nullptr && this->isRunning()) { _stencil->onEnter(); diff --git a/core/2d/CCClippingNode.h b/core/2d/CCClippingNode.h index 16901a2ad0..806f97d9fb 100644 --- a/core/2d/CCClippingNode.h +++ b/core/2d/CCClippingNode.h @@ -44,7 +44,7 @@ class StencilStateManager; * The stencil is an other Node that will not be drawn. * The clipping is done using the alpha part of the stencil (adjusted with an alphaThreshold). */ -class CC_DLL ClippingNode : public Node +class AX_DLL ClippingNode : public Node { public: /** Creates and initializes a clipping node without a stencil. @@ -166,7 +166,7 @@ protected: std::unordered_map _originalStencilProgramState; private: - CC_DISALLOW_COPY_AND_ASSIGN(ClippingNode); + AX_DISALLOW_COPY_AND_ASSIGN(ClippingNode); }; /** @} */ NS_AX_END diff --git a/core/2d/CCClippingRectangleNode.cpp b/core/2d/CCClippingRectangleNode.cpp index 60f68536f4..862e236866 100644 --- a/core/2d/CCClippingRectangleNode.cpp +++ b/core/2d/CCClippingRectangleNode.cpp @@ -38,7 +38,7 @@ ClippingRectangleNode* ClippingRectangleNode::create(const Rect& clippingRegion) node->autorelease(); } else - CC_SAFE_DELETE(node); + AX_SAFE_DELETE(node); return node; } @@ -49,7 +49,7 @@ ClippingRectangleNode* ClippingRectangleNode::create() if (node->init()) node->autorelease(); else - CC_SAFE_DELETE(node); + AX_SAFE_DELETE(node); return node; } @@ -94,14 +94,14 @@ void ClippingRectangleNode::visit(Renderer* renderer, const Mat4& parentTransfor { auto beforeVisitCmdScissor = renderer->nextCallbackCommand(); beforeVisitCmdScissor->init(_globalZOrder); - beforeVisitCmdScissor->func = CC_CALLBACK_0(ClippingRectangleNode::onBeforeVisitScissor, this); + beforeVisitCmdScissor->func = AX_CALLBACK_0(ClippingRectangleNode::onBeforeVisitScissor, this); renderer->addCommand(beforeVisitCmdScissor); Node::visit(renderer, parentTransform, parentFlags); auto afterVisitCmdScissor = renderer->nextCallbackCommand(); afterVisitCmdScissor->init(_globalZOrder); - afterVisitCmdScissor->func = CC_CALLBACK_0(ClippingRectangleNode::onAfterVisitScissor, this); + afterVisitCmdScissor->func = AX_CALLBACK_0(ClippingRectangleNode::onAfterVisitScissor, this); renderer->addCommand(afterVisitCmdScissor); } diff --git a/core/2d/CCClippingRectangleNode.h b/core/2d/CCClippingRectangleNode.h index d4c849f517..77e6595168 100644 --- a/core/2d/CCClippingRectangleNode.h +++ b/core/2d/CCClippingRectangleNode.h @@ -43,7 +43,7 @@ NS_AX_BEGIN The region of ClippingRectangleNode doesn't support any transform except scale. @js NA */ -class CC_DLL ClippingRectangleNode : public Node +class AX_DLL ClippingRectangleNode : public Node { public: /** diff --git a/core/2d/CCComponent.cpp b/core/2d/CCComponent.cpp index 5222172b32..4b731562c2 100644 --- a/core/2d/CCComponent.cpp +++ b/core/2d/CCComponent.cpp @@ -61,7 +61,7 @@ Component* Component::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; diff --git a/core/2d/CCComponent.h b/core/2d/CCComponent.h index fc79a90d63..375f0b8d62 100644 --- a/core/2d/CCComponent.h +++ b/core/2d/CCComponent.h @@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_FRAMEWORK_COMPONENT_H__ -#define __CC_FRAMEWORK_COMPONENT_H__ +#ifndef __AX_FRAMEWORK_COMPONENT_H__ +#define __AX_FRAMEWORK_COMPONENT_H__ /// @cond DO_NOT_SHOW #include @@ -44,7 +44,7 @@ enum kComponentOnUpdate }; -class CC_DLL Component : public Ref +class AX_DLL Component : public Ref { public: static Component* create(); @@ -88,4 +88,4 @@ protected: NS_AX_END /// @endcond -#endif // __CC_FRAMEWORK_COMPONENT_H__ +#endif // __AX_FRAMEWORK_COMPONENT_H__ diff --git a/core/2d/CCComponentContainer.cpp b/core/2d/CCComponentContainer.cpp index 50993f5ffb..ebaf27e470 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); - CC_BREAK_IF(iter == _componentMap.end()); + AX_BREAK_IF(iter == _componentMap.end()); auto component = iter->second; _componentMap.erase(componentName); @@ -116,12 +116,12 @@ void ComponentContainer::visit(float delta) { if (!_componentMap.empty()) { - CC_SAFE_RETAIN(_owner); + AX_SAFE_RETAIN(_owner); for (auto& iter : _componentMap) { iter.second->update(delta); } - CC_SAFE_RELEASE(_owner); + AX_SAFE_RELEASE(_owner); } } diff --git a/core/2d/CCComponentContainer.h b/core/2d/CCComponentContainer.h index 89f9afa86e..d6ff59d268 100644 --- a/core/2d/CCComponentContainer.h +++ b/core/2d/CCComponentContainer.h @@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_FRAMEWORK_COMCONTAINER_H__ -#define __CC_FRAMEWORK_COMCONTAINER_H__ +#ifndef __AX_FRAMEWORK_COMCONTAINER_H__ +#define __AX_FRAMEWORK_COMCONTAINER_H__ /// @cond DO_NOT_SHOW @@ -36,7 +36,7 @@ NS_AX_BEGIN class Component; class Node; -class CC_DLL ComponentContainer +class AX_DLL ComponentContainer { protected: /** @@ -77,4 +77,4 @@ private: NS_AX_END /// @endcond -#endif // __CC_FRAMEWORK_COMCONTAINER_H__ +#endif // __AX_FRAMEWORK_COMCONTAINER_H__ diff --git a/core/2d/CCDrawNode.cpp b/core/2d/CCDrawNode.cpp index 1e85611338..73f32ac113 100644 --- a/core/2d/CCDrawNode.cpp +++ b/core/2d/CCDrawNode.cpp @@ -49,7 +49,7 @@ static inline Tex2F v2ToTex2F(const Vec2& v) DrawNode::DrawNode(float lineWidth) : _lineWidth(lineWidth), _defaultLineWidth(lineWidth) { _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // TODO new-renderer: interface setupBuffer removal // Need to listen the event only when not use batchnode, because it will use VBO @@ -64,9 +64,9 @@ DrawNode::DrawNode(float lineWidth) : _lineWidth(lineWidth), _defaultLineWidth(l DrawNode::~DrawNode() { - CC_SAFE_FREE(_bufferTriangle); - CC_SAFE_FREE(_bufferPoint); - CC_SAFE_FREE(_bufferLine); + AX_SAFE_FREE(_bufferTriangle); + AX_SAFE_FREE(_bufferPoint); + AX_SAFE_FREE(_bufferLine); freeShaderInternal(_customCommandTriangle); freeShaderInternal(_customCommandPoint); @@ -82,7 +82,7 @@ DrawNode* DrawNode::create(float defaultLineWidth) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -166,7 +166,7 @@ void DrawNode::updateShaderInternal(CustomCommand& cmd, CustomCommand::PrimitiveType primitiveType) { auto& pipelinePS = cmd.getPipelineDescriptor().programState; - CC_SAFE_RELEASE(pipelinePS); + AX_SAFE_RELEASE(pipelinePS); auto program = backend::Program::getBuiltinProgram(programType); pipelinePS = new backend::ProgramState(program); @@ -178,7 +178,7 @@ void DrawNode::updateShaderInternal(CustomCommand& cmd, void DrawNode::freeShaderInternal(CustomCommand& cmd) { auto& pipelinePS = cmd.getPipelineDescriptor().programState; - CC_SAFE_RELEASE_NULL(pipelinePS); + AX_SAFE_RELEASE_NULL(pipelinePS); } void DrawNode::setVertexLayout(CustomCommand& cmd) diff --git a/core/2d/CCDrawNode.h b/core/2d/CCDrawNode.h index 049cd93c0b..ad952fb497 100644 --- a/core/2d/CCDrawNode.h +++ b/core/2d/CCDrawNode.h @@ -54,7 +54,7 @@ class PointArray; * Faster than the "drawing primitives" since they draws everything in one single batch. * @since v2.1 */ -class CC_DLL DrawNode : public Node +class AX_DLL DrawNode : public Node { public: /** creates and initialize a DrawNode node. @@ -412,7 +412,7 @@ protected: axis::any_buffer _abuf; private: - CC_DISALLOW_COPY_AND_ASSIGN(DrawNode); + AX_DISALLOW_COPY_AND_ASSIGN(DrawNode); }; /** @} */ NS_AX_END diff --git a/core/2d/CCFastTMXLayer.cpp b/core/2d/CCFastTMXLayer.cpp index 22265096a6..af2c574468 100644 --- a/core/2d/CCFastTMXLayer.cpp +++ b/core/2d/CCFastTMXLayer.cpp @@ -65,7 +65,7 @@ FastTMXLayer* FastTMXLayer::create(TMXTilesetInfo* tilesetInfo, TMXLayerInfo* la ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -88,7 +88,7 @@ bool FastTMXLayer::initWithTilesetInfo(TMXTilesetInfo* tilesetInfo, TMXLayerInfo // tilesetInfo _tileSet = tilesetInfo; - CC_SAFE_RETAIN(_tileSet); + AX_SAFE_RETAIN(_tileSet); // mapInfo _mapTileSize = mapInfo->getTileSize(); @@ -98,10 +98,10 @@ bool FastTMXLayer::initWithTilesetInfo(TMXTilesetInfo* tilesetInfo, TMXLayerInfo // offset (after layer orientation is set); Vec2 offset = this->calculateLayerOffset(layerInfo->_offset); - this->setPosition(CC_POINT_PIXELS_TO_POINTS(offset)); + this->setPosition(AX_POINT_PIXELS_TO_POINTS(offset)); this->setContentSize( - CC_SIZE_PIXELS_TO_POINTS(Vec2(_layerSize.width * _mapTileSize.width, _layerSize.height * _mapTileSize.height))); + AX_SIZE_PIXELS_TO_POINTS(Vec2(_layerSize.width * _mapTileSize.width, _layerSize.height * _mapTileSize.height))); this->tileToNodeTransform(); @@ -115,15 +115,15 @@ FastTMXLayer::FastTMXLayer() {} FastTMXLayer::~FastTMXLayer() { - CC_SAFE_RELEASE(_tileSet); - CC_SAFE_RELEASE(_texture); - CC_SAFE_FREE(_tiles); - CC_SAFE_RELEASE(_vertexBuffer); - CC_SAFE_RELEASE(_indexBuffer); + AX_SAFE_RELEASE(_tileSet); + AX_SAFE_RELEASE(_texture); + AX_SAFE_FREE(_tiles); + AX_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_indexBuffer); for (auto& e : _customCommands) { - CC_SAFE_RELEASE(e.second->getPipelineDescriptor().programState); + AX_SAFE_RELEASE(e.second->getPipelineDescriptor().programState); delete e.second; } } @@ -167,8 +167,8 @@ void FastTMXLayer::draw(Renderer* renderer, const Mat4& transform, uint32_t flag void FastTMXLayer::updateTiles(const Rect& culledRect) { Rect visibleTiles = Rect(culledRect.origin, culledRect.size * _director->getContentScaleFactor()); - Vec2 mapTileSize = CC_SIZE_PIXELS_TO_POINTS(_mapTileSize); - Vec2 tileSize = CC_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize); + Vec2 mapTileSize = AX_SIZE_PIXELS_TO_POINTS(_mapTileSize); + Vec2 tileSize = AX_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize); Mat4 nodeToTileTransform = _tileToNodeTransform.getInversed(); // transform to tile visibleTiles = RectApplyTransform(visibleTiles, nodeToTileTransform); @@ -275,7 +275,7 @@ void FastTMXLayer::updateVertexBuffer() void FastTMXLayer::updateIndexBuffer() { -#ifdef CC_FAST_TILEMAP_32_BIT_INDICES +#ifdef AX_FAST_TILEMAP_32_BIT_INDICES unsigned int indexBufferSize = (unsigned int)(sizeof(unsigned int) * _indices.size()); #else unsigned int indexBufferSize = (unsigned int)(sizeof(unsigned short) * _indices.size()); @@ -384,8 +384,8 @@ void FastTMXLayer::setupTiles() Mat4 FastTMXLayer::tileToNodeTransform() { - float w = _mapTileSize.width / CC_CONTENT_SCALE_FACTOR(); - float h = _mapTileSize.height / CC_CONTENT_SCALE_FACTOR(); + float w = _mapTileSize.width / AX_CONTENT_SCALE_FACTOR(); + float h = _mapTileSize.height / AX_CONTENT_SCALE_FACTOR(); float offY = (_layerSize.height - 1) * h; switch (_layerOrientation) @@ -432,7 +432,7 @@ void FastTMXLayer::updatePrimitives() command->setVertexBuffer(_vertexBuffer); CustomCommand::IndexFormat indexFormat = CustomCommand::IndexFormat::U_SHORT; -#if CC_FAST_TILEMAP_32_BIT_INDICES +#if AX_FAST_TILEMAP_32_BIT_INDICES indexFormat = CustomCommand::IndexFormat::U_INT; #endif command->setIndexBuffer(_indexBuffer, indexFormat); @@ -443,7 +443,7 @@ void FastTMXLayer::updatePrimitives() if (_useAutomaticVertexZ) { - CC_SAFE_RELEASE(pipelineDescriptor.programState); + AX_SAFE_RELEASE(pipelineDescriptor.programState); auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE_COLOR_ALPHA_TEST); auto programState = new backend::ProgramState(program); @@ -454,7 +454,7 @@ void FastTMXLayer::updatePrimitives() } else { - CC_SAFE_RELEASE(pipelineDescriptor.programState); + AX_SAFE_RELEASE(pipelineDescriptor.programState); auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE_COLOR); auto programState = new backend::ProgramState(program); pipelineDescriptor.programState = programState; @@ -504,7 +504,7 @@ void FastTMXLayer::updateTotalQuads() { if (_quadsDirty) { - Vec2 tileSize = CC_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize); + Vec2 tileSize = AX_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize); Vec2 texSize = _tileSet->_imageSize; _tileToQuadIndex.clear(); _totalQuads.resize(int(_layerSize.width * _layerSize.height)); @@ -669,7 +669,7 @@ Sprite* FastTMXLayer::getTileAt(const Vec2& tileCoordinate) { // tile not created yet. create it Rect rect = _tileSet->getRectForGID(gid); - rect = CC_RECT_PIXELS_TO_POINTS(rect); + rect = AX_RECT_PIXELS_TO_POINTS(rect); tile = Sprite::createWithTexture(_texture, rect); Vec2 p = this->getPositionAt(tileCoordinate); @@ -890,7 +890,7 @@ void FastTMXLayer::setTileGID(int gid, const Vec2& tileCoordinate, TMXTileFlags { Sprite* sprite = it->second.first; Rect rect = _tileSet->getRectForGID(gid); - rect = CC_RECT_PIXELS_TO_POINTS(rect); + rect = AX_RECT_PIXELS_TO_POINTS(rect); sprite->setTextureRect(rect, false, rect.size); this->reorderChild(sprite, z); @@ -1026,7 +1026,7 @@ TMXTileAnimTask::TMXTileAnimTask(FastTMXLayer* layer, TMXTileAnimInfo* animation void TMXTileAnimTask::tickAndScheduleNext(float dt) { setCurrFrame(); - _layer->getParent()->scheduleOnce(CC_CALLBACK_1(TMXTileAnimTask::tickAndScheduleNext, this), + _layer->getParent()->scheduleOnce(AX_CALLBACK_1(TMXTileAnimTask::tickAndScheduleNext, this), _animation->_frames[_currentFrame]._duration / 1000.0f, _key); } diff --git a/core/2d/CCFastTMXLayer.h b/core/2d/CCFastTMXLayer.h index 8c0adb5439..e07cadc53b 100644 --- a/core/2d/CCFastTMXLayer.h +++ b/core/2d/CCFastTMXLayer.h @@ -81,7 +81,7 @@ class Buffer; * @js NA */ -class CC_DLL FastTMXLayer : public Node +class AX_DLL FastTMXLayer : public Node { public: /** Possible orientations of the TMX map */ @@ -222,8 +222,8 @@ public: */ void setTileSet(TMXTilesetInfo* info) { - CC_SAFE_RETAIN(info); - CC_SAFE_RELEASE(_tileSet); + AX_SAFE_RETAIN(info); + AX_SAFE_RELEASE(_tileSet); _tileSet = info; } @@ -363,7 +363,7 @@ protected: bool _quadsDirty = true; std::vector _tileToQuadIndex; std::vector _totalQuads; -#ifdef CC_FAST_TILEMAP_32_BIT_INDICES +#ifdef AX_FAST_TILEMAP_32_BIT_INDICES std::vector _indices; #else std::vector _indices; @@ -386,7 +386,7 @@ protected: /** @brief TMXTileAnimTask represents the frame-tick task of an animated tile. * It is a assistant class for TMXTileAnimTicker. */ -class CC_DLL TMXTileAnimTask : public Ref +class AX_DLL TMXTileAnimTask : public Ref { public: TMXTileAnimTask(FastTMXLayer* layer, TMXTileAnimInfo* animation, const Vec2& tilePos); @@ -418,7 +418,7 @@ protected: /** @brief TMXTileAnimManager controls all tile animation of a layer. */ -class CC_DLL TMXTileAnimManager : public Ref +class AX_DLL TMXTileAnimManager : public Ref { public: static TMXTileAnimManager* create(FastTMXLayer* layer); diff --git a/core/2d/CCFastTMXTiledMap.cpp b/core/2d/CCFastTMXTiledMap.cpp index ba63586670..fadf34e839 100644 --- a/core/2d/CCFastTMXTiledMap.cpp +++ b/core/2d/CCFastTMXTiledMap.cpp @@ -41,7 +41,7 @@ FastTMXTiledMap* FastTMXTiledMap::create(std::string_view tmxFile) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -53,7 +53,7 @@ FastTMXTiledMap* FastTMXTiledMap::createWithXML(std::string_view tmxString, std: ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } diff --git a/core/2d/CCFastTMXTiledMap.h b/core/2d/CCFastTMXTiledMap.h index d4aeb26de2..497776d54f 100644 --- a/core/2d/CCFastTMXTiledMap.h +++ b/core/2d/CCFastTMXTiledMap.h @@ -94,7 +94,7 @@ class FastTMXLayer; * @since v3.2 * @js NA */ -class CC_DLL FastTMXTiledMap : public Node +class AX_DLL FastTMXTiledMap : public Node { public: /** Creates a TMX Tiled Map with a TMX file. @@ -203,7 +203,7 @@ public: */ void setTileAnimEnabled(bool enabled); - CC_DEPRECATED_ATTRIBUTE int getLayerNum() const { return getLayerCount(); } + AX_DEPRECATED_ATTRIBUTE int getLayerNum() const { return getLayerCount(); } int getLayerCount() const { return _layerCount; } @@ -249,7 +249,7 @@ protected: std::string _tmxFile; private: - CC_DISALLOW_COPY_AND_ASSIGN(FastTMXTiledMap); + AX_DISALLOW_COPY_AND_ASSIGN(FastTMXTiledMap); }; // end of tilemap_parallax_nodes group diff --git a/core/2d/CCFont.h b/core/2d/CCFont.h index e699b03dbd..6fdff63689 100644 --- a/core/2d/CCFont.h +++ b/core/2d/CCFont.h @@ -38,7 +38,7 @@ NS_AX_BEGIN class FontAtlas; -class CC_DLL Font : public Ref +class AX_DLL Font : public Ref { public: virtual FontAtlas* newFontAtlas() = 0; diff --git a/core/2d/CCFontAtlas.cpp b/core/2d/CCFontAtlas.cpp index 850e1f3360..753f8ad131 100644 --- a/core/2d/CCFontAtlas.cpp +++ b/core/2d/CCFontAtlas.cpp @@ -26,8 +26,8 @@ ****************************************************************************/ #include "2d/CCFontAtlas.h" -#if CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM != AX_PLATFORM_WIN32 && AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID +#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include "platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" #endif #include @@ -63,7 +63,7 @@ FontAtlas::FontAtlas(Font* theFont) : _font(theFont) _pixelFormat = backend::PixelFormat::LA8; _currentPageDataSize = CacheTextureWidth * CacheTextureHeight << _strideShift; -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) _currentPageDataSizeRGBA = CacheTextureWidth * CacheTextureHeight * 4; #endif @@ -81,11 +81,11 @@ FontAtlas::FontAtlas(Font* theFont) : _font(theFont) _letterPadding += 2 * FontFreeType::DistanceMapSpread; } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA auto eventDispatcher = Director::getInstance()->getEventDispatcher(); _rendererRecreatedListener = EventListenerCustom::create( - EVENT_RENDERER_RECREATED, CC_CALLBACK_1(FontAtlas::listenRendererRecreated, this)); + EVENT_RENDERER_RECREATED, AX_CALLBACK_1(FontAtlas::listenRendererRecreated, this)); eventDispatcher->addEventListenerWithFixedPriority(_rendererRecreatedListener, 1); #endif } @@ -97,7 +97,7 @@ void FontAtlas::reinit() _currentPageData = new uint8_t[_currentPageDataSize]; _currentPage = -1; -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) if (_strideShift && !_currentPageDataRGBA) _currentPageDataRGBA = new uint8_t[_currentPageDataSizeRGBA]; #endif @@ -107,7 +107,7 @@ void FontAtlas::reinit() FontAtlas::~FontAtlas() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA if (_fontFreeType && _rendererRecreatedListener) { auto eventDispatcher = Director::getInstance()->getEventDispatcher(); @@ -119,9 +119,9 @@ FontAtlas::~FontAtlas() _font->release(); releaseTextures(); - CC_SAFE_DELETE_ARRAY(_currentPageData); -#if defined(CC_USE_METAL) - CC_SAFE_DELETE_ARRAY(_currentPageDataRGBA); + AX_SAFE_DELETE_ARRAY(_currentPageData); +#if defined(AX_USE_METAL) + AX_SAFE_DELETE_ARRAY(_currentPageDataRGBA); #endif } @@ -234,7 +234,7 @@ bool FontAtlas::prepareLetterDefinitions(const std::u32string& utf32Text) Rect tempRect; FontLetterDefinition tempDef; - auto scaleFactor = CC_CONTENT_SCALE_FACTOR(); + auto scaleFactor = AX_CONTENT_SCALE_FACTOR(); auto pixelFormat = _pixelFormat; int startY = (int)_currentPageOrigY; @@ -309,7 +309,7 @@ bool FontAtlas::prepareLetterDefinitions(const std::u32string& utf32Text) void FontAtlas::updateTextureContent(backend::PixelFormat format, int startY) { -#if !defined(CC_USE_METAL) +#if !defined(AX_USE_METAL) auto data = _currentPageData + (CacheTextureWidth * (int)startY << _strideShift); _atlasTextures[_currentPage]->updateWithSubData(data, 0, startY, CacheTextureWidth, (int)_currentPageOrigY - startY + _currLineHeight); @@ -343,7 +343,7 @@ void FontAtlas::addNewPage() memset(_currentPageData, 0, _currentPageDataSize); -#if !defined(CC_USE_METAL) +#if !defined(AX_USE_METAL) texture->initWithData(_currentPageData, _currentPageDataSize, _pixelFormat, CacheTextureWidth, CacheTextureHeight); #else if (_strideShift) diff --git a/core/2d/CCFontAtlas.h b/core/2d/CCFontAtlas.h index eb2b6bb96e..65afc0122f 100644 --- a/core/2d/CCFontAtlas.h +++ b/core/2d/CCFontAtlas.h @@ -59,7 +59,7 @@ struct FontLetterDefinition bool rotated; }; -class CC_DLL FontAtlas : public Ref +class AX_DLL FontAtlas : public Ref { public: static const int CacheTextureWidth; @@ -147,7 +147,7 @@ protected: int _strideShift = 0; uint8_t* _currentPageData = nullptr; int _currentPageDataSize = 0; -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) // Notes: // Metal backend doesn't support PixelFormat::LA8 // Currently we use RGBA for texture data upload diff --git a/core/2d/CCFontAtlasCache.cpp b/core/2d/CCFontAtlasCache.cpp index 752c7b133b..bdbf72639d 100644 --- a/core/2d/CCFontAtlasCache.cpp +++ b/core/2d/CCFontAtlasCache.cpp @@ -270,7 +270,7 @@ void FontAtlasCache::reloadFontAtlasFNT(std::string_view fontFileName, const Rec auto it = _atlasMap.find(atlasName); if (it != _atlasMap.end()) { - CC_SAFE_RELEASE_NULL(it->second); + AX_SAFE_RELEASE_NULL(it->second); _atlasMap.erase(it); } FontFNT::reloadBMFontResource(fontFileName); @@ -297,7 +297,7 @@ void FontAtlasCache::unloadFontAtlasTTF(std::string_view fontFileName) { if (item->first.find(fontFileName) != std::string::npos) { - CC_SAFE_RELEASE_NULL(item->second); + AX_SAFE_RELEASE_NULL(item->second); item = _atlasMap.erase(item); } else diff --git a/core/2d/CCFontAtlasCache.h b/core/2d/CCFontAtlasCache.h index 3a93dbd114..ac75932201 100644 --- a/core/2d/CCFontAtlasCache.h +++ b/core/2d/CCFontAtlasCache.h @@ -38,7 +38,7 @@ class FontAtlas; class Texture2D; struct _ttfConfig; -class CC_DLL FontAtlasCache +class AX_DLL FontAtlasCache { public: static FontAtlas* getFontAtlasTTF(const _ttfConfig* config); @@ -46,7 +46,7 @@ public: static FontAtlas* getFontAtlasFNT(std::string_view fontFileName); static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, std::string_view subTextureKey); static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Rect& imageRect, bool imageRotated); - CC_DEPRECATED_ATTRIBUTE static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset); + AX_DEPRECATED_ATTRIBUTE static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset); static FontAtlas* getFontAtlasCharMap(std::string_view charMapFile, int itemWidth, @@ -68,7 +68,7 @@ public: */ static void reloadFontAtlasFNT(std::string_view fontFileName, const Rect& imageRect, bool imageRotated); - CC_DEPRECATED_ATTRIBUTE static void reloadFontAtlasFNT(std::string_view fontFileName, + AX_DEPRECATED_ATTRIBUTE static void reloadFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset = Vec2::ZERO); /** Unload all texture atlas texture create by special file name. diff --git a/core/2d/CCFontCharMap.cpp b/core/2d/CCFontCharMap.cpp index 2f56e84683..aba79dbd22 100644 --- a/core/2d/CCFontCharMap.cpp +++ b/core/2d/CCFontCharMap.cpp @@ -112,7 +112,7 @@ FontAtlas* FontCharMap::newFontAtlas() tempAtlas->setLineHeight((float)_itemHeight); - auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR(); + auto contentScaleFactor = AX_CONTENT_SCALE_FACTOR(); FontLetterDefinition tempDefinition; tempDefinition.textureID = 0; diff --git a/core/2d/CCFontFNT.cpp b/core/2d/CCFontFNT.cpp index 4d77b9b4c7..1555dabc2d 100644 --- a/core/2d/CCFontFNT.cpp +++ b/core/2d/CCFontFNT.cpp @@ -92,7 +92,7 @@ BMFontConfiguration* BMFontConfiguration::create(std::string_view FNTfile) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -121,13 +121,13 @@ BMFontConfiguration::~BMFontConfiguration() this->purgeFontDefDictionary(); this->purgeKerningDictionary(); _atlasName.clear(); - CC_SAFE_DELETE(_characterSet); + AX_SAFE_DELETE(_characterSet); } std::string BMFontConfiguration::description() const { return StringUtils::format( - "", (size_t)this, + "", (size_t)this, static_cast(_fontDefDictionary.size()), static_cast(_kerningDictionary.size()), _atlasName.c_str()); } @@ -596,7 +596,7 @@ FontFNT* FontFNT::create(std::string_view fntFilePath, const Vec2& imageOffset) } FontFNT::FontFNT(BMFontConfiguration* theContfig, const Rect& imageRect, bool imageRotated) - : _configuration(theContfig), _imageRectInPoints(CC_RECT_PIXELS_TO_POINTS(imageRect)), _imageRotated(imageRotated) + : _configuration(theContfig), _imageRectInPoints(AX_RECT_PIXELS_TO_POINTS(imageRect)), _imageRotated(imageRotated) { _configuration->retain(); } @@ -615,7 +615,7 @@ void FontFNT::purgeCachedData() if (s_configurations) { s_configurations->clear(); - CC_SAFE_DELETE(s_configurations); + AX_SAFE_DELETE(s_configurations); } } @@ -709,7 +709,7 @@ FontAtlas* FontFNT::newFontAtlas() FontLetterDefinition tempDefinition; - const auto tempRect = CC_RECT_PIXELS_TO_POINTS(fontDef.rect); + const auto tempRect = AX_RECT_PIXELS_TO_POINTS(fontDef.rect); tempDefinition.offsetX = fontDef.xOffset; tempDefinition.offsetY = fontDef.yOffset; @@ -751,7 +751,7 @@ FontAtlas* FontFNT::newFontAtlas() Texture2D* tempTexture = Director::getInstance()->getTextureCache()->addImage(_configuration->getAtlasName()); if (!tempTexture) { - CC_SAFE_RELEASE(tempAtlas); + AX_SAFE_RELEASE(tempAtlas); return nullptr; } diff --git a/core/2d/CCFontFNT.h b/core/2d/CCFontFNT.h index 0c5e854780..46bb5bd654 100644 --- a/core/2d/CCFontFNT.h +++ b/core/2d/CCFontFNT.h @@ -73,7 +73,7 @@ typedef struct _BMFontPadding /** @brief BMFontConfiguration has parsed configuration of the .fnt file @since v0.8 */ -class CC_DLL BMFontConfiguration : public Ref +class AX_DLL BMFontConfiguration : public Ref { // FIXME: Creating a public interface so that the bitmapFontArray[] is accessible public: //@public @@ -141,7 +141,7 @@ private: void purgeFontDefDictionary(); }; -class CC_DLL FontFNT : public Font +class AX_DLL FontFNT : public Font { public: @@ -149,7 +149,7 @@ public: static FontFNT* create(std::string_view fntFilePath, std::string_view subTextureKey); static FontFNT* create(std::string_view fntFilePath); - CC_DEPRECATED_ATTRIBUTE static FontFNT* create(std::string_view fntFilePath, const Vec2& imageOffset = Vec2::ZERO); + AX_DEPRECATED_ATTRIBUTE static FontFNT* create(std::string_view fntFilePath, const Vec2& imageOffset = Vec2::ZERO); /** Purges the cached data. Removes from memory the cached configurations and the atlas name dictionary. diff --git a/core/2d/CCFontFreeType.cpp b/core/2d/CCFontFreeType.cpp index d6328b08a6..4645aae952 100644 --- a/core/2d/CCFontFreeType.cpp +++ b/core/2d/CCFontFreeType.cpp @@ -164,7 +164,7 @@ FontFreeType::FontFreeType(bool distanceFieldEnabled /* = false */, float outlin { if (outline > 0.0f) { - _outlineSize = outline * CC_CONTENT_SCALE_FACTOR(); + _outlineSize = outline * AX_CONTENT_SCALE_FACTOR(); FT_Stroker_New(FontFreeType::getFTLibrary(), &_stroker); FT_Stroker_Set(_stroker, (int)(_outlineSize * 64), @@ -255,7 +255,7 @@ bool FontFreeType::loadFontFace(std::string_view fontPath, float fontSize) // set the requested font size int dpi = 72; - int fontSizePoints = (int)(64.f * fontSize * CC_CONTENT_SCALE_FACTOR()); + int fontSizePoints = (int)(64.f * fontSize * AX_CONTENT_SCALE_FACTOR()); if (FT_Set_Char_Size(face, fontSizePoints, fontSizePoints, dpi, dpi)) break; diff --git a/core/2d/CCFontFreeType.h b/core/2d/CCFontFreeType.h index b7fc133856..697a19086d 100644 --- a/core/2d/CCFontFreeType.h +++ b/core/2d/CCFontFreeType.h @@ -42,7 +42,7 @@ typedef struct FT_BBox_ FT_BBox; NS_AX_BEGIN -class CC_DLL FontFreeType : public Font +class AX_DLL FontFreeType : public Font { public: static const int DistanceMapSpread; diff --git a/core/2d/CCGrid.cpp b/core/2d/CCGrid.cpp index 0818c70f53..bd8d7cd270 100644 --- a/core/2d/CCGrid.cpp +++ b/core/2d/CCGrid.cpp @@ -84,10 +84,10 @@ bool GridBase::initWithSize(const Vec2& gridSize, Texture2D* texture, bool flipp _gridSize = gridSize; _texture = texture; - CC_SAFE_RETAIN(_texture); + AX_SAFE_RETAIN(_texture); _isTextureFlipped = flipped; -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _isTextureFlipped = !flipped; #endif @@ -104,7 +104,7 @@ bool GridBase::initWithSize(const Vec2& gridSize, Texture2D* texture, bool flipp _step.y = _gridRect.size.height / _gridSize.height; auto& pipelineDescriptor = _drawCommand.getPipelineDescriptor(); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE); _programState = new backend::ProgramState(program); pipelineDescriptor.programState = _programState; @@ -151,12 +151,12 @@ GridBase::~GridBase() { CCLOGINFO("deallocing GridBase: %p", this); - CC_SAFE_RELEASE(_renderTarget); + AX_SAFE_RELEASE(_renderTarget); // TODO: ? why 2.0 comments this line: setActive(false); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_texture); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); } // properties @@ -216,7 +216,7 @@ void GridBase::beforeDraw() renderer->setViewPort(0, 0, (unsigned int)size.width, (unsigned int)size.height); _oldRenderTarget = renderer->getRenderTarget(); - CC_SAFE_RELEASE(_renderTarget); + AX_SAFE_RELEASE(_renderTarget); _renderTarget = backend::Device::getInstance()->newRenderTarget(TargetBufferFlags::COLOR, _texture->getBackendTexture()); renderer->setRenderTarget(_renderTarget); @@ -344,11 +344,11 @@ Grid3D::Grid3D() {} Grid3D::~Grid3D() { - CC_SAFE_FREE(_texCoordinates); - CC_SAFE_FREE(_vertices); - CC_SAFE_FREE(_indices); - CC_SAFE_FREE(_originalVertices); - CC_SAFE_FREE(_vertexBuffer); + AX_SAFE_FREE(_texCoordinates); + AX_SAFE_FREE(_vertices); + AX_SAFE_FREE(_indices); + AX_SAFE_FREE(_originalVertices); + AX_SAFE_FREE(_vertexBuffer); } void Grid3D::beforeBlit() @@ -392,11 +392,11 @@ void Grid3D::calculateVertexPoints() float height = (float)_texture->getPixelsHigh(); float imageH = _texture->getContentSizeInPixels().height; - CC_SAFE_FREE(_vertices); - CC_SAFE_FREE(_originalVertices); - CC_SAFE_FREE(_texCoordinates); - CC_SAFE_FREE(_vertexBuffer); - CC_SAFE_FREE(_indices); + AX_SAFE_FREE(_vertices); + AX_SAFE_FREE(_originalVertices); + AX_SAFE_FREE(_texCoordinates); + AX_SAFE_FREE(_vertexBuffer); + AX_SAFE_FREE(_indices); size_t numOfPoints = static_cast((_gridSize.width + 1) * (_gridSize.height + 1)); @@ -552,10 +552,10 @@ void Grid3D::updateVertexAndTexCoordinate() TiledGrid3D::~TiledGrid3D() { - CC_SAFE_FREE(_texCoordinates); - CC_SAFE_FREE(_vertices); - CC_SAFE_FREE(_originalVertices); - CC_SAFE_FREE(_indices); + AX_SAFE_FREE(_texCoordinates); + AX_SAFE_FREE(_vertices); + AX_SAFE_FREE(_originalVertices); + AX_SAFE_FREE(_indices); } TiledGrid3D* TiledGrid3D::create(const Vec2& gridSize) @@ -643,11 +643,11 @@ void TiledGrid3D::calculateVertexPoints() float imageH = _texture->getContentSizeInPixels().height; int numQuads = (int)(_gridSize.width * _gridSize.height); - CC_SAFE_FREE(_vertices); - CC_SAFE_FREE(_originalVertices); - CC_SAFE_FREE(_texCoordinates); - CC_SAFE_FREE(_indices); - CC_SAFE_FREE(_vertexBuffer); + AX_SAFE_FREE(_vertices); + AX_SAFE_FREE(_originalVertices); + AX_SAFE_FREE(_texCoordinates); + AX_SAFE_FREE(_indices); + AX_SAFE_FREE(_vertexBuffer); _vertices = malloc(numQuads * 4 * sizeof(Vec3)); _originalVertices = malloc(numQuads * 4 * sizeof(Vec3)); diff --git a/core/2d/CCGrid.h b/core/2d/CCGrid.h index 07aaa769cc..efc2fc5914 100644 --- a/core/2d/CCGrid.h +++ b/core/2d/CCGrid.h @@ -53,7 +53,7 @@ class RenderTarget; /** Base class for Other grid. */ -class CC_DLL GridBase : public Ref +class AX_DLL GridBase : public Ref { public: /** @@ -174,7 +174,7 @@ protected: /** Grid3D is a 3D grid implementation. Each vertex has 3 dimensions: x,y,z */ -class CC_DLL Grid3D : public GridBase +class AX_DLL Grid3D : public GridBase { public: /** create one Grid. */ @@ -248,7 +248,7 @@ protected: TiledGrid3D is a 3D grid implementation. It differs from Grid3D in that the tiles can be separated from the grid. */ -class CC_DLL TiledGrid3D : public GridBase +class AX_DLL TiledGrid3D : public GridBase { public: /** Create one Grid. */ diff --git a/core/2d/CCLabel.cpp b/core/2d/CCLabel.cpp index 07417f0b09..f7d36f2387 100644 --- a/core/2d/CCLabel.cpp +++ b/core/2d/CCLabel.cpp @@ -95,7 +95,7 @@ public: letter->autorelease(); return letter; } - CC_SAFE_DELETE(letter); + AX_SAFE_DELETE(letter); return nullptr; } @@ -206,9 +206,9 @@ Label::BatchCommand::BatchCommand() Label::BatchCommand::~BatchCommand() { - CC_SAFE_RELEASE(textCommand.getPipelineDescriptor().programState); - CC_SAFE_RELEASE(shadowCommand.getPipelineDescriptor().programState); - CC_SAFE_RELEASE(outLineCommand.getPipelineDescriptor().programState); + AX_SAFE_RELEASE(textCommand.getPipelineDescriptor().programState); + AX_SAFE_RELEASE(shadowCommand.getPipelineDescriptor().programState); + AX_SAFE_RELEASE(outLineCommand.getPipelineDescriptor().programState); } void Label::BatchCommand::setProgramState(backend::ProgramState* programState) @@ -216,15 +216,15 @@ void Label::BatchCommand::setProgramState(backend::ProgramState* programState) assert(programState); auto& programStateText = textCommand.getPipelineDescriptor().programState; - CC_SAFE_RELEASE(programStateText); + AX_SAFE_RELEASE(programStateText); programStateText = programState->clone(); auto& programStateShadow = shadowCommand.getPipelineDescriptor().programState; - CC_SAFE_RELEASE(programStateShadow); + AX_SAFE_RELEASE(programStateShadow); programStateShadow = programState->clone(); auto& programStateOutline = outLineCommand.getPipelineDescriptor().programState; - CC_SAFE_RELEASE(programStateOutline); + AX_SAFE_RELEASE(programStateOutline); programStateOutline = programState->clone(); } @@ -274,7 +274,7 @@ Label* Label::createWithTTF(std::string_view text, return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -291,7 +291,7 @@ Label* Label::createWithTTF(const TTFConfig& ttfConfig, return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -508,7 +508,7 @@ Label::Label(TextHAlignment hAlignment /* = TextHAlignment::LEFT */, _hAlignment = hAlignment; _vAlignment = vAlignment; -#if CC_LABEL_DEBUG_DRAW +#if AX_LABEL_DEBUG_DRAW _debugDrawNode = DrawNode::create(); addChild(_debugDrawNode); #endif @@ -557,7 +557,7 @@ Label::~Label() if (_fontAtlas) { Node::removeAllChildrenWithCleanup(true); - CC_SAFE_RELEASE_NULL(_reusedLetter); + AX_SAFE_RELEASE_NULL(_reusedLetter); _batchNodes.clear(); FontAtlasCache::releaseFontAtlas(_fontAtlas); } @@ -565,16 +565,16 @@ Label::~Label() _eventDispatcher->removeEventListener(_purgeTextureListener); _eventDispatcher->removeEventListener(_resetTextureListener); - CC_SAFE_RELEASE_NULL(_textSprite); - CC_SAFE_RELEASE_NULL(_shadowNode); + AX_SAFE_RELEASE_NULL(_textSprite); + AX_SAFE_RELEASE_NULL(_shadowNode); } void Label::reset() { - CC_SAFE_RELEASE_NULL(_textSprite); - CC_SAFE_RELEASE_NULL(_shadowNode); + AX_SAFE_RELEASE_NULL(_textSprite); + AX_SAFE_RELEASE_NULL(_shadowNode); Node::removeAllChildrenWithCleanup(true); - CC_SAFE_RELEASE_NULL(_reusedLetter); + AX_SAFE_RELEASE_NULL(_reusedLetter); _letters.clear(); _batchNodes.clear(); _batchCommands.clear(); @@ -604,7 +604,7 @@ void Label::reset() _systemFontDirty = false; _systemFont = "Helvetica"; - _systemFontSize = CC_DEFAULT_FONT_LABEL_SIZE; + _systemFontSize = AX_DEFAULT_FONT_LABEL_SIZE; if (_horizontalKernings) { @@ -803,7 +803,7 @@ void Label::setFontAtlas(FontAtlas* atlas, bool distanceFieldEnabled /* = false if (atlas == _fontAtlas) return; - CC_SAFE_RETAIN(atlas); + AX_SAFE_RETAIN(atlas); if (_fontAtlas) { _batchNodes.clear(); @@ -858,7 +858,7 @@ bool Label::setBMFontFilePath(std::string_view bmfontFilePath, float fontSize) if (bmFont) { float originalFontSize = bmFont->getOriginalFontSize(); - _bmFontSize = originalFontSize / CC_CONTENT_SCALE_FACTOR(); + _bmFontSize = originalFontSize / AX_CONTENT_SCALE_FACTOR(); } } @@ -892,7 +892,7 @@ bool Label::setBMFontFilePath(std::string_view bmfontFilePath, const Rect& image if (bmFont) { float originalFontSize = bmFont->getOriginalFontSize(); - _bmFontSize = originalFontSize / CC_CONTENT_SCALE_FACTOR(); + _bmFontSize = originalFontSize / AX_CONTENT_SCALE_FACTOR(); } } @@ -928,7 +928,7 @@ bool Label::setBMFontFilePath(std::string_view bmfontFilePath, std::string_view if (bmFont) { float originalFontSize = bmFont->getOriginalFontSize(); - _bmFontSize = originalFontSize / CC_CONTENT_SCALE_FACTOR(); + _bmFontSize = originalFontSize / AX_CONTENT_SCALE_FACTOR(); } } @@ -1157,7 +1157,7 @@ bool Label::alignText() if (fontSize > 0 && isVerticalClamp()) { - this->shrinkLabelToContentSize(CC_CALLBACK_0(Label::isVerticalClamp, this)); + this->shrinkLabelToContentSize(AX_CALLBACK_0(Label::isVerticalClamp, this)); } } @@ -1166,7 +1166,7 @@ bool Label::alignText() ret = false; if (_overflow == Overflow::SHRINK) { - this->shrinkLabelToContentSize(CC_CALLBACK_0(Label::isHorizontalClamp, this)); + this->shrinkLabelToContentSize(AX_CALLBACK_0(Label::isHorizontalClamp, this)); } break; } @@ -1543,7 +1543,7 @@ void Label::disableEffect(LabelEffect effect) if (_shadowEnabled) { _shadowEnabled = false; - CC_SAFE_RELEASE_NULL(_shadowNode); + AX_SAFE_RELEASE_NULL(_shadowNode); updateShaderProgram(); } break; @@ -1680,7 +1680,7 @@ void Label::updateContent() { _batchNodes.clear(); _batchCommands.clear(); - CC_SAFE_RELEASE_NULL(_reusedLetter); + AX_SAFE_RELEASE_NULL(_reusedLetter); FontAtlasCache::releaseFontAtlas(_fontAtlas); _fontAtlas = nullptr; } @@ -1688,8 +1688,8 @@ void Label::updateContent() _systemFontDirty = false; } - CC_SAFE_RELEASE_NULL(_textSprite); - CC_SAFE_RELEASE_NULL(_shadowNode); + AX_SAFE_RELEASE_NULL(_textSprite); + AX_SAFE_RELEASE_NULL(_shadowNode); bool updateFinished = true; if (_fontAtlas) @@ -1760,7 +1760,7 @@ void Label::updateContent() _contentDirty = false; } -#if CC_LABEL_DEBUG_DRAW +#if AX_LABEL_DEBUG_DRAW _debugDrawNode->clear(); Vec2 vertices[4] = {Vec2::ZERO, Vec2(_contentSize.width, 0.0f), Vec2(_contentSize.width, _contentSize.height), Vec2(0.0f, _contentSize.height)}; @@ -1920,7 +1920,7 @@ void Label::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) } // Don't do calculate the culling if the transform was not updated bool transformUpdated = flags & FLAGS_TRANSFORM_DIRTY; -#if CC_USE_CULLING +#if AX_USE_CULLING auto visitingCamera = Camera::getVisitingCamera(); auto defaultCamera = Camera::getDefaultCamera(); if (visitingCamera == defaultCamera) @@ -2502,7 +2502,7 @@ FontDefinition Label::_getFontDefinition() const systemFontDef._stroke._strokeEnabled = false; } -#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) && (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) if (systemFontDef._stroke._strokeEnabled) { CCLOGERROR("Stroke Currently only supported on iOS and Android!"); @@ -2530,7 +2530,7 @@ void Label::setGlobalZOrder(float globalZOrder) _underlineNode->setGlobalZOrder(globalZOrder); } -#if CC_LABEL_DEBUG_DRAW +#if AX_LABEL_DEBUG_DRAW _debugDrawNode->setGlobalZOrder(globalZOrder); #endif } diff --git a/core/2d/CCLabel.h b/core/2d/CCLabel.h index 26ff70520c..48d08e0673 100644 --- a/core/2d/CCLabel.h +++ b/core/2d/CCLabel.h @@ -41,7 +41,7 @@ NS_AX_BEGIN * @{ */ -#define CC_DEFAULT_FONT_LABEL_SIZE 12 +#define AX_DEFAULT_FONT_LABEL_SIZE 12 /** * @struct TTFConfig @@ -64,7 +64,7 @@ typedef struct _ttfConfig bool strikethrough; _ttfConfig(std::string_view filePath = {}, - float size = CC_DEFAULT_FONT_LABEL_SIZE, + float size = AX_DEFAULT_FONT_LABEL_SIZE, const GlyphCollection& glyphCollection = GlyphCollection::DYNAMIC, const char* customGlyphCollection = nullptr, /* nullable */ bool useDistanceField = false, @@ -113,7 +113,7 @@ class TextureAtlas; * - http://www.angelcode.com/products/bmfont/ (Free, Windows only) * @js NA */ -class CC_DLL Label : public Node, public LabelProtocol, public BlendProtocol +class AX_DLL Label : public Node, public LabelProtocol, public BlendProtocol { public: enum class Overflow @@ -274,7 +274,7 @@ public: * @return An automatically released Label object. * @see setBMFontFilePath setMaxLineWidth */ - CC_DEPRECATED_ATTRIBUTE static Label* createWithBMFont(std::string_view bmfontPath, + AX_DEPRECATED_ATTRIBUTE static Label* createWithBMFont(std::string_view bmfontPath, std::string_view text, const TextHAlignment& hAlignment, int maxLineWidth, @@ -344,7 +344,7 @@ public: virtual bool setBMFontFilePath(std::string_view bmfontFilePath, std::string_view subTextureKey, float fontSize = 0); /** Sets a new bitmap font to Label */ - CC_DEPRECATED_ATTRIBUTE virtual bool setBMFontFilePath(std::string_view bmfontFilePath, + AX_DEPRECATED_ATTRIBUTE virtual bool setBMFontFilePath(std::string_view bmfontFilePath, const Vec2& imageOffset, float fontSize = 0); @@ -899,7 +899,7 @@ protected: EventListenerCustom* _purgeTextureListener; EventListenerCustom* _resetTextureListener; -#if CC_LABEL_DEBUG_DRAW +#if AX_LABEL_DEBUG_DRAW DrawNode* _debugDrawNode; #endif @@ -920,7 +920,7 @@ protected: backend::UniformLocation _effectTypeLocation; private: - CC_DISALLOW_COPY_AND_ASSIGN(Label); + AX_DISALLOW_COPY_AND_ASSIGN(Label); }; // end group diff --git a/core/2d/CCLabelAtlas.cpp b/core/2d/CCLabelAtlas.cpp index 7cf365f084..977ca04a0c 100644 --- a/core/2d/CCLabelAtlas.cpp +++ b/core/2d/CCLabelAtlas.cpp @@ -32,7 +32,7 @@ THE SOFTWARE. #include "base/ccUTF8.h" #include "renderer/CCTextureCache.h" -#if CC_LABELATLAS_DEBUG_DRAW +#if AX_LABELATLAS_DEBUG_DRAW # include "renderer/CCRenderer.h" #endif @@ -52,7 +52,7 @@ LabelAtlas* LabelAtlas::create(std::string_view string, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -91,7 +91,7 @@ LabelAtlas* LabelAtlas::create(std::string_view string, std::string_view fntFile } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -111,7 +111,7 @@ LabelAtlas* LabelAtlas::create(std::string_view string, } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -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() / CC_CONTENT_SCALE_FACTOR()); - unsigned int height = static_cast(dict["itemHeight"].asInt() / CC_CONTENT_SCALE_FACTOR()); + unsigned int width = static_cast(dict["itemWidth"].asInt() / AX_CONTENT_SCALE_FACTOR()); + unsigned int height = static_cast(dict["itemHeight"].asInt() / AX_CONTENT_SCALE_FACTOR()); unsigned int startChar = dict["firstChar"].asInt(); this->initWithString(theString, textureFilename, width, height, startChar); @@ -152,8 +152,8 @@ void LabelAtlas::updateAtlasValues() Texture2D* texture = _textureAtlas->getTexture(); float textureWide = (float)texture->getPixelsWide(); float textureHigh = (float)texture->getPixelsHigh(); - float itemWidthInPixels = _itemWidth * CC_CONTENT_SCALE_FACTOR(); - float itemHeightInPixels = _itemHeight * CC_CONTENT_SCALE_FACTOR(); + float itemWidthInPixels = _itemWidth * AX_CONTENT_SCALE_FACTOR(); + float itemHeightInPixels = _itemHeight * AX_CONTENT_SCALE_FACTOR(); if (_ignoreContentScaleFactor) { itemWidthInPixels = static_cast(_itemWidth); @@ -169,7 +169,7 @@ void LabelAtlas::updateAtlasValues() float row = (float)(a % _itemsPerRow); float col = (float)(a / _itemsPerRow); -#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#if AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL // Issue #938. Don't use texStepX & texStepY float left = (2 * row * itemWidthInPixels + 1) / (2 * textureWide); float right = left + (itemWidthInPixels * 2 - 2) / (2 * textureWide); @@ -180,7 +180,7 @@ void LabelAtlas::updateAtlasValues() float right = left + itemWidthInPixels / textureWide; float top = col * itemHeightInPixels / textureHigh; float bottom = top + itemHeightInPixels / textureHigh; -#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#endif // ! AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL quads[i].tl.texCoords.u = left; quads[i].tl.texCoords.v = top; @@ -269,7 +269,7 @@ void LabelAtlas::updateColor() } // CCLabelAtlas - draw -#if CC_LABELATLAS_DEBUG_DRAW +#if AX_LABELATLAS_DEBUG_DRAW void LabelAtlas::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) { AtlasNode::draw(renderer, transform, _transformUpdated); diff --git a/core/2d/CCLabelAtlas.h b/core/2d/CCLabelAtlas.h index 15d7e0284a..68343f0b89 100644 --- a/core/2d/CCLabelAtlas.h +++ b/core/2d/CCLabelAtlas.h @@ -29,7 +29,7 @@ THE SOFTWARE. #define __CCLABEL_ATLAS_H__ #include "2d/CCAtlasNode.h" -#if CC_LABELATLAS_DEBUG_DRAW +#if AX_LABELATLAS_DEBUG_DRAW # include "renderer/CCCustomCommand.h" # include "2d/CCDrawNode.h" #endif @@ -53,7 +53,7 @@ NS_AX_BEGIN * * A more flexible class is LabelBMFont. It supports variable width characters and it also has a nice editor. */ -class CC_DLL LabelAtlas : public AtlasNode, public LabelProtocol +class AX_DLL LabelAtlas : public AtlasNode, public LabelProtocol { public: /** Creates the LabelAtlas with a string, a char map file(the atlas), the width and height of each element and the @@ -107,13 +107,13 @@ public: */ virtual std::string getDescription() const override; -#if CC_LABELATLAS_DEBUG_DRAW +#if AX_LABELATLAS_DEBUG_DRAW virtual void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override; #endif LabelAtlas() { -#if CC_LABELATLAS_DEBUG_DRAW +#if AX_LABELATLAS_DEBUG_DRAW _debugDrawNode = DrawNode::create(); addChild(_debugDrawNode); #endif @@ -124,7 +124,7 @@ public: protected: virtual void updateColor() override; -#if CC_LABELATLAS_DEBUG_DRAW +#if AX_LABELATLAS_DEBUG_DRAW DrawNode* _debugDrawNode; #endif diff --git a/core/2d/CCLabelTextFormatter.cpp b/core/2d/CCLabelTextFormatter.cpp index 559303b610..25ad9c77d7 100644 --- a/core/2d/CCLabelTextFormatter.cpp +++ b/core/2d/CCLabelTextFormatter.cpp @@ -83,7 +83,7 @@ int Label::getFirstWordLen(const std::u32string& utf32Text, int startIndex, int int len = 0; auto nextLetterX = 0; FontLetterDefinition letterDef; - auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR(); + auto contentScaleFactor = AX_CONTENT_SCALE_FACTOR(); for (int index = startIndex; index < textLen; ++index) { @@ -141,7 +141,7 @@ void Label::updateBMFontScale() { FontFNT* bmFont = (FontFNT*)font; auto originalFontSize = bmFont->getOriginalFontSize(); - _bmfontScale = _bmFontSize * CC_CONTENT_SCALE_FACTOR() / originalFontSize; + _bmfontScale = _bmFontSize * AX_CONTENT_SCALE_FACTOR() / originalFontSize; } else { @@ -159,7 +159,7 @@ bool Label::multilineTextWrap(const std::functionautorelease(); return layer; } - CC_SAFE_DELETE(layer); + AX_SAFE_DELETE(layer); return nullptr; } @@ -97,7 +97,7 @@ LayerColor* LayerColor::create(const Color4B& color) layer->autorelease(); return layer; } - CC_SAFE_DELETE(layer); + AX_SAFE_DELETE(layer); return nullptr; } @@ -162,7 +162,7 @@ LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end) layer->autorelease(); return layer; } - CC_SAFE_DELETE(layer); + AX_SAFE_DELETE(layer); return nullptr; } @@ -174,7 +174,7 @@ LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end, c layer->autorelease(); return layer; } - CC_SAFE_DELETE(layer); + AX_SAFE_DELETE(layer); return nullptr; } @@ -187,7 +187,7 @@ LayerGradient* LayerGradient::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -406,7 +406,7 @@ LayerRadialGradient::LayerRadialGradient() LayerRadialGradient::~LayerRadialGradient() { - CC_SAFE_RELEASE_NULL(_customCommand.getPipelineDescriptor().programState); + AX_SAFE_RELEASE_NULL(_customCommand.getPipelineDescriptor().programState); } bool LayerRadialGradient::initWithColor(const axis::Color4B& startColor, @@ -603,7 +603,7 @@ LayerMultiplex* LayerMultiplex::create(Node* layer, ...) return ret; } va_end(args); - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -621,7 +621,7 @@ LayerMultiplex* LayerMultiplex::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -635,20 +635,20 @@ LayerMultiplex* LayerMultiplex::createWithArray(const Vector& arrayOfLaye } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } void LayerMultiplex::addLayer(Node* layer) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, layer); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.pushBack(layer); } @@ -667,24 +667,24 @@ bool LayerMultiplex::initWithLayers(Node* layer, va_list params) if (Node::initLayer()) { _layers.reserve(5); -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, layer); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.pushBack(layer); Node* l = va_arg(params, Node*); while (l) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS if (sEngine) { sEngine->retainScriptObject(this, l); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.pushBack(l); l = va_arg(params, Node*); } @@ -701,7 +701,7 @@ bool LayerMultiplex::initWithArray(const Vector& arrayOfLayers) { if (Node::initLayer()) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -713,7 +713,7 @@ bool LayerMultiplex::initWithArray(const Vector& arrayOfLayers) } } } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.reserve(arrayOfLayers.size()); _layers.pushBack(arrayOfLayers); @@ -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 CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, _layers.at(_enabledLayer)); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _layers.replace(_enabledLayer, nullptr); diff --git a/core/2d/CCLayer.h b/core/2d/CCLayer.h index 4575b72e8e..41b5a8a4dc 100644 --- a/core/2d/CCLayer.h +++ b/core/2d/CCLayer.h @@ -41,7 +41,7 @@ NS_AX_BEGIN */ /* !!!HACK, the memory model of 'Layer' is identical to 'Node' */ -class CC_DLL Layer : public Node +class AX_DLL Layer : public Node { public: static Layer* create(); @@ -56,7 +56,7 @@ All features from Layer are valid, plus the following new features: - opacity - RGB colors */ -class CC_DLL LayerColor : public Sprite +class AX_DLL LayerColor : public Sprite { public: @@ -103,7 +103,7 @@ public: bool initWithColor(const Color4B& color); private: - CC_DISALLOW_COPY_AND_ASSIGN(LayerColor); + AX_DISALLOW_COPY_AND_ASSIGN(LayerColor); }; @@ -130,7 +130,7 @@ If ' compressedInterpolation' is enabled (default mode) you will see both the st @since v0.99.5 */ -class CC_DLL LayerGradient : public LayerColor +class AX_DLL LayerGradient : public LayerColor { public: /** Creates a fullscreen black layer. @@ -257,7 +257,7 @@ protected: * @brief LayerRadialGradient is a subclass of Layer that draws radial gradients across the background. @since v3.16 */ -class CC_DLL LayerRadialGradient : public Node, BlendProtocol +class AX_DLL LayerRadialGradient : public Node, BlendProtocol { public: /** Create a LayerRadialGradient @@ -349,7 +349,7 @@ Features: - It supports one or more children - Only one children will be active a time */ -class CC_DLL LayerMultiplex : public Node +class AX_DLL LayerMultiplex : public Node { public: /** Creates and initializes a LayerMultiplex object. @@ -439,7 +439,7 @@ protected: Vector _layers; private: - CC_DISALLOW_COPY_AND_ASSIGN(LayerMultiplex); + AX_DISALLOW_COPY_AND_ASSIGN(LayerMultiplex); }; // end of _2d group diff --git a/core/2d/CCLight.cpp b/core/2d/CCLight.cpp index d5e6ef8ba7..5f25441e62 100644 --- a/core/2d/CCLight.cpp +++ b/core/2d/CCLight.cpp @@ -29,7 +29,7 @@ NS_AX_BEGIN void BaseLight::setIntensity(float intensity) { - CC_ASSERT(intensity >= 0); + AX_ASSERT(intensity >= 0); _intensity = intensity; } @@ -61,8 +61,8 @@ void BaseLight::onExit() void BaseLight::setRotationFromDirection(const Vec3& direction) { float projLen = sqrt(direction.x * direction.x + direction.z * direction.z); - float rotY = CC_RADIANS_TO_DEGREES(atan2f(-direction.x, -direction.z)); - float rotX = -CC_RADIANS_TO_DEGREES(atan2f(-direction.y, projLen)); + float rotY = AX_RADIANS_TO_DEGREES(atan2f(-direction.x, -direction.z)); + float rotX = -AX_RADIANS_TO_DEGREES(atan2f(-direction.y, projLen)); setRotation3D(Vec3(rotX, rotY, 0.0f)); } diff --git a/core/2d/CCLight.h b/core/2d/CCLight.h index 67ca1e1a4e..631dff828a 100644 --- a/core/2d/CCLight.h +++ b/core/2d/CCLight.h @@ -61,7 +61,7 @@ enum class LightFlag /** @js NA */ -class CC_DLL BaseLight : public Node +class AX_DLL BaseLight : public Node { public: /** @@ -103,7 +103,7 @@ protected: /** @js NA */ -class CC_DLL DirectionLight : public BaseLight +class AX_DLL DirectionLight : public BaseLight { public: /** @@ -142,7 +142,7 @@ public: /** @js NA */ -class CC_DLL PointLight : public BaseLight +class AX_DLL PointLight : public BaseLight { public: /** @@ -172,7 +172,7 @@ protected: /** @js NA */ -class CC_DLL SpotLight : public BaseLight +class AX_DLL SpotLight : public BaseLight { public: /** @@ -270,7 +270,7 @@ protected: /** @js NA */ -class CC_DLL AmbientLight : public BaseLight +class AX_DLL AmbientLight : public BaseLight { public: /** diff --git a/core/2d/CCMenu.cpp b/core/2d/CCMenu.cpp index 85d5a7c709..5e53c882eb 100644 --- a/core/2d/CCMenu.cpp +++ b/core/2d/CCMenu.cpp @@ -79,7 +79,7 @@ Menu* Menu::createWithArray(const Vector& arrayOfItems) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -144,10 +144,10 @@ bool Menu::initWithArray(const Vector& arrayOfItems) auto touchListener = EventListenerTouchOneByOne::create(); touchListener->setSwallowTouches(true); - touchListener->onTouchBegan = CC_CALLBACK_2(Menu::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(Menu::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(Menu::onTouchEnded, this); - touchListener->onTouchCancelled = CC_CALLBACK_2(Menu::onTouchCancelled, this); + touchListener->onTouchBegan = AX_CALLBACK_2(Menu::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(Menu::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(Menu::onTouchEnded, this); + touchListener->onTouchCancelled = AX_CALLBACK_2(Menu::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); diff --git a/core/2d/CCMenu.h b/core/2d/CCMenu.h index a288360a4d..062864a39c 100644 --- a/core/2d/CCMenu.h +++ b/core/2d/CCMenu.h @@ -45,7 +45,7 @@ class Touch; * - You can add MenuItem objects in runtime using addChild. * - But the only accepted children are MenuItem objects. */ -class CC_DLL Menu : public Node +class AX_DLL Menu : public Node { public: /** @@ -63,7 +63,7 @@ public: static Menu* create(); /** Creates a Menu with MenuItem objects. */ - static Menu* create(MenuItem* item, ...) CC_REQUIRES_NULL_TERMINATION; + static Menu* create(MenuItem* item, ...) AX_REQUIRES_NULL_TERMINATION; /** * Creates a Menu with a Array of MenuItem objects. @@ -101,7 +101,7 @@ public: void alignItemsHorizontallyWithPadding(float padding); /** Align items in rows of columns. */ - void alignItemsInColumns(int columns, ...) CC_REQUIRES_NULL_TERMINATION; + void alignItemsInColumns(int columns, ...) AX_REQUIRES_NULL_TERMINATION; /** Align items in rows of columns. */ void alignItemsInColumns(int columns, va_list args); @@ -112,7 +112,7 @@ public: void alignItemsInColumnsWithArray(const ValueVector& rows); /** Align items in columns of rows. */ - void alignItemsInRows(int rows, ...) CC_REQUIRES_NULL_TERMINATION; + void alignItemsInRows(int rows, ...) AX_REQUIRES_NULL_TERMINATION; /** Align items in columns of rows. */ void alignItemsInRows(int rows, va_list args); @@ -179,7 +179,7 @@ protected: const Camera* _selectedWithCamera; private: - CC_DISALLOW_COPY_AND_ASSIGN(Menu); + AX_DISALLOW_COPY_AND_ASSIGN(Menu); }; // end of _2d group diff --git a/core/2d/CCMenuItem.cpp b/core/2d/CCMenuItem.cpp index 6bfab4ce64..f94e27e3c2 100644 --- a/core/2d/CCMenuItem.cpp +++ b/core/2d/CCMenuItem.cpp @@ -88,7 +88,7 @@ void MenuItem::activate() { _callback(this); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING BasicScriptData data(this); ScriptEvent scriptEvent(kMenuClickedEvent, &data); ScriptEngineManager::sendEventToLua(scriptEvent); @@ -591,7 +591,7 @@ MenuItemImage* MenuItemImage::create() ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -623,7 +623,7 @@ MenuItemImage* MenuItemImage::create(std::string_view normalImage, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -637,7 +637,7 @@ MenuItemImage* MenuItemImage::create(std::string_view normalImage, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -694,7 +694,7 @@ MenuItemToggle* MenuItemToggle::createWithCallback(const ccMenuCallback& callbac MenuItemToggle* ret = new MenuItemToggle(); ret->MenuItem::initWithCallback(callback); ret->autorelease(); -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -706,7 +706,7 @@ MenuItemToggle* MenuItemToggle::createWithCallback(const ccMenuCallback& callbac } } } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS ret->_subItems = menuItems; ret->_selectedIndex = UINT_MAX; ret->setSelectedIndex(0); @@ -739,19 +739,19 @@ bool MenuItemToggle::initWithCallback(const ccMenuCallback& callback, MenuItem* int z = 0; MenuItem* i = item; -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS while (i) { z++; -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS if (sEngine) { sEngine->retainScriptObject(this, i); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _subItems.pushBack(i); i = va_arg(args, MenuItem*); } @@ -787,13 +787,13 @@ bool MenuItemToggle::initWithItem(MenuItem* item) void MenuItemToggle::addSubItem(MenuItem* item) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, item); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _subItems.pushBack(item); } @@ -801,7 +801,7 @@ void MenuItemToggle::cleanup() { for (const auto& item : _subItems) { -#if defined(CC_NATIVE_CONTROL_SCRIPT) && !CC_NATIVE_CONTROL_SCRIPT +#if defined(AX_NATIVE_CONTROL_SCRIPT) && !AX_NATIVE_CONTROL_SCRIPT ScriptEngineManager::getInstance()->getScriptEngine()->releaseScriptObject(this, item); #endif item->cleanup(); diff --git a/core/2d/CCMenuItem.h b/core/2d/CCMenuItem.h index a75648a545..4f0aa761c0 100644 --- a/core/2d/CCMenuItem.h +++ b/core/2d/CCMenuItem.h @@ -55,7 +55,7 @@ class SpriteFrame; * * Subclass MenuItem (or any subclass) to create your custom MenuItem objects. */ -class CC_DLL MenuItem : public Node +class AX_DLL MenuItem : public Node { public: /** Creates a MenuItem with no target/selector. */ @@ -113,7 +113,7 @@ protected: ccMenuCallback _callback; private: - CC_DISALLOW_COPY_AND_ASSIGN(MenuItem); + AX_DISALLOW_COPY_AND_ASSIGN(MenuItem); }; /** @brief An abstract class for "label" MenuItemLabel items. @@ -124,7 +124,7 @@ private: - LabelTTF - Label */ -class CC_DLL MenuItemLabel : public MenuItem +class AX_DLL MenuItemLabel : public MenuItem { public: /** Creates a MenuItemLabel with a Label and a callback. */ @@ -180,13 +180,13 @@ protected: Node* _label; private: - CC_DISALLOW_COPY_AND_ASSIGN(MenuItemLabel); + AX_DISALLOW_COPY_AND_ASSIGN(MenuItemLabel); }; /** @brief A MenuItemAtlasFont. Helper class that creates a MenuItemLabel class with a LabelAtlas. */ -class CC_DLL MenuItemAtlasFont : public MenuItemLabel +class AX_DLL MenuItemAtlasFont : public MenuItemLabel { public: /** Creates a menu item from a string and atlas with a target/selector. */ @@ -222,13 +222,13 @@ public: const ccMenuCallback& callback); private: - CC_DISALLOW_COPY_AND_ASSIGN(MenuItemAtlasFont); + AX_DISALLOW_COPY_AND_ASSIGN(MenuItemAtlasFont); }; /** @brief A MenuItemFont. Helper class that creates a MenuItemLabel class with a Label. */ -class CC_DLL MenuItemFont : public MenuItemLabel +class AX_DLL MenuItemFont : public MenuItemLabel { public: /** Creates a menu item from a string without target/selector. To be used with MenuItemToggle. */ @@ -292,7 +292,7 @@ protected: std::string _fontName; private: - CC_DISALLOW_COPY_AND_ASSIGN(MenuItemFont); + AX_DISALLOW_COPY_AND_ASSIGN(MenuItemFont); }; /** @brief MenuItemSprite accepts Node objects as items. @@ -303,7 +303,7 @@ private: @since v0.8.0 */ -class CC_DLL MenuItemSprite : public MenuItem +class AX_DLL MenuItemSprite : public MenuItem { public: /** Creates a menu item with a normal, selected and disabled image.*/ @@ -365,7 +365,7 @@ protected: Node* _disabledImage; private: - CC_DISALLOW_COPY_AND_ASSIGN(MenuItemSprite); + AX_DISALLOW_COPY_AND_ASSIGN(MenuItemSprite); }; /** @brief MenuItemImage accepts images as items. @@ -376,7 +376,7 @@ private: For best results try that all images are of the same size. */ -class CC_DLL MenuItemImage : public MenuItemSprite +class AX_DLL MenuItemImage : public MenuItemSprite { public: /** Creates an MenuItemImage. */ @@ -423,14 +423,14 @@ public: const ccMenuCallback& callback); private: - CC_DISALLOW_COPY_AND_ASSIGN(MenuItemImage); + AX_DISALLOW_COPY_AND_ASSIGN(MenuItemImage); }; /** @brief A MenuItemToggle. A simple container class that "toggles" it's inner items. The inner items can be any MenuItem. */ -class CC_DLL MenuItemToggle : public MenuItem +class AX_DLL MenuItemToggle : public MenuItem { public: /** @@ -440,7 +440,7 @@ public: /** Creates a menu item from a list of items with a callable object. */ static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, MenuItem* item, - ...) CC_REQUIRES_NULL_TERMINATION; + ...) AX_REQUIRES_NULL_TERMINATION; /** Creates a menu item with no target/selector and no items. */ static MenuItemToggle* create(); @@ -501,7 +501,7 @@ protected: Vector _subItems; private: - CC_DISALLOW_COPY_AND_ASSIGN(MenuItemToggle); + AX_DISALLOW_COPY_AND_ASSIGN(MenuItemToggle); }; // end of 2d group diff --git a/core/2d/CCMotionStreak.cpp b/core/2d/CCMotionStreak.cpp index 053f211086..8f5b0b4b1b 100644 --- a/core/2d/CCMotionStreak.cpp +++ b/core/2d/CCMotionStreak.cpp @@ -44,12 +44,12 @@ MotionStreak::MotionStreak() MotionStreak::~MotionStreak() { - CC_SAFE_RELEASE(_texture); - CC_SAFE_FREE(_pointState); - CC_SAFE_FREE(_pointVertexes); - CC_SAFE_FREE(_vertices); - CC_SAFE_FREE(_colorPointer); - CC_SAFE_FREE(_texCoords); + AX_SAFE_RELEASE(_texture); + AX_SAFE_FREE(_pointState); + AX_SAFE_FREE(_pointVertexes); + AX_SAFE_FREE(_vertices); + AX_SAFE_FREE(_colorPointer); + AX_SAFE_FREE(_texCoords); } MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const Color3B& color, std::string_view path) @@ -61,7 +61,7 @@ MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -74,7 +74,7 @@ MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -215,8 +215,8 @@ void MotionStreak::setTexture(Texture2D* texture) { if (_texture != texture) { - CC_SAFE_RETAIN(texture); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RETAIN(texture); + AX_SAFE_RELEASE(_texture); _texture = texture; setProgramStateWithRegistry(backend::ProgramType::POSITION_TEXTURE_COLOR, _texture); diff --git a/core/2d/CCMotionStreak.h b/core/2d/CCMotionStreak.h index 1340fec9b5..a9c3f01ab0 100644 --- a/core/2d/CCMotionStreak.h +++ b/core/2d/CCMotionStreak.h @@ -42,7 +42,7 @@ class Texture2D; /** @class MotionStreak. * @brief Creates a trailing path. */ -class CC_DLL MotionStreak : public Node, public TextureProtocol +class AX_DLL MotionStreak : public Node, public TextureProtocol { public: /** Creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture @@ -200,7 +200,7 @@ protected: backend::UniformLocation _textureLocation; private: - CC_DISALLOW_COPY_AND_ASSIGN(MotionStreak); + AX_DISALLOW_COPY_AND_ASSIGN(MotionStreak); }; // end of _2d group diff --git a/core/2d/CCNode.cpp b/core/2d/CCNode.cpp index cf5bb7ca20..e93b167d5a 100644 --- a/core/2d/CCNode.cpp +++ b/core/2d/CCNode.cpp @@ -47,7 +47,7 @@ THE SOFTWARE. #include "math/TransformUtils.h" #include "renderer/backend/ProgramStateRegistry.h" -#if CC_NODE_RENDER_SUBPIXEL +#if AX_NODE_RENDER_SUBPIXEL # define RENDER_IN_SUBPIXEL #else # define RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__)) @@ -56,7 +56,7 @@ THE SOFTWARE. /* * 4.5x faster than std::hash in release mode */ -#define CC_HASH_NODE_NAME(name) (!name.empty() ? XXH3_64bits(name.data(), name.length()) : 0) +#define AX_HASH_NODE_NAME(name) (!name.empty() ? XXH3_64bits(name.data(), name.length()) : 0) NS_AX_BEGIN @@ -106,7 +106,7 @@ Node::Node() , _ignoreAnchorPointForPosition(false) , _reorderChildDirty(false) , _isTransitionFinished(false) -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING , _scriptHandler(0) , _updateScriptHandler(0) #endif @@ -123,7 +123,7 @@ Node::Node() , _onExitCallback(nullptr) , _onEnterTransitionDidFinishCallback(nullptr) , _onExitTransitionDidStartCallback(nullptr) -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS , _physicsBody(nullptr) #endif { @@ -148,7 +148,7 @@ Node* Node::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -157,9 +157,9 @@ Node::~Node() { CCLOGINFO("deallocing Node: %p - tag: %i", this, _tag); - CC_SAFE_DELETE(_childrenIndexer); + AX_SAFE_DELETE(_childrenIndexer); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING if (_updateScriptHandler) { ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_updateScriptHandler); @@ -168,8 +168,8 @@ Node::~Node() // User object has to be released before others, since userObject may have a weak reference of this node // It may invoke `node->stopAllActions();` while `_actionManager` is null if the next line is after - // `CC_SAFE_RELEASE_NULL(_actionManager)`. - CC_SAFE_RELEASE_NULL(_userObject); + // `AX_SAFE_RELEASE_NULL(_actionManager)`. + AX_SAFE_RELEASE_NULL(_userObject); for (auto& child : _children) { @@ -178,26 +178,26 @@ Node::~Node() removeAllComponents(); - CC_SAFE_DELETE(_componentContainer); + AX_SAFE_DELETE(_componentContainer); stopAllActions(); unscheduleAllCallbacks(); - CC_SAFE_RELEASE_NULL(_actionManager); - CC_SAFE_RELEASE_NULL(_scheduler); + AX_SAFE_RELEASE_NULL(_actionManager); + AX_SAFE_RELEASE_NULL(_scheduler); _eventDispatcher->removeEventListenersForTarget(this); -#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 +#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS && 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?"); - CC_SAFE_RELEASE(_eventDispatcher); + AX_SAFE_RELEASE(_eventDispatcher); delete[] _additionalTransform; - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); } bool Node::init() @@ -214,9 +214,9 @@ bool Node::initLayer() { void Node::cleanup() { -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEngineManager::sendNodeEventToLua(this, kNodeOnCleanup); -#endif // #if CC_ENABLE_SCRIPT_BINDING +#endif // #if AX_ENABLE_SCRIPT_BINDING // actions this->stopAllActions(); @@ -360,8 +360,8 @@ void Node::updateRotationQuat() // convert Euler angle to quaternion // when _rotationZ_X == _rotationZ_Y, _rotationQuat = RotationZ_X * RotationY * RotationX // when _rotationZ_X != _rotationZ_Y, _rotationQuat = RotationY * RotationX - float halfRadx = CC_DEGREES_TO_RADIANS(_rotationX / 2.f), halfRady = CC_DEGREES_TO_RADIANS(_rotationY / 2.f), - halfRadz = _rotationZ_X == _rotationZ_Y ? -CC_DEGREES_TO_RADIANS(_rotationZ_X / 2.f) : 0; + float halfRadx = AX_DEGREES_TO_RADIANS(_rotationX / 2.f), halfRady = AX_DEGREES_TO_RADIANS(_rotationY / 2.f), + halfRadz = _rotationZ_X == _rotationZ_Y ? -AX_DEGREES_TO_RADIANS(_rotationZ_X / 2.f) : 0; float coshalfRadx = cosf(halfRadx), sinhalfRadx = sinf(halfRadx), coshalfRady = cosf(halfRady), sinhalfRady = sinf(halfRady), coshalfRadz = cosf(halfRadz), sinhalfRadz = sinf(halfRadz); _rotationQuat.x = sinhalfRadx * coshalfRady * coshalfRadz - coshalfRadx * sinhalfRady * sinhalfRadz; @@ -380,9 +380,9 @@ void Node::updateRotation3D() _rotationY = asinf(sy); _rotationZ_X = atan2f(2.f * (w * z + x * y), 1.f - 2.f * (y * y + z * z)); - _rotationX = CC_RADIANS_TO_DEGREES(_rotationX); - _rotationY = CC_RADIANS_TO_DEGREES(_rotationY); - _rotationZ_X = _rotationZ_Y = -CC_RADIANS_TO_DEGREES(_rotationZ_X); + _rotationX = AX_RADIANS_TO_DEGREES(_rotationX); + _rotationY = AX_RADIANS_TO_DEGREES(_rotationY); + _rotationZ_X = _rotationZ_Y = -AX_RADIANS_TO_DEGREES(_rotationZ_X); } void Node::setRotationQuat(const Quaternion& quat) @@ -727,11 +727,11 @@ void Node::updateParentChildrenIndexer(int tag) void Node::updateParentChildrenIndexer(std::string_view name) { - uint64_t newHash = CC_HASH_NODE_NAME(name); + uint64_t newHash = AX_HASH_NODE_NAME(name); auto parentChildrenIndexer = getParentChildrenIndexer(); if (parentChildrenIndexer) { - auto oldHash = CC_HASH_NODE_NAME(_name); + auto oldHash = AX_HASH_NODE_NAME(_name); if (oldHash != newHash) parentChildrenIndexer->erase(oldHash); (*parentChildrenIndexer)[newHash] = this; @@ -763,7 +763,7 @@ void Node::setUserData(void* userData) void Node::setUserObject(Ref* userObject) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -772,9 +772,9 @@ void Node::setUserObject(Ref* userObject) if (_userObject) sEngine->releaseScriptObject(this, _userObject); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS - CC_SAFE_RETAIN(userObject); - CC_SAFE_RELEASE(_userObject); +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS + AX_SAFE_RETAIN(userObject); + AX_SAFE_RELEASE(_userObject); _userObject = userObject; } @@ -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 = CC_HASH_NODE_NAME(name); + auto hash = AX_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 != CC_INVALID_INDEX) + if (index != AX_INVALID_INDEX) this->detachChild(child, index, cleanup); } @@ -1132,7 +1132,7 @@ void Node::removeAllChildrenWithCleanup(bool cleanup) } _children.clear(); - CC_SAFE_DELETE(_childrenIndexer); + AX_SAFE_DELETE(_childrenIndexer); } void Node::resetChild(Node* child, bool cleanup) @@ -1152,13 +1152,13 @@ void Node::resetChild(Node* child, bool cleanup) child->cleanup(); } -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, child); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS // set parent nil at the end child->setParent(nullptr); } @@ -1178,13 +1178,13 @@ void Node::detachChild(Node* child, ssize_t childIndex, bool cleanup) // helper used by reorderChild & add void Node::insertChild(Node* child, int z) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, child); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _transformUpdated = true; _reorderChildDirty = true; _children.pushBack(child); @@ -1350,7 +1350,7 @@ void Node::onEnter() _running = true; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEngineManager::sendNodeEventToLua(this, kNodeOnEnter); #endif } @@ -1364,7 +1364,7 @@ void Node::onEnterTransitionDidFinish() for (const auto& child : _children) child->onEnterTransitionDidFinish(); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEngineManager::sendNodeEventToLua(this, kNodeOnEnterTransitionDidFinish); #endif } @@ -1377,7 +1377,7 @@ void Node::onExitTransitionDidStart() for (const auto& child : _children) child->onExitTransitionDidStart(); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEngineManager::sendNodeEventToLua(this, kNodeOnExitTransitionDidStart); #endif } @@ -1404,7 +1404,7 @@ void Node::onExit() for (const auto& child : _children) child->onExit(); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEngineManager::sendNodeEventToLua(this, kNodeOnExit); #endif } @@ -1414,8 +1414,8 @@ void Node::setEventDispatcher(EventDispatcher* dispatcher) if (dispatcher != _eventDispatcher) { _eventDispatcher->removeEventListenersForTarget(this); - CC_SAFE_RETAIN(dispatcher); - CC_SAFE_RELEASE(_eventDispatcher); + AX_SAFE_RETAIN(dispatcher); + AX_SAFE_RELEASE(_eventDispatcher); _eventDispatcher = dispatcher; } } @@ -1425,8 +1425,8 @@ void Node::setActionManager(ActionManager* actionManager) if (actionManager != _actionManager) { this->stopAllActions(); - CC_SAFE_RETAIN(actionManager); - CC_SAFE_RELEASE(_actionManager); + AX_SAFE_RETAIN(actionManager); + AX_SAFE_RELEASE(_actionManager); _actionManager = actionManager; } } @@ -1493,8 +1493,8 @@ void Node::setScheduler(Scheduler* scheduler) if (scheduler != _scheduler) { this->unscheduleAllCallbacks(); - CC_SAFE_RETAIN(scheduler); - CC_SAFE_RELEASE(_scheduler); + AX_SAFE_RETAIN(scheduler); + AX_SAFE_RELEASE(_scheduler); _scheduler = scheduler; } } @@ -1523,7 +1523,7 @@ void Node::scheduleUpdateWithPriorityLua(int nHandler, int priority) { unscheduleUpdate(); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING _updateScriptHandler = nHandler; #endif @@ -1534,7 +1534,7 @@ void Node::unscheduleUpdate() { _scheduler->unscheduleUpdate(this); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING if (_updateScriptHandler) { ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_updateScriptHandler); @@ -1545,12 +1545,12 @@ void Node::unscheduleUpdate() void Node::schedule(SEL_SCHEDULE selector) { - this->schedule(selector, 0.0f, CC_REPEAT_FOREVER, 0.0f); + this->schedule(selector, 0.0f, AX_REPEAT_FOREVER, 0.0f); } void Node::schedule(SEL_SCHEDULE selector, float interval) { - this->schedule(selector, interval, CC_REPEAT_FOREVER, 0.0f); + this->schedule(selector, interval, AX_REPEAT_FOREVER, 0.0f); } void Node::schedule(SEL_SCHEDULE selector, float interval, unsigned int repeat, float delay) @@ -1626,7 +1626,7 @@ void Node::pause() // override me void Node::update(float fDelta) { -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING if (0 != _updateScriptHandler) { // only lua use @@ -1702,8 +1702,8 @@ const Mat4& Node::getNodeToParentTransform() const // Rotation values // Change rotation code to handle X and Y // If we skew with the exact same value for both x and y then we're simply just rotating - float radiansX = -CC_DEGREES_TO_RADIANS(_rotationZ_X); - float radiansY = -CC_DEGREES_TO_RADIANS(_rotationZ_Y); + float radiansX = -AX_DEGREES_TO_RADIANS(_rotationZ_X); + float radiansY = -AX_DEGREES_TO_RADIANS(_rotationZ_Y); float cx = cosf(radiansX); float sx = sinf(radiansX); float cy = cosf(radiansY); @@ -1744,10 +1744,10 @@ const Mat4& Node::getNodeToParentTransform() const if (needsSkewMatrix) { float skewMatArray[16] = {1, - (float)tanf(CC_DEGREES_TO_RADIANS(_skewY)), + (float)tanf(AX_DEGREES_TO_RADIANS(_skewY)), 0, 0, - (float)tanf(CC_DEGREES_TO_RADIANS(_skewX)), + (float)tanf(AX_DEGREES_TO_RADIANS(_skewX)), 1, 0, 0, @@ -2225,10 +2225,10 @@ bool Node::setProgramState(backend::ProgramState* programState, bool needsRetain { if (_programState != programState) { - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); _programState = programState; if (needsRetain) - CC_SAFE_RETAIN(_programState); + AX_SAFE_RETAIN(_programState); return !!_programState; } return false; diff --git a/core/2d/CCNode.h b/core/2d/CCNode.h index 3b467fadd8..2dcc696c96 100644 --- a/core/2d/CCNode.h +++ b/core/2d/CCNode.h @@ -41,7 +41,7 @@ #include "2d/CCComponentContainer.h" #include "2d/CCComponent.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "physics/CCPhysicsBody.h" #endif @@ -114,7 +114,7 @@ Node and override `draw`. */ -class CC_DLL Node : public Ref +class AX_DLL Node : public Ref { public: /** Default tag used for all the nodes */ @@ -949,7 +949,7 @@ public: inline static void sortNodes(axis::Vector<_T*>& nodes) { static_assert(std::is_base_of::value, "Node::sortNodes: Only accept derived of Node!"); -#if CC_64BITS +#if AX_64BITS std::sort(std::begin(nodes), std::end(nodes), [](_T* n1, _T* n2) { return (n1->_localZOrder$Arrival < n2->_localZOrder$Arrival); }); #else @@ -1344,13 +1344,13 @@ public: // firstly, implement a schedule function void MyNode::TickMe(float dt); // wrap this function into a selector via schedule_selector macro. - this->schedule(CC_SCHEDULE_SELECTOR(MyNode::TickMe), 0, 0, 0); + this->schedule(AX_SCHEDULE_SELECTOR(MyNode::TickMe), 0, 0, 0); @endcode * * @param selector The SEL_SCHEDULE selector to be scheduled. * @param interval Tick interval in seconds. 0 means tick every frame. If interval = 0, it's recommended to use scheduleUpdate() instead. - * @param repeat The selector will be executed (repeat + 1) times, you can use CC_REPEAT_FOREVER for tick + * @param repeat The selector will be executed (repeat + 1) times, you can use AX_REPEAT_FOREVER for tick infinitely. * @param delay The amount of time that the first tick will wait before execution. * @lua NA @@ -1420,7 +1420,7 @@ public: * * @param callback The lambda function to be schedule. * @param interval Tick interval in seconds. 0 means tick every frame. - * @param repeat The selector will be executed (repeat + 1) times, you can use CC_REPEAT_FOREVER for tick + * @param repeat The selector will be executed (repeat + 1) times, you can use AX_REPEAT_FOREVER for tick * infinitely. * @param delay The amount of time that the first tick will wait before execution. * @param key The key of the lambda function. To be used if you want to unschedule it. @@ -1915,7 +1915,7 @@ protected: mutable Mat4 _inverse; ///< inverse transform mutable Mat4* _additionalTransform; ///< two transforms needed by additional transforms -#if CC_LITTLE_ENDIAN +#if AX_LITTLE_ENDIAN union { struct @@ -1982,7 +1982,7 @@ protected: // camera mask, it is visible only when _cameraMask & current camera' camera flag is true unsigned short _cameraMask; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING int _scriptHandler; ///< script handler for onEnter() & onExit(), used in Javascript binding and Lua binding. int _updateScriptHandler; ///< script handler for update() callback per frame, which is invoked from lua & ///< javascript. @@ -2004,7 +2004,7 @@ protected: backend::ProgramState* _programState = nullptr; // Physics:remaining backwardly compatible -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS PhysicsBody* _physicsBody; public: @@ -2025,7 +2025,7 @@ public: static int __attachedNodeCount; private: - CC_DISALLOW_COPY_AND_ASSIGN(Node); + AX_DISALLOW_COPY_AND_ASSIGN(Node); }; /** @@ -2043,7 +2043,7 @@ private: * @parma p Point to a Vec3 for store the intersect point, if don't need them set to nullptr. * @return true if the point is in content rectangle, false otherwise. */ -bool CC_DLL isScreenPointInRect(const Vec2& pt, const Camera* camera, const Mat4& w2l, const Rect& rect, Vec3* p); +bool AX_DLL isScreenPointInRect(const Vec2& pt, const Camera* camera, const Mat4& w2l, const Rect& rect, Vec3* p); // end of _2d group /// @} diff --git a/core/2d/CCNodeGrid.cpp b/core/2d/CCNodeGrid.cpp index 6ef17ddf29..1bfd47da6a 100644 --- a/core/2d/CCNodeGrid.cpp +++ b/core/2d/CCNodeGrid.cpp @@ -37,7 +37,7 @@ NodeGrid* NodeGrid::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -56,7 +56,7 @@ NodeGrid::NodeGrid() {} void NodeGrid::setTarget(Node* target) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -65,16 +65,16 @@ void NodeGrid::setTarget(Node* target) if (target) sEngine->retainScriptObject(this, target); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS - CC_SAFE_RELEASE(_gridTarget); - CC_SAFE_RETAIN(target); +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS + AX_SAFE_RELEASE(_gridTarget); + AX_SAFE_RETAIN(target); _gridTarget = target; } NodeGrid::~NodeGrid() { - CC_SAFE_RELEASE(_nodeGrid); - CC_SAFE_RELEASE(_gridTarget); + AX_SAFE_RELEASE(_nodeGrid); + AX_SAFE_RELEASE(_gridTarget); } void NodeGrid::onGridBeginDraw() @@ -173,8 +173,8 @@ void NodeGrid::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t p void NodeGrid::setGrid(GridBase* grid) { - CC_SAFE_RELEASE(_nodeGrid); - CC_SAFE_RETAIN(grid); + AX_SAFE_RELEASE(_nodeGrid); + AX_SAFE_RETAIN(grid); _nodeGrid = grid; } diff --git a/core/2d/CCNodeGrid.h b/core/2d/CCNodeGrid.h index 2f5eb54503..4d25d38c47 100644 --- a/core/2d/CCNodeGrid.h +++ b/core/2d/CCNodeGrid.h @@ -40,7 +40,7 @@ class GridBase; * @brief Base class for Grid Node. */ -class CC_DLL NodeGrid : public Node +class AX_DLL NodeGrid : public Node { public: /** Create a Grid Node. @@ -104,7 +104,7 @@ protected: Rect _gridRect = Rect::ZERO; private: - CC_DISALLOW_COPY_AND_ASSIGN(NodeGrid); + AX_DISALLOW_COPY_AND_ASSIGN(NodeGrid); }; /** @} */ NS_AX_END diff --git a/core/2d/CCParallaxNode.h b/core/2d/CCParallaxNode.h index ef4a3008a5..1a8e01799d 100644 --- a/core/2d/CCParallaxNode.h +++ b/core/2d/CCParallaxNode.h @@ -46,7 +46,7 @@ struct _ccArray; The children will be moved faster / slower than the parent according the parallax ratio. */ -class CC_DLL ParallaxNode : public Node +class AX_DLL ParallaxNode : public Node { public: /** Create a Parallax node. @@ -107,7 +107,7 @@ protected: struct _ccArray* _parallaxArray; private: - CC_DISALLOW_COPY_AND_ASSIGN(ParallaxNode); + AX_DISALLOW_COPY_AND_ASSIGN(ParallaxNode); }; // end of _2d group diff --git a/core/2d/CCParticleBatchNode.cpp b/core/2d/CCParticleBatchNode.cpp index 5afcbcc5ef..1c9129bfc5 100644 --- a/core/2d/CCParticleBatchNode.cpp +++ b/core/2d/CCParticleBatchNode.cpp @@ -85,8 +85,8 @@ ParticleBatchNode::ParticleBatchNode() ParticleBatchNode::~ParticleBatchNode() { - CC_SAFE_RELEASE(_textureAtlas); - CC_SAFE_RELEASE(_customCommand.getPipelineDescriptor().programState); + AX_SAFE_RELEASE(_textureAtlas); + AX_SAFE_RELEASE(_customCommand.getPipelineDescriptor().programState); } /* * creation with Texture2D @@ -100,7 +100,7 @@ ParticleBatchNode* ParticleBatchNode::createWithTexture(Texture2D* tex, int capa p->autorelease(); return p; } - CC_SAFE_DELETE(p); + AX_SAFE_DELETE(p); return nullptr; } @@ -116,7 +116,7 @@ ParticleBatchNode* ParticleBatchNode::create(std::string_view imageFile, int cap p->autorelease(); return p; } - CC_SAFE_DELETE(p); + AX_SAFE_DELETE(p); return nullptr; } @@ -447,7 +447,7 @@ void ParticleBatchNode::removeAllChildrenWithCleanup(bool doCleanup) void ParticleBatchNode::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) { - CC_PROFILER_START("CCParticleBatchNode - draw"); + AX_PROFILER_START("CCParticleBatchNode - draw"); if (_textureAtlas->getTotalQuads() == 0) return; @@ -476,7 +476,7 @@ void ParticleBatchNode::draw(Renderer* renderer, const Mat4& transform, uint32_t renderer->addCommand(&_customCommand); - CC_PROFILER_STOP("CCParticleBatchNode - draw"); + AX_PROFILER_STOP("CCParticleBatchNode - draw"); } void ParticleBatchNode::increaseAtlasCapacityTo(ssize_t quantity) @@ -564,7 +564,7 @@ void ParticleBatchNode::updateProgramStateTexture() auto programState = _customCommand.getPipelineDescriptor().programState; programState->setTexture(texture->getBackendTexture()); // If the new texture has No premultiplied alpha, AND the blendFunc hasn't been changed, then update it - if (!texture->hasPremultipliedAlpha() && (_blendFunc.src == CC_BLEND_SRC && _blendFunc.dst == CC_BLEND_DST)) + if (!texture->hasPremultipliedAlpha() && (_blendFunc.src == AX_BLEND_SRC && _blendFunc.dst == AX_BLEND_DST)) _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED; } diff --git a/core/2d/CCParticleBatchNode.h b/core/2d/CCParticleBatchNode.h index 03539690fa..0d35b5fee0 100644 --- a/core/2d/CCParticleBatchNode.h +++ b/core/2d/CCParticleBatchNode.h @@ -68,7 +68,7 @@ class ParticleSystem; * @since v1.1 */ -class CC_DLL ParticleBatchNode : public Node, public TextureProtocol +class AX_DLL ParticleBatchNode : public Node, public TextureProtocol { public: /** Create the particle system with Texture2D, a capacity of particles, which particle system to use. diff --git a/core/2d/CCParticleExamples.cpp b/core/2d/CCParticleExamples.cpp index 4ec7944b69..0834e12701 100644 --- a/core/2d/CCParticleExamples.cpp +++ b/core/2d/CCParticleExamples.cpp @@ -44,16 +44,16 @@ static Texture2D* getDefaultTexture() { const std::string key = "/__firePngData"; texture = Director::getInstance()->getTextureCache()->getTextureForKey(key); - CC_BREAK_IF(texture != nullptr); + AX_BREAK_IF(texture != nullptr); image = new Image(); bool ret = image->initWithImageData(__firePngData, sizeof(__firePngData)); - CC_BREAK_IF(!ret); + AX_BREAK_IF(!ret); texture = Director::getInstance()->getTextureCache()->addImage(image, key); } while (0); - CC_SAFE_RELEASE(image); + AX_SAFE_RELEASE(image); return texture; } @@ -67,7 +67,7 @@ ParticleFire* ParticleFire::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -81,7 +81,7 @@ ParticleFire* ParticleFire::createWithTotalParticles(int numberOfParticles) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -171,7 +171,7 @@ ParticleFireworks* ParticleFireworks::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -185,7 +185,7 @@ ParticleFireworks* ParticleFireworks::createWithTotalParticles(int numberOfParti } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -272,7 +272,7 @@ ParticleSun* ParticleSun::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -286,7 +286,7 @@ ParticleSun* ParticleSun::createWithTotalParticles(int numberOfParticles) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -378,7 +378,7 @@ ParticleGalaxy* ParticleGalaxy::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -392,7 +392,7 @@ ParticleGalaxy* ParticleGalaxy::createWithTotalParticles(int numberOfParticles) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -487,7 +487,7 @@ ParticleFlower* ParticleFlower::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -501,7 +501,7 @@ ParticleFlower* ParticleFlower::createWithTotalParticles(int numberOfParticles) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -595,7 +595,7 @@ ParticleMeteor* ParticleMeteor::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -609,7 +609,7 @@ ParticleMeteor* ParticleMeteor::createWithTotalParticles(int numberOfParticles) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -704,7 +704,7 @@ ParticleSpiral* ParticleSpiral::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -718,7 +718,7 @@ ParticleSpiral* ParticleSpiral::createWithTotalParticles(int numberOfParticles) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -813,7 +813,7 @@ ParticleExplosion* ParticleExplosion::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -827,7 +827,7 @@ ParticleExplosion* ParticleExplosion::createWithTotalParticles(int numberOfParti } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -921,7 +921,7 @@ ParticleSmoke* ParticleSmoke::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -935,7 +935,7 @@ ParticleSmoke* ParticleSmoke::createWithTotalParticles(int numberOfParticles) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -1026,7 +1026,7 @@ ParticleSnow* ParticleSnow::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -1040,7 +1040,7 @@ ParticleSnow* ParticleSnow::createWithTotalParticles(int numberOfParticles) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -1134,7 +1134,7 @@ ParticleRain* ParticleRain::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -1148,7 +1148,7 @@ ParticleRain* ParticleRain::createWithTotalParticles(int numberOfParticles) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/core/2d/CCParticleExamples.h b/core/2d/CCParticleExamples.h index a067ae3958..107130b39f 100644 --- a/core/2d/CCParticleExamples.h +++ b/core/2d/CCParticleExamples.h @@ -40,7 +40,7 @@ NS_AX_BEGIN /** @class ParticleFire * @brief A fire particle system. */ -class CC_DLL ParticleFire : public ParticleSystemQuad +class AX_DLL ParticleFire : public ParticleSystemQuad { public: /** Create a fire particle system. @@ -70,13 +70,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles) override; private: - CC_DISALLOW_COPY_AND_ASSIGN(ParticleFire); + AX_DISALLOW_COPY_AND_ASSIGN(ParticleFire); }; /** @class ParticleFireworks * @brief A fireworks particle system. */ -class CC_DLL ParticleFireworks : public ParticleSystemQuad +class AX_DLL ParticleFireworks : public ParticleSystemQuad { public: /** Create a fireworks particle system. @@ -106,13 +106,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - CC_DISALLOW_COPY_AND_ASSIGN(ParticleFireworks); + AX_DISALLOW_COPY_AND_ASSIGN(ParticleFireworks); }; /** @class ParticleSun * @brief A sun particle system. */ -class CC_DLL ParticleSun : public ParticleSystemQuad +class AX_DLL ParticleSun : public ParticleSystemQuad { public: /** Create a sun particle system. @@ -142,13 +142,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - CC_DISALLOW_COPY_AND_ASSIGN(ParticleSun); + AX_DISALLOW_COPY_AND_ASSIGN(ParticleSun); }; /** @class ParticleGalaxy * @brief A galaxy particle system. */ -class CC_DLL ParticleGalaxy : public ParticleSystemQuad +class AX_DLL ParticleGalaxy : public ParticleSystemQuad { public: /** Create a galaxy particle system. @@ -178,13 +178,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - CC_DISALLOW_COPY_AND_ASSIGN(ParticleGalaxy); + AX_DISALLOW_COPY_AND_ASSIGN(ParticleGalaxy); }; /** @class ParticleFlower * @brief A flower particle system. */ -class CC_DLL ParticleFlower : public ParticleSystemQuad +class AX_DLL ParticleFlower : public ParticleSystemQuad { public: /** Create a flower particle system. @@ -214,13 +214,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - CC_DISALLOW_COPY_AND_ASSIGN(ParticleFlower); + AX_DISALLOW_COPY_AND_ASSIGN(ParticleFlower); }; /** @class ParticleMeteor * @brief A meteor particle system. */ -class CC_DLL ParticleMeteor : public ParticleSystemQuad +class AX_DLL ParticleMeteor : public ParticleSystemQuad { public: /** Create a meteor particle system. @@ -250,13 +250,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - CC_DISALLOW_COPY_AND_ASSIGN(ParticleMeteor); + AX_DISALLOW_COPY_AND_ASSIGN(ParticleMeteor); }; /** @class ParticleSpiral * @brief An spiral particle system. */ -class CC_DLL ParticleSpiral : public ParticleSystemQuad +class AX_DLL ParticleSpiral : public ParticleSystemQuad { public: /** Create a spiral particle system. @@ -286,13 +286,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - CC_DISALLOW_COPY_AND_ASSIGN(ParticleSpiral); + AX_DISALLOW_COPY_AND_ASSIGN(ParticleSpiral); }; /** @class ParticleExplosion * @brief An explosion particle system. */ -class CC_DLL ParticleExplosion : public ParticleSystemQuad +class AX_DLL ParticleExplosion : public ParticleSystemQuad { public: /** Create a explosion particle system. @@ -322,13 +322,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - CC_DISALLOW_COPY_AND_ASSIGN(ParticleExplosion); + AX_DISALLOW_COPY_AND_ASSIGN(ParticleExplosion); }; /** @class ParticleSmoke * @brief An smoke particle system. */ -class CC_DLL ParticleSmoke : public ParticleSystemQuad +class AX_DLL ParticleSmoke : public ParticleSystemQuad { public: /** Create a smoke particle system. @@ -358,13 +358,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - CC_DISALLOW_COPY_AND_ASSIGN(ParticleSmoke); + AX_DISALLOW_COPY_AND_ASSIGN(ParticleSmoke); }; /** @class ParticleSnow * @brief An snow particle system. */ -class CC_DLL ParticleSnow : public ParticleSystemQuad +class AX_DLL ParticleSnow : public ParticleSystemQuad { public: /** Create a snow particle system. @@ -394,13 +394,13 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - CC_DISALLOW_COPY_AND_ASSIGN(ParticleSnow); + AX_DISALLOW_COPY_AND_ASSIGN(ParticleSnow); }; /** @class ParticleRain * @brief A rain particle system. */ -class CC_DLL ParticleRain : public ParticleSystemQuad +class AX_DLL ParticleRain : public ParticleSystemQuad { public: /** Create a rain particle system. @@ -430,7 +430,7 @@ public: virtual bool initWithTotalParticles(int numberOfParticles); private: - CC_DISALLOW_COPY_AND_ASSIGN(ParticleRain); + AX_DISALLOW_COPY_AND_ASSIGN(ParticleRain); }; // end of _2d group diff --git a/core/2d/CCParticleSystem.cpp b/core/2d/CCParticleSystem.cpp index b5a0754405..5a540076d6 100644 --- a/core/2d/CCParticleSystem.cpp +++ b/core/2d/CCParticleSystem.cpp @@ -147,47 +147,47 @@ bool ParticleData::init(int count) void ParticleData::release() { - CC_SAFE_FREE(posx); - CC_SAFE_FREE(posy); - CC_SAFE_FREE(startPosX); - CC_SAFE_FREE(startPosY); - CC_SAFE_FREE(colorR); - CC_SAFE_FREE(colorG); - CC_SAFE_FREE(colorB); - CC_SAFE_FREE(colorA); - CC_SAFE_FREE(deltaColorR); - CC_SAFE_FREE(deltaColorG); - CC_SAFE_FREE(deltaColorB); - CC_SAFE_FREE(deltaColorA); - CC_SAFE_FREE(hue); - CC_SAFE_FREE(sat); - CC_SAFE_FREE(val); - CC_SAFE_FREE(opacityFadeInDelta); - CC_SAFE_FREE(opacityFadeInLength); - CC_SAFE_FREE(scaleInDelta); - CC_SAFE_FREE(scaleInLength); - CC_SAFE_FREE(size); - CC_SAFE_FREE(deltaSize); - CC_SAFE_FREE(rotation); - CC_SAFE_FREE(staticRotation); - CC_SAFE_FREE(deltaRotation); - CC_SAFE_FREE(totalTimeToLive); - CC_SAFE_FREE(timeToLive); - CC_SAFE_FREE(animTimeLength); - CC_SAFE_FREE(animTimeDelta); - CC_SAFE_FREE(animIndex); - CC_SAFE_FREE(animCellIndex); - CC_SAFE_FREE(atlasIndex); + AX_SAFE_FREE(posx); + AX_SAFE_FREE(posy); + AX_SAFE_FREE(startPosX); + AX_SAFE_FREE(startPosY); + AX_SAFE_FREE(colorR); + AX_SAFE_FREE(colorG); + AX_SAFE_FREE(colorB); + AX_SAFE_FREE(colorA); + AX_SAFE_FREE(deltaColorR); + AX_SAFE_FREE(deltaColorG); + AX_SAFE_FREE(deltaColorB); + AX_SAFE_FREE(deltaColorA); + AX_SAFE_FREE(hue); + AX_SAFE_FREE(sat); + AX_SAFE_FREE(val); + AX_SAFE_FREE(opacityFadeInDelta); + AX_SAFE_FREE(opacityFadeInLength); + AX_SAFE_FREE(scaleInDelta); + AX_SAFE_FREE(scaleInLength); + AX_SAFE_FREE(size); + AX_SAFE_FREE(deltaSize); + AX_SAFE_FREE(rotation); + AX_SAFE_FREE(staticRotation); + AX_SAFE_FREE(deltaRotation); + AX_SAFE_FREE(totalTimeToLive); + AX_SAFE_FREE(timeToLive); + AX_SAFE_FREE(animTimeLength); + AX_SAFE_FREE(animTimeDelta); + AX_SAFE_FREE(animIndex); + AX_SAFE_FREE(animCellIndex); + AX_SAFE_FREE(atlasIndex); - CC_SAFE_FREE(modeA.dirX); - CC_SAFE_FREE(modeA.dirY); - CC_SAFE_FREE(modeA.radialAccel); - CC_SAFE_FREE(modeA.tangentialAccel); + AX_SAFE_FREE(modeA.dirX); + AX_SAFE_FREE(modeA.dirY); + AX_SAFE_FREE(modeA.radialAccel); + AX_SAFE_FREE(modeA.tangentialAccel); - CC_SAFE_FREE(modeB.angle); - CC_SAFE_FREE(modeB.degreesPerSecond); - CC_SAFE_FREE(modeB.deltaRadius); - CC_SAFE_FREE(modeB.radius); + AX_SAFE_FREE(modeB.angle); + AX_SAFE_FREE(modeB.degreesPerSecond); + AX_SAFE_FREE(modeB.deltaRadius); + AX_SAFE_FREE(modeB.radius); } Vector ParticleSystem::__allInstances; @@ -279,7 +279,7 @@ ParticleSystem* ParticleSystem::create(std::string_view plistFile) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -291,7 +291,7 @@ ParticleSystem* ParticleSystem::createWithTotalParticles(int numberOfParticles) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -321,10 +321,10 @@ bool ParticleSystem::allocAnimationMem() void ParticleSystem::deallocAnimationMem() { - CC_SAFE_FREE(_particleData.animTimeLength); - CC_SAFE_FREE(_particleData.animTimeDelta); - CC_SAFE_FREE(_particleData.animIndex); - CC_SAFE_FREE(_particleData.animCellIndex); + AX_SAFE_FREE(_particleData.animTimeLength); + AX_SAFE_FREE(_particleData.animTimeDelta); + AX_SAFE_FREE(_particleData.animIndex); + AX_SAFE_FREE(_particleData.animCellIndex); _isAnimAllocated = false; } @@ -346,9 +346,9 @@ bool ParticleSystem::allocHSVMem() void ParticleSystem::deallocHSVMem() { - CC_SAFE_FREE(_particleData.hue); - CC_SAFE_FREE(_particleData.sat); - CC_SAFE_FREE(_particleData.val); + AX_SAFE_FREE(_particleData.hue); + AX_SAFE_FREE(_particleData.sat); + AX_SAFE_FREE(_particleData.val); _isHSVAllocated = false; } @@ -369,8 +369,8 @@ bool ParticleSystem::allocOpacityFadeInMem() void ParticleSystem::deallocOpacityFadeInMem() { - CC_SAFE_FREE(_particleData.opacityFadeInDelta); - CC_SAFE_FREE(_particleData.opacityFadeInLength); + AX_SAFE_FREE(_particleData.opacityFadeInDelta); + AX_SAFE_FREE(_particleData.opacityFadeInLength); _isOpacityFadeInAllocated = false; } @@ -391,8 +391,8 @@ bool ParticleSystem::allocScaleInMem() void ParticleSystem::deallocScaleInMem() { - CC_SAFE_FREE(_particleData.scaleInDelta); - CC_SAFE_FREE(_particleData.scaleInLength); + AX_SAFE_FREE(_particleData.scaleInDelta); + AX_SAFE_FREE(_particleData.scaleInLength); _isScaleInAllocated = false; } @@ -574,7 +574,7 @@ bool ParticleSystem::initWithDictionary(const ValueMap& dictionary, std::string_ else { CCASSERT(false, "Invalid emitterType in config file"); - CC_BREAK_IF(true); + AX_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"); - CC_BREAK_IF(!buffer); + AX_BREAK_IF(!buffer); unsigned char* deflated = nullptr; ssize_t deflatedLen = ZipUtils::inflateMemory(buffer, decodeLen, &deflated); CCASSERT(deflated != nullptr, "CCParticleSystem: error ungzipping textureImageData"); - CC_BREAK_IF(!deflated); + AX_BREAK_IF(!deflated); // For android, we should retain it in VolatileTexture::addImage which invoked in // Director::getInstance()->getTextureCache()->addUIImage() image = new Image(); bool isOK = image->initWithImageData(deflated, deflatedLen, true); CCASSERT(isOK, "CCParticleSystem: error init image with Data"); - CC_BREAK_IF(!isOK); + AX_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 = (CC_UPDATE_PARTICLE_IMP) [self methodForSelector:updateParticleSel]; + // updateParticleImp = (AX_UPDATE_PARTICLE_IMP) [self methodForSelector:updateParticleSel]; // for batchNode _transformSystemDirty = false; @@ -726,7 +726,7 @@ ParticleSystem::~ParticleSystem() // unscheduleUpdate(); _particleData.release(); _animations.clear(); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_texture); } void ParticleSystem::addParticles(int count, int animationIndex, int animationCellIndex) @@ -798,7 +798,7 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe auto val = _rng.float01() * shape.innerRadius / shape.innerRadius; val = powf(val, 1 / shape.edgeBias); auto point = Vec2(0.0F, val * shape.innerRadius); - point = point.rotateByAngle(Vec2::ZERO, -CC_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef())); + point = point.rotateByAngle(Vec2::ZERO, -AX_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef())); _particleData.posx[i] = _sourcePosition.x + shape.x + point.x / 2; _particleData.posy[i] = _sourcePosition.y + shape.y + point.y / 2; @@ -809,7 +809,7 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe auto val = _rng.float01() * shape.outerRadius / shape.outerRadius; val = powf(val, 1 / shape.edgeBias); auto point = Vec2(0.0F, ((val * (shape.outerRadius - shape.innerRadius) + shape.outerRadius) - (shape.outerRadius - shape.innerRadius))); - point = point.rotateByAngle(Vec2::ZERO, -CC_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef())); + point = point.rotateByAngle(Vec2::ZERO, -AX_DEGREES_TO_RADIANS(shape.coneOffset + shape.coneAngle / 2 * _rng.rangef())); _particleData.posx[i] = _sourcePosition.x + shape.x + point.x / 2; _particleData.posy[i] = _sourcePosition.y + shape.y + point.y / 2; @@ -839,7 +839,7 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe point.x = point.x / size.x * overrideSize.x * scale.x; point.y = point.y / size.y * overrideSize.y * scale.y; - point = point.rotateByAngle(Vec2::ZERO, -CC_DEGREES_TO_RADIANS(angle)); + point = point.rotateByAngle(Vec2::ZERO, -AX_DEGREES_TO_RADIANS(angle)); _particleData.posx[i] = _sourcePosition.x + shape.x + point.x; _particleData.posy[i] = _sourcePosition.y + shape.y + point.y; @@ -1053,20 +1053,20 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe { for (int i = start; i < _particleCount; ++i) { - float a = CC_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef()); + float a = AX_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef()); Vec2 v(cosf(a), sinf(a)); float s = modeA.speed + modeA.speedVar * _rng.rangef(); Vec2 dir = v * s; _particleData.modeA.dirX[i] = dir.x; // v * s ; _particleData.modeA.dirY[i] = dir.y; - _particleData.rotation[i] = -CC_RADIANS_TO_DEGREES(dir.getAngle()); + _particleData.rotation[i] = -AX_RADIANS_TO_DEGREES(dir.getAngle()); } } else { for (int i = start; i < _particleCount; ++i) { - float a = CC_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef()); + float a = AX_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef()); Vec2 v(cosf(a), sinf(a)); float s = modeA.speed + modeA.speedVar * _rng.rangef(); Vec2 dir = v * s; @@ -1088,13 +1088,13 @@ void ParticleSystem::addParticles(int count, int animationIndex, int animationCe for (int i = start; i < _particleCount; ++i) { - _particleData.modeB.angle[i] = CC_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef()); + _particleData.modeB.angle[i] = AX_DEGREES_TO_RADIANS(_angle + _angleVar * _rng.rangef()); } for (int i = start; i < _particleCount; ++i) { _particleData.modeB.degreesPerSecond[i] = - CC_DEGREES_TO_RADIANS(modeB.rotatePerSecond + modeB.rotatePerSecondVar * _rng.rangef()); + AX_DEGREES_TO_RADIANS(modeB.rotatePerSecond + modeB.rotatePerSecondVar * _rng.rangef()); } if (modeB.endRadius == START_RADIUS_EQUAL_TO_END_RADIUS) @@ -1558,7 +1558,7 @@ void ParticleSystem::update(float dt) if (!_visible) return; - CC_PROFILER_START_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update"); + AX_PROFILER_START_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update"); if (_componentContainer && !_componentContainer->isEmpty()) { @@ -1572,7 +1572,7 @@ void ParticleSystem::update(float dt) { updateParticleQuads(); _transformSystemDirty = false; - CC_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update"); + AX_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update"); return; } dt = _fixedFPSDelta; @@ -1838,7 +1838,7 @@ void ParticleSystem::update(float dt) postStep(); } - CC_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update"); + AX_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles, "CCParticleSystem - update"); } void ParticleSystem::updateWithNoTime() @@ -1861,8 +1861,8 @@ void ParticleSystem::setTexture(Texture2D* var) { if (_texture != var) { - CC_SAFE_RETAIN(var); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RETAIN(var); + AX_SAFE_RELEASE(_texture); _texture = var; updateBlendFunc(); } @@ -1878,7 +1878,7 @@ void ParticleSystem::updateBlendFunc() _opacityModifyRGB = false; - if (_texture && (_blendFunc.src == CC_BLEND_SRC && _blendFunc.dst == CC_BLEND_DST)) + if (_texture && (_blendFunc.src == AX_BLEND_SRC && _blendFunc.dst == AX_BLEND_DST)) { if (premultiplied) { diff --git a/core/2d/CCParticleSystem.h b/core/2d/CCParticleSystem.h index acb00b6ac6..46ef4c35d0 100644 --- a/core/2d/CCParticleSystem.h +++ b/core/2d/CCParticleSystem.h @@ -103,7 +103,7 @@ struct ParticleFrameDescriptor bool isRotated; }; -class CC_DLL ParticleData +class AX_DLL ParticleData { public: float* posx; @@ -239,7 +239,7 @@ public: * Particle emission mask cache. * @since axis-1.0.0b8 */ -class CC_DLL ParticleEmissionMaskCache : public axis::Ref +class AX_DLL ParticleEmissionMaskCache : public axis::Ref { public: static ParticleEmissionMaskCache* getInstance(); @@ -306,7 +306,7 @@ private: }; -// typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tParticle*, Vec2); +// typedef void (*AX_UPDATE_PARTICLE_IMP)(id, SEL, tParticle*, Vec2); class Texture2D; @@ -354,7 +354,7 @@ emitter.startSpin = 0; @endcode */ -class CC_DLL ParticleSystem : public Node, public TextureProtocol, public PlayableProtocol +class AX_DLL ParticleSystem : public Node, public TextureProtocol, public PlayableProtocol { public: /** Mode @@ -1535,7 +1535,7 @@ protected: float _emitCounter; // Optimization - // CC_UPDATE_PARTICLE_IMP updateParticleImp; + // AX_UPDATE_PARTICLE_IMP updateParticleImp; // SEL updateParticleSel; /** weak reference to the SpriteBatchNode that renders the Sprite */ @@ -1684,7 +1684,7 @@ protected: FastRNG _rng; private: - CC_DISALLOW_COPY_AND_ASSIGN(ParticleSystem); + AX_DISALLOW_COPY_AND_ASSIGN(ParticleSystem); }; // end of _2d group diff --git a/core/2d/CCParticleSystemQuad.cpp b/core/2d/CCParticleSystemQuad.cpp index e83713ee21..dfff526ed0 100644 --- a/core/2d/CCParticleSystemQuad.cpp +++ b/core/2d/CCParticleSystemQuad.cpp @@ -83,11 +83,11 @@ ParticleSystemQuad::~ParticleSystemQuad() { if (nullptr == _batchNode) { - CC_SAFE_FREE(_quads); - CC_SAFE_FREE(_indices); + AX_SAFE_FREE(_quads); + AX_SAFE_FREE(_indices); } - CC_SAFE_RELEASE_NULL(_quadCommand.getPipelineDescriptor().programState); + AX_SAFE_RELEASE_NULL(_quadCommand.getPipelineDescriptor().programState); } // implementation ParticleSystemQuad @@ -100,7 +100,7 @@ ParticleSystemQuad* ParticleSystemQuad::create(std::string_view filename) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -116,7 +116,7 @@ ParticleSystemQuad* ParticleSystemQuad::createWithTotalParticles(int numberOfPar ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -128,7 +128,7 @@ ParticleSystemQuad* ParticleSystemQuad::create(ValueMap& dictionary) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -149,10 +149,10 @@ bool ParticleSystemQuad::initWithTotalParticles(int numberOfParticles) initIndices(); // setupVBO(); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // Need to listen the event only when not use batchnode, because it will use VBO auto listener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, - CC_CALLBACK_1(ParticleSystemQuad::listenRendererRecreated, this)); + AX_CALLBACK_1(ParticleSystemQuad::listenRendererRecreated, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); #endif @@ -167,8 +167,8 @@ void ParticleSystemQuad::initTexCoordsWithRect(const Rect& pointRect) // convert to Tex coords Rect rect = - Rect(pointRect.origin.x * CC_CONTENT_SCALE_FACTOR(), pointRect.origin.y * CC_CONTENT_SCALE_FACTOR(), - pointRect.size.width * CC_CONTENT_SCALE_FACTOR(), pointRect.size.height * CC_CONTENT_SCALE_FACTOR()); + Rect(pointRect.origin.x * AX_CONTENT_SCALE_FACTOR(), pointRect.origin.y * AX_CONTENT_SCALE_FACTOR(), + pointRect.size.width * AX_CONTENT_SCALE_FACTOR(), pointRect.size.height * AX_CONTENT_SCALE_FACTOR()); float wide = (float)pointRect.size.width; float high = (float)pointRect.size.height; @@ -179,7 +179,7 @@ void ParticleSystemQuad::initTexCoordsWithRect(const Rect& pointRect) high = (float)_texture->getPixelsHigh(); } -#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#if AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL float left = (rect.origin.x * 2 + 1) / (wide * 2); float bottom = (rect.origin.y * 2 + 1) / (high * 2); float right = left + (rect.size.width * 2 - 2) / (wide * 2); @@ -189,7 +189,7 @@ void ParticleSystemQuad::initTexCoordsWithRect(const Rect& pointRect) float bottom = rect.origin.y / high; float right = left + rect.size.width / wide; float top = bottom + rect.size.height / high; -#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#endif // ! AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL // Important. Texture in cocos2d are inverted, so the Y component should be inverted std::swap(top, bottom); @@ -295,7 +295,7 @@ inline void updatePosWithParticle(V3F_C4B_T2F_Quad* quad, float x = newPosition.x; float y = newPosition.y; - float r = (float)-CC_DEGREES_TO_RADIANS(rotation + staticRotation); + float r = (float)-AX_DEGREES_TO_RADIANS(rotation + staticRotation); float cr = cosf(r); float sr = sinf(r); float ax = x1 * cr - y1 * sr + x; @@ -811,8 +811,8 @@ bool ParticleSystemQuad::allocMemory() { CCASSERT(!_batchNode, "Memory should not be alloced when not using batchNode"); - CC_SAFE_FREE(_quads); - CC_SAFE_FREE(_indices); + AX_SAFE_FREE(_quads); + AX_SAFE_FREE(_indices); _quads = (V3F_C4B_T2F_Quad*)malloc(_totalParticles * sizeof(V3F_C4B_T2F_Quad)); _indices = (unsigned short*)malloc(_totalParticles * 6 * sizeof(unsigned short)); @@ -820,8 +820,8 @@ bool ParticleSystemQuad::allocMemory() if (!_quads || !_indices) { CCLOG("cocos2d: Particle system: not enough memory"); - CC_SAFE_FREE(_quads); - CC_SAFE_FREE(_indices); + AX_SAFE_FREE(_quads); + AX_SAFE_FREE(_indices); return false; } @@ -856,8 +856,8 @@ void ParticleSystemQuad::setBatchNode(ParticleBatchNode* batchNode) V3F_C4B_T2F_Quad* quad = &(batchQuads[_atlasIndex]); memcpy(quad, _quads, _totalParticles * sizeof(_quads[0])); - CC_SAFE_FREE(_quads); - CC_SAFE_FREE(_indices); + AX_SAFE_FREE(_quads); + AX_SAFE_FREE(_indices); } } } @@ -870,7 +870,7 @@ ParticleSystemQuad* ParticleSystemQuad::create() particleSystemQuad->autorelease(); return particleSystemQuad; } - CC_SAFE_DELETE(particleSystemQuad); + AX_SAFE_DELETE(particleSystemQuad); return nullptr; } diff --git a/core/2d/CCParticleSystemQuad.h b/core/2d/CCParticleSystemQuad.h index a84eb4c3a0..6ee53372f9 100644 --- a/core/2d/CCParticleSystemQuad.h +++ b/core/2d/CCParticleSystemQuad.h @@ -55,7 +55,7 @@ Special features and Limitations: @since v0.8 @js NA */ -class CC_DLL ParticleSystemQuad : public ParticleSystem +class AX_DLL ParticleSystemQuad : public ParticleSystem { public: /** Creates a Particle Emitter. @@ -176,7 +176,7 @@ protected: backend::UniformLocation _textureLocation; private: - CC_DISALLOW_COPY_AND_ASSIGN(ParticleSystemQuad); + AX_DISALLOW_COPY_AND_ASSIGN(ParticleSystemQuad); }; // end of _2d group diff --git a/core/2d/CCPlistSpriteSheetLoader.cpp b/core/2d/CCPlistSpriteSheetLoader.cpp index af98e06652..b7415db851 100644 --- a/core/2d/CCPlistSpriteSheetLoader.cpp +++ b/core/2d/CCPlistSpriteSheetLoader.cpp @@ -317,7 +317,7 @@ void PlistSpriteSheetLoader::addSpriteFramesWithDictionary(ValueMap& dictionary, spriteSheet->full = true; - CC_SAFE_DELETE(image); + AX_SAFE_DELETE(image); } void PlistSpriteSheetLoader::addSpriteFramesWithDictionary(ValueMap& dict, diff --git a/core/2d/CCProgressTimer.cpp b/core/2d/CCProgressTimer.cpp index c1adb585b6..6a0e30279e 100644 --- a/core/2d/CCProgressTimer.cpp +++ b/core/2d/CCProgressTimer.cpp @@ -53,7 +53,7 @@ backend::ProgramState* initPipelineDescriptor(axis::CustomCommand& command, auto& pipelieDescriptor = command.getPipelineDescriptor(); auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE_COLOR); auto programState = new backend::ProgramState(program); - CC_SAFE_RELEASE(pipelieDescriptor.programState); + AX_SAFE_RELEASE(pipelieDescriptor.programState); pipelieDescriptor.programState = programState; // set vertexLayout according to V2F_C4B_T2F structure @@ -117,7 +117,7 @@ bool ProgressTimer::initWithSprite(Sprite* sp) setSprite(sp); // TODO: Use ProgramState Vector to Node - CC_SAFE_RELEASE(_programState2); + AX_SAFE_RELEASE(_programState2); setProgramState(initPipelineDescriptor(_customCommand, true, _locMVP1, _locTex1), false); _programState2 = initPipelineDescriptor(_customCommand2, false, _locMVP2, _locTex2); @@ -126,8 +126,8 @@ bool ProgressTimer::initWithSprite(Sprite* sp) ProgressTimer::~ProgressTimer() { - CC_SAFE_RELEASE(_sprite); - CC_SAFE_RELEASE(_programState2); + AX_SAFE_RELEASE(_sprite); + AX_SAFE_RELEASE(_programState2); } void ProgressTimer::setPercentage(float percentage) @@ -143,7 +143,7 @@ void ProgressTimer::setSprite(Sprite* sprite) { if (_sprite != sprite) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -152,9 +152,9 @@ void ProgressTimer::setSprite(Sprite* sprite) if (sprite) sEngine->retainScriptObject(this, sprite); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS - CC_SAFE_RETAIN(sprite); - CC_SAFE_RELEASE(_sprite); +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS + AX_SAFE_RETAIN(sprite); + AX_SAFE_RELEASE(_sprite); _sprite = sprite; setContentSize(_sprite->getContentSize()); diff --git a/core/2d/CCProgressTimer.h b/core/2d/CCProgressTimer.h index ff2591db31..073f44b123 100644 --- a/core/2d/CCProgressTimer.h +++ b/core/2d/CCProgressTimer.h @@ -48,7 +48,7 @@ class Sprite; * The progress can be Radial, Horizontal or vertical. * @since v0.99.1 */ -class CC_DLL ProgressTimer : public Node +class AX_DLL ProgressTimer : public Node { public: /** Types of progress @@ -201,7 +201,7 @@ protected: backend::UniformLocation _locTex2; private: - CC_DISALLOW_COPY_AND_ASSIGN(ProgressTimer); + AX_DISALLOW_COPY_AND_ASSIGN(ProgressTimer); }; // end of misc_nodes group diff --git a/core/2d/CCProtectedNode.cpp b/core/2d/CCProtectedNode.cpp index 728e13977b..ab18a6cfa0 100644 --- a/core/2d/CCProtectedNode.cpp +++ b/core/2d/CCProtectedNode.cpp @@ -51,7 +51,7 @@ ProtectedNode* ProtectedNode::create() } else { - CC_SAFE_DELETE(ret); + AX_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 != CC_INVALID_INDEX) + if (index != AX_INVALID_INDEX) { // IMPORTANT: @@ -163,13 +163,13 @@ void ProtectedNode::removeProtectedChild(axis::Node* child, bool cleanup) // set parent nil at the end child->setParent(nullptr); -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, child); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _protectedChildren.erase(index); } } @@ -197,13 +197,13 @@ void ProtectedNode::removeAllProtectedChildrenWithCleanup(bool cleanup) { child->cleanup(); } -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, child); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS // set parent nil at the end child->setParent(nullptr); } @@ -230,13 +230,13 @@ void ProtectedNode::removeProtectedChildByTag(int tag, bool cleanup) // helper used by reorderChild & add void ProtectedNode::insertProtectedChild(axis::Node* child, int z) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, child); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _reorderProtectedChildDirty = true; _protectedChildren.pushBack(child); child->setLocalZOrder(z); diff --git a/core/2d/CCProtectedNode.h b/core/2d/CCProtectedNode.h index 8259da729d..76fd415be9 100644 --- a/core/2d/CCProtectedNode.h +++ b/core/2d/CCProtectedNode.h @@ -43,7 +43,7 @@ NS_AX_BEGIN *@brief A inner node type mainly used for UI module. * It is useful for composing complex node type and it's children are protected. */ -class CC_DLL ProtectedNode : public Node +class AX_DLL ProtectedNode : public Node { public: /** @@ -199,7 +199,7 @@ protected: bool _reorderProtectedChildDirty; private: - CC_DISALLOW_COPY_AND_ASSIGN(ProtectedNode); + AX_DISALLOW_COPY_AND_ASSIGN(ProtectedNode); }; // end of 2d group diff --git a/core/2d/CCRenderTexture.cpp b/core/2d/CCRenderTexture.cpp index d56e10d399..14da71e21b 100644 --- a/core/2d/CCRenderTexture.cpp +++ b/core/2d/CCRenderTexture.cpp @@ -45,39 +45,39 @@ NS_AX_BEGIN // implementation RenderTexture RenderTexture::RenderTexture() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // Listen this event to save render texture before come to background. // Then it can be restored after coming to foreground on Android. auto toBackgroundListener = - EventListenerCustom::create(EVENT_COME_TO_BACKGROUND, CC_CALLBACK_1(RenderTexture::listenToBackground, this)); + EventListenerCustom::create(EVENT_COME_TO_BACKGROUND, AX_CALLBACK_1(RenderTexture::listenToBackground, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(toBackgroundListener, this); auto toForegroundListener = - EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(RenderTexture::listenToForeground, this)); + EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, AX_CALLBACK_1(RenderTexture::listenToForeground, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(toForegroundListener, this); #endif } RenderTexture::~RenderTexture() { - CC_SAFE_RELEASE(_renderTarget); - CC_SAFE_RELEASE(_sprite); - CC_SAFE_RELEASE(_depthStencilTexture); - CC_SAFE_RELEASE(_UITextureImage); + AX_SAFE_RELEASE(_renderTarget); + AX_SAFE_RELEASE(_sprite); + AX_SAFE_RELEASE(_depthStencilTexture); + AX_SAFE_RELEASE(_UITextureImage); } void RenderTexture::listenToBackground(EventCustom* /*event*/) { // We have not found a way to dispatch the enter background message before the texture data are destroyed. // So we disable this pair of message handler at present. -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // to get the rendered texture data auto func = [&](Image* uiTextureImage) { if (uiTextureImage) { - CC_SAFE_RELEASE(_UITextureImage); + AX_SAFE_RELEASE(_UITextureImage); _UITextureImage = uiTextureImage; - CC_SAFE_RETAIN(_UITextureImage); + AX_SAFE_RETAIN(_UITextureImage); const Vec2& s = _texture2D->getContentSizeInPixels(); VolatileTextureMgr::addDataTexture(_texture2D, uiTextureImage->getData(), s.width * s.height * 4, backend::PixelFormat::RGBA8, s); @@ -86,7 +86,7 @@ void RenderTexture::listenToBackground(EventCustom* /*event*/) { CCLOG("Cache rendertexture failed!"); } - CC_SAFE_RELEASE(uiTextureImage); + AX_SAFE_RELEASE(uiTextureImage); }; auto callback = std::bind(func, std::placeholders::_1); newImage(callback, false); @@ -96,7 +96,7 @@ void RenderTexture::listenToBackground(EventCustom* /*event*/) void RenderTexture::listenToForeground(EventCustom* /*event*/) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA const Vec2& s = _texture2D->getContentSizeInPixels(); // TODO new-renderer: field _depthAndStencilFormat removal // if (_depthAndStencilFormat != 0) @@ -117,7 +117,7 @@ RenderTexture* RenderTexture::create(int w, int h, backend::PixelFormat eFormat, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -130,7 +130,7 @@ RenderTexture* RenderTexture::create(int w, int h, backend::PixelFormat eFormat, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -143,7 +143,7 @@ RenderTexture* RenderTexture::create(int w, int h, bool sharedRenderTarget) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -164,8 +164,8 @@ bool RenderTexture::initWithWidthAndHeight(int w, do { _fullRect = _rtTextureRect = Rect(0, 0, w, h); - w = (int)(w * CC_CONTENT_SCALE_FACTOR()); - h = (int)(h * CC_CONTENT_SCALE_FACTOR()); + w = (int)(w * AX_CONTENT_SCALE_FACTOR()); + h = (int)(h * AX_CONTENT_SCALE_FACTOR()); _fullviewPort = Rect(0, 0, w, h); // textures must be power of two squared @@ -189,7 +189,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, descriptor.textureUsage = TextureUsage::RENDER_TARGET; descriptor.textureFormat = PixelFormat::RGBA8; _texture2D = new Texture2D(); - _texture2D->updateTextureDescriptor(descriptor, !!CC_ENABLE_PREMULTIPLIED_ALPHA); + _texture2D->updateTextureDescriptor(descriptor, !!AX_ENABLE_PREMULTIPLIED_ALPHA); _renderTargetFlags = RenderTargetFlag::COLOR; if (PixelFormat::D24S8 == depthStencilFormat) @@ -201,7 +201,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, _depthStencilTexture->updateTextureDescriptor(descriptor); } - CC_SAFE_RELEASE(_renderTarget); + AX_SAFE_RELEASE(_renderTarget); if (sharedRenderTarget) { @@ -229,7 +229,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, // retained setSprite(Sprite::createWithTexture(_texture2D)); -#if defined(CC_USE_GL) || defined(CC_USE_GLES) +#if defined(AX_USE_GL) || defined(AX_USE_GLES) _sprite->setFlippedY(true); #endif @@ -260,7 +260,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, void RenderTexture::setSprite(Sprite* sprite) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -269,9 +269,9 @@ void RenderTexture::setSprite(Sprite* sprite) if (_sprite) sEngine->releaseScriptObject(this, _sprite); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS - CC_SAFE_RETAIN(sprite); - CC_SAFE_RELEASE(_sprite); +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS + AX_SAFE_RETAIN(sprite); + AX_SAFE_RELEASE(_sprite); _sprite = sprite; } @@ -430,7 +430,7 @@ bool RenderTexture::saveToFileAsNonPMA(std::string_view fileName, auto renderer = _director->getRenderer(); auto saveToFileCommand = renderer->nextCallbackCommand(); saveToFileCommand->init(_globalZOrder); - saveToFileCommand->func = CC_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, true); + saveToFileCommand->func = AX_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, true); renderer->addCommand(saveToFileCommand); return true; @@ -453,7 +453,7 @@ bool RenderTexture::saveToFile(std::string_view fileName, auto renderer = _director->getRenderer(); auto saveToFileCommand = renderer->nextCallbackCommand(); saveToFileCommand->init(_globalZOrder); - saveToFileCommand->func = CC_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, false); + saveToFileCommand->func = AX_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA, false); _director->getRenderer()->addCommand(saveToFileCommand); return true; @@ -619,7 +619,7 @@ void RenderTexture::begin() auto beginCommand = renderer->nextCallbackCommand(); beginCommand->init(_globalZOrder); - beginCommand->func = CC_CALLBACK_0(RenderTexture::onBegin, this); + beginCommand->func = AX_CALLBACK_0(RenderTexture::onBegin, this); renderer->addCommand(beginCommand); } @@ -629,7 +629,7 @@ void RenderTexture::end() auto endCommand = renderer->nextCallbackCommand(); endCommand->init(_globalZOrder); - endCommand->func = CC_CALLBACK_0(RenderTexture::onEnd, this); + endCommand->func = AX_CALLBACK_0(RenderTexture::onEnd, this); renderer->addCommand(endCommand); renderer->popGroup(); diff --git a/core/2d/CCRenderTexture.h b/core/2d/CCRenderTexture.h index 6137342dcc..e90f494582 100644 --- a/core/2d/CCRenderTexture.h +++ b/core/2d/CCRenderTexture.h @@ -58,7 +58,7 @@ class EventCustom; * There are also functions for saving the render texture to disk in PNG or JPG format. * @since v0.8.1 */ -class CC_DLL RenderTexture : public Node +class AX_DLL RenderTexture : public Node { public: using SaveFileCallbackType = std::function; @@ -430,7 +430,7 @@ protected: Mat4 _transformMatrix, _projectionMatrix; private: - CC_DISALLOW_COPY_AND_ASSIGN(RenderTexture); + AX_DISALLOW_COPY_AND_ASSIGN(RenderTexture); }; // end of textures group diff --git a/core/2d/CCScene.cpp b/core/2d/CCScene.cpp index 7b547d97d5..8c70db3621 100644 --- a/core/2d/CCScene.cpp +++ b/core/2d/CCScene.cpp @@ -34,16 +34,16 @@ THE SOFTWARE. #include "base/ccUTF8.h" #include "renderer/CCRenderer.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "physics/CCPhysicsWorld.h" #endif -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION # include "physics3d/CCPhysics3DWorld.h" # include "physics3d/CCPhysics3DComponent.h" #endif -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "navmesh/CCNavMesh.h" #endif @@ -64,36 +64,36 @@ Scene::Scene() Scene::~Scene() { -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION - CC_SAFE_RELEASE(_physics3DWorld); - CC_SAFE_RELEASE(_physics3dDebugCamera); +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION + AX_SAFE_RELEASE(_physics3DWorld); + AX_SAFE_RELEASE(_physics3dDebugCamera); #endif -#if CC_USE_NAVMESH - CC_SAFE_RELEASE(_navMesh); +#if AX_USE_NAVMESH + AX_SAFE_RELEASE(_navMesh); #endif _director->getEventDispatcher()->removeEventListener(_event); - CC_SAFE_RELEASE(_event); + AX_SAFE_RELEASE(_event); -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS delete _physicsWorld; #endif -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseAllChildrenRecursive(this); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS } -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH void Scene::setNavMesh(NavMesh* navMesh) { if (_navMesh != navMesh) { - CC_SAFE_RETAIN(navMesh); - CC_SAFE_RELEASE(_navMesh); + AX_SAFE_RETAIN(navMesh); + AX_SAFE_RELEASE(_navMesh); _navMesh = navMesh; } } @@ -131,7 +131,7 @@ Scene* Scene::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } } @@ -146,7 +146,7 @@ Scene* Scene::createWithSize(const Vec2& size) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } } @@ -215,7 +215,7 @@ void Scene::render(Renderer* renderer, const Mat4& eyeTransform, const Mat4* eye camera->clearBackground(); // visit the scene visit(renderer, transform, 0); -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH if (_navMesh && _navMeshDebugCamera == camera) { _navMesh->debugDraw(renderer); @@ -231,7 +231,7 @@ void Scene::render(Renderer* renderer, const Mat4& eyeTransform, const Mat4* eye // camera->setNodeToParentTransform(eyeCopy); } -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION if (_physics3DWorld && _physics3DWorld->isDebugDrawEnabled()) { Camera* physics3dDebugCamera = _physics3dDebugCamera != nullptr ? _physics3dDebugCamera : defaultCamera; @@ -272,26 +272,26 @@ void Scene::removeAllChildren() } } -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION void Scene::setPhysics3DDebugCamera(Camera* camera) { - CC_SAFE_RETAIN(camera); - CC_SAFE_RELEASE(_physics3dDebugCamera); + AX_SAFE_RETAIN(camera); + AX_SAFE_RELEASE(_physics3dDebugCamera); _physics3dDebugCamera = camera; } #endif -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH void Scene::setNavMeshDebugCamera(Camera* camera) { - CC_SAFE_RETAIN(camera); - CC_SAFE_RELEASE(_navMeshDebugCamera); + AX_SAFE_RETAIN(camera); + AX_SAFE_RELEASE(_navMeshDebugCamera); _navMeshDebugCamera = camera; } #endif -#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION)) +#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION)) Scene* Scene::createWithPhysics() { @@ -303,7 +303,7 @@ Scene* Scene::createWithPhysics() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } } @@ -316,7 +316,7 @@ bool Scene::initWithPhysics() bool Scene::initPhysicsWorld() { -# if CC_USE_PHYSICS +# if AX_USE_PHYSICS _physicsWorld = PhysicsWorld::construct(this); # endif @@ -325,9 +325,9 @@ bool Scene::initPhysicsWorld() { this->setContentSize(_director->getWinSize()); -# if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +# if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION Physics3DWorldDes info; - CC_BREAK_IF(!(_physics3DWorld = Physics3DWorld::create(&info))); + AX_BREAK_IF(!(_physics3DWorld = Physics3DWorld::create(&info))); _physics3DWorld->retain(); # endif @@ -339,21 +339,21 @@ bool Scene::initPhysicsWorld() #endif -#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION) || CC_USE_NAVMESH) +#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION) || AX_USE_NAVMESH) void Scene::stepPhysicsAndNavigation(float deltaTime) { -# if CC_USE_PHYSICS +# if AX_USE_PHYSICS if (_physicsWorld && _physicsWorld->isAutoStep()) _physicsWorld->update(deltaTime); # endif -# if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +# if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION if (_physics3DWorld) { _physics3DWorld->stepSimulate(deltaTime); } # endif -# if CC_USE_NAVMESH +# if AX_USE_NAVMESH if (_navMesh) { _navMesh->update(deltaTime); diff --git a/core/2d/CCScene.h b/core/2d/CCScene.h index 47d7967282..d22e7da1b5 100644 --- a/core/2d/CCScene.h +++ b/core/2d/CCScene.h @@ -40,13 +40,13 @@ class BaseLight; class Renderer; class EventListenerCustom; class EventCustom; -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS class PhysicsWorld; #endif -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION class Physics3DWorld; #endif -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH class NavMesh; #endif @@ -68,7 +68,7 @@ It is a good practice to use a Scene as the parent of all your nodes. Scene will create a default camera for you. */ -class CC_DLL Scene : public Node +class AX_DLL Scene : public Node { public: /** Creates a new Scene object. @@ -151,11 +151,11 @@ protected: std::vector _lights; private: - CC_DISALLOW_COPY_AND_ASSIGN(Scene); + AX_DISALLOW_COPY_AND_ASSIGN(Scene); -#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION)) +#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION)) public: -# if CC_USE_PHYSICS +# if AX_USE_PHYSICS /** Get the physics world of the scene. * @return The physics world of the scene. * @js NA @@ -163,7 +163,7 @@ public: PhysicsWorld* getPhysicsWorld() const { return _physicsWorld; } # endif -# if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +# if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION /** Get the 3d physics world of the scene. * @return The 3d physics world of the scene. * @js NA @@ -189,17 +189,17 @@ public: protected: void addChildToPhysicsWorld(Node* child); -# if CC_USE_PHYSICS +# if AX_USE_PHYSICS PhysicsWorld* _physicsWorld = nullptr; # endif -# if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +# if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION Physics3DWorld* _physics3DWorld = nullptr; Camera* _physics3dDebugCamera = nullptr; # endif -#endif // (CC_USE_PHYSICS || CC_USE_3D_PHYSICS) +#endif // (AX_USE_PHYSICS || AX_USE_3D_PHYSICS) -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH public: /** set navigation mesh */ void setNavMesh(NavMesh* navMesh); @@ -215,7 +215,7 @@ protected: Camera* _navMeshDebugCamera = nullptr; #endif -#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION) || CC_USE_NAVMESH) +#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION) || AX_USE_NAVMESH) public: void stepPhysicsAndNavigation(float deltaTime); #endif diff --git a/core/2d/CCSprite.cpp b/core/2d/CCSprite.cpp index e09e8f6aa4..89ec39279e 100644 --- a/core/2d/CCSprite.cpp +++ b/core/2d/CCSprite.cpp @@ -57,7 +57,7 @@ Sprite* Sprite::createWithTexture(Texture2D* texture) sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -69,7 +69,7 @@ Sprite* Sprite::createWithTexture(Texture2D* texture, const Rect& rect, bool rot sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -86,7 +86,7 @@ Sprite* Sprite::create(std::string_view filename, PixelFormat format) sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -98,7 +98,7 @@ Sprite* Sprite::create(const PolygonInfo& info) sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -110,7 +110,7 @@ Sprite* Sprite::create(std::string_view filename, const Rect& rect) sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -122,7 +122,7 @@ Sprite* Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame) sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -147,7 +147,7 @@ Sprite* Sprite::create() sprite->autorelease(); return sprite; } - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); return nullptr; } @@ -307,18 +307,18 @@ bool Sprite::initWithTexture(Texture2D* texture, const Rect& rect, bool rotated) Sprite::Sprite() { -#if CC_SPRITE_DEBUG_DRAW +#if AX_SPRITE_DEBUG_DRAW _debugDrawNode = DrawNode::create(); addChild(_debugDrawNode); -#endif // CC_SPRITE_DEBUG_DRAW +#endif // AX_SPRITE_DEBUG_DRAW } Sprite::~Sprite() { - CC_SAFE_FREE(_trianglesVertex); - CC_SAFE_FREE(_trianglesIndex); - CC_SAFE_RELEASE(_spriteFrame); - CC_SAFE_RELEASE(_texture); + AX_SAFE_FREE(_trianglesVertex); + AX_SAFE_FREE(_trianglesIndex); + AX_SAFE_RELEASE(_spriteFrame); + AX_SAFE_RELEASE(_texture); } /* @@ -340,7 +340,7 @@ static unsigned char cc_2x2_white_image[] = { // RGBA8888 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; -#define CC_2x2_WHITE_IMAGE_KEY "/cc_2x2_white_image" +#define AX_2x2_WHITE_IMAGE_KEY "/cc_2x2_white_image" // MARK: texture void Sprite::setTexture(std::string_view filename) @@ -409,17 +409,17 @@ void Sprite::setTexture(Texture2D* texture) if (texture == nullptr) { // Gets the texture by key firstly. - texture = _director->getTextureCache()->getTextureForKey(CC_2x2_WHITE_IMAGE_KEY); + texture = _director->getTextureCache()->getTextureForKey(AX_2x2_WHITE_IMAGE_KEY); // If texture wasn't in cache, create it from RAW data. if (texture == nullptr) { Image* image = new Image(); - bool CC_UNUSED isOK = image->initWithRawData(cc_2x2_white_image, sizeof(cc_2x2_white_image), 2, 2, 8); + bool AX_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, CC_2x2_WHITE_IMAGE_KEY); - CC_SAFE_RELEASE(image); + texture = _director->getTextureCache()->addImage(image, AX_2x2_WHITE_IMAGE_KEY); + AX_SAFE_RELEASE(image); } } @@ -431,8 +431,8 @@ void Sprite::setTexture(Texture2D* texture) { if (_texture != texture) { - CC_SAFE_RETAIN(texture); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RETAIN(texture); + AX_SAFE_RELEASE(_texture); _texture = texture; } updateBlendFunc(); @@ -817,7 +817,7 @@ void Sprite::setTextureCoords(const Rect& rectInPoints, V3F_C4B_T2F_Quad* outQua if (tex == nullptr) return; - const auto rectInPixels = CC_RECT_POINTS_TO_PIXELS(rectInPoints); + const auto rectInPixels = AX_RECT_POINTS_TO_PIXELS(rectInPoints); const float atlasWidth = (float)tex->getPixelsWide(); const float atlasHeight = (float)tex->getPixelsHigh(); @@ -838,7 +838,7 @@ void Sprite::setTextureCoords(const Rect& rectInPoints, V3F_C4B_T2F_Quad* outQua if (_rectRotated) std::swap(rw, rh); -#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#if AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL float left = (2 * rectInPixels.origin.x + 1) / (2 * atlasWidth); float right = left + (rw * 2 - 2) / (2 * atlasWidth); float top = (2 * rectInPixels.origin.y + 1) / (2 * atlasHeight); @@ -848,7 +848,7 @@ void Sprite::setTextureCoords(const Rect& rectInPoints, V3F_C4B_T2F_Quad* outQua float right = (rectInPixels.origin.x + rw) / atlasWidth; float top = rectInPixels.origin.y / atlasHeight; float bottom = (rectInPixels.origin.y + rh) / atlasHeight; -#endif // CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#endif // AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL if ((!_rectRotated && _flippedX) || (_rectRotated && _flippedY)) std::swap(left, right); @@ -1073,7 +1073,7 @@ void Sprite::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) // TODO: arnold: current camera can be a non-default one. setMVPMatrixUniform(); -#if CC_USE_CULLING +#if AX_USE_CULLING // Don't calculate the culling if the transform was not updated auto visitingCamera = Camera::getVisitingCamera(); auto defaultCamera = Camera::getDefaultCamera(); @@ -1093,7 +1093,7 @@ void Sprite::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) _trianglesCommand.init(_globalZOrder, _texture, _blendFunc, _polyInfo.triangles, transform, flags); renderer->addCommand(&_trianglesCommand); -#if CC_SPRITE_DEBUG_DRAW +#if AX_SPRITE_DEBUG_DRAW _debugDrawNode->clear(); auto count = _polyInfo.triangles.indexCount / 3; auto indices = _polyInfo.triangles.indices; @@ -1113,7 +1113,7 @@ void Sprite::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) to = verts[indices[i * 3]].vertices; _debugDrawNode->drawLine(Vec2(from.x, from.y), Vec2(to.x, to.y), Color4F::WHITE); } -#endif // CC_SPRITE_DEBUG_DRAW +#endif // AX_SPRITE_DEBUG_DRAW } } @@ -1316,7 +1316,7 @@ void Sprite::setScaleX(float scaleX) void Sprite::setScaleY(float scaleY) { -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL if (_texture->isRenderTarget()) scaleY = std::abs(scaleY); #endif @@ -1445,7 +1445,7 @@ bool Sprite::isFlippedX() const void Sprite::setFlippedY(bool flippedY) { -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL if (_texture->isRenderTarget()) flippedY = !flippedY; #endif @@ -1570,7 +1570,7 @@ void Sprite::setSpriteFrame(SpriteFrame* spriteFrame) // do not removed by SpriteFrameCache::removeUnusedSpriteFrames if (_spriteFrame != spriteFrame) { - CC_SAFE_RELEASE(_spriteFrame); + AX_SAFE_RELEASE(_spriteFrame); _spriteFrame = spriteFrame; spriteFrame->retain(); } @@ -1631,9 +1631,9 @@ SpriteFrame* Sprite::getSpriteFrame() const if (nullptr != this->_spriteFrame) return this->_spriteFrame; - return SpriteFrame::createWithTexture(_texture, CC_RECT_POINTS_TO_PIXELS(_rect), _rectRotated, - CC_POINT_POINTS_TO_PIXELS(_unflippedOffsetPositionFromCenter), - CC_SIZE_POINTS_TO_PIXELS(_originalContentSize)); + return SpriteFrame::createWithTexture(_texture, AX_RECT_POINTS_TO_PIXELS(_rect), _rectRotated, + AX_POINT_POINTS_TO_PIXELS(_unflippedOffsetPositionFromCenter), + AX_SIZE_POINTS_TO_PIXELS(_originalContentSize)); } SpriteBatchNode* Sprite::getBatchNode() const diff --git a/core/2d/CCSprite.h b/core/2d/CCSprite.h index 0b30510d35..d0062fcd34 100644 --- a/core/2d/CCSprite.h +++ b/core/2d/CCSprite.h @@ -52,7 +52,7 @@ struct transformValues_; # undef SPRITE_RENDER_IN_SUBPIXEL #endif -#if CC_SPRITEBATCHNODE_RENDER_SUBPIXEL +#if AX_SPRITEBATCHNODE_RENDER_SUBPIXEL # define SPRITE_RENDER_IN_SUBPIXEL #else # define SPRITE_RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__)) @@ -98,7 +98,7 @@ struct transformValues_; * * The default anchorPoint in Sprite is (0.5, 0.5). */ -class CC_DLL Sprite : public Node, public TextureProtocol +class AX_DLL Sprite : public Node, public TextureProtocol { public: enum class RenderMode @@ -660,9 +660,9 @@ protected: TrianglesCommand _trianglesCommand; backend::UniformLocation _mvpMatrixLocation; -#if CC_SPRITE_DEBUG_DRAW +#if AX_SPRITE_DEBUG_DRAW DrawNode* _debugDrawNode = nullptr; -#endif // CC_SPRITE_DEBUG_DRAW +#endif // AX_SPRITE_DEBUG_DRAW // // Shared data // @@ -702,7 +702,7 @@ protected: bool _stretchEnabled = true; private: - CC_DISALLOW_COPY_AND_ASSIGN(Sprite); + AX_DISALLOW_COPY_AND_ASSIGN(Sprite); }; // end of sprite_nodes group diff --git a/core/2d/CCSpriteBatchNode.cpp b/core/2d/CCSpriteBatchNode.cpp index e459a776d1..d0d6e43ae1 100644 --- a/core/2d/CCSpriteBatchNode.cpp +++ b/core/2d/CCSpriteBatchNode.cpp @@ -178,14 +178,14 @@ SpriteBatchNode::SpriteBatchNode() {} SpriteBatchNode::~SpriteBatchNode() { - CC_SAFE_RELEASE(_textureAtlas); + AX_SAFE_RELEASE(_textureAtlas); } // override visit // don't call visit on it's children void SpriteBatchNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t parentFlags) { - CC_PROFILER_START_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); + AX_PROFILER_START_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); // CAREFUL: // This visit is almost identical to CocosNode#visit @@ -218,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); - CC_PROFILER_STOP_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); + AX_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 CC_SPRITE_DEBUG_DRAW - // when using CC_SPRITE_DEBUG_DRAW, a DrawNode is appended to sprites. remove it since only Sprites can be used +#if AX_SPRITE_DEBUG_DRAW + // when using AX_SPRITE_DEBUG_DRAW, a DrawNode is appended to sprites. remove it since only Sprites can be used // as children in SpriteBatchNode // Github issue #14730 if (dynamic_cast(child)) diff --git a/core/2d/CCSpriteBatchNode.h b/core/2d/CCSpriteBatchNode.h index 4cd189adf6..c22d33d3a6 100644 --- a/core/2d/CCSpriteBatchNode.h +++ b/core/2d/CCSpriteBatchNode.h @@ -62,7 +62,7 @@ class Sprite; * * @since v0.7.1 */ -class CC_DLL SpriteBatchNode : public Node, public TextureProtocol +class AX_DLL SpriteBatchNode : public Node, public TextureProtocol { static const int DEFAULT_CAPACITY = 29; @@ -100,8 +100,8 @@ public: { if (textureAtlas != _textureAtlas) { - CC_SAFE_RETAIN(textureAtlas); - CC_SAFE_RELEASE(_textureAtlas); + AX_SAFE_RETAIN(textureAtlas); + AX_SAFE_RELEASE(_textureAtlas); _textureAtlas = textureAtlas; } } diff --git a/core/2d/CCSpriteFrame.cpp b/core/2d/CCSpriteFrame.cpp index 6a31ea18cc..c162563da3 100644 --- a/core/2d/CCSpriteFrame.cpp +++ b/core/2d/CCSpriteFrame.cpp @@ -90,13 +90,13 @@ SpriteFrame::SpriteFrame() : _rotated(false), _texture(nullptr) {} bool SpriteFrame::initWithTexture(Texture2D* texture, const Rect& rect) { - Rect rectInPixels = CC_RECT_POINTS_TO_PIXELS(rect); + Rect rectInPixels = AX_RECT_POINTS_TO_PIXELS(rect); return initWithTexture(texture, rectInPixels, false, Vec2::ZERO, rectInPixels.size); } bool SpriteFrame::initWithTextureFilename(std::string_view filename, const Rect& rect) { - Rect rectInPixels = CC_RECT_POINTS_TO_PIXELS(rect); + Rect rectInPixels = AX_RECT_POINTS_TO_PIXELS(rect); return initWithTextureFilename(filename, rectInPixels, false, Vec2::ZERO, rectInPixels.size); } @@ -114,11 +114,11 @@ bool SpriteFrame::initWithTexture(Texture2D* texture, } _rectInPixels = rect; - _rect = CC_RECT_PIXELS_TO_POINTS(rect); + _rect = AX_RECT_PIXELS_TO_POINTS(rect); _offsetInPixels = offset; - _offset = CC_POINT_PIXELS_TO_POINTS(_offsetInPixels); + _offset = AX_POINT_PIXELS_TO_POINTS(_offsetInPixels); _originalSizeInPixels = originalSize; - _originalSize = CC_SIZE_PIXELS_TO_POINTS(_originalSizeInPixels); + _originalSize = AX_SIZE_PIXELS_TO_POINTS(_originalSizeInPixels); _rotated = rotated; _anchorPoint = Vec2(NAN, NAN); _centerRect = Rect(NAN, NAN, NAN, NAN); @@ -137,11 +137,11 @@ bool SpriteFrame::initWithTextureFilename(std::string_view filename, _texture = nullptr; _textureFilename = filename; _rectInPixels = rect; - _rect = CC_RECT_PIXELS_TO_POINTS(rect); + _rect = AX_RECT_PIXELS_TO_POINTS(rect); _offsetInPixels = offset; - _offset = CC_POINT_PIXELS_TO_POINTS(_offsetInPixels); + _offset = AX_POINT_PIXELS_TO_POINTS(_offsetInPixels); _originalSizeInPixels = originalSize; - _originalSize = CC_SIZE_PIXELS_TO_POINTS(_originalSizeInPixels); + _originalSize = AX_SIZE_PIXELS_TO_POINTS(_originalSizeInPixels); _rotated = rotated; _anchorPoint = Vec2(NAN, NAN); _centerRect = Rect(NAN, NAN, NAN, NAN); @@ -153,7 +153,7 @@ bool SpriteFrame::initWithTextureFilename(std::string_view filename, SpriteFrame::~SpriteFrame() { CCLOGINFO("deallocing SpriteFrame: %p", this); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_texture); } SpriteFrame* SpriteFrame::clone() const @@ -169,18 +169,18 @@ SpriteFrame* SpriteFrame::clone() const void SpriteFrame::setRect(const Rect& rect) { _rect = rect; - _rectInPixels = CC_RECT_POINTS_TO_PIXELS(_rect); + _rectInPixels = AX_RECT_POINTS_TO_PIXELS(_rect); } void SpriteFrame::setRectInPixels(const Rect& rectInPixels) { _rectInPixels = rectInPixels; - _rect = CC_RECT_PIXELS_TO_POINTS(rectInPixels); + _rect = AX_RECT_PIXELS_TO_POINTS(rectInPixels); } void SpriteFrame::setCenterRectInPixels(const Rect& centerRect) { - _centerRect = CC_RECT_PIXELS_TO_POINTS(centerRect); + _centerRect = AX_RECT_PIXELS_TO_POINTS(centerRect); } bool SpriteFrame::hasCenterRect() const @@ -196,7 +196,7 @@ const Vec2& SpriteFrame::getOffset() const void SpriteFrame::setOffset(const Vec2& offsets) { _offset = offsets; - _offsetInPixels = CC_POINT_POINTS_TO_PIXELS(_offset); + _offsetInPixels = AX_POINT_POINTS_TO_PIXELS(_offset); } const Vec2& SpriteFrame::getOffsetInPixels() const @@ -207,7 +207,7 @@ const Vec2& SpriteFrame::getOffsetInPixels() const void SpriteFrame::setOffsetInPixels(const Vec2& offsetInPixels) { _offsetInPixels = offsetInPixels; - _offset = CC_POINT_PIXELS_TO_POINTS(_offsetInPixels); + _offset = AX_POINT_PIXELS_TO_POINTS(_offsetInPixels); } const Vec2& SpriteFrame::getAnchorPoint() const @@ -229,8 +229,8 @@ void SpriteFrame::setTexture(Texture2D* texture) { if (_texture != texture) { - CC_SAFE_RELEASE(_texture); - CC_SAFE_RETAIN(texture); + AX_SAFE_RELEASE(_texture); + AX_SAFE_RETAIN(texture); _texture = texture; } } diff --git a/core/2d/CCSpriteFrame.h b/core/2d/CCSpriteFrame.h index 77b460bd96..efeb30a3f0 100644 --- a/core/2d/CCSpriteFrame.h +++ b/core/2d/CCSpriteFrame.h @@ -56,7 +56,7 @@ class Texture2D; sprite->setSpriteFrame(frame); @endcode */ -class CC_DLL SpriteFrame : public Ref, public Clonable +class AX_DLL SpriteFrame : public Ref, public Clonable { public: /** Create a SpriteFrame with a texture filename, rect in points. diff --git a/core/2d/CCSpriteFrameCache.cpp b/core/2d/CCSpriteFrameCache.cpp index f256b0babe..dfe4fcbeae 100644 --- a/core/2d/CCSpriteFrameCache.cpp +++ b/core/2d/CCSpriteFrameCache.cpp @@ -60,7 +60,7 @@ SpriteFrameCache* SpriteFrameCache::getInstance() void SpriteFrameCache::destroyInstance() { - CC_SAFE_RELEASE_NULL(_sharedSpriteFrameCache); + AX_SAFE_RELEASE_NULL(_sharedSpriteFrameCache); } bool SpriteFrameCache::init() diff --git a/core/2d/CCSpriteFrameCache.h b/core/2d/CCSpriteFrameCache.h index 21650ca919..a06dd5aa55 100644 --- a/core/2d/CCSpriteFrameCache.h +++ b/core/2d/CCSpriteFrameCache.h @@ -88,7 +88,7 @@ class PolygonInfo; @since v0.9 @js cc.spriteFrameCache */ -class CC_DLL SpriteFrameCache : public Ref +class AX_DLL SpriteFrameCache : public Ref { public: /** Returns the shared instance of the Sprite Frame cache. diff --git a/core/2d/CCSpriteSheetLoader.cpp b/core/2d/CCSpriteSheetLoader.cpp index 5a0db4af95..d745d6729e 100644 --- a/core/2d/CCSpriteSheetLoader.cpp +++ b/core/2d/CCSpriteSheetLoader.cpp @@ -16,7 +16,7 @@ void SpriteSheetLoader::initializePolygonInfo(const Vec2& textureSize, const auto vertexCount = vertices.size(); const auto indexCount = triangleIndices.size(); - const auto scaleFactor = CC_CONTENT_SCALE_FACTOR(); + const auto scaleFactor = AX_CONTENT_SCALE_FACTOR(); auto* vertexData = new V3F_C4B_T2F[vertexCount]; for (size_t i = 0; i < vertexCount / 2; i++) diff --git a/core/2d/CCTMXObjectGroup.h b/core/2d/CCTMXObjectGroup.h index 4f4fe76ec5..eaa83831c9 100644 --- a/core/2d/CCTMXObjectGroup.h +++ b/core/2d/CCTMXObjectGroup.h @@ -43,7 +43,7 @@ NS_AX_BEGIN /** @brief TMXObjectGroup represents the TMX object group. * @since v0.99.0 */ -class CC_DLL TMXObjectGroup : public Ref +class AX_DLL TMXObjectGroup : public Ref { public: /** diff --git a/core/2d/CCTMXXMLParser.cpp b/core/2d/CCTMXXMLParser.cpp index f18ea8ada7..9a4bc34f15 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; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -112,7 +112,7 @@ TMXMapInfo* TMXMapInfo::createWithXML(std::string_view tmxString, std::string_vi ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -502,14 +502,14 @@ void TMXMapInfo::startElement(void* /*ctx*/, const char* name, const char** atts Vec2 p(x + objectGroup->getPositionOffset().x, _mapSize.height * _tileSize.height - y - objectGroup->getPositionOffset().y - attributeDict["height"].asInt()); - p = CC_POINT_PIXELS_TO_POINTS(p); + p = AX_POINT_PIXELS_TO_POINTS(p); dict["x"] = Value(p.x); dict["y"] = Value(p.y); int width = attributeDict["width"].asInt(); int height = attributeDict["height"].asInt(); Vec2 s(width, height); - s = CC_SIZE_PIXELS_TO_POINTS(s); + s = AX_SIZE_PIXELS_TO_POINTS(s); dict["width"] = Value(s.width); dict["height"] = Value(s.height); @@ -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 CC_UNUSED inflatedLen = ZipUtils::inflateMemoryWithHint(buffer, len, &deflated, sizeHint); + ssize_t AX_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 3afe4de1e8..084a51ac65 100644 --- a/core/2d/CCTMXXMLParser.h +++ b/core/2d/CCTMXXMLParser.h @@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_TM_XML_PARSER__ -#define __CC_TM_XML_PARSER__ +#ifndef __AX_TM_XML_PARSER__ +#define __AX_TM_XML_PARSER__ /// @cond DO_NOT_SHOW @@ -134,7 +134,7 @@ enum This information is obtained from the TMX file. */ -struct CC_DLL TMXTileAnimFrame +struct AX_DLL TMXTileAnimFrame { TMXTileAnimFrame(uint32_t tileID, float duration); /** gid of the frame */ @@ -149,7 +149,7 @@ struct CC_DLL TMXTileAnimFrame This information is obtained from the TMX file. */ -struct CC_DLL TMXTileAnimInfo : public Ref +struct AX_DLL TMXTileAnimInfo : public Ref { static TMXTileAnimInfo* create(uint32_t tileID); explicit TMXTileAnimInfo(uint32_t tileID); @@ -167,7 +167,7 @@ struct CC_DLL TMXTileAnimInfo : public Ref This information is obtained from the TMX file. */ -class CC_DLL TMXLayerInfo : public Ref +class AX_DLL TMXLayerInfo : public Ref { public: /** @@ -203,7 +203,7 @@ public: This information is obtained from the TMX file. */ -class CC_DLL TMXTilesetInfo : public Ref +class AX_DLL TMXTilesetInfo : public Ref { public: std::string _name; @@ -246,7 +246,7 @@ And it also contains: This information is obtained from the TMX file. */ -class CC_DLL TMXMapInfo : public Ref, public SAXDelegator +class AX_DLL TMXMapInfo : public Ref, public SAXDelegator { public: /** creates a TMX Format with a tmx file */ diff --git a/core/2d/CCTextFieldTTF.cpp b/core/2d/CCTextFieldTTF.cpp index ed44395d5c..dc59873acb 100644 --- a/core/2d/CCTextFieldTTF.cpp +++ b/core/2d/CCTextFieldTTF.cpp @@ -42,7 +42,7 @@ static std::size_t _calcCharCount(const char* text) char ch = 0; while ((ch = *text)) { - CC_BREAK_IF(!ch); + AX_BREAK_IF(!ch); if (0x80 != (0xC0 & ch)) { @@ -125,7 +125,7 @@ TextFieldTTF* TextFieldTTF::textFieldWithPlaceHolder(std::string_view placeholde } return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -143,7 +143,7 @@ TextFieldTTF* TextFieldTTF::textFieldWithPlaceHolder(std::string_view placeholde } return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -186,8 +186,8 @@ bool TextFieldTTF::initWithPlaceHolder(std::string_view placeholder, std::string setTextColorInternally(_colorSpaceHolder); Label::setString(_placeHolder); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ - CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ + AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) // On desktop default enable cursor if (_currentLabelType == LabelType::TTF) { diff --git a/core/2d/CCTextFieldTTF.h b/core/2d/CCTextFieldTTF.h index cb0d8f7704..744a9db8fd 100644 --- a/core/2d/CCTextFieldTTF.h +++ b/core/2d/CCTextFieldTTF.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_TEXT_FIELD_H__ -#define __CC_TEXT_FIELD_H__ +#ifndef __AX_TEXT_FIELD_H__ +#define __AX_TEXT_FIELD_H__ #include "2d/CCLabel.h" #include "base/CCIMEDelegate.h" @@ -41,7 +41,7 @@ class TextFieldTTF; /** * A input protocol for TextField. */ -class CC_DLL TextFieldDelegate +class AX_DLL TextFieldDelegate { public: /** @@ -79,7 +79,7 @@ public: /** *@brief A simple text input field with TTF font. */ -class CC_DLL TextFieldTTF : public Label, public IMEDelegate +class AX_DLL TextFieldTTF : public Label, public IMEDelegate { public: /** @@ -300,4 +300,4 @@ NS_AX_END // end of ui group /// @} -#endif // __CC_TEXT_FIELD_H__ +#endif // __AX_TEXT_FIELD_H__ diff --git a/core/2d/CCTileMapAtlas.cpp b/core/2d/CCTileMapAtlas.cpp index d860eb00be..5b658d9b60 100644 --- a/core/2d/CCTileMapAtlas.cpp +++ b/core/2d/CCTileMapAtlas.cpp @@ -44,7 +44,7 @@ TileMapAtlas* TileMapAtlas::create(std::string_view tile, std::string_view mapFi ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -171,10 +171,10 @@ void TileMapAtlas::updateAtlasValueAt(const Vec2& pos, const Color3B& value, int float textureWide = (float)(_textureAtlas->getTexture()->getPixelsWide()); float textureHigh = (float)(_textureAtlas->getTexture()->getPixelsHigh()); - float itemWidthInPixels = _itemWidth * CC_CONTENT_SCALE_FACTOR(); - float itemHeightInPixels = _itemHeight * CC_CONTENT_SCALE_FACTOR(); + float itemWidthInPixels = _itemWidth * AX_CONTENT_SCALE_FACTOR(); + float itemHeightInPixels = _itemHeight * AX_CONTENT_SCALE_FACTOR(); -#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#if AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL float left = (2 * row * itemWidthInPixels + 1) / (2 * textureWide); float right = left + (itemWidthInPixels * 2 - 2) / (2 * textureWide); float top = (2 * col * itemHeightInPixels + 1) / (2 * textureHigh); diff --git a/core/2d/CCTileMapAtlas.h b/core/2d/CCTileMapAtlas.h index 97d529f9a5..fae1197ac3 100644 --- a/core/2d/CCTileMapAtlas.h +++ b/core/2d/CCTileMapAtlas.h @@ -53,7 +53,7 @@ You SHOULD not use this class. Instead, use the newer TMX file format: TMXTiledMap @js NA */ -class CC_DLL TileMapAtlas : public AtlasNode +class AX_DLL TileMapAtlas : public AtlasNode { public: /** creates a TileMap with a tile file (atlas) with a map file and the width and height of each tile in points. diff --git a/core/2d/CCTransition.cpp b/core/2d/CCTransition.cpp index 3fc8f6e519..b466102185 100644 --- a/core/2d/CCTransition.cpp +++ b/core/2d/CCTransition.cpp @@ -49,8 +49,8 @@ TransitionScene::TransitionScene() TransitionScene::~TransitionScene() { - CC_SAFE_RELEASE(_inScene); - CC_SAFE_RELEASE(_outScene); + AX_SAFE_RELEASE(_inScene); + AX_SAFE_RELEASE(_outScene); } TransitionScene* TransitionScene::create(float t, Scene* scene) @@ -61,7 +61,7 @@ TransitionScene* TransitionScene::create(float t, Scene* scene) pScene->autorelease(); return pScene; } - CC_SAFE_DELETE(pScene); + AX_SAFE_DELETE(pScene); return nullptr; } @@ -74,13 +74,13 @@ bool TransitionScene::initWithDuration(float t, Scene* scene) _duration = t; // retain -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, scene); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _inScene = scene; _inScene->retain(); _outScene = _director->getRunningScene(); @@ -142,24 +142,24 @@ void TransitionScene::finish() _outScene->setAdditionalTransform(nullptr); //[self schedule:@selector(setNewScene:) interval:0]; - this->schedule(CC_SCHEDULE_SELECTOR(TransitionScene::setNewScene), 0); + this->schedule(AX_SCHEDULE_SELECTOR(TransitionScene::setNewScene), 0); } void TransitionScene::setNewScene(float /*dt*/) { - this->unschedule(CC_SCHEDULE_SELECTOR(TransitionScene::setNewScene)); + this->unschedule(AX_SCHEDULE_SELECTOR(TransitionScene::setNewScene)); // Before replacing, save the "send cleanup to scene" _isSendCleanupToScene = _director->isSendCleanupToScene(); _director->replaceScene(_inScene); -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, _inScene); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS // issue #267 _outScene->setVisible(true); @@ -199,10 +199,10 @@ void TransitionScene::onExit() // only the onEnterTransitionDidFinish _inScene->onEnterTransitionDidFinish(); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING if (ScriptEngineManager::getInstance()->getScriptEngine()) ScriptEngineManager::getInstance()->getScriptEngine()->garbageCollect(); -#endif // CC_ENABLE_SCRIPT_BINDING +#endif // AX_ENABLE_SCRIPT_BINDING } // custom cleanup @@ -252,7 +252,7 @@ TransitionRotoZoom* TransitionRotoZoom::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -274,7 +274,7 @@ void TransitionRotoZoom::onEnter() _outScene->runAction(rotozoom); _inScene->runAction( - Sequence::create(rotozoom->reverse(), CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr)); + Sequence::create(rotozoom->reverse(), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); } // @@ -291,7 +291,7 @@ TransitionJumpZoom* TransitionJumpZoom::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -316,7 +316,7 @@ void TransitionJumpZoom::onEnter() _outScene->runAction(jumpZoomOut); _inScene->runAction( - Sequence::create(delay, jumpZoomIn, CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr)); + Sequence::create(delay, jumpZoomIn, CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); } // @@ -334,7 +334,7 @@ TransitionMoveInL* TransitionMoveInL::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -346,7 +346,7 @@ void TransitionMoveInL::onEnter() ActionInterval* a = this->action(); _inScene->runAction(Sequence::create(this->easeActionWithAction(a), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr)); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); } ActionInterval* TransitionMoveInL::action() @@ -380,7 +380,7 @@ TransitionMoveInR* TransitionMoveInR::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -404,7 +404,7 @@ TransitionMoveInT* TransitionMoveInT::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -428,7 +428,7 @@ TransitionMoveInB* TransitionMoveInB::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -461,7 +461,7 @@ void TransitionSlideInL::onEnter() ActionInterval* inAction = easeActionWithAction(in); ActionInterval* outAction = Sequence::create( - easeActionWithAction(out), CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + easeActionWithAction(out), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); _inScene->runAction(inAction); _outScene->runAction(outAction); } @@ -496,7 +496,7 @@ TransitionSlideInL* TransitionSlideInL::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -514,7 +514,7 @@ TransitionSlideInR* TransitionSlideInR::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -549,7 +549,7 @@ TransitionSlideInT* TransitionSlideInT::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -584,7 +584,7 @@ TransitionSlideInB* TransitionSlideInB::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -619,7 +619,7 @@ TransitionShrinkGrow* TransitionShrinkGrow::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -638,7 +638,7 @@ void TransitionShrinkGrow::onEnter() _inScene->runAction(this->easeActionWithAction(scaleIn)); _outScene->runAction(Sequence::create(this->easeActionWithAction(scaleOut), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr)); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); } ActionInterval* TransitionShrinkGrow::easeActionWithAction(ActionInterval* action) { @@ -678,7 +678,7 @@ void TransitionFlipX::onEnter() auto inA = Sequence::create(DelayTime::create(_duration / 2), Show::create(), OrbitCamera::create(_duration / 2, 1, 0, inAngleZ, inDeltaZ, 0, 0), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); auto outA = Sequence::create(OrbitCamera::create(_duration / 2, 1, 0, outAngleZ, outDeltaZ, 0, 0), Hide::create(), DelayTime::create(_duration / 2), nullptr); @@ -733,7 +733,7 @@ void TransitionFlipY::onEnter() auto inA = Sequence::create(DelayTime::create(_duration / 2), Show::create(), OrbitCamera::create(_duration / 2, 1, 0, inAngleZ, inDeltaZ, 90, 0), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); auto outA = Sequence::create(OrbitCamera::create(_duration / 2, 1, 0, outAngleZ, outDeltaZ, 90, 0), Hide::create(), DelayTime::create(_duration / 2), nullptr); @@ -788,7 +788,7 @@ void TransitionFlipAngular::onEnter() auto inA = Sequence::create(DelayTime::create(_duration / 2), Show::create(), OrbitCamera::create(_duration / 2, 1, 0, inAngleZ, inDeltaZ, -45, 0), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); auto outA = Sequence::create(OrbitCamera::create(_duration / 2, 1, 0, outAngleZ, outDeltaZ, 45, 0), Hide::create(), DelayTime::create(_duration / 2), nullptr); @@ -842,7 +842,7 @@ void TransitionZoomFlipX::onEnter() auto inA = Sequence::create(DelayTime::create(_duration / 2), Spawn::create(OrbitCamera::create(_duration / 2, 1, 0, inAngleZ, inDeltaZ, 0, 0), ScaleTo::create(_duration / 2, 1), Show::create(), nullptr), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); auto outA = Sequence::create(Spawn::create(OrbitCamera::create(_duration / 2, 1, 0, outAngleZ, outDeltaZ, 0, 0), ScaleTo::create(_duration / 2, 0.5f), nullptr), Hide::create(), DelayTime::create(_duration / 2), nullptr); @@ -900,7 +900,7 @@ void TransitionZoomFlipY::onEnter() auto inA = Sequence::create(DelayTime::create(_duration / 2), Spawn::create(OrbitCamera::create(_duration / 2, 1, 0, inAngleZ, inDeltaZ, 90, 0), ScaleTo::create(_duration / 2, 1), Show::create(), nullptr), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); auto outA = Sequence::create(Spawn::create(OrbitCamera::create(_duration / 2, 1, 0, outAngleZ, outDeltaZ, 90, 0), ScaleTo::create(_duration / 2, 0.5f), nullptr), @@ -959,7 +959,7 @@ void TransitionZoomFlipAngular::onEnter() Sequence::create(DelayTime::create(_duration / 2), Spawn::create(OrbitCamera::create(_duration / 2, 1, 0, inAngleZ, inDeltaZ, -45, 0), ScaleTo::create(_duration / 2, 1), Show::create(), nullptr), - Show::create(), CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + Show::create(), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); auto outA = Sequence::create(Spawn::create(OrbitCamera::create(_duration / 2, 1, 0, outAngleZ, outDeltaZ, 45, 0), ScaleTo::create(_duration / 2, 0.5f), nullptr), Hide::create(), DelayTime::create(_duration / 2), nullptr); @@ -1031,8 +1031,8 @@ void TransitionFade ::onEnter() Node* f = getChildByTag(kSceneFade); auto a = Sequence::create( - FadeIn::create(_duration / 2), CallFunc::create(CC_CALLBACK_0(TransitionScene::hideOutShowIn, this)), - FadeOut::create(_duration / 2), CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), + FadeIn::create(_duration / 2), CallFunc::create(AX_CALLBACK_0(TransitionScene::hideOutShowIn, this)), + FadeOut::create(_duration / 2), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); f->runAction(a); @@ -1058,7 +1058,7 @@ TransitionCrossFade* TransitionCrossFade::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1123,8 +1123,8 @@ void TransitionCrossFade::onEnter() // create the blend action Action* layerAction = Sequence::create(FadeTo::create(_duration, 0), - CallFunc::create(CC_CALLBACK_0(TransitionScene::hideOutShowIn, this)), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::hideOutShowIn, this)), + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); // run the blend action outTexture->getSprite()->runAction(layerAction); @@ -1152,7 +1152,7 @@ TransitionTurnOffTiles::TransitionTurnOffTiles() TransitionTurnOffTiles::~TransitionTurnOffTiles() { - CC_SAFE_RELEASE(_outSceneProxy); + AX_SAFE_RELEASE(_outSceneProxy); } TransitionTurnOffTiles* TransitionTurnOffTiles::create(float t, Scene* scene) @@ -1163,7 +1163,7 @@ TransitionTurnOffTiles* TransitionTurnOffTiles::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1186,7 +1186,7 @@ void TransitionTurnOffTiles::onEnter() TurnOffTiles* toff = TurnOffTiles::create(_duration, Vec2(x, y)); ActionInterval* action = easeActionWithAction(toff); - _outSceneProxy->runAction(Sequence::create(action, CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), + _outSceneProxy->runAction(Sequence::create(action, CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } @@ -1228,7 +1228,7 @@ TransitionSplitCols::TransitionSplitCols() } TransitionSplitCols::~TransitionSplitCols() { - CC_SAFE_RELEASE(_gridProxy); + AX_SAFE_RELEASE(_gridProxy); } TransitionSplitCols* TransitionSplitCols::create(float t, Scene* scene) @@ -1239,7 +1239,7 @@ TransitionSplitCols* TransitionSplitCols::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1252,11 +1252,11 @@ void TransitionSplitCols::onEnter() ActionInterval* split = action(); auto seq = - Sequence::create(split, CallFunc::create(CC_CALLBACK_0(TransitionSplitCols::switchTargetToInscene, this)), + Sequence::create(split, CallFunc::create(AX_CALLBACK_0(TransitionSplitCols::switchTargetToInscene, this)), split->reverse(), nullptr); _gridProxy->runAction(Sequence::create(easeActionWithAction(seq), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } @@ -1308,7 +1308,7 @@ TransitionSplitRows* TransitionSplitRows::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1322,7 +1322,7 @@ TransitionFadeTR::TransitionFadeTR() } TransitionFadeTR::~TransitionFadeTR() { - CC_SAFE_RELEASE(_outSceneProxy); + AX_SAFE_RELEASE(_outSceneProxy); } TransitionFadeTR* TransitionFadeTR::create(float t, Scene* scene) @@ -1333,7 +1333,7 @@ TransitionFadeTR* TransitionFadeTR::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1357,7 +1357,7 @@ void TransitionFadeTR::onEnter() ActionInterval* action = actionWithSize(Vec2(x, y)); _outSceneProxy->runAction(Sequence::create(easeActionWithAction(action), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } @@ -1409,7 +1409,7 @@ TransitionFadeBL* TransitionFadeBL::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1433,7 +1433,7 @@ TransitionFadeUp* TransitionFadeUp::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -1456,7 +1456,7 @@ TransitionFadeDown* TransitionFadeDown::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } diff --git a/core/2d/CCTransition.h b/core/2d/CCTransition.h index 8980bb3296..9894771c24 100644 --- a/core/2d/CCTransition.h +++ b/core/2d/CCTransition.h @@ -51,7 +51,7 @@ class NodeGrid; @since v0.8.2 @js NA */ -class CC_DLL TransitionEaseScene // : public Ref +class AX_DLL TransitionEaseScene // : public Ref { public: /** Constructor. @@ -70,7 +70,7 @@ public: /** @class TransitionScene * @brief Base class for Transition scenes. */ -class CC_DLL TransitionScene : public Scene +class AX_DLL TransitionScene : public Scene { public: /** Orientation Type used by some transitions. @@ -130,14 +130,14 @@ protected: bool _isSendCleanupToScene; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionScene); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionScene); }; /** @class TransitionSceneOriented * @brief A Transition that supports orientation like. * Possible orientation: LeftOver, RightOver, UpOver, DownOver */ -class CC_DLL TransitionSceneOriented : public TransitionScene +class AX_DLL TransitionSceneOriented : public TransitionScene { public: /** Creates a transition with duration, incoming scene and orientation. @@ -159,14 +159,14 @@ protected: Orientation _orientation; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSceneOriented); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSceneOriented); }; /** @class TransitionRotoZoom * @brief TransitionRotoZoom: Rotate and zoom out the outgoing scene, and then rotate and zoom in the incoming */ -class CC_DLL TransitionRotoZoom : public TransitionScene +class AX_DLL TransitionRotoZoom : public TransitionScene { public: /** Creates a transition with duration and incoming scene. @@ -186,14 +186,14 @@ public: virtual ~TransitionRotoZoom(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionRotoZoom); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionRotoZoom); }; /** @class TransitionJumpZoom * @brief TransitionJumpZoom: Zoom out and jump the outgoing scene, and then jump and zoom in the incoming */ -class CC_DLL TransitionJumpZoom : public TransitionScene +class AX_DLL TransitionJumpZoom : public TransitionScene { public: /** Creates a transition with duration and incoming scene. @@ -213,14 +213,14 @@ public: virtual ~TransitionJumpZoom(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionJumpZoom); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionJumpZoom); }; /** @class TransitionMoveInL * @brief TransitionMoveInL: Move in from to the left the incoming scene. */ -class CC_DLL TransitionMoveInL : public TransitionScene, public TransitionEaseScene +class AX_DLL TransitionMoveInL : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -252,14 +252,14 @@ protected: virtual void initScenes(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInL); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInL); }; /** @class TransitionMoveInR * @brief TransitionMoveInR: Move in from to the right the incoming scene. */ -class CC_DLL TransitionMoveInR : public TransitionMoveInL +class AX_DLL TransitionMoveInR : public TransitionMoveInL { public: /** Creates a transition with duration and incoming scene. @@ -277,14 +277,14 @@ protected: virtual void initScenes(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInR); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInR); }; /** @class TransitionMoveInT * @brief TransitionMoveInT: Move in from to the top the incoming scene. */ -class CC_DLL TransitionMoveInT : public TransitionMoveInL +class AX_DLL TransitionMoveInT : public TransitionMoveInL { public: /** Creates a transition with duration and incoming scene. @@ -302,14 +302,14 @@ protected: virtual void initScenes(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInT); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInT); }; /** @class TransitionMoveInB * @brief TransitionMoveInB: Move in from to the bottom the incoming scene. */ -class CC_DLL TransitionMoveInB : public TransitionMoveInL +class AX_DLL TransitionMoveInB : public TransitionMoveInL { public: /** Creates a transition with duration and incoming scene. @@ -327,14 +327,14 @@ protected: virtual void initScenes(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInB); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInB); }; /** @class TransitionSlideInL * @brief TransitionSlideInL: Slide in the incoming scene from the left border. */ -class CC_DLL TransitionSlideInL : public TransitionScene, public TransitionEaseScene +class AX_DLL TransitionSlideInL : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -368,14 +368,14 @@ protected: virtual void sceneOrder() override; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInL); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInL); }; /** @class TransitionSlideInR *@brief TransitionSlideInR: Slide in the incoming scene from the right border. */ -class CC_DLL TransitionSlideInR : public TransitionSlideInL +class AX_DLL TransitionSlideInR : public TransitionSlideInL { public: /** Creates a transition with duration and incoming scene. @@ -399,14 +399,14 @@ protected: virtual void sceneOrder() override; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInR); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInR); }; /** @class TransitionSlideInB * @brief TransitionSlideInB: Slide in the incoming scene from the bottom border. */ -class CC_DLL TransitionSlideInB : public TransitionSlideInL +class AX_DLL TransitionSlideInB : public TransitionSlideInL { public: /** Creates a transition with duration and incoming scene. @@ -430,14 +430,14 @@ protected: virtual void sceneOrder() override; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInB); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInB); }; /** @class TransitionSlideInT * @brief TransitionSlideInT: Slide in the incoming scene from the top border. */ -class CC_DLL TransitionSlideInT : public TransitionSlideInL +class AX_DLL TransitionSlideInT : public TransitionSlideInL { public: /** Creates a transition with duration and incoming scene. @@ -461,13 +461,13 @@ protected: virtual void sceneOrder() override; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInT); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInT); }; /** @class TransitionShrinkGrow * @brief Shrink the outgoing scene while grow the incoming scene */ -class CC_DLL TransitionShrinkGrow : public TransitionScene, public TransitionEaseScene +class AX_DLL TransitionShrinkGrow : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -491,7 +491,7 @@ public: virtual ~TransitionShrinkGrow(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionShrinkGrow); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionShrinkGrow); }; /** @class TransitionFlipX @@ -499,7 +499,7 @@ private: Flips the screen horizontally. The front face is the outgoing scene and the back face is the incoming scene. */ -class CC_DLL TransitionFlipX : public TransitionSceneOriented +class AX_DLL TransitionFlipX : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -530,7 +530,7 @@ public: virtual ~TransitionFlipX(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipX); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFlipX); }; /** @class TransitionFlipY @@ -538,7 +538,7 @@ private: Flips the screen vertically. The front face is the outgoing scene and the back face is the incoming scene. */ -class CC_DLL TransitionFlipY : public TransitionSceneOriented +class AX_DLL TransitionFlipY : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -569,7 +569,7 @@ public: virtual ~TransitionFlipY(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipY); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFlipY); }; /** @class TransitionFlipAngular @@ -577,7 +577,7 @@ private: Flips the screen half horizontally and half vertically. The front face is the outgoing scene and the back face is the incoming scene. */ -class CC_DLL TransitionFlipAngular : public TransitionSceneOriented +class AX_DLL TransitionFlipAngular : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -608,7 +608,7 @@ public: virtual ~TransitionFlipAngular(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipAngular); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFlipAngular); }; /** @class TransitionZoomFlipX @@ -616,7 +616,7 @@ private: Flips the screen horizontally doing a zoom out/in The front face is the outgoing scene and the back face is the incoming scene. */ -class CC_DLL TransitionZoomFlipX : public TransitionSceneOriented +class AX_DLL TransitionZoomFlipX : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -647,7 +647,7 @@ public: virtual ~TransitionZoomFlipX(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipX); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipX); }; /** @class TransitionZoomFlipY @@ -655,7 +655,7 @@ private: Flips the screen vertically doing a little zooming out/in The front face is the outgoing scene and the back face is the incoming scene. */ -class CC_DLL TransitionZoomFlipY : public TransitionSceneOriented +class AX_DLL TransitionZoomFlipY : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -686,7 +686,7 @@ public: virtual ~TransitionZoomFlipY(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipY); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipY); }; /** @class TransitionZoomFlipAngular @@ -694,7 +694,7 @@ private: Flips the screen half horizontally and half vertically doing a little zooming out/in. The front face is the outgoing scene and the back face is the incoming scene. */ -class CC_DLL TransitionZoomFlipAngular : public TransitionSceneOriented +class AX_DLL TransitionZoomFlipAngular : public TransitionSceneOriented { public: /** Creates a transition with duration, incoming scene and orientation. @@ -725,14 +725,14 @@ public: virtual ~TransitionZoomFlipAngular(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipAngular); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipAngular); }; /** @class TransitionFade * @brief TransitionFade: Fade out the outgoing scene and then fade in the incoming scene.''' */ -class CC_DLL TransitionFade : public TransitionScene +class AX_DLL TransitionFade : public TransitionScene { public: /** Creates the transition with a duration and with an RGB color @@ -772,7 +772,7 @@ protected: Color4B _color; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFade); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFade); }; class RenderTexture; @@ -780,7 +780,7 @@ class RenderTexture; @brief TransitionCrossFade: Cross fades two scenes using the RenderTexture object. */ -class CC_DLL TransitionCrossFade : public TransitionScene +class AX_DLL TransitionCrossFade : public TransitionScene { public: /** Creates a transition with duration and incoming scene. @@ -811,14 +811,14 @@ public: virtual ~TransitionCrossFade(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionCrossFade); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionCrossFade); }; /** @class TransitionTurnOffTiles * @brief TransitionTurnOffTiles: Turn off the tiles of the outgoing scene in random order */ -class CC_DLL TransitionTurnOffTiles : public TransitionScene, public TransitionEaseScene +class AX_DLL TransitionTurnOffTiles : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -854,14 +854,14 @@ protected: NodeGrid* _outSceneProxy; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionTurnOffTiles); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionTurnOffTiles); }; /** @class TransitionSplitCols * @brief TransitionSplitCols: The odd columns goes upwards while the even columns goes downwards. */ -class CC_DLL TransitionSplitCols : public TransitionScene, public TransitionEaseScene +class AX_DLL TransitionSplitCols : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -897,14 +897,14 @@ protected: NodeGrid* _gridProxy; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSplitCols); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSplitCols); }; /** @class TransitionSplitRows * @brief TransitionSplitRows: The odd rows goes to the left while the even rows goes to the right. */ -class CC_DLL TransitionSplitRows : public TransitionSplitCols +class AX_DLL TransitionSplitRows : public TransitionSplitCols { public: /** Creates a transition with duration and incoming scene. @@ -924,14 +924,14 @@ public: virtual ~TransitionSplitRows(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionSplitRows); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionSplitRows); }; /** @class TransitionFadeTR * @brief TransitionFadeTR: Fade the tiles of the outgoing scene from the left-bottom corner the to top-right corner. */ -class CC_DLL TransitionFadeTR : public TransitionScene, public TransitionEaseScene +class AX_DLL TransitionFadeTR : public TransitionScene, public TransitionEaseScene { public: /** Creates a transition with duration and incoming scene. @@ -970,14 +970,14 @@ protected: NodeGrid* _outSceneProxy; private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeTR); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFadeTR); }; /** @class TransitionFadeBL * @brief TransitionFadeBL: Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner. */ -class CC_DLL TransitionFadeBL : public TransitionFadeTR +class AX_DLL TransitionFadeBL : public TransitionFadeTR { public: /** Creates a transition with duration and incoming scene. @@ -997,14 +997,14 @@ public: virtual ~TransitionFadeBL(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeBL); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFadeBL); }; /** @class TransitionFadeUp * @brief TransitionFadeUp: * Fade the tiles of the outgoing scene from the bottom to the top. */ -class CC_DLL TransitionFadeUp : public TransitionFadeTR +class AX_DLL TransitionFadeUp : public TransitionFadeTR { public: /** Creates a transition with duration and incoming scene. @@ -1024,14 +1024,14 @@ public: virtual ~TransitionFadeUp(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeUp); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFadeUp); }; /** @class TransitionFadeDown * @brief TransitionFadeDown: * Fade the tiles of the outgoing scene from the top to the bottom. */ -class CC_DLL TransitionFadeDown : public TransitionFadeTR +class AX_DLL TransitionFadeDown : public TransitionFadeTR { public: /** Creates a transition with duration and incoming scene. @@ -1051,7 +1051,7 @@ public: virtual ~TransitionFadeDown(); private: - CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeDown); + AX_DISALLOW_COPY_AND_ASSIGN(TransitionFadeDown); }; // end of _2d group diff --git a/core/2d/CCTransitionPageTurn.cpp b/core/2d/CCTransitionPageTurn.cpp index b43f0ffd78..af87b7f2cd 100644 --- a/core/2d/CCTransitionPageTurn.cpp +++ b/core/2d/CCTransitionPageTurn.cpp @@ -44,8 +44,8 @@ TransitionPageTurn::TransitionPageTurn() TransitionPageTurn::~TransitionPageTurn() { - CC_SAFE_RELEASE(_inSceneProxy); - CC_SAFE_RELEASE(_outSceneProxy); + AX_SAFE_RELEASE(_inSceneProxy); + AX_SAFE_RELEASE(_outSceneProxy); } /** creates a base transition with duration and incoming scene */ @@ -119,14 +119,14 @@ void TransitionPageTurn::onEnter() if (!_back) { _outSceneProxy->runAction(Sequence::create( - action, CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); + action, CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } else { // to prevent initial flicker _inSceneProxy->setVisible(false); _inSceneProxy->runAction(Sequence::create(Show::create(), action, - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), StopGrid::create(), nullptr)); } } diff --git a/core/2d/CCTransitionPageTurn.h b/core/2d/CCTransitionPageTurn.h index 34cc305eaf..047306b22a 100644 --- a/core/2d/CCTransitionPageTurn.h +++ b/core/2d/CCTransitionPageTurn.h @@ -51,7 +51,7 @@ is turned on in Director using: @since v0.8.2 */ -class CC_DLL TransitionPageTurn : public TransitionScene +class AX_DLL TransitionPageTurn : public TransitionScene { public: /** diff --git a/core/2d/CCTransitionProgress.cpp b/core/2d/CCTransitionProgress.cpp index c412ad92f9..4d22024edb 100644 --- a/core/2d/CCTransitionProgress.cpp +++ b/core/2d/CCTransitionProgress.cpp @@ -50,7 +50,7 @@ TransitionProgress* TransitionProgress::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -87,7 +87,7 @@ void TransitionProgress::onEnter() // create the blend action auto layerAction = Sequence::create(ProgressFromTo::create(_duration, _from, _to), - CallFunc::create(CC_CALLBACK_0(TransitionScene::finish, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); // run the blend action node->runAction(layerAction); @@ -150,7 +150,7 @@ TransitionProgressRadialCCW* TransitionProgressRadialCCW::create(float t, Scene* newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -163,7 +163,7 @@ TransitionProgressRadialCW* TransitionProgressRadialCW::create(float t, Scene* s newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -195,7 +195,7 @@ TransitionProgressHorizontal* TransitionProgressHorizontal::create(float t, Scen newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -228,7 +228,7 @@ TransitionProgressVertical* TransitionProgressVertical::create(float t, Scene* s newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -261,7 +261,7 @@ TransitionProgressInOut* TransitionProgressInOut::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } @@ -306,7 +306,7 @@ TransitionProgressOutIn* TransitionProgressOutIn::create(float t, Scene* scene) newScene->autorelease(); return newScene; } - CC_SAFE_DELETE(newScene); + AX_SAFE_DELETE(newScene); return nullptr; } diff --git a/core/2d/CCTransitionProgress.h b/core/2d/CCTransitionProgress.h index db5330c897..d2a163d82c 100644 --- a/core/2d/CCTransitionProgress.h +++ b/core/2d/CCTransitionProgress.h @@ -43,7 +43,7 @@ class RenderTexture; /** @class TransitionProgress * @brief A base class of progress transition. */ -class CC_DLL TransitionProgress : public TransitionScene +class AX_DLL TransitionProgress : public TransitionScene { public: /** Creates a transition with duration and incoming scene. @@ -80,7 +80,7 @@ protected: * @brief TransitionRadialCCW transition. A counter clock-wise radial transition to the next scene */ -class CC_DLL TransitionProgressRadialCCW : public TransitionProgress +class AX_DLL TransitionProgressRadialCCW : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. @@ -108,7 +108,7 @@ protected: * @brief TransitionRadialCW transition. A counter clock-wise radial transition to the next scene. */ -class CC_DLL TransitionProgressRadialCW : public TransitionProgress +class AX_DLL TransitionProgressRadialCW : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. @@ -136,7 +136,7 @@ protected: * @brief TransitionProgressHorizontal transition. A clock-wise radial transition to the next scene */ -class CC_DLL TransitionProgressHorizontal : public TransitionProgress +class AX_DLL TransitionProgressHorizontal : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. @@ -163,7 +163,7 @@ protected: /** @class TransitionProgressVertical * @brief TransitionProgressVertical transition. */ -class CC_DLL TransitionProgressVertical : public TransitionProgress +class AX_DLL TransitionProgressVertical : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. @@ -190,7 +190,7 @@ protected: /** @class TransitionProgressInOut * @brief TransitionProgressInOut transition. */ -class CC_DLL TransitionProgressInOut : public TransitionProgress +class AX_DLL TransitionProgressInOut : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. @@ -219,7 +219,7 @@ protected: /** @class TransitionProgressOutIn * @brief TransitionProgressOutIn transition. */ -class CC_DLL TransitionProgressOutIn : public TransitionProgress +class AX_DLL TransitionProgressOutIn : public TransitionProgress { public: /** Creates a transition with duration and incoming scene. diff --git a/core/2d/CCTweenFunction.h b/core/2d/CCTweenFunction.h index 47f168adcc..49d0fd9935 100644 --- a/core/2d/CCTweenFunction.h +++ b/core/2d/CCTweenFunction.h @@ -87,210 +87,210 @@ enum TweenType /** * @param time in seconds. */ -float CC_DLL easeIn(float time, float rate); +float AX_DLL easeIn(float time, float rate); /** * @param time in seconds. */ -float CC_DLL easeOut(float time, float rate); +float AX_DLL easeOut(float time, float rate); /** * @param time in seconds. */ -float CC_DLL easeInOut(float time, float rate); +float AX_DLL easeInOut(float time, float rate); /** * @param time in seconds. */ -float CC_DLL bezieratFunction(float a, float b, float c, float d, float t); +float AX_DLL bezieratFunction(float a, float b, float c, float d, float t); /** * @param time in seconds. */ -float CC_DLL quadraticIn(float time); +float AX_DLL quadraticIn(float time); /** * @param time in seconds. */ -float CC_DLL quadraticOut(float time); +float AX_DLL quadraticOut(float time); /** * @param time in seconds. */ -float CC_DLL quadraticInOut(float time); +float AX_DLL quadraticInOut(float time); /** * @param time in seconds. */ -float CC_DLL quadraticInOut(float time); +float AX_DLL quadraticInOut(float time); /** * @param time in seconds. */ -float CC_DLL tweenTo(float time, TweenType type, float* easingParam); +float AX_DLL tweenTo(float time, TweenType type, float* easingParam); /** * @param time in seconds. */ -float CC_DLL linear(float time); +float AX_DLL linear(float time); /** * @param time in seconds. */ -float CC_DLL sineEaseIn(float time); +float AX_DLL sineEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL sineEaseOut(float time); +float AX_DLL sineEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL sineEaseInOut(float time); +float AX_DLL sineEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL quadEaseIn(float time); +float AX_DLL quadEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL quadEaseOut(float time); +float AX_DLL quadEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL quadEaseInOut(float time); +float AX_DLL quadEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL cubicEaseIn(float time); +float AX_DLL cubicEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL cubicEaseOut(float time); +float AX_DLL cubicEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL cubicEaseInOut(float time); +float AX_DLL cubicEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL quartEaseIn(float time); +float AX_DLL quartEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL quartEaseOut(float time); +float AX_DLL quartEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL quartEaseInOut(float time); +float AX_DLL quartEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL quintEaseIn(float time); +float AX_DLL quintEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL quintEaseOut(float time); +float AX_DLL quintEaseOut(float time); /** @param time in seconds. */ -float CC_DLL quintEaseInOut(float time); +float AX_DLL quintEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL expoEaseIn(float time); +float AX_DLL expoEaseIn(float time); /** @param time in seconds. */ -float CC_DLL expoEaseOut(float time); +float AX_DLL expoEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL expoEaseInOut(float time); +float AX_DLL expoEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL circEaseIn(float time); +float AX_DLL circEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL circEaseOut(float time); +float AX_DLL circEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL circEaseInOut(float time); +float AX_DLL circEaseInOut(float time); /** * @param time in seconds. * @param period in seconds. */ -float CC_DLL elasticEaseIn(float time, float period); +float AX_DLL elasticEaseIn(float time, float period); /** * @param time in seconds. * @param period in seconds. */ -float CC_DLL elasticEaseOut(float time, float period); +float AX_DLL elasticEaseOut(float time, float period); /** * @param time in seconds. * @param period in seconds. */ -float CC_DLL elasticEaseInOut(float time, float period); +float AX_DLL elasticEaseInOut(float time, float period); /** * @param time in seconds. */ -float CC_DLL backEaseIn(float time); +float AX_DLL backEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL backEaseOut(float time); +float AX_DLL backEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL backEaseInOut(float time); +float AX_DLL backEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL bounceEaseIn(float time); +float AX_DLL bounceEaseIn(float time); /** * @param time in seconds. */ -float CC_DLL bounceEaseOut(float time); +float AX_DLL bounceEaseOut(float time); /** * @param time in seconds. */ -float CC_DLL bounceEaseInOut(float time); +float AX_DLL bounceEaseInOut(float time); /** * @param time in seconds. */ -float CC_DLL customEase(float time, float* easingParam); +float AX_DLL customEase(float time, float* easingParam); } // namespace tweenfunc NS_AX_END diff --git a/core/3d/CC3DProgramInfo.cpp b/core/3d/CC3DProgramInfo.cpp index da98282e27..6dd455893d 100644 --- a/core/3d/CC3DProgramInfo.cpp +++ b/core/3d/CC3DProgramInfo.cpp @@ -52,22 +52,22 @@ const char* SHADER_LAYER_RADIAL_GRADIENT = "ShaderLayerRadialGrad namespace uniform { // uniform names -const char* UNIFORM_NAME_AMBIENT_COLOR = "CC_AmbientColor"; -const char* UNIFORM_NAME_P_MATRIX = "CC_PMatrix"; -const char* UNIFORM_NAME_MULTIVIEW_P_MATRIX = "CC_MultiViewPMatrix"; -const char* UNIFORM_NAME_MV_MATRIX = "CC_MVMatrix"; -const char* UNIFORM_NAME_MVP_MATRIX = "CC_MVPMatrix"; -const char* UNIFORM_NAME_MULTIVIEW_MVP_MATRIX = "CC_MultiViewMVPMatrix"; -const char* UNIFORM_NAME_NORMAL_MATRIX = "CC_NormalMatrix"; -const char* UNIFORM_NAME_TIME = "CC_Time"; -const char* UNIFORM_NAME_SIN_TIME = "CC_SinTime"; -const char* UNIFORM_NAME_COS_TIME = "CC_CosTime"; -const char* UNIFORM_NAME_RANDOM01 = "CC_Random01"; -const char* UNIFORM_NAME_SAMPLER0 = "CC_Texture0"; -const char* UNIFORM_NAME_SAMPLER1 = "CC_Texture1"; -const char* UNIFORM_NAME_SAMPLER2 = "CC_Texture2"; -const char* UNIFORM_NAME_SAMPLER3 = "CC_Texture3"; -const char* UNIFORM_NAME_ALPHA_TEST_VALUE = "CC_alpha_value"; +const char* UNIFORM_NAME_AMBIENT_COLOR = "AX_AmbientColor"; +const char* UNIFORM_NAME_P_MATRIX = "AX_PMatrix"; +const char* UNIFORM_NAME_MULTIVIEW_P_MATRIX = "AX_MultiViewPMatrix"; +const char* UNIFORM_NAME_MV_MATRIX = "AX_MVMatrix"; +const char* UNIFORM_NAME_MVP_MATRIX = "AX_MVPMatrix"; +const char* UNIFORM_NAME_MULTIVIEW_MVP_MATRIX = "AX_MultiViewMVPMatrix"; +const char* UNIFORM_NAME_NORMAL_MATRIX = "AX_NormalMatrix"; +const char* UNIFORM_NAME_TIME = "AX_Time"; +const char* UNIFORM_NAME_SIN_TIME = "AX_SinTime"; +const char* UNIFORM_NAME_COS_TIME = "AX_CosTime"; +const char* UNIFORM_NAME_RANDOM01 = "AX_Random01"; +const char* UNIFORM_NAME_SAMPLER0 = "AX_Texture0"; +const char* UNIFORM_NAME_SAMPLER1 = "AX_Texture1"; +const char* UNIFORM_NAME_SAMPLER2 = "AX_Texture2"; +const char* UNIFORM_NAME_SAMPLER3 = "AX_Texture3"; +const char* UNIFORM_NAME_ALPHA_TEST_VALUE = "AX_alpha_value"; } // namespace uniform namespace attribute diff --git a/core/3d/CCAABB.h b/core/3d/CCAABB.h index 05205a1c49..82120f5ce1 100644 --- a/core/3d/CCAABB.h +++ b/core/3d/CCAABB.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_AABB_H__ -#define __CC_AABB_H__ +#ifndef __AX_AABB_H__ +#define __AX_AABB_H__ #include "base/ccMacros.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ NS_AX_BEGIN /** * Axis Aligned Bounding Box (AABB), usually calculate some rough but fast collision detection. */ -class CC_DLL AABB +class AX_DLL AABB { public: diff --git a/core/3d/CCAnimate3D.cpp b/core/3d/CCAnimate3D.cpp index c87e2f6ef6..ea1d6761e0 100644 --- a/core/3d/CCAnimate3D.cpp +++ b/core/3d/CCAnimate3D.cpp @@ -513,7 +513,7 @@ Animate3D::~Animate3D() } _keyFrameEvent.clear(); - CC_SAFE_RELEASE(_animation); + AX_SAFE_RELEASE(_animation); } void Animate3D::removeFromMap() diff --git a/core/3d/CCAnimate3D.h b/core/3d/CCAnimate3D.h index 0f07a450b3..af741c856d 100644 --- a/core/3d/CCAnimate3D.h +++ b/core/3d/CCAnimate3D.h @@ -56,7 +56,7 @@ enum class Animate3DQuality /** * @brief Animate3D, Animates a MeshRenderer given with an Animation3D */ -class CC_DLL Animate3D : public ActionInterval +class AX_DLL Animate3D : public ActionInterval { public: /**create Animate3D using Animation.*/ diff --git a/core/3d/CCAnimation3D.cpp b/core/3d/CCAnimation3D.cpp index 05fd8adc35..a6d15cf3e4 100644 --- a/core/3d/CCAnimation3D.cpp +++ b/core/3d/CCAnimation3D.cpp @@ -44,7 +44,7 @@ Animation3D* Animation3D::create(std::string_view fileName, std::string_view ani } else { - CC_SAFE_DELETE(animation); + AX_SAFE_DELETE(animation); } return animation; @@ -86,16 +86,16 @@ Animation3D::~Animation3D() for (const auto& itor : _boneCurves) { Curve* curve = itor.second; - CC_SAFE_DELETE(curve); + AX_SAFE_DELETE(curve); } } Animation3D::Curve::Curve() : translateCurve(nullptr), rotCurve(nullptr), scaleCurve(nullptr) {} Animation3D::Curve::~Curve() { - CC_SAFE_RELEASE_NULL(translateCurve); - CC_SAFE_RELEASE_NULL(rotCurve); - CC_SAFE_RELEASE_NULL(scaleCurve); + AX_SAFE_RELEASE_NULL(translateCurve); + AX_SAFE_RELEASE_NULL(rotCurve); + AX_SAFE_RELEASE_NULL(scaleCurve); } bool Animation3D::init(const Animation3DData& data) @@ -196,7 +196,7 @@ Animation3DCache* Animation3DCache::getInstance() } void Animation3DCache::destroyInstance() { - CC_SAFE_DELETE(_cacheInstance); + AX_SAFE_DELETE(_cacheInstance); } Animation3D* Animation3DCache::getAnimation(std::string_view key) @@ -222,7 +222,7 @@ void Animation3DCache::removeAllAnimations() { for (auto itor : _animations) { - CC_SAFE_RELEASE(itor.second); + AX_SAFE_RELEASE(itor.second); } _animations.clear(); } diff --git a/core/3d/CCAnimation3D.h b/core/3d/CCAnimation3D.h index 34b8c02d1d..ae6cafa094 100644 --- a/core/3d/CCAnimation3D.h +++ b/core/3d/CCAnimation3D.h @@ -43,7 +43,7 @@ NS_AX_BEGIN /** * @brief static animation data, shared */ -class CC_DLL Animation3D : public Ref +class AX_DLL Animation3D : public Ref { friend class Bundle3D; diff --git a/core/3d/CCAnimationCurve.inl b/core/3d/CCAnimationCurve.inl index 9c2c7da90e..346e09d95b 100644 --- a/core/3d/CCAnimationCurve.inl +++ b/core/3d/CCAnimationCurve.inl @@ -117,8 +117,8 @@ AnimationCurve::AnimationCurve() template AnimationCurve::~AnimationCurve() { - CC_SAFE_DELETE_ARRAY(_keytime); - CC_SAFE_DELETE_ARRAY(_value); + AX_SAFE_DELETE_ARRAY(_keytime); + AX_SAFE_DELETE_ARRAY(_value); } template diff --git a/core/3d/CCAttachNode.h b/core/3d/CCAttachNode.h index 8077535a6e..c59cfa5bcf 100644 --- a/core/3d/CCAttachNode.h +++ b/core/3d/CCAttachNode.h @@ -43,7 +43,7 @@ class Bone3D; * auto attachNode = mesh->getAttachNode("left hand"); * attachNode->addChild(weapon); */ -class CC_DLL AttachNode : public Node +class AX_DLL AttachNode : public Node { public: /** diff --git a/core/3d/CCBillBoard.cpp b/core/3d/CCBillBoard.cpp index 91365a70f1..925cfb34bd 100644 --- a/core/3d/CCBillBoard.cpp +++ b/core/3d/CCBillBoard.cpp @@ -49,7 +49,7 @@ BillBoard* BillBoard::createWithTexture(Texture2D* texture, Mode mode) billboard->autorelease(); return billboard; } - CC_SAFE_DELETE(billboard); + AX_SAFE_DELETE(billboard); return nullptr; } @@ -62,7 +62,7 @@ BillBoard* BillBoard::create(std::string_view filename, Mode mode) billboard->autorelease(); return billboard; } - CC_SAFE_DELETE(billboard); + AX_SAFE_DELETE(billboard); return nullptr; } @@ -75,7 +75,7 @@ BillBoard* BillBoard::create(std::string_view filename, const Rect& rect, Mode m billboard->autorelease(); return billboard; } - CC_SAFE_DELETE(billboard); + AX_SAFE_DELETE(billboard); return nullptr; } @@ -88,7 +88,7 @@ BillBoard* BillBoard::create(Mode mode) billboard->autorelease(); return billboard; } - CC_SAFE_DELETE(billboard); + AX_SAFE_DELETE(billboard); return nullptr; } diff --git a/core/3d/CCBillBoard.h b/core/3d/CCBillBoard.h index c0e37373c3..0d439acd2c 100644 --- a/core/3d/CCBillBoard.h +++ b/core/3d/CCBillBoard.h @@ -36,7 +36,7 @@ NS_AX_BEGIN /** * @brief Inherit from Sprite, achieve BillBoard. */ -class CC_DLL BillBoard : public Sprite +class AX_DLL BillBoard : public Sprite { public: enum class Mode @@ -118,7 +118,7 @@ protected: bool _modeDirty; private: - CC_DISALLOW_COPY_AND_ASSIGN(BillBoard); + AX_DISALLOW_COPY_AND_ASSIGN(BillBoard); }; // end of 3d group diff --git a/core/3d/CCBundle3D.cpp b/core/3d/CCBundle3D.cpp index 6ffe71093e..0bdb3e875b 100644 --- a/core/3d/CCBundle3D.cpp +++ b/core/3d/CCBundle3D.cpp @@ -161,7 +161,7 @@ void Bundle3D::clear() if (_isBinary) { _binaryBuffer.clear(); - CC_SAFE_DELETE_ARRAY(_references); + AX_SAFE_DELETE_ARRAY(_references); } else { @@ -489,7 +489,7 @@ bool Bundle3D::loadMeshDatasBinary(MeshDatas& meshdatas) FAILED: { - CC_SAFE_DELETE(meshData); + AX_SAFE_DELETE(meshData); for (auto& meshdata : meshdatas.meshDatas) { delete meshdata; @@ -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()); - CC_SAFE_DELETE(meshdata); + AX_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()); - CC_SAFE_DELETE(meshdata); + AX_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()); - CC_SAFE_DELETE(meshdata); + AX_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()); - CC_SAFE_DELETE(meshdata); + AX_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()); - CC_SAFE_DELETE(meshdata); + AX_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()); - CC_SAFE_DELETE(meshdata); + AX_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()); - CC_SAFE_DELETE(meshdata); + AX_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()); - CC_SAFE_DELETE(meshdata); + AX_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()); - CC_SAFE_DELETE(meshdata); + AX_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()); - CC_SAFE_DELETE(meshdata); + AX_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()); - CC_SAFE_DELETE(meshdata); + AX_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()); - CC_SAFE_DELETE(meshdata); + AX_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()); - CC_SAFE_DELETE(meshdata); + AX_SAFE_DELETE(meshdata); return false; } @@ -1131,7 +1131,7 @@ bool Bundle3D::loadBinary(std::string_view path) } // Read all refs - CC_SAFE_DELETE_ARRAY(_references); + AX_SAFE_DELETE_ARRAY(_references); _references = new Reference[_referenceCount]; for (unsigned int i = 0; i < _referenceCount; ++i) { @@ -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()); - CC_SAFE_DELETE_ARRAY(_references); + AX_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()); - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AX_SAFE_DELETE(modelnodedata); + AX_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"); - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AX_SAFE_DELETE(modelnodedata); + AX_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()); - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AX_SAFE_DELETE(modelnodedata); + AX_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()); - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AX_SAFE_DELETE(modelnodedata); + AX_SAFE_DELETE(nodedata); return nullptr; } @@ -1919,8 +1919,8 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit Mat4 invbindpos; if (!_binaryReader.readMatrix(invbindpos.m)) { - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AX_SAFE_DELETE(modelnodedata); + AX_SAFE_DELETE(nodedata); return nullptr; } @@ -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()); - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AX_SAFE_DELETE(modelnodedata); + AX_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()); - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AX_SAFE_DELETE(modelnodedata); + AX_SAFE_DELETE(nodedata); return nullptr; } for (unsigned int k = 0; k < textureIndexSize; ++k) @@ -1951,8 +1951,8 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprit unsigned int index = 0; if (_binaryReader.read(&index, 4, 1) != 1) { - CC_SAFE_DELETE(modelnodedata); - CC_SAFE_DELETE(nodedata); + AX_SAFE_DELETE(modelnodedata); + AX_SAFE_DELETE(nodedata); return nullptr; } } @@ -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()); - CC_SAFE_DELETE(nodedata); + AX_SAFE_DELETE(nodedata); return nullptr; } if (childrenSize > 0) diff --git a/core/3d/CCBundle3D.h b/core/3d/CCBundle3D.h index e76bb039a5..b375ea2565 100644 --- a/core/3d/CCBundle3D.h +++ b/core/3d/CCBundle3D.h @@ -49,7 +49,7 @@ class Animation3D; * @js NA * @lua NA */ -class CC_DLL Bundle3D +class AX_DLL Bundle3D { public: /** diff --git a/core/3d/CCBundle3DData.h b/core/3d/CCBundle3DData.h index a0e9480ca3..d7b5996ec0 100644 --- a/core/3d/CCBundle3DData.h +++ b/core/3d/CCBundle3DData.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_BUNDLE_3D_DATA_H__ -#define __CC_BUNDLE_3D_DATA_H__ +#ifndef __AX_BUNDLE_3D_DATA_H__ +#define __AX_BUNDLE_3D_DATA_H__ #include "base/CCRef.h" #include "base/ccTypes.h" @@ -229,7 +229,7 @@ protected: * @js NA * @lua NA */ -struct CC_DLL MeshVertexAttrib +struct AX_DLL MeshVertexAttrib { backend::VertexFormat type; shaderinfos::VertexKey vertexAttrib; @@ -583,4 +583,4 @@ struct Reference NS_AX_END -#endif //__CC_BUNDLE_3D_DATA_H__ +#endif //__AX_BUNDLE_3D_DATA_H__ diff --git a/core/3d/CCBundleReader.h b/core/3d/CCBundleReader.h index c4ecc117fe..57159c766d 100644 --- a/core/3d/CCBundleReader.h +++ b/core/3d/CCBundleReader.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_BUNDLE_READER_H__ -#define __CC_BUNDLE_READER_H__ +#ifndef __AX_BUNDLE_READER_H__ +#define __AX_BUNDLE_READER_H__ #include #include diff --git a/core/3d/CCFrustum.h b/core/3d/CCFrustum.h index e5d6ba1ed7..1f0a092cf6 100644 --- a/core/3d/CCFrustum.h +++ b/core/3d/CCFrustum.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_FRUSTUM_H_ -#define __CC_FRUSTUM_H_ +#ifndef __AX_FRUSTUM_H_ +#define __AX_FRUSTUM_H_ #include "base/ccMacros.h" #include "math/CCMath.h" @@ -42,7 +42,7 @@ class Camera; * @js NA * @lua NA */ -class CC_DLL Frustum +class AX_DLL Frustum { friend class Camera; @@ -86,4 +86,4 @@ protected: NS_AX_END -#endif //__CC_FRUSTUM_H_ +#endif //__AX_FRUSTUM_H_ diff --git a/core/3d/CCMesh.cpp b/core/3d/CCMesh.cpp index 65fb72976e..1090ae62cb 100644 --- a/core/3d/CCMesh.cpp +++ b/core/3d/CCMesh.cpp @@ -124,11 +124,11 @@ Mesh::~Mesh() { for (auto& tex : _textures) { - CC_SAFE_RELEASE(tex.second); + AX_SAFE_RELEASE(tex.second); } - CC_SAFE_RELEASE(_skin); - CC_SAFE_RELEASE(_meshIndexData); - CC_SAFE_RELEASE(_material); + AX_SAFE_RELEASE(_skin); + AX_SAFE_RELEASE(_meshIndexData); + AX_SAFE_RELEASE(_material); } backend::Buffer* Mesh::getVertexBuffer() const @@ -279,8 +279,8 @@ void Mesh::setTexture(Texture2D* tex, NTextureData::Usage usage, bool cacheFileN if (tex == nullptr) tex = getDummyTexture(); - CC_SAFE_RETAIN(tex); - CC_SAFE_RELEASE(_textures[usage]); + AX_SAFE_RETAIN(tex); + AX_SAFE_RELEASE(_textures[usage]); _textures[usage] = tex; if (usage == NTextureData::Usage::Diffuse) @@ -331,9 +331,9 @@ void Mesh::setMaterial(Material* material) { if (_material != material) { - CC_SAFE_RELEASE(_material); + AX_SAFE_RELEASE(_material); _material = material; - CC_SAFE_RETAIN(_material); + AX_SAFE_RETAIN(_material); } _meshCommands.clear(); @@ -450,8 +450,8 @@ void Mesh::setSkin(MeshSkin* skin) { if (_skin != skin) { - CC_SAFE_RETAIN(skin); - CC_SAFE_RELEASE(_skin); + AX_SAFE_RETAIN(skin); + AX_SAFE_RELEASE(_skin); _skin = skin; calculateAABB(); } @@ -461,8 +461,8 @@ void Mesh::setMeshIndexData(MeshIndexData* subMesh) { if (_meshIndexData != subMesh) { - CC_SAFE_RETAIN(subMesh); - CC_SAFE_RELEASE(_meshIndexData); + AX_SAFE_RETAIN(subMesh); + AX_SAFE_RELEASE(_meshIndexData); _meshIndexData = subMesh; calculateAABB(); bindMeshCommand(); diff --git a/core/3d/CCMesh.h b/core/3d/CCMesh.h index d4da0068e4..f412ff0e92 100644 --- a/core/3d/CCMesh.h +++ b/core/3d/CCMesh.h @@ -59,7 +59,7 @@ class Buffer; /** * @brief Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on */ -class CC_DLL Mesh : public Ref +class AX_DLL Mesh : public Ref { friend class MeshRenderer; @@ -293,7 +293,7 @@ protected: /// @} /// @cond -extern std::string CC_DLL s_uniformSamplerName[]; // uniform sampler names array +extern std::string AX_DLL s_uniformSamplerName[]; // uniform sampler names array /// @endcond NS_AX_END diff --git a/core/3d/CCMeshMaterial.cpp b/core/3d/CCMeshMaterial.cpp index 088052ba4b..4ccf6ba504 100644 --- a/core/3d/CCMeshMaterial.cpp +++ b/core/3d/CCMeshMaterial.cpp @@ -155,30 +155,30 @@ void MeshMaterial::createBuiltInMaterial() void MeshMaterial::releaseBuiltInMaterial() { - CC_SAFE_RELEASE_NULL(_unLitMaterial); - CC_SAFE_RELEASE_NULL(_unLitMaterialSkin); + AX_SAFE_RELEASE_NULL(_unLitMaterial); + AX_SAFE_RELEASE_NULL(_unLitMaterialSkin); - CC_SAFE_RELEASE_NULL(_unLitNoTexMaterial); - CC_SAFE_RELEASE_NULL(_vertexLitMaterial); - CC_SAFE_RELEASE_NULL(_diffuseMaterial); - CC_SAFE_RELEASE_NULL(_diffuseNoTexMaterial); - CC_SAFE_RELEASE_NULL(_bumpedDiffuseMaterial); + AX_SAFE_RELEASE_NULL(_unLitNoTexMaterial); + AX_SAFE_RELEASE_NULL(_vertexLitMaterial); + AX_SAFE_RELEASE_NULL(_diffuseMaterial); + AX_SAFE_RELEASE_NULL(_diffuseNoTexMaterial); + AX_SAFE_RELEASE_NULL(_bumpedDiffuseMaterial); - CC_SAFE_RELEASE_NULL(_vertexLitMaterialSkin); - CC_SAFE_RELEASE_NULL(_diffuseMaterialSkin); - CC_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialSkin); + AX_SAFE_RELEASE_NULL(_vertexLitMaterialSkin); + AX_SAFE_RELEASE_NULL(_diffuseMaterialSkin); + AX_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialSkin); // release program states - CC_SAFE_RELEASE_NULL(_unLitMaterialProgState); - CC_SAFE_RELEASE_NULL(_unLitNoTexMaterialProgState); - CC_SAFE_RELEASE_NULL(_vertexLitMaterialProgState); - CC_SAFE_RELEASE_NULL(_diffuseMaterialProgState); - CC_SAFE_RELEASE_NULL(_diffuseNoTexMaterialProgState); - CC_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialProgState); + AX_SAFE_RELEASE_NULL(_unLitMaterialProgState); + AX_SAFE_RELEASE_NULL(_unLitNoTexMaterialProgState); + AX_SAFE_RELEASE_NULL(_vertexLitMaterialProgState); + AX_SAFE_RELEASE_NULL(_diffuseMaterialProgState); + AX_SAFE_RELEASE_NULL(_diffuseNoTexMaterialProgState); + AX_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialProgState); - CC_SAFE_RELEASE_NULL(_unLitMaterialSkinProgState); - CC_SAFE_RELEASE_NULL(_vertexLitMaterialSkinProgState); - CC_SAFE_RELEASE_NULL(_diffuseMaterialSkinProgState); - CC_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialSkinProgState); + AX_SAFE_RELEASE_NULL(_unLitMaterialSkinProgState); + AX_SAFE_RELEASE_NULL(_vertexLitMaterialSkinProgState); + AX_SAFE_RELEASE_NULL(_diffuseMaterialSkinProgState); + AX_SAFE_RELEASE_NULL(_bumpedDiffuseMaterialSkinProgState); } void MeshMaterial::releaseCachedMaterial() @@ -284,7 +284,7 @@ MeshMaterial* MeshMaterial::createWithFilename(std::string_view path) return (MeshMaterial*)material->clone(); } - CC_SAFE_DELETE(material); + AX_SAFE_DELETE(material); } return nullptr; } @@ -300,7 +300,7 @@ MeshMaterial* MeshMaterial::createWithProgramState(backend::ProgramState* progra mat->autorelease(); return mat; } - CC_SAFE_DELETE(mat); + AX_SAFE_DELETE(mat); return nullptr; } @@ -336,7 +336,7 @@ void MeshMaterialCache::destroyInstance() { if (_cacheInstance) { - CC_SAFE_DELETE(_cacheInstance); + AX_SAFE_DELETE(_cacheInstance); } } @@ -345,7 +345,7 @@ bool MeshMaterialCache::addMeshMaterial(std::string_view key, Texture2D* texture auto itr = _materials.find(key); if (itr == _materials.end()) { - CC_SAFE_RETAIN(texture); + AX_SAFE_RETAIN(texture); _materials.emplace(key, texture); return true; } @@ -366,7 +366,7 @@ void MeshMaterialCache::removeAllMeshMaterial() { for (auto& itr : _materials) { - CC_SAFE_RELEASE_NULL(itr.second); + AX_SAFE_RELEASE_NULL(itr.second); } _materials.clear(); } diff --git a/core/3d/CCMeshMaterial.h b/core/3d/CCMeshMaterial.h index 2e88a4552e..4ade01dd64 100644 --- a/core/3d/CCMeshMaterial.h +++ b/core/3d/CCMeshMaterial.h @@ -48,7 +48,7 @@ class ProgramState; /** * @brief MeshMaterial: a mesh material for MeshRenderers. */ -class CC_DLL MeshMaterial : public Material +class AX_DLL MeshMaterial : public Material { public: /** diff --git a/core/3d/CCMeshRenderer.cpp b/core/3d/CCMeshRenderer.cpp index 8d745c5094..297cfef339 100644 --- a/core/3d/CCMeshRenderer.cpp +++ b/core/3d/CCMeshRenderer.cpp @@ -58,7 +58,7 @@ MeshRenderer* MeshRenderer::create() mesh->autorelease(); return mesh; } - CC_SAFE_DELETE(mesh); + AX_SAFE_DELETE(mesh); return nullptr; } @@ -73,7 +73,7 @@ MeshRenderer* MeshRenderer::create(std::string_view modelPath) mesh->autorelease(); return mesh; } - CC_SAFE_DELETE(mesh); + AX_SAFE_DELETE(mesh); return nullptr; } MeshRenderer* MeshRenderer::create(std::string_view modelPath, std::string_view texturePath) @@ -118,7 +118,7 @@ void MeshRenderer::createAsync(std::string_view modelPath, mesh->_asyncLoadParam.meshdatas = new MeshDatas(); mesh->_asyncLoadParam.nodeDatas = new NodeDatas(); AsyncTaskPool::getInstance()->enqueue( - AsyncTaskPool::TaskType::TASK_IO, CC_CALLBACK_1(MeshRenderer::afterAsyncLoad, mesh), + AsyncTaskPool::TaskType::TASK_IO, AX_CALLBACK_1(MeshRenderer::afterAsyncLoad, mesh), (void*)(&mesh->_asyncLoadParam), [mesh]() { mesh->_asyncLoadParam.result = mesh->loadFromFile(mesh->_asyncLoadParam.modelFullPath, mesh->_asyncLoadParam.nodeDatas, @@ -136,7 +136,7 @@ void MeshRenderer::afterAsyncLoad(void* param) { _meshes.clear(); _meshVertexDatas.clear(); - CC_SAFE_RELEASE_NULL(_skeleton); + AX_SAFE_RELEASE_NULL(_skeleton); removeAllAttachNode(); // create in the main thread @@ -160,14 +160,14 @@ void MeshRenderer::afterAsyncLoad(void* param) MeshRendererCache::getInstance()->addMeshRenderData(asyncParam->modelPath, data); - CC_SAFE_DELETE(meshdatas); + AX_SAFE_DELETE(meshdatas); materialdatas = nullptr; nodeDatas = nullptr; } } - CC_SAFE_DELETE(meshdatas); - CC_SAFE_DELETE(materialdatas); - CC_SAFE_DELETE(nodeDatas); + AX_SAFE_DELETE(meshdatas); + AX_SAFE_DELETE(materialdatas); + AX_SAFE_DELETE(nodeDatas); if (asyncParam->texPath != "") { @@ -207,7 +207,7 @@ bool MeshRenderer::loadFromCache(std::string_view path) _meshVertexDatas.pushBack(it); } _skeleton = Skeleton3D::create(meshdata->nodedatas->skeleton); - CC_SAFE_RETAIN(_skeleton); + AX_SAFE_RETAIN(_skeleton); const bool singleMesh = (meshdata->nodedatas->nodes.size() == 1); for (const auto& it : meshdata->nodedatas->nodes) @@ -283,7 +283,7 @@ MeshRenderer::~MeshRenderer() { _meshes.clear(); _meshVertexDatas.clear(); - CC_SAFE_RELEASE_NULL(_skeleton); + AX_SAFE_RELEASE_NULL(_skeleton); removeAllAttachNode(); } @@ -301,7 +301,7 @@ bool MeshRenderer::initWithFile(std::string_view path) _aabbDirty = true; _meshes.clear(); _meshVertexDatas.clear(); - CC_SAFE_RELEASE_NULL(_skeleton); + AX_SAFE_RELEASE_NULL(_skeleton); removeAllAttachNode(); if (loadFromCache(path)) @@ -325,14 +325,14 @@ bool MeshRenderer::initWithFile(std::string_view path) } MeshRendererCache::getInstance()->addMeshRenderData(path, data); - CC_SAFE_DELETE(meshdatas); + AX_SAFE_DELETE(meshdatas); _contentSize = getBoundingBox().size; return true; } } - CC_SAFE_DELETE(meshdatas); - CC_SAFE_DELETE(materialdatas); - CC_SAFE_DELETE(nodeDatas); + AX_SAFE_DELETE(meshdatas); + AX_SAFE_DELETE(materialdatas); + AX_SAFE_DELETE(nodeDatas); return false; } @@ -350,7 +350,7 @@ bool MeshRenderer::initFrom(const NodeDatas& nodeDatas, const MeshDatas& meshdat } } _skeleton = Skeleton3D::create(nodeDatas.skeleton); - CC_SAFE_RETAIN(_skeleton); + AX_SAFE_RETAIN(_skeleton); auto size = nodeDatas.nodes.size(); for (const auto& it : nodeDatas.nodes) @@ -774,7 +774,7 @@ void MeshRenderer::visit(axis::Renderer* renderer, const axis::Mat4& parentTrans void MeshRenderer::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) { -#if CC_USE_CULLING +#if AX_USE_CULLING // TODO new-renderer: interface isVisibleInFrustum removal // camera clipping // if(_children.empty() && Camera::getVisitingCamera() && diff --git a/core/3d/CCMeshRenderer.h b/core/3d/CCMeshRenderer.h index 995cbf6e4a..0c9cc61c88 100644 --- a/core/3d/CCMeshRenderer.h +++ b/core/3d/CCMeshRenderer.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_MESH_RENDERER_H__ -#define __CC_MESH_RENDERER_H__ +#ifndef __AX_MESH_RENDERER_H__ +#define __AX_MESH_RENDERER_H__ #include @@ -53,7 +53,7 @@ struct NodeData; /** @brief MeshRenderer: A mesh can be loaded from model files, .obj, .c3t, .c3b *and a mesh renderer renders a list of these loaded meshes with specified materials */ -class CC_DLL MeshRenderer : public Node, public BlendProtocol +class AX_DLL MeshRenderer : public Node, public BlendProtocol { public: /** @@ -286,7 +286,7 @@ protected: /** * @brief MeshRendererCache: the cache data of MeshRenderer, used to speed up the creation process of MeshRenderer */ -class CC_DLL MeshRendererCache +class AX_DLL MeshRendererCache { public: struct MeshRenderData @@ -341,4 +341,4 @@ protected: /// @} NS_AX_END -#endif // __CC_MESH_RENDERER_H__ +#endif // __AX_MESH_RENDERER_H__ diff --git a/core/3d/CCMeshSkin.cpp b/core/3d/CCMeshSkin.cpp index 65f893251e..df25bc23a6 100644 --- a/core/3d/CCMeshSkin.cpp +++ b/core/3d/CCMeshSkin.cpp @@ -36,7 +36,7 @@ MeshSkin::MeshSkin() : _rootBone(nullptr), _skeleton(nullptr) {} MeshSkin::~MeshSkin() { removeAllBones(); - CC_SAFE_RELEASE(_skeleton); + AX_SAFE_RELEASE(_skeleton); } MeshSkin* MeshSkin::create(Skeleton3D* skeleton, @@ -127,7 +127,7 @@ ssize_t MeshSkin::getMatrixPaletteSizeInBytes() const void MeshSkin::removeAllBones() { _skinBones.clear(); - CC_SAFE_RELEASE(_rootBone); + AX_SAFE_RELEASE(_rootBone); } void MeshSkin::addSkinBone(Bone3D* bone) diff --git a/core/3d/CCMeshSkin.h b/core/3d/CCMeshSkin.h index b61d77b8c8..51c65afc5f 100644 --- a/core/3d/CCMeshSkin.h +++ b/core/3d/CCMeshSkin.h @@ -48,7 +48,7 @@ class Skeleton3D; * @js NA * @lua NA */ -class CC_DLL MeshSkin : public Ref +class AX_DLL MeshSkin : public Ref { friend class Mesh; diff --git a/core/3d/CCMeshVertexIndexData.cpp b/core/3d/CCMeshVertexIndexData.cpp index 0e0677e4ef..00188bd664 100644 --- a/core/3d/CCMeshVertexIndexData.cpp +++ b/core/3d/CCMeshVertexIndexData.cpp @@ -73,7 +73,7 @@ backend::Buffer* MeshIndexData::getVertexBuffer() const MeshIndexData::MeshIndexData() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { _indexBuffer->updateData((void*)_indexData.data(), _indexData.bsize()); }); @@ -83,7 +83,7 @@ MeshIndexData::MeshIndexData() void MeshIndexData::setIndexData(const axis::MeshData::IndexArray& indexdata) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA if (!_indexData.empty()) return; _indexData = indexdata; @@ -92,16 +92,16 @@ void MeshIndexData::setIndexData(const axis::MeshData::IndexArray& indexdata) MeshIndexData::~MeshIndexData() { - CC_SAFE_RELEASE(_indexBuffer); + AX_SAFE_RELEASE(_indexBuffer); _indexData.clear(); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } void MeshVertexData::setVertexData(const std::vector& vertexData) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA if (!_vertexData.empty()) return; _vertexData = vertexData; @@ -113,7 +113,7 @@ MeshVertexData* MeshVertexData::create(const MeshData& meshdata, CustomCommand:: auto vertexdata = new MeshVertexData(); vertexdata->_vertexBuffer = backend::Device::getInstance()->newBuffer( meshdata.vertex.size() * sizeof(meshdata.vertex[0]), backend::BufferType::VERTEX, backend::BufferUsage::STATIC); - // CC_SAFE_RETAIN(vertexdata->_vertexBuffer); + // AX_SAFE_RETAIN(vertexdata->_vertexBuffer); vertexdata->_sizePerVertex = meshdata.getPerVertexSize(); @@ -121,7 +121,7 @@ MeshVertexData* MeshVertexData::create(const MeshData& meshdata, CustomCommand:: if (vertexdata->_vertexBuffer) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA vertexdata->setVertexData(meshdata.vertex); vertexdata->_vertexBuffer->usingDefaultStoredData(false); #endif @@ -136,7 +136,7 @@ MeshVertexData* MeshVertexData::create(const MeshData& meshdata, CustomCommand:: auto indexBuffer = backend::Device::getInstance()->newBuffer( indices.bsize(), backend::BufferType::INDEX, backend::BufferUsage::STATIC); indexBuffer->autorelease(); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA indexBuffer->usingDefaultStoredData(false); #endif indexBuffer->updateData((void*)indices.data(), indices.bsize()); @@ -150,7 +150,7 @@ MeshVertexData* MeshVertexData::create(const MeshData& meshdata, CustomCommand:: } else indexdata = MeshIndexData::create(id, vertexdata, indexBuffer, meshdata.subMeshAABB[i]); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA indexdata->setIndexData(indices); #endif vertexdata->_indices.pushBack(indexdata); @@ -182,7 +182,7 @@ bool MeshVertexData::hasVertexAttrib(shaderinfos::VertexKey attrib) const MeshVertexData::MeshVertexData() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { _vertexBuffer->updateData((void*)_vertexData.data(), _vertexData.size() * sizeof(_vertexData[0])); }); @@ -192,10 +192,10 @@ MeshVertexData::MeshVertexData() MeshVertexData::~MeshVertexData() { - CC_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_vertexBuffer); _indices.clear(); _vertexData.clear(); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } diff --git a/core/3d/CCMeshVertexIndexData.h b/core/3d/CCMeshVertexIndexData.h index e32bb9ed90..0282c2db06 100644 --- a/core/3d/CCMeshVertexIndexData.h +++ b/core/3d/CCMeshVertexIndexData.h @@ -51,7 +51,7 @@ class MeshVertexData; * @js NA * @lua NA */ -class CC_DLL MeshIndexData : public Ref +class AX_DLL MeshIndexData : public Ref { public: /** create */ @@ -96,7 +96,7 @@ protected: friend class MeshVertexData; friend class MeshRenderer; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener = nullptr; #endif }; @@ -105,7 +105,7 @@ protected: * the MeshVertexData class. * @brief the MeshVertexData contain all of the vertices data which mesh need. */ -class CC_DLL MeshVertexData : public Ref +class AX_DLL MeshVertexData : public Ref { friend class MeshRenderer; friend class Mesh; @@ -149,7 +149,7 @@ protected: int _vertexCount = 0; // vertex count std::vector _vertexData; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener = nullptr; #endif }; diff --git a/core/3d/CCMotionStreak3D.cpp b/core/3d/CCMotionStreak3D.cpp index 5befbc9cd4..964d680f9f 100644 --- a/core/3d/CCMotionStreak3D.cpp +++ b/core/3d/CCMotionStreak3D.cpp @@ -54,7 +54,7 @@ MotionStreak3D::MotionStreak3D() MotionStreak3D::~MotionStreak3D() { - CC_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_texture); } MotionStreak3D* MotionStreak3D::create(float fade, @@ -70,7 +70,7 @@ MotionStreak3D* MotionStreak3D::create(float fade, return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -83,7 +83,7 @@ MotionStreak3D* MotionStreak3D::create(float fade, float minSeg, float stroke, c return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -274,8 +274,8 @@ void MotionStreak3D::setTexture(Texture2D* texture) { if (_texture != texture) { - CC_SAFE_RETAIN(texture); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RETAIN(texture); + AX_SAFE_RELEASE(_texture); _texture = texture; _programState->setTexture(_locTexture, 0, _texture->getBackendTexture()); } @@ -432,8 +432,8 @@ void MotionStreak3D::draw(Renderer* renderer, const Mat4& transform, uint32_t fl _programState->setUniform(_locMVP, mvpMatrix.m, sizeof(mvpMatrix.m)); - beforeCommand->func = CC_CALLBACK_0(MotionStreak3D::onBeforeDraw, this); - afterCommand->func = CC_CALLBACK_0(MotionStreak3D::onAfterDraw, this); + beforeCommand->func = AX_CALLBACK_0(MotionStreak3D::onBeforeDraw, this); + afterCommand->func = AX_CALLBACK_0(MotionStreak3D::onAfterDraw, this); _customCommand.updateVertexBuffer(_vertexData.data(), sizeof(_vertexData[0]) * _nuPoints * 2); @@ -442,7 +442,7 @@ void MotionStreak3D::draw(Renderer* renderer, const Mat4& transform, uint32_t fl renderer->addCommand(beforeCommand); renderer->addCommand(&_customCommand); renderer->addCommand(afterCommand); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _nuPoints * 2); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _nuPoints * 2); } void MotionStreak3D::onBeforeDraw() diff --git a/core/3d/CCMotionStreak3D.h b/core/3d/CCMotionStreak3D.h index eb8282327d..a93ad8ef85 100644 --- a/core/3d/CCMotionStreak3D.h +++ b/core/3d/CCMotionStreak3D.h @@ -22,8 +22,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_MOTION_STREAK3D_H__ -#define __CC_MOTION_STREAK3D_H__ +#ifndef __AX_MOTION_STREAK3D_H__ +#define __AX_MOTION_STREAK3D_H__ #include "base/CCProtocols.h" #include "2d/CCNode.h" @@ -44,7 +44,7 @@ class Texture2D; /** @class MotionStreak3D. * @brief Creates a trailing path. It is created from a line segment sweeping along the path. */ -class CC_DLL MotionStreak3D : public Node, public TextureProtocol +class AX_DLL MotionStreak3D : public Node, public TextureProtocol { public: /** Creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture @@ -203,7 +203,7 @@ protected: CustomCommand _customCommand; private: - CC_DISALLOW_COPY_AND_ASSIGN(MotionStreak3D); + AX_DISALLOW_COPY_AND_ASSIGN(MotionStreak3D); //CallbackCommand _beforeCommand; //CallbackCommand _afterCommand; @@ -222,4 +222,4 @@ private: NS_AX_END -#endif //__CC_MOTION_STREAK3D_H__ +#endif //__AX_MOTION_STREAK3D_H__ diff --git a/core/3d/CCOBB.cpp b/core/3d/CCOBB.cpp index c7846bb762..63dcc7fc9d 100644 --- a/core/3d/CCOBB.cpp +++ b/core/3d/CCOBB.cpp @@ -85,7 +85,7 @@ static float& _getElement(Vec3& point, int index) if (index == 2) return point.z; - CC_ASSERT(0); + AX_ASSERT(0); return point.x; } diff --git a/core/3d/CCOBB.h b/core/3d/CCOBB.h index 2cd6babbd6..58819e1e98 100644 --- a/core/3d/CCOBB.h +++ b/core/3d/CCOBB.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_OBB_H__ -#define __CC_OBB_H__ +#ifndef __AX_OBB_H__ +#define __AX_OBB_H__ #include "3d/CCAABB.h" @@ -41,7 +41,7 @@ NS_AX_BEGIN * MeshRenderer. so collision detection is more precise than AABB. * @js NA */ -class CC_DLL OBB +class AX_DLL OBB { public: OBB(); diff --git a/core/3d/CCPlane.h b/core/3d/CCPlane.h index f8e8cd0913..6301068226 100644 --- a/core/3d/CCPlane.h +++ b/core/3d/CCPlane.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PLANE_H_ -#define __CC_PLANE_H_ +#ifndef __AX_PLANE_H_ +#define __AX_PLANE_H_ #include "base/ccMacros.h" #include "math/CCMath.h" @@ -43,7 +43,7 @@ enum class PointSide * @js NA * @lua NA **/ -class CC_DLL Plane +class AX_DLL Plane { public: /** diff --git a/core/3d/CCRay.h b/core/3d/CCRay.h index dccea23361..e0575c19c1 100644 --- a/core/3d/CCRay.h +++ b/core/3d/CCRay.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_RAY_H_ -#define __CC_RAY_H_ +#ifndef __AX_RAY_H_ +#define __AX_RAY_H_ #include "math/CCMath.h" #include "3d/CCAABB.h" @@ -42,7 +42,7 @@ NS_AX_BEGIN * @brief Ray is a line with one end. usually use it to check intersects with some object,such as Plane, OBB, AABB * @js NA **/ -class CC_DLL Ray +class AX_DLL Ray { public: /** diff --git a/core/3d/CCSkeleton3D.h b/core/3d/CCSkeleton3D.h index ea86fc6367..1b52540074 100644 --- a/core/3d/CCSkeleton3D.h +++ b/core/3d/CCSkeleton3D.h @@ -41,7 +41,7 @@ NS_AX_BEGIN * @brief Defines a basic hierarchical structure of transformation spaces. * @lua NA */ -class CC_DLL Bone3D : public Ref +class AX_DLL Bone3D : public Ref { friend class Skeleton3D; friend class MeshSkin; @@ -177,7 +177,7 @@ protected: * Skeleton * */ -class CC_DLL Skeleton3D : public Ref +class AX_DLL Skeleton3D : public Ref { public: /** diff --git a/core/3d/CCSkybox.cpp b/core/3d/CCSkybox.cpp index 5b78572db3..07926f50eb 100644 --- a/core/3d/CCSkybox.cpp +++ b/core/3d/CCSkybox.cpp @@ -60,8 +60,8 @@ bool Skybox::init() _customCommand.setTransparent(false); _customCommand.set3D(true); - _customCommand.setBeforeCallback(CC_CALLBACK_0(Skybox::onBeforeDraw, this)); - _customCommand.setAfterCallback(CC_CALLBACK_0(Skybox::onAfterDraw, this)); + _customCommand.setBeforeCallback(AX_CALLBACK_0(Skybox::onBeforeDraw, this)); + _customCommand.setAfterCallback(AX_CALLBACK_0(Skybox::onAfterDraw, this)); // create and set our custom shader auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::SKYBOX_3D); @@ -162,13 +162,13 @@ void Skybox::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) _programState->setUniform(_uniformColorLoc, &color, sizeof(color)); _programState->setUniform(_uniformCameraRotLoc, cameraModelMat.m, sizeof(cameraModelMat.m)); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 4); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 4); } void Skybox::setTexture(TextureCube* texture) { CCASSERT(texture != nullptr, __FUNCTION__); - CC_SAFE_RELEASE_NULL(_texture); + AX_SAFE_RELEASE_NULL(_texture); texture->retain(); _texture = texture; _programState->setTexture(_uniformEnvLoc, 0, _texture->getBackendTexture()); diff --git a/core/3d/CCSkybox.h b/core/3d/CCSkybox.h index 62497d0893..0a8acd6a0b 100644 --- a/core/3d/CCSkybox.h +++ b/core/3d/CCSkybox.h @@ -44,7 +44,7 @@ class TextureCube; /** * Sky box technology is usually used to simulate infinity sky, mountains and other phenomena. */ -class CC_DLL Skybox : public Node +class AX_DLL Skybox : public Node { public: CREATE_FUNC(Skybox); @@ -109,7 +109,7 @@ protected: TextureCube* _texture; private: - CC_DISALLOW_COPY_AND_ASSIGN(Skybox); + AX_DISALLOW_COPY_AND_ASSIGN(Skybox); backend::UniformLocation _uniformColorLoc; backend::UniformLocation _uniformCameraRotLoc; diff --git a/core/3d/CCTerrain.cpp b/core/3d/CCTerrain.cpp index e8dcb8b369..c72375ee7f 100644 --- a/core/3d/CCTerrain.cpp +++ b/core/3d/CCTerrain.cpp @@ -61,7 +61,7 @@ Terrain* Terrain::create(TerrainData& parameter, CrackFixedType fixedType) terrain->autorelease(); return terrain; } - CC_SAFE_DELETE(terrain); + AX_SAFE_DELETE(terrain); return terrain; } bool Terrain::initWithTerrainData(TerrainData& parameter, CrackFixedType fixedType) @@ -85,7 +85,7 @@ bool Terrain::initWithTerrainData(TerrainData& parameter, CrackFixedType fixedTy void axis::Terrain::setLightMap(std::string_view fileName) { - CC_SAFE_RELEASE(_lightMap); + AX_SAFE_RELEASE(_lightMap); auto image = new Image(); image->initWithImageFile(fileName); _lightMap = new Texture2D(); @@ -162,7 +162,7 @@ void Terrain::draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32 { int hasLightMap = 0; _programState->setUniform(_lightMapCheckLocation, &hasLightMap, sizeof(hasLightMap)); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _programState->setTexture(_lightMapLocation, 5, _dummyTexture->getBackendTexture()); #endif } @@ -255,22 +255,22 @@ Terrain::Terrain() : _alphaMap(nullptr) , _lightMap(nullptr) , _lightDir(-1.f, -1.f, 0.f) -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA , _backToForegroundListener(nullptr) #endif { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { reload(); }); _director->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, 1); #endif -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL auto image = new Image(); - bool CC_UNUSED isOK = image->initWithRawData(cc_2x2_white_image, sizeof(cc_2x2_white_image), 2, 2, 8); + bool AX_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); - CC_SAFE_RELEASE(image); + AX_SAFE_RELEASE(image); #endif } @@ -465,10 +465,10 @@ void Terrain::setIsEnableFrustumCull(bool bool_value) Terrain::~Terrain() { - CC_SAFE_RELEASE(_alphaMap); - CC_SAFE_RELEASE(_lightMap); - CC_SAFE_RELEASE(_heightMapImage); - CC_SAFE_RELEASE(_dummyTexture); + AX_SAFE_RELEASE(_alphaMap); + AX_SAFE_RELEASE(_lightMap); + AX_SAFE_RELEASE(_heightMapImage); + AX_SAFE_RELEASE(_dummyTexture); delete _quadRoot; for (int i = 0; i < 4; ++i) { @@ -488,7 +488,7 @@ Terrain::~Terrain() } } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _director->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -674,8 +674,8 @@ Terrain::Chunk* axis::Terrain::getChunkByIndex(int x, int y) const void Terrain::setAlphaMap(axis::Texture2D* newAlphaMapTexture) { - CC_SAFE_RETAIN(newAlphaMapTexture); - CC_SAFE_RELEASE(_alphaMap); + AX_SAFE_RETAIN(newAlphaMapTexture); + AX_SAFE_RELEASE(_alphaMap); _alphaMap = newAlphaMapTexture; } @@ -738,7 +738,7 @@ Terrain::ChunkIndices Terrain::insertIndicesLOD(int neighborLod[4], int selfLod, backend::BufferUsage::STATIC); buffer->updateData(indices, sizeof(uint16_t) * size); - CC_SAFE_RELEASE_NULL(lodIndices._chunkIndices._indexBuffer); + AX_SAFE_RELEASE_NULL(lodIndices._chunkIndices._indexBuffer); lodIndices._chunkIndices._indexBuffer = buffer; this->_chunkLodIndicesSet.push_back(lodIndices); return lodIndices._chunkIndices; @@ -776,7 +776,7 @@ Terrain::ChunkIndices Terrain::insertIndicesLODSkirt(int selfLod, uint16_t* indi backend::BufferUsage::STATIC); buffer->updateData(indices, sizeof(uint16_t) * size); - CC_SAFE_RELEASE_NULL(skirtIndices._chunkIndices._indexBuffer); + AX_SAFE_RELEASE_NULL(skirtIndices._chunkIndices._indexBuffer); skirtIndices._chunkIndices._indexBuffer = buffer; this->_chunkLodIndicesSkirtSet.push_back(skirtIndices); return skirtIndices._chunkIndices; @@ -931,7 +931,7 @@ void Terrain::Chunk::finish() // the second vbo for the indices, because we use level of detail technique to each chunk, so we will modified // frequently - CC_SAFE_RELEASE_NULL(_buffer); + AX_SAFE_RELEASE_NULL(_buffer); _buffer = backend::Device::getInstance()->newBuffer(sizeof(TerrainVertexData) * _originalVertices.size(), backend::BufferType::VERTEX, backend::BufferUsage::DYNAMIC); @@ -977,7 +977,7 @@ void Terrain::Chunk::bindAndDraw() _command.getPipelineDescriptor().programState = _terrain->_programState; _command.setIndexDrawInfo(0, _chunkIndices._size); renderer->addCommand(&_command); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _chunkIndices._size); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _chunkIndices._size); } void Terrain::Chunk::generate(int imgWidth, int imageHei, int m, int n, const unsigned char* /*data*/) @@ -1099,8 +1099,8 @@ Terrain::Chunk::Chunk(Terrain* terrain) _command.setPrimitiveType(MeshCommand::PrimitiveType::TRIANGLE); _command.setDrawType(MeshCommand::DrawType::ELEMENT); - _command.setBeforeCallback(CC_CALLBACK_0(Terrain::onBeforeDraw, terrain)); - _command.setAfterCallback(CC_CALLBACK_0(Terrain::onAfterDraw, terrain)); + _command.setBeforeCallback(AX_CALLBACK_0(Terrain::onBeforeDraw, terrain)); + _command.setAfterCallback(AX_CALLBACK_0(Terrain::onAfterDraw, terrain)); auto& pipelineDescriptor = _command.getPipelineDescriptor(); pipelineDescriptor.blendDescriptor.blendEnabled = false; @@ -1438,7 +1438,7 @@ void Terrain::Chunk::updateVerticesForLOD() Terrain::Chunk::~Chunk() { - CC_SAFE_RELEASE_NULL(_buffer); + AX_SAFE_RELEASE_NULL(_buffer); } void Terrain::Chunk::updateIndicesLODSkirt() @@ -1708,7 +1708,7 @@ Terrain::TerrainData::TerrainData() {} Terrain::ChunkIndices::ChunkIndices(const Terrain::ChunkIndices& other) { _indexBuffer = other._indexBuffer; - CC_SAFE_RETAIN(_indexBuffer); + AX_SAFE_RETAIN(_indexBuffer); _size = other._size; } @@ -1716,9 +1716,9 @@ Terrain::ChunkIndices& Terrain::ChunkIndices::operator=(const Terrain::ChunkIndi { if (other._indexBuffer != _indexBuffer) { - CC_SAFE_RELEASE_NULL(_indexBuffer); + AX_SAFE_RELEASE_NULL(_indexBuffer); _indexBuffer = other._indexBuffer; - CC_SAFE_RETAIN(_indexBuffer); + AX_SAFE_RETAIN(_indexBuffer); } _size = other._size; return *this; @@ -1726,7 +1726,7 @@ Terrain::ChunkIndices& Terrain::ChunkIndices::operator=(const Terrain::ChunkIndi Terrain::ChunkIndices::~ChunkIndices() { - CC_SAFE_RELEASE_NULL(_indexBuffer); + AX_SAFE_RELEASE_NULL(_indexBuffer); } Terrain::DetailMap::DetailMap(std::string_view detailMapPath, float size /*= 35*/) diff --git a/core/3d/CCTerrain.h b/core/3d/CCTerrain.h index 619027a4db..12f0ec15ca 100644 --- a/core/3d/CCTerrain.h +++ b/core/3d/CCTerrain.h @@ -89,7 +89,7 @@ NS_AX_BEGIN * We can use ray-terrain intersection to pick a point of the terrain; * Also we can get an arbitrary point of the terrain's height and normal vector for convenience . **/ -class CC_DLL Terrain : public Node +class AX_DLL Terrain : public Node { public: /**the crack fix type. use to fix the gaps between different LOD chunks */ @@ -104,7 +104,7 @@ public: *this struct maintain a detail map data ,including source file ,detail size. *the DetailMap can use for terrain splatting **/ - struct CC_DLL DetailMap + struct AX_DLL DetailMap { /*Constructors*/ DetailMap(); @@ -131,7 +131,7 @@ public: *TerrainData *This TerrainData struct warp all parameter that Terrain need to create */ - struct CC_DLL TerrainData + struct AX_DLL TerrainData { /**empty constructor*/ TerrainData(); @@ -205,7 +205,7 @@ private: /* *terrain vertices internal data format **/ - struct CC_DLL TerrainVertexData + struct AX_DLL TerrainVertexData { /*constructor*/ TerrainVertexData(){}; @@ -220,7 +220,7 @@ private: axis::Vec3 _normal; }; - struct CC_DLL QuadTree; + struct AX_DLL QuadTree; /* *the terminal node of quad, use to subdivision terrain mesh and LOD **/ @@ -298,7 +298,7 @@ private: *QuadTree * @brief use to hierarchically frustum culling and set LOD **/ - struct CC_DLL QuadTree + struct AX_DLL QuadTree { /**constructor*/ QuadTree(int x, int y, int width, int height, Terrain* terrain); @@ -569,7 +569,7 @@ private: backend::UniformLocation _lightDirLocation; backend::UniformLocation _mvpMatrixLocation; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener; #endif }; diff --git a/core/3d/CCVertexAttribBinding.cpp b/core/3d/CCVertexAttribBinding.cpp index 21ac744d76..9db0148f41 100644 --- a/core/3d/CCVertexAttribBinding.cpp +++ b/core/3d/CCVertexAttribBinding.cpp @@ -43,8 +43,8 @@ VertexAttribBinding::~VertexAttribBinding() __vertexAttribBindingCache.erase(itr); } - CC_SAFE_RELEASE(_meshIndexData); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_meshIndexData); + AX_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]; - CC_ASSERT(b); + AX_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 c4bad32dc1..79ee0463d8 100644 --- a/core/3d/CCVertexAttribBinding.h +++ b/core/3d/CCVertexAttribBinding.h @@ -54,7 +54,7 @@ class VertexAttribValue; * arrays, since it is slower than the server-side VAOs used by OpenGL * (when creating a VertexAttribBinding between a Mesh and Effect). */ -class CC_DLL VertexAttribBinding : public Ref +class AX_DLL VertexAttribBinding : public Ref { public: /** diff --git a/core/audio/AudioCache.h b/core/audio/AudioCache.h index 32a3abfe8b..020cd19d72 100644 --- a/core/audio/AudioCache.h +++ b/core/audio/AudioCache.h @@ -43,7 +43,7 @@ NS_AX_BEGIN class AudioEngineImpl; class AudioPlayer; -class CC_DLL AudioCache +class AX_DLL AudioCache { public: enum class State diff --git a/core/audio/AudioDecoderMp3.cpp b/core/audio/AudioDecoderMp3.cpp index 2280f3a208..bd60e87fb3 100644 --- a/core/audio/AudioDecoderMp3.cpp +++ b/core/audio/AudioDecoderMp3.cpp @@ -32,7 +32,7 @@ #include "base/CCConsole.h" -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 # define MINIMP3_IMPLEMENTATION # include "minimp3/minimp3_ex.h" #else @@ -41,12 +41,12 @@ # include "mpg123.h" #endif -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include # include #endif -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 struct mp3dec_impl { mp3dec_ex_t _dec; @@ -56,7 +56,7 @@ struct mp3dec_impl NS_AX_BEGIN -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 static size_t minimp3_read_r(void* buf, size_t size, void* user_data) { return ((FileStream*)user_data)->read(buf, size); @@ -87,7 +87,7 @@ void mpg123_close_r(void* handle) bool AudioDecoderMp3::lazyInit() { bool ret = true; -#if CC_USE_MPG123 +#if AX_USE_MPG123 if (!__mp3Inited) { int error = mpg123_init(); @@ -107,7 +107,7 @@ bool AudioDecoderMp3::lazyInit() void AudioDecoderMp3::destroy() { -#if CC_USE_MPG123 +#if AX_USE_MPG123 if (__mp3Inited) { mpg123_exit(); @@ -128,7 +128,7 @@ AudioDecoderMp3::~AudioDecoderMp3() bool AudioDecoderMp3::open(std::string_view fullPath) { -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 do { _fileStream = FileUtils::getInstance()->openFileStream(fullPath, FileStream::Mode::READ); @@ -245,7 +245,7 @@ void AudioDecoderMp3::close() { if (isOpened()) { -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 if (_handle) { mp3dec_ex_close(&_handle->_dec); @@ -270,7 +270,7 @@ void AudioDecoderMp3::close() uint32_t AudioDecoderMp3::read(uint32_t framesToRead, char* pcmBuf) { -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 auto sampelsToRead = framesToRead * _channelCount; auto samplesRead = mp3dec_ex_read(&_handle->_dec, (mp3d_sample_t*)pcmBuf, sampelsToRead); return static_cast(samplesRead / _channelCount); @@ -290,7 +290,7 @@ uint32_t AudioDecoderMp3::read(uint32_t framesToRead, char* pcmBuf) bool AudioDecoderMp3::seek(uint32_t frameOffset) { -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 return 0 == mp3dec_ex_seek(&_handle->_dec, frameOffset); #else off_t offset = mpg123_seek(_handle, frameOffset, SEEK_SET); diff --git a/core/audio/AudioDecoderMp3.h b/core/audio/AudioDecoderMp3.h index c942cab42d..a240c0418c 100644 --- a/core/audio/AudioDecoderMp3.h +++ b/core/audio/AudioDecoderMp3.h @@ -29,11 +29,11 @@ #include "audio/AudioDecoder.h" #include -#if !defined(CC_USE_MPG123) -# define CC_USE_MPG123 0 +#if !defined(AX_USE_MPG123) +# define AX_USE_MPG123 0 #endif -#if !CC_USE_MPG123 +#if !AX_USE_MPG123 typedef struct mp3dec_impl* mp3dec_handle_t; #else typedef struct mpg123_handle_struct* mp3dec_handle_t; diff --git a/core/audio/AudioDecoderOgg.cpp b/core/audio/AudioDecoderOgg.cpp index 21ef0bb452..27da9595f5 100644 --- a/core/audio/AudioDecoderOgg.cpp +++ b/core/audio/AudioDecoderOgg.cpp @@ -30,7 +30,7 @@ #include "audio/AudioMacros.h" #include "platform/CCFileUtils.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include # include #endif diff --git a/core/audio/AudioEngine.cpp b/core/audio/AudioEngine.cpp index 92909701de..2410772e5b 100644 --- a/core/audio/AudioEngine.cpp +++ b/core/audio/AudioEngine.cpp @@ -196,7 +196,7 @@ AUDIO_ID AudioEngine::play2d(std::string_view filePath, bool loop, float volume, auto profileHelper = _defaultProfileHelper; if (profile && profile != &profileHelper->profile) { - CC_ASSERT(!profile->name.empty()); + AX_ASSERT(!profile->name.empty()); profileHelper = &_audioPathProfileHelperMap[profile->name]; profileHelper->profile = *profile; } diff --git a/core/audio/AudioEngine.h b/core/audio/AudioEngine.h index a239877efa..90fdaca512 100644 --- a/core/audio/AudioEngine.h +++ b/core/audio/AudioEngine.h @@ -52,7 +52,7 @@ NS_AX_BEGIN * @brief * @js NA */ -class CC_DLL AudioProfile +class AX_DLL AudioProfile { public: // Profile name can't be empty. @@ -82,7 +82,7 @@ class AudioEngineImpl; * @js NA */ -class CC_DLL AudioEngine +class AX_DLL AudioEngine { public: /** AudioState enum,all possible states of an audio instance.*/ diff --git a/core/audio/AudioEngineImpl.cpp b/core/audio/AudioEngineImpl.cpp index aacf28172e..4834d22f6c 100644 --- a/core/audio/AudioEngineImpl.cpp +++ b/core/audio/AudioEngineImpl.cpp @@ -31,7 +31,7 @@ #include "audio/AudioEngineImpl.h" #include "audio/AudioDecoderManager.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC # import #endif @@ -41,7 +41,7 @@ #include "base/CCScheduler.h" #include "base/ccUtils.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS # import #endif @@ -100,7 +100,7 @@ static ALenum alSourceAddNotificationExt(ALuint sid, return AL_INVALID_VALUE; } -# if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +# if AX_TARGET_PLATFORM == AX_PLATFORM_IOS @interface AudioEngineSessionHandler : NSObject { } @@ -269,7 +269,7 @@ AudioEngineImpl::~AudioEngineImpl() { if (_scheduled && _scheduler != nullptr) { - _scheduler->unschedule(CC_SCHEDULE_SELECTOR(AudioEngineImpl::update), this); + _scheduler->unschedule(AX_SCHEDULE_SELECTOR(AudioEngineImpl::update), this); } if (s_ALContext) @@ -291,7 +291,7 @@ AudioEngineImpl::~AudioEngineImpl() AudioDecoderManager::destroy(); -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS [s_AudioEngineSessionHandler release]; #endif s_instance = nullptr; @@ -302,7 +302,7 @@ bool AudioEngineImpl::init() bool ret = false; do { -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS s_AudioEngineSessionHandler = [[AudioEngineSessionHandler alloc] init]; #endif @@ -476,7 +476,7 @@ AUDIO_ID AudioEngineImpl::play2d(std::string_view filePath, bool loop, float vol if (!_scheduled) { _scheduled = true; - _scheduler->schedule(CC_SCHEDULE_SELECTOR(AudioEngineImpl::update), this, 0.05f, false); + _scheduler->schedule(AX_SCHEDULE_SELECTOR(AudioEngineImpl::update), this, 0.05f, false); } return _currentAudioID; @@ -852,7 +852,7 @@ void AudioEngineImpl::_unscheduleUpdate() if (_scheduled) { _scheduled = false; - _scheduler->unschedule(CC_SCHEDULE_SELECTOR(AudioEngineImpl::update), this); + _scheduler->unschedule(AX_SCHEDULE_SELECTOR(AudioEngineImpl::update), this); } } diff --git a/core/audio/AudioEngineImpl.h b/core/audio/AudioEngineImpl.h index 9ec33a0b16..f8a9c3a342 100644 --- a/core/audio/AudioEngineImpl.h +++ b/core/audio/AudioEngineImpl.h @@ -42,7 +42,7 @@ NS_AX_BEGIN class Scheduler; -class CC_DLL AudioEngineImpl : public axis::Ref +class AX_DLL AudioEngineImpl : public axis::Ref { public: AudioEngineImpl(); diff --git a/core/audio/AudioMacros.h b/core/audio/AudioMacros.h index 5de56024da..2498535b15 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 CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include "base/ccUTF8.h" // for StringUtils::format # define AUDIO_LOG(fmt, ...) OutputDebugStringA(StringUtils::format((fmt "\r\n"), ##__VA_ARGS__).c_str()) -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include # define AUDIO_LOG(fmt, ...) __android_log_print(ANDROID_LOG_DEBUG, "AudioEngine", fmt, ##__VA_ARGS__) #else // other platforms diff --git a/core/audio/AudioPlayer.cpp b/core/audio/AudioPlayer.cpp index 50ef6bab0b..622c131975 100644 --- a/core/audio/AudioPlayer.cpp +++ b/core/audio/AudioPlayer.cpp @@ -125,7 +125,7 @@ void AudioPlayer::destroy() _rotateBufferThread = nullptr; ALOGVV("rotateBufferThread exited!"); -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS // some specific OpenAL implement defects existed on iOS platform // refer to: https://github.com/cocos2d/cocos2d-x/issues/18597 ALint sourceState; diff --git a/core/audio/AudioPlayer.h b/core/audio/AudioPlayer.h index 048b79fe4e..bb4e19ece2 100644 --- a/core/audio/AudioPlayer.h +++ b/core/audio/AudioPlayer.h @@ -43,7 +43,7 @@ NS_AX_BEGIN class AudioCache; class AudioEngineImpl; -class CC_DLL AudioPlayer +class AX_DLL AudioPlayer { friend class AudioEngineImpl; diff --git a/core/axis.cpp b/core/axis.cpp index f83161bdcc..6e5ab82c80 100644 --- a/core/axis.cpp +++ b/core/axis.cpp @@ -31,12 +31,12 @@ THE SOFTWARE. NS_AX_BEGIN -CC_DLL const char* axisVersion() +AX_DLL const char* axisVersion() { return "axis-1.0.0b9"; } -CC_DLL const char* cocos2dVersion() +AX_DLL const char* cocos2dVersion() { return axisVersion(); } diff --git a/core/axis.h b/core/axis.h index cc115694ff..584ca965eb 100644 --- a/core/axis.h +++ b/core/axis.h @@ -183,13 +183,13 @@ THE SOFTWARE. #include "platform/CCPlatformMacros.h" #include "platform/CCSAXParser.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # include "platform/ios/CCApplication-ios.h" # include "platform/ios/CCGLViewImpl-ios.h" # include "platform/ios/CCStdC-ios.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_IOS -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "platform/android/CCApplication-android.h" # include "platform/android/CCGLViewImpl-android.h" # include "platform/android/CCGL-android.h" @@ -197,27 +197,27 @@ THE SOFTWARE. // Enhance modification begin # include "platform/android/CCEnhanceAPI-android.h" // Enhance modification end -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "platform/win32/CCApplication-win32.h" # include "platform/desktop/CCGLViewImpl-desktop.h" # include "platform/win32/CCGL-win32.h" # include "platform/win32/CCStdC-win32.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # include "platform/desktop/CCGLViewImpl-desktop.h" # include "platform/mac/CCApplication-mac.h" # include "platform/mac/CCStdC-mac.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_MAC -#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) # include "platform/linux/CCApplication-linux.h" # include "platform/desktop/CCGLViewImpl-desktop.h" # include "platform/linux/CCGL-linux.h" # include "platform/linux/CCStdC-linux.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_LINUX // script_support #include "base/CCScriptSupport.h" @@ -272,7 +272,7 @@ THE SOFTWARE. NS_AX_BEGIN -CC_DLL const char* axisVersion(); +AX_DLL const char* axisVersion(); NS_AX_END diff --git a/core/base/CCAsyncTaskPool.h b/core/base/CCAsyncTaskPool.h index da9711419c..27218ccca1 100644 --- a/core/base/CCAsyncTaskPool.h +++ b/core/base/CCAsyncTaskPool.h @@ -50,7 +50,7 @@ NS_AX_BEGIN * @brief This class allows to perform background operations without having to manipulate threads. * @js NA */ -class CC_DLL AsyncTaskPool +class AX_DLL AsyncTaskPool { public: typedef std::function TaskCallBack; @@ -174,7 +174,7 @@ protected: // don't allow enqueueing after stopping the pool if (_stop) { - CC_ASSERT(0 && "already stop"); + AX_ASSERT(0 && "already stop"); return; } diff --git a/core/base/CCAutoreleasePool.cpp b/core/base/CCAutoreleasePool.cpp index 9b7230a57d..d288326b3d 100644 --- a/core/base/CCAutoreleasePool.cpp +++ b/core/base/CCAutoreleasePool.cpp @@ -162,7 +162,7 @@ void PoolManager::push(AutoreleasePool* pool) void PoolManager::pop() { - CC_ASSERT(!_releasePoolStack.empty()); + AX_ASSERT(!_releasePoolStack.empty()); _releasePoolStack.pop_back(); } diff --git a/core/base/CCAutoreleasePool.h b/core/base/CCAutoreleasePool.h index 583558cde8..1e310b1d70 100644 --- a/core/base/CCAutoreleasePool.h +++ b/core/base/CCAutoreleasePool.h @@ -40,7 +40,7 @@ NS_AX_BEGIN * A pool for managing autorelease objects. * @js NA */ -class CC_DLL AutoreleasePool +class AX_DLL AutoreleasePool { public: /** @@ -149,7 +149,7 @@ private: /** * @cond */ -class CC_DLL PoolManager +class AX_DLL PoolManager { public: static PoolManager* getInstance(); diff --git a/core/base/CCConfiguration.cpp b/core/base/CCConfiguration.cpp index 561fad0d88..6876585dfe 100644 --- a/core/base/CCConfiguration.cpp +++ b/core/base/CCConfiguration.cpp @@ -68,13 +68,13 @@ bool Configuration::init() { _valueDict["axis.version"] = Value(axisVersion()); -#if CC_ENABLE_PROFILERS +#if AX_ENABLE_PROFILERS _valueDict["axis.compiled_with_profiler"] = Value(true); #else _valueDict["axis.compiled_with_profiler"] = Value(false); #endif -#if CC_ENABLE_GL_STATE_CACHE == 0 +#if AX_ENABLE_GL_STATE_CACHE == 0 _valueDict["axis.compiled_with_gl_state_cache"] = Value(false); #else _valueDict["axis.compiled_with_gl_state_cache"] = Value(true); @@ -91,21 +91,21 @@ bool Configuration::init() Configuration::~Configuration() { - CC_SAFE_DELETE(_loadedEvent); + AX_SAFE_DELETE(_loadedEvent); } std::string Configuration::getInfo() const { // And Dump some warnings as well -#if CC_ENABLE_PROFILERS +#if AX_ENABLE_PROFILERS CCLOG( - "cocos2d: **** WARNING **** CC_ENABLE_PROFILERS is defined. Disable it when you finish profiling (from " + "cocos2d: **** WARNING **** AX_ENABLE_PROFILERS is defined. Disable it when you finish profiling (from " "ccConfig.h)\n"); #endif -#if CC_ENABLE_GL_STATE_CACHE == 0 +#if AX_ENABLE_GL_STATE_CACHE == 0 CCLOG( - "cocos2d: **** WARNING **** CC_ENABLE_GL_STATE_CACHE is disabled. To improve performance, enable it (from " + "cocos2d: **** WARNING **** AX_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() { - CC_SAFE_RELEASE_NULL(s_sharedConfiguration); + AX_SAFE_RELEASE_NULL(s_sharedConfiguration); } bool Configuration::checkForGLExtension(std::string_view searchName) const @@ -259,7 +259,7 @@ bool Configuration::supportsDiscardFramebuffer() const bool Configuration::supportsShareableVAO() const { -#if CC_TEXTURE_ATLAS_USE_VAO +#if AX_TEXTURE_ATLAS_USE_VAO return _supportsShareableVAO; #else return false; @@ -276,7 +276,7 @@ bool Configuration::supportsMapBuffer() const // is always implemented in OpenGL. // XXX: Warning. On iOS this is always `true`. Avoiding the comparison. -#if defined(CC_USE_GLES) && !defined(__APPLE__) +#if defined(AX_USE_GLES) && !defined(__APPLE__) return _supportsOESMapBuffer; #else return true; diff --git a/core/base/CCConfiguration.h b/core/base/CCConfiguration.h index 254181c40f..fa6012c1a1 100644 --- a/core/base/CCConfiguration.h +++ b/core/base/CCConfiguration.h @@ -47,7 +47,7 @@ class EventCustom; * @since v0.99.0 * @js NA */ -class CC_DLL Configuration : public Ref +class AX_DLL Configuration : public Ref { public: /** Returns a shared instance of Configuration. diff --git a/core/base/CCConsole.cpp b/core/base/CCConsole.cpp index a4d353ce00..cee6f9a13e 100644 --- a/core/base/CCConsole.cpp +++ b/core/base/CCConsole.cpp @@ -60,12 +60,12 @@ // !FIXME: the previous version of axis::log not thread safe // since axis make it multi-threading safe by default -#if !defined(CC_LOG_MULTITHREAD) -# define CC_LOG_MULTITHREAD 1 +#if !defined(AX_LOG_MULTITHREAD) +# define AX_LOG_MULTITHREAD 1 #endif -#if !defined(CC_LOG_TO_CONSOLE) -# define CC_LOG_TO_CONSOLE 1 +#if !defined(AX_LOG_TO_CONSOLE) +# define AX_LOG_TO_CONSOLE 1 #endif NS_AX_BEGIN @@ -102,7 +102,7 @@ const char* inet_ntop(int af, const void* src, char* dst, int cnt) // Free functions to log // -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) void SendLogToWindow(const char* log) { static const int CCLOG_STRING_TAG = 1; @@ -123,17 +123,17 @@ void SendLogToWindow(const char* log) void log(const char* format, ...) { -#define CC_VSNPRINTF_BUFFER_LENGTH 512 +#define AX_VSNPRINTF_BUFFER_LENGTH 512 va_list args; va_start(args, format); auto buf = StringUtils::vformat(format, args); va_end(args); -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID __android_log_print(ANDROID_LOG_DEBUG, "axis debug info", "%s", buf.c_str()); -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 buf.push_back('\n'); // print to debugger output window @@ -141,7 +141,7 @@ void log(const char* format, ...) OutputDebugStringW(wbuf.c_str()); -# if CC_LOG_TO_CONSOLE +# if AX_LOG_TO_CONSOLE auto hStdout = ::GetStdHandle(STD_OUTPUT_HANDLE); if (hStdout) { @@ -153,7 +153,7 @@ void log(const char* format, ...) } # endif -# if !CC_LOG_MULTITHREAD +# if !AX_LOG_MULTITHREAD // print to log window SendLogToWindow(buf.c_str()); # endif @@ -164,7 +164,7 @@ void log(const char* format, ...) fflush(stdout); #endif -#if !CC_LOG_MULTITHREAD +#if !AX_LOG_MULTITHREAD Director::getInstance()->getConsole()->log(buf.c_str()); #endif } @@ -502,14 +502,14 @@ bool Console::listenOnTCP(int port) hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) WSADATA wsaData; n = WSAStartup(MAKEWORD(2, 2), &wsaData); #endif if ((n = getaddrinfo(nullptr, serv, &hints, &res)) != 0) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) fprintf(stderr, "net_listen error for %s: %s", serv, gai_strerrorA(n)); #else fprintf(stderr, "net_listen error for %s: %s", serv, gai_strerror(n)); @@ -546,7 +546,7 @@ bool Console::listenOnTCP(int port) break; /* success */ /* bind error, close and try next one */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) closesocket(listenfd); #else close(listenfd); @@ -769,7 +769,7 @@ void Console::loop() // receive a SIGPIPE, which will cause linux system shutdown the sending process. // Add this ioctl code to check if the socket has been closed by peer. -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) u_long n = 0; ioctlsocket(fd, FIONREAD, &n); #else @@ -826,14 +826,14 @@ void Console::loop() // clean up: ignore stdin, stdout and stderr for (const auto& fd : _fds) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) closesocket(fd); #else close(fd); #endif } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) closesocket(_listenfd); WSACleanup(); #else @@ -1028,7 +1028,7 @@ void Console::addClient() * * The default behaviour for this signal is to end the process.So we make the process ignore SIGPIPE. */ -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS int set = 1; setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int)); #endif @@ -1042,24 +1042,24 @@ void Console::addClient() void Console::createCommandAllocator() { addCommand({"allocator", "Display allocator diagnostics for all allocators. Args: [-h | help | ]", - CC_CALLBACK_2(Console::commandAllocator, this)}); + AX_CALLBACK_2(Console::commandAllocator, this)}); } void Console::createCommandConfig() { addCommand({"config", "Print the Configuration object. Args: [-h | help | ]", - CC_CALLBACK_2(Console::commandConfig, this)}); + AX_CALLBACK_2(Console::commandConfig, this)}); } void Console::createCommandDebugMsg() { addCommand({"debugmsg", "Whether or not to forward the debug messages on the console. Args: [-h | help | on | off | ]", - CC_CALLBACK_2(Console::commandDebugMsg, this)}); + AX_CALLBACK_2(Console::commandDebugMsg, this)}); addSubCommand("debugmsg", - {"on", "enable debug logging", CC_CALLBACK_2(Console::commandDebugMsgSubCommandOnOff, this)}); + {"on", "enable debug logging", AX_CALLBACK_2(Console::commandDebugMsgSubCommandOnOff, this)}); addSubCommand("debugmsg", - {"off", "disable debug logging", CC_CALLBACK_2(Console::commandDebugMsgSubCommandOnOff, this)}); + {"off", "disable debug logging", AX_CALLBACK_2(Console::commandDebugMsgSubCommandOnOff, this)}); } void Console::createCommandDirector() @@ -1067,96 +1067,96 @@ void Console::createCommandDirector() addCommand({"director", "director commands, type -h or [director help] to list supported directives"}); addSubCommand("director", {"pause", "pause all scheduled timers, the draw rate will be 4 FPS to reduce CPU consumption", - CC_CALLBACK_2(Console::commandDirectorSubCommandPause, this)}); + AX_CALLBACK_2(Console::commandDirectorSubCommandPause, this)}); addSubCommand("director", {"resume", "resume all scheduled timers", - CC_CALLBACK_2(Console::commandDirectorSubCommandResume, this)}); + AX_CALLBACK_2(Console::commandDirectorSubCommandResume, this)}); addSubCommand("director", {"stop", "Stops the animation. Nothing will be drawn.", - CC_CALLBACK_2(Console::commandDirectorSubCommandStop, this)}); + AX_CALLBACK_2(Console::commandDirectorSubCommandStop, this)}); addSubCommand( "director", {"start", "Restart the animation again, Call this function only if [director stop] was called earlier", - CC_CALLBACK_2(Console::commandDirectorSubCommandStart, this)}); - addSubCommand("director", {"end", "exit this app.", CC_CALLBACK_2(Console::commandDirectorSubCommandEnd, this)}); + AX_CALLBACK_2(Console::commandDirectorSubCommandStart, this)}); + addSubCommand("director", {"end", "exit this app.", AX_CALLBACK_2(Console::commandDirectorSubCommandEnd, this)}); } void Console::createCommandExit() { addCommand( - {"exit", "Close connection to the console. Args: [-h | help | ]", CC_CALLBACK_2(Console::commandExit, this)}); + {"exit", "Close connection to the console. Args: [-h | help | ]", AX_CALLBACK_2(Console::commandExit, this)}); } void Console::createCommandFileUtils() { addCommand({"fileutils", "Flush or print the FileUtils info. Args: [-h | help | flush | ]", - CC_CALLBACK_2(Console::commandFileUtils, this)}); + AX_CALLBACK_2(Console::commandFileUtils, this)}); addSubCommand("fileutils", {"flush", "Purges the file searching cache.", - CC_CALLBACK_2(Console::commandFileUtilsSubCommandFlush, this)}); + AX_CALLBACK_2(Console::commandFileUtilsSubCommandFlush, this)}); } void Console::createCommandFps() { addCommand( - {"fps", "Turn on / off the FPS. Args: [-h | help | on | off | ]", CC_CALLBACK_2(Console::commandFps, this)}); + {"fps", "Turn on / off the FPS. Args: [-h | help | on | off | ]", AX_CALLBACK_2(Console::commandFps, this)}); addSubCommand("fps", {"on", "Display the FPS on the bottom-left corner.", - CC_CALLBACK_2(Console::commandFpsSubCommandOnOff, this)}); + AX_CALLBACK_2(Console::commandFpsSubCommandOnOff, this)}); addSubCommand("fps", {"off", "Hide the FPS on the bottom-left corner.", - CC_CALLBACK_2(Console::commandFpsSubCommandOnOff, this)}); + AX_CALLBACK_2(Console::commandFpsSubCommandOnOff, this)}); } void Console::createCommandHelp() { - addCommand({"help", "Print this message. Args: [ ]", CC_CALLBACK_2(Console::commandHelp, this)}); + addCommand({"help", "Print this message. Args: [ ]", AX_CALLBACK_2(Console::commandHelp, this)}); } void Console::createCommandProjection() { addCommand({"projection", "Change or print the current projection. Args: [-h | help | 2d | 3d | ]", - CC_CALLBACK_2(Console::commandProjection, this)}); + AX_CALLBACK_2(Console::commandProjection, this)}); addSubCommand("projection", {"2d", "sets a 2D projection (orthogonal projection).", - CC_CALLBACK_2(Console::commandProjectionSubCommand2d, this)}); + AX_CALLBACK_2(Console::commandProjectionSubCommand2d, this)}); addSubCommand("projection", {"3d", "sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500.", - CC_CALLBACK_2(Console::commandProjectionSubCommand3d, this)}); + AX_CALLBACK_2(Console::commandProjectionSubCommand3d, this)}); } void Console::createCommandResolution() { addCommand({"resolution", "Change or print the window resolution. Args: [-h | help | width height resolution_policy | ]", - CC_CALLBACK_2(Console::commandResolution, this)}); - addSubCommand("resolution", {"", "", CC_CALLBACK_2(Console::commandResolutionSubCommandEmpty, this)}); + AX_CALLBACK_2(Console::commandResolution, this)}); + addSubCommand("resolution", {"", "", AX_CALLBACK_2(Console::commandResolutionSubCommandEmpty, this)}); } void Console::createCommandSceneGraph() { - addCommand({"scenegraph", "Print the scene graph", CC_CALLBACK_2(Console::commandSceneGraph, this)}); + addCommand({"scenegraph", "Print the scene graph", AX_CALLBACK_2(Console::commandSceneGraph, this)}); } void Console::createCommandTexture() { addCommand({"texture", "Flush or print the TextureCache info. Args: [-h | help | flush | ] ", - CC_CALLBACK_2(Console::commandTextures, this)}); + AX_CALLBACK_2(Console::commandTextures, this)}); addSubCommand("texture", {"flush", "Purges the dictionary of loaded textures.", - CC_CALLBACK_2(Console::commandTexturesSubCommandFlush, this)}); + AX_CALLBACK_2(Console::commandTexturesSubCommandFlush, this)}); } void Console::createCommandTouch() { addCommand({"touch", "simulate touch event via console, type -h or [touch help] to list supported directives"}); addSubCommand("touch", {"tap", "touch tap x y: simulate touch tap at (x,y).", - CC_CALLBACK_2(Console::commandTouchSubCommandTap, this)}); + AX_CALLBACK_2(Console::commandTouchSubCommandTap, this)}); addSubCommand("touch", {"swipe", "touch swipe x1 y1 x2 y2: simulate touch swipe from (x1,y1) to (x2,y2).", - CC_CALLBACK_2(Console::commandTouchSubCommandSwipe, this)}); + AX_CALLBACK_2(Console::commandTouchSubCommandSwipe, this)}); } void Console::createCommandUpload() { addCommand( - {"upload", "upload file. Args: [filename base64_encoded_data]", CC_CALLBACK_1(Console::commandUpload, this)}); + {"upload", "upload file. Args: [filename base64_encoded_data]", AX_CALLBACK_1(Console::commandUpload, this)}); } void Console::createCommandVersion() { - addCommand({"version", "print version string ", CC_CALLBACK_2(Console::commandVersion, this)}); + addCommand({"version", "print version string ", AX_CALLBACK_2(Console::commandVersion, this)}); } // @@ -1165,12 +1165,12 @@ void Console::createCommandVersion() void Console::commandAllocator(socket_native_type fd, std::string_view /*args*/) { -#if CC_ENABLE_ALLOCATOR_DIAGNOSTICS +#if AX_ENABLE_ALLOCATOR_DIAGNOSTICS auto info = allocator::AllocatorDiagnostics::instance()->diagnostics(); Console::Utility::mydprintf(fd, info.c_str()); #else Console::Utility::mydprintf( - fd, "allocator diagnostics not available. CC_ENABLE_ALLOCATOR_DIAGNOSTICS must be set to 1 in ccConfig.h\n"); + fd, "allocator diagnostics not available. AX_ENABLE_ALLOCATOR_DIAGNOSTICS must be set to 1 in ccConfig.h\n"); #endif } @@ -1229,7 +1229,7 @@ void Console::commandExit(socket_native_type fd, std::string_view /*args*/) { FD_CLR(fd, &_read_set); _fds.erase(std::remove(_fds.begin(), _fds.end(), fd), _fds.end()); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) closesocket(fd); #else close(fd); diff --git a/core/base/CCConsole.h b/core/base/CCConsole.h index dd0f20ad7d..e5e38a782f 100644 --- a/core/base/CCConsole.h +++ b/core/base/CCConsole.h @@ -57,7 +57,7 @@ static const int MAX_LOG_LENGTH = 16 * 1024; /** @brief Output Debug message. */ -void CC_DLL log(const char* format, ...) CC_FORMAT_PRINTF(1, 2); +void AX_DLL log(const char* format, ...) AX_FORMAT_PRINTF(1, 2); /** Console is helper class that lets the developer control the game from TCP connection. Console will spawn a new thread that will listen to a specified TCP port. @@ -69,7 +69,7 @@ void CC_DLL log(const char* format, ...) CC_FORMAT_PRINTF(1, 2); ``` */ -class CC_DLL Console : public Ref +class AX_DLL Console : public Ref { public: /** Console Utils */ @@ -108,7 +108,7 @@ public: }; /** Command Struct */ - class CC_DLL Command + class AX_DLL Command { public: using Callback = std::function; @@ -208,7 +208,7 @@ public: bool isIpv6Server() const; /** The command separator */ - CC_SYNTHESIZE(char, _commandSeparator, CommandSeparator); + AX_SYNTHESIZE(char, _commandSeparator, CommandSeparator); protected: // Main Loop @@ -291,7 +291,7 @@ protected: std::string _bindAddress; private: - CC_DISALLOW_COPY_AND_ASSIGN(Console); + AX_DISALLOW_COPY_AND_ASSIGN(Console); // helper functions int printSceneGraph(socket_native_type fd, Node* node, int level); diff --git a/core/base/CCController-android.cpp b/core/base/CCController-android.cpp index 7a1c3dcf9b..306895de6d 100644 --- a/core/base/CCController-android.cpp +++ b/core/base/CCController-android.cpp @@ -26,7 +26,7 @@ #include "base/CCController.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include # include "base/ccMacros.h" # include "base/CCDirector.h" @@ -212,4 +212,4 @@ JNIEXPORT void JNICALL Java_org_cocos2dx_lib_GameControllerAdapter_nativeControl } // extern "C" { -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) diff --git a/core/base/CCController-apple.mm b/core/base/CCController-apple.mm index 203d4500bc..7be0fb7366 100644 --- a/core/base/CCController-apple.mm +++ b/core/base/CCController-apple.mm @@ -26,7 +26,7 @@ #include "base/CCController.h" #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # include "base/ccMacros.h" # include "base/CCEventDispatcher.h" @@ -325,7 +325,7 @@ void Controller::registerListeners() } }; } -# if defined(CC_TARGET_OS_TVOS) +# if defined(AX_TARGET_OS_TVOS) else if (_impl->_gcController.microGamepad != nil) { _impl->_gcController.microGamepad.dpad.up.valueChangedHandler = @@ -386,4 +386,4 @@ void Controller::receiveExternalKeyEvent(int externalKeyCode, bool receive) {} NS_AX_END -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) diff --git a/core/base/CCController-linux-win32.cpp b/core/base/CCController-linux-win32.cpp index c33aa4f7eb..1bf9f42bfe 100644 --- a/core/base/CCController-linux-win32.cpp +++ b/core/base/CCController-linux-win32.cpp @@ -27,7 +27,7 @@ THE SOFTWARE. #include "base/CCController.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include # include "base/ccMacros.h" # include "base/CCDirector.h" @@ -37,7 +37,7 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL ControllerImpl +class AX_DLL ControllerImpl { public: ControllerImpl() @@ -4454,4 +4454,4 @@ Controller::~Controller() NS_AX_END -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) diff --git a/core/base/CCController.cpp b/core/base/CCController.cpp index 455b3c68bd..aeaadb11b8 100644 --- a/core/base/CCController.cpp +++ b/core/base/CCController.cpp @@ -26,9 +26,9 @@ #include "base/CCController.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "base/CCEventDispatcher.h" # include "base/CCEventController.h" @@ -127,5 +127,5 @@ void Controller::onAxisEvent(int axisCode, float value, bool isAnalog) NS_AX_END -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == - // CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif // (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == + // AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) diff --git a/core/base/CCController.h b/core/base/CCController.h index 5877e34174..7ecc8d99b7 100644 --- a/core/base/CCController.h +++ b/core/base/CCController.h @@ -25,9 +25,9 @@ #ifndef __cocos2d_libs__CCController__ #define __cocos2d_libs__CCController__ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "platform/CCPlatformMacros.h" # include @@ -51,7 +51,7 @@ class EventDispatcher; * @brief A Controller object represents a connected physical game controller. * @js NA */ -class CC_DLL Controller +class AX_DLL Controller { public: /** @@ -223,7 +223,7 @@ private: EventController* _keyEvent; EventController* _axisEvent; -# if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +# if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) // FIXME: Once GLFW 3.3 is bundled with cocos2d-x, remove these unordered // maps. They won't be needed. We will only need to provide a mapping from // the GLFW gamepad key codes to the Controller::Key. diff --git a/core/base/CCData.h b/core/base/CCData.h index 95b465a164..91735bd848 100644 --- a/core/base/CCData.h +++ b/core/base/CCData.h @@ -39,7 +39,7 @@ */ NS_AX_BEGIN -class CC_DLL Data +class AX_DLL Data { friend class Properties; diff --git a/core/base/CCDirector.cpp b/core/base/CCDirector.cpp index d0df40eded..0ead658042 100644 --- a/core/base/CCDirector.cpp +++ b/core/base/CCDirector.cpp @@ -63,7 +63,7 @@ THE SOFTWARE. #include "renderer/backend/ProgramCache.h" #include "audio/AudioEngine.h" -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING # include "base/CCScriptSupport.h" #endif @@ -150,40 +150,40 @@ Director::~Director() { CCLOGINFO("deallocing Director: %p", this); - CC_SAFE_RELEASE(_FPSLabel); - CC_SAFE_RELEASE(_drawnVerticesLabel); - CC_SAFE_RELEASE(_drawnBatchesLabel); + AX_SAFE_RELEASE(_FPSLabel); + AX_SAFE_RELEASE(_drawnVerticesLabel); + AX_SAFE_RELEASE(_drawnBatchesLabel); - CC_SAFE_RELEASE(_runningScene); - CC_SAFE_RELEASE(_notificationNode); - CC_SAFE_RELEASE(_scheduler); - CC_SAFE_RELEASE(_actionManager); + AX_SAFE_RELEASE(_runningScene); + AX_SAFE_RELEASE(_notificationNode); + AX_SAFE_RELEASE(_scheduler); + AX_SAFE_RELEASE(_actionManager); - CC_SAFE_RELEASE(_beforeSetNextScene); - CC_SAFE_RELEASE(_afterSetNextScene); - CC_SAFE_RELEASE(_eventBeforeUpdate); - CC_SAFE_RELEASE(_eventAfterUpdate); - CC_SAFE_RELEASE(_eventAfterDraw); - CC_SAFE_RELEASE(_eventBeforeDraw); - CC_SAFE_RELEASE(_eventAfterVisit); - CC_SAFE_RELEASE(_eventProjectionChanged); - CC_SAFE_RELEASE(_eventResetDirector); + AX_SAFE_RELEASE(_beforeSetNextScene); + AX_SAFE_RELEASE(_afterSetNextScene); + AX_SAFE_RELEASE(_eventBeforeUpdate); + AX_SAFE_RELEASE(_eventAfterUpdate); + AX_SAFE_RELEASE(_eventAfterDraw); + AX_SAFE_RELEASE(_eventBeforeDraw); + AX_SAFE_RELEASE(_eventAfterVisit); + AX_SAFE_RELEASE(_eventProjectionChanged); + AX_SAFE_RELEASE(_eventResetDirector); delete _renderer; delete _console; - CC_SAFE_RELEASE(_eventDispatcher); + AX_SAFE_RELEASE(_eventDispatcher); Configuration::destroyInstance(); ObjectFactory::destroyInstance(); s_SharedDirector = nullptr; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEngineManager::destroyInstance(); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) exit(0); #endif } @@ -285,7 +285,7 @@ void Director::drawScene() if (_runningScene) { -#if (CC_USE_PHYSICS || (CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION) || CC_USE_NAVMESH) +#if (AX_USE_PHYSICS || (AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION) || AX_USE_NAVMESH) _runningScene->stepPhysicsAndNavigation(_deltaTime); #endif // clear draw stats @@ -308,7 +308,7 @@ void Director::drawScene() if (_statsDisplay) { -#if !CC_STRIP_FPS +#if !AX_STRIP_FPS showStats(); #endif } @@ -331,7 +331,7 @@ void Director::drawScene() if (_statsDisplay) { -#if !CC_STRIP_FPS +#if !AX_STRIP_FPS calculateMPF(); #endif } @@ -421,7 +421,7 @@ void Director::destroyTextureCache() if (_textureCache) { _textureCache->waitForQuit(); - CC_SAFE_RELEASE_NULL(_textureCache); + AX_SAFE_RELEASE_NULL(_textureCache); } } @@ -820,14 +820,14 @@ void Director::replaceScene(Scene* scene) ssize_t index = _scenesStack.size() - 1; _sendCleanupToScene = true; -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, scene); sEngine->releaseScriptObject(this, _scenesStack.at(index)); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.replace(index, scene); _nextScene = scene; @@ -839,13 +839,13 @@ void Director::pushScene(Scene* scene) _sendCleanupToScene = false; -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, scene); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.pushBack(scene); _nextScene = scene; } @@ -854,13 +854,13 @@ void Director::popScene() { CCASSERT(_runningScene != nullptr, "running scene should not null"); -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, _scenesStack.back()); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.popBack(); ssize_t c = _scenesStack.size(); @@ -899,13 +899,13 @@ void Director::popToSceneStackLevel(int level) auto firstOnStackScene = _scenesStack.back(); if (firstOnStackScene == _runningScene) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, _scenesStack.back()); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.popBack(); --c; } @@ -921,13 +921,13 @@ void Director::popToSceneStackLevel(int level) } current->cleanup(); -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->releaseScriptObject(this, _scenesStack.back()); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _scenesStack.popBack(); --c; } @@ -950,18 +950,18 @@ void Director::restart() void Director::reset() { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS if (_runningScene) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS if (sEngine) { sEngine->releaseScriptObject(this, _runningScene); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS _runningScene->onExit(); _runningScene->cleanup(); _runningScene->release(); @@ -997,7 +997,7 @@ void Director::reset() // remove all objects, but don't release it. // runWithScene might be executed after 'end'. -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS if (sEngine) { for (const auto& scene : _scenesStack) @@ -1006,7 +1006,7 @@ void Director::reset() sEngine->releaseScriptObject(this, scene); } } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS while (!_scenesStack.empty()) { @@ -1015,10 +1015,10 @@ void Director::reset() stopAnimation(); - CC_SAFE_RELEASE_NULL(_notificationNode); - CC_SAFE_RELEASE_NULL(_FPSLabel); - CC_SAFE_RELEASE_NULL(_drawnBatchesLabel); - CC_SAFE_RELEASE_NULL(_drawnVerticesLabel); + AX_SAFE_RELEASE_NULL(_notificationNode); + AX_SAFE_RELEASE_NULL(_FPSLabel); + AX_SAFE_RELEASE_NULL(_drawnBatchesLabel); + AX_SAFE_RELEASE_NULL(_drawnVerticesLabel); // purge bitmap cache FontFNT::purgeCachedData(); @@ -1074,7 +1074,7 @@ void Director::restartDirector() startAnimation(); // Real restart in script level -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEvent scriptEvent(kRestartGame, nullptr); ScriptEngineManager::sendEventToLua(scriptEvent); #endif @@ -1132,7 +1132,7 @@ void Director::pause() _oldAnimationInterval = _animationInterval; -#if CC_REDUCE_PAUSED_CPU_USAGE +#if AX_REDUCE_PAUSED_CPU_USAGE // when paused, don't consume CPU setAnimationInterval(1 / 4.0, SetIntervalReason::BY_DIRECTOR_PAUSE); #endif @@ -1146,7 +1146,7 @@ void Director::resume() return; } -#if CC_REDUCE_PAUSED_CPU_USAGE +#if AX_REDUCE_PAUSED_CPU_USAGE setAnimationInterval(_oldAnimationInterval, SetIntervalReason::BY_ENGINE); #endif @@ -1169,7 +1169,7 @@ void Director::updateFrameRate() _frameRate = 1.0f / _deltaTime; } -#if !CC_STRIP_FPS +#if !AX_STRIP_FPS // display the FPS using a LabelAtlas // updates the FPS every frame @@ -1194,7 +1194,7 @@ void Director::showStats() // Probably we don't need this anymore since // the framerate is using a low-pass filter // to make the FPS stable - if (_accumDt > CC_DIRECTOR_STATS_INTERVAL) + if (_accumDt > AX_DIRECTOR_STATS_INTERVAL) { sprintf(buffer, "%.1f / %.3f", _frames / _accumDt, _secondsPerFrame); _FPSLabel->setString(buffer); @@ -1254,9 +1254,9 @@ void Director::createStatsLabel() drawBatchString = _drawnBatchesLabel->getString(); drawVerticesString = _drawnVerticesLabel->getString(); - CC_SAFE_RELEASE_NULL(_FPSLabel); - CC_SAFE_RELEASE_NULL(_drawnBatchesLabel); - CC_SAFE_RELEASE_NULL(_drawnVerticesLabel); + AX_SAFE_RELEASE_NULL(_FPSLabel); + AX_SAFE_RELEASE_NULL(_drawnBatchesLabel); + AX_SAFE_RELEASE_NULL(_drawnVerticesLabel); _textureCache->removeTextureForKey("/cc_fps_images"); FileUtils::getInstance()->purgeCachedEntries(); } @@ -1276,7 +1276,7 @@ void Director::createStatsLabel() } texture = _textureCache->addImage(image, "/cc_fps_images", PixelFormat::RGBA4); - CC_SAFE_RELEASE(image); + AX_SAFE_RELEASE(image); /* We want to use an image which is stored in the file named ccFPSImage.c @@ -1286,7 +1286,7 @@ void Director::createStatsLabel() So I added a new method called 'setIgnoreContentScaleFactor' for 'AtlasNode', this is not exposed to game developers, it's only used for displaying FPS now. */ - float scaleFactor = 1 / CC_CONTENT_SCALE_FACTOR(); + float scaleFactor = 1 / AX_CONTENT_SCALE_FACTOR(); _FPSLabel = LabelAtlas::create(fpsString, texture, 12, 32, '.'); _FPSLabel->retain(); @@ -1319,7 +1319,7 @@ void Director::setStatsAnchor(AnchorPreset anchor) static Vec2 _fpsPosition = {0, 0}; auto safeOrigin = getSafeAreaRect().origin; auto safeSize = getSafeAreaRect().size; - const int height_spacing = (int)(22 / CC_CONTENT_SCALE_FACTOR()); + const int height_spacing = (int)(22 / AX_CONTENT_SCALE_FACTOR()); switch (anchor) { @@ -1391,7 +1391,7 @@ void Director::setStatsAnchor(AnchorPreset anchor) } } -#endif // #if !CC_STRIP_FPS +#endif // #if !AX_STRIP_FPS void Director::setContentScaleFactor(float scaleFactor) { @@ -1410,22 +1410,22 @@ void Director::setNotificationNode(Node* node) _notificationNode->onExit(); _notificationNode->cleanup(); } - CC_SAFE_RELEASE(_notificationNode); + AX_SAFE_RELEASE(_notificationNode); _notificationNode = node; if (node == nullptr) return; _notificationNode->onEnter(); _notificationNode->onEnterTransitionDidFinish(); - CC_SAFE_RETAIN(_notificationNode); + AX_SAFE_RETAIN(_notificationNode); } void Director::setScheduler(Scheduler* scheduler) { if (_scheduler != scheduler) { - CC_SAFE_RETAIN(scheduler); - CC_SAFE_RELEASE(_scheduler); + AX_SAFE_RETAIN(scheduler); + AX_SAFE_RELEASE(_scheduler); _scheduler = scheduler; } } @@ -1434,8 +1434,8 @@ void Director::setActionManager(ActionManager* actionManager) { if (_actionManager != actionManager) { - CC_SAFE_RETAIN(actionManager); - CC_SAFE_RELEASE(_actionManager); + AX_SAFE_RETAIN(actionManager); + AX_SAFE_RELEASE(_actionManager); _actionManager = actionManager; } } @@ -1444,8 +1444,8 @@ void Director::setEventDispatcher(EventDispatcher* dispatcher) { if (_eventDispatcher != dispatcher) { - CC_SAFE_RETAIN(dispatcher); - CC_SAFE_RELEASE(_eventDispatcher); + AX_SAFE_RETAIN(dispatcher); + AX_SAFE_RELEASE(_eventDispatcher); _eventDispatcher = dispatcher; } } diff --git a/core/base/CCDirector.h b/core/base/CCDirector.h index 9a63a5dafb..27b6ff93a4 100644 --- a/core/base/CCDirector.h +++ b/core/base/CCDirector.h @@ -74,7 +74,7 @@ class Console; Since the Director is a singleton, the standard way to use it is by calling: _ Director::getInstance()->methodName(); */ -class CC_DLL Director : public Ref +class AX_DLL Director : public Ref { public: /** Director will trigger an event before set next scene. */ @@ -524,7 +524,7 @@ protected: void setNextScene(); void updateFrameRate(); -#if !CC_STRIP_FPS +#if !AX_STRIP_FPS void showStats(); void createStatsLabel(); void calculateMPF(); diff --git a/core/base/CCEvent.h b/core/base/CCEvent.h index 649a56eaae..80950b9ca8 100644 --- a/core/base/CCEvent.h +++ b/core/base/CCEvent.h @@ -41,7 +41,7 @@ class Node; /** @class Event * @brief Base class of all kinds of events. */ -class CC_DLL Event : public Ref +class AX_DLL Event : public Ref { public: /** Type Event type.*/ diff --git a/core/base/CCEventAcceleration.h b/core/base/CCEventAcceleration.h index f396e0445a..6786abb1e5 100644 --- a/core/base/CCEventAcceleration.h +++ b/core/base/CCEventAcceleration.h @@ -39,7 +39,7 @@ NS_AX_BEGIN /** @class EventAcceleration * @brief Accelerometer event. */ -class CC_DLL EventAcceleration : public Event +class AX_DLL EventAcceleration : public Event { public: /** Constructor. diff --git a/core/base/CCEventController.h b/core/base/CCEventController.h index 9bbcf28153..afe0cff186 100644 --- a/core/base/CCEventController.h +++ b/core/base/CCEventController.h @@ -44,7 +44,7 @@ class EventListenerController; /** @class EventController * @brief Controller event. */ -class CC_DLL EventController : public Event +class AX_DLL EventController : public Event { public: /** ControllerEventType Controller event type.*/ diff --git a/core/base/CCEventCustom.h b/core/base/CCEventCustom.h index 69190a4031..c0912a4331 100644 --- a/core/base/CCEventCustom.h +++ b/core/base/CCEventCustom.h @@ -39,7 +39,7 @@ NS_AX_BEGIN /** @class EventCustom * @brief Custom event. */ -class CC_DLL EventCustom : public Event +class AX_DLL EventCustom : public Event { public: /** Constructor. diff --git a/core/base/CCEventDispatcher.cpp b/core/base/CCEventDispatcher.cpp index 36408c7917..a3aeb7f85d 100644 --- a/core/base/CCEventDispatcher.cpp +++ b/core/base/CCEventDispatcher.cpp @@ -32,9 +32,9 @@ #include "base/CCEventListenerKeyboard.h" #include "base/CCEventListenerCustom.h" #include "base/CCEventListenerFocus.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "base/CCEventListenerController.h" #endif #include "2d/CCScene.h" @@ -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 (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) case Event::Type::GAME_CONTROLLER: ret = EventListenerController::LISTENER_ID; break; @@ -111,8 +111,8 @@ EventDispatcher::EventListenerVector::EventListenerVector() EventDispatcher::EventListenerVector::~EventListenerVector() { - CC_SAFE_DELETE(_sceneGraphListeners); - CC_SAFE_DELETE(_fixedListeners); + AX_SAFE_DELETE(_sceneGraphListeners); + AX_SAFE_DELETE(_fixedListeners); } size_t EventDispatcher::EventListenerVector::size() const @@ -134,7 +134,7 @@ bool EventDispatcher::EventListenerVector::empty() const void EventDispatcher::EventListenerVector::push_back(EventListener* listener) { -#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS +#if AX_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 CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { sEngine->retainScriptObject(this, listener); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS listener->retain(); } @@ -502,7 +502,7 @@ void EventDispatcher::addEventListenerWithSceneGraphPriority(EventListener* list addEventListener(listener); } -#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 +#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 void EventDispatcher::debugCheckNodeHasNoEventListenersOnDestruction(Node* node) { @@ -559,7 +559,7 @@ void EventDispatcher::debugCheckNodeHasNoEventListenersOnDestruction(Node* node) } } -#endif // #if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 +#endif // #if AX_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) { - CC_SAFE_RETAIN(l); + AX_SAFE_RETAIN(l); l->setRegistered(false); if (l->getAssociatedNode() != nullptr) { @@ -653,7 +653,7 @@ void EventDispatcher::removeEventListener(EventListener* listener) } } -#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS +#if AX_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); - CC_SAFE_DELETE(list); + AX_SAFE_DELETE(list); } else { @@ -1603,7 +1603,7 @@ void EventDispatcher::cleanToRemovedListeners() } } else - CC_SAFE_RELEASE(l); + AX_SAFE_RELEASE(l); } _toRemovedListeners.clear(); @@ -1611,14 +1611,14 @@ void EventDispatcher::cleanToRemovedListeners() void EventDispatcher::releaseListener(EventListener* listener) { -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (listener && sEngine) { sEngine->releaseScriptObject(this, listener); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS - CC_SAFE_RELEASE(listener); +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS + AX_SAFE_RELEASE(listener); } NS_AX_END diff --git a/core/base/CCEventDispatcher.h b/core/base/CCEventDispatcher.h index 9f0e0d86bb..4a36dc636a 100644 --- a/core/base/CCEventDispatcher.h +++ b/core/base/CCEventDispatcher.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EVENT_DISPATCHER_H__ -#define __CC_EVENT_DISPATCHER_H__ +#ifndef __AX_EVENT_DISPATCHER_H__ +#define __AX_EVENT_DISPATCHER_H__ #include #include @@ -60,7 +60,7 @@ from within an EventListener, while events are being dispatched. @js NA */ -class CC_DLL EventDispatcher : public Ref +class AX_DLL EventDispatcher : public Ref { public: // Adds event listener. @@ -196,7 +196,7 @@ public: */ ~EventDispatcher(); -#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0 +#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS && 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 // __CC_EVENT_DISPATCHER_H__ +#endif // __AX_EVENT_DISPATCHER_H__ diff --git a/core/base/CCEventFocus.h b/core/base/CCEventFocus.h index 3a0958846d..86f6373735 100644 --- a/core/base/CCEventFocus.h +++ b/core/base/CCEventFocus.h @@ -44,7 +44,7 @@ class Widget; /** @class EventFocus * @brief Focus event. */ -class CC_DLL EventFocus : public Event +class AX_DLL EventFocus : public Event { public: /** Constructor. diff --git a/core/base/CCEventKeyboard.h b/core/base/CCEventKeyboard.h index 38823e029c..7fd206de63 100644 --- a/core/base/CCEventKeyboard.h +++ b/core/base/CCEventKeyboard.h @@ -39,7 +39,7 @@ NS_AX_BEGIN /** @class EventKeyboard * @brief Keyboard event. */ -class CC_DLL EventKeyboard : public Event +class AX_DLL EventKeyboard : public Event { public: /** diff --git a/core/base/CCEventListener.h b/core/base/CCEventListener.h index 02f4d0ac44..2b61aa9998 100644 --- a/core/base/CCEventListener.h +++ b/core/base/CCEventListener.h @@ -49,7 +49,7 @@ class Node; * For instance, you could refer to EventListenerAcceleration, EventListenerKeyboard, EventListenerTouchOneByOne, * EventListenerCustom. */ -class CC_DLL EventListener : public Ref +class AX_DLL EventListener : public Ref { public: /** Type Event type.*/ diff --git a/core/base/CCEventListenerAcceleration.cpp b/core/base/CCEventListenerAcceleration.cpp index bf43f27831..2e2ee39de2 100644 --- a/core/base/CCEventListenerAcceleration.cpp +++ b/core/base/CCEventListenerAcceleration.cpp @@ -47,7 +47,7 @@ EventListenerAcceleration* EventListenerAcceleration::create(const std::function } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -79,7 +79,7 @@ EventListenerAcceleration* EventListenerAcceleration::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; diff --git a/core/base/CCEventListenerAcceleration.h b/core/base/CCEventListenerAcceleration.h index 52b355ac2c..1aec200528 100644 --- a/core/base/CCEventListenerAcceleration.h +++ b/core/base/CCEventListenerAcceleration.h @@ -40,7 +40,7 @@ NS_AX_BEGIN * @brief Acceleration event listener. * @js NA */ -class CC_DLL EventListenerAcceleration : public EventListener +class AX_DLL EventListenerAcceleration : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerController.cpp b/core/base/CCEventListenerController.cpp index 1b50f52231..380b011f33 100644 --- a/core/base/CCEventListenerController.cpp +++ b/core/base/CCEventListenerController.cpp @@ -42,7 +42,7 @@ EventListenerController* EventListenerController::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerController.h b/core/base/CCEventListenerController.h index a0d44df411..e612b2ee00 100644 --- a/core/base/CCEventListenerController.h +++ b/core/base/CCEventListenerController.h @@ -44,7 +44,7 @@ class Controller; * @param Controller event listener. * @js NA */ -class CC_DLL EventListenerController : public EventListener +class AX_DLL EventListenerController : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerCustom.cpp b/core/base/CCEventListenerCustom.cpp index 0ca3e279d7..cac8bca754 100644 --- a/core/base/CCEventListenerCustom.cpp +++ b/core/base/CCEventListenerCustom.cpp @@ -40,7 +40,7 @@ EventListenerCustom* EventListenerCustom::create(std::string_view eventName, } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -74,7 +74,7 @@ EventListenerCustom* EventListenerCustom::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerCustom.h b/core/base/CCEventListenerCustom.h index f4b22d06f2..37fa114582 100644 --- a/core/base/CCEventListenerCustom.h +++ b/core/base/CCEventListenerCustom.h @@ -58,7 +58,7 @@ class EventCustom; * \endcode * @js cc._EventListenerCustom */ -class CC_DLL EventListenerCustom : public EventListener +class AX_DLL EventListenerCustom : public EventListener { public: /** Creates an event listener with type and callback. diff --git a/core/base/CCEventListenerFocus.cpp b/core/base/CCEventListenerFocus.cpp index b67da31491..ba56eed15b 100644 --- a/core/base/CCEventListenerFocus.cpp +++ b/core/base/CCEventListenerFocus.cpp @@ -47,7 +47,7 @@ EventListenerFocus* EventListenerFocus::create() ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -62,7 +62,7 @@ EventListenerFocus* EventListenerFocus::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerFocus.h b/core/base/CCEventListenerFocus.h index ab8e407786..5d32b53311 100644 --- a/core/base/CCEventListenerFocus.h +++ b/core/base/CCEventListenerFocus.h @@ -44,7 +44,7 @@ class Widget; /** @class EventListenerFocus * @brief Focus event listener. */ -class CC_DLL EventListenerFocus : public EventListener +class AX_DLL EventListenerFocus : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerKeyboard.cpp b/core/base/CCEventListenerKeyboard.cpp index dcd464af8a..a19d338b7c 100644 --- a/core/base/CCEventListenerKeyboard.cpp +++ b/core/base/CCEventListenerKeyboard.cpp @@ -51,7 +51,7 @@ EventListenerKeyboard* EventListenerKeyboard::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -67,7 +67,7 @@ EventListenerKeyboard* EventListenerKeyboard::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerKeyboard.h b/core/base/CCEventListenerKeyboard.h index c25f9e4e31..eeb5b69269 100644 --- a/core/base/CCEventListenerKeyboard.h +++ b/core/base/CCEventListenerKeyboard.h @@ -43,7 +43,7 @@ class Event; * @brief Keyboard event listener. * @js cc._EventListenerKeyboard */ -class CC_DLL EventListenerKeyboard : public EventListener +class AX_DLL EventListenerKeyboard : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerMouse.cpp b/core/base/CCEventListenerMouse.cpp index d7c6999216..6bc360a72f 100644 --- a/core/base/CCEventListenerMouse.cpp +++ b/core/base/CCEventListenerMouse.cpp @@ -44,7 +44,7 @@ EventListenerMouse* EventListenerMouse::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -62,7 +62,7 @@ EventListenerMouse* EventListenerMouse::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerMouse.h b/core/base/CCEventListenerMouse.h index 00631ab177..6fce6bae7e 100644 --- a/core/base/CCEventListenerMouse.h +++ b/core/base/CCEventListenerMouse.h @@ -43,7 +43,7 @@ class Event; * @brief Mouse event listener. * @js cc._EventListenerMouse */ -class CC_DLL EventListenerMouse : public EventListener +class AX_DLL EventListenerMouse : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventListenerTouch.cpp b/core/base/CCEventListenerTouch.cpp index f4c136afac..6140914cfc 100644 --- a/core/base/CCEventListenerTouch.cpp +++ b/core/base/CCEventListenerTouch.cpp @@ -76,7 +76,7 @@ EventListenerTouchOneByOne* EventListenerTouchOneByOne::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -111,7 +111,7 @@ EventListenerTouchOneByOne* EventListenerTouchOneByOne::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -148,7 +148,7 @@ EventListenerTouchAllAtOnce* EventListenerTouchAllAtOnce::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -179,7 +179,7 @@ EventListenerTouchAllAtOnce* EventListenerTouchAllAtOnce::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/core/base/CCEventListenerTouch.h b/core/base/CCEventListenerTouch.h index 7ec050ffe0..d7c9beb717 100644 --- a/core/base/CCEventListenerTouch.h +++ b/core/base/CCEventListenerTouch.h @@ -43,7 +43,7 @@ class Touch; * @brief Single touch event listener. * @js cc._EventListenerTouchOneByOne */ -class CC_DLL EventListenerTouchOneByOne : public EventListener +class AX_DLL EventListenerTouchOneByOne : public EventListener { public: static const std::string LISTENER_ID; @@ -96,7 +96,7 @@ private: /** @class EventListenerTouchAllAtOnce * @brief Multiple touches event listener. */ -class CC_DLL EventListenerTouchAllAtOnce : public EventListener +class AX_DLL EventListenerTouchAllAtOnce : public EventListener { public: static const std::string LISTENER_ID; diff --git a/core/base/CCEventMouse.h b/core/base/CCEventMouse.h index 24ed182cc9..c1a81c34b5 100644 --- a/core/base/CCEventMouse.h +++ b/core/base/CCEventMouse.h @@ -40,7 +40,7 @@ NS_AX_BEGIN /** @class EventMouse * @brief The mouse event. */ -class CC_DLL EventMouse : public Event +class AX_DLL EventMouse : public Event { public: /** diff --git a/core/base/CCEventTouch.h b/core/base/CCEventTouch.h index f2a042ed1f..2b0347d40b 100644 --- a/core/base/CCEventTouch.h +++ b/core/base/CCEventTouch.h @@ -43,7 +43,7 @@ class Touch; /** @class EventTouch * @brief Touch event. */ -class CC_DLL EventTouch : public Event +class AX_DLL EventTouch : public Event { public: static const int MAX_TOUCHES = 15; diff --git a/core/base/CCIMEDelegate.h b/core/base/CCIMEDelegate.h index 29ff4fb0e9..1ad7499a4a 100644 --- a/core/base/CCIMEDelegate.h +++ b/core/base/CCIMEDelegate.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_IME_DELEGATE_H__ -#define __CC_IME_DELEGATE_H__ +#ifndef __AX_IME_DELEGATE_H__ +#define __AX_IME_DELEGATE_H__ #include #include "math/CCMath.h" @@ -40,7 +40,7 @@ NS_AX_BEGIN /** * A static global empty std::string install. */ -extern const std::string CC_DLL STD_STRING_EMPTY; +extern const std::string AX_DLL STD_STRING_EMPTY; /** * Keyboard notification event type. @@ -55,7 +55,7 @@ typedef struct /** *@brief Input method editor delegate. */ -class CC_DLL IMEDelegate +class AX_DLL IMEDelegate { public: /** @@ -175,4 +175,4 @@ NS_AX_END // end of base group /// @} -#endif // __CC_IME_DELEGATE_H__ +#endif // __AX_IME_DELEGATE_H__ diff --git a/core/base/CCIMEDispatcher.cpp b/core/base/CCIMEDispatcher.cpp index 4bfed04244..c1a06332c1 100644 --- a/core/base/CCIMEDispatcher.cpp +++ b/core/base/CCIMEDispatcher.cpp @@ -100,7 +100,7 @@ IMEDispatcher::IMEDispatcher() : _impl(new IMEDispatcher::Impl) IMEDispatcher::~IMEDispatcher() { - CC_SAFE_DELETE(_impl); + AX_SAFE_DELETE(_impl); } ////////////////////////////////////////////////////////////////////////// @@ -126,13 +126,13 @@ bool IMEDispatcher::attachDelegateWithIME(IMEDelegate* delegate) bool ret = false; do { - CC_BREAK_IF(!_impl || !delegate); + AX_BREAK_IF(!_impl || !delegate); DelegateIter end = _impl->_delegateList.end(); DelegateIter iter = _impl->findDelegate(delegate); // if pDelegate is not in delegate list, return - CC_BREAK_IF(end == iter); + AX_BREAK_IF(end == iter); if (_impl->_delegateWithIme) { @@ -141,7 +141,7 @@ bool IMEDispatcher::attachDelegateWithIME(IMEDelegate* delegate) // if old delegate canDetachWithIME return false // or pDelegate canAttachWithIME return false, // do nothing. - CC_BREAK_IF(!_impl->_delegateWithIme->canDetachWithIME() || !delegate->canAttachWithIME()); + AX_BREAK_IF(!_impl->_delegateWithIme->canDetachWithIME() || !delegate->canAttachWithIME()); // detach first IMEDelegate* oldDelegate = _impl->_delegateWithIme; @@ -156,7 +156,7 @@ bool IMEDispatcher::attachDelegateWithIME(IMEDelegate* delegate) } // delegate hasn't attached to IME yet - CC_BREAK_IF(!delegate->canAttachWithIME()); + AX_BREAK_IF(!delegate->canAttachWithIME()); _impl->_delegateWithIme = *iter; delegate->didAttachWithIME(); @@ -170,12 +170,12 @@ bool IMEDispatcher::detachDelegateWithIME(IMEDelegate* delegate) bool ret = false; do { - CC_BREAK_IF(!_impl || !delegate); + AX_BREAK_IF(!_impl || !delegate); // if pDelegate is not the current delegate attached to IME, return - CC_BREAK_IF(_impl->_delegateWithIme != delegate); + AX_BREAK_IF(_impl->_delegateWithIme != delegate); - CC_BREAK_IF(!delegate->canDetachWithIME()); + AX_BREAK_IF(!delegate->canDetachWithIME()); _impl->_delegateWithIme = 0; delegate->didDetachWithIME(); @@ -188,11 +188,11 @@ void IMEDispatcher::removeDelegate(IMEDelegate* delegate) { do { - CC_BREAK_IF(!delegate || !_impl); + AX_BREAK_IF(!delegate || !_impl); DelegateIter iter = _impl->findDelegate(delegate); DelegateIter end = _impl->_delegateList.end(); - CC_BREAK_IF(end == iter); + AX_BREAK_IF(end == iter); if (_impl->_delegateWithIme) @@ -212,10 +212,10 @@ void IMEDispatcher::dispatchInsertText(const char* text, size_t len) { do { - CC_BREAK_IF(!_impl || !text || len <= 0); + AX_BREAK_IF(!_impl || !text || len <= 0); // there is no delegate attached to IME - CC_BREAK_IF(!_impl->_delegateWithIme); + AX_BREAK_IF(!_impl->_delegateWithIme); _impl->_delegateWithIme->insertText(text, len); } while (0); @@ -225,10 +225,10 @@ void IMEDispatcher::dispatchDeleteBackward() { do { - CC_BREAK_IF(!_impl); + AX_BREAK_IF(!_impl); // there is no delegate attached to IME - CC_BREAK_IF(!_impl->_delegateWithIme); + AX_BREAK_IF(!_impl->_delegateWithIme); _impl->_delegateWithIme->deleteBackward(); } while (0); @@ -238,10 +238,10 @@ void IMEDispatcher::dispatchControlKey(EventKeyboard::KeyCode keyCode) { do { - CC_BREAK_IF(!_impl); + AX_BREAK_IF(!_impl); // there is no delegate attached to IME - CC_BREAK_IF(!_impl->_delegateWithIme); + AX_BREAK_IF(!_impl->_delegateWithIme); _impl->_delegateWithIme->controlKey(keyCode); } while (0); diff --git a/core/base/CCIMEDispatcher.h b/core/base/CCIMEDispatcher.h index eafd22bf45..dc83a7ceeb 100644 --- a/core/base/CCIMEDispatcher.h +++ b/core/base/CCIMEDispatcher.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_IME_DISPATCHER_H__ -#define __CC_IME_DISPATCHER_H__ +#ifndef __AX_IME_DISPATCHER_H__ +#define __AX_IME_DISPATCHER_H__ #include "base/CCIMEDelegate.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN /** @brief Input Method Edit Message Dispatcher. */ -class CC_DLL IMEDispatcher +class AX_DLL IMEDispatcher { public: /** @@ -140,4 +140,4 @@ NS_AX_END // end of base group /// @} -#endif // __CC_IME_DISPATCHER_H__ +#endif // __AX_IME_DISPATCHER_H__ diff --git a/core/base/CCNS.cpp b/core/base/CCNS.cpp index 97fcdc03e6..d4439d9fd4 100644 --- a/core/base/CCNS.cpp +++ b/core/base/CCNS.cpp @@ -64,24 +64,24 @@ static bool splitWithForm(std::string_view content, strArray& strs) do { - CC_BREAK_IF(content.empty()); + AX_BREAK_IF(content.empty()); size_t nPosLeft = content.find('{'); size_t nPosRight = content.find('}'); // don't have '{' and '}' - CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); + AX_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); // '}' is before '{' - CC_BREAK_IF(nPosLeft > nPosRight); + AX_BREAK_IF(nPosLeft > nPosRight); auto pointStr = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1); // nothing between '{' and '}' - CC_BREAK_IF(pointStr.empty()); + AX_BREAK_IF(pointStr.empty()); size_t nPos1 = pointStr.find('{'); size_t nPos2 = pointStr.find('}'); // contain '{' or '}' - CC_BREAK_IF(nPos1 != std::string::npos || nPos2 != std::string::npos); + AX_BREAK_IF(nPos1 != std::string::npos || nPos2 != std::string::npos); split(pointStr, ",", strs); if (strs.size() != 2 || strs[0].empty() || strs[1].empty()) @@ -104,7 +104,7 @@ Rect RectFromString(std::string_view str) do { - CC_BREAK_IF(str.empty()); + AX_BREAK_IF(str.empty()); auto content = str; // find the first '{' and the third '}' @@ -118,13 +118,13 @@ Rect RectFromString(std::string_view str) } nPosRight = content.find('}', nPosRight + 1); } - CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); + AX_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos); content = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1); size_t nPointEnd = content.find('}'); - CC_BREAK_IF(nPointEnd == std::string::npos); + AX_BREAK_IF(nPointEnd == std::string::npos); nPointEnd = content.find(',', nPointEnd); - CC_BREAK_IF(nPointEnd == std::string::npos); + AX_BREAK_IF(nPointEnd == std::string::npos); // get the point string and size string auto pointStr = content.substr(0, nPointEnd); @@ -132,9 +132,9 @@ Rect RectFromString(std::string_view str) // split the string with ',' strArray pointInfo; - CC_BREAK_IF(!splitWithForm(pointStr, pointInfo)); + AX_BREAK_IF(!splitWithForm(pointStr, pointInfo)); strArray sizeInfo; - CC_BREAK_IF(!splitWithForm(sizeStr, sizeInfo)); + AX_BREAK_IF(!splitWithForm(sizeStr, sizeInfo)); float x = (float)utils::atof(pointInfo[0].c_str()); float y = (float)utils::atof(pointInfo[1].c_str()); @@ -154,7 +154,7 @@ Vec2 PointFromString(std::string_view str) do { strArray strs; - CC_BREAK_IF(!splitWithForm(str, strs)); + AX_BREAK_IF(!splitWithForm(str, strs)); float x = (float)utils::atof(strs[0].c_str()); float y = (float)utils::atof(strs[1].c_str()); @@ -172,7 +172,7 @@ Vec2 SizeFromString(std::string_view pszContent) do { strArray strs; - CC_BREAK_IF(!splitWithForm(pszContent, strs)); + AX_BREAK_IF(!splitWithForm(pszContent, strs)); float width = (float)utils::atof(strs[0].c_str()); float height = (float)utils::atof(strs[1].c_str()); diff --git a/core/base/CCNS.h b/core/base/CCNS.h index e0f3b9114f..0dc9c7a1fb 100644 --- a/core/base/CCNS.h +++ b/core/base/CCNS.h @@ -46,7 +46,7 @@ NS_AX_BEGIN * @return A Core Graphics structure that represents a rectangle. * If the string is not well-formed, the function returns Rect::ZERO. */ -Rect CC_DLL RectFromString(std::string_view str); +Rect AX_DLL RectFromString(std::string_view str); /** * @brief Returns a Core Graphics point structure corresponding to the data in a given string. @@ -58,7 +58,7 @@ Rect CC_DLL RectFromString(std::string_view str); * @return A Core Graphics structure that represents a point. * If the string is not well-formed, the function returns Vec2::ZERO. */ -Vec2 CC_DLL PointFromString(std::string_view str); +Vec2 AX_DLL PointFromString(std::string_view str); /** * @brief Returns a Core Graphics size structure corresponding to the data in a given string. @@ -70,7 +70,7 @@ Vec2 CC_DLL PointFromString(std::string_view str); * @return A Core Graphics structure that represents a size. * If the string is not well-formed, the function returns Vec2::ZERO. */ -Vec2 CC_DLL SizeFromString(std::string_view str); +Vec2 AX_DLL SizeFromString(std::string_view str); // end of data_structure group /** @} */ diff --git a/core/base/CCNinePatchImageParser.cpp b/core/base/CCNinePatchImageParser.cpp index 64ffd0c67e..3d765e4e39 100644 --- a/core/base/CCNinePatchImageParser.cpp +++ b/core/base/CCNinePatchImageParser.cpp @@ -166,7 +166,7 @@ Rect NinePatchImageParser::parseCapInset() const verticalLine.y - verticalLine.x); } - capInsets = CC_RECT_PIXELS_TO_POINTS(capInsets); + capInsets = AX_RECT_PIXELS_TO_POINTS(capInsets); return capInsets; } diff --git a/core/base/CCNinePatchImageParser.h b/core/base/CCNinePatchImageParser.h index ec189a16c6..d248b2598c 100644 --- a/core/base/CCNinePatchImageParser.h +++ b/core/base/CCNinePatchImageParser.h @@ -42,7 +42,7 @@ class SpriteFrame; * - TexturePacker Trim mode is not supported at the moment. */ -class CC_DLL NinePatchImageParser +class AX_DLL NinePatchImageParser { public: /** diff --git a/core/base/CCProfiling.h b/core/base/CCProfiling.h index fbb1f551bc..340160af94 100644 --- a/core/base/CCProfiling.h +++ b/core/base/CCProfiling.h @@ -47,10 +47,10 @@ class ProfilingTimer; /** Profiler cocos2d builtin profiler. - To use it, enable set the CC_ENABLE_PROFILERS=1 in the ccConfig.h file + To use it, enable set the AX_ENABLE_PROFILERS=1 in the ccConfig.h file */ -class CC_DLL Profiler : public Ref +class AX_DLL Profiler : public Ref { public: /** @@ -140,9 +140,9 @@ public: int32_t numberOfCalls; }; -extern void CC_DLL ProfilingBeginTimingBlock(const char* timerName); -extern void CC_DLL ProfilingEndTimingBlock(const char* timerName); -extern void CC_DLL ProfilingResetTimingBlock(const char* timerName); +extern void AX_DLL ProfilingBeginTimingBlock(const char* timerName); +extern void AX_DLL ProfilingEndTimingBlock(const char* timerName); +extern void AX_DLL ProfilingResetTimingBlock(const char* timerName); /* * cocos2d profiling categories diff --git a/core/base/CCProperties.cpp b/core/base/CCProperties.cpp index 4d1f768ecb..dbaacfcb88 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()); - CC_SAFE_DELETE(properties); + AX_SAFE_DELETE(properties); return nullptr; } @@ -133,7 +133,7 @@ Properties* Properties::createNonRefCounted(std::string_view url) if (p != properties) { p = p->clone(); - CC_SAFE_DELETE(properties); + AX_SAFE_DELETE(properties); } // XXX // p->setDirectoryPath(FileSystem::getDirectoryName(fileString)); @@ -411,13 +411,13 @@ void Properties::readProperties() Properties::~Properties() { - CC_SAFE_DELETE(_dirPath); + AX_SAFE_DELETE(_dirPath); for (size_t i = 0, count = _namespaces.size(); i < count; ++i) { - CC_SAFE_DELETE(_namespaces[i]); + AX_SAFE_DELETE(_namespaces[i]); } - CC_SAFE_DELETE(_variables); + AX_SAFE_DELETE(_variables); } // @@ -546,7 +546,7 @@ void Properties::resolveInheritance(const char* id) // Delete the child's data. for (size_t i = 0, count = derived->_namespaces.size(); i < count; i++) { - CC_SAFE_DELETE(derived->_namespaces[i]); + AX_SAFE_DELETE(derived->_namespaces[i]); } // Copy data from the parent into the child. @@ -563,7 +563,7 @@ void Properties::resolveInheritance(const char* id) derived->mergeWith(overrides); // Delete the child copy. - CC_SAFE_DELETE(overrides); + AX_SAFE_DELETE(overrides); } } @@ -1089,7 +1089,7 @@ void Properties::setDirectoryPath(const std::string* path) } else { - CC_SAFE_DELETE(_dirPath); + AX_SAFE_DELETE(_dirPath); } } diff --git a/core/base/CCProperties.h b/core/base/CCProperties.h index 1025134ff0..ba9668fa4d 100644 --- a/core/base/CCProperties.h +++ b/core/base/CCProperties.h @@ -156,7 +156,7 @@ class Data; * of a property. If the type is unknown, its string can be retrieved and interpreted * as necessary. */ -class CC_DLL Properties +class AX_DLL Properties { public: /** diff --git a/core/base/CCProtocols.h b/core/base/CCProtocols.h index 8625dea95a..00b02cf263 100644 --- a/core/base/CCProtocols.h +++ b/core/base/CCProtocols.h @@ -39,7 +39,7 @@ NS_AX_BEGIN /** * RGBA protocol that affects Node's color and opacity */ -class CC_DLL __RGBAProtocol +class AX_DLL __RGBAProtocol { public: virtual ~__RGBAProtocol() {} @@ -168,7 +168,7 @@ public: * Please refer to glBlendFunc in OpenGL ES Manual * http://www.khronos.org/opengles/sdk/docs/man/xhtml/glBlendFunc.xml for more details. */ -class CC_DLL BlendProtocol +class AX_DLL BlendProtocol { public: virtual ~BlendProtocol() {} @@ -203,7 +203,7 @@ public: * src=BlendFactor::SRC_ALPHA dst= BlendFactor::ONE_MINUS_SRC_ALPHA * But you can change the blending function at any time. */ -class CC_DLL TextureProtocol : public BlendProtocol +class AX_DLL TextureProtocol : public BlendProtocol { public: virtual ~TextureProtocol() {} @@ -229,7 +229,7 @@ public: /** * Common interface for Labels */ -class CC_DLL LabelProtocol +class AX_DLL LabelProtocol { public: virtual ~LabelProtocol() {} @@ -256,7 +256,7 @@ public: /** * OpenGL projection protocol */ -class CC_DLL DirectorDelegate +class AX_DLL DirectorDelegate { public: virtual ~DirectorDelegate() {} @@ -272,7 +272,7 @@ public: /** * interface for playable items */ -class CC_DLL PlayableProtocol +class AX_DLL PlayableProtocol { public: virtual ~PlayableProtocol() {} diff --git a/core/base/CCRef.cpp b/core/base/CCRef.cpp index e1af11b336..9b01d0123a 100644 --- a/core/base/CCRef.cpp +++ b/core/base/CCRef.cpp @@ -29,7 +29,7 @@ THE SOFTWARE. #include "base/ccMacros.h" #include "base/CCScriptSupport.h" -#if CC_REF_LEAK_DETECTION +#if AX_REF_LEAK_DETECTION # include // std::find # include # include @@ -38,41 +38,41 @@ THE SOFTWARE. NS_AX_BEGIN -#if CC_REF_LEAK_DETECTION +#if AX_REF_LEAK_DETECTION static void trackRef(Ref* ref); static void untrackRef(Ref* ref); #endif Ref::Ref() : _referenceCount(1) // when the Ref is created, the reference count of it is 1 -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING , _luaID(0) , _scriptObject(nullptr) , _rooted(false) #endif { -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING static unsigned int uObjectCount = 0; _ID = ++uObjectCount; #endif -#if CC_REF_LEAK_DETECTION +#if AX_REF_LEAK_DETECTION trackRef(this); #endif } Ref::~Ref() { -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEngineProtocol* pEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (pEngine != nullptr && _luaID) { // if the object is referenced by Lua engine, remove it pEngine->removeScriptObjectByObject(this); } -#endif // CC_ENABLE_SCRIPT_BINDING +#endif // AX_ENABLE_SCRIPT_BINDING -#if CC_REF_LEAK_DETECTION +#if AX_REF_LEAK_DETECTION if (_referenceCount != 0) untrackRef(this); #endif @@ -127,7 +127,7 @@ void Ref::release() } #endif -#if CC_REF_LEAK_DETECTION +#if AX_REF_LEAK_DETECTION untrackRef(this); #endif delete this; @@ -145,7 +145,7 @@ unsigned int Ref::getReferenceCount() const return _referenceCount; } -#if CC_REF_LEAK_DETECTION +#if AX_REF_LEAK_DETECTION static std::vector __refAllocationList; static std::mutex __refMutex; @@ -164,7 +164,7 @@ void Ref::printLeaks() for (const auto& ref : __refAllocationList) { - CC_ASSERT(ref); + AX_ASSERT(ref); const char* type = typeid(*ref).name(); log("[memory] LEAK: Ref object '%s' still active with reference count %d.\n", (type ? type : ""), ref->getReferenceCount()); @@ -194,6 +194,6 @@ static void untrackRef(Ref* ref) __refAllocationList.erase(iter); } -#endif // #if CC_REF_LEAK_DETECTION +#endif // #if AX_REF_LEAK_DETECTION NS_AX_END diff --git a/core/base/CCRef.h b/core/base/CCRef.h index 7beeedd2e6..9a74e8ded1 100644 --- a/core/base/CCRef.h +++ b/core/base/CCRef.h @@ -30,7 +30,7 @@ THE SOFTWARE. #include "platform/CCPlatformMacros.h" #include "base/ccConfig.h" -#define CC_REF_LEAK_DETECTION 0 +#define AX_REF_LEAK_DETECTION 0 /** * @addtogroup base @@ -45,7 +45,7 @@ class Ref; * @lua NA * @js NA */ -class CC_DLL Clonable +class AX_DLL Clonable { public: /** Returns a copy of the Ref. */ @@ -63,7 +63,7 @@ public: * then it is easy to be shared in different places. * @js NA */ -class CC_DLL Ref +class AX_DLL Ref { public: /** @@ -138,7 +138,7 @@ protected: friend class AutoreleasePool; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING public: /// object id, ScriptSupport need public _ID unsigned int _ID; @@ -153,8 +153,8 @@ public: bool _rooted; #endif - // Memory leak diagnostic data (only included when CC_REF_LEAK_DETECTION is defined and its value isn't zero) -#if CC_REF_LEAK_DETECTION + // Memory leak diagnostic data (only included when AX_REF_LEAK_DETECTION is defined and its value isn't zero) +#if AX_REF_LEAK_DETECTION public: static void printLeaks(); #endif @@ -169,12 +169,12 @@ typedef void (Ref::*SEL_CallFuncO)(Ref*); typedef void (Ref::*SEL_MenuHandler)(Ref*); typedef void (Ref::*SEL_SCHEDULE)(float); -#define CC_CALLFUNC_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) -#define CC_CALLFUNCN_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) -#define CC_CALLFUNCND_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) -#define CC_CALLFUNCO_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) -#define CC_MENU_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) -#define CC_SCHEDULE_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) +#define AX_CALLFUNC_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) +#define AX_CALLFUNCN_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) +#define AX_CALLFUNCND_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) +#define AX_CALLFUNCO_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) +#define AX_MENU_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) +#define AX_SCHEDULE_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) NS_AX_END // end of base group diff --git a/core/base/CCRefPtr.h b/core/base/CCRefPtr.h index 7e92da5fe2..4b78ee6637 100644 --- a/core/base/CCRefPtr.h +++ b/core/base/CCRefPtr.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_REF_PTR_H__ -#define __CC_REF_PTR_H__ +#ifndef __AX_REF_PTR_H__ +#define __AX_REF_PTR_H__ /// @cond DO_NOT_SHOW #include "base/CCRef.h" @@ -39,7 +39,7 @@ NS_AX_BEGIN * Utility/support macros. Defined to enable RefPtr to contain types like 'const T' because we do not * regard retain()/release() as affecting mutability of state. */ -#define CC_REF_PTR_SAFE_RETAIN(ptr) \ +#define AX_REF_PTR_SAFE_RETAIN(ptr) \ \ do \ { \ @@ -50,7 +50,7 @@ NS_AX_BEGIN \ } while (0); -#define CC_REF_PTR_SAFE_RELEASE(ptr) \ +#define AX_REF_PTR_SAFE_RELEASE(ptr) \ \ do \ { \ @@ -61,7 +61,7 @@ NS_AX_BEGIN \ } while (0); -#define CC_REF_PTR_SAFE_RELEASE_NULL(ptr) \ +#define AX_REF_PTR_SAFE_RELEASE_NULL(ptr) \ \ do \ { \ @@ -102,7 +102,7 @@ public: other._ptr = nullptr; } - RefPtr(T* ptr) : _ptr(ptr) { CC_REF_PTR_SAFE_RETAIN(_ptr); } + RefPtr(T* ptr) : _ptr(ptr) { AX_REF_PTR_SAFE_RETAIN(_ptr); } template RefPtr(ReferencedObject<_Other>&& ptr) : _ptr(ptr._ptr) @@ -110,16 +110,16 @@ public: RefPtr(std::nullptr_t ptr) : _ptr(nullptr) {} - RefPtr(const RefPtr& other) : _ptr(other._ptr) { CC_REF_PTR_SAFE_RETAIN(_ptr); } + RefPtr(const RefPtr& other) : _ptr(other._ptr) { AX_REF_PTR_SAFE_RETAIN(_ptr); } - ~RefPtr() { CC_REF_PTR_SAFE_RELEASE_NULL(_ptr); } + ~RefPtr() { AX_REF_PTR_SAFE_RELEASE_NULL(_ptr); } RefPtr& operator=(const RefPtr& other) { if (other._ptr != _ptr) { - CC_REF_PTR_SAFE_RETAIN(other._ptr); - CC_REF_PTR_SAFE_RELEASE(_ptr); + AX_REF_PTR_SAFE_RETAIN(other._ptr); + AX_REF_PTR_SAFE_RELEASE(_ptr); _ptr = other._ptr; } @@ -130,7 +130,7 @@ public: { if (&other != this) { - CC_REF_PTR_SAFE_RELEASE(_ptr); + AX_REF_PTR_SAFE_RELEASE(_ptr); _ptr = other._ptr; other._ptr = nullptr; } @@ -142,8 +142,8 @@ public: { if (other != _ptr) { - CC_REF_PTR_SAFE_RETAIN(other); - CC_REF_PTR_SAFE_RELEASE(_ptr); + AX_REF_PTR_SAFE_RETAIN(other); + AX_REF_PTR_SAFE_RELEASE(_ptr); _ptr = other; } @@ -152,7 +152,7 @@ public: RefPtr& operator=(std::nullptr_t other) { - CC_REF_PTR_SAFE_RELEASE_NULL(_ptr); + AX_REF_PTR_SAFE_RELEASE_NULL(_ptr); return *this; } @@ -214,7 +214,7 @@ public: explicit operator bool() const { return _ptr != nullptr; } - void reset() { CC_REF_PTR_SAFE_RELEASE_NULL(_ptr); } + void reset() { AX_REF_PTR_SAFE_RELEASE_NULL(_ptr); } void swap(RefPtr& other) { @@ -242,7 +242,7 @@ public: */ void weakAssign(const RefPtr& other) { - CC_REF_PTR_SAFE_RELEASE(_ptr); + AX_REF_PTR_SAFE_RELEASE(_ptr); _ptr = other._ptr; } @@ -328,11 +328,11 @@ RefPtr dynamic_pointer_cast(const RefPtr& r) /** * Done with these macros. */ -#undef CC_REF_PTR_SAFE_RETAIN -#undef CC_REF_PTR_SAFE_RELEASE -#undef CC_REF_PTR_SAFE_RELEASE_NULL +#undef AX_REF_PTR_SAFE_RETAIN +#undef AX_REF_PTR_SAFE_RELEASE +#undef AX_REF_PTR_SAFE_RELEASE_NULL NS_AX_END /// @endcond -#endif // __CC_REF_PTR_H__ +#endif // __AX_REF_PTR_H__ diff --git a/core/base/CCScheduler.cpp b/core/base/CCScheduler.cpp index 1109449b2f..8f79c23985 100644 --- a/core/base/CCScheduler.cpp +++ b/core/base/CCScheduler.cpp @@ -89,7 +89,7 @@ void Timer::setupTimerWithInterval(float seconds, unsigned int repeat, float del _delay = delay; _useDelay = (_delay > 0.0f) ? true : false; _repeat = repeat; - _runForever = (_repeat == CC_REPEAT_FOREVER) ? true : false; + _runForever = (_repeat == AX_REPEAT_FOREVER) ? true : false; _timesExecuted = 0; } @@ -214,7 +214,7 @@ void TimerTargetCallback::cancel() _scheduler->unschedule(_key, _target); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING // TimerScriptHandler @@ -259,7 +259,7 @@ Scheduler::Scheduler() , _currentTarget(nullptr) , _currentTargetSalvaged(false) , _updateHashLocked(false) -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING , _scriptHandlerEntries(20) #endif { @@ -285,7 +285,7 @@ void Scheduler::schedule(const ccSchedulerFunc& callback, bool paused, std::string_view key) { - this->schedule(callback, target, interval, CC_REPEAT_FOREVER, 0.0f, paused, key); + this->schedule(callback, target, interval, AX_REPEAT_FOREVER, 0.0f, paused, key); } void Scheduler::schedule(const ccSchedulerFunc& callback, @@ -553,7 +553,7 @@ void Scheduler::removeUpdateFromHash(struct _listEntry* entry) // list entry DL_DELETE(*element->list, element->entry); if (!_updateHashLocked) - CC_SAFE_DELETE(element->entry); + AX_SAFE_DELETE(element->entry); else { element->entry->markedForDeletion = true; @@ -623,7 +623,7 @@ void Scheduler::unscheduleAllWithMinPriority(int minPriority) unscheduleUpdate(entry->target); } } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING _scriptHandlerEntries.clear(); #endif } @@ -663,7 +663,7 @@ void Scheduler::unscheduleAllForTarget(void* target) unscheduleUpdate(target); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING unsigned int Scheduler::scheduleScriptFunc(unsigned int handler, float interval, bool paused) { SchedulerScriptHandlerEntry* entry = SchedulerScriptHandlerEntry::create(handler, interval, paused); @@ -916,7 +916,7 @@ void Scheduler::update(float dt) _updateHashLocked = false; _currentTarget = nullptr; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING // // Script callbacks // @@ -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, CC_REPEAT_FOREVER, 0.0f, paused); + this->schedule(selector, target, interval, AX_REPEAT_FOREVER, 0.0f, paused); } bool Scheduler::isScheduled(SEL_SCHEDULE selector, const Ref* target) const diff --git a/core/base/CCScheduler.h b/core/base/CCScheduler.h index 4051b355a4..c49837b411 100644 --- a/core/base/CCScheduler.h +++ b/core/base/CCScheduler.h @@ -46,7 +46,7 @@ typedef std::function ccSchedulerFunc; /** * @cond */ -class CC_DLL Timer : public Ref +class AX_DLL Timer : public Ref { protected: Timer(); @@ -75,7 +75,7 @@ protected: bool _aborted; }; -class CC_DLL TimerTargetSelector : public Timer +class AX_DLL TimerTargetSelector : public Timer { public: TimerTargetSelector(); @@ -99,7 +99,7 @@ protected: SEL_SCHEDULE _selector; }; -class CC_DLL TimerTargetCallback : public Timer +class AX_DLL TimerTargetCallback : public Timer { public: TimerTargetCallback(); @@ -126,9 +126,9 @@ protected: std::string _key; }; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING -class CC_DLL TimerScriptHandler : public Timer +class AX_DLL TimerScriptHandler : public Timer { public: bool initWithScriptHandler(int handler, float seconds); @@ -156,7 +156,7 @@ struct _listEntry; struct _hashSelectorEntry; struct _hashUpdateEntry; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING class SchedulerScriptHandlerEntry; #endif @@ -172,7 +172,7 @@ The 'custom selectors' should be avoided when possible. It is faster, and consum selector'. */ -class CC_DLL Scheduler : public Ref +class AX_DLL Scheduler : public Ref { public: /** Priority level reserved for system services. @@ -232,7 +232,7 @@ public: If paused is true, then it won't be called until it is resumed. If 'interval' is 0, it will be called every frame, but if so, it's recommended to use 'scheduleUpdate' instead. If the 'callback' is already scheduled, then only the interval parameter will be updated without re-scheduling it - again. repeat let the action be repeated repeat + 1 times, use CC_REPEAT_FOREVER to let the action run continuously + again. repeat let the action be repeated repeat + 1 times, use AX_REPEAT_FOREVER to let the action run continuously delay is the amount of time the action will wait before it'll start. @param callback The callback function. @param target The target of the callback function. @@ -269,7 +269,7 @@ public: If paused is true, then it won't be called until it is resumed. If 'interval' is 0, it will be called every frame, but if so, it's recommended to use 'scheduleUpdate' instead. If the selector is already scheduled, then only the interval parameter will be updated without re-scheduling it - again. repeat let the action be repeated repeat + 1 times, use CC_REPEAT_FOREVER to let the action run continuously + again. repeat let the action be repeated repeat + 1 times, use AX_REPEAT_FOREVER to let the action run continuously delay is the amount of time the action will wait before it'll start @param selector The callback function. @@ -306,7 +306,7 @@ public: this->schedulePerFrame([target](float dt) { target->update(dt); }, target, priority, paused); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING // Schedule for script bindings. /** The scheduled script callback will be called every 'interval' seconds. If paused is true, then it won't be called until it is resumed. @@ -367,7 +367,7 @@ public: */ void unscheduleAllWithMinPriority(int minPriority); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING /** Unschedule a script entry. * @warning Don't invoke this function unless you know what you are doing. * @js NA @@ -497,7 +497,7 @@ protected: // If true unschedule will not remove anything from a hash. Elements will only be marked for deletion. bool _updateHashLocked; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING Vector _scriptHandlerEntries; #endif diff --git a/core/base/CCScriptSupport.cpp b/core/base/CCScriptSupport.cpp index 136382a740..5c526a362b 100644 --- a/core/base/CCScriptSupport.cpp +++ b/core/base/CCScriptSupport.cpp @@ -26,12 +26,12 @@ #include "base/CCScriptSupport.h" -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING # include "base/CCScheduler.h" # include "2d/CCNode.h" -bool CC_DLL cc_assert_script_compatible(const char* msg) +bool AX_DLL cc_assert_script_compatible(const char* msg) { axis::ScriptEngineProtocol* engine = axis::ScriptEngineManager::getInstance()->getScriptEngine(); if (engine && engine->handleAssert(msg)) @@ -183,4 +183,4 @@ int ScriptEngineManager::sendEventToLua(const ScriptEvent& event) NS_AX_END -#endif // #if CC_ENABLE_SCRIPT_BINDING +#endif // #if AX_ENABLE_SCRIPT_BINDING diff --git a/core/base/CCScriptSupport.h b/core/base/CCScriptSupport.h index 314a421d4c..d2fa6edfe1 100644 --- a/core/base/CCScriptSupport.h +++ b/core/base/CCScriptSupport.h @@ -41,7 +41,7 @@ * @{ */ -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING typedef struct lua_State lua_State; @@ -587,7 +587,7 @@ struct ScriptEvent * ScriptEngine. So a crash will appear on Win32 if you click the close button. * @js NA */ -class CC_DLL ScriptEngineProtocol +class AX_DLL ScriptEngineProtocol { public: /** @@ -783,7 +783,7 @@ class Node; * @since v0.99.5-x-0.8.5 * @js NA */ -class CC_DLL ScriptEngineManager +class AX_DLL ScriptEngineManager { public: /** @@ -866,7 +866,7 @@ private: NS_AX_END -#endif // #if CC_ENABLE_SCRIPT_BINDING +#endif // #if AX_ENABLE_SCRIPT_BINDING // end group /// @} diff --git a/core/base/CCStencilStateManager.cpp b/core/base/CCStencilStateManager.cpp index 48d9d12f85..a682af37c4 100644 --- a/core/base/CCStencilStateManager.cpp +++ b/core/base/CCStencilStateManager.cpp @@ -66,7 +66,7 @@ StencilStateManager::StencilStateManager() StencilStateManager::~StencilStateManager() { - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); } void StencilStateManager::drawFullScreenQuadClearStencil(float globalZOrder) @@ -111,8 +111,8 @@ void StencilStateManager::updateLayerMask() void StencilStateManager::onBeforeVisit(float globalZOrder) { - _customCommand.setBeforeCallback(CC_CALLBACK_0(StencilStateManager::onBeforeDrawQuadCmd, this)); - _customCommand.setAfterCallback(CC_CALLBACK_0(StencilStateManager::onAfterDrawQuadCmd, this)); + _customCommand.setBeforeCallback(AX_CALLBACK_0(StencilStateManager::onBeforeDrawQuadCmd, this)); + _customCommand.setAfterCallback(AX_CALLBACK_0(StencilStateManager::onAfterDrawQuadCmd, this)); // draw a fullscreen solid rectangle to clear the stencil buffer drawFullScreenQuadClearStencil(globalZOrder); diff --git a/core/base/CCStencilStateManager.h b/core/base/CCStencilStateManager.h index 0d168495bc..2b1ba78310 100644 --- a/core/base/CCStencilStateManager.h +++ b/core/base/CCStencilStateManager.h @@ -36,7 +36,7 @@ */ NS_AX_BEGIN -class CC_DLL StencilStateManager +class AX_DLL StencilStateManager { public: StencilStateManager(); @@ -50,7 +50,7 @@ public: float getAlphaThreshold() const; private: - CC_DISALLOW_COPY_AND_ASSIGN(StencilStateManager); + AX_DISALLOW_COPY_AND_ASSIGN(StencilStateManager); static int s_layer; /**draw fullscreen quad to clear stencil bits */ diff --git a/core/base/CCTouch.h b/core/base/CCTouch.h index cf9b02f283..0f6723d0f3 100644 --- a/core/base/CCTouch.h +++ b/core/base/CCTouch.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_TOUCH_H__ -#define __CC_TOUCH_H__ +#ifndef __AX_TOUCH_H__ +#define __AX_TOUCH_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -41,7 +41,7 @@ NS_AX_BEGIN * @brief Encapsulates the Touch information, such as touch point, id and so on, and provides the methods that commonly used. */ -class CC_DLL Touch : public Ref +class AX_DLL Touch : public Ref { public: /** diff --git a/core/base/CCUserDefault.cpp b/core/base/CCUserDefault.cpp index 6b00d4b473..8c9b97f697 100644 --- a/core/base/CCUserDefault.cpp +++ b/core/base/CCUserDefault.cpp @@ -365,7 +365,7 @@ UserDefault* UserDefault::getInstance() void UserDefault::destroyInstance() { - CC_SAFE_DELETE(_userDefault); + AX_SAFE_DELETE(_userDefault); } void UserDefault::setDelegate(UserDefault* delegate) diff --git a/core/base/CCUserDefault.h b/core/base/CCUserDefault.h index a74540750c..04106f25bb 100644 --- a/core/base/CCUserDefault.h +++ b/core/base/CCUserDefault.h @@ -51,7 +51,7 @@ NS_AX_BEGIN * @warning: On windows, linux, use XML to store data, which means there are some limitations of * the key string, for example, `/` is not valid. */ -class CC_DLL UserDefault +class AX_DLL UserDefault { public: // get value methods diff --git a/core/base/CCValue.cpp b/core/base/CCValue.cpp index d4986694ba..bb582c6816 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: - CC_SAFE_DELETE(_field.strVal); + AX_SAFE_DELETE(_field.strVal); break; case Type::VECTOR: - CC_SAFE_DELETE(_field.vectorVal); + AX_SAFE_DELETE(_field.vectorVal); break; case Type::MAP: - CC_SAFE_DELETE(_field.mapVal); + AX_SAFE_DELETE(_field.mapVal); break; case Type::INT_KEY_MAP: - CC_SAFE_DELETE(_field.intKeyMapVal); + AX_SAFE_DELETE(_field.intKeyMapVal); break; default: break; diff --git a/core/base/CCValue.h b/core/base/CCValue.h index afc2ff139e..b01c53be9d 100644 --- a/core/base/CCValue.h +++ b/core/base/CCValue.h @@ -46,14 +46,14 @@ typedef std::vector ValueVector; typedef hlookup::string_map ValueMap; typedef std::unordered_map ValueMapIntKey; -CC_DLL extern const ValueVector ValueVectorNull; -CC_DLL extern const ValueMap ValueMapNull; -CC_DLL extern const ValueMapIntKey ValueMapIntKeyNull; +AX_DLL extern const ValueVector ValueVectorNull; +AX_DLL extern const ValueMap ValueMapNull; +AX_DLL extern const ValueMapIntKey ValueMapIntKeyNull; /* * This class is provide as a wrapper of basic types, such as int and bool. */ -class CC_DLL Value +class AX_DLL Value { public: /** A predefined Value that has not value. */ diff --git a/core/base/ObjectFactory.cpp b/core/base/ObjectFactory.cpp index 643b093ede..7ed5428996 100644 --- a/core/base/ObjectFactory.cpp +++ b/core/base/ObjectFactory.cpp @@ -82,7 +82,7 @@ ObjectFactory* ObjectFactory::getInstance() void ObjectFactory::destroyInstance() { - CC_SAFE_DELETE(_sharedFactory); + AX_SAFE_DELETE(_sharedFactory); } Ref* ObjectFactory::createObject(std::string_view name) diff --git a/core/base/ObjectFactory.h b/core/base/ObjectFactory.h index 0b9c6ed24b..8e9b732c5f 100644 --- a/core/base/ObjectFactory.h +++ b/core/base/ObjectFactory.h @@ -34,12 +34,12 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL ObjectFactory +class AX_DLL ObjectFactory { public: typedef axis::Ref* (*Instance)(void); typedef std::function InstanceFunc; - struct CC_DLL TInfo + struct AX_DLL TInfo { TInfo(); TInfo(std::string_view type, Instance ins = nullptr); diff --git a/core/base/SimpleTimer.h b/core/base/SimpleTimer.h index 7d5482a068..9bf757933c 100644 --- a/core/base/SimpleTimer.h +++ b/core/base/SimpleTimer.h @@ -12,10 +12,10 @@ namespace stimer { typedef void* TIMER_ID; typedef std::function vcallback_t; -CC_DLL TIMER_ID loop(unsigned int n, float interval, vcallback_t callback, bool bNative = true); -CC_DLL TIMER_ID delay(float delay, vcallback_t callback, bool bNative = true); -CC_DLL void kill(TIMER_ID timerId, bool bNative = true); -CC_DLL void killAll(bool bNative = true); +AX_DLL TIMER_ID loop(unsigned int n, float interval, vcallback_t callback, bool bNative = true); +AX_DLL TIMER_ID delay(float delay, vcallback_t callback, bool bNative = true); +AX_DLL void kill(TIMER_ID timerId, bool bNative = true); +AX_DLL void killAll(bool bNative = true); } // namespace stimer NS_AX_END diff --git a/core/base/TGAlib.cpp b/core/base/TGAlib.cpp index d5c89805ea..7948ac5474 100644 --- a/core/base/TGAlib.cpp +++ b/core/base/TGAlib.cpp @@ -44,19 +44,19 @@ bool tgaLoadHeader(unsigned char* buffer, uint32_t bufSize, tImageTGA* info) do { size_t step = sizeof(unsigned char) * 2; - CC_BREAK_IF((step + sizeof(unsigned char)) > bufSize); + AX_BREAK_IF((step + sizeof(unsigned char)) > bufSize); memcpy(&info->type, buffer + step, sizeof(unsigned char)); step += sizeof(unsigned char) * 2; step += sizeof(signed short) * 4; - CC_BREAK_IF((step + sizeof(signed short) * 2 + sizeof(unsigned char)) > bufSize); + AX_BREAK_IF((step + sizeof(signed short) * 2 + sizeof(unsigned char)) > bufSize); memcpy(&info->width, buffer + step, sizeof(signed short)); memcpy(&info->height, buffer + step + sizeof(signed short), sizeof(signed short)); memcpy(&info->pixelDepth, buffer + step + sizeof(signed short) * 2, sizeof(unsigned char)); step += sizeof(unsigned char); step += sizeof(signed short) * 2; - CC_BREAK_IF((step + sizeof(unsigned char)) > bufSize); + AX_BREAK_IF((step + sizeof(unsigned char)) > bufSize); unsigned char cGarbage; memcpy(&cGarbage, buffer + step, sizeof(unsigned char)); @@ -87,7 +87,7 @@ bool tgaLoadImageData(unsigned char* Buffer, uint32_t bufSize, tImageTGA* info) total = info->height * info->width * mode; size_t dataSize = sizeof(unsigned char) * total; - CC_BREAK_IF((step + dataSize) > bufSize); + AX_BREAK_IF((step + dataSize) > bufSize); memcpy(info->imageData, Buffer + step, dataSize); // mode=3 or 4 implies that the image is RGB(A). However TGA @@ -132,7 +132,7 @@ static bool tgaLoadRLEImageData(unsigned char* buffer, uint32_t bufSize, tImageT else { // otherwise, read in the run length token - CC_BREAK_IF((step + sizeof(unsigned char)) > bufSize); + AX_BREAK_IF((step + sizeof(unsigned char)) > bufSize); memcpy(&runlength, buffer + step, sizeof(unsigned char)); step += sizeof(unsigned char); @@ -149,7 +149,7 @@ static bool tgaLoadRLEImageData(unsigned char* buffer, uint32_t bufSize, tImageT if (!skip) { // no, read in the pixel data - CC_BREAK_IF((step + sizeof(unsigned char) * mode) > bufSize); + AX_BREAK_IF((step + sizeof(unsigned char) * mode) > bufSize); memcpy(aux, buffer + step, sizeof(unsigned char) * mode); step += sizeof(unsigned char) * mode; @@ -203,7 +203,7 @@ tImageTGA* tgaLoadBuffer(unsigned char* buffer, int32_t size) do { - CC_BREAK_IF(!buffer); + AX_BREAK_IF(!buffer); info = (tImageTGA*)malloc(sizeof(tImageTGA)); // get the file header info diff --git a/core/base/ZipUtils.cpp b/core/base/ZipUtils.cpp index db5bf1c4a4..d460530fbf 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 = CC_SWAP_INT16_BIG_TO_HOST(header->version); + unsigned int version = AX_SWAP_INT16_BIG_TO_HOST(header->version); if (version > 2) { CCLOG("cocos2d: Unsupported CCZ header format"); @@ -406,7 +406,7 @@ int ZipUtils::inflateCCZBuffer(const unsigned char* buffer, ssize_t bufferLen, u } // verify compression format - if (CC_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB) + if (AX_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB) { CCLOG("cocos2d: CCZ Unsupported compression method"); 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 = CC_SWAP_INT16_BIG_TO_HOST(header->version); + unsigned int version = AX_SWAP_INT16_BIG_TO_HOST(header->version); if (version > 0) { CCLOG("cocos2d: Unsupported CCZ header format"); @@ -426,7 +426,7 @@ int ZipUtils::inflateCCZBuffer(const unsigned char* buffer, ssize_t bufferLen, u } // verify compression format - if (CC_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB) + if (AX_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB) { CCLOG("cocos2d: CCZ Unsupported compression method"); 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 = CC_SWAP_INT32_BIG_TO_HOST(header->reserved); + unsigned int required = AX_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 = CC_SWAP_INT32_BIG_TO_HOST(header->len); + unsigned int len = AX_SWAP_INT32_BIG_TO_HOST(header->len); *out = (unsigned char*)malloc(len); if (!*out) @@ -697,7 +697,7 @@ ZipFile::~ZipFile() unzClose(_data->zipFile); } - CC_SAFE_DELETE(_data); + AX_SAFE_DELETE(_data); } bool ZipFile::setFilter(std::string_view filter) @@ -705,8 +705,8 @@ bool ZipFile::setFilter(std::string_view filter) bool ret = false; do { - CC_BREAK_IF(!_data); - CC_BREAK_IF(!_data->zipFile); + AX_BREAK_IF(!_data); + AX_BREAK_IF(!_data->zipFile); // clear existing file list _data->fileList.clear(); @@ -748,7 +748,7 @@ bool ZipFile::fileExists(std::string_view fileName) const bool ret = false; do { - CC_BREAK_IF(!_data); + AX_BREAK_IF(!_data); ret = _data->fileList.find(fileName) != _data->fileList.end(); } while (false); @@ -798,24 +798,24 @@ unsigned char* ZipFile::getFileData(std::string_view fileName, ssize_t* size) do { - CC_BREAK_IF(!_data->zipFile); - CC_BREAK_IF(fileName.empty()); + AX_BREAK_IF(!_data->zipFile); + AX_BREAK_IF(fileName.empty()); auto it = _data->fileList.find(fileName); - CC_BREAK_IF(it == _data->fileList.end()); + AX_BREAK_IF(it == _data->fileList.end()); ZipEntryInfo& fileInfo = it->second; std::unique_lock lck(_data->zipFileMtx); int nRet = unzGoToFilePos(_data->zipFile, &fileInfo.pos); - CC_BREAK_IF(UNZ_OK != nRet); + AX_BREAK_IF(UNZ_OK != nRet); nRet = unzOpenCurrentFile(_data->zipFile); - CC_BREAK_IF(UNZ_OK != nRet); + AX_BREAK_IF(UNZ_OK != nRet); buffer = (unsigned char*)malloc(fileInfo.uncompressed_size); - int CC_UNUSED nSize = + int AX_UNUSED nSize = unzReadCurrentFile(_data->zipFile, buffer, static_cast(fileInfo.uncompressed_size)); CCASSERT(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong"); @@ -834,24 +834,24 @@ bool ZipFile::getFileData(std::string_view fileName, ResizableBuffer* buffer) bool res = false; do { - CC_BREAK_IF(!_data->zipFile); - CC_BREAK_IF(fileName.empty()); + AX_BREAK_IF(!_data->zipFile); + AX_BREAK_IF(fileName.empty()); ZipFilePrivate::FileListContainer::iterator it = _data->fileList.find(fileName); - CC_BREAK_IF(it == _data->fileList.end()); + AX_BREAK_IF(it == _data->fileList.end()); ZipEntryInfo& fileInfo = it->second; std::unique_lock lck(_data->zipFileMtx); int nRet = unzGoToFilePos(_data->zipFile, &fileInfo.pos); - CC_BREAK_IF(UNZ_OK != nRet); + AX_BREAK_IF(UNZ_OK != nRet); nRet = unzOpenCurrentFile(_data->zipFile); - CC_BREAK_IF(UNZ_OK != nRet); + AX_BREAK_IF(UNZ_OK != nRet); buffer->resize(fileInfo.uncompressed_size); - int CC_UNUSED nSize = + int AX_UNUSED nSize = unzReadCurrentFile(_data->zipFile, buffer->buffer(), static_cast(fileInfo.uncompressed_size)); CCASSERT(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong"); unzCloseCurrentFile(_data->zipFile); @@ -937,12 +937,12 @@ int ZipFile::zfread(ZipFileStream* zfs, void* buf, unsigned int size) int n = 0; do { - CC_BREAK_IF(zfs == nullptr || zfs->offset >= zfs->entry->uncompressed_size); + AX_BREAK_IF(zfs == nullptr || zfs->offset >= zfs->entry->uncompressed_size); std::unique_lock lck(_data->zipFileMtx); int nRet = unzGoToFilePos(_data->zipFile, &zfs->entry->pos); - CC_BREAK_IF(UNZ_OK != nRet); + AX_BREAK_IF(UNZ_OK != nRet); nRet = unzOpenCurrentFile(_data->zipFile); unzSeek64(_data->zipFile, zfs->offset, SEEK_SET); @@ -1014,26 +1014,26 @@ unsigned char* ZipFile::getFileDataFromZip(std::string_view zipFilePath, std::st do { - CC_BREAK_IF(zipFilePath.empty()); + AX_BREAK_IF(zipFilePath.empty()); file = unzOpen(zipFilePath.data()); - CC_BREAK_IF(!file); + AX_BREAK_IF(!file); // minizip 1.2.0 is same with other platforms int ret = unzLocateFile(file, filename.data(), nullptr); - CC_BREAK_IF(UNZ_OK != ret); + AX_BREAK_IF(UNZ_OK != ret); char filePathA[260]; unz_file_info_s fileInfo; ret = unzGetCurrentFileInfo(file, &fileInfo, filePathA, sizeof(filePathA), nullptr, 0, nullptr, 0); - CC_BREAK_IF(UNZ_OK != ret); + AX_BREAK_IF(UNZ_OK != ret); ret = unzOpenCurrentFile(file); - CC_BREAK_IF(UNZ_OK != ret); + AX_BREAK_IF(UNZ_OK != ret); buffer = (unsigned char*)malloc(fileInfo.uncompressed_size); - int CC_UNUSED readedSize = unzReadCurrentFile(file, buffer, static_cast(fileInfo.uncompressed_size)); + int AX_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 8c044f4334..49dabc5314 100644 --- a/core/base/ZipUtils.h +++ b/core/base/ZipUtils.h @@ -33,9 +33,9 @@ THE SOFTWARE. #include "platform/CCFileUtils.h" #include -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "platform/android/CCFileUtils-android.h" -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) // for import ssize_t on win32 platform # include "platform/CCStdC.h" #endif @@ -70,7 +70,7 @@ enum CCZ_COMPRESSION_NONE, /** plain (not supported yet). */ }; -class CC_DLL ZipUtils +class AX_DLL ZipUtils { public: /** @@ -237,7 +237,7 @@ struct ZipFileStream * * @since v2.0.5 */ -class CC_DLL ZipFile +class AX_DLL ZipFile { public: /** @@ -323,7 +323,7 @@ public: * @return Upon success, a pointer to the data is returned, otherwise nullptr. * @warning Recall: you are responsible for calling free() on any Non-nullptr pointer returned. */ - CC_DEPRECATED() + AX_DEPRECATED() static unsigned char* getFileDataFromZip(std::string_view zipFilePath, std::string_view filename, ssize_t* size); private: diff --git a/core/base/base64.cpp b/core/base/base64.cpp index 745dde04bc..179a26207d 100644 --- a/core/base/base64.cpp +++ b/core/base/base64.cpp @@ -76,7 +76,7 @@ int _base64Decode(const unsigned char* input, unsigned int input_len, unsigned c switch (char_count) { case 1: -#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_BADA) fprintf(stderr, "base64Decode: encoding incomplete: at least 2 bits missing"); #endif errors++; @@ -94,7 +94,7 @@ int _base64Decode(const unsigned char* input, unsigned int input_len, unsigned c { if (char_count) { -#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_BADA) fprintf(stderr, "base64 encoding incomplete: at least %d bits truncated", ((4 - char_count) * 6)); #endif errors++; @@ -169,7 +169,7 @@ int base64Decode(const unsigned char* in, unsigned int inLength, unsigned char** if (ret > 0) { -#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_BADA) printf("Base64Utils: error decoding"); #endif free(*out); diff --git a/core/base/base64.h b/core/base/base64.h index a6e16f5e7c..8e54029415 100644 --- a/core/base/base64.h +++ b/core/base/base64.h @@ -44,7 +44,7 @@ NS_AX_BEGIN * @since v0.8.1 */ -int CC_DLL base64Decode(const unsigned char* in, unsigned int inLength, unsigned char** out); +int AX_DLL base64Decode(const unsigned char* in, unsigned int inLength, unsigned char** out); /** * Encodes bytes into a 64base encoded memory with terminating '\0' character. @@ -54,7 +54,7 @@ int CC_DLL base64Decode(const unsigned char* in, unsigned int inLength, unsigned * @since v2.1.4 */ -int CC_DLL base64Encode(const unsigned char* in, unsigned int inLength, char** out); +int AX_DLL base64Encode(const unsigned char* in, unsigned int inLength, char** out); } // namespace cocos2d diff --git a/core/base/bitmask.h b/core/base/bitmask.h index 8e84e46484..497c5c1b90 100644 --- a/core/base/bitmask.h +++ b/core/base/bitmask.h @@ -33,7 +33,7 @@ Copyright (c) 2020 C4games Ltd. #endif // BITMASK OPERATIONS, modified from msvc++ for cross-platform compiling. -#define CC_ENABLE_BITMASK_OPS(_BITMASK) \ +#define AX_ENABLE_BITMASK_OPS(_BITMASK) \ constexpr _BITMASK operator&(_BITMASK _Left, _BITMASK _Right) noexcept \ { /* return _Left & _Right */ \ using _IntTy = _STD underlying_type<_BITMASK>::type; \ @@ -80,7 +80,7 @@ Copyright (c) 2020 C4games Ltd. } // BITSHIFT OPERATIONS, inspired from msvc++ . -#define CC_ENABLE_BITSHIFT_OPS(_BITMASK) \ +#define AX_ENABLE_BITSHIFT_OPS(_BITMASK) \ constexpr _BITMASK operator>>(_BITMASK _Left, _BITMASK _Right) noexcept \ { /* return _Left & _Right */ \ using _IntTy = _STD underlying_type<_BITMASK>::type; \ diff --git a/core/base/ccCArray.cpp b/core/base/ccCArray.cpp index 8ee244c4d9..e8668c2177 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, CC_INVALID_INDEX if object not found. */ +/** Returns index of first occurrence of object, AX_INVALID_INDEX if object not found. */ ssize_t ccArrayGetIndexOfObject(ccArray* arr, Ref* object) { const auto arrNum = arr->num; @@ -112,13 +112,13 @@ ssize_t ccArrayGetIndexOfObject(ccArray* arr, Ref* object) return i; } - return CC_INVALID_INDEX; + return AX_INVALID_INDEX; } /** Returns a Boolean value that indicates whether object is present in array. */ bool ccArrayContainsObject(ccArray* arr, Ref* object) { - return ccArrayGetIndexOfObject(arr, object) != CC_INVALID_INDEX; + return ccArrayGetIndexOfObject(arr, object) != AX_INVALID_INDEX; } /** Appends an object. Behavior undefined if array doesn't have enough capacity. */ @@ -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) { - CC_SAFE_RELEASE(arr->arr[index]); + AX_SAFE_RELEASE(arr->arr[index]); } arr->num--; @@ -218,7 +218,7 @@ void ccArrayRemoveObjectAtIndex(ccArray* arr, ssize_t index, bool releaseObj /* Behavior undefined if index outside [0, num-1]. */ void ccArrayFastRemoveObjectAtIndex(ccArray* arr, ssize_t index) { - CC_SAFE_RELEASE(arr->arr[index]); + AX_SAFE_RELEASE(arr->arr[index]); auto last = --arr->num; arr->arr[index] = arr->arr[last]; } @@ -226,7 +226,7 @@ void ccArrayFastRemoveObjectAtIndex(ccArray* arr, ssize_t index) void ccArrayFastRemoveObject(ccArray* arr, Ref* object) { auto index = ccArrayGetIndexOfObject(arr, object); - if (index != CC_INVALID_INDEX) + if (index != AX_INVALID_INDEX) { ccArrayFastRemoveObjectAtIndex(arr, index); } @@ -237,7 +237,7 @@ void ccArrayFastRemoveObject(ccArray* arr, Ref* object) void ccArrayRemoveObject(ccArray* arr, Ref* object, bool releaseObj /* = true*/) { auto index = ccArrayGetIndexOfObject(arr, object); - if (index != CC_INVALID_INDEX) + if (index != AX_INVALID_INDEX) { ccArrayRemoveObjectAtIndex(arr, index, releaseObj); } @@ -263,7 +263,7 @@ void ccArrayFullRemoveArray(ccArray* arr, ccArray* minusArr) { if (ccArrayContainsObject(minusArr, arr->arr[i])) { - CC_SAFE_RELEASE(arr->arr[i]); + AX_SAFE_RELEASE(arr->arr[i]); back++; } else @@ -319,7 +319,7 @@ void ccCArrayEnsureExtraCapacity(ccCArray* arr, ssize_t extra) ccArrayEnsureExtraCapacity((ccArray*)arr, extra); } -/** Returns index of first occurrence of value, CC_INVALID_INDEX if value not found. */ +/** Returns index of first occurrence of value, AX_INVALID_INDEX if value not found. */ ssize_t ccCArrayGetIndexOfValue(ccCArray* arr, void* value) { for (ssize_t i = 0; i < arr->num; i++) @@ -327,13 +327,13 @@ ssize_t ccCArrayGetIndexOfValue(ccCArray* arr, void* value) if (arr->arr[i] == value) return i; } - return CC_INVALID_INDEX; + return AX_INVALID_INDEX; } /** Returns a Boolean value that indicates whether value is present in the C array. */ bool ccCArrayContainsValue(ccCArray* arr, void* value) { - return ccCArrayGetIndexOfValue(arr, value) != CC_INVALID_INDEX; + return ccCArrayGetIndexOfValue(arr, value) != AX_INVALID_INDEX; } /** Inserts a value at a certain position. Behavior undefined if array doesn't have enough capacity */ @@ -430,7 +430,7 @@ void ccCArrayFastRemoveValueAtIndex(ccCArray* arr, ssize_t index) void ccCArrayRemoveValue(ccCArray* arr, void* value) { auto index = ccCArrayGetIndexOfValue(arr, value); - if (index != CC_INVALID_INDEX) + if (index != AX_INVALID_INDEX) { ccCArrayRemoveValueAtIndex(arr, index); } diff --git a/core/base/ccCArray.h b/core/base/ccCArray.h index d029fbc731..5fc91056fb 100644 --- a/core/base/ccCArray.h +++ b/core/base/ccCArray.h @@ -41,8 +41,8 @@ THE SOFTWARE. - ccCArray functions that manipulates values like if they were standard C structures (no retain/release is performed) */ -#ifndef CC_ARRAY_H -#define CC_ARRAY_H +#ifndef AX_ARRAY_H +#define AX_ARRAY_H /// @cond DO_NOT_SHOW #include "base/ccMacros.h" @@ -66,70 +66,70 @@ typedef struct _ccArray } ccArray; /** Allocates and initializes a new array with specified capacity */ -CC_DLL ccArray* ccArrayNew(ssize_t capacity); +AX_DLL ccArray* ccArrayNew(ssize_t capacity); /** Frees array after removing all remaining objects. Silently ignores nil arr. */ -CC_DLL void ccArrayFree(ccArray*& arr); +AX_DLL void ccArrayFree(ccArray*& arr); /** Doubles array capacity */ -CC_DLL void ccArrayDoubleCapacity(ccArray* arr); +AX_DLL void ccArrayDoubleCapacity(ccArray* arr); /** Increases array capacity such that max >= num + extra. */ -CC_DLL void ccArrayEnsureExtraCapacity(ccArray* arr, ssize_t extra); +AX_DLL void ccArrayEnsureExtraCapacity(ccArray* arr, ssize_t extra); /** shrinks the array so the memory footprint corresponds with the number of items */ -CC_DLL void ccArrayShrink(ccArray* arr); +AX_DLL void ccArrayShrink(ccArray* arr); /** Returns index of first occurrence of object, NSNotFound if object not found. */ -CC_DLL ssize_t ccArrayGetIndexOfObject(ccArray* arr, Ref* object); +AX_DLL ssize_t ccArrayGetIndexOfObject(ccArray* arr, Ref* object); /** Returns a Boolean value that indicates whether object is present in array. */ -CC_DLL bool ccArrayContainsObject(ccArray* arr, Ref* object); +AX_DLL bool ccArrayContainsObject(ccArray* arr, Ref* object); /** Appends an object. Behavior undefined if array doesn't have enough capacity. */ -CC_DLL void ccArrayAppendObject(ccArray* arr, Ref* object); +AX_DLL void ccArrayAppendObject(ccArray* arr, Ref* object); /** Appends an object. Capacity of arr is increased if needed. */ -CC_DLL void ccArrayAppendObjectWithResize(ccArray* arr, Ref* object); +AX_DLL void ccArrayAppendObjectWithResize(ccArray* arr, Ref* object); /** Appends objects from plusArr to arr. Behavior undefined if arr doesn't have enough capacity. */ -CC_DLL void ccArrayAppendArray(ccArray* arr, ccArray* plusArr); +AX_DLL void ccArrayAppendArray(ccArray* arr, ccArray* plusArr); /** Appends objects from plusArr to arr. Capacity of arr is increased if needed. */ -CC_DLL void ccArrayAppendArrayWithResize(ccArray* arr, ccArray* plusArr); +AX_DLL void ccArrayAppendArrayWithResize(ccArray* arr, ccArray* plusArr); /** Inserts an object at index */ -CC_DLL void ccArrayInsertObjectAtIndex(ccArray* arr, Ref* object, ssize_t index); +AX_DLL void ccArrayInsertObjectAtIndex(ccArray* arr, Ref* object, ssize_t index); /** Swaps two objects */ -CC_DLL void ccArraySwapObjectsAtIndexes(ccArray* arr, ssize_t index1, ssize_t index2); +AX_DLL void ccArraySwapObjectsAtIndexes(ccArray* arr, ssize_t index1, ssize_t index2); /** Removes all objects from arr */ -CC_DLL void ccArrayRemoveAllObjects(ccArray* arr); +AX_DLL void ccArrayRemoveAllObjects(ccArray* arr); /** Removes object at specified index and pushes back all subsequent objects. Behavior undefined if index outside [0, num-1]. */ -CC_DLL void ccArrayRemoveObjectAtIndex(ccArray* arr, ssize_t index, bool releaseObj = true); +AX_DLL void ccArrayRemoveObjectAtIndex(ccArray* arr, ssize_t index, bool releaseObj = true); /** Removes object at specified index and fills the gap with the last object, thereby avoiding the need to push back subsequent objects. Behavior undefined if index outside [0, num-1]. */ -CC_DLL void ccArrayFastRemoveObjectAtIndex(ccArray* arr, ssize_t index); +AX_DLL void ccArrayFastRemoveObjectAtIndex(ccArray* arr, ssize_t index); -CC_DLL void ccArrayFastRemoveObject(ccArray* arr, Ref* object); +AX_DLL void ccArrayFastRemoveObject(ccArray* arr, Ref* object); /** Searches for the first occurrence of object and removes it. If object is not found the function has no effect. */ -CC_DLL void ccArrayRemoveObject(ccArray* arr, Ref* object, bool releaseObj = true); +AX_DLL void ccArrayRemoveObject(ccArray* arr, Ref* object, bool releaseObj = true); /** Removes from arr all objects in minusArr. For each object in minusArr, the first matching instance in arr will be removed. */ -CC_DLL void ccArrayRemoveArray(ccArray* arr, ccArray* minusArr); +AX_DLL void ccArrayRemoveArray(ccArray* arr, ccArray* minusArr); /** Removes from arr all objects in minusArr. For each object in minusArr, all matching instances in arr will be removed. */ -CC_DLL void ccArrayFullRemoveArray(ccArray* arr, ccArray* minusArr); +AX_DLL void ccArrayFullRemoveArray(ccArray* arr, ccArray* minusArr); // // // ccCArray for Values (c structures) @@ -141,72 +141,72 @@ typedef struct _ccCArray } ccCArray; /** Allocates and initializes a new C array with specified capacity */ -CC_DLL ccCArray* ccCArrayNew(ssize_t capacity); +AX_DLL ccCArray* ccCArrayNew(ssize_t capacity); /** Frees C array after removing all remaining values. Silently ignores nil arr. */ -CC_DLL void ccCArrayFree(ccCArray* arr); +AX_DLL void ccCArrayFree(ccCArray* arr); /** Doubles C array capacity */ -CC_DLL void ccCArrayDoubleCapacity(ccCArray* arr); +AX_DLL void ccCArrayDoubleCapacity(ccCArray* arr); /** Increases array capacity such that max >= num + extra. */ -CC_DLL void ccCArrayEnsureExtraCapacity(ccCArray* arr, ssize_t extra); +AX_DLL void ccCArrayEnsureExtraCapacity(ccCArray* arr, ssize_t extra); /** Returns index of first occurrence of value, NSNotFound if value not found. */ -CC_DLL ssize_t ccCArrayGetIndexOfValue(ccCArray* arr, void* value); +AX_DLL ssize_t ccCArrayGetIndexOfValue(ccCArray* arr, void* value); /** Returns a Boolean value that indicates whether value is present in the C array. */ -CC_DLL bool ccCArrayContainsValue(ccCArray* arr, void* value); +AX_DLL bool ccCArrayContainsValue(ccCArray* arr, void* value); /** Inserts a value at a certain position. Behavior undefined if array doesn't have enough capacity */ -CC_DLL void ccCArrayInsertValueAtIndex(ccCArray* arr, void* value, ssize_t index); +AX_DLL void ccCArrayInsertValueAtIndex(ccCArray* arr, void* value, ssize_t index); /** Appends an value. Behavior undefined if array doesn't have enough capacity. */ -CC_DLL void ccCArrayAppendValue(ccCArray* arr, void* value); +AX_DLL void ccCArrayAppendValue(ccCArray* arr, void* value); /** Appends an value. Capacity of arr is increased if needed. */ -CC_DLL void ccCArrayAppendValueWithResize(ccCArray* arr, void* value); +AX_DLL void ccCArrayAppendValueWithResize(ccCArray* arr, void* value); /** Appends values from plusArr to arr. Behavior undefined if arr doesn't have enough capacity. */ -CC_DLL void ccCArrayAppendArray(ccCArray* arr, ccCArray* plusArr); +AX_DLL void ccCArrayAppendArray(ccCArray* arr, ccCArray* plusArr); /** Appends values from plusArr to arr. Capacity of arr is increased if needed. */ -CC_DLL void ccCArrayAppendArrayWithResize(ccCArray* arr, ccCArray* plusArr); +AX_DLL void ccCArrayAppendArrayWithResize(ccCArray* arr, ccCArray* plusArr); /** Removes all values from arr */ -CC_DLL void ccCArrayRemoveAllValues(ccCArray* arr); +AX_DLL void ccCArrayRemoveAllValues(ccCArray* arr); /** Removes value at specified index and pushes back all subsequent values. Behavior undefined if index outside [0, num-1]. @since v0.99.4 */ -CC_DLL void ccCArrayRemoveValueAtIndex(ccCArray* arr, ssize_t index); +AX_DLL void ccCArrayRemoveValueAtIndex(ccCArray* arr, ssize_t index); /** Removes value at specified index and fills the gap with the last value, thereby avoiding the need to push back subsequent values. Behavior undefined if index outside [0, num-1]. @since v0.99.4 */ -CC_DLL void ccCArrayFastRemoveValueAtIndex(ccCArray* arr, ssize_t index); +AX_DLL void ccCArrayFastRemoveValueAtIndex(ccCArray* arr, ssize_t index); /** Searches for the first occurrence of value and removes it. If value is not found the function has no effect. @since v0.99.4 */ -CC_DLL void ccCArrayRemoveValue(ccCArray* arr, void* value); +AX_DLL void ccCArrayRemoveValue(ccCArray* arr, void* value); /** Removes from arr all values in minusArr. For each Value in minusArr, the first matching instance in arr will be removed. @since v0.99.4 */ -CC_DLL void ccCArrayRemoveArray(ccCArray* arr, ccCArray* minusArr); +AX_DLL void ccCArrayRemoveArray(ccCArray* arr, ccCArray* minusArr); /** Removes from arr all values in minusArr. For each value in minusArr, all matching instances in arr will be removed. @since v0.99.4 */ -CC_DLL void ccCArrayFullRemoveArray(ccCArray* arr, ccCArray* minusArr); +AX_DLL void ccCArrayFullRemoveArray(ccCArray* arr, ccCArray* minusArr); NS_AX_END /// @endcond -#endif // CC_ARRAY_H +#endif // AX_ARRAY_H diff --git a/core/base/ccConfig.h b/core/base/ccConfig.h index d8b90a0c54..173b589df5 100644 --- a/core/base/ccConfig.h +++ b/core/base/ccConfig.h @@ -34,18 +34,18 @@ THE SOFTWARE. * cocos2d (cc) configuration file. */ -/** @def CC_ENABLE_STACKABLE_ACTIONS +/** @def AX_ENABLE_STACKABLE_ACTIONS * If enabled, actions that alter the position property (eg: MoveBy, JumpBy, BezierBy, etc..) will be stacked. * If you run 2 or more 'position' actions at the same time on a node, then end position will be the sum of all the * positions. If disabled, only the last run action will take effect. Enabled by default. Disable to be compatible with * v2.0 and older versions. * @since v2.1 */ -#ifndef CC_ENABLE_STACKABLE_ACTIONS -# define CC_ENABLE_STACKABLE_ACTIONS 1 +#ifndef AX_ENABLE_STACKABLE_ACTIONS +# define AX_ENABLE_STACKABLE_ACTIONS 1 #endif -/** @def CC_ENABLE_GL_STATE_CACHE +/** @def AX_ENABLE_GL_STATE_CACHE * If enabled, cocos2d will maintain an OpenGL state cache internally to avoid unnecessary switches. * In order to use them, you have to use the following functions, instead of the GL ones: * - ccGLUseProgram() instead of glUseProgram(). @@ -63,11 +63,11 @@ THE SOFTWARE. * @since v2.0.0 */ -#ifndef CC_ENABLE_GL_STATE_CACHE -# define CC_ENABLE_GL_STATE_CACHE 1 +#ifndef AX_ENABLE_GL_STATE_CACHE +# define AX_ENABLE_GL_STATE_CACHE 1 #endif -/** @def CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +/** @def AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL * If enabled, the texture coordinates will be calculated by using this formula: * - texCoord.left = (rect.origin.x*2+1) / (texture.wide*2); * - texCoord.right = texCoord.left + (rect.size.width*2-2)/(texture.wide*2); @@ -87,31 +87,31 @@ THE SOFTWARE. * @since v0.99.5 */ -#ifndef CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL -# define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0 +#ifndef AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL +# define AX_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0 #endif -/** @def CC_DIRECTOR_STATS_INTERVAL +/** @def AX_DIRECTOR_STATS_INTERVAL * Seconds between FPS updates. * 0.5 seconds, means that the FPS number will be updated every 0.5 seconds. * Having a bigger number means a more reliable FPS. * Default value: 0.5f */ -#ifndef CC_DIRECTOR_STATS_INTERVAL -# define CC_DIRECTOR_STATS_INTERVAL (0.5f) +#ifndef AX_DIRECTOR_STATS_INTERVAL +# define AX_DIRECTOR_STATS_INTERVAL (0.5f) #endif -/** @def CC_DIRECTOR_FPS_POSITION +/** @def AX_DIRECTOR_FPS_POSITION * Position of the FPS. * Default: 0,0 (bottom-left corner). */ -#ifndef CC_DIRECTOR_FPS_POSITION -# define CC_DIRECTOR_FPS_POSITION Vec2(0, 0) +#ifndef AX_DIRECTOR_FPS_POSITION +# define AX_DIRECTOR_FPS_POSITION Vec2(0, 0) #endif -/** @def CC_DIRECTOR_DISPATCH_FAST_EVENTS +/** @def AX_DIRECTOR_DISPATCH_FAST_EVENTS * If enabled, and only when it is used with FastDirector, the main loop will wait 0.04 seconds to * dispatch all the events, even if there are not events to dispatch. * If your game uses lot's of events (eg: touches) it might be a good idea to enable this feature. @@ -121,62 +121,62 @@ THE SOFTWARE. * @warning This feature is experimental. */ -#ifndef CC_DIRECTOR_DISPATCH_FAST_EVENTS -# define CC_DIRECTOR_DISPATCH_FAST_EVENTS 0 +#ifndef AX_DIRECTOR_DISPATCH_FAST_EVENTS +# define AX_DIRECTOR_DISPATCH_FAST_EVENTS 0 #endif -/** @def CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD +/** @def AX_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD * If enabled, cocos2d-mac will run on the Display Link thread. If disabled cocos2d-mac will run in its own thread. * If enabled, the images will be drawn at the "correct" time, but the events might not be very responsive. * If disabled, some frames might be skipped, but the events will be dispatched as they arrived. * To enable set it to a 1, to disable it set to 0. Enabled by default. * Only valid for cocos2d-mac. Not supported on cocos2d-ios. */ -#ifndef CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD -# define CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD 1 +#ifndef AX_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD +# define AX_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD 1 #endif -/** @def CC_NODE_RENDER_SUBPIXEL +/** @def AX_NODE_RENDER_SUBPIXEL * If enabled, the Node objects (Sprite, Label,etc) will be able to render in subpixels. * If disabled, integer pixels will be used. * To enable set it to 1. Enabled by default. */ -#ifndef CC_NODE_RENDER_SUBPIXEL -# define CC_NODE_RENDER_SUBPIXEL 1 +#ifndef AX_NODE_RENDER_SUBPIXEL +# define AX_NODE_RENDER_SUBPIXEL 1 #endif -/** @def CC_SPRITEBATCHNODE_RENDER_SUBPIXEL +/** @def AX_SPRITEBATCHNODE_RENDER_SUBPIXEL * If enabled, the Sprite objects rendered with SpriteBatchNode will be able to render in subpixels. * If disabled, integer pixels will be used. * To enable set it to 1. Enabled by default. */ -#ifndef CC_SPRITEBATCHNODE_RENDER_SUBPIXEL -# define CC_SPRITEBATCHNODE_RENDER_SUBPIXEL 1 +#ifndef AX_SPRITEBATCHNODE_RENDER_SUBPIXEL +# define AX_SPRITEBATCHNODE_RENDER_SUBPIXEL 1 #endif -/** @def CC_TEXTURE_ATLAS_USE_VAO +/** @def AX_TEXTURE_ATLAS_USE_VAO * By default, TextureAtlas (used by many cocos2d classes) will use VAO (Vertex Array Objects). * Apple recommends its usage but they might consume a lot of memory, specially if you use many of them. * So for certain cases, where you might need hundreds of VAO objects, it might be a good idea to disable it. * To disable it set it to 0. Enabled by default. * If a device doesn't support VAO though it claims to support should add exceptions list here. */ -#ifndef CC_TEXTURE_ATLAS_USE_VAO -# define CC_TEXTURE_ATLAS_USE_VAO 1 +#ifndef AX_TEXTURE_ATLAS_USE_VAO +# define AX_TEXTURE_ATLAS_USE_VAO 1 #endif -/** @def CC_USE_LA88_LABELS +/** @def AX_USE_LA88_LABELS * If enabled, it will use LA88 (Luminance Alpha 16-bit textures) for LabelTTF objects. * If it is disabled, it will use A8 (Alpha 8-bit textures). * LA88 textures are 6% faster than A8 textures, but they will consume 2x memory. * This feature is enabled by default. * @since v0.99.5 */ -#ifndef CC_USE_LA88_LABELS -# define CC_USE_LA88_LABELS 1 +#ifndef AX_USE_LA88_LABELS +# define AX_USE_LA88_LABELS 1 #endif -/** @def CC_SPRITE_DEBUG_DRAW +/** @def AX_SPRITE_DEBUG_DRAW * If enabled, all subclasses of Sprite will draw a bounding box. * Useful for debugging purposes only. It is recommended to leave it disabled. * To enable set it to a value different than 0. Disabled by default: @@ -184,177 +184,177 @@ THE SOFTWARE. * 1 -- draw bounding box * 2 -- draw texture box */ -#ifndef CC_SPRITE_DEBUG_DRAW -# define CC_SPRITE_DEBUG_DRAW 0 +#ifndef AX_SPRITE_DEBUG_DRAW +# define AX_SPRITE_DEBUG_DRAW 0 #endif -/** @def CC_LABEL_DEBUG_DRAW +/** @def AX_LABEL_DEBUG_DRAW * If enabled, all subclasses of Label will draw a bounding box. * Useful for debugging purposes only. It is recommended to leave it disabled. * To enable set it to a value different than 0. Disabled by default: * 0 -- disabled * 1 -- draw bounding box */ -#ifndef CC_LABEL_DEBUG_DRAW -# define CC_LABEL_DEBUG_DRAW 0 +#ifndef AX_LABEL_DEBUG_DRAW +# define AX_LABEL_DEBUG_DRAW 0 #endif -/** @def CC_SPRITEBATCHNODE_DEBUG_DRAW +/** @def AX_SPRITEBATCHNODE_DEBUG_DRAW * If enabled, all subclasses of Sprite that are rendered using an SpriteBatchNode draw a bounding box. * Useful for debugging purposes only. It is recommended to leave it disabled. * To enable set it to a value different than 0. Disabled by default. */ -#ifndef CC_SPRITEBATCHNODE_DEBUG_DRAW -# define CC_SPRITEBATCHNODE_DEBUG_DRAW 0 +#ifndef AX_SPRITEBATCHNODE_DEBUG_DRAW +# define AX_SPRITEBATCHNODE_DEBUG_DRAW 0 #endif -/** @def CC_LABELBMFONT_DEBUG_DRAW +/** @def AX_LABELBMFONT_DEBUG_DRAW * If enabled, all subclasses of LabelBMFont will draw a bounding box. * Useful for debugging purposes only. It is recommended to leave it disabled. * To enable set it to a value different than 0. Disabled by default. */ -#ifndef CC_LABELBMFONT_DEBUG_DRAW -# define CC_LABELBMFONT_DEBUG_DRAW 0 +#ifndef AX_LABELBMFONT_DEBUG_DRAW +# define AX_LABELBMFONT_DEBUG_DRAW 0 #endif -/** @def CC_LABELATLAS_DEBUG_DRAW +/** @def AX_LABELATLAS_DEBUG_DRAW * If enabled, all subclasses of LabeltAtlas will draw a bounding box * Useful for debugging purposes only. It is recommended to leave it disabled. * To enable set it to a value different than 0. Disabled by default. */ -#ifndef CC_LABELATLAS_DEBUG_DRAW -# define CC_LABELATLAS_DEBUG_DRAW 0 +#ifndef AX_LABELATLAS_DEBUG_DRAW +# define AX_LABELATLAS_DEBUG_DRAW 0 #endif -/** @def CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS +/** @def AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS * If enabled (in conjunction with assertion macros) will verify on Node destruction that the node being destroyed has * no event listeners still associated with it in the event dispatcher. This can be used to track down problems where * the event dispatch system has dangling pointers to destroyed nodes. Note: event listener verification will always be * disabled in builds where assertions are disabled regardless of this setting. */ -#ifndef CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS -# define CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS 0 +#ifndef AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS +# define AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS 0 #endif -/** @def CC_ENABLE_PROFILERS +/** @def AX_ENABLE_PROFILERS * If enabled, will activate various profilers within cocos2d. This statistical data will be output to the console * once per second showing average time (in milliseconds) required to execute the specific routine(s). * Useful for debugging purposes only. It is recommended to leave it disabled. * To enable set it to a value different than 0. Disabled by default. */ -#ifndef CC_ENABLE_PROFILERS -# define CC_ENABLE_PROFILERS 0 +#ifndef AX_ENABLE_PROFILERS +# define AX_ENABLE_PROFILERS 0 #endif /** Enable Lua engine debug log. */ -#ifndef CC_LUA_ENGINE_DEBUG -# define CC_LUA_ENGINE_DEBUG 0 +#ifndef AX_LUA_ENGINE_DEBUG +# define AX_LUA_ENGINE_DEBUG 0 #endif /** Use physics integration API. */ // It works with: // Chipmunk2D or Box2D -#ifndef CC_USE_PHYSICS -# define CC_USE_PHYSICS 1 +#ifndef AX_USE_PHYSICS +# define AX_USE_PHYSICS 1 #endif -#if (CC_USE_PHYSICS) +#if (AX_USE_PHYSICS) /** Use Chipmunk2D physics 2d engine on physics integration API. */ -# ifndef CC_ENABLE_CHIPMUNK_INTEGRATION -# define CC_ENABLE_CHIPMUNK_INTEGRATION 0 +# ifndef AX_ENABLE_CHIPMUNK_INTEGRATION +# define AX_ENABLE_CHIPMUNK_INTEGRATION 0 # endif /** or use Box2D physics 2d engine on physics integration API. */ -# ifndef CC_ENABLE_BOX2D_INTEGRATION -# define CC_ENABLE_BOX2D_INTEGRATION 1 +# ifndef AX_ENABLE_BOX2D_INTEGRATION +# define AX_ENABLE_BOX2D_INTEGRATION 1 # endif -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS /** Use 3d physics integration API. */ -#ifndef CC_USE_3D_PHYSICS -# if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || \ - CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) -# define CC_USE_3D_PHYSICS 1 +#ifndef AX_USE_3D_PHYSICS +# if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || \ + AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +# define AX_USE_3D_PHYSICS 1 # endif #endif -#if (CC_USE_3D_PHYSICS) +#if (AX_USE_3D_PHYSICS) /** Use bullet physics engine. */ -# ifndef CC_ENABLE_BULLET_INTEGRATION -# define CC_ENABLE_BULLET_INTEGRATION 1 +# ifndef AX_ENABLE_BULLET_INTEGRATION +# define AX_ENABLE_BULLET_INTEGRATION 1 # endif #endif /** Use 3D navigation API */ -#ifndef CC_USE_NAVMESH -# define CC_USE_NAVMESH 1 +#ifndef AX_USE_NAVMESH +# define AX_USE_NAVMESH 1 #endif /** Use culling or not. */ -#ifndef CC_USE_CULLING -# define CC_USE_CULLING 1 +#ifndef AX_USE_CULLING +# define AX_USE_CULLING 1 #endif /** Support PNG or not. If your application don't use png format picture, you can undefine this macro to save package * size. */ -#ifndef CC_USE_PNG -# define CC_USE_PNG 1 -#endif // CC_USE_PNG +#ifndef AX_USE_PNG +# define AX_USE_PNG 1 +#endif // AX_USE_PNG /** Support JPEG or not. If your application don't use jpeg format picture, you can undefine this macro to save package * size. */ -#ifndef CC_USE_JPEG -# define CC_USE_JPEG 1 -#endif // CC_USE_JPEG +#ifndef AX_USE_JPEG +# define AX_USE_JPEG 1 +#endif // AX_USE_JPEG /** Support webp or not. If your application don't use webp format picture, you can undefine this macro to save package * size. */ -#ifndef CC_USE_WEBP -# define CC_USE_WEBP 1 -#endif // CC_USE_WEBP +#ifndef AX_USE_WEBP +# define AX_USE_WEBP 1 +#endif // AX_USE_WEBP /** Enable Lua Script binding */ -#ifndef CC_ENABLE_SCRIPT_BINDING -# define CC_ENABLE_SCRIPT_BINDING 1 +#ifndef AX_ENABLE_SCRIPT_BINDING +# define AX_ENABLE_SCRIPT_BINDING 1 #endif -/** When CC_ENABLE_SCRIPT_BINDING and CC_ENABLE_GC_FOR_NATIVE_OBJECTS are both 1 +/** When AX_ENABLE_SCRIPT_BINDING and AX_ENABLE_GC_FOR_NATIVE_OBJECTS are both 1 * then the Garbage collector will release the native objects, only when the JS/Lua objects * are collected. * The benefit is that users don't need to retain/release the JS/Lua objects manually. * Disabled by default. */ -#ifdef CC_ENABLE_SCRIPT_BINDING -# ifndef CC_ENABLE_GC_FOR_NATIVE_OBJECTS -# define CC_ENABLE_GC_FOR_NATIVE_OBJECTS 0 +#ifdef AX_ENABLE_SCRIPT_BINDING +# ifndef AX_ENABLE_GC_FOR_NATIVE_OBJECTS +# define AX_ENABLE_GC_FOR_NATIVE_OBJECTS 0 # endif #endif -#ifndef CC_FILEUTILS_APPLE_ENABLE_OBJC -# define CC_FILEUTILS_APPLE_ENABLE_OBJC 1 +#ifndef AX_FILEUTILS_APPLE_ENABLE_OBJC +# define AX_FILEUTILS_APPLE_ENABLE_OBJC 1 #endif -/** @def CC_ENABLE_PREMULTIPLIED_ALPHA +/** @def AX_ENABLE_PREMULTIPLIED_ALPHA * If enabled, all textures will be preprocessed to multiply its rgb components * by its alpha component. */ -#ifndef CC_ENABLE_PREMULTIPLIED_ALPHA -# define CC_ENABLE_PREMULTIPLIED_ALPHA 1 +#ifndef AX_ENABLE_PREMULTIPLIED_ALPHA +# define AX_ENABLE_PREMULTIPLIED_ALPHA 1 #endif -/** @def CC_STRIP_FPS +/** @def AX_STRIP_FPS * Whether to strip FPS related data and functions, such as cc_fps_images_png */ -#ifndef CC_STRIP_FPS -# define CC_STRIP_FPS 0 +#ifndef AX_STRIP_FPS +# define AX_STRIP_FPS 0 #endif -#ifndef CC_REDUCE_PAUSED_CPU_USAGE -# define CC_REDUCE_PAUSED_CPU_USAGE 0 +#ifndef AX_REDUCE_PAUSED_CPU_USAGE +# define AX_REDUCE_PAUSED_CPU_USAGE 0 #endif -#ifndef CC_META_TEXTURES -# define CC_META_TEXTURES 2 +#ifndef AX_META_TEXTURES +# define AX_META_TEXTURES 2 #endif diff --git a/core/base/ccFPSImages.c b/core/base/ccFPSImages.c index 8ff5e48907..a1df969be3 100644 --- a/core/base/ccFPSImages.c +++ b/core/base/ccFPSImages.c @@ -26,7 +26,7 @@ #include "base/ccFPSImages.h" -#if !CC_STRIP_FPS +#if !AX_STRIP_FPS unsigned char cc_fps_images_png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x03, @@ -1516,4 +1516,4 @@ unsigned int cc_fps_images_len(void) return sizeof(cc_fps_images_png); } -#endif // #if !CC_STRIP_FPS +#endif // #if !AX_STRIP_FPS diff --git a/core/base/ccFPSImages.h b/core/base/ccFPSImages.h index 4bf7924604..087acde554 100644 --- a/core/base/ccFPSImages.h +++ b/core/base/ccFPSImages.h @@ -33,7 +33,7 @@ THE SOFTWARE. extern "C" { #endif -#if !CC_STRIP_FPS +#if !AX_STRIP_FPS extern unsigned char cc_fps_images_png[]; extern unsigned int cc_fps_images_len(void); #endif diff --git a/core/base/ccMacros.h b/core/base/ccMacros.h index ab316812a1..544d28ea50 100644 --- a/core/base/ccMacros.h +++ b/core/base/ccMacros.h @@ -38,8 +38,8 @@ THE SOFTWARE. #ifndef CCASSERT # if COCOS2D_DEBUG > 0 -# if CC_ENABLE_SCRIPT_BINDING -extern bool CC_DLL cc_assert_script_compatible(const char* msg); +# if AX_ENABLE_SCRIPT_BINDING +extern bool AX_DLL cc_assert_script_compatible(const char* msg); # define CCASSERT(cond, msg) \ do \ { \ @@ -47,11 +47,11 @@ extern bool CC_DLL cc_assert_script_compatible(const char* msg); { \ if (msg && *msg && !cc_assert_script_compatible(msg)) \ axis::log("Assert failed: %s", msg); \ - CC_ASSERT(cond); \ + AX_ASSERT(cond); \ } \ } while (0) # else -# define CCASSERT(cond, msg) CC_ASSERT(cond) +# define CCASSERT(cond, msg) AX_ASSERT(cond) # endif # else # define CCASSERT(cond, msg) @@ -67,9 +67,9 @@ extern bool CC_DLL cc_assert_script_compatible(const char* msg); #include "base/ccRandom.h" -#define CC_HALF_PI (M_PI * 0.5f) +#define AX_HALF_PI (M_PI * 0.5f) -#define CC_DOUBLE_PI (M_PI * 2) +#define AX_DOUBLE_PI (M_PI * 2) /** @def CCRANDOM_MINUS1_1 returns a random float between -1 and 1 @@ -81,96 +81,96 @@ extern bool CC_DLL cc_assert_script_compatible(const char* msg); */ #define CCRANDOM_0_1() axis::rand_0_1() -/** @def CC_DEGREES_TO_RADIANS +/** @def AX_DEGREES_TO_RADIANS converts degrees to radians */ -#define CC_DEGREES_TO_RADIANS(__ANGLE__) ((__ANGLE__)*0.01745329252f) // PI / 180 +#define AX_DEGREES_TO_RADIANS(__ANGLE__) ((__ANGLE__)*0.01745329252f) // PI / 180 -/** @def CC_RADIANS_TO_DEGREES +/** @def AX_RADIANS_TO_DEGREES converts radians to degrees */ -#define CC_RADIANS_TO_DEGREES(__ANGLE__) ((__ANGLE__)*57.29577951f) // PI * 180 +#define AX_RADIANS_TO_DEGREES(__ANGLE__) ((__ANGLE__)*57.29577951f) // PI * 180 -#define CC_REPEAT_FOREVER (UINT_MAX - 1) -#define kRepeatForever CC_REPEAT_FOREVER +#define AX_REPEAT_FOREVER (UINT_MAX - 1) +#define kRepeatForever AX_REPEAT_FOREVER -/** @def CC_BLEND_SRC +/** @def AX_BLEND_SRC default gl blend src function. Compatible with premultiplied alpha images. */ -#define CC_BLEND_SRC axis::backend::BlendFactor::ONE -#define CC_BLEND_DST axis::backend::BlendFactor::ONE_MINUS_SRC_ALPHA +#define AX_BLEND_SRC axis::backend::BlendFactor::ONE +#define AX_BLEND_DST axis::backend::BlendFactor::ONE_MINUS_SRC_ALPHA -/** @def CC_NODE_DRAW_SETUP [DEPRECATED] +/** @def AX_NODE_DRAW_SETUP [DEPRECATED] Helpful macro that setups the GL server state, the correct GL program and sets the Model View Projection matrix @since v2.0 */ -#define CC_NODE_DRAW_SETUP() +#define AX_NODE_DRAW_SETUP() -/** @def CC_DIRECTOR_END +/** @def AX_DIRECTOR_END Stops and removes the director from memory. Removes the GLView from its parent @since v0.99.4 */ -#define CC_DIRECTOR_END() \ +#define AX_DIRECTOR_END() \ do \ { \ Director* __director = axis::Director::getInstance(); \ __director->end(); \ } while (0) -/** @def CC_CONTENT_SCALE_FACTOR +/** @def AX_CONTENT_SCALE_FACTOR On Mac it returns 1; On iPhone it returns 2 if RetinaDisplay is On. Otherwise it returns 1 */ -#define CC_CONTENT_SCALE_FACTOR() axis::Director::getInstance()->getContentScaleFactor() +#define AX_CONTENT_SCALE_FACTOR() axis::Director::getInstance()->getContentScaleFactor() /****************************/ /** RETINA DISPLAY ENABLED **/ /****************************/ -/** @def CC_RECT_PIXELS_TO_POINTS +/** @def AX_RECT_PIXELS_TO_POINTS Converts a rect in pixels to points */ -#define CC_RECT_PIXELS_TO_POINTS(__rect_in_pixels__) \ - axis::Rect((__rect_in_pixels__).origin.x / CC_CONTENT_SCALE_FACTOR(), \ - (__rect_in_pixels__).origin.y / CC_CONTENT_SCALE_FACTOR(), \ - (__rect_in_pixels__).size.width / CC_CONTENT_SCALE_FACTOR(), \ - (__rect_in_pixels__).size.height / CC_CONTENT_SCALE_FACTOR()) +#define AX_RECT_PIXELS_TO_POINTS(__rect_in_pixels__) \ + axis::Rect((__rect_in_pixels__).origin.x / AX_CONTENT_SCALE_FACTOR(), \ + (__rect_in_pixels__).origin.y / AX_CONTENT_SCALE_FACTOR(), \ + (__rect_in_pixels__).size.width / AX_CONTENT_SCALE_FACTOR(), \ + (__rect_in_pixels__).size.height / AX_CONTENT_SCALE_FACTOR()) -/** @def CC_RECT_POINTS_TO_PIXELS +/** @def AX_RECT_POINTS_TO_PIXELS Converts a rect in points to pixels */ -#define CC_RECT_POINTS_TO_PIXELS(__rect_in_points_points__) \ - axis::Rect((__rect_in_points_points__).origin.x* CC_CONTENT_SCALE_FACTOR(), \ - (__rect_in_points_points__).origin.y* CC_CONTENT_SCALE_FACTOR(), \ - (__rect_in_points_points__).size.width* CC_CONTENT_SCALE_FACTOR(), \ - (__rect_in_points_points__).size.height* CC_CONTENT_SCALE_FACTOR()) +#define AX_RECT_POINTS_TO_PIXELS(__rect_in_points_points__) \ + axis::Rect((__rect_in_points_points__).origin.x* AX_CONTENT_SCALE_FACTOR(), \ + (__rect_in_points_points__).origin.y* AX_CONTENT_SCALE_FACTOR(), \ + (__rect_in_points_points__).size.width* AX_CONTENT_SCALE_FACTOR(), \ + (__rect_in_points_points__).size.height* AX_CONTENT_SCALE_FACTOR()) -/** @def CC_POINT_PIXELS_TO_POINTS +/** @def AX_POINT_PIXELS_TO_POINTS Converts a rect in pixels to points */ -#define CC_POINT_PIXELS_TO_POINTS(__pixels__) \ - axis::Vec2((__pixels__).x / CC_CONTENT_SCALE_FACTOR(), (__pixels__).y / CC_CONTENT_SCALE_FACTOR()) +#define AX_POINT_PIXELS_TO_POINTS(__pixels__) \ + axis::Vec2((__pixels__).x / AX_CONTENT_SCALE_FACTOR(), (__pixels__).y / AX_CONTENT_SCALE_FACTOR()) -/** @def CC_POINT_POINTS_TO_PIXELS +/** @def AX_POINT_POINTS_TO_PIXELS Converts a rect in points to pixels */ -#define CC_POINT_POINTS_TO_PIXELS(__points__) \ - axis::Vec2((__points__).x* CC_CONTENT_SCALE_FACTOR(), (__points__).y* CC_CONTENT_SCALE_FACTOR()) +#define AX_POINT_POINTS_TO_PIXELS(__points__) \ + axis::Vec2((__points__).x* AX_CONTENT_SCALE_FACTOR(), (__points__).y* AX_CONTENT_SCALE_FACTOR()) -/** @def CC_POINT_PIXELS_TO_POINTS +/** @def AX_POINT_PIXELS_TO_POINTS Converts a rect in pixels to points */ -#define CC_SIZE_PIXELS_TO_POINTS(__size_in_pixels__) \ - Vec2((__size_in_pixels__).width / CC_CONTENT_SCALE_FACTOR(), \ - (__size_in_pixels__).height / CC_CONTENT_SCALE_FACTOR()) +#define AX_SIZE_PIXELS_TO_POINTS(__size_in_pixels__) \ + Vec2((__size_in_pixels__).width / AX_CONTENT_SCALE_FACTOR(), \ + (__size_in_pixels__).height / AX_CONTENT_SCALE_FACTOR()) -/** @def CC_POINT_POINTS_TO_PIXELS +/** @def AX_POINT_POINTS_TO_PIXELS Converts a rect in points to pixels */ -#define CC_SIZE_POINTS_TO_PIXELS(__size_in_points__) \ - Vec2((__size_in_points__).width* CC_CONTENT_SCALE_FACTOR(), (__size_in_points__).height* CC_CONTENT_SCALE_FACTOR()) +#define AX_SIZE_POINTS_TO_PIXELS(__size_in_points__) \ + Vec2((__size_in_points__).width* AX_CONTENT_SCALE_FACTOR(), (__size_in_points__).height* AX_CONTENT_SCALE_FACTOR()) #ifndef FLT_EPSILON # define FLT_EPSILON 1.192092896e-07F @@ -188,58 +188,58 @@ It should work same as apples CFSwapInt32LittleToHost(..) */ /// when define returns true it means that our architecture uses big endian -#define CC_HOST_IS_BIG_ENDIAN (bool)(*(unsigned short*)"\0\xff" < 0x100) -#define CC_SWAP32(i) ((i & 0x000000ff) << 24 | (i & 0x0000ff00) << 8 | (i & 0x00ff0000) >> 8 | (i & 0xff000000) >> 24) -#define CC_SWAP16(i) ((i & 0x00ff) << 8 | (i & 0xff00) >> 8) -#define CC_SWAP_INT32_LITTLE_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true) ? CC_SWAP32(i) : (i)) -#define CC_SWAP_INT16_LITTLE_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true) ? CC_SWAP16(i) : (i)) -#define CC_SWAP_INT32_BIG_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true) ? (i) : CC_SWAP32(i)) -#define CC_SWAP_INT16_BIG_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true) ? (i) : CC_SWAP16(i)) +#define AX_HOST_IS_BIG_ENDIAN (bool)(*(unsigned short*)"\0\xff" < 0x100) +#define AX_SWAP32(i) ((i & 0x000000ff) << 24 | (i & 0x0000ff00) << 8 | (i & 0x00ff0000) >> 8 | (i & 0xff000000) >> 24) +#define AX_SWAP16(i) ((i & 0x00ff) << 8 | (i & 0xff00) >> 8) +#define AX_SWAP_INT32_LITTLE_TO_HOST(i) ((AX_HOST_IS_BIG_ENDIAN == true) ? AX_SWAP32(i) : (i)) +#define AX_SWAP_INT16_LITTLE_TO_HOST(i) ((AX_HOST_IS_BIG_ENDIAN == true) ? AX_SWAP16(i) : (i)) +#define AX_SWAP_INT32_BIG_TO_HOST(i) ((AX_HOST_IS_BIG_ENDIAN == true) ? (i) : AX_SWAP32(i)) +#define AX_SWAP_INT16_BIG_TO_HOST(i) ((AX_HOST_IS_BIG_ENDIAN == true) ? (i) : AX_SWAP16(i)) /**********************/ /** Profiling Macros **/ /**********************/ -#if CC_ENABLE_PROFILERS +#if AX_ENABLE_PROFILERS -# define CC_PROFILER_DISPLAY_TIMERS() NS_AX::Profiler::getInstance()->displayTimers() -# define CC_PROFILER_PURGE_ALL() NS_AX::Profiler::getInstance()->releaseAllTimers() +# define AX_PROFILER_DISPLAY_TIMERS() NS_AX::Profiler::getInstance()->displayTimers() +# define AX_PROFILER_PURGE_ALL() NS_AX::Profiler::getInstance()->releaseAllTimers() -# define CC_PROFILER_START(__name__) NS_AX::ProfilingBeginTimingBlock(__name__) -# define CC_PROFILER_STOP(__name__) NS_AX::ProfilingEndTimingBlock(__name__) -# define CC_PROFILER_RESET(__name__) NS_AX::ProfilingResetTimingBlock(__name__) +# define AX_PROFILER_START(__name__) NS_AX::ProfilingBeginTimingBlock(__name__) +# define AX_PROFILER_STOP(__name__) NS_AX::ProfilingEndTimingBlock(__name__) +# define AX_PROFILER_RESET(__name__) NS_AX::ProfilingResetTimingBlock(__name__) -# define CC_PROFILER_START_CATEGORY(__cat__, __name__) \ +# define AX_PROFILER_START_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ NS_AX::ProfilingBeginTimingBlock(__name__); \ } while (0) -# define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) \ +# define AX_PROFILER_STOP_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ NS_AX::ProfilingEndTimingBlock(__name__); \ } while (0) -# define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) \ +# define AX_PROFILER_RESET_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ NS_AX::ProfilingResetTimingBlock(__name__); \ } while (0) -# define CC_PROFILER_START_INSTANCE(__id__, __name__) \ +# define AX_PROFILER_START_INSTANCE(__id__, __name__) \ do \ { \ NS_AX::ProfilingBeginTimingBlock( \ NS_AX::String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ } while (0) -# define CC_PROFILER_STOP_INSTANCE(__id__, __name__) \ +# define AX_PROFILER_STOP_INSTANCE(__id__, __name__) \ do \ { \ NS_AX::ProfilingEndTimingBlock( \ NS_AX::String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ } while (0) -# define CC_PROFILER_RESET_INSTANCE(__id__, __name__) \ +# define AX_PROFILER_RESET_INSTANCE(__id__, __name__) \ do \ { \ NS_AX::ProfilingResetTimingBlock( \ @@ -248,50 +248,50 @@ It should work same as apples CFSwapInt32LittleToHost(..) #else -# define CC_PROFILER_DISPLAY_TIMERS() \ +# define AX_PROFILER_DISPLAY_TIMERS() \ do \ { \ } while (0) -# define CC_PROFILER_PURGE_ALL() \ +# define AX_PROFILER_PURGE_ALL() \ do \ { \ } while (0) -# define CC_PROFILER_START(__name__) \ +# define AX_PROFILER_START(__name__) \ do \ { \ } while (0) -# define CC_PROFILER_STOP(__name__) \ +# define AX_PROFILER_STOP(__name__) \ do \ { \ } while (0) -# define CC_PROFILER_RESET(__name__) \ +# define AX_PROFILER_RESET(__name__) \ do \ { \ } while (0) -# define CC_PROFILER_START_CATEGORY(__cat__, __name__) \ +# define AX_PROFILER_START_CATEGORY(__cat__, __name__) \ do \ { \ } while (0) -# define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) \ +# define AX_PROFILER_STOP_CATEGORY(__cat__, __name__) \ do \ { \ } while (0) -# define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) \ +# define AX_PROFILER_RESET_CATEGORY(__cat__, __name__) \ do \ { \ } while (0) -# define CC_PROFILER_START_INSTANCE(__id__, __name__) \ +# define AX_PROFILER_START_INSTANCE(__id__, __name__) \ do \ { \ } while (0) -# define CC_PROFILER_STOP_INSTANCE(__id__, __name__) \ +# define AX_PROFILER_STOP_INSTANCE(__id__, __name__) \ do \ { \ } while (0) -# define CC_PROFILER_RESET_INSTANCE(__id__, __name__) \ +# define AX_PROFILER_RESET_INSTANCE(__id__, __name__) \ do \ { \ } while (0) @@ -303,9 +303,9 @@ It should work same as apples CFSwapInt32LittleToHost(..) /*********************************/ #if defined(_M_X64) || defined(_WIN64) || defined(__LP64__) || defined(_LP64) || defined(__x86_64) || \ defined(__arm64__) || defined(__aarch64__) -# define CC_64BITS 1 +# define AX_64BITS 1 #else -# define CC_64BITS 0 +# define AX_64BITS 0 #endif /******************************************************************************************/ @@ -314,8 +314,8 @@ It should work same as apples CFSwapInt32LittleToHost(..) /******************************************************************************************/ #ifdef _WIN32 // Assuming windows is always little-endian. -# if !defined(CC_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) -# define CC_LITTLE_ENDIAN 1 +# if !defined(AX_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) +# define AX_LITTLE_ENDIAN 1 # endif # if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(__INTEL_COMPILER) // If MSVC has "/RTCc" set, it will complain about truncating casts at @@ -334,17 +334,17 @@ It should work same as apples CFSwapInt32LittleToHost(..) # endif # if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN)) && \ - !defined(CC_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) -# define CC_LITTLE_ENDIAN 1 + !defined(AX_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) +# define AX_LITTLE_ENDIAN 1 # endif #endif -/** @def CC_INCREMENT_GL_DRAWS_BY_ONE +/** @def AX_INCREMENT_GL_DRAWS_BY_ONE Increments the GL Draws counts by one. The number of calls per frame are displayed on the screen when the Director's stats are enabled. */ -#define CC_INCREMENT_GL_DRAWS(__n__) axis::Director::getInstance()->getRenderer()->addDrawnBatches(__n__) -#define CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(__drawcalls__, __vertices__) \ +#define AX_INCREMENT_GL_DRAWS(__n__) axis::Director::getInstance()->getRenderer()->addDrawnBatches(__n__) +#define AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(__drawcalls__, __vertices__) \ do \ { \ auto __renderer__ = axis::Director::getInstance()->getRenderer(); \ @@ -369,12 +369,12 @@ It should work same as apples CFSwapInt32LittleToHost(..) #define Animate3DDisplayedNotification "CCAnimate3DDisplayedNotification" // new callbacks based on C++11 -#define CC_CALLBACK_0(__selector__, __target__, ...) std::bind(&__selector__, __target__, ##__VA_ARGS__) -#define CC_CALLBACK_1(__selector__, __target__, ...) \ +#define AX_CALLBACK_0(__selector__, __target__, ...) std::bind(&__selector__, __target__, ##__VA_ARGS__) +#define AX_CALLBACK_1(__selector__, __target__, ...) \ std::bind(&__selector__, __target__, std::placeholders::_1, ##__VA_ARGS__) -#define CC_CALLBACK_2(__selector__, __target__, ...) \ +#define AX_CALLBACK_2(__selector__, __target__, ...) \ std::bind(&__selector__, __target__, std::placeholders::_1, std::placeholders::_2, ##__VA_ARGS__) -#define CC_CALLBACK_3(__selector__, __target__, ...) \ +#define AX_CALLBACK_3(__selector__, __target__, ...) \ std::bind(&__selector__, __target__, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, \ ##__VA_ARGS__) diff --git a/core/base/ccRandom.h b/core/base/ccRandom.h index e86987ec16..789fd37a98 100644 --- a/core/base/ccRandom.h +++ b/core/base/ccRandom.h @@ -42,7 +42,7 @@ NS_AX_BEGIN * @class RandomHelper * @brief A helper class for creating random number. */ -class CC_DLL RandomHelper +class AX_DLL RandomHelper { public: template diff --git a/core/base/ccTypes.cpp b/core/base/ccTypes.cpp index c8df7f2ce4..d92e7c568e 100644 --- a/core/base/ccTypes.cpp +++ b/core/base/ccTypes.cpp @@ -32,7 +32,7 @@ Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. NS_AX_BEGIN const std::string STD_STRING_EMPTY(""); -const ssize_t CC_INVALID_INDEX = -1; +const ssize_t AX_INVALID_INDEX = -1; /** * Color3B diff --git a/core/base/ccTypes.h b/core/base/ccTypes.h index 0130a95443..9e01b4a2d0 100644 --- a/core/base/ccTypes.h +++ b/core/base/ccTypes.h @@ -51,7 +51,7 @@ struct HSV; * RGB color composed of bytes 3 bytes. * @since v3.0 */ -struct CC_DLL Color3B +struct AX_DLL Color3B { Color3B(); Color3B(uint8_t _r, uint8_t _g, uint8_t _b); @@ -86,7 +86,7 @@ struct CC_DLL Color3B * RGBA color composed of 4 bytes. * @since v3.0 */ -struct CC_DLL Color4B +struct AX_DLL Color4B { Color4B(); Color4B(uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a); @@ -128,7 +128,7 @@ struct CC_DLL Color4B * RGBA color composed of 4 floats. * @since v3.0 */ -struct CC_DLL Color4F +struct AX_DLL Color4F { Color4F(); Color4F(float _r, float _g, float _b, float _a); @@ -182,7 +182,7 @@ Color4F operator/(Color4F lhs, float rhs); * * Implementation source: https://gist.github.com/fairlight1337/4935ae72bcbcc1ba5c72 */ -struct CC_DLL HSV +struct AX_DLL HSV { HSV(); HSV(float _h, float _s, float _v, float _a = 1.0F); @@ -231,7 +231,7 @@ HSV operator/(HSV lhs, float rhs); * * Implementation source: https://gist.github.com/ciembor/1494530 */ -struct CC_DLL HSL +struct AX_DLL HSL { HSL(); HSL(float _h, float _s, float _l, float _a = 1.0F); @@ -285,7 +285,7 @@ typedef Vec2 Tex2F; /** @struct PointSprite * Vec2 Sprite component. */ -struct CC_DLL PointSprite +struct AX_DLL PointSprite { Vec2 pos; // 8 bytes Color4B color; // 4 bytes @@ -295,7 +295,7 @@ struct CC_DLL PointSprite /** @struct Quad2 * A 2D Quad. 4 * 2 floats. */ -struct CC_DLL Quad2 +struct AX_DLL Quad2 { Vec2 tl; Vec2 tr; @@ -306,7 +306,7 @@ struct CC_DLL Quad2 /** @struct Quad3 * A 3D Quad. 4 * 3 floats. */ -struct CC_DLL Quad3 +struct AX_DLL Quad3 { Vec3 bl; Vec3 br; @@ -343,7 +343,7 @@ struct V2F_C4B_PF /** @struct V2F_C4F_T2F * A Vec2 with a vertex point, a tex coord point and a color 4F. */ -struct CC_DLL V2F_C4F_T2F +struct AX_DLL V2F_C4F_T2F { /// vertices (2F) Vec2 vertices; @@ -356,7 +356,7 @@ struct CC_DLL V2F_C4F_T2F /** @struct V3F_C4B_T2F * A Vec2 with a vertex point, a tex coord point and a color 4B. */ -struct CC_DLL V3F_C4B_T2F +struct AX_DLL V3F_C4B_T2F { /// vertices (3F) Vec3 vertices; // 12 bytes @@ -371,7 +371,7 @@ struct CC_DLL V3F_C4B_T2F /** @struct V3F_T2F * A Vec2 with a vertex point, a tex coord point. */ -struct CC_DLL V3F_T2F +struct AX_DLL V3F_T2F { /// vertices (2F) Vec3 vertices; @@ -382,7 +382,7 @@ struct CC_DLL V3F_T2F /** @struct V3F_C4F * A Vec3 with a vertex point, a color. */ -struct CC_DLL V3F_C4F +struct AX_DLL V3F_C4F { /// vertices (3F) Vec3 vertices; @@ -393,7 +393,7 @@ struct CC_DLL V3F_C4F /** @struct V2F_C4B_T2F_Triangle * A Triangle of V2F_C4B_T2F. */ -struct CC_DLL V2F_C4B_T2F_Triangle +struct AX_DLL V2F_C4B_T2F_Triangle { V2F_C4B_T2F a; V2F_C4B_T2F b; @@ -403,7 +403,7 @@ struct CC_DLL V2F_C4B_T2F_Triangle /** @struct V2F_C4B_T2F_Quad * A Quad of V2F_C4B_T2F. */ -struct CC_DLL V2F_C4B_T2F_Quad +struct AX_DLL V2F_C4B_T2F_Quad { /// bottom left V2F_C4B_T2F bl; @@ -418,7 +418,7 @@ struct CC_DLL V2F_C4B_T2F_Quad /** @struct V3F_C4B_T2F_Quad * 4 Vertex3FTex2FColor4B. */ -struct CC_DLL V3F_C4B_T2F_Quad +struct AX_DLL V3F_C4B_T2F_Quad { /// top left V3F_C4B_T2F tl; @@ -433,7 +433,7 @@ struct CC_DLL V3F_C4B_T2F_Quad /** @struct V2F_C4F_T2F_Quad * 4 Vertex2FTex2FColor4F Quad. */ -struct CC_DLL V2F_C4F_T2F_Quad +struct AX_DLL V2F_C4F_T2F_Quad { /// bottom left V2F_C4F_T2F bl; @@ -448,7 +448,7 @@ struct CC_DLL V2F_C4F_T2F_Quad /** @struct V3F_T2F_Quad * */ -struct CC_DLL V3F_T2F_Quad +struct AX_DLL V3F_T2F_Quad { /// bottom left V3F_T2F bl; @@ -468,7 +468,7 @@ enum class BlendFactor : uint32_t; /** @struct BlendFunc * Blend Function used for textures. */ -struct CC_DLL BlendFunc +struct AX_DLL BlendFunc { /** source blend function */ backend::BlendFactor src; @@ -498,7 +498,7 @@ struct CC_DLL BlendFunc * * @note If any of these enums are edited and/or reordered, update Texture2D.m. */ -enum class CC_DLL TextVAlignment +enum class AX_DLL TextVAlignment { TOP, CENTER, @@ -510,7 +510,7 @@ enum class CC_DLL TextVAlignment * * @note If any of these enums are edited and/or reordered, update Texture2D.m. */ -enum class CC_DLL TextHAlignment +enum class AX_DLL TextHAlignment { LEFT, CENTER, @@ -536,7 +536,7 @@ enum class GlyphCollection /** @struct T2F_Quad * Texture coordinates for a quad. */ -struct CC_DLL T2F_Quad +struct AX_DLL T2F_Quad { /// bottom left Tex2F bl; @@ -551,7 +551,7 @@ struct CC_DLL T2F_Quad /** @struct AnimationFrameData * Struct that holds the size in pixels, texture coordinates and delays for animated ParticleSystemQuad. */ -struct CC_DLL AnimationFrameData +struct AX_DLL AnimationFrameData { T2F_Quad texCoords; Vec2 size; @@ -565,7 +565,7 @@ struct CC_DLL AnimationFrameData /** @struct FontShadow * Shadow attributes. */ -struct CC_DLL FontShadow +struct AX_DLL FontShadow { /// shadow x and y offset Vec2 _shadowOffset; @@ -580,7 +580,7 @@ struct CC_DLL FontShadow /** @struct FontStroke * Stroke attributes. */ -struct CC_DLL FontStroke +struct AX_DLL FontStroke { /// stroke color Color3B _strokeColor = Color3B::BLACK; @@ -595,7 +595,7 @@ struct CC_DLL FontStroke /** @struct FontDefinition * Font attributes. */ -struct CC_DLL FontDefinition +struct AX_DLL FontDefinition { /// font name std::string _fontName; @@ -627,7 +627,7 @@ struct CC_DLL FontDefinition /** @struct Acceleration * The device accelerometer reports values for each axis in units of g-force. */ -class CC_DLL Acceleration : public Ref +class AX_DLL Acceleration : public Ref { public: double x = 0; @@ -637,10 +637,10 @@ public: double timestamp = 0; }; -extern const std::string CC_DLL STD_STRING_EMPTY; -extern const ssize_t CC_DLL CC_INVALID_INDEX; +extern const std::string AX_DLL STD_STRING_EMPTY; +extern const ssize_t AX_DLL AX_INVALID_INDEX; -struct CC_DLL Viewport +struct AX_DLL Viewport { int x = 0; int y = 0; @@ -648,7 +648,7 @@ struct CC_DLL Viewport unsigned int h = 0; }; -struct CC_DLL ScissorRect +struct AX_DLL ScissorRect { float x = 0; float y = 0; diff --git a/core/base/ccUTF8.cpp b/core/base/ccUTF8.cpp index 892f6ec899..8a9a4fd1a8 100644 --- a/core/base/ccUTF8.cpp +++ b/core/base/ccUTF8.cpp @@ -38,7 +38,7 @@ NS_AX_BEGIN namespace StringUtils { -std::string CC_DLL format(const char* format, ...) +std::string AX_DLL format(const char* format, ...) { va_list args; va_start(args, format); @@ -56,8 +56,8 @@ std::string CC_DLL format(const char* format, ...) */ std::string vformat(const char* format, va_list ap) { -#define CC_VSNPRINTF_BUFFER_LENGTH 512 - std::string buf(CC_VSNPRINTF_BUFFER_LENGTH, '\0'); +#define AX_VSNPRINTF_BUFFER_LENGTH 512 + std::string buf(AX_VSNPRINTF_BUFFER_LENGTH, '\0'); va_list args; va_copy(args, ap); @@ -344,7 +344,7 @@ bool UTF32ToUTF16(std::u32string_view utf32, std::u16string& outUtf16) return utfConvert(utf32, outUtf16, ConvertUTF32toUTF16); } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret) { std::string utf8Str; diff --git a/core/base/ccUTF8.h b/core/base/ccUTF8.h index acfa9ed16a..527bacc050 100644 --- a/core/base/ccUTF8.h +++ b/core/base/ccUTF8.h @@ -33,7 +33,7 @@ #include #include -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "platform/android/jni/JniHelper.h" #endif @@ -67,8 +67,8 @@ std::string toString(T arg) return ss.str(); } -std::string CC_DLL format(const char* format, ...) CC_FORMAT_PRINTF(1, 2); -std::string CC_DLL vformat(const char* format, va_list ap); +std::string AX_DLL format(const char* format, ...) AX_FORMAT_PRINTF(1, 2); +std::string AX_DLL vformat(const char* format, va_list ap); /** * @brief Converts from UTF8 string to UTF16 string. @@ -90,44 +90,44 @@ std::string CC_DLL vformat(const char* format, va_list ap); * } * @endcode */ -CC_DLL bool UTF8ToUTF16(std::string_view inUtf8, std::u16string& outUtf16); +AX_DLL bool UTF8ToUTF16(std::string_view inUtf8, std::u16string& outUtf16); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF8 to UTF32. * * @see UTF8ToUTF16 */ -CC_DLL bool UTF8ToUTF32(std::string_view inUtf8, std::u32string& outUtf32); +AX_DLL bool UTF8ToUTF32(std::string_view inUtf8, std::u32string& outUtf32); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF16 to UTF8. * * @see UTF8ToUTF16 */ -CC_DLL bool UTF16ToUTF8(std::u16string_view inUtf16, std::string& outUtf8); +AX_DLL bool UTF16ToUTF8(std::u16string_view inUtf16, std::string& outUtf8); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF16 to UTF32. * * @see UTF8ToUTF16 */ -CC_DLL bool UTF16ToUTF32(std::u16string_view inUtf16, std::u32string& outUtf32); +AX_DLL bool UTF16ToUTF32(std::u16string_view inUtf16, std::u32string& outUtf32); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF32 to UTF8. * * @see UTF8ToUTF16 */ -CC_DLL bool UTF32ToUTF8(std::u32string_view inUtf32, std::string& outUtf8); +AX_DLL bool UTF32ToUTF8(std::u32string_view inUtf32, std::string& outUtf8); /** * @brief Same as \a UTF8ToUTF16 but converts form UTF32 to UTF16. * * @see UTF8ToUTF16 */ -CC_DLL bool UTF32ToUTF16(std::u32string_view inUtf32, std::u16string& outUtf16); +AX_DLL bool UTF32ToUTF16(std::u32string_view inUtf32, std::u16string& outUtf16); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) /** * @brief convert jstring to utf8 std::string, same function with env->getStringUTFChars. @@ -137,7 +137,7 @@ CC_DLL bool UTF32ToUTF16(std::u32string_view inUtf32, std::u16string& outUtf16); * @param ret True if the conversion succeeds and the ret pointer isn't null * @returns the result of utf8 string */ -CC_DLL std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret = nullptr); +AX_DLL std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret = nullptr); /** * @brief create a jstring with utf8 std::string, same function with env->newStringUTF @@ -147,18 +147,18 @@ CC_DLL std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret * @param ret True if the conversion succeeds and the ret pointer isn't null * @returns the result of jstring,the jstring need to DeleteLocalRef(jstring); */ -CC_DLL jstring newStringUTFJNI(JNIEnv* env, std::string_view utf8Str, bool* ret = nullptr); +AX_DLL jstring newStringUTFJNI(JNIEnv* env, std::string_view utf8Str, bool* ret = nullptr); #endif /** * @brief Trims the unicode spaces at the end of char16_t vector. */ -CC_DLL void trimUTF16Vector(std::vector& str); +AX_DLL void trimUTF16Vector(std::vector& str); /** * @brief Trims the unicode spaces at the end of char32_t vector. */ -CC_DLL void trimUTF32Vector(std::vector& str); +AX_DLL void trimUTF32Vector(std::vector& str); /** * @brief Whether the character is a whitespace character. @@ -168,7 +168,7 @@ CC_DLL void trimUTF32Vector(std::vector& str); * @see http://en.wikipedia.org/wiki/Whitespace_character#Unicode * */ -CC_DLL bool isUnicodeSpace(char32_t ch); +AX_DLL bool isUnicodeSpace(char32_t ch); /** * @brief Whether the character is a Chinese/Japanese/Korean character. @@ -179,7 +179,7 @@ CC_DLL bool isUnicodeSpace(char32_t ch); * @see http://tieba.baidu.com/p/748765987 * */ -CC_DLL bool isCJKUnicode(char32_t ch); +AX_DLL bool isCJKUnicode(char32_t ch); /** * @brief Whether the character is a non-breaking character. @@ -192,14 +192,14 @@ CC_DLL bool isCJKUnicode(char32_t ch); * @see https://en.wikipedia.org/wiki/Word_joiner * */ -CC_DLL bool isUnicodeNonBreaking(char32_t ch); +AX_DLL bool isUnicodeNonBreaking(char32_t ch); /** * @brief Returns the length of the string in characters. * @param utf8 An UTF-8 encoded string. * @returns The length of the string in characters. */ -CC_DLL int32_t getCharacterCountInUTF8String(std::string_view utf8); +AX_DLL int32_t getCharacterCountInUTF8String(std::string_view utf8); /** * @brief Gets the index of the last character that is not equal to the character given. @@ -207,34 +207,34 @@ CC_DLL int32_t getCharacterCountInUTF8String(std::string_view utf8); * @param c The character to be searched for. * @returns The index of the last character that is not \p c. */ -CC_DLL unsigned int getIndexOfLastNotChar16(const std::vector& str, char16_t c); +AX_DLL unsigned int getIndexOfLastNotChar16(const std::vector& str, char16_t c); /** * @brief Gets char16_t vector from a given utf16 string. */ -CC_DLL std::vector getChar16VectorFromUTF16String(const std::u16string& utf16); +AX_DLL std::vector getChar16VectorFromUTF16String(const std::u16string& utf16); /** * @brief Whether has non-ascii utf-8 characters */ -CC_DLL bool hasNonAsciiUTF8(const char* str, size_t len); +AX_DLL bool hasNonAsciiUTF8(const char* str, size_t len); /** * @brief Whether contains utf-8 or all characters are ascii */ -CC_DLL bool detectNonAsciiUTF8(const char* str, size_t len, bool restrictUTF8, bool* pAllCharsAreAscii); +AX_DLL bool detectNonAsciiUTF8(const char* str, size_t len, bool restrictUTF8, bool* pAllCharsAreAscii); /** * @brief isLegalUTF8String, contains ascii characters */ -CC_DLL bool isLegalUTF8String(const char* str, size_t len); +AX_DLL bool isLegalUTF8String(const char* str, size_t len); /** * Utf8 sequence * Store all utf8 chars as std::string * Build from std::string */ -class CC_DLL StringUTF8 +class AX_DLL StringUTF8 { public: struct CharUTF8 diff --git a/core/base/ccUtils.cpp b/core/base/ccUtils.cpp index 63ec1ebe51..d5ec1e2273 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(CC_USE_METAL) +#if defined(AX_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) { - CC_SAFE_RELEASE_NULL(image); + AX_SAFE_RELEASE_NULL(image); return nullptr; } @@ -333,7 +333,7 @@ Sprite* createSpriteFromBase64(const char* base64String) if (!imageResult) { - CC_SAFE_RELEASE_NULL(image); + AX_SAFE_RELEASE_NULL(image); return nullptr; } @@ -780,7 +780,7 @@ std::string urlDecode(std::string_view st) return decoded; } -CC_DLL uint32_t fourccValue(std::string_view str) +AX_DLL uint32_t fourccValue(std::string_view str) { if (str.empty() || str[0] != '#') return (uint32_t)-1; diff --git a/core/base/ccUtils.h b/core/base/ccUtils.h index 8a75bffd83..585b4629c8 100644 --- a/core/base/ccUtils.h +++ b/core/base/ccUtils.h @@ -25,8 +25,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_UTILS_H__ -#define __CC_UTILS_H__ +#ifndef __AX_UTILS_H__ +#define __AX_UTILS_H__ #include #include @@ -73,7 +73,7 @@ namespace utils * etc.). * @since v4.0 with axis */ -CC_DLL void captureScreen(std::function)> imageCallback); +AX_DLL void captureScreen(std::function)> imageCallback); /** Capture a specific Node. * @param startNode specify the snapshot Node. It should be axis::Scene @@ -81,7 +81,7 @@ CC_DLL void captureScreen(std::function)> imageCallback); * @returns: return a Image, then can call saveToFile to save the image as "xxx.png or xxx.jpg". * @since v4.0 with axis */ -CC_DLL void captureNode(Node* startNode, std::function)> imageCallback, float scale = 1.0f); +AX_DLL void captureNode(Node* startNode, std::function)> imageCallback, float scale = 1.0f); /** Capture the entire screen. V4-copmatiable only, [DEPRECATED] * To ensure the snapshot is applied after everything is updated and rendered in the current frame, @@ -92,7 +92,7 @@ CC_DLL void captureNode(Node* startNode, std::function)> imag * etc.). * @since v4.0 */ -CC_DLL void captureScreen(std::function afterCap, std::string_view filename); +AX_DLL void captureScreen(std::function afterCap, std::string_view filename); /** Find children by name, it will return all child that has the same name. * It supports c++ 11 regular expression. It is a helper function of `Node::enumerateChildren()`. @@ -103,7 +103,7 @@ CC_DLL void captureScreen(std::function afterCap, * @return Array of Nodes that matches the name * @since v3.2 */ -CC_DLL std::vector findChildren(const Node& node, std::string_view name); +AX_DLL std::vector findChildren(const Node& node, std::string_view name); /** Same to ::atof, but strip the string, remain 7 numbers after '.' before call atof. * Why we need this? Because in android c++_static, atof ( and std::atof ) is unsupported for numbers have long decimal @@ -112,53 +112,53 @@ CC_DLL std::vector findChildren(const Node& node, std::string_view name); * @param str The string be to converted to double. * @return Returns converted value of a string. */ -CC_DLL double atof(const char* str); +AX_DLL double atof(const char* str); /** Get current exact time, accurate to nanoseconds. * @return Returns the time in seconds since the Epoch. */ -CC_DLL double gettime(); +AX_DLL double gettime(); /** * Get current time in milliseconds, accurate to nanoseconds * * @return Returns the time in milliseconds since the Epoch. */ -CC_DLL long long getTimeInMilliseconds(); +AX_DLL long long getTimeInMilliseconds(); /** * Calculate unionof bounding box of a node and its children. * @return Returns unionof bounding box of a node and its children. */ -CC_DLL Rect getCascadeBoundingBox(Node* node); +AX_DLL Rect getCascadeBoundingBox(Node* node); /** * Create a sprite instance from base64 encoded image and adds the texture to the Texture Cache. * @return Returns an instance of sprite */ -CC_DLL Sprite* createSpriteFromBase64Cached(const char* base64String, const char* key); +AX_DLL Sprite* createSpriteFromBase64Cached(const char* base64String, const char* key); /** * Create a sprite instance from base64 encoded image. * @return Returns an instance of sprite */ -CC_DLL Sprite* createSpriteFromBase64(const char* base64String); +AX_DLL Sprite* createSpriteFromBase64(const char* base64String); /** * Find a child by name recursively * @return Returns found node or nullptr */ -CC_DLL Node* findChild(Node* levelRoot, std::string_view name); +AX_DLL Node* findChild(Node* levelRoot, std::string_view name); /** * Find a child by tag recursively * @return Returns found node or nullptr */ -CC_DLL Node* findChild(Node* levelRoot, int tag); +AX_DLL Node* findChild(Node* levelRoot, int tag); /** * Find a child by name recursively @@ -187,14 +187,14 @@ inline T findChild(Node* levelRoot, int tag) * @param filename The file to calculate md5 hash. * @return The md5 hash for the file */ -CC_DLL std::string getFileMD5Hash(std::string_view filename); +AX_DLL std::string getFileMD5Hash(std::string_view filename); /** * Gets the md5 hash for the given buffer. * @param data The buffer to calculate md5 hash. * @return The md5 hash for the data */ -CC_DLL std::string getDataMD5Hash(const Data& data); +AX_DLL std::string getDataMD5Hash(const Data& data); /** * Gets the hash for the given buffer with specific algorithm. @@ -202,7 +202,7 @@ CC_DLL std::string getDataMD5Hash(const Data& data); * @param algorithm The hash algorithm, support "md5", "sha1", "sha256", "sha512" and more * @return The hash for the data */ -CC_DLL std::string computeDigest(std::string_view data, std::string_view algorithm); +AX_DLL std::string computeDigest(std::string_view data, std::string_view algorithm); /** @brief Converts language iso 639-1 code to LanguageType enum. @@ -210,23 +210,23 @@ CC_DLL std::string computeDigest(std::string_view data, std::string_view algorit * @js NA * @lua NA */ -CC_DLL LanguageType getLanguageTypeByISO2(const char* code); +AX_DLL LanguageType getLanguageTypeByISO2(const char* code); -CC_DLL backend::BlendFactor toBackendBlendFactor(int factor); +AX_DLL backend::BlendFactor toBackendBlendFactor(int factor); -CC_DLL int toGLBlendFactor(backend::BlendFactor blendFactor); +AX_DLL int toGLBlendFactor(backend::BlendFactor blendFactor); -CC_DLL backend::SamplerFilter toBackendSamplerFilter(int mode); +AX_DLL backend::SamplerFilter toBackendSamplerFilter(int mode); -CC_DLL backend::SamplerAddressMode toBackendAddressMode(int mode); +AX_DLL backend::SamplerAddressMode toBackendAddressMode(int mode); // Adjust matrix for metal. -CC_DLL const Mat4& getAdjustMatrix(); +AX_DLL const Mat4& getAdjustMatrix(); /** Get the Normal Matrix of matrixMV */ -CC_DLL std::vector getNormalMat3OfMat4(const Mat4& mat); +AX_DLL std::vector getNormalMat3OfMat4(const Mat4& mat); /** @brief Parses a list of space-separated integers. @@ -234,7 +234,7 @@ CC_DLL std::vector getNormalMat3OfMat4(const Mat4& mat); * @js NA * @lua NA */ -CC_DLL std::vector parseIntegerList(std::string_view intsString); +AX_DLL std::vector parseIntegerList(std::string_view intsString); /** @brief translate charstring/binarystream to hexstring. @@ -242,7 +242,7 @@ CC_DLL std::vector parseIntegerList(std::string_view intsString); * @js NA * @lua NA */ -CC_DLL std::string bin2hex(std::string_view binary /*charstring also regard as binary in C/C++*/, +AX_DLL std::string bin2hex(std::string_view binary /*charstring also regard as binary in C/C++*/, int delim = -1, bool prefix = false); @@ -252,7 +252,7 @@ CC_DLL std::string bin2hex(std::string_view binary /*charstring also regard as b * @js NA * @lua NA */ -CC_DLL void killCurrentProcess(); +AX_DLL void killCurrentProcess(); /** * Create a Game Object, like CREATE_FUNC, but more powerful @@ -401,13 +401,13 @@ inline char* char2hex(char* p, unsigned char c, unsigned char a = 'a') return p; } -CC_DLL std::string urlEncode(std::string_view s); +AX_DLL std::string urlEncode(std::string_view s); -CC_DLL std::string urlDecode(std::string_view st); +AX_DLL std::string urlDecode(std::string_view st); -CC_DLL uint32_t fourccValue(std::string_view str); +AX_DLL uint32_t fourccValue(std::string_view str); } // namespace utils NS_AX_END -#endif // __SUPPORT_CC_UTILS_H__ +#endif // __SUPPORT_AX_UTILS_H__ diff --git a/core/cocos2d.h b/core/cocos2d.h index 244d8549db..7e5b95c698 100644 --- a/core/cocos2d.h +++ b/core/cocos2d.h @@ -36,7 +36,7 @@ THE SOFTWARE. NS_AX_BEGIN -CC_DLL const char* cocos2dVersion(); +AX_DLL const char* cocos2dVersion(); /** Backward compatibility with old axis projects */ diff --git a/core/math/CCAffineTransform.h b/core/math/CCAffineTransform.h index 99ad200934..03a2c13b99 100644 --- a/core/math/CCAffineTransform.h +++ b/core/math/CCAffineTransform.h @@ -49,7 +49,7 @@ NS_AX_BEGIN 0 1 0 0 0 1 */ -struct CC_DLL AffineTransform +struct AX_DLL AffineTransform { float a, b, c, d; float tx, ty; @@ -60,25 +60,25 @@ struct CC_DLL AffineTransform /**@}*/ /**Make affine transform.*/ -CC_DLL AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty); +AX_DLL AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty); #define AffineTransformMake __CCAffineTransformMake /**Multiply point (x,y,1) by a affine transform.*/ -CC_DLL Vec2 __CCPointApplyAffineTransform(const Vec2& point, const AffineTransform& t); +AX_DLL Vec2 __CCPointApplyAffineTransform(const Vec2& point, const AffineTransform& t); #define PointApplyAffineTransform __CCPointApplyAffineTransform /**Multiply size (width,height,0) by a affine transform.*/ -CC_DLL Vec2 __CCSizeApplyAffineTransform(const Vec2& size, const AffineTransform& t); +AX_DLL Vec2 __CCSizeApplyAffineTransform(const Vec2& size, const AffineTransform& t); #define SizeApplyAffineTransform __CCSizeApplyAffineTransform /**Make identity affine transform.*/ -CC_DLL AffineTransform AffineTransformMakeIdentity(); +AX_DLL AffineTransform AffineTransformMakeIdentity(); /**Transform Rect, which will transform the four vertices of the point.*/ -CC_DLL Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform); +AX_DLL Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform); /**@{ Transform vec2 and Rect by Mat4. */ -CC_DLL Rect RectApplyTransform(const Rect& rect, const Mat4& transform); -CC_DLL Vec2 PointApplyTransform(const Vec2& point, const Mat4& transform); +AX_DLL Rect RectApplyTransform(const Rect& rect, const Mat4& transform); +AX_DLL Vec2 PointApplyTransform(const Vec2& point, const Mat4& transform); /**@}*/ /** Translation, equals @@ -86,31 +86,31 @@ CC_DLL Vec2 PointApplyTransform(const Vec2& point, const Mat4& transform); 0 1 0 * affine transform tx ty 1 */ -CC_DLL AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty); +AX_DLL AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty); /** Rotation, equals cos(angle) sin(angle) 0 -sin(angle) cos(angle) 0 * AffineTransform 0 0 1 */ -CC_DLL AffineTransform AffineTransformRotate(const AffineTransform& aTransform, float anAngle); +AX_DLL AffineTransform AffineTransformRotate(const AffineTransform& aTransform, float anAngle); /** Scale, equals sx 0 0 0 sy 0 * affineTransform 0 0 1 */ -CC_DLL AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy); +AX_DLL AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy); /**Concat two affine transform, t1 * t2*/ -CC_DLL AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2); +AX_DLL AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2); /**Compare affine transform.*/ -CC_DLL bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2); +AX_DLL bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2); /**Get the inverse of affine transform.*/ -CC_DLL AffineTransform AffineTransformInvert(const AffineTransform& t); +AX_DLL AffineTransform AffineTransformInvert(const AffineTransform& t); /**Concat Mat4, return t1 * t2.*/ -CC_DLL Mat4 TransformConcat(const Mat4& t1, const Mat4& t2); +AX_DLL Mat4 TransformConcat(const Mat4& t1, const Mat4& t2); -extern CC_DLL const AffineTransform AffineTransformIdentity; +extern AX_DLL const AffineTransform AffineTransformIdentity; NS_AX_END diff --git a/core/math/CCMath.h b/core/math/CCMath.h index 9970ea55dd..0dea46eaf1 100644 --- a/core/math/CCMath.h +++ b/core/math/CCMath.h @@ -22,8 +22,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_MATH_H__ -#define __CC_MATH_H__ +#ifndef __AX_MATH_H__ +#define __AX_MATH_H__ #include "math/Vec2.h" #include "math/Vec3.h" diff --git a/core/math/CCVertex.cpp b/core/math/CCVertex.cpp index 7973d0baad..d837efa845 100644 --- a/core/math/CCVertex.cpp +++ b/core/math/CCVertex.cpp @@ -62,9 +62,9 @@ void ccVertexLineToPolygon(Vec2* points, float stroke, Vec2* vertices, unsigned // Calculate angle between vectors float angle = acosf(p2p1.dot(p0p1)); - if (angle < CC_DEGREES_TO_RADIANS(70)) + if (angle < AX_DEGREES_TO_RADIANS(70)) perpVector = p2p1.getMidpoint(p0p1).getNormalized().getPerp(); - else if (angle < CC_DEGREES_TO_RADIANS(170)) + else if (angle < AX_DEGREES_TO_RADIANS(170)) perpVector = p2p1.getMidpoint(p0p1).getNormalized(); else perpVector = (p2 - p0).getNormalized().getPerp(); diff --git a/core/math/CCVertex.h b/core/math/CCVertex.h index 56d3f38e96..a85f2776b3 100644 --- a/core/math/CCVertex.h +++ b/core/math/CCVertex.h @@ -39,11 +39,11 @@ NS_AX_BEGIN /** @file CCVertex.h */ /** converts a line to a polygon */ -void CC_DLL +void AX_DLL ccVertexLineToPolygon(Vec2* points, float stroke, Vec2* vertices, unsigned int offset, unsigned int nuPoints); /** returns whether or not the line intersects */ -bool CC_DLL +bool AX_DLL ccVertexLineIntersect(float Ax, float Ay, float Bx, float By, float Cx, float Cy, float Dx, float Dy, float* T); NS_AX_END diff --git a/core/math/Mat4.cpp b/core/math/Mat4.cpp index 32ac43cc49..0ab9228c2b 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 CC_USE_METAL +#ifdef AX_USE_METAL dst->m[10] = -(zFarPlane)*f_n; dst->m[14] = -(zFarPlane * zNearPlane) * f_n; #endif @@ -186,7 +186,7 @@ void Mat4::createOrthographicOffCenter(float left, dst->m[15] = 1; //// https://metashapes.com/blog/opengl-metal-projection-matrix-problem/ -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL dst->m[10] = 1 / (zNearPlane - zFarPlane); dst->m[14] = zNearPlane / (zNearPlane - zFarPlane); #endif diff --git a/core/math/Mat4.h b/core/math/Mat4.h index 5118e56f14..9f8721395c 100644 --- a/core/math/Mat4.h +++ b/core/math/Mat4.h @@ -72,7 +72,7 @@ NS_AX_MATH_BEGIN * * @see Transform */ -class CC_DLL Mat4 +class AX_DLL Mat4 { public: // //temp add conversion diff --git a/core/math/MathUtil.cpp b/core/math/MathUtil.cpp index 76450f6625..0a38766fae 100644 --- a/core/math/MathUtil.cpp +++ b/core/math/MathUtil.cpp @@ -22,7 +22,7 @@ This file was modified to fit the cocos2d-x project #include "math/MathUtil.h" #include "base/ccMacros.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include #endif @@ -33,7 +33,7 @@ This file was modified to fit the cocos2d-x project //#define USE_SSE : SSE code used //#define INCLUDE_SSE : SSE code included -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # if defined(__arm64__) # define USE_NEON64 # define INCLUDE_NEON64 @@ -42,7 +42,7 @@ This file was modified to fit the cocos2d-x project # define INCLUDE_NEON32 # else # endif -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # if defined(__arm64__) || defined(__aarch64__) # define USE_NEON64 # define INCLUDE_NEON64 @@ -105,7 +105,7 @@ bool MathUtil::isNeon32Enabled() { #ifdef USE_NEON32 return true; -#elif (defined(INCLUDE_NEON32) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)) +#elif (defined(INCLUDE_NEON32) && (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)) class AnrdoidNeonChecker { public: diff --git a/core/math/MathUtil.h b/core/math/MathUtil.h index aba75e31bb..cad9960928 100644 --- a/core/math/MathUtil.h +++ b/core/math/MathUtil.h @@ -41,7 +41,7 @@ NS_AX_MATH_BEGIN * * This is primarily used for optimized internal math operations. */ -class CC_DLL MathUtil +class AX_DLL MathUtil { friend class Mat4; friend class Vec3; diff --git a/core/math/Quaternion.h b/core/math/Quaternion.h index 7258a82172..9c04056b68 100644 --- a/core/math/Quaternion.h +++ b/core/math/Quaternion.h @@ -71,7 +71,7 @@ class Mat4; * q4 = (-0.8, 0.0, -0.6, 0.0). * For the point p = (1.0, 1.0, 1.0), the following figures show the trajectories of p using lerp, slerp, and squad. */ -class CC_DLL Quaternion +class AX_DLL Quaternion { friend class Curve; friend class Transform; diff --git a/core/math/Rect.h b/core/math/Rect.h index 29818057b7..78f08d9d12 100644 --- a/core/math/Rect.h +++ b/core/math/Rect.h @@ -38,7 +38,7 @@ THE SOFTWARE. NS_AX_BEGIN /**Rectangle area.*/ -class CC_DLL Rect +class AX_DLL Rect { public: /**Low left point of rect.*/ diff --git a/core/math/TransformUtils.h b/core/math/TransformUtils.h index 32b11d38dc..cd5d7ce98c 100644 --- a/core/math/TransformUtils.h +++ b/core/math/TransformUtils.h @@ -43,8 +43,8 @@ struct AffineTransform; @param m The Mat4*4 pointer. @param t Affine transform. */ -CC_DLL void CGAffineToGL(const AffineTransform& t, float* m); -CC_DLL void GLToCGAffine(const float* m, AffineTransform* t); +AX_DLL void CGAffineToGL(const AffineTransform& t, float* m); +AX_DLL void GLToCGAffine(const float* m, AffineTransform* t); /**@}*/ } // namespace cocos2d /** diff --git a/core/math/Vec2.h b/core/math/Vec2.h index fef1349ea4..54c0f0fe6d 100644 --- a/core/math/Vec2.h +++ b/core/math/Vec2.h @@ -55,7 +55,7 @@ class Mat4; /** * Defines a 2-element floating point vector. */ -class CC_DLL Vec2 +class AX_DLL Vec2 { public: union diff --git a/core/math/Vec3.h b/core/math/Vec3.h index 71bb9d413f..6a337ceb16 100644 --- a/core/math/Vec3.h +++ b/core/math/Vec3.h @@ -45,7 +45,7 @@ class Quaternion; * the magnitude of the vector intact. When used as a point, * the elements of the vector represent a position in 3D space. */ -class CC_DLL Vec3 +class AX_DLL Vec3 { public: /** diff --git a/core/math/Vec4.h b/core/math/Vec4.h index b8876f3ca9..5f4d928b7b 100644 --- a/core/math/Vec4.h +++ b/core/math/Vec4.h @@ -41,7 +41,7 @@ class Mat4; /** * Defines 4-element floating point vector. */ -class CC_DLL Vec4 +class AX_DLL Vec4 { public: #ifdef __SSE__ diff --git a/core/navmesh/CCNavMesh.cpp b/core/navmesh/CCNavMesh.cpp index 3c8882c2f2..49f1fd72e7 100644 --- a/core/navmesh/CCNavMesh.cpp +++ b/core/navmesh/CCNavMesh.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "navmesh/CCNavMesh.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "platform/CCFileUtils.h" # include "renderer/CCRenderer.h" @@ -98,7 +98,7 @@ NavMesh* NavMesh::create(std::string_view navFilePath, std::string_view geomFile ref->autorelease(); return ref; } - CC_SAFE_DELETE(ref); + AX_SAFE_DELETE(ref); return nullptr; } @@ -120,20 +120,20 @@ NavMesh::~NavMesh() dtFreeCrowd(_crowed); dtFreeNavMesh(_navMesh); dtFreeNavMeshQuery(_navMeshQuery); - CC_SAFE_DELETE(_allocator); - CC_SAFE_DELETE(_compressor); - CC_SAFE_DELETE(_meshProcess); - CC_SAFE_DELETE(_geomData); + AX_SAFE_DELETE(_allocator); + AX_SAFE_DELETE(_compressor); + AX_SAFE_DELETE(_meshProcess); + AX_SAFE_DELETE(_geomData); for (auto iter : _agentList) { - CC_SAFE_RELEASE(iter); + AX_SAFE_RELEASE(iter); } _agentList.clear(); for (auto iter : _obstacleList) { - CC_SAFE_RELEASE(iter); + AX_SAFE_RELEASE(iter); } _obstacleList.clear(); } @@ -662,4 +662,4 @@ void axis::NavMesh::findPath(const Vec3& start, const Vec3& end, std::vectorautorelease(); return ref; } - CC_SAFE_DELETE(ref); + AX_SAFE_DELETE(ref); return nullptr; } @@ -424,4 +424,4 @@ Vec3 NavMeshAgent::getVelocity() const NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshAgent.h b/core/navmesh/CCNavMeshAgent.h index 3afbc9ba64..32f9d85afc 100644 --- a/core/navmesh/CCNavMeshAgent.h +++ b/core/navmesh/CCNavMeshAgent.h @@ -27,7 +27,7 @@ #define __CCNAV_MESH_AGENT_H__ #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "2d/CCComponent.h" # include "base/CCRef.h" @@ -41,7 +41,7 @@ NS_AX_BEGIN * @addtogroup 3d * @{ */ -struct CC_DLL NavMeshAgentParam +struct AX_DLL NavMeshAgentParam { NavMeshAgentParam(); @@ -69,14 +69,14 @@ struct CC_DLL NavMeshAgentParam unsigned char queryFilterType; }; -struct CC_DLL OffMeshLinkData +struct AX_DLL OffMeshLinkData { Vec3 startPosition; // position in local coordinate system. Vec3 endPosition; // position in local coordinate system. }; /** @brief NavMeshAgent: The code wrapping of dtCrowdAgent, use component mode. */ -class CC_DLL NavMeshAgent : public Component +class AX_DLL NavMeshAgent : public Component { friend class NavMesh; @@ -232,6 +232,6 @@ private: NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH #endif // __CCNAV_MESH_AGENT_H__ diff --git a/core/navmesh/CCNavMeshDebugDraw.cpp b/core/navmesh/CCNavMeshDebugDraw.cpp index f82c5c6a64..e9e59703cc 100644 --- a/core/navmesh/CCNavMeshDebugDraw.cpp +++ b/core/navmesh/CCNavMeshDebugDraw.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "navmesh/CCNavMeshDebugDraw.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include // offsetof # include "base/ccTypes.h" # include "renderer/backend/ProgramState.h" @@ -98,8 +98,8 @@ NavMeshDebugDraw::~NavMeshDebugDraw() { delete iter; } - CC_SAFE_RELEASE_NULL(_programState); - CC_SAFE_RELEASE_NULL(_vertexBuffer); + AX_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_vertexBuffer); } void NavMeshDebugDraw::depthMask(bool state) @@ -162,8 +162,8 @@ void NavMeshDebugDraw::draw(Renderer* renderer) beforeCommand->init(0, Mat4::IDENTITY, Node::FLAGS_RENDER_AS_3D); afterCommand->init(0, Mat4::IDENTITY, Node::FLAGS_RENDER_AS_3D); - beforeCommand->func = CC_CALLBACK_0(NavMeshDebugDraw::onBeforeVisitCmd, this); - afterCommand->func = CC_CALLBACK_0(NavMeshDebugDraw::onAfterVisitCmd, this); + beforeCommand->func = AX_CALLBACK_0(NavMeshDebugDraw::onBeforeVisitCmd, this); + afterCommand->func = AX_CALLBACK_0(NavMeshDebugDraw::onAfterVisitCmd, this); beforeCommand->set3D(true); beforeCommand->setTransparent(true); @@ -201,7 +201,7 @@ void NavMeshDebugDraw::draw(Renderer* renderer) auto& command = _commands[idx]; initCustomCommand(command); - command.setBeforeCallback(CC_CALLBACK_0(NavMeshDebugDraw::onBeforeEachCommand, this, iter->depthMask)); + command.setBeforeCallback(AX_CALLBACK_0(NavMeshDebugDraw::onBeforeEachCommand, this, iter->depthMask)); if (iter->type == backend::PrimitiveType::LINE) { @@ -214,7 +214,7 @@ void NavMeshDebugDraw::draw(Renderer* renderer) renderer->addCommand(&command); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, iter->end - iter->start); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, iter->end - iter->start); idx++; } @@ -264,4 +264,4 @@ void NavMeshDebugDraw::clear() NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshDebugDraw.h b/core/navmesh/CCNavMeshDebugDraw.h index 786603955d..d7de6d727a 100644 --- a/core/navmesh/CCNavMeshDebugDraw.h +++ b/core/navmesh/CCNavMeshDebugDraw.h @@ -26,7 +26,7 @@ #pragma once #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "renderer/CCRenderState.h" # include "renderer/backend/ProgramState.h" @@ -122,4 +122,4 @@ private: NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshObstacle.cpp b/core/navmesh/CCNavMeshObstacle.cpp index a8aeebaf96..819125e28c 100644 --- a/core/navmesh/CCNavMeshObstacle.cpp +++ b/core/navmesh/CCNavMeshObstacle.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "navmesh/CCNavMeshObstacle.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "navmesh/CCNavMesh.h" # include "2d/CCNode.h" @@ -41,7 +41,7 @@ NavMeshObstacle* NavMeshObstacle::create(float radius, float height) ref->autorelease(); return ref; } - CC_SAFE_DELETE(ref); + AX_SAFE_DELETE(ref); return nullptr; } @@ -164,4 +164,4 @@ void NavMeshObstacle::syncToObstacle() NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshObstacle.h b/core/navmesh/CCNavMeshObstacle.h index 3503c5f4e4..bd7cf15b5d 100644 --- a/core/navmesh/CCNavMeshObstacle.h +++ b/core/navmesh/CCNavMeshObstacle.h @@ -27,7 +27,7 @@ #define __CCNAV_MESH_OBSTACLE_H__ #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "2d/CCComponent.h" @@ -44,7 +44,7 @@ NS_AX_BEGIN */ /** @brief NavMeshObstacle: The code wrapping of dtTileCacheObstacle, use component mode. */ -class CC_DLL NavMeshObstacle : public Component +class AX_DLL NavMeshObstacle : public Component { friend class NavMesh; @@ -117,6 +117,6 @@ private: NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH #endif // __CCNAV_MESH_OBSTACLE_H__ diff --git a/core/navmesh/CCNavMeshUtils.cpp b/core/navmesh/CCNavMeshUtils.cpp index 45e3789ec7..e303b41fe3 100644 --- a/core/navmesh/CCNavMeshUtils.cpp +++ b/core/navmesh/CCNavMeshUtils.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "navmesh/CCNavMeshUtils.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "recast/DetourCommon.h" # include "recast/DetourNavMeshBuilder.h" @@ -291,4 +291,4 @@ bool inRange(const float* v1, const float* v2, const float r, const float h) NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH diff --git a/core/navmesh/CCNavMeshUtils.h b/core/navmesh/CCNavMeshUtils.h index 122671b4ad..00e66f0006 100644 --- a/core/navmesh/CCNavMeshUtils.h +++ b/core/navmesh/CCNavMeshUtils.h @@ -27,7 +27,7 @@ #define __CCNAV_MESH_TOOL_H__ #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "platform/CCPlatformMacros.h" # include "math/CCMath.h" @@ -143,6 +143,6 @@ bool getSteerTarget(dtNavMeshQuery* navQuery, NS_AX_END -#endif // CC_USE_NAVMESH +#endif // AX_USE_NAVMESH #endif // __CCNAV_MESH_H__ diff --git a/core/network/CCDownloader-curl.cpp b/core/network/CCDownloader-curl.cpp index db6f3a3e75..2e2381aa56 100644 --- a/core/network/CCDownloader-curl.cpp +++ b/core/network/CCDownloader-curl.cpp @@ -50,7 +50,7 @@ // https://curl.se/libcurl/c/curl_easy_getinfo.html // https://curl.se/libcurl/c/curl_easy_setopt.html -#define CC_CURL_POLL_TIMEOUT_MS 50 // wait until DNS query done +#define AX_CURL_POLL_TIMEOUT_MS 50 // wait until DNS query done enum { @@ -700,7 +700,7 @@ private: // do wait action if (maxfd == -1) { - std::this_thread::sleep_for(std::chrono::milliseconds(CC_CURL_POLL_TIMEOUT_MS)); + std::this_thread::sleep_for(std::chrono::milliseconds(AX_CURL_POLL_TIMEOUT_MS)); rc = 0; } else diff --git a/core/network/CCDownloader.h b/core/network/CCDownloader.h index e3a32e1bf5..d59464d2a9 100644 --- a/core/network/CCDownloader.h +++ b/core/network/CCDownloader.h @@ -43,7 +43,7 @@ class IDownloaderImpl; class Downloader; class DownloaderCURL; -class CC_DLL DownloadTask final +class AX_DLL DownloadTask final { public: const static int ERROR_NO_ERROR = 0; @@ -96,7 +96,7 @@ private: std::unique_ptr _coTask; }; -class CC_DLL DownloaderHints +class AX_DLL DownloaderHints { public: uint32_t countOfMaxProcessingTasks; @@ -104,7 +104,7 @@ public: std::string tempFileNameSuffix; }; -class CC_DLL Downloader final +class AX_DLL Downloader final { public: Downloader(); diff --git a/core/network/CCIDownloaderImpl.h b/core/network/CCIDownloaderImpl.h index 9bd5339f78..3ea7927d31 100644 --- a/core/network/CCIDownloaderImpl.h +++ b/core/network/CCIDownloaderImpl.h @@ -32,8 +32,8 @@ #include "base/CCConsole.h" -// #define CC_DOWNLOADER_DEBUG -#if defined(CC_DOWNLOADER_DEBUG) || defined(_DEBUG) +// #define AX_DOWNLOADER_DEBUG +#if defined(AX_DOWNLOADER_DEBUG) || defined(_DEBUG) # define DLLOG(format, ...) axis::log(format, ##__VA_ARGS__) #else # define DLLOG(...) \ @@ -48,7 +48,7 @@ namespace network { class DownloadTask; -class CC_DLL IDownloadTask +class AX_DLL IDownloadTask { public: virtual ~IDownloadTask() {} diff --git a/core/network/HttpClient.cpp b/core/network/HttpClient.cpp index cd6273f814..18a15688bb 100644 --- a/core/network/HttpClient.cpp +++ b/core/network/HttpClient.cpp @@ -442,7 +442,7 @@ void HttpClient::dispatchResponseCallbacks() if (_finishedResponseQueue.unsafe_empty()) return; - auto CC_UNUSED lck = _finishedResponseQueue.get_lock(); + auto AX_UNUSED lck = _finishedResponseQueue.get_lock(); if (!_finishedResponseQueue.unsafe_empty()) { HttpResponse* response = _finishedResponseQueue.front(); @@ -495,13 +495,13 @@ void HttpClient::clearResponseQueue() void HttpClient::clearPendingResponseQueue() { - auto CC_UNUSED lck = _pendingResponseQueue.get_lock(); + auto AX_UNUSED lck = _pendingResponseQueue.get_lock(); __clearQueueUnsafe(_pendingResponseQueue, ClearResponsePredicate{}); } void HttpClient::clearFinishedResponseQueue() { - auto CC_UNUSED lck = _finishedResponseQueue.get_lock(); + auto AX_UNUSED lck = _finishedResponseQueue.get_lock(); __clearQueueUnsafe(_finishedResponseQueue, ClearResponsePredicate{}); } diff --git a/core/network/HttpClient.h b/core/network/HttpClient.h index 8881aac357..dfe4a92e40 100644 --- a/core/network/HttpClient.h +++ b/core/network/HttpClient.h @@ -56,7 +56,7 @@ namespace network * * @lua NA */ -class CC_DLL HttpClient +class AX_DLL HttpClient { public: /** diff --git a/core/network/HttpRequest.h b/core/network/HttpRequest.h index 06095520e4..77cfc7eb18 100644 --- a/core/network/HttpRequest.h +++ b/core/network/HttpRequest.h @@ -60,7 +60,7 @@ typedef std::function ccHttpRe * @lua NA */ -class CC_DLL HttpRequest : public Ref +class AX_DLL HttpRequest : public Ref { friend class HttpClient; diff --git a/core/network/HttpResponse.h b/core/network/HttpResponse.h index 3e2858c7ff..f3c185ea02 100644 --- a/core/network/HttpResponse.h +++ b/core/network/HttpResponse.h @@ -51,7 +51,7 @@ class HttpClient; * @since v2.0.2. * @lua NA */ -class CC_DLL HttpResponse : public axis::Ref +class AX_DLL HttpResponse : public axis::Ref { friend class HttpClient; diff --git a/core/network/Uri.h b/core/network/Uri.h index 15d60d83d0..7933aa7ce7 100644 --- a/core/network/Uri.h +++ b/core/network/Uri.h @@ -52,7 +52,7 @@ namespace network * UriEscapeMode::QUERY) (for the query, but probably only after splitting at * '&' to identify the individual parameters). */ -class CC_DLL Uri +class AX_DLL Uri { public: /** diff --git a/core/physics/CCPhysicsBody.cpp b/core/physics/CCPhysicsBody.cpp index 817399b9c5..b7ceaa6f32 100644 --- a/core/physics/CCPhysicsBody.cpp +++ b/core/physics/CCPhysicsBody.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "physics/CCPhysicsBody.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include # include @@ -137,7 +137,7 @@ PhysicsBody* PhysicsBody::create() return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -155,7 +155,7 @@ PhysicsBody* PhysicsBody::create(float mass) } } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -175,7 +175,7 @@ PhysicsBody* PhysicsBody::create(float mass, float moment) } } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -189,7 +189,7 @@ PhysicsBody* PhysicsBody::createCircle(float radius, const PhysicsMaterial& mate return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -203,7 +203,7 @@ PhysicsBody* PhysicsBody::createBox(const Vec2& size, const PhysicsMaterial& mat return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -220,7 +220,7 @@ PhysicsBody* PhysicsBody::createPolygon(const Vec2* points, return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -238,7 +238,7 @@ PhysicsBody* PhysicsBody::createEdgeSegment(const Vec2& a, return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -256,7 +256,7 @@ PhysicsBody* PhysicsBody::createEdgeBox(const Vec2& size, return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -275,7 +275,7 @@ PhysicsBody* PhysicsBody::createEdgePolygon(const Vec2* points, return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -294,7 +294,7 @@ PhysicsBody* PhysicsBody::createEdgeChain(const Vec2* points, return body; } - CC_SAFE_DELETE(body); + AX_SAFE_DELETE(body); return nullptr; } @@ -308,7 +308,7 @@ bool PhysicsBody::init() cpBodySetUserData(_cpBody, this); cpBodySetVelocityUpdateFunc(_cpBody, internalBodyUpdateVelocity); - CC_BREAK_IF(_cpBody == nullptr); + AX_BREAK_IF(_cpBody == nullptr); return true; } while (false); @@ -1011,4 +1011,4 @@ void PhysicsBody::removeFromPhysicsWorld() NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS diff --git a/core/physics/CCPhysicsBody.h b/core/physics/CCPhysicsBody.h index 389b5ffaad..ad69381e54 100644 --- a/core/physics/CCPhysicsBody.h +++ b/core/physics/CCPhysicsBody.h @@ -28,7 +28,7 @@ #define __CCPHYSICS_BODY_H__ #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "2d/CCComponent.h" # include "math/CCMath.h" @@ -62,7 +62,7 @@ const PhysicsMaterial PHYSICSBODY_MATERIAL_DEFAULT(0.1f, 0.5f, 0.5f); * static body. You can change mass and moment with setMass() and setMoment(). And you can change the body to be dynamic * or static by use function setDynamic(). */ -class CC_DLL PhysicsBody : public Component +class AX_DLL PhysicsBody : public Component { public: const static std::string COMPONENT_NAME; @@ -618,5 +618,5 @@ protected: NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif // __CCPHYSICS_BODY_H__ diff --git a/core/physics/CCPhysicsContact.cpp b/core/physics/CCPhysicsContact.cpp index cdb9759fad..2eb2f9b5fc 100644 --- a/core/physics/CCPhysicsContact.cpp +++ b/core/physics/CCPhysicsContact.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "physics/CCPhysicsContact.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "chipmunk/chipmunk.h" # include "physics/CCPhysicsBody.h" @@ -50,8 +50,8 @@ PhysicsContact::PhysicsContact() PhysicsContact::~PhysicsContact() { - CC_SAFE_DELETE(_contactData); - CC_SAFE_DELETE(_preContactData); + AX_SAFE_DELETE(_contactData); + AX_SAFE_DELETE(_preContactData); } PhysicsContact* PhysicsContact::construct(PhysicsShape* a, PhysicsShape* b) @@ -62,7 +62,7 @@ PhysicsContact* PhysicsContact::construct(PhysicsShape* a, PhysicsShape* b) return contact; } - CC_SAFE_DELETE(contact); + AX_SAFE_DELETE(contact); return nullptr; } @@ -70,7 +70,7 @@ bool PhysicsContact::init(PhysicsShape* a, PhysicsShape* b) { do { - CC_BREAK_IF(a == nullptr || b == nullptr); + AX_BREAK_IF(a == nullptr || b == nullptr); _shapeA = a; _shapeB = b; @@ -89,7 +89,7 @@ void PhysicsContact::generateContactData() } cpArbiter* arb = static_cast(_contactInfo); - CC_SAFE_DELETE(_preContactData); + AX_SAFE_DELETE(_preContactData); _preContactData = _contactData; _contactData = new PhysicsContactData(); _contactData->count = cpArbiterGetCount(arb); @@ -245,7 +245,7 @@ EventListenerPhysicsContact* EventListenerPhysicsContact::create() return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -280,7 +280,7 @@ EventListenerPhysicsContact* EventListenerPhysicsContact::clone() return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -297,7 +297,7 @@ EventListenerPhysicsContactWithBodies* EventListenerPhysicsContactWithBodies::cr return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -329,7 +329,7 @@ EventListenerPhysicsContactWithBodies* EventListenerPhysicsContactWithBodies::cl return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -350,7 +350,7 @@ EventListenerPhysicsContactWithShapes* EventListenerPhysicsContactWithShapes::cr return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -378,7 +378,7 @@ EventListenerPhysicsContactWithShapes* EventListenerPhysicsContactWithShapes::cl return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -397,7 +397,7 @@ EventListenerPhysicsContactWithGroup* EventListenerPhysicsContactWithGroup::crea return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } @@ -425,9 +425,9 @@ EventListenerPhysicsContactWithGroup* EventListenerPhysicsContactWithGroup::clon return obj; } - CC_SAFE_DELETE(obj); + AX_SAFE_DELETE(obj); return nullptr; } NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS diff --git a/core/physics/CCPhysicsContact.h b/core/physics/CCPhysicsContact.h index 7e4200e5d0..693a01a740 100644 --- a/core/physics/CCPhysicsContact.h +++ b/core/physics/CCPhysicsContact.h @@ -27,7 +27,7 @@ #define __CCPHYSICS_CONTACT_H__ #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "base/CCRef.h" # include "math/CCMath.h" @@ -41,7 +41,7 @@ class PhysicsShape; class PhysicsBody; class PhysicsWorld; -typedef struct CC_DLL PhysicsContactData +typedef struct AX_DLL PhysicsContactData { static const int POINT_MAX = 4; Vec2 points[POINT_MAX]; @@ -64,7 +64,7 @@ typedef struct CC_DLL PhysicsContactData * It will created automatically when two shape contact with each other. And it will destroyed automatically when two shape separated. */ -class CC_DLL PhysicsContact : public EventCustom +class AX_DLL PhysicsContact : public EventCustom { public: enum class EventCode @@ -151,7 +151,7 @@ private: /** * @brief Presolve value generated when onContactPreSolve called. */ -class CC_DLL PhysicsContactPreSolve +class AX_DLL PhysicsContactPreSolve { public: /** Get restitution between two bodies.*/ @@ -182,7 +182,7 @@ private: /** * @brief Postsolve value generated when onContactPostSolve called. */ -class CC_DLL PhysicsContactPostSolve +class AX_DLL PhysicsContactPostSolve { public: /** Get restitution between two bodies.*/ @@ -203,7 +203,7 @@ private: }; /** Contact listener. It will receive all the contact callbacks. */ -class CC_DLL EventListenerPhysicsContact : public EventListenerCustom +class AX_DLL EventListenerPhysicsContact : public EventListenerCustom { public: /** Create the listener. */ @@ -260,7 +260,7 @@ protected: }; /** This event listener only be called when bodyA and bodyB have contacts. */ -class CC_DLL EventListenerPhysicsContactWithBodies : public EventListenerPhysicsContact +class AX_DLL EventListenerPhysicsContactWithBodies : public EventListenerPhysicsContact { public: /** Create the listener. */ @@ -280,7 +280,7 @@ protected: }; /** This event listener only be called when shapeA and shapeB have contacts. */ -class CC_DLL EventListenerPhysicsContactWithShapes : public EventListenerPhysicsContact +class AX_DLL EventListenerPhysicsContactWithShapes : public EventListenerPhysicsContact { public: /** Create the listener. */ @@ -299,7 +299,7 @@ protected: }; /** This event listener only be called when shapeA or shapeB is in the group your specified */ -class CC_DLL EventListenerPhysicsContactWithGroup : public EventListenerPhysicsContact +class AX_DLL EventListenerPhysicsContactWithGroup : public EventListenerPhysicsContact { public: /** Create the listener. */ @@ -321,5 +321,5 @@ protected: NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif //__CCPHYSICS_CONTACT_H__ diff --git a/core/physics/CCPhysicsHelper.h b/core/physics/CCPhysicsHelper.h index 6dab709a11..557c432c9f 100644 --- a/core/physics/CCPhysicsHelper.h +++ b/core/physics/CCPhysicsHelper.h @@ -28,7 +28,7 @@ #define __CCPHYSICS_HELPER_H__ #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "chipmunk/chipmunk.h" # include "platform/CCPlatformMacros.h" @@ -112,5 +112,5 @@ public: NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif // __CCPHYSICS_HELPER_H__ diff --git a/core/physics/CCPhysicsJoint.cpp b/core/physics/CCPhysicsJoint.cpp index 8bf9dadd47..9dd3efbb63 100644 --- a/core/physics/CCPhysicsJoint.cpp +++ b/core/physics/CCPhysicsJoint.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "physics/CCPhysicsJoint.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "chipmunk/chipmunk.h" # include "physics/CCPhysicsBody.h" @@ -92,7 +92,7 @@ public: # define UNLIKELY(x) (x) # endif -# define CC_PJOINT_CACHE_READ(field) \ +# define AX_PJOINT_CACHE_READ(field) \ do \ { \ if (UNLIKELY(_initDirty)) \ @@ -101,7 +101,7 @@ public: } \ } while (0) -# define CC_PJOINT_CACHE_WRITE2(field, method, arg, convertedArg) \ +# define AX_PJOINT_CACHE_WRITE2(field, method, arg, convertedArg) \ do \ { \ if (UNLIKELY(_initDirty)) \ @@ -115,7 +115,7 @@ public: } \ } while (0) -# define CC_PJOINT_CACHE_WRITE(field, method, arg) CC_PJOINT_CACHE_WRITE2(field, method, arg, arg) +# define AX_PJOINT_CACHE_WRITE(field, method, arg) AX_PJOINT_CACHE_WRITE2(field, method, arg, arg) PhysicsJoint::PhysicsJoint() : _bodyA(nullptr) @@ -169,7 +169,7 @@ bool PhysicsJoint::initJoint() while (_initDirty) { ret = createConstraints(); - CC_BREAK_IF(!ret); + AX_BREAK_IF(!ret); for (auto subjoint : _cpConstraints) { @@ -261,7 +261,7 @@ PhysicsJointFixed* PhysicsJointFixed::construct(PhysicsBody* a, PhysicsBody* b, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -274,12 +274,12 @@ bool PhysicsJointFixed::createConstraints() // add a pivot joint to fixed two body together auto joint = cpPivotJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), PhysicsHelper::vec22cpv(_anchr)); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); // add a gear joint to make two body have the same rotation. joint = cpGearJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), 0, 1); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); _collisionEnable = false; @@ -301,7 +301,7 @@ PhysicsJointPin* PhysicsJointPin::construct(PhysicsBody* a, PhysicsBody* b, cons return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -318,7 +318,7 @@ PhysicsJointPin* PhysicsJointPin::construct(PhysicsBody* a, PhysicsBody* b, cons return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -337,7 +337,7 @@ bool PhysicsJointPin::createConstraints() joint = cpPivotJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), PhysicsHelper::vec22cpv(_anchr1)); } - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -365,7 +365,7 @@ PhysicsJointLimit* PhysicsJointLimit::construct(PhysicsBody* a, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -381,7 +381,7 @@ bool PhysicsJointLimit::createConstraints() auto joint = cpSlideJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), PhysicsHelper::vec22cpv(_anchr1), PhysicsHelper::vec22cpv(_anchr2), _min, _max); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -392,46 +392,46 @@ bool PhysicsJointLimit::createConstraints() float PhysicsJointLimit::getMin() const { - CC_PJOINT_CACHE_READ(_min); + AX_PJOINT_CACHE_READ(_min); return PhysicsHelper::cpfloat2float(cpSlideJointGetMin(_cpConstraints.front())); } void PhysicsJointLimit::setMin(float min) { - CC_PJOINT_CACHE_WRITE(_min, cpSlideJointSetMin, min); + AX_PJOINT_CACHE_WRITE(_min, cpSlideJointSetMin, min); } float PhysicsJointLimit::getMax() const { - CC_PJOINT_CACHE_READ(_max); + AX_PJOINT_CACHE_READ(_max); return PhysicsHelper::cpfloat2float(cpSlideJointGetMax(_cpConstraints.front())); } void PhysicsJointLimit::setMax(float max) { - CC_PJOINT_CACHE_WRITE(_max, cpSlideJointSetMax, max); + AX_PJOINT_CACHE_WRITE(_max, cpSlideJointSetMax, max); } Vec2 PhysicsJointLimit::getAnchr1() const { - CC_PJOINT_CACHE_READ(_anchr1); + AX_PJOINT_CACHE_READ(_anchr1); return PhysicsHelper::cpv2vec2(cpSlideJointGetAnchorA(_cpConstraints.front())); } void PhysicsJointLimit::setAnchr1(const Vec2& anchr) { - CC_PJOINT_CACHE_WRITE2(_anchr1, cpSlideJointSetAnchorA, anchr, PhysicsHelper::vec22cpv(anchr)); + AX_PJOINT_CACHE_WRITE2(_anchr1, cpSlideJointSetAnchorA, anchr, PhysicsHelper::vec22cpv(anchr)); } Vec2 PhysicsJointLimit::getAnchr2() const { - CC_PJOINT_CACHE_READ(_anchr2); + AX_PJOINT_CACHE_READ(_anchr2); return PhysicsHelper::cpv2vec2(cpSlideJointGetAnchorB(_cpConstraints.front())); } void PhysicsJointLimit::setAnchr2(const Vec2& anchr) { - CC_PJOINT_CACHE_WRITE2(_anchr2, cpSlideJointSetAnchorB, anchr, PhysicsHelper::vec22cpv(anchr)); + AX_PJOINT_CACHE_WRITE2(_anchr2, cpSlideJointSetAnchorB, anchr, PhysicsHelper::vec22cpv(anchr)); } PhysicsJointDistance* PhysicsJointDistance::construct(PhysicsBody* a, @@ -449,7 +449,7 @@ PhysicsJointDistance* PhysicsJointDistance::construct(PhysicsBody* a, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -459,7 +459,7 @@ bool PhysicsJointDistance::createConstraints() { auto joint = cpPinJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), PhysicsHelper::vec22cpv(_anchr1), PhysicsHelper::vec22cpv(_anchr2)); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -470,13 +470,13 @@ bool PhysicsJointDistance::createConstraints() float PhysicsJointDistance::getDistance() const { - CC_PJOINT_CACHE_READ(_distance); + AX_PJOINT_CACHE_READ(_distance); return PhysicsHelper::cpfloat2float(cpPinJointGetDist(_cpConstraints.front())); } void PhysicsJointDistance::setDistance(float distance) { - CC_PJOINT_CACHE_WRITE(_distance, cpPinJointSetDist, distance); + AX_PJOINT_CACHE_WRITE(_distance, cpPinJointSetDist, distance); } PhysicsJointSpring* PhysicsJointSpring::construct(PhysicsBody* a, @@ -498,7 +498,7 @@ PhysicsJointSpring* PhysicsJointSpring::construct(PhysicsBody* a, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -511,7 +511,7 @@ bool PhysicsJointSpring::createConstraints() _bodyB->local2World(_anchr1).getDistance(_bodyA->local2World(_anchr2)), _stiffness, _damping); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -522,57 +522,57 @@ bool PhysicsJointSpring::createConstraints() Vec2 PhysicsJointSpring::getAnchr1() const { - CC_PJOINT_CACHE_READ(_anchr1); + AX_PJOINT_CACHE_READ(_anchr1); return PhysicsHelper::cpv2vec2(cpDampedSpringGetAnchorA(_cpConstraints.front())); } void PhysicsJointSpring::setAnchr1(const Vec2& anchr) { - CC_PJOINT_CACHE_WRITE2(_anchr1, cpDampedSpringSetAnchorA, anchr, PhysicsHelper::vec22cpv(anchr)); + AX_PJOINT_CACHE_WRITE2(_anchr1, cpDampedSpringSetAnchorA, anchr, PhysicsHelper::vec22cpv(anchr)); } Vec2 PhysicsJointSpring::getAnchr2() const { - CC_PJOINT_CACHE_READ(_anchr2); + AX_PJOINT_CACHE_READ(_anchr2); return PhysicsHelper::cpv2vec2(cpDampedSpringGetAnchorB(_cpConstraints.front())); } void PhysicsJointSpring::setAnchr2(const Vec2& anchr) { - CC_PJOINT_CACHE_WRITE2(_anchr2, cpDampedSpringSetAnchorB, anchr, PhysicsHelper::vec22cpv(anchr)); + AX_PJOINT_CACHE_WRITE2(_anchr2, cpDampedSpringSetAnchorB, anchr, PhysicsHelper::vec22cpv(anchr)); } float PhysicsJointSpring::getRestLength() const { - CC_PJOINT_CACHE_READ(_restLength); + AX_PJOINT_CACHE_READ(_restLength); return PhysicsHelper::cpfloat2float(cpDampedSpringGetRestLength(_cpConstraints.front())); } void PhysicsJointSpring::setRestLength(float restLength) { - CC_PJOINT_CACHE_WRITE(_restLength, cpDampedSpringSetRestLength, restLength); + AX_PJOINT_CACHE_WRITE(_restLength, cpDampedSpringSetRestLength, restLength); } float PhysicsJointSpring::getStiffness() const { - CC_PJOINT_CACHE_READ(_stiffness); + AX_PJOINT_CACHE_READ(_stiffness); return PhysicsHelper::cpfloat2float(cpDampedSpringGetStiffness(_cpConstraints.front())); } void PhysicsJointSpring::setStiffness(float stiffness) { - CC_PJOINT_CACHE_WRITE(_stiffness, cpDampedSpringSetStiffness, stiffness); + AX_PJOINT_CACHE_WRITE(_stiffness, cpDampedSpringSetStiffness, stiffness); } float PhysicsJointSpring::getDamping() const { - CC_PJOINT_CACHE_READ(_damping); + AX_PJOINT_CACHE_READ(_damping); return PhysicsHelper::cpfloat2float(cpDampedSpringGetDamping(_cpConstraints.front())); } void PhysicsJointSpring::setDamping(float damping) { - CC_PJOINT_CACHE_WRITE(_damping, cpDampedSpringSetDamping, damping); + AX_PJOINT_CACHE_WRITE(_damping, cpDampedSpringSetDamping, damping); } PhysicsJointGroove* PhysicsJointGroove::construct(PhysicsBody* a, @@ -592,7 +592,7 @@ PhysicsJointGroove* PhysicsJointGroove::construct(PhysicsBody* a, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -603,7 +603,7 @@ bool PhysicsJointGroove::createConstraints() auto joint = cpGrooveJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), PhysicsHelper::vec22cpv(_grooveA), PhysicsHelper::vec22cpv(_grooveB), PhysicsHelper::vec22cpv(_anchr2)); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -614,35 +614,35 @@ bool PhysicsJointGroove::createConstraints() Vec2 PhysicsJointGroove::getGrooveA() const { - CC_PJOINT_CACHE_READ(_grooveA); + AX_PJOINT_CACHE_READ(_grooveA); return PhysicsHelper::cpv2vec2(cpGrooveJointGetGrooveA(_cpConstraints.front())); } void PhysicsJointGroove::setGrooveA(const Vec2& grooveA) { - CC_PJOINT_CACHE_WRITE2(_grooveA, cpGrooveJointSetGrooveA, grooveA, PhysicsHelper::vec22cpv(grooveA)); + AX_PJOINT_CACHE_WRITE2(_grooveA, cpGrooveJointSetGrooveA, grooveA, PhysicsHelper::vec22cpv(grooveA)); } Vec2 PhysicsJointGroove::getGrooveB() const { - CC_PJOINT_CACHE_READ(_grooveB); + AX_PJOINT_CACHE_READ(_grooveB); return PhysicsHelper::cpv2vec2(cpGrooveJointGetGrooveB(_cpConstraints.front())); } void PhysicsJointGroove::setGrooveB(const Vec2& grooveB) { - CC_PJOINT_CACHE_WRITE2(_grooveB, cpGrooveJointSetGrooveB, grooveB, PhysicsHelper::vec22cpv(grooveB)); + AX_PJOINT_CACHE_WRITE2(_grooveB, cpGrooveJointSetGrooveB, grooveB, PhysicsHelper::vec22cpv(grooveB)); } Vec2 PhysicsJointGroove::getAnchr2() const { - CC_PJOINT_CACHE_READ(_anchr2); + AX_PJOINT_CACHE_READ(_anchr2); return PhysicsHelper::cpv2vec2(cpGrooveJointGetAnchorB(_cpConstraints.front())); } void PhysicsJointGroove::setAnchr2(const Vec2& anchr2) { - CC_PJOINT_CACHE_WRITE2(_anchr2, cpGrooveJointSetAnchorB, anchr2, PhysicsHelper::vec22cpv(anchr2)); + AX_PJOINT_CACHE_WRITE2(_anchr2, cpGrooveJointSetAnchorB, anchr2, PhysicsHelper::vec22cpv(anchr2)); } PhysicsJointRotarySpring* PhysicsJointRotarySpring::construct(PhysicsBody* a, @@ -660,7 +660,7 @@ PhysicsJointRotarySpring* PhysicsJointRotarySpring::construct(PhysicsBody* a, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -671,7 +671,7 @@ bool PhysicsJointRotarySpring::createConstraints() auto joint = cpDampedRotarySpringNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _bodyB->getRotation() - _bodyA->getRotation(), _stiffness, _damping); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -682,35 +682,35 @@ bool PhysicsJointRotarySpring::createConstraints() float PhysicsJointRotarySpring::getRestAngle() const { - CC_PJOINT_CACHE_READ(_restAngle); + AX_PJOINT_CACHE_READ(_restAngle); return PhysicsHelper::cpfloat2float(cpDampedRotarySpringGetRestAngle(_cpConstraints.front())); } void PhysicsJointRotarySpring::setRestAngle(float restAngle) { - CC_PJOINT_CACHE_WRITE(_restAngle, cpDampedRotarySpringSetRestAngle, restAngle); + AX_PJOINT_CACHE_WRITE(_restAngle, cpDampedRotarySpringSetRestAngle, restAngle); } float PhysicsJointRotarySpring::getStiffness() const { - CC_PJOINT_CACHE_READ(_stiffness); + AX_PJOINT_CACHE_READ(_stiffness); return PhysicsHelper::cpfloat2float(cpDampedRotarySpringGetStiffness(_cpConstraints.front())); } void PhysicsJointRotarySpring::setStiffness(float stiffness) { - CC_PJOINT_CACHE_WRITE(_stiffness, cpDampedRotarySpringSetStiffness, stiffness); + AX_PJOINT_CACHE_WRITE(_stiffness, cpDampedRotarySpringSetStiffness, stiffness); } float PhysicsJointRotarySpring::getDamping() const { - CC_PJOINT_CACHE_READ(_damping); + AX_PJOINT_CACHE_READ(_damping); return PhysicsHelper::cpfloat2float(cpDampedRotarySpringGetDamping(_cpConstraints.front())); } void PhysicsJointRotarySpring::setDamping(float damping) { - CC_PJOINT_CACHE_WRITE(_damping, cpDampedRotarySpringSetDamping, damping); + AX_PJOINT_CACHE_WRITE(_damping, cpDampedRotarySpringSetDamping, damping); } PhysicsJointRotaryLimit* PhysicsJointRotaryLimit::construct(PhysicsBody* a, PhysicsBody* b, float min, float max) @@ -725,7 +725,7 @@ PhysicsJointRotaryLimit* PhysicsJointRotaryLimit::construct(PhysicsBody* a, Phys return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -740,7 +740,7 @@ bool PhysicsJointRotaryLimit::createConstraints() { auto joint = cpRotaryLimitJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _min, _max); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -751,24 +751,24 @@ bool PhysicsJointRotaryLimit::createConstraints() float PhysicsJointRotaryLimit::getMin() const { - CC_PJOINT_CACHE_READ(_min); + AX_PJOINT_CACHE_READ(_min); return PhysicsHelper::cpfloat2float(cpRotaryLimitJointGetMin(_cpConstraints.front())); } void PhysicsJointRotaryLimit::setMin(float min) { - CC_PJOINT_CACHE_WRITE(_min, cpRotaryLimitJointSetMin, min); + AX_PJOINT_CACHE_WRITE(_min, cpRotaryLimitJointSetMin, min); } float PhysicsJointRotaryLimit::getMax() const { - CC_PJOINT_CACHE_READ(_max); + AX_PJOINT_CACHE_READ(_max); return PhysicsHelper::cpfloat2float(cpRotaryLimitJointGetMax(_cpConstraints.front())); } void PhysicsJointRotaryLimit::setMax(float max) { - CC_PJOINT_CACHE_WRITE(_max, cpRotaryLimitJointSetMax, max); + AX_PJOINT_CACHE_WRITE(_max, cpRotaryLimitJointSetMax, max); } PhysicsJointRatchet* PhysicsJointRatchet::construct(PhysicsBody* a, PhysicsBody* b, float phase, float ratchet) @@ -783,7 +783,7 @@ PhysicsJointRatchet* PhysicsJointRatchet::construct(PhysicsBody* a, PhysicsBody* return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -794,7 +794,7 @@ bool PhysicsJointRatchet::createConstraints() auto joint = cpRatchetJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _phase, PhysicsHelper::cpfloat2float(_ratchet)); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -805,35 +805,35 @@ bool PhysicsJointRatchet::createConstraints() float PhysicsJointRatchet::getAngle() const { - CC_PJOINT_CACHE_READ(_angle); + AX_PJOINT_CACHE_READ(_angle); return PhysicsHelper::cpfloat2float(cpRatchetJointGetAngle(_cpConstraints.front())); } void PhysicsJointRatchet::setAngle(float angle) { - CC_PJOINT_CACHE_WRITE(_angle, cpRatchetJointSetAngle, angle); + AX_PJOINT_CACHE_WRITE(_angle, cpRatchetJointSetAngle, angle); } float PhysicsJointRatchet::getPhase() const { - CC_PJOINT_CACHE_READ(_phase); + AX_PJOINT_CACHE_READ(_phase); return PhysicsHelper::cpfloat2float(cpRatchetJointGetPhase(_cpConstraints.front())); } void PhysicsJointRatchet::setPhase(float phase) { - CC_PJOINT_CACHE_WRITE(_phase, cpRatchetJointSetPhase, phase); + AX_PJOINT_CACHE_WRITE(_phase, cpRatchetJointSetPhase, phase); } float PhysicsJointRatchet::getRatchet() const { - CC_PJOINT_CACHE_READ(_ratchet); + AX_PJOINT_CACHE_READ(_ratchet); return PhysicsHelper::cpfloat2float(cpRatchetJointGetRatchet(_cpConstraints.front())); } void PhysicsJointRatchet::setRatchet(float ratchet) { - CC_PJOINT_CACHE_WRITE(_ratchet, cpRatchetJointSetRatchet, ratchet); + AX_PJOINT_CACHE_WRITE(_ratchet, cpRatchetJointSetRatchet, ratchet); } PhysicsJointGear* PhysicsJointGear::construct(PhysicsBody* a, PhysicsBody* b, float phase, float ratio) @@ -848,7 +848,7 @@ PhysicsJointGear* PhysicsJointGear::construct(PhysicsBody* a, PhysicsBody* b, fl return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -858,7 +858,7 @@ bool PhysicsJointGear::createConstraints() { auto joint = cpGearJointNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _phase, _ratio); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -869,24 +869,24 @@ bool PhysicsJointGear::createConstraints() float PhysicsJointGear::getPhase() const { - CC_PJOINT_CACHE_READ(_phase); + AX_PJOINT_CACHE_READ(_phase); return PhysicsHelper::cpfloat2float(cpGearJointGetPhase(_cpConstraints.front())); } void PhysicsJointGear::setPhase(float phase) { - CC_PJOINT_CACHE_WRITE(_phase, cpGearJointSetPhase, phase); + AX_PJOINT_CACHE_WRITE(_phase, cpGearJointSetPhase, phase); } float PhysicsJointGear::getRatio() const { - CC_PJOINT_CACHE_READ(_ratio); + AX_PJOINT_CACHE_READ(_ratio); return PhysicsHelper::cpfloat2float(cpGearJointGetRatio(_cpConstraints.front())); } void PhysicsJointGear::setRatio(float ratio) { - CC_PJOINT_CACHE_WRITE(_ratio, cpGearJointSetRatio, ratio); + AX_PJOINT_CACHE_WRITE(_ratio, cpGearJointSetRatio, ratio); } PhysicsJointMotor* PhysicsJointMotor::construct(PhysicsBody* a, PhysicsBody* b, float rate) @@ -900,7 +900,7 @@ PhysicsJointMotor* PhysicsJointMotor::construct(PhysicsBody* a, PhysicsBody* b, return joint; } - CC_SAFE_DELETE(joint); + AX_SAFE_DELETE(joint); return nullptr; } @@ -910,7 +910,7 @@ bool PhysicsJointMotor::createConstraints() { auto joint = cpSimpleMotorNew(_bodyA->getCPBody(), _bodyB->getCPBody(), _rate); - CC_BREAK_IF(joint == nullptr); + AX_BREAK_IF(joint == nullptr); _cpConstraints.push_back(joint); return true; @@ -921,14 +921,14 @@ bool PhysicsJointMotor::createConstraints() float PhysicsJointMotor::getRate() const { - CC_PJOINT_CACHE_READ(_rate); + AX_PJOINT_CACHE_READ(_rate); return PhysicsHelper::cpfloat2float(cpSimpleMotorGetRate(_cpConstraints.front())); } void PhysicsJointMotor::setRate(float rate) { - CC_PJOINT_CACHE_WRITE(_rate, cpSimpleMotorSetRate, rate); + AX_PJOINT_CACHE_WRITE(_rate, cpSimpleMotorSetRate, rate); } NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS diff --git a/core/physics/CCPhysicsJoint.h b/core/physics/CCPhysicsJoint.h index 55d54c07dd..459b3c0ca1 100644 --- a/core/physics/CCPhysicsJoint.h +++ b/core/physics/CCPhysicsJoint.h @@ -29,7 +29,7 @@ #include #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "base/CCRef.h" # include "math/CCMath.h" @@ -54,7 +54,7 @@ class WriteCache; /** * @brief An PhysicsJoint object connects two physics bodies together. */ -class CC_DLL PhysicsJoint +class AX_DLL PhysicsJoint { protected: typedef std::function DelayTask; @@ -145,7 +145,7 @@ protected: * @brief A fixed joint fuses the two bodies together at a reference point. Fixed joints are useful for creating complex * shapes that can be broken apart later. */ -class CC_DLL PhysicsJointFixed : public PhysicsJoint +class AX_DLL PhysicsJointFixed : public PhysicsJoint { public: /** Create a fixed joint. @@ -169,7 +169,7 @@ protected: /** * @brief A limit joint imposes a maximum distance between the two bodies, as if they were connected by a rope. */ -class CC_DLL PhysicsJointLimit : public PhysicsJoint +class AX_DLL PhysicsJointLimit : public PhysicsJoint { public: /** Create a limit joint. @@ -236,7 +236,7 @@ protected: /** * @brief A pin joint allows the two bodies to independently rotate around the anchor point as if pinned together. */ -class CC_DLL PhysicsJointPin : public PhysicsJoint +class AX_DLL PhysicsJointPin : public PhysicsJoint { public: /** Create a pin joint. @@ -270,7 +270,7 @@ protected: }; /** Set the fixed distance with two bodies */ -class CC_DLL PhysicsJointDistance : public PhysicsJoint +class AX_DLL PhysicsJointDistance : public PhysicsJoint { public: /** Create a fixed distance joint. @@ -298,7 +298,7 @@ protected: }; /** Connecting two physics bodies together with a spring. */ -class CC_DLL PhysicsJointSpring : public PhysicsJoint +class AX_DLL PhysicsJointSpring : public PhysicsJoint { public: /** Create a fixed distance joint. @@ -361,7 +361,7 @@ protected: }; /** Attach body a to a line, and attach body b to a dot. */ -class CC_DLL PhysicsJointGroove : public PhysicsJoint +class AX_DLL PhysicsJointGroove : public PhysicsJoint { public: /** Create a groove joint. @@ -409,7 +409,7 @@ protected: }; /** Likes a spring joint, but works with rotary. */ -class CC_DLL PhysicsJointRotarySpring : public PhysicsJoint +class AX_DLL PhysicsJointRotarySpring : public PhysicsJoint { public: /** Create a damped rotary spring joint. @@ -451,7 +451,7 @@ protected: }; /** Likes a limit joint, but works with rotary. */ -class CC_DLL PhysicsJointRotaryLimit : public PhysicsJoint +class AX_DLL PhysicsJointRotaryLimit : public PhysicsJoint { public: /** Create a limit rotary joint. @@ -495,7 +495,7 @@ protected: }; /** Works like a socket wrench. */ -class CC_DLL PhysicsJointRatchet : public PhysicsJoint +class AX_DLL PhysicsJointRatchet : public PhysicsJoint { public: /** Create a ratchet joint. @@ -536,7 +536,7 @@ protected: }; /** Keeps the angular velocity ratio of a pair of bodies constant. */ -class CC_DLL PhysicsJointGear : public PhysicsJoint +class AX_DLL PhysicsJointGear : public PhysicsJoint { public: /** Create a gear joint. @@ -572,7 +572,7 @@ protected: }; /** Keeps the relative angular velocity of a pair of bodies constant. */ -class CC_DLL PhysicsJointMotor : public PhysicsJoint +class AX_DLL PhysicsJointMotor : public PhysicsJoint { public: /** Create a motor joint. @@ -603,5 +603,5 @@ protected: NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif // __CCPHYSICS_JOINT_H__ diff --git a/core/physics/CCPhysicsShape.cpp b/core/physics/CCPhysicsShape.cpp index 607fa2074a..79f4039abe 100644 --- a/core/physics/CCPhysicsShape.cpp +++ b/core/physics/CCPhysicsShape.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "physics/CCPhysicsShape.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include # include @@ -288,7 +288,7 @@ PhysicsShapeCircle* PhysicsShapeCircle::create(float radius, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -301,7 +301,7 @@ bool PhysicsShapeCircle::init(float radius, _type = Type::CIRCLE; auto shape = cpCircleShapeNew(s_sharedBody, radius, PhysicsHelper::vec22cpv(offset)); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); @@ -380,7 +380,7 @@ PhysicsShapeEdgeSegment* PhysicsShapeEdgeSegment::create(const Vec2& a, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -394,7 +394,7 @@ bool PhysicsShapeEdgeSegment::init(const Vec2& a, _type = Type::EDGESEGMENT; auto shape = cpSegmentShapeNew(s_sharedBody, PhysicsHelper::vec22cpv(a), PhysicsHelper::vec22cpv(b), border); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); @@ -457,7 +457,7 @@ PhysicsShapeBox* PhysicsShapeBox::create(const Vec2& size, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -479,7 +479,7 @@ bool PhysicsShapeBox::init(const Vec2& size, cpTransform transform = cpTransformTranslate(PhysicsHelper::vec22cpv(offset)); auto shape = cpPolyShapeNew(s_sharedBody, 4, vec, transform, radius); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); @@ -517,7 +517,7 @@ PhysicsShapePolygon* PhysicsShapePolygon::create(const Vec2* points, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -536,9 +536,9 @@ bool PhysicsShapePolygon::init(const Vec2* points, // 0); cpTransform transform = cpTransformTranslate(PhysicsHelper::vec22cpv(offset)); auto shape = cpPolyShapeNew(s_sharedBody, count, vecs, transform, radius); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); @@ -560,7 +560,7 @@ float PhysicsShapePolygon::calculateArea(const Vec2* points, int count) cpVect* vecs = new cpVect[count]; PhysicsHelper::points2cpvs(points, vecs, count); float area = PhysicsHelper::cpfloat2float(cpAreaForPoly(count, vecs, 0.0f)); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); return area; } @@ -573,7 +573,7 @@ float PhysicsShapePolygon::calculateMoment(float mass, const Vec2* points, int c mass == PHYSICS_INFINITY ? PHYSICS_INFINITY : PhysicsHelper::cpfloat2float(cpMomentForPoly(mass, count, vecs, PhysicsHelper::vec22cpv(offset), radius)); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); return moment; } @@ -586,7 +586,7 @@ float PhysicsShapePolygon::calculateArea() for (int i = 0; i < count; ++i) vecs[i] = cpPolyShapeGetVert(shape, i); float area = PhysicsHelper::cpfloat2float(cpAreaForPoly(count, vecs, cpPolyShapeGetRadius(shape))); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); return area; } @@ -605,7 +605,7 @@ float PhysicsShapePolygon::calculateDefaultMoment() vecs[i] = cpPolyShapeGetVert(shape, i); float moment = PhysicsHelper::cpfloat2float(cpMomentForPoly(_mass, count, vecs, cpvzero, cpPolyShapeGetRadius(shape))); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); return moment; } } @@ -623,7 +623,7 @@ void PhysicsShapePolygon::getPoints(Vec2* outPoints) const for (int i = 0; i < count; ++i) vecs[i] = cpPolyShapeGetVert(shape, i); PhysicsHelper::cpvs2points(vecs, outPoints, count); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); } int PhysicsShapePolygon::getPointsCount() const @@ -640,7 +640,7 @@ Vec2 PhysicsShapePolygon::getCenter() vecs[i] = cpPolyShapeGetVert(shape, i); Vec2 center = PhysicsHelper::cpv2vec2(cpCentroidForPoly(count, vecs)); - CC_SAFE_DELETE_ARRAY(vecs); + AX_SAFE_DELETE_ARRAY(vecs); return center; } @@ -674,7 +674,7 @@ void PhysicsShapePolygon::updateScale() } cpPolyShapeSetVertsRaw(shape, count, vects); - CC_SAFE_DELETE_ARRAY(vects); + AX_SAFE_DELETE_ARRAY(vects); PhysicsShape::updateScale(); } @@ -692,7 +692,7 @@ PhysicsShapeEdgeBox* PhysicsShapeEdgeBox::create(const Vec2& size, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -715,11 +715,11 @@ bool PhysicsShapeEdgeBox::init(const Vec2& size, for (; i < 4; ++i) { auto shape = cpSegmentShapeNew(s_sharedBody, vec[i], vec[(i + 1) % 4], border); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); addShape(shape); } - CC_BREAK_IF(i < 4); + AX_BREAK_IF(i < 4); _mass = PHYSICS_INFINITY; _moment = PHYSICS_INFINITY; @@ -745,7 +745,7 @@ PhysicsShapeEdgePolygon* PhysicsShapeEdgePolygon::create(const Vec2* points, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -766,15 +766,15 @@ bool PhysicsShapeEdgePolygon::init(const Vec2* points, for (; i < count; ++i) { auto shape = cpSegmentShapeNew(s_sharedBody, vec[i], vec[(i + 1) % count], border); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); cpShapeSetElasticity(shape, 1.0f); cpShapeSetFriction(shape, 1.0f); addShape(shape); } - CC_SAFE_DELETE_ARRAY(vec); + AX_SAFE_DELETE_ARRAY(vec); - CC_BREAK_IF(i < count); + AX_BREAK_IF(i < count); _mass = PHYSICS_INFINITY; _moment = PHYSICS_INFINITY; @@ -784,7 +784,7 @@ bool PhysicsShapeEdgePolygon::init(const Vec2* points, return true; } while (false); - CC_SAFE_DELETE_ARRAY(vec); + AX_SAFE_DELETE_ARRAY(vec); return false; } @@ -832,7 +832,7 @@ PhysicsShapeEdgeChain* PhysicsShapeEdgeChain::create(const Vec2* points, return shape; } - CC_SAFE_DELETE(shape); + AX_SAFE_DELETE(shape); return nullptr; } @@ -872,14 +872,14 @@ bool PhysicsShapeEdgeChain::init(const Vec2* points, for (; i < count - 1; ++i) { auto shape = cpSegmentShapeNew(s_sharedBody, vec[i], vec[i + 1], border); - CC_BREAK_IF(shape == nullptr); + AX_BREAK_IF(shape == nullptr); cpShapeSetUserData(shape, this); cpShapeSetElasticity(shape, 1.0f); cpShapeSetFriction(shape, 1.0f); addShape(shape); } - CC_SAFE_DELETE_ARRAY(vec); - CC_BREAK_IF(i < count - 1); + AX_SAFE_DELETE_ARRAY(vec); + AX_BREAK_IF(i < count - 1); _mass = PHYSICS_INFINITY; _moment = PHYSICS_INFINITY; @@ -889,7 +889,7 @@ bool PhysicsShapeEdgeChain::init(const Vec2* points, return true; } while (false); - CC_SAFE_DELETE_ARRAY(vec); + AX_SAFE_DELETE_ARRAY(vec); return false; } @@ -975,4 +975,4 @@ bool PhysicsShape::containsPoint(const Vec2& point) const NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS diff --git a/core/physics/CCPhysicsShape.h b/core/physics/CCPhysicsShape.h index dba8bcb012..6819123b00 100644 --- a/core/physics/CCPhysicsShape.h +++ b/core/physics/CCPhysicsShape.h @@ -28,7 +28,7 @@ #define __CCPHYSICS_SHAPE_H__ #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "base/CCRef.h" # include "math/CCMath.h" @@ -39,7 +39,7 @@ NS_AX_BEGIN class PhysicsBody; -typedef struct CC_DLL PhysicsMaterial +typedef struct AX_DLL PhysicsMaterial { float density; ///< The density of the object. float restitution; ///< The bounciness of the physics body. @@ -66,7 +66,7 @@ const PhysicsMaterial PHYSICSSHAPE_MATERIAL_DEFAULT; * @brief A shape for body. You do not create PhysicsWorld objects directly, instead, you can view PhysicsBody to see * how to create it. */ -class CC_DLL PhysicsShape : public Ref +class AX_DLL PhysicsShape : public Ref { public: enum class Type @@ -383,7 +383,7 @@ protected: }; /** A circle shape. */ -class CC_DLL PhysicsShapeCircle : public PhysicsShape +class AX_DLL PhysicsShapeCircle : public PhysicsShape { public: /** @@ -450,7 +450,7 @@ protected: }; /** A polygon shape. */ -class CC_DLL PhysicsShapePolygon : public PhysicsShape +class AX_DLL PhysicsShapePolygon : public PhysicsShape { public: /** @@ -543,7 +543,7 @@ protected: }; /** A box shape. */ -class CC_DLL PhysicsShapeBox : public PhysicsShapePolygon +class AX_DLL PhysicsShapeBox : public PhysicsShapePolygon { public: /** @@ -585,7 +585,7 @@ protected: }; /** A segment shape. */ -class CC_DLL PhysicsShapeEdgeSegment : public PhysicsShape +class AX_DLL PhysicsShapeEdgeSegment : public PhysicsShape { public: /** @@ -638,7 +638,7 @@ protected: }; /** An edge polygon shape. */ -class CC_DLL PhysicsShapeEdgePolygon : public PhysicsShape +class AX_DLL PhysicsShapeEdgePolygon : public PhysicsShape { public: /** @@ -691,7 +691,7 @@ protected: }; /** An edge box shape. */ -class CC_DLL PhysicsShapeEdgeBox : public PhysicsShapeEdgePolygon +class AX_DLL PhysicsShapeEdgeBox : public PhysicsShapeEdgePolygon { public: /** @@ -729,7 +729,7 @@ protected: }; /** A chain shape. */ -class CC_DLL PhysicsShapeEdgeChain : public PhysicsShape +class AX_DLL PhysicsShapeEdgeChain : public PhysicsShape { public: /** @@ -786,5 +786,5 @@ protected: NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif // __CCPHYSICS_FIXTURE_H__ diff --git a/core/physics/CCPhysicsWorld.cpp b/core/physics/CCPhysicsWorld.cpp index 5048072c6b..db59f92dfe 100644 --- a/core/physics/CCPhysicsWorld.cpp +++ b/core/physics/CCPhysicsWorld.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "physics/CCPhysicsWorld.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include # include @@ -115,7 +115,7 @@ cpBool PhysicsWorldCallback::collisionBeginCallbackFunc(cpArbiter* arb, struct c PhysicsShape* shapeA = static_cast(cpShapeGetUserData(a)); PhysicsShape* shapeB = static_cast(cpShapeGetUserData(b)); - CC_ASSERT(shapeA != nullptr && shapeB != nullptr); + AX_ASSERT(shapeA != nullptr && shapeB != nullptr); auto contact = PhysicsContact::construct(shapeA, shapeB); cpArbiterSetUserData(arb, contact); @@ -155,7 +155,7 @@ void PhysicsWorldCallback::rayCastCallbackFunc(cpShape* shape, } PhysicsShape* physicsShape = static_cast(cpShapeGetUserData(shape)); - CC_ASSERT(physicsShape != nullptr); + AX_ASSERT(physicsShape != nullptr); PhysicsRayCastInfo callbackInfo = { physicsShape, @@ -172,7 +172,7 @@ void PhysicsWorldCallback::rayCastCallbackFunc(cpShape* shape, void PhysicsWorldCallback::queryRectCallbackFunc(cpShape* shape, RectQueryCallbackInfo* info) { PhysicsShape* physicsShape = static_cast(cpShapeGetUserData(shape)); - CC_ASSERT(physicsShape != nullptr); + AX_ASSERT(physicsShape != nullptr); if (!PhysicsWorldCallback::continues) { @@ -189,7 +189,7 @@ void PhysicsWorldCallback::getShapesAtPointFunc(cpShape* shape, Vector* arr) { PhysicsShape* physicsShape = static_cast(cpShapeGetUserData(shape)); - CC_ASSERT(physicsShape != nullptr); + AX_ASSERT(physicsShape != nullptr); arr->pushBack(physicsShape); } @@ -200,7 +200,7 @@ void PhysicsWorldCallback::queryPointFunc(cpShape* shape, PointQueryCallbackInfo* info) { PhysicsShape* physicsShape = static_cast(cpShapeGetUserData(shape)); - CC_ASSERT(physicsShape != nullptr); + AX_ASSERT(physicsShape != nullptr); PhysicsWorldCallback::continues = info->func(*info->world, *physicsShape, info->data); } @@ -518,13 +518,13 @@ bool PhysicsWorld::init() { do { -# if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +# if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 _cpSpace = cpSpaceNew(); # else _cpSpace = cpHastySpaceNew(); cpHastySpaceSetThreads(_cpSpace, 0); # endif - CC_BREAK_IF(_cpSpace == nullptr); + AX_BREAK_IF(_cpSpace == nullptr); cpSpaceSetGravity(_cpSpace, PhysicsHelper::vec22cpv(_gravity)); @@ -652,7 +652,7 @@ void PhysicsWorld::removeBody(PhysicsBody* body) void PhysicsWorld::removeBodyOrDelay(PhysicsBody* body) { - if (_delayAddBodies.getIndex(body) != CC_INVALID_INDEX) + if (_delayAddBodies.getIndex(body) != AX_INVALID_INDEX) { _delayAddBodies.eraseObject(body); return; @@ -660,7 +660,7 @@ void PhysicsWorld::removeBodyOrDelay(PhysicsBody* body) if (cpSpaceIsLocked(_cpSpace)) { - if (_delayRemoveBodies.getIndex(body) == CC_INVALID_INDEX) + if (_delayRemoveBodies.getIndex(body) == AX_INVALID_INDEX) { _delayRemoveBodies.pushBack(body); } @@ -855,7 +855,7 @@ void PhysicsWorld::setDebugDrawMask(int mask) if (mask == DEBUGDRAW_NONE && _debugDraw) { _debugDraw->removeFromParent(); - CC_SAFE_RELEASE_NULL(_debugDraw); + AX_SAFE_RELEASE_NULL(_debugDraw); } _debugDrawMask = mask; @@ -939,7 +939,7 @@ void PhysicsWorld::update(float delta, bool userCall /* = false*/) if (userCall) { -# if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +# if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 cpSpaceStep(_cpSpace, delta); # else cpHastySpaceStep(_cpSpace, delta); @@ -955,7 +955,7 @@ void PhysicsWorld::update(float delta, bool userCall /* = false*/) while (_updateTime > step) { _updateTime -= step; -# if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +# if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 cpSpaceStep(_cpSpace, dt); # else cpHastySpaceStep(_cpSpace, dt); @@ -969,7 +969,7 @@ void PhysicsWorld::update(float delta, bool userCall /* = false*/) const float dt = _updateTime * _speed / _substeps; for (int i = 0; i < _substeps; ++i) { -# if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +# if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 cpSpaceStep(_cpSpace, dt); # else cpHastySpaceStep(_cpSpace, dt); @@ -1008,7 +1008,7 @@ PhysicsWorld* PhysicsWorld::construct(Scene* scene) return world; } - CC_SAFE_DELETE(world); + AX_SAFE_DELETE(world); return nullptr; } @@ -1035,13 +1035,13 @@ PhysicsWorld::~PhysicsWorld() removeAllBodies(); if (_cpSpace) { -# if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +# if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 cpSpaceFree(_cpSpace); # else cpHastySpaceFree(_cpSpace); # endif } - CC_SAFE_RELEASE_NULL(_debugDraw); + AX_SAFE_RELEASE_NULL(_debugDraw); } void PhysicsWorld::beforeSimulation(Node* node, @@ -1093,4 +1093,4 @@ void PhysicsWorld::setPreUpdateCallback(const std::function& callback) NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS diff --git a/core/physics/CCPhysicsWorld.h b/core/physics/CCPhysicsWorld.h index 43c7b1e7d3..df35cb6b9a 100644 --- a/core/physics/CCPhysicsWorld.h +++ b/core/physics/CCPhysicsWorld.h @@ -27,7 +27,7 @@ #define __CCPHYSICS_WORLD_H__ #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include # include "base/CCVector.h" @@ -97,7 +97,7 @@ typedef PhysicsQueryRectCallbackFunc PhysicsQueryPointCallbackFunc; * @brief An PhysicsWorld object simulates collisions and other physical properties. You do not create PhysicsWorld * objects directly; instead, you can get it from an Scene object. */ -class CC_DLL PhysicsWorld +class AX_DLL PhysicsWorld { public: static const int DEBUGDRAW_NONE; ///< draw nothing @@ -449,12 +449,12 @@ protected: friend class PhysicsDebugDraw; }; -extern const float CC_DLL PHYSICS_INFINITY; +extern const float AX_DLL PHYSICS_INFINITY; /** @} */ /** @} */ NS_AX_END -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif // __CCPHYSICS_WORLD_H__ diff --git a/core/physics3d/CCPhysics3D.cpp b/core/physics3d/CCPhysics3D.cpp index 2c6127d1dc..fcddebf429 100644 --- a/core/physics3d/CCPhysics3D.cpp +++ b/core/physics3d/CCPhysics3D.cpp @@ -25,15 +25,15 @@ #include "physics3d/CCPhysics3D.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN -CC_DLL const char* physics3dVersion() +AX_DLL const char* physics3dVersion() { -# if CC_ENABLE_BULLET_INTEGRATION +# if AX_ENABLE_BULLET_INTEGRATION return "bullet2.82"; # endif } @@ -91,6 +91,6 @@ btQuaternion convertQuatTobtQuat(const axis::Quaternion& quat) return btQuaternion(quat.x, quat.y, quat.z, quat.w); } -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3D.h b/core/physics3d/CCPhysics3D.h index 5a0bb139ea..23323ea307 100644 --- a/core/physics3d/CCPhysics3D.h +++ b/core/physics3d/CCPhysics3D.h @@ -29,7 +29,7 @@ #include "base/ccConfig.h" #include "math/CCMath.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS # include "physics3d/CCPhysics3DShape.h" # include "physics3d/CCPhysicsMeshRenderer.h" @@ -41,11 +41,11 @@ NS_AX_BEGIN -CC_DLL const char* physics3dVersion(); +AX_DLL const char* physics3dVersion(); NS_AX_END -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) // include bullet header files # include "bullet/LinearMath/btTransform.h" @@ -64,8 +64,8 @@ btTransform convertMat4TobtTransform(const axis::Mat4& mat4); axis::Quaternion convertbtQuatToQuat(const btQuaternion& btQuat); btQuaternion convertQuatTobtQuat(const axis::Quaternion& quat); -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_H__ diff --git a/core/physics3d/CCPhysics3DComponent.cpp b/core/physics3d/CCPhysics3DComponent.cpp index f143cbfd7d..96737d9135 100644 --- a/core/physics3d/CCPhysics3DComponent.cpp +++ b/core/physics3d/CCPhysics3DComponent.cpp @@ -27,15 +27,15 @@ THE SOFTWARE. #include "2d/CCNode.h" #include "2d/CCScene.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN Physics3DComponent::~Physics3DComponent() { - CC_SAFE_RELEASE(_physics3DObj); + AX_SAFE_RELEASE(_physics3DObj); } std::string& Physics3DComponent::getPhysics3DComponentName() @@ -62,14 +62,14 @@ Physics3DComponent* Physics3DComponent::create(Physics3DObject* physicsObj, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } void Physics3DComponent::setPhysics3DObject(Physics3DObject* physicsObj) { - CC_SAFE_RETAIN(physicsObj); - CC_SAFE_RELEASE(_physics3DObj); + AX_SAFE_RETAIN(physicsObj); + AX_SAFE_RELEASE(_physics3DObj); _physics3DObj = physicsObj; } @@ -250,6 +250,6 @@ void Physics3DComponent::syncNodeToPhysics() NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DComponent.h b/core/physics3d/CCPhysics3DComponent.h index 95bd325612..b6c8c6f63e 100644 --- a/core/physics3d/CCPhysics3DComponent.h +++ b/core/physics3d/CCPhysics3DComponent.h @@ -31,9 +31,9 @@ #include "2d/CCComponent.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -47,7 +47,7 @@ class Physics3DWorld; /** @brief Physics3DComponent: A component with 3D physics, you can add a rigid body to it, and then add this component * to a node, the node will move and rotate with this rigid body */ -class CC_DLL Physics3DComponent : public axis::Component +class AX_DLL Physics3DComponent : public axis::Component { friend class Physics3DWorld; @@ -143,8 +143,8 @@ protected: /// @} NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_COMPONENT_H__ diff --git a/core/physics3d/CCPhysics3DConstraint.cpp b/core/physics3d/CCPhysics3DConstraint.cpp index ef0ff76172..67f94ce3f1 100644 --- a/core/physics3d/CCPhysics3DConstraint.cpp +++ b/core/physics3d/CCPhysics3DConstraint.cpp @@ -25,9 +25,9 @@ #include "physics3d/CCPhysics3D.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -41,9 +41,9 @@ Physics3DConstraint::Physics3DConstraint() Physics3DConstraint::~Physics3DConstraint() { - CC_SAFE_RELEASE(_bodyA); - CC_SAFE_RELEASE(_bodyB); - CC_SAFE_DELETE(_constraint); + AX_SAFE_RELEASE(_bodyA); + AX_SAFE_RELEASE(_bodyB); + AX_SAFE_DELETE(_constraint); } float Physics3DConstraint::getBreakingImpulse() const @@ -89,7 +89,7 @@ Physics3DPointToPointConstraint* Physics3DPointToPointConstraint::create(Physics return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -105,7 +105,7 @@ Physics3DPointToPointConstraint* Physics3DPointToPointConstraint::create(Physics return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -880,6 +880,6 @@ void Physics3D6DofConstraint::setUseFrameOffset(bool frameOffsetOnOff) const NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DConstraint.h b/core/physics3d/CCPhysics3DConstraint.h index 72404c0bed..020bacc62f 100644 --- a/core/physics3d/CCPhysics3DConstraint.h +++ b/core/physics3d/CCPhysics3DConstraint.h @@ -30,9 +30,9 @@ #include "base/CCRef.h" #include "base/ccConfig.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) class btTypedConstraint; @@ -47,7 +47,7 @@ class Physics3DRigidBody; /** @brief Physics3DConstraint: Constraint affects the movement of physics object, it usually connect one or two physics * object. There are some types of physics constraints. */ -class CC_DLL Physics3DConstraint : public Ref +class AX_DLL Physics3DConstraint : public Ref { public: enum class ConstraintType @@ -115,7 +115,7 @@ public: */ void setOverrideNumSolverIterations(int overrideNumIterations); -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) btTypedConstraint* getbtContraint() { return _constraint; } # endif @@ -135,7 +135,7 @@ protected: /** * Point to point constraint limits the translation so that the local pivot points of 2 rigidbodies match in worldspace. */ -class CC_DLL Physics3DPointToPointConstraint : public Physics3DConstraint +class AX_DLL Physics3DPointToPointConstraint : public Physics3DConstraint { public: /** @@ -193,7 +193,7 @@ public: * the hinge axis. This can be useful to represent doors or wheels rotating around one axis. hinge constraint between * two rigidbodies each with a pivotpoint that describes the axis location in local space */ -class CC_DLL Physics3DHingeConstraint : public Physics3DConstraint +class AX_DLL Physics3DHingeConstraint : public Physics3DConstraint { public: /** @@ -334,7 +334,7 @@ public: * LimAng - hitting angular limit * OrthoLin, OrthoAng - against constraint axis */ -class CC_DLL Physics3DSliderConstraint : public Physics3DConstraint +class AX_DLL Physics3DSliderConstraint : public Physics3DConstraint { public: /** @@ -441,7 +441,7 @@ public: /** * It is a special point to point constraint that adds cone and twist axis limits. The x-axis serves as twist axis. */ -class CC_DLL Physics3DConeTwistConstraint : public Physics3DConstraint +class AX_DLL Physics3DConeTwistConstraint : public Physics3DConstraint { public: /** @@ -544,7 +544,7 @@ public: * Lowerlimit > Upperlimit -> axis is free * Lowerlimit < Upperlimit -> axis it limited in that range */ -class CC_DLL Physics3D6DofConstraint : public Physics3DConstraint +class AX_DLL Physics3D6DofConstraint : public Physics3DConstraint { public: /** @@ -615,8 +615,8 @@ public: NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_CONSTRAINT_H__ diff --git a/core/physics3d/CCPhysics3DDebugDrawer.cpp b/core/physics3d/CCPhysics3DDebugDrawer.cpp index 1f9f336742..926e1c27aa 100644 --- a/core/physics3d/CCPhysics3DDebugDrawer.cpp +++ b/core/physics3d/CCPhysics3DDebugDrawer.cpp @@ -34,9 +34,9 @@ #include "renderer/ccShaders.h" #include "renderer/backend/Buffer.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -110,7 +110,7 @@ void Physics3DDebugDrawer::draw(Renderer* renderer) _customCommand.setVertexDrawInfo(0, _buffer.size()); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _buffer.size()); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _buffer.size()); renderer->addCommand(&_customCommand); } @@ -122,12 +122,12 @@ Physics3DDebugDrawer::Physics3DDebugDrawer() Physics3DDebugDrawer::~Physics3DDebugDrawer() { - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); } void Physics3DDebugDrawer::init() { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_COLOR); _programState = new backend::ProgramState(program); _locMVP = _programState->getUniformLocation("u_MVPMatrix"); @@ -148,8 +148,8 @@ void Physics3DDebugDrawer::init() _customCommand.getPipelineDescriptor().programState = _programState; _customCommand.setPrimitiveType(CustomCommand::PrimitiveType::LINE); _customCommand.setDrawType(CustomCommand::DrawType::ARRAY); - _customCommand.setBeforeCallback(CC_CALLBACK_0(Physics3DDebugDrawer::onBeforeDraw, this)); - _customCommand.setAfterCallback(CC_CALLBACK_0(Physics3DDebugDrawer::onAfterDraw, this)); + _customCommand.setBeforeCallback(AX_CALLBACK_0(Physics3DDebugDrawer::onBeforeDraw, this)); + _customCommand.setAfterCallback(AX_CALLBACK_0(Physics3DDebugDrawer::onAfterDraw, this)); } void Physics3DDebugDrawer::onBeforeDraw() @@ -172,6 +172,6 @@ void Physics3DDebugDrawer::clear() NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DDebugDrawer.h b/core/physics3d/CCPhysics3DDebugDrawer.h index 69ad88b7e0..8587b20a25 100644 --- a/core/physics3d/CCPhysics3DDebugDrawer.h +++ b/core/physics3d/CCPhysics3DDebugDrawer.h @@ -34,9 +34,9 @@ #include "renderer/backend/ProgramState.h" #include "renderer/backend/Types.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) # include "bullet/LinearMath/btIDebugDraw.h" NS_AX_BEGIN @@ -102,8 +102,8 @@ private: NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_VIEWER_H__ diff --git a/core/physics3d/CCPhysics3DObject.cpp b/core/physics3d/CCPhysics3DObject.cpp index 366ffd4647..81ae7c3214 100644 --- a/core/physics3d/CCPhysics3DObject.cpp +++ b/core/physics3d/CCPhysics3DObject.cpp @@ -26,9 +26,9 @@ #include "physics3d/CCPhysics3D.h" #include "base/ccUTF8.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) # include "bullet/btBulletCollisionCommon.h" # include "bullet/btBulletDynamicsCommon.h" @@ -48,9 +48,9 @@ Physics3DRigidBody::~Physics3DRigidBody() _constraintList.clear(); } auto ms = _btRigidBody->getMotionState(); - CC_SAFE_DELETE(ms); - CC_SAFE_DELETE(_btRigidBody); - CC_SAFE_RELEASE(_physics3DShape); + AX_SAFE_DELETE(ms); + AX_SAFE_DELETE(_btRigidBody); + AX_SAFE_RELEASE(_physics3DShape); } Physics3DRigidBody* Physics3DRigidBody::create(Physics3DRigidBodyDes* info) @@ -62,7 +62,7 @@ Physics3DRigidBody* Physics3DRigidBody::create(Physics3DRigidBodyDes* info) return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -436,8 +436,8 @@ Physics3DCollider::Physics3DCollider() : _btGhostObject(nullptr), _physics3DShap Physics3DCollider::~Physics3DCollider() { - CC_SAFE_DELETE(_btGhostObject); - CC_SAFE_RELEASE(_physics3DShape); + AX_SAFE_DELETE(_btGhostObject); + AX_SAFE_RELEASE(_physics3DShape); } Physics3DCollider* Physics3DCollider::create(Physics3DColliderDes* info) @@ -449,7 +449,7 @@ Physics3DCollider* Physics3DCollider::create(Physics3DColliderDes* info) return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -551,6 +551,6 @@ axis::Mat4 Physics3DCollider::getWorldTransform() const NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DObject.h b/core/physics3d/CCPhysics3DObject.h index a929fba0b9..eb4ec27c05 100644 --- a/core/physics3d/CCPhysics3DObject.h +++ b/core/physics3d/CCPhysics3DObject.h @@ -32,9 +32,9 @@ #include -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) class btCollisionShape; class btRigidBody; @@ -54,7 +54,7 @@ class Physics3DObject; /** * @brief The collision information of Physics3DObject. */ -struct CC_DLL Physics3DCollisionInfo +struct AX_DLL Physics3DCollisionInfo { struct CollisionPoint { @@ -72,7 +72,7 @@ struct CC_DLL Physics3DCollisionInfo /** * @brief Inherit from Ref, base class */ -class CC_DLL Physics3DObject : public Ref +class AX_DLL Physics3DObject : public Ref { public: typedef std::function CollisionCallbackFunc; @@ -134,7 +134,7 @@ protected: /** * @brief The description of Physics3DRigidBody. */ -struct CC_DLL Physics3DRigidBodyDes +struct AX_DLL Physics3DRigidBodyDes { float mass; // Note: mass equals zero means static, default 0 axis::Vec3 localInertia; // default (0, 0, 0) @@ -148,7 +148,7 @@ struct CC_DLL Physics3DRigidBodyDes /** * @brief Inherit from Physics3DObject, the main class for rigid body objects */ -class CC_DLL Physics3DRigidBody : public Physics3DObject +class AX_DLL Physics3DRigidBody : public Physics3DObject { friend class Physics3DWorld; @@ -349,7 +349,7 @@ protected: /** * @brief The description of Physics3DCollider. */ -struct CC_DLL Physics3DColliderDes +struct AX_DLL Physics3DColliderDes { /**shape pointer*/ Physics3DShape* shape; @@ -385,7 +385,7 @@ struct CC_DLL Physics3DColliderDes /** * @brief Inherit from Physics3DObject, the main class for Colliders. */ -class CC_DLL Physics3DCollider : public Physics3DObject +class AX_DLL Physics3DCollider : public Physics3DObject { public: /** @@ -495,8 +495,8 @@ protected: NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_OBJECT_H__ diff --git a/core/physics3d/CCPhysics3DShape.cpp b/core/physics3d/CCPhysics3DShape.cpp index cef34c3717..10eed4ac3e 100644 --- a/core/physics3d/CCPhysics3DShape.cpp +++ b/core/physics3d/CCPhysics3DShape.cpp @@ -25,9 +25,9 @@ #include "physics3d/CCPhysics3D.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) # include "bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h" NS_AX_BEGIN @@ -39,19 +39,19 @@ Physics3DShape::ShapeType Physics3DShape::getShapeType() const Physics3DShape::Physics3DShape() : _shapeType(ShapeType::UNKNOWN) { -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) _btShape = nullptr; _heightfieldData = nullptr; # endif } Physics3DShape::~Physics3DShape() { -# if (CC_ENABLE_BULLET_INTEGRATION) - CC_SAFE_DELETE(_btShape); - CC_SAFE_DELETE_ARRAY(_heightfieldData); +# if (AX_ENABLE_BULLET_INTEGRATION) + AX_SAFE_DELETE(_btShape); + AX_SAFE_DELETE_ARRAY(_heightfieldData); for (auto iter : _compoundChildShapes) { - CC_SAFE_RELEASE(iter); + AX_SAFE_RELEASE(iter); } _compoundChildShapes.clear(); # endif @@ -209,7 +209,7 @@ bool Physics3DShape::initCompoundShape(const std::vectoraddChildShape(convertMat4TobtTransform(iter.second), iter.first->getbtShape()); - CC_SAFE_RETAIN(iter.first); + AX_SAFE_RETAIN(iter.first); _compoundChildShapes.push_back(iter.first); } _btShape = compound; @@ -218,6 +218,6 @@ bool Physics3DShape::initCompoundShape(const std::vector>& shapes); -# if CC_ENABLE_BULLET_INTEGRATION +# if AX_ENABLE_BULLET_INTEGRATION btCollisionShape* getbtShape() const { return _btShape; } # endif @@ -158,7 +158,7 @@ public: protected: ShapeType _shapeType; // shape type -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) btCollisionShape* _btShape; unsigned char* _heightfieldData; std::vector _compoundChildShapes; @@ -170,8 +170,8 @@ protected: NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_SHAPE_H__ diff --git a/core/physics3d/CCPhysics3DWorld.cpp b/core/physics3d/CCPhysics3DWorld.cpp index c0b1911730..1ccffe709d 100644 --- a/core/physics3d/CCPhysics3DWorld.cpp +++ b/core/physics3d/CCPhysics3DWorld.cpp @@ -26,9 +26,9 @@ #include "physics3d/CCPhysics3D.h" #include "renderer/CCRenderer.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -49,13 +49,13 @@ Physics3DWorld::~Physics3DWorld() removeAllPhysics3DConstraints(); removeAllPhysics3DObjects(); - CC_SAFE_DELETE(_collisionConfiguration); - CC_SAFE_DELETE(_dispatcher); - CC_SAFE_DELETE(_broadphase); - CC_SAFE_DELETE(_ghostCallback); - CC_SAFE_DELETE(_solver); - CC_SAFE_DELETE(_btPhyiscsWorld); - CC_SAFE_DELETE(_debugDrawer); + AX_SAFE_DELETE(_collisionConfiguration); + AX_SAFE_DELETE(_dispatcher); + AX_SAFE_DELETE(_broadphase); + AX_SAFE_DELETE(_ghostCallback); + AX_SAFE_DELETE(_solver); + AX_SAFE_DELETE(_btPhyiscsWorld); + AX_SAFE_DELETE(_debugDrawer); for (auto it : _physicsComponents) it->setPhysics3DObject(nullptr); _physicsComponents.clear(); @@ -309,7 +309,7 @@ bool Physics3DWorld::sweepShape(Physics3DShape* shape, const axis::Mat4& endTransform, Physics3DWorld::HitResult* result) { - CC_ASSERT(shape->getShapeType() != Physics3DShape::ShapeType::HEIGHT_FIELD && + AX_ASSERT(shape->getShapeType() != Physics3DShape::ShapeType::HEIGHT_FIELD && shape->getShapeType() != Physics3DShape::ShapeType::MESH); auto btStart = convertMat4TobtTransform(startTransform); auto btEnd = convertMat4TobtTransform(endTransform); @@ -423,6 +423,6 @@ void Physics3DWorld::setGhostPairCallback() NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysics3DWorld.h b/core/physics3d/CCPhysics3DWorld.h index 542e2c0186..47fb72521d 100644 --- a/core/physics3d/CCPhysics3DWorld.h +++ b/core/physics3d/CCPhysics3DWorld.h @@ -30,9 +30,9 @@ #include "base/CCRef.h" #include "base/ccConfig.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) class btDynamicsWorld; class btDefaultCollisionConfiguration; @@ -59,7 +59,7 @@ class Renderer; /** * @brief The description of Physics3DWorld. */ -struct CC_DLL Physics3DWorldDes +struct AX_DLL Physics3DWorldDes { bool isDebugDrawEnabled; // using physics debug draw?, false by default axis::Vec3 gravity; // gravity, (0, -9.8, 0) @@ -74,7 +74,7 @@ struct CC_DLL Physics3DWorldDes * @brief The physics information container, include Physics3DObjects, Physics3DConstraints, collision information and * so on. */ -class CC_DLL Physics3DWorld : public Ref +class AX_DLL Physics3DWorld : public Ref { friend class Physics3DComponent; @@ -167,7 +167,7 @@ protected: bool _collisionCheckingFlag; bool _needGhostPairCallbackChecking; -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) btDynamicsWorld* _btPhyiscsWorld; btDefaultCollisionConfiguration* _collisionConfiguration; btCollisionDispatcher* _dispatcher; @@ -175,7 +175,7 @@ protected: btSequentialImpulseConstraintSolver* _solver; btGhostPairCallback* _ghostCallback; Physics3DDebugDrawer* _debugDrawer; -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION }; // end of 3d group @@ -184,6 +184,6 @@ NS_AX_END # endif -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_3D_WORLD_H__ diff --git a/core/physics3d/CCPhysicsMeshRenderer.cpp b/core/physics3d/CCPhysicsMeshRenderer.cpp index 5fdef7d474..3dcd41a611 100644 --- a/core/physics3d/CCPhysicsMeshRenderer.cpp +++ b/core/physics3d/CCPhysicsMeshRenderer.cpp @@ -25,9 +25,9 @@ #include "physics3d/CCPhysics3D.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN @@ -46,7 +46,7 @@ PhysicsMeshRenderer* PhysicsMeshRenderer::create(std::string_view modelPath, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -65,7 +65,7 @@ PhysicsMeshRenderer* PhysicsMeshRenderer::createWithCollider(std::string_view mo ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -97,6 +97,6 @@ PhysicsMeshRenderer::~PhysicsMeshRenderer() {} NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS diff --git a/core/physics3d/CCPhysicsMeshRenderer.h b/core/physics3d/CCPhysicsMeshRenderer.h index f0bfdb6a4e..ef434b62f7 100644 --- a/core/physics3d/CCPhysicsMeshRenderer.h +++ b/core/physics3d/CCPhysicsMeshRenderer.h @@ -31,9 +31,9 @@ #include "physics3d/CCPhysics3DObject.h" #include "physics3d/CCPhysics3DComponent.h" -#if CC_USE_3D_PHYSICS +#if AX_USE_3D_PHYSICS -# if (CC_ENABLE_BULLET_INTEGRATION) +# if (AX_ENABLE_BULLET_INTEGRATION) NS_AX_BEGIN /** @@ -44,7 +44,7 @@ NS_AX_BEGIN /** * @brief Convenient class to create a rigid body with a MeshRenderer */ -class CC_DLL PhysicsMeshRenderer : public axis::MeshRenderer +class AX_DLL PhysicsMeshRenderer : public axis::MeshRenderer { public: /** creates a PhysicsMeshRenderer */ @@ -82,8 +82,8 @@ protected: /// @} NS_AX_END -# endif // CC_ENABLE_BULLET_INTEGRATION +# endif // AX_ENABLE_BULLET_INTEGRATION -#endif // CC_USE_3D_PHYSICS +#endif // AX_USE_3D_PHYSICS #endif // __PHYSICS_MESH_RENDERER_H__ diff --git a/core/platform/CCApplication.h b/core/platform/CCApplication.h index 9ab3da2ece..1d96165338 100644 --- a/core/platform/CCApplication.h +++ b/core/platform/CCApplication.h @@ -30,15 +30,15 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_MAC # include "platform/mac/CCApplication-mac.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS # include "platform/ios/CCApplication-ios.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include "platform/android/CCApplication-android.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include "platform/win32/CCApplication-win32.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#elif AX_TARGET_PLATFORM == AX_PLATFORM_LINUX # include "platform/linux/CCApplication-linux.h" #endif diff --git a/core/platform/CCApplicationProtocol.h b/core/platform/CCApplicationProtocol.h index 35bbc95631..6da7553d62 100644 --- a/core/platform/CCApplicationProtocol.h +++ b/core/platform/CCApplicationProtocol.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_APPLICATION_PROTOCOL_H__ -#define __CC_APPLICATION_PROTOCOL_H__ +#ifndef __AX_APPLICATION_PROTOCOL_H__ +#define __AX_APPLICATION_PROTOCOL_H__ #include "platform/CCPlatformMacros.h" #include "base/CCAutoreleasePool.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN * @{ */ -class CC_DLL ApplicationProtocol +class AX_DLL ApplicationProtocol { public: /** Since WINDOWS and ANDROID are defined as macros, we could not just use these keywords in enumeration(Platform). @@ -149,4 +149,4 @@ public: NS_AX_END -#endif // __CC_APPLICATION_PROTOCOL_H__ +#endif // __AX_APPLICATION_PROTOCOL_H__ diff --git a/core/platform/CCCommon.h b/core/platform/CCCommon.h index 7a182cc8b7..073f204e85 100644 --- a/core/platform/CCCommon.h +++ b/core/platform/CCCommon.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_COMMON_H__ -#define __CC_COMMON_H__ +#ifndef __AX_COMMON_H__ +#define __AX_COMMON_H__ /// @cond DO_NOT_SHOW #include "platform/CCPlatformMacros.h" @@ -40,12 +40,12 @@ NS_AX_BEGIN /** * lua can not deal with ... */ -void CC_DLL LuaLog(const char* format); +void AX_DLL LuaLog(const char* format); /** @brief Pop out a message box */ -void CC_DLL ccMessageBox(const char* msg, const char* title); +void AX_DLL ccMessageBox(const char* msg, const char* title); /** @brief Enum the language type supported now @@ -80,4 +80,4 @@ enum class LanguageType NS_AX_END /// @endcond -#endif // __CC_COMMON_H__ +#endif // __AX_COMMON_H__ diff --git a/core/platform/CCDevice.h b/core/platform/CCDevice.h index 0e24daee81..c7c21d51df 100644 --- a/core/platform/CCDevice.h +++ b/core/platform/CCDevice.h @@ -44,7 +44,7 @@ struct FontDefinition; * @class Device * @brief */ -class CC_DLL Device +class AX_DLL Device { public: /** Defines the alignment of text. */ @@ -104,7 +104,7 @@ public: bool& hasPremultipliedAlpha); private: - CC_DISALLOW_IMPLICIT_CONSTRUCTORS(Device); + AX_DISALLOW_IMPLICIT_CONSTRUCTORS(Device); }; // end group diff --git a/core/platform/CCFileStream.h b/core/platform/CCFileStream.h index 9221a9b196..7e2996acec 100644 --- a/core/platform/CCFileStream.h +++ b/core/platform/CCFileStream.h @@ -9,7 +9,7 @@ NS_AX_BEGIN -class CC_DLL FileStream +class AX_DLL FileStream { public: virtual ~FileStream() = default; diff --git a/core/platform/CCFileUtils.cpp b/core/platform/CCFileUtils.cpp index b497a1c83f..813918be96 100644 --- a/core/platform/CCFileUtils.cpp +++ b/core/platform/CCFileUtils.cpp @@ -465,7 +465,7 @@ FileUtils* FileUtils::s_sharedFileUtils = nullptr; void FileUtils::destroyInstance() { - CC_SAFE_DELETE(s_sharedFileUtils); + AX_SAFE_DELETE(s_sharedFileUtils); } void FileUtils::setDelegate(FileUtils* delegate) @@ -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 - CC_BREAK_IF(!fileStream); + AX_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 (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +# if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # if defined(__cpp_lib_char8_t) std::u8string u8path = entry.path().u8string(); std::string pathStr = {u8path.begin(), u8path.end()}; @@ -1159,7 +1159,7 @@ void FileUtils::listFilesRecursively(std::string_view dirPath, std::vector // android doesn't have ftw.h -# if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +# if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) # include # endif @@ -1307,7 +1307,7 @@ bool FileUtils::createDirectory(std::string_view path) const namespace { -# if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +# if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) int unlink_cb(const char* fpath, const struct stat* sb, int typeflag, struct FTW* ftwbuf) { int rv = remove(fpath); @@ -1322,9 +1322,9 @@ int unlink_cb(const char* fpath, const struct stat* sb, int typeflag, struct FTW bool FileUtils::removeDirectory(std::string_view path) const { -# if !defined(CC_TARGET_OS_TVOS) +# if !defined(AX_TARGET_OS_TVOS) -# if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +# if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) if (nftw(path.data(), unlink_cb, 64, FTW_DEPTH | FTW_PHYS) == -1) return false; else @@ -1337,11 +1337,11 @@ bool FileUtils::removeDirectory(std::string_view path) const return true; else return false; -# endif // (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +# endif // (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) # else return false; -# endif // !defined(CC_TARGET_OS_TVOS) +# endif // !defined(AX_TARGET_OS_TVOS) } bool FileUtils::removeFile(std::string_view path) const diff --git a/core/platform/CCFileUtils.h b/core/platform/CCFileUtils.h index bf663662af..9482b40d78 100644 --- a/core/platform/CCFileUtils.h +++ b/core/platform/CCFileUtils.h @@ -23,8 +23,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_FILEUTILS_H__ -#define __CC_FILEUTILS_H__ +#ifndef __AX_FILEUTILS_H__ +#define __AX_FILEUTILS_H__ #include #include @@ -98,7 +98,7 @@ public: }; /** Helper class to handle file operations. */ -class CC_DLL FileUtils +class AX_DLL FileUtils { public: /** @@ -943,4 +943,4 @@ protected: NS_AX_END -#endif // __CC_FILEUTILS_H__ +#endif // __AX_FILEUTILS_H__ diff --git a/core/platform/CCGL.h b/core/platform/CCGL.h index 054c5c5ac2..8e88c1dc2e 100644 --- a/core/platform/CCGL.h +++ b/core/platform/CCGL.h @@ -31,17 +31,17 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include "platform/android/CCGL-android.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include "platform/win32/CCGL-win32.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#elif AX_TARGET_PLATFORM == AX_PLATFORM_LINUX # include "platform/linux/CCGL-linux.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS # if AX_USE_COMPAT_GL # include "platform/ios/CCGL-ios.h" # endif -#elif CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#elif AX_TARGET_PLATFORM == AX_PLATFORM_MAC # if AX_USE_COMPAT_GL # include "platform/mac/CCGL-mac.h" # endif diff --git a/core/platform/CCGLView.h b/core/platform/CCGLView.h index edc6e2cf27..88c57c9c01 100644 --- a/core/platform/CCGLView.h +++ b/core/platform/CCGLView.h @@ -32,17 +32,17 @@ THE SOFTWARE. #include -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) typedef void* id; -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) -# define CC_ICON_SET_SUPPORT true -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) */ +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +# define AX_ICON_SET_SUPPORT true +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) */ /** There are some Resolution Policy for Adapt to the screen. */ enum class ResolutionPolicy @@ -108,7 +108,7 @@ class Renderer; /** * @brief By GLView you can operate the frame information of EGL view through some function. */ -class CC_DLL GLView : public Ref +class AX_DLL GLView : public Ref { public: /** @@ -219,9 +219,9 @@ public: */ virtual bool isRetinaDisplay() const { return false; } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) virtual void* getEAGLView() const { return nullptr; } -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) */ /** * Get the visible area size of opengl viewport. @@ -416,14 +416,14 @@ public: */ ResolutionPolicy getResolutionPolicy() const { return _resolutionPolicy; } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) virtual HWND getWin32Window() = 0; -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) virtual id getCocoaWindow() = 0; virtual id getNSGLContext() = 0; // stevetranby: added -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) */ /** * Renders a Scene with a Renderer diff --git a/core/platform/CCImage.cpp b/core/platform/CCImage.cpp index c47a0adb79..208492a8a4 100644 --- a/core/platform/CCImage.cpp +++ b/core/platform/CCImage.cpp @@ -32,7 +32,7 @@ THE SOFTWARE. #include #include -#include "base/ccConfig.h" // CC_USE_JPEG, CC_USE_WEBP +#include "base/ccConfig.h" // AX_USE_JPEG, AX_USE_WEBP #define STBI_NO_JPEG #define STBI_NO_PNG @@ -43,7 +43,7 @@ THE SOFTWARE. #define STBI_NO_HDR #define STBI_NO_TGA #define STB_IMAGE_IMPLEMENTATION -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS # define STBI_NO_THREAD_LOCALS #endif #include "stb/stb_image.h" @@ -51,7 +51,7 @@ THE SOFTWARE. extern "C" { // To resolve link error when building 32bits with Xcode 6. // More information please refer to the discussion in https://github.com/cocos2d/cocos2d-x/pull/6986 -#if defined(__unix) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if defined(__unix) || (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # ifndef __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ # define __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ # include @@ -93,14 +93,14 @@ struct dirent* readdir$INODE64(DIR* dir) # endif #endif -#if CC_USE_PNG +#if AX_USE_PNG # include "png.h" -#endif // CC_USE_PNG +#endif // AX_USE_PNG -#if CC_USE_JPEG +#if AX_USE_JPEG # include "jpeglib.h" # include -#endif // CC_USE_JPEG +#endif // AX_USE_JPEG } /* extern "C" */ #include "base/ktxspec_v1.h" @@ -115,9 +115,9 @@ struct dirent* readdir$INODE64(DIR* dir) #include "base/astc.h" -#if CC_USE_WEBP +#if AX_USE_WEBP # include "decode.h" -#endif // CC_USE_WEBP +#endif // AX_USE_WEBP #include "base/ccMacros.h" #include "platform/CCCommon.h" @@ -126,7 +126,7 @@ struct dirent* readdir$INODE64(DIR* dir) #include "base/CCConfiguration.h" #include "base/ccUtils.h" #include "base/ZipUtils.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "platform/android/CCFileUtils-android.h" # include "platform/CCGL.h" #endif @@ -422,7 +422,7 @@ typedef struct int offset; } tImageSource; -#if CC_USE_PNG +#if AX_USE_PNG void pngWriteCallback(png_structp png_ptr, png_bytep data, size_t length) { if (png_ptr == NULL) @@ -450,7 +450,7 @@ static void pngReadCallback(png_structp png_ptr, png_bytep data, png_size_t leng png_error(png_ptr, "pngReaderCallback failed"); } } -#endif // CC_USE_PNG +#endif // AX_USE_PNG } // namespace /* @@ -567,12 +567,12 @@ Image::~Image() { if (!_unpack) { - CC_SAFE_FREE(_data); + AX_SAFE_FREE(_data); } else { for (int i = 0; i < _numberOfMipmaps; ++i) - CC_SAFE_FREE(_mipmaps[i].address); + AX_SAFE_FREE(_mipmaps[i].address); } } @@ -621,7 +621,7 @@ bool Image::initWithImageData(uint8_t* data, ssize_t dataLen, bool ownData) do { - CC_BREAK_IF(!data || dataLen == 0); + AX_BREAK_IF(!data || dataLen == 0); uint8_t* unpackedData = nullptr; ssize_t unpackedLen = 0; @@ -719,7 +719,7 @@ bool Image::initWithRawData(const uint8_t* data, bool ret = false; do { - CC_BREAK_IF(0 == width || 0 == height); + AX_BREAK_IF(0 == width || 0 == height); _height = height; _width = width; @@ -730,7 +730,7 @@ bool Image::initWithRawData(const uint8_t* data, int bytesPerComponent = 4; _dataLen = height * width * bytesPerComponent; _data = static_cast(malloc(_dataLen)); - CC_BREAK_IF(!_data); + AX_BREAK_IF(!_data); memcpy(_data, data, _dataLen); ret = true; @@ -819,7 +819,7 @@ bool Image::isPvr(const uint8_t* data, ssize_t dataLen) const PVRv3TexHeader* headerv3 = static_cast(static_cast(data)); return memcmp(&headerv2->pvrTag, gPVRTexIdentifier, strlen(gPVRTexIdentifier)) == 0 || - CC_SWAP_INT32_BIG_TO_HOST(headerv3->version) == 0x50565203; + AX_SWAP_INT32_BIG_TO_HOST(headerv3->version) == 0x50565203; } Image::Format Image::detectFormat(const uint8_t* data, ssize_t dataLen) @@ -923,7 +923,7 @@ namespace * * Here's the extended error handler struct: */ -#if CC_USE_JPEG +#if AX_USE_JPEG struct MyErrorMgr { struct jpeg_error_mgr pub; /* "public" fields */ @@ -955,12 +955,12 @@ myErrorExit(j_common_ptr cinfo) /* Return control to the setjmp point */ longjmp(myerr->setjmp_buffer, 1); } -#endif // CC_USE_JPEG +#endif // AX_USE_JPEG } // namespace bool Image::initWithJpgData(uint8_t* data, ssize_t dataLen) { -#if CC_USE_JPEG +#if AX_USE_JPEG /* these are standard libjpeg structures for reading(decompression) */ struct jpeg_decompress_struct cinfo; /* We use our private extension JPEG error handler. @@ -991,9 +991,9 @@ bool Image::initWithJpgData(uint8_t* data, ssize_t dataLen) /* setup decompression process and source, then read JPEG header */ jpeg_create_decompress(&cinfo); -# ifndef CC_TARGET_QT5 +# ifndef AX_TARGET_QT5 jpeg_mem_src(&cinfo, const_cast(data), dataLen); -# endif /* CC_TARGET_QT5 */ +# endif /* AX_TARGET_QT5 */ /* reading the image header which contains image information */ # if (JPEG_LIB_VERSION >= 90) @@ -1023,7 +1023,7 @@ bool Image::initWithJpgData(uint8_t* data, ssize_t dataLen) _dataLen = cinfo.output_width * cinfo.output_height * cinfo.output_components; _data = static_cast(malloc(_dataLen)); - CC_BREAK_IF(!_data); + AX_BREAK_IF(!_data); /* now actually read the jpeg into the raw buffer */ /* read one scan line at a time */ @@ -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 // CC_USE_JPEG +#endif // AX_USE_JPEG } bool Image::initWithPngData(uint8_t* data, ssize_t dataLen) { -#if CC_USE_PNG +#if AX_USE_PNG // length of bytes to check if it is a valid png file # define PNGSIGSIZE 8 bool ret = false; @@ -1065,21 +1065,21 @@ bool Image::initWithPngData(uint8_t* data, ssize_t dataLen) do { // png header len is 8 bytes - CC_BREAK_IF(dataLen < PNGSIGSIZE); + AX_BREAK_IF(dataLen < PNGSIGSIZE); // check the data is png or not memcpy(header, data, PNGSIGSIZE); - CC_BREAK_IF(png_sig_cmp(header, 0, PNGSIGSIZE)); + AX_BREAK_IF(png_sig_cmp(header, 0, PNGSIGSIZE)); // init png_struct png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0); - CC_BREAK_IF(!png_ptr); + AX_BREAK_IF(!png_ptr); // init png_info info_ptr = png_create_info_struct(png_ptr); - CC_BREAK_IF(!info_ptr); + AX_BREAK_IF(!info_ptr); - CC_BREAK_IF(setjmp(png_jmpbuf(png_ptr))); + AX_BREAK_IF(setjmp(png_jmpbuf(png_ptr))); // set the read call back function tImageSource imageSource; @@ -1184,9 +1184,9 @@ bool Image::initWithPngData(uint8_t* data, ssize_t dataLen) } else { - // if PNG_PREMULTIPLIED_ALPHA_ENABLED == false && CC_ENABLE_PREMULTIPLIED_ALPHA != 0, + // if PNG_PREMULTIPLIED_ALPHA_ENABLED == false && AX_ENABLE_PREMULTIPLIED_ALPHA != 0, // you must do PMA at shader, such as modify positionTextureColor.frag - _hasPremultipliedAlpha = !!CC_ENABLE_PREMULTIPLIED_ALPHA; + _hasPremultipliedAlpha = !!AX_ENABLE_PREMULTIPLIED_ALPHA; } } @@ -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 // CC_USE_PNG +#endif // AX_USE_PNG } bool Image::initWithBmpData(uint8_t* data, ssize_t dataLen) @@ -1225,7 +1225,7 @@ bool Image::initWithBmpData(uint8_t* data, ssize_t dataLen) bool Image::initWithWebpData(uint8_t* data, ssize_t dataLen) { -#if CC_USE_WEBP +#if AX_USE_WEBP bool ret = false; do @@ -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 // CC_USE_WEBP +#endif // AX_USE_WEBP } bool Image::initWithTGAData(tImageTGA* tgaData) @@ -1276,7 +1276,7 @@ bool Image::initWithTGAData(tImageTGA* tgaData) do { - CC_BREAK_IF(tgaData == nullptr); + AX_BREAK_IF(tgaData == nullptr); // tgaLoadBuffer only support type 2, 3, 10 if (2 == tgaData->type || 10 == tgaData->type) @@ -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 = CC_SWAP_INT32_LITTLE_TO_HOST(header->flags); + unsigned int flags = AX_SWAP_INT32_LITTLE_TO_HOST(header->flags); PVR2TexturePixelFormat formatFlags = static_cast(flags & PVR_TEXTURE_FLAG_TYPE_MASK); bool flipped = (flags & (unsigned int)PVR2TextureFlag::VerticalFlip) ? true : false; if (flipped) @@ -1411,8 +1411,8 @@ bool Image::initWithPVRv2Data(uint8_t* data, ssize_t dataLen, bool ownData) _numberOfMipmaps = 0; // Get size of mipmap - _width = width = CC_SWAP_INT32_LITTLE_TO_HOST(header->width); - _height = height = CC_SWAP_INT32_LITTLE_TO_HOST(header->height); + _width = width = AX_SWAP_INT32_LITTLE_TO_HOST(header->width); + _height = height = AX_SWAP_INT32_LITTLE_TO_HOST(header->height); // Move by size of header const int pixelOffset = sizeof(PVRv2TexHeader); @@ -1420,7 +1420,7 @@ bool Image::initWithPVRv2Data(uint8_t* data, ssize_t dataLen, bool ownData) int dataOffset = 0, dataSize = 0; // Get ptr to where data starts.. - int dataLength = CC_SWAP_INT32_LITTLE_TO_HOST(header->dataLength); + int dataLength = AX_SWAP_INT32_LITTLE_TO_HOST(header->dataLength); // Calculate the data size for each texture level and respect the minimum number of blocks while (dataOffset < dataLength) @@ -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 (CC_SWAP_INT32_BIG_TO_HOST(header->version) != 0x50565203) + if (AX_SWAP_INT32_BIG_TO_HOST(header->version) != 0x50565203) { CCLOG("cocos2d: WARNING: pvr file version mismatch"); return false; @@ -1562,7 +1562,7 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) _pixelFormat = finalPixelFormat; // flags - int flags = CC_SWAP_INT32_LITTLE_TO_HOST(header->flags); + int flags = AX_SWAP_INT32_LITTLE_TO_HOST(header->flags); // PVRv3 specifies premultiply alpha in a flag -- should always respect this in PVRv3 files if (flags & (unsigned int)PVR3TextureFlag::PremultipliedAlpha) @@ -1571,8 +1571,8 @@ bool Image::initWithPVRv3Data(uint8_t* data, ssize_t dataLen, bool ownData) } // sizing - int width = CC_SWAP_INT32_LITTLE_TO_HOST(header->width); - int height = CC_SWAP_INT32_LITTLE_TO_HOST(header->height); + int width = AX_SWAP_INT32_LITTLE_TO_HOST(header->width); + int height = AX_SWAP_INT32_LITTLE_TO_HOST(header->height); _width = width; _height = height; @@ -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 CC_MIPMAP_MAX value"); + "Image: Maximum number of mimpaps reached. Increase the AX_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 - CC_SAFE_FREE(_data); + AX_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 - CC_SAFE_FREE(_data); + AX_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)) { - CC_SAFE_FREE(_data); + AX_SAFE_FREE(_data); _dataLen = 0; break; } @@ -2197,7 +2197,7 @@ void Image::forwardPixels(uint8_t* data, ssize_t dataLen, int offset, bool ownDa } } -#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) bool Image::saveToFile(std::string_view filename, bool isToRGB) { // only support for backend::PixelFormat::RGB8 or backend::PixelFormat::RGBA8 uncompressed data @@ -2229,7 +2229,7 @@ bool Image::saveToFile(std::string_view filename, bool isToRGB) bool Image::saveImageToPNG(std::string_view filePath, bool isToRGB) { -#if CC_USE_PNG +#if AX_USE_PNG bool ret = false; do { @@ -2239,7 +2239,7 @@ bool Image::saveImageToPNG(std::string_view filePath, bool isToRGB) auto outStream = FileUtils::getInstance()->openFileStream(filePath, FileStream::Mode::WRITE); - CC_BREAK_IF(nullptr == outStream); + AX_BREAK_IF(nullptr == outStream); png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); @@ -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 // CC_USE_PNG +#endif // AX_USE_PNG } bool Image::saveImageToJPG(std::string_view filePath) { -#if CC_USE_JPEG +#if AX_USE_JPEG bool ret = false; do { @@ -2387,7 +2387,7 @@ bool Image::saveImageToJPG(std::string_view filePath) jpeg_create_compress(&cinfo); outfile = FileUtils::getInstance()->openFileStream(filePath, FileStream::Mode::WRITE); - CC_BREAK_IF(nullptr == outfile); + AX_BREAK_IF(nullptr == outfile); unsigned char* outputBuffer = nullptr; unsigned long outputSize = 0; @@ -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 // CC_USE_JPEG +#endif // AX_USE_JPEG } void Image::premultiplyAlpha() { -#if CC_ENABLE_PREMULTIPLIED_ALPHA +#if AX_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] = CC_RGB_PREMULTIPLY_ALPHA(p[0], p[1], p[2], p[3]); + fourBytes[i] = AX_RGB_PREMULTIPLY_ALPHA(p[0], p[1], p[2], p[3]); } _hasPremultipliedAlpha = true; diff --git a/core/platform/CCImage.h b/core/platform/CCImage.h index b1b3196c05..0af8b9171b 100644 --- a/core/platform/CCImage.h +++ b/core/platform/CCImage.h @@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_IMAGE_H__ -#define __CC_IMAGE_H__ +#ifndef __AX_IMAGE_H__ +#define __AX_IMAGE_H__ #include "base/CCRef.h" #include "renderer/CCTexture2D.h" @@ -35,7 +35,7 @@ THE SOFTWARE. // premultiply alpha, or the effect will be wrong when using other pixel formats in Texture2D, // such as RGB888, RGB5A1 -#define CC_RGB_PREMULTIPLY_ALPHA(vr, vg, vb, va) \ +#define AX_RGB_PREMULTIPLY_ALPHA(vr, vg, vb, va) \ (unsigned)(((unsigned)((uint8_t)(vr) * ((uint8_t)(va) + 1)) >> 8) | \ ((unsigned)((uint8_t)(vg) * ((uint8_t)(va) + 1) >> 8) << 8) | \ ((unsigned)((uint8_t)(vb) * ((uint8_t)(va) + 1) >> 8) << 16) | ((unsigned)(uint8_t)(va) << 24)) @@ -58,7 +58,7 @@ typedef struct _MipmapInfo } MipmapInfo; /** The Image class for loading all images supported by axis . */ -class CC_DLL Image : public Ref +class AX_DLL Image : public Ref { public: friend class TextureCache; @@ -269,4 +269,4 @@ protected: NS_AX_END -#endif // __CC_IMAGE_H__ +#endif // __AX_IMAGE_H__ diff --git a/core/platform/CCPlatformConfig.h b/core/platform/CCPlatformConfig.h index 5b62df246d..e58ac1de88 100644 --- a/core/platform/CCPlatformConfig.h +++ b/core/platform/CCPlatformConfig.h @@ -25,8 +25,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __BASE_CC_PLATFORM_CONFIG_H__ -#define __BASE_CC_PLATFORM_CONFIG_H__ +#ifndef __BASE_AX_PLATFORM_CONFIG_H__ +#define __BASE_AX_PLATFORM_CONFIG_H__ /// @cond DO_NOT_SHOW /** @@ -40,53 +40,53 @@ THE SOFTWARE. ////////////////////////////////////////////////////////////////////////// // define supported target platform macro which CC uses. -#define CC_PLATFORM_UNKNOWN 0 -#define CC_PLATFORM_IOS 1 -#define CC_PLATFORM_ANDROID 2 -#define CC_PLATFORM_WIN32 3 -// #define CC_PLATFORM_MARMALADE 4 -#define CC_PLATFORM_LINUX 5 -// #define CC_PLATFORM_BADA 6 -// #define CC_PLATFORM_BLACKBERRY 7 -#define CC_PLATFORM_MAC 8 -// #define CC_PLATFORM_NACL 9 -// #define CC_PLATFORM_EMSCRIPTEN 10 -// #define CC_PLATFORM_TIZEN 11 -// #define CC_PLATFORM_QT5 12 -// #define CC_PLATFORM_WINRT 13 +#define AX_PLATFORM_UNKNOWN 0 +#define AX_PLATFORM_IOS 1 +#define AX_PLATFORM_ANDROID 2 +#define AX_PLATFORM_WIN32 3 +// #define AX_PLATFORM_MARMALADE 4 +#define AX_PLATFORM_LINUX 5 +// #define AX_PLATFORM_BADA 6 +// #define AX_PLATFORM_BLACKBERRY 7 +#define AX_PLATFORM_MAC 8 +// #define AX_PLATFORM_NACL 9 +// #define AX_PLATFORM_EMSCRIPTEN 10 +// #define AX_PLATFORM_TIZEN 11 +// #define AX_PLATFORM_QT5 12 +// #define AX_PLATFORM_WINRT 13 // Determine target platform by compile environment macro. -#define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN +#define AX_TARGET_PLATFORM AX_PLATFORM_UNKNOWN // Apple: Mac and iOS #if defined(__APPLE__) && !defined(__ANDROID__) // exclude android for binding generator. # include # if TARGET_OS_IPHONE // TARGET_OS_IPHONE includes TARGET_OS_IOS TARGET_OS_TV and TARGET_OS_WATCH. see // TargetConditionals.h -# undef CC_TARGET_PLATFORM -# define CC_TARGET_PLATFORM CC_PLATFORM_IOS +# undef AX_TARGET_PLATFORM +# define AX_TARGET_PLATFORM AX_PLATFORM_IOS # elif TARGET_OS_MAC -# undef CC_TARGET_PLATFORM -# define CC_TARGET_PLATFORM CC_PLATFORM_MAC +# undef AX_TARGET_PLATFORM +# define AX_TARGET_PLATFORM AX_PLATFORM_MAC # endif #endif // android #if defined(__ANDROID__) -# undef CC_TARGET_PLATFORM -# define CC_TARGET_PLATFORM CC_PLATFORM_ANDROID +# undef AX_TARGET_PLATFORM +# define AX_TARGET_PLATFORM AX_PLATFORM_ANDROID #endif // win32 #if defined(_WIN32) && defined(_WINDOWS) -# undef CC_TARGET_PLATFORM -# define CC_TARGET_PLATFORM CC_PLATFORM_WIN32 +# undef AX_TARGET_PLATFORM +# define AX_TARGET_PLATFORM AX_PLATFORM_WIN32 #endif // linux #if defined(LINUX) && !defined(__APPLE__) -# undef CC_TARGET_PLATFORM -# define CC_TARGET_PLATFORM CC_PLATFORM_LINUX +# undef AX_TARGET_PLATFORM +# define AX_TARGET_PLATFORM AX_PLATFORM_LINUX #endif ////////////////////////////////////////////////////////////////////////// @@ -94,15 +94,15 @@ THE SOFTWARE. ////////////////////////////////////////////////////////////////////////// // check user set platform -#if !CC_TARGET_PLATFORM +#if !AX_TARGET_PLATFORM # error "Cannot recognize the target platform; are you targeting an unsupported platform?" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # ifndef __MINGW32__ # pragma warning(disable : 4127) # endif -#endif // CC_PLATFORM_WIN32 +#endif // AX_PLATFORM_WIN32 /* windows: https://github.com/google/angle @@ -114,35 +114,35 @@ other: GL # define AX_USE_COMPAT_GL 0 #endif -#if ((CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)) -# define CC_PLATFORM_MOBILE +#if ((AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || (AX_TARGET_PLATFORM == AX_PLATFORM_IOS)) +# define AX_PLATFORM_MOBILE #else -# define CC_PLATFORM_PC +# define AX_PLATFORM_PC #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # if !AX_USE_COMPAT_GL -# define CC_USE_METAL +# define AX_USE_METAL # else -# define CC_USE_GL +# define AX_USE_GL # endif -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # if !AX_USE_COMPAT_GL -# define CC_USE_METAL +# define AX_USE_METAL # else -# define CC_USE_GLES +# define AX_USE_GLES # endif -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -# define CC_USE_GLES -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +# define AX_USE_GLES +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # if !AX_USE_COMPAT_GL -# define CC_USE_GL +# define AX_USE_GL # else -# define CC_USE_GLES +# define AX_USE_GLES # endif #else -# define CC_USE_GL +# define AX_USE_GL #endif /// @endcond -#endif // __BASE_CC_PLATFORM_CONFIG_H__ +#endif // __BASE_AX_PLATFORM_CONFIG_H__ diff --git a/core/platform/CCPlatformDefine.h b/core/platform/CCPlatformDefine.h index 5e4371bc14..843d4b1574 100644 --- a/core/platform/CCPlatformDefine.h +++ b/core/platform/CCPlatformDefine.h @@ -29,14 +29,14 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_MAC # include "platform/mac/CCPlatformDefine-mac.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS # include "platform/ios/CCPlatformDefine-ios.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include "platform/android/CCPlatformDefine-android.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include "platform/win32/CCPlatformDefine-win32.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#elif AX_TARGET_PLATFORM == AX_PLATFORM_LINUX # include "platform/linux/CCPlatformDefine-linux.h" #endif diff --git a/core/platform/CCPlatformMacros.h b/core/platform/CCPlatformMacros.h index d29e60d8d6..d67324da52 100644 --- a/core/platform/CCPlatformMacros.h +++ b/core/platform/CCPlatformMacros.h @@ -25,8 +25,8 @@ Copyright (c) 2021 Bytedance Inc. THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PLATFORM_MACROS_H__ -#define __CC_PLATFORM_MACROS_H__ +#ifndef __AX_PLATFORM_MACROS_H__ +#define __AX_PLATFORM_MACROS_H__ /** * Define some platform specific macros. @@ -65,7 +65,7 @@ Copyright (c) 2021 Bytedance Inc. * @deprecated This interface will be deprecated sooner or later. */ #define NODE_FUNC(__TYPE__) \ - CC_DEPRECATED_ATTRIBUTE static __TYPE__* node() \ + AX_DEPRECATED_ATTRIBUTE static __TYPE__* node() \ { \ __TYPE__* pRet = new __TYPE__(); \ if (pRet->init()) \ @@ -81,26 +81,26 @@ Copyright (c) 2021 Bytedance Inc. } \ } -/** @def CC_ENABLE_CACHE_TEXTURE_DATA +/** @def AX_ENABLE_CACHE_TEXTURE_DATA * Enable it if you want to cache the texture data. * Not enabling for Emscripten any more -- doesn't seem necessary and don't want * to be different from other platforms unless there's a good reason. * * @since v0.99.5 */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -# define CC_ENABLE_CACHE_TEXTURE_DATA 1 +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) +# define AX_ENABLE_CACHE_TEXTURE_DATA 1 #else -# define CC_ENABLE_CACHE_TEXTURE_DATA 0 +# define AX_ENABLE_CACHE_TEXTURE_DATA 0 #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) /** Application will crash in glDrawElements function on some win32 computers and some android devices. * Indices should be bound again while drawing to avoid this bug. */ -# define CC_REBIND_INDICES_BUFFER 1 +# define AX_REBIND_INDICES_BUFFER 1 #else -# define CC_REBIND_INDICES_BUFFER 0 +# define AX_REBIND_INDICES_BUFFER 0 #endif // Generic macros @@ -126,31 +126,31 @@ namespace ax = axis; // end of namespace group /// @} -/** @def CC_PROPERTY_READONLY +/** @def AX_PROPERTY_READONLY * It is used to declare a protected variable. We can use getter to read the variable. * * @param varType the type of variable. * @param varName variable name. * @param funName "get + funName" will be the name of the getter. * @warning The getter is a public virtual function, you should rewrite it first. - * The variables and methods declared after CC_PROPERTY_READONLY are all public. + * The variables and methods declared after AX_PROPERTY_READONLY are all public. * If you need protected or private, please declare. */ -#define CC_PROPERTY_READONLY(varType, varName, funName) \ +#define AX_PROPERTY_READONLY(varType, varName, funName) \ protected: \ varType varName; \ \ public: \ virtual varType get##funName() const; -#define CC_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName) \ +#define AX_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName) \ protected: \ varType varName; \ \ public: \ virtual const varType& get##funName() const; -/** @def CC_PROPERTY +/** @def AX_PROPERTY * It is used to declare a protected variable. * We can use getter to read the variable, and use the setter to change the variable. * @@ -159,10 +159,10 @@ public: \ * @param funName "get + funName" will be the name of the getter. * "set + funName" will be the name of the setter. * @warning The getter and setter are public virtual functions, you should rewrite them first. - * The variables and methods declared after CC_PROPERTY are all public. + * The variables and methods declared after AX_PROPERTY are all public. * If you need protected or private, please declare. */ -#define CC_PROPERTY(varType, varName, funName) \ +#define AX_PROPERTY(varType, varName, funName) \ protected: \ varType varName; \ \ @@ -170,7 +170,7 @@ public: \ virtual varType get##funName() const; \ virtual void set##funName(varType var); -#define CC_PROPERTY_PASS_BY_REF(varType, varName, funName) \ +#define AX_PROPERTY_PASS_BY_REF(varType, varName, funName) \ protected: \ varType varName; \ \ @@ -178,31 +178,31 @@ public: \ virtual const varType& get##funName() const; \ virtual void set##funName(const varType& var); -/** @def CC_SYNTHESIZE_READONLY +/** @def AX_SYNTHESIZE_READONLY * It is used to declare a protected variable. We can use getter to read the variable. * * @param varType The type of variable. * @param varName Variable name. * @param funName "get + funName" will be the name of the getter. * @warning The getter is a public inline function. - * The variables and methods declared after CC_SYNTHESIZE_READONLY are all public. + * The variables and methods declared after AX_SYNTHESIZE_READONLY are all public. * If you need protected or private, please declare. */ -#define CC_SYNTHESIZE_READONLY(varType, varName, funName) \ +#define AX_SYNTHESIZE_READONLY(varType, varName, funName) \ protected: \ varType varName; \ \ public: \ virtual inline varType get##funName() const { return varName; } -#define CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName) \ +#define AX_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName) \ protected: \ varType varName; \ \ public: \ virtual inline const varType& get##funName() const { return varName; } -/** @def CC_SYNTHESIZE +/** @def AX_SYNTHESIZE * It is used to declare a protected variable. * We can use getter to read the variable, and use the setter to change the variable. * @@ -211,10 +211,10 @@ public: \ * @param funName "get + funName" will be the name of the getter. * "set + funName" will be the name of the setter. * @warning The getter and setter are public inline functions. - * The variables and methods declared after CC_SYNTHESIZE are all public. + * The variables and methods declared after AX_SYNTHESIZE are all public. * If you need protected or private, please declare. */ -#define CC_SYNTHESIZE(varType, varName, funName) \ +#define AX_SYNTHESIZE(varType, varName, funName) \ protected: \ varType varName; \ \ @@ -222,7 +222,7 @@ public: \ virtual inline varType get##funName() const { return varName; } \ virtual inline void set##funName(varType var) { varName = var; } -#define CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName) \ +#define AX_SYNTHESIZE_PASS_BY_REF(varType, varName, funName) \ protected: \ varType varName; \ \ @@ -230,7 +230,7 @@ public: \ virtual inline const varType& get##funName() const { return varName; } \ virtual inline void set##funName(const varType& var) { varName = var; } -#define CC_SYNTHESIZE_RETAIN(varType, varName, funName) \ +#define AX_SYNTHESIZE_RETAIN(varType, varName, funName) \ private: \ varType varName; \ \ @@ -240,19 +240,19 @@ public: \ { \ if (varName != var) \ { \ - CC_SAFE_RETAIN(var); \ - CC_SAFE_RELEASE(varName); \ + AX_SAFE_RETAIN(var); \ + AX_SAFE_RELEASE(varName); \ varName = var; \ } \ } -#define CC_SAFE_DELETE(p) \ +#define AX_SAFE_DELETE(p) \ do \ { \ delete (p); \ (p) = nullptr; \ } while (0) -#define CC_SAFE_DELETE_ARRAY(p) \ +#define AX_SAFE_DELETE_ARRAY(p) \ do \ { \ if (p) \ @@ -261,7 +261,7 @@ public: \ (p) = nullptr; \ } \ } while (0) -#define CC_SAFE_FREE(p) \ +#define AX_SAFE_FREE(p) \ do \ { \ if (p) \ @@ -270,7 +270,7 @@ public: \ (p) = nullptr; \ } \ } while (0) -#define CC_SAFE_RELEASE(p) \ +#define AX_SAFE_RELEASE(p) \ do \ { \ if (p) \ @@ -278,7 +278,7 @@ public: \ (p)->release(); \ } \ } while (0) -#define CC_SAFE_RELEASE_NULL(p) \ +#define AX_SAFE_RELEASE_NULL(p) \ do \ { \ if (p) \ @@ -287,7 +287,7 @@ public: \ (p) = nullptr; \ } \ } while (0) -#define CC_SAFE_RETAIN(p) \ +#define AX_SAFE_RETAIN(p) \ do \ { \ if (p) \ @@ -295,7 +295,7 @@ public: \ (p)->retain(); \ } \ } while (0) -#define CC_BREAK_IF(cond) \ +#define AX_BREAK_IF(cond) \ if (cond) \ break @@ -339,7 +339,7 @@ public: \ #endif // COCOS2D_DEBUG /** Lua engine debug */ -#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 || CC_LUA_ENGINE_DEBUG == 0 +#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 || AX_LUA_ENGINE_DEBUG == 0 # define LUALOG(...) #else # define LUALOG(format, ...) axis::log(format, ##__VA_ARGS__) @@ -348,22 +348,22 @@ public: \ // end of debug group /// @} -/** @def CC_DISALLOW_COPY_AND_ASSIGN(TypeName) +/** @def AX_DISALLOW_COPY_AND_ASSIGN(TypeName) * A macro to disallow the copy constructor and operator= functions. * This should be used in the private: declarations for a class */ #if defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUG__ == 4) && (__GNUC_MINOR__ >= 4))) || \ (defined(__clang__) && (__clang_major__ >= 3)) || (_MSC_VER >= 1800) -# define CC_DISALLOW_COPY_AND_ASSIGN(TypeName) \ +# define AX_DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&) = delete; \ TypeName& operator=(const TypeName&) = delete; #else -# define CC_DISALLOW_COPY_AND_ASSIGN(TypeName) \ +# define AX_DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ TypeName& operator=(const TypeName&); #endif -/** @def CC_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) +/** @def AX_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) * A macro to disallow all the implicit constructors, namely the * default constructor, copy constructor and operator= functions. * @@ -371,68 +371,68 @@ public: \ * that wants to prevent anyone from instantiating it. This is * especially useful for classes containing only static methods. */ -#define CC_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ +#define AX_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ TypeName(); \ - CC_DISALLOW_COPY_AND_ASSIGN(TypeName) + AX_DISALLOW_COPY_AND_ASSIGN(TypeName) -/** @def CC_DEPRECATED_ATTRIBUTE +/** @def AX_DEPRECATED_ATTRIBUTE * Only certain compilers support __attribute__((deprecated)). */ #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) -# define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) +# define AX_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) #elif _MSC_VER >= 1400 // vs 2005 or higher -# define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated) +# define AX_DEPRECATED_ATTRIBUTE __declspec(deprecated) #else -# define CC_DEPRECATED_ATTRIBUTE +# define AX_DEPRECATED_ATTRIBUTE #endif -/** @def CC_DEPRECATED(...) +/** @def AX_DEPRECATED(...) * Macro to mark things deprecated as of a particular version * can be used with arbitrary parameters which are thrown away. - * e.g. CC_DEPRECATED(4.0) or CC_DEPRECATED(4.0, "not going to need this anymore") etc. + * e.g. AX_DEPRECATED(4.0) or AX_DEPRECATED(4.0, "not going to need this anymore") etc. */ -#define CC_DEPRECATED(...) CC_DEPRECATED_ATTRIBUTE +#define AX_DEPRECATED(...) AX_DEPRECATED_ATTRIBUTE -/** @def CC_FORMAT_PRINTF(formatPos, argPos) +/** @def AX_FORMAT_PRINTF(formatPos, argPos) * Only certain compiler support __attribute__((format)) * * @param formatPos 1-based position of format string argument. * @param argPos 1-based position of first format-dependent argument. */ #if defined(__GNUC__) && (__GNUC__ >= 4) -# define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) +# define AX_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) #elif defined(__has_attribute) # if __has_attribute(format) -# define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) +# define AX_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) # else -# define CC_FORMAT_PRINTF(formatPos, argPos) +# define AX_FORMAT_PRINTF(formatPos, argPos) # endif // __has_attribute(format) #else -# define CC_FORMAT_PRINTF(formatPos, argPos) +# define AX_FORMAT_PRINTF(formatPos, argPos) #endif #if defined(_MSC_VER) -# define CC_FORMAT_PRINTF_SIZE_T "%08lX" +# define AX_FORMAT_PRINTF_SIZE_T "%08lX" #else -# define CC_FORMAT_PRINTF_SIZE_T "%08zX" +# define AX_FORMAT_PRINTF_SIZE_T "%08zX" #endif #ifdef __GNUC__ -# define CC_UNUSED __attribute__((unused)) +# define AX_UNUSED __attribute__((unused)) #else -# define CC_UNUSED +# define AX_UNUSED #endif -/** @def CC_REQUIRES_NULL_TERMINATION +/** @def AX_REQUIRES_NULL_TERMINATION * */ -#if !defined(CC_REQUIRES_NULL_TERMINATION) -# if defined(__APPLE_CC__) && (__APPLE_CC__ >= 5549) -# define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel(0, 1))) +#if !defined(AX_REQUIRES_NULL_TERMINATION) +# if defined(__APPLE_AX__) && (__APPLE_AX__ >= 5549) +# define AX_REQUIRES_NULL_TERMINATION __attribute__((sentinel(0, 1))) # elif defined(__GNUC__) -# define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel)) +# define AX_REQUIRES_NULL_TERMINATION __attribute__((sentinel)) # else -# define CC_REQUIRES_NULL_TERMINATION +# define AX_REQUIRES_NULL_TERMINATION # endif #endif @@ -460,4 +460,4 @@ public: \ # define UTILS_UNLIKELY(exp) (!!(exp)) #endif -#endif // __CC_PLATFORM_MACROS_H__ +#endif // __AX_PLATFORM_MACROS_H__ diff --git a/core/platform/CCPosixFileStream.cpp b/core/platform/CCPosixFileStream.cpp index 83692837ac..89c93c6acb 100644 --- a/core/platform/CCPosixFileStream.cpp +++ b/core/platform/CCPosixFileStream.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2020 C4games Ltd #include "platform/CCPosixFileStream.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include "base/ZipUtils.h" #endif @@ -76,7 +76,7 @@ static long long pfs_posix_size(PXFileHandle& handle) static PXIoF pfs_posix_iof = {pfs_posix_read, pfs_posix_seek, pfs_posix_close, pfs_posix_size}; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID // android AssetManager wrappers static int pfs_asset_read(PXFileHandle& handle, void* buf, unsigned int size) { @@ -130,7 +130,7 @@ PosixFileStream::~PosixFileStream() bool PosixFileStream::open(std::string_view path, FileStream::Mode mode) { bool ok = false; -#if CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID ok = pfs_posix_open(path, mode, _handle) != -1; #else // Android if (path[0] != '/') @@ -223,7 +223,7 @@ int64_t PosixFileStream::size() bool PosixFileStream::isOpen() const { -#if CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID return _handle._fd != -1; #else return _handle._fd != -1 && _handle._asset != nullptr; diff --git a/core/platform/CCPosixFileStream.h b/core/platform/CCPosixFileStream.h index 52804def31..1908abce5c 100644 --- a/core/platform/CCPosixFileStream.h +++ b/core/platform/CCPosixFileStream.h @@ -5,7 +5,7 @@ #include "platform/CCFileStream.h" #include "platform/CCPlatformConfig.h" #include -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include # include #else @@ -17,7 +17,7 @@ #include "platform/CCPlatformMacros.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include "platform/android/CCFileUtils-android.h" # include # include @@ -70,7 +70,7 @@ struct UnzFileStream; union PXFileHandle { int _fd = -1; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID AAsset* _asset; ZipFileStream _zfs; #endif @@ -78,7 +78,7 @@ union PXFileHandle struct PXIoF; -class CC_DLL PosixFileStream : public FileStream +class AX_DLL PosixFileStream : public FileStream { public: PosixFileStream() = default; diff --git a/core/platform/CCSAXParser.cpp b/core/platform/CCSAXParser.cpp index 1819e63df0..d2bc715c65 100644 --- a/core/platform/CCSAXParser.cpp +++ b/core/platform/CCSAXParser.cpp @@ -54,23 +54,23 @@ public: if (!_curEleAttrs.empty()) { _curEleAttrs.push_back(nullptr); - SAXParser::startElement(_ccsaxParserImp, (const CC_XML_CHAR*)_curEleName.c_str(), - (const CC_XML_CHAR**)&_curEleAttrs[0]); + SAXParser::startElement(_ccsaxParserImp, (const AX_XML_CHAR*)_curEleName.c_str(), + (const AX_XML_CHAR**)&_curEleAttrs[0]); _curEleAttrs.clear(); } else { const char* attr = nullptr; const char** attrs = &attr; - SAXParser::startElement(_ccsaxParserImp, (const CC_XML_CHAR*)_curEleName.c_str(), - (const CC_XML_CHAR**)attrs); + SAXParser::startElement(_ccsaxParserImp, (const AX_XML_CHAR*)_curEleName.c_str(), + (const AX_XML_CHAR**)attrs); } }; _sax3Handler.xml_end_element_cb = [=](const char* name, size_t len) { - SAXParser::endElement(_ccsaxParserImp, (const CC_XML_CHAR*)name); + SAXParser::endElement(_ccsaxParserImp, (const AX_XML_CHAR*)name); }; _sax3Handler.xml_text_cb = [=](const char* s, size_t len) { - SAXParser::textHandler(_ccsaxParserImp, (const CC_XML_CHAR*)s, len); + SAXParser::textHandler(_ccsaxParserImp, (const AX_XML_CHAR*)s, len); }; }; @@ -139,16 +139,16 @@ bool SAXParser::parseIntrusive(char* xmlData, size_t dataLength) return false; } -void SAXParser::startElement(void* ctx, const CC_XML_CHAR* name, const CC_XML_CHAR** atts) +void SAXParser::startElement(void* ctx, const AX_XML_CHAR* name, const AX_XML_CHAR** atts) { ((SAXParser*)(ctx))->_delegator->startElement(ctx, (char*)name, (const char**)atts); } -void SAXParser::endElement(void* ctx, const CC_XML_CHAR* name) +void SAXParser::endElement(void* ctx, const AX_XML_CHAR* name) { ((SAXParser*)(ctx))->_delegator->endElement(ctx, (char*)name); } -void SAXParser::textHandler(void* ctx, const CC_XML_CHAR* name, size_t len) +void SAXParser::textHandler(void* ctx, const AX_XML_CHAR* name, size_t len) { ((SAXParser*)(ctx))->_delegator->textHandler(ctx, (char*)name, len); } diff --git a/core/platform/CCSAXParser.h b/core/platform/CCSAXParser.h index 2de23a8484..1c19681f65 100644 --- a/core/platform/CCSAXParser.h +++ b/core/platform/CCSAXParser.h @@ -37,9 +37,9 @@ NS_AX_BEGIN * @{ */ -typedef unsigned char CC_XML_CHAR; +typedef unsigned char AX_XML_CHAR; -class CC_DLL SAXDelegator +class AX_DLL SAXDelegator { public: virtual ~SAXDelegator() {} @@ -61,7 +61,7 @@ public: virtual void textHandler(void* ctx, const char* s, size_t len) = 0; }; -class CC_DLL SAXParser +class AX_DLL SAXParser { SAXDelegator* _delegator; @@ -106,17 +106,17 @@ public: * @js NA * @lua NA */ - static void startElement(void* ctx, const CC_XML_CHAR* name, const CC_XML_CHAR** atts); + static void startElement(void* ctx, const AX_XML_CHAR* name, const AX_XML_CHAR** atts); /** * @js NA * @lua NA */ - static void endElement(void* ctx, const CC_XML_CHAR* name); + static void endElement(void* ctx, const AX_XML_CHAR* name); /** * @js NA * @lua NA */ - static void textHandler(void* ctx, const CC_XML_CHAR* name, size_t len); + static void textHandler(void* ctx, const AX_XML_CHAR* name, size_t len); }; // end of platform group diff --git a/core/platform/CCStdC.h b/core/platform/CCStdC.h index ed0cd377fa..0f3283e99d 100644 --- a/core/platform/CCStdC.h +++ b/core/platform/CCStdC.h @@ -29,15 +29,15 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_MAC # include "platform/mac/CCStdC-mac.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS # include "platform/ios/CCStdC-ios.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID # include "platform/android/CCStdC-android.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include "platform/win32/CCStdC-win32.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#elif AX_TARGET_PLATFORM == AX_PLATFORM_LINUX # include "platform/linux/CCStdC-linux.h" #endif diff --git a/core/platform/android/CCApplication-android.h b/core/platform/android/CCApplication-android.h index dfa56b4383..a3b2d8ff00 100644 --- a/core/platform/android/CCApplication-android.h +++ b/core/platform/android/CCApplication-android.h @@ -30,7 +30,7 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL Application : public ApplicationProtocol +class AX_DLL Application : public ApplicationProtocol { public: /** @@ -61,7 +61,7 @@ public: static Application* getInstance(); /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); + AX_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); /** @brief Get current language config diff --git a/core/platform/android/CCEnhanceAPI-android.h b/core/platform/android/CCEnhanceAPI-android.h index 04b7db35a9..2492975d61 100644 --- a/core/platform/android/CCEnhanceAPI-android.h +++ b/core/platform/android/CCEnhanceAPI-android.h @@ -24,7 +24,7 @@ NS_AX_BEGIN * Note: The minimum required Android version is 5.0. * */ -class CC_DLL EnhanceAPI +class AX_DLL EnhanceAPI { public: /** diff --git a/core/platform/android/CCFileUtils-android.h b/core/platform/android/CCFileUtils-android.h index 7c5ccbc743..b72cdc38c7 100644 --- a/core/platform/android/CCFileUtils-android.h +++ b/core/platform/android/CCFileUtils-android.h @@ -45,7 +45,7 @@ class ZipFile; */ //! @brief Helper class to handle file operations -class CC_DLL FileUtilsAndroid : public FileUtils +class AX_DLL FileUtilsAndroid : public FileUtils { friend class FileUtils; diff --git a/core/platform/android/CCGLViewImpl-android.cpp b/core/platform/android/CCGLViewImpl-android.cpp index e86b883970..dca7163635 100644 --- a/core/platform/android/CCGLViewImpl-android.cpp +++ b/core/platform/android/CCGLViewImpl-android.cpp @@ -58,7 +58,7 @@ GLViewImpl* GLViewImpl::createWithRect(std::string_view viewName, Rect rect, flo ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -70,7 +70,7 @@ GLViewImpl* GLViewImpl::create(std::string_view viewName) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -82,7 +82,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } diff --git a/core/platform/android/CCGLViewImpl-android.h b/core/platform/android/CCGLViewImpl-android.h index cfb2503990..1def117b5c 100644 --- a/core/platform/android/CCGLViewImpl-android.h +++ b/core/platform/android/CCGLViewImpl-android.h @@ -31,7 +31,7 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL GLViewImpl : public GLView +class AX_DLL GLViewImpl : public GLView { public: // static function diff --git a/core/platform/android/CCPlatformDefine-android.h b/core/platform/android/CCPlatformDefine-android.h index 2aae5c5521..c7d9598b74 100644 --- a/core/platform/android/CCPlatformDefine-android.h +++ b/core/platform/android/CCPlatformDefine-android.h @@ -27,25 +27,25 @@ THE SOFTWARE. #include -#define CC_DLL +#define AX_DLL -#define CC_NO_MESSAGE_PSEUDOASSERT(cond) \ +#define AX_NO_MESSAGE_PSEUDOASSERT(cond) \ if (!(cond)) \ { \ __android_log_print(ANDROID_LOG_ERROR, "cocos2d-x assert", "%s function:%s line:%d", __FILE__, __FUNCTION__, \ __LINE__); \ } -#define CC_MESSAGE_PSEUDOASSERT(cond, msg) \ +#define AX_MESSAGE_PSEUDOASSERT(cond, msg) \ if (!(cond)) \ { \ __android_log_print(ANDROID_LOG_ERROR, "cocos2d-x assert", "file:%s function:%s line:%d, %s", __FILE__, \ __FUNCTION__, __LINE__, msg); \ } -#define CC_ASSERT(cond) CC_NO_MESSAGE_PSEUDOASSERT(cond) +#define AX_ASSERT(cond) AX_NO_MESSAGE_PSEUDOASSERT(cond) -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam +#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam /* Define NULL pointer value */ #ifndef NULL diff --git a/core/platform/android/jni/JniHelper.h b/core/platform/android/jni/JniHelper.h index 0b1a2cbd6b..2e6f89af2a 100644 --- a/core/platform/android/jni/JniHelper.h +++ b/core/platform/android/jni/JniHelper.h @@ -70,7 +70,7 @@ typedef struct JniMethodInfo_ jmethodID methodID; } JniMethodInfo; -class CC_DLL JniHelper +class AX_DLL JniHelper { public: typedef std::unordered_map> LocalRefMapType; diff --git a/core/platform/apple/CCDevice-apple.mm b/core/platform/apple/CCDevice-apple.mm index 0ee63febf3..91e2c324a9 100644 --- a/core/platform/apple/CCDevice-apple.mm +++ b/core/platform/apple/CCDevice-apple.mm @@ -27,13 +27,13 @@ #include "platform/CCPlatformConfig.h" #include "platform/CCDevice.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_MAC # include # include # include -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#elif AX_TARGET_PLATFORM == AX_PLATFORM_IOS # import diff --git a/core/platform/apple/CCFileUtils-apple.h b/core/platform/apple/CCFileUtils-apple.h index ea4315cc71..09ad5df731 100644 --- a/core/platform/apple/CCFileUtils-apple.h +++ b/core/platform/apple/CCFileUtils-apple.h @@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_FILEUTILS_APPLE_H__ -#define __CC_FILEUTILS_APPLE_H__ +#ifndef __AX_FILEUTILS_APPLE_H__ +#define __AX_FILEUTILS_APPLE_H__ #include #include @@ -43,7 +43,7 @@ NS_AX_BEGIN */ //! @brief Helper class to handle file operations -class CC_DLL FileUtilsApple : public FileUtils +class AX_DLL FileUtilsApple : public FileUtils { public: FileUtilsApple(); @@ -54,7 +54,7 @@ public: virtual std::string getFullPathForFilenameWithinDirectory(std::string_view directory, std::string_view filename) const override; -#if CC_FILEUTILS_APPLE_ENABLE_OBJC +#if AX_FILEUTILS_APPLE_ENABLE_OBJC void setBundle(NSBundle* bundle); #endif @@ -76,4 +76,4 @@ private: NS_AX_END -#endif // __CC_FILEUTILS_APPLE_H__ +#endif // __AX_FILEUTILS_APPLE_H__ diff --git a/core/platform/apple/CCFileUtils-apple.mm b/core/platform/apple/CCFileUtils-apple.mm index d8bb0b5b93..1a213ce7c8 100644 --- a/core/platform/apple/CCFileUtils-apple.mm +++ b/core/platform/apple/CCFileUtils-apple.mm @@ -54,7 +54,7 @@ FileUtilsApple::FileUtilsApple() : pimpl_(new IMPL([NSBundle mainBundle])) {} FileUtilsApple::~FileUtilsApple() = default; -#if CC_FILEUTILS_APPLE_ENABLE_OBJC +#if AX_FILEUTILS_APPLE_ENABLE_OBJC void FileUtilsApple::setBundle(NSBundle* bundle) { pimpl_->setBundle(bundle); diff --git a/core/platform/desktop/CCGLViewImpl-desktop.cpp b/core/platform/desktop/CCGLViewImpl-desktop.cpp index 5e2a33000b..c30378bb83 100644 --- a/core/platform/desktop/CCGLViewImpl-desktop.cpp +++ b/core/platform/desktop/CCGLViewImpl-desktop.cpp @@ -48,9 +48,9 @@ THE SOFTWARE. # include "glfw3ext.h" #endif -#if CC_ICON_SET_SUPPORT +#if AX_ICON_SET_SUPPORT # include "platform/CCImage.h" -#endif /* CC_ICON_SET_SUPPORT */ +#endif /* AX_ICON_SET_SUPPORT */ #include "renderer/CCRenderer.h" @@ -306,7 +306,7 @@ GLViewImpl::GLViewImpl(bool initglfw) if (initglfw) { glfwSetErrorCallback(GLFWEventHandler::onGLFWError); -#if defined(CC_USE_GLES) && GLFW_VERSION_MAJOR >= 3 && GLFW_VERSION_MINOR >= 4 +#if defined(AX_USE_GLES) && GLFW_VERSION_MAJOR >= 3 && GLFW_VERSION_MINOR >= 4 glfwInitHint(GLFW_ANGLE_PLATFORM_TYPE, GLFW_ANGLE_PLATFORM_TYPE_D3D11); // since glfw-3.4 #endif #if defined(_WIN32) @@ -341,7 +341,7 @@ GLViewImpl* GLViewImpl::create(std::string_view viewName, bool resizable) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -353,7 +353,7 @@ GLViewImpl* GLViewImpl::createWithRect(std::string_view viewName, Rect rect, flo ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -365,7 +365,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -379,7 +379,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -389,7 +389,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ _frameZoomFactor = frameZoomFactor; -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); @@ -409,7 +409,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ glfwWindowHint(GLFW_VISIBLE, _glContextAttrs.visible); glfwWindowHint(GLFW_DECORATED, _glContextAttrs.decorated); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) // Don't create gl context. glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); #endif @@ -417,7 +417,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ int neededWidth = (int)(rect.size.width * _frameZoomFactor); int neededHeight = (int)(rect.size.height * _frameZoomFactor); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) glfwxSetParent((HWND)_glContextAttrs.viewParent); #endif @@ -489,7 +489,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ } // Will cause OpenGL error 0x0500 when use ANGLE-GLES on desktop -#if defined(CC_USE_GL) +#if defined(AX_USE_GL) // Enable point size by default. # if defined(GL_VERSION_2_0) glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); @@ -501,7 +501,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ #endif CHECK_GL_ERROR_DEBUG(); -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX glfwSwapInterval(_glContextAttrs.vsync ? 1 : 0); #endif @@ -577,7 +577,7 @@ void GLViewImpl::pollEvents() void GLViewImpl::enableRetina(bool enabled) { // official v4 comment follow sources - // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) + // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) // _isRetinaEnabled = enabled; // if (_isRetinaEnabled) // { @@ -593,7 +593,7 @@ void GLViewImpl::enableRetina(bool enabled) void GLViewImpl::setIMEKeyboardState(bool /*bOpen*/) {} -#if CC_ICON_SET_SUPPORT +#if AX_ICON_SET_SUPPORT void GLViewImpl::setIcon(std::string_view filename) const { this->setIcon(std::vector{filename}); @@ -613,7 +613,7 @@ void GLViewImpl::setIcon(const std::vector& filelist) const } else { - CC_SAFE_DELETE(icon); + AX_SAFE_DELETE(icon); } } @@ -633,10 +633,10 @@ void GLViewImpl::setIcon(const std::vector& filelist) const GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, iconsCount, images); - CC_SAFE_DELETE_ARRAY(images); + AX_SAFE_DELETE_ARRAY(images); for (auto& icon : icons) { - CC_SAFE_DELETE(icon); + AX_SAFE_DELETE(icon); } } @@ -645,7 +645,7 @@ void GLViewImpl::setDefaultIcon() const GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, 0, nullptr); } -#endif /* CC_ICON_SET_SUPPORT */ +#endif /* AX_ICON_SET_SUPPORT */ void GLViewImpl::setCursorVisible(bool isVisible) { @@ -749,7 +749,7 @@ void GLViewImpl::setWindowed(int width, int height) ypos += (int)((videoMode->height - height) * 0.5f); _monitor = nullptr; glfwSetWindowMonitor(_mainWindow, nullptr, xpos, ypos, width, height, GLFW_DONT_CARE); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) // on mac window will sometimes lose title when windowed glfwSetWindowTitle(_mainWindow, _viewName.c_str()); #endif @@ -1194,11 +1194,11 @@ static bool loadFboExtensions() // helper bool GLViewImpl::loadGL() { -#if (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_MAC) // glad: load all OpenGL function pointers // --------------------------------------- -# if defined(CC_USE_GL) +# if defined(AX_USE_GL) if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) { log("glad: Failed to Load GL"); @@ -1222,7 +1222,7 @@ bool GLViewImpl::loadGL() loadFboExtensions(); -#endif // (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) +#endif // (AX_TARGET_PLATFORM != AX_PLATFORM_MAC) return true; } diff --git a/core/platform/desktop/CCGLViewImpl-desktop.h b/core/platform/desktop/CCGLViewImpl-desktop.h index ec9c68d525..45e0b9242d 100644 --- a/core/platform/desktop/CCGLViewImpl-desktop.h +++ b/core/platform/desktop/CCGLViewImpl-desktop.h @@ -32,7 +32,7 @@ THE SOFTWARE. #include "platform/CCGLView.h" #include "glfw3.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # ifndef GLFW_EXPOSE_NATIVE_WIN32 # define GLFW_EXPOSE_NATIVE_WIN32 # endif @@ -40,9 +40,9 @@ THE SOFTWARE. # define GLFW_EXPOSE_NATIVE_WGL # endif # include "glfw3native.h" -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # ifndef GLFW_EXPOSE_NATIVE_NSGL # define GLFW_EXPOSE_NATIVE_NSGL # endif @@ -50,12 +50,12 @@ THE SOFTWARE. # define GLFW_EXPOSE_NATIVE_COCOA # endif # include "glfw3native.h" -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) NS_AX_BEGIN class GLFWEventHandler; -class CC_DLL GLViewImpl : public GLView +class AX_DLL GLViewImpl : public GLView { friend class GLFWEventHandler; @@ -120,11 +120,11 @@ public: virtual void setFrameSize(float width, float height) override; virtual void setIMEKeyboardState(bool bOpen) override; -#if CC_ICON_SET_SUPPORT +#if AX_ICON_SET_SUPPORT virtual void setIcon(std::string_view filename) const override; virtual void setIcon(const std::vector& filelist) const override; virtual void setDefaultIcon() const override; -#endif /* CC_ICON_SET_SUPPORT */ +#endif /* AX_ICON_SET_SUPPORT */ /* * Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop. @@ -144,14 +144,14 @@ public: /** Get retina factor */ int getRetinaFactor() const override { return _retinaFactor; } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) HWND getWin32Window() { return glfwGetWin32Window(_mainWindow); } -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) id getCocoaWindow() override { return glfwGetCocoaWindow(_mainWindow); } id getNSGLContext() override { return glfwGetNSGLContext(_mainWindow); } // stevetranby: added -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) protected: GLViewImpl(bool initglfw = true); @@ -202,7 +202,7 @@ public: static const std::string EVENT_WINDOW_UNFOCUSED; private: - CC_DISALLOW_COPY_AND_ASSIGN(GLViewImpl); + AX_DISALLOW_COPY_AND_ASSIGN(GLViewImpl); }; NS_AX_END // end of namespace cocos2d diff --git a/core/platform/ios/CCApplication-ios.h b/core/platform/ios/CCApplication-ios.h index 52f355a06f..bdb721dfb6 100644 --- a/core/platform/ios/CCApplication-ios.h +++ b/core/platform/ios/CCApplication-ios.h @@ -30,7 +30,7 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL Application : public ApplicationProtocol +class AX_DLL Application : public ApplicationProtocol { public: /** diff --git a/core/platform/ios/CCApplication-ios.mm b/core/platform/ios/CCApplication-ios.mm index 02ade1b8f3..4efe993e1b 100644 --- a/core/platform/ios/CCApplication-ios.mm +++ b/core/platform/ios/CCApplication-ios.mm @@ -37,13 +37,13 @@ Application* Application::sm_pSharedApplication = nullptr; Application::Application() { - CC_ASSERT(!sm_pSharedApplication); + AX_ASSERT(!sm_pSharedApplication); sm_pSharedApplication = this; } Application::~Application() { - CC_ASSERT(this == sm_pSharedApplication); + AX_ASSERT(this == sm_pSharedApplication); sm_pSharedApplication = 0; } @@ -67,7 +67,7 @@ void Application::setAnimationInterval(float interval) Application* Application::getInstance() { - CC_ASSERT(sm_pSharedApplication); + AX_ASSERT(sm_pSharedApplication); return sm_pSharedApplication; } diff --git a/core/platform/ios/CCCommon-ios.mm b/core/platform/ios/CCCommon-ios.mm index 9b135c617f..549aabd01c 100644 --- a/core/platform/ios/CCCommon-ios.mm +++ b/core/platform/ios/CCCommon-ios.mm @@ -40,7 +40,7 @@ void ccMessageBox(const char* msg, const char* title) { // only enable it on iOS. // FIXME: Implement it for tvOS -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) NSString* tmpTitle = (title) ? [NSString stringWithUTF8String:title] : nil; NSString* tmpMsg = (msg) ? [NSString stringWithUTF8String:msg] : nil; diff --git a/core/platform/ios/CCDevice-ios.mm b/core/platform/ios/CCDevice-ios.mm index 6b87000ffd..f2c8c42b2a 100644 --- a/core/platform/ios/CCDevice-ios.mm +++ b/core/platform/ios/CCDevice-ios.mm @@ -33,7 +33,7 @@ #include "platform/apple/CCDevice-apple.h" // Accelerometer -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) # import #endif #import @@ -189,7 +189,7 @@ static CGSize _calculateShrinkedSizeForString(NSAttributedString** str, #define SENSOR_DELAY_GAME 0.02 -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) @interface CCAccelerometerDispatcher : NSObject { axis::Acceleration* _acceleration; CMMotionManager* _motionManager; @@ -302,7 +302,7 @@ static CCAccelerometerDispatcher* s_pAccelerometerDispatcher; dispatcher->dispatchEvent(&event); } @end -#endif // !defined(CC_TARGET_OS_TVOS) +#endif // !defined(AX_TARGET_OS_TVOS) // @@ -340,14 +340,14 @@ int Device::getDPI() void Device::setAccelerometerEnabled(bool isEnabled) { -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [[CCAccelerometerDispatcher sharedAccelerometerDispatcher] setAccelerometerEnabled:isEnabled]; #endif } void Device::setAccelerometerInterval(float interval) { -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [[CCAccelerometerDispatcher sharedAccelerometerDispatcher] setAccelerometerInterval:interval]; #endif } @@ -443,14 +443,14 @@ static bool _initWithString(const char* text, bool bRet = false; do { - CC_BREAK_IF(!text || !info); + AX_BREAK_IF(!text || !info); id font = _createSystemFont(fontName, size); - CC_BREAK_IF(!font); + AX_BREAK_IF(!font); NSString* str = [NSString stringWithUTF8String:text]; - CC_BREAK_IF(!str); + AX_BREAK_IF(!str); CGSize dimensions; dimensions.width = info->width; @@ -487,7 +487,7 @@ static bool _initWithString(const char* text, realDimensions = _calculateStringSize(stringWithAttributes, font, &dimensions, enableWrap, overflow); } - CC_BREAK_IF(realDimensions.width <= 0 || realDimensions.height <= 0); + AX_BREAK_IF(realDimensions.width <= 0 || realDimensions.height <= 0); if (dimensions.width <= 0) { dimensions.width = realDimensions.width; @@ -517,7 +517,7 @@ static bool _initWithString(const char* text, if (!context) { CGColorSpaceRelease(colorSpace); - CC_SAFE_FREE(data); + AX_SAFE_FREE(data); break; } diff --git a/core/platform/ios/CCDirectorCaller-ios.mm b/core/platform/ios/CCDirectorCaller-ios.mm index 9cbd9a2139..a7210ba839 100644 --- a/core/platform/ios/CCDirectorCaller-ios.mm +++ b/core/platform/ios/CCDirectorCaller-ios.mm @@ -138,7 +138,7 @@ static id s_sharedDirectorCaller; if (isAppActive) { axis::Director* director = axis::Director::getInstance(); -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) EAGLContext* cocos2dxContext = [(CCEAGLView*)director->getOpenGLView()->getEAGLView() context]; if (cocos2dxContext != [EAGLContext currentContext]) glFlush(); diff --git a/core/platform/ios/CCEAGLView-ios.h b/core/platform/ios/CCEAGLView-ios.h index 5c70cf73b0..5ad547b20a 100644 --- a/core/platform/ios/CCEAGLView-ios.h +++ b/core/platform/ios/CCEAGLView-ios.h @@ -68,7 +68,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. #import #import "platform/CCPlatformConfig.h" -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) # import "platform/ios/CCESRenderer-ios.h" #endif @@ -80,7 +80,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. * Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. */ @interface CCEAGLView : UIView { -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) id renderer_; #endif BOOL preserveBackbuffer_; @@ -129,7 +129,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. /** returns surface size in pixels */ @property(nonatomic, readonly) CGSize surfaceSize; -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) /** OpenGL context */ @property(nonatomic, readonly) EAGLContext* context; #endif diff --git a/core/platform/ios/CCEAGLView-ios.mm b/core/platform/ios/CCEAGLView-ios.mm index 716c8b8af2..40ff8f96cc 100644 --- a/core/platform/ios/CCEAGLView-ios.mm +++ b/core/platform/ios/CCEAGLView-ios.mm @@ -69,7 +69,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. #import "base/CCIMEDispatcher.h" #import "platform/ios/CCInputView-ios.h" -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) # import # import "renderer/backend/metal/DeviceMTL.h" # import "renderer/backend/metal/UtilsMTL.h" @@ -94,7 +94,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. @synthesize surfaceSize = size_; @synthesize pixelFormat = pixelformat_, depthFormat = depthFormat_; -#if !defined(CC_USE_METAL) +#if !defined(AX_USE_METAL) @synthesize context = context_; #endif @synthesize multiSampling = multiSampling_; @@ -104,7 +104,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. + (Class)layerClass { -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) return [CAMetalLayer class]; #else return [CAEAGLLayer class]; @@ -190,7 +190,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. self.contentScaleFactor = [[UIScreen mainScreen] scale]; } -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) id device = MTLCreateSystemDefaultDevice(); if (!device) { @@ -224,7 +224,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. if ((self = [super initWithCoder:aDecoder])) { self.textInputView = [[CCInputView alloc] initWithCoder:aDecoder]; -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) size_ = [self bounds].size; #else CAEAGLLayer* eaglLayer = (CAEAGLLayer*)[self layer]; @@ -258,7 +258,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. return (int)bound.height * self.contentScaleFactor; } -#if !defined(CC_USE_METAL) +#if !defined(AX_USE_METAL) - (BOOL)setupSurfaceWithSharegroup:(EAGLSharegroup*)sharegroup { CAEAGLLayer* eaglLayer = (CAEAGLLayer*)self.layer; @@ -296,7 +296,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; // remove keyboard notification -#if !defined(CC_USE_METAL) +#if !defined(AX_USE_METAL) [renderer_ release]; #endif [self.textInputView release]; @@ -308,7 +308,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. if (!axis::Director::getInstance()->isValid()) return; -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) size_ = [self bounds].size; size_.width *= self.contentScaleFactor; size_.height *= self.contentScaleFactor; @@ -333,7 +333,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. } } -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) - (void)swapBuffers {} #else @@ -582,7 +582,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. dis /= self.contentScaleFactor; -#if defined(CC_TARGET_OS_TVOS) +#if defined(AX_TARGET_OS_TVOS) self.frame = CGRectMake(originalRect_.origin.x, originalRect_.origin.y - dis, originalRect_.size.width, originalRect_.size.height); #else @@ -626,7 +626,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. #pragma UIKeyboard notification -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) namespace { UIInterfaceOrientation getFixedOrientation(UIInterfaceOrientation statusBarOrientation) @@ -642,7 +642,7 @@ UIInterfaceOrientation getFixedOrientation(UIInterfaceOrientation statusBarOrien - (void)didMoveToWindow { -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onUIKeyboardNotification:) name:UIKeyboardWillShowNotification diff --git a/core/platform/ios/CCES2Renderer-ios.h b/core/platform/ios/CCES2Renderer-ios.h index 6dfccb9f7a..7270125c81 100644 --- a/core/platform/ios/CCES2Renderer-ios.h +++ b/core/platform/ios/CCES2Renderer-ios.h @@ -30,7 +30,7 @@ // But in case they are included, it won't be compiled. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS # import "platform/ios/CCESRenderer-ios.h" @@ -80,4 +80,4 @@ - (BOOL)resizeFromLayer:(CAEAGLLayer*)layer; @end -#endif // CC_PLATFORM_IOS +#endif // AX_PLATFORM_IOS diff --git a/core/platform/ios/CCES2Renderer-ios.m b/core/platform/ios/CCES2Renderer-ios.m index 0a41819426..f12c53a248 100644 --- a/core/platform/ios/CCES2Renderer-ios.m +++ b/core/platform/ios/CCES2Renderer-ios.m @@ -30,7 +30,7 @@ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS #import "platform/ios/CCES2Renderer-ios.h" // #import "platform/CCPlatformMacros.h" @@ -254,4 +254,4 @@ @end -#endif // CC_PLATFORM_IOS +#endif // AX_PLATFORM_IOS diff --git a/core/platform/ios/CCESRenderer-ios.h b/core/platform/ios/CCESRenderer-ios.h index 33602e8a46..f75de29a38 100644 --- a/core/platform/ios/CCESRenderer-ios.h +++ b/core/platform/ios/CCESRenderer-ios.h @@ -30,7 +30,7 @@ // But in case they are included, it won't be compiled. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS // # include "platform/CCPlatformMacros.h" # import @@ -57,4 +57,4 @@ - (unsigned int)msaaColorBuffer; @end -#endif // CC_PLATFORM_IOS +#endif // AX_PLATFORM_IOS diff --git a/core/platform/ios/CCGL-ios.h b/core/platform/ios/CCGL-ios.h index 74a2ae6efd..cfbdbe9724 100644 --- a/core/platform/ios/CCGL-ios.h +++ b/core/platform/ios/CCGL-ios.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __PLATFORM_IOS_CCGL_H__ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS # define glClearDepth glClearDepthf # define glDeleteVertexArrays glDeleteVertexArraysOES @@ -126,6 +126,6 @@ THE SOFTWARE. # define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD # endif -#endif // CC_PLATFORM_IOS +#endif // AX_PLATFORM_IOS #endif // __PLATFORM_IOS_CCGL_H__ diff --git a/core/platform/ios/CCGLViewImpl-ios.h b/core/platform/ios/CCGLViewImpl-ios.h index dcd5104ac7..9125c14c48 100644 --- a/core/platform/ios/CCGLViewImpl-ios.h +++ b/core/platform/ios/CCGLViewImpl-ios.h @@ -33,7 +33,7 @@ NS_AX_BEGIN /** Class that represent the OpenGL View */ -class CC_DLL GLViewImpl : public GLView +class AX_DLL GLViewImpl : public GLView { public: /** creates a GLViewImpl with a objective-c CCEAGLViewImpl instance */ diff --git a/core/platform/ios/CCGLViewImpl-ios.mm b/core/platform/ios/CCGLViewImpl-ios.mm index b704ebce4e..e483af0481 100644 --- a/core/platform/ios/CCGLViewImpl-ios.mm +++ b/core/platform/ios/CCGLViewImpl-ios.mm @@ -45,7 +45,7 @@ GLViewImpl* GLViewImpl::createWithEAGLView(void* eaglview) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -57,7 +57,7 @@ GLViewImpl* GLViewImpl::create(std::string_view viewName) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -69,7 +69,7 @@ GLViewImpl* GLViewImpl::createWithRect(std::string_view viewName, const Rect& re ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -81,7 +81,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -151,7 +151,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, const Rect& rect, float numberOfSamples:0]; // Not available on tvOS -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [eaglview setMultipleTouchEnabled:YES]; #endif @@ -183,7 +183,7 @@ bool GLViewImpl::isOpenGLReady() bool GLViewImpl::setContentScaleFactor(float contentScaleFactor) { - CC_ASSERT(_resolutionPolicy == ResolutionPolicy::UNKNOWN); // cannot enable retina mode + AX_ASSERT(_resolutionPolicy == ResolutionPolicy::UNKNOWN); // cannot enable retina mode _scaleX = _scaleY = contentScaleFactor; CCEAGLView* eaglview = (CCEAGLView*)_eaglview; diff --git a/core/platform/ios/CCPlatformDefine-ios.h b/core/platform/ios/CCPlatformDefine-ios.h index 29d76f68ee..a7b94804a4 100644 --- a/core/platform/ios/CCPlatformDefine-ios.h +++ b/core/platform/ios/CCPlatformDefine-ios.h @@ -27,11 +27,11 @@ THE SOFTWARE. #include -#define CC_DLL +#define AX_DLL -#define CC_ASSERT(cond) assert(cond) +#define AX_ASSERT(cond) assert(cond) -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam +#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam /* Define NULL pointer value */ #ifndef NULL diff --git a/core/platform/ios/OpenGL_Internal-ios.h b/core/platform/ios/OpenGL_Internal-ios.h index c9c888d902..66d685a842 100644 --- a/core/platform/ios/OpenGL_Internal-ios.h +++ b/core/platform/ios/OpenGL_Internal-ios.h @@ -62,7 +62,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. */ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS /* Generic error reporting */ # define REPORT_ERROR(__FORMAT__, ...) \ @@ -101,4 +101,4 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. self->__DELEGATE_METHODS_IVAR__ &= ~(1 << __BIT__); \ } -#endif // CC_PLATFORM_IOS +#endif // AX_PLATFORM_IOS diff --git a/core/platform/linux/CCApplication-linux.cpp b/core/platform/linux/CCApplication-linux.cpp index 7d7b6580b2..b41cadfa1a 100644 --- a/core/platform/linux/CCApplication-linux.cpp +++ b/core/platform/linux/CCApplication-linux.cpp @@ -39,13 +39,13 @@ Application* Application::sm_pSharedApplication = nullptr; Application::Application() : _animationInterval(16666667) { - CC_ASSERT(!sm_pSharedApplication); + AX_ASSERT(!sm_pSharedApplication); sm_pSharedApplication = this; } Application::~Application() { - CC_ASSERT(this == sm_pSharedApplication); + AX_ASSERT(this == sm_pSharedApplication); sm_pSharedApplication = nullptr; } @@ -145,7 +145,7 @@ bool Application::openURL(std::string_view url) ////////////////////////////////////////////////////////////////////////// Application* Application::getInstance() { - CC_ASSERT(sm_pSharedApplication); + AX_ASSERT(sm_pSharedApplication); return sm_pSharedApplication; } diff --git a/core/platform/linux/CCApplication-linux.h b/core/platform/linux/CCApplication-linux.h index fdcb1933b5..3fb5d00250 100644 --- a/core/platform/linux/CCApplication-linux.h +++ b/core/platform/linux/CCApplication-linux.h @@ -64,7 +64,7 @@ public: static Application* getInstance(); /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); + AX_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); /* override functions */ virtual LanguageType getCurrentLanguage() override; @@ -91,13 +91,13 @@ public: * Sets the Resource root path. * @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead. */ - CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(std::string_view rootResDir); + AX_DEPRECATED_ATTRIBUTE void setResourceRootPath(std::string_view rootResDir); /** * Gets the Resource root path. * @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. */ - CC_DEPRECATED_ATTRIBUTE std::string_view getResourceRootPath(); + AX_DEPRECATED_ATTRIBUTE std::string_view getResourceRootPath(); /** @brief Get target platform diff --git a/core/platform/linux/CCDevice-linux.cpp b/core/platform/linux/CCDevice-linux.cpp index 297bcbacc6..e39d167a5d 100644 --- a/core/platform/linux/CCDevice-linux.cpp +++ b/core/platform/linux/CCDevice-linux.cpp @@ -558,8 +558,8 @@ Data Device::getTextureDataForText(const char* text, { BitmapDC& dc = sharedBitmapDC(); - CC_BREAK_IF(!dc.getBitmap(text, textDefinition, align)); - CC_BREAK_IF(!dc._data); + AX_BREAK_IF(!dc.getBitmap(text, textDefinition, align)); + AX_BREAK_IF(!dc._data); width = dc.iMaxLineWidth; height = dc.iMaxLineHeight; dc.reset(); diff --git a/core/platform/linux/CCFileUtils-linux.h b/core/platform/linux/CCFileUtils-linux.h index cb27c0c02b..19f23eabf1 100644 --- a/core/platform/linux/CCFileUtils-linux.h +++ b/core/platform/linux/CCFileUtils-linux.h @@ -39,7 +39,7 @@ NS_AX_BEGIN */ //! @brief Helper class to handle file operations -class CC_DLL FileUtilsLinux : public FileUtils +class AX_DLL FileUtilsLinux : public FileUtils { friend class FileUtils; diff --git a/core/platform/linux/CCPlatformDefine-linux.h b/core/platform/linux/CCPlatformDefine-linux.h index af6bfc961f..5d25b55a84 100644 --- a/core/platform/linux/CCPlatformDefine-linux.h +++ b/core/platform/linux/CCPlatformDefine-linux.h @@ -27,11 +27,11 @@ THE SOFTWARE. #include -#define CC_DLL +#define AX_DLL #include -#define CC_ASSERT(cond) assert(cond) -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam +#define AX_ASSERT(cond) assert(cond) +#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam /* Define NULL pointer value */ #ifndef NULL diff --git a/core/platform/mac/CCApplication-mac.h b/core/platform/mac/CCApplication-mac.h index 635fa06431..eababe7373 100644 --- a/core/platform/mac/CCApplication-mac.h +++ b/core/platform/mac/CCApplication-mac.h @@ -32,7 +32,7 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL Application : public ApplicationProtocol +class AX_DLL Application : public ApplicationProtocol { public: /** diff --git a/core/platform/mac/CCDevice-mac.mm b/core/platform/mac/CCDevice-mac.mm index 2458a0d452..3f59fcd85e 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]; - CC_BREAK_IF(!string); + AX_BREAK_IF(!string); id font = _createSystemFont(fontName, size); - CC_BREAK_IF(!font); + AX_BREAK_IF(!font); // color NSColor* foregroundColor; @@ -328,7 +328,7 @@ static bool _initWithString(const char* text, realDimensions = _calculateStringSize(stringWithAttributes, font, &dimensions, enableWrap, overflow); // Mac crashes if the width or height is 0 - CC_BREAK_IF(realDimensions.width <= 0 || realDimensions.height <= 0); + AX_BREAK_IF(realDimensions.width <= 0 || realDimensions.height <= 0); if (dimensions.width <= 0.f) dimensions.width = realDimensions.width; diff --git a/core/platform/mac/CCGL-mac.h b/core/platform/mac/CCGL-mac.h index 91a7e42189..5a932ef8ed 100644 --- a/core/platform/mac/CCGL-mac.h +++ b/core/platform/mac/CCGL-mac.h @@ -28,13 +28,13 @@ THE SOFTWARE. #define __PLATFORM_MAC_CCGL_H__ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_MAC # import # import # import -# define CC_GL_DEPTH24_STENCIL8 -1 +# define AX_GL_DEPTH24_STENCIL8 -1 # define glDeleteVertexArrays glDeleteVertexArraysAPPLE # define glGenVertexArrays glGenVertexArraysAPPLE @@ -109,4 +109,4 @@ THE SOFTWARE. #endif // __PLATFORM_MAC_CCGL_H__ -#endif // s CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#endif // s AX_TARGET_PLATFORM == AX_PLATFORM_MAC diff --git a/core/platform/mac/CCGLViewImpl-mac.h b/core/platform/mac/CCGLViewImpl-mac.h index b1bceb5e98..a59cc5bf31 100644 --- a/core/platform/mac/CCGLViewImpl-mac.h +++ b/core/platform/mac/CCGLViewImpl-mac.h @@ -30,7 +30,7 @@ THE SOFTWARE. #include "platform/CCGLView.h" #include "glfw3.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # ifndef GLFW_EXPOSE_NATIVE_WIN32 # define GLFW_EXPOSE_NATIVE_WIN32 # endif @@ -38,9 +38,9 @@ THE SOFTWARE. # define GLFW_EXPOSE_NATIVE_WGL # endif # include "glfw3native.h" -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # ifndef GLFW_EXPOSE_NATIVE_NSGL # define GLFW_EXPOSE_NATIVE_NSGL # endif @@ -48,12 +48,12 @@ THE SOFTWARE. # define GLFW_EXPOSE_NATIVE_COCOA # endif # include "glfw3native.h" -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) NS_AX_BEGIN class GLFWEventHandler; -class CC_DLL GLViewImpl : public GLView +class AX_DLL GLViewImpl : public GLView { friend class GLFWEventHandler; @@ -118,11 +118,11 @@ public: virtual void setFrameSize(float width, float height) override; virtual void setIMEKeyboardState(bool bOpen) override; -#if CC_ICON_SET_SUPPORT +#if AX_ICON_SET_SUPPORT virtual void setIcon(std::string_view filename) const override; virtual void setIcon(const std::vector& filelist) const override; virtual void setDefaultIcon() const override; -#endif /* CC_ICON_SET_SUPPORT */ +#endif /* AX_ICON_SET_SUPPORT */ /* * Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop. @@ -191,7 +191,7 @@ public: static const std::string EVENT_WINDOW_UNFOCUSED; private: - CC_DISALLOW_COPY_AND_ASSIGN(GLViewImpl); + AX_DISALLOW_COPY_AND_ASSIGN(GLViewImpl); }; NS_AX_END // end of namespace cocos2d diff --git a/core/platform/mac/CCGLViewImpl-mac.mm b/core/platform/mac/CCGLViewImpl-mac.mm index 22f825d7d2..20c028078d 100644 --- a/core/platform/mac/CCGLViewImpl-mac.mm +++ b/core/platform/mac/CCGLViewImpl-mac.mm @@ -39,9 +39,9 @@ THE SOFTWARE. #include "base/ccUtils.h" #include "base/ccUTF8.h" #include "2d/CCCamera.h" -#if CC_ICON_SET_SUPPORT +#if AX_ICON_SET_SUPPORT # include "platform/CCImage.h" -#endif /* CC_ICON_SET_SUPPORT */ +#endif /* AX_ICON_SET_SUPPORT */ #include "renderer/backend/metal/DeviceMTL.h" #include "renderer/CCRenderer.h" #include "renderer/backend/metal/UtilsMTL.h" @@ -322,7 +322,7 @@ GLViewImpl* GLViewImpl::create(std::string_view viewName, bool resizable) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -334,7 +334,7 @@ GLViewImpl* GLViewImpl::createWithRect(std::string_view viewName, Rect rect, flo ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -346,7 +346,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -360,7 +360,7 @@ GLViewImpl* GLViewImpl::createWithFullScreen(std::string_view viewName, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -380,7 +380,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ glfwWindowHint(GLFW_SAMPLES, _glContextAttrs.multisamplingCount); -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) // Don't create gl context. glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); #endif @@ -410,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(CC_USE_METAL) +#if defined(AX_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(CC_USE_GL) +#if defined(AX_USE_GL) glfwMakeContextCurrent(_mainWindow); glfwSwapInterval(_glContextAttrs.vsync ? 1 : 0); #endif @@ -519,7 +519,7 @@ void GLViewImpl::end() void GLViewImpl::swapBuffers() { -#if defined(CC_USE_GL) +#if defined(AX_USE_GL) if (_mainWindow) glfwSwapBuffers(_mainWindow); #endif @@ -554,7 +554,7 @@ void GLViewImpl::enableRetina(bool enabled) void GLViewImpl::setIMEKeyboardState(bool /*bOpen*/) {} -#if CC_ICON_SET_SUPPORT +#if AX_ICON_SET_SUPPORT void GLViewImpl::setIcon(std::string_view filename) const { std::vector vec = {filename}; @@ -575,7 +575,7 @@ void GLViewImpl::setIcon(const std::vector& filelist) const } else { - CC_SAFE_DELETE(icon); + AX_SAFE_DELETE(icon); } } @@ -595,10 +595,10 @@ void GLViewImpl::setIcon(const std::vector& filelist) const GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, iconsCount, images); - CC_SAFE_DELETE_ARRAY(images); + AX_SAFE_DELETE_ARRAY(images); for (auto& icon : icons) { - CC_SAFE_DELETE(icon); + AX_SAFE_DELETE(icon); } } @@ -607,7 +607,7 @@ void GLViewImpl::setDefaultIcon() const GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, 0, nullptr); } -#endif /* CC_ICON_SET_SUPPORT */ +#endif /* AX_ICON_SET_SUPPORT */ void GLViewImpl::setCursorVisible(bool isVisible) { @@ -711,7 +711,7 @@ void GLViewImpl::setWindowed(int width, int height) ypos += (int)((videoMode->height - height) * 0.5f); _monitor = nullptr; glfwSetWindowMonitor(_mainWindow, nullptr, xpos, ypos, width, height, GLFW_DONT_CARE); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) // on mac window will sometimes lose title when windowed glfwSetWindowTitle(_mainWindow, _viewName.c_str()); #endif @@ -1030,7 +1030,7 @@ void GLViewImpl::onGLFWWindowSizeCallback(GLFWwindow* /*window*/, int width, int Director::getInstance()->setViewport(); Director::getInstance()->getEventDispatcher()->dispatchCustomEvent(GLViewImpl::EVENT_WINDOW_RESIZED, nullptr); -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) // update metal attachment texture size. int fbWidth, fbHeight; glfwGetFramebufferSize(_mainWindow, &fbWidth, &fbHeight); diff --git a/core/platform/mac/CCPlatformDefine-mac.h b/core/platform/mac/CCPlatformDefine-mac.h index 8681478aac..41e403f93e 100644 --- a/core/platform/mac/CCPlatformDefine-mac.h +++ b/core/platform/mac/CCPlatformDefine-mac.h @@ -27,15 +27,15 @@ THE SOFTWARE. #include -#define CC_DLL +#define AX_DLL -#if CC_DISABLE_ASSERT > 0 -# define CC_ASSERT(cond) +#if AX_DISABLE_ASSERT > 0 +# define AX_ASSERT(cond) #else -# define CC_ASSERT(cond) assert(cond) +# define AX_ASSERT(cond) assert(cond) #endif -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam +#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam /* Define NULL pointer value */ #ifndef NULL diff --git a/core/platform/win32/CCApplication-win32.cpp b/core/platform/win32/CCApplication-win32.cpp index 8bf743da57..6bb58c55ca 100644 --- a/core/platform/win32/CCApplication-win32.cpp +++ b/core/platform/win32/CCApplication-win32.cpp @@ -49,13 +49,13 @@ Application::Application() : _instance(nullptr), _accelTable(nullptr) { _instance = GetModuleHandle(nullptr); _animationInterval.QuadPart = 0; - CC_ASSERT(!sm_pSharedApplication); + AX_ASSERT(!sm_pSharedApplication); sm_pSharedApplication = this; } Application::~Application() { - CC_ASSERT(this == sm_pSharedApplication); + AX_ASSERT(this == sm_pSharedApplication); sm_pSharedApplication = nullptr; } @@ -155,7 +155,7 @@ void Application::setAnimationInterval(float interval) ////////////////////////////////////////////////////////////////////////// Application* Application::getInstance() { - CC_ASSERT(sm_pSharedApplication); + AX_ASSERT(sm_pSharedApplication); return sm_pSharedApplication; } diff --git a/core/platform/win32/CCApplication-win32.h b/core/platform/win32/CCApplication-win32.h index d31ced54f1..bc2f3344c8 100644 --- a/core/platform/win32/CCApplication-win32.h +++ b/core/platform/win32/CCApplication-win32.h @@ -32,7 +32,7 @@ THE SOFTWARE. NS_AX_BEGIN -class CC_DLL Application : public ApplicationProtocol +class AX_DLL Application : public ApplicationProtocol { public: /** @@ -84,13 +84,13 @@ public: * Sets the Resource root path. * @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead. */ - CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(std::string_view rootResDir); + AX_DEPRECATED_ATTRIBUTE void setResourceRootPath(std::string_view rootResDir); /** * Gets the Resource root path. * @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. */ - CC_DEPRECATED_ATTRIBUTE std::string_view getResourceRootPath(); + AX_DEPRECATED_ATTRIBUTE std::string_view getResourceRootPath(); void setStartupScriptFilename(std::string_view startupScriptFile); diff --git a/core/platform/win32/CCDevice-win32.cpp b/core/platform/win32/CCDevice-win32.cpp index e18b7eebca..f89546d4b8 100644 --- a/core/platform/win32/CCDevice-win32.cpp +++ b/core/platform/win32/CCDevice-win32.cpp @@ -143,7 +143,7 @@ public: SIZE tRet = {0}; do { - CC_BREAK_IF(!pszText || nLen <= 0); + AX_BREAK_IF(!pszText || nLen <= 0); RECT rc = {0, 0, 0, 0}; DWORD dwCalcFmt = DT_CALCRECT; @@ -232,7 +232,7 @@ public: wchar_t* fixedText = nullptr; do { - CC_BREAK_IF(!pszText); + AX_BREAK_IF(!pszText); DWORD dwFmt = DT_WORDBREAK; if (!enableWrap) @@ -259,7 +259,7 @@ public: // utf-8 to utf-16 int nBufLen = nLen + 1; pwszBuffer = new wchar_t[nBufLen]; - CC_BREAK_IF(!pwszBuffer); + AX_BREAK_IF(!pwszBuffer); memset(pwszBuffer, 0, sizeof(wchar_t) * nBufLen); nLen = MultiByteToWideChar(CP_UTF8, 0, pszText, nLen, pwszBuffer, nBufLen); @@ -353,7 +353,7 @@ public: } } - CC_BREAK_IF(!prepareBitmap(tSize.cx, tSize.cy)); + AX_BREAK_IF(!prepareBitmap(tSize.cx, tSize.cy)); // draw text HGDIOBJ hOldFont = SelectObject(_DC, _font); @@ -375,14 +375,14 @@ public: SelectObject(_DC, hOldBmp); SelectObject(_DC, hOldFont); } while (0); - CC_SAFE_DELETE_ARRAY(pwszBuffer); + AX_SAFE_DELETE_ARRAY(pwszBuffer); delete[] fixedText; return nRet; } - CC_SYNTHESIZE_READONLY(HDC, _DC, DC); - CC_SYNTHESIZE_READONLY(HBITMAP, _bmp, Bitmap); + AX_SYNTHESIZE_READONLY(HDC, _DC, DC); + AX_SYNTHESIZE_READONLY(HBITMAP, _bmp, Bitmap); private: friend class Image; @@ -426,12 +426,12 @@ Data Device::getTextureDataForText(const char* text, // draw text // does changing to SIZE here affects the font size by rounding from float? SIZE size = {(LONG)textDefinition._dimensions.width, (LONG)textDefinition._dimensions.height}; - CC_BREAK_IF(!dc.drawText(text, size, align, textDefinition._fontName.c_str(), (int)textDefinition._fontSize, + AX_BREAK_IF(!dc.drawText(text, size, align, textDefinition._fontName.c_str(), (int)textDefinition._fontSize, textDefinition._enableWrap, textDefinition._overflow)); int dataLen = size.cx * size.cy * 4; unsigned char* dataBuf = (unsigned char*)malloc(sizeof(unsigned char) * dataLen); - CC_BREAK_IF(!dataBuf); + AX_BREAK_IF(!dataBuf); struct { @@ -439,7 +439,7 @@ Data Device::getTextureDataForText(const char* text, int mask[4]; } bi = {0}; bi.bmiHeader.biSize = sizeof(bi.bmiHeader); - CC_BREAK_IF(!GetDIBits(dc.getDC(), dc.getBitmap(), 0, 0, nullptr, (LPBITMAPINFO)&bi, DIB_RGB_COLORS)); + AX_BREAK_IF(!GetDIBits(dc.getDC(), dc.getBitmap(), 0, 0, nullptr, (LPBITMAPINFO)&bi, DIB_RGB_COLORS)); width = (short)size.cx; height = (short)size.cy; @@ -473,12 +473,12 @@ Data Device::getTextureDataForText(const char* text, void Device::setKeepScreenOn(bool value) { - CC_UNUSED_PARAM(value); + AX_UNUSED_PARAM(value); } void Device::vibrate(float duration) { - CC_UNUSED_PARAM(duration); + AX_UNUSED_PARAM(duration); } NS_AX_END diff --git a/core/platform/win32/CCFileUtils-win32.h b/core/platform/win32/CCFileUtils-win32.h index 6a248f28fe..d47d1a48ca 100644 --- a/core/platform/win32/CCFileUtils-win32.h +++ b/core/platform/win32/CCFileUtils-win32.h @@ -41,7 +41,7 @@ NS_AX_BEGIN */ //! @brief Helper class to handle file operations -class CC_DLL FileUtilsWin32 : public FileUtils +class AX_DLL FileUtilsWin32 : public FileUtils { friend class FileUtils; diff --git a/core/platform/win32/CCGL-win32.h b/core/platform/win32/CCGL-win32.h index 86f919dd6c..449b3b6252 100644 --- a/core/platform/win32/CCGL-win32.h +++ b/core/platform/win32/CCGL-win32.h @@ -27,11 +27,11 @@ THE SOFTWARE. #pragma once #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include "glad/glad.h" -# if defined(CC_USE_GLES) +# if defined(AX_USE_GLES) # undef GL_DEPTH_STENCIL # undef GL_DEPTH24_STENCIL8 # undef GL_UNSIGNED_INT_24_8 @@ -90,4 +90,4 @@ THE SOFTWARE. # endif -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 diff --git a/core/platform/win32/CCPlatformDefine-win32.h b/core/platform/win32/CCPlatformDefine-win32.h index 1ccc2dc0cf..e3c65800e0 100644 --- a/core/platform/win32/CCPlatformDefine-win32.h +++ b/core/platform/win32/CCPlatformDefine-win32.h @@ -29,24 +29,24 @@ THE SOFTWARE. # include #endif -#if defined(CC_STATIC) -# define CC_DLL +#if defined(AX_STATIC) +# define AX_DLL #else # if defined(_USRDLL) -# define CC_DLL __declspec(dllexport) +# define AX_DLL __declspec(dllexport) # else /* use a DLL library */ -# define CC_DLL __declspec(dllimport) +# define AX_DLL __declspec(dllimport) # endif #endif #include -#if CC_DISABLE_ASSERT > 0 -# define CC_ASSERT(cond) +#if AX_DISABLE_ASSERT > 0 +# define AX_ASSERT(cond) #else -# define CC_ASSERT(cond) assert(cond) +# define AX_ASSERT(cond) assert(cond) #endif -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam +#define AX_UNUSED_PARAM(unusedparam) (void)unusedparam /* Define NULL pointer value */ #ifndef NULL diff --git a/core/platform/win32/CCStdC-win32.h b/core/platform/win32/CCStdC-win32.h index ad177da6a6..bac118457f 100644 --- a/core/platform/win32/CCStdC-win32.h +++ b/core/platform/win32/CCStdC-win32.h @@ -106,7 +106,7 @@ struct timezone int tz_dsttime; }; -int CC_DLL gettimeofday(struct timeval*, struct timezone*); +int AX_DLL gettimeofday(struct timeval*, struct timezone*); NS_AX_END diff --git a/core/platform/win32/compat/stdint.h b/core/platform/win32/compat/stdint.h index 7b95775d5a..cb188c58c1 100644 --- a/core/platform/win32/compat/stdint.h +++ b/core/platform/win32/compat/stdint.h @@ -33,7 +33,7 @@ #define _MSC_STDINT_H_ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # ifndef _MSC_VER // [ # error "Use this header only with Microsoft Visual C++ compilers!" @@ -243,6 +243,6 @@ typedef uint64_t uintmax_t; # endif // __STDC_CONSTANT_MACROS ] -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 #endif // _MSC_STDINT_H_ ] diff --git a/core/renderer/CCCallbackCommand.h b/core/renderer/CCCallbackCommand.h index 7b8d6c467c..cde6b6e29e 100644 --- a/core/renderer/CCCallbackCommand.h +++ b/core/renderer/CCCallbackCommand.h @@ -46,7 +46,7 @@ executed. You can do some logic opertion in the callback, such as invoking renderer to set depth/stencil test. Don't suggest to invoke backen API in the callback function. */ -class CC_DLL CallbackCommand : public RenderCommand +class AX_DLL CallbackCommand : public RenderCommand { // only allow render to manage the callbackCommand friend class Renderer; diff --git a/core/renderer/CCColorizer.h b/core/renderer/CCColorizer.h index 0aa10ff499..dcf568492e 100644 --- a/core/renderer/CCColorizer.h +++ b/core/renderer/CCColorizer.h @@ -11,7 +11,7 @@ # include NS_AX_BEGIN -class CC_DLL Colorizer +class AX_DLL Colorizer { public: static bool enableNodeIntelliShading(Node* node, const Vec3& hsv, const Vec3& filter = Vec3(1.0f, 0.45f, 0.3109f)); diff --git a/core/renderer/CCCustomCommand.cpp b/core/renderer/CCCustomCommand.cpp index f14c9cce2b..88f0d794d3 100644 --- a/core/renderer/CCCustomCommand.cpp +++ b/core/renderer/CCCustomCommand.cpp @@ -38,8 +38,8 @@ CustomCommand::CustomCommand() CustomCommand::~CustomCommand() { - CC_SAFE_RELEASE(_vertexBuffer); - CC_SAFE_RELEASE(_indexBuffer); + AX_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_indexBuffer); } CustomCommand::CustomCommand(const CustomCommand& rhs) @@ -85,8 +85,8 @@ void CustomCommand::assign(const CustomCommand& rhs) auto podSize = offsetof(CustomCommand, _beforeCallback) - podOffset; memcpy((uint8_t*)this + podOffset, (const uint8_t*)&rhs + podOffset, podSize); - CC_SAFE_RETAIN(_vertexBuffer); - CC_SAFE_RETAIN(_indexBuffer); + AX_SAFE_RETAIN(_vertexBuffer); + AX_SAFE_RETAIN(_indexBuffer); _beforeCallback = rhs._beforeCallback; _afterCallback = rhs._afterCallback; @@ -136,7 +136,7 @@ void CustomCommand::init(float globalZOrder, const BlendFunc& blendFunc) void CustomCommand::createVertexBuffer(std::size_t vertexSize, std::size_t capacity, BufferUsage usage) { - CC_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_vertexBuffer); _vertexCapacity = capacity; _vertexDrawCount = capacity; @@ -147,7 +147,7 @@ void CustomCommand::createVertexBuffer(std::size_t vertexSize, std::size_t capac void CustomCommand::createIndexBuffer(IndexFormat format, std::size_t capacity, BufferUsage usage) { - CC_SAFE_RELEASE(_indexBuffer); + AX_SAFE_RELEASE(_indexBuffer); _indexFormat = format; _indexSize = computeIndexSize(); @@ -175,9 +175,9 @@ void CustomCommand::setVertexBuffer(backend::Buffer* vertexBuffer) if (_vertexBuffer == vertexBuffer) return; - CC_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_vertexBuffer); _vertexBuffer = vertexBuffer; - CC_SAFE_RETAIN(_vertexBuffer); + AX_SAFE_RETAIN(_vertexBuffer); } void CustomCommand::setIndexBuffer(backend::Buffer* indexBuffer, IndexFormat format) @@ -185,9 +185,9 @@ void CustomCommand::setIndexBuffer(backend::Buffer* indexBuffer, IndexFormat for if (_indexBuffer == indexBuffer && _indexFormat == format) return; - CC_SAFE_RELEASE(_indexBuffer); + AX_SAFE_RELEASE(_indexBuffer); _indexBuffer = indexBuffer; - CC_SAFE_RETAIN(_indexBuffer); + AX_SAFE_RETAIN(_indexBuffer); _indexFormat = format; _indexSize = computeIndexSize(); diff --git a/core/renderer/CCCustomCommand.h b/core/renderer/CCCustomCommand.h index a9169df0f0..ef67cf6b18 100644 --- a/core/renderer/CCCustomCommand.h +++ b/core/renderer/CCCustomCommand.h @@ -42,7 +42,7 @@ class Buffer; Custom command is used to draw all things except triangle commands. You can use this command to draw things, just provide vertex/index data and set corret flags. */ -class CC_DLL CustomCommand : public RenderCommand +class AX_DLL CustomCommand : public RenderCommand { public: enum class DrawType diff --git a/core/renderer/CCGroupCommand.h b/core/renderer/CCGroupCommand.h index 92578b9f90..d767bdaad5 100644 --- a/core/renderer/CCGroupCommand.h +++ b/core/renderer/CCGroupCommand.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef _CC_GROUPCOMMAND_H_ -#define _CC_GROUPCOMMAND_H_ +#ifndef _AX_GROUPCOMMAND_H_ +#define _AX_GROUPCOMMAND_H_ #include #include @@ -59,7 +59,7 @@ protected: GroupCommand is used to group several command together, and more, it can be nested. So it is used to generate the hierarchy for the rendcommands. Every group command will be assigned by a group ID. */ -class CC_DLL GroupCommand : public RenderCommand +class AX_DLL GroupCommand : public RenderCommand { public: /**@{ @@ -85,4 +85,4 @@ NS_AX_END end of support group @} */ -#endif //_CC_GROUPCOMMAND_H_ +#endif //_AX_GROUPCOMMAND_H_ diff --git a/core/renderer/CCMaterial.cpp b/core/renderer/CCMaterial.cpp index 0cb537791a..9e17fca1d1 100644 --- a/core/renderer/CCMaterial.cpp +++ b/core/renderer/CCMaterial.cpp @@ -40,7 +40,7 @@ #include -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # define strcasecmp _stricmp #endif @@ -138,7 +138,7 @@ bool Material::initWithFile(std::string_view validfilename) // get the first material parseProperties((strlen(properties->getNamespace()) > 0) ? properties : properties->getNextNamespace()); - CC_SAFE_DELETE(properties); + AX_SAFE_DELETE(properties); return true; } @@ -408,8 +408,8 @@ bool Material::parseShader(Pass* pass, Properties* shaderProperties) } space = shaderProperties->getNextNamespace(); } - CC_SAFE_RELEASE(program); - CC_SAFE_RELEASE(programState); + AX_SAFE_RELEASE(program); + AX_SAFE_RELEASE(programState); } return true; @@ -554,7 +554,7 @@ Technique* Material::getTechniqueByName(std::string_view name) Technique* Material::getTechniqueByIndex(ssize_t index) { - CC_ASSERT(index >= 0 && index < _techniques.size() && "Invalid size"); + AX_ASSERT(index >= 0 && index < _techniques.size() && "Invalid size"); return _techniques.at(index); } diff --git a/core/renderer/CCMaterial.h b/core/renderer/CCMaterial.h index 2908d341fa..95505e8d8c 100644 --- a/core/renderer/CCMaterial.h +++ b/core/renderer/CCMaterial.h @@ -58,7 +58,7 @@ class ProgramState; } /// Material -class CC_DLL Material : public Ref +class AX_DLL Material : public Ref { friend class Node; friend class Technique; diff --git a/core/renderer/CCMeshCommand.cpp b/core/renderer/CCMeshCommand.cpp index 3cfe278a70..145e309d7a 100644 --- a/core/renderer/CCMeshCommand.cpp +++ b/core/renderer/CCMeshCommand.cpp @@ -44,16 +44,16 @@ NS_AX_BEGIN MeshCommand::MeshCommand() -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA : _rendererRecreatedListener(nullptr) #endif { _type = RenderCommand::Type::MESH_COMMAND; _is3D = true; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // listen the event that renderer was recreated on Android/WP8 _rendererRecreatedListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, - CC_CALLBACK_1(MeshCommand::listenRendererRecreated, this)); + AX_CALLBACK_1(MeshCommand::listenRendererRecreated, this)); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_rendererRecreatedListener, -1); #endif } @@ -75,12 +75,12 @@ void MeshCommand::init(float globalZOrder, const Mat4& transform) MeshCommand::~MeshCommand() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_rendererRecreatedListener); #endif } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA void MeshCommand::listenRendererRecreated(EventCustom* event) {} #endif diff --git a/core/renderer/CCMeshCommand.h b/core/renderer/CCMeshCommand.h index ce78a53ed5..6c912a2824 100644 --- a/core/renderer/CCMeshCommand.h +++ b/core/renderer/CCMeshCommand.h @@ -41,7 +41,7 @@ class EventCustom; class Material; // it is a common mesh -class CC_DLL MeshCommand : public CustomCommand +class AX_DLL MeshCommand : public CustomCommand { public: // using PrimitiveType = backend::PrimitiveType; @@ -73,12 +73,12 @@ public: void init(float globalZOrder, const Mat4& transform); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA void listenRendererRecreated(EventCustom* event); #endif protected: -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _rendererRecreatedListener; #endif }; diff --git a/core/renderer/CCPass.cpp b/core/renderer/CCPass.cpp index b3c27d98ff..6a2137071d 100644 --- a/core/renderer/CCPass.cpp +++ b/core/renderer/CCPass.cpp @@ -70,7 +70,7 @@ Pass* Pass::create(Technique* technique) pass->autorelease(); return pass; } - CC_SAFE_DELETE(pass); + AX_SAFE_DELETE(pass); return nullptr; } @@ -82,7 +82,7 @@ Pass* Pass::createWithProgramState(Technique* technique, backend::ProgramState* pass->autorelease(); return pass; } - CC_SAFE_DELETE(pass); + AX_SAFE_DELETE(pass); return nullptr; } @@ -103,8 +103,8 @@ Pass::Pass() {} Pass::~Pass() { - CC_SAFE_RELEASE(_vertexAttribBinding); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_vertexAttribBinding); + AX_SAFE_RELEASE(_programState); } Pass* Pass::clone() const @@ -115,7 +115,7 @@ Pass* Pass::clone() const pass->setProgramState(_programState->clone()); pass->_vertexAttribBinding = _vertexAttribBinding; - CC_SAFE_RETAIN(pass->_vertexAttribBinding); + AX_SAFE_RETAIN(pass->_vertexAttribBinding); pass->setTechnique(_technique); @@ -133,9 +133,9 @@ void Pass::setProgramState(backend::ProgramState* programState) { if (_programState != programState) { - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); _programState = programState; - CC_SAFE_RETAIN(_programState); + AX_SAFE_RETAIN(_programState); initUniformLocations(); _hashDirty = true; } @@ -183,8 +183,8 @@ void Pass::draw(MeshCommand* meshCommand, const Mat4& modelView) { - meshCommand->setBeforeCallback(CC_CALLBACK_0(Pass::onBeforeVisitCmd, this, meshCommand)); - meshCommand->setAfterCallback(CC_CALLBACK_0(Pass::onAfterVisitCmd, this, meshCommand)); + meshCommand->setBeforeCallback(AX_CALLBACK_0(Pass::onBeforeVisitCmd, this, meshCommand)); + meshCommand->setAfterCallback(AX_CALLBACK_0(Pass::onAfterVisitCmd, this, meshCommand)); meshCommand->init(globalZOrder, modelView); meshCommand->setPrimitiveType(primitive); meshCommand->setIndexBuffer(indexBuffer, indexFormat); @@ -263,9 +263,9 @@ void Pass::setVertexAttribBinding(VertexAttribBinding* binding) { if (_vertexAttribBinding != binding) { - CC_SAFE_RELEASE(_vertexAttribBinding); + AX_SAFE_RELEASE(_vertexAttribBinding); _vertexAttribBinding = binding; - CC_SAFE_RETAIN(_vertexAttribBinding); + AX_SAFE_RETAIN(_vertexAttribBinding); } } diff --git a/core/renderer/CCPass.h b/core/renderer/CCPass.h index 26963d9974..1c8ee68000 100644 --- a/core/renderer/CCPass.h +++ b/core/renderer/CCPass.h @@ -51,7 +51,7 @@ class ProgramState; class Buffer; } // namespace backend -class CC_DLL Pass : public Ref +class AX_DLL Pass : public Ref { friend class Material; friend class Technique; diff --git a/core/renderer/CCPipelineDescriptor.h b/core/renderer/CCPipelineDescriptor.h index 8b24a2cec0..92a109eecc 100644 --- a/core/renderer/CCPipelineDescriptor.h +++ b/core/renderer/CCPipelineDescriptor.h @@ -38,7 +38,7 @@ */ NS_AX_BEGIN -struct CC_DLL PipelineDescriptor +struct AX_DLL PipelineDescriptor { backend::ProgramState* programState = nullptr; backend::BlendDescriptor blendDescriptor; diff --git a/core/renderer/CCQuadCommand.cpp b/core/renderer/CCQuadCommand.cpp index 3442c1095f..60433a394e 100644 --- a/core/renderer/CCQuadCommand.cpp +++ b/core/renderer/CCQuadCommand.cpp @@ -43,7 +43,7 @@ QuadCommand::~QuadCommand() { for (auto& indices : _ownedIndices) { - CC_SAFE_DELETE_ARRAY(indices); + AX_SAFE_DELETE_ARRAY(indices); } } diff --git a/core/renderer/CCQuadCommand.h b/core/renderer/CCQuadCommand.h index ec36111b35..dd33a45eb6 100644 --- a/core/renderer/CCQuadCommand.h +++ b/core/renderer/CCQuadCommand.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef _CC_QUADCOMMAND_H_ -#define _CC_QUADCOMMAND_H_ +#ifndef _AX_QUADCOMMAND_H_ +#define _AX_QUADCOMMAND_H_ #include @@ -42,7 +42,7 @@ NS_AX_BEGIN Every QuadCommand will have generate material ID by give textureID, glProgramState, Blend function if the material id is the same, these QuadCommands could be batched to save draw call. */ -class CC_DLL QuadCommand : public TrianglesCommand +class AX_DLL QuadCommand : public TrianglesCommand { public: /**Constructor.*/ @@ -84,4 +84,4 @@ NS_AX_END end of support group @} */ -#endif //_CC_QUADCOMMAND_H_ +#endif //_AX_QUADCOMMAND_H_ diff --git a/core/renderer/CCRenderCommand.h b/core/renderer/CCRenderCommand.h index 7804bb1fbc..be72676521 100644 --- a/core/renderer/CCRenderCommand.h +++ b/core/renderer/CCRenderCommand.h @@ -39,7 +39,7 @@ NS_AX_BEGIN * The `Renderer` knows how to render `RenderCommands` objects. */ -class CC_DLL RenderCommand +class AX_DLL RenderCommand { public: /**Enum the type of render command. */ diff --git a/core/renderer/CCRenderCommandPool.h b/core/renderer/CCRenderCommandPool.h index 17474a772d..599c168934 100644 --- a/core/renderer/CCRenderCommandPool.h +++ b/core/renderer/CCRenderCommandPool.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_RENDERCOMMANDPOOL_H__ -#define __CC_RENDERCOMMANDPOOL_H__ +#ifndef __AX_RENDERCOMMANDPOOL_H__ +#define __AX_RENDERCOMMANDPOOL_H__ /// @cond DO_NOT_SHOW #include diff --git a/core/renderer/CCRenderState.cpp b/core/renderer/CCRenderState.cpp index cb34e99396..e5a6f3c866 100644 --- a/core/renderer/CCRenderState.cpp +++ b/core/renderer/CCRenderState.cpp @@ -46,7 +46,7 @@ std::string RenderState::getName() const void RenderState::bindPass(Pass* pass, MeshCommand* command) { - CC_ASSERT(pass); + AX_ASSERT(pass); assert(pass->_technique && pass->_technique->_material); auto* technique = pass->_technique; auto* material = technique->_material; @@ -87,7 +87,7 @@ void RenderState::StateBlock::bind(PipelineDescriptor* pipelineDescriptor) void RenderState::StateBlock::apply(PipelineDescriptor* pipelineDescriptor) { - // CC_ASSERT(_globalState); + // AX_ASSERT(_globalState); auto renderer = Director::getInstance()->getRenderer(); auto& blend = pipelineDescriptor->blendDescriptor; diff --git a/core/renderer/CCRenderState.h b/core/renderer/CCRenderState.h index 1a36017f33..e2f2c09214 100644 --- a/core/renderer/CCRenderState.h +++ b/core/renderer/CCRenderState.h @@ -52,7 +52,7 @@ using DepthFunction = backend::CompareFunction; /** * Defines the rendering state of the graphics device. */ -class CC_DLL RenderState : public Ref +class AX_DLL RenderState : public Ref { friend class Material; friend class Technique; @@ -71,7 +71,7 @@ public: * Defines a block of fixed-function render states that can be applied to a * RenderState object. */ - class CC_DLL StateBlock // : public Ref + class AX_DLL StateBlock // : public Ref { friend class RenderState; friend class Pass; diff --git a/core/renderer/CCRenderer.cpp b/core/renderer/CCRenderer.cpp index e8ba9d3197..875de6bf89 100644 --- a/core/renderer/CCRenderer.cpp +++ b/core/renderer/CCRenderer.cpp @@ -185,11 +185,11 @@ Renderer::~Renderer() free(_triBatchesToDraw); - CC_SAFE_RELEASE(_depthStencilState); - CC_SAFE_RELEASE(_commandBuffer); - CC_SAFE_RELEASE(_renderPipeline); - CC_SAFE_RELEASE(_defaultRT); - CC_SAFE_RELEASE(_offscreenRT); + AX_SAFE_RELEASE(_depthStencilState); + AX_SAFE_RELEASE(_commandBuffer); + AX_SAFE_RELEASE(_renderPipeline); + AX_SAFE_RELEASE(_defaultRT); + AX_SAFE_RELEASE(_offscreenRT); } void Renderer::init() @@ -298,7 +298,7 @@ void Renderer::processRenderCommand(RenderCommand* command) drawBatchedTriangles(); _queuedTotalIndexCount = _queuedTotalVertexCount = 0; -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _queuedIndexCount = _queuedVertexCount = 0; _triangleCommandBufferManager.prepareNextBuffer(); _vertexBuffer = _triangleCommandBufferManager.getVertexBuffer(); @@ -308,7 +308,7 @@ void Renderer::processRenderCommand(RenderCommand* command) // queue it _queuedTriangleCommands.push_back(cmd); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _queuedIndexCount += cmd->getIndexCount(); _queuedVertexCount += cmd->getVertexCount(); #endif @@ -408,7 +408,7 @@ void Renderer::endFrame() { _commandBuffer->endFrame(); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _triangleCommandBufferManager.putbackAllBuffers(); _vertexBuffer = _triangleCommandBufferManager.getVertexBuffer(); _indexBuffer = _triangleCommandBufferManager.getIndexBuffer(); @@ -609,7 +609,7 @@ void Renderer::drawBatchedTriangles() return; /************** 1: Setup up vertices/indices *************/ -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL unsigned int vertexBufferFillOffset = _queuedTotalVertexCount - _queuedVertexCount; unsigned int indexBufferFillOffset = _queuedTotalIndexCount - _queuedIndexCount; #else @@ -638,7 +638,7 @@ void Renderer::drawBatchedTriangles() // in the same batch ? if (batchable && (prevMaterialID == currentMaterialID || firstCommand)) { - CC_ASSERT((firstCommand || _triBatchesToDraw[batchesTotal].cmd->getMaterialID() == cmd->getMaterialID()) && + AX_ASSERT((firstCommand || _triBatchesToDraw[batchesTotal].cmd->getMaterialID() == cmd->getMaterialID()) && "argh... error in logic"); _triBatchesToDraw[batchesTotal].indicesToDraw += cmd->getIndexCount(); _triBatchesToDraw[batchesTotal].cmd = cmd; @@ -673,7 +673,7 @@ void Renderer::drawBatchedTriangles() firstCommand = false; } batchesTotal++; -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _vertexBuffer->updateSubData(_verts, vertexBufferFillOffset * sizeof(_verts[0]), _filledVertex * sizeof(_verts[0])); _indexBuffer->updateSubData(_indices, indexBufferFillOffset * sizeof(_indices[0]), _filledIndex * sizeof(_indices[0])); @@ -706,7 +706,7 @@ void Renderer::drawBatchedTriangles() /************** 3: Cleanup *************/ _queuedTriangleCommands.clear(); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _queuedIndexCount = 0; _queuedVertexCount = 0; #endif @@ -975,7 +975,7 @@ void Renderer::TriangleCommandBufferManager::createBuffer() { auto device = backend::Device::getInstance(); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL // Metal doesn't need to update buffer to make sure it has the correct size. auto vertexBuffer = device->newBuffer(Renderer::VBO_SIZE * sizeof(_verts[0]), backend::BufferType::VERTEX, backend::BufferUsage::DYNAMIC); diff --git a/core/renderer/CCRenderer.h b/core/renderer/CCRenderer.h index 8f479cfa7d..0162654ab9 100644 --- a/core/renderer/CCRenderer.h +++ b/core/renderer/CCRenderer.h @@ -126,7 +126,7 @@ class GroupCommandManager; Whenever possible prefer to use `TrianglesCommand` objects since the renderer will automatically batch them. */ -class CC_DLL Renderer +class AX_DLL Renderer { public: /**The max number of vertices in a vertex buffer object.*/ diff --git a/core/renderer/CCTechnique.cpp b/core/renderer/CCTechnique.cpp index 35d3d30a47..4e0620839d 100644 --- a/core/renderer/CCTechnique.cpp +++ b/core/renderer/CCTechnique.cpp @@ -105,7 +105,7 @@ void Technique::setName(std::string_view name) Pass* Technique::getPassByIndex(ssize_t index) const { - CC_ASSERT(index >= 0 && index < _passes.size() && "Invalid index"); + AX_ASSERT(index >= 0 && index < _passes.size() && "Invalid index"); return _passes.at(index); } diff --git a/core/renderer/CCTechnique.h b/core/renderer/CCTechnique.h index 8b4dbd6b99..e7c8cb0cbd 100644 --- a/core/renderer/CCTechnique.h +++ b/core/renderer/CCTechnique.h @@ -46,7 +46,7 @@ class ProgramState; } /// Technique -class CC_DLL Technique : public Ref +class AX_DLL Technique : public Ref { friend class Material; friend class Renderer; diff --git a/core/renderer/CCTexture2D.cpp b/core/renderer/CCTexture2D.cpp index f9c206e2b3..f1e2b78007 100644 --- a/core/renderer/CCTexture2D.cpp +++ b/core/renderer/CCTexture2D.cpp @@ -50,7 +50,7 @@ THE SOFTWARE. #include "renderer/backend/PixelFormatUtils.h" #include "renderer/CCRenderer.h" -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA # include "renderer/CCTextureCache.h" #endif @@ -80,15 +80,15 @@ Texture2D::Texture2D() Texture2D::~Texture2D() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA VolatileTextureMgr::removeTexture(this); #endif CCLOGINFO("deallocing Texture2D: %p - id=%u", this, _name); - CC_SAFE_DELETE(_ninePatchInfo); + AX_SAFE_DELETE(_ninePatchInfo); - CC_SAFE_RELEASE(_texture); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_programState); } backend::PixelFormat Texture2D::getPixelFormat() const @@ -114,8 +114,8 @@ backend::TextureBackend* Texture2D::getBackendTexture() const Vec2 Texture2D::getContentSize() const { Vec2 ret; - ret.width = _contentSize.width / CC_CONTENT_SCALE_FACTOR(); - ret.height = _contentSize.height / CC_CONTENT_SCALE_FACTOR(); + ret.width = _contentSize.width / AX_CONTENT_SCALE_FACTOR(); + ret.height = _contentSize.height / AX_CONTENT_SCALE_FACTOR(); return ret; } @@ -219,11 +219,11 @@ bool Texture2D::updateWithImage(Image* image, backend::PixelFormat format, int i backend::PixelFormat imagePixelFormat = image->getPixelFormat(); size_t tempDataLen = image->getDataLen(); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL //! override renderFormat, since some render format is not supported by metal switch (renderFormat) { -# if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS || TARGET_OS_SIMULATOR) +# if (AX_TARGET_PLATFORM != AX_PLATFORM_IOS || TARGET_OS_SIMULATOR) // packed 16 bits pixels only available on iOS case PixelFormat::RGB565: case PixelFormat::RGB5A1: @@ -308,7 +308,7 @@ bool Texture2D::updateWithMipmaps(MipmapInfo* mipmaps, if (!pfd.bpp) { CCLOG("cocos2d: WARNING: unsupported pixelformat: %x", (uint32_t)pixelFormat); -#ifdef CC_USE_METAL +#ifdef AX_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 CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_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 CC_USE_METAL +#ifdef AX_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 CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_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 (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) && (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) 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 = CC_CONTENT_SCALE_FACTOR(); + auto contentScaleFactor = AX_CONTENT_SCALE_FACTOR(); textDef._fontSize *= contentScaleFactor; textDef._dimensions.width *= contentScaleFactor; textDef._dimensions.height *= contentScaleFactor; @@ -562,7 +562,7 @@ bool Texture2D::initWithString(const char* text, const FontDefinition& textDefin bool Texture2D::updateTextureDescriptor(const backend::TextureDescriptor& descriptor, bool preMultipliedAlpha) { - CC_ASSERT(_texture); + AX_ASSERT(_texture); _texture->updateTextureDescriptor(descriptor); _pixelsWide = _contentSize.width = _texture->getWidth(); diff --git a/core/renderer/CCTexture2D.h b/core/renderer/CCTexture2D.h index f8fcd106c8..6ad6461337 100644 --- a/core/renderer/CCTexture2D.h +++ b/core/renderer/CCTexture2D.h @@ -71,7 +71,7 @@ class ProgramState; * texture dimensions i.e. "contentSize" != (pixelsWide, pixelsHigh) and (maxS, maxT) != (1.0, 1.0). Be aware that the * content of the generated textures will be upside-down! */ -class CC_DLL Texture2D : public Ref +class AX_DLL Texture2D : public Ref { public: struct PixelFormatInfo diff --git a/core/renderer/CCTextureAtlas.cpp b/core/renderer/CCTextureAtlas.cpp index a32d30da72..96dfdc64ee 100644 --- a/core/renderer/CCTextureAtlas.cpp +++ b/core/renderer/CCTextureAtlas.cpp @@ -53,12 +53,12 @@ TextureAtlas::~TextureAtlas() { CCLOGINFO("deallocing TextureAtlas: %p", this); - CC_SAFE_FREE(_quads); - CC_SAFE_FREE(_indices); + AX_SAFE_FREE(_quads); + AX_SAFE_FREE(_indices); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_texture); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_rendererRecreatedListener); #endif } @@ -80,8 +80,8 @@ Texture2D* TextureAtlas::getTexture() const void TextureAtlas::setTexture(Texture2D* var) { - CC_SAFE_RETAIN(var); - CC_SAFE_RELEASE(_texture); + AX_SAFE_RETAIN(var); + AX_SAFE_RELEASE(_texture); _texture = var; } @@ -107,7 +107,7 @@ TextureAtlas* TextureAtlas::create(std::string_view file, ssize_t capacity) textureAtlas->autorelease(); return textureAtlas; } - CC_SAFE_DELETE(textureAtlas); + AX_SAFE_DELETE(textureAtlas); return nullptr; } @@ -119,7 +119,7 @@ TextureAtlas* TextureAtlas::createWithTexture(Texture2D* texture, ssize_t capaci textureAtlas->autorelease(); return textureAtlas; } - CC_SAFE_DELETE(textureAtlas); + AX_SAFE_DELETE(textureAtlas); return nullptr; } @@ -149,7 +149,7 @@ bool TextureAtlas::initWithTexture(Texture2D* texture, ssize_t capacity) // retained in property this->_texture = texture; - CC_SAFE_RETAIN(_texture); + AX_SAFE_RETAIN(_texture); // Re-initialization is not allowed CCASSERT(_quads == nullptr && _indices == nullptr, "_quads and _indices should be nullptr."); @@ -160,12 +160,12 @@ bool TextureAtlas::initWithTexture(Texture2D* texture, ssize_t capacity) if (!(_quads && _indices) && _capacity > 0) { // CCLOG("cocos2d: TextureAtlas: not enough memory"); - CC_SAFE_FREE(_quads); - CC_SAFE_FREE(_indices); + AX_SAFE_FREE(_quads); + AX_SAFE_FREE(_indices); // release texture, should set it to null, because the destruction will // release it too. see cocos2d-x issue #484 - CC_SAFE_RELEASE_NULL(_texture); + AX_SAFE_RELEASE_NULL(_texture); return false; } @@ -399,10 +399,10 @@ bool TextureAtlas::resizeCapacity(ssize_t newCapacity) if (!(tmpQuads && tmpIndices)) { CCLOG("cocos2d: TextureAtlas: not enough memory"); - CC_SAFE_FREE(tmpQuads); - CC_SAFE_FREE(tmpIndices); - CC_SAFE_FREE(_quads); - CC_SAFE_FREE(_indices); + AX_SAFE_FREE(tmpQuads); + AX_SAFE_FREE(tmpIndices); + AX_SAFE_FREE(_quads); + AX_SAFE_FREE(_indices); _capacity = _totalQuads = 0; return false; } diff --git a/core/renderer/CCTextureAtlas.h b/core/renderer/CCTextureAtlas.h index 971353e03e..c7eb69e055 100644 --- a/core/renderer/CCTextureAtlas.h +++ b/core/renderer/CCTextureAtlas.h @@ -59,7 +59,7 @@ To render the quads using an interleaved vertex array list, you should modify th @warning If you want to use TextureAtlas, you'd better setup GL status before it's rendered. Otherwise, the effect of TextureAtlas will be affected by the GL status of other nodes. */ -class CC_DLL TextureAtlas : public Ref +class AX_DLL TextureAtlas : public Ref { public: /** Creates a TextureAtlas with an filename and with an initial capacity for Quads. @@ -239,7 +239,7 @@ protected: /** Quads that are going to be rendered */ V3F_C4B_T2F_Quad* _quads = nullptr; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _rendererRecreatedListener = nullptr; #endif }; diff --git a/core/renderer/CCTextureCache.cpp b/core/renderer/CCTextureCache.cpp index 1fa66a7573..cbf6aad4dc 100644 --- a/core/renderer/CCTextureCache.cpp +++ b/core/renderer/CCTextureCache.cpp @@ -72,7 +72,7 @@ TextureCache::~TextureCache() for (auto& texture : _textures) texture.second->release(); - CC_SAFE_DELETE(_loadingThread); + AX_SAFE_DELETE(_loadingThread); } std::string TextureCache::getDescription() const @@ -208,7 +208,7 @@ void TextureCache::addImageAsync(std::string_view path, if (0 == _asyncRefCount) { - Director::getInstance()->getScheduler()->schedule(CC_SCHEDULE_SELECTOR(TextureCache::addImageAsyncCallBack), + Director::getInstance()->getScheduler()->schedule(AX_SCHEDULE_SELECTOR(TextureCache::addImageAsyncCallBack), this, 0, false); } @@ -316,7 +316,7 @@ void TextureCache::addImageAsyncCallBack(float /*dt*/) _responseQueue.pop_front(); // the asyncStruct's sequence order in _asyncStructQueue must equal to the order in _responseQueue - CC_ASSERT(asyncStruct == _asyncStructQueue.front()); + AX_ASSERT(asyncStruct == _asyncStructQueue.front()); _asyncStructQueue.pop_front(); } _responseMutex.unlock(); @@ -344,7 +344,7 @@ void TextureCache::addImageAsyncCallBack(float /*dt*/) texture->initWithImage(image, asyncStruct->pixelFormat); // parse 9-patch info this->parseNinePatchImage(image, texture, asyncStruct->filename); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // cache the texture file name VolatileTextureMgr::addImageTexture(texture, asyncStruct->filename); #endif @@ -379,7 +379,7 @@ void TextureCache::addImageAsyncCallBack(float /*dt*/) if (0 == _asyncRefCount) { - Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(TextureCache::addImageAsyncCallBack), + Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(TextureCache::addImageAsyncCallBack), this); } } @@ -414,13 +414,13 @@ Texture2D* TextureCache::addImage(std::string_view path, PixelFormat format) image = new Image(); bool bRet = image->initWithImageFile(fullpath); - CC_BREAK_IF(!bRet); + AX_BREAK_IF(!bRet); texture = new Texture2D(); if (texture->initWithImage(image, format)) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // cache the texture file name VolatileTextureMgr::addImageTexture(texture, fullpath); #endif @@ -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()); - CC_SAFE_RELEASE(texture); + AX_SAFE_RELEASE(texture); texture = nullptr; } } while (0); } - CC_SAFE_RELEASE(image); + AX_SAFE_RELEASE(image); return texture; } @@ -495,14 +495,14 @@ Texture2D* TextureCache::addImage(Image* image, std::string_view key, PixelForma } else { - CC_SAFE_RELEASE(texture); + AX_SAFE_RELEASE(texture); texture = nullptr; CCLOG("cocos2d: initWithImage failed!"); } } while (0); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA VolatileTextureMgr::addImage(texture, image); #endif @@ -538,7 +538,7 @@ bool TextureCache::reloadTexture(std::string_view fileName) Image image; bool bRet = image.initWithImageFile(fullpath); - CC_BREAK_IF(!bRet); + AX_BREAK_IF(!bRet); ret = texture->initWithImage(&image); } while (0); @@ -712,7 +712,7 @@ void TextureCache::renameTextureWithKey(std::string_view srcName, std::string_vi } } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA std::list VolatileTextureMgr::_textures; bool VolatileTextureMgr::_isReloading = false; @@ -729,7 +729,7 @@ VolatileTexture::VolatileTexture(Texture2D* t) VolatileTexture::~VolatileTexture() { - CC_SAFE_RELEASE(_uiImage); + AX_SAFE_RELEASE(_uiImage); } void VolatileTextureMgr::addImageTexture(Texture2D* tt, std::string_view imageFileName) @@ -886,9 +886,9 @@ void VolatileTextureMgr::reloadTexture(Texture2D* texture, std::string_view file if (image->initWithImageData(data.getBytes(), data.getSize())) texture->initWithImage(image, pixelFormat); - CC_SAFE_DELETE(image); + AX_SAFE_DELETE(image); } -#endif // CC_ENABLE_CACHE_TEXTURE_DATA +#endif // AX_ENABLE_CACHE_TEXTURE_DATA NS_AX_END diff --git a/core/renderer/CCTextureCache.h b/core/renderer/CCTextureCache.h index a8db9976b2..c0f31d3e2b 100644 --- a/core/renderer/CCTextureCache.h +++ b/core/renderer/CCTextureCache.h @@ -43,7 +43,7 @@ THE SOFTWARE. #include "renderer/CCTexture2D.h" #include "platform/CCImage.h" -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA # include #endif @@ -62,7 +62,7 @@ NS_AX_BEGIN * Once the texture is loaded, the next time it will return. * A reference of the previously loaded texture reducing GPU & CPU memory. */ -class CC_DLL TextureCache : public Ref +class AX_DLL TextureCache : public Ref { public: // ETC1 ALPHA supports. @@ -235,7 +235,7 @@ protected: static std::string s_etc1AlphaFileSuffix; }; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA class VolatileTexture { @@ -275,7 +275,7 @@ protected: FontDefinition _fontDefinition; }; -class CC_DLL VolatileTextureMgr +class AX_DLL VolatileTextureMgr { public: static void addImageTexture(Texture2D* tt, std::string_view imageFileName); diff --git a/core/renderer/CCTextureCube.cpp b/core/renderer/CCTextureCube.cpp index 7a80f4ed14..c22c58f6ee 100644 --- a/core/renderer/CCTextureCube.cpp +++ b/core/renderer/CCTextureCube.cpp @@ -149,7 +149,7 @@ TextureCube::TextureCube() TextureCube::~TextureCube() { - CC_SAFE_RELEASE_NULL(_texture); + AX_SAFE_RELEASE_NULL(_texture); } TextureCube* TextureCube::create(std::string_view positive_x, @@ -165,7 +165,7 @@ TextureCube* TextureCube::create(std::string_view positive_x, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -256,7 +256,7 @@ bool TextureCube::init(std::string_view positive_x, for (auto img : images) { - CC_SAFE_RELEASE(img); + AX_SAFE_RELEASE(img); } return true; diff --git a/core/renderer/CCTextureCube.h b/core/renderer/CCTextureCube.h index dc29227cdf..fc4b439d31 100644 --- a/core/renderer/CCTextureCube.h +++ b/core/renderer/CCTextureCube.h @@ -44,7 +44,7 @@ NS_AX_BEGIN TextureCube is a collection of six separate square textures that are put onto the faces of an imaginary cube. */ -class CC_DLL TextureCube : public Ref +class AX_DLL TextureCube : public Ref { public: /** create cube texture from 6 textures. diff --git a/core/renderer/CCTrianglesCommand.h b/core/renderer/CCTrianglesCommand.h index d26052dea9..6bd790faae 100644 --- a/core/renderer/CCTrianglesCommand.h +++ b/core/renderer/CCTrianglesCommand.h @@ -46,7 +46,7 @@ class Program; class Texture2D; -class CC_DLL TrianglesCommand : public RenderCommand +class AX_DLL TrianglesCommand : public RenderCommand { public: /**The structure of Triangles. */ diff --git a/core/renderer/backend/Device.h b/core/renderer/backend/Device.h index a8cff2254a..8a8a05852f 100644 --- a/core/renderer/backend/Device.h +++ b/core/renderer/backend/Device.h @@ -54,7 +54,7 @@ class RenderTarget; /** * New or create resources from Device. */ -class CC_DLL Device : public axis::Ref +class AX_DLL Device : public axis::Ref { public: friend class ProgramCache; diff --git a/core/renderer/backend/Enums.h b/core/renderer/backend/Enums.h index d656ad61b7..8c67b16c33 100644 --- a/core/renderer/backend/Enums.h +++ b/core/renderer/backend/Enums.h @@ -263,8 +263,8 @@ enum class ColorWriteMask : uint32_t ALPHA = 1 << ALPHA_BIT, ALL = 0x0000000F }; -CC_ENABLE_BITMASK_OPS(ColorWriteMask) -CC_ENABLE_BITSHIFT_OPS(ColorWriteMask) +AX_ENABLE_BITMASK_OPS(ColorWriteMask) +AX_ENABLE_BITSHIFT_OPS(ColorWriteMask) /** * Bitmask for selecting render buffers @@ -283,7 +283,7 @@ enum class TargetBufferFlags : uint8_t DEPTH_AND_STENCIL = DEPTH | STENCIL, //!< depth and stencil buffer selected. ALL = COLOR_ALL | DEPTH | STENCIL //!< Color, depth and stencil buffer selected. }; -CC_ENABLE_BITMASK_OPS(TargetBufferFlags) +AX_ENABLE_BITMASK_OPS(TargetBufferFlags) enum class DepthStencilFlags : unsigned int { @@ -294,8 +294,8 @@ enum class DepthStencilFlags : unsigned int DEPTH_STENCIL_TEST = DEPTH_TEST | STENCIL_TEST, ALL = DEPTH_TEST | STENCIL_TEST | DEPTH_WRITE, }; -CC_ENABLE_BITMASK_OPS(DepthStencilFlags) -CC_ENABLE_BITSHIFT_OPS(DepthStencilFlags) +AX_ENABLE_BITMASK_OPS(DepthStencilFlags) +AX_ENABLE_BITSHIFT_OPS(DepthStencilFlags) enum class CullMode : uint32_t { diff --git a/core/renderer/backend/Macros.h b/core/renderer/backend/Macros.h index a82235311e..b39c39dbef 100644 --- a/core/renderer/backend/Macros.h +++ b/core/renderer/backend/Macros.h @@ -38,4 +38,4 @@ #define MAX_INFLIGHT_BUFFER 3 -#define CC_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0])) +#define AX_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0])) diff --git a/core/renderer/backend/PixelFormatUtils.cpp b/core/renderer/backend/PixelFormatUtils.cpp index 82c670bf3e..6f9b4bac5c 100644 --- a/core/renderer/backend/PixelFormatUtils.cpp +++ b/core/renderer/backend/PixelFormatUtils.cpp @@ -72,14 +72,14 @@ static const PixelFormatDescriptor s_pixelFormatDescriptors[] = { {8, 1, 1, 1, 1, 1, true, "A8"}, // A8 {8, 1, 1, 1, 1, 1, false, "L8"}, // L8 {16, 1, 1, 2, 1, 1, true, "LA8"}, // LA8 -#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) {32, 1, 1, 4, 1, 1, false, "D24S8"}, // D24S8 #else {64, 1, 1, 8, 1, 1, false, "D32FS8"}, // D32FS8 iOS #endif }; -static_assert(CC_ARRAYSIZE(s_pixelFormatDescriptors) == (int)PixelFormat::COUNT, +static_assert(AX_ARRAYSIZE(s_pixelFormatDescriptors) == (int)PixelFormat::COUNT, "The pixel format descriptor table incomplete!"); ////////////////////////////////////////////////////////////////////////// diff --git a/core/renderer/backend/Program.h b/core/renderer/backend/Program.h index 0fca197332..ef18a85245 100644 --- a/core/renderer/backend/Program.h +++ b/core/renderer/backend/Program.h @@ -46,7 +46,7 @@ class ShaderModule; /** * A program. */ -class CC_DLL Program : public Ref +class AX_DLL Program : public Ref { public: /** @@ -153,7 +153,7 @@ protected: */ Program(std::string_view vs, std::string_view fs); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA /** * In case of EGL context lost, the engine will reload shaders. Thus location of uniform may changed. * The engine will maintain the relationship between the original uniform location and the current active uniform diff --git a/core/renderer/backend/ProgramCache.cpp b/core/renderer/backend/ProgramCache.cpp index d73178e303..080b3a3684 100644 --- a/core/renderer/backend/ProgramCache.cpp +++ b/core/renderer/backend/ProgramCache.cpp @@ -58,7 +58,7 @@ ProgramCache* ProgramCache::getInstance() _sharedProgramCache = new ProgramCache(); if (!_sharedProgramCache->init()) { - CC_SAFE_DELETE(_sharedProgramCache); + AX_SAFE_DELETE(_sharedProgramCache); } } return _sharedProgramCache; @@ -66,14 +66,14 @@ ProgramCache* ProgramCache::getInstance() void ProgramCache::destroyInstance() { - CC_SAFE_RELEASE_NULL(_sharedProgramCache); + AX_SAFE_RELEASE_NULL(_sharedProgramCache); } ProgramCache::~ProgramCache() { for (auto& program : _cachedPrograms) { - CC_SAFE_RELEASE(program.second); + AX_SAFE_RELEASE(program.second); } CCLOGINFO("deallocing ProgramCache: %p", this); ShaderCache::destroyInstance(); diff --git a/core/renderer/backend/ProgramState.cpp b/core/renderer/backend/ProgramState.cpp index ffe359731d..267ac6e688 100644 --- a/core/renderer/backend/ProgramState.cpp +++ b/core/renderer/backend/ProgramState.cpp @@ -35,7 +35,7 @@ #include "xxhash.h" -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL # include "glsl_optimizer.h" #endif @@ -125,13 +125,13 @@ TextureInfo::~TextureInfo() void TextureInfo::retainTextures() { for (auto& texture : textures) - CC_SAFE_RETAIN(texture); + AX_SAFE_RETAIN(texture); } void TextureInfo::releaseTextures() { for (auto& texture : textures) - CC_SAFE_RELEASE(texture); + AX_SAFE_RELEASE(texture); textures.clear(); } @@ -158,7 +158,7 @@ void TextureInfo::assign(const TextureInfo& other) textures = other.textures; retainTextures(); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA location = other.location; #endif } @@ -174,7 +174,7 @@ void TextureInfo::assign(TextureInfo&& other) slots = std::move(other.slots); textures = std::move(other.textures); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA location = other.location; other.location = -1; #endif @@ -189,19 +189,19 @@ ProgramState::ProgramState(Program* program) bool ProgramState::init(Program* program) { - CC_SAFE_RETAIN(program); + AX_SAFE_RETAIN(program); _program = program; _vertexUniformBufferSize = _program->getUniformBufferSize(ShaderStage::VERTEX); _vertexUniformBuffer = (char*)calloc(1, _vertexUniformBufferSize); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _fragmentUniformBufferSize = _program->getUniformBufferSize(ShaderStage::FRAGMENT); _fragmentUniformBuffer = (char*)calloc(1, _fragmentUniformBufferSize); #endif -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL _uniformHashState = XXH32_createState(); #endif -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { this->resetUniforms(); }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1); @@ -211,7 +211,7 @@ bool ProgramState::init(Program* program) void ProgramState::resetUniforms() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA if (_program == nullptr) return; @@ -232,14 +232,14 @@ void ProgramState::resetUniforms() ProgramState::~ProgramState() { -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL XXH32_freeState(_uniformHashState); #endif - CC_SAFE_RELEASE(_program); - CC_SAFE_FREE(_vertexUniformBuffer); - CC_SAFE_FREE(_fragmentUniformBuffer); + AX_SAFE_RELEASE(_program); + AX_SAFE_FREE(_vertexUniformBuffer); + AX_SAFE_FREE(_fragmentUniformBuffer); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -251,7 +251,7 @@ ProgramState* ProgramState::clone() const cp->_fragmentTextureInfos = _fragmentTextureInfos; memcpy(cp->_vertexUniformBuffer, _vertexUniformBuffer, _vertexUniformBufferSize); cp->_vertexLayout = _vertexLayout; -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL memcpy(cp->_fragmentUniformBuffer, _fragmentUniformBuffer, _fragmentUniformBufferSize); #endif cp->_uniformID = _uniformID; @@ -292,7 +292,7 @@ void ProgramState::setUniform(const backend::UniformLocation& uniformLocation, c } } -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL void ProgramState::convertAndCopyUniformData(const backend::UniformInfo& uniformInfo, const void* srcData, std::size_t srcSize, @@ -355,12 +355,12 @@ void ProgramState::convertAndCopyUniformData(const backend::UniformInfo& uniform break; } default: - CC_ASSERT(false); + AX_ASSERT(false); break; } memcpy((char*)buffer + uniformInfo.location, convertedData, uniformInfo.size); - CC_SAFE_DELETE_ARRAY(convertedData); + AX_SAFE_DELETE_ARRAY(convertedData); } #endif @@ -370,7 +370,7 @@ void ProgramState::setVertexUniform(int location, const void* data, std::size_t return; // float3 etc in Metal has both sizeof and alignment same as float4, need convert to correct laytout -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL const auto& uniformInfo = _program->getActiveUniformInfo(ShaderStage::VERTEX, location); if (uniformInfo.needConvert) { @@ -391,7 +391,7 @@ void ProgramState::setFragmentUniform(int location, const void* data, std::size_ return; // float3 etc in Metal has both sizeof and alignment same as float4, need convert to correct laytout -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL const auto& uniformInfo = _program->getActiveUniformInfo(ShaderStage::FRAGMENT, location); if (uniformInfo.needConvert) { @@ -408,7 +408,7 @@ void ProgramState::updateUniformID(int uniformID) { if (uniformID == -1) { -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL XXH32_reset(_uniformHashState, 0); XXH32_update(_uniformHashState, _vertexUniformBuffer, _vertexUniformBufferSize); XXH32_update(_uniformHashState, _fragmentUniformBuffer, _fragmentUniformBufferSize); @@ -425,7 +425,7 @@ void ProgramState::updateUniformID(int uniformID) void ProgramState::setTexture(backend::TextureBackend* texture) { - for (int slot = 0; slot < texture->getCount() && slot < CC_META_TEXTURES; ++slot) + for (int slot = 0; slot < texture->getCount() && slot < AX_META_TEXTURES; ++slot) { auto location = getUniformLocation((backend::Uniform)(backend::Uniform::TEXTURE + slot)); setTexture(location, slot, slot, texture); @@ -494,7 +494,7 @@ void ProgramState::setTexture(int location, auto& info = textureInfo[location]; info = {{slot}, {index}, {texture}}; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA info.location = location; #endif } @@ -509,7 +509,7 @@ void ProgramState::setTextureArray(int location, auto& info = textureInfo[location]; info = {std::move(slots), std::move(textures)}; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA info.location = location; #endif } diff --git a/core/renderer/backend/ProgramState.h b/core/renderer/backend/ProgramState.h index f054f5e281..e3af9e3cf0 100644 --- a/core/renderer/backend/ProgramState.h +++ b/core/renderer/backend/ProgramState.h @@ -37,7 +37,7 @@ #include "renderer/backend/Program.h" #include "renderer/backend/VertexLayout.h" -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL struct XXH32_state_s; #endif @@ -54,7 +54,7 @@ class VertexLayout; /** * Store texture information. */ -struct CC_DLL TextureInfo +struct AX_DLL TextureInfo { TextureInfo(std::vector&& _slots, std::vector&& _textures); TextureInfo(std::vector&& _slots, @@ -78,7 +78,7 @@ struct CC_DLL TextureInfo std::vector slots; std::vector indexs; std::vector textures; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA int location = -1; #endif }; @@ -87,7 +87,7 @@ struct CC_DLL TextureInfo * A program state object can create or reuse a program. * Each program state object keep its own unifroms and textures data. */ -class CC_DLL ProgramState : public Ref +class AX_DLL ProgramState : public Ref { public: using UniformCallback = std::function; @@ -256,7 +256,7 @@ public: * * @script{ignore} */ - class CC_DLL AutoBindingResolver + class AX_DLL AutoBindingResolver { public: AutoBindingResolver(); @@ -358,7 +358,7 @@ protected: /// Initialize. bool init(Program* program); -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL /** * float3 etc in Metal has both sizeof and alignment same as float4, convert it before fill into uniform buffer * @param uniformInfo Specifies the uniform information. @@ -395,11 +395,11 @@ protected: std::shared_ptr _vertexLayout = std::make_shared(); uint32_t _uniformID = 0; -#ifdef CC_USE_METAL +#ifdef AX_USE_METAL struct XXH32_state_s* _uniformHashState = nullptr; #endif -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener = nullptr; #endif }; diff --git a/core/renderer/backend/ProgramStateRegistry.cpp b/core/renderer/backend/ProgramStateRegistry.cpp index 5705da8875..0bfbef39e5 100644 --- a/core/renderer/backend/ProgramStateRegistry.cpp +++ b/core/renderer/backend/ProgramStateRegistry.cpp @@ -12,7 +12,7 @@ ProgramStateRegistry* ProgramStateRegistry::getInstance() _sharedStateRegistry = new ProgramStateRegistry(); if (!_sharedStateRegistry->init()) { - CC_SAFE_DELETE(_sharedStateRegistry); + AX_SAFE_DELETE(_sharedStateRegistry); } return _sharedStateRegistry; @@ -21,7 +21,7 @@ ProgramStateRegistry* ProgramStateRegistry::getInstance() /** purges the cache. It releases the retained instance. */ void ProgramStateRegistry::destroyInstance() { - CC_SAFE_RELEASE_NULL(_sharedStateRegistry); + AX_SAFE_RELEASE_NULL(_sharedStateRegistry); } bool ProgramStateRegistry::init() diff --git a/core/renderer/backend/RenderTarget.h b/core/renderer/backend/RenderTarget.h index 07ae3bf108..e4d57ce3bc 100644 --- a/core/renderer/backend/RenderTarget.h +++ b/core/renderer/backend/RenderTarget.h @@ -21,9 +21,9 @@ public: virtual ~RenderTarget() { for (auto colorItem : _color) - CC_SAFE_RELEASE(colorItem.texture); - CC_SAFE_RELEASE(_depth.texture); - CC_SAFE_RELEASE(_stencil.texture); + AX_SAFE_RELEASE(colorItem.texture); + AX_SAFE_RELEASE(_depth.texture); + AX_SAFE_RELEASE(_stencil.texture); } bool isDefaultRenderTarget() const { return _defaultRenderTarget; } @@ -44,37 +44,37 @@ public: void setColorAttachment(ColorAttachment attachment) { for (auto colorItem : _color) - CC_SAFE_RELEASE(colorItem.texture); + AX_SAFE_RELEASE(colorItem.texture); memcpy(_color, attachment, sizeof(ColorAttachment)); for (auto colorItem : _color) - CC_SAFE_RETAIN(colorItem.texture); + AX_SAFE_RETAIN(colorItem.texture); _dirty = true; }; void setColorAttachment(TextureBackend* attachment, int level = 0, int index = 0) { - CC_SAFE_RELEASE(_color[index].texture); + AX_SAFE_RELEASE(_color[index].texture); _color[index].texture = attachment; _color[index].level = level; - CC_SAFE_RETAIN(_color[index].texture); + AX_SAFE_RETAIN(_color[index].texture); _dirty = true; } void setDepthAttachment(TextureBackend* attachment, int level = 0) { - CC_SAFE_RELEASE(_depth.texture); + AX_SAFE_RELEASE(_depth.texture); _depth.texture = attachment; _depth.level = level; - CC_SAFE_RETAIN(_depth.texture); + AX_SAFE_RETAIN(_depth.texture); _dirty = true; }; void setStencilAttachment(TextureBackend* attachment, int level = 0) { - CC_SAFE_RELEASE(_stencil.texture); + AX_SAFE_RELEASE(_stencil.texture); _stencil.texture = attachment; _stencil.level = level; - CC_SAFE_RETAIN(_stencil.texture); + AX_SAFE_RETAIN(_stencil.texture); _dirty = true; }; diff --git a/core/renderer/backend/ShaderCache.cpp b/core/renderer/backend/ShaderCache.cpp index eba07ad07f..a84c150626 100644 --- a/core/renderer/backend/ShaderCache.cpp +++ b/core/renderer/backend/ShaderCache.cpp @@ -37,7 +37,7 @@ ShaderCache* ShaderCache::getInstance() _sharedShaderCache = new ShaderCache(); if (!_sharedShaderCache->init()) { - CC_SAFE_DELETE(_sharedShaderCache); + AX_SAFE_DELETE(_sharedShaderCache); } } return _sharedShaderCache; @@ -45,14 +45,14 @@ ShaderCache* ShaderCache::getInstance() void ShaderCache::destroyInstance() { - CC_SAFE_RELEASE_NULL(_sharedShaderCache); + AX_SAFE_RELEASE_NULL(_sharedShaderCache); } ShaderCache::~ShaderCache() { for (auto& shaderModule : _cachedShaders) { - CC_SAFE_RELEASE(shaderModule.second); + AX_SAFE_RELEASE(shaderModule.second); } CCLOGINFO("deallocing ProgramCache: %p", this); } diff --git a/core/renderer/backend/ShaderCache.h b/core/renderer/backend/ShaderCache.h index 5c22ac23e5..8a9e4515b7 100644 --- a/core/renderer/backend/ShaderCache.h +++ b/core/renderer/backend/ShaderCache.h @@ -40,7 +40,7 @@ NS_AX_BACKEND_BEGIN /** * Create and reuse shader module. */ -class CC_DLL ShaderCache : public Ref +class AX_DLL ShaderCache : public Ref { public: /** returns the shared instance */ diff --git a/core/renderer/backend/ShaderModule.h b/core/renderer/backend/ShaderModule.h index a36522e29d..574b9bcb08 100644 --- a/core/renderer/backend/ShaderModule.h +++ b/core/renderer/backend/ShaderModule.h @@ -62,7 +62,7 @@ enum Attribute : uint32_t /** * Create shader. */ -class CC_DLL ShaderModule : public axis::Ref +class AX_DLL ShaderModule : public axis::Ref { public: /** diff --git a/core/renderer/backend/VertexLayout.h b/core/renderer/backend/VertexLayout.h index dce25560b1..243e8813c0 100644 --- a/core/renderer/backend/VertexLayout.h +++ b/core/renderer/backend/VertexLayout.h @@ -42,7 +42,7 @@ NS_AX_BACKEND_BEGIN /** * Store vertex attribute layout. */ -class CC_DLL VertexLayout +class AX_DLL VertexLayout { public: struct Attribute diff --git a/core/renderer/backend/metal/CommandBufferMTL.mm b/core/renderer/backend/metal/CommandBufferMTL.mm index 8b6d78f77e..1ed47f3002 100644 --- a/core/renderer/backend/metal/CommandBufferMTL.mm +++ b/core/renderer/backend/metal/CommandBufferMTL.mm @@ -51,7 +51,7 @@ static uint8_t getBitsPerElementMTL(MTLPixelFormat pixleFormat) case MTLPixelFormatRGBA8Unorm: case MTLPixelFormatDepth32Float: return byte(4); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) case MTLPixelFormatDepth24Unorm_Stencil8: return byte(4); #else @@ -275,8 +275,8 @@ void CommandBufferMTL::setVertexBuffer(Buffer* buffer) void CommandBufferMTL::setProgramState(ProgramState* programState) { - CC_SAFE_RETAIN(programState); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RETAIN(programState); + AX_SAFE_RELEASE(_programState); _programState = programState; } @@ -321,7 +321,7 @@ void CommandBufferMTL::readPixels(RenderTarget* rt, std::function_color[0].texture; - CC_SAFE_RETAIN(texture); + AX_SAFE_RETAIN(texture); _captureCallbacks.emplace_back(texture, std::move(callback)); } @@ -390,7 +390,7 @@ void CommandBufferMTL::flushCaptureCommands() auto texture = cb.first; assert(texture != nullptr); CommandBufferMTL::readPixels(texture, 0, 0, texture->getWidth(), texture->getHeight(), pixelData); - CC_SAFE_RELEASE(texture); + AX_SAFE_RELEASE(texture); cb.second(pixelData); } } @@ -406,7 +406,7 @@ void CommandBufferMTL::afterDraw() _mtlIndexBuffer = nullptr; } - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); } void CommandBufferMTL::prepareDrawing() const @@ -569,7 +569,7 @@ void CommandBufferMTL::readPixels(id texture, destinationLevel:0 destinationOrigin:region.origin]; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) [blitCommandEncoder synchronizeResource:readPixelsTexture]; #endif [blitCommandEncoder endEncoding]; diff --git a/core/renderer/backend/metal/DeviceInfoMTL.mm b/core/renderer/backend/metal/DeviceInfoMTL.mm index 50eecdb46c..a16e32b59d 100644 --- a/core/renderer/backend/metal/DeviceInfoMTL.mm +++ b/core/renderer/backend/metal/DeviceInfoMTL.mm @@ -374,7 +374,7 @@ DeviceInfoMTL::DeviceInfoMTL(id device) { _deviceName = [device.name UTF8String]; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) const FeatureSet minRequiredFeatureSet = FeatureSet::FeatureSet_iOS_GPUFamily1_v1; const FeatureSet maxKnownFeatureSet = FeatureSet::FeatureSet_iOS_GPUFamily4_v2; #else diff --git a/core/renderer/backend/metal/ProgramMTL.mm b/core/renderer/backend/metal/ProgramMTL.mm index 4f9f284224..5ff5330dd4 100644 --- a/core/renderer/backend/metal/ProgramMTL.mm +++ b/core/renderer/backend/metal/ProgramMTL.mm @@ -40,14 +40,14 @@ ProgramMTL::ProgramMTL(std::string_view vertexShader, std::string_view fragmentS combinedSource += fragmentShader; _fragmentShader = static_cast(ShaderCache::newFragmentShaderModule(std::move(combinedSource))); - CC_SAFE_RETAIN(_vertexShader); - CC_SAFE_RETAIN(_fragmentShader); + AX_SAFE_RETAIN(_vertexShader); + AX_SAFE_RETAIN(_fragmentShader); } ProgramMTL::~ProgramMTL() { - CC_SAFE_RELEASE(_vertexShader); - CC_SAFE_RELEASE(_fragmentShader); + AX_SAFE_RELEASE(_vertexShader); + AX_SAFE_RELEASE(_fragmentShader); } int ProgramMTL::getAttributeLocation(Attribute name) const diff --git a/core/renderer/backend/metal/TextureMTL.h b/core/renderer/backend/metal/TextureMTL.h index 3242519689..a4d09bf8c8 100644 --- a/core/renderer/backend/metal/TextureMTL.h +++ b/core/renderer/backend/metal/TextureMTL.h @@ -65,7 +65,7 @@ struct TextureInfoMTL TextureDescriptor _descriptor; id _mtlDevice; - std::array, CC_META_TEXTURES + 1> _mtlTextures; + std::array, AX_META_TEXTURES + 1> _mtlTextures; int _maxIdx = -1; id _mtlSamplerState = nil; diff --git a/core/renderer/backend/metal/TextureMTL.mm b/core/renderer/backend/metal/TextureMTL.mm index 0ed8f4340e..479f88851a 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 < CC_META_TEXTURES) + if (index < AX_META_TEXTURES) { id& mtlTexture = _mtlTextures[index]; if (mtlTexture) diff --git a/core/renderer/backend/metal/UtilsMTL.mm b/core/renderer/backend/metal/UtilsMTL.mm index 714df700c9..a6d9a42560 100644 --- a/core/renderer/backend/metal/UtilsMTL.mm +++ b/core/renderer/backend/metal/UtilsMTL.mm @@ -41,7 +41,7 @@ namespace MTLPixelFormat getSupportedDepthStencilFormat() { MTLPixelFormat pixelFormat = MTLPixelFormatDepth32Float_Stencil8; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) bool isDepth24Stencil8PixelFormatSupported = DeviceInfoMTL::supportD24S8(); if (isDepth24Stencil8PixelFormatSupported) pixelFormat = MTLPixelFormatDepth24Unorm_Stencil8; @@ -79,7 +79,7 @@ static GPUTextureFormatInfo s_textureFormats[] = { {MTLPixelFormatInvalid, MTLPixelFormatInvalid}, // ATC_INTERPOLATED_ALPHA /* astc */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) {MTLPixelFormatASTC_4x4_LDR, MTLPixelFormatASTC_4x4_sRGB}, // ASTC4x4 {MTLPixelFormatASTC_5x5_LDR, MTLPixelFormatASTC_5x5_sRGB}, // ASTC5x5 {MTLPixelFormatASTC_6x6_LDR, MTLPixelFormatASTC_6x6_sRGB}, // ASTC6x6 @@ -111,7 +111,7 @@ static GPUTextureFormatInfo s_textureFormats[] = { /* depth stencil */ {MTLPixelFormat(255 /*Depth24Unorm_Stencil8*/), MTLPixelFormatInvalid}, // D24S8 }; -static_assert(CC_ARRAYSIZE(s_textureFormats) == (int)PixelFormat::COUNT, +static_assert(AX_ARRAYSIZE(s_textureFormats) == (int)PixelFormat::COUNT, "The OpenGL GPU texture format info table incomplete!"); void UtilsMTL::initGPUTextureFormats() diff --git a/core/renderer/backend/opengl/BufferGL.cpp b/core/renderer/backend/opengl/BufferGL.cpp index 7ed7023420..f542bdb77c 100644 --- a/core/renderer/backend/opengl/BufferGL.cpp +++ b/core/renderer/backend/opengl/BufferGL.cpp @@ -51,7 +51,7 @@ BufferGL::BufferGL(std::size_t size, BufferType type, BufferUsage usage) : Buffe { glGenBuffers(1, &_buffer); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { this->reloadBuffer(); }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1); @@ -63,20 +63,20 @@ BufferGL::~BufferGL() if (_buffer) glDeleteBuffers(1, &_buffer); -#if CC_ENABLE_CACHE_TEXTURE_DATA - CC_SAFE_DELETE_ARRAY(_data); +#if AX_ENABLE_CACHE_TEXTURE_DATA + AX_SAFE_DELETE_ARRAY(_data); Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } void BufferGL::usingDefaultStoredData(bool needDefaultStoredData) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA _needDefaultStoredData = needDefaultStoredData; #endif } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA void BufferGL::reloadBuffer() { glGenBuffers(1, &_buffer); @@ -121,7 +121,7 @@ void BufferGL::updateData(void* data, std::size_t size) CHECK_GL_ERROR_DEBUG(); _bufferAllocated = size; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA fillBuffer(data, 0, size); #endif } @@ -147,7 +147,7 @@ void BufferGL::updateSubData(void* data, std::size_t offset, std::size_t size) glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, offset, size, data); } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA fillBuffer(data, offset, size); #endif CHECK_GL_ERROR_DEBUG(); diff --git a/core/renderer/backend/opengl/BufferGL.h b/core/renderer/backend/opengl/BufferGL.h index c2062693da..3c2e1b7eb3 100644 --- a/core/renderer/backend/opengl/BufferGL.h +++ b/core/renderer/backend/opengl/BufferGL.h @@ -85,7 +85,7 @@ public: inline GLuint getHandler() const { return _buffer; } private: -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA void reloadBuffer(); void fillBuffer(void* data, std::size_t offset, std::size_t size); diff --git a/core/renderer/backend/opengl/CommandBufferGL.cpp b/core/renderer/backend/opengl/CommandBufferGL.cpp index eac9209330..f1be71681a 100644 --- a/core/renderer/backend/opengl/CommandBufferGL.cpp +++ b/core/renderer/backend/opengl/CommandBufferGL.cpp @@ -189,7 +189,7 @@ void CommandBufferGL::setIndexBuffer(Buffer* buffer) return; buffer->retain(); - CC_SAFE_RELEASE(_indexBuffer); + AX_SAFE_RELEASE(_indexBuffer); _indexBuffer = static_cast(buffer); } @@ -200,14 +200,14 @@ void CommandBufferGL::setVertexBuffer(Buffer* buffer) return; buffer->retain(); - CC_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_vertexBuffer); _vertexBuffer = static_cast(buffer); } void CommandBufferGL::setProgramState(ProgramState* programState) { - CC_SAFE_RETAIN(programState); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RETAIN(programState); + AX_SAFE_RELEASE(_programState); _programState = programState; } @@ -234,8 +234,8 @@ void CommandBufferGL::drawElements(PrimitiveType primitiveType, void CommandBufferGL::endRenderPass() { - CC_SAFE_RELEASE_NULL(_indexBuffer); - CC_SAFE_RELEASE_NULL(_vertexBuffer); + AX_SAFE_RELEASE_NULL(_indexBuffer); + AX_SAFE_RELEASE_NULL(_vertexBuffer); } void CommandBufferGL::endFrame() {} @@ -325,7 +325,7 @@ void CommandBufferGL::setUniforms(ProgramGL* program) const auto& slots = iter.second.slots; auto& indexs = iter.second.indexs; auto location = iter.first; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA location = iter.second.location; #endif int i = 0; @@ -425,7 +425,7 @@ void CommandBufferGL::setUniform(bool isArray, GLuint location, unsigned int siz void CommandBufferGL::cleanResources() { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); } void CommandBufferGL::setLineWidth(float lineWidth) @@ -483,8 +483,8 @@ void CommandBufferGL::readPixels(RenderTarget* rt, glPixelStorei(GL_PACK_ALIGNMENT, 1); auto bufferSize = bytesPerRow * height; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(GL_ES_VERSION_3_0)) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID && defined(GL_PIXEL_PACK_BUFFER)) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 && defined(GL_ES_VERSION_3_0)) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID && defined(GL_PIXEL_PACK_BUFFER)) GLuint pbo; glGenBuffers(1, &pbo); glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo); @@ -510,8 +510,8 @@ void CommandBufferGL::readPixels(RenderTarget* rt, pbd._width = width; pbd._height = height; } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(GL_ES_VERSION_3_0)) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID && defined(GL_PIXEL_PACK_BUFFER)) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 && defined(GL_ES_VERSION_3_0)) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID && defined(GL_PIXEL_PACK_BUFFER)) glUnmapBuffer(GL_PIXEL_PACK_BUFFER); glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); glDeleteBuffers(1, &pbo); diff --git a/core/renderer/backend/opengl/CommandBufferGL.h b/core/renderer/backend/opengl/CommandBufferGL.h index f49ff943cf..95c68fb409 100644 --- a/core/renderer/backend/opengl/CommandBufferGL.h +++ b/core/renderer/backend/opengl/CommandBufferGL.h @@ -218,7 +218,7 @@ private: Viewport _viewPort; GLboolean _alphaTestEnabled = false; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundListener = nullptr; #endif }; diff --git a/core/renderer/backend/opengl/DeviceInfoGL.cpp b/core/renderer/backend/opengl/DeviceInfoGL.cpp index baf8b5a801..3dfdcbd999 100644 --- a/core/renderer/backend/opengl/DeviceInfoGL.cpp +++ b/core/renderer/backend/opengl/DeviceInfoGL.cpp @@ -68,7 +68,7 @@ static bool checkReallySupportsASTC() astctexels); auto error = glGetError(); -#if defined(CC_USE_GL) +#if defined(AX_USE_GL) if (!error && glGetTexImage) { // read pixel RGB: should be: 255, 128, 0 @@ -148,7 +148,7 @@ bool DeviceInfoGL::checkForFeatureSupported(FeatureType feature) featureSupported = checkForGLExtension("GL_OES_packed_depth_stencil"); break; case FeatureType::VAO: -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC featureSupported = checkForGLExtension("vertex_array_object"); #else featureSupported = checkForGLExtension("GL_OES_vertex_array_object"); diff --git a/core/renderer/backend/opengl/MacrosGL.h b/core/renderer/backend/opengl/MacrosGL.h index 81a5f35b97..fed49a33c9 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 CC_GL_ASSERT(gl_code) gl_code +# define AX_GL_ASSERT(gl_code) gl_code #else -# define CC_GL_ASSERT(gl_code) \ +# define AX_GL_ASSERT(gl_code) \ do \ { \ gl_code; \ __gl_error_code = glGetError(); \ - CC_ASSERT(__gl_error_code == GL_NO_ERROR, "Error"); \ + AX_ASSERT(__gl_error_code == GL_NO_ERROR, "Error"); \ } while (0) #endif diff --git a/core/renderer/backend/opengl/ProgramGL.cpp b/core/renderer/backend/opengl/ProgramGL.cpp index 131497787c..618849ea38 100644 --- a/core/renderer/backend/opengl/ProgramGL.cpp +++ b/core/renderer/backend/opengl/ProgramGL.cpp @@ -43,7 +43,7 @@ static const std::string SHADER_PREDEFINE = "#version 100\n precision highp floa ProgramGL::ProgramGL(std::string_view vertexShader, std::string_view fragmentShader) : Program(vertexShader, fragmentShader) { -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) // some device required manually specify the precision qualifiers for vertex shader. _vertexShaderModule = static_cast(ShaderCache::newVertexShaderModule(SHADER_PREDEFINE + _vertexShader)); @@ -54,12 +54,12 @@ ProgramGL::ProgramGL(std::string_view vertexShader, std::string_view fragmentSha _fragmentShaderModule = static_cast(ShaderCache::newFragmentShaderModule(_fragmentShader)); #endif - CC_SAFE_RETAIN(_vertexShaderModule); - CC_SAFE_RETAIN(_fragmentShaderModule); + AX_SAFE_RETAIN(_vertexShaderModule); + AX_SAFE_RETAIN(_fragmentShaderModule); compileProgram(); computeUniformInfos(); computeLocations(); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA for (const auto& uniform : _activeUniformInfos) { auto location = uniform.second.location; @@ -76,17 +76,17 @@ ProgramGL::ProgramGL(std::string_view vertexShader, std::string_view fragmentSha ProgramGL::~ProgramGL() { - CC_SAFE_RELEASE(_vertexShaderModule); - CC_SAFE_RELEASE(_fragmentShaderModule); + AX_SAFE_RELEASE(_vertexShaderModule); + AX_SAFE_RELEASE(_fragmentShaderModule); if (_program) glDeleteProgram(_program); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA void ProgramGL::reloadProgram() { _activeUniformInfos.clear(); @@ -310,7 +310,7 @@ UniformLocation ProgramGL::getUniformLocation(std::string_view uniform) const if (_activeUniformInfos.find(uniform) != _activeUniformInfos.end()) { const auto& uniformInfo = _activeUniformInfos.at(uniform); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA uniformLocation.location[0] = _mapToOriginalLocation.at(uniformInfo.location); #else uniformLocation.location[0] = uniformInfo.location; @@ -329,7 +329,7 @@ int ProgramGL::getMaxFragmentLocation() const return _maxLocation; } -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA int ProgramGL::getMappedLocation(int location) const { if (_mapToCurrentActiveLocation.find(location) != _mapToCurrentActiveLocation.end()) diff --git a/core/renderer/backend/opengl/ProgramGL.h b/core/renderer/backend/opengl/ProgramGL.h index 1e521b3152..59c2607631 100644 --- a/core/renderer/backend/opengl/ProgramGL.h +++ b/core/renderer/backend/opengl/ProgramGL.h @@ -156,7 +156,7 @@ private: bool getAttributeLocation(std::string_view attributeName, unsigned int& location) const; void computeUniformInfos(); void computeLocations(); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA virtual void reloadProgram(); virtual int getMappedLocation(int location) const override; virtual int getOriginalLocation(int location) const override; @@ -172,7 +172,7 @@ private: std::vector _attributeInfos; hlookup::string_map _activeUniformInfos; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA std::unordered_map _originalUniformLocations; ///< record the uniform location when shader was first created. std::unordered_map _mapToCurrentActiveLocation; ///< diff --git a/core/renderer/backend/opengl/RenderPipelineGL.cpp b/core/renderer/backend/opengl/RenderPipelineGL.cpp index e9bad70c3b..5da3e075f5 100644 --- a/core/renderer/backend/opengl/RenderPipelineGL.cpp +++ b/core/renderer/backend/opengl/RenderPipelineGL.cpp @@ -37,9 +37,9 @@ void RenderPipelineGL::update(const RenderTarget*, const PipelineDescriptor& pip { if (_programGL != pipelineDescirptor.programState->getProgram()) { - CC_SAFE_RELEASE(_programGL); + AX_SAFE_RELEASE(_programGL); _programGL = static_cast(pipelineDescirptor.programState->getProgram()); - CC_SAFE_RETAIN(_programGL); + AX_SAFE_RETAIN(_programGL); } updateBlendState(pipelineDescirptor.blendDescriptor); @@ -74,7 +74,7 @@ void RenderPipelineGL::updateBlendState(const BlendDescriptor& descriptor) RenderPipelineGL::~RenderPipelineGL() { - CC_SAFE_RELEASE(_programGL); + AX_SAFE_RELEASE(_programGL); } NS_AX_BACKEND_END diff --git a/core/renderer/backend/opengl/RenderTargetGL.cpp b/core/renderer/backend/opengl/RenderTargetGL.cpp index 9e7b44189a..b42932cf8c 100644 --- a/core/renderer/backend/opengl/RenderTargetGL.cpp +++ b/core/renderer/backend/opengl/RenderTargetGL.cpp @@ -60,7 +60,7 @@ void RenderTargetGL::update() const { bufs[i] = GL_COLOR_ATTACHMENT0 + i; } } - #if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX glDrawBuffers(MAX_COLOR_ATTCHMENT, bufs); #endif CHECK_GL_ERROR_DEBUG(); diff --git a/core/renderer/backend/opengl/TextureGL.cpp b/core/renderer/backend/opengl/TextureGL.cpp index 1e6075b5d6..6056eeefc0 100644 --- a/core/renderer/backend/opengl/TextureGL.cpp +++ b/core/renderer/backend/opengl/TextureGL.cpp @@ -98,12 +98,12 @@ void TextureInfoGL::setCurrentTexParameters(GLenum target) void TextureInfoGL::apply(int slot, int index, GLenum target) const { glActiveTexture(GL_TEXTURE0 + slot); - glBindTexture(target, index < CC_META_TEXTURES ? textures[index] : textures[0]); + glBindTexture(target, index < AX_META_TEXTURES ? textures[index] : textures[0]); } GLuint TextureInfoGL::ensure(int index, GLenum target) { - if (index >= CC_META_TEXTURES) + if (index >= AX_META_TEXTURES) return 0; // glActiveTexture(GL_TEXTURE0 + index); auto& texID = this->textures[index]; @@ -139,7 +139,7 @@ Texture2DGL::Texture2DGL(const TextureDescriptor& descriptor) { updateTextureDescriptor(descriptor); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // Listen this event to restored texture id after coming to foreground on Android. _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { _textureInfo.recreateAll(GL_TEXTURE_2D); @@ -184,7 +184,7 @@ void Texture2DGL::initWithZeros() Texture2DGL::~Texture2DGL() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -318,7 +318,7 @@ TextureCubeGL::TextureCubeGL(const TextureDescriptor& descriptor) _textureType = TextureType::TEXTURE_CUBE; updateTextureDescriptor(descriptor); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // Listen this event to restored texture id after coming to foreground on Android. _backToForegroundListener = EventListenerCustom::create( EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { _textureInfo.recreateAll(GL_TEXTURE_CUBE_MAP); }); @@ -339,7 +339,7 @@ void TextureCubeGL::updateTextureDescriptor(const axis::backend::TextureDescript TextureCubeGL::~TextureCubeGL() { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } diff --git a/core/renderer/backend/opengl/TextureGL.h b/core/renderer/backend/opengl/TextureGL.h index eb59fa87a5..39ceffece9 100644 --- a/core/renderer/backend/opengl/TextureGL.h +++ b/core/renderer/backend/opengl/TextureGL.h @@ -80,7 +80,7 @@ struct TextureInfoGL GLenum format = GL_RGBA; GLenum type = GL_UNSIGNED_BYTE; - std::array textures; + std::array textures; int maxIdx = 0; }; diff --git a/core/renderer/backend/opengl/UtilsGL.cpp b/core/renderer/backend/opengl/UtilsGL.cpp index daa9182b93..19f48e4ce1 100644 --- a/core/renderer/backend/opengl/UtilsGL.cpp +++ b/core/renderer/backend/opengl/UtilsGL.cpp @@ -90,13 +90,13 @@ static GPUTextureFormatInfo s_textureFormats[] = { GL_LUMINANCE_ALPHA, GL_SLUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, }, // LA8 /* depth stencil internalFormat | internalFormatSrgb | format | formatSrgb | type */ -#if defined(CC_USE_GLES) +#if defined(AX_USE_GLES) { GL_DEPTH_STENCIL_OES, GL_ZERO, GL_DEPTH_STENCIL_OES, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, }, // D24S8 #else { GL_DEPTH24_STENCIL8, GL_ZERO, GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, }, // D24S8 #endif }; -static_assert(CC_ARRAYSIZE(s_textureFormats) == (int)PixelFormat::COUNT, "The OpenGL GPU texture format info table incomplete!"); +static_assert(AX_ARRAYSIZE(s_textureFormats) == (int)PixelFormat::COUNT, "The OpenGL GPU texture format info table incomplete!"); // clang-format on /* diff --git a/core/renderer/ccShaders.h b/core/renderer/ccShaders.h index 9ca49efc41..b26e65f3b9 100644 --- a/core/renderer/ccShaders.h +++ b/core/renderer/ccShaders.h @@ -37,53 +37,53 @@ THE SOFTWARE. NS_AX_BEGIN -extern CC_DLL const char* positionColor_vert; -extern CC_DLL const char* positionColor_frag; -extern CC_DLL const char* positionTexture_vert; -extern CC_DLL const char* positionTexture_frag; -extern CC_DLL const char* positionTextureColor_vert; -extern CC_DLL const char* positionTextureColor_frag; -extern CC_DLL const char* positionTextureColorAlphaTest_frag; -extern CC_DLL const char* label_normal_frag; -extern CC_DLL const char* label_distanceNormal_frag; -extern CC_DLL const char* labelOutline_frag; -extern CC_DLL const char* labelDistanceFieldGlow_frag; -extern CC_DLL const char* lineColor3D_frag; -extern CC_DLL const char* lineColor3D_vert; -extern CC_DLL const char* positionColorLengthTexture_vert; -extern CC_DLL const char* positionColorLengthTexture_frag; -extern CC_DLL const char* positionColorTextureAsPointsize_vert; -extern CC_DLL const char* position_vert; -extern CC_DLL const char* layer_radialGradient_frag; -extern CC_DLL const char* grayScale_frag; -extern CC_DLL const char* positionUColor_vert; -extern CC_DLL const char* dualSampler_frag; -extern CC_DLL const char* dualSampler_gray_frag; -extern CC_DLL const char* cameraClear_vert; -extern CC_DLL const char* cameraClear_frag; +extern AX_DLL const char* positionColor_vert; +extern AX_DLL const char* positionColor_frag; +extern AX_DLL const char* positionTexture_vert; +extern AX_DLL const char* positionTexture_frag; +extern AX_DLL const char* positionTextureColor_vert; +extern AX_DLL const char* positionTextureColor_frag; +extern AX_DLL const char* positionTextureColorAlphaTest_frag; +extern AX_DLL const char* label_normal_frag; +extern AX_DLL const char* label_distanceNormal_frag; +extern AX_DLL const char* labelOutline_frag; +extern AX_DLL const char* labelDistanceFieldGlow_frag; +extern AX_DLL const char* lineColor3D_frag; +extern AX_DLL const char* lineColor3D_vert; +extern AX_DLL const char* positionColorLengthTexture_vert; +extern AX_DLL const char* positionColorLengthTexture_frag; +extern AX_DLL const char* positionColorTextureAsPointsize_vert; +extern AX_DLL const char* position_vert; +extern AX_DLL const char* layer_radialGradient_frag; +extern AX_DLL const char* grayScale_frag; +extern AX_DLL const char* positionUColor_vert; +extern AX_DLL const char* dualSampler_frag; +extern AX_DLL const char* dualSampler_gray_frag; +extern AX_DLL const char* cameraClear_vert; +extern AX_DLL const char* cameraClear_frag; -extern CC_DLL const char* CC3D_color_frag; -extern CC_DLL const char* CC3D_colorNormal_frag; -extern CC_DLL const char* CC3D_colorNormalTexture_frag; -extern CC_DLL const char* CC3D_colorTexture_frag; -extern CC_DLL const char* CC3D_particleTexture_frag; -extern CC_DLL const char* CC3D_particleColor_frag; -extern CC_DLL const char* CC3D_particle_vert; -extern CC_DLL const char* CC3D_positionNormalTexture_vert; -extern CC_DLL const char* CC3D_skinPositionNormalTexture_vert; -extern CC_DLL const char* CC3D_positionTexture_vert; -extern CC_DLL const char* CC3D_skinPositionTexture_vert; -extern CC_DLL const char* CC3D_skybox_frag; -extern CC_DLL const char* CC3D_skybox_vert; -extern CC_DLL const char* CC3D_terrain_frag; -extern CC_DLL const char* CC3D_terrain_vert; +extern AX_DLL const char* CC3D_color_frag; +extern AX_DLL const char* CC3D_colorNormal_frag; +extern AX_DLL const char* CC3D_colorNormalTexture_frag; +extern AX_DLL const char* CC3D_colorTexture_frag; +extern AX_DLL const char* CC3D_particleTexture_frag; +extern AX_DLL const char* CC3D_particleColor_frag; +extern AX_DLL const char* CC3D_particle_vert; +extern AX_DLL const char* CC3D_positionNormalTexture_vert; +extern AX_DLL const char* CC3D_skinPositionNormalTexture_vert; +extern AX_DLL const char* CC3D_positionTexture_vert; +extern AX_DLL const char* CC3D_skinPositionTexture_vert; +extern AX_DLL const char* CC3D_skybox_frag; +extern AX_DLL const char* CC3D_skybox_vert; +extern AX_DLL const char* CC3D_terrain_frag; +extern AX_DLL const char* CC3D_terrain_vert; -extern CC_DLL const char* CC2D_quadTexture_frag; -extern CC_DLL const char* CC2D_quadColor_frag; -extern CC_DLL const char* CC2D_quad_vert; +extern AX_DLL const char* CC2D_quadTexture_frag; +extern AX_DLL const char* CC2D_quadColor_frag; +extern AX_DLL const char* CC2D_quad_vert; -extern CC_DLL const char* hsv_frag; -extern CC_DLL const char* dualSampler_hsv_frag; +extern AX_DLL const char* hsv_frag; +extern AX_DLL const char* dualSampler_hsv_frag; NS_AX_END /** end of support group diff --git a/core/ui/CocosGUI.h b/core/ui/CocosGUI.h index 40dca1fcea..acf8b0fc38 100644 --- a/core/ui/CocosGUI.h +++ b/core/ui/CocosGUI.h @@ -67,7 +67,7 @@ namespace ui * Get current cocos GUI module version string. *@return A string representation of GUI module version number */ -CC_GUI_DLL const char* CocosGUIVersion(); +AX_GUI_DLL const char* CocosGUIVersion(); } // namespace ui diff --git a/core/ui/GUIDefine.h b/core/ui/GUIDefine.h index 460c0874dd..1ae676a088 100644 --- a/core/ui/GUIDefine.h +++ b/core/ui/GUIDefine.h @@ -60,13 +60,13 @@ public: \ #define CREATE_CLASS_WIDGET_READER_INFO(className) axis::ObjectFactory::TInfo(#className, &className::createInstance) -#define CC_VIDEOPLAYER_DEBUG_DRAW 0 +#define AX_VIDEOPLAYER_DEBUG_DRAW 0 #define __LAYOUT_COMPONENT_NAME "__ui_layout" ///@endcond NS_AX_BEGIN -struct CC_DLL ResourceData +struct AX_DLL ResourceData { int type; std::string file; diff --git a/core/ui/GUIExport.h b/core/ui/GUIExport.h index 55e42ac99c..aa8a8371fd 100644 --- a/core/ui/GUIExport.h +++ b/core/ui/GUIExport.h @@ -30,13 +30,13 @@ # include # endif -# if defined(CC_STATIC) -# define CC_GUI_DLL +# if defined(AX_STATIC) +# define AX_GUI_DLL # else # if defined(_USEGUIDLL) -# define CC_GUI_DLL __declspec(dllexport) +# define AX_GUI_DLL __declspec(dllexport) # else -# define CC_GUI_DLL __declspec(dllimport) +# define AX_GUI_DLL __declspec(dllimport) # endif # endif @@ -49,9 +49,9 @@ # endif # endif #elif defined(_SHARED_) -# define CC_GUI_DLL __attribute__((visibility("default"))) +# define AX_GUI_DLL __attribute__((visibility("default"))) #else -# define CC_GUI_DLL +# define AX_GUI_DLL #endif #endif /* __CCEXTENSIONEXPORT_H__*/ \ No newline at end of file diff --git a/core/ui/LayoutHelper.cpp b/core/ui/LayoutHelper.cpp index 8b817171f0..8f88ac2ffe 100644 --- a/core/ui/LayoutHelper.cpp +++ b/core/ui/LayoutHelper.cpp @@ -1030,7 +1030,7 @@ float LayoutHelper::VisibleRect::getNodeTop(Node* pNode) void LayoutHelper::VisibleRect::setNodeLeft(Node* pNode, float left) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(0, scrSize.height) - LayoutHelper::VisibleRect::leftTop(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1045,7 +1045,7 @@ void LayoutHelper::VisibleRect::setNodeLeft(Node* pNode, float left) } void LayoutHelper::VisibleRect::setNodeTop(Node* pNode, float top) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(0, scrSize.height) - LayoutHelper::VisibleRect::leftTop(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1060,7 +1060,7 @@ void LayoutHelper::VisibleRect::setNodeTop(Node* pNode, float top) } void LayoutHelper::VisibleRect::setNodeRight(Node* pNode, float right) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, 0) - LayoutHelper::VisibleRect::rightBottom(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1075,7 +1075,7 @@ void LayoutHelper::VisibleRect::setNodeRight(Node* pNode, float right) } void LayoutHelper::VisibleRect::setNodeBottom(Node* pNode, float bottom) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, 0) - LayoutHelper::VisibleRect::rightBottom(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1091,7 +1091,7 @@ void LayoutHelper::VisibleRect::setNodeBottom(Node* pNode, float bottom) void LayoutHelper::VisibleRect::setNodeLT(Node* pNode, const axis::Point& p) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(0, scrSize.height) - LayoutHelper::VisibleRect::leftTop(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1108,7 +1108,7 @@ void LayoutHelper::VisibleRect::setNodeLT(Node* pNode, const axis::Point& p) } void LayoutHelper::VisibleRect::setNodeRT(Node* pNode, const axis::Point& p) { // right top - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, scrSize.height) - LayoutHelper::VisibleRect::rightTop(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1124,7 +1124,7 @@ void LayoutHelper::VisibleRect::setNodeRT(Node* pNode, const axis::Point& p) } void LayoutHelper::VisibleRect::setNodeLB(Node* pNode, const axis::Point& p) { // left bottom - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(0, 0) - LayoutHelper::VisibleRect::leftBottom(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1140,7 +1140,7 @@ void LayoutHelper::VisibleRect::setNodeLB(Node* pNode, const axis::Point& p) } void LayoutHelper::VisibleRect::setNodeRB(Node* pNode, const axis::Point& p) { // right bottom - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, 0) - LayoutHelper::VisibleRect::rightBottom(); Vec2 size = pNode->getContentSize() * getScale2D(pNode); @@ -1159,7 +1159,7 @@ void LayoutHelper::VisibleRect::setNodeRB(Node* pNode, const axis::Point& p) /// ratio position void LayoutHelper::VisibleRect::setNodeNormalizedLT(Node* pNode, const axis::Point& ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(0, scrSize.height) - LayoutHelper::VisibleRect::leftTop(); @@ -1181,7 +1181,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedLT(Node* pNode, const axis::Poi } void LayoutHelper::VisibleRect::setNodeNormalizedRT(Node* pNode, const axis::Point& ratio) { // right top - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, scrSize.height) - LayoutHelper::VisibleRect::rightTop(); @@ -1202,7 +1202,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedRT(Node* pNode, const axis::Poi } void LayoutHelper::VisibleRect::setNodeNormalizedLB(Node* pNode, const axis::Point& ratio) { // left bottom - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(0, 0) - LayoutHelper::VisibleRect::leftBottom(); @@ -1223,7 +1223,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedLB(Node* pNode, const axis::Poi } void LayoutHelper::VisibleRect::setNodeNormalizedRB(Node* pNode, const axis::Point& ratio) { // right bottom - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, 0) - LayoutHelper::VisibleRect::rightBottom(); @@ -1245,7 +1245,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedRB(Node* pNode, const axis::Poi void LayoutHelper::VisibleRect::setNodeNormalizedTop(Node* pNode, const float ratioTop) { // right top - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 scrSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize(); axis::Point delta = axis::Vec2(scrSize.width, scrSize.height) - LayoutHelper::VisibleRect::rightTop(); @@ -1265,7 +1265,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedTop(Node* pNode, const float ra void LayoutHelper::VisibleRect::setNodeNormalizedPositionX(axis::Node* pNode, float ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); axis::Rect visibleRect = LayoutHelper::LayoutHelper::VisibleRect::getScreenVisibleRect(); axis::Point ptWorld(visibleRect.size.width * ratio + visibleRect.origin.x, 0); auto ptLocal = pNode->getParent()->convertToNodeSpace(ptWorld); @@ -1274,7 +1274,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedPositionX(axis::Node* pNode, fl void LayoutHelper::VisibleRect::setNodeNormalizedPositionY(axis::Node* pNode, float ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); axis::Rect visibleRect = LayoutHelper::LayoutHelper::VisibleRect::getScreenVisibleRect(); axis::Point ptWorld(0, visibleRect.size.height * ratio + visibleRect.origin.y); @@ -1283,7 +1283,7 @@ void LayoutHelper::VisibleRect::setNodeNormalizedPositionY(axis::Node* pNode, fl } void LayoutHelper::VisibleRect::setNodeNormalizedPosition(Node* pNode, const axis::Point& ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); pNode->setIgnoreAnchorPointForPosition(false); pNode->setAnchorPoint(axis::Vec2(.5f, .5f)); axis::Rect visibleRect = LayoutHelper::LayoutHelper::VisibleRect::getScreenVisibleRect(); diff --git a/core/ui/LayoutHelper.h b/core/ui/LayoutHelper.h index 65073d2db1..1215af1283 100644 --- a/core/ui/LayoutHelper.h +++ b/core/ui/LayoutHelper.h @@ -37,7 +37,7 @@ USING_NS_AX; // return Vec2(left.width * right.x, left.height * right.y); // } -struct CC_DLL LayoutHelper +struct AX_DLL LayoutHelper { static Vec2 s_designSize; @@ -222,7 +222,7 @@ struct CC_DLL LayoutHelper // @version 2 static void centerNodeX(axis::Node* pNode, const Vec2& parentSize) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -235,7 +235,7 @@ struct CC_DLL LayoutHelper static void centerNodeY(axis::Node* pNode, const Vec2& parentSize) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -248,7 +248,7 @@ struct CC_DLL LayoutHelper static void centerNode(axis::Node* pNode, const Vec2& parentSize) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achor = axis::Vec2::ZERO; @@ -375,7 +375,7 @@ struct CC_DLL LayoutHelper // @version 2 used as internal interfaces static void setNodeLeft(axis::Node* pNode, const Vec2& parentSize, float left, float anchor = 0.0f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -387,7 +387,7 @@ struct CC_DLL LayoutHelper } static float getNodeLeft(axis::Node* pNode, const Vec2& parentSize, float anchor = 0.0f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -400,7 +400,7 @@ struct CC_DLL LayoutHelper static void setNodeTop(axis::Node* pNode, const Vec2& parentSize, float top, float anchor = 0.0f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -412,7 +412,7 @@ struct CC_DLL LayoutHelper } static float getNodeTop(axis::Node* pNode, const Vec2& parentSize, float anchor = 0.0f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -425,7 +425,7 @@ struct CC_DLL LayoutHelper static void setNodeRight(axis::Node* pNode, const Vec2& parentSize, float right) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -438,7 +438,7 @@ struct CC_DLL LayoutHelper static float getNodeRight(axis::Node* pNode, const Vec2& parentSize, float anchor = 0.0f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorX = 0.0f; @@ -451,7 +451,7 @@ struct CC_DLL LayoutHelper static void setNodeBottom(axis::Node* pNode, const Vec2& parentSize, float bottom, float anchor = 0.0f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -464,7 +464,7 @@ struct CC_DLL LayoutHelper static float getNodeBottom(axis::Node* pNode, const Vec2& parentSize, float anchor = 0.f) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); float achorY = 0.0f; @@ -477,7 +477,7 @@ struct CC_DLL LayoutHelper static void setNodeLB(axis::Node* pNode, const Vec2& parentSize, const axis::Point& p) { // left bottom - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achorPoint = axis::Vec2::ZERO; @@ -491,7 +491,7 @@ struct CC_DLL LayoutHelper static void setNodeRB(axis::Node* pNode, const Vec2& parentSize, const axis::Point& p) { // right bottom - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achorPoint = axis::Vec2::ZERO; @@ -505,7 +505,7 @@ struct CC_DLL LayoutHelper static void setNodeLT(axis::Node* pNode, const Vec2& parentSize, const axis::Point& p) { // left top - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achorPoint = axis::Vec2::ZERO; @@ -519,7 +519,7 @@ struct CC_DLL LayoutHelper static void setNodeRT(axis::Node* pNode, const Vec2& parentSize, const axis::Point& p) { // right top - CC_ASSERT(pNode); + AX_ASSERT(pNode); Vec2 size = pNode->getContentSize() * getScale2D(pNode); axis::Point achorPoint = axis::Vec2::ZERO; @@ -561,20 +561,20 @@ struct CC_DLL LayoutHelper /* set node position as normalized: @version 2 */ static void setNodeNormalizedPositionX(axis::Node* pNode, const Vec2& parentSize, float ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); pNode->setPositionX(parentSize.width * ratio); } static void setNodeNormalizedPositionY(axis::Node* pNode, const Vec2& parentSize, float ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); pNode->setPositionY(parentSize.height * ratio); } static void setNodeNormalizedPosition(axis::Node* pNode, const Vec2& parentSize, const axis::Point& ratio) { - CC_ASSERT(pNode); + AX_ASSERT(pNode); pNode->setPosition(axis::Point(parentSize.width * ratio.x, parentSize.height * ratio.y)); } @@ -773,7 +773,7 @@ struct CC_DLL LayoutHelper /// /// CLASS VisibleRect /// - class CC_DLL VisibleRect + class AX_DLL VisibleRect { public: static void refresh(void); diff --git a/core/ui/UIAbstractCheckButton.h b/core/ui/UIAbstractCheckButton.h index a77ff6cc7a..25f8ab3c05 100644 --- a/core/ui/UIAbstractCheckButton.h +++ b/core/ui/UIAbstractCheckButton.h @@ -35,7 +35,7 @@ THE SOFTWARE. */ NS_AX_BEGIN class Sprite; -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -43,7 +43,7 @@ namespace ui /** * AbstractCheckButton is a specific type of two-states button that can be either checked or unchecked. */ -class CC_GUI_DLL AbstractCheckButton : public Widget +class AX_GUI_DLL AbstractCheckButton : public Widget { public: diff --git a/core/ui/UIButton.cpp b/core/ui/UIButton.cpp index f4003b9940..5880455abd 100644 --- a/core/ui/UIButton.cpp +++ b/core/ui/UIButton.cpp @@ -88,7 +88,7 @@ Button* Button::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -103,7 +103,7 @@ Button* Button::create(std::string_view normalImage, btn->autorelease(); return btn; } - CC_SAFE_DELETE(btn); + AX_SAFE_DELETE(btn); return nullptr; } @@ -170,9 +170,9 @@ void Button::setTitleLabel(Label* label) { if (_titleRenderer != label) { - CC_SAFE_RELEASE(_titleRenderer); + AX_SAFE_RELEASE(_titleRenderer); _titleRenderer = label; - CC_SAFE_RETAIN(_titleRenderer); + AX_SAFE_RETAIN(_titleRenderer); addProtectedChild(_titleRenderer, TITLE_RENDERER_Z, -1); updateTitleLocation(); @@ -729,7 +729,7 @@ void Button::setTitleText(std::string_view text) if (getTitleFontSize() <= 0) { - setTitleFontSize(CC_DEFAULT_FONT_LABEL_SIZE); + setTitleFontSize(AX_DEFAULT_FONT_LABEL_SIZE); } _titleRenderer->setString(text); diff --git a/core/ui/UIButton.h b/core/ui/UIButton.h index 05e0f5f1cd..0d4d628bcb 100644 --- a/core/ui/UIButton.h +++ b/core/ui/UIButton.h @@ -38,7 +38,7 @@ NS_AX_BEGIN class Label; class SpriteFrame; -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -48,7 +48,7 @@ class Scale9Sprite; * Represents a push-button widget. * Push-buttons can be pressed, or clicked, by the user to perform an action. */ -class CC_GUI_DLL Button : public Widget +class AX_GUI_DLL Button : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UICheckBox.cpp b/core/ui/UICheckBox.cpp index 50d6999e42..7456dd120c 100644 --- a/core/ui/UICheckBox.cpp +++ b/core/ui/UICheckBox.cpp @@ -44,7 +44,7 @@ CheckBox* CheckBox::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -61,7 +61,7 @@ CheckBox* CheckBox::create(std::string_view backGround, pWidget->autorelease(); return pWidget; } - CC_SAFE_DELETE(pWidget); + AX_SAFE_DELETE(pWidget); return nullptr; } @@ -73,7 +73,7 @@ CheckBox* CheckBox::create(std::string_view backGround, std::string_view cross, pWidget->autorelease(); return pWidget; } - CC_SAFE_DELETE(pWidget); + AX_SAFE_DELETE(pWidget); return nullptr; } diff --git a/core/ui/UICheckBox.h b/core/ui/UICheckBox.h index caae7404ee..c18f1f18a0 100644 --- a/core/ui/UICheckBox.h +++ b/core/ui/UICheckBox.h @@ -41,7 +41,7 @@ namespace ui /** * Checkbox is a specific type of two-states button that can be either checked or unchecked. */ -class CC_GUI_DLL CheckBox : public AbstractCheckButton +class AX_GUI_DLL CheckBox : public AbstractCheckButton { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UIEditBox/UIEditBox.cpp b/core/ui/UIEditBox/UIEditBox.cpp index e24b8703dd..24ef528813 100644 --- a/core/ui/UIEditBox/UIEditBox.cpp +++ b/core/ui/UIEditBox/UIEditBox.cpp @@ -45,8 +45,8 @@ EditBox::EditBox() EditBox::~EditBox() { - CC_SAFE_DELETE(_editBoxImpl); -#if CC_ENABLE_SCRIPT_BINDING + AX_SAFE_DELETE(_editBoxImpl); +#if AX_ENABLE_SCRIPT_BINDING unregisterScriptEditBoxHandler(); #endif } @@ -74,7 +74,7 @@ EditBox* EditBox::create(const Vec2& size, } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -92,7 +92,7 @@ EditBox* EditBox::create(const Vec2& size, } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } @@ -797,8 +797,8 @@ void EditBox::onEnter() { _editBoxImpl->onEnter(); } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) - this->schedule(CC_SCHEDULE_SELECTOR(EditBox::updatePosition), CHECK_EDITBOX_POSITION_INTERVAL); +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) + this->schedule(AX_SCHEDULE_SELECTOR(EditBox::updatePosition), CHECK_EDITBOX_POSITION_INTERVAL); #endif } @@ -873,7 +873,7 @@ void EditBox::setGlobalZOrder(float globalZOrder) } } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING void EditBox::registerScriptEditBoxHandler(int handler) { unregisterScriptEditBoxHandler(); diff --git a/core/ui/UIEditBox/UIEditBox.h b/core/ui/UIEditBox/UIEditBox.h index 67aa27ec1e..37515e83d1 100644 --- a/core/ui/UIEditBox/UIEditBox.h +++ b/core/ui/UIEditBox/UIEditBox.h @@ -51,7 +51,7 @@ class EditBoxImpl; * @js NA * @lua NA */ -class CC_GUI_DLL EditBoxDelegate +class AX_GUI_DLL EditBoxDelegate { public: /** @@ -100,7 +100,7 @@ public: * You can use this widget to gather small amounts of text from the user. * */ -class CC_GUI_DLL EditBox : public Widget, public IMEDelegate +class AX_GUI_DLL EditBox : public Widget, public IMEDelegate { public: /** @@ -381,7 +381,7 @@ public: */ EditBoxDelegate* getDelegate(); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING /** * Registers a script function that will be called for EditBox events. * @@ -423,7 +423,7 @@ public: */ int getScriptEditBoxHandler() { return _scriptEditBoxHandler; } -#endif // #if CC_ENABLE_SCRIPT_BINDING +#endif // #if AX_ENABLE_SCRIPT_BINDING /** * Set the text entered in the edit box. @@ -706,7 +706,7 @@ protected: EditBoxDelegate* _delegate = nullptr; float _adjustHeight = 0.f; -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING int _scriptEditBoxHandler = 0; #endif }; diff --git a/core/ui/UIEditBox/UIEditBoxImpl-android.cpp b/core/ui/UIEditBox/UIEditBoxImpl-android.cpp index b537baa5a7..d348b9e953 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-android.cpp +++ b/core/ui/UIEditBox/UIEditBoxImpl-android.cpp @@ -28,7 +28,7 @@ #include "ui/UIEditBox/UIEditBoxImpl-android.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "ui/UIEditBox/UIEditBox.h" # include @@ -249,4 +249,4 @@ const char* EditBoxImplAndroid::getNativeDefaultFontName() NS_AX_END -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) */ +#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-android.h b/core/ui/UIEditBox/UIEditBoxImpl-android.h index 4ae9c8b3cc..562bd8fc4a 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-android.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-android.h @@ -29,7 +29,7 @@ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "ui/UIEditBox/UIEditBoxImpl-common.h" @@ -82,6 +82,6 @@ private: NS_AX_END -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) */ +#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) */ #endif /* __UIEDITBOXIMPLANDROID_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-common.cpp b/core/ui/UIEditBox/UIEditBoxImpl-common.cpp index c8203f4854..24aef5d2e5 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-common.cpp +++ b/core/ui/UIEditBox/UIEditBoxImpl-common.cpp @@ -33,9 +33,9 @@ #include "2d/CCLabel.h" #include "ui/UIHelper.h" -static const int CC_EDIT_BOX_PADDING = 5; +static const int AX_EDIT_BOX_PADDING = 5; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # define PASSWORD_CHAR "*" #else # define PASSWORD_CHAR "\u25CF" @@ -45,7 +45,7 @@ NS_AX_BEGIN static Vec2 applyPadding(const Vec2& sizeToCorrect) { - return Vec2(sizeToCorrect.width - CC_EDIT_BOX_PADDING * 2, sizeToCorrect.height); + return Vec2(sizeToCorrect.width - AX_EDIT_BOX_PADDING * 2, sizeToCorrect.height); } namespace ui @@ -116,20 +116,20 @@ void EditBoxImplCommon::placeInactiveLabels(const Vec2& size) if (_editBoxInputMode == EditBox::InputMode::ANY) { - _label->setPosition(Vec2((float)CC_EDIT_BOX_PADDING, size.height - CC_EDIT_BOX_PADDING)); + _label->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, size.height - AX_EDIT_BOX_PADDING)); _label->setVerticalAlignment(TextVAlignment::TOP); _label->enableWrap(true); - _labelPlaceHolder->setPosition(Vec2((float)CC_EDIT_BOX_PADDING, size.height - CC_EDIT_BOX_PADDING)); + _labelPlaceHolder->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, size.height - AX_EDIT_BOX_PADDING)); _labelPlaceHolder->setVerticalAlignment(TextVAlignment::TOP); } else { _label->enableWrap(false); - _label->setPosition(Vec2((float)CC_EDIT_BOX_PADDING, size.height)); + _label->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, size.height)); _label->setVerticalAlignment(TextVAlignment::CENTER); - _labelPlaceHolder->setPosition(Vec2((float)CC_EDIT_BOX_PADDING, (size.height + placeholderSize.height) / 2)); + _labelPlaceHolder->setPosition(Vec2((float)AX_EDIT_BOX_PADDING, (size.height + placeholderSize.height) / 2)); _labelPlaceHolder->setVerticalAlignment(TextVAlignment::CENTER); } } @@ -364,7 +364,7 @@ void EditBoxImplCommon::editBoxEditingDidBegin() pDelegate->editBoxEditingDidBegin(_editBox); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING if (NULL != _editBox && 0 != _editBox->getScriptEditBoxHandler()) { axis::CommonScriptData data(_editBox->getScriptEditBoxHandler(), "began", _editBox); @@ -386,7 +386,7 @@ void EditBoxImplCommon::editBoxEditingDidEnd(std::string_view text, EditBoxDeleg pDelegate->editBoxReturn(_editBox); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING if (_editBox != nullptr && 0 != _editBox->getScriptEditBoxHandler()) { axis::CommonScriptData data(_editBox->getScriptEditBoxHandler(), "ended", _editBox); @@ -415,7 +415,7 @@ void EditBoxImplCommon::editBoxEditingChanged(std::string_view text) pDelegate->editBoxTextChanged(_editBox, text); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING if (NULL != _editBox && 0 != _editBox->getScriptEditBoxHandler()) { axis::CommonScriptData data(_editBox->getScriptEditBoxHandler(), "changed", _editBox); diff --git a/core/ui/UIEditBox/UIEditBoxImpl-common.h b/core/ui/UIEditBox/UIEditBoxImpl-common.h index 7831f886d1..942b5c0a24 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-common.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-common.h @@ -40,7 +40,7 @@ namespace ui class EditBox; -class CC_GUI_DLL EditBoxImplCommon : public EditBoxImpl +class AX_GUI_DLL EditBoxImplCommon : public EditBoxImpl { public: /** diff --git a/core/ui/UIEditBox/UIEditBoxImpl-ios.h b/core/ui/UIEditBox/UIEditBoxImpl-ios.h index a8d8869506..96717cf7d8 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-ios.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-ios.h @@ -27,7 +27,7 @@ #ifndef __UIEditBoxIMPLIOS_H__ #define __UIEditBoxIMPLIOS_H__ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # include "ui/UIEditBox/UIEditBoxImpl-common.h" @@ -87,6 +87,6 @@ private: NS_AX_END -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */ +#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) */ #endif /* __UIEditBoxIMPLIOS_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-ios.mm b/core/ui/UIEditBox/UIEditBoxImpl-ios.mm index d4ed934606..934f895845 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-ios.mm +++ b/core/ui/UIEditBox/UIEditBoxImpl-ios.mm @@ -26,7 +26,7 @@ ****************************************************************************/ #include "ui/UIEditBox/UIEditBoxImpl-ios.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # define kLabelZOrder 9999 @@ -245,4 +245,4 @@ UIFont* EditBoxImplIOS::constructFont(const char* fontName, int fontSize) NS_AX_END -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */ +#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-linux.cpp b/core/ui/UIEditBox/UIEditBoxImpl-linux.cpp index 15d1c30405..d9f40229c1 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-linux.cpp +++ b/core/ui/UIEditBox/UIEditBoxImpl-linux.cpp @@ -26,7 +26,7 @@ #include "ui/UIEditBox/UIEditBoxImpl-linux.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) # include "ui/UIEditBox/UIEditBox.h" # include "2d/CCLabel.h" @@ -112,4 +112,4 @@ void EditBoxImplLinux::nativeOpenKeyboard() NS_AX_END -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) */ +#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-linux.h b/core/ui/UIEditBox/UIEditBoxImpl-linux.h index 643c150321..b3dcb03c2f 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-linux.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-linux.h @@ -29,7 +29,7 @@ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) # include "ui/UIEditBox/UIEditBoxImpl-common.h" @@ -82,6 +82,6 @@ private: NS_AX_END -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) */ +#endif /* #if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) */ #endif /* __UIEDITBOXIMPLLINUX_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-mac.h b/core/ui/UIEditBox/UIEditBoxImpl-mac.h index fedcc8bed1..1fae64cc00 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-mac.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-mac.h @@ -29,7 +29,7 @@ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # include "ui/UIEditBox/UIEditBoxImpl-common.h" @@ -86,6 +86,6 @@ private: NS_AX_END -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) #endif /* __UIEditBoxIMPLMAC_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-mac.mm b/core/ui/UIEditBox/UIEditBoxImpl-mac.mm index b0731d5f1f..3cb0fed134 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-mac.mm +++ b/core/ui/UIEditBox/UIEditBoxImpl-mac.mm @@ -25,7 +25,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # include "ui/UIEditBox/UIEditBoxImpl-mac.h" # include "base/CCDirector.h" @@ -221,4 +221,4 @@ void EditBoxImplMac::nativeCloseKeyboard() NS_AX_END -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#endif // #if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) diff --git a/core/ui/UIEditBox/UIEditBoxImpl-stub.cpp b/core/ui/UIEditBox/UIEditBoxImpl-stub.cpp index 5272d23752..f1ca12ca5d 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-stub.cpp +++ b/core/ui/UIEditBox/UIEditBoxImpl-stub.cpp @@ -24,8 +24,8 @@ #include "ui/UIEditBox/UIEditBox.h" -#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) && \ - (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) && (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) && \ + (AX_TARGET_PLATFORM != AX_PLATFORM_WIN32) && (AX_TARGET_PLATFORM != AX_PLATFORM_MAC) NS_AX_BEGIN diff --git a/core/ui/UIEditBox/UIEditBoxImpl-win32.cpp b/core/ui/UIEditBox/UIEditBoxImpl-win32.cpp index 8c83cdfa47..ba44c86764 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-win32.cpp +++ b/core/ui/UIEditBox/UIEditBoxImpl-win32.cpp @@ -27,7 +27,7 @@ THE SOFTWARE. #include "ui/UIEditBox/UIEditBoxImpl-win32.h" #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "ui/UIEditBox/UIEditBox.h" # include @@ -438,4 +438,4 @@ LRESULT EditBoxImplWin::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l NS_AX_END -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl-win32.h b/core/ui/UIEditBox/UIEditBoxImpl-win32.h index a7c502b17a..c58e7adb59 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl-win32.h +++ b/core/ui/UIEditBox/UIEditBoxImpl-win32.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "ui/UIEditBox/UIEditBoxImpl-common.h" NS_AX_BEGIN @@ -39,7 +39,7 @@ namespace ui class EditBox; -class CC_GUI_DLL EditBoxImplWin : public EditBoxImplCommon +class AX_GUI_DLL EditBoxImplWin : public EditBoxImplCommon { public: EditBoxImplWin(EditBox* pEditText); @@ -92,6 +92,6 @@ private: NS_AX_END -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) */ #endif /* __UIEditBoxIMPLWIN_H__ */ diff --git a/core/ui/UIEditBox/UIEditBoxImpl.h b/core/ui/UIEditBox/UIEditBoxImpl.h index 1cfd169956..10daff1f82 100644 --- a/core/ui/UIEditBox/UIEditBoxImpl.h +++ b/core/ui/UIEditBox/UIEditBoxImpl.h @@ -34,7 +34,7 @@ NS_AX_BEGIN namespace ui { -class CC_GUI_DLL EditBoxImpl +class AX_GUI_DLL EditBoxImpl { public: /** diff --git a/core/ui/UIEditBox/iOS/CCUIMultilineTextField.mm b/core/ui/UIEditBox/iOS/CCUIMultilineTextField.mm index 3cfb050f60..b08185cf68 100644 --- a/core/ui/UIEditBox/iOS/CCUIMultilineTextField.mm +++ b/core/ui/UIEditBox/iOS/CCUIMultilineTextField.mm @@ -85,7 +85,7 @@ CGFloat const UI_PLACEHOLDER_TEXT_CHANGED_ANIMATION_DURATION = 0.25; if (_placeHolderLabel == nil) { auto glview = axis::Director::getInstance()->getOpenGLView(); - float padding = CC_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); + float padding = AX_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); _placeHolderLabel = [[UILabel alloc] initWithFrame:CGRectMake(padding, padding, self.bounds.size.width - padding * 2, 0)]; @@ -108,7 +108,7 @@ CGFloat const UI_PLACEHOLDER_TEXT_CHANGED_ANIMATION_DURATION = 0.25; { auto glview = axis::Director::getInstance()->getOpenGLView(); - float padding = CC_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); + float padding = AX_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); return CGRectInset(bounds, padding, padding); } diff --git a/core/ui/UIEditBox/iOS/CCUISingleLineTextField.mm b/core/ui/UIEditBox/iOS/CCUISingleLineTextField.mm index 4f59d8e786..aae6d137c4 100644 --- a/core/ui/UIEditBox/iOS/CCUISingleLineTextField.mm +++ b/core/ui/UIEditBox/iOS/CCUISingleLineTextField.mm @@ -78,7 +78,7 @@ { auto glview = axis::Director::getInstance()->getOpenGLView(); - float padding = CC_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); + float padding = AX_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); return CGRectInset(bounds, padding, padding); } diff --git a/core/ui/UIEditBox/iOS/CCUITextInput.h b/core/ui/UIEditBox/iOS/CCUITextInput.h index 9706ad5741..3a493c3cde 100644 --- a/core/ui/UIEditBox/iOS/CCUITextInput.h +++ b/core/ui/UIEditBox/iOS/CCUITextInput.h @@ -26,7 +26,7 @@ #ifndef cocos2d_libs_CCUITextInput_h #define cocos2d_libs_CCUITextInput_h -static const int CC_EDIT_BOX_PADDING = 5; +static const int AX_EDIT_BOX_PADDING = 5; /** This protocol provides a common interface for consolidating text input method calls diff --git a/core/ui/UIHBox.cpp b/core/ui/UIHBox.cpp index f68c375bb3..afbc15c87c 100644 --- a/core/ui/UIHBox.cpp +++ b/core/ui/UIHBox.cpp @@ -42,7 +42,7 @@ HBox* HBox::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -54,7 +54,7 @@ HBox* HBox::create(const Vec2& size) widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIHBox.h b/core/ui/UIHBox.h index 4ee6b1b014..c5fbe7a9e5 100644 --- a/core/ui/UIHBox.h +++ b/core/ui/UIHBox.h @@ -42,7 +42,7 @@ namespace ui * HBox is just a convenient wrapper class for horizontal layout type. * HBox lays out its children in a single horizontal row. */ -class CC_GUI_DLL HBox : public Layout +class AX_GUI_DLL HBox : public Layout { public: /** diff --git a/core/ui/UIHelper.h b/core/ui/UIHelper.h index c90493b93e..2516d2481e 100644 --- a/core/ui/UIHelper.h +++ b/core/ui/UIHelper.h @@ -46,7 +46,7 @@ class Widget; * Helper class for traversing children in widget tree. * It also provides some helper functions for layout. */ -class CC_GUI_DLL Helper +class AX_GUI_DLL Helper { public: /** diff --git a/core/ui/UIImageView.cpp b/core/ui/UIImageView.cpp index fb3cbaad0a..de5c3cc1ca 100644 --- a/core/ui/UIImageView.cpp +++ b/core/ui/UIImageView.cpp @@ -58,7 +58,7 @@ ImageView* ImageView::create(std::string_view imageFileName, TextureResType texT widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -70,7 +70,7 @@ ImageView* ImageView::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIImageView.h b/core/ui/UIImageView.h index cd7049a3b0..61a31f474c 100644 --- a/core/ui/UIImageView.h +++ b/core/ui/UIImageView.h @@ -35,7 +35,7 @@ THE SOFTWARE. */ NS_AX_BEGIN -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -43,7 +43,7 @@ class Scale9Sprite; /** * @brief A widget to display images. */ -class CC_GUI_DLL ImageView : public Widget, public axis::BlendProtocol +class AX_GUI_DLL ImageView : public Widget, public axis::BlendProtocol { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UILayout.cpp b/core/ui/UILayout.cpp index d71c364f39..89b01ae7c1 100644 --- a/core/ui/UILayout.cpp +++ b/core/ui/UILayout.cpp @@ -84,8 +84,8 @@ Layout::Layout() Layout::~Layout() { - CC_SAFE_RELEASE(_clippingStencil); - CC_SAFE_DELETE(_stencilStateManager); + AX_SAFE_RELEASE(_clippingStencil); + AX_SAFE_DELETE(_stencilStateManager); } void Layout::onEnter() @@ -128,7 +128,7 @@ Layout* Layout::create() layout->autorelease(); return layout; } - CC_SAFE_DELETE(layout); + AX_SAFE_DELETE(layout); return nullptr; } @@ -139,7 +139,7 @@ bool Layout::init() ignoreContentAdaptWithSize(false); setContentSize(Vec2::ZERO); setAnchorPoint(Vec2::ZERO); - onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); return true; } return false; @@ -254,7 +254,7 @@ void Layout::stencilClippingVisit(Renderer* renderer, const Mat4& parentTransfor renderer->pushGroup(_groupCommand.getRenderQueueID()); // _beforeVisitCmdStencil.init(_globalZOrder); - // _beforeVisitCmdStencil.func = CC_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilStateManager); + // _beforeVisitCmdStencil.func = AX_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilStateManager); // renderer->addCommand(&_beforeVisitCmdStencil); _stencilStateManager->onBeforeVisit(_globalZOrder); @@ -262,7 +262,7 @@ void Layout::stencilClippingVisit(Renderer* renderer, const Mat4& parentTransfor auto afterDrawStencilCmd = renderer->nextCallbackCommand(); afterDrawStencilCmd->init(_globalZOrder); - afterDrawStencilCmd->func = CC_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilStateManager); + afterDrawStencilCmd->func = AX_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilStateManager); renderer->addCommand(afterDrawStencilCmd); int i = 0; // used by _children @@ -310,7 +310,7 @@ void Layout::stencilClippingVisit(Renderer* renderer, const Mat4& parentTransfor auto afterVisitCmdStencil = renderer->nextCallbackCommand(); afterVisitCmdStencil->init(_globalZOrder); - afterVisitCmdStencil->func = CC_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager); + afterVisitCmdStencil->func = AX_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager); renderer->addCommand(afterVisitCmdStencil); renderer->popGroup(); @@ -375,14 +375,14 @@ void Layout::scissorClippingVisit(Renderer* renderer, const Mat4& parentTransfor auto beforeVisitCmdScissor = renderer->nextCallbackCommand(); beforeVisitCmdScissor->init(_globalZOrder); - beforeVisitCmdScissor->func = CC_CALLBACK_0(Layout::onBeforeVisitScissor, this); + beforeVisitCmdScissor->func = AX_CALLBACK_0(Layout::onBeforeVisitScissor, this); renderer->addCommand(beforeVisitCmdScissor); ProtectedNode::visit(renderer, parentTransform, parentFlags); auto afterVisitCmdScissor = renderer->nextCallbackCommand(); afterVisitCmdScissor->init(_globalZOrder); - afterVisitCmdScissor->func = CC_CALLBACK_0(Layout::onAfterVisitScissor, this); + afterVisitCmdScissor->func = AX_CALLBACK_0(Layout::onAfterVisitScissor, this); renderer->addCommand(afterVisitCmdScissor); renderer->popGroup(); @@ -1312,44 +1312,44 @@ void Layout::findProperSearchingFunctor(FocusDirection dir, Widget* baseWidget) { if (previousWidgetPosition.x > widgetPosition.x) { - onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); } else { - onPassFocusToChild = CC_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); } } else if (dir == FocusDirection::RIGHT) { if (previousWidgetPosition.x > widgetPosition.x) { - onPassFocusToChild = CC_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); } else { - onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); } } else if (dir == FocusDirection::DOWN) { if (previousWidgetPosition.y > widgetPosition.y) { - onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); } else { - onPassFocusToChild = CC_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); } } else if (dir == FocusDirection::UP) { if (previousWidgetPosition.y < widgetPosition.y) { - onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); } else { - onPassFocusToChild = CC_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); + onPassFocusToChild = AX_CALLBACK_2(Layout::findFarthestChildWidgetIndex, this); } } else diff --git a/core/ui/UILayout.h b/core/ui/UILayout.h index 00533ffb52..78d2ddd714 100644 --- a/core/ui/UILayout.h +++ b/core/ui/UILayout.h @@ -43,7 +43,7 @@ class DrawNode; class LayerColor; class LayerGradient; class StencilStateManager; -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -55,7 +55,7 @@ class Scale9Sprite; *@brief Layout interface for creating LayoutManger and do actual layout. * @js NA */ -class CC_GUI_DLL LayoutProtocol +class AX_GUI_DLL LayoutProtocol { public: /** @@ -109,7 +109,7 @@ public: * - Relative layout: child elements are arranged relative to certain rules. * */ -class CC_GUI_DLL Layout : public Widget, public LayoutProtocol +class AX_GUI_DLL Layout : public Widget, public LayoutProtocol { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UILayoutComponent.cpp b/core/ui/UILayoutComponent.cpp index a6755c7578..b47f938623 100644 --- a/core/ui/UILayoutComponent.cpp +++ b/core/ui/UILayoutComponent.cpp @@ -71,7 +71,7 @@ LayoutComponent* LayoutComponent::bindLayoutComponent(Node* node) node->addComponent(layout); return layout; } - CC_SAFE_DELETE(layout); + AX_SAFE_DELETE(layout); return nullptr; } diff --git a/core/ui/UILayoutComponent.h b/core/ui/UILayoutComponent.h index 1300b22926..0bb2651ebf 100644 --- a/core/ui/UILayoutComponent.h +++ b/core/ui/UILayoutComponent.h @@ -41,7 +41,7 @@ namespace ui *@brief A component class used for layout. * The LayoutComponent holds all the data for layouting. */ -class CC_GUI_DLL LayoutComponent : public Component +class AX_GUI_DLL LayoutComponent : public Component { public: /** diff --git a/core/ui/UILayoutManager.h b/core/ui/UILayoutManager.h index f67331781e..7162241b97 100644 --- a/core/ui/UILayoutManager.h +++ b/core/ui/UILayoutManager.h @@ -47,7 +47,7 @@ class RelativeLayoutParameter; *@brief Base class for managing layout. * All the concrete layout manager should inherit from this class. */ -class CC_GUI_DLL LayoutManager : public Ref +class AX_GUI_DLL LayoutManager : public Ref { public: virtual ~LayoutManager(){}; @@ -67,7 +67,7 @@ public: * @lua NA * @js NA */ -class CC_GUI_DLL LinearVerticalLayoutManager : public LayoutManager +class AX_GUI_DLL LinearVerticalLayoutManager : public LayoutManager { private: LinearVerticalLayoutManager(){}; @@ -84,7 +84,7 @@ private: * @lua NA * @js NA */ -class CC_GUI_DLL LinearHorizontalLayoutManager : public LayoutManager +class AX_GUI_DLL LinearHorizontalLayoutManager : public LayoutManager { private: LinearHorizontalLayoutManager(){}; @@ -101,7 +101,7 @@ private: * @lua NA * @js NA */ -class CC_GUI_DLL LinearCenterVerticalLayoutManager : public LayoutManager +class AX_GUI_DLL LinearCenterVerticalLayoutManager : public LayoutManager { private: LinearCenterVerticalLayoutManager(){}; @@ -118,7 +118,7 @@ private: * @lua NA * @js NA */ -class CC_GUI_DLL RelativeLayoutManager : public LayoutManager +class AX_GUI_DLL RelativeLayoutManager : public LayoutManager { private: RelativeLayoutManager() diff --git a/core/ui/UILayoutParameter.h b/core/ui/UILayoutParameter.h index b16ca4c585..f193ab3095 100644 --- a/core/ui/UILayoutParameter.h +++ b/core/ui/UILayoutParameter.h @@ -43,7 +43,7 @@ namespace ui *@brief Margin of widget's in point. Margin value should be positive. *@lua NA */ -class CC_GUI_DLL Margin +class AX_GUI_DLL Margin { public: /** @@ -113,7 +113,7 @@ public: /** *@brief Base class for various LayoutParameter. */ -class CC_GUI_DLL LayoutParameter : public Ref +class AX_GUI_DLL LayoutParameter : public Ref { public: /** @@ -198,7 +198,7 @@ protected: * Protocol for getting a LayoutParameter. * Every element want to have layout parameter should inherit from this class. */ -class CC_GUI_DLL LayoutParameterProtocol +class AX_GUI_DLL LayoutParameterProtocol { public: /** @@ -217,7 +217,7 @@ public: * @brief Linear layout parameter. * It is used by linear layout manager for arranging elements linearly. */ -class CC_GUI_DLL LinearLayoutParameter : public LayoutParameter +class AX_GUI_DLL LinearLayoutParameter : public LayoutParameter { public: /** @@ -283,7 +283,7 @@ protected: * @brief Relative layout parameter. * It is mainly used by `RelativeLayoutManager`. */ -class CC_GUI_DLL RelativeLayoutParameter : public LayoutParameter +class AX_GUI_DLL RelativeLayoutParameter : public LayoutParameter { public: /** diff --git a/core/ui/UIListView.cpp b/core/ui/UIListView.cpp index e8dc2f3ee4..0883a6d8e6 100644 --- a/core/ui/UIListView.cpp +++ b/core/ui/UIListView.cpp @@ -56,7 +56,7 @@ ListView::ListView() ListView::~ListView() { _items.clear(); - CC_SAFE_RELEASE(_model); + AX_SAFE_RELEASE(_model); } ListView* ListView::create() @@ -67,7 +67,7 @@ ListView* ListView::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -88,9 +88,9 @@ void ListView::setItemModel(Widget* model) CCLOG("Can't set a nullptr to item model!"); return; } - CC_SAFE_RELEASE_NULL(_model); + AX_SAFE_RELEASE_NULL(_model); _model = model; - CC_SAFE_RETAIN(_model); + AX_SAFE_RETAIN(_model); } void ListView::handleReleaseLogic(Touch* touch) diff --git a/core/ui/UIListView.h b/core/ui/UIListView.h index f81d887308..cacf2ad644 100644 --- a/core/ui/UIListView.h +++ b/core/ui/UIListView.h @@ -45,7 +45,7 @@ namespace ui *to be displayed, use `TableView` instead. ListView is a subclass of `ScrollView`, so it shares many features of *ScrollView. */ -class CC_GUI_DLL ListView : public ScrollView +class AX_GUI_DLL ListView : public ScrollView { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UILoadingBar.cpp b/core/ui/UILoadingBar.cpp index a0e28e0678..5e8584aaa9 100644 --- a/core/ui/UILoadingBar.cpp +++ b/core/ui/UILoadingBar.cpp @@ -67,7 +67,7 @@ LoadingBar* LoadingBar::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -86,7 +86,7 @@ LoadingBar* LoadingBar::create(std::string_view textureName, TextureResType texT widget->setPercent(percentage); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UILoadingBar.h b/core/ui/UILoadingBar.h index 531454f12f..acfce004d2 100644 --- a/core/ui/UILoadingBar.h +++ b/core/ui/UILoadingBar.h @@ -35,7 +35,7 @@ NS_AX_BEGIN * @{ */ -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -46,7 +46,7 @@ class Scale9Sprite; * Displays a bar to the user representing how far the operation has progressed. * */ -class CC_GUI_DLL LoadingBar : public Widget +class AX_GUI_DLL LoadingBar : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UIPageView.cpp b/core/ui/UIPageView.cpp index 02b2a8355a..4eb6f6161e 100644 --- a/core/ui/UIPageView.cpp +++ b/core/ui/UIPageView.cpp @@ -54,7 +54,7 @@ PageView* PageView::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIPageView.h b/core/ui/UIPageView.h index 627b966ce5..e5947db2c0 100644 --- a/core/ui/UIPageView.h +++ b/core/ui/UIPageView.h @@ -44,7 +44,7 @@ class PageViewIndicator; *@brief Layout manager that allows the user to flip left & right and up & down through pages of data. * */ -class CC_GUI_DLL PageView : public ListView +class AX_GUI_DLL PageView : public ListView { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UIPageViewIndicator.cpp b/core/ui/UIPageViewIndicator.cpp index 5c1a44b98c..a22a3ec572 100644 --- a/core/ui/UIPageViewIndicator.cpp +++ b/core/ui/UIPageViewIndicator.cpp @@ -54,7 +54,7 @@ PageViewIndicator* PageViewIndicator::create() node->autorelease(); return node; } - CC_SAFE_DELETE(node); + AX_SAFE_DELETE(node); return nullptr; } diff --git a/core/ui/UIRadioButton.cpp b/core/ui/UIRadioButton.cpp index e1c620c7c4..bed44e8862 100644 --- a/core/ui/UIRadioButton.cpp +++ b/core/ui/UIRadioButton.cpp @@ -48,7 +48,7 @@ RadioButton* RadioButton::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -65,7 +65,7 @@ RadioButton* RadioButton::create(std::string_view backGround, pWidget->autorelease(); return pWidget; } - CC_SAFE_DELETE(pWidget); + AX_SAFE_DELETE(pWidget); return nullptr; } @@ -77,7 +77,7 @@ RadioButton* RadioButton::create(std::string_view backGround, std::string_view c pWidget->autorelease(); return pWidget; } - CC_SAFE_DELETE(pWidget); + AX_SAFE_DELETE(pWidget); return nullptr; } @@ -158,7 +158,7 @@ RadioButtonGroup* RadioButtonGroup::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -185,7 +185,7 @@ void RadioButtonGroup::addRadioButton(RadioButton* radioButton) void RadioButtonGroup::removeRadioButton(RadioButton* radioButton) { ssize_t index = _radioButtons.getIndex(radioButton); - if (index == CC_INVALID_INDEX) + if (index == AX_INVALID_INDEX) { CCLOGERROR("The radio button does not belong to this group!"); return; diff --git a/core/ui/UIRadioButton.h b/core/ui/UIRadioButton.h index af832a3622..58a00a9012 100644 --- a/core/ui/UIRadioButton.h +++ b/core/ui/UIRadioButton.h @@ -44,7 +44,7 @@ class RadioButtonGroup; * RadioButton is a specific type of two-states button that is similar to CheckBox. * Additionally, it can be used together with RadioButtonGroup to interact with other radio buttons. */ -class CC_GUI_DLL RadioButton : public AbstractCheckButton +class AX_GUI_DLL RadioButton : public AbstractCheckButton { DECLARE_CLASS_GUI_INFO @@ -141,7 +141,7 @@ protected: * RadioButtonGroup groups designated radio buttons to make them interact to each other. * In one RadioButtonGroup, only one or no RadioButton can be checked. */ -class CC_GUI_DLL RadioButtonGroup : public Widget +class AX_GUI_DLL RadioButtonGroup : public Widget { friend class RadioButton; diff --git a/core/ui/UIRelativeBox.cpp b/core/ui/UIRelativeBox.cpp index f99df58f3e..e5be927d6f 100644 --- a/core/ui/UIRelativeBox.cpp +++ b/core/ui/UIRelativeBox.cpp @@ -42,7 +42,7 @@ RelativeBox* RelativeBox::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -54,7 +54,7 @@ RelativeBox* RelativeBox::create(const Vec2& size) widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIRelativeBox.h b/core/ui/UIRelativeBox.h index 1fef1d4a05..1989cd5bbf 100644 --- a/core/ui/UIRelativeBox.h +++ b/core/ui/UIRelativeBox.h @@ -43,7 +43,7 @@ namespace ui *@brief RelativeBox is just a convenient wrapper class for relative layout type. * RelativeBox lays out its children relative to a widget or a position. */ -class CC_GUI_DLL RelativeBox : public Layout +class AX_GUI_DLL RelativeBox : public Layout { public: diff --git a/core/ui/UIRichText.cpp b/core/ui/UIRichText.cpp index ad03db9bc0..dd877f9fb5 100644 --- a/core/ui/UIRichText.cpp +++ b/core/ui/UIRichText.cpp @@ -66,7 +66,7 @@ public: setName(ListenerComponent::COMPONENT_NAME); _touchListener = axis::EventListenerTouchAllAtOnce::create(); - _touchListener->onTouchesEnded = CC_CALLBACK_2(ListenerComponent::onTouchesEnded, this); + _touchListener->onTouchesEnded = AX_CALLBACK_2(ListenerComponent::onTouchesEnded, this); Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(_touchListener, _parent); _touchListener->retain(); @@ -144,7 +144,7 @@ RichElementText* RichElementText::create(int tag, element->autorelease(); return element; } - CC_SAFE_DELETE(element); + AX_SAFE_DELETE(element); return nullptr; } @@ -194,7 +194,7 @@ RichElementImage* RichElementImage::create(int tag, element->autorelease(); return element; } - CC_SAFE_DELETE(element); + AX_SAFE_DELETE(element); return nullptr; } @@ -243,7 +243,7 @@ RichElementCustomNode* RichElementCustomNode::create(int tag, element->autorelease(); return element; } - CC_SAFE_DELETE(element); + AX_SAFE_DELETE(element); return nullptr; } @@ -266,7 +266,7 @@ RichElementNewLine* RichElementNewLine::create(int tag, const Color3B& color, ui element->autorelease(); return element; } - CC_SAFE_DELETE(element); + AX_SAFE_DELETE(element); return nullptr; } @@ -1006,7 +1006,7 @@ RichText* RichText::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -1018,7 +1018,7 @@ RichText* RichText::createWithXML(std::string_view xml, const ValueMap& defaults widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIRichText.h b/core/ui/UIRichText.h index eec6903ccd..f001f888ed 100644 --- a/core/ui/UIRichText.h +++ b/core/ui/UIRichText.h @@ -45,7 +45,7 @@ namespace ui *@brief Rich text element base class. * It defines the basic common properties for all rich text element. */ -class CC_GUI_DLL RichElement : public Ref +class AX_GUI_DLL RichElement : public Ref { public: /** @@ -97,7 +97,7 @@ protected: /** *@brief Rich element for displaying text. */ -class CC_GUI_DLL RichElementText : public RichElement +class AX_GUI_DLL RichElementText : public RichElement { public: /** @@ -212,7 +212,7 @@ protected: /** *@brief Rich element for displaying images. */ -class CC_GUI_DLL RichElementImage : public RichElement +class AX_GUI_DLL RichElementImage : public RichElement { public: /** @@ -283,7 +283,7 @@ protected: /** *@brief Rich element for displaying custom node type. */ -class CC_GUI_DLL RichElementCustomNode : public RichElement +class AX_GUI_DLL RichElementCustomNode : public RichElement { public: /** @@ -298,7 +298,7 @@ public: * @js NA * @lua NA */ - virtual ~RichElementCustomNode() { CC_SAFE_RELEASE(_customNode); }; + virtual ~RichElementCustomNode() { AX_SAFE_RELEASE(_customNode); }; /** * @brief Initialize a RichElementCustomNode with various arguments. @@ -330,7 +330,7 @@ protected: /** *@brief Rich element for new line. */ -class CC_GUI_DLL RichElementNewLine : public RichElement +class AX_GUI_DLL RichElementNewLine : public RichElement { public: /** @@ -366,7 +366,7 @@ protected: *@brief A container for displaying various RichElements. * We could use it to display texts with images easily. */ -class CC_GUI_DLL RichText : public Widget +class AX_GUI_DLL RichText : public Widget { public: enum WrapMode diff --git a/core/ui/UIScale9Sprite.cpp b/core/ui/UIScale9Sprite.cpp index 296e19e36b..65945bba47 100644 --- a/core/ui/UIScale9Sprite.cpp +++ b/core/ui/UIScale9Sprite.cpp @@ -49,7 +49,7 @@ Scale9Sprite* Scale9Sprite::create() ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -61,7 +61,7 @@ Scale9Sprite* Scale9Sprite::create(std::string_view filename, const Rect& rect, ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -78,7 +78,7 @@ Scale9Sprite* Scale9Sprite::create(const Rect& capInsets, std::string_view file) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -95,7 +95,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame, cons ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -112,7 +112,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(std::string_view spriteFra ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -124,7 +124,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(std::string_view spriteFra ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); log("Could not allocate Scale9Sprite()"); return nullptr; @@ -272,8 +272,8 @@ bool Scale9Sprite::updateWithSprite(Sprite* sprite, const Rect& capInsets) { SpriteFrame* spriteframe = - SpriteFrame::createWithTexture(sprite->getTexture(), CC_RECT_POINTS_TO_PIXELS(textureRect), rotated, - CC_POINT_POINTS_TO_PIXELS(offset), CC_SIZE_POINTS_TO_PIXELS(originalSize)); + SpriteFrame::createWithTexture(sprite->getTexture(), AX_RECT_POINTS_TO_PIXELS(textureRect), rotated, + AX_POINT_POINTS_TO_PIXELS(offset), AX_SIZE_POINTS_TO_PIXELS(originalSize)); setSpriteFrame(spriteframe); setCapInsets(capInsets); return true; @@ -288,7 +288,7 @@ Scale9Sprite* Scale9Sprite::resizableSpriteWithCapInsets(const Rect& capInsets) ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } diff --git a/core/ui/UIScale9Sprite.h b/core/ui/UIScale9Sprite.h index b1d859482d..521769c56a 100644 --- a/core/ui/UIScale9Sprite.h +++ b/core/ui/UIScale9Sprite.h @@ -57,7 +57,7 @@ namespace ui * Then you could call any methods of Sprite class with the return pointers. * */ -class CC_GUI_DLL Scale9Sprite : public Sprite +class AX_GUI_DLL Scale9Sprite : public Sprite { public: /** diff --git a/core/ui/UIScrollView.cpp b/core/ui/UIScrollView.cpp index e431d55bd2..1bb782673e 100644 --- a/core/ui/UIScrollView.cpp +++ b/core/ui/UIScrollView.cpp @@ -98,7 +98,7 @@ ScrollView* ScrollView::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIScrollView.h b/core/ui/UIScrollView.h index a102e22271..1e8ab6ead7 100644 --- a/core/ui/UIScrollView.h +++ b/core/ui/UIScrollView.h @@ -47,7 +47,7 @@ class ScrollViewBar; * Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical * display. It holds a inner `Layout` container for storing child items horizontally or vertically. */ -class CC_GUI_DLL ScrollView : public Layout +class AX_GUI_DLL ScrollView : public Layout { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UIScrollViewBar.cpp b/core/ui/UIScrollViewBar.cpp index 653e4b6285..f4d3ea9292 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; } - CC_SAFE_DELETE(node); + AX_SAFE_DELETE(node); return nullptr; } diff --git a/core/ui/UIScrollViewBar.h b/core/ui/UIScrollViewBar.h index 37e3fc4839..32c4081d46 100644 --- a/core/ui/UIScrollViewBar.h +++ b/core/ui/UIScrollViewBar.h @@ -42,7 +42,7 @@ namespace ui /** * Scroll bar being attached to ScrollView layout container. */ -class CC_GUI_DLL ScrollViewBar : public ProtectedNode +class AX_GUI_DLL ScrollViewBar : public ProtectedNode { public: diff --git a/core/ui/UISlider.cpp b/core/ui/UISlider.cpp index 3e443bdd06..4f669c987f 100644 --- a/core/ui/UISlider.cpp +++ b/core/ui/UISlider.cpp @@ -99,7 +99,7 @@ Slider* Slider::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -113,7 +113,7 @@ Slider* Slider::create(std::string_view barTextureName, std::string_view normalB widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UISlider.h b/core/ui/UISlider.h index 982a00bdc9..ae2164f671 100644 --- a/core/ui/UISlider.h +++ b/core/ui/UISlider.h @@ -37,7 +37,7 @@ NS_AX_BEGIN */ class Sprite; -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -54,7 +54,7 @@ typedef void (Ref::*SEL_SlidPercentChangedEvent)(Ref*, SliderEventType); /** * @brief UI Slider widget. */ -class CC_GUI_DLL Slider : public Widget +class AX_GUI_DLL Slider : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITabControl.cpp b/core/ui/UITabControl.cpp index 58adb94143..818d3db686 100644 --- a/core/ui/UITabControl.cpp +++ b/core/ui/UITabControl.cpp @@ -53,7 +53,7 @@ TabControl::~TabControl() for (auto& item : _tabItems) { if (item) - CC_SAFE_DELETE(item); + AX_SAFE_DELETE(item); } _tabItems.clear(); } @@ -73,7 +73,7 @@ void TabControl::insertTab(int index, TabHeader* header, Layout* container) _tabItems.insert(_tabItems.begin() + index, new TabItem(header, container)); header->_tabView = this; header->_tabSelectedEvent = - CC_CALLBACK_2(TabControl::dispatchSelectedTabChanged, this); // binding tab selected event + AX_CALLBACK_2(TabControl::dispatchSelectedTabChanged, this); // binding tab selected event initAfterInsert(index); } @@ -134,7 +134,7 @@ void TabControl::removeTab(int index) auto header = tabItem->header; auto container = tabItem->container; if (tabItem) - CC_SAFE_DELETE(tabItem); + AX_SAFE_DELETE(tabItem); _tabItems.erase(_tabItems.begin() + index); if (header != nullptr) @@ -366,7 +366,7 @@ TabControl* TabControl::create() tabview->autorelease(); return tabview; } - CC_SAFE_DELETE(tabview); + AX_SAFE_DELETE(tabview); return nullptr; } @@ -483,7 +483,7 @@ TabHeader* TabHeader::create() tabcell->autorelease(); return tabcell; } - CC_SAFE_DELETE(tabcell); + AX_SAFE_DELETE(tabcell); return nullptr; } @@ -501,7 +501,7 @@ TabHeader* TabHeader::create(std::string_view titleStr, tabcell->autorelease(); return tabcell; } - CC_SAFE_DELETE(tabcell); + AX_SAFE_DELETE(tabcell); return nullptr; } @@ -522,7 +522,7 @@ TabHeader* TabHeader::create(std::string_view titleStr, tabcell->autorelease(); return tabcell; } - CC_SAFE_DELETE(tabcell); + AX_SAFE_DELETE(tabcell); return nullptr; } diff --git a/core/ui/UITabControl.h b/core/ui/UITabControl.h index 9d03bab184..9bab96b028 100644 --- a/core/ui/UITabControl.h +++ b/core/ui/UITabControl.h @@ -45,7 +45,7 @@ class TabControl; /** * the header button in TabControl */ -class CC_GUI_DLL TabHeader : public AbstractCheckButton +class AX_GUI_DLL TabHeader : public AbstractCheckButton { friend class TabControl; @@ -188,7 +188,7 @@ private: /** * TabControl, use header button switch container */ -class CC_GUI_DLL TabControl : public Widget +class AX_GUI_DLL TabControl : public Widget { public: enum class Dock diff --git a/core/ui/UIText.cpp b/core/ui/UIText.cpp index 9b934b647c..a4f04ea627 100644 --- a/core/ui/UIText.cpp +++ b/core/ui/UIText.cpp @@ -58,7 +58,7 @@ Text* Text::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -79,7 +79,7 @@ Text* Text::create(std::string_view textContent, std::string_view fontName, floa text->autorelease(); return text; } - CC_SAFE_DELETE(text); + AX_SAFE_DELETE(text); return nullptr; } diff --git a/core/ui/UIText.h b/core/ui/UIText.h index 0273813a10..0388d18c20 100644 --- a/core/ui/UIText.h +++ b/core/ui/UIText.h @@ -46,7 +46,7 @@ namespace ui /** * For creating a system font or a TTF font Text */ -class CC_GUI_DLL Text : public Widget, public axis::BlendProtocol +class AX_GUI_DLL Text : public Widget, public axis::BlendProtocol { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITextAtlas.cpp b/core/ui/UITextAtlas.cpp index b2bc2fe05b..0bdf7bf3df 100644 --- a/core/ui/UITextAtlas.cpp +++ b/core/ui/UITextAtlas.cpp @@ -55,7 +55,7 @@ TextAtlas* TextAtlas::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -79,7 +79,7 @@ TextAtlas* TextAtlas::create(std::string_view stringValue, widget->setProperty(stringValue, charMapFile, itemWidth, itemHeight, startCharMap); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UITextAtlas.h b/core/ui/UITextAtlas.h index 4c8e21473d..89aaca1529 100644 --- a/core/ui/UITextAtlas.h +++ b/core/ui/UITextAtlas.h @@ -37,7 +37,7 @@ NS_AX_BEGIN */ class Label; -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -45,7 +45,7 @@ namespace ui /** * @brief UI TextAtlas widget. */ -class CC_GUI_DLL TextAtlas : public Widget +class AX_GUI_DLL TextAtlas : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITextBMFont.cpp b/core/ui/UITextBMFont.cpp index e4c2f2b271..b23eb56724 100644 --- a/core/ui/UITextBMFont.cpp +++ b/core/ui/UITextBMFont.cpp @@ -49,7 +49,7 @@ TextBMFont* TextBMFont::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -63,7 +63,7 @@ TextBMFont* TextBMFont::create(std::string_view text, std::string_view filename) widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UITextBMFont.h b/core/ui/UITextBMFont.h index eb171b4484..f9dfeb0832 100644 --- a/core/ui/UITextBMFont.h +++ b/core/ui/UITextBMFont.h @@ -36,7 +36,7 @@ THE SOFTWARE. NS_AX_BEGIN class Label; -struct CC_DLL ResourceData; +struct AX_DLL ResourceData; namespace ui { @@ -44,7 +44,7 @@ namespace ui /** * A widget for displaying BMFont label. */ -class CC_GUI_DLL TextBMFont : public Widget +class AX_GUI_DLL TextBMFont : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITextField.cpp b/core/ui/UITextField.cpp index 61a879f073..2f7b56edf5 100644 --- a/core/ui/UITextField.cpp +++ b/core/ui/UITextField.cpp @@ -65,7 +65,7 @@ UICCTextField* UICCTextField::create(std::string_view placeholder, std::string_v } return pRet; } - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); return nullptr; } @@ -288,7 +288,7 @@ TextField* TextField::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -303,7 +303,7 @@ TextField* TextField::create(std::string_view placeholder, std::string_view font widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UITextField.h b/core/ui/UITextField.h index 61a17db0d3..32d5f1363b 100644 --- a/core/ui/UITextField.h +++ b/core/ui/UITextField.h @@ -45,7 +45,7 @@ namespace ui * @js NA * @lua NA */ -class CC_GUI_DLL UICCTextField : public TextFieldTTF, public TextFieldDelegate +class AX_GUI_DLL UICCTextField : public TextFieldTTF, public TextFieldDelegate { public: /** @@ -223,7 +223,7 @@ protected: * @js NA * @lua NA */ -class CC_GUI_DLL TextField : public Widget +class AX_GUI_DLL TextField : public Widget { DECLARE_CLASS_GUI_INFO diff --git a/core/ui/UITextFieldEx.cpp b/core/ui/UITextFieldEx.cpp index 4a18a51b41..e9f3cd381f 100644 --- a/core/ui/UITextFieldEx.cpp +++ b/core/ui/UITextFieldEx.cpp @@ -44,7 +44,7 @@ static Label* createLabel(std::string_view text, static bool engine_inj_checkVisibility(Node* theNode) { - // CC_ASSERT(theNode != NULL); + // AX_ASSERT(theNode != NULL); bool visible = false; for (Node* ptr = theNode; (ptr != nullptr && (visible = ptr->isVisible())); ptr = ptr->getParent()) ; @@ -126,7 +126,7 @@ static int _calcCharCount(const char* text) char ch = 0; while ((ch = *text) != 0x0) { - CC_BREAK_IF(!ch); + AX_BREAK_IF(!ch); if (0x80 != (0xC0 & ch)) { @@ -145,7 +145,7 @@ static int _truncateUTF8String(const char* text, int limit, int& nb) nb = 0; while ((ch = *text) != 0x0) { - CC_BREAK_IF(!ch || n > limit); + AX_BREAK_IF(!ch || n > limit); if (0x80 != (0xC0 & ch)) { @@ -281,7 +281,7 @@ TextFieldEx* TextFieldEx::create(std::string_view placeholder, } return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } diff --git a/core/ui/UITextFieldEx.h b/core/ui/UITextFieldEx.h index d683e81a4e..ff563351d9 100644 --- a/core/ui/UITextFieldEx.h +++ b/core/ui/UITextFieldEx.h @@ -16,7 +16,7 @@ namespace ui /** @brief A extension implementation of ui::TextField */ -class CC_DLL TextFieldEx : public axis::Node, public IMEDelegate +class AX_DLL TextFieldEx : public axis::Node, public IMEDelegate { public: /** @@ -100,7 +100,7 @@ public: void setTextFontName(std::string_view fontName); std::string_view getTextFontName() const; - CC_SYNTHESIZE(size_t, charLimit, CharLimit); + AX_SYNTHESIZE(size_t, charLimit, CharLimit); bool isSystemFont(void) const { return systemFontUsed; } diff --git a/core/ui/UIVBox.cpp b/core/ui/UIVBox.cpp index 93e5ff064b..2f7bdfe4d3 100644 --- a/core/ui/UIVBox.cpp +++ b/core/ui/UIVBox.cpp @@ -42,7 +42,7 @@ VBox* VBox::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -54,7 +54,7 @@ VBox* VBox::create(const Vec2& size) widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } diff --git a/core/ui/UIVBox.h b/core/ui/UIVBox.h index cb5e6065b7..40f0b1f140 100644 --- a/core/ui/UIVBox.h +++ b/core/ui/UIVBox.h @@ -42,7 +42,7 @@ namespace ui * VBox is just a convenient wrapper class for vertical layout type. * VBox lays out its children in a single vertical column. */ -class CC_GUI_DLL VBox : public Layout +class AX_GUI_DLL VBox : public Layout { public: /** diff --git a/core/ui/UIVideoPlayer/UIVideoPlayer-android.cpp b/core/ui/UIVideoPlayer/UIVideoPlayer-android.cpp index 3370643f07..7b2d3f9e04 100644 --- a/core/ui/UIVideoPlayer/UIVideoPlayer-android.cpp +++ b/core/ui/UIVideoPlayer/UIVideoPlayer-android.cpp @@ -26,7 +26,7 @@ #include "ui/UIVideoPlayer/UIVideoPlayer.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include # include # include @@ -113,7 +113,7 @@ VideoPlayer::VideoPlayer() _videoPlayerIndex = createVideoWidgetJNI(); s_allVideoPlayers[_videoPlayerIndex] = this; -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW _debugDrawNode = DrawNode::create(); addChild(_debugDrawNode); # endif @@ -169,7 +169,7 @@ void VideoPlayer::draw(Renderer* renderer, const Mat4& transform, uint32_t flags (int)uiRect.origin.y, (int)uiRect.size.width, (int)uiRect.size.height); } -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW _debugDrawNode->clear(); auto size = getContentSize(); Point vertices[4] = {Point::ZERO, Point(size.width, 0), Point(size.width, size.height), Point(0, size.height)}; diff --git a/core/ui/UIVideoPlayer/UIVideoPlayer-ios.mm b/core/ui/UIVideoPlayer/UIVideoPlayer-ios.mm index 38aa9d8729..34410204c0 100644 --- a/core/ui/UIVideoPlayer/UIVideoPlayer-ios.mm +++ b/core/ui/UIVideoPlayer/UIVideoPlayer-ios.mm @@ -27,7 +27,7 @@ #include "ui/UIVideoPlayer/UIVideoPlayer.h" // No Available on tvOS -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS && !defined(CC_TARGET_OS_TVOS) +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS && !defined(AX_TARGET_OS_TVOS) using namespace axis::ui; //------------------------------------------------------------------------------------- @@ -283,7 +283,7 @@ VideoPlayer::VideoPlayer() { _videoContext = [[UIVideoViewWrapperIos alloc] init:this]; -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW _debugDrawNode = DrawNode::create(); addChild(_debugDrawNode); # endif @@ -366,7 +366,7 @@ void VideoPlayer::draw(Renderer* renderer, const Mat4& transform, uint32_t flags scaleFactor)]; } -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW _debugDrawNode->clear(); auto size = getContentSize(); Point vertices[4] = {Point::ZERO, Point(size.width, 0), Point(size.width, size.height), Point(0, size.height)}; diff --git a/core/ui/UIVideoPlayer/UIVideoPlayer-win.cpp b/core/ui/UIVideoPlayer/UIVideoPlayer-win.cpp index 9682a84957..1d666a0bbf 100644 --- a/core/ui/UIVideoPlayer/UIVideoPlayer-win.cpp +++ b/core/ui/UIVideoPlayer/UIVideoPlayer-win.cpp @@ -26,7 +26,7 @@ #include "ui/UIVideoPlayer/UIVideoPlayer.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include # include # include @@ -273,7 +273,7 @@ VideoPlayer::VideoPlayer() { auto pvd = new PrivateVideoDescriptor{}; _videoContext = pvd; -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW _debugDrawNode = DrawNode::create(); addChild(_debugDrawNode); # endif @@ -501,7 +501,7 @@ void VideoPlayer::draw(Renderer* renderer, const Mat4& transform, uint32_t flags if (pvd->_scaleDirty || (flags & FLAGS_TRANSFORM_DIRTY)) pvd->rescaleTo(this); -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW _debugDrawNode->clear(); auto size = getContentSize(); Point vertices[4] = {Point::ZERO, Point(size.width, 0), Point(size.width, size.height), Point(0, size.height)}; diff --git a/core/ui/UIVideoPlayer/UIVideoPlayer.h b/core/ui/UIVideoPlayer/UIVideoPlayer.h index 68a65ef578..a025a5fd8f 100644 --- a/core/ui/UIVideoPlayer/UIVideoPlayer.h +++ b/core/ui/UIVideoPlayer/UIVideoPlayer.h @@ -25,13 +25,13 @@ ****************************************************************************/ #pragma once -#if defined(_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) && \ - !defined(CC_PLATFORM_OS_TVOS) +#if defined(_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_TIZEN) && \ + !defined(AX_PLATFORM_OS_TVOS) # include "ui/UIWidget.h" -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW # include "2d/CCDrawNode.h" # endif @@ -247,7 +247,7 @@ protected: virtual axis::ui::Widget* createCloneInstance() override; virtual void copySpecialProperties(Widget* model) override; -# if CC_VIDEOPLAYER_DEBUG_DRAW +# if AX_VIDEOPLAYER_DEBUG_DRAW DrawNode* _debugDrawNode; # endif diff --git a/core/ui/UIWebView/UIWebView-inl.h b/core/ui/UIWebView/UIWebView-inl.h index 26a2fd73f1..4341e238c3 100644 --- a/core/ui/UIWebView/UIWebView-inl.h +++ b/core/ui/UIWebView/UIWebView-inl.h @@ -38,7 +38,7 @@ WebView::WebView() : _impl(new WebViewImpl(this)) {} WebView::~WebView() { - CC_SAFE_DELETE(_impl); + AX_SAFE_DELETE(_impl); } WebView* WebView::create() @@ -49,7 +49,7 @@ WebView* WebView::create() webView->autorelease(); return webView; } - CC_SAFE_DELETE(webView); + AX_SAFE_DELETE(webView); return nullptr; } diff --git a/core/ui/UIWebView/UIWebView.cpp b/core/ui/UIWebView/UIWebView.cpp index 7e1ba2e758..ac480535c4 100644 --- a/core/ui/UIWebView/UIWebView.cpp +++ b/core/ui/UIWebView/UIWebView.cpp @@ -24,12 +24,12 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "ui/UIWebView/UIWebViewImpl-android.h" # include "ui/UIWebView/UIWebView-inl.h" -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "ui/UIWebView/UIWebViewImpl-win32.h" # include "ui/UIWebView/UIWebView-inl.h" diff --git a/core/ui/UIWebView/UIWebView.h b/core/ui/UIWebView/UIWebView.h index 34f71dab84..80a55f2acc 100644 --- a/core/ui/UIWebView/UIWebView.h +++ b/core/ui/UIWebView/UIWebView.h @@ -29,7 +29,7 @@ #include "ui/GUIExport.h" #include "base/CCData.h" -#if defined(_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if defined(_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) /** * @addtogroup ui * @{ @@ -48,7 +48,7 @@ class WebViewImpl; * It's mean WebView displays web pages above all graphical elements of cocos2d-x. * @js NA */ -class CC_GUI_DLL WebView : public axis::ui::Widget +class AX_GUI_DLL WebView : public axis::ui::Widget { public: /** diff --git a/core/ui/UIWebView/UIWebViewImpl-win32.cpp b/core/ui/UIWebView/UIWebViewImpl-win32.cpp index dc4d6940f8..4b9cad508f 100644 --- a/core/ui/UIWebView/UIWebViewImpl-win32.cpp +++ b/core/ui/UIWebView/UIWebViewImpl-win32.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2) +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2) # include "UIWebViewImpl-win32.h" # include "UIWebView.h" @@ -1082,4 +1082,4 @@ void Win32WebControl::setBackgroundTransparent() } } -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 diff --git a/core/ui/UIWebView/UIWebViewImpl-win32.h b/core/ui/UIWebView/UIWebViewImpl-win32.h index 23c5d59b64..10e03d240d 100644 --- a/core/ui/UIWebView/UIWebViewImpl-win32.h +++ b/core/ui/UIWebView/UIWebViewImpl-win32.h @@ -28,7 +28,7 @@ #include "platform/CCPlatformMacros.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2) +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 && defined(AXIS_HAVE_WEBVIEW2) # include # include "CCStdC.h" @@ -92,6 +92,6 @@ private: } // namespace ui NS_AX_END // namespace axis -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 #endif // __COCOS2D__UI__WEBVIEWIMPL_WIN32_H_ diff --git a/core/ui/UIWidget.cpp b/core/ui/UIWidget.cpp index fdce7d7d46..0b5a7f1a6f 100644 --- a/core/ui/UIWidget.cpp +++ b/core/ui/UIWidget.cpp @@ -129,7 +129,7 @@ void Widget::FocusNavigationController::addKeyboardEventListener() if (nullptr == _keyboardListener) { _keyboardListener = EventListenerKeyboard::create(); - _keyboardListener->onKeyReleased = CC_CALLBACK_2(Widget::FocusNavigationController::onKeypadKeyPressed, this); + _keyboardListener->onKeyReleased = AX_CALLBACK_2(Widget::FocusNavigationController::onKeypadKeyPressed, this); EventDispatcher* dispatcher = Director::getInstance()->getEventDispatcher(); dispatcher->addEventListenerWithFixedPriority(_keyboardListener, _keyboardEventPriority); } @@ -186,13 +186,13 @@ void Widget::cleanupWidget() { // clean up _touchListener _eventDispatcher->removeEventListener(_touchListener); - CC_SAFE_RELEASE_NULL(_touchListener); + AX_SAFE_RELEASE_NULL(_touchListener); // cleanup focused widget and focus navigation controller if (_focusedWidget == this) { // delete - CC_SAFE_DELETE(_focusNavigationController); + AX_SAFE_DELETE(_focusNavigationController); _focusedWidget = nullptr; } } @@ -205,7 +205,7 @@ Widget* Widget::create() widget->autorelease(); return widget; } - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return nullptr; } @@ -215,7 +215,7 @@ bool Widget::init() { initRenderer(); setBright(true); - onFocusChanged = CC_CALLBACK_2(Widget::onFocusChange, this); + onFocusChanged = AX_CALLBACK_2(Widget::onFocusChange, this); onNextFocusedWidget = nullptr; this->setAnchorPoint(Vec2(0.5f, 0.5f)); @@ -560,18 +560,18 @@ void Widget::setTouchEnabled(bool enable) if (_touchEnabled) { _touchListener = EventListenerTouchOneByOne::create(); - CC_SAFE_RETAIN(_touchListener); + AX_SAFE_RETAIN(_touchListener); _touchListener->setSwallowTouches(true); - _touchListener->onTouchBegan = CC_CALLBACK_2(Widget::onTouchBegan, this); - _touchListener->onTouchMoved = CC_CALLBACK_2(Widget::onTouchMoved, this); - _touchListener->onTouchEnded = CC_CALLBACK_2(Widget::onTouchEnded, this); - _touchListener->onTouchCancelled = CC_CALLBACK_2(Widget::onTouchCancelled, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(Widget::onTouchBegan, this); + _touchListener->onTouchMoved = AX_CALLBACK_2(Widget::onTouchMoved, this); + _touchListener->onTouchEnded = AX_CALLBACK_2(Widget::onTouchEnded, this); + _touchListener->onTouchCancelled = AX_CALLBACK_2(Widget::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(_touchListener, this); } else { _eventDispatcher->removeEventListener(_touchListener); - CC_SAFE_RELEASE_NULL(_touchListener); + AX_SAFE_RELEASE_NULL(_touchListener); } } @@ -1415,7 +1415,7 @@ void Widget::enableDpadNavigation(bool enable) } else { - CC_SAFE_DELETE(_focusNavigationController); + AX_SAFE_DELETE(_focusNavigationController); } if (nullptr != _focusNavigationController) diff --git a/core/ui/UIWidget.h b/core/ui/UIWidget.h index bd9f461a59..bf4b46f9c0 100644 --- a/core/ui/UIWidget.h +++ b/core/ui/UIWidget.h @@ -52,7 +52,7 @@ class LayoutComponent; * This class inherent from `ProtectedNode` and `LayoutParameterProtocol`. * If you want to implements your own ui widget, you should subclass it. */ -class CC_GUI_DLL Widget : public ProtectedNode, public LayoutParameterProtocol +class AX_GUI_DLL Widget : public ProtectedNode, public LayoutParameterProtocol { public: /** diff --git a/extensions/DragonBones/CCArmatureDisplay.cpp b/extensions/DragonBones/CCArmatureDisplay.cpp index f545ce78a7..0596bd2345 100644 --- a/extensions/DragonBones/CCArmatureDisplay.cpp +++ b/extensions/DragonBones/CCArmatureDisplay.cpp @@ -12,7 +12,7 @@ CCArmatureDisplay* CCArmatureDisplay::create() } else { - CC_SAFE_DELETE(displayContainer); + AX_SAFE_DELETE(displayContainer); } return displayContainer; @@ -28,7 +28,7 @@ void CCArmatureDisplay::dbClear() setEventDispatcher(axis::Director::getInstance()->getEventDispatcher()); _armature = nullptr; - CC_SAFE_RELEASE(_dispatcher); + AX_SAFE_RELEASE(_dispatcher); release(); } @@ -124,7 +124,7 @@ DBCCSprite* DBCCSprite::create() } else { - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); } return sprite; @@ -168,7 +168,7 @@ bool DBCCSprite::_checkVisibility(const axis::Mat4& transform, const axis::Size& void DBCCSprite::draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) { -#if CC_USE_CULLING +#if AX_USE_CULLING # if COCOS2D_VERSION >= 0x00031400 const auto& rect = _polyInfo.getRect(); # else @@ -200,7 +200,7 @@ void DBCCSprite::draw(axis::Renderer* renderer, const axis::Mat4& transform, uin #endif renderer->addCommand(&_trianglesCommand); -#if CC_SPRITE_DEBUG_DRAW +#if AX_SPRITE_DEBUG_DRAW _debugDrawNode->clear(); auto count = _polyInfo.triangles.indexCount / 3; auto indices = _polyInfo.triangles.indices; @@ -220,7 +220,7 @@ void DBCCSprite::draw(axis::Renderer* renderer, const axis::Mat4& transform, uin to = verts[indices[i * 3]].vertices; _debugDrawNode->drawLine(axis::Vec2(from.x, from.y), axis::Vec2(to.x, to.y), axis::Color4F::WHITE); } -#endif // CC_SPRITE_DEBUG_DRAW +#endif // AX_SPRITE_DEBUG_DRAW } } diff --git a/extensions/DragonBones/CCArmatureDisplay.h b/extensions/DragonBones/CCArmatureDisplay.h index a06db8dd18..9ebc450292 100644 --- a/extensions/DragonBones/CCArmatureDisplay.h +++ b/extensions/DragonBones/CCArmatureDisplay.h @@ -20,8 +20,8 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H -#define DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H +#ifndef DRAGONBONES_AX_ARMATURE_DISPLAY_CONTAINER_H +#define DRAGONBONES_AX_ARMATURE_DISPLAY_CONTAINER_H #include "DragonBones/DragonBonesHeaders.h" #include "cocos2d.h" @@ -140,4 +140,4 @@ public: }; DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H +#endif // DRAGONBONES_AX_ARMATURE_DISPLAY_CONTAINER_H diff --git a/extensions/DragonBones/CCDragonBonesHeaders.h b/extensions/DragonBones/CCDragonBonesHeaders.h index 2bab803b9c..6afbe16ba6 100644 --- a/extensions/DragonBones/CCDragonBonesHeaders.h +++ b/extensions/DragonBones/CCDragonBonesHeaders.h @@ -20,12 +20,12 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef DRAGONBONES_CC_HEADERS_H -#define DRAGONBONES_CC_HEADERS_H +#ifndef DRAGONBONES_AX_HEADERS_H +#define DRAGONBONES_AX_HEADERS_H #include "CCTextureAtlasData.h" #include "CCArmatureDisplay.h" #include "CCSlot.h" #include "CCFactory.h" -#endif // DRAGONBONES_CC_HEADERS_H +#endif // DRAGONBONES_AX_HEADERS_H diff --git a/extensions/DragonBones/CCFactory.h b/extensions/DragonBones/CCFactory.h index 29dc2f462e..35097b36d3 100644 --- a/extensions/DragonBones/CCFactory.h +++ b/extensions/DragonBones/CCFactory.h @@ -20,8 +20,8 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef DRAGONBONES_CC_FACTORY_H -#define DRAGONBONES_CC_FACTORY_H +#ifndef DRAGONBONES_AX_FACTORY_H +#define DRAGONBONES_AX_FACTORY_H #include "DragonBonesHeaders.h" #include "cocos2d.h" @@ -219,4 +219,4 @@ public: }; DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_CC_FACTORY_H +#endif // DRAGONBONES_AX_FACTORY_H diff --git a/extensions/DragonBones/CCSlot.h b/extensions/DragonBones/CCSlot.h index 1ece5d8a01..7c988a91fe 100644 --- a/extensions/DragonBones/CCSlot.h +++ b/extensions/DragonBones/CCSlot.h @@ -20,8 +20,8 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef DRAGONBONES_CC_SLOT_H -#define DRAGONBONES_CC_SLOT_H +#ifndef DRAGONBONES_AX_SLOT_H +#define DRAGONBONES_AX_SLOT_H #include "DragonBonesHeaders.h" #include "cocos2d.h" @@ -73,4 +73,4 @@ public: }; DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_CC_SLOT_H +#endif // DRAGONBONES_AX_SLOT_H diff --git a/extensions/DragonBones/CCTextureAtlasData.h b/extensions/DragonBones/CCTextureAtlasData.h index 7cd0bfe3d3..5362911c6f 100644 --- a/extensions/DragonBones/CCTextureAtlasData.h +++ b/extensions/DragonBones/CCTextureAtlasData.h @@ -20,8 +20,8 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef DRAGONBONES_CC_TEXTUREATLAS_DATA_H -#define DRAGONBONES_CC_TEXTUREATLAS_DATA_H +#ifndef DRAGONBONES_AX_TEXTUREATLAS_DATA_H +#define DRAGONBONES_AX_TEXTUREATLAS_DATA_H #include "DragonBonesHeaders.h" #include "cocos2d.h" @@ -76,4 +76,4 @@ protected: virtual void _onClear() override; }; DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_CC_TEXTUREATLAS_DATA_H +#endif // DRAGONBONES_AX_TEXTUREATLAS_DATA_H diff --git a/extensions/ExtensionExport.h b/extensions/ExtensionExport.h index cc4b764060..204cf4ac0a 100644 --- a/extensions/ExtensionExport.h +++ b/extensions/ExtensionExport.h @@ -30,13 +30,13 @@ # include # endif -# if defined(CC_STATIC) -# define CC_EX_DLL +# if defined(AX_STATIC) +# define AX_EX_DLL # else # if defined(_USREXDLL) -# define CC_EX_DLL __declspec(dllexport) +# define AX_EX_DLL __declspec(dllexport) # else /* use a DLL library */ -# define CC_EX_DLL __declspec(dllimport) +# define AX_EX_DLL __declspec(dllimport) # endif # endif @@ -49,9 +49,9 @@ # endif # endif #elif defined(_SHARED_) -# define CC_EX_DLL __attribute__((visibility("default"))) +# define AX_EX_DLL __attribute__((visibility("default"))) #else -# define CC_EX_DLL +# define AX_EX_DLL #endif #endif /* __CCEXTENSIONEXPORT_H__*/ \ No newline at end of file diff --git a/extensions/GUI/CCControlExtension/CCControl.cpp b/extensions/GUI/CCControlExtension/CCControl.cpp index 848a2f82bd..4c07ca450c 100644 --- a/extensions/GUI/CCControlExtension/CCControl.cpp +++ b/extensions/GUI/CCControlExtension/CCControl.cpp @@ -58,7 +58,7 @@ Control* Control::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); return nullptr; } } @@ -76,10 +76,10 @@ bool Control::init() auto dispatcher = Director::getInstance()->getEventDispatcher(); auto touchListener = EventListenerTouchOneByOne::create(); touchListener->setSwallowTouches(true); - touchListener->onTouchBegan = CC_CALLBACK_2(Control::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(Control::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(Control::onTouchEnded, this); - touchListener->onTouchCancelled = CC_CALLBACK_2(Control::onTouchCancelled, this); + touchListener->onTouchBegan = AX_CALLBACK_2(Control::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(Control::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(Control::onTouchEnded, this); + touchListener->onTouchCancelled = AX_CALLBACK_2(Control::onTouchCancelled, this); dispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); @@ -117,7 +117,7 @@ void Control::sendActionsForControlEvents(EventType controlEvents) { invocation->invoke(this); } -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING axis::BasicScriptData data(this, (void*)&controlEvents); axis::ScriptEvent event(axis::kControlEvent, (void*)&data); auto scriptEngine = axis::ScriptEngineManager::getInstance()->getScriptEngine(); diff --git a/extensions/GUI/CCControlExtension/CCControl.h b/extensions/GUI/CCControlExtension/CCControl.h index 0af905388f..eeff256c5a 100644 --- a/extensions/GUI/CCControlExtension/CCControl.h +++ b/extensions/GUI/CCControlExtension/CCControl.h @@ -61,11 +61,11 @@ class Invocation; * * To use the Control you have to subclass it. */ -class CC_EX_DLL Control : public Layer +class AX_EX_DLL Control : public Layer { public: /** Kinds of possible events for the control objects. */ - enum class CC_EX_DLL EventType + enum class AX_EX_DLL EventType { TOUCH_DOWN = 1 << 0, // A touch-down event in the control. DRAG_INSIDE = 1 << 1, // An event where a finger is dragged inside the bounds of the control. @@ -267,13 +267,13 @@ protected: bool _isOpacityModifyRGB; /** The current control state constant. */ - CC_SYNTHESIZE_READONLY(State, _state, State); + AX_SYNTHESIZE_READONLY(State, _state, State); private: - CC_DISALLOW_COPY_AND_ASSIGN(Control); + AX_DISALLOW_COPY_AND_ASSIGN(Control); }; -CC_EX_DLL Control::EventType operator|(Control::EventType a, Control::EventType b); +AX_EX_DLL Control::EventType operator|(Control::EventType a, Control::EventType b); // end of GUI group /// @} diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index 334a60428f..3d95f564a2 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -55,8 +55,8 @@ ControlButton::ControlButton() ControlButton::~ControlButton() { - CC_SAFE_RELEASE(_titleLabel); - CC_SAFE_RELEASE(_backgroundSprite); + AX_SAFE_RELEASE(_titleLabel); + AX_SAFE_RELEASE(_backgroundSprite); } // initialisers @@ -740,7 +740,7 @@ ControlButton* ControlButton::create() pControlButton->autorelease(); return pControlButton; } - CC_SAFE_DELETE(pControlButton); + AX_SAFE_DELETE(pControlButton); return nullptr; } diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index 7eb5b97df7..a6777d6065 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/extensions/GUI/CCControlExtension/CCControlButton.h @@ -51,7 +51,7 @@ NS_AX_EXT_BEGIN */ /** @class ControlButton Button control for Cocos2D. */ -class CC_EX_DLL ControlButton : public Control +class AX_EX_DLL ControlButton : public Control { public: static ControlButton* create(); @@ -217,23 +217,23 @@ protected: std::string _currentTitle; /** The current color used to display the title. */ - CC_SYNTHESIZE_READONLY_PASS_BY_REF(Color3B, _currentTitleColor, CurrentTitleColor); + AX_SYNTHESIZE_READONLY_PASS_BY_REF(Color3B, _currentTitleColor, CurrentTitleColor); /** The current title label. */ - CC_SYNTHESIZE_RETAIN(Node*, _titleLabel, TitleLabel); + AX_SYNTHESIZE_RETAIN(Node*, _titleLabel, TitleLabel); /** The current background sprite. */ - CC_SYNTHESIZE_RETAIN(axis::ui::Scale9Sprite*, _backgroundSprite, BackgroundSprite); + AX_SYNTHESIZE_RETAIN(axis::ui::Scale9Sprite*, _backgroundSprite, BackgroundSprite); /** The preferred size of the button, if label is larger it will be expanded. */ - CC_PROPERTY_PASS_BY_REF(Size, _preferredSize, PreferredSize); + AX_PROPERTY_PASS_BY_REF(Size, _preferredSize, PreferredSize); /** Adjust the button zooming on touchdown. Default value is YES. */ - CC_PROPERTY(bool, _zoomOnTouchDown, ZoomOnTouchDown); + AX_PROPERTY(bool, _zoomOnTouchDown, ZoomOnTouchDown); /** Scale ratio button on touchdown. Default value 1.1f */ - CC_SYNTHESIZE(float, _scaleRatio, ScaleRatio); + AX_SYNTHESIZE(float, _scaleRatio, ScaleRatio); - CC_PROPERTY_PASS_BY_REF(Vec2, _labelAnchorPoint, LabelAnchorPoint); + AX_PROPERTY_PASS_BY_REF(Vec2, _labelAnchorPoint, LabelAnchorPoint); std::unordered_map _titleDispatchTable; std::unordered_map _titleColorDispatchTable; @@ -242,12 +242,12 @@ protected: Map _backgroundSpriteDispatchTable; /* Define the button margin for Top/Bottom edge */ - CC_SYNTHESIZE_READONLY(int, _marginV, VerticalMargin); + AX_SYNTHESIZE_READONLY(int, _marginV, VerticalMargin); /* Define the button margin for Left/Right edge */ - CC_SYNTHESIZE_READONLY(int, _marginH, HorizontalOrigin); + AX_SYNTHESIZE_READONLY(int, _marginH, HorizontalOrigin); private: - CC_DISALLOW_COPY_AND_ASSIGN(ControlButton); + AX_DISALLOW_COPY_AND_ASSIGN(ControlButton); }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp index 21fd888482..f73e4c918d 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp @@ -41,9 +41,9 @@ ControlColourPicker::ControlColourPicker() : _colourPicker(nullptr), _huePicker( ControlColourPicker::~ControlColourPicker() { - CC_SAFE_RELEASE(_background); - CC_SAFE_RELEASE(_huePicker); - CC_SAFE_RELEASE(_colourPicker); + AX_SAFE_RELEASE(_background); + AX_SAFE_RELEASE(_huePicker); + AX_SAFE_RELEASE(_colourPicker); } bool ControlColourPicker::init() @@ -77,7 +77,7 @@ bool ControlColourPicker::init() Vec2::ZERO, Vec2(0.5f, 0.5f)); if (!_background) return false; - CC_SAFE_RETAIN(_background); + AX_SAFE_RETAIN(_background); Vec2 backgroundPointZero = _background->getPosition() - Vec2(_background->getContentSize().width / 2, _background->getContentSize().height / 2); diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.h b/extensions/GUI/CCControlExtension/CCControlColourPicker.h index e93def4280..3b8d1a3755 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.h +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.h @@ -49,7 +49,7 @@ NS_AX_EXT_BEGIN * @{ */ -class CC_EX_DLL ControlColourPicker : public Control +class AX_EX_DLL ControlColourPicker : public Control { public: static ControlColourPicker* create(); @@ -79,9 +79,9 @@ protected: virtual bool onTouchBegan(Touch* touch, Event* pEvent) override; HSV _hsv; - CC_SYNTHESIZE_RETAIN(ControlSaturationBrightnessPicker*, _colourPicker, colourPicker) - CC_SYNTHESIZE_RETAIN(ControlHuePicker*, _huePicker, HuePicker) - CC_SYNTHESIZE_RETAIN(Sprite*, _background, Background) + AX_SYNTHESIZE_RETAIN(ControlSaturationBrightnessPicker*, _colourPicker, colourPicker) + AX_SYNTHESIZE_RETAIN(ControlHuePicker*, _huePicker, HuePicker) + AX_SYNTHESIZE_RETAIN(Sprite*, _background, Background) }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp b/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp index 59f2cfcb56..e84bd0d5dd 100644 --- a/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp @@ -40,8 +40,8 @@ ControlHuePicker::ControlHuePicker() : _hue(0.0f), _huePercentage(0.0f), _backgr ControlHuePicker::~ControlHuePicker() { removeAllChildrenWithCleanup(true); - CC_SAFE_RELEASE(_background); - CC_SAFE_RELEASE(_slider); + AX_SAFE_RELEASE(_background); + AX_SAFE_RELEASE(_slider); } ControlHuePicker* ControlHuePicker::create(Node* target, Vec2 pos) @@ -102,7 +102,7 @@ void ControlHuePicker::setHuePercentage(float hueValueInPercent) // Update angle float angleDeg = _huePercentage * 360.0f - 180.0f; - float angle = CC_DEGREES_TO_RADIANS(angleDeg); + float angle = AX_DEGREES_TO_RADIANS(angleDeg); // Set new position of the slider float x = centerX + limit * cosf(angle); @@ -135,7 +135,7 @@ void ControlHuePicker::updateSliderPosition(Vec2 location) // Update angle by using the direction of the location float angle = atan2f(dy, dx); - float angleDeg = CC_RADIANS_TO_DEGREES(angle) + 180.0f; + float angleDeg = AX_RADIANS_TO_DEGREES(angle) + 180.0f; // use the position / slider width to determine the percentage the dragger is at setHue(angleDeg); diff --git a/extensions/GUI/CCControlExtension/CCControlHuePicker.h b/extensions/GUI/CCControlExtension/CCControlHuePicker.h index 88f7bafad6..f5e311d864 100644 --- a/extensions/GUI/CCControlExtension/CCControlHuePicker.h +++ b/extensions/GUI/CCControlExtension/CCControlHuePicker.h @@ -47,7 +47,7 @@ NS_AX_EXT_BEGIN * @{ */ -class CC_EX_DLL ControlHuePicker : public Control +class AX_EX_DLL ControlHuePicker : public Control { public: static ControlHuePicker* create(Node* target, Vec2 pos); @@ -73,15 +73,15 @@ protected: bool checkSliderPosition(Vec2 location); // manually put in the setters - CC_SYNTHESIZE_READONLY(float, _hue, Hue); + AX_SYNTHESIZE_READONLY(float, _hue, Hue); virtual void setHue(float val); - CC_SYNTHESIZE_READONLY(float, _huePercentage, HuePercentage); + AX_SYNTHESIZE_READONLY(float, _huePercentage, HuePercentage); virtual void setHuePercentage(float val); // not sure if these need to be there actually. I suppose someone might want to access the sprite? - CC_SYNTHESIZE_RETAIN(Sprite*, _background, Background); - CC_SYNTHESIZE_RETAIN(Sprite*, _slider, Slider); - CC_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); + AX_SYNTHESIZE_RETAIN(Sprite*, _background, Background); + AX_SYNTHESIZE_RETAIN(Sprite*, _slider, Slider); + AX_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp index d74dc94af3..fb4408b485 100644 --- a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp +++ b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp @@ -37,8 +37,8 @@ ControlPotentiometer::ControlPotentiometer() ControlPotentiometer::~ControlPotentiometer() { - CC_SAFE_RELEASE(_thumbSprite); - CC_SAFE_RELEASE(_progressTimer); + AX_SAFE_RELEASE(_thumbSprite); + AX_SAFE_RELEASE(_progressTimer); } ControlPotentiometer* ControlPotentiometer::create(const char* backgroundFile, @@ -61,7 +61,7 @@ ControlPotentiometer* ControlPotentiometer::create(const char* backgroundFile, } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/GUI/CCControlExtension/CCControlPotentiometer.h b/extensions/GUI/CCControlExtension/CCControlPotentiometer.h index 8a6051821a..166d046393 100644 --- a/extensions/GUI/CCControlExtension/CCControlPotentiometer.h +++ b/extensions/GUI/CCControlExtension/CCControlPotentiometer.h @@ -43,7 +43,7 @@ NS_AX_EXT_BEGIN */ /** @class ControlPotentiometer Potentiometer control for Cocos2D. */ -class CC_EX_DLL ControlPotentiometer : public Control +class AX_EX_DLL ControlPotentiometer : public Control { public: /** @@ -110,9 +110,9 @@ protected: * The default value of this property is 1.0. */ float _maximumValue; - CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) - CC_SYNTHESIZE_RETAIN(ProgressTimer*, _progressTimer, ProgressTimer) - CC_SYNTHESIZE(Vec2, _previousLocation, PreviousLocation) + AX_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) + AX_SYNTHESIZE_RETAIN(ProgressTimer*, _progressTimer, ProgressTimer) + AX_SYNTHESIZE(Vec2, _previousLocation, PreviousLocation) }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h index c2a7df3f8d..a0063c5b40 100644 --- a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h +++ b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h @@ -47,19 +47,19 @@ NS_AX_EXT_BEGIN * @{ */ -class CC_EX_DLL ControlSaturationBrightnessPicker : public Control +class AX_EX_DLL ControlSaturationBrightnessPicker : public Control { /** Contains the receiver's current saturation value. */ - CC_SYNTHESIZE_READONLY(float, _saturation, Saturation); + AX_SYNTHESIZE_READONLY(float, _saturation, Saturation); /** Contains the receiver's current brightness value. */ - CC_SYNTHESIZE_READONLY(float, _brightness, Brightness); + AX_SYNTHESIZE_READONLY(float, _brightness, Brightness); // not sure if these need to be there actually. I suppose someone might want to access the sprite? - CC_SYNTHESIZE_READONLY(Sprite*, _background, Background); - CC_SYNTHESIZE_READONLY(Sprite*, _overlay, Overlay); - CC_SYNTHESIZE_READONLY(Sprite*, _shadow, Shadow); - CC_SYNTHESIZE_READONLY(Sprite*, _slider, Slider); - CC_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); + AX_SYNTHESIZE_READONLY(Sprite*, _background, Background); + AX_SYNTHESIZE_READONLY(Sprite*, _overlay, Overlay); + AX_SYNTHESIZE_READONLY(Sprite*, _shadow, Shadow); + AX_SYNTHESIZE_READONLY(Sprite*, _slider, Slider); + AX_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); protected: int boxPos; diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.cpp b/extensions/GUI/CCControlExtension/CCControlSlider.cpp index 16dbd88431..eea7142279 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSlider.cpp @@ -49,10 +49,10 @@ ControlSlider::ControlSlider() ControlSlider::~ControlSlider() { - CC_SAFE_RELEASE(_thumbSprite); - CC_SAFE_RELEASE(_selectedThumbSprite); - CC_SAFE_RELEASE(_progressSprite); - CC_SAFE_RELEASE(_backgroundSprite); + AX_SAFE_RELEASE(_thumbSprite); + AX_SAFE_RELEASE(_selectedThumbSprite); + AX_SAFE_RELEASE(_progressSprite); + AX_SAFE_RELEASE(_backgroundSprite); } ControlSlider* ControlSlider::create(const char* bgFile, const char* progressFile, const char* thumbFile) diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.h b/extensions/GUI/CCControlExtension/CCControlSlider.h index 482632da66..a48bc2dd6f 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.h +++ b/extensions/GUI/CCControlExtension/CCControlSlider.h @@ -44,7 +44,7 @@ NS_AX_EXT_BEGIN * @{ */ -class CC_EX_DLL ControlSlider : public Control +class AX_EX_DLL ControlSlider : public Control { public: /** @@ -138,24 +138,24 @@ protected: // manually put in the setters /** Contains the receiver's current value. */ - CC_SYNTHESIZE_READONLY(float, _value, Value); + AX_SYNTHESIZE_READONLY(float, _value, Value); /** Contains the minimum value of the receiver. * The default value of this property is 0.0. */ - CC_SYNTHESIZE_READONLY(float, _minimumValue, MinimumValue); + AX_SYNTHESIZE_READONLY(float, _minimumValue, MinimumValue); /** Contains the maximum value of the receiver. * The default value of this property is 1.0. */ - CC_SYNTHESIZE_READONLY(float, _maximumValue, MaximumValue); + AX_SYNTHESIZE_READONLY(float, _maximumValue, MaximumValue); - CC_SYNTHESIZE(float, _minimumAllowedValue, MinimumAllowedValue); - CC_SYNTHESIZE(float, _maximumAllowedValue, MaximumAllowedValue); + AX_SYNTHESIZE(float, _minimumAllowedValue, MinimumAllowedValue); + AX_SYNTHESIZE(float, _maximumAllowedValue, MaximumAllowedValue); // maybe this should be read-only - CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite); - CC_SYNTHESIZE_RETAIN(Sprite*, _selectedThumbSprite, SelectedThumbSprite); - CC_SYNTHESIZE_RETAIN(Sprite*, _progressSprite, ProgressSprite); - CC_SYNTHESIZE_RETAIN(Sprite*, _backgroundSprite, BackgroundSprite); + AX_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite); + AX_SYNTHESIZE_RETAIN(Sprite*, _selectedThumbSprite, SelectedThumbSprite); + AX_SYNTHESIZE_RETAIN(Sprite*, _progressSprite, ProgressSprite); + AX_SYNTHESIZE_RETAIN(Sprite*, _backgroundSprite, BackgroundSprite); }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlStepper.cpp b/extensions/GUI/CCControlExtension/CCControlStepper.cpp index 9c3fb23471..f38f7514e5 100644 --- a/extensions/GUI/CCControlExtension/CCControlStepper.cpp +++ b/extensions/GUI/CCControlExtension/CCControlStepper.cpp @@ -60,10 +60,10 @@ ControlStepper::~ControlStepper() { unscheduleAllCallbacks(); - CC_SAFE_RELEASE(_minusSprite); - CC_SAFE_RELEASE(_plusSprite); - CC_SAFE_RELEASE(_minusLabel); - CC_SAFE_RELEASE(_plusLabel); + AX_SAFE_RELEASE(_minusSprite); + AX_SAFE_RELEASE(_plusSprite); + AX_SAFE_RELEASE(_minusLabel); + AX_SAFE_RELEASE(_plusLabel); } bool ControlStepper::initWithMinusSpriteAndPlusSprite(Sprite* minusSprite, Sprite* plusSprite) @@ -124,7 +124,7 @@ ControlStepper* ControlStepper::create(Sprite* minusSprite, Sprite* plusSprite) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } @@ -224,14 +224,14 @@ void ControlStepper::startAutorepeat() { _autorepeatCount = -1; - this->schedule(CC_SCHEDULE_SELECTOR(ControlStepper::update), kAutorepeatDeltaTime, CC_REPEAT_FOREVER, + this->schedule(AX_SCHEDULE_SELECTOR(ControlStepper::update), kAutorepeatDeltaTime, AX_REPEAT_FOREVER, kAutorepeatDeltaTime * 3); } /** Stop the autorepeat. */ void ControlStepper::stopAutorepeat() { - this->unschedule(CC_SCHEDULE_SELECTOR(ControlStepper::update)); + this->unschedule(AX_SCHEDULE_SELECTOR(ControlStepper::update)); } void ControlStepper::update(float /*dt*/) diff --git a/extensions/GUI/CCControlExtension/CCControlStepper.h b/extensions/GUI/CCControlExtension/CCControlStepper.h index b38e149b53..0c1a20a224 100644 --- a/extensions/GUI/CCControlExtension/CCControlStepper.h +++ b/extensions/GUI/CCControlExtension/CCControlStepper.h @@ -43,7 +43,7 @@ NS_AX_EXT_BEGIN * @{ */ -class CC_EX_DLL ControlStepper : public Control +class AX_EX_DLL ControlStepper : public Control { public: enum class Part @@ -113,10 +113,10 @@ protected: int _autorepeatCount; // Weak links to children - CC_SYNTHESIZE_RETAIN(Sprite*, _minusSprite, MinusSprite) - CC_SYNTHESIZE_RETAIN(Sprite*, _plusSprite, PlusSprite) - CC_SYNTHESIZE_RETAIN(Label*, _minusLabel, MinusLabel) - CC_SYNTHESIZE_RETAIN(Label*, _plusLabel, PlusLabel) + AX_SYNTHESIZE_RETAIN(Sprite*, _minusSprite, MinusSprite) + AX_SYNTHESIZE_RETAIN(Sprite*, _plusSprite, PlusSprite) + AX_SYNTHESIZE_RETAIN(Label*, _minusLabel, MinusLabel) + AX_SYNTHESIZE_RETAIN(Label*, _plusLabel, PlusLabel) }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp index 6ce82e48d8..c6a01c405e 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp @@ -82,18 +82,18 @@ public: /** Contains the position (in x-axis) of the slider inside the receiver. */ float _sliderXPosition; - CC_SYNTHESIZE(float, _onPosition, OnPosition) - CC_SYNTHESIZE(float, _offPosition, OffPosition) + AX_SYNTHESIZE(float, _onPosition, OnPosition) + AX_SYNTHESIZE(float, _offPosition, OffPosition) - CC_SYNTHESIZE_RETAIN(Texture2D*, _maskTexture, MaskTexture) - CC_SYNTHESIZE(uint32_t, _textureLocation, TextureLocation) - CC_SYNTHESIZE(uint32_t, _maskLocation, MaskLocation) + AX_SYNTHESIZE_RETAIN(Texture2D*, _maskTexture, MaskTexture) + AX_SYNTHESIZE(uint32_t, _textureLocation, TextureLocation) + AX_SYNTHESIZE(uint32_t, _maskLocation, MaskLocation) - CC_SYNTHESIZE_RETAIN(Sprite*, _onSprite, OnSprite) - CC_SYNTHESIZE_RETAIN(Sprite*, _offSprite, OffSprite) - CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) - CC_SYNTHESIZE_RETAIN(Label*, _onLabel, OnLabel) - CC_SYNTHESIZE_RETAIN(Label*, _offLabel, OffLabel) + AX_SYNTHESIZE_RETAIN(Sprite*, _onSprite, OnSprite) + AX_SYNTHESIZE_RETAIN(Sprite*, _offSprite, OffSprite) + AX_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) + AX_SYNTHESIZE_RETAIN(Label*, _onLabel, OnLabel) + AX_SYNTHESIZE_RETAIN(Label*, _offLabel, OffLabel) Sprite* _clipperStencil; @@ -120,7 +120,7 @@ protected: Label* offLabel); private: - CC_DISALLOW_COPY_AND_ASSIGN(ControlSwitchSprite); + AX_DISALLOW_COPY_AND_ASSIGN(ControlSwitchSprite); }; ControlSwitchSprite* ControlSwitchSprite::create(Sprite* maskSprite, @@ -153,13 +153,13 @@ ControlSwitchSprite::ControlSwitchSprite() ControlSwitchSprite::~ControlSwitchSprite() { - CC_SAFE_RELEASE(_onSprite); - CC_SAFE_RELEASE(_offSprite); - CC_SAFE_RELEASE(_thumbSprite); - CC_SAFE_RELEASE(_onLabel); - CC_SAFE_RELEASE(_offLabel); - CC_SAFE_RELEASE(_maskTexture); - CC_SAFE_RELEASE(_clipperStencil); + AX_SAFE_RELEASE(_onSprite); + AX_SAFE_RELEASE(_offSprite); + AX_SAFE_RELEASE(_thumbSprite); + AX_SAFE_RELEASE(_onLabel); + AX_SAFE_RELEASE(_offLabel); + AX_SAFE_RELEASE(_maskTexture); + AX_SAFE_RELEASE(_clipperStencil); } bool ControlSwitchSprite::initWithMaskSprite(Sprite* maskSprite, @@ -282,7 +282,7 @@ ControlSwitch::ControlSwitch() : _switchSprite(nullptr), _initialTouchXPosition( ControlSwitch::~ControlSwitch() { - CC_SAFE_RELEASE(_switchSprite); + AX_SAFE_RELEASE(_switchSprite); } bool ControlSwitch::initWithMaskSprite(Sprite* maskSprite, Sprite* onSprite, Sprite* offSprite, Sprite* thumbSprite) @@ -299,7 +299,7 @@ ControlSwitch* ControlSwitch::create(Sprite* maskSprite, Sprite* onSprite, Sprit } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } @@ -348,7 +348,7 @@ ControlSwitch* ControlSwitch::create(Sprite* maskSprite, } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.h b/extensions/GUI/CCControlExtension/CCControlSwitch.h index 3231a314c3..02ba46b79c 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.h +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.h @@ -50,7 +50,7 @@ class ControlSwitchSprite; */ /** @class ControlSwitch Switch control for Cocos2D. */ -class CC_EX_DLL ControlSwitch : public Control +class AX_EX_DLL ControlSwitch : public Control { public: /** Creates a switch with a mask sprite, on/off sprites for on/off states, a thumb sprite and an on/off labels. */ diff --git a/extensions/GUI/CCControlExtension/CCControlUtils.h b/extensions/GUI/CCControlExtension/CCControlUtils.h index 3d59cbcea3..4e3ded4d95 100644 --- a/extensions/GUI/CCControlExtension/CCControlUtils.h +++ b/extensions/GUI/CCControlExtension/CCControlUtils.h @@ -65,7 +65,7 @@ typedef struct */ // helper class to store Color3B's in mutable arrays -class CC_EX_DLL Color3bObject : public Ref +class AX_EX_DLL Color3bObject : public Ref { public: Color3B value; @@ -76,7 +76,7 @@ public: Color3bObject(Color3B s_value) : value(s_value) {} }; -class CC_EX_DLL ControlUtils +class AX_EX_DLL ControlUtils { public: /** diff --git a/extensions/GUI/CCControlExtension/CCInvocation.h b/extensions/GUI/CCControlExtension/CCInvocation.h index 1cfbd2c51d..931a3dd62e 100644 --- a/extensions/GUI/CCControlExtension/CCInvocation.h +++ b/extensions/GUI/CCControlExtension/CCInvocation.h @@ -49,7 +49,7 @@ NS_AX_EXT_BEGIN #define cccontrol_selector(_SELECTOR) static_cast(&_SELECTOR) -class CC_EX_DLL Invocation : public Ref +class AX_EX_DLL Invocation : public Ref { public: /** @@ -69,9 +69,9 @@ public: void invoke(Ref* sender); protected: - CC_SYNTHESIZE_READONLY(Control::Handler, _action, Action); - CC_SYNTHESIZE_READONLY(Ref*, _target, Target); - CC_SYNTHESIZE_READONLY(Control::EventType, _controlEvent, ControlEvent); + AX_SYNTHESIZE_READONLY(Control::Handler, _action, Action); + AX_SYNTHESIZE_READONLY(Ref*, _target, Target); + AX_SYNTHESIZE_READONLY(Control::EventType, _controlEvent, ControlEvent); }; // end of GUI group diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index d9331addda..ac0c692a27 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -78,7 +78,7 @@ ScrollView* ScrollView::create(Size size, Node* container /* = nullptr*/) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } @@ -92,7 +92,7 @@ ScrollView* ScrollView::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } @@ -186,10 +186,10 @@ void ScrollView::setTouchEnabled(bool enabled) { _touchListener = EventListenerTouchOneByOne::create(); _touchListener->setSwallowTouches(true); - _touchListener->onTouchBegan = CC_CALLBACK_2(ScrollView::onTouchBegan, this); - _touchListener->onTouchMoved = CC_CALLBACK_2(ScrollView::onTouchMoved, this); - _touchListener->onTouchEnded = CC_CALLBACK_2(ScrollView::onTouchEnded, this); - _touchListener->onTouchCancelled = CC_CALLBACK_2(ScrollView::onTouchCancelled, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(ScrollView::onTouchBegan, this); + _touchListener->onTouchMoved = AX_CALLBACK_2(ScrollView::onTouchMoved, this); + _touchListener->onTouchEnded = AX_CALLBACK_2(ScrollView::onTouchEnded, this); + _touchListener->onTouchCancelled = AX_CALLBACK_2(ScrollView::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(_touchListener, this); } @@ -244,10 +244,10 @@ void ScrollView::setContentOffsetInDuration(Vec2 offset, float dt) stopAnimatedContentOffset(); } scroll = MoveTo::create(dt, offset); - expire = CallFuncN::create(CC_CALLBACK_1(ScrollView::stoppedAnimatedScroll, this)); + expire = CallFuncN::create(AX_CALLBACK_1(ScrollView::stoppedAnimatedScroll, this)); _animatedScrollAction = _container->runAction(Sequence::create(scroll, expire, nullptr)); _animatedScrollAction->retain(); - this->schedule(CC_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); + this->schedule(AX_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); } void ScrollView::stopAnimatedContentOffset() @@ -426,7 +426,7 @@ void ScrollView::deaccelerateScrolling(float /*dt*/) { if (_dragging) { - this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); + this->unschedule(AX_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); return; } @@ -458,14 +458,14 @@ void ScrollView::deaccelerateScrolling(float /*dt*/) ((_direction == Direction::BOTH || _direction == Direction::HORIZONTAL) && (newX >= maxInset.x || newX <= minInset.x))) { - this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); + this->unschedule(AX_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); this->relocateContainer(true); } } void ScrollView::stoppedAnimatedScroll(Node* /*node*/) { - this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); + this->unschedule(AX_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); // After the animation stopped, "scrollViewDidScroll" should be invoked, this could fix the bug of lack of tableview // cells. if (_delegate != nullptr) @@ -478,7 +478,7 @@ void ScrollView::performedAnimatedScroll(float /*dt*/) { if (_dragging) { - this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); + this->unschedule(AX_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); return; } @@ -568,7 +568,7 @@ void ScrollView::beforeDraw() // TODO: minggo // ScrollView don't support drawing in 3D space // _beforeDrawCommand.init(_globalZOrder); - // _beforeDrawCommand.func = CC_CALLBACK_0(ScrollView::onBeforeDraw, this); + // _beforeDrawCommand.func = AX_CALLBACK_0(ScrollView::onBeforeDraw, this); // Director::getInstance()->getRenderer()->addCommand(&_beforeDrawCommand); } @@ -610,7 +610,7 @@ void ScrollView::afterDraw() { // TODO: minggo // _afterDrawCommand.init(_globalZOrder); - // _afterDrawCommand.func = CC_CALLBACK_0(ScrollView::onAfterDraw, this); + // _afterDrawCommand.func = AX_CALLBACK_0(ScrollView::onAfterDraw, this); // Director::getInstance()->getRenderer()->addCommand(&_afterDrawCommand); } @@ -850,7 +850,7 @@ void ScrollView::onTouchEnded(Touch* touch, Event* /*event*/) { if (_touches.size() == 1 && _touchMoved) { - this->schedule(CC_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); + this->schedule(AX_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); } _touches.erase(touchIter); } diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index 8e90324f62..b5fb41f36a 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -41,7 +41,7 @@ NS_AX_EXT_BEGIN class ScrollView; -class CC_EX_DLL ScrollViewDelegate +class AX_EX_DLL ScrollViewDelegate { public: /** @@ -65,7 +65,7 @@ public: * ScrollView support for cocos2d-x. * It provides scroll view functionalities to cocos2d projects natively. */ -class CC_EX_DLL ScrollView : public Layer, public ActionTweenDelegate +class AX_EX_DLL ScrollView : public Layer, public ActionTweenDelegate { public: enum class Direction diff --git a/extensions/GUI/CCScrollView/CCTableView.cpp b/extensions/GUI/CCScrollView/CCTableView.cpp index 8b01add9ce..a634d809cb 100644 --- a/extensions/GUI/CCScrollView/CCTableView.cpp +++ b/extensions/GUI/CCScrollView/CCTableView.cpp @@ -71,7 +71,7 @@ bool TableView::initWithViewSize(Size size, Node* container /* = nullptr*/) { if (ScrollView::initWithViewSize(size, container)) { - CC_SAFE_DELETE(_indices); + AX_SAFE_DELETE(_indices); _indices = new std::set(); _vordering = VerticalFillOrder::BOTTOM_UP; this->setDirection(Direction::VERTICAL); @@ -93,7 +93,7 @@ TableView::TableView() TableView::~TableView() { - CC_SAFE_DELETE(_indices); + AX_SAFE_DELETE(_indices); } void TableView::setVerticalFillOrder(VerticalFillOrder fillOrder) @@ -162,7 +162,7 @@ TableViewCell* TableView::cellAtIndex(ssize_t idx) void TableView::updateCellAtIndex(ssize_t idx) { - if (idx == CC_INVALID_INDEX) + if (idx == AX_INVALID_INDEX) { return; } @@ -184,7 +184,7 @@ void TableView::updateCellAtIndex(ssize_t idx) void TableView::insertCellAtIndex(ssize_t idx) { - if (idx == CC_INVALID_INDEX) + if (idx == AX_INVALID_INDEX) { return; } @@ -220,7 +220,7 @@ void TableView::insertCellAtIndex(ssize_t idx) void TableView::removeCellAtIndex(ssize_t idx) { - if (idx == CC_INVALID_INDEX) + if (idx == AX_INVALID_INDEX) { return; } @@ -364,7 +364,7 @@ long TableView::_indexFromOffset(Vec2 offset) index = MAX(0, index); if (index > maxIdx) { - index = CC_INVALID_INDEX; + index = AX_INVALID_INDEX; } } @@ -494,7 +494,7 @@ void TableView::scrollViewDidScroll(ScrollView* /*view*/) offset.y = offset.y + _viewSize.height / this->getContainer()->getScaleY(); } startIdx = this->_indexFromOffset(offset); - if (startIdx == CC_INVALID_INDEX) + if (startIdx == AX_INVALID_INDEX) { startIdx = countOfItems - 1; } @@ -510,7 +510,7 @@ void TableView::scrollViewDidScroll(ScrollView* /*view*/) offset.x += _viewSize.width / this->getContainer()->getScaleX(); endIdx = this->_indexFromOffset(offset); - if (endIdx == CC_INVALID_INDEX) + if (endIdx == AX_INVALID_INDEX) { endIdx = countOfItems - 1; } @@ -633,7 +633,7 @@ bool TableView::onTouchBegan(Touch* pTouch, Event* pEvent) point = this->getContainer()->convertTouchToNodeSpace(pTouch); index = this->_indexFromOffset(point); - if (index == CC_INVALID_INDEX) + if (index == AX_INVALID_INDEX) { _touchedCell = nullptr; } diff --git a/extensions/GUI/CCScrollView/CCTableView.h b/extensions/GUI/CCScrollView/CCTableView.h index bcb9f1125b..972f3c3051 100644 --- a/extensions/GUI/CCScrollView/CCTableView.h +++ b/extensions/GUI/CCScrollView/CCTableView.h @@ -45,7 +45,7 @@ class TableView; /** * Sole purpose of this delegate is to single touch event in this version. */ -class CC_EX_DLL TableViewDelegate : public ScrollViewDelegate +class AX_EX_DLL TableViewDelegate : public ScrollViewDelegate { public: /** @@ -94,7 +94,7 @@ public: /** * Data source that governs table backend data. */ -class CC_EX_DLL TableViewDataSource +class AX_EX_DLL TableViewDataSource { public: /** @@ -137,7 +137,7 @@ public: * * This is a very basic, minimal implementation to bring UITableView-like component into cocos2d world. */ -class CC_EX_DLL TableView : public ScrollView, public ScrollViewDelegate +class AX_EX_DLL TableView : public ScrollView, public ScrollViewDelegate { public: enum class VerticalFillOrder diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.cpp b/extensions/GUI/CCScrollView/CCTableViewCell.cpp index da0280fe31..2c8a8ca2fd 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.cpp +++ b/extensions/GUI/CCScrollView/CCTableViewCell.cpp @@ -30,7 +30,7 @@ NS_AX_EXT_BEGIN void TableViewCell::reset() { - _idx = CC_INVALID_INDEX; + _idx = AX_INVALID_INDEX; } ssize_t TableViewCell::getIdx() const diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.h b/extensions/GUI/CCScrollView/CCTableViewCell.h index cd39fe5009..4b4b5a69ab 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.h +++ b/extensions/GUI/CCScrollView/CCTableViewCell.h @@ -40,7 +40,7 @@ NS_AX_EXT_BEGIN /** * Abstract class for SWTableView cell node */ -class CC_EX_DLL TableViewCell : public Node +class AX_EX_DLL TableViewCell : public Node { public: CREATE_FUNC(TableViewCell); diff --git a/extensions/ImGui/ImGuiPresenter.cpp b/extensions/ImGui/ImGuiPresenter.cpp index 8c78179a1e..3eca8ac863 100644 --- a/extensions/ImGui/ImGuiPresenter.cpp +++ b/extensions/ImGui/ImGuiPresenter.cpp @@ -4,10 +4,10 @@ #include "imgui_internal.h" // TODO: mac metal -#if (defined(CC_USE_GL) || defined(CC_USE_GLES)) -# define CC_IMGUI_ENABLE_MULTI_VIEWPORT 1 +#if (defined(AX_USE_GL) || defined(AX_USE_GLES)) +# define AX_IMGUI_ENABLE_MULTI_VIEWPORT 1 #else -# define CC_IMGUI_ENABLE_MULTI_VIEWPORT 0 +# define AX_IMGUI_ENABLE_MULTI_VIEWPORT 0 #endif NS_AX_EXT_BEGIN @@ -33,7 +33,7 @@ class ImGuiSceneEventTracker : public ImGuiEventTracker public: bool initWithScene(Scene* scene) { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC _trackLayer = utils::newInstance(&Node::initLayer); // note: when at the first click to focus the window, this will not take effect @@ -75,7 +75,7 @@ public: ~ImGuiSceneEventTracker() { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC if (_trackLayer) { if (_trackLayer->getParent()) @@ -96,7 +96,7 @@ class ImGuiGlobalEventTracker : public ImGuiEventTracker public: bool init() { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC // note: when at the first click to focus the window, this will not take effect auto eventDispatcher = Director::getInstance()->getEventDispatcher(); @@ -122,7 +122,7 @@ public: ~ImGuiGlobalEventTracker() { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC auto eventDispatcher = Director::getInstance()->getEventDispatcher(); eventDispatcher->removeEventListener(_mouseListener); eventDispatcher->removeEventListener(_touchListener); @@ -172,7 +172,7 @@ void ImGuiPresenter::init() // io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking -#if CC_IMGUI_ENABLE_MULTI_VIEWPORT +#if AX_IMGUI_ENABLE_MULTI_VIEWPORT io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows #endif // io.ConfigViewportsNoAutoMerge = true; @@ -220,7 +220,7 @@ void ImGuiPresenter::cleanup() ImGui_ImplAxis_Shutdown(); ImGui_ImplGlfw_Shutdown(); - CC_SAFE_RELEASE_NULL(_fontsTexture); + AX_SAFE_RELEASE_NULL(_fontsTexture); ImGui::DestroyContext(); } @@ -372,7 +372,7 @@ void ImGuiPresenter::endFrame() ImGui_ImplAxis_RenderPlatform(); --_beginFrames; - CC_SAFE_RELEASE_NULL(_fontsTexture); + AX_SAFE_RELEASE_NULL(_fontsTexture); } } diff --git a/extensions/ImGui/README.md b/extensions/ImGui/README.md index b1df1191a0..5890e1493b 100644 --- a/extensions/ImGui/README.md +++ b/extensions/ImGui/README.md @@ -26,7 +26,7 @@ public: ImGuiPresenter::getInstance()->addFont(R"(C:\Windows\Fonts\msyh.ttc)", ImGuiPresenter::DEFAULT_FONT_SIZE, ImGuiPresenter::CHS_GLYPH_RANGE::GENERAL); */ - ImGuiPresenter::getInstance()->addRenderLoop("#im01", CC_CALLBACK_0(GameScene::onImGuiDraw, this), this); + ImGuiPresenter::getInstance()->addRenderLoop("#im01", AX_CALLBACK_0(GameScene::onImGuiDraw, this), this); } void onExit() override { diff --git a/extensions/ImGui/imgui_impl_axis.cpp b/extensions/ImGui/imgui_impl_axis.cpp index 37b557e93e..2a40860240 100644 --- a/extensions/ImGui/imgui_impl_axis.cpp +++ b/extensions/ImGui/imgui_impl_axis.cpp @@ -1187,13 +1187,13 @@ static void ImGui_ImplGlfw_ShutdownPlatformInterface() ////////////////////////// axis spec ///////////////////////// -#define CC_PTR_CAST(v, pointer_type) reinterpret_cast(v) +#define AX_PTR_CAST(v, pointer_type) reinterpret_cast(v) // fps macro -#define CC_IMGUI_DEFAULT_DELTA (1 / 60.f) -#define CC_IMGUI_MIN_DELTA (1 / 1000.f) -#define CC_IMGUI_MAX_DELTA (1 / 30.f) +#define AX_IMGUI_DEFAULT_DELTA (1 / 60.f) +#define AX_IMGUI_MIN_DELTA (1 / 1000.f) +#define AX_IMGUI_MAX_DELTA (1 / 30.f) enum { @@ -1396,8 +1396,8 @@ static bool ImGui_ImplAxis_CreateDeviceObjects() static void ImGui_ImplAxis_DestroyDeviceObjects() { auto bd = ImGui_ImplGlfw_GetBackendData(); - CC_SAFE_RELEASE_NULL(bd->ProgramInfo.program); - CC_SAFE_RELEASE_NULL(bd->ProgramFontInfo.program); + AX_SAFE_RELEASE_NULL(bd->ProgramInfo.program); + AX_SAFE_RELEASE_NULL(bd->ProgramFontInfo.program); ImGui_ImplAxis_DestroyFontsTexture(); } @@ -1442,8 +1442,8 @@ static bool ImGui_ImplAxis_createShaderPrograms() auto bd = ImGui_ImplGlfw_GetBackendData(); - CC_SAFE_RELEASE(bd->ProgramInfo.program); - CC_SAFE_RELEASE(bd->ProgramFontInfo.program); + AX_SAFE_RELEASE(bd->ProgramInfo.program); + AX_SAFE_RELEASE(bd->ProgramFontInfo.program); bd->ProgramInfo.program = backend::Device::getInstance()->newProgram(vertex_shader, fragment_shader); bd->ProgramFontInfo.program = backend::Device::getInstance()->newProgram(vertex_shader, fragment_shader_font); IM_ASSERT(bd->ProgramInfo.program); @@ -1486,7 +1486,7 @@ bool ImGui_ImplAxis_CreateFontsTexture() // consider calling GetTexDataAsAlpha8() instead to save on GPU memory. io.Fonts->GetTexDataAsAlpha8(&pixels, &width, &height); - CC_SAFE_RELEASE(bd->FontTexture); + AX_SAFE_RELEASE(bd->FontTexture); bd->FontTexture = new Texture2D(); bd->FontTexture->setAntiAliasTexParameters(); @@ -1501,7 +1501,7 @@ IMGUI_IMPL_API void ImGui_ImplAxis_DestroyFontsTexture() if (bd->FontTexture) { ImGui::GetIO().Fonts->TexID = nullptr; - CC_SAFE_RELEASE_NULL(bd->FontTexture); + AX_SAFE_RELEASE_NULL(bd->FontTexture); } } @@ -1640,7 +1640,7 @@ IMGUI_IMPL_API void ImGui_ImplAxis_RenderDrawData(ImDrawData* draw_data) if (typeid(*((Ref*)pcmd->TextureId)) == typeid(Texture2D)) { - auto tex = CC_PTR_CAST(pcmd->TextureId, Texture2D*); + auto tex = AX_PTR_CAST(pcmd->TextureId, Texture2D*); auto cmd = std::make_shared(); bd->CustomCommands.push_back(cmd); cmd->init(0.f, BlendFunc::ALPHA_NON_PREMULTIPLIED); @@ -1667,7 +1667,7 @@ IMGUI_IMPL_API void ImGui_ImplAxis_RenderDrawData(ImDrawData* draw_data) } else { - auto node = CC_PTR_CAST(pcmd->TextureId, Node*); + auto node = AX_PTR_CAST(pcmd->TextureId, Node*); const auto tr = node->getNodeToParentTransform(); node->setVisible(true); node->setNodeToParentTransform(tr); diff --git a/extensions/Live2D/Framework/src/Rendering/axis/CubismOffscreenSurface_Cocos2dx.cpp b/extensions/Live2D/Framework/src/Rendering/axis/CubismOffscreenSurface_Cocos2dx.cpp index cf76d05743..a5edc5f81e 100644 --- a/extensions/Live2D/Framework/src/Rendering/axis/CubismOffscreenSurface_Cocos2dx.cpp +++ b/extensions/Live2D/Framework/src/Rendering/axis/CubismOffscreenSurface_Cocos2dx.cpp @@ -146,7 +146,7 @@ void CubismOffscreenFrame_Cocos2dx::DestroyOffscreenFrame() { if ((_renderTexture != NULL) && !_isInheritedRenderTexture) { - CC_SAFE_RELEASE_NULL(_renderTexture); + AX_SAFE_RELEASE_NULL(_renderTexture); _colorBuffer = NULL; } } diff --git a/extensions/Live2D/Framework/src/Rendering/axis/CubismRenderer_Cocos2dx.cpp b/extensions/Live2D/Framework/src/Rendering/axis/CubismRenderer_Cocos2dx.cpp index ee3fe99663..538dfb3052 100644 --- a/extensions/Live2D/Framework/src/Rendering/axis/CubismRenderer_Cocos2dx.cpp +++ b/extensions/Live2D/Framework/src/Rendering/axis/CubismRenderer_Cocos2dx.cpp @@ -745,7 +745,7 @@ void CubismShader_Cocos2dx::ReleaseShaderProgram() // SetupMask static const csmChar* VertShaderSrcSetupMask = -#if !defined(CC_PLATFORM_MOBILE) && !defined(CC_USE_GLES) +#if !defined(AX_PLATFORM_MOBILE) && !defined(AX_USE_GLES) "#version 120\n" #endif "attribute vec2 a_position;" @@ -777,7 +777,7 @@ static const csmChar* FragShaderSrcSetupMask = "gl_FragColor = u_channelFlag * texture2D(s_texture0 , v_texCoord).a * isInside;" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcSetupMaskTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" @@ -801,7 +801,7 @@ static const csmChar* FragShaderSrcSetupMaskTegra = //----- バーテックスシェーダプログラム ----- // Normal & Add & Mult 共通 static const csmChar* VertShaderSrc = -#if !defined(CC_PLATFORM_MOBILE) && !defined(CC_USE_GLES) +#if !defined(AX_PLATFORM_MOBILE) && !defined(AX_USE_GLES) "#version 120\n" #endif "attribute vec2 a_position;" //v.vertex @@ -818,7 +818,7 @@ static const csmChar* VertShaderSrc = // Normal & Add & Mult 共通(クリッピングされたものの描画用) static const csmChar* VertShaderSrcMasked = -#if !defined(CC_PLATFORM_MOBILE) && !defined(CC_USE_GLES) +#if !defined(AX_PLATFORM_MOBILE) && !defined(AX_USE_GLES) "#version 120\n" #endif "attribute vec2 a_position;" @@ -832,7 +832,7 @@ static const csmChar* VertShaderSrcMasked = "vec4 pos = vec4(a_position.x, a_position.y, 0.0, 1.0);" "gl_Position = u_matrix * pos;" "v_clipPos = u_clipMatrix * pos;" -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) "v_clipPos = vec4(v_clipPos.x, 1.0 - v_clipPos.y, v_clipPos.zw);" #endif "v_texCoord = a_texCoord;" @@ -850,7 +850,7 @@ static const csmChar* FragShaderSrc = "vec4 color = texture2D(s_texture0 , v_texCoord) * u_baseColor;" "gl_FragColor = vec4(color.rgb * color.a, color.a);" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" @@ -873,7 +873,7 @@ static const csmChar* FragShaderSrcPremultipliedAlpha = "{" "gl_FragColor = texture2D(s_texture0 , v_texCoord) * u_baseColor;" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcPremultipliedAlphaTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" @@ -903,7 +903,7 @@ static const csmChar* FragShaderSrcMask = "col_formask = col_formask * maskVal;" "gl_FragColor = col_formask;" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcMaskTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" @@ -941,7 +941,7 @@ static const csmChar* FragShaderSrcMaskInverted = "col_formask = col_formask * (1.0 - maskVal);" "gl_FragColor = col_formask;" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcMaskInvertedTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" @@ -978,7 +978,7 @@ static const csmChar* FragShaderSrcMaskPremultipliedAlpha = "col_formask = col_formask * maskVal;" "gl_FragColor = col_formask;" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcMaskPremultipliedAlphaTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" @@ -1014,7 +1014,7 @@ static const csmChar* FragShaderSrcMaskInvertedPremultipliedAlpha = "col_formask = col_formask * (1.0 - maskVal);" "gl_FragColor = col_formask;" "}"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static const csmChar* FragShaderSrcMaskInvertedPremultipliedAlphaTegra = "#extension GL_NV_shader_framebuffer_fetch : enable\n" "precision mediump float;" diff --git a/extensions/Particle3D/CCParticle3DAffector.h b/extensions/Particle3D/CCParticle3DAffector.h index 6889673261..3f44cade54 100644 --- a/extensions/Particle3D/CCParticle3DAffector.h +++ b/extensions/Particle3D/CCParticle3DAffector.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PARTICLE_3D_AFFECTOR_H__ -#define __CC_PARTICLE_3D_AFFECTOR_H__ +#ifndef __AX_PARTICLE_3D_AFFECTOR_H__ +#define __AX_PARTICLE_3D_AFFECTOR_H__ #include "base/CCRef.h" #include @@ -35,7 +35,7 @@ NS_AX_BEGIN class ParticleSystem3D; struct Particle3D; -class CC_EX_DLL Particle3DAffector : public Ref +class AX_EX_DLL Particle3DAffector : public Ref { friend class ParticleSystem3D; diff --git a/extensions/Particle3D/CCParticle3DEmitter.h b/extensions/Particle3D/CCParticle3DEmitter.h index ea84104aae..040d163728 100644 --- a/extensions/Particle3D/CCParticle3DEmitter.h +++ b/extensions/Particle3D/CCParticle3DEmitter.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PARTICLE_3D_EMITTER_H__ -#define __CC_PARTICLE_3D_EMITTER_H__ +#ifndef __AX_PARTICLE_3D_EMITTER_H__ +#define __AX_PARTICLE_3D_EMITTER_H__ #include "base/CCRef.h" #include @@ -37,7 +37,7 @@ struct Particle3D; /** * 3d particle emitter */ -class CC_EX_DLL Particle3DEmitter : public Ref +class AX_EX_DLL Particle3DEmitter : public Ref { friend class ParticleSystem3D; diff --git a/extensions/Particle3D/CCParticle3DRender.cpp b/extensions/Particle3D/CCParticle3DRender.cpp index fe378faf5b..1c14d49f58 100644 --- a/extensions/Particle3D/CCParticle3DRender.cpp +++ b/extensions/Particle3D/CCParticle3DRender.cpp @@ -45,10 +45,10 @@ Particle3DQuadRender::Particle3DQuadRender() Particle3DQuadRender::~Particle3DQuadRender() { - // CC_SAFE_RELEASE(_texture); - CC_SAFE_RELEASE(_programState); - CC_SAFE_RELEASE(_vertexBuffer); - CC_SAFE_RELEASE(_indexBuffer); + // AX_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_indexBuffer); } Particle3DQuadRender* Particle3DQuadRender::create(std::string_view texFile) @@ -61,7 +61,7 @@ Particle3DQuadRender* Particle3DQuadRender::create(std::string_view texFile) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -167,8 +167,8 @@ void Particle3DQuadRender::render(Renderer* renderer, const Mat4& transform, Par auto afterCommand = renderer->nextCallbackCommand(); afterCommand->init(depthZ); - beforeCommand->func = [=]() { onBeforeDraw(); }; // CC_CALLBACK_0(Particle3DQuadRender::onBeforeDraw, this); - afterCommand->func = [=]() { onAfterDraw(); }; // CC_CALLBACK_0(Particle3DQuadRender::onAfterDraw, this); + beforeCommand->func = [=]() { onBeforeDraw(); }; // AX_CALLBACK_0(Particle3DQuadRender::onBeforeDraw, this); + afterCommand->func = [=]() { onAfterDraw(); }; // AX_CALLBACK_0(Particle3DQuadRender::onAfterDraw, this); _meshCommand.setVertexBuffer(_vertexBuffer); _meshCommand.setIndexBuffer(_indexBuffer, MeshCommand::IndexFormat::U_SHORT); @@ -193,7 +193,7 @@ void Particle3DQuadRender::render(Renderer* renderer, const Mat4& transform, Par bool Particle3DQuadRender::initQuadRender(std::string_view texFile) { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); if (!texFile.empty()) { diff --git a/extensions/Particle3D/CCParticle3DRender.h b/extensions/Particle3D/CCParticle3DRender.h index eff20b1857..9e2049f0ed 100644 --- a/extensions/Particle3D/CCParticle3DRender.h +++ b/extensions/Particle3D/CCParticle3DRender.h @@ -50,7 +50,7 @@ class Texture2D; /** * 3d particle render */ -class CC_EX_DLL Particle3DRender : public Ref +class AX_EX_DLL Particle3DRender : public Ref { friend class ParticleSystem3D; @@ -92,7 +92,7 @@ protected: }; // particle render for quad -class CC_EX_DLL Particle3DQuadRender : public Particle3DRender +class AX_EX_DLL Particle3DQuadRender : public Particle3DRender { public: static Particle3DQuadRender* create(std::string_view texFile = ""); @@ -142,7 +142,7 @@ protected: }; // particle renderer using MeshRenderer -class CC_EX_DLL Particle3DModelRender : public Particle3DRender +class AX_EX_DLL Particle3DModelRender : public Particle3DRender { public: static Particle3DModelRender* create(std::string_view modelFile, std::string_view texFile = ""); diff --git a/extensions/Particle3D/CCParticleSystem3D.cpp b/extensions/Particle3D/CCParticleSystem3D.cpp index 845cfdac0c..b03c955293 100644 --- a/extensions/Particle3D/CCParticleSystem3D.cpp +++ b/extensions/Particle3D/CCParticleSystem3D.cpp @@ -48,8 +48,8 @@ ParticleSystem3D::~ParticleSystem3D() { // stopParticle(); removeAllAffector(); - CC_SAFE_RELEASE(_emitter); - CC_SAFE_RELEASE(_render); + AX_SAFE_RELEASE(_emitter); + AX_SAFE_RELEASE(_render); } void ParticleSystem3D::startParticleSystem() @@ -96,10 +96,10 @@ void ParticleSystem3D::setEmitter(Particle3DEmitter* emitter) { if (_emitter != emitter) { - CC_SAFE_RELEASE(_emitter); + AX_SAFE_RELEASE(_emitter); emitter->_particleSystem = this; _emitter = emitter; - CC_SAFE_RETAIN(_emitter); + AX_SAFE_RETAIN(_emitter); } } @@ -107,10 +107,10 @@ void ParticleSystem3D::setRender(Particle3DRender* render) { if (_render != render) { - CC_SAFE_RELEASE(_render); + AX_SAFE_RELEASE(_render); _render = render; _render->_particleSystem = this; - CC_SAFE_RETAIN(_render); + AX_SAFE_RETAIN(_render); } } diff --git a/extensions/Particle3D/CCParticleSystem3D.h b/extensions/Particle3D/CCParticleSystem3D.h index fcb0e126d9..4bca820146 100644 --- a/extensions/Particle3D/CCParticleSystem3D.h +++ b/extensions/Particle3D/CCParticleSystem3D.h @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PARTICLE_SYSTEM_3D_H__ -#define __CC_PARTICLE_SYSTEM_3D_H__ +#ifndef __AX_PARTICLE_SYSTEM_3D_H__ +#define __AX_PARTICLE_SYSTEM_3D_H__ #include "2d/CCNode.h" #include "math/CCMath.h" @@ -42,7 +42,7 @@ class Particle3DEmitter; class Particle3DAffector; class Particle3DRender; -struct CC_EX_DLL Particle3D +struct AX_EX_DLL Particle3D { Particle3D(); virtual ~Particle3D(); @@ -61,7 +61,7 @@ struct CC_EX_DLL Particle3D }; template -class CC_EX_DLL DataPool +class AX_EX_DLL DataPool { public: typedef typename std::list PoolList; @@ -157,7 +157,7 @@ private: typedef DataPool ParticlePool; -class CC_EX_DLL ParticleSystem3D : public Node, public BlendProtocol +class AX_EX_DLL ParticleSystem3D : public Node, public BlendProtocol { public: enum class State diff --git a/extensions/Particle3D/PU/CCPUAffector.h b/extensions/Particle3D/PU/CCPUAffector.h index a76f174f62..318aea6c0a 100644 --- a/extensions/Particle3D/PU/CCPUAffector.h +++ b/extensions/Particle3D/PU/CCPUAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_AFFECTOR_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUAffector : public Particle3DAffector +class AX_EX_DLL PUAffector : public Particle3DAffector { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/PU/CCPUAffectorManager.h b/extensions/Particle3D/PU/CCPUAffectorManager.h index 86979b25cc..f98e7261ab 100644 --- a/extensions/Particle3D/PU/CCPUAffectorManager.h +++ b/extensions/Particle3D/PU/CCPUAffectorManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" @@ -59,7 +59,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUAffectorManager +class AX_EX_DLL PUAffectorManager { public: static PUAffectorManager* Instance(); diff --git a/extensions/Particle3D/PU/CCPUAffectorTranslator.h b/extensions/Particle3D/PU/CCPUAffectorTranslator.h index 8abfb0261b..44063be30a 100644 --- a/extensions/Particle3D/PU/CCPUAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUAffectorTranslator : public PUScriptTranslator +class AX_EX_DLL PUAffectorTranslator : public PUScriptTranslator { protected: PUAffector* _affector; diff --git a/extensions/Particle3D/PU/CCPUAlignAffector.h b/extensions/Particle3D/PU/CCPUAlignAffector.h index 478382ac9d..d80beaf57f 100644 --- a/extensions/Particle3D/PU/CCPUAlignAffector.h +++ b/extensions/Particle3D/PU/CCPUAlignAffector.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ALIGN_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_ALIGN_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ALIGN_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_ALIGN_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" NS_AX_BEGIN -class CC_EX_DLL PUAlignAffector : public PUAffector +class AX_EX_DLL PUAlignAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUAlignAffectorTranslator.h b/extensions/Particle3D/PU/CCPUAlignAffectorTranslator.h index f0437c70ef..f80817f7b4 100644 --- a/extensions/Particle3D/PU/CCPUAlignAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUAlignAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ALIGN_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ALIGN_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ALIGN_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ALIGN_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUAlignAffectorTranslator : public PUScriptTranslator +class AX_EX_DLL PUAlignAffectorTranslator : public PUScriptTranslator { public: PUAlignAffectorTranslator(); diff --git a/extensions/Particle3D/PU/CCPUBaseCollider.h b/extensions/Particle3D/PU/CCPUBaseCollider.h index 739c92c621..2f09f89adb 100644 --- a/extensions/Particle3D/PU/CCPUBaseCollider.h +++ b/extensions/Particle3D/PU/CCPUBaseCollider.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BASE_COLLIDER_H__ -#define __CC_PU_PARTICLE_3D_BASE_COLLIDER_H__ +#ifndef __AX_PU_PARTICLE_3D_BASE_COLLIDER_H__ +#define __AX_PU_PARTICLE_3D_BASE_COLLIDER_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "3d/CCAABB.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN struct PUParticle3D; -class CC_EX_DLL PUBaseCollider : public PUAffector +class AX_EX_DLL PUBaseCollider : public PUAffector { public: /** Determines how a particle collision should be determined. IT_POINT means that the position of diff --git a/extensions/Particle3D/PU/CCPUBaseColliderTranslator.h b/extensions/Particle3D/PU/CCPUBaseColliderTranslator.h index cee8a94671..f8dfd22c4e 100644 --- a/extensions/Particle3D/PU/CCPUBaseColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUBaseColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BASE_COLLIDER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_BASE_COLLIDER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_BASE_COLLIDER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_BASE_COLLIDER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUBaseColliderTranslator : public PUScriptTranslator +class AX_EX_DLL PUBaseColliderTranslator : public PUScriptTranslator { public: PUBaseColliderTranslator(); diff --git a/extensions/Particle3D/PU/CCPUBaseForceAffector.h b/extensions/Particle3D/PU/CCPUBaseForceAffector.h index 05358425e1..f7d22b95fa 100644 --- a/extensions/Particle3D/PU/CCPUBaseForceAffector.h +++ b/extensions/Particle3D/PU/CCPUBaseForceAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BASE_FORCE_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_BASE_FORCE_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_BASE_FORCE_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_BASE_FORCE_AFFECTOR_H__ #include "math/CCMath.h" #include "extensions/Particle3D/PU/CCPUAffector.h" NS_AX_BEGIN -class CC_EX_DLL PUBaseForceAffector : public PUAffector +class AX_EX_DLL PUBaseForceAffector : public PUAffector { public: enum ForceApplication diff --git a/extensions/Particle3D/PU/CCPUBaseForceAffectorTranslator.h b/extensions/Particle3D/PU/CCPUBaseForceAffectorTranslator.h index 101eca3c83..339eb635f1 100644 --- a/extensions/Particle3D/PU/CCPUBaseForceAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUBaseForceAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BASE_FORCE_AFFECT_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_BASE_FORCE_AFFECT_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_BASE_FORCE_AFFECT_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_BASE_FORCE_AFFECT_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUBaseForceAffectorTranslator : public PUScriptTranslator +class AX_EX_DLL PUBaseForceAffectorTranslator : public PUScriptTranslator { public: PUBaseForceAffectorTranslator(); diff --git a/extensions/Particle3D/PU/CCPUBeamRender.cpp b/extensions/Particle3D/PU/CCPUBeamRender.cpp index b8696c2be6..6f5e892cb6 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 - CC_SAFE_DELETE(_billboardChain); + AX_SAFE_DELETE(_billboardChain); // Delete the visual data std::vector::const_iterator it; diff --git a/extensions/Particle3D/PU/CCPUBeamRender.h b/extensions/Particle3D/PU/CCPUBeamRender.h index cb567edd5f..56c55bb6c7 100644 --- a/extensions/Particle3D/PU/CCPUBeamRender.h +++ b/extensions/Particle3D/PU/CCPUBeamRender.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BEAM_RENDER_H__ -#define __CC_PU_PARTICLE_3D_BEAM_RENDER_H__ +#ifndef __AX_PU_PARTICLE_3D_BEAM_RENDER_H__ +#define __AX_PU_PARTICLE_3D_BEAM_RENDER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -76,7 +76,7 @@ public: }; // particle render for quad -class CC_EX_DLL PUBeamRender : public PURender, public PUListener +class AX_EX_DLL PUBeamRender : public PURender, public PUListener { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUBehaviour.h b/extensions/Particle3D/PU/CCPUBehaviour.h index 37e5dc4edc..85a1b8b52c 100644 --- a/extensions/Particle3D/PU/CCPUBehaviour.h +++ b/extensions/Particle3D/PU/CCPUBehaviour.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BEHAVIOUR_H__ -#define __CC_PU_PARTICLE_3D_BEHAVIOUR_H__ +#ifndef __AX_PU_PARTICLE_3D_BEHAVIOUR_H__ +#define __AX_PU_PARTICLE_3D_BEHAVIOUR_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUBehaviour : public Ref +class AX_EX_DLL PUBehaviour : public Ref { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/PU/CCPUBehaviourManager.h b/extensions/Particle3D/PU/CCPUBehaviourManager.h index f56d3085d3..3e9081ec59 100644 --- a/extensions/Particle3D/PU/CCPUBehaviourManager.h +++ b/extensions/Particle3D/PU/CCPUBehaviourManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUBehaviourTranslator.h b/extensions/Particle3D/PU/CCPUBehaviourTranslator.h index 7b5a3a91c5..1ea887043b 100644 --- a/extensions/Particle3D/PU/CCPUBehaviourTranslator.h +++ b/extensions/Particle3D/PU/CCPUBehaviourTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BEHAVIOUR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_BEHAVIOUR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_BEHAVIOUR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_BEHAVIOUR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUBillboardChain.cpp b/extensions/Particle3D/PU/CCPUBillboardChain.cpp index fff5ec20ff..4c429d44bf 100644 --- a/extensions/Particle3D/PU/CCPUBillboardChain.cpp +++ b/extensions/Particle3D/PU/CCPUBillboardChain.cpp @@ -91,10 +91,10 @@ PUBillboardChain::PUBillboardChain(std::string_view /*name*/, //----------------------------------------------------------------------- PUBillboardChain::~PUBillboardChain() { - // CC_SAFE_RELEASE(_texture); - CC_SAFE_RELEASE(_programState); - CC_SAFE_RELEASE(_vertexBuffer); - CC_SAFE_RELEASE(_indexBuffer); + // AX_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_indexBuffer); } //----------------------------------------------------------------------- void PUBillboardChain::setupChainContainers() @@ -153,8 +153,8 @@ void PUBillboardChain::setupBuffers() // setupVertexDeclaration(); if (_buffersNeedRecreating) { - CC_SAFE_RELEASE_NULL(_vertexBuffer); - CC_SAFE_RELEASE_NULL(_indexBuffer); + AX_SAFE_RELEASE_NULL(_vertexBuffer); + AX_SAFE_RELEASE_NULL(_indexBuffer); size_t stride = sizeof(VertexInfo); _vertexBuffer = backend::Device::getInstance()->newBuffer( @@ -629,7 +629,7 @@ void PUBillboardChain::updateIndexBuffer() //----------------------------------------------------------------------- void PUBillboardChain::init(std::string_view texFile) { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); if (!texFile.empty()) { @@ -684,8 +684,8 @@ void PUBillboardChain::init(std::string_view texFile) _stateBlock.setCullFaceSide(backend::CullMode::BACK); _stateBlock.setCullFace(true); - _meshCommand.setBeforeCallback(CC_CALLBACK_0(PUBillboardChain::onBeforeDraw, this)); - _meshCommand.setAfterCallback(CC_CALLBACK_0(PUBillboardChain::onAfterDraw, this)); + _meshCommand.setBeforeCallback(AX_CALLBACK_0(PUBillboardChain::onBeforeDraw, this)); + _meshCommand.setAfterCallback(AX_CALLBACK_0(PUBillboardChain::onAfterDraw, this)); } void PUBillboardChain::render(Renderer* renderer, const Mat4& transform, ParticleSystem3D* particleSystem) diff --git a/extensions/Particle3D/PU/CCPUBoxCollider.h b/extensions/Particle3D/PU/CCPUBoxCollider.h index 7fb7f3f90e..e2b37a8727 100644 --- a/extensions/Particle3D/PU/CCPUBoxCollider.h +++ b/extensions/Particle3D/PU/CCPUBoxCollider.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BOX_COLLIDER_H__ -#define __CC_PU_PARTICLE_3D_BOX_COLLIDER_H__ +#ifndef __AX_PU_PARTICLE_3D_BOX_COLLIDER_H__ +#define __AX_PU_PARTICLE_3D_BOX_COLLIDER_H__ #include "CCPUBaseCollider.h" NS_AX_BEGIN -class CC_EX_DLL PUBoxCollider : public PUBaseCollider +class AX_EX_DLL PUBoxCollider : public PUBaseCollider { public: static const float DEFAULT_WIDTH; diff --git a/extensions/Particle3D/PU/CCPUBoxColliderTranslator.h b/extensions/Particle3D/PU/CCPUBoxColliderTranslator.h index 943108edca..5546a359a4 100644 --- a/extensions/Particle3D/PU/CCPUBoxColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUBoxColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BOX_COLLIDER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_BOX_COLLIDER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_BOX_COLLIDER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_BOX_COLLIDER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUBoxEmitter.h b/extensions/Particle3D/PU/CCPUBoxEmitter.h index 146c65fcef..1689c5d720 100644 --- a/extensions/Particle3D/PU/CCPUBoxEmitter.h +++ b/extensions/Particle3D/PU/CCPUBoxEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BOX_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_BOX_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_BOX_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_BOX_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class CC_EX_DLL CCPUBoxEmitter : public PUEmitter +class AX_EX_DLL CCPUBoxEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUBoxEmitterTranslator.h b/extensions/Particle3D/PU/CCPUBoxEmitterTranslator.h index 8c35623e86..282b24cac1 100644 --- a/extensions/Particle3D/PU/CCPUBoxEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUBoxEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_BOX_EMITTER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_BOX_EMITTER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_BOX_EMITTER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_BOX_EMITTER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUCircleEmitter.h b/extensions/Particle3D/PU/CCPUCircleEmitter.h index e101d3c3e5..641899e73c 100644 --- a/extensions/Particle3D/PU/CCPUCircleEmitter.h +++ b/extensions/Particle3D/PU/CCPUCircleEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_CIRCLE_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_CIRCLE_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_CIRCLE_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_CIRCLE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class CC_EX_DLL PUCircleEmitter : public PUEmitter +class AX_EX_DLL PUCircleEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUCircleEmitterTranslator.h b/extensions/Particle3D/PU/CCPUCircleEmitterTranslator.h index 5e03d54b00..d64b03f955 100644 --- a/extensions/Particle3D/PU/CCPUCircleEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUCircleEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_CIRCLE_EMITTER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_CIRCLE_EMITTER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_CIRCLE_EMITTER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_CIRCLE_EMITTER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.h b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.h index 0ce443269f..7c0eceab35 100644 --- a/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.h +++ b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffector.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" NS_AX_BEGIN -class CC_EX_DLL PUCollisionAvoidanceAffector : public PUAffector +class AX_EX_DLL PUCollisionAvoidanceAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffectorTranslator.h b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffectorTranslator.h index bb16906a5c..1060648226 100644 --- a/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUCollisionAvoidanceAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_COLLISION_AVOIDDANCE_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUColorAffector.h b/extensions/Particle3D/PU/CCPUColorAffector.h index e9ae4841d0..3b680de222 100644 --- a/extensions/Particle3D/PU/CCPUColorAffector.h +++ b/extensions/Particle3D/PU/CCPUColorAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_COLOR_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_COLOR_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_COLOR_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_COLOR_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUColorAffector : public PUAffector +class AX_EX_DLL PUColorAffector : public PUAffector { public: typedef std::map ColorMap; diff --git a/extensions/Particle3D/PU/CCPUColorAffectorTranslator.h b/extensions/Particle3D/PU/CCPUColorAffectorTranslator.h index 2fe9683a64..d9d65741ab 100644 --- a/extensions/Particle3D/PU/CCPUColorAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUColorAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_COLOR_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_COLOR_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_COLOR_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_COLOR_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoAffectorEventHandler.h b/extensions/Particle3D/PU/CCPUDoAffectorEventHandler.h index f0770e81dc..16aa6d3bcc 100644 --- a/extensions/Particle3D/PU/CCPUDoAffectorEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoAffectorEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ struct PUParticle3D; class PUObserver; class PUParticleSystem3D; -class CC_EX_DLL PUDoAffectorEventHandler : public PUEventHandler +class AX_EX_DLL PUDoAffectorEventHandler : public PUEventHandler { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUDoAffectorEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoAffectorEventHandlerTranslator.h index 2595f85277..b380e5e7d3 100644 --- a/extensions/Particle3D/PU/CCPUDoAffectorEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoAffectorEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandler.h b/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandler.h index 3404cd65c3..5cc64a9361 100644 --- a/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -40,7 +40,7 @@ struct PUParticle3D; class PUObserver; class PUParticleSystem3D; -class CC_EX_DLL PUDoEnableComponentEventHandler : public PUEventHandler +class AX_EX_DLL PUDoEnableComponentEventHandler : public PUEventHandler { public: static PUDoEnableComponentEventHandler* create(); diff --git a/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandlerTranslator.h index deaa3a711d..9c6bd55f68 100644 --- a/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoEnableComponentEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoExpireEventHandler.h b/extensions/Particle3D/PU/CCPUDoExpireEventHandler.h index 97780aada0..29f44d89f9 100644 --- a/extensions/Particle3D/PU/CCPUDoExpireEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoExpireEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ struct PUParticle3D; class PUObserver; class PUParticleSystem3D; -class CC_EX_DLL PUDoExpireEventHandler : public PUEventHandler +class AX_EX_DLL PUDoExpireEventHandler : public PUEventHandler { public: static PUDoExpireEventHandler* create(); diff --git a/extensions/Particle3D/PU/CCPUDoExpireEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoExpireEventHandlerTranslator.h index ebbeafe75f..1ed398c8f1 100644 --- a/extensions/Particle3D/PU/CCPUDoExpireEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoExpireEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoFreezeEventHandler.h b/extensions/Particle3D/PU/CCPUDoFreezeEventHandler.h index ec2d6b41ff..b818002fbd 100644 --- a/extensions/Particle3D/PU/CCPUDoFreezeEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoFreezeEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ struct PUParticle3D; class PUObserver; class PUParticleSystem3D; -class CC_EX_DLL PUDoFreezeEventHandler : public PUEventHandler +class AX_EX_DLL PUDoFreezeEventHandler : public PUEventHandler { public: static PUDoFreezeEventHandler* create(); diff --git a/extensions/Particle3D/PU/CCPUDoFreezeEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoFreezeEventHandlerTranslator.h index 343b8dab3b..f76f7d9ebf 100644 --- a/extensions/Particle3D/PU/CCPUDoFreezeEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoFreezeEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandler.h b/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandler.h index 2ef7910abe..99d985eb41 100644 --- a/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -41,7 +41,7 @@ class PUObserver; class PUEmitter; class PUParticleSystem3D; -class CC_EX_DLL PUDoPlacementParticleEventHandler : public PUEventHandler, public PUListener +class AX_EX_DLL PUDoPlacementParticleEventHandler : public PUEventHandler, public PUListener { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandlerTranslator.h index 0e7fedb4e9..989373b1f6 100644 --- a/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoPlacementParticleEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoScaleEventHandler.h b/extensions/Particle3D/PU/CCPUDoScaleEventHandler.h index 1ac2fdf61f..a0661b5a1b 100644 --- a/extensions/Particle3D/PU/CCPUDoScaleEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoScaleEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUDoScaleEventHandler : public PUEventHandler +class AX_EX_DLL PUDoScaleEventHandler : public PUEventHandler { public: enum ScaleType diff --git a/extensions/Particle3D/PU/CCPUDoScaleEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoScaleEventHandlerTranslator.h index 6454f543eb..1d33d1e00b 100644 --- a/extensions/Particle3D/PU/CCPUDoScaleEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoScaleEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDoStopSystemEventHandler.h b/extensions/Particle3D/PU/CCPUDoStopSystemEventHandler.h index 1dcde9f3bb..3f9febdd0b 100644 --- a/extensions/Particle3D/PU/CCPUDoStopSystemEventHandler.h +++ b/extensions/Particle3D/PU/CCPUDoStopSystemEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_STOP_SYSTEM_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_DO_STOP_SYSTEM_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_STOP_SYSTEM_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_DO_STOP_SYSTEM_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ struct PUParticle3D; class PUObserver; class PUParticleSystem3D; -class CC_EX_DLL PUDoStopSystemEventHandler : public PUEventHandler +class AX_EX_DLL PUDoStopSystemEventHandler : public PUEventHandler { protected: public: diff --git a/extensions/Particle3D/PU/CCPUDoStopSystemEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUDoStopSystemEventHandlerTranslator.h index 0b9d6e818b..8236934efe 100644 --- a/extensions/Particle3D/PU/CCPUDoStopSystemEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUDoStopSystemEventHandlerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_STOP_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_STOP_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_STOP_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_STOP_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUDynamicAttribute.h b/extensions/Particle3D/PU/CCPUDynamicAttribute.h index 5bbeec74e1..67495e0201 100644 --- a/extensions/Particle3D/PU/CCPUDynamicAttribute.h +++ b/extensions/Particle3D/PU/CCPUDynamicAttribute.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_H__ -#define __CC_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_H__ +#ifndef __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_H__ +#define __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -57,7 +57,7 @@ struct PUControlPointSorter but where implementation of this behaviour may not be scattered or duplicated within the application that needs it. */ -class CC_EX_DLL PUDynamicAttribute : public Ref +class AX_EX_DLL PUDynamicAttribute : public Ref { public: enum DynamicAttributeType @@ -106,7 +106,7 @@ protected: Although use of a regular attribute within the class that needs it is preferred, its benefit is that it makes use of the generic 'getValue' mechanism of a DynamicAttribute. */ -class CC_EX_DLL PUDynamicAttributeFixed : public PUDynamicAttribute +class AX_EX_DLL PUDynamicAttributeFixed : public PUDynamicAttribute { public: /** Constructor @@ -138,7 +138,7 @@ protected: /* This class generates random values within a given minimum and maximum interval. */ -class CC_EX_DLL PUDynamicAttributeRandom : public PUDynamicAttribute +class AX_EX_DLL PUDynamicAttributeRandom : public PUDynamicAttribute { public: /** Constructor @@ -178,7 +178,7 @@ protected: on these control points. Interpolation is done in different flavours. linear?provides linear interpolation of a value on the curve, while spline?generates a smooth curve and the returns a value that lies on that curve. */ -class CC_EX_DLL PUDynamicAttributeCurved : public PUDynamicAttribute +class AX_EX_DLL PUDynamicAttributeCurved : public PUDynamicAttribute { public: typedef std::vector ControlPointList; @@ -257,7 +257,7 @@ protected: /* This class generates values based on an oscillating function (i.e. Sine). */ -class CC_EX_DLL PUDynamicAttributeOscillate : public PUDynamicAttribute +class AX_EX_DLL PUDynamicAttributeOscillate : public PUDynamicAttribute { public: enum OscillationType diff --git a/extensions/Particle3D/PU/CCPUDynamicAttributeTranslator.h b/extensions/Particle3D/PU/CCPUDynamicAttributeTranslator.h index b26412e3c0..2b044cb113 100644 --- a/extensions/Particle3D/PU/CCPUDynamicAttributeTranslator.h +++ b/extensions/Particle3D/PU/CCPUDynamicAttributeTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUEmitter.cpp b/extensions/Particle3D/PU/CCPUEmitter.cpp index b25a5414ac..7f78c6524a 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 = CC_DEGREES_TO_RADIANS(_dynamicAttributeHelper.calculate( + float a = AX_DEGREES_TO_RADIANS(_dynamicAttributeHelper.calculate( _dynAngle, (static_cast(_particleSystem))->getTimeElapsedSinceStart())); angle = a; if (_dynAngle->getType() == PUDynamicAttribute::DAT_FIXED) diff --git a/extensions/Particle3D/PU/CCPUEmitter.h b/extensions/Particle3D/PU/CCPUEmitter.h index 6eadc7f9f6..ff9c78e5d4 100644 --- a/extensions/Particle3D/PU/CCPUEmitter.h +++ b/extensions/Particle3D/PU/CCPUEmitter.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_EMITTER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -41,7 +41,7 @@ class PUParticleSystem3D; /** * 3d particle emitter */ -class CC_EX_DLL PUEmitter : public Particle3DEmitter +class AX_EX_DLL PUEmitter : public Particle3DEmitter { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/PU/CCPUEmitterManager.h b/extensions/Particle3D/PU/CCPUEmitterManager.h index d302e6dc2a..79bd13f291 100644 --- a/extensions/Particle3D/PU/CCPUEmitterManager.h +++ b/extensions/Particle3D/PU/CCPUEmitterManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_EMITTER_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_EMITTER_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_EMITTER_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_EMITTER_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUEmitterTranslator.h b/extensions/Particle3D/PU/CCPUEmitterTranslator.h index 676ed8afd4..b5a46e81bf 100644 --- a/extensions/Particle3D/PU/CCPUEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_EMITTER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_EMITTER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_EMITTER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_EMITTER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUEventHandler.h b/extensions/Particle3D/PU/CCPUEventHandler.h index e5bb16c050..c0f037dc37 100644 --- a/extensions/Particle3D/PU/CCPUEventHandler.h +++ b/extensions/Particle3D/PU/CCPUEventHandler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_EVENT_HANDLER_H__ -#define __CC_PU_PARTICLE_3D_EVENT_HANDLER_H__ +#ifndef __AX_PU_PARTICLE_3D_EVENT_HANDLER_H__ +#define __AX_PU_PARTICLE_3D_EVENT_HANDLER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ struct PUParticle3D; class PUObserver; class PUParticleSystem3D; -class CC_EX_DLL PUEventHandler : public Ref +class AX_EX_DLL PUEventHandler : public Ref { public: /** Todo diff --git a/extensions/Particle3D/PU/CCPUEventHandlerManager.h b/extensions/Particle3D/PU/CCPUEventHandlerManager.h index 26052cb8b9..03b51b1d00 100644 --- a/extensions/Particle3D/PU/CCPUEventHandlerManager.h +++ b/extensions/Particle3D/PU/CCPUEventHandlerManager.h @@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_EVENT_HANDLER_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_EVENT_HANDLER_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_EVENT_HANDLER_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_EVENT_HANDLER_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUEventHandlerTranslator.h b/extensions/Particle3D/PU/CCPUEventHandlerTranslator.h index 769aecdf96..e6c906de8d 100644 --- a/extensions/Particle3D/PU/CCPUEventHandlerTranslator.h +++ b/extensions/Particle3D/PU/CCPUEventHandlerTranslator.h @@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_EVENT_HANDLER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_EVENT_HANDLER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_EVENT_HANDLER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUFlockCenteringAffector.h b/extensions/Particle3D/PU/CCPUFlockCenteringAffector.h index 0910d16caa..e1221283f5 100644 --- a/extensions/Particle3D/PU/CCPUFlockCenteringAffector.h +++ b/extensions/Particle3D/PU/CCPUFlockCenteringAffector.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_H__ #include "Particle3D/PU/CCPUAffector.h" NS_AX_BEGIN -class CC_EX_DLL PUFlockCenteringAffector : public PUAffector +class AX_EX_DLL PUFlockCenteringAffector : public PUAffector { public: static PUFlockCenteringAffector* create(); diff --git a/extensions/Particle3D/PU/CCPUFlockCenteringAffectorTranslator.h b/extensions/Particle3D/PU/CCPUFlockCenteringAffectorTranslator.h index 2c6e0cfd48..8fe55887ad 100644 --- a/extensions/Particle3D/PU/CCPUFlockCenteringAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUFlockCenteringAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_FLOCK_CENTERING_AFFECTOR_TRANSLATOR_H__ #include "Particle3D/PU/CCPUScriptTranslator.h" #include "Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUForceField.h b/extensions/Particle3D/PU/CCPUForceField.h index ca6b58e7c4..2f0f622bce 100644 --- a/extensions/Particle3D/PU/CCPUForceField.h +++ b/extensions/Particle3D/PU/CCPUForceField.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_FORCE_FIELD_H__ -#define __CC_PU_PARTICLE_3D_FORCE_FIELD_H__ +#ifndef __AX_PU_PARTICLE_3D_FORCE_FIELD_H__ +#define __AX_PU_PARTICLE_3D_FORCE_FIELD_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPUForceFieldAffector.h b/extensions/Particle3D/PU/CCPUForceFieldAffector.h index 7f05f23862..2a93f26aa4 100644 --- a/extensions/Particle3D/PU/CCPUForceFieldAffector.h +++ b/extensions/Particle3D/PU/CCPUForceFieldAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUForceField.h" NS_AX_BEGIN -class CC_EX_DLL PUForceFieldAffector : public PUAffector +class AX_EX_DLL PUForceFieldAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUForceFieldAffectorTranslator.h b/extensions/Particle3D/PU/CCPUForceFieldAffectorTranslator.h index 7344b7c2ab..9f454bfcc3 100644 --- a/extensions/Particle3D/PU/CCPUForceFieldAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUForceFieldAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_FORCE_FIELD_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUGeometryRotator.cpp b/extensions/Particle3D/PU/CCPUGeometryRotator.cpp index 76723b21c2..a7ec9cf0fc 100644 --- a/extensions/Particle3D/PU/CCPUGeometryRotator.cpp +++ b/extensions/Particle3D/PU/CCPUGeometryRotator.cpp @@ -51,7 +51,7 @@ PUGeometryRotator::PUGeometryRotator() PUGeometryRotator::~PUGeometryRotator() { if (_dynRotationSpeed) - CC_SAFE_DELETE(_dynRotationSpeed); + AX_SAFE_DELETE(_dynRotationSpeed); } //----------------------------------------------------------------------- const Vec3& PUGeometryRotator::getRotationAxis() const @@ -80,7 +80,7 @@ PUDynamicAttribute* PUGeometryRotator::getRotationSpeed() const void PUGeometryRotator::setRotationSpeed(PUDynamicAttribute* dynRotationSpeed) { if (_dynRotationSpeed) - CC_SAFE_DELETE(_dynRotationSpeed); + AX_SAFE_DELETE(_dynRotationSpeed); _dynRotationSpeed = dynRotationSpeed; } //----------------------------------------------------------------------- diff --git a/extensions/Particle3D/PU/CCPUGeometryRotator.h b/extensions/Particle3D/PU/CCPUGeometryRotator.h index a2d22fcbf5..980fb0688b 100644 --- a/extensions/Particle3D/PU/CCPUGeometryRotator.h +++ b/extensions/Particle3D/PU/CCPUGeometryRotator.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_GEOMETRY_ROTATOR_H__ -#define __CC_PU_PARTICLE_3D_GEOMETRY_ROTATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_GEOMETRY_ROTATOR_H__ +#define __AX_PU_PARTICLE_3D_GEOMETRY_ROTATOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" NS_AX_BEGIN struct PUParticle3D; -class CC_EX_DLL PUGeometryRotator : public PUAffector +class AX_EX_DLL PUGeometryRotator : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUGeometryRotatorTranslator.h b/extensions/Particle3D/PU/CCPUGeometryRotatorTranslator.h index 4459bb9c3d..c42396cfa1 100644 --- a/extensions/Particle3D/PU/CCPUGeometryRotatorTranslator.h +++ b/extensions/Particle3D/PU/CCPUGeometryRotatorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_GEOMETRY_ROTATOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_GEOMETRY_ROTATOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_GEOMETRY_ROTATOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_GEOMETRY_ROTATOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUGravityAffector.h b/extensions/Particle3D/PU/CCPUGravityAffector.h index 0f7f651507..124bdd2c3f 100644 --- a/extensions/Particle3D/PU/CCPUGravityAffector.h +++ b/extensions/Particle3D/PU/CCPUGravityAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_GRAVITY_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_GRAVITY_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_GRAVITY_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_GRAVITY_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PUGravityAffector : public PUAffector +class AX_EX_DLL PUGravityAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUGravityAffectorTranslator.h b/extensions/Particle3D/PU/CCPUGravityAffectorTranslator.h index f8c89c5f29..c02768f3f3 100644 --- a/extensions/Particle3D/PU/CCPUGravityAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUGravityAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_GRAVITY_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_GRAVITY_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_GRAVITY_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_GRAVITY_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUInterParticleCollider.h b/extensions/Particle3D/PU/CCPUInterParticleCollider.h index 15aac1489d..9906b67697 100644 --- a/extensions/Particle3D/PU/CCPUInterParticleCollider.h +++ b/extensions/Particle3D/PU/CCPUInterParticleCollider.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_H__ -#define __CC_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_H__ +#ifndef __AX_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_H__ +#define __AX_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_H__ #include "CCPUBaseCollider.h" #include "base/ccTypes.h" NS_AX_BEGIN struct PUParticle3D; -class CC_EX_DLL PUParticle3DInterParticleCollider : public PUBaseCollider +class AX_EX_DLL PUParticle3DInterParticleCollider : public PUBaseCollider { public: enum InterParticleCollisionResponse diff --git a/extensions/Particle3D/PU/CCPUInterParticleColliderTranslator.h b/extensions/Particle3D/PU/CCPUInterParticleColliderTranslator.h index bcdb5ded08..ef3c858338 100644 --- a/extensions/Particle3D/PU/CCPUInterParticleColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUInterParticleColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_INNER_PARTICLE_COLLIDER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUJetAffector.cpp b/extensions/Particle3D/PU/CCPUJetAffector.cpp index 08ba3ffd08..f5d428375f 100644 --- a/extensions/Particle3D/PU/CCPUJetAffector.cpp +++ b/extensions/Particle3D/PU/CCPUJetAffector.cpp @@ -44,14 +44,14 @@ PUJetAffector::~PUJetAffector() if (!_dynAcceleration) return; - CC_SAFE_DELETE(_dynAcceleration); + AX_SAFE_DELETE(_dynAcceleration); _dynAcceleration = 0; } //----------------------------------------------------------------------- void PUJetAffector::setDynAcceleration(PUDynamicAttribute* dynAcceleration) { if (_dynAcceleration) - CC_SAFE_DELETE(_dynAcceleration); + AX_SAFE_DELETE(_dynAcceleration); _dynAcceleration = dynAcceleration; } diff --git a/extensions/Particle3D/PU/CCPUJetAffector.h b/extensions/Particle3D/PU/CCPUJetAffector.h index 656ef3d7a9..0a35e09663 100644 --- a/extensions/Particle3D/PU/CCPUJetAffector.h +++ b/extensions/Particle3D/PU/CCPUJetAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_JET_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_JET_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_JET_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_JET_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUJetAffector : public PUAffector +class AX_EX_DLL PUJetAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUJetAffectorTranslator.h b/extensions/Particle3D/PU/CCPUJetAffectorTranslator.h index 18642ca58f..034ceeea67 100644 --- a/extensions/Particle3D/PU/CCPUJetAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUJetAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_JET_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_JET_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_JET_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_JET_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPULineAffector.h b/extensions/Particle3D/PU/CCPULineAffector.h index 150fa8deb7..3d63d60a2f 100644 --- a/extensions/Particle3D/PU/CCPULineAffector.h +++ b/extensions/Particle3D/PU/CCPULineAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LINE_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_LINE_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_LINE_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_LINE_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PULineAffector : public PUAffector +class AX_EX_DLL PULineAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPULineAffectorTranslator.h b/extensions/Particle3D/PU/CCPULineAffectorTranslator.h index 70294a4bbb..6ed17311c8 100644 --- a/extensions/Particle3D/PU/CCPULineAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPULineAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LINE_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_LINE_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_LINE_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_LINE_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPULineEmitter.h b/extensions/Particle3D/PU/CCPULineEmitter.h index 118b825035..fe1ec7bb85 100644 --- a/extensions/Particle3D/PU/CCPULineEmitter.h +++ b/extensions/Particle3D/PU/CCPULineEmitter.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LINE_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_LINE_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_LINE_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_LINE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN struct PUParticle3D; -class CC_EX_DLL PULineEmitter : public PUEmitter +class AX_EX_DLL PULineEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPULineEmitterTranslator.h b/extensions/Particle3D/PU/CCPULineEmitterTranslator.h index 7e51a8217d..e8f5dd211e 100644 --- a/extensions/Particle3D/PU/CCPULineEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPULineEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LINE_EMITTER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_LINE_EMITTER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_LINE_EMITTER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_LINE_EMITTER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPULinearForceAffector.h b/extensions/Particle3D/PU/CCPULinearForceAffector.h index 5800a6ad40..73bf1078b6 100644 --- a/extensions/Particle3D/PU/CCPULinearForceAffector.h +++ b/extensions/Particle3D/PU/CCPULinearForceAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_H__ #include "CCPUBaseForceAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PULinearForceAffector : public PUBaseForceAffector +class AX_EX_DLL PULinearForceAffector : public PUBaseForceAffector { public: static PULinearForceAffector* create(); diff --git a/extensions/Particle3D/PU/CCPULinearForceAffectorTranslator.h b/extensions/Particle3D/PU/CCPULinearForceAffectorTranslator.h index 98ab3296e9..9d5ba25793 100644 --- a/extensions/Particle3D/PU/CCPULinearForceAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPULinearForceAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_LINEAR_FORCE_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUListener.h b/extensions/Particle3D/PU/CCPUListener.h index e50e365f14..16b2a7ebf7 100644 --- a/extensions/Particle3D/PU/CCPUListener.h +++ b/extensions/Particle3D/PU/CCPUListener.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_LISTENER_H__ -#define __CC_PU_PARTICLE_3D_LISTENER_H__ +#ifndef __AX_PU_PARTICLE_3D_LISTENER_H__ +#define __AX_PU_PARTICLE_3D_LISTENER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUListener +class AX_EX_DLL PUListener { public: PUListener(); diff --git a/extensions/Particle3D/PU/CCPUMaterialManager.cpp b/extensions/Particle3D/PU/CCPUMaterialManager.cpp index c5f40e0332..adcefd9f2b 100644 --- a/extensions/Particle3D/PU/CCPUMaterialManager.cpp +++ b/extensions/Particle3D/PU/CCPUMaterialManager.cpp @@ -31,14 +31,14 @@ #include "platform/CCPlatformMacros.h" #include "renderer/backend/Types.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "platform/android/CCFileUtils-android.h" # include -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # include -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) # include # include # include @@ -116,7 +116,7 @@ void PUMaterialCache::addMaterial(PUMaterial* material) _materialMap.push_back(material); } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) int iterPath(const char* fpath, const struct stat* /*sb*/, int typeflag) { if (typeflag == FTW_F) @@ -131,7 +131,7 @@ int iterPath(const char* fpath, const struct stat* /*sb*/, int typeflag) bool PUMaterialCache::loadMaterialsFromSearchPaths(std::string_view fileFolder) { bool state = false; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_WINRT) std::string seg("/"); std::string fullPath{fileFolder}; fullPath += seg; @@ -149,7 +149,7 @@ bool PUMaterialCache::loadMaterialsFromSearchPaths(std::string_view fileFolder) state = true; } _findclose(handle); -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID /* || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX*/) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID /* || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX*/) std::string::size_type pos = fileFolder.find("assets/"); std::string_view relativePath = fileFolder; if (pos != std::string::npos) @@ -171,9 +171,9 @@ bool PUMaterialCache::loadMaterialsFromSearchPaths(std::string_view fileFolder) } AAssetDir_close(dir); -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) ftw(fileFolder.data(), iterPath, 500); -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX || AX_TARGET_PLATFORM == AX_PLATFORM_TIZEN) DIR* d; // dir handle struct dirent* file; // readdir struct stat statbuf; diff --git a/extensions/Particle3D/PU/CCPUMaterialManager.h b/extensions/Particle3D/PU/CCPUMaterialManager.h index 168da5ffc2..cbaf2fb499 100644 --- a/extensions/Particle3D/PU/CCPUMaterialManager.h +++ b/extensions/Particle3D/PU/CCPUMaterialManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_MATERIAL_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_MATERIAL_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_MATERIAL_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_MATERIAL_MANAGER_H__ #include "math/CCMath.h" #include "base/ccTypes.h" #include @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUMaterial : public Ref +class AX_EX_DLL PUMaterial : public Ref { public: PUMaterial(); @@ -55,7 +55,7 @@ public: backend::SamplerAddressMode wrapMode; }; -class CC_EX_DLL PUMaterialCache +class AX_EX_DLL PUMaterialCache { public: PUMaterialCache(); diff --git a/extensions/Particle3D/PU/CCPUMaterialTranslator.h b/extensions/Particle3D/PU/CCPUMaterialTranslator.h index cebb718beb..7c681b0a0d 100644 --- a/extensions/Particle3D/PU/CCPUMaterialTranslator.h +++ b/extensions/Particle3D/PU/CCPUMaterialTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_MATERIAL_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_MATERIAL_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_MATERIAL_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_MATERIAL_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.cpp b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.cpp index deb58d8a3b..c007df054b 100644 --- a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.cpp +++ b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.cpp @@ -418,7 +418,7 @@ PUMeshSurfaceEmitter::~PUMeshSurfaceEmitter() { if (_meshInfo) { - CC_SAFE_DELETE(_meshInfo); + AX_SAFE_DELETE(_meshInfo); } } //----------------------------------------------------------------------- @@ -569,7 +569,7 @@ void PUMeshSurfaceEmitter::build() // Delete the mesh info if already existing if (_meshInfo) { - CC_SAFE_DELETE(_meshInfo); + AX_SAFE_DELETE(_meshInfo); } // Generate meshinfo. diff --git a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.h b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.h index ab62c87d01..63b7bcee71 100644 --- a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.h +++ b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitter.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_MESH_SURFACE_EMITTER_H__ -#define __CC_PU_PARTICLE_MESH_SURFACE_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_MESH_SURFACE_EMITTER_H__ +#define __AX_PU_PARTICLE_MESH_SURFACE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" @@ -162,7 +162,7 @@ protected: It is also possible to define whether more particles emit on larger faces. */ -class CC_EX_DLL PUMeshSurfaceEmitter : public PUEmitter +class AX_EX_DLL PUMeshSurfaceEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitterTranslator.h b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitterTranslator.h index 521a43192d..d681a335d0 100644 --- a/extensions/Particle3D/PU/CCPUMeshSurfaceEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUMeshSurfaceEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_MESH_SURFACE_EMITTER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_MESH_SURFACE_EMITTER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_MESH_SURFACE_EMITTER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_MESH_SURFACE_EMITTER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUNoise.h b/extensions/Particle3D/PU/CCPUNoise.h index f070b0dfd0..dea4b3342b 100644 --- a/extensions/Particle3D/PU/CCPUNoise.h +++ b/extensions/Particle3D/PU/CCPUNoise.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_NOISE_H__ -#define __CC_PU_PARTICLE_3D_NOISE_H__ +#ifndef __AX_PU_PARTICLE_3D_NOISE_H__ +#define __AX_PU_PARTICLE_3D_NOISE_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPUObserver.h b/extensions/Particle3D/PU/CCPUObserver.h index a82a984979..aacdb7dcb5 100644 --- a/extensions/Particle3D/PU/CCPUObserver.h +++ b/extensions/Particle3D/PU/CCPUObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -46,7 +46,7 @@ enum PUComparisionOperator CO_GREATER_THAN }; -class CC_EX_DLL PUObserver : public Ref +class AX_EX_DLL PUObserver : public Ref { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/PU/CCPUObserverManager.h b/extensions/Particle3D/PU/CCPUObserverManager.h index 1373c6a2d5..4b0b3d9502 100644 --- a/extensions/Particle3D/PU/CCPUObserverManager.h +++ b/extensions/Particle3D/PU/CCPUObserverManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_OBSERVER_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_OBSERVER_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_OBSERVER_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_OBSERVER_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUObserverTranslator.h b/extensions/Particle3D/PU/CCPUObserverTranslator.h index 5bb7f5d0c1..14f06104db 100644 --- a/extensions/Particle3D/PU/CCPUObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnClearObserver.h b/extensions/Particle3D/PU/CCPUOnClearObserver.h index 812d0623ad..ab5a5ac4ff 100644 --- a/extensions/Particle3D/PU/CCPUOnClearObserver.h +++ b/extensions/Particle3D/PU/CCPUOnClearObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnClearObserver : public PUObserver +class AX_EX_DLL PUOnClearObserver : public PUObserver { public: static PUOnClearObserver* create(); diff --git a/extensions/Particle3D/PU/CCPUOnClearObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnClearObserverTranslator.h index cc684ae8e1..f8fcd1a6b2 100644 --- a/extensions/Particle3D/PU/CCPUOnClearObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnClearObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnCollisionObserver.h b/extensions/Particle3D/PU/CCPUOnCollisionObserver.h index 97268414b0..c60a1a1e17 100644 --- a/extensions/Particle3D/PU/CCPUOnCollisionObserver.h +++ b/extensions/Particle3D/PU/CCPUOnCollisionObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -36,7 +36,7 @@ NS_AX_BEGIN struct PUParticle3D; -class CC_EX_DLL PUOnCollisionObserver : public PUObserver +class AX_EX_DLL PUOnCollisionObserver : public PUObserver { public: static PUOnCollisionObserver* create(); diff --git a/extensions/Particle3D/PU/CCPUOnCollisionObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnCollisionObserverTranslator.h index daa40aa245..f4327566ca 100644 --- a/extensions/Particle3D/PU/CCPUOnCollisionObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnCollisionObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnCountObserver.h b/extensions/Particle3D/PU/CCPUOnCountObserver.h index 51f090c08a..3ce7468d4d 100644 --- a/extensions/Particle3D/PU/CCPUOnCountObserver.h +++ b/extensions/Particle3D/PU/CCPUOnCountObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_COUNT_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_COUNT_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnCountObserver : public PUObserver +class AX_EX_DLL PUOnCountObserver : public PUObserver { protected: unsigned int _count; diff --git a/extensions/Particle3D/PU/CCPUOnCountObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnCountObserverTranslator.h index e7101752ee..f4affba5e7 100644 --- a/extensions/Particle3D/PU/CCPUOnCountObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnCountObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_COUNT_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_COUNT_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnEmissionObserver.h b/extensions/Particle3D/PU/CCPUOnEmissionObserver.h index 7988ab4d35..ff527bc748 100644 --- a/extensions/Particle3D/PU/CCPUOnEmissionObserver.h +++ b/extensions/Particle3D/PU/CCPUOnEmissionObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnEmissionObserver : public PUObserver +class AX_EX_DLL PUOnEmissionObserver : public PUObserver { public: static PUOnEmissionObserver* create(); diff --git a/extensions/Particle3D/PU/CCPUOnEmissionObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnEmissionObserverTranslator.h index 0f2deea70c..7ec67da5bf 100644 --- a/extensions/Particle3D/PU/CCPUOnEmissionObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnEmissionObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnEventFlagObserver.h b/extensions/Particle3D/PU/CCPUOnEventFlagObserver.h index acdf443a54..9d072d274d 100644 --- a/extensions/Particle3D/PU/CCPUOnEventFlagObserver.h +++ b/extensions/Particle3D/PU/CCPUOnEventFlagObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnEventFlagObserver : public PUObserver +class AX_EX_DLL PUOnEventFlagObserver : public PUObserver { protected: unsigned int _eventFlag; diff --git a/extensions/Particle3D/PU/CCPUOnEventFlagObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnEventFlagObserverTranslator.h index 3cd35ba067..dc3f7001d6 100644 --- a/extensions/Particle3D/PU/CCPUOnEventFlagObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnEventFlagObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnExpireObserver.h b/extensions/Particle3D/PU/CCPUOnExpireObserver.h index 04f917a2a6..042f9124aa 100644 --- a/extensions/Particle3D/PU/CCPUOnExpireObserver.h +++ b/extensions/Particle3D/PU/CCPUOnExpireObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnExpireObserver : public PUObserver +class AX_EX_DLL PUOnExpireObserver : public PUObserver { protected: public: diff --git a/extensions/Particle3D/PU/CCPUOnExpireObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnExpireObserverTranslator.h index 9b61294092..7147be55cf 100644 --- a/extensions/Particle3D/PU/CCPUOnExpireObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnExpireObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnPositionObserver.h b/extensions/Particle3D/PU/CCPUOnPositionObserver.h index 55192e099f..2af387cc87 100644 --- a/extensions/Particle3D/PU/CCPUOnPositionObserver.h +++ b/extensions/Particle3D/PU/CCPUOnPositionObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_POSITION_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_POSITION_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnPositionObserver : public PUObserver +class AX_EX_DLL PUOnPositionObserver : public PUObserver { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUOnPositionObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnPositionObserverTranslator.h index caae34f7b0..f7b3b96a48 100644 --- a/extensions/Particle3D/PU/CCPUOnPositionObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnPositionObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_POSITION_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_POSITION_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnQuotaObserver.h b/extensions/Particle3D/PU/CCPUOnQuotaObserver.h index ffdbcc84bf..6359e855e0 100644 --- a/extensions/Particle3D/PU/CCPUOnQuotaObserver.h +++ b/extensions/Particle3D/PU/CCPUOnQuotaObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnQuotaObserver : public PUObserver +class AX_EX_DLL PUOnQuotaObserver : public PUObserver { public: static PUOnQuotaObserver* create(); diff --git a/extensions/Particle3D/PU/CCPUOnQuotaObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnQuotaObserverTranslator.h index 5c266c9854..0d5ad0df93 100644 --- a/extensions/Particle3D/PU/CCPUOnQuotaObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnQuotaObserverTranslator.h @@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnRandomObserver.h b/extensions/Particle3D/PU/CCPUOnRandomObserver.h index 43130e6c4b..1d19a5e56f 100644 --- a/extensions/Particle3D/PU/CCPUOnRandomObserver.h +++ b/extensions/Particle3D/PU/CCPUOnRandomObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnRandomObserver : public PUObserver +class AX_EX_DLL PUOnRandomObserver : public PUObserver { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUOnRandomObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnRandomObserverTranslator.h index c2897972bb..5aa467f58e 100644 --- a/extensions/Particle3D/PU/CCPUOnRandomObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnRandomObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnTimeObserver.h b/extensions/Particle3D/PU/CCPUOnTimeObserver.h index 704d9ca12b..43830829c6 100644 --- a/extensions/Particle3D/PU/CCPUOnTimeObserver.h +++ b/extensions/Particle3D/PU/CCPUOnTimeObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_TIME_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_TIME_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnTimeObserver : public PUObserver +class AX_EX_DLL PUOnTimeObserver : public PUObserver { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUOnTimeObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnTimeObserverTranslator.h index cf8b5b9f16..f41bd3fe4e 100644 --- a/extensions/Particle3D/PU/CCPUOnTimeObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnTimeObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_TIME_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_ON_TIME_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUOnVelocityObserver.h b/extensions/Particle3D/PU/CCPUOnVelocityObserver.h index 510e1799ba..a099633182 100644 --- a/extensions/Particle3D/PU/CCPUOnVelocityObserver.h +++ b/extensions/Particle3D/PU/CCPUOnVelocityObserver.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_ON_VELOCITY_OBSERVER_H__ -#define __CC_PU_PARTICLE_3D_ON_VELOCITY_OBSERVER_H__ +#ifndef __AX_PU_PARTICLE_3D_ON_VELOCITY_OBSERVER_H__ +#define __AX_PU_PARTICLE_3D_ON_VELOCITY_OBSERVER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUOnVelocityObserver : public PUObserver +class AX_EX_DLL PUOnVelocityObserver : public PUObserver { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUOnVelocityObserverTranslator.h b/extensions/Particle3D/PU/CCPUOnVelocityObserverTranslator.h index 5c85830641..3762443cc7 100644 --- a/extensions/Particle3D/PU/CCPUOnVelocityObserverTranslator.h +++ b/extensions/Particle3D/PU/CCPUOnVelocityObserverTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_DO_CLEAR_OBSERVER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_DO_CLEAR_OBSERVER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_DO_CLEAR_OBSERVER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_DO_CLEAR_OBSERVER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUParticleFollower.h b/extensions/Particle3D/PU/CCPUParticleFollower.h index e28af1da2d..0edb7d7c69 100644 --- a/extensions/Particle3D/PU/CCPUParticleFollower.h +++ b/extensions/Particle3D/PU/CCPUParticleFollower.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PARTICLE_FOLLOWER_H__ -#define __CC_PU_PARTICLE_3D_PARTICLE_FOLLOWER_H__ +#ifndef __AX_PU_PARTICLE_3D_PARTICLE_FOLLOWER_H__ +#define __AX_PU_PARTICLE_3D_PARTICLE_FOLLOWER_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PUParticleFollower : public PUAffector +class AX_EX_DLL PUParticleFollower : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUParticleFollowerTranslator.h b/extensions/Particle3D/PU/CCPUParticleFollowerTranslator.h index 6488c34188..1cd77b258b 100644 --- a/extensions/Particle3D/PU/CCPUParticleFollowerTranslator.h +++ b/extensions/Particle3D/PU/CCPUParticleFollowerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PARTICLE_FOLLOWER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_PARTICLE_FOLLOWER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_PARTICLE_FOLLOWER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_PARTICLE_FOLLOWER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp b/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp index 0edbf91be8..77e95f3e03 100644 --- a/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp +++ b/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp @@ -163,7 +163,7 @@ PUParticle3D::~PUParticle3D() it->release(); } - // CC_SAFE_RELEASE(particleEntityPtr); + // AX_SAFE_RELEASE(particleEntityPtr); } void PUParticle3D::copyBehaviours(const ParticleBehaviourList& list) @@ -269,7 +269,7 @@ PUParticleSystem3D* PUParticleSystem3D::create(std::string_view filePath, std::s } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } } @@ -284,7 +284,7 @@ PUParticleSystem3D* PUParticleSystem3D::create(std::string_view filePath) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } } @@ -1148,14 +1148,14 @@ void PUParticleSystem3D::addBehaviourTemplate(PUBehaviour* behaviour) void PUParticleSystem3D::convertToUnixStylePath(std::string& path) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) for (auto& iter : path) { if (iter == '\\') iter = '/'; } #else - CC_UNUSED_PARAM(path); + AX_UNUSED_PARAM(path); #endif } diff --git a/extensions/Particle3D/PU/CCPUParticleSystem3D.h b/extensions/Particle3D/PU/CCPUParticleSystem3D.h index 0686fd6177..ec82c23740 100644 --- a/extensions/Particle3D/PU/CCPUParticleSystem3D.h +++ b/extensions/Particle3D/PU/CCPUParticleSystem3D.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_SYSTEM_3D_H__ -#define __CC_PU_PARTICLE_SYSTEM_3D_H__ +#ifndef __AX_PU_PARTICLE_SYSTEM_3D_H__ +#define __AX_PU_PARTICLE_SYSTEM_3D_H__ #include "2d/CCNode.h" #include "base/CCProtocols.h" @@ -56,7 +56,7 @@ enum PUComponentType CT_OBSERVER }; -struct CC_EX_DLL PUParticle3D : public Particle3D +struct AX_EX_DLL PUParticle3D : public Particle3D { static float DEFAULT_TTL; static float DEFAULT_MASS; @@ -204,7 +204,7 @@ struct CC_EX_DLL PUParticle3D : public Particle3D // float depthInWorld; }; -class CC_EX_DLL PUParticleSystem3D : public ParticleSystem3D +class AX_EX_DLL PUParticleSystem3D : public ParticleSystem3D { public: typedef hlookup::string_map ParticlePoolMap; diff --git a/extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h b/extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h index dfec22739e..2c81eb5aa5 100644 --- a/extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h +++ b/extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_SYSTEM_3D_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_SYSTEM_3D_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_SYSTEM_3D_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_SYSTEM_3D_TRANSLATOR_H__ //#include #include "extensions/Particle3D/PU/CCPUParticleSystem3D.h" diff --git a/extensions/Particle3D/PU/CCPUPathFollower.h b/extensions/Particle3D/PU/CCPUPathFollower.h index e7820d0872..9349ff00ee 100644 --- a/extensions/Particle3D/PU/CCPUPathFollower.h +++ b/extensions/Particle3D/PU/CCPUPathFollower.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PATH_FOLLOWER_H__ -#define __CC_PU_PARTICLE_3D_PATH_FOLLOWER_H__ +#ifndef __AX_PU_PARTICLE_3D_PATH_FOLLOWER_H__ +#define __AX_PU_PARTICLE_3D_PATH_FOLLOWER_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUSimpleSpline.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUPathFollower : public PUAffector +class AX_EX_DLL PUPathFollower : public PUAffector { public: static PUPathFollower* create(); diff --git a/extensions/Particle3D/PU/CCPUPathFollowerTranslator.h b/extensions/Particle3D/PU/CCPUPathFollowerTranslator.h index 075d3db8e8..3a5f13b271 100644 --- a/extensions/Particle3D/PU/CCPUPathFollowerTranslator.h +++ b/extensions/Particle3D/PU/CCPUPathFollowerTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PATH_FOLLOWER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_PATH_FOLLOWER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_PATH_FOLLOWER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_PATH_FOLLOWER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUPlane.h b/extensions/Particle3D/PU/CCPUPlane.h index 5fe6f943e5..691d07d0bd 100644 --- a/extensions/Particle3D/PU/CCPUPlane.h +++ b/extensions/Particle3D/PU/CCPUPlane.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PLANE_H__ -#define __CC_PU_PARTICLE_3D_PLANE_H__ +#ifndef __AX_PU_PARTICLE_3D_PLANE_H__ +#define __AX_PU_PARTICLE_3D_PLANE_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPUPlaneCollider.h b/extensions/Particle3D/PU/CCPUPlaneCollider.h index 4b64ab86ee..6aafa1f214 100644 --- a/extensions/Particle3D/PU/CCPUPlaneCollider.h +++ b/extensions/Particle3D/PU/CCPUPlaneCollider.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PLANE_COLLIDER_H__ -#define __CC_PU_PARTICLE_3D_PLANE_COLLIDER_H__ +#ifndef __AX_PU_PARTICLE_3D_PLANE_COLLIDER_H__ +#define __AX_PU_PARTICLE_3D_PLANE_COLLIDER_H__ #include "CCPUBaseCollider.h" #include "extensions/Particle3D/PU/CCPUPlane.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUPlaneCollider : public PUBaseCollider +class AX_EX_DLL PUPlaneCollider : public PUBaseCollider { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUPlaneColliderTranslator.h b/extensions/Particle3D/PU/CCPUPlaneColliderTranslator.h index 8caa7c66db..0dbe8c29d1 100644 --- a/extensions/Particle3D/PU/CCPUPlaneColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUPlaneColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_PLANE_COLLIDER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_PLANE_COLLIDER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_PLANE_COLLIDER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_PLANE_COLLIDER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUPointEmitter.h b/extensions/Particle3D/PU/CCPUPointEmitter.h index aa18f6a740..092a7193df 100644 --- a/extensions/Particle3D/PU/CCPUPointEmitter.h +++ b/extensions/Particle3D/PU/CCPUPointEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_POINT_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_POINT_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_POINT_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_POINT_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class CC_EX_DLL PUPointEmitter : public PUEmitter +class AX_EX_DLL PUPointEmitter : public PUEmitter { public: static PUPointEmitter* create(); diff --git a/extensions/Particle3D/PU/CCPUPointEmitterTranslator.h b/extensions/Particle3D/PU/CCPUPointEmitterTranslator.h index 79b0b44e0f..00c78ece31 100644 --- a/extensions/Particle3D/PU/CCPUPointEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUPointEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_POINT_EMITTER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_POINT_EMITTER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_POINT_EMITTER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_POINT_EMITTER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUPositionEmitter.h b/extensions/Particle3D/PU/CCPUPositionEmitter.h index e71103d1a4..82f9a87912 100644 --- a/extensions/Particle3D/PU/CCPUPositionEmitter.h +++ b/extensions/Particle3D/PU/CCPUPositionEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_POSITION_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_POSITION_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_POSITION_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_POSITION_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class CC_EX_DLL PUPositionEmitter : public PUEmitter +class AX_EX_DLL PUPositionEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUPositionEmitterTranslator.h b/extensions/Particle3D/PU/CCPUPositionEmitterTranslator.h index 6e9160448b..51ae06fca4 100644 --- a/extensions/Particle3D/PU/CCPUPositionEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUPositionEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_POSITION_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_POSITION_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_POSITION_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_POSITION_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPURandomiser.h b/extensions/Particle3D/PU/CCPURandomiser.h index 1f7f0f42bc..ee73fdc72c 100644 --- a/extensions/Particle3D/PU/CCPURandomiser.h +++ b/extensions/Particle3D/PU/CCPURandomiser.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_RANDOMISER_H__ -#define __CC_PU_PARTICLE_3D_RANDOMISER_H__ +#ifndef __AX_PU_PARTICLE_3D_RANDOMISER_H__ +#define __AX_PU_PARTICLE_3D_RANDOMISER_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PURandomiser : public PUAffector +class AX_EX_DLL PURandomiser : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPURandomiserTranslator.h b/extensions/Particle3D/PU/CCPURandomiserTranslator.h index 1eb34a9068..69778af3fe 100644 --- a/extensions/Particle3D/PU/CCPURandomiserTranslator.h +++ b/extensions/Particle3D/PU/CCPURandomiserTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_RANDOMISER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_RANDOMISER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_RANDOMISER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_RANDOMISER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPURender.cpp b/extensions/Particle3D/PU/CCPURender.cpp index 87f3c00236..35d085e4e2 100644 --- a/extensions/Particle3D/PU/CCPURender.cpp +++ b/extensions/Particle3D/PU/CCPURender.cpp @@ -66,7 +66,7 @@ PUParticle3DQuadRender* PUParticle3DQuadRender::create(std::string_view texFile) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -607,15 +607,15 @@ PUParticle3DEntityRender::PUParticle3DEntityRender() PUParticle3DEntityRender::~PUParticle3DEntityRender() { ; - // CC_SAFE_RELEASE(_texture); - CC_SAFE_RELEASE(_programState); - CC_SAFE_RELEASE(_vertexBuffer); - CC_SAFE_RELEASE(_indexBuffer); + // AX_SAFE_RELEASE(_texture); + AX_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_vertexBuffer); + AX_SAFE_RELEASE(_indexBuffer); } bool PUParticle3DEntityRender::initRender(std::string_view texFile) { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); if (!texFile.empty()) { auto tex = Director::getInstance()->getTextureCache()->addImage(texFile); @@ -669,8 +669,8 @@ bool PUParticle3DEntityRender::initRender(std::string_view texFile) _stateBlock.setCullFaceSide(backend::CullMode::BACK); _stateBlock.setCullFace(true); - _meshCommand.setBeforeCallback(CC_CALLBACK_0(PUParticle3DEntityRender::onBeforeDraw, this)); - _meshCommand.setAfterCallback(CC_CALLBACK_0(PUParticle3DEntityRender::onAfterDraw, this)); + _meshCommand.setBeforeCallback(AX_CALLBACK_0(PUParticle3DEntityRender::onBeforeDraw, this)); + _meshCommand.setAfterCallback(AX_CALLBACK_0(PUParticle3DEntityRender::onAfterDraw, this)); return true; } @@ -701,7 +701,7 @@ PUParticle3DBoxRender* PUParticle3DBoxRender::create(std::string_view texFile) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -891,7 +891,7 @@ PUSphereRender* PUSphereRender::create(std::string_view texFile) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/extensions/Particle3D/PU/CCPURender.h b/extensions/Particle3D/PU/CCPURender.h index 082833cc13..1abb123a4b 100644 --- a/extensions/Particle3D/PU/CCPURender.h +++ b/extensions/Particle3D/PU/CCPURender.h @@ -40,7 +40,7 @@ NS_AX_BEGIN // particle render for quad struct PUParticle3D; -class CC_EX_DLL PURender : public Particle3DRender +class AX_EX_DLL PURender : public Particle3DRender { public: virtual void prepare(){}; @@ -61,7 +61,7 @@ protected: std::string _renderType; }; -class CC_EX_DLL PUParticle3DEntityRender : public PURender +class AX_EX_DLL PUParticle3DEntityRender : public PURender { public: void copyAttributesTo(PUParticle3DEntityRender* render); @@ -109,7 +109,7 @@ protected: bool _rendererDepthWrite = false; }; -class CC_EX_DLL PUParticle3DQuadRender : public PUParticle3DEntityRender +class AX_EX_DLL PUParticle3DQuadRender : public PUParticle3DEntityRender { public: enum Type @@ -188,7 +188,7 @@ protected: }; // particle render for MeshRenderer -class CC_EX_DLL PUParticle3DModelRender : public PURender +class AX_EX_DLL PUParticle3DModelRender : public PURender { public: static PUParticle3DModelRender* create(std::string_view modelFile, std::string_view texFile = ""); @@ -209,7 +209,7 @@ protected: Vec3 _meshSize; }; -class CC_EX_DLL PUParticle3DBoxRender : public PUParticle3DEntityRender +class AX_EX_DLL PUParticle3DBoxRender : public PUParticle3DEntityRender { public: static PUParticle3DBoxRender* create(std::string_view texFile = ""); @@ -225,7 +225,7 @@ protected: void reBuildIndices(unsigned short count); }; -class CC_EX_DLL PUSphereRender : public PUParticle3DEntityRender +class AX_EX_DLL PUSphereRender : public PUParticle3DEntityRender { public: static PUSphereRender* create(std::string_view texFile = ""); diff --git a/extensions/Particle3D/PU/CCPURendererTranslator.h b/extensions/Particle3D/PU/CCPURendererTranslator.h index 54d8afe466..775eeb0c4f 100644 --- a/extensions/Particle3D/PU/CCPURendererTranslator.h +++ b/extensions/Particle3D/PU/CCPURendererTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_RENDERER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_RENDERER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_RENDERER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_RENDERER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPURender.h" #include "extensions/Particle3D/PU/CCPUBeamRender.h" diff --git a/extensions/Particle3D/PU/CCPURibbonTrail.h b/extensions/Particle3D/PU/CCPURibbonTrail.h index 2a3a6a5df8..ad8bee4c79 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrail.h +++ b/extensions/Particle3D/PU/CCPURibbonTrail.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_RIBBON_TRAIL_H__ -#define __CC_PU_PARTICLE_3D_RIBBON_TRAIL_H__ +#ifndef __AX_PU_PARTICLE_3D_RIBBON_TRAIL_H__ +#define __AX_PU_PARTICLE_3D_RIBBON_TRAIL_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp b/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp index c0f77101df..8fd11da706 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp +++ b/extensions/Particle3D/PU/CCPURibbonTrailRender.cpp @@ -332,7 +332,7 @@ void PURibbonTrailRender::destroyAll() } // Delete the Ribbontrail - CC_SAFE_DELETE(_trail); + AX_SAFE_DELETE(_trail); // Delete the visual data std::vector::const_iterator it; diff --git a/extensions/Particle3D/PU/CCPURibbonTrailRender.h b/extensions/Particle3D/PU/CCPURibbonTrailRender.h index cc3a17b78d..0ca85b7d57 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrailRender.h +++ b/extensions/Particle3D/PU/CCPURibbonTrailRender.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_RIBBON_TRAIL_RENDER_H__ -#define __CC_PU_PARTICLE_3D_RIBBON_TRAIL_RENDER_H__ +#ifndef __AX_PU_PARTICLE_3D_RIBBON_TRAIL_RENDER_H__ +#define __AX_PU_PARTICLE_3D_RIBBON_TRAIL_RENDER_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -71,7 +71,7 @@ public: }; // particle render for quad -class CC_EX_DLL PURibbonTrailRender : public PURender, public PUListener +class AX_EX_DLL PURibbonTrailRender : public PURender, public PUListener { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUScaleAffector.cpp b/extensions/Particle3D/PU/CCPUScaleAffector.cpp index 4129908837..5e387c31ae 100644 --- a/extensions/Particle3D/PU/CCPUScaleAffector.cpp +++ b/extensions/Particle3D/PU/CCPUScaleAffector.cpp @@ -59,26 +59,26 @@ PUScaleAffector::~PUScaleAffector() { if (_dynScaleX) { - CC_SAFE_DELETE(_dynScaleX); + AX_SAFE_DELETE(_dynScaleX); } if (_dynScaleY) { - CC_SAFE_DELETE(_dynScaleY); + AX_SAFE_DELETE(_dynScaleY); } if (_dynScaleZ) { - CC_SAFE_DELETE(_dynScaleZ); + AX_SAFE_DELETE(_dynScaleZ); } if (_dynScaleXYZ) { - CC_SAFE_DELETE(_dynScaleXYZ); + AX_SAFE_DELETE(_dynScaleXYZ); } } //----------------------------------------------------------------------- void PUScaleAffector::setDynScaleX(PUDynamicAttribute* dynScaleX) { if (_dynScaleX) - CC_SAFE_DELETE(_dynScaleX); + AX_SAFE_DELETE(_dynScaleX); _dynScaleX = dynScaleX; _dynScaleXSet = true; @@ -88,7 +88,7 @@ void PUScaleAffector::resetDynScaleX(bool resetToDefault) { if (resetToDefault) { - CC_SAFE_DELETE(_dynScaleX); + AX_SAFE_DELETE(_dynScaleX); _dynScaleX = new PUDynamicAttributeFixed(); (static_cast(_dynScaleX))->setValue(DEFAULT_X_SCALE); _dynScaleXSet = false; @@ -102,7 +102,7 @@ void PUScaleAffector::resetDynScaleX(bool resetToDefault) void PUScaleAffector::setDynScaleY(PUDynamicAttribute* dynScaleY) { if (_dynScaleY) - CC_SAFE_DELETE(_dynScaleY); + AX_SAFE_DELETE(_dynScaleY); _dynScaleY = dynScaleY; _dynScaleYSet = true; @@ -113,7 +113,7 @@ void PUScaleAffector::resetDynScaleY(bool resetToDefault) if (resetToDefault) { - CC_SAFE_DELETE(_dynScaleY); + AX_SAFE_DELETE(_dynScaleY); _dynScaleY = new PUDynamicAttributeFixed(); (static_cast(_dynScaleY))->setValue(DEFAULT_X_SCALE); _dynScaleYSet = false; @@ -127,7 +127,7 @@ void PUScaleAffector::resetDynScaleY(bool resetToDefault) void PUScaleAffector::setDynScaleZ(PUDynamicAttribute* dynScaleZ) { if (_dynScaleZ) - CC_SAFE_DELETE(_dynScaleZ); + AX_SAFE_DELETE(_dynScaleZ); _dynScaleZ = dynScaleZ; _dynScaleZSet = true; @@ -137,7 +137,7 @@ void PUScaleAffector::resetDynScaleZ(bool resetToDefault) { if (resetToDefault) { - CC_SAFE_DELETE(_dynScaleZ); + AX_SAFE_DELETE(_dynScaleZ); _dynScaleZ = new PUDynamicAttributeFixed(); (static_cast(_dynScaleZ))->setValue(DEFAULT_X_SCALE); _dynScaleYSet = false; @@ -151,7 +151,7 @@ void PUScaleAffector::resetDynScaleZ(bool resetToDefault) void PUScaleAffector::setDynScaleXYZ(PUDynamicAttribute* dynScaleXYZ) { if (_dynScaleXYZ) - CC_SAFE_DELETE(_dynScaleXYZ); + AX_SAFE_DELETE(_dynScaleXYZ); _dynScaleXYZ = dynScaleXYZ; _dynScaleXYZSet = true; @@ -161,7 +161,7 @@ void PUScaleAffector::resetDynScaleXYZ(bool resetToDefault) { if (resetToDefault) { - CC_SAFE_DELETE(_dynScaleXYZ); + AX_SAFE_DELETE(_dynScaleXYZ); _dynScaleXYZ = new PUDynamicAttributeFixed(); (static_cast(_dynScaleXYZ))->setValue(DEFAULT_XYZ_SCALE); _dynScaleXYZSet = false; diff --git a/extensions/Particle3D/PU/CCPUScaleAffector.h b/extensions/Particle3D/PU/CCPUScaleAffector.h index 45ef1929fb..e67cbd0c0a 100644 --- a/extensions/Particle3D/PU/CCPUScaleAffector.h +++ b/extensions/Particle3D/PU/CCPUScaleAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SCALE_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_SCALE_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SCALE_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_SCALE_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUScaleAffector : public PUAffector +class AX_EX_DLL PUScaleAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUScaleAffectorTranslator.h b/extensions/Particle3D/PU/CCPUScaleAffectorTranslator.h index 198ed845ee..993471bfaa 100644 --- a/extensions/Particle3D/PU/CCPUScaleAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUScaleAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SCALE_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SCALE_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SCALE_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SCALE_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUScaleVelocityAffector.cpp b/extensions/Particle3D/PU/CCPUScaleVelocityAffector.cpp index 9e4172cc24..7d192ac6d5 100644 --- a/extensions/Particle3D/PU/CCPUScaleVelocityAffector.cpp +++ b/extensions/Particle3D/PU/CCPUScaleVelocityAffector.cpp @@ -42,7 +42,7 @@ PUScaleVelocityAffector::~PUScaleVelocityAffector() { if (_dynScaleVelocity) { - CC_SAFE_DELETE(_dynScaleVelocity); + AX_SAFE_DELETE(_dynScaleVelocity); } } //----------------------------------------------------------------------- @@ -91,7 +91,7 @@ void PUScaleVelocityAffector::updatePUAffector(PUParticle3D* particle, float del void PUScaleVelocityAffector::setDynScaleVelocity(PUDynamicAttribute* dynScaleVelocity) { if (_dynScaleVelocity) - CC_SAFE_DELETE(_dynScaleVelocity); + AX_SAFE_DELETE(_dynScaleVelocity); _dynScaleVelocity = dynScaleVelocity; } @@ -100,7 +100,7 @@ void PUScaleVelocityAffector::resetDynScaleVelocity(bool resetToDefault) { if (resetToDefault) { - CC_SAFE_DELETE(_dynScaleVelocity); + AX_SAFE_DELETE(_dynScaleVelocity); _dynScaleVelocity = new PUDynamicAttributeFixed(); (static_cast(_dynScaleVelocity))->setValue(DEFAULT_VELOCITY_SCALE); } diff --git a/extensions/Particle3D/PU/CCPUScaleVelocityAffector.h b/extensions/Particle3D/PU/CCPUScaleVelocityAffector.h index 011f7b15e8..511c235eda 100644 --- a/extensions/Particle3D/PU/CCPUScaleVelocityAffector.h +++ b/extensions/Particle3D/PU/CCPUScaleVelocityAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUScaleVelocityAffector : public PUAffector +class AX_EX_DLL PUScaleVelocityAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUScaleVelocityAffectorTranslator.h b/extensions/Particle3D/PU/CCPUScaleVelocityAffectorTranslator.h index 378ec45405..ed1a1de115 100644 --- a/extensions/Particle3D/PU/CCPUScaleVelocityAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUScaleVelocityAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SCALE_VELOCITY_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUScriptCompiler.h b/extensions/Particle3D/PU/CCPUScriptCompiler.h index 86f381ca41..a015ca063a 100644 --- a/extensions/Particle3D/PU/CCPUScriptCompiler.h +++ b/extensions/Particle3D/PU/CCPUScriptCompiler.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_SCRIPT_COMPILER_H__ -#define __CC_PU_SCRIPT_COMPILER_H__ +#ifndef __AX_PU_SCRIPT_COMPILER_H__ +#define __AX_PU_SCRIPT_COMPILER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUScriptParser.h" @@ -45,10 +45,10 @@ enum PUAbstractNodeType ANT_VARIABLE_SET, ANT_VARIABLE_ACCESS }; -class CC_EX_DLL PUAbstractNode; +class AX_EX_DLL PUAbstractNode; typedef std::list PUAbstractNodeList; -class CC_EX_DLL PUAbstractNode +class AX_EX_DLL PUAbstractNode { public: std::string file; @@ -69,7 +69,7 @@ public: }; /** This specific abstract node represents a script object */ -class CC_EX_DLL PUObjectAbstractNode : public PUAbstractNode +class AX_EX_DLL PUObjectAbstractNode : public PUAbstractNode { private: hlookup::string_map _env; @@ -95,7 +95,7 @@ public: }; /** This abstract node represents a script property */ -class CC_EX_DLL PUPropertyAbstractNode : public PUAbstractNode +class AX_EX_DLL PUPropertyAbstractNode : public PUAbstractNode { public: std::string name; @@ -110,7 +110,7 @@ public: }; /** This is an abstract node which cannot be broken down further */ -class CC_EX_DLL PUAtomAbstractNode : public PUAbstractNode +class AX_EX_DLL PUAtomAbstractNode : public PUAbstractNode { public: std::string value; @@ -125,8 +125,8 @@ private: void parseNumber() const; }; -class CC_EX_DLL PUParticleSystem3D; -class CC_EX_DLL PUScriptCompiler +class AX_EX_DLL PUParticleSystem3D; +class AX_EX_DLL PUScriptCompiler { private: diff --git a/extensions/Particle3D/PU/CCPUScriptLexer.h b/extensions/Particle3D/PU/CCPUScriptLexer.h index 65845d09b4..3dd937dd42 100644 --- a/extensions/Particle3D/PU/CCPUScriptLexer.h +++ b/extensions/Particle3D/PU/CCPUScriptLexer.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_SCRIPT_LEXER_H__ -#define __CC_PU_SCRIPT_LEXER_H__ +#ifndef __AX_PU_SCRIPT_LEXER_H__ +#define __AX_PU_SCRIPT_LEXER_H__ #include "base/CCRef.h" #include diff --git a/extensions/Particle3D/PU/CCPUScriptParser.h b/extensions/Particle3D/PU/CCPUScriptParser.h index 2f76123dc9..2999f7c55c 100644 --- a/extensions/Particle3D/PU/CCPUScriptParser.h +++ b/extensions/Particle3D/PU/CCPUScriptParser.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_SCRIPT_PARSER_H__ -#define __CC_PU_SCRIPT_PARSER_H__ +#ifndef __AX_PU_SCRIPT_PARSER_H__ +#define __AX_PU_SCRIPT_PARSER_H__ #include #include diff --git a/extensions/Particle3D/PU/CCPUScriptTranslator.h b/extensions/Particle3D/PU/CCPUScriptTranslator.h index 74fbe3ded4..3e82d92524 100644 --- a/extensions/Particle3D/PU/CCPUScriptTranslator.h +++ b/extensions/Particle3D/PU/CCPUScriptTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_SCRIPT_TRANSLATOR_H__ -#define __CC_PU_SCRIPT_TRANSLATOR_H__ +#ifndef __AX_PU_SCRIPT_TRANSLATOR_H__ +#define __AX_PU_SCRIPT_TRANSLATOR_H__ #include diff --git a/extensions/Particle3D/PU/CCPUSimpleSpline.h b/extensions/Particle3D/PU/CCPUSimpleSpline.h index e029a6f2f5..1a9c1ba7d7 100644 --- a/extensions/Particle3D/PU/CCPUSimpleSpline.h +++ b/extensions/Particle3D/PU/CCPUSimpleSpline.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SIMPLE_SPLINE_H__ -#define __CC_PU_PARTICLE_3D_SIMPLE_SPLINE_H__ +#ifndef __AX_PU_PARTICLE_3D_SIMPLE_SPLINE_H__ +#define __AX_PU_PARTICLE_3D_SIMPLE_SPLINE_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPUSineForceAffector.h b/extensions/Particle3D/PU/CCPUSineForceAffector.h index 818fd5e94b..3d7fd8ee74 100644 --- a/extensions/Particle3D/PU/CCPUSineForceAffector.h +++ b/extensions/Particle3D/PU/CCPUSineForceAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_H__ #include "CCPUBaseForceAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PUSineForceAffector : public PUBaseForceAffector +class AX_EX_DLL PUSineForceAffector : public PUBaseForceAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUSineForceAffectorTranslator.h b/extensions/Particle3D/PU/CCPUSineForceAffectorTranslator.h index 66ccf66868..bbc0836f0a 100644 --- a/extensions/Particle3D/PU/CCPUSineForceAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUSineForceAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SINE_FORCE_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUSlaveBehaviour.h b/extensions/Particle3D/PU/CCPUSlaveBehaviour.h index dcbe042ded..d8ca31784a 100644 --- a/extensions/Particle3D/PU/CCPUSlaveBehaviour.h +++ b/extensions/Particle3D/PU/CCPUSlaveBehaviour.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__ -#define __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__ +#ifndef __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__ +#define __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__ #include "base/CCRef.h" #include "math/CCMath.h" @@ -39,7 +39,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class CC_EX_DLL PUSlaveBehaviour : public PUBehaviour +class AX_EX_DLL PUSlaveBehaviour : public PUBehaviour { public: static PUSlaveBehaviour* create(); diff --git a/extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.h b/extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.h index 491c18b6c3..3702bbf7e3 100644 --- a/extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.h +++ b/extensions/Particle3D/PU/CCPUSlaveBehaviourTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUSlaveEmitter.h b/extensions/Particle3D/PU/CCPUSlaveEmitter.h index 290d07ad67..6f393c56fa 100644 --- a/extensions/Particle3D/PU/CCPUSlaveEmitter.h +++ b/extensions/Particle3D/PU/CCPUSlaveEmitter.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SLAVE_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_SLAVE_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_SLAVE_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_SLAVE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" #include "extensions/Particle3D/PU/CCPUListener.h" NS_AX_BEGIN // FIXME -class CC_EX_DLL PUSlaveEmitter : public PUEmitter, public PUListener +class AX_EX_DLL PUSlaveEmitter : public PUEmitter, public PUListener { public: static PUSlaveEmitter* create(); diff --git a/extensions/Particle3D/PU/CCPUSlaveEmitterTranslator.h b/extensions/Particle3D/PU/CCPUSlaveEmitterTranslator.h index 35ec9dc36c..98a39a3ff3 100644 --- a/extensions/Particle3D/PU/CCPUSlaveEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUSlaveEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SLAVE_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SLAVE_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SLAVE_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SLAVE_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUSphere.h b/extensions/Particle3D/PU/CCPUSphere.h index 1650682c17..f35d6a0c53 100644 --- a/extensions/Particle3D/PU/CCPUSphere.h +++ b/extensions/Particle3D/PU/CCPUSphere.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SPHERE_H__ -#define __CC_PU_PARTICLE_3D_SPHERE_H__ +#ifndef __AX_PU_PARTICLE_3D_SPHERE_H__ +#define __AX_PU_PARTICLE_3D_SPHERE_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPUSphereCollider.h b/extensions/Particle3D/PU/CCPUSphereCollider.h index 7d080b7fde..14413a8b97 100644 --- a/extensions/Particle3D/PU/CCPUSphereCollider.h +++ b/extensions/Particle3D/PU/CCPUSphereCollider.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SPHERE_COLLIDER_H__ -#define __CC_PU_PARTICLE_3D_SPHERE_COLLIDER_H__ +#ifndef __AX_PU_PARTICLE_3D_SPHERE_COLLIDER_H__ +#define __AX_PU_PARTICLE_3D_SPHERE_COLLIDER_H__ #include "CCPUBaseCollider.h" #include "extensions/Particle3D/PU/CCPUSphere.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUSphereCollider : public PUBaseCollider +class AX_EX_DLL PUSphereCollider : public PUBaseCollider { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUSphereColliderTranslator.h b/extensions/Particle3D/PU/CCPUSphereColliderTranslator.h index e12edc90a9..0cd2fa2f40 100644 --- a/extensions/Particle3D/PU/CCPUSphereColliderTranslator.h +++ b/extensions/Particle3D/PU/CCPUSphereColliderTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SPHERE_COLLIDER_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SPHERE_COLLIDER_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SPHERE_COLLIDER_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SPHERE_COLLIDER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.h b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.h index 44fa5f690c..2ed2770084 100644 --- a/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.h +++ b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitter.h @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SPHERE_SURFACE_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_SPHERE_SURFACE_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_SPHERE_SURFACE_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_SPHERE_SURFACE_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" NS_AX_BEGIN -class CC_EX_DLL PUSphereSurfaceEmitter : public PUEmitter +class AX_EX_DLL PUSphereSurfaceEmitter : public PUEmitter { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUSphereSurfaceEmitterTranslator.h b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitterTranslator.h index 3fc10b4e5e..fa9e723a76 100644 --- a/extensions/Particle3D/PU/CCPUSphereSurfaceEmitterTranslator.h +++ b/extensions/Particle3D/PU/CCPUSphereSurfaceEmitterTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_SPHERE_SURFACE_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_SPHERE_SURFACE_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_SPHERE_SURFACE_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_SPHERE_SURFACE_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUTechniqueTranslator.h b/extensions/Particle3D/PU/CCPUTechniqueTranslator.h index 2fcecf412f..f31222aec3 100644 --- a/extensions/Particle3D/PU/CCPUTechniqueTranslator.h +++ b/extensions/Particle3D/PU/CCPUTechniqueTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_TECHNIQUE_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_TECHNIQUE_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_TECHNIQUE_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_TECHNIQUE_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUParticleSystem3D.h" #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUTextureAnimator.h b/extensions/Particle3D/PU/CCPUTextureAnimator.h index a602caf9a3..99ab8ffbc8 100644 --- a/extensions/Particle3D/PU/CCPUTextureAnimator.h +++ b/extensions/Particle3D/PU/CCPUTextureAnimator.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_TEXTURE_ANIMATOR_H__ -#define __CC_PU_PARTICLE_3D_TEXTURE_ANIMATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_TEXTURE_ANIMATOR_H__ +#define __AX_PU_PARTICLE_3D_TEXTURE_ANIMATOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PUTextureAnimator : public PUAffector +class AX_EX_DLL PUTextureAnimator : public PUAffector { public: enum TextureAnimationType diff --git a/extensions/Particle3D/PU/CCPUTextureAnimatorTranslator.h b/extensions/Particle3D/PU/CCPUTextureAnimatorTranslator.h index d00edc86f3..0626cc5f47 100644 --- a/extensions/Particle3D/PU/CCPUTextureAnimatorTranslator.h +++ b/extensions/Particle3D/PU/CCPUTextureAnimatorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_TEXTURE_ANIMATOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_TEXTURE_ANIMATOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_TEXTURE_ANIMATOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_TEXTURE_ANIMATOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUTextureRotator.cpp b/extensions/Particle3D/PU/CCPUTextureRotator.cpp index b76464c702..1d89267b1b 100644 --- a/extensions/Particle3D/PU/CCPUTextureRotator.cpp +++ b/extensions/Particle3D/PU/CCPUTextureRotator.cpp @@ -50,12 +50,12 @@ PUTextureRotator::~PUTextureRotator() { if (_dynRotation) { - CC_SAFE_DELETE(_dynRotation); + AX_SAFE_DELETE(_dynRotation); } if (_dynRotationSpeed) { - CC_SAFE_DELETE(_dynRotationSpeed); + AX_SAFE_DELETE(_dynRotationSpeed); } } //----------------------------------------------------------------------- @@ -77,7 +77,7 @@ PUDynamicAttribute* PUTextureRotator::getRotation() const void PUTextureRotator::setRotation(PUDynamicAttribute* dynRotation) { if (_dynRotation) - CC_SAFE_DELETE(_dynRotation); + AX_SAFE_DELETE(_dynRotation); _dynRotation = dynRotation; } @@ -90,7 +90,7 @@ PUDynamicAttribute* PUTextureRotator::getRotationSpeed() const void PUTextureRotator::setRotationSpeed(PUDynamicAttribute* dynRotationSpeed) { if (_dynRotationSpeed) - CC_SAFE_DELETE(_dynRotationSpeed); + AX_SAFE_DELETE(_dynRotationSpeed); _dynRotationSpeed = dynRotationSpeed; } diff --git a/extensions/Particle3D/PU/CCPUTextureRotator.h b/extensions/Particle3D/PU/CCPUTextureRotator.h index 92efa9c34e..ac1a71f822 100644 --- a/extensions/Particle3D/PU/CCPUTextureRotator.h +++ b/extensions/Particle3D/PU/CCPUTextureRotator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_TEXTURE_ROTATOR_H__ -#define __CC_PU_PARTICLE_3D_TEXTURE_ROTATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_TEXTURE_ROTATOR_H__ +#define __AX_PU_PARTICLE_3D_TEXTURE_ROTATOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUTextureRotator : public PUAffector +class AX_EX_DLL PUTextureRotator : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUTextureRotatorTranslator.h b/extensions/Particle3D/PU/CCPUTextureRotatorTranslator.h index 2ec37ecc8d..fe9031871a 100644 --- a/extensions/Particle3D/PU/CCPUTextureRotatorTranslator.h +++ b/extensions/Particle3D/PU/CCPUTextureRotatorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_TEXTURE_ROTATOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_TEXTURE_ROTATOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_TEXTURE_ROTATOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_TEXTURE_ROTATOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUTranslateManager.h b/extensions/Particle3D/PU/CCPUTranslateManager.h index e96f8c1fd2..fe7831eb68 100644 --- a/extensions/Particle3D/PU/CCPUTranslateManager.h +++ b/extensions/Particle3D/PU/CCPUTranslateManager.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ -#define __CC_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ +#ifndef __AX_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ +#define __AX_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ #include "base/CCRef.h" #include "extensions/Particle3D/PU/CCPUParticleSystem3DTranslator.h" diff --git a/extensions/Particle3D/PU/CCPUUtil.h b/extensions/Particle3D/PU/CCPUUtil.h index 75aae20fd3..8e885f0bb0 100644 --- a/extensions/Particle3D/PU/CCPUUtil.h +++ b/extensions/Particle3D/PU/CCPUUtil.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_UTIL_H__ -#define __CC_PU_PARTICLE_3D_UTIL_H__ +#ifndef __AX_PU_PARTICLE_3D_UTIL_H__ +#define __AX_PU_PARTICLE_3D_UTIL_H__ #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/extensions/Particle3D/PU/CCPUVelocityMatchingAffector.h b/extensions/Particle3D/PU/CCPUVelocityMatchingAffector.h index d6a25085cc..7c26161d87 100644 --- a/extensions/Particle3D/PU/CCPUVelocityMatchingAffector.h +++ b/extensions/Particle3D/PU/CCPUVelocityMatchingAffector.h @@ -24,15 +24,15 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "base/ccTypes.h" NS_AX_BEGIN -class CC_EX_DLL PUVelocityMatchingAffector : public PUAffector +class AX_EX_DLL PUVelocityMatchingAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.h b/extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.h index 654ce49713..0256235e02 100644 --- a/extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUVelocityMatchingAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_VELOCITY_MATCHING_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/Particle3D/PU/CCPUVertexEmitter.h b/extensions/Particle3D/PU/CCPUVertexEmitter.h index c7e0a3a731..d0c947b3d6 100644 --- a/extensions/Particle3D/PU/CCPUVertexEmitter.h +++ b/extensions/Particle3D/PU/CCPUVertexEmitter.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_VERTEX_EMITTER_H__ -#define __CC_PU_PARTICLE_3D_VERTEX_EMITTER_H__ +#ifndef __AX_PU_PARTICLE_3D_VERTEX_EMITTER_H__ +#define __AX_PU_PARTICLE_3D_VERTEX_EMITTER_H__ #include "extensions/Particle3D/PU/CCPUEmitter.h" #include diff --git a/extensions/Particle3D/PU/CCPUVortexAffector.cpp b/extensions/Particle3D/PU/CCPUVortexAffector.cpp index 5c338692dc..b36fbd8bd1 100644 --- a/extensions/Particle3D/PU/CCPUVortexAffector.cpp +++ b/extensions/Particle3D/PU/CCPUVortexAffector.cpp @@ -44,7 +44,7 @@ PUVortexAffector::~PUVortexAffector() { if (_dynRotationSpeed) { - CC_SAFE_DELETE(_dynRotationSpeed); + AX_SAFE_DELETE(_dynRotationSpeed); } } //----------------------------------------------------------------------- @@ -66,7 +66,7 @@ PUDynamicAttribute* PUVortexAffector::getRotationSpeed() const void PUVortexAffector::setRotationSpeed(PUDynamicAttribute* dynRotationSpeed) { if (_dynRotationSpeed) - CC_SAFE_DELETE(_dynRotationSpeed); + AX_SAFE_DELETE(_dynRotationSpeed); _dynRotationSpeed = dynRotationSpeed; } diff --git a/extensions/Particle3D/PU/CCPUVortexAffector.h b/extensions/Particle3D/PU/CCPUVortexAffector.h index 7af688df65..13ec67a75d 100644 --- a/extensions/Particle3D/PU/CCPUVortexAffector.h +++ b/extensions/Particle3D/PU/CCPUVortexAffector.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_VORTEX_AFFECTOR_H__ -#define __CC_PU_PARTICLE_3D_VORTEX_AFFECTOR_H__ +#ifndef __AX_PU_PARTICLE_3D_VORTEX_AFFECTOR_H__ +#define __AX_PU_PARTICLE_3D_VORTEX_AFFECTOR_H__ #include "extensions/Particle3D/PU/CCPUAffector.h" #include "extensions/Particle3D/PU/CCPUDynamicAttribute.h" @@ -33,7 +33,7 @@ NS_AX_BEGIN -class CC_EX_DLL PUVortexAffector : public PUAffector +class AX_EX_DLL PUVortexAffector : public PUAffector { public: // Constants diff --git a/extensions/Particle3D/PU/CCPUVortexAffectorTranslator.h b/extensions/Particle3D/PU/CCPUVortexAffectorTranslator.h index 3f1675a3a8..24c7d08cb4 100644 --- a/extensions/Particle3D/PU/CCPUVortexAffectorTranslator.h +++ b/extensions/Particle3D/PU/CCPUVortexAffectorTranslator.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PU_PARTICLE_3D_VORTEX_AFFECTOR_TRANSLATOR_H__ -#define __CC_PU_PARTICLE_3D_VORTEX_AFFECTOR_TRANSLATOR_H__ +#ifndef __AX_PU_PARTICLE_3D_VORTEX_AFFECTOR_TRANSLATOR_H__ +#define __AX_PU_PARTICLE_3D_VORTEX_AFFECTOR_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" diff --git a/extensions/assets-manager/AssetsManager.cpp b/extensions/assets-manager/AssetsManager.cpp index 78e28c2f88..7494c4c4ba 100644 --- a/extensions/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/AssetsManager.cpp @@ -266,7 +266,7 @@ AssetsManager::~AssetsManager() { delete _delegate; } - CC_SAFE_DELETE(_downloader); + AX_SAFE_DELETE(_downloader); } void AssetsManager::checkStoragePath() diff --git a/extensions/assets-manager/AssetsManager.h b/extensions/assets-manager/AssetsManager.h index 0fe26d6926..14f78125be 100644 --- a/extensions/assets-manager/AssetsManager.h +++ b/extensions/assets-manager/AssetsManager.h @@ -54,7 +54,7 @@ class AssetsManagerDelegateProtocol; * The updated package should be a zip file. And there should be a file named * version in the server, which contains version code. */ -class CC_EX_DLL AssetsManager : public Node +class AX_EX_DLL AssetsManager : public Node { public: enum class ErrorCode diff --git a/extensions/assets-manager/AssetsManagerEx.cpp b/extensions/assets-manager/AssetsManagerEx.cpp index 5b54625462..97ae5fdedb 100644 --- a/extensions/assets-manager/AssetsManagerEx.cpp +++ b/extensions/assets-manager/AssetsManagerEx.cpp @@ -200,11 +200,11 @@ AssetsManagerEx::~AssetsManagerEx() _downloader->onTaskError = (nullptr); _downloader->onFileTaskSuccess = (nullptr); _downloader->onTaskProgress = (nullptr); - CC_SAFE_RELEASE(_localManifest); + AX_SAFE_RELEASE(_localManifest); // _tempManifest could share a ptr with _remoteManifest or _localManifest if (_tempManifest != _localManifest && _tempManifest != _remoteManifest) - CC_SAFE_RELEASE(_tempManifest); - CC_SAFE_RELEASE(_remoteManifest); + AX_SAFE_RELEASE(_tempManifest); + AX_SAFE_RELEASE(_remoteManifest); } AssetsManagerEx* AssetsManagerEx::create(std::string_view manifestUrl, std::string_view storagePath) @@ -231,7 +231,7 @@ void AssetsManagerEx::initManifests(std::string_view manifestUrl) if (!_tempManifest->isLoaded()) { _fileUtils->removeDirectory(_tempStoragePath); - CC_SAFE_RELEASE(_tempManifest); + AX_SAFE_RELEASE(_tempManifest); _tempManifest = nullptr; } } @@ -241,9 +241,9 @@ void AssetsManagerEx::initManifests(std::string_view manifestUrl) if (!_inited) { - CC_SAFE_RELEASE(_localManifest); - CC_SAFE_RELEASE(_tempManifest); - CC_SAFE_RELEASE(_remoteManifest); + AX_SAFE_RELEASE(_localManifest); + AX_SAFE_RELEASE(_tempManifest); + AX_SAFE_RELEASE(_remoteManifest); _localManifest = nullptr; _tempManifest = nullptr; _remoteManifest = nullptr; @@ -270,7 +270,7 @@ void AssetsManagerEx::loadLocalManifest(std::string_view /*manifestUrl*/) if (!cachedManifest->isLoaded()) { _fileUtils->removeFile(_cacheManifestPath); - CC_SAFE_RELEASE(cachedManifest); + AX_SAFE_RELEASE(cachedManifest); cachedManifest = nullptr; } } @@ -309,11 +309,11 @@ void AssetsManagerEx::loadLocalManifest(std::string_view /*manifestUrl*/) // Recreate storage, to empty the content _fileUtils->removeDirectory(_storagePath); _fileUtils->createDirectory(_storagePath); - CC_SAFE_RELEASE(cachedManifest); + AX_SAFE_RELEASE(cachedManifest); } else { - CC_SAFE_RELEASE(_localManifest); + AX_SAFE_RELEASE(_localManifest); _localManifest = cachedManifest; } } @@ -775,7 +775,7 @@ void AssetsManagerEx::startUpdate() { // Remove all temp files _fileUtils->removeDirectory(_tempStoragePath); - CC_SAFE_RELEASE(_tempManifest); + AX_SAFE_RELEASE(_tempManifest); // Recreate temp storage path and save remote manifest _fileUtils->createDirectory(_tempStoragePath); _remoteManifest->saveToFile(_tempManifestPath); @@ -861,7 +861,7 @@ void AssetsManagerEx::updateSucceed() _fileUtils->removeDirectory(_tempStoragePath); } // 3. swap the localManifest - CC_SAFE_RELEASE(_localManifest); + AX_SAFE_RELEASE(_localManifest); _localManifest = _remoteManifest; _localManifest->setManifestRoot(_storagePath); _remoteManifest = nullptr; diff --git a/extensions/assets-manager/AssetsManagerEx.h b/extensions/assets-manager/AssetsManagerEx.h index 3270c3442e..2c4d1c1934 100644 --- a/extensions/assets-manager/AssetsManagerEx.h +++ b/extensions/assets-manager/AssetsManagerEx.h @@ -48,7 +48,7 @@ NS_AX_EXT_BEGIN /** * @brief This class is used to auto update resources, such as pictures or scripts. */ -class CC_EX_DLL AssetsManagerEx : public Ref +class AX_EX_DLL AssetsManagerEx : public Ref { public: //! Update states diff --git a/extensions/assets-manager/CCEventAssetsManagerEx.h b/extensions/assets-manager/CCEventAssetsManagerEx.h index c966449633..c57f19d846 100644 --- a/extensions/assets-manager/CCEventAssetsManagerEx.h +++ b/extensions/assets-manager/CCEventAssetsManagerEx.h @@ -35,7 +35,7 @@ NS_AX_EXT_BEGIN class AssetsManagerEx; -class CC_EX_DLL EventAssetsManagerEx : public axis::EventCustom +class AX_EX_DLL EventAssetsManagerEx : public axis::EventCustom { public: friend class AssetsManagerEx; diff --git a/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp b/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp index 8efa185729..b85bf26085 100644 --- a/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp +++ b/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp @@ -47,7 +47,7 @@ EventListenerAssetsManagerEx* EventListenerAssetsManagerEx::create( } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -81,7 +81,7 @@ EventListenerAssetsManagerEx* EventListenerAssetsManagerEx::clone() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/extensions/assets-manager/CCEventListenerAssetsManagerEx.h b/extensions/assets-manager/CCEventListenerAssetsManagerEx.h index 55b2068877..9bf1481c9f 100644 --- a/extensions/assets-manager/CCEventListenerAssetsManagerEx.h +++ b/extensions/assets-manager/CCEventListenerAssetsManagerEx.h @@ -50,7 +50,7 @@ class AssetsManagerEx; * * dispatcher->removeEventListener(listener); */ -class CC_EX_DLL EventListenerAssetsManagerEx : public axis::EventListenerCustom +class AX_EX_DLL EventListenerAssetsManagerEx : public axis::EventListenerCustom { public: friend class AssetsManagerEx; diff --git a/extensions/assets-manager/Manifest.h b/extensions/assets-manager/Manifest.h index 0297b4e5c2..ac3cd61445 100644 --- a/extensions/assets-manager/Manifest.h +++ b/extensions/assets-manager/Manifest.h @@ -58,7 +58,7 @@ struct ManifestAsset typedef hlookup::string_map DownloadUnits; -class CC_EX_DLL Manifest : public Ref +class AX_EX_DLL Manifest : public Ref { public: friend class AssetsManagerEx; diff --git a/extensions/cocostudio/ActionTimeline/CCActionTimeline.cpp b/extensions/cocostudio/ActionTimeline/CCActionTimeline.cpp index 02aa848038..9641ee3599 100644 --- a/extensions/cocostudio/ActionTimeline/CCActionTimeline.cpp +++ b/extensions/cocostudio/ActionTimeline/CCActionTimeline.cpp @@ -41,7 +41,7 @@ ActionTimelineData* ActionTimelineData::create(int actionTag) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -67,7 +67,7 @@ ActionTimeline* ActionTimeline::create() ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } diff --git a/extensions/cocostudio/ActionTimeline/CCActionTimelineCache.cpp b/extensions/cocostudio/ActionTimeline/CCActionTimelineCache.cpp index 6b505560e2..93c308244d 100644 --- a/extensions/cocostudio/ActionTimeline/CCActionTimelineCache.cpp +++ b/extensions/cocostudio/ActionTimeline/CCActionTimelineCache.cpp @@ -99,7 +99,7 @@ ActionTimelineCache* ActionTimelineCache::getInstance() void ActionTimelineCache::destroyInstance() { - CC_SAFE_DELETE(_sharedActionCache); + AX_SAFE_DELETE(_sharedActionCache); } void ActionTimelineCache::purge() @@ -443,7 +443,7 @@ ActionTimeline* ActionTimelineCache::loadAnimationActionWithFlatBuffersFile(std: std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName); - CC_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); + AX_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); Data buf = FileUtils::getInstance()->getDataFromFile(fullPath); action = createActionWithDataBuffer(buf); @@ -461,7 +461,7 @@ ActionTimeline* ActionTimelineCache::loadAnimationWithDataBuffer(const axis::Dat std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName); - CC_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); + AX_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); action = createActionWithDataBuffer(data); _animationActions.insert(fileName, action); diff --git a/extensions/cocostudio/ActionTimeline/CCActionTimelineData.cpp b/extensions/cocostudio/ActionTimeline/CCActionTimelineData.cpp index 84c5db52c1..d88a1c3ffb 100644 --- a/extensions/cocostudio/ActionTimeline/CCActionTimelineData.cpp +++ b/extensions/cocostudio/ActionTimeline/CCActionTimelineData.cpp @@ -12,7 +12,7 @@ ActionTimelineData* ActionTimelineData::create(int actionTag) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } diff --git a/extensions/cocostudio/ActionTimeline/CCActionTimelineNode.cpp b/extensions/cocostudio/ActionTimeline/CCActionTimelineNode.cpp index 1d378fc376..4a79912ff7 100644 --- a/extensions/cocostudio/ActionTimeline/CCActionTimelineNode.cpp +++ b/extensions/cocostudio/ActionTimeline/CCActionTimelineNode.cpp @@ -36,7 +36,7 @@ ActionTimelineNode* ActionTimelineNode::create(Node* root, ActionTimeline* actio ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } diff --git a/extensions/cocostudio/ActionTimeline/CCBoneNode.cpp b/extensions/cocostudio/ActionTimeline/CCBoneNode.cpp index 4520e9da06..f21c43c9ee 100644 --- a/extensions/cocostudio/ActionTimeline/CCBoneNode.cpp +++ b/extensions/cocostudio/ActionTimeline/CCBoneNode.cpp @@ -41,7 +41,7 @@ BoneNode* BoneNode::create() ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -55,7 +55,7 @@ BoneNode* BoneNode::create(int length) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -136,7 +136,7 @@ void BoneNode::addSkin(SkinNode* skin, bool display) void BoneNode::removeChild(Node* child, bool cleanup /* = true */) { ssize_t index = _children.getIndex(child); - if (index != axis::CC_INVALID_INDEX) + if (index != axis::AX_INVALID_INDEX) { removeFromChildrenListHelper(child); Node::removeChild(child, cleanup); @@ -420,7 +420,7 @@ void BoneNode::draw(axis::Renderer* renderer, const axis::Mat4& transform, uint3 _customCommand.init(_globalZOrder, _blendFunc); renderer->addCommand(&_customCommand); -#ifdef CC_STUDIO_ENABLED_VIEW +#ifdef AX_STUDIO_ENABLED_VIEW // TODO // glVertexAttribPointer(axis::GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _noMVPVertices); // glVertexAttribPointer(axis::GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, _squareColors); @@ -428,8 +428,8 @@ void BoneNode::draw(axis::Renderer* renderer, const axis::Mat4& transform, uint3 // glEnable(GL_LINE_SMOOTH); // glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE); // glDrawArrays(GL_LINE_LOOP, 0, 4); -// CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8); -#endif // CC_STUDIO_ENABLED_VIEW +// AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8); +#endif // AX_STUDIO_ENABLED_VIEW for (int i = 0; i < 4; ++i) { @@ -564,7 +564,7 @@ SkeletonNode* BoneNode::getRootSkeletonNode() const return _rootSkeleton; } -#ifdef CC_STUDIO_ENABLED_VIEW +#ifdef AX_STUDIO_ENABLED_VIEW bool BoneNode::isPointOnRack(const axis::Vec2& bonePoint) { @@ -584,7 +584,7 @@ bool BoneNode::isPointOnRack(const axis::Vec2& bonePoint) } return false; } -#endif // CC_STUDIO_ENABLED_VIEW +#endif // AX_STUDIO_ENABLED_VIEW void BoneNode::batchBoneDrawToSkeleton(BoneNode* bone) const { diff --git a/extensions/cocostudio/ActionTimeline/CCBoneNode.h b/extensions/cocostudio/ActionTimeline/CCBoneNode.h index 7b02ad1998..f2ecb3fae5 100644 --- a/extensions/cocostudio/ActionTimeline/CCBoneNode.h +++ b/extensions/cocostudio/ActionTimeline/CCBoneNode.h @@ -156,7 +156,7 @@ public: // set localzorder, and recalculate debugdraw virtual void setAnchorPoint(const axis::Vec2& anchorPoint) override; -#ifdef CC_STUDIO_ENABLED_VIEW +#ifdef AX_STUDIO_ENABLED_VIEW // hit test , bonePoint is in self coordinate virtual bool isPointOnRack(const axis::Vec2& bonePoint); #endif @@ -235,7 +235,7 @@ private: axis::Vec2 _squareVertices[4]; VertexData _vertexData[4]; - CC_DISALLOW_COPY_AND_ASSIGN(BoneNode); + AX_DISALLOW_COPY_AND_ASSIGN(BoneNode); }; NS_TIMELINE_END diff --git a/extensions/cocostudio/ActionTimeline/CCFrame.h b/extensions/cocostudio/ActionTimeline/CCFrame.h index 0a360112d0..8d242bc98d 100644 --- a/extensions/cocostudio/ActionTimeline/CCFrame.h +++ b/extensions/cocostudio/ActionTimeline/CCFrame.h @@ -317,8 +317,8 @@ public: virtual Frame* clone() override; /** @deprecated Use method setAlpha() and getAlpha() of AlphaFrame instead */ - CC_DEPRECATED_ATTRIBUTE inline void setAlpha(uint8_t alpha) { _alpha = alpha; } - CC_DEPRECATED_ATTRIBUTE inline uint8_t getAlpha() const { return _alpha; } + AX_DEPRECATED_ATTRIBUTE inline void setAlpha(uint8_t alpha) { _alpha = alpha; } + AX_DEPRECATED_ATTRIBUTE inline uint8_t getAlpha() const { return _alpha; } inline void setColor(const axis::Color3B& color) { _color = color; } inline axis::Color3B getColor() const { return _color; } diff --git a/extensions/cocostudio/ActionTimeline/CCSkeletonNode.cpp b/extensions/cocostudio/ActionTimeline/CCSkeletonNode.cpp index 74847baef2..882ffd6ee4 100644 --- a/extensions/cocostudio/ActionTimeline/CCSkeletonNode.cpp +++ b/extensions/cocostudio/ActionTimeline/CCSkeletonNode.cpp @@ -40,7 +40,7 @@ SkeletonNode* SkeletonNode::create() skeletonNode->autorelease(); return skeletonNode; } - CC_SAFE_DELETE(skeletonNode); + AX_SAFE_DELETE(skeletonNode); return nullptr; } @@ -268,7 +268,7 @@ void SkeletonNode::batchDrawAllSubBones() axis::CustomCommand::BufferUsage::DYNAMIC); _batchBoneCommand.updateVertexBuffer(_batchedBoneVertexData.data(), sizeof(VertexData) * _batchedVeticesCount); -#ifdef CC_STUDIO_ENABLED_VIEW +#ifdef AX_STUDIO_ENABLED_VIEW // TODO // glLineWidth(1); // glEnable(GL_LINE_SMOOTH); @@ -278,7 +278,7 @@ void SkeletonNode::batchDrawAllSubBones() // glDrawArrays(GL_TRIANGLE_FAN, i, 4); // glDrawArrays(GL_LINE_LOOP, i, 4); // } -// CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _batchedVeticesCount); +// AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _batchedVeticesCount); #else unsigned short* indices = (unsigned short*)malloc(sizeof(unsigned short) * _batchedVeticesCount); for (int i = 0; i < _batchedVeticesCount; i += 4) @@ -295,7 +295,7 @@ void SkeletonNode::batchDrawAllSubBones() axis::CustomCommand::BufferUsage::DYNAMIC); _batchBoneCommand.updateIndexBuffer(indices, sizeof(unsigned short) * _batchedVeticesCount); free(indices); -#endif // CC_STUDIO_ENABLED_VIEW +#endif // AX_STUDIO_ENABLED_VIEW } void SkeletonNode::changeSkins(const hlookup::string_map& boneSkinNameMap) diff --git a/extensions/cocostudio/ActionTimeline/CCSkeletonNode.h b/extensions/cocostudio/ActionTimeline/CCSkeletonNode.h index cf66fda305..4282034fa3 100644 --- a/extensions/cocostudio/ActionTimeline/CCSkeletonNode.h +++ b/extensions/cocostudio/ActionTimeline/CCSkeletonNode.h @@ -100,7 +100,7 @@ private: hlookup::string_map> _skinGroupMap; // map< suit name, map< bone name, skin name> > - CC_DISALLOW_COPY_AND_ASSIGN(SkeletonNode); + AX_DISALLOW_COPY_AND_ASSIGN(SkeletonNode); void checkSubBonesDirty(); // for draw skins as ordered bones' local z diff --git a/extensions/cocostudio/ActionTimeline/CCTimelineMacro.h b/extensions/cocostudio/ActionTimeline/CCTimelineMacro.h index ac9a476eff..9d2df6e5f2 100644 --- a/extensions/cocostudio/ActionTimeline/CCTimelineMacro.h +++ b/extensions/cocostudio/ActionTimeline/CCTimelineMacro.h @@ -22,8 +22,8 @@ Copyright (c) 2013-2017 Chukong Technologies OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_TIMELINE_MACROS_H__ -#define __CC_TIMELINE_MACROS_H__ +#ifndef __AX_TIMELINE_MACROS_H__ +#define __AX_TIMELINE_MACROS_H__ #ifdef __cplusplus # define NS_TIMELINE_BEGIN \ diff --git a/extensions/cocostudio/ActionTimeline/CSLoader.cpp b/extensions/cocostudio/ActionTimeline/CSLoader.cpp index cd8ca5c348..33977d1ef0 100644 --- a/extensions/cocostudio/ActionTimeline/CSLoader.cpp +++ b/extensions/cocostudio/ActionTimeline/CSLoader.cpp @@ -79,7 +79,7 @@ #include "WidgetReader/SkeletonReader/BoneNodeReader.h" #include "WidgetReader/SkeletonReader/SkeletonNodeReader.h" -#if defined(CC_BUILD_WITH_SPINE) && CC_BUILD_WITH_SPINE +#if defined(AX_BUILD_WITH_SPINE) && AX_BUILD_WITH_SPINE # include "WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h" #endif #include "WidgetReader/RichTextReader/RichTextReader.h" @@ -197,7 +197,7 @@ CSLoader* CSLoader::getInstance() void CSLoader::destroyInstance() { - CC_SAFE_DELETE(_sharedCSLoader); + AX_SAFE_DELETE(_sharedCSLoader); ActionTimelineCache::destroyInstance(); } @@ -238,7 +238,7 @@ CSLoader::CSLoader() /// Added by x-studio CREATE_CLASS_NODE_READER_INFO(RichTextReader); -#if defined(CC_BUILD_WITH_SPINE) && CC_BUILD_WITH_SPINE +#if defined(AX_BUILD_WITH_SPINE) && AX_BUILD_WITH_SPINE CREATE_CLASS_NODE_READER_INFO(SpineSkeletonReader); #endif CREATE_CLASS_NODE_READER_INFO(RadioButtonReader); @@ -897,9 +897,9 @@ Node* CSLoader::createNode(const Data& data, const ccNodeLoadCallback& callback) Node* node = nullptr; do { - CC_BREAK_IF(data.isNull() || data.getSize() <= 0); + AX_BREAK_IF(data.isNull() || data.getSize() <= 0); auto csparsebinary = GetCSParseBinary(data.getBytes()); - CC_BREAK_IF(nullptr == csparsebinary); + AX_BREAK_IF(nullptr == csparsebinary); auto csBuildId = csparsebinary->version(); if (csBuildId) { @@ -1004,14 +1004,14 @@ Node* CSLoader::nodeWithFlatBuffersFile(std::string_view fileName, const ccNodeL { std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName); - CC_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); + AX_ASSERT(FileUtils::getInstance()->isFileExist(fullPath)); Data buf = FileUtils::getInstance()->getDataFromFile(fullPath); if (buf.isNull()) { CCLOG("CSLoader::nodeWithFlatBuffersFile - failed read file: %s", fileName.data()); - CC_ASSERT(false); + AX_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) { - CC_SAFE_DELETE(widget); + AX_SAFE_DELETE(widget); return true; } diff --git a/extensions/cocostudio/ActionTimeline/CSLoader.h b/extensions/cocostudio/ActionTimeline/CSLoader.h index 2c4e19f2bc..d026d018b1 100644 --- a/extensions/cocostudio/ActionTimeline/CSLoader.h +++ b/extensions/cocostudio/ActionTimeline/CSLoader.h @@ -75,7 +75,7 @@ public: CSLoader(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE void purge(); + AX_DEPRECATED_ATTRIBUTE void purge(); void init(); diff --git a/extensions/cocostudio/CCActionManagerEx.cpp b/extensions/cocostudio/CCActionManagerEx.cpp index 0868543dd5..ea59f0356f 100644 --- a/extensions/cocostudio/CCActionManagerEx.cpp +++ b/extensions/cocostudio/CCActionManagerEx.cpp @@ -46,7 +46,7 @@ void ActionManagerEx::destroyInstance() if (sharedActionManager != nullptr) { sharedActionManager->releaseActions(); - CC_SAFE_DELETE(sharedActionManager); + AX_SAFE_DELETE(sharedActionManager); } } diff --git a/extensions/cocostudio/CCActionNode.cpp b/extensions/cocostudio/CCActionNode.cpp index e92fafe34b..6d8e042def 100644 --- a/extensions/cocostudio/CCActionNode.cpp +++ b/extensions/cocostudio/CCActionNode.cpp @@ -58,20 +58,20 @@ ActionNode::~ActionNode() { if (_action == nullptr) { - CC_SAFE_RELEASE_NULL(_actionSpawn); + AX_SAFE_RELEASE_NULL(_actionSpawn); } else { - CC_SAFE_RELEASE_NULL(_action); - CC_SAFE_RELEASE_NULL(_actionSpawn); + AX_SAFE_RELEASE_NULL(_action); + AX_SAFE_RELEASE_NULL(_actionSpawn); } - CC_SAFE_RELEASE(_object); + AX_SAFE_RELEASE(_object); for (auto object : _frameArray) { object->clear(); - CC_SAFE_DELETE(object); + AX_SAFE_DELETE(object); } _frameArray.clear(); } @@ -395,9 +395,9 @@ int ActionNode::getActionTag() void ActionNode::setObject(Ref* node) { - CC_SAFE_RELEASE(_object); + AX_SAFE_RELEASE(_object); _object = node; - CC_SAFE_RETAIN(_object); + AX_SAFE_RETAIN(_object); } Ref* ActionNode::getObject() @@ -527,16 +527,16 @@ Spawn* ActionNode::refreshActionProperty() if (_action == nullptr) { - CC_SAFE_RELEASE_NULL(_actionSpawn); + AX_SAFE_RELEASE_NULL(_actionSpawn); } else { - CC_SAFE_RELEASE_NULL(_action); - CC_SAFE_RELEASE_NULL(_actionSpawn); + AX_SAFE_RELEASE_NULL(_action); + AX_SAFE_RELEASE_NULL(_actionSpawn); } _actionSpawn = Spawn::create(cSpawnArray); - CC_SAFE_RETAIN(_actionSpawn); + AX_SAFE_RETAIN(_actionSpawn); return _actionSpawn; } diff --git a/extensions/cocostudio/CCActionObject.cpp b/extensions/cocostudio/CCActionObject.cpp index 459fdcc355..3e6c7d8917 100644 --- a/extensions/cocostudio/CCActionObject.cpp +++ b/extensions/cocostudio/CCActionObject.cpp @@ -47,7 +47,7 @@ ActionObject::ActionObject() , _fTotalTime(0.0f) { _pScheduler = Director::getInstance()->getScheduler(); - CC_SAFE_RETAIN(_pScheduler); + AX_SAFE_RETAIN(_pScheduler); } ActionObject::~ActionObject() @@ -55,8 +55,8 @@ ActionObject::~ActionObject() _loop = false; _pScheduler->unscheduleAllForTarget(this); _actionNodeList.clear(); - CC_SAFE_RELEASE(_pScheduler); - CC_SAFE_RELEASE(_CallBack); + AX_SAFE_RELEASE(_pScheduler); + AX_SAFE_RELEASE(_CallBack); } void ActionObject::setName(const char* name) @@ -233,12 +233,12 @@ void ActionObject::play() } if (_loop) { - _pScheduler->schedule(CC_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this, 0.0f, CC_REPEAT_FOREVER, + _pScheduler->schedule(AX_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this, 0.0f, AX_REPEAT_FOREVER, 0.0f, false); } else { - _pScheduler->schedule(CC_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this, 0.0f, false); + _pScheduler->schedule(AX_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this, 0.0f, false); } } @@ -246,7 +246,7 @@ void ActionObject::play(CallFunc* func) { this->play(); this->_CallBack = func; - CC_SAFE_RETAIN(_CallBack); + AX_SAFE_RETAIN(_CallBack); } void ActionObject::pause() { @@ -261,7 +261,7 @@ void ActionObject::stop() e->stopAction(); } _bPlaying = false; - _pScheduler->unschedule(CC_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this); + _pScheduler->unschedule(AX_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this); _bPause = false; } @@ -300,7 +300,7 @@ void ActionObject::simulationActionUpdate(float /*dt*/) else { _bPlaying = false; - _pScheduler->unschedule(CC_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this); + _pScheduler->unschedule(AX_SCHEDULE_SELECTOR(ActionObject::simulationActionUpdate), this); } } } diff --git a/extensions/cocostudio/CCArmature.cpp b/extensions/cocostudio/CCArmature.cpp index eab47c2e9b..f400df5f83 100644 --- a/extensions/cocostudio/CCArmature.cpp +++ b/extensions/cocostudio/CCArmature.cpp @@ -53,7 +53,7 @@ Armature* Armature::create() armature->autorelease(); return armature; } - CC_SAFE_DELETE(armature); + AX_SAFE_DELETE(armature); return nullptr; } @@ -65,7 +65,7 @@ Armature* Armature::create(std::string_view name) armature->autorelease(); return armature; } - CC_SAFE_DELETE(armature); + AX_SAFE_DELETE(armature); return nullptr; } @@ -77,7 +77,7 @@ Armature* Armature::create(std::string_view name, Bone* parentBone) armature->autorelease(); return armature; } - CC_SAFE_DELETE(armature); + AX_SAFE_DELETE(armature); return nullptr; } @@ -94,7 +94,7 @@ Armature::~Armature() _boneDic.clear(); _topBoneList.clear(); - CC_SAFE_DELETE(_animation); + AX_SAFE_DELETE(_animation); } bool Armature::init() @@ -109,7 +109,7 @@ bool Armature::init(std::string_view name) { removeAllChildren(); - CC_SAFE_DELETE(_animation); + AX_SAFE_DELETE(_animation); _animation = new ArmatureAnimation(); _animation->init(this); @@ -142,13 +142,13 @@ bool Armature::init(std::string_view name) do { MovementData* movData = animationData->getMovement(animationData->movementNames.at(0)); - CC_BREAK_IF(!movData); + AX_BREAK_IF(!movData); MovementBoneData* movBoneData = movData->getMovementBoneData(bone->getName()); - CC_BREAK_IF(!movBoneData || movBoneData->frameList.size() <= 0); + AX_BREAK_IF(!movBoneData || movBoneData->frameList.size() <= 0); FrameData* frameData = movBoneData->getFrameData(0); - CC_BREAK_IF(!frameData); + AX_BREAK_IF(!frameData); bone->getTweenData()->copy(frameData); bone->changeDisplayWithIndex(frameData->displayIndex, false); @@ -372,7 +372,7 @@ void Armature::draw(axis::Renderer* renderer, const Mat4& transform, uint32_t fl { if (_parentBone == nullptr && _batchNode == nullptr) { - // CC_NODE_DRAW_SETUP(); + // AX_NODE_DRAW_SETUP(); } for (auto& object : _children) @@ -419,7 +419,7 @@ void Armature::draw(axis::Renderer* renderer, const Mat4& transform, uint32_t fl default: { node->visit(renderer, transform, flags); - // CC_NODE_DRAW_SETUP(); + // AX_NODE_DRAW_SETUP(); } break; } @@ -427,7 +427,7 @@ void Armature::draw(axis::Renderer* renderer, const Mat4& transform, uint32_t fl else if (Node* node = dynamic_cast(object)) { node->visit(renderer, transform, flags); - // CC_NODE_DRAW_SETUP(); + // AX_NODE_DRAW_SETUP(); } } } diff --git a/extensions/cocostudio/CCArmature.h b/extensions/cocostudio/CCArmature.h index a472bc8405..480a1d5cb7 100644 --- a/extensions/cocostudio/CCArmature.h +++ b/extensions/cocostudio/CCArmature.h @@ -40,34 +40,34 @@ struct cpBody; namespace cocostudio { -CC_DEPRECATED_ATTRIBUTE typedef ProcessBase CCProcessBase; -CC_DEPRECATED_ATTRIBUTE typedef BaseData CCBaseData; -CC_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef SpriteDisplayData CCSpriteDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureDisplayData CCArmatureDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef ParticleDisplayData CCParticleDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef BoneData CCBoneData; -CC_DEPRECATED_ATTRIBUTE typedef FrameData CCFrameData; -CC_DEPRECATED_ATTRIBUTE typedef MovementBoneData CCMovementBoneData; -CC_DEPRECATED_ATTRIBUTE typedef MovementData CCMovementData; -CC_DEPRECATED_ATTRIBUTE typedef AnimationData CCAnimationData; -CC_DEPRECATED_ATTRIBUTE typedef ContourData CCContourData; -CC_DEPRECATED_ATTRIBUTE typedef TextureData CCTextureData; -CC_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; -CC_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef DisplayFactory CCDisplayFactory; -CC_DEPRECATED_ATTRIBUTE typedef BatchNode CCBatchNode; -CC_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; -CC_DEPRECATED_ATTRIBUTE typedef DisplayManager CCDisplayManager; -CC_DEPRECATED_ATTRIBUTE typedef ColliderBody CCColliderBody; -CC_DEPRECATED_ATTRIBUTE typedef ColliderDetector CCColliderDetector; -CC_DEPRECATED_ATTRIBUTE typedef SpriteFrameCacheHelper CCSpriteFrameCacheHelper; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureData CCArmatureData; -CC_DEPRECATED_ATTRIBUTE typedef Bone CCBone; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation; -CC_DEPRECATED_ATTRIBUTE typedef Armature CCArmature; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager; -CC_DEPRECATED_ATTRIBUTE typedef axis::tweenfunc::TweenType CCTweenType; +AX_DEPRECATED_ATTRIBUTE typedef ProcessBase CCProcessBase; +AX_DEPRECATED_ATTRIBUTE typedef BaseData CCBaseData; +AX_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; +AX_DEPRECATED_ATTRIBUTE typedef SpriteDisplayData CCSpriteDisplayData; +AX_DEPRECATED_ATTRIBUTE typedef ArmatureDisplayData CCArmatureDisplayData; +AX_DEPRECATED_ATTRIBUTE typedef ParticleDisplayData CCParticleDisplayData; +AX_DEPRECATED_ATTRIBUTE typedef BoneData CCBoneData; +AX_DEPRECATED_ATTRIBUTE typedef FrameData CCFrameData; +AX_DEPRECATED_ATTRIBUTE typedef MovementBoneData CCMovementBoneData; +AX_DEPRECATED_ATTRIBUTE typedef MovementData CCMovementData; +AX_DEPRECATED_ATTRIBUTE typedef AnimationData CCAnimationData; +AX_DEPRECATED_ATTRIBUTE typedef ContourData CCContourData; +AX_DEPRECATED_ATTRIBUTE typedef TextureData CCTextureData; +AX_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; +AX_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; +AX_DEPRECATED_ATTRIBUTE typedef DisplayFactory CCDisplayFactory; +AX_DEPRECATED_ATTRIBUTE typedef BatchNode CCBatchNode; +AX_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; +AX_DEPRECATED_ATTRIBUTE typedef DisplayManager CCDisplayManager; +AX_DEPRECATED_ATTRIBUTE typedef ColliderBody CCColliderBody; +AX_DEPRECATED_ATTRIBUTE typedef ColliderDetector CCColliderDetector; +AX_DEPRECATED_ATTRIBUTE typedef SpriteFrameCacheHelper CCSpriteFrameCacheHelper; +AX_DEPRECATED_ATTRIBUTE typedef ArmatureData CCArmatureData; +AX_DEPRECATED_ATTRIBUTE typedef Bone CCBone; +AX_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation; +AX_DEPRECATED_ATTRIBUTE typedef Armature CCArmature; +AX_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager; +AX_DEPRECATED_ATTRIBUTE typedef axis::tweenfunc::TweenType CCTweenType; class CCS_DLL Armature : public axis::Node, public axis::BlendProtocol { @@ -195,7 +195,7 @@ public: #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT virtual void setColliderFilter(ColliderFilter* filter); #elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX - CC_DEPRECATED_ATTRIBUTE virtual void drawContour(); + AX_DEPRECATED_ATTRIBUTE virtual void drawContour(); #endif virtual void setArmatureData(ArmatureData* armatureData) { _armatureData = armatureData; } diff --git a/extensions/cocostudio/CCArmatureAnimation.cpp b/extensions/cocostudio/CCArmatureAnimation.cpp index a1ad553f2c..ed34ecce4b 100644 --- a/extensions/cocostudio/CCArmatureAnimation.cpp +++ b/extensions/cocostudio/CCArmatureAnimation.cpp @@ -41,7 +41,7 @@ ArmatureAnimation* ArmatureAnimation::create(Armature* armature) pArmatureAnimation->autorelease(); return pArmatureAnimation; } - CC_SAFE_DELETE(pArmatureAnimation); + AX_SAFE_DELETE(pArmatureAnimation); return nullptr; } @@ -69,9 +69,9 @@ ArmatureAnimation::ArmatureAnimation() ArmatureAnimation::~ArmatureAnimation(void) { - CC_SAFE_RELEASE_NULL(_animationData); + AX_SAFE_RELEASE_NULL(_animationData); - CC_SAFE_RELEASE_NULL(_userObject); + AX_SAFE_RELEASE_NULL(_userObject); } bool ArmatureAnimation::init(Armature* armature) @@ -254,7 +254,7 @@ void ArmatureAnimation::playByIndex(int animationIndex, int durationTo, int loop void ArmatureAnimation::playWithIndex(int animationIndex, int durationTo, int loop) { std::vector& movName = _animationData->movementNames; - CC_ASSERT((animationIndex > -1) && ((unsigned int)animationIndex < movName.size())); + AX_ASSERT((animationIndex > -1) && ((unsigned int)animationIndex < movName.size())); std::string animationName = movName.at(animationIndex); play(animationName, durationTo, loop); @@ -366,7 +366,7 @@ void ArmatureAnimation::update(float dt) _ignoreFrameEvent = false; - CC_SAFE_DELETE(event); + AX_SAFE_DELETE(event); } while (_movementEventQueue.size() > 0) @@ -384,7 +384,7 @@ void ArmatureAnimation::update(float dt) _movementEventListener(event->armature, event->movementType, event->movementID); } - CC_SAFE_DELETE(event); + AX_SAFE_DELETE(event); } } @@ -482,8 +482,8 @@ void ArmatureAnimation::setFrameEventCallFunc( void ArmatureAnimation::setUserObject(Ref* pUserObject) { - CC_SAFE_RETAIN(pUserObject); - CC_SAFE_RELEASE(_userObject); + AX_SAFE_RETAIN(pUserObject); + AX_SAFE_RELEASE(_userObject); _userObject = pUserObject; } diff --git a/extensions/cocostudio/CCArmatureAnimation.h b/extensions/cocostudio/CCArmatureAnimation.h index 6b61f316ce..f9abd11ae9 100644 --- a/extensions/cocostudio/CCArmatureAnimation.h +++ b/extensions/cocostudio/CCArmatureAnimation.h @@ -95,8 +95,8 @@ public: * This method is deprecated, please use setSpeedScale. * @param animationScale Scale value */ - CC_DEPRECATED_ATTRIBUTE virtual void setAnimationScale(float animationScale); - CC_DEPRECATED_ATTRIBUTE virtual float getAnimationScale() const; + AX_DEPRECATED_ATTRIBUTE virtual void setAnimationScale(float animationScale); + AX_DEPRECATED_ATTRIBUTE virtual float getAnimationScale() const; /** * Scale animation play speed. @@ -106,7 +106,7 @@ public: virtual float getSpeedScale() const; //! The animation update speed - CC_DEPRECATED_ATTRIBUTE virtual void setAnimationInternal(float animationInternal) {} + AX_DEPRECATED_ATTRIBUTE virtual void setAnimationInternal(float animationInternal) {} using ProcessBase::play; /** @@ -130,7 +130,7 @@ public: * @deprecated, please use playWithIndex * @param animationIndex the animation index you want to play */ - CC_DEPRECATED_ATTRIBUTE virtual void playByIndex(int animationIndex, int durationTo = -1, int loop = -1); + AX_DEPRECATED_ATTRIBUTE virtual void playByIndex(int animationIndex, int durationTo = -1, int loop = -1); virtual void playWithIndex(int animationIndex, int durationTo = -1, int loop = -1); virtual void playWithNames(const std::vector& movementNames, int durationTo = -1, bool loop = true); @@ -183,13 +183,13 @@ public: * Set armature's movement event callback function * To disconnect this event, just setMovementEventCallFunc(nullptr, nullptr); */ - CC_DEPRECATED_ATTRIBUTE void setMovementEventCallFunc(axis::Ref* target, SEL_MovementEventCallFunc callFunc); + AX_DEPRECATED_ATTRIBUTE void setMovementEventCallFunc(axis::Ref* target, SEL_MovementEventCallFunc callFunc); /** * Set armature's frame event callback function * To disconnect this event, just setFrameEventCallFunc(nullptr, nullptr); */ - CC_DEPRECATED_ATTRIBUTE void setFrameEventCallFunc(axis::Ref* target, SEL_FrameEventCallFunc callFunc); + AX_DEPRECATED_ATTRIBUTE void setFrameEventCallFunc(axis::Ref* target, SEL_FrameEventCallFunc callFunc); void setMovementEventCallFunc( std::function listener); @@ -201,8 +201,8 @@ public: { if (_animationData != data) { - CC_SAFE_RETAIN(data); - CC_SAFE_RELEASE(_animationData); + AX_SAFE_RETAIN(data); + AX_SAFE_RELEASE(_animationData); _animationData = data; } } diff --git a/extensions/cocostudio/CCArmatureDataManager.cpp b/extensions/cocostudio/CCArmatureDataManager.cpp index 4ddff62d8f..14a4cdcea5 100644 --- a/extensions/cocostudio/CCArmatureDataManager.cpp +++ b/extensions/cocostudio/CCArmatureDataManager.cpp @@ -42,7 +42,7 @@ ArmatureDataManager* ArmatureDataManager::getInstance() s_sharedArmatureDataManager = new ArmatureDataManager(); if (!s_sharedArmatureDataManager->init()) { - CC_SAFE_DELETE(s_sharedArmatureDataManager); + AX_SAFE_DELETE(s_sharedArmatureDataManager); } } return s_sharedArmatureDataManager; @@ -52,7 +52,7 @@ void ArmatureDataManager::destroyInstance() { SpriteFrameCacheHelper::purge(); DataReaderHelper::purge(); - CC_SAFE_RELEASE_NULL(s_sharedArmatureDataManager); + AX_SAFE_RELEASE_NULL(s_sharedArmatureDataManager); } ArmatureDataManager::ArmatureDataManager(void) diff --git a/extensions/cocostudio/CCArmatureDataManager.h b/extensions/cocostudio/CCArmatureDataManager.h index 8409791162..646df7f2ce 100644 --- a/extensions/cocostudio/CCArmatureDataManager.h +++ b/extensions/cocostudio/CCArmatureDataManager.h @@ -47,13 +47,13 @@ class CCS_DLL ArmatureDataManager : public axis::Ref { public: /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static ArmatureDataManager* sharedArmatureDataManager() + AX_DEPRECATED_ATTRIBUTE static ArmatureDataManager* sharedArmatureDataManager() { return ArmatureDataManager::getInstance(); } /** @deprecated Use destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge() { ArmatureDataManager::destroyInstance(); }; + AX_DEPRECATED_ATTRIBUTE static void purge() { ArmatureDataManager::destroyInstance(); }; static ArmatureDataManager* getInstance(); static void destroyInstance(); diff --git a/extensions/cocostudio/CCBatchNode.cpp b/extensions/cocostudio/CCBatchNode.cpp index 2817166847..bb69ff6391 100644 --- a/extensions/cocostudio/CCBatchNode.cpp +++ b/extensions/cocostudio/CCBatchNode.cpp @@ -40,13 +40,13 @@ BatchNode* BatchNode::create() batchNode->autorelease(); return batchNode; } - CC_SAFE_DELETE(batchNode); + AX_SAFE_DELETE(batchNode); return nullptr; } BatchNode::BatchNode() : _groupCommand(nullptr) {} BatchNode::~BatchNode() { - CC_SAFE_DELETE(_groupCommand); + AX_SAFE_DELETE(_groupCommand); } bool BatchNode::init() @@ -131,7 +131,7 @@ void BatchNode::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) return; } - // CC_NODE_DRAW_SETUP(); + // AX_NODE_DRAW_SETUP(); bool pushed = false; for (auto object : _children) diff --git a/extensions/cocostudio/CCBone.cpp b/extensions/cocostudio/CCBone.cpp index b43e6b88dd..b178534c57 100644 --- a/extensions/cocostudio/CCBone.cpp +++ b/extensions/cocostudio/CCBone.cpp @@ -43,7 +43,7 @@ Bone* Bone::create() pBone->autorelease(); return pBone; } - CC_SAFE_DELETE(pBone); + AX_SAFE_DELETE(pBone); return nullptr; } @@ -56,7 +56,7 @@ Bone* Bone::create(std::string_view name) pBone->autorelease(); return pBone; } - CC_SAFE_DELETE(pBone); + AX_SAFE_DELETE(pBone); return nullptr; } @@ -80,14 +80,14 @@ Bone::Bone() Bone::~Bone(void) { - CC_SAFE_DELETE(_tweenData); - CC_SAFE_DELETE(_tween); - CC_SAFE_DELETE(_displayManager); - CC_SAFE_DELETE(_worldInfo); + AX_SAFE_DELETE(_tweenData); + AX_SAFE_DELETE(_tween); + AX_SAFE_DELETE(_displayManager); + AX_SAFE_DELETE(_worldInfo); - CC_SAFE_RELEASE_NULL(_boneData); + AX_SAFE_RELEASE_NULL(_boneData); - CC_SAFE_RELEASE(_childArmature); + AX_SAFE_RELEASE(_childArmature); } bool Bone::init() @@ -103,21 +103,21 @@ bool Bone::init(std::string_view name) _name = name; - CC_SAFE_DELETE(_tweenData); + AX_SAFE_DELETE(_tweenData); _tweenData = new FrameData(); - CC_SAFE_DELETE(_tween); + AX_SAFE_DELETE(_tween); _tween = new Tween(); _tween->init(this); - CC_SAFE_DELETE(_displayManager); + AX_SAFE_DELETE(_displayManager); _displayManager = new DisplayManager(); _displayManager->init(this); - CC_SAFE_DELETE(_worldInfo); + AX_SAFE_DELETE(_worldInfo); _worldInfo = new BaseData(); - CC_SAFE_DELETE(_boneData); + AX_SAFE_DELETE(_boneData); _boneData = new BoneData(); bRet = true; @@ -132,8 +132,8 @@ void Bone::setBoneData(BoneData* boneData) if (_boneData != boneData) { - CC_SAFE_RETAIN(boneData); - CC_SAFE_RELEASE(_boneData); + AX_SAFE_RETAIN(boneData); + AX_SAFE_RELEASE(_boneData); _boneData = boneData; } @@ -192,8 +192,8 @@ void Bone::update(float delta) _worldInfo->y = _worldInfo->y + _position.y; _worldInfo->scaleX = _worldInfo->scaleX * _scaleX; _worldInfo->scaleY = _worldInfo->scaleY * _scaleY; - _worldInfo->skewX = _worldInfo->skewX + _skewX + CC_DEGREES_TO_RADIANS(_rotationZ_X); - _worldInfo->skewY = _worldInfo->skewY + _skewY - CC_DEGREES_TO_RADIANS(_rotationZ_Y); + _worldInfo->skewX = _worldInfo->skewX + _skewX + AX_DEGREES_TO_RADIANS(_rotationZ_X); + _worldInfo->skewY = _worldInfo->skewY + _skewY - AX_DEGREES_TO_RADIANS(_rotationZ_Y); if (_parentBone) { @@ -249,17 +249,17 @@ void Bone::setBlendFunc(const BlendFunc& blendFunc) void Bone::updateDisplayedColor(const Color3B& parentColor) { -#ifdef CC_STUDIO_ENABLED_VIEW +#ifdef AX_STUDIO_ENABLED_VIEW _realColor = Color3B(255, 255, 255); -#endif // CC_STUDIO_ENABLED_VIEW +#endif // AX_STUDIO_ENABLED_VIEW Node::updateDisplayedColor(parentColor); } void Bone::updateDisplayedOpacity(uint8_t parentOpacity) { -#ifdef CC_STUDIO_ENABLED_VIEW +#ifdef AX_STUDIO_ENABLED_VIEW _realOpacity = 255; -#endif // CC_STUDIO_ENABLED_VIEW +#endif // AX_STUDIO_ENABLED_VIEW Node::updateDisplayedOpacity(parentOpacity); } @@ -297,7 +297,7 @@ void Bone::addChildBone(Bone* child) _children.reserve(4); } - if (_children.getIndex(child) == CC_INVALID_INDEX) + if (_children.getIndex(child) == AX_INVALID_INDEX) { _children.pushBack(child); child->setParentBone(this); @@ -306,7 +306,7 @@ void Bone::addChildBone(Bone* child) void Bone::removeChildBone(Bone* bone, bool recursion) { - if (!_children.empty() && _children.getIndex(bone) != CC_INVALID_INDEX) + if (!_children.empty() && _children.getIndex(bone) != AX_INVALID_INDEX) { if (recursion) { @@ -354,8 +354,8 @@ void Bone::setChildArmature(Armature* armature) _childArmature->setParentBone(nullptr); } - CC_SAFE_RETAIN(armature); - CC_SAFE_RELEASE(_childArmature); + AX_SAFE_RETAIN(armature); + AX_SAFE_RELEASE(_childArmature); _childArmature = armature; } } diff --git a/extensions/cocostudio/CCBone.h b/extensions/cocostudio/CCBone.h index 1ab62afcf9..3964bc7a4b 100644 --- a/extensions/cocostudio/CCBone.h +++ b/extensions/cocostudio/CCBone.h @@ -94,8 +94,8 @@ public: void removeDisplay(int index); - CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); - CC_DEPRECATED_ATTRIBUTE void changeDisplayByName(std::string_view name, bool force); + AX_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); + AX_DEPRECATED_ATTRIBUTE void changeDisplayByName(std::string_view name, bool force); void changeDisplayWithIndex(int index, bool force); void changeDisplayWithName(std::string_view name, bool force); @@ -194,7 +194,7 @@ public: * This function is deprecated, please use isIgnoreMovementBoneData() * @lua NA */ - CC_DEPRECATED_ATTRIBUTE virtual bool getIgnoreMovementBoneData() const { return isIgnoreMovementBoneData(); } + AX_DEPRECATED_ATTRIBUTE virtual bool getIgnoreMovementBoneData() const { return isIgnoreMovementBoneData(); } /* * Set blend function diff --git a/extensions/cocostudio/CCColliderDetector.cpp b/extensions/cocostudio/CCColliderDetector.cpp index e6d0b8cf8a..93399d3b06 100644 --- a/extensions/cocostudio/CCColliderDetector.cpp +++ b/extensions/cocostudio/CCColliderDetector.cpp @@ -60,39 +60,39 @@ void ColliderFilter::updateShape(cpShape* shape) #if ENABLE_PHYSICS_BOX2D_DETECT ColliderBody::ColliderBody(ContourData* contourData) : _fixture(nullptr), _contourData(contourData) { - CC_SAFE_RETAIN(_contourData); + AX_SAFE_RETAIN(_contourData); _filter = new ColliderFilter(); # if ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX _calculatedVertexList = Array::create(); - CC_SAFE_RETAIN(_calculatedVertexList); + AX_SAFE_RETAIN(_calculatedVertexList); # endif } #elif ENABLE_PHYSICS_CHIPMUNK_DETECT ColliderBody::ColliderBody(ContourData* contourData) : _shape(nullptr), _contourData(contourData) { - CC_SAFE_RETAIN(_contourData); + AX_SAFE_RETAIN(_contourData); _filter = new ColliderFilter(); # if ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX _calculatedVertexList = Array::create(); - CC_SAFE_RETAIN(_calculatedVertexList); + AX_SAFE_RETAIN(_calculatedVertexList); # endif } #elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX ColliderBody::ColliderBody(ContourData* contourData) : _contourData(contourData) { - CC_SAFE_RETAIN(_contourData); + AX_SAFE_RETAIN(_contourData); } #endif ColliderBody::~ColliderBody() { - CC_SAFE_RELEASE(_contourData); + AX_SAFE_RELEASE(_contourData); #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT - CC_SAFE_DELETE(_filter); + AX_SAFE_DELETE(_filter); #endif } @@ -115,7 +115,7 @@ ColliderDetector* ColliderDetector::create() pColliderDetector->autorelease(); return pColliderDetector; } - CC_SAFE_DELETE(pColliderDetector); + AX_SAFE_DELETE(pColliderDetector); return nullptr; } @@ -127,7 +127,7 @@ ColliderDetector* ColliderDetector::create(Bone* bone) pColliderDetector->autorelease(); return pColliderDetector; } - CC_SAFE_DELETE(pColliderDetector); + AX_SAFE_DELETE(pColliderDetector); return nullptr; } @@ -144,7 +144,7 @@ ColliderDetector::~ColliderDetector() _colliderBodyList.clear(); #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT - CC_SAFE_DELETE(_filter); + AX_SAFE_DELETE(_filter); #endif } @@ -413,7 +413,7 @@ void ColliderDetector::setBody(b2Body* pBody) b2PolygonShape polygon; polygon.Set(b2bv, (int)contourData->vertexList.size()); - CC_SAFE_DELETE(b2bv); + AX_SAFE_DELETE(b2bv); b2FixtureDef fixtureDef; fixtureDef.shape = &polygon; diff --git a/extensions/cocostudio/CCComAttribute.cpp b/extensions/cocostudio/CCComAttribute.cpp index e1c3334c09..36ad7dfb4b 100644 --- a/extensions/cocostudio/CCComAttribute.cpp +++ b/extensions/cocostudio/CCComAttribute.cpp @@ -141,7 +141,7 @@ ComAttribute* ComAttribute::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } @@ -151,7 +151,7 @@ bool ComAttribute::serialize(void* r) bool ret = false; do { - CC_BREAK_IF(r == nullptr); + AX_BREAK_IF(r == nullptr); SerData* serData = (SerData*)(r); const rapidjson::Value* v = serData->_rData; stExpCocoNode* cocoNode = serData->_cocoNode; @@ -164,26 +164,26 @@ bool ComAttribute::serialize(void* r) if (v != nullptr) { className = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(className == nullptr); + AX_BREAK_IF(className == nullptr); comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value& fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); - CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + AX_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); file = DICTOOL->getStringValue_json(fileData, "path"); - CC_BREAK_IF(file == nullptr); + AX_BREAK_IF(file == nullptr); resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); - CC_BREAK_IF(resType != 0); + AX_BREAK_IF(resType != 0); } else if (cocoNode != nullptr) { className = cocoNode[1].GetValue(cocoLoader); - CC_BREAK_IF(className == nullptr); + AX_BREAK_IF(className == nullptr); comName = cocoNode[2].GetValue(cocoLoader); stExpCocoNode* fileData = cocoNode[3].GetChildArray(cocoLoader); - CC_BREAK_IF(!fileData); + AX_BREAK_IF(!fileData); file = fileData[0].GetValue(cocoLoader); - CC_BREAK_IF(file == nullptr); + AX_BREAK_IF(file == nullptr); resType = atoi(fileData[2].GetValue(cocoLoader)); - CC_BREAK_IF(resType != 0); + AX_BREAK_IF(resType != 0); } if (comName != nullptr) { @@ -213,7 +213,7 @@ bool ComAttribute::parse(std::string_view jsonFile) { std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonFile); _doc.Parse<0>(contentStr.c_str()); - CC_BREAK_IF(_doc.HasParseError()); + AX_BREAK_IF(_doc.HasParseError()); ret = true; } while (0); return ret; diff --git a/extensions/cocostudio/CCComAttribute.h b/extensions/cocostudio/CCComAttribute.h index 453ac8327f..d30d153b09 100644 --- a/extensions/cocostudio/CCComAttribute.h +++ b/extensions/cocostudio/CCComAttribute.h @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EXTENTIONS_CCCOMATTRIBUTE_H__ -#define __CC_EXTENTIONS_CCCOMATTRIBUTE_H__ +#ifndef __AX_EXTENTIONS_CCCOMATTRIBUTE_H__ +#define __AX_EXTENTIONS_CCCOMATTRIBUTE_H__ #include "CCComBase.h" #include "2d/CCComponent.h" @@ -71,4 +71,4 @@ private: } // namespace cocostudio -#endif // __CC_EXTENTIONS_CCCOMATTRIBUTE_H__ +#endif // __AX_EXTENTIONS_CCCOMATTRIBUTE_H__ diff --git a/extensions/cocostudio/CCComAudio.cpp b/extensions/cocostudio/CCComAudio.cpp index 4da00aa3ff..769b0c5011 100644 --- a/extensions/cocostudio/CCComAudio.cpp +++ b/extensions/cocostudio/CCComAudio.cpp @@ -65,7 +65,7 @@ bool ComAudio::serialize(void* r) bool ret = false; do { - CC_BREAK_IF(r == nullptr); + AX_BREAK_IF(r == nullptr); SerData* serData = (SerData*)(r); const rapidjson::Value* v = serData->_rData; stExpCocoNode* cocoNode = serData->_cocoNode; @@ -79,27 +79,27 @@ bool ComAudio::serialize(void* r) if (v != nullptr) { className = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(className == nullptr); + AX_BREAK_IF(className == nullptr); comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value& fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); - CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + AX_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); file = DICTOOL->getStringValue_json(fileData, "path"); - CC_BREAK_IF(file == nullptr); + AX_BREAK_IF(file == nullptr); resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); - CC_BREAK_IF(resType != 0); + AX_BREAK_IF(resType != 0); loop = DICTOOL->getIntValue_json(*v, "loop") != 0 ? true : false; } else if (cocoNode != nullptr) { className = cocoNode[1].GetValue(cocoLoader); - CC_BREAK_IF(className == nullptr); + AX_BREAK_IF(className == nullptr); comName = cocoNode[2].GetValue(cocoLoader); stExpCocoNode* pfileData = cocoNode[4].GetChildArray(cocoLoader); - CC_BREAK_IF(!pfileData); + AX_BREAK_IF(!pfileData); file = pfileData[0].GetValue(cocoLoader); - CC_BREAK_IF(file == nullptr); + AX_BREAK_IF(file == nullptr); resType = atoi(pfileData[2].GetValue(cocoLoader)); - CC_BREAK_IF(resType != 0); + AX_BREAK_IF(resType != 0); loop = atoi(cocoNode[5].GetValue(cocoLoader)) != 0 ? true : false; ret = true; } @@ -131,7 +131,7 @@ bool ComAudio::serialize(void* r) } else { - CC_BREAK_IF(true); + AX_BREAK_IF(true); } ret = true; } while (0); @@ -147,7 +147,7 @@ ComAudio* ComAudio::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/cocostudio/CCComAudio.h b/extensions/cocostudio/CCComAudio.h index e4268bb9e8..3f3947c4ff 100644 --- a/extensions/cocostudio/CCComAudio.h +++ b/extensions/cocostudio/CCComAudio.h @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EXTENTIONS_CCCOMAUDIO_H__ -#define __CC_EXTENTIONS_CCCOMAUDIO_H__ +#ifndef __AX_EXTENTIONS_CCCOMAUDIO_H__ +#define __AX_EXTENTIONS_CCCOMAUDIO_H__ #include "CCComBase.h" #include "base/CCProtocols.h" @@ -129,4 +129,4 @@ private: } // namespace cocostudio -#endif // __CC_EXTENTIONS_CCCOMAUDIO_H__ +#endif // __AX_EXTENTIONS_CCCOMAUDIO_H__ diff --git a/extensions/cocostudio/CCComBase.h b/extensions/cocostudio/CCComBase.h index 46aa627cd0..001a805bab 100644 --- a/extensions/cocostudio/CCComBase.h +++ b/extensions/cocostudio/CCComBase.h @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EXTENTIONS_CCCOMBASE_H__ -#define __CC_EXTENTIONS_CCCOMBASE_H__ +#ifndef __AX_EXTENTIONS_CCCOMBASE_H__ +#define __AX_EXTENTIONS_CCCOMBASE_H__ #include #include "DictionaryHelper.h" diff --git a/extensions/cocostudio/CCComController.cpp b/extensions/cocostudio/CCComController.cpp index ef748246e0..61ac4616e1 100644 --- a/extensions/cocostudio/CCComController.cpp +++ b/extensions/cocostudio/CCComController.cpp @@ -75,7 +75,7 @@ ComController* ComController::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/cocostudio/CCComController.h b/extensions/cocostudio/CCComController.h index c6dcff7589..5ab0f482c8 100644 --- a/extensions/cocostudio/CCComController.h +++ b/extensions/cocostudio/CCComController.h @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EXTENTIONS_CCCOMCONTROLLER_H__ -#define __CC_EXTENTIONS_CCCOMCONTROLLER_H__ +#ifndef __AX_EXTENTIONS_CCCOMCONTROLLER_H__ +#define __AX_EXTENTIONS_CCCOMCONTROLLER_H__ #include "CCComBase.h" #include "CCInputDelegate.h" @@ -83,4 +83,4 @@ public: } // namespace cocostudio -#endif // __CC_EXTENTIONS_CCCOMCONTROLLER_H__ +#endif // __AX_EXTENTIONS_CCCOMCONTROLLER_H__ diff --git a/extensions/cocostudio/CCComExtensionData.cpp b/extensions/cocostudio/CCComExtensionData.cpp index 629c808870..040d721bdb 100644 --- a/extensions/cocostudio/CCComExtensionData.cpp +++ b/extensions/cocostudio/CCComExtensionData.cpp @@ -38,7 +38,7 @@ ComExtensionData::ComExtensionData() : _customProperty(""), _timelineData(nullpt ComExtensionData::~ComExtensionData() { - CC_SAFE_RELEASE(_timelineData); + AX_SAFE_RELEASE(_timelineData); } ComExtensionData* ComExtensionData::create() @@ -50,7 +50,7 @@ ComExtensionData* ComExtensionData::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -58,7 +58,7 @@ ComExtensionData* ComExtensionData::create() bool ComExtensionData::init() { _timelineData = cocostudio::timeline::ActionTimelineData::create(0); - CC_SAFE_RETAIN(_timelineData); + AX_SAFE_RETAIN(_timelineData); return true; } diff --git a/extensions/cocostudio/CCComRender.cpp b/extensions/cocostudio/CCComRender.cpp index 28876357a8..da42f5422c 100644 --- a/extensions/cocostudio/CCComRender.cpp +++ b/extensions/cocostudio/CCComRender.cpp @@ -56,7 +56,7 @@ ComRender::ComRender(axis::Node* node, const char* comName) ComRender::~ComRender() { - CC_SAFE_RELEASE_NULL(_render); + AX_SAFE_RELEASE_NULL(_render); } void ComRender::onEnter() @@ -116,7 +116,7 @@ bool ComRender::serialize(void* r) bool ret = false; do { - CC_BREAK_IF(r == nullptr); + AX_BREAK_IF(r == nullptr); SerData* serData = (SerData*)(r); const rapidjson::Value* v = serData->_rData; stExpCocoNode* cocoNode = serData->_cocoNode; @@ -131,25 +131,25 @@ bool ComRender::serialize(void* r) if (v != nullptr) { className = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(className == nullptr); + AX_BREAK_IF(className == nullptr); comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value& fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); - CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + AX_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); file = DICTOOL->getStringValue_json(fileData, "path"); plist = DICTOOL->getStringValue_json(fileData, "plistFile"); - CC_BREAK_IF(file == nullptr && plist == nullptr); + AX_BREAK_IF(file == nullptr && plist == nullptr); resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); } else if (cocoNode != nullptr) { className = cocoNode[1].GetValue(cocoLoader); - CC_BREAK_IF(className == nullptr); + AX_BREAK_IF(className == nullptr); comName = cocoNode[2].GetValue(cocoLoader); stExpCocoNode* pfileData = cocoNode[4].GetChildArray(cocoLoader); - CC_BREAK_IF(!pfileData); + AX_BREAK_IF(!pfileData); file = pfileData[0].GetValue(cocoLoader); plist = pfileData[1].GetValue(cocoLoader); - CC_BREAK_IF(file == nullptr && plist == nullptr); + AX_BREAK_IF(file == nullptr && plist == nullptr); resType = atoi(pfileData[2].GetValue(cocoLoader)); } if (comName != nullptr) @@ -232,7 +232,7 @@ bool ComRender::serialize(void* r) std::string binaryFilePath = FileUtils::getInstance()->fullPathForFilename(filePath); auto fileData = FileUtils::getInstance()->getDataFromFile(binaryFilePath); auto fileDataBytes = fileData.getBytes(); - CC_BREAK_IF(fileData.isNull()); + AX_BREAK_IF(fileData.isNull()); CocoLoader tCocoLoader; if (tCocoLoader.ReadCocoBinBuff((char*)fileDataBytes)) { @@ -321,7 +321,7 @@ bool ComRender::serialize(void* r) } else { - CC_BREAK_IF(true); + AX_BREAK_IF(true); } } else if (resType == 1) @@ -343,12 +343,12 @@ bool ComRender::serialize(void* r) } else { - CC_BREAK_IF(true); + AX_BREAK_IF(true); } } else { - CC_BREAK_IF(true); + AX_BREAK_IF(true); } } while (0); @@ -364,7 +364,7 @@ ComRender* ComRender::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -378,7 +378,7 @@ ComRender* ComRender::create(axis::Node* node, const char* comName) } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -390,7 +390,7 @@ bool ComRender::readJson(std::string_view fileName, rapidjson::Document& doc) { std::string contentStr = FileUtils::getInstance()->getStringFromFile(fileName); doc.Parse<0>(contentStr.c_str()); - CC_BREAK_IF(doc.HasParseError()); + AX_BREAK_IF(doc.HasParseError()); ret = true; } while (0); return ret; diff --git a/extensions/cocostudio/CCComRender.h b/extensions/cocostudio/CCComRender.h index 226bb2cec1..4b1262e18a 100644 --- a/extensions/cocostudio/CCComRender.h +++ b/extensions/cocostudio/CCComRender.h @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EXTENTIONS_CCCOMRENDER_H__ -#define __CC_EXTENTIONS_CCCOMRENDER_H__ +#ifndef __AX_EXTENTIONS_CCCOMRENDER_H__ +#define __AX_EXTENTIONS_CCCOMRENDER_H__ #include "CCComBase.h" #include "2d/CCComponent.h" @@ -83,4 +83,4 @@ private: }; } // namespace cocostudio -#endif // __CC_EXTENTIONS_CCCOMRENDER_H__ +#endif // __AX_EXTENTIONS_CCCOMRENDER_H__ diff --git a/extensions/cocostudio/CCDataReaderHelper.cpp b/extensions/cocostudio/CCDataReaderHelper.cpp index 606d08cc8d..7448e66940 100644 --- a/extensions/cocostudio/CCDataReaderHelper.cpp +++ b/extensions/cocostudio/CCDataReaderHelper.cpp @@ -240,7 +240,7 @@ float DataReaderHelper::getPositionReadScale() void DataReaderHelper::purge() { _configFileList.clear(); - CC_SAFE_RELEASE_NULL(_dataReaderHelper); + AX_SAFE_RELEASE_NULL(_dataReaderHelper); } DataReaderHelper::DataReaderHelper() @@ -260,7 +260,7 @@ DataReaderHelper::~DataReaderHelper() if (_loadingThread) _loadingThread->join(); - CC_SAFE_DELETE(_loadingThread); + AX_SAFE_DELETE(_loadingThread); _dataReaderHelper = nullptr; } @@ -367,7 +367,7 @@ void DataReaderHelper::addDataFromFileAsync(std::string_view imagePath, if (0 == _asyncRefCount) { - Director::getInstance()->getScheduler()->schedule(CC_SCHEDULE_SELECTOR(DataReaderHelper::addDataAsyncCallBack), + Director::getInstance()->getScheduler()->schedule(AX_SCHEDULE_SELECTOR(DataReaderHelper::addDataAsyncCallBack), this, 0, false); } @@ -477,7 +477,7 @@ void DataReaderHelper::addDataAsyncCallBack(float /*dt*/) { _asyncRefTotalCount = 0; Director::getInstance()->getScheduler()->unschedule( - CC_SCHEDULE_SELECTOR(DataReaderHelper::addDataAsyncCallBack), this); + AX_SCHEDULE_SELECTOR(DataReaderHelper::addDataAsyncCallBack), this); } } } @@ -928,7 +928,7 @@ FrameData* DataReaderHelper::decodeFrame(pugi::xml_node& frameXML, } } - auto degrees2radius = [](float v) { return CC_DEGREES_TO_RADIANS(v); }; + auto degrees2radius = [](float v) { return AX_DEGREES_TO_RADIANS(v); }; pugiext::query_attribute(frameXML, A_SCALE_X, &frameData->scaleX); pugiext::query_attribute(frameXML, A_SCALE_Y, &frameData->scaleY); @@ -968,8 +968,8 @@ FrameData* DataReaderHelper::decodeFrame(pugi::xml_node& frameXML, break; default: { - frameData->blendFunc.src = CC_BLEND_SRC; - frameData->blendFunc.dst = CC_BLEND_DST; + frameData->blendFunc.src = AX_BLEND_SRC; + frameData->blendFunc.dst = AX_BLEND_DST; } break; } @@ -1035,8 +1035,8 @@ FrameData* DataReaderHelper::decodeFrame(pugi::xml_node& frameXML, pugiext::query_attribute(parentFrameXml, A_SKEW_Y, &helpNode.skewY); helpNode.y = -helpNode.y; - helpNode.skewX = CC_DEGREES_TO_RADIANS(helpNode.skewX); - helpNode.skewY = CC_DEGREES_TO_RADIANS(-helpNode.skewY); + helpNode.skewX = AX_DEGREES_TO_RADIANS(helpNode.skewX); + helpNode.skewY = AX_DEGREES_TO_RADIANS(-helpNode.skewY); TransformHelp::transformFromParent(*frameData, helpNode); } diff --git a/extensions/cocostudio/CCDataReaderHelper.h b/extensions/cocostudio/CCDataReaderHelper.h index f362b87841..0b089667d6 100644 --- a/extensions/cocostudio/CCDataReaderHelper.h +++ b/extensions/cocostudio/CCDataReaderHelper.h @@ -87,7 +87,7 @@ protected: public: /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static DataReaderHelper* sharedDataReaderHelper() + AX_DEPRECATED_ATTRIBUTE static DataReaderHelper* sharedDataReaderHelper() { return DataReaderHelper::getInstance(); } diff --git a/extensions/cocostudio/CCDatas.cpp b/extensions/cocostudio/CCDatas.cpp index bd57787988..97087bb48d 100644 --- a/extensions/cocostudio/CCDatas.cpp +++ b/extensions/cocostudio/CCDatas.cpp @@ -99,20 +99,20 @@ void BaseData::subtract(BaseData* from, BaseData* to, bool limit) { if (skewX > M_PI) { - skewX -= (float)CC_DOUBLE_PI; + skewX -= (float)AX_DOUBLE_PI; } if (skewX < -M_PI) { - skewX += (float)CC_DOUBLE_PI; + skewX += (float)AX_DOUBLE_PI; } if (skewY > M_PI) { - skewY -= (float)CC_DOUBLE_PI; + skewY -= (float)AX_DOUBLE_PI; } if (skewY < -M_PI) { - skewY += (float)CC_DOUBLE_PI; + skewY += (float)AX_DOUBLE_PI; } } @@ -241,7 +241,7 @@ FrameData::FrameData(void) FrameData::~FrameData(void) { - CC_SAFE_DELETE(easingParams); + AX_SAFE_DELETE(easingParams); } void FrameData::copy(const BaseData* baseData) @@ -256,7 +256,7 @@ void FrameData::copy(const BaseData* baseData) tweenEasing = frameData->tweenEasing; easingParamNumber = frameData->easingParamNumber; - CC_SAFE_DELETE(easingParams); + AX_SAFE_DELETE(easingParams); if (easingParamNumber != 0) { easingParams = new float[easingParamNumber]; diff --git a/extensions/cocostudio/CCDatas.h b/extensions/cocostudio/CCDatas.h index a43fa0dc8b..fa6e204d7f 100644 --- a/extensions/cocostudio/CCDatas.h +++ b/extensions/cocostudio/CCDatas.h @@ -35,7 +35,7 @@ THE SOFTWARE. #include "2d/CCTweenFunction.h" #include "CocosStudioExport.h" -#define CC_CREATE_NO_PARAM_NO_INIT(varType) \ +#define AX_CREATE_NO_PARAM_NO_INIT(varType) \ public: \ static inline varType* create(void) \ { \ @@ -44,7 +44,7 @@ public: \ return var; \ } -#define CC_CREATE_NO_PARAM(varType) \ +#define AX_CREATE_NO_PARAM(varType) \ public: \ static inline varType* create(void) \ { \ @@ -54,7 +54,7 @@ public: \ var->autorelease(); \ return var; \ } \ - CC_SAFE_DELETE(var); \ + AX_SAFE_DELETE(var); \ return nullptr; \ } @@ -69,7 +69,7 @@ namespace cocostudio class CCS_DLL BaseData : public axis::Ref { public: - CC_CREATE_NO_PARAM_NO_INIT(BaseData) + AX_CREATE_NO_PARAM_NO_INIT(BaseData) public: /** * @js ctor @@ -138,7 +138,7 @@ enum DisplayType class CCS_DLL DisplayData : public axis::Ref { public: - CC_CREATE_NO_PARAM_NO_INIT(DisplayData) + AX_CREATE_NO_PARAM_NO_INIT(DisplayData) static std::string changeDisplayToTexture(std::string_view displayName); @@ -166,7 +166,7 @@ public: class CCS_DLL SpriteDisplayData : public DisplayData { public: - CC_CREATE_NO_PARAM_NO_INIT(SpriteDisplayData) + AX_CREATE_NO_PARAM_NO_INIT(SpriteDisplayData) public: /** * @js ctor @@ -191,7 +191,7 @@ public: class CCS_DLL ArmatureDisplayData : public DisplayData { public: - CC_CREATE_NO_PARAM_NO_INIT(ArmatureDisplayData) + AX_CREATE_NO_PARAM_NO_INIT(ArmatureDisplayData) public: /** * @js ctor @@ -211,7 +211,7 @@ public: class CCS_DLL ParticleDisplayData : public DisplayData { public: - CC_CREATE_NO_PARAM_NO_INIT(ParticleDisplayData) + AX_CREATE_NO_PARAM_NO_INIT(ParticleDisplayData) public: /** * @js ctor @@ -234,7 +234,7 @@ public: class CCS_DLL BoneData : public BaseData { public: - CC_CREATE_NO_PARAM(BoneData) + AX_CREATE_NO_PARAM(BoneData) public: /** * @js ctor @@ -268,7 +268,7 @@ public: class CCS_DLL ArmatureData : public axis::Ref { public: - CC_CREATE_NO_PARAM(ArmatureData) + AX_CREATE_NO_PARAM(ArmatureData) public: /** * @js ctor @@ -315,7 +315,7 @@ enum BlendType class CCS_DLL FrameData : public BaseData { public: - CC_CREATE_NO_PARAM_NO_INIT(FrameData) + AX_CREATE_NO_PARAM_NO_INIT(FrameData) public: /** * @js ctor @@ -363,7 +363,7 @@ public: class CCS_DLL MovementBoneData : public axis::Ref { public: - CC_CREATE_NO_PARAM(MovementBoneData) + AX_CREATE_NO_PARAM(MovementBoneData) public: /** * @js ctor @@ -396,7 +396,7 @@ public: class CCS_DLL MovementData : public axis::Ref { public: - CC_CREATE_NO_PARAM_NO_INIT(MovementData) + AX_CREATE_NO_PARAM_NO_INIT(MovementData) public: /** * @js ctor @@ -459,7 +459,7 @@ public: class CCS_DLL AnimationData : public axis::Ref { public: - CC_CREATE_NO_PARAM_NO_INIT(AnimationData) + AX_CREATE_NO_PARAM_NO_INIT(AnimationData) public: /** * @js ctor @@ -489,7 +489,7 @@ public: class CCS_DLL ContourData : public axis::Ref { public: - CC_CREATE_NO_PARAM(ContourData) + AX_CREATE_NO_PARAM(ContourData) public: /** * @js ctor @@ -516,7 +516,7 @@ public: class CCS_DLL TextureData : public axis::Ref { public: - CC_CREATE_NO_PARAM(TextureData) + AX_CREATE_NO_PARAM(TextureData) public: /** * @js ctor diff --git a/extensions/cocostudio/CCDecorativeDisplay.cpp b/extensions/cocostudio/CCDecorativeDisplay.cpp index 7b4d3599c4..2d38e3923d 100644 --- a/extensions/cocostudio/CCDecorativeDisplay.cpp +++ b/extensions/cocostudio/CCDecorativeDisplay.cpp @@ -38,7 +38,7 @@ DecorativeDisplay* DecorativeDisplay::create() pDisplay->autorelease(); return pDisplay; } - CC_SAFE_DELETE(pDisplay); + AX_SAFE_DELETE(pDisplay); return nullptr; } @@ -52,11 +52,11 @@ DecorativeDisplay::DecorativeDisplay() : _display(nullptr), _displayData(nullptr DecorativeDisplay::~DecorativeDisplay(void) { - CC_SAFE_RELEASE_NULL(_displayData); - CC_SAFE_RELEASE_NULL(_display); + AX_SAFE_RELEASE_NULL(_displayData); + AX_SAFE_RELEASE_NULL(_display); #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT || ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX - CC_SAFE_RELEASE_NULL(_colliderDetector); + AX_SAFE_RELEASE_NULL(_colliderDetector); #endif } @@ -69,8 +69,8 @@ void DecorativeDisplay::setDisplay(axis::Node* display) { if (_display != display) { - CC_SAFE_RETAIN(display); - CC_SAFE_RELEASE(_display); + AX_SAFE_RETAIN(display); + AX_SAFE_RELEASE(_display); _display = display; } } diff --git a/extensions/cocostudio/CCDecorativeDisplay.h b/extensions/cocostudio/CCDecorativeDisplay.h index 076201788f..6b98fbfb1e 100644 --- a/extensions/cocostudio/CCDecorativeDisplay.h +++ b/extensions/cocostudio/CCDecorativeDisplay.h @@ -62,8 +62,8 @@ public: { if (_displayData != data) { - CC_SAFE_RETAIN(data); - CC_SAFE_RELEASE(_displayData); + AX_SAFE_RETAIN(data); + AX_SAFE_RELEASE(_displayData); _displayData = data; } } @@ -74,8 +74,8 @@ public: { if (_colliderDetector != detector) { - CC_SAFE_RETAIN(detector); - CC_SAFE_RELEASE(_colliderDetector); + AX_SAFE_RETAIN(detector); + AX_SAFE_RELEASE(_colliderDetector); _colliderDetector = detector; } } diff --git a/extensions/cocostudio/CCDisplayFactory.cpp b/extensions/cocostudio/CCDisplayFactory.cpp index 5a3f884091..0b240312a3 100644 --- a/extensions/cocostudio/CCDisplayFactory.cpp +++ b/extensions/cocostudio/CCDisplayFactory.cpp @@ -109,7 +109,7 @@ void DisplayFactory::updateDisplay(Bone* bone, float dt, bool dirty) do { # if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT - CC_BREAK_IF(!detector->getBody()); + AX_BREAK_IF(!detector->getBody()); # endif Mat4 displayTransform = display->getNodeToParentTransform(); diff --git a/extensions/cocostudio/CCDisplayManager.cpp b/extensions/cocostudio/CCDisplayManager.cpp index 1210d7e881..dba1f5e1ae 100644 --- a/extensions/cocostudio/CCDisplayManager.cpp +++ b/extensions/cocostudio/CCDisplayManager.cpp @@ -42,7 +42,7 @@ DisplayManager* DisplayManager::create(Bone* bone) pDisplayManager->autorelease(); return pDisplayManager; } - CC_SAFE_DELETE(pDisplayManager); + AX_SAFE_DELETE(pDisplayManager); return nullptr; } @@ -64,7 +64,7 @@ DisplayManager::~DisplayManager() { _displayRenderNode->removeFromParentAndCleanup(true); if (_displayRenderNode->getReferenceCount() > 0) - CC_SAFE_RELEASE_NULL(_displayRenderNode); + AX_SAFE_RELEASE_NULL(_displayRenderNode); } } diff --git a/extensions/cocostudio/CCDisplayManager.h b/extensions/cocostudio/CCDisplayManager.h index 460e8673f2..9976b48c06 100644 --- a/extensions/cocostudio/CCDisplayManager.h +++ b/extensions/cocostudio/CCDisplayManager.h @@ -79,8 +79,8 @@ public: /* * @deprecated, please use changeDisplayWithIndex and changeDisplayWithName */ - CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); - CC_DEPRECATED_ATTRIBUTE void changeDisplayByName(std::string_view name, bool force); + AX_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); + AX_DEPRECATED_ATTRIBUTE void changeDisplayByName(std::string_view name, bool force); /** * Change display by index. You can just use this method to change display in the display list. diff --git a/extensions/cocostudio/CCInputDelegate.cpp b/extensions/cocostudio/CCInputDelegate.cpp index a44c1695bd..ffcbb3318a 100644 --- a/extensions/cocostudio/CCInputDelegate.cpp +++ b/extensions/cocostudio/CCInputDelegate.cpp @@ -119,10 +119,10 @@ void InputDelegate::setTouchEnabled(bool enabled) // Register Touch Event auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(InputDelegate::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(InputDelegate::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(InputDelegate::onTouchesEnded, this); - listener->onTouchesCancelled = CC_CALLBACK_2(InputDelegate::onTouchesCancelled, this); + listener->onTouchesBegan = AX_CALLBACK_2(InputDelegate::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(InputDelegate::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(InputDelegate::onTouchesEnded, this); + listener->onTouchesCancelled = AX_CALLBACK_2(InputDelegate::onTouchesCancelled, this); dispatcher->addEventListenerWithFixedPriority(listener, _touchPriority); _touchListener = listener; @@ -133,10 +133,10 @@ void InputDelegate::setTouchEnabled(bool enabled) auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - listener->onTouchBegan = CC_CALLBACK_2(InputDelegate::onTouchBegan, this); - listener->onTouchMoved = CC_CALLBACK_2(InputDelegate::onTouchMoved, this); - listener->onTouchEnded = CC_CALLBACK_2(InputDelegate::onTouchEnded, this); - listener->onTouchCancelled = CC_CALLBACK_2(InputDelegate::onTouchCancelled, this); + listener->onTouchBegan = AX_CALLBACK_2(InputDelegate::onTouchBegan, this); + listener->onTouchMoved = AX_CALLBACK_2(InputDelegate::onTouchMoved, this); + listener->onTouchEnded = AX_CALLBACK_2(InputDelegate::onTouchEnded, this); + listener->onTouchCancelled = AX_CALLBACK_2(InputDelegate::onTouchCancelled, this); dispatcher->addEventListenerWithFixedPriority(listener, _touchPriority); _touchListener = listener; @@ -206,7 +206,7 @@ void InputDelegate::setAccelerometerEnabled(bool enabled) if (enabled) { - auto listener = EventListenerAcceleration::create(CC_CALLBACK_2(InputDelegate::onAcceleration, this)); + auto listener = EventListenerAcceleration::create(AX_CALLBACK_2(InputDelegate::onAcceleration, this)); dispatcher->addEventListenerWithFixedPriority(listener, -1); _accelerometerListener = listener; } @@ -230,8 +230,8 @@ void InputDelegate::setKeypadEnabled(bool enabled) if (enabled) { auto listener = EventListenerKeyboard::create(); - listener->onKeyPressed = CC_CALLBACK_2(InputDelegate::onKeyPressed, this); - listener->onKeyReleased = CC_CALLBACK_2(InputDelegate::onKeyReleased, this); + listener->onKeyPressed = AX_CALLBACK_2(InputDelegate::onKeyPressed, this); + listener->onKeyReleased = AX_CALLBACK_2(InputDelegate::onKeyReleased, this); dispatcher->addEventListenerWithFixedPriority(listener, -1); _keyboardListener = listener; diff --git a/extensions/cocostudio/CCInputDelegate.h b/extensions/cocostudio/CCInputDelegate.h index 47791301b3..f513e3c387 100644 --- a/extensions/cocostudio/CCInputDelegate.h +++ b/extensions/cocostudio/CCInputDelegate.h @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EXTENTIONS_CCINPUTDELEGATE_H__ -#define __CC_EXTENTIONS_CCINPUTDELEGATE_H__ +#ifndef __AX_EXTENTIONS_CCINPUTDELEGATE_H__ +#define __AX_EXTENTIONS_CCINPUTDELEGATE_H__ #include "platform/CCPlatformMacros.h" #include "base/CCTouch.h" @@ -68,40 +68,40 @@ public: /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void didAccelerate(axis::Acceleration* accelerationValue) final; + AX_DEPRECATED_ATTRIBUTE virtual void didAccelerate(axis::Acceleration* accelerationValue) final; // Deprecated touch callbacks. /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(axis::Touch* touch, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(axis::Touch* touch, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(axis::Touch* touch, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(axis::Touch* touch, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(axis::Touch* touch, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(axis::Touch* touch, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(axis::Touch* touch, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(axis::Touch* touch, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(axis::__Set* touches, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(axis::__Set* touches, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(axis::__Set* touches, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(axis::__Set* touches, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(axis::__Set* touches, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(axis::__Set* touches, axis::Event* event) final; /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(axis::__Set* touches, axis::Event* event) final; + AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(axis::__Set* touches, axis::Event* event) final; /** * @js NA */ @@ -162,4 +162,4 @@ private: } // namespace cocostudio -#endif // __CC_EXTENTIONS_CCINPUTDELEGATE_H__ +#endif // __AX_EXTENTIONS_CCINPUTDELEGATE_H__ diff --git a/extensions/cocostudio/CCSGUIReader.cpp b/extensions/cocostudio/CCSGUIReader.cpp index 08430ae749..5116760b74 100644 --- a/extensions/cocostudio/CCSGUIReader.cpp +++ b/extensions/cocostudio/CCSGUIReader.cpp @@ -102,7 +102,7 @@ GUIReader* GUIReader::getInstance() void GUIReader::destroyInstance() { - CC_SAFE_DELETE(sharedReader); + AX_SAFE_DELETE(sharedReader); } int GUIReader::getVersionInteger(const char* str) @@ -239,7 +239,7 @@ Widget* GUIReader::widgetFromJsonFile(const char* fileName) widget = pReader->createWidget(jsonDict, this->m_strFilePath.c_str(), fileName); } - CC_SAFE_DELETE(pReader); + AX_SAFE_DELETE(pReader); return widget; } @@ -420,7 +420,7 @@ Widget* GUIReader::widgetFromBinaryFile(const char* fileName) widget = pReader->createWidgetFromBinary(&tCocoLoader, tpRootCocoNode, fileName); } - CC_SAFE_DELETE(pReader); + AX_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") / CC_CONTENT_SCALE_FACTOR(), - DICTOOL->getIntValue_json(options, "itemHeight") / CC_CONTENT_SCALE_FACTOR(), + DICTOOL->getIntValue_json(options, "itemWidth") / AX_CONTENT_SCALE_FACTOR(), + DICTOOL->getIntValue_json(options, "itemHeight") / AX_CONTENT_SCALE_FACTOR(), DICTOOL->getStringValue_json(options, "startCharMap")); } setColorPropsForWidgetFromJsonDictionary(widget, options); diff --git a/extensions/cocostudio/CCSGUIReader.h b/extensions/cocostudio/CCSGUIReader.h index aa2d9a80e8..5ab79b61f7 100644 --- a/extensions/cocostudio/CCSGUIReader.h +++ b/extensions/cocostudio/CCSGUIReader.h @@ -56,8 +56,8 @@ typedef void (axis::Ref::*SEL_ParseEvent)(std::string_view, axis::Ref*, const ra class CCS_DLL GUIReader : public axis::Ref { public: - CC_DEPRECATED_ATTRIBUTE static GUIReader* shareReader() { return GUIReader::getInstance(); }; - CC_DEPRECATED_ATTRIBUTE static void purgeGUIReader() { GUIReader::destroyInstance(); }; + AX_DEPRECATED_ATTRIBUTE static GUIReader* shareReader() { return GUIReader::getInstance(); }; + AX_DEPRECATED_ATTRIBUTE static void purgeGUIReader() { GUIReader::destroyInstance(); }; static GUIReader* getInstance(); static void destroyInstance(); diff --git a/extensions/cocostudio/CCSSceneReader.cpp b/extensions/cocostudio/CCSSceneReader.cpp index 2b9dbf559b..9a1a322a58 100644 --- a/extensions/cocostudio/CCSSceneReader.cpp +++ b/extensions/cocostudio/CCSSceneReader.cpp @@ -63,7 +63,7 @@ axis::Node* SceneReader::createNodeWithSceneFile( rapidjson::Document jsonDict; do { - CC_BREAK_IF(!readJson(fileName, jsonDict)); + AX_BREAK_IF(!readJson(fileName, jsonDict)); _node = createObject(jsonDict, nullptr, attachComponent); TriggerMng::getInstance()->parse(jsonDict); } while (0); @@ -77,7 +77,7 @@ axis::Node* SceneReader::createNodeWithSceneFile( std::string binaryFilePath = FileUtils::getInstance()->fullPathForFilename(fileName); auto fileData = FileUtils::getInstance()->getDataFromFile(binaryFilePath); auto fileDataBytes = fileData.getBytes(); - CC_BREAK_IF(fileData.isNull()); + AX_BREAK_IF(fileData.isNull()); CocoLoader tCocoLoader; if (tCocoLoader.ReadCocoBinBuff((char*)fileDataBytes)) { @@ -86,7 +86,7 @@ axis::Node* SceneReader::createNodeWithSceneFile( if (rapidjson::kObjectType == tType) { stExpCocoNode* tpChildArray = tpRootCocoNode->GetChildArray(&tCocoLoader); - CC_BREAK_IF(tpRootCocoNode->GetChildNum() == 0); + AX_BREAK_IF(tpRootCocoNode->GetChildNum() == 0); _node = Node::create(); int nCount = 0; std::vector _vecComs; @@ -131,7 +131,7 @@ axis::Node* SceneReader::createNodeWithSceneFile( } else { - CC_SAFE_RELEASE_NULL(pCom); + AX_SAFE_RELEASE_NULL(pCom); } } if (_fnSelector != nullptr) @@ -173,7 +173,7 @@ bool SceneReader::readJson(std::string_view fileName, rapidjson::Document& doc) std::string jsonpath = FileUtils::getInstance()->fullPathForFilename(fileName); std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonpath); doc.Parse<0>(contentStr.c_str()); - CC_BREAK_IF(doc.HasParseError()); + AX_BREAK_IF(doc.HasParseError()); ret = true; } while (0); return ret; @@ -292,7 +292,7 @@ Node* SceneReader::createObject(const rapidjson::Value& dict, } } } - CC_SAFE_DELETE(data); + AX_SAFE_DELETE(data); if (_fnSelector != nullptr) { _fnSelector(com, data); @@ -406,7 +406,7 @@ axis::Node* SceneReader::createObject(CocoLoader* cocoLoader, } else { - CC_SAFE_RELEASE_NULL(pCom); + AX_SAFE_RELEASE_NULL(pCom); } } if (_fnSelector != nullptr) @@ -414,7 +414,7 @@ axis::Node* SceneReader::createObject(CocoLoader* cocoLoader, _fnSelector(pCom, (void*)(data)); } } - CC_SAFE_DELETE(data); + AX_SAFE_DELETE(data); if (parent != nullptr) { @@ -431,7 +431,7 @@ axis::Node* SceneReader::createObject(CocoLoader* cocoLoader, gb = pRender->getNode(); gb->retain(); pRender->setNode(nullptr); - CC_SAFE_RELEASE_NULL(pRender); + AX_SAFE_RELEASE_NULL(pRender); } parent->addChild(gb); } @@ -562,7 +562,7 @@ void SceneReader::destroyInstance() DictionaryHelper::destroyInstance(); TriggerMng::destroyInstance(); // CocosDenshion::SimpleAudioEngine::end(); - CC_SAFE_DELETE(s_sharedReader); + AX_SAFE_DELETE(s_sharedReader); } } // namespace cocostudio diff --git a/extensions/cocostudio/CCSkin.cpp b/extensions/cocostudio/CCSkin.cpp index 0684ee742b..dc6e2c3427 100644 --- a/extensions/cocostudio/CCSkin.cpp +++ b/extensions/cocostudio/CCSkin.cpp @@ -37,7 +37,7 @@ USING_NS_AX; namespace cocostudio { -#if CC_SPRITEBATCHNODE_RENDER_SUBPIXEL +#if AX_SPRITEBATCHNODE_RENDER_SUBPIXEL # define RENDER_IN_SUBPIXEL #else # define RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__)) @@ -51,7 +51,7 @@ Skin* Skin::create() skin->autorelease(); return skin; } - CC_SAFE_DELETE(skin); + AX_SAFE_DELETE(skin); return nullptr; } @@ -63,7 +63,7 @@ Skin* Skin::createWithSpriteFrameName(std::string_view pszSpriteFrameName) skin->autorelease(); return skin; } - CC_SAFE_DELETE(skin); + AX_SAFE_DELETE(skin); return nullptr; } @@ -75,7 +75,7 @@ Skin* Skin::create(std::string_view pszFileName) skin->autorelease(); return skin; } - CC_SAFE_DELETE(skin); + AX_SAFE_DELETE(skin); return nullptr; } @@ -118,8 +118,8 @@ void Skin::setSkinData(const BaseData& var) setScaleX(_skinData.scaleX); setScaleY(_skinData.scaleY); - setRotationSkewX(CC_RADIANS_TO_DEGREES(_skinData.skewX)); - setRotationSkewY(CC_RADIANS_TO_DEGREES(-_skinData.skewY)); + setRotationSkewX(AX_RADIANS_TO_DEGREES(_skinData.skewX)); + setRotationSkewY(AX_RADIANS_TO_DEGREES(-_skinData.skewY)); setPosition(_skinData.x, _skinData.y); _skinTransform = getNodeToParentTransform(); diff --git a/extensions/cocostudio/CCSpriteFrameCacheHelper.cpp b/extensions/cocostudio/CCSpriteFrameCacheHelper.cpp index b6d58592a5..3706bf0662 100644 --- a/extensions/cocostudio/CCSpriteFrameCacheHelper.cpp +++ b/extensions/cocostudio/CCSpriteFrameCacheHelper.cpp @@ -67,7 +67,7 @@ void SpriteFrameCacheHelper::retainSpriteFrames(std::string_view plistPath) auto& spriteFrameName = iter->first; SpriteFrame* spriteFrame = spriteFramesCache->getSpriteFrameByName(spriteFrameName); vec.push_back(spriteFrame); - CC_SAFE_RETAIN(spriteFrame); + AX_SAFE_RETAIN(spriteFrame); } _usingSpriteFrames[plistPath] = vec; } @@ -82,7 +82,7 @@ void SpriteFrameCacheHelper::releaseSpriteFrames(std::string_view plistPath) auto itFrame = vec.begin(); while (itFrame != vec.end()) { - CC_SAFE_RELEASE(*itFrame); + AX_SAFE_RELEASE(*itFrame); ++itFrame; } vec.clear(); diff --git a/extensions/cocostudio/CCSpriteFrameCacheHelper.h b/extensions/cocostudio/CCSpriteFrameCacheHelper.h index 889bb43508..d744e5e46b 100644 --- a/extensions/cocostudio/CCSpriteFrameCacheHelper.h +++ b/extensions/cocostudio/CCSpriteFrameCacheHelper.h @@ -46,7 +46,7 @@ class CCS_DLL SpriteFrameCacheHelper { public: /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static SpriteFrameCacheHelper* sharedSpriteFrameCacheHelper() + AX_DEPRECATED_ATTRIBUTE static SpriteFrameCacheHelper* sharedSpriteFrameCacheHelper() { return SpriteFrameCacheHelper::getInstance(); } diff --git a/extensions/cocostudio/CCTween.cpp b/extensions/cocostudio/CCTween.cpp index bb363df941..1f60fd8180 100644 --- a/extensions/cocostudio/CCTween.cpp +++ b/extensions/cocostudio/CCTween.cpp @@ -41,7 +41,7 @@ Tween* Tween::create(Bone* bone) pTween->autorelease(); return pTween; } - CC_SAFE_DELETE(pTween); + AX_SAFE_DELETE(pTween); return nullptr; } @@ -62,8 +62,8 @@ Tween::Tween() Tween::~Tween(void) { - CC_SAFE_DELETE(_from); - CC_SAFE_DELETE(_between); + AX_SAFE_DELETE(_from); + AX_SAFE_DELETE(_between); } bool Tween::init(Bone* bone) @@ -260,7 +260,7 @@ void Tween::updateHandler() if (_currentPercent < 1 && _loopType <= ANIMATION_TO_LOOP_BACK) { - _currentPercent = sin(_currentPercent * CC_HALF_PI); + _currentPercent = sin(_currentPercent * AX_HALF_PI); } float percent = _currentPercent; diff --git a/extensions/cocostudio/CocosStudioExport.h b/extensions/cocostudio/CocosStudioExport.h index c5612b730e..7f88c5b847 100644 --- a/extensions/cocostudio/CocosStudioExport.h +++ b/extensions/cocostudio/CocosStudioExport.h @@ -7,7 +7,7 @@ # include # endif -# if defined(CC_STATIC) +# if defined(AX_STATIC) # define CCS_DLL # else # if defined(_USRCCS_DLL) diff --git a/extensions/cocostudio/DictionaryHelper.cpp b/extensions/cocostudio/DictionaryHelper.cpp index 09fccc8624..38a3e4d74c 100644 --- a/extensions/cocostudio/DictionaryHelper.cpp +++ b/extensions/cocostudio/DictionaryHelper.cpp @@ -45,7 +45,7 @@ DictionaryHelper* DictionaryHelper::getInstance() void DictionaryHelper::destroyInstance() { - CC_SAFE_DELETE(sharedHelper); + AX_SAFE_DELETE(sharedHelper); } const rapidjson::Value& DictionaryHelper::getSubDictionary_json(const rapidjson::Value& root, const char* key) @@ -68,9 +68,9 @@ int DictionaryHelper::getIntValue_json(const rapidjson::Value& root, const char* int nRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.HasMember(key)); - CC_BREAK_IF(root[key].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.HasMember(key)); + AX_BREAK_IF(root[key].IsNull()); nRet = root[key].GetInt(); } while (0); @@ -82,9 +82,9 @@ float DictionaryHelper::getFloatValue_json(const rapidjson::Value& root, const c float fRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.HasMember(key)); - CC_BREAK_IF(root[key].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.HasMember(key)); + AX_BREAK_IF(root[key].IsNull()); fRet = (float)root[key].GetDouble(); } while (0); @@ -96,9 +96,9 @@ bool DictionaryHelper::getBooleanValue_json(const rapidjson::Value& root, const bool bRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.HasMember(key)); - CC_BREAK_IF(root[key].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.HasMember(key)); + AX_BREAK_IF(root[key].IsNull()); bRet = root[key].GetBool(); } while (0); @@ -110,9 +110,9 @@ const char* DictionaryHelper::getStringValue_json(const rapidjson::Value& root, const char* sRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.HasMember(key)); - CC_BREAK_IF(root[key].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.HasMember(key)); + AX_BREAK_IF(root[key].IsNull()); sRet = root[key].GetString(); } while (0); @@ -124,9 +124,9 @@ int DictionaryHelper::getArrayCount_json(const rapidjson::Value& root, const cha int nRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.HasMember(key)); - CC_BREAK_IF(root[key].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.HasMember(key)); + AX_BREAK_IF(root[key].IsNull()); nRet = (int)(root[key].Size()); } while (0); @@ -138,10 +138,10 @@ int DictionaryHelper::getIntValueFromArray_json(const rapidjson::Value& root, co int nRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.HasMember(arrayKey)); - CC_BREAK_IF(root[arrayKey].IsNull()); - CC_BREAK_IF(root[arrayKey][idx].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.HasMember(arrayKey)); + AX_BREAK_IF(root[arrayKey].IsNull()); + AX_BREAK_IF(root[arrayKey][idx].IsNull()); nRet = root[arrayKey][idx].GetInt(); } while (0); @@ -156,9 +156,9 @@ float DictionaryHelper::getFloatValueFromArray_json(const rapidjson::Value& root float fRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(root[arrayKey].IsNull()); - CC_BREAK_IF(root[arrayKey][idx].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(root[arrayKey].IsNull()); + AX_BREAK_IF(root[arrayKey][idx].IsNull()); fRet = (float)root[arrayKey][idx].GetDouble(); } while (0); @@ -170,9 +170,9 @@ bool DictionaryHelper::getBoolValueFromArray_json(const rapidjson::Value& root, bool bRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(root[arrayKey].IsNull()); - CC_BREAK_IF(root[arrayKey][idx].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(root[arrayKey].IsNull()); + AX_BREAK_IF(root[arrayKey][idx].IsNull()); bRet = root[arrayKey][idx].GetBool(); } while (0); @@ -187,9 +187,9 @@ const char* DictionaryHelper::getStringValueFromArray_json(const rapidjson::Valu const char* sRet = def; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(root[arrayKey].IsNull()); - CC_BREAK_IF(root[arrayKey][idx].IsNull()); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(root[arrayKey].IsNull()); + AX_BREAK_IF(root[arrayKey][idx].IsNull()); sRet = root[arrayKey][idx].GetString(); } while (0); @@ -208,7 +208,7 @@ bool DictionaryHelper::checkObjectExist_json(const rapidjson::Value& root) bool bRet = false; do { - CC_BREAK_IF(root.IsNull()); + AX_BREAK_IF(root.IsNull()); bRet = true; } while (0); @@ -220,7 +220,7 @@ bool DictionaryHelper::checkObjectExist_json(const rapidjson::Value& root, const bool bRet = false; do { - CC_BREAK_IF(root.IsNull()); + AX_BREAK_IF(root.IsNull()); bRet = root.HasMember(key); } while (0); @@ -232,9 +232,9 @@ bool DictionaryHelper::checkObjectExist_json(const rapidjson::Value& root, int i bool bRet = false; do { - CC_BREAK_IF(root.IsNull()); - CC_BREAK_IF(!root.IsArray()); - CC_BREAK_IF(index < 0 || root.Size() <= (unsigned int)index); + AX_BREAK_IF(root.IsNull()); + AX_BREAK_IF(!root.IsArray()); + AX_BREAK_IF(index < 0 || root.Size() <= (unsigned int)index); bRet = true; } while (0); diff --git a/extensions/cocostudio/FlatBuffersSerialize.cpp b/extensions/cocostudio/FlatBuffersSerialize.cpp index 0e16ceacda..d091de9614 100644 --- a/extensions/cocostudio/FlatBuffersSerialize.cpp +++ b/extensions/cocostudio/FlatBuffersSerialize.cpp @@ -124,12 +124,12 @@ FlatBuffersSerialize* FlatBuffersSerialize::getInstance() void FlatBuffersSerialize::purge() { - CC_SAFE_DELETE(_instanceFlatBuffersSerialize); + AX_SAFE_DELETE(_instanceFlatBuffersSerialize); } void FlatBuffersSerialize::destroyInstance() { - CC_SAFE_DELETE(_instanceFlatBuffersSerialize); + AX_SAFE_DELETE(_instanceFlatBuffersSerialize); } void FlatBuffersSerialize::deleteFlatBufferBuilder() @@ -137,7 +137,7 @@ void FlatBuffersSerialize::deleteFlatBufferBuilder() if (_builder != nullptr) { _builder->Clear(); - CC_SAFE_DELETE(_builder); + AX_SAFE_DELETE(_builder); } } diff --git a/extensions/cocostudio/FlatBuffersSerialize.h b/extensions/cocostudio/FlatBuffersSerialize.h index fca7ced434..0e3bc9e6a4 100644 --- a/extensions/cocostudio/FlatBuffersSerialize.h +++ b/extensions/cocostudio/FlatBuffersSerialize.h @@ -97,7 +97,7 @@ class CCS_DLL FlatBuffersSerialize public: static FlatBuffersSerialize* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); FlatBuffersSerialize(); diff --git a/extensions/cocostudio/LocalizationManager.cpp b/extensions/cocostudio/LocalizationManager.cpp index 7352bf60ce..c0ab1f66b8 100644 --- a/extensions/cocostudio/LocalizationManager.cpp +++ b/extensions/cocostudio/LocalizationManager.cpp @@ -31,7 +31,7 @@ JsonLocalizationManager::JsonLocalizationManager() : languageData(nullptr) {} JsonLocalizationManager::~JsonLocalizationManager() { - CC_SAFE_DELETE(languageData); + AX_SAFE_DELETE(languageData); } bool JsonLocalizationManager::initLanguageData(std::string file) @@ -47,7 +47,7 @@ bool JsonLocalizationManager::initLanguageData(std::string file) if (languageData->IsObject()) result = true; else - CC_SAFE_DELETE(languageData); + AX_SAFE_DELETE(languageData); } return result; diff --git a/extensions/cocostudio/SpineSkeletonDataCache.cpp b/extensions/cocostudio/SpineSkeletonDataCache.cpp index 029c1f0718..7285a8e49f 100644 --- a/extensions/cocostudio/SpineSkeletonDataCache.cpp +++ b/extensions/cocostudio/SpineSkeletonDataCache.cpp @@ -1,6 +1,6 @@ #include "SpineSkeletonDataCache.h" -#if !defined(CC_USE_SPINE_CPP) || CC_USE_SPINE_CPP +#if !defined(AX_USE_SPINE_CPP) || AX_USE_SPINE_CPP SpineSkeletonDataCache* SpineSkeletonDataCache::getInstance() { static SpineSkeletonDataCache internalShared; diff --git a/extensions/cocostudio/SpineSkeletonDataCache.h b/extensions/cocostudio/SpineSkeletonDataCache.h index 6557a4fca4..a5ea3e08ae 100644 --- a/extensions/cocostudio/SpineSkeletonDataCache.h +++ b/extensions/cocostudio/SpineSkeletonDataCache.h @@ -6,7 +6,7 @@ #include "CocosStudioExport.h" #include -#if !defined(CC_USE_SPINE_CPP) || CC_USE_SPINE_CPP +#if !defined(AX_USE_SPINE_CPP) || AX_USE_SPINE_CPP class CCS_DLL SpineSkeletonDataCache { public: diff --git a/extensions/cocostudio/TriggerMng.cpp b/extensions/cocostudio/TriggerMng.cpp index 99a4cf0d84..07034fd863 100644 --- a/extensions/cocostudio/TriggerMng.cpp +++ b/extensions/cocostudio/TriggerMng.cpp @@ -49,9 +49,9 @@ TriggerMng::~TriggerMng(void) _triggerObjs.clear(); removeAllArmatureMovementCallBack(); - CC_SAFE_DELETE(_movementDispatches); + AX_SAFE_DELETE(_movementDispatches); - CC_SAFE_RELEASE(_eventDispatcher); + AX_SAFE_RELEASE(_eventDispatcher); } const char* TriggerMng::triggerMngVersion() @@ -70,7 +70,7 @@ TriggerMng* TriggerMng::getInstance() void TriggerMng::destroyInstance() { - CC_SAFE_DELETE(_sharedTriggerMng); + AX_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 CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEngineProtocol* engine = ScriptEngineManager::getInstance()->getScriptEngine(); bool useBindings = engine != nullptr; @@ -95,7 +95,7 @@ void TriggerMng::parse(const rapidjson::Value& root) } } else -#endif // #if CC_ENABLE_SCRIPT_BINDING +#endif // #if AX_ENABLE_SCRIPT_BINDING { for (int i = 0; i < count; ++i) { @@ -115,7 +115,7 @@ void TriggerMng::parse(cocostudio::CocoLoader* pCocoLoader, cocostudio::stExpCoc int count = pCocoNode[13].GetChildNum(); stExpCocoNode* pTriggersArray = pCocoNode[13].GetChildArray(pCocoLoader); -#if CC_ENABLE_SCRIPT_BINDING +#if AX_ENABLE_SCRIPT_BINDING ScriptEngineProtocol* engine = ScriptEngineManager::getInstance()->getScriptEngine(); bool useBindings = engine != nullptr; @@ -133,7 +133,7 @@ void TriggerMng::parse(cocostudio::CocoLoader* pCocoLoader, cocostudio::stExpCoc } } else -#endif // #if CC_ENABLE_SCRIPT_BINDING +#endif // #if AX_ENABLE_SCRIPT_BINDING { for (int i = 0; i < count; ++i) { @@ -161,7 +161,7 @@ void TriggerMng::removeAll(void) for (; etIter != _triggerObjs.end(); ++etIter) { etIter->second->removeAll(); - CC_SAFE_DELETE(etIter->second); + AX_SAFE_DELETE(etIter->second); } _triggerObjs.clear(); } @@ -415,7 +415,7 @@ void TriggerMng::addArmatureMovementCallBack(Armature* pAr, Ref* pTarget, SEL_Mo if (iter == _movementDispatches->end()) { amd = new ArmatureMovementDispatcher(); - pAr->getAnimation()->setMovementEventCallFunc(CC_CALLBACK_0(ArmatureMovementDispatcher::animationEvent, amd, + pAr->getAnimation()->setMovementEventCallFunc(AX_CALLBACK_0(ArmatureMovementDispatcher::animationEvent, amd, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); amd->addAnimationEventCallBack(pTarget, mecf); @@ -462,7 +462,7 @@ void TriggerMng::removeArmatureAllMovementCallBack(Armature* pAr) } else { - CC_SAFE_DELETE(iter->second); + AX_SAFE_DELETE(iter->second); _movementDispatches->erase(iter); } } @@ -500,7 +500,7 @@ ArmatureMovementDispatcher::ArmatureMovementDispatcher(void) : _mapEventAnimatio ArmatureMovementDispatcher::~ArmatureMovementDispatcher(void) { _mapEventAnimation->clear(); - CC_SAFE_DELETE(_mapEventAnimation); + AX_SAFE_DELETE(_mapEventAnimation); } void ArmatureMovementDispatcher::animationEvent(Armature* armature, diff --git a/extensions/cocostudio/TriggerObj.cpp b/extensions/cocostudio/TriggerObj.cpp index f67c5d9ca8..06f2026f62 100644 --- a/extensions/cocostudio/TriggerObj.cpp +++ b/extensions/cocostudio/TriggerObj.cpp @@ -84,7 +84,7 @@ TriggerObj* TriggerObj::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; } diff --git a/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp b/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp index 88d545de54..e4de3e220f 100644 --- a/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp +++ b/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp @@ -7,7 +7,7 @@ #include "CSParseBinary_generated.h" #include "WidgetReader/ArmatureNodeReader/CSArmatureNode_generated.h" #include "CCArmature.h" -#if defined(CC_BUILD_WITH_DRANGBONES) && CC_BUILD_WITH_DRANGBONES +#if defined(AX_BUILD_WITH_DRANGBONES) && AX_BUILD_WITH_DRANGBONES # include "DragonBones/CCDragonBonesHeaders.h" #endif @@ -34,7 +34,7 @@ ArmatureNodeReader* ArmatureNodeReader::getInstance() void ArmatureNodeReader::destroyInstance() { - CC_SAFE_DELETE(_instanceArmatureNodeReader); + AX_SAFE_DELETE(_instanceArmatureNodeReader); } Offset ArmatureNodeReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, @@ -142,7 +142,7 @@ void ArmatureNodeReader::setPropsWithFlatBuffers(axis::Node* node, const flatbuf if (FileUtils::getInstance()->isFileExist(filepath)) { fileExist = true; -#if defined(CC_BUILD_WITH_DRANGBONES) && CC_BUILD_WITH_DRANGBONES +#if defined(AX_BUILD_WITH_DRANGBONES) && AX_BUILD_WITH_DRANGBONES auto filep = filepath.rfind('.'); if (filep != std::string::npos && strcmp(&filepath[filep], ".json") == 0) { // Currently, adjust by file ext, regard as DragonBones 4.5/5.0 diff --git a/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h b/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h index 4e767494a8..3abe8079bf 100644 --- a/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h +++ b/extensions/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h @@ -47,7 +47,7 @@ public: static ArmatureNodeReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers( diff --git a/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp b/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp index 2a0511eeb8..ebe152a284 100644 --- a/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp +++ b/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp @@ -56,12 +56,12 @@ ButtonReader* ButtonReader::getInstance() void ButtonReader::purge() { - CC_SAFE_DELETE(instanceButtonReader); + AX_SAFE_DELETE(instanceButtonReader); } void ButtonReader::destroyInstance() { - CC_SAFE_DELETE(instanceButtonReader); + AX_SAFE_DELETE(instanceButtonReader); } void ButtonReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -83,9 +83,9 @@ void ButtonReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* coco std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_Scale9Enable) { button->setScale9Enabled(valueToBool(value)); } else if (key == P_NormalData) diff --git a/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.h b/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.h index c2a0c837b3..1f27a393a0 100644 --- a/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.h +++ b/extensions/cocostudio/WidgetReader/ButtonReader/ButtonReader.h @@ -40,7 +40,7 @@ public: static ButtonReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp b/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp index 64848dbe90..4258aad24a 100644 --- a/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp +++ b/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp @@ -42,7 +42,7 @@ CheckBoxReader* CheckBoxReader::getInstance() void CheckBoxReader::destroyInstance() { - CC_SAFE_DELETE(instanceCheckBoxReader); + AX_SAFE_DELETE(instanceCheckBoxReader); } void CheckBoxReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -57,9 +57,9 @@ void CheckBoxReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* co std::string key = stChildArray[i].GetName(cocoLoader); std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_BackGroundBoxData) { diff --git a/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h b/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h index a6a26c3f97..59003e2f42 100644 --- a/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h +++ b/extensions/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h @@ -40,7 +40,7 @@ public: static CheckBoxReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp b/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp index 99e15f2447..ecc98affc6 100644 --- a/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp +++ b/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp @@ -53,12 +53,12 @@ ComAudioReader* ComAudioReader::getInstance() void ComAudioReader::purge() { - CC_SAFE_DELETE(_instanceComAudioReader); + AX_SAFE_DELETE(_instanceComAudioReader); } void ComAudioReader::destroyInstance() { - CC_SAFE_DELETE(_instanceComAudioReader); + AX_SAFE_DELETE(_instanceComAudioReader); } Offset
ComAudioReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h b/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h index c480a42c12..336f84a5c9 100644 --- a/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h +++ b/extensions/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h @@ -42,7 +42,7 @@ public: static ComAudioReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp b/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp index 00ee259ead..a7a67e9e82 100644 --- a/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp +++ b/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp @@ -60,7 +60,7 @@ GameMapReader* GameMapReader::getInstance() void GameMapReader::destroyInstance() { - CC_SAFE_DELETE(_instanceTMXTiledMapReader); + AX_SAFE_DELETE(_instanceTMXTiledMapReader); } Offset
GameMapReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.h b/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.h index ac6fd6b602..6e04fc06e3 100644 --- a/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.h +++ b/extensions/cocostudio/WidgetReader/GameMapReader/GameMapReader.h @@ -41,7 +41,7 @@ public: static GameMapReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp b/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp index 64ab0199e4..221938102d 100644 --- a/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp +++ b/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp @@ -65,12 +65,12 @@ CameraBackgroundBrush* GameNode3DReader::getSceneBrushInstance() void GameNode3DReader::purge() { - CC_SAFE_DELETE(_instanceNode3DReader); + AX_SAFE_DELETE(_instanceNode3DReader); } void GameNode3DReader::destroyInstance() { - CC_SAFE_DELETE(_instanceNode3DReader); + AX_SAFE_DELETE(_instanceNode3DReader); } Offset
GameNode3DReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h b/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h index 1d5af11bc9..4d3938522f 100644 --- a/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h +++ b/extensions/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h @@ -43,7 +43,7 @@ public: static GameNode3DReader* getInstance(); static axis::CameraBackgroundBrush* getSceneBrushInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp b/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp index 8117f9e1d0..d9ad630589 100644 --- a/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp +++ b/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp @@ -46,7 +46,7 @@ ImageViewReader* ImageViewReader::getInstance() void ImageViewReader::destroyInstance() { - CC_SAFE_DELETE(instanceImageViewReader); + AX_SAFE_DELETE(instanceImageViewReader); } void ImageViewReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -65,9 +65,9 @@ void ImageViewReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* c std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_Scale9Enable) { imageView->setScale9Enabled(valueToBool(value)); } else if (key == P_FileNameData) diff --git a/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h b/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h index 9b3be9fb5e..8bfe44fa0b 100644 --- a/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h +++ b/extensions/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h @@ -40,7 +40,7 @@ public: static ImageViewReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp b/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp index 6ec925e3ab..503afd44bc 100644 --- a/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp +++ b/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp @@ -62,7 +62,7 @@ LayoutReader* LayoutReader::getInstance() void LayoutReader::destroyInstance() { - CC_SAFE_DELETE(instanceLayoutReader); + AX_SAFE_DELETE(instanceLayoutReader); } void LayoutReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -88,9 +88,9 @@ void LayoutReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* coco std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_AdaptScreen) { _isAdaptScreen = valueToBool(value); } else if (key == P_ClipAble) { panel->setClippingEnabled(valueToBool(value)); } diff --git a/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.h b/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.h index 1e21e9ce59..ad35162066 100644 --- a/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.h +++ b/extensions/cocostudio/WidgetReader/LayoutReader/LayoutReader.h @@ -41,7 +41,7 @@ public: static LayoutReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp b/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp index 3bdabc16a0..416140f9ba 100644 --- a/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp +++ b/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp @@ -58,12 +58,12 @@ Light3DReader* Light3DReader::getInstance() void Light3DReader::purge() { - CC_SAFE_DELETE(_instanceLight3DReader); + AX_SAFE_DELETE(_instanceLight3DReader); } void Light3DReader::destroyInstance() { - CC_SAFE_DELETE(_instanceLight3DReader); + AX_SAFE_DELETE(_instanceLight3DReader); } Offset
Light3DReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, @@ -181,7 +181,7 @@ Node* Light3DReader::createNodeWithFlatBuffers(const flatbuffers::Table* light3D break; case axis::LightType::SPOT: light = - SpotLight::create(Vec3::UNIT_Z, Vec3::ZERO, Color3B::WHITE, 0, CC_DEGREES_TO_RADIANS(outerAngle), range); + SpotLight::create(Vec3::UNIT_Z, Vec3::ZERO, Color3B::WHITE, 0, AX_DEGREES_TO_RADIANS(outerAngle), range); break; case axis::LightType::AMBIENT: light = AmbientLight::create(Color3B::WHITE); diff --git a/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.h b/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.h index 353edfcb9b..2952762268 100644 --- a/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.h +++ b/extensions/cocostudio/WidgetReader/Light3DReader/Light3DReader.h @@ -41,7 +41,7 @@ public: static Light3DReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp b/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp index aca256f011..842fca5e09 100644 --- a/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp +++ b/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp @@ -39,7 +39,7 @@ ListViewReader* ListViewReader::getInstance() void ListViewReader::destroyInstance() { - CC_SAFE_DELETE(instanceListViewReader); + AX_SAFE_DELETE(instanceListViewReader); } void ListViewReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) diff --git a/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.h b/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.h index f0f795aeda..ca96b53cd8 100644 --- a/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.h +++ b/extensions/cocostudio/WidgetReader/ListViewReader/ListViewReader.h @@ -40,7 +40,7 @@ public: static ListViewReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp b/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp index f9fa8c337c..4467b8f5f3 100644 --- a/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp +++ b/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp @@ -46,7 +46,7 @@ LoadingBarReader* LoadingBarReader::getInstance() void LoadingBarReader::destroyInstance() { - CC_SAFE_DELETE(instanceLoadingBar); + AX_SAFE_DELETE(instanceLoadingBar); } void LoadingBarReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -67,9 +67,9 @@ void LoadingBarReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_Scale9Enable) { loadingBar->setScale9Enabled(valueToBool(value)); } else if (key == P_TextureData) diff --git a/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h b/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h index 05dbe0aa87..5f18b35cab 100644 --- a/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h +++ b/extensions/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h @@ -40,7 +40,7 @@ public: static LoadingBarReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.cpp b/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.cpp index 83573dae9d..088ae2717a 100644 --- a/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.cpp +++ b/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.cpp @@ -63,12 +63,12 @@ MeshReader* MeshReader::getInstance() void MeshReader::purge() { - CC_SAFE_DELETE(_instanceMeshReader); + AX_SAFE_DELETE(_instanceMeshReader); } void MeshReader::destroyInstance() { - CC_SAFE_DELETE(_instanceMeshReader); + AX_SAFE_DELETE(_instanceMeshReader); } Vec2 MeshReader::getVec2Attribute(pugi::xml_attribute attribute) const diff --git a/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.h b/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.h index 4d82d3f914..c9cbff63c6 100644 --- a/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.h +++ b/extensions/cocostudio/WidgetReader/MeshReader/MeshReader.h @@ -42,7 +42,7 @@ public: static MeshReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp b/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp index 418371a655..1f7c31e3dd 100644 --- a/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp +++ b/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp @@ -57,12 +57,12 @@ Node3DReader* Node3DReader::getInstance() void Node3DReader::purge() { - CC_SAFE_DELETE(_instanceNode3DReader); + AX_SAFE_DELETE(_instanceNode3DReader); } void Node3DReader::destroyInstance() { - CC_SAFE_DELETE(_instanceNode3DReader); + AX_SAFE_DELETE(_instanceNode3DReader); } Vec3 Node3DReader::getVec3Attribute(pugi::xml_attribute attribute) const diff --git a/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.h b/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.h index 1f6d3a34ae..fc209726f0 100644 --- a/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.h +++ b/extensions/cocostudio/WidgetReader/Node3DReader/Node3DReader.h @@ -42,7 +42,7 @@ public: static Node3DReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.cpp b/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.cpp index 74a15ee41e..7354d479d3 100644 --- a/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.cpp +++ b/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.cpp @@ -74,7 +74,7 @@ NodeReader* NodeReader::getInstance() void NodeReader::destroyInstance() { - CC_SAFE_DELETE(_instanceNodeReader); + AX_SAFE_DELETE(_instanceNodeReader); } Offset
NodeReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.h b/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.h index 84dde876ac..17ce65cc25 100644 --- a/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.h +++ b/extensions/cocostudio/WidgetReader/NodeReader/NodeReader.h @@ -41,7 +41,7 @@ public: static NodeReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/NodeReaderProtocol.h b/extensions/cocostudio/WidgetReader/NodeReaderProtocol.h index beaa5723e4..15a930f316 100644 --- a/extensions/cocostudio/WidgetReader/NodeReaderProtocol.h +++ b/extensions/cocostudio/WidgetReader/NodeReaderProtocol.h @@ -134,7 +134,7 @@ namespace wext { // engine extends APIs // TODO-2020 -CC_DLL extern APP_LOGERROR_FUNC getAppErrorLogFunc(); +AX_DLL extern APP_LOGERROR_FUNC getAppErrorLogFunc(); CCS_DLL extern void (*onLoadSpriteFramesWithFile)(std::string& file); diff --git a/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp b/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp index 4599666cb7..7769e80813 100644 --- a/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp +++ b/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp @@ -37,7 +37,7 @@ PageViewReader* PageViewReader::getInstance() void PageViewReader::destroyInstance() { - CC_SAFE_DELETE(instancePageViewReader); + AX_SAFE_DELETE(instancePageViewReader); } void PageViewReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) diff --git a/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.h b/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.h index c90083508e..197720147d 100644 --- a/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.h +++ b/extensions/cocostudio/WidgetReader/PageViewReader/PageViewReader.h @@ -40,7 +40,7 @@ public: static PageViewReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp b/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp index c1719f34c7..c880545efb 100644 --- a/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp +++ b/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp @@ -59,12 +59,12 @@ Particle3DReader* Particle3DReader::getInstance() void Particle3DReader::purge() { - CC_SAFE_DELETE(_instanceParticle3DReader); + AX_SAFE_DELETE(_instanceParticle3DReader); } void Particle3DReader::destroyInstance() { - CC_SAFE_DELETE(_instanceParticle3DReader); + AX_SAFE_DELETE(_instanceParticle3DReader); } Offset
Particle3DReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h b/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h index 555c1f6e45..a4cb542a10 100644 --- a/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h +++ b/extensions/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h @@ -41,7 +41,7 @@ public: static Particle3DReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp b/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp index 5c31abfa1b..5ac1761483 100644 --- a/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp +++ b/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp @@ -58,12 +58,12 @@ ParticleReader* ParticleReader::getInstance() void ParticleReader::purge() { - CC_SAFE_DELETE(_instanceParticleReader); + AX_SAFE_DELETE(_instanceParticleReader); } void ParticleReader::destroyInstance() { - CC_SAFE_DELETE(_instanceParticleReader); + AX_SAFE_DELETE(_instanceParticleReader); } Offset
ParticleReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.h b/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.h index 099bbb1c46..75c9aa47bf 100644 --- a/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.h +++ b/extensions/cocostudio/WidgetReader/ParticleReader/ParticleReader.h @@ -41,7 +41,7 @@ public: static ParticleReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp b/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp index c817d6dc82..82b5cbf287 100644 --- a/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp +++ b/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp @@ -52,12 +52,12 @@ ProjectNodeReader* ProjectNodeReader::getInstance() void ProjectNodeReader::purge() { - CC_SAFE_DELETE(_instanceProjectNodeReader); + AX_SAFE_DELETE(_instanceProjectNodeReader); } void ProjectNodeReader::destroyInstance() { - CC_SAFE_DELETE(_instanceProjectNodeReader); + AX_SAFE_DELETE(_instanceProjectNodeReader); } Offset
ProjectNodeReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h b/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h index 560385bb38..6b069251de 100644 --- a/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h +++ b/extensions/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h @@ -40,7 +40,7 @@ public: static ProjectNodeReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.cpp b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.cpp index a1cb3abac8..d0cb6f7b7b 100644 --- a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.cpp +++ b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.cpp @@ -46,7 +46,7 @@ RadioButtonGroupReader* RadioButtonGroupReader::getInstance() void RadioButtonGroupReader::destroyInstance() { - CC_SAFE_DELETE(s_readerInstance); + AX_SAFE_DELETE(s_readerInstance); } Offset
RadioButtonGroupReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h index fa232ffff9..1e5f9927f7 100644 --- a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h +++ b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h @@ -40,7 +40,7 @@ public: static RadioButtonGroupReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.cpp b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.cpp index 1181118833..fca7cc9c45 100644 --- a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.cpp +++ b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.cpp @@ -42,7 +42,7 @@ RadioButtonReader* RadioButtonReader::getInstance() void RadioButtonReader::destroyInstance() { - CC_SAFE_DELETE(instanceCheckBoxReader); + AX_SAFE_DELETE(instanceCheckBoxReader); } Offset
RadioButtonReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h index 1ea45967a5..d26506f886 100644 --- a/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h +++ b/extensions/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h @@ -40,7 +40,7 @@ public: static RadioButtonReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.cpp b/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.cpp index b806536752..c6f1126f29 100644 --- a/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.cpp +++ b/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.cpp @@ -36,7 +36,7 @@ RichTextReader* RichTextReader::getInstance() void RichTextReader::destroyInstance() { - CC_SAFE_DELETE(instanceTextBMFontReader); + AX_SAFE_DELETE(instanceTextBMFontReader); } Offset
RichTextReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.h b/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.h index ef63953e8f..3ab385c202 100644 --- a/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.h +++ b/extensions/cocostudio/WidgetReader/RichTextReader/RichTextReader.h @@ -40,7 +40,7 @@ public: static RichTextReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp b/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp index c38e50f149..ff9eefe75f 100644 --- a/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp +++ b/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp @@ -41,7 +41,7 @@ ScrollViewReader* ScrollViewReader::getInstance() void ScrollViewReader::destroyInstance() { - CC_SAFE_DELETE(instanceScrollViewReader); + AX_SAFE_DELETE(instanceScrollViewReader); } void ScrollViewReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) diff --git a/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h b/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h index 0e364bbca2..17a9765978 100644 --- a/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h +++ b/extensions/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h @@ -40,7 +40,7 @@ public: static ScrollViewReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp b/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp index 29aad3a48a..f9c1984888 100644 --- a/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp +++ b/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp @@ -55,12 +55,12 @@ SingleNodeReader* SingleNodeReader::getInstance() void SingleNodeReader::purge() { - CC_SAFE_DELETE(_instanceSingleNodeReader); + AX_SAFE_DELETE(_instanceSingleNodeReader); } void SingleNodeReader::destroyInstance() { - CC_SAFE_DELETE(_instanceSingleNodeReader); + AX_SAFE_DELETE(_instanceSingleNodeReader); } Offset
SingleNodeReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h b/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h index 0c3aaf2764..1e9a2249c3 100644 --- a/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h +++ b/extensions/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h @@ -41,7 +41,7 @@ public: static SingleNodeReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.cpp b/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.cpp index 5a69bf37e8..c65cd0c588 100644 --- a/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.cpp +++ b/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.cpp @@ -55,7 +55,7 @@ BoneNodeReader* BoneNodeReader::getInstance() void BoneNodeReader::destroyInstance() { - CC_SAFE_DELETE(_instanceBoneNodeReader); + AX_SAFE_DELETE(_instanceBoneNodeReader); } Offset
BoneNodeReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h b/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h index c6aa8e1dd6..58900d8c44 100644 --- a/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h +++ b/extensions/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h @@ -38,7 +38,7 @@ public: static BoneNodeReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers( diff --git a/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.cpp b/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.cpp index 46138fd143..bf2a126890 100644 --- a/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.cpp +++ b/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.cpp @@ -53,7 +53,7 @@ SkeletonNodeReader* SkeletonNodeReader::getInstance() void SkeletonNodeReader::destroyInstance() { - CC_SAFE_DELETE(_instanceSkeletonNodeReader); + AX_SAFE_DELETE(_instanceSkeletonNodeReader); } axis::Node* SkeletonNodeReader::createNodeWithFlatBuffers(const flatbuffers::Table* nodeOptions) diff --git a/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h b/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h index ced3d5f725..165adf2df9 100644 --- a/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h +++ b/extensions/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h @@ -37,7 +37,7 @@ public: static SkeletonNodeReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); axis::Node* createNodeWithFlatBuffers(const flatbuffers::Table* boneOptions) override; diff --git a/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.cpp b/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.cpp index d0e3def5d4..62efe0c015 100644 --- a/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.cpp +++ b/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.cpp @@ -46,7 +46,7 @@ SliderReader* SliderReader::getInstance() void SliderReader::destroyInstance() { - CC_SAFE_DELETE(instanceSliderReader); + AX_SAFE_DELETE(instanceSliderReader); } void SliderReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -65,9 +65,9 @@ void SliderReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* coco std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER // control custom properties else if (key == P_Scale9Enable) { slider->setScale9Enabled(valueToBool(value)); } diff --git a/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.h b/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.h index a70ac3fa7e..6354350bbe 100644 --- a/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.h +++ b/extensions/cocostudio/WidgetReader/SliderReader/SliderReader.h @@ -40,7 +40,7 @@ public: static SliderReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.cpp b/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.cpp index 4349aa3ea9..83f8eb9aeb 100644 --- a/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.cpp +++ b/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.cpp @@ -24,7 +24,7 @@ #include "WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h" -#if defined(CC_BUILD_WITH_SPINE) +#if defined(AX_BUILD_WITH_SPINE) # include "SpineSkeletonDataCache.h" # include "2d/CCSprite.h" @@ -62,12 +62,12 @@ SpineSkeletonReader* SpineSkeletonReader::getInstance() void SpineSkeletonReader::purge() { - CC_SAFE_DELETE(_instanceSpriteReader); + AX_SAFE_DELETE(_instanceSpriteReader); } void SpineSkeletonReader::destroyInstance() { - CC_SAFE_DELETE(_instanceSpriteReader); + AX_SAFE_DELETE(_instanceSpriteReader); } Offset
SpineSkeletonReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h b/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h index 9eae4303fa..6cc84e7db3 100644 --- a/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h +++ b/extensions/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h @@ -29,7 +29,7 @@ #include "WidgetReader/NodeReaderProtocol.h" #include "WidgetReader/NodeReaderDefine.h" -#if defined(CC_BUILD_WITH_SPINE) +#if defined(AX_BUILD_WITH_SPINE) namespace cocostudio { @@ -43,7 +43,7 @@ public: static SpineSkeletonReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp b/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp index 263bd65142..bd1ab92d27 100644 --- a/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp +++ b/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp @@ -63,12 +63,12 @@ SpriteReader* SpriteReader::getInstance() void SpriteReader::purge() { - CC_SAFE_DELETE(_instanceSpriteReader); + AX_SAFE_DELETE(_instanceSpriteReader); } void SpriteReader::destroyInstance() { - CC_SAFE_DELETE(_instanceSpriteReader); + AX_SAFE_DELETE(_instanceSpriteReader); } Offset
SpriteReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.h b/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.h index 761d284b3b..e9b70e9f30 100644 --- a/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.h +++ b/extensions/cocostudio/WidgetReader/SpriteReader/SpriteReader.h @@ -41,7 +41,7 @@ public: static SpriteReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp b/extensions/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp index b5912853d5..6e4fecd7ed 100644 --- a/extensions/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp +++ b/extensions/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp @@ -53,7 +53,7 @@ TabControlReader* TabControlReader::getInstance() void TabControlReader::destroyInstance() { - CC_SAFE_DELETE(_tabReaderInstance); + AX_SAFE_DELETE(_tabReaderInstance); } flatbuffers::Offset TabControlReader::createOptionsWithFlatBuffers( @@ -217,7 +217,7 @@ TabHeaderReader* TabHeaderReader::getInstance() void TabHeaderReader::destroyInstance() { - CC_SAFE_DELETE(_tabheaderReaderInstance); + AX_SAFE_DELETE(_tabheaderReaderInstance); } flatbuffers::Offset TabHeaderReader::createOptionsWithFlatBuffers( @@ -900,7 +900,7 @@ TabItemReader* TabItemReader::getInstance() void TabItemReader::destroyInstance() { - CC_SAFE_DELETE(_tabItemReaderInstance); + AX_SAFE_DELETE(_tabItemReaderInstance); } flatbuffers::Offset TabItemReader::createTabItemOptionWithFlatBuffers( diff --git a/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp b/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp index f9155c9306..486b97da70 100644 --- a/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp +++ b/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp @@ -42,7 +42,7 @@ TextAtlasReader* TextAtlasReader::getInstance() void TextAtlasReader::destroyInstance() { - CC_SAFE_DELETE(instanceTextAtlasReader); + AX_SAFE_DELETE(instanceTextAtlasReader); } void TextAtlasReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -67,9 +67,9 @@ void TextAtlasReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* c std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_StringValue) { stringValue = value; } else if (key == P_CharMapFileData) diff --git a/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h b/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h index 5e00f8edaa..2adac40e41 100644 --- a/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h +++ b/extensions/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h @@ -40,7 +40,7 @@ public: static TextAtlasReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp b/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp index 69fdba9c97..1a3632718c 100644 --- a/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp +++ b/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp @@ -39,7 +39,7 @@ TextBMFontReader* TextBMFontReader::getInstance() void TextBMFontReader::destroyInstance() { - CC_SAFE_DELETE(instanceTextBMFontReader); + AX_SAFE_DELETE(instanceTextBMFontReader); } void TextBMFontReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -55,9 +55,9 @@ void TextBMFontReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* std::string key = stChildArray[i].GetName(cocoLoader); std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_FileNameData) { diff --git a/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h b/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h index baf112a1e3..c2901d0d3e 100644 --- a/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h +++ b/extensions/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h @@ -40,7 +40,7 @@ public: static TextBMFontReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.cpp b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.cpp index adb491cf47..1eac411b78 100644 --- a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.cpp +++ b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.cpp @@ -58,7 +58,7 @@ TextFieldExReader* TextFieldExReader::getInstance() void TextFieldExReader::destroyInstance() { - CC_SAFE_DELETE(instanceTextFieldExReader); + AX_SAFE_DELETE(instanceTextFieldExReader); } Offset
TextFieldExReader::createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h index 897db93379..dae94a0515 100644 --- a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h +++ b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h @@ -40,7 +40,7 @@ public: static TextFieldExReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp index e378e7b01a..afdd34405c 100644 --- a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp +++ b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp @@ -46,7 +46,7 @@ TextFieldReader* TextFieldReader::getInstance() void TextFieldReader::destroyInstance() { - CC_SAFE_DELETE(instanceTextFieldReader); + AX_SAFE_DELETE(instanceTextFieldReader); } void TextFieldReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -63,9 +63,9 @@ void TextFieldReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* c std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_PlaceHolder) { textField->setPlaceHolder(value); } else if (key == P_Text) { textField->setString(value); } diff --git a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h index 95d4bfa675..00f92933b4 100644 --- a/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h +++ b/extensions/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h @@ -40,7 +40,7 @@ public: static TextFieldReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/TextReader/TextReader.cpp b/extensions/cocostudio/WidgetReader/TextReader/TextReader.cpp index cd2f194aad..b78c68bbf5 100644 --- a/extensions/cocostudio/WidgetReader/TextReader/TextReader.cpp +++ b/extensions/cocostudio/WidgetReader/TextReader/TextReader.cpp @@ -46,7 +46,7 @@ TextReader* TextReader::getInstance() void TextReader::destroyInstance() { - CC_SAFE_DELETE(instanceTextReader); + AX_SAFE_DELETE(instanceTextReader); } void TextReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) @@ -64,9 +64,9 @@ void TextReader::setPropsFromBinary(axis::ui::Widget* widget, CocoLoader* cocoLo std::string key = stChildArray[i].GetName(cocoLoader); std::string value = stChildArray[i].GetValue(cocoLoader); // read all basic properties of widget - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER // read all color related properties of widget - CC_COLOR_PROPERTY_BINARY_READER + AX_COLOR_PROPERTY_BINARY_READER else if (key == P_TouchScaleEnable) { label->setTouchScaleChangeEnabled(valueToBool(value)); } diff --git a/extensions/cocostudio/WidgetReader/TextReader/TextReader.h b/extensions/cocostudio/WidgetReader/TextReader/TextReader.h index 1fbf26280d..224a357e17 100644 --- a/extensions/cocostudio/WidgetReader/TextReader/TextReader.h +++ b/extensions/cocostudio/WidgetReader/TextReader/TextReader.h @@ -40,7 +40,7 @@ public: static TextReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp b/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp index 6aa9b289d4..e9f586e2a3 100644 --- a/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp +++ b/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp @@ -60,12 +60,12 @@ UserCameraReader* UserCameraReader::getInstance() void UserCameraReader::purge() { - CC_SAFE_DELETE(_instanceUserCameraReader); + AX_SAFE_DELETE(_instanceUserCameraReader); } void UserCameraReader::destroyInstance() { - CC_SAFE_DELETE(_instanceUserCameraReader); + AX_SAFE_DELETE(_instanceUserCameraReader); } Vec2 UserCameraReader::getVec2Attribute(pugi::xml_attribute attribute) const diff --git a/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h b/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h index 93dd8d11eb..bbedaf8fe7 100644 --- a/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h +++ b/extensions/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h @@ -42,7 +42,7 @@ public: static UserCameraReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/WidgetReader/WidgetReader.cpp b/extensions/cocostudio/WidgetReader/WidgetReader.cpp index 52e1175cc9..6c4dcb0232 100644 --- a/extensions/cocostudio/WidgetReader/WidgetReader.cpp +++ b/extensions/cocostudio/WidgetReader/WidgetReader.cpp @@ -128,12 +128,12 @@ WidgetReader* WidgetReader::getInstance() void WidgetReader::purge() { - CC_SAFE_DELETE(instanceWidgetReader); + AX_SAFE_DELETE(instanceWidgetReader); } void WidgetReader::destroyInstance() { - CC_SAFE_DELETE(instanceWidgetReader); + AX_SAFE_DELETE(instanceWidgetReader); } void WidgetReader::setPropsFromJsonDictionary(Widget* widget, const rapidjson::Value& options) @@ -403,7 +403,7 @@ void WidgetReader::setPropsFromBinary(axis::ui::Widget* widget, std::string key = stChildArray[i].GetName(cocoLoader); std::string value = stChildArray[i].GetValue(cocoLoader); - CC_BASIC_PROPERTY_BINARY_READER + AX_BASIC_PROPERTY_BINARY_READER } this->endSetBasicProperties(widget); diff --git a/extensions/cocostudio/WidgetReader/WidgetReader.h b/extensions/cocostudio/WidgetReader/WidgetReader.h index 3b7f8dfff9..cd58e0af95 100644 --- a/extensions/cocostudio/WidgetReader/WidgetReader.h +++ b/extensions/cocostudio/WidgetReader/WidgetReader.h @@ -47,7 +47,7 @@ public: static WidgetReader* getInstance(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); + AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(axis::ui::Widget* widget, const rapidjson::Value& options); @@ -141,7 +141,7 @@ extern const char* P_AnchorPointY; extern const char* P_ResourceType; extern const char* P_Path; -#define CC_BASIC_PROPERTY_BINARY_READER \ +#define AX_BASIC_PROPERTY_BINARY_READER \ if (key == P_IgnoreSize) \ { \ widget->ignoreContentAdaptWithSize(valueToBool(value)); \ @@ -287,7 +287,7 @@ extern const char* P_Path; } \ } -#define CC_COLOR_PROPERTY_BINARY_READER \ +#define AX_COLOR_PROPERTY_BINARY_READER \ else if (key == P_Opacity) { _opacity = valueToInt(value); } \ else if (key == P_ColorR) { _color.r = valueToInt(value); } \ else if (key == P_ColorG) { _color.g = valueToInt(value); } \ diff --git a/extensions/fairygui/DragDropManager.cpp b/extensions/fairygui/DragDropManager.cpp index ff27bdcef4..2cdd7ef5fc 100644 --- a/extensions/fairygui/DragDropManager.cpp +++ b/extensions/fairygui/DragDropManager.cpp @@ -19,12 +19,12 @@ DragDropManager::DragDropManager() : _agent->setAlign(TextHAlignment::CENTER); _agent->setVerticalAlign(TextVAlignment::CENTER); _agent->setSortingOrder(INT_MAX); - _agent->addEventListener(UIEventType::DragEnd, CC_CALLBACK_1(DragDropManager::onDragEnd, this)); + _agent->addEventListener(UIEventType::DragEnd, AX_CALLBACK_1(DragDropManager::onDragEnd, this)); } DragDropManager::~DragDropManager() { - CC_SAFE_RELEASE(_agent); + AX_SAFE_RELEASE(_agent); } DragDropManager* DragDropManager::getInstance() diff --git a/extensions/fairygui/FairyGUIMacros.h b/extensions/fairygui/FairyGUIMacros.h index 6168ede2eb..b244d2b6da 100644 --- a/extensions/fairygui/FairyGUIMacros.h +++ b/extensions/fairygui/FairyGUIMacros.h @@ -10,24 +10,24 @@ #define CALL_LATER_FUNC(__TYPE__,__FUNC__) \ void __selector_##__FUNC__(float dt) \ {\ - axis::Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this);\ + axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this);\ __FUNC__(); \ }\ void __FUNC__() #define CALL_LATER(__TYPE__,__FUNC__,...) \ -if (!axis::Director::getInstance()->getScheduler()->isScheduled(CC_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this))\ - axis::Director::getInstance()->getScheduler()->schedule(CC_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this, (__VA_ARGS__+0), false) +if (!axis::Director::getInstance()->getScheduler()->isScheduled(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this))\ + axis::Director::getInstance()->getScheduler()->schedule(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this, (__VA_ARGS__+0), false) #define CALL_LATER_CANCEL(__TYPE__,__FUNC__) \ -axis::Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this) +axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this) #define CALL_PER_FRAME(__TYPE__,__FUNC__) \ -if (!axis::Director::getInstance()->getScheduler()->isScheduled(CC_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this))\ - axis::Director::getInstance()->getScheduler()->schedule(CC_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this, 0, false) +if (!axis::Director::getInstance()->getScheduler()->isScheduled(AX_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this))\ + axis::Director::getInstance()->getScheduler()->schedule(AX_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this, 0, false) #define CALL_PER_FRAME_CANCEL(__TYPE__,__FUNC__) \ -axis::Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this) +axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this) #define UIRoot GRoot::getInstance() diff --git a/extensions/fairygui/GButton.cpp b/extensions/fairygui/GButton.cpp index ac332beceb..55966f41bb 100644 --- a/extensions/fairygui/GButton.cpp +++ b/extensions/fairygui/GButton.cpp @@ -289,12 +289,12 @@ void GButton::constructExtension(ByteBuffer* buffer) if (_mode == ButtonMode::COMMON) setState(UP); - addEventListener(UIEventType::RollOver, CC_CALLBACK_1(GButton::onRollOver, this)); - addEventListener(UIEventType::RollOut, CC_CALLBACK_1(GButton::onRollOut, this)); - addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GButton::onTouchBegin, this)); - addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(GButton::onTouchEnd, this)); - addEventListener(UIEventType::Click, CC_CALLBACK_1(GButton::onClick, this)); - addEventListener(UIEventType::Exit, CC_CALLBACK_1(GButton::onExit, this)); + addEventListener(UIEventType::RollOver, AX_CALLBACK_1(GButton::onRollOver, this)); + addEventListener(UIEventType::RollOut, AX_CALLBACK_1(GButton::onRollOut, this)); + addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GButton::onTouchBegin, this)); + addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(GButton::onTouchEnd, this)); + addEventListener(UIEventType::Click, AX_CALLBACK_1(GButton::onClick, this)); + addEventListener(UIEventType::Exit, AX_CALLBACK_1(GButton::onExit, this)); } void GButton::setup_afterAdd(ByteBuffer* buffer, int beginPos) diff --git a/extensions/fairygui/GComboBox.cpp b/extensions/fairygui/GComboBox.cpp index 3898a4080a..154733093f 100644 --- a/extensions/fairygui/GComboBox.cpp +++ b/extensions/fairygui/GComboBox.cpp @@ -28,7 +28,7 @@ GComboBox::GComboBox() GComboBox::~GComboBox() { - CC_SAFE_RELEASE(_dropdown); + AX_SAFE_RELEASE(_dropdown); } const std::string& GComboBox::getTitle() const @@ -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, CC_CALLBACK_1(GComboBox::onClickItem, this)); + _list->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(GComboBox::onClickItem, this)); _list->addRelation(_dropdown, RelationType::Width); _list->removeRelation(_dropdown, RelationType::Height); @@ -322,13 +322,13 @@ void GComboBox::constructExtension(ByteBuffer* buffer) _dropdown->addRelation(_list, RelationType::Height); _dropdown->removeRelation(_list, RelationType::Width); - _dropdown->addEventListener(UIEventType::Exit, CC_CALLBACK_1(GComboBox::onPopupWinClosed, this)); + _dropdown->addEventListener(UIEventType::Exit, AX_CALLBACK_1(GComboBox::onPopupWinClosed, this)); } - addEventListener(UIEventType::RollOver, CC_CALLBACK_1(GComboBox::onRollover, this)); - addEventListener(UIEventType::RollOut, CC_CALLBACK_1(GComboBox::onRollout, this)); - addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GComboBox::onTouchBegin, this)); - addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(GComboBox::onTouchEnd, this)); + addEventListener(UIEventType::RollOver, AX_CALLBACK_1(GComboBox::onRollover, this)); + addEventListener(UIEventType::RollOut, AX_CALLBACK_1(GComboBox::onRollout, this)); + addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GComboBox::onTouchBegin, this)); + addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(GComboBox::onTouchEnd, this)); } void GComboBox::setup_afterAdd(ByteBuffer* buffer, int beginPos) diff --git a/extensions/fairygui/GComponent.cpp b/extensions/fairygui/GComponent.cpp index bbfa0748de..af0bce8028 100644 --- a/extensions/fairygui/GComponent.cpp +++ b/extensions/fairygui/GComponent.cpp @@ -36,10 +36,10 @@ GComponent::~GComponent() _children.clear(); _controllers.clear(); _transitions.clear(); - CC_SAFE_RELEASE(_maskOwner); - CC_SAFE_RELEASE(_container); - CC_SAFE_RELEASE(_scrollPane); - CC_SAFE_DELETE(_hitArea); + AX_SAFE_RELEASE(_maskOwner); + AX_SAFE_RELEASE(_container); + AX_SAFE_RELEASE(_scrollPane); + AX_SAFE_DELETE(_hitArea); CALL_LATER_CANCEL(GComponent, doUpdateBounds); CALL_LATER_CANCEL(GComponent, buildNativeDisplayList); } @@ -580,7 +580,7 @@ void GComponent::setHitArea(IHitTest* value) { if (_hitArea != value) { - CC_SAFE_DELETE(_hitArea); + AX_SAFE_DELETE(_hitArea); _hitArea = value; } } diff --git a/extensions/fairygui/GGraph.cpp b/extensions/fairygui/GGraph.cpp index c0444e0a4f..6dfb917c9c 100644 --- a/extensions/fairygui/GGraph.cpp +++ b/extensions/fairygui/GGraph.cpp @@ -27,9 +27,9 @@ GGraph::GGraph() : _shape(nullptr), GGraph::~GGraph() { - CC_SAFE_DELETE(_cornerRadius); - CC_SAFE_DELETE(_polygonPoints); - CC_SAFE_DELETE(_distances); + AX_SAFE_DELETE(_cornerRadius); + AX_SAFE_DELETE(_polygonPoints); + AX_SAFE_DELETE(_distances); } void GGraph::handleInit() diff --git a/extensions/fairygui/GList.cpp b/extensions/fairygui/GList.cpp index b90db9952f..ab8288e4b9 100644 --- a/extensions/fairygui/GList.cpp +++ b/extensions/fairygui/GList.cpp @@ -189,9 +189,9 @@ GObject* GList::addChildAt(GObject* child, int index) button->setChangeStateOnClick(false); } - child->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GList::onItemTouchBegin, this), EventTag(this)); - child->addClickListener(CC_CALLBACK_1(GList::onClickItem, this), EventTag(this)); - child->addEventListener(UIEventType::RightClick, CC_CALLBACK_1(GList::onClickItem, this), EventTag(this)); + child->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GList::onItemTouchBegin, this), EventTag(this)); + child->addClickListener(AX_CALLBACK_1(GList::onClickItem, this), EventTag(this)); + child->addEventListener(UIEventType::RightClick, AX_CALLBACK_1(GList::onClickItem, this), EventTag(this)); return child; } @@ -1033,7 +1033,7 @@ void GList::setVirtual(bool loop) _scrollPane->_loop = 1; } - addEventListener(UIEventType::Scroll, CC_CALLBACK_1(GList::onScroll, this)); + addEventListener(UIEventType::Scroll, AX_CALLBACK_1(GList::onScroll, this)); setVirtualListChangedFlag(true); } } diff --git a/extensions/fairygui/GLoader.cpp b/extensions/fairygui/GLoader.cpp index db73e20854..cf0a36770b 100644 --- a/extensions/fairygui/GLoader.cpp +++ b/extensions/fairygui/GLoader.cpp @@ -28,9 +28,9 @@ GLoader::GLoader() GLoader::~GLoader() { - CC_SAFE_RELEASE(_playAction); - CC_SAFE_RELEASE(_content); - CC_SAFE_RELEASE(_content2); + AX_SAFE_RELEASE(_playAction); + AX_SAFE_RELEASE(_content); + AX_SAFE_RELEASE(_content2); } void GLoader::handleInit() @@ -321,7 +321,7 @@ void GLoader::clearContent() if (_content2 != nullptr) { _displayObject->removeChild(_content2->displayObject()); - CC_SAFE_RELEASE_NULL(_content2); + AX_SAFE_RELEASE_NULL(_content2); } ((FUISprite*)_content)->clearContent(); diff --git a/extensions/fairygui/GLoader3D.cpp b/extensions/fairygui/GLoader3D.cpp index 03e4ecd8fd..db467d39ab 100644 --- a/extensions/fairygui/GLoader3D.cpp +++ b/extensions/fairygui/GLoader3D.cpp @@ -30,8 +30,8 @@ GLoader3D::GLoader3D() GLoader3D::~GLoader3D() { - CC_SAFE_RELEASE(_content); - CC_SAFE_RELEASE(_container); + AX_SAFE_RELEASE(_content); + AX_SAFE_RELEASE(_container); } void GLoader3D::handleInit() @@ -235,7 +235,7 @@ void GLoader3D::onChangeSpine() if (skeletonAni == nullptr) return; -#if !defined(CC_USE_SPINE_CPP) || CC_USE_SPINE_CPP +#if !defined(AX_USE_SPINE_CPP) || AX_USE_SPINE_CPP spine::AnimationState* state = skeletonAni->getState(); spine::Animation* aniToUse = !_animationName.empty() ? skeletonAni->findAnimation(_animationName) : nullptr; @@ -311,7 +311,7 @@ void GLoader3D::clearContent() if (_content != nullptr) { _container->removeChild(_content); - CC_SAFE_RELEASE_NULL(_content); + AX_SAFE_RELEASE_NULL(_content); } _contentItem = nullptr; diff --git a/extensions/fairygui/GMovieClip.cpp b/extensions/fairygui/GMovieClip.cpp index e3e7f3c7ba..216c925812 100644 --- a/extensions/fairygui/GMovieClip.cpp +++ b/extensions/fairygui/GMovieClip.cpp @@ -18,7 +18,7 @@ GMovieClip::GMovieClip() GMovieClip::~GMovieClip() { - CC_SAFE_RELEASE(_playAction); + AX_SAFE_RELEASE(_playAction); } void GMovieClip::handleInit() @@ -192,7 +192,7 @@ _timeScale(1) ActionMovieClip::~ActionMovieClip() { - CC_SAFE_RELEASE(_animation); + AX_SAFE_RELEASE(_animation); } ActionMovieClip* ActionMovieClip::create(axis::Animation* animation, float repeatDelay, bool swing) @@ -307,7 +307,7 @@ void ActionMovieClip::startWithTarget(Node* target) ActionMovieClip* ActionMovieClip::reverse() const { - CC_ASSERT(0); + AX_ASSERT(0); return nullptr; } @@ -421,8 +421,8 @@ void ActionMovieClip::setAnimation(axis::Animation* animation, float repeatDelay { if (_animation != animation) { - CC_SAFE_RETAIN(animation); - CC_SAFE_RELEASE(_animation); + AX_SAFE_RETAIN(animation); + AX_SAFE_RELEASE(_animation); _animation = animation; } diff --git a/extensions/fairygui/GMovieClip.h b/extensions/fairygui/GMovieClip.h index 5a6d140489..accf88f81c 100644 --- a/extensions/fairygui/GMovieClip.h +++ b/extensions/fairygui/GMovieClip.h @@ -98,7 +98,7 @@ private: int _endAt; int _status; //0-none, 1-next loop, 2-ending, 3-ended - CC_DISALLOW_COPY_AND_ASSIGN(ActionMovieClip); + AX_DISALLOW_COPY_AND_ASSIGN(ActionMovieClip); }; NS_FGUI_END diff --git a/extensions/fairygui/GObject.cpp b/extensions/fairygui/GObject.cpp index b089044ed6..fe598baf86 100644 --- a/extensions/fairygui/GObject.cpp +++ b/extensions/fairygui/GObject.cpp @@ -66,12 +66,12 @@ GObject::~GObject() if (_displayObject) { _displayObject->removeFromParent(); - CC_SAFE_RELEASE(_displayObject); + AX_SAFE_RELEASE(_displayObject); } for (int i = 0; i < 10; i++) - CC_SAFE_DELETE(_gears[i]); - CC_SAFE_DELETE(_relations); - CC_SAFE_DELETE(_dragBounds); + AX_SAFE_DELETE(_gears[i]); + AX_SAFE_DELETE(_relations); + AX_SAFE_DELETE(_dragBounds); if (_weakPtrRef > 0) WeakPtr::markDisposed(this); @@ -85,8 +85,8 @@ bool GObject::init() { _displayObject->setAnchorPoint(Vec2(0, 1)); _displayObject->setCascadeOpacityEnabled(true); - _displayObject->setOnEnterCallback(CC_CALLBACK_0(GObject::onEnter, this)); - _displayObject->setOnExitCallback(CC_CALLBACK_0(GObject::onExit, this)); + _displayObject->setOnEnterCallback(AX_CALLBACK_0(GObject::onEnter, this)); + _displayObject->setOnExitCallback(AX_CALLBACK_0(GObject::onExit, this)); } return true; } @@ -402,8 +402,8 @@ void GObject::setTooltips(const std::string& value) _tooltips = value; if (!_tooltips.empty()) { - addEventListener(UIEventType::RollOver, CC_CALLBACK_1(GObject::onRollOver, this), EventTag(this)); - addEventListener(UIEventType::RollOut, CC_CALLBACK_1(GObject::onRollOut, this), EventTag(this)); + addEventListener(UIEventType::RollOver, AX_CALLBACK_1(GObject::onRollOver, this), EventTag(this)); + addEventListener(UIEventType::RollOut, AX_CALLBACK_1(GObject::onRollOut, this), EventTag(this)); } } @@ -908,9 +908,9 @@ void GObject::initDrag() { if (_draggable) { - addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GObject::onTouchBegin, this), EventTag(this)); - addEventListener(UIEventType::TouchMove, CC_CALLBACK_1(GObject::onTouchMove, this), EventTag(this)); - addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(GObject::onTouchEnd, this), EventTag(this)); + addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GObject::onTouchBegin, this), EventTag(this)); + addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(GObject::onTouchMove, this), EventTag(this)); + addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(GObject::onTouchEnd, this), EventTag(this)); } else { @@ -937,8 +937,8 @@ void GObject::dragBegin(int touchId) _dragTesting = true; UIRoot->getInputProcessor()->addTouchMonitor(touchId, this); - addEventListener(UIEventType::TouchMove, CC_CALLBACK_1(GObject::onTouchMove, this), EventTag(this)); - addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(GObject::onTouchEnd, this), EventTag(this)); + addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(GObject::onTouchMove, this), EventTag(this)); + addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(GObject::onTouchEnd, this), EventTag(this)); } void GObject::dragEnd() @@ -964,7 +964,7 @@ void GObject::onTouchMove(EventContext* context) if (_draggingObject != this && _draggable && _dragTesting) { int sensitivity; -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC sensitivity = UIConfig::clickDragSensitivity; #else sensitivity = UIConfig::touchDragSensitivity; diff --git a/extensions/fairygui/GRoot.cpp b/extensions/fairygui/GRoot.cpp index 4325968dc7..d0da72ab1b 100644 --- a/extensions/fairygui/GRoot.cpp +++ b/extensions/fairygui/GRoot.cpp @@ -43,9 +43,9 @@ GRoot::GRoot() : _windowSizeListener(nullptr), GRoot::~GRoot() { delete _inputProcessor; - CC_SAFE_RELEASE(_modalWaitPane); - CC_SAFE_RELEASE(_defaultTooltipWin); - CC_SAFE_RELEASE(_modalLayer); + AX_SAFE_RELEASE(_modalWaitPane); + AX_SAFE_RELEASE(_defaultTooltipWin); + AX_SAFE_RELEASE(_modalLayer); CALL_LATER_CANCEL(GRoot, doShowTooltipsWin); if (_windowSizeListener) @@ -533,10 +533,10 @@ bool GRoot::initWithScene(axis::Scene* scene, int zOrder) _inst = this; _inputProcessor = new InputProcessor(this); - _inputProcessor->setCaptureCallback(CC_CALLBACK_1(GRoot::onTouchEvent, this)); + _inputProcessor->setCaptureCallback(AX_CALLBACK_1(GRoot::onTouchEvent, this)); -#ifdef CC_PLATFORM_PC - _windowSizeListener = Director::getInstance()->getEventDispatcher()->addCustomEventListener(GLViewImpl::EVENT_WINDOW_RESIZED, CC_CALLBACK_0(GRoot::onWindowSizeChanged, this)); +#ifdef AX_PLATFORM_PC + _windowSizeListener = Director::getInstance()->getEventDispatcher()->addCustomEventListener(GLViewImpl::EVENT_WINDOW_RESIZED, AX_CALLBACK_0(GRoot::onWindowSizeChanged, this)); #endif onWindowSizeChanged(); diff --git a/extensions/fairygui/GScrollBar.cpp b/extensions/fairygui/GScrollBar.cpp index c031e4cc3d..ec15f4bf71 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, CC_CALLBACK_1(GScrollBar::onGripTouchBegin, this)); - _grip->addEventListener(UIEventType::TouchMove, CC_CALLBACK_1(GScrollBar::onGripTouchMove, this)); - _grip->addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(GScrollBar::onGripTouchEnd, this)); + _grip->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GScrollBar::onGripTouchBegin, this)); + _grip->addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(GScrollBar::onGripTouchMove, this)); + _grip->addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(GScrollBar::onGripTouchEnd, this)); - this->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GScrollBar::onTouchBegin, this)); + this->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GScrollBar::onTouchBegin, this)); if (_arrowButton1 != nullptr) - _arrowButton1->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GScrollBar::onArrowButton1Click, this)); + _arrowButton1->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GScrollBar::onArrowButton1Click, this)); if (_arrowButton2 != nullptr) - _arrowButton2->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GScrollBar::onArrowButton2Click, this)); + _arrowButton2->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GScrollBar::onArrowButton2Click, this)); } void GScrollBar::onTouchBegin(EventContext* context) diff --git a/extensions/fairygui/GSlider.cpp b/extensions/fairygui/GSlider.cpp index ceb2831b4b..98688b33de 100644 --- a/extensions/fairygui/GSlider.cpp +++ b/extensions/fairygui/GSlider.cpp @@ -198,11 +198,11 @@ void GSlider::constructExtension(ByteBuffer* buffer) if (_gripObject != nullptr) { - _gripObject->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GSlider::onGripTouchBegin, this)); - _gripObject->addEventListener(UIEventType::TouchMove, CC_CALLBACK_1(GSlider::onGripTouchMove, this)); + _gripObject->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GSlider::onGripTouchBegin, this)); + _gripObject->addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(GSlider::onGripTouchMove, this)); } - addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GSlider::onTouchBegin, this)); + addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GSlider::onTouchBegin, this)); } void GSlider::setup_afterAdd(ByteBuffer* buffer, int beginPos) diff --git a/extensions/fairygui/GTextField.cpp b/extensions/fairygui/GTextField.cpp index f8124d4566..f518400f9d 100644 --- a/extensions/fairygui/GTextField.cpp +++ b/extensions/fairygui/GTextField.cpp @@ -14,7 +14,7 @@ GTextField::GTextField() GTextField::~GTextField() { - CC_SAFE_DELETE(_templateVars); + AX_SAFE_DELETE(_templateVars); } void GTextField::setText(const std::string& value) @@ -71,7 +71,7 @@ void GTextField::setTemplateVars(axis::ValueMap* value) return; if (value == nullptr) - CC_SAFE_DELETE(_templateVars); + AX_SAFE_DELETE(_templateVars); else { if (_templateVars == nullptr) diff --git a/extensions/fairygui/GTree.cpp b/extensions/fairygui/GTree.cpp index 3d9ef86338..0f86d57d8e 100644 --- a/extensions/fairygui/GTree.cpp +++ b/extensions/fairygui/GTree.cpp @@ -16,7 +16,7 @@ GTree::GTree() GTree::~GTree() { - CC_SAFE_RELEASE(_rootNode); + AX_SAFE_RELEASE(_rootNode); } void GTree::handleInit() @@ -96,9 +96,9 @@ void GTree::createCell(GTreeNode* node) child->_treeNode = node; if (node->_cell != child) { - CC_SAFE_RELEASE(node->_cell); + AX_SAFE_RELEASE(node->_cell); node->_cell = child; - CC_SAFE_RETAIN(node->_cell); + AX_SAFE_RETAIN(node->_cell); } GObject* indentObj = node->_cell->getChild("indent"); @@ -110,7 +110,7 @@ void GTree::createCell(GTreeNode* node) cc = child->getController("expanded"); if (cc != nullptr) { - cc->addEventListener(UIEventType::Changed, CC_CALLBACK_1(GTree::onExpandedStateChanged, this)); + cc->addEventListener(UIEventType::Changed, AX_CALLBACK_1(GTree::onExpandedStateChanged, this)); cc->setSelectedIndex(node->isExpanded() ? 1 : 0); } @@ -119,7 +119,7 @@ void GTree::createCell(GTreeNode* node) cc->setSelectedIndex(node->isFolder() ? 0 : 1); if (node->isFolder()) - child->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(GTree::onCellTouchBegin, this)); + child->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(GTree::onCellTouchBegin, this)); if (treeNodeRender != nullptr) treeNodeRender(node, child); diff --git a/extensions/fairygui/GTreeNode.cpp b/extensions/fairygui/GTreeNode.cpp index 6cb12933f4..ddf015db10 100644 --- a/extensions/fairygui/GTreeNode.cpp +++ b/extensions/fairygui/GTreeNode.cpp @@ -15,7 +15,7 @@ GTreeNode* GTreeNode::create(bool isFolder, const std::string& resURL) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -41,7 +41,7 @@ GTreeNode::~GTreeNode() if (_parent) _parent->removeChild(this); - CC_SAFE_RELEASE(_cell); + AX_SAFE_RELEASE(_cell); } bool GTreeNode::init(bool isFolder, const std::string& resURL) diff --git a/extensions/fairygui/PackageItem.cpp b/extensions/fairygui/PackageItem.cpp index 5d2e53a0dd..f594d3d699 100644 --- a/extensions/fairygui/PackageItem.cpp +++ b/extensions/fairygui/PackageItem.cpp @@ -29,18 +29,18 @@ PackageItem::PackageItem() : owner(nullptr), PackageItem::~PackageItem() { - CC_SAFE_DELETE(scale9Grid); + AX_SAFE_DELETE(scale9Grid); - CC_SAFE_DELETE(rawData); + AX_SAFE_DELETE(rawData); if (bitmapFont) //bitmapfont will be released by fontatlas bitmapFont->releaseAtlas(); bitmapFont = nullptr; - CC_SAFE_RELEASE(animation); - CC_SAFE_RELEASE(texture); - CC_SAFE_RELEASE(spriteFrame); + AX_SAFE_RELEASE(animation); + AX_SAFE_RELEASE(texture); + AX_SAFE_RELEASE(spriteFrame); - CC_SAFE_DELETE(branches); - CC_SAFE_DELETE(highResolution); + AX_SAFE_DELETE(branches); + AX_SAFE_DELETE(highResolution); } void PackageItem::load() diff --git a/extensions/fairygui/PopupMenu.cpp b/extensions/fairygui/PopupMenu.cpp index 9f08af23a4..30d45b4c7a 100644 --- a/extensions/fairygui/PopupMenu.cpp +++ b/extensions/fairygui/PopupMenu.cpp @@ -32,7 +32,7 @@ PopupMenu::PopupMenu() : PopupMenu::~PopupMenu() { - CC_SAFE_RELEASE(_contentPane); + AX_SAFE_RELEASE(_contentPane); } bool PopupMenu::init(const std::string & resourceURL) @@ -50,7 +50,7 @@ bool PopupMenu::init(const std::string & resourceURL) _contentPane = UIPackage::createObjectFromURL(url)->as(); _contentPane->retain(); - _contentPane->addEventListener(UIEventType::Enter, CC_CALLBACK_1(PopupMenu::onEnter, this)); + _contentPane->addEventListener(UIEventType::Enter, AX_CALLBACK_1(PopupMenu::onEnter, this)); _list = _contentPane->getChild("list")->as(); _list->removeChildrenToPool(); @@ -59,7 +59,7 @@ bool PopupMenu::init(const std::string & resourceURL) _list->removeRelation(_contentPane, RelationType::Height); _contentPane->addRelation(_list, RelationType::Height); - _list->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(PopupMenu::onClickItem, this)); + _list->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(PopupMenu::onClickItem, this)); return true; } diff --git a/extensions/fairygui/RelationItem.cpp b/extensions/fairygui/RelationItem.cpp index c0357c24a2..c0274b5889 100644 --- a/extensions/fairygui/RelationItem.cpp +++ b/extensions/fairygui/RelationItem.cpp @@ -544,8 +544,8 @@ void RelationItem::addRefTarget(GObject* target) return; if (target != _owner->_parent) - target->addEventListener(UIEventType::PositionChange, CC_CALLBACK_1(RelationItem::onTargetXYChanged, this), EventTag(this)); - target->addEventListener(UIEventType::SizeChange, CC_CALLBACK_1(RelationItem::onTargetSizeChanged, this), EventTag(this)); + target->addEventListener(UIEventType::PositionChange, AX_CALLBACK_1(RelationItem::onTargetXYChanged, this), EventTag(this)); + target->addEventListener(UIEventType::SizeChange, AX_CALLBACK_1(RelationItem::onTargetSizeChanged, this), EventTag(this)); _targetData.x = target->_position.x; _targetData.y = target->_position.y; diff --git a/extensions/fairygui/ScrollPane.cpp b/extensions/fairygui/ScrollPane.cpp index 29768e2867..4faa914db0 100644 --- a/extensions/fairygui/ScrollPane.cpp +++ b/extensions/fairygui/ScrollPane.cpp @@ -79,10 +79,10 @@ ScrollPane::ScrollPane(GComponent* owner) _container->removeFromParent(); _maskContainer->addChild(_container, 1); - _owner->addEventListener(UIEventType::MouseWheel, CC_CALLBACK_1(ScrollPane::onMouseWheel, this)); - _owner->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(ScrollPane::onTouchBegin, this)); - _owner->addEventListener(UIEventType::TouchMove, CC_CALLBACK_1(ScrollPane::onTouchMove, this)); - _owner->addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(ScrollPane::onTouchEnd, this)); + _owner->addEventListener(UIEventType::MouseWheel, AX_CALLBACK_1(ScrollPane::onMouseWheel, this)); + _owner->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(ScrollPane::onTouchBegin, this)); + _owner->addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(ScrollPane::onTouchMove, this)); + _owner->addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(ScrollPane::onTouchEnd, this)); _owner->addEventListener(UIEventType::Exit, [this](EventContext*) { if (_draggingPane == this) _draggingPane = nullptr; @@ -146,7 +146,7 @@ void ScrollPane::setup(ByteBuffer* buffer) if (scrollBarDisplay == ScrollBarDisplayType::DEFAULT) { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC scrollBarDisplay = UIConfig::defaultScrollBarDisplay; #else scrollBarDisplay = ScrollBarDisplayType::AUTO; @@ -198,8 +198,8 @@ void ScrollPane::setup(ByteBuffer* buffer) if (_hzScrollBar != nullptr) _hzScrollBar->setVisible(false); - _owner->addEventListener(UIEventType::RollOver, CC_CALLBACK_1(ScrollPane::onRollOver, this)); - _owner->addEventListener(UIEventType::RollOut, CC_CALLBACK_1(ScrollPane::onRollOut, this)); + _owner->addEventListener(UIEventType::RollOver, AX_CALLBACK_1(ScrollPane::onRollOver, this)); + _owner->addEventListener(UIEventType::RollOut, AX_CALLBACK_1(ScrollPane::onRollOut, this)); } } else @@ -994,7 +994,7 @@ void ScrollPane::updateScrollBarVisible2(GScrollBar* bar) if (bar->isVisible()) GTween::to(1, 0, 0.5f) ->setDelay(0.5f) - ->onComplete1(CC_CALLBACK_1(ScrollPane::onBarTweenComplete, this)) + ->onComplete1(AX_CALLBACK_1(ScrollPane::onBarTweenComplete, this)) ->setTarget(bar, TweenPropType::Alpha); } else @@ -1221,7 +1221,7 @@ float ScrollPane::updateTargetAndDuration(float pos, int axis) { float v2 = std::abs(v) * _velocityScale; float ratio = 0; -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC if (v2 > 500) ratio = pow((v2 - 500) / 500, 2); #else @@ -1492,7 +1492,7 @@ void ScrollPane::onTouchMove(EventContext* context) Vec2 pt = _owner->globalToLocal(evt->getPosition()); int sensitivity; -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC sensitivity = 8; #else sensitivity = UIConfig::touchScrollSensitivity; diff --git a/extensions/fairygui/Transition.cpp b/extensions/fairygui/Transition.cpp index aa22215732..7b43fa232b 100644 --- a/extensions/fairygui/Transition.cpp +++ b/extensions/fairygui/Transition.cpp @@ -158,9 +158,9 @@ TweenConfig::TweenConfig() TweenConfig::~TweenConfig() { - CC_SAFE_DELETE(path); - CC_SAFE_DELETE(startValue); - CC_SAFE_DELETE(endValue); + AX_SAFE_DELETE(path); + AX_SAFE_DELETE(startValue); + AX_SAFE_DELETE(endValue); } class TransitionItem @@ -253,7 +253,7 @@ TransitionItem::~TransitionItem() delete tweenConfig; } - CC_SAFE_DELETE(value); + AX_SAFE_DELETE(value); } Transition::Transition(GComponent* owner) @@ -378,7 +378,7 @@ void Transition::play(int times, float delay, float startTime, float endTime, Pl if (delay == 0) onDelayedPlay(); else - GTween::delayedCall(delay)->setTarget(this)->onComplete(CC_CALLBACK_0(Transition::onDelayedPlay, this)); + GTween::delayedCall(delay)->setTarget(this)->onComplete(AX_CALLBACK_0(Transition::onDelayedPlay, this)); } void Transition::changePlayTimes(int value) @@ -867,9 +867,9 @@ void Transition::playItem(TransitionItem* item) ->setRepeat(item->tweenConfig->repeat, item->tweenConfig->yoyo) ->setTimeScale(_timeScale) ->setTargetAny(item) - ->onStart(CC_CALLBACK_1(Transition::onTweenStart, this)) - ->onUpdate(CC_CALLBACK_1(Transition::onTweenUpdate, this)) - ->onComplete1(CC_CALLBACK_1(Transition::onTweenComplete, this)); + ->onStart(AX_CALLBACK_1(Transition::onTweenStart, this)) + ->onUpdate(AX_CALLBACK_1(Transition::onTweenUpdate, this)) + ->onComplete1(AX_CALLBACK_1(Transition::onTweenComplete, this)); if (_endTime >= 0) item->tweener->setBreakpoint(_endTime - time); @@ -894,9 +894,9 @@ void Transition::playItem(TransitionItem* item) ->setDelay(time) ->setTimeScale(_timeScale) ->setTargetAny(item) - ->onStart(CC_CALLBACK_1(Transition::onTweenStart, this)) - ->onUpdate(CC_CALLBACK_1(Transition::onTweenUpdate, this)) - ->onComplete1(CC_CALLBACK_1(Transition::onTweenComplete, this)); + ->onStart(AX_CALLBACK_1(Transition::onTweenStart, this)) + ->onUpdate(AX_CALLBACK_1(Transition::onTweenUpdate, this)) + ->onComplete1(AX_CALLBACK_1(Transition::onTweenComplete, this)); if (_endTime >= 0) item->tweener->setBreakpoint(_endTime - item->time); @@ -922,7 +922,7 @@ void Transition::playItem(TransitionItem* item) item->tweener = GTween::delayedCall(time) ->setTimeScale(_timeScale) ->setTargetAny(item) - ->onComplete1(CC_CALLBACK_1(Transition::onDelayedPlayItem, this)); + ->onComplete1(AX_CALLBACK_1(Transition::onDelayedPlayItem, this)); } } diff --git a/extensions/fairygui/UIPackage.cpp b/extensions/fairygui/UIPackage.cpp index c5b5b3aa33..3e7baf60b6 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 = CC_SIZE_PIXELS_TO_POINTS(mcSizeInPixels); + Size mcSize = AX_SIZE_PIXELS_TO_POINTS(mcSizeInPixels); AtlasSprite* sprite; SpriteFrame* spriteFrame; @@ -821,7 +821,7 @@ void UIPackage::loadFont(PackageItem* item) if (ttf) { Rect tempRect = Rect(bx + mainSprite->rect.origin.x, by + mainSprite->rect.origin.y, bw, bh); - tempRect = CC_RECT_PIXELS_TO_POINTS(tempRect); + tempRect = AX_RECT_PIXELS_TO_POINTS(tempRect); def.U = tempRect.origin.x; def.V = tempRect.origin.y; def.width = tempRect.size.width; @@ -848,7 +848,7 @@ void UIPackage::loadFont(PackageItem* item) getItemAsset(charImg); Rect tempRect = charImg->spriteFrame->getRectInPixels(); - tempRect = CC_RECT_PIXELS_TO_POINTS(tempRect); + tempRect = AX_RECT_PIXELS_TO_POINTS(tempRect); def.U = tempRect.origin.x; def.V = tempRect.origin.y; def.width = tempRect.size.width; diff --git a/extensions/fairygui/Window.cpp b/extensions/fairygui/Window.cpp index d62a0e921e..0ef2b3b9fd 100644 --- a/extensions/fairygui/Window.cpp +++ b/extensions/fairygui/Window.cpp @@ -23,18 +23,18 @@ Window::Window() : Window::~Window() { - CC_SAFE_RELEASE(_contentPane); - CC_SAFE_RELEASE(_frame); - CC_SAFE_RELEASE(_closeButton); - CC_SAFE_RELEASE(_dragArea); - CC_SAFE_RELEASE(_modalWaitPane); + AX_SAFE_RELEASE(_contentPane); + AX_SAFE_RELEASE(_frame); + AX_SAFE_RELEASE(_closeButton); + AX_SAFE_RELEASE(_dragArea); + AX_SAFE_RELEASE(_modalWaitPane); } void Window::handleInit() { GComponent::handleInit(); - addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(Window::onTouchBegin, this)); + addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(Window::onTouchBegin, this)); } void Window::setContentPane(GComponent* value) @@ -45,7 +45,7 @@ void Window::setContentPane(GComponent* value) { removeChild(_contentPane); - CC_SAFE_RELEASE(_frame); + AX_SAFE_RELEASE(_frame); _contentPane->release(); } _contentPane = value; @@ -82,7 +82,7 @@ void Window::setCloseButton(GObject * value) if (_closeButton != nullptr) { _closeButton->retain(); - _closeButton->addClickListener(CC_CALLBACK_1(Window::closeEventHandler, this), EventTag(this)); + _closeButton->addClickListener(AX_CALLBACK_1(Window::closeEventHandler, this), EventTag(this)); } } @@ -104,7 +104,7 @@ void Window::setDragArea(GObject * value) if (dynamic_cast(_dragArea) && ((GGraph*)_dragArea)->isEmpty()) ((GGraph*)_dragArea)->drawRect(_dragArea->getWidth(), _dragArea->getHeight(), 0, Color4F(0, 0, 0, 0), Color4F(0, 0, 0, 0)); _dragArea->setDraggable(true); - _dragArea->addEventListener(UIEventType::DragStart, CC_CALLBACK_1(Window::onDragStart, this), EventTag(this)); + _dragArea->addEventListener(UIEventType::DragStart, AX_CALLBACK_1(Window::onDragStart, this), EventTag(this)); } } } @@ -204,7 +204,7 @@ void Window::initWindow() IUISource* lib = _uiSources.at(i); if (!lib->isLoaded()) { - lib->load(CC_CALLBACK_0(Window::onUILoadComplete, this)); + lib->load(AX_CALLBACK_0(Window::onUILoadComplete, this)); _loading = true; } } diff --git a/extensions/fairygui/display/BitmapFont.h b/extensions/fairygui/display/BitmapFont.h index 478d5eff57..e6aff965ce 100644 --- a/extensions/fairygui/display/BitmapFont.h +++ b/extensions/fairygui/display/BitmapFont.h @@ -25,7 +25,7 @@ public: { if (_fontAtlas != fontAtlas) { - CC_SAFE_RELEASE(_fontAtlas); + AX_SAFE_RELEASE(_fontAtlas); _fontAtlas = fontAtlas; } return _fontAtlas; diff --git a/extensions/fairygui/display/FUIContainer.cpp b/extensions/fairygui/display/FUIContainer.cpp index 7d0b8a244d..35555e7671 100644 --- a/extensions/fairygui/display/FUIContainer.cpp +++ b/extensions/fairygui/display/FUIContainer.cpp @@ -7,13 +7,13 @@ NS_FGUI_BEGIN USING_NS_AX; #if COCOS2D_VERSION < 0x00040000 -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) -#define CC_CLIPPING_NODE_OPENGLES 0 +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) +#define AX_CLIPPING_NODE_OPENGLES 0 #else -#define CC_CLIPPING_NODE_OPENGLES 1 +#define AX_CLIPPING_NODE_OPENGLES 1 #endif -#if CC_CLIPPING_NODE_OPENGLES +#if AX_CLIPPING_NODE_OPENGLES static void setProgram(Node *n, GLProgram *p) { n->setGLProgram(p); @@ -49,7 +49,7 @@ FUIContainer::FUIContainer() : FUIContainer::~FUIContainer() { - CC_SAFE_DELETE(_rectClippingSupport); + AX_SAFE_DELETE(_rectClippingSupport); if (_stencilClippingSupport) { if (_stencilClippingSupport->_stencil) @@ -57,7 +57,7 @@ FUIContainer::~FUIContainer() _stencilClippingSupport->_stencil->stopAllActions(); _stencilClippingSupport->_stencil->release(); } - CC_SAFE_DELETE(_stencilClippingSupport->_stencilStateManager); + AX_SAFE_DELETE(_stencilClippingSupport->_stencilStateManager); delete _stencilClippingSupport; } } @@ -121,7 +121,7 @@ void FUIContainer::setStencil(axis::Node * stencil) if (_stencilClippingSupport->_stencil == stencil) return; -#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) { @@ -130,7 +130,7 @@ void FUIContainer::setStencil(axis::Node * stencil) if (stencil) sEngine->retainScriptObject(this, stencil); } -#endif // CC_ENABLE_GC_FOR_NATIVE_OBJECTS +#endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS //cleanup current stencil if (_stencilClippingSupport->_stencil != nullptr && _stencilClippingSupport->_stencil->isRunning()) @@ -138,11 +138,11 @@ void FUIContainer::setStencil(axis::Node * stencil) _stencilClippingSupport->_stencil->onExitTransitionDidStart(); _stencilClippingSupport->_stencil->onExit(); } - CC_SAFE_RELEASE_NULL(_stencilClippingSupport->_stencil); + AX_SAFE_RELEASE_NULL(_stencilClippingSupport->_stencil); //initialise new stencil _stencilClippingSupport->_stencil = stencil; - CC_SAFE_RETAIN(_stencilClippingSupport->_stencil); + AX_SAFE_RETAIN(_stencilClippingSupport->_stencil); if (_stencilClippingSupport->_stencil != nullptr && this->isRunning()) { _stencilClippingSupport->_stencil->onEnter(); @@ -180,7 +180,7 @@ void FUIContainer::setAlphaThreshold(float alphaThreshold) } } #else -#if CC_CLIPPING_NODE_OPENGLES +#if AX_CLIPPING_NODE_OPENGLES if (alphaThreshold == 1 && alphaThreshold != _stencilClippingSupport->_stencilStateManager->getAlphaThreshold()) { // should reset program used by _stencil @@ -211,7 +211,7 @@ void FUIContainer::setInverted(bool inverted) void FUIContainer::onEnter() { -#if CC_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 if (_scriptType == kScriptTypeJavascript) { if (ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnEnter)) @@ -230,7 +230,7 @@ void FUIContainer::onEnter() void FUIContainer::onEnterTransitionDidFinish() { -#if CC_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 if (_scriptType == kScriptTypeJavascript) { if (ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnEnterTransitionDidFinish)) @@ -248,7 +248,7 @@ void FUIContainer::onEnterTransitionDidFinish() void FUIContainer::onExitTransitionDidStart() { -#if CC_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 if (_scriptType == kScriptTypeJavascript) { if (ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnExitTransitionDidStart)) @@ -263,7 +263,7 @@ void FUIContainer::onExitTransitionDidStart() void FUIContainer::onExit() { -#if CC_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 if (_scriptType == kScriptTypeJavascript) { if (ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnExit)) @@ -396,7 +396,7 @@ void FUIContainer::visit(axis::Renderer * renderer, const axis::Mat4 & parentTra _stencilClippingSupport->_stencilStateManager->onBeforeVisit(_globalZOrder); #else _stencilClippingSupport->_beforeVisitCmd.init(_globalZOrder); - _stencilClippingSupport->_beforeVisitCmd.func = CC_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilClippingSupport->_stencilStateManager); + _stencilClippingSupport->_beforeVisitCmd.func = AX_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilClippingSupport->_stencilStateManager); renderer->addCommand(&_stencilClippingSupport->_beforeVisitCmd); #endif @@ -409,9 +409,9 @@ void FUIContainer::visit(axis::Renderer * renderer, const axis::Mat4 & parentTra auto alphaLocation = programState->getUniformLocation("u_alpha_value"); programState->setUniform(alphaLocation, &alphaThreshold, sizeof(alphaThreshold)); setProgramStateRecursively(_stencilClippingSupport->_stencil, programState); - CC_SAFE_RELEASE_NULL(programState); + AX_SAFE_RELEASE_NULL(programState); #else -#if CC_CLIPPING_NODE_OPENGLES +#if AX_CLIPPING_NODE_OPENGLES // since glAlphaTest do not exists in OES, use a shader that writes // pixel only if greater than an alpha threshold GLProgram *program = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST_NO_MV); @@ -430,7 +430,7 @@ void FUIContainer::visit(axis::Renderer * renderer, const axis::Mat4 & parentTra auto afterDrawStencilCmd = renderer->nextCallbackCommand(); afterDrawStencilCmd->init(_globalZOrder); - afterDrawStencilCmd->func = CC_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilClippingSupport->_stencilStateManager); + afterDrawStencilCmd->func = AX_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilClippingSupport->_stencilStateManager); renderer->addCommand(afterDrawStencilCmd); int i = 0; @@ -463,7 +463,7 @@ void FUIContainer::visit(axis::Renderer * renderer, const axis::Mat4 & parentTra auto afterVisitCmd = renderer->nextCallbackCommand(); afterVisitCmd->init(_globalZOrder); - afterVisitCmd->func = CC_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilClippingSupport->_stencilStateManager); + afterVisitCmd->func = AX_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilClippingSupport->_stencilStateManager); renderer->addCommand(afterVisitCmd); renderer->popGroup(); @@ -483,14 +483,14 @@ void FUIContainer::visit(axis::Renderer * renderer, const axis::Mat4 & parentTra #endif auto beforeVisitCmdScissor = renderer->nextCallbackCommand(); beforeVisitCmdScissor->init(_globalZOrder); - beforeVisitCmdScissor->func = CC_CALLBACK_0(FUIContainer::onBeforeVisitScissor, this); + beforeVisitCmdScissor->func = AX_CALLBACK_0(FUIContainer::onBeforeVisitScissor, this); renderer->addCommand(beforeVisitCmdScissor); Node::visit(renderer, parentTransform, parentFlags); auto afterVisitCmdScissor = renderer->nextCallbackCommand(); afterVisitCmdScissor->init(_globalZOrder); - afterVisitCmdScissor->func = CC_CALLBACK_0(FUIContainer::onAfterVisitScissor, this); + afterVisitCmdScissor->func = AX_CALLBACK_0(FUIContainer::onAfterVisitScissor, this); renderer->addCommand(afterVisitCmdScissor); #if COCOS2D_VERSION >= 0x00040000 renderer->popGroup(); diff --git a/extensions/fairygui/display/FUIInput.cpp b/extensions/fairygui/display/FUIInput.cpp index 33a4f13e9e..278fce0767 100644 --- a/extensions/fairygui/display/FUIInput.cpp +++ b/extensions/fairygui/display/FUIInput.cpp @@ -17,7 +17,7 @@ FUIInput * FUIInput::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -91,7 +91,7 @@ void FUIInput::continueInit() //disable default behavior this->setTouchEnabled(false); - this->addTouchEventListener(CC_CALLBACK_2(FUIInput::_touchDownAction, this)); + this->addTouchEventListener(AX_CALLBACK_2(FUIInput::_touchDownAction, this)); } void FUIInput::_touchDownAction(axis::Ref *sender, axis::ui::Widget::TouchEventType controlEvent) diff --git a/extensions/fairygui/display/FUILabel.cpp b/extensions/fairygui/display/FUILabel.cpp index 6545e111d1..9786cf65dd 100644 --- a/extensions/fairygui/display/FUILabel.cpp +++ b/extensions/fairygui/display/FUILabel.cpp @@ -131,7 +131,7 @@ bool FUILabel::setBMFontFilePath(std::string_view bmfontFilePath, const Vec2& im if (std::abs(fontSize) < FLT_EPSILON) { float originalFontSize = bmFont->getOriginalFontSize(); - _bmFontSize = originalFontSize / CC_CONTENT_SCALE_FACTOR(); + _bmFontSize = originalFontSize / AX_CONTENT_SCALE_FACTOR(); } if (fontSize > 0.0f && bmFont->isResizable()) @@ -174,7 +174,7 @@ void FUILabel::updateBMFontScale() { BitmapFont* bmFont = (BitmapFont*)font; float originalFontSize = bmFont->getOriginalFontSize(); - _bmfontScale = _bmFontSize * CC_CONTENT_SCALE_FACTOR() / originalFontSize; + _bmfontScale = _bmFontSize * AX_CONTENT_SCALE_FACTOR() / originalFontSize; } else { diff --git a/extensions/fairygui/display/FUIRichText.cpp b/extensions/fairygui/display/FUIRichText.cpp index 762a6386bb..200d081c0f 100644 --- a/extensions/fairygui/display/FUIRichText.cpp +++ b/extensions/fairygui/display/FUIRichText.cpp @@ -15,7 +15,7 @@ USING_NS_AX; using namespace std; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_WINRT) #define strcasecmp _stricmp #endif diff --git a/extensions/fairygui/display/FUISprite.cpp b/extensions/fairygui/display/FUISprite.cpp index 57ec625ed2..39b0aa6739 100644 --- a/extensions/fairygui/display/FUISprite.cpp +++ b/extensions/fairygui/display/FUISprite.cpp @@ -23,14 +23,14 @@ FUISprite::FUISprite() FUISprite::~FUISprite() { - CC_SAFE_FREE(_vertexData); - CC_SAFE_FREE(_vertexIndex); + AX_SAFE_FREE(_vertexData); + AX_SAFE_FREE(_vertexIndex); } void FUISprite::clearContent() { setTexture(nullptr); - CC_SAFE_RELEASE_NULL(_spriteFrame); + AX_SAFE_RELEASE_NULL(_spriteFrame); setCenterRectNormalized(Rect(0, 0, 1, 1)); _empty = _texture; @@ -130,8 +130,8 @@ void FUISprite::setFillMethod(FillMethod value) setupFill(); else { - CC_SAFE_FREE(_vertexData); - CC_SAFE_FREE(_vertexIndex); + AX_SAFE_FREE(_vertexData); + AX_SAFE_FREE(_vertexIndex); } } } @@ -335,8 +335,8 @@ void FUISprite::updateRadial(void) if (_vertexDataCount != index + 3) { sameIndexCount = false; - CC_SAFE_FREE(_vertexData); - CC_SAFE_FREE(_vertexIndex); + AX_SAFE_FREE(_vertexData); + AX_SAFE_FREE(_vertexIndex); _vertexDataCount = 0; } @@ -497,7 +497,7 @@ void FUISprite::draw(axis::Renderer* renderer, const axis::Mat4& transform, uint setMVPMatrixUniform(); #endif -#if CC_USE_CULLING +#if AX_USE_CULLING // Don't calculate the culling if the transform was not updated auto visitingCamera = Camera::getVisitingCamera(); auto defaultCamera = Camera::getDefaultCamera(); diff --git a/extensions/fairygui/event/HitTest.cpp b/extensions/fairygui/event/HitTest.cpp index 44dc5b4ede..82eba39d77 100644 --- a/extensions/fairygui/event/HitTest.cpp +++ b/extensions/fairygui/event/HitTest.cpp @@ -15,7 +15,7 @@ PixelHitTestData::PixelHitTestData() : PixelHitTestData::~PixelHitTestData() { - CC_SAFE_DELETE(pixels); + AX_SAFE_DELETE(pixels); } void PixelHitTestData::load(ByteBuffer* buffer) diff --git a/extensions/fairygui/event/InputProcessor.cpp b/extensions/fairygui/event/InputProcessor.cpp index d002656a03..809446057f 100644 --- a/extensions/fairygui/event/InputProcessor.cpp +++ b/extensions/fairygui/event/InputProcessor.cpp @@ -45,42 +45,42 @@ InputProcessor::InputProcessor(GComponent* owner) : _owner = owner; _recentInput._inputProcessor = this; -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC _mouseListener = EventListenerMouse::create(); - CC_SAFE_RETAIN(_mouseListener); - _mouseListener->onMouseDown = CC_CALLBACK_1(InputProcessor::onMouseDown, this); - _mouseListener->onMouseUp = CC_CALLBACK_1(InputProcessor::onMouseUp, this); - _mouseListener->onMouseMove = CC_CALLBACK_1(InputProcessor::onMouseMove, this); - _mouseListener->onMouseScroll = CC_CALLBACK_1(InputProcessor::onMouseScroll, this); + AX_SAFE_RETAIN(_mouseListener); + _mouseListener->onMouseDown = AX_CALLBACK_1(InputProcessor::onMouseDown, this); + _mouseListener->onMouseUp = AX_CALLBACK_1(InputProcessor::onMouseUp, this); + _mouseListener->onMouseMove = AX_CALLBACK_1(InputProcessor::onMouseMove, this); + _mouseListener->onMouseScroll = AX_CALLBACK_1(InputProcessor::onMouseScroll, this); _owner->displayObject()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(_mouseListener, _owner->displayObject()); #endif _touchListener = EventListenerTouchOneByOne::create(); - CC_SAFE_RETAIN(_touchListener); + AX_SAFE_RETAIN(_touchListener); _touchListener->setSwallowTouches(false); - _touchListener->onTouchBegan = CC_CALLBACK_2(InputProcessor::onTouchBegan, this); - _touchListener->onTouchMoved = CC_CALLBACK_2(InputProcessor::onTouchMoved, this); - _touchListener->onTouchEnded = CC_CALLBACK_2(InputProcessor::onTouchEnded, this); - _touchListener->onTouchCancelled = CC_CALLBACK_2(InputProcessor::onTouchCancelled, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(InputProcessor::onTouchBegan, this); + _touchListener->onTouchMoved = AX_CALLBACK_2(InputProcessor::onTouchMoved, this); + _touchListener->onTouchEnded = AX_CALLBACK_2(InputProcessor::onTouchEnded, this); + _touchListener->onTouchCancelled = AX_CALLBACK_2(InputProcessor::onTouchCancelled, this); _owner->displayObject()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(_touchListener, _owner->displayObject()); _keyboardListener = EventListenerKeyboard::create(); - CC_SAFE_RETAIN(_keyboardListener); - _keyboardListener->onKeyPressed = CC_CALLBACK_2(InputProcessor::onKeyDown, this); - _keyboardListener->onKeyReleased = CC_CALLBACK_2(InputProcessor::onKeyUp, this); + AX_SAFE_RETAIN(_keyboardListener); + _keyboardListener->onKeyPressed = AX_CALLBACK_2(InputProcessor::onKeyDown, this); + _keyboardListener->onKeyReleased = AX_CALLBACK_2(InputProcessor::onKeyUp, this); _owner->displayObject()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(_keyboardListener, _owner->displayObject()); } InputProcessor::~InputProcessor() { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC _owner->displayObject()->getEventDispatcher()->removeEventListener(_mouseListener); #endif _owner->displayObject()->getEventDispatcher()->removeEventListener(_touchListener); _owner->displayObject()->getEventDispatcher()->removeEventListener(_keyboardListener); - CC_SAFE_RELEASE_NULL(_touchListener); - CC_SAFE_RELEASE_NULL(_mouseListener); - CC_SAFE_RELEASE_NULL(_keyboardListener); + AX_SAFE_RELEASE_NULL(_touchListener); + AX_SAFE_RELEASE_NULL(_mouseListener); + AX_SAFE_RELEASE_NULL(_keyboardListener); for (auto &ti : _touches) delete ti; @@ -475,7 +475,7 @@ void InputProcessor::onTouchEnded(Touch *touch, Event* /*unusedEvent*/) target = wptr.ptr(); } -#ifndef CC_PLATFORM_PC +#ifndef AX_PLATFORM_PC //on mobile platform, trigger RollOut on up event, but not on PC handleRollOver(ti, nullptr); #else diff --git a/extensions/fairygui/gears/GearBase.cpp b/extensions/fairygui/gears/GearBase.cpp index 6fe7386f85..f56a35be06 100644 --- a/extensions/fairygui/gears/GearBase.cpp +++ b/extensions/fairygui/gears/GearBase.cpp @@ -76,7 +76,7 @@ GearBase::~GearBase() { if (_tweenConfig && _tweenConfig->_tweener) _tweenConfig->_tweener->kill(); - CC_SAFE_DELETE(_tweenConfig); + AX_SAFE_DELETE(_tweenConfig); } void GearBase::setController(GController* value) diff --git a/extensions/fairygui/gears/GearColor.cpp b/extensions/fairygui/gears/GearColor.cpp index 6afaa3f9a3..e238ce5629 100644 --- a/extensions/fairygui/gears/GearColor.cpp +++ b/extensions/fairygui/gears/GearColor.cpp @@ -86,8 +86,8 @@ void GearColor::apply() ->setDelay(_tweenConfig->delay) ->setEase(_tweenConfig->easeType) ->setTargetAny(this) - ->onUpdate(CC_CALLBACK_1(GearColor::onTweenUpdate, this)) - ->onComplete(CC_CALLBACK_0(GearColor::onTweenComplete, this)); + ->onUpdate(AX_CALLBACK_1(GearColor::onTweenUpdate, this)) + ->onComplete(AX_CALLBACK_0(GearColor::onTweenComplete, this)); } } else diff --git a/extensions/fairygui/gears/GearLook.cpp b/extensions/fairygui/gears/GearLook.cpp index 472d1de754..369c8204b4 100644 --- a/extensions/fairygui/gears/GearLook.cpp +++ b/extensions/fairygui/gears/GearLook.cpp @@ -87,8 +87,8 @@ void GearLook::apply() ->setEase(_tweenConfig->easeType) ->setTargetAny(this) ->setUserData(Value((a ? 1 : 0) + (b ? 2 : 0))) - ->onUpdate(CC_CALLBACK_1(GearLook::onTweenUpdate, this)) - ->onComplete(CC_CALLBACK_0(GearLook::onTweenComplete, this)); + ->onUpdate(AX_CALLBACK_1(GearLook::onTweenUpdate, this)) + ->onComplete(AX_CALLBACK_0(GearLook::onTweenComplete, this)); } } else diff --git a/extensions/fairygui/gears/GearSize.cpp b/extensions/fairygui/gears/GearSize.cpp index 6f99a371c8..0770938eff 100644 --- a/extensions/fairygui/gears/GearSize.cpp +++ b/extensions/fairygui/gears/GearSize.cpp @@ -70,8 +70,8 @@ void GearSize::apply() ->setEase(_tweenConfig->easeType) ->setTargetAny(this) ->setUserData(Value((a ? 1 : 0) + (b ? 2 : 0))) - ->onUpdate(CC_CALLBACK_1(GearSize::onTweenUpdate, this)) - ->onComplete(CC_CALLBACK_0(GearSize::onTweenComplete, this)); + ->onUpdate(AX_CALLBACK_1(GearSize::onTweenUpdate, this)) + ->onComplete(AX_CALLBACK_0(GearSize::onTweenComplete, this)); } } else diff --git a/extensions/fairygui/gears/GearXY.cpp b/extensions/fairygui/gears/GearXY.cpp index 4f312e3f28..d5dc5b89b0 100644 --- a/extensions/fairygui/gears/GearXY.cpp +++ b/extensions/fairygui/gears/GearXY.cpp @@ -94,8 +94,8 @@ void GearXY::apply() ->setDelay(_tweenConfig->delay) ->setEase(_tweenConfig->easeType) ->setTargetAny(this) - ->onUpdate(CC_CALLBACK_1(GearXY::onTweenUpdate, this)) - ->onComplete(CC_CALLBACK_0(GearXY::onTweenComplete, this)); + ->onUpdate(AX_CALLBACK_1(GearXY::onTweenUpdate, this)) + ->onComplete(AX_CALLBACK_0(GearXY::onTweenComplete, this)); } } else diff --git a/extensions/fairygui/tween/GTweener.cpp b/extensions/fairygui/tween/GTweener.cpp index 4125f1c743..cc26b596ff 100644 --- a/extensions/fairygui/tween/GTweener.cpp +++ b/extensions/fairygui/tween/GTweener.cpp @@ -78,7 +78,7 @@ GTweener* GTweener::setSnapping(bool value) GTweener* GTweener::setTargetAny(void* value) { - CC_SAFE_RELEASE(_refTarget); + AX_SAFE_RELEASE(_refTarget); _refTarget = nullptr; _target = value; return this; @@ -91,10 +91,10 @@ GTweener* GTweener::setTarget(axis::Ref* value) GTweener* GTweener::setTarget(axis::Ref* target, TweenPropType propType) { - CC_SAFE_RELEASE(_refTarget); + AX_SAFE_RELEASE(_refTarget); _target = _refTarget = target; _propType = propType; - CC_SAFE_RETAIN(_refTarget); + AX_SAFE_RETAIN(_refTarget); return this; } @@ -278,7 +278,7 @@ void GTweener::_init() void GTweener::_reset() { - CC_SAFE_RELEASE(_refTarget); + AX_SAFE_RELEASE(_refTarget); _target = nullptr; _refTarget = nullptr; _userData = nullptr; diff --git a/extensions/fairygui/utils/html/HtmlObject.cpp b/extensions/fairygui/utils/html/HtmlObject.cpp index 14b5df0854..dec6684054 100644 --- a/extensions/fairygui/utils/html/HtmlObject.cpp +++ b/extensions/fairygui/utils/html/HtmlObject.cpp @@ -36,7 +36,7 @@ HtmlObject::~HtmlObject() } } - CC_SAFE_RELEASE(_ui); + AX_SAFE_RELEASE(_ui); } void HtmlObject::create(FUIRichText* owner, HtmlElement* element) diff --git a/extensions/fairygui/utils/html/HtmlParser.cpp b/extensions/fairygui/utils/html/HtmlParser.cpp index cee83ccd3e..8f834b1105 100644 --- a/extensions/fairygui/utils/html/HtmlParser.cpp +++ b/extensions/fairygui/utils/html/HtmlParser.cpp @@ -12,7 +12,7 @@ USING_NS_AX; using namespace std; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_WINRT) #define strcasecmp _stricmp #endif diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.cpp b/extensions/physics-nodes/CCPhysicsDebugNode.cpp index b46d4b454f..2baa0d0fe4 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.cpp +++ b/extensions/physics-nodes/CCPhysicsDebugNode.cpp @@ -114,7 +114,7 @@ static void DrawShape(cpShape* shape, DrawNode* renderer) renderer->drawPolygon(pPoints, num, color, 1.0, line); } - CC_SAFE_DELETE_ARRAY(pPoints); + AX_SAFE_DELETE_ARRAY(pPoints); } break; default: diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.h b/extensions/physics-nodes/CCPhysicsDebugNode.h index 832eed84ac..f688fe3c38 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.h +++ b/extensions/physics-nodes/CCPhysicsDebugNode.h @@ -43,7 +43,7 @@ NS_AX_EXT_BEGIN * @lua NA */ -class CC_EX_DLL PhysicsDebugNode : public DrawNode +class AX_EX_DLL PhysicsDebugNode : public DrawNode { public: diff --git a/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.cpp b/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.cpp index d2f7852749..79ded5910b 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.cpp +++ b/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.cpp @@ -68,7 +68,7 @@ void PhysicsDebugNodeBox2D::DrawSolidPolygon(const b2Vec2* verts, int vertexCoun void PhysicsDebugNodeBox2D::DrawCircle(const b2Vec2& center, float radius, const b2Color& color) { drawBP->drawCircle(Vec2(center.x * mRatio, center.y * mRatio) + debugNodeOffset, radius * mRatio, - CC_DEGREES_TO_RADIANS(0), 30, true, 1.0f, 1.0f, Color4F(color.r, color.g, color.b, color.a)); + AX_DEGREES_TO_RADIANS(0), 30, true, 1.0f, 1.0f, Color4F(color.r, color.g, color.b, color.a)); } void PhysicsDebugNodeBox2D::DrawSolidCircle(const b2Vec2& center, @@ -77,7 +77,7 @@ void PhysicsDebugNodeBox2D::DrawSolidCircle(const b2Vec2& center, const b2Color& color) { Vec2 c = {Vec2(center.x * mRatio, center.y * mRatio) + debugNodeOffset}; - drawBP->drawSolidCircle(c, radius * mRatio, CC_DEGREES_TO_RADIANS(0), 20, 1.0f, 1.0f, + drawBP->drawSolidCircle(c, radius * mRatio, AX_DEGREES_TO_RADIANS(0), 20, 1.0f, 1.0f, Color4F(color.r / 2, color.g / 2, color.b / 2, color.a), 0.4f, Color4F(color.r, color.g, color.b, color.a)); diff --git a/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.h b/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.h index be3f13d66f..e74713d1c9 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.h +++ b/extensions/physics-nodes/CCPhysicsDebugNodeBox2D.h @@ -29,7 +29,7 @@ NS_AX_EXT_BEGIN // This class implements debug drawing callbacks that are invoked inside b2World::Step. -class CC_EX_DLL PhysicsDebugNodeBox2D : public b2Draw +class AX_EX_DLL PhysicsDebugNodeBox2D : public b2Draw { public: PhysicsDebugNodeBox2D(); diff --git a/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.cpp b/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.cpp index 3345623f9d..36aa79ad85 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.cpp +++ b/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.cpp @@ -116,7 +116,7 @@ static void DrawShape(cpShape* shape, DrawNode* renderer) renderer->drawPolygon(pPoints, num, color, 1.0, line); } - CC_SAFE_DELETE_ARRAY(pPoints); + AX_SAFE_DELETE_ARRAY(pPoints); } break; default: diff --git a/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.h b/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.h index 6f4f9374a9..364a25e89f 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.h +++ b/extensions/physics-nodes/CCPhysicsDebugNodeChipmunk2D.h @@ -45,7 +45,7 @@ extern Vec2 physicsDebugNodeOffset; * @lua NA */ -class CC_EX_DLL PhysicsDebugNodeChipmunk2D : public DrawNode +class AX_EX_DLL PhysicsDebugNodeChipmunk2D : public DrawNode { public: diff --git a/extensions/physics-nodes/CCPhysicsSprite.cpp b/extensions/physics-nodes/CCPhysicsSprite.cpp index 0ec61d3141..bbc25a5d33 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.cpp +++ b/extensions/physics-nodes/CCPhysicsSprite.cpp @@ -26,11 +26,11 @@ #include "base/CCDirector.h" #include "base/CCEventDispatcher.h" -#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) +#if (AX_ENABLE_CHIPMUNK_INTEGRATION || AX_ENABLE_BOX2D_INTEGRATION) -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION # include "chipmunk/chipmunk.h" -# elif CC_ENABLE_BOX2D_INTEGRATION +# elif AX_ENABLE_BOX2D_INTEGRATION # include "box2d/box2d.h" # endif @@ -49,7 +49,7 @@ PhysicsSprite* PhysicsSprite::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -64,7 +64,7 @@ PhysicsSprite* PhysicsSprite::createWithTexture(Texture2D* pTexture) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -79,7 +79,7 @@ PhysicsSprite* PhysicsSprite::createWithTexture(Texture2D* pTexture, const Rect& } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -94,7 +94,7 @@ PhysicsSprite* PhysicsSprite::createWithSpriteFrame(SpriteFrame* pSpriteFrame) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -109,7 +109,7 @@ PhysicsSprite* PhysicsSprite::createWithSpriteFrameName(const char* pszSpriteFra } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -124,7 +124,7 @@ PhysicsSprite* PhysicsSprite::create(const char* pszFileName) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -139,7 +139,7 @@ PhysicsSprite* PhysicsSprite::create(const char* pszFileName, const Rect& rect) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -202,7 +202,7 @@ Vec3 PhysicsSprite::getPosition3D() const cpBody* PhysicsSprite::getCPBody() const { -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION return _CPBody; # else CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); @@ -212,7 +212,7 @@ cpBody* PhysicsSprite::getCPBody() const void PhysicsSprite::setCPBody(cpBody* pBody) { -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION _CPBody = pBody; # else CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); @@ -221,7 +221,7 @@ void PhysicsSprite::setCPBody(cpBody* pBody) b2Body* PhysicsSprite::getB2Body() const { -# if CC_ENABLE_BOX2D_INTEGRATION +# if AX_ENABLE_BOX2D_INTEGRATION return _pB2Body; # else CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); @@ -231,17 +231,17 @@ b2Body* PhysicsSprite::getB2Body() const void PhysicsSprite::setB2Body(b2Body* pBody) { -# if CC_ENABLE_BOX2D_INTEGRATION +# if AX_ENABLE_BOX2D_INTEGRATION _pB2Body = pBody; # else - CC_UNUSED_PARAM(pBody); + AX_UNUSED_PARAM(pBody); CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); # endif } float PhysicsSprite::getPTMRatio() const { -# if CC_ENABLE_BOX2D_INTEGRATION +# if AX_ENABLE_BOX2D_INTEGRATION return _PTMRatio; # else CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); @@ -251,10 +251,10 @@ float PhysicsSprite::getPTMRatio() const void PhysicsSprite::setPTMRatio(float fRatio) { -# if CC_ENABLE_BOX2D_INTEGRATION +# if AX_ENABLE_BOX2D_INTEGRATION _PTMRatio = fRatio; # else - CC_UNUSED_PARAM(fRatio); + AX_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 CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION cpVect cpPos = cpBodyGetPosition(_CPBody); s_physicPosion = Vec2(cpPos.x, cpPos.y); -# elif CC_ENABLE_BOX2D_INTEGRATION +# elif AX_ENABLE_BOX2D_INTEGRATION b2Vec2 pos = _pB2Body->GetPosition(); float x = pos.x * _PTMRatio; @@ -283,12 +283,12 @@ const Vec2& PhysicsSprite::getPosFromPhysics() const void PhysicsSprite::setPosition(float x, float y) { -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION cpVect cpPos = cpv(x, y); cpBodySetPosition(_CPBody, cpPos); -# elif CC_ENABLE_BOX2D_INTEGRATION +# elif AX_ENABLE_BOX2D_INTEGRATION float angle = _pB2Body->GetAngle(); _pB2Body->SetTransform(b2Vec2(x / _PTMRatio, y / _PTMRatio), angle); @@ -317,13 +317,13 @@ void PhysicsSprite::setPosition3D(const Vec3& position) float PhysicsSprite::getRotation() const { -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION - return (_ignoreBodyRotation ? Sprite::getRotation() : -CC_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); + return (_ignoreBodyRotation ? Sprite::getRotation() : -AX_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); -# elif CC_ENABLE_BOX2D_INTEGRATION +# elif AX_ENABLE_BOX2D_INTEGRATION - return (_ignoreBodyRotation ? Sprite::getRotation() : CC_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); + return (_ignoreBodyRotation ? Sprite::getRotation() : AX_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); # else return 0.0f; # endif @@ -336,17 +336,17 @@ void PhysicsSprite::setRotation(float fRotation) Sprite::setRotation(fRotation); } -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION else { - cpBodySetAngle(_CPBody, -CC_DEGREES_TO_RADIANS(fRotation)); + cpBodySetAngle(_CPBody, -AX_DEGREES_TO_RADIANS(fRotation)); } -# elif CC_ENABLE_BOX2D_INTEGRATION +# elif AX_ENABLE_BOX2D_INTEGRATION else { b2Vec2 p = _pB2Body->GetPosition(); - float radians = CC_DEGREES_TO_RADIANS(fRotation); + float radians = AX_DEGREES_TO_RADIANS(fRotation); _pB2Body->SetTransform(p, radians); } # endif @@ -358,9 +358,9 @@ void PhysicsSprite::syncPhysicsTransform() const // the sprite is animated (scaled up/down) using actions. // For more info see: http://www.cocos2d-iphone.org/forum/topic/68990 -# if CC_ENABLE_CHIPMUNK_INTEGRATION +# if AX_ENABLE_CHIPMUNK_INTEGRATION - cpVect rot = (_ignoreBodyRotation ? cpvforangle(-CC_DEGREES_TO_RADIANS(_rotationX)) : cpBodyGetRotation(_CPBody)); + cpVect rot = (_ignoreBodyRotation ? cpvforangle(-AX_DEGREES_TO_RADIANS(_rotationX)) : cpBodyGetRotation(_CPBody)); float x = cpBodyGetPosition(_CPBody).x + rot.x * -_anchorPointInPoints.x * _scaleX - rot.y * -_anchorPointInPoints.y * _scaleY; float y = cpBodyGetPosition(_CPBody).y + rot.y * -_anchorPointInPoints.x * _scaleX + @@ -391,7 +391,7 @@ void PhysicsSprite::syncPhysicsTransform() const _transform.set(mat); -# elif CC_ENABLE_BOX2D_INTEGRATION +# elif AX_ENABLE_BOX2D_INTEGRATION b2Vec2 pos = _pB2Body->GetPosition(); @@ -467,4 +467,4 @@ void PhysicsSprite::afterUpdate(EventCustom* /*event*/) NS_AX_EXT_END -#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION +#endif // AX_ENABLE_CHIPMUNK_INTEGRATION || AX_ENABLE_BOX2D_INTEGRATION diff --git a/extensions/physics-nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h index 16a0eb49b0..a931d73b36 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.h +++ b/extensions/physics-nodes/CCPhysicsSprite.h @@ -30,7 +30,7 @@ #include "extensions/ExtensionExport.h" #include "base/CCEventListenerCustom.h" -#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) +#if (AX_ENABLE_CHIPMUNK_INTEGRATION || AX_ENABLE_BOX2D_INTEGRATION) struct cpBody; class b2Body; @@ -39,9 +39,9 @@ NS_AX_EXT_BEGIN /** A Sprite subclass that is bound to a physics body. It works with: - - Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined - - Objective-Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined - - Box2d: Preprocessor macro CC_ENABLE_BOX2D_INTEGRATION should be defined + - Chipmunk: Preprocessor macro AX_ENABLE_CHIPMUNK_INTEGRATION should be defined + - Objective-Chipmunk: Preprocessor macro AX_ENABLE_CHIPMUNK_INTEGRATION should be defined + - Box2d: Preprocessor macro AX_ENABLE_BOX2D_INTEGRATION should be defined Features and Limitations: - Scale and Skew properties are ignored. @@ -50,7 +50,7 @@ NS_AX_EXT_BEGIN - You can't enble both Chipmunk support and Box2d support at the same time. Only one can be enabled at compile time * @lua NA */ -class CC_EX_DLL PhysicsSprite : public Sprite +class AX_EX_DLL PhysicsSprite : public Sprite { public: static PhysicsSprite* create(); @@ -149,6 +149,6 @@ protected: NS_AX_EXT_END -#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION +#endif // AX_ENABLE_CHIPMUNK_INTEGRATION || AX_ENABLE_BOX2D_INTEGRATION #endif // __PHYSICSNODES_CCPHYSICSSPRITE_H__ diff --git a/extensions/physics-nodes/CCPhysicsSpriteBox2D.cpp b/extensions/physics-nodes/CCPhysicsSpriteBox2D.cpp index 6add6591cb..604d58d8a4 100644 --- a/extensions/physics-nodes/CCPhysicsSpriteBox2D.cpp +++ b/extensions/physics-nodes/CCPhysicsSpriteBox2D.cpp @@ -43,7 +43,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -58,7 +58,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::createWithTexture(Texture2D* pTexture) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -73,7 +73,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::createWithTexture(Texture2D* pTexture, c } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -88,7 +88,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::createWithSpriteFrame(SpriteFrame* pSpri } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -103,7 +103,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::createWithSpriteFrameName(const char* ps } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -118,7 +118,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::create(const char* pszFileName) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -133,7 +133,7 @@ PhysicsSpriteBox2D* PhysicsSpriteBox2D::create(const char* pszFileName, const Re } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -254,7 +254,7 @@ void PhysicsSpriteBox2D::setPosition3D(const Vec3& position) float PhysicsSpriteBox2D::getRotation() const { - return (_ignoreBodyRotation ? Sprite::getRotation() : CC_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); + return (_ignoreBodyRotation ? Sprite::getRotation() : AX_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); } void PhysicsSpriteBox2D::setRotation(float fRotation) @@ -267,7 +267,7 @@ void PhysicsSpriteBox2D::setRotation(float fRotation) else { b2Vec2 p = _pB2Body->GetPosition(); - float radians = CC_DEGREES_TO_RADIANS(fRotation); + float radians = AX_DEGREES_TO_RADIANS(fRotation); _pB2Body->SetTransform(p, radians); } } diff --git a/extensions/physics-nodes/CCPhysicsSpriteBox2D.h b/extensions/physics-nodes/CCPhysicsSpriteBox2D.h index 5a39e38263..2f4a0e83c0 100644 --- a/extensions/physics-nodes/CCPhysicsSpriteBox2D.h +++ b/extensions/physics-nodes/CCPhysicsSpriteBox2D.h @@ -45,7 +45,7 @@ NS_AX_EXT_BEGIN - You can't enble both Chipmunk support and Box2d support at the same time. Only one can be enabled at compile time * @lua NA */ -class CC_EX_DLL PhysicsSpriteBox2D : public Sprite +class AX_EX_DLL PhysicsSpriteBox2D : public Sprite { public: static PhysicsSpriteBox2D* create(); diff --git a/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.cpp b/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.cpp index a5e21a679f..8b911b7112 100644 --- a/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.cpp +++ b/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.cpp @@ -43,7 +43,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::create() } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -58,7 +58,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::createWithTexture(Texture2D* p } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -73,7 +73,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::createWithTexture(Texture2D* p } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -88,7 +88,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::createWithSpriteFrame(SpriteFr } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -103,7 +103,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::createWithSpriteFrameName(cons } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -118,7 +118,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::create(const char* pszFileName } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -133,7 +133,7 @@ PhysicsSpriteChipmunk2D* PhysicsSpriteChipmunk2D::create(const char* pszFileName } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -246,7 +246,7 @@ void PhysicsSpriteChipmunk2D::setPosition3D(const Vec3& position) float PhysicsSpriteChipmunk2D::getRotation() const { - return (_ignoreBodyRotation ? Sprite::getRotation() : -CC_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); + return (_ignoreBodyRotation ? Sprite::getRotation() : -AX_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); } void PhysicsSpriteChipmunk2D::setRotation(float fRotation) @@ -257,7 +257,7 @@ void PhysicsSpriteChipmunk2D::setRotation(float fRotation) } else { - cpBodySetAngle(_CPBody, -CC_DEGREES_TO_RADIANS(fRotation)); + cpBodySetAngle(_CPBody, -AX_DEGREES_TO_RADIANS(fRotation)); } } @@ -267,7 +267,7 @@ void PhysicsSpriteChipmunk2D::syncPhysicsTransform() const // the sprite is animated (scaled up/down) using actions. // For more info see: http://www.cocos2d-iphone.org/forum/topic/68990 - cpVect rot = (_ignoreBodyRotation ? cpvforangle(-CC_DEGREES_TO_RADIANS(_rotationX)) : cpBodyGetRotation(_CPBody)); + cpVect rot = (_ignoreBodyRotation ? cpvforangle(-AX_DEGREES_TO_RADIANS(_rotationX)) : cpBodyGetRotation(_CPBody)); float x = cpBodyGetPosition(_CPBody).x + rot.x * -_anchorPointInPoints.x * _scaleX - rot.y * -_anchorPointInPoints.y * _scaleY; float y = cpBodyGetPosition(_CPBody).y + rot.y * -_anchorPointInPoints.x * _scaleX + diff --git a/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.h b/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.h index d948a02fee..6962b09a3c 100644 --- a/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.h +++ b/extensions/physics-nodes/CCPhysicsSpriteChipmunk2D.h @@ -45,7 +45,7 @@ NS_AX_EXT_BEGIN - You can't enble both Chipmunk support and Box2d support at the same time. Only one can be enabled at compile time * @lua NA */ -class CC_EX_DLL PhysicsSpriteChipmunk2D : public Sprite +class AX_EX_DLL PhysicsSpriteChipmunk2D : public Sprite { public: static PhysicsSpriteChipmunk2D* create(); diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.cpp b/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.cpp index b8c2ed63bc..2958fead41 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/lua-bindings/auto/lua_axis_audioengine_auto.hpp" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX #include "audio/AudioEngine.h" #include "scripting/lua-bindings/manual/tolua_fix.h" #include "scripting/lua-bindings/manual/LuaBasicConversions.h" diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.hpp b/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.hpp index 87ea5ced94..b399dba4dd 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.hpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_audioengine_auto.hpp @@ -1,5 +1,5 @@ #include "base/ccConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX #ifndef __axis_audioengine_h__ #define __axis_audioengine_h__ @@ -38,4 +38,4 @@ int register_all_axis_audioengine(lua_State* tolua_S); #endif // __axis_audioengine_h__ -#endif //#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#endif //#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.cpp b/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.cpp index c75a7663d3..0f9ce39185 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/lua-bindings/auto/lua_axis_controller_auto.hpp" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) #include "base/CCGameController.h" #include "scripting/lua-bindings/manual/tolua_fix.h" #include "scripting/lua-bindings/manual/LuaBasicConversions.h" diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.hpp b/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.hpp index 810535c8e2..8db961ac8a 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.hpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_controller_auto.hpp @@ -1,5 +1,5 @@ #include "base/ccConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) #ifndef __axis_controller_h__ #define __axis_controller_h__ @@ -29,4 +29,4 @@ int register_all_axis_controller(lua_State* tolua_S); #endif // __axis_controller_h__ -#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#endif //#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.cpp b/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.cpp index af7309c2c7..70a9f5035c 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/lua-bindings/auto/lua_axis_navmesh_auto.hpp" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH #include "navmesh/CCNavMesh.h" #include "scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.h" #include "scripting/lua-bindings/manual/tolua_fix.h" diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.hpp b/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.hpp index 5737b928d8..3471c278fb 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.hpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_navmesh_auto.hpp @@ -1,5 +1,5 @@ #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH #ifndef __axis_navmesh_h__ #define __axis_navmesh_h__ @@ -63,4 +63,4 @@ int register_all_axis_navmesh(lua_State* tolua_S); #endif // __axis_navmesh_h__ -#endif //#if CC_USE_NAVMESH +#endif //#if AX_USE_NAVMESH diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.cpp b/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.cpp index 592a42f75c..30802a10e9 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/lua-bindings/auto/lua_axis_physics3d_auto.hpp" -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION #include "physics3d/CCPhysics3D.h" #include "scripting/lua-bindings/manual/tolua_fix.h" #include "scripting/lua-bindings/manual/LuaBasicConversions.h" diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.hpp b/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.hpp index 8daec8990d..23d83858f0 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.hpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_physics3d_auto.hpp @@ -1,5 +1,5 @@ #include "base/ccConfig.h" -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION #ifndef __axis_physics3d_h__ #define __axis_physics3d_h__ @@ -260,4 +260,4 @@ int register_all_axis_physics3d(lua_State* tolua_S); #endif // __axis_physics3d_h__ -#endif //#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#endif //#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.cpp b/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.cpp index 85fc79f8af..ed229eec1c 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/lua-bindings/auto/lua_axis_physics_auto.hpp" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS #include "cocos2d.h" #include "scripting/lua-bindings/manual/tolua_fix.h" #include "scripting/lua-bindings/manual/LuaBasicConversions.h" diff --git a/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.hpp b/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.hpp index efaee4a1ca..2c847ad9f3 100644 --- a/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.hpp +++ b/extensions/scripting/lua-bindings/auto/lua_axis_physics_auto.hpp @@ -1,5 +1,5 @@ #include "base/ccConfig.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS #ifndef __axis_physics_h__ #define __axis_physics_h__ @@ -277,4 +277,4 @@ int register_all_axis_physics(lua_State* tolua_S); #endif // __axis_physics_h__ -#endif //#if CC_USE_PHYSICS +#endif //#if AX_USE_PHYSICS diff --git a/extensions/scripting/lua-bindings/manual/3d/lua_axis_3d_manual.cpp b/extensions/scripting/lua-bindings/manual/3d/lua_axis_3d_manual.cpp index 8f675d7dce..cc5ae1d27b 100644 --- a/extensions/scripting/lua-bindings/manual/3d/lua_axis_3d_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/3d/lua_axis_3d_manual.cpp @@ -1228,7 +1228,7 @@ tolua_lerror: int lua_axis_3d_AABB_finalize(lua_State* L) { axis::AABB* self = (axis::AABB*)tolua_tousertype(L, 1, 0); - CC_SAFE_DELETE(self); + AX_SAFE_DELETE(self); return 0; } @@ -1979,7 +1979,7 @@ int lua_axis_3d_OBB_getCorners(lua_State* L) vec3_to_luaval(L, arg0[i - 1]); lua_rawset(L, -3); } - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } @@ -1997,7 +1997,7 @@ tolua_lerror: int lua_axis_3d_OBB_finalize(lua_State* L) { axis::OBB* self = (axis::OBB*)tolua_tousertype(L, 1, 0); - CC_SAFE_DELETE(self); + AX_SAFE_DELETE(self); return 0; } @@ -2362,7 +2362,7 @@ tolua_lerror: int lua_axis_3d_Ray_finalize(lua_State* L) { axis::Ray* self = (axis::Ray*)tolua_tousertype(L, 1, 0); - CC_SAFE_DELETE(self); + AX_SAFE_DELETE(self); return 0; } diff --git a/extensions/scripting/lua-bindings/manual/CCComponentLua.cpp b/extensions/scripting/lua-bindings/manual/CCComponentLua.cpp index b437d7c2da..df7177b712 100644 --- a/extensions/scripting/lua-bindings/manual/CCComponentLua.cpp +++ b/extensions/scripting/lua-bindings/manual/CCComponentLua.cpp @@ -68,7 +68,7 @@ int ComponentLua::_index = 0; ComponentLua* ComponentLua::create(std::string_view scriptFileName) { - CC_ASSERT(!scriptFileName.empty()); + AX_ASSERT(!scriptFileName.empty()); initClass(); diff --git a/extensions/scripting/lua-bindings/manual/CCLuaEngine.cpp b/extensions/scripting/lua-bindings/manual/CCLuaEngine.cpp index 3c74184c36..fd1cac2acd 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaEngine.cpp +++ b/extensions/scripting/lua-bindings/manual/CCLuaEngine.cpp @@ -52,7 +52,7 @@ LuaEngine* LuaEngine::getInstance(void) LuaEngine::~LuaEngine(void) { - CC_SAFE_RELEASE(_stack); + AX_SAFE_RELEASE(_stack); _defaultEngine = nullptr; } diff --git a/extensions/scripting/lua-bindings/manual/CCLuaEngine.h b/extensions/scripting/lua-bindings/manual/CCLuaEngine.h index 753f46b12d..acf85cd1f3 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaEngine.h +++ b/extensions/scripting/lua-bindings/manual/CCLuaEngine.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_LUA_ENGINE_H__ -#define __CC_LUA_ENGINE_H__ +#ifndef __AX_LUA_ENGINE_H__ +#define __AX_LUA_ENGINE_H__ extern "C" { #include "lua.h" @@ -50,7 +50,7 @@ NS_AX_BEGIN * @lua NA * @js NA */ -class CC_LUA_DLL LuaEngine : public ScriptEngineProtocol +class AX_LUA_DLL LuaEngine : public ScriptEngineProtocol { public: /** @@ -64,7 +64,7 @@ public: * * @return the instance of LuaEngine. */ - CC_DEPRECATED_ATTRIBUTE static LuaEngine* defaultEngine(void) { return LuaEngine::getInstance(); } + AX_DEPRECATED_ATTRIBUTE static LuaEngine* defaultEngine(void) { return LuaEngine::getInstance(); } /** * Destructor of LuaEngine. @@ -264,4 +264,4 @@ NS_AX_END // end group /// @} -#endif // __CC_LUA_ENGINE_H__ +#endif // __AX_LUA_ENGINE_H__ diff --git a/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp b/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp index 3b4741fc1b..a61b721eac 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp +++ b/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp @@ -37,11 +37,11 @@ extern "C" { #include "scripting/lua-bindings/manual/AxisLuaLoader.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) # include "scripting/lua-bindings/manual/platform/ios/CCLuaObjcBridge.h" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.h" #endif @@ -154,16 +154,16 @@ bool LuaStack::init() tolua_luanode_open(_state); register_luanode_manual(_state); -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS register_all_axis_physics(_state); register_all_axis_physics_manual(_state); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) LuaObjcBridge::luaopen_luaoc(_state); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) LuaJavaBridge::luaopen_luaj(_state); #endif diff --git a/extensions/scripting/lua-bindings/manual/CCLuaStack.h b/extensions/scripting/lua-bindings/manual/CCLuaStack.h index f0df2a2cbf..2fd6583d8c 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaStack.h +++ b/extensions/scripting/lua-bindings/manual/CCLuaStack.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_LUA_STACK_H_ -#define __CC_LUA_STACK_H_ +#ifndef __AX_LUA_STACK_H_ +#define __AX_LUA_STACK_H_ extern "C" { #include "lua.h" @@ -332,4 +332,4 @@ NS_AX_END // end group /// @} -#endif // __CC_LUA_STACK_H_ +#endif // __AX_LUA_STACK_H_ diff --git a/extensions/scripting/lua-bindings/manual/CCLuaValue.h b/extensions/scripting/lua-bindings/manual/CCLuaValue.h index 7aea56eadd..db5afc19ad 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaValue.h +++ b/extensions/scripting/lua-bindings/manual/CCLuaValue.h @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_LUA_VALUE_H_ -#define __CC_LUA_VALUE_H_ +#ifndef __AX_LUA_VALUE_H_ +#define __AX_LUA_VALUE_H_ #include #include @@ -38,7 +38,7 @@ extern "C" { #include "base/ccTypes.h" #include "base/CCRef.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY +#if AX_TARGET_PLATFORM == AX_PLATFORM_BLACKBERRY using std::memcpy; using std::memset; #endif @@ -281,4 +281,4 @@ NS_AX_END // end group /// @} -#endif // __CC_LUA_VALUE_H_ +#endif // __AX_LUA_VALUE_H_ diff --git a/extensions/scripting/lua-bindings/manual/Lua-BindingsExport.h b/extensions/scripting/lua-bindings/manual/Lua-BindingsExport.h index 48e73786ea..199f7a6775 100644 --- a/extensions/scripting/lua-bindings/manual/Lua-BindingsExport.h +++ b/extensions/scripting/lua-bindings/manual/Lua-BindingsExport.h @@ -31,12 +31,12 @@ # endif # if defined(_USRLUASTATIC) -# define CC_LUA_DLL +# define AX_LUA_DLL # else # if defined(_USRLUADLL) -# define CC_LUA_DLL __declspec(dllexport) +# define AX_LUA_DLL __declspec(dllexport) # else /* use a DLL library */ -# define CC_LUA_DLL __declspec(dllimport) +# define AX_LUA_DLL __declspec(dllimport) # endif # endif @@ -49,9 +49,9 @@ # endif # endif #elif defined(_SHARED_) -# define CC_LUA_DLL __attribute__((visibility("default"))) +# define AX_LUA_DLL __attribute__((visibility("default"))) #else -# define CC_LUA_DLL +# define AX_LUA_DLL #endif #endif /* __CCEXTENSIONEXPORT_H__*/ \ No newline at end of file diff --git a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.cpp b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.cpp index f2b180e899..b532ff2382 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 CC_USE_PHYSICS +#if AX_USE_PHYSICS bool luaval_to_physics_material(lua_State* L, int lo, PhysicsMaterial* outValue, const char* funcName) { if (NULL == L || NULL == outValue) @@ -542,7 +542,7 @@ bool luaval_to_physics_material(lua_State* L, int lo, PhysicsMaterial* outValue, } return ok; } -#endif //#if CC_USE_PHYSICS +#endif //#if AX_USE_PHYSICS bool luaval_to_ssize_t(lua_State* L, int lo, ssize_t* outValue, const char* funcName) { @@ -1149,14 +1149,14 @@ bool luaval_to_array_of_vec2(lua_State* L, int lo, axis::Vec2** points, int* num luaval_to_native_err(L, "#ferror:", &tolua_err, funcName); #endif lua_pop(L, 1); - CC_SAFE_DELETE_ARRAY(array); + AX_SAFE_DELETE_ARRAY(array); return false; } ok &= luaval_to_vec2(L, lua_gettop(L), &array[i]); if (!ok) { lua_pop(L, 1); - CC_SAFE_DELETE_ARRAY(array); + AX_SAFE_DELETE_ARRAY(array); return false; } lua_pop(L, 1); @@ -2255,7 +2255,7 @@ int vec4_to_luaval(lua_State* L, const axis::Vec4& vec4) return 1; } -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS void physics_material_to_luaval(lua_State* L, const PhysicsMaterial& pm) { if (nullptr == L) @@ -2333,7 +2333,7 @@ void physics_contactdata_to_luaval(lua_State* L, const PhysicsContactData* data) lua_pushnumber(L, data->POINT_MAX); lua_rawset(L, -3); } -#endif //#if CC_USE_PHYSICS +#endif //#if AX_USE_PHYSICS void size_to_luaval(lua_State* L, const Size& sz) { diff --git a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h index 3036e6a929..7f078c8685 100644 --- a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -175,7 +175,7 @@ extern bool luaval_to_uint16(lua_State* L, int lo, uint16_t* outValue, const cha * @return Return true if the value at the given acceptable index of stack is a number or a string convertible to a * number, otherwise return false. */ -extern CC_LUA_DLL bool luaval_to_boolean(lua_State* L, int lo, bool* outValue, const char* funcName = ""); +extern AX_LUA_DLL bool luaval_to_boolean(lua_State* L, int lo, bool* outValue, const char* funcName = ""); /** * Get a double value from the given acceptable index of stack. @@ -217,8 +217,8 @@ extern bool luaval_to_long_long(lua_State* L, int lo, long long* outValue, const * @return Return true if the value at the given acceptable index of stack is a string or a number convertible to a * string, otherwise return false. */ -extern CC_LUA_DLL bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue, const char* funcName = ""); -extern CC_LUA_DLL bool luaval_to_std_string_view(lua_State* L, +extern AX_LUA_DLL bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue, const char* funcName = ""); +extern AX_LUA_DLL bool luaval_to_std_string_view(lua_State* L, int lo, cxx17::string_view* outValue, const char* funcName = ""); @@ -277,7 +277,7 @@ extern bool luaval_to_rect(lua_State* L, int lo, Rect* outValue, const char* fun * @param funcName the name of calling function, it is used for error output in the debug model. * @return Return true if the value at the given acceptable index of stack is a table, otherwise return false. */ -extern CC_LUA_DLL bool luaval_to_color3b(lua_State* L, int lo, Color3B* outValue, const char* funcName = ""); +extern AX_LUA_DLL bool luaval_to_color3b(lua_State* L, int lo, Color3B* outValue, const char* funcName = ""); /** * Get a Color4B object value from the given acceptable index of stack. @@ -306,7 +306,7 @@ extern bool luaval_to_color4b(lua_State* L, int lo, Color4B* outValue, const cha * @return Return true if the value at the given acceptable index of stack is a table, otherwise return false. */ extern bool luaval_to_color4f(lua_State* L, int lo, Color4F* outValue, const char* funcName = ""); -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS /** * Get a PhysicsMaterial object value from the given acceptable index of stack. @@ -325,7 +325,7 @@ extern bool luaval_to_physics_material(lua_State* L, int lo, axis::PhysicsMaterial* outValue, const char* funcName = ""); -#endif //#if CC_USE_PHYSICS +#endif //#if AX_USE_PHYSICS /** * If the value at the given acceptable index of stack is a table it returns true, otherwise returns false. @@ -478,14 +478,14 @@ static inline bool luaval_to_point(lua_State* L, int lo, axis::Vec2* outValue, c return luaval_to_vec2(L, lo, outValue); } -CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_kmMat4(lua_State* L, +AX_DEPRECATED_ATTRIBUTE static inline bool luaval_to_kmMat4(lua_State* L, int lo, axis::Mat4* outValue, const char* funcName = "") { return luaval_to_mat4(L, lo, outValue); } -CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L, +AX_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L, int lo, axis::Vec2** points, int* numPoints, @@ -585,12 +585,12 @@ bool luaval_to_ccvector(lua_State* L, int lo, axis::Vector* ret, const char* * @param funcName the name of calling function, it is used for error output in the debug model. * @return Return true if the value at the given acceptable index of stack is a table, otherwise return false. */ -CC_LUA_DLL bool luaval_to_std_vector_string(lua_State* L, +AX_LUA_DLL bool luaval_to_std_vector_string(lua_State* L, int lo, std::vector* ret, const char* funcName = ""); -CC_LUA_DLL bool luaval_to_std_vector_string_view(lua_State* L, +AX_LUA_DLL bool luaval_to_std_vector_string_view(lua_State* L, int lo, std::vector* ret, const char* funcName = ""); @@ -949,7 +949,7 @@ extern void rect_to_luaval(lua_State* L, const Rect& rt); * @param L the current lua_State. * @param cc a axis::Color3B object. */ -extern CC_LUA_DLL void color3b_to_luaval(lua_State* L, const Color3B& cc); +extern AX_LUA_DLL void color3b_to_luaval(lua_State* L, const Color3B& cc); /** * Push a table converted from a axis::Color4B object into the Lua stack. @@ -968,7 +968,7 @@ extern void color4b_to_luaval(lua_State* L, const Color4B& cc); * @param cc a axis::Color4F object. */ extern void color4f_to_luaval(lua_State* L, const Color4F& cc); -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS /** * Push a table converted from a axis::PhysicsMaterial object into the Lua stack. @@ -997,7 +997,7 @@ extern void physics_raycastinfo_to_luaval(lua_State* L, const PhysicsRayCastInfo * @param data a axis::PhysicsContactData object. */ extern void physics_contactdata_to_luaval(lua_State* L, const PhysicsContactData* data); -#endif //#if CC_USE_PHYSICS +#endif //#if AX_USE_PHYSICS /** * Push a table converted from a axis::AffineTransform object into the Lua stack. @@ -1054,7 +1054,7 @@ static inline void point_to_luaval(lua_State* L, const axis::Vec2& pt) vec2_to_luaval(L, pt); } -CC_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L, const axis::Vec2* points, int count) +AX_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L, const axis::Vec2* points, int count) { vec2_array_to_luaval(L, points, count); } @@ -1329,13 +1329,13 @@ void std_vector_vec3_to_luaval(lua_State* L, const std::vector& inVa void std_map_string_string_to_luaval(lua_State* L, const std::map& inValue); // Follow 2 function is added for Cocos Studio to make lua lib can be compile as dynamic library -CC_LUA_DLL extern bool luaval_to_node(lua_State* L, int lo, const char* type, axis::Node** node); -CC_LUA_DLL extern void node_to_luaval(lua_State* L, const char* type, axis::Node* node); +AX_LUA_DLL extern bool luaval_to_node(lua_State* L, int lo, const char* type, axis::Node** node); +AX_LUA_DLL extern void node_to_luaval(lua_State* L, const char* type, axis::Node* node); /** * convert lua object VertexLayout to native object */ -CC_LUA_DLL bool luaval_to_vertexLayout(lua_State* L, +AX_LUA_DLL bool luaval_to_vertexLayout(lua_State* L, int pos, axis::backend::VertexLayout& outLayout, const char* message); @@ -1343,7 +1343,7 @@ CC_LUA_DLL bool luaval_to_vertexLayout(lua_State* L, /** * convert lua object SamplerDescriptor to native object */ -CC_LUA_DLL bool luaval_to_samplerDescriptor(lua_State* L, +AX_LUA_DLL bool luaval_to_samplerDescriptor(lua_State* L, int pos, axis::backend::SamplerDescriptor& desc, const char* message); @@ -1351,7 +1351,7 @@ CC_LUA_DLL bool luaval_to_samplerDescriptor(lua_State* L, /** * convert lua object to axis::backend::UniformLocation */ -CC_LUA_DLL bool luaval_to_uniformLocation(lua_State* L, +AX_LUA_DLL bool luaval_to_uniformLocation(lua_State* L, int pos, axis::backend::UniformLocation& desc, const char* message); @@ -1359,9 +1359,9 @@ CC_LUA_DLL bool luaval_to_uniformLocation(lua_State* L, /** * convert axis::backend::UniformLocation to lua object */ -CC_LUA_DLL void uniformLocation_to_luaval(lua_State* L, const axis::backend::UniformLocation& desc); +AX_LUA_DLL void uniformLocation_to_luaval(lua_State* L, const axis::backend::UniformLocation& desc); -CC_LUA_DLL void program_activeattrs_to_luaval(lua_State* L, +AX_LUA_DLL void program_activeattrs_to_luaval(lua_State* L, const hlookup::string_map& map); // end group diff --git a/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.cpp b/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.cpp index b257bcaa6b..8760d03b4b 100644 --- a/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.cpp +++ b/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.cpp @@ -56,7 +56,7 @@ LuaCallFunc* LuaCallFunc::create(const std::function& func) return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -120,7 +120,7 @@ ScriptHandlerMgr* ScriptHandlerMgr::getInstance() void ScriptHandlerMgr::destroyInstance() { - CC_SAFE_DELETE(_scriptHandlerMgr); + AX_SAFE_DELETE(_scriptHandlerMgr); } void ScriptHandlerMgr::init() diff --git a/extensions/scripting/lua-bindings/manual/base/lua_axis_base_manual.cpp b/extensions/scripting/lua-bindings/manual/base/lua_axis_base_manual.cpp index 458ed657d2..25a75e9e20 100644 --- a/extensions/scripting/lua-bindings/manual/base/lua_axis_base_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/base/lua_axis_base_manual.cpp @@ -2439,7 +2439,7 @@ tolua_lerror: return 0; } -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "navmesh/CCNavMesh.h" int lua_axis_Scene_setNavMeshDebugCamera(lua_State* tolua_S) { @@ -2591,7 +2591,7 @@ tolua_lerror: return 0; } -#endif //#if CC_USE_NAVMESH +#endif //#if AX_USE_NAVMESH static int tolua_cocos2d_Spawn_create(lua_State* tolua_S) { @@ -2686,7 +2686,7 @@ int lua_cocos2d_CardinalSplineBy_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4, &ten, "ax.CardinalSplineBy:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2696,7 +2696,7 @@ int lua_cocos2d_CardinalSplineBy_create(lua_State* tolua_S) if (NULL == points) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2705,7 +2705,7 @@ int lua_cocos2d_CardinalSplineBy_create(lua_State* tolua_S) points->addControlPoint(arr[i]); } - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); CardinalSplineBy* tolua_ret = CardinalSplineBy::create((float)dur, points, (float)ten); if (NULL != tolua_ret) { @@ -2763,7 +2763,7 @@ int tolua_cocos2d_CatmullRomBy_create(lua_State* tolua_S) if (NULL == points) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2772,7 +2772,7 @@ int tolua_cocos2d_CatmullRomBy_create(lua_State* tolua_S) points->addControlPoint(arr[i]); } - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); CatmullRomBy* tolua_ret = CatmullRomBy::create((float)dur, points); if (NULL != tolua_ret) { @@ -2829,7 +2829,7 @@ int tolua_cocos2d_CatmullRomTo_create(lua_State* tolua_S) if (NULL == points) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2838,7 +2838,7 @@ int tolua_cocos2d_CatmullRomTo_create(lua_State* tolua_S) points->addControlPoint(arr[i]); } - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); CatmullRomTo* tolua_ret = CatmullRomTo::create((float)dur, points); if (NULL != tolua_ret) { @@ -2891,7 +2891,7 @@ int tolua_cocos2d_BezierBy_create(lua_State* tolua_S) if (num < 3) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2899,7 +2899,7 @@ int tolua_cocos2d_BezierBy_create(lua_State* tolua_S) config.controlPoint_1 = arr[0]; config.controlPoint_2 = arr[1]; config.endPosition = arr[2]; - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); BezierBy* tolua_ret = BezierBy::create((float)t, config); if (NULL != tolua_ret) @@ -2952,7 +2952,7 @@ int tolua_cocos2d_BezierTo_create(lua_State* tolua_S) if (num < 3) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -2960,7 +2960,7 @@ int tolua_cocos2d_BezierTo_create(lua_State* tolua_S) config.controlPoint_1 = arr[0]; config.controlPoint_2 = arr[1]; config.endPosition = arr[2]; - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); BezierTo* tolua_ret = BezierTo::create((float)t, config); if (NULL != tolua_ret) @@ -3026,7 +3026,7 @@ static int tolua_axis_DrawNode_drawPolygon(lua_State* tolua_S) lua_gettable(tolua_S, 2); if (!tolua_istable(tolua_S, -1, 0, &tolua_err)) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); #if COCOS2D_DEBUG >= 1 goto tolua_lerror; #endif @@ -3035,7 +3035,7 @@ static int tolua_axis_DrawNode_drawPolygon(lua_State* tolua_S) if (!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i], "ax.DrawNode:drawPolygon")) { lua_pop(tolua_S, 1); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } lua_pop(tolua_S, 1); @@ -3044,7 +3044,7 @@ static int tolua_axis_DrawNode_drawPolygon(lua_State* tolua_S) Color4F fillColor; if (!luaval_to_color4f(tolua_S, 4, &fillColor, "ax.DrawNode:drawPolygon")) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } @@ -3053,12 +3053,12 @@ static int tolua_axis_DrawNode_drawPolygon(lua_State* tolua_S) Color4F borderColor; if (!luaval_to_color4f(tolua_S, 6, &borderColor, "ax.DrawNode:drawPolygon")) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } self->drawPolygon(points, (int)size, fillColor, borderWidth, borderColor); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } } @@ -3110,7 +3110,7 @@ int tolua_axis_DrawNode_drawSolidPoly(lua_State* tolua_S) lua_gettable(tolua_S, 2); if (!tolua_istable(tolua_S, -1, 0, &tolua_err)) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); #if COCOS2D_DEBUG >= 1 goto tolua_lerror; #endif @@ -3119,7 +3119,7 @@ int tolua_axis_DrawNode_drawSolidPoly(lua_State* tolua_S) if (!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i], "ax.DrawNode:drawSolidPoly")) { lua_pop(tolua_S, 1); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } lua_pop(tolua_S, 1); @@ -3131,7 +3131,7 @@ int tolua_axis_DrawNode_drawSolidPoly(lua_State* tolua_S) if (!ok) return 0; self->drawSolidPoly(points, size, arg2); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } } @@ -3188,7 +3188,7 @@ int tolua_axis_DrawNode_drawPoly(lua_State* tolua_S) lua_gettable(tolua_S, 2); if (!tolua_istable(tolua_S, -1, 0, &tolua_err)) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); #if COCOS2D_DEBUG >= 1 goto tolua_lerror; #endif @@ -3197,7 +3197,7 @@ int tolua_axis_DrawNode_drawPoly(lua_State* tolua_S) if (!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i], "ax.DrawNode:drawPoly")) { lua_pop(tolua_S, 1); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } lua_pop(tolua_S, 1); @@ -3213,7 +3213,7 @@ int tolua_axis_DrawNode_drawPoly(lua_State* tolua_S) return 0; self->drawPoly(points, size, arg2, arg3); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } } @@ -3261,7 +3261,7 @@ int tolua_axis_DrawNode_drawCardinalSpline(lua_State* tolua_S) PointArray* config = PointArray::create(num); if (NULL == config) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -3269,7 +3269,7 @@ int tolua_axis_DrawNode_drawCardinalSpline(lua_State* tolua_S) { config->addControlPoint(arr[i]); } - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); double arg1; unsigned int arg2; @@ -3329,7 +3329,7 @@ int tolua_axis_DrawNode_drawCatmullRom(lua_State* tolua_S) PointArray* config = PointArray::create(num); if (NULL == config) { - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); return 0; } @@ -3337,7 +3337,7 @@ int tolua_axis_DrawNode_drawCatmullRom(lua_State* tolua_S) { config->addControlPoint(arr[i]); } - CC_SAFE_DELETE_ARRAY(arr); + AX_SAFE_DELETE_ARRAY(arr); unsigned int arg1; axis::Color4F arg2; @@ -3400,7 +3400,7 @@ int tolua_axis_DrawNode_drawPoints(lua_State* tolua_S) lua_gettable(tolua_S, 2); if (!tolua_istable(tolua_S, -1, 0, &tolua_err)) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); #if COCOS2D_DEBUG >= 1 goto tolua_lerror; #endif @@ -3409,7 +3409,7 @@ int tolua_axis_DrawNode_drawPoints(lua_State* tolua_S) if (!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i], "ax.DrawNode:drawPoints")) { lua_pop(tolua_S, 1); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } lua_pop(tolua_S, 1); @@ -3437,7 +3437,7 @@ int tolua_axis_DrawNode_drawPoints(lua_State* tolua_S) lua_gettable(tolua_S, 2); if (!tolua_istable(tolua_S, -1, 0, &tolua_err)) { - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); #if COCOS2D_DEBUG >= 1 goto tolua_lerror; #endif @@ -3446,7 +3446,7 @@ int tolua_axis_DrawNode_drawPoints(lua_State* tolua_S) if (!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i], "ax.DrawNode:drawPoints")) { lua_pop(tolua_S, 1); - CC_SAFE_DELETE_ARRAY(points); + AX_SAFE_DELETE_ARRAY(points); return 0; } lua_pop(tolua_S, 1); @@ -3786,7 +3786,7 @@ tolua_lerror: return 0; } -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION # include "physics3d/CCPhysics3DWorld.h" int lua_axis_Scene_getPhysics3DWorld(lua_State* tolua_S) { @@ -3895,12 +3895,12 @@ static void extendScene(lua_State* tolua_S) lua_rawget(tolua_S, LUA_REGISTRYINDEX); if (lua_istable(tolua_S, -1)) { -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION tolua_function(tolua_S, "getPhysics3DWorld", lua_axis_Scene_getPhysics3DWorld); tolua_function(tolua_S, "setPhysics3DDebugCamera", lua_axis_Scene_setPhysics3DDebugCamera); #endif -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH tolua_function(tolua_S, "setNavMeshDebugCamera", lua_axis_Scene_setNavMeshDebugCamera); tolua_function(tolua_S, "setNavMesh", lua_axis_Scene_setNavMesh); tolua_function(tolua_S, "getNavMesh", lua_axis_Scene_getNavMesh); @@ -4541,7 +4541,7 @@ EventListenerAcceleration* LuaEventListenerAcceleration::create() } else { - CC_SAFE_DELETE(eventAcceleration); + AX_SAFE_DELETE(eventAcceleration); } return eventAcceleration; } @@ -4558,7 +4558,7 @@ EventListenerCustom* LuaEventListenerCustom::create(std::string_view eventName) } else { - CC_SAFE_DELETE(eventCustom); + AX_SAFE_DELETE(eventCustom); } return eventCustom; } @@ -6329,7 +6329,7 @@ int lua_axis_TMXLayer_setTiles(lua_State* tolua_S) cobj->setTiles(arg0); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); lua_settop(tolua_S, 1); return 1; } @@ -6817,7 +6817,7 @@ tolua_lerror: static int lua_collect_Properties(lua_State* tolua_S) { axis::Properties* self = (axis::Properties*)tolua_tousertype(tolua_S, 1, 0); - CC_SAFE_DELETE(self); + AX_SAFE_DELETE(self); return 0; } @@ -6980,7 +6980,7 @@ tolua_lerror: static int lua_collect_PolygonInfo(lua_State* tolua_S) { axis::PolygonInfo* self = (axis::PolygonInfo*)tolua_tousertype(tolua_S, 1, 0); - CC_SAFE_DELETE(self); + AX_SAFE_DELETE(self); return 0; } @@ -7336,7 +7336,7 @@ tolua_lerror: static int lua_collect_AutoPolygon(lua_State* tolua_S) { axis::AutoPolygon* self = (axis::AutoPolygon*)tolua_tousertype(tolua_S, 1, 0); - CC_SAFE_DELETE(self); + AX_SAFE_DELETE(self); return 0; } diff --git a/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp b/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp index bac7b9e1f4..5c613b26e1 100644 --- a/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp +++ b/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp @@ -75,7 +75,7 @@ void CustomGUIReader::init(std::string& className, int createFunc, int setPropsF ObjectFactory* factoryCreate = ObjectFactory::getInstance(); ObjectFactory::TInfo t; t._class = className; - t._func = CC_CALLBACK_0(CustomGUIReader::createInstance, this); + t._func = AX_CALLBACK_0(CustomGUIReader::createInstance, this); factoryCreate->registerType(t); auto guiReader = GUIReader::getInstance(); diff --git a/extensions/scripting/lua-bindings/manual/cocostudio/lua_axis_cocostudio_manual.cpp b/extensions/scripting/lua-bindings/manual/cocostudio/lua_axis_cocostudio_manual.cpp index 6ada683d8a..0eb224f1a9 100644 --- a/extensions/scripting/lua-bindings/manual/cocostudio/lua_axis_cocostudio_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/cocostudio/lua_axis_cocostudio_manual.cpp @@ -276,7 +276,7 @@ static int lua_axis_ArmatureDataManager_addArmatureFileInfoAsyncCallFunc(lua_Sta ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); self->addArmatureFileInfoAsync(configFilePath, wrapper, - CC_SCHEDULE_SELECTOR(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback)); + AX_SCHEDULE_SELECTOR(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback)); return 0; } @@ -302,7 +302,7 @@ static int lua_axis_ArmatureDataManager_addArmatureFileInfoAsyncCallFunc(lua_Sta ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); self->addArmatureFileInfoAsync(imagePath, plistPath, configFilePath, wrapper, - CC_SCHEDULE_SELECTOR(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback)); + AX_SCHEDULE_SELECTOR(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback)); return 0; } diff --git a/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.cpp b/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.cpp index 5d4041c27b..d19c95393e 100644 --- a/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.cpp @@ -25,7 +25,7 @@ ****************************************************************************/ #include "scripting/lua-bindings/manual/controller/lua_axis_controller_manual.hpp" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # include "scripting/lua-bindings/manual/tolua_fix.h" # include "scripting/lua-bindings/manual/LuaBasicConversions.h" @@ -381,4 +381,4 @@ int register_all_axis_controller_manual(lua_State* L) return 0; } -#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#endif //#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) diff --git a/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.hpp b/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.hpp index 5f2d0a692d..a76ca137c3 100644 --- a/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.hpp +++ b/extensions/scripting/lua-bindings/manual/controller/lua_axis_controller_manual.hpp @@ -27,10 +27,10 @@ #include "tolua++.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) TOLUA_API int register_all_axis_controller_manual(lua_State* L); -#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#endif //#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) #endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_CONTROLLER_MANUAL_H diff --git a/extensions/scripting/lua-bindings/manual/lua_module_register.cpp b/extensions/scripting/lua-bindings/manual/lua_module_register.cpp index eaacb1b4c6..1c97a36492 100644 --- a/extensions/scripting/lua-bindings/manual/lua_module_register.cpp +++ b/extensions/scripting/lua-bindings/manual/lua_module_register.cpp @@ -66,10 +66,10 @@ int lua_module_register(lua_State* L) register_spine_module(L); register_cocos3d_module(L); register_audioengine_module(L); -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION register_physics3d_module(L); #endif -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH register_navmesh_module(L); #endif diff --git a/extensions/scripting/lua-bindings/manual/lua_module_register.h b/extensions/scripting/lua-bindings/manual/lua_module_register.h index 2601c1d0c9..be92f7d819 100644 --- a/extensions/scripting/lua-bindings/manual/lua_module_register.h +++ b/extensions/scripting/lua-bindings/manual/lua_module_register.h @@ -28,6 +28,6 @@ #include "lua.h" #include "scripting/lua-bindings/manual/Lua-BindingsExport.h" -CC_LUA_DLL int lua_module_register(lua_State* L); +AX_LUA_DLL int lua_module_register(lua_State* L); #endif // __LUA_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_LUA_MODULE_REGISTER_H__ diff --git a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.cpp b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.cpp index 0110acaddb..803a551977 100644 --- a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.cpp +++ b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.cpp @@ -25,7 +25,7 @@ #include "scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.h" #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "scripting/lua-bindings/manual/LuaBasicConversions.h" # include "navmesh/CCNavMeshAgent.h" diff --git a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.h b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.h index db2a574f36..cadc4143ad 100644 --- a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.h +++ b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_conversions.h @@ -25,7 +25,7 @@ #ifndef __SCRIPTING_LUA_BINDING_MANUAL_NAVMESH_LUA_AXIS_NAVMESH_CONVERSIONS_H__ #define __SCRIPTING_LUA_BINDING_MANUAL_NAVMESH_LUA_AXIS_NAVMESH_CONVERSIONS_H__ -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "scripting/lua-bindings/manual/tolua_fix.h" # include "platform/CCPlatformMacros.h" @@ -47,5 +47,5 @@ extern bool luaval_to_offmeshlinkdata(lua_State* L, extern void navmeshagentparam_to_luaval(lua_State* L, const axis::NavMeshAgentParam& inValue); extern void offmeshlinkdata_to_luaval(lua_State* L, const axis::OffMeshLinkData& inValue); -#endif // #if CC_USE_NAVMESH +#endif // #if AX_USE_NAVMESH #endif // __COCOS_SCRIPTING_LUA_BINDING_MANUAL_NAVMESH_LUA_NAVMESH_CONVERSIONS_H__ diff --git a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.cpp b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.cpp index ad027d2cfd..602d9554b2 100644 --- a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" #include "base/ccConfig.h" -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH # include "scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.h" # include "scripting/lua-bindings/auto/lua_axis_navmesh_auto.hpp" # include "scripting/lua-bindings/manual/tolua_fix.h" diff --git a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.h b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.h index 344be3c703..af664e1120 100644 --- a/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.h +++ b/extensions/scripting/lua-bindings/manual/navmesh/lua_axis_navmesh_manual.h @@ -25,7 +25,7 @@ #ifndef SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_AXIS_NAVMESH_MANUAL_H__ #define SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_AXIS_NAVMESH_MANUAL_H__ -#if CC_USE_NAVMESH +#if AX_USE_NAVMESH #include "tolua++.h" @@ -47,5 +47,5 @@ TOLUA_API int register_navmesh_module(lua_State* L); // end group /// @} -#endif // #if CC_USE_NAVMESH +#endif // #if AX_USE_NAVMESH #endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_COCOS2DX_NAVMESH_MANUAL_H__ diff --git a/extensions/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp b/extensions/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp index 10ddd0a6ad..f163ab04de 100644 --- a/extensions/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp +++ b/extensions/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp @@ -152,7 +152,7 @@ LuaMinXmlHttpRequest::~LuaMinXmlHttpRequest() { _httpHeader.clear(); _requestHeader.clear(); - CC_SAFE_RELEASE_NULL(_httpRequest); + AX_SAFE_RELEASE_NULL(_httpRequest); } /** @@ -714,7 +714,7 @@ static int lua_get_XMLHttpRequest_response(lua_State* L) pStack->pushLuaValueArray(array); - CC_SAFE_DELETE_ARRAY(tmpData); + AX_SAFE_DELETE_ARRAY(tmpData); return 1; } else diff --git a/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.cpp b/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.cpp index 538949c5e2..1f5bb6b830 100644 --- a/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.cpp @@ -25,14 +25,14 @@ #include "scripting/lua-bindings/manual/base/lua_axis_base_manual.hpp" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include "scripting/lua-bindings/manual/tolua_fix.h" # include "scripting/lua-bindings/manual/LuaBasicConversions.h" # include "scripting/lua-bindings/manual/CCLuaValue.h" # include "scripting/lua-bindings/manual/CCLuaEngine.h" # include "2d/CCScene.h" -# ifndef CC_SAFE_DELETE_ARRAY +# ifndef AX_SAFE_DELETE_ARRAY # define do \ { \ if (p) \ @@ -375,11 +375,11 @@ int lua_axis_physics_PhysicsBody_createPolygon(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createPolygon(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -411,11 +411,11 @@ int lua_axis_physics_PhysicsBody_createPolygon(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "ax.PhysicsBody:createPolygon"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createPolygon(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { @@ -450,11 +450,11 @@ int lua_axis_physics_PhysicsBody_createPolygon(lua_State* tolua_S) ok &= luaval_to_vec2(tolua_S, 4, &arg3, "ax.PhysicsBody:createPolygon"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createPolygon(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -509,11 +509,11 @@ int lua_axis_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgePolygon(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -545,11 +545,11 @@ int lua_axis_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "ax.PhysicsBody:createEdgePolygon"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgePolygon(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -583,11 +583,11 @@ int lua_axis_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4, &arg3, "ax.PhysicsBody:createEdgePolygon"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgePolygon(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -642,11 +642,11 @@ int lua_axis_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgeChain(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -678,11 +678,11 @@ int lua_axis_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "ax.PhysicsBody:createEdgeChain"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgeChain(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -716,11 +716,11 @@ int lua_axis_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4, &arg3, "ax.PhysicsBody:createEdgeChain"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsBody* ret = axis::PhysicsBody::createEdgeChain(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -775,12 +775,12 @@ int lua_axis_physics_PhysicsShape_recenterPoints(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShape::recenterPoints(arg0, arg1); vec2_array_to_luaval(tolua_S, arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } @@ -800,12 +800,12 @@ int lua_axis_physics_PhysicsShape_recenterPoints(lua_State* tolua_S) ok &= luaval_to_vec2(tolua_S, 3, &arg2, "ax.PhysicsShape:recenterPoints"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShape::recenterPoints(arg0, arg1, arg2); vec2_array_to_luaval(tolua_S, arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "recenterPoints", argc, 2); @@ -847,11 +847,11 @@ int lua_axis_physics_PhysicsShape_getPolygonCenter(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::Vec2 ret = axis::PhysicsShape::getPolygonCenter(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); vec2_to_luaval(tolua_S, ret); return 1; } @@ -938,7 +938,7 @@ int lua_axis_physics_PhysicsShapePolygon_getPoints(lua_State* tolua_S) axis::Vec2* arg0 = new axis::Vec2[count]; cobj->getPoints(arg0); vec2_array_to_luaval(tolua_S, arg0, count); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getPoints", argc, 1); @@ -983,11 +983,11 @@ int lua_axis_physics_PhysicsShapePolygon_create(lua_State* tolua_S) if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapePolygon* ret = axis::PhysicsShapePolygon::create(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapePolygon", (axis::PhysicsShapePolygon*)ret); return 1; @@ -1008,11 +1008,11 @@ int lua_axis_physics_PhysicsShapePolygon_create(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "ax.PhysicsShapePolygon:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapePolygon* ret = axis::PhysicsShapePolygon::create(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapePolygon", (axis::PhysicsShapePolygon*)ret); return 1; @@ -1035,11 +1035,11 @@ int lua_axis_physics_PhysicsShapePolygon_create(lua_State* tolua_S) ok &= luaval_to_vec2(tolua_S, 4, &arg3, "ax.PhysicsShapePolygon:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapePolygon* ret = axis::PhysicsShapePolygon::create(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapePolygon", (axis::PhysicsShapePolygon*)ret); return 1; @@ -1082,11 +1082,11 @@ int lua_axis_physics_PhysicsShapePolygon_calculateArea(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } double ret = axis::PhysicsShapePolygon::calculateArea(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); tolua_pushnumber(tolua_S, (lua_Number)ret); return 1; } @@ -1130,11 +1130,11 @@ int lua_axis_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg1); + AX_SAFE_DELETE_ARRAY(arg1); return 0; } double ret = axis::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg1); + AX_SAFE_DELETE_ARRAY(arg1); tolua_pushnumber(tolua_S, (lua_Number)ret); return 1; } @@ -1156,11 +1156,11 @@ int lua_axis_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S) ok &= luaval_to_vec2(tolua_S, 4, &arg3, "ax.PhysicsShapePolygon:calculateMoment"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg1); + AX_SAFE_DELETE_ARRAY(arg1); return 0; } double ret = axis::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg1); + AX_SAFE_DELETE_ARRAY(arg1); tolua_pushnumber(tolua_S, (lua_Number)ret); return 1; } @@ -1204,7 +1204,7 @@ int lua_axis_physics_PhysicsShapeEdgeBox_getPoints(lua_State* tolua_S) axis::Vec2* arg0 = new axis::Vec2[count]; cobj->getPoints(arg0); vec2_array_to_luaval(tolua_S, arg0, count); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getPoints", argc, 1); @@ -1250,7 +1250,7 @@ int lua_axis_physics_PhysicsShapeEdgePolygon_getPoints(lua_State* tolua_S) axis::Vec2* arg0 = new axis::Vec2[count]; cobj->getPoints(arg0); vec2_array_to_luaval(tolua_S, arg0, count); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getPoints", argc, 1); @@ -1295,7 +1295,7 @@ int lua_axis_physics_PhysicsShapeEdgeChain_getPoints(lua_State* tolua_S) axis::Vec2* arg0 = new axis::Vec2[count]; cobj->getPoints(arg0); vec2_array_to_luaval(tolua_S, arg0, count); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "getPoints", argc, 1); @@ -1449,11 +1449,11 @@ int lua_axis_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgePolygon* ret = axis::PhysicsShapeEdgePolygon::create(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapeEdgePolygon", (axis::PhysicsShapeEdgePolygon*)ret); return 1; @@ -1474,11 +1474,11 @@ int lua_axis_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "ax.PhysicsShapeEdgePolygon:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgePolygon* ret = axis::PhysicsShapeEdgePolygon::create(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapeEdgePolygon", (axis::PhysicsShapeEdgePolygon*)ret); return 1; @@ -1501,11 +1501,11 @@ int lua_axis_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4, &arg3, "ax.PhysicsShapeEdgePolygon:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgePolygon* ret = axis::PhysicsShapeEdgePolygon::create(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapeEdgePolygon", (axis::PhysicsShapeEdgePolygon*)ret); return 1; @@ -1549,11 +1549,11 @@ int lua_axis_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) } while (0); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgeChain* ret = axis::PhysicsShapeEdgeChain::create(arg0, arg1); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapeEdgeChain", (axis::PhysicsShapeEdgeChain*)ret); return 1; @@ -1574,11 +1574,11 @@ int lua_axis_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2, "ax.PhysicsShapeEdgeChain:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgeChain* ret = axis::PhysicsShapeEdgeChain::create(arg0, arg1, arg2); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapeEdgeChain", (axis::PhysicsShapeEdgeChain*)ret); return 1; @@ -1601,11 +1601,11 @@ int lua_axis_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4, &arg3, "ax.PhysicsShapeEdgeChain:create"); if (!ok) { - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); return 0; } axis::PhysicsShapeEdgeChain* ret = axis::PhysicsShapeEdgeChain::create(arg0, arg1, arg2, arg3); - CC_SAFE_DELETE_ARRAY(arg0); + AX_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "ax.PhysicsShapeEdgeChain", (axis::PhysicsShapeEdgeChain*)ret); return 1; diff --git a/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.hpp b/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.hpp index 1e7f814d9d..73603f7d34 100644 --- a/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.hpp +++ b/extensions/scripting/lua-bindings/manual/physics/lua_axis_physics_manual.hpp @@ -25,7 +25,7 @@ #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_PHYSICS_MANUAL_H #define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_PHYSICS_MANUAL_H -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS #ifdef __cplusplus extern "C" { @@ -40,6 +40,6 @@ extern "C" { int register_all_axis_physics_manual(lua_State* tolua_S); -#endif // CC_USE_PHYSICS +#endif // AX_USE_PHYSICS #endif // #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_PHYSICS_MANUAL_H diff --git a/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.cpp b/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.cpp index 19eb0e5db1..873346690a 100644 --- a/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" #include "base/ccConfig.h" -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION # include "scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.h" # include "scripting/lua-bindings/auto/lua_axis_physics3d_auto.hpp" # include "scripting/lua-bindings/manual/tolua_fix.h" diff --git a/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.h b/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.h index 8a8e3b9383..299002eb72 100644 --- a/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.h +++ b/extensions/scripting/lua-bindings/manual/physics3d/lua_axis_physics3d_manual.h @@ -25,7 +25,7 @@ #ifndef SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_AXIS_PHYSICS3D_MANUAL_H__ #define SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_AXIS_PHYSICS3D_MANUAL_H__ -#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION #include "tolua++.h" @@ -47,5 +47,5 @@ TOLUA_API int register_physics3d_module(lua_State* L); // end group /// @} -#endif // #if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +#endif // #if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION #endif // #ifndef SCRIPTING_LUA_BINDINGS_MANUAL_PHYSICS3D_LUA_AXIS_PHYSICS3D_MANUAL_H__ diff --git a/extensions/scripting/lua-bindings/manual/ui/lua_axis_ui_manual.cpp b/extensions/scripting/lua-bindings/manual/ui/lua_axis_ui_manual.cpp index 152eeda705..861690190f 100644 --- a/extensions/scripting/lua-bindings/manual/ui/lua_axis_ui_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/ui/lua_axis_ui_manual.cpp @@ -24,12 +24,12 @@ ****************************************************************************/ #include "scripting/lua-bindings/manual/ui/lua_axis_ui_manual.hpp" #include "scripting/lua-bindings/auto/lua_axis_ui_auto.hpp" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) && !defined(AX_TARGET_OS_TVOS) # include "scripting/lua-bindings/auto/lua_axis_video_auto.hpp" # include "scripting/lua-bindings/manual/ui/lua_axis_video_manual.hpp" # include "scripting/lua-bindings/auto/lua_axis_webview_auto.hpp" # include "scripting/lua-bindings/manual/ui/lua_axis_webview_manual.hpp" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # if defined(AX_ENABLE_MFMEDIA) # include "scripting/lua-bindings/auto/lua_axis_video_auto.hpp" # include "scripting/lua-bindings/manual/ui/lua_axis_video_manual.hpp" @@ -1243,12 +1243,12 @@ int register_ui_module(lua_State* L) { register_all_axis_ui(L); register_all_axis_ui_manual(L); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) && !defined(AX_TARGET_OS_TVOS) register_all_axis_video(L); register_all_axis_video_manual(L); register_all_axis_webview(L); register_all_axis_webview_manual(L); -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # if defined(AX_ENABLE_MFMEDIA) register_all_axis_video(L); register_all_axis_video_manual(L); diff --git a/extensions/scripting/lua-bindings/script/cocos2d/Cocos2dConstants.lua b/extensions/scripting/lua-bindings/script/cocos2d/Cocos2dConstants.lua index d8ba7cabd2..7b4144746e 100644 --- a/extensions/scripting/lua-bindings/script/cocos2d/Cocos2dConstants.lua +++ b/extensions/scripting/lua-bindings/script/cocos2d/Cocos2dConstants.lua @@ -180,15 +180,15 @@ cc.SHADER_POSITION_TEXTURE_COLOR = 'ShaderPositionTextureColor' cc.SHADER_POSITION_TEXTURE_COLOR_ALPHA_TEST = 'ShaderPositionTextureColorAlphaTest' cc.SHADER_POSITION_TEXTURE_U_COLOR = 'ShaderPositionTexture_uColor' cc.SHADER_POSITION_U_COLOR = 'ShaderPosition_uColor' -cc.UNIFORM_ALPHA_TEST_VALUE_S = 'CC_AlphaValue' -cc.UNIFORM_COS_TIME_S = 'CC_CosTime' -cc.UNIFORM_MV_MATRIX_S = 'CC_MVMatrix' -cc.UNIFORM_MVP_MATRIX_S = 'CC_MVPMatrix' -cc.UNIFORM_P_MATRIX_S = 'CC_PMatrix' -cc.UNIFORM_RANDOM01_S = 'CC_Random01' -cc.UNIFORM_SAMPLER_S = 'CC_Texture0' -cc.UNIFORM_SIN_TIME_S = 'CC_SinTime' -cc.UNIFORM_TIME_S = 'CC_Time' +cc.UNIFORM_ALPHA_TEST_VALUE_S = 'AX_AlphaValue' +cc.UNIFORM_COS_TIME_S = 'AX_CosTime' +cc.UNIFORM_MV_MATRIX_S = 'AX_MVMatrix' +cc.UNIFORM_MVP_MATRIX_S = 'AX_MVPMatrix' +cc.UNIFORM_P_MATRIX_S = 'AX_PMatrix' +cc.UNIFORM_RANDOM01_S = 'AX_Random01' +cc.UNIFORM_SAMPLER_S = 'AX_Texture0' +cc.UNIFORM_SIN_TIME_S = 'AX_SinTime' +cc.UNIFORM_TIME_S = 'AX_Time' cc.PLATFORM_OS_WINDOWS = 0 cc.PLATFORM_OS_LINUX = 1 diff --git a/extensions/scripting/lua-bindings/script/framework/display.lua b/extensions/scripting/lua-bindings/script/framework/display.lua index 014aa0e496..d12666df15 100644 --- a/extensions/scripting/lua-bindings/script/framework/display.lua +++ b/extensions/scripting/lua-bindings/script/framework/display.lua @@ -30,12 +30,12 @@ local view = director:getOpenGLView() if not view then local width = 960 local height = 640 - if CC_DESIGN_RESOLUTION then - if CC_DESIGN_RESOLUTION.width then - width = CC_DESIGN_RESOLUTION.width + if AX_DESIGN_RESOLUTION then + if AX_DESIGN_RESOLUTION.width then + width = AX_DESIGN_RESOLUTION.width end - if CC_DESIGN_RESOLUTION.height then - height = CC_DESIGN_RESOLUTION.height + if AX_DESIGN_RESOLUTION.height then + height = AX_DESIGN_RESOLUTION.height end end view = cc.GLViewImpl:createWithRect("Cocos2d-Lua", cc.rect(0, 0, width, height)) @@ -157,8 +157,8 @@ function display.setAutoScale(configs) setConstants() end -if type(CC_DESIGN_RESOLUTION) == "table" then - display.setAutoScale(CC_DESIGN_RESOLUTION) +if type(AX_DESIGN_RESOLUTION) == "table" then + display.setAutoScale(AX_DESIGN_RESOLUTION) end display.COLOR_WHITE = cc.c3b(255, 255, 255) diff --git a/extensions/scripting/lua-bindings/script/framework/init.lua b/extensions/scripting/lua-bindings/script/framework/init.lua index edf8ca9803..d5a53267fe 100644 --- a/extensions/scripting/lua-bindings/script/framework/init.lua +++ b/extensions/scripting/lua-bindings/script/framework/init.lua @@ -76,6 +76,6 @@ function cc.disable_global() }) end -if CC_DISABLE_GLOBAL then +if AX_DISABLE_GLOBAL then cc.disable_global() end diff --git a/extensions/scripting/lua-bindings/script/init.lua b/extensions/scripting/lua-bindings/script/init.lua index be4a4dc615..842b306222 100644 --- a/extensions/scripting/lua-bindings/script/init.lua +++ b/extensions/scripting/lua-bindings/script/init.lua @@ -106,6 +106,6 @@ require "cocos.cocos2d.bitExtend" -- physics3d require "cocos.physics3d.physics3d-constants" -if CC_USE_FRAMEWORK then +if AX_USE_FRAMEWORK then require "cocos.framework.init" end diff --git a/extensions/spine/SkeletonAnimation.h b/extensions/spine/SkeletonAnimation.h index 6387c20a45..91bb19e182 100644 --- a/extensions/spine/SkeletonAnimation.h +++ b/extensions/spine/SkeletonAnimation.h @@ -58,12 +58,12 @@ public: static SkeletonAnimation* createWithBinaryFile (const std::string& skeletonBinaryFile, const std::string& atlasFile, float scale = 1); // Use createWithJsonFile instead - CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale = 1) + AX_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale = 1) { return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlas, scale); } // Use createWithJsonFile instead - CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale = 1) + AX_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale = 1) { return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlasFile, scale); } diff --git a/extensions/spine/SkeletonBatch.cpp b/extensions/spine/SkeletonBatch.cpp index 9e5bdb395b..531e7b46ac 100644 --- a/extensions/spine/SkeletonBatch.cpp +++ b/extensions/spine/SkeletonBatch.cpp @@ -77,11 +77,11 @@ SkeletonBatch::~SkeletonBatch () { Director::getInstance()->getEventDispatcher()->removeCustomEventListeners(EVENT_AFTER_DRAW_RESET_POSITION); for (unsigned int i = 0; i < _commandsPool.size(); i++) { - CC_SAFE_RELEASE(_commandsPool[i]->getPipelineDescriptor().programState); + AX_SAFE_RELEASE(_commandsPool[i]->getPipelineDescriptor().programState); delete _commandsPool[i]; _commandsPool[i] = nullptr; } - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); } backend::ProgramState* SkeletonBatch::updateCommandPipelinePS(SkeletonCommand* command, backend::ProgramState* programState) @@ -92,7 +92,7 @@ backend::ProgramState* SkeletonBatch::updateCommandPipelinePS(SkeletonCommand* c #else if(currentState == nullptr || currentState->getProgram() != programState->getProgram()) { #endif - CC_SAFE_RELEASE(currentState); + AX_SAFE_RELEASE(currentState); currentState = programState->clone(); auto vertexLayout = currentState->getVertexLayout(); diff --git a/extensions/spine/SkeletonRenderer.cpp b/extensions/spine/SkeletonRenderer.cpp index 9019cb47b0..ecde3e1168 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 CC_USE_CULLING +#if AX_USE_CULLING const axis::Rect bb = computeBoundingRect(worldCoords, coordCount / 2); if (cullRectangle(renderer, transform, bb)) { @@ -851,7 +851,7 @@ bool SkeletonRenderer::getDebugBoundingRectEnabled() const { } void SkeletonRenderer::onEnter () { -#if CC_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 if (_scriptType == kScriptTypeJavascript && ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnEnter)) return; #endif Node::onEnter(); @@ -859,7 +859,7 @@ void SkeletonRenderer::onEnter () { } void SkeletonRenderer::onExit () { -#if CC_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 +#if AX_ENABLE_SCRIPT_BINDING && COCOS2D_VERSION < 0x00040000 if (_scriptType == kScriptTypeJavascript && ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnExit)) return; #endif Node::onExit(); diff --git a/extensions/spine/SkeletonTwoColorBatch.cpp b/extensions/spine/SkeletonTwoColorBatch.cpp index fcdcbc6466..abe9c369c6 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) { - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); _programState = programState; // Because the programState belong to Node, so no need to clone - CC_SAFE_RETAIN(_programState); + AX_SAFE_RETAIN(_programState); needsUpdateStateLayout = true; } } else { needsUpdateStateLayout = _programState != nullptr && _programState->getProgram() != __twoColorProgramState->getProgram(); - CC_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(_programState); _programState = __twoColorProgramState->clone(); } @@ -218,7 +218,7 @@ void TwoColorTrianglesCommand::updateCommandPipelineDescriptor(axis::backend::Pr TwoColorTrianglesCommand::~TwoColorTrianglesCommand() { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); } void TwoColorTrianglesCommand::generateMaterialID() { diff --git a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp index 772a9af1ae..4581fe3358 100644 --- a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp +++ b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp @@ -86,7 +86,7 @@ void CrashTest::onEnter() // After 1.5 second, self will be removed. child->runAction(Sequence::create(DelayTime::create(1.4f), - CallFunc::create(CC_CALLBACK_0(CrashTest::removeThis, this)), nullptr)); + CallFunc::create(AX_CALLBACK_0(CrashTest::removeThis, this)), nullptr)); } void CrashTest::removeThis() @@ -116,7 +116,7 @@ void LogicTest::onEnter() grossini->setPosition(VisibleRect::center()); grossini->runAction(Sequence::create(MoveBy::create(1, Vec2(150.0f, 0.0f)), - CallFuncN::create(CC_CALLBACK_1(LogicTest::bugMe, this)), nullptr)); + CallFuncN::create(AX_CALLBACK_1(LogicTest::bugMe, this)), nullptr)); } void LogicTest::bugMe(Node* node) @@ -160,12 +160,12 @@ void PauseTest::onEnter() auto director = Director::getInstance(); director->getActionManager()->addAction(action, grossini, true); - schedule(CC_SCHEDULE_SELECTOR(PauseTest::unpause), 3); + schedule(AX_SCHEDULE_SELECTOR(PauseTest::unpause), 3); } void PauseTest::unpause(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(PauseTest::unpause)); + unschedule(AX_SCHEDULE_SELECTOR(PauseTest::unpause)); auto node = getChildByTag(kTagGrossini); auto director = Director::getInstance(); director->getActionManager()->resumeTarget(node); @@ -190,7 +190,7 @@ void StopActionTest::onEnter() l->setPosition(VisibleRect::center().x, VisibleRect::top().y - 75); auto pMove = MoveBy::create(2, Vec2(200.0f, 0.0f)); - auto pCallback = CallFunc::create(CC_CALLBACK_0(StopActionTest::stopAction, this)); + auto pCallback = CallFunc::create(AX_CALLBACK_0(StopActionTest::stopAction, this)); auto pSequence = Sequence::create(pMove, pCallback, nullptr); pSequence->setTag(kTagSequence); @@ -290,12 +290,12 @@ void ResumeTest::onEnter() director->getActionManager()->pauseTarget(pGrossini); pGrossini->runAction(RotateBy::create(2, 360)); - this->schedule(CC_SCHEDULE_SELECTOR(ResumeTest::resumeGrossini), 3.0f); + this->schedule(AX_SCHEDULE_SELECTOR(ResumeTest::resumeGrossini), 3.0f); } void ResumeTest::resumeGrossini(float time) { - this->unschedule(CC_SCHEDULE_SELECTOR(ResumeTest::resumeGrossini)); + this->unschedule(AX_SCHEDULE_SELECTOR(ResumeTest::resumeGrossini)); auto pGrossini = getChildByTag(kTagGrossini); auto director = Director::getInstance(); diff --git a/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp b/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp index 8f87c0a626..c5bd488149 100644 --- a/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp +++ b/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp @@ -105,12 +105,12 @@ void SpriteEase::onEnter() auto a = _kathia->runAction(RepeatForever::create(seq3)); a->setTag(1); - schedule(CC_SCHEDULE_SELECTOR(SpriteEase::testStopAction), 6.25f); + schedule(AX_SCHEDULE_SELECTOR(SpriteEase::testStopAction), 6.25f); } void SpriteEase::testStopAction(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(SpriteEase::testStopAction)); + unschedule(AX_SCHEDULE_SELECTOR(SpriteEase::testStopAction)); _tamara->stopActionByTag(1); _kathia->stopActionByTag(1); _grossini->stopActionByTag(1); @@ -922,7 +922,7 @@ void SpeedTest::onEnter() _tamara->runAction(action3); _kathia->runAction(action); - this->schedule(CC_SCHEDULE_SELECTOR(SpeedTest::altertime), 1.0f); //:@selector(altertime:) interval:1.0f]; + this->schedule(AX_SCHEDULE_SELECTOR(SpeedTest::altertime), 1.0f); //:@selector(altertime:) interval:1.0f]; } void SpeedTest::altertime(float dt) diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp index c8a5fefa31..7b1b1415df 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp @@ -740,9 +740,9 @@ void ActionSequence2::onEnter() auto action = Sequence::create( Place::create(Vec2(200.0f, 200.0f)), Show::create(), MoveBy::create(1, Vec2(100.0f, 0.0f)), - CallFunc::create(CC_CALLBACK_0(ActionSequence2::callback1, this)), - CallFunc::create(CC_CALLBACK_0(ActionSequence2::callback2, this, _grossini)), - CallFunc::create(CC_CALLBACK_0(ActionSequence2::callback3, this, _grossini, 0xbebabeba)), nullptr); + CallFunc::create(AX_CALLBACK_0(ActionSequence2::callback1, this)), + CallFunc::create(AX_CALLBACK_0(ActionSequence2::callback2, this, _grossini)), + CallFunc::create(AX_CALLBACK_0(ActionSequence2::callback3, this, _grossini, 0xbebabeba)), nullptr); _grossini->runAction(action); } @@ -822,7 +822,7 @@ void ActionCallFuncN::onEnter() centerSprites(1); auto action = Sequence::create(MoveBy::create(2.0f, Vec2(150.0f, 0.0f)), - CallFuncN::create(CC_CALLBACK_1(ActionCallFuncN::callback, this)), nullptr); + CallFuncN::create(AX_CALLBACK_1(ActionCallFuncN::callback, this)), nullptr); _grossini->runAction(action); } @@ -856,7 +856,7 @@ void ActionCallFuncND::onEnter() auto action = Sequence::create( MoveBy::create(2.0f, Vec2(200.0f, 0.0f)), - CallFuncN::create(CC_CALLBACK_1(ActionCallFuncND::doRemoveFromParentAndCleanup, this, true)), nullptr); + CallFuncN::create(AX_CALLBACK_1(ActionCallFuncND::doRemoveFromParentAndCleanup, this, true)), nullptr); _grossini->runAction(action); } @@ -1371,7 +1371,7 @@ void ActionStacked::onEnter() this->centerSprites(0); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(ActionStacked::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(ActionStacked::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); diff --git a/tests/cpp-tests/Classes/AppDelegate.cpp b/tests/cpp-tests/Classes/AppDelegate.cpp index 666b3b77b3..e3fe4149e3 100644 --- a/tests/cpp-tests/Classes/AppDelegate.cpp +++ b/tests/cpp-tests/Classes/AppDelegate.cpp @@ -86,7 +86,7 @@ bool AppDelegate::applicationDidFinishLaunching() director->setStatsDisplay(true); -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC director->setAnimationInterval(1.0f / glfwGetVideoMode(glfwGetPrimaryMonitor())->refreshRate); #else director->setAnimationInterval(1.0f / 60); diff --git a/tests/cpp-tests/Classes/BaseTest.cpp b/tests/cpp-tests/Classes/BaseTest.cpp index bb5434a283..86e77670a1 100644 --- a/tests/cpp-tests/Classes/BaseTest.cpp +++ b/tests/cpp-tests/Classes/BaseTest.cpp @@ -113,7 +113,7 @@ protected: TestCustomTableView() { auto mouseListener = EventListenerMouse::create(); - mouseListener->onMouseScroll = CC_CALLBACK_1(TestCustomTableView::onMouseScroll, this); + mouseListener->onMouseScroll = AX_CALLBACK_1(TestCustomTableView::onMouseScroll, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(mouseListener, this); } }; @@ -133,7 +133,7 @@ void TestList::deatchTableView() { if (_tableView) _tableView->setDataSource(nullptr); - CC_SAFE_RELEASE_NULL(_tableView); + AX_SAFE_RELEASE_NULL(_tableView); } void TestList::addTest(std::string_view testName, std::function callback) @@ -156,7 +156,7 @@ void TestList::runThisTest() */ GLViewImpl* glview = (GLViewImpl*)Director::getInstance()->getOpenGLView(); -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) Size resourceSize(960, 640); glview->setWindowed(resourceSize.width, resourceSize.height); #endif @@ -421,14 +421,14 @@ bool TestCase::init() addChild(_subtitleLabel, 9999); _subtitleLabel->setPosition(VisibleRect::center().x, VisibleRect::top().y - 60); - _priorTestItem = MenuItemImage::create(s_pathB1, s_pathB2, CC_CALLBACK_1(TestCase::priorTestCallback, this)); + _priorTestItem = MenuItemImage::create(s_pathB1, s_pathB2, AX_CALLBACK_1(TestCase::priorTestCallback, this)); _restartTestItem = - MenuItemImage::create(s_pathR1, s_pathR2, CC_CALLBACK_1(TestCase::restartTestCallback, this)); - _nextTestItem = MenuItemImage::create(s_pathF1, s_pathF2, CC_CALLBACK_1(TestCase::nextTestCallback, this)); + MenuItemImage::create(s_pathR1, s_pathR2, AX_CALLBACK_1(TestCase::restartTestCallback, this)); + _nextTestItem = MenuItemImage::create(s_pathF1, s_pathF2, AX_CALLBACK_1(TestCase::nextTestCallback, this)); ttfConfig.fontSize = 20; auto backLabel = Label::createWithTTF(ttfConfig, "Back"); - auto backItem = MenuItemLabel::create(backLabel, CC_CALLBACK_1(TestCase::onBackCallback, this)); + auto backItem = MenuItemLabel::create(backLabel, AX_CALLBACK_1(TestCase::onBackCallback, this)); auto menu = Menu::create(_priorTestItem, _restartTestItem, _nextTestItem, backItem, nullptr); diff --git a/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.cpp b/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.cpp index 9be5cdae41..b91c240b8c 100644 --- a/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.cpp +++ b/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.cpp @@ -110,7 +110,7 @@ BillBoardTest::BillBoardTest() : _camera(nullptr) { // Create touch listener auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(BillBoardTest::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(BillBoardTest::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto layer3D = Layer::create(); @@ -174,9 +174,9 @@ BillBoardTest::BillBoardTest() : _camera(nullptr) TTFConfig ttfConfig("fonts/arial.ttf", 16); auto label1 = Label::createWithTTF(ttfConfig, "rotate+"); - auto menuItem1 = MenuItemLabel::create(label1, CC_CALLBACK_1(BillBoardTest::rotateCameraCallback, this, 10)); + auto menuItem1 = MenuItemLabel::create(label1, AX_CALLBACK_1(BillBoardTest::rotateCameraCallback, this, 10)); auto label2 = Label::createWithTTF(ttfConfig, "rotate-"); - auto menuItem2 = MenuItemLabel::create(label2, CC_CALLBACK_1(BillBoardTest::rotateCameraCallback, this, -10)); + auto menuItem2 = MenuItemLabel::create(label2, AX_CALLBACK_1(BillBoardTest::rotateCameraCallback, this, -10)); auto menu = Menu::create(menuItem1, menuItem2, nullptr); menu->setPosition(Vec2::ZERO); menuItem1->setPosition(Vec2(s.width - 80, VisibleRect::top().y - 160)); @@ -185,9 +185,9 @@ BillBoardTest::BillBoardTest() : _camera(nullptr) _layerBillBoard->setCameraMask(2); label1 = Label::createWithTTF(ttfConfig, "Point Oriented"); - menuItem1 = MenuItemLabel::create(label1, CC_CALLBACK_1(BillBoardTest::menuCallback_orientedPoint, this)); + menuItem1 = MenuItemLabel::create(label1, AX_CALLBACK_1(BillBoardTest::menuCallback_orientedPoint, this)); label2 = Label::createWithTTF(ttfConfig, "Plane Oriented"); - menuItem2 = MenuItemLabel::create(label2, CC_CALLBACK_1(BillBoardTest::menuCallback_orientedPlane, this)); + menuItem2 = MenuItemLabel::create(label2, AX_CALLBACK_1(BillBoardTest::menuCallback_orientedPlane, this)); menuItem1->setPosition(Vec2(s.width - 80, VisibleRect::top().y - 100)); menuItem2->setPosition(Vec2(s.width - 80, VisibleRect::top().y - 130)); @@ -196,7 +196,7 @@ BillBoardTest::BillBoardTest() : _camera(nullptr) this->addChild(menu, 10); menuCallback_orientedPoint(nullptr); - schedule(CC_SCHEDULE_SELECTOR(BillBoardTest::update)); + schedule(AX_SCHEDULE_SELECTOR(BillBoardTest::update)); } void BillBoardTest::menuCallback_orientedPoint(Ref* sender) diff --git a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp index e4a26ac934..7a01db484a 100644 --- a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp +++ b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp @@ -58,7 +58,7 @@ bool Box2DTest::init() auto dispatcher = Director::getInstance()->getEventDispatcher(); auto touchListener = EventListenerTouchAllAtOnce::create(); - touchListener->onTouchesEnded = CC_CALLBACK_2(Box2DTest::onTouchesEnded, this); + touchListener->onTouchesEnded = AX_CALLBACK_2(Box2DTest::onTouchesEnded, this); dispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); // init physics @@ -88,7 +88,7 @@ bool Box2DTest::init() // menu for debug layer MenuItemFont::setFontSize(18); - auto item = MenuItemFont::create("Toggle debug", CC_CALLBACK_1(Box2DTest::toggleDebugCallback, this)); + auto item = MenuItemFont::create("Toggle debug", AX_CALLBACK_1(Box2DTest::toggleDebugCallback, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -107,7 +107,7 @@ Box2DTest::Box2DTest() : _spriteTexture(nullptr), world(nullptr) {} Box2DTest::~Box2DTest() { - CC_SAFE_DELETE(world); + AX_SAFE_DELETE(world); } void Box2DTest::toggleDebugCallback(Ref* sender) diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp b/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp index 90df124323..373c9c6986 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp +++ b/tests/cpp-tests/Classes/Box2DTestBed/Box2DTestBed.cpp @@ -124,22 +124,22 @@ bool Box2DTestBed::initWithEntryID(int entryId) // Adds touch event listener _touchListener = EventListenerTouchOneByOne::create(); _touchListener->setSwallowTouches(true); - _touchListener->onTouchBegan = CC_CALLBACK_2(Box2DTestBed::onTouchBegan, this); - _touchListener->onTouchMoved = CC_CALLBACK_2(Box2DTestBed::onTouchMoved, this); - _touchListener->onTouchEnded = CC_CALLBACK_2(Box2DTestBed::onTouchEnded, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(Box2DTestBed::onTouchBegan, this); + _touchListener->onTouchMoved = AX_CALLBACK_2(Box2DTestBed::onTouchMoved, this); + _touchListener->onTouchEnded = AX_CALLBACK_2(Box2DTestBed::onTouchEnded, this); TestCase::_eventDispatcher->addEventListenerWithFixedPriority(_touchListener, 10); // Adds Keyboard event listener _keyboardListener = EventListenerKeyboard::create(); - _keyboardListener->onKeyPressed = CC_CALLBACK_2(Box2DTestBed::onKeyPressed, this); - _keyboardListener->onKeyReleased = CC_CALLBACK_2(Box2DTestBed::onKeyReleased, this); + _keyboardListener->onKeyPressed = AX_CALLBACK_2(Box2DTestBed::onKeyPressed, this); + _keyboardListener->onKeyReleased = AX_CALLBACK_2(Box2DTestBed::onKeyReleased, this); TestCase::_eventDispatcher->addEventListenerWithFixedPriority(_keyboardListener, 11); auto _mouseListener = EventListenerMouse::create(); - _mouseListener->onMouseMove = CC_CALLBACK_1(Box2DTestBed::onMouseMove, this); - _mouseListener->onMouseUp = CC_CALLBACK_1(Box2DTestBed::onMouseUp, this); - _mouseListener->onMouseDown = CC_CALLBACK_1(Box2DTestBed::onMouseDown, this); - _mouseListener->onMouseScroll = CC_CALLBACK_1(Box2DTestBed::onMouseScroll, this); + _mouseListener->onMouseMove = AX_CALLBACK_1(Box2DTestBed::onMouseMove, this); + _mouseListener->onMouseUp = AX_CALLBACK_1(Box2DTestBed::onMouseUp, this); + _mouseListener->onMouseDown = AX_CALLBACK_1(Box2DTestBed::onMouseDown, this); + _mouseListener->onMouseScroll = AX_CALLBACK_1(Box2DTestBed::onMouseScroll, this); TestCase::_eventDispatcher->addEventListenerWithFixedPriority(_mouseListener, 12); // Demo messageString @@ -237,7 +237,7 @@ void Box2DTestBed::onEnter() { Scene::onEnter(); ImGuiPresenter::getInstance()->addFont(FileUtils::getInstance()->fullPathForFilename("fonts/arial.ttf")); - ImGuiPresenter::getInstance()->addRenderLoop("#im01", CC_CALLBACK_0(Box2DTestBed::onDrawImGui, this), this); + ImGuiPresenter::getInstance()->addRenderLoop("#im01", AX_CALLBACK_0(Box2DTestBed::onDrawImGui, this), this); } void Box2DTestBed::onExit() { diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp b/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp index 51f47aa572..5ca3c4105d 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp +++ b/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp @@ -27,7 +27,7 @@ USING_NS_AX; USING_NS_AX_EXT; -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) extern axis::Label* labelDebugDraw; #endif @@ -464,7 +464,7 @@ void Test::initShader(void) void Test::DrawString(int x, int y, const char* fmt, ...) { -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) debugString.append(std::string(fmt)); debugString.append("\n"); labelDebugDraw->setString(debugString); @@ -474,7 +474,7 @@ void Test::DrawString(int x, int y, const char* fmt, ...) void Test::DrawString(const b2Vec2& pw, const char* fmt, ...) { -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) debugString.append(std::string(fmt)); debugString.append("\n"); labelDebugDraw->setString(debugString); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp index bc42f7feac..fe3184671b 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp @@ -51,7 +51,7 @@ bool Bug1159Layer::init() addChild(sprite_b); auto label = MenuItemLabel::create(Label::createWithSystemFont("Flip Me", "Helvetica", 24), - CC_CALLBACK_1(Bug1159Layer::callBack, this)); + AX_CALLBACK_1(Bug1159Layer::callBack, this)); auto menu = Menu::create(label, nullptr); menu->setPosition(s.width - 200.0f, 50.0f); addChild(menu); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-14327.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-14327.cpp index 54ba591e62..9bd9a32cb2 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-14327.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-14327.cpp @@ -33,7 +33,7 @@ #include "Bug-14327.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) USING_NS_AX; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-14327.h b/tests/cpp-tests/Classes/BugsTest/Bug-14327.h index 9a19f0effc..6c8e7c7ca0 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-14327.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-14327.h @@ -27,7 +27,7 @@ #include "BugsTest.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "ui/UIEditBox/UIEditBox.h" diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp index bc2d41fed1..6f07a7adb1 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", CC_CALLBACK_1(Bug422Layer::menuCallback, this)); + auto item1 = MenuItemFont::create("One", AX_CALLBACK_1(Bug422Layer::menuCallback, this)); log("MenuItemFont: %p", item1); - MenuItem* item2 = MenuItemFont::create("Two", CC_CALLBACK_1(Bug422Layer::menuCallback, this)); + MenuItem* item2 = MenuItemFont::create("Two", AX_CALLBACK_1(Bug422Layer::menuCallback, this)); auto menu = Menu::create(item1, item2, nullptr); menu->alignItemsVertically(); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp index 9630652967..1a7833fc0b 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp @@ -47,13 +47,13 @@ bool Bug458Layer::init() // [question setContentSize:CGSizeMake(50,50)]; // [question2 setContentSize:CGSizeMake(50,50)]; - auto sprite = MenuItemSprite::create(question2, question, CC_CALLBACK_1(Bug458Layer::selectAnswer, this)); + auto sprite = MenuItemSprite::create(question2, question, AX_CALLBACK_1(Bug458Layer::selectAnswer, this)); auto layer = LayerColor::create(Color4B(0, 0, 255, 255), 100, 100); question->release(); question2->release(); auto layer2 = LayerColor::create(Color4B(255, 0, 0, 255), 100, 100); - auto sprite2 = MenuItemSprite::create(layer, layer2, CC_CALLBACK_1(Bug458Layer::selectAnswer, this)); + auto sprite2 = MenuItemSprite::create(layer, layer2, AX_CALLBACK_1(Bug458Layer::selectAnswer, this)); auto menu = Menu::create(sprite, sprite2, nullptr); menu->alignItemsVerticallyWithPadding(100); menu->setPosition(size.width / 2, size.height / 2); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp index 84d8466c23..7f2906674a 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp @@ -52,10 +52,10 @@ bool Bug624Layer::init() addChild(label); Device::setAccelerometerEnabled(true); - auto listener = EventListenerAcceleration::create(CC_CALLBACK_2(Bug624Layer::onAcceleration, this)); + auto listener = EventListenerAcceleration::create(AX_CALLBACK_2(Bug624Layer::onAcceleration, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); - schedule(CC_SCHEDULE_SELECTOR(Bug624Layer::switchLayer), 5.0f); + schedule(AX_SCHEDULE_SELECTOR(Bug624Layer::switchLayer), 5.0f); return true; } @@ -65,7 +65,7 @@ bool Bug624Layer::init() void Bug624Layer::switchLayer(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(Bug624Layer::switchLayer)); + unschedule(AX_SCHEDULE_SELECTOR(Bug624Layer::switchLayer)); auto scene = Scene::create(); scene->addChild(Bug624Layer2::create(), 0); @@ -98,10 +98,10 @@ bool Bug624Layer2::init() addChild(label); Device::setAccelerometerEnabled(true); - auto listener = EventListenerAcceleration::create(CC_CALLBACK_2(Bug624Layer2::onAcceleration, this)); + auto listener = EventListenerAcceleration::create(AX_CALLBACK_2(Bug624Layer2::onAcceleration, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); - schedule(CC_SCHEDULE_SELECTOR(Bug624Layer2::switchLayer), 5.0f); + schedule(AX_SCHEDULE_SELECTOR(Bug624Layer2::switchLayer), 5.0f); return true; } @@ -111,7 +111,7 @@ bool Bug624Layer2::init() void Bug624Layer2::switchLayer(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(Bug624Layer::switchLayer)); + unschedule(AX_SCHEDULE_SELECTOR(Bug624Layer::switchLayer)); auto scene = Scene::create(); scene->addChild(Bug624Layer::create(), 0); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp index 971785f289..5742affbef 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp @@ -35,8 +35,8 @@ bool Bug914Layer::init() if (BugsTestBase::init()) { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(Bug914Layer::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(Bug914Layer::onTouchesMoved, this); + listener->onTouchesBegan = AX_CALLBACK_2(Bug914Layer::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(Bug914Layer::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // ask director the the window size @@ -54,7 +54,7 @@ bool Bug914Layer::init() // create and initialize a Label auto label = Label::createWithTTF("Hello World", "fonts/Marker Felt.ttf", 64.0f); - auto item1 = MenuItemFont::create("restart", CC_CALLBACK_1(Bug914Layer::restart, this)); + auto item1 = MenuItemFont::create("restart", AX_CALLBACK_1(Bug914Layer::restart, this)); auto menu = Menu::create(item1, nullptr); menu->alignItemsVertically(); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp index dfe20001f0..ccb5a4d67c 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp @@ -41,7 +41,7 @@ bool BugChild::init() auto size = Director::getInstance()->getWinSize(); // create and initialize a Label - auto item1 = MenuItemFont::create("Switch Child", CC_CALLBACK_1(BugChild::switchChild, this)); + auto item1 = MenuItemFont::create("Switch Child", AX_CALLBACK_1(BugChild::switchChild, this)); menu = Menu::create(item1, nullptr); @@ -104,7 +104,7 @@ bool BugCameraMask::init() camera->setCameraFlag(CameraFlag::USER1); addChild(camera); - auto item1 = MenuItemFont::create("Switch Child", CC_CALLBACK_1(BugCameraMask::switchSpriteFlag, this)); + auto item1 = MenuItemFont::create("Switch Child", AX_CALLBACK_1(BugCameraMask::switchSpriteFlag, this)); auto menu = Menu::create(item1, nullptr); diff --git a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp index bae480c537..c056deed95 100644 --- a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp +++ b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp @@ -38,7 +38,7 @@ #include "Bug-15594.h" #include "Bug-15776.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "Bug-14327.h" #endif @@ -62,7 +62,7 @@ BugsTests::BugsTests() // NOTE: comment this out because it currently crashes during autotest // ADD_TEST_CASE(Bug15776Layer); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) ADD_TEST_CASE(Bug14327Layer); #endif } diff --git a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp index c86e6b3345..16e1d38949 100644 --- a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp +++ b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp @@ -147,7 +147,7 @@ CameraRotationTest::CameraRotationTest() Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(_lis, this); - schedule(CC_SCHEDULE_SELECTOR(CameraRotationTest::update)); + schedule(AX_SCHEDULE_SELECTOR(CameraRotationTest::update)); } CameraRotationTest::~CameraRotationTest() @@ -264,9 +264,9 @@ void Camera3DTestDemo::onEnter() _mesh = nullptr; auto s = Director::getInstance()->getWinSize(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(Camera3DTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(Camera3DTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(Camera3DTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(Camera3DTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto layer3D = Layer::create(); addChild(layer3D, 0); @@ -284,8 +284,8 @@ void Camera3DTestDemo::onEnter() auto listener1 = EventListenerTouchOneByOne::create(); listener1->setSwallowTouches(true); - listener1->onTouchBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesZoomOut, this); - listener1->onTouchEnded = CC_CALLBACK_2(Camera3DTestDemo::onTouchesZoomOutEnd, this); + listener1->onTouchBegan = AX_CALLBACK_2(Camera3DTestDemo::onTouchesZoomOut, this); + listener1->onTouchEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesZoomOutEnd, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener1, _ZoomOutlabel); @@ -298,8 +298,8 @@ void Camera3DTestDemo::onEnter() auto listener2 = EventListenerTouchOneByOne::create(); listener2->setSwallowTouches(true); - listener2->onTouchBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesZoomIn, this); - listener2->onTouchEnded = CC_CALLBACK_2(Camera3DTestDemo::onTouchesZoomInEnd, this); + listener2->onTouchBegan = AX_CALLBACK_2(Camera3DTestDemo::onTouchesZoomIn, this); + listener2->onTouchEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesZoomInEnd, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener2, _ZoomInlabel); @@ -312,8 +312,8 @@ void Camera3DTestDemo::onEnter() auto listener3 = EventListenerTouchOneByOne::create(); listener3->setSwallowTouches(true); - listener3->onTouchBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesRotateLeft, this); - listener3->onTouchEnded = CC_CALLBACK_2(Camera3DTestDemo::onTouchesRotateLeftEnd, this); + listener3->onTouchBegan = AX_CALLBACK_2(Camera3DTestDemo::onTouchesRotateLeft, this); + listener3->onTouchEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesRotateLeftEnd, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener3, _RotateLeftlabel); @@ -326,20 +326,20 @@ void Camera3DTestDemo::onEnter() auto listener4 = EventListenerTouchOneByOne::create(); listener4->setSwallowTouches(true); - listener4->onTouchBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesRotateRight, this); - listener4->onTouchEnded = CC_CALLBACK_2(Camera3DTestDemo::onTouchesRotateRightEnd, this); + listener4->onTouchBegan = AX_CALLBACK_2(Camera3DTestDemo::onTouchesRotateRight, this); + listener4->onTouchEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesRotateRightEnd, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener4, _RotateRightlabel); auto label1 = Label::createWithTTF(ttfConfig, "free "); auto menuItem1 = - MenuItemLabel::create(label1, CC_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::Free)); + MenuItemLabel::create(label1, AX_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::Free)); auto label2 = Label::createWithTTF(ttfConfig, "third person"); auto menuItem2 = MenuItemLabel::create( - label2, CC_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::ThirdPerson)); + label2, AX_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::ThirdPerson)); auto label3 = Label::createWithTTF(ttfConfig, "first person"); auto menuItem3 = MenuItemLabel::create( - label3, CC_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::FirstPerson)); + label3, AX_CALLBACK_1(Camera3DTestDemo::SwitchViewCallback, this, CameraType::FirstPerson)); auto menu = Menu::create(menuItem1, menuItem2, menuItem3, nullptr); menu->setPosition(Vec2::ZERO); @@ -348,7 +348,7 @@ void Camera3DTestDemo::onEnter() menuItem2->setPosition(VisibleRect::left().x + 100, VisibleRect::top().y - 100); menuItem3->setPosition(VisibleRect::left().x + 100, VisibleRect::top().y - 150); addChild(menu, 0); - schedule(CC_SCHEDULE_SELECTOR(Camera3DTestDemo::updateCamera), 0.0f); + schedule(AX_SCHEDULE_SELECTOR(Camera3DTestDemo::updateCamera), 0.0f); if (_camera == nullptr) { _camera = Camera::createPerspective(60, (float)s.width / s.height, 1, 1000); @@ -722,13 +722,13 @@ void CameraCullingDemo::onEnter() { CameraBaseTest::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(CameraCullingDemo::update), 0.0f); + schedule(AX_SCHEDULE_SELECTOR(CameraCullingDemo::update), 0.0f); auto s = Director::getInstance()->getWinSize(); /*auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(Camera3DTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(Camera3DTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(Camera3DTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(Camera3DTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(Camera3DTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(Camera3DTestDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);*/ auto layer3D = Layer::create(); addChild(layer3D, 0); @@ -738,7 +738,7 @@ void CameraCullingDemo::onEnter() MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(20); - auto menuItem1 = MenuItemFont::create("Switch Camera", CC_CALLBACK_1(CameraCullingDemo::switchViewCallback, this)); + auto menuItem1 = MenuItemFont::create("Switch Camera", AX_CALLBACK_1(CameraCullingDemo::switchViewCallback, this)); menuItem1->setColor(Color3B(0, 200, 20)); auto menu = Menu::create(menuItem1, NULL); menu->setPosition(Vec2::ZERO); @@ -747,9 +747,9 @@ void CameraCullingDemo::onEnter() // + - MenuItemFont::setFontSize(40); - auto decrease = MenuItemFont::create(" - ", CC_CALLBACK_1(CameraCullingDemo::delMeshCallback, this)); + auto decrease = MenuItemFont::create(" - ", AX_CALLBACK_1(CameraCullingDemo::delMeshCallback, this)); decrease->setColor(Color3B(0, 200, 20)); - auto increase = MenuItemFont::create(" + ", CC_CALLBACK_1(CameraCullingDemo::addMeshCallback, this)); + auto increase = MenuItemFont::create(" + ", AX_CALLBACK_1(CameraCullingDemo::addMeshCallback, this)); increase->setColor(Color3B(0, 200, 20)); menu = Menu::create(decrease, increase, nullptr); @@ -824,7 +824,7 @@ void CameraCullingDemo::reachEndCallBack() _moveAction = inverse; auto rot = RotateBy::create(1.f, Vec3(0.f, 180.f, 0.f)); auto seq = Sequence::create(rot, _moveAction, - CallFunc::create(CC_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr); seq->setTag(100); _cameraFirst->runAction(seq); } @@ -842,7 +842,7 @@ void CameraCullingDemo::switchViewCallback(Ref* sender) _moveAction = MoveTo::create(4.f, Vec2(-_cameraFirst->getPositionX(), 0.0f)); _moveAction->retain(); auto seq = Sequence::create( - _moveAction, CallFunc::create(CC_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr); + _moveAction, CallFunc::create(AX_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr); seq->setTag(100); _cameraFirst->runAction(seq); addChild(_cameraFirst); @@ -1007,10 +1007,10 @@ void CameraArcBallDemo::onEnter() { CameraBaseTest::onEnter(); _rotationQuat.set(0.0f, 0.0f, 0.0f, 1.0f); - schedule(CC_SCHEDULE_SELECTOR(CameraArcBallDemo::update), 0.0f); + schedule(AX_SCHEDULE_SELECTOR(CameraArcBallDemo::update), 0.0f); auto s = Director::getInstance()->getWinSize(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(CameraArcBallDemo::onTouchsMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(CameraArcBallDemo::onTouchsMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // switch camera @@ -1018,10 +1018,10 @@ void CameraArcBallDemo::onEnter() MenuItemFont::setFontSize(20); auto menuItem1 = - MenuItemFont::create("Switch Operation", CC_CALLBACK_1(CameraArcBallDemo::switchOperateCallback, this)); + MenuItemFont::create("Switch Operation", AX_CALLBACK_1(CameraArcBallDemo::switchOperateCallback, this)); menuItem1->setColor(Color3B(0, 200, 20)); auto menuItem2 = - MenuItemFont::create("Switch Target", CC_CALLBACK_1(CameraArcBallDemo::switchTargetCallback, this)); + MenuItemFont::create("Switch Target", AX_CALLBACK_1(CameraArcBallDemo::switchTargetCallback, this)); menuItem2->setColor(Color3B(0, 200, 20)); auto menu = Menu::create(menuItem1, menuItem2, NULL); menu->setPosition(Vec2::ZERO); @@ -1208,8 +1208,8 @@ void CameraArcBallDemo::update(float dt) FogTestDemo::FogTestDemo() : CameraBaseTest() {} FogTestDemo::~FogTestDemo() { - CC_SAFE_RELEASE_NULL(_programState1); - CC_SAFE_RELEASE_NULL(_programState2); + AX_SAFE_RELEASE_NULL(_programState1); + AX_SAFE_RELEASE_NULL(_programState2); } std::string FogTestDemo::title() const @@ -1220,23 +1220,23 @@ std::string FogTestDemo::title() const void FogTestDemo::onEnter() { CameraBaseTest::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(FogTestDemo::update), 0.0f); + schedule(AX_SCHEDULE_SELECTOR(FogTestDemo::update), 0.0f); Director::getInstance()->setClearColor(Color4F(0.5, 0.5, 0.5, 1)); auto s = Director::getInstance()->getWinSize(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(FogTestDemo::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(FogTestDemo::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // switch fog type TTFConfig ttfConfig("fonts/arial.ttf", 20); auto label1 = Label::createWithTTF(ttfConfig, "Linear "); - auto menuItem1 = MenuItemLabel::create(label1, CC_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 0)); + auto menuItem1 = MenuItemLabel::create(label1, AX_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 0)); auto label2 = Label::createWithTTF(ttfConfig, "Exp"); - auto menuItem2 = MenuItemLabel::create(label2, CC_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 1)); + auto menuItem2 = MenuItemLabel::create(label2, AX_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 1)); auto label3 = Label::createWithTTF(ttfConfig, "Exp2"); - auto menuItem3 = MenuItemLabel::create(label3, CC_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 2)); + auto menuItem3 = MenuItemLabel::create(label3, AX_CALLBACK_1(FogTestDemo::switchTypeCallback, this, 2)); auto menu = Menu::create(menuItem1, menuItem2, menuItem3, nullptr); menu->setPosition(Vec2::ZERO); @@ -1250,15 +1250,15 @@ void FogTestDemo::onEnter() addChild(layer3D, 0); _layer3D = layer3D; - CC_SAFE_RELEASE_NULL(_programState1); - CC_SAFE_RELEASE_NULL(_programState2); + AX_SAFE_RELEASE_NULL(_programState1); + AX_SAFE_RELEASE_NULL(_programState2); auto vertexSource = FileUtils::getInstance()->getStringFromFile("MeshRendererTest/fog.vert"); auto fragSource = FileUtils::getInstance()->getStringFromFile("MeshRendererTest/fog.frag"); auto program = backend::Device::getInstance()->newProgram(vertexSource, fragSource); _programState1 = new backend::ProgramState(program); _programState2 = new backend::ProgramState(program); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(program); _mesh1 = MeshRenderer::create("MeshRendererTest/teapot.c3b"); _mesh2 = MeshRenderer::create("MeshRendererTest/teapot.c3b"); @@ -1297,11 +1297,11 @@ void FogTestDemo::onEnter() } _layer3D->setCameraMask(2); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { Director::getInstance()->setClearColor(Color4F(0.5, 0.5, 0.5, 1)); - CC_SAFE_RELEASE_NULL(_programState1); - CC_SAFE_RELEASE_NULL(_programState2); + AX_SAFE_RELEASE_NULL(_programState1); + AX_SAFE_RELEASE_NULL(_programState2); auto vertexSource = FileUtils::getInstance()->getStringFromFile("MeshRendererTest/fog.vert"); auto fragSource = FileUtils::getInstance()->getStringFromFile("MeshRendererTest/fog.frag"); @@ -1311,7 +1311,7 @@ void FogTestDemo::onEnter() _mesh1->setProgramState(_programState1); _mesh2->setProgramState(_programState2); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(program); auto fogColor = Vec4(0.5, 0.5, 0.5, 1.0); float fogStart = 10; @@ -1372,7 +1372,7 @@ void FogTestDemo::onExit() _camera = nullptr; } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } diff --git a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.h b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.h index 223ceeeacf..c8100672c4 100644 --- a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.h +++ b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.h @@ -263,7 +263,7 @@ protected: axis::backend::ProgramState* _programState1 = nullptr; axis::backend::ProgramState* _programState2 = nullptr; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; diff --git a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp index 7c8fdedabe..ec361c00bd 100644 --- a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp +++ b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp @@ -53,11 +53,11 @@ ChipmunkTest::ChipmunkTest() // enable events auto touchListener = EventListenerTouchAllAtOnce::create(); - touchListener->onTouchesEnded = CC_CALLBACK_2(ChipmunkTest::onTouchesEnded, this); + touchListener->onTouchesEnded = AX_CALLBACK_2(ChipmunkTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); Device::setAccelerometerEnabled(true); - auto accListener = EventListenerAcceleration::create(CC_CALLBACK_2(ChipmunkTest::onAcceleration, this)); + auto accListener = EventListenerAcceleration::create(AX_CALLBACK_2(ChipmunkTest::onAcceleration, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(accListener, this); // title @@ -88,7 +88,7 @@ ChipmunkTest::ChipmunkTest() // menu for debug layer MenuItemFont::setFontSize(18); - auto item = MenuItemFont::create("Toggle debug", CC_CALLBACK_1(ChipmunkTest::toggleDebugCallback, this)); + auto item = MenuItemFont::create("Toggle debug", AX_CALLBACK_1(ChipmunkTest::toggleDebugCallback, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -110,7 +110,7 @@ ChipmunkTest::~ChipmunkTest() cpShapeFree(_walls[i]); } -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 cpSpaceFree(_space); #else cpHastySpaceFree(_space); @@ -125,7 +125,7 @@ void ChipmunkTest::initPhysics() // init chipmunk // cpInitChipmunk(); -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 _space = cpSpaceNew(); #else _space = cpHastySpaceNew(); @@ -179,7 +179,7 @@ void ChipmunkTest::update(float delta) for (int i = 0; i < steps; i++) { -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 cpSpaceStep(_space, dt); #else cpHastySpaceStep(_space, dt); @@ -189,7 +189,7 @@ void ChipmunkTest::update(float delta) void ChipmunkTest::createResetButton() { - auto reset = MenuItemImage::create("Images/r1.png", "Images/r2.png", CC_CALLBACK_1(ChipmunkTest::reset, this)); + auto reset = MenuItemImage::create("Images/r1.png", "Images/r2.png", AX_CALLBACK_1(ChipmunkTest::reset, this)); auto menu = Menu::create(reset, nullptr); diff --git a/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp b/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp index 402d0844e5..103b0ffeb8 100644 --- a/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp +++ b/tests/cpp-tests/Classes/ChipmunkTestBed/ChipmunkTestBed.cpp @@ -118,7 +118,7 @@ void ChipmunkDebugDrawCircle(cpVect pos, cpSpaceDebugColor fillColor) { - drawCP->drawCircle(Vec2(pos.x, pos.y) + physicsDebugNodeOffset, 100, CC_DEGREES_TO_RADIANS(90), 50, true, 1.0f, + drawCP->drawCircle(Vec2(pos.x, pos.y) + physicsDebugNodeOffset, 100, AX_DEGREES_TO_RADIANS(90), 50, true, 1.0f, 2.0f, Color4F(fillColor.r, fillColor.g, fillColor.b, fillColor.a)); } @@ -339,9 +339,9 @@ ChipmunkTestBed::ChipmunkTestBed() // creating a mouse event listener _mouseListener = EventListenerMouse::create(); - _mouseListener->onMouseMove = CC_CALLBACK_1(ChipmunkTestBed::onMouseMove, this); - _mouseListener->onMouseUp = CC_CALLBACK_1(ChipmunkTestBed::onMouseUp, this); - _mouseListener->onMouseDown = CC_CALLBACK_1(ChipmunkTestBed::onMouseDown, this); + _mouseListener->onMouseMove = AX_CALLBACK_1(ChipmunkTestBed::onMouseMove, this); + _mouseListener->onMouseUp = AX_CALLBACK_1(ChipmunkTestBed::onMouseUp, this); + _mouseListener->onMouseDown = AX_CALLBACK_1(ChipmunkTestBed::onMouseDown, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(_mouseListener, this); // Some info text @@ -394,7 +394,7 @@ void ChipmunkTestBed::initPhysics() void ChipmunkTestBed::update(float delta) { - //#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + //#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 // cpSpaceStep(_space, delta); //#else // cpHastySpaceStep(_space, delta); @@ -403,7 +403,7 @@ void ChipmunkTestBed::update(float delta) void ChipmunkTestBed::createResetButton() { - auto reset = MenuItemImage::create("Images/r1.png", "Images/r2.png", CC_CALLBACK_1(ChipmunkTestBed::reset, this)); + auto reset = MenuItemImage::create("Images/r1.png", "Images/r2.png", AX_CALLBACK_1(ChipmunkTestBed::reset, this)); auto menu = Menu::create(reset, nullptr); menu->setPosition(VisibleRect::center().x, VisibleRect::bottom().y); this->addChild(menu, -1); diff --git a/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp b/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp index 38190cf496..a5d070819e 100644 --- a/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp +++ b/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp @@ -40,8 +40,8 @@ ClickAndMoveTest::ClickAndMoveTest() ClickAndMoveTestCase::ClickAndMoveTestCase() { auto listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = CC_CALLBACK_2(ClickAndMoveTestCase::onTouchBegan, this); - listener->onTouchEnded = CC_CALLBACK_2(ClickAndMoveTestCase::onTouchEnded, this); + listener->onTouchBegan = AX_CALLBACK_2(ClickAndMoveTestCase::onTouchBegan, this); + listener->onTouchEnded = AX_CALLBACK_2(ClickAndMoveTestCase::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto sprite = Sprite::create(s_pathGrossini); @@ -71,7 +71,7 @@ void ClickAndMoveTestCase::onTouchEnded(Touch* touch, Event* event) s->runAction(MoveTo::create(1, Vec2(location.x, location.y))); float o = location.x - s->getPosition().x; float a = location.y - s->getPosition().y; - float at = (float)CC_RADIANS_TO_DEGREES(atanf(o / a)); + float at = (float)AX_RADIANS_TO_DEGREES(atanf(o / a)); if (a < 0) { diff --git a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp index a09c4b9a57..a8b23be490 100644 --- a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp +++ b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp @@ -342,9 +342,9 @@ void NestedTest::setup() HoleDemo::~HoleDemo() { - CC_SAFE_RELEASE(_outerClipper); - CC_SAFE_RELEASE(_holes); - CC_SAFE_RELEASE(_holesStencil); + AX_SAFE_RELEASE(_outerClipper); + AX_SAFE_RELEASE(_holes); + AX_SAFE_RELEASE(_holesStencil); } std::string HoleDemo::title() const @@ -396,7 +396,7 @@ void HoleDemo::setup() this->addChild(_outerClipper); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(HoleDemo::onTouchesBegan, this); + listener->onTouchesBegan = AX_CALLBACK_2(HoleDemo::onTouchesBegan, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -474,9 +474,9 @@ void ScrollViewDemo::setup() _scrolling = false; auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(ScrollViewDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(ScrollViewDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(ScrollViewDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(ScrollViewDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(ScrollViewDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(ScrollViewDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -583,7 +583,7 @@ void RawStencilBufferTest::initCommands() auto& cmd = _renderCmds[cmdIndex]; cmdIndex++; cmd.init(_globalZOrder, blend); - cmd.setBeforeCallback(CC_CALLBACK_0(RawStencilBufferTest::onBeforeDrawClip, this, i)); + cmd.setBeforeCallback(AX_CALLBACK_0(RawStencilBufferTest::onBeforeDrawClip, this, i)); Vec2 vertices[] = {Vec2::ZERO, Vec2(stencilPoint.x, 0.0f), stencilPoint, Vec2(0.0f, stencilPoint.y)}; unsigned short indices[] = {0, 2, 1, 0, 3, 2}; cmd.createVertexBuffer(sizeof(Vec2), 4, backend::BufferUsage::STATIC); @@ -601,7 +601,7 @@ void RawStencilBufferTest::initCommands() auto& cmd2 = _renderCmds[cmdIndex]; cmdIndex++; cmd2.init(_globalZOrder, blend); - cmd2.setBeforeCallback(CC_CALLBACK_0(RawStencilBufferTest::onBeforeDrawSprite, this, i)); + cmd2.setBeforeCallback(AX_CALLBACK_0(RawStencilBufferTest::onBeforeDrawSprite, this, i)); Vec2 vertices2[] = {Vec2::ZERO, Vec2(winPoint.x, 0.0f), winPoint, Vec2(0.0f, winPoint.y)}; cmd2.createVertexBuffer(sizeof(Vec2), 4, backend::BufferUsage::STATIC); cmd2.updateVertexBuffer(vertices2, sizeof(vertices2)); diff --git a/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp b/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp index 230da0f134..8734ad3543 100644 --- a/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp +++ b/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp @@ -27,7 +27,7 @@ #include "../testResource.h" #include #include -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_WIN32) # include # include # include @@ -145,7 +145,7 @@ void ConsoleUploadFile::uploadFile() hints.ai_flags = 0; hints.ai_protocol = 0; /* Any protocol */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) WSADATA wsaData; WSAStartup(MAKEWORD(2, 2), &wsaData); #endif @@ -177,7 +177,7 @@ void ConsoleUploadFile::uploadFile() if (connect(sfd, rp->ai_addr, rp->ai_addrlen) != -1) break; /* Success */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) closesocket(sfd); #else close(sfd); @@ -246,7 +246,7 @@ void ConsoleUploadFile::uploadFile() // Sleep 1s to wait server to receive all data. std::this_thread::sleep_for(std::chrono::seconds(1)); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) closesocket(sfd); WSACleanup(); #else diff --git a/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.h b/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.h index 503665ec2b..acb93afa81 100644 --- a/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.h +++ b/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.h @@ -55,7 +55,7 @@ protected: axis::Console* _console; private: - CC_DISALLOW_COPY_AND_ASSIGN(ConsoleCustomCommand); + AX_DISALLOW_COPY_AND_ASSIGN(ConsoleCustomCommand); }; class ConsoleUploadFile : public BaseTestConsole @@ -74,7 +74,7 @@ protected: void uploadFile(); private: - CC_DISALLOW_COPY_AND_ASSIGN(ConsoleUploadFile); + AX_DISALLOW_COPY_AND_ASSIGN(ConsoleUploadFile); std::string _targetFileName; }; diff --git a/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp b/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp index 6e150b9e5b..f98c3cd193 100644 --- a/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp +++ b/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp @@ -42,7 +42,7 @@ CurlTest::CurlTest() label->setPosition(VisibleRect::center().x, VisibleRect::top().y - 50); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(CurlTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(CurlTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // create a label to display the tip string diff --git a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp index 477fb6eb23..52da2fb8b2 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, CC_DEGREES_TO_RADIANS(90), 50, true, 1.0f, 2.0f, + draw->drawCircle(VisibleRect::center() + Vec2(140, 0), 100, AX_DEGREES_TO_RADIANS(90), 50, true, 1.0f, 2.0f, Color4F(1.0f, 0.0f, 0.0f, 0.5f)); - draw->drawCircle(VisibleRect::center() - Vec2(140, 0), 50, CC_DEGREES_TO_RADIANS(90), 30, false, + draw->drawCircle(VisibleRect::center() - Vec2(140, 0), 50, AX_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, CC_DEGREES_TO_RADIANS(90), 50, 2.0f, 2.0f, + draw->drawSolidCircle(VisibleRect::center() + Vec2(140.0f, 0.0f), 40, AX_DEGREES_TO_RADIANS(90), 50, 2.0f, 2.0f, Color4F(0.0f, 1.0f, 0.0f, 1.0f)); // Draw segment @@ -222,10 +222,10 @@ Issue11942Test::Issue11942Test() // draw a circle draw->setLineWidth(1); - draw->drawCircle(VisibleRect::center() - Vec2(140.0f, 0.0f), 50, CC_DEGREES_TO_RADIANS(90), 30, false, + draw->drawCircle(VisibleRect::center() - Vec2(140.0f, 0.0f), 50, AX_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, CC_DEGREES_TO_RADIANS(90), 30, false, + draw->drawCircle(VisibleRect::center() + Vec2(140.0f, 0.0f), 50, AX_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 2d3fb4896d..b6fc9eae92 100644 --- a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp +++ b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp @@ -385,7 +385,7 @@ bool EffectBaseTest::init() auto sc2_back = sc2->reverse(); tamara->runAction(RepeatForever::create(Sequence::create(sc2, sc2_back, nullptr))); - schedule(CC_SCHEDULE_SELECTOR(EffectBaseTest::checkAnim)); + schedule(AX_SCHEDULE_SELECTOR(EffectBaseTest::checkAnim)); return true; } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp index 898bb25b72..661ec440b0 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp @@ -77,7 +77,7 @@ bool AssetsManagerExLoaderScene::init() auto downloadLabel = Label::createWithTTF("Start Download", "fonts/arial.ttf", 16); auto downloadItem = - MenuItemLabel::create(downloadLabel, CC_CALLBACK_1(AssetsManagerExLoaderScene::startDownloadCallback, this)); + MenuItemLabel::create(downloadLabel, AX_CALLBACK_1(AssetsManagerExLoaderScene::startDownloadCallback, this)); downloadItem->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y + 100)); _downloadMenu = Menu::create(downloadItem, nullptr); _downloadMenu->setPosition(Vec2::ZERO); diff --git a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp index 5c7feffd64..a1165fb1d8 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 (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM != AX_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 5f9327e680..dc047adafd 100644 --- a/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.cpp +++ b/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.cpp @@ -6,7 +6,7 @@ USING_NS_AX; USING_NS_AX_EXT; -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) static bool show_test_window = true; static bool show_another_window = true; @@ -28,7 +28,7 @@ void ImGuiTest::onEnter() TestCase::onEnter(); ImGuiPresenter::getInstance()->addFont(FileUtils::getInstance()->fullPathForFilename("fonts/arial.ttf")); - ImGuiPresenter::getInstance()->addRenderLoop("#test", CC_CALLBACK_0(ImGuiTest::onDrawImGui, this), this); + ImGuiPresenter::getInstance()->addRenderLoop("#test", AX_CALLBACK_0(ImGuiTest::onDrawImGui, this), this); } void ImGuiTest::onExit() diff --git a/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.h b/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.h index 35619b777d..e7963c295b 100644 --- a/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.h +++ b/tests/cpp-tests/Classes/ImGuiTest/ImGuiTest.h @@ -30,7 +30,7 @@ #include "cocos2d.h" #include "../BaseTest.h" -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) DEFINE_TEST_SUITE(ImGuiTests); diff --git a/tests/cpp-tests/Classes/InputTest/MouseTest.cpp b/tests/cpp-tests/Classes/InputTest/MouseTest.cpp index bbea5819c0..acca7e7fed 100644 --- a/tests/cpp-tests/Classes/InputTest/MouseTest.cpp +++ b/tests/cpp-tests/Classes/InputTest/MouseTest.cpp @@ -60,10 +60,10 @@ MouseEventTest::MouseEventTest() addChild(_labelPosition); _mouseListener = EventListenerMouse::create(); - _mouseListener->onMouseMove = CC_CALLBACK_1(MouseEventTest::onMouseMove, this); - _mouseListener->onMouseUp = CC_CALLBACK_1(MouseEventTest::onMouseUp, this); - _mouseListener->onMouseDown = CC_CALLBACK_1(MouseEventTest::onMouseDown, this); - _mouseListener->onMouseScroll = CC_CALLBACK_1(MouseEventTest::onMouseScroll, this); + _mouseListener->onMouseMove = AX_CALLBACK_1(MouseEventTest::onMouseMove, this); + _mouseListener->onMouseUp = AX_CALLBACK_1(MouseEventTest::onMouseUp, this); + _mouseListener->onMouseDown = AX_CALLBACK_1(MouseEventTest::onMouseDown, this); + _mouseListener->onMouseScroll = AX_CALLBACK_1(MouseEventTest::onMouseScroll, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(_mouseListener, this); } diff --git a/tests/cpp-tests/Classes/JNITest/JNITest.cpp b/tests/cpp-tests/Classes/JNITest/JNITest.cpp index c7391063c6..ceeffda90b 100644 --- a/tests/cpp-tests/Classes/JNITest/JNITest.cpp +++ b/tests/cpp-tests/Classes/JNITest/JNITest.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "JNITest.h" @@ -57,28 +57,28 @@ JNITest::JNITest() JniHelper::callStaticVoidMethod(classPath, "voidMethod3", int(4), float(2.5), "JNI is really easy"); bool b1 = JniHelper::callStaticBooleanMethod(classPath, "booleanMethod", int(5)); - CC_ASSERT(b1 == true); + AX_ASSERT(b1 == true); bool b2 = JniHelper::callStaticBooleanMethod(classPath, "booleanMethod", int(-3)); - CC_ASSERT(b2 == false); + AX_ASSERT(b2 == false); int i = JniHelper::callStaticIntMethod(classPath, "intMethod", int(10), int(10)); - CC_ASSERT(i == 20); + AX_ASSERT(i == 20); float f = JniHelper::callStaticFloatMethod(classPath, "floatMethod", float(2.35), float(7.65)); - CC_ASSERT(f == 10.0); + AX_ASSERT(f == 10.0); double d = JniHelper::callStaticDoubleMethod(classPath, "doubleMethod", double(2.5), int(4)); - CC_ASSERT(d == 10.0); + AX_ASSERT(d == 10.0); std::string str = "ABCDEF"; std::string s1 = JniHelper::callStaticStringMethod(classPath, "stringMethod", str, true); - CC_ASSERT(s1 == "FEDCBA"); + AX_ASSERT(s1 == "FEDCBA"); std::string s2 = JniHelper::callStaticStringMethod(classPath, "stringMethod", str, false); - CC_ASSERT(s2 == "ABCDEF"); + AX_ASSERT(s2 == "ABCDEF"); const char* cstr = "XYZ"; std::string s3 = JniHelper::callStaticStringMethod(classPath, "stringMethod", cstr, true); - CC_ASSERT(s3 == "ZYX"); + AX_ASSERT(s3 == "ZYX"); // should not crash for (int i = 0; i < 10000; i++) diff --git a/tests/cpp-tests/Classes/JNITest/JNITest.h b/tests/cpp-tests/Classes/JNITest/JNITest.h index c89cc8f8a6..530065bcb6 100644 --- a/tests/cpp-tests/Classes/JNITest/JNITest.h +++ b/tests/cpp-tests/Classes/JNITest/JNITest.h @@ -25,7 +25,7 @@ #ifndef _JNI_TEST_H_ #define _JNI_TEST_H_ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "cocos2d.h" # include "../BaseTest.h" diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp index b484b50344..b15facf5ab 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp @@ -180,7 +180,7 @@ LabelFNTColorAndOpacity::LabelFNTColorAndOpacity() label2->setPosition(VisibleRect::center()); label3->setPosition(VisibleRect::rightTop()); - schedule(CC_CALLBACK_1(LabelFNTColorAndOpacity::step, this), "step_key"); + schedule(AX_CALLBACK_1(LabelFNTColorAndOpacity::step, this), "step_key"); } void LabelFNTColorAndOpacity::step(float dt) @@ -259,7 +259,7 @@ LabelFNTSpriteActions::LabelFNTSpriteActions() auto lastChar = (Sprite*)label2->getLetter(3); lastChar->runAction(rot_4ever->clone()); - schedule(CC_CALLBACK_1(LabelFNTSpriteActions::step, this), 0.1f, "step_key"); + schedule(AX_CALLBACK_1(LabelFNTSpriteActions::step, this), 0.1f, "step_key"); } void LabelFNTSpriteActions::step(float dt) @@ -473,7 +473,7 @@ LabelFNTandTTFEmpty::LabelFNTandTTFEmpty() addChild(label3, 0, kTagBitmapAtlas3); label3->setPosition(Vec2(s.width / 2, 100.0f)); - schedule(CC_CALLBACK_1(LabelFNTandTTFEmpty::updateStrings, this), 1.0f, "update_strings_key"); + schedule(AX_CALLBACK_1(LabelFNTandTTFEmpty::updateStrings, this), 1.0f, "update_strings_key"); setEmpty = false; } @@ -593,9 +593,9 @@ bool LabelFNTMultiLineAlignment::init() } auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(LabelFNTMultiLineAlignment::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // ask director the the window size @@ -609,11 +609,11 @@ bool LabelFNTMultiLineAlignment::init() MenuItemFont::setFontSize(20); auto longSentences = - MenuItemFont::create("Long Flowing Sentences", CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); + MenuItemFont::create("Long Flowing Sentences", AX_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); auto lineBreaks = MenuItemFont::create("Short Sentences With Intentional Line Breaks", - CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); + AX_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); auto mixed = MenuItemFont::create("Long Sentences Mixed With Intentional Line Breaks", - CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); + AX_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); auto stringMenu = Menu::create(longSentences, lineBreaks, mixed, nullptr); stringMenu->alignItemsVertically(); @@ -627,9 +627,9 @@ bool LabelFNTMultiLineAlignment::init() MenuItemFont::setFontSize(30); - auto left = MenuItemFont::create("Left", CC_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); - auto center = MenuItemFont::create("Center", CC_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); - auto right = MenuItemFont::create("Right", CC_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); + auto left = MenuItemFont::create("Left", AX_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); + auto center = MenuItemFont::create("Center", AX_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); + auto right = MenuItemFont::create("Right", AX_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); auto alignmentMenu = Menu::create(left, center, right, nullptr); alignmentMenu->alignItemsHorizontallyWithPadding(alignmentItemPadding); @@ -1055,9 +1055,9 @@ LabelTTFDynamicAlignment::LabelTTFDynamicAlignment() addChild(_label); auto menu = Menu::create( - MenuItemFont::create("Left", CC_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentLeft, this)), - MenuItemFont::create("Center", CC_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentCenter, this)), - MenuItemFont::create("Right", CC_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentRight, this)), nullptr); + MenuItemFont::create("Left", AX_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentLeft, this)), + MenuItemFont::create("Center", AX_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentCenter, this)), + MenuItemFont::create("Right", AX_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentRight, this)), nullptr); menu->alignItemsHorizontallyWithPadding(20); menu->setPosition(winSize.width / 2, winSize.height * 0.25f); @@ -1376,7 +1376,7 @@ void LabelShadowTest::onEnter() slider->loadProgressBarTexture("cocosui/sliderProgress.png"); slider->setPosition(Vec2(size.width / 2.0f, size.height * 0.15f + slider->getContentSize().height * 2.0f)); slider->setPercent(52); - slider->addEventListener(CC_CALLBACK_2(LabelShadowTest::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(LabelShadowTest::sliderEvent, this)); addChild(slider, 999); auto slider2 = ui::Slider::create(); @@ -1388,7 +1388,7 @@ void LabelShadowTest::onEnter() slider2->setPosition(Vec2(size.width * 0.15f, size.height / 2.0f)); slider2->setRotation(90); slider2->setPercent(52); - slider2->addEventListener(CC_CALLBACK_2(LabelShadowTest::sliderEvent, this)); + slider2->addEventListener(AX_CALLBACK_2(LabelShadowTest::sliderEvent, this)); addChild(slider2, 999); float subtitleY = _subtitleLabel->getPosition().y; @@ -1465,7 +1465,7 @@ LabelCharMapTest::LabelCharMapTest() label2->setPosition(Vec2(10, 200)); label2->setOpacity(32); - schedule(CC_CALLBACK_1(LabelCharMapTest::step, this), "step_key"); + schedule(AX_CALLBACK_1(LabelCharMapTest::step, this), "step_key"); } void LabelCharMapTest::step(float dt) @@ -1513,14 +1513,14 @@ LabelCharMapColorTest::LabelCharMapColorTest() auto fade = FadeOut::create(1.0f); auto fade_in = fade->reverse(); - auto cb = CallFunc::create(CC_CALLBACK_0(LabelCharMapColorTest::actionFinishCallback, this)); + auto cb = CallFunc::create(AX_CALLBACK_0(LabelCharMapColorTest::actionFinishCallback, this)); auto seq = Sequence::create(fade, fade_in, cb, nullptr); auto repeat = RepeatForever::create(seq); label2->runAction(repeat); _time = 0; - schedule(CC_CALLBACK_1(LabelCharMapColorTest::step, this), "step_key"); + schedule(AX_CALLBACK_1(LabelCharMapColorTest::step, this), "step_key"); } void LabelCharMapColorTest::actionFinishCallback() @@ -1661,16 +1661,16 @@ LabelAlignmentTest::LabelAlignmentTest() MenuItemFont::setFontSize(30); auto menu = Menu::create( - MenuItemFont::create("Left", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentLeft, this)), - MenuItemFont::create("Center", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentCenter, this)), - MenuItemFont::create("Right", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentRight, this)), nullptr); + MenuItemFont::create("Left", AX_CALLBACK_1(LabelAlignmentTest::setAlignmentLeft, this)), + MenuItemFont::create("Center", AX_CALLBACK_1(LabelAlignmentTest::setAlignmentCenter, this)), + MenuItemFont::create("Right", AX_CALLBACK_1(LabelAlignmentTest::setAlignmentRight, this)), nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(50.0f, s.height / 2 - 20)); this->addChild(menu); - menu = Menu::create(MenuItemFont::create("Top", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentTop, this)), - MenuItemFont::create("Middle", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentMiddle, this)), - MenuItemFont::create("Bottom", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentBottom, this)), + menu = Menu::create(MenuItemFont::create("Top", AX_CALLBACK_1(LabelAlignmentTest::setAlignmentTop, this)), + MenuItemFont::create("Middle", AX_CALLBACK_1(LabelAlignmentTest::setAlignmentMiddle, this)), + MenuItemFont::create("Bottom", AX_CALLBACK_1(LabelAlignmentTest::setAlignmentBottom, this)), nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(s.width - 50, s.height / 2 - 20)); @@ -1793,7 +1793,7 @@ LabelLineHeightTest::LabelLineHeightTest() slider->loadProgressBarTexture("cocosui/sliderProgress.png"); slider->setPosition(Vec2(size.width / 2.0f, size.height * 0.15f + slider->getContentSize().height * 2.0f)); slider->setPercent(label->getLineHeight()); - slider->addEventListener(CC_CALLBACK_2(LabelLineHeightTest::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(LabelLineHeightTest::sliderEvent, this)); addChild(slider); } @@ -1837,7 +1837,7 @@ LabelAdditionalKerningTest::LabelAdditionalKerningTest() slider->loadProgressBarTexture("cocosui/sliderProgress.png"); slider->setPosition(Vec2(size.width / 2.0f, size.height * 0.15f + slider->getContentSize().height * 2.0f)); slider->setPercent(0); - slider->addEventListener(CC_CALLBACK_2(LabelAdditionalKerningTest::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(LabelAdditionalKerningTest::sliderEvent, this)); addChild(slider); } @@ -2352,16 +2352,16 @@ void LabelLayoutBaseTest::initAlignmentOption(const axis::Size& size) // add text alignment settings MenuItemFont::setFontSize(30); auto menu = Menu::create( - MenuItemFont::create("Left", CC_CALLBACK_1(LabelLayoutBaseTest::setAlignmentLeft, this)), - MenuItemFont::create("Center", CC_CALLBACK_1(LabelLayoutBaseTest::setAlignmentCenter, this)), - MenuItemFont::create("Right", CC_CALLBACK_1(LabelLayoutBaseTest::setAlignmentRight, this)), nullptr); + MenuItemFont::create("Left", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentLeft, this)), + MenuItemFont::create("Center", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentCenter, this)), + MenuItemFont::create("Right", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentRight, this)), nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(50.0f, size.height / 2 - 20)); this->addChild(menu); - menu = Menu::create(MenuItemFont::create("Top", CC_CALLBACK_1(LabelLayoutBaseTest::setAlignmentTop, this)), - MenuItemFont::create("Middle", CC_CALLBACK_1(LabelLayoutBaseTest::setAlignmentMiddle, this)), - MenuItemFont::create("Bottom", CC_CALLBACK_1(LabelLayoutBaseTest::setAlignmentBottom, this)), + menu = Menu::create(MenuItemFont::create("Top", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentTop, this)), + MenuItemFont::create("Middle", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentMiddle, this)), + MenuItemFont::create("Bottom", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentBottom, this)), nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(size.width - 50, size.height / 2 - 20)); @@ -2767,7 +2767,7 @@ void LabelToggleTypeTest::initToggleCheckboxes() float posX = startPosX + BUTTON_WIDTH * i; radioButton->setPosition(Vec2(posX, winSize.height / 2.0f + 70)); radioButton->setScale(1.2f); - radioButton->addEventListener(CC_CALLBACK_2(LabelToggleTypeTest::onChangedRadioButtonSelect, this)); + radioButton->addEventListener(AX_CALLBACK_2(LabelToggleTypeTest::onChangedRadioButtonSelect, this)); radioButton->setTag(i); radioButtonGroup->addRadioButton(radioButton); this->addChild(radioButton); @@ -2913,7 +2913,7 @@ void LabelSystemFontTest::initToggleCheckboxes() float posX = startPosX + BUTTON_WIDTH * i; radioButton->setPosition(Vec2(posX, winSize.height / 2.0f + 70)); radioButton->setScale(1.2f); - radioButton->addEventListener(CC_CALLBACK_2(LabelSystemFontTest::onChangedRadioButtonSelect, this)); + radioButton->addEventListener(AX_CALLBACK_2(LabelSystemFontTest::onChangedRadioButtonSelect, this)); radioButton->setTag(i); radioButtonGroup->addRadioButton(radioButton); this->addChild(radioButton); @@ -3313,7 +3313,7 @@ LabelLocalizationTest::LabelLocalizationTest() float posX = startPosX + BUTTON_WIDTH * i; radioButton->setPosition(Vec2(posX, winSize.height / 2.0f + 70)); radioButton->setScale(1.2f); - radioButton->addEventListener(CC_CALLBACK_2(LabelLocalizationTest::onChangedRadioButtonSelect, this)); + radioButton->addEventListener(AX_CALLBACK_2(LabelLocalizationTest::onChangedRadioButtonSelect, this)); radioButton->setTag(i); radioButtonGroup->addRadioButton(radioButton); this->addChild(radioButton); @@ -3571,7 +3571,7 @@ LabelIssue17902::LabelIssue17902() label->setPosition(center); addChild(label); - scheduleOnce(CC_CALLBACK_0(LabelIssue17902::purgeCachedData, this), 1.0f, "purge_cached_data"); + scheduleOnce(AX_CALLBACK_0(LabelIssue17902::purgeCachedData, this), 1.0f, "purge_cached_data"); } void LabelIssue17902::purgeCachedData() @@ -3606,7 +3606,7 @@ LabelIssue20523::LabelIssue20523() ++_i; _crashingLabel->setString(std::to_string(_i)); }, - 1, CC_REPEAT_FOREVER, 0, "repeat"); + 1, AX_REPEAT_FOREVER, 0, "repeat"); } std::string LabelIssue20523::title() const diff --git a/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp b/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp index 9204a3e344..c3c0026b2c 100644 --- a/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp +++ b/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp @@ -315,9 +315,9 @@ void LayerTest1::onEnter() LayerTest::onEnter(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(LayerTest1::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(LayerTest1::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(LayerTest1::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(LayerTest1::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(LayerTest1::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(LayerTest1::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); @@ -419,7 +419,7 @@ LayerTestBlend::LayerTestBlend() sister1->setPosition(Vec2(s.width * 1 / 3, s.height / 2)); sister2->setPosition(Vec2(s.width * 2 / 3, s.height / 2)); - schedule(CC_SCHEDULE_SELECTOR(LayerTestBlend::newBlend), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(LayerTestBlend::newBlend), 1.0f); } void LayerTestBlend::newBlend(float dt) @@ -460,7 +460,7 @@ LayerGradientTest::LayerGradientTest() addChild(layer1, 0, kTagLayer); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(LayerGradientTest::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(LayerGradientTest::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto label1 = Label::createWithTTF("Compressed Interpolation: Enabled", "fonts/Marker Felt.ttf", 26); @@ -468,7 +468,7 @@ LayerGradientTest::LayerGradientTest() auto item1 = MenuItemLabel::create(label1); auto item2 = MenuItemLabel::create(label2); auto item = - MenuItemToggle::createWithCallback(CC_CALLBACK_1(LayerGradientTest::toggleItem, this), item1, item2, nullptr); + MenuItemToggle::createWithCallback(AX_CALLBACK_1(LayerGradientTest::toggleItem, this), item1, item2, nullptr); auto menu = Menu::create(item, nullptr); addChild(menu); @@ -554,7 +554,7 @@ void LayerIgnoreAnchorPointPos::onEnter() child->setPosition(Vec2(lsize.width / 2, lsize.height / 2)); auto item = - MenuItemFont::create("Toggle ignore anchor point", CC_CALLBACK_1(LayerIgnoreAnchorPointPos::onToggle, this)); + MenuItemFont::create("Toggle ignore anchor point", AX_CALLBACK_1(LayerIgnoreAnchorPointPos::onToggle, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -602,7 +602,7 @@ void LayerIgnoreAnchorPointRot::onEnter() child->setPosition(Vec2(lsize.width / 2, lsize.height / 2)); auto item = - MenuItemFont::create("Toggle ignore anchor point", CC_CALLBACK_1(LayerIgnoreAnchorPointRot::onToggle, this)); + MenuItemFont::create("Toggle ignore anchor point", AX_CALLBACK_1(LayerIgnoreAnchorPointRot::onToggle, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -653,7 +653,7 @@ void LayerIgnoreAnchorPointScale::onEnter() child->setPosition(Vec2(lsize.width / 2, lsize.height / 2)); auto item = - MenuItemFont::create("Toggle ignore anchor point", CC_CALLBACK_1(LayerIgnoreAnchorPointScale::onToggle, this)); + MenuItemFont::create("Toggle ignore anchor point", AX_CALLBACK_1(LayerIgnoreAnchorPointScale::onToggle, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -736,7 +736,7 @@ void LayerBug3162A::onEnter() this->addChild(_layer[0]); - schedule(CC_SCHEDULE_SELECTOR(LayerBug3162A::step), 0.5, CC_REPEAT_FOREVER, 0); + schedule(AX_SCHEDULE_SELECTOR(LayerBug3162A::step), 0.5, AX_REPEAT_FOREVER, 0); } void LayerBug3162A::step(float dt) @@ -782,7 +782,7 @@ void LayerBug3162B::onEnter() _layer[1]->setCascadeColorEnabled(true); _layer[2]->setCascadeColorEnabled(true); - schedule(CC_SCHEDULE_SELECTOR(LayerBug3162B::step), 0.5, CC_REPEAT_FOREVER, 0); + schedule(AX_SCHEDULE_SELECTOR(LayerBug3162B::step), 0.5, AX_REPEAT_FOREVER, 0); } void LayerBug3162B::step(float dt) @@ -862,7 +862,7 @@ axis::ui::Slider* LayerRadialGradientTest::createSlider() slider->loadBarTexture("cocosui/sliderTrack.png"); slider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); slider->loadProgressBarTexture("cocosui/sliderProgress.png"); - slider->addEventListener(CC_CALLBACK_2(LayerRadialGradientTest::sliderCallback, this)); + slider->addEventListener(AX_CALLBACK_2(LayerRadialGradientTest::sliderCallback, this)); slider->setRotation(90); slider->setTag(101); slider->setPercent(50); @@ -980,7 +980,7 @@ axis::ui::ListView* LayerRadialGradientTest::createListView() listview->setCurSelectedIndex(0); listview->setTouchEnabled(true); listview->addEventListener( - (ui::ListView::ccListViewCallback)CC_CALLBACK_2(LayerRadialGradientTest::listviewCallback, this)); + (ui::ListView::ccListViewCallback)AX_CALLBACK_2(LayerRadialGradientTest::listviewCallback, this)); listview->setTag(100); return listview; diff --git a/tests/cpp-tests/Classes/LightTest/LightTest.cpp b/tests/cpp-tests/Classes/LightTest/LightTest.cpp index 268acd7679..a108e668f0 100644 --- a/tests/cpp-tests/Classes/LightTest/LightTest.cpp +++ b/tests/cpp-tests/Classes/LightTest/LightTest.cpp @@ -48,19 +48,19 @@ LightTest::LightTest() : _directionalLight(nullptr), _pointLight(nullptr), _spot _ambientLightLabel = Label::createWithTTF(ttfConfig, "Ambient Light ON"); _ambientLightLabel->retain(); auto menuItem0 = - MenuItemLabel::create(_ambientLightLabel, CC_CALLBACK_1(LightTest::SwitchLight, this, LightType::AMBIENT)); + MenuItemLabel::create(_ambientLightLabel, AX_CALLBACK_1(LightTest::SwitchLight, this, LightType::AMBIENT)); _directionalLightLabel = Label::createWithTTF(ttfConfig, "Directional Light OFF"); _directionalLightLabel->retain(); auto menuItem1 = MenuItemLabel::create(_directionalLightLabel, - CC_CALLBACK_1(LightTest::SwitchLight, this, LightType::DIRECTIONAL)); + AX_CALLBACK_1(LightTest::SwitchLight, this, LightType::DIRECTIONAL)); _pointLightLabel = Label::createWithTTF(ttfConfig, "Point Light OFF"); _pointLightLabel->retain(); auto menuItem2 = - MenuItemLabel::create(_pointLightLabel, CC_CALLBACK_1(LightTest::SwitchLight, this, LightType::POINT)); + MenuItemLabel::create(_pointLightLabel, AX_CALLBACK_1(LightTest::SwitchLight, this, LightType::POINT)); _spotLightLabel = Label::createWithTTF(ttfConfig, "Spot Light OFF"); _spotLightLabel->retain(); auto menuItem3 = - MenuItemLabel::create(_spotLightLabel, CC_CALLBACK_1(LightTest::SwitchLight, this, LightType::SPOT)); + MenuItemLabel::create(_spotLightLabel, AX_CALLBACK_1(LightTest::SwitchLight, this, LightType::SPOT)); auto menu = Menu::create(menuItem0, menuItem1, menuItem2, menuItem3, nullptr); menu->setPosition(Vec2::ZERO); menuItem0->setAnchorPoint(Vec2::ANCHOR_TOP_LEFT); @@ -234,7 +234,7 @@ void LightTest::update(float delta) if (_directionalLight) { - _directionalLight->setRotation3D(Vec3(-45.0, -CC_RADIANS_TO_DEGREES(angleDelta), 0.0f)); + _directionalLight->setRotation3D(Vec3(-45.0, -AX_RADIANS_TO_DEGREES(angleDelta), 0.0f)); } if (_pointLight) diff --git a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp index 57b8685a44..c890335c57 100644 --- a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp +++ b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp @@ -150,10 +150,10 @@ void Material_2DEffects::onEnter() FETCH_CCTIME_LOCATION(meshNoise); FETCH_CCTIME_LOCATION(meshEdgeDetect); - schedule(CC_SCHEDULE_SELECTOR(Material_2DEffects::updateCCTimeUniforms)); + schedule(AX_SCHEDULE_SELECTOR(Material_2DEffects::updateCCTimeUniforms)); // properties is not a "Ref" object - CC_SAFE_DELETE(properties); + AX_SAFE_DELETE(properties); } std::string Material_2DEffects::subtitle() const @@ -195,13 +195,13 @@ bool EffectAutoBindingResolver::resolveAutoBinding(backend::ProgramState* progra if (autoBinding.compare("DYNAMIC_RADIUS") == 0) { auto loc = programState->getUniformLocation(uniform); - programState->setCallbackUniform(loc, CC_CALLBACK_2(EffectAutoBindingResolver::callbackRadius, this)); + programState->setCallbackUniform(loc, AX_CALLBACK_2(EffectAutoBindingResolver::callbackRadius, this)); return true; } else if (autoBinding.compare("OUTLINE_COLOR") == 0) { auto loc = programState->getUniformLocation(uniform); - programState->setCallbackUniform(loc, CC_CALLBACK_2(EffectAutoBindingResolver::callbackColor, this)); + programState->setCallbackUniform(loc, AX_CALLBACK_2(EffectAutoBindingResolver::callbackColor, this)); return true; } return false; @@ -268,9 +268,9 @@ void Material_AutoBindings::onEnter() _noiseProgramState = meshNoise->getProgramState(); _locationTime = _noiseProgramState->getUniformLocation("u_Time"); - schedule(CC_SCHEDULE_SELECTOR(Material_AutoBindings::updateUniformTime)); + schedule(AX_SCHEDULE_SELECTOR(Material_AutoBindings::updateUniformTime)); // properties is not a "Ref" object - CC_SAFE_DELETE(properties); + AX_SAFE_DELETE(properties); } std::string Material_AutoBindings::subtitle() const @@ -308,7 +308,7 @@ void Material_setTechnique::onEnter() auto light2 = DirectionLight::create(Vec3(-1, 1, 0), Color3B::GREEN); addChild(light2); - this->schedule(CC_CALLBACK_1(Material_setTechnique::changeMaterial, this), 1, "cookie"); + this->schedule(AX_CALLBACK_1(Material_setTechnique::changeMaterial, this), 1, "cookie"); _techniqueState = 0; auto rot = RotateBy::create(5, Vec3(30.0f, 60.0f, 270.0f)); diff --git a/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp b/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp index 06b20683d5..49f541b0ce 100644 --- a/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp +++ b/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp @@ -60,10 +60,10 @@ MenuLayerMainMenu::MenuLayerMainMenu() { _touchListener = EventListenerTouchOneByOne::create(); _touchListener->setSwallowTouches(true); - _touchListener->onTouchBegan = CC_CALLBACK_2(MenuLayerMainMenu::touchBegan, this); - _touchListener->onTouchMoved = CC_CALLBACK_2(MenuLayerMainMenu::touchMoved, this); - _touchListener->onTouchEnded = CC_CALLBACK_2(MenuLayerMainMenu::touchEnded, this); - _touchListener->onTouchCancelled = CC_CALLBACK_2(MenuLayerMainMenu::touchCancelled, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(MenuLayerMainMenu::touchBegan, this); + _touchListener->onTouchMoved = AX_CALLBACK_2(MenuLayerMainMenu::touchMoved, this); + _touchListener->onTouchEnded = AX_CALLBACK_2(MenuLayerMainMenu::touchEnded, this); + _touchListener->onTouchCancelled = AX_CALLBACK_2(MenuLayerMainMenu::touchCancelled, this); _eventDispatcher->addEventListenerWithFixedPriority(_touchListener, 1); // Font Item @@ -72,15 +72,15 @@ MenuLayerMainMenu::MenuLayerMainMenu() auto spriteDisabled = Sprite::create(s_MenuItem, Rect(0, 23 * 0, 115, 23)); auto item1 = MenuItemSprite::create(spriteNormal, spriteSelected, spriteDisabled, - CC_CALLBACK_1(MenuLayerMainMenu::menuCallback, this)); + AX_CALLBACK_1(MenuLayerMainMenu::menuCallback, this)); // Image Item auto item2 = - MenuItemImage::create(s_SendScore, s_PressSendScore, CC_CALLBACK_1(MenuLayerMainMenu::menuCallback2, this)); + MenuItemImage::create(s_SendScore, s_PressSendScore, AX_CALLBACK_1(MenuLayerMainMenu::menuCallback2, this)); // Label Item (LabelAtlas) auto labelAtlas = LabelAtlas::create("0123456789", "fonts/labelatlas.png", 16, 24, '.'); - auto item3 = MenuItemLabel::create(labelAtlas, CC_CALLBACK_1(MenuLayerMainMenu::menuCallbackDisabled, this)); + auto item3 = MenuItemLabel::create(labelAtlas, AX_CALLBACK_1(MenuLayerMainMenu::menuCallbackDisabled, this)); item3->setDisabledColor(Color3B(32, 32, 64)); item3->setColor(Color3B(200, 200, 255)); CCLOG("test MenuItem Label getString: %s", item3->getString().data()); @@ -93,7 +93,7 @@ MenuLayerMainMenu::MenuLayerMainMenu() // Label Item (LabelBMFont) auto label = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", "configuration"); - auto item5 = MenuItemLabel::create(label, CC_CALLBACK_1(MenuLayerMainMenu::menuCallbackConfig, this)); + auto item5 = MenuItemLabel::create(label, AX_CALLBACK_1(MenuLayerMainMenu::menuCallbackConfig, this)); // Testing issue #500 item5->setScale(0.8f); @@ -101,13 +101,13 @@ MenuLayerMainMenu::MenuLayerMainMenu() // Events MenuItemFont::setFontName("fonts/Marker Felt.ttf"); // Bugs Item - auto item6 = MenuItemFont::create("Bugs", CC_CALLBACK_1(MenuLayerMainMenu::menuCallbackBugsTest, this)); + auto item6 = MenuItemFont::create("Bugs", AX_CALLBACK_1(MenuLayerMainMenu::menuCallbackBugsTest, this)); // Font Item - auto item7 = MenuItemFont::create("Quit", CC_CALLBACK_1(MenuLayerMainMenu::onQuit, this)); + auto item7 = MenuItemFont::create("Quit", AX_CALLBACK_1(MenuLayerMainMenu::onQuit, this)); auto item8 = MenuItemFont::create("Remove menu item when moving", - CC_CALLBACK_1(MenuLayerMainMenu::menuMovingCallback, this)); + AX_CALLBACK_1(MenuLayerMainMenu::menuMovingCallback, this)); auto color_action = TintBy::create(0.5f, 0, -255, -255); auto color_back = color_action->reverse(); @@ -182,7 +182,7 @@ void MenuLayerMainMenu::menuCallbackDisabled(Ref* sender) { // hijack all touch events for 5 seconds _eventDispatcher->setPriority(_touchListener, -1); - schedule(CC_SCHEDULE_SELECTOR(MenuLayerMainMenu::allowTouches), 5.0f); + schedule(AX_SCHEDULE_SELECTOR(MenuLayerMainMenu::allowTouches), 5.0f); log("TOUCHES DISABLED FOR 5 SECONDS"); } @@ -216,11 +216,11 @@ MenuLayer2::MenuLayer2() { for (int i = 0; i < 2; i++) { - auto item1 = MenuItemImage::create(s_PlayNormal, s_PlaySelect, CC_CALLBACK_1(MenuLayer2::menuCallback, this)); + auto item1 = MenuItemImage::create(s_PlayNormal, s_PlaySelect, AX_CALLBACK_1(MenuLayer2::menuCallback, this)); auto item2 = - MenuItemImage::create(s_HighNormal, s_HighSelect, CC_CALLBACK_1(MenuLayer2::menuCallbackOpacity, this)); + MenuItemImage::create(s_HighNormal, s_HighSelect, AX_CALLBACK_1(MenuLayer2::menuCallbackOpacity, this)); auto item3 = - MenuItemImage::create(s_AboutNormal, s_AboutSelect, CC_CALLBACK_1(MenuLayer2::menuCallbackAlign, this)); + MenuItemImage::create(s_AboutNormal, s_AboutSelect, AX_CALLBACK_1(MenuLayer2::menuCallbackAlign, this)); item1->setScaleX(1.5f); item2->setScaleX(0.5f); @@ -387,7 +387,7 @@ MenuLayer4::MenuLayer4() title1->setEnabled(false); MenuItemFont::setFontName("fonts/Marker Felt.ttf"); MenuItemFont::setFontSize(34); - auto item1 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), + auto item1 = MenuItemToggle::createWithCallback(AX_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create("On"), MenuItemFont::create("Off"), nullptr); MenuItemFont::setFontName("American Typewriter"); @@ -396,7 +396,7 @@ MenuLayer4::MenuLayer4() title2->setEnabled(false); MenuItemFont::setFontName("fonts/Marker Felt.ttf"); MenuItemFont::setFontSize(34); - auto item2 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), + auto item2 = MenuItemToggle::createWithCallback(AX_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create("On"), MenuItemFont::create("Off"), nullptr); MenuItemFont::setFontName("American Typewriter"); @@ -405,7 +405,7 @@ MenuLayer4::MenuLayer4() title3->setEnabled(false); MenuItemFont::setFontName("fonts/Marker Felt.ttf"); MenuItemFont::setFontSize(34); - auto item3 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), + auto item3 = MenuItemToggle::createWithCallback(AX_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create("High"), MenuItemFont::create("Low"), nullptr); MenuItemFont::setFontName("American Typewriter"); @@ -414,7 +414,7 @@ MenuLayer4::MenuLayer4() title4->setEnabled(false); MenuItemFont::setFontName("fonts/Marker Felt.ttf"); MenuItemFont::setFontSize(34); - auto item4 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), + auto item4 = MenuItemToggle::createWithCallback(AX_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create("Off"), nullptr); // TIP: you can manipulate the items like any other MutableArray @@ -429,7 +429,7 @@ MenuLayer4::MenuLayer4() MenuItemFont::setFontSize(34); auto label = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", "go back"); - auto back = MenuItemLabel::create(label, CC_CALLBACK_1(MenuLayer4::backCallback, this)); + auto back = MenuItemLabel::create(label, AX_CALLBACK_1(MenuLayer4::backCallback, this)); auto menu = Menu::create(title1, title2, item1, item2, title3, title4, item3, item4, back, nullptr); // 9 items. @@ -457,9 +457,9 @@ void MenuLayer4::backCallback(Ref* sender) // BugsTest BugsTest::BugsTest() { - auto issue1410 = MenuItemFont::create("Issue 1410", CC_CALLBACK_1(BugsTest::issue1410MenuCallback, this)); - auto issue1410_2 = MenuItemFont::create("Issue 1410 #2", CC_CALLBACK_1(BugsTest::issue1410v2MenuCallback, this)); - auto back = MenuItemFont::create("Back", CC_CALLBACK_1(BugsTest::backMenuCallback, this)); + auto issue1410 = MenuItemFont::create("Issue 1410", AX_CALLBACK_1(BugsTest::issue1410MenuCallback, this)); + auto issue1410_2 = MenuItemFont::create("Issue 1410 #2", AX_CALLBACK_1(BugsTest::issue1410v2MenuCallback, this)); + auto back = MenuItemFont::create("Back", AX_CALLBACK_1(BugsTest::backMenuCallback, this)); auto menu = Menu::create(issue1410, issue1410_2, back, nullptr); addChild(menu); @@ -503,7 +503,7 @@ RemoveMenuItemWhenMove::RemoveMenuItemWhenMove() item = MenuItemFont::create("item 1"); item->retain(); - auto back = MenuItemFont::create("go back", CC_CALLBACK_1(RemoveMenuItemWhenMove::goBack, this)); + auto back = MenuItemFont::create("go back", AX_CALLBACK_1(RemoveMenuItemWhenMove::goBack, this)); auto menu = Menu::create(item, back, nullptr); addChild(menu); @@ -515,8 +515,8 @@ RemoveMenuItemWhenMove::RemoveMenuItemWhenMove() _touchListener = EventListenerTouchOneByOne::create(); _touchListener->setSwallowTouches(false); - _touchListener->onTouchBegan = CC_CALLBACK_2(RemoveMenuItemWhenMove::onTouchBegan, this); - _touchListener->onTouchMoved = CC_CALLBACK_2(RemoveMenuItemWhenMove::onTouchMoved, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(RemoveMenuItemWhenMove::onTouchBegan, this); + _touchListener->onTouchMoved = AX_CALLBACK_2(RemoveMenuItemWhenMove::onTouchMoved, this); _eventDispatcher->addEventListenerWithFixedPriority(_touchListener, -129); } @@ -529,7 +529,7 @@ void RemoveMenuItemWhenMove::goBack(Ref* pSender) RemoveMenuItemWhenMove::~RemoveMenuItemWhenMove() { _eventDispatcher->removeEventListener(_touchListener); - CC_SAFE_RELEASE(item); + AX_SAFE_RELEASE(item); } bool RemoveMenuItemWhenMove::onTouchBegan(Touch* touch, Event* event) diff --git a/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.cpp b/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.cpp index 8a4964a36f..9355b455b7 100644 --- a/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.cpp +++ b/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.cpp @@ -34,8 +34,8 @@ DrawNode3D::DrawNode3D() DrawNode3D::~DrawNode3D() { - CC_SAFE_RELEASE_NULL(_programStateLine); - CC_SAFE_DELETE(_depthstencilDescriptor); + AX_SAFE_RELEASE_NULL(_programStateLine); + AX_SAFE_DELETE(_depthstencilDescriptor); } DrawNode3D* DrawNode3D::create() @@ -47,7 +47,7 @@ DrawNode3D* DrawNode3D::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -79,8 +79,8 @@ bool DrawNode3D::init() _locMVPMatrix = _programStateLine->getUniformLocation("u_MVPMatrix"); - _customCommand.setBeforeCallback(CC_CALLBACK_0(DrawNode3D::onBeforeDraw, this)); - _customCommand.setAfterCallback(CC_CALLBACK_0(DrawNode3D::onAfterDraw, this)); + _customCommand.setBeforeCallback(AX_CALLBACK_0(DrawNode3D::onBeforeDraw, this)); + _customCommand.setAfterCallback(AX_CALLBACK_0(DrawNode3D::onAfterDraw, this)); auto layout = _programStateLine->getVertexLayout(); #define INITIAL_VERTEX_BUFFER_LENGTH 512 @@ -107,7 +107,7 @@ bool DrawNode3D::init() CustomCommand::BufferUsage::DYNAMIC); _isDirty = true; -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // Need to listen the event only when not use batchnode, because it will use VBO auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event) { /** listen the event that coming to foreground on Android */ @@ -152,7 +152,7 @@ void DrawNode3D::updateCommand(axis::Renderer* renderer, const Mat4& transform, blend.sourceRGBBlendFactor = blend.sourceAlphaBlendFactor = _blendFunc.src; blend.destinationRGBBlendFactor = blend.destinationAlphaBlendFactor = _blendFunc.dst; - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _bufferLines.size()); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _bufferLines.size()); } void DrawNode3D::drawLine(const Vec3& from, const Vec3& to, const Color4F& color) diff --git a/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.h b/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.h index df9e7c5102..719f119f6c 100644 --- a/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.h +++ b/tests/cpp-tests/Classes/MeshRendererTest/DrawNode3D.h @@ -105,7 +105,7 @@ protected: std::vector _bufferLines; private: - CC_DISALLOW_COPY_AND_ASSIGN(DrawNode3D); + AX_DISALLOW_COPY_AND_ASSIGN(DrawNode3D); bool _isDirty = true; bool _rendererDepthTestEnabled = true; diff --git a/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.cpp b/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.cpp index 435bb1104d..e9b4638ad4 100644 --- a/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.cpp +++ b/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.cpp @@ -158,7 +158,7 @@ std::string MeshRendererEmptyTest::subtitle() const MeshRendererBasicTest::MeshRendererBasicTest() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererBasicTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererBasicTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -258,9 +258,9 @@ MeshRendererUVAnimationTest::MeshRendererUVAnimationTest() cylinder->setRotation3D(Vec3(-90.0f, 0.0f, 0.0f)); // the callback function update cylinder's texcoord - schedule(CC_SCHEDULE_SELECTOR(MeshRendererUVAnimationTest::cylinderUpdate)); + schedule(AX_SCHEDULE_SELECTOR(MeshRendererUVAnimationTest::cylinderUpdate)); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [=](EventCustom*) { auto mat = MeshMaterial::createWithFilename("MeshRendererTest/UVAnimation.material"); @@ -273,7 +273,7 @@ MeshRendererUVAnimationTest::MeshRendererUVAnimationTest() MeshRendererUVAnimationTest::~MeshRendererUVAnimationTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -324,9 +324,9 @@ MeshRendererFakeShadowTest::MeshRendererFakeShadowTest() Size visibleSize = Director::getInstance()->getVisibleSize(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererFakeShadowTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto layer = Layer::create(); @@ -363,9 +363,9 @@ MeshRendererFakeShadowTest::MeshRendererFakeShadowTest() layer->addChild(_camera); layer->setCameraMask(2); - schedule(CC_SCHEDULE_SELECTOR(MeshRendererFakeShadowTest::updateCamera), 0.0f); + schedule(AX_SCHEDULE_SELECTOR(MeshRendererFakeShadowTest::updateCamera), 0.0f); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { auto mat = MeshMaterial::createWithFilename("MeshRendererTest/FakeShadow.material"); _state = mat->getTechniqueByIndex(0)->getPassByIndex(0)->getProgramState(); @@ -383,7 +383,7 @@ MeshRendererFakeShadowTest::MeshRendererFakeShadowTest() MeshRendererFakeShadowTest::~MeshRendererFakeShadowTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -564,7 +564,7 @@ MeshRendererBasicToonShaderTest::MeshRendererBasicToonShaderTest() addChild(teapot); addChild(_camera); setCameraMask(2); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [=](EventCustom*) { auto mat = MeshMaterial::createWithFilename("MeshRendererTest/BasicToon.material"); _state = mat->getTechniqueByIndex(0)->getPassByIndex(0)->getProgramState(); @@ -576,7 +576,7 @@ MeshRendererBasicToonShaderTest::MeshRendererBasicToonShaderTest() MeshRendererBasicToonShaderTest::~MeshRendererBasicToonShaderTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -620,7 +620,7 @@ MeshRendererLightMapTest::MeshRendererLightMapTest() // create a listener auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(MeshRendererLightMapTest::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(MeshRendererLightMapTest::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } MeshRendererLightMapTest::~MeshRendererLightMapTest() {} @@ -737,9 +737,9 @@ MeshRendererEffectTest::MeshRendererEffectTest() addNewMeshWithCoords(Vec2(s.width / 2, s.height / 2)); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererEffectTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererEffectTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { auto material = MeshMaterial::createWithFilename("MeshRendererTest/outline.material"); material->setTechnique("outline_noneskinned"); @@ -754,7 +754,7 @@ MeshRendererEffectTest::MeshRendererEffectTest() MeshRendererEffectTest::~MeshRendererEffectTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -823,7 +823,7 @@ AsyncLoadMeshRendererTest::AsyncLoadMeshRendererTest() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "AsyncLoad MeshRenderer"); auto item1 = - MenuItemLabel::create(label1, CC_CALLBACK_1(AsyncLoadMeshRendererTest::menuCallback_asyncLoadMesh, this)); + MenuItemLabel::create(label1, AX_CALLBACK_1(AsyncLoadMeshRendererTest::menuCallback_asyncLoadMesh, this)); auto s = Director::getInstance()->getWinSize(); item1->setPosition(s.width * .5f, s.height * .8f); @@ -863,7 +863,7 @@ void AsyncLoadMeshRendererTest::menuCallback_asyncLoadMesh(Ref* sender) int32_t index = 0; for (const auto& path : _paths) { - MeshRenderer::createAsync(path, CC_CALLBACK_2(AsyncLoadMeshRendererTest::asyncLoad_Callback, this), (void*)index++); + MeshRenderer::createAsync(path, AX_CALLBACK_2(AsyncLoadMeshRendererTest::asyncLoad_Callback, this), (void*)index++); } } @@ -881,7 +881,7 @@ void AsyncLoadMeshRendererTest::asyncLoad_Callback(MeshRenderer* mesh, void* par MeshRendererWithSkinTest::MeshRendererWithSkinTest() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererWithSkinTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererWithSkinTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // switch animation quality. In fact, you can set the mesh3d out of frustum to Animate3DQuality::QUALITY_NONE, it @@ -890,7 +890,7 @@ MeshRendererWithSkinTest::MeshRendererWithSkinTest() MenuItemFont::setFontSize(15); _animateQuality = (int)Animate3DQuality::QUALITY_LOW; _menuItem = MenuItemFont::create(getAnimationQualityMessage(), - CC_CALLBACK_1(MeshRendererWithSkinTest::switchAnimationQualityCallback, this)); + AX_CALLBACK_1(MeshRendererWithSkinTest::switchAnimationQualityCallback, this)); _menuItem->setColor(Color3B(0, 200, 20)); auto menu = Menu::create(_menuItem, NULL); menu->setPosition(Vec2::ZERO); @@ -987,13 +987,13 @@ void MeshRendererWithSkinTest::onTouchesEnded(const std::vector& touches MeshRendererWithSkinOutlineTest::MeshRendererWithSkinOutlineTest() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererWithSkinOutlineTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererWithSkinOutlineTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); addNewMeshWithCoords(Vec2(s.width / 2, s.height / 2)); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { auto material = MeshMaterial::createWithFilename("MeshRendererTest/outline.material"); material->setTechnique("outline_skinned"); @@ -1007,7 +1007,7 @@ MeshRendererWithSkinOutlineTest::MeshRendererWithSkinOutlineTest() } MeshRendererWithSkinOutlineTest::~MeshRendererWithSkinOutlineTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -1073,7 +1073,7 @@ Animate3DTest::Animate3DTest() addMeshRenderer(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(Animate3DTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(Animate3DTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); scheduleUpdate(); @@ -1081,9 +1081,9 @@ Animate3DTest::Animate3DTest() Animate3DTest::~Animate3DTest() { - CC_SAFE_RELEASE(_moveAction); - CC_SAFE_RELEASE(_hurt); - CC_SAFE_RELEASE(_swim); + AX_SAFE_RELEASE(_moveAction); + AX_SAFE_RELEASE(_hurt); + AX_SAFE_RELEASE(_swim); } std::string Animate3DTest::title() const @@ -1144,7 +1144,7 @@ void Animate3DTest::addMeshRenderer() _moveAction = MoveTo::create(4.f, Vec2(s.width / 5.f, s.height / 2.f)); _moveAction->retain(); auto seq = - Sequence::create(_moveAction, CallFunc::create(CC_CALLBACK_0(Animate3DTest::reachEndCallBack, this)), nullptr); + Sequence::create(_moveAction, CallFunc::create(AX_CALLBACK_0(Animate3DTest::reachEndCallBack, this)), nullptr); seq->setTag(100); mesh->runAction(seq); } @@ -1159,7 +1159,7 @@ void Animate3DTest::reachEndCallBack() _moveAction = inverse; auto rot = RotateBy::create(1.f, Vec3(0.f, 180.f, 0.f)); auto seq = Sequence::create(rot, _moveAction, - CallFunc::create(CC_CALLBACK_0(Animate3DTest::reachEndCallBack, this)), nullptr); + CallFunc::create(AX_CALLBACK_0(Animate3DTest::reachEndCallBack, this)), nullptr); seq->setTag(100); _mesh->runAction(seq); } @@ -1192,7 +1192,7 @@ void Animate3DTest::onTouchesEnded(const std::vector& touches, Event* ev _mesh->runAction(_hurt); auto delay = DelayTime::create(_hurt->getDuration() - Animate3D::getTransitionTime()); auto seq = Sequence::create( - delay, CallFunc::create(CC_CALLBACK_0(Animate3DTest::renewCallBack, this)), nullptr); + delay, CallFunc::create(AX_CALLBACK_0(Animate3DTest::renewCallBack, this)), nullptr); seq->setTag(101); _mesh->runAction(seq); } @@ -1208,7 +1208,7 @@ AttachmentTest::AttachmentTest() : _hasWeapon(false), _mesh(nullptr) addNewMeshWithCoords(Vec2(s.width / 2, s.height / 2)); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(AttachmentTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(AttachmentTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } std::string AttachmentTest::title() const @@ -1264,19 +1264,19 @@ MeshRendererReskinTest::MeshRendererReskinTest() : _mesh(nullptr) addNewMeshWithCoords(Vec2(s.width / 2, s.height / 2)); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererReskinTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererReskinTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); TTFConfig ttfConfig("fonts/arial.ttf", 20); auto label1 = Label::createWithTTF(ttfConfig, "Hair"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); auto label2 = Label::createWithTTF(ttfConfig, "Glasses"); - auto item2 = MenuItemLabel::create(label2, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item2 = MenuItemLabel::create(label2, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); auto label3 = Label::createWithTTF(ttfConfig, "Coat"); - auto item3 = MenuItemLabel::create(label3, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item3 = MenuItemLabel::create(label3, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); auto label4 = Label::createWithTTF(ttfConfig, "Pants"); - auto item4 = MenuItemLabel::create(label4, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item4 = MenuItemLabel::create(label4, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); auto label5 = Label::createWithTTF(ttfConfig, "Shoes"); - auto item5 = MenuItemLabel::create(label5, CC_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); + auto item5 = MenuItemLabel::create(label5, AX_CALLBACK_1(MeshRendererReskinTest::menuCallback_reSkin, this)); item1->setPosition(Vec2(VisibleRect::left().x + 50, VisibleRect::bottom().y + item1->getContentSize().height * 4)); item2->setPosition(Vec2(VisibleRect::left().x + 50, VisibleRect::bottom().y + item1->getContentSize().height * 5)); item3->setPosition(Vec2(VisibleRect::left().x + 50, VisibleRect::bottom().y + item1->getContentSize().height * 6)); @@ -1383,9 +1383,9 @@ void MeshRendererReskinTest::applyCurSkin() MeshRendererWithOBBPerformanceTest::MeshRendererWithOBBPerformanceTest() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesBegan, this); - listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesEnded, this); - listener->onTouchesMoved = CC_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesMoved, this); + listener->onTouchesBegan = AX_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesBegan, this); + listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesEnded, this); + listener->onTouchesMoved = AX_CALLBACK_2(MeshRendererWithOBBPerformanceTest::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); initDrawBox(); @@ -1393,9 +1393,9 @@ MeshRendererWithOBBPerformanceTest::MeshRendererWithOBBPerformanceTest() addNewMeshWithCoords(Vec2(s.width / 2, s.height / 2)); MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(65); - auto decrease = MenuItemFont::create(" - ", CC_CALLBACK_1(MeshRendererWithOBBPerformanceTest::delOBBCallback, this)); + auto decrease = MenuItemFont::create(" - ", AX_CALLBACK_1(MeshRendererWithOBBPerformanceTest::delOBBCallback, this)); decrease->setColor(Color3B(0, 200, 20)); - auto increase = MenuItemFont::create(" + ", CC_CALLBACK_1(MeshRendererWithOBBPerformanceTest::addOBBCallback, this)); + auto increase = MenuItemFont::create(" + ", AX_CALLBACK_1(MeshRendererWithOBBPerformanceTest::addOBBCallback, this)); increase->setColor(Color3B(0, 200, 20)); auto menu = Menu::create(decrease, increase, nullptr); @@ -1530,7 +1530,7 @@ void MeshRendererWithOBBPerformanceTest::addNewMeshWithCoords(Vec2 p) _moveAction = MoveTo::create(4.f, Vec2(s.width / 5.f, s.height / 2.f)); _moveAction->retain(); auto seq = Sequence::create( - _moveAction, CallFunc::create(CC_CALLBACK_0(MeshRendererWithOBBPerformanceTest::reachEndCallBack, this)), nullptr); + _moveAction, CallFunc::create(AX_CALLBACK_0(MeshRendererWithOBBPerformanceTest::reachEndCallBack, this)), nullptr); seq->setTag(100); mesh->runAction(seq); @@ -1548,7 +1548,7 @@ void MeshRendererWithOBBPerformanceTest::reachEndCallBack() _moveAction = inverse; auto rot = RotateBy::create(1.0f, Vec3(0.f, 180.f, 0.f)); auto seq = Sequence::create(rot, _moveAction, - CallFunc::create(CC_CALLBACK_0(MeshRendererWithOBBPerformanceTest::reachEndCallBack, this)), + CallFunc::create(AX_CALLBACK_0(MeshRendererWithOBBPerformanceTest::reachEndCallBack, this)), nullptr); seq->setTag(100); _mesh->runAction(seq); @@ -1693,7 +1693,7 @@ void MeshRendererMirrorTest::addNewMeshWithCoords(Vec2 p) _mirrorMesh = mesh; } -QuaternionTest::QuaternionTest() : _arcSpeed(CC_DEGREES_TO_RADIANS(90)), _radius(100.f), _accAngle(0.f) +QuaternionTest::QuaternionTest() : _arcSpeed(AX_DEGREES_TO_RADIANS(90)), _radius(100.f), _accAngle(0.f) { auto s = Director::getInstance()->getWinSize(); addNewMeshWithCoords(Vec2(s.width / 2.f, s.height / 2.f)); @@ -1858,9 +1858,9 @@ void UseCaseMeshRenderer::switchCase() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Message"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UseCaseMeshRenderer::menuCallback_Message, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UseCaseMeshRenderer::menuCallback_Message, this)); auto label2 = Label::createWithTTF(ttfConfig, "Message"); - auto item2 = MenuItemLabel::create(label2, CC_CALLBACK_1(UseCaseMeshRenderer::menuCallback_Message, this)); + auto item2 = MenuItemLabel::create(label2, AX_CALLBACK_1(UseCaseMeshRenderer::menuCallback_Message, this)); item1->setPosition(Vec2(s.width * 0.5f - item1->getContentSize().width * 0.5f, s.height * 0.5f - item1->getContentSize().height)); @@ -1902,7 +1902,7 @@ void UseCaseMeshRenderer::update(float delta) if (_caseIdx == 0) { static float accAngle = 0.f; - accAngle += delta * CC_DEGREES_TO_RADIANS(60); + accAngle += delta * AX_DEGREES_TO_RADIANS(60); float radius = 30.f; float x = cosf(accAngle) * radius, z = sinf(accAngle) * radius; @@ -2021,7 +2021,7 @@ MeshRendererCubeMapTest::MeshRendererCubeMapTest() : _textureCube(nullptr), _sky MeshRendererCubeMapTest::~MeshRendererCubeMapTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif @@ -2048,7 +2048,7 @@ void MeshRendererCubeMapTest::addNewMeshWithCoords(Vec2 p) _camera->setCameraFlag(CameraFlag::USER1); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(MeshRendererCubeMapTest::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(MeshRendererCubeMapTest::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // create a teapot @@ -2097,9 +2097,9 @@ void MeshRendererCubeMapTest::addNewMeshWithCoords(Vec2 p) addChild(_camera); setCameraMask(2); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { - CC_SAFE_RELEASE(_textureCube); + AX_SAFE_RELEASE(_textureCube); _textureCube = TextureCube::create("MeshRendererTest/skybox/left.jpg", "MeshRendererTest/skybox/right.jpg", "MeshRendererTest/skybox/top.jpg", "MeshRendererTest/skybox/bottom.jpg", "MeshRendererTest/skybox/front.jpg", "MeshRendererTest/skybox/back.jpg"); @@ -2133,7 +2133,7 @@ void MeshRendererCubeMapTest::onTouchesMoved(const std::vector& touches, auto delta = touch->getDelta(); static float _angle = 0.f; - _angle -= CC_DEGREES_TO_RADIANS(delta.x); + _angle -= AX_DEGREES_TO_RADIANS(delta.x); _camera->setPosition3D(Vec3(50.0f * sinf(_angle), 0.0f, 50.0f * cosf(_angle))); _camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f)); } @@ -2153,7 +2153,7 @@ Issue9767::Issue9767() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "switch shader"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(Issue9767::menuCallback_SwitchShader, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(Issue9767::menuCallback_SwitchShader, this)); item1->setPosition( Vec2(s.width * 0.9f - item1->getContentSize().width * 0.5f, s.height * 0.5f - item1->getContentSize().height)); @@ -2167,7 +2167,7 @@ Issue9767::~Issue9767() {} void Issue9767::menuCallback_SwitchShader(axis::Ref* sender) { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); if (_shaderType == Issue9767::ShaderType::SHADER_TEX) { _shaderType = Issue9767::ShaderType::SHADER_COLOR; @@ -2310,7 +2310,7 @@ MeshRendererVertexColorTest::MeshRendererVertexColorTest() camera->lookAt(Vec3(0.f, 0.f, 0.f)); addChild(camera); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [=](EventCustom*) { auto mat = MeshMaterial::createWithFilename("MeshRendererTest/VertexColor.material"); mesh->setMaterial(mat); @@ -2321,7 +2321,7 @@ MeshRendererVertexColorTest::MeshRendererVertexColorTest() MeshRendererVertexColorTest::~MeshRendererVertexColorTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif } @@ -2340,7 +2340,7 @@ CameraBackgroundClearTest::CameraBackgroundClearTest() { TTFConfig ttfConfig("fonts/arial.ttf", 20); auto label1 = Label::createWithTTF(ttfConfig, "Clear Mode"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(CameraBackgroundClearTest::switch_CameraClearMode, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(CameraBackgroundClearTest::switch_CameraClearMode, this)); item1->setPosition(Vec2(VisibleRect::left().x + 50, VisibleRect::bottom().y + item1->getContentSize().height * 4)); @@ -2553,17 +2553,17 @@ MeshRendererPropertyTest::MeshRendererPropertyTest() setCameraMask(2); // auto listener = EventListenerTouchAllAtOnce::create(); - ////listener->onTouchesEnded = CC_CALLBACK_2(MeshRendererReskinTest::onTouchesEnded, this); + ////listener->onTouchesEnded = AX_CALLBACK_2(MeshRendererReskinTest::onTouchesEnded, this); //_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); TTFConfig ttfConfig("fonts/arial.ttf", 20); auto label1 = Label::createWithTTF(ttfConfig, "Print Mesh Name"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(MeshRendererPropertyTest::printMeshName, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(MeshRendererPropertyTest::printMeshName, this)); auto label2 = Label::createWithTTF(ttfConfig, "Remove Used Texture"); - auto item2 = MenuItemLabel::create(label2, CC_CALLBACK_1(MeshRendererPropertyTest::removeUsedTexture, this)); + auto item2 = MenuItemLabel::create(label2, AX_CALLBACK_1(MeshRendererPropertyTest::removeUsedTexture, this)); auto label3 = Label::createWithTTF(ttfConfig, "Reset"); - auto item3 = MenuItemLabel::create(label3, CC_CALLBACK_1(MeshRendererPropertyTest::resetTexture, this)); + auto item3 = MenuItemLabel::create(label3, AX_CALLBACK_1(MeshRendererPropertyTest::resetTexture, this)); item1->setPosition(Vec2(VisibleRect::left().x + 100, VisibleRect::bottom().y + item1->getContentSize().height * 4)); item2->setPosition(Vec2(VisibleRect::left().x + 100, VisibleRect::bottom().y + item1->getContentSize().height * 5)); diff --git a/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h b/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h index f06cef6c74..5c0ccbb6ee 100644 --- a/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h +++ b/tests/cpp-tests/Classes/MeshRendererTest/MeshRendererTest.h @@ -95,7 +95,7 @@ protected: float _shining_duration; axis::backend::ProgramState* _state = nullptr; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -132,7 +132,7 @@ private: axis::MeshRenderer* _orc; axis::backend::ProgramState* _state = nullptr; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -163,7 +163,7 @@ public: protected: axis::backend::ProgramState* _state; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -193,7 +193,7 @@ public: protected: std::vector _meshes; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -252,7 +252,7 @@ public: protected: std::vector _meshes; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -486,7 +486,7 @@ protected: axis::MeshRenderer* _teapot; axis::Camera* _camera; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; @@ -565,7 +565,7 @@ public: protected: axis::MeshRenderer* _mesh; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) axis::EventListenerCustom* _backToForegroundListener; #endif }; diff --git a/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp b/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp index b3b2bb7df6..a1ba0ab326 100644 --- a/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp +++ b/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp @@ -68,7 +68,7 @@ void MotionStreakTest1::onEnter() _streak = MotionStreak::create(2, 3, 32, Color3B::GREEN, s_streak); addChild(_streak); // schedule an update on each frame so we can synchronize the streak with the target - schedule(CC_SCHEDULE_SELECTOR(MotionStreakTest1::onUpdate)); + schedule(AX_SCHEDULE_SELECTOR(MotionStreakTest1::onUpdate)); auto a1 = RotateBy::create(2, 360); @@ -106,7 +106,7 @@ void MotionStreakTest2::onEnter() MotionStreakTest::onEnter(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(MotionStreakTest2::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(MotionStreakTest2::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -155,7 +155,7 @@ void Issue1358::onEnter() _radius = size.width / 3; _angle = 0.0f; - schedule(CC_SCHEDULE_SELECTOR(Issue1358::update), 0); + schedule(AX_SCHEDULE_SELECTOR(Issue1358::update), 0); } void Issue1358::update(float dt) @@ -206,13 +206,13 @@ void Issue12226::onEnter() std::function updateMotionStreak = [=](float dt) { Vec2 position = - Vec2(outer->getPositionX() + length * cosf(-1 * CC_DEGREES_TO_RADIANS(outer->getRotation() + 90.0f)), - outer->getPositionY() + length * sinf(-1 * CC_DEGREES_TO_RADIANS(outer->getRotation() + 90.0f))); + Vec2(outer->getPositionX() + length * cosf(-1 * AX_DEGREES_TO_RADIANS(outer->getRotation() + 90.0f)), + outer->getPositionY() + length * sinf(-1 * AX_DEGREES_TO_RADIANS(outer->getRotation() + 90.0f))); _streak->setPosition(position); }; - outer->schedule(updateMotionStreak, 1 / 240.0f, CC_REPEAT_FOREVER, 0, "motion1scheduler"); + outer->schedule(updateMotionStreak, 1 / 240.0f, AX_REPEAT_FOREVER, 0, "motion1scheduler"); auto rot = RotateBy::create(2, 360); auto forever = RepeatForever::create(rot); @@ -255,7 +255,7 @@ void MotionStreakTest::onEnter() auto s = Director::getInstance()->getWinSize(); - auto itemMode = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MotionStreakTest::modeCallback, this), + auto itemMode = MenuItemToggle::createWithCallback(AX_CALLBACK_1(MotionStreakTest::modeCallback, this), MenuItemFont::create("Use High Quality Mode"), MenuItemFont::create("Use Fast Mode"), nullptr); diff --git a/tests/cpp-tests/Classes/MultiTouchTest/MultiTouchTest.cpp b/tests/cpp-tests/Classes/MultiTouchTest/MultiTouchTest.cpp index d08cae63bf..7cd9ed6f79 100644 --- a/tests/cpp-tests/Classes/MultiTouchTest/MultiTouchTest.cpp +++ b/tests/cpp-tests/Classes/MultiTouchTest/MultiTouchTest.cpp @@ -63,9 +63,9 @@ bool MultiTouchTest::init() if (TestCase::init()) { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(MultiTouchTest::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(MultiTouchTest::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(MultiTouchTest::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(MultiTouchTest::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(MultiTouchTest::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(MultiTouchTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto title = Label::createWithSystemFont("Please touch the screen!", "", 24); diff --git a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.cpp b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.cpp index 27651c7f13..26976152f6 100644 --- a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.cpp +++ b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.cpp @@ -40,7 +40,7 @@ struct AgentUserData NavMeshTests::NavMeshTests() { -#if (CC_USE_NAVMESH == 0) || (CC_USE_PHYSICS == 0) +#if (AX_USE_NAVMESH == 0) || (AX_USE_PHYSICS == 0) ADD_TEST_CASE(NavMeshDisabled); #else ADD_TEST_CASE(NavMeshBasicTestDemo); @@ -48,12 +48,12 @@ NavMeshTests::NavMeshTests() #endif }; -#if (CC_USE_NAVMESH == 0) || (CC_USE_PHYSICS == 0) +#if (AX_USE_NAVMESH == 0) || (AX_USE_PHYSICS == 0) void NavMeshDisabled::onEnter() { TTFConfig ttfConfig("fonts/arial.ttf", 16); auto label = - Label::createWithTTF(ttfConfig, "Should define CC_USE_NAVMESH & CC_USE_PHYSICS\n to run this test case"); + Label::createWithTTF(ttfConfig, "Should define AX_USE_NAVMESH & AX_USE_PHYSICS\n to run this test case"); auto size = Director::getInstance()->getWinSize(); label->setPosition(Vec2(size.width / 2, size.height / 2)); @@ -93,9 +93,9 @@ bool NavMeshBaseTestDemo::init() this->addChild(_camera); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(NavMeshBaseTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(NavMeshBaseTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(NavMeshBaseTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(NavMeshBaseTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(NavMeshBaseTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(NavMeshBaseTestDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); initScene(); @@ -118,7 +118,7 @@ void NavMeshBaseTestDemo::onTouchesMoved(const std::vector& touche auto touch = touches[0]; auto delta = touch->getDelta(); - _angle -= CC_DEGREES_TO_RADIANS(delta.x); + _angle -= AX_DEGREES_TO_RADIANS(delta.x); _camera->setPosition3D(Vec3(100.0f * sinf(_angle), 50.0f, 100.0f * cosf(_angle))); _camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f)); diff --git a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h index 83f138ee4d..5bcfcb28ae 100644 --- a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h +++ b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h @@ -32,7 +32,7 @@ DEFINE_TEST_SUITE(NavMeshTests); -#if (CC_USE_NAVMESH == 0) || (CC_USE_PHYSICS == 0) +#if (AX_USE_NAVMESH == 0) || (AX_USE_PHYSICS == 0) class NavMeshDisabled : public TestCase { public: diff --git a/tests/cpp-tests/Classes/NetworkTest/DownloaderTest/DownloaderTest.cpp b/tests/cpp-tests/Classes/NetworkTest/DownloaderTest/DownloaderTest.cpp index 794599a07d..32a5f8e236 100644 --- a/tests/cpp-tests/Classes/NetworkTest/DownloaderTest/DownloaderTest.cpp +++ b/tests/cpp-tests/Classes/NetworkTest/DownloaderTest/DownloaderTest.cpp @@ -249,7 +249,7 @@ struct DownloaderTest : public TestCase auto bar = (ui::LoadingBar*)view->getChildByTag(TAG_PROGRESS_BAR); bar->setVisible(false); } while (0); - CC_SAFE_RELEASE(texture); + AX_SAFE_RELEASE(texture); }; downloader->onFileTaskSuccess = [this](const axis::network::DownloadTask& task) { @@ -268,7 +268,7 @@ struct DownloaderTest : public TestCase MIN((viewSize.height - 20) / spriteSize.height, (viewSize.width - 20) / spriteSize.width); sprite->setScale(scale); view->addChild(sprite, 5, TAG_SPRITE); - CC_SAFE_RELEASE(texture); + AX_SAFE_RELEASE(texture); } else { diff --git a/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp b/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp index ded15ee714..7168f126f2 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, CC_CALLBACK_1(HttpClientTest::onMenuGetTestClicked, this)); + auto itemGet = MenuItemLabel::create(labelGet, AX_CALLBACK_1(HttpClientTest::onMenuGetTestClicked, this)); itemGet->setPosition(LEFT, winSize.height - MARGIN - SPACE); menuRequest->addChild(itemGet); // Post auto labelPost = Label::createWithTTF("Test Post", "fonts/arial.ttf", 22); - auto itemPost = MenuItemLabel::create(labelPost, CC_CALLBACK_1(HttpClientTest::onMenuPostTestClicked, this)); + auto itemPost = MenuItemLabel::create(labelPost, AX_CALLBACK_1(HttpClientTest::onMenuPostTestClicked, this)); itemPost->setPosition(LEFT, winSize.height - MARGIN - 2 * SPACE); menuRequest->addChild(itemPost); // Post Binary auto labelPostBinary = Label::createWithTTF("Test Post Binary", "fonts/arial.ttf", 22); auto itemPostBinary = - MenuItemLabel::create(labelPostBinary, CC_CALLBACK_1(HttpClientTest::onMenuPostBinaryTestClicked, this)); + MenuItemLabel::create(labelPostBinary, AX_CALLBACK_1(HttpClientTest::onMenuPostBinaryTestClicked, this)); itemPostBinary->setPosition(LEFT, winSize.height - MARGIN - 3 * SPACE); menuRequest->addChild(itemPostBinary); // Put auto labelPut = Label::createWithTTF("Test Put", "fonts/arial.ttf", 22); - auto itemPut = MenuItemLabel::create(labelPut, CC_CALLBACK_1(HttpClientTest::onMenuPutTestClicked, this)); + auto itemPut = MenuItemLabel::create(labelPut, AX_CALLBACK_1(HttpClientTest::onMenuPutTestClicked, this)); itemPut->setPosition(LEFT, winSize.height - MARGIN - 4 * SPACE); menuRequest->addChild(itemPut); // Delete auto labelDelete = Label::createWithTTF("Test Delete", "fonts/arial.ttf", 22); - auto itemDelete = MenuItemLabel::create(labelDelete, CC_CALLBACK_1(HttpClientTest::onMenuDeleteTestClicked, this)); + auto itemDelete = MenuItemLabel::create(labelDelete, AX_CALLBACK_1(HttpClientTest::onMenuDeleteTestClicked, this)); itemDelete->setPosition(LEFT, winSize.height - MARGIN - 5 * SPACE); menuRequest->addChild(itemDelete); @@ -110,7 +110,7 @@ void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender) request->setUrl("https://tool.chinaz.com"); request->setRequestType(HttpRequest::Type::GET); request->setHeaders(std::vector{CHROME_UA}); - // request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + // request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("GET test1"); HttpResponse* response = HttpClient::getInstance()->sendSync(request); if (response) @@ -127,7 +127,7 @@ void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender) request->setUrl("https://just-make-this-request-failed.com"); request->setRequestType(HttpRequest::Type::GET); request->setHeaders(std::vector{CHROME_UA}); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("GET test2"); HttpClient::getInstance()->send(request); request->release(); @@ -140,7 +140,7 @@ void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender) request->setUrl("https://httpbin.org/ip"); request->setRequestType(HttpRequest::Type::GET); request->setHeaders(std::vector{CHROME_UA}); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("GET test3"); HttpClient::getInstance()->send(request); // don't forget to release it, pair to new @@ -153,7 +153,7 @@ void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender) request->setUrl("https://httpbin.org/get"); request->setRequestType(HttpRequest::Type::GET); request->setHeaders(std::vector{CHROME_UA}); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("GET test4"); HttpClient::getInstance()->send(request); request->release(); @@ -165,7 +165,7 @@ void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender) request->setUrl("https://github.com/yasio/yasio"); request->setRequestType(HttpRequest::Type::GET); request->setHeaders(std::vector{CHROME_UA}); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("GET test5"); HttpClient::getInstance()->send(request); request->release(); @@ -183,7 +183,7 @@ void HttpClientTest::onMenuPostTestClicked(axis::Ref* sender) request->setUrl("https://httpbin.org/post"); request->setRequestType(HttpRequest::Type::POST); request->setHeaders(std::vector{CHROME_UA}); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); // write the post data const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest"; @@ -199,7 +199,7 @@ void HttpClientTest::onMenuPostTestClicked(axis::Ref* sender) request->setUrl("https://httpbin.org/post"); request->setRequestType(HttpRequest::Type::POST); request->setHeaders(std::vector{CHROME_UA, "Content-Type: application/json; charset=utf-8"}); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); // write the post data const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest"; @@ -218,7 +218,7 @@ void HttpClientTest::onMenuPostBinaryTestClicked(axis::Ref* sender) HttpRequest* request = new HttpRequest(); request->setUrl("https://httpbin.org/post"); request->setRequestType(HttpRequest::Type::POST); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); // write the post data char postData[22] = "binary=hello\0\0cocos2d"; // including \0, the strings after \0 should not be cut in response @@ -238,7 +238,7 @@ void HttpClientTest::onMenuPutTestClicked(Ref* sender) HttpRequest* request = new HttpRequest(); request->setUrl("https://httpbin.org/put"); request->setRequestType(HttpRequest::Type::PUT); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); // write the post data const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest"; @@ -256,7 +256,7 @@ void HttpClientTest::onMenuPutTestClicked(Ref* sender) std::vector headers; headers.push_back("Content-Type: application/json; charset=utf-8"); request->setHeaders(headers); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); // write the post data const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest"; @@ -277,7 +277,7 @@ void HttpClientTest::onMenuDeleteTestClicked(Ref* sender) HttpRequest* request = new HttpRequest(); request->setUrl("https://just-make-this-request-failed.com"); request->setRequestType(HttpRequest::Type::DELETE); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("DELETE test1"); HttpClient::getInstance()->send(request); request->release(); @@ -288,7 +288,7 @@ void HttpClientTest::onMenuDeleteTestClicked(Ref* sender) HttpRequest* request = new HttpRequest(); request->setUrl("https://httpbin.org/delete"); request->setRequestType(HttpRequest::Type::DELETE); - request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this)); request->setTag("DELETE test2"); HttpClient::getInstance()->send(request); request->release(); @@ -351,14 +351,14 @@ HttpClientClearRequestsTest::HttpClientClearRequestsTest() : _labelStatusCode(nu // Get auto labelGet = Label::createWithTTF("Test Clear all Get", "fonts/arial.ttf", 22); auto itemGet = - MenuItemLabel::create(labelGet, CC_CALLBACK_1(HttpClientClearRequestsTest::onMenuCancelAllClicked, this)); + MenuItemLabel::create(labelGet, AX_CALLBACK_1(HttpClientClearRequestsTest::onMenuCancelAllClicked, this)); itemGet->setPosition(CENTER, winSize.height - MARGIN - SPACE); menuRequest->addChild(itemGet); // Post auto labelPost = Label::createWithTTF("Test Clear but only with the tag DELETE", "fonts/arial.ttf", 22); auto itemPost = - MenuItemLabel::create(labelPost, CC_CALLBACK_1(HttpClientClearRequestsTest::onMenuCancelSomeClicked, this)); + MenuItemLabel::create(labelPost, AX_CALLBACK_1(HttpClientClearRequestsTest::onMenuCancelSomeClicked, this)); itemPost->setPosition(CENTER, winSize.height - MARGIN - 2 * SPACE); menuRequest->addChild(itemPost); @@ -390,7 +390,7 @@ void HttpClientClearRequestsTest::onMenuCancelAllClicked(axis::Ref* sender) url << "https://cocos2d-x.org/images/logo.png?id=" << std::to_string(i); request->setUrl(url.str()); request->setRequestType(HttpRequest::Type::GET); - request->setResponseCallback(CC_CALLBACK_2(HttpClientClearRequestsTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientClearRequestsTest::onHttpRequestCompleted, this)); url.str(""); url << "TEST_" << std::to_string(i); @@ -419,7 +419,7 @@ void HttpClientClearRequestsTest::onMenuCancelSomeClicked(axis::Ref* sender) url << "https://cocos2d-x.org/images/logo.png?id=" << std::to_string(i); request->setUrl(url.str()); request->setRequestType(HttpRequest::Type::GET); - request->setResponseCallback(CC_CALLBACK_2(HttpClientClearRequestsTest::onHttpRequestCompleted, this)); + request->setResponseCallback(AX_CALLBACK_2(HttpClientClearRequestsTest::onHttpRequestCompleted, this)); url.str(""); if (i < 5) diff --git a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp index dab995f0e4..2e4a4c32c0 100644 --- a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp +++ b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp @@ -103,9 +103,9 @@ private: auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - listener->onTouchBegan = CC_CALLBACK_2(TextButton::onTouchBegan, this); - listener->onTouchEnded = CC_CALLBACK_2(TextButton::onTouchEnded, this); - listener->onTouchCancelled = CC_CALLBACK_2(TextButton::onTouchCancelled, this); + listener->onTouchBegan = AX_CALLBACK_2(TextButton::onTouchBegan, this); + listener->onTouchEnded = AX_CALLBACK_2(TextButton::onTouchEnded, this); + listener->onTouchCancelled = AX_CALLBACK_2(TextButton::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -176,7 +176,7 @@ public: return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } @@ -374,7 +374,7 @@ bool AudioControlTest::init() timeLabel->setPosition(timeSliderPos.x - sliderSize.width / 2, timeSliderPos.y); addChild(timeLabel); - this->schedule(CC_CALLBACK_1(AudioControlTest::update, this), 0.1f, "update_key"); + this->schedule(AX_CALLBACK_1(AudioControlTest::update, this), 0.1f, "update_key"); return ret; } @@ -583,7 +583,7 @@ bool AudioProfileTest::init() char text[30]; _files[0] = "background.mp3"; -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC _files[1] = "background.caf"; #else _files[1] = "background.ogg"; @@ -648,7 +648,7 @@ bool AudioProfileTest::init() addChild(timeSlider); _timeSlider = timeSlider; - this->schedule(CC_CALLBACK_1(AudioProfileTest::update, this), 0.05f, "update_key"); + this->schedule(AX_CALLBACK_1(AudioProfileTest::update, this), 0.05f, "update_key"); return ret; } @@ -680,9 +680,9 @@ bool InvalidAudioFileTest::init() auto ret = AudioEngineTestDemo::init(); auto playItem = TextButton::create("play unsupported media type", [&](TextButton* button) { -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC AudioEngine::play2d("background.ogg"); -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 AudioEngine::play2d("background.caf"); #endif }); @@ -819,54 +819,54 @@ std::string AudioIssue11143Test::subtitle() const } // Enable profiles for this file -#undef CC_PROFILER_DISPLAY_TIMERS -#define CC_PROFILER_DISPLAY_TIMERS() Profiler::getInstance()->displayTimers() -#undef CC_PROFILER_PURGE_ALL -#define CC_PROFILER_PURGE_ALL() Profiler::getInstance()->releaseAllTimers() +#undef AX_PROFILER_DISPLAY_TIMERS +#define AX_PROFILER_DISPLAY_TIMERS() Profiler::getInstance()->displayTimers() +#undef AX_PROFILER_PURGE_ALL +#define AX_PROFILER_PURGE_ALL() Profiler::getInstance()->releaseAllTimers() -#undef CC_PROFILER_START -#define CC_PROFILER_START(__name__) ProfilingBeginTimingBlock(__name__) -#undef CC_PROFILER_STOP -#define CC_PROFILER_STOP(__name__) ProfilingEndTimingBlock(__name__) -#undef CC_PROFILER_RESET -#define CC_PROFILER_RESET(__name__) ProfilingResetTimingBlock(__name__) +#undef AX_PROFILER_START +#define AX_PROFILER_START(__name__) ProfilingBeginTimingBlock(__name__) +#undef AX_PROFILER_STOP +#define AX_PROFILER_STOP(__name__) ProfilingEndTimingBlock(__name__) +#undef AX_PROFILER_RESET +#define AX_PROFILER_RESET(__name__) ProfilingResetTimingBlock(__name__) -#undef CC_PROFILER_START_CATEGORY -#define CC_PROFILER_START_CATEGORY(__cat__, __name__) \ +#undef AX_PROFILER_START_CATEGORY +#define AX_PROFILER_START_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ ProfilingBeginTimingBlock(__name__); \ } while (0) -#undef CC_PROFILER_STOP_CATEGORY -#define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) \ +#undef AX_PROFILER_STOP_CATEGORY +#define AX_PROFILER_STOP_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ ProfilingEndTimingBlock(__name__); \ } while (0) -#undef CC_PROFILER_RESET_CATEGORY -#define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) \ +#undef AX_PROFILER_RESET_CATEGORY +#define AX_PROFILER_RESET_CATEGORY(__cat__, __name__) \ do \ { \ if (__cat__) \ ProfilingResetTimingBlock(__name__); \ } while (0) -#undef CC_PROFILER_START_INSTANCE -#define CC_PROFILER_START_INSTANCE(__id__, __name__) \ +#undef AX_PROFILER_START_INSTANCE +#define AX_PROFILER_START_INSTANCE(__id__, __name__) \ do \ { \ ProfilingBeginTimingBlock(String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ } while (0) -#undef CC_PROFILER_STOP_INSTANCE -#define CC_PROFILER_STOP_INSTANCE(__id__, __name__) \ +#undef AX_PROFILER_STOP_INSTANCE +#define AX_PROFILER_STOP_INSTANCE(__id__, __name__) \ do \ { \ ProfilingEndTimingBlock(String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ } while (0) -#undef CC_PROFILER_RESET_INSTANCE -#define CC_PROFILER_RESET_INSTANCE(__id__, __name__) \ +#undef AX_PROFILER_RESET_INSTANCE +#define AX_PROFILER_RESET_INSTANCE(__id__, __name__) \ do \ { \ ProfilingResetTimingBlock(String::createWithFormat("%08X - %s", __id__, __name__)->getCString()); \ @@ -898,9 +898,9 @@ bool AudioPerformanceTest::init() schedule( [audioFiles](float dt) { int index = axis::random(0, (int)(audioFiles.size() - 1)); - CC_PROFILER_START("play2d"); + AX_PROFILER_START("play2d"); AudioEngine::play2d(audioFiles[index]); - CC_PROFILER_STOP("play2d"); + AX_PROFILER_STOP("play2d"); }, 0.25f, "test"); }); @@ -911,7 +911,7 @@ bool AudioPerformanceTest::init() auto displayItem = TextButton::create("Display Result", [this, playItem](TextButton* button) { unschedule("test"); AudioEngine::stopAll(); - CC_PROFILER_DISPLAY_TIMERS(); + AX_PROFILER_DISPLAY_TIMERS(); playItem->setEnabled(true); button->setEnabled(false); }); diff --git a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp index 6ac70b1a2a..5481cc5baf 100644 --- a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -71,9 +71,9 @@ namespace { auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - listener->onTouchBegan = CC_CALLBACK_2(TextButton::onTouchBegan, this); - listener->onTouchEnded = CC_CALLBACK_2(TextButton::onTouchEnded, this); - listener->onTouchCancelled = CC_CALLBACK_2(TextButton::onTouchCancelled, this); + listener->onTouchBegan = AX_CALLBACK_2(TextButton::onTouchBegan, this); + listener->onTouchEnded = AX_CALLBACK_2(TextButton::onTouchEnded, this); + listener->onTouchCancelled = AX_CALLBACK_2(TextButton::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -266,7 +266,7 @@ public: } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; } @@ -483,7 +483,7 @@ void CustomEventTest::onEnter() EventCustom event("game_custom_event1"); event.setUserData(buf); _eventDispatcher->dispatchEvent(&event); - CC_SAFE_DELETE_ARRAY(buf); + AX_SAFE_DELETE_ARRAY(buf); }); sendItem->setPosition(origin + Vec2(size.width / 2, size.height / 2)); @@ -509,7 +509,7 @@ void CustomEventTest::onEnter() EventCustom event("game_custom_event2"); event.setUserData(buf); _eventDispatcher->dispatchEvent(&event); - CC_SAFE_DELETE_ARRAY(buf); + AX_SAFE_DELETE_ARRAY(buf); }); sendItem2->setPosition(origin + Vec2(size.width / 2, size.height / 2 - 40)); @@ -544,7 +544,7 @@ void LabelKeyboardEventTest::onEnter() Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC auto statusLabel = Label::createWithSystemFont("No keyboard event received!", "", 20); statusLabel->setPosition(origin + Vec2(size.width / 2, size.height / 2)); addChild(statusLabel); @@ -632,7 +632,7 @@ std::string LabelKeyboardEventTest::title() const std::string LabelKeyboardEventTest::subtitle() const { -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC return "Press keys 1 through 9 to change the stats anchor on the screen."; #else return "Change the stats anchor [1-9]"; @@ -1120,7 +1120,7 @@ StopPropagationTest::StopPropagationTest() auto keyboardEventListener = EventListenerKeyboard::create(); keyboardEventListener->onKeyPressed = [](EventKeyboard::KeyCode /*key*/, Event* event) { auto target = static_cast(event->getCurrentTarget()); - CC_UNUSED_PARAM(target); + AX_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; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } @@ -1571,7 +1571,7 @@ private: DanglingNodePointersTest::DanglingNodePointersTest() { -#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1 && COCOS2D_DEBUG > 0 +#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1 && COCOS2D_DEBUG > 0 Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); @@ -1619,11 +1619,11 @@ std::string DanglingNodePointersTest::title() const std::string DanglingNodePointersTest::subtitle() const { -#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1 && COCOS2D_DEBUG > 0 +#if AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1 && COCOS2D_DEBUG > 0 return "Tap the square - should not crash!"; #else return "For test to work, must be compiled with:\n" - "CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1\n&& COCOS2D_DEBUG > 0"; + "AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1\n&& COCOS2D_DEBUG > 0"; #endif } @@ -1668,8 +1668,8 @@ std::string RegisterAndUnregisterWhileEventHanldingTest::subtitle() const // WindowEventsTest::WindowEventsTest() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) auto dispatcher = Director::getInstance()->getEventDispatcher(); dispatcher->addCustomEventListener(GLViewImpl::EVENT_WINDOW_RESIZED, [](EventCustom* event) { // TODO: need to create resizeable window @@ -1689,8 +1689,8 @@ std::string WindowEventsTest::title() const std::string WindowEventsTest::subtitle() const { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) return "Resize and Switch to another window and back. Read Logs."; #else return "Unsupported platform."; diff --git a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp index 267e582363..7b49565214 100644 --- a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp +++ b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp @@ -110,7 +110,7 @@ std::string MultiSceneTest::subtitle() const NewSpriteTest::NewSpriteTest() { auto touchListener = EventListenerTouchAllAtOnce::create(); - touchListener->onTouchesEnded = CC_CALLBACK_2(NewSpriteTest::onTouchesEnded, this); + touchListener->onTouchesEnded = AX_CALLBACK_2(NewSpriteTest::onTouchesEnded, this); createSpriteTest(); createNewSpriteTest(); @@ -281,9 +281,9 @@ NewClippingNodeTest::NewClippingNodeTest() _scrolling = false; auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(NewClippingNodeTest::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(NewClippingNodeTest::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(NewClippingNodeTest::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(NewClippingNodeTest::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(NewClippingNodeTest::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(NewClippingNodeTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -382,8 +382,8 @@ NewCullingTest::NewCullingTest() auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - listener->onTouchBegan = CC_CALLBACK_2(NewCullingTest::onTouchBegan, this); - listener->onTouchMoved = CC_CALLBACK_2(NewCullingTest::onTouchMoved, this); + listener->onTouchBegan = AX_CALLBACK_2(NewCullingTest::onTouchBegan, this); + listener->onTouchMoved = AX_CALLBACK_2(NewCullingTest::onTouchMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -436,9 +436,9 @@ SpriteCreation::SpriteCreation() MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(65); - auto decrease = MenuItemFont::create(" - ", CC_CALLBACK_1(SpriteCreation::delSpritesCallback, this)); + auto decrease = MenuItemFont::create(" - ", AX_CALLBACK_1(SpriteCreation::delSpritesCallback, this)); decrease->setColor(Color3B(0, 200, 20)); - auto increase = MenuItemFont::create(" + ", CC_CALLBACK_1(SpriteCreation::addSpritesCallback, this)); + auto increase = MenuItemFont::create(" + ", AX_CALLBACK_1(SpriteCreation::addSpritesCallback, this)); increase->setColor(Color3B(0, 200, 20)); auto menu = Menu::create(decrease, increase, nullptr); @@ -630,7 +630,7 @@ CaptureScreenTest::CaptureScreenTest() sp2->runAction(seq2); auto label1 = Label::createWithTTF(TTFConfig("fonts/arial.ttf"), "capture all"); - auto mi1 = MenuItemLabel::create(label1, CC_CALLBACK_1(CaptureScreenTest::onCaptured, this)); + auto mi1 = MenuItemLabel::create(label1, AX_CALLBACK_1(CaptureScreenTest::onCaptured, this)); auto menu = Menu::create(mi1, nullptr); addChild(menu); menu->setPosition(s.width / 2, s.height / 4); @@ -660,7 +660,7 @@ void CaptureScreenTest::onCaptured(Ref*) _filename = "CaptureScreenTest.png"; // retain it to avoid crash caused by invoking afterCaptured this->retain(); - utils::captureScreen(CC_CALLBACK_2(CaptureScreenTest::afterCaptured, this), _filename); + utils::captureScreen(AX_CALLBACK_2(CaptureScreenTest::afterCaptured, this), _filename); } void CaptureScreenTest::afterCaptured(bool succeed, std::string_view outputFile) @@ -703,7 +703,7 @@ CaptureNodeTest::CaptureNodeTest() sp2->runAction(seq2); auto label1 = Label::createWithTTF(TTFConfig("fonts/arial.ttf"), "capture this scene"); - auto mi1 = MenuItemLabel::create(label1, CC_CALLBACK_1(CaptureNodeTest::onCaptured, this)); + auto mi1 = MenuItemLabel::create(label1, AX_CALLBACK_1(CaptureNodeTest::onCaptured, this)); auto menu = Menu::create(mi1, nullptr); addChild(menu); menu->setPosition(s.width / 2, s.height / 4); diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp index 418989ae23..24f4292816 100644 --- a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp +++ b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp @@ -147,8 +147,8 @@ NodeTest4::NodeTest4() addChild(sp1, 0, 2); addChild(sp2, 0, 3); - schedule(CC_CALLBACK_1(NodeTest4::delay2, this), 2.0f, "delay2_key"); - schedule(CC_CALLBACK_1(NodeTest4::delay4, this), 4.0f, "delay4_key"); + schedule(AX_CALLBACK_1(NodeTest4::delay2, this), 2.0f, "delay2_key"); + schedule(AX_CALLBACK_1(NodeTest4::delay4, this), 4.0f, "delay4_key"); } void NodeTest4::delay2(float dt) @@ -195,7 +195,7 @@ NodeTest5::NodeTest5() sp1->runAction(forever); sp2->runAction(forever2); - schedule(CC_CALLBACK_1(NodeTest5::addAndRemove, this), 2.0f, "add_and_remove_key"); + schedule(AX_CALLBACK_1(NodeTest5::addAndRemove, this), 2.0f, "add_and_remove_key"); } void NodeTest5::addAndRemove(float dt) @@ -255,7 +255,7 @@ NodeTest6::NodeTest6() sp2->runAction(forever2); sp21->runAction(forever21); - schedule(CC_CALLBACK_1(NodeTest6::addAndRemove, this), 2.0f, "add_and_remove_key"); + schedule(AX_CALLBACK_1(NodeTest6::addAndRemove, this), 2.0f, "add_and_remove_key"); } void NodeTest6::addAndRemove(float dt) @@ -295,7 +295,7 @@ StressTest1::StressTest1() sp1->setPosition(Vec2(s.width / 2, s.height / 2)); - schedule(CC_CALLBACK_1(StressTest1::shouldNotCrash, this), 1.0f, "should_not_crash_key"); + schedule(AX_CALLBACK_1(StressTest1::shouldNotCrash, this), 1.0f, "should_not_crash_key"); } void StressTest1::shouldNotCrash(float dt) @@ -313,7 +313,7 @@ void StressTest1::shouldNotCrash(float dt) explosion->setPosition(Vec2(s.width / 2, s.height / 2)); - runAction(Sequence::create(RotateBy::create(2, 360), CallFuncN::create(CC_CALLBACK_1(StressTest1::removeMe, this)), + runAction(Sequence::create(RotateBy::create(2, 360), CallFuncN::create(AX_CALLBACK_1(StressTest1::removeMe, this)), nullptr)); addChild(explosion); @@ -360,7 +360,7 @@ StressTest2::StressTest2() fire->runAction(RepeatForever::create(copy_seq3)); sublayer->addChild(fire, 2); - schedule(CC_CALLBACK_1(StressTest2::shouldNotLeak, this), 6.0f, "should_not_leak_key"); + schedule(AX_CALLBACK_1(StressTest2::shouldNotLeak, this), 6.0f, "should_not_leak_key"); addChild(sublayer, 0, kTagSprite1); } @@ -390,7 +390,7 @@ SchedulerTest1::SchedulerTest1() addChild(layer, 0); // CCLOG("retain count after addChild is %d", layer->getReferenceCount()); // 2 - layer->schedule(CC_CALLBACK_1(SchedulerTest1::doSomething, this), "do_something_key"); + layer->schedule(AX_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 = CC_CALLBACK_2(ConvertToNode::onTouchesEnded, this); + listener->onTouchesEnded = AX_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(CC_CALLBACK_1(NodeNameTest::test, this), 0.05f, "test_key"); + this->scheduleOnce(AX_CALLBACK_1(NodeNameTest::test, this), 0.05f, "test_key"); } void NodeNameTest::onExit() diff --git a/tests/cpp-tests/Classes/OpenURLTest/OpenURLTest.cpp b/tests/cpp-tests/Classes/OpenURLTest/OpenURLTest.cpp index 2d397c0846..9181b569e2 100644 --- a/tests/cpp-tests/Classes/OpenURLTest/OpenURLTest.cpp +++ b/tests/cpp-tests/Classes/OpenURLTest/OpenURLTest.cpp @@ -38,7 +38,7 @@ OpenURLTest::OpenURLTest() label->setPosition(VisibleRect::center().x, VisibleRect::top().y - 50); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(OpenURLTest::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(OpenURLTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // create a label to display the tip string diff --git a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp index 4751a28a27..98ea6fc9b7 100644 --- a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp +++ b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp @@ -113,7 +113,7 @@ std::string Parallax1::title() const Parallax2::Parallax2() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(Parallax2::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(Parallax2::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // Top Layer, a simple image diff --git a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp index 42b909f51a..b04c6af65e 100644 --- a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp +++ b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp @@ -74,9 +74,9 @@ bool Particle3DTestDemo::init() this->addChild(_camera); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(Particle3DTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(Particle3DTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(Particle3DTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(Particle3DTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(Particle3DTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(Particle3DTestDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); TTFConfig config("fonts/tahoma.ttf", 10); @@ -99,7 +99,7 @@ void Particle3DTestDemo::onTouchesMoved(const std::vector& touches, axis auto touch = touches[0]; auto delta = touch->getDelta(); - _angle -= CC_DEGREES_TO_RADIANS(delta.x); + _angle -= AX_DEGREES_TO_RADIANS(delta.x); _camera->setPosition3D(Vec3(100.0f * sinf(_angle), 0.0f, 100.0f * cosf(_angle))); _camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f)); } diff --git a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp index b5ba510e8c..9c13ae0608 100644 --- a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp +++ b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp @@ -120,7 +120,7 @@ void DemoPause::onEnter() _emitter->setTexture(Director::getInstance()->getTextureCache()->addImage(s_fire)); setEmitterPosition(); - schedule(CC_SCHEDULE_SELECTOR(DemoPause::pauseEmitter), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(DemoPause::pauseEmitter), 2.0f); } void DemoPause::pauseEmitter(float time) { @@ -2072,7 +2072,7 @@ void Issue870::onEnter() _emitter->retain(); _index = 0; - schedule(CC_SCHEDULE_SELECTOR(Issue870::updateQuads), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(Issue870::updateQuads), 2.0f); } void Issue870::updateQuads(float dt) @@ -2220,7 +2220,7 @@ ParticleTests::ParticleTests() ParticleDemo::~ParticleDemo() { - CC_SAFE_RELEASE(_emitter); + AX_SAFE_RELEASE(_emitter); } void ParticleDemo::onEnter() @@ -2235,15 +2235,15 @@ void ParticleDemo::onEnter() _emitter = nullptr; auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(ParticleDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(ParticleDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(ParticleDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(ParticleDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(ParticleDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(ParticleDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); auto item4 = MenuItemToggle::createWithCallback( - CC_CALLBACK_1(ParticleDemo::toggleCallback, this), MenuItemFont::create("Free Movement"), + AX_CALLBACK_1(ParticleDemo::toggleCallback, this), MenuItemFont::create("Free Movement"), MenuItemFont::create("Relative Movement"), MenuItemFont::create("Grouped Movement"), nullptr); auto menu = Menu::create(item4, nullptr); @@ -2360,7 +2360,7 @@ void ParticleBatchHybrid::onEnter() addChild(batch, 10); - schedule(CC_SCHEDULE_SELECTOR(ParticleBatchHybrid::switchRender), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(ParticleBatchHybrid::switchRender), 2.0f); auto node = Node::create(); addChild(node); @@ -2477,7 +2477,7 @@ void ParticleReorder::onEnter() addChild(parent, 10, 1000 + i); } - schedule(CC_SCHEDULE_SELECTOR(ParticleReorder::reorderParticles), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(ParticleReorder::reorderParticles), 1.0f); } std::string ParticleReorder::title() const @@ -2780,7 +2780,7 @@ void AddAndDeleteParticleSystems::onEnter() _batchNode->addChild(particleSystem, randZ, -1); } - schedule(CC_SCHEDULE_SELECTOR(AddAndDeleteParticleSystems::removeSystem), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(AddAndDeleteParticleSystems::removeSystem), 0.5f); _emitter = nullptr; } @@ -2928,7 +2928,7 @@ void ReorderParticleSystems::onEnter() //[pBNode addChild:particleSystem z:10 tag:0); } - schedule(CC_SCHEDULE_SELECTOR(ReorderParticleSystems::reorderSystem), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(ReorderParticleSystems::reorderSystem), 2.0f); _emitter = nullptr; } @@ -3023,7 +3023,7 @@ void PremultipliedAlphaTest::onEnter() this->addChild(_emitter, 10); _hasEmitter = true; - schedule(CC_SCHEDULE_SELECTOR(PremultipliedAlphaTest::readdParticle), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(PremultipliedAlphaTest::readdParticle), 1.0f); } // PremultipliedAlphaTest2 @@ -3093,7 +3093,7 @@ void ParticleVisibleTest::onEnter() _emitter->setTexture(Director::getInstance()->getTextureCache()->addImage(s_stars1)); - schedule(CC_SCHEDULE_SELECTOR(ParticleVisibleTest::callback), 1); + schedule(AX_SCHEDULE_SELECTOR(ParticleVisibleTest::callback), 1); setEmitterPosition(); } diff --git a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.cpp b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.cpp index 8ede42f65e..0a9810d271 100644 --- a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.cpp +++ b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.cpp @@ -52,7 +52,7 @@ static axis::Scene* physicsScene = nullptr; Physics3DTests::Physics3DTests() { -#if CC_USE_3D_PHYSICS == 0 +#if AX_USE_3D_PHYSICS == 0 ADD_TEST_CASE(Physics3DDemoDisabled); #else ADD_TEST_CASE(BasicPhysics3DDemo); @@ -64,11 +64,11 @@ Physics3DTests::Physics3DTests() #endif }; -#if CC_USE_3D_PHYSICS == 0 +#if AX_USE_3D_PHYSICS == 0 void Physics3DDemoDisabled::onEnter() { TTFConfig ttfConfig("fonts/arial.ttf", 16); - auto label = Label::createWithTTF(ttfConfig, "Should define CC_USE_3D_PHYSICS\n to run this test case"); + auto label = Label::createWithTTF(ttfConfig, "Should define AX_USE_3D_PHYSICS\n to run this test case"); auto size = Director::getInstance()->getWinSize(); label->setPosition(Vec2(size.width / 2, size.height / 2)); @@ -106,9 +106,9 @@ bool Physics3DTestDemo::init() this->addChild(_camera); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(Physics3DTestDemo::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(Physics3DTestDemo::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(Physics3DTestDemo::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(Physics3DTestDemo::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(Physics3DTestDemo::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(Physics3DTestDemo::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); TTFConfig ttfConfig("fonts/arial.ttf", 10); @@ -152,7 +152,7 @@ void Physics3DTestDemo::onTouchesMoved(const std::vector& touches, axis: auto touch = touches[0]; auto delta = touch->getDelta(); - _angle -= CC_DEGREES_TO_RADIANS(delta.x); + _angle -= AX_DEGREES_TO_RADIANS(delta.x); _camera->setPosition3D(Vec3(100.0f * sinf(_angle), 50.0f, 100.0f * cosf(_angle))); _camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f)); @@ -379,7 +379,7 @@ bool Physics3DConstraintDemo::init() rbDes.shape = Physics3DShape::createBox(Vec3(5.0f, 5.0f, 5.0f)); auto rigidBody = Physics3DRigidBody::create(&rbDes); Quaternion quat; - Quaternion::createFromAxisAngle(Vec3(0.f, 1.f, 0.f), CC_DEGREES_TO_RADIANS(180), &quat); + Quaternion::createFromAxisAngle(Vec3(0.f, 1.f, 0.f), AX_DEGREES_TO_RADIANS(180), &quat); auto component = Physics3DComponent::create(rigidBody, Vec3(0.f, -3.f, 0.f), quat); mesh->addComponent(component); @@ -446,7 +446,7 @@ bool Physics3DConstraintDemo::init() component->syncNodeToPhysics(); Mat4 frameInA, frameInB; - Mat4::createRotationZ(CC_DEGREES_TO_RADIANS(90), &frameInA); + Mat4::createRotationZ(AX_DEGREES_TO_RADIANS(90), &frameInA); frameInB = frameInA; frameInA.m[13] = -5.f; frameInB.m[13] = 5.f; @@ -469,14 +469,14 @@ bool Physics3DConstraintDemo::init() this->addChild(mesh); component->syncNodeToPhysics(); - Mat4::createRotationZ(CC_DEGREES_TO_RADIANS(90), &frameInA); + Mat4::createRotationZ(AX_DEGREES_TO_RADIANS(90), &frameInA); frameInA.m[12] = 0.f; frameInA.m[13] = -10.f; frameInA.m[14] = 0.f; constraint = Physics3DConeTwistConstraint::create(rigidBody, frameInA); physicsScene->getPhysics3DWorld()->addPhysics3DConstraint(constraint, true); ((Physics3DConeTwistConstraint*)constraint) - ->setLimit(CC_DEGREES_TO_RADIANS(10), CC_DEGREES_TO_RADIANS(10), CC_DEGREES_TO_RADIANS(40)); + ->setLimit(AX_DEGREES_TO_RADIANS(10), AX_DEGREES_TO_RADIANS(10), AX_DEGREES_TO_RADIANS(40)); // create 6 dof constraint rbDes.mass = 1.0f; @@ -652,13 +652,13 @@ bool Physics3DTerrainDemo::init() Mat4::createTranslation(0.6f, 5.0f, -1.5f, &localTrans); shapeList.push_back(std::make_pair(headshape, localTrans)); auto lhandshape = Physics3DShape::createBox(Vec3(1.0f, 3.0f, 1.0f)); - Mat4::createRotation(Vec3(1.0f, 0.0f, 0.0f), CC_DEGREES_TO_RADIANS(15.0f), &localTrans); + Mat4::createRotation(Vec3(1.0f, 0.0f, 0.0f), AX_DEGREES_TO_RADIANS(15.0f), &localTrans); localTrans.m[12] = -1.5f; localTrans.m[13] = 2.5f; localTrans.m[14] = -2.5f; shapeList.push_back(std::make_pair(lhandshape, localTrans)); auto rhandshape = Physics3DShape::createBox(Vec3(1.0f, 3.0f, 1.0f)); - Mat4::createRotation(Vec3(1.0f, 0.0f, 0.0f), CC_DEGREES_TO_RADIANS(-15.0f), &localTrans); + Mat4::createRotation(Vec3(1.0f, 0.0f, 0.0f), AX_DEGREES_TO_RADIANS(-15.0f), &localTrans); localTrans.m[12] = 2.0f; localTrans.m[13] = 2.5f; localTrans.m[14] = 1.f; diff --git a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h index 083c5142f1..923485479e 100644 --- a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h +++ b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h @@ -37,7 +37,7 @@ NS_AX_END DEFINE_TEST_SUITE(Physics3DTests); -#if CC_USE_3D_PHYSICS == 0 +#if AX_USE_3D_PHYSICS == 0 class Physics3DDemoDisabled : public TestCase { public: diff --git a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp index e2dd28fd18..b92b649b83 100644 --- a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp +++ b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp @@ -24,7 +24,7 @@ #include "PhysicsTest.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS # include # include "ui/CocosGUI.h" @@ -62,7 +62,7 @@ const int DRAG_BODYS_TAG = 0x80; void PhysicsDemo::toggleDebug() { -# if CC_USE_PHYSICS +# if AX_USE_PHYSICS _debugDraw = !_debugDraw; _physicsWorld->setDebugDrawMask(_debugDraw ? PhysicsWorld::DEBUGDRAW_ALL : PhysicsWorld::DEBUGDRAW_NONE); # endif @@ -91,7 +91,7 @@ void PhysicsDemo::onEnter() // menu for debug layer MenuItemFont::setFontSize(18); - auto item = MenuItemFont::create("Toggle debug", CC_CALLBACK_1(PhysicsDemo::toggleDebugCallback, this)); + auto item = MenuItemFont::create("Toggle debug", AX_CALLBACK_1(PhysicsDemo::toggleDebugCallback, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -372,11 +372,11 @@ void PhysicsDemoClickAdd::onEnter() PhysicsDemo::onEnter(); auto touchListener = EventListenerTouchAllAtOnce::create(); - touchListener->onTouchesEnded = CC_CALLBACK_2(PhysicsDemoClickAdd::onTouchesEnded, this); + touchListener->onTouchesEnded = AX_CALLBACK_2(PhysicsDemoClickAdd::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); Device::setAccelerometerEnabled(true); - auto accListener = EventListenerAcceleration::create(CC_CALLBACK_2(PhysicsDemoClickAdd::onAcceleration, this)); + auto accListener = EventListenerAcceleration::create(AX_CALLBACK_2(PhysicsDemoClickAdd::onAcceleration, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(accListener, this); auto node = Node::create(); @@ -427,9 +427,9 @@ void PhysicsDemoPyramidStack::onEnter() PhysicsDemo::onEnter(); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemoPyramidStack::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemoPyramidStack::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemoPyramidStack::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemoPyramidStack::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemoPyramidStack::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoPyramidStack::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); auto node = Node::create(); @@ -446,7 +446,7 @@ void PhysicsDemoPyramidStack::onEnter() ball->setPosition(VisibleRect::bottom() + Vec2(0.0f, 60.0f)); this->addChild(ball); - scheduleOnce(CC_SCHEDULE_SELECTOR(PhysicsDemoPyramidStack::updateOnce), 3.0); + scheduleOnce(AX_SCHEDULE_SELECTOR(PhysicsDemoPyramidStack::updateOnce), 3.0); for (int i = 0; i < 14; i++) { @@ -477,7 +477,7 @@ void PhysicsDemoRayCast::onEnter() PhysicsDemo::onEnter(); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(PhysicsDemoRayCast::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(PhysicsDemoRayCast::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); _physicsWorld->setGravity(Point::ZERO); @@ -489,7 +489,7 @@ void PhysicsDemoRayCast::onEnter() this->addChild(node); MenuItemFont::setFontSize(18); - auto item = MenuItemFont::create("Change Mode(any)", CC_CALLBACK_1(PhysicsDemoRayCast::changeModeCallback, this)); + auto item = MenuItemFont::create("Change Mode(any)", AX_CALLBACK_1(PhysicsDemoRayCast::changeModeCallback, this)); auto menu = Menu::create(item, nullptr); this->addChild(menu); @@ -539,7 +539,7 @@ void PhysicsDemoRayCast::update(float /*delta*/) case 0: { Vec2 point3 = point2; - auto func = CC_CALLBACK_3(PhysicsDemoRayCast::anyRay, this); + auto func = AX_CALLBACK_3(PhysicsDemoRayCast::anyRay, this); _physicsWorld->rayCast(func, point1, point2, &point3); _node->drawSegment(point1, point3, 0.5f, STATIC_COLOR); @@ -651,9 +651,9 @@ void PhysicsDemoActions::onEnter() _physicsWorld->setGravity(Vec2::ZERO); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemoActions::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemoActions::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemoActions::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemoActions::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemoActions::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoActions::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); auto node = Node::create(); @@ -698,9 +698,9 @@ void PhysicsDemoJoints::onEnter() toggleDebug(); auto listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = CC_CALLBACK_2(PhysicsDemo::onTouchBegan, this); - listener->onTouchMoved = CC_CALLBACK_2(PhysicsDemo::onTouchMoved, this); - listener->onTouchEnded = CC_CALLBACK_2(PhysicsDemo::onTouchEnded, this); + listener->onTouchBegan = AX_CALLBACK_2(PhysicsDemo::onTouchBegan, this); + listener->onTouchMoved = AX_CALLBACK_2(PhysicsDemo::onTouchMoved, this); + listener->onTouchEnded = AX_CALLBACK_2(PhysicsDemo::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); float width = (VisibleRect::getVisibleRect().size.width - 10) / 4; @@ -949,9 +949,9 @@ void PhysicsDemoPump::onEnter() _distance = 0.0f; _rotationV = 0.0f; auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemoPump::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemoPump::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemoPump::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemoPump::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemoPump::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoPump::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); scheduleUpdate(); @@ -1120,9 +1120,9 @@ void PhysicsDemoOneWayPlatform::onEnter() PhysicsDemo::onEnter(); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoOneWayPlatform::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); auto ground = Node::create(); @@ -1145,7 +1145,7 @@ void PhysicsDemoOneWayPlatform::onEnter() this->addChild(ball); auto contactListener = EventListenerPhysicsContactWithBodies::create(platformBody, ballBody); - contactListener->onContactBegin = CC_CALLBACK_1(PhysicsDemoOneWayPlatform::onContactBegin, this); + contactListener->onContactBegin = AX_CALLBACK_1(PhysicsDemoOneWayPlatform::onContactBegin, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(contactListener, this); } @@ -1168,7 +1168,7 @@ void PhysicsDemoSlice::onEnter() auto touchListener = EventListenerTouchOneByOne::create(); touchListener->onTouchBegan = [](Touch* /*touch*/, Event* /*event*/) -> bool { return true; }; - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemoSlice::onTouchEnded, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemoSlice::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); auto ground = Node::create(); @@ -1250,7 +1250,7 @@ void PhysicsDemoSlice::clipPoly(PhysicsShapePolygon* shape, Vec2 normal, float d void PhysicsDemoSlice::onTouchEnded(Touch* touch, Event* /*event*/) { - auto func = CC_CALLBACK_3(PhysicsDemoSlice::slice, this); + auto func = AX_CALLBACK_3(PhysicsDemoSlice::slice, this); getPhysicsWorld()->rayCast(func, touch->getStartLocation(), touch->getLocation(), nullptr); } @@ -1302,9 +1302,9 @@ void PhysicsContactTest::onEnter() _blueTriangleNum = 50; MenuItemFont::setFontSize(65); - auto decrease1 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); + auto decrease1 = MenuItemFont::create(" - ", AX_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease1->setColor(Color3B(0, 200, 20)); - auto increase1 = MenuItemFont::create(" + ", CC_CALLBACK_1(PhysicsContactTest::onIncrease, this)); + auto increase1 = MenuItemFont::create(" + ", AX_CALLBACK_1(PhysicsContactTest::onIncrease, this)); increase1->setColor(Color3B(0, 200, 20)); decrease1->setTag(1); increase1->setTag(1); @@ -1320,9 +1320,9 @@ void PhysicsContactTest::onEnter() addChild(label, 1); label->setPosition(Vec2(s.width / 2 - 150, prevMenuPos)); - auto decrease2 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); + auto decrease2 = MenuItemFont::create(" - ", AX_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease2->setColor(Color3B(0, 200, 20)); - auto increase2 = MenuItemFont::create(" + ", CC_CALLBACK_1(PhysicsContactTest::onIncrease, this)); + auto increase2 = MenuItemFont::create(" + ", AX_CALLBACK_1(PhysicsContactTest::onIncrease, this)); increase2->setColor(Color3B(0, 200, 20)); decrease2->setTag(2); increase2->setTag(2); @@ -1336,9 +1336,9 @@ void PhysicsContactTest::onEnter() addChild(label, 1); label->setPosition(Vec2(s.width / 2 - 150, prevMenuPos)); - auto decrease3 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); + auto decrease3 = MenuItemFont::create(" - ", AX_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease3->setColor(Color3B(0, 200, 20)); - auto increase3 = MenuItemFont::create(" + ", CC_CALLBACK_1(PhysicsContactTest::onIncrease, this)); + auto increase3 = MenuItemFont::create(" + ", AX_CALLBACK_1(PhysicsContactTest::onIncrease, this)); increase3->setColor(Color3B(0, 200, 20)); decrease3->setTag(3); increase3->setTag(3); @@ -1352,9 +1352,9 @@ void PhysicsContactTest::onEnter() addChild(label, 1); label->setPosition(Vec2(s.width / 2 - 150, prevMenuPos)); - auto decrease4 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); + auto decrease4 = MenuItemFont::create(" - ", AX_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease4->setColor(Color3B(0, 200, 20)); - auto increase4 = MenuItemFont::create(" + ", CC_CALLBACK_1(PhysicsContactTest::onIncrease, this)); + auto increase4 = MenuItemFont::create(" + ", AX_CALLBACK_1(PhysicsContactTest::onIncrease, this)); increase4->setColor(Color3B(0, 200, 20)); decrease4->setTag(4); increase4->setTag(4); @@ -1462,7 +1462,7 @@ void PhysicsContactTest::resetTest() root->addChild(wall); auto contactListener = EventListenerPhysicsContact::create(); - contactListener->onContactBegin = CC_CALLBACK_1(PhysicsContactTest::onContactBegin, this); + contactListener->onContactBegin = AX_CALLBACK_1(PhysicsContactTest::onContactBegin, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(contactListener, this); // yellow box, will collide with itself and blue box. @@ -1547,7 +1547,7 @@ bool PhysicsContactTest::onContactBegin(PhysicsContact& contact) PhysicsBody* a = contact.getShapeA()->getBody(); PhysicsBody* b = contact.getShapeB()->getBody(); PhysicsBody* body = (a->getCategoryBitmask() == 0x04 || a->getCategoryBitmask() == 0x08) ? a : b; - CC_ASSERT(body->getCategoryBitmask() == 0x04 || body->getCategoryBitmask() == 0x08); + AX_ASSERT(body->getCategoryBitmask() == 0x04 || body->getCategoryBitmask() == 0x08); return true; } @@ -1569,9 +1569,9 @@ void PhysicsPositionRotationTest::onEnter() _physicsWorld->setGravity(Point::ZERO); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemo::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemo::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemo::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemo::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemo::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemo::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); auto wall = Node::create(); @@ -1632,9 +1632,9 @@ void PhysicsSetGravityEnableTest::onEnter() PhysicsDemo::onEnter(); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemo::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemo::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemo::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemo::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemo::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemo::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); // wall @@ -1665,7 +1665,7 @@ void PhysicsSetGravityEnableTest::onEnter() ballBody->setMass(50); addChild(ball); - scheduleOnce(CC_SCHEDULE_SELECTOR(PhysicsSetGravityEnableTest::onScheduleOnce), 1.0); + scheduleOnce(AX_SCHEDULE_SELECTOR(PhysicsSetGravityEnableTest::onScheduleOnce), 1.0); } void PhysicsSetGravityEnableTest::onScheduleOnce(float /*delta*/) @@ -1693,9 +1693,9 @@ void PhysicsDemoBug5482::onEnter() toggleDebug(); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsDemo::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(PhysicsDemo::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(PhysicsDemo::onTouchEnded, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsDemo::onTouchBegan, this); + touchListener->onTouchMoved = AX_CALLBACK_2(PhysicsDemo::onTouchMoved, this); + touchListener->onTouchEnded = AX_CALLBACK_2(PhysicsDemo::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); _bodyInA = false; @@ -1709,7 +1709,7 @@ void PhysicsDemoBug5482::onEnter() // button MenuItemFont::setFontSize(18); - _button = MenuItemFont::create("Set Body To A", CC_CALLBACK_1(PhysicsDemoBug5482::changeBodyCallback, this)); + _button = MenuItemFont::create("Set Body To A", AX_CALLBACK_1(PhysicsDemoBug5482::changeBodyCallback, this)); auto menu = Menu::create(_button, nullptr); this->addChild(menu); @@ -1783,7 +1783,7 @@ void PhysicsFixedUpdate::onEnter() addBall(); - scheduleOnce(CC_SCHEDULE_SELECTOR(PhysicsFixedUpdate::updateStart), 2); + scheduleOnce(AX_SCHEDULE_SELECTOR(PhysicsFixedUpdate::updateStart), 2); } void PhysicsFixedUpdate::addBall() @@ -1837,7 +1837,7 @@ void PhysicsTransformTest::onEnter() _physicsWorld->setGravity(Point::ZERO); auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->onTouchBegan = CC_CALLBACK_2(PhysicsTransformTest::onTouchBegan, this); + touchListener->onTouchBegan = AX_CALLBACK_2(PhysicsTransformTest::onTouchBegan, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); _rootLayer = Layer::create(); diff --git a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h index 803ef2a55f..a70092c8e2 100644 --- a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h +++ b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h @@ -28,7 +28,7 @@ #include "../BaseTest.h" -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS DEFINE_TEST_SUITE(PhysicsTests); @@ -308,4 +308,4 @@ public: virtual std::string subtitle() const override; }; -#endif // #if CC_USE_PHYSICS \ No newline at end of file +#endif // #if AX_USE_PHYSICS \ No newline at end of file diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp index 18d1ec4e11..dbe28026d1 100644 --- a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -56,19 +56,19 @@ RenderTextureSave::RenderTextureSave() this->addChild(_target, -1); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(RenderTextureSave::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(RenderTextureSave::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // Save Image menu MenuItemFont::setFontSize(16); auto item1 = - MenuItemFont::create("Save Image PMA", CC_CALLBACK_1(RenderTextureSave::saveImageWithPremultipliedAlpha, this)); + MenuItemFont::create("Save Image PMA", AX_CALLBACK_1(RenderTextureSave::saveImageWithPremultipliedAlpha, this)); auto item2 = MenuItemFont::create("Save Image Non-PMA", - CC_CALLBACK_1(RenderTextureSave::saveImageWithNonPremultipliedAlpha, this)); - auto item3 = MenuItemFont::create("Add Image", CC_CALLBACK_1(RenderTextureSave::addImage, this)); - auto item4 = MenuItemFont::create("Clear to Random", CC_CALLBACK_1(RenderTextureSave::clearImage, this)); + AX_CALLBACK_1(RenderTextureSave::saveImageWithNonPremultipliedAlpha, this)); + auto item3 = MenuItemFont::create("Add Image", AX_CALLBACK_1(RenderTextureSave::addImage, this)); + auto item4 = MenuItemFont::create("Clear to Random", AX_CALLBACK_1(RenderTextureSave::clearImage, this)); auto item5 = - MenuItemFont::create("Clear to Transparent", CC_CALLBACK_1(RenderTextureSave::clearImageTransparent, this)); + MenuItemFont::create("Clear to Transparent", AX_CALLBACK_1(RenderTextureSave::clearImageTransparent, this)); auto menu = Menu::create(item1, item2, item3, item4, item5, nullptr); this->addChild(menu); menu->alignItemsVertically(); @@ -286,9 +286,9 @@ std::string RenderTextureIssue937::subtitle() const RenderTextureZbuffer::RenderTextureZbuffer() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(RenderTextureZbuffer::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(RenderTextureZbuffer::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(RenderTextureZbuffer::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(RenderTextureZbuffer::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(RenderTextureZbuffer::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(RenderTextureZbuffer::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto size = Director::getInstance()->getWinSize(); @@ -467,7 +467,7 @@ RenderTexturePartTest::RenderTexturePartTest() RenderTexturePartTest::~RenderTexturePartTest() { - CC_SAFE_RELEASE(_rend); + AX_SAFE_RELEASE(_rend); } std::string RenderTexturePartTest::title() const @@ -514,8 +514,8 @@ RenderTextureTestDepthStencil::RenderTextureTestDepthStencil() RenderTextureTestDepthStencil::~RenderTextureTestDepthStencil() { - CC_SAFE_RELEASE(_spriteDraw); - CC_SAFE_RELEASE(_spriteDS); + AX_SAFE_RELEASE(_spriteDraw); + AX_SAFE_RELEASE(_spriteDS); // restore depth stencil desc _renderer->setDepthStencilDesc(_dsDesc); @@ -527,24 +527,24 @@ void RenderTextureTestDepthStencil::draw(Renderer* renderer, const Mat4& transfo _rtx->beginWithClear(0, 0, 0, 0, 0, 0); // _renderCmds[0].init(_globalZOrder); -// _renderCmds[0].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this); - renderer->addCallbackCommand(CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this), _globalZOrder); +// _renderCmds[0].func = AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this); + renderer->addCallbackCommand(AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this), _globalZOrder); // _renderCmds[1].init(_globalZOrder); -// _renderCmds[1].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this); - renderer->addCallbackCommand(CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this), _globalZOrder); +// _renderCmds[1].func = AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this); + renderer->addCallbackCommand(AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this), _globalZOrder); _spriteDS->visit(); // _renderCmds[2].init(_globalZOrder); -// _renderCmds[2].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeDraw, this); - renderer->addCallbackCommand(CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeDraw, this), _globalZOrder); +// _renderCmds[2].func = AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeDraw, this); + renderer->addCallbackCommand(AX_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeDraw, this), _globalZOrder); _spriteDraw->visit(); // _renderCmds[3].init(_globalZOrder); -// _renderCmds[3].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onAfterDraw, this); - renderer->addCallbackCommand(CC_CALLBACK_0(RenderTextureTestDepthStencil::onAfterDraw, this), _globalZOrder); +// _renderCmds[3].func = AX_CALLBACK_0(RenderTextureTestDepthStencil::onAfterDraw, this); + renderer->addCallbackCommand(AX_CALLBACK_0(RenderTextureTestDepthStencil::onAfterDraw, this), _globalZOrder); /// !!!end will set current render target to default renderTarget /// !!!all render target share one depthStencilDesc, TODO: optimize me? @@ -632,7 +632,7 @@ RenderTextureTargetNode::RenderTextureTargetNode() scheduleUpdate(); // Toggle clear on / off - auto item = MenuItemFont::create("Clear On/Off", CC_CALLBACK_1(RenderTextureTargetNode::touched, this)); + auto item = MenuItemFont::create("Clear On/Off", AX_CALLBACK_1(RenderTextureTargetNode::touched, this)); auto menu = Menu::create(item, nullptr); addChild(menu); @@ -678,7 +678,7 @@ std::string RenderTextureTargetNode::subtitle() const SpriteRenderTextureBug::SimpleSprite::SimpleSprite() : _rt(nullptr) {} SpriteRenderTextureBug::SimpleSprite::~SimpleSprite() { - CC_SAFE_RELEASE(_rt); + AX_SAFE_RELEASE(_rt); } SpriteRenderTextureBug::SimpleSprite* SpriteRenderTextureBug::SimpleSprite::create(const char* filename, @@ -691,7 +691,7 @@ SpriteRenderTextureBug::SimpleSprite* SpriteRenderTextureBug::SimpleSprite::crea } else { - CC_SAFE_DELETE(sprite); + AX_SAFE_DELETE(sprite); } return sprite; @@ -714,7 +714,7 @@ void SpriteRenderTextureBug::SimpleSprite::draw(Renderer* renderer, const Mat4& SpriteRenderTextureBug::SpriteRenderTextureBug() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(SpriteRenderTextureBug::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(SpriteRenderTextureBug::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); diff --git a/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp b/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp index 3c0c0befef..112850770d 100644 --- a/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp +++ b/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp @@ -240,7 +240,7 @@ bool Scene3DTestScene::init() bool ret = false; do { - CC_BREAK_IF(false == TestCase::init()); + AX_BREAK_IF(false == TestCase::init()); // prepare for camera creation, we need several custom cameras _gameCameras.resize(CAMERA_COUNT); @@ -350,8 +350,8 @@ bool Scene3DTestScene::init() //////////////////////////////////////////////////////////////////////// // add touch event callback auto listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = CC_CALLBACK_2(Scene3DTestScene::onTouchBegan, this); - listener->onTouchEnded = CC_CALLBACK_2(Scene3DTestScene::onTouchEnd, this); + listener->onTouchBegan = AX_CALLBACK_2(Scene3DTestScene::onTouchBegan, this); + listener->onTouchEnded = AX_CALLBACK_2(Scene3DTestScene::onTouchEnd, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); ret = true; diff --git a/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp b/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp index 8ab329dbca..93f4121b8b 100644 --- a/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp +++ b/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp @@ -49,10 +49,10 @@ enum SceneTestLayer1::SceneTestLayer1() { - auto item1 = MenuItemFont::create("Test pushScene", CC_CALLBACK_1(SceneTestLayer1::onPushScene, this)); + auto item1 = MenuItemFont::create("Test pushScene", AX_CALLBACK_1(SceneTestLayer1::onPushScene, this)); auto item2 = - MenuItemFont::create("Test pushScene w/transition", CC_CALLBACK_1(SceneTestLayer1::onPushSceneTran, this)); - auto item3 = MenuItemFont::create("Quit", CC_CALLBACK_1(SceneTestLayer1::onQuit, this)); + MenuItemFont::create("Test pushScene w/transition", AX_CALLBACK_1(SceneTestLayer1::onPushSceneTran, this)); + auto item3 = MenuItemFont::create("Quit", AX_CALLBACK_1(SceneTestLayer1::onQuit, this)); auto menu = Menu::create(item1, item2, item3, nullptr); menu->alignItemsVertically(); @@ -67,7 +67,7 @@ SceneTestLayer1::SceneTestLayer1() auto repeat = RepeatForever::create(rotate); sprite->runAction(repeat); - schedule(CC_SCHEDULE_SELECTOR(SceneTestLayer1::testDealloc)); + schedule(AX_SCHEDULE_SELECTOR(SceneTestLayer1::testDealloc)); } void SceneTestLayer1::testDealloc(float dt) @@ -125,10 +125,10 @@ SceneTestLayer2::SceneTestLayer2() { _timeCounter = 0; - auto item1 = MenuItemFont::create("replaceScene", CC_CALLBACK_1(SceneTestLayer2::onReplaceScene, this)); + auto item1 = MenuItemFont::create("replaceScene", AX_CALLBACK_1(SceneTestLayer2::onReplaceScene, this)); auto item2 = - MenuItemFont::create("replaceScene w/transition", CC_CALLBACK_1(SceneTestLayer2::onReplaceSceneTran, this)); - auto item3 = MenuItemFont::create("Go Back", CC_CALLBACK_1(SceneTestLayer2::onGoBack, this)); + MenuItemFont::create("replaceScene w/transition", AX_CALLBACK_1(SceneTestLayer2::onReplaceSceneTran, this)); + auto item3 = MenuItemFont::create("Go Back", AX_CALLBACK_1(SceneTestLayer2::onGoBack, this)); auto menu = Menu::create(item1, item2, item3, nullptr); menu->alignItemsVertically(); @@ -143,7 +143,7 @@ SceneTestLayer2::SceneTestLayer2() auto repeat = RepeatForever::create(rotate); sprite->runAction(repeat); - schedule(CC_SCHEDULE_SELECTOR(SceneTestLayer2::testDealloc)); + schedule(AX_SCHEDULE_SELECTOR(SceneTestLayer2::testDealloc)); } void SceneTestLayer2::testDealloc(float dt) @@ -185,18 +185,18 @@ bool SceneTestLayer3::init() auto s = Director::getInstance()->getWinSize(); auto item0 = - MenuItemFont::create("Touch to pushScene (self)", CC_CALLBACK_1(SceneTestLayer3::item0Clicked, this)); - auto item1 = MenuItemFont::create("Touch to popScene", CC_CALLBACK_1(SceneTestLayer3::item1Clicked, this)); + MenuItemFont::create("Touch to pushScene (self)", AX_CALLBACK_1(SceneTestLayer3::item0Clicked, this)); + auto item1 = MenuItemFont::create("Touch to popScene", AX_CALLBACK_1(SceneTestLayer3::item1Clicked, this)); auto item2 = - MenuItemFont::create("Touch to popToRootScene", CC_CALLBACK_1(SceneTestLayer3::item2Clicked, this)); + MenuItemFont::create("Touch to popToRootScene", AX_CALLBACK_1(SceneTestLayer3::item2Clicked, this)); auto item3 = MenuItemFont::create("Touch to popToSceneStackLevel(2)", - CC_CALLBACK_1(SceneTestLayer3::item3Clicked, this)); + AX_CALLBACK_1(SceneTestLayer3::item3Clicked, this)); auto menu = Menu::create(item0, item1, item2, item3, nullptr); this->addChild(menu); menu->alignItemsVertically(); - this->schedule(CC_SCHEDULE_SELECTOR(SceneTestLayer3::testDealloc)); + this->schedule(AX_SCHEDULE_SELECTOR(SceneTestLayer3::testDealloc)); auto sprite = Sprite::create(s_pathGrossini); addChild(sprite); diff --git a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp index 6272d15a0a..e340d7ea79 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(CC_SCHEDULE_SELECTOR(SchedulerAutoremove::autoremove), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerAutoremove::tick), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerAutoremove::autoremove), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerAutoremove::tick), 0.5f); accum = 0; } @@ -85,7 +85,7 @@ void SchedulerAutoremove::autoremove(float dt) if (accum > 3) { - unschedule(CC_SCHEDULE_SELECTOR(SchedulerAutoremove::autoremove)); + unschedule(AX_SCHEDULE_SELECTOR(SchedulerAutoremove::autoremove)); CCLOG("autoremove scheduler: scheduler removed"); } } @@ -113,9 +113,9 @@ std::string SchedulerAutoremove::subtitle() const void SchedulerPauseResume::onEnter() { SchedulerTestLayer::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResume::tick1), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResume::tick2), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResume::pause), 3.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResume::tick1), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResume::tick2), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResume::pause), 3.0f); } void SchedulerPauseResume::tick1(float /*dt*/) @@ -164,9 +164,9 @@ void SchedulerPauseResumeAll::onEnter() sprite->runAction(RepeatForever::create(RotateBy::create(3.0f, 360.0f))); sprite->setTag(123); scheduleUpdate(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::tick1), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::tick2), 1.0f); - scheduleOnce(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::pause), 3.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::tick1), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::tick2), 1.0f); + scheduleOnce(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAll::pause), 3.0f); } void SchedulerPauseResumeAll::update(float /*delta*/) @@ -246,9 +246,9 @@ void SchedulerPauseResumeAllUser::onEnter() this->addChild(sprite); sprite->runAction(RepeatForever::create(RotateBy::create(3.0f, 360.0f))); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAllUser::tick1), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAllUser::tick2), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerPauseResumeAllUser::pause), 3.0f, false, 0); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAllUser::tick1), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAllUser::tick2), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerPauseResumeAllUser::pause), 3.0f, false, 0); } void SchedulerPauseResumeAllUser::onExit() @@ -305,11 +305,11 @@ void SchedulerUnscheduleAll::onEnter() { SchedulerTestLayer::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick1), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick2), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick3), 1.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick4), 1.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::unscheduleAll), 4); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick1), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick2), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick3), 1.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::tick4), 1.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAll::unscheduleAll), 4); } void SchedulerUnscheduleAll::tick1(float /*dt*/) @@ -365,11 +365,11 @@ void SchedulerUnscheduleAllHard::onEnter() _actionManagerActive = true; - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick1), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick2), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick3), 1.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick4), 1.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::unscheduleAll), 4); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick1), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick2), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick3), 1.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::tick4), 1.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllHard::unscheduleAll), 4); } void SchedulerUnscheduleAllHard::onExit() @@ -436,11 +436,11 @@ void SchedulerUnscheduleAllUserLevel::onEnter() this->addChild(sprite); sprite->runAction(RepeatForever::create(RotateBy::create(3.0f, 360.0f))); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick1), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick2), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick3), 1.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick4), 1.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::unscheduleAll), 4); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick1), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick2), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick3), 1.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::tick4), 1.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUnscheduleAllUserLevel::unscheduleAll), 4); } void SchedulerUnscheduleAllUserLevel::tick1(float /*dt*/) @@ -487,9 +487,9 @@ void SchedulerSchedulesAndRemove::onEnter() { SchedulerTestLayer::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick1), 0.5f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick2), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::scheduleAndUnschedule), 4.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick1), 0.5f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick2), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::scheduleAndUnschedule), 4.0f); } void SchedulerSchedulesAndRemove::tick1(float /*dt*/) @@ -524,12 +524,12 @@ std::string SchedulerSchedulesAndRemove::subtitle() const void SchedulerSchedulesAndRemove::scheduleAndUnschedule(float /*dt*/) { - unschedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick1)); - unschedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick2)); - unschedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::scheduleAndUnschedule)); + unschedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick1)); + unschedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick2)); + unschedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::scheduleAndUnschedule)); - schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick3), 1.0f); - schedule(CC_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick4), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick3), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerSchedulesAndRemove::tick4), 1.0f); } //------------------------------------------------------------------ @@ -589,7 +589,7 @@ void SchedulerUpdate::onEnter() addChild(f); f->release(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdate::removeUpdates), 4.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdate::removeUpdates), 4.0f); } void SchedulerUpdate::removeUpdates(float /*dt*/) @@ -629,8 +629,8 @@ void SchedulerUpdateAndCustom::onEnter() SchedulerTestLayer::onEnter(); scheduleUpdate(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateAndCustom::tick)); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateAndCustom::stopSelectors), 0.4f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateAndCustom::tick)); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateAndCustom::stopSelectors), 0.4f); } void SchedulerUpdateAndCustom::update(float dt) @@ -668,7 +668,7 @@ void SchedulerUpdateFromCustom::onEnter() { SchedulerTestLayer::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::schedUpdate), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::schedUpdate), 2.0f); } void SchedulerUpdateFromCustom::update(float dt) @@ -678,15 +678,15 @@ void SchedulerUpdateFromCustom::update(float dt) void SchedulerUpdateFromCustom::schedUpdate(float /*dt*/) { - unschedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::schedUpdate)); + unschedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::schedUpdate)); scheduleUpdate(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::stopUpdate), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::stopUpdate), 2.0f); } void SchedulerUpdateFromCustom::stopUpdate(float /*dt*/) { unscheduleUpdate(); - unschedule(CC_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::stopUpdate)); + unschedule(AX_SCHEDULE_SELECTOR(SchedulerUpdateFromCustom::stopUpdate)); } std::string SchedulerUpdateFromCustom::title() const @@ -710,7 +710,7 @@ void RescheduleSelector::onEnter() _interval = 1.0f; _ticks = 0; - schedule(CC_SCHEDULE_SELECTOR(RescheduleSelector::schedUpdate), _interval); + schedule(AX_SCHEDULE_SELECTOR(RescheduleSelector::schedUpdate), _interval); } std::string RescheduleSelector::title() const @@ -731,7 +731,7 @@ void RescheduleSelector::schedUpdate(float dt) if (_ticks > 3) { _interval += 1.0f; - schedule(CC_SCHEDULE_SELECTOR(RescheduleSelector::schedUpdate), _interval); + schedule(AX_SCHEDULE_SELECTOR(RescheduleSelector::schedUpdate), _interval); _ticks = 0; } } @@ -741,7 +741,7 @@ void RescheduleSelector::schedUpdate(float dt) void SchedulerDelayAndRepeat::onEnter() { SchedulerTestLayer::onEnter(); - schedule(CC_SCHEDULE_SELECTOR(SchedulerDelayAndRepeat::update), 0, 4, 3.f); + schedule(AX_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() { - CC_SAFE_RELEASE(testNode); + AX_SAFE_RELEASE(testNode); } std::string SchedulerIssue2268::title() const @@ -1125,7 +1125,7 @@ std::string ScheduleCallbackTest::subtitle() const { return "\n\n\n\nPlease see console.\n\ schedule(lambda, ...)\n\ -schedule(CC_CALLBACK_1(XXX::member_function), this), this, ...)\n\ +schedule(AX_CALLBACK_1(XXX::member_function), this), this, ...)\n\ schedule(global_function, ...)\n\ "; } @@ -1142,14 +1142,14 @@ void ScheduleCallbackTest::onEnter() _scheduler->schedule([](float dt) { log("In the callback of schedule(lambda, ...), dt = %f", dt); }, this, 1.0f, false, "lambda"); - _scheduler->schedule(CC_CALLBACK_1(ScheduleCallbackTest::callback, this), this, 1.0f, false, "member_function"); + _scheduler->schedule(AX_CALLBACK_1(ScheduleCallbackTest::callback, this), this, 1.0f, false, "member_function"); _scheduler->schedule(ScheduleCallbackTest_global_callback, this, 1.0f, false, "global_function"); } void ScheduleCallbackTest::callback(float dt) { - log("In the callback of schedule(CC_CALLBACK_1(XXX::member_function), this), this, ...), dt = %f", dt); + log("In the callback of schedule(AX_CALLBACK_1(XXX::member_function), this), this, ...), dt = %f", dt); } // ScheduleUpdatePriority @@ -1179,7 +1179,7 @@ void ScheduleUpdatePriority::onEnter() scheduleUpdate(); auto listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = CC_CALLBACK_2(ScheduleUpdatePriority::onTouchBegan, this); + listener->onTouchBegan = AX_CALLBACK_2(ScheduleUpdatePriority::onTouchBegan, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -1425,7 +1425,7 @@ void SchedulerRemoveSelectorDuringCall::onEnter() Scheduler* const scheduler(Director::getInstance()->getScheduler()); scheduler->setTimeScale(10); - scheduler->schedule(SEL_SCHEDULE(&SchedulerRemoveSelectorDuringCall::callback), this, 0.01f, CC_REPEAT_FOREVER, + scheduler->schedule(SEL_SCHEDULE(&SchedulerRemoveSelectorDuringCall::callback), this, 0.01f, AX_REPEAT_FOREVER, 0.0f, !isRunning()); _scheduled = true; diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp index 9319646c46..d4c2656ef3 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp @@ -113,7 +113,7 @@ bool ShaderNode::initWithVertex(std::string_view vert, std::string_view frag) /* * TODO: the Y-coordinate of subclasses are flipped in metal * - * keywords: CC_USE_METAL , CC_USE_GL + * keywords: AX_USE_METAL , AX_USE_GL */ _customCommand.createVertexBuffer(sizeof(Vec2), 6, CustomCommand::BufferUsage::STATIC); @@ -146,8 +146,8 @@ void ShaderNode::loadShaderVertex(std::string_view vert, std::string_view frag) auto program = backend::Device::getInstance()->newProgram(vertSource.c_str(), fragSource.c_str()); auto programState = new backend::ProgramState(program); setProgramState(programState); - CC_SAFE_RELEASE(programState); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(programState); + AX_SAFE_RELEASE(program); } void ShaderNode::update(float dt) @@ -188,7 +188,7 @@ void ShaderNode::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) _programState->setUniform(_locCosTime, &cosTime, sizeof(cosTime)); renderer->addCommand(&_customCommand); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 6); + AX_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 6); } void ShaderNode::updateUniforms() @@ -421,7 +421,7 @@ SpriteBlur* SpriteBlur::create(const char* pszFileName) } else { - CC_SAFE_DELETE(pRet); + AX_SAFE_DELETE(pRet); } return pRet; @@ -432,7 +432,7 @@ bool SpriteBlur::initWithTexture(Texture2D* texture, const Rect& rect) _blurRadius = 0; if (Sprite::initWithTexture(texture, rect)) { -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA auto listener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom* event) { initProgram(); }); @@ -455,8 +455,8 @@ void SpriteBlur::initProgram() auto program = backend::Device::getInstance()->newProgram(positionTextureColor_vert, fragSource.data()); auto programState = new backend::ProgramState(program); setProgramState(programState); - CC_SAFE_RELEASE(programState); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(programState); + AX_SAFE_RELEASE(program); auto size = getTexture()->getContentSizeInPixels(); @@ -599,14 +599,14 @@ bool ShaderRetroEffect::init() _label = Label::createWithBMFont("fonts/west_england-64.fnt", "RETRO EFFECT"); _label->setAnchorPoint(Vec2::ANCHOR_MIDDLE); _label->setProgramState(p); - CC_SAFE_RELEASE(p); + AX_SAFE_RELEASE(p); _label->setPosition(Vec2(s.width / 2, s.height / 2)); addChild(_label); scheduleUpdate(); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(program); return true; } @@ -780,13 +780,13 @@ bool ShaderMultiTexture::init() // menu auto label = Label::createWithTTF(TTFConfig("fonts/arial.ttf"), "change"); - auto mi = MenuItemLabel::create(label, CC_CALLBACK_1(ShaderMultiTexture::changeTexture, this)); + auto mi = MenuItemLabel::create(label, AX_CALLBACK_1(ShaderMultiTexture::changeTexture, this)); auto menu = Menu::create(mi, nullptr); addChild(menu); menu->setPosition(s.width * 7 / 8, s.height / 2); - CC_SAFE_RELEASE(programState); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(programState); + AX_SAFE_RELEASE(program); return true; } diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.vsh.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.vsh.h index 06c0a17bc2..68aa81afc5 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.vsh.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.vsh.h @@ -27,6 +27,6 @@ static const char* shadertestvsh = STRINGIFY( attribute vec4 a_position; - void main() { gl_Position = CC_MVPMatrix * a_position; } + void main() { gl_Position = AX_MVPMatrix * a_position; } ); diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp index 1cdeab29ee..b4239200c1 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp @@ -87,7 +87,7 @@ public: ret->autorelease(); return ret; } - CC_SAFE_RELEASE(ret); + AX_SAFE_RELEASE(ret); return nullptr; } @@ -97,9 +97,9 @@ public: { effect->setTarget(this); - CC_SAFE_RELEASE(_defaultEffect); + AX_SAFE_RELEASE(_defaultEffect); _defaultEffect = effect; - CC_SAFE_RETAIN(_defaultEffect); + AX_SAFE_RETAIN(_defaultEffect); setProgramState(_defaultEffect->getProgramState()); } @@ -116,7 +116,7 @@ public: void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override { -#if CC_USE_CULLING +#if AX_USE_CULLING // Don't do calculate the culling if the transform was not updated _insideBounds = (flags & FLAGS_TRANSFORM_DIRTY) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; @@ -170,7 +170,7 @@ protected: { std::get<1>(tuple)->release(); } - CC_SAFE_RELEASE(_defaultEffect); + AX_SAFE_RELEASE(_defaultEffect); } std::vector> _effects; @@ -187,13 +187,13 @@ bool Effect::initProgramState(std::string_view fragmentFilename) auto fragmentFullPath = fileUtiles->fullPathForFilename(fragmentFilename); auto fragSource = fileUtiles->getStringFromFile(fragmentFullPath); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) _fragSource = fragSource; #endif auto program = backend::Device::getInstance()->newProgram(positionTextureColor_vert, fragSource.c_str()); auto programState = new backend::ProgramState(program); - CC_SAFE_RELEASE(_programState); - CC_SAFE_RELEASE(program); + AX_SAFE_RELEASE(_programState); + AX_SAFE_RELEASE(program); _programState = programState; return _programState != nullptr; @@ -203,7 +203,7 @@ Effect::Effect() {} Effect::~Effect() { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); } // Blur @@ -416,7 +416,7 @@ public: normalMappedSprite->autorelease(); return normalMappedSprite; } - CC_SAFE_DELETE(normalMappedSprite); + AX_SAFE_DELETE(normalMappedSprite); return nullptr; } void setKBump(float value); @@ -566,9 +566,9 @@ bool EffectSpriteLamp::init() _sprite->setEffect(lampEffect); _effect = lampEffect; auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(EffectSpriteLamp::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(EffectSpriteLamp::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(EffectSpriteLamp::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(EffectSpriteLamp::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(EffectSpriteLamp::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(EffectSpriteLamp::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); return true; } diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h index d025387e96..4611ba839d 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h @@ -52,7 +52,7 @@ protected: Effect(); virtual ~Effect(); axis::backend::ProgramState* _programState = nullptr; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) std::string _fragSource; axis::EventListenerCustom* _backgroundListener; #endif diff --git a/tests/cpp-tests/Classes/ShaderTest/shaderTest.psh.h b/tests/cpp-tests/Classes/ShaderTest/shaderTest.psh.h index fbd2c0be7f..ca839d53ea 100644 --- a/tests/cpp-tests/Classes/ShaderTest/shaderTest.psh.h +++ b/tests/cpp-tests/Classes/ShaderTest/shaderTest.psh.h @@ -29,7 +29,7 @@ static const char* starFlame = STRINGIFY( uniform vec2 center; uniform vec2 resolution; vec2 iResolution = resolution; // viewport resolution (in pixels) - float iGlobalTime = CC_Time[1]; // shader playback time (in seconds) + float iGlobalTime = AX_Time[1]; // shader playback time (in seconds) // uniform float iChannelTime[4]; // channel playback time (in seconds) // uniform vec3 iChannelResolution[4]; // channel resolution (in pixels) vec4 iMouse = vec4(0, 0, 0, 0); // mouse pixel coords. xy: current (if MLB down), zw: click @@ -102,7 +102,7 @@ static const char* starNestFrg = STRINGIFY( vec2 iCenter = center; vec2 iResolution = resolution; // viewport resolution (in pixels) - float iGlobalTime = CC_Time[1]; // shader playback time (in seconds) + float iGlobalTime = AX_Time[1]; // shader playback time (in seconds) // uniform float iChannelTime[4]; // channel playback time (in seconds) // uniform vec3 iChannelResolution[4]; // channel resolution (in pixels) vec4 iMouse = vec4(0, 0, 0, 0); // mouse pixel coords. xy: current (if MLB down), zw: click @@ -189,7 +189,7 @@ static const char* shadertoyRelentlessFrag = STRINGIFY( vec2 iCenter = center; vec2 iResolution = resolution; // viewport resolution (in pixels) - float iGlobalTime = CC_Time[1]; // shader playback time (in seconds) + float iGlobalTime = AX_Time[1]; // shader playback time (in seconds) // uniform float iChannelTime[4]; // channel playback time (in seconds) // uniform vec3 iChannelResolution[4]; // channel resolution (in pixels) diff --git a/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp b/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp index 54a61163d0..0fc08879ea 100644 --- a/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp +++ b/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp @@ -85,8 +85,8 @@ void SpriteFrameCachePixelFormatTest::loadSpriteFrames(std::string_view file, const ssize_t bitsPerKB = 8 * 1024; const double memorySize = 1.0 * texture->getBitsPerPixelForFormat() * texture->getContentSizeInPixels().width * texture->getContentSizeInPixels().height / bitsPerKB; -#ifndef CC_USE_METAL - CC_ASSERT(texture->getPixelFormat() == expectedFormat); +#ifndef AX_USE_METAL + AX_ASSERT(texture->getPixelFormat() == expectedFormat); #endif const std::string textureInfo = StringUtils::format("%s%s: %.2f KB\r\n", infoLabel->getString().data(), texture->getStringForFormat(), memorySize); @@ -113,7 +113,7 @@ void SpriteFrameCacheLoadMultipleTimes::loadSpriteFrames(std::string_view file, SpriteFrameCache::getInstance()->addSpriteFramesWithFile(file); SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName("sprite_frames_test/grossini.png"); Texture2D* texture = spriteFrame->getTexture(); - CC_ASSERT(texture->getPixelFormat() == expectedFormat); + AX_ASSERT(texture->getPixelFormat() == expectedFormat); SpriteFrameCache::getInstance()->removeSpriteFrameByName("sprite_frames_test/grossini.png"); Director::getInstance()->getTextureCache()->removeTexture(texture); @@ -411,7 +411,7 @@ protected: spriteSheet->full = true; - CC_SAFE_DELETE(image); + AX_SAFE_DELETE(image); } void reloadSpriteFramesWithDictionary(const rapidjson::Document& doc, @@ -500,8 +500,8 @@ void SpriteFrameCacheJsonAtlasTest::loadSpriteFrames(std::string_view file, const ssize_t bitsPerKB = 8 * 1024; const double memorySize = 1.0 * texture->getBitsPerPixelForFormat() * texture->getContentSizeInPixels().width * texture->getContentSizeInPixels().height / bitsPerKB; -#ifndef CC_USE_METAL - CC_ASSERT(texture->getPixelFormat() == expectedFormat); +#ifndef AX_USE_METAL + AX_ASSERT(texture->getPixelFormat() == expectedFormat); #endif const std::string textureInfo = StringUtils::format("%s%s: %.2f KB\r\n", infoLabel->getString().data(), texture->getStringForFormat(), memorySize); diff --git a/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.cpp b/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.cpp index 921b9bfc9f..0e9f4edcf2 100644 --- a/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.cpp +++ b/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.cpp @@ -306,7 +306,7 @@ void SpritePolygonTestSlider::initSliders() _epsilonLabel->setPosition(Vec2(vsize.width / 2, vsize.height / 4 + 15)); addChild(slider); - slider->addEventListener(CC_CALLBACK_2(SpritePolygonTestSlider::changeEpsilon, this)); + slider->addEventListener(AX_CALLBACK_2(SpritePolygonTestSlider::changeEpsilon, this)); slider->setPercent((int)(sqrtf(1.0f / 19.0f) * 100)); } diff --git a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp index 1760c1584e..01fec9f83e 100644 --- a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp +++ b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp @@ -148,7 +148,7 @@ SpriteTests::SpriteTests() Sprite1::Sprite1() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(Sprite1::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(Sprite1::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -214,7 +214,7 @@ std::string Sprite1::subtitle() const SpriteBatchNode1::SpriteBatchNode1() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(SpriteBatchNode1::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(SpriteBatchNode1::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto BatchNode = SpriteBatchNode::create("Images/grossini_dance_atlas.png", 50); @@ -336,7 +336,7 @@ SpriteColorOpacity::SpriteColorOpacity() addChild(sprite7, 0, kTagSprite7); addChild(sprite8, 0, kTagSprite8); - schedule(CC_CALLBACK_1(SpriteColorOpacity::removeAndAddSprite, this), 2, "remove_add_key"); + schedule(AX_CALLBACK_1(SpriteColorOpacity::removeAndAddSprite, this), 2, "remove_add_key"); } // this function test if remove and add works as expected: @@ -448,7 +448,7 @@ SpriteColorOpacityHSVHSL::SpriteColorOpacityHSVHSL() addChild(sprite7, 0, kTagSprite7); addChild(sprite8, 0, kTagSprite8); - schedule(CC_CALLBACK_1(SpriteColorOpacityHSVHSL::removeAndAddSprite, this), 2, "remove_add_key"); + schedule(AX_CALLBACK_1(SpriteColorOpacityHSVHSL::removeAndAddSprite, this), 2, "remove_add_key"); } // this function test if remove and add works as expected: @@ -538,7 +538,7 @@ SpriteBatchNodeColorOpacity::SpriteBatchNodeColorOpacity() batch->addChild(sprite7, 0, kTagSprite7); batch->addChild(sprite8, 0, kTagSprite8); - schedule(CC_CALLBACK_1(SpriteBatchNodeColorOpacity::removeAndAddSprite, this), 2, "remove_add_key"); + schedule(AX_CALLBACK_1(SpriteBatchNodeColorOpacity::removeAndAddSprite, this), 2, "remove_add_key"); } // this function test if remove and add works as expected: @@ -599,7 +599,7 @@ SpriteZOrder::SpriteZOrder() sprite->setScaleX(6); sprite->setColor(Color3B::RED); - schedule(CC_CALLBACK_1(SpriteZOrder::reorderSprite, this), 1, "reorder_key"); + schedule(AX_CALLBACK_1(SpriteZOrder::reorderSprite, this), 1, "reorder_key"); } void SpriteZOrder::reorderSprite(float dt) @@ -666,7 +666,7 @@ SpriteBatchNodeZOrder::SpriteBatchNodeZOrder() sprite->setScaleX(6); sprite->setColor(Color3B::RED); - schedule(CC_CALLBACK_1(SpriteBatchNodeZOrder::reorderSprite, this), 1, "reorder_key"); + schedule(AX_CALLBACK_1(SpriteBatchNodeZOrder::reorderSprite, this), 1, "reorder_key"); } void SpriteBatchNodeZOrder::reorderSprite(float dt) @@ -722,7 +722,7 @@ SpriteBatchNodeReorder::SpriteBatchNodeReorder() } } - ssize_t CC_UNUSED prev = -1; + ssize_t AX_UNUSED prev = -1; auto& children = asmtest->getChildren(); @@ -797,23 +797,23 @@ std::string SpriteBatchNodeReorderIssue744::subtitle() const Sprite* SpriteBatchNodeReorderIssue766::makeSpriteZ(int aZ) { Rect rcw(128, 0, 64, 64); - rcw = CC_RECT_PIXELS_TO_POINTS(rcw); + rcw = AX_RECT_PIXELS_TO_POINTS(rcw); auto sprite = Sprite::createWithTexture(batchNode->getTexture(), rcw); - sprite->setScale(CC_CONTENT_SCALE_FACTOR()); + sprite->setScale(AX_CONTENT_SCALE_FACTOR()); batchNode->addChild(sprite, aZ + 1, 0); // children Rect rc1(0, 0, 64, 64); - rc1 = CC_RECT_PIXELS_TO_POINTS(rc1); + rc1 = AX_RECT_PIXELS_TO_POINTS(rc1); auto spriteShadow = Sprite::createWithTexture(batchNode->getTexture(), rc1); spriteShadow->setOpacity(128); - sprite->setScale(CC_CONTENT_SCALE_FACTOR()); + sprite->setScale(AX_CONTENT_SCALE_FACTOR()); sprite->addChild(spriteShadow, aZ, 3); Rect rc2(64, 0, 64, 64); - rc2 = CC_RECT_PIXELS_TO_POINTS(rc2); + rc2 = AX_RECT_PIXELS_TO_POINTS(rc2); auto spriteTop = Sprite::createWithTexture(batchNode->getTexture(), rc2); - sprite->setScale(CC_CONTENT_SCALE_FACTOR()); + sprite->setScale(AX_CONTENT_SCALE_FACTOR()); sprite->addChild(spriteTop, aZ + 2, 3); return sprite; @@ -841,7 +841,7 @@ SpriteBatchNodeReorderIssue766::SpriteBatchNodeReorderIssue766() sprite3 = makeSpriteZ(4); sprite3->setPosition(Vec2(328.0f, 160.0f)); - schedule(CC_CALLBACK_1(SpriteBatchNodeReorderIssue766::reorderSprite, this), 2, "issue_766_key"); + schedule(AX_CALLBACK_1(SpriteBatchNodeReorderIssue766::reorderSprite, this), 2, "issue_766_key"); } std::string SpriteBatchNodeReorderIssue766::title() const @@ -915,7 +915,7 @@ SpriteBatchNodeReorderIssue767::SpriteBatchNodeReorderIssue767() l3b2->setPosition(Vec2(0 + l2bSize.width / 2, +50 + l2bSize.height / 2)); l2b->addChild(l3b2, 1); - schedule(CC_CALLBACK_1(SpriteBatchNodeReorderIssue767::reorderSprites, this), 1, "issue_767_key"); + schedule(AX_CALLBACK_1(SpriteBatchNodeReorderIssue767::reorderSprites, this), 1, "issue_767_key"); } std::string SpriteBatchNodeReorderIssue767::title() const @@ -1362,7 +1362,7 @@ SpriteFlip::SpriteFlip() sprite2->setPosition(Vec2(s.width / 2 + 100, s.height / 2)); addChild(sprite2, 0, kTagSprite2); - schedule(CC_CALLBACK_1(SpriteFlip::flipSprites, this), 1, "sprite_flip_key"); + schedule(AX_CALLBACK_1(SpriteFlip::flipSprites, this), 1, "sprite_flip_key"); } void SpriteFlip::flipSprites(float dt) @@ -1409,7 +1409,7 @@ SpriteBatchNodeFlip::SpriteBatchNodeFlip() sprite2->setPosition(Vec2(s.width / 2 + 100, s.height / 2)); batch->addChild(sprite2, 0, kTagSprite2); - schedule(CC_CALLBACK_1(SpriteBatchNodeFlip::flipSprites, this), 1, "flip_sprites_key"); + schedule(AX_CALLBACK_1(SpriteBatchNodeFlip::flipSprites, this), 1, "flip_sprites_key"); } void SpriteBatchNodeFlip::flipSprites(float dt) @@ -1562,7 +1562,7 @@ std::string SpriteBatchNodeAliased::subtitle() const SpriteNewTexture::SpriteNewTexture() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(SpriteNewTexture::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(SpriteNewTexture::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto node = Node::create(); @@ -1670,7 +1670,7 @@ std::string SpriteNewTexture::subtitle() const SpriteBatchNodeNewTexture::SpriteBatchNodeNewTexture() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(SpriteBatchNodeNewTexture::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(SpriteBatchNodeNewTexture::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto batch = SpriteBatchNode::create("Images/grossini_dance_atlas.png", 50); @@ -1825,7 +1825,7 @@ void SpriteFrameTest::onEnter() _sprite2->setFlippedX(false); _sprite2->setFlippedY(false); - schedule(CC_CALLBACK_1(SpriteFrameTest::startIn05Secs, this), 0.5f, "in_05_secs_key"); + schedule(AX_CALLBACK_1(SpriteFrameTest::startIn05Secs, this), 0.5f, "in_05_secs_key"); _counter = 0; } @@ -1851,7 +1851,7 @@ std::string SpriteFrameTest::subtitle() const void SpriteFrameTest::startIn05Secs(float dt) { unschedule("in_05_secs_key"); - schedule(CC_CALLBACK_1(SpriteFrameTest::flipSprites, this), 1.0f, "flip_sprites_key"); + schedule(AX_CALLBACK_1(SpriteFrameTest::flipSprites, this), 1.0f, "flip_sprites_key"); } void SpriteFrameTest::flipSprites(float dt) @@ -1984,7 +1984,7 @@ void SpriteFramesFromFileContent::onEnter() texture->initWithImage(image); texture->autorelease(); - CC_SAFE_RELEASE(image); + AX_SAFE_RELEASE(image); auto cache = SpriteFrameCache::getInstance(); cache->addSpriteFramesWithFileContent(plist_content, texture); @@ -2471,7 +2471,7 @@ SpriteHybrid::SpriteHybrid() _usingSpriteBatchNode = false; - schedule(CC_CALLBACK_1(SpriteHybrid::reparentSprite, this), 2, "reparent_sprite_key"); + schedule(AX_CALLBACK_1(SpriteHybrid::reparentSprite, this), 2, "reparent_sprite_key"); } void SpriteHybrid::reparentSprite(float dt) @@ -4285,7 +4285,7 @@ NodeSort::NodeSort() _sprite5->setPosition(Vec2(356.0f, 160.0f)); _node->addChild(_sprite5, -3, 5); - schedule(CC_CALLBACK_1(NodeSort::reorderSprite, this), "reorder_sprite_key"); + schedule(AX_CALLBACK_1(NodeSort::reorderSprite, this), "reorder_sprite_key"); } std::string NodeSort::title() const @@ -4348,7 +4348,7 @@ SpriteBatchNodeReorderSameIndex::SpriteBatchNodeReorderSameIndex() _sprite5->setPosition(Vec2(356.0f, 160.0f)); _batchNode->addChild(_sprite5, 6, 5); - scheduleOnce(CC_CALLBACK_1(SpriteBatchNodeReorderSameIndex::reorderSprite, this), 2, "reorder_sprite_key"); + scheduleOnce(AX_CALLBACK_1(SpriteBatchNodeReorderSameIndex::reorderSprite, this), 2, "reorder_sprite_key"); } std::string SpriteBatchNodeReorderSameIndex::title() const @@ -4444,7 +4444,7 @@ SpriteBatchNodeReorderOneChild::SpriteBatchNodeReorderOneChild() l3b2->setPosition(Vec2(0 + l2bSize.width / 2, +50 + l2bSize.height / 2)); l2b->addChild(l3b2); - scheduleOnce(CC_CALLBACK_1(SpriteBatchNodeReorderOneChild::reorderSprite, this), 2.0f, "reorder_sprite_key"); + scheduleOnce(AX_CALLBACK_1(SpriteBatchNodeReorderOneChild::reorderSprite, this), 2.0f, "reorder_sprite_key"); } void SpriteBatchNodeReorderOneChild::reorderSprite(float dt) @@ -5075,7 +5075,7 @@ SpriteGetSpriteFrameTest::SpriteGetSpriteFrameTest() // Create reference sprite that's rotating based on there anchor point auto s3 = Sprite::createWithSpriteFrameName("grossini.png"); addChild(s3); - s3->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); + s3->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); s3->setPosition(s.width / 2 + s.width / 3, s.height / 2); s3->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s3->setSpriteFrame(s3->getSpriteFrame()); @@ -5317,9 +5317,9 @@ SpriteSlice9Test4::SpriteSlice9Test4() // enable slice 9, only in the first row if (i == 2) { - s1->setCenterRect(CC_RECT_PIXELS_TO_POINTS(Rect(6, 14, 2, 4))); - s2->setCenterRect(CC_RECT_PIXELS_TO_POINTS(Rect(6, 14, 2, 4))); - s3->setCenterRect(CC_RECT_PIXELS_TO_POINTS(Rect(6, 14, 2, 4))); + s1->setCenterRect(AX_RECT_PIXELS_TO_POINTS(Rect(6, 14, 2, 4))); + s2->setCenterRect(AX_RECT_PIXELS_TO_POINTS(Rect(6, 14, 2, 4))); + s3->setCenterRect(AX_RECT_PIXELS_TO_POINTS(Rect(6, 14, 2, 4))); } // "anchor points" @@ -5356,7 +5356,7 @@ SpriteSlice9Test5::SpriteSlice9Test5() auto s1 = Sprite::create("Images/grossinis_heads.png"); addChild(s1); s1->getTexture()->setAliasTexParameters(); - s1->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); + s1->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); s1->setPosition(s.width / 2 - s.width / 3, s.height / 2); s1->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s1->setContentSize(Size(s.width / 3, s.height)); @@ -5366,7 +5366,7 @@ SpriteSlice9Test5::SpriteSlice9Test5() // Create reference sprite that's rotating based on there anchor point auto s2 = Sprite::create("Images/grossinis_heads.png"); addChild(s2); - s2->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); + s2->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); s2->setPosition(s.width * 2 / 4, s.height / 2); s2->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s2->setContentSize(Size(s.width / 3, s.height)); @@ -5376,7 +5376,7 @@ SpriteSlice9Test5::SpriteSlice9Test5() // Create reference sprite that's rotating based on there anchor point auto s3 = Sprite::create("Images/grossinis_heads.png"); addChild(s3); - s3->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); + s3->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); s3->setPosition(s.width / 2 + s.width / 3, s.height / 2); s3->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s3->setContentSize(Size(s.width / 3, s.height)); @@ -5432,7 +5432,7 @@ SpriteSlice9Test6::SpriteSlice9Test6() auto s1 = Sprite::create("Images/grossinis_heads.png"); addChild(s1); s1->getTexture()->setAliasTexParameters(); - s1->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); + s1->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); s1->setPosition(s.width / 2 - s.width / 3, s.height / 2); s1->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s1->setContentSize(Size(s.width / 3, s.height)); @@ -5442,7 +5442,7 @@ SpriteSlice9Test6::SpriteSlice9Test6() // Create reference sprite that's rotating based on there anchor point auto s2 = Sprite::create("Images/grossinis_heads.png"); addChild(s2); - s2->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); + s2->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); s2->setPosition(s.width * 2 / 4, s.height / 2); s2->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s2->setContentSize(Size(s.width / 3, s.height)); @@ -5452,7 +5452,7 @@ SpriteSlice9Test6::SpriteSlice9Test6() // Create reference sprite that's rotating based on there anchor point auto s3 = Sprite::create("Images/grossinis_heads.png"); addChild(s3); - s3->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); + s3->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); s3->setPosition(s.width / 2 + s.width / 3, s.height / 2); s3->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s3->setContentSize(Size(s.width / 3, s.height)); @@ -5508,7 +5508,7 @@ SpriteSlice9Test7::SpriteSlice9Test7() auto s1 = Sprite::create("Images/grossinis_heads.png"); addChild(s1); s1->getTexture()->setAliasTexParameters(); - s1->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); + s1->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(0, 0, 64, 128))); s1->setPosition(s.width / 2 - s.width / 3, s.height / 2); s1->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s1->setContentSize(Size(s.width / 3, s.height)); @@ -5517,7 +5517,7 @@ SpriteSlice9Test7::SpriteSlice9Test7() // Create reference sprite that's rotating based on there anchor point auto s2 = Sprite::create("Images/grossinis_heads.png"); addChild(s2); - s2->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); + s2->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(64, 0, 64, 128))); s2->setPosition(s.width * 2 / 4, s.height / 2); s2->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s2->setContentSize(Size(s.width / 3, s.height)); @@ -5526,7 +5526,7 @@ SpriteSlice9Test7::SpriteSlice9Test7() // Create reference sprite that's rotating based on there anchor point auto s3 = Sprite::create("Images/grossinis_heads.png"); addChild(s3); - s3->setTextureRect(CC_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); + s3->setTextureRect(AX_RECT_PIXELS_TO_POINTS(Rect(128, 0, 64, 128))); s3->setPosition(s.width / 2 + s.width / 3, s.height / 2); s3->setAnchorPoint(Vec2::ANCHOR_MIDDLE); s3->setContentSize(Size(s.width / 3, s.height)); diff --git a/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp b/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp index 93613aa65d..a5f1b0fed2 100644 --- a/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp +++ b/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp @@ -58,7 +58,7 @@ TerrainSimple::TerrainSimple() _terrain->setCameraMask(2); _terrain->setDrawWire(false); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(TerrainSimple::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(TerrainSimple::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // add Particle3D for test blend auto rootps = PUParticleSystem3D::create("Particle3D/scripts/mp_torch.pu"); @@ -113,8 +113,8 @@ std::string TerrainWalkThru::subtitle() const TerrainWalkThru::TerrainWalkThru() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(TerrainWalkThru::onTouchesBegan, this); - listener->onTouchesEnded = CC_CALLBACK_2(TerrainWalkThru::onTouchesEnd, this); + listener->onTouchesBegan = AX_CALLBACK_2(TerrainWalkThru::onTouchesBegan, this); + listener->onTouchesEnded = AX_CALLBACK_2(TerrainWalkThru::onTouchesEnd, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); Size visibleSize = Director::getInstance()->getVisibleSize(); @@ -334,7 +334,7 @@ Player* Player::create(const char* file, Camera* cam, Terrain* terrain) player->scheduleUpdate(); return player; } - CC_SAFE_DELETE(player); + AX_SAFE_DELETE(player); return nullptr; } @@ -361,7 +361,7 @@ TerrainWithLightMap::TerrainWithLightMap() _terrain->setDrawWire(false); _terrain->setLightMap("TerrainTest/Lightmap.png"); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(TerrainWithLightMap::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(TerrainWithLightMap::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } std::string TerrainWithLightMap::title() const diff --git a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp index 8efaf45fca..d9d2908cf4 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 = CC_CALLBACK_2(KeyboardNotificationLayer::onTouchBegan, this); - listener->onTouchEnded = CC_CALLBACK_2(KeyboardNotificationLayer::onTouchEnded, this); + listener->onTouchBegan = AX_CALLBACK_2(KeyboardNotificationLayer::onTouchBegan, this); + listener->onTouchEnded = AX_CALLBACK_2(KeyboardNotificationLayer::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -174,7 +174,7 @@ void TextFieldTTFDefaultTest::onEnter() auto pTextField = TextFieldTTF::textFieldWithPlaceHolder("", FONT_NAME, FONT_SIZE); addChild(pTextField); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) // on android, TextFieldTTF cannot auto adjust its position when soft-keyboard pop up // so we had to set a higher position to make it visible pTextField->setPosition(Vec2(s.width / 2, s.height / 2 + 50)); @@ -229,7 +229,7 @@ void TextFieldTTFActionTest::onEnter() _textField->setDelegate(this); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) // on android, TextFieldTTF cannot auto adjust its position when soft-keyboard pop up // so we had to set a higher position _textField->setPosition(Vec2(s.width / 2, s.height / 2 + 50)); @@ -304,7 +304,7 @@ bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF* sender, const c auto seq = Sequence::create( Spawn::create(MoveTo::create(duration, endPos), ScaleTo::create(duration, 1), FadeOut::create(duration), nullptr), - CallFuncN::create(CC_CALLBACK_1(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction, this)), nullptr); + CallFuncN::create(AX_CALLBACK_1(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction, this)), nullptr); label->runAction(seq); return false; } @@ -333,7 +333,7 @@ bool TextFieldTTFActionTest::onTextFieldDeleteBackward(TextFieldTTF* sender, con Spawn::create(MoveTo::create(duration, endPos), Repeat::create(RotateBy::create(rotateDuration, (rand() % 2) ? 360 : -360), repeatTime), FadeOut::create(duration), nullptr), - CallFuncN::create(CC_CALLBACK_1(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction, this)), nullptr); + CallFuncN::create(AX_CALLBACK_1(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction, this)), nullptr); label->runAction(seq); return false; } @@ -367,7 +367,7 @@ void TextFieldTTFSecureTextEntryTest::onEnter() auto pTextField = TextFieldTTF::textFieldWithPlaceHolder("", FONT_NAME, FONT_SIZE); addChild(pTextField); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) // on android, TextFieldTTF cannot auto adjust its position when soft-keyboard pop up // so we had to set a higher position to make it visible pTextField->setPosition(Vec2(s.width / 2, s.height / 2 + 50)); @@ -418,7 +418,7 @@ void TextFieldTTSetCursorFromPoint::onEnter() auto pTextField = TextFieldTTF::textFieldWithPlaceHolder("", FONT_NAME, FONT_SIZE); addChild(pTextField); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) // on android, TextFieldTTF cannot auto adjust its position when soft-keyboard pop up // so we had to set a higher position to make it visible pTextField->setPosition(Vec2(s.width / 2, s.height / 2 + 50)); diff --git a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp index 1fb9c1766d..892c24f229 100644 --- a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp +++ b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp @@ -188,7 +188,7 @@ std::string TextureASTC::title() const TextureETC1Alpha::TextureETC1Alpha() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(TextureETC1Alpha::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(TextureETC1Alpha::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -269,7 +269,7 @@ std::string TextureETC1Alpha::subtitle() const TextureETC2::TextureETC2() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(TextureETC2::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(TextureETC2::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -332,7 +332,7 @@ std::string TextureETC2::subtitle() const TextureBMP::TextureBMP() { auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(TextureBMP::onTouchesEnded, this); + listener->onTouchesEnded = AX_CALLBACK_2(TextureBMP::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); @@ -875,7 +875,7 @@ void TexturePVRRGBA4444GZ::onEnter() TextureDemo::onEnter(); auto s = Director::getInstance()->getWinSize(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) // android can not pack .gz file into apk file auto img = Sprite::create("Images/test_image_rgba4444.pvr"); #else @@ -1739,7 +1739,7 @@ void TextureAsync::onEnter() auto seq = Sequence::create(scale, scale_back, nullptr); label->runAction(RepeatForever::create(seq)); - scheduleOnce(CC_SCHEDULE_SELECTOR(TextureAsync::loadImages), 1.0f); + scheduleOnce(AX_SCHEDULE_SELECTOR(TextureAsync::loadImages), 1.0f); } TextureAsync::~TextureAsync() @@ -1758,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, CC_CALLBACK_1(TextureAsync::imageLoaded, this)); + textureCache->addImageAsync(szSpriteName, AX_CALLBACK_1(TextureAsync::imageLoaded, this)); } } - textureCache->addImageAsync("Images/background1.jpg", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); - textureCache->addImageAsync("Images/background2.jpg", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); - textureCache->addImageAsync("Images/background.png", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); - textureCache->addImageAsync("Images/atlastest.png", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); - textureCache->addImageAsync("Images/grossini_dance_atlas.png", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); + textureCache->addImageAsync("Images/background1.jpg", AX_CALLBACK_1(TextureAsync::imageLoaded, this)); + textureCache->addImageAsync("Images/background2.jpg", AX_CALLBACK_1(TextureAsync::imageLoaded, this)); + textureCache->addImageAsync("Images/background.png", AX_CALLBACK_1(TextureAsync::imageLoaded, this)); + textureCache->addImageAsync("Images/atlastest.png", AX_CALLBACK_1(TextureAsync::imageLoaded, this)); + textureCache->addImageAsync("Images/grossini_dance_atlas.png", AX_CALLBACK_1(TextureAsync::imageLoaded, this)); } void TextureAsync::imageLoaded(Texture2D* texture) @@ -2096,19 +2096,19 @@ void TextureMemoryAlloc::onEnter() MenuItemFont::setFontSize(24); - auto item1 = MenuItemFont::create("PNG", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item1 = MenuItemFont::create("PNG", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item1->setTag(0); - auto item2 = MenuItemFont::create("RGBA8", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item2 = MenuItemFont::create("RGBA8", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item2->setTag(1); - auto item3 = MenuItemFont::create("RGB8", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item3 = MenuItemFont::create("RGB8", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item3->setTag(2); - auto item4 = MenuItemFont::create("RGBA4", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item4 = MenuItemFont::create("RGBA4", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item4->setTag(3); - auto item5 = MenuItemFont::create("A8", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); + auto item5 = MenuItemFont::create("A8", AX_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item5->setTag(4); auto menu = Menu::create(item1, item2, item3, item4, item5, nullptr); @@ -2117,7 +2117,7 @@ void TextureMemoryAlloc::onEnter() addChild(menu); auto warmup = - MenuItemFont::create("warm up texture", CC_CALLBACK_1(TextureMemoryAlloc::changeBackgroundVisible, this)); + MenuItemFont::create("warm up texture", AX_CALLBACK_1(TextureMemoryAlloc::changeBackgroundVisible, this)); auto menu2 = Menu::create(warmup, nullptr); diff --git a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp index 97070a63bb..af64d60eef 100644 --- a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp +++ b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp @@ -47,45 +47,45 @@ TextureCacheTest::TextureCacheTest() : _numberOfSprites(20), _numberOfLoadedSpri // load textures Director::getInstance()->getTextureCache()->addImageAsync("Images/HelloWorld.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_01.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_02.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_03.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_04.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_05.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_06.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_07.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_08.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_09.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_10.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_11.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_12.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_13.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_14.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/background1.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/background2.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/background3.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); Director::getInstance()->getTextureCache()->addImageAsync("Images/blocks.png", - CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + AX_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); } void TextureCacheTest::loadingCallBack(axis::Texture2D* texture) @@ -187,9 +187,9 @@ TextureCacheUnbindTest::TextureCacheUnbindTest() cache->removeTextureForKey("Images/texture2048x2048.png"); - cache->addImageAsync("Images/texture2048x2048.png", CC_CALLBACK_1(TextureCacheUnbindTest::textureLoadedA, this), + cache->addImageAsync("Images/texture2048x2048.png", AX_CALLBACK_1(TextureCacheUnbindTest::textureLoadedA, this), "A"); - cache->addImageAsync("Images/texture2048x2048.png", CC_CALLBACK_1(TextureCacheUnbindTest::textureLoadedB, this), + cache->addImageAsync("Images/texture2048x2048.png", AX_CALLBACK_1(TextureCacheUnbindTest::textureLoadedB, this), "B"); cache->unbindImageAsync("A"); } diff --git a/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp b/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp index 10b55810d5..6af03ff2c5 100644 --- a/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp +++ b/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp @@ -78,7 +78,7 @@ TileDemoNew::TileDemoNew() Director::getInstance()->getRenderer()->setDepthWrite(true); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesMoved = CC_CALLBACK_2(TileDemoNew::onTouchesMoved, this); + listener->onTouchesMoved = AX_CALLBACK_2(TileDemoNew::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -122,7 +122,7 @@ TileMapTestNew::TileMapTestNew() // Convert it to "alias" (GL_LINEAR filtering) map->getTexture()->setAntiAliasTexParameters(); - Size CC_UNUSED s = map->getContentSize(); + Size AX_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 CC_UNUSED s = map->getContentSize(); + Size AX_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(CC_SCHEDULE_SELECTOR(TileMapEditTestNew::updateMap), 0.2f); + schedule(AX_SCHEDULE_SELECTOR(TileMapEditTestNew::updateMap), 0.2f); addChild(map, 0, kTagTileMap); @@ -227,7 +227,7 @@ TMXOrthoTestNew::TMXOrthoTestNew() addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); + Size AX_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 CC_UNUSED s = map->getContentSize(); + Size AX_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 CC_UNUSED s = map->getContentSize(); + Size AX_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 CC_UNUSED s1 = map->getContentSize(); + Size AX_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(CC_SCHEDULE_SELECTOR(TMXOrthoTest4New::removeSprite), 2); + schedule(AX_SCHEDULE_SELECTOR(TMXOrthoTest4New::removeSprite), 2); } void TMXOrthoTest4New::removeSprite(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(TMXOrthoTest4New::removeSprite)); + unschedule(AX_SCHEDULE_SELECTOR(TMXOrthoTest4New::removeSprite)); auto map = static_cast(getChildByTag(kTagTileMap)); auto layer = map->getLayer("Layer 0"); @@ -373,7 +373,7 @@ TMXReadWriteTestNew::TMXReadWriteTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test2.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); + Size AX_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(CC_CALLBACK_1(TMXReadWriteTestNew::removeSprite, this)); + auto finish = CallFuncN::create(AX_CALLBACK_1(TMXReadWriteTestNew::removeSprite, this)); auto seq0 = Sequence::create(move, rotate, scale, opacity, fadein, scaleback, finish, nullptr); auto seq1 = seq0->clone(); auto seq2 = seq0->clone(); @@ -409,9 +409,9 @@ TMXReadWriteTestNew::TMXReadWriteTestNew() _gid = layer->getTileGIDAt(Vec2(0, 63)); ////----CCLOG("Tile GID at:(0,63) is: %d", _gid); - schedule(CC_SCHEDULE_SELECTOR(TMXReadWriteTestNew::updateCol), 2.0f); - schedule(CC_SCHEDULE_SELECTOR(TMXReadWriteTestNew::repaintWithGID), 2.05f); - schedule(CC_SCHEDULE_SELECTOR(TMXReadWriteTestNew::removeTiles), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(TMXReadWriteTestNew::updateCol), 2.0f); + schedule(AX_SCHEDULE_SELECTOR(TMXReadWriteTestNew::repaintWithGID), 2.05f); + schedule(AX_SCHEDULE_SELECTOR(TMXReadWriteTestNew::removeTiles), 1.0f); ////----CCLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads()); ////----CCLOG("++++children: %d", layer->getChildren()->count() ); @@ -468,7 +468,7 @@ void TMXReadWriteTestNew::repaintWithGID(float dt) void TMXReadWriteTestNew::removeTiles(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(TMXReadWriteTestNew::removeTiles)); + unschedule(AX_SCHEDULE_SELECTOR(TMXReadWriteTestNew::removeTiles)); auto map = (axis::FastTMXTiledMap*)getChildByTag(kTagTileMap); auto layer = (axis::FastTMXLayer*)map->getChildByTag(0); @@ -498,7 +498,7 @@ TMXHexTestNew::TMXHexTestNew() auto map = axis::FastTMXTiledMap::create("TileMaps/hexa-test.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); + Size AX_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 CC_UNUSED s = map->getContentSize(); + Size AX_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 CC_UNUSED s = map->getContentSize(); + Size AX_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 CC_UNUSED s = map->getContentSize(); + Size AX_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 CC_UNUSED s = map->getContentSize(); + Size AX_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 CC_UNUSED s = map->getContentSize(); + Size AX_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 CC_UNUSED s = map->getContentSize(); + Size AX_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 CC_UNUSED s = map->getContentSize(); + Size AX_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(CC_POINT_PIXELS_TO_POINTS(Vec2(mapWidth / 2.0f, 0.0f))); + _tamara->setPosition(AX_POINT_PIXELS_TO_POINTS(Vec2(mapWidth / 2.0f, 0.0f))); _tamara->setAnchorPoint(Vec2(0.5f, 0.0f)); auto move = MoveBy::create(10, Vec2(300.0f, 250.0f)); @@ -800,7 +800,7 @@ TMXIsoZorderNew::TMXIsoZorderNew() auto seq = Sequence::create(move, back, nullptr); _tamara->runAction(RepeatForever::create(seq)); - schedule(CC_SCHEDULE_SELECTOR(TMXIsoZorderNew::repositionSprite)); + schedule(AX_SCHEDULE_SELECTOR(TMXIsoZorderNew::repositionSprite)); } TMXIsoZorderNew::~TMXIsoZorderNew() @@ -810,14 +810,14 @@ TMXIsoZorderNew::~TMXIsoZorderNew() void TMXIsoZorderNew::onExit() { - unschedule(CC_SCHEDULE_SELECTOR(TMXIsoZorderNew::repositionSprite)); + unschedule(AX_SCHEDULE_SELECTOR(TMXIsoZorderNew::repositionSprite)); TileDemoNew::onExit(); } void TMXIsoZorderNew::repositionSprite(float dt) { auto p = _tamara->getPosition(); - p = CC_POINT_POINTS_TO_PIXELS(p); + p = AX_POINT_POINTS_TO_PIXELS(p); auto map = getChildByTag(kTagTileMap); // there are only 4 layers. (grass and 3 trees layers) @@ -851,7 +851,7 @@ TMXOrthoZorderNew::TMXOrthoZorderNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test-zorder.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); + Size AX_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(CC_SCHEDULE_SELECTOR(TMXOrthoZorderNew::repositionSprite)); + schedule(AX_SCHEDULE_SELECTOR(TMXOrthoZorderNew::repositionSprite)); } TMXOrthoZorderNew::~TMXOrthoZorderNew() @@ -875,7 +875,7 @@ TMXOrthoZorderNew::~TMXOrthoZorderNew() void TMXOrthoZorderNew::repositionSprite(float dt) { auto p = _tamara->getPosition(); - p = CC_POINT_POINTS_TO_PIXELS(p); + p = AX_POINT_POINTS_TO_PIXELS(p); auto map = getChildByTag(kTagTileMap); // there are only 4 layers. (grass and 3 trees layers) @@ -920,12 +920,12 @@ TMXIsoVertexZNew::TMXIsoVertexZNew() _tamara = layer->getTileAt(Vec2(29.0f, 29.0f)); _tamara->retain(); - auto move = MoveBy::create(10, Vec2(300, 250) * (1 / CC_CONTENT_SCALE_FACTOR())); + auto move = MoveBy::create(10, Vec2(300, 250) * (1 / AX_CONTENT_SCALE_FACTOR())); auto back = move->reverse(); auto seq = Sequence::create(move, back, nullptr); _tamara->runAction(RepeatForever::create(seq)); - schedule(CC_SCHEDULE_SELECTOR(TMXIsoVertexZNew::repositionSprite)); + schedule(AX_SCHEDULE_SELECTOR(TMXIsoVertexZNew::repositionSprite)); } TMXIsoVertexZNew::~TMXIsoVertexZNew() @@ -938,7 +938,7 @@ void TMXIsoVertexZNew::repositionSprite(float dt) // tile height is 64x32 // map size: 30x30 auto p = _tamara->getPosition(); - p = CC_POINT_POINTS_TO_PIXELS(p); + p = AX_POINT_POINTS_TO_PIXELS(p); float newZ = -(p.y + 32) / 16; _tamara->setPositionZ(newZ); } @@ -982,7 +982,7 @@ TMXOrthoVertexZNew::TMXOrthoVertexZNew() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test-vertexz.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s = map->getContentSize(); + Size AX_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 / CC_CONTENT_SCALE_FACTOR())); + auto move = MoveBy::create(10, Vec2(400, 450) * (1 / AX_CONTENT_SCALE_FACTOR())); auto back = move->reverse(); auto seq = Sequence::create(move, back, nullptr); _tamara->runAction(RepeatForever::create(seq)); - schedule(CC_SCHEDULE_SELECTOR(TMXOrthoVertexZNew::repositionSprite)); + schedule(AX_SCHEDULE_SELECTOR(TMXOrthoVertexZNew::repositionSprite)); } TMXOrthoVertexZNew::~TMXOrthoVertexZNew() @@ -1010,7 +1010,7 @@ void TMXOrthoVertexZNew::repositionSprite(float dt) // tile height is 101x81 // map size: 12x12 auto p = _tamara->getPosition(); - p = CC_POINT_POINTS_TO_PIXELS(p); + p = AX_POINT_POINTS_TO_PIXELS(p); _tamara->setPositionZ(-((p.y + 81) / 81)); } @@ -1055,7 +1055,7 @@ TMXIsoMoveLayerNew::TMXIsoMoveLayerNew() map->setPosition(Vec2(-700.0f, -50.0f)); - Size CC_UNUSED s = map->getContentSize(); + Size AX_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 CC_UNUSED s = map->getContentSize(); + Size AX_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 CC_UNUSED s = map->getContentSize(); + Size AX_UNUSED s = map->getContentSize(); log("ContentSize: %f, %f", s.width, s.height); auto action = ScaleBy::create(2, 0.5f); @@ -1163,7 +1163,7 @@ TMXOrthoFlipRunTimeTestNew::TMXOrthoFlipRunTimeTestNew() auto action = ScaleBy::create(2, 0.5f); map->runAction(action); - schedule(CC_SCHEDULE_SELECTOR(TMXOrthoFlipRunTimeTestNew::flipIt), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(TMXOrthoFlipRunTimeTestNew::flipIt), 1.0f); } std::string TMXOrthoFlipRunTimeTestNew::title() const @@ -1280,7 +1280,7 @@ TMXBug987New::TMXBug987New() auto map = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test6.tmx"); addChild(map, 0, kTagTileMap); - Size CC_UNUSED s1 = map->getContentSize(); + Size AX_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 CC_UNUSED s = map->getContentSize(); + Size AX_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 = CC_CALLBACK_2(TileAnimTestNew::onTouchBegan, this); + listener->onTouchesBegan = AX_CALLBACK_2(TileAnimTestNew::onTouchBegan, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); - Size CC_UNUSED s = map->getContentSize(); + Size AX_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 1dde9bc49d..0bf53bddf0 100644 --- a/tests/cpp-tests/Classes/TouchesTest/Paddle.cpp +++ b/tests/cpp-tests/Classes/TouchesTest/Paddle.cpp @@ -63,9 +63,9 @@ void Paddle::onEnter() auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - listener->onTouchBegan = CC_CALLBACK_2(Paddle::onTouchBegan, this); - listener->onTouchMoved = CC_CALLBACK_2(Paddle::onTouchMoved, this); - listener->onTouchEnded = CC_CALLBACK_2(Paddle::onTouchEnded, this); + listener->onTouchBegan = AX_CALLBACK_2(Paddle::onTouchBegan, this); + listener->onTouchMoved = AX_CALLBACK_2(Paddle::onTouchMoved, this); + listener->onTouchEnded = AX_CALLBACK_2(Paddle::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } diff --git a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp index 12fec743c3..c43ed65ac7 100644 --- a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp +++ b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp @@ -110,7 +110,7 @@ PongLayer::PongLayer() addChild(paddle); } - schedule(CC_SCHEDULE_SELECTOR(PongLayer::doStep)); + schedule(AX_SCHEDULE_SELECTOR(PongLayer::doStep)); } PongLayer::~PongLayer() {} @@ -154,9 +154,9 @@ ForceTouchTest::ForceTouchTest() addChild(_infoLabel); auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesBegan = CC_CALLBACK_2(ForceTouchTest::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(ForceTouchTest::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(ForceTouchTest::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(ForceTouchTest::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(ForceTouchTest::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(ForceTouchTest::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } diff --git a/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp b/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp index 29a5fd3cc9..9904eef0a7 100644 --- a/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp +++ b/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp @@ -286,7 +286,7 @@ TestLayer1::TestLayer1(std::string_view transitionName) label->setPosition(Vec2(x / 2, y / 2)); addChild(label); - schedule(CC_SCHEDULE_SELECTOR(TestLayer1::step), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(TestLayer1::step), 1.0f); } TestLayer1::~TestLayer1() {} @@ -356,7 +356,7 @@ TestLayer2::TestLayer2(std::string_view transitionName) label->setPosition(Vec2(x / 2, y / 2)); addChild(label); - schedule(CC_SCHEDULE_SELECTOR(TestLayer2::step), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(TestLayer2::step), 1.0f); } TestLayer2::~TestLayer2() {} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index af4ce1d2c0..8b8f5a24d8 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -44,36 +44,36 @@ #include "UIFocusTest/UIFocusTest.h" #include "UITabControlTest/UITabControlTest.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) && !defined(CC_TARGET_OS_TVOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) && !defined(AX_TARGET_OS_TVOS) # include "UIVideoPlayerTest/UIVideoPlayerTest.h" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) && !defined(AX_TARGET_OS_TVOS) # include "UIWebViewTest/UIWebViewTest.h" #endif #include "UIScale9SpriteTest.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "UIEditBoxTest.h" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) # include "UIWebViewTest/UIWebViewTest.h" #endif GUIDynamicCreateTests::GUIDynamicCreateTests() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) && !defined(CC_TARGET_OS_TVOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) && !defined(AX_TARGET_OS_TVOS) addTest("VideoPlayer Test", []() { return new VideoPlayerTests; }); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && \ - !defined(CC_TARGET_OS_TVOS) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) && \ + !defined(AX_TARGET_OS_TVOS) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) addTest("WebView Test", []() { return new WebViewTests; }); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || \ - (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) || (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) || \ + (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) addTest("EditBox Test", []() { return new UIEditBoxTests; }); #endif addTest("Focus Test", []() { return new UIFocusTests; }); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index 860cc52f92..41480b1d45 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(CC_CALLBACK_2(UIButtonTest::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTest::touchEvent, this)); button->setZoomScale(0.4f); button->setPressedActionEnabled(true); _uiLayer->addChild(button); @@ -99,7 +99,7 @@ bool UIButtonTest::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UIButtonTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UIButtonTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); @@ -191,7 +191,7 @@ bool UIButtonTest_Scale9::init() auto moveByReverse = moveBy->reverse()->clone(); button->runAction(RepeatForever::create(Sequence::create(moveBy, moveByReverse, NULL))); button->setPressedActionEnabled(true); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Scale9::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTest_Scale9::touchEvent, this)); _uiLayer->addChild(button); // Create the imageview @@ -273,7 +273,7 @@ bool UIButtonTest_Scale9_State_Change::init() button->setContentSize(Size(180.0f, 60.0f)); button->setTitleText("Hello Scale9"); button->setPressedActionEnabled(false); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Scale9_State_Change::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTest_Scale9_State_Change::touchEvent, this)); _uiLayer->addChild(button); Button* button2 = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); @@ -284,7 +284,7 @@ bool UIButtonTest_Scale9_State_Change::init() button2->setPosition(Vec2(widgetSize.width / 2.0f + 100, widgetSize.height / 2.0f)); button2->setContentSize(Size(180.0f, 60.0f)); button2->setPressedActionEnabled(true); - button2->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Scale9_State_Change::touchEvent, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIButtonTest_Scale9_State_Change::touchEvent, this)); _uiLayer->addChild(button2); return true; } @@ -357,7 +357,7 @@ bool UIButtonTest_PressedAction::init() button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); button->setColor(Color3B::GREEN); button->setOpacity(30); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_PressedAction::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTest_PressedAction::touchEvent, this)); button->setName("button"); _uiLayer->addChild(button); @@ -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(CC_CALLBACK_2(UIButtonTest_Title::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTest_Title::touchEvent, this)); _uiLayer->addChild(button); button->setFlippedX(true); auto label = button->getTitleRenderer(); @@ -541,7 +541,7 @@ bool UIButtonTestRemoveSelf::init() Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); button->setPosition(Vec2(layout->getContentSize().width / 2.0f, layout->getContentSize().height / 2.0f)); // button->addTouchEventListener(this, toucheventselector(UIButtonTest::touchEvent)); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTestRemoveSelf::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTestRemoveSelf::touchEvent, this)); layout->addChild(button); return true; @@ -598,7 +598,7 @@ bool UIButtonTestSwitchScale9::init() // Create the button Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTestSwitchScale9::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIButtonTestSwitchScale9::touchEvent, this)); button->setTitleText("Button Title"); button->ignoreContentAdaptWithSize(false); @@ -672,7 +672,7 @@ bool UIButtonTestZoomScale::init() slider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); slider->loadProgressBarTexture("cocosui/sliderProgress.png"); slider->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - 20)); - slider->addEventListener(CC_CALLBACK_2(UIButtonTestZoomScale::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(UIButtonTestZoomScale::sliderEvent, this)); slider->setPercent(button->getZoomScale() * 100); _uiLayer->addChild(slider); return true; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp index 491eb11e09..7981908cd4 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp @@ -64,12 +64,12 @@ bool UICheckBoxTest::init() "cocosui/check_box_active_disable.png"); _checkBox->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - _checkBox->addEventListener(CC_CALLBACK_2(UICheckBoxTest::selectedEvent, this)); + _checkBox->addEventListener(AX_CALLBACK_2(UICheckBoxTest::selectedEvent, this)); _uiLayer->addChild(_checkBox); TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UICheckBoxTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UICheckBoxTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp index e8e8628a4a..5e3977ccb0 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp @@ -63,19 +63,19 @@ bool UIFocusTestBase::init() _dpadMenu = Menu::create(); auto winSize = Director::getInstance()->getVisibleSize(); - auto leftItem = MenuItemFont::create("Left", CC_CALLBACK_0(UIFocusTestBase::onLeftKeyPressed, this)); + auto leftItem = MenuItemFont::create("Left", AX_CALLBACK_0(UIFocusTestBase::onLeftKeyPressed, this)); leftItem->setPosition(Vec2(winSize.width - 100, winSize.height / 2)); _dpadMenu->addChild(leftItem); - auto rightItem = MenuItemFont::create("Right", CC_CALLBACK_0(UIFocusTestBase::onRightKeyPressed, this)); + auto rightItem = MenuItemFont::create("Right", AX_CALLBACK_0(UIFocusTestBase::onRightKeyPressed, this)); rightItem->setPosition(Vec2(winSize.width - 30, winSize.height / 2)); _dpadMenu->addChild(rightItem); - auto upItem = MenuItemFont::create("Up", CC_CALLBACK_0(UIFocusTestBase::onUpKeyPressed, this)); + auto upItem = MenuItemFont::create("Up", AX_CALLBACK_0(UIFocusTestBase::onUpKeyPressed, this)); upItem->setPosition(Vec2(winSize.width - 60, winSize.height / 2 + 50)); _dpadMenu->addChild(upItem); - auto downItem = MenuItemFont::create("Down", CC_CALLBACK_0(UIFocusTestBase::onDownKeyPressed, this)); + auto downItem = MenuItemFont::create("Down", AX_CALLBACK_0(UIFocusTestBase::onDownKeyPressed, this)); downItem->setPosition(Vec2(winSize.width - 60, winSize.height / 2 - 50)); _dpadMenu->addChild(downItem); @@ -86,7 +86,7 @@ bool UIFocusTestBase::init() Widget::enableDpadNavigation(true); _eventListener = EventListenerFocus::create(); - _eventListener->onFocusChanged = CC_CALLBACK_2(UIFocusTestBase::onFocusChanged, this); + _eventListener->onFocusChanged = AX_CALLBACK_2(UIFocusTestBase::onFocusChanged, this); _eventDispatcher->addEventListenerWithFixedPriority(_eventListener, 1); @@ -195,7 +195,7 @@ bool UIFocusTestHorizontal::init() ImageView* w = ImageView::create("cocosui/scrollviewbg.png"); w->setTouchEnabled(true); w->setTag(i); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestHorizontal::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestHorizontal::onImageViewClicked, this)); _horizontalLayout->addChild(w); } @@ -204,7 +204,7 @@ bool UIFocusTestHorizontal::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(CC_CALLBACK_2(UIFocusTestHorizontal::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestHorizontal::toggleFocusLoop, this)); return true; } @@ -255,7 +255,7 @@ bool UIFocusTestVertical::init() ImageView* w = ImageView::create("cocosui/scrollviewbg.png"); w->setTouchEnabled(true); w->setTag(i); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestVertical::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestVertical::onImageViewClicked, this)); _verticalLayout->addChild(w); } @@ -264,7 +264,7 @@ bool UIFocusTestVertical::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(CC_CALLBACK_2(UIFocusTestVertical::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestVertical::toggleFocusLoop, this)); return true; } @@ -317,7 +317,7 @@ bool UIFocusTestNestedLayout1::init() w->setTouchEnabled(true); w->setScaleX(2.5); w->setTag(i + count1); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); _verticalLayout->addChild(w); } @@ -335,7 +335,7 @@ bool UIFocusTestNestedLayout1::init() w->setScaleY(2.0); w->setTouchEnabled(true); w->setTag(i + count1 + count2); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); hbox->addChild(w); } @@ -351,7 +351,7 @@ bool UIFocusTestNestedLayout1::init() ImageView* w = ImageView::create("cocosui/scrollviewbg.png"); w->setTouchEnabled(true); w->setTag(i + count1 + count2 + count3); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this)); innerVBox->addChild(w); } @@ -360,7 +360,7 @@ bool UIFocusTestNestedLayout1::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout1::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout1::toggleFocusLoop, this)); return true; } @@ -413,7 +413,7 @@ bool UIFocusTestNestedLayout2::init() w->setTouchEnabled(true); w->setTag(i + count1); w->setScaleY(2.4f); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); _horizontalLayout->addChild(w); } @@ -431,7 +431,7 @@ bool UIFocusTestNestedLayout2::init() w->setScaleX(2.0); w->setTouchEnabled(true); w->setTag(i + count1 + count2); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); vbox->addChild(w); } @@ -447,7 +447,7 @@ bool UIFocusTestNestedLayout2::init() ImageView* w = ImageView::create("cocosui/scrollviewbg.png"); w->setTouchEnabled(true); w->setTag(i + count1 + count2 + count3); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); innerHBox->addChild(w); } @@ -456,7 +456,7 @@ bool UIFocusTestNestedLayout2::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout2::toggleFocusLoop, this)); return true; } @@ -526,7 +526,7 @@ bool UIFocusTestNestedLayout3::init() ImageView* w = ImageView::create("cocosui/scrollviewbg.png"); w->setTouchEnabled(true); w->setTag(j + firstVbox->getTag() + 1); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestBase::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestBase::onImageViewClicked, this)); firstVbox->addChild(w); } @@ -547,7 +547,7 @@ bool UIFocusTestNestedLayout3::init() w->setLayoutParameter(bottomParams); w->setTouchEnabled(true); w->setTag(i + 601); - w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestBase::onImageViewClicked, this)); + w->addTouchEventListener(AX_CALLBACK_2(UIFocusTestBase::onImageViewClicked, this)); bottomHBox->addChild(w); } _verticalLayout->addChild(bottomHBox); @@ -557,7 +557,7 @@ bool UIFocusTestNestedLayout3::init() _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); - _toggleButton->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout3::toggleFocusLoop, this)); + _toggleButton->addTouchEventListener(AX_CALLBACK_2(UIFocusTestNestedLayout3::toggleFocusLoop, this)); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp index 1fc33daa7d..37e7792398 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp @@ -62,7 +62,7 @@ bool UIImageViewTest::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UIImageViewTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UIImageViewTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp index 992a0d5f02..9c827650c0 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp @@ -282,7 +282,7 @@ bool UILayoutTest_BackGroundImage::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); auto item1 = - MenuItemLabel::create(label1, CC_CALLBACK_1(UILayoutTest_BackGroundImage::printWidgetResources, this)); + MenuItemLabel::create(label1, AX_CALLBACK_1(UILayoutTest_BackGroundImage::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); @@ -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(CC_CALLBACK_2(UILayoutComponentTest::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UILayoutComponentTest::touchEvent, this)); button->setZoomScale(0.4f); button->setPressedActionEnabled(true); _uiLayer->addChild(button); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp index 3c11c5ef20..09343e3133 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp @@ -93,8 +93,8 @@ bool UIListViewTest_Vertical::init() _listView->setContentSize(Size(240.0f, 130.0f)); _listView->setPosition(Vec2((widgetSize - _listView->getContentSize()) / 2.0f)); _listView->addEventListener( - (ui::ListView::ccListViewCallback)CC_CALLBACK_2(UIListViewTest_Vertical::selectedItemEvent, this)); - _listView->addEventListener((ui::ListView::ccScrollViewCallback)CC_CALLBACK_2( + (ui::ListView::ccListViewCallback)AX_CALLBACK_2(UIListViewTest_Vertical::selectedItemEvent, this)); + _listView->addEventListener((ui::ListView::ccScrollViewCallback)AX_CALLBACK_2( UIListViewTest_Vertical::selectedItemEventScrollView, this)); _listView->setScrollBarPositionFromCorner(Vec2(7, 7)); _uiLayer->addChild(_listView); @@ -346,7 +346,7 @@ bool UIListViewTest_Horizontal::init() (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - _listView->getContentSize().height) / 2.0f)); _listView->addEventListener( - (ui::ListView::ccListViewCallback)CC_CALLBACK_2(UIListViewTest_Horizontal::selectedItemEvent, this)); + (ui::ListView::ccListViewCallback)AX_CALLBACK_2(UIListViewTest_Horizontal::selectedItemEvent, this)); _listView->setScrollBarPositionFromCorner(Vec2(7, 7)); _uiLayer->addChild(_listView); @@ -937,7 +937,7 @@ bool UIListViewTest_Padding::init() slider->setCapInsets(Rect(0.0f, 0.0f, 0.0f, 0.0f)); slider->setContentSize(Size(30.0f, 10.0f)); slider->setPosition(Vec2(60.0f, 150.0f - (25 * i))); - slider->addEventListener(CC_CALLBACK_2(UIListViewTest_Padding::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(UIListViewTest_Padding::sliderEvent, this)); slider->setTag(i); _uiLayer->addChild(slider); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp index 3eff94fa2e..81cbd9a554 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp @@ -101,7 +101,7 @@ bool UILoadingBarTest_Left::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UILoadingBarTest_Left::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UILoadingBarTest_Left::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index d68d1c8f8b..761ff19f6c 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -188,7 +188,7 @@ bool UIPageViewButtonTest::init() Button* btn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); btn->setName(StringUtils::format("button %d", j)); - btn->addTouchEventListener(CC_CALLBACK_2(UIPageViewButtonTest::onButtonClicked, this)); + btn->addTouchEventListener(AX_CALLBACK_2(UIPageViewButtonTest::onButtonClicked, this)); innerBox->addChild(btn); } @@ -206,7 +206,7 @@ bool UIPageViewButtonTest::init() pageView->removeItem(0); pageView->addEventListener( - (PageView::ccPageViewCallback)CC_CALLBACK_2(UIPageViewButtonTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewButtonTest::pageViewEvent, this)); _uiLayer->addChild(pageView); @@ -294,7 +294,7 @@ bool UIPageViewTouchPropagationTest::init() Button* btn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); btn->setName(StringUtils::format("button %d", j)); - btn->addTouchEventListener(CC_CALLBACK_2(UIPageViewTouchPropagationTest::onButtonClicked, this)); + btn->addTouchEventListener(AX_CALLBACK_2(UIPageViewTouchPropagationTest::onButtonClicked, this)); innerBox->addChild(btn); } @@ -310,7 +310,7 @@ bool UIPageViewTouchPropagationTest::init() } pageView->addEventListener( - (PageView::ccPageViewCallback)CC_CALLBACK_2(UIPageViewTouchPropagationTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewTouchPropagationTest::pageViewEvent, this)); pageView->setName("pageView"); pageView->addTouchEventListener([](Ref* sender, Widget::TouchEventType type) { if (type == Widget::TouchEventType::BEGAN) @@ -502,7 +502,7 @@ bool UIPageViewDynamicAddAndRemoveTest::init() } pageView->addEventListener( - (PageView::ccPageViewCallback)CC_CALLBACK_2(UIPageViewDynamicAddAndRemoveTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewDynamicAddAndRemoveTest::pageViewEvent, this)); pageView->setName("pageView"); _uiLayer->addChild(pageView); @@ -762,7 +762,7 @@ bool UIPageViewVerticalTest::init() } pageView->addEventListener( - (PageView::ccPageViewCallback)CC_CALLBACK_2(UIPageViewVerticalTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewVerticalTest::pageViewEvent, this)); _uiLayer->addChild(pageView); @@ -911,7 +911,7 @@ bool UIPageViewChildSizeTest::init() } pageView->addEventListener( - (PageView::ccPageViewCallback)CC_CALLBACK_2(UIPageViewChildSizeTest::pageViewEvent, this)); + (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewChildSizeTest::pageViewEvent, this)); _uiLayer->addChild(pageView); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp index 1e5b14a8d2..5dbd2bbbc8 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp @@ -69,7 +69,7 @@ bool UIRadioButtonTest::init() Button* addButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); addButton->setTitleText("Add"); addButton->setPosition(Vec2(widgetSize.width / 2.0f - 100, widgetSize.height / 2.0f - 65)); - addButton->addClickEventListener(CC_CALLBACK_1(UIRadioButtonTest::addRadioButton, this)); + addButton->addClickEventListener(AX_CALLBACK_1(UIRadioButtonTest::addRadioButton, this)); addButton->setScale(0.7f); _uiLayer->addChild(addButton); @@ -77,7 +77,7 @@ bool UIRadioButtonTest::init() Button* deleteButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); deleteButton->setTitleText("Delete"); deleteButton->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - 65)); - deleteButton->addClickEventListener(CC_CALLBACK_1(UIRadioButtonTest::deleteRadioButton, this)); + deleteButton->addClickEventListener(AX_CALLBACK_1(UIRadioButtonTest::deleteRadioButton, this)); deleteButton->setScale(0.7f); _uiLayer->addChild(deleteButton); @@ -181,7 +181,7 @@ bool UIRadioButtonTwoGroupsTest::init() if (type == 0) { _radioButtonGroups[type]->addEventListener( - CC_CALLBACK_3(UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup1, this)); + AX_CALLBACK_3(UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup1, this)); normalImage = "cocosui/radio_button_off.png"; selectedImage = "cocosui/radio_button_on.png"; posYAdjust = 35; @@ -189,7 +189,7 @@ bool UIRadioButtonTwoGroupsTest::init() else { _radioButtonGroups[type]->addEventListener( - CC_CALLBACK_3(UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup2, this)); + AX_CALLBACK_3(UIRadioButtonTwoGroupsTest::onChangedRadioButtonGroup2, this)); normalImage = "cocosui/UIEditorTest/2.1/Button/button_common_box03_003 copy 221.png"; selectedImage = "cocosui/UIEditorTest/2.1/Button/button_common_box03_001.png"; posYAdjust = -15; @@ -210,7 +210,7 @@ bool UIRadioButtonTwoGroupsTest::init() radioButton->setPosition(Vec2(posX, posY)); radioButton->addEventListener( - CC_CALLBACK_2(UIRadioButtonTwoGroupsTest::onChangedRadioButtonSelect, this)); + AX_CALLBACK_2(UIRadioButtonTwoGroupsTest::onChangedRadioButtonSelect, this)); radioButton->setTag(i); _uiLayer->addChild(radioButton); _radioButtonGroups[type]->addRadioButton(radioButton); @@ -220,7 +220,7 @@ bool UIRadioButtonTwoGroupsTest::init() Button* clearButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); clearButton->setTitleText("Clear"); clearButton->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - 65)); - clearButton->addClickEventListener(CC_CALLBACK_1(UIRadioButtonTwoGroupsTest::clearRadioButtonGroup, this)); + clearButton->addClickEventListener(AX_CALLBACK_1(UIRadioButtonTwoGroupsTest::clearRadioButtonGroup, this)); clearButton->setScale(0.8f); _uiLayer->addChild(clearButton); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp index e47b9e72b4..ee69a885c3 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(CC_CALLBACK_2(UIRichTextTest::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextTest::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -93,7 +93,7 @@ bool UIRichTextTest::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextTest::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextTest::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -102,7 +102,7 @@ bool UIRichTextTest::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextTest::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextTest::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -215,7 +215,7 @@ bool UIRichTextXMLBasic::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLBasic::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLBasic::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -224,7 +224,7 @@ bool UIRichTextXMLBasic::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLBasic::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLBasic::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -233,7 +233,7 @@ bool UIRichTextXMLBasic::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLBasic::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLBasic::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -322,7 +322,7 @@ bool UIRichTextXMLSmallBig::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSmallBig::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSmallBig::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -331,7 +331,7 @@ bool UIRichTextXMLSmallBig::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSmallBig::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSmallBig::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -340,7 +340,7 @@ bool UIRichTextXMLSmallBig::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSmallBig::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSmallBig::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -428,7 +428,7 @@ bool UIRichTextXMLColor::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLColor::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLColor::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -437,7 +437,7 @@ bool UIRichTextXMLColor::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLColor::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLColor::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -446,7 +446,7 @@ bool UIRichTextXMLColor::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLColor::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLColor::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -534,7 +534,7 @@ bool UIRichTextXMLSUIB::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -543,7 +543,7 @@ bool UIRichTextXMLSUIB::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -552,7 +552,7 @@ bool UIRichTextXMLSUIB::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -640,7 +640,7 @@ bool UIRichTextXMLSUIB2::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB2::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB2::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -649,7 +649,7 @@ bool UIRichTextXMLSUIB2::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB2::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB2::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -658,7 +658,7 @@ bool UIRichTextXMLSUIB2::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB2::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB2::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -747,7 +747,7 @@ bool UIRichTextXMLSUIB3::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB3::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB3::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -756,7 +756,7 @@ bool UIRichTextXMLSUIB3::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB3::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB3::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -765,7 +765,7 @@ bool UIRichTextXMLSUIB3::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSUIB3::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSUIB3::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -854,7 +854,7 @@ bool UIRichTextXMLImg::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLImg::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLImg::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -863,7 +863,7 @@ bool UIRichTextXMLImg::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLImg::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLImg::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -872,7 +872,7 @@ bool UIRichTextXMLImg::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLImg::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLImg::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -962,7 +962,7 @@ bool UIRichTextXMLUrl::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLUrl::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLUrl::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -971,7 +971,7 @@ bool UIRichTextXMLUrl::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLUrl::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLUrl::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -980,7 +980,7 @@ bool UIRichTextXMLUrl::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLUrl::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLUrl::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1068,7 +1068,7 @@ bool UIRichTextXMLUrlImg::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLUrlImg::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLUrlImg::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1077,7 +1077,7 @@ bool UIRichTextXMLUrlImg::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLUrlImg::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLUrlImg::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1086,7 +1086,7 @@ bool UIRichTextXMLUrlImg::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLUrlImg::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLUrlImg::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1175,7 +1175,7 @@ bool UIRichTextXMLFace::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLFace::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLFace::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1184,7 +1184,7 @@ bool UIRichTextXMLFace::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLFace::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLFace::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1193,7 +1193,7 @@ bool UIRichTextXMLFace::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLFace::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLFace::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1282,7 +1282,7 @@ bool UIRichTextXMLBR::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLBR::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLBR::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1291,7 +1291,7 @@ bool UIRichTextXMLBR::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLBR::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLBR::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1300,7 +1300,7 @@ bool UIRichTextXMLBR::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLBR::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLBR::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1424,7 +1424,7 @@ bool UIRichTextXMLOutline::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLOutline::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLOutline::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1433,7 +1433,7 @@ bool UIRichTextXMLOutline::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLOutline::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLOutline::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1442,7 +1442,7 @@ bool UIRichTextXMLOutline::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLOutline::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLOutline::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1531,7 +1531,7 @@ bool UIRichTextXMLShadow::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLShadow::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLShadow::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1540,7 +1540,7 @@ bool UIRichTextXMLShadow::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLShadow::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLShadow::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1549,7 +1549,7 @@ bool UIRichTextXMLShadow::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLShadow::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLShadow::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1638,7 +1638,7 @@ bool UIRichTextXMLGlow::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLGlow::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLGlow::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1647,7 +1647,7 @@ bool UIRichTextXMLGlow::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLGlow::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLGlow::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1656,7 +1656,7 @@ bool UIRichTextXMLGlow::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLGlow::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLGlow::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1744,7 +1744,7 @@ bool UIRichTextXMLExtend::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLExtend::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLExtend::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1753,7 +1753,7 @@ bool UIRichTextXMLExtend::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLExtend::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLExtend::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1762,7 +1762,7 @@ bool UIRichTextXMLExtend::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLExtend::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLExtend::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); @@ -1886,7 +1886,7 @@ bool UIRichTextXMLSpace::init() button->setTitleText("switch"); button->setPosition( Vec2(widgetSize.width * 1 / 3, widgetSize.height / 2.0f + button->getContentSize().height * 2.5)); - button->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSpace::touchEvent, this)); + button->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSpace::touchEvent, this)); button->setLocalZOrder(10); _widget->addChild(button); @@ -1895,7 +1895,7 @@ bool UIRichTextXMLSpace::init() button2->setTitleText("wrap mode"); button2->setPosition( Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button2->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSpace::switchWrapMode, this)); + button2->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSpace::switchWrapMode, this)); button2->setLocalZOrder(10); _widget->addChild(button2); @@ -1904,7 +1904,7 @@ bool UIRichTextXMLSpace::init() button3->setTitleText("alignment"); button3->setPosition( Vec2(widgetSize.width * 2 / 3, widgetSize.height / 2.0f + button2->getContentSize().height * 2.5)); - button3->addTouchEventListener(CC_CALLBACK_2(UIRichTextXMLSpace::switchAlignment, this)); + button3->addTouchEventListener(AX_CALLBACK_2(UIRichTextXMLSpace::switchAlignment, this)); button3->setLocalZOrder(10); _widget->addChild(button3); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp index 7a8b2241af..7a9120796c 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(CC_CALLBACK_2(UIS9GrayStateOpacityTest::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(UIS9GrayStateOpacityTest::sliderEvent, this)); _uiLayer->addChild(slider); return true; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp index 7b903f4588..33235d3d50 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp @@ -71,14 +71,14 @@ bool UISliderTest::init() slider->setMaxPercent(10000); slider->setPosition( Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f /* + slider->getSize().height * 2.0f*/)); - slider->addEventListener(CC_CALLBACK_2(UISliderTest::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(UISliderTest::sliderEvent, this)); _uiLayer->addChild(slider); _slider = slider; TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UISliderTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UISliderTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); @@ -153,7 +153,7 @@ bool UISliderTest_Scale9::init() slider->setContentSize(Size(250.0f, 19.0f)); slider->setPosition( Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f /* + slider->getSize().height * 3.0f*/)); - slider->addEventListener(CC_CALLBACK_2(UISliderTest_Scale9::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(UISliderTest_Scale9::sliderEvent, this)); _uiLayer->addChild(slider); return true; @@ -362,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; - CC_UNUSED_PARAM(slider); + AX_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(CC_CALLBACK_2(UISliderIssue12249Test::sliderEvent, this)); + slider->addEventListener(AX_CALLBACK_2(UISliderIssue12249Test::sliderEvent, this)); _uiLayer->addChild(slider); return true; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp index 014bc4a43f..2eb6bb84d6 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp @@ -63,7 +63,7 @@ bool UITextAtlasTest::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UITextAtlasTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UITextAtlasTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); @@ -113,7 +113,7 @@ bool UITextAtlasETC1ShadowTest::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); auto item1 = - MenuItemLabel::create(label1, CC_CALLBACK_1(UITextAtlasETC1ShadowTest::printWidgetResources, this)); + MenuItemLabel::create(label1, AX_CALLBACK_1(UITextAtlasETC1ShadowTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp index f6815ae8ea..024b761686 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp @@ -55,7 +55,7 @@ bool UITextBMFontTest::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); auto label1 = Label::createWithTTF(ttfConfig, "Print Resources"); - auto item1 = MenuItemLabel::create(label1, CC_CALLBACK_1(UITextBMFontTest::printWidgetResources, this)); + auto item1 = MenuItemLabel::create(label1, AX_CALLBACK_1(UITextBMFontTest::printWidgetResources, this)); item1->setPosition( Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + item1->getContentSize().height * 3)); auto pMenu1 = Menu::create(item1, nullptr); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp index 527cb43030..14caab74aa 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp @@ -67,7 +67,7 @@ bool UITextFieldTest::init() TextField* textField = TextField::create("input words here", "Arial", 30); textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest::textFieldEvent, this)); _uiLayer->addChild(textField); return true; @@ -142,7 +142,7 @@ bool UITextFieldTest_MaxLength::init() textField->setMaxLengthEnabled(true); textField->setMaxLength(3); textField->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_MaxLength::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest_MaxLength::textFieldEvent, this)); _uiLayer->addChild(textField); return true; @@ -223,7 +223,7 @@ bool UITextFieldTest_Password::init() textField->setPasswordEnabled(true); textField->setPasswordStyleText("*"); textField->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_Password::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest_Password::textFieldEvent, this)); _uiLayer->addChild(textField); return true; @@ -302,7 +302,7 @@ bool UITextFieldTest_LineWrap::init() textField->setTextHorizontalAlignment(TextHAlignment::CENTER); textField->setTextVerticalAlignment(TextVAlignment::CENTER); textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_LineWrap::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest_LineWrap::textFieldEvent, this)); _uiLayer->addChild(textField); return true; @@ -376,7 +376,7 @@ bool UITextFieldTest_TrueTypeFont::init() TextField* textField = TextField::create("input words here", "fonts/A Damn Mess.ttf", 30); textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_TrueTypeFont::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest_TrueTypeFont::textFieldEvent, this)); _uiLayer->addChild(textField); return true; @@ -449,7 +449,7 @@ bool UITextFieldTest_BMFont::init() TextField* textField = TextField::create("BMFont Text", "fonts/bitmapFontTest3.fnt", 30); textField->setCursorEnabled(true); textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_BMFont::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest_BMFont::textFieldEvent, this)); _uiLayer->addChild(textField); return true; @@ -526,7 +526,7 @@ bool UITextFieldTest_PlaceHolderColor::init() textField->setPlaceHolderColor(Color4B::GREEN); textField->setTextColor(Color4B::RED); textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_PlaceHolderColor::textFieldEvent, this)); + textField->addEventListener(AX_CALLBACK_2(UITextFieldTest_PlaceHolderColor::textFieldEvent, this)); _uiLayer->addChild(textField); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp index aed5f0167b..14f95a4a57 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp @@ -46,42 +46,42 @@ bool VideoPlayerTest::init() MenuItemFont::setFontSize(16); auto fullSwitch = - MenuItemFont::create("FullScreenSwitch", CC_CALLBACK_1(VideoPlayerTest::menuFullScreenCallback, this)); + MenuItemFont::create("FullScreenSwitch", AX_CALLBACK_1(VideoPlayerTest::menuFullScreenCallback, this)); fullSwitch->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); fullSwitch->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 50)); - auto pauseItem = MenuItemFont::create("Pause", CC_CALLBACK_1(VideoPlayerTest::menuPauseCallback, this)); + auto pauseItem = MenuItemFont::create("Pause", AX_CALLBACK_1(VideoPlayerTest::menuPauseCallback, this)); pauseItem->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); pauseItem->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 100)); - auto resumeItem = MenuItemFont::create("Resume", CC_CALLBACK_1(VideoPlayerTest::menuResumeCallback, this)); + auto resumeItem = MenuItemFont::create("Resume", AX_CALLBACK_1(VideoPlayerTest::menuResumeCallback, this)); resumeItem->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); resumeItem->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 150)); - auto stopItem = MenuItemFont::create("Stop", CC_CALLBACK_1(VideoPlayerTest::menuStopCallback, this)); + auto stopItem = MenuItemFont::create("Stop", AX_CALLBACK_1(VideoPlayerTest::menuStopCallback, this)); stopItem->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); stopItem->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 200)); - auto hintItem = MenuItemFont::create("Hint", CC_CALLBACK_1(VideoPlayerTest::menuHintCallback, this)); + auto hintItem = MenuItemFont::create("Hint", AX_CALLBACK_1(VideoPlayerTest::menuHintCallback, this)); hintItem->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); hintItem->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 250)); //------------------------------------------------------------------------------------------------------------------- auto resourceVideo = - MenuItemFont::create("Play resource video", CC_CALLBACK_1(VideoPlayerTest::menuResourceVideoCallback, this)); + MenuItemFont::create("Play resource video", AX_CALLBACK_1(VideoPlayerTest::menuResourceVideoCallback, this)); resourceVideo->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); resourceVideo->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10, _visibleRect.origin.y + 50)); auto onlineVideo = - MenuItemFont::create("Play online video", CC_CALLBACK_1(VideoPlayerTest::menuOnlineVideoCallback, this)); + MenuItemFont::create("Play online video", AX_CALLBACK_1(VideoPlayerTest::menuOnlineVideoCallback, this)); onlineVideo->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); onlineVideo->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10, _visibleRect.origin.y + 100)); - auto ratioSwitch = MenuItemFont::create("KeepRatioSwitch", CC_CALLBACK_1(VideoPlayerTest::menuRatioCallback, this)); + auto ratioSwitch = MenuItemFont::create("KeepRatioSwitch", AX_CALLBACK_1(VideoPlayerTest::menuRatioCallback, this)); ratioSwitch->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); ratioSwitch->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10, _visibleRect.origin.y + 150)); - auto loopToggle = MenuItemFont::create("LoopToogle", CC_CALLBACK_1(VideoPlayerTest::menuLoopCallback, this)); + auto loopToggle = MenuItemFont::create("LoopToogle", AX_CALLBACK_1(VideoPlayerTest::menuLoopCallback, this)); loopToggle->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); loopToggle->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10, _visibleRect.origin.y + 170)); @@ -215,7 +215,7 @@ void VideoPlayerTest::createVideo() _videoPlayer->setContentSize(Size(widgetSize.width * 0.4f, widgetSize.height * 0.4f)); _uiLayer->addChild(_videoPlayer); - _videoPlayer->addEventListener(CC_CALLBACK_2(VideoPlayerTest::videoEventCallback, this)); + _videoPlayer->addEventListener(AX_CALLBACK_2(VideoPlayerTest::videoEventCallback, this)); } void VideoPlayerTest::createSlider() @@ -230,7 +230,7 @@ void VideoPlayerTest::createSlider() hSlider->loadProgressBarTexture("cocosui/sliderProgress.png"); hSlider->setPosition(Vec2(centerPos.x, _visibleRect.origin.y + _visibleRect.size.height * 0.15f)); hSlider->setPercent(50); - hSlider->addEventListener(CC_CALLBACK_2(VideoPlayerTest::sliderCallback, this)); + hSlider->addEventListener(AX_CALLBACK_2(VideoPlayerTest::sliderCallback, this)); _uiLayer->addChild(hSlider, 0, 1); auto vSlider = ui::Slider::create(); @@ -241,7 +241,7 @@ void VideoPlayerTest::createSlider() vSlider->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width * 0.15f, centerPos.y)); vSlider->setRotation(90); vSlider->setPercent(50); - vSlider->addEventListener(CC_CALLBACK_2(VideoPlayerTest::sliderCallback, this)); + vSlider->addEventListener(AX_CALLBACK_2(VideoPlayerTest::sliderCallback, this)); _uiLayer->addChild(vSlider, 0, 2); } @@ -335,12 +335,12 @@ bool SimpleVideoPlayerTest::init() MenuItemFont::setFontSize(16); _switchStyle = - MenuItemFont::create("Switch Style", CC_CALLBACK_1(SimpleVideoPlayerTest::switchStyleCallback, this)); + MenuItemFont::create("Switch Style", AX_CALLBACK_1(SimpleVideoPlayerTest::switchStyleCallback, this)); _switchStyle->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); _switchStyle->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 50)); _switchUserInputEnabled = - MenuItemFont::create("Enable User Input", CC_CALLBACK_1(SimpleVideoPlayerTest::switchUserInputCallback, this)); + MenuItemFont::create("Enable User Input", AX_CALLBACK_1(SimpleVideoPlayerTest::switchUserInputCallback, this)); _switchUserInputEnabled->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); _switchUserInputEnabled->setPosition(Vec2(_visibleRect.origin.x + 10, _visibleRect.origin.y + 100)); @@ -372,7 +372,7 @@ void SimpleVideoPlayerTest::menuCloseCallback(Ref* sender) { Director::getInstance()->end(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) exit(0); #endif } @@ -433,7 +433,7 @@ void SimpleVideoPlayerTest::createVideo() _uiLayer->addChild(_videoPlayer); - // _videoPlayer->addEventListener(CC_CALLBACK_2(SimpleVideoPlayerTest::videoEventCallback, this)); + // _videoPlayer->addEventListener(AX_CALLBACK_2(SimpleVideoPlayerTest::videoEventCallback, this)); _videoPlayer->setFileName("cocosvideo.mp4"); _videoPlayer->play(); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp index 1fa295c514..2d18c9f9da 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp @@ -45,9 +45,9 @@ bool WebViewTest::init() _webView->loadURL("https://www.baidu.com"); _webView->setScalesPageToFit(true); - _webView->setOnShouldStartLoading(CC_CALLBACK_2(WebViewTest::onWebViewShouldStartLoading, this)); - _webView->setOnDidFinishLoading(CC_CALLBACK_2(WebViewTest::onWebViewDidFinishLoading, this)); - _webView->setOnDidFailLoading(CC_CALLBACK_2(WebViewTest::onWebViewDidFailLoading, this)); + _webView->setOnShouldStartLoading(AX_CALLBACK_2(WebViewTest::onWebViewShouldStartLoading, this)); + _webView->setOnDidFinishLoading(AX_CALLBACK_2(WebViewTest::onWebViewDidFinishLoading, this)); + _webView->setOnDidFailLoading(AX_CALLBACK_2(WebViewTest::onWebViewDidFailLoading, this)); this->addChild(_webView); diff --git a/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp b/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp index 99be32e2d1..5dea731bc9 100644 --- a/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp +++ b/tests/cpp-tests/Classes/UnitTest/UnitTest.cpp @@ -32,7 +32,7 @@ USING_NS_AX; using namespace axis::network; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) # if defined(__arm64__) # define USE_NEON64 # define INCLUDE_NEON64 @@ -41,7 +41,7 @@ using namespace axis::network; # define INCLUDE_NEON32 # else # endif -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#elif (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # if defined(__arm64__) || defined(__aarch64__) # define USE_NEON64 # define INCLUDE_NEON64 @@ -165,7 +165,7 @@ void TemplateVectorTest::onEnter() Vector vec4(createVector()); for (const auto& child : vec4) { - CC_UNUSED_PARAM(child); + AX_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) { - CC_UNUSED_PARAM(child); + AX_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) { - CC_UNUSED_PARAM(child); + AX_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) { - CC_UNUSED_PARAM(child); + AX_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) { - CC_UNUSED_PARAM(child); + AX_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) { - CC_UNUSED_PARAM(e); + AX_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) { - CC_UNUSED_PARAM(e); + AX_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) { - CC_UNUSED_PARAM(e); + AX_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) { - CC_UNUSED_PARAM(e); + AX_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) { - CC_UNUSED_PARAM(e); + AX_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"); - CC_UNUSED_PARAM(nodeToFind); + AX_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) { - CC_UNUSED_PARAM(e); + AX_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) { - CC_UNUSED_PARAM(e); + AX_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) { - CC_UNUSED_PARAM(e); + AX_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"; - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 2) == "ab"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 2) == "cd"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 2) == "ef"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 2) == "ab"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 2) == "cd"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 2) == "ef"); } { // Empty string std::string source = ""; // OK - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); // Error: These cases cause "out of range" error - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); } { // Ascii std::string source = "abc"; // OK - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 3, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 3) == "abc"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 4) == "abc"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 2) == "bc"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 3) == "bc"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 1) == "c"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 2) == "c"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 3, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 3, 2) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 3, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 3) == "abc"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 4) == "abc"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 2) == "bc"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 3) == "bc"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 1) == "c"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 2) == "c"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 3, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 3, 2) == ""); // Error: These cases cause "out of range" error - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 4, 1) == ""); } { // CJK characters std::string source = "这里是中文测试例"; // OK - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 7, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 8, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 8, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == "\xe8\xbf\x99"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 4) == "\xe8\xbf\x99\xe9\x87\x8c\xe6\x98\xaf\xe4\xb8\xad"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 8) == + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 7, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 8, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 8, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == "\xe8\xbf\x99"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 4) == "\xe8\xbf\x99\xe9\x87\x8c\xe6\x98\xaf\xe4\xb8\xad"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 8) == "\xe8\xbf\x99\xe9\x87\x8c\xe6\x98\xaf\xe4\xb8\xad\xe6\x96\x87\xe6\xb5\x8b\xe8\xaf\x95\xe4\xbe\x8b"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 100) == + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 100) == "\xe8\xbf\x99\xe9\x87\x8c\xe6\x98\xaf\xe4\xb8\xad\xe6\x96\x87\xe6\xb5\x8b\xe8\xaf\x95\xe4\xbe\x8b"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 5) == + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 2, 5) == "\xe6\x98\xaf\xe4\xb8\xad\xe6\x96\x87\xe6\xb5\x8b\xe8\xaf\x95"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 6, 2) == "\xe8\xaf\x95\xe4\xbe\x8b"); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 6, 100) == "\xe8\xaf\x95\xe4\xbe\x8b"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 6, 2) == "\xe8\xaf\x95\xe4\xbe\x8b"); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 6, 100) == "\xe8\xaf\x95\xe4\xbe\x8b"); // Error: These cases cause "out of range" error - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 9, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 9, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 9, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 9, 1) == ""); } { // Redundant UTF-8 sequence for Directory traversal attack (1) std::string source = "\xC0\xAF"; // Error: Can't convert string to correct encoding such as UTF-32 - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 2) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 2) == ""); } { // Redundant UTF-8 sequence for Directory traversal attack (2) std::string source = "\xE0\x80\xAF"; // Error: Can't convert string to correct encoding such as UTF-32 - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 3) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 3) == ""); } { // Redundant UTF-8 sequence for Directory traversal attack (3) std::string source = "\xF0\x80\x80\xAF"; // Error: Can't convert string to correct encoding such as UTF-32 - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); - CC_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 4) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 0) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 1, 1) == ""); + AX_ASSERT(Helper::getSubStringOfUTF8String(source, 0, 4) == ""); } } diff --git a/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp b/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp index 65fd69b069..276b811e14 100644 --- a/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp +++ b/tests/cpp-tests/Classes/VibrateTest/VibrateTest.cpp @@ -79,9 +79,9 @@ private: auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); - listener->onTouchBegan = CC_CALLBACK_2(TextButton::onTouchBegan, this); - listener->onTouchEnded = CC_CALLBACK_2(TextButton::onTouchEnded, this); - listener->onTouchCancelled = CC_CALLBACK_2(TextButton::onTouchCancelled, this); + listener->onTouchBegan = AX_CALLBACK_2(TextButton::onTouchBegan, this); + listener->onTouchEnded = AX_CALLBACK_2(TextButton::onTouchEnded, this); + listener->onTouchCancelled = AX_CALLBACK_2(TextButton::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } @@ -161,7 +161,7 @@ public: return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return ret; } diff --git a/tests/cpp-tests/Classes/WindowTest/WindowTest.cpp b/tests/cpp-tests/Classes/WindowTest/WindowTest.cpp index a77fde5041..1690944d6b 100644 --- a/tests/cpp-tests/Classes/WindowTest/WindowTest.cpp +++ b/tests/cpp-tests/Classes/WindowTest/WindowTest.cpp @@ -24,8 +24,8 @@ #include "WindowTest.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ - CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ + AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) USING_NS_AX; WindowTests::WindowTests() diff --git a/tests/cpp-tests/Classes/WindowTest/WindowTest.h b/tests/cpp-tests/Classes/WindowTest/WindowTest.h index 7028669dd5..b4cb5cde7e 100644 --- a/tests/cpp-tests/Classes/WindowTest/WindowTest.h +++ b/tests/cpp-tests/Classes/WindowTest/WindowTest.h @@ -25,8 +25,8 @@ #ifndef __WINDOWTEST_H__ #define __WINDOWTEST_H__ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ - CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ + AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) # include "../BaseTest.h" DEFINE_TEST_SUITE(WindowTests); diff --git a/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp b/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp index 301fb40976..096d9683db 100644 --- a/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp +++ b/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp @@ -70,7 +70,7 @@ void ZwoptexGenericTest::onEnter() sprite2->setFlippedX(false); sprite2->setFlippedY(false); - schedule(CC_SCHEDULE_SELECTOR(ZwoptexGenericTest::startIn05Secs), 1.0f); + schedule(AX_SCHEDULE_SELECTOR(ZwoptexGenericTest::startIn05Secs), 1.0f); sprite1->retain(); sprite2->retain(); @@ -80,8 +80,8 @@ void ZwoptexGenericTest::onEnter() void ZwoptexGenericTest::startIn05Secs(float dt) { - unschedule(CC_SCHEDULE_SELECTOR(ZwoptexGenericTest::startIn05Secs)); - schedule(CC_SCHEDULE_SELECTOR(ZwoptexGenericTest::flipSprites), 0.5f); + unschedule(AX_SCHEDULE_SELECTOR(ZwoptexGenericTest::startIn05Secs)); + schedule(AX_SCHEDULE_SELECTOR(ZwoptexGenericTest::flipSprites), 0.5f); } static int spriteFrameIndex = 0; diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index 265b91f7bd..3ffabe05a8 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -44,7 +44,7 @@ public: RootTests() { // addTest("Node: Scene3D", [](){return new Scene3DTests(); }); -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) addTest("ImGui", []() { return new ImGuiTests(); }); #endif addTest("Texture2D", []() { return new Texture2DTests(); }); @@ -55,11 +55,11 @@ public: addTest("Audio - NewAudioEngine", []() { return new AudioEngineTests(); }); addTest("Box2D - Basic", []() { return new Box2DTests(); }); -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) addTest("Box2D - TestBed", []() { return new Box2DTestBedTests(); }); #endif addTest("Chipmunk2D - Basic", []() { return new ChipmunkTests(); }); -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) addTest("Chipmunk2D - TestBed", []() { return new ChipmunkTestBedTests(); }); #endif addTest("Bugs", []() { return new BugsTests(); }); @@ -76,7 +76,7 @@ public: addTest("FileUtils", []() { return new FileUtilsTests(); }); addTest("Fonts", []() { return new FontTests(); }); addTest("Interval", []() { return new IntervalTests(); }); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) addTest("JNIHelper", []() { return new JNITests(); }); #endif addTest("Material System", []() { return new MaterialSystemTest(); }); @@ -94,7 +94,7 @@ public: addTest("Node: Parallax", []() { return new ParallaxTests(); }); addTest("Node: Particles", []() { return new ParticleTests(); }); addTest("Node: Particle3D (PU)", []() { return new Particle3DTests(); }); -#if CC_USE_PHYSICS +#if AX_USE_PHYSICS addTest("Node: Physics", []() { return new PhysicsTests(); }); #endif addTest("Node: Physics3D", []() { return new Physics3DTests(); }); @@ -124,13 +124,13 @@ public: addTest("Unzip Test", []() { return new ZipTests(); }); addTest("URL Open Test", []() { return new OpenURLTests(); }); addTest("UserDefault", []() { return new UserDefaultTests(); }); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) addTest("Vibrate", []() { return new VibrateTests(); }); #endif addTest("Zwoptex", []() { return new ZwoptexTests(); }); addTest("SpriteFrameCache", []() { return new SpriteFrameCacheTests(); }); // TODO -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ - CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ + AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) addTest("Window Test", []() { return new WindowTests(); }); // TODO wrong effect #endif } @@ -143,7 +143,7 @@ TestController::TestController() : _stopAutoTest(true), _isRunInBackground(false _director = Director::getInstance(); _touchListener = EventListenerTouchOneByOne::create(); - _touchListener->onTouchBegan = CC_CALLBACK_2(TestController::blockTouchBegan, this); + _touchListener->onTouchBegan = AX_CALLBACK_2(TestController::blockTouchBegan, this); _touchListener->setSwallowTouches(true); _director->getEventDispatcher()->addEventListenerWithFixedPriority(_touchListener, -200); @@ -441,10 +441,10 @@ void TestController::logEx(const char* format, ...) vsnprintf(buff, 1020, format, args); strcat(buff, "\n"); -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID __android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", "%s", buff); -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 WCHAR wszBuf[1024] = {0}; MultiByteToWideChar(CP_UTF8, 0, buff, -1, wszBuf, sizeof(wszBuf)); OutputDebugStringW(wszBuf); @@ -489,7 +489,7 @@ bool TestController::blockTouchBegan(Touch* touch, Event* event) } //================================================================================================== -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 # include static long __stdcall windowExceptionFilter(_EXCEPTION_POINTERS* excp) @@ -511,10 +511,10 @@ static void disableCrashCatch() SetUnhandledExceptionFilter(UnhandledExceptionFilter); } -#elif CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || \ - CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#elif AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \ + AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID -# if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +# if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID static int s_fatal_signals[] = { SIGILL, SIGABRT, SIGBUS, SIGFPE, SIGSEGV, SIGSTKFLT, SIGPIPE, }; diff --git a/tests/cpp-tests/Classes/tests.h b/tests/cpp-tests/Classes/tests.h index 5fb6ffe782..661cbb2c24 100644 --- a/tests/cpp-tests/Classes/tests.h +++ b/tests/cpp-tests/Classes/tests.h @@ -29,27 +29,27 @@ #include "Box2DTestBed/Box2DTestBed.h" #include "ChipmunkTest/ChipmunkTest.h" -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) # include "ChipmunkTestBed/ChipmunkTestBed.h" #endif -#if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_MARMALADE) # include "ClippingNodeTest/ClippingNodeTest.h" #endif #include "NewAudioEngineTest/NewAudioEngineTest.h" -#if (CC_TARGET_PLATFORM != CC_PLATFORM_EMSCRIPEN) -# if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_EMSCRIPEN) +# if (AX_TARGET_PLATFORM != AX_PLATFORM_MARMALADE) // bada don't support libcurl -# if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) +# if (AX_TARGET_PLATFORM != AX_PLATFORM_BADA) # include "CurlTest/CurlTest.h" # endif # endif #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) # include "JNITest/JNITest.h" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || \ - CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || \ + AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) # include "WindowTest/WindowTest.h" #endif @@ -119,7 +119,7 @@ #include "ZwoptexTest/ZwoptexTest.h" #include "SpriteFrameCacheTest/SpriteFrameCacheTest.h" #include "ZipTest/ZipTests.h" -#if defined(CC_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) # include "ImGuiTest/ImGuiTest.h" #endif #endif diff --git a/tests/cpp-tests/proj.ios/Classes/testsAppDelegate.mm b/tests/cpp-tests/proj.ios/Classes/testsAppDelegate.mm index d7c2da05d4..937f9461f5 100644 --- a/tests/cpp-tests/proj.ios/Classes/testsAppDelegate.mm +++ b/tests/cpp-tests/proj.ios/Classes/testsAppDelegate.mm @@ -60,13 +60,13 @@ static AppDelegate s_sharedApplication; multiSampling:axis::GLViewImpl::_multisamplingCount > 0 ? YES : NO numberOfSamples:axis::GLViewImpl::_multisamplingCount]; -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [eaglView setMultipleTouchEnabled:YES]; #endif // Use RootViewController manage CCEAGLView viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) viewController.extendedLayoutIncludesOpaqueBars = YES; #endif viewController.view = eaglView; @@ -85,7 +85,7 @@ static AppDelegate s_sharedApplication; [window makeKeyAndVisible]; -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [viewController prefersStatusBarHidden]; #endif diff --git a/tests/fairygui-tests/Classes/AppDelegate.cpp b/tests/fairygui-tests/Classes/AppDelegate.cpp index 8aa8059469..0db17f4941 100644 --- a/tests/fairygui-tests/Classes/AppDelegate.cpp +++ b/tests/fairygui-tests/Classes/AppDelegate.cpp @@ -41,7 +41,7 @@ bool AppDelegate::applicationDidFinishLaunching() { auto director = Director::getInstance(); auto glview = director->getOpenGLView(); if (!glview) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) glview = GLViewImpl::createWithRect("Examples", axis::Rect(0, 0, 1280, 720)); #else glview = GLViewImpl::create("Examples"); @@ -79,7 +79,7 @@ bool AppDelegate::applicationDidFinishLaunching() { register_all_packages(); //showing how to regsiter a ttf font -#ifdef CC_PLATFORM_PC +#ifdef AX_PLATFORM_PC UIConfig::registerFont(UIConfig::defaultFont, "fonts/DroidSansFallback.ttf"); #endif diff --git a/tests/fairygui-tests/Classes/BagScene.cpp b/tests/fairygui-tests/Classes/BagScene.cpp index 7c83e454aa..955c983ddb 100644 --- a/tests/fairygui-tests/Classes/BagScene.cpp +++ b/tests/fairygui-tests/Classes/BagScene.cpp @@ -8,7 +8,7 @@ BagScene::BagScene() :_bagWindow(nullptr) BagScene::~BagScene() { - CC_SAFE_RELEASE(_bagWindow); + AX_SAFE_RELEASE(_bagWindow); } void BagScene::continueInit() diff --git a/tests/fairygui-tests/Classes/BagWindow.cpp b/tests/fairygui-tests/Classes/BagWindow.cpp index 3afa32194f..e8a0c9dc02 100644 --- a/tests/fairygui-tests/Classes/BagWindow.cpp +++ b/tests/fairygui-tests/Classes/BagWindow.cpp @@ -9,8 +9,8 @@ void BagWindow::onInit() setModal(true); _list = _contentPane->getChild("list")->as(); - _list->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(BagWindow::onClickItem, this)); - _list->itemRenderer = CC_CALLBACK_2(BagWindow::renderListItem, this); + _list->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(BagWindow::onClickItem, this)); + _list->itemRenderer = AX_CALLBACK_2(BagWindow::renderListItem, this); _list->setNumItems(45); } @@ -25,12 +25,12 @@ void BagWindow::doShowAnimation() setScale(0.1f, 0.1f); setPivot(0.5f, 0.5f); - GTween::to(getScale(), Vec2::ONE, 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(CC_CALLBACK_0(BagWindow::onShown, this)); + GTween::to(getScale(), Vec2::ONE, 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(AX_CALLBACK_0(BagWindow::onShown, this)); } void BagWindow::doHideAnimation() { - GTween::to(getScale(), Vec2(0.1f, 0.1f), 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(CC_CALLBACK_0(BagWindow::hideImmediately, this)); + GTween::to(getScale(), Vec2(0.1f, 0.1f), 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(AX_CALLBACK_0(BagWindow::hideImmediately, this)); } void BagWindow::onClickItem(EventContext* context) diff --git a/tests/fairygui-tests/Classes/BasicsScene.cpp b/tests/fairygui-tests/Classes/BasicsScene.cpp index 17eb0b1351..8a8853689c 100644 --- a/tests/fairygui-tests/Classes/BasicsScene.cpp +++ b/tests/fairygui-tests/Classes/BasicsScene.cpp @@ -18,7 +18,7 @@ void BasicsScene::continueInit() _backBtn = _view->getChild("btn_Back"); _backBtn->setVisible(false); - _backBtn->addClickListener(CC_CALLBACK_1(BasicsScene::onClickBack, this)); + _backBtn->addClickListener(AX_CALLBACK_1(BasicsScene::onClickBack, this)); _demoContainer = _view->getChild("container")->as(); _cc = _view->getController("c1"); @@ -28,7 +28,7 @@ void BasicsScene::continueInit() { GObject* obj = _view->getChildAt(i); if (obj->getGroup() != nullptr && obj->getGroup()->name.compare("btns") == 0) - obj->addClickListener(CC_CALLBACK_1(BasicsScene::runDemo, this)); + obj->addClickListener(AX_CALLBACK_1(BasicsScene::runDemo, this)); } } @@ -42,10 +42,10 @@ BasicsScene::BasicsScene() BasicsScene::~BasicsScene() { - CC_SAFE_RELEASE(_winA); - CC_SAFE_RELEASE(_winB); - CC_SAFE_RELEASE(_pm); - CC_SAFE_RELEASE(_popupCom); + AX_SAFE_RELEASE(_winA); + AX_SAFE_RELEASE(_winB); + AX_SAFE_RELEASE(_pm); + AX_SAFE_RELEASE(_popupCom); } void BasicsScene::onClickBack(EventContext* context) @@ -104,10 +104,10 @@ void BasicsScene::playPopup() { _pm = PopupMenu::create(); _pm->retain(); - _pm->addItem("Item 1", CC_CALLBACK_1(BasicsScene::onClickMenu, this)); - _pm->addItem("Item 2", CC_CALLBACK_1(BasicsScene::onClickMenu, this)); - _pm->addItem("Item 3", CC_CALLBACK_1(BasicsScene::onClickMenu, this)); - _pm->addItem("Item 4", CC_CALLBACK_1(BasicsScene::onClickMenu, this)); + _pm->addItem("Item 1", AX_CALLBACK_1(BasicsScene::onClickMenu, this)); + _pm->addItem("Item 2", AX_CALLBACK_1(BasicsScene::onClickMenu, this)); + _pm->addItem("Item 3", AX_CALLBACK_1(BasicsScene::onClickMenu, this)); + _pm->addItem("Item 4", AX_CALLBACK_1(BasicsScene::onClickMenu, this)); } if (_popupCom == nullptr) @@ -239,9 +239,9 @@ void BasicsScene::playProgress() { GComponent* obj = _demoObjects.at("ProgressBar"); axis::Director::getInstance()->getScheduler()->schedule( - CC_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this, 0.02f, false); + AX_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this, 0.02f, false); obj->addEventListener(UIEventType::Exit, [this](EventContext*) { - axis::Director::getInstance()->getScheduler()->unschedule(CC_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this); + axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(BasicsScene::onPlayProgress), this); }); } diff --git a/tests/fairygui-tests/Classes/ChatScene.cpp b/tests/fairygui-tests/Classes/ChatScene.cpp index 69870f0fdc..8d14111e9c 100644 --- a/tests/fairygui-tests/Classes/ChatScene.cpp +++ b/tests/fairygui-tests/Classes/ChatScene.cpp @@ -9,7 +9,7 @@ ChatScene::ChatScene() :_emojiSelectUI(nullptr) ChatScene::~ChatScene() { - CC_SAFE_RELEASE(_emojiSelectUI); + AX_SAFE_RELEASE(_emojiSelectUI); } void ChatScene::continueInit() @@ -22,18 +22,18 @@ void ChatScene::continueInit() _list = _view->getChild("list")->as(); _list->setVirtual(); - _list->itemProvider = CC_CALLBACK_1(ChatScene::getListItemResource, this); - _list->itemRenderer = CC_CALLBACK_2(ChatScene::renderListItem, this); + _list->itemProvider = AX_CALLBACK_1(ChatScene::getListItemResource, this); + _list->itemRenderer = AX_CALLBACK_2(ChatScene::renderListItem, this); _input = _view->getChild("input")->as(); - _input->addEventListener(UIEventType::Submit, CC_CALLBACK_1(ChatScene::onSubmit, this)); + _input->addEventListener(UIEventType::Submit, AX_CALLBACK_1(ChatScene::onSubmit, this)); - _view->getChild("btnSend")->addClickListener(CC_CALLBACK_1(ChatScene::onClickSendBtn, this)); - _view->getChild("btnEmoji")->addClickListener(CC_CALLBACK_1(ChatScene::onClickEmojiBtn, this)); + _view->getChild("btnSend")->addClickListener(AX_CALLBACK_1(ChatScene::onClickSendBtn, this)); + _view->getChild("btnEmoji")->addClickListener(AX_CALLBACK_1(ChatScene::onClickEmojiBtn, this)); _emojiSelectUI = UIPackage::createObject("Emoji", "EmojiSelectUI")->as(); _emojiSelectUI->retain(); - _emojiSelectUI->getChild("list")->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(ChatScene::onClickEmoji, this)); + _emojiSelectUI->getChild("list")->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(ChatScene::onClickEmoji, this)); } void ChatScene::onClickSendBtn(EventContext * context) diff --git a/tests/fairygui-tests/Classes/DemoScene.cpp b/tests/fairygui-tests/Classes/DemoScene.cpp index 3d1174b528..ac6d23464a 100644 --- a/tests/fairygui-tests/Classes/DemoScene.cpp +++ b/tests/fairygui-tests/Classes/DemoScene.cpp @@ -21,7 +21,7 @@ bool DemoScene::init() closeButton->addRelation(_groot, RelationType::Right_Right); closeButton->addRelation(_groot, RelationType::Bottom_Bottom); closeButton->setSortingOrder(100000); - closeButton->addClickListener(CC_CALLBACK_1(DemoScene::onClose, this)); + closeButton->addClickListener(AX_CALLBACK_1(DemoScene::onClose, this)); _groot->addChild(closeButton); return true; @@ -42,7 +42,7 @@ void DemoScene::onClose(EventContext* context) //Close the cocos2d-x game scene and quit the application Director::getInstance()->end(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) exit(0); #endif @@ -60,5 +60,5 @@ DemoScene::DemoScene() : DemoScene::~DemoScene() { - CC_SAFE_RELEASE(_groot); + AX_SAFE_RELEASE(_groot); } diff --git a/tests/fairygui-tests/Classes/GuideScene.cpp b/tests/fairygui-tests/Classes/GuideScene.cpp index 4231136228..972e5e912d 100644 --- a/tests/fairygui-tests/Classes/GuideScene.cpp +++ b/tests/fairygui-tests/Classes/GuideScene.cpp @@ -9,7 +9,7 @@ GuideScene::GuideScene():_guideLayer(nullptr) GuideScene::~GuideScene() { - CC_SAFE_RELEASE(_guideLayer); + AX_SAFE_RELEASE(_guideLayer); } void GuideScene::continueInit() diff --git a/tests/fairygui-tests/Classes/JoystickModule.cpp b/tests/fairygui-tests/Classes/JoystickModule.cpp index 2121f7cd59..d9655d6e01 100644 --- a/tests/fairygui-tests/Classes/JoystickModule.cpp +++ b/tests/fairygui-tests/Classes/JoystickModule.cpp @@ -32,9 +32,9 @@ bool JoystickModule::init(GComponent * mainView) touchId = -1; _radius = 150; - _touchArea->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(JoystickModule::onTouchBegin, this)); - _touchArea->addEventListener(UIEventType::TouchMove, CC_CALLBACK_1(JoystickModule::onTouchMove, this)); - _touchArea->addEventListener(UIEventType::TouchEnd, CC_CALLBACK_1(JoystickModule::onTouchEnd, this)); + _touchArea->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(JoystickModule::onTouchBegin, this)); + _touchArea->addEventListener(UIEventType::TouchMove, AX_CALLBACK_1(JoystickModule::onTouchMove, this)); + _touchArea->addEventListener(UIEventType::TouchEnd, AX_CALLBACK_1(JoystickModule::onTouchEnd, this)); _tweener = nullptr; diff --git a/tests/fairygui-tests/Classes/JoystickScene.cpp b/tests/fairygui-tests/Classes/JoystickScene.cpp index 1ad53ab691..5e0230bc33 100644 --- a/tests/fairygui-tests/Classes/JoystickScene.cpp +++ b/tests/fairygui-tests/Classes/JoystickScene.cpp @@ -4,7 +4,7 @@ USING_NS_AX; JoystickScene::~JoystickScene() { - CC_SAFE_RELEASE(_joystick); + AX_SAFE_RELEASE(_joystick); } void JoystickScene::continueInit() diff --git a/tests/fairygui-tests/Classes/LoopListScene.cpp b/tests/fairygui-tests/Classes/LoopListScene.cpp index 9ac842eec2..6cbecb5137 100644 --- a/tests/fairygui-tests/Classes/LoopListScene.cpp +++ b/tests/fairygui-tests/Classes/LoopListScene.cpp @@ -12,10 +12,10 @@ void LoopListScene::continueInit() _groot->addChild(_view); _list = _view->getChild("list")->as(); - _list->itemRenderer = CC_CALLBACK_2(LoopListScene::renderListItem, this); + _list->itemRenderer = AX_CALLBACK_2(LoopListScene::renderListItem, this); _list->setVirtualAndLoop(); _list->setNumItems(5); - _list->addEventListener(UIEventType::Scroll, CC_CALLBACK_1(LoopListScene::doSpecialEffect, this)); + _list->addEventListener(UIEventType::Scroll, AX_CALLBACK_1(LoopListScene::doSpecialEffect, this)); doSpecialEffect(nullptr); } diff --git a/tests/fairygui-tests/Classes/ModalWaitingScene.cpp b/tests/fairygui-tests/Classes/ModalWaitingScene.cpp index c989cc5e65..62b09fe133 100644 --- a/tests/fairygui-tests/Classes/ModalWaitingScene.cpp +++ b/tests/fairygui-tests/Classes/ModalWaitingScene.cpp @@ -8,7 +8,7 @@ ModalWaitingScene::ModalWaitingScene():_testWin(nullptr) ModalWaitingScene::~ModalWaitingScene() { - CC_SAFE_RELEASE(_testWin); + AX_SAFE_RELEASE(_testWin); } void ModalWaitingScene::continueInit() diff --git a/tests/fairygui-tests/Classes/PullToRefreshScene.cpp b/tests/fairygui-tests/Classes/PullToRefreshScene.cpp index 0600d04365..82ca959c90 100644 --- a/tests/fairygui-tests/Classes/PullToRefreshScene.cpp +++ b/tests/fairygui-tests/Classes/PullToRefreshScene.cpp @@ -24,7 +24,7 @@ void ScrollPaneHeader::onConstruct() { _c1 = getController("c1"); - addEventListener(UIEventType::SizeChange, CC_CALLBACK_1(ScrollPaneHeader::onSizeChanged, this)); + addEventListener(UIEventType::SizeChange, AX_CALLBACK_1(ScrollPaneHeader::onSizeChanged, this)); } void ScrollPaneHeader::onSizeChanged(EventContext*) @@ -52,16 +52,16 @@ void PullToRefreshScene::continueInit() _groot->addChild(_view); _list1 = _view->getChild("list1")->as(); - _list1->itemRenderer = CC_CALLBACK_2(PullToRefreshScene::renderListItem1, this); + _list1->itemRenderer = AX_CALLBACK_2(PullToRefreshScene::renderListItem1, this); _list1->setVirtual(); _list1->setNumItems(1); - _list1->addEventListener(UIEventType::PullDownRelease, CC_CALLBACK_1(PullToRefreshScene::onPullDownToRefresh, this)); + _list1->addEventListener(UIEventType::PullDownRelease, AX_CALLBACK_1(PullToRefreshScene::onPullDownToRefresh, this)); _list2 = _view->getChild("list2")->as(); - _list2->itemRenderer = CC_CALLBACK_2(PullToRefreshScene::renderListItem2, this); + _list2->itemRenderer = AX_CALLBACK_2(PullToRefreshScene::renderListItem2, this); _list2->setVirtual(); _list2->setNumItems(1); - _list2->addEventListener(UIEventType::PullUpRelease, CC_CALLBACK_1(PullToRefreshScene::onPullUpToRefresh, this)); + _list2->addEventListener(UIEventType::PullUpRelease, AX_CALLBACK_1(PullToRefreshScene::onPullUpToRefresh, this)); } void PullToRefreshScene::renderListItem1(int index, GObject* obj) diff --git a/tests/fairygui-tests/Classes/ScrollPaneScene.cpp b/tests/fairygui-tests/Classes/ScrollPaneScene.cpp index dc0029881c..af28613dbc 100644 --- a/tests/fairygui-tests/Classes/ScrollPaneScene.cpp +++ b/tests/fairygui-tests/Classes/ScrollPaneScene.cpp @@ -13,10 +13,10 @@ void ScrollPaneScene::continueInit() _groot->addChild(_view); _list = _view->getChild("list")->as(); - _list->itemRenderer = CC_CALLBACK_2(ScrollPaneScene::renderListItem, this); + _list->itemRenderer = AX_CALLBACK_2(ScrollPaneScene::renderListItem, this); _list->setVirtual(); _list->setNumItems(1000); - _list->addEventListener(UIEventType::TouchBegin, CC_CALLBACK_1(ScrollPaneScene::onClickList, this)); + _list->addEventListener(UIEventType::TouchBegin, AX_CALLBACK_1(ScrollPaneScene::onClickList, this)); } void ScrollPaneScene::renderListItem(int index, GObject* obj) @@ -26,8 +26,8 @@ void ScrollPaneScene::renderListItem(int index, GObject* obj) item->getScrollPane()->setPosX(0); //reset scroll pos //Be carefull, RenderListItem is calling repeatedly, add tag to avoid adding duplicately. - item->getChild("b0")->addClickListener(CC_CALLBACK_1(ScrollPaneScene::onClickStick, this), EventTag(this)); - item->getChild("b1")->addClickListener(CC_CALLBACK_1(ScrollPaneScene::onClickDelete, this), EventTag(this)); + item->getChild("b0")->addClickListener(AX_CALLBACK_1(ScrollPaneScene::onClickStick, this), EventTag(this)); + item->getChild("b1")->addClickListener(AX_CALLBACK_1(ScrollPaneScene::onClickDelete, this), EventTag(this)); } void ScrollPaneScene::onClickStick(EventContext * context) diff --git a/tests/fairygui-tests/Classes/TransitionDemoScene.cpp b/tests/fairygui-tests/Classes/TransitionDemoScene.cpp index 0e6dd17394..b4477d4fb1 100644 --- a/tests/fairygui-tests/Classes/TransitionDemoScene.cpp +++ b/tests/fairygui-tests/Classes/TransitionDemoScene.cpp @@ -4,12 +4,12 @@ USING_NS_AX; TransitionDemoScene::~TransitionDemoScene() { - CC_SAFE_RELEASE(_g1); - CC_SAFE_RELEASE(_g2); - CC_SAFE_RELEASE(_g3); - CC_SAFE_RELEASE(_g4); - CC_SAFE_RELEASE(_g5); - CC_SAFE_RELEASE(_g6); + AX_SAFE_RELEASE(_g1); + AX_SAFE_RELEASE(_g2); + AX_SAFE_RELEASE(_g3); + AX_SAFE_RELEASE(_g4); + AX_SAFE_RELEASE(_g5); + AX_SAFE_RELEASE(_g6); } void TransitionDemoScene::continueInit() @@ -30,15 +30,15 @@ void TransitionDemoScene::continueInit() _g4->retain(); _g5 = UIPackage::createObject("Transition", "PowerUp")->as(); _g5->retain(); - _g5->getTransition("t0")->setHook("play_num_now", CC_CALLBACK_0(TransitionDemoScene::playNum, this)); + _g5->getTransition("t0")->setHook("play_num_now", AX_CALLBACK_0(TransitionDemoScene::playNum, this)); _g6 = UIPackage::createObject("Transition", "PathDemo")->as(); _g6->retain(); _view->getChild("btn0")->addClickListener([this](EventContext*) { __play(_g1); }); _view->getChild("btn1")->addClickListener([this](EventContext*) { __play(_g2); }); _view->getChild("btn2")->addClickListener([this](EventContext*) { __play(_g3); }); - _view->getChild("btn3")->addClickListener(CC_CALLBACK_1(TransitionDemoScene::__play4, this)); - _view->getChild("btn4")->addClickListener(CC_CALLBACK_1(TransitionDemoScene::__play5, this)); + _view->getChild("btn3")->addClickListener(AX_CALLBACK_1(TransitionDemoScene::__play4, this)); + _view->getChild("btn4")->addClickListener(AX_CALLBACK_1(TransitionDemoScene::__play5, this)); _view->getChild("btn5")->addClickListener([this](EventContext*) { __play(_g6); }); } diff --git a/tests/fairygui-tests/Classes/TreeViewScene.cpp b/tests/fairygui-tests/Classes/TreeViewScene.cpp index e63ed7da3c..37da86bb5a 100644 --- a/tests/fairygui-tests/Classes/TreeViewScene.cpp +++ b/tests/fairygui-tests/Classes/TreeViewScene.cpp @@ -18,11 +18,11 @@ void TreeViewScene::continueInit() _groot->addChild(_view); _tree1 = _view->getChild("tree")->as(); - _tree1->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(TreeViewScene::onClickNode, this)); + _tree1->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(TreeViewScene::onClickNode, this)); _tree2 = _view->getChild("tree2")->as(); - _tree2->addEventListener(UIEventType::ClickItem, CC_CALLBACK_1(TreeViewScene::onClickNode, this)); - _tree2->treeNodeRender = CC_CALLBACK_2(TreeViewScene::renderTreeNode, this); + _tree2->addEventListener(UIEventType::ClickItem, AX_CALLBACK_1(TreeViewScene::onClickNode, this)); + _tree2->treeNodeRender = AX_CALLBACK_2(TreeViewScene::renderTreeNode, this); GTreeNode* topNode = GTreeNode::create(true); topNode->setData(Value("I'm a top node")); diff --git a/tests/fairygui-tests/Classes/VirtualListScene.cpp b/tests/fairygui-tests/Classes/VirtualListScene.cpp index b3ea94f235..6dc02c3f50 100644 --- a/tests/fairygui-tests/Classes/VirtualListScene.cpp +++ b/tests/fairygui-tests/Classes/VirtualListScene.cpp @@ -18,7 +18,7 @@ void VirtualListScene::continueInit() _view->getChild("n8")->addClickListener([this](EventContext*) { _list->getScrollPane()->scrollBottom(); }); _list = _view->getChild("mailList")->as(); - _list->itemRenderer = CC_CALLBACK_2(VirtualListScene::renderListItem, this); + _list->itemRenderer = AX_CALLBACK_2(VirtualListScene::renderListItem, this); _list->setVirtual(); _list->setNumItems(1000); } diff --git a/tests/fairygui-tests/Classes/Window2.cpp b/tests/fairygui-tests/Classes/Window2.cpp index fc7e803dcb..07fb457bef 100644 --- a/tests/fairygui-tests/Classes/Window2.cpp +++ b/tests/fairygui-tests/Classes/Window2.cpp @@ -13,12 +13,12 @@ void Window2::doShowAnimation() setScale(0.1f, 0.1f); setPivot(0.5f, 0.5f); - GTween::to(getScale(), Vec2::ONE, 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(CC_CALLBACK_0(Window2::onShown, this)); + GTween::to(getScale(), Vec2::ONE, 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(AX_CALLBACK_0(Window2::onShown, this)); } void Window2::doHideAnimation() { - GTween::to(getScale(), Vec2(0.1f, 0.1f), 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(CC_CALLBACK_0(Window2::hideImmediately, this)); + GTween::to(getScale(), Vec2(0.1f, 0.1f), 0.3f)->setTarget(this, TweenPropType::Scale)->onComplete(AX_CALLBACK_0(Window2::hideImmediately, this)); } void Window2::onShown() diff --git a/tests/live2d-tests/Classes/AppDelegate.cpp b/tests/live2d-tests/Classes/AppDelegate.cpp index 7904e7095d..4aca219233 100644 --- a/tests/live2d-tests/Classes/AppDelegate.cpp +++ b/tests/live2d-tests/Classes/AppDelegate.cpp @@ -71,7 +71,7 @@ bool AppDelegate::applicationDidFinishLaunching() auto glview = director->getOpenGLView(); if(!glview) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) glview = GLViewImpl::createWithRect("Demo", axis::Rect(0, 0, designResolutionSize.width, designResolutionSize.height)); #else glview = GLViewImpl::create("Demo"); diff --git a/tests/live2d-tests/Classes/LAppLive2DManager.cpp b/tests/live2d-tests/Classes/LAppLive2DManager.cpp index df8ffac86f..06b2349887 100644 --- a/tests/live2d-tests/Classes/LAppLive2DManager.cpp +++ b/tests/live2d-tests/Classes/LAppLive2DManager.cpp @@ -87,7 +87,7 @@ LAppLive2DManager::LAppLive2DManager() if (_renderBuffer) {// 描画ターゲット作成 -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) // Retina対策でこっちからとる GLViewImpl *glimpl = (GLViewImpl *)Director::getInstance()->getOpenGLView(); glfwGetFramebufferSize(glimpl->getWindow(), &width, &height); @@ -323,7 +323,7 @@ void LAppLive2DManager::CreateShader() "attribute vec2 uv;" "varying vec2 vuv;" "void main(void){" -#if defined(CC_USE_METAL) +#if defined(AX_USE_METAL) " gl_Position = vec4(position.x, -position.y, position.z, 1.0);" #else " gl_Position = vec4(position, 1.0);" @@ -332,7 +332,7 @@ void LAppLive2DManager::CreateShader() "}"; const char* fragmentShader = -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID) "precision mediump float;" #endif "varying vec2 vuv;" diff --git a/tests/live2d-tests/Classes/LAppModel.cpp b/tests/live2d-tests/Classes/LAppModel.cpp index b711b54d9f..8ad6a1ddb9 100644 --- a/tests/live2d-tests/Classes/LAppModel.cpp +++ b/tests/live2d-tests/Classes/LAppModel.cpp @@ -762,7 +762,7 @@ void LAppModel::MakeRenderingTarget() float aspectFactor = 1.0f; int frameW = Director::getInstance()->getOpenGLView()->getFrameSize().width, frameH = Director::getInstance()->getOpenGLView()->getFrameSize().height; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) // Retina対策でこっちからとる GLViewImpl *glimpl = (GLViewImpl *)Director::getInstance()->getOpenGLView(); int renderW = frameW; diff --git a/tests/live2d-tests/Classes/LAppView.cpp b/tests/live2d-tests/Classes/LAppView.cpp index f29f9db94b..612e3863f3 100644 --- a/tests/live2d-tests/Classes/LAppView.cpp +++ b/tests/live2d-tests/Classes/LAppView.cpp @@ -77,9 +77,9 @@ void LAppView::onEnter() EventListenerTouchAllAtOnce* listener = EventListenerTouchAllAtOnce::create(); // タッチメソッド設定 - listener->onTouchesBegan = CC_CALLBACK_2(LAppView::onTouchesBegan, this); - listener->onTouchesMoved = CC_CALLBACK_2(LAppView::onTouchesMoved, this); - listener->onTouchesEnded = CC_CALLBACK_2(LAppView::onTouchesEnded, this); + listener->onTouchesBegan = AX_CALLBACK_2(LAppView::onTouchesBegan, this); + listener->onTouchesMoved = AX_CALLBACK_2(LAppView::onTouchesMoved, this); + listener->onTouchesEnded = AX_CALLBACK_2(LAppView::onTouchesEnded, this); // 優先度100でディスパッチャーに登録 this->getEventDispatcher()->addEventListenerWithFixedPriority(listener, 100); @@ -261,6 +261,6 @@ LAppView* LAppView::createDrawNode() ret->autorelease(); return ret; } - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); return nullptr; } diff --git a/tests/live2d-tests/Classes/SampleScene.cpp b/tests/live2d-tests/Classes/SampleScene.cpp index ef1e102684..5c321f788b 100644 --- a/tests/live2d-tests/Classes/SampleScene.cpp +++ b/tests/live2d-tests/Classes/SampleScene.cpp @@ -67,7 +67,7 @@ bool SampleScene::init() _closeItem = MenuItemImage::create( "CloseNormal.png", "CloseSelected.png", - CC_CALLBACK_1(SampleScene::menuCloseCallback, this) + AX_CALLBACK_1(SampleScene::menuCloseCallback, this) ); if (_closeItem == nullptr || @@ -86,7 +86,7 @@ bool SampleScene::init() _changeItem = MenuItemImage::create( "icon_gear.png", "icon_gear.png", - CC_CALLBACK_1(SampleScene::menuChangeCallback, this) + AX_CALLBACK_1(SampleScene::menuChangeCallback, this) ); if (_changeItem == nullptr || @@ -191,7 +191,7 @@ void SampleScene::menuCloseCallback(Ref* pSender) Director::getInstance()->end(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS) exit(0); #endif } diff --git a/tests/lua-tests/project/Classes/AppDelegate.cpp b/tests/lua-tests/project/Classes/AppDelegate.cpp index a15a770105..9cc3456f87 100644 --- a/tests/lua-tests/project/Classes/AppDelegate.cpp +++ b/tests/lua-tests/project/Classes/AppDelegate.cpp @@ -57,8 +57,8 @@ bool AppDelegate::applicationDidFinishLaunching() lua_getglobal(L, "_G"); if (lua_istable(L, -1)) // stack:...,_G, { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || \ - CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || \ + AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) register_assetsmanager_test_sample(L); #endif register_test_binding(L); diff --git a/tests/lua-tests/project/Classes/lua_assetsmanager_test_sample.cpp b/tests/lua-tests/project/Classes/lua_assetsmanager_test_sample.cpp index ba919eefac..e7ccc209c0 100644 --- a/tests/lua-tests/project/Classes/lua_assetsmanager_test_sample.cpp +++ b/tests/lua-tests/project/Classes/lua_assetsmanager_test_sample.cpp @@ -29,7 +29,7 @@ #include "cocos2d.h" #include "extensions/cocos-ext.h" -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_WIN32) # include # include #endif @@ -49,7 +49,7 @@ static int lua_cocos2dx_createDownloadDir(lua_State* L) std::string pathToSave = FileUtils::getInstance()->getWritablePath(); pathToSave += "tmpdir"; -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) +#if (AX_TARGET_PLATFORM != AX_PLATFORM_WIN32) DIR* pDir = NULL; pDir = opendir(pathToSave.c_str()); @@ -90,7 +90,7 @@ static int lua_cocos2dx_deleteDownloadDir(lua_State* L) #endif std::string pathToSave = tolua_tostring(L, 1, ""); -#if CC_TARGET_OS_TVOS +#if AX_TARGET_OS_TVOS // Not implemented. "system" is not present on tvOS CCLOG("'lua_cocos2dx_deleteDownloadDir' not implemented on tvOS"); 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 399462daaa..23625cf6a5 100644 --- a/tests/lua-tests/project/Classes/lua_test_bindings.cpp +++ b/tests/lua-tests/project/Classes/lua_test_bindings.cpp @@ -99,7 +99,7 @@ protected: backend::UniformLocation _locMVPMatrix; private: - CC_DISALLOW_COPY_AND_ASSIGN(DrawNode3D); + AX_DISALLOW_COPY_AND_ASSIGN(DrawNode3D); bool _rendererDepthTestEnabled = false; @@ -111,7 +111,7 @@ DrawNode3D::DrawNode3D() {} DrawNode3D::~DrawNode3D() { - CC_SAFE_RELEASE_NULL(_programState); + AX_SAFE_RELEASE_NULL(_programState); } DrawNode3D* DrawNode3D::create() @@ -123,7 +123,7 @@ DrawNode3D* DrawNode3D::create() } else { - CC_SAFE_DELETE(ret); + AX_SAFE_DELETE(ret); } return ret; @@ -176,10 +176,10 @@ bool DrawNode3D::init() _dirty = true; - _customCommand.setBeforeCallback(CC_CALLBACK_0(DrawNode3D::onBeforeDraw, this)); - _customCommand.setAfterCallback(CC_CALLBACK_0(DrawNode3D::onAfterDraw, this)); + _customCommand.setBeforeCallback(AX_CALLBACK_0(DrawNode3D::onBeforeDraw, this)); + _customCommand.setAfterCallback(AX_CALLBACK_0(DrawNode3D::onAfterDraw, this)); -#if CC_ENABLE_CACHE_TEXTURE_DATA +#if AX_ENABLE_CACHE_TEXTURE_DATA // Need to listen the event only when not use batchnode, because it will use VBO auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event) { /** listen the event that coming to foreground on Android */ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/AppController.mm b/tests/lua-tests/project/proj.ios_mac/ios/AppController.mm index 3445999a14..fe2c093ca3 100644 --- a/tests/lua-tests/project/proj.ios_mac/ios/AppController.mm +++ b/tests/lua-tests/project/proj.ios_mac/ios/AppController.mm @@ -56,13 +56,13 @@ static AppDelegate s_sharedApplication; multiSampling:axis::GLViewImpl::_multisamplingCount > 0 ? YES : NO numberOfSamples:axis::GLViewImpl::_multisamplingCount]; -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [eaglView setMultipleTouchEnabled:YES]; #endif // Use RootViewController manage CCEAGLView viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) viewController.wantsFullScreenLayout = YES; #endif viewController.view = eaglView; @@ -81,7 +81,7 @@ static AppDelegate s_sharedApplication; [window makeKeyAndVisible]; -#if !defined(CC_TARGET_OS_TVOS) +#if !defined(AX_TARGET_OS_TVOS) [[UIApplication sharedApplication] setStatusBarHidden:YES]; #endif diff --git a/tools/console/plugins/plugin_generate/bin-templates/cpp-template-default/Classes/HelloWorldScene.cpp b/tools/console/plugins/plugin_generate/bin-templates/cpp-template-default/Classes/HelloWorldScene.cpp index 7a795176b0..4b3fe1d864 100644 --- a/tools/console/plugins/plugin_generate/bin-templates/cpp-template-default/Classes/HelloWorldScene.cpp +++ b/tools/console/plugins/plugin_generate/bin-templates/cpp-template-default/Classes/HelloWorldScene.cpp @@ -42,7 +42,7 @@ bool HelloWorld::init() auto closeItem = MenuItemImage::create( "CloseNormal.png", "CloseSelected.png", - CC_CALLBACK_1(HelloWorld::menuCloseCallback, this)); + AX_CALLBACK_1(HelloWorld::menuCloseCallback, this)); closeItem->setPosition(Vec2(origin.x + visibleSize.width - closeItem->getContentSize().width/2 , origin.y + closeItem->getContentSize().height/2)); diff --git a/tools/console/plugins/plugin_generate/bin-templates/lua-template-runtime/src/config.lua b/tools/console/plugins/plugin_generate/bin-templates/lua-template-runtime/src/config.lua index 2a7389f3ae..c656400d67 100644 --- a/tools/console/plugins/plugin_generate/bin-templates/lua-template-runtime/src/config.lua +++ b/tools/console/plugins/plugin_generate/bin-templates/lua-template-runtime/src/config.lua @@ -3,16 +3,16 @@ DEBUG = 2 -- use framework, will disable all deprecated API, false - use legacy API -CC_USE_FRAMEWORK = true +AX_USE_FRAMEWORK = true -- show FPS on screen -CC_SHOW_FPS = true +AX_SHOW_FPS = true -- disable create unexpected global variable -CC_DISABLE_GLOBAL = true +AX_DISABLE_GLOBAL = true -- for module display -CC_DESIGN_RESOLUTION = { +AX_DESIGN_RESOLUTION = { width = 960, height = 640, autoscale = "SHOW_ALL", diff --git a/tools/console/plugins/plugin_generate/gen_simulator.py b/tools/console/plugins/plugin_generate/gen_simulator.py index 710fa0fcbf..5666a2afd2 100644 --- a/tools/console/plugins/plugin_generate/gen_simulator.py +++ b/tools/console/plugins/plugin_generate/gen_simulator.py @@ -161,8 +161,8 @@ class SimulatorCompiler(axis.CCPlugin): def get_keywords(self): osx_keyword = { - "CC_TARGET_OS_IPHONE,":"CC_TARGET_OS_IPHONE,\n\"COCOS2D_DEBUG=1\",", - "CC_TARGET_OS_MAC,":"CC_TARGET_OS_MAC,\n\"COCOS2D_DEBUG=1\",", + "AX_TARGET_OS_IPHONE,":"AX_TARGET_OS_IPHONE,\n\"COCOS2D_DEBUG=1\",", + "AX_TARGET_OS_MAC,":"AX_TARGET_OS_MAC,\n\"COCOS2D_DEBUG=1\",", "COCOS2D_DEBUG=0":"COCOS2D_DEBUG=1", } diff --git a/tools/console/plugins/plugin_package/helper/template/proj.ios_mac/__PACKAGE_NAME__.xcodeproj/project.pbxproj b/tools/console/plugins/plugin_package/helper/template/proj.ios_mac/__PACKAGE_NAME__.xcodeproj/project.pbxproj index a34d8ccc5c..9db30b2be5 100644 --- a/tools/console/plugins/plugin_package/helper/template/proj.ios_mac/__PACKAGE_NAME__.xcodeproj/project.pbxproj +++ b/tools/console/plugins/plugin_package/helper/template/proj.ios_mac/__PACKAGE_NAME__.xcodeproj/project.pbxproj @@ -187,7 +187,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = ( - "CC_LUA_ENGINE_ENABLED=1", + "AX_LUA_ENGINE_ENABLED=1", "DEBUG=1", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; @@ -230,7 +230,7 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = "CC_LUA_ENGINE_ENABLED=1"; + GCC_PREPROCESSOR_DEFINITIONS = "AX_LUA_ENGINE_ENABLED=1"; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -273,7 +273,7 @@ GCC_PREFIX_HEADER = __PACKAGE_NAME__.pch; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", - CC_TARGET_OS_IPHONE, + AX_TARGET_OS_IPHONE, ); PRODUCT_NAME = "__PACKAGE_NAME__ IOS"; SDKROOT = iphoneos8.1; @@ -289,7 +289,7 @@ GCC_PREFIX_HEADER = __PACKAGE_NAME__.pch; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", - CC_TARGET_OS_IPHONE, + AX_TARGET_OS_IPHONE, ); PRODUCT_NAME = "__PACKAGE_NAME__ IOS"; SDKROOT = iphoneos8.1; diff --git a/tools/console/plugins/plugin_package/helper/template/proj.win32/__PACKAGE_NAME__.vcxproj b/tools/console/plugins/plugin_package/helper/template/proj.win32/__PACKAGE_NAME__.vcxproj index 26aaa6ff24..0c4ec7379e 100644 --- a/tools/console/plugins/plugin_package/helper/template/proj.win32/__PACKAGE_NAME__.vcxproj +++ b/tools/console/plugins/plugin_package/helper/template/proj.win32/__PACKAGE_NAME__.vcxproj @@ -53,7 +53,7 @@ NotUsing Level3 Disabled - WIN32;_WINDOWS;_DEBUG;_LIB;CC_USE_CURL=1;CC_LUA_ENGINE_ENABLED=1;%(PreprocessorDefinitions) + WIN32;_WINDOWS;_DEBUG;_LIB;AX_USE_CURL=1;AX_LUA_ENGINE_ENABLED=1;%(PreprocessorDefinitions) $(ProjectDir)..\..\..\frameworks\cocos2d-x\cocos;$(ProjectDir)..\..\..\frameworks\cocos2d-x\external;$(ProjectDir)..\..\..\frameworks\cocos2d-x\external\glfw3\include\win32;$(ProjectDir)..\..\..\frameworks\cocos2d-x\external\win32-specific\zlib\include;$(ProjectDir)..\..\..\frameworks\cocos2d-x\external\win32-specific\gles\include\OGLES/;$(ProjectDir)..\..\..\frameworks\cocos2d-x\external\curl\include\win32;$(ProjectDir)..\..\..\frameworks\cocos2d-x\extensions;%(AdditionalIncludeDirectories) true 4267;4251;4244;%(DisableSpecificWarnings) diff --git a/tools/tolua/axis_audioengine.ini b/tools/tolua/axis_audioengine.ini index 89dd473c44..ed7148f15d 100644 --- a/tools/tolua/axis_audioengine.ini +++ b/tools/tolua/axis_audioengine.ini @@ -7,7 +7,7 @@ prefix = axis_audioengine # all classes will be embedded in that namespace target_namespace = ax -macro_judgement = #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +macro_judgement = #if AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC || AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_LINUX android_headers = diff --git a/tools/tolua/axis_controller.ini b/tools/tolua/axis_controller.ini index eab34991ae..c877ea8663 100644 --- a/tools/tolua/axis_controller.ini +++ b/tools/tolua/axis_controller.ini @@ -7,7 +7,7 @@ prefix = axis_controller # all classes will be embedded in that namespace target_namespace = ax -macro_judgement = #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +macro_judgement = #if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS) android_headers = diff --git a/tools/tolua/axis_navmesh.ini b/tools/tolua/axis_navmesh.ini index 7392545e1e..01cb7345ae 100644 --- a/tools/tolua/axis_navmesh.ini +++ b/tools/tolua/axis_navmesh.ini @@ -7,14 +7,14 @@ prefix = axis_navmesh # all classes will be embedded in that namespace target_namespace = ax -macro_judgement = #if CC_USE_NAVMESH +macro_judgement = #if AX_USE_NAVMESH android_headers = android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -DANDROID -D__ANDROID_API__=14 -gcc-toolchain %(gcc_toolchain_dir)s --sysroot=%(androidndkdir)s/platforms/android-14/arch-arm -idirafter %(androidndkdir)s/sources/android/support/include -idirafter %(androidndkdir)s/sysroot/usr/include -idirafter %(androidndkdir)s/sysroot/usr/include/arm-linux-androideabi -idirafter %(clangllvmdir)s/lib64/clang/5.0/include -I%(androidndkdir)s/sources/cxx-stl/llvm-libc++/include clang_headers = -clang_flags = -nostdinc -x c++ -std=c++17 -fsigned-char -U__SSE__ -DCC_USE_NAVMESH +clang_flags = -nostdinc -x c++ -std=c++17 -fsigned-char -U__SSE__ -DAX__USE_NAVMESH win32_clang_flags = -U __SSE__ diff --git a/tools/tolua/axis_physics.ini b/tools/tolua/axis_physics.ini index 9671bcc6bd..6a2ef15dbd 100644 --- a/tools/tolua/axis_physics.ini +++ b/tools/tolua/axis_physics.ini @@ -7,7 +7,7 @@ prefix = axis_physics # all classes will be embedded in that namespace target_namespace = ax -macro_judgement = #if CC_USE_PHYSICS +macro_judgement = #if AX_USE_PHYSICS android_headers = diff --git a/tools/tolua/axis_physics3d.ini b/tools/tolua/axis_physics3d.ini index 705fc9188a..ab17daa633 100644 --- a/tools/tolua/axis_physics3d.ini +++ b/tools/tolua/axis_physics3d.ini @@ -7,14 +7,14 @@ prefix = axis_physics3d # all classes will be embedded in that namespace target_namespace = ax -macro_judgement = #if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION +macro_judgement = #if AX_USE_3D_PHYSICS && AX_ENABLE_BULLET_INTEGRATION android_headers = android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -DANDROID -D__ANDROID_API__=14 -gcc-toolchain %(gcc_toolchain_dir)s --sysroot=%(androidndkdir)s/platforms/android-14/arch-arm -idirafter %(androidndkdir)s/sources/android/support/include -idirafter %(androidndkdir)s/sysroot/usr/include -idirafter %(androidndkdir)s/sysroot/usr/include/arm-linux-androideabi -idirafter %(clangllvmdir)s/lib64/clang/5.0/include -I%(androidndkdir)s/sources/cxx-stl/llvm-libc++/include clang_headers = -clang_flags = -nostdinc -x c++ -std=c++17 -fsigned-char -U__SSE__ -DCC_ENABLE_BULLET_INTEGRATION +clang_flags = -nostdinc -x c++ -std=c++17 -fsigned-char -U__SSE__ -DAX__ENABLE_BULLET_INTEGRATION win32_clang_flags = -U __SSE__