Cleanup code

This commit is contained in:
SirLynix
2024-02-02 17:31:12 +01:00
parent adc6a5c0a5
commit 06a42b4ecb
3 changed files with 11 additions and 9 deletions

View File

@@ -82,7 +82,7 @@ int main()
for (auto&& [offset, dims] : boxes)
{
taskScheduler.AddTask([&, offset, dims]
taskScheduler.AddTask([&, offset = offset, dims = dims]
{
thread_local std::size_t threadId = ++threadCounter;

View File

@@ -37,8 +37,8 @@ Nz::Color RayColor(const SceneData& sceneData, const Nz::Rayd& r)
else
{
Nz::Vector3d unitDirection = Nz::Vector3d::Normalize(r.direction);
double a = 0.5 * (unitDirection.y + 1.0);
return (1.0 - a) * Nz::Color(1.0, 1.0, 1.0) + a * Nz::Color(0.5, 0.7, 1.0);
float a = static_cast<float>(0.5 * (unitDirection.y + 1.0));
return (1.f - a) * Nz::Color(1.0, 1.0, 1.0) + a * Nz::Color(0.5, 0.7, 1.0);
}
}