Merge pull request #45353 from asmaloney/fix-lightmapper_cpu-compile-error

[3.2] Fix undeclared identifier error (rand) in lightmapper_cpu
This commit is contained in:
Rémi Verschelde 2021-02-02 12:35:42 +01:00 committed by GitHub
commit 07f169af72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -777,7 +777,7 @@ void LightmapperCPU::_compute_direct_light(uint32_t p_idx, void *r_lightmap) {
_ALWAYS_INLINE_ float uniform_rand() {
/* Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs" */
static thread_local uint32_t state = rand();
static thread_local uint32_t state = Math::rand();
state ^= state << 13;
state ^= state >> 17;
state ^= state << 5;