Browse Source

[cpp] 4.3 porting WIP

Mario Zechner 2 months ago
parent
commit
65d0eec7c5

+ 0 - 2
spine-cpp/spine-cpp/include/spine/Constraint.h

@@ -68,8 +68,6 @@ namespace spine {
 
 	template<class T, class D, class P>
 	class SP_API ConstraintGeneric : public PosedGeneric<D, P, P>, public PosedActive, public Constraint {
-		RTTI_DECL
-
 	public:
 		ConstraintGeneric(D &data) : PosedGeneric<D, P, P>(data), PosedActive(), Constraint() {
 		}

+ 1 - 1
spine-cpp/spine-cpp/include/spine/Sequence.h

@@ -97,7 +97,7 @@ namespace spine {
 		SequenceMode_pingpongReverse = 6
 	};
 
-	SequenceMode SequenceMode_valueOf(const String &value) {
+	inline SequenceMode SequenceMode_valueOf(const String &value) {
 		if (value == "hold") return SequenceMode_hold;
 		if (value == "once") return SequenceMode_once;
 		if (value == "loop") return SequenceMode_loop;

+ 2 - 0
spine-cpp/spine-cpp/include/spine/SlotPose.h

@@ -79,6 +79,8 @@ namespace spine {
 		/// Returns true if this slot has a dark color.
 		bool hasDarkColor();
 
+		void setHasDarkColor(bool hasDarkColor);
+
 		/// The current attachment for the slot, or null if the slot has no attachment.
 		Attachment* getAttachment();
 

+ 2 - 2
spine-cpp/spine-cpp/include/spine/Version.h

@@ -31,7 +31,7 @@
 #define SPINE_VERSION_H_
 
 #define SPINE_MAJOR_VERSION 4
-#define SPINE_MINOR_VERSION 2
-#define SPINE_VERSION_STRING "4.2"
+#define SPINE_MINOR_VERSION 3
+#define SPINE_VERSION_STRING "4.3"
 
 #endif

+ 3 - 1
spine-cpp/spine-cpp/src/spine/ConstraintTimeline.cpp

@@ -31,4 +31,6 @@
 
 using namespace spine;
 
-RTTI_IMPL_NOPARENT(ConstraintTimeline)
+RTTI_IMPL_NOPARENT(ConstraintTimeline)
+
+ConstraintTimeline::ConstraintTimeline(int constraintIndex) : _constraintIndex(constraintIndex) {}

+ 2 - 2
spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp

@@ -680,8 +680,8 @@ Attachment *SkeletonJson::readAttachment(Json *map, Skin *skin, int slotIndex, c
 
 			if (Json::getInt(map, "hull", 0)) mesh->setHullLength(Json::getInt(map, "hull", 0) << 1);
 			Vector<unsigned short> edges;
-			if (!Json::asArray(Json::getItem(map, "edges"), edges)) return NULL;
-			mesh->_edges.clearAndAddAll(edges);
+			Json::asArray(Json::getItem(map, "edges"), edges);
+			if (edges.size() > 0) mesh->_edges.clearAndAddAll(edges);
 			return mesh;
 		}
 		case AttachmentType_Path: {

+ 4 - 0
spine-cpp/spine-cpp/src/spine/SlotPose.cpp

@@ -61,6 +61,10 @@ bool SlotPose::hasDarkColor() {
 	return _hasDarkColor;
 }
 
+void SlotPose::setHasDarkColor(bool hasDarkColor) {
+	_hasDarkColor = hasDarkColor;
+}
+
 Attachment *SlotPose::getAttachment() {
 	return _attachment;
 }

+ 7 - 0
spine-libgdx/.vscode/settings.json

@@ -0,0 +1,7 @@
+{
+    "java.configuration.updateBuildConfiguration": "automatic",
+    "java.import.gradle.enabled": true,
+    "java.import.gradle.wrapper.enabled": true,
+    "java.import.gradle.offline.enabled": false,
+    "java.server.launchMode": "Standard"
+}

+ 2 - 0
spine-libgdx/settings.gradle

@@ -1,3 +1,5 @@
+rootProject.name = 'spine-libgdx-root'
+
 // includeBuild "../../libgdx"
 include ":spine-libgdx"
 include ":spine-libgdx-tests"