From 34387d48d4164f339305a8c52f4eedf7a06de87d Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 10 Apr 2024 15:15:58 +0200 Subject: [PATCH] Formatting --- .../example/Classes/PhysicsExample.cpp | 18 +++++++++--------- .../example/Classes/PhysicsExample.h | 2 +- spine-cpp/spine-cpp/src/spine/Atlas.cpp | 2 +- spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/spine-cocos2dx/example/Classes/PhysicsExample.cpp b/spine-cocos2dx/example/Classes/PhysicsExample.cpp index 166007918b..3d5e561265 100644 --- a/spine-cocos2dx/example/Classes/PhysicsExample.cpp +++ b/spine-cocos2dx/example/Classes/PhysicsExample.cpp @@ -53,21 +53,21 @@ bool PhysicsExample::init() { // Next we setup a listener that receives and stores // the current mouse location and updates the skeleton position - // accordingly. + // accordingly. EventListenerMouse *mouseListener = EventListenerMouse::create(); mouseListener->onMouseMove = [this](cocos2d::Event *event) -> void { // convert the mosue location to the skeleton's coordinate space // and store it. EventMouse *mouseEvent = dynamic_cast(event); Vec2 mousePosition = skeletonNode->convertToNodeSpace(mouseEvent->getLocationInView()); - if (firstUpdate) { - firstUpdate = false; - lastMousePosition = mousePosition; - return; - } - Vec2 delta = mousePosition - lastMousePosition; - skeletonNode->getSkeleton()->physicsTranslate(-delta.x, -delta.y); - lastMousePosition = mousePosition; + if (firstUpdate) { + firstUpdate = false; + lastMousePosition = mousePosition; + return; + } + Vec2 delta = mousePosition - lastMousePosition; + skeletonNode->getSkeleton()->physicsTranslate(-delta.x, -delta.y); + lastMousePosition = mousePosition; }; _eventDispatcher->addEventListenerWithSceneGraphPriority(mouseListener, this); diff --git a/spine-cocos2dx/example/Classes/PhysicsExample.h b/spine-cocos2dx/example/Classes/PhysicsExample.h index 540e167e4d..881bd3453b 100644 --- a/spine-cocos2dx/example/Classes/PhysicsExample.h +++ b/spine-cocos2dx/example/Classes/PhysicsExample.h @@ -45,7 +45,7 @@ class PhysicsExample : public cocos2d::LayerColor { private: spine::SkeletonAnimation *skeletonNode; - bool firstUpdate = true; + bool firstUpdate = true; cocos2d::Vec2 lastMousePosition; }; diff --git a/spine-cpp/spine-cpp/src/spine/Atlas.cpp b/spine-cpp/spine-cpp/src/spine/Atlas.cpp index f3f89e5870..d87070b820 100644 --- a/spine-cpp/spine-cpp/src/spine/Atlas.cpp +++ b/spine-cpp/spine-cpp/src/spine/Atlas.cpp @@ -192,7 +192,7 @@ struct AtlasInput { line.end = index; if (index != end) index++; line = line.trim(); - line.length = (int)(end - start); + line.length = (int) (end - start); return &line; } diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp index b769cd0f37..5f20a4973f 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp @@ -1164,7 +1164,7 @@ Animation *SkeletonJson::readAnimation(Json *root, SkeletonData *skeletonData) { timelines.add(readTimeline(timelineMap->_child, timeline, 0, 1)); } else if (strcmp(timelineMap->_name, "inherit") == 0) { InheritTimeline *timeline = new (__FILE__, __LINE__) InheritTimeline(frames, boneIndex); - keyMap = timelineMap->_child; + keyMap = timelineMap->_child; for (frame = 0;; frame++) { float time = Json::getFloat(keyMap, "time", 0); const char *value = Json::getString(keyMap, "value", "normal");