Common/BitField: Fix off-by-one error for signed types

Fixes Darkstalkers 3 character select screen.
pull/474/head
Connor McLaughlin 6 years ago
parent dc1e1b5adf
commit 341b163ca1

@ -119,8 +119,8 @@ struct BitField
}
else if constexpr (std::is_signed_v<DataType>)
{
constexpr int shift = 8 * sizeof(DataType) - BitCount;
return (static_cast<DataType>((data & GetMask()) >> BitIndex) << shift) >> shift;
constexpr int shift = 8 * sizeof(DataType) - BitCount + 1;
return (static_cast<DataType>(data >> BitIndex) << shift) >> shift;
}
else
{

Loading…
Cancel
Save