Use static const int instead of #define for OpenSimplexNoise octaves

This closes #44860.

(cherry picked from commit 7a65375b7a)
This commit is contained in:
Hugo Locurcio 2021-01-01 21:18:20 +01:00 committed by Rémi Verschelde
parent bc564cd661
commit e35f17d33d
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -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;