ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/noise.h
(Generate patch)

Comparing deliantra/server/include/noise.h (file contents):
Revision 1.16 by root, Wed Nov 28 17:32:51 2012 UTC vs.
Revision 1.19 by root, Wed Nov 16 22:14:05 2016 UTC

21 */ 21 */
22 22
23#ifndef NOISE_H_ 23#ifndef NOISE_H_
24#define NOISE_H_ 24#define NOISE_H_
25 25
26#if 0 // blitz++0.09
26#include <string.h> // possible workaround for tinyvec using memcpy without including string.h 27#include <string.h> // workaround for tinyvec using memcpy without including string.h
28#include <cstdlib> // workaround for tinyvec using labs without including cstdlib
27#include <blitz/tinyvec.h> 29#include <blitz/tinyvec.h>
28#include <blitz/tinyvec-et.h> 30#include <blitz/tinyvec-et.h>
29
30#include "global.h"
31
32typedef blitz::TinyVector<float,2> vec2d; 31typedef blitz::TinyVector<float,2> vec2d;
33typedef blitz::TinyVector<float,3> vec3d; 32typedef blitz::TinyVector<float,3> vec3d;
33#else
34
35// blitz++ 0.10 - not working
36#include <blitz/array.h>
37#include <blitz/tinyvec2.h>
38#include <blitz/tinyvec2.cc>
39
40template<typename T, int length>
41struct vecnd
42: blitz::TinyVector<T, length>
43{
44 static const int numElements = length;
45 using blitz::TinyVector<T, length>::TinyVector;
46};
47
48typedef vecnd<float,2> vec2d;
49typedef vecnd<float,3> vec3d;
50
51#endif
52
53#include "global.h"
34 54
35vec2d 55vec2d
36inline floor (vec2d v) 56inline floor (vec2d v)
37{ 57{
38 return vec2d (fastfloor (v[0]), fastfloor (v[1])); 58 return vec2d (fastfloor (v[0]), fastfloor (v[1]));
219 239
220 frac_gen (int octaves = 3, value_t lacunarity = 2, value_t hurst_expo = .5, uint32_t seed = 0); 240 frac_gen (int octaves = 3, value_t lacunarity = 2, value_t hurst_expo = .5, uint32_t seed = 0);
221 241
222 value_t noise (vec_t P, uint32_t seed = 0) func_pure 242 value_t noise (vec_t P, uint32_t seed = 0) func_pure
223 { 243 {
224 return operator() (P, seed); 244 return this->operator() (P, seed);
225 } 245 }
226 246
227 value_t fBm (vec_t P) func_pure; 247 value_t fBm (vec_t P) func_pure;
228 value_t turbulence (vec_t P) func_pure; 248 value_t turbulence (vec_t P) func_pure;
229 value_t multifractal (vec_t P, value_t offset = 1) func_pure; 249 value_t multifractal (vec_t P, value_t offset = 1) func_pure;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines