2022-03-12 15:47:20 +00:00
|
|
|
#include "CGX.hpp"
|
|
|
|
|
|
|
|
#include "Graphics/CTexture.hpp"
|
|
|
|
|
|
|
|
namespace metaforce::CGX {
|
2022-03-19 17:30:25 +00:00
|
|
|
SGXState sGXState{};
|
2022-07-29 20:16:55 +00:00
|
|
|
std::array<GXVtxDescList, 12> sVtxDescList{};
|
2022-03-12 15:47:20 +00:00
|
|
|
|
|
|
|
void ResetGXStates() noexcept {
|
2022-03-19 17:30:25 +00:00
|
|
|
sGXState.x48_descList = 0;
|
|
|
|
GXClearVtxDesc();
|
2022-03-12 15:47:20 +00:00
|
|
|
sGXState.x0_arrayPtrs.fill(nullptr);
|
2022-07-29 20:16:55 +00:00
|
|
|
for (GXTexMapID id = GX_TEXMAP0; id < GX_MAX_TEXMAP; id = static_cast<GXTexMapID>(id + 1)) {
|
2022-03-12 15:47:20 +00:00
|
|
|
CTexture::InvalidateTexMap(id);
|
|
|
|
}
|
2022-07-29 20:16:55 +00:00
|
|
|
for (GXTevKColorID id = GX_KCOLOR0; const auto& item : sGXState.x58_kColors) {
|
2022-03-12 15:47:20 +00:00
|
|
|
GXSetTevKColor(id, item);
|
2022-07-29 20:16:55 +00:00
|
|
|
id = static_cast<GXTevKColorID>(id + 1);
|
2022-03-12 15:47:20 +00:00
|
|
|
}
|
2022-07-29 20:16:55 +00:00
|
|
|
GXSetTevSwapModeTable(GX_TEV_SWAP1, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_RED);
|
|
|
|
GXSetTevSwapModeTable(GX_TEV_SWAP2, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_GREEN);
|
|
|
|
GXSetTevSwapModeTable(GX_TEV_SWAP3, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_BLUE);
|
|
|
|
SetAlphaCompare(GX_ALWAYS, 0, GX_AOP_AND, GX_ALWAYS, 0);
|
|
|
|
GXSetCurrentMtx(GX_PNMTX0);
|
2022-03-12 15:47:20 +00:00
|
|
|
SetNumIndStages(0);
|
|
|
|
// TODO GXSetIndTexCoordScale
|
2022-07-29 20:16:55 +00:00
|
|
|
for (GXTevStageID id = GX_TEVSTAGE0; id < GX_MAX_TEVSTAGE; id = static_cast<GXTevStageID>(id + 1)) {
|
2022-03-12 15:47:20 +00:00
|
|
|
SetTevDirect(id);
|
|
|
|
}
|
|
|
|
// GXSetTexCoordCylWrap
|
|
|
|
// GXSetZTexture
|
|
|
|
}
|
|
|
|
} // namespace metaforce::CGX
|