Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim trailing whitespace for files in core folder #2089

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/2d/AutoPolygon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion core/2d/Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void Camera::initDefault()
}

setDepth(0);

if (_zoomFactor != 1.0F)
applyZoom();
}
Expand Down
18 changes: 9 additions & 9 deletions core/2d/Camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -255,31 +255,31 @@ 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; }

/**
* 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();
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion core/2d/ClippingNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion core/2d/ClippingNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion core/2d/DrawNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void DrawNode::setVertexLayout(CustomCommand& cmd)
}

void DrawNode::freeShaderInternal(CustomCommand& cmd)
{
{
auto& pipelinePS = cmd.getPipelineDescriptor().programState;
AX_SAFE_RELEASE_NULL(pipelinePS);
}
Expand Down
4 changes: 2 additions & 2 deletions core/2d/DrawNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions core/2d/FastTMXLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion core/2d/FastTMXTiledMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions core/2d/Label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions core/2d/Label.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -916,7 +916,7 @@ class AX_DLL Label : public Node, public LabelProtocol, public BlendProtocol

std::vector<float> _linesWidth;
std::vector<float> _linesOffsetX;

QuadCommand _quadCommand;

std::vector<BatchCommand> _batchCommands;
Expand Down
4 changes: 2 additions & 2 deletions core/2d/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions core/2d/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions core/2d/ParticleSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions core/2d/PlistSpriteSheetLoader.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion core/2d/PlistSpriteSheetLoader.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions core/2d/ProgressTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -306,10 +306,10 @@ const Color3B& ProgressTimer::getColor() const
void ProgressTimer::setOpacity(uint8_t opacity)
{
_displayedOpacity = _realOpacity = opacity;

_sprite->setOpacity(_displayedOpacity);
updateColor();

updateCascadeOpacity();
}

Expand Down Expand Up @@ -622,7 +622,7 @@ Vec2 ProgressTimer::boundaryTexCoord(char index)
return Vec2((kProgressTextureCoords >> ((index << 1) + 1)) & 1,
(kProgressTextureCoords >> (index << 1)) & 1);
}

return Vec2::ZERO;
}

Expand Down
2 changes: 1 addition & 1 deletion core/2d/ProtectedNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/2d/ProtectedNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions core/2d/RenderTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -494,7 +494,7 @@ void RenderTexture::onSaveToFile(std::string filename, bool isRGBA, bool forceNo
if (_saveFileCallback)
{
_saveFileCallback(this, _filename);
}
}
}
};
newImage(callbackFunc);
Expand Down
Loading