Remove BOMs

This commit is contained in:
Mario Zechner 2021-08-18 20:51:17 +02:00
parent 26a9813ced
commit 6a93555805
10 changed files with 255 additions and 255 deletions

View File

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;

View File

@ -1,4 +1,4 @@
// //
// System.Collections.Generic.List // System.Collections.Generic.List
// //
// Authors: // Authors:

View File

@ -1,4 +1,4 @@
/****************************************************************************** /******************************************************************************
* Spine Runtimes License Agreement * Spine Runtimes License Agreement
* Last updated January 1, 2020. Replaces all prior versions. * Last updated January 1, 2020. Replaces all prior versions.
* *

View File

@ -1,4 +1,4 @@
/****************************************************************************** /******************************************************************************
* Spine Runtimes License Agreement * Spine Runtimes License Agreement
* Last updated January 1, 2020. Replaces all prior versions. * Last updated January 1, 2020. Replaces all prior versions.
* *

View File

@ -1,4 +1,4 @@
using Spine.Unity; using Spine.Unity;
using UnityEngine; using UnityEngine;
namespace Spine.Unity.Examples { namespace Spine.Unity.Examples {

View File

@ -1,4 +1,4 @@
/****************************************************************************** /******************************************************************************
* Spine Runtimes License Agreement * Spine Runtimes License Agreement
* Last updated January 1, 2020. Replaces all prior versions. * Last updated January 1, 2020. Replaces all prior versions.
* *

View File

@ -1,4 +1,4 @@
using NUnit.Framework; using NUnit.Framework;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;

View File

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;

View File

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;

View File

@ -1,246 +1,246 @@
/****************************************************************************** /******************************************************************************
* Spine Runtimes License Agreement * Spine Runtimes License Agreement
* Last updated January 1, 2020. Replaces all prior versions. * Last updated January 1, 2020. Replaces all prior versions.
* *
* Copyright (c) 2013-2020, Esoteric Software LLC * Copyright (c) 2013-2020, Esoteric Software LLC
* *
* Integration of the Spine Runtimes into software or otherwise creating * Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and * derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement: * conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license * http://esotericsoftware.com/spine-editor-license
* *
* Otherwise, it is permitted to integrate the Spine Runtimes into software * Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively, * or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own * "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must * Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice. * include this license and copyright notice.
* *
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media; using Microsoft.Xna.Framework.Media;
using Spine; using Spine;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
namespace Spine { namespace Spine {
public class Example : Microsoft.Xna.Framework.Game { public class Example : Microsoft.Xna.Framework.Game {
GraphicsDeviceManager graphics; GraphicsDeviceManager graphics;
SkeletonRenderer skeletonRenderer; SkeletonRenderer skeletonRenderer;
SkeletonDebugRenderer skeletonDebugRenderer; SkeletonDebugRenderer skeletonDebugRenderer;
Skeleton skeleton; Skeleton skeleton;
Slot headSlot; Slot headSlot;
AnimationState state; AnimationState state;
SkeletonBounds bounds = new SkeletonBounds(); SkeletonBounds bounds = new SkeletonBounds();
#if WINDOWS_STOREAPP #if WINDOWS_STOREAPP
private string assetsFolder = @"Assets\"; private string assetsFolder = @"Assets\";
#else #else
private string assetsFolder = "data/"; private string assetsFolder = "data/";
#endif #endif
public Example () { public Example () {
IsMouseVisible = true; IsMouseVisible = true;
graphics = new GraphicsDeviceManager(this); graphics = new GraphicsDeviceManager(this);
graphics.IsFullScreen = false; graphics.IsFullScreen = false;
graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferWidth = 800;
graphics.PreferredBackBufferHeight = 600; graphics.PreferredBackBufferHeight = 600;
} }
protected override void Initialize () { protected override void Initialize () {
// TODO: Add your initialization logic here // TODO: Add your initialization logic here
base.Initialize(); base.Initialize();
} }
protected override void LoadContent () { protected override void LoadContent () {
bool useNormalmapShader = false; bool useNormalmapShader = false;
Effect spineEffect; Effect spineEffect;
if (!useNormalmapShader) { if (!useNormalmapShader) {
// Two color tint effect. Note that you can also use the default BasicEffect instead. // Two color tint effect. Note that you can also use the default BasicEffect instead.
spineEffect = Content.Load<Effect>("spine-xna-example-content\\SpineEffect"); spineEffect = Content.Load<Effect>("spine-xna-example-content\\SpineEffect");
} else { } else {
spineEffect = Content.Load<Effect>("spine-xna-example-content\\SpineEffectNormalmap"); spineEffect = Content.Load<Effect>("spine-xna-example-content\\SpineEffectNormalmap");
spineEffect.Parameters["Light0_Direction"].SetValue(new Vector3(-0.5265408f, 0.5735765f, -0.6275069f)); spineEffect.Parameters["Light0_Direction"].SetValue(new Vector3(-0.5265408f, 0.5735765f, -0.6275069f));
spineEffect.Parameters["Light0_Diffuse"].SetValue(new Vector3(1, 0.9607844f, 0.8078432f)); spineEffect.Parameters["Light0_Diffuse"].SetValue(new Vector3(1, 0.9607844f, 0.8078432f));
spineEffect.Parameters["Light0_Specular"].SetValue(new Vector3(1, 0.9607844f, 0.8078432f)); spineEffect.Parameters["Light0_Specular"].SetValue(new Vector3(1, 0.9607844f, 0.8078432f));
spineEffect.Parameters["Light0_SpecularExponent"].SetValue(2.0f); spineEffect.Parameters["Light0_SpecularExponent"].SetValue(2.0f);
} }
spineEffect.Parameters["World"].SetValue(Matrix.Identity); spineEffect.Parameters["World"].SetValue(Matrix.Identity);
spineEffect.Parameters["View"].SetValue(Matrix.CreateLookAt(new Vector3(0.0f, 0.0f, 1.0f), Vector3.Zero, Vector3.Up)); spineEffect.Parameters["View"].SetValue(Matrix.CreateLookAt(new Vector3(0.0f, 0.0f, 1.0f), Vector3.Zero, Vector3.Up));
skeletonRenderer = new SkeletonRenderer(GraphicsDevice); skeletonRenderer = new SkeletonRenderer(GraphicsDevice);
skeletonRenderer.PremultipliedAlpha = false; skeletonRenderer.PremultipliedAlpha = false;
skeletonRenderer.Effect = spineEffect; skeletonRenderer.Effect = spineEffect;
skeletonDebugRenderer = new SkeletonDebugRenderer(GraphicsDevice); skeletonDebugRenderer = new SkeletonDebugRenderer(GraphicsDevice);
skeletonDebugRenderer.DisableAll(); skeletonDebugRenderer.DisableAll();
skeletonDebugRenderer.DrawClipping = true; skeletonDebugRenderer.DrawClipping = true;
//String name = "spineboy-pro"; //String name = "spineboy-pro";
String name = "raptor-pro"; String name = "raptor-pro";
// String name = "tank-pro"; // String name = "tank-pro";
//String name = "coin-pro"; //String name = "coin-pro";
if (useNormalmapShader) if (useNormalmapShader)
name = "raptor-pro"; // we only have normalmaps for raptor name = "raptor-pro"; // we only have normalmaps for raptor
String atlasName = name.Replace("-pro", "").Replace("-ess", ""); String atlasName = name.Replace("-pro", "").Replace("-ess", "");
bool binaryData = name.Contains("spineboy"); bool binaryData = name.Contains("spineboy");
Atlas atlas; Atlas atlas;
if (!useNormalmapShader) { if (!useNormalmapShader) {
atlas = new Atlas(assetsFolder + atlasName + ".atlas", new XnaTextureLoader(GraphicsDevice)); atlas = new Atlas(assetsFolder + atlasName + ".atlas", new XnaTextureLoader(GraphicsDevice));
} else { } else {
atlas = new Atlas(assetsFolder + atlasName + ".atlas", new XnaTextureLoader(GraphicsDevice, atlas = new Atlas(assetsFolder + atlasName + ".atlas", new XnaTextureLoader(GraphicsDevice,
loadMultipleTextureLayers: true, textureSuffixes: new string[] { "", "_normals" })); loadMultipleTextureLayers: true, textureSuffixes: new string[] { "", "_normals" }));
} }
float scale = 1; float scale = 1;
if (name == "spineboy-pro") scale = 0.6f; if (name == "spineboy-pro") scale = 0.6f;
if (name == "raptor-pro") scale = 0.5f; if (name == "raptor-pro") scale = 0.5f;
if (name == "tank-pro") scale = 0.3f; if (name == "tank-pro") scale = 0.3f;
if (name == "coin-pro") scale = 1; if (name == "coin-pro") scale = 1;
SkeletonData skeletonData; SkeletonData skeletonData;
if (binaryData) { if (binaryData) {
SkeletonBinary binary = new SkeletonBinary(atlas); SkeletonBinary binary = new SkeletonBinary(atlas);
binary.Scale = scale; binary.Scale = scale;
skeletonData = binary.ReadSkeletonData(assetsFolder + name + ".skel"); skeletonData = binary.ReadSkeletonData(assetsFolder + name + ".skel");
} else { } else {
SkeletonJson json = new SkeletonJson(atlas); SkeletonJson json = new SkeletonJson(atlas);
json.Scale = scale; json.Scale = scale;
skeletonData = json.ReadSkeletonData(assetsFolder + name + ".json"); skeletonData = json.ReadSkeletonData(assetsFolder + name + ".json");
} }
skeleton = new Skeleton(skeletonData); skeleton = new Skeleton(skeletonData);
if (name == "goblins-pro") skeleton.SetSkin("goblin"); if (name == "goblins-pro") skeleton.SetSkin("goblin");
// Define mixing between animations. // Define mixing between animations.
AnimationStateData stateData = new AnimationStateData(skeleton.Data); AnimationStateData stateData = new AnimationStateData(skeleton.Data);
state = new AnimationState(stateData); state = new AnimationState(stateData);
if (name == "spineboy-pro") { if (name == "spineboy-pro") {
skeleton.SetAttachment("head-bb", "head"); skeleton.SetAttachment("head-bb", "head");
stateData.SetMix("run", "jump", 0.2f); stateData.SetMix("run", "jump", 0.2f);
stateData.SetMix("jump", "run", 0.4f); stateData.SetMix("jump", "run", 0.4f);
// Event handling for all animations. // Event handling for all animations.
state.Start += Start; state.Start += Start;
state.End += End; state.End += End;
state.Complete += Complete; state.Complete += Complete;
state.Event += Event; state.Event += Event;
state.SetAnimation(0, "run", true); state.SetAnimation(0, "run", true);
TrackEntry entry = state.AddAnimation(0, "jump", false, 0); TrackEntry entry = state.AddAnimation(0, "jump", false, 0);
entry.End += End; // Event handling for queued animations. entry.End += End; // Event handling for queued animations.
state.AddAnimation(0, "run", true, 0); state.AddAnimation(0, "run", true, 0);
} else if (name == "raptor-pro") { } else if (name == "raptor-pro") {
state.SetAnimation(0, "walk", true); state.SetAnimation(0, "walk", true);
state.AddAnimation(1, "gun-grab", false, 2); state.AddAnimation(1, "gun-grab", false, 2);
} else if (name == "coin-pro") { } else if (name == "coin-pro") {
state.SetAnimation(0, "animation", true); state.SetAnimation(0, "animation", true);
} else if (name == "tank-pro") { } else if (name == "tank-pro") {
skeleton.X += 300; skeleton.X += 300;
state.SetAnimation(0, "drive", true); state.SetAnimation(0, "drive", true);
} else { } else {
state.SetAnimation(0, "walk", true); state.SetAnimation(0, "walk", true);
} }
skeleton.X += 400; skeleton.X += 400;
skeleton.Y += GraphicsDevice.Viewport.Height; skeleton.Y += GraphicsDevice.Viewport.Height;
skeleton.UpdateWorldTransform(); skeleton.UpdateWorldTransform();
headSlot = skeleton.FindSlot("head"); headSlot = skeleton.FindSlot("head");
} }
protected override void UnloadContent () { protected override void UnloadContent () {
// TODO: Unload any non ContentManager content here // TODO: Unload any non ContentManager content here
} }
protected override void Update (GameTime gameTime) { protected override void Update (GameTime gameTime) {
// TODO: Add your update logic here // TODO: Add your update logic here
#if (!WINDOWS_STOREAPP || WINDOWS_PHONE81) && !IOS #if (!WINDOWS_STOREAPP || WINDOWS_PHONE81) && !IOS
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit(); this.Exit();
#endif #endif
base.Update(gameTime); base.Update(gameTime);
} }
protected override void Draw (GameTime gameTime) { protected override void Draw (GameTime gameTime) {
GraphicsDevice.Clear(Color.Black); GraphicsDevice.Clear(Color.Black);
state.Update((float)(gameTime.ElapsedGameTime.TotalMilliseconds / 1000.0)); state.Update((float)(gameTime.ElapsedGameTime.TotalMilliseconds / 1000.0));
state.Apply(skeleton); state.Apply(skeleton);
skeleton.UpdateWorldTransform(); skeleton.UpdateWorldTransform();
if (skeletonRenderer.Effect is BasicEffect) { if (skeletonRenderer.Effect is BasicEffect) {
((BasicEffect)skeletonRenderer.Effect).Projection = Matrix.CreateOrthographicOffCenter(0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0, 1, 0); ((BasicEffect)skeletonRenderer.Effect).Projection = Matrix.CreateOrthographicOffCenter(0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0, 1, 0);
} else { } else {
skeletonRenderer.Effect.Parameters["Projection"].SetValue(Matrix.CreateOrthographicOffCenter(0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0, 1, 0)); skeletonRenderer.Effect.Parameters["Projection"].SetValue(Matrix.CreateOrthographicOffCenter(0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0, 1, 0));
} }
skeletonRenderer.Begin(); skeletonRenderer.Begin();
skeletonRenderer.Draw(skeleton); skeletonRenderer.Draw(skeleton);
skeletonRenderer.End(); skeletonRenderer.End();
skeletonDebugRenderer.Effect.Projection = Matrix.CreateOrthographicOffCenter(0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0, 1, 0); skeletonDebugRenderer.Effect.Projection = Matrix.CreateOrthographicOffCenter(0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0, 1, 0);
skeletonDebugRenderer.Begin(); skeletonDebugRenderer.Begin();
skeletonDebugRenderer.Draw(skeleton); skeletonDebugRenderer.Draw(skeleton);
skeletonDebugRenderer.End(); skeletonDebugRenderer.End();
bounds.Update(skeleton, true); bounds.Update(skeleton, true);
MouseState mouse = Mouse.GetState(); MouseState mouse = Mouse.GetState();
if (headSlot != null) { if (headSlot != null) {
headSlot.G = 1; headSlot.G = 1;
headSlot.B = 1; headSlot.B = 1;
if (bounds.AabbContainsPoint(mouse.X, mouse.Y)) { if (bounds.AabbContainsPoint(mouse.X, mouse.Y)) {
BoundingBoxAttachment hit = bounds.ContainsPoint(mouse.X, mouse.Y); BoundingBoxAttachment hit = bounds.ContainsPoint(mouse.X, mouse.Y);
if (hit != null) { if (hit != null) {
headSlot.G = 0; headSlot.G = 0;
headSlot.B = 0; headSlot.B = 0;
} }
} }
} }
base.Draw(gameTime); base.Draw(gameTime);
} }
public void Start (TrackEntry entry) { public void Start (TrackEntry entry) {
#if !WINDOWS_STOREAPP #if !WINDOWS_STOREAPP
Console.WriteLine(entry + ": start"); Console.WriteLine(entry + ": start");
#endif #endif
} }
public void End (TrackEntry entry) { public void End (TrackEntry entry) {
#if !WINDOWS_STOREAPP #if !WINDOWS_STOREAPP
Console.WriteLine(entry + ": end"); Console.WriteLine(entry + ": end");
#endif #endif
} }
public void Complete (TrackEntry entry) { public void Complete (TrackEntry entry) {
#if !WINDOWS_STOREAPP #if !WINDOWS_STOREAPP
Console.WriteLine(entry + ": complete "); Console.WriteLine(entry + ": complete ");
#endif #endif
} }
public void Event (TrackEntry entry, Event e) { public void Event (TrackEntry entry, Event e) {
#if !WINDOWS_STOREAPP #if !WINDOWS_STOREAPP
Console.WriteLine(entry + ": event " + e); Console.WriteLine(entry + ": event " + e);
#endif #endif
} }
} }
} }