| 238 | namespace AdditionStyle1 |
| 239 | { |
| 240 | static void paintSupport(PaintSession& session, const RoadAdditionSupport& tppaSupport, const uint8_t rotation, const ImageId baseImageId, int16_t height) |
| 241 | { |
| 242 | TrackRoadAdditionSupports support{}; |
| 243 | support.height = height + tppaSupport.height; |
| 244 | support.occupiedSegments = session.getOccupiedAdditionSupportSegments(); |
| 245 | uint8_t i = 0; |
| 246 | auto segments = enumValue(tppaSupport.segments[rotation]); |
| 247 | for (auto seg = Numerics::bitScanForward(segments); seg != -1; seg = Numerics::bitScanForward(segments)) |
| 248 | { |
| 249 | segments &= ~(1U << seg); |
| 250 | assert(i < 2); |
| 251 | |
| 252 | support.segmentFrequency[seg] = tppaSupport.frequencies[rotation]; |
| 253 | support.segmentImages[seg] = baseImageId.withIndexOffset(tppaSupport.imageIds[rotation][i * 2]).toUInt32(); |
| 254 | support.segmentInteractionItem[seg] = session.getCurrentItem(); |
| 255 | support.segmentInteractionType[seg] = session.getItemType(); |
| 256 | i++; |
| 257 | } |
| 258 | session.setAdditionSupport(support); |
| 259 | } |
| 260 | |
| 261 | static void paintRoadAdditionPPMergeable(PaintSession& session, const World::RoadElement& elRoad, const uint8_t rotation, const ImageId baseImageId, const RoadPaintAdditionPiece& tppa) |
| 262 | { |
no test coverage detected