mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-15 20:10:20 +02:00
Merge pull request #676 from birarda/master
make randIntInRange and randomColorValue inclusive on max side
This commit is contained in:
commit
dc0b4d3e99
2 changed files with 3 additions and 3 deletions
|
@ -434,7 +434,7 @@ void sendDanceFloor() {
|
|||
for (int i = 0; i < DANCE_FLOOR_WIDTH; i++) {
|
||||
for (int j = 0; j < DANCE_FLOOR_LENGTH; j++) {
|
||||
|
||||
int randomColorIndex = randIntInRange( -(DANCE_FLOOR_COLORS), (DANCE_FLOOR_COLORS + 1));
|
||||
int randomColorIndex = randIntInRange(-DANCE_FLOOR_COLORS, DANCE_FLOOR_COLORS);
|
||||
::danceFloorColors[i][j] = randomColorIndex;
|
||||
::danceFloorLights[i][j] = ::danceFloorPosition +
|
||||
glm::vec3(i * DANCE_FLOOR_LIGHT_SIZE, 0, j * DANCE_FLOOR_LIGHT_SIZE);
|
||||
|
|
|
@ -40,7 +40,7 @@ float randFloat () {
|
|||
}
|
||||
|
||||
int randIntInRange (int min, int max) {
|
||||
return min + (rand() % (max - min));
|
||||
return min + (rand() % ((max + 1) - min));
|
||||
}
|
||||
|
||||
float randFloatInRange (float min,float max) {
|
||||
|
@ -48,7 +48,7 @@ float randFloatInRange (float min,float max) {
|
|||
}
|
||||
|
||||
unsigned char randomColorValue(int miniumum) {
|
||||
return miniumum + (rand() % (255 - miniumum));
|
||||
return miniumum + (rand() % (256 - miniumum));
|
||||
}
|
||||
|
||||
bool randomBoolean() {
|
||||
|
|
Loading…
Reference in a new issue