Fix fomatting script, apply formatting.

This commit is contained in:
Mario Zechner 2022-01-20 19:49:10 +01:00
parent beea7c5b4d
commit d7bb172c95
5 changed files with 14 additions and 18 deletions

View File

@ -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

View File

@ -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));

View File

@ -30,7 +30,7 @@
#include <spine/Sequence.h>
#include <spine/extension.h>
_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
}

View File

@ -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<RegionAttachment*>(attachment)->getColor().a == 0)
if (static_cast<RegionAttachment *>(attachment)->getColor().a == 0)
return true;
}
else if (attachmentRTTI.isExactly(MeshAttachment::rtti)) {
if (static_cast<MeshAttachment*>(attachment)->getColor().a == 0)
} else if (attachmentRTTI.isExactly(MeshAttachment::rtti)) {
if (static_cast<MeshAttachment *>(attachment)->getColor().a == 0)
return true;
}
return false;

View File

@ -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) : "";