Browse Source

Fix crashes at startup in Win9x builds

pull/7801/head^2
staphen 9 months ago committed by Anders Jenbo
parent
commit
82868d5dfb
  1. 4
      Source/control.cpp
  2. 2
      Source/engine/random.hpp

4
Source/control.cpp

@ -145,8 +145,8 @@ Rectangle MainPanelButtonRect[8] = {
Rectangle LevelButtonRect = { { 40, -39 }, { 41, 22 } };
int BeltItems = 8;
Size BeltSize { (INV_SLOT_SIZE_PX + 1) * BeltItems, INV_SLOT_SIZE_PX };
constexpr int BeltItems = 8;
constexpr Size BeltSize { (INV_SLOT_SIZE_PX + 1) * BeltItems, INV_SLOT_SIZE_PX };
Rectangle BeltRect { { 205, 5 }, BeltSize };
Rectangle SpellButtonRect { { 565, 64 }, { 56, 56 } };

2
Source/engine/random.hpp

@ -272,10 +272,12 @@ private:
{
seed(timeSeed());
#if !(defined(WINVER) && WINVER <= 0x0500 && (!defined(_WIN32_WINNT) || _WIN32_WINNT == 0))
static std::random_device rd;
std::uniform_int_distribution<uint32_t> dist;
for (uint32_t &cell : s)
cell ^= dist(rd);
#endif
}
static uint64_t timeSeed();

Loading…
Cancel
Save