You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Fix undeclared identifier error in lightmapper_cpu.cpp
Compiling with latest clang on macOS produced this error: use of undeclared identifier 'rand'. Fixes godotengine/godot#45342 This file is not present in 4.0/master.
This commit is contained in:
@@ -777,7 +777,7 @@ void LightmapperCPU::_compute_direct_light(uint32_t p_idx, void *r_lightmap) {
|
|||||||
|
|
||||||
_ALWAYS_INLINE_ float uniform_rand() {
|
_ALWAYS_INLINE_ float uniform_rand() {
|
||||||
/* Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs" */
|
/* 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 << 13;
|
||||||
state ^= state >> 17;
|
state ^= state >> 17;
|
||||||
state ^= state << 5;
|
state ^= state << 5;
|
||||||
|
|||||||
Reference in New Issue
Block a user