Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/render/MapView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/render/MapView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/render/MapWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading