mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-27 00:34:46 +01:00
Replace custom BitCount implementation with std::popcount (C++20)
This commit is contained in:
@@ -45,9 +45,11 @@
|
||||
#include "Surface.h"
|
||||
#include "TileElement.h"
|
||||
|
||||
#include <bit>
|
||||
#include <iterator>
|
||||
|
||||
using namespace OpenRCT2::TrackMetaData;
|
||||
|
||||
void FootpathUpdateQueueEntranceBanner(const CoordsXY& footpathPos, TileElement* tileElement);
|
||||
|
||||
FootpathSelection gFootpathSelection;
|
||||
@@ -1134,8 +1136,8 @@ void FootpathChainRideQueue(
|
||||
{
|
||||
// Fix #2051: Stop queue paths that are already connected to two other tiles
|
||||
// from connecting to the tile we are coming from.
|
||||
int32_t edges = tileElement->AsPath()->GetEdges();
|
||||
int32_t numEdges = BitCount(edges);
|
||||
uint32_t edges = tileElement->AsPath()->GetEdges();
|
||||
uint32_t numEdges = std::popcount(edges);
|
||||
if (numEdges >= 2)
|
||||
{
|
||||
int32_t requiredEdgeMask = 1 << DirectionReverse(direction);
|
||||
|
||||
Reference in New Issue
Block a user