From f01fdb7e2a7c1693a0b1bc3ccb27baabc8f6a450 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Thu, 8 Aug 2024 12:31:18 -0500 Subject: [PATCH] move ui_rand to cDialog --- src/dialogxml/dialogs/dialog.cpp | 1 + src/dialogxml/dialogs/dialog.hpp | 2 ++ src/mathutil.cpp | 1 - src/mathutil.hpp | 1 - 4 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dialogxml/dialogs/dialog.cpp b/src/dialogxml/dialogs/dialog.cpp index b74b8b5e..3f25744f 100644 --- a/src/dialogxml/dialogs/dialog.cpp +++ b/src/dialogxml/dialogs/dialog.cpp @@ -41,6 +41,7 @@ const short cDialog::BG_DARK = 5, cDialog::BG_LIGHT = 16; short cDialog::defaultBackground = cDialog::BG_DARK; cDialog* cDialog::topWindow = nullptr; void (*cDialog::redraw_everything)() = nullptr; +std::mt19937 cDialog::ui_rand; std::string cDialog::generateRandomString(){ // Not bothering to seed, because it doesn't actually matter if it's truly random. diff --git a/src/dialogxml/dialogs/dialog.hpp b/src/dialogxml/dialogs/dialog.hpp index d0def522..bd9e27af 100644 --- a/src/dialogxml/dialogs/dialog.hpp +++ b/src/dialogxml/dialogs/dialog.hpp @@ -20,6 +20,7 @@ #include #include #include +#include #include "ticpp.h" #include "dialogxml/keycodes.hpp" @@ -70,6 +71,7 @@ class cDialog { std::vector> tabOrder; static cDialog* topWindow; // Tracks the frontmost dialog. static bool initCalled; + static std::mt19937 ui_rand; public: static void (*redraw_everything)(); /// Performs essential startup initialization. Generally should not be called directly. diff --git a/src/mathutil.cpp b/src/mathutil.cpp index 5bd9e2f0..f3f93473 100644 --- a/src/mathutil.cpp +++ b/src/mathutil.cpp @@ -10,7 +10,6 @@ #include "mathutil.hpp" std::mt19937 game_rand; -std::mt19937 ui_rand; short get_ran (short times,short min,short max){ long int store; diff --git a/src/mathutil.hpp b/src/mathutil.hpp index f4877afc..f5cfea60 100644 --- a/src/mathutil.hpp +++ b/src/mathutil.hpp @@ -24,7 +24,6 @@ using std::abs; extern std::mt19937 game_rand; -extern std::mt19937 ui_rand; short get_ran(short times, short min, short max); short max(short a,short b);