0x00498C6B roadObjId : bh townDensity : 0x01135C5F return : edi
| 866 | // townDensity : 0x01135C5F |
| 867 | // return : edi |
| 868 | static uint32_t getStreetLightStyle(uint8_t roadObjId, uint8_t townDensity) |
| 869 | { |
| 870 | auto* roadObj = ObjectManager::get<RoadObject>(roadObjId); |
| 871 | if (!roadObj->hasFlags(RoadObjectFlags::canHaveStreetLights) || townDensity == 0) |
| 872 | { |
| 873 | return 0; |
| 874 | } |
| 875 | |
| 876 | return []() { |
| 877 | auto* streetLightObj = ObjectManager::get<StreetLightObject>(); |
| 878 | const auto curYear = getCurrentYear(); |
| 879 | for (auto i = 0U; i < std::size(streetLightObj->designedYear); ++i) |
| 880 | { |
| 881 | if (curYear < streetLightObj->designedYear[i]) |
| 882 | { |
| 883 | return i; |
| 884 | } |
| 885 | } |
| 886 | return static_cast<uint32_t>(std::size(streetLightObj->designedYear)); |
| 887 | }(); |
| 888 | } |
| 889 | |
| 890 | // 0x0047AC3E |
| 891 | static RoadInformation getRoadInformation(const World::Pos3& loc, Vehicles::TrackAndDirection::_RoadAndDirection tad) |
no test coverage detected