Files
dusklight/src/dusk/endian.cpp
T
PJB3005 4213b055ea Make GXVtxDescList and GXVtxAttrFmtList not be behind BE
Fixes a stub call because we couldn't pass the BE form to the API
2026-02-27 01:04:44 +01:00

42 lines
879 B
C++

#include <dolphin/gx.h>
#include "dusk/endian.h"
#include "dusk/endian_gx.hpp"
#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);
IMPL_ENUM(GXCompCnt);
template <>
GXColorS10 BE<GXColorS10>::swap(GXColorS10 val) {
return {
be16s(val.r),
be16s(val.g),
be16s(val.b),
be16s(val.a),
};
}
GXVtxDescList BE<GXVtxDescList>::swap(GXVtxDescList val) {
return {
BE<GXAttr>::swap(val.attr),
BE<GXAttrType>::swap(val.type),
};
}
GXVtxAttrFmtList BE<GXVtxAttrFmtList>::swap(GXVtxAttrFmtList val) {
return {
BE<GXAttr>::swap(val.attr),
BE<GXCompCnt>::swap(val.cnt),
BE<GXCompType>::swap(val.type),
val.frac
};
}