0x004AAC02
| 69 | |
| 70 | // 0x004AAC02 |
| 71 | void VehicleBogie::updateRoll(const int32_t unkDistance) |
| 72 | { |
| 73 | auto unk = unkDistance / 8; |
| 74 | if (has38Flags(Flags38::isReversed)) |
| 75 | { |
| 76 | unk = -unk; |
| 77 | } |
| 78 | var_44 += unk; |
| 79 | |
| 80 | if (objectSpriteType != 0xFF) |
| 81 | { |
| 82 | auto* vehObj = ObjectManager::get<VehicleObject>(objectId); |
| 83 | auto& bogieSprites = vehObj->bogieSprites[objectSpriteType]; |
| 84 | const auto newAnimationIndex = (bogieSprites.numAnimationFrames - 1) & (var_44 / 4096); |
| 85 | if (newAnimationIndex != animationIndex) |
| 86 | { |
| 87 | animationIndex = newAnimationIndex; |
| 88 | invalidateSprite(); |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | // To replace several instances of the same exact code in |
| 94 | // VehicleBogie::updateSegmentCrashed(). Returns true if the |
no outgoing calls
no test coverage detected