Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

XNA namespace build option #6

Open
wants to merge 2 commits into from

3 participants

Sérgio Estêvão Michael Hutchinson CodesInChaos
Sérgio Estêvão

Hi Michael,

Can you tell me if you plan to accept my fork changes that implement a XNA namespace replacement option.
This is useful for projects that use the XNA math but want' to be cross platform ( Mono).

Thanks,

Sérgio

XTZGZoReX and others added some commits
XTZGZoReX This formula for SmoothStep seems to be more correct. d01c717
Sergio Estevao Added ifdef for XNA namespace replacement.
Added several implementatios for utility methods.
5c24517
Michael Hutchinson
Owner
mhutch commented

The goal of Mono.GameMath is to be a source-compatible superset of the XNA maths classes. Since it's source-compatible, not binary-compatible, any code that uses it will have to be recompiled, so it IMO would make more sense to put the namespace #ifdefs in the consuming code. If you're looking for binary compatibility, I'd suggest MonoGame or MonoXNA.

Your other changes would be very useful though, so if you can separate them into smaller patches I'd love to review and integrate them. Can you confirm that you haven't looked at decompiled XNA source code?

CodesInChaos

For me being source compatible implies that the consuming code doesn't need to be adapted. So I think the #ifs are useful in the implementing code.

And since his SmoothStep function is a separate commit you should be able to integrate it separately.

Sérgio Estêvão

I share the same opinion of CodeInChaos to be truly source compatible the consuming code shouldn't be changed. My test case for the MonoGameMath library was using it in JibLibX library. It wasn't feasible to change all the JigLibX to use the new namespace.

Regarding the code it was based on the MonoGame, MonoXNA, and the Axiom Math library.

Michael Hutchinson
Owner

1) If I read this correctly, it seems to be just the addition of a Clamp, and factoring out of a Lerp. Since those are both trivial functions and the JIT does a poor job of inlining, I'd prefer to have them inlined here (in particular, a clamp should be little more than two x86 instructions - Max and Min are intrinsics).

2) The Clamp change should be made to all the other SmoothStep functions too.

Michael Hutchinson
Owner
mhutch commented

You're technically correct, but the other problem with changing the namespace is that it requires having an alternative version of all of the assemblies. So "Mono.GameMath" is still not truly source-compatible, but "MonoGameMath (XNA-namespaced variant)" is. I'll accept the defines, but instead of adding configurations I'd prefer to have a separate library project called Mono.GameMath.XnaCompat (it can simply Mono.GameMath and override some properties). I can do that part if you want.

Regarding SmoothStep, I commented directly on that commit. Regarding the other code, I would prefer if any that was sourced from other places had a comment attributing the source and stating the license.

CodesInChaos

I think an alternate version of the library that's used for XNA compatibility is a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 2 authors.

Jan 22, 2011
XTZGZoReX This formula for SmoothStep seems to be more correct. d01c717
Mar 10, 2011
Sergio Estevao Added ifdef for XNA namespace replacement.
Added several implementatios for utility methods.
5c24517
Something went wrong with that request. Please try again.