clang-tidy

This commit is contained in:
2026-04-03 09:31:41 +02:00
parent 8dcc1d282a
commit 46dc81124f
25 changed files with 320 additions and 314 deletions

View File

@@ -527,7 +527,7 @@ namespace Rendering {
// ---------------------------------------------------------------------------
// createPipeline
// ---------------------------------------------------------------------------
auto SDL3GPUShader::createPipeline() -> bool {
auto SDL3GPUShader::createPipeline() -> bool { // NOLINT(readability-function-cognitive-complexity)
const SDL_GPUTextureFormat SWAPCHAIN_FMT = SDL_GetGPUSwapchainTextureFormat(device_, window_);
// ---- PostFX pipeline (scene/scaled → swapchain) ----
@@ -770,7 +770,7 @@ namespace Rendering {
// ---------------------------------------------------------------------------
// render — upload scene texture + PostFX pass → swapchain
// ---------------------------------------------------------------------------
void SDL3GPUShader::render() {
void SDL3GPUShader::render() { // NOLINT(readability-function-cognitive-complexity)
if (!is_initialized_) { return; }
// Paso 0: si SS activo, calcular el factor necesario según el zoom actual y recrear si cambió.
@@ -868,9 +868,11 @@ namespace Rendering {
// pixel_scale: subpíxeles por pixel lógico.
// Sin SS: vh/game_height (zoom de ventana).
// Con SS: ss_factor_ exacto (3, 6, 9...).
uniforms_.pixel_scale = (oversample_ > 1 && ss_factor_ > 0)
? static_cast<float>(ss_factor_)
: ((game_height_ > 0) ? (vh / static_cast<float>(game_height_)) : 1.0F);
if (oversample_ > 1 && ss_factor_ > 0) {
uniforms_.pixel_scale = static_cast<float>(ss_factor_);
} else {
uniforms_.pixel_scale = (game_height_ > 0) ? (vh / static_cast<float>(game_height_)) : 1.0F;
}
uniforms_.time = static_cast<float>(SDL_GetTicks()) / 1000.0F;
uniforms_.oversample = (oversample_ > 1 && ss_factor_ > 0)
? static_cast<float>(ss_factor_)
@@ -1266,8 +1268,8 @@ namespace Rendering {
// ---------------------------------------------------------------------------
auto SDL3GPUShader::calcSsFactor(float zoom) -> int {
const int MULTIPLE = 3;
const int n = static_cast<int>(std::ceil(zoom / static_cast<float>(MULTIPLE)));
return std::max(1, n) * MULTIPLE;
const int N = static_cast<int>(std::ceil(zoom / static_cast<float>(MULTIPLE)));
return std::max(1, N) * MULTIPLE;
}
// ---------------------------------------------------------------------------