Fix compile for 4.0. (At least for g++, will probably not work on other compilers for now)

This commit is contained in:
Relintai 2020-04-09 12:48:57 +02:00
parent ea3b34d972
commit f7aed39c06
3 changed files with 31 additions and 0 deletions

View File

@ -1,5 +1,11 @@
#include "fastnoise_noise_params.h"
#include "core/version.h"
#if VERSION_MAJOR >= 4
#define REAL FLOAT
#endif
void FastnoiseNoiseParams::setup_noise(Ref<FastNoise> noise) {
noise->set_seed(_seed);
noise->set_noise_type(_noise_type);

View File

@ -34,6 +34,16 @@
#include <algorithm>
#include <random>
#include "core/version.h"
#if VERSION_MAJOR >= 4
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
namespace fastnoise {
const FN_DECIMAL GRAD_X[] =
@ -2258,3 +2268,10 @@ void FastNoise::SingleGradientPerturb(unsigned char offset, FN_DECIMAL warpAmp,
}
} // namespace fastnoise
#if VERSION_MAJOR >= 4
#pragma GCC diagnostic pop
#endif

View File

@ -6,6 +6,14 @@
#include "core/ustring.h"
#include "core/version.h"
#if VERSION_MAJOR < 4
#include "core/pool_vector.h"
#else
typedef PackedInt64Array PoolIntArray;
#endif
typedef fastnoise::FastNoise _FastNoise;
class FastNoise : public Reference {