0x0048864C
| 211 | |
| 212 | // 0x0048864C |
| 213 | void paintSignal(PaintSession& session, const World::SignalElement& elSignal) |
| 214 | { |
| 215 | if (elSignal.isAiAllocated()) |
| 216 | { |
| 217 | return; |
| 218 | } |
| 219 | |
| 220 | auto* elTrack = elSignal.prev()->as<World::TrackElement>(); |
| 221 | if (elTrack == nullptr) |
| 222 | { |
| 223 | return; |
| 224 | } |
| 225 | if (elSignal.isGhost() |
| 226 | && CompanyManager::getSecondaryPlayerId() != CompanyId::null |
| 227 | && elTrack->owner() == CompanyManager::getSecondaryPlayerId()) |
| 228 | { |
| 229 | return; |
| 230 | } |
| 231 | |
| 232 | if (session.getRenderTarget()->zoomLevel > 1) |
| 233 | { |
| 234 | return; |
| 235 | } |
| 236 | |
| 237 | const coord_t height = elSignal.baseHeight(); |
| 238 | const auto trackId = elTrack->trackId(); |
| 239 | const uint8_t rotation = (session.getRotation() + elSignal.rotation()) & 0x3; |
| 240 | if (elTrack->sequenceIndex() == 0) |
| 241 | { |
| 242 | auto& leftSignal = elSignal.getLeft(); |
| 243 | const bool leftIsGhost = elSignal.isGhost() || elSignal.isLeftGhost(); |
| 244 | paintSignalSide(session, leftSignal, false, leftIsGhost, trackId, rotation, height); |
| 245 | } |
| 246 | if (!elTrack->isFlag6()) |
| 247 | { |
| 248 | return; |
| 249 | } |
| 250 | |
| 251 | auto& rightSignal = elSignal.getRight(); |
| 252 | const bool rightIsGhost = elSignal.isGhost() || elSignal.isRightGhost(); |
| 253 | paintSignalSide(session, rightSignal, true, rightIsGhost, trackId, rotation, height); |
| 254 | } |
| 255 | } |
no test coverage detected