From f56bb35301836e56582a575a75864392a0177875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20P=2E=20Tjern=C3=B8?= Date: Mon, 2 Dec 2013 19:31:46 -0800 Subject: Fix line endings. WHAMMY. --- mp/src/mathlib/sparse_convolution_noise.cpp | 436 ++++++++++++++-------------- 1 file changed, 218 insertions(+), 218 deletions(-) (limited to 'mp/src/mathlib/sparse_convolution_noise.cpp') diff --git a/mp/src/mathlib/sparse_convolution_noise.cpp b/mp/src/mathlib/sparse_convolution_noise.cpp index 447c5292..dbf19b60 100644 --- a/mp/src/mathlib/sparse_convolution_noise.cpp +++ b/mp/src/mathlib/sparse_convolution_noise.cpp @@ -1,218 +1,218 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// -// -// Purpose: noise() primitives. -// -//=====================================================================================// - -#include -#include "basetypes.h" -#include -#include "tier0/dbg.h" -#include "mathlib/mathlib.h" -#include "mathlib/vector.h" -#include "mathlib/noise.h" - -// memdbgon must be the last include file in a .cpp file!!! -#include "tier0/memdbgon.h" - -// generate high quality noise based upon "sparse convolution". HIgher quality than perlin noise, -// and no direcitonal artifacts. - -#include "noisedata.h" - -#define N_IMPULSES_PER_CELL 5 -#define NORMALIZING_FACTOR 1.0 - -//(0.5/N_IMPULSES_PER_CELL) - -static inline int LatticeCoord(float x) -{ - return ((int) floor(x)) & 0xff; -} - -static inline int Hash4D(int ix, int iy, int iz, int idx) -{ - int ret=perm_a[ix]; - ret=perm_b[(ret+iy) & 0xff]; - ret=perm_c[(ret+iz) & 0xff]; - ret=perm_d[(ret+idx) & 0xff]; - return ret; -} - -#define SQ(x) ((x)*(x)) - -static float CellNoise( int ix, int iy, int iz, float xfrac, float yfrac, float zfrac, - float (*pNoiseShapeFunction)(float) ) -{ - float ret=0; - for(int idx=0;idx +#include "basetypes.h" +#include +#include "tier0/dbg.h" +#include "mathlib/mathlib.h" +#include "mathlib/vector.h" +#include "mathlib/noise.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +// generate high quality noise based upon "sparse convolution". HIgher quality than perlin noise, +// and no direcitonal artifacts. + +#include "noisedata.h" + +#define N_IMPULSES_PER_CELL 5 +#define NORMALIZING_FACTOR 1.0 + +//(0.5/N_IMPULSES_PER_CELL) + +static inline int LatticeCoord(float x) +{ + return ((int) floor(x)) & 0xff; +} + +static inline int Hash4D(int ix, int iy, int iz, int idx) +{ + int ret=perm_a[ix]; + ret=perm_b[(ret+iy) & 0xff]; + ret=perm_c[(ret+iz) & 0xff]; + ret=perm_d[(ret+idx) & 0xff]; + return ret; +} + +#define SQ(x) ((x)*(x)) + +static float CellNoise( int ix, int iy, int iz, float xfrac, float yfrac, float zfrac, + float (*pNoiseShapeFunction)(float) ) +{ + float ret=0; + for(int idx=0;idx