mirror of https://github.com/AxioDL/metaforce.git
HUD blending fixes and map interpolation
This commit is contained in:
parent
a2c79eb996
commit
e00f6bfe30
|
@ -202,9 +202,9 @@ CModelShaders::GetShaderExtensionsGLSL(boo::IGraphicsDataFactory::Platform plat)
|
||||||
|
|
||||||
/* Forced additive shading */
|
/* Forced additive shading */
|
||||||
ext.registerExtensionSlot({LightingGLSL, "LightingFunc"}, {MainPostGLSL, "MainPostFunc"},
|
ext.registerExtensionSlot({LightingGLSL, "LightingFunc"}, {MainPostGLSL, "MainPostFunc"},
|
||||||
3, BlockNames, 0, nullptr, hecl::Backend::BlendFactor::One,
|
3, BlockNames, 0, nullptr, hecl::Backend::BlendFactor::SrcAlpha,
|
||||||
hecl::Backend::BlendFactor::One, hecl::Backend::ZTest::Original,
|
hecl::Backend::BlendFactor::One, hecl::Backend::ZTest::Original,
|
||||||
false, false, false, true);
|
false, true, false, true);
|
||||||
|
|
||||||
/* Solid color */
|
/* Solid color */
|
||||||
ext.registerExtensionSlot({}, {SolidPostGLSL, "SolidPostFunc"},
|
ext.registerExtensionSlot({}, {SolidPostGLSL, "SolidPostFunc"},
|
||||||
|
|
|
@ -185,9 +185,9 @@ CModelShaders::GetShaderExtensionsHLSL(boo::IGraphicsDataFactory::Platform plat)
|
||||||
|
|
||||||
/* Forced additive shading */
|
/* Forced additive shading */
|
||||||
ext.registerExtensionSlot({LightingHLSL, "LightingFunc"}, {MainPostHLSL, "MainPostFunc"},
|
ext.registerExtensionSlot({LightingHLSL, "LightingFunc"}, {MainPostHLSL, "MainPostFunc"},
|
||||||
0, nullptr, 0, nullptr, hecl::Backend::BlendFactor::One,
|
0, nullptr, 0, nullptr, hecl::Backend::BlendFactor::SrcAlpha,
|
||||||
hecl::Backend::BlendFactor::One, hecl::Backend::ZTest::Original,
|
hecl::Backend::BlendFactor::One, hecl::Backend::ZTest::Original,
|
||||||
false, false, false, true);
|
false, true, false, true);
|
||||||
|
|
||||||
/* Solid color */
|
/* Solid color */
|
||||||
ext.registerExtensionSlot({}, {SolidPostHLSL, "SolidPostFunc"},
|
ext.registerExtensionSlot({}, {SolidPostHLSL, "SolidPostFunc"},
|
||||||
|
|
|
@ -192,9 +192,9 @@ CModelShaders::GetShaderExtensionsMetal(boo::IGraphicsDataFactory::Platform plat
|
||||||
|
|
||||||
/* Forced additive shading */
|
/* Forced additive shading */
|
||||||
ext.registerExtensionSlot({LightingMetal, "LightingFunc"}, {MainPostMetal, "MainPostFunc"},
|
ext.registerExtensionSlot({LightingMetal, "LightingFunc"}, {MainPostMetal, "MainPostFunc"},
|
||||||
1, BlockNames, 0, nullptr, hecl::Backend::BlendFactor::One,
|
1, BlockNames, 0, nullptr, hecl::Backend::BlendFactor::SrcAlpha,
|
||||||
hecl::Backend::BlendFactor::One, hecl::Backend::ZTest::Original,
|
hecl::Backend::BlendFactor::One, hecl::Backend::ZTest::Original,
|
||||||
false, false, false, true);
|
false, true, false, true);
|
||||||
|
|
||||||
/* Solid color */
|
/* Solid color */
|
||||||
ext.registerExtensionSlot({}, {SolidPostMetal, "SolidPostFunc"},
|
ext.registerExtensionSlot({}, {SolidPostMetal, "SolidPostFunc"},
|
||||||
|
|
|
@ -295,7 +295,7 @@ bool CInGameGuiManager::CheckLoadComplete(CStateManager& stateMgr)
|
||||||
zeus::CVector3f(0.f, 2.f, g_tweakAutoMapper->GetCamVerticalOffset());
|
zeus::CVector3f(0.f, 2.f, g_tweakAutoMapper->GetCamVerticalOffset());
|
||||||
|
|
||||||
zeus::CMatrix3f mtx(x170_camRotate);
|
zeus::CMatrix3f mtx(x170_camRotate);
|
||||||
x18c_camXf = zeus::CTransform(mtx, x180_camOffset);
|
x18c_mapCamXf = zeus::CTransform(mtx, x180_camOffset);
|
||||||
|
|
||||||
BeginStateTransition(EInGameGuiState::InGame, stateMgr);
|
BeginStateTransition(EInGameGuiState::InGame, stateMgr);
|
||||||
x18_loadPhase = ELoadPhase::Done;
|
x18_loadPhase = ELoadPhase::Done;
|
||||||
|
@ -353,14 +353,14 @@ void CInGameGuiManager::UpdateAutoMapper(float dt, const CStateManager& stateMgr
|
||||||
{
|
{
|
||||||
x148_model_automapper->SetO2WTransform(
|
x148_model_automapper->SetO2WTransform(
|
||||||
zeus::CTransform(x170_camRotate, x180_camOffset) * zeus::CTransform::Scale(scaleX, 1.f, scaleZ));
|
zeus::CTransform(x170_camRotate, x180_camOffset) * zeus::CTransform::Scale(scaleX, 1.f, scaleZ));
|
||||||
x18c_camXf = zeus::CTransform(x170_camRotate, x180_camOffset) *
|
x18c_mapCamXf = zeus::CTransform(x170_camRotate, x180_camOffset) *
|
||||||
zeus::CTransform::Scale(frameLength, 1.f, frameLength);
|
zeus::CTransform::Scale(frameLength, 1.f, frameLength);
|
||||||
x148_model_automapper->SetColor(g_tweakAutoMapper->GetAutomapperWidgetColor());
|
x148_model_automapper->SetColor(g_tweakAutoMapper->GetAutomapperWidgetColor());
|
||||||
}
|
}
|
||||||
else if (x38_autoMapper->IsFullyInMiniMapState())
|
else if (x38_autoMapper->IsFullyInMiniMapState())
|
||||||
{
|
{
|
||||||
x148_model_automapper->SetO2WTransform(zeus::CTransform(x154_automapperRotate, x164_automapperOffset));
|
x148_model_automapper->SetO2WTransform(zeus::CTransform(x154_automapperRotate, x164_automapperOffset));
|
||||||
x18c_camXf = x148_model_automapper->GetWorldTransform();
|
x18c_mapCamXf = x148_model_automapper->GetWorldTransform();
|
||||||
x148_model_automapper->SetColor(g_tweakAutoMapper->GetAutomapperWidgetMiniColor());
|
x148_model_automapper->SetColor(g_tweakAutoMapper->GetAutomapperWidgetMiniColor());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -371,9 +371,11 @@ void CInGameGuiManager::UpdateAutoMapper(float dt, const CStateManager& stateMgr
|
||||||
else
|
else
|
||||||
t = 1.f - x38_autoMapper->GetInterp();
|
t = 1.f - x38_autoMapper->GetInterp();
|
||||||
float st = t * (frameLength - 1.f) + 1.f;
|
float st = t * (frameLength - 1.f) + 1.f;
|
||||||
x148_model_automapper->SetO2WTransform(zeus::CTransform(
|
zeus::CQuaternion rotate = zeus::CQuaternion::slerp(x154_automapperRotate, x170_camRotate, t);
|
||||||
zeus::CQuaternion::slerp(x154_automapperRotate, x170_camRotate, t),
|
zeus::CVector3f offset = x164_automapperOffset * (1.f - t) + x180_camOffset * t;
|
||||||
x164_automapperOffset * (1.f - t) + x180_camOffset * t) * zeus::CTransform::Scale(st, 1.f, st));
|
x18c_mapCamXf = zeus::CTransform(rotate, offset) * zeus::CTransform::Scale(st, 1.f, st);
|
||||||
|
x148_model_automapper->SetO2WTransform(zeus::CTransform(rotate, offset) *
|
||||||
|
zeus::CTransform::Scale(t * (scaleX - 1.f) + 1.f, 1.f, t * (scaleZ - 1.f) + 1.f));
|
||||||
x148_model_automapper->SetColor(zeus::CColor::lerp(g_tweakAutoMapper->GetAutomapperWidgetMiniColor(),
|
x148_model_automapper->SetColor(zeus::CColor::lerp(g_tweakAutoMapper->GetAutomapperWidgetMiniColor(),
|
||||||
g_tweakAutoMapper->GetAutomapperWidgetColor(), t));
|
g_tweakAutoMapper->GetAutomapperWidgetColor(), t));
|
||||||
}
|
}
|
||||||
|
@ -650,7 +652,7 @@ void CInGameGuiManager::Draw(CStateManager& stateMgr)
|
||||||
x148_model_automapper->SetIsVisible(true);
|
x148_model_automapper->SetIsVisible(true);
|
||||||
x148_model_automapper->Draw(CGuiWidgetDrawParms(1.f, zeus::CVector3f::skZero));
|
x148_model_automapper->Draw(CGuiWidgetDrawParms(1.f, zeus::CVector3f::skZero));
|
||||||
// ZTest no write
|
// ZTest no write
|
||||||
x38_autoMapper->Draw(stateMgr, zeus::CTransform::Translate(0.f, 0.02f, 0.f) * x18c_camXf,
|
x38_autoMapper->Draw(stateMgr, zeus::CTransform::Translate(0.f, 0.02f, 0.f) * x18c_mapCamXf,
|
||||||
mapAlpha * x1f4_visorStaticAlpha * t);
|
mapAlpha * x1f4_visorStaticAlpha * t);
|
||||||
// Zest and write
|
// Zest and write
|
||||||
x148_model_automapper->SetIsVisible(false);
|
x148_model_automapper->SetIsVisible(false);
|
||||||
|
|
|
@ -85,7 +85,7 @@ private:
|
||||||
zeus::CVector3f x164_automapperOffset;
|
zeus::CVector3f x164_automapperOffset;
|
||||||
zeus::CQuaternion x170_camRotate;
|
zeus::CQuaternion x170_camRotate;
|
||||||
zeus::CVector3f x180_camOffset;
|
zeus::CVector3f x180_camOffset;
|
||||||
zeus::CTransform x18c_camXf;
|
zeus::CTransform x18c_mapCamXf;
|
||||||
EInGameGuiState x1bc_prevState = EInGameGuiState::Zero;
|
EInGameGuiState x1bc_prevState = EInGameGuiState::Zero;
|
||||||
EInGameGuiState x1c0_nextState = EInGameGuiState::Zero;
|
EInGameGuiState x1c0_nextState = EInGameGuiState::Zero;
|
||||||
SOnScreenTex x1c4_onScreenTex;
|
SOnScreenTex x1c4_onScreenTex;
|
||||||
|
|
Loading…
Reference in New Issue