mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 05:45:38 +00:00
Common/BitField: Fix off-by-one error for signed types
Fixes Darkstalkers 3 character select screen.
This commit is contained in:
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…
Reference in a new issue