mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 16:48:43 +08:00
Merge branch '3.6' into 3.7-beta
This commit is contained in:
commit
cce86c1e33
@ -93,7 +93,8 @@ static float toColor (const char* value, int index) {
|
||||
char *error;
|
||||
int color;
|
||||
|
||||
if (strlen(value) / 2 < index) return -1;
|
||||
if (index >= strlen(value) / 2)
|
||||
return -1;
|
||||
value += index * 2;
|
||||
|
||||
digits[0] = *value;
|
||||
|
||||
@ -2,14 +2,14 @@ cmake_minimum_required(VERSION 2.8)
|
||||
set(EXAMPLE_DIR "${CMAKE_CURRENT_LIST_DIR}/example")
|
||||
if (NOT EXISTS ${EXAMPLE_DIR}/cocos2d)
|
||||
message("Downloading cocos2dx, this may take some time!")
|
||||
file(DOWNLOAD "http://www.cocos2d-x.org/filedown/start/364" "${EXAMPLE_DIR}/cocos2dx.zip")
|
||||
file(DOWNLOAD "http://cdn.cocos2d-x.org/cocos2d-x-3.16.zip" "${EXAMPLE_DIR}/cocos2dx.zip")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E tar x ${EXAMPLE_DIR}/cocos2dx.zip
|
||||
WORKING_DIRECTORY ${EXAMPLE_DIR}
|
||||
)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E rename
|
||||
"${EXAMPLE_DIR}/cocos2d-x-3.14.1" "${EXAMPLE_DIR}/cocos2d"
|
||||
"${EXAMPLE_DIR}/cocos2d-x-3.16" "${EXAMPLE_DIR}/cocos2d"
|
||||
)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory "${EXAMPLE_DIR}/cocos2d/cocos/editor-support/spine"
|
||||
|
||||
@ -399,7 +399,7 @@ namespace Spine.Unity.Modules.AttachmentTools {
|
||||
/// <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") {
|
||||
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) {
|
||||
if (sourceAttachments == null) throw new System.ArgumentNullException("sourceAttachments");
|
||||
if (outputAttachments == null) throw new System.ArgumentNullException("outputAttachments");
|
||||
|
||||
@ -468,8 +468,8 @@ namespace Spine.Unity.Modules.AttachmentTools {
|
||||
}
|
||||
|
||||
// Clean up.
|
||||
foreach (var ttp in texturesToPack)
|
||||
UnityEngine.Object.Destroy(ttp);
|
||||
if (clearCache)
|
||||
AtlasUtilities.ClearCache();
|
||||
|
||||
outputTexture = newTexture;
|
||||
outputMaterial = newMaterial;
|
||||
@ -485,7 +485,7 @@ namespace Spine.Unity.Modules.AttachmentTools {
|
||||
/// <summary>
|
||||
/// Creates and populates a duplicate skin with cloned attachments that are backed by a new packed texture atlas comprised of all the regions from the original skin.</summary>
|
||||
/// <remarks>No Spine.Atlas object is created so there is no way to find AtlasRegions except through the Attachments using them.</remarks>
|
||||
public static Skin GetRepackedSkin (this Skin o, string newName, Shader shader, out Material outputMaterial, out Texture2D outputTexture, int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, Material materialPropertySource = null) {
|
||||
public static Skin GetRepackedSkin (this Skin o, string newName, Shader shader, out Material outputMaterial, out Texture2D outputTexture, int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, Material materialPropertySource = null, bool clearCache = false) {
|
||||
var skinAttachments = o.Attachments;
|
||||
var newSkin = new Skin(newName);
|
||||
|
||||
@ -553,8 +553,8 @@ namespace Spine.Unity.Modules.AttachmentTools {
|
||||
}
|
||||
|
||||
// Clean up.
|
||||
foreach (var ttp in texturesToPack)
|
||||
UnityEngine.Object.Destroy(ttp);
|
||||
if (clearCache)
|
||||
AtlasUtilities.ClearCache();
|
||||
|
||||
outputTexture = newTexture;
|
||||
outputMaterial = newMaterial;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user