| 206 | |
| 207 | |
| 208 | void DS1::bindLayerTileReferences(std::vector<Tile> &tiles, const std::vector<DT1> &dt1s) { |
| 209 | for (auto &tile : tiles) { |
| 210 | if (tile.prop1 == 0) |
| 211 | continue; |
| 212 | auto foundTile = false; |
| 213 | for (const auto &dt1 : dt1s) { |
| 214 | if (foundTile) |
| 215 | break; |
| 216 | for (const auto &tileInfo : dt1.tiles) { |
| 217 | if (tileInfo.header.orientation != tile.type) |
| 218 | continue; |
| 219 | if (tileInfo.header.mainIndex != tile.mainIndex) |
| 220 | continue; |
| 221 | if (tileInfo.header.subIndex != tile.subIndex) |
| 222 | continue; |
| 223 | tile.dt1Ref = &dt1; |
| 224 | tile.dt1Index = tileInfo.dt1Index; |
| 225 | if (tile.type == TileType::RightPartOfNorthCornerWall) { |
| 226 | // Get tile with style of LeftPartOfNorthCornerWall |
| 227 | for (const auto &tileInfo2 : dt1.tiles) { |
| 228 | if (tileInfo2.header.orientation != TileType::LeftPartOfNorthCornerWall) |
| 229 | continue; |
| 230 | if (tileInfo2.header.mainIndex != tile.mainIndex) |
| 231 | continue; |
| 232 | if (tileInfo2.header.subIndex != tile.subIndex) |
| 233 | continue; |
| 234 | tile.dt1IndexAlt = tileInfo2.dt1Index; |
| 235 | break; |
| 236 | } |
| 237 | } |
| 238 | foundTile = true; |
| 239 | break; |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | } // namespace Abyss::DataTypes |
nothing calls this directly
no outgoing calls
no test coverage detected