Auburn / FastNoiseLite

Fast Portable Noise Library - C# C++ C Java HLSL GLSL JavaScript Rust Go
http://auburn.github.io/FastNoiseLite/
MIT License
2.79k stars 327 forks source link

Incorrect class initialization #12

Closed sevstels closed 7 years ago

sevstels commented 7 years ago

Dear author. For successful assemble our code with different compilers, you should do class member initialization inside in the class constructor, or use: class_ini() call. Presently, code have "indian style".

.\Source\Noise_Generator\FastNoise.cpp ".\Source\Noise_Generator\FastNoise.h", line 220: cc0321: error: data member initializer is not allowed int m_seed = 1337; ^

".\Source\Noise_Generator\FastNoise.h", line 221: cc0321: error: data member initializer is not allowed FN_DECIMAL m_frequency = FN_DECIMAL(0.01); ^

".\Source\Noise_Generator\FastNoise.h", line 222: cc0321: error: data member initializer is not allowed Interp m_interp = Quintic; ^

".\Source\Noise_Generator\FastNoise.h", line 223: cc0321: error: data member initializer is not allowed NoiseType m_noiseType = Simplex; ^

".\Source\Noise_Generator\FastNoise.h", line 225: cc0321: error: data member initializer is not allowed int m_octaves = 3; ^

".\Source\Noise_Generator\FastNoise.h", line 226: cc0321: error: data member initializer is not allowed FN_DECIMAL m_lacunarity = FN_DECIMAL(2); ^

".\Source\Noise_Generator\FastNoise.h", line 227: cc0321: error: data member initializer is not allowed FN_DECIMAL m_gain = FN_DECIMAL(0.5); ^

".\Source\Noise_Generator\FastNoise.h", line 228: cc0321: error: data member initializer is not allowed FractalType m_fractalType = FBM; ^

".\Source\Noise_Generator\FastNoise.h", line 231: cc0321: error: data member initializer is not allowed CellularDistanceFunction m_cellularDistanceFunction = Euclidean; ^

".\Source\Noise_Generator\FastNoise.h", line 232: cc0321: error: data member initializer is not allowed CellularReturnType m_cellularReturnType = CellValue; ^

".\Source\Noise_Generator\FastNoise.h", line 233: cc0321: error: data member initializer is not allowed FastNoise* m_cellularNoiseLookup = nullptr; ^

".\Source\Noise_Generator\FastNoise.h", line 234: cc0321: error: data member initializer is not allowed int m_cellularDistanceIndex0 = 0; ^

".\Source\Noise_Generator\FastNoise.h", line 235: cc0321: error: data member initializer is not allowed int m_cellularDistanceIndex1 = 1; ^

".\Source\Noise_Generator\FastNoise.h", line 236: cc0321: error: data member initializer is not allowed FN_DECIMAL m_cellularJitter = FN_DECIMAL(0.45); ^

".\Source\Noise_Generator\FastNoise.h", line 238: cc0321: error: data member initializer is not allowed FN_DECIMAL m_gradientPerturbAmp = FN_DECIMAL(1); ^

15 errors detected in the compilation of ".\Source\Noise_Generator\FastNoise.cpp". Compilation terminated. cc3089: fatal error: Compilation failed Tool failed with exit/exception code: 1. Build was unsuccessful.

Auburn commented 7 years ago

You need to compile using c++11 standard, this supports initialising variables at the definition.

sevstels commented 7 years ago

Apologize for my small prompt, not all comilers supported this mode. Should try write correct code, without perversion... ;)