fix calls to GetRandomValue
This commit is contained in:
parent
9057c47904
commit
0bfc37450c
2 changed files with 58 additions and 58 deletions
|
|
@ -232,7 +232,7 @@ int main(void)
|
|||
for (int i = 0; i < TEXT_MAX_LAYERS; ++i)
|
||||
{
|
||||
multi[i] = GenerateRandomColor(0.5f, 0.8f);
|
||||
multi[i].a = GetRandomValue(0, 255);
|
||||
multi[i].a = GetRandomRangeInt(0, 255);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -688,7 +688,7 @@ static Vector3 MeasureTextWave3D(Font font, const char* text, float fontSize, fl
|
|||
static Color GenerateRandomColor(float s, float v)
|
||||
{
|
||||
const float Phi = 0.618033988749895f; // Golden ratio conjugate
|
||||
float h = (float)GetRandomValue(0, 360);
|
||||
float h = (float)GetRandomRangeInt(0, 360);
|
||||
h = fmodf((h + h*Phi), 360.0f);
|
||||
return ColorFromHSV(h, s, v);
|
||||
}
|
||||
|
|
@ -313,18 +313,18 @@ int main(void)
|
|||
static void RandomizeEmoji(void)
|
||||
{
|
||||
hovered = selected = -1;
|
||||
int start = GetRandomValue(45, 360);
|
||||
int start = GetRandomRangeInt(45, 360);
|
||||
|
||||
for (int i = 0; i < SIZEOF(emoji); ++i)
|
||||
{
|
||||
// 0-179 emoji codepoints (from emoji char array) each 4bytes + null char
|
||||
emoji[i].index = GetRandomValue(0, 179)*5;
|
||||
emoji[i].index = GetRandomRangeInt(0, 179)*5;
|
||||
|
||||
// Generate a random color for this emoji
|
||||
emoji[i].color = Fade(ColorFromHSV((float)((start*(i + 1))%360), 0.6f, 0.85f), 0.8f);
|
||||
|
||||
// Set a random message for this emoji
|
||||
emoji[i].message = GetRandomValue(0, SIZEOF(messages) - 1);
|
||||
emoji[i].message = GetRandomRangeInt(0, SIZEOF(messages) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue