mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-17 20:43:07 -04:00
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:
@@ -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);
|
||||
Reference in New Issue
Block a user