From 7c8c4ac2f7ec9b6e9f73ece8b54571827cef99ea Mon Sep 17 00:00:00 2001 From: temple Date: Sat, 17 Feb 2018 16:56:12 +0000 Subject: [PATCH] Fix selection rings while garrisoning Differential Revision: https://code.wildfiregames.com/D1158 Reviewed by: elexis, Itms Refs: #2627 This was SVN commit r21241. --- source/simulation2/components/CCmpSelectable.cpp | 13 ------------- .../simulation2/components/CCmpUnitRenderer.cpp | 15 ++++++++------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/source/simulation2/components/CCmpSelectable.cpp b/source/simulation2/components/CCmpSelectable.cpp index d8e1adbdae..a64dfe40bc 100644 --- a/source/simulation2/components/CCmpSelectable.cpp +++ b/source/simulation2/components/CCmpSelectable.cpp @@ -349,19 +349,6 @@ void CCmpSelectable::HandleMessage(const CMessage& msg, bool UNUSED(global)) break; } case MT_PositionChanged: - { - if (m_AlwaysVisible) - { - const CMessagePositionChanged& msgData = static_cast (msg); - if (!msgData.inWorld) - m_Color.a = m_AlphaMin = MIN_ALPHA_UNSELECTED; - else if (!m_Selected) - m_Color.a = m_AlphaMin = MIN_ALPHA_ALWAYS_VISIBLE; - } - - InvalidateStaticOverlay(); - break; - } case MT_TerrainChanged: case MT_WaterChanged: InvalidateStaticOverlay(); diff --git a/source/simulation2/components/CCmpUnitRenderer.cpp b/source/simulation2/components/CCmpUnitRenderer.cpp index e492c8f0fe..7fe440f65c 100644 --- a/source/simulation2/components/CCmpUnitRenderer.cpp +++ b/source/simulation2/components/CCmpUnitRenderer.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2018 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -397,7 +397,13 @@ void CCmpUnitRenderer::RenderSubmit(SceneCollector& collector, const CFrustum& f unit.culled = true; - if (!(unit.actor && unit.inWorld)) + if (!unit.actor) + continue; + + if (unit.visibilityDirty) + UpdateVisibility(unit); + + if (unit.visibility == ICmpRangeManager::VIS_HIDDEN) continue; if (!g_AtlasGameLoop->running && !g_RenderActors && (unit.flags & ACTOR_ONLY)) @@ -409,11 +415,6 @@ void CCmpUnitRenderer::RenderSubmit(SceneCollector& collector, const CFrustum& f if (culling && !frustum.IsSphereVisible(unit.sweptBounds.GetCenter(), unit.sweptBounds.GetRadius())) continue; - if (unit.visibilityDirty) - UpdateVisibility(unit); - if (unit.visibility == ICmpRangeManager::VIS_HIDDEN) - continue; - unit.culled = false; CModelAbstract& unitModel = unit.actor->GetModel();