From c883e5f1ac6882ffd161460fc9344a2cf0bc3520 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 15 Aug 2022 18:50:20 -0400 Subject: [PATCH] CTevCombiners: Discovered TEV pass names --- Runtime/Camera/CCameraFilter.cpp | 16 +++++++------- Runtime/Graphics/CSimpleShadow.cpp | 4 ++-- Runtime/Graphics/CTevCombiners.cpp | 32 ++++++++++++--------------- Runtime/Graphics/CTevCombiners.hpp | 24 ++++++++++---------- Runtime/GuiSys/CAuiEnergyBarT01.cpp | 4 ++-- Runtime/GuiSys/CAuiImagePane.cpp | 8 +++---- Runtime/GuiSys/CGuiFrame.cpp | 2 +- Runtime/GuiSys/CGuiPane.cpp | 2 +- Runtime/GuiSys/CHudRadarInterface.cpp | 2 +- Runtime/GuiSys/CScanDisplay.cpp | 2 +- Runtime/GuiSys/CSplashScreen.cpp | 4 ++-- Runtime/MP1/CFrontEndUI.cpp | 4 ++-- Runtime/MP1/CInGameGuiManager.cpp | 4 ++-- Runtime/MP1/World/COmegaPirate.cpp | 4 ++-- Runtime/MP1/World/CThardus.cpp | 4 ++-- Runtime/Particle/CElementGen.cpp | 22 ++++++++++-------- Runtime/World/CVisorFlare.cpp | 4 ++-- Runtime/World/CWorldShadow.cpp | 12 +++++----- 18 files changed, 77 insertions(+), 77 deletions(-) diff --git a/Runtime/Camera/CCameraFilter.cpp b/Runtime/Camera/CCameraFilter.cpp index 95cb8bec2..752aba7a6 100644 --- a/Runtime/Camera/CCameraFilter.cpp +++ b/Runtime/Camera/CCameraFilter.cpp @@ -182,8 +182,8 @@ void CCameraFilterPass::DrawFilterShape(EFilterShape shape, const zeus::CColor& void CCameraFilterPass::DrawFullScreenTexturedQuadQuarters(const zeus::CColor& color, CTexture* tex, float lod) { SCOPED_GRAPHICS_DEBUG_GROUP("CCameraFilterPass::DrawFullScreenTexturedQuadQuarters", zeus::skBlue); const auto [lt, rb] = g_Renderer->SetViewportOrtho(true, -4096.f, 4096.f); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); g_Renderer->SetDepthReadWrite(false, false); if (tex != nullptr) { tex->Load(GX_TEXMAP0, EClampMode::Repeat); @@ -215,8 +215,8 @@ void CCameraFilterPass::DrawFullScreenTexturedQuad(const zeus::CColor& color, CT if (tex != nullptr) { tex->Load(GX_TEXMAP0, EClampMode::Repeat); } - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); CGraphics::StreamBegin(GX_TRIANGLESTRIP); CGraphics::StreamColor(color); CGraphics::StreamTexcoord(u, v); @@ -240,12 +240,12 @@ void CCameraFilterPass::DrawRandomStatic(const zeus::CColor& color, float alpha, CGraphics::SetAlphaCompare(ERglAlphaFunc::GEqual, static_cast((1.f - alpha) * 255.f), ERglAlphaOp::And, ERglAlphaFunc::Always, 0); g_Renderer->SetDepthReadWrite(true, true); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); } else { g_Renderer->SetDepthReadWrite(false, false); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a6038); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulateColor); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); } // Upload random static texture (game reads from .text) diff --git a/Runtime/Graphics/CSimpleShadow.cpp b/Runtime/Graphics/CSimpleShadow.cpp index 7347e7dd9..f96dd24d3 100644 --- a/Runtime/Graphics/CSimpleShadow.cpp +++ b/Runtime/Graphics/CSimpleShadow.cpp @@ -34,8 +34,8 @@ void CSimpleShadow::Render(TLockedToken& tex) { CGraphics::SetModelMatrix(x0_xf); tex->Load(GX_TEXMAP0, EClampMode::Repeat); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); CGraphics::SetAlphaCompare(ERglAlphaFunc::Always, 0, ERglAlphaOp::And, ERglAlphaFunc::Always, 0); CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, false); CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha, diff --git a/Runtime/Graphics/CTevCombiners.cpp b/Runtime/Graphics/CTevCombiners.cpp index 9787881bc..bd5319a8b 100644 --- a/Runtime/Graphics/CTevCombiners.cpp +++ b/Runtime/Graphics/CTevCombiners.cpp @@ -21,51 +21,47 @@ constexpr u32 maxTevPasses = 2; static u32 sNumEnabledPasses; static std::array sValidPasses; -const CTevPass skPassThru{ +const CTevPass kEnvPassthru{ {GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_RASC}, {GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_RASA}, }; -const CTevPass sTevPass804bfcc0{ +const CTevPass kEnvBlendCTandCConCF{ {GX_CC_C0, GX_CC_TEXC, GX_CC_RASC, GX_CC_ZERO}, {GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_RASA}, }; -const CTevPass sTevPass804bfe68{ - {GX_CC_ZERO, GX_CC_CPREV, GX_CC_RASC, GX_CC_ZERO}, - {GX_CA_ZERO, GX_CA_APREV, GX_CA_RASA, GX_CA_ZERO}, -}; -const CTevPass sTevPass805a5698{ +const CTevPass kEnvModulateConstColor{ {GX_CC_ZERO, GX_CC_RASC, GX_CC_C0, GX_CC_ZERO}, {GX_CA_ZERO, GX_CA_RASA, GX_CA_A0, GX_CA_ZERO}, }; -const CTevPass sTevPass805a5e70{ +const CTevPass kEnvConstColor{ {GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_C0}, {GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_A0}, }; -const CTevPass sTevPass805a5ebc{ +const CTevPass kEnvModulate{ {GX_CC_ZERO, GX_CC_RASC, GX_CC_TEXC, GX_CC_ZERO}, {GX_CA_ZERO, GX_CA_RASA, GX_CA_TEXA, GX_CA_ZERO}, }; -const CTevPass sTevPass805a5f08{ +const CTevPass kEnvDecal{ {GX_CC_RASC, GX_CC_TEXC, GX_CC_TEXA, GX_CC_ZERO}, {GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_RASA}, }; -const CTevPass sTevPass805a5f54{ +const CTevPass kEnvBlend{ {GX_CC_RASC, GX_CC_ONE, GX_CC_TEXC, GX_CC_ZERO}, {GX_CA_ZERO, GX_CA_TEXA, GX_CA_RASA, GX_CA_ZERO}, }; -const CTevPass sTevPass805a5fa0{ +const CTevPass kEnvReplace{ {GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_TEXC}, {GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA}, }; -const CTevPass sTevPass805a5fec{ +const CTevPass kEnvModulateAlpha{ {GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_RASC}, {GX_CA_ZERO, GX_CA_TEXA, GX_CA_RASA, GX_CA_ZERO}, }; -const CTevPass sTevPass805a6038{ +const CTevPass kEnvModulateColor{ {GX_CC_ZERO, GX_CC_TEXC, GX_CC_RASC, GX_CC_ZERO}, {GX_CA_ZERO, GX_CA_KONST, GX_CA_RASA, GX_CA_ZERO}, }; -const CTevPass sTevPass805a6084{ +const CTevPass kEnvModulateColorByAlpha{ {GX_CC_ZERO, GX_CC_CPREV, GX_CC_APREV, GX_CC_ZERO}, {GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_APREV}, }; @@ -81,7 +77,7 @@ void Init() { } void SetupPass(ERglTevStage stage, const CTevPass& pass) { - if (pass == skPassThru) { + if (pass == kEnvPassthru) { DeletePass(stage); return; } @@ -92,7 +88,7 @@ void SetupPass(ERglTevStage stage, const CTevPass& pass) { } void DeletePass(ERglTevStage stage) { - SetPassCombiners(stage, skPassThru); + SetPassCombiners(stage, kEnvPassthru); sValidPasses[static_cast(stage)] = false; RecomputePasses(); } @@ -109,7 +105,7 @@ void RecomputePasses() { void ResetStates() { sValidPasses.fill(false); - skPassThru.Execute(ERglTevStage::Stage0); + kEnvPassthru.Execute(ERglTevStage::Stage0); sNumEnabledPasses = 1; CGX::SetNumTevStages(1); } diff --git a/Runtime/Graphics/CTevCombiners.hpp b/Runtime/Graphics/CTevCombiners.hpp index f83a85a1f..91087f25f 100644 --- a/Runtime/Graphics/CTevCombiners.hpp +++ b/Runtime/Graphics/CTevCombiners.hpp @@ -103,18 +103,18 @@ public: } }; -extern const CTevPass skPassThru; -extern const CTevPass sTevPass804bfcc0; -extern const CTevPass sTevPass804bfe68; -extern const CTevPass sTevPass805a5698; -extern const CTevPass sTevPass805a5e70; -extern const CTevPass sTevPass805a5ebc; -extern const CTevPass sTevPass805a5f08; -extern const CTevPass sTevPass805a5f54; -extern const CTevPass sTevPass805a5fa0; -extern const CTevPass sTevPass805a5fec; -extern const CTevPass sTevPass805a6038; -extern const CTevPass sTevPass805a6084; +extern const CTevPass kEnvPassthru; +// TODO move below to CGraphics +extern const CTevPass kEnvBlendCTandCConCF; +extern const CTevPass kEnvModulateConstColor; +extern const CTevPass kEnvConstColor; +extern const CTevPass kEnvModulate; +extern const CTevPass kEnvDecal; +extern const CTevPass kEnvBlend; +extern const CTevPass kEnvReplace; +extern const CTevPass kEnvModulateAlpha; +extern const CTevPass kEnvModulateColor; +extern const CTevPass kEnvModulateColorByAlpha; void Init(); void SetupPass(ERglTevStage stage, const CTevPass& pass); diff --git a/Runtime/GuiSys/CAuiEnergyBarT01.cpp b/Runtime/GuiSys/CAuiEnergyBarT01.cpp index 4d3a16fdc..f04696361 100644 --- a/Runtime/GuiSys/CAuiEnergyBarT01.cpp +++ b/Runtime/GuiSys/CAuiEnergyBarT01.cpp @@ -110,8 +110,8 @@ void CAuiEnergyBarT01::Draw(const CGuiWidgetDrawParms& drawParms) { } if (barOffT != barMaxT) { - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); xbc_tex->Load(GX_TEXMAP0, EClampMode::Repeat); CGraphics::StreamBegin(GX_TRIANGLESTRIP); CGraphics::StreamColor(useCol); diff --git a/Runtime/GuiSys/CAuiImagePane.cpp b/Runtime/GuiSys/CAuiImagePane.cpp index 29706cd84..870ca35fe 100644 --- a/Runtime/GuiSys/CAuiImagePane.cpp +++ b/Runtime/GuiSys/CAuiImagePane.cpp @@ -78,8 +78,8 @@ void CAuiImagePane::DoDrawImagePane(const zeus::CColor& color, CTexture& tex, in if (!noBlur) { if ((x14c_deResFactor == 0.f && alpha == 1.f) || tex.GetNumberOfMipMaps() == 1) { - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); tex.LoadMipLevel(0, GX_TEXMAP0, EClampMode::Repeat); CGraphics::StreamBegin(GX_TRIANGLESTRIP); CGraphics::StreamColor(useColor); @@ -144,8 +144,8 @@ void CAuiImagePane::DoDrawImagePane(const zeus::CColor& color, CTexture& tex, in CGX::End(); } } else { - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5fec); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulateAlpha); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); tex.Load(GX_TEXMAP0, EClampMode::Repeat); CGraphics::StreamBegin(GX_TRIANGLESTRIP); CGraphics::StreamColor(useColor); diff --git a/Runtime/GuiSys/CGuiFrame.cpp b/Runtime/GuiSys/CGuiFrame.cpp index e7b96dc3a..f8c6d98ef 100644 --- a/Runtime/GuiSys/CGuiFrame.cpp +++ b/Runtime/GuiSys/CGuiFrame.cpp @@ -128,7 +128,7 @@ void CGuiFrame::Draw(const CGuiWidgetDrawParms& parms) const { CGraphics::SetAmbientColor(zeus::skWhite); DisableLights(); x14_camera->Draw(parms); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha, ERglLogicOp::Clear); diff --git a/Runtime/GuiSys/CGuiPane.cpp b/Runtime/GuiSys/CGuiPane.cpp index 06e1aa4ae..f9640f03b 100644 --- a/Runtime/GuiSys/CGuiPane.cpp +++ b/Runtime/GuiSys/CGuiPane.cpp @@ -16,7 +16,7 @@ void CGuiPane::Draw(const CGuiWidgetDrawParms& parms) { auto col = xa8_color2; col.a() = parms.x0_alphaMod * xa8_color2.a(); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvPassthru); CGraphics::DrawPrimitive(GX_TRIANGLESTRIP, xc0_verts.data(), skDefaultNormal, col, xc0_verts.size()); } CGuiWidget::Draw(parms); diff --git a/Runtime/GuiSys/CHudRadarInterface.cpp b/Runtime/GuiSys/CHudRadarInterface.cpp index 027610aa1..45b8fe9bb 100644 --- a/Runtime/GuiSys/CHudRadarInterface.cpp +++ b/Runtime/GuiSys/CHudRadarInterface.cpp @@ -125,7 +125,7 @@ void CHudRadarInterface::Draw(const CStateManager& mgr, float alpha) { g_Renderer->SetModelMatrix(drawParms.x3c_postTranslate); g_Renderer->SetBlendMode_AdditiveAlpha(); x0_txtrRadarPaint->Load(GX_TEXMAP0, EClampMode::Repeat); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); g_Renderer->SetDepthReadWrite(false, false); zeus::CColor playerColor = g_tweakGuiColors->GetRadarPlayerPaintColor(); playerColor.a() *= alpha; diff --git a/Runtime/GuiSys/CScanDisplay.cpp b/Runtime/GuiSys/CScanDisplay.cpp index 82cc167f5..37b909c72 100644 --- a/Runtime/GuiSys/CScanDisplay.cpp +++ b/Runtime/GuiSys/CScanDisplay.cpp @@ -451,7 +451,7 @@ void CScanDisplay::Draw() { g_Renderer->SetDepthReadWrite(false, false); g_Renderer->SetViewportOrtho(true, -4096.f, 4096.f); g_Renderer->SetBlendMode_AdditiveAlpha(); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); x0_dataDot->Load(GX_TEXMAP0, EClampMode::Repeat); const float vpRatio = CGraphics::GetViewportHeight() / 480.f; diff --git a/Runtime/GuiSys/CSplashScreen.cpp b/Runtime/GuiSys/CSplashScreen.cpp index 23f9761f5..834cfbf69 100644 --- a/Runtime/GuiSys/CSplashScreen.cpp +++ b/Runtime/GuiSys/CSplashScreen.cpp @@ -66,8 +66,8 @@ void CSplashScreen::Draw() { CGraphics::SetAlphaCompare(ERglAlphaFunc::Always, 0, ERglAlphaOp::And, ERglAlphaFunc::Always, 0); g_Renderer->SetModelMatrix({}); CGraphics::SetViewPointMatrix({}); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); g_Renderer->SetBlendMode_AlphaBlended(); auto& tex = *x28_texture.GetObj(); const auto width = tex.GetWidth(); diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index 0be525c11..829bb9ff5 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -1823,8 +1823,8 @@ void CFrontEndUI::Draw() { if (x64_pressStartAlpha > 0.f && x38_pressStart.IsLoaded()) { /* Render "Press Start" */ - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); g_Renderer->SetBlendMode_AdditiveAlpha(); g_Renderer->SetDepthReadWrite(false, false); const auto width = x38_pressStart->GetWidth(); diff --git a/Runtime/MP1/CInGameGuiManager.cpp b/Runtime/MP1/CInGameGuiManager.cpp index 406b69c17..118b17bb7 100644 --- a/Runtime/MP1/CInGameGuiManager.cpp +++ b/Runtime/MP1/CInGameGuiManager.cpp @@ -475,8 +475,8 @@ void CInGameGuiManager::Draw(CStateManager& stateMgr) { if (x1d8_onScreenTexAlpha > 0.f && x1dc_onScreenTexTok.IsLoaded()) { g_Renderer->SetDepthReadWrite(false, false); g_Renderer->SetBlendMode_AlphaBlended(); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); int w = x1c4_onScreenTex.x4_origin.x; int h = x1c4_onScreenTex.x4_origin.y; int x = CGraphics::GetViewportLeft() + (CGraphics::GetViewportWidth() - w) / 2 + x1c4_onScreenTex.xc_extent.x; diff --git a/Runtime/MP1/World/COmegaPirate.cpp b/Runtime/MP1/World/COmegaPirate.cpp index c1c6b5ad1..9a1af15c7 100644 --- a/Runtime/MP1/World/COmegaPirate.cpp +++ b/Runtime/MP1/World/COmegaPirate.cpp @@ -107,8 +107,8 @@ void COmegaPirate::CFlash::Render(CStateManager& mgr) { const auto rvS = GetTranslation() - rightVec; const auto rvP = GetTranslation() + rightVec; CGraphics::SetModelMatrix(zeus::CTransform()); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); CGraphics::SetDepthWriteMode(false, ERglEnum::Always, false); CGraphics::StreamColor(zeus::CColor{1.f, std::min(1.f, size)}); CGraphics::StreamBegin(GX_TRIANGLEFAN); diff --git a/Runtime/MP1/World/CThardus.cpp b/Runtime/MP1/World/CThardus.cpp index 1d04fcf91..0da0f7162 100644 --- a/Runtime/MP1/World/CThardus.cpp +++ b/Runtime/MP1/World/CThardus.cpp @@ -1394,8 +1394,8 @@ void CThardus::RenderFlare(const CStateManager& mgr, float t) { zeus::CVector3f min = x92c_currentRockPos - (scale * CGraphics::g_ViewMatrix.basis[0]); CGraphics::SetModelMatrix({}); CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::One, ERglBlendFactor::One, ERglLogicOp::Clear); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); CGraphics::SetDepthWriteMode(false, ERglEnum::Always, false); CGraphics::StreamColor({t, t}); CGraphics::StreamBegin(GX_TRIANGLEFAN); diff --git a/Runtime/Particle/CElementGen.cpp b/Runtime/Particle/CElementGen.cpp index 88d123c1c..6b4c5d0c3 100644 --- a/Runtime/Particle/CElementGen.cpp +++ b/Runtime/Particle/CElementGen.cpp @@ -915,7 +915,7 @@ void CElementGen::RenderModels() { cachedTex = texr->GetValueTexture(partFrame).GetObj(); cachedTex->Load(GX_TEXMAP0, EClampMode::Repeat); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); if (moveRedToAlphaBuffer) { CGX::SetTevColorIn(GX_TEVSTAGE1, GX_CC_ZERO, GX_CC_CPREV, GX_CC_APREV, GX_CC_ZERO); CGX::SetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, GX_CA_TEXA, GX_CA_APREV, GX_CA_ZERO); @@ -936,14 +936,14 @@ void CElementGen::RenderModels() { CGX::SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0); CGX::SetNumTexGens(1); } else { - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); } texConst = texr->HasConstantTexture(); texr->GetValueUV(partFrame, uvs); } else { - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::skPassThru); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvPassthru); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); } } @@ -1255,19 +1255,23 @@ void CElementGen::RenderParticles() { cachedTex = texr->GetValueTexture(partFrame).GetObj(); cachedTex->Load(GX_TEXMAP0, EClampMode::Repeat); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); if (hasModuColor) { /* Add RASC * PREVC pass for MODU color loaded into channel mat-color */ - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::sTevPass804bfe68); + static const CTevCombiners::CTevPass kEnvModuColor{ + {GX_CC_ZERO, GX_CC_CPREV, GX_CC_RASC, GX_CC_ZERO}, + {GX_CA_ZERO, GX_CA_APREV, GX_CA_RASA, GX_CA_ZERO}, + }; + CGraphics::SetTevOp(ERglTevStage::Stage1, kEnvModuColor); } else { - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); } texr->GetValueUV(partFrame, uvs); constUVs = texr->HasConstantUV(); } else { - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::skPassThru); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvPassthru); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); } constexpr std::array vtxDescList{ diff --git a/Runtime/World/CVisorFlare.cpp b/Runtime/World/CVisorFlare.cpp index 70b60b375..349f6bb71 100644 --- a/Runtime/World/CVisorFlare.cpp +++ b/Runtime/World/CVisorFlare.cpp @@ -182,8 +182,8 @@ void CVisorFlare::SetupRenderState(const CStateManager& mgr) const { } else if (x0_blendMode == EBlendMode::Additive) { g_Renderer->SetBlendMode_AdditiveAlpha(); } - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); } } diff --git a/Runtime/World/CWorldShadow.cpp b/Runtime/World/CWorldShadow.cpp index c15525254..5f3cf4ba9 100644 --- a/Runtime/World/CWorldShadow.cpp +++ b/Runtime/World/CWorldShadow.cpp @@ -74,8 +74,8 @@ void CWorldShadow::BuildLightShadowTexture(const CStateManager& mgr, TAreaId aid CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, true); CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha, ERglLogicOp::Clear); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::skPassThru); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvPassthru); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); g_Renderer->BeginTriangleStrip(4); g_Renderer->PrimVertex({-extent, 0.f, extent}); g_Renderer->PrimVertex({extent, 0.f, extent}); @@ -97,8 +97,8 @@ void CWorldShadow::BuildLightShadowTexture(const CStateManager& mgr, TAreaId aid CGraphics::SetDepthWriteMode(false, ERglEnum::LEqual, false); CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha, ERglLogicOp::Clear); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::skPassThru); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvPassthru); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); CGraphics::StreamBegin(GX_TRIANGLESTRIP); CGraphics::StreamColor(1.f, 1.f, 1.f, 0.25f); CGraphics::StreamVertex(-extent, 0.f, extent); @@ -114,8 +114,8 @@ void CWorldShadow::BuildLightShadowTexture(const CStateManager& mgr, TAreaId aid CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha, ERglLogicOp::Clear); CGraphics::SetAlphaCompare(ERglAlphaFunc::Always, 0, ERglAlphaOp::And, ERglAlphaFunc::Always, 0); - CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); - CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); + CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate); + CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru); CGraphics::Render2D(*x0_texture, 0, x0_texture->GetWidth() * 2, x0_texture->GetHeight() * 2, x0_texture->GetWidth() * -2, zeus::CColor{1.f, 0.85f}); CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, true);