LAB: Fix a regression related to random number generation, some renaming

This commit is contained in:
Strangerke 2015-12-14 12:40:19 +01:00 committed by Willem Jan Palenstijn
parent cbf4c876e5
commit 21e6f40301
7 changed files with 75 additions and 69 deletions

View file

@ -34,7 +34,7 @@
#include "lab/utils.h"
namespace Lab {
Utils::Utils(LabEngine *vm) : _vm(vm) {
Utils::Utils(LabEngine *vm) : _vm(vm), _rnd("lab") {
_dataBytesPerRow = 0;
}
@ -427,4 +427,10 @@ void Utils::setBytesPerRow(int num) {
_dataBytesPerRow = num;
}
uint16 Utils::getRandom(uint16 max) {
if (max > 1)
return _rnd.getRandomNumber(max - 1);
else
return 0;
}
} // End of namespace Lab