Fix endianness & 64-bit in 3D asset loading code

Combination of plumbing BE(T) through everything, making BE<T> have template specializations, and inverting at load time where more practical.
This commit is contained in:
PJB3005
2026-02-25 20:20:45 +01:00
parent 31149794f1
commit e7861f1ee3
32 changed files with 830 additions and 553 deletions
+23
View File
@@ -0,0 +1,23 @@
#include <dolphin/gx.h>
#include "dusk/endian.h"
template <>
GXColorS10 BE<GXColorS10>::swap(GXColorS10 val) {
return {
be16s(val.r),
be16s(val.g),
be16s(val.b),
be16s(val.a),
};
}
#define IMPL_ENUM(type) \
template <> \
type BE<type>::swap(type val) { \
return static_cast<type>(be32(val)); \
}
IMPL_ENUM(GXCullMode);
IMPL_ENUM(GXAttr);
IMPL_ENUM(GXAttrType);
IMPL_ENUM(GXCompType);