mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Merge branch '3.7-beta' into 3.7-beta-cpp
This commit is contained in:
commit
dce7731855
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -69,7 +69,7 @@ namespace Spine.Unity.Modules.AttachmentTools {
|
||||
|
||||
/// <summary>Sets the region (image) of a RegionAttachment</summary>
|
||||
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 {
|
||||
|
||||
/// <summary>Sets the region (image) of a MeshAttachment</summary>
|
||||
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.</summary>
|
||||
/// <param name="sourceAttachments">The list of attachments to be repacked.</param>
|
||||
/// <param name = "outputAttachments">The List(Attachment) to populate with the newly created Attachment objects.</param>
|
||||
///
|
||||
///
|
||||
/// <param name="materialPropertySource">May be null. If no Material property source is provided, no special </param>
|
||||
public static void GetRepackedAttachments (List<Attachment> sourceAttachments, List<Attachment> 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)</summary>
|
||||
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 {
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new Spine AtlasRegion according to a Unity UV Rect (x-right, y-up, uv-normalized).</summary>
|
||||
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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user