| 1304 | } |
| 1305 | |
| 1306 | static bool IsTileElementVegetation(const TileElement* tileElement) |
| 1307 | { |
| 1308 | switch (tileElement->getType()) |
| 1309 | { |
| 1310 | case TileElementType::SmallScenery: |
| 1311 | { |
| 1312 | auto sceneryItem = tileElement->asSmallScenery(); |
| 1313 | auto sceneryEntry = sceneryItem->GetEntry(); |
| 1314 | if (sceneryEntry != nullptr |
| 1315 | && (sceneryEntry->flags.has(SmallSceneryFlag::isTree) || IsCursorIdVegetation(sceneryEntry->tool_id))) |
| 1316 | { |
| 1317 | return true; |
| 1318 | } |
| 1319 | break; |
| 1320 | } |
| 1321 | case TileElementType::LargeScenery: |
| 1322 | { |
| 1323 | auto sceneryItem = tileElement->asLargeScenery(); |
| 1324 | auto sceneryEntry = sceneryItem->GetEntry(); |
| 1325 | if (sceneryEntry != nullptr && IsCursorIdVegetation(sceneryEntry->tool_id)) |
| 1326 | { |
| 1327 | return true; |
| 1328 | } |
| 1329 | break; |
| 1330 | } |
| 1331 | case TileElementType::Wall: |
| 1332 | { |
| 1333 | auto sceneryItem = tileElement->asWall(); |
| 1334 | auto sceneryEntry = sceneryItem->GetEntry(); |
| 1335 | if (sceneryEntry != nullptr && IsCursorIdVegetation(sceneryEntry->tool_id)) |
| 1336 | { |
| 1337 | return true; |
| 1338 | } |
| 1339 | break; |
| 1340 | } |
| 1341 | default: |
| 1342 | break; |
| 1343 | } |
| 1344 | return false; |
| 1345 | } |
| 1346 | |
| 1347 | VisibilityKind GetPaintStructVisibility(const PaintStruct* ps, uint32_t viewFlags) |
| 1348 | { |
no test coverage detected