WP7 XNA and accelerometer [FIXED]

Monkey Forums/Monkey Bug Reports/WP7 XNA and accelerometer [FIXED]

programmer(Posted 2013) [#1]
When launching a game on WP7 with "XNA_ACCELEROMETER_ENABLED=True" outside of Visual Studio, it randomly and silently shutdowns at startup.

The worst thing is that when launching a game in the Debug mode from Visual Studio, it never happens to be buggy. Only once I managed to catch the exception in the MotionEvent method. The exception was thrown because the MotionEvent method's _delegate field was null.

Has anyone ever encountered such problem?

Device: Nokia Lumia 610.
Monkey v72b.


marksibly(Posted 2013) [#2]
No, never had this problem, and a quick glance at the code suggests it *can't* happen! MotionEvent wont use the delegate unless started is true, and started wont be set to true if delegate is null. But of course, that doesn't mean it's NOT happening.

Will have a look at it eventually, but I'm currently having trouble building for Windows Phone 7 so I guess I'll be spending the rest of the day uninstalling/reinstalling first...


programmer(Posted 2013) [#3]
Is it possible to add global exception handler to XNA and display information about unhandled exceptions through the Guide.BeginShowMessageBox? If so, I would be able to report more accurately, what causes the problem.


marksibly(Posted 2013) [#4]
Could you give this a try...?

https://github.com/blitz-research/monkey/blob/develop/targets/xna/modules/native/xnagame.cs

You may also need to update to latest experimental monkey version.


programmer(Posted 2013) [#5]
No more random crashes so far! Thank you!