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-03-20 20:52:07 +00:00
|
|
|
std::array<GX::VtxDescList, 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);
|
|
|
|
for (GX::TexMapID id = GX::TEXMAP0; id < GX::MAX_TEXMAP; id = static_cast<GX::TexMapID>(id + 1)) {
|
|
|
|
CTexture::InvalidateTexMap(id);
|
|
|
|
}
|
|
|
|
for (GX::TevKColorID id = GX::KCOLOR0; const auto& item : sGXState.x58_kColors) {
|
|
|
|
GXSetTevKColor(id, item);
|
|
|
|
id = static_cast<GX::TevKColorID>(id + 1);
|
|
|
|
}
|
2022-03-19 17:30:25 +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);
|
2022-03-12 15:47:20 +00:00
|
|
|
SetAlphaCompare(GX::ALWAYS, 0, GX::AOP_AND, GX::ALWAYS, 0);
|
|
|
|
// GXSetCurrentMtx(0);
|
|
|
|
SetNumIndStages(0);
|
|
|
|
// TODO GXSetIndTexCoordScale
|
|
|
|
for (GX::TevStageID id = GX::TEVSTAGE0; id < GX::MAX_TEVSTAGE; id = static_cast<GX::TevStageID>(id + 1)) {
|
|
|
|
SetTevDirect(id);
|
|
|
|
}
|
|
|
|
// GXSetTexCoordCylWrap
|
|
|
|
// GXSetZTexture
|
|
|
|
}
|
|
|
|
} // namespace metaforce::CGX
|