metaforce/Runtime/Graphics/CGX.cpp

34 lines
1.1 KiB
C++
Raw Normal View History

#include "CGX.hpp"
#include "Graphics/CTexture.hpp"
namespace metaforce::CGX {
SGXState sGXState{};
2022-07-29 20:16:55 +00:00
std::array<GXVtxDescList, 12> sVtxDescList{};
void ResetGXStates() noexcept {
sGXState.x48_descList = 0;
GXClearVtxDesc();
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)) {
CTexture::InvalidateTexMap(id);
}
2022-07-29 20:16:55 +00:00
for (GXTevKColorID id = GX_KCOLOR0; const auto& item : sGXState.x58_kColors) {
GXSetTevKColor(id, item);
2022-07-29 20:16:55 +00:00
id = static_cast<GXTevKColorID>(id + 1);
}
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);
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)) {
SetTevDirect(id);
}
// GXSetTexCoordCylWrap
// GXSetZTexture
}
} // namespace metaforce::CGX