| 1074 | } |
| 1075 | |
| 1076 | void CEditorMap::PlaceBorderTiles() |
| 1077 | { |
| 1078 | std::shared_ptr<CLayerTiles> pT = std::static_pointer_cast<CLayerTiles>(SelectedLayerType(0, LAYERTYPE_TILES)); |
| 1079 | |
| 1080 | for(int i = 0; i < pT->m_Width * pT->m_Height; ++i) |
| 1081 | { |
| 1082 | if(i % pT->m_Width < 2 || i % pT->m_Width > pT->m_Width - 3 || i < pT->m_Width * 2 || i > pT->m_Width * (pT->m_Height - 2)) |
| 1083 | { |
| 1084 | int x = i % pT->m_Width; |
| 1085 | int y = i / pT->m_Width; |
| 1086 | |
| 1087 | CTile Current = pT->m_pTiles[i]; |
| 1088 | Current.m_Index = 1; |
| 1089 | pT->SetTile(x, y, Current); |
| 1090 | } |
| 1091 | } |
| 1092 | |
| 1093 | int GameGroupIndex = std::find(m_vpGroups.begin(), m_vpGroups.end(), m_pGameGroup) - m_vpGroups.begin(); |
| 1094 | m_EditorHistory.RecordAction(std::make_shared<CEditorBrushDrawAction>(this, GameGroupIndex), "Tool 'Make borders'"); |
| 1095 | |
| 1096 | OnModify(); |
| 1097 | } |
no test coverage detected