summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-01-01 21:18:20 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-01-01 21:32:50 +0100
commit7a65375b7a4e11a71cf8484e25a504d0f0434e1e (patch)
tree592217419a6ec92ef70372024b48bb177ec9b9a0 /modules
parenta6b869988f4427fe2eb746f3f3776697258f3dd5 (diff)
Use `static const int` instead of `#define` for OpenSimplexNoise octaves
This closes #44860.
Diffstat (limited to 'modules')
-rw-r--r--modules/opensimplex/open_simplex_noise.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/opensimplex/open_simplex_noise.h b/modules/opensimplex/open_simplex_noise.h
index d9bf05115d..838b535ba1 100644
--- a/modules/opensimplex/open_simplex_noise.h
+++ b/modules/opensimplex/open_simplex_noise.h
@@ -37,15 +37,15 @@
#include "thirdparty/misc/open-simplex-noise.h"
-// The maximum number of octaves allowed. Note that these are statically allocated.
-// Higher values become exponentially slower, so this shouldn't be set too high
-// to avoid freezing the editor for long periods of time.
-#define MAX_OCTAVES 9
-
class OpenSimplexNoise : public Resource {
GDCLASS(OpenSimplexNoise, Resource);
OBJ_SAVE_TYPE(OpenSimplexNoise);
+ // The maximum number of octaves allowed. Note that these are statically allocated.
+ // Higher values become exponentially slower, so this shouldn't be set too high
+ // to avoid freezing the editor for long periods of time.
+ static const int MAX_OCTAVES = 9;
+
osn_context contexts[MAX_OCTAVES];
int seed;