@All
If anyone in interst Corto fix whole loader to works on big_endian with -O3. Through it works only with latest Salas00 version of get_unaligned_le_float:
static inline float get_unaligned_le_float(const u8 *ptr)
{
union {
u8 u[4];
float f;
} tmp;
#ifdef __BIG_ENDIAN__
tmp.u[0] = ptr[3];
tmp.u[1] = ptr[2];
tmp.u[2] = ptr[1];
tmp.u[3] = ptr[0];
#else
tmp.u = *(float*)ptr;
#endif
return tmp.f;
}
Because once we just use only "union" version in the middle of the code, seems compiler optimize it wrongly anyway. So we had to move it at top (where structures placed) as well.
So, there is final version with Corto's added padding and some code modifications to make it all works, and Salas00's get_unaligned_le_float():
http://kas1e.mikendezign.com/aos4/irr ... DMeshFileLoader_fixed.cpp(see pad[] things in structures at top, etc)
Also there is some test compiled to try it out on x1000 or sam on on other x5000, to be sure that all works fine on any big-endian machine, plz try it:
http://kas1e.mikendezign.com/aos4/irrlicht/ms3dtest.lhaUnpack it to any place, run form shell, it will give list of drivers to choice , choice "a" (opengl).
Then in the test itself, choice in menu via mouse "File / Open Model & Texture". There choice from directory "ms3d" any model you want to test: zombie, farma2 or gun. In that directory you need to choice ".ms3d" file to load, so it will load mesh and associated images with (for sake of fun in "gun" one, you can also choice to load "hud.x").
If someone can test if all works on x1000 and on sam460 and on tabor, that will mean that big-endian changes are fine.
Thanks !
Edited by kas1e on 2019/11/17 12:34:03