diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-01-01 22:26:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-01 22:26:50 +0100 |
commit | 3e10962dbb628b1a2a6e5c8d1aa4bb56c8b29d81 (patch) | |
tree | 70f9743c8ff364539701bf8fe2e8291acee1c451 /modules/opensimplex | |
parent | 2abe996414b8b551e69e29461de3ff1bcaf5a28f (diff) | |
parent | 7a65375b7a4e11a71cf8484e25a504d0f0434e1e (diff) | |
download | redot-engine-3e10962dbb628b1a2a6e5c8d1aa4bb56c8b29d81.tar.gz |
Merge pull request #44862 from Calinou/opensimplex-no-max-octaves-define
Use `static const int` instead of `#define` for OpenSimplexNoise octaves
Diffstat (limited to 'modules/opensimplex')
-rw-r--r-- | modules/opensimplex/open_simplex_noise.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/opensimplex/open_simplex_noise.h b/modules/opensimplex/open_simplex_noise.h index 3a524e0a9d..f18dd4d798 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; |