This commit is contained in:
Lwmte 2024-12-22 19:57:12 +01:00
parent bcf4dc5497
commit b75d14184f
2 changed files with 10 additions and 10 deletions

View file

@ -1260,7 +1260,7 @@ void TriggerDynamicSpotLight(const Vector3& pos, const Vector3& dir, const Color
// Deprecated. Use above version instead. // Deprecated. Use above version instead.
void TriggerDynamicLight(int x, int y, int z, short falloff, byte r, byte g, byte b) void TriggerDynamicLight(int x, int y, int z, short falloff, byte r, byte g, byte b)
{ {
g_Renderer.AddDynamicPointLight(Vector3(x, y, z), (float)(falloff * UCHAR_MAX), Color(r / (float)UCHAR_MAX, g / (float)UCHAR_MAX, b / (float)UCHAR_MAX), false); g_Renderer.AddDynamicPointLight(Vector3(x, y, z), (float)(falloff * UCHAR_MAX), Color(r / (float)CHAR_MAX, g / (float)CHAR_MAX, b / (float)CHAR_MAX), false);
} }
void SpawnPlayerWaterSurfaceEffects(const ItemInfo& item, int waterHeight, int waterDepth) void SpawnPlayerWaterSurfaceEffects(const ItemInfo& item, int waterHeight, int waterDepth)

View file

@ -1567,7 +1567,7 @@ namespace TEN::Renderer
RendererLight dynamicLight = {}; RendererLight dynamicLight = {};
dynamicLight.Color = Vector3(color.x, color.y, color.z) * 2.0f; dynamicLight.Color = Vector3(color.x, color.y, color.z);
if (falloff < 8) if (falloff < 8)
dynamicLight.Color *= (falloff / 8.0f); dynamicLight.Color *= (falloff / 8.0f);
@ -1604,7 +1604,7 @@ namespace TEN::Renderer
RendererLight dynamicLight = {}; RendererLight dynamicLight = {};
dynamicLight.Color = Vector3(color.x, color.y, color.z) * 2.0f; dynamicLight.Color = Vector3(color.x, color.y, color.z);
if (radius < BLOCK(2)) if (radius < BLOCK(2))
dynamicLight.Color *= (radius / BLOCK(2)); dynamicLight.Color *= (radius / BLOCK(2));
@ -1637,13 +1637,13 @@ namespace TEN::Renderer
return prevLight.Hash == light.Hash; return prevLight.Hash == light.Hash;
}); });
if (it == previousList.end()) if (it != previousList.end())
return; {
// If a matching light is found, copy its data.
// If a matching light is found, copy its data. const auto& prevLight = *it;
const auto& prevLight = *it; light.PrevPosition = prevLight.Position;
light.PrevPosition = prevLight.Position; light.PrevDirection = prevLight.Direction;
light.PrevDirection = prevLight.Direction; }
} }
// Queue dynamic light. // Queue dynamic light.