MCPcopy Create free account
hub / github.com/MyGUI/mygui / getRand

Method getRand

Demos/Demo_Gui/ColourWindow.cpp:12–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10{
11
12 int ColourWindow::getRand(int _min, int _max)
13 {
14 if (_max < _min)
15 std::swap(_max, _min);
16 int range = _max - _min;
17 if (range == 0)
18 return 0;
19 int result = ::rand() % range;
20 if (result < 0)
21 result = -result;
22 return _min + result;
23 }
24
25 ColourWindow::ColourWindow(MyGUI::Widget* _parent) :
26 BaseLayout("ColourWindow.layout", _parent)

Callers

nothing calls this directly

Calls 1

swapFunction · 0.50

Tested by

no test coverage detected