1
0
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:
Aaron van Geffen
2024-07-12 14:30:55 +02:00
parent 6072545c0c
commit 6bea2e8190
4 changed files with 8 additions and 56 deletions

View File

@@ -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);