Merge branch 'MontyTRC89:develop' into develop

This commit is contained in:
davidmarr 2024-11-28 12:49:21 +01:00 committed by GitHub
commit c3a97f4113
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 19 additions and 8 deletions

View file

@ -756,7 +756,8 @@ GameStatus HandleMenuCalls(bool isTitle)
{
SaveGame::LoadHeaders();
g_Gui.SetInventoryMode(InventoryMode::Load);
g_Gui.CallInventory(LaraItem, false);
if (g_Gui.CallInventory(LaraItem, false))
gameStatus = GameStatus::LoadGame;
}
else if (doPause && g_Gui.GetInventoryMode() != InventoryMode::Pause)
{

View file

@ -3520,7 +3520,7 @@ namespace TEN::Gui
else
{
SoundEffect(SFX_TR4_MENU_CHOOSE, nullptr, SoundEnvironment::Always);
NextLevel = -(SelectedSaveSlot + 1);
g_GameFlow->SelectedSaveGame = SelectedSaveSlot;
return LoadResult::Load;
}
}

View file

@ -7,6 +7,7 @@
#include "Scripting/Include/ScriptInterfaceLevel.h"
#include "Scripting/Include/Flow/ScriptInterfaceFlowHandler.h"
#include "Specific/level.h"
#include "Game/Lara/lara_helpers.h"
using namespace TEN::Math;
@ -111,7 +112,8 @@ namespace TEN::Entities::Effects
isVisible = false;
// Check occlusion only for player.
collided = isVisible && ObjectOnLOS2(&origin, &target, &pointOfContact, nullptr, ID_LARA) != NO_LOS_ITEM;
int playerItemNumber = isVisible ? ObjectOnLOS2(&origin, &target, &pointOfContact, nullptr, ID_LARA) : NO_LOS_ITEM;
collided = isVisible && playerItemNumber != NO_LOS_ITEM && !GetLaraInfo(g_Level.Items[playerItemNumber]).Control.Look.IsUsingBinoculars;
if (collided && Vector3::Distance(pointOfContact.ToVector3(), origin.ToVector3()) < distance)
isVisible = false;
}

View file

@ -2994,9 +2994,10 @@ namespace TEN::Renderer
rDrawSprite.Scale = 1.0f;
rDrawSprite.Width = SUN_SIZE;
rDrawSprite.Height = SUN_SIZE;
rDrawSprite.color = renderView.LensFlaresToDraw[0].Color;
_stInstancedSpriteBuffer.Sprites[0].World = GetWorldMatrixForSprite(&rDrawSprite, renderView);
_stInstancedSpriteBuffer.Sprites[0].Color = Vector4::One;
_stInstancedSpriteBuffer.Sprites[0].Color = renderView.LensFlaresToDraw[0].Color;
_stInstancedSpriteBuffer.Sprites[0].IsBillboard = 1;
_stInstancedSpriteBuffer.Sprites[0].IsSoftParticle = 0;

View file

@ -144,11 +144,18 @@ float3 LensFlare(float2 uv, float2 pos)
f23 + f43 + f53 + f63
);
// Combine the effects and adjust intensity
float3 c = saturate(sunflare) * 0.5f + lensflare;
c = c * 1.3f - float3(length(uvd) * 0.05f, length(uvd) * 0.05f, length(uvd) * 0.05f);
// Subtle anamorphic glare
float anamorphicScaleX = 1.2f; // Horizontal stretch factor
float anamorphicScaleY = 35.0f; // Vertical compression factor
float2 anamorphicOffset = main; // Center at the lensflare source
float glare = exp(-pow(anamorphicOffset.x * anamorphicScaleX, 2.0f) - pow(anamorphicOffset.y * anamorphicScaleY, 2.0f));
float3 anamorphicGlare = float3(glare * 0.6f, glare * 0.5f, glare * 1.0f) * 0.05f;
return c * intensity;
// Combine the effects and adjust intensity
float3 c = saturate(sunflare) * 0.5f + lensflare + anamorphicGlare;
c = c * 1.3f - float3(length(uvd) * 0.05f, length(uvd) * 0.05f, length(uvd) * 0.05f);
return c * intensity;
}
float3 LensFlareColorCorrection(float3 color, float factor,float factor2)