openfl / box2d

Haxe port of Box2D, a popular rigid-body 2D physics engine
Other
95 stars 28 forks source link

Compilation fails on neko #5

Closed drkibitz closed 9 years ago

drkibitz commented 10 years ago

Using the openfl-sample SimpleBox2D https://github.com/openfl/openfl-samples/issues/8. This is the result from test with Haxe 3.0.1 and Neko 2.0.0 on a Mac 64.

$ openfl test neko
Called from box2D/common/B2Settings.hx line 72
Uncaught exception - Invalid operation (*)
drkibitz commented 10 years ago

@jgranick Ok, I did a little digging, but first I have a question. How are you maintaining this library? Is it a manual port or is it transpiled? I'm asking because making specific changes will make it much harder to maintain if it is the latter :/

So my findings are, that first compilation error is just an order of definitions issue. Line 72 just doesn't know about the constant it is using yet.

After fixing this, there are numerous runtime errors, that I have seemed to boil down to one simple thing. This library is expecting null to be coerced to 0 in quite a few operations involving mainly bitmasks and increments from what I can see.

I just kept stomping them and making sure a 0 was defined where these operations failed with null.

With that the openfl sample works on neko.

Your thoughts?

drkibitz commented 10 years ago

Since I'm new to the party, I'm not sure if this is a recent change in Neko, or in Haxe targeting Neko. But it does seem like a weird change :/

jgranick commented 10 years ago

This was a manual conversion, so all (or any) Neko fixes would be greatly appreciated!

jgranick commented 9 years ago

Box2D works on Neko in my tests, but if you have any more problems, please report them. Thank you! :wink: