Skip to content

Commit

Permalink
Update Source/engine/palette.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Gleb Mazovetskiy <glex.spb@gmail.com>
  • Loading branch information
kphoenix137 and glebm authored Feb 4, 2025
1 parent 526f90f commit f36c2ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/engine/palette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void ApplyToneMapping(std::array<SDL_Color, 256> &dst,
float x = i / 255.0f;
// Our quadratic tone mapping: f(x) = a*x^2 + (1-a)*x.
const float y = std::clamp(a * x * x + (1.0f - a) * x, 0.0f, 1.0f);
toneMap[i] = static_cast<Uint8>(y * 255.0f + 0.5f);
toneMap[i] = static_cast<uint8_t>(y * 255.0f + 0.5f);
}

// Apply the lookup table to each color channel in the palette.
Expand Down

0 comments on commit f36c2ca

Please sign in to comment.