From 055a6a22d1d1c0493cfb626ebd042536552e8072 Mon Sep 17 00:00:00 2001 From: Julius Trinkunas Date: Wed, 14 Aug 2024 20:44:56 +0300 Subject: [PATCH] Trim trailing whitespace for files in `core` folder --- core/2d/AutoPolygon.h | 6 +-- core/2d/Camera.cpp | 2 +- core/2d/Camera.h | 18 ++++----- core/2d/ClippingNode.cpp | 2 +- core/2d/ClippingNode.h | 2 +- core/2d/DrawNode.cpp | 2 +- core/2d/DrawNode.h | 4 +- core/2d/FastTMXLayer.cpp | 6 +-- core/2d/FastTMXTiledMap.cpp | 2 +- core/2d/Label.cpp | 4 +- core/2d/Label.h | 6 +-- core/2d/Node.cpp | 4 +- core/2d/Node.h | 4 +- core/2d/ParticleSystem.h | 10 ++--- core/2d/PlistSpriteSheetLoader.cpp | 4 +- core/2d/PlistSpriteSheetLoader.h | 2 +- core/2d/ProgressTimer.cpp | 12 +++--- core/2d/ProtectedNode.cpp | 2 +- core/2d/ProtectedNode.h | 2 +- core/2d/RenderTexture.cpp | 4 +- core/2d/Sprite.cpp | 2 +- core/2d/Sprite.h | 4 +- core/2d/SpriteBatchNode.h | 2 +- core/2d/SpriteFrame.cpp | 2 +- core/2d/TextFieldTTF.h | 2 +- core/2d/Transition.cpp | 40 +++++++++---------- core/2d/Transition.h | 8 ++-- core/3d/Animate3D.cpp | 2 +- core/3d/Animate3D.h | 2 +- core/3d/AnimationCurve.inl | 28 ++++++------- core/3d/Bundle3D.cpp | 4 +- core/3d/BundleReader.h | 2 +- core/3d/Mesh.cpp | 2 +- core/3d/MeshMaterial.cpp | 2 +- core/3d/MeshMaterial.h | 2 +- core/3d/MeshRenderer.h | 6 +-- core/3d/Terrain.cpp | 2 +- core/3d/VertexAttribBinding.cpp | 2 +- core/3d/VertexAttribBinding.h | 2 +- core/CMakeLists.txt | 10 ++--- core/audio/CMakeLists.txt | 4 +- core/base/Controller-android.cpp | 2 +- core/base/Controller-linux-win32.cpp | 2 +- core/base/Data.cpp | 2 +- core/base/Data.h | 2 +- core/base/Event.cpp | 2 +- core/base/EventDispatcher.cpp | 2 +- core/base/EventListener.h | 2 +- core/base/EventListenerAcceleration.cpp | 2 +- core/base/EventListenerAcceleration.h | 2 +- core/base/EventListenerFocus.cpp | 2 +- core/base/EventListenerFocus.h | 2 +- core/base/EventListenerTouch.cpp | 2 +- core/base/EventListenerTouch.h | 2 +- core/base/JobSystem.cpp | 2 +- core/base/Properties.h | 2 +- core/base/Random.h | 2 +- core/base/Vector.h | 2 +- core/base/base64.h | 2 +- core/math/Mat4.h | 2 +- core/math/Vec4.h | 6 +-- core/media/AvfMediaEngine.mm | 10 ++--- core/media/MfMediaEngine.cpp | 2 +- core/media/MfMediaEngine.h | 8 ++-- core/media/WmfMediaEngine.cpp | 2 +- core/navmesh/NavMeshDebugDraw.cpp | 14 +++---- core/network/CMakeLists.txt | 18 ++++----- core/network/Downloader-wasm.cpp | 10 ++--- core/network/Downloader-wasm.h | 6 +-- core/network/Downloader.h | 2 +- core/network/HttpClient-wasm.h | 24 +++++------ core/network/Uri.cpp | 2 +- core/network/WebSocket-wasm.cpp | 4 +- core/network/WebSocket-wasm.h | 4 +- core/physics/PhysicsWorld.cpp | 2 +- core/platform/Device.h | 2 +- core/platform/FileStream.h | 2 +- core/platform/GLView.h | 2 +- .../AndroidManifest.xml | 6 +-- core/platform/android/GLViewImpl-android.cpp | 2 +- .../platform/android/java/AndroidManifest.xml | 2 +- .../libaxmol-with-controller/build.gradle | 2 +- core/platform/ios/Device-ios.mm | 4 +- core/platform/ios/ES3Renderer-ios.m | 30 +++++++------- core/platform/linux/Device-linux.cpp | 2 +- core/platform/mac/Device-mac.mm | 2 +- core/platform/wasm/Application-wasm.h | 14 +++---- core/platform/wasm/Device-wasm.cpp | 18 ++++----- core/platform/wasm/shell_minimal.html | 8 ++-- core/platform/winrt/Application-winrt.h | 2 +- core/platform/winrt/FileUtilsWinRT.cpp | 2 +- core/platform/winrt/FileUtilsWinRT.h | 2 +- core/platform/winrt/GLViewImpl-winrt.cpp | 2 +- core/platform/winrt/InputEventTypes.h | 2 +- core/platform/winrt/WICImageLoader-winrt.cpp | 38 +++++++++--------- core/platform/winrt/WICImageLoader-winrt.h | 4 +- core/platform/winrt/WinRTUtils.cpp | 2 +- core/platform/winrt/xaml/AxmolRenderer.h | 4 +- core/platform/winrt/xaml/OpenGLES.cpp | 30 +++++++------- core/renderer/CMakeLists.txt | 8 ++-- core/renderer/CallbackCommand.h | 2 +- core/renderer/GroupCommand.h | 2 +- core/renderer/Material.cpp | 2 +- core/renderer/Material.h | 2 +- core/renderer/RenderCommand.cpp | 2 +- core/renderer/RenderCommand.h | 2 +- core/renderer/RenderState.cpp | 2 +- core/renderer/RenderState.h | 2 +- core/renderer/TextureAtlas.h | 2 +- core/renderer/TextureCache.cpp | 2 +- core/renderer/TextureCache.h | 4 +- core/renderer/TrianglesCommand.cpp | 2 +- core/renderer/TrianglesCommand.h | 2 +- core/renderer/backend/VertexLayout.cpp | 2 +- core/renderer/backend/VertexLayout.h | 2 +- .../renderer/backend/metal/CommandBufferMTL.h | 6 +-- core/renderer/backend/metal/DriverMTL.h | 4 +- core/renderer/backend/metal/DriverMTL.mm | 2 +- .../renderer/backend/metal/RenderTargetMTL.mm | 6 +-- core/renderer/backend/metal/ShaderModuleMTL.h | 4 +- .../renderer/backend/metal/ShaderModuleMTL.mm | 14 +++---- .../backend/opengl/CommandBufferGLES2.cpp | 4 +- .../backend/opengl/CommandBufferGLES2.h | 4 +- core/renderer/shaders/base.glsl | 2 +- core/renderer/shaders/colorTexture.frag | 2 +- core/renderer/shaders/dualSampler_hsv.frag | 12 +++--- core/renderer/shaders/hsv.frag | 8 ++-- core/renderer/shaders/particle.vert | 2 +- core/renderer/shaders/quadColor.vert | 2 +- core/renderer/shaders/quadTexture.vert | 2 +- core/renderer/shaders/videoTextureI420.frag | 4 +- core/renderer/shaders/videoTextureNV12.frag | 4 +- core/renderer/shaders/videoTextureYUY2.frag | 4 +- core/ui/CMakeLists.txt | 2 +- core/ui/UIEditBox/Mac/UIMultilineTextField.m | 10 ++--- core/ui/UIEditBox/Mac/UIPasswordTextField.m | 10 ++--- core/ui/UIEditBox/Mac/UISingleLineTextField.m | 16 ++++---- core/ui/UIEditBox/Mac/UITextFieldFormatter.m | 10 ++--- core/ui/UIEditBox/UIEditBox.cpp | 2 +- core/ui/UIEditBox/UIEditBox.h | 2 +- core/ui/UIEditBox/UIEditBoxImpl-android.h | 2 +- core/ui/UIEditBox/UIEditBoxImpl-common.cpp | 2 +- core/ui/UIEditBox/UIEditBoxImpl-common.h | 2 +- core/ui/UIEditBox/UIEditBoxImpl-ios.h | 2 +- core/ui/UIEditBox/UIEditBoxImpl-ios.mm | 2 +- core/ui/UIEditBox/UIEditBoxImpl-linux.cpp | 4 +- core/ui/UIEditBox/UIEditBoxImpl-linux.h | 2 +- core/ui/UIEditBox/UIEditBoxImpl-mac.h | 2 +- core/ui/UIEditBox/UIEditBoxImpl-mac.mm | 2 +- core/ui/UIEditBox/UIEditBoxImpl-stub.cpp | 2 +- core/ui/UIEditBox/UIEditBoxImpl-wasm.cpp | 6 +-- core/ui/UIEditBox/UIEditBoxImpl-wasm.h | 2 +- core/ui/UIEditBox/UIEditBoxImpl.h | 2 +- core/ui/UIHBox.h | 2 +- core/ui/UILayout.cpp | 2 +- core/ui/UILayoutManager.h | 2 +- core/ui/UILayoutParameter.cpp | 2 +- core/ui/UILayoutParameter.h | 2 +- core/ui/UIRelativeBox.cpp | 2 +- core/ui/UIScrollViewBar.cpp | 2 +- core/ui/UIVBox.cpp | 2 +- core/ui/UIVBox.h | 2 +- core/ui/UIWebView/UIWebView-inl.h | 2 +- core/ui/UIWebView/UIWebView.mm | 2 +- core/ui/UIWebView/UIWebViewImpl-android.h | 2 +- core/ui/UIWebView/UIWebViewImpl-ios.h | 2 +- core/ui/UIWebView/UIWebViewImpl-ios.mm | 2 +- core/ui/UIWebView/UIWebViewImpl-win32.h | 2 +- 168 files changed, 402 insertions(+), 402 deletions(-) diff --git a/core/2d/AutoPolygon.h b/core/2d/AutoPolygon.h index 3da971ce859e..92554a472dcd 100644 --- a/core/2d/AutoPolygon.h +++ b/core/2d/AutoPolygon.h @@ -256,9 +256,9 @@ class AX_DLL AutoPolygon * auto sp = Sprite::create(AutoPolygon::generatePolygon("grossini.png")); * @endcode */ - static PolygonInfo generatePolygon(std::string_view filename, - const Rect& rect = Rect::ZERO, - float epsilon = 2.0f, + static PolygonInfo generatePolygon(std::string_view filename, + const Rect& rect = Rect::ZERO, + float epsilon = 2.0f, float threshold = 0.05f); protected: diff --git a/core/2d/Camera.cpp b/core/2d/Camera.cpp index 5fca86e47276..9f0e0e4dac6d 100644 --- a/core/2d/Camera.cpp +++ b/core/2d/Camera.cpp @@ -217,7 +217,7 @@ void Camera::initDefault() } setDepth(0); - + if (_zoomFactor != 1.0F) applyZoom(); } diff --git a/core/2d/Camera.h b/core/2d/Camera.h index 98af754dfce5..e92b4ca8ec0d 100644 --- a/core/2d/Camera.h +++ b/core/2d/Camera.h @@ -224,14 +224,14 @@ class AX_DLL Camera : public Node /** * Gets the field of view of the camera if the projection mode is 3D. - * + * * @since axmol-1.0.0b8 */ float getFOV() const { return _fieldOfView; } /** * Sets the field of view of the camera if the projection mode is 3D. - * + * * @since axmol-1.0.0b8 */ void setFOV(float fov); @@ -243,7 +243,7 @@ class AX_DLL Camera : public Node /** * Sets the frustum's far plane. - * + * * @since axmol-1.0.0b8 */ void setFarPlane(float farPlane); @@ -255,14 +255,14 @@ class AX_DLL Camera : public Node /** * Gets the frustum's near plane. - * + * * @since axmol-1.0.0b8 */ void setNearPlane(float nearPlane); /** * Gets the zoom multiplier of the camera. - * + * * @since axmol-1.0.0b8 */ float getZoom() const { return _zoomFactor; } @@ -270,16 +270,16 @@ class AX_DLL Camera : public Node /** * Sets the zoom multiplier of the camera. * This is designed to be used with 2D views only. - * + * * @param factor The zoom factor of the camera. - * + * * @since axmol-1.0.0b8 */ void setZoom(float factor); /** Apply the zoom factor. - * + * * @since axmol-1.0.0b8 */ void applyZoom(); @@ -332,7 +332,7 @@ class AX_DLL Camera : public Node * WP8*/ void setAdditionalProjection(const Mat4& mat); - /** Init default camera with director current projection, + /** Init default camera with director current projection, !!!Note: Must invoke this function again when director projection or winsize changed */ void initDefault(); diff --git a/core/2d/ClippingNode.cpp b/core/2d/ClippingNode.cpp index b9f88e2967af..fafba772d398 100644 --- a/core/2d/ClippingNode.cpp +++ b/core/2d/ClippingNode.cpp @@ -235,7 +235,7 @@ void ClippingNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32 void ClippingNode::setGlobalZOrder(float globalZOrder) { Node::setGlobalZOrder(globalZOrder); - + if (_stencil) { // Make sure our stencil stays on the same globalZOrder: _stencil->setGlobalZOrder(globalZOrder); diff --git a/core/2d/ClippingNode.h b/core/2d/ClippingNode.h index bbab51690644..34aba1b364ea 100644 --- a/core/2d/ClippingNode.h +++ b/core/2d/ClippingNode.h @@ -138,7 +138,7 @@ class AX_DLL ClippingNode : public Node virtual void visit(Renderer* renderer, const Mat4& parentTransform, uint32_t parentFlags) override; virtual void setGlobalZOrder(float globalZOrder) override; - + virtual void setCameraMask(unsigned short mask, bool applyChildren = true) override; ClippingNode(); diff --git a/core/2d/DrawNode.cpp b/core/2d/DrawNode.cpp index 1ae188eb19ba..03fa54498522 100644 --- a/core/2d/DrawNode.cpp +++ b/core/2d/DrawNode.cpp @@ -214,7 +214,7 @@ void DrawNode::setVertexLayout(CustomCommand& cmd) } void DrawNode::freeShaderInternal(CustomCommand& cmd) -{ +{ auto& pipelinePS = cmd.getPipelineDescriptor().programState; AX_SAFE_RELEASE_NULL(pipelinePS); } diff --git a/core/2d/DrawNode.h b/core/2d/DrawNode.h index ead0417f3eef..4bf28e9ac7e6 100644 --- a/core/2d/DrawNode.h +++ b/core/2d/DrawNode.h @@ -152,7 +152,7 @@ class AX_DLL DrawNode : public Node float scaleX, float scaleY, const Color4B& color, - float threshold = 500); // 500 should "simulate/save" the backwards compatibility + float threshold = 500); // 500 should "simulate/save" the backwards compatibility /** Draws a circle given the center, radius and number of segments. * @@ -320,7 +320,7 @@ class AX_DLL DrawNode : public Node * @param scaleX The scale value in x. * @param scaleY The scale value in y. * @param color The solid circle color. - * @param DrawMode The draw mode + * @param DrawMode The draw mode * @js NA */ void drawPie(const Vec2& center, diff --git a/core/2d/FastTMXLayer.cpp b/core/2d/FastTMXLayer.cpp index 3d79ff26a569..53df2636e8f5 100644 --- a/core/2d/FastTMXLayer.cpp +++ b/core/2d/FastTMXLayer.cpp @@ -439,7 +439,7 @@ void FastTMXLayer::updatePrimitives() { auto command = new CustomCommand(); command->setVertexBuffer(_vertexBuffer); - + #ifdef AX_FAST_TILEMAP_32_BIT_INDICES CustomCommand::IndexFormat indexFormat = CustomCommand::IndexFormat::U_INT; #else @@ -906,11 +906,11 @@ void FastTMXLayer::setupTileSprite(Sprite* sprite, const Vec2& pos, uint32_t gid { auto tempPosAt = getPositionAt(pos); auto tempSpriteContentSize = sprite->getContentSize(); - + sprite->setPositionZ((float)getVertexZForPos(pos)); sprite->setOpacity(this->getOpacity()); - // fix issue #1283 too; put the anchor in the middle for ease of rotation. + // fix issue #1283 too; put the anchor in the middle for ease of rotation. sprite->setAnchorPoint(Vec2(0.5f, 0.5f)); sprite->setPosition(tempPosAt.x + std::roundf(tempSpriteContentSize.height / 2), tempPosAt.y + std::roundf(tempSpriteContentSize.width / 2)); diff --git a/core/2d/FastTMXTiledMap.cpp b/core/2d/FastTMXTiledMap.cpp index f6a51b15e9a0..2e5bfd65c302 100644 --- a/core/2d/FastTMXTiledMap.cpp +++ b/core/2d/FastTMXTiledMap.cpp @@ -5,7 +5,7 @@ Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/2d/Label.cpp b/core/2d/Label.cpp index 50b2dd77ae62..9ebd44160981 100644 --- a/core/2d/Label.cpp +++ b/core/2d/Label.cpp @@ -568,7 +568,7 @@ Label::~Label() AX_SAFE_RELEASE_NULL(_textSprite); AX_SAFE_RELEASE_NULL(_shadowNode); - + #if AX_LABEL_DEBUG_DRAW AX_SAFE_RELEASE_NULL(_debugDrawNode); #endif @@ -2106,7 +2106,7 @@ void Label::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t pare #if AX_LABEL_DEBUG_DRAW _debugDrawNode->visit(renderer, _modelViewTransform, parentFlags | FLAGS_TRANSFORM_DIRTY); #endif - + _director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); } diff --git a/core/2d/Label.h b/core/2d/Label.h index eff25f4a7a3d..0b2e8fac89b2 100644 --- a/core/2d/Label.h +++ b/core/2d/Label.h @@ -821,7 +821,7 @@ class AX_DLL Label : public Node, public LabelProtocol, public BlendProtocol void updateBuffer(TextureAtlas* textureAtlas, CustomCommand& customCommand); void updateBatchCommand(BatchCommand& batch); - + bool _contentDirty; bool _useDistanceField; bool _useA8Shader; @@ -881,7 +881,7 @@ class AX_DLL Label : public Node, public LabelProtocol, public BlendProtocol Color4B _textColor; BlendFunc _blendFunc; - + Vec2 _labelDimensions; Vec2 _shadowOffset; mutable Vec2 _scaledContentSize; // !SDF scale @@ -916,7 +916,7 @@ class AX_DLL Label : public Node, public LabelProtocol, public BlendProtocol std::vector _linesWidth; std::vector _linesOffsetX; - + QuadCommand _quadCommand; std::vector _batchCommands; diff --git a/core/2d/Node.cpp b/core/2d/Node.cpp index 2976a97357ef..5e35ff41a7f6 100644 --- a/core/2d/Node.cpp +++ b/core/2d/Node.cpp @@ -1005,13 +1005,13 @@ void Node::addChildHelper(Node* child, int localZOrder, int tag, std::string_vie this->insertChild(child, localZOrder); child->setParent(this); - + if (_childFollowCameraMask) { child->setCameraMask(this->getCameraMask()); child->applyMaskOnEnter(true); } - + if (setTag) { child->setTag(tag); diff --git a/core/2d/Node.h b/core/2d/Node.h index 5b012263c48a..78a2a0aa41ef 100644 --- a/core/2d/Node.h +++ b/core/2d/Node.h @@ -1827,7 +1827,7 @@ class AX_DLL Node : public Object * @param applyChildren A boolean value to determine whether the mask bit should apply to its children or not. */ void applyMaskOnEnter(bool applyChildren); - + virtual void setProgramState(uint32_t programType) { setProgramStateWithRegistry(programType, nullptr); } void setProgramStateWithRegistry(uint32_t programType, Texture2D* texture); @@ -1998,7 +1998,7 @@ class AX_DLL Node : public Object bool _usingNormalizedPosition; bool _normalizedPositionDirty; - + bool _childFollowCameraMask; // camera mask, it is visible only when _cameraMask & current camera' camera flag is true unsigned short _cameraMask; diff --git a/core/2d/ParticleSystem.h b/core/2d/ParticleSystem.h index 7cd4924494eb..7b74cbd776d4 100644 --- a/core/2d/ParticleSystem.h +++ b/core/2d/ParticleSystem.h @@ -1214,7 +1214,7 @@ class AX_DLL ParticleSystem : public Node, public TextureProtocol, public Playab /** Adds an emission shape to the system. * The index is automatically incremented on each addition. - * + * * @param shape Shape descriptor object. */ void addEmissionShape(EmissionShape shape); @@ -1227,7 +1227,7 @@ class AX_DLL ParticleSystem : public Node, public TextureProtocol, public Playab /** Adds an emission shape of type mask to the system. * The mask should be added using the ParticleEmissionMaskCache class. - * + * * @param maskId The id of the mask, FOURCC starts with '#', such as "#abcd" * @param pos Position of the emission shape in local space. * @param overrideSize Size of the emission mask in pixels, leave ZERO to use texture size. @@ -1240,18 +1240,18 @@ class AX_DLL ParticleSystem : public Node, public TextureProtocol, public Playab Vec2 scale = Vec2::ONE, float angle = 0.0F); - /** Adds an emission shape of type point to the system. + /** Adds an emission shape of type point to the system. * @param pos Position of the emission shape in local space. */ static EmissionShape createPointShape(Vec2 pos); - /** Adds an emission shape of type Rectangle to the system. + /** Adds an emission shape of type Rectangle to the system. * @param pos Position of the emission shape in local space. * @param size Size of the rectangle. */ static EmissionShape createRectShape(Vec2 pos, Size size); - /** Adds an emission shape of type Rectangular Torus to the system. + /** Adds an emission shape of type Rectangular Torus to the system. * @param pos Position of the emission shape in local space. * @param innerSize Inner size offset of the rectangle. * @param outerSize Outer size of the rectangle. diff --git a/core/2d/PlistSpriteSheetLoader.cpp b/core/2d/PlistSpriteSheetLoader.cpp index 79376613f22f..0a7b3a43dd41 100644 --- a/core/2d/PlistSpriteSheetLoader.cpp +++ b/core/2d/PlistSpriteSheetLoader.cpp @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ - + #include "2d/PlistSpriteSheetLoader.h" #include "platform/FileUtils.h" diff --git a/core/2d/PlistSpriteSheetLoader.h b/core/2d/PlistSpriteSheetLoader.h index 9b6d37c0fe1c..e0db341c9b7d 100644 --- a/core/2d/PlistSpriteSheetLoader.h +++ b/core/2d/PlistSpriteSheetLoader.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/2d/ProgressTimer.cpp b/core/2d/ProgressTimer.cpp index 9e7764f390be..d807e0c180a5 100644 --- a/core/2d/ProgressTimer.cpp +++ b/core/2d/ProgressTimer.cpp @@ -232,15 +232,15 @@ void ProgressTimer::updateDisplayedOpacity(uint8_t parentOpacity) Node::updateDisplayedOpacity(parentOpacity); _displayedOpacity = _realOpacity * parentOpacity / 0xFF; - + _sprite->setOpacity(_displayedOpacity); updateColor(); updateProgress(); - + if (_cascadeOpacityEnabled) { _sprite->updateDisplayedOpacity(_displayedOpacity); - + for(const auto& child : _children) { child->updateDisplayedOpacity(_displayedOpacity); @@ -306,10 +306,10 @@ const Color3B& ProgressTimer::getColor() const void ProgressTimer::setOpacity(uint8_t opacity) { _displayedOpacity = _realOpacity = opacity; - + _sprite->setOpacity(_displayedOpacity); updateColor(); - + updateCascadeOpacity(); } @@ -622,7 +622,7 @@ Vec2 ProgressTimer::boundaryTexCoord(char index) return Vec2((kProgressTextureCoords >> ((index << 1) + 1)) & 1, (kProgressTextureCoords >> (index << 1)) & 1); } - + return Vec2::ZERO; } diff --git a/core/2d/ProtectedNode.cpp b/core/2d/ProtectedNode.cpp index 8b7af293f2ab..2a94684fa853 100644 --- a/core/2d/ProtectedNode.cpp +++ b/core/2d/ProtectedNode.cpp @@ -6,7 +6,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/2d/ProtectedNode.h b/core/2d/ProtectedNode.h index 8401fcee04a7..940612902b02 100644 --- a/core/2d/ProtectedNode.h +++ b/core/2d/ProtectedNode.h @@ -6,7 +6,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/2d/RenderTexture.cpp b/core/2d/RenderTexture.cpp index 8d0f6665622b..cb439cfdfefa 100644 --- a/core/2d/RenderTexture.cpp +++ b/core/2d/RenderTexture.cpp @@ -210,7 +210,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, _renderTarget = backend::DriverBase::getInstance()->newRenderTarget( _texture2D ? _texture2D->getBackendTexture() : nullptr, _depthStencilTexture ? _depthStencilTexture->getBackendTexture() : nullptr, - _depthStencilTexture ? _depthStencilTexture->getBackendTexture() : nullptr); + _depthStencilTexture ? _depthStencilTexture->getBackendTexture() : nullptr); } _renderTarget->setColorAttachment(_texture2D ? _texture2D->getBackendTexture() : nullptr); @@ -494,7 +494,7 @@ void RenderTexture::onSaveToFile(std::string filename, bool isRGBA, bool forceNo if (_saveFileCallback) { _saveFileCallback(this, _filename); - } + } } }; newImage(callbackFunc); diff --git a/core/2d/Sprite.cpp b/core/2d/Sprite.cpp index 03b40b3b4df3..9e51ca90c2d9 100644 --- a/core/2d/Sprite.cpp +++ b/core/2d/Sprite.cpp @@ -327,7 +327,7 @@ bool Sprite::initWithImageData(const Data& imageData, std::string_view key) //_fileName = filename; Texture2D *texture = _director->getTextureCache()->addImage(imageData, key); - + if (texture) { Rect rect = Rect::ZERO; diff --git a/core/2d/Sprite.h b/core/2d/Sprite.h index 8d464ae58569..01c3f88738ed 100644 --- a/core/2d/Sprite.h +++ b/core/2d/Sprite.h @@ -161,7 +161,7 @@ class AX_DLL Sprite : public Node, public TextureProtocol * @return An autoreleased sprite object. */ static Sprite* create(const ax::Data& imageData, std::string_view key); - + /** * Creates a sprite with a Texture2D object. * @@ -627,7 +627,7 @@ class AX_DLL Sprite : public Node, public TextureProtocol * @lua init */ virtual bool initWithFile(std::string_view filename, const Rect& rect); - + /** * Initializes a sprite with an image data, and a key for the cache. * diff --git a/core/2d/SpriteBatchNode.h b/core/2d/SpriteBatchNode.h index 3c6a88c58558..154ddf979013 100644 --- a/core/2d/SpriteBatchNode.h +++ b/core/2d/SpriteBatchNode.h @@ -6,7 +6,7 @@ Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/2d/SpriteFrame.cpp b/core/2d/SpriteFrame.cpp index 2f1cea04b257..96f309359b8a 100644 --- a/core/2d/SpriteFrame.cpp +++ b/core/2d/SpriteFrame.cpp @@ -5,7 +5,7 @@ Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/2d/TextFieldTTF.h b/core/2d/TextFieldTTF.h index 7afbfdc8e40e..fcedc84da646 100644 --- a/core/2d/TextFieldTTF.h +++ b/core/2d/TextFieldTTF.h @@ -39,7 +39,7 @@ NS_AX_BEGIN class TextFieldTTF; /** - * A input protocol for TextField. + * A input protocol for TextField. * !!!DEPRECATED since axmol-2.1.3 */ class AX_DLL TextFieldDelegate diff --git a/core/2d/Transition.cpp b/core/2d/Transition.cpp index b3378183208f..c47cfc9ae2cf 100644 --- a/core/2d/Transition.cpp +++ b/core/2d/Transition.cpp @@ -135,7 +135,7 @@ void TransitionScene::setWaitForFinishCount(int count) void TransitionScene::finish() { _waitForFinishCount--; - + if(_waitForFinishCount == 0) { // clean up @@ -144,13 +144,13 @@ void TransitionScene::finish() _inScene->setScale(1.0f); _inScene->setRotation(0.0f); _inScene->setAdditionalTransform(nullptr); - + _outScene->setVisible(false); _outScene->setPosition(0, 0); _outScene->setScale(1.0f); _outScene->setRotation(0.0f); _outScene->setAdditionalTransform(nullptr); - + //[self schedule:@selector(setNewScene:) interval:0]; this->schedule(AX_SCHEDULE_SELECTOR(TransitionScene::setNewScene), 0); } @@ -186,7 +186,7 @@ void TransitionScene::hideOutShowIn() void TransitionScene::onEnter() { Scene::onEnter(); - + // disable events while transitions _eventDispatcher->setEnabled(false); @@ -278,9 +278,9 @@ void TransitionRotoZoom::onEnter() _inScene->setAnchorPoint(Vec2(0.5f, 0.5f)); _outScene->setAnchorPoint(Vec2(0.5f, 0.5f)); - + setWaitForFinishCount(2); - + auto rotozoom = Sequence::create( Spawn::create(ScaleBy::create(_duration / 2, 0.001f), RotateBy::create(_duration / 2, 360 * 2), nullptr), DelayTime::create(_duration / 2), nullptr); @@ -320,7 +320,7 @@ void TransitionJumpZoom::onEnter() _outScene->setAnchorPoint(Vec2(0.5f, 0.5f)); setWaitForFinishCount(2); - + ActionInterval* jump = JumpBy::create(_duration / 4, Vec2(-s.width, 0.0f), s.width / 4, 2); ActionInterval* scaleIn = ScaleTo::create(_duration / 4, 1.0f); ActionInterval* scaleOut = ScaleTo::create(_duration / 4, 0.5f); @@ -329,7 +329,7 @@ void TransitionJumpZoom::onEnter() auto jumpZoomIn = Sequence::create(jump, scaleIn, nullptr); ActionInterval* delay = DelayTime::create(_duration / 2); - + _outScene->runAction( Sequence::create(jumpZoomOut, CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); _inScene->runAction( @@ -474,15 +474,15 @@ void TransitionSlideInL::onEnter() this->initScenes(); setWaitForFinishCount(2); - + ActionInterval* in = this->action(); ActionInterval* out = this->action(); - + ActionInterval* inAction = Sequence::create(easeActionWithAction(in), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); ActionInterval* outAction = Sequence::create( easeActionWithAction(out), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); - + _inScene->runAction(inAction); _outScene->runAction(outAction); } @@ -655,10 +655,10 @@ void TransitionShrinkGrow::onEnter() _outScene->setAnchorPoint(Vec2(1 / 3.0f, 0.5f)); setWaitForFinishCount(2); - + ActionInterval* scaleOut = ScaleTo::create(_duration, 0.01f); ActionInterval* scaleIn = ScaleTo::create(_duration, 1.0f); - + _inScene->runAction(Sequence::create(this->easeActionWithAction(scaleIn), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr)); _outScene->runAction(Sequence::create(this->easeActionWithAction(scaleOut), @@ -683,7 +683,7 @@ void TransitionFlipX::onEnter() _inScene->setVisible(false); setWaitForFinishCount(2); - + float inDeltaZ, inAngleZ; float outDeltaZ, outAngleZ; @@ -701,7 +701,7 @@ void TransitionFlipX::onEnter() outDeltaZ = -90; outAngleZ = 0; } - + auto inA = Sequence::create(DelayTime::create(_duration / 2), Show::create(), OrbitCamera::create(_duration / 2, 1, 0, inAngleZ, inDeltaZ, 0, 0), CallFunc::create(AX_CALLBACK_0(TransitionScene::finish, this)), nullptr); @@ -741,7 +741,7 @@ void TransitionFlipY::onEnter() _inScene->setVisible(false); setWaitForFinishCount(2); - + float inDeltaZ, inAngleZ; float outDeltaZ, outAngleZ; @@ -799,7 +799,7 @@ void TransitionFlipAngular::onEnter() _inScene->setVisible(false); setWaitForFinishCount(2); - + float inDeltaZ, inAngleZ; float outDeltaZ, outAngleZ; @@ -856,7 +856,7 @@ void TransitionZoomFlipX::onEnter() _inScene->setVisible(false); setWaitForFinishCount(2); - + float inDeltaZ, inAngleZ; float outDeltaZ, outAngleZ; @@ -916,7 +916,7 @@ void TransitionZoomFlipY::onEnter() _inScene->setVisible(false); setWaitForFinishCount(2); - + float inDeltaZ, inAngleZ; float outDeltaZ, outAngleZ; @@ -977,7 +977,7 @@ void TransitionZoomFlipAngular::onEnter() _inScene->setVisible(false); setWaitForFinishCount(2); - + float inDeltaZ, inAngleZ; float outDeltaZ, outAngleZ; diff --git a/core/2d/Transition.h b/core/2d/Transition.h index df4ace1884b4..8aab96b606bd 100644 --- a/core/2d/Transition.h +++ b/core/2d/Transition.h @@ -122,7 +122,7 @@ class AX_DLL TransitionScene : public Scene protected: virtual void sceneOrder(); void setNewScene(float dt); - + /** Set the number of actions to be done to finish */ void setWaitForFinishCount(int count); @@ -132,11 +132,11 @@ class AX_DLL TransitionScene : public Scene float _duration; bool _isInSceneOnTop; bool _isSendCleanupToScene; - - + + private: AX_DISALLOW_COPY_AND_ASSIGN(TransitionScene); - + int _waitForFinishCount = 1; }; diff --git a/core/3d/Animate3D.cpp b/core/3d/Animate3D.cpp index 58887e2bb212..2ee7ba9cfc10 100644 --- a/core/3d/Animate3D.cpp +++ b/core/3d/Animate3D.cpp @@ -2,7 +2,7 @@ Copyright (c) 2014-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/3d/Animate3D.h b/core/3d/Animate3D.h index 94dd8afa06a7..2152fef9b94f 100644 --- a/core/3d/Animate3D.h +++ b/core/3d/Animate3D.h @@ -2,7 +2,7 @@ Copyright (c) 2014-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/3d/AnimationCurve.inl b/core/3d/AnimationCurve.inl index d495e9673188..84d87e3f6166 100644 --- a/core/3d/AnimationCurve.inl +++ b/core/3d/AnimationCurve.inl @@ -14,15 +14,15 @@ void AnimationCurve::evaluate(float time, float* dst, EvaluateTyp memcpy(dst, &_value[(_count - 1) * componentSize], _componentSizeByte); return; } - + unsigned int index = determineIndex(time); - + float scale = (_keytime[index + 1] - _keytime[index]); float t = (time - _keytime[index]) / scale; - + float* fromValue = &_value[index * componentSize]; float* toValue = fromValue + componentSize; - + switch (type) { case EvaluateType::INT_LINEAR: { @@ -45,7 +45,7 @@ void AnimationCurve::evaluate(float time, float* dst, EvaluateTyp Quaternion::slerp(Quaternion(fromValue), Quaternion(toValue), t, &quat); else Quaternion::slerp(Quaternion(toValue), Quaternion(fromValue), t, &quat); - + dst[0] = quat.x; dst[1] = quat.y; dst[2] = quat.z; @@ -58,7 +58,7 @@ void AnimationCurve::evaluate(float time, float* dst, EvaluateTyp _evaluateFun(time, dst); } break; - + default: break; } @@ -78,15 +78,15 @@ AnimationCurve* AnimationCurve::create(float* keyt AnimationCurve* curve = new AnimationCurve(); curve->_keytime = new float[count]; memcpy(curve->_keytime, keytime, count * floatSize); - + int compoentSizeByte = componentSize * floatSize; int totalByte = count * compoentSizeByte; curve->_value = new float[totalByte / floatSize]; memcpy(curve->_value, value, totalByte); - + curve->_count = count; curve->_componentSizeByte = compoentSizeByte; - + curve->autorelease(); return curve; } @@ -112,7 +112,7 @@ AnimationCurve::AnimationCurve() , _componentSizeByte(0) , _evaluateFun(nullptr) { - + } template AnimationCurve::~AnimationCurve() @@ -127,11 +127,11 @@ int AnimationCurve::determineIndex(float time) const unsigned int min = 0; unsigned int max = _count - 1; unsigned int mid = 0; - + do { mid = (min + max) >> 1; - + if (time >= _keytime[mid] && time <= _keytime[mid + 1]) return mid; else if (time < _keytime[mid]) @@ -139,9 +139,9 @@ int AnimationCurve::determineIndex(float time) const else min = mid + 1; } while (min <= max); - + // We should never hit this! return -1; } -NS_AX_END \ No newline at end of file +NS_AX_END diff --git a/core/3d/Bundle3D.cpp b/core/3d/Bundle3D.cpp index b2c6afe89714..b31b7975039e 100644 --- a/core/3d/Bundle3D.cpp +++ b/core/3d/Bundle3D.cpp @@ -474,7 +474,7 @@ bool Bundle3D::loadMeshDatasBinary(MeshDatas& meshdatas) { AXLOGW("warning: Failed to read meshdata: aabb '{}'.", _path); goto FAILED; - } + } meshData->subMeshAABB.emplace_back(AABB(Vec3(aabb[0], aabb[1], aabb[2]), Vec3(aabb[3], aabb[4], aabb[5]))); } else @@ -2329,7 +2329,7 @@ ax::AABB Bundle3D::calculateAABB(const std::vector& vertex, indices.for_each ([&](uint32_t i) { Vec3 point(vertex[i * stride], vertex[i * stride + 1], vertex[i * stride + 2]); - aabb.updateMinMax(&point, 1); + aabb.updateMinMax(&point, 1); }); return aabb; diff --git a/core/3d/BundleReader.h b/core/3d/BundleReader.h index 90cb2be61493..f7b00a4c2420 100644 --- a/core/3d/BundleReader.h +++ b/core/3d/BundleReader.h @@ -2,7 +2,7 @@ Copyright (c) 2014-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/3d/Mesh.cpp b/core/3d/Mesh.cpp index 53160ccc4fc2..07c1bd027946 100644 --- a/core/3d/Mesh.cpp +++ b/core/3d/Mesh.cpp @@ -199,7 +199,7 @@ Mesh* Mesh::create(const std::vector& positions, int perVertexSizeInFloat = 0; std::vector vertices; std::vector attribs; - + MeshVertexAttrib att; att.type = backend::VertexFormat::FLOAT3; diff --git a/core/3d/MeshMaterial.cpp b/core/3d/MeshMaterial.cpp index 3b0db87511af..79541d7f45db 100644 --- a/core/3d/MeshMaterial.cpp +++ b/core/3d/MeshMaterial.cpp @@ -2,7 +2,7 @@ Copyright (c) 2014-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/3d/MeshMaterial.h b/core/3d/MeshMaterial.h index 3a22411ad900..c9f171918e4d 100644 --- a/core/3d/MeshMaterial.h +++ b/core/3d/MeshMaterial.h @@ -2,7 +2,7 @@ Copyright (c) 2014-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/3d/MeshRenderer.h b/core/3d/MeshRenderer.h index 134bd6744a9d..9e04e278cb21 100644 --- a/core/3d/MeshRenderer.h +++ b/core/3d/MeshRenderer.h @@ -154,7 +154,7 @@ class AX_DLL MeshRenderer : public Node, public BlendProtocol * This node becomes the action's target. Refer to Action::getTarget() * @warning Actions don't retain their target. * - * @return a pointer to Action + * @return a pointer to Action */ virtual Action* runAction(Action* action) override; @@ -196,13 +196,13 @@ class AX_DLL MeshRenderer : public Node, public BlendProtocol /** Adds a new material to a particular mesh in this mesh renderer. * if meshIndex == -1, then it will be applied to all the meshes that belong to this mesh renderer. - * + * * @param meshIndex Index of the mesh to apply the material to. */ void setMaterial(Material* material, int meshIndex); /** Gets the material of a specific mesh in this mesh renderer. - * + * * @param meshIndex Index of the mesh to get the material from. 0 is the default index. */ Material* getMaterial(int meshIndex = 0) const; diff --git a/core/3d/Terrain.cpp b/core/3d/Terrain.cpp index c55b140efeb1..6d39d9deb211 100644 --- a/core/3d/Terrain.cpp +++ b/core/3d/Terrain.cpp @@ -2,7 +2,7 @@ Copyright (c) 2015-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/3d/VertexAttribBinding.cpp b/core/3d/VertexAttribBinding.cpp index f4c92656d788..807f4f6dbab2 100644 --- a/core/3d/VertexAttribBinding.cpp +++ b/core/3d/VertexAttribBinding.cpp @@ -3,7 +3,7 @@ Copyright (c) 2015-2017 Chukong Technologies Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/core/3d/VertexAttribBinding.h b/core/3d/VertexAttribBinding.h index d1858fe60503..c08aa76d336d 100644 --- a/core/3d/VertexAttribBinding.h +++ b/core/3d/VertexAttribBinding.h @@ -3,7 +3,7 @@ Copyright (c) 2015-2017 Chukong Technologies Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 7defad5ae35c..478c181a9911 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -3,7 +3,7 @@ # Copyright (c) 2014 martell malone # Copyright (c) 2015-2017 Chukong Technologies Inc. # Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). -# +# # https://axmol.dev/ # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -178,7 +178,7 @@ configure_file( "${CMAKE_CURRENT_LIST_DIR}/axmolver.h.in" "${CMAKE_CURRENT_LIST_DIR}/axmolver.h" @ONLY) -# early experimental features +# early experimental features # include(CMakeDependentOption) # cmake_dependent_option(AX_ENABLE_EARLY_FEATURES # "Build the tests when we are the root project" ON @@ -359,16 +359,16 @@ if(XCODE OR VS) endif() message("CMake ${_AX_CORE_LIB} target_precompile_headers") -target_precompile_headers(${_AX_CORE_LIB} PRIVATE +target_precompile_headers(${_AX_CORE_LIB} PRIVATE "$<$:axmol.h>" ) if(WINDOWS) # cppwinrt or webview2 require nuget if(WINDOWS_STORE OR AX_ENABLE_MSEDGE_WEBVIEW2) - find_program(NUGET_EXE NAMES nuget + find_program(NUGET_EXE NAMES nuget PATHS ${_AX_ROOT}/tools/external/nuget) - + if(NOT NUGET_EXE) message("NUGET.EXE not found.") message(FATAL_ERROR "Please run setup.ps1 again to download NUGET.EXE, and run CMake again.") diff --git a/core/audio/CMakeLists.txt b/core/audio/CMakeLists.txt index 627a93396ad6..1003dca1ed06 100644 --- a/core/audio/CMakeLists.txt +++ b/core/audio/CMakeLists.txt @@ -11,7 +11,7 @@ set(_AX_AUDIO_HEADER audio/AudioCache.h audio/AudioEngineImpl.h ) - + set(_AX_AUDIO_SRC audio/AudioEngine.cpp audio/AudioDecoderManager.cpp @@ -24,7 +24,7 @@ set(_AX_AUDIO_SRC if(APPLE) set_source_files_properties(audio/AudioEngineImpl.cpp PROPERTIES LANGUAGE OBJCXX) - + set(_AX_AUDIO_HEADER ${_AX_AUDIO_HEADER} audio/AudioDecoderEXT.h) set(_AX_AUDIO_SRC ${_AX_AUDIO_SRC} diff --git a/core/base/Controller-android.cpp b/core/base/Controller-android.cpp index eb04093cd8db..4070801ae4eb 100644 --- a/core/base/Controller-android.cpp +++ b/core/base/Controller-android.cpp @@ -3,7 +3,7 @@ Copyright (c) 2014-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/Controller-linux-win32.cpp b/core/base/Controller-linux-win32.cpp index 6bf50f8875a6..61091d1c9d80 100644 --- a/core/base/Controller-linux-win32.cpp +++ b/core/base/Controller-linux-win32.cpp @@ -4,7 +4,7 @@ Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2017 Wilson E. Alvarez Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/Data.cpp b/core/base/Data.cpp index 1dc3cbc900bd..70a5f7a34113 100644 --- a/core/base/Data.cpp +++ b/core/base/Data.cpp @@ -3,7 +3,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/Data.h b/core/base/Data.h index edb347c54b4f..49cd801b1dc2 100644 --- a/core/base/Data.h +++ b/core/base/Data.h @@ -3,7 +3,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/Event.cpp b/core/base/Event.cpp index e9a5b068f178..39eb886ffbff 100644 --- a/core/base/Event.cpp +++ b/core/base/Event.cpp @@ -2,7 +2,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/EventDispatcher.cpp b/core/base/EventDispatcher.cpp index 23c887c57d2b..660cb6fafa9e 100644 --- a/core/base/EventDispatcher.cpp +++ b/core/base/EventDispatcher.cpp @@ -2,7 +2,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/EventListener.h b/core/base/EventListener.h index 9034a673d88a..71859a7c0516 100644 --- a/core/base/EventListener.h +++ b/core/base/EventListener.h @@ -2,7 +2,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/EventListenerAcceleration.cpp b/core/base/EventListenerAcceleration.cpp index 34bb8fa7e8df..fd24dc01f3cd 100644 --- a/core/base/EventListenerAcceleration.cpp +++ b/core/base/EventListenerAcceleration.cpp @@ -2,7 +2,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/EventListenerAcceleration.h b/core/base/EventListenerAcceleration.h index 34d5ef6d90f7..850b652c3aad 100644 --- a/core/base/EventListenerAcceleration.h +++ b/core/base/EventListenerAcceleration.h @@ -2,7 +2,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/EventListenerFocus.cpp b/core/base/EventListenerFocus.cpp index 7e3b6d1a503a..2289af47a9bb 100644 --- a/core/base/EventListenerFocus.cpp +++ b/core/base/EventListenerFocus.cpp @@ -3,7 +3,7 @@ Copyright (c) 2014-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/EventListenerFocus.h b/core/base/EventListenerFocus.h index f9ce696f012b..3f6691e37575 100644 --- a/core/base/EventListenerFocus.h +++ b/core/base/EventListenerFocus.h @@ -3,7 +3,7 @@ Copyright (c) 2014-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/EventListenerTouch.cpp b/core/base/EventListenerTouch.cpp index 9ff6afaf373d..016438314ba1 100644 --- a/core/base/EventListenerTouch.cpp +++ b/core/base/EventListenerTouch.cpp @@ -2,7 +2,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/EventListenerTouch.h b/core/base/EventListenerTouch.h index 683922afaf6c..30313128a819 100644 --- a/core/base/EventListenerTouch.h +++ b/core/base/EventListenerTouch.h @@ -2,7 +2,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/JobSystem.cpp b/core/base/JobSystem.cpp index f517de0d2452..f4783b4cee0d 100644 --- a/core/base/JobSystem.cpp +++ b/core/base/JobSystem.cpp @@ -1,7 +1,7 @@ /**************************************************************************** Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/base/Properties.h b/core/base/Properties.h index 10aced0b55af..538a38ec428f 100644 --- a/core/base/Properties.h +++ b/core/base/Properties.h @@ -3,7 +3,7 @@ Copyright (c) 2015-2017 Chukong Technologies Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/core/base/Random.h b/core/base/Random.h index 6f5237be2fa6..223fecf57b81 100644 --- a/core/base/Random.h +++ b/core/base/Random.h @@ -42,7 +42,7 @@ NS_AX_BEGIN /** * @class RandomHelper - * @brief A helper class for creating device dependent random number + * @brief A helper class for creating device dependent random number * @remark * Random Generator: std::mt19937 32bit */ diff --git a/core/base/Vector.h b/core/base/Vector.h index 22c020fb04b1..15e7cba1afee 100644 --- a/core/base/Vector.h +++ b/core/base/Vector.h @@ -247,7 +247,7 @@ class Vector T operator[](ssize_t index) const { - return this->at(index); + return this->at(index); } /** Returns the first element in the Vector. */ diff --git a/core/base/base64.h b/core/base/base64.h index 9d2bb2cc4ae7..e16a1bf1bfba 100644 --- a/core/base/base64.h +++ b/core/base/base64.h @@ -43,7 +43,7 @@ decoded_size(std::size_t n) /** Encode a series of octets as a padded, base64 string. The resulting string will not be null terminated. - + @par Requires The memory pointed to by `out` points to valid memory diff --git a/core/math/Mat4.h b/core/math/Mat4.h index 613648901699..ab0ae3ad7106 100644 --- a/core/math/Mat4.h +++ b/core/math/Mat4.h @@ -3,7 +3,7 @@ Copyright (c) 2014-2017 Chukong Technologies Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/core/math/Vec4.h b/core/math/Vec4.h index c16d0edb65fd..db5ff385f924 100644 --- a/core/math/Vec4.h +++ b/core/math/Vec4.h @@ -125,7 +125,7 @@ class Vec4Base this->x = xx; this->y = yy; this->z = zz; - this->w = ww; + this->w = ww; } /** @@ -140,7 +140,7 @@ class Vec4Base this->x = array[0]; this->y = array[1]; this->z = array[2]; - this->w = array[3]; + this->w = array[3]; } /** @@ -153,7 +153,7 @@ class Vec4Base this->x = v.x; this->y = v.y; this->z = v.z; - this->w = v.w; + this->w = v.w; } inline impl_type& operator-() { return impl_type{*static_cast(this)}.negate(); } diff --git a/core/media/AvfMediaEngine.mm b/core/media/AvfMediaEngine.mm index 4b5d75a9902b..53bef91dbed0 100644 --- a/core/media/AvfMediaEngine.mm +++ b/core/media/AvfMediaEngine.mm @@ -63,7 +63,7 @@ - (AVMediaSessionHandler*)initWithMediaEngine:(AvfMediaEngine*)me { #if TARGET_OS_IPHONE auto nc = [NSNotificationCenter defaultCenter]; - + [nc addObserver:self selector:@selector(handleAudioRouteChange:) name:AVAudioSessionRouteChangeNotification @@ -170,7 +170,7 @@ - (void)observeValueForKeyPath:(NSString*)keyPath _playbackEnded = true; _state = MEMediaState::Stopped; fireMediaEvent(MEMediaEventType::Stopped); - + if (_repeatEnabled) { this->setCurrentTime(0); this->play(); @@ -297,11 +297,11 @@ - (void)observeValueForKeyPath:(NSString*)keyPath NSString* mediaType = assetTrack.mediaType; if ([mediaType isEqualToString:AVMediaTypeVideo]) { // we only care about video - + auto naturalSize = [assetTrack naturalSize]; _videoExtent.x = naturalSize.width; _videoExtent.y = naturalSize.height; - + NSMutableDictionary* outputAttrs = [NSMutableDictionary dictionary]; CMFormatDescriptionRef DescRef = (CMFormatDescriptionRef)[assetTrack.formatDescriptions objectAtIndex:0]; CMVideoCodecType codecType = CMFormatDescriptionGetMediaSubType(DescRef); @@ -487,7 +487,7 @@ - (void)observeValueForKeyPath:(NSString*)keyPath if (CMTIME_IS_VALID(currTime)) return CMTimeGetSeconds(currTime); } - + return 0.0; } diff --git a/core/media/MfMediaEngine.cpp b/core/media/MfMediaEngine.cpp index 0b0b3b33316f..968f2635f773 100644 --- a/core/media/MfMediaEngine.cpp +++ b/core/media/MfMediaEngine.cpp @@ -4,7 +4,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). -// +// // https://axmol.dev/ //------------------------------------------------------------------------------------- diff --git a/core/media/MfMediaEngine.h b/core/media/MfMediaEngine.h index de83f3282ebf..eb84585e4c0e 100644 --- a/core/media/MfMediaEngine.h +++ b/core/media/MfMediaEngine.h @@ -6,7 +6,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). -// +// // https://axmol.dev/ //------------------------------------------------------------------------------------- @@ -54,7 +54,7 @@ class MfMediaEngine : public IMFNotify, public MediaEngine public: MfMediaEngine() noexcept; ~MfMediaEngine(); - + MfMediaEngine(const MfMediaEngine&) = delete; MfMediaEngine& operator=(const MfMediaEngine&) = delete; @@ -80,7 +80,7 @@ class MfMediaEngine : public IMFNotify, public MediaEngine bool open(std::string_view sourceUri) override; bool close() override; - + bool setLoop(bool bLoop) override; bool setRate(double fRate) override; @@ -133,7 +133,7 @@ struct MfMediaEngineFactory : public MediaEngineFactory { engine->Initialize(); return engine; } - void destroyMediaEngine(MediaEngine* me) override + void destroyMediaEngine(MediaEngine* me) override { delete static_cast(me); } diff --git a/core/media/WmfMediaEngine.cpp b/core/media/WmfMediaEngine.cpp index 83c669987a44..ed02a1ad14c0 100644 --- a/core/media/WmfMediaEngine.cpp +++ b/core/media/WmfMediaEngine.cpp @@ -10,7 +10,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). -// +// // https://axmol.dev/ ////////////////////////////////////////////////////////////////////////// diff --git a/core/navmesh/NavMeshDebugDraw.cpp b/core/navmesh/NavMeshDebugDraw.cpp index b5f417e31ee2..47e9f89b1ee7 100644 --- a/core/navmesh/NavMeshDebugDraw.cpp +++ b/core/navmesh/NavMeshDebugDraw.cpp @@ -45,15 +45,15 @@ NavMeshDebugDraw::NavMeshDebugDraw() // the POSITION_COLOR default vertex layout is: V3F_C4B, so we need modify it auto vertexLayout = _programState->getMutableVertexLayout(); - vertexLayout->setAttrib("a_position", + vertexLayout->setAttrib("a_position", _programState->getAttributeLocation(backend::Attribute::POSITION), backend::VertexFormat::FLOAT3, - offsetof(V3F_C4F, position), + offsetof(V3F_C4F, position), false); - vertexLayout->setAttrib("a_color", - _programState->getAttributeLocation(backend::Attribute::COLOR), - backend::VertexFormat::FLOAT4, - offsetof(V3F_C4F, color), + vertexLayout->setAttrib("a_color", + _programState->getAttributeLocation(backend::Attribute::COLOR), + backend::VertexFormat::FLOAT4, + offsetof(V3F_C4F, color), false); vertexLayout->setStride(sizeof(V3F_C4F)); } @@ -166,7 +166,7 @@ void NavMeshDebugDraw::draw(Renderer* renderer) auto& transform = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); auto beforeCommand = renderer->nextCallbackCommand(); auto afterCommand = renderer->nextCallbackCommand(); - + beforeCommand->init(0, Mat4::IDENTITY, Node::FLAGS_RENDER_AS_3D); afterCommand->init(0, Mat4::IDENTITY, Node::FLAGS_RENDER_AS_3D); diff --git a/core/network/CMakeLists.txt b/core/network/CMakeLists.txt index 7f7f829457ff..d9cd06ce6e52 100644 --- a/core/network/CMakeLists.txt +++ b/core/network/CMakeLists.txt @@ -15,7 +15,7 @@ if(EMSCRIPTEN) network/Downloader-wasm.cpp network/Uri.cpp ) - + if (AX_ENABLE_HTTP) list(APPEND _AX_NETWORK_HEADER network/HttpClient.h @@ -27,9 +27,9 @@ if(EMSCRIPTEN) list(APPEND _AX_NETWORK_SRC network/HttpClient-wasm.cpp network/HttpCookie.cpp - ) + ) endif() - + if (AX_ENABLE_WEBSOCKET) list(APPEND _AX_NETWORK_HEADER network/WebSocket.h @@ -37,9 +37,9 @@ if(EMSCRIPTEN) list(APPEND _AX_NETWORK_SRC network/WebSocket-wasm.cpp - ) + ) endif() - + else() set(_AX_NETWORK_HEADER network/Downloader-curl.h @@ -53,7 +53,7 @@ else() network/Downloader-curl.cpp network/Uri.cpp ) - + if (AX_ENABLE_HTTP) list(APPEND _AX_NETWORK_HEADER network/HttpClient.h @@ -65,9 +65,9 @@ else() list(APPEND _AX_NETWORK_SRC network/HttpClient.cpp network/HttpCookie.cpp - ) + ) endif() - + if (AX_ENABLE_WEBSOCKET) list(APPEND _AX_NETWORK_HEADER network/WebSocket.h @@ -75,7 +75,7 @@ else() list(APPEND _AX_NETWORK_SRC network/WebSocket.cpp - ) + ) endif() endif() diff --git a/core/network/Downloader-wasm.cpp b/core/network/Downloader-wasm.cpp index dd9a0124af16..f281ff470dbf 100644 --- a/core/network/Downloader-wasm.cpp +++ b/core/network/Downloader-wasm.cpp @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev Permission is hereby granted, free of charge, to any person obtaining a copy @@ -90,7 +90,7 @@ namespace ax { namespace network { DownloadTaskEmscripten *coTask = new DownloadTaskEmscripten(fetch->id); coTask->task = task; - + AXLOGD("DownloaderEmscripten::createCoTask id: {}", coTask->id); _taskMap.insert(make_pair(coTask->id, coTask)); } @@ -111,7 +111,7 @@ namespace ax { namespace network { std::vector buf(reinterpret_cast(fetch->data), reinterpret_cast(fetch->data) + size); emscripten_fetch_close(fetch); coTask->fetch = fetch = NULL; - + downloader->_taskMap.erase(iter); downloader->onTaskFinish(*coTask->task, DownloadTask::ERROR_NO_ERROR, @@ -119,7 +119,7 @@ namespace ax { namespace network { "", buf ); - + coTask->task.reset(); } @@ -138,7 +138,7 @@ namespace ax { namespace network { DownloadTaskEmscripten *coTask = iter->second; vector buf; downloader->_taskMap.erase(iter); - + string storagePath = coTask->task->storagePath; int errCode = DownloadTask::ERROR_NO_ERROR; int errCodeInternal = 0; diff --git a/core/network/Downloader-wasm.h b/core/network/Downloader-wasm.h index 2dedcdb847c5..b673af64e8e9 100644 --- a/core/network/Downloader-wasm.h +++ b/core/network/Downloader-wasm.h @@ -1,7 +1,7 @@ /**************************************************************************** Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev Permission is hereby granted, free of charge, to any person obtaining a copy @@ -50,9 +50,9 @@ namespace ax { namespace network int _id; DownloaderHints hints; - + std::unordered_map _taskMap; - + static void onError(emscripten_fetch_t *fetch); static void onProgress(emscripten_fetch_t *fetch); diff --git a/core/network/Downloader.h b/core/network/Downloader.h index 4f96451bac01..1b0732564b24 100644 --- a/core/network/Downloader.h +++ b/core/network/Downloader.h @@ -60,7 +60,7 @@ class AX_DLL DownloadTask final std::string identifier; std::string requestURL; std::string storagePath; - + std::string cacertPath; struct diff --git a/core/network/HttpClient-wasm.h b/core/network/HttpClient-wasm.h index 618000a1ba6e..f34ce799bba1 100644 --- a/core/network/HttpClient-wasm.h +++ b/core/network/HttpClient-wasm.h @@ -150,7 +150,7 @@ class AX_DLL HttpClient * If defined, the method uses the ClearRequestPredicate and ClearResponsePredicate * to check for each request/response which to delete */ - void clearResponseAndRequestQueue(); + void clearResponseAndRequestQueue(); void clearResponseQueue() { clearResponseAndRequestQueue(); } @@ -158,7 +158,7 @@ class AX_DLL HttpClient * Sets a predicate function that is going to be called to determine if we proceed * each of the pending requests * - * @param predicate function that will be called + * @param predicate function that will be called */ void setClearRequestPredicate(ClearRequestPredicate predicate) { _clearRequestPredicate = predicate; } @@ -166,15 +166,15 @@ class AX_DLL HttpClient Sets a predicate function that is going to be called to determine if we proceed * each of the pending requests * - * @param cb predicate function that will be called + * @param cb predicate function that will be called */ void setClearResponsePredicate(ClearResponsePredicate predicate) { _clearResponsePredicate = predicate; } - + private: HttpClient(); virtual ~HttpClient(); - + void processResponse(HttpResponse* response, bool isAlone); static void onRequestComplete(emscripten_fetch_t *fetch); void increaseThreadCount(); @@ -182,17 +182,17 @@ class AX_DLL HttpClient private: int _timeoutForConnect; - + int _timeoutForRead; - + int _threadCount; - + Vector _requestQueue; - + std::string _cookieFilename; - + std::string _sslCaFilename; - + HttpCookie* _cookie; ClearRequestPredicate _clearRequestPredicate; @@ -204,4 +204,4 @@ class AX_DLL HttpClient NS_AX_END // end group -/// @} \ No newline at end of file +/// @} diff --git a/core/network/Uri.cpp b/core/network/Uri.cpp index 2be188ed1ec0..d59157e187a5 100644 --- a/core/network/Uri.cpp +++ b/core/network/Uri.cpp @@ -174,7 +174,7 @@ bool Uri::doParse(std::string_view str) } bool hasScheme = true; - + std::string copied(str); if (copied.find("://") == std::string::npos) { diff --git a/core/network/WebSocket-wasm.cpp b/core/network/WebSocket-wasm.cpp index 92e86592ccca..d592f9761c2f 100644 --- a/core/network/WebSocket-wasm.cpp +++ b/core/network/WebSocket-wasm.cpp @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev Permission is hereby granted, free of charge, to any person obtaining a copy @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ - + #include "network/WebSocket-wasm.h" #include "yasio/errc.hpp" #include "base/Logging.h" diff --git a/core/network/WebSocket-wasm.h b/core/network/WebSocket-wasm.h index c87be25523b4..3a5edbbd7b7d 100644 --- a/core/network/WebSocket-wasm.h +++ b/core/network/WebSocket-wasm.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ - + #pragma once #include "platform/PlatformMacros.h" diff --git a/core/physics/PhysicsWorld.cpp b/core/physics/PhysicsWorld.cpp index e24edb9f8820..0ce183fffebe 100644 --- a/core/physics/PhysicsWorld.cpp +++ b/core/physics/PhysicsWorld.cpp @@ -973,7 +973,7 @@ void PhysicsWorld::update(float delta, bool userCall /* = false*/) cpSpaceStep(_cpSpace, dt); # else cpHastySpaceStep(_cpSpace, dt); -# endif +# endif } } else diff --git a/core/platform/Device.h b/core/platform/Device.h index 9db5dacc1c0b..b419419608d4 100644 --- a/core/platform/Device.h +++ b/core/platform/Device.h @@ -83,7 +83,7 @@ class AX_DLL Device * @return The DPI of device. */ static int getDPI(); - + /** * Gets the device pixel ratio * @since axmol-2.1.0 diff --git a/core/platform/FileStream.h b/core/platform/FileStream.h index d7bea821f311..091798fedeeb 100644 --- a/core/platform/FileStream.h +++ b/core/platform/FileStream.h @@ -40,7 +40,7 @@ class AX_DLL FileStream : public IFileStream { public: using IFileStream::Mode; - + FileStream() = default; ~FileStream() override; diff --git a/core/platform/GLView.h b/core/platform/GLView.h index 24cebd5b7056..555779d4aef6 100644 --- a/core/platform/GLView.h +++ b/core/platform/GLView.h @@ -3,7 +3,7 @@ Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/platform/android/ControllerManualAdapter/AndroidManifest.xml b/core/platform/android/ControllerManualAdapter/AndroidManifest.xml index c472596a8c8c..5afb7f3e423e 100644 --- a/core/platform/android/ControllerManualAdapter/AndroidManifest.xml +++ b/core/platform/android/ControllerManualAdapter/AndroidManifest.xml @@ -2,7 +2,7 @@ - + - - + + diff --git a/core/platform/android/GLViewImpl-android.cpp b/core/platform/android/GLViewImpl-android.cpp index 4716a044dc57..e5868284b1f2 100644 --- a/core/platform/android/GLViewImpl-android.cpp +++ b/core/platform/android/GLViewImpl-android.cpp @@ -3,7 +3,7 @@ Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). - + https://axmol.dev/ Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/core/platform/android/java/AndroidManifest.xml b/core/platform/android/java/AndroidManifest.xml index d41fa7146170..a755584d05e6 100644 --- a/core/platform/android/java/AndroidManifest.xml +++ b/core/platform/android/java/AndroidManifest.xml @@ -5,4 +5,4 @@ - + diff --git a/core/platform/android/libaxmol-with-controller/build.gradle b/core/platform/android/libaxmol-with-controller/build.gradle index 496763fd0723..e094fbb34023 100644 --- a/core/platform/android/libaxmol-with-controller/build.gradle +++ b/core/platform/android/libaxmol-with-controller/build.gradle @@ -16,7 +16,7 @@ android { java.srcDirs = ['../java/src','../ControllerManualAdapter/src'] manifest.srcFile "AndroidManifest.xml" } - + buildTypes { release { minifyEnabled false diff --git a/core/platform/ios/Device-ios.mm b/core/platform/ios/Device-ios.mm index a640ebdfc5df..2cda8f948f8d 100644 --- a/core/platform/ios/Device-ios.mm +++ b/core/platform/ios/Device-ios.mm @@ -342,11 +342,11 @@ static float getDevicePixelRatio(int& sdpi) { float scale = getDevicePixelRatio(sdpi); return static_cast(scale * sdpi); } - + return dpi; } -float Device::getPixelRatio() +float Device::getPixelRatio() { int ignored_sdpi; return getDevicePixelRatio(ignored_sdpi); diff --git a/core/platform/ios/ES3Renderer-ios.m b/core/platform/ios/ES3Renderer-ios.m index 983f028d9957..52279d615245 100644 --- a/core/platform/ios/ES3Renderer-ios.m +++ b/core/platform/ios/ES3Renderer-ios.m @@ -63,7 +63,7 @@ - (id) initWithDepthFormat:(unsigned int)depthFormat withPixelFormat:(unsigned i [self release]; return nil; } - + depthFormat_ = depthFormat; pixelFormat_ = pixelFormat; multiSampling_ = multiSampling; @@ -84,12 +84,12 @@ - (id) initWithDepthFormat:(unsigned int)depthFormat withPixelFormat:(unsigned i GLint maxSamplesAllowed; glGetIntegerv(GL_MAX_SAMPLES, &maxSamplesAllowed); samplesToUse_ = MIN(maxSamplesAllowed,requestedSamples); - + /* Create the MSAA framebuffer (offscreen) */ glGenFramebuffers(1, &msaaFramebuffer_); NSAssert( msaaFramebuffer_, @"Can't create default MSAA frame buffer"); glBindFramebuffer(GL_FRAMEBUFFER, msaaFramebuffer_); - + } CHECK_GL_ERROR(); @@ -107,7 +107,7 @@ - (BOOL)resizeFromLayer:(CAEAGLLayer *)layer { NSLog(@"failed to call context"); } - + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth_); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &backingHeight_); @@ -119,21 +119,21 @@ - (BOOL)resizeFromLayer:(CAEAGLLayer *)layer glDeleteRenderbuffers(1, &msaaColorbuffer_); msaaColorbuffer_ = 0; } - + /* Create the offscreen MSAA color buffer. After rendering, the contents of this will be blitted into ColorRenderbuffer */ - + //msaaFrameBuffer needs to be binded glBindFramebuffer(GL_FRAMEBUFFER, msaaFramebuffer_); glGenRenderbuffers(1, &msaaColorbuffer_); NSAssert(msaaFramebuffer_, @"Can't create MSAA color buffer"); - + glBindRenderbuffer(GL_RENDERBUFFER, msaaColorbuffer_); - + glRenderbufferStorageMultisample(GL_RENDERBUFFER, samplesToUse_, pixelFormat_ , backingWidth_, backingHeight_); - + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, msaaColorbuffer_); - + GLenum error; if ( (error=glCheckFramebufferStatus(GL_FRAMEBUFFER)) != GL_FRAMEBUFFER_COMPLETE) { @@ -152,20 +152,20 @@ - (BOOL)resizeFromLayer:(CAEAGLLayer *)layer } glBindRenderbuffer(GL_RENDERBUFFER, depthBuffer_); - + if( multiSampling_ ) glRenderbufferStorageMultisample(GL_RENDERBUFFER, samplesToUse_, depthFormat_,backingWidth_, backingHeight_); else glRenderbufferStorage(GL_RENDERBUFFER, depthFormat_, backingWidth_, backingHeight_); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthBuffer_); - + if (depthFormat_ == GL_DEPTH24_STENCIL8) { glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, depthBuffer_); } // bind color buffer - glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer_); + glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer_); } CHECK_GL_ERROR(); @@ -229,13 +229,13 @@ - (void)dealloc glDeleteRenderbuffers(1, &depthBuffer_ ); depthBuffer_ = 0; } - + if ( msaaColorbuffer_) { glDeleteRenderbuffers(1, &msaaColorbuffer_); msaaColorbuffer_ = 0; } - + if ( msaaFramebuffer_) { glDeleteRenderbuffers(1, &msaaFramebuffer_); diff --git a/core/platform/linux/Device-linux.cpp b/core/platform/linux/Device-linux.cpp index b63498538988..f642937a095e 100644 --- a/core/platform/linux/Device-linux.cpp +++ b/core/platform/linux/Device-linux.cpp @@ -103,7 +103,7 @@ int Device::getDPI() return dpi; } -float Device::getPixelRatio() +float Device::getPixelRatio() { return Device::getDPI() / 96.0f; } diff --git a/core/platform/mac/Device-mac.mm b/core/platform/mac/Device-mac.mm index a9ec835c788d..f39d6b84f4a9 100644 --- a/core/platform/mac/Device-mac.mm +++ b/core/platform/mac/Device-mac.mm @@ -65,7 +65,7 @@ of this software and associated documentation files (the "Software"), to deal return ((displayPixelSize.width / displayPhysicalSize.width) * 25.4f); } -float Device::getPixelRatio() +float Device::getPixelRatio() { NSScreen* screen = [NSScreen mainScreen]; const auto points = [screen frame]; diff --git a/core/platform/wasm/Application-wasm.h b/core/platform/wasm/Application-wasm.h index 09f1315e8129..97c33550840a 100644 --- a/core/platform/wasm/Application-wasm.h +++ b/core/platform/wasm/Application-wasm.h @@ -71,7 +71,7 @@ class Application : public ApplicationBase /** @deprecated Use getInstance() instead */ AX_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); - + /* override functions */ virtual LanguageType getCurrentLanguage() override; @@ -80,7 +80,7 @@ class Application : public ApplicationBase @return Current language iso 639-1 code */ virtual const char * getCurrentLanguageCode() override; - + /** @brief Get application version */ @@ -99,13 +99,13 @@ class Application : public ApplicationBase * @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead. */ AX_DEPRECATED_ATTRIBUTE void setResourceRootPath(const std::string& rootResDir); - - /** + + /** * Gets the Resource root path. - * @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. + * @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. */ AX_DEPRECATED_ATTRIBUTE const std::string& getResourceRootPath(); - + /** @brief Get target platform */ @@ -113,7 +113,7 @@ class Application : public ApplicationBase protected: long _animationSpeed; // micro second std::string _resourceRootPath; - + static Application * sm_pSharedApplication; }; diff --git a/core/platform/wasm/Device-wasm.cpp b/core/platform/wasm/Device-wasm.cpp index 699897822794..c002b7639dab 100644 --- a/core/platform/wasm/Device-wasm.cpp +++ b/core/platform/wasm/Device-wasm.cpp @@ -41,7 +41,7 @@ int Device::getDPI() return static_cast(160 * Device::getPixelRatio()); } -float Device::getPixelRatio() +float Device::getPixelRatio() { return EM_ASM_DOUBLE(return window.devicePixelRatio); } @@ -70,11 +70,11 @@ Data Device::getTextureDataForText(std::string_view text, const FontDefinition& var dimWidth = $4; var dimHeight = $5; var align = $6; - + var canvas = Module.axmolSharedCanvas = Module.axmolSharedCanvas || document.createElement("canvas"); var context = canvas.getContext("2d"); context.font = fontSize + "px " + fontName; - + var canvasWidth = dimWidth; var canvasHeight = dimHeight; for (var i = 0; i < lines.length; i++) { @@ -82,7 +82,7 @@ Data Device::getTextureDataForText(std::string_view text, const FontDefinition& linesWidth[i] = lineWidth; if (lineWidth > canvasWidth && dimWidth <= 0) { canvasWidth = lineWidth; - } + } }; if (dimHeight <= 0) { @@ -94,11 +94,11 @@ Data Device::getTextureDataForText(std::string_view text, const FontDefinition& canvas.width = canvasWidth; canvas.height = canvasHeight; - + context.clearRect(0, 0, canvasWidth, canvasHeight); context.font = fontSize + "px " + fontName; context.fillStyle = color; - context.textBaseline = "top"; + context.textBaseline = "top"; //Vertical top var offsetY = 0; @@ -122,14 +122,14 @@ Data Device::getTextureDataForText(std::string_view text, const FontDefinition& } context.fillText(lines[i], offsetX, offsetY + lineHeight * i); } - + var data = context.getImageData(0, 0, canvasWidth, canvasHeight).data; var ptr = _malloc(data.byteLength); // Cocos Data object free it var buffer= new Uint8Array(Module.HEAPU8.buffer, ptr, data.byteLength); buffer.set(data); return ptr; }, text.data(), textDefinition._fontName.c_str(), textDefinition._fontSize, color, textDefinition._dimensions.width, textDefinition._dimensions.height, align); - + width = EM_ASM_INT({ return Module.axmolSharedCanvas.width; }); @@ -137,7 +137,7 @@ Data Device::getTextureDataForText(std::string_view text, const FontDefinition& return Module.axmolSharedCanvas.height; }); hasPremultipliedAlpha = false; - + Data ret; ret.fastSet(ptr, width * height * 4); return ret; diff --git a/core/platform/wasm/shell_minimal.html b/core/platform/wasm/shell_minimal.html index cd3f77e1639b..569d6d2d7261 100644 --- a/core/platform/wasm/shell_minimal.html +++ b/core/platform/wasm/shell_minimal.html @@ -35,7 +35,7 @@
Downloading...
- +
@@ -43,14 +43,14 @@ Resize canvas Lock/hide mouse pointer     - | - +
@@ -58,7 +58,7 @@