Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spritekit] Update for Xcode 9 beta 1, 2 & 3 #2331

Merged
merged 6 commits into from
Jul 19, 2017

Conversation

VincentDondain
Copy link
Contributor

  • Added Quaternion support to XI runtime (simd_quatf).

- Added Quaternion support to XI runtime (simd_quatf).
@monojenkins
Copy link
Collaborator

Build failure

Copy link
Member

@dalexsoto dalexsoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if changing parameter names is considered a breaking change (question for @spouliot) but if we allow it, we should also include the unit of measure in the new parameter name

Make.config Outdated
@@ -60,7 +60,7 @@ MIN_MONO_URL=https://bosstoragemirror.blob.core.windows.net/wrench/mono-2017-04/
# Minimum Visual Studio version
MIN_VISUAL_STUDIO_URL=https://bosstoragemirror.blob.core.windows.net/wrench/monodevelop-lion-dogfood-vNext/8f/8f1c13cb983138ee63bd53e09908ea5e737988cd/VisualStudioForMac-Preview-7.0.0.2728.dmg
MIN_VISUAL_STUDIO_VERSION=7.0.0.2728
MAX_VISUAL_STUDIO_VERSION=7.2.99
MAX_VISUAL_STUDIO_VERSION=7.3.99
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required? I think we should keep the same as 15.3 unless we require this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message says that we can bump whenever we test with a more recent version and it works (:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I completely agree when you are not in a release branch but I think that message is more intended for master

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already not the same version as the d15.3 branch, I really think it doesn't matter: https://github.com/xamarin/xamarin-macios/blob/d15-3/Make.config#L63

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think you changed that in the first Xcode9 bump 24cd73a#diff-f682ea58f8badb13b9f8ed17cda4deb7R63 but yeah I think it does not matter much at this point unless we really want to be close to dev 15.3

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change itself is fine, but should go in a different PR, it has nothing to do with sprite kit 😄

src/spritekit.cs Outdated
@@ -1954,28 +1991,28 @@ partial interface SKAction : NSCoding, NSCopying {

// These are in a category
[Static, Export ("moveByX:y:duration:")]
SKAction MoveBy (nfloat deltaX, nfloat deltaY, double sec);
SKAction MoveBy (nfloat deltaX, nfloat deltaY, double duration);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spouliot is this a breaking change? I am in favor of the change if we can allow it but @VincentDondain I would use durationInSeconds instead if seconds is the unit of measure of duration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmh API diff considers this a breaking change. I don't really understand why it would be one...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because you can do

var action = MoveBy (deltaX: 1, deltaY: 2, sec: 100);

If anyone had the above code you will break them

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I still consider this is a good one, it really helps to better understand the API and even more if we add the measurement unit to the parameter name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aaaaaah you're right, I didn't think about that, I never name anything explicitly in C# :P

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a breakage change and it's less clear than (already less than perfect) sec, please keep the existing name.

src/spritekit.cs Outdated

[Static, Export ("moveBy:duration:")]
SKAction MoveBy (CGVector delta, double duration);

[Static, Export ("moveTo:duration:")]
SKAction MoveTo (CGPoint location, double sec);
SKAction MoveTo (CGPoint location, double duration);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

src/spritekit.cs Outdated

[Static, Export ("moveToX:duration:")]
SKAction MoveToX (nfloat x, double sec);
SKAction MoveToX (nfloat x, double duration);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

src/spritekit.cs Outdated

[Static, Export ("moveToY:duration:")]
SKAction MoveToY (nfloat y, double sec);
SKAction MoveToY (nfloat y, double duration);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

src/spritekit.cs Outdated

[iOS (8,0), Mac(10,10)]
[Static, Export ("reachTo:rootNode:velocity:")]
SKAction ReachTo (CGPoint position, SKNode rootNode, nfloat velocity);

[iOS (8,0), Mac(10,10)]
[Static, Export ("reachToNode:rootNode:duration:")]
SKAction ReachToNode (SKNode node, SKNode rootNode, double sec);
SKAction ReachToNode (SKNode node, SKNode rootNode, double duration);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

src/spritekit.cs Outdated

[iOS (8,0), Mac(10,10)]
[Static, Export ("reachToNode:rootNode:velocity:")]
SKAction ReachToNode (SKNode node, SKNode rootNode, nfloat velocity);

[iOS (8,0), Mac (10,10)] // this method is missing the NS_AVAILABLE macro, but it shows up in the 10.10 sdk, but not the 10.9 sdk.
[Static, Export ("strengthTo:duration:")]
SKAction StrengthTo (float /* float, not CGFloat */ strength, double sec);
SKAction StrengthTo (float /* float, not CGFloat */ strength, double duration);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

src/spritekit.cs Outdated

[iOS (8,0), Mac (10,10)] // this method is missing the NS_AVAILABLE macro, but it shows up in the 10.10 sdk, but not the 10.9 sdk.
[Static, Export ("strengthBy:duration:")]
SKAction StrengthBy (float /* float, not CGFloat */ strength, double sec);
SKAction StrengthBy (float /* float, not CGFloat */ strength, double duration);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

src/spritekit.cs Outdated
@@ -2150,7 +2187,7 @@ partial interface SKAction : NSCoding, NSCopying {
[iOS (8,0), Mac(10,10)]
[Static]
[Export ("falloffTo:duration:")]
SKAction FalloffTo (float falloff, double sec);
SKAction FalloffTo (float falloff, double duration);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

src/spritekit.cs Outdated
void Render (CGRect viewport, IMTLRenderCommandEncoder renderCommandEncoder, MTLRenderPassDescriptor renderPassDescriptor, IMTLCommandQueue commandQueue);

[Export ("updateAtTime:")]
void UpdateAtTime (double currentTime);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just Update?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. 👍

Copy link
Contributor

@spouliot spouliot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not mix new bindings with other changes. If needed they should be in separate PR.

Also make sure the tests are run on devices before committing (simd stuff can behave differently).

Comment = " // void func (Quaternion)",
Prefix = "simd__",
Variants = Variants.NonStret,
Parameters = new ParameterData[] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: space before []

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Copied it from code above :P

src/spritekit.cs Outdated
@@ -1954,28 +1991,28 @@ partial interface SKAction : NSCoding, NSCopying {

// These are in a category
[Static, Export ("moveByX:y:duration:")]
SKAction MoveBy (nfloat deltaX, nfloat deltaY, double sec);
SKAction MoveBy (nfloat deltaX, nfloat deltaY, double duration);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a breakage change and it's less clear than (already less than perfect) sec, please keep the existing name.

Vector3 V3;

using (var obj = new SKTransformNode ())
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: should be on the previous line

public void RotationMatrix ()
{
using (var obj = new SKTransformNode ())
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Quaternion Q;

using (var obj = new SKTransformNode ())
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same (the IDE should set it up properly, double check your settings and file a bug if set to mono style).

Make.config Outdated
@@ -60,7 +60,7 @@ MIN_MONO_URL=https://bosstoragemirror.blob.core.windows.net/wrench/mono-2017-04/
# Minimum Visual Studio version
MIN_VISUAL_STUDIO_URL=https://bosstoragemirror.blob.core.windows.net/wrench/monodevelop-lion-dogfood-vNext/8f/8f1c13cb983138ee63bd53e09908ea5e737988cd/VisualStudioForMac-Preview-7.0.0.2728.dmg
MIN_VISUAL_STUDIO_VERSION=7.0.0.2728
MAX_VISUAL_STUDIO_VERSION=7.2.99
MAX_VISUAL_STUDIO_VERSION=7.3.99
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change itself is fine, but should go in a different PR, it has nothing to do with sprite kit 😄

public void VersionCheck ()
{
if (!TestRuntime.CheckXcodeVersion (9,0))
Assert.Inconclusive ("Requires Xcode9+");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor (for next time): there's a one-liner for this:

TestRuntime.AssertXcodeVersion (9,0);

Asserts.AreEqual (Vector3.Zero, obj.EulerAngles, "1 EulerAngles");
V3 = new Vector3 (1, 2, 3);
obj.EulerAngles = V3;
Assert.AreEqual (-2.14159298f, obj.EulerAngles.X, "#x1");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're setting a vector of [1,2,3] and getting something back that looks like random numbers. Are you sure the test isn't finding a bug somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same values as native Swift example.

using (var obj = new SKTransformNode ())
{
obj.RotationMatrix = Matrix3.Zero;
Asserts.AreEqual (Matrix3.Identity, obj.RotationMatrix, "RotationMatrix");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: setting Matrix3.Zero, and getting back Matrix3.Identity. This doesn't look random, but it still looks strange (so I'd test with Xcode, and added a comment about it).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with Xcode already (found that weird too), same behavior. I'll add a comment that it does the same thing with native code.

@monojenkins
Copy link
Collaborator

Build failure

@monojenkins
Copy link
Collaborator

Build failure

1 similar comment
@monojenkins
Copy link
Collaborator

Build failure

@VincentDondain
Copy link
Contributor Author

introspection and monotouch tests ran on device, both pass.

Copy link
Member

@dalexsoto dalexsoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor stuff, but 👍 once fixed

src/spritekit.cs Outdated
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
interface SKRenderer
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Brace should be on the above line

src/spritekit.cs Outdated
[TV (11,0), Watch (4,0), Mac (13,0), iOS (11,0)]
[BaseType (typeof(SKNode))]
interface SKTransformNode
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Brace should be on the above line

@monojenkins
Copy link
Collaborator

Build failure

@VincentDondain
Copy link
Contributor Author

Unrelated test failure: https://bugzilla.xamarin.com/show_bug.cgi?id=55719

@VincentDondain VincentDondain merged commit 49b020e into xamarin:xcode9 Jul 19, 2017
@VincentDondain VincentDondain deleted the spritekit-b3 branch July 19, 2017 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants