mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-12 13:35:35 -04:00
4213b055ea
Fixes a stub call because we couldn't pass the BE form to the API
42 lines
879 B
C++
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
|
|
};
|
|
}
|