0x00440B0A
| 80 | |
| 81 | // 0x00440B0A |
| 82 | VehicleCrashParticle* VehicleCrashParticle::create(const World::Pos3& loc, const ColourScheme colourScheme) |
| 83 | { |
| 84 | auto t = static_cast<VehicleCrashParticle*>(EntityManager::createEntityMisc()); |
| 85 | if (t != nullptr) |
| 86 | { |
| 87 | t->colourScheme = colourScheme; |
| 88 | t->spriteWidth = 8; |
| 89 | t->spriteHeightNegative = 8; |
| 90 | t->spriteHeightPositive = 8; |
| 91 | t->baseType = EntityBaseType::effect; |
| 92 | t->moveTo(loc); |
| 93 | t->setSubType(EffectType::vehicleCrashParticle); |
| 94 | |
| 95 | const auto rand = gPrng1().randNext(); |
| 96 | t->frame = (rand & 0xFF) * 12; |
| 97 | t->timeToLive = 140 + (rand & 0x7F); |
| 98 | // rand value from 0 - 4 inclusive |
| 99 | t->crashedSpriteBase = (((rand >> 23) & 0xFF) * 5) >> 8; |
| 100 | |
| 101 | t->accelerationX = static_cast<int16_t>(rand & 0xFFFF) * 4; |
| 102 | t->accelerationY = static_cast<int16_t>((rand >> 16) & 0xFFFF) * 4; |
| 103 | t->accelerationZ = ((rand >> 8) & 0xFFFF) * 4 + 0x10000; |
| 104 | t->velocity = { 0, 0, 0 }; |
| 105 | } |
| 106 | return t; |
| 107 | } |
| 108 | } |
nothing calls this directly
no test coverage detected