diff --git a/spine-c/spine-c-unit-tests/CMakeLists.txt b/spine-c/spine-c-unit-tests/CMakeLists.txt index 71eca51d6..defc326c9 100755 --- a/spine-c/spine-c-unit-tests/CMakeLists.txt +++ b/spine-c/spine-c-unit-tests/CMakeLists.txt @@ -3,7 +3,8 @@ project(spine_unit_test) set(CMAKE_INSTALL_PREFIX "./") set(CMAKE_VERBOSE_MAKEFILE ON) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DKANJI_MEMTRACE -DUSE_CPP11_MUTEX") +set (CMAKE_CXX_FLAGS "-Wall -Wextra -Wnon-virtual-dtor -pedantic -std=c++03 -fno-rtti -DKANJI_MEMTRACE -DUSE_CPP11_MUTEX") + ######################################################### # set includes diff --git a/spine-c/spine-c/src/spine/SkeletonJson.c b/spine-c/spine-c/src/spine/SkeletonJson.c index 205fc95be..9c770d96b 100644 --- a/spine-c/spine-c/src/spine/SkeletonJson.c +++ b/spine-c/spine-c/src/spine/SkeletonJson.c @@ -894,6 +894,8 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha type = SP_ATTACHMENT_PATH; else if (strcmp(typeString, "clipping") == 0) type = SP_ATTACHMENT_CLIPPING; + else if (strcmp(typeString, "point") == 0) + type = SP_ATTACHMENT_POINT; else { spSkeletonData_dispose(skeletonData); _spSkeletonJson_setError(self, root, "Unknown attachment type: ", typeString); diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp index 69348de9e..ba35f8af9 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp @@ -467,7 +467,9 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) { type = AttachmentType_Path; } else if (strcmp(typeString, "clipping") == 0) { type = AttachmentType_Clipping; - } else { + } else if (strcmp(typeString, "point") == 0) { + type = AttachmentType_Point; + }else { delete skeletonData; setError(root, "Unknown attachment type: ", typeString); return NULL; diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs index 4bbc7f0ad..08c4d0618 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs @@ -69,7 +69,7 @@ namespace Spine.Unity.Modules.AttachmentTools { /// Sets the region (image) of a RegionAttachment public static void SetRegion (this RegionAttachment attachment, AtlasRegion region, bool updateOffset = true) { - if (region == null) throw new System.ArgumentNullException("region"); + if (region == null) throw new System.ArgumentNullException("region"); // (AtlasAttachmentLoader.cs) attachment.RendererObject = region; @@ -86,7 +86,7 @@ namespace Spine.Unity.Modules.AttachmentTools { /// Sets the region (image) of a MeshAttachment public static void SetRegion (this MeshAttachment attachment, AtlasRegion region, bool updateUVs = true) { - if (region == null) throw new System.ArgumentNullException("region"); + if (region == null) throw new System.ArgumentNullException("region"); // (AtlasAttachmentLoader.cs) attachment.RendererObject = region; @@ -395,7 +395,7 @@ namespace Spine.Unity.Modules.AttachmentTools { /// Fills the outputAttachments list with new attachment objects based on the attachments in sourceAttachments, but mapped to a new single texture using the same material. /// The list of attachments to be repacked. /// The List(Attachment) to populate with the newly created Attachment objects. - /// + /// /// May be null. If no Material property source is provided, no special public static void GetRepackedAttachments (List sourceAttachments, List outputAttachments, Material materialPropertySource, out Material outputMaterial, out Texture2D outputTexture, int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, string newAssetName = "Repacked Attachments", bool clearCache = false, bool useOriginalNonrenderables = true) { if (sourceAttachments == null) throw new System.ArgumentNullException("sourceAttachments"); @@ -413,7 +413,7 @@ namespace Spine.Unity.Modules.AttachmentTools { int newRegionIndex = 0; for (int i = 0, n = sourceAttachments.Count; i < n; i++) { var originalAttachment = sourceAttachments[i]; - + if (IsRenderable(originalAttachment)) { var newAttachment = originalAttachment.GetClone(true); var region = newAttachment.GetRegion(); @@ -524,7 +524,7 @@ namespace Spine.Unity.Modules.AttachmentTools { newSkin.AddAttachment(originalKey.slotIndex, originalKey.name, newAttachment); } else { newSkin.AddAttachment(originalKey.slotIndex, originalKey.name, useOriginalNonrenderables ? originalAttachment : originalAttachment.GetClone(true)); - } + } } // Fill a new texture with the collected attachment textures. @@ -657,7 +657,7 @@ namespace Spine.Unity.Modules.AttachmentTools { /// Returns a Rect of the AtlasRegion according to Spine texture coordinates. (x-right, y-down) static Rect GetSpineAtlasRect (this AtlasRegion region, bool includeRotate = true) { if (includeRotate && region.rotate) - return new Rect(region.x, region.y, region.height, region.width); + return new Rect(region.x, region.y, region.height, region.width); else return new Rect(region.x, region.y, region.width, region.height); } @@ -684,7 +684,7 @@ namespace Spine.Unity.Modules.AttachmentTools { /// /// Creates a new Spine AtlasRegion according to a Unity UV Rect (x-right, y-up, uv-normalized). - static AtlasRegion UVRectToAtlasRegion (Rect uvRect, string name, AtlasPage page, float offsetX, float offsetY, bool rotate) { + static AtlasRegion UVRectToAtlasRegion (Rect uvRect, string name, AtlasPage page, float offsetX, float offsetY, bool rotate) { var tr = UVRectToTextureRect(uvRect, page.width, page.height); var rr = tr.SpineUnityFlipRect(page.height); @@ -875,7 +875,7 @@ namespace Spine.Unity.Modules.AttachmentTools { public static Attachment GetClone (this Attachment o, bool cloneMeshesAsLinked) { var regionAttachment = o as RegionAttachment; if (regionAttachment != null) - return regionAttachment.GetClone(); + return regionAttachment.GetClone(); var meshAttachment = o as MeshAttachment; if (meshAttachment != null)