From 51dbeb26dff4383bca3f21100833a30a4afc9fa3 Mon Sep 17 00:00:00 2001 From: mortenlyhr Date: Mon, 23 Nov 2026 18:11:59 +0100 Subject: [PATCH] No unit flags while Combat Zoom is in on a battle Seen in Wine (BtS + BUG/BULL, backlog #98, batch 3 film combat.mov): with Combat Zoom on, while the camera is in close over a fight, the original shows no unit flag anywhere on the screen, the bystanders' too; with it off only the two fighting plots lose theirs, which OpenCiv4 already did. OpenCiv4 kept the other plots' flags and health bars. MapView::Options::battleZoom follows MapWindow's battle view (CAMERALOOKAT_BATTLE_ZOOM_IN, until the core lets go of the camera); while it is on, no 3D flags, health bars, or the overlay's flat emblems (the overlay's fallback for a plot without a 3D flag) are drawn. Co-Authored-By: Claude Opus 5.5 --- src/render/MapView.cpp | 7 ++++--- src/render/MapView.h | 4 ++++ src/render/MapWindow.cpp | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/render/MapView.cpp b/src/render/MapView.cpp index bae1b955..456c64d4 100644 --- a/src/render/MapView.cpp +++ b/src/render/MapView.cpp @@ -4923,9 +4923,9 @@ float4 PSWater(WaterOut i) : SV_Target // (the selection rings under the units: the figures on them cover them) m->ringsDrawn = m->drawRings(); m->drawInstances(m->units, frustum, true); - if (options.flags) + if (options.flags && !options.battleZoom) m->drawFlags(frustum); - if (options.flags && options.healthBars && m->renderer.camera().distance > m->map.cameraMinDistance + 0.5f && + if (options.flags && !options.battleZoom && options.healthBars && m->renderer.camera().distance > m->map.cameraMinDistance + 0.5f && m->renderer.camera().distance < 22 * m->S()) m->drawHealthBars(frustum); } @@ -4999,7 +4999,8 @@ float4 PSWater(WaterOut i) : SV_Target return x > -50 && x < W + 50 && y > -50 && y < H + 50; }; // The units' flags: the visible owner's decal and colours, health, and stack count. - if (options.flags && options.units && distance < 22 && m->renderer.camera().distance > m->map.cameraMinDistance + 0.5f) + // (none while the camera is in close over a battle: Combat Zoom, as drawFlags) + if (options.flags && !options.battleZoom && options.units && distance < 22 && m->renderer.camera().distance > m->map.cameraMinDistance + 0.5f) for (const UnitView& u : m->map.units) { const int plot = u.x + u.y * m->map.width; diff --git a/src/render/MapView.h b/src/render/MapView.h index 4dabad46..93307008 100644 --- a/src/render/MapView.h +++ b/src/render/MapView.h @@ -34,6 +34,10 @@ namespace oc4::render // A city's screen is up: as the original, no units (nor their flags and health) and no // city bars on the map; the cities, signs and plots stay. bool cityScreen = false; + // The camera is in close over a battle (Combat Zoom): as the original, no unit's flag nor + // health bar anywhere on the map until it backs out (seen in Wine; without Combat Zoom + // only the fighters' plots lose theirs). + bool battleZoom = false; }; MapView(Renderer& renderer, const AssetResolver& assets); diff --git a/src/render/MapWindow.cpp b/src/render/MapWindow.cpp index 0ba01cd3..325ec389 100644 --- a/src/render/MapWindow.cpp +++ b/src/render/MapWindow.cpp @@ -1681,6 +1681,7 @@ namespace oc4::render // (beyond the map: black as the ground not seen, until the team's map is centred) renderer->beginFrame(camera, view->seenBounds() ? Vec3{ 0, 0, 0 } : Vec3{ 0.05f, 0.07f, 0.10f }); view->options.cityScreen = cityView; + view->options.battleZoom = battleView; view->draw(); renderer->endFrame(); syncHeads();