fix(demonware): fix heat map generation

This commit is contained in:
FutureRave 2023-02-02 19:35:30 +00:00
parent b6efb058b3
commit a26500731f
No known key found for this signature in database
GPG Key ID: 22F9079C86CFAB31

View File

@ -93,7 +93,7 @@ namespace demonware
{
for (auto x = 0; x < 256; ++x)
{
auto data = static_cast<uint8_t>(std::clamp<int>(rand(), std::numeric_limits<uint8_t>::min(), std::numeric_limits<uint8_t>::max()));
auto data = std::rand() % std::numeric_limits<std::uint8_t>::max();
if (data % 15 == 0)
{
data = 0xF | ((data & 0x7) << 4) | 0x10;
@ -103,7 +103,7 @@ namespace demonware
data = 0;
}
map[y][x] = data;
map[y][x] = static_cast<std::uint8_t>(data);
}
}