Skip to content

Commit

Permalink
move ui_rand to cDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
NQNStudios authored and CelticMinstrel committed Aug 8, 2024
1 parent fc12092 commit f01fdb7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/dialogxml/dialogs/dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions src/dialogxml/dialogs/dialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <exception>
#include <functional>
#include <deque>
#include <random>

#include "ticpp.h"
#include "dialogxml/keycodes.hpp"
Expand Down Expand Up @@ -70,6 +71,7 @@ class cDialog {
std::vector<std::pair<std::string,cTextField*>> 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.
Expand Down
1 change: 0 additions & 1 deletion src/mathutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/mathutil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f01fdb7

Please sign in to comment.