Mode | Name | Size | |
-rw-r--r-- | Bildschirmfoto_2016-09-17_09-43-29.png | 9345 | logplain |
-rw-r--r-- | Bildschirmfoto_2016-09-17_09-45-38.png | 16695 | logplain |
-rw-r--r-- | Bildschirmfoto_2016-09-17_09-46-21.png | 18834 | logplain |
-rw-r--r-- | Bildschirmfoto_2016-09-17_09-48-54.png | 14032 | logplain |
-rw-r--r-- | Bildschirmfoto_2016-09-17_09-50-27.png | 4246 | logplain |
-rw-r--r-- | Bildschirmfoto_2016-09-17_09-51-02.png | 3704 | logplain |
-rw-r--r-- | Bildschirmfoto_2016-09-17_09-52-17.png | 13788 | logplain |
-rw-r--r-- | Bildschirmfoto_2016-09-17_09-52-40.png | 13889 | logplain |
-rw-r--r-- | Bildschirmfoto_2016-09-17_09-53-01.png | 15473 | logplain |
-rw-r--r-- | Bildschirmfoto_2016-09-17_09-56-34.png | 2789 | logplain |
-rw-r--r-- | Bildschirmfoto_2016-09-17_09-58-20.png | 10375 | logplain |
-rw-r--r-- | Bildschirmfoto_2016-09-17_09-58-39.png | 6880 | logplain |
-rw-r--r-- | /*
* Minetest
* Copyright (C) 2010-2014 celeron55, Perttu Ahola <celeron55@gmail.com>
* Copyright (C) 2010-2014 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NOISE_HEADER
#define NOISE_HEADER
#include "irr_v3d.h"
#include "exceptions.h"
#include "util/string.h"
extern FlagDesc flagdesc_noiseparams[];
// Note: this class is not polymorphic so that its high level of
// optimizability may be preserved in the common use case
class PseudoRandom {
public:
const static u32 RANDOM_RANGE = 32767;
inline PseudoRandom(int seed=0):
m_next(seed)
{
}
inline void seed(int seed)
{
m_next = seed;
}
inline int next()
{
m_next = m_next * 1103515245 + 12345;
return (unsigned)(m_next / 65536) % (RANDOM_RANGE + 1);
}
inline int range(int min, int max)
{
if (max < min)
throw PrngException("Invalid range (max < min)");
/*
Here, we ensure the range is not too large relative to RANDOM_MAX,
as otherwise the effects of bias would become noticable. Unlike
PcgRandom, we cannot modify this RNG's range as it would change the
output of this RNG for reverse compatibility.
*/
if ((u32)(max - min) > (RANDOM_RANGE + 1) / 10)
throw PrngException("Range too large");
return (next() % (max - min + 1)) + min;
}
private:
int m_next;
};
class PcgRandom {
public:
const static s32 RANDOM_MIN = -0x7fffffff - 1;
const static s32 RANDOM_MAX = 0x7fffffff;
const static u32 RANDOM_RANGE = 0xffffffff;
PcgRandom(u64 state=0x853c49e6748fea9bULL, u64 seq=0xda3e39cb94b95bdbULL);
void seed(u64 state, u64 seq=0xda3e39cb94b95bdbULL);
u32 next();
u32 range(u32 bound);
s32 range(s32 min, s32 max);
void bytes-rw-r--r-- | screenshot_20161203_230648.png | 555494 | logplain |
-rw-r--r-- | screenshot_20161203_231622.png | 108256 | logplain |
-rw-r--r-- | screenshot_20161203_232335.png | 1607786 | logplain |
-rw-r--r-- | screenshot_20161203_232545.png | 1527310 | logplain |