diff --git a/DataSpec/DNAMP1/Tweaks/CTweakBall.hpp b/DataSpec/DNAMP1/Tweaks/CTweakBall.hpp index aca02a0d1..20086c00e 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakBall.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakBall.hpp @@ -113,8 +113,12 @@ struct CTweakBall final : public ITweakBall CTweakBall(athena::io::IStreamReader& r) { this->read(r); + x6c_ = -x6c_; + x70_ = -x70_; x74_ballCameraAnglePerSecond = zeus::degToRad(x74_ballCameraAnglePerSecond); x90_ = zeus::degToRad(x90_); + xe4_ballGravity = -xe4_ballGravity; + xe8_ballWaterGravity = -xe8_ballWaterGravity; x15c_ = zeus::degToRad(x15c_); x16c_ = zeus::degToRad(x16c_); x174_ = zeus::degToRad(x174_); diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index c9a14ecb9..c9417623b 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -613,11 +613,11 @@ zeus::CFrustum CStateManager::SetupDrawFrustum(const SViewport& vp) const zeus::CFrustum ret; const CGameCamera* cam = x870_cameraManager->GetCurrentCamera(*this); zeus::CTransform camXf = x870_cameraManager->GetCurrentCameraTransform(*this); - //int vpWidth = xf2c_viewportScale.x * vp.x8_width; - //int vpHeight = xf2c_viewportScale.y * vp.xc_height; - //int vpLeft = (vp.x8_width - vpWidth) / 2 + vp.x0_left; - //int vpTop = (vp.xc_height - vpHeight) / 2 + vp.x4_top; - //g_Renderer->SetViewport(vpLeft, vpTop, vpWidth, vpHeight); + int vpWidth = xf2c_viewportScale.x * vp.x8_width; + int vpHeight = xf2c_viewportScale.y * vp.xc_height; + int vpLeft = (vp.x8_width - vpWidth) / 2 + vp.x0_left; + int vpTop = (vp.xc_height - vpHeight) / 2 + vp.x4_top; + g_Renderer->SetViewport(vpLeft, vpTop, vpWidth, vpHeight); float fov = std::atan(std::tan(zeus::degToRad(cam->GetFov()) * 0.5f) * xf2c_viewportScale.y) * 2.f; float width = xf2c_viewportScale.x * vp.x8_width; float height = xf2c_viewportScale.y * vp.xc_height; @@ -633,11 +633,11 @@ zeus::CFrustum CStateManager::SetupViewForDraw(const SViewport& vp) const zeus::CTransform camXf = x870_cameraManager->GetCurrentCameraTransform(*this); g_Renderer->SetWorldViewpoint(camXf); CBooModel::SetNewPlayerPositionAndTime(x84c_player->GetTranslation()); - //int vpWidth = xf2c_viewportScale.x * vp.x8_width; - //int vpHeight = xf2c_viewportScale.y * vp.xc_height; - //int vpLeft = (vp.x8_width - vpWidth) / 2 + vp.x0_left; - //int vpTop = (vp.xc_height - vpHeight) / 2 + vp.x4_top; - //g_Renderer->SetViewport(vpLeft, vpTop, vpWidth, vpHeight); + int vpWidth = xf2c_viewportScale.x * vp.x8_width; + int vpHeight = xf2c_viewportScale.y * vp.xc_height; + int vpLeft = (vp.x8_width - vpWidth) / 2 + vp.x0_left; + int vpTop = (vp.xc_height - vpHeight) / 2 + vp.x4_top; + g_Renderer->SetViewport(vpLeft, vpTop, vpWidth, vpHeight); CGraphics::SetDepthRange(DEPTH_WORLD, DEPTH_FAR); float fov = std::atan(std::tan(zeus::degToRad(cam->GetFov()) * 0.5f) * xf2c_viewportScale.y) * 2.f; float width = xf2c_viewportScale.x * vp.x8_width; diff --git a/Runtime/Graphics/CBooRenderer.cpp b/Runtime/Graphics/CBooRenderer.cpp index eecff006c..3179af04a 100644 --- a/Runtime/Graphics/CBooRenderer.cpp +++ b/Runtime/Graphics/CBooRenderer.cpp @@ -11,6 +11,7 @@ #include "zeus/CUnitVector.hpp" #include "Graphics/CSkinnedModel.hpp" #include "zeus/CVector3d.hpp" +#include "World/CActor.hpp" #define FOGVOL_RAMP_RES 256 #define FOGVOL_FAR 750.0 @@ -109,6 +110,7 @@ void Buckets::Sort() cont = planeObj.x3c_24_invertTest ? (!partial || !full) : (partial || full); if (!cont) break; + slot += precision; } } diff --git a/Runtime/Graphics/CBooRenderer.hpp b/Runtime/Graphics/CBooRenderer.hpp index a750c9f1c..ef4c5fef5 100644 --- a/Runtime/Graphics/CBooRenderer.hpp +++ b/Runtime/Graphics/CBooRenderer.hpp @@ -50,7 +50,7 @@ public: static void Init(); }; -class CBooRenderer : public IRenderer +class CBooRenderer final : public IRenderer { friend class CBooModel; friend class CModel; diff --git a/Runtime/Graphics/Shaders/CModelShadersGLSL.cpp b/Runtime/Graphics/Shaders/CModelShadersGLSL.cpp index a1c246409..581382403 100644 --- a/Runtime/Graphics/Shaders/CModelShadersGLSL.cpp +++ b/Runtime/Graphics/Shaders/CModelShadersGLSL.cpp @@ -322,8 +322,8 @@ CModelShaders::GetShaderExtensionsGLSL(boo::IGraphicsDataFactory::Platform plat) /* Depth GEqual no Z-write */ ext.registerExtensionSlot({LightingGLSL, "LightingFunc"}, {MainPostGLSL, "MainPostFunc"}, - 3, BlockNames, 0, nullptr, hecl::Backend::BlendFactor::Original, - hecl::Backend::BlendFactor::Original, hecl::Backend::ZTest::GEqual, + 3, BlockNames, 0, nullptr, hecl::Backend::BlendFactor::SrcAlpha, + hecl::Backend::BlendFactor::InvSrcAlpha, hecl::Backend::ZTest::GEqual, hecl::Backend::CullMode::Backface, true, false, true); return ext; diff --git a/Runtime/Graphics/Shaders/CModelShadersHLSL.cpp b/Runtime/Graphics/Shaders/CModelShadersHLSL.cpp index 6a37ef152..ff71933d9 100644 --- a/Runtime/Graphics/Shaders/CModelShadersHLSL.cpp +++ b/Runtime/Graphics/Shaders/CModelShadersHLSL.cpp @@ -302,8 +302,8 @@ CModelShaders::GetShaderExtensionsHLSL(boo::IGraphicsDataFactory::Platform plat) /* Depth GEqual no Z-write */ ext.registerExtensionSlot({LightingHLSL, "LightingFunc"}, {MainPostHLSL, "MainPostFunc"}, - 0, nullptr, 0, nullptr, hecl::Backend::BlendFactor::Original, - hecl::Backend::BlendFactor::Original, hecl::Backend::ZTest::GEqual, + 0, nullptr, 0, nullptr, hecl::Backend::BlendFactor::SrcAlpha, + hecl::Backend::BlendFactor::InvSrcAlpha, hecl::Backend::ZTest::GEqual, hecl::Backend::CullMode::Backface, true, false, true); return ext; diff --git a/Runtime/Graphics/Shaders/CModelShadersMetal.cpp b/Runtime/Graphics/Shaders/CModelShadersMetal.cpp index 9bd72bfb0..8b13b6ba9 100644 --- a/Runtime/Graphics/Shaders/CModelShadersMetal.cpp +++ b/Runtime/Graphics/Shaders/CModelShadersMetal.cpp @@ -312,8 +312,8 @@ CModelShaders::GetShaderExtensionsMetal(boo::IGraphicsDataFactory::Platform plat /* Depth GEqual no Z-write */ ext.registerExtensionSlot({LightingMetal, "LightingFunc"}, {MainPostMetal, "MainPostFunc"}, - 1, BlockNames, 0, nullptr, hecl::Backend::BlendFactor::Original, - hecl::Backend::BlendFactor::Original, hecl::Backend::ZTest::GEqual, + 1, BlockNames, 0, nullptr, hecl::Backend::BlendFactor::SrcAlpha, + hecl::Backend::BlendFactor::InvSrcAlpha, hecl::Backend::ZTest::GEqual, hecl::Backend::CullMode::Backface, true, false, true); return ext; diff --git a/Runtime/GuiSys/CGuiWidget.hpp b/Runtime/GuiSys/CGuiWidget.hpp index 54e353de6..20e0ef589 100644 --- a/Runtime/GuiSys/CGuiWidget.hpp +++ b/Runtime/GuiSys/CGuiWidget.hpp @@ -118,7 +118,7 @@ public: const zeus::CColor& GetGeometryColor() const { return xa8_color2; } void SetIdlePosition(const zeus::CVector3f& pos, bool reapply); void ReapplyXform(); - void SetIsVisible(bool); + virtual void SetIsVisible(bool); void SetIsActive(bool); bool GetIsSelectable() const { return xb6_27_isSelectable; } void SetIsSelectable(bool v) { xb6_27_isSelectable = v; } diff --git a/Runtime/GuiSys/CHudVisorBeamMenu.cpp b/Runtime/GuiSys/CHudVisorBeamMenu.cpp index 7a6cf991d..17a0bbffd 100644 --- a/Runtime/GuiSys/CHudVisorBeamMenu.cpp +++ b/Runtime/GuiSys/CHudVisorBeamMenu.cpp @@ -269,18 +269,16 @@ void CHudVisorBeamMenu::Update(float dt, bool init) UpdateMenuWidgetTransform(x8_selectedItem, *x24_model_ghost, x28_menuItems[x8_selectedItem].x8_positioner); } - if (x1c_basewidget_menutitle->GetGeometryColor().a) - x1c_basewidget_menutitle->SetVisibility(true, ETraversalMode::Children); - else - x1c_basewidget_menutitle->SetVisibility(false, ETraversalMode::Children); + if (!x14_24_visibleDebug || !x14_25_visibleGame) + return; + + x1c_basewidget_menutitle->SetVisibility + (x1c_basewidget_menutitle->GetGeometryColor().a != 0.f, ETraversalMode::Children); for (int i=0 ; i<4 ; ++i) { SMenuItem& item = x28_menuItems[i]; - if (item.x4_model_icon->GetGeometryColor().a) - item.x4_model_icon->SetIsVisible(true); - else - item.x4_model_icon->SetIsVisible(false); + item.x4_model_icon->SetIsVisible(item.x4_model_icon->GetGeometryColor().a != 0.f); } } diff --git a/Runtime/MP1/CPlayerVisor.cpp b/Runtime/MP1/CPlayerVisor.cpp index 1e8326d75..c7888c6ca 100644 --- a/Runtime/MP1/CPlayerVisor.cpp +++ b/Runtime/MP1/CPlayerVisor.cpp @@ -558,8 +558,8 @@ void CPlayerVisor::BeginTransitionIn(const CStateManager&) { case CPlayerState::EPlayerVisor::XRay: x90_xrayBlur.SetBlur(EBlurType::Xray, 0.f, 0.f); - xc4_vpScaleX = 0.9f; - xc8_vpScaleY = 0.9f; + //xc4_vpScaleX = 0.9f; + //xc8_vpScaleY = 0.9f; CSfxManager::SfxStart(1383, x24_visorSfxVol, 0.f, false, 0x7f, false, kInvalidAreaId); break; case CPlayerState::EPlayerVisor::Scan: @@ -579,8 +579,8 @@ void CPlayerVisor::FinishTransitionOut(const CStateManager&) { case CPlayerState::EPlayerVisor::XRay: x90_xrayBlur.DisableBlur(0.f); - xc4_vpScaleX = 1.f; - xc8_vpScaleY = 1.f; + //xc4_vpScaleX = 1.f; + //xc8_vpScaleY = 1.f; break; case CPlayerState::EPlayerVisor::Scan: x64_scanDim.DisableFilter(0.f); diff --git a/Runtime/MP1/CSamusHud.cpp b/Runtime/MP1/CSamusHud.cpp index dcf342488..b45616599 100644 --- a/Runtime/MP1/CSamusHud.cpp +++ b/Runtime/MP1/CSamusHud.cpp @@ -1268,7 +1268,9 @@ void CSamusHud::Update(float dt, const CStateManager& mgr, default: break; } - x500_viewportScale.y = 1.f - morphT * g_tweakGui->GetBallViewportYReduction(); + float aspect = g_Viewport.x8_width / float(g_Viewport.xc_height); + float scaleMul = 1.f - zeus::clamp(0.f, (aspect - 1.33f) / (1.77f - 1.33f), 1.f); + x500_viewportScale.y = 1.f - scaleMul * morphT * g_tweakGui->GetBallViewportYReduction() * 1.2f; if (x2b0_ballIntf) x2b0_ballIntf->SetBallModeFactor(morphT); diff --git a/Runtime/World/CMorphBallShadow.cpp b/Runtime/World/CMorphBallShadow.cpp index 47a8cdf85..3c9f4439a 100644 --- a/Runtime/World/CMorphBallShadow.cpp +++ b/Runtime/World/CMorphBallShadow.cpp @@ -38,6 +38,7 @@ void CMorphBallShadow::RenderIdBuffer(const zeus::CAABox& aabb, const CStateMana GatherAreas(mgr); + SViewport backupVp = g_Viewport; g_Renderer->BindBallShadowIdTarget(); CGraphics::g_BooMainCommandQueue->clearTarget(); @@ -94,6 +95,7 @@ void CMorphBallShadow::RenderIdBuffer(const zeus::CAABox& aabb, const CStateMana g_Renderer->BindMainDrawTarget(); CGraphics::SetViewPointMatrix(backupViewMtx); CGraphics::SetProjectionState(backupProjection); + g_Renderer->SetViewport(backupVp.x0_left, backupVp.x4_top, backupVp.x8_width, backupVp.xc_height); CGraphics::SetDepthRange(backupDepth[0], backupDepth[1]); xd0_hasIds = alphaVal != 4; diff --git a/amuse b/amuse index d7011f0e7..1e8ce19b1 160000 --- a/amuse +++ b/amuse @@ -1 +1 @@ -Subproject commit d7011f0e77c2cce57d0195f07e325e7415794676 +Subproject commit 1e8ce19b167c80706ed396d32d1cc573c2b2a7ee