aboutsummaryrefslogtreecommitdiff
path: root/src/noise.cpp
AgeCommit message (Collapse)Author
2015-12-06Fix spelling of noise_thresholdJun Zhang
2015-11-01Fix Noise compiled under clang >= 3.7.x with -O2 or higherkwolekr
When compiled with optimizations, the most recent versions of clang seem to 'optimize' out a crucial "and %reg, 0x7FFFFFFF" instruction in noise2d(), probably because it somehow assumed the variable n would never become greater than that amount. Indeed, signed integer underflow is undefined behavior in C and C++, so while this optimization is "correct" in that sense, it breaks lots of existing code. Solved by changing n to an unsigned type, making behavior well-defined.
2015-08-12Fix Lua PcgRandomest31
Before, this lua code led to a crash: local pcg = PcgRandom(42) local value = pcg:next() This was because if you called s32 PcgRandom::range(min, max) with the minimum and maximum possible values for s32 integers (which the lua binding code did), u32 PcgRandom::range(bound) got called with 0 as the bound. The bound however is one above the maximum value, so 0 is a "special" value to pass to this function. This commit fixes the lua crash by assigning the RNG's full range to the bound 0, which is also fits to the "maximum is bound - 1" principle, as (u32)-1 is the maximum value in the u32 range.
2015-07-24Remove some old dead code. Fix some Clang warnings in SRP (ng->N... willLoic Blot
always evaluate to true.
2015-07-10Misc. minor fixeskwolekr
2015-05-17Noise: Fix interpolation at negative coordinateskwolekr
2015-05-16Add -Wsign-compare for Clang builds and fix some signed/unsigned compiler ↵kwolekr
warnings
2015-05-15Noise: Make buffer size parameters unsignedkwolekr
2015-04-29Fix MSVC compatibilitykwolekr
Make sure to include random unittests in android builds, too Use SWAP() macro Ensure that negative ranges are tested as well in random unittests
2015-04-27Noise: Fix PcgRandom::randNormalDist() when range contains negative numberskwolekr
This fixes an issue with erroneous float-to-int rounding that resulted in truncation toward 0, causing a biased distribution.
2015-04-27Replace PRNG assertions with PrngExceptionkwolekr
2015-04-21Noise: Add noise unittestskwolekr
Fix buffer size calculation for lacunarity < 1.0 Add guard against absurd noise parameters
2015-04-19Noise: Correct noise objects created with invalid dimensionskwolekr
2015-03-23Fix endianness inconsistency with PcgRandom::bytes()kwolekr
2015-03-22Fix some loose ends from 3993093fkwolekr
2015-03-22Add support for the PCG32 PRNG algo (and associated script APIs)kwolekr
2014-12-14Noise: Don't assume Noise is used for 2D unless gradientMap2D is actually calledkwolekr
2014-12-11Clean up Noise macroskwolekr
2014-12-10Noise: Automatically transform noise maps if neededkwolekr
2014-12-10Noise: Create a deep copy of NoiseParamskwolekr
2014-12-09Noise: Update Noise::resizeNoiseBuf to account for lacunarity not equal to 2kwolekr
2014-12-08Optimize noise implementationskwolekr
2014-12-07Add flags and lacunarity as new noise parameterskwolekr
Add 'absolute value' option to noise map functions Extend persistence modulation to 3D noise Extend 'eased' option to noise2d_perlin* functions Some noise.cpp formatting fixups
2014-11-29noise: Throw exception on noise allocation failurekwolekr
2014-11-12Add eased 3d point-value noise functionskwolekr
2014-11-08Add mgv5. New noise code, uses biome API. Eased 3d noise for terrain, caves, ↵paramat
blobs
2014-10-27Change license of noise implementation to Simplified BSDkwolekr
2014-10-27Add support for eased 3d noisekwolekr
2013-08-14Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl
2013-04-07Add Mapgen V7, reorganize biomeskwolekr
2013-02-26Fix most warnings, re-fix MSVC compile errorkwolekr
2013-02-24Update Copyright YearsSfan5
2013-02-24Change Minetest-c55 to MinetestPilzAdam
2013-02-06Fix and improve noise map functionskwolekr
2013-01-21Finish and clean up mapgen configurationkwolekr
2013-01-21Readded and optimized mapgen V6kwolekr
2013-01-21Cleaned & enhanced noise object managementkwolekr
2013-01-21Add initial Lua biomedef support, fixed biome selectionkwolekr
2013-01-21The new mapgen, noise functions, et al.kwolekr
2012-11-02Replace pow() with multiplikation to improve speedPilzAdam
2012-06-05Switch the license to be LGPLv2/later, with small parts still remaining as ↵Perttu Ahola
GPLv2/later, by agreement of major contributors
2011-06-26updated noise stuffPerttu Ahola
2011-06-25New map generator added (and SQLite, messed up the commits at that time...) ↵Perttu Ahola
(import from temporary git repo)
2011-04-26tested out and commented out some new stuff for the terrain generator, to be ↵Perttu Ahola
used in the future.
2011-03-02mapgen work-in-progressPerttu Ahola
2011-03-01mapgen tweakingPerttu Ahola
2011-02-28A third try on terrain generation. No trees yet.Perttu Ahola
2011-02-27fixed 3d noise and made 2d noise fasterPerttu Ahola
2011-02-263d noise stuffPerttu Ahola
2011-02-08made it to work with my windows compilerPerttu Ahola