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

Method getRand

Demos/Demo_Gui/InformationWindow.cpp:33–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 }
32
33 int InformationWindow::getRand(int _min, int _max)
34 {
35 if (_max < _min)
36 std::swap(_max, _min);
37 int range = _max - _min;
38 if (range == 0)
39 return 0;
40 int result = ::rand() % range;
41 if (result < 0)
42 result = -result;
43 return _min + result;
44 }
45
46 void InformationWindow::notifyFrameStart(float _time)
47 {

Callers

nothing calls this directly

Calls 1

swapFunction · 0.50

Tested by

no test coverage detected