From 0bf4bf41f8c14e00d3af974d6c85197624eeda9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Wed, 16 Apr 2025 18:29:55 +0200 Subject: [PATCH] Take COLOUR_HEAT into account in heat display limit calculation --- src/graphics/Renderer.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index a975cc1df..bc0505a73 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -1389,19 +1389,22 @@ void Renderer::AdjustHdispLimit() if (std::holds_alternative(wantHdispLimitMin) || std::holds_alternative(wantHdispLimitMax)) { - auto &sd = SimulationData::CRef(); - for (int i = 0; i <= sim->parts.lastActiveIndex; ++i) + if (colorMode & COLOUR_HEAT) { - auto t = sim->parts[i].type; - if (t > 0 && t < PT_NUM) + auto &sd = SimulationData::CRef(); + for (int i = 0; i <= sim->parts.lastActiveIndex; ++i) { - if (!sd.elements[t].HeatConduct) + auto t = sim->parts[i].type; + if (t > 0 && t < PT_NUM) { - continue; + if (!sd.elements[t].HeatConduct) + { + continue; + } + auto nx = int(sim->parts[i].x + 0.5f); + auto ny = int(sim->parts[i].y + 0.5f); + visit({ nx, ny }, sim->parts[i].temp); } - auto nx = int(sim->parts[i].x + 0.5f); - auto ny = int(sim->parts[i].y + 0.5f); - visit({ nx, ny }, sim->parts[i].temp); } } if (sim->aheat_enable && (displayMode & DISPLAY_AIR) && (displayMode & DISPLAY_AIRH))