openfl / away3d

An open source, real-time 3D engine for OpenFL
Apache License 2.0
206 stars 34 forks source link

AWD files are broken on native platforms #13

Closed TerryCavanagh closed 7 years ago

TerryCavanagh commented 7 years ago

Heya,

Recently updated to the latest OpenFL and Away3D versions. Previously, I had been able to load .awd files without any problems in native builds. As of the current versions (away3d 5.0.3, openfl 6.1.0, lime 5.4.0), textures are no longer being loaded for awd files.

Here's a simple example which demonstrates the problem. It's a modified version of the Basic LoadAWD example without lighting and using a simple textured model: away3d_awdbug.zip

If I build this project in flash, I get the expected result, which is:

flash

However, on windows, I get an untextured version, like this:

cversion

TerryCavanagh commented 7 years ago

Tried doing some digging into this myself today, but, yeah, I'm totally out of my depth on this. Figured that it might be related to the endian stuff that came up in openfl 6.0, but messing with the endian values in away3d.loaders.awdparser didn't get me anywhere.

Greg209 commented 7 years ago

Ha. Beat me to it. Yes, the images aren't being detected due to endian issues. The fix might be more generic if added to the away3d.loaders.parsers.ImageParse.hx as any images will need the BIG_ENDIAN, not just AWD files.