From d7bb172c9567534d9815c14ba3c95a4b826c5c1e Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Thu, 20 Jan 2022 19:49:10 +0100 Subject: [PATCH] Fix fomatting script, apply formatting. --- formatters/format.sh | 7 ++----- spine-c/spine-c/src/spine/AtlasAttachmentLoader.c | 2 +- spine-c/spine-c/src/spine/Sequence.c | 8 ++++---- spine-cocos2dx/src/spine/SkeletonRenderer.cpp | 13 ++++++------- spine-ts/spine-core/src/AssetManagerBase.ts | 2 +- 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/formatters/format.sh b/formatters/format.sh index 9f13c9b8b..a9ff96fb4 100755 --- a/formatters/format.sh +++ b/formatters/format.sh @@ -8,8 +8,7 @@ setup() { cp $dir/.clang-format $dir/.. cp $dir/build.gradle $dir/.. cp $dir/settings.gradle $dir/.. - cp $dir/.editorconfig $dir/../spine-csharp - cp $dir/.editorconfig $dir/../spine-xna + cp $dir/.editorconfig $dir/../spine-csharp cp $dir/.editorconfig $dir/../spine-monogame cp $dir/.editorconfig $dir/../spine-unity } @@ -18,8 +17,7 @@ cleanup() { rm $dir/../.clang-format rm $dir/../build.gradle rm $dir/../settings.gradle - rm $dir/../spine-csharp/.editorconfig - rm $dir/../spine-xna/.editorconfig + rm $dir/../spine-csharp/.editorconfig rm $dir/../spine-monogame/.editorconfig rm $dir/../spine-unity/.editorconfig } @@ -31,7 +29,6 @@ setup pushd $dir/.. ./formatters/gradlew spotlessApply dotnet-format spine-csharp/spine-csharp.sln -dotnet-format -f spine-xna dotnet-format -f spine-monogame dotnet-format -f spine-unity popd diff --git a/spine-c/spine-c/src/spine/AtlasAttachmentLoader.c b/spine-c/spine-c/src/spine/AtlasAttachmentLoader.c index 6055b30e8..7ccff5d28 100644 --- a/spine-c/spine-c/src/spine/AtlasAttachmentLoader.c +++ b/spine-c/spine-c/src/spine/AtlasAttachmentLoader.c @@ -34,7 +34,7 @@ static int /*bool*/ loadSequence(spAtlas *atlas, const char *basePath, spSequence *sequence) { spTextureRegionArray *regions = sequence->regions; char *path = CALLOC(char, strlen(basePath) + sequence->digits + 1); - int i ; + int i; for (i = 0; i < regions->size; i++) { spSequence_getPath(basePath, i, path); regions->items[i] = SUPER(spAtlas_findRegion(atlas, path)); diff --git a/spine-c/spine-c/src/spine/Sequence.c b/spine-c/spine-c/src/spine/Sequence.c index 2811fbfdd..a611135ba 100644 --- a/spine-c/spine-c/src/spine/Sequence.c +++ b/spine-c/spine-c/src/spine/Sequence.c @@ -30,7 +30,7 @@ #include #include -_SP_ARRAY_IMPLEMENT_TYPE(spTextureRegionArray, spTextureRegion*) +_SP_ARRAY_IMPLEMENT_TYPE(spTextureRegionArray, spTextureRegion *) static int nextSequenceId = 0; @@ -69,7 +69,7 @@ void spSequence_apply(spSequence *self, spSlot *slot, spAttachment *attachment) region = self->regions->items[index]; if (attachment->type == SP_ATTACHMENT_REGION) { - spRegionAttachment *regionAttachment = (spRegionAttachment*)attachment; + spRegionAttachment *regionAttachment = (spRegionAttachment *) attachment; if (regionAttachment->region != region) { regionAttachment->rendererObject = region; regionAttachment->region = region; @@ -78,7 +78,7 @@ void spSequence_apply(spSequence *self, spSlot *slot, spAttachment *attachment) } if (attachment->type == SP_ATTACHMENT_MESH) { - spMeshAttachment *meshAttachment = (spMeshAttachment*)attachment; + spMeshAttachment *meshAttachment = (spMeshAttachment *) attachment; if (meshAttachment->region != region) { meshAttachment->rendererObject = region; meshAttachment->region = region; @@ -87,6 +87,6 @@ void spSequence_apply(spSequence *self, spSlot *slot, spAttachment *attachment) } } -void spSequence_getPath(const char* basePath, int index, char* path) { +void spSequence_getPath(const char *basePath, int index, char *path) { fix me } diff --git a/spine-cocos2dx/src/spine/SkeletonRenderer.cpp b/spine-cocos2dx/src/spine/SkeletonRenderer.cpp index 6c8dddae8..2ae6ae389 100644 --- a/spine-cocos2dx/src/spine/SkeletonRenderer.cpp +++ b/spine-cocos2dx/src/spine/SkeletonRenderer.cpp @@ -656,7 +656,7 @@ namespace spine { RegionAttachment *attachment = (RegionAttachment *) slot->getAttachment(); float worldVertices[8]; - attachment->computeWorldVertices(*slot, worldVertices, 0, 2); + attachment->computeWorldVertices(*slot, worldVertices, 0, 2); const Vec2 points[4] = { {worldVertices[0], worldVertices[1]}, @@ -907,23 +907,22 @@ namespace spine { return startSlotIndex > index || endSlotIndex < index; } - bool nothingToDraw(Slot& slot, int startSlotIndex, int endSlotIndex) { + bool nothingToDraw(Slot &slot, int startSlotIndex, int endSlotIndex) { Attachment *attachment = slot.getAttachment(); if (!attachment || slotIsOutRange(slot, startSlotIndex, endSlotIndex) || !slot.getBone().isActive()) return true; - const auto& attachmentRTTI = attachment->getRTTI(); + const auto &attachmentRTTI = attachment->getRTTI(); if (attachmentRTTI.isExactly(ClippingAttachment::rtti)) return false; if (slot.getColor().a == 0) return true; if (attachmentRTTI.isExactly(RegionAttachment::rtti)) { - if (static_cast(attachment)->getColor().a == 0) + if (static_cast(attachment)->getColor().a == 0) return true; - } - else if (attachmentRTTI.isExactly(MeshAttachment::rtti)) { - if (static_cast(attachment)->getColor().a == 0) + } else if (attachmentRTTI.isExactly(MeshAttachment::rtti)) { + if (static_cast(attachment)->getColor().a == 0) return true; } return false; diff --git a/spine-ts/spine-core/src/AssetManagerBase.ts b/spine-ts/spine-core/src/AssetManagerBase.ts index 45c6ad06f..67f047bfd 100644 --- a/spine-ts/spine-core/src/AssetManagerBase.ts +++ b/spine-ts/spine-core/src/AssetManagerBase.ts @@ -139,7 +139,7 @@ export class AssetManagerBase implements Disposable { loadTextureAtlas (path: string, success: (path: string, atlas: TextureAtlas) => void = null, error: (path: string, message: string) => void = null, - fileAlias: {[keyword:string] : string} = null + fileAlias: { [keyword: string]: string } = null ) { let index = path.lastIndexOf("/"); let parent = index >= 0 ? path.substring(0, index + 1) : "";