| 73 | template <class S> |
| 74 | class ShapeHistory { |
| 75 | public: |
| 76 | typedef typename std::map<size_t, S>::const_iterator const_iterator; |
| 77 | |
| 78 | ShapeHistory(size_t baseId = 1) |
| 79 | : m_HistoryBase(baseId) |
| 80 | { |
| 81 | } |
| 82 | bool isInHistory(size_t id) const { |
| 83 | return id >= m_HistoryBase; |
| 84 | } |
| 85 | void add(size_t id, S const & e) { |
| 86 | m_Modifications.insert(std::make_pair(id, e)); |
| 87 | if (m_Modifications.size() > 10) { |
| 88 | m_HistoryBase = m_Modifications.begin()->first + 1; |
| 89 | m_Modifications.erase(m_Modifications.begin()); |
| 90 | } |
| 91 | } |
| 92 | void reset(size_t id) { |
| 93 | m_Modifications.clear(); |
| 94 | m_HistoryBase = id; |
| 95 | } |
| 96 | const_iterator end() const { |
| 97 | return m_Modifications.end(); |
| 98 | } |
| 99 | const_iterator get(size_t id) const { |
| 100 | return m_Modifications.lower_bound(id); |
| 101 | } |
| 102 | |
| 103 | private: |
| 104 | std::map<size_t, S> m_Modifications; |
| 105 | size_t m_HistoryBase; |
| 106 | }; |
| 107 | |
| 193 | //m_ExpandPathfinding = entity_pos_t::FromInt(CELL_SIZE / 2); |
| 194 | // Actually that's bad because units get stuck when the A* pathfinder thinks they're |
| 195 | // blocked on all sides, so it's better to underestimate |
| 196 | m_ExpandPathfinding = entity_pos_t::FromInt(0); |
| 197 | |
| 198 | // For AI building foundation planning, we want to definitely block all |
| 199 | // potentially-obstructed tiles (so we don't blindly build on top of an obstruction), |
| 200 | // so we need to expand by at least 1/sqrt(2) of a tile |
| 201 | m_ExpandFoundation = (entity_pos_t::FromInt(CELL_SIZE) * 3) / 4; |
| 202 | |
| 512 | // For tile-based pathfinding: |
| 513 | // Since we only count tiles whose centers are inside the square, |
| 514 | // we maybe want to expand the square a bit so we're less likely to think there's |
| 515 | // free space between buildings when there isn't. But this is just a random guess |
| 516 | // and needs to be tweaked until everything works nicely. |
| 517 | entity_pos_t m_ExpandPathfinding; |
| 518 | entity_pos_t m_ExpandFoundation; |
| 519 | |
| 520 | std::multimap<u32, u32> m_StaticShapesInfluence; // key : a tile index ((i << 16) + j) ; value : index of a static shape influencing the tile |
| 521 | std::multimap<u32, u32> m_UnitShapesInfluence; // key : a tile index ((i << 16) + j) ; value : index of a unit shape influencing the tile |
| 522 | |
| 524 | * Register tiles that are affected by the shape |
| 525 | */ |
| 526 | void RegisterShapeTiles(StaticShape const & shape, u32 id); |
| 527 | void RegisterShapeTiles(UnitShape const & shape, u32 id); |
| 528 | |
| 529 | /** |
| 530 | * Unregister tiles that were affected by the shape |
| 531 | */ |
| 532 | void UnregisterShapeTiles(StaticShape const & shape, u32 id); |
| 533 | void UnregisterShapeTiles(UnitShape const & shape, u32 id); |
| 534 | |
| 535 | /** |
| 536 | * Update obstruction flags of a tile |
| 537 | */ |
| 538 | void UpdateTile(u16 i, u16 j, Grid<u8>& grid); |
| 539 | |
| 540 | /** |
| 541 | * Update obstruction flags of tiles affected by the shape |
| 542 | */ |
| 543 | void UpdateTilesUnderShape(StaticShape const & shape, Grid<u8>& grid, entity_pos_t const & expand); |
| 544 | void UpdateTilesUnderShape(UnitShape const & shape, Grid<u8>& grid, entity_pos_t const & expand); |
| 545 | |
| 546 | |
| 547 | /** |
711 | | PROFILE("Rasterise"); |
| 820 | u16 i0, j0, i1, j1; |
| 821 | NearestTile(center.X - halfBound.X, center.Y - halfBound.Y, i0, j0, grid.m_W, grid.m_H); |
| 822 | NearestTile(center.X + halfBound.X, center.Y + halfBound.Y, i1, j1, grid.m_W, grid.m_H); |
| 823 | for (u16 j = j0; j <= j1; ++j) |
| 824 | { |
| 825 | for (u16 i = i0; i <= i1; ++i) |
| 826 | { |
| 827 | entity_pos_t x, z; |
| 828 | TileCenter(i, j, x, z); |
| 829 | if (Geometry::PointIsInSquare(CFixedVector2D(x, z) - center, shape.u, shape.v, halfSize)) |
| 830 | grid.set(i, j, grid.get(i, j) | modificator); |
| 831 | } |
| 832 | } |
| 833 | } |
| 834 | static void ModifyTilesUnderShape(UnitShape const & shape, Grid<u8>& grid, entity_pos_t const & expand, ICmpObstructionManager::TileObstruction modificator) |
| 835 | { |
| 836 | CFixedVector2D center(shape.x, shape.z); |
| 837 | entity_pos_t r = shape.r + expand; |
713 | | grid.m_DirtyID = m_DirtyID; |
| 839 | u16 i0, j0, i1, j1; |
| 840 | NearestTile(center.X - r, center.Y - r, i0, j0, grid.m_W, grid.m_H); |
| 841 | NearestTile(center.X + r, center.Y + r, i1, j1, grid.m_W, grid.m_H); |
| 842 | for (u16 j = j0; j <= j1; ++j) |
| 843 | for (u16 i = i0; i <= i1; ++i) |
| 844 | grid.set(i, j, grid.get(i, j) | modificator); |
| 845 | } |
715 | | // TODO: this is all hopelessly inefficient |
716 | | // What we should perhaps do is have some kind of quadtree storing Shapes so it's |
717 | | // quick to invalidate and update small numbers of tiles |
| 847 | static bool TileIsUnderShape(u16 i, u16 j, StaticShape const & shape, Grid<u8>& grid, entity_pos_t const & expand) |
| 848 | { |
| 849 | CFixedVector2D center(shape.x, shape.z); |
| 850 | CFixedVector2D halfSize(shape.hw + expand, shape.hh + expand); |
| 851 | CFixedVector2D halfBound = Geometry::GetHalfBoundingBox(shape.u, shape.v, halfSize); |
719 | | grid.reset(); |
| 853 | u16 i0, j0, i1, j1; |
| 854 | NearestTile(center.X - halfBound.X, center.Y - halfBound.Y, i0, j0, grid.m_W, grid.m_H); |
| 855 | NearestTile(center.X + halfBound.X, center.Y + halfBound.Y, i1, j1, grid.m_W, grid.m_H); |
| 856 | if (j >= j0 && j <= j1 && i >= i0 && i <= i1) { |
| 857 | entity_pos_t x, z; |
| 858 | TileCenter(i, j, x, z); |
| 859 | if (Geometry::PointIsInSquare(CFixedVector2D(x, z) - center, shape.u, shape.v, halfSize)) |
| 860 | return true; |
| 861 | } |
| 862 | return false; |
| 863 | } |
| 864 | static bool TileIsUnderShape(u16 i, u16 j, UnitShape const & shape, Grid<u8>& grid, entity_pos_t const & expand) |
| 865 | { |
| 866 | CFixedVector2D center(shape.x, shape.z); |
| 867 | entity_pos_t r = shape.r + expand; |
721 | | // For tile-based pathfinding: |
722 | | // Since we only count tiles whose centers are inside the square, |
723 | | // we maybe want to expand the square a bit so we're less likely to think there's |
724 | | // free space between buildings when there isn't. But this is just a random guess |
725 | | // and needs to be tweaked until everything works nicely. |
726 | | //entity_pos_t expandPathfinding = entity_pos_t::FromInt(CELL_SIZE / 2); |
727 | | // Actually that's bad because units get stuck when the A* pathfinder thinks they're |
728 | | // blocked on all sides, so it's better to underestimate |
729 | | entity_pos_t expandPathfinding = entity_pos_t::FromInt(0); |
| 869 | u16 i0, j0, i1, j1; |
| 870 | NearestTile(center.X - r, center.Y - r, i0, j0, grid.m_W, grid.m_H); |
| 871 | NearestTile(center.X + r, center.Y + r, i1, j1, grid.m_W, grid.m_H); |
| 872 | return (j >= j0 && j <= j1 && i >= i0 && i <= i1); |
| 873 | } |
731 | | // For AI building foundation planning, we want to definitely block all |
732 | | // potentially-obstructed tiles (so we don't blindly build on top of an obstruction), |
733 | | // so we need to expand by at least 1/sqrt(2) of a tile |
734 | | entity_pos_t expandFoundation = (entity_pos_t::FromInt(CELL_SIZE) * 3) / 4; |
| 875 | void CCmpObstructionManager::RegisterShapeTiles(StaticShape const & shape, u32 id) |
| 876 | { |
| 877 | if (shape.flags & (FLAG_BLOCK_PATHFINDING | FLAG_BLOCK_FOUNDATION)) |
| 878 | { |
| 879 | entity_pos_t expand = std::max(m_ExpandPathfinding, m_ExpandFoundation); |
| 880 | CFixedVector2D center(shape.x, shape.z); |
| 881 | CFixedVector2D halfSize(shape.hw + expand, shape.hh + expand); |
| 882 | CFixedVector2D halfBound = Geometry::GetHalfBoundingBox(shape.u, shape.v, halfSize); |
736 | | for (std::map<u32, StaticShape>::iterator it = m_StaticShapes.begin(); it != m_StaticShapes.end(); ++it) |
| 884 | u16 i0 = ((center.X - halfBound.X) / (int)CELL_SIZE).ToInt_RoundToZero(); |
| 885 | u16 j0 = ((center.Y - halfBound.Y) / (int)CELL_SIZE).ToInt_RoundToZero(); |
| 886 | u16 i1 = ((center.X + halfBound.X) / (int)CELL_SIZE).ToInt_RoundToZero(); |
| 887 | u16 j1 = ((center.Y + halfBound.Y) / (int)CELL_SIZE).ToInt_RoundToZero(); |
| 888 | for (u16 j = j0; j <= j1; ++j) |
| 889 | { |
| 890 | for (u16 i = i0; i <= i1; ++i) |
| 891 | { |
| 892 | entity_pos_t x, z; |
| 893 | TileCenter(i, j, x, z); |
| 894 | if (Geometry::PointIsInSquare(CFixedVector2D(x, z) - center, shape.u, shape.v, halfSize)) |
| 895 | { |
| 896 | u32 key = (i << 16) + j; |
| 897 | m_StaticShapesInfluence.insert(std::make_pair(key, id)); |
| 898 | } |
| 899 | } |
| 900 | } |
| 901 | } |
| 902 | } |
| 903 | |
| 904 | void CCmpObstructionManager::RegisterShapeTiles(UnitShape const & shape, u32 id) |
| 905 | { |
| 906 | if (shape.flags & (FLAG_BLOCK_PATHFINDING | FLAG_BLOCK_FOUNDATION)) |
745 | | u16 i0, j0, i1, j1; |
746 | | NearestTile(center.X - halfBound.X, center.Y - halfBound.Y, i0, j0, grid.m_W, grid.m_H); |
747 | | NearestTile(center.X + halfBound.X, center.Y + halfBound.Y, i1, j1, grid.m_W, grid.m_H); |
748 | | for (u16 j = j0; j <= j1; ++j) |
| 927 | void CCmpObstructionManager::UnregisterShapeTiles(StaticShape const & shape, u32 id) |
| 928 | { |
| 929 | if (shape.flags & (FLAG_BLOCK_PATHFINDING | FLAG_BLOCK_FOUNDATION)) |
| 930 | { |
| 931 | entity_pos_t expand = std::max(m_ExpandPathfinding, m_ExpandFoundation); |
| 932 | CFixedVector2D center(shape.x, shape.z); |
| 933 | CFixedVector2D halfSize(shape.hw + expand, shape.hh + expand); |
| 934 | CFixedVector2D halfBound = Geometry::GetHalfBoundingBox(shape.u, shape.v, halfSize); |
| 935 | |
| 936 | u16 i0 = ((center.X - halfBound.X) / (int)CELL_SIZE).ToInt_RoundToZero(); |
| 937 | u16 j0 = ((center.Y - halfBound.Y) / (int)CELL_SIZE).ToInt_RoundToZero(); |
| 938 | u16 i1 = ((center.X + halfBound.X) / (int)CELL_SIZE).ToInt_RoundToZero(); |
| 939 | u16 j1 = ((center.Y + halfBound.Y) / (int)CELL_SIZE).ToInt_RoundToZero(); |
| 940 | for (u16 j = j0; j <= j1; ++j) |
| 941 | { |
| 942 | for (u16 i = i0; i <= i1; ++i) |
752 | | entity_pos_t x, z; |
753 | | TileCenter(i, j, x, z); |
754 | | if (Geometry::PointIsInSquare(CFixedVector2D(x, z) - center, it->second.u, it->second.v, halfSize)) |
755 | | grid.set(i, j, grid.get(i, j) | TILE_OBSTRUCTED_PATHFINDING); |
| 948 | typedef std::multimap<u32, u32>::iterator iterator_t; |
| 949 | u32 key = (i << 16) + j; |
| 950 | std::pair<iterator_t, iterator_t> range = m_StaticShapesInfluence.equal_range(key); |
| 951 | while (range.first != range.second) |
| 952 | { |
| 953 | if (range.first->second == id) { |
| 954 | iterator_t to_erase = range.first; |
| 955 | ++range.first; |
| 956 | m_StaticShapesInfluence.erase(to_erase); |
| 957 | }else { |
| 958 | ++range.first; |
| 959 | } |
| 960 | } |
760 | | if (it->second.flags & FLAG_BLOCK_FOUNDATION) |
| 967 | void CCmpObstructionManager::UnregisterShapeTiles(UnitShape const & shape, u32 id) |
| 968 | { |
| 969 | if (shape.flags & (FLAG_BLOCK_PATHFINDING | FLAG_BLOCK_FOUNDATION)) |
| 970 | { |
| 971 | entity_pos_t expand = std::max(m_ExpandPathfinding, m_ExpandFoundation); |
| 972 | CFixedVector2D center(shape.x, shape.z); |
| 973 | entity_pos_t r = shape.r + expand; |
| 974 | |
| 975 | u16 i0 = ((center.X - r) / (int)CELL_SIZE).ToInt_RoundToZero(); |
| 976 | u16 j0 = ((center.Y - r) / (int)CELL_SIZE).ToInt_RoundToZero(); |
| 977 | u16 i1 = ((center.X + r) / (int)CELL_SIZE).ToInt_RoundToZero(); |
| 978 | u16 j1 = ((center.Y + r) / (int)CELL_SIZE).ToInt_RoundToZero(); |
| 979 | for (u16 j = j0; j <= j1; ++j) |
762 | | CFixedVector2D halfSize(it->second.hw + expandFoundation, it->second.hh + expandFoundation); |
763 | | CFixedVector2D halfBound = Geometry::GetHalfBoundingBox(it->second.u, it->second.v, halfSize); |
764 | | |
765 | | u16 i0, j0, i1, j1; |
766 | | NearestTile(center.X - halfBound.X, center.Y - halfBound.Y, i0, j0, grid.m_W, grid.m_H); |
767 | | NearestTile(center.X + halfBound.X, center.Y + halfBound.Y, i1, j1, grid.m_W, grid.m_H); |
768 | | for (u16 j = j0; j <= j1; ++j) |
| 981 | for (u16 i = i0; i <= i1; ++i) |
781 | | for (std::map<u32, UnitShape>::iterator it = m_UnitShapes.begin(); it != m_UnitShapes.end(); ++it) |
| 1001 | void CCmpObstructionManager::UpdateTile(u16 i, u16 j, Grid<uint8_t>& grid) |
| 1002 | { |
| 1003 | typedef std::multimap<u32, u32>::const_iterator iterator_t; |
| 1004 | u8 tile = 0; |
| 1005 | u8 full = (TILE_OBSTRUCTED_PATHFINDING | TILE_OBSTRUCTED_FOUNDATION); |
| 1006 | |
| 1007 | u32 key = (i << 16) + j; |
| 1008 | std::pair<iterator_t, iterator_t> range = m_StaticShapesInfluence.equal_range(key); |
| 1009 | while (range.first != range.second) |
783 | | CFixedVector2D center(it->second.x, it->second.z); |
| 1011 | StaticShape const & shape = m_StaticShapes[range.first->second]; |
| 1012 | if (shape.flags & FLAG_BLOCK_PATHFINDING) { |
| 1013 | if (TileIsUnderShape(i, j, shape, grid, m_ExpandPathfinding)) { |
| 1014 | tile |= TILE_OBSTRUCTED_PATHFINDING; |
| 1015 | } |
| 1016 | } |
| 1017 | if (shape.flags & FLAG_BLOCK_FOUNDATION) { |
| 1018 | if (TileIsUnderShape(i, j, shape, grid, m_ExpandFoundation)) { |
| 1019 | tile |= TILE_OBSTRUCTED_FOUNDATION; |
| 1020 | } |
| 1021 | } |
785 | | if (it->second.flags & FLAG_BLOCK_PATHFINDING) |
| 1023 | if (tile == full) { |
| 1024 | break; |
| 1025 | } |
| 1026 | |
| 1027 | ++range.first; |
| 1028 | } |
| 1029 | |
| 1030 | range = m_UnitShapesInfluence.equal_range(key); |
| 1031 | while (tile != full && range.first != range.second) |
| 1032 | { |
| 1033 | UnitShape const & shape = m_UnitShapes[range.first->second]; |
| 1034 | if (shape.flags & FLAG_BLOCK_PATHFINDING) { |
| 1035 | if (TileIsUnderShape(i, j, shape, grid, m_ExpandPathfinding)) { |
| 1036 | tile |= TILE_OBSTRUCTED_PATHFINDING; |
| 1037 | } |
| 1038 | } |
| 1039 | if (shape.flags & FLAG_BLOCK_FOUNDATION) { |
| 1040 | if (TileIsUnderShape(i, j, shape, grid, m_ExpandFoundation)) { |
| 1041 | tile |= TILE_OBSTRUCTED_FOUNDATION; |
| 1042 | } |
| 1043 | } |
| 1044 | |
| 1045 | ++range.first; |
| 1046 | } |
| 1047 | |
| 1048 | grid.set(i, j, tile); |
| 1049 | } |
| 1050 | |
| 1051 | void CCmpObstructionManager::UpdateTilesUnderShape(StaticShape const & shape, Grid<u8>& grid, entity_pos_t const & expand) |
| 1052 | { |
| 1053 | CFixedVector2D center(shape.x, shape.z); |
| 1054 | CFixedVector2D halfSize(shape.hw + expand, shape.hh + expand); |
| 1055 | CFixedVector2D halfBound = Geometry::GetHalfBoundingBox(shape.u, shape.v, halfSize); |
| 1056 | |
| 1057 | u16 i0, j0, i1, j1; |
| 1058 | NearestTile(center.X - halfBound.X, center.Y - halfBound.Y, i0, j0, grid.m_W, grid.m_H); |
| 1059 | NearestTile(center.X + halfBound.X, center.Y + halfBound.Y, i1, j1, grid.m_W, grid.m_H); |
| 1060 | for (u16 j = j0; j <= j1; ++j) |
| 1061 | { |
| 1062 | for (u16 i = i0; i <= i1; ++i) |
787 | | entity_pos_t r = it->second.r + expandPathfinding; |
| 1064 | entity_pos_t x, z; |
| 1065 | TileCenter(i, j, x, z); |
| 1066 | if (Geometry::PointIsInSquare(CFixedVector2D(x, z) - center, shape.u, shape.v, halfSize)) |
| 1067 | { |
| 1068 | UpdateTile(i, j, grid); |
| 1069 | } |
| 1070 | } |
| 1071 | } |
| 1072 | } |
| 1073 | void CCmpObstructionManager::UpdateTilesUnderShape(UnitShape const & shape, Grid<u8>& grid, entity_pos_t const & expand) |
| 1074 | { |
| 1075 | CFixedVector2D center(shape.x, shape.z); |
| 1076 | entity_pos_t r = shape.r + expand; |
789 | | u16 i0, j0, i1, j1; |
790 | | NearestTile(center.X - r, center.Y - r, i0, j0, grid.m_W, grid.m_H); |
791 | | NearestTile(center.X + r, center.Y + r, i1, j1, grid.m_W, grid.m_H); |
792 | | for (u16 j = j0; j <= j1; ++j) |
793 | | for (u16 i = i0; i <= i1; ++i) |
794 | | grid.set(i, j, grid.get(i, j) | TILE_OBSTRUCTED_PATHFINDING); |
| 1078 | u16 i0, j0, i1, j1; |
| 1079 | NearestTile(center.X - r, center.Y - r, i0, j0, grid.m_W, grid.m_H); |
| 1080 | NearestTile(center.X + r, center.Y + r, i1, j1, grid.m_W, grid.m_H); |
| 1081 | for (u16 j = j0; j <= j1; ++j) |
| 1082 | for (u16 i = i0; i <= i1; ++i) |
| 1083 | UpdateTile(i, j, grid); |
| 1084 | } |
| 1085 | |
| 1086 | bool CCmpObstructionManager::Rasterise(Grid<u8>& grid) |
| 1087 | { |
| 1088 | if (!IsDirty(grid)) |
| 1089 | return false; |
| 1090 | |
| 1091 | PROFILE("Rasterise"); |
| 1092 | TIMER_ACCRUE(tc_Rasterize); |
| 1093 | |
| 1094 | if (!m_StaticHistory.isInHistory(grid.m_DirtyID) || !m_UnitHistory.isInHistory(grid.m_DirtyID)) { |
| 1095 | // Some pieces of history are missing, we need to recompute the entire grid |
| 1096 | grid.reset(); |
| 1097 | for (std::map<u32, StaticShape>::iterator it = m_StaticShapes.begin(); it != m_StaticShapes.end(); ++it) |
| 1098 | { |
| 1099 | if (it->second.flags & FLAG_BLOCK_PATHFINDING) |
| 1100 | ModifyTilesUnderShape(it->second, grid, m_ExpandPathfinding, TILE_OBSTRUCTED_PATHFINDING); |
| 1101 | |
| 1102 | if (it->second.flags & FLAG_BLOCK_FOUNDATION) |
| 1103 | ModifyTilesUnderShape(it->second, grid, m_ExpandFoundation, TILE_OBSTRUCTED_FOUNDATION); |
801 | | u16 i0, j0, i1, j1; |
802 | | NearestTile(center.X - r, center.Y - r, i0, j0, grid.m_W, grid.m_H); |
803 | | NearestTile(center.X + r, center.Y + r, i1, j1, grid.m_W, grid.m_H); |
804 | | for (u16 j = j0; j <= j1; ++j) |
805 | | for (u16 i = i0; i <= i1; ++i) |
806 | | grid.set(i, j, grid.get(i, j) | TILE_OBSTRUCTED_FOUNDATION); |
| 1111 | if (it->second.flags & FLAG_BLOCK_FOUNDATION) |
| 1112 | ModifyTilesUnderShape(it->second, grid, m_ExpandFoundation, TILE_OBSTRUCTED_FOUNDATION); |
| 1114 | }else { |
| 1115 | // We'll recompute only needed tiles according to history |
| 1116 | |
| 1117 | entity_pos_t maxExpand = std::max(m_ExpandPathfinding, m_ExpandFoundation); |
| 1118 | |
| 1119 | // Compute tiles under modified static shapes |
| 1120 | ShapeHistory<StaticShape>::const_iterator srmit = m_StaticHistory.get(grid.m_DirtyID); |
| 1121 | ShapeHistory<StaticShape>::const_iterator srmend = m_StaticHistory.end(); |
| 1122 | while (srmit != srmend) { |
| 1123 | if (srmit->second.flags & (FLAG_BLOCK_PATHFINDING | FLAG_BLOCK_FOUNDATION)) { |
| 1124 | UpdateTilesUnderShape(srmit->second, grid, maxExpand); |
| 1125 | } |
| 1126 | |
| 1127 | ++srmit; |
| 1128 | } |
| 1129 | |
| 1130 | // Reset tiles under removed unit shapes |
| 1131 | ShapeHistory<UnitShape>::const_iterator urmit = m_UnitHistory.get(grid.m_DirtyID); |
| 1132 | ShapeHistory<UnitShape>::const_iterator urmend = m_UnitHistory.end(); |
| 1133 | while (urmit != urmend) { |
| 1134 | if (urmit->second.flags & (FLAG_BLOCK_PATHFINDING | FLAG_BLOCK_FOUNDATION)) { |
| 1135 | UpdateTilesUnderShape(urmit->second, grid, maxExpand); |
| 1136 | } |
| 1137 | |
| 1138 | ++urmit; |
| 1139 | } |