mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-18 12:33:17 +01:00
Remove numerics from common.h and use it as needed
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "../core/IStream.hpp"
|
||||
#include "../core/Memory.hpp"
|
||||
#include "../core/MemoryStream.h"
|
||||
#include "../core/Numerics.hpp"
|
||||
#include "../core/Path.hpp"
|
||||
#include "../core/String.hpp"
|
||||
#include "../localisation/Localisation.h"
|
||||
@@ -757,11 +758,11 @@ int32_t object_calculate_checksum(const rct_object_entry* entry, const void* dat
|
||||
|
||||
uint32_t checksum = 0xF369A75B;
|
||||
checksum ^= entryBytePtr[0];
|
||||
checksum = rol32(checksum, 11);
|
||||
checksum = Numerics::rol32(checksum, 11);
|
||||
for (int32_t i = 4; i < 12; i++)
|
||||
{
|
||||
checksum ^= entryBytePtr[i];
|
||||
checksum = rol32(checksum, 11);
|
||||
checksum = Numerics::rol32(checksum, 11);
|
||||
}
|
||||
|
||||
const uint8_t* dataBytes = reinterpret_cast<const uint8_t*>(data);
|
||||
@@ -772,12 +773,12 @@ int32_t object_calculate_checksum(const rct_object_entry* entry, const void* dat
|
||||
{
|
||||
checksum ^= dataBytes[j];
|
||||
}
|
||||
checksum = rol32(checksum, 11);
|
||||
checksum = Numerics::rol32(checksum, 11);
|
||||
}
|
||||
for (size_t i = dataLength32; i < dataLength; i++)
|
||||
{
|
||||
checksum ^= dataBytes[i];
|
||||
checksum = rol32(checksum, 11);
|
||||
checksum = Numerics::rol32(checksum, 11);
|
||||
}
|
||||
|
||||
return static_cast<int32_t>(checksum);
|
||||
|
||||
Reference in New Issue
Block a user