Game Developer Online |
|
The animated model code was the most difficult to upgrade. XNA 2.0 added not only added changes to the custom content pipeline, it also added stricter enforcement of how class or struct objects are declared. I will provide more details this weekend (May 25) but basically the animated model code would throw an error when launching on the Xbox 360.
For example, when declaring an array of class objects such as: CMyClass[] object You will get an error when running this code on the Xbox if it is done at the class level inside a content processor. The declaration must be done locally inside a method. To get around this I used ArrayLists to initialize the class object arrays from within methods. I also converted my structs to classes to make it cleaner but this is not necessary. To get everything working you also need to ensure your project name, namespace, and assembly references match up. Apparently I had the GetRunTimeReader() method which makes references to these items wrong but it did actually work in the first releases so we never caught it. Here is a screenshot of the settings you'd need for Zarlag example. ![]() Also note, the content reader was moved to MD2.cs in the game project as XNA 2.0 does not allow you to include this in the content processor. The working animated model solutions are now included with the upgraded code. All code should work on the Xbox 360 or PC in version 2.0. |