Open bartvanheukelom opened 10 years ago
I'd be tempted to log this to openfl instead... I cannot reproduce it in a non-openfl project with just neko + nape
class Main
{
static function main() {
var space = new nape.space.Space(nape.geom.Vec2.weak(0, 10));
var b = new nape.phys.Body();
b.shapes.add(new nape.shape.Circle(10));
b.space = space;
space.step(1/60);
trace(b.position.y);
}
}
haxe -x Main -lib nape
As you can see I've reported the issue with OpenFL. I'll soon test your code to see if the error is gone then on my machine as well.
Yes, your sample works here too.
I get this error when trying to run with Neko target:
AL lib: (EE) alc_cleanup: 1 device not closed
Called from zpp_nape/callbacks/CbType.hx line 348
Called from nape/callbacks/CbType.hx line 179
Called from nape/callbacks/CbType.hx line 198
Called from zpp_nape/callbacks/CbType.hx line 174
Called from zpp_nape/callbacks/CbType.hx line 353
Called from zpp_nape/ID.hx line 186
Uncaught exception - Invalid operation (+)
I put these two defines in my project.xml:
<haxedef name="NAPE_RELEASE_BUILD" />
<haxedef name="NAPE_NO_INLINE" if="neko"/>
Could you reproduce that without using openfl and it's build tools? This seems to stem from the ID.hx file which is basicly just a bunch of 'static var X_ID = 0;' lines not ending up in the compiled code, and with the integers initialised to null (hence the invalid operationr + error).
Well, here's a test project that initializes nape without openfl, it seems to work... but I need openfl and its build tools to make my games that use of Nape. So I'm still kinda sad, because Neko compiles much faster than cpp.
It might be a neko issue https://github.com/HaxeFoundation/neko/pull/14
It works. hehe..
<haxeflag name="-dce full" />
<!-- Optional -->
<haxedef name="NAPE_RELEASE_BUILD" />
haxe [3.1.3]
lime [0.9.7]
openfl-native [1.4.0]
nape [2.0.16]
As I mentioned in openfl/openfl#158, that flag doesn't resolve the issue for me, using all the same versions.
@deltaluca do you know why the static variables in ID.hx
are included in the compiled code for all other targets, but not Neko? Can you think of why OpenFL would cause this to happen?
There's no point investigating any further unless you build the latest neko with the lifted opcode limit as that is the reason for this problem. (OpenFL + Nape triggers it by being so damn huge paired together)
It doesn't work for me:
haxe [3.1.0]
lime [2.0.0]
open-fl [2.1.6]
nape [2.0.16]
I'm in the middle of a coding jam so I will do it with flash and loose all the neko debugging facility...
Just pointing out that I compile Neko from the GIT source and this does fix it for the example in the first post, however testing it on my game, the same error still occured.
Here my build of neko: http://test.failsafevault.com/files/neko-2.0.1-win.zip don't forget to replace the neko.dll in the bin folder
@starburst997, raise it with haxe/neko, if it's the exact same issue it may still be something on the lines of not having a large enough opcode size since presumably your game is more than a few lines of code ^^
Thanks, I'll try tweaking the values to allow more size
It appears something in Nape causes an error when running an OpenFL game with Neko.
Demo code:
This works fine. However, if you uncomment the
var space
line, the output is as follows:Am I doing something wrong or is this a Nape thing. If the latter, is it a bug or is Neko deliberately unsupported? Will it be fixed/added in the future? Thanks