Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon


11. May 2012

 

Alright, I have been programming long enough I shouldn’t have made this mistake, but… I did.  In the comments section for Working with Spritesheets, there were a couple comments about being unable to run on the device.  I swore when I was testing this I ran it on my actual Vita, but apparently I did not.

 

I really should have, because frankly it doesn’t work.  It just hangs and makes your Vita extremely unhappy with you in the process.  Running it through the debugger, I found it was dying a hideous death on this line:

XDocument doc = XDocument.Load ("application/" + imageDetailsFilename);

 

Hmm, nothing out of the ordinary there.  So off to Google I go!  Ends up that this is a bug in the SDK, welcome to the wonderful world of beta software!  From the same thread, the fix is fairly straight forward.  In Walker.cs change the beginning of the constructor to look like this:

 

//XDocument doc = XDocument.Load ("application/" + imageDetailsFilename); FileStream fileStream = File.Open( "/Application/" + imageDetailsFilename,FileMode.Open); StreamReader fileStreamReader = new StreamReader(fileStream); string xml = fileStreamReader.ReadToEnd(); fileStreamReader.Close(); fileStream.Close(); XDocument doc = XDocument.Parse(xml);

 

You will also need to add SYstem.IO to your using declarations. Now everything will work fine when deployed to an actual Vita.  Hopefully Sony fix the bug in Xdocument.Load soon.

 

 

In the future I will make sure I test all tutorials on my device before pushing them live!

Programming , ,

blog comments powered by Disqus

Month List

Popular Comments