Jelajahi Sumber

Merge pull request #44862 from Calinou/opensimplex-no-max-octaves-define

Use `static const int` instead of `#define` for OpenSimplexNoise octaves
Rémi Verschelde 4 tahun lalu
induk
melakukan
3e10962dbb
1 mengubah file dengan 5 tambahan dan 5 penghapusan
  1. 5 5
      modules/opensimplex/open_simplex_noise.h

+ 5 - 5
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;